@xopcai/xopc 0.0.431 → 0.0.433

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.
Files changed (186) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-WqnVruhY.js → activity-store-BpYGrRXw.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CSiO9c2F.js → agent-avatar-dicebear-DTgOSv6G.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-display-D-yds6wG.js → agent-avatar-display-BUH7ljEo.js} +2 -2
  6. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-_UT9C7bg.js → agent-defaults-settings-panel-B_FAikHA.js} +1 -1
  7. package/dist/gateway/static/root/assets/{agent-plugin-dialog-DVzYXsAy.js → agent-plugin-dialog-DPabZaSE.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agents-Ds7K3D7T.js → agents-BAPYP1Ka.js} +3 -3
  9. package/dist/gateway/static/root/assets/{agents-admin-api-Bgv4lJ9Y.js → agents-admin-api-CXCAHNPj.js} +1 -1
  10. package/dist/gateway/static/root/assets/{api-Dv6Cn-Rs.js → api-DMbimMEi.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-C-9J9ghT.js → api-oIK4hYkJ.js} +1 -1
  12. package/dist/gateway/static/root/assets/{app-management-settings-panel-BXJrrjH5.js → app-management-settings-panel-BZ3Fy8ZR.js} +1 -1
  13. package/dist/gateway/static/root/assets/{appearance-settings-oYjAVulT.js → appearance-settings-DsRTj1by.js} +1 -1
  14. package/dist/gateway/static/root/assets/{apps-page-D95yzj-f.js → apps-page-D-n71lO1.js} +1 -1
  15. package/dist/gateway/static/root/assets/{archive-plugin-DBPu3xCJ.js → archive-plugin-Bg1VTieK.js} +1 -1
  16. package/dist/gateway/static/root/assets/{automation-api-DAou8Kji.js → automation-api-CLPsgcQN.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automation-result-state-CA7LV098.js → automation-result-state-CKVnR4KG.js} +1 -1
  18. package/dist/gateway/static/root/assets/{automation-task-card-DIjI_Y1X.js → automation-task-card-D27Mw66U.js} +1 -1
  19. package/dist/gateway/static/root/assets/{automations-page-BQwSCkmd.js → automations-page-DGNTJ8lN.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automations-workspace-BUFTTjBq.js → automations-workspace-DWDWy-SG.js} +2 -2
  21. package/dist/gateway/static/root/assets/{binary-plugins-D25P9ZxQ.js → binary-plugins-CuwSdCG5.js} +1 -1
  22. package/dist/gateway/static/root/assets/{block-editor-BI105p1U.js → block-editor-Dtl2BG3t.js} +1 -1
  23. package/dist/gateway/static/root/assets/{browser-automation-inputs-DhDRvWQE.js → browser-automation-inputs-uGK086ag.js} +1 -1
  24. package/dist/gateway/static/root/assets/{browser-automations-page-CCPi1Bvy.js → browser-automations-page-Da_edNNS.js} +1 -1
  25. package/dist/gateway/static/root/assets/{browser-control-api-BN4F-bM1.js → browser-control-api-k3OOX3bS.js} +1 -1
  26. package/dist/gateway/static/root/assets/{browser-settings-page-BZXUZpjp.js → browser-settings-page-C1bSw-Jq.js} +1 -1
  27. package/dist/gateway/static/root/assets/{capabilities-LC-yEQYo.js → capabilities-CoeuLRt6.js} +1 -1
  28. package/dist/gateway/static/root/assets/{capabilities-u2z_KFRt.js → capabilities-DlHPLld_.js} +1 -1
  29. package/dist/gateway/static/root/assets/{capabilities-page-B8UgQ4dD.js → capabilities-page-IcwojmJK.js} +2 -2
  30. package/dist/gateway/static/root/assets/{capabilities-settings-panel-Bxn8HtEO.js → capabilities-settings-panel-CtY-bGIi.js} +1 -1
  31. package/dist/gateway/static/root/assets/{channels-9Uaa-IN0.js → channels-Cn1MWBL_.js} +1 -1
  32. package/dist/gateway/static/root/assets/{chat-agents-api-Cffxfzi1.js → chat-agents-api-BB0biwc7.js} +1 -1
  33. package/dist/gateway/static/root/assets/{chat-chart-block-Bbk0b3TV.js → chat-chart-block-QSvjx4w6.js} +1 -1
  34. package/dist/gateway/static/root/assets/{chat-page-e-xCsrdS.js → chat-page-CwP4OMdW.js} +16 -16
  35. package/dist/gateway/static/root/assets/{chat-terminal-dock-CQMuG-Bz.js → chat-terminal-dock-Cd51G9eG.js} +1 -1
  36. package/dist/gateway/static/root/assets/{command-palette-api-BRxfFgGA.js → command-palette-api-CEG10uE-.js} +1 -1
  37. package/dist/gateway/static/root/assets/{composer-payload-handoff-_9L2A5AZ.js → composer-payload-handoff-Bogdq9Hy.js} +1 -1
  38. package/dist/gateway/static/root/assets/{computer-settings-page-BIHbjBVt.js → computer-settings-page-DyAlOzqY.js} +1 -1
  39. package/dist/gateway/static/root/assets/{connected-providers-grid-B7ktDgqt.js → connected-providers-grid-D0lXg22c.js} +1 -1
  40. package/dist/gateway/static/root/assets/{connector-service-page-BVMEg8n-.js → connector-service-page-k2rjyjrp.js} +1 -1
  41. package/dist/gateway/static/root/assets/{connectors-api-B07yoCzk.js → connectors-api-DtvB9Cjm.js} +1 -1
  42. package/dist/gateway/static/root/assets/{connectors-page-hPKaJUWY.js → connectors-page-DI_Q0CKz.js} +1 -1
  43. package/dist/gateway/static/root/assets/{date-picker-BvEnSGZK.js → date-picker-CAankdQw.js} +1 -1
  44. package/dist/gateway/static/root/assets/{desktop-pet-C1z9YDEg.js → desktop-pet-DjM73fir.js} +1 -1
  45. package/dist/gateway/static/root/assets/{desktop-pet-settings-CbbVb8GY.js → desktop-pet-settings-Rmh-GxHl.js} +1 -1
  46. package/dist/gateway/static/root/assets/{dev-view-store-38EmUIEC.js → dev-view-store-BgW2Riyk.js} +1 -1
  47. package/dist/gateway/static/root/assets/{device-pairing-wizard-Wb1EKiXA.js → device-pairing-wizard-UdzSpNa5.js} +1 -1
  48. package/dist/gateway/static/root/assets/{directory-picker-path-field-BvKDrKc4.js → directory-picker-path-field-Rkw3f7lG.js} +1 -1
  49. package/dist/gateway/static/root/assets/{discussion-annotation-sync-BfVzIwe2.js → discussion-annotation-sync-Dudoj_Fz.js} +1 -1
  50. package/dist/gateway/static/root/assets/{extension-debug-page-CB9Lu3Sq.js → extension-debug-page-DxIGAO23.js} +1 -1
  51. package/dist/gateway/static/root/assets/{extension-iframe-host-BzjrVAUR.js → extension-iframe-host-63KpX6IP.js} +1 -1
  52. package/dist/gateway/static/root/assets/{extension-marketplace-api-DigziAgd.js → extension-marketplace-api-yXNUkQDA.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-page-DUa9MeaZ.js → extension-page-C811A_Ww.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-provider-301x0rh-.js → extension-provider-C4jLFIgh.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-settings-page-CP9ciZUI.js → extension-settings-page-WJSw5MT0.js} +1 -1
  56. package/dist/gateway/static/root/assets/{file-preview-surface-BaMGmCbw.js → file-preview-surface-zE9AcaHM.js} +1 -1
  57. package/dist/gateway/static/root/assets/{gateway-config-swr-BD4Bf8uu.js → gateway-config-swr-D6cc6W6E.js} +1 -1
  58. package/dist/gateway/static/root/assets/{gateway-realtime-CSd9VB7Z.js → gateway-realtime-BSRNLciy.js} +1 -1
  59. package/dist/gateway/static/root/assets/gateway-realtime-store-BFeFfApQ.js +1 -0
  60. package/dist/gateway/static/root/assets/{gateway-restart-CIUCTKYR.js → gateway-restart-Unun5hRL.js} +1 -1
  61. package/dist/gateway/static/root/assets/{gateway-settings-CCqF1uZv.js → gateway-settings-DP-DV-e5.js} +1 -1
  62. package/dist/gateway/static/root/assets/{gateway-startup-retry-BsU5k8oi.js → gateway-startup-retry-C8g666Ja.js} +1 -1
  63. package/dist/gateway/static/root/assets/{global-defaults-api-asOZQeM8.js → global-defaults-api-BObi-1ww.js} +1 -1
  64. package/dist/gateway/static/root/assets/{home-page-Bb_RC1O9.js → home-page-CIcs7Mzy.js} +2 -2
  65. package/dist/gateway/static/root/assets/{image-generation-api-CdwYgzhU.js → image-generation-api-C2SqYNyD.js} +1 -1
  66. package/dist/gateway/static/root/assets/{imports-page-CVnoGUyp.js → imports-page-C8ezUkOJ.js} +1 -1
  67. package/dist/gateway/static/root/assets/{index-BmUSsdwn.js → index-D1_PUrJf.js} +5 -5
  68. package/dist/gateway/static/root/assets/{install-connector-dialog-DXVOHMhS.js → install-connector-dialog-Cn4nRSyt.js} +1 -1
  69. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BCl90SrD.js → keyboard-shortcuts-settings-BRaY4-wA.js} +1 -1
  70. package/dist/gateway/static/root/assets/{local-app-workbench-page-CcJc9xLJ.js → local-app-workbench-page-BZtVcjF3.js} +1 -1
  71. package/dist/gateway/static/root/assets/{local-apps-page-CdAKoWfg.js → local-apps-page-MqP4EnJm.js} +1 -1
  72. package/dist/gateway/static/root/assets/{local-session-drafts-nRGeybku.js → local-session-drafts-DTq9776a.js} +1 -1
  73. package/dist/gateway/static/root/assets/{locale-store-B7y-RVe8.js → locale-store-B6OrWgY1.js} +1 -1
  74. package/dist/gateway/static/root/assets/{logs-page-McbSQwJI.js → logs-page-hkHBjblX.js} +1 -1
  75. package/dist/gateway/static/root/assets/{management-settings-BIR0BwNV.js → management-settings-DoX4eTM3.js} +1 -1
  76. package/dist/gateway/static/root/assets/{markdown-view-DFHa8rUg.js → markdown-view-DrhYZSmg.js} +1 -1
  77. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Dwx4TuIr.js → mcp-conversation-setup-page-BEp5E6TD.js} +1 -1
  78. package/dist/gateway/static/root/assets/{media-plugins-BzzLV7wW.js → media-plugins-D987i9Gc.js} +1 -1
  79. package/dist/gateway/static/root/assets/messages-jwdBhfL9.js +3 -0
  80. package/dist/gateway/static/root/assets/{model-selector-YsCHu1Gn.js → model-selector-DXm4NS1_.js} +1 -1
  81. package/dist/gateway/static/root/assets/{models-hub-cache-BUapaPTN.js → models-hub-cache-BLcha5rx.js} +1 -1
  82. package/dist/gateway/static/root/assets/{note-detail-panel-CJ-dPovd.js → note-detail-panel-Cl851ivY.js} +3 -3
  83. package/dist/gateway/static/root/assets/note-image-lightbox-DGYRJS03.js +1 -0
  84. package/dist/gateway/static/root/assets/{notes-api-ulup1oFS.js → notes-api-Ddsf7FVg.js} +1 -1
  85. package/dist/gateway/static/root/assets/{notes-page-BaFNplIr.js → notes-page-DSwA1MU1.js} +1 -1
  86. package/dist/gateway/static/root/assets/{oauth-api-DINa08-z.js → oauth-api-CMmu4DzH.js} +1 -1
  87. package/dist/gateway/static/root/assets/{oauth-provider-connect-C0PVEHC2.js → oauth-provider-connect-BkhnftBq.js} +1 -1
  88. package/dist/gateway/static/root/assets/{page-context-capture-button-CGfR0dsc.js → page-context-capture-button-urhQBRaN.js} +1 -1
  89. package/dist/gateway/static/root/assets/{page-context-draft-DhRNxc0v.js → page-context-draft-BuNUerth.js} +1 -1
  90. package/dist/gateway/static/root/assets/page-header-store-CEn_kPsn.js +1 -0
  91. package/dist/gateway/static/root/assets/{personal-avatar-DiVFO2Aw.js → personal-avatar-B49ueeZO.js} +1 -1
  92. package/dist/gateway/static/root/assets/{personal-page-Cvd-v9kT.js → personal-page-f05ceuFn.js} +1 -1
  93. package/dist/gateway/static/root/assets/{personal-settings-panel-Ds4ntiqu.js → personal-settings-panel-DLQxzPYr.js} +1 -1
  94. package/dist/gateway/static/root/assets/{phone-dependencies-card-B3R6L5Qu.js → phone-dependencies-card-DjmC1Z5j.js} +1 -1
  95. package/dist/gateway/static/root/assets/{phone-model-connection-BieYnAJ5.js → phone-model-connection-BRjHSgYn.js} +1 -1
  96. package/dist/gateway/static/root/assets/{phone-model-picker-Bkex4Sre.js → phone-model-picker-DgIiWLhR.js} +1 -1
  97. package/dist/gateway/static/root/assets/{phone-settings-page-D8PuvEuJ.js → phone-settings-page-DCZGCL_z.js} +1 -1
  98. package/dist/gateway/static/root/assets/{phone-workspace-store-Cmes9gQ4.js → phone-workspace-store-DbqktZbO.js} +1 -1
  99. package/dist/gateway/static/root/assets/{plugin-details-dialog-DblFhnuC.js → plugin-details-dialog-D4tGKip4.js} +1 -1
  100. package/dist/gateway/static/root/assets/{preference-select-fields-D2-QfMN5.js → preference-select-fields-BZWqG7pu.js} +1 -1
  101. package/dist/gateway/static/root/assets/{product-automation-feedback-BzY3z8zu.js → product-automation-feedback-DDQUsag7.js} +1 -1
  102. package/dist/gateway/static/root/assets/{product-open-page-BKw6H0Mn.js → product-open-page-BkRP_HmA.js} +1 -1
  103. package/dist/gateway/static/root/assets/{product-preview-content-VcvxaO2S.js → product-preview-content-o2Y3VNE7.js} +1 -1
  104. package/dist/gateway/static/root/assets/{product-preview-modal-Ym6bomTW.js → product-preview-modal-7Ohx-7OR.js} +2 -2
  105. package/dist/gateway/static/root/assets/{project-detail-page-CFbXWvcd.js → project-detail-page-B2RsSHya.js} +1 -1
  106. package/dist/gateway/static/root/assets/{project-understanding-CrSkrJnM.js → project-understanding-BIMouiYX.js} +1 -1
  107. package/dist/gateway/static/root/assets/{projects-page-Cp91_KzA.js → projects-page-C9R5u3tF.js} +1 -1
  108. package/dist/gateway/static/root/assets/{providers-api-CBSC3jdu.js → providers-api-BOCkRZ7X.js} +1 -1
  109. package/dist/gateway/static/root/assets/{recording-upload-DBHAGKZj.js → recording-upload-C6muEHEO.js} +1 -1
  110. package/dist/gateway/static/root/assets/{registry-api-QZEjziDq.js → registry-api-Bl2guMRg.js} +1 -1
  111. package/dist/gateway/static/root/assets/{remote-access-hub-BdXxFQfH.js → remote-access-hub-BceSMbCs.js} +1 -1
  112. package/dist/gateway/static/root/assets/{resource-unavailable-BTNhcOHF.js → resource-unavailable-CUNbPkdj.js} +1 -1
  113. package/dist/gateway/static/root/assets/{route-preload-C-VRKwB1.js → route-preload-C1BKDjnu.js} +2 -2
  114. package/dist/gateway/static/root/assets/{runtime-tools-api-BDTUD8Rj.js → runtime-tools-api-LopLjgvu.js} +1 -1
  115. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CYEzIrDf.js → runtime-tools-settings-panel-9HIPerDP.js} +1 -1
  116. package/dist/gateway/static/root/assets/{service-recommendation-list-CfeYH6lK.js → service-recommendation-list-CoMI6MB1.js} +1 -1
  117. package/dist/gateway/static/root/assets/{session-api-DVXLCZX2.js → session-api-Bfmlmn9F.js} +1 -1
  118. package/dist/gateway/static/root/assets/session-manager-X4UHOjjO.js +25 -0
  119. package/dist/gateway/static/root/assets/{sessions-page-C2CH-55n.js → sessions-page-BT0GdXdS.js} +1 -1
  120. package/dist/gateway/static/root/assets/settings-advanced-gate-Dk9c-Z5e.js +1 -0
  121. package/dist/gateway/static/root/assets/{settings-advanced-section-BmrbHgQa.js → settings-advanced-section-CEorDLUp.js} +1 -1
  122. package/dist/gateway/static/root/assets/{settings-mode-store-Bk_hzwPK.js → settings-mode-store-C2LZqBES.js} +1 -1
  123. package/dist/gateway/static/root/assets/{settings-page-B6vrcc6f.js → settings-page-C_Np_6qZ.js} +1 -1
  124. package/dist/gateway/static/root/assets/{settings-page-header-BLKI3_9N.js → settings-page-header-BAN34UQi.js} +1 -1
  125. package/dist/gateway/static/root/assets/{settings-page-layout-BqBVrkC9.js → settings-page-layout-B5TVFBV2.js} +1 -1
  126. package/dist/gateway/static/root/assets/{setup-interaction-page-BDPte58u.js → setup-interaction-page-BYvTJW3_.js} +1 -1
  127. package/dist/gateway/static/root/assets/{setup-status-panel-DEefuWo3.js → setup-status-panel-UY2dH-sK.js} +1 -1
  128. package/dist/gateway/static/root/assets/{share-link-dialog-C2LyeNzj.js → share-link-dialog-BMcXyzr2.js} +1 -1
  129. package/dist/gateway/static/root/assets/{share-preview-page-BFwEr7Ws.js → share-preview-page-UQ6eUM2_.js} +1 -1
  130. package/dist/gateway/static/root/assets/{shares-api-CTFkLQxq.js → shares-api-DOeDN6Tm.js} +1 -1
  131. package/dist/gateway/static/root/assets/{shares-settings-CpK3yhtc.js → shares-settings-W8XhuAoL.js} +1 -1
  132. package/dist/gateway/static/root/assets/{skill-api-DpicfA6o.js → skill-api-Do_c0d9n.js} +1 -1
  133. package/dist/gateway/static/root/assets/{skill-list-api-B8fegRLZ.js → skill-list-api-DpHaXI2l.js} +1 -1
  134. package/dist/gateway/static/root/assets/{skill-reload-api-VmC8ySUy.js → skill-reload-api-DDRd9IJ2.js} +1 -1
  135. package/dist/gateway/static/root/assets/{skills-page-BIWXS6Ki.js → skills-page-CaeJVKhO.js} +1 -1
  136. package/dist/gateway/static/root/assets/{system-settings-panel-BmoA92oX.js → system-settings-panel-DYWlWPJL.js} +1 -1
  137. package/dist/gateway/static/root/assets/{task-detail-page-CC3Rzqq9.js → task-detail-page-De0qD7xw.js} +1 -1
  138. package/dist/gateway/static/root/assets/{task-result-evidence-BV-6hBVU.js → task-result-evidence-CICR5K1t.js} +1 -1
  139. package/dist/gateway/static/root/assets/{terminal-panel-store-BGdKE9hU.js → terminal-panel-store-BbWUcQe7.js} +1 -1
  140. package/dist/gateway/static/root/assets/{theme-store-Dvv79Wb2.js → theme-store-TkG5mo0p.js} +1 -1
  141. package/dist/gateway/static/root/assets/{tracing-settings-page-B4uA4Pnz.js → tracing-settings-page-CYXEy4EG.js} +1 -1
  142. package/dist/gateway/static/root/assets/{tunnel-api-BurZtvqx.js → tunnel-api-DquDm6U2.js} +1 -1
  143. package/dist/gateway/static/root/assets/{understanding-activity-store-C1cLL8zq.js → understanding-activity-store-Ot3wZ3oQ.js} +1 -1
  144. package/dist/gateway/static/root/assets/{understanding-refresh-store-C3Lr_pjY.js → understanding-refresh-store-C5KYFMaC.js} +1 -1
  145. package/dist/gateway/static/root/assets/{usage-page-C91ZzLm9.js → usage-page-1xFO4smo.js} +1 -1
  146. package/dist/gateway/static/root/assets/{use-autosave-zkzRuUtx.js → use-autosave-HL8XRNR8.js} +1 -1
  147. package/dist/gateway/static/root/assets/{use-composer-attachments-CoiQAgjo.js → use-composer-attachments-XRlQBdNF.js} +1 -1
  148. package/dist/gateway/static/root/assets/{use-file-preview-expanded-DFzy6iVy.js → use-file-preview-expanded-CW956CXS.js} +2 -2
  149. package/dist/gateway/static/root/assets/{use-personal-profile-BB10h9ED.js → use-personal-profile-202s6tJt.js} +1 -1
  150. package/dist/gateway/static/root/assets/{use-workspace-tree-sF5DcONt.js → use-workspace-tree-CjydkmH1.js} +1 -1
  151. package/dist/gateway/static/root/assets/{user-model-page-WFnD5utO.js → user-model-page-OGPXx3pe.js} +1 -1
  152. package/dist/gateway/static/root/assets/{voice-api-key-field-Bqa4PeZx.js → voice-api-key-field-CxFu4MEA.js} +1 -1
  153. package/dist/gateway/static/root/assets/{voice-config-api-LNO2xXHk.js → voice-config-api-MHe5Pn-A.js} +1 -1
  154. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-AzfhxBX7.js → voice-input-shortcut-events-B9xc1oK8.js} +1 -1
  155. package/dist/gateway/static/root/assets/{voice-transcribe-api-Cb8i6dLb.js → voice-transcribe-api-CVEcB6Pe.js} +1 -1
  156. package/dist/gateway/static/root/assets/{work-discovery-overlay-CdQUiV-a.js → work-discovery-overlay-C-JoAg2D.js} +1 -1
  157. package/dist/gateway/static/root/assets/{work-discovery-page-HcUloXxf.js → work-discovery-page-B5Kx29Ru.js} +1 -1
  158. package/dist/gateway/static/root/assets/{working-directory-picker-modal-Dv1HUipe.js → working-directory-picker-modal-DGp9cNzH.js} +1 -1
  159. package/dist/gateway/static/root/assets/{workspace-api-Am2ee4R6.js → workspace-api-HBXn8pL9.js} +2 -2
  160. package/dist/gateway/static/root/assets/workspace-editor-agent-store-msZa42fU.js +1 -0
  161. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-z5Q00v92.js → workspace-file-preview-dialog-3cpwSG2w.js} +1 -1
  162. package/dist/gateway/static/root/assets/{workspace-open-location-menu-4ONYaGy0.js → workspace-open-location-menu-D0VOFvuP.js} +1 -1
  163. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DimGN59n.js → xopc-cloud-account-card-BkdW2p3v.js} +1 -1
  164. package/dist/gateway/static/root/index.html +78 -78
  165. package/dist/package.js +1 -1
  166. package/dist/src/gateway/global-defaults-admin.js +1 -1
  167. package/dist/src/gateway/service.js +4 -4
  168. package/dist/src/home-intelligence/host.js +2 -2
  169. package/dist/src/phone/adb-driver.js +2 -2
  170. package/dist/src/phone/model-adapter.d.ts +2 -0
  171. package/dist/src/phone/model-adapter.js +10 -3
  172. package/dist/src/phone/reliability.js +24 -2
  173. package/dist/src/phone/runtime.js +6 -1
  174. package/dist/src/phone/ui-dump-binary.d.ts +1 -1
  175. package/dist/src/phone/ui-dump-binary.js +1 -1
  176. package/dist/src/session/client-history.d.ts +2 -0
  177. package/dist/src/session/client-history.js +3 -0
  178. package/dist/src/session/compact-history.js +1 -0
  179. package/package.json +1 -1
  180. package/dist/gateway/static/root/assets/gateway-realtime-store-Bxkv62qs.js +0 -1
  181. package/dist/gateway/static/root/assets/messages-DYDkJvXj.js +0 -3
  182. package/dist/gateway/static/root/assets/note-image-lightbox-ClPkeHe5.js +0 -1
  183. package/dist/gateway/static/root/assets/page-header-store-CoKMiYoi.js +0 -1
  184. package/dist/gateway/static/root/assets/session-manager-DjRWxXJG.js +0 -23
  185. package/dist/gateway/static/root/assets/settings-advanced-gate-BMHe9uwy.js +0 -1
  186. package/dist/gateway/static/root/assets/workspace-editor-agent-store-CqHcVFhS.js +0 -1
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,o as r}from"./locale-store-B7y-RVe8.js";import{n as i,r as a}from"./popover-select-CEMWIrtY.js";import{t as o}from"./skeleton-BI5TyibZ.js";import{i as s}from"./vendor-swr-CdRzEUwF.js";var c=e(),l=`phone-mock/settings-about`;async function u(e,t,i=t===void 0?`GET`:`POST`){let a=await r(n(`/api/phone${e}`),{method:i,...t===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}});if(!a.ok)throw Error(a.error?.message??`Phone operation failed`);return a.payload}var d=()=>u(`/settings`),f=()=>u(`/devices`),p=()=>u(`/models`);async function m(e,t){return(await u(e?`/devices/${encodeURIComponent(e)}/apps`:`/apps?serial=${encodeURIComponent(t)}`)).applications}var h=t();function g(e){let t=(0,c.c)(36),{value:n,onChange:r,zh:l,disabled:u}=e,d=u!==void 0&&u,f=s(`phone-models`,p),m,g,y,b,x,S,C,w,T,E;if(t[0]!==d||t[1]!==f.data||t[2]!==f.error||t[3]!==r||t[4]!==n||t[5]!==l){g=Symbol.for(`react.early_return_sentinel`);bb0:{let e=f.data?.models.filter(v)??[];if(!f.data&&!f.error){let e;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(o,{className:`h-11 w-full rounded-lg`}),t[16]=e):e=t[16],g=e;break bb0}E=`space-y-2`,m=i,y=l?`手机模型`:`Phone model`,b=n,x=d||!!f.error,t[17]===r?S=t[18]:(S=e=>r(e.target.value),t[17]=r,t[18]=S);let s=l?`未配置`:`Not configured`;t[19]===s?C=t[20]:(C=(0,h.jsx)(a,{value:``,children:s}),t[19]=s,t[20]=C),w=n&&!e.some(e=>e.id===n)&&(0,h.jsx)(a,{value:n,disabled:!0,children:l?`当前模型不可用,请重新选择`:`Current model unavailable; choose another`}),T=e.map(_)}t[0]=d,t[1]=f.data,t[2]=f.error,t[3]=r,t[4]=n,t[5]=l,t[6]=m,t[7]=g,t[8]=y,t[9]=b,t[10]=x,t[11]=S,t[12]=C,t[13]=w,t[14]=T,t[15]=E}else m=t[6],g=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=t[12],w=t[13],T=t[14],E=t[15];if(g!==Symbol.for(`react.early_return_sentinel`))return g;let D;t[21]!==m||t[22]!==y||t[23]!==b||t[24]!==x||t[25]!==S||t[26]!==C||t[27]!==w||t[28]!==T?(D=(0,h.jsxs)(m,{"aria-label":y,value:b,disabled:x,onChange:S,children:[C,w,T]}),t[21]=m,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=D):D=t[29];let O;t[30]===f.error?O=t[31]:(O=f.error&&(0,h.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(f.error)}),t[30]=f.error,t[31]=O);let k;return t[32]!==D||t[33]!==O||t[34]!==E?(k=(0,h.jsxs)(`div`,{className:E,children:[D,O]}),t[32]=D,t[33]=O,t[34]=E,t[35]=k):k=t[35],k}function _(e){return(0,h.jsx)(a,{value:e.id,children:`${e.name} · ${e.id.split(`/`)[0]}`},e.id)}function v(e){return e.configured}function y(e){let t=(0,c.c)(24),{value:n,inherited:r,onChange:i,zh:a}=e,o=a?`手机操作模型`:`Phone Use model`,s;t[0]===o?s=t[1]:(s=(0,h.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:o}),t[0]=o,t[1]=s);let l=n?n.primary:`${a?`继承全局`:`Inherited`}: ${r?.primary??`—`}`,u;t[2]===l?u=t[3]:(u=(0,h.jsx)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:l}),t[2]=l,t[3]=u);let d;t[4]!==s||t[5]!==u?(d=(0,h.jsxs)(`div`,{children:[s,u]}),t[4]=s,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==r?.primary||t[8]!==i||t[9]!==n?(f=()=>i(n?void 0:{primary:r?.primary??``,fallbacks:[]}),t[7]=r?.primary,t[8]=i,t[9]=n,t[10]=f):f=t[10];let p=n?a?`继承全局`:`Inherit globally`:a?`单独设置`:`Override`,m;t[11]!==f||t[12]!==p?(m=(0,h.jsx)(`button`,{type:`button`,className:`touch-target rounded-lg px-3 py-2 text-sm text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:f,children:p}),t[11]=f,t[12]=p,t[13]=m):m=t[13];let _;t[14]!==d||t[15]!==m?(_=(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[d,m]}),t[14]=d,t[15]=m,t[16]=_):_=t[16];let v;t[17]!==i||t[18]!==n||t[19]!==a?(v=n&&(0,h.jsx)(g,{value:n.primary,onChange:e=>i({primary:e,fallbacks:[]}),zh:a}),t[17]=i,t[18]=n,t[19]=a,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==_?(y=(0,h.jsxs)(`section`,{className:`space-y-3 rounded-2xl border border-edge bg-surface-base p-4`,children:[_,v]}),t[21]=v,t[22]=_,t[23]=y):y=t[23],y}export{f as a,u as c,m as i,g as n,p as o,l as r,d as s,y as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,o as r}from"./locale-store-B6OrWgY1.js";import{n as i,r as a}from"./popover-select-CEMWIrtY.js";import{t as o}from"./skeleton-BI5TyibZ.js";import{i as s}from"./vendor-swr-CdRzEUwF.js";var c=e(),l=`phone-mock/settings-about`;async function u(e,t,i=t===void 0?`GET`:`POST`){let a=await r(n(`/api/phone${e}`),{method:i,...t===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}});if(!a.ok)throw Error(a.error?.message??`Phone operation failed`);return a.payload}var d=()=>u(`/settings`),f=()=>u(`/devices`),p=()=>u(`/models`);async function m(e,t){return(await u(e?`/devices/${encodeURIComponent(e)}/apps`:`/apps?serial=${encodeURIComponent(t)}`)).applications}var h=t();function g(e){let t=(0,c.c)(36),{value:n,onChange:r,zh:l,disabled:u}=e,d=u!==void 0&&u,f=s(`phone-models`,p),m,g,y,b,x,S,C,w,T,E;if(t[0]!==d||t[1]!==f.data||t[2]!==f.error||t[3]!==r||t[4]!==n||t[5]!==l){g=Symbol.for(`react.early_return_sentinel`);bb0:{let e=f.data?.models.filter(v)??[];if(!f.data&&!f.error){let e;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(o,{className:`h-11 w-full rounded-lg`}),t[16]=e):e=t[16],g=e;break bb0}E=`space-y-2`,m=i,y=l?`手机模型`:`Phone model`,b=n,x=d||!!f.error,t[17]===r?S=t[18]:(S=e=>r(e.target.value),t[17]=r,t[18]=S);let s=l?`未配置`:`Not configured`;t[19]===s?C=t[20]:(C=(0,h.jsx)(a,{value:``,children:s}),t[19]=s,t[20]=C),w=n&&!e.some(e=>e.id===n)&&(0,h.jsx)(a,{value:n,disabled:!0,children:l?`当前模型不可用,请重新选择`:`Current model unavailable; choose another`}),T=e.map(_)}t[0]=d,t[1]=f.data,t[2]=f.error,t[3]=r,t[4]=n,t[5]=l,t[6]=m,t[7]=g,t[8]=y,t[9]=b,t[10]=x,t[11]=S,t[12]=C,t[13]=w,t[14]=T,t[15]=E}else m=t[6],g=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=t[12],w=t[13],T=t[14],E=t[15];if(g!==Symbol.for(`react.early_return_sentinel`))return g;let D;t[21]!==m||t[22]!==y||t[23]!==b||t[24]!==x||t[25]!==S||t[26]!==C||t[27]!==w||t[28]!==T?(D=(0,h.jsxs)(m,{"aria-label":y,value:b,disabled:x,onChange:S,children:[C,w,T]}),t[21]=m,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=D):D=t[29];let O;t[30]===f.error?O=t[31]:(O=f.error&&(0,h.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(f.error)}),t[30]=f.error,t[31]=O);let k;return t[32]!==D||t[33]!==O||t[34]!==E?(k=(0,h.jsxs)(`div`,{className:E,children:[D,O]}),t[32]=D,t[33]=O,t[34]=E,t[35]=k):k=t[35],k}function _(e){return(0,h.jsx)(a,{value:e.id,children:`${e.name} · ${e.id.split(`/`)[0]}`},e.id)}function v(e){return e.configured}function y(e){let t=(0,c.c)(24),{value:n,inherited:r,onChange:i,zh:a}=e,o=a?`手机操作模型`:`Phone Use model`,s;t[0]===o?s=t[1]:(s=(0,h.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:o}),t[0]=o,t[1]=s);let l=n?n.primary:`${a?`继承全局`:`Inherited`}: ${r?.primary??`—`}`,u;t[2]===l?u=t[3]:(u=(0,h.jsx)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:l}),t[2]=l,t[3]=u);let d;t[4]!==s||t[5]!==u?(d=(0,h.jsxs)(`div`,{children:[s,u]}),t[4]=s,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==r?.primary||t[8]!==i||t[9]!==n?(f=()=>i(n?void 0:{primary:r?.primary??``,fallbacks:[]}),t[7]=r?.primary,t[8]=i,t[9]=n,t[10]=f):f=t[10];let p=n?a?`继承全局`:`Inherit globally`:a?`单独设置`:`Override`,m;t[11]!==f||t[12]!==p?(m=(0,h.jsx)(`button`,{type:`button`,className:`touch-target rounded-lg px-3 py-2 text-sm text-accent-fg hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,onClick:f,children:p}),t[11]=f,t[12]=p,t[13]=m):m=t[13];let _;t[14]!==d||t[15]!==m?(_=(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[d,m]}),t[14]=d,t[15]=m,t[16]=_):_=t[16];let v;t[17]!==i||t[18]!==n||t[19]!==a?(v=n&&(0,h.jsx)(g,{value:n.primary,onChange:e=>i({primary:e,fallbacks:[]}),zh:a}),t[17]=i,t[18]=n,t[19]=a,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==_?(y=(0,h.jsxs)(`section`,{className:`space-y-3 rounded-2xl border border-edge bg-surface-base p-4`,children:[_,v]}),t[21]=v,t[22]=_,t[23]=y):y=t[23],y}export{f as a,u as c,m as i,g as n,p as o,l as r,d as s,y as 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{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-B7y-RVe8.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./app-window-DXFNqt_0.js";import{t as h}from"./chevron-down-ccbiQQz_.js";import{n as g,r as _}from"./popover-select-CEMWIrtY.js";import{n as v,t as y}from"./beta-badge-BnzdzIEl.js";import{t as b}from"./play-kxZvpBg8.js";import{t as x}from"./plus-Q2yW6OE7.js";import{t as S}from"./refresh-cw-BRlGaq2w.js";import{t as C}from"./search-DA7gz22f.js";import{t as w}from"./shield-check-BU58siTV.js";import{t as T}from"./smartphone-DSSsQFqA.js";import{t as E}from"./x-B_N4OPjy.js";import{t as D}from"./cn-0WouolD0.js";import{t as O}from"./skeleton-BI5TyibZ.js";import{i as k}from"./vendor-swr-CdRzEUwF.js";import{t as A}from"./button-Cc4hUNTt.js";import{t as ee}from"./phone-workspace-store-Cmes9gQ4.js";import{l as te,m as ne,o as re,r as j,t as ie,u as ae}from"./dist-ZrL34Ps4.js";import{n as oe,t as se}from"./global-defaults-api-asOZQeM8.js";import{n as ce,t as le}from"./settings-page-header-BLKI3_9N.js";import{a as ue,c as M,i as N,r as de,s as fe}from"./phone-model-picker-Bkex4Sre.js";import{t as pe}from"./phone-dependencies-card-B3R6L5Qu.js";import{n as me,t as he}from"./phone-model-connection-BieYnAJ5.js";var P=e(t(),1),F=r();function ge({device:e,zh:t,onClose:n,onConnected:r}){let[i,a]=(0,P.useState)(!1),[o,l]=(0,P.useState)(e.wireless?.host??``),[m,h]=(0,P.useState)(``),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(``),b=async()=>{_(!0),y(``);try{await M(`/devices/${e.id}/reconnect`,i?{host:o,port:Number(m)}:{}),await r(),n()}catch(e){y(e instanceof Error?e.message:String(e)),a(!0)}finally{_(!1)}};return(0,F.jsx)(p,{open:!0,onOpenChange:e=>{!e&&!g&&n()},children:(0,F.jsxs)(u,{children:[(0,F.jsx)(s,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,F.jsxs)(d,{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,F.jsxs)(f,{className:`text-base font-semibold`,children:[t?`重新连接手机`:`Reconnect phone`,` · `,e.name]}),(0,F.jsx)(c,{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,F.jsxs)(`form`,{className:`mt-4 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto`,children:[(0,F.jsxs)(`label`,{className:`flex min-h-11 items-center gap-2 text-sm`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i,disabled:g,onChange:e=>a(e.target.checked)}),t?`手动填写当前连接地址`:`Enter current connection address`]}),i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`label`,{className:`block text-sm`,children:[t?`手机 IP 地址`:`Phone IP address`,(0,F.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,required:!0,value:o,disabled:g,onChange:e=>l(e.target.value.trim())})]}),(0,F.jsxs)(`label`,{className:`block text-sm`,children:[t?`连接端口(无线调试首页)`:`Connection port (Wireless debugging screen)`,(0,F.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:m,disabled:g,onChange:e=>h(e.target.value)})]})]}),v&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]}),(0,F.jsxs)(`footer`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,F.jsx)(A,{type:`button`,disabled:g,onClick:n,children:t?`取消`:`Cancel`}),(0,F.jsx)(A,{type:`submit`,variant:`primary`,disabled:g,children:g?t?`正在连接…`:`Connecting…`:t?`重新连接`:`Reconnect`})]})]})]})]})})}var I=n();function _e(e){let t=(0,I.c)(29),{deviceId:n,serial:r,mode:i,selected:a,onModeChange:o,onSelectedChange:s,disabled:c,zh:l}=e,u=(0,P.useId)(),[d,f]=(0,P.useState)(``),p;t[0]!==n||t[1]!==i||t[2]!==r?(p=i===`selected`?[`phone-applications`,n??r]:null,t[0]=n,t[1]=i,t[2]=r,t[3]=p):p=t[3];let h;t[4]!==n||t[5]!==r?(h=()=>N(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 _=k(p,h,g),v;if(t[8]!==_||t[9]!==c||t[10]!==u||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==d||t[15]!==a||t[16]!==l){let e=d.trim().toLocaleLowerCase(),n=_.data?.filter(t=>`${t.label} ${t.packageName}`.toLocaleLowerCase().includes(e))??[],r=_.data,p=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,y=l?`应用权限`:`Application access`,b;t[21]===y?b=t[22]:(b=(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:y}),t[21]=y,t[22]=b);let x;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=[`all`,`selected`],t[23]=x):x=t[23];let w;t[24]!==u||t[25]!==i||t[26]!==o||t[27]!==l?(w=(0,F.jsx)(`div`,{className:`grid gap-2`,children:x.map(e=>(0,F.jsxs)(`label`,{className:D(`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,F.jsx)(`input`,{type:`radio`,name:u,value:e,checked:i===e,onChange:()=>o(e),className:`mt-1 size-4 shrink-0 accent-accent`}),(0,F.jsxs)(`span`,{className:`min-w-0`,children:[(0,F.jsx)(`span`,{className:`block text-sm font-medium`,children:e===`all`?l?`允许所有应用`:`Allow all apps`:l?`仅允许所选应用`:`Only selected apps`}),(0,F.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-fg-muted`,children:e===`all`?l?`可在手机上的应用间切换,无需逐个配置。`:`Switch between apps on this phone without individual setup.`:l?`从手机上已安装的应用中选择。`:`Choose from applications installed on the phone.`})]})]},e))}),t[24]=u,t[25]=i,t[26]=o,t[27]=l,t[28]=w):w=t[28],v=(0,F.jsxs)(`fieldset`,{disabled:c,className:`space-y-3`,children:[b,w,i===`selected`?(0,F.jsxs)(`div`,{className:`space-y-2`,"aria-label":l?`选择手机应用`:`Choose phone applications`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`已选择 ${a.length} 个应用`:`${a.length} apps selected`}),(0,F.jsxs)(A,{variant:`ghost`,className:`gap-1 px-2 py-1 text-xs`,"aria-label":l?`刷新应用列表`:`Refresh applications`,disabled:c||_.isValidating,onClick:()=>{_.mutate()},children:[(0,F.jsx)(S,{className:D(`size-3.5`,_.isValidating&&`animate-spin motion-reduce:animate-none`),"aria-hidden":!0}),l?`刷新`:`Refresh`]})]}),(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(C,{className:`pointer-events-none absolute left-3 top-3 size-4 text-fg-muted`,"aria-hidden":!0}),(0,F.jsx)(`input`,{type:`search`,"aria-label":l?`搜索手机应用`:`Search phone applications`,placeholder:l?`搜索应用`:`Search apps`,value:d,onChange:e=>f(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`})]}),_.error?(0,F.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:[l?`暂时无法读取应用,请确认手机已连接后重试。之前的选择会保留。`:`Unable to read apps. Check the phone connection and retry. Previous selections are preserved.`,(0,F.jsx)(A,{variant:`ghost`,className:`ml-1 text-accent`,onClick:()=>{_.mutate()},children:l?`重试`:`Retry`})]}):null,!_.data&&!_.error?(0,F.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(O,{className:`h-10 w-full`})]}):_.data?(0,F.jsxs)(`div`,{className:`max-h-56 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-base`,"aria-label":l?`可选应用`:`Available applications`,children:[n.map(e=>(0,F.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-3 px-3 py-2 hover:bg-surface-hover`,children:[(0,F.jsx)(m,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm`,title:e.label,children:e.label}),e.label!==e.packageName&&_.data.some(t=>t.packageName!==e.packageName&&t.label===e.label)?(0,F.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:e.packageName}):null]}),(0,F.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,F.jsx)(`p`,{className:`p-4 text-center text-sm text-fg-muted`,children:e?l?`没有找到匹配的应用`:`No matching applications`:l?`这台手机上没有可打开的应用`:`No launchable applications on this phone`})]}):null,p.length?(0,F.jsxs)(`div`,{className:`space-y-1 text-xs text-fg-muted`,children:[(0,F.jsx)(`p`,{children:l?`以下原有选择未在手机上找到,可取消选择。`:`These previous selections are no longer available. You may deselect them.`}),p.map(e=>(0,F.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>g(e),className:`accent-accent`}),(0,F.jsx)(`span`,{className:`break-all`,children:e})]},e))]}):null,a.length?null:(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:l?`至少选择一个应用后保存。`:`Choose at least one application before saving.`})]}):null]}),t[8]=_,t[9]=c,t[10]=u,t[11]=i,t[12]=o,t[13]=s,t[14]=d,t[15]=a,t[16]=l,t[17]=v}else v=t[17];return v}function L({deviceId:e,value:t,onChange:n,disabled:r,zh:i}){let[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(``);async function l(){o(!0),c(``);try{let t=await M(`/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,F.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge bg-surface-base p-3`,children:[(0,F.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,F.jsx)(`input`,{type:`checkbox`,checked:t===`auto`,disabled:r,onChange:e=>n(e.target.checked?`auto`:`manual`),className:`size-4 accent-accent`})]}),(0,F.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,F.jsx)(A,{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,F.jsx)(`p`,{role:`status`,className:`text-xs leading-relaxed text-fg-muted`,children:s}):null]})}var R=`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`,z=`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`,B=`space-y-4 rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`;function ve({device:e,serial:t,name:n,onSave:r,onClose:i,zh:a}){let[o,m]=(0,P.useState)(e?.name??n),[h,g]=(0,P.useState)(e?.appAccess??(e?.allowedApps.length?`selected`:`all`)),[_,v]=(0,P.useState)(e?.allowedApps??[]),[y,b]=(0,P.useState)(e?.textInput??`auto`),[x,S]=(0,P.useState)(e?.enabled??!0),[C,w]=(0,P.useState)(!1),[T,D]=(0,P.useState)(``),O=async()=>{w(!0),D(``);try{let n={name:o,appAccess:h,allowedApps:h===`all`?[]:_,textInput:y,enabled:x};await M(e?`/devices/${e.id}`:`/devices`,e?n:{...n,serial:t},e?`PATCH`:`POST`),await r(),i()}catch(e){D(e instanceof Error?e.message:String(e))}finally{w(!1)}};return(0,F.jsx)(p,{open:!0,onOpenChange:e=>{!e&&!C&&i()},children:(0,F.jsxs)(u,{children:[(0,F.jsx)(s,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,F.jsxs)(d,{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,F.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(f,{className:`text-base font-semibold`,children:e?a?`管理手机`:`Manage phone`:a?`添加手机`:`Add phone`}),(0,F.jsx)(c,{className:`mt-1 text-sm text-fg-muted`,children:a?`设备连接在 Gateway 所在电脑。修改权限会停止当前控制。`:`This phone connects to the Gateway host. Changing access stops active control.`})]}),(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(A,{variant:`ghost`,disabled:C,"aria-label":a?`关闭`:`Close`,children:(0,F.jsx)(E,{className:`size-4`})})})]}),(0,F.jsxs)(`form`,{className:`mt-5 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),O()},children:[(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`名称`:`Name`,(0,F.jsx)(`input`,{className:R,value:o,maxLength:100,required:!0,onChange:e=>m(e.target.value)})]}),(0,F.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[`ADB: `,t]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`已启用 phone_use 工具的 Agent 可使用这台手机。`:`Agents with the phone_use tool can use this phone.`}),(0,F.jsx)(_e,{deviceId:e?.id,serial:t,mode:h,selected:_,onModeChange:g,onSelectedChange:v,zh:a,disabled:C}),(0,F.jsx)(L,{deviceId:e?.id,value:y,onChange:b,disabled:C,zh:a}),(0,F.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-3 text-sm`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked)}),a?`允许访问这台手机`:`Enable access to this phone`]}),T&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:T})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,F.jsx)(A,{type:`button`,disabled:C,onClick:i,children:a?`取消`:`Cancel`}),(0,F.jsx)(A,{type:`submit`,variant:`primary`,disabled:C||!o.trim()||h===`selected`&&!_.length,children:C?a?`保存中…`:`Saving…`:a?`保存手机`:`Save phone`})]})]})]})]})})}function V(){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})},s=o(e=>e.language)===`zh`,c=k(`phone-settings`,fe),l=k(`phone-devices`,ue,{refreshInterval:15e3}),u=k(`settings-agent-defaults`,se),d=u.data?.defaults.models.phoneUse?.primary??``,[f,p]=(0,P.useState)(d);(0,P.useEffect)(()=>{p(d)},[d]);let[m,C]=(0,P.useState)(!1),[E,D]=(0,P.useState)(``),[N,I]=(0,P.useState)(``),[_e,L]=(0,P.useState)(!1),[V,ye]=(0,P.useState)(),[be,H]=(0,P.useState)(),[xe,Se]=(0,P.useState)(``),[U,Ce]=(0,P.useState)(``),[W,we]=(0,P.useState)(``),[G,Te]=(0,P.useState)(()=>sessionStorage.getItem(`phone-settings-session`)??``),K=k(G?[`phone-session`,G]:null,()=>M(`/sessions/${G}`),{refreshInterval:1500}),Ee=a(),[q,J]=(0,P.useState)({}),Y=K.data,X=Y?.status===`running`,Z=xe||l.data?.defaultDeviceId||``,De=d===de,Q=async(e,t)=>{C(!0),D(``),I(``);try{await e(),t&&I(t)}catch(e){D(e instanceof Error?e.message:String(e))}finally{C(!1)}},Oe=async e=>{let t=await se(),n={...t.defaults.models};e?n.phoneUse={primary:e,fallbacks:[]}:delete n.phoneUse;let r=await oe({...t.defaults,models:n},{scope:`models`,expectedModels:t.defaults.models});await u.mutate(r,!1),p(e)},ke=()=>Q(async()=>{G&&Y&&![`closed`,`cancelled`,`failed`,`outcome_unknown`].includes(Y.status)&&await M(`/sessions/${G}/execute`,{op:`close`});let e=await M(`/sessions`,{deviceId:Z,mode:`control`});Te(e.id),sessionStorage.setItem(`phone-settings-session`,e.id),await M(`/sessions/${e.id}/execute`,{op:`run`,goal:U,...W?{expectText:W}:{},maxActions:6})}),$=e=>Q(async()=>{await M(`/sessions/${G}/execute`,{op:e}),await K.mutate()}),Ae=async e=>{J(t=>({...t,[e.id]:{pending:!0,text:s?`正在诊断…`:`Checking…`}}));try{let t=await M(`/devices/${e.id}/diagnostics`,{}),n=s?{device:`已连接`,disconnected:`未连接`,unauthorized:`未授权调试`,offline:`离线`}:{device:`Connected`,disconnected:`Disconnected`,unauthorized:`Debugging not authorized`,offline:`Offline`};J(r=>({...r,[e.id]:{pending:!1,text:`${s?`诊断结果`:`Diagnostics`}:${n[t.state]??t.state}`}}))}catch(t){J(n=>({...n,[e.id]:{pending:!1,error:!0,text:t instanceof Error?t.message:String(t)}}))}},je=s?{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,F.jsxs)(ce,{gap:`gap-6`,className:`max-w-[48rem]`,children:[(0,F.jsx)(le,{aiSetup:`phone`,title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[s?`手机控制`:`Phone Use`,(0,F.jsx)(y,{})]}),subtitle:s?`让 AI 帮你操作 Android 手机。`:`Let AI work with your Android phone.`}),E&&(0,F.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-danger-soft p-3 text-sm text-danger`,children:E}),N&&(0,F.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:N}),c.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(c.error)}),(0,F.jsx)(`section`,{className:B,"aria-label":s?`手机控制设置`:`Phone control settings`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,F.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-surface-inset text-fg-muted`,children:(0,F.jsx)(T,{className:`size-6`,"aria-hidden":!0})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`启用手机控制`:`Enable Phone Use`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:s?`连接与操作在 Gateway 电脑上执行。`:`Connects and runs on your Gateway computer.`})]})]}),c.data?(0,F.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":c.data.config.enabled,"aria-label":s?`启用手机控制`:`Enable Phone Use`,disabled:m||X,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;Q(async()=>{await M(`/settings`,{...c.data.config,enabled:e},`PATCH`),await c.mutate()})},children:(0,F.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,F.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,F.jsx)(O,{className:`h-8 w-12`})]})}),(0,F.jsx)(`section`,{className:B,children:(0,F.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,F.jsx)(`span`,{children:s?`默认执行方式`:`Default execution strategy`}),c.data?(0,F.jsxs)(g,{"aria-label":s?`默认执行方式`:`Default execution strategy`,value:c.data.config.executionMode??`collaborative`,disabled:m,onChange:e=>{let t=e.target.value;Q(async()=>{await M(`/settings`,{...c.data.config,executionMode:t},`PATCH`),await c.mutate()})},children:[(0,F.jsx)(_,{value:`collaborative`,children:s?`主 Agent 协作(默认)`:`Main Agent collaboration (default)`}),(0,F.jsx)(_,{value:`direct`,children:s?`直接执行`:`Direct execution`})]}):(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`协作:主 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,F.jsxs)(`section`,{"aria-label":s?`手机模型配置`:`Phone model configuration`,className:B,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`操作模型`:`Phone model`}),c.data&&(0,F.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,F.jsx)(`span`,{children:s?`连接保持时间`:`Connection lifetime`}),(0,F.jsxs)(g,{"aria-label":s?`连接保持时间`:`Connection lifetime`,value:String(c.data.config.idleDisconnectMs??0),disabled:m||X,onChange:e=>{let t=Number(e.target.value);Q(async()=>{await M(`/settings`,{...c.data.config,idleDisconnectMs:t},`PATCH`),await c.mutate()})},children:[(0,F.jsx)(_,{value:`0`,children:s?`保持连接,直到手动断开`:`Keep connected until disconnected`}),[15,30,60].map(e=>(0,F.jsx)(_,{value:String(e*6e4),children:s?`闲置 ${e} 分钟后断开`:`Disconnect after ${e} idle minutes`},e))]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`任务结束后保留连接;执行任务、人工操作和查看画面期间不计闲置。`:`Tasks finish without disconnecting. Running tasks, manual control and viewing the screen do not count as idle.`})]}),!u.data&&!u.error?(0,F.jsx)(O,{className:`h-20 w-full`}):(0,F.jsx)(he,{value:d,onSelect:p,onSave:Oe,zh:s,disabled:m||X||!u.data}),u.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(u.error)}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-3`,children:(0,F.jsx)(A,{variant:`ghost`,className:`px-0 text-accent-fg hover:bg-transparent hover:underline`,disabled:m||!f||f===`phone-mock/settings-about`,onClick:()=>{Q(async()=>{let e=await M(`/models/diagnostics`,{modelRef:f});I(e.mock?s?`模拟适配器可用;此测试不验证真实模型。`:`Mock adapter ready; this does not validate a real model.`:e.groundingVerified?s?`模型连接、动作协议和测试图定位通过;未操作真实手机。`:`Connection, protocol and test-image grounding passed. No phone was operated.`:s?`动作协议有效,但测试图定位未通过。`:`Protocol valid, but test-image grounding did not pass.`)})},children:s?`测试模型连接`:`Test model connection`})}),(0,F.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,F.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 [&::-webkit-details-marker]:hidden`,children:[(0,F.jsx)(w,{className:`size-4`,"aria-hidden":!0}),s?`隐私与执行限制`:`Privacy & execution limits`,(0,F.jsx)(h,{className:`ml-auto size-4 group-open:rotate-180`,"aria-hidden":!0})]}),(0,F.jsxs)(`div`,{className:`space-y-3 pb-2 leading-relaxed`,children:[(0,F.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:s?`手机截图会发送给所选模型;页面摘要可能进入聊天模型。`:`Phone screenshots go to the selected model; page summaries may reach the chat model.`}),` `,c.data&&(0,F.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[s?`每次小目标最多 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,` `,s?`动作`:`actions`,` · `,c.data.config.maxModelRequests,` `,s?`模型请求`:`model requests`]}),(0,F.jsx)(`p`,{children:s?`远程浏览器无法访问你本机的 USB 设备。`:`A remote browser cannot access your local USB devices.`})]})]})]}),(0,F.jsxs)(`section`,{className:`space-y-3`,"aria-label":s?`手机管理`:`Phone management`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`手机管理`:`Phones`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(A,{variant:`ghost`,disabled:m,onClick:()=>L(!0),children:[(0,F.jsx)(x,{className:`size-4`,"aria-hidden":!0}),s?`添加手机`:`Add phone`]}),(0,F.jsxs)(A,{variant:`ghost`,disabled:m||l.isValidating,onClick:()=>{Q(()=>l.mutate())},children:[(0,F.jsx)(S,{className:`size-4`,"aria-hidden":!0}),s?`刷新`:`Refresh`]})]})]}),!l.data&&!l.error?(0,F.jsx)(O,{className:`h-32 w-full rounded-xl`}):(0,F.jsxs)(`div`,{className:B,children:[(l.error||!Me&&l.data?.diagnostic)&&(0,F.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[l.data?.diagnostic??String(l.error),` · `,s?`检查 Gateway 电脑的 Android SDK 与 ADB。`:`Check Android SDK and ADB on the Gateway host.`]}),l.data?.devices.map(e=>(0,F.jsxs)(`div`,{className:`border-b border-edge-subtle pb-4 last:border-b-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-3 sm:flex-row sm:gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,F.jsx)(T,{className:`mt-0.5 size-5 shrink-0 text-fg-muted`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`p`,{className:`break-words text-sm font-medium`,children:[e.name,e.id===l.data?.defaultDeviceId&&(0,F.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:s?`默认`:`Default`})]}),(0,F.jsxs)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:[e.connection?`${s?`阿里云`:`Alibaba Cloud`} · ADB · `:``,e.serial,` · `,e.enabled?e.connection?s?`已配置 · 按需连接`:`Configured · Connects on demand`:{device:s?`已连接`:`Connected`,offline:s?`离线`:`Offline`,unauthorized:s?`待授权`:`Unauthorized`}[l.data?.discovery.find(t=>t.serial===e.serial)?.state??``]??(s?`未连接`:`Disconnected`):s?`已禁用`:`Disabled`]})]})]}),(0,F.jsxs)(`div`,{className:`flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1 self-end sm:self-start`,children:[(0,F.jsx)(A,{variant:`ghost`,disabled:m,onClick:()=>H({device:e,serial:e.serial,name:e.name}),children:s?`管理`:`Manage`}),(0,F.jsx)(A,{variant:`ghost`,disabled:m||!e.enabled,onClick:()=>{Q(async()=>{await M(`/devices/${e.id}/view`,{}),window.dispatchEvent(new Event(`phone-connections-changed`)),ee.getState().show(e.id)})},children:s?`查看屏幕`:`View screen`}),(0,F.jsx)(A,{variant:`ghost`,disabled:m||!e.enabled,onClick:()=>{Q(async()=>{let t=await M(`/devices/${e.id}/conversations`,{});window.dispatchEvent(new Event(`session-created`)),ee.getState().hide(),Ee(`/chat/${t.conversationId}`)})},children:s?`对话控制手机`:`Control in chat`}),(0,F.jsxs)(te,{modal:!1,children:[(0,F.jsx)(ne,{asChild:!0,children:(0,F.jsxs)(A,{variant:`ghost`,disabled:m,"aria-label":s?`${e.name}的更多操作`:`More actions for ${e.name}`,children:[s?`更多`:`More`,(0,F.jsx)(h,{className:`size-3.5`,"aria-hidden":!0})]})}),(0,F.jsx)(re,{children:(0,F.jsxs)(ie,{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,F.jsx)(j,{disabled:m||!e.enabled,className:z,onSelect:()=>ye(e),children:s?`重新连接`:`Reconnect`}),(0,F.jsx)(j,{disabled:m||q[e.id]?.pending,className:z,onSelect:()=>{Ae(e)},children:e.connection?s?`连接诊断`:`Connect & diagnose`:s?`诊断`:`Diagnose`}),e.id!==l.data?.defaultDeviceId&&(0,F.jsx)(j,{disabled:m,className:z,onSelect:()=>{Q(async()=>{await M(`/devices/${e.id}/default`,{}),await l.mutate()})},children:s?`设为默认`:`Set default`}),(0,F.jsx)(ae,{className:`my-1 border-t border-edge-subtle`}),(0,F.jsx)(j,{disabled:m,className:`${z} text-danger`,onSelect:()=>{Q(async()=>{await M(`/devices/${e.id}`,void 0,`DELETE`),await l.mutate()})},children:s?`移除连接`:`Remove connection`})]})})]})]})]}),(0,F.jsx)(`p`,{role:`status`,"aria-live":`polite`,title:q[e.id]?.text,className:`h-5 truncate text-xs leading-5 ${q[e.id]?.error?`text-danger`:`text-fg-muted`}`,children:q[e.id]?.text})]},e.id)),l.data?.discovery.filter(e=>!l.data?.devices.some(t=>t.serial===e.serial)).map(e=>(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm`,children:e.name}),(0,F.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.emulator?s?`Android 模拟器`:`Android emulator`:`Android`,` · `,e.state]})]}),(0,F.jsx)(A,{disabled:m||e.state!==`device`,onClick:()=>H({serial:e.serial,name:e.name}),children:s?`添加手机`:`Add phone`})]},e.serial)),!l.data?.devices.length&&!l.data?.discovery.length&&(0,F.jsx)(`p`,{className:`py-3 text-sm text-fg-muted`,children:s?`尚未发现设备。先启动 Android 模拟器,或通过 USB 连接手机并允许调试。`:`No devices found. Start an Android emulator, or connect a phone over USB and authorize debugging.`})]})]}),(0,F.jsx)(pe,{expanded:n(`components`),onExpandedChange:e=>r(`components`,e),cloudOnly:Me,onChanged:()=>{l.mutate(),c.mutate()}}),(0,F.jsxs)(`details`,{open:n(`test`,!!G),onToggle:e=>r(`test`,e.currentTarget.open,!!G),className:`group rounded-2xl border border-edge bg-surface-panel`,"aria-label":s?`手机试运行`:`Phone test run`,children:[(0,F.jsxs)(`summary`,{className:`flex min-h-16 cursor-pointer list-none items-center gap-3 p-5 [&::-webkit-details-marker]:hidden`,children:[(0,F.jsx)(v,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`试运行`:`Test run`}),(0,F.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:s?`验证手机操作`:`Try a task`}),(0,F.jsx)(h,{className:`size-4 shrink-0 text-fg-muted group-open:rotate-180`,"aria-hidden":!0})]}),(0,F.jsxs)(`div`,{className:`space-y-4 border-t border-edge-subtle p-5`,children:[(0,F.jsxs)(g,{"aria-label":s?`测试手机`:`Test phone`,value:Z,disabled:m||X,onChange:e=>Se(e.target.value),children:[(0,F.jsx)(_,{value:``,children:s?`选择手机`:`Choose phone`}),l.data?.devices.filter(e=>e.enabled).map(e=>(0,F.jsx)(_,{value:e.id,children:e.name},e.id))]}),(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[s?`本次授权的小目标`:`Authorized goal`,(0,F.jsx)(`textarea`,{className:R,value:U,maxLength:2e3,onChange:e=>Ce(e.target.value)})]}),(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[s?`完成时应显示的文字(可选)`:`Expected completion text (optional)`,(0,F.jsx)(`input`,{className:R,value:W,maxLength:200,onChange:e=>we(e.target.value)})]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`先手动打开允许的应用。模型说完成只表示执行结束,只有匹配界面证据才会显示验证通过。`:`First open an allowed app manually. A model completion claim remains unverified until native UI evidence matches.`})]}),(0,F.jsxs)(A,{variant:`primary`,disabled:m||X||!c.data?.config.enabled||!d||De||f!==d||!Z||!U.trim(),onClick:()=>{ke()},children:[(0,F.jsx)(b,{className:`size-4`}),s?`开始试运行`:`Start test run`]}),K.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(K.error)}),Y&&(0,F.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4`,"aria-live":`polite`,children:[(0,F.jsxs)(`p`,{className:`text-sm font-medium`,children:[Y.deviceName,` · `,je[Y.status]??Y.status]}),(0,F.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[Y.actions,` `,s?`动作`:`actions`,` · `,Y.modelRequests,` `,s?`模型请求`:`model requests`,` · `,Y.verified?s?`界面条件已验证`:`UI condition verified`:s?`尚未验证完成`:`Completion unverified`]}),Y.message&&(0,F.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Y.message}),(Y.errorCode||Y.stopReason)&&(0,F.jsx)(`p`,{className:`break-all text-xs text-fg-muted`,children:Y.errorCode??Y.stopReason}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(A,{disabled:m||!X,onClick:()=>{$(`pause`)},children:s?`暂停`:`Pause`}),(0,F.jsx)(A,{disabled:m||![`paused`,`needs_user`].includes(Y.status),onClick:()=>{$(`resume`)},children:s?`恢复`:`Resume`}),(0,F.jsx)(A,{disabled:m||[`closed`,`cancelled`].includes(Y.status),onClick:()=>{$(`cancel`)},children:s?`停止`:`Stop`}),(0,F.jsx)(A,{disabled:m,onClick:()=>{$(`close`)},children:s?`释放手机`:`Release phone`}),Y.status===`ready`&&!Y.mock&&(0,F.jsx)(A,{disabled:m,onClick:()=>{Q(async()=>{await M(`/sessions/${G}/execute`,{op:`run`,goal:U,...W?{expectText:W}:{}}),await K.mutate()})},children:s?`继续当前目标`:`Continue goal`})]}),Y.facts?.length?(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:s?`本次观察到的界面文字`:`Observed UI text`}),(0,F.jsx)(`ul`,{className:`mt-2 max-h-52 space-y-1 overflow-auto text-xs text-fg-muted`,children:Y.facts.map((e,t)=>(0,F.jsx)(`li`,{className:`break-words`,children:e},t))})]}):null]})]})]},G),_e&&(0,F.jsx)(me,{onAdded:()=>{l.mutate()},zh:s,onClose:()=>L(!1),onSelect:e=>{L(!1),H({serial:e.serial,name:e.name})}}),V&&(0,F.jsx)(ge,{device:V,zh:s,onClose:()=>ye(void 0),onConnected:async()=>{await l.mutate()}}),be&&c.data&&(0,F.jsx)(ve,{...be,zh:s,onSave:async()=>{await l.mutate()},onClose:()=>H(void 0)})]})}export{V 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,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as o}from"./locale-store-B6OrWgY1.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./app-window-DXFNqt_0.js";import{t as h}from"./chevron-down-ccbiQQz_.js";import{n as g,r as _}from"./popover-select-CEMWIrtY.js";import{n as v,t as y}from"./beta-badge-BnzdzIEl.js";import{t as b}from"./play-kxZvpBg8.js";import{t as x}from"./plus-Q2yW6OE7.js";import{t as S}from"./refresh-cw-BRlGaq2w.js";import{t as C}from"./search-DA7gz22f.js";import{t as w}from"./shield-check-BU58siTV.js";import{t as T}from"./smartphone-DSSsQFqA.js";import{t as E}from"./x-B_N4OPjy.js";import{t as D}from"./cn-0WouolD0.js";import{t as O}from"./skeleton-BI5TyibZ.js";import{i as k}from"./vendor-swr-CdRzEUwF.js";import{t as A}from"./button-Cc4hUNTt.js";import{t as ee}from"./phone-workspace-store-DbqktZbO.js";import{l as te,m as ne,o as re,r as j,t as ie,u as ae}from"./dist-ZrL34Ps4.js";import{n as oe,t as se}from"./global-defaults-api-BObi-1ww.js";import{n as ce,t as le}from"./settings-page-header-BAN34UQi.js";import{a as ue,c as M,i as N,r as de,s as fe}from"./phone-model-picker-DgIiWLhR.js";import{t as pe}from"./phone-dependencies-card-DjmC1Z5j.js";import{n as me,t as he}from"./phone-model-connection-BRjHSgYn.js";var P=e(t(),1),F=r();function ge({device:e,zh:t,onClose:n,onConnected:r}){let[i,a]=(0,P.useState)(!1),[o,l]=(0,P.useState)(e.wireless?.host??``),[m,h]=(0,P.useState)(``),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(``),b=async()=>{_(!0),y(``);try{await M(`/devices/${e.id}/reconnect`,i?{host:o,port:Number(m)}:{}),await r(),n()}catch(e){y(e instanceof Error?e.message:String(e)),a(!0)}finally{_(!1)}};return(0,F.jsx)(p,{open:!0,onOpenChange:e=>{!e&&!g&&n()},children:(0,F.jsxs)(u,{children:[(0,F.jsx)(s,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,F.jsxs)(d,{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,F.jsxs)(f,{className:`text-base font-semibold`,children:[t?`重新连接手机`:`Reconnect phone`,` · `,e.name]}),(0,F.jsx)(c,{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,F.jsxs)(`form`,{className:`mt-4 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto`,children:[(0,F.jsxs)(`label`,{className:`flex min-h-11 items-center gap-2 text-sm`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i,disabled:g,onChange:e=>a(e.target.checked)}),t?`手动填写当前连接地址`:`Enter current connection address`]}),i&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`label`,{className:`block text-sm`,children:[t?`手机 IP 地址`:`Phone IP address`,(0,F.jsx)(`input`,{className:`mt-1 w-full rounded-lg border border-edge bg-surface-base p-2`,required:!0,value:o,disabled:g,onChange:e=>l(e.target.value.trim())})]}),(0,F.jsxs)(`label`,{className:`block text-sm`,children:[t?`连接端口(无线调试首页)`:`Connection port (Wireless debugging screen)`,(0,F.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:m,disabled:g,onChange:e=>h(e.target.value)})]})]}),v&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:v})]}),(0,F.jsxs)(`footer`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,F.jsx)(A,{type:`button`,disabled:g,onClick:n,children:t?`取消`:`Cancel`}),(0,F.jsx)(A,{type:`submit`,variant:`primary`,disabled:g,children:g?t?`正在连接…`:`Connecting…`:t?`重新连接`:`Reconnect`})]})]})]})]})})}var I=n();function _e(e){let t=(0,I.c)(29),{deviceId:n,serial:r,mode:i,selected:a,onModeChange:o,onSelectedChange:s,disabled:c,zh:l}=e,u=(0,P.useId)(),[d,f]=(0,P.useState)(``),p;t[0]!==n||t[1]!==i||t[2]!==r?(p=i===`selected`?[`phone-applications`,n??r]:null,t[0]=n,t[1]=i,t[2]=r,t[3]=p):p=t[3];let h;t[4]!==n||t[5]!==r?(h=()=>N(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 _=k(p,h,g),v;if(t[8]!==_||t[9]!==c||t[10]!==u||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==d||t[15]!==a||t[16]!==l){let e=d.trim().toLocaleLowerCase(),n=_.data?.filter(t=>`${t.label} ${t.packageName}`.toLocaleLowerCase().includes(e))??[],r=_.data,p=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,y=l?`应用权限`:`Application access`,b;t[21]===y?b=t[22]:(b=(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:y}),t[21]=y,t[22]=b);let x;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=[`all`,`selected`],t[23]=x):x=t[23];let w;t[24]!==u||t[25]!==i||t[26]!==o||t[27]!==l?(w=(0,F.jsx)(`div`,{className:`grid gap-2`,children:x.map(e=>(0,F.jsxs)(`label`,{className:D(`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,F.jsx)(`input`,{type:`radio`,name:u,value:e,checked:i===e,onChange:()=>o(e),className:`mt-1 size-4 shrink-0 accent-accent`}),(0,F.jsxs)(`span`,{className:`min-w-0`,children:[(0,F.jsx)(`span`,{className:`block text-sm font-medium`,children:e===`all`?l?`允许所有应用`:`Allow all apps`:l?`仅允许所选应用`:`Only selected apps`}),(0,F.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-fg-muted`,children:e===`all`?l?`可在手机上的应用间切换,无需逐个配置。`:`Switch between apps on this phone without individual setup.`:l?`从手机上已安装的应用中选择。`:`Choose from applications installed on the phone.`})]})]},e))}),t[24]=u,t[25]=i,t[26]=o,t[27]=l,t[28]=w):w=t[28],v=(0,F.jsxs)(`fieldset`,{disabled:c,className:`space-y-3`,children:[b,w,i===`selected`?(0,F.jsxs)(`div`,{className:`space-y-2`,"aria-label":l?`选择手机应用`:`Choose phone applications`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:l?`已选择 ${a.length} 个应用`:`${a.length} apps selected`}),(0,F.jsxs)(A,{variant:`ghost`,className:`gap-1 px-2 py-1 text-xs`,"aria-label":l?`刷新应用列表`:`Refresh applications`,disabled:c||_.isValidating,onClick:()=>{_.mutate()},children:[(0,F.jsx)(S,{className:D(`size-3.5`,_.isValidating&&`animate-spin motion-reduce:animate-none`),"aria-hidden":!0}),l?`刷新`:`Refresh`]})]}),(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(C,{className:`pointer-events-none absolute left-3 top-3 size-4 text-fg-muted`,"aria-hidden":!0}),(0,F.jsx)(`input`,{type:`search`,"aria-label":l?`搜索手机应用`:`Search phone applications`,placeholder:l?`搜索应用`:`Search apps`,value:d,onChange:e=>f(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`})]}),_.error?(0,F.jsxs)(`div`,{role:`alert`,className:`rounded-lg bg-surface-inset p-3 text-sm text-fg-muted`,children:[l?`暂时无法读取应用,请确认手机已连接后重试。之前的选择会保留。`:`Unable to read apps. Check the phone connection and retry. Previous selections are preserved.`,(0,F.jsx)(A,{variant:`ghost`,className:`ml-1 text-accent`,onClick:()=>{_.mutate()},children:l?`重试`:`Retry`})]}):null,!_.data&&!_.error?(0,F.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(O,{className:`h-10 w-full`})]}):_.data?(0,F.jsxs)(`div`,{className:`max-h-56 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-base`,"aria-label":l?`可选应用`:`Available applications`,children:[n.map(e=>(0,F.jsxs)(`label`,{className:`flex min-h-12 cursor-pointer items-center gap-3 px-3 py-2 hover:bg-surface-hover`,children:[(0,F.jsx)(m,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm`,title:e.label,children:e.label}),e.label!==e.packageName&&_.data.some(t=>t.packageName!==e.packageName&&t.label===e.label)?(0,F.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:e.packageName}):null]}),(0,F.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,F.jsx)(`p`,{className:`p-4 text-center text-sm text-fg-muted`,children:e?l?`没有找到匹配的应用`:`No matching applications`:l?`这台手机上没有可打开的应用`:`No launchable applications on this phone`})]}):null,p.length?(0,F.jsxs)(`div`,{className:`space-y-1 text-xs text-fg-muted`,children:[(0,F.jsx)(`p`,{children:l?`以下原有选择未在手机上找到,可取消选择。`:`These previous selections are no longer available. You may deselect them.`}),p.map(e=>(0,F.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>g(e),className:`accent-accent`}),(0,F.jsx)(`span`,{className:`break-all`,children:e})]},e))]}):null,a.length?null:(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:l?`至少选择一个应用后保存。`:`Choose at least one application before saving.`})]}):null]}),t[8]=_,t[9]=c,t[10]=u,t[11]=i,t[12]=o,t[13]=s,t[14]=d,t[15]=a,t[16]=l,t[17]=v}else v=t[17];return v}function L({deviceId:e,value:t,onChange:n,disabled:r,zh:i}){let[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(``);async function l(){o(!0),c(``);try{let t=await M(`/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,F.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge bg-surface-base p-3`,children:[(0,F.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,F.jsx)(`input`,{type:`checkbox`,checked:t===`auto`,disabled:r,onChange:e=>n(e.target.checked?`auto`:`manual`),className:`size-4 accent-accent`})]}),(0,F.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,F.jsx)(A,{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,F.jsx)(`p`,{role:`status`,className:`text-xs leading-relaxed text-fg-muted`,children:s}):null]})}var R=`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`,z=`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`,B=`space-y-4 rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`;function ve({device:e,serial:t,name:n,onSave:r,onClose:i,zh:a}){let[o,m]=(0,P.useState)(e?.name??n),[h,g]=(0,P.useState)(e?.appAccess??(e?.allowedApps.length?`selected`:`all`)),[_,v]=(0,P.useState)(e?.allowedApps??[]),[y,b]=(0,P.useState)(e?.textInput??`auto`),[x,S]=(0,P.useState)(e?.enabled??!0),[C,w]=(0,P.useState)(!1),[T,D]=(0,P.useState)(``),O=async()=>{w(!0),D(``);try{let n={name:o,appAccess:h,allowedApps:h===`all`?[]:_,textInput:y,enabled:x};await M(e?`/devices/${e.id}`:`/devices`,e?n:{...n,serial:t},e?`PATCH`:`POST`),await r(),i()}catch(e){D(e instanceof Error?e.message:String(e))}finally{w(!1)}};return(0,F.jsx)(p,{open:!0,onOpenChange:e=>{!e&&!C&&i()},children:(0,F.jsxs)(u,{children:[(0,F.jsx)(s,{className:`fixed inset-0 z-[80] bg-black/40`}),(0,F.jsxs)(d,{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,F.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(f,{className:`text-base font-semibold`,children:e?a?`管理手机`:`Manage phone`:a?`添加手机`:`Add phone`}),(0,F.jsx)(c,{className:`mt-1 text-sm text-fg-muted`,children:a?`设备连接在 Gateway 所在电脑。修改权限会停止当前控制。`:`This phone connects to the Gateway host. Changing access stops active control.`})]}),(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(A,{variant:`ghost`,disabled:C,"aria-label":a?`关闭`:`Close`,children:(0,F.jsx)(E,{className:`size-4`})})})]}),(0,F.jsxs)(`form`,{className:`mt-5 flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),O()},children:[(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto pr-1`,children:[(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[a?`名称`:`Name`,(0,F.jsx)(`input`,{className:R,value:o,maxLength:100,required:!0,onChange:e=>m(e.target.value)})]}),(0,F.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[`ADB: `,t]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:a?`已启用 phone_use 工具的 Agent 可使用这台手机。`:`Agents with the phone_use tool can use this phone.`}),(0,F.jsx)(_e,{deviceId:e?.id,serial:t,mode:h,selected:_,onModeChange:g,onSelectedChange:v,zh:a,disabled:C}),(0,F.jsx)(L,{deviceId:e?.id,value:y,onChange:b,disabled:C,zh:a}),(0,F.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-3 text-sm`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked)}),a?`允许访问这台手机`:`Enable access to this phone`]}),T&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:T})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex shrink-0 justify-end gap-2 border-t border-edge pt-4`,children:[(0,F.jsx)(A,{type:`button`,disabled:C,onClick:i,children:a?`取消`:`Cancel`}),(0,F.jsx)(A,{type:`submit`,variant:`primary`,disabled:C||!o.trim()||h===`selected`&&!_.length,children:C?a?`保存中…`:`Saving…`:a?`保存手机`:`Save phone`})]})]})]})]})})}function V(){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})},s=o(e=>e.language)===`zh`,c=k(`phone-settings`,fe),l=k(`phone-devices`,ue,{refreshInterval:15e3}),u=k(`settings-agent-defaults`,se),d=u.data?.defaults.models.phoneUse?.primary??``,[f,p]=(0,P.useState)(d);(0,P.useEffect)(()=>{p(d)},[d]);let[m,C]=(0,P.useState)(!1),[E,D]=(0,P.useState)(``),[N,I]=(0,P.useState)(``),[_e,L]=(0,P.useState)(!1),[V,ye]=(0,P.useState)(),[be,H]=(0,P.useState)(),[xe,Se]=(0,P.useState)(``),[U,Ce]=(0,P.useState)(``),[W,we]=(0,P.useState)(``),[G,Te]=(0,P.useState)(()=>sessionStorage.getItem(`phone-settings-session`)??``),K=k(G?[`phone-session`,G]:null,()=>M(`/sessions/${G}`),{refreshInterval:1500}),Ee=a(),[q,J]=(0,P.useState)({}),Y=K.data,X=Y?.status===`running`,Z=xe||l.data?.defaultDeviceId||``,De=d===de,Q=async(e,t)=>{C(!0),D(``),I(``);try{await e(),t&&I(t)}catch(e){D(e instanceof Error?e.message:String(e))}finally{C(!1)}},Oe=async e=>{let t=await se(),n={...t.defaults.models};e?n.phoneUse={primary:e,fallbacks:[]}:delete n.phoneUse;let r=await oe({...t.defaults,models:n},{scope:`models`,expectedModels:t.defaults.models});await u.mutate(r,!1),p(e)},ke=()=>Q(async()=>{G&&Y&&![`closed`,`cancelled`,`failed`,`outcome_unknown`].includes(Y.status)&&await M(`/sessions/${G}/execute`,{op:`close`});let e=await M(`/sessions`,{deviceId:Z,mode:`control`});Te(e.id),sessionStorage.setItem(`phone-settings-session`,e.id),await M(`/sessions/${e.id}/execute`,{op:`run`,goal:U,...W?{expectText:W}:{},maxActions:6})}),$=e=>Q(async()=>{await M(`/sessions/${G}/execute`,{op:e}),await K.mutate()}),Ae=async e=>{J(t=>({...t,[e.id]:{pending:!0,text:s?`正在诊断…`:`Checking…`}}));try{let t=await M(`/devices/${e.id}/diagnostics`,{}),n=s?{device:`已连接`,disconnected:`未连接`,unauthorized:`未授权调试`,offline:`离线`}:{device:`Connected`,disconnected:`Disconnected`,unauthorized:`Debugging not authorized`,offline:`Offline`};J(r=>({...r,[e.id]:{pending:!1,text:`${s?`诊断结果`:`Diagnostics`}:${n[t.state]??t.state}`}}))}catch(t){J(n=>({...n,[e.id]:{pending:!1,error:!0,text:t instanceof Error?t.message:String(t)}}))}},je=s?{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,F.jsxs)(ce,{gap:`gap-6`,className:`max-w-[48rem]`,children:[(0,F.jsx)(le,{aiSetup:`phone`,title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[s?`手机控制`:`Phone Use`,(0,F.jsx)(y,{})]}),subtitle:s?`让 AI 帮你操作 Android 手机。`:`Let AI work with your Android phone.`}),E&&(0,F.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-danger-soft p-3 text-sm text-danger`,children:E}),N&&(0,F.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:N}),c.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(c.error)}),(0,F.jsx)(`section`,{className:B,"aria-label":s?`手机控制设置`:`Phone control settings`,children:(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,F.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-surface-inset text-fg-muted`,children:(0,F.jsx)(T,{className:`size-6`,"aria-hidden":!0})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`启用手机控制`:`Enable Phone Use`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:s?`连接与操作在 Gateway 电脑上执行。`:`Connects and runs on your Gateway computer.`})]})]}),c.data?(0,F.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":c.data.config.enabled,"aria-label":s?`启用手机控制`:`Enable Phone Use`,disabled:m||X,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;Q(async()=>{await M(`/settings`,{...c.data.config,enabled:e},`PATCH`),await c.mutate()})},children:(0,F.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,F.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,F.jsx)(O,{className:`h-8 w-12`})]})}),(0,F.jsx)(`section`,{className:B,children:(0,F.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,F.jsx)(`span`,{children:s?`默认执行方式`:`Default execution strategy`}),c.data?(0,F.jsxs)(g,{"aria-label":s?`默认执行方式`:`Default execution strategy`,value:c.data.config.executionMode??`collaborative`,disabled:m,onChange:e=>{let t=e.target.value;Q(async()=>{await M(`/settings`,{...c.data.config,executionMode:t},`PATCH`),await c.mutate()})},children:[(0,F.jsx)(_,{value:`collaborative`,children:s?`主 Agent 协作(默认)`:`Main Agent collaboration (default)`}),(0,F.jsx)(_,{value:`direct`,children:s?`直接执行`:`Direct execution`})]}):(0,F.jsx)(O,{className:`h-10 w-full`}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`协作:主 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,F.jsxs)(`section`,{"aria-label":s?`手机模型配置`:`Phone model configuration`,className:B,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`操作模型`:`Phone model`}),c.data&&(0,F.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,F.jsx)(`span`,{children:s?`连接保持时间`:`Connection lifetime`}),(0,F.jsxs)(g,{"aria-label":s?`连接保持时间`:`Connection lifetime`,value:String(c.data.config.idleDisconnectMs??0),disabled:m||X,onChange:e=>{let t=Number(e.target.value);Q(async()=>{await M(`/settings`,{...c.data.config,idleDisconnectMs:t},`PATCH`),await c.mutate()})},children:[(0,F.jsx)(_,{value:`0`,children:s?`保持连接,直到手动断开`:`Keep connected until disconnected`}),[15,30,60].map(e=>(0,F.jsx)(_,{value:String(e*6e4),children:s?`闲置 ${e} 分钟后断开`:`Disconnect after ${e} idle minutes`},e))]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`任务结束后保留连接;执行任务、人工操作和查看画面期间不计闲置。`:`Tasks finish without disconnecting. Running tasks, manual control and viewing the screen do not count as idle.`})]}),!u.data&&!u.error?(0,F.jsx)(O,{className:`h-20 w-full`}):(0,F.jsx)(he,{value:d,onSelect:p,onSave:Oe,zh:s,disabled:m||X||!u.data}),u.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(u.error)}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-3`,children:(0,F.jsx)(A,{variant:`ghost`,className:`px-0 text-accent-fg hover:bg-transparent hover:underline`,disabled:m||!f||f===`phone-mock/settings-about`,onClick:()=>{Q(async()=>{let e=await M(`/models/diagnostics`,{modelRef:f});I(e.mock?s?`模拟适配器可用;此测试不验证真实模型。`:`Mock adapter ready; this does not validate a real model.`:e.groundingVerified?s?`模型连接、动作协议和测试图定位通过;未操作真实手机。`:`Connection, protocol and test-image grounding passed. No phone was operated.`:s?`动作协议有效,但测试图定位未通过。`:`Protocol valid, but test-image grounding did not pass.`)})},children:s?`测试模型连接`:`Test model connection`})}),(0,F.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,F.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 [&::-webkit-details-marker]:hidden`,children:[(0,F.jsx)(w,{className:`size-4`,"aria-hidden":!0}),s?`隐私与执行限制`:`Privacy & execution limits`,(0,F.jsx)(h,{className:`ml-auto size-4 group-open:rotate-180`,"aria-hidden":!0})]}),(0,F.jsxs)(`div`,{className:`space-y-3 pb-2 leading-relaxed`,children:[(0,F.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:s?`手机截图会发送给所选模型;页面摘要可能进入聊天模型。`:`Phone screenshots go to the selected model; page summaries may reach the chat model.`}),` `,c.data&&(0,F.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[s?`每次小目标最多 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,` `,s?`动作`:`actions`,` · `,c.data.config.maxModelRequests,` `,s?`模型请求`:`model requests`]}),(0,F.jsx)(`p`,{children:s?`远程浏览器无法访问你本机的 USB 设备。`:`A remote browser cannot access your local USB devices.`})]})]})]}),(0,F.jsxs)(`section`,{className:`space-y-3`,"aria-label":s?`手机管理`:`Phone management`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`手机管理`:`Phones`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(A,{variant:`ghost`,disabled:m,onClick:()=>L(!0),children:[(0,F.jsx)(x,{className:`size-4`,"aria-hidden":!0}),s?`添加手机`:`Add phone`]}),(0,F.jsxs)(A,{variant:`ghost`,disabled:m||l.isValidating,onClick:()=>{Q(()=>l.mutate())},children:[(0,F.jsx)(S,{className:`size-4`,"aria-hidden":!0}),s?`刷新`:`Refresh`]})]})]}),!l.data&&!l.error?(0,F.jsx)(O,{className:`h-32 w-full rounded-xl`}):(0,F.jsxs)(`div`,{className:B,children:[(l.error||!Me&&l.data?.diagnostic)&&(0,F.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[l.data?.diagnostic??String(l.error),` · `,s?`检查 Gateway 电脑的 Android SDK 与 ADB。`:`Check Android SDK and ADB on the Gateway host.`]}),l.data?.devices.map(e=>(0,F.jsxs)(`div`,{className:`border-b border-edge-subtle pb-4 last:border-b-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-3 sm:flex-row sm:gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,F.jsx)(T,{className:`mt-0.5 size-5 shrink-0 text-fg-muted`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`p`,{className:`break-words text-sm font-medium`,children:[e.name,e.id===l.data?.defaultDeviceId&&(0,F.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:s?`默认`:`Default`})]}),(0,F.jsxs)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:[e.connection?`${s?`阿里云`:`Alibaba Cloud`} · ADB · `:``,e.serial,` · `,e.enabled?e.connection?s?`已配置 · 按需连接`:`Configured · Connects on demand`:{device:s?`已连接`:`Connected`,offline:s?`离线`:`Offline`,unauthorized:s?`待授权`:`Unauthorized`}[l.data?.discovery.find(t=>t.serial===e.serial)?.state??``]??(s?`未连接`:`Disconnected`):s?`已禁用`:`Disabled`]})]})]}),(0,F.jsxs)(`div`,{className:`flex max-w-full shrink-0 flex-wrap items-center justify-end gap-1 self-end sm:self-start`,children:[(0,F.jsx)(A,{variant:`ghost`,disabled:m,onClick:()=>H({device:e,serial:e.serial,name:e.name}),children:s?`管理`:`Manage`}),(0,F.jsx)(A,{variant:`ghost`,disabled:m||!e.enabled,onClick:()=>{Q(async()=>{await M(`/devices/${e.id}/view`,{}),window.dispatchEvent(new Event(`phone-connections-changed`)),ee.getState().show(e.id)})},children:s?`查看屏幕`:`View screen`}),(0,F.jsx)(A,{variant:`ghost`,disabled:m||!e.enabled,onClick:()=>{Q(async()=>{let t=await M(`/devices/${e.id}/conversations`,{});window.dispatchEvent(new Event(`session-created`)),ee.getState().hide(),Ee(`/chat/${t.conversationId}`)})},children:s?`对话控制手机`:`Control in chat`}),(0,F.jsxs)(te,{modal:!1,children:[(0,F.jsx)(ne,{asChild:!0,children:(0,F.jsxs)(A,{variant:`ghost`,disabled:m,"aria-label":s?`${e.name}的更多操作`:`More actions for ${e.name}`,children:[s?`更多`:`More`,(0,F.jsx)(h,{className:`size-3.5`,"aria-hidden":!0})]})}),(0,F.jsx)(re,{children:(0,F.jsxs)(ie,{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,F.jsx)(j,{disabled:m||!e.enabled,className:z,onSelect:()=>ye(e),children:s?`重新连接`:`Reconnect`}),(0,F.jsx)(j,{disabled:m||q[e.id]?.pending,className:z,onSelect:()=>{Ae(e)},children:e.connection?s?`连接诊断`:`Connect & diagnose`:s?`诊断`:`Diagnose`}),e.id!==l.data?.defaultDeviceId&&(0,F.jsx)(j,{disabled:m,className:z,onSelect:()=>{Q(async()=>{await M(`/devices/${e.id}/default`,{}),await l.mutate()})},children:s?`设为默认`:`Set default`}),(0,F.jsx)(ae,{className:`my-1 border-t border-edge-subtle`}),(0,F.jsx)(j,{disabled:m,className:`${z} text-danger`,onSelect:()=>{Q(async()=>{await M(`/devices/${e.id}`,void 0,`DELETE`),await l.mutate()})},children:s?`移除连接`:`Remove connection`})]})})]})]})]}),(0,F.jsx)(`p`,{role:`status`,"aria-live":`polite`,title:q[e.id]?.text,className:`h-5 truncate text-xs leading-5 ${q[e.id]?.error?`text-danger`:`text-fg-muted`}`,children:q[e.id]?.text})]},e.id)),l.data?.discovery.filter(e=>!l.data?.devices.some(t=>t.serial===e.serial)).map(e=>(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm`,children:e.name}),(0,F.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.emulator?s?`Android 模拟器`:`Android emulator`:`Android`,` · `,e.state]})]}),(0,F.jsx)(A,{disabled:m||e.state!==`device`,onClick:()=>H({serial:e.serial,name:e.name}),children:s?`添加手机`:`Add phone`})]},e.serial)),!l.data?.devices.length&&!l.data?.discovery.length&&(0,F.jsx)(`p`,{className:`py-3 text-sm text-fg-muted`,children:s?`尚未发现设备。先启动 Android 模拟器,或通过 USB 连接手机并允许调试。`:`No devices found. Start an Android emulator, or connect a phone over USB and authorize debugging.`})]})]}),(0,F.jsx)(pe,{expanded:n(`components`),onExpandedChange:e=>r(`components`,e),cloudOnly:Me,onChanged:()=>{l.mutate(),c.mutate()}}),(0,F.jsxs)(`details`,{open:n(`test`,!!G),onToggle:e=>r(`test`,e.currentTarget.open,!!G),className:`group rounded-2xl border border-edge bg-surface-panel`,"aria-label":s?`手机试运行`:`Phone test run`,children:[(0,F.jsxs)(`summary`,{className:`flex min-h-16 cursor-pointer list-none items-center gap-3 p-5 [&::-webkit-details-marker]:hidden`,children:[(0,F.jsx)(v,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),(0,F.jsx)(`h2`,{className:`text-sm font-semibold`,children:s?`试运行`:`Test run`}),(0,F.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:s?`验证手机操作`:`Try a task`}),(0,F.jsx)(h,{className:`size-4 shrink-0 text-fg-muted group-open:rotate-180`,"aria-hidden":!0})]}),(0,F.jsxs)(`div`,{className:`space-y-4 border-t border-edge-subtle p-5`,children:[(0,F.jsxs)(g,{"aria-label":s?`测试手机`:`Test phone`,value:Z,disabled:m||X,onChange:e=>Se(e.target.value),children:[(0,F.jsx)(_,{value:``,children:s?`选择手机`:`Choose phone`}),l.data?.devices.filter(e=>e.enabled).map(e=>(0,F.jsx)(_,{value:e.id,children:e.name},e.id))]}),(0,F.jsxs)(`div`,{className:`space-y-3`,children:[(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[s?`本次授权的小目标`:`Authorized goal`,(0,F.jsx)(`textarea`,{className:R,value:U,maxLength:2e3,onChange:e=>Ce(e.target.value)})]}),(0,F.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[s?`完成时应显示的文字(可选)`:`Expected completion text (optional)`,(0,F.jsx)(`input`,{className:R,value:W,maxLength:200,onChange:e=>we(e.target.value)})]}),(0,F.jsx)(`p`,{className:`text-xs text-fg-muted`,children:s?`先手动打开允许的应用。模型说完成只表示执行结束,只有匹配界面证据才会显示验证通过。`:`First open an allowed app manually. A model completion claim remains unverified until native UI evidence matches.`})]}),(0,F.jsxs)(A,{variant:`primary`,disabled:m||X||!c.data?.config.enabled||!d||De||f!==d||!Z||!U.trim(),onClick:()=>{ke()},children:[(0,F.jsx)(b,{className:`size-4`}),s?`开始试运行`:`Start test run`]}),K.error&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:String(K.error)}),Y&&(0,F.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge bg-surface-inset p-4`,"aria-live":`polite`,children:[(0,F.jsxs)(`p`,{className:`text-sm font-medium`,children:[Y.deviceName,` · `,je[Y.status]??Y.status]}),(0,F.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[Y.actions,` `,s?`动作`:`actions`,` · `,Y.modelRequests,` `,s?`模型请求`:`model requests`,` · `,Y.verified?s?`界面条件已验证`:`UI condition verified`:s?`尚未验证完成`:`Completion unverified`]}),Y.message&&(0,F.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Y.message}),(Y.errorCode||Y.stopReason)&&(0,F.jsx)(`p`,{className:`break-all text-xs text-fg-muted`,children:Y.errorCode??Y.stopReason}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(A,{disabled:m||!X,onClick:()=>{$(`pause`)},children:s?`暂停`:`Pause`}),(0,F.jsx)(A,{disabled:m||![`paused`,`needs_user`].includes(Y.status),onClick:()=>{$(`resume`)},children:s?`恢复`:`Resume`}),(0,F.jsx)(A,{disabled:m||[`closed`,`cancelled`].includes(Y.status),onClick:()=>{$(`cancel`)},children:s?`停止`:`Stop`}),(0,F.jsx)(A,{disabled:m,onClick:()=>{$(`close`)},children:s?`释放手机`:`Release phone`}),Y.status===`ready`&&!Y.mock&&(0,F.jsx)(A,{disabled:m,onClick:()=>{Q(async()=>{await M(`/sessions/${G}/execute`,{op:`run`,goal:U,...W?{expectText:W}:{}}),await K.mutate()})},children:s?`继续当前目标`:`Continue goal`})]}),Y.facts?.length?(0,F.jsxs)(`details`,{children:[(0,F.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:s?`本次观察到的界面文字`:`Observed UI text`}),(0,F.jsx)(`ul`,{className:`mt-2 max-h-52 space-y-1 overflow-auto text-xs text-fg-muted`,children:Y.facts.map((e,t)=>(0,F.jsx)(`li`,{className:`break-words`,children:e},t))})]}):null]})]})]},G),_e&&(0,F.jsx)(me,{onAdded:()=>{l.mutate()},zh:s,onClose:()=>L(!1),onSelect:e=>{L(!1),H({serial:e.serial,name:e.name})}}),V&&(0,F.jsx)(ge,{device:V,zh:s,onClose:()=>ye(void 0),onConnected:async()=>{await l.mutate()}}),be&&c.data&&(0,F.jsx)(ve,{...be,zh:s,onSave:async()=>{await l.mutate()},onClose:()=>H(void 0)})]})}export{V as PhoneSettingsPage};
@@ -1 +1 @@
1
- import{p as e}from"./locale-store-B7y-RVe8.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
+ import{p as e}from"./locale-store-B6OrWgY1.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 ee,n as a,o}from"./locale-store-B7y-RVe8.js";import{a as te,i as ne,n as s,o as c,r as l,s as u,t as d}from"./dist-BGTk37IG.js";import{t as f}from"./package-wATCyihJ.js";import{t as re}from"./x-B_N4OPjy.js";import{t as p}from"./skeleton-BI5TyibZ.js";import{a as ie,i as m}from"./vendor-swr-CdRzEUwF.js";import{t as h}from"./button-Cc4hUNTt.js";import{n as ae,t as oe}from"./agent-plugin-dialog-DVzYXsAy.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=a(x).startsWith(`zh`),{mutate:w}=ie(),[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 o(ee(`/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}=m(`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)(te,{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:f}),t[14]=L,t[15]=R);let z;t[16]===M?z=t[17]:(z=(0,y.jsx)(u,{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)(re,{className:`size-5`,"aria-hidden":!0}),t[23]=U):U=t[23];let W;t[24]===H?W=t[25]:(W=(0,y.jsx)(s,{asChild:!0,children:(0,y.jsx)(h,{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)(ne,{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)(p,{className:`h-14 w-full`}),(0,y.jsx)(p,{className:`h-28 w-full`}),(0,y.jsx)(p,{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)(h,{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)(h,{asChild:!0,children:(0,y.jsx)(i,{to:se(M,C),children:C?`开始使用`:`Start using`})}):(0,y.jsx)(s,{asChild:!0,children:(0,y.jsx)(h,{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)(c,{children:[F,(0,y.jsxs)(l,{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)(d,{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
+ 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 ee,n as a,o}from"./locale-store-B6OrWgY1.js";import{a as te,i as ne,n as s,o as c,r as l,s as u,t as d}from"./dist-BGTk37IG.js";import{t as f}from"./package-wATCyihJ.js";import{t as re}from"./x-B_N4OPjy.js";import{t as p}from"./skeleton-BI5TyibZ.js";import{a as ie,i as m}from"./vendor-swr-CdRzEUwF.js";import{t as h}from"./button-Cc4hUNTt.js";import{n as ae,t as oe}from"./agent-plugin-dialog-DPabZaSE.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=a(x).startsWith(`zh`),{mutate:w}=ie(),[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 o(ee(`/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}=m(`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)(te,{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:f}),t[14]=L,t[15]=R);let z;t[16]===M?z=t[17]:(z=(0,y.jsx)(u,{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)(re,{className:`size-5`,"aria-hidden":!0}),t[23]=U):U=t[23];let W;t[24]===H?W=t[25]:(W=(0,y.jsx)(s,{asChild:!0,children:(0,y.jsx)(h,{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)(ne,{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)(p,{className:`h-14 w-full`}),(0,y.jsx)(p,{className:`h-28 w-full`}),(0,y.jsx)(p,{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)(h,{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)(h,{asChild:!0,children:(0,y.jsx)(i,{to:se(M,C),children:C?`开始使用`:`Start using`})}):(0,y.jsx)(s,{asChild:!0,children:(0,y.jsx)(h,{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)(c,{children:[F,(0,y.jsxs)(l,{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)(d,{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-B7y-RVe8.js";import{t as i}from"./messages-DYDkJvXj.js";import{n as a,r as o}from"./popover-select-CEMWIrtY.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-Dvv79Wb2.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
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{n,p as r}from"./locale-store-B6OrWgY1.js";import{t as i}from"./messages-jwdBhfL9.js";import{n as a,r as o}from"./popover-select-CEMWIrtY.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-TkG5mo0p.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-B7y-RVe8.js";import{t as l}from"./messages-DYDkJvXj.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-ulup1oFS.js";import{t as v}from"./loader-circle-CifKLtgG.js";import{g as y}from"./markdown-view-DFHa8rUg.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{i as re}from"./vendor-swr-CdRzEUwF.js";import{t as D}from"./button-Cc4hUNTt.js";import{t as O}from"./automation-api-DAou8Kji.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,`
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-B6OrWgY1.js";import{t as l}from"./messages-jwdBhfL9.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-Ddsf7FVg.js";import{t as v}from"./loader-circle-CifKLtgG.js";import{g as y}from"./markdown-view-DrhYZSmg.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{i as re}from"./vendor-swr-CdRzEUwF.js";import{t as D}from"./button-Cc4hUNTt.js";import{t as O}from"./automation-api-CLPsgcQN.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-B7y-RVe8.js";import{t as o}from"./skeleton-BI5TyibZ.js";import{a as s,r as c}from"./product-delivery-DRyD9_Xq.js";import{i as l}from"./vendor-swr-CdRzEUwF.js";import{n as u}from"./api-Dv6Cn-Rs.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=c(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=l(_?[`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=s({...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
+ 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-B6OrWgY1.js";import{t as o}from"./skeleton-BI5TyibZ.js";import{a as s,r as c}from"./product-delivery-DRyD9_Xq.js";import{i as l}from"./vendor-swr-CdRzEUwF.js";import{n as u}from"./api-DMbimMEi.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=c(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=l(_?[`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=s({...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-B7y-RVe8.js";import{t as o}from"./messages-DYDkJvXj.js";import{t as s}from"./markdown-view-DFHa8rUg.js";import{t as c}from"./skeleton-BI5TyibZ.js";import{a as l}from"./api-C-9J9ghT.js";import{i as u}from"./vendor-swr-CdRzEUwF.js";import{t as d}from"./button-Cc4hUNTt.js";import{C as f,_ as p,n as m}from"./automation-task-card-DIjI_Y1X.js";import{t as h}from"./automation-api-DAou8Kji.js";import{i as g,n as _}from"./api-Dv6Cn-Rs.js";import{n as v}from"./product-preview-modal-Ym6bomTW.js";import{t as y}from"./open-route-MyZ2sB9C.js";import{i as b,r as x}from"./automation-result-state-CA7LV098.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),l=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=l?`暂时无法读取这次运行,请重试。`:`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=l?`重试`:`Retry`,a;t[9]!==r||t[10]!==i?(a=(0,C.jsx)(d,{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)(c,{className:`h-6 w-2/3`}),(0,C.jsx)(c,{className:`h-4 w-1/3`}),(0,C.jsx)(c,{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=l?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`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]!==l?(M=new Date(T.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[27]=T.createdAtMs,t[28]=l,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]!==l?(F=T.status===`queued`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):T.status===`running`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=T.status,t[37]=l,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 l(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-B6OrWgY1.js";import{t as o}from"./messages-jwdBhfL9.js";import{t as s}from"./markdown-view-DrhYZSmg.js";import{t as c}from"./skeleton-BI5TyibZ.js";import{a as l}from"./api-oIK4hYkJ.js";import{i as u}from"./vendor-swr-CdRzEUwF.js";import{t as d}from"./button-Cc4hUNTt.js";import{C as f,_ as p,n as m}from"./automation-task-card-D27Mw66U.js";import{t as h}from"./automation-api-CLPsgcQN.js";import{i as g,n as _}from"./api-DMbimMEi.js";import{n as v}from"./product-preview-modal-7Ohx-7OR.js";import{t as y}from"./open-route-MyZ2sB9C.js";import{i as b,r as x}from"./automation-result-state-CKVnR4KG.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),l=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=l?`暂时无法读取这次运行,请重试。`:`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=l?`重试`:`Retry`,a;t[9]!==r||t[10]!==i?(a=(0,C.jsx)(d,{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)(c,{className:`h-6 w-2/3`}),(0,C.jsx)(c,{className:`h-4 w-1/3`}),(0,C.jsx)(c,{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=l?`这条旧链接没有关联具体执行,请从任务的运行记录查看。`:`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]!==l?(M=new Date(T.createdAtMs).toLocaleString(l?`zh-CN`:`en-US`),t[27]=T.createdAtMs,t[28]=l,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]!==l?(F=T.status===`queued`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l?`任务正在排队,开始后会自动更新。`:`Queued. This view updates when execution starts.`}):T.status===`running`?(0,C.jsx)(`p`,{className:`text-sm text-fg-muted`,children:l?`正在执行,结果会自动显示在这里。`:`Running. The result will appear here automatically.`}):null,t[36]=T.status,t[37]=l,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 l(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-VcvxaO2S.js","assets/vendor-react-BOUWij0V.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-B7y-RVe8.js","assets/messages-DYDkJvXj.js","assets/markdown-view-DFHa8rUg.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.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/app-link-DRy3-k7j.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/skeleton-BI5TyibZ.js","assets/api-C-9J9ghT.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/vendor-swr-CdRzEUwF.js","assets/button-Cc4hUNTt.js","assets/automation-task-card-DIjI_Y1X.js","assets/calendar-clock-D-quYVPe.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/popover-select-CEMWIrtY.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.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-Cffxfzi1.js","assets/gateway-config-swr-BD4Bf8uu.js","assets/model-selector-YsCHu1Gn.js","assets/settings-2-D-csvaET.js","assets/registry-api-QZEjziDq.js","assets/gateway-startup-retry-BsU5k8oi.js","assets/open-capability-settings-Cvb65hQB.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/date-picker-BvEnSGZK.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/chevron-right-BweFrslA.js","assets/automation-api-DAou8Kji.js","assets/api-Dv6Cn-Rs.js","assets/open-route-MyZ2sB9C.js","assets/automation-result-state-CA7LV098.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-B7y-RVe8.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./external-link-DjqjBmc3.js";import{V as h}from"./markdown-view-DFHa8rUg.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./skeleton-BI5TyibZ.js";import{i as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-Cc4hUNTt.js";import{r as b}from"./automation-task-card-DIjI_Y1X.js";import{t as x}from"./automation-api-DAou8Kji.js";var S=n(),C=e(t(),1),w=r(),T=(0,C.lazy)(()=>i(()=>import(`./product-preview-content-VcvxaO2S.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)(_,{className:`h-7 w-2/3`}),(0,w.jsx)(_,{className:`h-4 w-full`}),(0,w.jsx)(_,{className:`h-4 w-4/5`}),(0,w.jsx)(_,{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),l,m;t[0]===n.id?(l=t[1],m=t[2]):(l=[`automation-card`,n.id],m=()=>x.get(n.id),t[0]=n.id,t[1]=l,t[2]=m);let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1,shouldRetryOnError:!1},t[3]=h):h=t[3];let{data:g,error:_,mutate:C}=v(l,m,h);if(g?.automation){if(g.automation.action.kind===`agent`&&!g.automation.management){let e;return t[4]!==g.automation||t[5]!==a||t[6]!==i?(e=(0,w.jsx)(b,{automation:g.automation,language:a,onClose:i}),t[4]=g.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)(s,{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)(f,{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)(c,{className:`sr-only`,children:N}),t[17]=N,t[18]=P);let F;t[19]!==_||t[20]!==C||t[21]!==T?(F=_?(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)(y,{variant:`secondary`,onClick:()=>void C(),children:T?`重试`:`Retry`})]}):(0,w.jsx)(D,{}),t[19]=_,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)(y,{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)(u,{children:[O,(0,w.jsxs)(d,{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)(p,{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,_=o(M)===`zh`,v=n.kind===`automation`&&n.view===`run`?_?`运行情况`:`Run progress`:E[n.kind][+!_],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)(s,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=b):b=t[2];let x;t[3]===v?x=t[4]:(x=(0,w.jsx)(f,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:v}),t[3]=v,t[4]=x);let O=_?`查看关联内容,或打开独立页面。`:`Preview related content or open its full page.`,k;t[5]===O?k=t[6]:(k=(0,w.jsx)(c,{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]!==_?(A=n.view!==`run`&&(0,w.jsxs)(a,{to:h(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)(m,{className:`size-4`,"aria-hidden":!0}),_?`打开独立页面`:`Open full page`]}),t[7]=r,t[8]=n.href,t[9]=n.view,t[10]=_,t[11]=A):A=t[11];let j=_?`关闭预览`:`Close preview`,N=_?`关闭预览`:`Close preview`,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,w.jsx)(g,{className:`size-4`,"aria-hidden":!0}),t[12]=P):P=t[12];let F;t[13]!==j||t[14]!==N?(F=(0,w.jsx)(l,{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)(u,{children:[b,(0,w.jsxs)(d,{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)(p,{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};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/product-preview-content-o2Y3VNE7.js","assets/vendor-react-BOUWij0V.js","assets/rolldown-runtime-aKtaBQYM.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/preload-helper-Czpn1I53.js","assets/locale-store-B6OrWgY1.js","assets/messages-jwdBhfL9.js","assets/markdown-view-DrhYZSmg.js","assets/dist-BGTk37IG.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.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/app-link-DRy3-k7j.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/skeleton-BI5TyibZ.js","assets/api-oIK4hYkJ.js","assets/tasks-DRmd6sWt.js","assets/specialists-xbB3xL9e.js","assets/files-BNL4kkSB.js","assets/vendor-swr-CdRzEUwF.js","assets/button-Cc4hUNTt.js","assets/automation-task-card-D27Mw66U.js","assets/calendar-clock-D-quYVPe.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/popover-select-CEMWIrtY.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.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-BB0biwc7.js","assets/gateway-config-swr-D6cc6W6E.js","assets/model-selector-DXm4NS1_.js","assets/settings-2-D-csvaET.js","assets/registry-api-Bl2guMRg.js","assets/gateway-startup-retry-C8g666Ja.js","assets/open-capability-settings-Cvb65hQB.js","assets/interaction-BdhHBbYa.js","assets/form-field-width-DJw_jULe.js","assets/date-picker-CAankdQw.js","assets/calendar-days-hw_Y-g-s.js","assets/chevron-left-DqFhpbvK.js","assets/chevron-right-BweFrslA.js","assets/automation-api-CLPsgcQN.js","assets/api-DMbimMEi.js","assets/open-route-MyZ2sB9C.js","assets/automation-result-state-CKVnR4KG.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-B6OrWgY1.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-BGTk37IG.js";import{t as m}from"./external-link-DjqjBmc3.js";import{V as h}from"./markdown-view-DrhYZSmg.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./skeleton-BI5TyibZ.js";import{i as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-Cc4hUNTt.js";import{r as b}from"./automation-task-card-D27Mw66U.js";import{t as x}from"./automation-api-CLPsgcQN.js";var S=n(),C=e(t(),1),w=r(),T=(0,C.lazy)(()=>i(()=>import(`./product-preview-content-o2Y3VNE7.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)(_,{className:`h-7 w-2/3`}),(0,w.jsx)(_,{className:`h-4 w-full`}),(0,w.jsx)(_,{className:`h-4 w-4/5`}),(0,w.jsx)(_,{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),l,m;t[0]===n.id?(l=t[1],m=t[2]):(l=[`automation-card`,n.id],m=()=>x.get(n.id),t[0]=n.id,t[1]=l,t[2]=m);let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={revalidateOnFocus:!1,shouldRetryOnError:!1},t[3]=h):h=t[3];let{data:g,error:_,mutate:C}=v(l,m,h);if(g?.automation){if(g.automation.action.kind===`agent`&&!g.automation.management){let e;return t[4]!==g.automation||t[5]!==a||t[6]!==i?(e=(0,w.jsx)(b,{automation:g.automation,language:a,onClose:i}),t[4]=g.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)(s,{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)(f,{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)(c,{className:`sr-only`,children:N}),t[17]=N,t[18]=P);let F;t[19]!==_||t[20]!==C||t[21]!==T?(F=_?(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)(y,{variant:`secondary`,onClick:()=>void C(),children:T?`重试`:`Retry`})]}):(0,w.jsx)(D,{}),t[19]=_,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)(y,{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)(u,{children:[O,(0,w.jsxs)(d,{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)(p,{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,_=o(M)===`zh`,v=n.kind===`automation`&&n.view===`run`?_?`运行情况`:`Run progress`:E[n.kind][+!_],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)(s,{className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`}),t[2]=b):b=t[2];let x;t[3]===v?x=t[4]:(x=(0,w.jsx)(f,{className:`min-w-0 flex-1 truncate font-medium text-fg`,children:v}),t[3]=v,t[4]=x);let O=_?`查看关联内容,或打开独立页面。`:`Preview related content or open its full page.`,k;t[5]===O?k=t[6]:(k=(0,w.jsx)(c,{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]!==_?(A=n.view!==`run`&&(0,w.jsxs)(a,{to:h(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)(m,{className:`size-4`,"aria-hidden":!0}),_?`打开独立页面`:`Open full page`]}),t[7]=r,t[8]=n.href,t[9]=n.view,t[10]=_,t[11]=A):A=t[11];let j=_?`关闭预览`:`Close preview`,N=_?`关闭预览`:`Close preview`,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,w.jsx)(g,{className:`size-4`,"aria-hidden":!0}),t[12]=P):P=t[12];let F;t[13]!==j||t[14]!==N?(F=(0,w.jsx)(l,{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)(u,{children:[b,(0,w.jsxs)(d,{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)(p,{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};