@xopcai/xopc 0.0.481 → 0.0.483
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/dist/assets/{auth-B658Oa_i.js → auth-tm02ZZB8.js} +26 -17
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/dingtalk/src/index.js +8 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/feishu/src/transport/client/install-sdk.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
- package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +2 -2
- package/dist/gateway/server/chunks.bin +1957 -1940
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-zMwJQbPV.js → activity-store-hSe5Nbgk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-VUJHrVXo.js → agent-avatar-dicebear-BY2wRiwY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-umdw-BQZ.js → agent-avatar-display-D_UDgOr9.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-2JEkjXQB.js → agent-defaults-settings-panel-BrcyLG9M.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-Cz08StU4.js → agent-plugin-dialog-CSJC1yud.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BXVjWw0p.js → agents-DX-t3X7K.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-C1Ab97Mn.js → agents-admin-api-DSr-PWuW.js} +1 -1
- package/dist/gateway/static/root/assets/{api-B2QJSgN6.js → api-B3T06TLl.js} +1 -1
- package/dist/gateway/static/root/assets/{api-5GGJYrzC.js → api-CGs641OT.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-IaAONzFg.js → app-management-settings-panel-D6ZoYKaA.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BFo0Yk57.js → appearance-settings-BRb6kZT8.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-aVZLDS59.js → apps-page-DO5uTFRI.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BgX_1X6q.js → archive-plugin-CQ5UXgZk.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-DtFbVh6a.js → automation-api-D-gn6x5E.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CBfGJb7v.js → automation-result-state-B7hq0XOL.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-C-nOpY2_.js → automation-run-list-CM59-qm5.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-BgS9JQeL.js → automation-task-card-C453Q-Wa.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C6dw7Nqb.js → automations-page-C5rp_vOE.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CKCsL5wQ.js → automations-workspace-BxN47gkP.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-DX9lDAWC.js → binary-plugins-D_zw0TgG.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DRNtaARK.js → block-editor-Cesz2DqP.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-settings-page-Btf2a-_0.js → browser-settings-page-BHElJSFt.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-BaKHutgZ.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-C5MLP2Rx.js → capabilities-abgigXV1.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-BFYx0xu5.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B1o8BKxy.js +8 -0
- package/dist/gateway/static/root/assets/{channels-CLpOmzO5.js → channels-_m_FjvAY.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-JoSvbwve.js → chat-agents-api-CyvBfBbp.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-D1XpCNA5.js → chat-chart-block-B83s8HE9.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-D7l_0kTV.js +74 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BDHq9kj3.js → chat-terminal-dock-BKnlzlXT.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-C2IaBEe4.js → command-palette-api-YP0zV_Ol.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-C5hjuJQc.js → composer-model-config-control-C2Bku39S.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-BSboNnS6.js → composer-notifications-MGKffwC7.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-D5CvsQWj.js → composer-payload-handoff-ClWsunJ2.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CwB7HgUb.js → computer-settings-page-DUzQe6Bz.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-DPJ_E0_Y.js → connected-providers-grid-BgW-ioIt.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-DWj6jcFA.js → connection-usage-guide-B9hoSOnN.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DEnQE7bH.js → connector-service-page-e67KylnM.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BRGeDfyP.js → connectors-api-CRGq-TSw.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CXNy8Y5R.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-jqmqOuOL.js → date-picker-DwITf4I2.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-B3n_gScw.js → date-time-picker-ChG1CqR1.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D8Tz4lEu.js → desktop-pet-BHoFymL4.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-24N6UYdz.js → desktop-pet-settings-BYeBN4jj.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DMaKk2H5.js → dev-view-store-DsjH8x76.js} +1 -1
- package/dist/gateway/static/root/assets/device-connections-panel-XtEX1NcJ.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-action-w1enAo76.js +1 -0
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CUMh0ui_.js → device-pairing-wizard-Dt737tSq.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DqknuyWo.js → directory-picker-path-field-B-eUnbng.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-Choc5BaY.js → extension-authoritative-grants-DYp2nNol.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-8tHOJM-0.js → extension-debug-page-BcjkhaY9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-crHrHgry.js → extension-iframe-host-RWjaucjJ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-3vDR-EC4.js → extension-marketplace-api-DGV5FC-v.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-CBdW5Mi0.js → extension-message-router-CzVgJn5c.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-page-ouZIIOwR.js → extension-page-DC58VBdj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CJJRG7Gq.js → extension-provider-BGrqW0_n.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BO8VsTJF.js → extension-settings-page-DYbal3Iq.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-zEJDQWOT.js → file-preview-surface-BOfJPMux.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CNzw8MWj.js → gateway-config-swr-BD-ams0X.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-jIH8iEGO.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-CTWm23Qi.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DaKNDKV9.js → gateway-restart-Dos1Pp84.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BxBJ1zGZ.js → gateway-settings-DUC1iOVK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CSY11ude.js → gateway-startup-retry-DgmvR-hb.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-C0qPO4zT.js → global-defaults-api-B7suATYU.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DnjsusRG.js +8 -0
- package/dist/gateway/static/root/assets/home-task-actions-C8Fi6GBq.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CD1tNChr.js → image-generation-api-Baz4xdZ4.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DHWKf1n3.js → imports-page-DR0eLPgB.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cl5ueYDl.css +1 -0
- package/dist/gateway/static/root/assets/index-DYRzuQl_.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-B3A7BKlp.js → install-connector-dialog-CntHi8Rh.js} +1 -1
- package/dist/gateway/static/root/assets/installed-connector-row-skeleton-BAe_utvG.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BZaTvMnH.js → keyboard-shortcuts-settings-DlGDLJI2.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DH1zWMav.js → local-app-workbench-page-DH5c5Zhv.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CSnxRVm2.js → local-apps-page-BoCtITdL.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CfgBHtlt.js → local-session-drafts-CGSV1RQg.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CeEXxDaP.js → locale-store-CHjsq5NR.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-fF3rKMVM.js → logs-page-D2olKpTB.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-iUbR1cSS.js → management-api-FVu7eYXD.js} +1 -1
- package/dist/gateway/static/root/assets/management-settings-QQB1r71U.js +1 -0
- package/dist/gateway/static/root/assets/map-pin-DNclV497.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-Czi3_WHu.css +1 -0
- package/dist/gateway/static/root/assets/markdown-view-ihzUc4ud.js +261 -0
- package/dist/gateway/static/root/assets/marked.esm-8VXEA2AD.js +64 -0
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-CJdg6fgZ.js → mcp-conversation-setup-page-DffQKrjd.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B_0Q_dY0.js → media-plugins-C78NkHfB.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-L7tv_OPK.js → messages-C7QSnTdg.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-CMsLur91.js → model-selector-QFZY5XNN.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-DI9vvuFx.js → models-hub-cache-BrD6r5Qs.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-lU1-3mBw.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-Bvjumefe.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-Ck4Yvy_j.js → notes-api-D5SvfybU.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-qellAl3o.js → notes-page-YQAAdasN.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-3nGo5FdC.js → oauth-api-DnMpUoyx.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-wtw_Oup3.js → oauth-provider-connect-DGYky6ut.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-Bm8TI2e0.js → page-context-capture-button-CDSH76wA.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-D7Wh_S2e.js → page-context-draft-Bk7jVvAG.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-hCKJckdJ.js → page-header-store-NP7MCIaP.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-CW6MOp9q.js → personal-avatar-1TVnHakL.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-YTJfXUqr.js → personal-page-Bfgb5oQI.js} +1 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-BvjLssF9.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-DgGTnduT.js → personal-settings-panel-Ffr7gcx4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-CiLziQ8R.js → phone-dependencies-card-B4QsgIEF.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DjQJIS33.js → phone-model-connection-Dk5kE1Ll.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BaHl_-yf.js → phone-model-picker-CFoxQiws.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-DEvyfoAt.js → phone-settings-page-Bv1xm8sh.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-9hDVXN9z.js → phone-workspace-store-DGaibcsi.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BI--oe7J.js → plugin-details-dialog-FcOJaeP0.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-DAhA9Z56.js → preference-select-fields-B-yK91If.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-DNxSgx2a.js → preview-runtime-pNF_b2oD.js} +3 -3
- package/dist/gateway/static/root/assets/product-automation-feedback-BxA2Ype-.js +1 -0
- package/dist/gateway/static/root/assets/product-navigation-wFfnI3uw.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-KyiYh48g.js → product-open-page-C09VEZjY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-BSj9eoc8.js → product-preview-content-BOq3gtSJ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-DhONFWvj.js → product-preview-modal-DIh_CsXp.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-DA11E8Iz.js → project-detail-page-DDaG-n-H.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-DjOdtNHh.js → project-understanding-4IyHVmus.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-3Y7Bj3vP.js → projects-page-BHQxQGTd.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-BKDzcCQr.js → providers-api-D9NuB7w3.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-Bg_HBFTj.js → recording-upload-plrQDkLa.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-C91pIb6J.js → registry-api-CDpUAb2R.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DZjxntjM.js → remote-access-hub-DVTs8pwO.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-D8FrMGjx.js → resource-unavailable-CZlqZYk-.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-D3nQJkDG.js → right-workspace-store-Cehybf-G.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-B-OXsVjy.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-BWLC11Ou.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-CbVocuF5.js → runtime-tools-api-BhS0RWf2.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BVcSYWWj.js → runtime-tools-settings-panel-jTbGPGeA.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-DEIaJSOU.js → service-recommendation-list-wfd0Mjtu.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-M4P3knYu.js → session-api-CR3NLqvs.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-CJAPoVO-.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-DRFdxntH.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-label-CZf50vSj.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-CVNlrzFB.js +28 -0
- package/dist/gateway/static/root/assets/sessions-page-9ibCNP9o.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cq4HDQu2.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BRNFkPxE.js → settings-advanced-section-CTLdGPvx.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-va_oX_Q8.js → settings-mode-store-CCQVvItG.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BVFv8SOp.js → settings-page-DzISa84O.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-Wx54i9EL.js → settings-page-header-C21Iw2rD.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DDTKMXIb.js → settings-page-layout-BXcLlp6p.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-CaHdjPKk.js → setup-interaction-page-W2F5ZaR_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-D1XJedVC.js → setup-status-panel-BFNwZuhp.js} +1 -1
- package/dist/gateway/static/root/assets/share-link-dialog-D31jDQN9.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-3QEwX9TP.js → share-preview-page-Co6GUYV5.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dp6g-bfj.js → shares-api-BhWvN3LS.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BbxnfBhc.js → shares-settings-C-czUl49.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BTiymSB8.js → skill-api-BG9A1WF0.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BM8u0Bs_.js → skill-list-api-B26hHnXq.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BP2ecrz2.js → skill-reload-api-B9Eu5Yk_.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DTrONo3c.js → skills-page-gGU0LZ5e.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-Ix7mfZDi.js → space-api-_uKFiASp.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-DhhqkNGh.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-CxV64kNP.js → space-workbook-BAwHwK6O.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C2BWOeNW.js → system-settings-panel-Gu0rWNOv.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DWoXIgp2.js +3 -0
- package/dist/gateway/static/root/assets/{task-header-title-Di5TvRaj.js → task-header-title-DfyaQ58P.js} +1 -1
- package/dist/gateway/static/root/assets/task-run-issue-notice-CljFUd21.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-BIehlq7k.js → tasks-CwyNaa-j.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-mDqqa0EW.js → terminal-panel-store-Cy90Ix5U.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-kQ-dt8qP.js → theme-store-CvG266p8.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BYAYhuS8.js → tracing-settings-page-Cx_fOH70.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-XScou7Y8.js → tunnel-api-Cph-ZBBy.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-NVT8M3Rv.js → understanding-activity-store-CN4JzOIO.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-D5pgGLiW.js → understanding-refresh-store-BuZZ1_VH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CWMg8m0Q.js → usage-page-Du42x0ej.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Iy9pO3fa.js → use-autosave-B_WH_LBE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DfSh4D1i.js → use-composer-attachments-Dnrs5cP1.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BFw8CA51.js → use-file-preview-expanded-U5rH80Jf.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-MuDDqdB3.js → use-generated-media-CzRbgtcv.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-Csm85ZFS.js → use-personal-profile-D4gLM6Wi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-CVmHKsJn.js → use-personal-work-FI9Cgyq5.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-D1zQbDnk.js → use-realtime-voice-BARxeNLd.js} +1 -1
- package/dist/gateway/static/root/assets/use-section-navigation-yC9HkVpd.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-B_do34-j.js → use-workspace-tree-NEeru2fw.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BlBvDtwt.js → user-model-page-AK2U8vGc.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DRlguUPt.js → voice-api-key-field-BqXQj51r.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B2AO_uL_.js → voice-config-api-sXEIG6lz.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-jLnl_86X.js → voice-input-shortcut-events-DN-_rY5a.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-player-store-C8BTMBVX.js → voice-player-store-CTbnOdeM.js} +1 -1
- package/dist/gateway/static/root/assets/voice-settings-bAmN4bUq.js +1 -0
- package/dist/gateway/static/root/assets/wifi-off-C35sMFUl.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C0oaToAM.js → work-discovery-overlay-BjfTRFX8.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-IEKvSp0W.js → work-discovery-page-CSRkFiXc.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-ppDpY-AP.js → working-directory-picker-modal-DgM21YVT.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-C8-p66T-.js +2 -0
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CX8zX9eZ.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-DGsFnZh-.js → workspace-file-preview-dialog-BlNfLhnV.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-CGe_tu1_.js → workspace-open-location-menu-BAbIGS01.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-L-HD-Zf7.js → xopc-cloud-account-card-e8HJFnTs.js} +1 -1
- package/dist/gateway/static/root/index.html +126 -123
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-client/src/index.js +2 -1
- package/dist/packages/endpoint-tools-protocol/src/canonical-json.js +20 -0
- package/dist/packages/endpoint-tools-protocol/src/folders.js +175 -0
- package/dist/packages/endpoint-tools-protocol/src/index.js +14 -16
- package/dist/packages/endpoint-tools-protocol/src/location.js +22 -1
- package/dist/packages/endpoint-tools-protocol/src/personal.js +151 -8
- package/dist/packages/gateway-contract/src/tasks.js +38 -2
- package/dist/src/activity/emitter.js +1 -1
- package/dist/src/activity/index.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +17 -16
- package/dist/src/agent/agent-scope.js +1 -1
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +9 -9
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/coding/workspace-revision.js +2 -2
- package/dist/src/agent/commands/command-registry.js +3 -3
- package/dist/src/agent/commands/commandMounts.js +1 -1
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/deep-recall.js +4 -4
- package/dist/src/agent/context/execution-context.js +3 -3
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/context/workspace-seed.js +2 -2
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/codemode-output.js +4 -4
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +9 -3
- package/dist/src/agent/embedded/run-for-session.js +6 -6
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-runner.js +4 -4
- package/dist/src/agent/external-tools/cliProvider.js +5 -5
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/discovery.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +44 -10
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/image/load-image-media.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/mcp/connection-drafts.js +1 -1
- package/dist/src/agent/mcp/connection-setup.js +2 -2
- package/dist/src/agent/mcp/managed-discovery.js +3 -3
- package/dist/src/agent/mcp/native-mcp.js +1 -1
- package/dist/src/agent/mcp/tool-catalog.js +1 -1
- package/dist/src/agent/mcp/transport.js +1 -1
- package/dist/src/agent/memory/compaction.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/child-run-resume.js +1 -1
- package/dist/src/agent/prompt/response-language.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.js +1 -1
- package/dist/src/agent/reply/post-compaction-context.js +1 -1
- package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/sandbox/fileAccess.js +1 -1
- package/dist/src/agent/sandbox/native-command.js +1 -1
- package/dist/src/agent/sandbox/path-policy.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +3 -3
- package/dist/src/agent/service.js +13 -12
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/session/session-config-service.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-hash.js +2 -2
- package/dist/src/agent/skills/hub-pull.js +6 -6
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.js +1 -1
- package/dist/src/agent/skills/skill-sources.js +3 -3
- package/dist/src/agent/starter-agents.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +7 -7
- package/dist/src/agent/tools/create-share-tool.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +12 -11
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.js +1 -1
- package/dist/src/agent/tools/personal-attention-tool.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +5 -5
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.d.ts +1 -0
- package/dist/src/agent/tools/personal-request-tool.js +3 -2
- package/dist/src/agent/tools/personal-task-tool.js +48 -17
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +2 -2
- package/dist/src/agent/tools/scoped-workspace-tools.js +2 -2
- package/dist/src/agent/tools/session-search-tool.js +2 -2
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
- package/dist/src/agent/tools/tool-media.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +3 -3
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +11 -11
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/agent-catalog/service.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth/openai.js +1 -1
- package/dist/src/auth/oauth/xopc-cloud.js +2 -2
- package/dist/src/auth/oauth-provider-lock.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/write.js +3 -3
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/domain/index.js +1 -1
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +4 -4
- package/dist/src/backup/archive.js +5 -5
- package/dist/src/browser/cache-dir-policy.js +1 -1
- package/dist/src/browser/native-messaging-host.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +7 -7
- package/dist/src/browser/providers/playwright-doctor.js +2 -2
- package/dist/src/browser/remote/endpoint-transport.js +2 -1
- package/dist/src/browser/runtime/browser-runtime.js +1 -1
- package/dist/src/capabilities/capability-catalog.js +3 -3
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +2 -2
- package/dist/src/capabilities/store-connector.js +2 -2
- package/dist/src/channels/catalog/channel-catalog-service.js +1 -1
- package/dist/src/channels/enterprise/setup.d.ts +4 -0
- package/dist/src/channels/enterprise/setup.js +3 -2
- package/dist/src/channels/pairing/allow-from-file.js +1 -1
- package/dist/src/channels/pairing/pairing-store.js +2 -2
- package/dist/src/channels/plugins/types.adapters.d.ts +4 -0
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +2 -2
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-create.js +1 -1
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension-pack.js +3 -3
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/logs.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/mcp.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +4 -4
- package/dist/src/computer/endpoint-transport.js +3 -2
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/config-file.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +3 -3
- package/dist/src/config/paths-state.js +1 -1
- package/dist/src/config/workspace-path.js +1 -1
- package/dist/src/connectors/cli/assets.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/cli/installer.js +3 -3
- package/dist/src/connectors/connected-source-ingestion.js +3 -3
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -1
- package/dist/src/connectors/connection-recovery-service.js +10 -7
- package/dist/src/connectors/content-enrichment.js +3 -3
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/plugin-connection.js +1 -1
- package/dist/src/daemon/constants.js +1 -1
- package/dist/src/daemon/install-plan.js +2 -2
- package/dist/src/daemon/launchd.js +3 -3
- package/dist/src/daemon/schtasks.js +2 -2
- package/dist/src/daemon/systemd.js +3 -3
- package/dist/src/discussions/action-tasks.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +3 -3
- package/dist/src/discussions/repository.js +1 -1
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/discussions/service.js +1 -1
- package/dist/src/endpoint-tools/bridge-host.js +1 -1
- package/dist/src/endpoint-tools/context-store.js +2 -1
- package/dist/src/endpoint-tools/delegation.js +3 -2
- package/dist/src/endpoint-tools/desktop-authority-response.js +2 -1
- package/dist/src/endpoint-tools/folder-connections.d.ts +17 -0
- package/dist/src/endpoint-tools/folder-connections.js +44 -0
- package/dist/src/endpoint-tools/grant-service.js +2 -1
- package/dist/src/endpoint-tools/invocation-service.js +4 -3
- package/dist/src/endpoint-tools/policy.js +15 -4
- package/dist/src/endpoint-tools/provider-catalog.js +2 -1
- package/dist/src/endpoint-tools/provider-operation-journal.js +3 -2
- package/dist/src/endpoint-tools/registry.js +2 -1
- package/dist/src/endpoint-tools/runtime.js +1 -1
- package/dist/src/endpoint-tools/target-resolver.d.ts +1 -1
- package/dist/src/endpoint-tools/target-resolver.js +17 -2
- package/dist/src/endpoint-tools/task-targets.d.ts +3 -1
- package/dist/src/endpoint-tools/task-targets.js +4 -3
- package/dist/src/endpoint-tools/terminal-broker.js +2 -1
- package/dist/src/endpoint-tools/upload-service.js +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +3 -3
- package/dist/src/execution-environments/store.js +1 -1
- package/dist/src/execution-environments/worktree-safety.js +1 -1
- package/dist/src/extensions/agent-plugins/auth.js +3 -3
- package/dist/src/extensions/agent-plugins/branding.js +2 -2
- package/dist/src/extensions/agent-plugins/capability-access.js +1 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +4 -4
- package/dist/src/extensions/agent-plugins/contained-path.js +1 -1
- package/dist/src/extensions/agent-plugins/credentials.js +2 -2
- package/dist/src/extensions/agent-plugins/formats.js +1 -1
- package/dist/src/extensions/agent-plugins/inventory.js +1 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +3 -3
- package/dist/src/extensions/agent-plugins/resources.js +2 -2
- package/dist/src/extensions/agent-plugins/setup.js +5 -5
- package/dist/src/extensions/agent-plugins/skill-catalog.js +5 -5
- package/dist/src/extensions/agent-plugins/source-catalog.js +3 -3
- package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
- package/dist/src/extensions/agent-plugins/sources.js +2 -2
- package/dist/src/extensions/agent-plugins/store.js +5 -5
- package/dist/src/extensions/agent-plugins/user-config.js +3 -3
- package/dist/src/extensions/agent-plugins/validation.js +4 -4
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/extensions/connector-dependencies.js +1 -1
- package/dist/src/extensions/install-transaction.js +1 -1
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/update.js +2 -2
- package/dist/src/files/file-service.js +4 -4
- package/dist/src/files/file-versions.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-reactions/reaction.js +3 -3
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/lib/static-ui.js +2 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +2 -2
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/device-connections.d.ts +3 -0
- package/dist/src/gateway/hono/routes/device-connections.js +198 -0
- package/dist/src/gateway/hono/routes/device-targets.js +32 -5
- package/dist/src/gateway/hono/routes/endpoint-compatibility.js +2 -0
- package/dist/src/gateway/hono/routes/extension-ui-assets.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/host-fs.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +2 -2
- package/dist/src/gateway/hono/routes/location-sharing.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/memory-learning.js +2 -2
- package/dist/src/gateway/hono/routes/mobile-capability-actions.js +4 -4
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +35 -18
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +3 -3
- package/dist/src/gateway/hono/routes/phone.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +7 -7
- package/dist/src/gateway/hono/routes/provider-setup.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/task-retry.d.ts +3 -0
- package/dist/src/gateway/hono/routes/task-retry.js +20 -0
- package/dist/src/gateway/hono/routes/tasks.js +3 -3
- package/dist/src/gateway/hono/routes/tui.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +6 -6
- package/dist/src/gateway/hono/routes/video-generation.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +2 -2
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -1
- package/dist/src/gateway/security/device-request-proof.js +1 -1
- package/dist/src/gateway/security/phone-access.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +3 -3
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/session-input-coordinator.js +2 -2
- package/dist/src/gateway/service.d.ts +9 -0
- package/dist/src/gateway/service.js +48 -40
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/home-intelligence/follow-ups.js +2 -2
- package/dist/src/home-intelligence/generator.js +2 -2
- package/dist/src/home-intelligence/host.js +6 -6
- package/dist/src/home-intelligence/observation.js +1 -1
- package/dist/src/home-intelligence/repository.js +1 -1
- package/dist/src/home-intelligence/routines.js +3 -3
- package/dist/src/imports/files.js +3 -3
- package/dist/src/imports/importService.js +4 -4
- package/dist/src/imports/inventory.js +4 -4
- package/dist/src/imports/planner.js +2 -2
- package/dist/src/imports/productImport.js +2 -2
- package/dist/src/imports/scanner.js +2 -2
- package/dist/src/imports/sources.js +2 -2
- package/dist/src/infra/brew.js +1 -1
- package/dist/src/infra/package-runtime-check.js +2 -2
- package/dist/src/infra/path-env.js +2 -2
- package/dist/src/infra/process-diagnostics.js +1 -1
- package/dist/src/infra/restart.js +1 -1
- package/dist/src/infra/update-check.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-lock.js +1 -1
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/infra/write-file-atomic.js +2 -2
- package/dist/src/knowledge/local-folder-adapter.js +1 -1
- package/dist/src/knowledge-memory/repository.js +1 -1
- package/dist/src/knowledge-memory/usage-policy.js +1 -1
- package/dist/src/local-apps/acceptance.js +1 -1
- package/dist/src/local-apps/artifact-files.js +2 -2
- package/dist/src/local-apps/automation-proposals.js +1 -1
- package/dist/src/local-apps/capabilities/automation-policy.js +1 -1
- package/dist/src/local-apps/capabilities/delegate.js +4 -4
- package/dist/src/local-apps/capabilities/projections.d.ts +1 -1
- package/dist/src/local-apps/execution-authority.js +3 -3
- package/dist/src/local-apps/p1-services.js +5 -5
- package/dist/src/local-apps/preview-fixtures.js +1 -1
- package/dist/src/local-apps/preview-sessions.js +2 -2
- package/dist/src/local-apps/preview-worker.js +3 -3
- package/dist/src/local-apps/public-assets.js +2 -2
- package/dist/src/local-apps/scaffold.js +1 -1
- package/dist/src/local-apps/service.js +8 -8
- package/dist/src/local-apps/snapshot-store.js +1 -1
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/media/store.js +1 -1
- package/dist/src/memory-learning/choice-observations.js +6 -6
- package/dist/src/memory-learning/source-learning.js +4 -4
- package/dist/src/memory-learning/task-receipts.js +2 -2
- package/dist/src/memory-learning/work-capture.js +1 -1
- package/dist/src/memory-learning/work-review.js +2 -2
- package/dist/src/migrations/runner.js +1 -1
- package/dist/src/music-generation/artifact.js +2 -2
- package/dist/src/notes/capabilities/write.js +1 -1
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +5 -5
- package/dist/src/notes/store.js +2 -2
- package/dist/src/notifications/harmony-push.js +1 -1
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/observability/store.js +1 -1
- package/dist/src/personal-agent/capability-service.js +3 -3
- package/dist/src/personal-agent/proactivity/repository.js +1 -1
- package/dist/src/personal-agent/proactivity/routes.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +6 -6
- package/dist/src/personal-agent/prompt-context.js +5 -5
- package/dist/src/personal-agent/prompts.js +2 -2
- package/dist/src/personal-agent/reply-composer.d.ts +2 -0
- package/dist/src/personal-agent/reply-composer.js +139 -89
- package/dist/src/personal-agent/reply-result.d.ts +11 -0
- package/dist/src/personal-agent/reply-result.js +60 -0
- package/dist/src/personal-agent/reply-style.d.ts +1 -1
- package/dist/src/personal-agent/reply-style.js +1 -1
- package/dist/src/personal-agent/request-access.js +1 -1
- package/dist/src/personal-agent/request-delivery.d.ts +1 -1
- package/dist/src/personal-agent/request-delivery.js +12 -11
- package/dist/src/personal-agent/request-service.d.ts +3 -1
- package/dist/src/personal-agent/request-service.js +80 -69
- package/dist/src/personal-agent/result-reader.js +4 -4
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/personal-agent/unread.js +1 -1
- package/dist/src/pets/factory.js +1 -1
- package/dist/src/pets/validator.js +1 -1
- package/dist/src/phone/adb-driver.js +3 -3
- package/dist/src/phone/assistance-service.js +1 -1
- package/dist/src/phone/assistance.js +1 -1
- package/dist/src/phone/cloud-adb-connection.js +2 -2
- package/dist/src/phone/execution-trace.js +1 -1
- package/dist/src/phone/hdc-driver.js +3 -3
- package/dist/src/phone/hdc-video-tools.js +2 -2
- package/dist/src/phone/location-baseline-store.js +1 -1
- package/dist/src/phone/location-environment.js +1 -1
- package/dist/src/phone/repository.js +1 -1
- package/dist/src/phone/ui-session.js +2 -2
- package/dist/src/project-trust/trust-store.js +2 -2
- package/dist/src/projects/capabilities/write.js +2 -2
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-kind.js +1 -1
- package/dist/src/projects/project-service.js +4 -4
- package/dist/src/projects/project-skill-service.js +3 -3
- package/dist/src/projects/workspace-project.js +2 -2
- package/dist/src/projects/workspace.js +1 -1
- package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
- package/dist/src/runtime-tools/archive.js +2 -2
- package/dist/src/runtime-tools/downloader.js +2 -2
- package/dist/src/runtime-tools/harmony-dependencies.js +6 -6
- package/dist/src/runtime-tools/hdc-files.js +1 -1
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/runtime-tools/manifest-store.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +3 -3
- package/dist/src/session/history-recall-policy.js +2 -2
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/init-session-turn.js +1 -1
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/share/hosted-note-publication.js +1 -1
- package/dist/src/share/hosted-session-share.js +2 -2
- package/dist/src/share/hosted-static-site-publication.js +2 -2
- package/dist/src/share/note-share-service.js +1 -1
- package/dist/src/share/session-share-service.js +2 -2
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.js +2 -2
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/share/site-static-serve.js +1 -1
- package/dist/src/space/budget-workbook.js +1 -1
- package/dist/src/space/ingest.js +1 -1
- package/dist/src/space/repository.js +3 -3
- package/dist/src/space/workbook-turn.js +1 -1
- package/dist/src/space/worker.js +1 -1
- package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
- package/dist/src/storage/sqlite/connection.js +3 -3
- package/dist/src/storage/sqlite/conversation-repository.js +2 -2
- package/dist/src/storage/sqlite/desktop-execution-repository.js +3 -2
- package/dist/src/storage/sqlite/desktop-execution-stop-repository.js +3 -2
- package/dist/src/storage/sqlite/desktop-operation-repository.js +2 -1
- package/dist/src/storage/sqlite/device-access-repository.js +1 -1
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/index.js +1 -1
- package/dist/src/storage/sqlite/offline-access.js +1 -1
- package/dist/src/storage/sqlite/schema-upgrade.js +3 -3
- package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
- package/dist/src/storage/sqlite/session-input-control-repository.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/storage/sqlite/sql-assets.js +1 -1
- package/dist/src/storage/sqlite/windows-database-owners.js +1 -1
- package/dist/src/tasks/capabilities/management.js +1 -1
- package/dist/src/tasks/capabilities/read.js +4 -4
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/capabilities/write.js +3 -3
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/task-allocation-service.js +9 -9
- package/dist/src/tasks/task-application-service.d.ts +8 -0
- package/dist/src/tasks/task-application-service.js +20 -9
- package/dist/src/tasks/task-context-assembler.js +4 -4
- package/dist/src/tasks/task-contract-planner.js +2 -2
- package/dist/src/tasks/task-criterion-review-repository.js +1 -1
- package/dist/src/tasks/task-deliverables.js +1 -1
- package/dist/src/tasks/task-execution-capabilities.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +2 -2
- package/dist/src/tasks/task-handoff.js +15 -15
- package/dist/src/tasks/task-json-acceptance.js +3 -3
- package/dist/src/tasks/task-main-update-decision-service.js +2 -2
- package/dist/src/tasks/task-main-update-delivery.js +1 -1
- package/dist/src/tasks/task-model-call.js +1 -1
- package/dist/src/tasks/task-origin-repository.d.ts +2 -0
- package/dist/src/tasks/task-origin-repository.js +3 -2
- package/dist/src/tasks/task-read-model-projector.js +22 -8
- package/dist/src/tasks/task-research-repair.js +2 -2
- package/dist/src/tasks/task-research-result.js +5 -5
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +4 -4
- package/dist/src/tasks/task-retry-policy.d.ts +5 -0
- package/dist/src/tasks/task-retry-policy.js +48 -0
- package/dist/src/tasks/task-retry-service.d.ts +18 -0
- package/dist/src/tasks/task-retry-service.js +186 -0
- package/dist/src/tasks/task-run-coordinator.js +8 -8
- package/dist/src/tasks/task-run-dispatcher.js +3 -2
- package/dist/src/tasks/task-run-repository.d.ts +1 -1
- package/dist/src/tasks/task-run-repository.js +1 -1
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tasks/task-workspace-verification.js +3 -3
- package/dist/src/tui/backends/embedded-backend.js +11 -11
- package/dist/src/tui/backends/embedded-drafts.js +2 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/clipboard-image.js +3 -3
- package/dist/src/tui/theme-manager.js +1 -1
- package/dist/src/tui/tui-capabilities.js +3 -3
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +2 -2
- package/dist/src/tui/tui-keybindings-file.js +1 -1
- package/dist/src/tui/tui-management.js +6 -6
- package/dist/src/tui/tui-scoped-models.js +1 -1
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui.js +7 -7
- package/dist/src/tunnel/frpc-binary.js +2 -2
- package/dist/src/tunnel/frpc-config.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +2 -2
- package/dist/src/tunnel/tunnel-state.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -2
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +2 -2
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/repository.js +1 -1
- package/dist/src/user-model/usage-policy.js +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/logger/index.js +1 -1
- package/dist/src/utils/logger.js +1 -1
- package/dist/src/video-generation/artifact.js +2 -2
- package/dist/src/video-generation/repository.js +1 -1
- package/dist/src/voice/audio/normalize.js +2 -2
- package/dist/src/voice/realtime/conversation-context.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +4 -4
- package/dist/src/voice/realtime/persona-context.js +2 -2
- package/dist/src/voice/realtime/runtime.js +1 -1
- package/dist/src/voice/realtime/user-context.js +1 -1
- package/dist/src/voice/tts/providers/edge-speech.js +2 -2
- package/dist/src/work-discovery/candidate-discovery.js +3 -3
- package/dist/src/work-discovery/probe.js +4 -4
- package/dist/src/work-discovery/service.js +7 -7
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/capabilities-SIty9Vcz.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BnTgeZB3.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7MsgsVvQ.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-sPNbEboB.js +0 -72
- package/dist/gateway/static/root/assets/connectors-page--3zYHSCM.js +0 -1
- package/dist/gateway/static/root/assets/diagnostics-Bo0Z42P_.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-BCghEC3U.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CQygYU9S.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DzSLTEJf.js +0 -8
- package/dist/gateway/static/root/assets/index-B9_yImuQ.css +0 -1
- package/dist/gateway/static/root/assets/index-BrXVoLVe.js +0 -11
- package/dist/gateway/static/root/assets/management-settings-BWJ-4D2j.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BQw7H2MV.js +0 -324
- package/dist/gateway/static/root/assets/markdown-view-DG8DDkEA.css +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BhJM-EYy.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-y9OBo4Kv.js +0 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-Qn6MR0gu.js +0 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-ChMWhk-X.js +0 -7
- package/dist/gateway/static/root/assets/product-navigation-Dp-adLY_.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-B_CMsS70.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BTuii051.js +0 -2
- package/dist/gateway/static/root/assets/session-channel-icon-COynhpeK.js +0 -1
- package/dist/gateway/static/root/assets/session-identity-label-DCIZvqbN.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-DQ0fiEo9.js +0 -22
- package/dist/gateway/static/root/assets/sessions-page-UTEjz3V0.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cnkvm_q6.js +0 -1
- package/dist/gateway/static/root/assets/share-link-dialog-C8bVavnr.js +0 -1
- package/dist/gateway/static/root/assets/space-page-Dpy0BPbT.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DqgGOX0M.js +0 -3
- package/dist/gateway/static/root/assets/task-run-issue-notice-FMMn1lE6.js +0 -1
- package/dist/gateway/static/root/assets/voice-settings-D8Snr-5R.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-C85sEgvX.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CNPlB8xY.js +0 -1
- package/dist/gateway/static/root/assets/workspace-preview-store-D8eGmciG.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{_ as i,f as a}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{_ as i,f as a}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-CHjsq5NR.js";import{t as d}from"./messages-C7QSnTdg.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./popover-select-hRG1EzAY.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./cpu-B247669f.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./eye-CABVeTq0.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./gauge-C78eD2BA.js";import{t as x}from"./globe-DSSGFWFn.js";import{t as S}from"./info-CDrmIZhb.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./lock-keyhole-DEK5kH0u.js";import{t as T}from"./plug-zap-L8NMe3Sv.js";import{t as E}from"./refresh-cw-BRlGaq2w.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./triangle-alert-2JXFNNKU.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{i as A}from"./vendor-swr-CdRzEUwF.js";import{n as j,r as ee}from"./gateway-config-swr-BD-ams0X.js";import{t as M}from"./button-C5tRaJxt.js";import{n as te,t as N}from"./settings-form-draft-Dy10ldo8.js";import{n as P}from"./settings-loading-skeleton-CAoOV17i.js";import{t as ne}from"./number-input-El7Szeln.js";import{n as F,t as re}from"./settings-page-header-C21Iw2rD.js";import"./settings-page-layout-BXcLlp6p.js";import{n as I,t as L}from"./use-autosave-B_WH_LBE.js";var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(31),{name:n,title:r,summary:a,icon:o,inset:s,children:c}=e,l=s!==void 0&&s,[u,d]=i(),p=(0,z.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==u?(h=u.get(m),t[0]=m,t[1]=u,t[2]=h):h=t[2];let g=h===`1`,_=l?`border-t border-edge-subtle`:`rounded-2xl bg-surface-base`,v;t[3]!==m||t[4]!==g||t[5]!==d?(v=()=>d(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=d,t[6]=v):v=t[6];let y;t[7]===o?y=t[8]:(y=o&&(0,B.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:o}),t[7]=o,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,B.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,B.jsx)(f,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,B.jsx)(`h2`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&c,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,B.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,B.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function ie(){return u(s(`/api/browser/status`))}function H(){return u(s(`/api/browser/test`),{method:`POST`})}function ae(e=!1){return u(s(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function U(e){return u(s(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function oe(e,t){let n=await o(s(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:t});if(!n.ok||!n.body)throw Error(`Chromium install request failed (HTTP ${n.status}).`);let r=n.body.getReader(),i=new TextDecoder,a=``,c;try{for(;!c;){let t=await r.read();if(t.done)break;a+=i.decode(t.value,{stream:!0}),a=a.replace(/\r\n/g,`
|
|
2
2
|
`);let n=a.split(`
|
|
3
3
|
|
|
4
4
|
`);a=n.pop()??``;for(let t of n){let n=t.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,c as n,d as r,f as i,g as a,i as o,l as s,m as c,n as l,o as u,p as d,r as ee,s as f,u as p,y as m}from"./schemas-CCWMleym.js";import{a as h,o as g}from"./turn-outcome-BSbEJx8h.js";import{l as te,s as ne,u as re}from"./product-delivery-4gEqUIsK.js";import{b as _,c as ie,d as v,h as y,l as b,m as x,n as S,o as C,v as w}from"./tasks-CwyNaa-j.js";import{_ as ae,g as oe}from"./local-session-drafts-CGSV1RQg.js";var T=l([`pr_review`,`issue_digest`,`work_summary`]),se=r({kind:T,topicIds:o(c()).min(1).max(8),requestCount:p().int().min(2),previews:o(c()).max(2)});d({kind:T,topicIds:o(c().min(1)).min(1).max(8),expectedRevision:p().int().positive(),idempotencyKey:c().min(1).max(120),locale:l([`zh`,`en`])});var ce={pr_review:{zh:{deliverables:[`相关 PR 和原始链接`,`每个 PR 建议核查的内容`,`还缺哪些代码或资料`],title:`PR 审查准备清单`,output:`把近期要审的 PR、需要核查的点和缺少的资料整理成一份清单。`,criteria:[`每个 PR 附上原始请求或链接`,`区分待核查项与已验证结论,未读取代码时不得给出审查通过结论`]},en:{deliverables:[`Related PRs and original links`,`Suggested checks for each PR`,`Code or source material still needed`],title:`PR review preparation`,output:`A checklist of requested PR reviews, points to inspect and missing source material.`,criteria:[`Link each PR to its original request or URL`,`Distinguish suggested checks from verified findings; never approve code that has not been read`]}},issue_digest:{zh:{deliverables:[`相关问题和原始线索`,`已知信息与待确认的判断`,`下一步排查需要的日志或资料`],title:`问题排查摘要`,output:`把近期的问题线索、已知事实和待补充的信息整理好,方便继续排查。`,criteria:[`每条问题线索标明来源`,`区分用户描述、已证实事实和假设,不把缺少日志的问题说成已经解决`]},en:{deliverables:[`Issues and their original reports`,`Known information and open questions`,`Logs or material needed for the next step`],title:`Issue investigation brief`,output:`A brief of recent issue reports, known facts and information needed for investigation.`,criteria:[`Cite the source of every issue report`,`Separate user reports, verified facts and hypotheses; do not claim a fix without evidence`]}},work_summary:{zh:{deliverables:[`按项目归类的工作条目`,`已确认进展和仍待确认的事项`,`待办与阻塞`],title:`工作进展草稿`,output:`按项目归纳近期工作、待办和阻塞,生成一份可修改的进展草稿。`,criteria:[`工作条目附来源,缺少项目归属时明确标注`,`区分工作请求与完成结果,不把用户提出的任务当作已经完成`]},en:{deliverables:[`Work items grouped by project`,`Confirmed progress and items needing confirmation`,`Pending work and blockers`],title:`Work progress draft`,output:`An editable draft grouping recent work, pending items and blockers by project.`,criteria:[`Cite work items and flag unknown project ownership`,`Distinguish requested tasks from completed outcomes; requests alone do not prove completion`]}}},E=u(`kind`,[r({kind:n(`once`),at:c()}),r({kind:n(`interval`),everyMs:p().positive(),anchorMs:p().optional()}),r({kind:n(`cron`),expr:c(),tz:c().optional()})]),D=u(`kind`,[r({kind:n(`manual`)}),r({kind:n(`schedule`),schedule:E}),r({kind:n(`webhook`),secretId:c().optional()}),r({kind:n(`event`),eventType:c(),source:c().optional(),payloadMatch:i(c(),a([c(),p(),t(),ee()])).optional()})]),O=u(`kind`,[r({kind:n(`routine`),routineId:c(),version:p().int().positive(),hash:c()}),r({kind:n(`agent`),agentId:c().optional(),instruction:c(),mcpSourceId:c().max(200).optional(),workingDirectory:c().optional(),model:c().optional(),timeoutSeconds:p().positive().optional()}),r({kind:n(`task_command`),taskId:c(),command:S}),r({kind:n(`personal_task`),conversationId:c(),agentId:c(),instruction:c(),locale:l([`zh`,`en`])}),r({kind:n(`system`),capability:l([`home.advisor.refresh`,`personal.proactivity.tick`,`memory.temporal_sweep`,`memory.daily_reconciliation`,`memory.weekly_knowledge`])})]),k=l([`queued`,`running`,`cancelling`,`succeeded`,`failed`,`cancelled`,`timeout`]),le=u(`kind`,[r({key:c(),kind:n(`gateway_event`)}),r({key:c(),kind:n(`weixin`),conversationId:c().uuid(),principalId:c().min(1)}),r({key:c(),kind:n(`webhook`),endpoint:c().url().startsWith(`https://`),secretId:c()}),r({key:c(),kind:n(`file`),targetId:c(),pathTemplate:c()}),r({key:c(),kind:n(`card`),channelId:c(),templateId:c()})]),A=r({id:c(),name:c(),description:c().optional(),projectId:c().optional(),enabled:t(),trigger:D,action:O,safety:r({mode:l([`suggest_only`,`ask_before_apply`,`auto_apply`])}).optional(),conversationMode:l([`new_session`,`continuous`]).optional(),delivery:r({notificationPolicy:l([`attention`,`all`,`none`]),destinations:o(le)}),reliability:r({executionTimeoutSeconds:p().positive().optional(),retryCount:p().int().nonnegative().optional(),maxConcurrentRuns:p().int().positive().optional(),disableAfterConsecutiveFailures:p().int().positive().optional()}).optional(),management:r({owner:c(),editable:o(l([`enabled`,`trigger`])),runnable:t(),deletable:t()}).optional(),state:r({nextRunAtMs:p().optional(),runningRunId:c().optional(),lastRunAtMs:p().optional(),lastRunStatus:k.optional(),lastError:c().optional(),consecutiveFailures:p().int().nonnegative().optional()}),createdAtMs:p(),updatedAtMs:p()}),j=r({id:c(),automationId:c(),automationName:c(),status:k,triggerSnapshot:D,actionSnapshot:O,manual:t(),createdAtMs:p(),startedAtMs:p().optional(),endedAtMs:p().optional(),durationMs:p().optional(),summary:c().optional(),error:c().optional(),conversationId:c().optional(),conversationShared:t().optional(),model:c().optional(),deadlineAtMs:p().optional(),currentPhase:l([`queued`,`action`,`cancelling`,`completed`]).optional(),cancelRequestedAtMs:p().optional(),cancelConfirmedAtMs:p().optional(),termination:r({reason:l([`completed`,`failed`,`user_cancelled`,`deadline_exceeded`]),component:l([`automation`,`agent_turn`,`tool`,`mcp`,`process`]).optional(),componentName:c().optional(),cancellationConfirmed:t()}).optional(),heartbeatAtMs:p().optional(),leaseOwner:c().optional(),leaseExpiresAtMs:p().optional(),attemptNumber:p().int().positive().optional(),rootRunId:c().optional()}),M=r({id:c(),runId:c(),automationId:c(),type:l([`run.queued`,`run.started`,`run.deadline_resolved`,`run.cancel_requested`,`run.cancel_confirmed`,`run.cancellation_unconfirmed`,`run.recovered`,`action.started`,`action.retry_scheduled`,`action.completed`,`action.failed`,`run.completed`]),message:c(),data:e().optional(),createdAtMs:p()}),N=r({totalAutomations:p().int().nonnegative(),enabledAutomations:p().int().nonnegative(),runningRuns:p().int().nonnegative(),failedLastHour:p().int().nonnegative(),nextRun:r({automationId:c(),name:c(),runAtMs:p()}).optional(),pendingEvents:p().int().nonnegative(),oldestPendingEventAgeMs:p().int().nonnegative(),projectionDeadLetters:p().int().nonnegative(),pendingRunDeliveries:p().int().nonnegative(),runDeliveryDeadLetters:p().int().nonnegative(),pendingResultDeliveries:p().int().nonnegative(),resultDeliveryDeadLetters:p().int().nonnegative(),activeExecutions:p().int().nonnegative(),activeDeliveryLeases:p().int().nonnegative()}),P=r({version:p(),baseVersion:p().nullable(),additions:o(c()),status:l([`candidate`,`validating`,`validated`,`approved`,`rejected`]),validationTaskId:c().nullable(),validation:l([`unverified`,`passed`,`failed`])}),F=r({id:c(),topicId:c(),title:c(),status:l([`active`,`paused`,`ended`]),revision:p(),adoptedVersion:p(),automationId:c(),validUntil:p(),schedule:E.nullable(),methods:o(P),executions:o(r({taskId:c(),runId:c(),version:p(),status:c(),verdict:c().nullable()}))});d({topicId:c().min(1),trialTaskId:c().min(1),expectedTaskVersion:p().int().positive(),idempotencyKey:c().min(1).max(200),schedule:E,validUntil:p().int().positive()}),d({expectedRevision:p().int().positive(),idempotencyKey:c().min(1).max(200),command:u(`kind`,[d({kind:n(`pause`)}),d({kind:n(`resume`)}),d({kind:n(`end`)}),d({kind:n(`configure`),schedule:E,validUntil:p().int().positive()}),d({kind:n(`validate`),version:p().int().positive()}),d({kind:n(`adopt_method`),version:p().int().positive()}),d({kind:n(`rollback`),version:p().int().positive()}),d({kind:n(`reject_method`),version:p().int().positive()})])});var I=r({id:c(),text:c(),scope:l([`once`,`project`,`similar`]),status:l([`active`,`retracted`]),createdAt:p()}),L=r({id:c(),title:c(),projectId:c().optional(),revision:p(),entries:o(r({id:c(),kind:c(),text:c(),sourceRef:c().nullish(),createdAt:p()})),feedback:o(I),trials:o(r({taskId:c(),title:c(),phase:c(),resolution:c().nullable(),taskVersion:p().optional()})),routine:F.optional()}),R=r({id:c().optional(),status:l([`disabled`,`active`,`paused`]),revision:p(),analyzedRevision:p(),lastProcessedAt:p().nullable(),starters:o(se).optional(),followUps:o(g).optional(),followUpCandidates:o(h).optional(),topics:o(L)}),z=u(`kind`,[d({kind:n(`start`),backfillDays:p().int().min(0).max(30).default(30)}),d({kind:n(`pause`)}),d({kind:n(`resume`),mode:l([`catch_up`,`new_only`])}),d({kind:n(`feedback`),topicId:c().min(1),text:c().trim().min(1).max(1e3),scope:l([`once`,`project`,`similar`])}),d({kind:n(`retract`),topicId:c().min(1),feedbackId:c().min(1)}),d({kind:n(`forget`),topicId:c().min(1)})]);d({idempotencyKey:c().min(1).max(200),expectedRevision:p().int().nonnegative(),command:z}),d({topicId:c().min(1),opportunityId:c().min(1),expectedRevision:p().int().positive(),expectedOpportunityRevision:p().int().positive(),idempotencyKey:c().min(1).max(200)});var B=r({id:c(),kind:l([`task`,`connector_approval`]),title:c(),detail:c().optional(),reason:l([`needs_input`,`blocked`,`user_input`,`user_approval`,`dependency`,`external`,`scheduled`,`retry`,`paused`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:l([`now`,`soon`]),href:c(),projectId:c().optional(),projectName:c().optional(),dueAt:p().int().nonnegative().optional(),updatedAt:p(),response:u(`kind`,[r({kind:n(`connector_approval`),approvalId:c()}),r({kind:n(`task`),taskId:c(),canRetry:t()})]).optional()});r({id:c(),kind:l([`automation_run`]),runId:c(),title:c(),detail:c(),reason:l([`run_failed`,`run_timeout`]),href:c(),updatedAt:p(),conversationId:c().optional()});var V=u(`type`,[r({type:n(`task_review`),label:c(),taskId:c()}),r({type:n(`retry_task`),label:c(),taskId:c()}),r({type:n(`open`),label:c(),href:c()}),r({type:n(`connector_decision`),label:c(),approvalId:c(),decision:l([`approve`,`deny`])}),r({type:n(`retry_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()}),r({type:n(`acknowledge_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()})]),H=r({id:c(),kind:l([`decision`,`failure`,`running`,`scheduled`]),title:c(),summary:c(),projectId:c().optional(),projectName:c().optional(),recommendation:c().optional(),dueAt:p().int().nonnegative().optional(),statusLabel:c().optional(),backgroundState:l([`waiting`,`paused`]).optional(),updatedAt:p(),openAction:V.optional(),primaryAction:V.optional(),secondaryActions:o(V).max(2).default([])}),U=r({conversationId:c(),runId:c(),title:c().optional(),agentId:c().optional(),updatedAt:p()}),W=d({id:c().trim().min(1).max(300),sourceType:l([`project`,`task`,`conversation`,`calendar`,`mail`,`communication`,`file`,`user_model`]),sourceRef:c().trim().min(1).max(1e3),revision:c().trim().min(1).max(300),observation:c().trim().min(1).max(1e3),observedAt:p().int().nonnegative(),freshUntil:p().int().nonnegative(),href:c().trim().min(1).max(2e3).optional()}),ue=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),resolvedId:c().trim().min(1).max(300).optional(),readiness:l([`ready`,`needs_setup`,`unavailable`]),required:t(),recoveryPath:c().trim().min(1).max(2e3).optional(),reason:c().trim().min(1).max(500).optional()}),de=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),code:l([`not_installed`,`disabled`,`agent_not_allowed`,`scope_too_narrow`,`connection_missing`,`account_selection_required`,`reauthorization_required`,`requirements_unmet`,`model_invocation_disabled`,`tool_gated`,`agent_unavailable`]),message:c().trim().min(1).max(500),recoveryPath:c().trim().min(1).max(2e3)}),fe=u(`state`,[d({state:n(`ready`)}),d({state:n(`needs_setup`),blockers:o(de).min(1).max(12),recoveryActions:o(d({capability:c().trim().min(1).max(200),href:c().trim().min(1).max(2e3)})).min(1).max(12),degradedAction:d({mode:n(`degraded_start`)}).optional()})]),pe=d({summary:c().trim().min(1).max(300),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),me=d({version:n(1),locale:l([`zh`,`en`]),groups:o(pe).min(1).max(8)}),G=d({id:c().trim().min(1).max(200),revision:p().int().positive(),kind:l([`project_next_step`,`delivery_risk`,`meeting_prep`,`commitment_follow_up`,`automation_candidate`]),projectId:c().trim().min(1).max(200).optional(),title:c().trim().min(1).max(160),outcome:c().trim().min(1).max(1e3),rationale:c().trim().min(1).max(1500),evidence:o(W).min(1).max(8),evidencePresentation:me.optional(),confidence:l([`high`,`medium`,`low`]),urgency:l([`now`,`today`,`this_week`]),estimatedMinutes:p().int().min(1).max(480).optional(),risk:l([`analysis`,`external_read`,`file_write`,`external_write`]),proposedSteps:o(c().trim().min(1).max(500)).min(1).max(6),capabilities:o(ue).max(12),verification:o(c().trim().min(1).max(500)).max(8),actionPrompt:c().trim().min(1).max(4e3),degradedActionPrompt:c().trim().min(1).max(4e3).optional(),continuation:u(`kind`,[d({kind:n(`automation`),reason:n(`repeated_success`),href:c().trim().min(1).max(4e3),successCount:p().int().min(2)})]).optional(),actions:d({canStart:t(),canDiscuss:t(),degradedStartAvailable:t()}),generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative()}),he=d({id:c().trim().min(1).max(200),revision:p().int().positive(),question:c().trim().min(1).max(500),options:o(d({id:c().trim().min(1).max(100),label:c().trim().min(1).max(200)})).min(2).max(3),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),ge=u(`state`,[d({state:n(`disabled`)}),d({state:n(`quiet`),reason:l([`no_change`,`insufficient_value`,`model_unavailable`,`generation_failed`,`budget_exhausted`])}),d({state:n(`refreshing`),previous:G.optional(),requestedAt:p().int().nonnegative()}),d({state:n(`clarification`),question:he,generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative()}),d({state:n(`ready`),primary:G,alternatives:o(G).max(2),placement:l([`primary`,`compact`]),generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative(),stale:t()})]);d({idempotencyKey:c().trim().min(1).max(200),locale:c().trim().max(30).optional()}),d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:p().int().positive(),kind:l([`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]),reasonCode:c().trim().min(1).max(100).optional(),note:c().trim().min(1).max(1e3).optional(),snoozedUntil:p().int().nonnegative().optional()}),d({idempotencyKey:c().trim().min(1).max(200)});var _e=d({items:o(d({opportunity:G,status:l([`available`,`started`,`discussing`,`completed`,`snoozed`,`dismissed`,`expired`,`superseded`]),feedbackKind:l([`started`,`discussed`,`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]).optional(),updatedAt:p().int().nonnegative(),snoozedUntil:p().int().nonnegative().optional(),href:c().trim().min(1).max(2e3).optional()})).max(100)});d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:p().int().positive(),mode:l([`start`,`degraded_start`,`discuss`])});var ve=u(`outcome`,[d({outcome:n(`task`),taskId:c(),href:c()}),d({outcome:n(`chat_draft`),href:c()}),d({outcome:n(`needs_setup`),preflight:fe})]),ye=r({observation:R.optional(),runningConversations:o(U).default([]),recentDeliveries:o(r({id:c(),kind:l([`task`,`automation`]),subjectId:c(),projectId:c().optional(),title:c(),summary:c(),completedAt:p(),read:t(),href:c()})).default([]),resumable:o(r({id:c(),kind:l([`task`,`conversation`]),title:c(),summary:c().optional(),projectName:c().optional(),updatedAt:p(),href:c()})).default([]),needsUser:o(H),background:o(H),backgroundCount:p().int().nonnegative(),decisions:o(B),advisor:ge,attentionPolicy:r({visibleDecisionCount:p().int().nonnegative(),suppressedDecisionCount:p().int().nonnegative(),visibleAttentionCount:p().int().nonnegative(),suppressedAttentionCount:p().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0})});d({window:d({since:p().int().nonnegative(),until:p().int().nonnegative()}),currentStrategyVersion:c().trim().min(1).max(100),generations:d({total:p().int().nonnegative(),succeeded:p().int().nonnegative(),quiet:p().int().nonnegative(),failed:p().int().nonnegative(),estimatedCostUsd:p().nonnegative()}),outcomes:d({opportunities:p().int().nonnegative(),started:p().int().nonnegative(),discussed:p().int().nonnegative(),completed:p().int().nonnegative(),corrected:p().int().nonnegative(),expired:p().int().nonnegative()}),rates:d({start:p().min(0).max(1),completionFromStarted:p().min(0).max(1),correction:p().min(0).max(1)}),feedback:d({alreadyDone:p().int().nonnegative(),irrelevant:p().int().nonnegative(),tooEarly:p().int().nonnegative(),sourceIncorrect:p().int().nonnegative(),lessLikeThis:p().int().nonnegative()}),strategies:o(d({version:c().trim().min(1).max(100),generations:p().int().nonnegative(),opportunities:p().int().nonnegative(),started:p().int().nonnegative(),completed:p().int().nonnegative()}))});var be=r({northStar:r({weeklyTrustedProgress:p(),weeklyActiveUsers:p(),trustedProgressPerWeeklyActiveUser:p()}),tasks:r({total:p(),achieved:p(),partial:p(),notAchieved:p(),userCorrected:p(),achievementRate:p(),correctionRate:p(),trusted:p(),trustedRate:p()})});function xe(e){return ye.parse(e)}l([`http`,`agent`,`cli`,`automation`,`mcp`,`extension`]);var Se=a([l(`overview.imports.sessions.tracing.usage.logs.computer-use.phone-use.agent-browser.extensions/debug.connector-service.appearance.keyboard-shortcuts.system.desktop-pet.desktop-app.agent-defaults.gateway.runtimes.devices.remote-access.shares.capabilities/models.capabilities/image.capabilities/voice.capabilities/search`.split(`.`)),c().regex(/^ext\/[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$/i).max(512)]);l([`INVALID_INPUT`,`FORBIDDEN`,`NOT_FOUND`,`REVISION_CONFLICT`,`CONTRACT_CHANGED`,`APPROVAL_REQUIRED`,`IN_PROGRESS`,`UNAVAILABLE`,`OUTCOME_UNKNOWN`,`CANCELLED`,`INTERNAL`]);var Ce=d({majorVersion:p().int().positive(),descriptorDigest:c().regex(/^[a-f0-9]{64}$/),input:f(),idempotencyKey:c().min(1).max(200).optional()}),we=r({triggerSummary:c(),actionSummary:c(),safetyNotes:o(c()),requiredConfirmations:o(c()),canRunNow:t(),runNowBlockedReason:c().optional()});d({agentId:c().trim().min(1).max(64).optional(),language:l([`en`,`zh`]).default(`en`)}),r({draftId:c(),explanation:c(),assumptions:o(c()),risks:o(c()),automation:s({name:c(),trigger:f(),action:f()}),simulation:we,repairAttempts:p().int().nonnegative()}),r({draftId:c(),patch:i(c(),f()),explanation:c(),expectedEffect:c(),risks:o(c()),requiresApproval:t(),repairAttempts:p().int().nonnegative()});var Te=d({eventId:c().min(1),kind:l([`note`,`task`,`project`,`automation`,`local_app`]),id:c().min(1),revision:p().int().nonnegative(),operation:l([`created`,`updated`,`deleted`]),operationId:c().optional()}),K=d({id:c().trim().min(1).max(512)});K.extend({expectedVersion:p().int().positive(),reason:c().trim().min(1).max(4096).default(`TaskRun cancelled`)}),K.extend({rating:l([`helpful`,`not_helpful`]),reason:c().trim().max(4096).optional()}),r({ok:n(!0),feedback:r({id:c(),runId:c(),rating:l([`helpful`,`not_helpful`]),reason:c().optional(),createdAt:p()})}),r({ok:n(!0),run:y,receipt:v,model:C.pick({task:!0,operationalState:!0,attention:!0,allowedCommands:!0}),executionStopConfirmed:n(!1)}),K.extend({enabled:t(),expectedRevision:p().int().nonnegative()}),r({ok:n(!0),automation:A.loose()}).extend({run:j.loose()}),r({ok:n(!0),cancelled:t(),confirmed:t()}),r({ok:n(!0),marked:n(!0)}),d({projectId:c().trim().min(1).max(512).optional()}),r({ok:n(!0),count:p().int().nonnegative()}),K.extend({reason:c().trim().min(1).max(2e3)}),d({runId:c().trim().min(1).max(200),destinationKey:c().trim().min(1).max(100),reason:c().trim().min(1).max(2e3)}),r({ok:n(!0),accepted:n(!0)}),K.extend({expectedRevision:p().int().nonnegative().nullable()}),r({ok:n(!0),removed:t(),automation:A.loose().optional(),cancelRunId:c().optional()});var Ee=d({status:l([`inbox`,`processed`,`archived`,`trashed`]).optional(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]).optional(),tag:c().max(512).optional(),projectId:c().min(1).max(512).optional(),unassigned:t().optional(),agentEdited:t().optional(),search:c().max(4096).optional(),pinned:t().optional(),limit:p().int().min(1).max(100).default(20),offset:p().int().min(0).default(0),sortBy:l([`createdAt`,`updatedAt`,`lastOpenedAt`]).optional(),sortOrder:l([`asc`,`desc`]).optional()}),q=s({id:c().min(1),markdown:c(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]),status:l([`inbox`,`processed`,`archived`,`trashed`]),createdAt:p(),updatedAt:p(),title:c().optional(),localVersion:p().optional()}),De=r({note:q});K.extend({expectedRevision:p().int().positive(),revokeShares:t().default(!0)}),r({deleted:n(!0),revokedShares:p().int().nonnegative()});var Oe=d({title:c().max(1e3).optional(),markdown:c().max(2e6).default(``),kind:q.shape.kind.optional(),tags:o(c().max(512)).max(100).optional(),capturedVia:d({channel:l([`app`,`web`,`electron`,`tui`,`telegram`,`wechat`,`feishu`]),platform:l([`ios`,`android`,`harmonyos`]).optional()}).default({channel:`web`}),pinned:t().default(!1),projectId:c().min(1).optional()});d({id:c().min(1),expectedRevision:p().int().positive(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]).optional(),patch:d({title:c().max(1e3).optional(),markdown:c().max(2e6).optional(),tags:o(c().max(512)).max(100).optional(),pinned:t().optional(),kind:q.shape.kind.optional(),status:q.shape.status.optional(),localVersion:p().int().positive().optional(),ai:i(c(),f()).optional(),aiDeep:s({processedAt:p()}).optional()})}),d({text:c().trim().min(1).max(2e6),capturedVia:Oe.shape.capturedVia}),d({id:c().min(1),expectedRevision:p().int().positive().optional(),content:c().trim().min(1).max(2e6),heading:c().trim().min(1).max(1e3).default(`AI 讨论沉淀`)}),d({id:c().min(1),timestamp:p().int().positive(),expectedRevision:p().int().positive()});var J=s({items:o(s({id:c().min(1)})),total:p().int().nonnegative()}),ke=d({phase:w.optional(),priority:b.optional(),projectId:c().min(1).max(512).optional(),search:c().max(4096).optional(),limit:p().int().min(1).max(200).default(50),offset:p().int().nonnegative().default(0)}),Y=s({id:c().min(1),name:c(),slug:c(),status:l([`planned`,`active`,`paused`,`completed`,`cancelled`,`archived`]),executionMode:l([`local_checkout`,`managed_worktree`]),successCriteria:o(c()),scope:i(c(),e()),nonGoals:o(c()),health:l([`unknown`,`on_track`,`at_risk`,`off_track`]),version:p().int().positive(),createdAt:p(),updatedAt:p(),workspaceRoot:c().optional(),defaultAgentId:c().optional()}),Ae=d({id:c().trim().min(1),expectedVersion:p().int().positive(),pinned:t()});r({ok:n(!0),project:Y}),d({workspacePath:c().trim().min(1).max(4096),agentId:c().trim().min(1).max(512).optional(),defaultAgentId:c().trim().max(512).optional(),projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoCreate:t().default(!1),conversationId:m().optional()}),r({ok:n(!0),project:Y.nullable(),reason:l([`exact`,`contained`,`auto_created`]).optional(),created:t().optional()}),Ae.omit({pinned:!0}),r({ok:n(!0),deleted:n(!0),executionStopConfirmed:n(!1)});var X={name:c().trim().min(1).max(1e3).optional(),description:c().max(2e4).optional(),defaultAgentId:c().trim().max(512).optional(),workspaceRoot:c().trim().min(1).max(4096).optional(),createWorkspaceRoot:t().optional(),executionMode:Y.shape.executionMode.optional(),brief:c().max(2e4).optional(),instructions:c().max(1e5).optional(),outcome:c().max(2e4).optional(),successCriteria:o(c().max(4096)).max(100).optional(),scope:i(c(),f()).optional(),nonGoals:o(c().max(4096)).max(100).optional(),health:Y.shape.health.optional(),ownerId:c().max(512).optional(),targetAt:p().finite().optional()};d({...X,projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoUnderstand:t().default(!1)}).refine(e=>!!(e.name||e.workspaceRoot),`name or workspaceRoot is required`),d({id:c().trim().min(1),expectedVersion:p().int().positive(),patch:d({...X,status:Y.shape.status.optional(),description:X.description.unwrap().nullable().optional(),defaultAgentId:X.defaultAgentId.unwrap().nullable().optional(),workspaceRoot:c().trim().max(4096).nullable().optional(),brief:X.brief.unwrap().nullable().optional(),instructions:X.instructions.unwrap().nullable().optional(),outcome:X.outcome.unwrap().nullable().optional(),ownerId:X.ownerId.unwrap().nullable().optional(),targetAt:X.targetAt.unwrap().nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),`Empty project patch`)});var je=d({status:Y.shape.status.optional(),search:c().max(4096).optional(),sortBy:l([`updatedAt`,`createdAt`,`name`]).optional(),sortOrder:l([`asc`,`desc`]).optional(),limit:p().int().min(1).max(500).default(50),offset:p().int().nonnegative().default(0)}),Z=s({id:c(),projectId:c(),title:c(),status:l([`planned`,`active`,`completed`,`cancelled`]),sortOrder:p(),createdAt:p(),updatedAt:p()}),Q=s({id:c(),projectId:c(),summary:c(),health:Y.shape.health,createdAt:p()}),$={title:c().trim().min(1).max(1e3),description:c().max(2e4).optional(),status:Z.shape.status.optional(),targetAt:p().int().nonnegative().optional(),sortOrder:p().int().optional()};d({projectId:c().trim().min(1),...$}),d({projectId:c().trim().min(1),id:c().trim().min(1),expectedRevision:p().int().nonnegative(),patch:d({...$,description:c().max(2e4).nullable().optional(),targetAt:p().int().nonnegative().nullable().optional()}).partial().refine(e=>Object.values(e).some(e=>e!==void 0),`Empty milestone patch`)}).omit({patch:!0}),r({ok:n(!0),milestone:Z,project:Y}),r({ok:n(!0),deleted:n(!0)}),d({projectId:c().trim().min(1),expectedVersion:p().int().positive(),health:Y.shape.health,summary:c().trim().min(1).max(2e4),progress:o(c().max(1e4)).max(100).default([]),risks:o(c().max(1e4)).max(100).default([]),nextSteps:o(c().max(1e4)).max(100).default([])}),r({ok:n(!0),update:Q,project:Y});var Me={"xopc.context.resolve":{input:oe,output:ae},"xopc.notes.preview_edit":{input:K.extend({instruction:c().trim().min(1).max(16e3),markdown:c().max(2e6).optional(),context:s({type:l([`selection`,`section`,`block`,`note`]),range:d({start:p().int().nonnegative(),end:p().int().nonnegative()})}).optional()}),output:r({message:c(),patch:r({id:c(),summary:c(),operations:o(r({type:n(`replaceRange`),from:p().int().nonnegative(),to:p().int().nonnegative(),markdown:c()}))})})},"xopc.automations.get_run":{input:K.extend({waitMs:p().int().min(0).max(3e4).optional()}),output:r({ok:n(!0),run:j.loose()})},"xopc.automations.run_events":{input:K,output:r({ok:n(!0),events:o(M.loose())})},"xopc.automations.metrics":{input:d({}),output:r({ok:n(!0),metrics:N})},"xopc.automations.events":{input:d({type:c().trim().min(1).max(512).optional(),source:c().trim().min(1).max(512).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({event:r({id:c(),type:c(),schemaVersion:p().int(),source:c(),subject:r({kind:c(),id:c()}).optional(),payload:i(c(),e()),occurredAtMs:p(),ingestedAtMs:p(),correlationId:c(),causationId:c().optional(),rootEventId:c(),chainDepth:p().int(),dedupeKey:c().optional(),trust:l([`system`,`user`,`connector`,`untrusted_webhook`])}),projectionStatus:l([`pending`,`projecting`,`retrying`,`projected`,`dead_letter`]),projectionAttempts:p().int(),projectionError:c().optional(),deliveries:o(r({automationId:c(),status:l([`pending`,`retrying`,`queued`,`completed`,`failed`,`cancelled`,`skipped`,`dead_letter`]),runId:c().optional(),attempts:p().int(),lastError:c().optional()}))}))})},"xopc.automations.deliveries":{input:d({runId:c().trim().min(1).max(200).optional(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({runId:c(),destinationKey:c(),kind:c(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]),attempts:p().int(),nextAttemptAtMs:p(),lastError:c().optional(),createdAtMs:p(),updatedAtMs:p()}))})},"xopc.automations.product_events":{input:d({eventType:c().trim().min(1).max(512),source:c().trim().min(1).max(512).optional(),payloadKey:c().trim().min(1).max(512).optional(),payloadValue:c().max(4096).optional(),limit:p().int().min(1).max(100).default(10)}).refine(e=>e.payloadKey===void 0==(e.payloadValue===void 0),`payloadKey and payloadValue must be supplied together`),output:r({ok:n(!0),items:o(r({run:j.loose(),triggerEvent:M.loose()}))})},"xopc.automations.list":{input:d({projectId:c().trim().min(1).optional()}),output:r({ok:n(!0),items:o(A.loose()),projectId:c().optional(),executionSummaries:i(c(),r({unreadCount:p().int().nonnegative()})).optional()})},"xopc.automations.get":{input:K,output:r({ok:n(!0),automation:A.loose()})},"xopc.automations.history":{input:d({automationId:c().trim().min(1).optional(),projectId:c().trim().min(1).optional(),cursor:c().max(1024).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(j.loose()),projectId:c().optional(),hasMore:t().optional(),nextCursor:c().optional()})},"xopc.settings.open":{input:d({section:c().trim().pipe(Se).default(`overview`),title:c().trim().min(1).max(512).default(`Settings`),summary:c().trim().max(4096).optional()}),output:r({ok:n(!0),settings:r({section:c(),title:c(),summary:c().optional()})})},"xopc.local_apps.list":{input:d({}),output:r({apps:o(te)})},"xopc.local_apps.get":{input:K,output:r({app:ne})},"xopc.local_apps.validate":{input:K,output:r({validation:re})},"xopc.projects.get":{input:K,output:r({ok:n(!0),project:Y})},"xopc.projects.list":{input:je,output:s({ok:n(!0),items:o(Y),total:p().int().nonnegative()})},"xopc.projects.list_milestones":{input:K,output:r({ok:n(!0),projectId:c(),items:o(Z)})},"xopc.projects.list_updates":{input:K.extend({limit:p().int().min(1).max(500).default(20)}),output:r({ok:n(!0),projectId:c(),items:o(Q)})},"xopc.task_runs.get":{input:K,output:r({ok:n(!0),run:y,receipt:v.optional(),events:o(x),activeWaits:o(_)})},"xopc.task_runs.list":{input:d({taskId:c().trim().min(1),limit:p().int().min(1).max(200).default(20)}),output:r({ok:n(!0),taskId:c(),items:o(y),receipts:o(v),activeWaits:o(_)})},"xopc.notes.project_summaries":{input:d({}),output:r({items:o(r({id:c(),name:c(),description:c().optional(),noteCount:p().int().nonnegative(),updatedAt:p().optional()}))})},"xopc.notes.history":{input:K,output:r({entries:o(r({timestamp:p().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),snippet:c().optional()}))})},"xopc.notes.snapshot":{input:K.extend({timestamp:p().int().nonnegative()}),output:r({snapshot:r({noteId:c(),timestamp:p().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),title:c().optional(),markdown:c(),tags:o(c()).optional(),kind:q.shape.kind,status:q.shape.status})})},"xopc.notes.get":{input:K,output:De},"xopc.notes.list":{input:Ee,output:J},"xopc.tasks.metrics":{input:d({}),output:r({ok:n(!0),metrics:be})},"xopc.tasks.get":{input:K,output:C},"xopc.tasks.list":{input:ke,output:ie.extend({total:p().int().nonnegative()})}};export{_e as a,F as c,ve as i,ce as l,Me as n,xe as o,Te as r,R as s,Ce as t};
|
package/dist/gateway/static/root/assets/{capabilities-C5MLP2Rx.js → capabilities-abgigXV1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./locale-store-
|
|
1
|
+
import{i as e,o as t}from"./locale-store-CHjsq5NR.js";import{n}from"./capabilities-BaKHutgZ.js";async function r(r,i){let a=n[r],o=a.input.parse(i),s=`/api/capabilities/operations/${encodeURIComponent(r)}`,c=await t(e(s)),l=await t(e(`${s}/invocations`),{method:`POST`,body:JSON.stringify({majorVersion:c.majorVersion,descriptorDigest:c.descriptorDigest,input:o})});return a.output.parse(l.data)}export{r as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-gGU0LZ5e.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-DIIvxCDx.js","assets/locale-store-CHjsq5NR.js","assets/messages-C7QSnTdg.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/briefcase-business-BsoCaI_t.js","assets/createLucideIcon-DPHK1VkS.js","assets/popover-select-hRG1EzAY.js","assets/check-DUBLcKHA.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/skeleton-DzdOeGYz.js","assets/dist-BSVQC3i_.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/code-xml-DJtYhZUF.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/file-archive-DanfQJNe.js","assets/file-text-D12HbeVy.js","assets/layers-mJW7JJKm.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-ihzUc4ud.js","assets/marked.esm-8VXEA2AD.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/app-link-Ji4uewEG.js","assets/product-delivery-4gEqUIsK.js","assets/schemas-CCWMleym.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-Czi3_WHu.css","assets/palette-CDI0VweW.js","assets/refresh-cw-BRlGaq2w.js","assets/sparkles-DHlfQFAF.js","assets/trash-2-DusmjVPV.js","assets/triangle-alert-2JXFNNKU.js","assets/wrench-DFb4r8bH.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-BD-ams0X.js","assets/chat-agents-api-CyvBfBbp.js","assets/button-C5tRaJxt.js","assets/interaction-BdhHBbYa.js","assets/page-tabs-DoYMKhVO.js","assets/sliding-indicator-hwz0sx3h.js","assets/page-header-store-NP7MCIaP.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/dist-DaFr5KMw.js","assets/command-palette-api-YP0zV_Ol.js","assets/local-session-drafts-CGSV1RQg.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/skill-list-api-B26hHnXq.js","assets/skill-api-utils-C7V4JVXM.js","assets/capability-links-MZdYfPKx.js","assets/connection-usage-BhdQRWgQ.js","assets/capability-icon-CmvCZOJX.js","assets/capability-header-actions-Ck3ILShB.js","assets/search-DA7gz22f.js","assets/use-media-query-ady-FgjK.js","assets/skill-reload-api-B9Eu5Yk_.js","assets/skill-api-BG9A1WF0.js","assets/connectors-page-CXNy8Y5R.js","assets/service-recommendation-list-wfd0Mjtu.js","assets/chevron-down-ccbiQQz_.js","assets/working-directory-picker-modal-DgM21YVT.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/circle-check-C23XjkUj.js","assets/key-round-DWbpyU2U.js","assets/install-connector-dialog-CntHi8Rh.js","assets/secret-input-DsjfQmDn.js","assets/copy-Dv6d4Dvw.js","assets/eye-CABVeTq0.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-CRGq-TSw.js","assets/electron-env-DHOGevH3.js","assets/oauth-provider-connect-DGYky6ut.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-BrD6r5Qs.js","assets/registry-api-CDpUAb2R.js","assets/gateway-startup-retry-DgmvR-hb.js","assets/oauth-api-DnMpUoyx.js","assets/connection-usage-guide-B9hoSOnN.js","assets/package-wATCyihJ.js","assets/server-BlHCBjiE.js","assets/agent-plugin-dialog-CSJC1yud.js","assets/arrow-left-D880xG-P.js","assets/circle-alert-BEjgurr2.js","assets/circle-BoO4YvTx.js","assets/folder-open-CyzJ19I9.js","assets/shield-check-BU58siTV.js","assets/upload-rrb46c3c.js","assets/browser-BLJWD7WI.js","assets/extension-marketplace-api-DGV5FC-v.js","assets/chevron-right-BweFrslA.js","assets/circle-pause-CN9jYH2s.js","assets/connector-filters-Cfcx9EA2.js","assets/clock-3-DnrAnuyZ.js","assets/database-CjjeZfRG.js","assets/plug-DKYPEgkR.js","assets/save-DRDABU--.js","assets/settings-uiTATseT.js","assets/store-SzD1Jvgm.js","assets/terminal-oKqqZdiG.js","assets/extension-provider-BGrqW0_n.js","assets/gateway-realtime-jIH8iEGO.js","assets/gateway-realtime-store-CTWm23Qi.js","assets/theme-store-CvG266p8.js","assets/middleware-Pd0e8Igk.js","assets/extension-message-router-CzVgJn5c.js","assets/session-manager-CVNlrzFB.js","assets/turn-outcome-BSbEJx8h.js","assets/session-api-CR3NLqvs.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BPYdUI6y.js","assets/playback-coordinator-CWHIf0wr.js","assets/agents-admin-api-DSr-PWuW.js","assets/capabilities-BaKHutgZ.js","assets/tasks-CwyNaa-j.js","assets/specialists-xbB3xL9e.js","assets/activity-store-hSe5Nbgk.js","assets/sliding-tab-list-CmcrqRzN.js","assets/confirm-dialog-MHCmEEUZ.js","assets/connector-service-page-e67KylnM.js","assets/installed-connector-row-skeleton-BAe_utvG.js","assets/number-input-El7Szeln.js","assets/device-connections-panel-XtEX1NcJ.js","assets/calendar-days-hw_Y-g-s.js","assets/map-pin-DNclV497.js","assets/folder-CN-pC3XL.js","assets/image-Cwyalflz.js","assets/laptop-CI3hBVrl.js","assets/monitor-Af5eAvF7.js","assets/mouse-pointer-2-DZ51Onvj.js","assets/smartphone-DSSsQFqA.js","assets/wifi-off-C35sMFUl.js","assets/use-section-navigation-yC9HkVpd.js","assets/device-pairing-action-w1enAo76.js","assets/device-pairing-wizard-Dt737tSq.js","assets/panel-right-CFGrHTsD.js","assets/copy-text-row-gqdh0Bg1.js","assets/oauth-authorization-window-o6URRos4.js","assets/tunnel-api-Cph-ZBBy.js","assets/globe-DSSGFWFn.js","assets/power-ZI-pBczI.js","assets/navigation-ByOzYT0t.js","assets/settings-form-section-num14vSv.js","assets/pencil-DmIY3Oa-.js","assets/mobile-pair-qr-CuIbmw5x.js","assets/plugin-details-dialog-FcOJaeP0.js","assets/plugin-presentation-CO5BFDGW.js","assets/apps-page-DO5uTFRI.js","assets/box-DvYoGszj.js","assets/extension-paths-DvuaZJuy.js","assets/agents-DX-t3X7K.js","assets/bot-DjLkhyZL.js","assets/heart-Cp4rgrqn.js","assets/message-square-plus-XP0tGdlV.js","assets/rotate-ccw-JM1TBLpp.js","assets/sliders-horizontal-DqsYor6I.js","assets/new-session-preferences-gb411vZP.js","assets/new-chat-navigation-spnin196.js","assets/use-personal-profile-D4gLM6Wi.js","assets/agent-avatar-display-D_UDgOr9.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/composer-handoff-params-DBpzHuNo.js","assets/agent-display-names-Bje7vfSn.js","assets/model-selector-QFZY5XNN.js","assets/settings-2-D-csvaET.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/agents-app-path-ciChvpCS.js","assets/settings-advanced-section-CTLdGPvx.js","assets/settings-mode-store-CCQVvItG.js","assets/settings-page-header-C21Iw2rD.js","assets/settings-page-layout-BXcLlp6p.js","assets/phone-model-picker-CFoxQiws.js","assets/directory-picker-path-field-B-eUnbng.js","assets/use-directory-picker-C4p7AgWY.js","assets/image-generation-api-Baz4xdZ4.js","assets/channels-_m_FjvAY.js","assets/channels-routes-r2g-9DdC.js","assets/stethoscope-DRqTAtjD.js","assets/secret-input-labels-B5Jl5HqK.js","assets/session-channel-icon-CJAPoVO-.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/panels-top-left-BKvp2Dag.js","assets/zap-dximCGjy.js","assets/session-identity-DRFdxntH.js","assets/refresh-button-DX7bULU5.js","assets/extension-iframe-host-RWjaucjJ.js","assets/extension-authoritative-grants-DYp2nNol.js","assets/settings-loading-skeleton-CAoOV17i.js","assets/schema-form-DkuIsCBU.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{_ as a,f as o,h as s,r as c}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{l as ee,n as l}from"./locale-store-CHjsq5NR.js";import{t as u}from"./messages-C7QSnTdg.js";import{t as d}from"./skeleton-DzdOeGYz.js";import{r as f,t as p}from"./product-navigation-wFfnI3uw.js";import{t as m}from"./page-header-store-NP7MCIaP.js";import{t as h}from"./capability-links-MZdYfPKx.js";import{t as te}from"./capability-header-actions-Ck3ILShB.js";var g=n(),_=e(t(),1),v=r(),y=(0,_.lazy)(()=>i(()=>import(`./skills-page-gGU0LZ5e.js`).then(e=>({default:e.SkillsPage})),__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,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71]))),b=(0,_.lazy)(()=>i(()=>import(`./connectors-page-CXNy8Y5R.js`).then(e=>({default:e.ConnectorsPage})),__vite__mapDeps([72,1,2,4,3,5,6,7,8,9,73,11,74,75,26,29,14,15,51,52,76,77,78,79,80,12,13,16,17,18,19,20,21,25,81,82,83,38,84,34,85,49,48,86,87,88,89,90,91,92,93,44,65,94,33,95,96,97,98,99,100,101,102,64,103,66,104,105,106,107,108,109,24,110,43,111,112,113,114,45,47,53,54,55,115,116,37,117,118,119,120,36,121,31,122,123,60,124,125,126,127,128,129,130,131,132,133,58,67,68,69,134,135,136]))),x=(0,_.lazy)(()=>i(()=>import(`./device-connections-panel-XtEX1NcJ.js`).then(e=>({default:e.DeviceConnectionsPanel})),__vite__mapDeps([137,1,2,4,3,5,6,7,8,9,138,11,105,78,108,139,140,141,142,29,143,144,33,101,145,146,14,15,37,48,51,52,132,54,135,16,147,148,149,23,25,150,34,17,18,19,20,21,35,36,56,151,13,82,38,92,86,152,153,154,155,49,76,156,157,158,159,103]))),S=(0,_.lazy)(()=>i(()=>import(`./device-connections-panel-XtEX1NcJ.js`).then(e=>({default:e.ConnectDeviceButton})),__vite__mapDeps([137,1,2,4,3,5,6,7,8,9,138,11,105,78,108,139,140,141,142,29,143,144,33,101,145,146,14,15,37,48,51,52,132,54,135,16,147,148,149,23,25,150,34,17,18,19,20,21,35,36,56,151,13,82,38,92,86,152,153,154,155,49,76,156,157,158,159,103]))),ne=(0,_.lazy)(()=>i(()=>import(`./plugin-details-dialog-FcOJaeP0.js`).then(e=>({default:e.PluginDetailsDialog})),__vite__mapDeps([160,1,2,4,3,5,6,7,8,9,94,11,34,16,14,15,48,51,93,44,65,96,97,74,75,26,29,52,76,77,98,78,99,100,101,102,64,103,66,161]))),re=(0,_.lazy)(()=>i(()=>import(`./apps-page-DO5uTFRI.js`).then(e=>({default:e.ExtensionsPage})),__vite__mapDeps([162,1,2,4,3,5,6,7,8,9,97,11,163,164,24,25,29,30,31,23,32,33,34,14,15,35,36,37,38,39,40,41,94,112,101,45,46,16,48,116,117,51,52,53,54,55,115,118,119,120,121,122,123,91,60,124,125,126,90,127,49,128,129,130,131,77,58,18,19,20,96,74,75,26,76,98,78,99,100,102,64,65,103,66,104,67,68,17,69,161]))),ie=(0,_.lazy)(()=>i(()=>import(`./agents-DX-t3X7K.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([165,1,2,3,4,5,6,7,8,9,166,11,10,105,12,13,14,15,16,17,18,19,20,21,22,24,83,167,30,31,23,32,33,34,35,36,37,38,39,40,41,168,158,169,68,112,170,46,102,130,171,48,49,90,91,127,51,52,118,119,53,54,172,173,174,175,176,177,61,178,132,133,58,179,180,181,76,182,183,184,185,69,136,186,25,44,187,188,189,75,26,29,77,190,191]))),ae=(0,_.lazy)(()=>i(()=>import(`./channels-_m_FjvAY.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([192,1,2,4,3,5,6,7,8,9,12,11,13,14,15,16,17,18,19,20,21,98,78,25,79,29,193,169,180,112,194,46,34,48,50,49,51,38,52,195,156,174,175,176,178,196,108,197,198,199,200,110,114,201,202,37,203,43,204,118,119,115,116,117,120,36,121,31,122,123,91,60,124,125,126,90,127,128,129,130,131,77,205,206,103,184,185,186,44,187,207,81,82,83,76,84,136])));function oe(e){return p.includes(e)?e:null}function se(e){let t=(0,g.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},C),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,v.jsx)(`div`,{className:`mx-auto grid w-full max-w-7xl gap-4 px-4 pb-7 pt-3 sm:grid-cols-2 sm:px-6 lg:grid-cols-3 lg:px-8 lg:pb-9 lg:pt-4`,"aria-label":n,"aria-busy":!0,children:r}),t[1]=n,t[2]=i),i}function C(e,t){return(0,v.jsx)(d,{className:`h-40 rounded-xl`},t)}function w(){let e=(0,g.c)(88),t=l(de),n=ee(ue),r;e[0]===t?r=e[1]:(r=u(t),e[0]=t,e[1]=r);let i=r,d=i.capabilitiesHub,{section:C,detailId:w}=s(),[T]=a(),E=o(),D;e[2]===T?D=e[3]:(D=T.get(`plugin`),e[2]=T,e[3]=D);let O=D,k;e[4]!==E||e[5]!==T?(k=()=>{let e=new URLSearchParams(T);e.delete(`plugin`),e.delete(`connect`),E({search:e.toString()},{replace:!0,preventScrollReset:!0})},e[4]=E,e[5]=T,e[6]=k):k=e[6];let A=k,j;e[7]===C?j=e[8]:(j=oe(C),e[7]=C,e[8]=j);let M=j,N=M??p[0],P=i.productNavigation.sections[`capabilities-${N}`],F=m(le),I=m(ce),L;e[9]===N?L=e[10]:(L={section:N,value:null},e[9]=N,e[10]=L);let[R,fe]=(0,_.useState)(L),z=N===`extensions`&&w?null:R.section===N?R.value:null,B;e[11]===N?B=e[12]:(B=e=>{fe({section:N,value:e})},e[11]=N,e[12]=B);let V=B,H,U;if(e[13]!==I||e[14]!==z||e[15]!==n||e[16]!==t||e[17]!==N||e[18]!==P||e[19]!==F?(H=()=>(F({startExtra:null,main:(0,v.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:P}),end:N===`devices`?n?(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(S,{zh:t===`zh`})}):null:(0,v.jsx)(te,{contribution:z})}),()=>I()),U=[I,z,n,t,N,P,F],e[13]=I,e[14]=z,e[15]=n,e[16]=t,e[17]=N,e[18]=P,e[19]=F,e[20]=H,e[21]=U):(H=e[20],U=e[21]),(0,_.useLayoutEffect)(H,U),N===`extensions`&&w){let t;e[22]===T?t=e[23]:(t=T.get(`from`)===`connections`?`connections`:T.get(`from`)===`skills`?`skills`:`installed`,e[22]=T,e[23]=t);let n;e[24]===T?n=e[25]:(n=T.get(`connect`),e[24]=T,e[25]=n);let r=n===`1`,i;e[26]!==w||e[27]!==T||e[28]!==r||e[29]!==t?(i=h(w,t,r,T.get(`returnTo`)??void 0),e[26]=w,e[27]=T,e[28]=r,e[29]=t,e[30]=i):i=e[30];let a;return e[31]===i?a=e[32]:(a=(0,v.jsx)(c,{replace:!0,to:i}),e[31]=i,e[32]=a),a}if(!M){let t;return e[33]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,v.jsx)(c,{to:f(p[0]),replace:!0}),e[33]=t):t=e[33],t}if(N===`connectors`&&T.get(`tab`)===`devices`){let t,n,r,i;if(e[34]!==T){let a=new URLSearchParams(T);a.delete(`tab`),t=c,n=!0,e[39]===Symbol.for(`react.memo_cache_sentinel`)?(r=f(`devices`),e[39]=r):r=e[39],i=a.toString(),e[34]=T,e[35]=t,e[36]=n,e[37]=r,e[38]=i}else t=e[35],n=e[36],r=e[37],i=e[38];let a;e[40]!==r||e[41]!==i?(a={pathname:r,search:i},e[40]=r,e[41]=i,e[42]=a):a=e[42];let o;return e[43]!==t||e[44]!==n||e[45]!==a?(o=(0,v.jsx)(t,{replace:n,to:a}),e[43]=t,e[44]=n,e[45]=a,e[46]=o):o=e[46],o}let W;e[47]===d.discoverLoading?W=e[48]:(W=(0,v.jsx)(se,{label:d.discoverLoading}),e[47]=d.discoverLoading,e[48]=W);let G;e[49]!==w||e[50]!==V||e[51]!==N?(G=N===`agents`?(0,v.jsx)(ie,{agentId:w,onHeaderActionChange:V}):null,e[49]=w,e[50]=V,e[51]=N,e[52]=G):G=e[52];let K;e[53]!==V||e[54]!==N?(K=N===`skills`?(0,v.jsx)(y,{embedded:!0,onHeaderActionChange:V}):null,e[53]=V,e[54]=N,e[55]=K):K=e[55];let q;e[56]!==V||e[57]!==N?(q=N===`connectors`?(0,v.jsx)(b,{embedded:!0,onHeaderActionChange:V}):null,e[56]=V,e[57]=N,e[58]=q):q=e[58];let J;e[59]!==n||e[60]!==t||e[61]!==i.connectorsSettings||e[62]!==N||e[63]!==P?(J=N===`devices`?(0,v.jsx)(`section`,{"aria-label":P,className:`mx-auto w-full max-w-7xl px-4 pb-7 sm:px-6 lg:px-8 lg:pb-9`,children:n?(0,v.jsx)(x,{zh:t===`zh`}):(0,v.jsx)(`p`,{className:`mt-3 rounded-xl bg-surface-panel px-4 py-3 text-sm text-fg-muted lg:mt-4`,children:i.connectorsSettings.tokenHint})}):null,e[59]=n,e[60]=t,e[61]=i.connectorsSettings,e[62]=N,e[63]=P,e[64]=J):J=e[64];let Y;e[65]!==w||e[66]!==V||e[67]!==N?(Y=N===`channels`?(0,v.jsx)(ae,{channelId:w,onHeaderActionChange:V}):null,e[65]=w,e[66]=V,e[67]=N,e[68]=Y):Y=e[68];let X;e[69]!==V||e[70]!==N?(X=N===`extensions`?(0,v.jsx)(re,{embedded:!0,onHeaderActionChange:V}):null,e[69]=V,e[70]=N,e[71]=X):X=e[71];let Z;e[72]!==N||e[73]!==K||e[74]!==q||e[75]!==J||e[76]!==Y||e[77]!==X||e[78]!==W||e[79]!==G?(Z=(0,v.jsxs)(_.Suspense,{fallback:W,children:[G,K,q,J,Y,X]},N),e[72]=N,e[73]=K,e[74]=q,e[75]=J,e[76]=Y,e[77]=X,e[78]=W,e[79]=G,e[80]=Z):Z=e[80];let Q;e[81]!==A||e[82]!==O||e[83]!==T?(Q=O?(0,v.jsx)(_.Suspense,{fallback:null,children:(0,v.jsx)(ne,{pluginId:O,initialConnect:T.get(`connect`)===`1`,onClose:A},O)}):null,e[81]=A,e[82]=O,e[83]=T,e[84]=Q):Q=e[84];let $;return e[85]!==Z||e[86]!==Q?($=(0,v.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[Z,Q]}),e[85]=Z,e[86]=Q,e[87]=$):$=e[87],$}function ce(e){return e.clearPageHeader}function le(e){return e.setPageHeader}function ue(e){return!!e.conversationId}function de(e){return e.language}export{w as CapabilitiesPage};
|
|
@@ -0,0 +1,8 @@
|
|
|
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{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{_ as a,d as o,h as s,r as c,t as l}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{a as u,i as d,l as f,n as p,o as m}from"./locale-store-CHjsq5NR.js";import{t as h}from"./messages-C7QSnTdg.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-DlirbHVs.js";import{t as C}from"./arrow-right-DSSvoX71.js";import{a as w,i as T,n as E,t as D}from"./video-generation-Cec49Jwg.js";import{t as O}from"./chevron-right-BweFrslA.js";import{n as k,r as A,t as j}from"./popover-select-hRG1EzAY.js";import{t as M}from"./circle-check-C23XjkUj.js";import{C as N,S as P,_ as F,a as I,b as L,c as R,d as ee,f as z,g as B,h as V,i as H,l as U,m as te,n as W,o as ne,p as re,r as G,s as ie,t as ae,u as oe,v as se,x as ce,y as K}from"./connected-providers-grid-BgW-ioIt.js";import{t as le}from"./cloud-C4-yfnnk.js";import{t as q}from"./external-link-DjqjBmc3.js";import{t as J}from"./secret-input-DsjfQmDn.js";import{t as ue}from"./eye-CABVeTq0.js";import{t as de}from"./image-Cwyalflz.js";import{t as fe}from"./key-round-DWbpyU2U.js";import{t as pe}from"./loader-circle-CifKLtgG.js";import{t as me}from"./pencil-DmIY3Oa-.js";import{t as he}from"./plug-DKYPEgkR.js";import{t as ge}from"./plus-Q2yW6OE7.js";import{t as _e}from"./refresh-cw-BRlGaq2w.js";import{t as ve}from"./settings-2-D-csvaET.js";import{t as ye}from"./shield-check-BU58siTV.js";import{t as be}from"./sliders-horizontal-DqsYor6I.js";import{t as xe}from"./trash-2-DusmjVPV.js";import{t as Se}from"./triangle-alert-2JXFNNKU.js";import{t as Ce}from"./wrench-DFb4r8bH.js";import{t as we}from"./x-B_N4OPjy.js";import{t as Y}from"./cn-0WouolD0.js";import{t as Te}from"./skeleton-DzdOeGYz.js";import{t as Ee}from"./voice-CUfqdnlR.js";import{n as De}from"./cloud-credits-B-nbtkqv.js";import{a as Oe,i as X}from"./vendor-swr-CdRzEUwF.js";import{n as ke,r as Ae}from"./gateway-config-swr-BD-ams0X.js";import{n as je,t as Me}from"./registry-api-CDpUAb2R.js";import{t as Z}from"./button-C5tRaJxt.js";import{i as Ne,o as Pe}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as Fe}from"./open-capability-settings-DQsmJxI7.js";import{n as Ie,t as Le}from"./interaction-BdhHBbYa.js";import{n as Re,t as ze}from"./voice-settings-bAmN4bUq.js";import{a as Be,o as Ve,s as He}from"./form-field-width-DJw_jULe.js";import{n as Ue}from"./is-masked-secret-DOkL5b_X.js";import{n as We,t as Ge}from"./secret-input-labels-B5Jl5HqK.js";import{a as Ke}from"./navigation-ByOzYT0t.js";import{t as qe}from"./electron-env-DHOGevH3.js";import{n as Je,t as Ye}from"./settings-form-draft-Dy10ldo8.js";import{t as Xe}from"./sliding-tab-list-CmcrqRzN.js";import{t as Ze}from"./confirm-dialog-MHCmEEUZ.js";import{n as Qe,t as $e}from"./model-sort-_Tz8s_4N.js";import{n as et,r as tt}from"./model-selector-QFZY5XNN.js";import{n as nt}from"./agents-app-path-ciChvpCS.js";import{n as rt,t as it}from"./global-defaults-api-B7suATYU.js";import{t as at}from"./settings-loading-skeleton-CAoOV17i.js";import{i as ot,n as st,r as ct,t as lt}from"./capability-navigation-CZbCI5C2.js";import{a as ut,i as dt,o as ft,r as pt,t as mt}from"./models-hub-cache-BrD6r5Qs.js";import{a as ht,r as gt,s as _t,t as vt}from"./providers-api-D9NuB7w3.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./oauth-api-DnMpUoyx.js";import{n as Tt,t as Et}from"./capability-presentation-DlJQUUlM.js";import{t as Dt}from"./settings-advanced-section-CTLdGPvx.js";import{n as Ot,r as kt,t as At}from"./oauth-authorization-window-o6URRos4.js";import{t as jt}from"./number-input-El7Szeln.js";import{n as Mt,t as Nt}from"./settings-page-header-C21Iw2rD.js";import"./settings-page-layout-BXcLlp6p.js";import{t as Pt}from"./use-section-navigation-yC9HkVpd.js";import{n as Ft,t as It}from"./settings-form-section-num14vSv.js";import{n as Lt,t as Rt}from"./use-autosave-B_WH_LBE.js";import{c as zt,h as Bt,l as Vt,n as Ht,o as Ut,t as Wt}from"./voice-config-api-sXEIG6lz.js";import{a as Gt,i as Kt,n as qt,o as Jt,r as Yt,s as Xt,t as Zt}from"./image-generation-api-Baz4xdZ4.js";import{t as Qt}from"./xopc-cloud-account-card-e8HJFnTs.js";var $t=`tencent-mps`,en=n(),Q=e(t(),1),$=r(),tn={en:{addTitle:`Add image service`,editTitle:`Manage image service`,intro:`Connect an endpoint that implements the OpenAI Images protocol.`,connection:`Connection`,providerId:`Provider ID`,providerIdHint:`Lowercase letters, numbers, hyphens, or underscores.`,name:`Display name`,baseUrl:`Base URL`,auth:`Authentication`,bearer:`Bearer token`,header:`Custom API key header`,none:`No authentication`,headerName:`Header name`,apiKey:`API key`,apiKeyHint:`Stored in the local credential store, separate from models.json.`,apiKeyUrl:`API key page (optional)`,docsUrl:`Documentation page (optional)`,openKeyPage:`Create API key`,paths:`Protocol and network`,generationsPath:`Generations path`,editsPath:`Edits path`,allowedHosts:`Allowed private hosts (optional)`,allowedHostsHint:`One exact hostname or IP per line. Private endpoints stay blocked unless listed here.`,staticHeaders:`Static headers (optional)`,staticHeadersHint:`One per line: X-Tenant: value. Credential headers are rejected.`,models:`Image models`,addModel:`Add model`,modelId:`Model ID`,modelName:`Name (optional)`,defaultModel:`Default model`,maxCount:`Max images`,defaultCount:`Default count`,defaultSize:`Default size`,format:`Output format`,supportsSize:`Supports size`,edit:`Supports edits`,remove:`Remove`,cancel:`Cancel`,save:`Save service`,saving:`Saving…`,test:`Test generation`,testing:`Generating…`,delete:`Delete service`,confirmDelete:`Delete permanently`,saved:`Image service saved.`,deleted:`Image service deleted.`,testReady:`Test image generated.`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`,revealFailed:`Unable to reveal the saved key.`,notRevealable:`No revealable key is stored locally.`,required:`Complete the required connection and model fields.`,duplicateModels:`Model IDs must be unique.`,invalidHeaders:`Static headers must use “Name: value”, one per line.`},zh:{addTitle:`添加图片服务`,editTitle:`管理图片服务`,intro:`连接一个严格实现 OpenAI Images 协议的服务端点。`,connection:`连接信息`,providerId:`Provider ID`,providerIdHint:`仅支持小写字母、数字、连字符和下划线。`,name:`显示名称`,baseUrl:`Base URL`,auth:`认证方式`,bearer:`Bearer Token`,header:`自定义 API Key Header`,none:`无需认证`,headerName:`Header 名称`,apiKey:`API Key`,apiKeyHint:`密钥单独保存在本机凭据存储,不写入 models.json。`,apiKeyUrl:`API Key 创建页面(可选)`,docsUrl:`协议文档页面(可选)`,openKeyPage:`去创建 API Key`,paths:`协议与网络`,generationsPath:`生成路径`,editsPath:`编辑路径`,allowedHosts:`允许访问的私有主机(可选)`,allowedHostsHint:`每行一个精确主机名或 IP;未列出的私网端点保持阻止。`,staticHeaders:`静态 Headers(可选)`,staticHeadersHint:`每行一个:X-Tenant: value。认证 Header 会被拒绝。`,models:`图片模型`,addModel:`添加模型`,modelId:`模型 ID`,modelName:`名称(可选)`,defaultModel:`默认模型`,maxCount:`单次最大张数`,defaultCount:`默认张数`,defaultSize:`默认尺寸`,format:`输出格式`,supportsSize:`支持尺寸参数`,edit:`支持图片编辑`,remove:`移除`,cancel:`取消`,save:`保存服务`,saving:`保存中…`,test:`测试生成`,testing:`生成中…`,delete:`删除服务`,confirmDelete:`确认永久删除`,saved:`图片服务已保存。`,deleted:`图片服务已删除。`,testReady:`测试图片生成成功。`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`,revealFailed:`无法查看已保存的密钥。`,notRevealable:`本机没有可查看的密钥。`,required:`请补全必填的连接和模型信息。`,duplicateModels:`模型 ID 不能重复。`,invalidHeaders:`静态 Header 必须使用“名称: 值”格式,每行一个。`}},nn=`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`;function rn(e){let t=e??{id:``,capabilities:{generate:{maxCount:1,supportsSize:!0},edit:{enabled:!1}}};return{original:t,id:t.id,name:t.name??``,maxCount:String(t.capabilities.generate?.maxCount??1),defaultCount:t.defaults?.count?String(t.defaults.count):``,defaultSize:t.defaults?.size??``,outputFormat:t.defaults?.outputFormat??``,supportsSize:t.capabilities.generate?.supportsSize??!1,editEnabled:t.capabilities.edit?.enabled??!1}}function an(e){let t=e.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return;let n=t.map(e=>{let t=e.indexOf(`:`);if(t<=0||!e.slice(t+1).trim())throw Error(`invalid_headers`);return[e.slice(0,t).trim(),e.slice(t+1).trim()]});return Object.fromEntries(n)}function on({open:e,onOpenChange:t,provider:n,configured:r,language:i,onSaved:a,portalContainer:o,onPendingChange:s}){let c=tn[i],[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,C]=(0,Q.useState)(`bearer`),[T,E]=(0,Q.useState)(`x-api-key`),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(``),[M,N]=(0,Q.useState)(``),[P,F]=(0,Q.useState)(`/images/generations`),[I,L]=(0,Q.useState)(`/images/edits`),[R,ee]=(0,Q.useState)(``),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)([rn()]),[U,te]=(0,Q.useState)(``),[W,ne]=(0,Q.useState)(),[re,G]=(0,Q.useState)(!1),[ie,ae]=(0,Q.useState)(),[oe,se]=(0,Q.useState)(),[ce,K]=(0,Q.useState)();(0,Q.useEffect)(()=>(s?.(!!W),()=>s?.(!1)),[W,s]),(0,Q.useEffect)(()=>{if(!e)return;let t=n?.imageGeneration;u(n?.providerId??``),f(t?.name??``),m(n?.baseUrl??``),C(t?.auth.type??`bearer`),E(t?.auth.type===`header`?t.auth.headerName:`x-api-key`),O(r?`••••••••••••`:``),A(t?.apiKeyUrl??``),N(t?.documentationUrl??``),F(t?.paths?.generations??`/images/generations`),L(t?.paths?.edits??`/images/edits`),ee(t?.network?.allowedHosts.join(`
|
|
4
|
+
`)??``),B(Object.entries(n?.headers??{}).map(([e,t])=>`${e}: ${t}`).join(`
|
|
5
|
+
`)),H(t?.models.map(rn)??[rn()]),te(t?.defaultModel??``),se(void 0),ne(void 0),G(!1),ae(void 0),K(void 0)},[r,e,n]);let le=(0,Q.useMemo)(()=>V.filter(e=>e.id.trim()).sort(Qe).map(e=>({value:e.id.trim(),label:e.name.trim()||e.id.trim()})),[V]),q=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},de=()=>{let e=l.trim(),t=V.map(e=>({...e,id:e.id.trim(),name:e.name.trim()}));if(!e||!d.trim()||!p.trim()||t.some(e=>!e.id))throw Error(c.required);if(new Set(t.map(e=>e.id)).size!==t.length)throw Error(c.duplicateModels);let n=U||t[0]?.id;if(!n||!t.some(e=>e.id===n))throw Error(c.required);let r;try{r=an(z)}catch{throw Error(c.invalidHeaders)}return{providerId:e,input:{baseUrl:p.trim(),...r?{headers:r}:{},imageGeneration:{api:`openai-images`,name:d.trim(),...M.trim()?{documentationUrl:M.trim()}:{},...k.trim()?{apiKeyUrl:k.trim()}:{},defaultModel:n,auth:h===`header`?{type:`header`,headerName:T.trim()}:{type:h},paths:{...P.trim()?{generations:P.trim()}:{},...I.trim()?{edits:I.trim()}:{}},...R.trim()?{network:{allowedHosts:R.split(`
|
|
6
|
+
`).map(e=>e.trim()).filter(Boolean)}}:{},models:t.map(e=>({...e.original,id:e.id,...e.name?{name:e.name}:{name:void 0},capabilities:{...e.original.capabilities,generate:{...e.original.capabilities.generate,maxCount:Math.max(1,Number.parseInt(e.maxCount,10)||1),supportsSize:e.supportsSize},edit:{...e.original.capabilities.edit,enabled:e.editEnabled}},defaults:{...e.original.defaults,...e.defaultCount?{count:Math.max(1,Number.parseInt(e.defaultCount,10)||1)}:{count:void 0},...e.defaultSize.trim()?{size:e.defaultSize.trim()}:{size:void 0},...e.outputFormat?{outputFormat:e.outputFormat}:{outputFormat:void 0}}}))}}}},fe=async()=>{let e=de();return await Kt(e.providerId,e.input),h!==`none`&&D.trim()&&!Ue(D)&&await Gt(e.providerId,D.trim()),await a(e.providerId),e},me=async()=>{ne(`save`),ae(void 0),se(void 0);try{await fe(),O(h===`none`?``:`••••••••••••`),se(c.saved)}catch(e){ae(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},he=async()=>{ne(`test`),ae(void 0),se(void 0),K(void 0);try{let e=await fe(),t=await Jt(e.providerId,e.input.imageGeneration.defaultModel);K(t.images[0]?.dataUrl),se(c.testReady)}catch(e){ae(e instanceof Error?e.message:String(e))}finally{ne(void 0)}},_e=async()=>{if(n){if(!re){G(!0);return}ne(`delete`),ae(void 0);try{await Zt(n.providerId),await a(),t(!1)}catch(e){ae(e instanceof Error?e.message:String(e))}finally{ne(void 0)}}};return(0,$.jsx)(S,{open:e,onOpenChange:e=>{W||t(e)},children:(0,$.jsxs)(y,{container:o,children:[(0,$.jsx)(g,{className:Y(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Pe)}),(0,$.jsxs)(b,{className:Y(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(88vh,760px)] w-[min(calc(100%-2rem),52rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,Ne),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:n?c.editTitle:c.addTitle}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:c.intro})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,disabled:!!W,className:`rounded-md p-1 text-fg-muted hover:bg-surface-inset hover:text-fg`,"aria-label":c.cancel,children:(0,$.jsx)(we,{className:`size-5`})})})]}),(0,$.jsxs)(`fieldset`,{disabled:!!W,className:`min-h-0 min-w-0 flex-1 space-y-6 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`section`,{className:`space-y-4`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.connection}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.providerId,(0,$.jsx)(`input`,{value:l,disabled:!!n,onChange:e=>u(e.target.value),placeholder:`my-image-service`,className:nn}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.providerIdHint})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.name,(0,$.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`My Image Service`,className:nn})]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.baseUrl,(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`https://api.example.com/v1`,className:nn})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.auth,(0,$.jsx)(j,{value:h,options:[{value:`bearer`,label:c.bearer},{value:`header`,label:c.header},{value:`none`,label:c.none}],placeholder:c.auth,allowEmpty:!1,onChange:e=>C(e),triggerClassName:`mt-1.5`})]}),h===`header`?(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.headerName,(0,$.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),className:nn})]}):null]}),h===`none`?null:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,$.jsx)(`label`,{htmlFor:`custom-image-api-key`,className:`text-xs font-medium text-fg-muted`,children:c.apiKey}),k.trim()?(0,$.jsxs)(`a`,{href:k.trim(),target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[c.openKeyPage,(0,$.jsx)(w,{className:`size-3.5`})]}):null]}),(0,$.jsx)(J,{id:`custom-image-api-key`,value:D,onChange:e=>O(Ue(D)?e.replace(/^•+/,``):e),labels:{show:c.show,hide:c.hide,copy:c.copy,copied:c.copied},reveal:()=>_t(l).then(e=>e.apiKey),loadFailedLabel:c.revealFailed,notInConfigFile:c.notRevealable}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:c.apiKeyHint})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.apiKeyUrl,(0,$.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),placeholder:`https://…`,className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.docsUrl,(0,$.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:`https://…`,className:nn})]})]}),(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:c.paths}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-4 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.generationsPath,(0,$.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.editsPath,(0,$.jsx)(`input`,{value:I,onChange:e=>L(e.target.value),className:nn})]})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.allowedHosts,(0,$.jsx)(`textarea`,{value:R,onChange:e=>ee(e.target.value),rows:2,placeholder:`127.0.0.1
|
|
7
|
+
image-server.lan`,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.allowedHostsHint})]}),(0,$.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[c.staticHeaders,(0,$.jsx)(`textarea`,{value:z,onChange:e=>B(e.target.value),rows:3,className:`mt-1.5 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 font-mono text-xs text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,$.jsx)(`span`,{className:`mt-1 block font-normal text-fg-subtle`,children:c.staticHeadersHint})]})]})]}),(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:c.models}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:()=>H(e=>[...e,rn()]),children:[(0,$.jsx)(ge,{className:`size-4`}),c.addModel]})]}),(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[c.defaultModel,(0,$.jsx)(j,{value:U||V.find(e=>e.id.trim())?.id.trim()||``,options:le,placeholder:c.defaultModel,allowEmpty:!1,onChange:te,triggerClassName:`mt-1.5 max-w-sm`})]}),V.map((e,t)=>(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelId,(0,$.jsx)(`input`,{value:e.id,onChange:e=>q(t,{id:e.target.value}),placeholder:`image-1`,className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.modelName,(0,$.jsx)(`input`,{value:e.name,onChange:e=>q(t,{name:e.target.value}),className:nn})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.maxCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.maxCount,onChange:e=>q(t,{maxCount:e.target.value}),className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultCount,(0,$.jsx)(`input`,{type:`number`,min:1,value:e.defaultCount,onChange:e=>q(t,{defaultCount:e.target.value}),className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.defaultSize,(0,$.jsx)(`input`,{value:e.defaultSize,onChange:e=>q(t,{defaultSize:e.target.value}),placeholder:`1024x1024`,className:nn})]}),(0,$.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[c.format,(0,$.jsx)(j,{value:e.outputFormat,options:[{value:`png`,label:`PNG`},{value:`jpeg`,label:`JPEG`},{value:`webp`,label:`WebP`}],placeholder:c.format,allowEmpty:!0,onChange:e=>q(t,{outputFormat:e}),triggerClassName:`mt-1.5`})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.supportsSize,onChange:e=>q(t,{supportsSize:e.target.checked})}),c.supportsSize]}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:e.editEnabled,onChange:e=>q(t,{editEnabled:e.target.checked})}),c.edit]}),(0,$.jsxs)(`button`,{type:`button`,disabled:V.length===1,onClick:()=>H(e=>e.filter((e,n)=>n!==t)),className:`ml-auto inline-flex items-center gap-1 text-xs text-red-600 disabled:opacity-40 dark:text-red-400`,children:[(0,$.jsx)(xe,{className:`size-3.5`}),c.remove]})]})]},t))]}),ce?(0,$.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(ue,{className:`size-4`}),c.testReady]}),(0,$.jsx)(`img`,{src:ce,alt:`Generated provider test`,className:`max-h-72 rounded-lg object-contain`})]}):null,oe?(0,$.jsx)(`p`,{className:`rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:oe}):null,ie?(0,$.jsx)(`p`,{className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:ie}):null]}),(0,$.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-edge px-5 py-3`,children:[n?(0,$.jsxs)(Z,{variant:`secondary`,className:`border-red-500/30 text-red-600 hover:bg-red-500/10 dark:text-red-400`,disabled:!!W,onClick:()=>void _e(),children:[W===`delete`?(0,$.jsx)(pe,{className:`size-4 animate-spin`}):(0,$.jsx)(xe,{className:`size-4`}),re?c.confirmDelete:c.delete]}):null,(0,$.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`secondary`,disabled:!!W,children:c.cancel})}),(0,$.jsxs)(Z,{variant:`secondary`,disabled:!!W,onClick:()=>void he(),children:[W===`test`?(0,$.jsx)(pe,{className:`size-4 animate-spin`}):null,W===`test`?c.testing:c.test]}),(0,$.jsxs)(Z,{variant:`primary`,disabled:!!W,onClick:()=>void me(),children:[W===`save`?(0,$.jsx)(pe,{className:`size-4 animate-spin`}):null,W===`save`?c.saving:c.save]})]})]})]})]})})}var sn=`••••••••••••`,cn={en:{title:`Image generation`,intro:`Configure the default image model and service. Agents inherit this setting unless overridden in Agent settings.`,provider:`Provider`,model:`Model`,apiKey:`API key`,getApiKey:`Get API key`,apiKeyHint:`Stored in the local credential store, never in xopc.json.`,existingKey:`A credential or environment variable is already available. Leave this blank to reuse it.`,savedKey:`A credential is saved. Use the eye button to view it, or type a new key to replace it.`,revealFailed:`Unable to load the saved API key.`,keyNotRevealable:`This credential comes from an environment variable or another non-revealable source.`,advanced:`Provider settings`,enable:`Enable image generation`,enabling:`Verifying and enabling…`,enabled:`Image generation is ready.`,addService:`Add image service`,manageService:`Manage service`,custom:`Custom`,current:`Current`,configured:`Credential ready`,needsKey:`API key required`,connect:`Connect to a gateway to continue.`,loadError:`Unable to load image generation settings.`,selectModel:`Select a model`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},zh:{title:`图片生成`,intro:`配置全局图片生成模型和服务。各智能体默认继承此设置,也可在智能体详情中单独覆盖。`,provider:`Provider`,model:`模型`,apiKey:`API Key`,getApiKey:`获取 API Key`,apiKeyHint:`密钥只保存在本机凭据存储中,不会写入 xopc.json。`,existingKey:`已有凭据或环境变量;留空即可继续使用。`,savedKey:`凭据已保存。点击眼睛可查看,直接输入新密钥可替换。`,revealFailed:`无法读取已保存的 API Key。`,keyNotRevealable:`当前凭据来自环境变量或其他不可查看的来源。`,advanced:`服务商设置`,enable:`启用图片生成`,enabling:`正在验证并启用…`,enabled:`图片生成已可用。`,addService:`添加图片服务`,manageService:`管理服务`,custom:`自定义`,current:`当前使用`,configured:`凭据已就绪`,needsKey:`需要 API Key`,connect:`请先连接网关。`,loadError:`无法加载图片生成设置。`,selectModel:`选择模型`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}};async function ln(){let e=await m(d(`/api/image-generation/default`));if(!e.payload)throw Error(`Invalid default image generation response`);return e.payload}function un(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(0,t):void 0}function dn(e){let t=e?.indexOf(`/`)??-1;return t>0?e.slice(t+1):void 0}function fn(e){return Object.fromEntries(e.configFields.map(t=>[t.key,e.config[t.key]??(t.required?t.options?.[0]?.value??``:``)]))}function pn(e){let t=(0,en.c)(11),{field:n,value:r,onChange:i}=e,a;t[0]!==n.label||t[1]!==n.options||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==n.type||t[5]!==i||t[6]!==r?(a=n.type===`select`?(0,$.jsx)(j,{value:r,options:(n.options??[]).map(mn),placeholder:n.placeholder??n.label,allowEmpty:!n.required,onChange:i,triggerClassName:`mt-1.5`}):(0,$.jsx)(`input`,{type:`url`,value:r,required:n.required,onChange:e=>i(e.target.value),placeholder:n.placeholder,className:`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[0]=n.label,t[1]=n.options,t[2]=n.placeholder,t[3]=n.required,t[4]=n.type,t[5]=i,t[6]=r,t[7]=a):a=t[7];let o;return t[8]!==n.label||t[9]!==a?(o=(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n.label,a]}),t[8]=n.label,t[9]=a,t[10]=o):o=t[10],o}function mn(e){return{value:e.value,label:e.label}}function hn(){let e=(0,en.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Te,{className:`h-24 rounded-xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`grid gap-4`,"aria-hidden":`true`,children:[t,(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:5}).map(gn)}),(0,$.jsx)(Te,{className:`h-64 rounded-xl`})]}),e[1]=n):n=e[1],n}function gn(e,t){return(0,$.jsx)(Te,{className:`h-24 rounded-xl`},t)}function _n({connectOnly:e=!1,onConnected:t,onPendingChange:n}={}){let r=p(e=>e.language),a=cn[r],o=!!f(e=>e.conversationId),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)({}),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,T]=(0,Q.useState)(null);(0,Q.useEffect)(()=>(n?.(y||x),()=>n?.(!1)),[y,x,n]);let[E,D]=(0,Q.useState)(),[O,k]=(0,Q.useState)(!1),[A,N]=(0,Q.useState)(!1),[P,I]=(0,Q.useState)(),{data:L,isLoading:R,error:ee,mutate:z}=X(o?d(`/api/image-generation/catalog`):null,Yt,{revalidateOnFocus:!1}),{data:B,isLoading:V,error:H,mutate:U}=X(o?d(`/api/image-generation/custom-providers`):null,qt,{revalidateOnFocus:!1}),{data:te,isLoading:W,error:ne,mutate:re}=X(o?`default-image-generation`:null,ln,{revalidateOnFocus:!1});(0,Q.useEffect)(()=>{if(!L||!te)return;let e=un(te.model?.primary),t=L.find(t=>t.id===e)??L.find(e=>e.configured)??L[0];t&&(c(t.id),u(t.id===e&&dn(te.model?.primary)||t.defaultModel),g(t.configured?sn:``),v(fn(t)))},[te,L]);let G=L?.find(e=>e.id===s),ie=G?G.apiKeyUrl??F(G.id,r)[0]?.href:void 0,ae=(0,Q.useMemo)(()=>[...G?.models??[]].sort($e).map(e=>({value:e,label:e})),[G?.models]),oe=te?.model?.primary,se=!!(G&&l&&(G.credentialMode!==`api-key`||G.configured||h.trim())&&G.configFields.every(e=>!e.required||_[e.key]?.trim()));if(!o)return(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a.connect});if(R||V||W)return(0,$.jsx)(hn,{});if(ee||H||ne||!L||!B)return(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:a.loadError});let ce=e=>{c(e.id),u(e.defaultModel),g(e.configured?sn:``),v(fn(e)),D(void 0)},K=()=>{I(void 0),N(!0)},le=()=>{let e=B.find(e=>e.providerId===G?.id);e&&(I(e),N(!0))},q=async n=>{let[r,i]=await Promise.all([U(),z()]);if(n&&i?.some(e=>e.id===n)){let a=i.find(e=>e.id===n);c(a.id),u(a.defaultModel),g(a.configured?sn:``),v(fn(a)),I(r?.find(e=>e.providerId===n)),e&&a.configured&&t?.()}},ue=async()=>{if(!(!G||!se)){b(!0),D(void 0),k(!1);try{if(e){h.trim()&&!Ue(h)&&await Gt(G.id,h.trim()),Object.keys(_).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({providersConfig:{[G.id]:_}})});let[e]=await Promise.all([z(),ke()]);if(!e?.find(e=>e.id===G.id)?.configured)throw Error(r===`zh`?`连接尚未就绪,请先完成对应服务的授权或凭据设置。`:`Connection is not ready. Complete authorization or credentials first.`);k(!0),t?.();return}let n=await m(d(`/api/image-generation/default/setup`),{method:`POST`,body:JSON.stringify({providerId:G.id,modelId:l,...h.trim()&&!Ue(h)?{apiKey:h.trim()}:{},providerConfig:Object.fromEntries(Object.entries(_).filter(([,e])=>e.trim()))})});if(!n.payload)throw Error(`Invalid setup response`);await Promise.all([re(n.payload.default,{revalidate:!1}),z(n.payload.providers,{revalidate:!1}),i(async()=>{let{mutate:e}=await import(`./vendor-swr-CdRzEUwF.js`).then(e=>e.r);return{mutate:e}},__vite__mapDeps([0,1,2])).then(({mutate:e})=>Promise.all([e(`settings-agent-defaults`),e(`settings-gateway-agents`)])),ke()]),g(sn),k(!0)}catch(e){D(e instanceof Error?e.message:String(e))}finally{b(!1)}}};return(0,$.jsxs)(`div`,{ref:T,className:`flex flex-col gap-4`,children:[(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`rounded-lg bg-accent/10 p-2 text-accent`,children:(0,$.jsx)(de,{className:`size-5`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:e?r===`zh`?`连接图片来源,不修改默认模型,也不发送生成测试请求。`:`Connect image sources without changing defaults or sending generation tests.`:a.intro})]})]})}),(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:a.provider}),(0,$.jsxs)(Z,{variant:`secondary`,className:`px-2.5 py-1.5 text-xs`,onClick:K,children:[(0,$.jsx)(ge,{className:`size-4`}),a.addService]})]}),(0,$.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:L.map(e=>{let t=e.id===s,n=e.id===un(oe);return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>ce(e),className:`min-h-24 rounded-xl p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${t?`bg-accent-soft shadow-surface`:`bg-surface-base/55 hover:bg-surface-hover`}`,children:[(0,$.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.label}),e.source===`custom`?(0,$.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-[10px] text-fg-subtle`,children:a.custom}):null]}),(0,$.jsx)(`span`,{"aria-hidden":!n,className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent ${n?``:`invisible`}`,children:a.current})]}),(0,$.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-xs ${e.configured?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`}`,children:[e.configured||e.credentialMode!==`api-key`?(0,$.jsx)(M,{className:`size-3.5`}):(0,$.jsx)(fe,{className:`size-3.5`}),e.configured||e.credentialMode!==`api-key`?a.configured:a.needsKey]})]},e.id)})})]}),G?(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[e?null:(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a.model,(0,$.jsx)(j,{value:l,options:ae,placeholder:a.selectModel,allowEmpty:!1,onChange:u,triggerClassName:`mt-1.5`})]}),G.configFields.filter(e=>e.required).map(e=>(0,$.jsx)(pn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))]}),G.source===`custom`?(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`secondary`,onClick:le,children:[(0,$.jsx)(ve,{className:`size-4`}),a.manageService]})}):null,G.credentialMode===`api-key`?(0,$.jsxs)(`div`,{className:`mt-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`label`,{htmlFor:`image-generation-api-key`,className:`text-xs font-medium text-fg-muted`,children:a.apiKey}),ie?(0,$.jsxs)(`a`,{href:ie,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs font-medium text-accent hover:underline`,children:[a.getApiKey,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})]}):null]}),(0,$.jsx)(J,{id:`image-generation-api-key`,value:h,onChange:e=>g(Ue(h)?e.replace(/^•+/,``):e),placeholder:G.configured?a.existingKey:a.needsKey,labels:{show:a.show,hide:a.hide,copy:a.copy,copied:a.copied},reveal:()=>_t(G.id).then(e=>e.apiKey),loadFailedLabel:a.revealFailed,notInConfigFile:a.keyNotRevealable,className:`mt-1.5`,autoComplete:`new-password`},G.id),(0,$.jsx)(`span`,{className:`mt-1.5 block font-normal leading-relaxed text-fg-subtle`,children:G.configured?a.savedKey:a.apiKeyHint})]}):null,G.configFields.some(e=>!e.required)?(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,$.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 text-sm font-medium text-fg-muted`,children:[(0,$.jsx)(be,{className:`size-4`}),a.advanced]}),(0,$.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:G.configFields.filter(e=>!e.required).map(e=>(0,$.jsx)(pn,{field:e,value:_[e.key]??``,onChange:t=>v(n=>({...n,[e.key]:t}))},e.key))})]}):null,O?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300`,role:`status`,children:e?r===`zh`?`连接已保存`:`Connection saved`:a.enabled}):null,E?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-400`,children:E}):null,(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(Z,{variant:`primary`,disabled:!se||y,onClick:()=>void ue(),children:[y?(0,$.jsx)(pe,{className:`size-4 animate-spin`}):(0,$.jsx)(M,{className:`size-4`}),(0,$.jsxs)(`span`,{className:`grid`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enable}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:a.enabling}),(0,$.jsx)(`span`,{className:`col-start-1 row-start-1`,children:e?y?r===`zh`?`保存中…`:`Saving…`:r===`zh`?`保存图片连接`:`Save image connection`:y?a.enabling:a.enable})]})]})})]}):null,(0,$.jsx)(on,{portalContainer:C?.closest(`[role="dialog"]`),onPendingChange:S,open:A,onOpenChange:N,provider:P,configured:!!(P&&L.find(e=>e.id===P.providerId)?.configured),language:r,onSaved:q})]})}function vn(e){return e.some(e=>e.disabled?!1:e.type===`searxng`?e.url.trim().length>0:e.apiKey.trim().length>0)}function yn(e){let t=e&&typeof e==`object`&&`tools`in e?e.tools:void 0,n=t&&typeof t==`object`&&`web`in t?t.web:void 0,r=n&&typeof n==`object`&&`region`in n?n.region:void 0,i=r===`cn`||r===`global`?r:`auto`,a=n&&typeof n==`object`&&`search`in n?n.search:void 0,o=a&&typeof a==`object`?a:{},s=typeof o.maxResults==`number`&&Number.isFinite(o.maxResults)?Math.floor(o.maxResults):5,c=n&&typeof n==`object`&&`blocklist`in n?n.blocklist:void 0,l=c&&typeof c==`object`?c:{},u=Array.isArray(l.domains)?l.domains.filter(e=>typeof e==`string`&&e.trim().length>0):[],d=o.providers;return{regionMode:i,maxResults:s,providers:Array.isArray(d)?d.map((e,t)=>{let n=e&&typeof e==`object`?e:{},r=n.type,i=r===`brave`||r===`tavily`||r===`bing`||r===`searxng`||r===`deepseek`?r:`brave`;return{clientKey:`search-provider-${t}`,type:i,apiKey:typeof n.apiKey==`string`?n.apiKey:``,url:typeof n.url==`string`?n.url:``,disabled:n.disabled===!0}}):[],blocklistEnabled:l.enabled===!0,blocklistDomains:u}}async function bn(e){let t=e.regionMode===`auto`?`auto`:e.regionMode===`cn`?`cn`:`global`,n={maxResults:e.maxResults,providers:e.providers.map(e=>{let t={type:e.type,apiKey:e.apiKey};return(e.type===`searxng`||e.type===`deepseek`)&&e.url.trim()&&(t.url=e.url.trim().replace(/\/+$/,``)),e.disabled&&(t.disabled=!0),t})};await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({tools:{web:{region:t,search:n,blocklist:{enabled:e.blocklistEnabled,domains:e.blocklistDomains}}}})}),ke()}async function xn(e){let t=await m(d(`/api/tools/web/reveal-search-api-key`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({index:e})});if(!t.ok||!t.payload)throw Error(t.error?.message??`Reveal failed`);return t.payload}function Sn(e){let t=(0,en.c)(8),{label:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:r}),t[2]=r,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[a,i,o]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Cn(){return Y(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,He,`dark:border-edge`)}function wn(){return Y(Ve,Be)}var Tn=[`brave`,`tavily`,`bing`,`searxng`,`deepseek`];function En(){return{clientKey:crypto.randomUUID(),type:`brave`,apiKey:``,url:``,disabled:!1}}var Dn=Ye();function On(){let e=h(p(e=>e.language)),t=e.webSearchSettings,n=e.logs,r=!!f(e=>e.conversationId),[i,a]=(0,Q.useReducer)(Dn,{form:null,baseline:null}),o=i.form,s=i.baseline,c=(0,Q.useRef)(!1),l=(0,Q.useRef)(o);l.current=o;let u=(0,Q.useRef)(null),{data:d,error:m,isLoading:g,mutate:_}=Ae(r);Je({enabled:r,parsed:(0,Q.useMemo)(()=>d?.payload?.config===void 0?null:yn(d.payload.config),[d]),dirty:c.current,trackedParsedRef:u,dispatch:a,onResetDirty:()=>{c.current=!1}});let v=!!(r&&g&&d===void 0&&!m),y=m instanceof Error?m.message:m?String(m):null,b=(0,Q.useMemo)(()=>!o||!s?!1:JSON.stringify(o)!==JSON.stringify(s),[o,s]),x=(0,Q.useCallback)(e=>{c.current=!0,a({type:`patch`,patch:e})},[]),S=Rt({value:o,dirty:b,onSave:(0,Q.useCallback)(async e=>{try{await bn(e),a({type:`saved`,value:e}),c.current=!!(l.current&&JSON.stringify(l.current)!==JSON.stringify(e))}catch(e){throw Error(e instanceof Error?e.message:t.saveError)}},[t.saveError])});if(!r)return(0,$.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.needToken})});if(v)return(0,$.jsx)(at,{rows:3});if(!o)return(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y??t.loadError}),(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void _(),children:n.refresh})]});let C=vn(o.providers);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,onBlurCapture:S.onBlurCapture,children:[S.error?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:S.error}):null,(0,$.jsxs)(It,{children:[(0,$.jsx)(Ft,{icon:he,title:t.sectionSearch,subtitle:t.sectionSearchHint,trailing:(0,$.jsx)(Lt,{status:S.status,error:S.error})}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-edge bg-surface-base/55 px-4 py-3`,children:[(0,$.jsx)(le,{className:`mt-0.5 size-5 shrink-0 text-accent`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.cloudProvider}),(0,$.jsx)(`span`,{className:Y(`rounded-full px-2 py-0.5 text-[11px] font-medium`,C?`bg-surface-panel text-fg-muted`:`bg-accent-soft text-accent`),children:C?t.cloudOverridden:t.cloudAutomatic})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-subtle`,children:C?t.cloudOverriddenHint:t.cloudAutomaticHint})]})]}),(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:t.providersTitle}),o.providers.map((n,r)=>(0,$.jsx)(kn,{row:n,providerIndex:r,labels:t,secretLabels:We(e.providersSettings),onChange:e=>{let t=[...o.providers];t[r]=e,x({providers:t})},onRemove:()=>{x({providers:o.providers.filter((e,t)=>t!==r)})}},n.clientKey??r)),(0,$.jsxs)(Z,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5 text-sm`,onClick:()=>x({providers:[...o.providers,En()]}),children:[(0,$.jsx)(ge,{className:`size-4`}),t.addProvider]})]})]}),(0,$.jsxs)(It,{children:[(0,$.jsx)(Ft,{icon:be,title:t.sectionPreferences}),(0,$.jsxs)(`div`,{className:`grid max-w-2xl gap-4 sm:grid-cols-2`,children:[(0,$.jsx)(Sn,{label:t.regionLabel,description:t.regionDesc,children:(0,$.jsxs)(k,{className:wn(),value:o.regionMode,onChange:e=>x({regionMode:e.target.value}),children:[(0,$.jsx)(A,{value:`auto`,children:t.regionAuto}),(0,$.jsx)(A,{value:`cn`,children:t.regionCn}),(0,$.jsx)(A,{value:`global`,children:t.regionGlobal})]})}),(0,$.jsx)(Dt,{title:t.maxResultsLabel,summary:o.maxResults,children:(0,$.jsx)(Sn,{label:t.maxResultsLabel,description:t.maxResultsDesc,children:(0,$.jsx)(jt,{type:`number`,min:1,max:50,className:Cn(),value:o.maxResults,onChange:e=>x({maxResults:Math.max(1,Math.min(50,Number(e.target.value)||5))})})})})]})]}),(0,$.jsxs)(`details`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,$.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:[t.sectionBlocklist,` · `,o.blocklistEnabled?o.blocklistDomains.length:0]}),(0,$.jsxs)(It,{children:[(0,$.jsx)(Ft,{icon:ye,title:t.sectionBlocklist,subtitle:t.sectionBlocklistHint}),(0,$.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-4`,children:[(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:o.blocklistEnabled,onChange:e=>x({blocklistEnabled:e.target.checked})}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:t.blocklistEnabled}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-subtle`,children:t.blocklistEnabledDesc})]})]}),o.blocklistEnabled?(0,$.jsx)(Sn,{label:t.blocklistDomains,description:t.blocklistDomainsDesc,children:(0,$.jsx)(`textarea`,{className:Y(Cn(),`min-h-[6rem] font-mono text-xs`),value:o.blocklistDomains.join(`
|
|
8
|
+
`),placeholder:t.blocklistDomainsPlaceholder,onChange:e=>{let t=e.target.value.split(/\r?\n/).flatMap(e=>{let t=e.trim().toLowerCase();return t?[t]:[]});x({blocklistDomains:t})}})}):null]})]})]})]})}function kn(e){let t=(0,en.c)(56),{row:n,providerIndex:r,labels:i,secretLabels:a,onChange:o,onRemove:s}=e,c;t[0]===r?c=t[1]:(c=()=>xn(r).then(An),t[0]=r,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=Y(wn(),`min-w-[8rem]`),t[2]=u):u=t[2];let d=n.type,f;t[3]!==o||t[4]!==n?(f=e=>o({...n,type:e.target.value,url:``,apiKey:``}),t[3]=o,t[4]=n,t[5]=f):f=t[5];let p;t[6]===i.providerTypes?p=t[7]:(p=Tn.map(e=>(0,$.jsx)(A,{value:e,children:i.providerTypes[e]},e)),t[6]=i.providerTypes,t[7]=p);let m;t[8]!==n.type||t[9]!==f||t[10]!==p?(m=(0,$.jsx)(k,{className:u,value:d,onChange:f,children:p}),t[8]=n.type,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==o||t[13]!==n?(h=e=>o({...n,disabled:e.target.checked}),t[12]=o,t[13]=n,t[14]=h):h=t[14];let g;t[15]!==n.disabled||t[16]!==h?(g=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:n.disabled,onChange:h}),t[15]=n.disabled,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==i.disabled||t[19]!==g?(_=(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-xs text-fg-muted`,children:[g,i.disabled]}),t[18]=i.disabled,t[19]=g,t[20]=_):_=t[20];let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(xe,{className:`size-4`}),t[21]=v):v=t[21];let y;t[22]===s?y=t[23]:(y=(0,$.jsx)(Z,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-fg-muted`,onClick:s,children:v}),t[22]=s,t[23]=y);let b;t[24]!==y||t[25]!==_?(b=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,y]}),t[24]=y,t[25]=_,t[26]=b):b=t[26];let x;t[27]!==b||t[28]!==m?(x=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[m,b]}),t[27]=b,t[28]=m,t[29]=x):x=t[29];let S;t[30]!==i.deepseekUrlDesc||t[31]!==i.deepseekUrlLabel||t[32]!==i.urlDesc||t[33]!==i.urlLabel||t[34]!==o||t[35]!==n?(S=n.type===`searxng`||n.type===`deepseek`?(0,$.jsx)(Sn,{label:n.type===`deepseek`?i.deepseekUrlLabel:i.urlLabel,description:n.type===`deepseek`?i.deepseekUrlDesc:i.urlDesc,children:(0,$.jsx)(`input`,{type:`url`,className:Cn(),value:n.url,placeholder:n.type===`deepseek`?`https://api.deepseek.com`:`http://localhost:8080`,onChange:e=>o({...n,url:e.target.value})})}):null,t[30]=i.deepseekUrlDesc,t[31]=i.deepseekUrlLabel,t[32]=i.urlDesc,t[33]=i.urlLabel,t[34]=o,t[35]=n,t[36]=S):S=t[36];let C;t[37]!==o||t[38]!==n?(C=e=>o({...n,apiKey:e}),t[37]=o,t[38]=n,t[39]=C):C=t[39];let w;t[40]!==i.keyPlaceholder||t[41]!==i.keyPlaceholderMasked||t[42]!==i.saveError||t[43]!==l||t[44]!==n.apiKey||t[45]!==a||t[46]!==C?(w=(0,$.jsx)(J,{value:n.apiKey,onChange:C,placeholder:i.keyPlaceholder,labels:a,reveal:l,loadFailedLabel:i.saveError,notInConfigFile:i.keyPlaceholderMasked}),t[40]=i.keyPlaceholder,t[41]=i.keyPlaceholderMasked,t[42]=i.saveError,t[43]=l,t[44]=n.apiKey,t[45]=a,t[46]=C,t[47]=w):w=t[47];let T;t[48]!==i.apiKeyDesc||t[49]!==i.apiKeyLabel||t[50]!==w?(T=(0,$.jsx)(Sn,{label:i.apiKeyLabel,description:i.apiKeyDesc,children:w}),t[48]=i.apiKeyDesc,t[49]=i.apiKeyLabel,t[50]=w,t[51]=T):T=t[51];let E;return t[52]!==x||t[53]!==S||t[54]!==T?(E=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-surface-panel/60 p-4`,children:[x,S,T]}),t[52]=x,t[53]=S,t[54]=T,t[55]=E):E=t[55],E}function An(e){return e.apiKey??null}function jn(e,t,n=[]){return e.filter(e=>!n.includes(e.providerId)&&e.uses.some(e=>e.id===t&&e.choices.length>0))}function Mn(e){let t=(0,en.c)(75),{use:n,data:r,language:i,labels:a,onSaved:o,inline:s,onPendingChange:c,onEditingChange:l}=e,u=s!==void 0&&s,d=i===`zh`,[f,p]=(0,Q.useState)(),[m,h]=(0,Q.useState)(!1),g;t[0]===c?g=t[1]:(g=e=>{h(e),c?.(e)},t[0]=c,t[1]=g);let _=g,v=n===`transcription`?`stt`:n===`speech`?`tts`:void 0,y,b,x;if(t[2]!==r.builtinRows||t[3]!==r.cards||t[4]!==r.customConfig?.providers||t[5]!==r.loading||t[6]!==n){let e=new Set(r.cards.filter(e=>!ee(e.id)||!!r.customConfig?.providers?.[e.id]).map(Vn));y=[...new Set([...r.builtinRows.map(Bn),...e])].filter(t=>!ee(t)||e.has(t)).sort(),b=X,x=r.loading?null:[`capability-service-connections`,n,y.join(`,`)],t[2]=r.builtinRows,t[3]=r.cards,t[4]=r.customConfig?.providers,t[5]=r.loading,t[6]=n,t[7]=y,t[8]=b,t[9]=x}else y=t[7],b=t[8],x=t[9];let S;t[10]!==y||t[11]!==n||t[12]!==v?(S=async()=>{let e=v===`stt`?await zt():v===`tts`?await Ut():void 0,t=e?.providers.filter(zn).map(Rn),r=e?.providers.filter(Ln).map(In)??[],i=t?y.filter(e=>t.includes(e)):y,a=await Promise.allSettled(i.map(L));return{services:jn(a.flatMap(Fn),n,r),failed:a.some(Pn)}},t[10]=y,t[11]=n,t[12]=v,t[13]=S):S=t[13];let C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[14]=C):C=t[14];let{data:w,error:T,isLoading:E,mutate:D}=b(x,S,C),O;t[15]===w?.services?O=t[16]:(O=new Set(w?.services.map(Nn)),t[15]=w?.services,t[16]=O);let k=O,A,j;if(t[17]!==l||t[18]!==f?(A=()=>(l?.(!!f),()=>l?.(!1)),j=[f,l],t[17]=l,t[18]=f,t[19]=A,t[20]=j):(A=t[19],j=t[20]),(0,Q.useEffect)(A,j),f&&u){let e;if(t[21]!==r.builtinRows||t[22]!==f){let n;t[24]===f?n=t[25]:(n=e=>e.id===f,t[24]=f,t[25]=n),e=r.builtinRows.find(n),t[21]=r.builtinRows,t[22]=f,t[23]=e}else e=t[23];let a;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>p(void 0),t[26]=a):a=t[26];let s;t[27]!==D||t[28]!==o?(s=()=>{D(),p(void 0),o()},t[27]=D,t[28]=o,t[29]=s):s=t[29];let c;return t[30]!==i||t[31]!==f||t[32]!==_||t[33]!==e||t[34]!==s||t[35]!==n?(c=(0,$.jsx)(`section`,{className:`overflow-hidden rounded-xl border border-edge`,children:(0,$.jsx)(I,{inline:!0,providerId:f,row:e,targetUse:n,language:i,onPendingChange:_,onDone:a,onApplied:s},f)}),t[30]=i,t[31]=f,t[32]=_,t[33]=e,t[34]=s,t[35]=n,t[36]=c):c=t[36],c}let M=d?`选择服务`:`Choose a service`,N;t[37]===M?N=t[38]:(N=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:M}),t[37]=M,t[38]=N);let P;t[39]!==r.loading||t[40]!==E?(P=r.loading||E?(0,$.jsx)(Te,{className:`h-24 w-full`}):null,t[39]=r.loading,t[40]=E,t[41]=P):P=t[41];let F;t[42]!==w?.failed||t[43]!==T||t[44]!==D||t[45]!==d?(F=T||w?.failed?(0,$.jsxs)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:[d?`部分服务目录暂时不可用。`:`Some service catalogs are unavailable.`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void D(),children:d?`重试`:`Retry`})]}):null,t[42]=w?.failed,t[43]=T,t[44]=D,t[45]=d,t[46]=F):F=t[46];let R;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(R=[!0,!1],t[47]=R):R=t[47];let z;t[48]!==m||t[49]!==w?.services||t[50]!==d?(z=R.map(e=>{let t=w?.services.filter(t=>t.configured===e)??[];return t.length?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:e?d?`已连接`:`Connected`:d?`添加服务`:`Add a service`}),t.map(t=>(0,$.jsxs)(`button`,{type:`button`,disabled:m,onClick:()=>p(t.providerId),className:`flex min-h-14 w-full items-center justify-between gap-3 rounded-lg px-3 py-3 text-left transition-colors hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-sm font-medium text-fg`,children:Tt(t.providerId,t.profile.name,d)}),(0,$.jsx)(`span`,{className:`shrink-0 text-sm text-accent-fg`,children:e?d?`选择`:`Choose`:d?`连接`:`Connect`})]},t.providerId))]},String(e)):null}),t[48]=m,t[49]=w?.services,t[50]=d,t[51]=z):z=t[51];let B;t[52]!==w||t[53]!==d?(B=w&&!w.services.length&&!w.failed?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无支持此能力的模型服务。`:`No model services currently support this capability.`}):null,t[52]=w,t[53]=d,t[54]=B):B=t[54];let V=d?`仅列出支持${st[n][0]}的服务。`:`Only compatible services are shown. Reuse saved credentials, then return to select a model.`,H;t[55]===V?H=t[56]:(H=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:V}),t[55]=V,t[56]=H);let U;t[57]!==r.builtinRows||t[58]!==r.customConfig||t[59]!==k||t[60]!==a||t[61]!==i||t[62]!==D||t[63]!==o||t[64]!==f||t[65]!==n?(U=f?(0,$.jsx)(G,{open:!0,initialProviderId:f,initialUse:n,connectOnly:!0,onOpenChange:e=>{e||p(void 0)},builtinRows:r.builtinRows.filter(e=>k.has(e.id)),customConfig:r.customConfig,labels:a,language:i,onSaved:()=>{D(),p(void 0),o()}},f):null,t[57]=r.builtinRows,t[58]=r.customConfig,t[59]=k,t[60]=a,t[61]=i,t[62]=D,t[63]=o,t[64]=f,t[65]=n,t[66]=U):U=t[66];let te;return t[67]!==N||t[68]!==P||t[69]!==F||t[70]!==z||t[71]!==B||t[72]!==H||t[73]!==U?(te=(0,$.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[N,P,F,z,B,H,U]}),t[67]=N,t[68]=P,t[69]=F,t[70]=z,t[71]=B,t[72]=H,t[73]=U,t[74]=te):te=t[74],te}function Nn(e){return e.providerId}function Pn(e){return e.status===`rejected`}function Fn(e){return e.status===`fulfilled`?[e.value]:[]}function In(e){return e.id}function Ln(e){return e.diagnostics.requiresApiKey}function Rn(e){return e.id}function zn(e){return!e.diagnostics.requiresApiKey}function Bn(e){return e.id}function Vn(e){return e.id}function Hn({zh:e,kind:t,modelServiceIds:n,onSaved:r,onPendingChange:i}){let{data:a,error:o,mutate:s}=X([`native-voice-connections`,t??`all`,n.join(`,`)],async()=>{let[e,r]=await Promise.all([t===`tts`?Promise.resolve({providers:[]}):zt(),t===`stt`?Promise.resolve({providers:[]}):Ut()]);return[...e.providers.map(e=>({...e,kind:`stt`})),...r.providers.map(e=>({...e,kind:`tts`}))].filter(e=>e.diagnostics.requiresApiKey||!n.includes(e.id))}),[c,l]=(0,Q.useState)(``),[u,f]=(0,Q.useState)({}),[p,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(!1),[_,v]=(0,Q.useState)(``);(0,Q.useEffect)(()=>(i?.(p),()=>i?.(!1)),[p,i]);let y=a?.find(e=>`${e.kind}:${e.id}`===c),b=y?.fields.filter(e=>e.secret||e.type===`password`||[`baseUrl`,`region`,`groupId`].includes(e.key))??[],x=async()=>{if(!(!y||g.current)){g.current=!0,h(!0),v(``);try{let t=Object.fromEntries(Object.entries(u).filter(([,e])=>e.trim()).map(([e,t])=>[e,t.trim()]));Object.keys(t).length&&await m(d(`/api/config`),{method:`PATCH`,body:JSON.stringify({[y.kind]:{providers:{[y.id]:t}}})});let[n]=await Promise.all([s(),dt()]);if(!n?.find(e=>e.kind===y.kind&&e.id===y.id)?.configured)throw Error(e?`连接尚未就绪,请补齐所需凭据。`:`Connection is not ready. Complete the required credentials.`);f({}),r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{g.current=!1,h(!1)}}};return a&&!a.length?null:(0,$.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:e?`其他语音服务与本地语音`:`Other voice services and local speech`}),(0,$.jsxs)(`section`,{className:`mt-4 space-y-4`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t===`stt`?e?`其他识别服务`:`Other recognition services`:t===`tts`?e?`其他合成服务与本地语音`:`Other synthesis services and local speech`:e?`语音 API 与本地语音`:`Voice APIs and local speech`}),!a&&!o?(0,$.jsx)(Te,{className:`h-20 w-full`}):null,o?(0,$.jsxs)(`p`,{role:`alert`,children:[e?`语音服务加载失败`:`Could not load voice services`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void s(),children:e?`重试`:`Retry`})]}):null,(0,$.jsxs)(k,{value:c,disabled:p,"aria-label":e?`语音服务接入`:`Connect voice service`,onChange:e=>{l(e.target.value),f({}),v(``)},children:[(0,$.jsx)(A,{value:``,children:e?`选择语音来源`:`Choose a voice source`}),a?.map(n=>(0,$.jsxs)(A,{value:`${n.kind}:${n.id}`,children:[n.displayName,t?``:` · ${n.kind.toUpperCase()}`,n.configured?e?` · 已连接`:` · Connected`:``]},`${n.kind}:${n.id}`))]}),y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:y.diagnostics.requiresApiKey?e?`此服务使用独立的 API Key。保存连接后,可在“模型与参数”中选用。`:`This service uses its own API key. Save the connection, then choose it in Model and parameters.`:e?`此来源无需 API Key,可返回能力设置选择。`:`No API key needed. Choose this source in capability settings.`}),b.map(t=>(0,$.jsxs)(`label`,{className:`block space-y-1 text-sm text-fg`,children:[(0,$.jsx)(`span`,{children:t.label}),t.secret||t.type===`password`?(0,$.jsx)(J,{labels:Ge,value:u[t.key]??``,onChange:e=>f(n=>({...n,[t.key]:e})),disabled:p}):t.options?.length?(0,$.jsxs)(k,{value:u[t.key]??``,disabled:p,onChange:e=>f(n=>({...n,[t.key]:e.target.value})),children:[(0,$.jsx)(A,{value:``,children:e?`保留现有值`:`Keep existing`}),(t.key===`model`?[...t.options].sort(Qe):t.options).map(e=>(0,$.jsx)(A,{value:e.id,children:e.name},e.id))]}):(0,$.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-panel p-2`,value:u[t.key]??``,disabled:p,placeholder:t.placeholder,onChange:e=>f(n=>({...n,[t.key]:e.target.value}))})]},t.key)),_?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:_}):null,(0,$.jsx)(Z,{disabled:p||!y.configured&&y.diagnostics.requiresApiKey&&!Object.values(u).some(e=>e.trim()),onClick:()=>void x(),children:p?e?`保存中…`:`Saving…`:e?`保存连接`:`Save connection`})]}):null]})]})}function Un(e){let t=(0,en.c)(8),{section:n,title:r,children:i}=e,a;t[0]===r?a=t[1]:(a=(0,$.jsx)(`h3`,{className:`bg-surface-panel px-4 py-1.5 text-xs font-medium text-fg-muted`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`section`,{"data-model-section":n,className:`min-w-0 border-t border-edge first:border-t-0`,children:[a,o]}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Wn(e){let t=(0,en.c)(10),{name:n,manageLabel:r,onManage:i,disabled:a}=e;if(!i){let e;return t[0]===n?e=t[1]:(e=n?(0,$.jsx)(`p`,{className:`px-1 text-xs text-fg-muted`,children:n}):null,t[0]=n,t[1]=e),e}let o=n?`${r} · ${n}`:r,s=n||r,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`span`,{className:`truncate`,children:s}),t[2]=s,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(O,{className:`size-3 shrink-0`,"aria-hidden":!0}),t[4]=l):l=t[4];let u;return t[5]!==a||t[6]!==i||t[7]!==o||t[8]!==c?(u=(0,$.jsxs)(Z,{variant:`ghost`,disabled:a,"aria-label":o,className:`min-h-8 max-w-full justify-start gap-1 rounded-md px-1 py-1 text-xs font-normal`,onClick:i,children:[c,l]}),t[5]=a,t[6]=i,t[7]=o,t[8]=c,t[9]=u):u=t[9],u}function Gn(e){let t=(0,en.c)(13),{description:n,picker:r,actions:i,inline:a,actionColumn:o}=e;if(a){let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(`div`,{className:`min-w-0 space-y-1 py-2`,children:r}),t[0]=r,t[1]=e),e}let s=`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 py-2.5 @min-[40rem]:gap-x-4 ${o?`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)_4.5rem]`:`@min-[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.35fr)]`}`,c;t[2]===n?c=t[3]:(c=(0,$.jsx)(`div`,{className:`col-start-1 row-start-1 min-w-0`,children:n}),t[2]=n,t[3]=c);let l;t[4]===r?l=t[5]:(l=(0,$.jsx)(`div`,{className:`col-span-2 row-start-2 w-full min-w-0 @min-[40rem]:col-span-1 @min-[40rem]:col-start-2 @min-[40rem]:row-start-1`,children:r}),t[4]=r,t[5]=l);let u;t[6]===i?u=t[7]:(u=i&&(0,$.jsx)(`div`,{className:`col-start-2 row-start-1 flex justify-end @min-[40rem]:col-start-3`,children:i}),t[6]=i,t[7]=u);let d;return t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:s,children:[c,l,u]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var Kn=`clear-natural-model`;function qn({label:e,value:t,currentLabel:n,options:r,loading:i,disabled:a,zh:o,onConnect:s,onManage:c,onSelect:l}){let[u,d]=(0,Q.useState)(``),f=u.trim().toLowerCase().split(/\s+/).filter(Boolean),p=[...r].sort((e,t)=>(e.group??``).localeCompare(t.group??``,`en`,{numeric:!0,sensitivity:`base`})||$e(e.label,t.label)||$e(e.value,t.value)).filter(e=>{let t=`${e.label} ${e.group} ${e.value} ${e.searchText??``}`.toLowerCase();return f.every(e=>t.includes(e))}),m=r.find(e=>e.value===t),h=m?.group??r.find(e=>e.value.split(`/`)[0]===t?.split(`/`)[0])?.group,g=m?.label??(t?.endsWith(`/default`)?o?`默认模型`:`Default model`:n??t),_=h?`${g} · ${h}`:g;return!i&&!r.length?(0,$.jsx)(Z,{variant:`secondary`,className:`min-h-11 w-full sm:justify-start`,"aria-label":`${o?`连接`:`Connect`} ${e}`,disabled:a,onClick:s,children:o?`连接服务以启用`:`Connect a service to enable`}):(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(j,{value:t??``,options:p,selectedLabel:g,title:_,placeholder:o?`选择模型`:`Choose a model`,ariaLabel:`${o?`选择`:`Select`} ${e}`,allowEmpty:!1,disabled:a,loading:i,onChange:l,searchPlaceholder:o?`搜索模型或服务`:`Search models or services`,searchValue:u,onSearchChange:d,statusMessage:p.length?void 0:o?`没有可用模型`:`No available models`,triggerClassName:`min-h-11`}),(0,$.jsx)(Wn,{name:h,manageLabel:o?`管理服务`:`Manage services`,onManage:c,disabled:a})]})}function Jn({data:e,zh:t,onChange:n,onSettings:r,onlyUse:i,disabled:a=!1,onPendingChange:o,videoRow:s,musicRow:c}){let{data:l,error:u,mutate:f}=X(`settings-agent-defaults`,it),{data:p}=Ae(!0),{data:m,mutate:h}=X(!i||i===`conversation`?d(Wt):null,Ht),{data:g,isLoading:_,error:v,mutate:y}=X(`model-capability-media-sources`,async()=>{let e=await Promise.allSettled([Ut(),zt(),Yt()]);return{ids:[...new Set(e.flatMap(e=>e.status===`fulfilled`?(Array.isArray(e.value)?e.value:e.value.providers).filter(e=>e.configured).map(e=>e.id):[]))],failed:e.some(e=>e.status===`rejected`)}}),b=[...new Set([...e.cards.filter(t=>t.configured&&(!ee(t.id)||!!e.customConfig?.providers?.[t.id])).map(e=>e.id),...g?.ids??[]])].sort(),{data:x,isLoading:S,mutate:C}=X(e.loading?null:[`model-use-choices`,...b],async()=>{let e=await Promise.allSettled(b.map(L));return{previews:e.flatMap(e=>e.status===`fulfilled`&&e.value.configured?[e.value]:[]),failed:e.some(e=>e.status===`rejected`)}},{revalidateOnFocus:!1}),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(null),O=(0,Q.useRef)(!1),k=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>o?.(!1),[o]);let A=async(e,t)=>{if(O.current||a)return;let n=x?.previews.find(n=>n.uses.some(n=>n.id===e&&n.choices.some(e=>e.id===t))),r=e===`conversation`&&(t===`boson/higgs-realtime`||t===Kn);if(!n&&!r)return;O.current=!0,o?.(!0),T(e),D(null);let i={mode:`replace`,selected:[e],overrides:{[e]:t}};try{if(r)await h(await Bt({defaultForNatural:t===Ee}),{revalidate:!1}),await ke();else if(n){let t=await ce(n.providerId,i);await K(n.providerId,i,t.revision),await Promise.all([f(),C(),...e===`conversation`?[h(),ke()]:[]])}D({use:e})}catch(t){D({use:e,error:t instanceof Error?t.message:String(t)}),Promise.allSettled([f(),C()])}finally{O.current=!1,T(null),o?.(!1),requestAnimationFrame(()=>k.current?.querySelector(`[data-capability="${e}"] button[aria-label]`)?.focus())}},j=p?.payload?.config?Vt(p.payload.config):void 0;if(!l&&!u)return(0,$.jsx)(Te,{className:`h-48 w-full rounded-xl`});if(u)return(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[t?`模型用途加载失败`:`Could not load model uses`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void f(),children:t?`重试`:`Retry`})]});let M=l.defaults.models,N=j?.voice.realtime,P=N?.enabled&&N.omni?`${N.omni.provider}/${N.omni.model}`:void 0,F=m?.defaultForNatural??N?.boson?.defaultForNatural?Ee:P,I=M.background?.primary??M.chat.primary,R=e.builtinRows.find(e=>e.id===I.split(`/`)[0])?.setupProfile?.interactiveOnly!==!0,z=x?.previews[0]?.uses.find(e=>e.id===`background`),B=z?z.current:R?I:void 0,V=[{id:`chat`,label:t?`对话与任务`:`Chat and tasks`,ref:M.chat.primary},{id:`vision`,label:t?`看图`:`Image understanding`,ref:M.imageUnderstanding?.primary},{id:`image`,label:t?`画图`:`Image generation`,ref:M.imageGeneration?.primary},{id:`background`,label:t?`后台任务`:`Background tasks`,ref:B,inherited:!M.background&&!!B},{id:`transcription`,label:t?`录音与听写`:`Recording and dictation`,ref:j?.stt.enabled?`${j.stt.provider}/${j.stt.providers?.[j.stt.provider]?.model??`default`}`:void 0},{id:`speech`,label:t?`语音合成`:`Speech synthesis`,ref:j?.tts.enabled?`${j.tts.provider}/${j.tts.providers?.[j.tts.provider]?.model??`default`}`:void 0},{id:`conversation`,label:t?`自然语音模型`:`Natural voice model`,ref:F}];return(0,$.jsxs)(`section`,{ref:k,className:`@container min-w-0`,children:[(0,$.jsx)(`h2`,{className:i?`mb-2 text-sm font-semibold text-fg`:`sr-only`,children:i?t?`当前模型`:`Current model`:t?`能力总览`:`Capabilities`}),(0,$.jsx)(`div`,{className:i?`space-y-4`:`overflow-hidden rounded-2xl bg-surface-inset`,children:lt.filter(e=>!i||e.uses.includes(i)).map(o=>{let l=o.uses.filter(e=>!i||e===i).map(o=>{let s=V.find(e=>e.id===o),c=Yn(x?.previews??[],s.id,t);s.id===`conversation`&&((m?.credentialSource||s.ref===`boson/higgs-realtime`)&&c.push({value:Ee,label:`Higgs Realtime`,group:`Boson AI`,disabled:!m?.credentialSource}),s.ref===`boson/higgs-realtime`&&!c.some(e=>e.value!==`boson/higgs-realtime`)&&c.push({value:Kn,label:t?`取消默认模型`:`Clear default model`}));let l=s.ref?e.allModels.find(e=>e.id===s.ref):void 0,u=l?tt(l,t?`zh`:`en`):s.ref;return(0,$.jsx)(`div`,{"data-capability":s.id,children:(0,$.jsx)(Gn,{inline:!!i,actionColumn:!!r,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:st[s.id][+!t]}),(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:s.ref?c.some(e=>e.value===s.ref||s.ref?.endsWith(`/default`)&&e.value.split(`/`)[0]===s.ref.split(`/`)[0])?null:t?`待连接`:`Connection needed`:t?`未配置`:`Not set up`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:Et[s.id][+!t]}),s.inherited?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t?`继承默认对话`:`Inherits chat default`}):null]}),picker:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(qn,{label:s.id===`conversation`?s.label:st[s.id][+!t],value:s.ref,currentLabel:u,options:c,loading:e.loading||S||_,disabled:w!==null||a,zh:t,onConnect:()=>n(s.id),onManage:r?()=>n(s.id):void 0,onSelect:e=>{e!==s.ref&&A(s.id,e)}}),w===s.id?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:t?`正在切换…`:`Switching…`}):null,E?.use===s.id?(0,$.jsx)(`div`,{role:E.error?`alert`:`status`,className:`text-xs text-fg-muted`,children:E.error?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-danger`,children:t?`未能切换模型,请重试。`:`Could not switch models. Please retry.`}),(0,$.jsxs)(`details`,{className:`mt-1`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:t?`查看详情`:`Show details`}),(0,$.jsx)(`p`,{className:`mt-1 break-words`,children:E.error})]})]}):t?`已切换`:`Model changed`}):null]}),actions:r&&(s.id===`conversation`||c.length>0||S||_)?(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:w!==null||a,onClick:()=>r(s.id),children:t?`设置`:`Settings`}):null})},s.id)});return i?(0,$.jsx)(`div`,{className:`min-w-0 divide-y divide-edge-subtle`,children:l},o.uses[0]):(0,$.jsxs)(Un,{section:o.uses[0],title:o.label[+!t],children:[l,o.uses.includes(`vision`)&&s,o.uses.includes(`vision`)&&c]},o.uses[0])})}),(!r||i)&&(x?.failed||g?.failed||v)?(0,$.jsxs)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:[t?`部分服务的模型加载失败`:`Some model services could not be loaded`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void Promise.all([y(),C()]),children:t?`重试`:`Retry`})]}):null,i||r?null:(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t?`快速与复杂任务模型随对话配置;音色、流式听写及电脑操作可在详细设置中调整。`:`Fast and complex task models follow chat setup. Voices, streaming dictation and Computer Use have detailed settings.`})]})}function Yn(e,t,n=!1){return e.flatMap(e=>e.uses.find(e=>e.id===t)?.choices.map(t=>({value:t.id,label:t.name,group:Tt(e.providerId,e.profile.name,n),searchText:e.profile.name}))??[])}var Xn={id:`services`,label:[`服务账户`,`Service accounts`]},Zn=[...lt.map(e=>({id:e.uses[0],label:e.label})),Xn];function Qn(e){let t=(0,en.c)(11),{zh:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={contentRef:i,toolbarRef:a,navRef:o,sectionAttribute:`data-model-section`,initialSectionId:Zn[0].id},t[0]=s):s=t[0];let{active:c,jumpTo:l}=Pt(s),u=n?`模型配置分区`:`Model settings sections`,d;t[1]!==c||t[2]!==l||t[3]!==n?(d=Zn.map(e=>(0,$.jsx)(`button`,{type:`button`,"aria-current":c===e.id?`location`:void 0,"aria-pressed":c===e.id,className:Y(`touch-target relative z-10 min-h-9 min-w-max flex-1 whitespace-nowrap rounded-lg px-3 text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,c===e.id?`text-fg`:`text-fg-muted hover:text-fg`),onClick:()=>l(e.id),children:e.label[+!n]},e.id)),t[1]=c,t[2]=l,t[3]=n,t[4]=d):d=t[4];let f;t[5]!==u||t[6]!==d?(f=(0,$.jsx)(`div`,{ref:a,className:`sticky top-0 z-10 min-w-0 bg-surface-panel py-1`,children:(0,$.jsx)(Xe,{as:`nav`,ref:o,"aria-label":u,scrollFocusedItemIntoView:!1,className:`flex w-full gap-0.5 overflow-x-auto rounded-xl bg-surface-inset p-1`,indicatorClassName:`rounded-lg bg-surface-panel ring-1 ring-edge-subtle motion-reduce:transition-none`,children:d})}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==f?(p=(0,$.jsxs)(`div`,{ref:i,className:`flex min-w-0 flex-col gap-5`,children:[f,r]}),t[8]=r,t[9]=f,t[10]=p):p=t[10],p}function $n(e){let t=(0,en.c)(208),{model:n,isNew:r,providerId:i,onSave:a,onClose:o,m:s}=e,c=p(tr)===`zh`,l;t[0]===n?l=t[1]:(l=()=>n?{...n}:te(``),t[0]=n,t[1]=l);let[u,d]=(0,Q.useState)(l),[f,m]=(0,Q.useState)(er),h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(e,t)=>{d(n=>({...n,[e]:t})),m(t=>{let n=new Map(t);return n.delete(e),n})},t[2]=h):h=t[2];let g=h,_;t[3]!==u.computerUse||t[4]!==u.contextWindow||t[5]!==u.id||t[6]!==u.input||t[7]!==u.maxTokens||t[8]!==s.modelIdRequired||t[9]!==s.mustBePositive||t[10]!==c?(_=()=>{let e=new Map;return(u.id||``).trim()||e.set(`id`,s.modelIdRequired),u.contextWindow!==void 0&&u.contextWindow<=0&&e.set(`contextWindow`,s.mustBePositive),u.maxTokens!==void 0&&u.maxTokens<=0&&e.set(`maxTokens`,s.mustBePositive),u.computerUse&&!u.input?.includes(`image`)&&e.set(`computerUse`,c?`电脑控制模型必须支持图片输入`:`Computer Use requires image input`),m(e),e.size===0},t[3]=u.computerUse,t[4]=u.contextWindow,t[5]=u.id,t[6]=u.input,t[7]=u.maxTokens,t[8]=s.modelIdRequired,t[9]=s.mustBePositive,t[10]=c,t[11]=_):_=t[11];let y=_,b;t[12]!==u||t[13]!==o||t[14]!==a||t[15]!==y?(b=()=>{if(!y())return;let e=(u.id||``).trim(),t={...u,id:e,name:u.name?.trim()||e,reasoning:u.reasoning||!1,input:u.input||[`text`],contextWindow:u.contextWindow??128e3,maxTokens:u.maxTokens??16384,cost:{input:u.cost?.input??0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}};a(t),o()},t[12]=u,t[13]=o,t[14]=a,t[15]=y,t[16]=b):b=t[16];let S=b,C=u,w;t[17]===C?w=t[18]:(w=z(C),t[17]=C,t[18]=w);let T=w,E=r?s.addModelTitle:s.editModelTitle,D;t[19]===E?D=t[20]:(D=(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:E}),t[19]=E,t[20]=D);let O;t[21]!==s.modelProviderLabel||t[22]!==i?(O=i?(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[s.modelProviderLabel,`: `,i]}):null,t[21]=s.modelProviderLabel,t[22]=i,t[23]=O):O=t[23];let j;t[24]!==D||t[25]!==O?(j=(0,$.jsxs)(`div`,{children:[D,O]}),t[24]=D,t[25]=O,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=Y(Le,`p-1.5 hover:bg-surface-base`),t[27]=M):M=t[27];let N;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(we,{className:`size-4`}),t[28]=N):N=t[28];let P;t[29]===s.close?P=t[30]:(P=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:M,"aria-label":s.close,children:N})}),t[29]=s.close,t[30]=P);let F;t[31]!==j||t[32]!==P?(F=(0,$.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-start justify-between gap-2`,children:[j,P]}),t[31]=j,t[32]=P,t[33]=F):F=t[33];let I;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(`span`,{className:`text-red-600 dark:text-red-400`,children:` *`}),t[34]=I):I=t[34];let L;t[35]===s.modelId?L=t[36]:(L=(0,$.jsxs)(`label`,{className:`mb-1 block text-xs font-medium text-fg`,children:[s.modelId,I]}),t[35]=s.modelId,t[36]=L);let ee;t[37]===f?ee=t[38]:(ee=Y(U(),f.has(`id`)&&`border-red-500`),t[37]=f,t[38]=ee);let B=u.id||``,V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>g(`id`,e.target.value),t[39]=V):V=t[39];let H=!r,W;t[40]!==ee||t[41]!==B||t[42]!==H?(W=(0,$.jsx)(`input`,{className:ee,value:B,onChange:V,placeholder:`e.g. llama3.1:8b`,disabled:H}),t[40]=ee,t[41]=B,t[42]=H,t[43]=W):W=t[43];let ne;t[44]===f?ne=t[45]:(ne=f.has(`id`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`id`)}):null,t[44]=f,t[45]=ne);let G;t[46]!==L||t[47]!==W||t[48]!==ne?(G=(0,$.jsxs)(`div`,{children:[L,W,ne]}),t[46]=L,t[47]=W,t[48]=ne,t[49]=G):G=t[49];let ie;t[50]===s.displayName?ie=t[51]:(ie=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.displayName}),t[50]=s.displayName,t[51]=ie);let ae;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ae=U(),t[52]=ae):ae=t[52];let se=u.name||``,ce;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ce=e=>g(`name`,e.target.value),t[53]=ce):ce=t[53];let K;t[54]===se?K=t[55]:(K=(0,$.jsx)(`input`,{className:ae,value:se,onChange:ce}),t[54]=se,t[55]=K);let le;t[56]!==ie||t[57]!==K?(le=(0,$.jsxs)(`div`,{children:[ie,K]}),t[56]=ie,t[57]=K,t[58]=le):le=t[58];let q;t[59]===s.inputTypes?q=t[60]:(q=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.inputTypes}),t[59]=s.inputTypes,t[60]=q);let J;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(J=re(),t[61]=J):J=t[61];let ue;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>g(`input`,oe(e.target.value)),t[62]=ue):ue=t[62];let de;t[63]===s?de=t[64]:(de=R.map(e=>(0,$.jsx)(A,{value:e.value,children:s[e.labelKey]},e.value)),t[63]=s,t[64]=de);let fe;t[65]!==T||t[66]!==de?(fe=(0,$.jsx)(k,{className:J,value:T,onChange:ue,children:de}),t[65]=T,t[66]=de,t[67]=fe):fe=t[67];let pe;t[68]!==q||t[69]!==fe?(pe=(0,$.jsxs)(`div`,{children:[q,fe]}),t[68]=q,t[69]=fe,t[70]=pe):pe=t[70];let me=u.reasoning||!1,he;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>g(`reasoning`,e.target.checked),t[71]=he):he=t[71];let ge;t[72]===me?ge=t[73]:(ge=(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:me,onChange:he}),t[72]=me,t[73]=ge);let _e;t[74]!==s.reasoning||t[75]!==ge?(_e=(0,$.jsxs)(`label`,{className:`mt-6 flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[ge,s.reasoning]}),t[74]=s.reasoning,t[75]=ge,t[76]=_e):_e=t[76];let ve;t[77]!==pe||t[78]!==_e?(ve=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=ve):ve=t[79];let ye;t[80]===s.contextWindow?ye=t[81]:(ye=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.contextWindow}),t[80]=s.contextWindow,t[81]=ye);let be;t[82]===f?be=t[83]:(be=Y(U(),f.has(`contextWindow`)&&`border-red-500`),t[82]=f,t[83]=be);let xe=u.contextWindow??128e3,Se;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>g(`contextWindow`,parseInt(e.target.value,10)||0),t[84]=Se):Se=t[84];let Ce;t[85]!==be||t[86]!==xe?(Ce=(0,$.jsx)(jt,{type:`number`,min:1,className:be,value:xe,onChange:Se}),t[85]=be,t[86]=xe,t[87]=Ce):Ce=t[87];let Te;t[88]===f?Te=t[89]:(Te=f.has(`contextWindow`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`contextWindow`)}):null,t[88]=f,t[89]=Te);let Ee;t[90]!==ye||t[91]!==Ce||t[92]!==Te?(Ee=(0,$.jsxs)(`div`,{children:[ye,Ce,Te]}),t[90]=ye,t[91]=Ce,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]===s.maxOutputTokens?De=t[95]:(De=(0,$.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-fg-muted`,children:s.maxOutputTokens}),t[94]=s.maxOutputTokens,t[95]=De);let Oe;t[96]===f?Oe=t[97]:(Oe=Y(U(),f.has(`maxTokens`)&&`border-red-500`),t[96]=f,t[97]=Oe);let X=u.maxTokens??16384,ke;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(ke=e=>g(`maxTokens`,parseInt(e.target.value,10)||0),t[98]=ke):ke=t[98];let Ae;t[99]!==Oe||t[100]!==X?(Ae=(0,$.jsx)(jt,{type:`number`,min:1,className:Oe,value:X,onChange:ke}),t[99]=Oe,t[100]=X,t[101]=Ae):Ae=t[101];let je;t[102]===f?je=t[103]:(je=f.has(`maxTokens`)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-400`,children:f.get(`maxTokens`)}):null,t[102]=f,t[103]=je);let Me;t[104]!==De||t[105]!==Ae||t[106]!==je?(Me=(0,$.jsxs)(`div`,{children:[De,Ae,je]}),t[104]=De,t[105]=Ae,t[106]=je,t[107]=Me):Me=t[107];let Ne;t[108]!==Ee||t[109]!==Me?(Ne=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Ee,Me]}),t[108]=Ee,t[109]=Me,t[110]=Ne):Ne=t[110];let Pe;t[111]===s.costSection?Pe=t[112]:(Pe=(0,$.jsx)(`p`,{className:`mb-2 text-xs font-semibold text-fg`,children:s.costSection}),t[111]=s.costSection,t[112]=Pe);let Fe;t[113]===s.costInput?Fe=t[114]:(Fe=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costInput}),t[113]=s.costInput,t[114]=Fe);let Ie;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=U(),t[115]=Ie):Ie=t[115];let Re=u.cost?.input??0,ze;t[116]===u.cost?ze=t[117]:(ze=e=>g(`cost`,{...u.cost,input:parseFloat(e.target.value)||0,output:u.cost?.output??0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[116]=u.cost,t[117]=ze);let Be;t[118]!==Re||t[119]!==ze?(Be=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ie,value:Re,onChange:ze}),t[118]=Re,t[119]=ze,t[120]=Be):Be=t[120];let Ve;t[121]!==Fe||t[122]!==Be?(Ve=(0,$.jsxs)(`div`,{children:[Fe,Be]}),t[121]=Fe,t[122]=Be,t[123]=Ve):Ve=t[123];let He;t[124]===s.costOutput?He=t[125]:(He=(0,$.jsx)(`label`,{className:`mb-1 block text-xs text-fg-muted`,children:s.costOutput}),t[124]=s.costOutput,t[125]=He);let Ue;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=U(),t[126]=Ue):Ue=t[126];let We=u.cost?.output??0,Ge;t[127]===u.cost?Ge=t[128]:(Ge=e=>g(`cost`,{...u.cost,input:u.cost?.input??0,output:parseFloat(e.target.value)||0,cacheRead:u.cost?.cacheRead??0,cacheWrite:u.cost?.cacheWrite??0}),t[127]=u.cost,t[128]=Ge);let Ke;t[129]!==We||t[130]!==Ge?(Ke=(0,$.jsx)(jt,{type:`number`,step:`any`,min:0,className:Ue,value:We,onChange:Ge}),t[129]=We,t[130]=Ge,t[131]=Ke):Ke=t[131];let qe;t[132]!==He||t[133]!==Ke?(qe=(0,$.jsxs)(`div`,{children:[He,Ke]}),t[132]=He,t[133]=Ke,t[134]=qe):qe=t[134];let Je;t[135]!==Ve||t[136]!==qe?(Je=(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[Ve,qe]}),t[135]=Ve,t[136]=qe,t[137]=Je):Je=t[137];let Ye;t[138]!==Pe||t[139]!==Je?(Ye=(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-2 dark:border-edge`,children:[Pe,Je]}),t[138]=Pe,t[139]=Je,t[140]=Ye):Ye=t[140];let Xe;t[141]!==G||t[142]!==le||t[143]!==ve||t[144]!==Ne||t[145]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[G,le,ve,Ne,Ye]}),t[141]=G,t[142]=le,t[143]=ve,t[144]=Ne,t[145]=Ye,t[146]=Xe):Xe=t[146];let Ze=c?`高级:手机操作协议`:`Advanced: Phone Use protocol`,Qe;t[147]===Ze?Qe=t[148]:(Qe=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:Ze}),t[147]=Ze,t[148]=Qe);let $e=c?`手机操作协议`:`Phone Use protocol`,et=u.phoneUse?.profile??``,tt;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(tt=e=>g(`phoneUse`,e.target.value?{profile:e.target.value}:void 0),t[149]=tt):tt=t[149];let nt=c?`自动识别`:`Automatic`,rt;t[150]===nt?rt=t[151]:(rt=(0,$.jsx)(A,{value:``,children:nt}),t[150]=nt,t[151]=rt);let it,at,ot,st,ct;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,$.jsx)(A,{value:`autoglm-phone-v1`,children:`AutoGLM Phone`}),at=(0,$.jsx)(A,{value:`structured-phone-v1`,children:`Structured Phone`}),ot=(0,$.jsx)(A,{value:`structured-tools-phone-v1`,children:`Visual function tools`}),st=(0,$.jsx)(A,{value:`doubao-seed-phone-v1`,children:`Doubao Seed GUI`}),ct=(0,$.jsx)(A,{value:`gui-owl-phone-v1`,children:`GUI-Owl 1.5`}),t[152]=it,t[153]=at,t[154]=ot,t[155]=st,t[156]=ct):(it=t[152],at=t[153],ot=t[154],st=t[155],ct=t[156]);let lt;t[157]!==$e||t[158]!==et||t[159]!==rt?(lt=(0,$.jsxs)(k,{"aria-label":$e,value:et,onChange:tt,children:[rt,it,at,ot,st,ct]}),t[157]=$e,t[158]=et,t[159]=rt,t[160]=lt):lt=t[160];let ut=c?`通用视觉模型支持图片输入和工具调用时会自动显示;也可指定专用手机协议。`:`Visual models with image input and function tools appear automatically. Dedicated phone protocols can also be selected.`,dt;t[161]===ut?dt=t[162]:(dt=(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:ut}),t[161]=ut,t[162]=dt);let ft;t[163]!==lt||t[164]!==dt?(ft=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[lt,dt]}),t[163]=lt,t[164]=dt,t[165]=ft):ft=t[165];let pt;t[166]!==Qe||t[167]!==ft?(pt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[Qe,ft]}),t[166]=Qe,t[167]=ft,t[168]=pt):pt=t[168];let mt=c?`高级:电脑控制协议`:`Advanced: Computer Use protocol`,ht;t[169]===mt?ht=t[170]:(ht=(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:mt}),t[169]=mt,t[170]=ht);let gt=c?`电脑控制协议`:`Computer Use protocol`,_t=u.computerUse?.profile??``,vt;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>g(`computerUse`,e.target.value?{profile:e.target.value}:void 0),t[171]=vt):vt=t[171];let yt=c?`自动识别`:`Automatic`,bt;t[172]===yt?bt=t[173]:(bt=(0,$.jsx)(A,{value:``,children:yt}),t[172]=yt,t[173]=bt);let xt,St,Ct;t[174]===Symbol.for(`react.memo_cache_sentinel`)?(xt=(0,$.jsx)(A,{value:`gui-plus-2026-02-26`,children:`GUI-Plus (2026-02-26)`}),St=(0,$.jsx)(A,{value:`structured-tools-v1`,children:`structured-tools-v1`}),Ct=(0,$.jsx)(A,{value:`openai-responses-computer-v1`,children:`OpenAI Responses Computer`}),t[174]=xt,t[175]=St,t[176]=Ct):(xt=t[174],St=t[175],Ct=t[176]);let wt;t[177]!==gt||t[178]!==_t||t[179]!==bt?(wt=(0,$.jsxs)(k,{"aria-label":gt,value:_t,onChange:vt,children:[bt,xt,St,Ct]}),t[177]=gt,t[178]=_t,t[179]=bt,t[180]=wt):wt=t[180];let Tt=c?`协议必须与模型 API 匹配。声明协议不代表模型已通过效果验证。`:`The protocol must match the model API. Declaring a protocol does not certify model quality.`,Et;t[181]===Tt?Et=t[182]:(Et=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:Tt}),t[181]=Tt,t[182]=Et);let Dt;t[183]===f?Dt=t[184]:(Dt=f.has(`computerUse`)&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:f.get(`computerUse`)}),t[183]=f,t[184]=Dt);let Ot;t[185]!==Et||t[186]!==Dt||t[187]!==wt?(Ot=(0,$.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[wt,Et,Dt]}),t[185]=Et,t[186]=Dt,t[187]=wt,t[188]=Ot):Ot=t[188];let kt;t[189]!==Ot||t[190]!==ht?(kt=(0,$.jsxs)(`details`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm text-fg`,children:[ht,Ot]}),t[189]=Ot,t[190]=ht,t[191]=kt):kt=t[191];let At;t[192]!==kt||t[193]!==Xe||t[194]!==pt?(At=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-1`,children:[Xe,pt,kt]}),t[192]=kt,t[193]=Xe,t[194]=pt,t[195]=At):At=t[195];let Mt;t[196]===s.cancel?Mt=t[197]:(Mt=(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{type:`button`,variant:`secondary`,children:s.cancel})}),t[196]=s.cancel,t[197]=Mt);let Nt=r?s.addModelConfirm:s.saveModelConfirm,Pt;t[198]!==S||t[199]!==Nt?(Pt=(0,$.jsx)(Z,{type:`button`,variant:`primary`,className:`hover:bg-accent/90`,onClick:S,children:Nt}),t[198]=S,t[199]=Nt,t[200]=Pt):Pt=t[200];let Ft;t[201]!==Mt||t[202]!==Pt?(Ft=(0,$.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge-subtle pt-3 dark:border-edge`,children:[Mt,Pt]}),t[201]=Mt,t[202]=Pt,t[203]=Ft):Ft=t[203];let It;return t[204]!==At||t[205]!==Ft||t[206]!==F?(It=(0,$.jsxs)($.Fragment,{children:[F,At,Ft]}),t[204]=At,t[205]=Ft,t[206]=F,t[207]=It):It=t[207],It}function er(){return new Map}function tr(e){return e.language}function nr(e){let t=(0,en.c)(16),{open:n,onOpenChange:r,providerId:i,model:a,isNew:o,onSave:s,m:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(g,{className:Y(`xopc-dialog-overlay fixed inset-0 bg-scrim`,Pe)}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=Y(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(90vh,720px)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,Ne,`overflow-hidden rounded-xl border border-edge bg-surface-overlay p-4 shadow-popover dark:border-edge`),t[1]=u):u=t[1];let d;t[2]!==o||t[3]!==c||t[4]!==a||t[5]!==r||t[6]!==s||t[7]!==n||t[8]!==i?(d=n?(0,$.jsx)($n,{model:a,isNew:o,providerId:i,onSave:s,onClose:()=>r(!1),m:c},`${i??`none`}-${a?.id??`new`}`):null,t[2]=o,t[3]=c,t[4]=a,t[5]=r,t[6]=s,t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;t[10]===d?f=t[11]:(f=(0,$.jsxs)(y,{children:[l,(0,$.jsx)(b,{className:u,onOpenAutoFocus:rr,children:d})]}),t[10]=d,t[11]=f);let p;return t[12]!==r||t[13]!==n||t[14]!==f?(p=(0,$.jsx)(S,{open:n,onOpenChange:r,children:f}),t[12]=r,t[13]=n,t[14]=f,t[15]=p):p=t[15],p}function rr(e){return e.preventDefault()}function ir(e){let t=(0,en.c)(14),{providerId:n,inputId:r,value:i,onChange:a,labels:o}=e,s;t[0]===n?s=t[1]:(s=()=>_t(n).then(ar),t[0]=n,t[1]=s);let c=s,l;t[2]!==r||t[3]!==o.apiKeyLabel?(l=(0,$.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium text-fg`,children:o.apiKeyLabel}),t[2]=r,t[3]=o.apiKeyLabel,t[4]=l):l=t[4];let u;t[5]!==r||t[6]!==o||t[7]!==a||t[8]!==c||t[9]!==i?(u=(0,$.jsx)(J,{id:r,value:i,onChange:a,placeholder:o.apiKeyPlaceholder,labels:o,reveal:c,loadFailedLabel:o.loadFailed,maskedHelp:o.maskedHelp,notInConfigFile:o.notInConfigFile}),t[5]=r,t[6]=o,t[7]=a,t[8]=c,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function ar(e){return e.apiKey??null}function or(e){let t=(0,en.c)(23),{open:n,onOpenChange:r,providerId:i,isCustom:a,builtinRows:o,customConfig:s,allModels:c,labels:l,language:u,onSaved:d}=e,f=(0,Q.useRef)(null),[p,m]=(0,Q.useState)(!1),[h,_]=(0,Q.useState)(null),v;t[0]===r?v=t[1]:(v=e=>{e||(_(null),m(!1)),r(e)},t[0]=r,t[1]=v);let x=v,C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(g,{className:Y(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,Pe)}),t[2]=C):C=t[2];let w,T,E;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null},T=e=>{f.current?.isConnected&&(e.preventDefault(),f.current.focus({preventScroll:!0}))},E=Y(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(85vh,720px)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,Ne),t[3]=w,t[4]=T,t[5]=E):(w=t[3],T=t[4],E=t[5]);let D;t[6]!==c||t[7]!==o||t[8]!==s||t[9]!==x||t[10]!==a||t[11]!==l||t[12]!==u||t[13]!==r||t[14]!==d||t[15]!==i||t[16]!==p||t[17]!==h?(D=(0,$.jsxs)(y,{children:[C,(0,$.jsx)(b,{onOpenAutoFocus:w,onCloseAutoFocus:T,className:E,children:h?(0,$.jsx)(H,{target:h,zh:u===`zh`,onDone:()=>x(!1)}):!a&&p?(0,$.jsx)(I,{providerId:i,existingConnection:!0,row:o.find(e=>e.id===i),language:u,onApplied:d,onBack:()=>m(!1),onDone:()=>x(!1)}):a?(0,$.jsx)(cr,{providerId:i,customConfig:s,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onModelAdded:e=>_({providerId:i,modelIds:[e]})}):(0,$.jsx)(sr,{providerId:i,builtinRows:o,allModels:c,labels:l,language:u,onClose:()=>r(!1),onSaved:d,onQuickSetup:()=>m(!0)},i)})]}),t[6]=c,t[7]=o,t[8]=s,t[9]=x,t[10]=a,t[11]=l,t[12]=u,t[13]=r,t[14]=d,t[15]=i,t[16]=p,t[17]=h,t[18]=D):D=t[18];let O;return t[19]!==x||t[20]!==n||t[21]!==D?(O=(0,$.jsx)(S,{open:n,onOpenChange:x,children:D}),t[19]=x,t[20]=n,t[21]=D,t[22]=O):O=t[22],O}function sr({providerId:e,builtinRows:t,allModels:n,labels:r,language:i,onClose:a,onSaved:o,onQuickSetup:s}){let c=t.find(t=>t.id===e),u=B[e],d=n.filter(t=>t.provider===e),[f,p]=(0,Q.useState)(!1),[m,g]=(0,Q.useState)(c?.apiKey??``),[_,y]=(0,Q.useState)(!1),[b,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D=h(i).providersSettings,O=c?.supportsApiKey!==!1,k=c?.supportsOAuth===!0,[A,j]=(0,Q.useState)(c?.authMode===`oauth`||!O?`oauth`:`api-key`),N=c?.authMode===`oauth`&&c.authStatus===`connected`,I=c?.configured===!0&&c.authMode!==`oauth`&&c.activeKeySource!==`env`&&c.activeKeySource!==`extension`&&c.activeKeySource!==`models_json`,[L,R]=(0,Q.useState)(null),[ee,z]=(0,Q.useState)(null),[V,H]=(0,Q.useState)(`idle`),[U,te]=(0,Q.useState)(null),[W,re]=(0,Q.useState)(null),[G,ae]=(0,Q.useState)(null),[oe,ce]=(0,Q.useState)(``),K=(0,Q.useRef)(null),le=(0,Q.useRef)(null),J=V===`waiting`||V===`waiting_code`,ue=(0,Q.useMemo)(()=>F(e,i),[e,i]),de=m!==(c?.apiKey??``),fe=async()=>{let t=m.trim();if(!(!t||!O||gt(t))){y(!0),w(null);try{await ht({[e]:t}),S(!0),window.setTimeout(()=>{o(),a()},600)}catch(e){w(e instanceof Error?e.message:r.saveError)}finally{y(!1)}}};(0,Q.useEffect)(()=>{if(!L||!J)return;let t=!0,n=window.setInterval(()=>{(async()=>{try{let r=await Ct(L);if(!t)return;if(r.status===`waiting_auth`||r.status===`waiting_code`)H(r.status===`waiting_code`?`waiting_code`:`waiting`),z(r.message??null),te(r.authUrl??null),re(r.instructions??null),ae(r.deviceCode??null),r.authUrl&&r.authUrl!==le.current&&(le.current=r.authUrl,Ot(r.authUrl,K.current).catch(()=>{}));else if(r.status===`completed`)t=!1,window.clearInterval(n),At(K.current),K.current=null,H(`success`),z(r.message??D.saved),window.setTimeout(()=>{o(),a()},600);else if(r.status===`failed`||r.status===`cancelled`){t=!1,window.clearInterval(n),At(K.current),K.current=null,R(null),H(`error`);let i=e===`openai`&&/"error"\s*:\s*"invalid_grant"/.test(r.error??``);z(i?D.oauthGrantRejected:r.error??r.message??D.revokeFailed)}}catch{}})()},1e3);return()=>{t=!1,window.clearInterval(n)}},[L,J,a,o,e,D.oauthGrantRejected,D.revokeFailed,D.saved]),(0,Q.useEffect)(()=>()=>{L&&xt(L).catch(()=>{})},[L]),(0,Q.useEffect)(()=>()=>{At(K.current),K.current=null},[]);let me=async()=>{try{await vt(e),o(),a()}catch{}},he=async()=>{At(K.current),K.current=kt(),le.current=null,H(`waiting`),z(D.oauthStarting),te(null),re(null),ae(null),ce(``),w(null);try{let t=await yt(e);R(t.sessionId)}catch(e){At(K.current),K.current=null,H(`error`),z(e instanceof Error?e.message:D.revokeFailed)}},ge=async()=>{if(L){try{await wt(L)}catch{}At(K.current),K.current=null,le.current=null,H(`idle`),z(null),R(null),te(null),re(null),ae(null)}},_e=async()=>{if(!(!L||!oe.trim()))try{await St(L,oe.trim()),ce(``),z(D.oauthProcessingCode)}catch(e){H(`error`),z(e instanceof Error?e.message:D.revokeFailed)}},ve=async()=>{try{await bt(e),o(),a()}catch(e){w(e instanceof Error?e.message:D.revokeFailed)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:c?.name??e}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:Y(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Ie.press),children:(0,$.jsx)(we,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-5 py-4`,children:[u?.description?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.description}):null,(0,$.jsx)(ie,{row:c,language:i}),O&&k?(0,$.jsx)(ne,{value:A,onChange:j,language:i,disabled:J||_}):null,O&&A===`api-key`?(0,$.jsx)(ir,{providerId:e,inputId:`manage-api-key`,value:m,onChange:e=>{g(e),S(!1)},labels:{apiKeyLabel:r.apiKeyLabel,apiKeyPlaceholder:r.apiKeyPlaceholder,maskedHelp:r.maskedHelp,copy:r.copy,copied:r.copied,show:r.showKey,hide:r.hideKey,notInConfigFile:r.notInConfigFile,loadFailed:r.loadFailed}}):!O&&c?.category===`extension`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{children:r.extensionKeyHint}),c?.extensionId?(0,$.jsxs)(l,{to:`/settings/ext/${encodeURIComponent(c.extensionId)}`,className:`inline-flex w-fit items-center gap-1 font-medium text-accent hover:underline`,title:r.extensionSettingsLinkTitle,onClick:a,children:[r.openExtensionSettings,(0,$.jsx)(q,{className:`size-3`,"aria-hidden":!0})]}):null]}):null,k&&A===`oauth`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-panel/60 p-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:D.oauth}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:N?i===`zh`?`账号已连接`:`Account connected`:c?.authMode===`oauth`&&c.authStatus===`expired`?i===`zh`?`授权已过期,请重新登录`:`Authorization expired. Sign in again.`:i===`zh`?`通过浏览器授权连接账号`:`Authorize your account in the browser`})]}),N?(0,$.jsx)(Z,{type:`button`,variant:`secondary`,className:`gap-1.5 text-red-600 dark:text-red-400`,onClick:()=>void ve(),children:D.revoke}):(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5`,disabled:J,onClick:()=>void he(),children:[J?(0,$.jsx)(pe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(P,{className:`size-3.5`,"aria-hidden":!0}),D.oauth]})]}),ee?(0,$.jsx)(`p`,{className:Y(`text-xs`,V===`error`?`text-red-600 dark:text-red-400`:`text-fg-muted`),children:ee}):null,V===`waiting`||V===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[U?(0,$.jsxs)(`a`,{href:U,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-on-accent hover:bg-accent-hover`,children:[(0,$.jsx)(q,{className:`size-4`,"aria-hidden":!0}),D.openAuthPage]}):null,(0,$.jsx)(Z,{type:`button`,variant:`secondary`,onClick:()=>void ge(),children:D.cancelOAuth})]}):null,J&&W?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:W}):null,J&&G?(0,$.jsxs)(`div`,{className:`rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:D.deviceCodeLabel}),(0,$.jsx)(`code`,{className:`mt-1 block select-all font-mono text-lg font-semibold tracking-widest text-fg`,children:G}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:D.deviceCodeHint})]}):null,V===`waiting_code`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(`input`,{type:`text`,value:oe,onChange:e=>ce(e.target.value),onKeyDown:e=>e.key===`Enter`&&void _e(),"aria-label":D.pasteRedirectUrl,placeholder:D.pasteRedirectUrl,className:Y(`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,He)}),(0,$.jsx)(Z,{type:`button`,variant:`primary`,onClick:()=>void _e(),children:D.submitCode})]}):null]}):null,ue.length>0&&O&&A===`api-key`?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ue.map(({kind:e,href:t})=>(0,$.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-accent hover:underline`,children:[se(e,r),(0,$.jsx)(q,{className:`size-3`,"aria-hidden":!0})]},e))}):null,A===`api-key`&&c?.baseUrl?(0,$.jsxs)(`details`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg`,children:i===`zh`?`高级设置`:`Advanced settings`}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:r.apiUrlLabel}),(0,$.jsx)(`code`,{className:`break-all font-mono text-xs text-fg-muted`,children:c.baseUrl})]})]}):c?.category===`extension`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.apiUrlExtensionHint}):null,d.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-medium text-fg`,children:[i===`zh`?`模型目录`:`Model catalog`,` (`,d.length,`)`]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i===`zh`?`此服务的模型目录;实际访问权限取决于当前生效的凭据和账号。`:`Models registered for this provider. Access depends on the active credentials and account.`}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:f,onChange:e=>p(e.target.checked)}),i===`zh`?`仅电脑控制模型`:`Computer Use only`]}),(0,$.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-lg border border-edge-subtle bg-surface-panel/40 p-2`,children:(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.filter(e=>!f||e.computerUse).map(e=>(0,$.jsxs)(`span`,{className:`inline-block rounded-md bg-surface-hover px-2 py-1 text-xs text-fg-muted`,children:[tt(e,i),e.computerUse?` · Computer Use`:``]},e.id))})})]}):(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.noModels}),s?(0,$.jsx)(Z,{variant:`secondary`,disabled:de||J||c?.authStatus!==`connected`,onClick:s,children:i===`zh`?`配置模型用途`:`Configure model uses`}):null,C?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:C}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[I?(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>E(!0),children:[(0,$.jsx)(xe,{className:`size-3.5`,"aria-hidden":!0}),i===`zh`?`移除 API Key`:`Remove API key`]}):(0,$.jsx)(`span`,{}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:O&&A===`api-key`&&de&&!gt(m.trim())?(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:!m.trim()||_||b,onClick:()=>void fe(),children:b?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),r.saved]}):_?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(pe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.saving]}):r.save}):null})]}),(0,$.jsx)(Ze,{open:T,title:r.removeConfirmTitle,description:r.removeConfirmDescription.replace(`{{provider}}`,c?.name??e),confirmLabel:r.removeConfirmAction,cancelLabel:r.cancel,destructive:!0,onConfirm:()=>void me(),onCancel:()=>E(!1)})]})}function cr({providerId:e,customConfig:t,labels:n,language:r,onClose:i,onSaved:a,onModelAdded:o}){let s=h(r).modelsSettings,c=t?.providers[e],[l,u]=(0,Q.useState)(c?.baseUrl??``),[d,f]=(0,Q.useState)(c?.apiKey??``),[p,m]=(0,Q.useState)(c?.models??[]),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(c?.modelDiscovery?.enabled===!0),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=n=>{if(!t)return null;let r=d.trim(),i={...c,baseUrl:l.trim()||void 0,apiKey:gt(r)?c?.apiKey:r||void 0,...n};return{providers:{...t.providers,[e]:i}}},F=async()=>{let e=P({models:p,modelDiscovery:{enabled:y}});if(e){C(!0),T(null);try{await V(e),a(),i()}catch(e){T(e instanceof Error?e.message:n.saveError)}finally{C(!1)}}},I=async()=>{if(t)try{let{[e]:n,...r}=t.providers;await V({providers:r}),a(),i()}catch{}},L=(e,t)=>{N({model:e,isNew:t}),j(!0)},R=async e=>{if(!M)return;let t=M.isNew&&!p.some(t=>t.id===e.id),r=M.isNew?[...p,e]:p.map(t=>t.id===e.id?e:t);m(r);let i=P({models:r});if(i)try{await V(i),a(),t&&!e.computerUse&&o(e.id)}catch(e){T(e instanceof Error?e.message:n.saveError)}},ee=async e=>{let t=p.filter(t=>t.id!==e);m(t),k(null);let r=P({models:t});if(r)try{await V(r),a()}catch(e){T(e instanceof Error?e.message:n.saveError)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(x,{className:`text-base font-semibold text-fg`,children:e}),(0,$.jsx)(`span`,{className:`rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:n.custom})]}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:Y(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Ie.press),children:(0,$.jsx)(we,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 overflow-y-auto px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`manage-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,$.jsx)(`input`,{id:`manage-base-url`,type:`url`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),className:Y(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,He)})]}),(0,$.jsx)(ir,{providerId:e,inputId:`manage-custom-api-key`,value:d,onChange:f,labels:{apiKeyLabel:n.apiKeyLabel,apiKeyPlaceholder:n.apiKeyPlaceholder,maskedHelp:n.maskedHelp,copy:n.copy,copied:n.copied,show:n.showKey,hide:n.hideKey,notInConfigFile:n.notInConfigFile,loadFailed:n.loadFailed}}),(0,$.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-edge-subtle bg-surface-panel/40 p-3`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-accent`}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r===`zh`?`自动同步模型目录`:`Automatically sync model catalog`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r===`zh`?`启动时及定时从此服务的 /models 接口更新模型。`:`Update models from this service’s /models endpoint at startup and on schedule.`})]})]}),(0,$.jsxs)(`div`,{className:`border-t border-edge-subtle pt-3`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-semibold text-fg`,children:[s.modelsSection,p.length>0?` (${p.length})`:``]}),(0,$.jsxs)(Z,{type:`button`,variant:`primary`,className:`gap-1.5 px-2 py-1 text-xs`,onClick:()=>L(null,!0),children:[(0,$.jsx)(ge,{className:`size-3.5`,"aria-hidden":!0}),s.addModel]})]}),(0,$.jsxs)(`label`,{className:`mb-2 flex items-center gap-2 text-xs text-fg-muted`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:g,onChange:e=>_(e.target.checked)}),r===`zh`?`仅电脑控制模型`:`Computer Use only`]}),p.filter(e=>!g||e.computerUse).length===0?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s.modelsEmpty}):(0,$.jsx)(`ul`,{className:`space-y-2`,children:p.filter(e=>!g||e.computerUse).map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-lg border border-edge-subtle bg-surface-panel/40 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.id}),e.computerUse&&(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Computer Use`}),e.name&&e.name!==e.id?(0,$.jsx)(`div`,{className:`truncate text-xs text-fg-muted`,children:e.name}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,className:Y(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,Ie.press),onClick:()=>L(e,!1),"aria-label":s.editModel,children:(0,$.jsx)(me,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,className:Y(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-red-600 dark:hover:text-red-400`,Ie.press),onClick:()=>k(e.id),"aria-label":s.removeModel,children:(0,$.jsx)(xe,{className:`size-3.5`,"aria-hidden":!0})})]})]},e.id))})]}),w?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:w}):null]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle px-5 py-3`,children:[(0,$.jsxs)(Z,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300`,onClick:()=>D(!0),children:[(0,$.jsx)(xe,{className:`size-3.5`,"aria-hidden":!0}),n.remove]}),(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(Z,{type:`button`,variant:`primary`,disabled:S,onClick:()=>void F(),children:S?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(pe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})})]}),(0,$.jsx)(Ze,{open:E,title:n.removeConfirmTitle,description:n.removeConfirmDescription.replace(`{{provider}}`,e),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>void I(),onCancel:()=>D(!1)}),(0,$.jsx)(Ze,{open:O!==null,title:s.removeModel,description:s.removeModelConfirm.replace(`{{id}}`,O??``),confirmLabel:n.removeConfirmAction,cancelLabel:n.cancel,destructive:!0,onConfirm:()=>{O&&ee(O)},onCancel:()=>k(null)}),(0,$.jsx)(nr,{open:A,onOpenChange:e=>{j(e),e||N(null)},providerId:e,model:M?.model??null,isNew:M?.isNew??!1,onSave:e=>void R(e),m:s})]})}var lr=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],ur=`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`,dr={en:{fast:[`Fast tasks`,`Short, low-latency work`],reasoning:[`Complex reasoning`,`Planning and multi-step analysis`],coding:[`Coding`,`Implementation and debugging`],review:[`Review`,`Critique and verification`],vision:[`Vision`,`Image and visual analysis`],understanding:[`Understanding`,`Long-form content comprehension`]},zh:{fast:[`快速任务`,`简短、低延迟的工作`],reasoning:[`复杂推理`,`规划和多步骤分析`],coding:[`编程`,`实现、调试和代码修改`],review:[`审查`,`检查、批评和验证`],vision:[`视觉任务`,`图片和视觉内容分析`],understanding:[`内容理解`,`长内容阅读和理解`]}};function fr(e,t){return{primary:t,fallbacks:e?.fallbacks??[]}}function pr(e){let t=(0,en.c)(38),{draft:n,setDraft:r,zh:i,capability:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[0]=o):o=t[0];let s=X(Me,je,o),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l=c,u=i?dr.zh:dr.en,d;t[3]!==n||t[4]!==r?(d=(e,t)=>{let i={...n.models.intents};t?i[e]=fr(i[e],t):delete i[e],r({...n,models:{...n.models,intents:i}})},t[3]=n,t[4]=r,t[5]=d):d=t[5];let f=d,p;t[6]!==a||t[7]!==n||t[8]!==l||t[9]!==s.error||t[10]!==s.isLoading||t[11]!==r||t[12]!==i?(p=a===`chat`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`已配置 ${n.models.chat.fallbacks.length} 个备用模型。`:`${n.models.chat.fallbacks.length} fallback models configured.`,children:(0,$.jsx)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:(0,$.jsx)(Xt,{primary:n.models.chat.primary,value:n.models.chat.fallbacks,models:l,loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,chat:{...n.models.chat,fallbacks:e}}})})})})}):null,t[6]=a,t[7]=n,t[8]=l,t[9]=s.error,t[10]=s.isLoading,t[11]=r,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==a||t[15]!==n||t[16]!==r||t[17]!==i?(m=a===`image`?(0,$.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:n.models.imageGeneration?(0,$.jsx)(Dt,{title:i?`图片执行策略`:`Image execution policy`,summary:i?`当前超时与回退策略继续生效。`:`The current timeout and fallback policy remains active.`,children:(0,$.jsxs)(`div`,{className:`mt-5 grid gap-4 rounded-xl bg-surface-base/45 p-4 sm:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[i?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,$.jsx)(jt,{allowEmpty:!0,type:`number`,min:1,className:`${ur} mt-2`,value:n.models.imageGeneration.timeoutMs??``,onChange:e=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,timeoutMs:e.target.value?Number(e.target.value):void 0}}})})]}),(0,$.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,$.jsx)(`span`,{children:i?`服务商自动回退`:`Automatic provider fallback`}),(0,$.jsx)(Xe,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`服务商自动回退`:`Automatic provider fallback`,children:[!0,!1].map(e=>(0,$.jsx)(Z,{"aria-pressed":n.models.imageGeneration?.autoProviderFallback===e,variant:n.models.imageGeneration?.autoProviderFallback===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,autoProviderFallback:e}}}),children:e?i?`开启`:`On`:i?`关闭`:`Off`},String(e)))})]})]})}):null}):null,t[14]=a,t[15]=n,t[16]=r,t[17]=i,t[18]=m):m=t[18];let h;t[19]!==a||t[20]!==n||t[21]!==l||t[22]!==s.error||t[23]!==s.isLoading||t[24]!==r||t[25]!==i?(h=a===`vision`&&n.models.imageUnderstanding?(0,$.jsx)(Dt,{title:i?`模型回退`:`Model fallbacks`,summary:i?`主模型不可用时使用已配置的备用模型。`:`Use configured fallback models when the primary is unavailable.`,children:(0,$.jsx)(Xt,{primary:n.models.imageUnderstanding.primary,value:n.models.imageUnderstanding.fallbacks,models:l.filter(mr),loading:s.isLoading,error:s.error,zh:i,onChange:e=>r({...n,models:{...n.models,imageUnderstanding:{...n.models.imageUnderstanding,fallbacks:e}}})})}):null,t[19]=a,t[20]=n,t[21]=l,t[22]=s.error,t[23]=s.isLoading,t[24]=r,t[25]=i,t[26]=h):h=t[26];let g;t[27]!==a||t[28]!==u||t[29]!==n||t[30]!==f||t[31]!==i?(g=a===`chat`?(0,$.jsx)(Dt,{title:i?`任务模型路由`:`Task model routing`,summary:i?`已配置 ${Object.keys(n.models.intents).length} 类任务路由;其他任务使用默认模型。`:`${Object.keys(n.models.intents).length} task routes configured; other tasks use the default model.`,children:(0,$.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:i?`按任务选择模型`:`Route by task`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`仅在确实需要不同模型时设置;否则保持“使用默认对话模型”。`:`Set a route only when a task genuinely needs another model; otherwise keep the default.`}),(0,$.jsx)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-2`,children:lr.map(e=>(0,$.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:u[e][0]}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u[e][1]})]}),(0,$.jsx)(et,{value:n.models.intents[e]?.primary??``,placeholder:i?`使用默认对话模型`:`Use default conversation model`,searchPlaceholder:i?`搜索模型或服务商`:`Search models or providers`,noMatches:i?`没有匹配的模型`:`No matching models`,allowEmpty:!0,emptyLabel:i?`使用默认对话模型`:`Use default conversation model`,showProviderInTrigger:!1,contentAlign:`start`,className:`w-full`,ariaLabel:i?`${u[e][0]}模型`:`${u[e][0]} model`,onChange:t=>f(e,t)})]},e))})]})}):null,t[27]=a,t[28]=u,t[29]=n,t[30]=f,t[31]=i,t[32]=g):g=t[32];let _;return t[33]!==p||t[34]!==m||t[35]!==h||t[36]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-5`,children:[p,m,h,g]}),t[33]=p,t[34]=m,t[35]=h,t[36]=g,t[37]=_):_=t[37],_}function mr(e){return e.vision}function hr(e){let t=(0,en.c)(9),{data:n,error:r}=X(`settings-agent-defaults`,it);if(r&&!n){let e=String(r),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e}),t[0]=e,t[1]=n),n}if(!n){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Te,{className:`h-32 rounded-xl`}),t[2]=e):e=t[2],e}let i;t[3]===n.defaults.models?i=t[4]:(i=JSON.stringify(n.defaults.models),t[3]=n.defaults.models,t[4]=i);let a;return t[5]!==n.defaults||t[6]!==e||t[7]!==i?(a=(0,$.jsx)(gr,{...e,initial:n.defaults},i),t[5]=n.defaults,t[6]=e,t[7]=i,t[8]=a):a=t[8],a}function gr(e){let t=(0,en.c)(36),{initial:n,capability:r,zh:i,disabled:a,onPendingChange:o}=e,s;t[0]===n?s=t[1]:(s=()=>structuredClone(n),t[0]=n,t[1]=s);let[c,l]=(0,Q.useState)(s),u;t[2]===n?u=t[3]:(u=()=>structuredClone(n),t[2]=n,t[3]=u);let[d,f]=(0,Q.useState)(u),p;t[4]===c.models?p=t[5]:(p=JSON.stringify(c.models),t[4]=c.models,t[5]=p);let m;t[6]===d.models?m=t[7]:(m=JSON.stringify(d.models),t[6]=d.models,t[7]=m);let h=p!==m,g;t[8]!==n.models||t[9]!==i?(g=async e=>{let t=await it();if(JSON.stringify(t.defaults.models)!==JSON.stringify(n.models))throw Error(i?`模型设置已变化,请刷新后重试。`:`Model settings changed. Refresh before retrying.`);let r=await rt({...t.defaults,models:e.models},{scope:`models`,expectedModels:n.models});f(r.defaults),await dt()},t[8]=n.models,t[9]=i,t[10]=g):g=t[10];let _=g,v;t[11]!==h||t[12]!==c||t[13]!==_?(v={value:c,dirty:h,onSave:_,delayMs:0},t[11]=h,t[12]=c,t[13]=_,t[14]=v):v=t[14];let y=Rt(v),b=h||y.status===`saving`||!!y.error,x,S;t[15]!==o||t[16]!==b?(x=()=>(o(b),()=>o(!1)),S=[b,o],t[15]=o,t[16]=b,t[17]=x,t[18]=S):(x=t[17],S=t[18]),(0,Q.useEffect)(x,S);let C=a||y.status===`saving`,w;t[19]!==y.error||t[20]!==y.status?(w=(0,$.jsx)(Lt,{status:y.status,error:y.error}),t[19]=y.error,t[20]=y.status,t[21]=w):w=t[21];let T;t[22]!==y.error||t[23]!==y.retry||t[24]!==i?(T=y.error?(0,$.jsx)(Z,{variant:`secondary`,onClick:y.retry,children:i?`重试保存`:`Retry saving`}):null,t[22]=y.error,t[23]=y.retry,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==r||t[27]!==c||t[28]!==i?(E=(0,$.jsx)(pr,{capability:r,draft:c,setDraft:l,zh:i}),t[26]=r,t[27]=c,t[28]=i,t[29]=E):E=t[29];let D;return t[30]!==y.onBlurCapture||t[31]!==w||t[32]!==T||t[33]!==E||t[34]!==C?(D=(0,$.jsxs)(`fieldset`,{disabled:C,onBlurCapture:y.onBlurCapture,className:`min-w-0 space-y-3`,children:[w,T,E]}),t[30]=y.onBlurCapture,t[31]=w,t[32]=T,t[33]=E,t[34]=C,t[35]=D):D=t[35],D}function _r(e){return e.status===`ready`?`ready`:e.status===`disabled`?`off`:e.status===`degraded`?`degraded`:e.rejected?.length?`misconfigured`:`not-configured`}function vr(e,t){if(e.startsWith(`agentCatalog.defaults.models`))return{label:t?`模型与能力`:`Models and capabilities`,href:`/settings/capabilities/models`};let n=e.match(/^agentCatalog\.agents\.([^.]+)\.models/);return n?.[1]?{label:t?`智能体 ${n[1]}`:`Agent ${n[1]}`,href:nt(n[1])}:e.startsWith(`sessions.`)?{label:t?`会话模型覆盖`:`Session model override`,href:`/settings/sessions`}:{label:e,href:`/settings/agent-defaults`}}function yr(e,t){switch(e){case`computer-use`:return{guidance:t?`选择兼容的电脑控制模型;本机权限需单独授权`:`Select a compatible computer model; local access requires separate approval`,action:t?`配置电脑控制`:`Configure computer use`};case`vision`:return{guidance:t?`接入支持图片理解的模型服务`:`Connect a model service that supports vision`,action:t?`去接入模型`:`Connect model`};case`image-generation`:return{guidance:t?`选择图片模型并配置所需凭据`:`Choose an image model and configure its credentials`,action:t?`去配置图片生成`:`Configure image generation`};case`stt`:return{guidance:t?`选择语音识别服务,或安装自管 STT 插件`:`Choose a speech-to-text service or install a self-managed STT plugin`,action:t?`去配置语音识别`:`Configure speech-to-text`};case`tts`:return{guidance:t?`选择语音合成服务并完成凭据配置`:`Choose a text-to-speech service and configure its credentials`,action:t?`去配置语音合成`:`Configure text-to-speech`}}}async function br(){let e=await u(d(`/api/models/catalog`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}async function xr(){let e=await u(d(`/api/capabilities/readiness`)),t=await e.json().catch(()=>null);if(!e.ok||!t?.ok||!t.payload)throw Error(t?.error?.message??`HTTP ${e.status}`);return t.payload}function Sr({showCapabilities:e=!0,embedded:t=!1}={}){let n=p(e=>e.language)===`zh`,{data:r,error:i,isLoading:a}=X(pt,br,{revalidateOnFocus:!0,refreshInterval:6e4}),{data:o}=X(mt,xr,{revalidateOnFocus:!1}),[s,c]=(0,Q.useState)(!1),[f,m]=(0,Q.useState)(null),h=Object.values(r?.sources??{}),g=h.reduce((e,t)=>e+t.models.filter(e=>e.availability===`available`).length,0),_=(r?.references??[]).filter(e=>e.availability===`unavailable`),v=r?.sync.lastSuccessAt??Math.max(0,...h.map(e=>e.lastSuccessAt)),y=!!i,b=r?.sync.sourceErrors??{},x=[...r?.sync.lastError?[[`catalog`,r.sync.lastError]]:[],...Object.entries(b),...f?[[`refresh`,f]]:[],...i instanceof Error?[[`load`,i.message]]:[]],S=r?.sync.lastAttemptAt??v,w=Object.entries(o?.capabilities??{}).filter(([e])=>e!==`computer-use`||qe()),T=w.some(([,e])=>{let t=_r(e);return t===`degraded`||t===`misconfigured`}),E=w.filter(([,e])=>_r(e)===`ready`).length,D=(0,Q.useRef)(null);if((0,Q.useEffect)(()=>{T&&!a&&D.current?.setAttribute(`open`,``)},[T,a]),a)return(0,$.jsx)(Te,{className:`h-24 w-full rounded-2xl`});let k=async()=>{c(!0),m(null);try{let e=await u(d(`/api/models/catalog/refresh`),{method:`POST`});if(!e.ok)throw Error(`HTTP ${e.status}`);await dt()}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}},A=(0,$.jsx)(`div`,{className:`mt-2 space-y-1 rounded-lg bg-surface-base/45 p-2 font-mono text-[11px] leading-5`,"aria-label":n?`同步错误详情`:`Sync error details`,children:x.map(([e,t],n)=>(0,$.jsxs)(`p`,{className:`break-words`,children:[e,`: `,t]},`${e}-${n}`))}),j=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{children:n?`${h.length} 个来源,${g} 个可用模型${v?` · 最近同步 ${new Date(v).toLocaleString()}`:``}`:`${h.length} sources, ${g} available models${v?` · Last synced ${new Date(v).toLocaleString()}`:``}`}),x.length>0?t?(0,$.jsxs)(`details`,{className:`mt-2 rounded-lg bg-surface-base/45 p-2`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer rounded text-xs font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),A]}):A:null]}),(0,$.jsxs)(Z,{className:`shrink-0`,type:`button`,variant:`secondary`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(pe,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(_e,{className:`size-4`,"aria-hidden":!0}),s?n?`刷新中…`:`Refreshing…`:n?`刷新目录`:`Refresh catalog`]})]});return(0,$.jsxs)(`section`,{className:t?`mt-4 border-t border-edge-subtle pt-1`:`rounded-xl bg-surface-hover/25 p-4 sm:p-5`,children:[e?(0,$.jsxs)(`details`,{ref:D,className:`group`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer list-none rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,$.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2`,children:[T?(0,$.jsx)(Se,{className:`size-4 text-amber-500`,"aria-hidden":!0}):E===w.length&&w.length>0?(0,$.jsx)(M,{className:`size-4 text-emerald-500`,"aria-hidden":!0}):(0,$.jsx)(N,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-semibold text-fg`,children:n?`可选能力`:`Optional capabilities`}),(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs font-normal text-fg-muted`,children:n?`${E}/${w.length} 项已配置,不影响基础聊天功能`:`${E} of ${w.length} configured · Not required for chat`})]}),(0,$.jsx)(O,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-open:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]})}),o?(0,$.jsx)(`div`,{className:`mt-3 grid gap-1 sm:grid-cols-2`,children:Object.entries(o.capabilities).map(([e,t])=>{if(e===`computer-use`&&!qe())return null;let r=e===`vision`?n?`图片理解`:`Vision`:e===`image-generation`?n?`图片生成`:`Image generation`:e===`computer-use`?n?`电脑控制模型`:`Computer use model`:e.toUpperCase(),i=t.selectionSource!==`explicit-config`,a=_r(t),o=a===`degraded`||a===`misconfigured`,s=yr(e,n),c=(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 text-xs font-medium text-fg`,children:r}),(0,$.jsx)(`span`,{className:a===`ready`?`shrink-0 text-xs text-emerald-600 dark:text-emerald-400`:a===`off`||a===`not-configured`?`shrink-0 text-xs text-fg-muted`:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,children:a===`ready`?e===`computer-use`?n?`已配置`:`Configured`:n?`可用`:`Ready`:a===`off`?n?`已关闭`:`Off`:a===`not-configured`?n?`未配置`:`Not configured`:a===`degraded`?n?`正在使用备用方案`:`Using fallback`:n?`需处理`:`Needs attention`})]}),(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted`,title:t.primary?`${t.primary.provider}/${t.primary.model}`:void 0,children:t.primary?`${i?n?`自动`:`Auto`:n?`显式`:`Explicit`} · ${t.primary.provider}/${t.primary.model}`:a===`not-configured`?n?`可稍后按需配置`:`Set up later if needed`:n?`已配置的模型不可用`:`The configured model is unavailable`}),o?(0,$.jsxs)(`div`,{className:`mt-2 rounded-lg bg-amber-500/10 p-2`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-amber-700 dark:text-amber-300`,children:t.status===`degraded`?n?`当前配置不可用,正在使用备用方案。${s.guidance}`:`The current configuration is unavailable, so a fallback is in use. ${s.guidance}.`:s.guidance}),(0,$.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-xs font-medium text-accent`,children:[s.action,(0,$.jsx)(C,{className:`size-3.5`,"aria-hidden":!0})]})]}):null]}),u={"aria-label":o?`${r}:${s.action}`:`${n?`配置`:`Configure`} ${r}`,className:Y(`rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors`,o?`bg-amber-500/5 hover:bg-amber-500/10`:`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`)};if(e===`computer-use`)return(0,$.jsx)(l,{to:`/settings/computer-use`,...u,children:c},e);let d={vision:`vision`,"image-generation":`image`,stt:`transcription`,tts:`speech`}[e];return(0,$.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,...u,onClick:()=>Fe(d,o?`services`:`settings`),children:c},e)})}):null]}):null,_.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-2`,"aria-live":`polite`,children:_.map(e=>(0,$.jsx)(`div`,{className:`rounded-lg border border-amber-500/25 bg-amber-500/5 p-3`,children:(()=>{let t=e.ref.split(`/`)[0]??``,r=!!b[t],i=vr(e.locations[0]??``,n);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(Se,{className:`mt-0.5 size-4 shrink-0 text-amber-500`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`p`,{className:`break-words text-sm font-medium text-fg`,children:[e.ref,(0,$.jsx)(`span`,{className:`ml-2 font-normal text-amber-700 dark:text-amber-300`,children:r?n?`暂时无法验证`:`Temporarily unverified`:n?`不可用`:`Unavailable`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:[r?n?`模型目录同步暂时失败,当前状态可能已过期;不会影响其他可用模型。`:`Catalog sync temporarily failed, so this status may be stale. Other available models are unaffected.`:n?`此模型已无法从当前配置中解析,使用它的功能可能失败。`:`This model no longer resolves from the current configuration. Features using it may fail.`,S?` · ${n?`最近检测`:`Last checked`} ${new Date(S).toLocaleString()}`:``]}),e.suggestedRef?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?`可替换为`:`Suggested replacement`,`:`,(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:e.suggestedRef})]}):null]})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1`,children:[(0,$.jsxs)(Z,{className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,disabled:s,onClick:()=>void k(),children:[s?(0,$.jsx)(pe,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0}),s?n?`检测中…`:`Checking…`:n?`重新检测`:`Check again`]}),(0,$.jsx)(Z,{asChild:!0,className:`px-2.5 py-1.5 text-xs`,variant:`ghost`,children:(0,$.jsxs)(l,{to:i.href,children:[(0,$.jsx)(Ce,{className:`size-3.5`,"aria-hidden":!0}),e.suggestedRef?n?`更换模型`:`Replace model`:n?`调整配置`:`Adjust configuration`]})}),(0,$.jsxs)(`details`,{className:`group/references`,children:[(0,$.jsxs)(`summary`,{className:`touch-target inline-flex cursor-pointer list-none items-center gap-1 rounded-xl px-2.5 py-1.5 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n?`查看 ${e.locations.length} 处引用`:`View ${e.locations.length} ${e.locations.length===1?`reference`:`references`}`,(0,$.jsx)(O,{className:`size-3.5 transition-transform group-open/references:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 pl-2 text-xs text-fg-muted`,children:e.locations.map(e=>{let t=vr(e,n);return(0,$.jsx)(`li`,{children:(0,$.jsx)(l,{className:`inline-flex rounded px-1.5 py-1 text-accent hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,to:t.href,title:e,children:t.label})},e)})})]})]})]})})()},e.ref))}):null,y||f?(0,$.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:y?n?`暂时无法读取模型状态,请重新检测;详细信息可在高级诊断中查看。`:`Model status is temporarily unavailable. Check again; details are available in Advanced diagnostics.`:n?`重新检测失败,请稍后重试;详细信息可在高级诊断中查看。`:`The check failed. Try again later; details are available in Advanced diagnostics.`}):null,t?j:(0,$.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`summary`,{className:`min-h-8 cursor-pointer rounded-md py-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`高级诊断`:`Advanced diagnostics`}),j]})]})}var Cr=()=>d(`/api/music-generation/settings`),wr=new Map([[`mureka-cn`,`https://platform.mureka.cn/`],[`mureka-global`,`https://platform.mureka.ai/`]]),Tr={secretId:`SecretId`,secretKey:`SecretKey`},Er=[`secretId`,`secretKey`];function Dr(e,t){return e===`mureka-cn`?t?`Mureka 中国站`:`Mureka China`:e===`mureka-global`?t?`Mureka 国际站`:`Mureka Global`:e===`tencent-mps`?t?`腾讯云媒体处理(MPS)`:`Tencent Cloud MPS`:e===`xopc-cloud`?`XOPC Cloud`:e}function Or({zh:e,disabled:t,onManageCloud:n}){let{data:r,error:i,mutate:a}=X(Cr(),m),{mutate:o}=Oe(),[s,c]=(0,Q.useState)(),[l,u]=(0,Q.useState)(),[f,p]=(0,Q.useState)(),[h,C]=(0,Q.useState)({}),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(``),M=r?.models.find(e=>e.ref===r.modelRef),N=r?.models.find(e=>e.ref===l?.modelRef),P=t=>t===`song`?e?`歌曲`:`Song`:e?`纯音乐`:`Instrumental`,F=s?r?.credentials[s]:void 0,I=s?wr.get(s):void 0,L=s===$t,R=s?`${Cr()}/credentials/${encodeURIComponent(s)}`:``,ee=f??(F===`saved`?`••••••••••••`:``),z=f?.trim()??``,B=L?Er.every(e=>{let t=h[e]?.trim()??``;return t&&!Ue(t)}):!!(z&&!Ue(z)),V=t=>t===`saved`?e?`已保存密钥`:`Credentials saved`:t===`oauth`?e?`已连接`:`Connected`:t===`environment`?e?`使用环境变量`:`Using environment variables`:e?`待连接`:`Connection needed`;async function H(e,n,r){if(t||T)return!1;E(!0),O(``);try{let t=await m(e,{method:n,body:r&&JSON.stringify(r)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/music-generation/sessions/`))),!0}catch(e){return O(e instanceof Error?e.message:String(e)),!1}finally{E(!1)}}function U(){c(void 0),u(void 0),p(void 0),C({}),O(``)}return(0,$.jsxs)(`div`,{"data-capability":`music`,children:[(0,$.jsx)(Gn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`创作音乐`:`Music generation`}),M&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:V(r?.credentials[M.providerId])})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`生成带歌词的歌曲和纯音乐`:`Generate songs with lyrics and instrumental tracks`})]}),picker:r&&M?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择音乐生成模型`:`Select music generation model`,value:r.modelRef,allowEmpty:!1,triggerClassName:`min-h-11`,disabled:t||T,onChange:e=>{e!==r.modelRef&&H(Cr(),`PUT`,{modelRef:e})},options:r.models.map(t=>({value:t.ref,label:t.name,group:Dr(t.providerId,e)}))}),(0,$.jsx)(Wn,{name:Dr(M.providerId,e),manageLabel:e?`管理服务`:`Manage services`,disabled:t||T,onManage:M.providerId===`xopc-cloud`?n:()=>{O(``),c(M.providerId)}}),M.creditMicroPerTrack&&(0,$.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[De(String(M.creditMicroPerTrack)),` `,e?`Credits / 首`:`Credits / track`]}),T&&!s&&!l&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!s&&!l&&D&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:D})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`音乐模型加载失败`:`Could not load music models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Te,{className:`h-11 w-full rounded-xl`}),actions:r&&M&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||T,onClick:()=>{O(``),u({modelRef:r.modelRef,mode:r.defaults?.mode??M.modes[0]??`song`})},children:e?`设置`:`Settings`})}),(0,$.jsx)(S,{open:!!l,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(20rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`音乐生成设置`:`Music generation settings`}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:N&&[Dr(N.providerId,e),N.name].join(` · `)})]}),l&&N&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await H(Cr(),`PATCH`,l)&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsx)(`label`,{htmlFor:`music-default-mode`,className:`block font-medium text-fg`,children:e?`默认创作类型`:`Default creation type`}),(0,$.jsx)(k,{id:`music-default-mode`,value:l.mode,disabled:T,onChange:e=>u({...l,mode:e.target.value}),children:N.modes.map(e=>(0,$.jsx)(A,{value:e,children:P(e)},e))}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`聊天中未指定类型时使用。`:`Used when the chat request does not specify a type.`}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})}),(0,$.jsx)(S,{open:!!s,onOpenChange:e=>{!e&&!T&&U()},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(23rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:s&&Dr(s,e)}),(0,$.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:V(F)})]}),s&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),B&&await H(R,`PUT`,L?h:{apiKey:z})&&U()},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto px-5 py-4`,children:[L?(0,$.jsxs)($.Fragment,{children:[Er.map(n=>{let r=h[n]??(F===`saved`?`••••••••••••`:``),i=Tr[n];return(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{htmlFor:`music-provider-${n}`,className:`block text-sm font-medium text-fg`,children:i}),(0,$.jsx)(J,{id:`music-provider-${n}`,autoComplete:`new-password`,value:r,disabled:t||T,onChange:e=>C(t=>({...t,[n]:Ue(r)?e.replace(/^•+/,``):e})),labels:e?{show:`显示 ${i}`,hide:`隐藏 ${i}`,copy:`复制 ${i}`,copied:`已复制`}:{show:`Show ${i}`,hide:`Hide ${i}`,copy:`Copy ${i}`,copied:`Copied`},reveal:F===`saved`?()=>m(R,{method:`POST`,body:JSON.stringify({field:n})}).then(e=>e.value):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的密钥。`:`Could not load the saved credential.`})]},n)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:[(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/mps`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`开通腾讯云 MPS`:`Activate Tencent Cloud MPS`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]}),(0,$.jsxs)(`a`,{href:`https://console.cloud.tencent.com/cam/capi`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-accent-fg hover:underline`,children:[e?`管理腾讯云 API 密钥`:`Manage Tencent Cloud API keys`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`请填写同一对密钥。更新时需重新填写两项。`:`Enter a matching pair. Fill in both fields when replacing credentials.`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,$.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`music-provider-api-key`,children:`API Key`}),I&&(0,$.jsxs)(`a`,{href:I,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-8 items-center gap-1 rounded-sm text-xs text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e?`获取 API Key`:`Get an API key`,(0,$.jsx)(w,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,$.jsx)(J,{id:`music-provider-api-key`,autoComplete:`new-password`,value:ee,disabled:t||T,onChange:e=>p(Ue(ee)?e.replace(/^•+/,``):e),placeholder:e?`粘贴 API Key`:`Paste your API key`,labels:e?{show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`}:{show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`},reveal:F===`saved`?()=>_t(s).then(e=>e.apiKey):void 0,allowUnrevealedCopy:!0,loadFailedLabel:e?`无法读取已保存的 API Key。`:`Could not load the saved API key.`,notInConfigFile:e?`网关中没有可查看的密钥。`:`No saved key is available to show.`},s),I&&(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:e?`登录对应站点的 Mureka 开放平台,在「API Keys」创建密钥,然后粘贴到这里并保存。`:`Sign in to this region’s Mureka API platform, create a key under API Keys, then paste it here and save.`})]}),D&&(0,$.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-danger`,children:D})]}),(0,$.jsxs)(`footer`,{className:`flex items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[F===`saved`&&(0,$.jsx)(Z,{variant:`ghost`,type:`button`,className:`mr-auto`,disabled:T,onClick:async()=>{await H(R,`DELETE`)&&U()},children:e?`移除密钥`:`Remove key`}),(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:T,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:t||T||!B,children:T?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function kr({zh:e,disabled:t,onManage:n}){let{data:r,error:i,mutate:a}=ut(),{mutate:o}=Oe(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(null),h=e=>r?.models?.[e]??E[e],C=r&&h(r.modelRef),w=C&&r?.configured[C.provider],O=t=>t===`dashscope-cn`?e?`阿里云百炼`:`Alibaba Cloud Bailian`:t===`xopc-cloud`?`XOPC Cloud`:e?`火山方舟`:`Volcengine Ark`;async function M(e,n){if(t||s)return!1;c(!0),u(``);try{let t=await m(d(ft),{method:e,body:JSON.stringify(n)});return await a(t,{revalidate:!1}),o(e=>typeof e==`string`&&e.startsWith(d(`/api/video-generation/sessions/`))),!0}catch(e){return u(e instanceof Error?e.message:String(e)),!1}finally{c(!1)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{"data-capability":`video`,children:(0,$.jsx)(Gn,{actionColumn:!0,description:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e?`生成视频`:`Video generation`}),C&&!w&&(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e?`待连接`:`Connection needed`})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:e?`文生视频和图生视频`:`Text-to-video and image-to-video`})]}),picker:r&&C?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{placeholder:e?`选择模型`:`Choose a model`,ariaLabel:e?`选择视频生成模型`:`Select video generation model`,value:r.modelRef,triggerClassName:`min-h-11`,allowEmpty:!1,disabled:t||s,onChange:e=>{e!==r.modelRef&&M(`PUT`,{modelRef:e})},options:(r.modelRefs??D).map(e=>{let t=h(e);return{value:e,label:t.name,group:O(t.provider)}})}),(0,$.jsx)(Wn,{name:O(C.provider),manageLabel:e?`管理服务`:`Manage services`,onManage:()=>n(C.provider),disabled:t||s}),s&&(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:e?`正在切换…`:`Switching…`}),!f&&l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}):i?(0,$.jsxs)(`div`,{role:`alert`,className:`text-sm text-danger`,children:[e?`视频模型加载失败`:`Could not load video models`,(0,$.jsx)(Z,{variant:`ghost`,onClick:()=>void a(),children:e?`重试`:`Retry`})]}):(0,$.jsx)(Te,{className:`h-11 w-full rounded-xl`}),actions:r&&C&&(0,$.jsx)(Z,{variant:`ghost`,className:`min-h-11`,disabled:t||s,onClick:()=>{u(``),p({modelRef:r.modelRef,...r.defaults})},children:e?`设置`:`Settings`})})}),(0,$.jsx)(S,{open:!!f,onOpenChange:e=>{!e&&!s&&(p(null),u(``))},children:(0,$.jsxs)(y,{children:[(0,$.jsx)(g,{className:`fixed inset-0 z-[150] bg-scrim`}),(0,$.jsxs)(b,{className:`fixed left-1/2 top-1/2 z-[151] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,children:[(0,$.jsxs)(`header`,{className:`border-b border-edge px-5 py-4`,children:[(0,$.jsx)(x,{className:`font-semibold text-fg`,children:e?`视频生成设置`:`Video generation settings`}),(0,$.jsxs)(_,{className:`mt-1 text-sm text-fg-muted`,children:[f&&h(f.modelRef).name,` · `,e?`新任务的默认参数`:`Defaults for new jobs`]})]}),f&&(0,$.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:async e=>{e.preventDefault(),await M(`PATCH`,f)&&p(null)},children:[(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4 text-sm`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认时长`:`Default duration`}),(0,$.jsx)(k,{"aria-label":e?`默认时长`:`Default duration`,value:String(f.duration),disabled:s,onChange:e=>p({...f,duration:Number(e.target.value)}),children:T(h(f.modelRef)).map(t=>(0,$.jsx)(A,{value:String(t),children:t===-1?e?`自动`:`Auto`:`${t}s`},t))})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`p`,{children:e?`默认分辨率`:`Default resolution`}),(0,$.jsx)(k,{"aria-label":e?`默认分辨率`:`Default resolution`,value:f.resolution,disabled:s,onChange:e=>p({...f,resolution:e.target.value}),children:h(f.modelRef).resolutions.map(e=>(0,$.jsx)(A,{value:e,children:e.toLowerCase()},e))})]}),l&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:l})]}),(0,$.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,$.jsx)(v,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,disabled:s,children:e?`取消`:`Cancel`})}),(0,$.jsx)(Z,{type:`submit`,variant:`primary`,disabled:s,children:s?e?`正在保存…`:`Saving…`:e?`保存`:`Save`})]})]})]})]})})]})}function Ar(e){let t=(0,en.c)(183),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{inlineUse:r,inlineView:i,onViewChange:u,onPendingChange:d}=n,f=i===void 0?`settings`:i,m=p(Pr),g=m===`zh`,_;t[2]===m?_=t[3]:(_=h(m),t[2]=m,t[3]=_);let v=_.capabilitiesSettings,{capability:y}=s(),[b,x]=a(),{state:S}=o(),C;t[4]===b?C=t[5]:(C=ct(b.get(`returnTo`)),t[4]=b,t[5]=C);let w=C,[T,E]=(0,Q.useState)(),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(!1),F=j||N||k,[I,L]=(0,Q.useState)(!1),[R,ee]=(0,Q.useState)(null),z=W(),B;t[6]===z.cards?B=t[7]:(B=z.cards.some(Nr),t[6]=z.cards,t[7]=B);let V=B,H=Mr,U,te;t[8]!==d||t[9]!==F?(U=()=>(d?.(F),()=>d?.(!1)),te=[F,d],t[8]=d,t[9]=F,t[10]=U,t[11]=te):(U=t[10],te=t[11]),(0,Q.useEffect)(U,te);let ne,re;t[12]!==y||t[13]!==r||t[14]!==S||t[15]!==b||t[16]!==x?(ne=()=>{if(r||y!==`models`)return;let e=ot(b.get(`configure`));if(!e&&b.get(`add`)!==`1`)return;let t=window.setTimeout(()=>{e?Fe(e,b.get(`tab`)===`services`?`services`:`settings`):L(!0);let t=new URLSearchParams(b);t.delete(`configure`),t.delete(`tab`),t.delete(`add`),x(t,{replace:!0,state:S})},0);return()=>window.clearTimeout(t)},re=[y,r,b,x,S],t[12]=y,t[13]=r,t[14]=S,t[15]=b,t[16]=x,t[17]=ne,t[18]=re):(ne=t[17],re=t[18]),(0,Q.useEffect)(ne,re);let ie;t[19]!==r||t[20]!==u||t[21]!==F?(ie=e=>{if(!F){if(!r){Fe(e,`services`);return}u?.(`services`),E(void 0)}},t[19]=r,t[20]=u,t[21]=F,t[22]=ie):ie=t[22];let oe=ie,se;t[23]===u?se=t[24]:(se=e=>{H(),u?.(`settings`),E(e)},t[23]=u,t[24]=se);let ce=se;if(r){let e=f===`services`,n=N||k,i;t[25]!==r||t[26]!==oe||t[27]!==z||t[28]!==n||t[29]!==g?(i=(0,$.jsx)(Jn,{data:z,zh:g,onlyUse:r,disabled:n,onPendingChange:M,onChange:oe}),t[25]=r,t[26]=oe,t[27]=z,t[28]=n,t[29]=g,t[30]=i):i=t[30];let a;t[31]!==e||t[32]!==i?(a=(0,$.jsx)(`div`,{hidden:e,children:i}),t[31]=e,t[32]=i,t[33]=a):a=t[33];let o;t[34]!==T||t[35]!==r||t[36]!==f||t[37]!==g?(o=T===r&&f===`settings`?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:g?`服务设置已保存`:`Service settings saved`}):null,t[34]=T,t[35]=r,t[36]=f,t[37]=g,t[38]=o):o=t[38];let s=f!==`services`,c;t[39]!==ce||t[40]!==r?(c=()=>ce(r),t[39]=ce,t[40]=r,t[41]=c):c=t[41];let l;t[42]!==v.addProviderDialog||t[43]!==r||t[44]!==m||t[45]!==z||t[46]!==c?(l=(0,$.jsx)(Mn,{inline:!0,onEditingChange:O,use:r,data:z,language:m,labels:v.addProviderDialog,onPendingChange:A,onSaved:c},r),t[42]=v.addProviderDialog,t[43]=r,t[44]=m,t[45]=z,t[46]=c,t[47]=l):l=t[47];let d;t[48]!==ce||t[49]!==D||t[50]!==r||t[51]!==z.builtinRows||t[52]!==g?(d=r===`transcription`||r===`speech`?(0,$.jsx)(`div`,{hidden:D,children:(0,$.jsx)(Hn,{kind:r===`transcription`?`stt`:`tts`,modelServiceIds:z.builtinRows.map(jr),zh:g,onPendingChange:A,onSaved:()=>ce(r)},r)}):null,t[48]=ce,t[49]=D,t[50]=r,t[51]=z.builtinRows,t[52]=g,t[53]=d):d=t[53];let p;t[54]!==D||t[55]!==r||t[56]!==u||t[57]!==g?(p=r===`conversation`&&!D&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge p-3`,children:[(0,$.jsx)(`span`,{className:`text-sm text-fg`,children:`Boson AI · Higgs Realtime`}),(0,$.jsx)(Z,{variant:`secondary`,onClick:()=>u?.(`settings`),children:g?`配置 Boson`:`Configure Boson`})]}),t[54]=D,t[55]=r,t[56]=u,t[57]=g,t[58]=p):p=t[58];let h;t[59]!==ce||t[60]!==r?(h=r===`image`?(0,$.jsx)(_n,{connectOnly:!0,onPendingChange:A,onConnected:()=>ce(r)}):null,t[59]=ce,t[60]=r,t[61]=h):h=t[61];let _;t[62]!==k||t[63]!==s||t[64]!==l||t[65]!==d||t[66]!==p||t[67]!==h?(_=(0,$.jsxs)(`fieldset`,{hidden:s,disabled:k,className:`min-w-0 space-y-3`,children:[l,d,p,h]}),t[62]=k,t[63]=s,t[64]=l,t[65]=d,t[66]=p,t[67]=h,t[68]=_):_=t[68];let y=f===`services`,b;t[69]!==k||t[70]!==r||t[71]!==j?(b=r===`transcription`||r===`speech`||r===`conversation`?(0,$.jsx)(ze,{capability:r,onPendingChange:P,disabled:j||k},r):null,t[69]=k,t[70]=r,t[71]=j,t[72]=b):b=t[72];let x;t[73]!==k||t[74]!==r||t[75]!==j||t[76]!==g?(x=r===`chat`||r===`vision`||r===`image`?(0,$.jsx)(hr,{capability:r,zh:g,disabled:j||k,onPendingChange:P}):null,t[73]=k,t[74]=r,t[75]=j,t[76]=g,t[77]=x):x=t[77];let S;t[78]!==r||t[79]!==g?(S=r===`background`?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:g?`使用所选模型执行自动化、定时和无人值守任务。此设置不会启用任务,也不会自动改用其他计费服务。`:`Use the selected model for automations, schedules and unattended tasks. This does not enable tasks or automatically switch billing services.`}):null,t[78]=r,t[79]=g,t[80]=S):S=t[80];let C;t[81]!==y||t[82]!==b||t[83]!==x||t[84]!==S?(C=(0,$.jsxs)(`div`,{hidden:y,className:`space-y-4`,children:[b,x,S]}),t[81]=y,t[82]=b,t[83]=x,t[84]=S,t[85]=C):C=t[85];let w;t[86]!==oe||t[87]!==o||t[88]!==_||t[89]!==C?(w=(0,$.jsxs)(Re.Provider,{value:oe,children:[o,_,C]}),t[86]=oe,t[87]=o,t[88]=_,t[89]=C,t[90]=w):w=t[90];let E;return t[91]!==a||t[92]!==w?(E=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[a,w]}),t[91]=a,t[92]=w,t[93]=E):E=t[93],E}if(y===`search`){let e;t[94]===m?e=t[95]:(e=h(m),t[94]=m,t[95]=e);let n;t[96]===e.nav.settingsSearch?n=t[97]:(n=(0,$.jsx)(Nt,{title:e.nav.settingsSearch}),t[96]=e.nav.settingsSearch,t[97]=n);let r;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(On,{}),t[98]=r):r=t[98];let i;return t[99]===n?i=t[100]:(i=(0,$.jsxs)(Mt,{children:[n,r]}),t[99]=n,t[100]=i),i}if(y!==`models`){let e;return t[101]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(c,{to:`/settings/capabilities/models`,replace:!0}),t[101]=e):e=t[101],e}let K=g?`模型与能力`:`Models and capabilities`,le=g?`按用途选择模型,点击服务商名称管理连接。`:`Choose models by purpose. Select a provider name to manage its connection.`,q;t[102]===m?q=t[103]:(q=Ke(m,`configuration`),t[102]=m,t[103]=q);let J;t[104]!==v.docsLink||t[105]!==q?(J=(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(`a`,{href:q,target:`_blank`,rel:`noreferrer`,className:`inline-flex min-h-11 items-center rounded-lg px-2 text-xs text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:v.docsLink})}),t[104]=v.docsLink,t[105]=q,t[106]=J):J=t[106];let ue;t[107]!==K||t[108]!==le||t[109]!==J?(ue=(0,$.jsx)(Nt,{title:K,subtitle:le,actions:J}),t[107]=K,t[108]=le,t[109]=J,t[110]=ue):ue=t[110];let de;t[111]!==w||t[112]!==g?(de=w?(0,$.jsx)(l,{to:w,className:`text-sm text-accent-fg hover:underline`,children:w===`/settings/phone-use`?g?`返回手机控制并测试模型`:`Return to phone control and test the model`:g?`返回原来的工作`:`Return to your work`}):null,t[111]=w,t[112]=g,t[113]=de):de=t[113];let fe;t[114]!==w||t[115]!==g?(fe=w?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:w===`/settings/phone-use`?g?`正在为手机控制连接模型服务;此处保存服务设置后,还需返回选择并测试手机模型。`:`Connect a model service for phone control, then return to select and test the phone model.`:g?`正在为原来的工作配置模型。服务保存、模型选择和实际运行验证分别生效。`:`Configure models for your work. Saving a service, choosing a model and verifying a run are separate steps.`}):null,t[114]=w,t[115]=g,t[116]=fe):fe=t[116];let pe;t[117]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>ee({providerId:e,isCustom:!1}),t[117]=pe):pe=t[117];let me;t[118]!==F||t[119]!==g?(me=(0,$.jsx)(kr,{zh:g,disabled:F,onManage:pe}),t[118]=F,t[119]=g,t[120]=me):me=t[120];let he;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>ee({providerId:`xopc-cloud`,isCustom:!1}),t[121]=he):he=t[121];let ge;t[122]!==F||t[123]!==g?(ge=(0,$.jsx)(Or,{zh:g,disabled:F,onManageCloud:he}),t[122]=F,t[123]=g,t[124]=ge):ge=t[124];let _e;t[125]===F?_e=t[126]:(_e=e=>{F||Fe(e)},t[125]=F,t[126]=_e);let ve;t[127]!==oe||t[128]!==z||t[129]!==F||t[130]!==me||t[131]!==ge||t[132]!==_e||t[133]!==g?(ve=(0,$.jsx)(Jn,{data:z,zh:g,videoRow:me,musicRow:ge,disabled:F,onPendingChange:M,onChange:oe,onSettings:_e}),t[127]=oe,t[128]=z,t[129]=F,t[130]=me,t[131]=ge,t[132]=_e,t[133]=g,t[134]=ve):ve=t[134];let ye=g?`连接的服务`:`Connected services`,be;t[135]===ye?be=t[136]:(be=(0,$.jsx)(`h2`,{id:`model-services-heading`,className:`text-base font-semibold text-fg`,children:ye}),t[135]=ye,t[136]=be);let xe=g?`在这里管理账户和密钥;各项能力的模型与参数在上方调整。`:`Manage accounts and keys here. Choose models and adjust capability settings above.`,Se;t[137]===xe?Se=t[138]:(Se=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:xe}),t[137]=xe,t[138]=Se);let Ce;t[139]!==be||t[140]!==Se?(Ce=(0,$.jsxs)(`div`,{children:[be,Se]}),t[139]=be,t[140]=Se,t[141]=Ce):Ce=t[141];let we;t[142]!==v.xopcCloudAccount||t[143]!==V?(we=V?(0,$.jsx)(Qt,{labels:v.xopcCloudAccount,children:(0,$.jsx)(Sr,{showCapabilities:!1,embedded:!0})}):null,t[142]=v.xopcCloudAccount,t[143]=V,t[144]=we):we=t[144];let Y,Te;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>L(!0),Te=(e,t)=>ee({providerId:e,isCustom:t}),t[145]=Y,t[146]=Te):(Y=t[145],Te=t[146]);let Ee;t[147]!==v.connectedProviders||t[148]!==z?(Ee=(0,$.jsx)(ae,{labels:v.connectedProviders,data:z,onAdd:Y,onManage:Te}),t[147]=v.connectedProviders,t[148]=z,t[149]=Ee):Ee=t[149];let De;t[150]!==V||t[151]!==z.cards.length?(De=!V&&z.cards.length>0?(0,$.jsx)(Sr,{showCapabilities:!1}):null,t[150]=V,t[151]=z.cards.length,t[152]=De):De=t[152];let Oe;t[153]!==Ce||t[154]!==we||t[155]!==Ee||t[156]!==De?(Oe=(0,$.jsxs)(`section`,{"data-model-section":`services`,"aria-labelledby":`model-services-heading`,className:`space-y-4 scroll-mt-4 rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[Ce,we,Ee,De]}),t[153]=Ce,t[154]=we,t[155]=Ee,t[156]=De,t[157]=Oe):Oe=t[157];let X;t[158]!==ve||t[159]!==Oe||t[160]!==g?(X=(0,$.jsxs)(Qn,{zh:g,children:[ve,Oe]}),t[158]=ve,t[159]=Oe,t[160]=g,t[161]=X):X=t[161];let ke;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(ke=()=>{H(),L(!1)},t[162]=ke):ke=t[162];let Ae;t[163]!==I||t[164]!==v.addProviderDialog||t[165]!==m||t[166]!==z.builtinRows||t[167]!==z.customConfig?(Ae=(0,$.jsx)(G,{open:I,connectOnly:!0,onOpenChange:L,builtinRows:z.builtinRows,customConfig:z.customConfig,labels:v.addProviderDialog,language:m,onSaved:ke}),t[163]=I,t[164]=v.addProviderDialog,t[165]=m,t[166]=z.builtinRows,t[167]=z.customConfig,t[168]=Ae):Ae=t[168];let je;t[169]!==v.manageProviderDialog||t[170]!==m||t[171]!==R||t[172]!==z.allModels||t[173]!==z.builtinRows||t[174]!==z.customConfig?(je=R?(0,$.jsx)(or,{open:!0,onOpenChange:e=>{e||ee(null)},providerId:R.providerId,isCustom:R.isCustom,builtinRows:z.builtinRows,customConfig:z.customConfig,allModels:z.allModels,labels:v.manageProviderDialog,language:m,onSaved:H}):null,t[169]=v.manageProviderDialog,t[170]=m,t[171]=R,t[172]=z.allModels,t[173]=z.builtinRows,t[174]=z.customConfig,t[175]=je):je=t[175];let Me;return t[176]!==ue||t[177]!==de||t[178]!==fe||t[179]!==X||t[180]!==Ae||t[181]!==je?(Me=(0,$.jsxs)(Mt,{children:[ue,de,fe,X,Ae,je]}),t[176]=ue,t[177]=de,t[178]=fe,t[179]=X,t[180]=Ae,t[181]=je,t[182]=Me):Me=t[182],Me}function jr(e){return e.id}function Mr(){dt()}function Nr(e){return e.id===`xopc-cloud`&&!e.isCustom}function Pr(e){return e.language}export{Ar as CapabilitiesSettingsPanel};
|