@xopcai/xopc 0.0.480 → 0.0.482
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/dingtalk/src/index.js +8 -3
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/server/chunks.bin +1548 -1552
- package/dist/gateway/server/chunks.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-9wMoZ4Ok.js → activity-store-BCPCuT-6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-TrALdAg_.js → agent-avatar-dicebear-Di9jxcH9.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BiHRFRo2.js → agent-avatar-display-KbzBlJ8W.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DLopBKfN.js → agent-defaults-settings-panel-CYZzdU6C.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-wisFd2cR.js → agent-plugin-dialog-Bhkawcil.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CzgZX_E9.js → agents-B2RXJeIo.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-Crvl6IB4.js → agents-admin-api-DpfkHNbc.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DQVcF1zq.js → api-BtngCZrB.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CJvZsRen.js → api-CnOSHyKU.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CYwY9a8P.js → app-management-settings-panel-Dyc3I-ng.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-8clf9SDY.js → appearance-settings-CmdhL-0n.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-B2qv9gWd.js → apps-page-BFqC9Knk.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Bu1nF6Lg.js → archive-plugin-DFP0MajV.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-HQmKv0Sm.js → automation-api-Cc5X3Q1t.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CMjfyY6p.js → automation-result-state-B7fHzLLf.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-wlGMBYYv.js → automation-run-list-DPTby29p.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-2EsZ1jBs.js → automation-task-card-CjzArAJi.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BUtoiUiH.js → automations-page-BKbElVfF.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CW_8-0Cb.js → automations-workspace-_18qOoLm.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Dz62GXI_.js → binary-plugins-DnE-iqaV.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CA66tdm3.js → block-editor-CYobheuw.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-settings-page-hAttQ9qS.js → browser-settings-page-BLniK98R.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-BfTF_flC.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-BNmDs-Ca.js → capabilities-oihQXc5J.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-B32XFJ59.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CWnHPY8j.js +8 -0
- package/dist/gateway/static/root/assets/capability-presentation-DlJQUUlM.js +1 -0
- package/dist/gateway/static/root/assets/{channels-CFmGXibE.js → channels-DEIqjf9M.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-LVSL686y.js → chat-agents-api-BzuJyysa.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-Drmp5p0m.js → chat-chart-block-DurSfGy2.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-CK4aWVbI.js +74 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-twWNRsuW.js → chat-terminal-dock-UBaRUsXJ.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-B27c_GTI.js → command-palette-api-3kNqE3U7.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-DdxZ-1U4.js → composer-model-config-control-CrI-u8F_.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-Dd64p5ZI.js → composer-notifications-L6u0F2_8.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-Cbkv-F26.js → composer-payload-handoff-DdHGkHOq.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-B8UkO-mU.js → computer-settings-page-BwvCOkbI.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-B8eiZl6Z.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-CNB9P9jg.js → connection-usage-guide-CydSRk3h.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DkifsBTl.js → connector-service-page-CLBi6R-Z.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DjIpuBCy.js → connectors-api-Bn2IbtcF.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-oGveGlkI.js → connectors-page-ywk7W0s6.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-_G6tIiGk.js → date-picker-DsD7NIm2.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-B3lS-ZGW.js → date-time-picker-BhnBpBpj.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAKyq-sn.js → desktop-pet-eFR-zmP2.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DGpu4hH_.js → desktop-pet-settings-CfFTYstQ.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-DqYjZFu1.js → dev-view-store-D_uPX9_R.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CIvmpDvo.js → device-pairing-wizard-BeLkoDUp.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BAsEQvG4.js → directory-picker-path-field-5wZa0JF3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-BmlRcbhA.js → extension-authoritative-grants-DaA0KXyO.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page--EU_kb8E.js → extension-debug-page-CXe8jimk.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CcspWP4N.js → extension-iframe-host-BwMISzWU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-BQIfGFSy.js → extension-marketplace-api-DuWuae8G.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-f7v82b69.js → extension-message-router-DzBfVl6h.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-page-CJxtbXQj.js → extension-page-DW18FOb8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-htRLPCBf.js → extension-provider-CyYrgUw-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CKui11ZQ.js → extension-settings-page-ByGVQYDw.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Cwy9Cgaq.js → file-preview-surface-Cw70pwph.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-abWJ0Q_y.js → gateway-config-swr-BYoBGl6i.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-PYDAppcy.js → gateway-realtime-Dzq6_piH.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B9CDQ8NO.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-BtAJNIO-.js → gateway-restart-CtqJpyNu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BvD8fcB2.js → gateway-settings-xzO7KDsu.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cza1BaL8.js → gateway-startup-retry-DCDOl6Oo.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BIa73mvy.js → global-defaults-api-DXFSI87T.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CztF0goW.js +8 -0
- package/dist/gateway/static/root/assets/home-task-actions-DTXb7Gc7.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BCU7Uxyy.js → image-generation-api-Ck0rMJy3.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Clh0polM.js → imports-page-egn9yYfF.js} +1 -1
- package/dist/gateway/static/root/assets/index-dqkMYWTd.js +11 -0
- package/dist/gateway/static/root/assets/index-q78xsKF3.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-DSkXYsng.js → install-connector-dialog-CMh8jhn1.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Crf76ecq.js → keyboard-shortcuts-settings-BOiKmOwN.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-WudNXl41.js → local-app-workbench-page-ev6VTDX2.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Br9ZO7Ad.js → local-apps-page-CQBSa3cR.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-BHrHLZJJ.js → local-session-drafts-pAAFf-Ad.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-5DzxIIeq.js → locale-store-BYdvIuPj.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BqUeqzPB.js → logs-page-Z-4VNgnq.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-DHCpR1ma.js → management-api-D739TCBl.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BccKy8tW.js → management-settings-CZDWUPmg.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-BOJVaGPC.js +261 -0
- package/dist/gateway/static/root/assets/markdown-view-Czi3_WHu.css +1 -0
- package/dist/gateway/static/root/assets/marked.esm-8VXEA2AD.js +64 -0
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DxZ-KH6B.js → mcp-conversation-setup-page-NcRvP7cK.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DissTT0S.js → media-plugins-B9bQ3e1j.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CGGOcV9B.js → messages-lc5BjBtX.js} +2 -2
- package/dist/gateway/static/root/assets/{model-selector-DsCLjn_X.js → model-selector-DugdMlvi.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-B0Y9Frop.js → models-hub-cache-DvDksW4g.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CEi6GNEA.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-DftbeSZR.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CdC4jVPP.js → notes-api-auhtw3zM.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CC5-BWmA.js → notes-page-DnI1iJ3g.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CAPuqZdT.js → oauth-api-BXKG29Kg.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-7i3NoKo4.js → oauth-provider-connect-y6-vDWb-.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BcSfcOme.js → page-context-capture-button-BBVJZgU0.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BJ2cY1Us.js → page-context-draft-B30xEPDh.js} +1 -1
- package/dist/gateway/static/root/assets/{page-header-store-xgXJVGDC.js → page-header-store-BGCCXOOf.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-avatar-CidTaDAv.js → personal-avatar-w5Sekj02.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BlxApjBh.js → personal-page-BWzfp81f.js} +1 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-BYmKk14v.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-BXKSkUoc.js → personal-settings-panel-DYnTT7aB.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-_7leySaj.js → phone-dependencies-card-DJciwZ-7.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CVI6GGMF.js → phone-model-connection-C3jmc4ma.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-qP1Sh-eA.js → phone-model-picker-MWC_Zh2a.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-BAKOJllx.js → phone-settings-page-C1Yc6tP7.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CDtfKAUX.js → phone-workspace-store-Cxk2PJZe.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BpPMZLLz.js → plugin-details-dialog-CpKZE_nx.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BS-XMhb4.js → preference-select-fields-ByihE_wl.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-runtime-D8kxmrLV.js → preview-runtime-iJuVSugF.js} +3 -3
- package/dist/gateway/static/root/assets/product-automation-feedback-ref9gqOW.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BUqA67HG.js → product-open-page-B7kAAD7Q.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CowHxHNk.js → product-preview-content-CzNWh2h2.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-BJDwL7x3.js → product-preview-modal-B1RKw3Z-.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-CJQuslC9.js → project-detail-page-Zr1I56NG.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-eH4uN6k8.js → project-understanding-D0S9pFg7.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DFo_ESE9.js → projects-page-DlwRbxAj.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-Df4w723e.js → providers-api-D_v_CJ3l.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DnRi2KQ5.js → recording-upload-BSyxK34y.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Dw8Ou9VV.js → registry-api-DGi-X6j7.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B7jGK_WY.js → remote-access-hub-D3EYRXQC.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-CZV8cItD.js → resource-unavailable-52Jvhy-I.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-DOyKalyG.js → right-workspace-store-DsGslCi-.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-D00yB6hp.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-sCpXMbMl.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-2sksjMtE.js → runtime-tools-api-D8Xtty0g.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DPX5htrV.js → runtime-tools-settings-panel-r28zxrgP.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-BnJcjQuF.js → service-recommendation-list-Kw6pwI8U.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CUkWJyfm.js → session-api-eApyRHbI.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-CJAPoVO-.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-DRFdxntH.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-label-CZf50vSj.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-C-oe-9_N.js +28 -0
- package/dist/gateway/static/root/assets/sessions-page-BkNfjgXC.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B82UPSQS.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-Bponzv_k.js → settings-advanced-section-Dc9aztiW.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BtgmaA-P.js → settings-mode-store-DcE2iR7e.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C1USPFgf.js → settings-page-CXRPZxuB.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-B8nLRdnY.js → settings-page-header-CQueaD1Z.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DhOLVJYv.js → settings-page-layout-BlwyxcEq.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-CyEO6jAM.js → setup-interaction-page-BvL6C5ja.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CNpRqxnq.js → setup-status-panel-Dp5cY2P9.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-kZSUpbBN.js → share-link-dialog-CB3LkWw8.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-9-aTa7_a.js → share-preview-page-IG0fTWJO.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BxQqmxkq.js → shares-api-DgYOJV0T.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DoMMw8Ud.js → shares-settings-YeLkRDki.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-V3Y6pTog.js → skill-api-DRCHLW2T.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BSHfM0qb.js → skill-list-api-CQUhEUOF.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-Dq3F9pqP.js → skill-reload-api-BoEna1cx.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DGWy1Jns.js → skills-page-CBAL83FE.js} +1 -1
- package/dist/gateway/static/root/assets/{space-api-BkXqM2MT.js → space-api-d4Q4hkEY.js} +1 -1
- package/dist/gateway/static/root/assets/space-page-8BMb_g2p.js +2 -0
- package/dist/gateway/static/root/assets/{space-workbook-7S_FfalA.js → space-workbook-BDjeiRtr.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DSmwwU8o.js → system-settings-panel-dt8k0K4V.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DFeKIcxT.js +3 -0
- package/dist/gateway/static/root/assets/{task-header-title-DAwu5vni.js → task-header-title-ClyuCAFb.js} +1 -1
- package/dist/gateway/static/root/assets/task-run-issue-notice-XWlgvgEo.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-BIehlq7k.js → tasks-CwyNaa-j.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-IpKmyQVN.js → terminal-panel-store-CNkRP4kf.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-B75oCec7.js → theme-store-nXIuAiQZ.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-CVj7aLAl.js → tracing-settings-page-CoWcr2c0.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-TWW8dGwO.js → tunnel-api-DgsELO9g.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-NgjWPD55.js → understanding-activity-store-BI_PbKCi.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CN-7T5G5.js → understanding-refresh-store-DPHzCi1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-D6mzQviK.js → usage-page-BVNBJa59.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BYtW_pgF.js → use-autosave-BPDFVsgM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dn6X6xAP.js → use-composer-attachments-9nVD0sQ1.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BT0pss9g.js → use-file-preview-expanded-BhmEiOkv.js} +1 -1
- package/dist/gateway/static/root/assets/{use-generated-media-CuhMqXFp.js → use-generated-media-CLEV4wYC.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-profile-DxE21oPS.js → use-personal-profile-CFaihmiJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-personal-work-j8AH0g9w.js → use-personal-work-CIZMwOlm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-CNG2yeaO.js → use-realtime-voice-CvtX2HcA.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-BohZkOOW.js → use-workspace-tree-BnvuxYD4.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Dlm-Mmo4.js → user-model-page-D4yNFvW1.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-D_o-xx9v.js → voice-api-key-field-NINoxB5r.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-BX2Q9Cgb.js → voice-config-api-7cvKLNoE.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-qbqLMfW_.js → voice-input-shortcut-events-DaCuiqoi.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-player-store-z-upb7lD.js → voice-player-store-DipmM7w1.js} +1 -1
- package/dist/gateway/static/root/assets/voice-settings-BTvMqF_9.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-ClPiLw1F.js → work-discovery-overlay-BKdumzyK.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BohjMx1A.js → work-discovery-page-uX1VIzJY.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CcD0smT0.js → working-directory-picker-modal-C9hWAPvW.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-_mQWmOZm.js +2 -0
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BzuNTkZu.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BjJEOajj.js → workspace-file-preview-dialog-D4Nc7XkR.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Bc8qK8WA.js → workspace-open-location-menu-BZSS94es.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BWdmU4iy.js → xopc-cloud-account-card-xJr48TmR.js} +1 -1
- package/dist/gateway/static/root/index.html +125 -123
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +38 -2
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +6 -5
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +8 -2
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/discovery.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/mcp/connection-drafts.d.ts +1 -1
- package/dist/src/agent/mcp/connection-drafts.js +15 -2
- package/dist/src/agent/mcp/managed-discovery.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service.js +5 -4
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +3 -2
- package/dist/src/agent/tools/personal-memory-tool.js +2 -2
- package/dist/src/agent/tools/personal-request-tool.d.ts +1 -0
- package/dist/src/agent/tools/personal-request-tool.js +2 -1
- package/dist/src/agent/tools/personal-task-tool.js +44 -13
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/skill-manage-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +3 -3
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +1 -1
- package/dist/src/automations/service/automation-service.js +1 -1
- package/dist/src/capabilities/capability-catalog.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/enterprise/setup.d.ts +4 -0
- package/dist/src/channels/enterprise/setup.js +3 -2
- package/dist/src/channels/plugins/types.adapters.d.ts +4 -0
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -1
- package/dist/src/connectors/connection-recovery-service.js +10 -7
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +1 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.d.ts +3 -1
- package/dist/src/gateway/hono/routes/mobile-capability-panels.js +144 -50
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -1
- package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/task-retry.d.ts +3 -0
- package/dist/src/gateway/hono/routes/task-retry.js +20 -0
- package/dist/src/gateway/hono/routes/tui.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.js +1 -1
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service.d.ts +9 -0
- package/dist/src/gateway/service.js +21 -13
- package/dist/src/local-apps/automation-proposals.js +1 -1
- package/dist/src/local-apps/capabilities/projections.d.ts +1 -1
- package/dist/src/local-apps/execution-authority.js +1 -1
- package/dist/src/local-apps/p1-services.js +2 -2
- package/dist/src/local-apps/preview-worker.js +1 -1
- package/dist/src/local-apps/service.js +3 -3
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +3 -3
- package/dist/src/personal-agent/capability-service.js +2 -2
- package/dist/src/personal-agent/prompt-context.js +1 -1
- package/dist/src/personal-agent/prompts.js +2 -2
- package/dist/src/personal-agent/reply-composer.d.ts +2 -0
- package/dist/src/personal-agent/reply-composer.js +132 -82
- package/dist/src/personal-agent/reply-result.d.ts +11 -0
- package/dist/src/personal-agent/reply-result.js +60 -0
- package/dist/src/personal-agent/reply-style.d.ts +1 -1
- package/dist/src/personal-agent/reply-style.js +1 -1
- package/dist/src/personal-agent/request-access.js +1 -1
- package/dist/src/personal-agent/request-delivery.d.ts +1 -1
- package/dist/src/personal-agent/request-delivery.js +10 -9
- package/dist/src/personal-agent/request-service.d.ts +3 -1
- package/dist/src/personal-agent/request-service.js +75 -64
- package/dist/src/projects/capabilities/write.js +3 -3
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/runtime-tools/harmony-dependencies.js +5 -5
- package/dist/src/runtime-tools/hdc-files.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +2 -2
- package/dist/src/tasks/capabilities/read.js +1 -1
- package/dist/src/tasks/capabilities/relations.js +1 -1
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/index.js +1 -1
- package/dist/src/tasks/task-allocation-service.js +3 -3
- package/dist/src/tasks/task-application-service.d.ts +8 -0
- package/dist/src/tasks/task-application-service.js +18 -7
- package/dist/src/tasks/task-context-assembler.js +2 -2
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tasks/task-execution-capabilities.js +2 -2
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.js +2 -2
- package/dist/src/tasks/task-origin-repository.d.ts +2 -0
- package/dist/src/tasks/task-origin-repository.js +3 -2
- package/dist/src/tasks/task-read-model-projector.js +22 -8
- package/dist/src/tasks/task-research-result.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +1 -1
- package/dist/src/tasks/task-retry-policy.d.ts +5 -0
- package/dist/src/tasks/task-retry-policy.js +48 -0
- package/dist/src/tasks/task-retry-service.d.ts +18 -0
- package/dist/src/tasks/task-retry-service.js +186 -0
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-dispatcher.js +2 -1
- package/dist/src/tasks/task-run-repository.d.ts +1 -1
- package/dist/src/tui/backends/embedded-backend.js +3 -3
- package/dist/src/tui/tui-capabilities.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/voice/realtime/memory-context.d.ts +1 -1
- package/dist/src/voice/realtime/memory-context.js +12 -10
- package/dist/src/voice/realtime/omniEngine.js +32 -12
- package/dist/src/voice/realtime/omniRoute.js +1 -1
- package/dist/src/voice/realtime/runtime.js +15 -11
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/capabilities-BcgSEYc5.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-CT6qMkqA.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-9lLzGQ-F.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-qrdWReZ2.js +0 -72
- package/dist/gateway/static/root/assets/connected-providers-grid-ds0J-7Qc.js +0 -1
- package/dist/gateway/static/root/assets/diagnostics-Bo0Z42P_.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DTcS5Hqk.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CwUc6499.js +0 -8
- package/dist/gateway/static/root/assets/index-BWJ0tePz.js +0 -11
- package/dist/gateway/static/root/assets/index-C-4H3NhI.css +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BwbjZnQ6.js +0 -324
- package/dist/gateway/static/root/assets/markdown-view-DG8DDkEA.css +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DEz8I-eN.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-D-7a_BCN.js +0 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-D1TpPIVg.js +0 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-CDjJlwol.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-N7Ieq1wB.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BvBR3khG.js +0 -2
- package/dist/gateway/static/root/assets/session-channel-icon-COynhpeK.js +0 -1
- package/dist/gateway/static/root/assets/session-identity-label-DCIZvqbN.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-BRzFtnn4.js +0 -22
- package/dist/gateway/static/root/assets/sessions-page-PjTnKj7l.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-JrndQtAT.js +0 -1
- package/dist/gateway/static/root/assets/space-page-BAp28k1I.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-15Qm8kNq.js +0 -3
- package/dist/gateway/static/root/assets/task-result-evidence-BqAt23uk.js +0 -1
- package/dist/gateway/static/root/assets/voice-settings-BEhihzNq.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-Bpq_rBZM.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-BkCt8mdN.js +0 -1
- package/dist/gateway/static/root/assets/workspace-preview-store-QUX-jyAL.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
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-5DzxIIeq.js";import{t as c}from"./messages-CGGOcV9B.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dist-DlirbHVs.js";import{t as g}from"./createLucideIcon-DPHK1VkS.js";import{t as _}from"./chevron-left-DqFhpbvK.js";import{t as v}from"./chevron-right-BweFrslA.js";import{n as y,r as b}from"./popover-select-hRG1EzAY.js";import{t as x}from"./circle-check-C23XjkUj.js";import{t as S}from"./secret-input-DsjfQmDn.js";import{t as C}from"./globe-DSSGFWFn.js";import{t as w}from"./loader-circle-CifKLtgG.js";import{t as T}from"./plus-Q2yW6OE7.js";import{t as E}from"./search-DA7gz22f.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./x-B_N4OPjy.js";import{t as k}from"./cn-0WouolD0.js";import{t as A}from"./skeleton-DzdOeGYz.js";import{i as j}from"./vendor-swr-CdRzEUwF.js";import{r as M}from"./gateway-config-swr-abWJ0Q_y.js";import{n as N,t as P}from"./registry-api-Dw8Ou9VV.js";import{t as F}from"./button-C5tRaJxt.js";import{i as ee,o as te}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as I}from"./interaction-BdhHBbYa.js";import{a as L,o as ne,s as R}from"./form-field-width-DJw_jULe.js";import{n as re}from"./secret-input-labels-B5Jl5HqK.js";import{t as ie}from"./sliding-tab-list-CmcrqRzN.js";import{n as ae}from"./model-sort-_Tz8s_4N.js";import{n as oe}from"./capability-navigation-CZbCI5C2.js";import{i as se,n as ce}from"./models-hub-cache-B0Y9Frop.js";import{a as le,i as z,o as ue}from"./providers-api-Df4w723e.js";import{t as de}from"./oauth-provider-connect-7i3NoKo4.js";var B=g(`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`}]]),fe=g(`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`}]]),V=e(t(),1),H=n(),U=r();async function W(e){return(await s(a(`/api/models/setup/${encodeURIComponent(e)}`))).payload}async function pe(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 me(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 se()}function G(e,t){return e===`single`?t.getApiKey:e===`intl`?t.getApiKeyIntl:t.getApiKeyCn}var K={"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-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:[`ZAI_CODING_CN_API_KEY`,`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 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-api":{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 q(e,t){let n=K[e];return n&&n.apiKeyUrl?[{href:n.apiKeyUrl,kind:`single`}]:[]}var he=[`common`,`domestic`,`specialty`,`enterprise`,`oauth`,`extension`];function ge(e){let t=new Map;for(let e of he)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}function _e(e,t){switch(t){case`agent`:return e.sourceAgent;case`gateway`:return e.sourceGateway;case`oauth`:return e.sourceOauth;case`env`:return e.sourceEnv;case`models_json`:return e.sourceModelsJson;case`extension`:return e.sourceExtension;default:return e.sourceNone}}var ve=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`azure-openai-responses`,label:`Azure OpenAI`},{value:`bedrock-converse-stream`,label:`AWS Bedrock`},{value:`google-gemini-cli`,label:`Google Gemini CLI`},{value:`google-vertex`,label:`Google Vertex AI`}];function J(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 ye(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 be(){let e=await i(a(`/api/models-json`)),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok||!t.payload)throw Error(J(t)||`HTTP ${e.status}`);return{...t.payload,config:ye(t.payload.config)}}async function Y(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(J(n)||`HTTP ${t.status}`);return await se(),n.payload}async function X(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(J(n)||`HTTP ${t.status}`);return n.payload.models}function xe(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`}},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 API (International)`,providerId:`zai-api`,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`]}]}},dashscopePhone:{label:`Alibaba Bailian · Phone Use`,providerId:`dashscope-phone`,description:`Beijing GUI-Plus API, the official GUI-Owl hosted entry; requires a Beijing Bailian key`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`gui-plus-2026-02-26`,name:`Bailian GUI-Plus · Phone`,input:[`text`,`image`],contextWindow:262144,maxTokens:4096,phoneUse:{profile:`gui-owl-phone-v1`}}]}},modelscope:{label:`ModelScope`,providerId:`modelscope`,description:`General inference; select a model currently offered by ModelScope`,config:{baseUrl:`https://api-inference.modelscope.cn/v1`,api:`openai-completions`,apiKey:`MODELSCOPE_TOKEN`,models:[{id:`Qwen/Qwen3.5-35B-A3B`,name:`Qwen3.5 35B A3B`,input:[`text`],maxTokens:4096}]}},volcengineArk:{label:`Volcengine Ark`,providerId:`volcengine-ark`,description:`Doubao Seed GUI; use the activated model ID or your Ark endpoint ID`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`doubao-seed-2-1-pro-260915`,name:`Doubao Seed 2.1 Pro`,contextWindow:1024e3,maxTokens:4096,input:[`text`,`image`],phoneUse:{profile:`doubao-seed-phone-v1`}}]}},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`]}]}},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`]}]}}},Se=Object.entries(Z).map(([e,t])=>({key:e,...t}));function Q(e){return Z[e]?.providerId??e}function Ce(e){return Se.find(t=>t.providerId===e)?.key}var we=new Set([`modelscope`,`dashscope-phone`,`dashscope-cn`,`dashscope-intl`,`volcengine-ark`,`volcengine-plan`,`byteplus-plan`,`stepfun-cn`,`stepfun-intl`,`stepfun-plan-cn`,`stepfun-plan-intl`,`zhipu-cn`,`zai-api`]);function $(e){if(we.has(e))return Ce(e)}var Te=[{value:`text`,labelKey:`inputTextOnly`},{value:`text,image`,labelKey:`inputTextVision`}];function Ee(){return k(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,R,`dark:border-edge`)}function De(){return k(ne,L)}function Oe(e){return(e.input||[`text`]).includes(`image`)?`text,image`:`text`}function ke(e){return e===`text,image`?[`text`,`image`]:[`text`]}var Ae={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 je(e,t,n){return n?{"qwen-token-plan-cn":`阿里云百炼订阅 · 北京`,"qwen-token-plan":`阿里云百炼订阅 · 国际`,"dashscope-cn":`阿里云百炼 · 中国区`,"dashscope-intl":`阿里云百炼 · 国际区`,"xiaomi-token-plan-cn":`小米 MiMo 订阅 · 中国区`}[e]??t:t}function Me(e){let t=(0,H.c)(16),{value:n,onChange:r,language:i,disabled:a}=e,o=a!==void 0&&a,s=i===`zh`,c=(0,V.useId)(),l=s?`配置接入方式`:`Configure access method`,u;t[0]===l?u=t[1]:(u=(0,U.jsx)(`legend`,{className:`mb-2 text-sm font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`api-key`,`oauth`],t[2]=d):d=t[2];let f;t[3]!==o||t[4]!==c||t[5]!==r||t[6]!==n||t[7]!==s?(f=(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:d.map(e=>(0,U.jsxs)(`label`,{className:k(`relative flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-lg border px-3 text-sm text-fg has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-accent`,n===e?`border-accent bg-surface-active`:`border-edge bg-surface-panel`,o&&`cursor-default opacity-60`),children:[(0,U.jsx)(`input`,{className:`sr-only`,type:`radio`,name:c,value:e,checked:n===e,onChange:()=>r(e)}),e===`api-key`?`API Key`:s?`账号登录(OAuth)`:`Account (OAuth)`]},e))}),t[3]=o,t[4]=c,t[5]=r,t[6]=n,t[7]=s,t[8]=f):f=t[8];let p=s?`选择要配置的方式;保存密钥或完成授权后,按凭据优先级生效。已保存的 API Key 优先于 OAuth。`:`Choose which credentials to configure. Saved API keys take priority over OAuth; selecting a form does not switch the active connection.`,m;t[9]===p?m=t[10]:(m=(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:p}),t[9]=p,t[10]=m);let h;return t[11]!==o||t[12]!==u||t[13]!==f||t[14]!==m?(h=(0,U.jsxs)(`fieldset`,{disabled:o,className:`space-y-2`,children:[u,f,m]}),t[11]=o,t[12]=u,t[13]=f,t[14]=m,t[15]=h):h=t[15],h}function Ne(e){let t=(0,H.c)(17),{row:n,language:r}=e,i=r===`zh`,a=n?.authMode??n?.activeKeySource,o=n?.authStatus,s=o===`connected`,l=o===`expired`?i?`授权已过期`:`Authorization expired`:s?i?`凭据已配置`:`Credentials configured`:i?`未连接`:`Not connected`,u;t[0]===l?u=t[1]:(u=(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:l}),t[0]=l,t[1]=u);let d;t[2]!==r||t[3]!==a||t[4]!==i?(d=a&&a!==`none`?(0,U.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[i?`当前认证来源:`:`Current credential source: `,_e(c(r).providersSettings,a)]}):null,t[2]=r,t[3]=a,t[4]=i,t[5]=d):d=t[5];let f;t[6]!==a||t[7]!==i?(f=a===`env`?(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`正在使用环境变量中的凭据,无需重复填写。`:`Using credentials from the environment. No need to enter them again.`}):null,t[6]=a,t[7]=i,t[8]=f):f=t[8];let p;t[9]!==s||t[10]!==i?(p=s?(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`凭据状态不代表模型调用已验证。`:`Credential status does not verify model access.`}):null,t[9]=s,t[10]=i,t[11]=p):p=t[11];let m;return t[12]!==u||t[13]!==d||t[14]!==f||t[15]!==p?(m=(0,U.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-lg border border-edge-subtle bg-surface-panel/60 p-3`,children:[u,d,f,p]}),t[12]=u,t[13]=d,t[14]=f,t[15]=p,t[16]=m):m=t[16],m}var Pe={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:f,onApplied:p,inline:h=!1,onPendingChange:g}){let v=o===`zh`,C=(0,V.useRef)(!1),[T,E]=(0,V.useState)(null),[D,k]=(0,V.useState)({mode:i?`replace`:`fill`,modelIds:n}),[j,M]=(0,V.useState)(null),[N,P]=(0,V.useState)(!1),[ee,te]=(0,V.useState)(!1),[I,L]=(0,V.useState)(``),[ne,R]=(0,V.useState)(!1),[se,ce]=(0,V.useState)(!1),[z,ue]=(0,V.useState)(r||!!t?.configured),[B,fe]=(0,V.useState)(!1),H=(0,V.useRef)(!1),[W,G]=(0,V.useState)(``),[q,he]=(0,V.useState)(!1),[ge,_e]=(0,V.useState)(0);(0,V.useEffect)(()=>{let t=!0;return pe(e,{modelIds:n,...a?{selected:[]}:{},...i&&!a?{mode:`replace`,selected:[i]}:{}}).then(e=>{t&&(E(e),ue(e.configured),C.current||(C.current=!0,k({mode:i?`replace`:`fill`,modelIds:n,selected:a?[]:e.uses.filter(e=>e.selected).map(e=>e.id)})),G(``))}).catch(e=>{t&&G(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,n,i,a,ge]),(0,V.useEffect)(()=>(g?.(B||N),()=>g?.(!1)),[B,N,g]);let ve=t?.supportsOAuth??T?.profile.credential===`oauth`,J=t?.supportsApiKey??T?.profile.credential===`api-key`,ye=j??(t?.authMode===`oauth`||!J?`oauth`:`api-key`),be=J&&ye===`api-key`,Y=ve&&ye===`oauth`,X=ee||z&&(t?t.authMode===`oauth`&&t.authStatus===`connected`:T?.profile.credential===`oauth`),xe=t?!!t.apiKey:T?.profile.credential===`api-key`,Z=J&&ve&&!r&&!q?(0,U.jsx)(Me,{value:ye,language:o,disabled:B||N,onChange:e=>{M(e),L(``),R(!1)}}):null,Se=()=>{ue(!0),te(!0),L(``),R(!1),a?(he(!0),p?.()):_e(e=>e+1)},Q=D.selected??[],Ce=e=>{k({...D,mode:e,selected:T?.uses.filter(t=>t.recommended&&t.choices.length&&(e===`replace`||t.selected)).map(e=>e.id)??[]})},we=async()=>{if(!T||H.current)return;H.current=!0,fe(!0),G(``),ce(!1);let t=!1;try{I.trim()&&(await le({[e]:I.trim()}),t=!0,ce(!0),ue(!0),R(!1),L(``));let n=await pe(e,D);if(ue(n.configured),a){if(!n.configured)throw Error(v?`请先连接此服务。`:`Connect this service first.`);E(n),he(!0),p?.();return}let r=T.uses.filter(e=>Q.includes(e.id)).map(e=>D.overrides?.[e.id]??e.recommended),i=n.uses.filter(e=>Q.includes(e.id)).map(e=>D.overrides?.[e.id]??e.recommended);if(T.revision!==n.revision||JSON.stringify(r)!==JSON.stringify(i))throw E(n),k({...D,selected:n.uses.filter(e=>e.selected).map(e=>e.id)}),Error(v?`目录或当前配置已更新,请核对后再次应用。`:`The catalog or settings changed. Review the updated choices and apply again.`);if(!n.configured)throw Error(v?`请先连接此服务。`:`Connect this service first.`);await me(e,D,n.revision),E(n),he(!0),p?.()}catch(e){let n=e instanceof Error?e.message:String(e);G((!h&&t?v?`服务已保存,用途配置未完成。`:`Connection saved; model setup is incomplete. `:``)+n)}finally{H.current=!1,fe(!1)}},$=T?.profile.name??t?.name??e,Te=T?.profile.apiKeyUrl??K[e]?.apiKeyUrl;if(h){let t=T?.uses.find(e=>e.id===i),n=i?D.overrides?.[i]??t?.recommended:void 0,r=je(e,$,v);return(0,U.jsxs)(`div`,{className:`space-y-6 p-4 sm:p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:r}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`${v?`用于`:`For `}${oe[i][+!v]}`:``})]}),(0,U.jsx)(F,{variant:`ghost`,disabled:B||N,onClick:f,children:v?`更换服务`:`Change service`})]}),!T&&!W?(0,U.jsx)(A,{className:`h-48 w-full rounded-xl`}):null,T?(0,U.jsxs)(U.Fragment,{children:[Z,Y&&!X?(0,U.jsx)(de,{providerId:e,displayName:r,connected:X,onConnected:Se,onPendingChange:P}):null,Y&&X?(0,U.jsxs)(`p`,{className:`flex items-center gap-2 rounded-xl bg-surface-inset px-4 py-3 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),v?`使用已有连接`:`Using the existing connection`]}):null,be?(0,U.jsx)(`div`,{className:`space-y-3`,children:z&&!ne?(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,U.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),v?`使用已有连接`:`Using the existing connection`]}),(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>R(!0),children:xe?v?`更换`:`Change`:v?`添加 API Key`:`Add API key`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:T.profile.access===`subscription`?v?`订阅 API Key`:`Subscription API key`:`API Key`}),z?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>{R(!1),L(``)},children:xe?v?`保留原 Key`:`Keep saved key`:v?`保留当前连接`:`Keep current connection`}):null]}),(0,U.jsx)(S,{id:`provider-setup-key`,disabled:B,value:I,onChange:L,placeholder:z?v?`输入新的 API Key`:`Enter a new API key`:v?`粘贴 API Key`:`Paste your API key`,labels:re(c(o).providersSettings)}),z?(0,U.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:v?`此服务的其他已配置模型也会使用新的 Key。`:`Other models configured with this service will also use the new key.`}):null,Te?(0,U.jsx)(`a`,{className:`inline-flex min-h-10 items-center text-sm text-accent-fg hover:underline`,href:Te,target:`_blank`,rel:`noopener noreferrer`,children:v?`获取 API Key`:`Get an API key`}):null]})}):null,t?(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`label`,{className:`block text-sm font-medium text-fg`,children:v?`选择模型`:`Model`}),(0,U.jsx)(y,{value:n??``,disabled:B||!t.choices.length,"aria-label":v?`选择模型`:`Model`,onChange:e=>k({...D,selected:[t.id],overrides:{...D.overrides,[t.id]:e.target.value}}),children:[...t.choices].sort(ae).map(e=>(0,U.jsx)(b,{value:e.id,children:e.name},e.id))})]}):null,(0,U.jsxs)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:[v?`只更改当前能力使用的模型。`:`Changes the model for this capability only.`,T.profile.interactiveOnly?v?` 后台任务继续使用原服务。`:` Background tasks keep their current service.`:``]})]}):null,W?(0,U.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded-xl border border-edge p-3`,children:[(0,U.jsx)(`p`,{className:`text-sm text-danger`,children:se?v?`连接信息已保存,模型尚未切换。请重试。`:`Connection saved. The model has not switched; please retry.`:v?`未能应用配置,请重试。`:`Could not apply settings. Please retry.`}),(0,U.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer`,children:v?`查看详情`:`Show details`}),(0,U.jsx)(`p`,{className:`mt-2 break-words`,children:W})]})]}):null,(0,U.jsx)(`div`,{className:`flex items-center justify-end gap-3 border-t border-edge-subtle pt-4`,children:(0,U.jsxs)(F,{variant:`primary`,disabled:B||!T&&!W||!!T&&(!z&&!I.trim()||!n||!t?.choices.some(e=>e.id===n)),onClick:()=>{T?we():_e(e=>e+1)},children:[B?(0,U.jsx)(w,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,B?v?`正在应用…`:`Applying…`:!T&&W?v?`重新加载`:`Reload`:W?v?`重试`:`Retry`:z&&!I.trim()?v?`使用此模型`:`Use this model`:v?`连接并使用`:`Connect and use`]})})]})}let Ee=h?`h3`:m,De=h?`p`:u;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 px-5 py-5`,children:[d&&!B&&!q?(0,U.jsx)(F,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":v?`返回`:`Back`,onClick:d,children:(0,U.jsx)(_,{className:`size-4`})}):null,(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(Ee,{className:`text-base font-semibold text-fg`,children:i?`${v?`连接服务 · `:`Connect service · `}${Pe[i][+!v]}`:v?`连接模型服务`:`Connect model service`}),(0,U.jsx)(De,{className:`mt-2 text-sm text-fg-muted`,children:$})]}),(0,U.jsx)(F,{variant:`ghost`,className:`shrink-0 p-1.5`,disabled:B,"aria-label":v?`关闭`:`Close`,onClick:f,children:(0,U.jsx)(O,{className:`size-4`})})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-5`,children:[!T&&!W?(0,U.jsx)(A,{className:`h-64 w-full rounded-xl`}):null,T?(0,U.jsxs)(U.Fragment,{children:[Z,!q&&s.length>1&&l?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`mb-2 block text-xs text-fg-muted`,children:v?`接入方式 / 地域`:`Access method / region`}),(0,U.jsx)(y,{value:e,disabled:B,"aria-label":v?`接入方式 / 地域`:`Access method / region`,onChange:e=>l(e.target.value),children:s.map(e=>(0,U.jsx)(b,{value:e.id,children:e.setupProfile?.name??e.name},e.id))})]}):null,q?(0,U.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg`,children:[(0,U.jsx)(x,{className:`size-4`}),a?v?`服务连接已保存`:`Connection saved`:v?`所选用途配置已保存`:`Selected model uses saved`]}):(0,U.jsxs)(U.Fragment,{children:[Y&&!X?(0,U.jsx)(de,{providerId:e,displayName:$,connected:X,onConnected:Se,onPendingChange:P}):null,z&&!ne?(0,U.jsxs)(`div`,{role:`status`,className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,U.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v?`服务已连接`:`Service connected`}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:v?`可直接选择模型,无需重复填写凭据。`:`Choose a model without entering credentials again.`})]})]}),!r&&be?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>R(!0),children:xe?v?`更换 API Key`:`Change API key`:v?`添加 API Key`:`Add API key`}):null]}):null,be&&!r&&(!z||ne)?(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:T.profile.access===`subscription`?v?`套餐 API Key`:`Plan API key`:`API Key`}),z?(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>{R(!1),L(``)},children:v?`取消更换`:`Cancel change`}):null]}),(0,U.jsx)(S,{id:`provider-setup-key`,disabled:B,value:I,onChange:L,placeholder:z?v?`输入新的 API Key`:`Enter a new API key`:`API Key`,labels:re(c(o).providersSettings)}),Te?(0,U.jsx)(`a`,{className:`inline-flex min-h-8 items-center text-sm text-accent-fg hover:underline`,href:Te,target:`_blank`,rel:`noopener noreferrer`,children:v?`获取对应接入方式的 Key`:`Get a key for this access method`}):null]}):null,!a&&!h?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:v?`模型用途`:`Model uses`}),(0,U.jsx)(ie,{className:`flex gap-2`,indicatorClassName:`rounded-lg bg-surface-active`,children:[`fill`,`replace`].map(e=>(0,U.jsx)(F,{variant:D.mode===e?`secondary`:`ghost`,disabled:B,"aria-pressed":D.mode===e,onClick:()=>Ce(e),children:e===`fill`?v?`补齐未配置`:`Fill missing`:v?`改用此服务`:`Switch to this service`},e))})]}):(0,U.jsx)(`p`,{className:`text-sm text-fg-muted`,children:h?v?`仅更新当前能力,其他模型和参数保持原设置。`:`Only this capability changes; other settings are preserved.`:z?v?`连接已就绪,返回能力设置选择要使用的模型。`:`The connection is ready. Return to capability settings to choose a model.`:v?`保存连接后返回能力设置,再选择要使用的模型。`:`Save the connection, then choose a model in capability settings.`})]}),a?(0,U.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[v?`支持用途:`:`Supported uses: `,T.uses.filter(e=>e.choices.length&&(!i||e.id===i)).map(e=>Pe[e.id][+!v]).join(`、`)]}):null,a?null:(0,U.jsx)(`div`,{className:`divide-y divide-edge rounded-xl border border-edge bg-surface-inset px-4`,children:T.uses.filter(e=>!h||!i||e.id===i).map(e=>{let t=D.overrides?.[e.id]??e.recommended,n=e.choices.find(e=>e.id===t);return(0,U.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,U.jsxs)(`label`,{className:`flex min-h-10 items-start gap-3`,children:[(0,U.jsx)(`input`,{hidden:h,type:`checkbox`,className:`ui-checkbox mt-1`,checked:Q.includes(e.id),disabled:h||B||q||!t||!e.choices.length,onChange:t=>k({...D,selected:t.target.checked?[...Q,e.id]:Q.filter(t=>t!==e.id)})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Pe[e.id][+!v]}),(0,U.jsx)(`span`,{className:`mt-1 block break-all text-xs text-fg-muted`,children:Q.includes(e.id)?`${e.current?`${e.current} → `:``}${n?.name??t??``}`:e.current?`${v?`保留:`:`Keep: `}${e.current}`:e.reason===`interactive_only`?v?`此套餐不用于后台任务`:`This plan is not used for background tasks`:n?.name??(v?`暂无可自动配置的模型`:`No automatic model selection available`)})]})]}),!q&&e.choices.length>1?(0,U.jsxs)(`details`,{open:h||void 0,className:`pl-7`,children:[(0,U.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:v?`选择具体模型`:`Choose a model`}),(0,U.jsx)(y,{value:t??``,disabled:B,"aria-label":Pe[e.id][+!v],onChange:t=>k({...D,selected:[...new Set([...Q,e.id])],overrides:{...D.overrides,[e.id]:t.target.value}}),children:[...e.choices].sort(ae).map(e=>(0,U.jsx)(b,{value:e.id,children:e.name},e.id))})]}):null]},e.id)})}),q?null:(0,U.jsx)(F,{variant:`ghost`,disabled:B,onClick:()=>_e(e=>e+1),children:v?`刷新目录`:`Refresh catalog`}),!a&&!h?(0,U.jsxs)(`details`,{children:[(0,U.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:v?`任务模型与其他用途`:`Task models and other uses`}),(0,U.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[Object.entries(T.taskModels).map(([e,t])=>(0,U.jsxs)(`p`,{children:[e,`: `,t]},e)),(0,U.jsx)(`p`,{children:v?`未选用途与电脑操作保留当前配置;所选用途清除跨服务回退。`:`Unselected uses and Computer Use keep their settings. Selected uses clear cross-service fallbacks.`})]})]}):null,a?null:(0,U.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:T.profile.interactiveOnly?v?`此套餐仅用于交互任务。后台调用会检查使用范围,不会自动切换到其他收费来源。`:`This plan is for interactive tasks. Background calls check usage scope and do not automatically switch billing sources.`:v?`仅更新勾选的全局用途,智能体和会话的独立设置继续生效。`:`Only selected global uses change. Agent and session overrides remain effective.`}),(0,U.jsx)(`p`,{className:`text-xs text-fg-muted`,children:v?`配置保存与模型真实调用验证分别显示;此操作不会发送测试请求。`:`Saving settings does not perform a model test request.`})]}):null,W?(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:W}):null]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,U.jsx)(`span`,{className:`text-xs text-fg-muted`,children:T&&!q&&!a?v?`将配置 ${Q.length} 项`:`${Q.length} uses selected`:``}),q||a&&z&&!I.trim()&&!ne?(0,U.jsx)(F,{disabled:B||N||!T,onClick:()=>{q||p?.(),f()},children:a?v?`返回选择模型`:`Return to model selection`:v?`完成`:`Done`}):!T&&W?(0,U.jsx)(F,{onClick:()=>_e(e=>e+1),children:v?`重试`:`Retry`}):(0,U.jsxs)(F,{onClick:()=>void we(),disabled:B||N||!T||!z&&!I.trim()||h&&!Q.some(e=>D.overrides?.[e]||T.uses.find(t=>t.id===e)?.recommended),children:[B?(0,U.jsx)(w,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}):null,B?v?`正在应用…`:`Applying…`:Q.length?h&&i?`${v?`连接并用于`:`Connect and use for `}${Pe[i][+!v]}`:v?`连接并应用`:`Connect and apply`:v?`仅连接`:`Connect only`]})]})]})}function Ie(e){let t=(0,H.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,U.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,H.c)(38),{open:n,initialProviderId:r,initialUse:i,connectOnly:a,onOpenChange:o,builtinRows:s,customConfig:c,labels:u,language:d,onSaved:m}=e,g=a!==void 0&&a,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={type:`pick`},t[0]=_):_=t[0];let[v,y]=(0,V.useState)(_),[b,x]=(0,V.useState)(``),S;t[1]!==r||t[2]!==v?(S=v.type===`pick`&&r?{type:`builtin`,providerId:r}:v,t[1]=r,t[2]=v,t[3]=S):S=t[3];let C=S,w=(0,V.useRef)(0),T;t[4]!==C.providerId||t[5]!==C.type||t[6]!==s?(T=C.type===`builtin`?s.find(e=>e.id===C.providerId)?.setupProfile?.brand:void 0,t[4]=C.providerId,t[5]=C.type,t[6]=s,t[7]=T):T=t[7];let E=T,D;t[8]===o?D=t[9]:(D=e=>{e||window.setTimeout(()=>{y({type:`pick`}),x(``),w.current=0},200),o(e)},t[8]=o,t[9]=D);let O=D,A;t[10]!==s||t[11]!==g||t[12]!==O||t[13]!==m?(A=(e,t)=>{let n=s.some(t=>t.id===e&&t.configured);g||t?.length===0||t===void 0&&n?(m(e),O(!1)):y({type:`success`,target:{providerId:e,modelIds:t}})},t[10]=s,t[11]=g,t[12]=O,t[13]=m,t[14]=A):A=t[14];let j=A,M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,U.jsx)(l,{className:k(`xopc-dialog-overlay fixed inset-0 bg-scrim`,te)}),t[15]=M):M=t[15];let N;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(N=k(`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`,ee),t[16]=N):N=t[16];let P;t[17]!==C.presetKey||t[18]!==C.providerId||t[19]!==C.target||t[20]!==C.type||t[21]!==s||t[22]!==g||t[23]!==c||t[24]!==O||t[25]!==j||t[26]!==r||t[27]!==i||t[28]!==u||t[29]!==d||t[30]!==m||t[31]!==b||t[32]!==E?(P=(0,U.jsxs)(f,{children:[M,(0,U.jsx)(p,{className:N,children:C.type===`success`?(0,U.jsx)(Ie,{target:C.target,targetUse:i,zh:d===`zh`,onApplied:()=>m(C.target.providerId),onDone:()=>O(!1)}):C.type===`pick`?(0,U.jsx)(ze,{builtinRows:s,searchQuery:b,onSearchChange:x,labels:u,language:d,scrollTopRef:w,onPickBuiltin:e=>{let t=$(e);y(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onPickCustom:()=>y({type:`custom`})}):C.type===`builtin`?(0,U.jsx)(Fe,{providerId:C.providerId,targetUse:i,connectOnly:g,row:s.find(e=>e.id===C.providerId),language:d,alternatives:E?s.filter(e=>e.setupProfile?.brand===E):[],onChooseProvider:e=>{let t=$(e);y(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onBack:r?void 0:()=>y({type:`pick`}),onApplied:()=>{m(C.providerId),g&&O(!1)},onDone:()=>O(!1)},C.providerId):(0,U.jsx)(Ge,{initialPresetKey:C.presetKey,customConfig:c,labels:u,language:d,onBack:()=>y({type:`pick`}),onSaved:j})})]}),t[17]=C.presetKey,t[18]=C.providerId,t[19]=C.target,t[20]=C.type,t[21]=s,t[22]=g,t[23]=c,t[24]=O,t[25]=j,t[26]=r,t[27]=i,t[28]=u,t[29]=d,t[30]=m,t[31]=b,t[32]=E,t[33]=P):P=t[33];let F;return t[34]!==O||t[35]!==n||t[36]!==P?(F=(0,U.jsx)(h,{open:n,onOpenChange:O,children:P}),t[34]=O,t[35]=n,t[36]=P,t[37]=F):F=t[37],F}function Re(e){let t=(0,H.c)(4),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=k(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,I.press),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(O,{className:`size-4`,"aria-hidden":!0}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,U.jsx)(d,{asChild:!0,children:(0,U.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,V.useRef)(null);(0,V.useLayoutEffect)(()=>{let e=l.current;e&&a.current>0&&(e.scrollTop=a.current)},[a]);let d=(0,V.useMemo)(()=>c?e.filter(e=>{let t=K[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,V.useMemo)(()=>{let e=new Set;return d.filter(t=>{let n=t.setupProfile?.brand??t.id;return e.has(n)?!1:(e.add(n),!0)})},[d]),p=f.filter(e=>e.id===`xopc-cloud`),h=p.map(e=>e.id),g=f.filter(e=>e.configured&&!h.includes(e.id)),_=(0,V.useMemo)(()=>ge(f.filter(e=>!h.includes(e.id)&&!e.configured)),[f,h]),y=e=>{let t=K[e.id];return i===`zh`?t?.descriptionZh??t?.description:t?.description};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pb-3 pt-5`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(m,{className:`text-base font-semibold text-fg`,children:r.step1Title}),(0,U.jsx)(u,{className:`mt-1 text-sm text-fg-muted`,children:r.step1Subtitle})]}),(0,U.jsx)(Re,{label:r.close})]}),(0,U.jsx)(`div`,{className:`px-5 pb-3`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(E,{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,U.jsx)(`input`,{type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:r.searchPlaceholder,autoComplete:`off`,className:k(`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`,R)})]})}),(0,U.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,U.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:r.noResults}):c?(0,U.jsx)(Be,{title:r.searchResults,children:f.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p.length>0?(0,U.jsx)(Be,{title:r.quickStart,children:p.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,prominent:!0,onPick:o},e.id))}):null,g.length>0?(0,U.jsx)(Be,{title:r.connectedSection,children:g.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))}):null,he.map(e=>{let t=_.get(e)??[];return t.length===0?null:(0,U.jsx)(Be,{title:r.categories[e]??e,children:t.map(e=>(0,U.jsx)(Ve,{row:e,description:y(e),labels:r,onPick:o},e.id))},e)}),(0,U.jsxs)(`button`,{type:`button`,onClick:s,className:k(`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,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base/60 text-fg-muted`,children:(0,U.jsx)(C,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.addCustom}),(0,U.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r.customDescription})]}),(0,U.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]})})]})}function Be(e){let t=(0,H.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,U.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,U.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,U.jsxs)(`section`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ve(e){let t=(0,H.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=k(`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 d;t[5]===n.name?d=t[6]:(d=(0,U.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:n.name}),t[5]=n.name,t[6]=d);let f;t[7]!==i||t[8]!==s?(f=s?(0,U.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]=f):f=t[9];let p;t[10]!==d||t[11]!==f?(p=(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]===r?m=t[14]:(m=r?(0,U.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:r}):null,t[13]=r,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==i||t[19]!==n.configured?(g=n.configured?(0,U.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,U.jsx)(x,{className:`size-3.5`,"aria-hidden":!0}),i.connected]}):null,t[18]=i,t[19]=n.configured,t[20]=g):g=t[20];let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,U.jsx)(v,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=_):_=t[21];let y;return t[22]!==g||t[23]!==c||t[24]!==u||t[25]!==h?(y=(0,U.jsxs)(`button`,{type:`button`,onClick:c,className:u,children:[h,g,_]}),t[22]=g,t[23]=c,t[24]=u,t[25]=h,t[26]=y):y=t[26],y}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:Q(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,V.useReducer)(We,void 0,()=>Ue(e)),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(!1),p=re(c(r).providersSettings),{preset:h,providerId:g,baseUrl:_,api:x,apiKey:C,modelSlots:D,error:A}=o,j=D.map(e=>e.value),M=async()=>{let e=g.trim(),r=_.trim();if(!e){s({type:`setError`,value:n.providerIdRequired});return}if(!r){s({type:`setError`,value:n.baseUrlRequired});return}let i=j.map(e=>e.trim()).filter(Boolean);u(!0),s({type:`setError`,value:null});try{let n=t?.providers??{},o=h===`custom`?void 0:Z[h]?.config,s={...o??{},baseUrl:r,api:x,apiKey:C.trim()||void 0,models:i.map(e=>o?.models?.find(t=>t.id===e)??{id:e})};await Y({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)}},N=async()=>{let e=g.trim()||Q(h)||`custom`,t=_.trim();if(!t){s({type:`setError`,value:n.baseUrlRequired});return}f(!0),s({type:`setError`,value:null});try{let r=h===`custom`?void 0:Z[h]?.config,i=(await X({providerId:e,baseUrl:t,apiKey:C.trim()||void 0,api:x,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{f(!1)}},P=g.trim()&&_.trim(),ee=(x===`openai-completions`||x===`openai-responses`)&&_.trim();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-3 pt-5`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:i,className:k(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,I.press),"aria-label":n.back,children:(0,U.jsx)(v,{className:`size-4 rotate-180`,"aria-hidden":!0})}),(0,U.jsx)(m,{className:`min-w-0 flex-1 text-base font-semibold text-fg`,children:n.step2CustomTitle}),(0,U.jsx)(Re,{label:n.close})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 pb-4`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,U.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.customDescription}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-preset`,className:`text-sm font-medium text-fg`,children:n.presetLabel}),(0,U.jsxs)(y,{id:`custom-preset`,value:h,onChange:e=>s({type:`applyPreset`,key:e.target.value}),className:De(),children:[(0,U.jsx)(b,{value:`custom`,children:n.presetCustom}),Se.map(e=>(0,U.jsx)(b,{value:e.key,children:e.label},e.key))]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-provider-id`,className:`text-sm font-medium text-fg`,children:n.providerIdLabel}),(0,U.jsx)(`input`,{id:`custom-provider-id`,type:`text`,autoComplete:`off`,value:g,onChange:e=>s({type:`setProviderId`,value:e.target.value}),placeholder:n.providerIdPlaceholder,className:k(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,U.jsx)(`input`,{id:`custom-base-url`,type:`url`,autoComplete:`off`,value:_,onChange:e=>s({type:`setBaseUrl`,value:e.target.value}),placeholder:n.baseUrlPlaceholder,className:k(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-api-type`,className:`text-sm font-medium text-fg`,children:n.apiTypeLabel}),(0,U.jsx)(y,{id:`custom-api-type`,value:x,onChange:e=>s({type:`setApi`,value:e.target.value}),className:De(),children:ve.map(e=>(0,U.jsx)(b,{value:e.value,children:e.label},e.value))})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`custom-api-key`,className:`text-sm font-medium text-fg`,children:n.apiKeyLabel}),(0,U.jsx)(S,{id:`custom-api-key`,value:C,onChange:e=>s({type:`setApiKey`,value:e}),placeholder:n.apiKeyPlaceholder,labels:p})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.modelIdLabel}),(0,U.jsxs)(F,{type:`button`,variant:`secondary`,className:`gap-1.5`,disabled:!ee||d,onClick:()=>void N(),children:[d?(0,U.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,U.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),d?n.discoveringModels:n.discoverModels]})]}),j.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`text`,autoComplete:`off`,value:e,onChange:e=>s({type:`updateModelId`,index:t,value:e.target.value}),placeholder:n.modelIdPlaceholder,className:k(`flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,R)}),j.length>1?(0,U.jsx)(`button`,{type:`button`,onClick:()=>s({type:`removeModelSlot`,index:t}),className:k(`rounded-lg p-1.5 text-fg-subtle hover:bg-surface-hover hover:text-fg`,I.press),children:(0,U.jsx)(O,{className:`size-3.5`,"aria-hidden":!0})}):null]},D[t].clientKey)),(0,U.jsxs)(F,{type:`button`,variant:`ghost`,className:`w-fit gap-1.5 text-fg-muted`,onClick:()=>s({type:`addModelSlot`}),children:[(0,U.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),n.addModel]})]}),A?(0,U.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:A}):null]})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2 bg-surface-hover/15 px-5 py-3`,children:[(0,U.jsx)(F,{type:`button`,variant:`secondary`,onClick:i,children:n.cancel}),(0,U.jsx)(F,{type:`button`,variant:`primary`,disabled:!P||l,onClick:()=>void M(),children:l?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})]})]})}function Ke(){let e=(0,H.c)(29),t=!!o(Qe),{data:n,isLoading:r}=M(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}=j(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}=j(t?P: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}=j(t?ce: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=z(c,ue(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=ye(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 be()}function Xe(){return N()}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,H.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,U.jsx)(A,{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,U.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-busy":`true`,children:[e,(0,U.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,U.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r}),t[7]=r,t[8]=s);let l=e.length>0?(0,U.jsxs)(F,{type:`button`,variant:`primary`,className:`gap-1.5`,onClick:i,children:[(0,U.jsx)(T,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]}):null,u;t[9]!==s||t[10]!==l?(u=(0,U.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,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,e.length===0?(0,U.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/25 px-6 py-10 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.empty}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint}),(0,U.jsxs)(F,{type:`button`,variant:`primary`,className:`mt-4 gap-1.5`,onClick:i,children:[(0,U.jsx)(T,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]})]}):(0,U.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:e.map(e=>(0,U.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,U.jsx)(A,{className:`h-16 rounded-lg`},e)}function nt(e){let t=(0,H.c)(26),{card:n,labels:r,onManage:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=k(`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`,I.pressCard),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(x,{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,U.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,U.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,U.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,U.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,U.jsx)(D,{className:`size-3`,"aria-hidden":!0}),t[16]=f):f=t[16];let p;t[17]===r.manage?p=t[18]:(p=(0,U.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 m;t[19]!==d||t[20]!==p?(m=(0,U.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]=m):m=t[21];let h;return t[22]!==i||t[23]!==m||t[24]!==l?(h=(0,U.jsxs)(`button`,{type:`button`,onClick:i,className:a,children:[l,m]}),t[22]=i,t[23]=m,t[24]=l,t[25]=h):h=t[25],h}export{pe as C,W as S,B as T,Y as _,Fe as a,G as b,Ae as c,Ee as d,ke as f,xe as g,De as h,Ie as i,je as l,Oe as m,Ke as n,Me as o,$ as p,Le as r,Ne as s,$e as t,Te as u,K as v,fe as w,me as x,q as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(()=>{try{return typeof localStorage<`u`&&localStorage.getItem(`xopc.performance`)===`1`}catch{return!1}})(),t=[],n=0;function r(r){if(!e)return()=>{};let i=++n,a=performance.now();return e=>{t.push({id:i,journey:r,phase:e,durationMs:performance.now()-a}),t.length>200&&t.shift()}}var i=new Set;function a(n){!e||i.has(n)||(i.add(n),t.push({id:0,journey:`startup`,phase:n,durationMs:performance.now()}),t.length>200&&t.shift())}function o(){return t.map(e=>({...e}))}e&&typeof window<`u`&&(window.__xopcJourneyMetrics=o);export{e as n,a as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-5DzxIIeq.js";var t=e(()=>({connectionState:`idle`,error:null}));function n(e){t.setState(e)}export{t as n,n as t};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-BjJEOajj.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-5DzxIIeq.js","assets/messages-CGGOcV9B.js","assets/use-file-preview-expanded-BT0pss9g.js","assets/chunk-KS7C4IRE-DIIvxCDx.js","assets/preload-helper-Czpn1I53.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/copy-Dv6d4Dvw.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-BwbjZnQ6.js","assets/diagnostics-Bo0Z42P_.js","assets/dist-DlirbHVs.js","assets/es2015-CFqg57eW.js","assets/dist-CDSvxjOh.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-Ji4uewEG.js","assets/product-delivery-4gEqUIsK.js","assets/schemas-CCWMleym.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/save-DRDABU--.js","assets/preview-runtime-D8kxmrLV.js","assets/rotate-cw-LIg3Am9S.js","assets/search-DA7gz22f.js","assets/skeleton-DzdOeGYz.js","assets/turn-outcome-BSbEJx8h.js","assets/attachment-utils-core-BPYdUI6y.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/workspace-api-Bpq_rBZM.js","assets/files-GdwDamkp.js","assets/index.module-Cd9ENXfk.js","assets/session-api-CUkWJyfm.js","assets/gateway-startup-retry-Cza1BaL8.js","assets/constants-D5Z-mUto.js","assets/interaction-BdhHBbYa.js","assets/composer-notifications-Dd64p5ZI.js","assets/activity-store-9wMoZ4Ok.js","assets/app-chrome-BeB4KgOf.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/dist-DaFr5KMw.js","assets/dist-DSRLZhL9.js","assets/floating-ui.dom-CiMnRY5O.js","assets/floating-ui.react-dom-Gx6CM22l.js","assets/share-link-dialog-kZSUpbBN.js","assets/popover-select-hRG1EzAY.js","assets/dist-BSVQC3i_.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/globe-DSSGFWFn.js","assets/button-C5tRaJxt.js","assets/copy-text-row-gqdh0Bg1.js","assets/right-workspace-store-DOyKalyG.js","assets/phone-workspace-store-CDtfKAUX.js","assets/theme-store-B75oCec7.js","assets/middleware-Pd0e8Igk.js","assets/file-preview-surface-Cwy9Cgaq.js","assets/shares-api-BxQqmxkq.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{_ as a,d as o,f as s,t as c}from"./chunk-KS7C4IRE-DIIvxCDx.js";import{i as l,n as u,o as d}from"./locale-store-5DzxIIeq.js";import{t as f}from"./messages-CGGOcV9B.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-DlirbHVs.js";import{t as b}from"./arrow-right-DSSvoX71.js";import{f as x}from"./automation-display-DaVDNZz8.js";import{t as S}from"./check-DUBLcKHA.js";import{t as C}from"./chevron-down-ccbiQQz_.js";import{t as w}from"./chevron-right-BweFrslA.js";import{t as T}from"./circle-alert-BEjgurr2.js";import{t as E}from"./circle-check-C23XjkUj.js";import{t as D}from"./circle-pause-CN9jYH2s.js";import{t as O}from"./clock-3-DnrAnuyZ.js";import{t as k}from"./external-link-DjqjBmc3.js";import{t as A}from"./file-text-D12HbeVy.js";import{t as j}from"./grip-horizontal-CqVA8V1e.js";import{t as M}from"./history-DXH_9jsE.js";import{t as N}from"./list-todo-CTVRto8O.js";import{t as P}from"./lock-keyhole-DEK5kH0u.js";import{N as F,t as I}from"./markdown-view-BwbjZnQ6.js";import{t as L}from"./message-circle-Badhj-4D.js";import{t as R}from"./message-square-fVE7Ghj1.js";import{t as z}from"./panels-top-left-BKvp2Dag.js";import{t as B}from"./paperclip-f1HujQY1.js";import{t as V}from"./plus-Q2yW6OE7.js";import{t as H}from"./refresh-cw-BRlGaq2w.js";import{t as U}from"./search-DA7gz22f.js";import{t as W}from"./settings-2-D-csvaET.js";import{t as G}from"./sparkles-DHlfQFAF.js";import{t as K}from"./undo-2-6IMTwK4M.js";import{t as ee}from"./x-B_N4OPjy.js";import{t as q}from"./cn-0WouolD0.js";import{t as J}from"./skeleton-DzdOeGYz.js";import{o as te}from"./turn-outcome-BSbEJx8h.js";import{i as Y,l as ne,s as re}from"./capabilities-BcgSEYc5.js";import{i as ie}from"./vendor-swr-CdRzEUwF.js";import{S as ae,b as oe,c as se,g as ce,h as le,m as ue,n as de,s as fe,v as pe,w as me,y as he}from"./workspace-preview-store-QUX-jyAL.js";import{t as X}from"./button-C5tRaJxt.js";import{a as ge,i as _e,o as ve,r as ye,s as be}from"./dist-BSVQC3i_.js";import{a as xe,c as Se,i as Ce,o as we,r as Te,s as Ee,t as De}from"./composer-payload-handoff-Cbkv-F26.js";import{t as Oe}from"./use-realtime-voice-CNG2yeaO.js";import{t as ke}from"./page-header-store-xgXJVGDC.js";import{t as Ae}from"./automation-api-HQmKv0Sm.js";import{r as je}from"./composer-handoff-params-DBpzHuNo.js";import{t as Me}from"./sliding-tab-list-CmcrqRzN.js";import{n as Ne,t as Pe}from"./use-composer-attachments-Dn6X6xAP.js";import{n as Fe,r as Ie}from"./voice-input-shortcut-events-qbqLMfW_.js";import{n as Le}from"./date-formatters-DukWSVwc.js";import{a as Re,i as ze,r as Be,t as Ve}from"./routine-panel-BvBR3khG.js";import{r as He,t as Ue}from"./task-result-evidence-BqAt23uk.js";import{n as We}from"./tab-completion-input-CxtEp0aP.js";var Ge=n(),Z=e(t(),1);function Ke(e,t,n=!1){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!0),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(0),u=(0,Z.useCallback)(async()=>{let t=++l.current;c(null);try{let r=await(n?ue(e,!0):ue(e));t===l.current&&i(r)}catch(e){t===l.current&&c(e instanceof Error?e.message:String(e))}finally{t===l.current&&o(!1)}},[e,n]);return(0,Z.useEffect)(()=>(u(),()=>{l.current++}),[u,t]),(0,Z.useEffect)(()=>{let e,t=1/0,n=n=>{let r=Date.now()+n;r>=t||(window.clearTimeout(e),t=r,e=window.setTimeout(()=>{e=void 0,t=1/0,u()},n))},r=()=>n(100),i=()=>n(750),a=()=>{document.visibilityState===`visible`&&r()},o=[`task-changed-v2`,`task-updated`,`session-created`,`agent-run-started`,`agent-run-ended`,`automation-run-completed`,`home-advisor-updated`,`gateway-realtime-connected`,`realtime-gap`,`focus`],s=[`session-updated`,`session-transcript-updated`];return o.forEach(e=>window.addEventListener(e,r)),s.forEach(e=>window.addEventListener(e,i)),document.addEventListener(`visibilitychange`,a),()=>{o.forEach(e=>window.removeEventListener(e,r)),s.forEach(e=>window.removeEventListener(e,i)),document.removeEventListener(`visibilitychange`,a),window.clearTimeout(e)}},[u]),{home:r,loading:a,loadError:s,setLoadError:c,load:u}}var Q=r(),$=12e3;function qe(e){let t=(0,Ge.c)(107),{variant:n,inputId:r,inputRef:i,intent:a,labels:o,attachments:s,isDragging:c,attachmentBusy:l,attachmentsFull:u,voice:d,chat:f,cancelAction:p,onIntentChange:m,onPickFiles:h,onRemoveAttachment:g,onPaste:_,onDragOver:v,onDragLeave:y,onDrop:b,onSubmit:x}=e,S=n===`inline`,C;t[0]!==s||t[1]!==a?(C=!!a.trim()||s.length>0,t[0]=s,t[1]=a,t[2]=C):C=t[2];let w=C,T=d.voiceActive&&d.phase!==`error`,E;t[3]!==x||t[4]!==d.voiceActive?(E=e=>{if(d.voiceActive){e.preventDefault();return}x(e)},t[3]=x,t[4]=d.voiceActive,t[5]=E):E=t[5];let D=S?`mx-auto mt-6 w-full overflow-hidden rounded-xl border border-edge bg-surface-base p-2 text-left shadow-surface transition-colors focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/15 sm:mt-8`:`flex min-h-0 flex-1 flex-col`,O;t[6]===D?O=t[7]:(O=q(`relative`,D),t[6]=D,t[7]=O);let k;t[8]!==S||t[9]!==c||t[10]!==o.dropFiles?(k=c?(0,Q.jsx)(`div`,{className:q(`pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-accent-soft/90 text-sm font-medium text-accent-fg backdrop-blur-[1px]`,S&&`rounded-2xl`),children:o.dropFiles}):null,t[8]=S,t[9]=c,t[10]=o.dropFiles,t[11]=k):k=t[11];let A=!S&&`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,j;t[12]===A?j=t[13]:(j=q(A),t[12]=A,t[13]=j);let M=S?`sr-only`:`mb-2 shrink-0 text-sm font-medium text-fg`,N;t[14]!==r||t[15]!==o.intentLabel||t[16]!==M?(N=(0,Q.jsx)(`label`,{htmlFor:r,className:M,children:o.intentLabel}),t[14]=r,t[15]=o.intentLabel,t[16]=M,t[17]=N):N=t[17];let P;t[18]!==l||t[19]!==f||t[20]!==d.audioLevel||t[21]!==d.cancelVoiceInput||t[22]!==d.confirmVoiceInput||t[23]!==d.elapsedLabel||t[24]!==d.error||t[25]!==d.finalTranscript||t[26]!==d.partialTranscript||t[27]!==d.phase||t[28]!==d.recordedDictation||t[29]!==d.retryVoiceInput||t[30]!==d.settingsRequired||t[31]!==d.voiceActive?(P=d.voiceActive?(0,Q.jsx)(Te,{phase:d.phase,elapsedLabel:d.elapsedLabel,recordedDictation:d.recordedDictation,audioLevel:d.audioLevel,partialTranscript:d.partialTranscript,finalTranscript:d.finalTranscript,error:d.error,settingsRequired:d.settingsRequired,disabled:l,chat:f,onCancel:d.cancelVoiceInput,onConfirm:d.confirmVoiceInput,onRetry:d.retryVoiceInput}):null,t[18]=l,t[19]=f,t[20]=d.audioLevel,t[21]=d.cancelVoiceInput,t[22]=d.confirmVoiceInput,t[23]=d.elapsedLabel,t[24]=d.error,t[25]=d.finalTranscript,t[26]=d.partialTranscript,t[27]=d.phase,t[28]=d.recordedDictation,t[29]=d.retryVoiceInput,t[30]=d.settingsRequired,t[31]=d.voiceActive,t[32]=P):P=t[32];let F=T&&`hidden`,I=S?`min-h-24 bg-transparent px-3 py-2`:`min-h-32 flex-1 rounded-xl border border-edge bg-surface-base p-3 focus:border-accent focus:ring-2 focus:ring-accent/20`,L;t[33]!==F||t[34]!==I?(L=q(`w-full resize-none text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle`,F,I),t[33]=F,t[34]=I,t[35]=L):L=t[35];let R;t[36]===m?R=t[37]:(R=e=>m(e.target.value),t[36]=m,t[37]=R);let z=!S,V;t[38]!==r||t[39]!==i||t[40]!==a||t[41]!==o.intentPlaceholder||t[42]!==o.intentSuggestion||t[43]!==m||t[44]!==_||t[45]!==L||t[46]!==R||t[47]!==z?(V=(0,Q.jsx)(We,{ref:i,id:r,className:L,value:a,onChange:R,onPaste:_,suggestion:o.intentSuggestion,onAcceptSuggestion:m,onKeyDown:Je,placeholder:o.intentPlaceholder,maxLength:$,autoFocus:z}),t[38]=r,t[39]=i,t[40]=a,t[41]=o.intentPlaceholder,t[42]=o.intentSuggestion,t[43]=m,t[44]=_,t[45]=L,t[46]=R,t[47]=z,t[48]=V):V=t[48];let H=S?`border-b-0 bg-transparent px-3 pb-2 pt-0`:`mt-3 border-b-0 bg-transparent px-0 pb-0`,U;t[49]!==s||t[50]!==g||t[51]!==H?(U=(0,Q.jsx)(Ne,{attachments:s,topPadded:!1,onRemove:g,className:H}),t[49]=s,t[50]=g,t[51]=H,t[52]=U):U=t[52];let W;t[53]!==S||t[54]!==a.length||t[55]!==o.shortcut?(W=S?null:(0,Q.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:o.shortcut}),(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[a.length.toLocaleString(),` / `,$.toLocaleString()]})]}),t[53]=S,t[54]=a.length,t[55]=o.shortcut,t[56]=W):W=t[56];let K;t[57]!==P||t[58]!==V||t[59]!==U||t[60]!==W||t[61]!==j||t[62]!==N?(K=(0,Q.jsxs)(`div`,{className:j,children:[N,P,V,U,W]}),t[57]=P,t[58]=V,t[59]=U,t[60]=W,t[61]=j,t[62]=N,t[63]=K):K=t[63];let ee=S?`border-edge-subtle px-1 pt-2`:`border-edge px-5 py-4`,J;t[64]===ee?J=t[65]:(J=q(`flex shrink-0 items-center gap-2 border-t`,ee),t[64]=ee,t[65]=J);let te=!S&&`mr-auto`,Y;t[66]===te?Y=t[67]:(Y=q(`flex items-center gap-1`,te),t[66]=te,t[67]=Y);let ne=l||u,re;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t[68]=re):re=t[68];let ie;t[69]!==o.attachTitle||t[70]!==h||t[71]!==ne?(ie=(0,Q.jsx)(X,{type:`button`,variant:`ghost`,className:`size-9 rounded-lg p-0`,disabled:ne,title:o.attachTitle,"aria-label":o.attachTitle,onClick:h,children:re}),t[69]=o.attachTitle,t[70]=h,t[71]=ne,t[72]=ie):ie=t[72];let ae;t[73]!==l||t[74]!==f||t[75]!==d.startVoiceInput||t[76]!==d.voiceActive?(ae=d.voiceActive?null:(0,Q.jsx)(we,{disabled:l,chat:f,onStart:d.startVoiceInput}),t[73]=l,t[74]=f,t[75]=d.startVoiceInput,t[76]=d.voiceActive,t[77]=ae):ae=t[77];let oe;t[78]!==Y||t[79]!==ie||t[80]!==ae?(oe=(0,Q.jsxs)(`div`,{className:Y,children:[ie,ae]}),t[78]=Y,t[79]=ie,t[80]=ae,t[81]=oe):oe=t[81];let se;t[82]!==p||t[83]!==S||t[84]!==o.shortcut?(se=S?(0,Q.jsx)(`span`,{className:`hidden text-[11px] text-fg-subtle sm:inline`,children:o.shortcut}):p,t[82]=p,t[83]=S,t[84]=o.shortcut,t[85]=se):se=t[85];let ce=S?`ml-auto h-9 rounded-lg px-3.5 text-xs`:`min-w-32`,le=!w||l||d.voiceActive,ue=S?`size-3.5`:`size-4`,de;t[86]===ue?de=t[87]:(de=(0,Q.jsx)(G,{className:ue,"aria-hidden":!0}),t[86]=ue,t[87]=de);let fe;t[88]!==o.submit||t[89]!==ce||t[90]!==le||t[91]!==de?(fe=(0,Q.jsxs)(X,{type:`submit`,variant:`primary`,className:ce,disabled:le,children:[de,o.submit]}),t[88]=o.submit,t[89]=ce,t[90]=le,t[91]=de,t[92]=fe):fe=t[92];let pe;t[93]!==J||t[94]!==oe||t[95]!==se||t[96]!==fe?(pe=(0,Q.jsxs)(`div`,{className:J,children:[oe,se,fe]}),t[93]=J,t[94]=oe,t[95]=se,t[96]=fe,t[97]=pe):pe=t[97];let me;return t[98]!==y||t[99]!==v||t[100]!==b||t[101]!==E||t[102]!==K||t[103]!==pe||t[104]!==O||t[105]!==k?(me=(0,Q.jsxs)(`form`,{onSubmit:E,onDragOver:v,onDragLeave:y,onDrop:b,className:O,children:[k,K,pe]}),t[98]=y,t[99]=v,t[100]=b,t[101]=E,t[102]=K,t[103]=pe,t[104]=O,t[105]=k,t[106]=me):me=t[106],me}function Je(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}function Ye(e){let t=(0,Ge.c)(12),{href:n,children:r,onOpen:i}=e,a=o();if(n&&/^https?:\/\//i.test(n)){let e;return t[0]!==r||t[1]!==n?(e=(0,Q.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r}),t[0]=r,t[1]=n,t[2]=e):e=t[2],e}if(n?.startsWith(`/`)&&!n.startsWith(`//`)){let e=`${a.pathname}${a.search}`,o;t[3]!==n||t[4]!==e?(o=F(e,n),t[3]=n,t[4]=e,t[5]=o):o=t[5];let s;return t[6]!==r||t[7]!==i||t[8]!==o?(s=(0,Q.jsx)(c,{to:o,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:i,children:r}),t[6]=r,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}let s;return t[10]===r?s=t[11]:(s=(0,Q.jsx)(`span`,{children:r}),t[10]=r,t[11]=s),s}function Xe(e){let t=(0,Ge.c)(6),{opportunity:n,onOpen:r}=e,i=u(Ze),a,o;if(t[0]!==i||t[1]!==r||t[2]!==n.evidence||t[3]!==n.evidencePresentation){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=f(i).projectsPage.home.advisorEvidenceCopy,t=n.evidencePresentation,s=t?.locale===i?t.groups:void 0,c=new Intl.DateTimeFormat(i===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),l=t=>(0,Q.jsx)(`ul`,{className:`mt-2 space-y-3 border-l border-edge pl-3 text-xs leading-5 text-fg-muted`,children:t.map(t=>{let n=!!(t.href&&(/^https?:\/\//i.test(t.href)||t.href.startsWith(`/`)&&!t.href.startsWith(`//`)));return(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsxs)(`p`,{className:`text-fg-subtle`,children:[e.sources[t.sourceType],` · `,(0,Q.jsx)(`time`,{dateTime:new Date(t.observedAt).toISOString(),children:c.format(t.observedAt)})]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap`,children:t.observation}),(0,Q.jsx)(`p`,{className:`mt-1`,children:n?(0,Q.jsx)(Ye,{href:t.href,onOpen:r,children:e.openSource}):e.noSource})]},t.id)})}),u=(t,r)=>(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:t.summary}),(0,Q.jsxs)(`details`,{className:`mt-1`,children:[(0,Q.jsxs)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.originals,` · `,e.sourceCount.replace(`{{count}}`,String(t.evidenceIds.length))]}),l(n.evidence.filter(e=>t.evidenceIds.includes(e.id)))]})]},r);if(!s){o=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:e.unavailable}),(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.originals}),l(n.evidence)]})]});break bb0}a=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5`,children:[(0,Q.jsx)(`p`,{className:`mb-3 text-fg-subtle`,children:e.aiNote}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(0,3).map(u)}),s.length>3?(0,Q.jsxs)(`details`,{className:`mt-2`,children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.more.replace(`{{count}}`,String(s.length-3))}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(3).map(u)})]}):null]})}t[0]=i,t[1]=r,t[2]=n.evidence,t[3]=n.evidencePresentation,t[4]=a,t[5]=o}else a=t[4],o=t[5];return o===Symbol.for(`react.early_return_sentinel`)?a:o}function Ze(e){return e.language}function Qe(e){let t=(0,Ge.c)(4),{label:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==r?(a=(0,Q.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-fg-muted transition-colors duration-150 hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:r,children:[i,n]}),t[1]=n,t[2]=r,t[3]=a):a=t[3],a}function $e(e){let t=(0,Ge.c)(63),{opportunity:n,copy:r,onOpenHistory:i}=e,a,o,s,c,l,u;if(t[0]!==r.aiLabel||t[1]!==r.automationAction||t[2]!==r.automationHint||t[3]!==r.history||t[4]!==r.minutes||t[5]!==r.needsSetup||t[6]!==r.why||t[7]!==i||t[8]!==n.capabilities||t[9]!==n.continuation||t[10]!==n.estimatedMinutes||t[11]!==n.outcome||t[12]!==n.rationale||t[13]!==n.title){let e=n.capabilities.filter(et),d;t[20]===r.aiLabel?d=t[21]:(d=(0,Q.jsx)(`span`,{children:r.aiLabel}),t[20]=r.aiLabel,t[21]=d);let f;t[22]!==r.minutes||t[23]!==n.estimatedMinutes?(f=n.estimatedMinutes?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Q.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),n.estimatedMinutes,` `,r.minutes]}):null,t[22]=r.minutes,t[23]=n.estimatedMinutes,t[24]=f):f=t[24];let p;t[25]!==d||t[26]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[d,f]}),t[25]=d,t[26]=f,t[27]=p):p=t[27];let m;t[28]!==r.history||t[29]!==i?(m=(0,Q.jsx)(Qe,{label:r.history,onClick:i}),t[28]=r.history,t[29]=i,t[30]=m):m=t[30],t[31]!==m||t[32]!==p?(a=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[p,m]}),t[31]=m,t[32]=p,t[33]=a):a=t[33],t[34]===n.title?o=t[35]:(o=(0,Q.jsx)(`h3`,{className:`mt-3 text-xl font-semibold leading-7 tracking-tight text-fg`,children:n.title}),t[34]=n.title,t[35]=o),t[36]===n.outcome?s=t[37]:(s=(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n.outcome}),t[36]=n.outcome,t[37]=s);let h;t[38]===r.why?h=t[39]:(h=(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.why,`:`]}),t[38]=r.why,t[39]=h),t[40]!==n.rationale||t[41]!==h?(c=(0,Q.jsxs)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:[h,n.rationale]}),t[40]=n.rationale,t[41]=h,t[42]=c):c=t[42],t[43]!==r.automationAction||t[44]!==r.automationHint||t[45]!==n.continuation?(l=n.continuation?.kind===`automation`?(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 rounded-xl border border-edge bg-surface-subtle p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:r.automationHint}),(0,Q.jsx)(`a`,{href:`#${n.continuation.href}`,className:`inline-flex min-h-11 shrink-0 items-center rounded-lg px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.automationAction})]}):null,t[43]=r.automationAction,t[44]=r.automationHint,t[45]=n.continuation,t[46]=l):l=t[46],u=e.length>0?(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,"aria-label":r.needsSetup,children:e.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.recoveryPath??`/settings`}`,className:`rounded-full border border-accent/25 bg-accent-soft px-2.5 py-1 text-xs text-accent hover:border-accent/50`,children:[r.needsSetup,` · `,e.capability]},`${e.kind}:${e.capability}`))}):null,t[0]=r.aiLabel,t[1]=r.automationAction,t[2]=r.automationHint,t[3]=r.history,t[4]=r.minutes,t[5]=r.needsSetup,t[6]=r.why,t[7]=i,t[8]=n.capabilities,t[9]=n.continuation,t[10]=n.estimatedMinutes,t[11]=n.outcome,t[12]=n.rationale,t[13]=n.title,t[14]=a,t[15]=o,t[16]=s,t[17]=c,t[18]=l,t[19]=u}else a=t[14],o=t[15],s=t[16],c=t[17],l=t[18],u=t[19];let d;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(C,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0}),t[47]=d):d=t[47];let f;t[48]===r.evidence?f=t[49]:(f=(0,Q.jsxs)(`summary`,{className:`flex min-h-9 cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.evidence,d]}),t[48]=r.evidence,t[49]=f);let p;t[50]===n?p=t[51]:(p=(0,Q.jsx)(Xe,{opportunity:n}),t[50]=n,t[51]=p);let m;t[52]!==f||t[53]!==p?(m=(0,Q.jsxs)(`details`,{className:`mt-4 group`,children:[f,p]}),t[52]=f,t[53]=p,t[54]=m):m=t[54];let h;return t[55]!==a||t[56]!==m||t[57]!==o||t[58]!==s||t[59]!==c||t[60]!==l||t[61]!==u?(h=(0,Q.jsxs)(Q.Fragment,{children:[a,o,s,c,l,u,m]}),t[55]=a,t[56]=m,t[57]=o,t[58]=s,t[59]=c,t[60]=l,t[61]=u,t[62]=h):h=t[62],h}function et(e){return e.readiness!==`ready`}function tt(e){let t=(0,Ge.c)(142),{advisor:n,copy:r,busy:i,onRefresh:a,onAction:o,onFeedback:s,onClarification:c,onOpenHistory:l,preflight:u,receipt:d}=e,[f,p]=(0,Z.useState)(),m;t[0]!==n.alternatives||t[1]!==n.primary||t[2]!==n.state?(m=n.state===`ready`?[n.primary,...n.alternatives]:[],t[0]=n.alternatives,t[1]=n.primary,t[2]=n.state,t[3]=m):m=t[3];let h=m,g;t[4]!==h||t[5]!==f?(g=h.find(e=>e.id===f)??h[0],t[4]=h,t[5]=f,t[6]=g):g=t[6];let _=g,v;t[7]===h[0]?.id?v=t[8]:(v=()=>p(h[0]?.id),t[7]=h[0]?.id,t[8]=v);let y=h[0]?.id,b;if(t[9]!==n.state||t[10]!==y?(b=[n.state,y],t[9]=n.state,t[10]=y,t[11]=b):b=t[11],(0,Z.useEffect)(v,b),n.state===`disabled`)return null;if(d){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(E,{className:`size-5 shrink-0 text-success`,"aria-hidden":!0}),t[12]=e):e=t[12];let n;t[13]===d.title?n=t[14]:(n=(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:d.title}),t[13]=d.title,t[14]=n);let i;t[15]===d.detail?i=t[16]:(i=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.detail}),t[15]=d.detail,t[16]=i);let a;t[17]!==n||t[18]!==i?(a=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n,i]}),t[17]=n,t[18]=i,t[19]=a):a=t[19];let o;t[20]!==r.history||t[21]!==l?(o=(0,Q.jsx)(Qe,{label:r.history,onClick:l}),t[20]=r.history,t[21]=l,t[22]=o):o=t[22];let s=`#${d.href}`,c;t[23]!==r.viewProgress||t[24]!==s?(c=(0,Q.jsx)(X,{asChild:!0,variant:`secondary`,className:`min-h-10 text-xs`,children:(0,Q.jsx)(`a`,{href:s,children:r.viewProgress})}),t[23]=r.viewProgress,t[24]=s,t[25]=c):c=t[25];let u;t[26]!==o||t[27]!==c?(u=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o,c]}),t[26]=o,t[27]=c,t[28]=u):u=t[28];let f;return t[29]!==u||t[30]!==a?(f=(0,Q.jsx)(`section`,{className:`mt-7 rounded-2xl border border-success/25 bg-success-soft px-5 py-4`,role:`status`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center`,children:[e,a,u]})}),t[29]=u,t[30]=a,t[31]=f):f=t[31],f}if(n.state===`quiet`||n.state===`refreshing`)return null;if(n.state===`clarification`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(G,{className:`size-4`,"aria-hidden":!0}),t[32]=e):e=t[32];let a;t[33]===r.aiLabel?a=t[34]:(a=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-accent`,children:[e,r.aiLabel]}),t[33]=r.aiLabel,t[34]=a);let o;t[35]!==r.history||t[36]!==l?(o=(0,Q.jsx)(Qe,{label:r.history,onClick:l}),t[35]=r.history,t[36]=l,t[37]=o):o=t[37];let s;t[38]!==a||t[39]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,o]}),t[38]=a,t[39]=o,t[40]=s):s=t[40];let u;t[41]===n.question.question?u=t[42]:(u=(0,Q.jsx)(`h3`,{id:`home-advisor-question`,className:`mt-3 text-lg font-semibold text-fg`,children:n.question.question}),t[41]=n.question.question,t[42]=u);let d;if(t[43]!==n.question.options||t[44]!==n.question.question||t[45]!==i||t[46]!==c){let e;t[48]!==n.question.question||t[49]!==i||t[50]!==c?(e=e=>(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>c(n.question.question,e.label),children:e.label},e.id),t[48]=n.question.question,t[49]=i,t[50]=c,t[51]=e):e=t[51],d=n.question.options.map(e),t[43]=n.question.options,t[44]=n.question.question,t[45]=i,t[46]=c,t[47]=d}else d=t[47];let f;t[52]===d?f=t[53]:(f=(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:d}),t[52]=d,t[53]=f);let p;return t[54]!==u||t[55]!==f||t[56]!==s?(p=(0,Q.jsxs)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base px-5 py-5`,"aria-labelledby":`home-advisor-question`,children:[s,u,f]}),t[54]=u,t[55]=f,t[56]=s,t[57]=p):p=t[57],p}if(!_)return null;let x=u?.opportunityId===_.id?u.value:void 0,S;t[58]!==n.stale||t[59]!==r.refreshing?(S=n.stale?(0,Q.jsxs)(`p`,{className:`mb-3 inline-flex items-center gap-2 text-xs text-accent`,children:[(0,Q.jsx)(H,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.refreshing]}):null,t[58]=n.stale,t[59]=r.refreshing,t[60]=S):S=t[60];let w;t[61]!==r||t[62]!==l||t[63]!==_?(w=(0,Q.jsx)($e,{opportunity:_,copy:r,onOpenHistory:l}),t[61]=r,t[62]=l,t[63]=_,t[64]=w):w=t[64];let T;t[65]!==i||t[66]!==r.configure||t[67]!==r.degradedStart||t[68]!==r.setupHint||t[69]!==r.setupTitle||t[70]!==o||t[71]!==_||t[72]!==x?(T=x?.state===`needs_setup`?(0,Q.jsx)(`div`,{className:`mt-5 rounded-xl border border-accent/25 bg-accent-soft/40 p-4`,role:`alert`,"aria-live":`polite`,children:(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsx)(W,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:r.setupTitle}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.setupHint}),(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1 text-xs leading-5 text-fg-muted`,children:x.blockers.map(nt)}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[x.recoveryActions.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.href}`,className:`inline-flex min-h-11 items-center rounded-lg border border-accent/30 px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.configure,` · `,e.capability]},e.capability)),x.degradedAction?(0,Q.jsx)(X,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`degraded_start`),children:r.degradedStart}):null]})]})]})}):null,t[65]=i,t[66]=r.configure,t[67]=r.degradedStart,t[68]=r.setupHint,t[69]=r.setupTitle,t[70]=o,t[71]=_,t[72]=x,t[73]=T):T=t[73];let D;t[74]!==i||t[75]!==r.start||t[76]!==o||t[77]!==_?(D=_.actions.canStart?(0,Q.jsxs)(X,{type:`button`,variant:`primary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`start`),children:[(0,Q.jsx)(G,{className:`size-4`,"aria-hidden":!0}),r.start]}):null,t[74]=i,t[75]=r.start,t[76]=o,t[77]=_,t[78]=D):D=t[78];let O;t[79]!==i||t[80]!==r.discuss||t[81]!==o||t[82]!==_?(O=_.actions.canDiscuss?(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`discuss`),children:[(0,Q.jsx)(L,{className:`size-4`,"aria-hidden":!0}),r.discuss]}):null,t[79]=i,t[80]=r.discuss,t[81]=o,t[82]=_,t[83]=O):O=t[83];let k;t[84]!==O||t[85]!==D?(k=(0,Q.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2`,children:[D,O]}),t[84]=O,t[85]=D,t[86]=k):k=t[86];let A;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),t[87]=A):A=t[87];let j;t[88]===r.more?j=t[89]:(j=(0,Q.jsxs)(`summary`,{className:`inline-flex min-h-9 cursor-pointer list-none items-center gap-1.5 rounded-lg px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[r.more,A]}),t[88]=r.more,t[89]=j);let M;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(H,{className:`size-4`,"aria-hidden":!0}),t[90]=M):M=t[90];let N;t[91]!==i||t[92]!==r.refresh||t[93]!==a?(N=(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:`min-h-11`,disabled:i,onClick:a,title:r.refresh,children:[M,r.refresh]}),t[91]=i,t[92]=r.refresh,t[93]=a,t[94]=N):N=t[94];let P;t[95]===r.feedback?P=t[96]:(P=(0,Q.jsx)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center rounded-lg px-3 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.feedback}),t[95]=r.feedback,t[96]=P);let F;t[97]===r.alreadyDone?F=t[98]:(F=[`already_done`,r.alreadyDone],t[97]=r.alreadyDone,t[98]=F);let I;t[99]===r.irrelevant?I=t[100]:(I=[`irrelevant`,r.irrelevant],t[99]=r.irrelevant,t[100]=I);let R;t[101]===r.later?R=t[102]:(R=[`too_early`,r.later],t[101]=r.later,t[102]=R);let z;t[103]===r.sourceIncorrect?z=t[104]:(z=[`source_incorrect`,r.sourceIncorrect],t[103]=r.sourceIncorrect,t[104]=z);let B;t[105]===r.lessLikeThis?B=t[106]:(B=[`less_like_this`,r.lessLikeThis],t[105]=r.lessLikeThis,t[106]=B);let V;t[107]!==F||t[108]!==I||t[109]!==R||t[110]!==z||t[111]!==B?(V=[F,I,R,z,B],t[107]=F,t[108]=I,t[109]=R,t[110]=z,t[111]=B,t[112]=V):V=t[112];let U=V,K;t[113]!==i||t[114]!==s||t[115]!==_||t[116]!==U?(K=(0,Q.jsx)(`div`,{className:`absolute right-0 z-20 mt-1 w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-float`,children:U.map(e=>{let[t,n]=e;return(0,Q.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 w-full rounded-lg px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(_,t),children:n},t)})}),t[113]=i,t[114]=s,t[115]=_,t[116]=U,t[117]=K):K=t[117];let ee;t[118]!==P||t[119]!==K?(ee=(0,Q.jsxs)(`details`,{className:`relative`,children:[P,K]}),t[118]=P,t[119]=K,t[120]=ee):ee=t[120];let q;t[121]!==N||t[122]!==ee?(q=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[N,ee]}),t[121]=N,t[122]=ee,t[123]=q):q=t[123];let J;t[124]!==i||t[125]!==r.alternatives||t[126]!==h||t[127]!==_.id?(J=h.length>1?(0,Q.jsxs)(`div`,{className:`border-t border-edge-subtle pt-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:r.alternatives}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:h.filter(e=>e.id!==_.id).map(e=>(0,Q.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 rounded-lg border border-edge px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>p(e.id),children:e.title},e.id))})]}):null,t[124]=i,t[125]=r.alternatives,t[126]=h,t[127]=_.id,t[128]=J):J=t[128];let te;t[129]!==j||t[130]!==q||t[131]!==J?(te=(0,Q.jsxs)(`details`,{className:`mt-1`,children:[j,q,J]}),t[129]=j,t[130]=q,t[131]=J,t[132]=te):te=t[132];let Y;t[133]!==k||t[134]!==te||t[135]!==S||t[136]!==w||t[137]!==T?(Y=(0,Q.jsxs)(`div`,{className:`px-5 py-5 sm:px-6`,children:[S,w,T,k,te]}),t[133]=k,t[134]=te,t[135]=S,t[136]=w,t[137]=T,t[138]=Y):Y=t[138];let ne;return t[139]!==r.aiLabel||t[140]!==Y?(ne=(0,Q.jsx)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base`,"aria-label":r.aiLabel,children:Y}),t[139]=r.aiLabel,t[140]=Y,t[141]=ne):ne=t[141],ne}function nt(e){return(0,Q.jsx)(`li`,{children:e.message},`${e.kind}:${e.capability}`)}function rt(e){let t=(0,Ge.c)(11),{observation:n,language:r,onUpdated:i}=e,a=r===`zh`,o=n.followUps??[],[s,c]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,Z.useState)(_),[b,x]=(0,Z.useState)(!0),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(``),E;t[1]!==n.topics||t[2]!==a?(E=e=>{f(e?.goal??``),g(e?.firstStep??(a?`先整理已有线索、已知事实和资料缺口,再提出下一步建议。`:`Organize existing evidence, known facts and missing material, then propose the next step.`)),m(``),y(e?[e.topicId]:n.topics.slice(0,3).map(dt)),c(!0),T(``)},t[1]=n.topics,t[2]=a,t[3]=E):E=t[3];let D=E,O;t[4]!==r||t[5]!==i?(O=e=>(0,Q.jsx)(ft,{followUp:e,language:r,onUpdated:i},e.id),t[4]=r,t[5]=i,t[6]=O):O=t[6];let k=o.filter(ut).map(O),A=n.status===`active`?(0,Q.jsxs)(Q.Fragment,{children:[o.some(lt)?null:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:a?`把一件事推进到完成`:`Keep one goal moving until it is done`}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:a?`记住目标和进展,一步步整理证据、查清问题。有新资料继续推进,遇到阻塞会告诉你缺什么。`:`Keep the goal and its progress together. Work through the evidence, continue when input arrives, and make blockers clear.`})]}),s?null:(n.followUpCandidates??[]).map(e=>(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-surface-inset p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`这条请求可能需要继续跟进,请先确认目标`:`This request may need follow-through. Confirm the goal first.`}),(0,Q.jsx)(`p`,{className:`line-clamp-2 text-sm text-fg`,children:e.goal}),(0,Q.jsx)(X,{variant:`tonal`,onClick:()=>D(e),children:a?`设为持续目标`:`Set up a continuing goal`})]},e.topicId)),s?(0,Q.jsxs)(`form`,{className:`space-y-3 rounded-lg bg-surface-inset p-3`,onSubmit:e=>{e.preventDefault(),!S&&(C(!0),T(``),d(l(`/api/home/follow-ups`),{method:`POST`,body:JSON.stringify({goal:u,criteria:p.split(`
|
|
3
|
-
`).map(ot).filter(Boolean),firstStep:h,topicIds:v,autoContinue:b,stepBudget:3,locale:r,expectedObservationRevision:n.revision,idempotencyKey:crypto.randomUUID()})}).then(e=>{te.parse(e),c(!1),i()}).catch(e=>{T(e instanceof Error?e.message:String(e)),i()}).finally(()=>C(!1)))},children:[(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`希望最终达成什么?`:`What outcome should we reach?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:u,onChange:e=>f(e.target.value),placeholder:a?`例如:查清 connector 重复请求的原因,并整理可验证的解决方案。`:`For example: understand duplicate connector requests and prepare a verifiable resolution.`,className:`mt-1 min-h-20 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`达到什么标准才算完成?每行一条,最多 10 项`:`What counts as done? One criterion per line`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e4,value:p,onChange:e=>m(e.target.value),placeholder:a?`明确复现条件
|
|
4
|
-
原因有日志或代码证据支持
|
|
5
|
-
给出修复后需要通过的验证项`:`Reproduction conditions are clear
|
|
6
|
-
Evidence supports the cause
|
|
7
|
-
Verification checks are defined`,className:`mt-1 min-h-24 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`label`,{className:`block text-sm text-fg`,children:[a?`现在先推进哪一步?`:`What is the first step?`,(0,Q.jsx)(`input`,{required:!0,maxLength:1e3,value:h,onChange:e=>g(e.target.value),placeholder:a?`整理现有线索、已知事实和缺少的日志。`:`Organize existing reports, known facts and missing logs.`,className:`mt-1 w-full rounded-lg border border-edge bg-surface-panel p-2`})]}),(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`参考资料范围:已选 ${v.length} 段对话`:`Source scope: ${v.length} selected conversations`}),(0,Q.jsx)(`div`,{className:`mt-2 max-h-40 space-y-2 overflow-y-auto`,children:n.topics.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:v.includes(e.id),disabled:!v.includes(e.id)&&v.length>=8,onChange:t=>y(t.target.checked?[...v,e.id]:v.filter(t=>t!==e.id))}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.title})]},e.id))})]}),n.topics.length?null:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`先在对话里提供这件事的背景资料,开启观察后再选为参考来源。`:`First provide the background in a chat, then select it as a source.`}),(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:b,onChange:e=>x(e.target.checked),className:`mt-1`}),a?`资料齐备时自动继续本轮分析,最多 3 步;缺资料或检查未通过就停下。只整理资料和分析,不修改外部服务。`:`Continue private analysis automatically, up to 3 steps this round. Stop for missing input or failed checks. No changes to external services.`]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`一份阶段结果不等于整个目标完成。最终由你对照完成标准验收,随时可以暂停或结束。`:`A step result does not complete the goal. You review the final criteria, and can pause or end at any time.`}),w?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:w}):null,(0,Q.jsx)(X,{variant:`primary`,type:`submit`,disabled:S||!v.length,children:a?`确认目标,开始第一步`:`Confirm goal and start`}),(0,Q.jsx)(X,{variant:`ghost`,disabled:S,onClick:()=>c(!1),children:a?`取消`:`Cancel`})]}):(0,Q.jsx)(X,{variant:o.some(ct)?`ghost`:`primary`,onClick:()=>D(),children:o.some(st)?a?`再交给我一件事`:`Add another goal`:a?`交给我持续推进一件事`:`Keep a goal moving`})]}):null,j=o.some(at)?(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`text-xs text-fg-muted`,children:a?`已结束的目标`:`Past goals`}),o.filter(it).map(e=>(0,Q.jsx)(ft,{followUp:e,language:r,onUpdated:i},e.id))]}):null,M;return t[7]!==k||t[8]!==A||t[9]!==j?(M=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[k,A,j]}),t[7]=k,t[8]=A,t[9]=j,t[10]=M):M=t[10],M}function it(e){return[`done`,`ended`].includes(e.status)}function at(e){return[`done`,`ended`].includes(e.status)}function ot(e){return e.trim()}function st(e){return![`done`,`ended`].includes(e.status)}function ct(e){return![`done`,`ended`].includes(e.status)}function lt(e){return![`done`,`ended`].includes(e.status)}function ut(e){return![`done`,`ended`].includes(e.status)}function dt(e){return e.id}function ft(e){let t=(0,Ge.c)(100),{followUp:n,language:r,onUpdated:i}=e,a=r===`zh`,[o,s]=(0,Z.useState)(),[c,u]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),E;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[0]=E):E=t[0];let[D,O]=(0,Z.useState)(E),[k,A]=(0,Z.useState)(``),j=o&&o.revision>n.revision?o:n,M;t[1]===j.steps?M=t[2]:(M=j.steps.at(-1),t[1]=j.steps,t[2]=M);let N=M,P;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(P=[`done`,`ended`],t[3]=P):P=t[3];let F=P.includes(j.status),I=N?.status===`queued`?a?`下一步已安排`:`Next step queued`:N&&[`succeeded`,`failed`,`cancelled`].includes(N.status)?a?`正在整理本步结果`:`Processing the step result`:a?`正在推进`:`In progress`,L=a?`等资料 / 待处理`:`Waiting for input`,R=a?`等你确认下一步`:`Review next step`,z=a?`已暂停`:`Paused`,B=a?`已由你验收完成`:`Accepted by you`,V=a?`已结束`:`Ended`,H;t[4]!==I||t[5]!==L||t[6]!==R||t[7]!==z||t[8]!==B||t[9]!==V?(H={working:I,waiting:L,review:R,paused:z,done:B,ended:V},t[4]=I,t[5]=L,t[6]=R,t[7]=z,t[8]=B,t[9]=V,t[10]=H):H=t[10];let U=H[j.status],W;t[11]!==c||t[12]!==j.id||t[13]!==j.revision||t[14]!==i||t[15]!==a?(W=e=>{c||(u(!0),p(``),d(l(`/api/home/follow-ups/${encodeURIComponent(j.id)}/command`),{method:`POST`,body:JSON.stringify({expectedRevision:j.revision,idempotencyKey:crypto.randomUUID(),command:e})}).then(t=>{s(te.parse(t)),e.kind===`add_input`&&h(``),y(!1),C(!1),T(!1),i()}).catch(e=>{let t=e instanceof Error?e.message:String(e);p(/changed/i.test(t)?a?`这条目标有新进展,已刷新。请确认后再操作。`:`Progress changed. Review the refreshed goal and try again.`:t),i()}).finally(()=>u(!1)))},t[11]=c,t[12]=j.id,t[13]=j.revision,t[14]=i,t[15]=a,t[16]=W):W=t[16];let G=W,K=a?`持续推进的目标`:`Continuing goal`,ee=a?`持续推进`:`Continuing goal`,q;t[17]===ee?q=t[18]:(q=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-accent-fg`,children:ee}),t[17]=ee,t[18]=q);let J;t[19]===U?J=t[20]:(J=(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,role:`status`,children:U}),t[19]=U,t[20]=J);let Y;t[21]!==q||t[22]!==J?(Y=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[q,J]}),t[21]=q,t[22]=J,t[23]=Y):Y=t[23];let ne;t[24]===j.goal?ne=t[25]:(ne=(0,Q.jsx)(`h4`,{className:`break-words text-base font-semibold text-fg`,children:j.goal}),t[24]=j.goal,t[25]=ne);let re;t[26]===f?re=t[27]:(re=f?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}):null,t[26]=f,t[27]=re);let ie;t[28]!==j.stopPending||t[29]!==a?(ie=j.stopPending?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`已停止安排新步骤,正在确认上一步是否终止。`:`No new steps will start until the previous execution is confirmed stopped.`}):null,t[28]=j.stopPending,t[29]=a,t[30]=ie):ie=t[30];let ae;t[31]!==j.summary||t[32]!==a?(ae=j.summary?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`最近进展`:`Latest progress`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-sm text-fg`,children:j.summary})]}):null,t[31]=j.summary,t[32]=a,t[33]=ae):ae=t[33];let oe;t[34]!==j.waitingFor||t[35]!==a?(oe=j.waitingFor?(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-panel p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`当前需要`:`What is needed`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:j.waitingFor===`Source scope or goal contract needs review`?a?`参考资料或目标要求已变更,请先检查。`:`Source scope or goal requirements need review.`:j.waitingFor===`Step history changed; review before resuming`?a?`一步历史结果已删除,目标已暂停。请确认下一步后再继续。`:`A step was deleted. Review the next action before resuming.`:j.waitingFor===`New material awaits review`?a?`有新增资料还没核对,请先推进下一步。`:`New material needs review before goal acceptance.`:j.waitingFor})]}):null,t[34]=j.waitingFor,t[35]=a,t[36]=oe):oe=t[36];let se;t[37]!==j.nextStep||t[38]!==j.status||t[39]!==a?(se=j.nextStep?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.status===`working`?a?`当前这一步`:`Current step`:a?`建议下一步`:`Proposed next step`}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:j.nextStep})]}):null,t[37]=j.nextStep,t[38]=j.status,t[39]=a,t[40]=se):se=t[40];let ce;t[41]!==N||t[42]!==b||t[43]!==a?(ce=N?(0,Q.jsx)(X,{variant:`secondary`,onClick:()=>x(b===N.taskId?void 0:N.taskId),children:a?`查看第 ${N.number} 步的进度与结果`:`Review step ${N.number}`}):null,t[41]=N,t[42]=b,t[43]=a,t[44]=ce):ce=t[44];let le;t[45]!==k||t[46]!==S||t[47]!==G||t[48]!==c||t[49]!==D||t[50]!==w||t[51]!==v||t[52]!==F||t[53]!==j.autoContinue||t[54]!==j.criteria||t[55]!==j.nextStep||t[56]!==j.remainingSteps||t[57]!==j.status||t[58]!==j.stopPending||t[59]!==N?.verified||t[60]!==g||t[61]!==m||t[62]!==a?(le=F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.autoContinue?a?`本轮还可自动推进 ${j.remainingSteps} 步。每步结果都会保留,遇到资料缺口会停下。`:`Up to ${j.remainingSteps} more automatic steps this round. Missing input stops progress.`:a?`每个下一步都由你确认后再执行。`:`You confirm each next step before it runs.`}),j.status===`review`&&!j.stopPending?(0,Q.jsx)(X,{variant:`primary`,disabled:c,onClick:()=>{_(j.nextStep),y(!v)},children:j.nextStep?a?`确认或调整下一步`:`Confirm or adjust next step`:a?`安排下一步`:`Set the next step`}):null,v?(0,Q.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),G({kind:`continue`,nextStep:g,stepBudget:j.autoContinue?3:1})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`下一步要完成什么?`:`What should the next step deliver?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:g,onChange:e=>_(e.target.value),className:`mt-1 min-h-20 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:j.autoContinue?a?`确认后,本轮最多再推进 3 步。`:`Confirm up to 3 more private steps this round.`:a?`确认后仅执行这一步。`:`Confirm this step only.`}),(0,Q.jsx)(X,{type:`submit`,variant:`primary`,disabled:c,children:a?`确认继续推进`:`Continue with this step`})]}):null,(0,Q.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),G({kind:`add_input`,text:m})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`补充资料或最新情况`:`Add evidence or an update`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:8e3,value:m,onChange:e=>h(e.target.value),placeholder:a?`粘贴复现条件、日志片段,或说明有什么新进展。`:`Add reproduction steps, logs or new progress.`,className:`mt-1 min-h-16 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(X,{variant:j.status===`waiting`?`primary`:`secondary`,disabled:c||!m.trim(),type:`submit`,children:j.status===`waiting`&&j.autoContinue&&j.remainingSteps>0&&N?.verified?a?`补充资料,继续推进`:`Add evidence and continue`:a?`补充到这条目标`:`Add to this goal`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[j.status===`waiting`&&!j.stopPending?(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>{_(j.nextStep),y(!v)},children:a?`调整下一步`:`Adjust next step`}):null,(0,Q.jsx)(X,{variant:`ghost`,disabled:c,onClick:()=>G({kind:j.status===`paused`?`resume`:`pause`}),children:j.status===`paused`?a?`恢复推进`:`Resume`:a?`暂停推进`:`Pause`}),N?.verified&&j.status!==`working`&&!j.stopPending?(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>C(!S),children:a?`验收整个目标`:`Review goal completion`}):null,(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>T(!w),children:a?`结束跟进`:`End follow-up`})]}),w?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`停止后续推进并请求取消当前步骤,保留已有结果。`:`Stop further work and cancel the current step. Keep previous results.`}),(0,Q.jsx)(X,{disabled:c,onClick:()=>G({kind:`end`}),children:a?`确认结束跟进`:`Confirm end`})]}):null,S?(0,Q.jsxs)(`form`,{className:`space-y-3 rounded-lg bg-surface-panel p-3`,onSubmit:e=>{e.preventDefault(),G({kind:`complete`,confirmedCriteria:D,note:k})},children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:a?`请对照结果逐项确认,阶段产出不代表目标已完成。`:`Confirm each criterion against the results. A completed step is not a completed goal.`}),j.criteria.map((e,t)=>(0,Q.jsxs)(`label`,{className:`flex items-start gap-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:D.includes(t),onChange:e=>O(e.target.checked?[...D,t]:D.filter(e=>e!==t))}),e]},t)),(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`验收依据`:`Acceptance evidence`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:k,onChange:e=>A(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-panel p-2 text-sm`})]}),(0,Q.jsx)(X,{type:`submit`,variant:`primary`,disabled:c||D.length!==j.criteria.length||!k.trim(),children:a?`确认目标已完成`:`Accept completed goal`})]}):null]}),t[45]=k,t[46]=S,t[47]=G,t[48]=c,t[49]=D,t[50]=w,t[51]=v,t[52]=F,t[53]=j.autoContinue,t[54]=j.criteria,t[55]=j.nextStep,t[56]=j.remainingSteps,t[57]=j.status,t[58]=j.stopPending,t[59]=N?.verified,t[60]=g,t[61]=m,t[62]=a,t[63]=le):le=t[63];let ue=a?`完成标准与推进记录`:`Acceptance criteria and step history`,de;t[64]===ue?de=t[65]:(de=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:ue}),t[64]=ue,t[65]=de);let fe;t[66]===j.criteria?fe=t[67]:(fe=j.criteria.map(pt),t[66]=j.criteria,t[67]=fe);let pe;t[68]===fe?pe=t[69]:(pe=(0,Q.jsx)(`ul`,{className:`mt-2 list-disc pl-4 text-sm text-fg-muted`,children:fe}),t[68]=fe,t[69]=pe);let me;if(t[70]!==j.steps||t[71]!==a){let e;t[73]===a?e=t[74]:(e=e=>(0,Q.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 border-l border-edge pl-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`span`,{children:[e.number,`. `,e.action,` · `,e.verified?a?`本步检查通过`:`Step checked`:a?`结果待核查`:`Needs review`]}),(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>x(e.taskId),children:a?`查看`:`Review`})]},e.number),t[73]=a,t[74]=e),me=j.steps.map(e),t[70]=j.steps,t[71]=a,t[72]=me}else me=t[72];let he;t[75]!==de||t[76]!==pe||t[77]!==me?(he=(0,Q.jsxs)(`details`,{children:[de,pe,me]}),t[75]=de,t[76]=pe,t[77]=me,t[78]=he):he=t[78];let ge;t[79]!==r||t[80]!==i||t[81]!==b?(ge=b?(0,Q.jsx)(ze,{taskId:b,language:r,onComplete:i}):null,t[79]=r,t[80]=i,t[81]=b,t[82]=ge):ge=t[82];let _e=`#/tasks/${encodeURIComponent(j.rootTaskId)}`,ve=a?`查看完整目标与子任务`:`View the goal and its child tasks`,ye;t[83]!==_e||t[84]!==ve?(ye=(0,Q.jsx)(`a`,{className:`inline-block text-xs text-accent-fg`,href:_e,children:ve}),t[83]=_e,t[84]=ve,t[85]=ye):ye=t[85];let be;return t[86]!==K||t[87]!==Y||t[88]!==ne||t[89]!==re||t[90]!==ie||t[91]!==ae||t[92]!==oe||t[93]!==se||t[94]!==ce||t[95]!==le||t[96]!==he||t[97]!==ge||t[98]!==ye?(be=(0,Q.jsxs)(`section`,{className:`space-y-3 rounded-lg bg-surface-inset p-3`,"aria-label":K,children:[Y,ne,re,ie,ae,oe,se,ce,le,he,ge,ye]}),t[86]=K,t[87]=Y,t[88]=ne,t[89]=re,t[90]=ie,t[91]=ae,t[92]=oe,t[93]=se,t[94]=ce,t[95]=le,t[96]=he,t[97]=ge,t[98]=ye,t[99]=be):be=t[99],be}function pt(e){return(0,Q.jsx)(`li`,{children:e},e)}function mt(e){let t=(0,Ge.c)(29),{starters:n,revision:r,language:i,onStarted:a,onUpdated:o}=e,s=i===`zh`,[c,u]=(0,Z.useState)(),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(``),g;if(t[0]!==f||t[1]!==m||t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==c||t[7]!==n||t[8]!==s){let e;t[10]===c?e=t[11]:(e=e=>e.kind===c,t[10]=c,t[11]=e);let _=n.find(e),v=_&&ne[_.kind][i],y=s?`这些工作,可以先帮你整理一份`:`Here is work I can prepare for you`,b;t[12]===y?b=t[13]:(b=(0,Q.jsx)(`p`,{className:`text-base font-semibold text-fg`,children:y}),t[12]=y,t[13]=b);let x=s?`从近期的相关请求中整理资料和待办,先给你看结果,再决定是否定期交给我。`:`Turn recent requests into useful drafts. Review the result before deciding whether to make it recurring.`,S;t[14]===x?S=t[15]:(S=(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:x}),t[14]=x,t[15]=S);let C;if(t[16]!==f||t[17]!==i||t[18]!==c||t[19]!==n||t[20]!==s){let e;t[22]!==f||t[23]!==i||t[24]!==c||t[25]!==s?(e=e=>{let t=ne[e.kind][i];return(0,Q.jsxs)(`article`,{className:`flex min-w-0 flex-col items-start gap-2 rounded-lg border border-edge p-3`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:t.title}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:t.output}),(0,Q.jsx)(`p`,{className:`mt-auto text-xs text-fg-subtle`,children:s?`最近有 ${e.requestCount} 条相关请求`:`${e.requestCount} related recent requests`}),(0,Q.jsx)(X,{disabled:f,"aria-expanded":c===e.kind,onClick:()=>{u(e.kind),h(``)},children:s?`看看会做什么`:`See what I will prepare`})]},e.kind)},t[22]=f,t[23]=i,t[24]=c,t[25]=s,t[26]=e):e=t[26],C=n.map(e),t[16]=f,t[17]=i,t[18]=c,t[19]=n,t[20]=s,t[21]=C}else C=t[21];let w;t[27]===C?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:C}),t[27]=C,t[28]=w),g=(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[b,S,w,_&&v?(0,Q.jsxs)(`form`,{className:`space-y-3 rounded-lg border border-edge bg-surface-inset p-3`,onSubmit:e=>{e.preventDefault(),!f&&(p(!0),h(``),d(l(`/api/home/observation/prepare`),{method:`POST`,body:JSON.stringify({kind:_.kind,topicIds:_.topicIds,expectedRevision:r,idempotencyKey:crypto.randomUUID(),locale:i})}).then(e=>{let t=Y.parse(e);if(t.outcome!==`task`)throw Error(s?`暂时无法开始,请稍后重试。`:`Could not start this draft.`);a(t.taskId),u(void 0),o()}).catch(e=>{let t=e instanceof Error?e.message:String(e);h(/revision|Refresh|available/i.test(t)?s?`工作记录有更新,已刷新可用任务,请重新确认。`:`Work has changed. Review the refreshed task and try again.`:t),o()}).finally(()=>p(!1)))},children:[(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:s?`你会得到:${v.title}`:`You will get: ${v.title}`}),(0,Q.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-sm text-fg-muted`,children:v.deliverables.map(gt)}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:s?`这次参考的请求`:`Requests used for this draft`}),_.previews.map(ht)]}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:s?`先准备私人草稿,资料不足会标出来。不发消息,也不自动设定时。`:`Prepare a private draft and flag missing material. No messages or recurring runs.`}),m?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:m}):null,(0,Q.jsx)(X,{variant:`primary`,type:`submit`,disabled:f,children:f?s?`正在创建任务…`:`Starting…`:s?`先生成一份`:`Prepare this draft`}),(0,Q.jsx)(X,{variant:`ghost`,disabled:f,onClick:()=>u(void 0),children:s?`取消`:`Cancel`})]}):null]}),t[0]=f,t[1]=m,t[2]=i,t[3]=a,t[4]=o,t[5]=r,t[6]=c,t[7]=n,t[8]=s,t[9]=g}else g=t[9];return g}function ht(e,t){return(0,Q.jsx)(`p`,{className:`mt-2 break-words`,children:e},t)}function gt(e){return(0,Q.jsx)(`li`,{children:e},e)}function _t({observation:e,advisor:t,language:n,emphasizeStart:r=!0,onUpdated:i}){let a=n===`zh`,[o,s]=(0,Z.useState)(!1),[c,u]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(`once`),[b,x]=(0,Z.useState)(),[S,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(),[N,F]=(0,Z.useState)(!1),I=t.state===`ready`?t.primary:void 0,L=I?.evidence.map(e=>/^observation:([^:]+):/.exec(e.id)?.[1]).find(Boolean),R=e.topics.filter(e=>e.feedback.some(e=>e.status===`active`)||e.trials.length||e.routine),z=R.find(e=>e.id===T),B=b?e.topics.find(e=>e.id===b):e.topics.find(e=>e.routine&&e.routine.status!==`ended`)??e.topics.find(e=>e.trials.length)??e.topics.find(e=>e.id===L)??e.topics[0],V=e.status===`active`&&B?.id===L?I:void 0,H=B?.trials[0],U=!!(B?.routine||H||V),W=t.state===`quiet`&&[`model_unavailable`,`generation_failed`,`budget_exhausted`].includes(t.reason),K=async e=>{if(!o){s(!0),u(``),p(``);try{await e(),i()}catch(e){u(e instanceof Error?e.message:String(e)),i()}finally{s(!1)}}},ee=async t=>re.parse(await d(l(`/api/home/observation/command`),{method:`POST`,body:JSON.stringify({expectedRevision:e.revision,idempotencyKey:crypto.randomUUID(),command:t})})),q=()=>{B&&(x(B.id),w(!S))},J=()=>B&&void K(async()=>{let t=await d(l(`/api/home/observation/discussion`),{method:`POST`,body:JSON.stringify({topicId:B.id,expectedRevision:e.revision,idempotencyKey:crypto.randomUUID()})});window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:t}))});return(0,Q.jsxs)(`section`,{className:`rounded-xl bg-surface-panel p-4`,"aria-labelledby":`home-observation-title`,"aria-busy":o,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-accent-soft text-accent-fg`,children:(0,Q.jsx)(G,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-observation-title`,className:`text-base font-semibold tracking-tight text-fg`,children:a?`交给我`:`Let me handle it`})]}),(0,Q.jsxs)(X,{variant:`ghost`,className:`gap-1 rounded-lg px-2 text-xs`,"aria-expanded":D,onClick:()=>O(!D),children:[a?`记录与设置`:`History and settings`,(0,Q.jsx)(C,{className:D?`size-3.5 shrink-0 rotate-180`:`size-3.5 shrink-0`,"aria-hidden":!0})]})]}),c?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:c}):null,f?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-fg-muted`,children:f}):null,b&&!B&&g?(0,Q.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[a?`这件事已不在记录中。未保存的内容:`:`This item is no longer available. Your unsaved note: `,g]}):null,(0,Q.jsx)(rt,{observation:e,language:n,onUpdated:i}),e.status===`active`?(0,Q.jsx)(X,{className:`mt-3`,variant:`ghost`,"aria-expanded":m,onClick:()=>h(!m),children:a?`一次性整理与定期安排`:`One-off drafts and recurring work`}):null,e.status!==`active`||m?(0,Q.jsx)(Q.Fragment,{children:e.status===`disabled`?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`h3`,{className:`text-balance text-lg font-semibold leading-snug tracking-tight text-fg`,children:a?`把重复的事,慢慢交给我`:`Let me take recurring work off your hands`}),(0,Q.jsx)(`p`,{className:`mt-2 max-w-prose text-sm leading-6 text-fg-muted`,children:a?`我会结合你在 xopc 中的工作记录,寻找可以代劳的事情。有合适的建议时,先做一次给你看。`:`I can look through your work in xopc for tasks I could take on, then offer a first draft for you to review.`}),(0,Q.jsx)(X,{className:`mt-3 rounded-lg text-xs sm:shadow-none`,variant:r?`primary`:`tonal`,disabled:o,onClick:()=>void K(async()=>{await ee({kind:`start`,backfillDays:30})}),children:a?`帮我发现重复工作`:`Find recurring work`}),(0,Q.jsxs)(`p`,{className:`mt-4 flex items-start gap-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(P,{className:`mt-1 size-3 shrink-0`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:a?`仅查看最近 30 天已授权的私人会话及后续工作记录。不扫描屏幕,定期执行前会请你确认。`:`Uses up to 30 days of authorized private chats and new work. No screen recording. Recurring runs need your confirmation.`})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[!U&&e.status===`active`&&e.starters?.length?(0,Q.jsx)(mt,{starters:e.starters,revision:e.revision,language:n,onStarted:M,onUpdated:i}):U?B?.routine?(0,Q.jsx)(Be,{routine:B.routine,language:n,onUpdated:i},B.routine.id):H?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:[`review`,`closed`].includes(H.phase)?a?`先看看这次做得怎么样`:`Review the first result`:a?`先做一次,再决定是否定期交给我`:`Try it once before making it recurring`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:H.title}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`满意后再决定要不要定期交给我。`:`Review the result before deciding whether to make it recurring.`}),(0,Q.jsx)(X,{variant:`primary`,onClick:()=>M(j===H.taskId?void 0:H.taskId),children:a?`查看这次结果`:`Review this result`}),[`review`,`closed`].includes(H.phase)?(0,Q.jsx)(Ve,{topicId:B.id,trial:H,language:n,onUpdated:i},H.taskId):null]}):V&&B?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`这件事,可以先让我试试`:`Here is something I could try`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:V.title}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:V.outcome}),V.risk===`analysis`?(0,Q.jsx)(X,{variant:`primary`,disabled:o,onClick:()=>void K(async()=>{let t=Y.parse(await d(l(`/api/home/observation/trial`),{method:`POST`,body:JSON.stringify({topicId:B.id,opportunityId:V.id,expectedRevision:e.revision,expectedOpportunityRevision:V.revision,idempotencyKey:crypto.randomUUID()})}));if(t.outcome===`task`)M(t.taskId);else throw Error(a?`请先完成相关能力配置。`:`Set up the required capabilities first.`)}),children:a?`先帮我做一次`:`Try it once`}):(0,Q.jsx)(X,{variant:`primary`,disabled:o,onClick:J,children:a?`先确认怎么做`:`Discuss the approach`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:V.risk===`analysis`?a?`先生成私人草稿,由你查看后决定下一步。`:`Start with a private draft for you to review.`:a?`这件事需要外部服务,先一起确认范围。`:`This needs an external service. Agree on the scope first.`}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:a?`为什么推荐这件事`:`Why this suggestion`}),(0,Q.jsx)(`p`,{className:`mt-2 leading-5`,children:V.rationale}),V.evidence.map(e=>(0,Q.jsx)(`p`,{className:`mt-2 leading-5`,children:e.observation},e.id))]})]}):null:(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:a?`先做一件具体的事`:`Start with a concrete task`}),(0,Q.jsx)(`p`,{className:`max-w-prose text-sm leading-6 text-fg-muted`,children:e.status===`paused`?a?`已暂停寻找新建议。你也可以直接告诉我,哪件事最想少做一点。`:`New suggestions are paused. You can still tell me what you would like to spend less time on.`:W?a?`暂时无法生成新建议,已有记录和反馈都已保留。你也可以直接说说想交给我的事。`:`New suggestions are temporarily unavailable. Your records and feedback are saved. You can still tell me what you would like help with.`:a?`例如整理 PR 审查清单、汇总问题线索,或写一份工作进展草稿。先准备一次,满意后再设为定期执行。`:`Prepare a PR review checklist, collect issue reports, or draft a work update. Try it once before making it recurring.`}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`pr_review`,`issue_digest`,`work_summary`].map(e=>{let t=ne[e][n],r=a?`请帮我准备「${t.title}」。\n目标:${t.output}\n\n要参考的资料或链接:\n\n先生成私人草稿;缺少资料时明确告诉我,不要开启定时执行。`:`Prepare ${t.title}.\n${t.output}\n\nSource material or links:\n\nCreate a private draft and flag missing information. Do not create recurring runs.`;return(0,Q.jsx)(X,{asChild:!0,children:(0,Q.jsx)(`a`,{href:`#/chat/new?${new URLSearchParams({draft:r})}`,children:t.title})},e)})}),e.status===`paused`?(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>F(!N),children:a?`恢复寻找建议`:`Resume suggestions`}):null]}),U&&B&&e.status===`active`?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:[(0,Q.jsx)(X,{variant:`ghost`,disabled:o,"aria-expanded":S,onClick:q,children:a?`调整做法`:`Refine the approach`}),(0,Q.jsx)(X,{variant:`ghost`,disabled:o,onClick:J,children:a?`聊聊这件事`:`Discuss this task`})]}):null,j?(0,Q.jsx)(ze,{taskId:j,language:n,onComplete:i}):null,N?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:a?`恢复后,要补看暂停期间的工作吗?`:`Include work from while suggestions were paused?`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[[`catch_up`,`new_only`].map(e=>(0,Q.jsx)(X,{disabled:o,onClick:()=>void K(async()=>{await ee({kind:`resume`,mode:e}),F(!1)}),children:e===`catch_up`?a?`一起补看`:`Include earlier work`:a?`只看之后的工作`:`New work only`},e)),(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>F(!1),children:a?`取消`:`Cancel`})]})]}):null]})}):null,S&&B?(0,Q.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg bg-surface-inset p-3`,onSubmit:e=>{e.preventDefault(),K(async()=>{await ee({kind:`feedback`,topicId:B.id,text:g,scope:v}),_(``),w(!1),p(a?`已记下。改变定期做法前,会先请你确认。`:`Preference saved. I will ask before changing the recurring approach.`)})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[a?`关于「${B.title}」,希望我怎么做?`:`How should I handle “${B.title}”?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:g,onChange:e=>_(e.target.value),placeholder:a?`例如:先列出未解决的阻塞,每项附上来源。`:`For example: list unresolved blockers first and include sources.`,className:`mt-1 min-h-24 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,role:`group`,"aria-label":a?`反馈范围`:`Feedback scope`,children:[`once`,`project`,`similar`].filter(e=>e!==`project`||B.projectId).map(e=>(0,Q.jsx)(X,{type:`button`,variant:e===v?`secondary`:`ghost`,"aria-pressed":e===v,onClick:()=>y(e),children:e===`once`?a?`仅这一次`:`Just this time`:e===`project`?a?`这个项目都适用`:`This project`:a?`以后这类事都适用`:`Similar future work`},e))}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`记下你的要求;改变定期安排前,仍会请你确认。`:`I will remember your preference and ask before changing a recurring arrangement.`}),(0,Q.jsx)(X,{type:`submit`,variant:`primary`,disabled:o||!g.trim(),children:a?`记住这个要求`:`Save preference`}),(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>{w(!1),_(``),y(`once`)},children:a?`取消`:`Cancel`})]}):null,D?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-3 rounded-lg bg-surface-inset p-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,role:`status`,children:e.status===`disabled`?a?`尚未开启`:`Not enabled`:e.status===`paused`?a?`已暂停寻找新建议`:`Suggestions paused`:e.analyzedRevision<e.revision?a?`正在整理最近的工作记录`:`Reviewing recent work`:a?`有新发现时会在这里告诉你`:`New suggestions will appear here`}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:a?`只查看已授权的 xopc 私人会话和相关任务结果。暂停寻找建议不会停止已经确认的定期安排。`:`Uses authorized private xopc chats and related task results. Pausing suggestions does not stop confirmed recurring tasks.`}),e.status===`disabled`?null:(0,Q.jsx)(X,{disabled:o,variant:`ghost`,onClick:()=>e.status===`active`?void K(async()=>{await ee({kind:`pause`})}):F(!N),children:e.status===`active`?a?`暂停寻找建议`:`Pause suggestions`:a?`恢复寻找建议`:`Resume suggestions`}),R.length?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:a?`已保存的要求与试做`:`Saved preferences and trials`}),(0,Q.jsx)(`div`,{className:`max-h-48 space-y-2 overflow-y-auto`,children:R.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-panel p-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm text-fg`,children:e.routine?.title||e.trials[0]?.title||(a?`已保存的工作要求`:`Saved work preferences`)}),(0,Q.jsx)(X,{variant:`ghost`,disabled:!!g&&e.id!==B?.id,onClick:()=>{E(e.id),x(e.id),A(!1)},children:a?`管理`:`Manage`})]},e.id))}),z?(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg bg-surface-panel p-3`,children:[e.status===`active`?(0,Q.jsx)(X,{variant:`ghost`,disabled:o,onClick:q,children:a?`调整要求`:`Edit preferences`}):null,z.feedback.filter(e=>e.status===`active`).map(e=>(0,Q.jsxs)(`div`,{className:`text-xs text-fg`,children:[(0,Q.jsx)(`p`,{children:e.text}),(0,Q.jsx)(X,{disabled:o,variant:`ghost`,onClick:()=>void K(async()=>{await ee({kind:`retract`,topicId:z.id,feedbackId:e.id})}),children:a?`撤回要求`:`Retract preference`})]},e.id)),z.trials.map(e=>(0,Q.jsxs)(X,{variant:`ghost`,onClick:()=>M(e.taskId),children:[a?`查看结果:`:`Review result: `,e.title]},e.taskId)),(0,Q.jsx)(X,{variant:`ghost`,disabled:o,onClick:()=>A(!0),children:a?`不再参考这件事`:`Stop using this work history`}),k?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:a?`清除关于这件事的理解和要求。原始记录、已有任务和自动化保留。`:`Forget this understanding and saved preferences. Original records, tasks and automations remain.`}),(0,Q.jsx)(X,{disabled:o,onClick:()=>void K(async()=>{await ee({kind:`forget`,topicId:z.id}),x(void 0),E(void 0),A(!1),_(``),w(!1),M(void 0)}),children:a?`确认不再参考`:`Confirm exclusion`})]}):null]}):null]}):(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`你确认的要求与试做结果会保存在这里。普通聊天记录仍在原对话中查看。`:`Your saved preferences and trial results will appear here. View ordinary work history in its original chat.`})]}):null]})}var vt=new Set([`started`,`discussing`,`completed`]);function yt(){let e=(0,Ge.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[0,1,2].map(bt)}),e[0]=t):t=e[0],t}function bt(e){return(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge-subtle p-4`,children:[(0,Q.jsx)(J,{className:`h-4 w-24 rounded`}),(0,Q.jsx)(J,{className:`h-5 w-4/5 rounded`}),(0,Q.jsx)(J,{className:`h-4 w-3/5 rounded`})]},e)}function xt(e){let t=(0,Ge.c)(11),{open:n,refreshKey:r,onOpenChange:i,onReevaluate:a}=e,o=u(St),c=f(o).projectsPage.home,l=s(),[d,b]=(0,Z.useState)(`all`),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[0]=x):x=t[0];let[S,w]=(0,Z.useState)(x),[T,E]=(0,Z.useState)(!1),[D,A]=(0,Z.useState)(),j;t[1]===n?j=t[2]:(j=()=>{if(!n)return;let e=!0;return E(!0),A(void 0),le().then(t=>{e&&w(t.items)}).catch(t=>{e&&A(t instanceof Error?t.message:String(t))}).finally(()=>{e&&E(!1)}),()=>{e=!1}},t[1]=n,t[2]=j);let N;t[3]!==n||t[4]!==r?(N=[n,r],t[3]=n,t[4]=r,t[5]=N):N=t[5],(0,Z.useEffect)(j,N);let P=S.filter(e=>d===`all`||(d===`adopted`?vt.has(e.status):!vt.has(e.status))),I=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}),L=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),R=new Map;for(let e of P){let t=I.format(new Date(e.updatedAt));R.set(t,[...R.get(t)??[],e])}let z=[...R.entries()],B=e=>e.feedbackKind===`already_done`?c.advisorHistoryStatusCompleted:e.feedbackKind===`irrelevant`?c.advisorHistoryStatusIrrelevant:e.feedbackKind===`source_incorrect`?c.advisorHistoryStatusSourceIncorrect:e.feedbackKind===`less_like_this`?c.advisorHistoryStatusLessLikeThis:{available:c.advisorHistoryStatusAvailable,started:c.advisorHistoryStatusStarted,discussing:c.advisorHistoryStatusDiscussing,completed:c.advisorHistoryStatusCompleted,snoozed:c.advisorHistoryStatusSnoozed,dismissed:c.advisorHistoryStatusDismissed,expired:c.advisorHistoryStatusExpired,superseded:c.advisorHistoryStatusSuperseded}[e.status],V=e=>{if(e.href){i(!1),l(F(`/`,e.href));return}e.status===`discussing`&&(i(!1),l(`/chat/new?${new URLSearchParams({draft:e.opportunity.actionPrompt}).toString()}`))},U;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),t[6]=U):U=t[6];let W;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(M,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=W):W=t[7];let G;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),t[8]=G):G=t[8];let K=T?(0,Q.jsx)(yt,{}):D?(0,Q.jsxs)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft p-4 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:c.advisorHistoryLoadFailed}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,className:`mt-2`,onClick:()=>i(!1),children:c.advisorHistoryClose})]}):z.length===0?(0,Q.jsxs)(`div`,{className:`py-16 text-center`,children:[(0,Q.jsx)(M,{className:`mx-auto size-6 text-fg-subtle`,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:c.advisorHistoryEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:c.advisorHistoryEmptyHint})]}):(0,Q.jsx)(`div`,{className:`space-y-6`,children:z.map(e=>{let[t,n]=e;return(0,Q.jsxs)(`section`,{"aria-label":t,children:[(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-fg-subtle`,children:t}),(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>{let t=!!e.href||e.status===`discussing`,n=[`snoozed`,`dismissed`,`expired`,`superseded`].includes(e.status);return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:B(e)}),(0,Q.jsx)(`h4`,{className:`mt-1.5 text-sm font-semibold leading-5 text-fg`,children:e.opportunity.title}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e.opportunity.outcome})]}),(0,Q.jsx)(`time`,{className:`shrink-0 text-[11px] text-fg-subtle`,dateTime:new Date(e.updatedAt).toISOString(),children:L.format(new Date(e.updatedAt))})]}),e.snoozedUntil?(0,Q.jsxs)(`p`,{className:`mt-2 inline-flex items-center gap-1 text-xs text-fg-muted`,children:[(0,Q.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),c.advisorHistoryReturnsAt,` `,L.format(new Date(e.snoozedUntil))]}):null,(0,Q.jsxs)(`details`,{className:`group mt-3`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1 text-xs font-medium text-fg-muted hover:text-fg`,children:[c.advisorHistoryEvidence,(0,Q.jsx)(C,{className:`size-3.5 transition-transform duration-200 group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,Q.jsx)(Xe,{opportunity:e.opportunity,onOpen:()=>i(!1)})]}),t||n?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[t?(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`min-h-9 text-xs`,onClick:()=>V(e),children:[(0,Q.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),e.status===`discussing`?c.advisorHistoryContinueDiscussion:c.advisorHistoryViewProgress]}):null,n?(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:`min-h-9 text-xs`,onClick:()=>{i(!1),a()},children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),c.advisorHistoryReevaluate]}):null]}):null]},e.opportunity.id)})})]},t)})}),q;return t[9]===K?q=t[10]:(q=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:K}),t[9]=K,t[10]=q),(0,Q.jsx)(y,{open:n,onOpenChange:i,children:(0,Q.jsxs)(g,{children:[U,(0,Q.jsxs)(_,{className:`xopc-drawer-right fixed right-0 top-0 z-[90] flex size-full max-w-lg flex-col overflow-hidden border-l border-edge bg-surface-overlay shadow-popover outline-none`,"aria-describedby":`home-advisor-history-description`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 border-b border-edge px-5 py-4`,children:[W,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:c.advisorHistoryTitle}),(0,Q.jsx)(m,{id:`home-advisor-history-description`,className:`mt-1 text-xs leading-5 text-fg-muted`,children:c.advisorHistoryDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(X,{type:`button`,variant:`ghost`,className:`-mr-2 size-9 shrink-0 p-0`,"aria-label":c.advisorHistoryClose,children:G})})]}),(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-5 py-3`,children:(0,Q.jsx)(Me,{className:`inline-flex rounded-lg bg-surface-inset p-1`,role:`group`,"aria-label":c.advisorHistoryFilterLabel,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`all`,c.advisorHistoryFilterAll],[`adopted`,c.advisorHistoryFilterAdopted],[`other`,c.advisorHistoryFilterOther]].map(e=>{let[t,n]=e;return(0,Q.jsx)(`button`,{type:`button`,className:`min-h-9 rounded-md px-3 text-xs font-medium transition-colors duration-150 ${d===t?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`}`,"aria-pressed":d===t,onClick:()=>b(t),children:n},t)})})}),q]})]})})}function St(e){return e.language}function Ct(e,t){return e.replace(`{{count}}`,String(t))}function wt(e,t){if(e.state===`disabled`)return null;if(e.state===`ready`){let n=1+e.alternatives.length;return{label:Ct(t.ready,n),detail:e.primary.title,tone:`accent`,refreshing:!!e.stale}}return e.state===`clarification`?{label:t.clarification,detail:e.question.question,tone:`accent`,refreshing:!1}:e.state===`refreshing`?{label:t.refreshing,detail:e.previous?.title??t.refreshingDetail,tone:`accent`,refreshing:!0}:e.reason===`generation_failed`?{label:t.generationFailed,detail:t.generationFailedDetail,tone:`danger`,refreshing:!1}:e.reason===`budget_exhausted`?{label:t.budgetExhausted,detail:t.budgetExhaustedDetail,tone:`warning`,refreshing:!1}:e.reason===`model_unavailable`?{label:t.modelUnavailable,detail:t.modelUnavailableDetail,tone:`warning`,refreshing:!1}:{label:t.idle,detail:t.idleDetail,tone:`neutral`,refreshing:!1}}var Tt={accent:`bg-accent`,danger:`bg-danger`,neutral:`bg-fg-subtle`,warning:`bg-warning`};function Et(e){let t=(0,Ge.c)(45),{advisor:n,busy:r,copy:i,onOpenHistory:a,onRefresh:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]!==n||t[1]!==i?(l=wt(n,i),t[0]=n,t[1]=i,t[2]=l):l=t[2];let u=l;if(!u)return null;let d=n.state!==`refreshing`,f=n.state===`ready`?i.findAnother:i.retry,p=`${i.label}:${u.label}`,m;t[3]===u.refreshing?m=t[4]:(m=u.refreshing?(0,Q.jsx)(H,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(G,{className:`size-4`,"aria-hidden":!0}),t[3]=u.refreshing,t[4]=m);let h;t[5]!==u.refreshing||t[6]!==u.tone?(h=u.tone!==`neutral`&&!u.refreshing?(0,Q.jsx)(`span`,{className:q(`absolute right-1.5 top-1.5 size-1.5 rounded-full`,Tt[u.tone]),"aria-hidden":!0}):null,t[5]=u.refreshing,t[6]=u.tone,t[7]=h):h=t[7];let g;t[8]!==p||t[9]!==m||t[10]!==h?(g=(0,Q.jsx)(be,{asChild:!0,children:(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:`relative size-9 rounded-lg p-0 data-[state=open]:bg-surface-hover data-[state=open]:text-fg`,"aria-label":p,title:p,children:[m,h]})}),t[8]=p,t[9]=m,t[10]=h,t[11]=g):g=t[11];let _;t[12]===u.refreshing?_=t[13]:(_=(0,Q.jsx)(`span`,{className:`mt-1 flex size-7 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:u.refreshing?(0,Q.jsx)(H,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(G,{className:`size-4`,"aria-hidden":!0})}),t[12]=u.refreshing,t[13]=_);let v;t[14]===u.label?v=t[15]:(v=(0,Q.jsx)(`p`,{className:`font-semibold text-fg`,children:u.label}),t[14]=u.label,t[15]=v);let y;t[16]===u.detail?y=t[17]:(y=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.detail}),t[16]=u.detail,t[17]=y);let b;t[18]!==v||t[19]!==y?(b=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20];let x;t[21]!==_||t[22]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[_,b]}),t[21]=_,t[22]=b,t[23]=x):x=t[23];let S;t[24]===a?S=t[25]:(S=()=>{c(!1),a()},t[24]=a,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(M,{className:`size-3.5`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]!==i.history||t[28]!==S?(w=(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:`h-9 rounded-lg text-xs`,onClick:S,children:[C,i.history]}),t[27]=i.history,t[28]=S,t[29]=w):w=t[29];let T;t[30]!==r||t[31]!==d||t[32]!==o||t[33]!==f?(T=d?(0,Q.jsxs)(X,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg text-xs`,disabled:r,onClick:()=>{c(!1),o()},children:[(0,Q.jsx)(H,{className:`size-3.5`,"aria-hidden":!0}),f]}):null,t[30]=r,t[31]=d,t[32]=o,t[33]=f,t[34]=T):T=t[34];let E;t[35]!==w||t[36]!==T?(E=(0,Q.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:[w,T]}),t[35]=w,t[36]=T,t[37]=E):E=t[37];let D;t[38]!==E||t[39]!==x?(D=(0,Q.jsx)(ge,{children:(0,Q.jsxs)(_e,{side:`bottom`,align:`end`,sideOffset:6,className:`z-[70] w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-edge bg-surface-overlay p-4 text-sm text-fg shadow-popover outline-none`,onOpenAutoFocus:Dt,children:[x,E]})}),t[38]=E,t[39]=x,t[40]=D):D=t[40];let O;return t[41]!==s||t[42]!==D||t[43]!==g?(O=(0,Q.jsxs)(ve,{open:s,onOpenChange:c,children:[g,D]}),t[41]=s,t[42]=D,t[43]=g,t[44]=O):O=t[44],O}function Dt(e){return e.preventDefault()}var Ot=(0,Z.lazy)(()=>i(()=>import(`./workspace-file-preview-dialog-BjJEOajj.js`).then(e=>e.n).then(e=>({default:e.WorkspaceFilePreviewPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79])));function kt(e){let t=(0,Ge.c)(39),{item:n,language:r,primary:i,showNew:a,onOpen:o}=e,s=a!==void 0&&a,c;t[0]===r?c=t[1]:(c=f(r),t[0]=r,t[1]=c);let l=c.projectsPage.home.workbench,u;t[2]===s?u=t[3]:(u=s?(0,Q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,Q.jsx)(A,{className:`size-4`,"aria-hidden":!0})}):null,t[2]=s,t[3]=u);let d;t[4]===n.title?d=t[5]:(d=(0,Q.jsx)(`p`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[4]=n.title,t[5]=d);let p;t[6]!==l.newDelivery||t[7]!==s?(p=s?(0,Q.jsx)(`span`,{className:`mr-2 font-medium text-accent-fg`,children:l.newDelivery}):null,t[6]=l.newDelivery,t[7]=s,t[8]=p):p=t[8];let m;t[9]===n.completedAt?m=t[10]:(m=new Date(n.completedAt).toISOString(),t[9]=n.completedAt,t[10]=m);let h;t[11]!==n.completedAt||t[12]!==r?(h=Le(new Date(n.completedAt),r),t[11]=n.completedAt,t[12]=r,t[13]=h):h=t[13];let g;t[14]!==m||t[15]!==h?(g=(0,Q.jsx)(`time`,{dateTime:m,children:h}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]!==p||t[18]!==g?(_=(0,Q.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[p,g]}),t[17]=p,t[18]=g,t[19]=_):_=t[19];let v;t[20]===n.summary?v=t[21]:(v=n.summary?(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 break-words text-xs leading-5 text-fg-muted`,children:n.summary}):null,t[20]=n.summary,t[21]=v);let y;t[22]!==v||t[23]!==d||t[24]!==_?(y=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[d,_,v]}),t[22]=v,t[23]=d,t[24]=_,t[25]=y):y=t[25];let b;t[26]!==y||t[27]!==u?(b=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-48 items-start gap-3`,children:[u,y]}),t[26]=y,t[27]=u,t[28]=b):b=t[28];let x=i?`primary`:s?`ghost`:`tonal`,S;t[29]===s?S=t[30]:(S=s?(0,Q.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}):null,t[29]=s,t[30]=S);let C;t[31]!==l.openDelivery||t[32]!==o||t[33]!==x||t[34]!==S?(C=(0,Q.jsxs)(X,{variant:x,className:`min-h-9 shrink-0 gap-1 rounded-lg px-2.5 text-xs sm:shadow-none`,onClick:o,children:[l.openDelivery,S]}),t[31]=l.openDelivery,t[32]=o,t[33]=x,t[34]=S,t[35]=C):C=t[35];let T;return t[36]!==b||t[37]!==C?(T=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3.5`,children:[b,C]}),t[36]=b,t[37]=C,t[38]=T):T=t[38],T}function At({view:e,items:t,language:n,onSelect:r,onClose:i,onRead:a,onOpenFull:o,onRestoreFocus:s}){let c=f(n).projectsPage.home,[l,u]=(0,Z.useState)(!1),[d,m]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),C=e&&e!==`history`?e:null,{data:w,error:T,mutate:E}=ie(C?[`home-delivery`,C.id]:null,async()=>{if(!C)return;if(C.kind===`automation`){let{run:e}=await Ae.getRun(C.subjectId);return{kind:`automation`,summary:e.summary}}let e=await ce(C.subjectId),t=e.receipts.find(e=>`task:${e.runId}`===C.id);if(!t)throw Error(c.workbench.deliveryFailed);return{kind:`task`,detail:e,receipt:t}},{shouldRetryOnError:!1}),D=w?.kind===`task`||!!w?.summary?.trim();async function O(e){if(!S.current){S.current=!0,u(!0),m(!1);try{e.kind===`automation`&&!e.read&&await Ae.markRunRead(e.subjectId),a(e)}catch{m(!0)}finally{S.current=!1,u(!1)}}}return(0,Q.jsx)(y,{open:e!==null,onOpenChange:e=>{!e&&!S.current&&(m(!1),i())},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(36rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay outline-none`,"aria-describedby":void 0,onCloseAutoFocus:e=>{e.preventDefault(),s()},children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,Q.jsx)(v,{className:`truncate text-base font-semibold text-fg`,children:C?.title??c.workbench.deliveryHistory}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:`size-9 p-0`,disabled:l,"aria-label":n===`zh`?`关闭`:`Close`,children:(0,Q.jsx)(ee,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:e===`history`?t.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:t.map(e=>(0,Q.jsx)(kt,{item:e,language:n,onOpen:()=>{m(!1),r(e)}},e.id))}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.deliveryEmpty}):T?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:c.workbench.deliveryFailed}),(0,Q.jsx)(X,{variant:`secondary`,onClick:()=>void E(),children:c.retry})]}):w?w.kind===`task`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(He,{content:w.receipt.summary,contentKey:w.receipt.runId,language:n}),(0,Q.jsx)(Ue,{evidence:w.receipt.evidence,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId??void 0,language:n,onOpenFile:x}),(0,Q.jsx)(y,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`fixed inset-0 z-[90] bg-scrim`}),(0,Q.jsxs)(_,{className:`fixed left-1/2 top-1/2 z-[100] flex h-[min(54rem,calc(100dvh-2rem))] w-[min(72rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel outline-none`,"aria-describedby":void 0,children:[(0,Q.jsx)(v,{className:`sr-only`,children:b}),(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(J,{className:`m-4 min-h-24`}),children:(0,Q.jsx)(Ot,{filePath:b,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId,onClose:()=>x(null)})})]})]})})]}):w.kind===`automation`&&w.summary?(0,Q.jsx)(I,{content:w.summary}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.noSummary}):(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(J,{className:`h-5 w-2/3`}),(0,Q.jsx)(J,{className:`h-24`})]})}),C?(0,Q.jsxs)(`footer`,{className:`shrink-0 space-y-2 border-t border-edge px-4 py-3`,children:[d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c.workbench.readFailed}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,Q.jsx)(X,{variant:`ghost`,disabled:l,onClick:()=>o(C),children:c.workbench.openFullResult}),(0,Q.jsx)(X,{variant:`primary`,disabled:!!T||!D||l,onClick:()=>void O(C),children:c.workbench.markRead})]})]}):null]})]})})}var jt=[`attention`,`delivery`,`resume`,`background`,`observation`],Mt=[`left`,`right`,`full`],Nt=`xopc.workbench.layout`,Pt=`application/x-xopc-workbench-card`,Ft=24,It=340,Lt=304,Rt=864,zt=1/1.57,Bt=260,Vt=72,Ht=1600,Ut={order:[...jt],lanes:{},sizes:{},ratio:zt};function Wt(){try{let e=JSON.parse(localStorage.getItem(Nt)??`{}`),t=Array.isArray(e?.order)?jt.filter(t=>e.order.includes(t)).sort((t,n)=>e.order.indexOf(t)-e.order.indexOf(n)):[],n={},r={};for(let t of jt){let i=e?.lanes?.[t];Mt.includes(i)&&(n[t]=i);let{width:a,height:o}=e?.sizes?.[t]??{},s=Number.isFinite(a)&&a>=Bt,c=Number.isFinite(o)&&o>=Vt&&o<=Ht;(s||c)&&(r[t]={width:s?a:void 0,height:c?o:void 0})}let i=typeof e?.ratio==`number`&&e.ratio>0&&e.ratio<1?e.ratio:zt;return{order:[...new Set([...t,...jt])],lanes:n,sizes:r,ratio:i}}catch{return Ut}}var Gt=`w-full justify-start rounded-md px-2.5 text-sm text-fg`;function Kt(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function qt({cards:e,editing:t,language:n}){let r=n===`zh`,[i,a]=(0,Z.useState)(Wt),[o,s]=(0,Z.useState)({width:0,heights:{}}),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(),[f,p]=(0,Z.useState)(),[m,h]=(0,Z.useState)(),[g,_]=(0,Z.useState)(``),v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!f)try{localStorage.setItem(Nt,JSON.stringify(i))}catch{}},[i,f]),(0,Z.useEffect)(()=>{let e=v.current,t=e?.closest(`[data-workbench-page-scroll]`);if(!e||!t)return;let n=e=>{let n=e.target instanceof Element?e.target.closest(`[data-workbench-card-scroll]`):null;n&&xe(e,n,t,{handoffOnly:!0})};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)},[]);let x=o.width-Ft,S=Math.max(It,x-Lt),C=Math.max(It,Math.min(S,Math.round(x*i.ratio))),w=new Map(e.map(e=>[e.id,e])),T=Mt.map(e=>i.order.flatMap(t=>{let n=w.get(t);return n&&(i.lanes[t]??n.lane)===e?[n]:[]})),E=e.some(({id:e})=>i.lanes[e]===`left`||i.lanes[e]===`right`),D=o.width>=Rt,O=D&&(t||E||T[0].length>0&&T[1].length>0);(0,Z.useLayoutEffect)(()=>{let e=v.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{let t=e.clientWidth,n={};for(let t of e.children)t instanceof HTMLElement&&t.dataset.workbenchItem&&(n[t.dataset.workbenchItem]=Math.ceil(t.getBoundingClientRect().height));s(e=>e.width===t&&Object.keys(e.heights).length===Object.keys(n).length&&Object.entries(n).every(([t,n])=>e.heights[t]===n)?e:{width:t,heights:n})},n=new ResizeObserver(t);n.observe(e);for(let t of e.children)n.observe(t);return t(),()=>n.disconnect()},[e,t,O,C]);function k(e,t){let{lane:n,anchor:o,after:s}=t;h(i),a(t=>{let r=t.order.filter(t=>t!==e);return r.splice(o?r.indexOf(o)+ +!!s:r.length,0,e),{...t,order:r,lanes:{...t.lanes,[e]:n}}}),_(r?`已移动「${w.get(e)?.label}」`:`Moved ${w.get(e)?.label}`)}function A(){l(void 0),d(void 0)}function M(e,t){!c||e.dataTransfer.getData(Pt)!==c||t.anchor===c||(e.preventDefault(),k(c,t),A())}function N(e,t){!c||t.anchor===c||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,d(e=>e?.lane===t.lane&&e.anchor===t.anchor&&e.after===t.after?e:t))}function P(e,t,n){let r=e.currentTarget.getBoundingClientRect();return{lane:t,anchor:n,after:e.clientY>=r.top+r.height/2}}function F(e){let t=Kt(e,It,S);t!==C&&a(e=>({...e,ratio:t/x}))}function I(e){let t=y.current;t&&(y.current=null,p(void 0),e?a(t.before):i.ratio!==t.before.ratio&&h(t.before))}function L(e,t){a(n=>{let r=n.sizes[e];if(r?.width===t.width&&r?.height===t.height)return n;let i={...n.sizes,[e]:t};return t.width===void 0&&t.height===void 0&&delete i[e],{...n,sizes:i}})}function R(e){i.sizes[e.id]&&(h(i),L(e.id,{}),_(r?`「${e.label}」已恢复自动尺寸`:`${e.label} restored to automatic size`))}function z(e,t){let n=b.current;if(n)if(b.current=null,p(void 0),t)a(n.before);else{let t=n.before.sizes[e.id],a=i.sizes[e.id];(a?.width!==t?.width||a?.height!==t?.height)&&(h(n.before),_(r?`已调整「${e.label}」大小`:`Resized ${e.label}`))}}let B=r?[`左栏`,`右栏`,`全宽`]:[`Left column`,`Right column`,`Full width`],V=[0,0,0],H=new Map,U=Mt.filter((e,n)=>t&&T[n].length===0);for(let[e,t]of Mt.entries()){let n=e===1?C+Ft:0,r=e===0?C:e===1?x-C:o.width;t===`full`&&(V[2]=Math.max(V[0],V[1]));let i=T[e].map(e=>e.id);U.includes(t)&&i.push(t);for(let t of i)H.set(t,{top:V[e],left:n,width:r}),V[e]+=(o.heights[t]??0)+Ft}return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,children:g}),t?(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-x-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:r?`拖动上方手柄移动卡片,拖动右下角调整大小。`:`Drag the top handle to move a card, or its bottom-right corner to resize.`}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsxs)(X,{variant:`ghost`,className:`rounded-lg text-xs`,disabled:!m,onClick:()=>{m&&(a(m),h(void 0),_(r?`已撤销布局调整`:`Layout change undone`))},children:[(0,Q.jsx)(K,{className:`size-3.5`,"aria-hidden":!0}),r?`撤销`:`Undo`]}),(0,Q.jsx)(X,{variant:`ghost`,className:`rounded-lg text-xs`,onClick:()=>{h(i),a(Ut)},children:r?`恢复默认布局`:`Reset layout`})]})]}):null,(0,Q.jsxs)(`div`,{ref:v,className:q(`relative min-w-0`,!O&&`flex flex-col gap-6`,f&&`select-none`),style:O?{height:Math.max(0,V[2]-Ft)}:void 0,children:[O?(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":r?`调整左右栏宽度`:`Resize workbench columns`,"aria-valuemin":It,"aria-valuemax":S,"aria-valuenow":C,tabIndex:0,title:r?`左右拖动调整栏宽,双击恢复默认`:`Drag to resize columns, double-click to reset`,className:`group absolute top-0 z-10 flex w-6 touch-none cursor-col-resize items-start justify-center rounded-lg pt-3 focus-visible:outline-2 focus-visible:outline-accent`,style:{left:C,height:Math.max(0,Math.max(V[0],V[1])-Ft)},onPointerDown:e=>{e.button!==0||f||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),y.current={id:e.pointerId,x:e.clientX,width:C,before:i},p(`columns`))},onPointerMove:e=>{let t=y.current;t?.id===e.pointerId&&F(t.width+e.clientX-t.x)},onPointerUp:()=>I(!1),onPointerCancel:()=>I(!0),onLostPointerCapture:()=>I(!0),onDoubleClick:()=>{h(i),a(e=>({...e,ratio:zt}))},onKeyDown:e=>{let t={ArrowLeft:C-16,ArrowRight:C+16,Home:It,End:S};Object.hasOwn(t,e.key)&&(e.preventDefault(),h(i),F(t[e.key]))},children:(0,Q.jsx)(`span`,{"aria-hidden":!0,className:q(`h-8 w-px rounded-full bg-edge-strong motion-safe:transition-colors group-hover:bg-accent`,f===`columns`&&`bg-accent`)})}):null,T.flatMap((e,n)=>e.map((a,s)=>{let m=Mt[n],g=u?.anchor===a.id,v=r?`移动「${a.label}」`:`Move ${a.label}`,y=r?`调整「${a.label}」大小`:`Resize ${a.label}`,x=H.get(a.id),S=(O?x?.width:o.width)??o.width,C=i.sizes[a.id],w=D&&C?.width!==void 0?Math.min(S,C.width):void 0,T=C?.height,E=f===a.id,F=`home-workbench-content-${a.id}`;return(0,Q.jsxs)(`div`,{"data-workbench-item":a.id,"data-workbench-lane":m,className:q(`relative min-w-0`,O&&`absolute`,c===a.id&&`opacity-50`,t&&`rounded-xl bg-surface-panel pb-3 pointer-coarse:pb-8`,t&&`[&_[data-workbench-panel]]:bg-transparent`,E&&`ring-2 ring-accent`),style:O?{...x,width:w??x?.width}:{width:w},onDragOver:c?e=>N(e,P(e,m,a.id)):void 0,onDrop:c?e=>M(e,P(e,m,a.id)):void 0,onDragLeave:e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||d(e=>e?.anchor===a.id?void 0:e)},children:[g?(0,Q.jsx)(`span`,{"aria-hidden":!0,className:q(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-accent`,u.after?`-bottom-2`:`-top-2`)}):null,t?(0,Q.jsx)(`div`,{className:`flex justify-start px-2 pt-1`,children:(0,Q.jsxs)(ve,{children:[(0,Q.jsx)(be,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:`h-7 cursor-grab rounded-lg px-3 py-0 active:cursor-grabbing`,"aria-label":v,title:v,draggable:!0,onDragStart:e=>{let t=e.currentTarget.closest(`[data-workbench-item]`);if(t){let n=t.getBoundingClientRect();e.dataTransfer.setDragImage(t,e.clientX-n.left,e.clientY-n.top)}e.dataTransfer.setData(Pt,a.id),e.dataTransfer.effectAllowed=`move`,l(a.id)},onDragEnd:A,children:(0,Q.jsx)(j,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(ge,{children:(0,Q.jsxs)(_e,{align:`start`,sideOffset:4,"aria-label":v,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:Gt,disabled:s===0,onClick:()=>k(a.id,{lane:m,anchor:e[s-1]?.id}),children:r?`上移`:`Move up`})}),(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:Gt,disabled:s===e.length-1,onClick:()=>k(a.id,{lane:m,anchor:e[s+1]?.id,after:!0}),children:r?`下移`:`Move down`})}),Mt.map((e,t)=>(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:Gt,disabled:e===m,onClick:()=>k(a.id,{lane:e}),children:r?`移到${B[t]}`:`Move to ${B[t].toLowerCase()}`})},e)),(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(X,{variant:`ghost`,className:Gt,disabled:!C,onClick:()=>R(a),children:r?`恢复自动尺寸`:`Restore automatic size`})})]})})]})}):null,(0,Q.jsx)(`div`,{id:F,"data-workbench-card-scroll":T===void 0?void 0:``,className:q(`min-w-0 rounded-xl`,t&&(a.id===`delivery`||a.id===`resume`)&&`px-3`,T!==void 0&&`overflow-auto overscroll-y-auto focus-visible:outline-2 focus-visible:outline-accent [&>section]:min-h-full [&>section:has(>[data-workbench-fill])]:flex [&>section:has(>[data-workbench-fill])]:flex-col [&>section>[data-workbench-fill]]:grow`),style:{height:T},role:T===void 0?void 0:`group`,"aria-label":T===void 0?void 0:a.label,tabIndex:T===void 0?void 0:0,children:a.content}),t?(0,Q.jsxs)(Q.Fragment,{children:[E?(0,Q.jsxs)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-2 right-9 z-10 rounded-md bg-accent-soft px-2 py-1 text-xs tabular-nums text-accent-fg`,children:[D?`${w??S} × `:``,T??b.current?.height,` px`]}):null,(0,Q.jsx)(X,{variant:`segmented`,className:q(`absolute bottom-0 right-0 z-10 size-8 touch-none rounded-none rounded-br-xl p-0 active:scale-100`,`pointer-fine:[clip-path:polygon(0_75%,75%_75%,75%_0,100%_0,100%_100%,0_100%)]`,`after:pointer-events-none after:absolute after:inset-0 after:rounded-br-xl after:border-b-2 after:border-r-2 after:border-accent after:opacity-0 motion-safe:after:transition-opacity hover:after:opacity-100 focus-visible:after:opacity-100`,D?`cursor-nwse-resize`:`cursor-ns-resize`,E&&`after:opacity-100`),"aria-label":y,"aria-controls":F,title:r?`拖动或使用方向键调整大小,双击恢复自动尺寸`:`Drag or use arrow keys to resize. Double-click to restore automatic size.`,onPointerDown:e=>{if(e.button!==0||f)return;let t=document.getElementById(F)?.getBoundingClientRect();t&&(e.currentTarget.focus({preventScroll:!0}),e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),b.current={pointer:e.pointerId,x:e.clientX,y:e.clientY,width:Math.round(t.width),height:Math.round(t.height),before:i},p(a.id))},onPointerMove:e=>{let t=b.current;if(t?.pointer!==e.pointerId)return;let n=t.before.sizes[a.id],r=e.clientX-t.x,i=e.clientY-t.y;L(a.id,{width:D&&r!==0?Kt(t.width+r,Bt,S):n?.width,height:i===0?n?.height:Kt(t.height+i,Vt,Ht)})},onPointerUp:()=>z(a,!1),onPointerCancel:()=>z(a,!0),onLostPointerCapture:()=>z(a,!0),onDoubleClick:()=>R(a),onKeyDown:e=>{if(e.key===`Escape`&&E){e.preventDefault();let t=b.current?.pointer;z(a,!0),t!==void 0&&e.currentTarget.hasPointerCapture(t)&&e.currentTarget.releasePointerCapture(t);return}if(e.key===`Home`||e.key===`Enter`||e.key===` `){e.preventDefault(),R(a);return}let t=e.key===`ArrowLeft`||e.key===`ArrowRight`,n=e.key===`ArrowUp`||e.key===`ArrowDown`;if((!t||!D)&&!n)return;let o=document.getElementById(F)?.getBoundingClientRect();if(!o)return;e.preventDefault();let s=e.key===`ArrowLeft`||e.key===`ArrowUp`?-16:16;h(i),L(a.id,{width:t?Kt((w??o.width)+s,Bt,S):C?.width,height:n?Kt((T??o.height)+s,Vt,Ht):C?.height}),_(r?`已调整「${a.label}」大小`:`Resized ${a.label}`)}})]}):null]},a.id)})),U.map(e=>(0,Q.jsx)(`div`,{"data-workbench-item":e,className:q(`grid min-h-16 place-items-center rounded-xl border border-dashed border-edge-strong text-xs text-fg-muted`,O&&`absolute`,u?.lane===e&&!u.anchor&&`border-accent bg-accent-soft text-accent-fg`),style:O?H.get(e):void 0,onDragOver:t=>N(t,{lane:e}),onDrop:t=>M(t,{lane:e}),onDragLeave:()=>d(t=>t?.lane===e&&!t.anchor?void 0:t),children:B[Mt.indexOf(e)]},e))]})]})}function Jt(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var Yt=`xopc-home-read-deliveries`,Xt=`min-w-0 rounded-xl bg-surface-panel`,Zt=`text-base font-semibold tracking-tight text-fg`,Qt=`@min-[54rem]/workbench:grid-cols-[minmax(0,1fr)_minmax(19rem,0.57fr)]`;function $t(){try{let e=JSON.parse(localStorage.getItem(Yt)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,300):[]}catch{return[]}}function en(){let e=(0,Ge.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(J,{className:`h-56 rounded-xl`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`grid items-start gap-6 ${Qt}`,"aria-busy":!0,children:[(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[t,(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(J,{className:`h-5 w-28 rounded-md`}),(0,Q.jsx)(J,{className:`h-24 rounded-xl`})]})]}),(0,Q.jsx)(J,{className:`h-44 rounded-xl`})]}),e[1]=n):n=e[1],n}function tn(e){let t=(0,Ge.c)(91),{item:n,busy:r,primary:i,dueLabel:o,failureLabel:s,locale:c,onAction:l,onComplete:u,onUpdated:d}=e,[p,m]=a(),h;t[0]===n.openAction?h=t[1]:(h=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=h);let g=h,_=n.primaryAction?.type===`task_review`?n.primaryAction.taskId:g?decodeURIComponent(g[1]):void 0,v;t[2]!==_||t[3]!==p?(v=_&&p.get(`reviewTask`)===_,t[2]=_,t[3]=p,t[4]=v):v=t[4];let y=!!v,b;t[5]!==_||t[6]!==p||t[7]!==m?(b=e=>{let t=new URLSearchParams(p);e&&_?t.set(`reviewTask`,_):t.delete(`reviewTask`),m(t)},t[5]=_,t[6]=p,t[7]=m,t[8]=b):b=t[8];let x=b,[S,C]=(0,Z.useState)(!1),w;t[9]===c?w=t[10]:(w=f(c),t[9]=c,t[10]=w);let T=w.projectsPage.home.workbench,E=n.primaryAction?.type===`connector_decision`,D;t[11]!==o||t[12]!==n.dueAt||t[13]!==c?(D=n.dueAt===void 0?null:`${o} ${Le(n.dueAt,c)}`,t[11]=o,t[12]=n.dueAt,t[13]=c,t[14]=D):D=t[14];let O=D,k;t[15]!==E||t[16]!==n.summary?(k=E?n.summary.split(`
|
|
8
|
-
`)[0]:n.summary,t[15]=E,t[16]=n.summary,t[17]=k):k=t[17];let A;t[18]!==n.projectName||t[19]!==k?(A=[n.projectName,k].filter(Boolean),t[18]=n.projectName,t[19]=k,t[20]=A):A=t[20];let j=A.join(` · `),M=!!(_&&(n.primaryAction?.type===`task_review`||n.primaryAction?.type===`open`)),N;t[21]!==n.id||t[22]!==n.openAction||t[23]!==n.title||t[24]!==l?(N=n.openAction?(0,Q.jsx)(`button`,{type:`button`,className:`touch-target min-w-0 break-words rounded-sm text-left text-sm font-semibold text-fg hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,onClick:()=>l(n.openAction,n.id),children:n.title}):(0,Q.jsx)(`span`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[21]=n.id,t[22]=n.openAction,t[23]=n.title,t[24]=l,t[25]=N):N=t[25];let P;t[26]!==O||t[27]!==s||t[28]!==n.kind?(P=O||n.kind===`failure`?(0,Q.jsx)(`span`,{className:`rounded-md bg-warning-soft px-1.5 py-0.5 text-xs text-fg-muted`,children:O??s}):null,t[26]=O,t[27]=s,t[28]=n.kind,t[29]=P):P=t[29];let F;t[30]!==N||t[31]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[N,P]}),t[30]=N,t[31]=P,t[32]=F):F=t[32];let I;t[33]===j?I=t[34]:(I=(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 break-words text-xs leading-5 text-fg-muted`,children:j}),t[33]=j,t[34]=I);let L;t[35]!==F||t[36]!==I?(L=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-52`,children:[F,I]}),t[35]=F,t[36]=I,t[37]=L):L=t[37];let R;t[38]!==n.primaryAction?.type||t[39]!==c||t[40]!==y||t[41]!==_||t[42]!==x?(R=_&&n.primaryAction?.type===`retry_task`?(0,Q.jsx)(X,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,"aria-expanded":y,onClick:()=>x(!y),children:c===`zh`?`查看结果与依据`:`View result and evidence`}):null,t[38]=n.primaryAction?.type,t[39]=c,t[40]=y,t[41]=_,t[42]=x,t[43]=R):R=t[43];let z;t[44]!==E||t[45]!==r||t[46]!==M||t[47]!==n.id||t[48]!==n.primaryAction||t[49]!==l||t[50]!==i||t[51]!==y||t[52]!==S||t[53]!==x||t[54]!==T?(z=n.primaryAction?(0,Q.jsx)(X,{type:`button`,variant:i?`primary`:`tonal`,className:`min-h-9 shrink-0 rounded-lg px-3 text-xs sm:shadow-none`,disabled:r,"aria-expanded":E?S:M?y:void 0,onClick:()=>{E?C(rn):M?x(!y):l(n.primaryAction,n.id)},children:E?T.viewScope:n.primaryAction.label}):null,t[44]=E,t[45]=r,t[46]=M,t[47]=n.id,t[48]=n.primaryAction,t[49]=l,t[50]=i,t[51]=y,t[52]=S,t[53]=x,t[54]=T,t[55]=z):z=t[55];let B;t[56]!==R||t[57]!==z?(B=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[R,z]}),t[56]=R,t[57]=z,t[58]=B):B=t[58];let V;t[59]!==L||t[60]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[L,B]}),t[59]=L,t[60]=B,t[61]=V):V=t[61];let H;t[62]!==E||t[63]!==r||t[64]!==n.id||t[65]!==n.primaryAction||t[66]!==n.secondaryActions||t[67]!==n.summary||t[68]!==l||t[69]!==S?(H=E&&S?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2 rounded-lg bg-surface-inset px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-fg-muted`,children:n.summary}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(X,{variant:`primary`,disabled:r,onClick:()=>l(n.primaryAction,n.id),children:n.primaryAction?.label}),n.secondaryActions.map(e=>(0,Q.jsx)(X,{disabled:r,onClick:()=>l(e,n.id),children:e.label},e.label))]})]}):null,t[62]=E,t[63]=r,t[64]=n.id,t[65]=n.primaryAction,t[66]=n.secondaryActions,t[67]=n.summary,t[68]=l,t[69]=S,t[70]=H):H=t[70];let U;t[71]!==E||t[72]!==r||t[73]!==M||t[74]!==n.id||t[75]!==n.secondaryActions||t[76]!==l?(U=!E&&!M&&n.secondaryActions.length?(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:n.secondaryActions.filter(nn).map(e=>(0,Q.jsx)(X,{variant:`ghost`,disabled:r,onClick:()=>l(e,n.id),children:e.label},e.label))}):null,t[71]=E,t[72]=r,t[73]=M,t[74]=n.id,t[75]=n.secondaryActions,t[76]=l,t[77]=U):U=t[77];let W;t[78]!==c||t[79]!==u||t[80]!==d||t[81]!==y||t[82]!==_||t[83]!==x?(W=y&&_?(0,Q.jsx)(ze,{taskId:_,language:c,onUpdated:d,onComplete:()=>{x(!1),u()}},_):null,t[78]=c,t[79]=u,t[80]=d,t[81]=y,t[82]=_,t[83]=x,t[84]=W):W=t[84];let G;return t[85]!==r||t[86]!==V||t[87]!==H||t[88]!==U||t[89]!==W?(G=(0,Q.jsxs)(`article`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,"aria-busy":r,children:[V,H,U,W]}),t[85]=r,t[86]=V,t[87]=H,t[88]=U,t[89]=W,t[90]=G):G=t[90],G}function nn(e){return e.type!==`open`}function rn(e){return!e}function an(e){let t=(0,Ge.c)(40),{item:n,onAction:r,language:i,onUpdated:a}=e,[o,s]=(0,Z.useState)(!1),c;t[0]===n.openAction?c=t[1]:(c=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=c);let l=c,u=l?decodeURIComponent(l[1]):void 0,d;t[2]!==n.backgroundState||t[3]!==n.kind?(d=n.kind===`scheduled`?(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":!0}):n.backgroundState===`paused`?(0,Q.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full bg-fg-subtle`,"aria-hidden":!0}),t[2]=n.backgroundState,t[3]=n.kind,t[4]=d):d=t[4];let f=d,p=!n.openAction,m=u?o:void 0,h;t[5]!==n.id||t[6]!==n.openAction||t[7]!==r||t[8]!==u?(h=()=>u?s(on):n.openAction&&r(n.openAction,n.id),t[5]=n.id,t[6]=n.openAction,t[7]=r,t[8]=u,t[9]=h):h=t[9];let g;t[10]===f?g=t[11]:(g=(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:f}),t[10]=f,t[11]=g);let _;t[12]===n.title?_=t[13]:(_=(0,Q.jsx)(`span`,{className:`block line-clamp-2 break-words text-sm font-medium text-fg`,children:n.title}),t[12]=n.title,t[13]=_);let v;t[14]!==n.kind||t[15]!==n.summary||t[16]!==n.updatedAt||t[17]!==i?(v=n.kind===`scheduled`?(0,Q.jsx)(`time`,{className:`block text-xs text-fg-muted`,dateTime:new Date(n.updatedAt).toISOString(),children:Le(n.updatedAt,i)}):(0,Q.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:n.summary}),t[14]=n.kind,t[15]=n.summary,t[16]=n.updatedAt,t[17]=i,t[18]=v):v=t[18];let y;t[19]!==_||t[20]!==v?(y=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[_,v]}),t[19]=_,t[20]=v,t[21]=y):y=t[21];let b;t[22]!==o||t[23]!==n.openAction?(b=n.openAction?(0,Q.jsxs)(`span`,{className:`flex max-w-[35%] shrink-0 items-center gap-1 text-right text-xs leading-4 text-fg-muted group-hover:text-fg`,children:[(0,Q.jsx)(`span`,{children:n.openAction.label}),(0,Q.jsx)(w,{className:o?`size-3.5 shrink-0 rotate-90`:`size-3.5 shrink-0`,"aria-hidden":!0})]}):null,t[22]=o,t[23]=n.openAction,t[24]=b):b=t[24];let S;t[25]!==b||t[26]!==p||t[27]!==m||t[28]!==h||t[29]!==g||t[30]!==y?(S=(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-12 w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left motion-safe:transition-colors enabled:hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent`,disabled:p,"aria-expanded":m,onClick:h,children:[g,y,b]}),t[25]=b,t[26]=p,t[27]=m,t[28]=h,t[29]=g,t[30]=y,t[31]=S):S=t[31];let C;t[32]!==o||t[33]!==i||t[34]!==a||t[35]!==u?(C=u&&o?(0,Q.jsx)(ze,{taskId:u,language:i,onUpdated:a,onComplete:()=>s(!1)}):null,t[32]=o,t[33]=i,t[34]=a,t[35]=u,t[36]=C):C=t[36];let T;return t[37]!==S||t[38]!==C?(T=(0,Q.jsxs)(`div`,{children:[S,C]}),t[37]=S,t[38]=C,t[39]=T):T=t[39],T}function on(e){return!e}function sn(){let e=u(e=>e.language),t=f(e),n=t.projectsPage,r=Se(e),i=s(),a=o(),l=ke(e=>e.setPageHeader),d=ke(e=>e.clearPageHeader),[x,E]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(!1),{home:k,loading:A,loadError:j,setLoadError:M,load:P}=Ke(e,a.key,!0),I=n.home.workbench,L=(0,Z.useRef)(null),[B,H]=(0,Z.useState)(null),[W,K]=(0,Z.useState)($t),q=(0,Z.useRef)(null),[J,te]=(0,Z.useState)(!1),[Y,ne]=(0,Z.useState)(!1),[re,ie]=(0,Z.useState)(``),ce=(0,Z.useRef)(!1),[le,ue]=(0,Z.useState)(),[ge,_e]=(0,Z.useState)(!1),[ve,ye]=(0,Z.useState)(null),[be,xe]=(0,Z.useState)(!1),[we,Te]=(0,Z.useState)(),[Ae,Me]=(0,Z.useState)(!1),[Ne,ze]=(0,Z.useState)(0),[Be,Ve]=(0,Z.useState)(),[He,Ue]=(0,Z.useState)(),[We,Ge]=(0,Z.useState)(!1),$=Pe({chat:t.chat}),Je=(0,Z.useRef)(null),Ye=Oe({disabled:We,chat:t.chat,onTranscript:e=>{ie(t=>Ce(t,e)),window.setTimeout(()=>Je.current?.focus(),0)}}),{phase:Xe,voiceActive:Ze,startVoiceInput:Qe,cancelVoiceInput:$e,confirmVoiceInput:et,retryVoiceInput:nt}=Ye;(0,Z.useEffect)(()=>{if(!Be)return;let e=window.setTimeout(()=>Ve(void 0),8e3);return()=>window.clearTimeout(e)},[Be]);let rt=(0,Z.useCallback)(async e=>{if(!(e.length===0||We)){Ge(!0);try{await $.processFiles(e)}finally{Ge(!1)}}},[We,$.processFiles]),it=(0,Z.useCallback)(async e=>{let t=Ee(e.clipboardData);t.length!==0&&(e.preventDefault(),await rt(t))},[rt]),at=(0,Z.useCallback)(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,$.setIsDragging(!0))},[$.setIsDragging]),ot=(0,Z.useCallback)(e=>{let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&$.setIsDragging(!1)},[$.setIsDragging]),st=(0,Z.useCallback)(async e=>{e.preventDefault(),$.setIsDragging(!1),await rt(Array.from(e.dataTransfer.files))},[$.setIsDragging,rt]),ct=(0,Z.useCallback)(e=>{e.preventDefault();let t=$.wireAttachmentsPayload(),n=t.length>0?De(t):void 0,r=je(re,n,{projectScope:`none`});r&&(ne(!1),ie(``),$.clearAttachments(),i(r))},[$.clearAttachments,$.wireAttachmentsPayload,re,i]),lt=$.attachments.length>=10,ut={attachTitle:lt?Jt(t.chat.maxAttachmentsReached,{max:10}):`${t.chat.attachFile} (${$.attachments.length}/10)`,dropFiles:t.chat.dropFiles,intentLabel:r.intentLabel,intentPlaceholder:r.intentPlaceholder,intentSuggestion:r.intentSuggestion,shortcut:n.home.submitShortcut,submit:r.newWork},dt=(0,Z.useMemo)(()=>({label:n.home.advisorStatusLabel,ready:n.home.advisorStatusReady,clarification:n.home.advisorStatusClarification,refreshing:n.home.advisorStatusRefreshing,refreshingDetail:n.home.advisorRefreshing,idle:n.home.advisorStatusIdle,idleDetail:n.home.advisorUnavailableTitle,generationFailed:n.home.advisorStatusGenerationFailed,budgetExhausted:n.home.advisorStatusBudgetExhausted,modelUnavailable:n.home.advisorStatusModelUnavailable,generationFailedDetail:n.home.advisorGenerationFailed,budgetExhaustedDetail:n.home.advisorBudgetExhausted,modelUnavailableDetail:n.home.advisorModelUnavailable,history:n.home.advisorHistory,retry:n.home.retry,findAnother:n.home.advisorRefresh}),[n.home]),ft=(k?.recentDeliveries??[]).map(e=>W.includes(e.id)?{...e,read:!0}:e),pt=Date.now(),mt=ft.filter(e=>!e.read&&e.completedAt>=pt-10080*6e4),ht=k?.resumable??[],gt=(k?.needsUser.length??0)+(k?.attentionPolicy?.suppressedAttentionCount??0)+(k?.attentionPolicy?.suppressedDecisionCount??0),vt=new Date(pt);vt.setHours(24,0,0,0);let yt=k?.needsUser.filter(e=>e.dueAt!==void 0&&e.dueAt>=pt&&e.dueAt<vt.getTime()).length??0,bt=k?.background??[],St=bt.filter(e=>e.kind!==`scheduled`),Ct=bt.filter(e=>e.kind===`scheduled`),wt=k?.advisor.state===`ready`||k?.advisor.state===`clarification`||!!we;(0,Z.useEffect)(()=>{if(!we)return;let e=window.setTimeout(()=>Te(void 0),8e3);return()=>window.clearTimeout(e)},[we]);let Tt=k?gt>0?`attention`:mt.length>0?`delivery`:ht.length>0||St.length>0||k.runningConversations?.length||wt?`resume`:`idle`:void 0,Dt=Tt===`idle`,Ot=Dt&&!Y,jt=Ot||Y,Mt=(0,Z.useRef)(Tt),Nt=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{let e=Mt.current;if(Mt.current=Tt,!e||!Tt||Tt===e||(Nt.current&&(Nt.current=!1,document.activeElement===document.body&&L.current?.focus({preventScroll:!0})),window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches))return;let t=L.current?.animate?.([{opacity:.7,transform:`translateY(4px)`},{opacity:1,transform:`translateY(0)`}],{duration:180,easing:`ease-out`});return()=>t?.cancel()},[Tt]),(0,Z.useEffect)(()=>{let e=e=>{(e.key===Yt||e.key===null)&&K($t())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let Pt=(0,Z.useCallback)(e=>{K(t=>[...new Set([e,...t])].slice(0,300));try{localStorage.setItem(Yt,JSON.stringify([...new Set([e,...$t()])].slice(0,300)))}catch{}},[]);(0,Z.useEffect)(()=>{!jt&&Ze&&$e()},[$e,jt,Ze]),(0,Z.useEffect)(()=>{let e=e=>{let t=e.detail?.target;t&&t!==`chat`||!jt||We||(e.preventDefault(),Xe===`recording`?et():Xe===`idle`?(Je.current?.focus(),Qe()):Xe===`error`&&nt())},t=e=>{let t=e.detail?.target;t&&t!==`chat`||!jt||!Ze||(e.preventDefault(),$e(),Je.current?.focus())};return window.addEventListener(Ie,e),window.addEventListener(Fe,t),()=>{window.removeEventListener(Ie,e),window.removeEventListener(Fe,t)}},[We,$e,jt,et,nt,Qe,Ze,Xe]);let Ft=(0,Z.useCallback)(e=>{e||$e(),ne(e)},[$e]),It=(0,Z.useCallback)((t,n)=>{if(t.type===`open`){i(F(`/`,t.href));return}if(t.type===`task_review`||ce.current)return;ce.current=!0,ye(n);let r=k?.needsUser.findIndex(e=>e.id===n)??-1,a=r<0?void 0:{item:k?.needsUser[r],slot:r};ue(void 0),M(null),(async()=>{try{if(t.type===`retry_task`)await Re(t.taskId,e),ue({...a,message:e===`zh`?`任务已重新开始,可查看执行进度。`:`Task restarted. View progress.`,href:F(`/`,`/tasks/${encodeURIComponent(t.taskId)}`)});else if(t.type===`connector_decision`)await he({kind:`connector_approval`,approvalId:t.approvalId},t.decision),ue({...a,message:e===`zh`?t.decision===`approve`?`已批准授权,任务状态将自动更新。`:`已拒绝授权。`:t.decision===`approve`?`Permission approved. Task status will update.`:`Permission denied.`});else if(t.type===`retry_run`){let n=await oe({kind:t.subjectKind,runId:t.runId});ue({...a,message:e===`zh`?`已发起重试,可查看新的执行结果。`:`Retry started. Follow the new execution.`,href:n.conversationId?`/chat/${encodeURIComponent(n.conversationId)}`:`/automations?run=${encodeURIComponent(n.runId)}`})}else t.type===`acknowledge_run`&&(await fe({kind:t.subjectKind,runId:t.runId}),ue({...a,message:e===`zh`?`已确认此异常,已从待处理事项移除。`:`Issue acknowledged and removed from pending items.`}));Nt.current=!0,await P()}catch(e){M(e instanceof Error?e.message:String(e))}finally{ce.current=!1,ye(null)}})()},[k,e,P,i]),Lt=(0,Z.useCallback)((t,n)=>{let r=t.task.phase===`closed`&&t.task.resolution===`done`?de(t):void 0;r&&Pt(`task:${r.runId}`),Nt.current=!0;let i=n?k?.needsUser.findIndex(e=>e.id===n.id):void 0;ue({item:n,slot:i,message:e===`zh`?t.task.phase===`closed`?`任务已验收完成。`:`操作已保存,任务状态已更新。`:t.task.phase===`closed`?`Task accepted.`:`Action saved. Task status updated.`,href:F(`/`,`/tasks/${encodeURIComponent(t.task.id)}`)}),P()},[k,e,P,Pt]),Rt=(0,Z.useCallback)(()=>{xe(!0),Te(void 0),Ue(void 0),M(null),pe(e).then(()=>P()).catch(e=>M(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[e,P]),zt=(0,Z.useCallback)((e,t)=>{xe(!0),M(null),se(e,t).then(async t=>{if(t.outcome===`needs_setup`){Ue({opportunityId:e.id,value:t.preflight});return}if(Ue(void 0),ze(e=>e+1),t.outcome===`task`){Te({title:n.home.advisorStartedTitle,detail:Jt(n.home.advisorStartedDetail,{title:e.title}),href:F(`/`,t.href)}),await P();return}i(t.href)}).catch(e=>M(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[P,i,n.home.advisorStartedDetail,n.home.advisorStartedTitle]),Bt=(0,Z.useCallback)((e,t)=>{xe(!0),Te(void 0),Ue(void 0),M(null),ae(e,{kind:t,snoozedUntil:t===`too_early`?Date.now()+4320*6e4:void 0}).then(({idempotencyKey:t})=>(Ve({opportunityId:e.id,idempotencyKey:t}),ze(e=>e+1),P())).catch(e=>M(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[P]),Vt=(0,Z.useCallback)(()=>{if(!Be)return;let e=Be;Ve(void 0),xe(!0),M(null),me(e.opportunityId,e.idempotencyKey).then(()=>(ze(e=>e+1),P())).catch(t=>{Ve(e),M(t instanceof Error?t.message:String(t))}).finally(()=>xe(!1))},[Be,P]),Ht=(0,Z.useCallback)((e,t)=>{i(`/chat/new?${new URLSearchParams({draft:`${e}\n\n${t}`}).toString()}`)},[i]),Ut=e=>{q.current=document.activeElement instanceof HTMLElement?document.activeElement:null,H(e)},Wt=e=>{Pt(e.id),H(null),ue({message:I.deliverySaved}),P()},Gt=x?k?.needsUser??[]:k?.needsUser.slice(0,2)??[],Kt=gt-Gt.length,Qt=le?.item&&!k?.needsUser.some(e=>e.id===le.item?.id)&&(le.slot??1/0)<2?le.item:void 0,nn=[...Gt];Qt&&nn.splice(le?.slot??0,0,Qt);let rn=(k?.runningConversations??[]).map(t=>({id:t.runId,kind:`running`,title:t.title??(e===`zh`?`对话正在执行`:`Conversation in progress`),summary:I.inProgress,updatedAt:t.updatedAt,secondaryActions:[],openAction:{type:`open`,label:I.inProgress,href:`/chat/${encodeURIComponent(t.conversationId)}`}})),on=[...St,...rn].sort((e,t)=>t.updatedAt-e.updatedAt),sn=Tt===`attention`&&!we&&!J,cn=k?.advisor.state===`ready`?k.advisor.primary.title:k?.advisor.state===`clarification`?k.advisor.question.question:void 0,ln=mt.length>0?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-delivery-title`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center justify-between gap-x-3 pl-1`,children:[(0,Q.jsx)(`h2`,{id:`home-delivery-title`,className:Zt,children:I.progress}),(0,Q.jsxs)(X,{variant:`ghost`,className:`rounded-lg px-2 text-xs`,onClick:()=>Ut(`history`),children:[I.deliveryHistory,(0,Q.jsx)(b,{className:`size-3.5`,"aria-hidden":!0})]})]}),(0,Q.jsx)(`div`,{className:`${Xt} space-y-1`,"data-workbench-fill":!0,"data-workbench-panel":!0,children:mt.slice(0,Tt===`attention`?1:3).map((t,n)=>(0,Q.jsx)(kt,{item:t,language:e,showNew:!0,primary:Tt===`delivery`&&n===0,onOpen:()=>Ut(t)},t.id))})]}):null,un=[{title:I.inProgress,items:on.filter(e=>!e.backgroundState&&!e.statusLabel)},{title:I.waiting,items:on.filter(e=>e.backgroundState===`waiting`||!e.backgroundState&&e.statusLabel)},{title:I.paused,items:on.filter(e=>e.backgroundState===`paused`)},{title:I.scheduled,items:Ct}].filter(e=>e.items.length>0),dn=Tt===`attention`?1:3,fn=un.length?(0,Q.jsxs)(`section`,{className:Xt,"aria-labelledby":`home-background-title`,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-4 pb-1 pt-4`,children:[(0,Q.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,Q.jsx)(N,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-background-title`,className:Zt,children:I.background})]}),(0,Q.jsxs)(`div`,{className:`px-3 pb-3`,children:[un.map(({title:t,items:n})=>(0,Q.jsxs)(`div`,{className:`pt-3`,children:[(0,Q.jsx)(`h3`,{className:`mb-1 px-2 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{className:`space-y-1`,children:(ge?n:n.slice(0,dn)).map(t=>(0,Q.jsx)(an,{item:t,language:e,onAction:It,onUpdated:Lt},t.id))})]},t)),un.some(({items:e})=>e.length>dn)?(0,Q.jsxs)(X,{variant:`ghost`,className:`mt-2 w-full justify-start rounded-lg px-2 text-xs`,"aria-expanded":ge,onClick:()=>_e(e=>!e),children:[(0,Q.jsx)(C,{className:ge?`size-3.5 rotate-180`:`size-3.5`,"aria-hidden":!0}),e===`zh`?ge?`收起`:`查看全部 ${on.length+Ct.length} 项`:ge?`Show less`:`View all ${on.length+Ct.length} items`]}):null]})]}):null,pn=!k?.observation&&wt,mn=gt>0?(0,Q.jsxs)(`section`,{className:Xt,"aria-labelledby":`home-needs-user-title`,"data-workbench-panel":!0,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-2 px-4 pb-1 pt-4 sm:px-5`,children:[(0,Q.jsx)(`span`,{className:`mr-0.5 grid size-9 shrink-0 place-items-center rounded-lg bg-warning-soft text-fg`,children:(0,Q.jsx)(T,{className:`size-[18px]`,"aria-hidden":!0})}),(0,Q.jsx)(`h2`,{id:`home-needs-user-title`,className:`text-lg font-semibold tracking-tight text-fg sm:text-xl`,children:I.attention}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-inset px-2 py-0.5 text-xs font-semibold tabular-nums text-fg-muted`,"aria-live":`polite`,"aria-label":Jt(n.home.attentionTitle,{count:gt}),children:gt}),yt>0?(0,Q.jsx)(`span`,{className:`ml-auto rounded-md bg-warning-soft px-2 py-1 text-xs text-fg-muted`,children:Jt(I.dueToday,{count:yt})}):null]}),(0,Q.jsxs)(`div`,{className:`space-y-1 pb-2`,children:[nn.map((t,i)=>t===Qt?(0,Q.jsxs)(`div`,{className:`flex min-h-16 items-center justify-between gap-3 px-4 py-3 text-sm text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.title}),(0,Q.jsx)(S,{className:`size-4 shrink-0 text-success`,"aria-label":e===`zh`?`已处理`:`Handled`})]},t.id):(0,Q.jsx)(tn,{item:t,primary:i===0||i===1&&nn[0]===Qt,busy:ve!==null,dueLabel:n.home.dueLabel,failureLabel:r.runAttention,locale:e,onAction:It,onComplete:()=>void P(),onUpdated:e=>Lt(e,t)},t.id)),x||Kt>0?(0,Q.jsx)(`div`,{className:`px-2 py-1.5 sm:px-3`,children:(0,Q.jsxs)(X,{variant:`ghost`,className:`w-full justify-start rounded-lg px-2 text-xs`,"aria-expanded":x,onClick:()=>E(e=>!e),children:[(0,Q.jsx)(C,{className:x?`size-3.5 rotate-180`:`size-3.5`,"aria-hidden":!0}),x?I.collapse:Jt(I.remaining,{count:Kt})]})}):null]})]}):null,hn=k&&(ht.length>0||pn)?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-resume-title`,children:[(0,Q.jsx)(`h2`,{id:`home-resume-title`,className:`flex min-h-9 items-center pl-1 ${Zt}`,children:I.resume}),ht.length>0?(0,Q.jsx)(`div`,{className:`${Xt} space-y-1 p-2`,"data-workbench-fill":!0,"data-workbench-panel":!0,children:ht.slice(0,Tt===`attention`?1:3).map(t=>(0,Q.jsxs)(c,{className:`group flex w-full flex-wrap items-center gap-x-3 gap-y-2 rounded-lg p-2 text-left motion-safe:transition-colors hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent`,to:F(`/`,t.href),children:[(0,Q.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-inset text-fg-muted`,children:t.kind===`task`?(0,Q.jsx)(N,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block break-words text-sm font-semibold text-fg`,children:t.title}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:[t.projectName,t.summary||Jt(I.lastActive,{time:Le(t.updatedAt,e)})].filter(Boolean).join(` · `)})]}),(0,Q.jsxs)(`span`,{className:`flex max-w-[35%] shrink-0 items-center gap-1 text-right text-xs leading-4 text-fg-muted group-hover:text-fg`,children:[t.kind===`task`?I.continueTask:I.continueChat,(0,Q.jsx)(w,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]})]},`${t.kind}:${t.id}`))}):null,!k.observation&&cn&&Tt===`attention`&&!we?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg bg-surface-inset px-3 py-1`,children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(G,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`truncate`,children:[n.home.advisorStatusLabel,` · `,cn]})]}),(0,Q.jsx)(X,{variant:`ghost`,"aria-expanded":J,onClick:()=>te(e=>!e),children:J?I.hideSuggestion:I.viewSuggestion})]}):null,!k.observation&&wt&&!sn?(0,Q.jsx)(tt,{advisor:k.advisor,busy:be,copy:{aiLabel:n.home.advisorAiLabel,why:n.home.advisorWhy,evidence:n.home.advisorEvidence,needsSetup:n.home.advisorNeedsSetup,start:n.home.advisorStart,discuss:n.home.advisorDiscuss,refresh:n.home.advisorRefresh,refreshing:n.home.advisorRefreshing,history:n.home.advisorHistory,viewProgress:n.home.advisorViewProgress,alternatives:n.home.advisorAlternatives,more:I.moreSuggestionActions,feedback:n.home.advisorFeedback,alreadyDone:n.home.advisorAlreadyDone,irrelevant:n.home.advisorIrrelevant,later:n.home.advisorLater,lessLikeThis:n.home.advisorLessLikeThis,sourceIncorrect:n.home.advisorSourceIncorrect,minutes:n.home.advisorMinutes,setupTitle:n.home.advisorSetupTitle,setupHint:n.home.advisorSetupHint,configure:n.home.advisorConfigure,degradedStart:n.home.advisorDegradedStart,automationHint:n.home.advisorAutomationHint,automationAction:n.home.advisorAutomationAction},onRefresh:Rt,onAction:zt,onFeedback:Bt,onClarification:Ht,onOpenHistory:()=>Me(!0),preflight:He,receipt:we}):null]}):null,gn=[{id:`attention`,label:I.attention,lane:`left`,content:mn},{id:`delivery`,label:I.progress,lane:`left`,content:ln},{id:`resume`,label:I.resume,lane:`left`,content:hn},{id:`background`,label:I.background,lane:`right`,content:fn},{id:`observation`,label:e===`zh`?`交给我`:`Let me handle it`,lane:`right`,content:k?.observation?(0,Q.jsx)(_t,{observation:k.observation,advisor:k.advisor,language:e,emphasizeStart:Tt!==`attention`&&Tt!==`delivery`,onUpdated:()=>void P()}):null}].filter(e=>e.content),_n=gn.length>0,vn=e===`zh`?`布局`:`Layout`,yn=e===`zh`?`完成布局`:`Done`,bn=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[k&&!Dt?(0,Q.jsx)(Et,{advisor:k.advisor,busy:be,copy:dt,onOpenHistory:()=>Me(!0),onRefresh:Rt}):null,_n?(0,Q.jsxs)(X,{type:`button`,variant:`ghost`,className:D?`h-9 w-9 gap-1.5 rounded-lg bg-accent-soft p-0 text-accent-fg sm:w-auto sm:px-2.5`:`size-9 rounded-lg p-0`,"aria-label":D?yn:vn,title:D?yn:vn,onClick:()=>O(e=>!e),children:[D?(0,Q.jsx)(S,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),D?(0,Q.jsx)(`span`,{className:`hidden whitespace-nowrap sm:inline`,children:yn}):null]}):null,Dt?null:(0,Q.jsxs)(X,{type:`button`,variant:`primary`,className:`ml-1 h-9 gap-1.5 whitespace-nowrap rounded-lg px-2.5 sm:shadow-none`,onClick:()=>ne(!0),children:[(0,Q.jsx)(V,{className:`size-4 shrink-0`,"aria-hidden":!0}),r.newWork]})]}),[be,dt,_n,r.newWork,yn,D,k,Dt,vn,Rt]);return(0,Z.useLayoutEffect)(()=>(l({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:bn}),()=>d()),[d,bn,l,n.title]),(0,Q.jsxs)(`div`,{className:`@container/workbench mx-auto flex w-full min-w-0 max-w-7xl flex-1 flex-col px-4 pb-8 pt-5 sm:px-6 sm:pt-7 lg:px-8`,children:[(0,Q.jsx)(`input`,{ref:$.fileInputRef,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=e.target.files;t&&rt(Array.from(t)),e.target.value=``}}),(0,Q.jsx)(y,{open:Y,onOpenChange:Ft,children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:r.dialogTitle}),(0,Q.jsx)(m,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r.dialogDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(X,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,children:(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0})})})]}),(0,Q.jsx)(qe,{variant:`dialog`,inputId:`new-conversation-intent`,inputRef:Je,intent:re,labels:{...ut,submit:r.submit},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:We,attachmentsFull:lt,voice:Ye,chat:t.chat,cancelAction:(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(X,{type:`button`,variant:`ghost`,children:n.cancel})}),onIntentChange:ie,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void it(e),onDragOver:at,onDragLeave:ot,onDrop:e=>void st(e),onSubmit:ct})]})]})}),(0,Q.jsx)(xt,{open:Ae,refreshKey:Ne,onOpenChange:Me,onReevaluate:Rt}),j?(0,Q.jsxs)(`div`,{role:`alert`,className:`mb-6 flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:j}),(0,Q.jsx)(X,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void P(),children:n.home.retry})]}):null,(0,Q.jsx)(At,{view:B,items:ft,language:e,onSelect:H,onClose:()=>H(null),onRead:Wt,onOpenFull:e=>{H(null),i(F(`/`,e.href))},onRestoreFocus:()=>{(q.current?.isConnected?q.current:L.current)?.focus({preventScroll:!0})}}),(0,Q.jsx)(`div`,{role:`status`,children:le?(0,Q.jsxs)(`div`,{className:`mb-3 flex w-full flex-wrap items-center justify-between gap-2 rounded-lg bg-success-soft px-3 py-1.5 text-xs text-fg`,children:[(0,Q.jsx)(`span`,{children:le.message}),le.href?(0,Q.jsx)(X,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>i(le.href),children:e===`zh`?`查看进展与结果`:`View progress and result`}):null]}):null}),A?(0,Q.jsx)(en,{}):k?(0,Q.jsxs)(`div`,{ref:L,tabIndex:-1,className:`flex min-h-0 w-full flex-1 flex-col gap-4 outline-none`,children:[gt===0?(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,"aria-live":`polite`,children:I.noAttention}):null,Ot?(0,Q.jsxs)(`section`,{className:`mx-auto flex w-full max-w-[640px] flex-1 flex-col justify-center pb-12 pt-10 text-center sm:pb-20 sm:pt-16`,children:[(0,Q.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:I.startTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:I.startHint}),(0,Q.jsx)(qe,{variant:`inline`,inputId:`home-conversation-intent`,inputRef:Je,intent:re,labels:{...ut,intentPlaceholder:I.startExample},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:We,attachmentsFull:lt,voice:Ye,chat:t.chat,onIntentChange:ie,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void it(e),onDragOver:at,onDragLeave:ot,onDrop:e=>void st(e),onSubmit:ct}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:[(0,Q.jsxs)(X,{variant:`ghost`,onClick:()=>window.dispatchEvent(new Event(`open-command-palette`)),children:[(0,Q.jsx)(U,{className:`size-4`,"aria-hidden":!0}),I.findWork]}),(0,Q.jsx)(X,{variant:`ghost`,onClick:()=>Ut(`history`),children:I.deliveryHistory})]})]}):null,(0,Q.jsx)(qt,{cards:gn,editing:D,language:e}),!Dt&&!ln&&ft.length>0?(0,Q.jsx)(X,{variant:`ghost`,className:`self-start px-2 text-xs`,onClick:()=>Ut(`history`),children:I.deliveryHistory}):null]}):null,Be?(0,Q.jsxs)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 z-[100] flex -translate-x-1/2 items-center gap-4 rounded-lg border border-edge bg-surface-overlay px-4 py-3 text-sm text-fg shadow-float`,children:[(0,Q.jsx)(`span`,{children:n.home.advisorFeedbackSaved}),(0,Q.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:Vt,children:n.home.advisorUndo})]}):null]})}export{sn as HomePage};
|