@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,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-avatar-dicebear-1UABT2KS.js","assets/rolldown-runtime-aKtaBQYM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{t as i}from"./cn-0WouolD0.js";import{i as a,l as o}from"./locale-store-lIXD1FMw.js";import{t as s}from"./loopi-CNtmi9FU.js";var c=e(t(),1),l=new Map,u=`xopc-agent-avatar-updated`;function d(e){let t=(l.get(e)??0)+1;return l.set(e,t),typeof window<`u`&&window.dispatchEvent(new CustomEvent(u,{detail:{agentId:e}})),t}function f(e){return l.get(e)??0}var p=`xopc:custom`,m=`xopc:dicebear:`,h=[`adventurer`,`bottts`,`lorelei`,`thumbs`,`fun-emoji`];function g(e){return h.includes(e)}function _(e,t){return`${m}${e}:${t}`}function v(e){if(!e.startsWith(m))return null;let t=e.slice(14),n=t.indexOf(`:`);if(n<=0)return null;let r=t.slice(0,n),i=t.slice(n+1);return!g(r)||!i.trim()?null:{styleId:r,seed:i}}var y=n();function b(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function x(e,t=128){let n=b(e)%360,r=(e.trim().charAt(0)||`A`).toUpperCase(),i=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 ${t} ${t}"><rect width="100%" height="100%" rx="${t/2}" fill="hsl(${n} 58% 42%)"/><text x="50%" y="54%" text-anchor="middle" dominant-baseline="middle" font-family="Inter, system-ui, sans-serif" font-size="${Math.round(t*.42)}" font-weight="700" fill="white">${r}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`}function S(e,t,n,r){let i=t?.trim()??``,o=x(e,n);if(i.startsWith(`xopc:loopi:`)){let e=i.slice(11);if(e===`idle`||e===`listen`||e===`curious`||e===`care`)return{kind:`loopi`,mood:e}}if(!i)return{kind:`dicebear`,styleId:`adventurer`,seed:e,fallbackSrc:o};if(i===`xopc:custom`){let t=a(`/api/agents/${encodeURIComponent(e)}/avatar`),n=new URLSearchParams;r>0&&n.set(`v`,String(r));let i=n.toString();return{kind:`authenticated`,url:i?`${t}?${i}`:t,fallbackSrc:o}}if(/^https?:\/\//i.test(i))return{kind:`sync`,src:i};let s=v(i);return s?{kind:`dicebear`,styleId:s.styleId,seed:s.seed,fallbackSrc:o}:{kind:`dicebear`,styleId:`adventurer`,seed:e,fallbackSrc:o}}function C(e){let t=o(e=>e.conversationId),n=e.token===void 0?t:e.token,{agentId:a,avatar:l,size:d=44}=e,[,p]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=e=>{e.detail?.agentId===a&&p(e=>e+1)};return window.addEventListener(u,e),()=>window.removeEventListener(u,e)},[a]);let m=f(a),h=(0,c.useMemo)(()=>S(a,l,d,m),[a,l,n,d,m]),g=h.kind===`sync`?h.src:h.kind===`loopi`?x(a,d):h.fallbackSrc,[_,v]=(0,c.useState)(g);return(0,c.useEffect)(()=>{v(g)},[g]),(0,c.useEffect)(()=>{if(h.kind!==`authenticated`||(v(h.fallbackSrc),!n))return;let e=new AbortController,t;return fetch(h.url,{credentials:`same-origin`,signal:e.signal,redirect:`error`}).then(async n=>{if(!n.ok)return;let r=await n.blob();e.signal.aborted||(t=URL.createObjectURL(r),v(t))}).catch(()=>{}),()=>{e.abort(),t&&URL.revokeObjectURL(t)}},[h,n]),(0,c.useEffect)(()=>{if(h.kind!==`dicebear`)return;let e=!1;return r(async()=>{let{dicebearToDataUri:e}=await import(`./agent-avatar-dicebear-1UABT2KS.js`);return{dicebearToDataUri:e}},__vite__mapDeps([0,1])).then(({dicebearToDataUri:t})=>{e||v(t(h.styleId,h.seed,d))}).catch(()=>{e||v(h.fallbackSrc)}),()=>{e=!0}},[h,d]),h.kind===`loopi`?(0,y.jsx)(`span`,{className:i(`inline-flex items-center justify-center rounded-full bg-surface-hover`,e.className),style:{width:d,height:d},children:(0,y.jsx)(s,{variant:`avatar`,mood:h.mood,className:`size-full`})}):(0,y.jsx)(`img`,{src:_,alt:``,width:d,height:d,className:i(`rounded-full object-cover bg-surface-hover`,e.className),draggable:!1,onError:()=>{v(x(a,d))}})}export{g as a,_ as i,h as n,v as o,p as r,d as s,C as t};
|
|
@@ -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}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as a}from"./circle-check-C23XjkUj.js";import{t as o}from"./gauge-C78eD2BA.js";import{t as s}from"./list-checks-BbsExAoq.js";import{t as c}from"./puzzle-BptcPjKI.js";import{t as ee}from"./search-DA7gz22f.js";import{t as l}from"./shield-check-BU58siTV.js";import{t as te}from"./sliders-horizontal-DqsYor6I.js";import{t as u}from"./cn-0WouolD0.js";import{l as d,n as f}from"./locale-store-lIXD1FMw.js";import{i as p}from"./vendor-swr-CdRzEUwF.js";import{t as ne}from"./button-CnRSIP6m.js";import{t as m}from"./skeleton-BI5TyibZ.js";import{n as h,r as g}from"./cloud-credits-B-nbtkqv.js";import{t as _}from"./electron-env-DHOGevH3.js";import{t as re}from"./sliding-tab-list-DuQyViqe.js";import{t as v}from"./skill-list-api-BzlKXPsE.js";import{n as y}from"./settings-mode-store-CBsJ-Qg2.js";import{n as ie,t as b}from"./global-defaults-api-CINf-C6a.js";import{t as ae}from"./settings-advanced-section-BqoVSko2.js";import{t as x}from"./number-input-El7Szeln.js";import{n as oe,t as se}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{n as S,t as C}from"./use-autosave-Cs2Ga_Y_.js";var ce=n(),w=e(t(),1),T=r(),E=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function D(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function le({draft:e,setDraft:t,zh:n}){let[r,i]=(0,w.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?h(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,w.useState)(!1);return(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,T.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${E} mt-2`,onChange:n=>{let r=n.target.value;i(r);try{let n=r===``?void 0:g(r);if(n===`0`||n&&n.length>15)throw Error(`Invalid limit`);o(!1),t({...e,runtime:{...e.runtime,cloudCreditLimitPerRunMicro:n}})}catch{o(!0)}},onBlur:()=>{a&&i(e.runtime.cloudCreditLimitPerRunMicro?h(e.runtime.cloudCreditLimitPerRunMicro):``),o(!1)}}),(0,T.jsx)(`span`,{className:`mt-2 block font-normal ${a?`text-danger`:`text-fg-subtle`}`,children:a?n?`请输入大于零、最多四位小数的 Credits。无效输入不会保存。`:`Enter positive Credits with up to four decimals. Invalid input is not saved.`:n?`模型、图片和文件语音调用共享上限;不支持实时语音或 Cloud 电脑控制,不包含运行前后的后台调用。达到上限后停止,调整后需手动继续。`:`Shared by model, image and file audio calls during a run. Does not support realtime voice or Cloud computer use; excludes background calls outside the run. Stops at the limit; continue manually after adjusting it.`})]})}function O(e){let t=(0,ce.c)(104),{draft:n,setDraft:r,zh:i}=e,a=i?`费用控制`:`Spending control`,o;t[0]===a?o=t[1]:(o=(0,T.jsx)(`h2`,{className:`mb-4 text-base font-semibold text-fg`,children:a}),t[0]=a,t[1]=o);let s;t[2]!==n||t[3]!==r||t[4]!==i?(s=(0,T.jsx)(le,{draft:n,setDraft:r,zh:i}),t[2]=n,t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;t[6]!==o||t[7]!==s?(c=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let ee=i?`执行与缓存策略`:`Execution and cache policy`,l=i?`轮数:${n.runtime.maxTurns??`默认`} · 超时:${n.runtime.timeoutMs??`默认`} · 缓存:${n.runtime.promptCache?.mode??`默认`} · Codemode:${n.runtime.codemode?.enabled?`开启`:`关闭`}`:`Turns: ${n.runtime.maxTurns??`default`} · Timeout: ${n.runtime.timeoutMs??`default`} · Cache: ${n.runtime.promptCache?.mode??`default`} · Codemode: ${n.runtime.codemode?.enabled?`on`:`off`}`,te=n.runtime.codemode?.enabled??!1,u;t[9]!==n||t[10]!==r?(u=e=>r({...n,runtime:{...n.runtime,codemode:{...n.runtime.codemode,enabled:e.target.checked}}}),t[9]=n,t[10]=r,t[11]=u):u=t[11];let d;t[12]!==te||t[13]!==u?(d=(0,T.jsx)(`input`,{type:`checkbox`,checked:te,onChange:u,className:`mt-1 size-4 accent-[var(--color-accent)]`}),t[12]=te,t[13]=u,t[14]=d):d=t[14];let f=i?`Codemode 读取试点`:`Codemode read pilot`,p;t[15]===f?p=t[16]:(p=(0,T.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:f}),t[15]=f,t[16]=p);let m=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,h;t[17]===m?h=t[18]:(h=(0,T.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:m}),t[17]=m,t[18]=h);let g;t[19]!==p||t[20]!==h?(g=(0,T.jsxs)(`span`,{children:[p,h]}),t[19]=p,t[20]=h,t[21]=g):g=t[21];let _;t[22]!==g||t[23]!==d?(_=(0,T.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,T.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[d,g]})}),t[22]=g,t[23]=d,t[24]=_):_=t[24];let v=i?`执行限制`:`Execution limits`,y;t[25]===v?y=t[26]:(y=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:v}),t[25]=v,t[26]=y);let ie=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,b;t[27]===ie?b=t[28]:(b=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ie}),t[27]=ie,t[28]=b);let oe=i?`每次运行最多轮数`:`Maximum turns per run`,se=n.runtime.maxTurns??``,S=i?`系统默认`:`System default`,C;t[29]!==n||t[30]!==r?(C=e=>r({...n,runtime:{...n.runtime,maxTurns:D(e.target.value)}}),t[29]=n,t[30]=r,t[31]=C):C=t[31];let w;t[32]!==se||t[33]!==S||t[34]!==C?(w=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:se,placeholder:S,onChange:C,className:`${E} mt-2`}),t[32]=se,t[33]=S,t[34]=C,t[35]=w):w=t[35];let O;t[36]!==oe||t[37]!==w?(O=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[oe,w]}),t[36]=oe,t[37]=w,t[38]=O):O=t[38];let k=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,A=n.runtime.timeoutMs??``,ue=i?`系统默认`:`System default`,j;t[39]!==n||t[40]!==r?(j=e=>r({...n,runtime:{...n.runtime,timeoutMs:D(e.target.value)}}),t[39]=n,t[40]=r,t[41]=j):j=t[41];let M;t[42]!==A||t[43]!==ue||t[44]!==j?(M=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:A,placeholder:ue,onChange:j,className:`${E} mt-2`}),t[42]=A,t[43]=ue,t[44]=j,t[45]=M):M=t[45];let N;t[46]!==k||t[47]!==M?(N=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[k,M]}),t[46]=k,t[47]=M,t[48]=N):N=t[48];let de=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,P=n.runtime.maxToolFailuresPerTurn??``,fe=i?`系统默认`:`System default`,F;t[49]!==n||t[50]!==r?(F=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:D(e.target.value)}}),t[49]=n,t[50]=r,t[51]=F):F=t[51];let pe;t[52]!==P||t[53]!==fe||t[54]!==F?(pe=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:P,placeholder:fe,onChange:F,className:`${E} mt-2`}),t[52]=P,t[53]=fe,t[54]=F,t[55]=pe):pe=t[55];let I;t[56]!==de||t[57]!==pe?(I=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[de,pe]}),t[56]=de,t[57]=pe,t[58]=I):I=t[58];let L;t[59]!==O||t[60]!==N||t[61]!==I?(L=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[O,N,I]}),t[59]=O,t[60]=N,t[61]=I,t[62]=L):L=t[62];let R;t[63]!==y||t[64]!==b||t[65]!==L?(R=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[y,b,L]}),t[63]=y,t[64]=b,t[65]=L,t[66]=R):R=t[66];let z=i?`提示词缓存`:`Prompt cache`,B;t[67]===z?B=t[68]:(B=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[67]=z,t[68]=B);let V=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,H;t[69]===V?H=t[70]:(H=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:V}),t[69]=V,t[70]=H);let U=i?`缓存模式`:`Cache mode`,W;t[71]===U?W=t[72]:(W=(0,T.jsx)(`span`,{children:U}),t[71]=U,t[72]=W);let G=i?`缓存模式`:`Cache mode`,K;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(K=[`auto`,`off`],t[73]=K):K=t[73];let q;t[74]!==n||t[75]!==r||t[76]!==i?(q=K.map(e=>(0,T.jsx)(ne,{"aria-pressed":n.runtime.promptCache?.mode===e,variant:n.runtime.promptCache?.mode===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:e,lifetime:n.runtime.promptCache?.lifetime??`short`}}}),children:e===`auto`?i?`自动`:`Automatic`:i?`关闭`:`Off`},e)),t[74]=n,t[75]=r,t[76]=i,t[77]=q):q=t[77];let J;t[78]!==G||t[79]!==q?(J=(0,T.jsx)(re,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":G,children:q}),t[78]=G,t[79]=q,t[80]=J):J=t[80];let Y;t[81]!==W||t[82]!==J?(Y=(0,T.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[W,J]}),t[81]=W,t[82]=J,t[83]=Y):Y=t[83];let me;t[84]!==n||t[85]!==r||t[86]!==i?(me=n.runtime.promptCache?.mode===`auto`?(0,T.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,T.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,T.jsx)(re,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`缓存周期`:`Cache lifetime`,children:[`short`,`long`].map(e=>(0,T.jsx)(ne,{"aria-pressed":n.runtime.promptCache?.lifetime===e,variant:n.runtime.promptCache?.lifetime===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:`auto`,lifetime:e}}}),children:e===`short`?i?`短期`:`Short`:i?`长期`:`Long`},e))})]}):null,t[84]=n,t[85]=r,t[86]=i,t[87]=me):me=t[87];let X;t[88]!==Y||t[89]!==me?(X=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[Y,me]}),t[88]=Y,t[89]=me,t[90]=X):X=t[90];let Z;t[91]!==B||t[92]!==H||t[93]!==X?(Z=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[B,H,X]}),t[91]=B,t[92]=H,t[93]=X,t[94]=Z):Z=t[94];let Q;t[95]!==_||t[96]!==R||t[97]!==ee||t[98]!==Z||t[99]!==l?(Q=(0,T.jsxs)(ae,{title:ee,summary:l,children:[_,R,Z]}),t[95]=_,t[96]=R,t[97]=ee,t[98]=Z,t[99]=l,t[100]=Q):Q=t[100];let $;return t[101]!==c||t[102]!==Q?($=(0,T.jsxs)(`div`,{className:`space-y-5`,children:[c,Q]}),t[101]=c,t[102]=Q,t[103]=$):$=t[103],$}function k(e){return[...new Set(e)].sort()}var A=[{id:`core`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`],en:`Core`,zh:`核心`},{id:`office`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`docx`,`pdf`,`pptx`,`xlsx`],en:`Office`,zh:`办公成果`},{id:`local-app`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`build-xopc-local-app`,`frontend-design`,`theme-factory`],en:`Local App`,zh:`本地应用`},{id:`developer`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`diagnose`,`github`,`tdd`,`webapp-testing`],en:`Developer`,zh:`开发者`},{id:`desktop-pet`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`hatch-pet`],en:`Desktop Pet`,zh:`桌面宠物`}];function ue(e){let t=(0,ce.c)(115),{draft:n,setDraft:r,zh:i}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[0]=o):o=t[0];let{data:c,error:l,isLoading:te}=p(`agent-defaults-skills-catalog`,v,o),[d,f]=(0,w.useState)(``),ne=n.skills.mode===`selected`?n.skills.include:n.skills.exclude;c?.catalog;let m;if(t[1]!==ne||t[2]!==c?.catalog||t[3]!==d){let e=[...c?.catalog??[]],n=new Set(e.map(P));for(let t of ne)n.has(t)||e.push({name:t,description:``,enabled:!0});let r=d.trim().toLowerCase();m=e.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r)).sort(de),t[1]=ne,t[2]=c?.catalog,t[3]=d,t[4]=m}else m=t[4];let h=m,g;t[5]!==n.skills.exclude||t[6]!==n.skills.include||t[7]!==n.skills.mode?(g=e=>n.skills.mode===`selected`?n.skills.include.includes(e):!n.skills.exclude.includes(e),t[5]=n.skills.exclude,t[6]=n.skills.include,t[7]=n.skills.mode,t[8]=g):g=t[8];let _=g,re;t[9]!==n||t[10]!==r?(re=e=>{if(n.skills.mode===`selected`){let t=n.skills.include.includes(e)?n.skills.include.filter(t=>t!==e):k([...n.skills.include,e]);r({...n,skills:{mode:`selected`,include:t}});return}let t=n.skills.exclude.includes(e)?n.skills.exclude.filter(t=>t!==e):k([...n.skills.exclude,e]);r({...n,skills:{mode:`all-enabled`,exclude:t}})},t[9]=n,t[10]=r,t[11]=re):re=t[11];let y=re,ie;t[12]===c?.catalog?ie=t[13]:(ie=c?.catalog??[],t[12]=c?.catalog,t[13]=ie);let b;if(t[14]!==_||t[15]!==ie){let e;t[17]===_?e=t[18]:(e=e=>e.enabled&&_(e.name),t[17]=_,t[18]=e),b=ie.filter(e),t[14]=_,t[15]=ie,t[16]=b}else b=t[16];let ae=b.length,x;t[19]!==c?.catalog||t[20]!==n||t[21]!==r?(x=e=>{let t=new Set((c?.catalog??[]).filter(N).map(M));r({...n,skills:{mode:`selected`,include:k(e.filter(e=>t.has(e)))}})},t[19]=c?.catalog,t[20]=n,t[21]=r,t[22]=x):x=t[22];let oe=x,se=i?`技能策略`:`Skill policy`,S;t[23]===se?S=t[24]:(S=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:se}),t[23]=se,t[24]=S);let C=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,E;t[25]===C?E=t[26]:(E=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:C}),t[25]=C,t[26]=E);let D;t[27]!==n||t[28]!==r?(D=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=D):D=t[29];let le=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,O;t[30]===le?O=t[31]:(O=u(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,le),t[30]=le,t[31]=O);let ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,T.jsx)(a,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=ue):ue=t[32];let fe=i?`使用所有已启用技能`:`Use every enabled skill`,F;t[33]===fe?F=t[34]:(F=(0,T.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:fe}),t[33]=fe,t[34]=F);let pe=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,I;t[35]===pe?I=t[36]:(I=(0,T.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:pe}),t[35]=pe,t[36]=I);let L;t[37]!==F||t[38]!==I?(L=(0,T.jsxs)(`span`,{children:[F,I]}),t[37]=F,t[38]=I,t[39]=L):L=t[39];let R;t[40]!==D||t[41]!==O||t[42]!==L?(R=(0,T.jsxs)(`button`,{type:`button`,onClick:D,className:O,children:[ue,L]}),t[40]=D,t[41]=O,t[42]=L,t[43]=R):R=t[43];let z;t[44]!==n||t[45]!==r?(z=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=z):z=t[46];let B=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,V;t[47]===B?V=t[48]:(V=u(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,B),t[47]=B,t[48]=V);let H;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(s,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=H):H=t[49];let U=i?`只使用选中的技能`:`Use selected skills only`,W;t[50]===U?W=t[51]:(W=(0,T.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:U}),t[50]=U,t[51]=W);let G=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,K;t[52]===G?K=t[53]:(K=(0,T.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:G}),t[52]=G,t[53]=K);let q;t[54]!==W||t[55]!==K?(q=(0,T.jsxs)(`span`,{children:[W,K]}),t[54]=W,t[55]=K,t[56]=q):q=t[56];let J;t[57]!==z||t[58]!==V||t[59]!==q?(J=(0,T.jsxs)(`button`,{type:`button`,onClick:z,className:V,children:[H,q]}),t[57]=z,t[58]=V,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==R||t[62]!==J?(Y=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[R,J]}),t[61]=R,t[62]=J,t[63]=Y):Y=t[63];let me=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,X;t[64]===me?X=t[65]:(X=(0,T.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:me}),t[64]=me,t[65]=X);let Z;t[66]!==oe||t[67]!==c||t[68]!==i?(Z=A.map(e=>(0,T.jsx)(`button`,{type:`button`,onClick:()=>oe(e.names),disabled:!c,className:`rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,children:i?e.zh:e.en},e.id)),t[66]=oe,t[67]=c,t[68]=i,t[69]=Z):Z=t[69];let Q;t[70]===Z?Q=t[71]:(Q=(0,T.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Z}),t[70]=Z,t[71]=Q);let $;t[72]!==X||t[73]!==Q?($=(0,T.jsxs)(`div`,{className:`mt-4`,children:[X,Q]}),t[72]=X,t[73]=Q,t[74]=$):$=t[74];let he;t[75]!==E||t[76]!==Y||t[77]!==$||t[78]!==S?(he=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[S,E,Y,$]}),t[75]=E,t[76]=Y,t[77]=$,t[78]=S,t[79]=he):he=t[79];let ge=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,_e;t[80]===ge?_e=t[81]:(_e=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ge}),t[80]=ge,t[81]=_e);let ve=i?`当前默认可用 ${ae} 个技能。`:`${ae} skills are available by default.`,ye;t[82]===ve?ye=t[83]:(ye=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ve}),t[82]=ve,t[83]=ye);let be;t[84]!==_e||t[85]!==ye?(be=(0,T.jsxs)(`div`,{children:[_e,ye]}),t[84]=_e,t[85]=ye,t[86]=be):be=t[86];let xe=i?`搜索技能`:`Search skills`,Se;t[87]===xe?Se=t[88]:(Se=(0,T.jsx)(`span`,{className:`sr-only`,children:xe}),t[87]=xe,t[88]=Se);let Ce;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,T.jsx)(ee,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[89]=Ce):Ce=t[89];let we;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>f(e.target.value),t[90]=we):we=t[90];let Te=i?`搜索技能`:`Search skills`,Ee;t[91]!==d||t[92]!==Te?(Ee=(0,T.jsx)(`input`,{type:`search`,value:d,onChange:we,placeholder:Te,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[91]=d,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==Se||t[95]!==Ee?(De=(0,T.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[Se,Ce,Ee]}),t[94]=Se,t[95]=Ee,t[96]=De):De=t[96];let Oe;t[97]!==be||t[98]!==De?(Oe=(0,T.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[be,De]}),t[97]=be,t[98]=De,t[99]=Oe):Oe=t[99];let ke;t[100]===l?ke=t[101]:(ke=l?(0,T.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:l instanceof Error?l.message:String(l)}):null,t[100]=l,t[101]=ke);let Ae;t[102]!==_||t[103]!==te||t[104]!==h||t[105]!==y||t[106]!==i?(Ae=te?(0,T.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(j)}):(0,T.jsxs)(`div`,{className:`mt-4 flex max-h-[32rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[h.map(e=>{let t=_(e.name);return(0,T.jsxs)(`label`,{className:u(`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,!e.enabled&&`cursor-not-allowed opacity-55`),children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!e.enabled,onChange:()=>y(e.name),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,T.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,T.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-muted`,children:i?`全局未启用`:`Disabled globally`})]}),e.description?(0,T.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description}):null]})]},e.name)}),h.length===0?(0,T.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`没有匹配的技能。`:`No matching skills.`}):null]}),t[102]=_,t[103]=te,t[104]=h,t[105]=y,t[106]=i,t[107]=Ae):Ae=t[107];let je;t[108]!==Oe||t[109]!==ke||t[110]!==Ae?(je=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,ke,Ae]}),t[108]=Oe,t[109]=ke,t[110]=Ae,t[111]=je):je=t[111];let Me;return t[112]!==he||t[113]!==je?(Me=(0,T.jsxs)(`div`,{className:`space-y-5`,children:[he,je]}),t[112]=he,t[113]=je,t[114]=Me):Me=t[114],Me}function j(e){return(0,T.jsx)(m,{className:`h-14 rounded-xl`},e)}function M(e){return e.name}function N(e){return e.enabled}function de(e,t){return e.name.localeCompare(t.name)}function P(e){return e.name}function fe(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function F(e){let t=(0,ce.c)(101),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,o=y(),[s,c]=(0,w.useState)(``),[l,d]=(0,w.useState)(`all`),[f,p]=(0,w.useState)(),m;t[0]===i?m=t[1]:(m=new Map(i.map(L)),t[0]=i,t[1]=m);let h=m,g;t[2]!==i||t[3]!==n.tools?(g=[...new Set([...i.map(I),...Object.keys(n.tools)])].filter(pe).sort(),t[2]=i,t[3]=n.tools,t[4]=g):g=t[4];let _=g,v;if(t[5]!==_||t[6]!==n.tools){let e;t[8]===n.tools?e=t[9]:(e=e=>(n.tools[e]?.mode??`allow`)===`allow`,t[8]=n.tools,t[9]=e),v=_.filter(e),t[5]=_,t[6]=n.tools,t[7]=v}else v=t[7];let ie=v.length,b;if(t[10]!==_||t[11]!==n.tools){let e;t[13]===n.tools?e=t[14]:(e=e=>n.tools[e]?.mode===`ask`,t[13]=n.tools,t[14]=e),b=_.filter(e),t[10]=_,t[11]=n.tools,t[12]=b}else b=t[12];let oe=b.length,se;if(t[15]!==_||t[16]!==n.tools){let e;t[18]===n.tools?e=t[19]:(e=e=>n.tools[e]?.mode===`deny`,t[18]=n.tools,t[19]=e),se=_.filter(e),t[15]=_,t[16]=n.tools,t[17]=se}else se=t[17];let S;t[20]!==v.length||t[21]!==b.length||t[22]!==se.length?(S={allow:ie,ask:oe,deny:se.length},t[20]=v.length,t[21]=b.length,t[22]=se.length,t[23]=S):S=t[23];let C=S,E;if(t[24]!==_||t[25]!==h||t[26]!==n.tools||t[27]!==l||t[28]!==s){let e=s.trim().toLowerCase();E=_.filter(t=>{let r=n.tools[t]?.mode??`allow`,i=h.get(t),a=`${t} ${i?.en??``} ${i?.zh??``}`.toLowerCase();return(!e||a.includes(e))&&(l===`all`||r===l)}),t[24]=_,t[25]=h,t[26]=n.tools,t[27]=l,t[28]=s,t[29]=E}else E=t[29];let D=E,le;t[30]!==n||t[31]!==r?(le=(e,t)=>{let i=n.tools[e]??{mode:`allow`};r({...n,tools:{...n.tools,[e]:{...i,...t}}})},t[30]=n,t[31]=r,t[32]=le):le=t[32];let O=le,k=a?`全部 ${_.length}`:`All ${_.length}`,A;t[33]===k?A=t[34]:(A={id:`all`,label:k},t[33]=k,t[34]=A);let ue=a?`允许 ${C.allow}`:`Allow ${C.allow}`,j;t[35]===ue?j=t[36]:(j={id:`allow`,label:ue},t[35]=ue,t[36]=j);let M=a?`询问 ${C.ask}`:`Ask ${C.ask}`,N;t[37]===M?N=t[38]:(N={id:`ask`,label:M},t[37]=M,t[38]=N);let de=a?`禁用 ${C.deny}`:`Deny ${C.deny}`,P;t[39]===de?P=t[40]:(P={id:`deny`,label:de},t[39]=de,t[40]=P);let F;t[41]!==A||t[42]!==j||t[43]!==N||t[44]!==P?(F=[A,j,N,P],t[41]=A,t[42]=j,t[43]=N,t[44]=P,t[45]=F):F=t[45];let R=F,z=a?`默认工具权限`:`Default tool permissions`,B;t[46]===z?B=t[47]:(B=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[46]=z,t[47]=B);let V=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,H;t[48]===V?H=t[49]:(H=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:V}),t[48]=V,t[49]=H);let U;t[50]!==B||t[51]!==H?(U=(0,T.jsxs)(`div`,{children:[B,H]}),t[50]=B,t[51]=H,t[52]=U):U=t[52];let W=a?`工具筛选`:`Tool filter`,G;t[53]!==l||t[54]!==R?(G=R.map(e=>(0,T.jsx)(`button`,{"aria-pressed":l===e.id,type:`button`,onClick:()=>d(e.id),className:u(`rounded-lg px-3 py-1.5 text-xs font-medium`,l===e.id?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:e.label},e.id)),t[53]=l,t[54]=R,t[55]=G):G=t[55];let K;t[56]!==W||t[57]!==G?(K=(0,T.jsx)(re,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,role:`group`,"aria-label":W,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:G}),t[56]=W,t[57]=G,t[58]=K):K=t[58];let q=a?`搜索工具`:`Search tools`,J;t[59]===q?J=t[60]:(J=(0,T.jsx)(`span`,{className:`sr-only`,children:q}),t[59]=q,t[60]=J);let Y;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,T.jsx)(ee,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[61]=Y):Y=t[61];let me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>c(e.target.value),t[62]=me):me=t[62];let X=a?`搜索工具`:`Search tools`,Z;t[63]!==s||t[64]!==X?(Z=(0,T.jsx)(`input`,{type:`search`,value:s,onChange:me,placeholder:X,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[63]=s,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==J||t[67]!==Z?(Q=(0,T.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[J,Y,Z]}),t[66]=J,t[67]=Z,t[68]=Q):Q=t[68];let $;t[69]!==K||t[70]!==Q?($=(0,T.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[K,Q]}),t[69]=K,t[70]=Q,t[71]=$):$=t[71];let he=a?`工具调用限制`:`Tool call limits`,ge=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,_e;t[72]!==he||t[73]!==ge?(_e=(0,T.jsx)(ae,{title:he,summary:ge,children:null}),t[72]=he,t[73]=ge,t[74]=_e):_e=t[74];let ve;if(t[75]!==h||t[76]!==n.tools||t[77]!==f||t[78]!==o||t[79]!==O||t[80]!==D||t[81]!==a){let e;t[83]!==h||t[84]!==n.tools||t[85]!==f||t[86]!==o||t[87]!==O||t[88]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=h.get(e),i=f===e;return(0,T.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,T.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(re,{className:`flex rounded-lg bg-surface-base p-1`,role:`group`,"aria-label":e,indicatorClassName:`rounded-md bg-accent`,children:[`allow`,`ask`,`deny`].map(n=>(0,T.jsx)(`button`,{"aria-pressed":t.mode===n,type:`button`,onClick:()=>O(e,{mode:n}),className:u(`rounded-md px-2.5 py-1 text-xs font-medium capitalize`,t.mode===n?`bg-accent text-on-accent`:`text-fg-muted hover:text-fg`),children:n===`allow`?a?`允许`:`Allow`:n===`ask`?a?`询问`:`Ask`:a?`禁用`:`Deny`},n))}),o?(0,T.jsx)(ne,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>p(i?void 0:e),children:(0,T.jsx)(te,{className:`size-4`})}):null]})]}),i&&o?(0,T.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>O(e,{maxCallsPerTurn:fe(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]}),(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>O(e,{timeoutMs:fe(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]})]}):null]},e)},t[83]=h,t[84]=n.tools,t[85]=f,t[86]=o,t[87]=O,t[88]=a,t[89]=e):e=t[89],ve=D.map(e),t[75]=h,t[76]=n.tools,t[77]=f,t[78]=o,t[79]=O,t[80]=D,t[81]=a,t[82]=ve}else ve=t[82];let ye;t[90]!==D.length||t[91]!==a?(ye=D.length===0?(0,T.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[90]=D.length,t[91]=a,t[92]=ye):ye=t[92];let be;t[93]!==ve||t[94]!==ye?(be=(0,T.jsxs)(`div`,{className:`mt-4 flex max-h-[38rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>*]:rounded-lg [&>*]:bg-surface-panel/55`,children:[ve,ye]}),t[93]=ve,t[94]=ye,t[95]=be):be=t[95];let xe;return t[96]!==U||t[97]!==$||t[98]!==_e||t[99]!==be?(xe=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[U,$,_e,be]}),t[96]=U,t[97]=$,t[98]=_e,t[99]=be,t[100]=xe):xe=t[100],xe}function pe(e){return e!==`computer_use`||_()}function I(e){return e.id}function L(e){return[e.id,e.description]}function R(){let e=(0,ce.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,T.jsxs)(oe,{gap:`gap-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(m,{className:`h-7 w-56`}),(0,T.jsx)(m,{className:`h-4 w-96 max-w-full`})]}),(0,T.jsx)(m,{className:`h-9 w-28`})]}),(0,T.jsx)(m,{className:`h-20 rounded-2xl`}),(0,T.jsx)(m,{className:`h-12 rounded-xl`}),(0,T.jsx)(m,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function z(e){let t=(0,ce.c)(65),{initial:n,builtinTools:r,zh:a}=e,[s,ee]=i(),te;t[0]===s?te=t[1]:(te=s.get(`panel`),t[0]=s,t[1]=te);let d=te,f=d===`skills`||d===`tools`||d===`runtime`?d:`skills`,p;t[2]!==s||t[3]!==ee?(p=e=>{let t=new URLSearchParams(s);t.set(`panel`,e),ee(t,{replace:!0})},t[2]=s,t[3]=ee,t[4]=p):p=t[4];let m=p,h;t[5]===n?h=t[6]:(h=()=>structuredClone(n),t[5]=n,t[6]=h);let[g,_]=(0,w.useState)(h),v;t[7]===n?v=t[8]:(v=()=>structuredClone(n),t[7]=n,t[8]=v);let[y,ae]=(0,w.useState)(v),x;t[9]===g?x=t[10]:(x=JSON.stringify(g),t[9]=g,t[10]=x);let E;t[11]===y?E=t[12]:(E=JSON.stringify(y),t[11]=y,t[12]=E);let D=x!==E,le=a?`技能`:`Skills`,k;t[13]===le?k=t[14]:(k={id:`skills`,label:le,icon:c},t[13]=le,t[14]=k);let A=a?`工具`:`Tools`,j;t[15]===A?j=t[16]:(j={id:`tools`,label:A,icon:l},t[15]=A,t[16]=j);let M=a?`运行`:`Runtime`,N;t[17]===M?N=t[18]:(N={id:`runtime`,label:M,icon:o},t[17]=M,t[18]=N);let de;t[19]!==j||t[20]!==N||t[21]!==k?(de=[k,j,N],t[19]=j,t[20]=N,t[21]=k,t[22]=de):de=t[22];let P=de,fe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(fe=async e=>{let t=structuredClone(e),n=await b(),r=await ie({...t,models:n.defaults.models},{scope:`agent`}),i=structuredClone(r.defaults);_(e=>JSON.stringify(e)===JSON.stringify(t)?i:e),ae(structuredClone(i))},t[23]=fe):fe=t[23];let pe=fe,I;t[24]!==D||t[25]!==g?(I={value:g,dirty:D,onSave:pe,delayMs:0},t[24]=D,t[25]=g,t[26]=I):I=t[26];let L=C(I),R=L.onBlurCapture,z=a?`智能体设置`:`Agent settings`,B;t[27]!==L.error||t[28]!==L.status?(B=(0,T.jsx)(S,{status:L.status,error:L.error}),t[27]=L.error,t[28]=L.status,t[29]=B):B=t[29];let V;t[30]!==z||t[31]!==B?(V=(0,T.jsx)(se,{title:z,actions:B}),t[30]=z,t[31]=B,t[32]=V):V=t[32];let H;t[33]!==L.error||t[34]!==L.retry||t[35]!==a?(H=L.error?(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:[(0,T.jsx)(`span`,{children:L.error}),(0,T.jsx)(ne,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:L.retry,children:a?`重试`:`Retry`})]}):null,t[33]=L.error,t[34]=L.retry,t[35]=a,t[36]=H):H=t[36];let U=a?`默认配置分区`:`Default configuration sections`,W;t[37]!==f||t[38]!==m||t[39]!==P?(W=P.map(e=>{let{id:t,label:n,icon:r}=e;return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":f===t,onClick:()=>m(t),className:u(`flex min-w-0 items-center justify-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f===t?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,T.jsx)(r,{className:u(`size-4 shrink-0`,f===t?`text-accent`:`text-fg-subtle`)}),(0,T.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[37]=f,t[38]=m,t[39]=P,t[40]=W):W=t[40];let G;t[41]!==U||t[42]!==W?(G=(0,T.jsx)(re,{as:`nav`,className:`grid grid-cols-3 gap-1 rounded-xl bg-surface-hover/20 p-1`,"aria-label":U,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:W}),t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]!==f||t[45]!==g||t[46]!==a?(K=f===`skills`?(0,T.jsx)(ue,{draft:g,setDraft:_,zh:a}):null,t[44]=f,t[45]=g,t[46]=a,t[47]=K):K=t[47];let q;t[48]!==f||t[49]!==r||t[50]!==g||t[51]!==a?(q=f===`tools`?(0,T.jsx)(F,{draft:g,setDraft:_,builtinTools:r,zh:a}):null,t[48]=f,t[49]=r,t[50]=g,t[51]=a,t[52]=q):q=t[52];let J;t[53]!==f||t[54]!==g||t[55]!==a?(J=f===`runtime`?(0,T.jsx)(O,{draft:g,setDraft:_,zh:a}):null,t[53]=f,t[54]=g,t[55]=a,t[56]=J):J=t[56];let Y;return t[57]!==L.onBlurCapture||t[58]!==V||t[59]!==H||t[60]!==G||t[61]!==K||t[62]!==q||t[63]!==J?(Y=(0,T.jsxs)(oe,{gap:`gap-5`,onBlurCapture:R,children:[V,H,G,K,q,J]}),t[57]=L.onBlurCapture,t[58]=V,t[59]=H,t[60]=G,t[61]=K,t[62]=q,t[63]=J,t[64]=Y):Y=t[64],Y}function B(){let e=(0,ce.c)(17),t=d(H),n=f(V)===`zh`,{data:r,error:i,isLoading:a,mutate:o}=p(t?`settings-agent-defaults`:null,b);if(!t){let t=n?`需要本机服务令牌。`:`Local service token required.`,r;return e[0]===t?r=e[1]:(r=(0,T.jsx)(oe,{children:(0,T.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t})}),e[0]=t,e[1]=r),r}if(i&&!r){let t=String(i),r;e[2]===t?r=e[3]:(r=(0,T.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:t}),e[2]=t,e[3]=r);let a;e[4]===o?a=e[5]:(a=()=>void o(),e[4]=o,e[5]=a);let s=n?`重试`:`Retry`,c;e[6]!==a||e[7]!==s?(c=(0,T.jsx)(ne,{onClick:a,children:s}),e[6]=a,e[7]=s,e[8]=c):c=e[8];let ee;return e[9]!==r||e[10]!==c?(ee=(0,T.jsxs)(oe,{children:[r,c]}),e[9]=r,e[10]=c,e[11]=ee):ee=e[11],ee}if(a||!r){let t;return e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,T.jsx)(R,{}),e[12]=t):t=e[12],t}let s;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(s=(0,T.jsx)(z,{initial:r.defaults,builtinTools:r.builtinTools,zh:n}),e[13]=r.builtinTools,e[14]=r.defaults,e[15]=n,e[16]=s):s=e[16],s}function V(e){return e.language}function H(e){return e.conversationId}export{B as AgentDefaultsSettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={main:{key:`assistant`,defaultNames:[`main`,`Main`,`Smart Assistant`],defaultDescriptions:[`General assistant`,`General-purpose personal assistant.`,`Your personal intelligent assistant for answering questions, handling everyday tasks, and chatting with you anytime.`]},conductor:{key:`conductor`,defaultNames:[`conductor`,`Conductor`],defaultDescriptions:[`Talks with the user, delegates complex work to specialist Agents, and delivers verified results.`,`User-facing coordination Agent for task planning, delegation, progress, verification, and reporting to the user.`]},"task-router":{key:`taskRouter`,defaultNames:[`task-router`,`Task Router`],defaultDescriptions:[`Selects one suitable specialist for a delegated task.`]},coder:{key:`coding`,defaultNames:[`coder`,`Coder`,`Coding Expert`],defaultDescriptions:[`Software development, debugging, refactoring, and tests.`,`Software engineering agent for repository understanding, implementation, debugging, refactoring, tests, and review.`]},writer:{key:`writing`,defaultNames:[`writer`,`Writer`,`Writing Assistant`],defaultDescriptions:[`Drafting, editing, rewriting, and audience-aware content.`]},researcher:{key:`research`,defaultNames:[`researcher`,`Researcher`,`Research Assistant`],defaultDescriptions:[`Deep research, source comparison, and fact synthesis.`]},"data-analyst":{key:`data`,defaultNames:[`data-analyst`,`Data Analyst`],defaultDescriptions:[`Data cleaning, analysis, visualization, and reproducible reports.`]},creative:{key:`creative`,defaultNames:[`creative`,`Creative`,`Creative Assistant`],defaultDescriptions:[`Visual direction, image prompts, design critique, and creative options.`]}};function t(e){return e?.trim().toLowerCase()??``}function n(e,n){let r=t(e);return!!r&&n.some(e=>t(e)===r)}function r(n){return e[t(n)]}function i(e){return/^personal-[a-f0-9]{12}$/.test(t(e))}function a(e,t){let i=e.name?.trim(),a=r(e.id);return a&&(!i||n(i,a.defaultNames))?t.builtInAgents[a.key].name:i||e.id}function o(e,t){let a=e.description?.trim();if(i(e.id)&&(!a||n(a,[`A personal AI that adapts its responses to the user and coordinates work.`])))return t.listPersonalAgentDescription;let o=r(e.id);return o&&(!a||n(a,o.defaultDescriptions))?t.builtInAgents[o.key].description:a||``}export{a as n,i as r,o as t};
|
|
@@ -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{l as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as s}from"./arrow-left-D880xG-P.js";import{t as c}from"./chevron-down-ccbiQQz_.js";import{t as l}from"./working-directory-picker-modal-DHl2cZY1.js";import{t as ee}from"./circle-alert-BEjgurr2.js";import{t as te}from"./circle-check-C23XjkUj.js";import{t as u}from"./circle-BoO4YvTx.js";import{t as ne}from"./file-archive-DanfQJNe.js";import{t as d}from"./folder-open-CyzJ19I9.js";import{t as re}from"./loader-circle-CifKLtgG.js";import{t as ie}from"./package-wATCyihJ.js";import{t as f}from"./shield-check-BU58siTV.js";import{t as p}from"./upload-rrb46c3c.js";import{t as m}from"./messages-DRR9N3HC.js";import{t as h}from"./cn-0WouolD0.js";import{i as ae,n as g,o as _}from"./locale-store-lIXD1FMw.js";import{a as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-CnRSIP6m.js";import{t as oe}from"./skeleton-BI5TyibZ.js";import{a as b,i as x,o as S,r as C,s as w,t as T}from"./dist-DfWfZ9iu.js";import{t as se}from"./capability-links-DzQWK1Fh.js";import{t as E}from"./browser-BLJWD7WI.js";import{t as D}from"./capability-icon-DVoZxEgW.js";var ce=n(),O=e(E(),1),k=e(t(),1),A=r();function j(e){let t=(0,ce.c)(6),{fields:n,values:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=Object.entries(n),t[0]=n,t[1]=a);let o;return t[2]!==i||t[3]!==a||t[4]!==r?(o=(0,A.jsx)(A.Fragment,{children:a.map(e=>{let[t,n]=e;return(0,A.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[(0,A.jsxs)(`span`,{children:[n.title,n.required?` *`:``]}),n.type===`boolean`?(0,A.jsx)(`input`,{type:`checkbox`,checked:r[t]===!0,onChange:e=>i({...r,[t]:e.target.checked})}):(0,A.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,type:n.sensitive?`password`:n.type===`number`?`number`:`text`,required:n.required,autoComplete:`off`,value:String(r[t]??``),onChange:e=>i({...r,[t]:n.type===`number`?Number(e.target.value):e.target.value})})]},t)})}),t[2]=i,t[3]=a,t[4]=r,t[5]=o):o=t[5],o}function M(e){let t=(0,ce.c)(62),{account:n,fields:r,zh:i,busy:a,attempt:o,initialMethod:c,onBack:l,onConnect:ee,onSave:te,onRedirect:u,onSkip:ne}=e,[d,ie]=(0,k.useState)(c&&n.methods.some(e=>e.id===c)?c:n.methods[0]?.id??``),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={},t[0]=f):f=t[0];let[p,m]=(0,k.useState)(f),[h,ae]=(0,k.useState)(``),[g,_]=(0,k.useState)(),v;t[1]===d?v=t[2]:(v=e=>e.id===d,t[1]=d,t[2]=v);let b=n.methods.find(v),x;t[3]===i?x=t[4]:(x=(e,t)=>i?e:t,t[3]=i,t[4]=x);let S=x,C=o?.challenge?.type===`qr`?o.challenge.url:void 0,w,T;t[5]===C?(w=t[6],T=t[7]):(w=()=>{let e=!1;return _(void 0),C&&O.toDataURL(C,{width:240,margin:2}).then(t=>{e||_(t)}).catch(P),()=>{e=!0}},T=[C],t[5]=C,t[6]=w,t[7]=T),(0,k.useEffect)(w,T);let se;t[8]===o?se=t[9]:(se=o&&![`cancelled`,`error`,`connected`].includes(o.state),t[8]=o,t[9]=se);let E=se,D=o?.authorizationUrl??o?.challenge?.url,M=`连接 ${n.title}`,F=`Connect ${n.title}`,I;t[10]!==S||t[11]!==M||t[12]!==F?(I=S(M,F),t[10]=S,t[11]=M,t[12]=F,t[13]=I):I=t[13];let L;t[14]===S?L=t[15]:(L=S(`返回插件详情`,`Back to plugin details`),t[14]=S,t[15]=L);let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,A.jsx)(s,{className:`size-4`}),t[16]=R):R=t[16];let z;t[17]!==l||t[18]!==L?(z=(0,A.jsx)(y,{variant:`ghost`,className:`shrink-0`,onClick:l,"aria-label":L,children:R}),t[17]=l,t[18]=L,t[19]=z):z=t[19];let B;t[20]===S?B=t[21]:(B=S(`连接 `,`Connect `),t[20]=S,t[21]=B);let V;t[22]!==n.title||t[23]!==B?(V=(0,A.jsxs)(`h3`,{className:`text-base font-semibold`,children:[B,n.title]}),t[22]=n.title,t[23]=B,t[24]=V):V=t[24];let H;t[25]!==n.description||t[26]!==S?(H=n.description??S(`完成授权后自动检查连接。也可以稍后在详情页继续。`,`The connection is checked after authorization. You can also continue later in plugin details.`),t[25]=n.description,t[26]=S,t[27]=H):H=t[27];let U;t[28]===H?U=t[29]:(U=(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:H}),t[28]=H,t[29]=U);let W;t[30]!==V||t[31]!==U?(W=(0,A.jsxs)(`div`,{children:[V,U]}),t[30]=V,t[31]=U,t[32]=W):W=t[32];let G;t[33]!==z||t[34]!==W?(G=(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[z,W]}),t[33]=z,t[34]=W,t[35]=G):G=t[35];let K;t[36]!==n.methods||t[37]!==E||t[38]!==a||t[39]!==d||t[40]!==S?(K=n.methods.length>1?(0,A.jsx)(`div`,{role:`tablist`,"aria-label":S(`授权方式`,`Authorization methods`),className:`flex flex-wrap gap-2 rounded-lg bg-surface-inset p-1.5`,children:n.methods.map(e=>(0,A.jsx)(`button`,{role:`tab`,type:`button`,"aria-selected":d===e.id,className:`min-h-10 rounded-md px-3 text-sm ${d===e.id?`bg-surface-panel font-medium text-fg`:`text-fg-muted`}`,disabled:a||!!E,onClick:()=>{ie(e.id),m({})},children:e.title},e.id))}):null,t[36]=n.methods,t[37]=E,t[38]=a,t[39]=d,t[40]=S,t[41]=K):K=t[41];let q=b?.instructions?.length||b?.helpUrl?(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[b.instructions?.length?(0,A.jsx)(`ol`,{className:`list-decimal space-y-2 pl-5`,children:b.instructions.map(N)}):null,b.helpUrl?(0,A.jsx)(`a`,{className:`text-accent underline`,href:b.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:S(`打开官方配置说明`,`Open setup instructions`)}):null]}):null,J=(b?.type===`form`||b?.fields?.length)&&!E?(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),te(b.id,p)},children:[(0,A.jsx)(j,{fields:Object.fromEntries((b.fields??[]).filter(e=>r[e]).map(e=>[e,{...r[e],required:!0}])),values:p,onChange:m}),(0,A.jsxs)(y,{type:`submit`,disabled:a||!b.fields?.every(e=>p[e]!==void 0&&p[e]!==``),children:[a?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,S(`保存并连接`,`Save and connect`)]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[E?null:(0,A.jsx)(y,{disabled:a,onClick:()=>ee(d),children:S(`连接账号`,`Connect account`)}),E?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:o.challenge?.message??(o.state===`preparing`?S(`正在准备登录…`,`Preparing sign-in…`):S(`请完成登录,返回后会自动继续。`,`Finish signing in. Installation continues automatically.`))}):null,C&&E?g?(0,A.jsx)(`img`,{src:g,alt:S(`使用 ${n.title} 扫码授权`,`Scan to authorize ${n.title}`),className:`mx-auto size-60 max-w-full rounded-lg`}):(0,A.jsx)(oe,{className:`mx-auto size-60`}):null,D&&E?(0,A.jsx)(`a`,{href:D,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-sm text-accent underline`,children:C?S(`也可以打开授权页面`,`Or open the authorization page`):S(`打开登录页面`,`Open sign-in page`)}):null,o?.expiresAt&&E?(0,A.jsxs)(`p`,{className:`text-center text-xs text-fg-muted`,children:[S(`本次授权有效期至 `,`This sign-in expires at `),new Date(o.expiresAt).toLocaleTimeString()]}):null,o?.error?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:o.error}):null,o?.acceptsRedirect&&E?(0,A.jsxs)(`details`,{className:`text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:S(`登录后没有自动返回?`,`Did sign-in not return automatically?`)}),(0,A.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:e=>{e.preventDefault(),u(h)},children:[(0,A.jsxs)(`label`,{children:[S(`登录回调地址`,`Sign-in callback URL`),(0,A.jsx)(`input`,{value:h,onChange:e=>ae(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-inset p-2`})]}),(0,A.jsx)(y,{type:`submit`,disabled:a||!h,children:S(`继续登录`,`Continue sign-in`)})]})]}):null]}),Y;t[42]===S?Y=t[43]:(Y=S(`暂时跳过`,`Skip for now`),t[42]=S,t[43]=Y);let X;t[44]!==a||t[45]!==ne||t[46]!==Y?(X=(0,A.jsx)(y,{variant:`secondary`,disabled:a,onClick:ne,children:Y}),t[44]=a,t[45]=ne,t[46]=Y,t[47]=X):X=t[47];let Z;t[48]===S?Z=t[49]:(Z=S(`相关功能暂不可用,可随时在插件详情中授权。`,`Features requiring this account stay unavailable. Connect later in plugin details.`),t[48]=S,t[49]=Z);let le;t[50]===Z?le=t[51]:(le=(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Z}),t[50]=Z,t[51]=le);let ue;t[52]!==X||t[53]!==le?(ue=(0,A.jsxs)(`div`,{className:`border-t border-edge pt-4`,children:[X,le]}),t[52]=X,t[53]=le,t[54]=ue):ue=t[54];let Q;return t[55]!==I||t[56]!==G||t[57]!==K||t[58]!==q||t[59]!==J||t[60]!==ue?(Q=(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":I,children:[G,K,q,J,ue]}),t[55]=I,t[56]=G,t[57]=K,t[58]=q,t[59]=J,t[60]=ue,t[61]=Q):Q=t[61],Q}function N(e,t){return(0,A.jsx)(`li`,{children:e},t)}function P(){}async function F(e,t=`GET`,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function I({extension:e,zh:t,onChanged:n,onStart:r,onInstalled:i,initialConnect:o=!1}){let s=`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,[c,l]=(0,k.useState)(),[ne,d]=(0,k.useState)({}),[ie,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(``),[h,ae]=(0,k.useState)({}),[g,_]=(0,k.useState)(null),[v,b]=(0,k.useState)(``),[x,S]=(0,k.useState)(null),[C,w]=(0,k.useState)(!1),T=(0,k.useRef)(new Set),se=(0,k.useRef)(new Set),E=(0,k.useRef)(void 0),D=(0,k.useRef)(null),ce=(0,k.useRef)(new Set),O=(e,n)=>t?e:n,N=e.setup?.authorizations??[],P=new Set(N.flatMap(e=>e.servers)),I=[...N,...(c?.connections??[]).filter(t=>!P.has(t.name)&&(e.components?.mcp.find(e=>e.name===t.name)?.type!==`stdio`||t.state===`token_required`)).map(t=>{let n=t.state===`token_required`||e.components?.mcp.find(e=>e.name===t.name)?.connectionAuth?.mode===`api-key`;return{id:t.name,title:t.name,servers:[t.name],methods:[{id:n?`api-key`:`oauth`,title:n?O(`访问令牌`,`Access token`):O(`浏览器登录`,`Browser sign-in`),type:n?`form`:`oauth`,...n?{fields:[`__apiKey`]}:{server:t.name}}]}})],L=e=>e.servers.every(e=>c?.connections.find(t=>t.name===e)?.state===`connected`)&&(!N.some(t=>t.id===e.id)||c?.authorizations?.find(t=>t.id===e.id)?.state===`connected`),R=(c?.authorizations??[]).flatMap(e=>(e.issues??[]).map(t=>({...t,account:I.find(t=>t.id===e.id)}))),z=I.filter(e=>!L(e)),B=c?.installed||c?.state===`completed`,V=e.setup?.userConfig??{},H=new Set(N.flatMap(e=>e.methods.flatMap(e=>e.fields??[]))),U=Object.fromEntries(Object.entries(V).filter(([e])=>!H.has(e))),W=c?.error===`Connection verification failed. Check the credentials or login status and try again.`?O(`连接验证未通过,请检查凭据或登录状态后重试。`,c.error):c?.error,G=Object.fromEntries(Object.entries(V).filter(([e])=>c?.missingConfig?.includes(e))),K=ie||c?.state===`running`,q=I.find(e=>e.id===x);(0,k.useEffect)(()=>{let e=!1;return F(`${s}/setup`).then(t=>{e||l(t)}).catch(t=>{e||(l(null),m(String(t)))}),()=>{e=!0}},[s]),(0,k.useEffect)(()=>{if(c?.state!==`running`)return;let e=!1,t=!1,r=setInterval(()=>{t||(t=!0,F(`${s}/setup`).then(t=>{e||(l(t),t?.state!==`running`&&n())}).catch(t=>{e||m(String(t))}).finally(()=>{t=!1}))},750);return()=>{e=!0,clearInterval(r)}},[s,c?.state]),(0,k.useEffect)(()=>{if(!c||!c.connections.some(e=>[`oauth_required`,`error`].includes(e.state)))return;let e=!1;return F(`${s}/setup/reusable`).then(t=>{e||ae(t)}).catch(()=>{e||ae({})}),()=>{e=!0}},[s,c?.revision]),(0,k.useEffect)(()=>{if(!v||c?.state===`completed`)return;let e=!1,t=!1,n=async()=>{if(!t){t=!0;try{let t=await F(`${s}/setup/auth/${encodeURIComponent(v)}`);e||_(t)}catch(t){e||m(String(t))}finally{t=!1}}};n();let r=setInterval(()=>void n(),1500),i=()=>void n();return window.addEventListener(`focus`,i),()=>{e=!0,clearInterval(r),window.removeEventListener(`focus`,i)}},[s,v,c?.state]),(0,k.useEffect)(()=>{let e=g?.authorizationUrl??(g?.challenge?.type===`url`?g.challenge.url:void 0);if(!g)return;if(g.error||[`cancelled`,`error`,`connected`].includes(g.state)){D.current?.close(),D.current=null;return}if(!e){g.challenge?.type===`qr`&&(D.current?.close(),D.current=null);return}let t=`${g.id}:${e}`;if(ce.current.has(t))return;ce.current.add(t);let n=D.current;D.current=null,n&&!n.closed?n.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)},[g]);async function J(e,t={},r=c?.revision){f(!0),m(``);try{let a=await F(`${s}/setup`,`POST`,{action:e,expectedRevision:r,...e===`start`?{}:{idempotencyKey:crypto.randomUUID()},...t}),o=e===`configure`&&N.find(e=>e.id===t.authorization)?.methods.some(e=>e.id===t.method&&e.type===`cli`);return([`reuse`,`start`].includes(e)||e===`configure`&&!o)&&(d({}),w(!1),a=await F(`${s}/setup`,`POST`,{action:`prepare`,expectedRevision:a.revision,idempotencyKey:crypto.randomUUID()})),l(a),await n(),[`complete`,`defer`].includes(e)&&(S(null),_(null),b(``),D.current?.close(),D.current=null,i?.()),a}catch(e){m(e instanceof Error?e.message:String(e));try{l(await F(`${s}/setup`))}catch{}return null}finally{f(!1)}}(0,k.useEffect)(()=>{if(!c||K||p||[`cancelled`,`running`,`failed`].includes(c.state)||c.state===`completed`)return;let e,t=``;if(c.state===`pending`?(e=`prepare`,t=`prepare:${s}:${c.revision}`):g?.state===`connected`&&(e=`prepare`,t=`auth:${s}:${g.id}`),e&&!T.current.has(t)){T.current.add(t),J(e);return}c.resources===`ready`&&!c.missingConfig?.length&&!c.partial&&c.connections.every(e=>e.state===`connected`)&&(c.authorizations??[]).every(e=>e.state===`connected`)&&(t=`complete:${s}:${c.revision}`,T.current.has(t)||(T.current.add(t),J(`complete`)))},[c,g,K,p,s]),(0,k.useEffect)(()=>{K||!c||c.state===`cancelled`||(q&&c.revision!==E.current&&L(q)?(S(null),_(null),b(``)):(!B||o)&&c.resources===`ready`&&(!c.missingConfig?.length||o&&!c.missingConfig.some(e=>e in U))&&!x&&z[0]&&!se.current.has(z[0].id)&&(se.current.add(z[0].id),E.current=c.revision,S(z[0].id)))},[c,K,B,x,o]);function Y(e,t){let n=e.methods.find(e=>e.id===t),r=n?.type===`oauth`||n?.type===`cli`?window.open(`about:blank`,`_blank`):null;r&&(r.opener=null),D.current=r,_(null),J(`authorize`,{server:e.id,...N.some(t=>t.id===e.id)?{method:t}:{}}).then(t=>{t?b(e.id):(r?.close(),D.current=null)})}async function X(t,n,r){if(n===`api-key`&&!N.some(e=>e.id===t.id)){f(!0),m(``);try{let n=e.components?.mcp.find(e=>e.name===t.id);await F(`${s}/mcp/${encodeURIComponent(t.id)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:n.type===`stdio`?`env`:`headers`,key:n.connectionAuth?.headerName??(n.type===`stdio`?`API_KEY`:`Authorization`),prefix:n.connectionAuth?.prefix??(n.type===`stdio`?``:`Bearer `),value:r.__apiKey}]});let i=await F(`${s}/setup`);l(i),f(!1),await J(`prepare`,{},i.revision);return}catch(e){m(String(e)),f(!1);return}f(!1)}else if(t.methods.find(e=>e.id===n)?.type===`cli`){let e=window.open(`about:blank`,`_blank`);e&&(e.opener=null),D.current=e,_(null);let i=await J(`configure`,{authorization:t.id,method:n,values:r},c?.revision);i&&await J(`authorize`,{server:t.id,method:n},i.revision)?b(t.id):(e?.close(),D.current=null)}else await J(`configure`,{authorization:t.id,method:n,values:r})}if(c===void 0)return(0,A.jsx)(oe,{className:`h-40 w-full`});let Z=()=>{J(`defer`)};return q?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(M,{initialMethod:c?.authorizations?.find(e=>e.id===q.id)?.method,account:q,fields:{...V,__apiKey:{type:`string`,title:O(`访问令牌`,`Access token`),required:!0,sensitive:!0}},zh:t,busy:K,attempt:g,onBack:()=>S(null),onConnect:e=>Y(q,e),onSave:(e,t)=>void X(q,e,t),onRedirect:e=>{f(!0),F(`${s}/setup/auth/${encodeURIComponent(v)}/redirect`,`POST`,{url:e}).catch(e=>m(String(e))).finally(()=>f(!1))},onSkip:Z},`${q.id}:${c?.authorizations?.find(e=>e.id===q.id)?.method??``}`),h[q.id]?.map(e=>(0,A.jsxs)(y,{disabled:K,variant:`secondary`,onClick:()=>void J(`reuse`,{server:q.id,sourceServerId:e.id}),children:[O(`使用已登录账号:`,`Use signed-in account: `),e.name]},e.id)),p||W&&q.servers.some(e=>c?.connections.find(t=>t.name===e)?.state===`error`)?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p||W}):null]}):(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":O(`插件安装与授权`,`Plugin setup`),children:[B?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装完成`,`Installation complete`)}),(0,A.jsx)(`p`,{role:`status`,className:`mt-1 text-sm text-fg-muted`,children:e.activationEligible===!1?O(`插件已停用。`,`Plugin is disabled.`):c?.partial||z.length||R.length||c?.missingConfig?.length?O(`插件已安装,部分功能仍需要授权。`,`Plugin installed. Some features still need authorization.`):O(`所有 Agent 均可使用。可在 Agent 设置中单独调整。`,`Available to all agents. Customize individual agents in Agent settings.`)})]}):(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装准备`,`Installation setup`)}),(0,A.jsx)(`ol`,{className:`mt-4 space-y-4 text-sm`,"aria-live":`polite`,children:[{name:O(`准备资源`,`Prepare resources`),done:c?.resources===`ready`,running:K&&c?.resources!==`ready`},{name:O(`授权账号`,`Authorize accounts`),done:c?.resources===`ready`&&!c?.missingConfig?.length&&z.length===0,running:!1},{name:O(`加载可用工具`,`Load available tools`),done:!1,running:K&&c?.resources===`ready`}].map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-3`,children:[e.done?(0,A.jsx)(te,{className:`size-5 text-accent`,"aria-hidden":!0}):e.running?(0,A.jsx)(re,{className:`size-5 animate-spin text-accent`,"aria-hidden":!0}):(0,A.jsx)(u,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),e.name]},e.name))}),(0,A.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:O(`安装后所有 Agent 均可使用,可在各自的设置中调整。`,`Available to all agents after installation. Customize individual agents in Agent settings.`)})]}),!c||c.state===`cancelled`?(0,A.jsx)(y,{disabled:ie||e.readiness===`blocked`,onClick:()=>void J(`start`),children:O(`继续安装`,`Continue installation`)}):(0,A.jsxs)(A.Fragment,{children:[c.missingConfig?.length||C?(0,A.jsxs)(`form`,{className:`space-y-4 rounded-xl border border-edge p-4`,onSubmit:e=>{e.preventDefault(),J(`configure`,{values:ne})},children:[(0,A.jsx)(`h4`,{className:`font-medium`,children:O(`补充配置`,`Required configuration`)}),(0,A.jsx)(j,{fields:C?U:G,values:ne,onChange:d}),(0,A.jsx)(y,{type:`submit`,disabled:K||!Object.keys(ne).length,children:O(`继续`,`Continue`)})]}):null,B&&(z.length||c.missingConfig?.length)?(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(ee,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium`,children:O(`需要授权`,`Authorization required`)}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:O(`授权后即可使用相关功能。已就绪的功能可继续使用。`,`Connect these accounts to use their features. Ready features remain available.`)})]})]}):null,R.length?(0,A.jsx)(`div`,{className:`space-y-3`,"aria-label":O(`需要补充权限`,`Additional permissions required`),children:R.map(e=>(0,A.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`text-fg-muted`,children:O(`账号已连接,以下权限尚未就绪;其他已授权功能可继续使用。`,`Account connected. These permissions are not ready; other authorized features remain available.`)}),e.scopes.length?(0,A.jsx)(`p`,{className:`break-all font-mono text-xs`,children:e.scopes.join(`, `)}):null,(0,A.jsx)(`ol`,{className:`list-inside list-decimal space-y-1 text-fg-muted`,children:e.instructions.map(e=>(0,A.jsx)(`li`,{children:e},e))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.helpUrl?(0,A.jsx)(y,{variant:`secondary`,asChild:!0,children:(0,A.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:O(`前往开通应用权限`,`Open application permissions`)})}):null,e.method&&e.account?(0,A.jsx)(y,{disabled:K,onClick:()=>{E.current=c.revision,S(e.account.id),Y(e.account,e.method)},children:O(`补充授权`,`Grant missing permissions`)}):null,(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`重新检查权限`,`Check permissions again`)})]})]},`${e.account?.id}:${e.id}`))}):null,I.length?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-sm font-medium`,children:O(`账号与连接`,`Accounts and connections`)}),I.map(e=>(0,A.jsxs)(`div`,{role:`group`,"aria-label":e.title,className:`flex items-center justify-between gap-3 rounded-lg border border-edge p-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:L(e)?O(`已连接`,`Connected`):O(`需要授权`,`Authorization required`)})]}),(0,A.jsx)(y,{variant:L(e)?`secondary`:`primary`,disabled:K||c.resources!==`ready`,onClick:()=>{_(null),b(``),E.current=c.revision,S(e.id)},children:L(e)?O(`重新授权`,`Reconnect`):O(`连接账号`,`Connect account`)})]},e.id))]}):null,!B&&c.resources===`ready`?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:Z,children:O(`暂时跳过`,`Skip for now`)}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:O(`先完成安装,稍后在详情页授权。未授权的功能暂不可用。`,`Finish installation and connect later in plugin details. Unauthenticated features remain unavailable.`)})]}):null,B&&Object.keys(U).length&&!C?(0,A.jsx)(y,{variant:`ghost`,disabled:K,onClick:()=>w(!0),children:O(`修改插件配置`,`Edit plugin configuration`)}):null,B&&!R.length&&N.some(e=>e.methods.some(e=>e.type===`cli`))?(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`检查连接与权限`,`Check connection and permissions`)}):null,!K&&(p||[`failed`,`interrupted`].includes(c.state)||c.connections.some(e=>e.state===`error`))?(0,A.jsx)(y,{variant:`secondary`,onClick:()=>void J(`prepare`),children:O(`重试检查`,`Retry checks`)}):null,B?null:(0,A.jsx)(y,{variant:`ghost`,disabled:ie,onClick:()=>void J(`cancel`),children:O(`取消安装`,`Cancel installation`)}),B&&!z.length&&!c.missingConfig?.length?e.setup?.tasks?.map(t=>(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-inset p-4 text-sm`,children:[(0,A.jsx)(`p`,{children:t}),(0,A.jsx)(y,{asChild:!0,disabled:!e.active,children:(0,A.jsx)(a,{to:`/chat/new?${new URLSearchParams({draft:t,projectScope:`none`})}`,state:{forceNewChat:!0},onClick:t=>{e.active?r?.():t.preventDefault()},children:O(`开始这个任务`,`Start this task`)})})]},t)):null]}),K?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:O(`正在准备,可关闭后继续。`,`Preparing. You can close this window and resume.`)}):null,c?.error&&!c.deferred&&!c.missingConfig?.length?(0,A.jsx)(`p`,{className:`text-sm text-fg-muted`,children:W}):null,p?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p}):null]})}var L=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function R(e,t){if(e.startsWith(`content.skills:`)){let n=e.slice(15);return t?`提供技能:${n}`:`Add skill: ${n}`}if(e.startsWith(`runtime.mcp.stdio:`)){let n=e.slice(18).split(`:`,1)[0];return t?`在 Gateway 上运行工具服务:${n}`:`Run a tool service on the Gateway: ${n}`}if(e.startsWith(`network.mcp:`)){let n=e.slice(12).split(`:`,1)[0];return t?`连接外部工具服务:${n}`:`Connect to an external tool service: ${n}`}return e.startsWith(`runtime.capability-access:`)?t?`按账号授权启用相关技能和工具`:`Enable skills and tools according to account authorization`:e.startsWith(`runtime.authorization:`)?t?`在本机运行账号登录程序:${e.split(`:`)[1]}`:`Run account sign-in locally: ${e.split(`:`)[1]}`:e.startsWith(`runtime.resource:`)?t?`下载可执行资源:${e.split(`:`)[1]}`:`Download executable resource: ${e.split(`:`)[1]}`:e.startsWith(`network.resource:`)?t?`下载并校验资源:${e.split(`:`)[1]}`:`Download and verify resource: ${e.split(`:`)[1]}`:e}function z(e,t){return t?.publisher?.verification!==`verified`||t.latestVersion.riskTier&&t.latestVersion.riskTier!==`content`?!0:e.addedCapabilities.some(e=>!e.startsWith(`content.skills:`))}async function B(e,t,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function V({extension:e,onClose:t,onUninstalled:n,initialSource:r=``,marketplace:a,autoInstall:s=!1}){let ee=g(e=>e.language),u=ee.startsWith(`zh`),ae=a?.localizations?.[u?`zh-CN`:`en`],_=ae?.displayName??a?.name,oe=ae?.description??a?.description,E=(0,k.useId)(),{mutate:ce}=v(),[O,j]=(0,k.useState)(e),[M,N]=(0,k.useState)(r||e?.installationSource||``),[P,F]=(0,k.useState)(null),[V,H]=(0,k.useState)([]),[U,W]=(0,k.useState)(!1),[G,K]=(0,k.useState)(``),[q,J]=(0,k.useState)(!1),[Y,X]=(0,k.useState)(!1),[Z,le]=(0,k.useState)(!1),[ue,Q]=(0,k.useState)(!1),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(!1),he=o(),ge=i(),[_e,ve]=(0,k.useState)(!1),ye=(0,k.useRef)(!1),be=`/api/extensions/agent-plugins/${encodeURIComponent(O?.pluginId??``)}`,xe=M.trim().startsWith(`store:`),Se=()=>ce(`gateway-extensions-list`);async function $(e){W(!0),K(``);try{await e()}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}function Ce(e){N(e),F(null),H([]),K(``)}let we=typeof window<`u`?window.electronAPI?.file:void 0,Te=/^(?:\/|[A-Za-z]:[\\/])/.test(M.trim())?M.trim():void 0;async function Ee(){if(!we?.openDirectory){fe(!0);return}let e=await we.openDirectory(Te?{defaultPath:Te}:void 0);e&&Ce(e)}async function De(){if(!we?.openFile){fe(!0);return}let e=await we.openFile({...Te?{defaultPath:Te}:{},extensions:[`zip`]});e&&Ce(e)}function Oe(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function ke(e){if(!Oe(e))return;e.preventDefault(),Q(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){K(u?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=we?.getPathForFile?.(t[0]);e?Ce(e):K(u?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`The browser cannot read local file paths. Use Choose file or folder to select the package.`);return}let n=e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`);n.trim()&&Ce(n.trim().split(/\r?\n/)[0])}async function Ae(e){let t=await B(`${be}/activation`,`POST`,{enabled:e});j(t),await Se()}async function je(e){let t=!O,n=await B(t?`/api/extensions/install`:`${be}/update`,`POST`,{source:M,reviewHash:e.reviewHash,...e.layout?{setup:!0}:{}});j(n),await Se(),!e.layout&&t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await B(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),j(n),await Se()),F(null),ve(!e.layout&&t&&n.activationEligible===!0)}async function Me(){let e=await B(`/api/extensions/inspect`,`POST`,{source:M});if(z(e,a)){F(e);return}await je(e)}(0,k.useEffect)(()=>{e&&!e.setup&&j(e)},[e]),(0,k.useEffect)(()=>{if(!e?.setup||!e.pluginId)return;let t=!1;return B(`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,`GET`).then(e=>{t||j(e)}).catch(()=>{}),()=>{t=!0}},[e?.pluginId]),(0,k.useEffect)(()=>{!s||O||!xe||ye.current||(ye.current=!0,$(Me))},[s,O,xe]);let Ne=s&&!O&&xe&&!ye.current;return(0,A.jsx)(T,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,A.jsxs)(S,{children:[(0,A.jsx)(b,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,A.jsxs)(C,{className:`fixed left-1/2 top-1/2 z-[131] flex max-h-[min(42rem,calc(100dvh-2rem))] w-[min(38rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(D,{iconUrl:O?.branding?.iconUrl??a?.branding?.iconUrl,fallback:ie}),(0,A.jsx)(w,{className:`font-semibold`,children:O?.name??_??(u?`安装插件`:`Install plugin`)})]}),(0,A.jsx)(y,{variant:`ghost`,onClick:t,children:u?`关闭`:`Close`})]}),(0,A.jsx)(x,{className:`sr-only`,children:u?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-auto space-y-4 overflow-y-auto overscroll-contain p-4`,children:[!O&&xe?(0,A.jsxs)(`section`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:_??P?.manifest.name??M.slice(6)}),oe?(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:oe}):null,(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:a?.publisher?.verification===`verified`?u?`已认证发布者 · 安装后所有 Agent 均可使用`:`Verified publisher · available to all agents after installation`:u?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),P?null:(0,A.jsxs)(y,{className:`w-full`,disabled:U||Ne,onClick:()=>void $(Me),children:[U||Ne?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,U||Ne?u?`正在安全检查并安装…`:`Checking and installing…`:u?`一键安装`:`Install`]})]}):null,O?(0,A.jsxs)(A.Fragment,{children:[_e?(0,A.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-4`,children:[(0,A.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:u?`插件已安装并启用`:`Plugin installed and enabled`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`现在可以直接在对话中使用它。`:`It is ready to use in your conversations.`})]})]}):null,(!O.setup||O.readiness!==`setup_required`)&&!O.activationEligible?(0,A.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-accent-fg`,children:u?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,A.jsx)(y,{disabled:U||O.readiness===`blocked`,onClick:()=>void $(()=>Ae(!0)),children:u?`启用插件`:`Enable plugin`})]}):null,O.setup?(0,A.jsx)(I,{extension:O,zh:u,onStart:t,onInstalled:()=>{t(),he(se(O.pluginId,`installed`,!1,ge.pathname+ge.search))},onChanged:async()=>{let e=await B(`${be}`,`GET`);j(e),await Se()}}):null,(0,A.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:u?`插件详情`:`Plugin details`}),(0,A.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[u?`插件`:`Plugin`,` · `,O.version,` · `,O.readiness&&{ready:u?`已就绪`:`Ready`,setup_required:u?`待连接`:`Setup required`,degraded:u?`部分不可用`:`Partially available`,blocked:u?`已阻止`:`Blocked`}[O.readiness]]}),O.provenance?(0,A.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[O.provenance.publisherVerification===`verified`?u?`已认证发布者`:`Verified publisher`:u?`社区发布者`:`Community publisher`,` · `,O.provenance.packageName,`@`,O.provenance.version,` · SHA-256 `,O.provenance.sha256.slice(0,12),`…`,O.provenance.riskTier?` · ${O.provenance.riskTier}`:``]}):null,(0,A.jsx)(`p`,{className:`text-sm`,children:O.description}),O.installationSource?(0,A.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[u?`来源:`:`Source: `,O.installationSource,O.resolvedCommit?` · ${O.resolvedCommit.slice(0,12)}`:``]}):null,O.activationEligible?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(()=>Ae(!1)),children:u?`停用`:`Disable`}):null,O.canRollback?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(async()=>{j(await B(`${be}/rollback`,`POST`)),await Se()}),children:u?`回滚上一版本`:`Roll back`}):null]})]}),O.diagnostics?.map((e,t)=>(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,O?(0,A.jsxs)(y,{variant:`ghost`,className:`px-0`,"aria-expanded":pe,onClick:()=>me(e=>!e),children:[(0,A.jsx)(c,{className:h(`size-4 transition-transform motion-reduce:transition-none`,pe&&`rotate-180`),"aria-hidden":!0}),u?`高级操作`:`Advanced actions`]}):null,!O&&!xe||pe?(0,A.jsxs)(`form`,{className:h(`space-y-3`,O&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),$(async()=>{let e=await B(`/api/extensions/inspect`,`POST`,{source:M});e.candidates?(H(e.candidates),F(null)):(H([]),F(e))})},children:[(0,A.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:h(`rounded-xl border border-dashed p-3 transition-colors`,ue?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{Oe(e)&&(e.preventDefault(),Q(!0))},onDragOver:e=>{Oe(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,Q(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Q(!1)},onDrop:ke,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,A.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:E,className:`block text-sm font-medium`,children:O?u?`更新包来源`:`Update package source`:u?`安装包来源`:`Package source`}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u?`输入 github:组织/仓库、Git / ZIP 地址或宿主目录;marketplace 可选择插件。`:`Enter github:owner/repo, a Git / ZIP URL or a Gateway directory. Marketplaces let you choose a plugin.`})]})]}),(0,A.jsx)(`input`,{id:E,className:L,value:M,onChange:e=>Ce(e.target.value),placeholder:u?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:we?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(Ee),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择目录`:`Choose directory`]}),(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(De),children:[(0,A.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),u?`选择 ZIP`:`Choose ZIP`]})]}):(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>fe(!0),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择文件或目录`:`Choose file or folder`]})})]}),(0,A.jsx)(y,{type:`submit`,variant:`secondary`,disabled:U||!M,children:u?`检查安装包`:`Inspect package`})]}):null,V.length?(0,A.jsx)(`div`,{className:`space-y-2`,"aria-label":u?`选择插件`:`Choose a plugin`,children:V.map(e=>(0,A.jsx)(y,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>{Ce(e.source),$(async()=>F(await B(`/api/extensions/inspect`,`POST`,{source:e.source})))},children:e.name},e.source))}):null,P?(0,A.jsxs)(`div`,{role:`region`,"aria-labelledby":`plugin-authorization-title`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:u?`需要你的授权`:`Your authorization is required`}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:u?`此插件需要以下新增能力。确认后自动准备资源,按需登录账号,所有 Agent 均可使用。`:`Review these capabilities. Resources are prepared automatically; sign in if needed. Available to all agents.`})]})]}),(0,A.jsx)(`ul`,{tabIndex:0,"aria-label":u?`插件新增能力`:`Added plugin capabilities`,className:`max-h-[min(28vh,14rem)] space-y-2 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-panel p-3 break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:P.addedCapabilities.map(e=>(0,A.jsxs)(`li`,{className:`flex gap-2`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,A.jsx)(`span`,{children:R(e,u)})]},e))}),P.diagnostics.map((e,t)=>(0,A.jsxs)(`p`,{children:[e.component,`: `,e.message]},t))]}):null,O&&pe?(0,A.jsx)(`div`,{className:`border-t border-edge pt-4`,children:Z?(0,A.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,A.jsx)(`p`,{children:u?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:q,onChange:e=>J(e.target.checked)}),u?`同时删除插件数据`:`Also delete plugin data`]}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:e=>X(e.target.checked)}),u?`同时删除本地凭据`:`Also delete local credentials`]}),(0,A.jsx)(y,{disabled:U,onClick:()=>void $(async()=>{await B(be,`DELETE`,{removeData:q,removeCredentials:Y}),await Se(),(n??t)()}),children:u?`确认卸载`:`Confirm uninstall`})]}):(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>le(!0),children:u?`卸载插件`:`Uninstall`})}):null,G?(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:G}):null]}),P?(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge p-4`,children:[(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>F(null),children:u?`取消`:`Cancel`}),(0,A.jsxs)(y,{disabled:U||!!O&&P.manifest.name!==O.name,onClick:()=>void $(()=>je(P)),children:[U?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,u?`授权并安装`:`Authorize and install`]})]}):null]}),we?null:(0,A.jsx)(l,{open:de,onOpenChange:fe,initialAbsolutePath:Te,onConfirm:async e=>Ce(e),wd:m(ee).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:u?`选择插件安装包`:`Choose plugin package`,description:u?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:u?`使用此来源`:`Use this source`,nested:!0})]})})}export{I as n,V as t};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-C477bTtO.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/unlink-BEuthaaq.js","assets/createLucideIcon-DPHK1VkS.js","assets/check-DUBLcKHA.js","assets/copy-Dv6d4Dvw.js","assets/external-link-DjqjBmc3.js","assets/notes-api-C_458rv5.js","assets/markdown-view-CJt-i2Dp.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/download-Dk-ZjtO6.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/messages-DRR9N3HC.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/locale-store-lIXD1FMw.js","assets/dist-DfWfZ9iu.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/app-link-CytZ5zkp.js","assets/product-delivery-BU_H84jL.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/chat-chart-block-K2t333qv.js","assets/skeleton-BI5TyibZ.js","assets/list-todo-CTVRto8O.js","assets/loader-circle-CifKLtgG.js","assets/mic-CuUb7zc-.js","assets/pause-DuPxgSxk.js","assets/pencil-DmIY3Oa-.js","assets/play-kxZvpBg8.js","assets/vendor-swr-CdRzEUwF.js","assets/floating-ui.dom-seOukHzT.js","assets/vendor-codemirror-aCQ0FcJT.js","assets/with-selector-xonYxPoM.js","assets/note-image-lightbox-CivkB6LB.js","assets/block-editor-Cvy3D_4T.css","assets/markdown-editor-BuuGlcfG.js","assets/languages-zXtNocoy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
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"./preload-helper-Czpn1I53.js";import{u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as o}from"./bot-DjLkhyZL.js";import{t as s}from"./briefcase-business-BsoCaI_t.js";import{i as c,s as l}from"./popover-select-DniHw2dy.js";import{t as u}from"./code-xml-DJtYhZUF.js";import{t as d}from"./ellipsis-0k4rZLoy.js";import{t as f}from"./eye-CABVeTq0.js";import{t as p}from"./heart-Cp4rgrqn.js";import{t as m}from"./markdown-view-CJt-i2Dp.js";import{t as h}from"./message-square-plus-XP0tGdlV.js";import{t as g}from"./pencil-DmIY3Oa-.js";import{t as _}from"./plus-Q2yW6OE7.js";import{t as v}from"./rotate-ccw-JM1TBLpp.js";import{t as y}from"./settings-uiTATseT.js";import{t as b}from"./sliders-horizontal-DqsYor6I.js";import{t as x}from"./triangle-alert-2JXFNNKU.js";import{t as S}from"./upload-rrb46c3c.js";import{t as C}from"./x-B_N4OPjy.js";import{t as w}from"./messages-DRR9N3HC.js";import{t as T}from"./cn-0WouolD0.js";import{l as E,n as D}from"./locale-store-lIXD1FMw.js";import{i as O}from"./vendor-swr-CdRzEUwF.js";import{t as k}from"./button-CnRSIP6m.js";import{t as A}from"./skeleton-BI5TyibZ.js";import{a as j,i as M,n as N,o as P,r as F,s as I,t as L}from"./dist-DfWfZ9iu.js";import{i as R,o as z}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as B}from"./specialists-xbB3xL9e.js";import{a as V}from"./new-session-preferences-gb411vZP.js";import{n as H}from"./interaction-BdhHBbYa.js";import{r as U}from"./gateway-config-swr-BAmUhiP1.js";import{n as W,t as G}from"./registry-api-n8TwtJ_j.js";import{c as ee,i as K,l as te,n as q,o as ne,r as re,s as ie,t as J}from"./agents-admin-api-CyjykMEh.js";import{i as ae}from"./theme-store-DW45fWYQ.js";import{t as oe}from"./page-tabs-oeTY7z3_.js";import{i as se,r as ce,s as le,t as ue}from"./agent-avatar-display-Cy50vjbq.js";import{t as de}from"./sliding-tab-list-DuQyViqe.js";import{t as Y}from"./confirm-dialog-XGclfBqe.js";import{a as fe,c as pe,o as me,r as he,t as ge}from"./dist-DNCdG_qB.js";import{n as _e}from"./model-selector-DCYA_ntf.js";import{n as ve,t as ye}from"./agents-app-path-ciChvpCS.js";import{n as be,r as xe,t as Se}from"./agent-display-names-Bje7vfSn.js";import{t as Ce}from"./settings-advanced-section-BqoVSko2.js";import{t as we}from"./use-media-query-ady-FgjK.js";import{t as Te}from"./number-input-El7Szeln.js";import{n as Ee}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{t as De}from"./phone-model-picker-u8YIQCgo.js";import{t as Oe}from"./directory-picker-path-field-D4jMhpka.js";import{r as ke,s as Ae}from"./image-generation-api-I_JgLL_m.js";var X=e(t(),1),Z=n();function je(e){let t=e.match(/^(---\r?\n[\s\S]*?\r?\n---(?:\r?\n)*)/);return t?{frontMatter:t[1],body:e.slice(t[1].length)}:{frontMatter:``,body:e}}function Me(e,t){let{frontMatter:n}=je(e);return`${n}${t}`}var Ne=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
3
|
+
|
|
4
|
+
## Core Truths
|
|
5
|
+
|
|
6
|
+
**Be genuinely helpful, not performatively helpful.** Skip the filler words — just help. Actions speak louder than pleasantries.
|
|
7
|
+
|
|
8
|
+
**Be precise and efficient.** Value the user's time. Give concise, actionable answers. Expand only when asked.
|
|
9
|
+
|
|
10
|
+
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones (reading, organizing, learning).
|
|
11
|
+
|
|
12
|
+
**Remember you're a guest.** You have access to someone's life. Treat it with respect.
|
|
13
|
+
|
|
14
|
+
## Boundaries
|
|
15
|
+
|
|
16
|
+
- Private things stay private. Period.
|
|
17
|
+
- When in doubt, ask before acting externally.
|
|
18
|
+
- Never send half-baked replies to messaging surfaces.
|
|
19
|
+
|
|
20
|
+
## Vibe
|
|
21
|
+
|
|
22
|
+
Professional, competent, and respectful. Concise when needed, thorough when it matters.`},{id:`casual`,labelEn:`Warm & Friendly`,labelZh:`轻松友好`,emoji:`😊`,content:`# SOUL.md - Who You Are
|
|
23
|
+
|
|
24
|
+
## Core Truths
|
|
25
|
+
|
|
26
|
+
**Be a good friend, not a corporate drone.** Be warm, genuine, and real. Skip the formality when it gets in the way.
|
|
27
|
+
|
|
28
|
+
**Have personality.** You're allowed to be amused, surprised, or excited. An assistant with no personality is just a search engine.
|
|
29
|
+
|
|
30
|
+
**Be resourceful before asking.** Try to figure it out first. Then ask if you're stuck.
|
|
31
|
+
|
|
32
|
+
**Earn trust by being reliable.** Show up, follow through, and remember what matters.
|
|
33
|
+
|
|
34
|
+
**Respect the intimacy.** You have access to someone's life. That's a privilege.
|
|
35
|
+
|
|
36
|
+
## Boundaries
|
|
37
|
+
|
|
38
|
+
- Private things stay private. Always.
|
|
39
|
+
- When in doubt, ask before acting externally.
|
|
40
|
+
- Be careful in group chats — you're not the user's voice.
|
|
41
|
+
|
|
42
|
+
## Vibe
|
|
43
|
+
|
|
44
|
+
Warm, friendly, and a little playful. Like a helpful friend who happens to know everything.`},{id:`geeky`,labelEn:`Geeky & Witty`,labelZh:`极客风格`,emoji:`🧑💻`,content:`# SOUL.md - Who You Are
|
|
45
|
+
|
|
46
|
+
## Core Truths
|
|
47
|
+
|
|
48
|
+
**Precision over politeness.** "This is broken" beats "This might be worth considering." Be direct.
|
|
49
|
+
|
|
50
|
+
**Have opinions.** Disagree, prefer things, find stuff interesting or dull. No personality = no value.
|
|
51
|
+
|
|
52
|
+
**Go deep.** When something is interesting, explore it. Surface-level answers are for search engines.
|
|
53
|
+
|
|
54
|
+
**Be resourceful.** Read the file. Check the context. Search for it. Come back with answers, not questions.
|
|
55
|
+
|
|
56
|
+
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones.
|
|
57
|
+
|
|
58
|
+
## Boundaries
|
|
59
|
+
|
|
60
|
+
- Private things stay private.
|
|
61
|
+
- When in doubt, ask before acting externally.
|
|
62
|
+
- Never send half-baked replies.
|
|
63
|
+
|
|
64
|
+
## Vibe
|
|
65
|
+
|
|
66
|
+
Sharp, direct, slightly nerdy. The kind of engineer you'd want on your team — competent, opinionated, and occasionally funny.`},{id:`custom`,labelEn:`Custom`,labelZh:`自定义`,emoji:`✍️`,content:``}],Pe=[{value:`AI assistant`,labelEn:`AI Assistant`,labelZh:`AI 助手`},{value:`robot`,labelEn:`Robot`,labelZh:`机器人`},{value:`familiar`,labelEn:`Familiar`,labelZh:`精灵`},{value:`ghost in the machine`,labelEn:`Ghost in the machine`,labelZh:`机器幽灵`},{value:`digital companion`,labelEn:`Digital Companion`,labelZh:`数字伙伴`}],Q=r(),Fe=()=>i(()=>import(`./block-editor-C477bTtO.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])),Ie=()=>i(()=>import(`./markdown-editor-BuuGlcfG.js`),__vite__mapDeps([45,1,2,41,46,11])),Le=(0,X.lazy)(()=>Fe().then(e=>({default:e.BlockEditor}))),Re=(0,X.lazy)(()=>Ie().then(e=>({default:e.MarkdownEditor})));function ze(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-3 p-5`,"aria-busy":`true`,children:[(0,Q.jsx)(A,{className:`h-8 w-52`}),(0,Q.jsx)(A,{className:`h-4 w-full`}),(0,Q.jsx)(A,{className:`h-4 w-4/5`}),(0,Q.jsx)(A,{className:`h-4 w-11/12`})]}),e[0]=t):t=e[0],t}var Be=(0,X.forwardRef)(function({agentId:e,file:t,zh:n,onDirtyChange:r},i){let a=ae(e=>e.resolved===`dark`),[c,l]=(0,X.useState)(``),[d,h]=(0,X.useState)(``),[_,v]=(0,X.useState)(!0),[y,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),[E,D]=(0,X.useState)(!1),[O,k]=(0,X.useState)(!1),[A,j]=(0,X.useState)(null),[M,N]=(0,X.useState)(`direct`);(0,X.useEffect)(()=>{let n=!1;return v(!0),b(!1),w(null),l(``),h(``),D(!1),j(null),(async()=>{try{let r=await K(e),i=new Set(r.files.filter(e=>!e.missing).map(e=>e.name)).has(t)?await re(e,t):``;if(n)return;l(i),h(i)}catch(e){if(n)return;b(!0),w(e instanceof Error?e.message:String(e))}finally{n||v(!1)}})(),()=>{n=!0}},[e,t]);let P=c!==d;(0,X.useEffect)(()=>r(P),[P,r]);let F=(0,X.useCallback)(async()=>{if(P){S(!0),w(null);try{await ie(e,t,c),h(c),D(!0),j(null)}catch(e){throw w(e instanceof Error?e.message:String(e)),e}finally{S(!1)}}},[e,t,P,c]);(0,X.useImperativeHandle)(i,()=>({save:F}),[F]);let I={"SOUL.md":{label:n?`个性与边界`:`Personality & boundaries`,description:n?`定义语气、价值观、行为原则与安全边界。`:`Tone, values, behavior principles, and safety boundaries.`},"TOOLS.md":{label:n?`工具使用约定`:`Tool guidance`,description:n?`补充工具偏好和使用约定,不负责授予权限。`:`Tool preferences and conventions; this does not grant access.`},"AGENTS.md":{label:n?`工作规范`:`Working instructions`,description:n?`该智能体长期遵循的协作和执行规范。`:`Persistent collaboration and execution instructions.`}},L=[s,p,u,g],R=je(c).body;return(0,Q.jsx)(`div`,{className:`space-y-5`,children:(0,Q.jsx)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:(0,Q.jsxs)(`div`,{className:`p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:I[t].label}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:I[t].description})]}),(0,Q.jsx)(de,{className:`flex rounded-lg bg-surface-hover p-1`,role:`group`,"aria-label":n?`编辑模式`:`Editor mode`,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`direct`,g,n?`直接编辑`:`Visual`],[`source`,u,`Markdown`],[`preview`,f,n?`预览`:`Preview`]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>N(e),"aria-pressed":M===e,className:T(`inline-flex min-h-9 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,M===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:[(0,Q.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),n]},e))})]}),t===`SOUL.md`&&!_?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`button`,{type:`button`,disabled:y,"aria-expanded":O,onClick:()=>k(!O),className:`text-xs font-medium text-accent hover:underline`,children:n?`使用模板`:`Use a template`}),A===null?null:(0,Q.jsx)(`button`,{type:`button`,className:`ml-3 text-xs text-accent hover:underline`,onClick:()=>{l(A),j(null)},children:n?`撤销模板替换`:`Undo template replacement`}),O?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`my-2 text-xs text-fg-muted`,children:n?`模板会替换当前个性正文,保存前可以撤销。`:`A template replaces the personality text. You can undo before saving.`}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:Ne.map((e,t)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{e.content&&(j(c),l(t=>Me(t,e.content))),N(`direct`)},className:`flex min-h-11 items-center gap-2 rounded-xl border border-edge px-3 py-2 text-left text-xs font-medium text-fg-muted transition-colors hover:border-accent/40 hover:bg-surface-hover hover:text-fg`,children:[(0,Q.jsx)(L[t]??o,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),n?e.labelZh:e.labelEn]},e.id))})]}):null]}):null,C?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,role:`alert`,children:C}):null,(0,Q.jsx)(`div`,{className:`mt-4 h-[min(40vh,22rem)] min-h-64 overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:_?(0,Q.jsx)(ze,{}):y?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-center text-sm text-fg-muted`,children:n?`无法加载角色配置,未对文件进行任何更改。`:`Profile documents could not be loaded. No files were changed.`}):M===`direct`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(ze,{}),children:(0,Q.jsx)(Le,{initialContent:R,onChange:e=>l(t=>Me(t,e)),placeholder:n?`直接输入内容,或输入 / 使用快捷命令…`:`Start writing, or type / for commands…`},`${e}-${t}-direct`)}):M===`source`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(ze,{}),children:(0,Q.jsx)(Re,{initialContent:c,onChange:e=>l(e),isDark:a,lineWrap:!0,className:`min-h-0 flex-1`},`${e}-${t}-source`)}):(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto p-5`,children:R.trim()?(0,Q.jsx)(m,{content:R}):(0,Q.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:n?`暂无内容。`:`No content yet.`})})}),(0,Q.jsx)(`div`,{className:`mt-2 flex justify-end text-xs text-fg-muted`,"aria-live":`polite`,children:x?n?`正在保存角色配置…`:`Saving profile documents…`:P?n?`角色配置有未保存的更改`:`Profile documents have unsaved changes`:E?n?`文档更改已保存`:`Document changes saved`:n?`未修改`:`No changes`})]})})})});function Ve(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-medium text-accent`,children:n}),t[0]=n,t[1]=r),r}function He(e){let t=(0,Z.c)(74),{label:n,inherited:r,value:i,zh:a,allowChatFallback:o,allowDisabled:s,modelKind:c,onChange:l}=e,u=o!==void 0&&o,d=s!==void 0&&s,f=c===void 0?`text`:c,p=i!=null,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={revalidateOnFocus:!1},t[0]=m):m=t[0];let h=O(p&&f!==`image`?G:null,W,m),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1},t[1]=g):g=t[1];let _=O(p&&f===`image`?`agent-defaults-image-models`:null,ke,g),v;t[2]===_.data?v=t[3]:(v=_.data??[],t[2]=_.data,t[3]=v);let y;t[4]===v?y=t[5]:(y=v.flatMap(We),t[4]=v,t[5]=y);let b=y,x;t[6]!==b||t[7]!==f||t[8]!==h?(x=f===`image`?b:h.data??[],t[6]=b,t[7]=f,t[8]=h,t[9]=x):x=t[9];let S=x,C;t[10]!==f||t[11]!==S?(C=f===`vision`?S.filter(Ue):S,t[10]=f,t[11]=S,t[12]=C):C=t[12];let w=C,T=f===`image`?_:h,E;t[13]===n?E=t[14]:(E=(0,Q.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:n}),t[13]=n,t[14]=E);let D;t[15]!==i||t[16]!==a?(D=i===void 0?(0,Q.jsx)(Ve,{children:a?`继承全局`:`Inherited globally`}):null,t[15]=i,t[16]=a,t[17]=D):D=t[17];let j;t[18]!==d||t[19]!==i||t[20]!==a?(j=i===null?(0,Q.jsx)(Ve,{children:d?a?`已禁用`:`Disabled`:a?`使用 Chat`:`Uses Chat`}):null,t[18]=d,t[19]=i,t[20]=a,t[21]=j):j=t[21];let M;t[22]!==E||t[23]!==D||t[24]!==j?(M=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[E,D,j]}),t[22]=E,t[23]=D,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==r?.primary||t[27]!==i||t[28]!==a?(N=i===void 0?(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,children:r?.primary??(a?`全局未配置`:`Not configured globally`)}):null,t[26]=r?.primary,t[27]=i,t[28]=a,t[29]=N):N=t[29];let P;t[30]!==M||t[31]!==N?(P=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[M,N]}),t[30]=M,t[31]=N,t[32]=P):P=t[32];let F;t[33]!==l||t[34]!==i||t[35]!==a?(F=i===void 0?null:(0,Q.jsx)(k,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(void 0),children:a?`继承全局`:`Inherit globally`}),t[33]=l,t[34]=i,t[35]=a,t[36]=F):F=t[36];let I;t[37]!==u||t[38]!==l||t[39]!==i||t[40]!==a?(I=u&&i!==null?(0,Q.jsx)(k,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`使用 Chat`:`Use Chat`}):null,t[37]=u,t[38]=l,t[39]=i,t[40]=a,t[41]=I):I=t[41];let L;t[42]!==d||t[43]!==l||t[44]!==i||t[45]!==a?(L=d&&i!==null?(0,Q.jsx)(k,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>l(null),children:a?`禁用`:`Disable`}):null,t[42]=d,t[43]=l,t[44]=i,t[45]=a,t[46]=L):L=t[46];let R;t[47]!==p||t[48]!==r?.fallbacks||t[49]!==r?.primary||t[50]!==l||t[51]!==a?(R=p?null:(0,Q.jsx)(k,{className:`px-2 py-1 text-xs`,onClick:()=>l({primary:r?.primary??``,fallbacks:[...r?.fallbacks??[]]}),children:a?`单独设置`:`Override for this agent`}),t[47]=p,t[48]=r?.fallbacks,t[49]=r?.primary,t[50]=l,t[51]=a,t[52]=R):R=t[52];let z;t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R?(z=(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[F,I,L,R]}),t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z):z=t[57];let B;t[58]!==P||t[59]!==z?(B=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[P,z]}),t[58]=P,t[59]=z,t[60]=B):B=t[60];let V;t[61]!==w||t[62]!==p||t[63]!==n||t[64]!==f||t[65]!==S||t[66]!==l||t[67]!==T||t[68]!==i||t[69]!==a?(V=p?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)]`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:a?`主模型`:`Primary model`}),T.isLoading?(0,Q.jsx)(A,{className:`mt-1.5 h-11 w-full rounded-lg`}):(0,Q.jsx)(_e,{value:i.primary,models:S,modelsLoading:T.isLoading,modelsError:T.error,capabilitiesFilter:f===`vision`?`vision`:void 0,placeholder:a?`选择模型`:`Select a model`,searchPlaceholder:a?`搜索模型或服务商`:`Search models or providers`,noMatches:a?`没有匹配的模型`:`No matching models`,contentAlign:`start`,className:`mt-1.5 w-full`,ariaLabel:a?`${n}主模型`:`${n} primary model`,onChange:e=>l({...i,primary:e})})]}),(0,Q.jsx)(Ce,{title:a?`备用模型`:`Fallback models`,summary:a?`已配置 ${i.fallbacks.length} 个备用模型`:`${i.fallbacks.length} fallback models configured`,children:(0,Q.jsx)(Ae,{primary:i.primary,value:i.fallbacks,models:w,loading:T.isLoading,error:T.error,zh:a,onChange:e=>l({...i,fallbacks:e})})})]}):null,t[61]=w,t[62]=p,t[63]=n,t[64]=f,t[65]=S,t[66]=l,t[67]=T,t[68]=i,t[69]=a,t[70]=V):V=t[70];let H;return t[71]!==B||t[72]!==V?(H=(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[B,V]}),t[71]=B,t[72]=V,t[73]=H):H=t[73],H}function Ue(e){return e.vision}function We(e){return e.models.map(t=>({id:`${e.id}/${t}`,name:t,provider:e.label}))}function Ge(e){let t=(0,Z.c)(88),{agentId:n,avatar:r,zh:i,disabled:a,pending:o,onPendingChange:s,onReadingChange:c,onChange:l}=e,[u,d]=(0,X.useState)(!1),f=(0,X.useRef)(null),p=(0,X.useRef)(null),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(null),v,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>p.current?.abort(),y=[],t[0]=v,t[1]=y):(v=t[0],y=t[1]),(0,X.useEffect)(v,y);let b=i?`自动头像`:`Automatic`,x;t[2]===b?x=t[3]:(x={value:``,label:b},t[2]=b,t[3]=x);let C=i?`Loopi · 平静`:`Loopi · Calm`,w;t[4]===C?w=t[5]:(w={value:`xopc:loopi:idle`,label:C},t[4]=C,t[5]=w);let E=i?`Loopi · 温暖`:`Loopi · Warm`,D;t[6]===E?D=t[7]:(D={value:`xopc:loopi:care`,label:E},t[6]=E,t[7]=D);let O=i?`Loopi · 好奇`:`Loopi · Curious`,A;t[8]===O?A=t[9]:(A={value:`xopc:loopi:curious`,label:O},t[8]=O,t[9]=A);let j=i?`Loopi · 倾听`:`Loopi · Listening`,M;t[10]===j?M=t[11]:(M={value:`xopc:loopi:listen`,label:j},t[10]=j,t[11]=M);let N;t[12]===n?N=t[13]:(N=se(`bottts`,n),t[12]=n,t[13]=N);let P=i?`机器人`:`Robot`,F;t[14]!==N||t[15]!==P?(F={value:N,label:P},t[14]=N,t[15]=P,t[16]=F):F=t[16];let I;t[17]===n?I=t[18]:(I=se(`adventurer`,n),t[17]=n,t[18]=I);let L=i?`插画人物`:`Illustration`,R;t[19]!==I||t[20]!==L?(R={value:I,label:L},t[19]=I,t[20]=L,t[21]=R):R=t[21];let z;t[22]!==A||t[23]!==M||t[24]!==F||t[25]!==R||t[26]!==x||t[27]!==w||t[28]!==D?(z=[x,w,D,A,M,F,R],t[22]=A,t[23]=M,t[24]=F,t[25]=R,t[26]=x,t[27]=w,t[28]=D,t[29]=z):z=t[29];let B=z,V=B.find(e=>e.value===(r??``))?.label??(i?`自定义头像`:`Custom avatar`),H;t[30]!==l||t[31]!==s||t[32]!==c||t[33]!==i?(H=e=>{if(!e)return;if(_(null),![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)){_(i?`请选择 PNG、JPG 或 WebP 图片。`:`Choose a PNG, JPG, or WebP image.`);return}if(!e.size||e.size>524288){_(i?`图片不能为空,且不能超过 512 KB。`:`The image must be non-empty and at most 512 KB.`);return}h(!0),c(!0);let t=new FileReader;p.current=t;let n=()=>{h(!1),c(!1),p.current=null};t.onload=()=>{let r=String(t.result);s({base64:r.slice(r.indexOf(`,`)+1),mimeType:e.type,preview:r}),l(ce),n()},t.onerror=()=>{_(i?`图片读取失败,请重新选择。`:`Could not read the image. Choose it again.`),n()},t.readAsDataURL(e)},t[30]=l,t[31]=s,t[32]=c,t[33]=i,t[34]=H):H=t[34];let U=H,W;t[35]===U?W=t[36]:(W=(0,Q.jsx)(`input`,{ref:f,type:`file`,accept:`image/png,image/jpeg,image/webp`,hidden:!0,onChange:e=>{U(e.target.files?.[0]),e.target.value=``}}),t[35]=U,t[36]=W);let G=a||m,ee;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>f.current?.click(),t[37]=ee):ee=t[37];let K=i?`上传头像`:`Upload avatar`,te=`avatar-help-${n}`,q;t[38]!==n||t[39]!==r||t[40]!==o?(q=o?(0,Q.jsx)(`img`,{src:o.preview,alt:``,width:64,height:64,className:`size-full object-cover`}):(0,Q.jsx)(ue,{agentId:n,avatar:r,size:64}),t[38]=n,t[39]=r,t[40]=o,t[41]=q):q=t[41];let ne;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{className:`absolute inset-x-0 bottom-0 flex h-5 items-center justify-center bg-black/55 text-white`,children:(0,Q.jsx)(S,{className:`size-3`,"aria-hidden":!0})}),t[42]=ne):ne=t[42];let re;t[43]!==G||t[44]!==K||t[45]!==te||t[46]!==q?(re=(0,Q.jsxs)(`button`,{type:`button`,disabled:G,onClick:ee,"aria-label":K,"aria-describedby":te,className:`group relative size-16 shrink-0 overflow-hidden rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent disabled:opacity-50`,children:[q,ne]}),t[43]=G,t[44]=K,t[45]=te,t[46]=q,t[47]=re):re=t[47];let ie=i?`头像`:`Avatar`,J;t[48]===ie?J=t[49]:(J=(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:ie}),t[48]=ie,t[49]=J);let ae=m?i?`正在读取图片…`:`Reading image…`:o?i?`新头像 · 保存后生效`:`New avatar · save to apply`:V,oe;t[50]===ae?oe=t[51]:(oe=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:ae}),t[50]=ae,t[51]=oe);let le=`avatar-help-${n}`,de=i?`点击头像上传 · PNG、JPG、WebP · 最大 512 KB`:`Click to upload · PNG, JPG, WebP · Max 512 KB`,Y;t[52]!==le||t[53]!==de?(Y=(0,Q.jsx)(`p`,{id:le,className:`mt-1 text-xs text-fg-muted`,children:de}),t[52]=le,t[53]=de,t[54]=Y):Y=t[54];let fe;t[55]!==J||t[56]!==oe||t[57]!==Y?(fe=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[J,oe,Y]}),t[55]=J,t[56]=oe,t[57]=Y,t[58]=fe):fe=t[58];let pe=a||m,me=`avatar-options-${n}`,he;t[59]===u?he=t[60]:(he=()=>d(!u),t[59]=u,t[60]=he);let ge=u?i?`收起选择`:`Hide choices`:i?`默认头像`:`Built-in avatars`,_e;t[61]!==u||t[62]!==pe||t[63]!==me||t[64]!==he||t[65]!==ge?(_e=(0,Q.jsx)(k,{variant:`ghost`,disabled:pe,"aria-expanded":u,"aria-controls":me,onClick:he,children:ge}),t[61]=u,t[62]=pe,t[63]=me,t[64]=he,t[65]=ge,t[66]=_e):_e=t[66];let ve;t[67]!==W||t[68]!==re||t[69]!==fe||t[70]!==_e?(ve=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[W,re,fe,_e]}),t[67]=W,t[68]=re,t[69]=fe,t[70]=_e,t[71]=ve):ve=t[71];let ye;t[72]!==n||t[73]!==r||t[74]!==u||t[75]!==a||t[76]!==l||t[77]!==s||t[78]!==B||t[79]!==m||t[80]!==i?(ye=u?(0,Q.jsx)(`div`,{id:`avatar-options-${n}`,className:`grid grid-cols-3 gap-2 sm:grid-cols-4`,role:`group`,"aria-label":i?`选择头像`:`Choose avatar`,children:B.map(e=>(0,Q.jsxs)(`button`,{type:`button`,disabled:a||m,"aria-pressed":(r??``)===e.value,onClick:()=>{s(null),l(e.value),_(null)},className:T(`flex min-h-24 flex-col items-center gap-2 rounded-xl border p-3 text-xs transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,(r??``)===e.value?`border-accent bg-accent-soft text-fg`:`border-edge bg-surface-panel text-fg-muted hover:bg-surface-hover`),children:[(0,Q.jsx)(ue,{agentId:n,avatar:e.value,size:44}),e.label]},e.value))}):null,t[72]=n,t[73]=r,t[74]=u,t[75]=a,t[76]=l,t[77]=s,t[78]=B,t[79]=m,t[80]=i,t[81]=ye):ye=t[81];let be;t[82]===g?be=t[83]:(be=g?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:g}):null,t[82]=g,t[83]=be);let xe;return t[84]!==ve||t[85]!==ye||t[86]!==be?(xe=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[ve,ye,be]}),t[84]=ve,t[85]=ye,t[86]=be,t[87]=xe):xe=t[87],xe}var Ke={version:1,domains:[],taskTypes:[],inputKinds:[],outputKinds:[],specialties:[],examples:[],limitations:[]},qe=`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none focus:border-accent`,Je=e=>e.split(`
|
|
67
|
+
`).map(e=>e.trim()).filter(Boolean);function Ye(e){let t=(0,Z.c)(21),{value:n,label:r,hint:i,onChange:a,max:o}=e,s;t[0]===n?s=t[1]:(s=n.join(`
|
|
68
|
+
`),t[0]=n,t[1]=s);let[c,l]=(0,X.useState)(s),u,d;t[2]!==c||t[3]!==n?(u=()=>{JSON.stringify(Je(c))!==JSON.stringify(n)&&l(n.join(`
|
|
69
|
+
`))},d=[n,c],t[2]=c,t[3]=n,t[4]=u,t[5]=d):(u=t[4],d=t[5]),(0,X.useEffect)(u,d);let f;t[6]===a?f=t[7]:(f=e=>{l(e.target.value),a(Je(e.target.value))},t[6]=a,t[7]=f);let p;t[8]!==i||t[9]!==f||t[10]!==c?(p=(0,Q.jsx)(`textarea`,{rows:3,className:qe,value:c,placeholder:i,onChange:f}),t[8]=i,t[9]=f,t[10]=c,t[11]=p):p=t[11];let m;t[12]===c?m=t[13]:(m=Je(c),t[12]=c,t[13]=m);let h;t[14]!==o||t[15]!==m.length?(h=(0,Q.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[m.length,`/`,o]}),t[14]=o,t[15]=m.length,t[16]=h):h=t[16];let g;return t[17]!==r||t[18]!==p||t[19]!==h?(g=(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[r,p,h]}),t[17]=r,t[18]=p,t[19]=h,t[20]=g):g=t[20],g}var Xe={general:`通用`,coordination:`协调`,software:`软件开发`,writing:`写作`,research:`研究`,data:`数据`,design:`设计`,operations:`运营`,general_assistance:`日常协助`,task_planning:`任务规划`,bug_fix:`修复 Bug`,implementation:`功能开发`,code_review:`代码审查`,editing:`编辑润色`,news_research:`新闻研究`,data_analysis:`数据分析`,data_cleaning:`数据清洗`,image_generation:`生成图片`,automation:`自动化`,text:`文本`,repository:`代码仓库`,csv:`CSV`,spreadsheet:`电子表格`,web_page:`网页`,image:`图片`,answer:`回答`,plan:`计划`,code_patch:`代码修改`,document:`文档`,report:`报告`,chart:`图表`,script:`脚本`,design_brief:`设计说明`};function Ze(e){let t=(0,Z.c)(48),{field:n,value:r,label:i,zh:a,onChange:o}=e,s=B[n],l;if(t[0]!==r||t[1]!==s){let e;t[3]===s?e=t[4]:(e=e=>!s.includes(e),t[3]=s,t[4]=e),l=r.filter(e),t[0]=r,t[1]=s,t[2]=l}else l=t[2];let u=l,d;t[5]===a?d=t[6]:(d=e=>a?Xe[e]??e:e.replaceAll(`_`,` `),t[5]=a,t[6]=d);let f=d,p;t[7]!==f||t[8]!==r||t[9]!==a?(p=r.length?r.map(f).join(` · `):a?`选择适用项`:`Select applicable items`,t[7]=f,t[8]=r,t[9]=a,t[10]=p):p=t[10];let m;t[11]===p?m=t[12]:(m=(0,Q.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-fg-muted`,children:p}),t[11]=p,t[12]=m);let h;t[13]!==i||t[14]!==m?(h=(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[i,m]}),t[13]=i,t[14]=m,t[15]=h):h=t[15];let g;if(t[16]!==f||t[17]!==r||t[18]!==s){let e;t[20]!==f||t[21]!==r?(e=e=>({value:e,label:f(e),disabled:r.length>=16&&!r.includes(e)}),t[20]=f,t[21]=r,t[22]=e):e=t[22],g=s.map(e),t[16]=f,t[17]=r,t[18]=s,t[19]=g}else g=t[19];let _;t[23]!==i||t[24]!==o||t[25]!==g||t[26]!==r?(_=(0,Q.jsx)(c,{options:g,values:r,multiple:!0,ariaLabel:i,onChange:o}),t[23]=i,t[24]=o,t[25]=g,t[26]=r,t[27]=_):_=t[27];let v=a?`自定义标识`:`Custom identifiers`,y;t[28]===v?y=t[29]:(y=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:v}),t[28]=v,t[29]=y);let b=a?`其他标识`:`Other identifiers`,x=a?`每行一个英文标识`:`One identifier per line`,S;t[30]!==o||t[31]!==r||t[32]!==s?(S=e=>o([...new Set([...r.filter(e=>s.includes(e)),...e])]),t[30]=o,t[31]=r,t[32]=s,t[33]=S):S=t[33];let C;t[34]!==u||t[35]!==b||t[36]!==x||t[37]!==S?(C=(0,Q.jsx)(Ye,{value:u,label:b,hint:x,max:16,onChange:S}),t[34]=u,t[35]=b,t[36]=x,t[37]=S,t[38]=C):C=t[38];let w;t[39]!==C||t[40]!==y?(w=(0,Q.jsxs)(`details`,{children:[y,C]}),t[39]=C,t[40]=y,t[41]=w):w=t[41];let T;t[42]!==w||t[43]!==_?(T=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[_,w]}),t[42]=w,t[43]=_,t[44]=T):T=t[44];let E;return t[45]!==T||t[46]!==h?(E=(0,Q.jsxs)(`details`,{className:`min-w-0 rounded-xl border border-edge p-3`,children:[h,T]}),t[45]=T,t[46]=h,t[47]=E):E=t[47],E}function Qe(e){let t=(0,Z.c)(45),{profile:n,zh:r,onChange:i}=e,a=r?`领域`:`Domains`,o;t[0]===a?o=t[1]:(o=[`domains`,a,`software
|
|
70
|
+
data
|
|
71
|
+
research`,16],t[0]=a,t[1]=o);let s=r?`任务类型`:`Task types`,c;t[2]===s?c=t[3]:(c=[`taskTypes`,s,`bug_fix
|
|
72
|
+
code_review
|
|
73
|
+
data_analysis`,16],t[2]=s,t[3]=c);let l=r?`输入类型`:`Input kinds`,u;t[4]===l?u=t[5]:(u=[`inputKinds`,l,`repository
|
|
74
|
+
csv
|
|
75
|
+
text`,16],t[4]=l,t[5]=u);let d=r?`交付类型`:`Output kinds`,f;t[6]===d?f=t[7]:(f=[`outputKinds`,d,`code_patch
|
|
76
|
+
report
|
|
77
|
+
chart`,16],t[6]=d,t[7]=f);let p=r?`具体专长`:`Specialties`,m=r?`每行一项具体专长`:`One specialty per line`,h;t[8]!==m||t[9]!==p?(h=[`specialties`,p,m,8],t[8]=m,t[9]=p,t[10]=h):h=t[10];let g=r?`适用边界`:`Limitations`,_=r?`每行一项边界或注意事项`:`One limitation per line`,v;t[11]!==g||t[12]!==_?(v=[`limitations`,g,_,8],t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==h||t[15]!==v||t[16]!==o||t[17]!==c||t[18]!==u||t[19]!==f?(y=[o,c,u,f,h,v],t[14]=h,t[15]=v,t[16]=o,t[17]=c,t[18]=u,t[19]=f,t[20]=y):y=t[20];let b=y,x=r?`擅长的任务`:`Specialties`,S;t[21]===x?S=t[22]:(S=(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:x}),t[21]=x,t[22]=S);let C=r?`声明专长,帮助系统匹配任务。实际执行还需具备相应模型、技能、工具和账号权限。`:`Describe expertise for task matching. Execution also requires the appropriate models, skills, tools, and account access.`,w;t[23]===C?w=t[24]:(w=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:C}),t[23]=C,t[24]=w);let T;t[25]!==S||t[26]!==w?(T=(0,Q.jsxs)(`div`,{children:[S,w]}),t[25]=S,t[26]=w,t[27]=T):T=t[27];let E;t[28]!==i||t[29]!==n?(E=()=>i(n?void 0:structuredClone(Ke)),t[28]=i,t[29]=n,t[30]=E):E=t[30];let D=n?r?`清除档案`:`Clear profile`:r?`添加档案`:`Add profile`,O;t[31]!==E||t[32]!==D?(O=(0,Q.jsx)(k,{variant:`ghost`,onClick:E,children:D}),t[31]=E,t[32]=D,t[33]=O):O=t[33];let A;t[34]!==T||t[35]!==O?(A=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,O]}),t[34]=T,t[35]=O,t[36]=A):A=t[36];let j;t[37]!==b||t[38]!==i||t[39]!==n||t[40]!==r?(j=n?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:b.slice(0,2).map(e=>{let[t,a]=e;return(0,Q.jsx)(Ze,{field:t,value:n[t],label:a,zh:r,onChange:e=>i({...n,[t]:e})},t)})}),(0,Q.jsx)(Ye,{value:n.specialties,label:r?`具体专长`:`Specialties`,hint:r?`每行一项,例如:React 应用调试`:`One specialty per line`,max:8,onChange:e=>i({...n,specialties:e})}),(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[r?`任务匹配细节`:`Task matching details`,(0,Q.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r?`${n.inputKinds.length} 项输入 · ${n.outputKinds.length} 项交付 · ${n.examples.length} 个示例`:`${n.inputKinds.length} inputs · ${n.outputKinds.length} outputs · ${n.examples.length} examples`})]}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:b.slice(2,4).map(e=>{let[t,a]=e;return(0,Q.jsx)(Ze,{field:t,value:n[t],label:a,zh:r,onChange:e=>i({...n,[t]:e})},t)})}),(0,Q.jsx)(Ye,{value:n.limitations,label:r?`适用边界`:`Limitations`,hint:r?`每行一项边界或注意事项`:`One limitation per line`,max:8,onChange:e=>i({...n,limitations:e})}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`h5`,{className:`text-xs font-medium text-fg-muted`,children:r?`适用示例`:`Examples`}),n.examples.map((e,t)=>(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge p-3`,children:[(0,Q.jsxs)(`label`,{className:`text-xs text-fg-muted`,children:[r?`请求`:`Request`,(0,Q.jsx)(`textarea`,{rows:2,maxLength:200,className:qe,value:e.request,onChange:e=>i({...n,examples:n.examples.map((n,r)=>r===t?{...n,request:e.target.value}:n)})})]}),(0,Q.jsxs)(`label`,{className:`text-xs text-fg-muted`,children:[r?`交付成果`:`Deliverable`,(0,Q.jsx)(`textarea`,{rows:2,maxLength:200,className:qe,value:e.deliverable,onChange:e=>i({...n,examples:n.examples.map((n,r)=>r===t?{...n,deliverable:e.target.value}:n)})})]}),(0,Q.jsx)(k,{variant:`ghost`,onClick:()=>i({...n,examples:n.examples.filter((e,n)=>n!==t)}),children:r?`移除示例`:`Remove example`})]},t)),(0,Q.jsx)(k,{variant:`ghost`,disabled:n.examples.length>=4,onClick:()=>i({...n,examples:[...n.examples,{request:``,deliverable:``}]}),children:r?`添加示例`:`Add example`})]})]})]})]}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:r?`未设置档案时,继续按现有角色描述和执行条件匹配。`:`Without a profile, matching continues using the existing role and execution conditions.`}),t[37]=b,t[38]=i,t[39]=n,t[40]=r,t[41]=j):j=t[41];let M;return t[42]!==A||t[43]!==j?(M=(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[A,j]}),t[42]=A,t[43]=j,t[44]=M):M=t[44],M}var $e=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],$=`w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function et(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function tt(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function nt(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-medium text-accent`,children:n}),t[0]=n,t[1]=r),r}function rt(e){let t=(0,Z.c)(10),{title:n,description:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r}):null,t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==i||t[8]!==s?(c=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[s,i]}),t[7]=i,t[8]=s,t[9]=c):c=t[9],c}function it(e){let t=(0,Z.c)(11),{label:n,value:r,detail:i,onClick:a}=e,o;t[0]===n?o=t[1]:(o=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,Q.jsx)(`p`,{className:`mt-2 truncate text-sm font-semibold text-fg`,title:r,children:r}),t[2]=r,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}),t[4]=i,t[5]=c);let l;return t[6]!==a||t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,Q.jsxs)(`button`,{type:`button`,onClick:a,className:`min-w-0 rounded-2xl border border-edge bg-surface-base p-4 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[o,s,c]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function at(e){let t=(0,Z.c)(10),{title:n,summary:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,Q.jsx)(`span`,{className:`ml-2 text-xs font-normal text-fg-muted`,children:r}):null,t[0]=r,t[1]=a);let o;t[2]!==a||t[3]!==n?(o=(0,Q.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n,a]}),t[2]=a,t[3]=n,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=(0,Q.jsx)(`div`,{className:`mt-4`,children:i}),t[5]=i,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Q.jsxs)(`details`,{className:`rounded-xl border border-edge bg-surface-base p-4`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function ot(e){return Object.values(e).some(e=>e!==void 0)?e:void 0}function st({agent:e,toolIds:t,zh:n,messages:r,externalError:i,onDirtyChange:a,onClose:o,onOpenDefaults:s,onChat:c,onDelete:l}){let[u,d]=(0,X.useState)(`overview`),f=we(`(min-width: 640px)`),[p,m]=(0,X.useState)(`specialties`),[g,_]=(0,X.useState)(`directory`),[y,b]=(0,X.useState)(!1),[S,C]=(0,X.useState)(!1),E=(0,X.useRef)(null),D=(0,X.useRef)({}),[O,A]=(0,X.useState)(()=>structuredClone(e.override)),[j,M]=(0,X.useState)(!1),[N,P]=(0,X.useState)(null),[F,I]=(0,X.useState)(!1),[L,R]=(0,X.useState)({soul:!1,agents:!1,tools:!1}),z=Object.values(L).some(Boolean),B=(0,X.useRef)(null),V=(0,X.useRef)(null),H=(0,X.useRef)(null),[U,W]=(0,X.useState)(null),[G,K]=(0,X.useState)(!1),q=JSON.stringify(O)!==JSON.stringify(e.override)||z||U!==null,ne=[O.models?.chat,...Object.values(O.models?.intents??{}),O.models?.imageUnderstanding,O.models?.imageGeneration].some(e=>e!=null&&!e.primary.trim());(0,X.useEffect)(()=>a(q),[q,a]);let re=(0,X.useMemo)(()=>[...new Set([...t,...Object.keys(e.effective.tools),...Object.keys(O.tools??{}),...O.toolAllowlist??[]])].sort(),[e.effective.tools,O.toolAllowlist,O.tools,t]),ie=[O.models?n?`模型`:`Models`:null,O.skills?n?`技能`:`Skills`:null,O.tools?n?`工具权限`:`Tool access`:null,null].filter(e=>!!e),J=O.toolAllowlist,ae=J?re.filter(t=>J.includes(t)&&e.effective.tools[t]?.mode!==`deny`).length:null,se=Object.values(e.effective.tools).filter(e=>e.mode===`deny`).length,ce=e.effective.skills.mode===`selected`?n?`${e.effective.skills.include.length} 个已选技能`:`${e.effective.skills.include.length} selected skills`:n?`所有已启用技能`:`All enabled skills`,ue=O.profile?.name??e.name??e.id,Y=(t,n)=>{A(r=>({...r,profile:{...r.profile,name:r.profile?.name??e.name??e.id,[t]:n}}))},fe=w(n?`zh`:`en`).chat.workingDirectory,pe={fast:r.editorIntentFast,reasoning:r.editorIntentReasoning,coding:r.editorIntentCoding,review:r.editorIntentReview,vision:r.editorIntentVision,understanding:r.editorIntentUnderstanding},me={inherit:r.editorToolModeInherit,allow:r.editorToolModeAllow,ask:r.editorToolModeAsk,deny:r.editorToolModeDeny},he=async()=>{let t=[];M(!0),P(null);try{await B.current?.save(),L.soul&&t.push(n?`个性与边界`:`Personality & boundaries`),await V.current?.save(),L.agents&&t.push(n?`工作规范`:`Working instructions`),await H.current?.save(),L.tools&&t.push(n?`工具使用约定`:`Tool guidance`),U&&(await te(e.id,U),le(e.id),t.push(n?`头像图片`:`Avatar image`));let r=(await ee(e.id,{expectedRevision:e.revision,specialistProfile:O.specialistProfile??null,workspace:O.workspace??null,profile:O.profile,models:O.models??null,skills:O.skills??null,tools:O.tools??null,toolAllowlist:O.toolAllowlist??null,runtime:O.runtime??null})).agents.find(t=>t.id===e.id);r&&A(structuredClone(r.override)),R({soul:!1,agents:!1,tools:!1}),C(!0),W(null)}catch(e){let r=e instanceof Error?e.message:String(e);P(t.length?n?`已保存:${t.join(`、`)}。其余更改未保存,请重试。${r}`:`Saved: ${t.join(`, `)}. Remaining changes were not saved; retry. ${r}`:r)}finally{M(!1)}},ge=async()=>{M(!0),P(null);try{await ee(e.id,{setDefault:!0})}catch(e){P(e instanceof Error?e.message:String(e))}finally{M(!1)}},_e=(e,t)=>{let n={...O.tools??{}};t===`inherit`?delete n[e]:n[e]={...n[e],mode:t},A({...O,tools:Object.keys(n).length>0?n:void 0})},ve=(t,n)=>{let r=new Set(O.toolAllowlist??[]);n?r.add(t):r.delete(t);let i={...O.tools??{}};n&&(i[t]?.mode===`deny`||e.effective.tools[t]?.mode===`deny`)&&(i[t]={...i[t],mode:`allow`}),A({...O,toolAllowlist:[...r],tools:Object.keys(i).length>0?i:void 0})},ye=(e,t)=>{let n={...O.models??{}},r={...n.intents??{}};t===void 0?delete r[e]:r[e]=t,Object.keys(r).length>0?n.intents=r:delete n.intents,A({...O,models:Object.keys(n).length>0?n:void 0})},xe=(0,X.useCallback)(e=>R(t=>({...t,soul:e})),[]),Ce=(0,X.useCallback)(e=>R(t=>({...t,agents:e})),[]),Ee=(0,X.useCallback)(e=>R(t=>({...t,tools:e})),[]),ke=t=>t.some(t=>JSON.stringify(O[t])!==JSON.stringify(e.override[t])),Ae=JSON.stringify({...O.profile,instructions:void 0})!==JSON.stringify({...e.override.profile,instructions:void 0})||L.soul||U!==null,Z=ke([`models`,`skills`,`tools`,`toolAllowlist`,`specialistProfile`]),je=ke([`workspace`,`runtime`])||O.profile?.instructions!==e.override.profile?.instructions||L.agents||L.tools,Me=e=>e?(0,Q.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,"aria-label":n?`有未保存的更改`:`Unsaved changes`}):void 0,Ne=[{id:`overview`,label:n?`概览`:`Overview`},{id:`profile`,label:n?`个性`:`Personality`,suffix:Me(Ae)},{id:`capabilities`,label:n?`能力`:`Capabilities`,suffix:Me(Z)},{id:`work`,label:n?`工作设置`:`Work settings`,suffix:Me(je)}],Fe=u===`capabilities`?`${u}:${p}`:u===`work`?`${u}:${g}`:u,Ie=(e,t=p,n=g)=>{D.current[Fe]=E.current?.scrollTop??0,e===`profile`&&I(!0),e===`work`&&b(!0),d(e),m(t),_(n)};return(0,X.useEffect)(()=>{E.current&&(E.current.scrollTop=D.current[Fe]??0)},[Fe]),(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row`,children:[(0,Q.jsx)(`aside`,{className:`shrink-0 border-b border-edge px-3 py-2 sm:w-44 sm:overflow-y-auto sm:border-b-0 sm:border-r sm:py-4`,children:(0,Q.jsx)(oe,{items:Ne,activeTab:u,onChange:Ie,ariaLabel:n?`智能体设置`:`Agent settings`,tabIdPrefix:`agent-tab`,panelIdPrefix:`agent-panel`,orientation:f?`vertical`:`horizontal`,className:`m-0 grid grid-cols-4 overflow-visible p-0 sm:flex sm:flex-col`,buttonClassName:`min-w-0 justify-center px-1 text-xs sm:justify-start sm:px-3 sm:py-3 sm:text-sm [&>span]:min-w-0 [&>span]:break-words`,selectedClassName:`bg-accent-soft text-accent-fg`})}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Q.jsxs)(`main`,{ref:E,role:`tabpanel`,id:`agent-panel-${u}`,"aria-labelledby":`agent-tab-${u}`,tabIndex:0,className:`min-h-0 flex-1 overflow-y-auto p-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:p-6`,children:[N||i?(0,Q.jsx)(`p`,{role:`alert`,className:`mb-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:N??i}):null,u===`overview`?(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(rt,{title:be({id:e.id,name:ue},r),description:n?`查看当前真正生效的配置。未覆盖的部分会持续跟随全局默认值。`:`Review what actually takes effect. Anything not overridden keeps following global defaults.`,action:(0,Q.jsxs)(k,{onClick:c,children:[(0,Q.jsx)(h,{className:`size-4`}),n?`开始对话`:`Start chat`]})}),(0,Q.jsxs)(`section`,{className:`space-y-3 rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:Se({id:e.id,description:O.profile?.description},r)||(n?`添加介绍,让这个智能体的定位更清晰。`:`Add a description to explain this agent’s role.`)}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(O.specialistProfile?.specialties??[]).map(e=>(0,Q.jsx)(`span`,{className:`rounded-lg bg-surface-hover px-2 py-1 text-xs text-fg-muted`,children:e},e)),(0,Q.jsx)(k,{variant:`ghost`,onClick:()=>Ie(`capabilities`,`specialties`),children:n?`查看专长`:`View specialties`}),(0,Q.jsx)(k,{variant:`ghost`,onClick:()=>Ie(`profile`),children:n?`编辑个性`:`Edit personality`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4 rounded-2xl border border-accent/20 bg-accent/5 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:ie.length>0?n?`已自定义:${ie.join(`、`)}`:`Customized: ${ie.join(`, `)}`:n?`能力配置使用全局默认`:`Capabilities use global defaults`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:ie.length>0?n?`其他能力会继续跟随全局默认配置。`:`All other capabilities continue to follow global defaults.`:n?`修改全局默认配置后,这个智能体会自动同步。`:`This agent updates automatically when global defaults change.`})]}),(0,Q.jsx)(k,{onClick:s,children:n?`查看全局默认配置`:`View global defaults`})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsx)(it,{onClick:()=>Ie(`capabilities`,`models`),label:n?`对话模型`:`Chat model`,value:e.effective.models.chat.primary,detail:O.models?.chat?n?`单独设置`:`Agent override`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(it,{onClick:()=>Ie(`capabilities`,`tools`),label:n?`技能`:`Skills`,value:ce,detail:O.skills?n?`单独设置`:`Agent override`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(it,{onClick:()=>Ie(`capabilities`,`tools`),label:n?`工具权限`:`Tool access`,value:ae===null?se>0?n?`${se} 个禁用`:`${se} denied`:n?`全部可用`:`All available`:n?`${ae} 个已开放`:`${ae} in scope`,detail:J?n?`受智能体工具范围限制`:`Limited by agent tool scope`:O.tools?n?`${Object.keys(O.tools).length} 个本地覆盖`:`${Object.keys(O.tools).length} local overrides`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(it,{onClick:()=>Ie(`work`,p,`directory`),label:n?`工作区`:`Workspace`,value:e.effective.workspace,detail:O.workspace?n?`单独设置`:`Agent specific`:n?`自动工作区`:`Automatic workspace`})]}),e.isDefault?null:(0,Q.jsx)(k,{onClick:()=>void ge(),disabled:j,children:n?`设为默认智能体`:`Make default agent`}),e.isDefault?(0,Q.jsx)(`p`,{className:`rounded-2xl bg-surface-base p-4 text-sm text-fg-muted`,children:n?`默认智能体不能删除,请先将其他智能体设为默认。`:`The default agent cannot be deleted. Make another agent the default first.`}):(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-2xl border border-red-500/25 bg-red-500/5 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-red-600`,children:n?`删除智能体`:`Delete agent`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`配置条目会被移除,删除前仍会再次确认。`:`The configuration entry will be removed after confirmation.`})]}),(0,Q.jsxs)(k,{variant:`ghost`,className:`text-red-600`,onClick:l,children:[(0,Q.jsx)(x,{className:`size-4`}),n?`删除`:`Delete`]})]})]}):null,F?(0,Q.jsxs)(`div`,{className:T(`space-y-6`,u!==`profile`&&`hidden`),children:[(0,Q.jsx)(rt,{title:n?`资料与个性`:`Identity and personality`,description:n?`设置它是谁,以及如何与你交流。`:`Define who this agent is and how it communicates.`}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`grid items-center gap-4 sm:grid-cols-2`,children:[(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(Ge,{agentId:e.id,avatar:O.profile?.avatar,zh:n,disabled:j,pending:U,onPendingChange:W,onReadingChange:K,onChange:e=>Y(`avatar`,e)})}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`名称`:`Name`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:ue,onChange:e=>Y(`name`,e.target.value),placeholder:n?`例如:小助`:`e.g. Nova`})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted sm:col-span-2`,children:[n?`介绍`:`Description`,(0,Q.jsx)(`textarea`,{rows:2,className:`${$} mt-1.5 resize-y leading-6`,value:O.profile?.description??``,onChange:e=>Y(`description`,e.target.value),placeholder:n?`例如:帮你整理想法、查找资料,把复杂任务拆成可以执行的步骤。`:`e.g. Helps organize ideas, research topics, and turn complex tasks into actionable steps.`}),(0,Q.jsx)(`span`,{className:`mt-1.5 block text-xs font-normal`,children:n?`简要说明定位;详细行为在下方「个性与边界」设置。`:`Describe the agent’s purpose and how it helps. Set detailed behavior in Personality & boundaries below.`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`表达风格`:`Style`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.profile?.style??``,onChange:e=>Y(`style`,e.target.value),placeholder:n?`例如:直接、温和`:`e.g. direct and warm`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`主要语言`:`Primary language`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.profile?.language??``,onChange:e=>Y(`language`,e.target.value),placeholder:n?`例如:简体中文`:`e.g. English`})]})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(at,{title:n?`更多身份设置`:`More identity settings`,summary:[O.profile?.creature,O.profile?.emoji].filter(Boolean).join(` · `),children:(0,Q.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`签名表情(可选)`:`Signature emoji (optional)`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.profile?.emoji??``,onChange:e=>Y(`emoji`,e.target.value),placeholder:`✨`}),(0,Q.jsx)(`span`,{className:`mt-1.5 block text-xs font-normal`,children:n?`用于表达个性,与头像分开设置。`:`A personal touch, separate from the avatar.`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`角色定位`:`Role`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,list:`agent-creatures-${e.id}`,value:O.profile?.creature??``,onChange:e=>Y(`creature`,e.target.value),placeholder:n?`AI 助手、研究伙伴…`:`AI assistant, research partner…`}),(0,Q.jsx)(`datalist`,{id:`agent-creatures-${e.id}`,children:Pe.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:n?e.labelZh:e.labelEn},e.value))})]})]})})})]}),(0,Q.jsx)(Be,{ref:B,file:`SOUL.md`,agentId:e.id,zh:n,onDirtyChange:xe})]}):null,u===`capabilities`?(0,Q.jsxs)(`div`,{className:`mb-5 space-y-3`,children:[(0,Q.jsx)(rt,{title:n?`能力`:`Capabilities`,description:n?`声明擅长的任务,并配置实际可用的模型、技能与工具。`:`Describe specialties and configure the models, skills, and tools available to this agent.`}),(0,Q.jsx)(oe,{items:[{id:`specialties`,label:n?`擅长的任务`:`Specialties`},{id:`models`,label:n?`模型`:`Models`},{id:`tools`,label:n?`技能与工具`:`Skills & tools`}],activeTab:p,onChange:e=>Ie(`capabilities`,e),ariaLabel:n?`能力设置`:`Capability settings`,tabIdPrefix:`agent-capability-tab`,panelIdPrefix:`agent-capability-panel`})]}):null,u===`capabilities`&&p===`specialties`?(0,Q.jsx)(`div`,{role:`tabpanel`,id:`agent-capability-panel-specialties`,"aria-labelledby":`agent-capability-tab-specialties`,children:(0,Q.jsx)(Qe,{profile:O.specialistProfile,zh:n,onChange:e=>A(t=>({...t,specialistProfile:e}))})}):null,u===`capabilities`&&p===`models`?(0,Q.jsxs)(`div`,{role:`tabpanel`,id:`agent-capability-panel-models`,"aria-labelledby":`agent-capability-tab-models`,className:`space-y-6`,children:[(0,Q.jsx)(rt,{title:n?`模型路由`:`Model routing`,description:n?`日常对话使用 Chat;固定意图只在对应任务中生效。默认继承全局。`:`Chat handles normal turns; fixed intents apply only to matching work. Everything inherits by default.`,action:O.models?(0,Q.jsxs)(k,{variant:`ghost`,onClick:()=>A({...O,models:void 0}),children:[(0,Q.jsx)(v,{className:`size-4`}),n?`全部继承`:`Inherit all`]}):void 0}),(0,Q.jsx)(De,{zh:n,value:O.models?.phoneUse,inherited:e.effective.models.phoneUse,onChange:e=>{let t={...O.models??{}};e===void 0?delete t.phoneUse:t.phoneUse=e,A({...O,models:Object.keys(t).length?t:void 0})}}),(0,Q.jsx)(He,{label:r.editorChatModel,inherited:e.effective.models.chat,value:O.models?.chat,zh:n,onChange:e=>{let t={...O.models??{}};e?t.chat=e:delete t.chat,A({...O,models:Object.keys(t).length>0?t:void 0})}}),(0,Q.jsx)(at,{title:n?`任务模型路由`:`Task model routing`,summary:n?`当前任务路由继续生效;未覆盖的任务继承全局设置。`:`Task routes remain active; unspecified routes inherit global defaults.`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:n?`固定意图`:`Fixed intents`}),(0,Q.jsx)(`div`,{className:`space-y-3`,children:$e.map(t=>(0,Q.jsx)(He,{label:pe[t],inherited:e.effective.models.intents[t]??e.effective.models.chat,value:O.models?.intents?.[t],zh:n,allowChatFallback:!0,modelKind:t===`vision`?`vision`:`text`,onChange:e=>ye(t,e)},t))})]})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:n?`图片能力`:`Image capabilities`}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(He,{label:n?`图片理解`:`Image understanding`,modelKind:`vision`,inherited:e.effective.models.imageUnderstanding,value:O.models?.imageUnderstanding,zh:n,allowDisabled:!0,onChange:e=>{let t={...O.models??{}};e===void 0?delete t.imageUnderstanding:t.imageUnderstanding=e,A({...O,models:Object.keys(t).length>0?t:void 0})}}),(0,Q.jsx)(He,{label:n?`图片生成`:`Image generation`,modelKind:`image`,inherited:e.effective.models.imageGeneration,value:O.models?.imageGeneration,zh:n,allowDisabled:!0,onChange:t=>{let n={...O.models??{}};t===void 0?delete n.imageGeneration:t===null?n.imageGeneration=null:n.imageGeneration={...t,timeoutMs:O.models?.imageGeneration?.timeoutMs??e.effective.models.imageGeneration?.timeoutMs,autoProviderFallback:O.models?.imageGeneration?.autoProviderFallback??e.effective.models.imageGeneration?.autoProviderFallback??!0},A({...O,models:Object.keys(n).length>0?n:void 0})}}),O.models?.imageGeneration?(0,Q.jsx)(at,{title:n?`图片执行策略`:`Image execution policy`,summary:n?`当前超时和回退策略继续生效。`:`Current timeout and fallback settings remain active.`,children:(0,Q.jsxs)(`div`,{className:`grid gap-4 rounded-2xl border border-edge bg-surface-base p-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,Q.jsx)(Te,{allowEmpty:!0,type:`number`,min:1,className:`${$} mt-1.5`,value:O.models.imageGeneration.timeoutMs??``,onChange:e=>A({...O,models:{...O.models,imageGeneration:{...O.models.imageGeneration,timeoutMs:tt(e.target.value)}}})})]}),(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`提供商自动回退`:`Automatic provider fallback`}),(0,Q.jsx)(de,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,role:`group`,"aria-label":n?`自动切换服务`:`Automatic provider fallback`,indicatorClassName:`rounded-lg bg-surface-panel shadow-surface`,children:[!0,!1].map(e=>(0,Q.jsx)(`button`,{"aria-pressed":O.models?.imageGeneration?.autoProviderFallback===e,type:`button`,onClick:()=>A({...O,models:{...O.models,imageGeneration:{...O.models.imageGeneration,autoProviderFallback:e}}}),className:T(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,O.models?.imageGeneration?.autoProviderFallback===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e?n?`开启`:`On`:n?`关闭`:`Off`},String(e)))})]})]})}):null]})]})]}):null,u===`capabilities`&&p===`tools`?(0,Q.jsxs)(`div`,{role:`tabpanel`,id:`agent-capability-panel-tools`,"aria-labelledby":`agent-capability-tab-tools`,className:`space-y-7`,children:[(0,Q.jsx)(rt,{title:n?`技能与工具`:`Skills and tools`,description:n?`默认继承全局能力;只设置确实不同的部分。`:`Keep inheritance for global capabilities; override only agents that genuinely differ.`}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`技能策略`:`Skill policy`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:O.skills?n?`当前使用单独设置`:`Using an agent override`:n?`当前继承全局`:`Currently inherited globally`})]}),O.skills?(0,Q.jsxs)(k,{variant:`ghost`,onClick:()=>A({...O,skills:void 0}),children:[(0,Q.jsx)(v,{className:`size-4`}),n?`继承`:`Inherit`]}):null]}),(0,Q.jsxs)(de,{className:`mt-4 flex gap-2`,role:`group`,"aria-label":n?`技能策略`:`Skill policy`,indicatorClassName:`rounded-lg bg-surface-active`,children:[(0,Q.jsx)(k,{"aria-pressed":O.skills?.mode===`merge`,variant:`ghost`,onClick:()=>A({...O,skills:{mode:`merge`,add:[],remove:[]}}),children:r.editorSkillModeMerge}),(0,Q.jsx)(k,{"aria-pressed":O.skills?.mode===`replace`,variant:`ghost`,onClick:()=>A({...O,skills:{mode:`replace`,include:[]}}),children:r.editorSkillModeReplace})]}),O.skills?.mode===`merge`?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`新增技能`:`Add skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.skills.add.join(`, `),onChange:e=>A({...O,skills:{mode:`merge`,add:et(e.target.value),remove:O.skills?.mode===`merge`?O.skills.remove:[]}})})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`移除技能`:`Remove skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.skills.remove.join(`, `),onChange:e=>A({...O,skills:{mode:`merge`,add:O.skills?.mode===`merge`?O.skills.add:[],remove:et(e.target.value)}})})]})]}):null,O.skills?.mode===`replace`?(0,Q.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[n?`仅启用这些技能`:`Enable only these skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:O.skills.include.join(`, `),onChange:e=>A({...O,skills:{mode:`replace`,include:et(e.target.value)}})})]}):null]}),(0,Q.jsxs)(`section`,{children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`工具权限`:`Tool permissions`}),O.tools?(0,Q.jsxs)(k,{variant:`ghost`,onClick:()=>A({...O,tools:void 0}),children:[(0,Q.jsx)(v,{className:`size-4`}),n?`全部继承`:`Inherit all`]}):null]}),J?(0,Q.jsx)(`p`,{className:`mb-3 text-xs text-fg-muted`,children:n?`此智能体使用限定的工具范围。可在下方启用或移除工具,保存后从下一轮对话生效。`:`This agent uses a limited tool set. Add or remove tools below; changes apply from the next conversation turn.`}):null,(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:re.map(t=>{if(J&&!J.includes(t))return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`code`,{className:`text-xs text-fg-muted`,children:t}),(0,Q.jsx)(`p`,{className:`mt-1 text-[11px] text-fg-muted`,children:n?`未开放`:`Unavailable`})]}),(0,Q.jsx)(k,{variant:`secondary`,className:`px-3 py-1.5 text-xs`,onClick:()=>ve(t,!0),children:n?`启用`:`Enable`})]},t);let r=O.tools?.[t]?.mode,i=e.effective.tools[t]?.mode??`allow`;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`code`,{className:`text-xs text-fg`,children:t}),(0,Q.jsx)(`p`,{className:`mt-1 text-[11px] text-fg-muted`,children:r?n?`单独设置`:`Agent override`:`${n?`继承`:`Inherits`} ${me[i]}`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(de,{className:`flex rounded-xl bg-surface-hover p-1`,role:`group`,"aria-label":t,indicatorClassName:`rounded-lg bg-surface-panel shadow-surface`,children:[`inherit`,`allow`,`ask`,`deny`].map(e=>(0,Q.jsx)(`button`,{"aria-pressed":e===`inherit`?!r:r===e,type:`button`,onClick:()=>_e(t,e),className:T(`rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,(e===`inherit`?!r:r===e)?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:me[e]},e))}),J?(0,Q.jsx)(k,{variant:`ghost`,className:`px-2 py-1.5 text-xs`,onClick:()=>ve(t,!1),children:n?`移除`:`Remove`}):null]})]},t)})})]})]}):null,y?(0,Q.jsxs)(`div`,{className:T(`space-y-6`,u!==`work`&&`hidden`),children:[(0,Q.jsx)(rt,{title:n?`工作设置`:`Work settings`,description:n?`管理工作目录、执行规范与运行策略。`:`Manage the working directory, instructions, and execution policy.`}),(0,Q.jsx)(oe,{items:[{id:`directory`,label:n?`工作目录`:`Directory`,suffix:Me(ke([`workspace`]))},{id:`instructions`,label:n?`工作规范`:`Instructions`,suffix:Me(L.agents||O.profile?.instructions!==e.override.profile?.instructions)},{id:`tools`,label:n?`工具约定`:`Tool guidance`,suffix:Me(L.tools)},{id:`runtime`,label:n?`运行策略`:`Runtime`,suffix:Me(ke([`runtime`]))}],activeTab:g,onChange:e=>Ie(`work`,p,e),ariaLabel:n?`工作设置分区`:`Work settings sections`,tabIdPrefix:`agent-work-tab`,panelIdPrefix:`agent-work-panel`}),(0,Q.jsx)(`div`,{role:`tabpanel`,id:`agent-work-panel-directory`,"aria-labelledby":`agent-work-tab-directory`,hidden:g!==`directory`,className:`space-y-6`,children:(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`工作区`:`Workspace`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`选择这个智能体读写文件时使用的目录;留空则使用自动工作区。`:`Choose where this agent reads and writes files, or leave it empty to use the automatic workspace.`})]}),O.workspace?(0,Q.jsxs)(k,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>A(e=>({...e,workspace:void 0})),children:[(0,Q.jsx)(v,{className:`size-3.5`}),n?`恢复自动`:`Use automatic`]}):(0,Q.jsx)(nt,{children:n?`自动`:`Automatic`})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Oe,{value:O.workspace??``,onChange:e=>A(t=>({...t,workspace:e||void 0})),wd:fe,placeholder:e.effective.workspace,inputAriaLabel:n?`智能体工作区路径`:`Agent workspace path`,inputClassName:`${$} font-mono`,disabled:j})})]})}),(0,Q.jsxs)(`div`,{role:`tabpanel`,id:`agent-work-panel-instructions`,"aria-labelledby":`agent-work-tab-instructions`,hidden:g!==`instructions`,className:`space-y-6`,children:[(0,Q.jsx)(Be,{ref:V,file:`AGENTS.md`,agentId:e.id,zh:n,onDirtyChange:Ce}),(0,Q.jsxs)(at,{title:n?`附加规则`:`Additional rules`,summary:O.profile?.instructions?n?`已设置`:`Configured`:void 0,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`附加指令`:`Additional instructions`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`补充简短的执行规则;长期工作规范请写入上方「工作规范」。`:`Add short execution rules. Keep lasting work guidance in Working instructions above.`}),(0,Q.jsx)(`textarea`,{rows:4,className:`${$} mt-4 resize-y leading-6`,value:O.profile?.instructions??``,onChange:t=>A(n=>({...n,profile:{...n.profile,name:n.profile?.name||e.name||e.id,instructions:t.target.value||void 0}})),placeholder:n?`可选:补充必须始终遵循的规则`:`Optional: add a rule that must always be followed`})]})]}),(0,Q.jsx)(`div`,{role:`tabpanel`,id:`agent-work-panel-tools`,"aria-labelledby":`agent-work-tab-tools`,hidden:g!==`tools`,className:`space-y-6`,children:(0,Q.jsx)(Be,{ref:H,file:`TOOLS.md`,agentId:e.id,zh:n,onDirtyChange:Ee})}),(0,Q.jsxs)(`div`,{role:`tabpanel`,id:`agent-work-panel-runtime`,"aria-labelledby":`agent-work-tab-runtime`,hidden:g!==`runtime`,className:`space-y-6`,children:[(0,Q.jsx)(rt,{title:n?`运行限制`:`Runtime limits`,description:n?`留空即继承全局限制。`:`Leave blank to inherit global limits. Use overrides only to tighten or relax a specialist agent.`,action:void 0}),(0,Q.jsx)(at,{title:n?`执行限制`:`Execution limits`,summary:n?`保留当前运行限制;未覆盖的字段继承全局设置。`:`Current limits remain active; unspecified limits inherit globally.`,children:(0,Q.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[[`maxTurns`,n?`单次最大轮数`:`Maximum turns`],[`timeoutMs`,n?`单轮超时(毫秒)`:`Turn timeout (ms)`],[`maxToolFailuresPerTurn`,n?`最大工具失败次数`:`Maximum tool failures`]].map(([t,r])=>(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r,O.runtime?.[t]===void 0?(0,Q.jsx)(nt,{children:n?`继承`:`Inherited`}):null]}),(0,Q.jsx)(Te,{allowEmpty:!0,type:`number`,min:1,className:`${$} mt-1.5`,value:O.runtime?.[t]??``,placeholder:String(e.effective.runtime[t]??``),onChange:e=>{let n=ot({...O.runtime??{},[t]:tt(e.target.value)});A({...O,runtime:n})}})]},t))})}),(0,Q.jsx)(at,{title:n?`提示词缓存`:`Prompt cache`,summary:O.runtime?.promptCache?.mode??(n?`继承全局`:`Inherited globally`),children:(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`提示词缓存`:`Prompt cache`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:O.runtime?.promptCache?n?`使用单独设置`:`Using agent override`:n?`继承全局`:`Inherited globally`})]}),O.runtime?.promptCache?(0,Q.jsxs)(k,{variant:`ghost`,onClick:()=>{let e=ot({...O.runtime??{},promptCache:void 0});A({...O,runtime:e})},children:[(0,Q.jsx)(v,{className:`size-4`}),n?`继承`:`Inherit`]}):null]}),O.runtime?.promptCache?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`模式`:`Mode`}),(0,Q.jsx)(de,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,role:`group`,"aria-label":n?`缓存模式`:`Cache mode`,indicatorClassName:`rounded-lg bg-surface-panel shadow-surface`,children:[`auto`,`off`].map(e=>(0,Q.jsx)(`button`,{"aria-pressed":O.runtime?.promptCache?.mode===e,type:`button`,onClick:()=>A({...O,runtime:{...O.runtime,promptCache:{...O.runtime.promptCache,mode:e}}}),className:T(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,O.runtime?.promptCache?.mode===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e===`auto`?r.editorCacheModeAuto:r.editorCacheModeOff},e))})]}),(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`缓存周期`:`Lifetime`}),(0,Q.jsx)(de,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,role:`group`,"aria-label":n?`缓存周期`:`Cache lifetime`,indicatorClassName:`rounded-lg bg-surface-panel shadow-surface`,children:[`short`,`long`].map(e=>(0,Q.jsx)(`button`,{"aria-pressed":O.runtime?.promptCache?.lifetime===e,type:`button`,onClick:()=>A({...O,runtime:{...O.runtime,promptCache:{...O.runtime.promptCache,lifetime:e}}}),className:T(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,O.runtime?.promptCache?.lifetime===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e===`short`?r.editorCacheLifetimeShort:r.editorCacheLifetimeLong},e))})]})]}):(0,Q.jsx)(k,{className:`mt-4`,onClick:()=>A({...O,runtime:{...O.runtime,promptCache:{...e.effective.runtime.promptCache??{mode:`auto`,lifetime:`short`}}}}),children:n?`自定义缓存策略`:`Customize cache policy`})]})})]})]}):null]}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge bg-surface-panel px-5 py-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,role:`status`,children:j?n?`保存中…`:`Saving…`:ne?n?`请补全自定义模型`:`Complete the custom model reference`:q?n?`有未保存的更改`:`Unsaved changes`:S?n?`更改已保存`:`Changes saved`:n?`未修改`:`No changes`}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(k,{onClick:o,children:n?`关闭`:`Close`}),(0,Q.jsx)(k,{variant:`primary`,disabled:j||G||!q||ne||O.profile!==void 0&&!O.profile.name.trim(),onClick:()=>void he(),children:j?n?`保存中…`:`Saving…`:n?`保存更改`:`Save changes`})]})]})]})]})}function ct(e){let t=(0,Z.c)(21),{agent:n,tuiDefaultAgentId:r,messages:i}=e,a;t[0]===n.id?a=t[1]:(a=xe(n.id),t[0]=n.id,t[1]=a);let o=a,s=n.id===r,c;t[2]!==n.isDefault||t[3]!==i?(c=n.isDefault?(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent`,children:i.listDefaultBadge}):null,t[2]=n.isDefault,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==i?(l=s?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg`,children:i.tuiDefaultBadge}):null,t[5]=s,t[6]=i,t[7]=l):l=t[7];let u;t[8]!==o||t[9]!==i?(u=o?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg`,children:i.listPersonalDefaultBadge}):null,t[8]=o,t[9]=i,t[10]=u):u=t[10];let d;t[11]!==n.isDefault||t[12]!==o||t[13]!==s||t[14]!==i?(d=!n.isDefault&&!s&&!o?(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:i.listCustomBadge}):null,t[11]=n.isDefault,t[12]=o,t[13]=s,t[14]=i,t[15]=d):d=t[15];let f;return t[16]!==c||t[17]!==l||t[18]!==u||t[19]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-1`,children:[c,l,u,d]}),t[16]=c,t[17]=l,t[18]=u,t[19]=d,t[20]=f):f=t[20],f}function lt(e){let t=(0,Z.c)(37),{agent:n,tuiDefaultAgentId:r,messages:i,open:a,onOpenChange:o,children:s}=e,[c,u]=(0,X.useState)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(j,{className:T(`xopc-dialog-overlay fixed inset-0 bg-scrim`,z)}),t[0]=d):d=t[0];let f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=T(`xopc-dialog-content fixed flex flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,R,`inset-3 h-[calc(100dvh-1.5rem)] min-h-0 sm:inset-auto sm:left-1/2 sm:top-1/2`,`sm:h-[min(88vh,48rem)] sm:w-[min(94vw,62rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),t[1]=f):f=t[1];let p;t[2]!==n.avatar||t[3]!==n.id?(p=(0,Q.jsx)(ue,{agentId:n.id,avatar:n.avatar,size:42,className:`size-11 shrink-0`}),t[2]=n.avatar,t[3]=n.id,t[4]=p):p=t[4];let m;t[5]!==n||t[6]!==i?(m=be(n,i),t[5]=n,t[6]=i,t[7]=m):m=t[7];let h;t[8]===m?h=t[9]:(h=(0,Q.jsx)(I,{className:`truncate text-base font-semibold text-fg`,children:m}),t[8]=m,t[9]=h);let g;t[10]===n.id?g=t[11]:(g=(0,Q.jsx)(M,{className:`mt-0.5 truncate font-mono text-xs text-fg-muted`,children:n.id}),t[10]=n.id,t[11]=g);let _;t[12]!==h||t[13]!==g?(_=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==n||t[16]!==i||t[17]!==r?(v=(0,Q.jsx)(ct,{agent:n,tuiDefaultAgentId:r,messages:i}),t[15]=n,t[16]=i,t[17]=r,t[18]=v):v=t[18];let y;t[19]!==p||t[20]!==_||t[21]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[p,_,v]}),t[19]=p,t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(C,{className:`size-4`}),t[23]=b):b=t[23];let x;t[24]===i.closeDialogAria?x=t[25]:(x=(0,Q.jsx)(N,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":i.closeDialogAria,children:b})}),t[24]=i.closeDialogAria,t[25]=x);let S;t[26]!==x||t[27]!==y?(S=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-4 border-b border-edge px-5 py-4`,children:[y,x]}),t[26]=x,t[27]=y,t[28]=S):S=t[28];let w;t[29]!==s||t[30]!==c||t[31]!==S?(w=(0,Q.jsxs)(P,{children:[d,(0,Q.jsx)(F,{ref:u,className:f,onOpenAutoFocus:ut,children:(0,Q.jsxs)(l,{layer:`modal`,portalContainer:c,children:[S,s]})})]}),t[29]=s,t[30]=c,t[31]=S,t[32]=w):w=t[32];let E;return t[33]!==o||t[34]!==a||t[35]!==w?(E=(0,Q.jsx)(L,{open:a,onOpenChange:o,children:w}),t[33]=o,t[34]=a,t[35]=w,t[36]=E):E=t[36],E}function ut(e){return e.preventDefault()}function dt(e){let t=(0,Z.c)(15),{agents:n,tuiDefaultAgentId:r,busy:i,messages:a,onOpen:o,onChat:s}=e,c;if(t[0]!==n||t[1]!==i||t[2]!==a||t[3]!==s||t[4]!==o||t[5]!==r){let e;t[7]!==i||t[8]!==a||t[9]!==s||t[10]!==o||t[11]!==r?(e=e=>{let t=be(e,a),n=Se(e,a);return(0,Q.jsx)(`li`,{className:`min-h-0`,children:(0,Q.jsxs)(`article`,{className:T(`group relative flex min-h-52 flex-col rounded-2xl border border-edge bg-surface-panel p-4 shadow-surface`,`transition-[transform,background-color,border-color] duration-200 ease-out hover:-translate-y-0.5 hover:border-accent/30 hover:bg-surface-hover/35 active:scale-[0.99] motion-reduce:transform-none`),children:[(0,Q.jsx)(`button`,{type:`button`,disabled:i,"aria-label":a.listConfigureAgent.replace(`{{name}}`,t),onClick:()=>o(e.id),className:`absolute inset-0 z-0 rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),(0,Q.jsxs)(`div`,{className:`pointer-events-none relative z-10 flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(ue,{agentId:e.id,avatar:e.avatar,size:48,className:`size-12 shrink-0`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`truncate text-base font-semibold text-fg`,children:t})})]}),(0,Q.jsx)(ct,{agent:e,tuiDefaultAgentId:r,messages:a})]}),(0,Q.jsx)(`p`,{className:`pointer-events-none relative z-10 mt-5 line-clamp-2 min-h-10 text-sm leading-5 text-fg-muted`,children:n||e.override.profile?.instructions||a.listUsesGlobalSettings}),(0,Q.jsx)(`div`,{className:`relative z-10 mt-auto pt-4`,children:(0,Q.jsxs)(k,{className:`w-full`,disabled:i,onClick:t=>{t.stopPropagation(),s(e.id)},children:[(0,Q.jsx)(h,{className:`size-4`}),a.listChatWithAgent]})})]})},e.id)},t[7]=i,t[8]=a,t[9]=s,t[10]=o,t[11]=r,t[12]=e):e=t[12],c=n.map(e),t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=r,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,Q.jsx)(`ul`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:c}),t[13]=c,t[14]=l),l}var ft=`w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function pt(e){let t=(0,Z.c)(79),{draft:n,busy:r,error:i,messages:a,workingDirectoryMessages:o,onChange:s,onCreate:c,onOpenChange:l}=e,u=n.open,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(j,{className:T(`xopc-dialog-overlay fixed inset-0 bg-scrim`,z)}),t[0]=d):d=t[0];let f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=T(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(38rem,calc(100dvh-2rem))] w-[min(92vw,36rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,`overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,R),t[1]=f):f=t[1];let p;t[2]===a.manualCreateTitle?p=t[3]:(p=(0,Q.jsx)(I,{className:`text-base font-semibold text-fg`,children:a.manualCreateTitle}),t[2]=a.manualCreateTitle,t[3]=p);let m;t[4]===a.manualCreateDescription?m=t[5]:(m=(0,Q.jsx)(M,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:a.manualCreateDescription}),t[4]=a.manualCreateDescription,t[5]=m);let h;t[6]!==p||t[7]!==m?(h=(0,Q.jsxs)(`div`,{children:[p,m]}),t[6]=p,t[7]=m,t[8]=h):h=t[8];let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(C,{className:`size-4`,"aria-hidden":!0}),t[9]=g):g=t[9];let _;t[10]===a.manualCreateClose?_=t[11]:(_=(0,Q.jsx)(N,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`touch-target shrink-0 rounded-lg p-2 text-fg-muted hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":a.manualCreateClose,children:g})}),t[10]=a.manualCreateClose,t[11]=_);let v;t[12]!==h||t[13]!==_?(v=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[h,_]}),t[12]=h,t[13]=_,t[14]=v):v=t[14];let y;t[15]===i?y=t[16]:(y=i?(0,Q.jsx)(`p`,{role:`alert`,className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:i}):null,t[15]=i,t[16]=y);let b;t[17]===s?b=t[18]:(b=e=>s({name:e.target.value}),t[17]=s,t[18]=b);let x;t[19]!==n.name||t[20]!==a.manualCreateNamePlaceholder||t[21]!==b?(x=(0,Q.jsx)(`input`,{id:`manual-agent-name`,autoFocus:!0,className:`${ft} mt-1.5`,value:n.name,onChange:b,placeholder:a.manualCreateNamePlaceholder}),t[19]=n.name,t[20]=a.manualCreateNamePlaceholder,t[21]=b,t[22]=x):x=t[22];let S;t[23]!==a.manualCreateName||t[24]!==x?(S=(0,Q.jsxs)(`label`,{htmlFor:`manual-agent-name`,className:`block text-xs font-medium text-fg-muted`,children:[a.manualCreateName,x]}),t[23]=a.manualCreateName,t[24]=x,t[25]=S):S=t[25];let w;t[26]===s?w=t[27]:(w=e=>s({instructions:e.target.value}),t[26]=s,t[27]=w);let E;t[28]!==n.instructions||t[29]!==a.manualCreateInstructionsPlaceholder||t[30]!==w?(E=(0,Q.jsx)(`textarea`,{id:`manual-agent-instructions`,rows:4,className:`${ft} mt-1.5 resize-y leading-6`,value:n.instructions,onChange:w,placeholder:a.manualCreateInstructionsPlaceholder}),t[28]=n.instructions,t[29]=a.manualCreateInstructionsPlaceholder,t[30]=w,t[31]=E):E=t[31];let D;t[32]!==a.manualCreateInstructions||t[33]!==E?(D=(0,Q.jsxs)(`label`,{htmlFor:`manual-agent-instructions`,className:`block text-xs font-medium text-fg-muted`,children:[a.manualCreateInstructions,E]}),t[32]=a.manualCreateInstructions,t[33]=E,t[34]=D):D=t[34];let O;t[35]===a.manualCreateWorkspace?O=t[36]:(O=(0,Q.jsx)(`label`,{htmlFor:`manual-agent-workspace`,className:`block text-xs font-medium text-fg-muted`,children:a.manualCreateWorkspace}),t[35]=a.manualCreateWorkspace,t[36]=O);let A;t[37]===a.manualCreateWorkspaceHint?A=t[38]:(A=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:a.manualCreateWorkspaceHint}),t[37]=a.manualCreateWorkspaceHint,t[38]=A);let B;t[39]===s?B=t[40]:(B=e=>s({workspace:e}),t[39]=s,t[40]=B);let V;t[41]!==r||t[42]!==n.workspace||t[43]!==a.manualCreateWorkspace||t[44]!==a.manualCreateWorkspacePlaceholder||t[45]!==B||t[46]!==o?(V=(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(Oe,{value:n.workspace,onChange:B,disabled:r,wd:o,placeholder:a.manualCreateWorkspacePlaceholder,inputAriaLabel:a.manualCreateWorkspace,inputClassName:`${ft} font-mono`})}),t[41]=r,t[42]=n.workspace,t[43]=a.manualCreateWorkspace,t[44]=a.manualCreateWorkspacePlaceholder,t[45]=B,t[46]=o,t[47]=V):V=t[47];let H;t[48]!==O||t[49]!==A||t[50]!==V?(H=(0,Q.jsxs)(`div`,{children:[O,A,V]}),t[48]=O,t[49]=A,t[50]=V,t[51]=H):H=t[51];let U;t[52]!==y||t[53]!==S||t[54]!==D||t[55]!==H?(U=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:[y,S,D,H]}),t[52]=y,t[53]=S,t[54]=D,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==r||t[58]!==a.manualCreateCancel?(W=(0,Q.jsx)(N,{asChild:!0,children:(0,Q.jsx)(k,{disabled:r,children:a.manualCreateCancel})}),t[57]=r,t[58]=a.manualCreateCancel,t[59]=W):W=t[59];let G;t[60]!==r||t[61]!==n.name?(G=r||!n.name.trim(),t[60]=r,t[61]=n.name,t[62]=G):G=t[62];let ee=r?a.manualCreating:a.manualCreateSubmit,K;t[63]!==r||t[64]!==c||t[65]!==G||t[66]!==ee?(K=(0,Q.jsx)(k,{variant:`primary`,disabled:G,"aria-busy":r,onClick:c,children:ee}),t[63]=r,t[64]=c,t[65]=G,t[66]=ee,t[67]=K):K=t[67];let te;t[68]!==W||t[69]!==K?(te=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[W,K]}),t[68]=W,t[69]=K,t[70]=te):te=t[70];let q;t[71]!==U||t[72]!==te||t[73]!==v?(q=(0,Q.jsxs)(P,{children:[d,(0,Q.jsxs)(F,{className:f,children:[v,U,te]})]}),t[71]=U,t[72]=te,t[73]=v,t[74]=q):q=t[74];let ne;return t[75]!==n.open||t[76]!==l||t[77]!==q?(ne=(0,Q.jsx)(L,{open:u,onOpenChange:l,children:q}),t[75]=n.open,t[76]=l,t[77]=q,t[78]=ne):ne=t[78],ne}var mt=`px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,ht=`max-w-7xl`;function gt(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(A,{className:`h-7 w-28`}),(0,Q.jsx)(A,{className:`h-4 w-80 max-w-full`})]}),(0,Q.jsx)(A,{className:`h-9 w-28`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Ee,{gap:`gap-5`,padding:mt,className:ht,children:[t,(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:[0,1,2].map(_t)})]}),e[1]=n):n=e[1],n}function _t(e){return(0,Q.jsx)(A,{className:`h-64 rounded-2xl`},e)}function vt({agentId:e,onHeaderActionChange:t}){let n=E(e=>e.conversationId),r=D(e=>e.language),i=r===`zh`,o=w(r),s=o.agentsSettings,c=a(),{data:l,error:u,isLoading:f,mutate:p}=O(n?`settings-gateway-agents`:null,ne),{data:m}=U(!!n),h=(m?.payload?.config)?.tui?.defaultAgent?.trim(),[g,v]=(0,X.useState)(!1),[x,S]=(0,X.useState)(null),[C,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(null),[N,P]=(0,X.useState)({open:!1,name:``,instructions:``,workspace:``}),F=(0,X.useRef)(!1),I=l?.agents.find(t=>t.id===e),L=(0,X.useCallback)(()=>{if(!l)return;S(null),V(l.defaultId);let e=new URLSearchParams({agentSetup:`1`,projectScope:`none`,draft:s.setupDraftPrefix});c(`/chat/new?${e.toString()}`,{state:{forceNewChat:!0,agentId:l.defaultId}})},[s.setupDraftPrefix,l,c]),R=(0,X.useCallback)(async()=>{if(!(g||!N.name.trim())){v(!0),A(null);try{let e=await J({profile:{name:N.name.trim(),...N.instructions.trim()?{instructions:N.instructions.trim()}:{}},...N.workspace.trim()?{workspace:N.workspace.trim()}:{}});P({open:!1,name:``,instructions:``,workspace:``}),V(e.createdAgentId),c(`/chat/new?projectScope=none`,{state:{forceNewChat:!0,agentId:e.createdAgentId}})}catch(e){A(e instanceof Error?e.message:String(e))}finally{v(!1)}}},[g,N,c]),z=(0,X.useMemo)(()=>({overflow:(0,Q.jsxs)(me,{children:[(0,Q.jsx)(pe,{asChild:!0,children:(0,Q.jsx)(k,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":o.capabilitiesHub.moreActions,title:o.capabilitiesHub.moreActions,children:(0,Q.jsx)(d,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(fe,{children:(0,Q.jsxs)(ge,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,Q.jsxs)(he,{className:T(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),onSelect:()=>c(`/settings/agent-defaults`),children:[(0,Q.jsx)(y,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),i?`全局默认配置`:`Global defaults`]}),(0,Q.jsxs)(he,{className:T(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,H.transition),onSelect:()=>{A(null),P(e=>({...e,open:!0}))},children:[(0,Q.jsx)(b,{className:`size-4 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),s.manualCreateMenu]})]})})]}),primary:(0,Q.jsxs)(k,{variant:`primary`,className:`shrink-0`,"aria-label":s.listNewAgentCard,onClick:L,children:[(0,Q.jsx)(_,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:s.listNewAgentCard})]})}),[s.listNewAgentCard,s.manualCreateMenu,o.capabilitiesHub.moreActions,c,L,i]);(0,X.useLayoutEffect)(()=>(t?.(z),()=>t?.(null)),[z,t]);let B=async e=>{v(!0),S(null);try{await q(e.id),c(ye)}catch(e){S(e instanceof Error?e.message:String(e))}finally{v(!1)}},W=e=>{V(e),c(`/chat/new`)},G=e=>{F.current=!1,window.setTimeout(()=>c(ve(e)),0)},ee=()=>{if(F.current){M({kind:`discard`,destination:ye});return}F.current=!1,c(ye)},K=()=>{if(F.current){M({kind:`discard`,destination:`/settings/agent-defaults`});return}F.current=!1,c(`/settings/agent-defaults`)},te=()=>{if(!j)return;if(M(null),j.kind===`discard`){F.current=!1,c(j.destination);return}let e=l?.agents.find(e=>e.id===j.agentId);e&&B(e)},re=(0,X.useCallback)(e=>{F.current=e},[]);return n?u&&!l?(0,Q.jsxs)(Ee,{className:ht,padding:mt,children:[(0,Q.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:String(u)}),(0,Q.jsx)(k,{onClick:()=>void p(),children:i?`重试`:`Retry`})]}):f||!l?(0,Q.jsx)(gt,{}):(0,Q.jsxs)(Ee,{gap:`gap-5`,className:ht,padding:mt,children:[(u||x)&&!I?(0,Q.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:x??String(u)}):null,(0,Q.jsx)(dt,{agents:l.agents,tuiDefaultAgentId:h,busy:g,messages:s,onOpen:G,onChat:W}),I?(0,Q.jsx)(lt,{agent:I,tuiDefaultAgentId:h,messages:s,open:!0,onOpenChange:e=>{e||ee()},children:(0,Q.jsx)(st,{agent:I,toolIds:l.builtinToolIds,zh:i,messages:s,externalError:x,onDirtyChange:re,onClose:ee,onOpenDefaults:K,onChat:()=>W(I.id),onDelete:()=>M({kind:`delete`,agentId:I.id,displayName:be(I,s)})},I.id)}):null,(0,Q.jsx)(pt,{draft:N,busy:g,error:C,messages:s,workingDirectoryMessages:o.chat.workingDirectory,onChange:e=>P(t=>({...t,...e})),onCreate:()=>void R(),onOpenChange:e=>{g||(P(t=>({...t,open:e})),e||A(null))}}),(0,Q.jsx)(Y,{open:j!==null,title:j?.kind===`delete`?i?`删除智能体?`:`Delete agent?`:i?`放弃未保存的更改?`:`Discard unsaved changes?`,description:j?.kind===`delete`?i?`删除 ${j.displayName}?此操作无法撤销。`:`Delete ${j.displayName}? This cannot be undone.`:i?`当前更改尚未保存,离开后将丢失。`:`Your changes have not been saved. Leaving will discard them.`,confirmLabel:j?.kind===`delete`?i?`删除`:`Delete`:i?`放弃并离开`:`Discard and leave`,cancelLabel:i?`继续编辑`:`Keep editing`,destructive:!0,overlayClassName:`z-[100]`,contentClassName:`z-[101]`,onConfirm:te,onCancel:()=>M(null)})]}):(0,Q.jsx)(Ee,{className:ht,padding:mt,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`需要本机服务令牌。`:`Local service token required.`})})}export{vt as AgentsSettingsPanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-swr-
|
|
2
|
-
import{t as e}from"./preload-helper-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-swr-CdRzEUwF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import{i as t,o as n}from"./locale-store-lIXD1FMw.js";import{n as r}from"./gateway-config-swr-BAmUhiP1.js";async function i(){let e=await n(t(`/api/agents`));if(!e.payload?.defaultId||!Array.isArray(e.payload.agents))throw Error(`Invalid /api/agents response`);return e.payload}async function a(e){let r=await n(t(`/api/agents/${encodeURIComponent(e)}/effective-config`));if(!r.payload?.config||!r.payload.sources)throw Error(`Invalid effective agent config response`);return r.payload}async function o(t){let{mutate:n}=await e(async()=>{let{mutate:e}=await import(`./vendor-swr-CdRzEUwF.js`).then(e=>e.r);return{mutate:e}},__vite__mapDeps([0,1,2]));await Promise.all([n(`settings-gateway-agents`,t,{revalidate:!1}),n(`setup-checklist-agents`,t,{revalidate:!1}),r()])}async function s(e){let r=await n(t(`/api/agents`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.payload?.agentId||!r.payload.agents)throw Error(`Invalid create agent response`);return await o(r.payload.agents),{...r.payload.agents,createdAgentId:r.payload.agentId}}async function c(e,r){let i=await n(t(`/api/agents/${encodeURIComponent(e)}`),{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.payload)throw Error(`Invalid update agent response`);return await o(i.payload),i.payload}async function l(e,r){await n(t(`/api/agents/${encodeURIComponent(e)}/avatar`),{method:`PUT`,body:JSON.stringify({base64:r.base64,mimeType:r.mimeType})})}async function u(e,r=!1){let i=await n(t(`/api/agents/${encodeURIComponent(e)}${r?`?purge=1`:``}`),{method:`DELETE`});if(!i.payload?.agents)throw Error(`Invalid delete agent response`);return await o(i.payload.agents),i.payload.agents}async function d(e){let r=(await n(t(`/api/agents/${encodeURIComponent(e)}/files`))).payload,i=typeof r?.profileDir==`string`?r.profileDir.trim():``;if(!r?.files||!i)throw Error(`Invalid agent profile files response`);return{agentId:r.agentId,profileDir:i,files:r.files}}async function f(e,r){let i=(await n(t(`/api/agents/${encodeURIComponent(e)}/files/${encodeURIComponent(r)}`))).payload?.content;if(typeof i!=`string`)throw Error(`Invalid agent profile file response`);return i}async function p(e,r,i){await n(t(`/api/agents/${encodeURIComponent(e)}/files/${encodeURIComponent(r)}`),{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:i})})}export{a,c,d as i,l,u as n,i as o,f as r,p as s,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`/capabilities/agents`;function t(t){return`${e}/${encodeURIComponent(t)}`}export{t as n,e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./locale-store-lIXD1FMw.js";async function n(){return(await t(e(`/api/local-apps`))).apps}async function r(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}`))).app}async function i(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/validate`),{method:`POST`})).validation}async function a(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/snapshots/${encodeURIComponent(r)}`))).snapshot}async function o(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/fix-guidance`),{method:`POST`,body:JSON.stringify(r)})).guidance}async function s(n,r,i){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/acceptance-runs`),{method:`POST`,body:JSON.stringify({sourceHash:r,...i})})).acceptance}async function c(n){return(await t(e(`/api/local-apps`),{method:`POST`,body:JSON.stringify(n)})).app}async function l(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/install`),{method:`POST`})).app}async function u(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/releases/${encodeURIComponent(r)}/rollback`),{method:`POST`})).app}async function d(n,r){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/${r?`enable`:`disable`}`),{method:`POST`})).app}async function f(n){return(await t(e(`/api/local-apps/${encodeURIComponent(n)}/install`),{method:`DELETE`})).app}export{l as a,u as c,i as d,a as i,d as l,r as n,n as o,o as r,s,c as t,f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./locale-store-lIXD1FMw.js";import{d as n,i as r,m as i,n as a,u as o}from"./schemas-CCWMleym.js";import{_ as s,a as c,g as l,h as u,l as d,m as f,u as p}from"./tasks-DRmd6sWt.js";import{i as m,r as h,t as g}from"./files-BNL4kkSB.js";var _=n({id:i(),name:i(),status:i(),description:i().optional(),brief:i().optional(),updatedAt:o()}),v=n({dependencyTaskId:i(),dependentTaskId:i()}),y=n({id:i(),title:i(),phase:l,resolution:s.optional(),operationalState:u,priority:d,dueAt:o().optional(),acceptanceCriteriaCount:o().int().nonnegative(),latestVerification:a([`passed`,`failed`,`unverified`]).optional(),nextCheckAt:o().int().nonnegative().optional(),attention:r(f).default([]),blockedBy:r(c).default([]),allowedCommands:r(i()),updatedAt:o()});n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional(),counts:n({ready:o().int().nonnegative(),moving:o().int().nonnegative(),waiting:o().int().nonnegative(),needsUser:o().int().nonnegative(),done:o().int().nonnegative()}),updatedAt:o().int().nonnegative()});var b=n({project:_,tasks:r(y),dependencyEdges:r(v),blockers:r(n({id:i(),taskId:i(),kind:i(),title:i(),detail:i().optional(),href:i().optional(),updatedAt:o().optional()})),recentResults:r(n({taskId:i(),taskTitle:i(),receipt:p})),digest:n({health:a([`healthy`,`attention`,`idle`,`empty`]),summary:i(),recommendedAction:i().optional()})});async function x(n){let r=new URLSearchParams;n?.status&&r.set(`status`,n.status),n?.search?.trim()&&r.set(`search`,n.search.trim()),n?.sortBy&&r.set(`sortBy`,n.sortBy),n?.sortOrder&&r.set(`sortOrder`,n.sortOrder),n?.limit&&r.set(`limit`,String(n.limit)),n?.offset&&r.set(`offset`,String(n.offset));let i=r.toString();return t(e(`/api/projects${i?`?${i}`:``}`))}async function S(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}`))).project}async function C(n){let r=await t(e(`/api/projects/${encodeURIComponent(n)}/operating-view`));return b.parse(r&&typeof r==`object`?r.view:void 0)}async function w(n,r={}){let i=new URLSearchParams;i.set(`visibility`,`timeline`),r.includeRelated&&i.set(`includeRelated`,`true`),r.limit&&i.set(`limit`,String(r.limit)),r.offset&&i.set(`offset`,String(r.offset));let a=i.toString();return t(e(`/api/projects/${encodeURIComponent(n)}/activity${a?`?${a}`:``}`))}async function T(n){return(await t(e(`/api/projects`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify(n)})).project}async function E(n,r,i){return(await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`PATCH`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({...r,expectedVersion:i})})).project}async function D(e,t,n){return E(e,{name:t},n)}async function O(e,t){return E(e,{status:`archived`},t)}async function k(e,t){return E(e,{status:`active`},t)}async function A(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/pin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function j(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/unpin`),{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})).project}async function M(n,r){await t(e(`/api/projects/${encodeURIComponent(n)}`),{method:`DELETE`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({expectedVersion:r})})}async function N(n){return(await t(e(`/api/projects/${encodeURIComponent(n)}/sessions?limit=100`))).sessions}async function P(n){await t(e(`/api/projects/${encodeURIComponent(n)}/digest-knowledge`),{method:`POST`,body:JSON.stringify({})})}async function F(n,r){return(await t(e(`/api/projects/${encodeURIComponent(n)}/blockers`),{method:`POST`,body:JSON.stringify(r)})).blocker}async function I(n,r){let i=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),a=m.parse(i.space),o=new URLSearchParams;r&&o.set(`path`,r);let s=o.toString(),c=h.parse(await t(e(`/api/files/spaces/${encodeURIComponent(a.id)}/children${s?`?${s}`:``}`)));return{ok:!0,root:``,path:r??``,parentPath:r?.includes(`/`)?r.slice(0,r.lastIndexOf(`/`)):null,entries:c.items.map(e=>({fileId:e.id,name:e.name,path:e.relativePath,type:e.kind,size:e.size,updatedAt:new Date(e.modifiedAt).toISOString()}))}}async function L(n){let r=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),i=m.parse(r.space),a=g.parse(await t(e(`/api/files/spaces/${encodeURIComponent(i.id)}/root`)));return{fileId:a.resource.id,name:a.resource.name}}async function R(n,r,i=50){let a=await t(e(`/api/files/contexts/project/${encodeURIComponent(n)}`)),o=m.parse(a.space),s=new URLSearchParams({q:r.trim(),limit:String(i),spaceId:o.id});return h.parse(await t(e(`/api/files/search?${s}`))).items.map(e=>({name:e.name,path:e.relativePath,isDirectory:e.kind===`directory`}))}export{j as _,S as a,C as c,x as d,A as f,R as g,P as h,M as i,L as l,k as m,T as n,w as o,D as p,F as r,I as s,O as t,N as u,E as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`[-webkit-app-region:drag]`,t=`[-webkit-app-region:no-drag]`,n=`h-14 shrink-0 items-center`;export{e as n,t as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./product-delivery-BU_H84jL.js";var n=new Set([`agents`,`capabilities`,`personal`,`user-model`,`automations`,`browser-automations`,`channels`,`chat`,`connectors`,`extensions`,`local-apps`,`notes`,`onboarding`,`open`,`projects`,`settings`,`skills`,`tasks`,`you`]);function r(e){if(!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`))return null;let t=e.slice(1).split(/[/?#]/,1)[0]??``;return t&&n.has(t)?e:null}function i(e){try{let t=new URL(e);return t.protocol!==`xopc:`||t.hostname!==`settings`?null:r(`/settings${t.pathname===`/`?``:t.pathname}${t.search}${t.hash}`)}catch{return null}}function a(n,a=window.location.href){let o=n.trim();if(!o)return{kind:`blocked`};let s=t(o);if(s){let t=e({...s,title:s.id,capabilities:[`open`]});return t?{kind:`internal-route`,route:t}:{kind:`blocked`}}let c=i(o);if(c)return{kind:`internal-route`,route:c};if(o.startsWith(`#/`)){let e=r(o.slice(1));return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}if(o.startsWith(`/`)){let e=r(o);return e?{kind:`internal-route`,route:e}:{kind:`blocked`}}try{let e=new URL(o,a);if(e.protocol!==`http:`&&e.protocol!==`https:`||e.username||e.password)return{kind:`blocked`};let t=new URL(a);if(e.origin===t.origin&&e.hash.startsWith(`#/`)){let t=r(e.hash.slice(1));if(t)return{kind:`internal-route`,route:t}}return{kind:`external-http`,url:e.toString()}}catch{return{kind:`blocked`}}}function o(e,t,n){for(let r of e.querySelectorAll(`a`)){if(n?.(r))continue;let e=a(r.getAttribute(`href`)??``);if(r.dataset.xopcLinkKind=e.kind,e.kind===`blocked`){r.replaceWith(...Array.from(r.childNodes));continue}if(e.kind===`internal-route`){if(r.setAttribute(`href`,`#${e.route}`),r.removeAttribute(`target`),t){let n=e.route.slice(1).split(/[/?#]/,1)[0]??``,i=t.destinations[n]??t.open,a=r.dataset.xopcLinkLabel??r.textContent?.trim()??``;r.dataset.xopcLinkLabel=a,(/^(?:xopc:\/\/|#\/)/i.test(a)||/^(?:Open(?: in xopc)?|打开)$/i.test(a))&&(r.textContent=i),r.title||=i}continue}r.target=`_blank`;let i=new Set(r.rel.split(/\s+/).filter(Boolean));i.add(`noopener`),i.add(`noreferrer`),r.rel=[...i].join(` `)}}async function s(e){let t=a(e);if(t.kind!==`external-http`)return{ok:!1,error:`Only external HTTP(S) links can be opened`};let n=window.electronAPI?.shell?.openExternalUrl;return n?n(t.url):(window.open(t.url,`_blank`,`noopener,noreferrer`),{ok:!0})}export{s as n,a as r,o as t};
|
|
@@ -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"./copy-Dv6d4Dvw.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./package-wATCyihJ.js";import{t as s}from"./messages-DRR9N3HC.js";import{t as c}from"./cn-0WouolD0.js";import{i as l,n as u,o as d}from"./locale-store-lIXD1FMw.js";import{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-CnRSIP6m.js";import{t as m}from"./skeleton-BI5TyibZ.js";import{a as h,i as g,o as _,r as v,s as y,t as b}from"./dist-DfWfZ9iu.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,s]=(0,N.useReducer)(E,R),{info:l,loadError:u,actionError:d,copiedField:f,clearDialogOpen:m,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){s({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();s({type:`patch`,patch:{info:t}})}catch(e){s({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){s({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>s({type:`patch`,patch:{copiedField:null}}),2e3);return}s({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(u)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:u});if(!l)return(0,P.jsx)(D,{rows:2});let U=!l.packaged,W=M||l.pendingUpdate||U,G=!U&&l.uninstallMode!==`unsupported`,K=L(l,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(o,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,d?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:d}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,l.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.appPath,`app`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.dataPath,`data`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(l.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(b,{open:m,onOpenChange:e=>{!e&&!M&&s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>s({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:c(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>s({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(a,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(b,{open:k,onOpenChange:e=>{e||s({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>s({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>s({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await d(l(`/api/migrations/status`))).payload}async function V(){await d(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=f(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(m,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(m,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),h=u.filter(e=>e.safety===`auto`&&e.status===`planned`),g=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:g?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(h.length))})]}),h.length>0&&!g?(0,P.jsx)(p,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=u(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let o;e[18]===i.title?o=e[19]:(o=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=o);let c;e[20]===i.migrations?c=e[21]:(c=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=c);let l;e[22]===i?l=e[23]:(l=(0,P.jsx)(z,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=l);let d;return e[24]!==o||e[25]!==c||e[26]!==l?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[o,c,l]}),e[24]=o,e[25]=c,e[26]=l,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
|