@xopcai/xopc 0.0.425 → 0.0.426
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CMw8qBuC.js → activity-store-D_DXNHba.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-JI0YWOIm.js → agent-avatar-dicebear-CjaQxFQt.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-YqmwzOSa.js → agent-avatar-display-6Z4m31Fz.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DlvjxWg6.js → agent-defaults-settings-panel-Dne9A10p.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-OBueuQSc.js → agent-plugin-dialog-BoHL-b1o.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Cp6_5OOQ.js → agents-CIiIlVBp.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DLnmdC1h.js → agents-admin-api-u5c3GREg.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Boc-CVh7.js → api-C3Tp9MkF.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bL7sxjAF.js → api-CRT9ZyH0.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-jIG5i7KE.js → app-management-settings-panel-C8yc3yHG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BnaQW9Xd.js → appearance-settings-BELgtR3O.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C2WKUwtN.js → apps-page-vgS1CHDj.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DjboG3kA.js → archive-plugin-BCQnOkV8.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-CZqL9l_d.js → automation-api-hRsGx-qe.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DRd-X_Ai.js → automation-result-state-CMfVTv_i.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-wbnR5i6N.js → automation-task-card-MnzgyTVA.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-HyBQIfmn.js → automations-page-CdIPdwF0.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D6cTOKr7.js → automations-workspace-C3xZLafX.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-Bg8ARZUH.js → binary-plugins-CIB5cbvQ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DKohqFAW.js → block-editor-BQtTLe6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-YeibTzw4.js → browser-automation-inputs-DeraGZ1y.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BWNcbuz2.js → browser-automations-page-SpPzRNqU.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-CDeuxy2x.js → browser-control-api-CbbPvhHR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-L0nBjfhG.js → browser-settings-page-BD1uF_Nb.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-aT-QjNTl.js → capabilities-BGE6hiUE.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BcQa8c9n.js → capabilities-DLMuj21P.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DlpuHdHi.js → capabilities-page-Bda4mSdf.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-pvqkN2-2.js → capabilities-settings-panel-B2B7no22.js} +2 -2
- package/dist/gateway/static/root/assets/{channels-BUPtawh6.js → channels-NtsjZThx.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-B8JO6Tcj.js → chat-agents-api-D8YS5amE.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DRtuFfF1.js → chat-chart-block-DCzUECct.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-BnOCCAXG.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Dkqq5FSL.js → chat-terminal-dock-Dl-OTkJI.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-qujvNqkK.js → command-palette-api-Dijix7V6.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CYIhcczq.js → composer-payload-handoff-CQc-VTaL.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-8q4hRmoo.js → computer-settings-page-B-lGMimW.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-CcXe9kz5.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-DQaTI21R.js → connector-service-page-C8InhrMt.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BjypBp2g.js → connectors-api-DEJU8mgn.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Lf1ZzaVn.js → connectors-page-Ci0L2How.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D_PSHGpe.js → date-picker-kqic8j73.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-UqKVJ9dv.js → dependency-picker-cbC6-2Ya.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-1Et9VqkM.js → desktop-pet-DFNehTtd.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-rADKU0FX.js → desktop-pet-narrative-ChwjpnsG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-0fCGgaG7.js → desktop-pet-settings-BDS7_tQ_.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-TTj_djD8.js → dev-view-store-CeZZLOc6.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-ByEL5lvM.js → device-pairing-wizard-_3BJFWVQ.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C07a7wYX.js → directory-picker-path-field-Di0h3ws4.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-BFqKm9ky.js → discussion-annotation-sync-ClKEyXmN.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DFaVlqas.js → extension-debug-page-DwB5KMGk.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-BfzPfXBq.js → extension-iframe-host-Cqg1K70e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ow0K1Y4_.js → extension-marketplace-api-DRBszrCR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CrDADV5W.js → extension-page-DyrQtG82.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-mnRoa63o.js → extension-provider-C_uKqJxP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BLl02GFY.js → extension-settings-page-BAMQHzkX.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-TGdKqhCf.js → file-preview-surface-DfkXvFnc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DfPQIHOL.js → gateway-config-swr-BOCt_zOo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-67vWg_M2.js → gateway-realtime-BL_Cf0OQ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BHBOPF_q.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CLtR2wkL.js → gateway-restart-CHf8qY7H.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-COvC3r-l.js → gateway-settings-uAboiElC.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-9YQllbw2.js → gateway-startup-retry-CvkJYurV.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DYMRjGvd.js → global-defaults-api-BWMbKu72.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-k9LFXcVa.js → home-page-D6pCBY1V.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-Dzydfvy8.js → image-generation-api-CQxZSTWA.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Csd_YZXZ.js → imports-page-C90644id.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cc41XQid.css +1 -0
- package/dist/gateway/static/root/assets/{index-DKW7BeT_.js → index-CnOYR6jq.js} +5 -5
- package/dist/gateway/static/root/assets/{install-connector-dialog-CTQAKTPv.js → install-connector-dialog-BuNXON0P.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B201bMIa.js → keyboard-shortcuts-settings-CbeubKe1.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CD_8_gd_.js → local-app-workbench-page-CP-BkbB6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BOwqNH0L.js → local-apps-page-C6zFgwkr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DjmK-SM9.js → local-session-drafts-BJ1B1dQ7.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Bg_XR36n.js → locale-store-Br7IfbXK.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-gw3E9CMQ.js → logs-page-CpVCvAWE.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-t_Z2mCyw.js → management-settings-I-pXv4ML.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BUpXJUPv.js → markdown-view-DrVAMlwc.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-_shnaEMY.js → media-plugins-Ba6vUE4J.js} +1 -1
- package/dist/gateway/static/root/assets/messages-ByFlEbsu.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-a7PIT1Lk.js → model-selector-CXcxc30J.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-KOJC3z6Q.js → models-hub-cache-Bd-fYUrV.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BsHYUFgk.js → note-detail-panel-CbpLXAVh.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-cLGiF8oU.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BSmikUKI.js → notes-api-CUlhTRv0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CA0NRL8O.js → notes-page-eoKX85K5.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-D2t9HXoC.js → oauth-api-DMMdeaNd.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-DGGGGtcB.js → oauth-provider-connect-C8BXow79.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BH54VO0V.js → page-context-capture-button-CBFK41OS.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-BS5y8Cx9.js → page-context-draft-LF33STHC.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Du44NIEJ.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-D8DtpDTa.js → personal-avatar-D6CzIIfo.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-KJezmTKP.js → personal-page-CXR1Gy0x.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-9uDaNJy5.js → personal-settings-panel-DnYapLo7.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DLYrI0C4.js → phone-dependencies-card-DBiKtzwz.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BbA2iI-3.js → phone-model-picker-BmSxEr7M.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-Cg_BPss4.js → phone-settings-page-vg65qilc.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CVDk80Bf.js → phone-workspace-store-SN7hfddU.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-DgibLkc3.js → plugin-details-dialog-B3Hn2cbx.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BVoN-lAv.js → preference-select-fields-Cu_ZC9Up.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DCo90zGh.js → product-automation-feedback-Tn2dUJWM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-OWl8IAoY.js → product-open-page-Nf-Oqf1h.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-Cjas7UNe.js → product-preview-content-D6NwUm3A.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-CPWRvBI9.js → product-preview-modal-BfNcGgXA.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-B_HlZux_.js → project-detail-page-Ch-ZMyTu.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-Ba02SFzB.js → project-understanding-B1BK7Ixi.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CdfKjp95.js → projects-page-B7cetxao.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-rwQ4LWzr.js → providers-api-DOnNfkwQ.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BSmvRrZQ.js → recording-upload-RAhaLUcQ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-Vy7LfH6E.js → registry-api-DFDvOTg4.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-UXrnpGev.js → remote-access-hub-DWsOWetc.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-f9OzSi4W.js → resource-unavailable-TQcRCpAg.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-BtObM-co.js → route-preload-Zc5Z3fNv.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-Bt8t37z5.js → runtime-tools-api-9o3Wfji1.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DU4UXnBm.js → runtime-tools-settings-panel-BGiXeHF5.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-CuYsRcBB.js → service-recommendation-list-BEnNx0u7.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DJI9eSgw.js → session-api-Bs3r_d2_.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-CtKgACGl.js → session-manager-ChUtTAoG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BAsKzRHt.js → sessions-page-Bt52kBvJ.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BI4DMz4_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BxUuF_yi.js → settings-advanced-section-CURRjsLK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CaoRh2gt.js → settings-mode-store-CiRpsdTJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-qQ8-6dJ_.js → settings-page-GtsbT6as.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-CyUHrn7c.js → settings-page-header-DBL0_u0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DGVqXrlp.js → settings-page-layout-IAvpbz4A.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BpaPb625.js → setup-status-panel-A6uMpGRy.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-CQJ6Ykm2.js → share-link-dialog-D1otGSXD.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Cem96FbB.js → share-preview-page-L9KYu8M7.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-Dowes16l.js → shares-api-D8Q-m46d.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DZEkZDR0.js → shares-settings-Bmfadz8A.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-D8ZwFEVe.js → skill-api-uKU4sRiv.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-B4gp00-f.js → skill-list-api-BzKzG-xG.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClmaaDXo.js → skill-reload-api-DkUXekcd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-CV0X9rvG.js → skills-page-BZklXTX9.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-D095uacX.js → system-settings-panel-CsvcFoaJ.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-SjZGW1Dx.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-LUrJlUhb.js → task-result-evidence-B8xUiwW3.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BqEDB1Vl.js → terminal-panel-store-DJVC7HqA.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-gAcojLgP.js → theme-store-Dlnmgryi.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-DcCc6g7o.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-B1ZRh-Is.js → tracing-settings-page-MvG4SH64.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-C9u9E3UQ.js → tunnel-api-BB7u79ID.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BTrzsR6_.js → understanding-activity-store-C4bblRnQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-5Qava3jh.js → understanding-refresh-store-BvCj9-Ue.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DFMLYKAc.js → usage-page-Cv4Je5XJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-3O-X7x15.js → use-autosave-YHxQ-UZg.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BLc4dBfe.js → use-composer-attachments-vDdxHtUb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BaOmTXsT.js → use-file-preview-expanded-Ce2mgYme.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-MusPgljM.js → use-personal-profile-D2Un8G1L.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-Ck_U2yTw.js → use-workspace-tree-BQEiJzK7.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Den5Lg-k.js → user-model-page-DRSsn4EV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-C5zJApoa.js → voice-api-key-field-DCM69u8Y.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DC1bYDt1.js → voice-config-api-CrULrSKC.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-0SZjJdVV.js → voice-input-shortcut-events-DFMNIyy4.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-CxVeANPX.js → voice-transcribe-api-Bbyj0yGR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DAQ8McVe.js → work-discovery-overlay-CVe9UmFl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DUQysEyb.js → work-discovery-page-CtqkRMN5.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BO9qdJyZ.js → working-directory-picker-modal-CDZ1xh3o.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-ZrN6yUER.js → workspace-api-tbifz2zY.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-4cZ26iaD.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-Yj_kBWSb.js → workspace-file-preview-dialog-BubQwQwU.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-yxT7wajO.js → workspace-open-location-menu-DZk3MBSa.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-IcH9KDzx.js → xopc-cloud-account-card-CIavPUr3.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/config/models-json.d.ts +12 -0
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/phone-setup.js +12 -7
- package/dist/src/gateway/hono/routes/phone.js +2 -4
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +9 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/phone/cloud-adb-connection.js +8 -5
- package/dist/src/phone/contracts.d.ts +4 -0
- package/dist/src/phone/contracts.js +6 -1
- package/dist/src/phone/gui-protocol.d.ts +7 -0
- package/dist/src/phone/gui-protocol.js +302 -0
- package/dist/src/phone/model-adapter.d.ts +1 -1
- package/dist/src/phone/model-adapter.js +7 -4
- package/dist/src/phone/runtime.js +8 -2
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +2 -0
- package/dist/src/phone/ui-session.js +23 -4
- package/dist/src/providers/env-keys.js +2 -0
- package/dist/src/providers/index.js +11 -0
- package/dist/src/providers/model-catalog-types.d.ts +1 -1
- package/dist/src/providers/model-supplements.d.ts +1 -1
- package/dist/src/providers/model-supplements.js +6 -3
- package/dist/src/providers/phone-models.d.ts +3 -0
- package/dist/src/providers/phone-models.js +33 -0
- package/dist/src/providers/presentation.js +0 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/chat-page-BP0huA-W.js +0 -72
- package/dist/gateway/static/root/assets/connected-providers-grid-CKZfhHSD.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +0 -1
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +0 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-Bg_XR36n.js";import{t as c}from"./app-window-DXFNqt_0.js";import{t as l}from"./arrow-left-D880xG-P.js";import{t as u}from"./chevron-down-ccbiQQz_.js";import{n as d,r as f}from"./popover-select-DD8fmrxH.js";import{n as p,t as m}from"./beta-badge-BnzdzIEl.js";import{t as h}from"./play-kxZvpBg8.js";import{t as g}from"./plus-Q2yW6OE7.js";import{t as _}from"./refresh-cw-BRlGaq2w.js";import{t as v}from"./search-DA7gz22f.js";import{t as y}from"./shield-check-BU58siTV.js";import{t as b}from"./smartphone-DSSsQFqA.js";import{t as x}from"./x-B_N4OPjy.js";import{t as S}from"./cn-0WouolD0.js";import{t as C}from"./button-CnRSIP6m.js";import{t as w}from"./skeleton-BI5TyibZ.js";import{t as T}from"./phone-workspace-store-CVDk80Bf.js";import{a as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dist-DfWfZ9iu.js";import{i as N}from"./vendor-swr-CdRzEUwF.js";import{t as P}from"./open-capability-settings-Cvb65hQB.js";import{l as ee,m as F,o as I,r as L,t as te,u as R}from"./dist-D3lWNSe7.js";import{n as z,t as B}from"./global-defaults-api-DYMRjGvd.js";import{n as V}from"./providers-api-rwQ4LWzr.js";import{n as ne,t as H}from"./settings-page-header-CyUHrn7c.js";import{t as U}from"./mobile-pair-qr-CuIbmw5x.js";import{a as re,c as W,i as ie,n as ae,o as oe,r as se,s as ce}from"./phone-model-picker-BbA2iI-3.js";import{t as le}from"./phone-dependencies-card-DLYrI0C4.js";var ue=n(),G=e(t(),1),K=r();function de({zh:e,onAdded:t}){let[n,r]=(0,G.useState)(e?`阿里云手机`:`Alibaba Cloud Phone`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(),[c,l]=(0,G.useState)(),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(``),g=(0,G.useRef)(void 0),_=(0,G.useRef)(!0),v=()=>{let e=g.current;g.current=void 0,l(void 0),e&&W(`/cloud/aliyun/tests/${e}`,void 0,`DELETE`).catch(()=>{})};(0,G.useEffect)(()=>(_.current=!0,()=>{_.current=!1,g.current&&W(`/cloud/aliyun/tests/${g.current}`,void 0,`DELETE`).catch(()=>{})}),[]);let y=async()=>{if(o){v(),p(!0),h(``);try{if(o.size>16384)throw Error(e?`私钥文件不能超过 16 KB`:`Private key must be at most 16 KB`);let t=await W(`/cloud/aliyun/test`,{endpoint:i.trim(),privateKey:await o.text()});if(!_.current){W(`/cloud/aliyun/tests/${t.token}`,void 0,`DELETE`).catch(()=>{});return}g.current=t.token,l(t)}catch(e){_.current&&h(String(e instanceof Error?e.message:e))}finally{_.current&&p(!1)}}},b=async()=>{if(c){p(!0),h(``);try{await W(`/cloud/aliyun/add`,{token:c.token,name:n.trim(),makeDefault:u}),g.current=void 0,t()}catch(e){_.current&&h(String(e instanceof Error?e.message:e))}finally{_.current&&p(!1)}}},x=`mt-2 w-full rounded-xl border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e?`在阿里云控制台绑定密钥对并创建 ADB 连接,复制公网或 Gateway 可访问的内网地址。无需云账号 AccessKey。`:`Bind a key pair and create an ADB connection in the Alibaba console. Use an address reachable from the Gateway. No cloud account AccessKey is needed.`}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`手机名称`:`Phone name`,(0,K.jsx)(`input`,{className:x,value:n,maxLength:100,disabled:f,onChange:e=>r(e.target.value)})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`ADB 地址`:`ADB address`,(0,K.jsx)(`input`,{className:x,placeholder:`203.0.113.10:10001`,value:i,disabled:f,autoComplete:`off`,onChange:e=>{v(),a(e.target.value)}})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`私钥文件(adbkey)`:`Private key file (adbkey)`,(0,K.jsx)(`input`,{className:x,type:`file`,disabled:f,onChange:e=>{v(),s(e.target.files?.[0])}})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`私钥仅提交到当前 Gateway,添加后保存在 Gateway 凭据目录,不会替换电脑现有 ADB 密钥。`:`The key is sent only to this Gateway and saved in its credentials directory after adding. Existing host ADB keys stay unchanged.`}),(0,K.jsx)(C,{disabled:f||!i.trim()||!o,onClick:()=>void y(),children:f?e?`处理中…`:`Working…`:e?`测试连接`:`Test connection`}),m&&(0,K.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-danger`,children:m}),c&&(0,K.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[(0,K.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[e?`连接成功`:`Connected`,` · `,c.model,` · Android `,c.androidVersion]}),(0,K.jsx)(`img`,{src:c.screenshot,alt:e?`云手机当前画面`:`Current cloud phone screen`,className:`mx-auto max-h-64 rounded-lg object-contain`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`添加后可在聊天中使用实时视频、接管操作和交还 Agent;视频不可用时使用截图。测试结果有效期为 10 分钟。默认只允许系统设置,添加后可在「管理」中调整。`:`After adding, use live video, takeover and Agent handback in chat, with snapshots when video is unavailable. Test expires after 10 minutes. Settings is the initial allowed app; adjust it in Manage.`}),(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u,disabled:f,onChange:e=>d(e.target.checked)}),e?`设为默认手机`:`Set as default phone`]}),(0,K.jsx)(C,{variant:`primary`,disabled:f||!n.trim()||c.expiresAt<=Date.now(),onClick:()=>void b(),children:e?`添加手机`:`Add phone`})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`移除连接只删除 xopc 的连接与私钥,不会销毁云手机,也不会关闭阿里云侧的 ADB 端口。`:`Removing a connection deletes its xopc credentials. It does not destroy the cloud phone or close its cloud ADB endpoint.`})]})}var q=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm`,J=new Set([`connected`,`timeout`,`error`,`cancelled`]);function Y({zh:e,onSelect:t}){let[n,r]=(0,G.useState)(`qr`),[i,a]=(0,G.useState)(),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(``),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(``),[b,x]=(0,G.useState)(Date.now()),S=(0,G.useRef)(void 0),T=(0,G.useRef)(0),E=(0,G.useRef)(t);E.current=t;let D=N(`phone-wireless-discovery`,()=>W(`/wireless/discovery`),{refreshInterval:4e3}),O=()=>{T.current++;let e=S.current;S.current=void 0,e&&W(`/wireless/pairings/${e}`,void 0,`DELETE`).catch(()=>{})},k=async e=>{O();let t=T.current;_(!0),y(``),a(void 0),s(``);try{if(e===`connect`){let e=await W(`/wireless/connect`,{host:c,port:Number(f)});T.current===t&&E.current(e)}else{let n=await W(`/wireless/pairings`,e===`qr`?{method:`qr`}:{method:`code`,host:c,pairingPort:Number(u),code:m,...f?{connectPort:Number(f)}:{}});if(T.current!==t){W(`/wireless/pairings/${n.id}`,void 0,`DELETE`).catch(()=>{});return}S.current=n.id,a(n),h(``)}}catch(e){T.current===t&&y(e instanceof Error?e.message:String(e))}finally{T.current===t&&_(!1)}};(0,G.useEffect)(()=>(n===`qr`&&k(`qr`),O),[n]),(0,G.useEffect)(()=>{let t=!0;return s(``),i?.qrPayload&&U(i.qrPayload).then(e=>{t&&s(e)}).catch(()=>{t&&y(e?`二维码生成失败,请重试`:`Unable to render QR code`)}),()=>{t=!1}},[i?.qrPayload,e]),(0,G.useEffect)(()=>{if(!i||J.has(i.status))return;let e=!0,t,n=async()=>{try{let r=await W(`/wireless/pairings/${i.id}`);if(!e)return;if(a(r),x(Date.now()),r.status===`connected`&&r.device){E.current(r.device);return}J.has(r.status)||(t=setTimeout(()=>{n()},1e3))}catch(r){if(!e)return;y(r instanceof Error?r.message:String(r)),Date.now()<i.expiresAt+5e3?t=setTimeout(()=>{n()},2e3):a(e=>e&&{...e,status:`timeout`,qrPayload:void 0})}};return t=setTimeout(()=>{n()},1e3),()=>{e=!1,clearTimeout(t)}},[i?.id,i?.status]);let A=e?{waiting:`等待扫码`,pairing:`正在配对`,paired:`已配对,正在查找连接地址`,connecting:`正在连接`,connected:`已连接`,timeout:`操作超时`,error:`配对失败`,cancelled:`已取消`}:{waiting:`Waiting for scan`,pairing:`Pairing`,paired:`Paired · Finding connection address`,connecting:`Connecting`,connected:`Connected`,timeout:`Timed out`,error:`Pairing failed`,cancelled:`Cancelled`},j=g||!!(i&&!J.has(i.status));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-3 text-sm`,children:e?`手机须与 Gateway 所在电脑处于同一局域网。仅浏览器与手机同网还不够。支持 Android 11 及以上。`:`Android 11+. The phone and Gateway host must share a local network.`}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":e?`无线连接方式`:`Wireless connection method`,children:[[`qr`,e?`扫码配对`:`QR pairing`],[`code`,e?`配对码`:`Pairing code`],[`connect`,e?`连接已配对设备`:`Already paired`]].map(([e,t])=>(0,K.jsx)(C,{"aria-pressed":n===e,onClick:()=>{O(),_(!1),a(void 0),y(``),s(``),r(e)},children:t},e))}),(0,K.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-5 text-sm text-fg-muted`,children:[(0,K.jsx)(`li`,{children:e?`打开手机「设置 → 开发者选项 → 无线调试」。`:`Open Settings → Developer options → Wireless debugging.`}),(0,K.jsx)(`li`,{children:n===`qr`?e?`选择「使用二维码配对设备」,扫描下方二维码。`:`Choose Pair device with QR code and scan below.`:n===`code`?e?`选择「使用配对码配对设备」,填写显示的地址和六位配对码。`:`Choose Pair device with pairing code and enter its address and six-digit code.`:e?`填写无线调试首页显示的 IP 地址与连接端口。`:`Enter the IP and port shown on the main Wireless debugging screen.`})]}),D.isLoading&&(0,K.jsx)(w,{className:`h-12 w-full`}),(D.error||D.data?.mdns===!1)&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:e?`自动发现不可用。可使用配对码并手动填写连接端口。请检查 Gateway 的 ADB、网络及防火墙。`:`Discovery unavailable. Use a pairing code and enter the connection port manually. Check Gateway ADB, network and firewall.`}),n===`qr`?(0,K.jsxs)(`div`,{className:`space-y-3 text-center`,children:[o?(0,K.jsx)(`img`,{src:o,alt:e?`无线调试配对二维码`:`Wireless debugging pairing QR code`,className:`mx-auto size-60 rounded-lg bg-white`}):i&&!J.has(i.status)?(0,K.jsx)(w,{className:`mx-auto size-60`}):null,i&&(0,K.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[A[i.status],J.has(i.status)?``:` · ${Math.max(0,Math.ceil((i.expiresAt-b)/1e3))}s`]}),(0,K.jsx)(C,{disabled:g,onClick:()=>{k(`qr`)},children:e?`重新生成`:`Regenerate`})]}):(0,K.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),k(n)},children:[D.data?.services.filter(e=>e.kind===(n===`code`?`pairing`:`connect`)).map(e=>(0,K.jsxs)(C,{type:`button`,disabled:j,onClick:()=>{if(l(e.host),n===`code`){d(String(e.port));let t=D.data?.services.find(t=>t.kind===`connect`&&t.host===e.host);p(t?String(t.port):``)}else p(String(e.port))},children:[e.host,`:`,e.port]},`${e.name}:${e.port}`)),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`手机 IP 地址`:`Phone IP address`,(0,K.jsx)(`input`,{className:q,value:c,onChange:e=>l(e.target.value.trim()),required:!0,disabled:j,placeholder:`192.168.1.10`})]}),n===`code`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`配对端口`:`Pairing port`,(0,K.jsx)(`input`,{className:q,type:`number`,min:1,max:65535,value:u,onChange:e=>d(e.target.value),required:!0,disabled:j})]}),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`六位配对码`:`Six-digit pairing code`,(0,K.jsx)(`input`,{className:q,inputMode:`numeric`,autoComplete:`off`,pattern:`[0-9]{6}`,maxLength:6,value:m,onChange:e=>h(e.target.value),required:!0,disabled:j})]})]}),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`连接端口`:`Connection port`,(0,K.jsx)(`input`,{className:q,type:`number`,min:1,max:65535,value:f,onChange:e=>p(e.target.value),required:n===`connect`,disabled:j,placeholder:e?`留空自动发现`:`Auto-discover if empty`})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`连接端口在无线调试首页显示,与配对端口不同,会随设备状态变化。`:`The connection port is on the main Wireless debugging screen. It differs from the pairing port and can change.`}),i&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm`,children:A[i.status]}),(0,K.jsx)(C,{type:`submit`,disabled:j,children:e?n===`code`?`配对并连接`:`连接`:n===`code`?`Pair and connect`:`Connect`})]}),i?.errorCode&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:i.errorCode===`PHONE_CONNECT_TIMEOUT`?e?`已配对,但未能连接。切换「连接已配对设备」并填写当前连接端口,无需重新配对。`:`Paired but not connected. Use Already paired with the current connection port.`:e?`未完成配对。请检查手机配对页面、网络和配对码后重试。`:`Pairing incomplete. Check the phone pairing screen, network and code, then retry.`}),j&&(0,K.jsx)(C,{onClick:()=>{O(),_(!1),a(void 0),s(``)},children:e?`取消配对`:`Cancel pairing`}),v&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]})}var fe=[{id:`wireless`,available:!0,name:[`无线连接 Android 手机`,`Wireless Android phone`],description:[`Android 11+,扫码或输入配对码,无需数据线。`,`Android 11+ · Pair with a QR code or pairing code.`]},{id:`local-adb`,available:!0,name:[`Gateway 电脑上的手机 / 模拟器`,`Phone or emulator on the Gateway host`],description:[`通过 USB 或已配对的无线 ADB 连接。`,`Connect over USB or previously paired wireless ADB.`]},{id:`remote-connector`,available:!1,name:[`通过本地连接器连接`,`Local connector`],description:[`Gateway 在服务器上,手机连接在你的电脑上。`,`Connect a phone on your computer to a remote Gateway.`]},{id:`aliyun`,available:!0,name:[`阿里云手机`,`Alibaba Cloud Phone`],description:[`填写 ADB 地址并上传私钥,连接已有云手机。`,`Connect an existing cloud phone with its ADB address and private key.`]},{id:`tencent`,available:!1,name:[`腾讯云手机`,`Tencent Cloud Phone`],description:[`连接云账号,选择地域和已有实例。`,`Connect an account, then choose a region and existing instance.`]}];function pe(e){let t=(0,ue.c)(48),{zh:n,onClose:r,onSelect:i,onAdded:a}=e,[o,s]=(0,G.useState)(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={refreshInterval:3e3},t[0]=c):c=t[0];let u=N(o===`local-adb`?`phone-devices`:null,re,c),d;t[1]===o?d=t[2]:(d=fe.find(e=>e.id===o),t[1]=o,t[2]=d);let f=d,p=+!n,m;t[3]===n?m=t[4]:(m=n?{device:`已连接,可添加`,unauthorized:`等待手机授权:解锁手机,点击「允许 USB 调试」`,offline:`设备离线:重新连接数据线或无线调试`,recovery:`恢复模式:请先启动 Android 系统`,sideload:`请退出刷机模式并启动 Android 系统`}:{device:`Connected · Ready to add`,unauthorized:`Unlock the phone and allow USB debugging`,offline:`Offline · Reconnect USB or wireless debugging`,recovery:`Boot Android before connecting`,sideload:`Exit sideload mode and boot Android`},t[3]=n,t[4]=m);let h=m,g;t[5]===u.data?.discovery?g=t[6]:(g=u.data?.discovery??[],t[5]=u.data?.discovery,t[6]=g);let v=g,y;t[7]===r?y=t[8]:(y=e=>{e||r()},t[7]=r,t[8]=y);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),t[9]=b):b=t[9];let S;t[10]!==o||t[11]!==n?(S=o&&(0,K.jsx)(C,{variant:`ghost`,"aria-label":n?`返回连接方式`:`Back to connection methods`,onClick:()=>s(void 0),children:(0,K.jsx)(l,{className:`size-4`})}),t[10]=o,t[11]=n,t[12]=S):S=t[12];let T=n?`添加手机`:`Add phone`,P;t[13]===T?P=t[14]:(P=(0,K.jsx)(j,{className:`text-base font-semibold`,children:T}),t[13]=T,t[14]=P);let ee=f?f.name[p]:n?`选择手机连接在哪里。手机模型在添加设备后独立配置。`:`Choose where the phone connects. Phone models are configured separately.`,F;t[15]===ee?F=t[16]:(F=(0,K.jsx)(D,{className:`mt-1 text-sm text-fg-muted`,children:ee}),t[15]=ee,t[16]=F);let I;t[17]!==F||t[18]!==P?(I=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[P,F]}),t[17]=F,t[18]=P,t[19]=I):I=t[19];let L=n?`关闭添加手机`:`Close add phone`,te;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,K.jsx)(x,{className:`size-4`}),t[20]=te):te=t[20];let R;t[21]===L?R=t[22]:(R=(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{variant:`ghost`,"aria-label":L,children:te})}),t[21]=L,t[22]=R);let z;t[23]!==I||t[24]!==R||t[25]!==S?(z=(0,K.jsxs)(`header`,{className:`flex shrink-0 items-start gap-3 border-b border-edge p-5`,children:[S,I,R]}),t[23]=I,t[24]=R,t[25]=S,t[26]=z):z=t[26];let B;t[27]!==u||t[28]!==v||t[29]!==p||t[30]!==o||t[31]!==a||t[32]!==r||t[33]!==i||t[34]!==h||t[35]!==n?(B=o?o===`aliyun`?(0,K.jsx)(de,{zh:n,onAdded:()=>{a?.(),r()}}):o===`wireless`?(0,K.jsx)(Y,{zh:n,onSelect:i}):o===`local-adb`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-3 text-sm`,children:n?`连接位置:Gateway 所在电脑。若 Gateway 在服务器上,浏览器无法访问你电脑的 USB 手机。`:`Connection location: the Gateway host. A remote Gateway cannot access your browser computer’s USB phone.`}),(0,K.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-sm text-fg-muted`,children:[(0,K.jsx)(`li`,{children:n?`手机开启开发者选项和 USB 调试;模拟器直接启动即可。`:`Enable developer options and USB debugging, or start an emulator.`}),(0,K.jsx)(`li`,{children:n?`用数据线连接 Gateway 电脑,在手机上允许 USB 调试。`:`Connect to the Gateway host with a data cable, then allow USB debugging on the phone.`}),(0,K.jsx)(`li`,{children:n?`等待下方显示设备,选择后确认名称和应用范围。`:`Select a discovered device below, then confirm its name and app access.`})]}),(0,K.jsxs)(`details`,{className:`text-sm`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:n?`使用无线连接或安装连接工具`:`Wireless connection or connection tools`}),(0,K.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:n?`可返回连接方式,选择「无线连接 Android 手机」进行扫码或配对码配对。ADB 可在手机控制页的「手机依赖状态」中手动安装,或使用 Gateway 电脑上已有的 Platform Tools;无需安装完整 Android Studio。`:`Choose Wireless Android phone to pair with a QR code or pairing code. Install ADB from Phone dependencies or use existing Platform Tools on the Gateway host.`}),(0,K.jsx)(`a`,{href:`https://developer.android.com/tools/adb`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-2 inline-block text-xs text-accent-fg hover:underline`,children:n?`查看 Android 官方连接指引`:`Android connection guide`})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:n?`发现的设备`:`Discovered devices`}),(0,K.jsxs)(C,{disabled:u.isValidating,onClick:()=>{u.mutate()},children:[(0,K.jsx)(_,{className:`size-4`}),n?`刷新`:`Refresh`]})]}),!u.data&&!u.error?(0,K.jsx)(w,{className:`h-24 w-full rounded-xl`}):null,(u.error||u.data?.diagnostic)&&(0,K.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[n?`无法检测设备,请检查 Gateway 电脑的 ADB 安装与连接。`:`Unable to detect devices. Check ADB on the Gateway host.`,(0,K.jsx)(`span`,{className:`mt-1 block break-all text-xs`,children:u.data?.diagnostic??String(u.error)})]}),v.map(e=>{let t=u.data?.devices.some(t=>t.serial===e.serial);return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-xl border border-edge p-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,K.jsx)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:e.serial}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:h[e.state]??e.state})]}),(0,K.jsx)(C,{disabled:t||e.state!==`device`,onClick:()=>i(e),children:t?n?`已添加`:`Added`:n?`选择设备`:`Choose device`})]},e.serial)}),u.data&&!v.length&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:n?`尚未发现设备。请检查数据线、手机调试授权,或启动模拟器。`:`No devices found. Check the cable and debugging authorization, or start an emulator.`})]}):(0,K.jsxs)(`div`,{className:`space-y-4 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:n?`此接入方式暂未支持`:`This connection method is not available yet`}),(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o===`remote-connector`?n?`后续可通过本地连接器将电脑上的手机接入远程 Gateway。当前请将手机连接到 Gateway 所在电脑。`:`A future local connector will connect your phone to a remote Gateway. For now, connect it to the Gateway host.`:n?`云手机适配器接入后,可配置云账号、选择地域和已有实例,再验证连接并添加。当前尚不能连接云实例,不会要求填写云密钥。`:`Once the cloud adapter is available, connect an account, select a region and existing instance, then verify and add it. Cloud connections are not supported yet.`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`添加已有实例与购买、创建、销毁实例分开处理。`:`Adding existing instances is separate from purchasing, creating or destroying them.`})]}):fe.map(e=>(0,K.jsxs)(`button`,{className:`block min-h-20 w-full rounded-xl border border-edge bg-surface-base p-4 text-left hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-accent`,onClick:()=>s(e.id),children:[(0,K.jsxs)(`span`,{className:`flex flex-wrap items-center justify-between gap-2 text-sm font-medium`,children:[e.name[p],!e.available&&(0,K.jsx)(`span`,{className:`text-xs font-normal text-fg-muted`,children:n?`暂未支持`:`Not available yet`})]}),(0,K.jsx)(`span`,{className:`mt-2 block text-xs text-fg-muted`,children:e.description[p]})]},e.id)),t[27]=u,t[28]=v,t[29]=p,t[30]=o,t[31]=a,t[32]=r,t[33]=i,t[34]=h,t[35]=n,t[36]=B):B=t[36];let V;t[37]===B?V=t[38]:(V=(0,K.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:B}),t[37]=B,t[38]=V);let ne=n?`取消`:`Cancel`,H;t[39]===ne?H=t[40]:(H=(0,K.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge p-4`,children:(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{children:ne})})}),t[39]=ne,t[40]=H);let U;t[41]!==z||t[42]!==V||t[43]!==H?(U=(0,K.jsxs)(k,{children:[b,(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(42rem,90dvh)] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay text-fg`,children:[z,V,H]})]}),t[41]=z,t[42]=V,t[43]=H,t[44]=U):U=t[44];let W;return t[45]!==U||t[46]!==y?(W=(0,K.jsx)(M,{open:!0,onOpenChange:y,children:U}),t[45]=U,t[46]=y,t[47]=W):W=t[47],W}function me({device:e,zh:t,onClose:n,onConnected:r}){let[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(e.wireless?.host??``),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``),m=async()=>{d(!0),p(``);try{await W(`/devices/${e.id}/reconnect`,i?{host:o,port:Number(c)}:{}),await r(),n()}catch(e){p(e instanceof Error?e.message:String(e)),a(!0)}finally{d(!1)}};return(0,K.jsx)(M,{open:!0,onOpenChange:e=>{!e&&!u&&n()},children:(0,K.jsxs)(k,{children:[(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(28rem,90dvh)] w-[min(32rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5 text-fg`,children:[(0,K.jsxs)(j,{className:`text-base font-semibold`,children:[t?`重新连接手机`:`Reconnect phone`,` · `,e.name]}),(0,K.jsx)(D,{className:`mt-2 text-sm text-fg-muted`,children:t?`开启手机无线调试,并连接 Gateway 所在局域网。重连会保留设备权限,之前的任务需要重新打开。`:`Enable wireless debugging on the Gateway network. Device permissions are preserved; reopen the previous task.`}),(0,K.jsxs)(`form`,{className:`mt-4 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto`,children:[(0,K.jsxs)(`label`,{className:`flex min-h-11 items-center gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:i,disabled:u,onChange:e=>a(e.target.checked)}),t?`手动填写当前连接地址`:`Enter current connection address`]}),i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`label`,{className:`block text-sm`,children:[t?`手机 IP 地址`:`Phone IP address`,(0,K.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,required:!0,value:o,disabled:u,onChange:e=>s(e.target.value.trim())})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[t?`连接端口(无线调试首页)`:`Connection port (Wireless debugging screen)`,(0,K.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,type:`number`,min:1,max:65535,required:!0,value:c,disabled:u,onChange:e=>l(e.target.value)})]})]}),f&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f})]}),(0,K.jsxs)(`footer`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,K.jsx)(C,{type:`button`,disabled:u,onClick:n,children:t?`取消`:`Cancel`}),(0,K.jsx)(C,{type:`submit`,variant:`primary`,disabled:u,children:u?t?`正在连接…`:`Connecting…`:t?`重新连接`:`Reconnect`})]})]})]})]})})}function X(e){let t=(0,ue.c)(29),{deviceId:n,serial:r,mode:i,selected:a,onModeChange:o,onSelectedChange:s,disabled:l,zh:u}=e,d=(0,G.useId)(),[f,p]=(0,G.useState)(``),m;t[0]!==n||t[1]!==i||t[2]!==r?(m=i===`selected`?[`phone-applications`,n??r]:null,t[0]=n,t[1]=i,t[2]=r,t[3]=m):m=t[3];let h;t[4]!==n||t[5]!==r?(h=()=>ie(n,r),t[4]=n,t[5]=r,t[6]=h):h=t[6];let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,shouldRetryOnError:!1},t[7]=g):g=t[7];let y=N(m,h,g),b;if(t[8]!==y||t[9]!==l||t[10]!==d||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==f||t[15]!==a||t[16]!==u){let e=f.trim().toLocaleLowerCase(),n=y.data?.filter(t=>`${t.label} ${t.packageName}`.toLocaleLowerCase().includes(e))??[],r=y.data,m=r?a.filter(e=>!r.some(t=>t.packageName===e)):[],h;t[18]!==s||t[19]!==a?(h=e=>s(a.includes(e)?a.filter(t=>t!==e):[...a,e]),t[18]=s,t[19]=a,t[20]=h):h=t[20];let g=h,x=u?`应用权限`:`Application access`,T;t[21]===x?T=t[22]:(T=(0,K.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:x}),t[21]=x,t[22]=T);let E;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`all`,`selected`],t[23]=E):E=t[23];let D;t[24]!==d||t[25]!==i||t[26]!==o||t[27]!==u?(D=(0,K.jsx)(`div`,{className:`grid gap-2`,children:E.map(e=>(0,K.jsxs)(`label`,{className:S(`flex min-h-14 cursor-pointer items-start gap-3 rounded-xl border p-3`,i===e?`border-accent/50 bg-accent-soft`:`border-edge bg-surface-base`),children:[(0,K.jsx)(`input`,{type:`radio`,name:d,value:e,checked:i===e,onChange:()=>o(e),className:`mt-1 size-4 shrink-0 accent-accent`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block text-sm font-medium`,children:e===`all`?u?`允许所有应用`:`Allow all apps`:u?`仅允许所选应用`:`Only selected apps`}),(0,K.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-fg-muted`,children:e===`all`?u?`可在手机上的应用间切换,无需逐个配置。`:`Switch between apps on this phone without individual setup.`:u?`从手机上已安装的应用中选择。`:`Choose from applications installed on the phone.`})]})]},e))}),t[24]=d,t[25]=i,t[26]=o,t[27]=u,t[28]=D):D=t[28],b=(0,K.jsxs)(`fieldset`,{disabled:l,className:`space-y-3`,children:[T,D,i===`selected`?(0,K.jsxs)(`div`,{className:`space-y-2`,"aria-label":u?`选择手机应用`:`Choose phone applications`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:u?`已选择 ${a.length} 个应用`:`${a.length} apps selected`}),(0,K.jsxs)(C,{variant:`ghost`,className:`gap-1 px-2 py-1 text-xs`,"aria-label":u?`刷新应用列表`:`Refresh applications`,disabled:l||y.isValidating,onClick:()=>{y.mutate()},children:[(0,K.jsx)(_,{className:S(`size-3.5`,y.isValidating&&`animate-spin motion-reduce:animate-none`),"aria-hidden":!0}),u?`刷新`:`Refresh`]})]}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(v,{className:`pointer-events-none absolute left-3 top-3 size-4 text-fg-muted`,"aria-hidden":!0}),(0,K.jsx)(`input`,{type:`search`,"aria-label":u?`搜索手机应用`:`Search phone applications`,placeholder:u?`搜索应用`:`Search apps`,value:f,onChange:e=>p(e.target.value),className:`min-h-10 w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-3 text-sm focus-visible:outline-2 focus-visible:outline-accent`})]}),y.error?(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:[u?`暂时无法读取应用,请确认手机已连接后重试。之前的选择会保留。`:`Unable to read apps. Check the phone connection and retry. Previous selections are preserved.`,(0,K.jsx)(C,{variant:`ghost`,className:`ml-1 text-accent`,onClick:()=>{y.mutate()},children:u?`重试`:`Retry`})]}):null,!y.data&&!y.error?(0,K.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(w,{className:`h-10 w-full`})]}):y.data?(0,K.jsxs)(`div`,{className:`max-h-56 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-base`,"aria-label":u?`可选应用`:`Available applications`,children:[n.map(e=>(0,K.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-3 px-3 py-2 hover:bg-surface-hover`,children:[(0,K.jsx)(c,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate text-sm`,title:e.label,children:e.label}),e.label!==e.packageName&&y.data.some(t=>t.packageName!==e.packageName&&t.label===e.label)?(0,K.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:e.packageName}):null]}),(0,K.jsx)(`input`,{type:`checkbox`,"aria-label":e.label,checked:a.includes(e.packageName),onChange:()=>g(e.packageName),className:`size-4 shrink-0 accent-accent`})]},e.packageName)),n.length?null:(0,K.jsx)(`p`,{className:`p-4 text-center text-sm text-fg-muted`,children:e?u?`没有找到匹配的应用`:`No matching applications`:u?`这台手机上没有可打开的应用`:`No launchable applications on this phone`})]}):null,m.length?(0,K.jsxs)(`div`,{className:`space-y-1 text-xs text-fg-muted`,children:[(0,K.jsx)(`p`,{children:u?`以下原有选择未在手机上找到,可取消选择。`:`These previous selections are no longer available. You may deselect them.`}),m.map(e=>(0,K.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>g(e),className:`accent-accent`}),(0,K.jsx)(`span`,{className:`break-all`,children:e})]},e))]}):null,a.length?null:(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:u?`至少选择一个应用后保存。`:`Choose at least one application before saving.`})]}):null]}),t[8]=y,t[9]=l,t[10]=d,t[11]=i,t[12]=o,t[13]=s,t[14]=f,t[15]=a,t[16]=u,t[17]=b}else b=t[17];return b}function he({deviceId:e,value:t,onChange:n,disabled:r,zh:i}){let[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(``);async function l(){o(!0),c(``);try{let t=await W(`/devices/${e}/input-status`);c(t.unicode===`available`?i?`中文输入通道已就绪,具体应用仍需允许粘贴。`:`Unicode input is ready. The app must allow pasting.`:t.unicode===`setup_required`?i?`请在手机依赖中安装或修复 scrcpy server,再重试检测。无需安装手机输入法。`:`Install or repair scrcpy server under phone dependencies, then retry. No phone keyboard installation is needed.`:i?`这台手机暂不支持自动中文输入,请接管后使用手机自带键盘。`:`Automatic Unicode input is unavailable. Take over and use the phone keyboard.`)}catch{c(i?`暂时无法检测,请确认手机连接后重试。`:`Unable to check. Reconnect the phone and retry.`)}finally{o(!1)}}return(0,K.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge bg-surface-base p-3`,children:[(0,K.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-3 text-sm font-medium`,children:[i?`允许自动输入文字`:`Allow automatic text input`,(0,K.jsx)(`input`,{type:`checkbox`,checked:t===`auto`,disabled:r,onChange:e=>n(e.target.checked?`auto`:`manual`),className:`size-4 accent-accent`})]}),(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:t===`auto`?i?`中文和 Emoji 通过手机剪贴板粘贴,不安装或切换输入法。输入内容可能留在手机剪贴板;不会读取或同步原有剪贴板。`:`Chinese and emoji use the phone clipboard without installing or switching keyboards. Supplied text may remain there; existing clipboard contents are never read or synced.`:i?`Agent 会在需要输入时暂停。请接管手机,使用手机自带键盘输入,完成后交还 Agent。`:`The Agent pauses when text is needed. Take over, type with the phone keyboard, then hand back to the Agent.`}),e?(0,K.jsx)(C,{variant:`ghost`,className:`min-h-9 px-2 text-xs text-accent`,disabled:r||a,onClick:()=>void l(),children:a?i?`正在检测…`:`Checking…`:i?`检测中文输入能力`:`Check Unicode input`}):null,s?(0,K.jsx)(`p`,{role:`status`,className:`text-xs leading-relaxed text-fg-muted`,children:s}):null]})}function ge({value:e,zh:t,disabled:n,onSave:r,onSelect:i}){let o=N(`phone-models`,oe),s=N(`phone-provider-meta`,V),[c,l]=(0,G.useState)(e),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(!1);(0,G.useEffect)(()=>{l(e)},[e]);let g=o.data?.models.find(e=>e.id===c),_=c.split(`/`)[0],v=s.data?.find(e=>e.id===_)?.name??_,y=!c||!!g?.configured,b=async()=>{if(!(u||!y)){d(!0),p(``),h(!1);try{await r(c),h(!0)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(ae,{value:c,onChange:e=>{l(e),i?.(e),h(!1),p(``)},zh:t,disabled:n||u})}),(0,K.jsx)(C,{variant:c===e?`secondary`:`primary`,disabled:n||u||!o.data||!y||c===e,onClick:()=>{b()},children:u?t?`保存中…`:`Saving…`:t?`保存`:`Save`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[c&&o.data?(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:g?`${v} · ${g.configured?t?`凭据就绪`:`Credentials ready`:t?`请先配置凭据`:`Configure credentials first`}`:t?`当前模型不可用,请重新选择。`:`This model is unavailable. Choose another model.`}):null,(0,K.jsx)(a,{to:`/settings/capabilities/models?returnTo=%2Fsettings%2Fphone-use&purpose=phone`,onClick:e=>{!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&(e.preventDefault(),P(`chat`,`services`,`phone`))},className:`inline-flex min-h-8 items-center text-xs text-accent-fg hover:underline`,children:t?`管理模型`:`Manage models`})]}),f&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}),m&&(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:t?`手机模型已保存,请返回手机连接测试实际操作。`:`Phone model saved. Test it from the phone connection.`})]})}var _e=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,ve=`min-h-11 w-full cursor-default rounded-lg px-3 py-2 text-left text-sm outline-none data-[highlighted]:bg-surface-hover data-[highlighted]:ring-2 data-[highlighted]:ring-inset data-[highlighted]:ring-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,ye=`space-y-4 rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`;function be({device:e,serial:t,name:n,onSave:r,onClose:i,zh:a}){let[o,s]=(0,G.useState)(e?.name??n),[c,l]=(0,G.useState)(e?.appAccess??(e?.allowedApps.length?`selected`:`all`)),[u,d]=(0,G.useState)(e?.allowedApps??[]),[f,p]=(0,G.useState)(e?.textInput??`auto`),[m,h]=(0,G.useState)(e?.enabled??!0),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(``),b=async()=>{_(!0),y(``);try{let n={name:o,appAccess:c,allowedApps:c===`all`?[]:u,textInput:f,enabled:m};await W(e?`/devices/${e.id}`:`/devices`,e?n:{...n,serial:t},e?`PATCH`:`POST`),await r(),i()}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}};return(0,K.jsx)(M,{open:!0,onOpenChange:e=>{!e&&!g&&i()},children:(0,K.jsxs)(k,{children:[(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(44rem,90dvh)] w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5 text-fg`,children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(j,{className:`text-base font-semibold`,children:e?a?`管理手机`:`Manage phone`:a?`添加手机`:`Add phone`}),(0,K.jsx)(D,{className:`mt-1 text-sm text-fg-muted`,children:a?`设备连接在 Gateway 所在电脑。修改权限会停止当前控制。`:`This phone connects to the Gateway host. Changing access stops active control.`})]}),(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{variant:`ghost`,disabled:g,"aria-label":a?`关闭`:`Close`,children:(0,K.jsx)(x,{className:`size-4`})})})]}),(0,K.jsxs)(`form`,{className:`mt-5 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`名称`:`Name`,(0,K.jsx)(`input`,{className:_e,value:o,maxLength:100,required:!0,onChange:e=>s(e.target.value)})]}),(0,K.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[`ADB: `,t]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`已启用 phone_use 工具的 Agent 可使用这台手机。`:`Agents with the phone_use tool can use this phone.`}),(0,K.jsx)(X,{deviceId:e?.id,serial:t,mode:c,selected:u,onModeChange:l,onSelectedChange:d,zh:a,disabled:g}),(0,K.jsx)(he,{deviceId:e?.id,value:f,onChange:p,disabled:g,zh:a}),(0,K.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-3 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),a?`允许访问这台手机`:`Enable access to this phone`]}),v&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,K.jsx)(C,{type:`button`,disabled:g,onClick:i,children:a?`取消`:`Cancel`}),(0,K.jsx)(C,{type:`submit`,variant:`primary`,disabled:g||!o.trim()||c===`selected`&&!u.length,children:g?a?`保存中…`:`Saving…`:a?`保存手机`:`Save phone`})]})]})]})]})})}function Z(){let[e,t]=i(),n=(t,n=!1)=>e.has(t)?e.get(t)===`1`:n,r=(e,r,i=!1)=>{r!==n(e,i)&&t(t=>{let n=new URLSearchParams(t);return n.set(e,r?`1`:`0`),n})},a=s(e=>e.language)===`zh`,c=N(`phone-settings`,ce),l=N(`phone-devices`,re,{refreshInterval:15e3}),v=N(`settings-agent-defaults`,B),x=v.data?.defaults.models.phoneUse?.primary??``,[S,E]=(0,G.useState)(x);(0,G.useEffect)(()=>{E(x)},[x]);let[D,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)(``),[j,M]=(0,G.useState)(``),[P,V]=(0,G.useState)(!1),[U,ie]=(0,G.useState)(),[ae,oe]=(0,G.useState)(),[ue,de]=(0,G.useState)(``),[q,J]=(0,G.useState)(``),[Y,fe]=(0,G.useState)(``),[X,he]=(0,G.useState)(()=>sessionStorage.getItem(`phone-settings-session`)??``),Z=N(X?[`phone-session`,X]:null,()=>W(`/sessions/${X}`),{refreshInterval:1500}),xe=o(),[Se,Ce]=(0,G.useState)({}),Q=Z.data,we=Q?.status===`running`,Te=ue||l.data?.defaultDeviceId||``,Ee=x===se,$=async(e,t)=>{O(!0),A(``),M(``);try{await e(),t&&M(t)}catch(e){A(e instanceof Error?e.message:String(e))}finally{O(!1)}},De=async e=>{let t=await B(),n={...t.defaults.models};e?n.phoneUse={primary:e,fallbacks:[]}:delete n.phoneUse;let r=await z({...t.defaults,models:n},{scope:`models`,expectedModels:t.defaults.models});await v.mutate(r,!1),E(e)},Oe=()=>$(async()=>{X&&Q&&![`closed`,`cancelled`,`failed`,`outcome_unknown`].includes(Q.status)&&await W(`/sessions/${X}/execute`,{op:`close`});let e=await W(`/sessions`,{deviceId:Te,mode:`control`});he(e.id),sessionStorage.setItem(`phone-settings-session`,e.id),await W(`/sessions/${e.id}/execute`,{op:`run`,goal:q,...Y?{expectText:Y}:{},maxActions:6})}),ke=e=>$(async()=>{await W(`/sessions/${X}/execute`,{op:e}),await Z.mutate()}),Ae=async e=>{Ce(t=>({...t,[e.id]:{pending:!0,text:a?`正在诊断…`:`Checking…`}}));try{let t=await W(`/devices/${e.id}/diagnostics`,{}),n=a?{device:`已连接`,disconnected:`未连接`,unauthorized:`未授权调试`,offline:`离线`}:{device:`Connected`,disconnected:`Disconnected`,unauthorized:`Debugging not authorized`,offline:`Offline`};Ce(r=>({...r,[e.id]:{pending:!1,text:`${a?`诊断结果`:`Diagnostics`}:${n[t.state]??t.state}`}}))}catch(t){Ce(n=>({...n,[e.id]:{pending:!1,error:!0,text:t instanceof Error?t.message:String(t)}}))}},je=a?{ready:`就绪`,running:`执行中`,paused:`已暂停`,needs_user:`等待人工处理`,completed:`执行结束`,cancelled:`已停止`,closed:`已关闭`,failed:`执行失败`,outcome_unknown:`结果待核查`}:{},Me=!!(l.data?.devices.length&&l.data.devices.every(e=>e.connection));return(0,K.jsxs)(ne,{gap:`gap-6`,className:`max-w-[48rem]`,children:[(0,K.jsx)(H,{aiSetup:`phone`,title:(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[a?`手机控制`:`Phone Use`,(0,K.jsx)(m,{})]}),subtitle:a?`让 AI 帮你操作 Android 手机。`:`Let AI work with your Android phone.`}),k&&(0,K.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-danger-soft p-3 text-sm text-danger`,children:k}),j&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:j}),c.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(c.error)}),(0,K.jsx)(`section`,{className:ye,"aria-label":a?`手机控制设置`:`Phone control settings`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-surface-inset text-fg-muted`,children:(0,K.jsx)(b,{className:`size-6`,"aria-hidden":!0})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`启用手机控制`:`Enable Phone Use`}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a?`连接与操作在 Gateway 电脑上执行。`:`Connects and runs on your Gateway computer.`})]})]}),c.data?(0,K.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":c.data.config.enabled,"aria-label":a?`启用手机控制`:`Enable Phone Use`,disabled:D||we,className:`touch-target flex shrink-0 items-center rounded-lg px-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,onClick:()=>{let e=!c.data.config.enabled;$(async()=>{await W(`/settings`,{...c.data.config,enabled:e},`PATCH`),await c.mutate()})},children:(0,K.jsx)(`span`,{className:`flex h-6 w-11 items-center rounded-full p-0.5 transition-colors motion-reduce:transition-none ${c.data.config.enabled?`bg-accent`:`bg-fg-muted/30`}`,children:(0,K.jsx)(`span`,{className:`size-5 rounded-full bg-white transition-transform motion-reduce:transition-none ${c.data.config.enabled?`translate-x-5`:`translate-x-0`}`})})}):(0,K.jsx)(w,{className:`h-8 w-12`})]})}),(0,K.jsx)(`section`,{className:ye,children:(0,K.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,K.jsx)(`span`,{children:a?`默认执行方式`:`Default execution strategy`}),c.data?(0,K.jsxs)(d,{"aria-label":a?`默认执行方式`:`Default execution strategy`,value:c.data.config.executionMode??`collaborative`,disabled:D,onChange:e=>{let t=e.target.value;$(async()=>{await W(`/settings`,{...c.data.config,executionMode:t},`PATCH`),await c.mutate()})},children:[(0,K.jsx)(f,{value:`collaborative`,children:a?`主 Agent 协作(默认)`:`Main Agent collaboration (default)`}),(0,K.jsx)(f,{value:`direct`,children:a?`直接执行`:`Direct execution`})]}):(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`协作:主 Agent 拆解目标并根据反馈继续。直接执行:手机模型自行规划完整手机任务。修改只影响新任务,聊天可覆盖。`:`Collaboration: the main Agent plans small goals using feedback. Direct: the phone model plans the full phone task. Changes affect new tasks; chats can override.`})]})}),(0,K.jsxs)(`section`,{"aria-label":a?`手机模型配置`:`Phone model configuration`,className:ye,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`操作模型`:`Phone model`}),c.data&&(0,K.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,K.jsx)(`span`,{children:a?`连接保持时间`:`Connection lifetime`}),(0,K.jsxs)(d,{"aria-label":a?`连接保持时间`:`Connection lifetime`,value:String(c.data.config.idleDisconnectMs??0),disabled:D||we,onChange:e=>{let t=Number(e.target.value);$(async()=>{await W(`/settings`,{...c.data.config,idleDisconnectMs:t},`PATCH`),await c.mutate()})},children:[(0,K.jsx)(f,{value:`0`,children:a?`保持连接,直到手动断开`:`Keep connected until disconnected`}),[15,30,60].map(e=>(0,K.jsx)(f,{value:String(e*6e4),children:a?`闲置 ${e} 分钟后断开`:`Disconnect after ${e} idle minutes`},e))]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`任务结束后保留连接;执行任务、人工操作和查看画面期间不计闲置。`:`Tasks finish without disconnecting. Running tasks, manual control and viewing the screen do not count as idle.`})]}),!v.data&&!v.error?(0,K.jsx)(w,{className:`h-20 w-full`}):(0,K.jsx)(ge,{value:x,onSelect:E,onSave:De,zh:a,disabled:D||we||!v.data}),v.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(v.error)}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-3`,children:(0,K.jsx)(C,{variant:`ghost`,className:`px-0 text-accent-fg hover:bg-transparent hover:underline`,disabled:D||!S||S===`phone-mock/settings-about`,onClick:()=>{$(async()=>{let e=await W(`/models/diagnostics`,{modelRef:S});M(e.mock?a?`模拟适配器可用;此测试不验证真实模型。`:`Mock adapter ready; this does not validate a real model.`:e.groundingVerified?a?`模型连接、动作协议和测试图定位通过;未操作真实手机。`:`Connection, protocol and test-image grounding passed. No phone was operated.`:a?`动作协议有效,但测试图定位未通过。`:`Protocol valid, but test-image grounding did not pass.`)})},children:a?`测试模型连接`:`Test model connection`})}),(0,K.jsxs)(`details`,{open:n(`privacy`),onToggle:e=>r(`privacy`,e.currentTarget.open),className:`group border-t border-edge-subtle pt-1 text-xs text-fg-muted`,children:[(0,K.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(y,{className:`size-4`,"aria-hidden":!0}),a?`隐私与执行限制`:`Privacy & execution limits`,(0,K.jsx)(u,{className:`ml-auto size-4 group-open:rotate-180`,"aria-hidden":!0})]}),(0,K.jsxs)(`div`,{className:`space-y-3 pb-2 leading-relaxed`,children:[(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:a?`手机截图会发送给所选模型;页面摘要可能进入聊天模型。`:`Phone screenshots go to the selected model; page summaries may reach the chat model.`}),` `,c.data&&(0,K.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[a?`每次小目标最多 12 步、${c.data.config.maxOperationDurationMs/1e3} 秒活跃执行时间;会话限制`:`Each goal: up to 12 actions / ${c.data.config.maxOperationDurationMs/1e3} active seconds. Session limits`,`: `,c.data.config.maxActionsPerSession,` `,a?`动作`:`actions`,` · `,c.data.config.maxModelRequests,` `,a?`模型请求`:`model requests`]}),(0,K.jsx)(`p`,{children:a?`远程浏览器无法访问你本机的 USB 设备。`:`A remote browser cannot access your local USB devices.`})]})]})]}),(0,K.jsxs)(`section`,{className:`space-y-3`,"aria-label":a?`手机管理`:`Phone management`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`手机管理`:`Phones`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(C,{variant:`ghost`,disabled:D,onClick:()=>V(!0),children:[(0,K.jsx)(g,{className:`size-4`,"aria-hidden":!0}),a?`添加手机`:`Add phone`]}),(0,K.jsxs)(C,{variant:`ghost`,disabled:D||l.isValidating,onClick:()=>{$(()=>l.mutate())},children:[(0,K.jsx)(_,{className:`size-4`,"aria-hidden":!0}),a?`刷新`:`Refresh`]})]})]}),!l.data&&!l.error?(0,K.jsx)(w,{className:`h-32 w-full rounded-xl`}):(0,K.jsxs)(`div`,{className:ye,children:[(l.error||!Me&&l.data?.diagnostic)&&(0,K.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[l.data?.diagnostic??String(l.error),` · `,a?`检查 Gateway 电脑的 Android SDK 与 ADB。`:`Check Android SDK and ADB on the Gateway host.`]}),l.data?.devices.map(e=>(0,K.jsxs)(`div`,{className:`border-b border-edge-subtle pb-4 last:border-b-0 last:pb-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-3 sm:flex-row sm:gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,K.jsx)(b,{className:`mt-0.5 size-5 shrink-0 text-fg-muted`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`p`,{className:`break-words text-sm font-medium`,children:[e.name,e.id===l.data?.defaultDeviceId&&(0,K.jsx)(`span`,{className:`ml-2 inline-block rounded-md bg-surface-inset px-2 py-0.5 text-xs font-normal text-fg-muted`,children:a?`默认`:`Default`})]}),(0,K.jsxs)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:[e.connection?`${a?`阿里云`:`Alibaba Cloud`} · ADB · `:``,e.serial,` · `,e.enabled?e.connection?a?`已配置 · 按需连接`:`Configured · Connects on demand`:{device:a?`已连接`:`Connected`,offline:a?`离线`:`Offline`,unauthorized:a?`待授权`:`Unauthorized`}[l.data?.discovery.find(t=>t.serial===e.serial)?.state??``]??(a?`未连接`:`Disconnected`):a?`已禁用`:`Disabled`]})]})]}),(0,K.jsxs)(`div`,{className:`flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1 self-end sm:self-start`,children:[(0,K.jsx)(C,{variant:`ghost`,disabled:D,onClick:()=>oe({device:e,serial:e.serial,name:e.name}),children:a?`管理`:`Manage`}),(0,K.jsx)(C,{variant:`ghost`,disabled:D||!e.enabled,onClick:()=>{$(async()=>{await W(`/devices/${e.id}/view`,{}),window.dispatchEvent(new Event(`phone-connections-changed`)),T.getState().show(e.id)})},children:a?`查看屏幕`:`View screen`}),(0,K.jsx)(C,{variant:`ghost`,disabled:D||!e.enabled,onClick:()=>{$(async()=>{let t=await W(`/devices/${e.id}/conversations`,{});window.dispatchEvent(new Event(`session-created`)),T.getState().hide(),xe(`/chat/${t.conversationId}`)})},children:a?`对话控制手机`:`Control in chat`}),(0,K.jsxs)(ee,{modal:!1,children:[(0,K.jsx)(F,{asChild:!0,children:(0,K.jsxs)(C,{variant:`ghost`,disabled:D,"aria-label":a?`${e.name}的更多操作`:`More actions for ${e.name}`,children:[a?`更多`:`More`,(0,K.jsx)(u,{className:`size-3.5`,"aria-hidden":!0})]})}),(0,K.jsx)(I,{children:(0,K.jsxs)(te,{align:`end`,sideOffset:6,collisionPadding:12,className:`z-[90] min-w-40 max-w-[calc(100vw-1.5rem)] rounded-xl border border-edge bg-surface-overlay p-1 text-fg shadow-popover`,children:[e.wireless&&(0,K.jsx)(L,{disabled:D||!e.enabled,className:ve,onSelect:()=>ie(e),children:a?`重新连接`:`Reconnect`}),(0,K.jsx)(L,{disabled:D||Se[e.id]?.pending,className:ve,onSelect:()=>{Ae(e)},children:e.connection?a?`连接诊断`:`Connect & diagnose`:a?`诊断`:`Diagnose`}),e.id!==l.data?.defaultDeviceId&&(0,K.jsx)(L,{disabled:D,className:ve,onSelect:()=>{$(async()=>{await W(`/devices/${e.id}/default`,{}),await l.mutate()})},children:a?`设为默认`:`Set default`}),(0,K.jsx)(R,{className:`my-1 border-t border-edge-subtle`}),(0,K.jsx)(L,{disabled:D,className:`${ve} text-danger`,onSelect:()=>{$(async()=>{await W(`/devices/${e.id}`,void 0,`DELETE`),await l.mutate()})},children:a?`移除连接`:`Remove connection`})]})})]})]})]}),(0,K.jsx)(`p`,{role:`status`,"aria-live":`polite`,title:Se[e.id]?.text,className:`h-5 truncate text-xs leading-5 ${Se[e.id]?.error?`text-danger`:`text-fg-muted`}`,children:Se[e.id]?.text})]},e.id)),l.data?.discovery.filter(e=>!l.data?.devices.some(t=>t.serial===e.serial)).map(e=>(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm`,children:e.name}),(0,K.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.emulator?a?`Android 模拟器`:`Android emulator`:`Android`,` · `,e.state]})]}),(0,K.jsx)(C,{disabled:D||e.state!==`device`,onClick:()=>oe({serial:e.serial,name:e.name}),children:a?`添加手机`:`Add phone`})]},e.serial)),!l.data?.devices.length&&!l.data?.discovery.length&&(0,K.jsx)(`p`,{className:`py-3 text-sm text-fg-muted`,children:a?`尚未发现设备。先启动 Android 模拟器,或通过 USB 连接手机并允许调试。`:`No devices found. Start an Android emulator, or connect a phone over USB and authorize debugging.`})]})]}),(0,K.jsx)(le,{expanded:n(`components`),onExpandedChange:e=>r(`components`,e),cloudOnly:Me,onChanged:()=>{l.mutate(),c.mutate()}}),(0,K.jsxs)(`details`,{open:n(`test`,!!X),onToggle:e=>r(`test`,e.currentTarget.open,!!X),className:`group rounded-2xl border border-edge bg-surface-panel`,"aria-label":a?`手机试运行`:`Phone test run`,children:[(0,K.jsxs)(`summary`,{className:`flex min-h-16 cursor-pointer list-none items-center gap-3 p-5 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(p,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`试运行`:`Test run`}),(0,K.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:a?`验证手机操作`:`Try a task`}),(0,K.jsx)(u,{className:`size-4 shrink-0 text-fg-muted group-open:rotate-180`,"aria-hidden":!0})]}),(0,K.jsxs)(`div`,{className:`space-y-4 border-t border-edge-subtle p-5`,children:[(0,K.jsxs)(d,{"aria-label":a?`测试手机`:`Test phone`,value:Te,disabled:D||we,onChange:e=>de(e.target.value),children:[(0,K.jsx)(f,{value:``,children:a?`选择手机`:`Choose phone`}),l.data?.devices.filter(e=>e.enabled).map(e=>(0,K.jsx)(f,{value:e.id,children:e.name},e.id))]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`本次授权的小目标`:`Authorized goal`,(0,K.jsx)(`textarea`,{className:_e,value:q,maxLength:2e3,onChange:e=>J(e.target.value)})]}),(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`完成时应显示的文字(可选)`:`Expected completion text (optional)`,(0,K.jsx)(`input`,{className:_e,value:Y,maxLength:200,onChange:e=>fe(e.target.value)})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`先手动打开允许的应用。模型说完成只表示执行结束,只有匹配界面证据才会显示验证通过。`:`First open an allowed app manually. A model completion claim remains unverified until native UI evidence matches.`})]}),(0,K.jsxs)(C,{variant:`primary`,disabled:D||we||!c.data?.config.enabled||!x||Ee||S!==x||!Te||!q.trim(),onClick:()=>{Oe()},children:[(0,K.jsx)(h,{className:`size-4`}),a?`开始试运行`:`Start test run`]}),Z.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(Z.error)}),Q&&(0,K.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4`,"aria-live":`polite`,children:[(0,K.jsxs)(`p`,{className:`text-sm font-medium`,children:[Q.deviceName,` · `,je[Q.status]??Q.status]}),(0,K.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[Q.actions,` `,a?`动作`:`actions`,` · `,Q.modelRequests,` `,a?`模型请求`:`model requests`,` · `,Q.verified?a?`界面条件已验证`:`UI condition verified`:a?`尚未验证完成`:`Completion unverified`]}),Q.message&&(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Q.message}),(Q.errorCode||Q.stopReason)&&(0,K.jsx)(`p`,{className:`break-all text-xs text-fg-muted`,children:Q.errorCode??Q.stopReason}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(C,{disabled:D||!we,onClick:()=>{ke(`pause`)},children:a?`暂停`:`Pause`}),(0,K.jsx)(C,{disabled:D||![`paused`,`needs_user`].includes(Q.status),onClick:()=>{ke(`resume`)},children:a?`恢复`:`Resume`}),(0,K.jsx)(C,{disabled:D||[`closed`,`cancelled`].includes(Q.status),onClick:()=>{ke(`cancel`)},children:a?`停止`:`Stop`}),(0,K.jsx)(C,{disabled:D,onClick:()=>{ke(`close`)},children:a?`释放手机`:`Release phone`}),Q.status===`ready`&&!Q.mock&&(0,K.jsx)(C,{disabled:D,onClick:()=>{$(async()=>{await W(`/sessions/${X}/execute`,{op:`run`,goal:q,...Y?{expectText:Y}:{}}),await Z.mutate()})},children:a?`继续当前目标`:`Continue goal`})]}),Q.facts?.length?(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`本次观察到的界面文字`:`Observed UI text`}),(0,K.jsx)(`ul`,{className:`mt-2 max-h-52 space-y-1 overflow-auto text-xs text-fg-muted`,children:Q.facts.map((e,t)=>(0,K.jsx)(`li`,{className:`break-words`,children:e},t))})]}):null]})]})]},X),P&&(0,K.jsx)(pe,{onAdded:()=>{l.mutate()},zh:a,onClose:()=>V(!1),onSelect:e=>{V(!1),oe({serial:e.serial,name:e.name})}}),U&&(0,K.jsx)(me,{device:U,zh:a,onClose:()=>ie(void 0),onConnected:async()=>{await l.mutate()}}),ae&&c.data&&(0,K.jsx)(be,{...ae,zh:a,onSave:async()=>{await l.mutate()},onClose:()=>oe(void 0)})]})}export{Z as PhoneSettingsPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as s}from"./locale-store-Br7IfbXK.js";import{t as c}from"./app-window-DXFNqt_0.js";import{t as l}from"./arrow-left-D880xG-P.js";import{t as u}from"./chevron-down-ccbiQQz_.js";import{n as d,r as f}from"./popover-select-DD8fmrxH.js";import{n as p,t as m}from"./beta-badge-BnzdzIEl.js";import{t as h}from"./play-kxZvpBg8.js";import{t as g}from"./plus-Q2yW6OE7.js";import{t as _}from"./refresh-cw-BRlGaq2w.js";import{t as v}from"./search-DA7gz22f.js";import{t as y}from"./shield-check-BU58siTV.js";import{t as b}from"./smartphone-DSSsQFqA.js";import{t as x}from"./x-B_N4OPjy.js";import{t as S}from"./cn-0WouolD0.js";import{t as C}from"./button-CnRSIP6m.js";import{t as w}from"./skeleton-BI5TyibZ.js";import{t as T}from"./phone-workspace-store-SN7hfddU.js";import{a as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dist-DfWfZ9iu.js";import{i as N}from"./vendor-swr-CdRzEUwF.js";import{t as P}from"./open-capability-settings-Cvb65hQB.js";import{l as ee,m as F,o as I,r as L,t as te,u as R}from"./dist-D3lWNSe7.js";import{n as z,t as B}from"./global-defaults-api-BWMbKu72.js";import{n as V}from"./providers-api-DOnNfkwQ.js";import{n as ne,t as H}from"./settings-page-header-DBL0_u0Z.js";import{t as U}from"./mobile-pair-qr-CuIbmw5x.js";import{a as re,c as W,i as ie,n as ae,o as oe,r as se,s as ce}from"./phone-model-picker-BmSxEr7M.js";import{t as le}from"./phone-dependencies-card-DBiKtzwz.js";var ue=n(),G=e(t(),1),K=r();function de({zh:e,onAdded:t}){let[n,r]=(0,G.useState)(e?`阿里云手机`:`Alibaba Cloud Phone`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(),[c,l]=(0,G.useState)(),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(``),g=(0,G.useRef)(void 0),_=(0,G.useRef)(!0),v=()=>{let e=g.current;g.current=void 0,l(void 0),e&&W(`/cloud/aliyun/tests/${e}`,void 0,`DELETE`).catch(()=>{})};(0,G.useEffect)(()=>(_.current=!0,()=>{_.current=!1,g.current&&W(`/cloud/aliyun/tests/${g.current}`,void 0,`DELETE`).catch(()=>{})}),[]);let y=async()=>{if(o){v(),p(!0),h(``);try{if(o.size>16384)throw Error(e?`私钥文件不能超过 16 KB`:`Private key must be at most 16 KB`);let t=await W(`/cloud/aliyun/test`,{endpoint:i.trim(),privateKey:await o.text()});if(!_.current){W(`/cloud/aliyun/tests/${t.token}`,void 0,`DELETE`).catch(()=>{});return}g.current=t.token,l(t)}catch(e){_.current&&h(String(e instanceof Error?e.message:e))}finally{_.current&&p(!1)}}},b=async()=>{if(c){p(!0),h(``);try{await W(`/cloud/aliyun/add`,{token:c.token,name:n.trim(),makeDefault:u}),g.current=void 0,t()}catch(e){_.current&&h(String(e instanceof Error?e.message:e))}finally{_.current&&p(!1)}}},x=`mt-2 w-full rounded-xl border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e?`在阿里云控制台绑定密钥对并创建 ADB 连接,复制公网或 Gateway 可访问的内网地址。无需云账号 AccessKey。`:`Bind a key pair and create an ADB connection in the Alibaba console. Use an address reachable from the Gateway. No cloud account AccessKey is needed.`}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`手机名称`:`Phone name`,(0,K.jsx)(`input`,{className:x,value:n,maxLength:100,disabled:f,onChange:e=>r(e.target.value)})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`ADB 地址`:`ADB address`,(0,K.jsx)(`input`,{className:x,placeholder:`203.0.113.10:10001`,value:i,disabled:f,autoComplete:`off`,onChange:e=>{v(),a(e.target.value)}})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[e?`私钥文件(adbkey)`:`Private key file (adbkey)`,(0,K.jsx)(`input`,{className:x,type:`file`,disabled:f,onChange:e=>{v(),s(e.target.files?.[0])}})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`私钥仅提交到当前 Gateway,添加后保存在 Gateway 凭据目录,不会替换电脑现有 ADB 密钥。`:`The key is sent only to this Gateway and saved in its credentials directory after adding. Existing host ADB keys stay unchanged.`}),(0,K.jsx)(C,{disabled:f||!i.trim()||!o,onClick:()=>void y(),children:f?e?`处理中…`:`Working…`:e?`测试连接`:`Test connection`}),m&&(0,K.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-danger`,children:m}),c&&(0,K.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[(0,K.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[e?`连接成功`:`Connected`,` · `,c.model,` · Android `,c.androidVersion]}),(0,K.jsx)(`img`,{src:c.screenshot,alt:e?`云手机当前画面`:`Current cloud phone screen`,className:`mx-auto max-h-64 rounded-lg object-contain`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`添加后可在聊天中使用实时视频、接管操作和交还 Agent;视频不可用时使用截图。测试结果有效期为 10 分钟。默认只允许系统设置,添加后可在「管理」中调整。`:`After adding, use live video, takeover and Agent handback in chat, with snapshots when video is unavailable. Test expires after 10 minutes. Settings is the initial allowed app; adjust it in Manage.`}),(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u,disabled:f,onChange:e=>d(e.target.checked)}),e?`设为默认手机`:`Set as default phone`]}),(0,K.jsx)(C,{variant:`primary`,disabled:f||!n.trim()||c.expiresAt<=Date.now(),onClick:()=>void b(),children:e?`添加手机`:`Add phone`})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`移除连接只删除 xopc 的连接与私钥,不会销毁云手机,也不会关闭阿里云侧的 ADB 端口。`:`Removing a connection deletes its xopc credentials. It does not destroy the cloud phone or close its cloud ADB endpoint.`})]})}var q=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm`,J=new Set([`connected`,`timeout`,`error`,`cancelled`]);function Y({zh:e,onSelect:t}){let[n,r]=(0,G.useState)(`qr`),[i,a]=(0,G.useState)(),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(``),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(``),[b,x]=(0,G.useState)(Date.now()),S=(0,G.useRef)(void 0),T=(0,G.useRef)(0),E=(0,G.useRef)(t);E.current=t;let D=N(`phone-wireless-discovery`,()=>W(`/wireless/discovery`),{refreshInterval:4e3}),O=()=>{T.current++;let e=S.current;S.current=void 0,e&&W(`/wireless/pairings/${e}`,void 0,`DELETE`).catch(()=>{})},k=async e=>{O();let t=T.current;_(!0),y(``),a(void 0),s(``);try{if(e===`connect`){let e=await W(`/wireless/connect`,{host:c,port:Number(f)});T.current===t&&E.current(e)}else{let n=await W(`/wireless/pairings`,e===`qr`?{method:`qr`}:{method:`code`,host:c,pairingPort:Number(u),code:m,...f?{connectPort:Number(f)}:{}});if(T.current!==t){W(`/wireless/pairings/${n.id}`,void 0,`DELETE`).catch(()=>{});return}S.current=n.id,a(n),h(``)}}catch(e){T.current===t&&y(e instanceof Error?e.message:String(e))}finally{T.current===t&&_(!1)}};(0,G.useEffect)(()=>(n===`qr`&&k(`qr`),O),[n]),(0,G.useEffect)(()=>{let t=!0;return s(``),i?.qrPayload&&U(i.qrPayload).then(e=>{t&&s(e)}).catch(()=>{t&&y(e?`二维码生成失败,请重试`:`Unable to render QR code`)}),()=>{t=!1}},[i?.qrPayload,e]),(0,G.useEffect)(()=>{if(!i||J.has(i.status))return;let e=!0,t,n=async()=>{try{let r=await W(`/wireless/pairings/${i.id}`);if(!e)return;if(a(r),x(Date.now()),r.status===`connected`&&r.device){E.current(r.device);return}J.has(r.status)||(t=setTimeout(()=>{n()},1e3))}catch(r){if(!e)return;y(r instanceof Error?r.message:String(r)),Date.now()<i.expiresAt+5e3?t=setTimeout(()=>{n()},2e3):a(e=>e&&{...e,status:`timeout`,qrPayload:void 0})}};return t=setTimeout(()=>{n()},1e3),()=>{e=!1,clearTimeout(t)}},[i?.id,i?.status]);let A=e?{waiting:`等待扫码`,pairing:`正在配对`,paired:`已配对,正在查找连接地址`,connecting:`正在连接`,connected:`已连接`,timeout:`操作超时`,error:`配对失败`,cancelled:`已取消`}:{waiting:`Waiting for scan`,pairing:`Pairing`,paired:`Paired · Finding connection address`,connecting:`Connecting`,connected:`Connected`,timeout:`Timed out`,error:`Pairing failed`,cancelled:`Cancelled`},j=g||!!(i&&!J.has(i.status));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-3 text-sm`,children:e?`手机须与 Gateway 所在电脑处于同一局域网。仅浏览器与手机同网还不够。支持 Android 11 及以上。`:`Android 11+. The phone and Gateway host must share a local network.`}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":e?`无线连接方式`:`Wireless connection method`,children:[[`qr`,e?`扫码配对`:`QR pairing`],[`code`,e?`配对码`:`Pairing code`],[`connect`,e?`连接已配对设备`:`Already paired`]].map(([e,t])=>(0,K.jsx)(C,{"aria-pressed":n===e,onClick:()=>{O(),_(!1),a(void 0),y(``),s(``),r(e)},children:t},e))}),(0,K.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-5 text-sm text-fg-muted`,children:[(0,K.jsx)(`li`,{children:e?`打开手机「设置 → 开发者选项 → 无线调试」。`:`Open Settings → Developer options → Wireless debugging.`}),(0,K.jsx)(`li`,{children:n===`qr`?e?`选择「使用二维码配对设备」,扫描下方二维码。`:`Choose Pair device with QR code and scan below.`:n===`code`?e?`选择「使用配对码配对设备」,填写显示的地址和六位配对码。`:`Choose Pair device with pairing code and enter its address and six-digit code.`:e?`填写无线调试首页显示的 IP 地址与连接端口。`:`Enter the IP and port shown on the main Wireless debugging screen.`})]}),D.isLoading&&(0,K.jsx)(w,{className:`h-12 w-full`}),(D.error||D.data?.mdns===!1)&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:e?`自动发现不可用。可使用配对码并手动填写连接端口。请检查 Gateway 的 ADB、网络及防火墙。`:`Discovery unavailable. Use a pairing code and enter the connection port manually. Check Gateway ADB, network and firewall.`}),n===`qr`?(0,K.jsxs)(`div`,{className:`space-y-3 text-center`,children:[o?(0,K.jsx)(`img`,{src:o,alt:e?`无线调试配对二维码`:`Wireless debugging pairing QR code`,className:`mx-auto size-60 rounded-lg bg-white`}):i&&!J.has(i.status)?(0,K.jsx)(w,{className:`mx-auto size-60`}):null,i&&(0,K.jsxs)(`p`,{role:`status`,className:`text-sm`,children:[A[i.status],J.has(i.status)?``:` · ${Math.max(0,Math.ceil((i.expiresAt-b)/1e3))}s`]}),(0,K.jsx)(C,{disabled:g,onClick:()=>{k(`qr`)},children:e?`重新生成`:`Regenerate`})]}):(0,K.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),k(n)},children:[D.data?.services.filter(e=>e.kind===(n===`code`?`pairing`:`connect`)).map(e=>(0,K.jsxs)(C,{type:`button`,disabled:j,onClick:()=>{if(l(e.host),n===`code`){d(String(e.port));let t=D.data?.services.find(t=>t.kind===`connect`&&t.host===e.host);p(t?String(t.port):``)}else p(String(e.port))},children:[e.host,`:`,e.port]},`${e.name}:${e.port}`)),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`手机 IP 地址`:`Phone IP address`,(0,K.jsx)(`input`,{className:q,value:c,onChange:e=>l(e.target.value.trim()),required:!0,disabled:j,placeholder:`192.168.1.10`})]}),n===`code`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`配对端口`:`Pairing port`,(0,K.jsx)(`input`,{className:q,type:`number`,min:1,max:65535,value:u,onChange:e=>d(e.target.value),required:!0,disabled:j})]}),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`六位配对码`:`Six-digit pairing code`,(0,K.jsx)(`input`,{className:q,inputMode:`numeric`,autoComplete:`off`,pattern:`[0-9]{6}`,maxLength:6,value:m,onChange:e=>h(e.target.value),required:!0,disabled:j})]})]}),(0,K.jsxs)(`label`,{className:`block space-y-1 text-sm`,children:[e?`连接端口`:`Connection port`,(0,K.jsx)(`input`,{className:q,type:`number`,min:1,max:65535,value:f,onChange:e=>p(e.target.value),required:n===`connect`,disabled:j,placeholder:e?`留空自动发现`:`Auto-discover if empty`})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`连接端口在无线调试首页显示,与配对端口不同,会随设备状态变化。`:`The connection port is on the main Wireless debugging screen. It differs from the pairing port and can change.`}),i&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm`,children:A[i.status]}),(0,K.jsx)(C,{type:`submit`,disabled:j,children:e?n===`code`?`配对并连接`:`连接`:n===`code`?`Pair and connect`:`Connect`})]}),i?.errorCode&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:i.errorCode===`PHONE_CONNECT_TIMEOUT`?e?`已配对,但未能连接。切换「连接已配对设备」并填写当前连接端口,无需重新配对。`:`Paired but not connected. Use Already paired with the current connection port.`:e?`未完成配对。请检查手机配对页面、网络和配对码后重试。`:`Pairing incomplete. Check the phone pairing screen, network and code, then retry.`}),j&&(0,K.jsx)(C,{onClick:()=>{O(),_(!1),a(void 0),s(``)},children:e?`取消配对`:`Cancel pairing`}),v&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]})}var fe=[{id:`wireless`,available:!0,name:[`无线连接 Android 手机`,`Wireless Android phone`],description:[`Android 11+,扫码或输入配对码,无需数据线。`,`Android 11+ · Pair with a QR code or pairing code.`]},{id:`local-adb`,available:!0,name:[`Gateway 电脑上的手机 / 模拟器`,`Phone or emulator on the Gateway host`],description:[`通过 USB 或已配对的无线 ADB 连接。`,`Connect over USB or previously paired wireless ADB.`]},{id:`remote-connector`,available:!1,name:[`通过本地连接器连接`,`Local connector`],description:[`Gateway 在服务器上,手机连接在你的电脑上。`,`Connect a phone on your computer to a remote Gateway.`]},{id:`aliyun`,available:!0,name:[`阿里云手机`,`Alibaba Cloud Phone`],description:[`填写 ADB 地址并上传私钥,连接已有云手机。`,`Connect an existing cloud phone with its ADB address and private key.`]},{id:`tencent`,available:!1,name:[`腾讯云手机`,`Tencent Cloud Phone`],description:[`连接云账号,选择地域和已有实例。`,`Connect an account, then choose a region and existing instance.`]}];function pe(e){let t=(0,ue.c)(48),{zh:n,onClose:r,onSelect:i,onAdded:a}=e,[o,s]=(0,G.useState)(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={refreshInterval:3e3},t[0]=c):c=t[0];let u=N(o===`local-adb`?`phone-devices`:null,re,c),d;t[1]===o?d=t[2]:(d=fe.find(e=>e.id===o),t[1]=o,t[2]=d);let f=d,p=+!n,m;t[3]===n?m=t[4]:(m=n?{device:`已连接,可添加`,unauthorized:`等待手机授权:解锁手机,点击「允许 USB 调试」`,offline:`设备离线:重新连接数据线或无线调试`,recovery:`恢复模式:请先启动 Android 系统`,sideload:`请退出刷机模式并启动 Android 系统`}:{device:`Connected · Ready to add`,unauthorized:`Unlock the phone and allow USB debugging`,offline:`Offline · Reconnect USB or wireless debugging`,recovery:`Boot Android before connecting`,sideload:`Exit sideload mode and boot Android`},t[3]=n,t[4]=m);let h=m,g;t[5]===u.data?.discovery?g=t[6]:(g=u.data?.discovery??[],t[5]=u.data?.discovery,t[6]=g);let v=g,y;t[7]===r?y=t[8]:(y=e=>{e||r()},t[7]=r,t[8]=y);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),t[9]=b):b=t[9];let S;t[10]!==o||t[11]!==n?(S=o&&(0,K.jsx)(C,{variant:`ghost`,"aria-label":n?`返回连接方式`:`Back to connection methods`,onClick:()=>s(void 0),children:(0,K.jsx)(l,{className:`size-4`})}),t[10]=o,t[11]=n,t[12]=S):S=t[12];let T=n?`添加手机`:`Add phone`,P;t[13]===T?P=t[14]:(P=(0,K.jsx)(j,{className:`text-base font-semibold`,children:T}),t[13]=T,t[14]=P);let ee=f?f.name[p]:n?`选择手机连接在哪里。手机模型在添加设备后独立配置。`:`Choose where the phone connects. Phone models are configured separately.`,F;t[15]===ee?F=t[16]:(F=(0,K.jsx)(D,{className:`mt-1 text-sm text-fg-muted`,children:ee}),t[15]=ee,t[16]=F);let I;t[17]!==F||t[18]!==P?(I=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[P,F]}),t[17]=F,t[18]=P,t[19]=I):I=t[19];let L=n?`关闭添加手机`:`Close add phone`,te;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,K.jsx)(x,{className:`size-4`}),t[20]=te):te=t[20];let R;t[21]===L?R=t[22]:(R=(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{variant:`ghost`,"aria-label":L,children:te})}),t[21]=L,t[22]=R);let z;t[23]!==I||t[24]!==R||t[25]!==S?(z=(0,K.jsxs)(`header`,{className:`flex shrink-0 items-start gap-3 border-b border-edge p-5`,children:[S,I,R]}),t[23]=I,t[24]=R,t[25]=S,t[26]=z):z=t[26];let B;t[27]!==u||t[28]!==v||t[29]!==p||t[30]!==o||t[31]!==a||t[32]!==r||t[33]!==i||t[34]!==h||t[35]!==n?(B=o?o===`aliyun`?(0,K.jsx)(de,{zh:n,onAdded:()=>{a?.(),r()}}):o===`wireless`?(0,K.jsx)(Y,{zh:n,onSelect:i}):o===`local-adb`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`rounded-xl bg-surface-inset p-3 text-sm`,children:n?`连接位置:Gateway 所在电脑。若 Gateway 在服务器上,浏览器无法访问你电脑的 USB 手机。`:`Connection location: the Gateway host. A remote Gateway cannot access your browser computer’s USB phone.`}),(0,K.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-sm text-fg-muted`,children:[(0,K.jsx)(`li`,{children:n?`手机开启开发者选项和 USB 调试;模拟器直接启动即可。`:`Enable developer options and USB debugging, or start an emulator.`}),(0,K.jsx)(`li`,{children:n?`用数据线连接 Gateway 电脑,在手机上允许 USB 调试。`:`Connect to the Gateway host with a data cable, then allow USB debugging on the phone.`}),(0,K.jsx)(`li`,{children:n?`等待下方显示设备,选择后确认名称和应用范围。`:`Select a discovered device below, then confirm its name and app access.`})]}),(0,K.jsxs)(`details`,{className:`text-sm`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:n?`使用无线连接或安装连接工具`:`Wireless connection or connection tools`}),(0,K.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:n?`可返回连接方式,选择「无线连接 Android 手机」进行扫码或配对码配对。ADB 可在手机控制页的「手机依赖状态」中手动安装,或使用 Gateway 电脑上已有的 Platform Tools;无需安装完整 Android Studio。`:`Choose Wireless Android phone to pair with a QR code or pairing code. Install ADB from Phone dependencies or use existing Platform Tools on the Gateway host.`}),(0,K.jsx)(`a`,{href:`https://developer.android.com/tools/adb`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-2 inline-block text-xs text-accent-fg hover:underline`,children:n?`查看 Android 官方连接指引`:`Android connection guide`})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:n?`发现的设备`:`Discovered devices`}),(0,K.jsxs)(C,{disabled:u.isValidating,onClick:()=>{u.mutate()},children:[(0,K.jsx)(_,{className:`size-4`}),n?`刷新`:`Refresh`]})]}),!u.data&&!u.error?(0,K.jsx)(w,{className:`h-24 w-full rounded-xl`}):null,(u.error||u.data?.diagnostic)&&(0,K.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[n?`无法检测设备,请检查 Gateway 电脑的 ADB 安装与连接。`:`Unable to detect devices. Check ADB on the Gateway host.`,(0,K.jsx)(`span`,{className:`mt-1 block break-all text-xs`,children:u.data?.diagnostic??String(u.error)})]}),v.map(e=>{let t=u.data?.devices.some(t=>t.serial===e.serial);return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-xl border border-edge p-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,K.jsx)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:e.serial}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:h[e.state]??e.state})]}),(0,K.jsx)(C,{disabled:t||e.state!==`device`,onClick:()=>i(e),children:t?n?`已添加`:`Added`:n?`选择设备`:`Choose device`})]},e.serial)}),u.data&&!v.length&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:n?`尚未发现设备。请检查数据线、手机调试授权,或启动模拟器。`:`No devices found. Check the cable and debugging authorization, or start an emulator.`})]}):(0,K.jsxs)(`div`,{className:`space-y-4 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:n?`此接入方式暂未支持`:`This connection method is not available yet`}),(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o===`remote-connector`?n?`后续可通过本地连接器将电脑上的手机接入远程 Gateway。当前请将手机连接到 Gateway 所在电脑。`:`A future local connector will connect your phone to a remote Gateway. For now, connect it to the Gateway host.`:n?`云手机适配器接入后,可配置云账号、选择地域和已有实例,再验证连接并添加。当前尚不能连接云实例,不会要求填写云密钥。`:`Once the cloud adapter is available, connect an account, select a region and existing instance, then verify and add it. Cloud connections are not supported yet.`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`添加已有实例与购买、创建、销毁实例分开处理。`:`Adding existing instances is separate from purchasing, creating or destroying them.`})]}):fe.map(e=>(0,K.jsxs)(`button`,{className:`block min-h-20 w-full rounded-xl border border-edge bg-surface-base p-4 text-left hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-accent`,onClick:()=>s(e.id),children:[(0,K.jsxs)(`span`,{className:`flex flex-wrap items-center justify-between gap-2 text-sm font-medium`,children:[e.name[p],!e.available&&(0,K.jsx)(`span`,{className:`text-xs font-normal text-fg-muted`,children:n?`暂未支持`:`Not available yet`})]}),(0,K.jsx)(`span`,{className:`mt-2 block text-xs text-fg-muted`,children:e.description[p]})]},e.id)),t[27]=u,t[28]=v,t[29]=p,t[30]=o,t[31]=a,t[32]=r,t[33]=i,t[34]=h,t[35]=n,t[36]=B):B=t[36];let V;t[37]===B?V=t[38]:(V=(0,K.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-5`,children:B}),t[37]=B,t[38]=V);let ne=n?`取消`:`Cancel`,H;t[39]===ne?H=t[40]:(H=(0,K.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge p-4`,children:(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{children:ne})})}),t[39]=ne,t[40]=H);let U;t[41]!==z||t[42]!==V||t[43]!==H?(U=(0,K.jsxs)(k,{children:[b,(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(42rem,90dvh)] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay text-fg`,children:[z,V,H]})]}),t[41]=z,t[42]=V,t[43]=H,t[44]=U):U=t[44];let W;return t[45]!==U||t[46]!==y?(W=(0,K.jsx)(M,{open:!0,onOpenChange:y,children:U}),t[45]=U,t[46]=y,t[47]=W):W=t[47],W}function me({device:e,zh:t,onClose:n,onConnected:r}){let[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(e.wireless?.host??``),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``),m=async()=>{d(!0),p(``);try{await W(`/devices/${e.id}/reconnect`,i?{host:o,port:Number(c)}:{}),await r(),n()}catch(e){p(e instanceof Error?e.message:String(e)),a(!0)}finally{d(!1)}};return(0,K.jsx)(M,{open:!0,onOpenChange:e=>{!e&&!u&&n()},children:(0,K.jsxs)(k,{children:[(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(28rem,90dvh)] w-[min(32rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5 text-fg`,children:[(0,K.jsxs)(j,{className:`text-base font-semibold`,children:[t?`重新连接手机`:`Reconnect phone`,` · `,e.name]}),(0,K.jsx)(D,{className:`mt-2 text-sm text-fg-muted`,children:t?`开启手机无线调试,并连接 Gateway 所在局域网。重连会保留设备权限,之前的任务需要重新打开。`:`Enable wireless debugging on the Gateway network. Device permissions are preserved; reopen the previous task.`}),(0,K.jsxs)(`form`,{className:`mt-4 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto`,children:[(0,K.jsxs)(`label`,{className:`flex min-h-11 items-center gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:i,disabled:u,onChange:e=>a(e.target.checked)}),t?`手动填写当前连接地址`:`Enter current connection address`]}),i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`label`,{className:`block text-sm`,children:[t?`手机 IP 地址`:`Phone IP address`,(0,K.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,required:!0,value:o,disabled:u,onChange:e=>s(e.target.value.trim())})]}),(0,K.jsxs)(`label`,{className:`block text-sm`,children:[t?`连接端口(无线调试首页)`:`Connection port (Wireless debugging screen)`,(0,K.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,type:`number`,min:1,max:65535,required:!0,value:c,disabled:u,onChange:e=>l(e.target.value)})]})]}),f&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f})]}),(0,K.jsxs)(`footer`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,K.jsx)(C,{type:`button`,disabled:u,onClick:n,children:t?`取消`:`Cancel`}),(0,K.jsx)(C,{type:`submit`,variant:`primary`,disabled:u,children:u?t?`正在连接…`:`Connecting…`:t?`重新连接`:`Reconnect`})]})]})]})]})})}function X(e){let t=(0,ue.c)(29),{deviceId:n,serial:r,mode:i,selected:a,onModeChange:o,onSelectedChange:s,disabled:l,zh:u}=e,d=(0,G.useId)(),[f,p]=(0,G.useState)(``),m;t[0]!==n||t[1]!==i||t[2]!==r?(m=i===`selected`?[`phone-applications`,n??r]:null,t[0]=n,t[1]=i,t[2]=r,t[3]=m):m=t[3];let h;t[4]!==n||t[5]!==r?(h=()=>ie(n,r),t[4]=n,t[5]=r,t[6]=h):h=t[6];let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,shouldRetryOnError:!1},t[7]=g):g=t[7];let y=N(m,h,g),b;if(t[8]!==y||t[9]!==l||t[10]!==d||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==f||t[15]!==a||t[16]!==u){let e=f.trim().toLocaleLowerCase(),n=y.data?.filter(t=>`${t.label} ${t.packageName}`.toLocaleLowerCase().includes(e))??[],r=y.data,m=r?a.filter(e=>!r.some(t=>t.packageName===e)):[],h;t[18]!==s||t[19]!==a?(h=e=>s(a.includes(e)?a.filter(t=>t!==e):[...a,e]),t[18]=s,t[19]=a,t[20]=h):h=t[20];let g=h,x=u?`应用权限`:`Application access`,T;t[21]===x?T=t[22]:(T=(0,K.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:x}),t[21]=x,t[22]=T);let E;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`all`,`selected`],t[23]=E):E=t[23];let D;t[24]!==d||t[25]!==i||t[26]!==o||t[27]!==u?(D=(0,K.jsx)(`div`,{className:`grid gap-2`,children:E.map(e=>(0,K.jsxs)(`label`,{className:S(`flex min-h-14 cursor-pointer items-start gap-3 rounded-xl border p-3`,i===e?`border-accent/50 bg-accent-soft`:`border-edge bg-surface-base`),children:[(0,K.jsx)(`input`,{type:`radio`,name:d,value:e,checked:i===e,onChange:()=>o(e),className:`mt-1 size-4 shrink-0 accent-accent`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block text-sm font-medium`,children:e===`all`?u?`允许所有应用`:`Allow all apps`:u?`仅允许所选应用`:`Only selected apps`}),(0,K.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-fg-muted`,children:e===`all`?u?`可在手机上的应用间切换,无需逐个配置。`:`Switch between apps on this phone without individual setup.`:u?`从手机上已安装的应用中选择。`:`Choose from applications installed on the phone.`})]})]},e))}),t[24]=d,t[25]=i,t[26]=o,t[27]=u,t[28]=D):D=t[28],b=(0,K.jsxs)(`fieldset`,{disabled:l,className:`space-y-3`,children:[T,D,i===`selected`?(0,K.jsxs)(`div`,{className:`space-y-2`,"aria-label":u?`选择手机应用`:`Choose phone applications`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:u?`已选择 ${a.length} 个应用`:`${a.length} apps selected`}),(0,K.jsxs)(C,{variant:`ghost`,className:`gap-1 px-2 py-1 text-xs`,"aria-label":u?`刷新应用列表`:`Refresh applications`,disabled:l||y.isValidating,onClick:()=>{y.mutate()},children:[(0,K.jsx)(_,{className:S(`size-3.5`,y.isValidating&&`animate-spin motion-reduce:animate-none`),"aria-hidden":!0}),u?`刷新`:`Refresh`]})]}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(v,{className:`pointer-events-none absolute left-3 top-3 size-4 text-fg-muted`,"aria-hidden":!0}),(0,K.jsx)(`input`,{type:`search`,"aria-label":u?`搜索手机应用`:`Search phone applications`,placeholder:u?`搜索应用`:`Search apps`,value:f,onChange:e=>p(e.target.value),className:`min-h-10 w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-3 text-sm focus-visible:outline-2 focus-visible:outline-accent`})]}),y.error?(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:[u?`暂时无法读取应用,请确认手机已连接后重试。之前的选择会保留。`:`Unable to read apps. Check the phone connection and retry. Previous selections are preserved.`,(0,K.jsx)(C,{variant:`ghost`,className:`ml-1 text-accent`,onClick:()=>{y.mutate()},children:u?`重试`:`Retry`})]}):null,!y.data&&!y.error?(0,K.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(w,{className:`h-10 w-full`})]}):y.data?(0,K.jsxs)(`div`,{className:`max-h-56 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-base`,"aria-label":u?`可选应用`:`Available applications`,children:[n.map(e=>(0,K.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-3 px-3 py-2 hover:bg-surface-hover`,children:[(0,K.jsx)(c,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate text-sm`,title:e.label,children:e.label}),e.label!==e.packageName&&y.data.some(t=>t.packageName!==e.packageName&&t.label===e.label)?(0,K.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:e.packageName}):null]}),(0,K.jsx)(`input`,{type:`checkbox`,"aria-label":e.label,checked:a.includes(e.packageName),onChange:()=>g(e.packageName),className:`size-4 shrink-0 accent-accent`})]},e.packageName)),n.length?null:(0,K.jsx)(`p`,{className:`p-4 text-center text-sm text-fg-muted`,children:e?u?`没有找到匹配的应用`:`No matching applications`:u?`这台手机上没有可打开的应用`:`No launchable applications on this phone`})]}):null,m.length?(0,K.jsxs)(`div`,{className:`space-y-1 text-xs text-fg-muted`,children:[(0,K.jsx)(`p`,{children:u?`以下原有选择未在手机上找到,可取消选择。`:`These previous selections are no longer available. You may deselect them.`}),m.map(e=>(0,K.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>g(e),className:`accent-accent`}),(0,K.jsx)(`span`,{className:`break-all`,children:e})]},e))]}):null,a.length?null:(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:u?`至少选择一个应用后保存。`:`Choose at least one application before saving.`})]}):null]}),t[8]=y,t[9]=l,t[10]=d,t[11]=i,t[12]=o,t[13]=s,t[14]=f,t[15]=a,t[16]=u,t[17]=b}else b=t[17];return b}function he({deviceId:e,value:t,onChange:n,disabled:r,zh:i}){let[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(``);async function l(){o(!0),c(``);try{let t=await W(`/devices/${e}/input-status`);c(t.unicode===`available`?i?`中文输入通道已就绪,具体应用仍需允许粘贴。`:`Unicode input is ready. The app must allow pasting.`:t.unicode===`setup_required`?i?`请在手机依赖中安装或修复 scrcpy server,再重试检测。无需安装手机输入法。`:`Install or repair scrcpy server under phone dependencies, then retry. No phone keyboard installation is needed.`:i?`这台手机暂不支持自动中文输入,请接管后使用手机自带键盘。`:`Automatic Unicode input is unavailable. Take over and use the phone keyboard.`)}catch{c(i?`暂时无法检测,请确认手机连接后重试。`:`Unable to check. Reconnect the phone and retry.`)}finally{o(!1)}}return(0,K.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge bg-surface-base p-3`,children:[(0,K.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center justify-between gap-3 text-sm font-medium`,children:[i?`允许自动输入文字`:`Allow automatic text input`,(0,K.jsx)(`input`,{type:`checkbox`,checked:t===`auto`,disabled:r,onChange:e=>n(e.target.checked?`auto`:`manual`),className:`size-4 accent-accent`})]}),(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:t===`auto`?i?`中文和 Emoji 通过手机剪贴板粘贴,不安装或切换输入法。输入内容可能留在手机剪贴板;不会读取或同步原有剪贴板。`:`Chinese and emoji use the phone clipboard without installing or switching keyboards. Supplied text may remain there; existing clipboard contents are never read or synced.`:i?`Agent 会在需要输入时暂停。请接管手机,使用手机自带键盘输入,完成后交还 Agent。`:`The Agent pauses when text is needed. Take over, type with the phone keyboard, then hand back to the Agent.`}),e?(0,K.jsx)(C,{variant:`ghost`,className:`min-h-9 px-2 text-xs text-accent`,disabled:r||a,onClick:()=>void l(),children:a?i?`正在检测…`:`Checking…`:i?`检测中文输入能力`:`Check Unicode input`}):null,s?(0,K.jsx)(`p`,{role:`status`,className:`text-xs leading-relaxed text-fg-muted`,children:s}):null]})}function ge({value:e,zh:t,disabled:n,onSave:r,onSelect:i}){let o=N(`phone-models`,oe),s=N(`phone-provider-meta`,V),[c,l]=(0,G.useState)(e),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(!1);(0,G.useEffect)(()=>{l(e)},[e]);let g=o.data?.models.find(e=>e.id===c),_=c.split(`/`)[0],v=s.data?.find(e=>e.id===_)?.name??_,y=!c||!!g?.configured,b=async()=>{if(!(u||!y)){d(!0),p(``),h(!1);try{await r(c),h(!0)}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(ae,{value:c,onChange:e=>{l(e),i?.(e),h(!1),p(``)},zh:t,disabled:n||u})}),(0,K.jsx)(C,{variant:c===e?`secondary`:`primary`,disabled:n||u||!o.data||!y||c===e,onClick:()=>{b()},children:u?t?`保存中…`:`Saving…`:t?`保存`:`Save`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[c&&o.data?(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:g?`${v} · ${g.configured?t?`凭据就绪`:`Credentials ready`:t?`请先配置凭据`:`Configure credentials first`}`:t?`当前模型不可用,请重新选择。`:`This model is unavailable. Choose another model.`}):null,(0,K.jsx)(a,{to:`/settings/capabilities/models?returnTo=%2Fsettings%2Fphone-use&purpose=phone`,onClick:e=>{!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&(e.preventDefault(),P(`chat`,`services`,`phone`))},className:`inline-flex min-h-8 items-center text-xs text-accent-fg hover:underline`,children:t?`管理模型`:`Manage models`})]}),f&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:f}),m&&(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:t?`手机模型已保存,请返回手机连接测试实际操作。`:`Phone model saved. Test it from the phone connection.`})]})}var _e=`w-full rounded-lg border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,ve=`min-h-11 w-full cursor-default rounded-lg px-3 py-2 text-left text-sm outline-none data-[highlighted]:bg-surface-hover data-[highlighted]:ring-2 data-[highlighted]:ring-inset data-[highlighted]:ring-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,ye=`space-y-4 rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`;function be({device:e,serial:t,name:n,onSave:r,onClose:i,zh:a}){let[o,s]=(0,G.useState)(e?.name??n),[c,l]=(0,G.useState)(e?.appAccess??(e?.allowedApps.length?`selected`:`all`)),[u,d]=(0,G.useState)(e?.allowedApps??[]),[f,p]=(0,G.useState)(e?.textInput??`auto`),[m,h]=(0,G.useState)(e?.enabled??!0),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(``),b=async()=>{_(!0),y(``);try{let n={name:o,appAccess:c,allowedApps:c===`all`?[]:u,textInput:f,enabled:m};await W(e?`/devices/${e.id}`:`/devices`,e?n:{...n,serial:t},e?`PATCH`:`POST`),await r(),i()}catch(e){y(e instanceof Error?e.message:String(e))}finally{_(!1)}};return(0,K.jsx)(M,{open:!0,onOpenChange:e=>{!e&&!g&&i()},children:(0,K.jsxs)(k,{children:[(0,K.jsx)(E,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,K.jsxs)(A,{className:`fixed left-1/2 top-1/2 z-[81] flex h-[min(44rem,90dvh)] w-[min(34rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5 text-fg`,children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(j,{className:`text-base font-semibold`,children:e?a?`管理手机`:`Manage phone`:a?`添加手机`:`Add phone`}),(0,K.jsx)(D,{className:`mt-1 text-sm text-fg-muted`,children:a?`设备连接在 Gateway 所在电脑。修改权限会停止当前控制。`:`This phone connects to the Gateway host. Changing access stops active control.`})]}),(0,K.jsx)(O,{asChild:!0,children:(0,K.jsx)(C,{variant:`ghost`,disabled:g,"aria-label":a?`关闭`:`Close`,children:(0,K.jsx)(x,{className:`size-4`})})})]}),(0,K.jsxs)(`form`,{className:`mt-5 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`名称`:`Name`,(0,K.jsx)(`input`,{className:_e,value:o,maxLength:100,required:!0,onChange:e=>s(e.target.value)})]}),(0,K.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[`ADB: `,t]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`已启用 phone_use 工具的 Agent 可使用这台手机。`:`Agents with the phone_use tool can use this phone.`}),(0,K.jsx)(X,{deviceId:e?.id,serial:t,mode:c,selected:u,onModeChange:l,onSelectedChange:d,zh:a,disabled:g}),(0,K.jsx)(he,{deviceId:e?.id,value:f,onChange:p,disabled:g,zh:a}),(0,K.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-3 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),a?`允许访问这台手机`:`Enable access to this phone`]}),v&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,K.jsx)(C,{type:`button`,disabled:g,onClick:i,children:a?`取消`:`Cancel`}),(0,K.jsx)(C,{type:`submit`,variant:`primary`,disabled:g||!o.trim()||c===`selected`&&!u.length,children:g?a?`保存中…`:`Saving…`:a?`保存手机`:`Save phone`})]})]})]})]})})}function Z(){let[e,t]=i(),n=(t,n=!1)=>e.has(t)?e.get(t)===`1`:n,r=(e,r,i=!1)=>{r!==n(e,i)&&t(t=>{let n=new URLSearchParams(t);return n.set(e,r?`1`:`0`),n})},a=s(e=>e.language)===`zh`,c=N(`phone-settings`,ce),l=N(`phone-devices`,re,{refreshInterval:15e3}),v=N(`settings-agent-defaults`,B),x=v.data?.defaults.models.phoneUse?.primary??``,[S,E]=(0,G.useState)(x);(0,G.useEffect)(()=>{E(x)},[x]);let[D,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)(``),[j,M]=(0,G.useState)(``),[P,V]=(0,G.useState)(!1),[U,ie]=(0,G.useState)(),[ae,oe]=(0,G.useState)(),[ue,de]=(0,G.useState)(``),[q,J]=(0,G.useState)(``),[Y,fe]=(0,G.useState)(``),[X,he]=(0,G.useState)(()=>sessionStorage.getItem(`phone-settings-session`)??``),Z=N(X?[`phone-session`,X]:null,()=>W(`/sessions/${X}`),{refreshInterval:1500}),xe=o(),[Se,Ce]=(0,G.useState)({}),Q=Z.data,we=Q?.status===`running`,Te=ue||l.data?.defaultDeviceId||``,Ee=x===se,$=async(e,t)=>{O(!0),A(``),M(``);try{await e(),t&&M(t)}catch(e){A(e instanceof Error?e.message:String(e))}finally{O(!1)}},De=async e=>{let t=await B(),n={...t.defaults.models};e?n.phoneUse={primary:e,fallbacks:[]}:delete n.phoneUse;let r=await z({...t.defaults,models:n},{scope:`models`,expectedModels:t.defaults.models});await v.mutate(r,!1),E(e)},Oe=()=>$(async()=>{X&&Q&&![`closed`,`cancelled`,`failed`,`outcome_unknown`].includes(Q.status)&&await W(`/sessions/${X}/execute`,{op:`close`});let e=await W(`/sessions`,{deviceId:Te,mode:`control`});he(e.id),sessionStorage.setItem(`phone-settings-session`,e.id),await W(`/sessions/${e.id}/execute`,{op:`run`,goal:q,...Y?{expectText:Y}:{},maxActions:6})}),ke=e=>$(async()=>{await W(`/sessions/${X}/execute`,{op:e}),await Z.mutate()}),Ae=async e=>{Ce(t=>({...t,[e.id]:{pending:!0,text:a?`正在诊断…`:`Checking…`}}));try{let t=await W(`/devices/${e.id}/diagnostics`,{}),n=a?{device:`已连接`,disconnected:`未连接`,unauthorized:`未授权调试`,offline:`离线`}:{device:`Connected`,disconnected:`Disconnected`,unauthorized:`Debugging not authorized`,offline:`Offline`};Ce(r=>({...r,[e.id]:{pending:!1,text:`${a?`诊断结果`:`Diagnostics`}:${n[t.state]??t.state}`}}))}catch(t){Ce(n=>({...n,[e.id]:{pending:!1,error:!0,text:t instanceof Error?t.message:String(t)}}))}},je=a?{ready:`就绪`,running:`执行中`,paused:`已暂停`,needs_user:`等待人工处理`,completed:`执行结束`,cancelled:`已停止`,closed:`已关闭`,failed:`执行失败`,outcome_unknown:`结果待核查`}:{},Me=!!(l.data?.devices.length&&l.data.devices.every(e=>e.connection));return(0,K.jsxs)(ne,{gap:`gap-6`,className:`max-w-[48rem]`,children:[(0,K.jsx)(H,{aiSetup:`phone`,title:(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[a?`手机控制`:`Phone Use`,(0,K.jsx)(m,{})]}),subtitle:a?`让 AI 帮你操作 Android 手机。`:`Let AI work with your Android phone.`}),k&&(0,K.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-danger-soft p-3 text-sm text-danger`,children:k}),j&&(0,K.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:j}),c.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(c.error)}),(0,K.jsx)(`section`,{className:ye,"aria-label":a?`手机控制设置`:`Phone control settings`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-surface-inset text-fg-muted`,children:(0,K.jsx)(b,{className:`size-6`,"aria-hidden":!0})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`启用手机控制`:`Enable Phone Use`}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a?`连接与操作在 Gateway 电脑上执行。`:`Connects and runs on your Gateway computer.`})]})]}),c.data?(0,K.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":c.data.config.enabled,"aria-label":a?`启用手机控制`:`Enable Phone Use`,disabled:D||we,className:`touch-target flex shrink-0 items-center rounded-lg px-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,onClick:()=>{let e=!c.data.config.enabled;$(async()=>{await W(`/settings`,{...c.data.config,enabled:e},`PATCH`),await c.mutate()})},children:(0,K.jsx)(`span`,{className:`flex h-6 w-11 items-center rounded-full p-0.5 transition-colors motion-reduce:transition-none ${c.data.config.enabled?`bg-accent`:`bg-fg-muted/30`}`,children:(0,K.jsx)(`span`,{className:`size-5 rounded-full bg-white transition-transform motion-reduce:transition-none ${c.data.config.enabled?`translate-x-5`:`translate-x-0`}`})})}):(0,K.jsx)(w,{className:`h-8 w-12`})]})}),(0,K.jsx)(`section`,{className:ye,children:(0,K.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,K.jsx)(`span`,{children:a?`默认执行方式`:`Default execution strategy`}),c.data?(0,K.jsxs)(d,{"aria-label":a?`默认执行方式`:`Default execution strategy`,value:c.data.config.executionMode??`collaborative`,disabled:D,onChange:e=>{let t=e.target.value;$(async()=>{await W(`/settings`,{...c.data.config,executionMode:t},`PATCH`),await c.mutate()})},children:[(0,K.jsx)(f,{value:`collaborative`,children:a?`主 Agent 协作(默认)`:`Main Agent collaboration (default)`}),(0,K.jsx)(f,{value:`direct`,children:a?`直接执行`:`Direct execution`})]}):(0,K.jsx)(w,{className:`h-10 w-full`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`协作:主 Agent 拆解目标并根据反馈继续。直接执行:手机模型自行规划完整手机任务。修改只影响新任务,聊天可覆盖。`:`Collaboration: the main Agent plans small goals using feedback. Direct: the phone model plans the full phone task. Changes affect new tasks; chats can override.`})]})}),(0,K.jsxs)(`section`,{"aria-label":a?`手机模型配置`:`Phone model configuration`,className:ye,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`操作模型`:`Phone model`}),c.data&&(0,K.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,K.jsx)(`span`,{children:a?`连接保持时间`:`Connection lifetime`}),(0,K.jsxs)(d,{"aria-label":a?`连接保持时间`:`Connection lifetime`,value:String(c.data.config.idleDisconnectMs??0),disabled:D||we,onChange:e=>{let t=Number(e.target.value);$(async()=>{await W(`/settings`,{...c.data.config,idleDisconnectMs:t},`PATCH`),await c.mutate()})},children:[(0,K.jsx)(f,{value:`0`,children:a?`保持连接,直到手动断开`:`Keep connected until disconnected`}),[15,30,60].map(e=>(0,K.jsx)(f,{value:String(e*6e4),children:a?`闲置 ${e} 分钟后断开`:`Disconnect after ${e} idle minutes`},e))]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`任务结束后保留连接;执行任务、人工操作和查看画面期间不计闲置。`:`Tasks finish without disconnecting. Running tasks, manual control and viewing the screen do not count as idle.`})]}),!v.data&&!v.error?(0,K.jsx)(w,{className:`h-20 w-full`}):(0,K.jsx)(ge,{value:x,onSelect:E,onSave:De,zh:a,disabled:D||we||!v.data}),v.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(v.error)}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-3`,children:(0,K.jsx)(C,{variant:`ghost`,className:`px-0 text-accent-fg hover:bg-transparent hover:underline`,disabled:D||!S||S===`phone-mock/settings-about`,onClick:()=>{$(async()=>{let e=await W(`/models/diagnostics`,{modelRef:S});M(e.mock?a?`模拟适配器可用;此测试不验证真实模型。`:`Mock adapter ready; this does not validate a real model.`:e.groundingVerified?a?`模型连接、动作协议和测试图定位通过;未操作真实手机。`:`Connection, protocol and test-image grounding passed. No phone was operated.`:a?`动作协议有效,但测试图定位未通过。`:`Protocol valid, but test-image grounding did not pass.`)})},children:a?`测试模型连接`:`Test model connection`})}),(0,K.jsxs)(`details`,{open:n(`privacy`),onToggle:e=>r(`privacy`,e.currentTarget.open),className:`group border-t border-edge-subtle pt-1 text-xs text-fg-muted`,children:[(0,K.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(y,{className:`size-4`,"aria-hidden":!0}),a?`隐私与执行限制`:`Privacy & execution limits`,(0,K.jsx)(u,{className:`ml-auto size-4 group-open:rotate-180`,"aria-hidden":!0})]}),(0,K.jsxs)(`div`,{className:`space-y-3 pb-2 leading-relaxed`,children:[(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:a?`手机截图会发送给所选模型;页面摘要可能进入聊天模型。`:`Phone screenshots go to the selected model; page summaries may reach the chat model.`}),` `,c.data&&(0,K.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[a?`每次小目标最多 12 步、${c.data.config.maxOperationDurationMs/1e3} 秒活跃执行时间;会话限制`:`Each goal: up to 12 actions / ${c.data.config.maxOperationDurationMs/1e3} active seconds. Session limits`,`: `,c.data.config.maxActionsPerSession,` `,a?`动作`:`actions`,` · `,c.data.config.maxModelRequests,` `,a?`模型请求`:`model requests`]}),(0,K.jsx)(`p`,{children:a?`远程浏览器无法访问你本机的 USB 设备。`:`A remote browser cannot access your local USB devices.`})]})]})]}),(0,K.jsxs)(`section`,{className:`space-y-3`,"aria-label":a?`手机管理`:`Phone management`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`手机管理`:`Phones`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(C,{variant:`ghost`,disabled:D,onClick:()=>V(!0),children:[(0,K.jsx)(g,{className:`size-4`,"aria-hidden":!0}),a?`添加手机`:`Add phone`]}),(0,K.jsxs)(C,{variant:`ghost`,disabled:D||l.isValidating,onClick:()=>{$(()=>l.mutate())},children:[(0,K.jsx)(_,{className:`size-4`,"aria-hidden":!0}),a?`刷新`:`Refresh`]})]})]}),!l.data&&!l.error?(0,K.jsx)(w,{className:`h-32 w-full rounded-xl`}):(0,K.jsxs)(`div`,{className:ye,children:[(l.error||!Me&&l.data?.diagnostic)&&(0,K.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[l.data?.diagnostic??String(l.error),` · `,a?`检查 Gateway 电脑的 Android SDK 与 ADB。`:`Check Android SDK and ADB on the Gateway host.`]}),l.data?.devices.map(e=>(0,K.jsxs)(`div`,{className:`border-b border-edge-subtle pb-4 last:border-b-0 last:pb-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-3 sm:flex-row sm:gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,K.jsx)(b,{className:`mt-0.5 size-5 shrink-0 text-fg-muted`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`p`,{className:`break-words text-sm font-medium`,children:[e.name,e.id===l.data?.defaultDeviceId&&(0,K.jsx)(`span`,{className:`ml-2 inline-block rounded-md bg-surface-inset px-2 py-0.5 text-xs font-normal text-fg-muted`,children:a?`默认`:`Default`})]}),(0,K.jsxs)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:[e.connection?`${a?`阿里云`:`Alibaba Cloud`} · ADB · `:``,e.serial,` · `,e.enabled?e.connection?a?`已配置 · 按需连接`:`Configured · Connects on demand`:{device:a?`已连接`:`Connected`,offline:a?`离线`:`Offline`,unauthorized:a?`待授权`:`Unauthorized`}[l.data?.discovery.find(t=>t.serial===e.serial)?.state??``]??(a?`未连接`:`Disconnected`):a?`已禁用`:`Disabled`]})]})]}),(0,K.jsxs)(`div`,{className:`flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1 self-end sm:self-start`,children:[(0,K.jsx)(C,{variant:`ghost`,disabled:D,onClick:()=>oe({device:e,serial:e.serial,name:e.name}),children:a?`管理`:`Manage`}),(0,K.jsx)(C,{variant:`ghost`,disabled:D||!e.enabled,onClick:()=>{$(async()=>{await W(`/devices/${e.id}/view`,{}),window.dispatchEvent(new Event(`phone-connections-changed`)),T.getState().show(e.id)})},children:a?`查看屏幕`:`View screen`}),(0,K.jsx)(C,{variant:`ghost`,disabled:D||!e.enabled,onClick:()=>{$(async()=>{let t=await W(`/devices/${e.id}/conversations`,{});window.dispatchEvent(new Event(`session-created`)),T.getState().hide(),xe(`/chat/${t.conversationId}`)})},children:a?`对话控制手机`:`Control in chat`}),(0,K.jsxs)(ee,{modal:!1,children:[(0,K.jsx)(F,{asChild:!0,children:(0,K.jsxs)(C,{variant:`ghost`,disabled:D,"aria-label":a?`${e.name}的更多操作`:`More actions for ${e.name}`,children:[a?`更多`:`More`,(0,K.jsx)(u,{className:`size-3.5`,"aria-hidden":!0})]})}),(0,K.jsx)(I,{children:(0,K.jsxs)(te,{align:`end`,sideOffset:6,collisionPadding:12,className:`z-[90] min-w-40 max-w-[calc(100vw-1.5rem)] rounded-xl border border-edge bg-surface-overlay p-1 text-fg shadow-popover`,children:[e.wireless&&(0,K.jsx)(L,{disabled:D||!e.enabled,className:ve,onSelect:()=>ie(e),children:a?`重新连接`:`Reconnect`}),(0,K.jsx)(L,{disabled:D||Se[e.id]?.pending,className:ve,onSelect:()=>{Ae(e)},children:e.connection?a?`连接诊断`:`Connect & diagnose`:a?`诊断`:`Diagnose`}),e.id!==l.data?.defaultDeviceId&&(0,K.jsx)(L,{disabled:D,className:ve,onSelect:()=>{$(async()=>{await W(`/devices/${e.id}/default`,{}),await l.mutate()})},children:a?`设为默认`:`Set default`}),(0,K.jsx)(R,{className:`my-1 border-t border-edge-subtle`}),(0,K.jsx)(L,{disabled:D,className:`${ve} text-danger`,onSelect:()=>{$(async()=>{await W(`/devices/${e.id}`,void 0,`DELETE`),await l.mutate()})},children:a?`移除连接`:`Remove connection`})]})})]})]})]}),(0,K.jsx)(`p`,{role:`status`,"aria-live":`polite`,title:Se[e.id]?.text,className:`h-5 truncate text-xs leading-5 ${Se[e.id]?.error?`text-danger`:`text-fg-muted`}`,children:Se[e.id]?.text})]},e.id)),l.data?.discovery.filter(e=>!l.data?.devices.some(t=>t.serial===e.serial)).map(e=>(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm`,children:e.name}),(0,K.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.emulator?a?`Android 模拟器`:`Android emulator`:`Android`,` · `,e.state]})]}),(0,K.jsx)(C,{disabled:D||e.state!==`device`,onClick:()=>oe({serial:e.serial,name:e.name}),children:a?`添加手机`:`Add phone`})]},e.serial)),!l.data?.devices.length&&!l.data?.discovery.length&&(0,K.jsx)(`p`,{className:`py-3 text-sm text-fg-muted`,children:a?`尚未发现设备。先启动 Android 模拟器,或通过 USB 连接手机并允许调试。`:`No devices found. Start an Android emulator, or connect a phone over USB and authorize debugging.`})]})]}),(0,K.jsx)(le,{expanded:n(`components`),onExpandedChange:e=>r(`components`,e),cloudOnly:Me,onChanged:()=>{l.mutate(),c.mutate()}}),(0,K.jsxs)(`details`,{open:n(`test`,!!X),onToggle:e=>r(`test`,e.currentTarget.open,!!X),className:`group rounded-2xl border border-edge bg-surface-panel`,"aria-label":a?`手机试运行`:`Phone test run`,children:[(0,K.jsxs)(`summary`,{className:`flex min-h-16 cursor-pointer list-none items-center gap-3 p-5 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(p,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:a?`试运行`:`Test run`}),(0,K.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:a?`验证手机操作`:`Try a task`}),(0,K.jsx)(u,{className:`size-4 shrink-0 text-fg-muted group-open:rotate-180`,"aria-hidden":!0})]}),(0,K.jsxs)(`div`,{className:`space-y-4 border-t border-edge-subtle p-5`,children:[(0,K.jsxs)(d,{"aria-label":a?`测试手机`:`Test phone`,value:Te,disabled:D||we,onChange:e=>de(e.target.value),children:[(0,K.jsx)(f,{value:``,children:a?`选择手机`:`Choose phone`}),l.data?.devices.filter(e=>e.enabled).map(e=>(0,K.jsx)(f,{value:e.id,children:e.name},e.id))]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`本次授权的小目标`:`Authorized goal`,(0,K.jsx)(`textarea`,{className:_e,value:q,maxLength:2e3,onChange:e=>J(e.target.value)})]}),(0,K.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`完成时应显示的文字(可选)`:`Expected completion text (optional)`,(0,K.jsx)(`input`,{className:_e,value:Y,maxLength:200,onChange:e=>fe(e.target.value)})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`先手动打开允许的应用。模型说完成只表示执行结束,只有匹配界面证据才会显示验证通过。`:`First open an allowed app manually. A model completion claim remains unverified until native UI evidence matches.`})]}),(0,K.jsxs)(C,{variant:`primary`,disabled:D||we||!c.data?.config.enabled||!x||Ee||S!==x||!Te||!q.trim(),onClick:()=>{Oe()},children:[(0,K.jsx)(h,{className:`size-4`}),a?`开始试运行`:`Start test run`]}),Z.error&&(0,K.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(Z.error)}),Q&&(0,K.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4`,"aria-live":`polite`,children:[(0,K.jsxs)(`p`,{className:`text-sm font-medium`,children:[Q.deviceName,` · `,je[Q.status]??Q.status]}),(0,K.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[Q.actions,` `,a?`动作`:`actions`,` · `,Q.modelRequests,` `,a?`模型请求`:`model requests`,` · `,Q.verified?a?`界面条件已验证`:`UI condition verified`:a?`尚未验证完成`:`Completion unverified`]}),Q.message&&(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Q.message}),(Q.errorCode||Q.stopReason)&&(0,K.jsx)(`p`,{className:`break-all text-xs text-fg-muted`,children:Q.errorCode??Q.stopReason}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(C,{disabled:D||!we,onClick:()=>{ke(`pause`)},children:a?`暂停`:`Pause`}),(0,K.jsx)(C,{disabled:D||![`paused`,`needs_user`].includes(Q.status),onClick:()=>{ke(`resume`)},children:a?`恢复`:`Resume`}),(0,K.jsx)(C,{disabled:D||[`closed`,`cancelled`].includes(Q.status),onClick:()=>{ke(`cancel`)},children:a?`停止`:`Stop`}),(0,K.jsx)(C,{disabled:D,onClick:()=>{ke(`close`)},children:a?`释放手机`:`Release phone`}),Q.status===`ready`&&!Q.mock&&(0,K.jsx)(C,{disabled:D,onClick:()=>{$(async()=>{await W(`/sessions/${X}/execute`,{op:`run`,goal:q,...Y?{expectText:Y}:{}}),await Z.mutate()})},children:a?`继续当前目标`:`Continue goal`})]}),Q.facts?.length?(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:a?`本次观察到的界面文字`:`Observed UI text`}),(0,K.jsx)(`ul`,{className:`mt-2 max-h-52 space-y-1 overflow-auto text-xs text-fg-muted`,children:Q.facts.map((e,t)=>(0,K.jsx)(`li`,{className:`break-words`,children:e},t))})]}):null]})]})]},X),P&&(0,K.jsx)(pe,{onAdded:()=>{l.mutate()},zh:a,onClose:()=>V(!1),onSelect:e=>{V(!1),oe({serial:e.serial,name:e.name})}}),U&&(0,K.jsx)(me,{device:U,zh:a,onClose:()=>ie(void 0),onConnected:async()=>{await l.mutate()}}),ae&&c.data&&(0,K.jsx)(be,{...ae,zh:a,onSave:async()=>{await l.mutate()},onClose:()=>oe(void 0)})]})}export{Z as PhoneSettingsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./locale-store-
|
|
1
|
+
import{p as e}from"./locale-store-Br7IfbXK.js";var t=e(e=>({activation:0,open:!1,selected:null,controlConversationId:null,displayMode:`docked`,position:null,floatingWidth:288,setFloatingWidth:t=>e({floatingWidth:t}),setDisplayMode:t=>e({displayMode:t}),setPosition:t=>e(e=>e.position?.x===t.x&&e.position?.y===t.y?e:{position:t}),show:(t,n=!0,r)=>e(e=>({activation:e.activation+ +!!n,selected:n||!e.selected?t??e.selected:e.selected,open:n||e.open,controlConversationId:n||!e.open?r??(t===void 0||t===e.selected?e.controlConversationId:null):e.controlConversationId})),hide:()=>e({open:!1})}));export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,n as o,o as s}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as a,n as o,o as s}from"./locale-store-Br7IfbXK.js";import{t as c}from"./package-wATCyihJ.js";import{t as ee}from"./x-B_N4OPjy.js";import{t as l}from"./button-CnRSIP6m.js";import{t as u}from"./skeleton-BI5TyibZ.js";import{a as d,i as f,n as p,o as m,r as te,s as ne,t as re}from"./dist-DfWfZ9iu.js";import{a as h,i as ie}from"./vendor-swr-CdRzEUwF.js";import{n as ae,t as oe}from"./agent-plugin-dialog-BoHL-b1o.js";import{n as se}from"./capability-links-DzQWK1Fh.js";import{t as ce}from"./capability-icon-DVoZxEgW.js";import{n as g,t as le}from"./plugin-presentation-CO5BFDGW.js";var _=n(),v=e(t(),1),y=r();function b(e){let t=(0,_.c)(61),{pluginId:n,initialConnect:r,onClose:b}=e,S=r!==void 0&&r,C=o(x).startsWith(`zh`),{mutate:w}=h(),[ue,T]=(0,v.useState)(!1),E=(0,v.useRef)(document.activeElement instanceof HTMLElement?document.activeElement:null),D;t[0]===n?D=t[1]:(D=async()=>{let e=await s(a(`/api/extensions/agent-plugins/${encodeURIComponent(n)}`));if(!e.ok)throw Error(e.error??`Plugin not found`);return e.payload},t[0]=n,t[1]=D);let O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O={revalidateOnFocus:!0},t[2]=O):O=t[2];let{data:k,error:A,mutate:j}=ie(`plugin-details:${n}`,D,O),M=k?g(k,C):C?`插件详情`:`Plugin details`,N=k?.localizations?.[C?`zh-CN`:`en`]?.description??k?.description;if(ue&&k){let e;t[3]!==j||t[4]!==T?(e=()=>{T(!1),j()},t[3]=j,t[4]=T,t[5]=e):e=t[5];let n;return t[6]!==k||t[7]!==b||t[8]!==e?(n=(0,y.jsx)(oe,{extension:k,onUninstalled:b,onClose:e}),t[6]=k,t[7]=b,t[8]=e,t[9]=n):n=t[9],n}let P;t[10]===b?P=t[11]:(P=e=>{e||b()},t[10]=b,t[11]=P);let F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,y.jsx)(d,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[12]=F):F=t[12];let I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{E.current?.isConnected&&(e.preventDefault(),E.current.focus({preventScroll:!0}))},t[13]=I):I=t[13];let L=k?.branding?.iconUrl,R;t[14]===L?R=t[15]:(R=(0,y.jsx)(ce,{iconUrl:L,fallback:c}),t[14]=L,t[15]=R);let z;t[16]===M?z=t[17]:(z=(0,y.jsx)(ne,{className:`truncate text-base font-semibold text-fg`,children:M}),t[16]=M,t[17]=z);let B;t[18]===k?B=t[19]:(B=k?(0,y.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:[k.version,` · `,k.name]}):null,t[18]=k,t[19]=B);let V;t[20]!==B||t[21]!==z?(V=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[z,B]}),t[20]=B,t[21]=z,t[22]=V):V=t[22];let H=C?`关闭插件详情`:`Close plugin details`,U;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(ee,{className:`size-5`,"aria-hidden":!0}),t[23]=U):U=t[23];let W;t[24]===H?W=t[25]:(W=(0,y.jsx)(p,{asChild:!0,children:(0,y.jsx)(l,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":H,children:U})}),t[24]=H,t[25]=W);let G;t[26]!==V||t[27]!==W||t[28]!==R?(G=(0,y.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-edge px-5 py-4`,children:[R,V,W]}),t[26]=V,t[27]=W,t[28]=R,t[29]=G):G=t[29];let K=C?`查看插件能力、管理账号连接与授权。关闭后返回原来的列表。`:`View plugin capabilities and manage account connections. Close to return to the list.`,q;t[30]===K?q=t[31]:(q=(0,y.jsx)(f,{className:`sr-only`,children:K}),t[30]=K,t[31]=q);let J;t[32]!==k||t[33]!==N||t[34]!==A||t[35]!==S||t[36]!==w||t[37]!==b||t[38]!==n||t[39]!==j||t[40]!==C?(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:A?(0,y.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:String(A)}):k?(0,y.jsxs)(y.Fragment,{children:[N?(0,y.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:N}):null,(0,y.jsx)(ae,{initialConnect:S,extension:k,zh:C,onChanged:async()=>{await j(),await w(`gateway-extensions-list`)}},n),k.components?.skills.length?(0,y.jsxs)(`section`,{className:`space-y-3 border-t border-edge pt-5`,children:[(0,y.jsx)(`h3`,{className:`text-sm font-medium`,children:C?`技能(${k.components.skills.length})`:`Skills (${k.components.skills.length})`}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:k.components.skills.map(e=>(0,y.jsx)(i,{onClick:b,to:`/capabilities/skills?${new URLSearchParams({tab:`installed`,source:`plugin`,q:k.dialect===`portable`?e.name:`${n}.${e.name}`})}`,className:`max-w-full break-words rounded-lg border border-edge px-3 py-2 text-sm text-accent hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.name},e.name))})]}):null]}):(0,y.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,y.jsx)(u,{className:`h-14 w-full`}),(0,y.jsx)(u,{className:`h-28 w-full`}),(0,y.jsx)(u,{className:`h-40 w-full`})]})}),t[32]=k,t[33]=N,t[34]=A,t[35]=S,t[36]=w,t[37]=b,t[38]=n,t[39]=j,t[40]=C,t[41]=J):J=t[41];let Y;t[42]!==k||t[43]!==T||t[44]!==C?(Y=k?(0,y.jsx)(l,{variant:`ghost`,onClick:()=>T(!0),children:C?`管理插件`:`Manage plugin`}):(0,y.jsx)(`span`,{}),t[42]=k,t[43]=T,t[44]=C,t[45]=Y):Y=t[45];let X;t[46]!==k||t[47]!==M||t[48]!==C?(X=k&&le(k)?(0,y.jsx)(l,{asChild:!0,children:(0,y.jsx)(i,{to:se(M,C),children:C?`开始使用`:`Start using`})}):(0,y.jsx)(p,{asChild:!0,children:(0,y.jsx)(l,{variant:`secondary`,children:C?`完成`:`Done`})}),t[46]=k,t[47]=M,t[48]=C,t[49]=X):X=t[49];let Z;t[50]!==Y||t[51]!==X?(Z=(0,y.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[Y,X]}),t[50]=Y,t[51]=X,t[52]=Z):Z=t[52];let Q;t[53]!==G||t[54]!==q||t[55]!==J||t[56]!==Z?(Q=(0,y.jsxs)(m,{children:[F,(0,y.jsxs)(te,{onCloseAutoFocus:I,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(38rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[G,q,J,Z]})]}),t[53]=G,t[54]=q,t[55]=J,t[56]=Z,t[57]=Q):Q=t[57];let $;return t[58]!==Q||t[59]!==P?($=(0,y.jsx)(re,{open:!0,onOpenChange:P,children:Q}),t[58]=Q,t[59]=P,t[60]=$):$=t[60],$}function x(e){return e.language}export{b as PluginDetailsDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{n,p as r}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{n,p as r}from"./locale-store-Br7IfbXK.js";import{t as i}from"./messages-ByFlEbsu.js";import{n as a,r as o}from"./popover-select-DD8fmrxH.js";import{t as s}from"./cn-0WouolD0.js";import{t as c}from"./middleware-Pd0e8Igk.js";import{o as l}from"./form-field-width-DJw_jULe.js";import{i as u}from"./theme-store-Dlnmgryi.js";var d=e(),f=[`compact`,`default`,`large`];function p(e){document.documentElement.dataset.fontScale=e}function m(){try{let e=localStorage.getItem(`xopc-web-font-scale`),t=`default`;if(e){let n=JSON.parse(e).state?.preference;n&&f.includes(n)&&(t=n)}p(t)}catch{p(`default`)}}var h=r(c(e=>({preference:`default`,setPreference:t=>{p(t),e({preference:t})}}),{name:`xopc-web-font-scale`}));function g(){p(h.getState().preference)}var _=t(),v=[`language`,`theme`,`font`];function y(e){let t=(0,d.c)(59),{variant:r,sections:c}=e,f=c===void 0?v:c,p=n(T),m=n(w),g=u(C),y=u(S),E=h(x),D=h(b),O;t[0]===p?O=t[1]:(O=i(p),t[0]=p,t[1]=O);let k=O.appearanceSettings,A=r===`page`?`w-full max-w-[min(100%,12rem)] shrink-0 sm:ml-auto sm:w-auto sm:max-w-[11rem]`:r===`toolbar`?`w-auto min-w-[6.5rem] max-w-[10rem] shrink-0 sm:min-w-[7.5rem]`:`w-full`,j;t[2]===A?j=t[3]:(j=s(l,A),t[2]=A,t[3]=j);let M=j,N=r===`page`?`flex flex-col gap-2 border-b border-edge-subtle px-4 py-3.5 last:border-b-0 sm:flex-row sm:items-center sm:justify-between sm:gap-6 sm:px-5 sm:py-4`:`flex flex-col gap-1.5`,P;t[4]===f?P=t[5]:(P=e=>f.includes(e),t[4]=f,t[5]=P);let F=P;if(r===`toolbar`){let e;t[6]!==k||t[7]!==p||t[8]!==M||t[9]!==m||t[10]!==F?(e=F(`language`)?(0,_.jsxs)(a,{className:M,value:p,"aria-label":k.languageTitle,onChange:e=>m(e.target.value),children:[(0,_.jsx)(o,{value:`en`,children:k.langOptionEn}),(0,_.jsx)(o,{value:`zh`,children:k.langOptionZh})]}):null,t[6]=k,t[7]=p,t[8]=M,t[9]=m,t[10]=F,t[11]=e):e=t[11];let n;t[12]!==k||t[13]!==M||t[14]!==y||t[15]!==F||t[16]!==g?(n=F(`theme`)?(0,_.jsxs)(a,{className:M,value:g,"aria-label":k.themeTitle,onChange:e=>y(e.target.value),children:[(0,_.jsx)(o,{value:`light`,children:k.themeOptionLight}),(0,_.jsx)(o,{value:`dark`,children:k.themeOptionDark}),(0,_.jsx)(o,{value:`system`,children:k.themeOptionSystem})]}):null,t[12]=k,t[13]=M,t[14]=y,t[15]=F,t[16]=g,t[17]=n):n=t[17];let r;t[18]!==k||t[19]!==E||t[20]!==M||t[21]!==D||t[22]!==F?(r=F(`font`)?(0,_.jsxs)(a,{className:M,value:E,"aria-label":k.fontScaleTitle,onChange:e=>D(e.target.value),children:[(0,_.jsx)(o,{value:`compact`,children:k.fontScaleCompact}),(0,_.jsx)(o,{value:`default`,children:k.fontScaleDefault}),(0,_.jsx)(o,{value:`large`,children:k.fontScaleLarge})]}):null,t[18]=k,t[19]=E,t[20]=M,t[21]=D,t[22]=F,t[23]=r):r=t[23];let i;return t[24]!==e||t[25]!==n||t[26]!==r?(i=(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[e,n,r]}),t[24]=e,t[25]=n,t[26]=r,t[27]=i):i=t[27],i}let I=r===`sidebar`&&`flex flex-col gap-4`,L;t[28]===I?L=t[29]:(L=s(I),t[28]=I,t[29]=L);let R;t[30]!==k||t[31]!==p||t[32]!==N||t[33]!==M||t[34]!==m||t[35]!==F||t[36]!==r?(R=F(`language`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.languageTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.languageDescription})]}),(0,_.jsxs)(a,{className:M,value:p,"aria-label":k.languageTitle,onChange:e=>m(e.target.value),children:[(0,_.jsx)(o,{value:`en`,children:k.langOptionEn}),(0,_.jsx)(o,{value:`zh`,children:k.langOptionZh})]})]}):null,t[30]=k,t[31]=p,t[32]=N,t[33]=M,t[34]=m,t[35]=F,t[36]=r,t[37]=R):R=t[37];let z;t[38]!==k||t[39]!==N||t[40]!==M||t[41]!==y||t[42]!==F||t[43]!==g||t[44]!==r?(z=F(`theme`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.themeTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.themeDescription})]}),(0,_.jsxs)(a,{className:M,value:g,"aria-label":k.themeTitle,onChange:e=>y(e.target.value),children:[(0,_.jsx)(o,{value:`light`,children:k.themeOptionLight}),(0,_.jsx)(o,{value:`dark`,children:k.themeOptionDark}),(0,_.jsx)(o,{value:`system`,children:k.themeOptionSystem})]})]}):null,t[38]=k,t[39]=N,t[40]=M,t[41]=y,t[42]=F,t[43]=g,t[44]=r,t[45]=z):z=t[45];let B;t[46]!==k||t[47]!==E||t[48]!==N||t[49]!==M||t[50]!==D||t[51]!==F||t[52]!==r?(B=F(`font`)?(0,_.jsxs)(`div`,{className:N,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:k.fontScaleTitle}),r===`page`?null:(0,_.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:k.fontScaleDescription})]}),(0,_.jsxs)(a,{className:M,value:E,"aria-label":k.fontScaleTitle,onChange:e=>D(e.target.value),children:[(0,_.jsx)(o,{value:`compact`,children:k.fontScaleCompact}),(0,_.jsx)(o,{value:`default`,children:k.fontScaleDefault}),(0,_.jsx)(o,{value:`large`,children:k.fontScaleLarge})]})]}):null,t[46]=k,t[47]=E,t[48]=N,t[49]=M,t[50]=D,t[51]=F,t[52]=r,t[53]=B):B=t[53];let V;return t[54]!==B||t[55]!==L||t[56]!==R||t[57]!==z?(V=(0,_.jsxs)(`div`,{className:L,children:[R,z,B]}),t[54]=B,t[55]=L,t[56]=R,t[57]=z,t[58]=V):V=t[58],V}function b(e){return e.setPreference}function x(e){return e.preference}function S(e){return e.setPreference}function C(e){return e.preference}function w(e){return e.setLanguage}function T(e){return e.language}export{h as i,m as n,g as r,y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a,i as o,n as s,p as c}from"./locale-store-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a,i as o,n as s,p as c}from"./locale-store-Br7IfbXK.js";import{t as l}from"./messages-ByFlEbsu.js";import{t as u}from"./createLucideIcon-DPHK1VkS.js";import{t as d}from"./activity-YogQEteU.js";import{t as f}from"./bot-DjLkhyZL.js";import{t as p}from"./circle-check-C23XjkUj.js";import{t as m}from"./circle-pause-CN9jYH2s.js";import{t as h}from"./clock-3-DnrAnuyZ.js";import{t as g}from"./external-link-DjqjBmc3.js";import{j as _}from"./notes-api-CUlhTRv0.js";import{t as v}from"./loader-circle-CifKLtgG.js";import{g as y}from"./markdown-view-DrVAMlwc.js";import{t as b}from"./message-square-fVE7Ghj1.js";import{t as x}from"./pause-DuPxgSxk.js";import{t as S}from"./play-kxZvpBg8.js";import{t as ee}from"./rotate-ccw-JM1TBLpp.js";import{t as C}from"./rotate-cw-LIg3Am9S.js";import{t as w}from"./sparkles-DHlfQFAF.js";import{t as T}from"./triangle-alert-2JXFNNKU.js";import{t as te}from"./volume-2-BSJhAY97.js";import{t as E}from"./zap-dximCGjy.js";import{t as ne}from"./cn-0WouolD0.js";import{t as D}from"./button-CnRSIP6m.js";import{i as re}from"./vendor-swr-CdRzEUwF.js";import{t as O}from"./automation-api-hRsGx-qe.js";var k=u(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),A=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),j=u(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),M=u(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),N=e(t(),1),P=n(),F=!1,I=[`play`,`pause`,`stop`,`seekto`,`seekbackward`,`seekforward`];function ie(){return typeof navigator>`u`?void 0:navigator.mediaSession}function ae(e){let t=ie();if(!t)return;F=!0;let n={play:e.resume,pause:e.pause,stop:e.stop,seekto:({seekTime:t})=>{t!==void 0&&e.seek(t)},seekbackward:({seekOffset:t})=>e.seek(e.position()-(t??10)),seekforward:({seekOffset:t})=>e.seek(e.position()+(t??10))};for(let e of I)try{t.setActionHandler(e,n[e])}catch{}}function oe(e){let t=ie();if(!(!F||!t)){typeof MediaMetadata<`u`&&t.metadata?.title!==e.source?.title&&(t.metadata=e.source?new MediaMetadata({title:e.source.title,artist:`xopc`}):null),t.playbackState=e.status===`playing`?`playing`:`paused`;try{t.setPositionState(e.durationComplete&&e.duration>0?{duration:e.duration,playbackRate:e.rate,position:Math.min(e.duration,Math.max(0,e.currentTime))}:void 0)}catch{}}}function L(){let e=ie();if(!(!F||!e)){F=!1,e.metadata=null,e.playbackState=`none`;for(let t of I)try{e.setActionHandler(t,null)}catch{}try{e.setPositionState()}catch{}}}var R=/```[\s\S]*?```|~~~[\s\S]*?~~~/g,se=/[^。!?!?\.\n]+[。!?!?\.]?|\n+/g;function ce(e){return e.replace(R,`
|
|
2
2
|
`).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/^#{1,6}\s+/gm,``).replace(/^\s*[-*+]\s+/gm,``).replace(/^\s*\d+[.)]\s+/gm,``).replace(/[|`*_~>]/g,` `).replace(/<[^>]+>/g,` `)}function le(e){if(!e.trim())return``;let t=e.replace(R,`
|
|
3
3
|
`),n;if(typeof DOMParser>`u`)n=ce(t);else{let e=y.parse(t,{gfm:!0,breaks:!1}),r=new DOMParser().parseFromString(`<main>${e}</main>`,`text/html`);r.querySelectorAll(`pre, script, style`).forEach(e=>e.remove()),r.querySelectorAll(`img`).forEach(e=>e.replaceWith(e.alt||``)),r.querySelectorAll(`br, p, h1, h2, h3, h4, h5, h6, li, tr`).forEach(e=>{e.append(r.createTextNode(`
|
|
4
4
|
`))}),n=r.body.textContent??``}return n.replace(/https?:\/\/\S+/gi,``).replace(/[\t ]+/g,` `).replace(/ *\n */g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{l as n,r,t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as a}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{l as n,r,t as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as a}from"./locale-store-Br7IfbXK.js";import{t as o}from"./skeleton-BI5TyibZ.js";import{i as s}from"./vendor-swr-CdRzEUwF.js";import{a as c,r as l}from"./product-delivery-DRyD9_Xq.js";import{n as u}from"./api-CRT9ZyH0.js";import{t as d}from"./open-route-MyZ2sB9C.js";var f=e(),p=t();function m(){let e=(0,f.c)(14),t=n(),i=a(h)===`zh`,m=l(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=s(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=i?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[0]=t,e[1]=i,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=c({...m,title:m.id,capabilities:[`open`]}),n;return e[3]!==t||e[4]!==i?(n=t?(0,p.jsx)(r,{to:t,replace:!0}):(0,p.jsx)(g,{message:i?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:i}),e[3]=t,e[4]=i,e[5]=n):n=e[5],n}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?i?`找不到这个应用,它可能已被删除。`:`This app was not found and may have been deleted.`:y instanceof Error?y.message:i?`无法打开这个应用。`:`Unable to open this app.`,n;return e[6]!==t||e[7]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[6]=t,e[7]=i,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=d(v),e[9]=v,e[10]=t);let n;return e[11]===t?n=e[12]:(n=(0,p.jsx)(r,{to:t,replace:!0}),e[11]=t,e[12]=n),n}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(o,{className:`h-6 w-48`}),(0,p.jsx)(o,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,f.c)(7),{message:n,zh:r}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=r?`查看应用`:`View apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(i,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as r,l as i,n as a}from"./locale-store-Bg_XR36n.js";import{t as o}from"./messages-DG4HLOER.js";import{t as s}from"./markdown-view-BUpXJUPv.js";import{t as c}from"./button-CnRSIP6m.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{i as u}from"./vendor-swr-CdRzEUwF.js";import{a as d}from"./api-Boc-CVh7.js";import{C as f,_ as p,n as m}from"./automation-task-card-wbnR5i6N.js";import{t as h}from"./automation-api-CZqL9l_d.js";import{i as g,n as _}from"./api-bL7sxjAF.js";import{n as v}from"./product-preview-modal-CPWRvBI9.js";import{t as y}from"./open-route-MyZ2sB9C.js";import{a as b,r as x}from"./automation-result-state-DRd-X_Ai.js";var S=e(),C=t(),w=new Set([`queued`,`running`,`cancelling`]);function T(e){let t=(0,S.c)(60),{automationId:n,runId:r}=e,i=a(O),d=i===`zh`,f,p;t[0]!==n||t[1]!==r?(f=[`automation-run-preview`,n,r],p=async()=>{let[e,t]=await Promise.all([h.get(n),r?h.getRun(r).then(D):Promise.resolve(void 0)]);if(t&&t.automationId!==n)throw Error(`Run does not belong to this task`);return{task:e.automation,run:t}},t[0]=n,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g={shouldRetryOnError:!1,refreshInterval:E},t[4]=g):g=t[4];let{data:_,error:v,mutate:y}=u(f,p,g);if(v){let e=d?`暂时无法读取这次运行,请重试。`:`Could not load this run. Try again.`,n;t[5]===e?n=t[6]:(n=(0,C.jsx)(`p`,{children:e}),t[5]=e,t[6]=n);let r;t[7]===y?r=t[8]:(r=()=>void y(),t[7]=y,t[8]=r);let i=d?`重试`:`Retry`,a;t[9]!==r||t[10]!==i?(a=(0,C.jsx)(c,{variant:`secondary`,onClick:r,children:i}),t[9]=r,t[10]=i,t[11]=a):a=t[11];let o;return t[12]!==n||t[13]!==a?(o=(0,C.jsxs)(`div`,{role:`alert`,className:`space-y-3 text-sm text-fg-muted`,children:[n,a]}),t[12]=n,t[13]=a,t[14]=o):o=t[14],o}if(!_){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,C.jsx)(l,{className:`h-6 w-2/3`}),(0,C.jsx)(l,{className:`h-4 w-1/3`}),(0,C.jsx)(l,{className:`h-32`})]}),t[15]=e):e=t[15],e}let T=_.run;if(!T){let e;t[16]===_.task.name?e=t[17]:(e=(0,C.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:_.task.name}),t[16]=_.task.name,t[17]=e);let n=d?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`This older link does not identify an execution. Choose one from the task history.`,r;t[18]===n?r=t[19]:(r=(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n}),t[18]=n,t[19]=r);let i;return t[20]!==e||t[21]!==r?(i=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[e,r]}),t[20]=e,t[21]=r,t[22]=i):i=t[22],i}let k;t[23]===_.task.name?k=t[24]:(k=(0,C.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:_.task.name}),t[23]=_.task.name,t[24]=k);let A;t[25]===i?A=t[26]:(A=o(i),t[25]=i,t[26]=A);let j=A.automations.status[T.status],M;t[27]!==T.createdAtMs||t[28]!==d?(M=new Date(T.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`),t[27]=T.createdAtMs,t[28]=d,t[29]=M):M=t[29];let N;t[30]!==j||t[31]!==M?(N=(0,C.jsxs)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:[j,` · `,M]}),t[30]=j,t[31]=M,t[32]=N):N=t[32];let P;t[33]!==k||t[34]!==N?(P=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[k,N]}),t[33]=k,t[34]=N,t[35]=P):P=t[35];let F;t[36]!==T.status||t[37]!==d?(F=T.status===`queued`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):T.status===`running`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=T.status,t[37]=d,t[38]=F):F=t[38];let I;t[39]===T.summary?I=t[40]:(I=T.summary?(0,C.jsx)(s,{content:T.summary}):null,t[39]=T.summary,t[40]=I);let L;t[41]!==i||t[42]!==T?(L=T.error?(0,C.jsx)(`p`,{className:`text-sm leading-6 text-danger`,children:x(T,i)}):null,t[41]=i,t[42]=T,t[43]=L):L=t[43];let R;t[44]!==n||t[45]!==i||t[46]!==T.id||t[47]!==T.status?(R=T.status===`failed`||T.status===`timeout`?(0,C.jsx)(m,{automationId:n,runId:T.id,language:i,variant:`secondary`}):null,t[44]=n,t[45]=i,t[46]=T.id,t[47]=T.status,t[48]=R):R=t[48];let z;t[49]!==i||t[50]!==T.id||t[51]!==T.status?(z=w.has(T.status)?null:(0,C.jsx)(b,{runId:T.id,language:i}),t[49]=i,t[50]=T.id,t[51]=T.status,t[52]=z):z=t[52];let B;return t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R||t[57]!==z||t[58]!==P?(B=(0,C.jsxs)(`div`,{className:`space-y-5`,children:[P,F,I,L,R,z]}),t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z,t[58]=P,t[59]=B):B=t[59],B}function E(e){return e&&(e.task.state.runningRunId||e.run&&w.has(e.run.status))?3e3:0}function D(e){return e.run}function O(e){return e.language}async function k(e){switch(e.kind){case`project`:return{kind:e.kind,value:await d(e.id)};case`automation`:{let[t,n]=await Promise.all([h.list(),h.runs(5,e.id)]);return{kind:e.kind,value:t.automations.find(t=>t.id===e.id),runs:n.runs}}case`local_app`:{let t=await _(e.id),n=e.sourceHash?await g(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var A={pending:[`等待中`,`Pending`],planned:[`计划中`,`Planned`],active:[`进行中`,`Active`],paused:[`已暂停`,`Paused`],completed:[`已完成`,`Completed`],cancelled:[`已取消`,`Cancelled`],archived:[`已归档`,`Archived`],queued:[`排队中`,`Queued`],running:[`运行中`,`Running`],succeeded:[`成功`,`Succeeded`],failed:[`失败`,`Failed`],timeout:[`超时`,`Timed out`],cancelling:[`取消中`,`Cancelling`],unknown:[`尚未评估`,`Not assessed`],on_track:[`进展正常`,`On track`],at_risk:[`存在风险`,`At risk`],off_track:[`偏离计划`,`Off track`]};function j(e){let t=(0,S.c)(5),{target:n}=e;if(n.kind===`automation`&&n.view===`run`){let e;return t[0]!==n.id||t[1]!==n.runId?(e=(0,C.jsx)(T,{automationId:n.id,runId:n.runId}),t[0]=n.id,t[1]=n.runId,t[2]=e):e=t[2],e}let r;return t[3]===n?r=t[4]:(r=(0,C.jsx)(M,{target:n}),t[3]=n,t[4]=r),r}function M(e){let t=(0,S.c)(95),{target:s}=e,c=i(L),l=a(I),d=l===`zh`,m=o(l),h;t[0]===d?h=t[1]:(h=e=>A[e]?.[+!d]||e,t[0]=d,t[1]=h);let g=h,_;t[2]!==s.href||t[3]!==c?(_=[`chat-product-preview`,s.href,c],t[2]=s.href,t[3]=c,t[4]=_):_=t[4];let b;t[5]===s?b=t[6]:(b=()=>k(s),t[5]=s,t[6]=b);let x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x={shouldRetryOnError:!1,refreshInterval:F},t[7]=x):x=t[7];let{data:w,error:T,isLoading:E}=u(_,b,x);if(E){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsx)(v,{}),t[8]=e):e=t[8],e}if(T){let e=d?`无法加载内容,它可能已删除或暂时不可用。`:`Unable to load this content. It may have been deleted or be temporarily unavailable.`,n;return t[9]===e?n=t[10]:(n=(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!w?.value){let e=d?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let D=P;if(w.kind===`project`){let e=w.value,n;t[13]===e.name?n=t[14]:(n=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[13]=e.name,t[14]=n);let r;t[15]!==e.status||t[16]!==g?(r=g(e.status),t[15]=e.status,t[16]=g,t[17]=r):r=t[17];let i;t[18]!==e.health||t[19]!==g?(i=g(e.health),t[18]=e.health,t[19]=g,t[20]=i):i=t[20];let a;t[21]!==r||t[22]!==i?(a=(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[r,` · `,i]}),t[21]=r,t[22]=i,t[23]=a):a=t[23];let o;t[24]!==D||t[25]!==e.description?(o=D(e.description),t[24]=D,t[25]=e.description,t[26]=o):o=t[26];let s;t[27]!==D||t[28]!==e.brief?(s=D(e.brief),t[27]=D,t[28]=e.brief,t[29]=s):s=t[29];let c;t[30]!==D||t[31]!==e.outcome?(c=D(e.outcome),t[30]=D,t[31]=e.outcome,t[32]=c):c=t[32];let l;t[33]!==s||t[34]!==c||t[35]!==n||t[36]!==a||t[37]!==o?(l=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[n,a,o,s,c]}),t[33]=s,t[34]=c,t[35]=n,t[36]=a,t[37]=o,t[38]=l):l=t[38];let u;t[39]!==e.successCriteria||t[40]!==d?(u=e.successCriteria?.length>0&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`完成标准`:`Success criteria`}),(0,C.jsx)(`ul`,{className:`list-disc space-y-2 pl-5 text-sm text-fg`,children:e.successCriteria.map(N)})]}),t[39]=e.successCriteria,t[40]=d,t[41]=u):u=t[41];let f;t[42]!==e.milestones||t[43]!==g||t[44]!==d?(f=e.milestones?.length>0&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`里程碑`:`Milestones`}),e.milestones.slice(0,8).map(e=>(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,g(e.status)]},e.id))]}),t[42]=e.milestones,t[43]=g,t[44]=d,t[45]=f):f=t[45];let p;t[46]!==D||t[47]!==e.recentUpdates||t[48]!==d?(p=e.recentUpdates?.[0]&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`最近进展`:`Latest update`}),D(e.recentUpdates[0].summary)]}),t[46]=D,t[47]=e.recentUpdates,t[48]=d,t[49]=p):p=t[49];let m;return t[50]!==l||t[51]!==u||t[52]!==f||t[53]!==p?(m=(0,C.jsxs)(`div`,{className:`space-y-6`,children:[l,u,f,p]}),t[50]=l,t[51]=u,t[52]=f,t[53]=p,t[54]=m):m=t[54],m}if(w.kind===`automation`){let e=w.value,n=e.action.kind===`agent`?e.action.instruction:void 0,r;t[55]===e.name?r=t[56]:(r=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[55]=e.name,t[56]=r);let i;t[57]!==e.description||t[58]!==D?(i=D(e.description),t[57]=e.description,t[58]=D,t[59]=i):i=t[59];let a;t[60]!==n||t[61]!==D?(a=D(n),t[60]=n,t[61]=D,t[62]=a):a=t[62];let o;t[63]!==e.state.nextRunAtMs||t[64]!==d?(o=e.state.nextRunAtMs&&(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[d?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),t[63]=e.state.nextRunAtMs,t[64]=d,t[65]=o):o=t[65];let s;t[66]===e.state.lastError?s=t[67]:(s=e.state.lastError&&(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[66]=e.state.lastError,t[67]=s);let c=d?`最近运行`:`Recent runs`,u;t[68]===c?u=t[69]:(u=(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:c}),t[68]=c,t[69]=u);let h;t[70]!==w.runs||t[71]!==D||t[72]!==g||t[73]!==d?(h=w.runs.length?w.runs.map(e=>(0,C.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[g(e.status),` · `,new Date(e.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),D(e.summary),e.error&&(0,C.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无运行记录。`:`No runs yet.`}),t[70]=w.runs,t[71]=D,t[72]=g,t[73]=d,t[74]=h):h=t[74];let _;return t[75]!==u||t[76]!==h?(_=(0,C.jsxs)(`section`,{className:`space-y-3`,children:[u,h]}),t[75]=u,t[76]=h,t[77]=_):_=t[77],(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[f(e)?d?`已完成`:`Completed`:e.enabled?d?`已启用`:`Enabled`:d?`已暂停`:`Paused`,` · `,p(e.trigger,m.automations,m.cron,l)]}),i,a,o,s]}),_]})}let O=w.value,j;t[78]===O.name?j=t[79]:(j=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:O.name}),t[78]=O.name,t[79]=j);let M=O.description||O.idea,R;t[80]!==D||t[81]!==M?(R=D(M),t[80]=D,t[81]=M,t[82]=R):R=t[82];let z;t[83]!==O.name||t[84]!==w.previewUrl||t[85]!==d?(z=w.previewUrl&&(0,C.jsx)(`iframe`,{title:d?`${O.name} 交互预览`:`${O.name} interactive preview`,src:r(w.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[83]=O.name,t[84]=w.previewUrl,t[85]=d,t[86]=z):z=t[86];let B;t[87]!==O||t[88]!==d?(B=O.installationState===`installed`&&O.enabled&&O.status===`installed`&&(0,C.jsx)(n,{to:y(O),className:`inline-flex rounded-lg bg-accent px-3 py-2 text-sm text-white focus-visible:ring-2 focus-visible:ring-accent`,children:d?`使用应用`:`Use app`}),t[87]=O,t[88]=d,t[89]=B):B=t[89];let V;return t[90]!==j||t[91]!==R||t[92]!==z||t[93]!==B?(V=(0,C.jsxs)(`div`,{className:`space-y-5`,children:[j,R,z,B]}),t[90]=j,t[91]=R,t[92]=z,t[93]=B,t[94]=V):V=t[94],V}function N(e,t){return(0,C.jsx)(`li`,{children:e},t)}function P(e){return e?.trim()?(0,C.jsx)(s,{content:e,mermaidActions:!1}):null}function F(e){return e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function I(e){return e.language}function L(e){return e.conversationId}export{j as default};
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as r,l as i,n as a}from"./locale-store-Br7IfbXK.js";import{t as o}from"./messages-ByFlEbsu.js";import{t as s}from"./markdown-view-DrVAMlwc.js";import{t as c}from"./button-CnRSIP6m.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{i as u}from"./vendor-swr-CdRzEUwF.js";import{a as d}from"./api-C3Tp9MkF.js";import{C as f,_ as p,n as m}from"./automation-task-card-MnzgyTVA.js";import{t as h}from"./automation-api-hRsGx-qe.js";import{i as g,n as _}from"./api-CRT9ZyH0.js";import{n as v}from"./product-preview-modal-BfNcGgXA.js";import{t as y}from"./open-route-MyZ2sB9C.js";import{a as b,r as x}from"./automation-result-state-CMfVTv_i.js";var S=e(),C=t(),w=new Set([`queued`,`running`,`cancelling`]);function T(e){let t=(0,S.c)(60),{automationId:n,runId:r}=e,i=a(O),d=i===`zh`,f,p;t[0]!==n||t[1]!==r?(f=[`automation-run-preview`,n,r],p=async()=>{let[e,t]=await Promise.all([h.get(n),r?h.getRun(r).then(D):Promise.resolve(void 0)]);if(t&&t.automationId!==n)throw Error(`Run does not belong to this task`);return{task:e.automation,run:t}},t[0]=n,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g={shouldRetryOnError:!1,refreshInterval:E},t[4]=g):g=t[4];let{data:_,error:v,mutate:y}=u(f,p,g);if(v){let e=d?`暂时无法读取这次运行,请重试。`:`Could not load this run. Try again.`,n;t[5]===e?n=t[6]:(n=(0,C.jsx)(`p`,{children:e}),t[5]=e,t[6]=n);let r;t[7]===y?r=t[8]:(r=()=>void y(),t[7]=y,t[8]=r);let i=d?`重试`:`Retry`,a;t[9]!==r||t[10]!==i?(a=(0,C.jsx)(c,{variant:`secondary`,onClick:r,children:i}),t[9]=r,t[10]=i,t[11]=a):a=t[11];let o;return t[12]!==n||t[13]!==a?(o=(0,C.jsxs)(`div`,{role:`alert`,className:`space-y-3 text-sm text-fg-muted`,children:[n,a]}),t[12]=n,t[13]=a,t[14]=o):o=t[14],o}if(!_){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,C.jsx)(l,{className:`h-6 w-2/3`}),(0,C.jsx)(l,{className:`h-4 w-1/3`}),(0,C.jsx)(l,{className:`h-32`})]}),t[15]=e):e=t[15],e}let T=_.run;if(!T){let e;t[16]===_.task.name?e=t[17]:(e=(0,C.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:_.task.name}),t[16]=_.task.name,t[17]=e);let n=d?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`This older link does not identify an execution. Choose one from the task history.`,r;t[18]===n?r=t[19]:(r=(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n}),t[18]=n,t[19]=r);let i;return t[20]!==e||t[21]!==r?(i=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[e,r]}),t[20]=e,t[21]=r,t[22]=i):i=t[22],i}let k;t[23]===_.task.name?k=t[24]:(k=(0,C.jsx)(`h2`,{className:`text-lg font-medium text-fg`,children:_.task.name}),t[23]=_.task.name,t[24]=k);let A;t[25]===i?A=t[26]:(A=o(i),t[25]=i,t[26]=A);let j=A.automations.status[T.status],M;t[27]!==T.createdAtMs||t[28]!==d?(M=new Date(T.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`),t[27]=T.createdAtMs,t[28]=d,t[29]=M):M=t[29];let N;t[30]!==j||t[31]!==M?(N=(0,C.jsxs)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:[j,` · `,M]}),t[30]=j,t[31]=M,t[32]=N):N=t[32];let P;t[33]!==k||t[34]!==N?(P=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[k,N]}),t[33]=k,t[34]=N,t[35]=P):P=t[35];let F;t[36]!==T.status||t[37]!==d?(F=T.status===`queued`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):T.status===`running`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=T.status,t[37]=d,t[38]=F):F=t[38];let I;t[39]===T.summary?I=t[40]:(I=T.summary?(0,C.jsx)(s,{content:T.summary}):null,t[39]=T.summary,t[40]=I);let L;t[41]!==i||t[42]!==T?(L=T.error?(0,C.jsx)(`p`,{className:`text-sm leading-6 text-danger`,children:x(T,i)}):null,t[41]=i,t[42]=T,t[43]=L):L=t[43];let R;t[44]!==n||t[45]!==i||t[46]!==T.id||t[47]!==T.status?(R=T.status===`failed`||T.status===`timeout`?(0,C.jsx)(m,{automationId:n,runId:T.id,language:i,variant:`secondary`}):null,t[44]=n,t[45]=i,t[46]=T.id,t[47]=T.status,t[48]=R):R=t[48];let z;t[49]!==i||t[50]!==T.id||t[51]!==T.status?(z=w.has(T.status)?null:(0,C.jsx)(b,{runId:T.id,language:i}),t[49]=i,t[50]=T.id,t[51]=T.status,t[52]=z):z=t[52];let B;return t[53]!==F||t[54]!==I||t[55]!==L||t[56]!==R||t[57]!==z||t[58]!==P?(B=(0,C.jsxs)(`div`,{className:`space-y-5`,children:[P,F,I,L,R,z]}),t[53]=F,t[54]=I,t[55]=L,t[56]=R,t[57]=z,t[58]=P,t[59]=B):B=t[59],B}function E(e){return e&&(e.task.state.runningRunId||e.run&&w.has(e.run.status))?3e3:0}function D(e){return e.run}function O(e){return e.language}async function k(e){switch(e.kind){case`project`:return{kind:e.kind,value:await d(e.id)};case`automation`:{let[t,n]=await Promise.all([h.list(),h.runs(5,e.id)]);return{kind:e.kind,value:t.automations.find(t=>t.id===e.id),runs:n.runs}}case`local_app`:{let t=await _(e.id),n=e.sourceHash?await g(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var A={pending:[`等待中`,`Pending`],planned:[`计划中`,`Planned`],active:[`进行中`,`Active`],paused:[`已暂停`,`Paused`],completed:[`已完成`,`Completed`],cancelled:[`已取消`,`Cancelled`],archived:[`已归档`,`Archived`],queued:[`排队中`,`Queued`],running:[`运行中`,`Running`],succeeded:[`成功`,`Succeeded`],failed:[`失败`,`Failed`],timeout:[`超时`,`Timed out`],cancelling:[`取消中`,`Cancelling`],unknown:[`尚未评估`,`Not assessed`],on_track:[`进展正常`,`On track`],at_risk:[`存在风险`,`At risk`],off_track:[`偏离计划`,`Off track`]};function j(e){let t=(0,S.c)(5),{target:n}=e;if(n.kind===`automation`&&n.view===`run`){let e;return t[0]!==n.id||t[1]!==n.runId?(e=(0,C.jsx)(T,{automationId:n.id,runId:n.runId}),t[0]=n.id,t[1]=n.runId,t[2]=e):e=t[2],e}let r;return t[3]===n?r=t[4]:(r=(0,C.jsx)(M,{target:n}),t[3]=n,t[4]=r),r}function M(e){let t=(0,S.c)(95),{target:s}=e,c=i(L),l=a(I),d=l===`zh`,m=o(l),h;t[0]===d?h=t[1]:(h=e=>A[e]?.[+!d]||e,t[0]=d,t[1]=h);let g=h,_;t[2]!==s.href||t[3]!==c?(_=[`chat-product-preview`,s.href,c],t[2]=s.href,t[3]=c,t[4]=_):_=t[4];let b;t[5]===s?b=t[6]:(b=()=>k(s),t[5]=s,t[6]=b);let x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x={shouldRetryOnError:!1,refreshInterval:F},t[7]=x):x=t[7];let{data:w,error:T,isLoading:E}=u(_,b,x);if(E){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsx)(v,{}),t[8]=e):e=t[8],e}if(T){let e=d?`无法加载内容,它可能已删除或暂时不可用。`:`Unable to load this content. It may have been deleted or be temporarily unavailable.`,n;return t[9]===e?n=t[10]:(n=(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!w?.value){let e=d?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let D=P;if(w.kind===`project`){let e=w.value,n;t[13]===e.name?n=t[14]:(n=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[13]=e.name,t[14]=n);let r;t[15]!==e.status||t[16]!==g?(r=g(e.status),t[15]=e.status,t[16]=g,t[17]=r):r=t[17];let i;t[18]!==e.health||t[19]!==g?(i=g(e.health),t[18]=e.health,t[19]=g,t[20]=i):i=t[20];let a;t[21]!==r||t[22]!==i?(a=(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[r,` · `,i]}),t[21]=r,t[22]=i,t[23]=a):a=t[23];let o;t[24]!==D||t[25]!==e.description?(o=D(e.description),t[24]=D,t[25]=e.description,t[26]=o):o=t[26];let s;t[27]!==D||t[28]!==e.brief?(s=D(e.brief),t[27]=D,t[28]=e.brief,t[29]=s):s=t[29];let c;t[30]!==D||t[31]!==e.outcome?(c=D(e.outcome),t[30]=D,t[31]=e.outcome,t[32]=c):c=t[32];let l;t[33]!==s||t[34]!==c||t[35]!==n||t[36]!==a||t[37]!==o?(l=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[n,a,o,s,c]}),t[33]=s,t[34]=c,t[35]=n,t[36]=a,t[37]=o,t[38]=l):l=t[38];let u;t[39]!==e.successCriteria||t[40]!==d?(u=e.successCriteria?.length>0&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`完成标准`:`Success criteria`}),(0,C.jsx)(`ul`,{className:`list-disc space-y-2 pl-5 text-sm text-fg`,children:e.successCriteria.map(N)})]}),t[39]=e.successCriteria,t[40]=d,t[41]=u):u=t[41];let f;t[42]!==e.milestones||t[43]!==g||t[44]!==d?(f=e.milestones?.length>0&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`里程碑`:`Milestones`}),e.milestones.slice(0,8).map(e=>(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,g(e.status)]},e.id))]}),t[42]=e.milestones,t[43]=g,t[44]=d,t[45]=f):f=t[45];let p;t[46]!==D||t[47]!==e.recentUpdates||t[48]!==d?(p=e.recentUpdates?.[0]&&(0,C.jsxs)(`section`,{className:`space-y-3`,children:[(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`最近进展`:`Latest update`}),D(e.recentUpdates[0].summary)]}),t[46]=D,t[47]=e.recentUpdates,t[48]=d,t[49]=p):p=t[49];let m;return t[50]!==l||t[51]!==u||t[52]!==f||t[53]!==p?(m=(0,C.jsxs)(`div`,{className:`space-y-6`,children:[l,u,f,p]}),t[50]=l,t[51]=u,t[52]=f,t[53]=p,t[54]=m):m=t[54],m}if(w.kind===`automation`){let e=w.value,n=e.action.kind===`agent`?e.action.instruction:void 0,r;t[55]===e.name?r=t[56]:(r=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[55]=e.name,t[56]=r);let i;t[57]!==e.description||t[58]!==D?(i=D(e.description),t[57]=e.description,t[58]=D,t[59]=i):i=t[59];let a;t[60]!==n||t[61]!==D?(a=D(n),t[60]=n,t[61]=D,t[62]=a):a=t[62];let o;t[63]!==e.state.nextRunAtMs||t[64]!==d?(o=e.state.nextRunAtMs&&(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[d?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),t[63]=e.state.nextRunAtMs,t[64]=d,t[65]=o):o=t[65];let s;t[66]===e.state.lastError?s=t[67]:(s=e.state.lastError&&(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[66]=e.state.lastError,t[67]=s);let c=d?`最近运行`:`Recent runs`,u;t[68]===c?u=t[69]:(u=(0,C.jsx)(`h3`,{className:`font-medium text-fg`,children:c}),t[68]=c,t[69]=u);let h;t[70]!==w.runs||t[71]!==D||t[72]!==g||t[73]!==d?(h=w.runs.length?w.runs.map(e=>(0,C.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[g(e.status),` · `,new Date(e.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),D(e.summary),e.error&&(0,C.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无运行记录。`:`No runs yet.`}),t[70]=w.runs,t[71]=D,t[72]=g,t[73]=d,t[74]=h):h=t[74];let _;return t[75]!==u||t[76]!==h?(_=(0,C.jsxs)(`section`,{className:`space-y-3`,children:[u,h]}),t[75]=u,t[76]=h,t[77]=_):_=t[77],(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,C.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[f(e)?d?`已完成`:`Completed`:e.enabled?d?`已启用`:`Enabled`:d?`已暂停`:`Paused`,` · `,p(e.trigger,m.automations,m.cron,l)]}),i,a,o,s]}),_]})}let O=w.value,j;t[78]===O.name?j=t[79]:(j=(0,C.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:O.name}),t[78]=O.name,t[79]=j);let M=O.description||O.idea,R;t[80]!==D||t[81]!==M?(R=D(M),t[80]=D,t[81]=M,t[82]=R):R=t[82];let z;t[83]!==O.name||t[84]!==w.previewUrl||t[85]!==d?(z=w.previewUrl&&(0,C.jsx)(`iframe`,{title:d?`${O.name} 交互预览`:`${O.name} interactive preview`,src:r(w.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[83]=O.name,t[84]=w.previewUrl,t[85]=d,t[86]=z):z=t[86];let B;t[87]!==O||t[88]!==d?(B=O.installationState===`installed`&&O.enabled&&O.status===`installed`&&(0,C.jsx)(n,{to:y(O),className:`inline-flex rounded-lg bg-accent px-3 py-2 text-sm text-white focus-visible:ring-2 focus-visible:ring-accent`,children:d?`使用应用`:`Use app`}),t[87]=O,t[88]=d,t[89]=B):B=t[89];let V;return t[90]!==j||t[91]!==R||t[92]!==z||t[93]!==B?(V=(0,C.jsxs)(`div`,{className:`space-y-5`,children:[j,R,z,B]}),t[90]=j,t[91]=R,t[92]=z,t[93]=B,t[94]=V):V=t[94],V}function N(e,t){return(0,C.jsx)(`li`,{children:e},t)}function P(e){return e?.trim()?(0,C.jsx)(s,{content:e,mermaidActions:!1}):null}function F(e){return e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function I(e){return e.language}function L(e){return e.conversationId}export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/product-preview-content-
|
|
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{t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/product-preview-content-D6NwUm3A.js","assets/vendor-react-BOUWij0V.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-Br7IfbXK.js","assets/messages-ByFlEbsu.js","assets/markdown-view-DrVAMlwc.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.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/dist-DfWfZ9iu.js","assets/dist-CxGUk8J-.js","assets/es2015-DBLcMg5B.js","assets/app-link-1j40sJ-z.js","assets/product-delivery-DRyD9_Xq.js","assets/schemas-CCWMleym.js","assets/local-apps-Ck6kACsY.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-C-DHb3Io.css","assets/button-CnRSIP6m.js","assets/skeleton-BI5TyibZ.js","assets/vendor-swr-CdRzEUwF.js","assets/api-C3Tp9MkF.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/automation-task-card-MnzgyTVA.js","assets/calendar-clock-D-quYVPe.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/popover-select-DD8fmrxH.js","assets/dist-CaUuvp8-.js","assets/dist-DusecO_p.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/clock-3-DnrAnuyZ.js","assets/message-circle-Badhj-4D.js","assets/pencil-DmIY3Oa-.js","assets/chat-agents-api-D8YS5amE.js","assets/gateway-config-swr-BOCt_zOo.js","assets/model-selector-CXcxc30J.js","assets/settings-2-D-csvaET.js","assets/open-capability-settings-Cvb65hQB.js","assets/interaction-BdhHBbYa.js","assets/registry-api-DFDvOTg4.js","assets/gateway-startup-retry-CvkJYurV.js","assets/form-field-width-DJw_jULe.js","assets/date-picker-kqic8j73.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/chevron-right-BweFrslA.js","assets/automation-api-hRsGx-qe.js","assets/api-CRT9ZyH0.js","assets/open-route-MyZ2sB9C.js","assets/automation-result-state-CMfVTv_i.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{t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-Br7IfbXK.js";import{t as s}from"./external-link-DjqjBmc3.js";import{V as c}from"./markdown-view-DrVAMlwc.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./button-CnRSIP6m.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{a as f,i as p,n as m,o as h,r as g,s as _,t as v}from"./dist-DfWfZ9iu.js";import{i as y}from"./vendor-swr-CdRzEUwF.js";import{r as b}from"./automation-task-card-MnzgyTVA.js";import{t as x}from"./automation-api-hRsGx-qe.js";var S=n(),C=e(t(),1),w=r(),T=(0,C.lazy)(()=>i(()=>import(`./product-preview-content-D6NwUm3A.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61]))),E={project:[`项目预览`,`Project preview`],automation:[`自动化详情`,`Automation details`],local_app:[`应用预览`,`App preview`]};function D(){let e=(0,S.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsxs)(`div`,{className:`space-y-4`,"aria-busy":`true`,children:[(0,w.jsx)(d,{className:`h-7 w-2/3`}),(0,w.jsx)(d,{className:`h-4 w-full`}),(0,w.jsx)(d,{className:`h-4 w-4/5`}),(0,w.jsx)(d,{className:`h-32 w-full`})]}),e[0]=t):t=e[0],t}function O(e){let t=(0,S.c)(8),{target:n,backgroundPath:r,onClose:i}=e;if(n.kind===`automation`&&n.view!==`run`){let e;return t[0]!==r||t[1]!==i||t[2]!==n?(e=(0,w.jsx)(k,{target:n,backgroundPath:r,onClose:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=e):e=t[3],e}let a;return t[4]!==r||t[5]!==i||t[6]!==n?(a=(0,w.jsx)(j,{target:n,backgroundPath:r,onClose:i}),t[4]=r,t[5]=i,t[6]=n,t[7]=a):a=t[7],a}function k(e){let t=(0,S.c)(34),{target:n,backgroundPath:r,onClose:i}=e,a=o(A),s,c;t[0]===n.id?(s=t[1],c=t[2]):(s=[`automation-card`,n.id],c=()=>x.get(n.id),t[0]=n.id,t[1]=s,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={revalidateOnFocus:!1,shouldRetryOnError:!1},t[3]=l):l=t[3];let{data:d,error:m,mutate:C}=y(s,c,l);if(d?.automation){if(d.automation.action.kind===`agent`&&!d.automation.management){let e;return t[4]!==d.automation||t[5]!==a||t[6]!==i?(e=(0,w.jsx)(b,{automation:d.automation,language:a,onClose:i}),t[4]=d.automation,t[5]=a,t[6]=i,t[7]=e):e=t[7],e}let e;return t[8]!==r||t[9]!==i||t[10]!==n?(e=(0,w.jsx)(j,{target:n,backgroundPath:r,onClose:i}),t[8]=r,t[9]=i,t[10]=n,t[11]=e):e=t[11],e}let T=a===`zh`,E;t[12]===i?E=t[13]:(E=e=>{e||i()},t[12]=i,t[13]=E);let O;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,w.jsx)(f,{className:`fixed inset-0 z-65 bg-scrim`}),t[14]=O):O=t[14];let k=T?`定时任务详情`:`Scheduled task details`,M;t[15]===k?M=t[16]:(M=(0,w.jsx)(_,{className:`mb-5 font-medium`,children:k}),t[15]=k,t[16]=M);let N=T?`查看和编辑定时任务。`:`View and edit the scheduled task.`,P;t[17]===N?P=t[18]:(P=(0,w.jsx)(p,{className:`sr-only`,children:N}),t[17]=N,t[18]=P);let F;t[19]!==m||t[20]!==C||t[21]!==T?(F=m?(0,w.jsxs)(`div`,{role:`alert`,className:`text-sm text-fg-muted`,children:[(0,w.jsx)(`p`,{children:T?`任务已不存在或暂时无法读取。`:`This task is unavailable.`}),(0,w.jsx)(u,{variant:`secondary`,onClick:()=>void C(),children:T?`重试`:`Retry`})]}):(0,w.jsx)(D,{}),t[19]=m,t[20]=C,t[21]=T,t[22]=F):F=t[22];let I=T?`关闭`:`Close`,L;t[23]!==i||t[24]!==I?(L=(0,w.jsx)(u,{className:`mt-auto self-end`,variant:`ghost`,onClick:i,children:I}),t[23]=i,t[24]=I,t[25]=L):L=t[25];let R;t[26]!==F||t[27]!==L||t[28]!==M||t[29]!==P?(R=(0,w.jsxs)(h,{children:[O,(0,w.jsxs)(g,{className:`fixed left-1/2 top-1/2 z-70 flex h-[min(600px,calc(100dvh-2rem))] w-[min(680px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay p-5`,children:[M,P,F,L]})]}),t[26]=F,t[27]=L,t[28]=M,t[29]=P,t[30]=R):R=t[30];let z;return t[31]!==R||t[32]!==E?(z=(0,w.jsx)(v,{open:!0,onOpenChange:E,children:R}),t[31]=R,t[32]=E,t[33]=z):z=t[33],z}function A(e){return e.language}function j(e){let t=(0,S.c)(30),{target:n,backgroundPath:r,onClose:i}=e,u=o(M)===`zh`,d=n.kind===`automation`&&n.view===`run`?u?`运行情况`:`Run progress`:E[n.kind][+!u],y;t[0]===i?y=t[1]:(y=e=>{e||i()},t[0]=i,t[1]=y);let b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,w.jsx)(f,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=b):b=t[2];let x;t[3]===d?x=t[4]:(x=(0,w.jsx)(_,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:d}),t[3]=d,t[4]=x);let O=u?`查看关联内容,或打开独立页面。`:`Preview related content or open its full page.`,k;t[5]===O?k=t[6]:(k=(0,w.jsx)(p,{className:`sr-only`,children:O}),t[5]=O,t[6]=k);let A;t[7]!==r||t[8]!==n.href||t[9]!==n.view||t[10]!==u?(A=n.view!==`run`&&(0,w.jsxs)(a,{to:c(n.href,r),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-accent hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,w.jsx)(s,{className:`size-4`,"aria-hidden":!0}),u?`打开独立页面`:`Open full page`]}),t[7]=r,t[8]=n.href,t[9]=n.view,t[10]=u,t[11]=A):A=t[11];let j=u?`关闭预览`:`Close preview`,N=u?`关闭预览`:`Close preview`,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,w.jsx)(l,{className:`size-4`,"aria-hidden":!0}),t[12]=P):P=t[12];let F;t[13]!==j||t[14]!==N?(F=(0,w.jsx)(m,{title:j,"aria-label":N,className:`flex size-8 shrink-0 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,children:P}),t[13]=j,t[14]=N,t[15]=F):F=t[15];let I;t[16]!==F||t[17]!==x||t[18]!==k||t[19]!==A?(I=(0,w.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 border-b border-edge bg-surface-panel px-5 py-3.5`,children:[x,k,A,F]}),t[16]=F,t[17]=x,t[18]=k,t[19]=A,t[20]=I):I=t[20];let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,w.jsx)(D,{}),t[21]=L):L=t[21];let R;t[22]===n?R=t[23]:(R=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5 sm:p-8`,children:(0,w.jsx)(C.Suspense,{fallback:L,children:(0,w.jsx)(T,{target:n},n.href)})}),t[22]=n,t[23]=R);let z;t[24]!==I||t[25]!==R?(z=(0,w.jsxs)(h,{children:[b,(0,w.jsxs)(g,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(48rem,calc(100dvh-2rem))] w-[min(52rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay focus:outline-none`,children:[I,R]})]}),t[24]=I,t[25]=R,t[26]=z):z=t[26];let B;return t[27]!==y||t[28]!==z?(B=(0,w.jsx)(v,{open:!0,onOpenChange:y,children:z}),t[27]=y,t[28]=z,t[29]=B):B=t[29],B}function M(e){return e.language}export{D as n,O as t};
|