@xopcai/xopc 0.0.424 → 0.0.425
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/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-AI081rxe.js → activity-store-CMw8qBuC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DupnTbL7.js → agent-avatar-dicebear-JI0YWOIm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-CmEj6Uqy.js → agent-avatar-display-YqmwzOSa.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-IEV5yKuu.js → agent-defaults-settings-panel-DlvjxWg6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-D_njOuFA.js → agent-plugin-dialog-OBueuQSc.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B_yg9nA3.js → agents-Cp6_5OOQ.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CUZUolwG.js → agents-admin-api-DLnmdC1h.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bpQ7yR10.js → api-Boc-CVh7.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CWWEVThO.js → api-bL7sxjAF.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C0_hxwgg.js → app-management-settings-panel-jIG5i7KE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CLh-qnCC.js → appearance-settings-BnaQW9Xd.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bjtm3Rgi.js → apps-page-C2WKUwtN.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-dGnstkhB.js → archive-plugin-DjboG3kA.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-MB2xCoFF.js → automation-api-CZqL9l_d.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DJQflY78.js → automation-result-state-DRd-X_Ai.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DXgBxVE2.js → automation-task-card-wbnR5i6N.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D3O7M2FH.js → automations-page-HyBQIfmn.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Dk3FVWoX.js → automations-workspace-D6cTOKr7.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-BrVJXmYf.js → binary-plugins-Bg8ARZUH.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dok4sfT3.js → block-editor-DKohqFAW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-PJbT3CxW.js → browser-automation-inputs-YeibTzw4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-kkpX1Q7K.js → browser-automations-page-BWNcbuz2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-Bg4wnkeA.js → browser-control-api-CDeuxy2x.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BrgX_Yb2.js → browser-settings-page-L0nBjfhG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cs6Jt5Gl.js → capabilities-BcQa8c9n.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BMaJizw4.js → capabilities-aT-QjNTl.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-D5hvAG6D.js → capabilities-page-DlpuHdHi.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BrEvm4IH.js → capabilities-settings-panel-pvqkN2-2.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-1jQgGVc9.js → channels-BUPtawh6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BAOWaUJf.js → chat-agents-api-B8JO6Tcj.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DeWrb9XR.js → chat-chart-block-DRtuFfF1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CafkCKOj.js → chat-page-BP0huA-W.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C544n0-R.js → chat-terminal-dock-Dkqq5FSL.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-D9PXzY8b.js → command-palette-api-qujvNqkK.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CYXfjpem.js → composer-payload-handoff-CYIhcczq.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DJmod8-w.js → computer-settings-page-8q4hRmoo.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-b46VH4uy.js → connected-providers-grid-CKZfhHSD.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BqDbTOTp.js → connector-service-page-DQaTI21R.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CwRuUnH4.js → connectors-api-BjypBp2g.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Mq9Bvoax.js → connectors-page-Lf1ZzaVn.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DWaT0IC0.js → date-picker-D_PSHGpe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DV9XAt6F.js → dependency-picker-UqKVJ9dv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dffq2NxL.js → desktop-pet-1Et9VqkM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-CS8qJpNO.js → desktop-pet-narrative-rADKU0FX.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CrB1ICax.js → desktop-pet-settings-0fCGgaG7.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-liRgSkcT.js → dev-view-store-TTj_djD8.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-ByEL5lvM.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-EKqQLQrE.js → directory-picker-path-field-C07a7wYX.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D-b1X6ro.js → discussion-annotation-sync-BFqKm9ky.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-wD97GeG0.js → extension-debug-page-DFaVlqas.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-B4Q1CjvW.js → extension-iframe-host-BfzPfXBq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ak1_K3u8.js → extension-marketplace-api-ow0K1Y4_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DWFI4iIh.js → extension-page-CrDADV5W.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BZwcaU5Y.js → extension-provider-mnRoa63o.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-cn4KS42C.js → extension-settings-page-BLl02GFY.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-c3gDD9sM.js → file-preview-surface-TGdKqhCf.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Dmt5JhZU.js → gateway-config-swr-DfPQIHOL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CJtDXQCt.js → gateway-realtime-67vWg_M2.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DInvvT5u.js → gateway-restart-CLtR2wkL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BZXdv2FE.js → gateway-settings-COvC3r-l.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-s2KcWekp.js → gateway-startup-retry-9YQllbw2.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DtnmDd87.js → global-defaults-api-DYMRjGvd.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CAVjA5rO.js → home-page-k9LFXcVa.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-RQQokgE9.js → image-generation-api-Dzydfvy8.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BP_4TubV.js → imports-page-Csd_YZXZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +1 -0
- package/dist/gateway/static/root/assets/index-DKW7BeT_.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-BNzNuXJ8.js → install-connector-dialog-CTQAKTPv.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DNRQFepg.js → keyboard-shortcuts-settings-B201bMIa.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CvY5XxbX.js → local-app-workbench-page-CD_8_gd_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DfwEvd8G.js → local-apps-page-BOwqNH0L.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CuDdIyxR.js → local-session-drafts-DjmK-SM9.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-TQcz_Vjt.js → locale-store-Bg_XR36n.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-eq49F1Rt.js → logs-page-gw3E9CMQ.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BaYXDMOJ.js → management-settings-t_Z2mCyw.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D4nII6Zv.js → markdown-view-BUpXJUPv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-MvlAY405.js → media-plugins-_shnaEMY.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-nsoNHqif.js → model-selector-a7PIT1Lk.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CFIazNIF.js → models-hub-cache-KOJC3z6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-KPzbHiEW.js → note-detail-panel-BsHYUFgk.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-HVxR5bRD.js → notes-api-BSmikUKI.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-yShJeR3i.js → notes-page-CA0NRL8O.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CfKjRVnb.js → oauth-api-D2t9HXoC.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D4uqONWr.js → oauth-provider-connect-DGGGGtcB.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-B98nlKTc.js → page-context-capture-button-BH54VO0V.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-HcuK45iu.js → page-context-draft-BS5y8Cx9.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-_d72UP_d.js → personal-avatar-D8DtpDTa.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-B19h_3WQ.js → personal-page-KJezmTKP.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CfwtGyue.js → personal-settings-panel-9uDaNJy5.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-D8bqsDk_.js → phone-dependencies-card-DLYrI0C4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CL_Zn6Xd.js → phone-model-picker-BbA2iI-3.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-C5Jia8eQ.js → phone-settings-page-Cg_BPss4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-FBfrfkYq.js → phone-workspace-store-CVDk80Bf.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-gAq2KPzK.js → plugin-details-dialog-DgibLkc3.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-Ck8GAX_y.js → preference-select-fields-BVoN-lAv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BJ9oTnNs.js → product-automation-feedback-DCo90zGh.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dw9hUdxP.js → product-open-page-OWl8IAoY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-C0iPzmSm.js → product-preview-content-Cjas7UNe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-COFtHoh6.js → product-preview-modal-CPWRvBI9.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-C5Amjah-.js → project-detail-page-B_HlZux_.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-DpL9ADQU.js → project-understanding-Ba02SFzB.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-gGg9nM2t.js → projects-page-CdfKjp95.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-D6JJRlJb.js → providers-api-rwQ4LWzr.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DxX1xKyt.js → recording-upload-BSmvRrZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BfXzBR1D.js → registry-api-Vy7LfH6E.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BZA4StwC.js → remote-access-hub-UXrnpGev.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-X-SIrZYI.js → resource-unavailable-f9OzSi4W.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-CWRb0UCt.js → route-preload-BtObM-co.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-1DjsPyQ5.js → runtime-tools-api-Bt8t37z5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BnCtyORj.js → runtime-tools-settings-panel-DU4UXnBm.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-ChSOfHHh.js → service-recommendation-list-CuYsRcBB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-rvY5aWw8.js → session-api-DJI9eSgw.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CtKgACGl.js +23 -0
- package/dist/gateway/static/root/assets/{sessions-page-DAS2IUGT.js → sessions-page-BAsKzRHt.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-ZKRIuk7h.js → settings-advanced-section-BxUuF_yi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CtJ8pEfm.js → settings-mode-store-CaoRh2gt.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DuNCn8i-.js → settings-page-header-CyUHrn7c.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DeNC8YHJ.js → settings-page-layout-DGVqXrlp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B3pUce-_.js → settings-page-qQ8-6dJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Fc3vuz_h.js → setup-status-panel-BpaPb625.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-B3hwjVAx.js → share-link-dialog-CQJ6Ykm2.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D_9oFzGS.js → share-preview-page-Cem96FbB.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BoUpXmxq.js → shares-api-Dowes16l.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Drfuvepz.js → shares-settings-DZEkZDR0.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-By2HhJ9O.js → skill-api-D8ZwFEVe.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-TaUCzS8Y.js → skill-list-api-B4gp00-f.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CN2fpS1n.js → skill-reload-api-ClmaaDXo.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-LzGLique.js → skills-page-CV0X9rvG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Cuyg8Ml3.js → system-settings-panel-D095uacX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DDubAU_5.js → task-result-evidence-LUrJlUhb.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BNs75Wdr.js → terminal-panel-store-BqEDB1Vl.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DB1ZfBUm.js → theme-store-gAcojLgP.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-TvtX4Goh.js → tracing-settings-page-B1ZRh-Is.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-COoVEdV9.js → tunnel-api-C9u9E3UQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-Dr_MLgYe.js → understanding-activity-store-BTrzsR6_.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DGmLGEqw.js → understanding-refresh-store-5Qava3jh.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DP6eb6ed.js → usage-page-DFMLYKAc.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-itwjDYUb.js → use-autosave-3O-X7x15.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-hjIGlI_2.js → use-composer-attachments-BLc4dBfe.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-ClLa0g8D.js → use-file-preview-expanded-BaOmTXsT.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-vhWk6tTU.js → use-personal-profile-MusPgljM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-dfXXjA2-.js → use-workspace-tree-Ck_U2yTw.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D8dswPWd.js → user-model-page-Den5Lg-k.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BIfBySnN.js → voice-api-key-field-C5zJApoa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-J4o59ICE.js → voice-config-api-DC1bYDt1.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-B1mlpUdC.js → voice-input-shortcut-events-0SZjJdVV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-xxaSOOmq.js → voice-transcribe-api-CxVeANPX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DqwT1E5u.js → work-discovery-overlay-DAQ8McVe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BzYQmPLT.js → work-discovery-page-DUQysEyb.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D2Zf3GOG.js → working-directory-picker-modal-BO9qdJyZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Bnx3eS2M.js → workspace-api-ZrN6yUER.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-D13qHzVr.js → workspace-file-preview-dialog-Yj_kBWSb.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Cou-ig1H.js → workspace-open-location-menu-yxT7wajO.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DQGPKxHA.js → xopc-cloud-account-card-IcH9KDzx.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +33 -3
- package/dist/src/agent/embedded/run-turn.js +64 -4
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +6 -0
- package/dist/src/agent/tools/computer-use-tool.js +18 -5
- package/dist/src/agent/tools/phone-use-tool.js +12 -2
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/computer/agent-context.d.ts +21 -0
- package/dist/src/computer/agent-context.js +107 -0
- package/dist/src/computer/broker.d.ts +4 -2
- package/dist/src/computer/broker.js +26 -11
- package/dist/src/computer/diagnostics.d.ts +60 -6
- package/dist/src/computer/diagnostics.js +45 -4
- package/dist/src/computer/errors.d.ts +1 -1
- package/dist/src/computer/errors.js +4 -0
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/native-timing.d.ts +15 -0
- package/dist/src/computer/native-timing.js +49 -0
- package/dist/src/computer/program-runtime.d.ts +22 -0
- package/dist/src/computer/program-runtime.js +105 -0
- package/dist/src/computer/runtime.d.ts +36 -2
- package/dist/src/computer/runtime.js +269 -58
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +6 -0
- package/dist/src/phone/adb-driver.d.ts +15 -1
- package/dist/src/phone/adb-driver.js +104 -41
- package/dist/src/phone/autoglm-protocol.d.ts +36 -0
- package/dist/src/phone/autoglm-protocol.js +88 -0
- package/dist/src/phone/autoglm-upstream-prompt.d.ts +2 -0
- package/dist/src/phone/autoglm-upstream-prompt.js +5 -0
- package/dist/src/phone/autoglm-upstream.LICENSE +201 -0
- package/dist/src/phone/cloud-adb-connection.d.ts +3 -0
- package/dist/src/phone/cloud-adb-connection.js +102 -31
- package/dist/src/phone/cloud-adb.js +18 -6
- package/dist/src/phone/completion-recovery.d.ts +6 -0
- package/dist/src/phone/completion-recovery.js +30 -0
- package/dist/src/phone/contracts.d.ts +20 -0
- package/dist/src/phone/contracts.js +6 -0
- package/dist/src/phone/execution-trace.d.ts +51 -0
- package/dist/src/phone/execution-trace.js +78 -0
- package/dist/src/phone/model-adapter.d.ts +9 -1
- package/dist/src/phone/model-adapter.js +132 -61
- package/dist/src/phone/model-response.d.ts +5 -0
- package/dist/src/phone/model-response.js +118 -0
- package/dist/src/phone/runtime.d.ts +4 -0
- package/dist/src/phone/runtime.js +146 -16
- package/dist/src/phone/text-session.d.ts +14 -0
- package/dist/src/phone/text-session.js +39 -0
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +22 -0
- package/dist/src/phone/ui-session.js +191 -0
- package/dist/src/process/phone-process.d.ts +1 -0
- package/dist/src/process/phone-process.js +11 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-1du1hfi5.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DcsZyYEa.js +0 -1
- package/dist/gateway/static/root/assets/index-BS9mjvSL.js +0 -11
- package/dist/gateway/static/root/assets/index-pT-m6l6b.css +0 -1
- package/dist/gateway/static/root/assets/messages-DaLmc4W1.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DticJxxh.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-D6SzJ9Ch.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-D2rbRfX3.js +0 -23
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYDQybNF.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-6A9337pK.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-DGmi7rCQ.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-COUVwj-p.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{a as i,i as a,l as o,o as s}from"./locale-store-TQcz_Vjt.js";import{t as c}from"./messages-DaLmc4W1.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./chevron-left-DqFhpbvK.js";import{t as d}from"./chevron-right-BweFrslA.js";import{n as f,r as p}from"./popover-select-DD8fmrxH.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./secret-input-BQvFXqzz.js";import{t as g}from"./globe-DSSGFWFn.js";import{t as _}from"./loader-circle-CifKLtgG.js";import{t as v}from"./plus-Q2yW6OE7.js";import{t as y}from"./search-DA7gz22f.js";import{t as b}from"./settings-2-D-csvaET.js";import{t as x}from"./x-B_N4OPjy.js";import{t as S}from"./cn-0WouolD0.js";import{t as C}from"./button-CnRSIP6m.js";import{t as w}from"./skeleton-BI5TyibZ.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./dist-DfWfZ9iu.js";import{i as M,o as N}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as P}from"./vendor-swr-CdRzEUwF.js";import{n as F}from"./interaction-BdhHBbYa.js";import{r as I}from"./gateway-config-swr-Dmt5JhZU.js";import{n as L,t as R}from"./registry-api-BfXzBR1D.js";import{a as z,o as B,s as V}from"./form-field-width-DJw_jULe.js";import{n as ee}from"./secret-input-labels-B5Jl5HqK.js";import{t as te}from"./sliding-tab-list-DuQyViqe.js";import{i as H,n as U}from"./models-hub-cache-CFIazNIF.js";import{a as ne,i as W,o as G}from"./providers-api-D6JJRlJb.js";import{t as re}from"./oauth-provider-connect-D4uqONWr.js";var ie=l(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),ae=l(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),K=e(t(),1),q=n(),J=[{label:[`文本`,`Text`],uses:[`chat`]},{label:[`图片`,`Images`],uses:[`vision`,`image`]},{label:[`语音`,`Voice`],uses:[`transcription`,`speech`,`conversation`]},{label:[`后台`,`Background`],uses:[`background`]}],oe={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`生成图片`,`Image generation`],transcription:[`录音与听写`,`Recording and dictation`],speech:[`文字转语音`,`Text to speech`],conversation:[`实时语音对话`,`Realtime conversation`],background:[`自动与后台任务`,`Background tasks`]};function se(e){return e&&Object.hasOwn(oe,e)?e:void 0}function ce(e){return e&&!/[\\\r\n]/.test(e)&&(e.startsWith(`/chat/`)||e===`/personal`||e===`/settings/phone-use`||e.startsWith(`/automations`))?e:void 0}function le(e,t){let[n,r]=e.split(`?`),i=new URLSearchParams(r),a=ce(t.get(`returnTo`));return a&&i.set(`returnTo`,a),`${n}${i.size?`?${i}`:``}`}async function Y(e){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}`))).payload}async function ue(e,t={}){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).payload}async function de(e,t,n){await s(a(`/api/models/setup/${encodeURIComponent(e)}/apply`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,revision:n})}),await H()}function fe(e,t){return e===`single`?t.getApiKey:e===`intl`?t.getApiKeyIntl:t.getApiKeyCn}var X={"qwen-token-plan-cn":{apiKeyUrl:`https://bailian.console.aliyun.com/cn-beijing/subscription/overview`,docsUrl:`https://help.aliyun.cn/zh/model-studio/token-plan-personal-quick-start`,description:`Alibaba Bailian subscription. Configure chat, vision and image generation with one key.`,descriptionZh:`阿里云百炼订阅,一份 Key 配置对话、视觉和图片生成。`,bestFor:[`general`,`coding`,`vision`],aliases:[`阿里云订阅`,`百炼订阅`,`aliyun`,`bailian`,`qwen`,`token plan`,`通义`,`千问`],envVars:[`QWEN_TOKEN_PLAN_CN_API_KEY`]},openai:{apiKeyUrl:`https://platform.openai.com/api-keys`,pricingUrl:`https://openai.com/pricing`,docsUrl:`https://platform.openai.com/docs`,description:`The most widely used LLM provider. Powers ChatGPT.`,descriptionZh:`最广泛使用的 LLM 服务商,ChatGPT 背后的技术。`,bestFor:[`general`,`coding`,`vision`],freeTier:!1,freeTierNote:`Pay-as-you-go; new accounts may receive trial credits.`,aliases:[`chatgpt`,`gpt`,`gpt-4`,`gpt4`,`gpt-4o`,`gpt4o`],envVars:[`OPENAI_API_KEY`]},anthropic:{apiKeyUrl:`https://console.anthropic.com/settings/keys`,pricingUrl:`https://www.anthropic.com/pricing`,docsUrl:`https://docs.anthropic.com`,description:`Anthropic model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Anthropic 模型服务。可用模型由网关目录动态加载。`,bestFor:[`long context`,`coding`,`reasoning`],freeTier:!1,aliases:[`claude`,`claude 3`,`claude sonnet`,`claude opus`,`claude haiku`],envVars:[`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`]},google:{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Google AI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Google AI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`multimodal`,`long context`,`general`],freeTier:!0,freeTierNote:`Free tier available via Google AI Studio.`,aliases:[`gemini`,`google gemini`,`bard`,`google ai`],envVars:[`GEMINI_API_KEY`,`GOOGLE_API_KEY`]},"google-vertex":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/vertex-ai/pricing`,docsUrl:`https://cloud.google.com/vertex-ai/docs`,description:`Google Vertex AI — enterprise-grade model hosting on GCP.`,descriptionZh:`Google Vertex AI,企业级 GCP 托管模型服务。`,bestFor:[`enterprise`,`multimodal`,`compliance`],freeTier:!1,aliases:[`vertex`,`vertex ai`,`gcp`,`google cloud`],envVars:[`GOOGLE_CLOUD_API_KEY`,`GOOGLE_CLOUD_PROJECT`,`GOOGLE_CLOUD_LOCATION`]},"google-gemini-cli":{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Gemini via CLI token — for users authenticated with the Gemini CLI tool.`,descriptionZh:`通过 Gemini CLI 令牌访问 Gemini,适合已安装 CLI 工具的用户。`,bestFor:[`general`,`multimodal`],freeTier:!0,freeTierNote:`Uses your existing Gemini CLI authentication.`,aliases:[`gemini cli`,`gemini-cli`],envVars:[`GEMINI_CLI_TOKEN`,`GOOGLE_TOKEN`]},"google-antigravity":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/pricing`,docsUrl:`https://cloud.google.com/docs`,description:`Google Antigravity — internal/experimental Google AI endpoint.`,descriptionZh:`Google Antigravity,Google 内部/实验性 AI 端点。`,bestFor:[`experimental`],freeTier:!1,aliases:[`antigravity`,`google antigravity`],envVars:[`ANTIGRAVITY_API_KEY`]},groq:{apiKeyUrl:`https://console.groq.com/keys`,pricingUrl:`https://groq.com/pricing/`,docsUrl:`https://console.groq.com/docs`,description:`Extremely fast inference — ideal for latency-sensitive applications.`,descriptionZh:`推理速度极快,适合对延迟敏感的场景。`,bestFor:[`speed`,`cheap`],freeTier:!0,freeTierNote:`Generous free tier with rate limits.`,aliases:[`groq`,`llama on groq`,`mixtral on groq`],envVars:[`GROQ_API_KEY`]},deepseek:{apiKeyUrl:`https://platform.deepseek.com/api_keys`,pricingUrl:`https://api-docs.deepseek.com/quick_start/pricing/`,docsUrl:`https://platform.deepseek.com/api-docs/`,description:`DeepSeek model access through an OpenAI-compatible API.`,descriptionZh:`通过 OpenAI 兼容 API 访问 DeepSeek 模型。`,bestFor:[`reasoning`,`cheap`,`coding`],freeTier:!0,freeTierNote:`Free credits may be available for new accounts.`,aliases:[`deepseek`,`deep seek`,`deepseek v4`,`deepseek-v4`,`r1`],envVars:[`DEEPSEEK_API_KEY`]},"volcengine-ark":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Ark — OpenAI-compatible access to Doubao and custom Ark endpoints.`,descriptionZh:`火山方舟,通过 OpenAI 兼容接口访问豆包与自定义方舟 endpoint。`,bestFor:[`chinese`,`general`,`enterprise`],aliases:[`volcengine`,`ark`,`doubao`,`volces`,`火山方舟`,`豆包`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"volcengine-plan":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Doubao Coding Plan — Ark coding endpoint.`,descriptionZh:`火山方舟豆包 Coding Plan,使用 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`volcengine plan`,`ark coding`,`doubao coding`,`火山方舟 coding`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"byteplus-plan":{apiKeyUrl:`https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey`,pricingUrl:`https://docs.byteplus.com/en/docs/ModelArk`,docsUrl:`https://docs.byteplus.com/en/docs/ModelArk/OpenAI`,description:`BytePlus Doubao Coding Plan — international Ark coding endpoint.`,descriptionZh:`BytePlus 豆包 Coding Plan,国际区 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`byteplus`,`byteplus plan`,`doubao coding international`],envVars:[`BYTEPLUS_API_KEY`,`ARK_API_KEY`]},xai:{apiKeyUrl:`https://console.x.ai/`,pricingUrl:`https://x.ai/api`,docsUrl:`https://docs.x.ai/`,description:`xAI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`xAI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`reasoning`,`real-time`],freeTier:!1,aliases:[`grok`,`xai`,`x.ai`],envVars:[`XAI_API_KEY`]},cerebras:{apiKeyUrl:`https://cloud.cerebras.ai/platform/`,pricingUrl:`https://cloud.cerebras.ai/platform/`,docsUrl:`https://inference-docs.cerebras.ai/`,description:`Ultra-fast inference on custom AI chips. Fastest Llama inference available.`,descriptionZh:`基于专用 AI 芯片的超快推理,Llama 推理速度业界最快。`,bestFor:[`speed`],freeTier:!0,freeTierNote:`Free tier available.`,aliases:[`cerebras`],envVars:[`CEREBRAS_API_KEY`]},mistral:{apiKeyUrl:`https://console.mistral.ai/api-keys/`,pricingUrl:`https://mistral.ai/technology/#pricing`,docsUrl:`https://docs.mistral.ai/`,description:`European open-weight models. Good balance of quality and cost.`,descriptionZh:`欧洲开源模型,质量与成本平衡好。`,bestFor:[`general`,`cheap`,`coding`],freeTier:!1,aliases:[`mistral`,`mixtral`,`codestral`],envVars:[`MISTRAL_API_KEY`]},openrouter:{apiKeyUrl:`https://openrouter.ai/keys`,pricingUrl:`https://openrouter.ai/models`,docsUrl:`https://openrouter.ai/docs`,description:`API gateway to 100+ models from many providers with a single key.`,descriptionZh:`统一 API 网关,一个 Key 访问 100+ 模型。`,bestFor:[`general`,`flexibility`],freeTier:!0,freeTierNote:`Some models are free; pay-per-use for others.`,aliases:[`openrouter`,`open router`],envVars:[`OPENROUTER_API_KEY`]},azure:{apiKeyUrl:`https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI`,pricingUrl:`https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`,docsUrl:`https://learn.microsoft.com/en-us/azure/ai-services/openai/`,description:`OpenAI models hosted on Azure. Enterprise SLA and data residency.`,descriptionZh:`Azure 托管的 OpenAI 模型,企业级 SLA 和数据合规。`,bestFor:[`enterprise`,`compliance`,`coding`],freeTier:!1,aliases:[`azure`,`azure openai`,`aoai`],envVars:[`AZURE_OPENAI_API_KEY`,`AZURE_OPENAI_BASE_URL`]},"amazon-bedrock":{apiKeyUrl:`https://console.aws.amazon.com/iam/home#/security_credentials`,pricingUrl:`https://aws.amazon.com/bedrock/pricing/`,docsUrl:`https://docs.aws.amazon.com/bedrock/`,description:`AWS Bedrock hosted model access with enterprise controls.`,descriptionZh:`AWS Bedrock 托管模型服务,提供企业级控制能力。`,bestFor:[`enterprise`,`compliance`],freeTier:!1,aliases:[`bedrock`,`aws`,`amazon`],envVars:[`AWS_ACCESS_KEY_ID`,`AWS_SECRET_ACCESS_KEY`,`AWS_REGION`]},minimax:{apiKeyUrl:`https://platform.minimax.io/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimax.io/docs/guides/models-intro`,docsUrl:`https://platform.minimax.io/docs/guides/quickstart-preparation`,description:`MiniMax — Chinese multimodal model with strong text and audio capabilities.`,descriptionZh:`MiniMax,国产多模态模型,文本和音频能力强。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax`,`mini max`,`abab`],envVars:[`MINIMAX_API_KEY`]},"minimax-cn":{apiKeyUrl:`https://platform.minimaxi.com/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimaxi.com/document/Price`,docsUrl:`https://platform.minimaxi.com/document/Announcement`,description:`MiniMax (China endpoint) — domestic access for Chinese users.`,descriptionZh:`MiniMax 国内端点,国内用户直连访问。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax cn`,`minimax china`,`abab`],envVars:[`MINIMAX_CN_API_KEY`,`MINIMAX_API_KEY`]},stepfun:{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun OpenAI-compatible endpoint.`,descriptionZh:`阶跃星辰 StepFun OpenAI 兼容端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun`,`step`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun China — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 中国区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun cn`,`step cn`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun International — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 国际区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun intl`,`step international`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan`,`step plan`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan China — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 中国区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan cn`,`step plan cn`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan International — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 国际区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan intl`,`step plan international`],envVars:[`STEPFUN_API_KEY`]},"kimi-coding":{apiKeyUrl:`https://platform.kimi.com/console/api-keys`,pricingUrl:`https://platform.kimi.com/docs/pricing/chat`,docsUrl:`https://platform.kimi.com/docs`,description:`Kimi Coding — dedicated Anthropic-compatible coding endpoint.`,descriptionZh:`Kimi Coding,Anthropic 兼容的专用 coding 端点。`,bestFor:[`coding`,`chinese`,`vision`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`kimi coding`,`moonshot coding`,`kimi code`],envVars:[`KIMI_API_KEY`,`MOONSHOT_API_KEY`]},moonshotai:{apiKeyUrl:`https://platform.moonshot.ai/console/api-keys`,pricingUrl:`https://platform.moonshot.ai/docs/pricing`,docsUrl:`https://platform.moonshot.ai/docs`,description:`Moonshot Kimi — international API (api.moonshot.ai).`,descriptionZh:`月之暗面 Kimi 国际版 API(api.moonshot.ai)。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot`,`kimi`,`moonshot ai`],envVars:[`MOONSHOT_API_KEY`]},"moonshotai-cn":{apiKeyUrl:`https://platform.moonshot.cn/console/api-keys`,pricingUrl:`https://platform.moonshot.cn/docs/pricing/chat`,docsUrl:`https://platform.moonshot.cn/docs`,description:`Moonshot Kimi — China region endpoint.`,descriptionZh:`月之暗面 Kimi 中国区域端点。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot cn`,`kimi cn`],envVars:[`MOONSHOT_API_KEY`]},fal:{apiKeyUrl:`https://fal.ai/dashboard/keys`,pricingUrl:`https://fal.ai/pricing`,docsUrl:`https://fal.ai/docs`,description:`fal — serverless image and media generation APIs.`,descriptionZh:`fal:无服务器图像与媒体生成 API。`,bestFor:[`image`,`video`],freeTier:!0,aliases:[`fal ai`,`fal.ai`],envVars:[`FAL_KEY`,`FAL_API_KEY`]},fireworks:{apiKeyUrl:`https://fireworks.ai/account/api-keys`,pricingUrl:`https://fireworks.ai/pricing`,docsUrl:`https://docs.fireworks.ai`,description:`Fireworks AI — fast inference for open and proprietary models.`,descriptionZh:`Fireworks AI,多种开源与商业模型的高速推理服务。`,bestFor:[`speed`,`coding`,`open weights`],freeTier:!0,aliases:[`fireworks ai`,`fireworks`],envVars:[`FIREWORKS_API_KEY`]},together:{apiKeyUrl:`https://api.together.xyz/settings/api-keys`,pricingUrl:`https://www.together.ai/pricing`,docsUrl:`https://docs.together.ai`,description:`Together AI — hosted Llama, Qwen, DeepSeek, and more.`,descriptionZh:`Together AI,托管 Llama、Qwen、DeepSeek 等模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,aliases:[`together ai`,`together.xyz`],envVars:[`TOGETHER_API_KEY`]},"cloudflare-workers-ai":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/workers-ai`,pricingUrl:`https://developers.cloudflare.com/workers-ai/platform/pricing/`,docsUrl:`https://developers.cloudflare.com/workers-ai/`,description:`Cloudflare Workers AI — models at the edge via Cloudflare API.`,descriptionZh:`Cloudflare Workers AI,通过 Cloudflare API 在边缘运行模型。`,bestFor:[`edge`,`latency`],freeTier:!0,aliases:[`workers ai`,`cf workers ai`],envVars:[`CLOUDFLARE_API_KEY`]},"cloudflare-ai-gateway":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/ai-gateway`,pricingUrl:`https://developers.cloudflare.com/ai-gateway/pricing/`,docsUrl:`https://developers.cloudflare.com/ai-gateway/`,description:`Cloudflare AI Gateway — unified OpenAI/Anthropic-compatible routing.`,descriptionZh:`Cloudflare AI Gateway,统一 OpenAI/Anthropic 兼容路由。`,bestFor:[`routing`,`observability`,`enterprise`],freeTier:!0,aliases:[`cf ai gateway`,`cloudflare gateway`],envVars:[`CLOUDFLARE_API_KEY`]},xiaomi:{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo — API billing through the MiMo open platform; endpoint api.xiaomimimo.com.`,descriptionZh:`小米 MiMo 按量计费线路,在开放平台创建密钥;接口域名为 api.xiaomimimo.com。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi`,`mimo`,`小米`,`xiaomimimo`],envVars:[`XIAOMI_API_KEY`]},"xiaomi-token-plan-cn":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — China region (token-plan-cn.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 中国区(token-plan-cn.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token cn`,`mimo token cn`],envVars:[`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-ams":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Amsterdam region (token-plan-ams.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 阿姆斯特丹(token-plan-ams.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token ams`,`mimo token ams`],envVars:[`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-sgp":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Singapore region (token-plan-sgp.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 新加坡(token-plan-sgp.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token sgp`,`mimo token sgp`],envVars:[`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"ant-ling":{apiKeyUrl:`https://ling.tbox.cn/`,docsUrl:`https://ling.tbox.cn/`,description:`Ant Ling — domestic OpenAI-compatible access to Ling and Ring models.`,descriptionZh:`蚂蚁 Ling,国内 OpenAI 兼容服务,提供 Ling 与 Ring 系列模型。`,bestFor:[`chinese`,`reasoning`,`coding`],aliases:[`ant ling`,`ling`,`ring`,`蚂蚁 ling`,`蚂蚁灵`],envVars:[`ANT_LING_API_KEY`,`LING_API_KEY`]},"zai-coding-global":{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM Coding Plan — international z.ai endpoint.`,descriptionZh:`智谱 GLM Coding Plan 国际区 z.ai 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding`,`zhipu coding global`,`glm coding global`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},"zai-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China endpoint from the pi-ai provider catalog.`,descriptionZh:`智谱 GLM Coding Plan 中国区,来自 pi-ai 内置 provider 目录。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding cn`,`zhipu coding cn`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China BigModel endpoint.`,descriptionZh:`智谱 GLM Coding Plan 中国区 BigModel 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zhipu coding`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM China — BigModel OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 中国区,通过 BigModel OpenAI 兼容接口访问。`,bestFor:[`chinese`,`reasoning`,`general`],freeTier:!0,aliases:[`zhipu`,`glm`,`bigmodel`,`智谱`,`z.ai cn`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`]},huggingface:{apiKeyUrl:`https://huggingface.co/settings/tokens`,pricingUrl:`https://huggingface.co/pricing`,docsUrl:`https://huggingface.co/docs/api-inference/`,description:`Access thousands of open-source models via Hugging Face Inference API.`,descriptionZh:`通过 Hugging Face 访问数千个开源模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,freeTierNote:`Free tier with rate limits.`,aliases:[`huggingface`,`hugging face`,`hf`],envVars:[`HF_TOKEN`,`HUGGINGFACE_TOKEN`]},opencode:{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode — AI coding assistant provider.`,descriptionZh:`OpenCode,AI 代码助手服务商。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode`,`open code`],envVars:[`OPENCODE_API_KEY`]},"opencode-go":{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode Go — AI coding assistant provider (Go variant).`,descriptionZh:`OpenCode Go,AI 代码助手服务商(Go 版本)。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode go`,`opencode-go`],envVars:[`OPENCODE_API_KEY`]},zai:{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM International — z.ai OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 国际区,通过 z.ai OpenAI 兼容接口访问。`,bestFor:[`general`,`reasoning`,`chinese`],freeTier:!1,aliases:[`zai`,`z.ai`,`zhipu global`,`glm global`,`智谱`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},dashscope:{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope service provider.`,descriptionZh:`阿里百炼 / DashScope 服务 provider。`,bestFor:[`chinese`,`coding`,`image`,`speech`],freeTier:!0,aliases:[`dash scope`,`alibaba dashscope`,`qwen`,`tongyi`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-cn":{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope China — Qwen LLMs through the China endpoint.`,descriptionZh:`阿里百炼 / DashScope 中国区:通过国内端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope cn`,`alibaba dashscope cn`,`qwen cn`,`tongyi cn`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-intl":{apiKeyUrl:`https://modelstudio.console.alibabacloud.com/`,pricingUrl:`https://www.alibabacloud.com/help/en/model-studio/billing-for-tongyi-qianwen`,docsUrl:`https://www.alibabacloud.com/help/en/model-studio/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope International — Qwen LLMs through the international endpoint.`,descriptionZh:`阿里百炼 / DashScope 国际区:通过国际端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope intl`,`alibaba cloud dashscope`,`qwen intl`,`tongyi intl`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"vercel-ai-gateway":{apiKeyUrl:`https://vercel.com/account/tokens`,pricingUrl:`https://vercel.com/pricing`,docsUrl:`https://vercel.com/docs/ai/ai-gateway`,description:`Vercel AI Gateway — route requests to multiple LLM providers via Vercel.`,descriptionZh:`Vercel AI Gateway,通过 Vercel 路由请求到多个 LLM 服务商。`,bestFor:[`flexibility`,`enterprise`],freeTier:!1,aliases:[`vercel gateway`,`vercel ai gateway`],envVars:[`AI_GATEWAY_API_KEY`,`VERCEL_AI_GATEWAY_API_KEY`]},"github-copilot":{apiKeyUrl:`https://github.com/settings/tokens`,pricingUrl:`https://github.com/features/copilot#pricing`,docsUrl:`https://docs.github.com/en/copilot`,description:`GitHub Copilot — use your GitHub token to access Copilot models.`,descriptionZh:`使用 GitHub 令牌访问 Copilot 模型。`,bestFor:[`coding`],freeTier:!0,freeTierNote:`Free for verified students and open-source maintainers.`,aliases:[`github copilot`,`copilot`,`github`],envVars:[`COPILOT_GITHUB_TOKEN`,`GH_TOKEN`,`GITHUB_TOKEN`,`GITHUB_COPILOT_TOKEN`]}};function pe(e,t){let n=X[e];return n&&n.apiKeyUrl?[{href:n.apiKeyUrl,kind:`single`}]:[]}var me=[`common`,`domestic`,`specialty`,`enterprise`,`oauth`,`extension`];function he(e){let t=new Map;for(let e of me)t.set(e,[]);for(let n of e){let e=n.category||`specialty`,r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var ge=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`azure-openai-responses`,label:`Azure OpenAI`},{value:`bedrock-converse-stream`,label:`AWS Bedrock`},{value:`google-gemini-cli`,label:`Google Gemini CLI`},{value:`google-vertex`,label:`Google Vertex AI`}];function _e(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&`message`in t.error){let e=t.error.message;return typeof e==`string`?e:void 0}}function ve(e){if(!e||typeof e!=`object`)return{providers:{}};let t=e,n=t.providers;return n&&typeof n==`object`&&!Array.isArray(n)?e:{...t,providers:{}}}async function ye(){let e=await i(a(`/api/models-json`)),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok||!t.payload)throw Error(_e(t)||`HTTP ${e.status}`);return{...t.payload,config:ve(t.payload.config)}}async function be(e){let t=await i(a(`/api/models-json`),{method:`PATCH`,body:JSON.stringify({config:e})}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(_e(n)||`HTTP ${t.status}`);return await H(),n.payload}async function xe(e){let t=await i(a(`/api/models-json/discover-models`),{method:`POST`,body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(_e(n)||`HTTP ${t.status}`);return n.payload.models}function Se(e,t,n){return{id:e,name:t||e,input:[`text`],contextWindow:128e3,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...n}}var Z={ollama:{label:`Ollama`,providerId:`ollama`,config:{baseUrl:`http://localhost:11434/v1`,api:`openai-completions`,apiKey:`ollama`}},lmstudio:{label:`LM Studio`,providerId:`lmstudio`,config:{baseUrl:`http://localhost:1234/v1`,api:`openai-completions`,apiKey:`lmstudio`}},openrouter:{label:`OpenRouter`,providerId:`openrouter`,config:{baseUrl:`https://openrouter.ai/api/v1`,api:`openai-completions`,apiKey:``}},zhipuCn:{label:`Zhipu GLM China`,providerId:`zhipu-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiGeneral:{label:`Zhipu GLM International`,providerId:`zai`,config:{baseUrl:`https://api.z.ai/api/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},dashscopeCn:{label:`Alibaba Bailian / DashScope China`,providerId:`dashscope-cn`,description:`China OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},dashscopeIntl:{label:`Alibaba Bailian / DashScope International`,providerId:`dashscope-intl`,description:`International OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},volcengineArk:{label:`Volcengine Ark`,providerId:`volcengine-ark`,description:`Use your Ark endpoint id as the model id`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ep-your-endpoint-id`,name:`Ark endpoint ID`,contextWindow:128e3,input:[`text`]}]}},volcenginePlan:{label:`Volcengine Doubao Coding Plan`,providerId:`volcengine-plan`,description:`Doubao coding-plan endpoint on Volcengine Ark`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/coding/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},byteplusPlan:{label:`BytePlus Doubao Coding Plan`,providerId:`byteplus-plan`,description:`Doubao coding-plan endpoint on BytePlus`,config:{baseUrl:`https://ark.ap-southeast.bytepluses.com/api/coding/v3`,api:`openai-completions`,apiKey:`BYTEPLUS_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},deepseek:{label:`DeepSeek`,providerId:`deepseek`,config:{baseUrl:`https://api.deepseek.com`,api:`openai-completions`,apiKey:`DEEPSEEK_API_KEY`,models:[{id:`deepseek-v4-pro`,name:`DeepSeek V4 Pro`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]},{id:`deepseek-v4-flash`,name:`DeepSeek V4 Flash`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]}]}},moonshotCn:{label:`Kimi / Moonshot China`,providerId:`moonshotai-cn`,config:{baseUrl:`https://api.moonshot.cn/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},moonshotIntl:{label:`Kimi / Moonshot International`,providerId:`moonshotai`,config:{baseUrl:`https://api.moonshot.ai/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},kimiCoding:{label:`Kimi Coding`,providerId:`kimi-coding`,description:`Dedicated Kimi coding endpoint`,config:{baseUrl:`https://api.kimi.com/coding`,api:`anthropic-messages`,apiKey:`KIMI_API_KEY`,headers:{"User-Agent":`KimiCLI/1.5`},models:[{id:`k2p7`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-for-coding`,name:`Kimi For Coding`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]}]}},stepfunIntl:{label:`StepFun International`,providerId:`stepfun-intl`,config:{baseUrl:`https://api.stepfun.ai/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunCn:{label:`StepFun China`,providerId:`stepfun-cn`,config:{baseUrl:`https://api.stepfun.com/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanIntl:{label:`StepFun Step Plan International`,providerId:`stepfun-plan-intl`,config:{baseUrl:`https://api.stepfun.ai/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanCn:{label:`StepFun Step Plan China`,providerId:`stepfun-plan-cn`,config:{baseUrl:`https://api.stepfun.com/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},xiaomi:{label:`Xiaomi MiMo`,providerId:`xiaomi`,config:{baseUrl:`https://api.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanCn:{label:`Xiaomi MiMo Token Plan China`,providerId:`xiaomi-token-plan-cn`,config:{baseUrl:`https://token-plan-cn.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_CN_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanAms:{label:`Xiaomi MiMo Token Plan Amsterdam`,providerId:`xiaomi-token-plan-ams`,config:{baseUrl:`https://token-plan-ams.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanSgp:{label:`Xiaomi MiMo Token Plan Singapore`,providerId:`xiaomi-token-plan-sgp`,config:{baseUrl:`https://token-plan-sgp.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},minimax:{label:`MiniMax`,providerId:`minimax`,description:`Anthropic-compatible endpoint preferred for agent workflows`,config:{baseUrl:`https://api.minimax.io/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}},zhipuCodingCn:{label:`Zhipu GLM Coding Plan China`,providerId:`zhipu-coding-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiCodingGlobal:{label:`Zhipu GLM Coding Plan International`,providerId:`zai-coding-global`,config:{baseUrl:`https://api.z.ai/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},minimaxCn:{label:`MiniMax China`,providerId:`minimax-cn`,config:{baseUrl:`https://api.minimaxi.com/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_CN_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}}},Ce=Object.entries(Z).map(([e,t])=>({key:e,...t}));function we(e){return Z[e]?.providerId??e}function Te(e){return Ce.find(t=>t.providerId===e)?.key}var Ee=new Set([`dashscope-cn`,`dashscope-intl`,`volcengine-ark`,`volcengine-plan`,`byteplus-plan`,`stepfun-cn`,`stepfun-intl`,`stepfun-plan-cn`,`stepfun-plan-intl`,`zhipu-cn`,`zai-coding-global`,`zhipu-coding-cn`]);function De(e){if(Ee.has(e))return Te(e)}var Oe=[{value:`text`,labelKey:`inputTextOnly`},{value:`text,image`,labelKey:`inputTextVision`}];function ke(){return S(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,V,`dark:border-edge`)}function Ae(){return S(B,z)}function je(e){return(e.input||[`text`]).includes(`image`)?`text,image`:`text`}function Me(e){return e===`text,image`?[`text`,`image`]:[`text`]}var Ne={chat:[`日常对话与交办任务`,`Everyday conversations and tasks`],vision:[`理解照片、截图和图片内容`,`Understand photos, screenshots and images`],image:[`根据描述生成图片`,`Create images from a description`],transcription:[`聊天听写与笔记录音转文字`,`Dictate messages and transcribe recorded notes`],speech:[`朗读消息,选择喜欢的音色`,`Read messages aloud in your preferred voice`],conversation:[`实时通话、音色与音频设备`,`Live calls, voices and audio devices`],background:[`自动化、定时和无人值守任务`,`Automations, schedules and unattended tasks`]};function Pe(e,t,n){return n?{"qwen-token-plan-cn":`阿里云百炼订阅 · 北京`,"qwen-token-plan":`阿里云百炼订阅 · 国际`,"dashscope-cn":`阿里云百炼 · 中国区`,"dashscope-intl":`阿里云百炼 · 国际区`,"xiaomi-token-plan-cn":`小米 MiMo 订阅 · 中国区`}[e]??t:t}var Q=r(),$={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`画图`,`Image generation`],background:[`后台任务`,`Background tasks`],speech:[`语音合成`,`Speech synthesis`],transcription:[`录音识别`,`Recorded audio recognition`],conversation:[`实时语音对话`,`Realtime conversation`]};function Fe({providerId:e,row:t,modelIds:n,existingConnection:r=!1,targetUse:i,connectOnly:a=!1,language:o,alternatives:s=[],onChooseProvider:l,onBack:d,onDone:g,onApplied:v,inline:y=!1,onPendingChange:b}){let S=o===`zh`,T=(0,K.useRef)(!1),[D,O]=(0,K.useState)(null),[k,j]=(0,K.useState)({mode:i?`replace`:`fill`,modelIds:n}),[M,N]=(0,K.useState)(``),[P,F]=(0,K.useState)(!1),[I,L]=(0,K.useState)(!1),[R,z]=(0,K.useState)(r||!!t?.configured),[B,V]=(0,K.useState)(!1),H=(0,K.useRef)(!1),[U,W]=(0,K.useState)(``),[G,ie]=(0,K.useState)(!1),[ae,q]=(0,K.useState)(0);(0,K.useEffect)(()=>{let t=!0;return ue(e,{modelIds:n,...a?{selected:[]}:{},...i&&!a?{mode:`replace`,selected:[i]}:{}}).then(e=>{t&&(O(e),z(e.configured),T.current||(T.current=!0,j({mode:i?`replace`:`fill`,modelIds:n,selected:a?[]:e.uses.filter(e=>e.selected).map(e=>e.id)})),W(``))}).catch(e=>{t&&W(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,n,i,a,ae]),(0,K.useEffect)(()=>(b?.(B),()=>b?.(!1)),[B,b]);let J=k.selected??[],se=e=>{j({...k,mode:e,selected:D?.uses.filter(t=>t.recommended&&t.choices.length&&(e===`replace`||t.selected)).map(e=>e.id)??[]})},ce=async()=>{if(!D||H.current)return;H.current=!0,V(!0),W(``),L(!1);let t=!1;try{M.trim()&&(await ne({[e]:M.trim()}),t=!0,L(!0),z(!0),F(!1),N(``));let n=await ue(e,k);if(z(n.configured),a){if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);O(n),ie(!0),v?.();return}let r=D.uses.filter(e=>J.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended),i=n.uses.filter(e=>J.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended);if(D.revision!==n.revision||JSON.stringify(r)!==JSON.stringify(i))throw O(n),j({...k,selected:n.uses.filter(e=>e.selected).map(e=>e.id)}),Error(S?`目录或当前配置已更新,请核对后再次应用。`:`The catalog or settings changed. Review the updated choices and apply again.`);if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);await de(e,k,n.revision),O(n),ie(!0),v?.()}catch(e){let n=e instanceof Error?e.message:String(e);W((!y&&t?S?`服务已保存,用途配置未完成。`:`Connection saved; model setup is incomplete. `:``)+n)}finally{H.current=!1,V(!1)}},le=D?.profile.name??t?.name??e,Y=D?.profile.apiKeyUrl??X[e]?.apiKeyUrl;if(y){let n=D?.uses.find(e=>e.id===i),r=i?k.overrides?.[i]??n?.recommended:void 0,a=Pe(e,le,S);return(0,Q.jsxs)(`div`,{className:`space-y-6 p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:a}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`${S?`用于`:`For `}${oe[i][+!S]}`:``})]}),(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:g,children:S?`更换服务`:`Change service`})]}),!D&&!U?(0,Q.jsx)(w,{className:`h-48 w-full rounded-xl`}):null,D?(0,Q.jsxs)(Q.Fragment,{children:[D.profile.credential===`oauth`&&!R?(0,Q.jsx)(re,{providerId:e,displayName:a,connected:R,onConnected:()=>{z(!0),q(e=>e+1)}}):null,D.profile.credential===`oauth`&&R&&!t?.supportsApiKey?(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-xl bg-surface-inset px-4 py-3 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}):null,D.profile.credential===`api-key`||D.profile.credential===`oauth`&&t?.supportsApiKey?(0,Q.jsx)(`div`,{className:`space-y-3`,children:R&&!P?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}),(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>F(!0),children:S?`更换`:`Change`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:D.profile.access===`subscription`?S?`订阅 API Key`:`Subscription API key`:`API Key`}),R?(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>{F(!1),N(``)},children:S?`保留原 Key`:`Keep saved key`}):null]}),(0,Q.jsx)(h,{id:`provider-setup-key`,disabled:B,value:M,onChange:N,placeholder:R?S?`输入新的 API Key`:`Enter a new API key`:S?`粘贴 API Key`:`Paste your API key`,labels:ee(c(o).providersSettings)}),R?(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:S?`此服务的其他已配置模型也会使用新的 Key。`:`Other models configured with this service will also use the new key.`}):null,Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-10 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取 API Key`:`Get an API key`}):null]})}):null,n?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-sm font-medium text-fg`,children:S?`选择模型`:`Model`}),(0,Q.jsx)(f,{value:r??``,disabled:B||!n.choices.length,"aria-label":S?`选择模型`:`Model`,onChange:e=>j({...k,selected:[n.id],overrides:{...k.overrides,[n.id]:e.target.value}}),children:n.choices.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.name},e.id))})]}):null,(0,Q.jsxs)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:[S?`只更改当前能力使用的模型。`:`Changes the model for this capability only.`,D.profile.interactiveOnly?S?` 后台任务继续使用原服务。`:` Background tasks keep their current service.`:``]})]}):null,U?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded-xl border border-edge p-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:I?S?`连接信息已保存,模型尚未切换。请重试。`:`Connection saved. The model has not switched; please retry.`:S?`未能应用配置,请重试。`:`Could not apply settings. Please retry.`}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:S?`查看详情`:`Show details`}),(0,Q.jsx)(`p`,{className:`mt-2 break-words`,children:U})]})]}):null,(0,Q.jsx)(`div`,{className:`flex items-center justify-end gap-3 border-t border-edge-subtle pt-4`,children:(0,Q.jsxs)(C,{variant:`primary`,disabled:B||!D&&!U||!!D&&(!R&&!M.trim()||!r||!n?.choices.some(e=>e.id===r)),onClick:()=>{D?ce():q(e=>e+1)},children:[B?(0,Q.jsx)(_,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?S?`正在应用…`:`Applying…`:!D&&U?S?`重新加载`:`Reload`:U?S?`重试`:`Retry`:R&&!M.trim()?S?`使用此模型`:`Use this model`:S?`连接并使用`:`Connect and use`]})})]})}let fe=y?`h3`:A,pe=y?`p`:E;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 px-5 py-5`,children:[d&&!B&&!G?(0,Q.jsx)(C,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":S?`返回`:`Back`,onClick:d,children:(0,Q.jsx)(u,{className:`size-4`})}):null,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(fe,{className:`text-base font-semibold text-fg`,children:i?`${S?`连接服务 · `:`Connect service · `}${$[i][+!S]}`:S?`连接模型服务`:`Connect model service`}),(0,Q.jsx)(pe,{className:`mt-2 text-sm text-fg-muted`,children:le})]}),(0,Q.jsx)(C,{variant:`ghost`,className:`shrink-0 p-1.5`,disabled:B,"aria-label":S?`关闭`:`Close`,onClick:g,children:(0,Q.jsx)(x,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-5`,children:[!D&&!U?(0,Q.jsx)(w,{className:`h-64 w-full rounded-xl`}):null,D?(0,Q.jsxs)(Q.Fragment,{children:[!G&&s.length>1&&l?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-xs text-fg-muted`,children:S?`接入方式 / 地域`:`Access method / region`}),(0,Q.jsx)(f,{value:e,disabled:B,"aria-label":S?`接入方式 / 地域`:`Access method / region`,onChange:e=>l(e.target.value),children:s.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.setupProfile?.name??e.name},e.id))})]}):null,G?(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4`}),a?S?`服务连接已保存`:`Connection saved`:S?`所选用途配置已保存`:`Selected model uses saved`]}):(0,Q.jsxs)(Q.Fragment,{children:[D.profile.credential===`oauth`&&!R?(0,Q.jsx)(re,{providerId:e,displayName:le,connected:R,onConnected:()=>{z(!0),q(e=>e+1)}}):null,(D.profile.credential===`api-key`||D.profile.credential===`oauth`&&t?.supportsApiKey)&&!r?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:D.profile.access===`subscription`?S?`套餐 API Key`:`Plan API key`:`API Key`}),(0,Q.jsx)(h,{id:`provider-setup-key`,disabled:B,value:M,onChange:N,placeholder:R?S?`留空使用已保存的凭据`:`Leave empty to use saved credentials`:`API Key`,labels:ee(c(o).providersSettings)}),Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-8 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取对应接入方式的 Key`:`Get a key for this access method`}):null]}):null,!a&&!y?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:S?`模型用途`:`Model uses`}),(0,Q.jsx)(te,{className:`flex gap-2`,indicatorClassName:`rounded-lg bg-surface-active`,children:[`fill`,`replace`].map(e=>(0,Q.jsx)(C,{variant:k.mode===e?`secondary`:`ghost`,disabled:B,"aria-pressed":k.mode===e,onClick:()=>se(e),children:e===`fill`?S?`补齐未配置`:`Fill missing`:S?`改用此服务`:`Switch to this service`},e))})]}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y?S?`仅更新当前能力,其他模型和参数保持原设置。`:`Only this capability changes; other settings are preserved.`:S?`保存连接后返回能力设置,再选择要使用的模型。`:`Save the connection, then choose a model in capability settings.`})]}),a?(0,Q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[S?`支持用途:`:`Supported uses: `,D.uses.filter(e=>e.choices.length&&(!i||e.id===i)).map(e=>$[e.id][+!S]).join(`、`)]}):null,a?null:(0,Q.jsx)(`div`,{className:`divide-y divide-edge rounded-xl border border-edge bg-surface-inset px-4`,children:D.uses.filter(e=>!y||!i||e.id===i).map(e=>{let t=k.overrides?.[e.id]??e.recommended,n=e.choices.find(e=>e.id===t);return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,Q.jsxs)(`label`,{className:`flex min-h-10 items-start gap-3`,children:[(0,Q.jsx)(`input`,{hidden:y,type:`checkbox`,className:`ui-checkbox mt-1`,checked:J.includes(e.id),disabled:y||B||G||!t||!e.choices.length,onChange:t=>j({...k,selected:t.target.checked?[...J,e.id]:J.filter(t=>t!==e.id)})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:$[e.id][+!S]}),(0,Q.jsx)(`span`,{className:`mt-1 block break-all text-xs text-fg-muted`,children:J.includes(e.id)?`${e.current?`${e.current} → `:``}${n?.name??t??``}`:e.current?`${S?`保留:`:`Keep: `}${e.current}`:e.reason===`interactive_only`?S?`此套餐不用于后台任务`:`This plan is not used for background tasks`:n?.name??(S?`暂无可自动配置的模型`:`No automatic model selection available`)})]})]}),!G&&e.choices.length>1?(0,Q.jsxs)(`details`,{open:y||void 0,className:`pl-7`,children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`选择具体模型`:`Choose a model`}),(0,Q.jsx)(f,{value:t??``,disabled:B,"aria-label":$[e.id][+!S],onChange:t=>j({...k,selected:[...new Set([...J,e.id])],overrides:{...k.overrides,[e.id]:t.target.value}}),children:e.choices.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.name},e.id))})]}):null]},e.id)})}),G?null:(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>q(e=>e+1),children:S?`刷新目录`:`Refresh catalog`}),!a&&!y?(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`任务模型与其他用途`:`Task models and other uses`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[Object.entries(D.taskModels).map(([e,t])=>(0,Q.jsxs)(`p`,{children:[e,`: `,t]},e)),(0,Q.jsx)(`p`,{children:S?`未选用途与电脑操作保留当前配置;所选用途清除跨服务回退。`:`Unselected uses and Computer Use keep their settings. Selected uses clear cross-service fallbacks.`})]})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:D.profile.interactiveOnly?S?`此套餐仅用于交互任务。后台调用会检查使用范围,不会自动切换到其他收费来源。`:`This plan is for interactive tasks. Background calls check usage scope and do not automatically switch billing sources.`:S?`仅更新勾选的全局用途,智能体和会话的独立设置继续生效。`:`Only selected global uses change. Agent and session overrides remain effective.`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:S?`配置保存与模型真实调用验证分别显示;此操作不会发送测试请求。`:`Saving settings does not perform a model test request.`})]}):null,U?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:U}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:D&&!G&&!a?S?`将配置 ${J.length} 项`:`${J.length} uses selected`:``}),G?(0,Q.jsx)(C,{onClick:g,children:S?`完成`:`Done`}):!D&&U?(0,Q.jsx)(C,{onClick:()=>q(e=>e+1),children:S?`重试`:`Retry`}):(0,Q.jsxs)(C,{onClick:()=>void ce(),disabled:B||!D||!R&&!M.trim()||y&&!J.some(e=>k.overrides?.[e]||D.uses.find(t=>t.id===e)?.recommended),children:[B?(0,Q.jsx)(_,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}):null,B?S?`正在应用…`:`Applying…`:J.length?y&&i?`${S?`连接并用于`:`Connect and use for `}${$[i][+!S]}`:S?`连接并应用`:`Connect and apply`:S?`仅连接`:`Connect only`]})]})]})}function Ie(e){let t=(0,q.c)(7),{target:n,targetUse:r,zh:i,onDone:a,onApplied:o}=e,s=i?`zh`:`en`,c;return t[0]!==o||t[1]!==a||t[2]!==s||t[3]!==n.modelIds||t[4]!==n.providerId||t[5]!==r?(c=(0,Q.jsx)(Fe,{providerId:n.providerId,modelIds:n.modelIds,targetUse:r,language:s,existingConnection:!0,onDone:a,onApplied:o},n.providerId),t[0]=o,t[1]=a,t[2]=s,t[3]=n.modelIds,t[4]=n.providerId,t[5]=r,t[6]=c):c=t[6],c}function Le(e){let t=(0,q.c)(38),{open:n,initialProviderId:r,initialUse:i,connectOnly:a,onOpenChange:o,builtinRows:s,customConfig:c,labels:l,language:u,onSaved:d}=e,f=a!==void 0&&a,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={type:`pick`},t[0]=p):p=t[0];let[m,h]=(0,K.useState)(p),[g,_]=(0,K.useState)(``),v;t[1]!==r||t[2]!==m?(v=m.type===`pick`&&r?{type:`builtin`,providerId:r}:m,t[1]=r,t[2]=m,t[3]=v):v=t[3];let y=v,b=(0,K.useRef)(0),x;t[4]!==y.providerId||t[5]!==y.type||t[6]!==s?(x=y.type===`builtin`?s.find(e=>e.id===y.providerId)?.setupProfile?.brand:void 0,t[4]=y.providerId,t[5]=y.type,t[6]=s,t[7]=x):x=t[7];let C=x,w;t[8]===o?w=t[9]:(w=e=>{e||window.setTimeout(()=>{h({type:`pick`}),_(``),b.current=0},200),o(e)},t[8]=o,t[9]=w);let E=w,D;t[10]!==s||t[11]!==f||t[12]!==E||t[13]!==d?(D=(e,t)=>{let n=s.some(t=>t.id===e&&t.configured);f||t?.length===0||t===void 0&&n?(d(e),E(!1)):h({type:`success`,target:{providerId:e,modelIds:t}})},t[10]=s,t[11]=f,t[12]=E,t[13]=d,t[14]=D):D=t[14];let A=D,P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(T,{className:S(`xopc-dialog-overlay fixed inset-0 bg-scrim`,N)}),t[15]=P):P=t[15];let F;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(F=S(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(40rem,calc(100vh-3rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,M),t[16]=F):F=t[16];let I;t[17]!==y.presetKey||t[18]!==y.providerId||t[19]!==y.target||t[20]!==y.type||t[21]!==s||t[22]!==f||t[23]!==c||t[24]!==E||t[25]!==A||t[26]!==r||t[27]!==i||t[28]!==l||t[29]!==u||t[30]!==d||t[31]!==g||t[32]!==C?(I=(0,Q.jsxs)(O,{children:[P,(0,Q.jsx)(k,{className:F,children:y.type===`success`?(0,Q.jsx)(Ie,{target:y.target,targetUse:i,zh:u===`zh`,onApplied:()=>d(y.target.providerId),onDone:()=>E(!1)}):y.type===`pick`?(0,Q.jsx)(ze,{builtinRows:s,searchQuery:g,onSearchChange:_,labels:l,language:u,scrollTopRef:b,onPickBuiltin:e=>{let t=De(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onPickCustom:()=>h({type:`custom`})}):y.type===`builtin`?(0,Q.jsx)(Fe,{providerId:y.providerId,targetUse:i,connectOnly:f,row:s.find(e=>e.id===y.providerId),language:u,alternatives:C?s.filter(e=>e.setupProfile?.brand===C):[],onChooseProvider:e=>{let t=De(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onBack:r?void 0:()=>h({type:`pick`}),onApplied:()=>{d(y.providerId),f&&E(!1)},onDone:()=>E(!1)},y.providerId):(0,Q.jsx)(Ge,{initialPresetKey:y.presetKey,customConfig:c,labels:l,language:u,onBack:()=>h({type:`pick`}),onSaved:A})})]}),t[17]=y.presetKey,t[18]=y.providerId,t[19]=y.target,t[20]=y.type,t[21]=s,t[22]=f,t[23]=c,t[24]=E,t[25]=A,t[26]=r,t[27]=i,t[28]=l,t[29]=u,t[30]=d,t[31]=g,t[32]=C,t[33]=I):I=t[33];let L;return t[34]!==E||t[35]!==n||t[36]!==I?(L=(0,Q.jsx)(j,{open:n,onOpenChange:E,children:I}),t[34]=E,t[35]=n,t[36]=I,t[37]=L):L=t[37],L}function Re(e){let t=(0,q.c)(4),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=S(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.press),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Q.jsx)(D,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:r,"aria-label":n,children:i})}),t[2]=n,t[3]=a),a}function ze({builtinRows:e,searchQuery:t,onSearchChange:n,labels:r,language:i,scrollTopRef:a,onPickBuiltin:o,onPickCustom:s}){let c=t.trim().toLowerCase(),l=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=l.current;e&&a.current>0&&(e.scrollTop=a.current)},[a]);let u=(0,K.useMemo)(()=>c?e.filter(e=>{let t=X[e.id]?.aliases??[];return e.id.toLowerCase().includes(c)||e.name.toLowerCase().includes(c)||t.some(e=>e.toLowerCase().includes(c))}):e,[e,c]),f=(0,K.useMemo)(()=>{let e=new Set;return u.filter(t=>{let n=t.setupProfile?.brand??t.id;return e.has(n)?!1:(e.add(n),!0)})},[u]),p=f.filter(e=>e.onboardingFeatured&&[`subscription`,`account`].includes(e.setupProfile?.access??``)).slice(0,6),m=p.map(e=>e.id),h=f.filter(e=>e.configured&&!m.includes(e.id)),_=(0,K.useMemo)(()=>he(f.filter(e=>!m.includes(e.id)&&!e.configured)),[f,m]),v=e=>{let t=X[e.id];return i===`zh`?t?.descriptionZh??t?.description:t?.description};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pb-3 pt-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(A,{className:`text-base font-semibold text-fg`,children:r.step1Title}),(0,Q.jsx)(E,{className:`mt-1 text-sm text-fg-muted`,children:r.step1Subtitle})]}),(0,Q.jsx)(Re,{label:r.close})]}),(0,Q.jsx)(`div`,{className:`px-5 pb-3`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(y,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:r.searchPlaceholder,autoComplete:`off`,className:S(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg placeholder:text-fg-subtle`,V)})]})}),(0,Q.jsx)(`div`,{ref:l,onScroll:e=>{a.current=e.currentTarget.scrollTop},className:`min-h-0 flex-1 overscroll-contain overflow-y-auto px-5 pb-5`,children:c&&f.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:r.noResults}):c?(0,Q.jsx)(Be,{title:r.searchResults,children:f.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p.length>0?(0,Q.jsx)(Be,{title:r.quickStart,children:p.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,prominent:!0,onPick:o},e.id))}):null,h.length>0?(0,Q.jsx)(Be,{title:r.connectedSection,children:h.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))}):null,me.map(e=>{let t=_.get(e)??[];return t.length===0?null:(0,Q.jsx)(Be,{title:r.categories[e]??e,children:t.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))},e)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:s,className:S(`flex w-full items-center gap-3 rounded-xl bg-surface-hover/25 px-4 py-3 text-left transition-colors`,`hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base/60 text-fg-muted`,children:(0,Q.jsx)(g,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.addCustom}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r.customDescription})]}),(0,Q.jsx)(d,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]})})]})}function Be(e){let t=(0,q.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`h3`,{className:`mb-1.5 px-1 text-xs font-semibold text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`section`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ve(e){let t=(0,q.c)(27),{row:n,description:r,labels:i,prominent:a,onPick:o}=e,s=a!==void 0&&a,c;t[0]!==o||t[1]!==n.id?(c=()=>o(n.id),t[0]=o,t[1]=n.id,t[2]=c):c=t[2];let l=s&&`bg-surface-base/80`,u;t[3]===l?u=t[4]:(u=S(`flex min-h-12 w-full items-center gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5 text-left transition-colors`,`hover:bg-surface-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,l),t[3]=l,t[4]=u);let f;t[5]===n.name?f=t[6]:(f=(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:n.name}),t[5]=n.name,t[6]=f);let p;t[7]!==i||t[8]!==s?(p=s?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:i.recommended}):null,t[7]=i,t[8]=s,t[9]=p):p=t[9];let h;t[10]!==f||t[11]!==p?(h=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=h):h=t[12];let g;t[13]===r?g=t[14]:(g=r?(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:r}):null,t[13]=r,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[h,g]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==i||t[19]!==n.configured?(v=n.configured?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-1 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,Q.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),i.connected]}):null,t[18]=i,t[19]=n.configured,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(d,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==c||t[24]!==u||t[25]!==_?(b=(0,Q.jsxs)(`button`,{type:`button`,onClick:c,className:u,children:[_,v,y]}),t[22]=v,t[23]=c,t[24]=u,t[25]=_,t[26]=b):b=t[26],b}function He(e){return{clientKey:crypto.randomUUID(),value:e}}function Ue(e=`custom`){if(e!==`custom`&&Z[e]){let t=Z[e].config;return{preset:e,providerId:we(e),baseUrl:t.baseUrl??``,api:t.api??`openai-completions`,apiKey:t.apiKey??``,modelSlots:(t.models?.map(e=>e.id)??[``]).map(He),error:null}}return{preset:`custom`,providerId:``,baseUrl:``,api:`openai-completions`,apiKey:``,modelSlots:[He(``)],error:null}}function We(e,t){switch(t.type){case`applyPreset`:return t.key===`custom`?{...e,preset:`custom`,error:null}:Z[t.key]?Ue(t.key):e;case`setProviderId`:return{...e,providerId:t.value};case`setBaseUrl`:return{...e,baseUrl:t.value};case`setApi`:return{...e,api:t.value};case`setApiKey`:return{...e,apiKey:t.value};case`addModelSlot`:return{...e,modelSlots:[...e.modelSlots,He(``)]};case`updateModelId`:return{...e,modelSlots:e.modelSlots.map((e,n)=>n===t.index?{...e,value:t.value}:e)};case`setModelIds`:return{...e,modelSlots:(t.values.length>0?t.values:[``]).map(He)};case`removeModelSlot`:return{...e,modelSlots:e.modelSlots.filter((e,n)=>n!==t.index)};case`setError`:return{...e,error:t.value}}}function Ge({initialPresetKey:e,customConfig:t,labels:n,language:r,onBack:i,onSaved:a}){let[o,s]=(0,K.useReducer)(We,void 0,()=>Ue(e)),[l,u]=(0,K.useState)(!1),[m,g]=(0,K.useState)(!1),b=ee(c(r).providersSettings),{preset:w,providerId:T,baseUrl:E,api:D,apiKey:O,modelSlots:k,error:j}=o,M=k.map(e=>e.value),N=async()=>{let e=T.trim(),r=E.trim();if(!e){s({type:`setError`,value:n.providerIdRequired});return}if(!r){s({type:`setError`,value:n.baseUrlRequired});return}let i=M.map(e=>e.trim()).filter(Boolean);u(!0),s({type:`setError`,value:null});try{let n=t?.providers??{},o=w===`custom`?void 0:Z[w]?.config,s={...o??{},baseUrl:r,api:D,apiKey:O.trim()||void 0,models:i.map(e=>o?.models?.find(t=>t.id===e)??{id:e})};await be({providers:{...n,[e]:s}});let c=new Set(n[e]?.models?.map(e=>e.id)??[]);a(e,s.models?.filter(e=>!c.has(e.id)&&!e.computerUse).map(e=>e.id)??[])}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.saveError})}finally{u(!1)}},P=async()=>{let e=T.trim()||we(w)||`custom`,t=E.trim();if(!t){s({type:`setError`,value:n.baseUrlRequired});return}g(!0),s({type:`setError`,value:null});try{let r=w===`custom`?void 0:Z[w]?.config,i=(await xe({providerId:e,baseUrl:t,apiKey:O.trim()||void 0,api:D,headers:r?.headers})).map(e=>e.id).filter(e=>e&&!e.includes(`/`));s({type:`setModelIds`,values:i}),i.length===0&&s({type:`setError`,value:n.discoverModelsHint})}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.discoverModelsHint})}finally{g(!1)}},I=T.trim()&&E.trim(),L=(D===`openai-completions`||D===`openai-responses`)&&E.trim();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-3 pt-5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:S(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.press),"aria-label":n.back,children:(0,Q.jsx)(d,{className:`size-4 rotate-180`,"aria-hidden":!0})}),(0,Q.jsx)(A,{className:`min-w-0 flex-1 text-base font-semibold text-fg`,children:n.step2CustomTitle}),(0,Q.jsx)(Re,{label:n.close})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 pb-4`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.customDescription}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-preset`,className:`text-sm font-medium text-fg`,children:n.presetLabel}),(0,Q.jsxs)(f,{id:`custom-preset`,value:w,onChange:e=>s({type:`applyPreset`,key:e.target.value}),className:Ae(),children:[(0,Q.jsx)(p,{value:`custom`,children:n.presetCustom}),Ce.map(e=>(0,Q.jsx)(p,{value:e.key,children:e.label},e.key))]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-provider-id`,className:`text-sm font-medium text-fg`,children:n.providerIdLabel}),(0,Q.jsx)(`input`,{id:`custom-provider-id`,type:`text`,autoComplete:`off`,value:T,onChange:e=>s({type:`setProviderId`,value:e.target.value}),placeholder:n.providerIdPlaceholder,className:S(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,Q.jsx)(`input`,{id:`custom-base-url`,type:`url`,autoComplete:`off`,value:E,onChange:e=>s({type:`setBaseUrl`,value:e.target.value}),placeholder:n.baseUrlPlaceholder,className:S(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-type`,className:`text-sm font-medium text-fg`,children:n.apiTypeLabel}),(0,Q.jsx)(f,{id:`custom-api-type`,value:D,onChange:e=>s({type:`setApi`,value:e.target.value}),className:Ae(),children:ge.map(e=>(0,Q.jsx)(p,{value:e.value,children:e.label},e.value))})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-key`,className:`text-sm font-medium text-fg`,children:n.apiKeyLabel}),(0,Q.jsx)(h,{id:`custom-api-key`,value:O,onChange:e=>s({type:`setApiKey`,value:e}),placeholder:n.apiKeyPlaceholder,labels:b})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.modelIdLabel}),(0,Q.jsxs)(C,{type:`button`,variant:`secondary`,className:`gap-1.5`,disabled:!L||m,onClick:()=>void P(),children:[m?(0,Q.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(y,{className:`size-3.5`,"aria-hidden":!0}),m?n.discoveringModels:n.discoverModels]})]}),M.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,autoComplete:`off`,value:e,onChange:e=>s({type:`updateModelId`,index:t,value:e.target.value}),placeholder:n.modelIdPlaceholder,className:S(`flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)}),M.length>1?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>s({type:`removeModelSlot`,index:t}),className:S(`rounded-lg p-1.5 text-fg-subtle hover:bg-surface-hover hover:text-fg`,F.press),children:(0,Q.jsx)(x,{className:`size-3.5`,"aria-hidden":!0})}):null]},k[t].clientKey)),(0,Q.jsxs)(C,{type:`button`,variant:`ghost`,className:`w-fit gap-1.5 text-fg-muted`,onClick:()=>s({type:`addModelSlot`}),children:[(0,Q.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),n.addModel]})]}),j?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:j}):null]})}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 bg-surface-hover/15 px-5 py-3`,children:[(0,Q.jsx)(C,{type:`button`,variant:`secondary`,onClick:i,children:n.cancel}),(0,Q.jsx)(C,{type:`button`,variant:`primary`,disabled:!I||l,onClick:()=>void N(),children:l?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})]})]})}function Ke(){let e=(0,q.c)(29),t=!!o(Qe),{data:n,isLoading:r}=I(t),i;e[0]===t?i=e[1]:(i=t?a(`/api/providers/meta`):null,e[0]=t,e[1]=i);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},e[2]=s):s=e[2];let{data:c,isLoading:l}=P(i,Ze,s),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u={revalidateOnFocus:!1},e[3]=u):u=e[3];let{data:d,isLoading:f}=P(t?R:null,Xe,u),p;e[4]===d?p=e[5]:(p=d===void 0?[]:d,e[4]=d,e[5]=p);let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1},e[6]=h):h=e[6];let{data:g}=P(t?U:null,Ye,h),_;bb0:{if(!c||n===void 0){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[7]=t):t=e[7],_=t;break bb0}let t;e[8]!==n?.payload?.config||e[9]!==c||e[10]!==m?(t=W(c,G(n?.payload?.config),m),e[8]=n?.payload?.config,e[9]=c,e[10]=m,e[11]=t):t=e[11],_=t}let v=_,y;bb1:{if(!g){y=null;break bb1}let t;e[12]===g.config?t=e[13]:(t=ve(g.config),e[12]=g.config,e[13]=t),y=t}let b=y,x;if(e[14]!==v||e[15]!==b||e[16]!==c||e[17]!==m){x=[];let t=new Set((c??[]).filter(Je).map(qe)),n;e[19]===b?n=e[20]:(n=new Set(b?Object.keys(b.providers):[]),e[19]=b,e[20]=n);let r=n;for(let e of v){if(!t.has(e.id))continue;let n=r.has(e.id),i=n?b.providers[e.id]?.models?.length??0:m.filter(t=>t.provider===e.id).length;x.push({id:e.id,name:e.name,configured:!0,isCustom:n,modelCount:i})}if(b){let t;e[21]===b.providers?t=e[22]:(t=Object.entries(b.providers),e[21]=b.providers,e[22]=t);for(let[e,n]of t)x.some(t=>t.id===e)||x.push({id:e,name:e,configured:!0,isCustom:!0,modelCount:n.models?.length??0})}e[14]=v,e[15]=b,e[16]=c,e[17]=m,e[18]=x}else x=e[18];let S=x,C=r||l||f,w;return e[23]!==v||e[24]!==S||e[25]!==b||e[26]!==C||e[27]!==m?(w={cards:S,loading:C,builtinRows:v,customConfig:b,allModels:m},e[23]=v,e[24]=S,e[25]=b,e[26]=C,e[27]=m,e[28]=w):w=e[28],w}function qe(e){return e.id}function Je(e){return e.configured}function Ye(){return ye()}function Xe(){return L()}async function Ze(e){let{payload:t}=await(await fetch(e,{credentials:`same-origin`,redirect:`error`})).json();return t?.providers??[]}function Qe(e){return e.conversationId}function $e(e){let t=(0,q.c)(12),{labels:n,data:r,onAdd:i,onManage:a}=e,{cards:o,loading:s}=r;if(s){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(w,{className:`h-6 w-48 max-w-full`}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-busy":`true`,children:[e,(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:[1,2,3].map(tt)})]}),t[1]=n):n=t[1],n}let c;if(t[2]!==o||t[3]!==n||t[4]!==i||t[5]!==a){let e=o.filter(et),r=e.length>0?n.titleCount.replace(`{{count}}`,String(e.length)):n.title,s;t[7]===r?s=t[8]:(s=(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r}),t[7]=r,t[8]=s);let l=e.length>0?(0,Q.jsxs)(C,{type:`button`,variant:`primary`,className:`gap-1.5`,onClick:i,children:[(0,Q.jsx)(v,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]}):null,u;t[9]!==s||t[10]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],c=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/25 px-6 py-10 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.empty}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint}),(0,Q.jsxs)(C,{type:`button`,variant:`primary`,className:`mt-4 gap-1.5`,onClick:i,children:[(0,Q.jsx)(v,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]})]}):(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:e.map(e=>(0,Q.jsx)(nt,{card:e,labels:n,onManage:()=>a(e.id,e.isCustom)},e.id))})]}),t[2]=o,t[3]=n,t[4]=i,t[5]=a,t[6]=c}else c=t[6];return c}function et(e){return e.configured}function tt(e){return(0,Q.jsx)(w,{className:`h-16 rounded-lg`},e)}function nt(e){let t=(0,q.c)(26),{card:n,labels:r,onManage:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=S(`group relative flex min-h-16 w-full flex-col justify-center gap-2 rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors sm:flex-row sm:items-center sm:gap-4`,`hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,F.pressCard),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(m,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),t[1]=o):o=t[1];let s;t[2]===n.name?s=t[3]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 text-sm font-semibold leading-snug text-fg`,children:n.name}),t[2]=n.name,t[3]=s);let c;t[4]!==n.isCustom||t[5]!==r.custom?(c=n.isCustom?(0,Q.jsx)(`span`,{className:`shrink-0 rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:r.custom}):null,t[4]=n.isCustom,t[5]=r.custom,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[o,s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==n.modelCount||t[11]!==r.modelsCount||t[12]!==r.noModels?(u=n.modelCount>0?r.modelsCount.replace(`{{count}}`,String(n.modelCount)):r.noModels,t[10]=n.modelCount,t[11]=r.modelsCount,t[12]=r.noModels,t[13]=u):u=t[13];let d;t[14]===u?d=t[15]:(d=(0,Q.jsx)(`span`,{className:`whitespace-nowrap text-xs text-fg-subtle`,children:u}),t[14]=u,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(b,{className:`size-3`,"aria-hidden":!0}),t[16]=f):f=t[16];let p;t[17]===r.manage?p=t[18]:(p=(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-medium text-accent-fg`,children:[f,r.manage]}),t[17]=r.manage,t[18]=p);let h;t[19]!==d||t[20]!==p?(h=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-4 pl-6 sm:justify-end sm:pl-0`,children:[d,p]}),t[19]=d,t[20]=p,t[21]=h):h=t[21];let g;return t[22]!==i||t[23]!==h||t[24]!==l?(g=(0,Q.jsxs)(`button`,{type:`button`,onClick:i,className:a,children:[l,h]}),t[22]=i,t[23]=h,t[24]=l,t[25]=g):g=t[25],g}export{oe as C,ae as D,le as E,ie as O,J as S,se as T,pe as _,Fe as a,Y as b,Oe as c,De as d,je as f,X as g,be as h,Ie as i,ke as l,Se as m,Ke as n,Ne as o,Ae as p,Le as r,Pe as s,$e as t,Me as u,fe as v,ce as w,ue as x,de as y};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{a as i,i as a,l as o,o as s}from"./locale-store-Bg_XR36n.js";import{t as c}from"./messages-DG4HLOER.js";import{t as l}from"./createLucideIcon-DPHK1VkS.js";import{t as u}from"./chevron-left-DqFhpbvK.js";import{t as d}from"./chevron-right-BweFrslA.js";import{n as f,r as p}from"./popover-select-DD8fmrxH.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./secret-input-BQvFXqzz.js";import{t as g}from"./globe-DSSGFWFn.js";import{t as _}from"./loader-circle-CifKLtgG.js";import{t as v}from"./plus-Q2yW6OE7.js";import{t as y}from"./search-DA7gz22f.js";import{t as b}from"./settings-2-D-csvaET.js";import{t as x}from"./x-B_N4OPjy.js";import{t as S}from"./cn-0WouolD0.js";import{t as C}from"./button-CnRSIP6m.js";import{t as w}from"./skeleton-BI5TyibZ.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./dist-DfWfZ9iu.js";import{i as M,o as N}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{i as P}from"./vendor-swr-CdRzEUwF.js";import{n as F}from"./interaction-BdhHBbYa.js";import{r as I}from"./gateway-config-swr-DfPQIHOL.js";import{n as L,t as R}from"./registry-api-Vy7LfH6E.js";import{a as z,o as B,s as V}from"./form-field-width-DJw_jULe.js";import{n as ee}from"./secret-input-labels-B5Jl5HqK.js";import{t as te}from"./sliding-tab-list-DuQyViqe.js";import{i as H,n as U}from"./models-hub-cache-KOJC3z6Q.js";import{a as ne,i as W,o as G}from"./providers-api-rwQ4LWzr.js";import{t as re}from"./oauth-provider-connect-DGGGGtcB.js";var ie=l(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),ae=l(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),K=e(t(),1),q=n(),J=[{label:[`文本`,`Text`],uses:[`chat`]},{label:[`图片`,`Images`],uses:[`vision`,`image`]},{label:[`语音`,`Voice`],uses:[`transcription`,`speech`,`conversation`]},{label:[`后台`,`Background`],uses:[`background`]}],oe={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`生成图片`,`Image generation`],transcription:[`录音与听写`,`Recording and dictation`],speech:[`文字转语音`,`Text to speech`],conversation:[`实时语音对话`,`Realtime conversation`],background:[`自动与后台任务`,`Background tasks`]};function se(e){return e&&Object.hasOwn(oe,e)?e:void 0}function ce(e){return e&&!/[\\\r\n]/.test(e)&&(e.startsWith(`/chat/`)||e===`/personal`||e===`/settings/phone-use`||e.startsWith(`/automations`))?e:void 0}function le(e,t){let[n,r]=e.split(`?`),i=new URLSearchParams(r),a=ce(t.get(`returnTo`));return a&&i.set(`returnTo`,a),`${n}${i.size?`?${i}`:``}`}async function Y(e){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}`))).payload}async function ue(e,t={}){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).payload}async function de(e,t,n){await s(a(`/api/models/setup/${encodeURIComponent(e)}/apply`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,revision:n})}),await H()}function fe(e,t){return e===`single`?t.getApiKey:e===`intl`?t.getApiKeyIntl:t.getApiKeyCn}var X={"qwen-token-plan-cn":{apiKeyUrl:`https://bailian.console.aliyun.com/cn-beijing/subscription/overview`,docsUrl:`https://help.aliyun.cn/zh/model-studio/token-plan-personal-quick-start`,description:`Alibaba Bailian subscription. Configure chat, vision and image generation with one key.`,descriptionZh:`阿里云百炼订阅,一份 Key 配置对话、视觉和图片生成。`,bestFor:[`general`,`coding`,`vision`],aliases:[`阿里云订阅`,`百炼订阅`,`aliyun`,`bailian`,`qwen`,`token plan`,`通义`,`千问`],envVars:[`QWEN_TOKEN_PLAN_CN_API_KEY`]},openai:{apiKeyUrl:`https://platform.openai.com/api-keys`,pricingUrl:`https://openai.com/pricing`,docsUrl:`https://platform.openai.com/docs`,description:`The most widely used LLM provider. Powers ChatGPT.`,descriptionZh:`最广泛使用的 LLM 服务商,ChatGPT 背后的技术。`,bestFor:[`general`,`coding`,`vision`],freeTier:!1,freeTierNote:`Pay-as-you-go; new accounts may receive trial credits.`,aliases:[`chatgpt`,`gpt`,`gpt-4`,`gpt4`,`gpt-4o`,`gpt4o`],envVars:[`OPENAI_API_KEY`]},anthropic:{apiKeyUrl:`https://console.anthropic.com/settings/keys`,pricingUrl:`https://www.anthropic.com/pricing`,docsUrl:`https://docs.anthropic.com`,description:`Anthropic model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Anthropic 模型服务。可用模型由网关目录动态加载。`,bestFor:[`long context`,`coding`,`reasoning`],freeTier:!1,aliases:[`claude`,`claude 3`,`claude sonnet`,`claude opus`,`claude haiku`],envVars:[`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`]},google:{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Google AI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Google AI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`multimodal`,`long context`,`general`],freeTier:!0,freeTierNote:`Free tier available via Google AI Studio.`,aliases:[`gemini`,`google gemini`,`bard`,`google ai`],envVars:[`GEMINI_API_KEY`,`GOOGLE_API_KEY`]},"google-vertex":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/vertex-ai/pricing`,docsUrl:`https://cloud.google.com/vertex-ai/docs`,description:`Google Vertex AI — enterprise-grade model hosting on GCP.`,descriptionZh:`Google Vertex AI,企业级 GCP 托管模型服务。`,bestFor:[`enterprise`,`multimodal`,`compliance`],freeTier:!1,aliases:[`vertex`,`vertex ai`,`gcp`,`google cloud`],envVars:[`GOOGLE_CLOUD_API_KEY`,`GOOGLE_CLOUD_PROJECT`,`GOOGLE_CLOUD_LOCATION`]},"google-gemini-cli":{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Gemini via CLI token — for users authenticated with the Gemini CLI tool.`,descriptionZh:`通过 Gemini CLI 令牌访问 Gemini,适合已安装 CLI 工具的用户。`,bestFor:[`general`,`multimodal`],freeTier:!0,freeTierNote:`Uses your existing Gemini CLI authentication.`,aliases:[`gemini cli`,`gemini-cli`],envVars:[`GEMINI_CLI_TOKEN`,`GOOGLE_TOKEN`]},"google-antigravity":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/pricing`,docsUrl:`https://cloud.google.com/docs`,description:`Google Antigravity — internal/experimental Google AI endpoint.`,descriptionZh:`Google Antigravity,Google 内部/实验性 AI 端点。`,bestFor:[`experimental`],freeTier:!1,aliases:[`antigravity`,`google antigravity`],envVars:[`ANTIGRAVITY_API_KEY`]},groq:{apiKeyUrl:`https://console.groq.com/keys`,pricingUrl:`https://groq.com/pricing/`,docsUrl:`https://console.groq.com/docs`,description:`Extremely fast inference — ideal for latency-sensitive applications.`,descriptionZh:`推理速度极快,适合对延迟敏感的场景。`,bestFor:[`speed`,`cheap`],freeTier:!0,freeTierNote:`Generous free tier with rate limits.`,aliases:[`groq`,`llama on groq`,`mixtral on groq`],envVars:[`GROQ_API_KEY`]},deepseek:{apiKeyUrl:`https://platform.deepseek.com/api_keys`,pricingUrl:`https://api-docs.deepseek.com/quick_start/pricing/`,docsUrl:`https://platform.deepseek.com/api-docs/`,description:`DeepSeek model access through an OpenAI-compatible API.`,descriptionZh:`通过 OpenAI 兼容 API 访问 DeepSeek 模型。`,bestFor:[`reasoning`,`cheap`,`coding`],freeTier:!0,freeTierNote:`Free credits may be available for new accounts.`,aliases:[`deepseek`,`deep seek`,`deepseek v4`,`deepseek-v4`,`r1`],envVars:[`DEEPSEEK_API_KEY`]},"volcengine-ark":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Ark — OpenAI-compatible access to Doubao and custom Ark endpoints.`,descriptionZh:`火山方舟,通过 OpenAI 兼容接口访问豆包与自定义方舟 endpoint。`,bestFor:[`chinese`,`general`,`enterprise`],aliases:[`volcengine`,`ark`,`doubao`,`volces`,`火山方舟`,`豆包`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"volcengine-plan":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Doubao Coding Plan — Ark coding endpoint.`,descriptionZh:`火山方舟豆包 Coding Plan,使用 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`volcengine plan`,`ark coding`,`doubao coding`,`火山方舟 coding`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"byteplus-plan":{apiKeyUrl:`https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey`,pricingUrl:`https://docs.byteplus.com/en/docs/ModelArk`,docsUrl:`https://docs.byteplus.com/en/docs/ModelArk/OpenAI`,description:`BytePlus Doubao Coding Plan — international Ark coding endpoint.`,descriptionZh:`BytePlus 豆包 Coding Plan,国际区 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`byteplus`,`byteplus plan`,`doubao coding international`],envVars:[`BYTEPLUS_API_KEY`,`ARK_API_KEY`]},xai:{apiKeyUrl:`https://console.x.ai/`,pricingUrl:`https://x.ai/api`,docsUrl:`https://docs.x.ai/`,description:`xAI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`xAI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`reasoning`,`real-time`],freeTier:!1,aliases:[`grok`,`xai`,`x.ai`],envVars:[`XAI_API_KEY`]},cerebras:{apiKeyUrl:`https://cloud.cerebras.ai/platform/`,pricingUrl:`https://cloud.cerebras.ai/platform/`,docsUrl:`https://inference-docs.cerebras.ai/`,description:`Ultra-fast inference on custom AI chips. Fastest Llama inference available.`,descriptionZh:`基于专用 AI 芯片的超快推理,Llama 推理速度业界最快。`,bestFor:[`speed`],freeTier:!0,freeTierNote:`Free tier available.`,aliases:[`cerebras`],envVars:[`CEREBRAS_API_KEY`]},mistral:{apiKeyUrl:`https://console.mistral.ai/api-keys/`,pricingUrl:`https://mistral.ai/technology/#pricing`,docsUrl:`https://docs.mistral.ai/`,description:`European open-weight models. Good balance of quality and cost.`,descriptionZh:`欧洲开源模型,质量与成本平衡好。`,bestFor:[`general`,`cheap`,`coding`],freeTier:!1,aliases:[`mistral`,`mixtral`,`codestral`],envVars:[`MISTRAL_API_KEY`]},openrouter:{apiKeyUrl:`https://openrouter.ai/keys`,pricingUrl:`https://openrouter.ai/models`,docsUrl:`https://openrouter.ai/docs`,description:`API gateway to 100+ models from many providers with a single key.`,descriptionZh:`统一 API 网关,一个 Key 访问 100+ 模型。`,bestFor:[`general`,`flexibility`],freeTier:!0,freeTierNote:`Some models are free; pay-per-use for others.`,aliases:[`openrouter`,`open router`],envVars:[`OPENROUTER_API_KEY`]},azure:{apiKeyUrl:`https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI`,pricingUrl:`https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`,docsUrl:`https://learn.microsoft.com/en-us/azure/ai-services/openai/`,description:`OpenAI models hosted on Azure. Enterprise SLA and data residency.`,descriptionZh:`Azure 托管的 OpenAI 模型,企业级 SLA 和数据合规。`,bestFor:[`enterprise`,`compliance`,`coding`],freeTier:!1,aliases:[`azure`,`azure openai`,`aoai`],envVars:[`AZURE_OPENAI_API_KEY`,`AZURE_OPENAI_BASE_URL`]},"amazon-bedrock":{apiKeyUrl:`https://console.aws.amazon.com/iam/home#/security_credentials`,pricingUrl:`https://aws.amazon.com/bedrock/pricing/`,docsUrl:`https://docs.aws.amazon.com/bedrock/`,description:`AWS Bedrock hosted model access with enterprise controls.`,descriptionZh:`AWS Bedrock 托管模型服务,提供企业级控制能力。`,bestFor:[`enterprise`,`compliance`],freeTier:!1,aliases:[`bedrock`,`aws`,`amazon`],envVars:[`AWS_ACCESS_KEY_ID`,`AWS_SECRET_ACCESS_KEY`,`AWS_REGION`]},minimax:{apiKeyUrl:`https://platform.minimax.io/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimax.io/docs/guides/models-intro`,docsUrl:`https://platform.minimax.io/docs/guides/quickstart-preparation`,description:`MiniMax — Chinese multimodal model with strong text and audio capabilities.`,descriptionZh:`MiniMax,国产多模态模型,文本和音频能力强。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax`,`mini max`,`abab`],envVars:[`MINIMAX_API_KEY`]},"minimax-cn":{apiKeyUrl:`https://platform.minimaxi.com/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimaxi.com/document/Price`,docsUrl:`https://platform.minimaxi.com/document/Announcement`,description:`MiniMax (China endpoint) — domestic access for Chinese users.`,descriptionZh:`MiniMax 国内端点,国内用户直连访问。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax cn`,`minimax china`,`abab`],envVars:[`MINIMAX_CN_API_KEY`,`MINIMAX_API_KEY`]},stepfun:{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun OpenAI-compatible endpoint.`,descriptionZh:`阶跃星辰 StepFun OpenAI 兼容端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun`,`step`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun China — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 中国区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun cn`,`step cn`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun International — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 国际区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun intl`,`step international`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan`,`step plan`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan China — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 中国区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan cn`,`step plan cn`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan International — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 国际区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan intl`,`step plan international`],envVars:[`STEPFUN_API_KEY`]},"kimi-coding":{apiKeyUrl:`https://platform.kimi.com/console/api-keys`,pricingUrl:`https://platform.kimi.com/docs/pricing/chat`,docsUrl:`https://platform.kimi.com/docs`,description:`Kimi Coding — dedicated Anthropic-compatible coding endpoint.`,descriptionZh:`Kimi Coding,Anthropic 兼容的专用 coding 端点。`,bestFor:[`coding`,`chinese`,`vision`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`kimi coding`,`moonshot coding`,`kimi code`],envVars:[`KIMI_API_KEY`,`MOONSHOT_API_KEY`]},moonshotai:{apiKeyUrl:`https://platform.moonshot.ai/console/api-keys`,pricingUrl:`https://platform.moonshot.ai/docs/pricing`,docsUrl:`https://platform.moonshot.ai/docs`,description:`Moonshot Kimi — international API (api.moonshot.ai).`,descriptionZh:`月之暗面 Kimi 国际版 API(api.moonshot.ai)。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot`,`kimi`,`moonshot ai`],envVars:[`MOONSHOT_API_KEY`]},"moonshotai-cn":{apiKeyUrl:`https://platform.moonshot.cn/console/api-keys`,pricingUrl:`https://platform.moonshot.cn/docs/pricing/chat`,docsUrl:`https://platform.moonshot.cn/docs`,description:`Moonshot Kimi — China region endpoint.`,descriptionZh:`月之暗面 Kimi 中国区域端点。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot cn`,`kimi cn`],envVars:[`MOONSHOT_API_KEY`]},fal:{apiKeyUrl:`https://fal.ai/dashboard/keys`,pricingUrl:`https://fal.ai/pricing`,docsUrl:`https://fal.ai/docs`,description:`fal — serverless image and media generation APIs.`,descriptionZh:`fal:无服务器图像与媒体生成 API。`,bestFor:[`image`,`video`],freeTier:!0,aliases:[`fal ai`,`fal.ai`],envVars:[`FAL_KEY`,`FAL_API_KEY`]},fireworks:{apiKeyUrl:`https://fireworks.ai/account/api-keys`,pricingUrl:`https://fireworks.ai/pricing`,docsUrl:`https://docs.fireworks.ai`,description:`Fireworks AI — fast inference for open and proprietary models.`,descriptionZh:`Fireworks AI,多种开源与商业模型的高速推理服务。`,bestFor:[`speed`,`coding`,`open weights`],freeTier:!0,aliases:[`fireworks ai`,`fireworks`],envVars:[`FIREWORKS_API_KEY`]},together:{apiKeyUrl:`https://api.together.xyz/settings/api-keys`,pricingUrl:`https://www.together.ai/pricing`,docsUrl:`https://docs.together.ai`,description:`Together AI — hosted Llama, Qwen, DeepSeek, and more.`,descriptionZh:`Together AI,托管 Llama、Qwen、DeepSeek 等模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,aliases:[`together ai`,`together.xyz`],envVars:[`TOGETHER_API_KEY`]},"cloudflare-workers-ai":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/workers-ai`,pricingUrl:`https://developers.cloudflare.com/workers-ai/platform/pricing/`,docsUrl:`https://developers.cloudflare.com/workers-ai/`,description:`Cloudflare Workers AI — models at the edge via Cloudflare API.`,descriptionZh:`Cloudflare Workers AI,通过 Cloudflare API 在边缘运行模型。`,bestFor:[`edge`,`latency`],freeTier:!0,aliases:[`workers ai`,`cf workers ai`],envVars:[`CLOUDFLARE_API_KEY`]},"cloudflare-ai-gateway":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/ai-gateway`,pricingUrl:`https://developers.cloudflare.com/ai-gateway/pricing/`,docsUrl:`https://developers.cloudflare.com/ai-gateway/`,description:`Cloudflare AI Gateway — unified OpenAI/Anthropic-compatible routing.`,descriptionZh:`Cloudflare AI Gateway,统一 OpenAI/Anthropic 兼容路由。`,bestFor:[`routing`,`observability`,`enterprise`],freeTier:!0,aliases:[`cf ai gateway`,`cloudflare gateway`],envVars:[`CLOUDFLARE_API_KEY`]},xiaomi:{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo — API billing through the MiMo open platform; endpoint api.xiaomimimo.com.`,descriptionZh:`小米 MiMo 按量计费线路,在开放平台创建密钥;接口域名为 api.xiaomimimo.com。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi`,`mimo`,`小米`,`xiaomimimo`],envVars:[`XIAOMI_API_KEY`]},"xiaomi-token-plan-cn":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — China region (token-plan-cn.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 中国区(token-plan-cn.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token cn`,`mimo token cn`],envVars:[`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-ams":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Amsterdam region (token-plan-ams.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 阿姆斯特丹(token-plan-ams.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token ams`,`mimo token ams`],envVars:[`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-sgp":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Singapore region (token-plan-sgp.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 新加坡(token-plan-sgp.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token sgp`,`mimo token sgp`],envVars:[`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"ant-ling":{apiKeyUrl:`https://ling.tbox.cn/`,docsUrl:`https://ling.tbox.cn/`,description:`Ant Ling — domestic OpenAI-compatible access to Ling and Ring models.`,descriptionZh:`蚂蚁 Ling,国内 OpenAI 兼容服务,提供 Ling 与 Ring 系列模型。`,bestFor:[`chinese`,`reasoning`,`coding`],aliases:[`ant ling`,`ling`,`ring`,`蚂蚁 ling`,`蚂蚁灵`],envVars:[`ANT_LING_API_KEY`,`LING_API_KEY`]},"zai-coding-global":{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM Coding Plan — international z.ai endpoint.`,descriptionZh:`智谱 GLM Coding Plan 国际区 z.ai 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding`,`zhipu coding global`,`glm coding global`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},"zai-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China endpoint from the pi-ai provider catalog.`,descriptionZh:`智谱 GLM Coding Plan 中国区,来自 pi-ai 内置 provider 目录。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding cn`,`zhipu coding cn`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China BigModel endpoint.`,descriptionZh:`智谱 GLM Coding Plan 中国区 BigModel 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zhipu coding`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM China — BigModel OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 中国区,通过 BigModel OpenAI 兼容接口访问。`,bestFor:[`chinese`,`reasoning`,`general`],freeTier:!0,aliases:[`zhipu`,`glm`,`bigmodel`,`智谱`,`z.ai cn`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`]},huggingface:{apiKeyUrl:`https://huggingface.co/settings/tokens`,pricingUrl:`https://huggingface.co/pricing`,docsUrl:`https://huggingface.co/docs/api-inference/`,description:`Access thousands of open-source models via Hugging Face Inference API.`,descriptionZh:`通过 Hugging Face 访问数千个开源模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,freeTierNote:`Free tier with rate limits.`,aliases:[`huggingface`,`hugging face`,`hf`],envVars:[`HF_TOKEN`,`HUGGINGFACE_TOKEN`]},opencode:{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode — AI coding assistant provider.`,descriptionZh:`OpenCode,AI 代码助手服务商。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode`,`open code`],envVars:[`OPENCODE_API_KEY`]},"opencode-go":{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode Go — AI coding assistant provider (Go variant).`,descriptionZh:`OpenCode Go,AI 代码助手服务商(Go 版本)。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode go`,`opencode-go`],envVars:[`OPENCODE_API_KEY`]},zai:{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM International — z.ai OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 国际区,通过 z.ai OpenAI 兼容接口访问。`,bestFor:[`general`,`reasoning`,`chinese`],freeTier:!1,aliases:[`zai`,`z.ai`,`zhipu global`,`glm global`,`智谱`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},dashscope:{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope service provider.`,descriptionZh:`阿里百炼 / DashScope 服务 provider。`,bestFor:[`chinese`,`coding`,`image`,`speech`],freeTier:!0,aliases:[`dash scope`,`alibaba dashscope`,`qwen`,`tongyi`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-cn":{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope China — Qwen LLMs through the China endpoint.`,descriptionZh:`阿里百炼 / DashScope 中国区:通过国内端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope cn`,`alibaba dashscope cn`,`qwen cn`,`tongyi cn`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-intl":{apiKeyUrl:`https://modelstudio.console.alibabacloud.com/`,pricingUrl:`https://www.alibabacloud.com/help/en/model-studio/billing-for-tongyi-qianwen`,docsUrl:`https://www.alibabacloud.com/help/en/model-studio/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope International — Qwen LLMs through the international endpoint.`,descriptionZh:`阿里百炼 / DashScope 国际区:通过国际端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope intl`,`alibaba cloud dashscope`,`qwen intl`,`tongyi intl`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"vercel-ai-gateway":{apiKeyUrl:`https://vercel.com/account/tokens`,pricingUrl:`https://vercel.com/pricing`,docsUrl:`https://vercel.com/docs/ai/ai-gateway`,description:`Vercel AI Gateway — route requests to multiple LLM providers via Vercel.`,descriptionZh:`Vercel AI Gateway,通过 Vercel 路由请求到多个 LLM 服务商。`,bestFor:[`flexibility`,`enterprise`],freeTier:!1,aliases:[`vercel gateway`,`vercel ai gateway`],envVars:[`AI_GATEWAY_API_KEY`,`VERCEL_AI_GATEWAY_API_KEY`]},"github-copilot":{apiKeyUrl:`https://github.com/settings/tokens`,pricingUrl:`https://github.com/features/copilot#pricing`,docsUrl:`https://docs.github.com/en/copilot`,description:`GitHub Copilot — use your GitHub token to access Copilot models.`,descriptionZh:`使用 GitHub 令牌访问 Copilot 模型。`,bestFor:[`coding`],freeTier:!0,freeTierNote:`Free for verified students and open-source maintainers.`,aliases:[`github copilot`,`copilot`,`github`],envVars:[`COPILOT_GITHUB_TOKEN`,`GH_TOKEN`,`GITHUB_TOKEN`,`GITHUB_COPILOT_TOKEN`]}};function pe(e,t){let n=X[e];return n&&n.apiKeyUrl?[{href:n.apiKeyUrl,kind:`single`}]:[]}var me=[`common`,`domestic`,`specialty`,`enterprise`,`oauth`,`extension`];function he(e){let t=new Map;for(let e of me)t.set(e,[]);for(let n of e){let e=n.category||`specialty`,r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var ge=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`azure-openai-responses`,label:`Azure OpenAI`},{value:`bedrock-converse-stream`,label:`AWS Bedrock`},{value:`google-gemini-cli`,label:`Google Gemini CLI`},{value:`google-vertex`,label:`Google Vertex AI`}];function _e(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&`message`in t.error){let e=t.error.message;return typeof e==`string`?e:void 0}}function ve(e){if(!e||typeof e!=`object`)return{providers:{}};let t=e,n=t.providers;return n&&typeof n==`object`&&!Array.isArray(n)?e:{...t,providers:{}}}async function ye(){let e=await i(a(`/api/models-json`)),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok||!t.payload)throw Error(_e(t)||`HTTP ${e.status}`);return{...t.payload,config:ve(t.payload.config)}}async function be(e){let t=await i(a(`/api/models-json`),{method:`PATCH`,body:JSON.stringify({config:e})}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(_e(n)||`HTTP ${t.status}`);return await H(),n.payload}async function xe(e){let t=await i(a(`/api/models-json/discover-models`),{method:`POST`,body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(_e(n)||`HTTP ${t.status}`);return n.payload.models}function Se(e,t,n){return{id:e,name:t||e,input:[`text`],contextWindow:128e3,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...n}}var Z={ollama:{label:`Ollama`,providerId:`ollama`,config:{baseUrl:`http://localhost:11434/v1`,api:`openai-completions`,apiKey:`ollama`}},lmstudio:{label:`LM Studio`,providerId:`lmstudio`,config:{baseUrl:`http://localhost:1234/v1`,api:`openai-completions`,apiKey:`lmstudio`}},openrouter:{label:`OpenRouter`,providerId:`openrouter`,config:{baseUrl:`https://openrouter.ai/api/v1`,api:`openai-completions`,apiKey:``}},zhipuCn:{label:`Zhipu GLM China`,providerId:`zhipu-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiGeneral:{label:`Zhipu GLM International`,providerId:`zai`,config:{baseUrl:`https://api.z.ai/api/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},dashscopeCn:{label:`Alibaba Bailian / DashScope China`,providerId:`dashscope-cn`,description:`China OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},dashscopeIntl:{label:`Alibaba Bailian / DashScope International`,providerId:`dashscope-intl`,description:`International OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},volcengineArk:{label:`Volcengine Ark`,providerId:`volcengine-ark`,description:`Use your Ark endpoint id as the model id`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ep-your-endpoint-id`,name:`Ark endpoint ID`,contextWindow:128e3,input:[`text`]}]}},volcenginePlan:{label:`Volcengine Doubao Coding Plan`,providerId:`volcengine-plan`,description:`Doubao coding-plan endpoint on Volcengine Ark`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/coding/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},byteplusPlan:{label:`BytePlus Doubao Coding Plan`,providerId:`byteplus-plan`,description:`Doubao coding-plan endpoint on BytePlus`,config:{baseUrl:`https://ark.ap-southeast.bytepluses.com/api/coding/v3`,api:`openai-completions`,apiKey:`BYTEPLUS_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},deepseek:{label:`DeepSeek`,providerId:`deepseek`,config:{baseUrl:`https://api.deepseek.com`,api:`openai-completions`,apiKey:`DEEPSEEK_API_KEY`,models:[{id:`deepseek-v4-pro`,name:`DeepSeek V4 Pro`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]},{id:`deepseek-v4-flash`,name:`DeepSeek V4 Flash`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]}]}},moonshotCn:{label:`Kimi / Moonshot China`,providerId:`moonshotai-cn`,config:{baseUrl:`https://api.moonshot.cn/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},moonshotIntl:{label:`Kimi / Moonshot International`,providerId:`moonshotai`,config:{baseUrl:`https://api.moonshot.ai/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},kimiCoding:{label:`Kimi Coding`,providerId:`kimi-coding`,description:`Dedicated Kimi coding endpoint`,config:{baseUrl:`https://api.kimi.com/coding`,api:`anthropic-messages`,apiKey:`KIMI_API_KEY`,headers:{"User-Agent":`KimiCLI/1.5`},models:[{id:`k2p7`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-for-coding`,name:`Kimi For Coding`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]}]}},stepfunIntl:{label:`StepFun International`,providerId:`stepfun-intl`,config:{baseUrl:`https://api.stepfun.ai/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunCn:{label:`StepFun China`,providerId:`stepfun-cn`,config:{baseUrl:`https://api.stepfun.com/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanIntl:{label:`StepFun Step Plan International`,providerId:`stepfun-plan-intl`,config:{baseUrl:`https://api.stepfun.ai/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanCn:{label:`StepFun Step Plan China`,providerId:`stepfun-plan-cn`,config:{baseUrl:`https://api.stepfun.com/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},xiaomi:{label:`Xiaomi MiMo`,providerId:`xiaomi`,config:{baseUrl:`https://api.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanCn:{label:`Xiaomi MiMo Token Plan China`,providerId:`xiaomi-token-plan-cn`,config:{baseUrl:`https://token-plan-cn.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_CN_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanAms:{label:`Xiaomi MiMo Token Plan Amsterdam`,providerId:`xiaomi-token-plan-ams`,config:{baseUrl:`https://token-plan-ams.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanSgp:{label:`Xiaomi MiMo Token Plan Singapore`,providerId:`xiaomi-token-plan-sgp`,config:{baseUrl:`https://token-plan-sgp.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},minimax:{label:`MiniMax`,providerId:`minimax`,description:`Anthropic-compatible endpoint preferred for agent workflows`,config:{baseUrl:`https://api.minimax.io/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}},zhipuCodingCn:{label:`Zhipu GLM Coding Plan China`,providerId:`zhipu-coding-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiCodingGlobal:{label:`Zhipu GLM Coding Plan International`,providerId:`zai-coding-global`,config:{baseUrl:`https://api.z.ai/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},minimaxCn:{label:`MiniMax China`,providerId:`minimax-cn`,config:{baseUrl:`https://api.minimaxi.com/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_CN_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}}},Ce=Object.entries(Z).map(([e,t])=>({key:e,...t}));function we(e){return Z[e]?.providerId??e}function Te(e){return Ce.find(t=>t.providerId===e)?.key}var Ee=new Set([`dashscope-cn`,`dashscope-intl`,`volcengine-ark`,`volcengine-plan`,`byteplus-plan`,`stepfun-cn`,`stepfun-intl`,`stepfun-plan-cn`,`stepfun-plan-intl`,`zhipu-cn`,`zai-coding-global`,`zhipu-coding-cn`]);function De(e){if(Ee.has(e))return Te(e)}var Oe=[{value:`text`,labelKey:`inputTextOnly`},{value:`text,image`,labelKey:`inputTextVision`}];function ke(){return S(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,V,`dark:border-edge`)}function Ae(){return S(B,z)}function je(e){return(e.input||[`text`]).includes(`image`)?`text,image`:`text`}function Me(e){return e===`text,image`?[`text`,`image`]:[`text`]}var Ne={chat:[`日常对话与交办任务`,`Everyday conversations and tasks`],vision:[`理解照片、截图和图片内容`,`Understand photos, screenshots and images`],image:[`根据描述生成图片`,`Create images from a description`],transcription:[`聊天听写与笔记录音转文字`,`Dictate messages and transcribe recorded notes`],speech:[`朗读消息,选择喜欢的音色`,`Read messages aloud in your preferred voice`],conversation:[`实时通话、音色与音频设备`,`Live calls, voices and audio devices`],background:[`自动化、定时和无人值守任务`,`Automations, schedules and unattended tasks`]};function Pe(e,t,n){return n?{"qwen-token-plan-cn":`阿里云百炼订阅 · 北京`,"qwen-token-plan":`阿里云百炼订阅 · 国际`,"dashscope-cn":`阿里云百炼 · 中国区`,"dashscope-intl":`阿里云百炼 · 国际区`,"xiaomi-token-plan-cn":`小米 MiMo 订阅 · 中国区`}[e]??t:t}var Q=r(),$={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`画图`,`Image generation`],background:[`后台任务`,`Background tasks`],speech:[`语音合成`,`Speech synthesis`],transcription:[`录音识别`,`Recorded audio recognition`],conversation:[`实时语音对话`,`Realtime conversation`]};function Fe({providerId:e,row:t,modelIds:n,existingConnection:r=!1,targetUse:i,connectOnly:a=!1,language:o,alternatives:s=[],onChooseProvider:l,onBack:d,onDone:g,onApplied:v,inline:y=!1,onPendingChange:b}){let S=o===`zh`,T=(0,K.useRef)(!1),[D,O]=(0,K.useState)(null),[k,j]=(0,K.useState)({mode:i?`replace`:`fill`,modelIds:n}),[M,N]=(0,K.useState)(``),[P,F]=(0,K.useState)(!1),[I,L]=(0,K.useState)(!1),[R,z]=(0,K.useState)(r||!!t?.configured),[B,V]=(0,K.useState)(!1),H=(0,K.useRef)(!1),[U,W]=(0,K.useState)(``),[G,ie]=(0,K.useState)(!1),[ae,q]=(0,K.useState)(0);(0,K.useEffect)(()=>{let t=!0;return ue(e,{modelIds:n,...a?{selected:[]}:{},...i&&!a?{mode:`replace`,selected:[i]}:{}}).then(e=>{t&&(O(e),z(e.configured),T.current||(T.current=!0,j({mode:i?`replace`:`fill`,modelIds:n,selected:a?[]:e.uses.filter(e=>e.selected).map(e=>e.id)})),W(``))}).catch(e=>{t&&W(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,n,i,a,ae]),(0,K.useEffect)(()=>(b?.(B),()=>b?.(!1)),[B,b]);let J=k.selected??[],se=e=>{j({...k,mode:e,selected:D?.uses.filter(t=>t.recommended&&t.choices.length&&(e===`replace`||t.selected)).map(e=>e.id)??[]})},ce=async()=>{if(!D||H.current)return;H.current=!0,V(!0),W(``),L(!1);let t=!1;try{M.trim()&&(await ne({[e]:M.trim()}),t=!0,L(!0),z(!0),F(!1),N(``));let n=await ue(e,k);if(z(n.configured),a){if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);O(n),ie(!0),v?.();return}let r=D.uses.filter(e=>J.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended),i=n.uses.filter(e=>J.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended);if(D.revision!==n.revision||JSON.stringify(r)!==JSON.stringify(i))throw O(n),j({...k,selected:n.uses.filter(e=>e.selected).map(e=>e.id)}),Error(S?`目录或当前配置已更新,请核对后再次应用。`:`The catalog or settings changed. Review the updated choices and apply again.`);if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);await de(e,k,n.revision),O(n),ie(!0),v?.()}catch(e){let n=e instanceof Error?e.message:String(e);W((!y&&t?S?`服务已保存,用途配置未完成。`:`Connection saved; model setup is incomplete. `:``)+n)}finally{H.current=!1,V(!1)}},le=D?.profile.name??t?.name??e,Y=D?.profile.apiKeyUrl??X[e]?.apiKeyUrl;if(y){let n=D?.uses.find(e=>e.id===i),r=i?k.overrides?.[i]??n?.recommended:void 0,a=Pe(e,le,S);return(0,Q.jsxs)(`div`,{className:`space-y-6 p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:a}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`${S?`用于`:`For `}${oe[i][+!S]}`:``})]}),(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:g,children:S?`更换服务`:`Change service`})]}),!D&&!U?(0,Q.jsx)(w,{className:`h-48 w-full rounded-xl`}):null,D?(0,Q.jsxs)(Q.Fragment,{children:[D.profile.credential===`oauth`&&!R?(0,Q.jsx)(re,{providerId:e,displayName:a,connected:R,onConnected:()=>{z(!0),q(e=>e+1)}}):null,D.profile.credential===`oauth`&&R&&!t?.supportsApiKey?(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-xl bg-surface-inset px-4 py-3 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}):null,D.profile.credential===`api-key`||D.profile.credential===`oauth`&&t?.supportsApiKey?(0,Q.jsx)(`div`,{className:`space-y-3`,children:R&&!P?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}),(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>F(!0),children:S?`更换`:`Change`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:D.profile.access===`subscription`?S?`订阅 API Key`:`Subscription API key`:`API Key`}),R?(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>{F(!1),N(``)},children:S?`保留原 Key`:`Keep saved key`}):null]}),(0,Q.jsx)(h,{id:`provider-setup-key`,disabled:B,value:M,onChange:N,placeholder:R?S?`输入新的 API Key`:`Enter a new API key`:S?`粘贴 API Key`:`Paste your API key`,labels:ee(c(o).providersSettings)}),R?(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:S?`此服务的其他已配置模型也会使用新的 Key。`:`Other models configured with this service will also use the new key.`}):null,Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-10 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取 API Key`:`Get an API key`}):null]})}):null,n?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-sm font-medium text-fg`,children:S?`选择模型`:`Model`}),(0,Q.jsx)(f,{value:r??``,disabled:B||!n.choices.length,"aria-label":S?`选择模型`:`Model`,onChange:e=>j({...k,selected:[n.id],overrides:{...k.overrides,[n.id]:e.target.value}}),children:n.choices.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.name},e.id))})]}):null,(0,Q.jsxs)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:[S?`只更改当前能力使用的模型。`:`Changes the model for this capability only.`,D.profile.interactiveOnly?S?` 后台任务继续使用原服务。`:` Background tasks keep their current service.`:``]})]}):null,U?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded-xl border border-edge p-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:I?S?`连接信息已保存,模型尚未切换。请重试。`:`Connection saved. The model has not switched; please retry.`:S?`未能应用配置,请重试。`:`Could not apply settings. Please retry.`}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:S?`查看详情`:`Show details`}),(0,Q.jsx)(`p`,{className:`mt-2 break-words`,children:U})]})]}):null,(0,Q.jsx)(`div`,{className:`flex items-center justify-end gap-3 border-t border-edge-subtle pt-4`,children:(0,Q.jsxs)(C,{variant:`primary`,disabled:B||!D&&!U||!!D&&(!R&&!M.trim()||!r||!n?.choices.some(e=>e.id===r)),onClick:()=>{D?ce():q(e=>e+1)},children:[B?(0,Q.jsx)(_,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?S?`正在应用…`:`Applying…`:!D&&U?S?`重新加载`:`Reload`:U?S?`重试`:`Retry`:R&&!M.trim()?S?`使用此模型`:`Use this model`:S?`连接并使用`:`Connect and use`]})})]})}let fe=y?`h3`:A,pe=y?`p`:E;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 px-5 py-5`,children:[d&&!B&&!G?(0,Q.jsx)(C,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":S?`返回`:`Back`,onClick:d,children:(0,Q.jsx)(u,{className:`size-4`})}):null,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(fe,{className:`text-base font-semibold text-fg`,children:i?`${S?`连接服务 · `:`Connect service · `}${$[i][+!S]}`:S?`连接模型服务`:`Connect model service`}),(0,Q.jsx)(pe,{className:`mt-2 text-sm text-fg-muted`,children:le})]}),(0,Q.jsx)(C,{variant:`ghost`,className:`shrink-0 p-1.5`,disabled:B,"aria-label":S?`关闭`:`Close`,onClick:g,children:(0,Q.jsx)(x,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-5`,children:[!D&&!U?(0,Q.jsx)(w,{className:`h-64 w-full rounded-xl`}):null,D?(0,Q.jsxs)(Q.Fragment,{children:[!G&&s.length>1&&l?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-xs text-fg-muted`,children:S?`接入方式 / 地域`:`Access method / region`}),(0,Q.jsx)(f,{value:e,disabled:B,"aria-label":S?`接入方式 / 地域`:`Access method / region`,onChange:e=>l(e.target.value),children:s.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.setupProfile?.name??e.name},e.id))})]}):null,G?(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(m,{className:`size-4`}),a?S?`服务连接已保存`:`Connection saved`:S?`所选用途配置已保存`:`Selected model uses saved`]}):(0,Q.jsxs)(Q.Fragment,{children:[D.profile.credential===`oauth`&&!R?(0,Q.jsx)(re,{providerId:e,displayName:le,connected:R,onConnected:()=>{z(!0),q(e=>e+1)}}):null,(D.profile.credential===`api-key`||D.profile.credential===`oauth`&&t?.supportsApiKey)&&!r?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:D.profile.access===`subscription`?S?`套餐 API Key`:`Plan API key`:`API Key`}),(0,Q.jsx)(h,{id:`provider-setup-key`,disabled:B,value:M,onChange:N,placeholder:R?S?`留空使用已保存的凭据`:`Leave empty to use saved credentials`:`API Key`,labels:ee(c(o).providersSettings)}),Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-8 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取对应接入方式的 Key`:`Get a key for this access method`}):null]}):null,!a&&!y?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:S?`模型用途`:`Model uses`}),(0,Q.jsx)(te,{className:`flex gap-2`,indicatorClassName:`rounded-lg bg-surface-active`,children:[`fill`,`replace`].map(e=>(0,Q.jsx)(C,{variant:k.mode===e?`secondary`:`ghost`,disabled:B,"aria-pressed":k.mode===e,onClick:()=>se(e),children:e===`fill`?S?`补齐未配置`:`Fill missing`:S?`改用此服务`:`Switch to this service`},e))})]}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y?S?`仅更新当前能力,其他模型和参数保持原设置。`:`Only this capability changes; other settings are preserved.`:S?`保存连接后返回能力设置,再选择要使用的模型。`:`Save the connection, then choose a model in capability settings.`})]}),a?(0,Q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[S?`支持用途:`:`Supported uses: `,D.uses.filter(e=>e.choices.length&&(!i||e.id===i)).map(e=>$[e.id][+!S]).join(`、`)]}):null,a?null:(0,Q.jsx)(`div`,{className:`divide-y divide-edge rounded-xl border border-edge bg-surface-inset px-4`,children:D.uses.filter(e=>!y||!i||e.id===i).map(e=>{let t=k.overrides?.[e.id]??e.recommended,n=e.choices.find(e=>e.id===t);return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,Q.jsxs)(`label`,{className:`flex min-h-10 items-start gap-3`,children:[(0,Q.jsx)(`input`,{hidden:y,type:`checkbox`,className:`ui-checkbox mt-1`,checked:J.includes(e.id),disabled:y||B||G||!t||!e.choices.length,onChange:t=>j({...k,selected:t.target.checked?[...J,e.id]:J.filter(t=>t!==e.id)})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:$[e.id][+!S]}),(0,Q.jsx)(`span`,{className:`mt-1 block break-all text-xs text-fg-muted`,children:J.includes(e.id)?`${e.current?`${e.current} → `:``}${n?.name??t??``}`:e.current?`${S?`保留:`:`Keep: `}${e.current}`:e.reason===`interactive_only`?S?`此套餐不用于后台任务`:`This plan is not used for background tasks`:n?.name??(S?`暂无可自动配置的模型`:`No automatic model selection available`)})]})]}),!G&&e.choices.length>1?(0,Q.jsxs)(`details`,{open:y||void 0,className:`pl-7`,children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`选择具体模型`:`Choose a model`}),(0,Q.jsx)(f,{value:t??``,disabled:B,"aria-label":$[e.id][+!S],onChange:t=>j({...k,selected:[...new Set([...J,e.id])],overrides:{...k.overrides,[e.id]:t.target.value}}),children:e.choices.map(e=>(0,Q.jsx)(p,{value:e.id,children:e.name},e.id))})]}):null]},e.id)})}),G?null:(0,Q.jsx)(C,{variant:`ghost`,disabled:B,onClick:()=>q(e=>e+1),children:S?`刷新目录`:`Refresh catalog`}),!a&&!y?(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`任务模型与其他用途`:`Task models and other uses`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[Object.entries(D.taskModels).map(([e,t])=>(0,Q.jsxs)(`p`,{children:[e,`: `,t]},e)),(0,Q.jsx)(`p`,{children:S?`未选用途与电脑操作保留当前配置;所选用途清除跨服务回退。`:`Unselected uses and Computer Use keep their settings. Selected uses clear cross-service fallbacks.`})]})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:D.profile.interactiveOnly?S?`此套餐仅用于交互任务。后台调用会检查使用范围,不会自动切换到其他收费来源。`:`This plan is for interactive tasks. Background calls check usage scope and do not automatically switch billing sources.`:S?`仅更新勾选的全局用途,智能体和会话的独立设置继续生效。`:`Only selected global uses change. Agent and session overrides remain effective.`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:S?`配置保存与模型真实调用验证分别显示;此操作不会发送测试请求。`:`Saving settings does not perform a model test request.`})]}):null,U?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:U}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:D&&!G&&!a?S?`将配置 ${J.length} 项`:`${J.length} uses selected`:``}),G?(0,Q.jsx)(C,{onClick:g,children:S?`完成`:`Done`}):!D&&U?(0,Q.jsx)(C,{onClick:()=>q(e=>e+1),children:S?`重试`:`Retry`}):(0,Q.jsxs)(C,{onClick:()=>void ce(),disabled:B||!D||!R&&!M.trim()||y&&!J.some(e=>k.overrides?.[e]||D.uses.find(t=>t.id===e)?.recommended),children:[B?(0,Q.jsx)(_,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}):null,B?S?`正在应用…`:`Applying…`:J.length?y&&i?`${S?`连接并用于`:`Connect and use for `}${$[i][+!S]}`:S?`连接并应用`:`Connect and apply`:S?`仅连接`:`Connect only`]})]})]})}function Ie(e){let t=(0,q.c)(7),{target:n,targetUse:r,zh:i,onDone:a,onApplied:o}=e,s=i?`zh`:`en`,c;return t[0]!==o||t[1]!==a||t[2]!==s||t[3]!==n.modelIds||t[4]!==n.providerId||t[5]!==r?(c=(0,Q.jsx)(Fe,{providerId:n.providerId,modelIds:n.modelIds,targetUse:r,language:s,existingConnection:!0,onDone:a,onApplied:o},n.providerId),t[0]=o,t[1]=a,t[2]=s,t[3]=n.modelIds,t[4]=n.providerId,t[5]=r,t[6]=c):c=t[6],c}function Le(e){let t=(0,q.c)(38),{open:n,initialProviderId:r,initialUse:i,connectOnly:a,onOpenChange:o,builtinRows:s,customConfig:c,labels:l,language:u,onSaved:d}=e,f=a!==void 0&&a,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={type:`pick`},t[0]=p):p=t[0];let[m,h]=(0,K.useState)(p),[g,_]=(0,K.useState)(``),v;t[1]!==r||t[2]!==m?(v=m.type===`pick`&&r?{type:`builtin`,providerId:r}:m,t[1]=r,t[2]=m,t[3]=v):v=t[3];let y=v,b=(0,K.useRef)(0),x;t[4]!==y.providerId||t[5]!==y.type||t[6]!==s?(x=y.type===`builtin`?s.find(e=>e.id===y.providerId)?.setupProfile?.brand:void 0,t[4]=y.providerId,t[5]=y.type,t[6]=s,t[7]=x):x=t[7];let C=x,w;t[8]===o?w=t[9]:(w=e=>{e||window.setTimeout(()=>{h({type:`pick`}),_(``),b.current=0},200),o(e)},t[8]=o,t[9]=w);let E=w,D;t[10]!==s||t[11]!==f||t[12]!==E||t[13]!==d?(D=(e,t)=>{let n=s.some(t=>t.id===e&&t.configured);f||t?.length===0||t===void 0&&n?(d(e),E(!1)):h({type:`success`,target:{providerId:e,modelIds:t}})},t[10]=s,t[11]=f,t[12]=E,t[13]=d,t[14]=D):D=t[14];let A=D,P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(T,{className:S(`xopc-dialog-overlay fixed inset-0 bg-scrim`,N)}),t[15]=P):P=t[15];let F;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(F=S(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(40rem,calc(100vh-3rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,M),t[16]=F):F=t[16];let I;t[17]!==y.presetKey||t[18]!==y.providerId||t[19]!==y.target||t[20]!==y.type||t[21]!==s||t[22]!==f||t[23]!==c||t[24]!==E||t[25]!==A||t[26]!==r||t[27]!==i||t[28]!==l||t[29]!==u||t[30]!==d||t[31]!==g||t[32]!==C?(I=(0,Q.jsxs)(O,{children:[P,(0,Q.jsx)(k,{className:F,children:y.type===`success`?(0,Q.jsx)(Ie,{target:y.target,targetUse:i,zh:u===`zh`,onApplied:()=>d(y.target.providerId),onDone:()=>E(!1)}):y.type===`pick`?(0,Q.jsx)(ze,{builtinRows:s,searchQuery:g,onSearchChange:_,labels:l,language:u,scrollTopRef:b,onPickBuiltin:e=>{let t=De(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onPickCustom:()=>h({type:`custom`})}):y.type===`builtin`?(0,Q.jsx)(Fe,{providerId:y.providerId,targetUse:i,connectOnly:f,row:s.find(e=>e.id===y.providerId),language:u,alternatives:C?s.filter(e=>e.setupProfile?.brand===C):[],onChooseProvider:e=>{let t=De(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onBack:r?void 0:()=>h({type:`pick`}),onApplied:()=>{d(y.providerId),f&&E(!1)},onDone:()=>E(!1)},y.providerId):(0,Q.jsx)(Ge,{initialPresetKey:y.presetKey,customConfig:c,labels:l,language:u,onBack:()=>h({type:`pick`}),onSaved:A})})]}),t[17]=y.presetKey,t[18]=y.providerId,t[19]=y.target,t[20]=y.type,t[21]=s,t[22]=f,t[23]=c,t[24]=E,t[25]=A,t[26]=r,t[27]=i,t[28]=l,t[29]=u,t[30]=d,t[31]=g,t[32]=C,t[33]=I):I=t[33];let L;return t[34]!==E||t[35]!==n||t[36]!==I?(L=(0,Q.jsx)(j,{open:n,onOpenChange:E,children:I}),t[34]=E,t[35]=n,t[36]=I,t[37]=L):L=t[37],L}function Re(e){let t=(0,q.c)(4),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=S(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.press),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Q.jsx)(D,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:r,"aria-label":n,children:i})}),t[2]=n,t[3]=a),a}function ze({builtinRows:e,searchQuery:t,onSearchChange:n,labels:r,language:i,scrollTopRef:a,onPickBuiltin:o,onPickCustom:s}){let c=t.trim().toLowerCase(),l=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=l.current;e&&a.current>0&&(e.scrollTop=a.current)},[a]);let u=(0,K.useMemo)(()=>c?e.filter(e=>{let t=X[e.id]?.aliases??[];return e.id.toLowerCase().includes(c)||e.name.toLowerCase().includes(c)||t.some(e=>e.toLowerCase().includes(c))}):e,[e,c]),f=(0,K.useMemo)(()=>{let e=new Set;return u.filter(t=>{let n=t.setupProfile?.brand??t.id;return e.has(n)?!1:(e.add(n),!0)})},[u]),p=f.filter(e=>e.onboardingFeatured&&[`subscription`,`account`].includes(e.setupProfile?.access??``)).slice(0,6),m=p.map(e=>e.id),h=f.filter(e=>e.configured&&!m.includes(e.id)),_=(0,K.useMemo)(()=>he(f.filter(e=>!m.includes(e.id)&&!e.configured)),[f,m]),v=e=>{let t=X[e.id];return i===`zh`?t?.descriptionZh??t?.description:t?.description};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pb-3 pt-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(A,{className:`text-base font-semibold text-fg`,children:r.step1Title}),(0,Q.jsx)(E,{className:`mt-1 text-sm text-fg-muted`,children:r.step1Subtitle})]}),(0,Q.jsx)(Re,{label:r.close})]}),(0,Q.jsx)(`div`,{className:`px-5 pb-3`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(y,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:r.searchPlaceholder,autoComplete:`off`,className:S(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg placeholder:text-fg-subtle`,V)})]})}),(0,Q.jsx)(`div`,{ref:l,onScroll:e=>{a.current=e.currentTarget.scrollTop},className:`min-h-0 flex-1 overscroll-contain overflow-y-auto px-5 pb-5`,children:c&&f.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:r.noResults}):c?(0,Q.jsx)(Be,{title:r.searchResults,children:f.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p.length>0?(0,Q.jsx)(Be,{title:r.quickStart,children:p.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,prominent:!0,onPick:o},e.id))}):null,h.length>0?(0,Q.jsx)(Be,{title:r.connectedSection,children:h.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))}):null,me.map(e=>{let t=_.get(e)??[];return t.length===0?null:(0,Q.jsx)(Be,{title:r.categories[e]??e,children:t.map(e=>(0,Q.jsx)(Ve,{row:e,description:v(e),labels:r,onPick:o},e.id))},e)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:s,className:S(`flex w-full items-center gap-3 rounded-xl bg-surface-hover/25 px-4 py-3 text-left transition-colors`,`hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base/60 text-fg-muted`,children:(0,Q.jsx)(g,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.addCustom}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r.customDescription})]}),(0,Q.jsx)(d,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]})})]})}function Be(e){let t=(0,q.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`h3`,{className:`mb-1.5 px-1 text-xs font-semibold text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`section`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ve(e){let t=(0,q.c)(27),{row:n,description:r,labels:i,prominent:a,onPick:o}=e,s=a!==void 0&&a,c;t[0]!==o||t[1]!==n.id?(c=()=>o(n.id),t[0]=o,t[1]=n.id,t[2]=c):c=t[2];let l=s&&`bg-surface-base/80`,u;t[3]===l?u=t[4]:(u=S(`flex min-h-12 w-full items-center gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5 text-left transition-colors`,`hover:bg-surface-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,l),t[3]=l,t[4]=u);let f;t[5]===n.name?f=t[6]:(f=(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:n.name}),t[5]=n.name,t[6]=f);let p;t[7]!==i||t[8]!==s?(p=s?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:i.recommended}):null,t[7]=i,t[8]=s,t[9]=p):p=t[9];let h;t[10]!==f||t[11]!==p?(h=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=h):h=t[12];let g;t[13]===r?g=t[14]:(g=r?(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:r}):null,t[13]=r,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[h,g]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==i||t[19]!==n.configured?(v=n.configured?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-1 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,Q.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),i.connected]}):null,t[18]=i,t[19]=n.configured,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(d,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==c||t[24]!==u||t[25]!==_?(b=(0,Q.jsxs)(`button`,{type:`button`,onClick:c,className:u,children:[_,v,y]}),t[22]=v,t[23]=c,t[24]=u,t[25]=_,t[26]=b):b=t[26],b}function He(e){return{clientKey:crypto.randomUUID(),value:e}}function Ue(e=`custom`){if(e!==`custom`&&Z[e]){let t=Z[e].config;return{preset:e,providerId:we(e),baseUrl:t.baseUrl??``,api:t.api??`openai-completions`,apiKey:t.apiKey??``,modelSlots:(t.models?.map(e=>e.id)??[``]).map(He),error:null}}return{preset:`custom`,providerId:``,baseUrl:``,api:`openai-completions`,apiKey:``,modelSlots:[He(``)],error:null}}function We(e,t){switch(t.type){case`applyPreset`:return t.key===`custom`?{...e,preset:`custom`,error:null}:Z[t.key]?Ue(t.key):e;case`setProviderId`:return{...e,providerId:t.value};case`setBaseUrl`:return{...e,baseUrl:t.value};case`setApi`:return{...e,api:t.value};case`setApiKey`:return{...e,apiKey:t.value};case`addModelSlot`:return{...e,modelSlots:[...e.modelSlots,He(``)]};case`updateModelId`:return{...e,modelSlots:e.modelSlots.map((e,n)=>n===t.index?{...e,value:t.value}:e)};case`setModelIds`:return{...e,modelSlots:(t.values.length>0?t.values:[``]).map(He)};case`removeModelSlot`:return{...e,modelSlots:e.modelSlots.filter((e,n)=>n!==t.index)};case`setError`:return{...e,error:t.value}}}function Ge({initialPresetKey:e,customConfig:t,labels:n,language:r,onBack:i,onSaved:a}){let[o,s]=(0,K.useReducer)(We,void 0,()=>Ue(e)),[l,u]=(0,K.useState)(!1),[m,g]=(0,K.useState)(!1),b=ee(c(r).providersSettings),{preset:w,providerId:T,baseUrl:E,api:D,apiKey:O,modelSlots:k,error:j}=o,M=k.map(e=>e.value),N=async()=>{let e=T.trim(),r=E.trim();if(!e){s({type:`setError`,value:n.providerIdRequired});return}if(!r){s({type:`setError`,value:n.baseUrlRequired});return}let i=M.map(e=>e.trim()).filter(Boolean);u(!0),s({type:`setError`,value:null});try{let n=t?.providers??{},o=w===`custom`?void 0:Z[w]?.config,s={...o??{},baseUrl:r,api:D,apiKey:O.trim()||void 0,models:i.map(e=>o?.models?.find(t=>t.id===e)??{id:e})};await be({providers:{...n,[e]:s}});let c=new Set(n[e]?.models?.map(e=>e.id)??[]);a(e,s.models?.filter(e=>!c.has(e.id)&&!e.computerUse).map(e=>e.id)??[])}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.saveError})}finally{u(!1)}},P=async()=>{let e=T.trim()||we(w)||`custom`,t=E.trim();if(!t){s({type:`setError`,value:n.baseUrlRequired});return}g(!0),s({type:`setError`,value:null});try{let r=w===`custom`?void 0:Z[w]?.config,i=(await xe({providerId:e,baseUrl:t,apiKey:O.trim()||void 0,api:D,headers:r?.headers})).map(e=>e.id).filter(e=>e&&!e.includes(`/`));s({type:`setModelIds`,values:i}),i.length===0&&s({type:`setError`,value:n.discoverModelsHint})}catch(e){s({type:`setError`,value:e instanceof Error?e.message:n.discoverModelsHint})}finally{g(!1)}},I=T.trim()&&E.trim(),L=(D===`openai-completions`||D===`openai-responses`)&&E.trim();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-3 pt-5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:S(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.press),"aria-label":n.back,children:(0,Q.jsx)(d,{className:`size-4 rotate-180`,"aria-hidden":!0})}),(0,Q.jsx)(A,{className:`min-w-0 flex-1 text-base font-semibold text-fg`,children:n.step2CustomTitle}),(0,Q.jsx)(Re,{label:n.close})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 pb-4`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.customDescription}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-preset`,className:`text-sm font-medium text-fg`,children:n.presetLabel}),(0,Q.jsxs)(f,{id:`custom-preset`,value:w,onChange:e=>s({type:`applyPreset`,key:e.target.value}),className:Ae(),children:[(0,Q.jsx)(p,{value:`custom`,children:n.presetCustom}),Ce.map(e=>(0,Q.jsx)(p,{value:e.key,children:e.label},e.key))]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-provider-id`,className:`text-sm font-medium text-fg`,children:n.providerIdLabel}),(0,Q.jsx)(`input`,{id:`custom-provider-id`,type:`text`,autoComplete:`off`,value:T,onChange:e=>s({type:`setProviderId`,value:e.target.value}),placeholder:n.providerIdPlaceholder,className:S(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,Q.jsx)(`input`,{id:`custom-base-url`,type:`url`,autoComplete:`off`,value:E,onChange:e=>s({type:`setBaseUrl`,value:e.target.value}),placeholder:n.baseUrlPlaceholder,className:S(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-type`,className:`text-sm font-medium text-fg`,children:n.apiTypeLabel}),(0,Q.jsx)(f,{id:`custom-api-type`,value:D,onChange:e=>s({type:`setApi`,value:e.target.value}),className:Ae(),children:ge.map(e=>(0,Q.jsx)(p,{value:e.value,children:e.label},e.value))})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-key`,className:`text-sm font-medium text-fg`,children:n.apiKeyLabel}),(0,Q.jsx)(h,{id:`custom-api-key`,value:O,onChange:e=>s({type:`setApiKey`,value:e}),placeholder:n.apiKeyPlaceholder,labels:b})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.modelIdLabel}),(0,Q.jsxs)(C,{type:`button`,variant:`secondary`,className:`gap-1.5`,disabled:!L||m,onClick:()=>void P(),children:[m?(0,Q.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(y,{className:`size-3.5`,"aria-hidden":!0}),m?n.discoveringModels:n.discoverModels]})]}),M.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,autoComplete:`off`,value:e,onChange:e=>s({type:`updateModelId`,index:t,value:e.target.value}),placeholder:n.modelIdPlaceholder,className:S(`flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,V)}),M.length>1?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>s({type:`removeModelSlot`,index:t}),className:S(`rounded-lg p-1.5 text-fg-subtle hover:bg-surface-hover hover:text-fg`,F.press),children:(0,Q.jsx)(x,{className:`size-3.5`,"aria-hidden":!0})}):null]},k[t].clientKey)),(0,Q.jsxs)(C,{type:`button`,variant:`ghost`,className:`w-fit gap-1.5 text-fg-muted`,onClick:()=>s({type:`addModelSlot`}),children:[(0,Q.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),n.addModel]})]}),j?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:j}):null]})}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 bg-surface-hover/15 px-5 py-3`,children:[(0,Q.jsx)(C,{type:`button`,variant:`secondary`,onClick:i,children:n.cancel}),(0,Q.jsx)(C,{type:`button`,variant:`primary`,disabled:!I||l,onClick:()=>void N(),children:l?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(_,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})]})]})}function Ke(){let e=(0,q.c)(29),t=!!o(Qe),{data:n,isLoading:r}=I(t),i;e[0]===t?i=e[1]:(i=t?a(`/api/providers/meta`):null,e[0]=t,e[1]=i);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},e[2]=s):s=e[2];let{data:c,isLoading:l}=P(i,Ze,s),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u={revalidateOnFocus:!1},e[3]=u):u=e[3];let{data:d,isLoading:f}=P(t?R:null,Xe,u),p;e[4]===d?p=e[5]:(p=d===void 0?[]:d,e[4]=d,e[5]=p);let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1},e[6]=h):h=e[6];let{data:g}=P(t?U:null,Ye,h),_;bb0:{if(!c||n===void 0){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[7]=t):t=e[7],_=t;break bb0}let t;e[8]!==n?.payload?.config||e[9]!==c||e[10]!==m?(t=W(c,G(n?.payload?.config),m),e[8]=n?.payload?.config,e[9]=c,e[10]=m,e[11]=t):t=e[11],_=t}let v=_,y;bb1:{if(!g){y=null;break bb1}let t;e[12]===g.config?t=e[13]:(t=ve(g.config),e[12]=g.config,e[13]=t),y=t}let b=y,x;if(e[14]!==v||e[15]!==b||e[16]!==c||e[17]!==m){x=[];let t=new Set((c??[]).filter(Je).map(qe)),n;e[19]===b?n=e[20]:(n=new Set(b?Object.keys(b.providers):[]),e[19]=b,e[20]=n);let r=n;for(let e of v){if(!t.has(e.id))continue;let n=r.has(e.id),i=n?b.providers[e.id]?.models?.length??0:m.filter(t=>t.provider===e.id).length;x.push({id:e.id,name:e.name,configured:!0,isCustom:n,modelCount:i})}if(b){let t;e[21]===b.providers?t=e[22]:(t=Object.entries(b.providers),e[21]=b.providers,e[22]=t);for(let[e,n]of t)x.some(t=>t.id===e)||x.push({id:e,name:e,configured:!0,isCustom:!0,modelCount:n.models?.length??0})}e[14]=v,e[15]=b,e[16]=c,e[17]=m,e[18]=x}else x=e[18];let S=x,C=r||l||f,w;return e[23]!==v||e[24]!==S||e[25]!==b||e[26]!==C||e[27]!==m?(w={cards:S,loading:C,builtinRows:v,customConfig:b,allModels:m},e[23]=v,e[24]=S,e[25]=b,e[26]=C,e[27]=m,e[28]=w):w=e[28],w}function qe(e){return e.id}function Je(e){return e.configured}function Ye(){return ye()}function Xe(){return L()}async function Ze(e){let{payload:t}=await(await fetch(e,{credentials:`same-origin`,redirect:`error`})).json();return t?.providers??[]}function Qe(e){return e.conversationId}function $e(e){let t=(0,q.c)(12),{labels:n,data:r,onAdd:i,onManage:a}=e,{cards:o,loading:s}=r;if(s){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(w,{className:`h-6 w-48 max-w-full`}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-busy":`true`,children:[e,(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:[1,2,3].map(tt)})]}),t[1]=n):n=t[1],n}let c;if(t[2]!==o||t[3]!==n||t[4]!==i||t[5]!==a){let e=o.filter(et),r=e.length>0?n.titleCount.replace(`{{count}}`,String(e.length)):n.title,s;t[7]===r?s=t[8]:(s=(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r}),t[7]=r,t[8]=s);let l=e.length>0?(0,Q.jsxs)(C,{type:`button`,variant:`primary`,className:`gap-1.5`,onClick:i,children:[(0,Q.jsx)(v,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]}):null,u;t[9]!==s||t[10]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],c=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/25 px-6 py-10 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.empty}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint}),(0,Q.jsxs)(C,{type:`button`,variant:`primary`,className:`mt-4 gap-1.5`,onClick:i,children:[(0,Q.jsx)(v,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]})]}):(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:e.map(e=>(0,Q.jsx)(nt,{card:e,labels:n,onManage:()=>a(e.id,e.isCustom)},e.id))})]}),t[2]=o,t[3]=n,t[4]=i,t[5]=a,t[6]=c}else c=t[6];return c}function et(e){return e.configured}function tt(e){return(0,Q.jsx)(w,{className:`h-16 rounded-lg`},e)}function nt(e){let t=(0,q.c)(26),{card:n,labels:r,onManage:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=S(`group relative flex min-h-16 w-full flex-col justify-center gap-2 rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors sm:flex-row sm:items-center sm:gap-4`,`hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,F.pressCard),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(m,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),t[1]=o):o=t[1];let s;t[2]===n.name?s=t[3]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 text-sm font-semibold leading-snug text-fg`,children:n.name}),t[2]=n.name,t[3]=s);let c;t[4]!==n.isCustom||t[5]!==r.custom?(c=n.isCustom?(0,Q.jsx)(`span`,{className:`shrink-0 rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:r.custom}):null,t[4]=n.isCustom,t[5]=r.custom,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[o,s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==n.modelCount||t[11]!==r.modelsCount||t[12]!==r.noModels?(u=n.modelCount>0?r.modelsCount.replace(`{{count}}`,String(n.modelCount)):r.noModels,t[10]=n.modelCount,t[11]=r.modelsCount,t[12]=r.noModels,t[13]=u):u=t[13];let d;t[14]===u?d=t[15]:(d=(0,Q.jsx)(`span`,{className:`whitespace-nowrap text-xs text-fg-subtle`,children:u}),t[14]=u,t[15]=d);let f;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(b,{className:`size-3`,"aria-hidden":!0}),t[16]=f):f=t[16];let p;t[17]===r.manage?p=t[18]:(p=(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-medium text-accent-fg`,children:[f,r.manage]}),t[17]=r.manage,t[18]=p);let h;t[19]!==d||t[20]!==p?(h=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-4 pl-6 sm:justify-end sm:pl-0`,children:[d,p]}),t[19]=d,t[20]=p,t[21]=h):h=t[21];let g;return t[22]!==i||t[23]!==h||t[24]!==l?(g=(0,Q.jsxs)(`button`,{type:`button`,onClick:i,className:a,children:[l,h]}),t[22]=i,t[23]=h,t[24]=l,t[25]=g):g=t[25],g}export{oe as C,ae as D,le as E,ie as O,J as S,se as T,pe as _,Fe as a,Y as b,Oe as c,De as d,je as f,X as g,be as h,Ie as i,ke as l,Se as m,Ke as n,Ne as o,Ae as p,Le as r,Pe as s,$e as t,Me as u,fe as v,ce as w,ue as x,de as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-Bg_XR36n.js";import{t as s}from"./messages-DG4HLOER.js";import{t as c}from"./secret-input-BQvFXqzz.js";import{t as l}from"./settings-uiTATseT.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./button-CnRSIP6m.js";import{t as f}from"./skeleton-BI5TyibZ.js";import{a as p,c as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./dist-DfWfZ9iu.js";import{i as x}from"./vendor-swr-CdRzEUwF.js";import{C as S,D as C,f as w,t as T}from"./connectors-api-BjypBp2g.js";import{t as E}from"./confirm-dialog-XGclfBqe.js";import{t as D}from"./oauth-provider-connect-DGGGGtcB.js";var O=t({ConnectorServiceDialog:()=>I,ConnectorServicePage:()=>M}),k=r(),A=e(n(),1),j=i();function M(){let e=(0,k.c)(11),t=o(N),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.connectorsSettings,i=t===`zh`,c;e[2]===r.title?c=e[3]:(c=(0,j.jsx)(a,{to:`/capabilities/connectors`,className:`text-sm text-accent-fg`,children:r.title}),e[2]=r.title,e[3]=c);let l=i?`应用连接服务`:`App connection service`,u;e[4]===l?u=e[5]:(u=(0,j.jsx)(`h1`,{className:`text-xl font-semibold`,children:l}),e[4]=l,e[5]=u);let d,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:(0,j.jsx)(P,{})}),f=(0,j.jsx)(R,{}),e[6]=d,e[7]=f):(d=e[6],f=e[7]);let p;return e[8]!==c||e[9]!==u?(p=(0,j.jsxs)(`main`,{className:`mx-auto w-full max-w-2xl space-y-6 p-6`,children:[c,u,d,f]}),e[8]=c,e[9]=u,e[10]=p):p=e[10],p}function N(e){return e.language}function P(){let e=(0,k.c)(2),t=o(F)===`zh`?`此设置决定新账号通过哪个服务连接。已有账号继续使用其原来的连接服务。`:`Choose the service for new accounts. Existing accounts keep their original service.`,n;return e[0]===t?n=e[1]:(n=(0,j.jsx)(j.Fragment,{children:t}),e[0]=t,e[1]=n),n}function F(e){return e.language}function I(e){let t=(0,k.c)(27),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{open:r,onOpenChange:i,hideTrigger:a}=n,c=a!==void 0&&a,f=o(L),x;t[2]===f?x=t[3]:(x=s(f),t[2]=f,t[3]=x);let S=x.connectorsSettings,C=f===`zh`,w;t[4]!==c||t[5]!==C?(w=c?null:(0,j.jsx)(m,{asChild:!0,children:(0,j.jsxs)(d,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":C?`应用连接服务`:`Connection service`,children:[(0,j.jsx)(l,{className:`size-4`,"aria-hidden":!0}),(0,j.jsx)(`span`,{className:`hidden sm:inline`,children:C?`应用连接服务`:`Connection service`})]})}),t[4]=c,t[5]=C,t[6]=w):w=t[6];let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,j.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[7]=T):T=t[7];let E=C?`应用连接服务`:`App connection service`,D;t[8]===E?D=t[9]:(D=(0,j.jsx)(y,{className:`text-base font-semibold text-fg`,children:E}),t[8]=E,t[9]=D);let O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,j.jsx)(h,{className:`mt-1 text-sm text-fg-muted`,children:(0,j.jsx)(P,{})}),t[10]=O):O=t[10];let A;t[11]===D?A=t[12]:(A=(0,j.jsxs)(`div`,{className:`min-w-0`,children:[D,O]}),t[11]=D,t[12]=A);let M;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,j.jsx)(u,{className:`size-5`,"aria-hidden":!0}),t[13]=M):M=t[13];let N;t[14]===S.modalClose?N=t[15]:(N=(0,j.jsx)(g,{asChild:!0,children:(0,j.jsx)(d,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":S.modalClose,children:M})}),t[14]=S.modalClose,t[15]=N);let F;t[16]!==N||t[17]!==A?(F=(0,j.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-6 py-5`,children:[A,N]}),t[16]=N,t[17]=A,t[18]=F):F=t[18];let I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:(0,j.jsx)(R,{})}),t[19]=I):I=t[19];let z;t[20]===F?z=t[21]:(z=(0,j.jsxs)(_,{children:[T,(0,j.jsxs)(v,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(100dvh-2rem,42rem)] w-[min(100%-2rem,42rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-float`,children:[F,I]})]}),t[20]=F,t[21]=z);let B;return t[22]!==i||t[23]!==r||t[24]!==z||t[25]!==w?(B=(0,j.jsxs)(b,{open:r,onOpenChange:i,children:[w,z]}),t[22]=i,t[23]=r,t[24]=z,t[25]=w,t[26]=B):B=t[26],B}function L(e){return e.language}function R(){let e=o(e=>e.language),t=s(e).connectorsSettings,n=e===`zh`,{data:r,error:i,mutate:a}=x(`connector-service`,w),[l,u]=(0,A.useState)(``),[p,m]=(0,A.useState)(!1),[h,g]=(0,A.useState)(),[_,v]=(0,A.useState)();async function y(e){m(!0),g(void 0);try{await e(),u(``),await a()}catch(e){g(e instanceof Error?e.message:String(e))}finally{m(!1)}}return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[!r&&!i?(0,j.jsx)(f,{className:`h-40 w-full`}):null,r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:`XOPC Cloud`}),(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.composioSetupHint}),(0,j.jsx)(D,{providerId:`xopc-cloud`,displayName:`XOPC Cloud`,connected:r.mode===`managed`&&r.configured,onConnected:()=>{a()}}),(0,j.jsx)(d,{variant:`secondary`,disabled:p||r.mode===`managed`&&r.configured,onClick:()=>void y(()=>C({mode:`managed`})),children:r.mode===`managed`?n?`当前服务`:`Current service`:n?`使用 XOPC Cloud`:`Use XOPC Cloud`})]}),(0,j.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:t.composioSetupByok}),(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsxs)(`ol`,{className:`list-inside list-decimal text-sm text-fg-muted`,children:[(0,j.jsx)(`li`,{children:t.composioSetupStepProject}),(0,j.jsx)(`li`,{children:t.composioSetupStepKey}),(0,j.jsx)(`li`,{children:t.composioSetupStepPaste})]}),(0,j.jsx)(`a`,{href:`https://app.composio.dev`,target:`_blank`,rel:`noreferrer`,className:`text-sm text-accent-fg`,children:t.composioSetupOpenDashboard}),(0,j.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,j.jsx)(`span`,{children:`Composio API key`}),(0,j.jsx)(c,{value:l,onChange:u,labels:t.secretInputLabels,placeholder:t.composioSetupKeyPlaceholder})]}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.composioSetupStorageHint}),(0,j.jsx)(d,{disabled:p||!l.trim(),onClick:()=>void y(()=>T(l)),children:n?`验证并使用新项目`:`Verify and use new project`}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n?`验证只检查连接服务和现有账号访问,不执行写入。工具权限在实际使用时检查。环境变量密钥需在运行环境中修改。`:`Verification checks service and existing account access without writes. Tool permissions are checked on use. Environment keys must be updated in the gateway environment.`}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.composioSessionWritePermissionHint}),r.backends?.filter(e=>e.mode===`byok`).map(e=>(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 text-sm`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{children:e.label}),(0,j.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.credentialSource===`environment`?n?`环境变量`:`Environment`:n?`本地保存`:`Stored locally`,e.verifiedAt&&` · ${new Date(e.verifiedAt).toLocaleString()}`]})]}),(0,j.jsx)(d,{variant:`ghost`,disabled:p||!l.trim()||e.credentialSource===`environment`,onClick:()=>void y(()=>T(l,e.id)),children:n?`用上方密钥更新`:`Update with key above`}),(0,j.jsx)(d,{variant:`ghost`,disabled:p||e.id===r.backendId,onClick:()=>void y(()=>C({backendId:e.id})),children:e.id===r.backendId?n?`当前服务`:`Current service`:n?`使用`:`Use`}),(0,j.jsx)(d,{variant:`ghost`,disabled:p||e.id===r.backendId,onClick:()=>v(e.id),children:n?`移除`:`Remove`})]},e.id))]})]})]}):null,h||i?(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:h??String(i)}):null,(0,j.jsx)(E,{open:!!_,title:n?`移除连接服务`:`Remove connection service`,description:n?`移除此服务及其本地保存的密钥,不修改环境变量。需要先切换服务并断开该项目的账号,已有数据不会删除。`:`Remove this service and its saved key, without changing environment variables. Switch services and disconnect this project’s accounts first. Existing data is retained.`,confirmLabel:n?`移除`:`Remove`,cancelLabel:t.modalCancel,destructive:!0,onCancel:()=>v(void 0),onConfirm:()=>{let e=_;v(void 0),e&&y(()=>S(e))}})]})}export{O as n,I as t};
|
package/dist/gateway/static/root/assets/{connectors-api-CwRuUnH4.js → connectors-api-BjypBp2g.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-Bg_XR36n.js";import{n}from"./gateway-config-swr-DfPQIHOL.js";function r(e,t){if(!e.payload)throw Error(e.error??t);return e.payload}async function i(){return r(await t(e(`/api/connectors/catalog`)),`Could not load connector catalog.`).connectors}async function a(n){let i=new URLSearchParams;return n?.q?.trim()&&i.set(`q`,n.q.trim()),n?.page&&i.set(`page`,String(n.page)),n?.pageSize&&i.set(`pageSize`,String(n.pageSize)),n?.refresh&&i.set(`refresh`,`1`),n?.verification&&i.set(`verification`,n.verification),r(await t(e(`/api/connectors/composio/catalog${i.size?`?${i.toString()}`:``}`)),`Could not load Composio catalog.`)}async function o(n){let i=new URLSearchParams;return n?.q?.trim()&&i.set(`q`,n.q.trim()),n?.page&&i.set(`page`,String(n.page)),n?.pageSize&&i.set(`pageSize`,String(n.pageSize)),n?.category?.trim()&&i.set(`category`,n.category.trim()),n?.sort&&i.set(`sort`,n.sort),r(await t(e(`/api/capabilities/connectors${i.size?`?${i.toString()}`:``}`)),`Could not load Store connector capabilities.`)}async function s(n,i){return r(await t(e(`/api/capabilities/connectors/${encodeURIComponent(n)}/install-plan`),{method:`POST`,body:JSON.stringify({version:i})}),`Could not prepare connector installation.`).plan}async function c(i,a,o,s){let c=await t(e(`/api/capabilities/connectors/${encodeURIComponent(i)}/install`),{method:`POST`,body:JSON.stringify({...a,version:o,reviewHash:s})});return n(),r(c,`Could not install Store connector.`).instance}async function l(){return r(await t(e(`/api/connectors/installed`)),`Could not load installed connectors.`).instances}async function u(n,i){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/auth/start`),{method:`POST`,body:JSON.stringify({accountId:i})}),`Could not start connector authorization.`).authorization}async function d(){return r(await t(e(`/api/connectors/composio/setup-status`)),`Could not check the connection service.`)}async function f(n,i){r(await t(e(`/api/connectors/composio/setup`),{method:`POST`,body:JSON.stringify({apiKey:n,replaceBackendId:i})}),`Could not enable the connection service.`)}async function p(n){await t(e(`/api/connectors/composio/setup`),{method:`POST`,body:JSON.stringify(n)})}async function m(n){await t(e(`/api/connectors/composio/backends/${encodeURIComponent(n)}`),{method:`DELETE`})}async function h(n){await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}`),{method:`DELETE`})}async function g(i,a){let o=await t(e(`/api/connectors/${encodeURIComponent(i)}/install`),{method:`POST`,body:JSON.stringify(a)});return n(),r(o,`Could not install connector.`).instance}async function _(n,i){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/config`),{method:`POST`,body:JSON.stringify(i)}),`Could not update connector config.`).instance}async function v(r){await t(e(`/api/connectors/${encodeURIComponent(r)}`),{method:`DELETE`}),n()}async function y(n){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/test`),{method:`POST`}),`Connector test failed.`)}async function b(){return r(await t(e(`/api/connectors/composio/connections`)),`Could not load Composio connections.`).connections}async function x(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/auth-configs`)),`Could not load Composio auth configs.`).auth}async function S(e,t,n=12e4,r){let i=Date.now()+n,a=1500;for(;Date.now()<i;){if(r){let e=await C(r);if(e.status===`failed`)throw Error(`Authorization failed or a different account was authorized. The original account was not changed.`);if(e.status===`expired`)throw Error(`Authorization expired. Start a new connection.`);if(e.status!==`succeeded`){await new Promise(e=>window.setTimeout(e,a)),a=Math.min(5e3,a*1.5);continue}}let n=(await b().catch(()=>[])).find(n=>n.toolkit.toLowerCase()===e.toLowerCase()&&n.status===`active`&&(!t||n.providerConnectionId===t));if(n)return n;await new Promise(e=>window.setTimeout(e,2e3))}throw Error(`Connection authorization timed out.`)}async function C(n){return r(await t(e(`/api/connectors/composio/authorizations/${encodeURIComponent(n)}`)),`Could not check authorization.`).attempt}async function w(n,i){return r(await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update Composio connection.`).connection}async function T(n,r){await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)})}async function E(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/health`)),`Could not check Composio connector health.`).health}async function D(n){await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}/refresh`),{method:`POST`})}async function O(n){await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}`),{method:`DELETE`})}async function k(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/scope`)),`Could not load Composio scope.`).scope}async function A(i,a){let o=await t(e(`/api/connectors/composio/${encodeURIComponent(i)}/scope`),{method:`POST`,body:JSON.stringify({scope:a})});return n(),r(o,`Could not update Composio scope.`).scope}async function j(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/policy`)),`Could not load Composio policy.`)}async function M(n,i){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/policy`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update Composio policy.`).policy}async function N(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/tools`)),`Could not load Composio tools.`).tools}async function P(n=50){return r(await t(e(`/api/connectors/composio/triggers?limit=${encodeURIComponent(String(n))}`)),`Could not load Composio trigger events.`).events}async function F(n){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/learning`),{method:`POST`}),`Could not start learning from this connection.`).job}async function I(){return r(await t(e(`/api/connectors/learning`)),`Could not load connector learning jobs.`).jobs}async function L(n){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/sync-policy`)),`Could not load connector sync policy.`).policy}async function R(n,i){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/sync-policy`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update connector sync policy.`).policy}async function z(n){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/source-sync`),{method:`POST`}),`Could not sync connector source.`)}async function B(n=`pending`){return r(await t(e(`/api/connectors/approvals?status=${encodeURIComponent(n)}`)),`Could not load connector approvals.`).approvals}async function V(n,i){return r(await t(e(`/api/connectors/approvals/respond`),{method:`POST`,body:JSON.stringify({id:n,decision:i})}),`Could not update connector approval.`).approval}async function H(i,a){let o=await t(e(`/api/connectors/${encodeURIComponent(i)}/${a?`enable`:`disable`}`),{method:`POST`});return n(),r(o,`Could not update connector state.`).instance}export{F as A,m as C,p as D,O as E,w as F,M as I,_ as L,z as M,y as N,A as O,T as P,R,D as S,V as T,b as _,l as a,B as b,C as c,k as d,d as f,c as g,g as h,i,u as j,H as k,E as l,L as m,h as n,o,x as p,a as r,s,f as t,j as u,N as v,v as w,I as x,P as y,S as z};
|