@xopcai/xopc 0.0.378 → 0.0.381

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 (241) 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-Xnu0H9yx.js → activity-store-D2oKh5ik.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-sKMpwYNC.js → agent-avatar-dicebear-BnMiU8HX.js} +1 -1
  5. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Ddv61pUQ.js +1 -0
  6. package/dist/gateway/static/root/assets/{agent-plugin-dialog-CxZeGEuL.js → agent-plugin-dialog-C7z3r3Z3.js} +1 -1
  7. package/dist/gateway/static/root/assets/agents-BstMN5nH.js +66 -0
  8. package/dist/gateway/static/root/assets/{agents-admin-api-DFBVz3bV.js → agents-admin-api-D-DNV0ms.js} +1 -1
  9. package/dist/gateway/static/root/assets/{app-management-settings-panel-CWqbEntC.js → app-management-settings-panel-D2boumUX.js} +1 -1
  10. package/dist/gateway/static/root/assets/{appearance-settings-QznCLnam.js → appearance-settings-Cwf53Rqo.js} +1 -1
  11. package/dist/gateway/static/root/assets/{apps-page-wbVq-6PP.js → apps-page-CwWCU5Ib.js} +1 -1
  12. package/dist/gateway/static/root/assets/{archive-plugin-BclI5H7-.js → archive-plugin-DivP9LfK.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automations-page-CTKIwPAS.js → automations-page-DztgYZdC.js} +1 -1
  14. package/dist/gateway/static/root/assets/automations-workspace-SVRa19EF.js +6 -0
  15. package/dist/gateway/static/root/assets/{binary-plugins-D9FwadCs.js → binary-plugins-f-JnMRA1.js} +1 -1
  16. package/dist/gateway/static/root/assets/{block-editor-Dqqtybdf.js → block-editor-CEnzVIbk.js} +39 -39
  17. package/dist/gateway/static/root/assets/{browser-automation-inputs-FGALoJY8.js → browser-automation-inputs-DD-SUHmv.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-automations-page-hQbQFWl-.js → browser-automations-page-m-9ETOOE.js} +2 -2
  19. package/dist/gateway/static/root/assets/{browser-settings-page-DQvfXaeq.js → browser-settings-page-DN37CRLL.js} +2 -2
  20. package/dist/gateway/static/root/assets/{cn-JdwAhgNB.js → bundle-mjs-rHxsej31.js} +1 -1
  21. package/dist/gateway/static/root/assets/{button-CS04eWY9.js → button-aIC072nz.js} +1 -1
  22. package/dist/gateway/static/root/assets/{capabilities-CQuaJBPv.js → capabilities-BOJYAeEJ.js} +1 -1
  23. package/dist/gateway/static/root/assets/{capabilities-ClI4hof_.js → capabilities-Bf6NYuvT.js} +1 -1
  24. package/dist/gateway/static/root/assets/capabilities-page-D1MJHORS.js +2 -0
  25. package/dist/gateway/static/root/assets/capabilities-settings-panel-DmwDOIlV.js +8 -0
  26. package/dist/gateway/static/root/assets/{capability-header-actions-XMz78V4c.js → capability-header-actions-DG-feQV0.js} +1 -1
  27. package/dist/gateway/static/root/assets/{capability-icon-BYm2-nS-.js → capability-icon-DVoZxEgW.js} +1 -1
  28. package/dist/gateway/static/root/assets/channels-Bl6g4Dg9.js +1 -0
  29. package/dist/gateway/static/root/assets/{chat-terminal-dock-Dr3rujcs.js → chat-terminal-dock-CE3tIjLW.js} +2 -2
  30. package/dist/gateway/static/root/assets/cn-0WouolD0.js +1 -0
  31. package/dist/gateway/static/root/assets/{computer-settings-page-G2lMB7CR.js → computer-settings-page-UMzIyZN5.js} +1 -1
  32. package/dist/gateway/static/root/assets/{connector-service-page-Cne5MBuz.js → connector-service-page-P6yEnQ6H.js} +1 -1
  33. package/dist/gateway/static/root/assets/connectors-page-DXhBTvqp.js +1 -0
  34. package/dist/gateway/static/root/assets/{copy-text-row-C1gaJwlZ.js → copy-text-row-C7egVuKr.js} +1 -1
  35. package/dist/gateway/static/root/assets/{date-picker-yGmnkoC5.js → date-picker-eg-Uf9Wx.js} +1 -1
  36. package/dist/gateway/static/root/assets/{dependency-picker-CdKC_TNa.js → dependency-picker-BEn7eZXu.js} +1 -1
  37. package/dist/gateway/static/root/assets/{desktop-pet-C4d305Me.js → desktop-pet-DPAFil05.js} +1 -1
  38. package/dist/gateway/static/root/assets/{desktop-pet-settings-hCS9Mddt.js → desktop-pet-settings-DK38Nevi.js} +1 -1
  39. package/dist/gateway/static/root/assets/{desktop-pet-sprite-DTqXSpqf.js → desktop-pet-sprite-BP6iMVw1.js} +1 -1
  40. package/dist/gateway/static/root/assets/{device-pairing-wizard-C6qeCyfO.js → device-pairing-wizard-DaRk9VLg.js} +1 -1
  41. package/dist/gateway/static/root/assets/{directory-picker-path-field-kYdBIm8m.js → directory-picker-path-field-Dm7jp0Y9.js} +1 -1
  42. package/dist/gateway/static/root/assets/{extension-debug-page-odpIjn1q.js → extension-debug-page-DJ1wFpMs.js} +1 -1
  43. package/dist/gateway/static/root/assets/{extension-page-C6Jn5baO.js → extension-page-tPkDLwrG.js} +1 -1
  44. package/dist/gateway/static/root/assets/{extension-provider-DB4M3dc8.js → extension-provider-Dnz8j6Q_.js} +1 -1
  45. package/dist/gateway/static/root/assets/{extension-settings-page-Clx81lZy.js → extension-settings-page-Vp9FPajP.js} +1 -1
  46. package/dist/gateway/static/root/assets/{fallback-models-pBVU4PxA.js → fallback-models-DirZnl7x.js} +1 -1
  47. package/dist/gateway/static/root/assets/{gateway-config-swr-ArYo4YFd.js → gateway-config-swr-f-4qw3AG.js} +1 -1
  48. package/dist/gateway/static/root/assets/{gateway-realtime-BaE0shFY.js → gateway-realtime-BGhPOSfz.js} +1 -1
  49. package/dist/gateway/static/root/assets/gateway-realtime-store-BYe-jWB1.js +1 -0
  50. package/dist/gateway/static/root/assets/gateway-settings-CRbb12ar.js +1 -0
  51. package/dist/gateway/static/root/assets/{gateway-startup-retry-BRCCiCBH.js → gateway-startup-retry-90pvxKox.js} +1 -1
  52. package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +1 -0
  53. package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-DdDvTjik.js +1 -0
  54. package/dist/gateway/static/root/assets/home-page-BeIZyioN.js +2 -0
  55. package/dist/gateway/static/root/assets/{image-generation-api-B5FwRmo9.js → image-generation-api-CtDjTXwX.js} +1 -1
  56. package/dist/gateway/static/root/assets/{imports-page-7s8jzc2G.js → imports-page-KIeykeaL.js} +1 -1
  57. package/dist/gateway/static/root/assets/index-DxydK_AA.js +255 -0
  58. package/dist/gateway/static/root/assets/index-_xgO2IDa.css +1 -0
  59. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CyFSxteg.js → keyboard-shortcuts-settings-5Df9Rng_.js} +1 -1
  60. package/dist/gateway/static/root/assets/{local-app-workbench-page-B-hYeH8P.js → local-app-workbench-page-BSuq_SAr.js} +1 -1
  61. package/dist/gateway/static/root/assets/{local-apps-page-CFt8G-ae.js → local-apps-page-D5-69OHu.js} +1 -1
  62. package/dist/gateway/static/root/assets/{local-session-drafts-CLR702g5.js → local-session-drafts-CrD74S6k.js} +1 -1
  63. package/dist/gateway/static/root/assets/{locale-store-CeoW7A5a.js → locale-store-pmT2B_By.js} +1 -1
  64. package/dist/gateway/static/root/assets/{logs-page-BQ9AzAj9.js → logs-page-DHYqPwJ3.js} +2 -2
  65. package/dist/gateway/static/root/assets/{management-settings-BDuuXJ5t.js → management-settings-uIgzZZ_J.js} +1 -1
  66. package/dist/gateway/static/root/assets/{markdown-view-DSjfHfaW.css → markdown-view-ByJbFign.css} +1 -1
  67. package/dist/gateway/static/root/assets/markdown-view-CZlvyzow.js +66 -0
  68. package/dist/gateway/static/root/assets/{media-plugins-hqKbHVyi.js → media-plugins-BtFqN13D.js} +1 -1
  69. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DOTWm1iy.js +1 -0
  70. package/dist/gateway/static/root/assets/mermaid-render-604gISVe.js +134 -0
  71. package/dist/gateway/static/root/assets/{messages-BpEhZm54.js → messages-Ib6DaUTo.js} +2 -2
  72. package/dist/gateway/static/root/assets/models-hub-cache-3slk24cw.js +1 -0
  73. package/dist/gateway/static/root/assets/{note-detail-panel-G_6LpTik.js → note-detail-panel-sujG9ZmW.js} +3 -3
  74. package/dist/gateway/static/root/assets/{note-image-lightbox-1qg2v-9j.js → note-image-lightbox-BYNLO2pt.js} +1 -1
  75. package/dist/gateway/static/root/assets/{notes-api-B0QQSN4M.js → notes-api-D-VLGhjV.js} +1 -1
  76. package/dist/gateway/static/root/assets/notes-page-C_4Ib15d.js +8 -0
  77. package/dist/gateway/static/root/assets/{page-context-capture-button-Dp1RoS6x.js → page-context-capture-button-DErqGBBe.js} +1 -1
  78. package/dist/gateway/static/root/assets/{page-tabs-D2xpUV26.js → page-tabs-BLGO2VIm.js} +1 -1
  79. package/dist/gateway/static/root/assets/personal-page-CC3W2EZ0.js +1 -0
  80. package/dist/gateway/static/root/assets/{popover-select-BgSdSbCL.js → popover-select-DHC7J4lG.js} +1 -1
  81. package/dist/gateway/static/root/assets/{preview-open-alternatives-Dvey7GwU.js → preview-open-alternatives-BJU2fmPn.js} +1 -1
  82. package/dist/gateway/static/root/assets/{product-open-page-DZyCQVVW.js → product-open-page-B3qxtYyi.js} +1 -1
  83. package/dist/gateway/static/root/assets/{product-preview-content-CrfIfrVJ.js → product-preview-content-NOhtxfkq.js} +1 -1
  84. package/dist/gateway/static/root/assets/project-detail-page-7BFqLZj4.js +1 -0
  85. package/dist/gateway/static/root/assets/{projects-page-DZ98gcjB.js → projects-page-qhnc7oNj.js} +1 -1
  86. package/dist/gateway/static/root/assets/{registry-api-Dzl61MkW.js → registry-api-Bi4muyaZ.js} +1 -1
  87. package/dist/gateway/static/root/assets/remote-access-hub-CS-zmmtV.js +1 -0
  88. package/dist/gateway/static/root/assets/{runtime-tools-api-Cg9dqJon.js → runtime-tools-api-9bk1payF.js} +1 -1
  89. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-oEdBs0He.js → runtime-tools-settings-panel-B55OozGG.js} +1 -1
  90. package/dist/gateway/static/root/assets/{scenes-page-CVlz-PiN.js → scenes-page-BJZqRz8a.js} +2 -2
  91. package/dist/gateway/static/root/assets/{schema-form-DIC8IlM1.js → schema-form-BND8Hs4C.js} +1 -1
  92. package/dist/gateway/static/root/assets/{secret-input-D93UrW4C.js → secret-input-BxWHx6J6.js} +1 -1
  93. package/dist/gateway/static/root/assets/send-session-input-BtF5UWGp.js +1 -0
  94. package/dist/gateway/static/root/assets/{session-api-CVHFZq_A.js → session-api-D2J6VacQ.js} +1 -1
  95. package/dist/gateway/static/root/assets/session-manager-64DD1cxN.js +16 -0
  96. package/dist/gateway/static/root/assets/sessions-page-U5k3iucx.js +1 -0
  97. package/dist/gateway/static/root/assets/settings-advanced-gate-D8dOvd8T.js +1 -0
  98. package/dist/gateway/static/root/assets/{settings-form-section-exRhP9xn.js → settings-form-section-num14vSv.js} +1 -1
  99. package/dist/gateway/static/root/assets/{settings-loading-skeleton-CAmWMaOT.js → settings-loading-skeleton-BTqvr_Fw.js} +1 -1
  100. package/dist/gateway/static/root/assets/{settings-page-CN0_Np6E.js → settings-page-DOMl-bv4.js} +1 -1
  101. package/dist/gateway/static/root/assets/{settings-page-layout-X1x-2Cp9.js → settings-page-layout-Dx5S-Msc.js} +1 -1
  102. package/dist/gateway/static/root/assets/setup-status-panel-Dgpd7bk0.js +1 -0
  103. package/dist/gateway/static/root/assets/{share-link-dialog-C0gKFt8r.js → share-link-dialog-BnqkFFBZ.js} +1 -1
  104. package/dist/gateway/static/root/assets/{share-preview-page-DxQ6yfYv.js → share-preview-page-aGjIkYmH.js} +1 -1
  105. package/dist/gateway/static/root/assets/{shares-api-tR66Fdly.js → shares-api-cGtd3rjc.js} +1 -1
  106. package/dist/gateway/static/root/assets/{shares-settings-C_ZOqMjz.js → shares-settings-DmFLUeqg.js} +1 -1
  107. package/dist/gateway/static/root/assets/{skeleton-BwbyijEw.js → skeleton-BI5TyibZ.js} +1 -1
  108. package/dist/gateway/static/root/assets/{skill-api-BFhU0NNu.js → skill-api-C9AYuE_b.js} +1 -1
  109. package/dist/gateway/static/root/assets/{skill-reload-api-D_04Mpcb.js → skill-reload-api-VT8F0enn.js} +1 -1
  110. package/dist/gateway/static/root/assets/{skills-page-4-d-lfhq.js → skills-page-CJIhQfG2.js} +1 -1
  111. package/dist/gateway/static/root/assets/{system-settings-panel-DHhaFWty.js → system-settings-panel-Cg0qUX2j.js} +1 -1
  112. package/dist/gateway/static/root/assets/{task-detail-page-CHBEI5uz.js → task-detail-page-C-VbndI4.js} +2 -2
  113. package/dist/gateway/static/root/assets/{task-expandable-content-AGJtkFIu.js → task-expandable-content-UI-0Elqy.js} +1 -1
  114. package/dist/gateway/static/root/assets/{theme-store-DezB9Sal.js → theme-store-D7m5Eng5.js} +1 -1
  115. package/dist/gateway/static/root/assets/{tracing-settings-page-BEHmd2wL.js → tracing-settings-page-CawYzT24.js} +1 -1
  116. package/dist/gateway/static/root/assets/{tunnel-api-Bbb_6pV4.js → tunnel-api-B8bvJesa.js} +1 -1
  117. package/dist/gateway/static/root/assets/{usage-page-BEiWznDq.js → usage-page-DdA0F-qo.js} +1 -1
  118. package/dist/gateway/static/root/assets/{use-autosave-BtTE5X_M.js → use-autosave-jrZBPSWn.js} +1 -1
  119. package/dist/gateway/static/root/assets/{use-composer-attachments-BBHrVqB7.js → use-composer-attachments-hTgxke6e.js} +1 -1
  120. package/dist/gateway/static/root/assets/{use-file-preview-expanded-CQmLEkdj.js → use-file-preview-expanded-tMUDUWVH.js} +2 -2
  121. package/dist/gateway/static/root/assets/user-model-page-Bs6hUk15.js +2 -0
  122. package/dist/gateway/static/root/assets/{voice-api-key-field-tQsUdQnu.js → voice-api-key-field-Bp8brswu.js} +1 -1
  123. package/dist/gateway/static/root/assets/{voice-config-api-69Yqf0QM.js → voice-config-api-415pyWx8.js} +1 -1
  124. package/dist/gateway/static/root/assets/{work-discovery-overlay-Cvf8u31v.js → work-discovery-overlay-CcIDsZWn.js} +1 -1
  125. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CqYp6zjF.js → workflow-run-setup-panel-YP4TJpWE.js} +2 -2
  126. package/dist/gateway/static/root/assets/workflows-page-CYqVuquq.js +6 -0
  127. package/dist/gateway/static/root/assets/{workspace-api-Bu6Csrxf.js → workspace-api-C01xjDt2.js} +2 -2
  128. package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +3 -0
  129. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-D3Cyk8pp.js → xopc-cloud-account-card-Cspd770Z.js} +1 -1
  130. package/dist/gateway/static/root/index.html +38 -35
  131. package/dist/package.js +1 -1
  132. package/dist/packages/realtime-protocol/src/voice-catalog.js +7 -2
  133. package/dist/src/agent/embedded/run-turn.js +38 -0
  134. package/dist/src/agent/embedded/session-runner.js +21 -3
  135. package/dist/src/agent/embedded/tool-metadata.d.ts +2 -1
  136. package/dist/src/agent/external-tools/index.js +6 -3
  137. package/dist/src/agent/external-tools/tool-registry.d.ts +2 -1
  138. package/dist/src/agent/prompt/response-language.js +9 -1
  139. package/dist/src/agent/session/session-config-service.js +0 -13
  140. package/dist/src/agent/tasks/task-judge-service.d.ts +2 -2
  141. package/dist/src/agent/tasks/task-judge-service.js +16 -9
  142. package/dist/src/agent/tools/xopc-use-tool.js +6 -2
  143. package/dist/src/browser/native-messaging-host.js +1 -1
  144. package/dist/src/browser/providers/browser-ext-install.js +2 -2
  145. package/dist/src/cli/bin.js +2 -2
  146. package/dist/src/cli/commands/agent.js +2 -2
  147. package/dist/src/cli/commands/auth.js +1 -1
  148. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  149. package/dist/src/cli/commands/extension-dev.js +1 -1
  150. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  151. package/dist/src/cli/commands/extension.js +1 -1
  152. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  153. package/dist/src/cli/commands/gateway-ssh-tunnel.js +1 -1
  154. package/dist/src/cli/commands/import.js +1 -1
  155. package/dist/src/cli/commands/mcp.js +2 -2
  156. package/dist/src/cli/commands/models.js +2 -2
  157. package/dist/src/cli/commands/onboard/model.js +2 -2
  158. package/dist/src/cli/commands/onboard.js +1 -1
  159. package/dist/src/cli/commands/platform.js +1 -1
  160. package/dist/src/cli/commands/profile.js +1 -1
  161. package/dist/src/cli/commands/tunnel.js +1 -1
  162. package/dist/src/cli/commands/update.js +1 -1
  163. package/dist/src/cli/extension-cli-register.js +1 -1
  164. package/dist/src/config/index.js +1 -1
  165. package/dist/src/endpoint-tools/registry.d.ts +4 -1
  166. package/dist/src/endpoint-tools/registry.js +14 -0
  167. package/dist/src/gateway/chat-stream/mapper.d.ts +2 -0
  168. package/dist/src/gateway/chat-stream/mapper.js +4 -1
  169. package/dist/src/gateway/chat-stream/protocol.d.ts +4 -1
  170. package/dist/src/gateway/hono/app.js +1 -1
  171. package/dist/src/gateway/hono/routes/browser-install.js +1 -1
  172. package/dist/src/gateway/hono/routes/chat-model-config.d.ts +0 -4
  173. package/dist/src/gateway/hono/routes/chat-model-config.js +0 -6
  174. package/dist/src/gateway/hono/routes/devices.js +1 -0
  175. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -0
  176. package/dist/src/gateway/hono/routes/personal-agent.js +4 -2
  177. package/dist/src/gateway/hono/routes/voice.js +12 -4
  178. package/dist/src/gateway/rate-limit/buckets.d.ts +1 -1
  179. package/dist/src/gateway/rate-limit/buckets.js +2 -2
  180. package/dist/src/gateway/run-loop.js +1 -1
  181. package/dist/src/gateway/server.js +1 -1
  182. package/dist/src/gateway/service/run-gateway-agent.js +8 -3
  183. package/dist/src/gateway/side-chat/manager.js +1 -1
  184. package/dist/src/personal-agent/communication.d.ts +2 -1
  185. package/dist/src/personal-agent/communication.js +4 -3
  186. package/dist/src/personal-agent/prompts.d.ts +1 -0
  187. package/dist/src/personal-agent/prompts.js +29 -5
  188. package/dist/src/personal-agent/reply-composer.js +19 -4
  189. package/dist/src/personal-agent/reply-style.d.ts +4 -2
  190. package/dist/src/personal-agent/reply-style.js +57 -5
  191. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  192. package/dist/src/tasks/capabilities/write.js +10 -1
  193. package/dist/src/tasks/task-application-service.js +5 -4
  194. package/dist/src/tasks/task-context-assembler.js +1 -0
  195. package/dist/src/tasks/task-contract-definition.d.ts +1 -1
  196. package/dist/src/tasks/task-contract-definition.js +2 -2
  197. package/dist/src/tasks/task-contract-planner.d.ts +1 -0
  198. package/dist/src/tasks/task-contract-planner.js +2 -1
  199. package/dist/src/tasks/task-language.d.ts +7 -0
  200. package/dist/src/tasks/task-language.js +15 -0
  201. package/dist/src/tasks/task-read-model-projector.js +3 -2
  202. package/dist/src/tasks/task-result-delivery-service.js +2 -1
  203. package/dist/src/tasks/task-run-coordinator.js +22 -8
  204. package/dist/src/tasks/task-run-dispatcher.js +8 -6
  205. package/dist/src/voice/platform-catalog.d.ts +1 -0
  206. package/dist/src/voice/platform-settings.d.ts +1 -1
  207. package/dist/src/voice/platform-settings.js +6 -2
  208. package/dist/src/voice/platform-streams.js +4 -1
  209. package/dist/src/voice/realtime/agentEngine.js +51 -2
  210. package/dist/src/voice/realtime/engine.d.ts +4 -0
  211. package/dist/src/voice/realtime/omniRoute.d.ts +1 -1
  212. package/dist/src/voice/realtime/omniRoute.js +4 -1
  213. package/dist/src/voice/realtime/runtime.js +3 -3
  214. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +6 -2
  215. package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
  216. package/package.json +6 -6
  217. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DLrGOiCS.js +0 -1
  218. package/dist/gateway/static/root/assets/agents-CUnG8q3J.js +0 -66
  219. package/dist/gateway/static/root/assets/automations-workspace-BblZP4ft.js +0 -6
  220. package/dist/gateway/static/root/assets/capabilities-page-CbPvaNJF.js +0 -2
  221. package/dist/gateway/static/root/assets/capabilities-settings-panel-CjApEiV4.js +0 -8
  222. package/dist/gateway/static/root/assets/channels-CJUz97Cw.js +0 -1
  223. package/dist/gateway/static/root/assets/connectors-page-CbxL6ENI.js +0 -1
  224. package/dist/gateway/static/root/assets/gateway-realtime-store-CHAa_VNb.js +0 -1
  225. package/dist/gateway/static/root/assets/gateway-settings-BcSr6MzW.js +0 -1
  226. package/dist/gateway/static/root/assets/home-page-CKeRXki2.js +0 -2
  227. package/dist/gateway/static/root/assets/index-B3BVcMQj.js +0 -106
  228. package/dist/gateway/static/root/assets/index-BU0KqtLI.css +0 -1
  229. package/dist/gateway/static/root/assets/markdown-view-CdqdeQqI.js +0 -201
  230. package/dist/gateway/static/root/assets/models-hub-cache-D0yA-nf6.js +0 -1
  231. package/dist/gateway/static/root/assets/notes-page-kBo3rUvj.js +0 -8
  232. package/dist/gateway/static/root/assets/personal-page-Bf07rfSd.js +0 -1
  233. package/dist/gateway/static/root/assets/project-detail-page-C3wJ8U07.js +0 -1
  234. package/dist/gateway/static/root/assets/remote-access-hub-BvhaF5Pi.js +0 -1
  235. package/dist/gateway/static/root/assets/send-session-input-C449pdoe.js +0 -1
  236. package/dist/gateway/static/root/assets/session-manager-CKFTwYtq.js +0 -16
  237. package/dist/gateway/static/root/assets/sessions-page-DtB119_G.js +0 -1
  238. package/dist/gateway/static/root/assets/settings-advanced-gate-2ciK8mPP.js +0 -1
  239. package/dist/gateway/static/root/assets/setup-status-panel-VtNv07PN.js +0 -1
  240. package/dist/gateway/static/root/assets/user-model-page-B4Gwo5T7.js +0 -2
  241. package/dist/gateway/static/root/assets/workflows-page-DMzGl3CE.js +0 -6
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./messages-BpEhZm54.js";import{c as s,n as c}from"./locale-store-CeoW7A5a.js";import{t as l}from"./session-manager-CKFTwYtq.js";import{t as u}from"./capabilities-CQuaJBPv.js";import{F as d,I as f,ec as p}from"./index-B3BVcMQj.js";var m=e(t(),1),h=n();function g({resource:e,selection:t,label:n,disabled:g=!1}){let _=o(c(e=>e.language)).chat.pageContext,v=r(),y=i().key,[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),w=(0,m.useRef)(!1),T=(0,m.useRef)(0),E=s(e=>e.baseUrl),D=s(e=>e.conversationId);(0,m.useEffect)(()=>(w.current=!1,x(!1),C(!1),()=>{T.current+=1}),[y,e.kind,e.id,e.revision,t?.text,t?.draft,g,E,D]);async function O(){if(g||w.current)return;w.current=!0,x(!0),C(!1);let n=T.current,r=()=>T.current===n&&s.getState().baseUrl===E&&s.getState().conversationId===D;try{let n=f.capture({title:``,text:``,resourceRefs:[e],selection:t}),i=await u(`xopc.context.resolve`,n.envelope);if(!r())return;let a=i.resources[0];if(i.resources.length!==1||JSON.stringify(i.snapshot)!==JSON.stringify(n.envelope)||a.reference.kind!==e.kind||a.reference.id!==e.id||a.reference.revision!==e.revision)throw Error(`Context mismatch`);n.title=a.title,n.preview=a.text,n.truncated=a.truncated;let o=await new l().createSession();if(!r())return;if(!f.put(d(E,D,o.key),n))throw Error(`Context draft limit reached`);v(`/chat/${encodeURIComponent(o.key)}`)}catch{r()&&C(!0)}finally{T.current===n&&(w.current=!1,x(!1))}}return(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,h.jsxs)(`button`,{type:`button`,disabled:g||b,onClick:()=>void O(),"aria-busy":b,title:g?_.unavailable:n??_.capture,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg border border-edge px-2.5 py-1.5 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[b?(0,h.jsx)(a,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,h.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),n??_.capture]}),S?(0,h.jsx)(`p`,{role:`alert`,className:`max-w-72 text-xs text-danger`,children:_.unavailable}):null]})}export{g as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./messages-Ib6DaUTo.js";import{c as s,n as c}from"./locale-store-pmT2B_By.js";import{t as l}from"./session-manager-64DD1cxN.js";import{t as u}from"./capabilities-BOJYAeEJ.js";import{F as d,I as f,ac as p}from"./index-DxydK_AA.js";var m=e(t(),1),h=n();function g({resource:e,selection:t,label:n,disabled:g=!1}){let _=o(c(e=>e.language)).chat.pageContext,v=r(),y=i().key,[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),w=(0,m.useRef)(!1),T=(0,m.useRef)(0),E=s(e=>e.baseUrl),D=s(e=>e.conversationId);(0,m.useEffect)(()=>(w.current=!1,x(!1),C(!1),()=>{T.current+=1}),[y,e.kind,e.id,e.revision,t?.text,t?.draft,g,E,D]);async function O(){if(g||w.current)return;w.current=!0,x(!0),C(!1);let n=T.current,r=()=>T.current===n&&s.getState().baseUrl===E&&s.getState().conversationId===D;try{let n=f.capture({title:``,text:``,resourceRefs:[e],selection:t}),i=await u(`xopc.context.resolve`,n.envelope);if(!r())return;let a=i.resources[0];if(i.resources.length!==1||JSON.stringify(i.snapshot)!==JSON.stringify(n.envelope)||a.reference.kind!==e.kind||a.reference.id!==e.id||a.reference.revision!==e.revision)throw Error(`Context mismatch`);n.title=a.title,n.preview=a.text,n.truncated=a.truncated;let o=await new l().createSession();if(!r())return;if(!f.put(d(E,D,o.key),n))throw Error(`Context draft limit reached`);v(`/chat/${encodeURIComponent(o.key)}`)}catch{r()&&C(!0)}finally{T.current===n&&(w.current=!1,x(!1))}}return(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,h.jsxs)(`button`,{type:`button`,disabled:g||b,onClick:()=>void O(),"aria-busy":b,title:g?_.unavailable:n??_.capture,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg border border-edge px-2.5 py-1.5 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[b?(0,h.jsx)(a,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,h.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),n??_.capture]}),S?(0,h.jsx)(`p`,{role:`alert`,className:`max-w-72 text-xs text-danger`,children:_.unavailable}):null]})}export{g 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{t as i}from"./cn-JdwAhgNB.js";import{n as a}from"./interaction-BdhHBbYa.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-surface-active text-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto overscroll-x-contain px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)||!n.length)return;e.preventDefault();let t=n.findIndex(e=>e.id===r),i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,t)+(e.key===`ArrowRight`?1:-1)+n.length)%n.length;l(n[i].id);let a=e.currentTarget.querySelectorAll(`[role="tab"]`)[i];a?.focus(),a?.scrollIntoView({block:`nearest`,inline:`nearest`})},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,tabIndex:h?0:-1,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`touch-target relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
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"./cn-0WouolD0.js";import{n as a}from"./interaction-BdhHBbYa.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-surface-active text-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto overscroll-x-contain px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)||!n.length)return;e.preventDefault();let t=n.findIndex(e=>e.id===r),i=e.key===`Home`?0:e.key===`End`?n.length-1:(Math.max(0,t)+(e.key===`ArrowRight`?1:-1)+n.length)%n.length;l(n[i].id);let a=e.currentTarget.querySelectorAll(`[role="tab"]`)[i];a?.focus(),a?.scrollIntoView({block:`nearest`,inline:`nearest`})},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,tabIndex:h?0:-1,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`touch-target relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
@@ -0,0 +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-BMYIfy9x.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./popover-select-DHC7J4lG.js";import{E as s}from"./markdown-view-CZlvyzow.js";import{t as c}from"./play-kxZvpBg8.js";import{t as l}from"./settings-2-D-csvaET.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./messages-Ib6DaUTo.js";import{a as f,n as p,r as m}from"./locale-store-pmT2B_By.js";import{T as h,at as g,d as _,t as v}from"./session-manager-64DD1cxN.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./dist-C3DSFZCi.js";import{t as T}from"./skeleton-BI5TyibZ.js";import{t as E}from"./date-formatters-CUZAyDEg.js";import{$ as D,Ds as O,Ea as k,Gc as A,J as j,Kc as M,No as ee,Wc as N,Yi as P,Yr as F,ea as te,fa as ne,ga as re,n as ie,os as ae,q as I,ta as L,vo as oe,wa as se}from"./index-DxydK_AA.js";import{l as R,n as ce,t as le}from"./voice-config-api-415pyWx8.js";var z=n(),B=e(t(),1),V=r();function ue(){try{return[`UTC`,...Intl.supportedValuesOf(`timeZone`)]}catch{return[`UTC`,`Asia/Shanghai`,`Asia/Hong_Kong`,`Asia/Taipei`,`Asia/Tokyo`,`Asia/Seoul`,`Asia/Singapore`,`Asia/Kolkata`,`Asia/Dubai`,`Europe/London`,`Europe/Paris`,`Europe/Berlin`,`America/New_York`,`America/Chicago`,`America/Denver`,`America/Los_Angeles`,`Australia/Sydney`,`Pacific/Auckland`]}}var de=ue();function fe({zh:e}){let[t,n]=(0,B.useState)(),[r,i]=(0,B.useState)(``),[a,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(``),u=c.trim().toLowerCase().replaceAll(`_`,` `),d=[...new Set([...de,t?.timezone].filter(e=>!!e))].sort().filter(e=>e.replaceAll(`_`,` `).toLowerCase().includes(u)).map(e=>({value:e,label:e.replaceAll(`_`,` `),group:e.split(`/`)[0]}));(0,B.useEffect)(()=>{let e=!0;return f(m(`/api/personal-agent/proactivity`)).then(t=>{e&&t.ok&&n(g.parse(t.payload))}).catch(t=>{e&&i(String(t))}),()=>{e=!1}},[]);async function p(e){if(!(!t||a)){s(!0),i(``);try{let r=await f(m(`/api/personal-agent/proactivity`),{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,...e})});r.ok&&n(g.parse(r.payload))}catch(e){i(String(e));let t=await f(m(`/api/personal-agent/proactivity`)).catch(()=>null);t?.ok&&n(g.parse(t.payload))}finally{s(!1)}}}return(0,V.jsxs)(`section`,{className:`space-y-3 border-t border-edge pt-5`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:e?`主动联系`:`Proactive messages`}),!t&&!r?(0,V.jsx)(T,{className:`h-9 w-full`}):t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(o,{placeholder:e?`选择主动方式`:`Choose participation`,value:t.mode,disabled:a,allowEmpty:!1,options:[{value:`off`,label:e?`关闭主动联系`:`Off`},{value:`follow_up`,label:e?`仅明确跟进`:`Requested follow-ups`},{value:`balanced`,label:e?`适度主动`:`Thoughtful participation`}],onChange:e=>void p({mode:e})}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsxs)(`label`,{className:`text-xs text-fg-muted`,children:[e?`静默开始`:`Quiet from`,(0,V.jsx)(o,{placeholder:e?`选择时间`:`Choose time`,value:String(t.quietStart),disabled:a,allowEmpty:!1,options:Array.from({length:24},(e,t)=>({value:String(t),label:`${String(t).padStart(2,`0`)}:00`})),onChange:e=>void p({quietStart:Number(e)})})]}),(0,V.jsxs)(`label`,{className:`text-xs text-fg-muted`,children:[e?`静默结束`:`Quiet until`,(0,V.jsx)(o,{placeholder:e?`选择时间`:`Choose time`,value:String(t.quietEnd),disabled:a,allowEmpty:!1,options:Array.from({length:24},(e,t)=>({value:String(t),label:`${String(t).padStart(2,`0`)}:00`})),onChange:e=>void p({quietEnd:Number(e)})})]})]}),(0,V.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[e?`时区`:`Timezone`,(0,V.jsx)(o,{placeholder:e?`选择时区`:`Choose timezone`,ariaLabel:e?`时区`:`Timezone`,value:t.timezone,selectedLabel:t.timezone.replaceAll(`_`,` `),options:d,disabled:a,allowEmpty:!1,triggerClassName:`mt-1`,searchPlaceholder:e?`搜索时区或城市`:`Search timezone or city`,searchValue:c,onSearchChange:l,statusMessage:d.length?void 0:e?`没有匹配的时区`:`No matching timezones`,onChange:e=>{l(``),e!==t.timezone&&p({timezone:e})}})]}),(0,V.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e?`有值得交流的进展时,在聊天里留下消息。明确请求的结果会照常交付。`:`Useful developments appear in this chat. Requested results are delivered as usual.`})]}),r&&(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:r})]})}var H=[`intro`,`identity`,`voice`,`connections`],pe=[{id:`loopi`,zh:`小环`,en:`Loopi`},{id:`loopi-curious`,zh:`好奇`,en:`Curious`},{id:`loopi-care`,zh:`温和`,en:`Gentle`}];function me(e){return!!(e?.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`))}async function he(e,t){let n=await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(t)});await f(m(`/api/agents/${encodeURIComponent(e)}/avatar`),{method:`PUT`,body:JSON.stringify({base64:n.slice(n.indexOf(`,`)+1),mimeType:t.type})}),te(e)}function ge({modelsAvailable:e,onCreated:t}){let n=p(e=>e.language)===`zh`,r=p(e=>e.language),[o,s]=(0,B.useState)(`intro`),[l,u]=(0,B.useState)({displayName:`Ada`,appearance:`loopi`,voice:null}),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(null),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(null),[E,O]=(0,B.useState)(null),[ee,N]=(0,B.useState)(!0),[F,te]=(0,B.useState)([]),[ne,ie]=(0,B.useState)(null),ae=(0,B.useRef)(null),L=(0,B.useRef)(null),[z,ue]=(0,B.useState)([]),[de,fe]=(0,B.useState)(!0),[ge,_e]=(0,B.useState)([]),[U,W]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=!1;return f(m(`/api/personal-agent/onboarding`)).then(t=>{e||(s(t.payload.step),u(t.payload.draft))}).catch(t=>{e||b(t instanceof Error?t.message:String(t))}).finally(()=>{e||g(!0)}),()=>{e=!0}},[]),(0,B.useEffect)(()=>{if(!h)return;let e=window.setTimeout(()=>{f(m(`/api/personal-agent/onboarding`),{method:`PUT`,body:JSON.stringify({step:o,draft:l})}).catch(()=>{})},350);return()=>window.clearTimeout(e)},[l,h,o]),(0,B.useEffect)(()=>{let e=!1;return le().then(t=>{e||(t.tts&&t.enabled?O({provider:t.tts.provider,model:t.tts.model,enabled:!0}):N(!1))}).catch(()=>{e||N(!1)}),()=>{e=!0}},[]),(0,B.useEffect)(()=>{if(!E?.enabled)return;let e=!1;return ce(E.provider,E.model,`realtime`).then(t=>{e||te(t.slice(0,12))}).catch(()=>{}).finally(()=>{e||N(!1)}),()=>{e=!0}},[E]),(0,B.useEffect)(()=>{if(o!==`connections`)return;let e=!1;return fe(!0),Promise.allSettled([se({page:1,pageSize:24,verification:`verified`}),k()]).then(([t,n])=>{if(!e){if(t.status===`fulfilled`){let e=[`gmail`,`googlecalendar`,`googledrive`,`github`,`linear`];ue(t.value.connectors.filter(t=>t.runtime.type===`composio`&&e.includes(t.runtime.toolkit)).sort((t,n)=>e.indexOf(t.runtime.type===`composio`?t.runtime.toolkit:``)-e.indexOf(n.runtime.type===`composio`?n.runtime.toolkit:``)))}n.status===`fulfilled`&&_e(n.value),fe(!1)}}),()=>{e=!0}},[o]),(0,B.useEffect)(()=>()=>{L.current?.abort(),ae.current?.close()},[]),(0,B.useEffect)(()=>()=>{C&&URL.revokeObjectURL(C)},[C]);let G=async(e,t=l)=>{await f(m(`/api/personal-agent/onboarding`),{method:`PUT`,body:JSON.stringify({step:e,draft:t})}),s(e)},ve=async e=>{b(null);let t=H[Math.max(0,Math.min(H.length-1,H.indexOf(o)+e))];try{await G(t)}catch(e){b(e instanceof Error?e.message:String(e))}},K=async(n=!1)=>{if(!(!e||_)){v(!0),b(null);try{let e=n?{displayName:`Ada`,appearance:`loopi`,voice:null}:l,r=e.voice&&E?.enabled&&F.some(t=>t.id===e.voice)?{provider:E.provider,model:E.model,voice:e.voice}:void 0,i=(await f(m(`/api/personal-agent`),{method:`POST`,body:JSON.stringify({displayName:e.displayName.trim()||`Ada`,appearance:e.appearance,...r?{voicePreference:r}:{}})})).payload,a=!1;if(!n&&x)try{await he(i.agentId,x),i=(await f(m(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:i.revision,displayName:i.displayName,appearance:`custom`,preferences:i.preferences})})).payload}catch{a=!0}t(i,a)}catch(e){b(e instanceof Error?e.message:String(e))}finally{v(!1)}}},ye=(0,B.useCallback)(async e=>{L.current?.abort(),ae.current?.close();let t=new AbortController;L.current=t,ie(e),b(null);try{let n=new re;ae.current=n,await n.start();let r=await R(t.signal,e);if(t.signal.aborted)return;n.enqueue(r,()=>ie(null))}catch(e){t.signal.aborted||b(e instanceof Error?e.message:String(e)),ie(null)}},[]);if(!h)return(0,V.jsxs)(`div`,{className:`mx-auto w-full max-w-xl space-y-4 px-6 py-14`,children:[(0,V.jsx)(T,{className:`h-10 w-2/3`}),(0,V.jsx)(T,{className:`h-64 w-full rounded-2xl`}),(0,V.jsx)(T,{className:`h-12 w-full rounded-xl`})]});let q=H.indexOf(o),be={intro:n?`创建一个和你一起做事的助手`:`Create an assistant to work with you`,identity:n?`先给它一个形象和名字`:`Choose a look and a name`,voice:n?`想让我用什么声音回应?`:`How should your assistant sound?`,connections:n?`要让我了解哪些信息?`:`What information can your assistant use?`}[o];return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-surface-base`,children:[(0,V.jsx)(`header`,{className:`shrink-0 px-5 pt-5 sm:px-8 sm:pt-7`,children:(0,V.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-10 items-center justify-between gap-4`,children:[q>0?(0,V.jsxs)(`button`,{type:`button`,disabled:_,onClick:()=>void ve(-1),className:`-ml-2 inline-flex min-h-10 items-center gap-1.5 rounded-lg px-2 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-40`,children:[(0,V.jsx)(M,{className:`size-4`}),n?`上一步`:`Back`]}):(0,V.jsx)(`span`,{className:`text-sm font-medium text-fg-muted`,children:n?`设置我的助手`:`Set up my assistant`}),(0,V.jsx)(i,{to:`/chat`,className:`-mr-2 inline-flex min-h-10 items-center rounded-lg px-2 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`稍后继续`:`Finish later`})]}),(0,V.jsx)(`div`,{className:`mt-4 grid grid-cols-4 gap-1.5`,role:`progressbar`,"aria-label":n?`设置进度`:`Setup progress`,"aria-valuenow":q+1,"aria-valuemin":1,"aria-valuemax":H.length,children:H.map((e,t)=>(0,V.jsx)(`span`,{className:`h-1 rounded-full transition-colors duration-200 ${t<=q?`bg-accent`:`bg-surface-active`}`},e))})]})}),(0,V.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-8 sm:px-8`,children:(0,V.jsxs)(`div`,{className:`mx-auto my-auto w-full max-w-2xl py-6 motion-safe:animate-[page-enter_220ms_ease-out]`,children:[(0,V.jsxs)(`div`,{className:`mb-8 flex items-center gap-4`,children:[(0,V.jsx)(`span`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-surface-hover`,children:C?(0,V.jsx)(`img`,{src:C,alt:``,className:`size-14 rounded-xl object-cover`}):(0,V.jsx)(P,{appearance:l.appearance,className:`size-14`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`我的助手`:`My assistant`}),(0,V.jsx)(`p`,{className:`mt-1 text-lg font-semibold text-fg`,children:l.displayName||`Ada`})]})]}),(0,V.jsx)(`p`,{className:`mb-3 text-xs font-medium tracking-wide text-fg-subtle`,children:n?`第 ${q+1} 步 · 共 ${H.length} 步`:`Step ${q+1} of ${H.length}`}),(0,V.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:be}),o===`intro`&&(0,V.jsxs)(`div`,{className:`mt-6 max-w-xl space-y-3 text-base leading-8 text-fg-muted`,children:[(0,V.jsx)(`p`,{children:n?`你可以找它讨论问题,也可以交给它一件要推进的事。`:`Talk through a question or give it something to move forward.`}),(0,V.jsx)(`p`,{children:n?`需要深入处理时,它会找合适的 Agent,并把进展带回对话。`:`It can ask a suitable Agent for deeper work and bring the progress back.`}),(0,V.jsx)(`p`,{children:n?`它能使用哪些数据和设备,由你决定。`:`You choose which data and devices it can use.`})]}),o===`identity`&&(0,V.jsxs)(`div`,{className:`mt-7 space-y-7`,children:[(0,V.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[n?`助手名字`:`Assistant name`,(0,V.jsx)(`input`,{value:l.displayName,maxLength:60,onChange:e=>u(t=>({...t,displayName:e.target.value})),onBlur:()=>u(e=>({...e,displayName:e.displayName.trim()||`Ada`})),className:`mt-2 block w-full rounded-xl border border-edge bg-surface-panel px-4 py-3 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`选择头像`:`Choose an avatar`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[pe.map(e=>(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":!x&&l.appearance===e.id,onClick:()=>{S(null),w(null),u(t=>({...t,appearance:e.id}))},className:`flex min-h-28 flex-col items-center justify-center gap-2 rounded-2xl p-3 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${!x&&l.appearance===e.id?`bg-accent/10 text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:[(0,V.jsx)(P,{appearance:e.id,className:`size-14`}),n?e.zh:e.en]},e.id)),(0,V.jsxs)(`label`,{className:`flex min-h-28 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl p-3 text-sm transition-colors focus-within:ring-2 focus-within:ring-accent ${x?`bg-accent/10 text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:[(0,V.jsx)(oe,{className:`size-6`}),n?`上传图片`:`Upload image`,(0,V.jsx)(`input`,{className:`sr-only`,type:`file`,accept:`image/png,image/jpeg,image/webp`,onChange:e=>{let t=e.target.files?.[0];if(t){if(t.size>512*1024||![`image/png`,`image/jpeg`,`image/webp`].includes(t.type)){b(n?`请选择不超过 512 KB 的 PNG、JPEG 或 WebP 图片。`:`Choose a PNG, JPEG, or WebP image under 512 KB.`);return}S(t),w(URL.createObjectURL(t))}}})]})]}),(0,V.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n?`自定义图片在创建助手时上传;刷新后需要重新选择。`:`Custom images upload when you create the assistant; select again after a refresh.`})]})]}),o===`voice`&&(0,V.jsxs)(`div`,{className:`mt-5`,children:[(0,V.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:n?`用于这个助手的语音通话;文字回答不受影响。试听不会使用麦克风。`:`This affects calls with this assistant. Text stays the same. Preview does not use your microphone.`}),ee?(0,V.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[(0,V.jsx)(T,{className:`h-20 rounded-xl`}),(0,V.jsx)(T,{className:`h-20 rounded-xl`})]}):E?.enabled&&F.length>0?(0,V.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[(0,V.jsx)(`button`,{type:`button`,"aria-pressed":!l.voice,onClick:()=>u(e=>({...e,voice:null})),className:`rounded-xl p-4 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${l.voice?`bg-surface-panel text-fg-muted hover:bg-surface-hover`:`bg-accent/10 text-fg ring-1 ring-accent/40`}`,children:n?`使用默认声音`:`Use the default voice`}),F.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl p-3 transition-colors ${l.voice===e.id?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-pressed":l.voice===e.id,onClick:()=>u(t=>({...t,voice:e.id})),children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.name}),(0,V.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description||e.style||(n?`点击选择`:`Select this voice`)})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void ye(e.id),className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-hover text-fg hover:bg-surface-active focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`试听${e.name}`:`Preview ${e.name}`,children:(0,V.jsx)(c,{className:`size-4 ${ne===e.id?`text-accent`:``}`})})]},e.id))]}):(0,V.jsxs)(`div`,{className:`mt-5 rounded-xl bg-surface-panel p-5 text-sm text-fg-muted`,children:[(0,V.jsx)(`p`,{children:n?`当前没有可试听的语音。你可以先用文字对话,稍后再设置。`:`No voice is ready to preview. You can start with text and set it up later.`}),(0,V.jsx)(i,{to:`/settings/capabilities/voice?returnTo=%2Fpersonal`,className:`mt-3 inline-block text-accent hover:underline`,children:n?`设置语音服务`:`Set up voice`})]})]}),o===`connections`&&(0,V.jsxs)(`div`,{className:`mt-5`,children:[(0,V.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:n?`现在连接,或进入对话后再添加。连接不会自动读取历史数据或创建持续关注。`:`Connect now or add sources later. Connecting does not automatically scan history or create ongoing monitoring.`}),de?(0,V.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,V.jsx)(T,{className:`h-18 rounded-xl`}),(0,V.jsx)(T,{className:`h-18 rounded-xl`})]}):(0,V.jsx)(`div`,{className:`mt-5 space-y-2`,children:z.length?z.map(e=>{let t=me(ge.find(t=>t.connectorId===e.id));return(0,V.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-surface-panel p-4`,children:[(0,V.jsx)(D,{connector:e,size:`sm`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.displayName}),(0,V.jsx)(`p`,{className:`line-clamp-2 text-xs text-fg-muted`,children:e.description})]}),t?(0,V.jsxs)(`span`,{className:`flex items-center gap-1 text-xs text-success`,children:[(0,V.jsx)(a,{className:`size-4`}),n?`已连接`:`Connected`]}):(0,V.jsx)(`button`,{type:`button`,onClick:()=>W(I(e)),className:`rounded-lg bg-surface-hover px-3 py-2 text-xs text-fg transition-colors hover:bg-surface-active focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`连接`:`Connect`})]},e.id)}):(0,V.jsx)(`p`,{className:`rounded-xl bg-surface-panel p-5 text-sm text-fg-muted`,children:n?`暂无可用的推荐服务;你仍可直接进入对话。`:`No suggested services are available. You can continue to chat.`})})]}),!e&&(0,V.jsxs)(`p`,{className:`mt-5 rounded-xl bg-warning/5 p-4 text-sm text-fg-muted`,children:[n?`开始前需要一个可用模型。`:`A compatible model is required before you start.`,` `,(0,V.jsx)(i,{to:`/settings/capabilities/models`,className:`text-accent underline`,children:n?`配置模型`:`Set up a model`})]}),y&&(0,V.jsx)(`p`,{role:`alert`,className:`mt-5 text-sm text-danger`,children:y})]},o)}),(0,V.jsx)(`footer`,{className:`shrink-0 px-5 pb-6 pt-3 sm:px-8 sm:pb-9`,children:(0,V.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:n?`这些选择以后都能调整`:`You can change these choices later`}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[o===`intro`&&(0,V.jsx)(`button`,{type:`button`,disabled:!e||_,onClick:()=>void K(!0),className:`min-h-11 rounded-lg px-3 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-40`,children:n?`用默认设置开始`:`Use defaults`}),o===`voice`&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>{let e={...l,voice:null};u(e),b(null),G(`connections`,e).catch(e=>b(e instanceof Error?e.message:String(e)))},className:`min-h-11 rounded-lg px-3 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:n?`跳过`:`Skip`}),(0,V.jsxs)(`button`,{type:`button`,disabled:_||o===`connections`&&!e,onClick:()=>o===`connections`?void K():void ve(1),className:`flex min-h-11 items-center gap-2 rounded-xl bg-accent px-5 text-sm font-medium text-on-accent transition-colors hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:opacity-40`,children:[_?n?`正在创建…`:`Creating…`:o===`connections`?n?`进入对话`:`Start chatting`:n?`继续`:`Continue`,` `,!_&&(0,V.jsx)(A,{className:`size-4`})]})]})]})}),U&&(0,V.jsx)(j,{draft:U,onChange:W,onClose:()=>W(null),t:d(r).connectorsSettings,onInstalled:async()=>{_e(await k()),W(null)}})]})}function _e({record:e,zh:t,onSelectVoice:n,onGreetingChange:r}){let[a,s]=(0,B.useState)(!1),[l,u]=(0,B.useState)(!0),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)([]),[_,v]=(0,B.useState)(e.voicePreference?.voice??``),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(null),E=(0,B.useRef)(null),D=(0,B.useRef)(null);(0,B.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await le();if(e||(s(t.openingGreeting===!0),!t.enabled||!t.tts))return;let n={provider:t.tts.provider,model:t.tts.model};m(n);let r=await ce(n.provider,n.model,`realtime`);e||g(r)}catch(t){e||S(t instanceof Error?t.message:String(t))}finally{e||u(!1)}})(),()=>{e=!0}},[]),(0,B.useEffect)(()=>()=>{D.current?.abort(),E.current?.close()},[]);let O=()=>{D.current?.abort(),D.current=null,E.current?.close(),E.current=null,w(null)},k=async e=>{if(C!==null){O();return}O(),S(null);let n=new AbortController;D.current=n,w(e);try{let t=new re;E.current=t,await t.start();let r=await R(n.signal,e);n.signal.aborted||t.enqueue(r,()=>{D.current===n&&(w(null),D.current=null,E.current=null,t.close())})}catch(e){if(!n.signal.aborted){let n=e?.body?.error?.code;S(t&&n===`unsupported_voice`?`当前音色暂不可用,请刷新语音目录或选择其他音色。`:e instanceof Error?e.message:String(e))}D.current===n&&O()}},A=async e=>{if(y||e===_)return;O();let t=_;v(e),f(``),b(!0),S(null);try{await n(e&&p?{provider:p.provider,model:p.model,voice:e}:null)||v(t)}catch(e){v(t),S(e instanceof Error?e.message:String(e))}finally{b(!1)}},j=h.find(e=>e.id===_),M=t?`默认声音`:`Default voice`,N=j?.name||(_?t?`当前音色不可用`:`Current voice unavailable`:M),P=d.trim().toLocaleLowerCase(),F=h.filter(e=>!P||`${e.name} ${e.description??``} ${e.style??``}`.toLocaleLowerCase().includes(P)).map(e=>({value:e.id,label:e.name}));return(0,V.jsxs)(`section`,{className:`border-t border-edge pt-5`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:t?`通话声音`:`Call voice`}),l?(0,V.jsx)(`div`,{className:`mt-3`,"aria-busy":`true`,children:(0,V.jsx)(T,{className:`h-10 w-full`})}):p&&h.length?(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(o,{value:_,selectedLabel:N,options:F,placeholder:M,emptyLabel:M,ariaLabel:t?`选择通话音色`:`Choose call voice`,disabled:y,onChange:e=>void A(e),searchPlaceholder:h.length>8?t?`搜索音色`:`Search voices`:void 0,searchValue:d,onSearchChange:f,statusMessage:P&&!F.length?t?`没有匹配的音色`:`No matching voices`:void 0})}),(0,V.jsxs)(`button`,{type:`button`,disabled:y||!!(_&&!j),onClick:()=>void k(_),className:`touch-target flex h-10 shrink-0 items-center justify-center gap-1.5 rounded-lg border border-edge px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,title:C===null?t?`试听${N}`:`Preview ${N}`:t?`停止试听`:`Stop preview`,"aria-label":C===null?t?`试听${N}`:`Preview ${N}`:t?`停止试听`:`Stop preview`,children:[C===null?(0,V.jsx)(c,{className:`size-4`,"aria-hidden":!0}):(0,V.jsx)(ee,{className:`size-4 text-accent`,"aria-hidden":!0}),C===null?t?`试听`:`Preview`:t?`停止`:`Stop`]})]}),(0,V.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:j?.description||j?.style||(_?t?`选择后自动保存,用于之后的语音通话。`:`Saved automatically for future voice calls.`:t?`跟随语音服务的默认音色。`:`Uses the voice service’s default voice.`)})]}):(0,V.jsxs)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:[t?`当前没有可用音色。`:`No voice is ready.`,` `,(0,V.jsx)(i,{to:`/settings/capabilities/voice?returnTo=%2Fpersonal`,className:`text-accent underline`,children:t?`设置语音服务`:`Set up voice`})]}),r&&a&&(0,V.jsxs)(`label`,{className:`mt-4 flex items-center justify-between gap-3 text-sm text-fg`,children:[t?`连接时打招呼`:`Greet me when connected`,(0,V.jsx)(`input`,{type:`checkbox`,checked:e.voiceCallPreferences?.openingGreetingEnabled??!0,disabled:y,onChange:e=>{let t=e.target.checked;b(!0),r(t).catch(e=>S(String(e))).finally(()=>b(!1))}})]}),x&&(0,V.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-danger`,children:x})]})}var U=new v;function W({conversationId:e,zh:t,onSaved:n}){let r=h(t=>t.sessions[e]),[i,a]=(0,B.useState)(!0),[o,s]=(0,B.useState)(``);(0,B.useEffect)(()=>{let t=!0;return U.loadSessionAgentConfig(e).then(n=>{t&&_(e,n)}).catch(e=>{t&&s(String(e))}).finally(()=>{t&&a(!1)}),()=>{t=!1}},[e]);let c=!!r?.modelConfigSaving;async function l(t,i){h.getState().patchSessionMeta(e,{modelConfigSaving:!0});try{_(e,await U.patchSessionAgentConfig(e,{model:t,thinkingLevel:i,configVersion:r?.configVersion})),await n()}catch(t){let n=await U.loadSessionAgentConfig(e).catch(()=>null);throw n&&_(e,n),t}finally{h.getState().patchSessionMeta(e,{modelConfigSaving:!1})}}return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:t?`对话模型与思考强度`:`Conversation model and thinking`}),i?(0,V.jsx)(T,{className:`h-9 w-full`}):(0,V.jsx)(F,{chat:d(t?`zh`:`en`).chat,sessionModel:r?.model??``,thinkingLevel:r?.thinkingLevel??`off`,modelDisabled:c,thinkingDisabled:c,onModelChange:l,onThinkingChange:e=>l(r?.model??``,e)}),o&&(0,V.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-danger`,children:o})]})}var G=5;function ve(e){let t=e.replace(/\s+/g,` `).trim();if(t.length<=58)return t;let n=t.replace(/([^)]{1,80})|\([^)]{1,80}\)/g,``).replace(/([A-Za-z0-9])(?=[\u4e00-\u9fff])/g,`$1 `).replace(/\s+/g,` `).trim(),r=n.split(/[。!?;;,]/,1)[0]?.trim()||n;return r.length>58?`${r.slice(0,57).trimEnd()}…`:r}function K(e,t){if(e.phase===`closed`)return{label:t?`已结束`:`Finished`,tone:`bg-fg-subtle`};let n=e.operationalState??e.runStatus;return n===`running`?{label:t?`正在执行`:`Working`,tone:`bg-accent`}:n===`queued`?{label:t?`等待开始`:`Queued`,tone:`bg-fg-subtle`}:n===`failed`?{label:t?`执行失败`:`Failed`,tone:`bg-danger`}:n===`waiting`?{label:t?`等待继续`:`Waiting`,tone:`bg-warning`}:n===`blocked`?{label:t?`已阻塞`:`Blocked`,tone:`bg-warning`}:n===`verifying`?{label:t?`正在验证`:`Verifying`,tone:`bg-accent`}:n===`cancelled`?{label:t?`执行已取消`:`Cancelled`,tone:`bg-fg-subtle`}:e.phase===`review`?{label:t?`等待验收`:`In review`,tone:`bg-warning`}:e.phase===`active`?{label:t?`正在推进`:`In progress`,tone:`bg-accent`}:e.phase===`ready`?{label:t?`准备开始`:`Ready`,tone:`bg-fg-subtle`}:{label:t?`待处理`:`Planned`,tone:`bg-fg-subtle`}}function ye(e){let t=(0,z.c)(30),{item:n,zh:r}=e,a;t[0]!==n||t[1]!==r?(a=K(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,c;t[3]===n.id?c=t[4]:(c=s(`/personal`,n.id),t[3]=n.id,t[4]=c);let l=`mt-2 size-1.5 shrink-0 rounded-full ${o.tone}`,u;t[5]===l?u=t[6]:(u=(0,V.jsx)(`span`,{className:l,"aria-hidden":!0}),t[5]=l,t[6]=u);let d;t[7]===n.title?d=t[8]:(d=ve(n.title),t[7]=n.title,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,V.jsx)(`span`,{className:`line-clamp-2 break-words text-sm font-medium leading-5 text-fg`,children:d}),t[9]=d,t[10]=f);let p;t[11]===o.label?p=t[12]:(p=(0,V.jsx)(`span`,{children:o.label}),t[11]=o.label,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,V.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`·`}),t[13]=m):m=t[13];let h=r?`zh`:`en`,g;t[14]!==n.updatedAt||t[15]!==h?(g=E(n.updatedAt,h),t[14]=n.updatedAt,t[15]=h,t[16]=g):g=t[16];let _;t[17]===g?_=t[18]:(_=(0,V.jsx)(`span`,{children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==p?(v=(0,V.jsxs)(`span`,{className:`mt-1.5 flex items-center gap-2 text-xs text-fg-muted`,children:[p,m,_]}),t[19]=_,t[20]=p,t[21]=v):v=t[21];let y;t[22]!==v||t[23]!==f?(y=(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,v]}),t[22]=v,t[23]=f,t[24]=y):y=t[24];let b;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,V.jsx)(N,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100`,"aria-hidden":!0}),t[25]=b):b=t[25];let x;return t[26]!==y||t[27]!==c||t[28]!==u?(x=(0,V.jsxs)(i,{to:c,className:`group flex min-w-0 items-start gap-3 rounded-2xl bg-surface-panel px-4 py-4 transition-colors duration-150 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,y,b]}),t[26]=y,t[27]=c,t[28]=u,t[29]=x):x=t[29],x}var q=[{id:`direct`,warmth:`reserved`,zh:`直接`,en:`Direct`},{id:`natural`,warmth:`balanced`,zh:`自然`,en:`Natural`},{id:`gentle`,warmth:`gentle`,zh:`温和`,en:`Gentle`}],be=[{id:`loopi`,zh:`小环`,en:`Loopi`,color:`bg-slate-100/50 dark:bg-slate-400/10`},{id:`loopi-curious`,zh:`好奇`,en:`Curious`,color:`bg-blue-100/50 dark:bg-blue-400/10`},{id:`loopi-care`,zh:`温和`,en:`Gentle`,color:`bg-violet-100/50 dark:bg-violet-400/10`}];function xe(e,t){return e.warmth===`reserved`?t?`你可以直接说目标或问题。我会先给结论,需要时再展开。`:`Tell me the goal or question. I’ll lead with the answer and expand when useful.`:e.warmth===`gentle`?t?`想聊一件事,或让我帮你推进工作,都可以从这里开始。我会认真听,也会把下一步说清楚。`:`You can talk something through or ask me to move work forward. I’ll listen carefully and make the next step clear.`:t?`有什么想讨论或推进的事?直接告诉我就好。`:`What would you like to discuss or move forward? Just tell me what is on your mind.`}function Se(e){return q.find(t=>t.warmth===e.warmth)?.id??`natural`}function Ce(){let e=ne(),t=(0,B.useRef)(e);t.current=e;let n=p(e=>e.language)===`zh`,r=L(e=>e.setPageHeader),i=L(e=>e.clearPageHeader),[a,s]=(0,B.useState)(null),c=(0,B.useRef)(null),d=(0,B.useRef)(Promise.resolve()),[h,g]=(0,B.useState)([]),[_,v]=(0,B.useState)(!0),[E,D]=(0,B.useState)(0),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(!0),[ee,N]=(0,B.useState)(!1),[F,re]=(0,B.useState)(`natural`),[I,se]=(0,B.useState)(`loopi`),[R,ce]=(0,B.useState)(!1),le=(0,B.useRef)(null),z=(0,B.useRef)(null),ue=(0,B.useRef)(null),[de,H]=(0,B.useState)(``),[pe,me]=(0,B.useState)(`untangle`),[he,U]=(0,B.useState)(`none`),[ve,K]=(0,B.useState)(`balanced`),[Ce,we]=(0,B.useState)(`decisions`),[Te,Ee]=(0,B.useState)(!1),[De,J]=(0,B.useState)(!1),[Oe,ke]=(0,B.useState)(!1),[Y,Ae]=(0,B.useState)(null),[je,Me]=(0,B.useState)(!1),[X,Ne]=(0,B.useState)(!1),[Pe,Fe]=(0,B.useState)(!1),[Z,Ie]=(0,B.useState)(0),Q=(0,B.useRef)(0),Le=(0,B.useCallback)(()=>{ke(!1),J(!1),Ee(!0)},[]),Re=(0,B.useCallback)(()=>{ke(!1),J(!1),Ee(e=>!e)},[]),ze=(0,B.useCallback)(async()=>{try{let[e,t]=await Promise.all([f(m(`/api/personal-agent`)),f(m(`/api/personal-agent/models`))]);if(c.current=e.payload,s(e.payload),e.payload?.state===`ready`){let e=await f(m(`/api/personal-agent/onboarding`));M(!e.payload.completed||e.payload.welcomeDone)}window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e.payload})),e.payload&&window.dispatchEvent(new Event(`session-updated`)),g(t.payload),e.payload&&(H(e.payload.displayName),se(e.payload.appearance),re(Se(e.payload.preferences)),me(e.payload.preferences.supportMode??`untangle`),U(e.payload.preferences.humor??`none`),K(e.payload.preferences.detailLevel??`balanced`),we(e.payload.preferences.proactivity??`decisions`))}catch(e){A(e instanceof Error?e.message:String(e))}finally{v(!1)}},[]);(0,B.useEffect)(()=>{ze()},[ze]);let $=(0,B.useCallback)(e=>{D(e=>e+1),A(null);let t=d.current.then(async()=>{let t=c.current;if(!t)return!1;let n=e.displayName?.trim()||t.displayName,r=e.appearance??t.appearance,i={...t.preferences,...e.preferences},a=e.voicePreference===void 0?t.voicePreference:e.voicePreference;if(n===t.displayName&&r===t.appearance&&JSON.stringify(i)===JSON.stringify(t.preferences)&&JSON.stringify(a)===JSON.stringify(t.voicePreference)&&(!e.voiceCallPreferences||JSON.stringify(e.voiceCallPreferences)===JSON.stringify(t.voiceCallPreferences)))return!0;try{let o=await f(m(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:t.revision,displayName:n,appearance:r,preferences:i,...e.voicePreference===void 0?{}:{voicePreference:a},...e.voiceCallPreferences?{voiceCallPreferences:e.voiceCallPreferences}:{}})});return c.current=o.payload,s(o.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:o.payload})),!0}catch(e){return A(e instanceof Error?e.message:String(e)),!1}}).finally(()=>D(e=>e-1));return d.current=t,t},[]),Be=async e=>{if(a){A(null);try{if(e){let t=await f(m(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:a.revision,displayName:a.displayName,appearance:a.appearance,preferences:{...a.preferences,supportMode:e}})});c.current=t.payload,s(t.payload)}await f(m(`/api/personal-agent/onboarding/welcome`),{method:`POST`,body:`{}`}),M(!0)}catch(e){A(e instanceof Error?e.message:String(e))}}},Ve=(0,B.useCallback)(async()=>{let e=++Q.current;ke(!0),Ae(null),Me(!1),Ne(!1),Fe(!1),Ie(0);try{let t=await f(m(`/api/personal-agent/activity?limit=${G}&offset=0`));if(e!==Q.current)return;Ae(t.payload),Ie(t.payload.items.length)}catch{e===Q.current&&Me(!0)}},[]),He=(0,B.useCallback)(async()=>{if(!Y||X||Z>=Y.total)return;let e=Q.current;Ne(!0),Fe(!1);try{let t=await f(m(`/api/personal-agent/activity?limit=${G}&offset=${Z}`));if(e!==Q.current)return;Ae(e=>e?{total:t.payload.total,items:[...e.items,...t.payload.items.filter(t=>!e.items.some(e=>e.id===t.id))]}:t.payload),Ie(e=>e+t.payload.items.length)}catch{e===Q.current&&Fe(!0)}finally{e===Q.current&&Ne(!1)}},[Y,Z,X]);(0,B.useEffect)(()=>{if(!Oe||!Y||X)return;let e,t=()=>{window.clearTimeout(e),e=window.setTimeout(async()=>{let e=Q.current;try{let t=await f(m(`/api/personal-agent/activity?limit=${Math.max(G,Math.min(100,Z))}&offset=0`));if(e!==Q.current)return;Ae(t.payload),Ie(t.payload.items.length)}catch{}},120)},n=window.setInterval(t,5e3);return window.addEventListener(`task-changed-v2`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.clearTimeout(e),window.clearInterval(n),window.removeEventListener(`task-changed-v2`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[Y,Z,X,Oe]);let Ue=async e=>{if(!a||![`image/png`,`image/jpeg`,`image/webp`].includes(e.type)){A(n?`请选择 PNG、JPEG 或 WebP 图片。`:`Choose a PNG, JPEG, or WebP image.`);return}if(e.size===0||e.size>512*1024){A(n?`图片大小不能超过 512 KB。`:`Image must be 512 KB or smaller.`);return}ce(!0),A(null);try{let t=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(e)});await f(m(`/api/agents/${encodeURIComponent(a.agentId)}/avatar`),{method:`PUT`,body:JSON.stringify({base64:t.slice(t.indexOf(`,`)+1),mimeType:e.type})}),te(a.agentId),se(`custom`),J(!1),await $({appearance:`custom`})}catch(e){A(e instanceof Error?e.message:String(e))}finally{ce(!1)}};(0,B.useLayoutEffect)(()=>{let o=a?.state===`ready`,s=o?a.appearance:I,c=o?a.displayName:`Ada`;return r({startExtra:null,main:(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[o?(0,V.jsx)(`button`,{ref:ue,type:`button`,onClick:Re,"aria-expanded":Te,className:`touch-target -m-1 shrink-0 rounded-full p-1 transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`编辑${c}的资料`:`Edit ${c}'s profile`,title:n?`资料`:`Profile`,children:(0,V.jsx)(`span`,{className:`flex size-8 items-center justify-center`,children:(0,V.jsx)(P,{appearance:s,agentId:a?.agentId,className:`size-8`})})}):(0,V.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center`,children:(0,V.jsx)(P,{appearance:s,agentId:a?.agentId,className:`size-8`})}),(0,V.jsx)(`h1`,{className:`min-w-0 truncate text-sm font-semibold text-fg sm:text-base`,children:c})]}),end:o?(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`button`,{type:`button`,disabled:e.active,onClick:()=>{a?.state===`ready`&&t.current.open({conversationId:a.conversationId,name:a.displayName,mode:`assistant`})},className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,"aria-label":n?`语音通话`:`Voice call`,title:n?`语音通话`:`Voice call`,children:(0,V.jsx)(ae,{className:`size-5`})}),(0,V.jsxs)(x,{open:Oe,onOpenChange:e=>{e?Ve():ke(!1)},children:[(0,V.jsx)(C,{asChild:!0,children:(0,V.jsx)(`button`,{type:`button`,"aria-pressed":Oe,className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`正在做的事`:`Activity`,children:(0,V.jsx)(O,{className:`size-5`})})}),(0,V.jsx)(y,{children:(0,V.jsxs)(b,{side:`bottom`,align:`end`,sideOffset:8,collisionPadding:8,"aria-label":n?`派发的任务`:`Delegated tasks`,className:`z-50 flex h-[min(34rem,calc(100dvh-6rem))] w-[min(25rem,calc(100vw-1rem))] min-h-0 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-inset shadow-xl focus:outline-none`,children:[(0,V.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 px-6 pb-3 pt-6`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n?`交给我推进的事`:`Delegated work`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:Y?n?`最近更新 · 共 ${Y.total} 项`:`Recently updated · ${Y.total} total`:n?`查看任务进展与结果`:`Follow progress and results`})]}),(0,V.jsx)(S,{className:`touch-target -mr-2 -mt-1 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`关闭活动`:`Close activity`,children:(0,V.jsx)(u,{className:`size-4`})})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-5 pt-3`,children:[!Y&&!je&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(T,{className:`h-18 rounded-2xl`}),(0,V.jsx)(T,{className:`h-18 rounded-2xl`}),(0,V.jsx)(T,{className:`h-18 rounded-2xl`})]}),je&&(0,V.jsxs)(`div`,{className:`px-5 py-12 text-center`,children:[(0,V.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n?`暂时无法读取任务`:`Could not load tasks`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>void Ve(),className:`mt-3 rounded-lg px-3 py-2 text-sm text-accent hover:bg-surface-hover`,children:n?`重试`:`Try again`})]}),Y?.items.length===0&&(0,V.jsxs)(`div`,{className:`px-5 py-16 text-center`,children:[(0,V.jsx)(O,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,V.jsx)(`p`,{className:`mt-4 text-sm font-medium text-fg`,children:n?`还没有派发的任务`:`No delegated work yet`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`你可以在对话里直接告诉我想推进的事。`:`Tell me what you would like to move forward in chat.`})]}),Y&&Y.items.length>0&&(0,V.jsx)(`div`,{className:`space-y-2`,children:Y.items.map(e=>(0,V.jsx)(ye,{item:e,zh:n},e.id))}),Y&&Z<Y.total&&(0,V.jsxs)(`div`,{className:`pt-4 text-center`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>void He(),disabled:X,className:`min-h-10 rounded-xl bg-surface-panel px-5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:opacity-50`,children:X?n?`正在加载…`:`Loading…`:n?`加载更多`:`Load more`}),Pe&&(0,V.jsx)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:n?`加载失败,请重试`:`Could not load more. Try again.`})]})]})]})})]}),(0,V.jsx)(`button`,{ref:z,type:`button`,onClick:Re,"aria-expanded":Te,className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`回应偏好`:`Response preferences`,children:(0,V.jsx)(l,{className:`size-5`})})]}):null}),()=>i()},[Y,je,Z,X,Pe,I,i,He,Ve,a,r,Oe,Te,Re,e.active,n]);function We(){return a?(0,V.jsxs)(x,{open:Te,onOpenChange:e=>{Ee(e),e||J(!1)},children:[(0,V.jsx)(w,{virtualRef:z}),(0,V.jsx)(y,{children:(0,V.jsxs)(b,{side:`bottom`,align:`end`,sideOffset:8,collisionPadding:8,"aria-label":n?`编辑 Personal AI`:`Edit Personal AI`,onInteractOutside:e=>{e.target instanceof Node&&(z.current?.contains(e.target)||ue.current?.contains(e.target))&&e.preventDefault()},className:`z-50 flex h-[min(38rem,calc(100dvh-6rem))] w-[min(28rem,calc(100vw-1rem))] min-h-0 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-xl outline-none`,children:[(0,V.jsxs)(`div`,{className:`relative flex shrink-0 flex-col items-center px-5 pt-5 text-center`,children:[(0,V.jsx)(`button`,{type:`button`,disabled:R,onClick:()=>J(e=>!e),"aria-expanded":De,"aria-controls":`personal-appearance-options`,"aria-label":n?`选择头像`:`Choose avatar`,className:`rounded-full transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:(0,V.jsx)(P,{appearance:I,agentId:a.agentId,className:`size-20`})}),(0,V.jsx)(`input`,{id:`personal-name`,"aria-label":n?`助手名称`:`Assistant name`,value:de,onChange:e=>H(e.target.value),onBlur:e=>{let t=e.currentTarget.value.trim();t?(H(t),$({displayName:t})):H(c.current?.displayName??``)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(e.currentTarget.value=c.current?.displayName??``,H(e.currentTarget.value),e.currentTarget.blur())},maxLength:60,placeholder:`Ada`,className:`mt-3 w-full min-w-0 rounded-lg border border-transparent bg-transparent px-2 py-1 text-center text-lg font-semibold text-fg outline-none transition-colors hover:border-edge focus:border-edge focus:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`}),E>0&&(0,V.jsx)(`span`,{className:`absolute right-4 top-4 text-xs text-fg-muted`,children:n?`正在保存…`:`Saving…`})]}),(0,V.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto overscroll-contain px-5 py-5`,children:[k&&(0,V.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:k}),De&&(0,V.jsxs)(`section`,{id:`personal-appearance-options`,children:[(0,V.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`形象`:`Appearance`}),(0,V.jsxs)(`div`,{className:`grid grid-cols-4 gap-2`,children:[be.map(e=>(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{se(e.id),J(!1),$({appearance:e.id})},"aria-pressed":I===e.id,className:`flex min-w-0 flex-col items-center gap-1.5 rounded-xl px-1 py-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${I===e.id?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,V.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-full ${e.color}`,children:(0,V.jsx)(P,{appearance:e.id,className:`size-8`})}),(0,V.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,children:n?e.zh:e.en})]},e.id)),(0,V.jsx)(`input`,{ref:le,type:`file`,accept:`image/png,image/jpeg,image/webp`,className:`sr-only`,"aria-label":n?`上传头像`:`Upload avatar`,onChange:e=>{let t=e.currentTarget.files?.[0];t&&Ue(t),e.currentTarget.value=``}}),(0,V.jsxs)(`button`,{type:`button`,disabled:R,onClick:()=>le.current?.click(),"aria-pressed":I===`custom`,className:`flex min-w-0 flex-col items-center gap-1.5 rounded-xl px-1 py-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50 ${I===`custom`?`bg-accent/10 ring-1 ring-accent/40`:`bg-surface-panel hover:bg-surface-hover`}`,children:[(0,V.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-full bg-surface-panel`,children:I===`custom`?(0,V.jsx)(P,{appearance:`custom`,agentId:a.agentId,className:`size-8`}):(0,V.jsx)(oe,{className:`size-4 text-fg-muted`,"aria-hidden":!0})}),(0,V.jsx)(`span`,{className:`truncate text-xs text-fg-muted`,children:R?n?`上传中…`:`Uploading…`:n?`上传`:`Upload`})]})]})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`语气`:`Tone`}),(0,V.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:q.map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>{re(e.id),$({preferences:{warmth:e.warmth}})},"aria-pressed":F===e.id,className:`min-h-10 rounded-xl px-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${F===e.id?`bg-accent/10 font-medium text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:n?e.zh:e.en},e.id))})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-fg`,children:n?`棘手时`:`When things get tricky`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[[`listen`,n?`先听`:`Listen`],[`untangle`,n?`理清`:`Untangle`],[`solutions`,n?`给办法`:`Suggest`]].map(([e,t])=>(0,V.jsx)(`button`,{type:`button`,"aria-pressed":pe===e,onClick:()=>{me(e),$({preferences:{supportMode:e}})},className:`min-h-9 rounded-full px-3 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${pe===e?`bg-accent/10 text-fg ring-1 ring-accent/40`:`bg-surface-panel text-fg-muted hover:bg-surface-hover`}`,children:t},e))})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`mb-2 text-sm font-medium text-fg`,children:n?`回答长度`:`Length`}),(0,V.jsx)(o,{value:ve??`balanced`,options:[{value:`brief`,label:n?`简短`:`Brief`},{value:`balanced`,label:n?`适中`:`Balanced`},{value:`detailed`,label:n?`详细`:`Detailed`}],placeholder:n?`选择长度`:`Choose length`,allowEmpty:!1,onChange:e=>{let t=e;K(t),$({preferences:{detailLevel:t}})}})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`mb-2 text-sm font-medium text-fg`,children:n?`主动更新`:`Updates`}),(0,V.jsx)(o,{value:Ce??`decisions`,options:[{value:`decisions`,label:n?`结果与决定`:`Results only`},{value:`important`,label:n?`重要进展`:`Milestones`},{value:`open`,label:n?`多提建议`:`Suggestions`}],placeholder:n?`选择频率`:`Choose frequency`,allowEmpty:!1,onChange:e=>{let t=e;we(t),$({preferences:{proactivity:t}})}})]})]}),(0,V.jsxs)(`details`,{className:`text-sm text-fg-muted`,children:[(0,V.jsx)(`summary`,{className:`cursor-pointer select-none`,children:n?`更多偏好`:`More preferences`}),(0,V.jsxs)(`div`,{className:`mt-3`,children:[(0,V.jsx)(`p`,{className:`mb-2 font-medium text-fg`,children:n?`轻松程度`:`Humor`}),(0,V.jsx)(o,{value:he??`none`,options:[{value:`none`,label:n?`不加玩笑`:`None`},{value:`occasional`,label:n?`偶尔轻松`:`Sometimes`},{value:`playful`,label:n?`活泼`:`Playful`}],placeholder:n?`选择程度`:`Choose level`,allowEmpty:!1,onChange:e=>{let t=e;U(t),$({preferences:{humor:t}})}})]})]}),(0,V.jsx)(fe,{zh:n}),(0,V.jsx)(_e,{onGreetingChange:e=>$({voiceCallPreferences:{openingGreetingEnabled:e}}),record:a,zh:n,onSelectVoice:e=>$({voicePreference:e})}),(0,V.jsx)(`div`,{className:`border-t border-edge pt-5`,children:(0,V.jsx)(W,{conversationId:a.conversationId,zh:n,onSaved:async()=>{let e=await f(m(`/api/personal-agent`));e.ok&&e.payload&&(c.current=e.payload,s(e.payload))}})})]})]})})]}):null}return _?(0,V.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl space-y-5 px-6 py-12`,children:[(0,V.jsx)(T,{className:`h-20 w-20 rounded-full`}),(0,V.jsx)(T,{className:`h-9 w-72`}),(0,V.jsx)(T,{className:`h-44 w-full rounded-2xl`})]}):a?.state===`ready`?(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-surface-panel`,children:[ee&&(0,V.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 items-center justify-between gap-3 border-b border-warning/30 bg-warning/5 px-5 py-3 text-sm text-fg-muted`,children:[(0,V.jsx)(`span`,{children:n?`助手已创建,头像上传未完成。可在资料设置中重新上传。`:`Your assistant is ready. Upload the avatar again in profile settings.`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{N(!1),Le()},className:`shrink-0 text-accent hover:underline`,children:n?`打开设置`:`Open settings`})]}),(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(ie,{embedded:!0,personal:!0,personalWelcome:{name:a.displayName,addressAs:a.userCallName??void 0,avatar:(0,V.jsx)(P,{appearance:a.appearance,agentId:a.agentId,className:`size-14`}),opening:xe(a.preferences,n),showSupportChoice:!j,onChooseSupport:e=>void Be(e),onSkipSupport:()=>void Be(),supportChoiceError:k},conversationId:a.conversationId})})}),We()]}):(0,V.jsx)(ge,{modelsAvailable:h.length>0,onCreated:(e,t)=>{c.current=e,s(e),H(e.displayName),M(!1),N(t),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e})),window.dispatchEvent(new Event(`session-updated`))}})}export{Ce as PersonalPage};
@@ -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"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-JdwAhgNB.js";import{a as s,i as c,o as l,s as u}from"./dist-C3DSFZCi.js";import{t as d}from"./skeleton-BwbyijEw.js";import{a as f,s as p,t as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";var h=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),g=e(t(),1),_=n();function v(e,t=!1){if(!t)return m;switch(e){case`modal`:return f;case`page`:return p;default:return`z-50`}}var y=r(),b=(0,g.createContext)({layer:`default`,portalContainer:null});function x(e,t){return e===`modal`||t===`modal`?`modal`:e===`page`||t===`page`?`page`:`default`}function S(e){let t=(0,_.c)(9),{layer:n,portalContainer:r,children:i}=e,a=(0,g.useContext)(b),o;t[0]!==n||t[1]!==a.layer?(o=x(a.layer,n),t[0]=n,t[1]=a.layer,t[2]=o):o=t[2];let s=o,c=r??a.portalContainer,l;t[3]!==s||t[4]!==c?(l={layer:s,portalContainer:c},t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==i||t[7]!==l?(u=(0,y.jsx)(b.Provider,{value:l,children:i}),t[6]=i,t[7]=l,t[8]=u):u=t[8],u}function C(){return(0,g.useContext)(b).layer}function w(){return(0,g.useContext)(b).portalContainer}function T(e){let t=(0,_.c)(3),n=w(),r;return t[0]!==n||t[1]!==e?(r=e?.closest(`[role="dialog"]`)??n,t[0]=n,t[1]=e,t[2]=r):r=t[2],r}function E(e){let t=(0,_.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:s}=e,c=i===void 0?!1:i,l=(0,g.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,y.jsxs)(`label`,{className:o(`touch-target flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,y.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,y.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==s||t[12]!==u?(d=(0,y.jsx)(`fieldset`,{"aria-label":s,className:`min-w-0 space-y-0.5`,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var D=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,O=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function k({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:f=!1,disabledValues:p,disabled:m,id:_,ariaLabel:b,ariaLabelledBy:x,title:S,triggerClassName:w,triggerIcon:E,contentClassName:k,side:A=`bottom`,align:j=`start`,onChange:M,searchPlaceholder:N,searchValue:P,onSearchChange:F,loading:I=!1,statusMessage:L,selectedLabel:R}){let[z,B]=(0,g.useState)(!1),[V,H]=(0,g.useState)(null),U=C(),W=T(V),G=v(U,W!==null),K=t.find(t=>t.value===e),q=R??K?.label??(e?`${e} · unavailable`:n),J;return(0,y.jsxs)(l,{open:z,onOpenChange:B,children:[(0,y.jsx)(u,{asChild:!0,children:(0,y.jsxs)(`button`,{ref:H,id:_,type:`button`,"aria-label":b,"aria-labelledby":x,title:S,disabled:m,className:o(`touch-target box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-inset px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m&&`cursor-not-allowed opacity-50 hover:border-edge`,w),children:[E,(0,y.jsx)(`span`,{className:o(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:q}),(0,y.jsx)(h,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,y.jsx)(s,{container:W??void 0,children:(0,y.jsxs)(c,{side:A,align:j,sideOffset:4,collisionPadding:8,className:o(G,D,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,k),children:[N?(0,y.jsx)(`input`,{type:`search`,"aria-label":N,placeholder:N,value:P,onChange:e=>F?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-base text-fg placeholder:text-fg-subtle sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,y.jsxs)(`div`,{"data-select-scroll-region":!0,className:o(O,`max-h-64`),children:[r?(0,y.jsxs)(`button`,{type:`button`,disabled:f,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,f&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{f||(M(``),B(!1))},children:[(0,y.jsx)(a,{className:o(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,I?(0,y.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,y.jsx)(d,{className:`h-8 w-full`},e))}):null,L&&!I?(0,y.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:L}):null,(I?[]:t).map(t=>{let n=t.disabled===!0||p?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==J;return J=t.group,(0,y.jsxs)(g.Fragment,{children:[r?(0,y.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,y.jsxs)(`button`,{type:`button`,disabled:n,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(M(t.value),B(!1))},children:[t.icon??(0,y.jsx)(a,{className:o(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,y.jsx)(a,{className:o(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function A(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(A).join(``):(0,g.isValidElement)(e)?A(e.props.children):``}function j(e,t){let n=[];return g.Children.forEach(e,e=>{if(!(0,g.isValidElement)(e))return;if(e.type===g.Fragment){n.push(...j(e.props.children,t));return}if(e.type===N){let t=e.props;n.push(...j(t.children,A(t.label)));return}if(e.type!==M)return;let r=e.props,i=A(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function M(e){return null}function N(e){return null}function P(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function F(e){let t=(0,_.c)(66),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:s,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,g.useId)(),v=m==null?``:String(m),b,x,S,C,w,T,E,D,O,A;if(t[13]!==r||t[14]!==i||t[15]!==s||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==v){let e=j(r);C=e.find(L),x=C!==void 0,S=C?.label||u||``,D=s||void 0,t[31]===i?O=t[32]:(O=P(i),t[31]=i,t[32]=O),A=d.name,b=k,w=c??h,T=v,E=e.filter(I),t[13]=r,t[14]=i,t[15]=s,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=v,t[21]=b,t[22]=x,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E,t[28]=D,t[29]=O,t[30]=A}else b=t[21],x=t[22],S=t[23],C=t[24],w=t[25],T=t[26],E=t[27],D=t[28],O=t[29],A=t[30];let M=u??S,N=C?.disabled===!0,F=d[`aria-label`],R=d[`aria-labelledby`],z=d.title,B;t[33]!==i||t[34]!==p?(B=o(i,p),t[33]=i,t[34]=p,t[35]=B):B=t[35];let V;t[36]===l?V=t[37]:(V=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=V);let H;t[38]!==b||t[39]!==n||t[40]!==x||t[41]!==a||t[42]!==s||t[43]!==S||t[44]!==d.title||t[45]!==f||t[46]!==w||t[47]!==R||t[48]!==B||t[49]!==V||t[50]!==T||t[51]!==E||t[52]!==M||t[53]!==N||t[54]!==F?(H=(0,y.jsx)(b,{id:w,value:T,options:E,placeholder:M,allowEmpty:x,emptyLabel:S,emptyDisabled:N,disabled:s,ariaLabel:F,ariaLabelledBy:R,title:z,side:f,align:n,triggerClassName:B,contentClassName:a,onChange:V}),t[38]=b,t[39]=n,t[40]=x,t[41]=a,t[42]=s,t[43]=S,t[44]=d.title,t[45]=f,t[46]=w,t[47]=R,t[48]=B,t[49]=V,t[50]=T,t[51]=E,t[52]=M,t[53]=N,t[54]=F,t[55]=H):H=t[55];let U;t[56]!==s||t[57]!==d.name||t[58]!==v?(U=(0,y.jsx)(`input`,{name:d.name,value:v,readOnly:!0,hidden:!0,disabled:s}),t[56]=s,t[57]=d.name,t[58]=v,t[59]=U):U=t[59];let W;return t[60]!==H||t[61]!==U||t[62]!==D||t[63]!==O||t[64]!==A?(W=(0,y.jsxs)(`div`,{"aria-disabled":D,className:O,"data-select-name":A,children:[H,U]}),t[60]=H,t[61]=U,t[62]=D,t[63]=O,t[64]=A,t[65]=W):W=t[65],W}function I(e){return e.value!==``}function L(e){return e.value===``}export{D as a,T as c,h as d,E as i,C as l,F as n,O as o,M as r,S as s,k as t,v as u};
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"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-0WouolD0.js";import{a as s,i as c,o as l,s as u}from"./dist-C3DSFZCi.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{a as f,s as p,t as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";var h=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),g=e(t(),1),_=n();function v(e,t=!1){if(!t)return m;switch(e){case`modal`:return f;case`page`:return p;default:return`z-50`}}var y=r(),b=(0,g.createContext)({layer:`default`,portalContainer:null});function x(e,t){return e===`modal`||t===`modal`?`modal`:e===`page`||t===`page`?`page`:`default`}function S(e){let t=(0,_.c)(9),{layer:n,portalContainer:r,children:i}=e,a=(0,g.useContext)(b),o;t[0]!==n||t[1]!==a.layer?(o=x(a.layer,n),t[0]=n,t[1]=a.layer,t[2]=o):o=t[2];let s=o,c=r??a.portalContainer,l;t[3]!==s||t[4]!==c?(l={layer:s,portalContainer:c},t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;return t[6]!==i||t[7]!==l?(u=(0,y.jsx)(b.Provider,{value:l,children:i}),t[6]=i,t[7]=l,t[8]=u):u=t[8],u}function C(){return(0,g.useContext)(b).layer}function w(){return(0,g.useContext)(b).portalContainer}function T(e){let t=(0,_.c)(3),n=w(),r;return t[0]!==n||t[1]!==e?(r=e?.closest(`[role="dialog"]`)??n,t[0]=n,t[1]=e,t[2]=r):r=t[2],r}function E(e){let t=(0,_.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:s}=e,c=i===void 0?!1:i,l=(0,g.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,y.jsxs)(`label`,{className:o(`touch-target flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,y.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,y.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==s||t[12]!==u?(d=(0,y.jsx)(`fieldset`,{"aria-label":s,className:`min-w-0 space-y-0.5`,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var D=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,O=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function k({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:f=!1,disabledValues:p,disabled:m,id:_,ariaLabel:b,ariaLabelledBy:x,title:S,triggerClassName:w,triggerIcon:E,contentClassName:k,side:A=`bottom`,align:j=`start`,onChange:M,searchPlaceholder:N,searchValue:P,onSearchChange:F,loading:I=!1,statusMessage:L,selectedLabel:R}){let[z,B]=(0,g.useState)(!1),[V,H]=(0,g.useState)(null),U=C(),W=T(V),G=v(U,W!==null),K=t.find(t=>t.value===e),q=R??K?.label??(e?`${e} · unavailable`:n),J;return(0,y.jsxs)(l,{open:z,onOpenChange:B,children:[(0,y.jsx)(u,{asChild:!0,children:(0,y.jsxs)(`button`,{ref:H,id:_,type:`button`,"aria-label":b,"aria-labelledby":x,title:S,disabled:m,className:o(`touch-target box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-inset px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,m&&`cursor-not-allowed opacity-50 hover:border-edge`,w),children:[E,(0,y.jsx)(`span`,{className:o(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:q}),(0,y.jsx)(h,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,y.jsx)(s,{container:W??void 0,children:(0,y.jsxs)(c,{side:A,align:j,sideOffset:4,collisionPadding:8,className:o(G,D,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,k),children:[N?(0,y.jsx)(`input`,{type:`search`,"aria-label":N,placeholder:N,value:P,onChange:e=>F?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-base text-fg placeholder:text-fg-subtle sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,y.jsxs)(`div`,{"data-select-scroll-region":!0,className:o(O,`max-h-64`),children:[r?(0,y.jsxs)(`button`,{type:`button`,disabled:f,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,f&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{f||(M(``),B(!1))},children:[(0,y.jsx)(a,{className:o(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,I?(0,y.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,y.jsx)(d,{className:`h-8 w-full`},e))}):null,L&&!I?(0,y.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:L}):null,(I?[]:t).map(t=>{let n=t.disabled===!0||p?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==J;return J=t.group,(0,y.jsxs)(g.Fragment,{children:[r?(0,y.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,y.jsxs)(`button`,{type:`button`,disabled:n,className:o(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(M(t.value),B(!1))},children:[t.icon??(0,y.jsx)(a,{className:o(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,y.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,y.jsx)(a,{className:o(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function A(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(A).join(``):(0,g.isValidElement)(e)?A(e.props.children):``}function j(e,t){let n=[];return g.Children.forEach(e,e=>{if(!(0,g.isValidElement)(e))return;if(e.type===g.Fragment){n.push(...j(e.props.children,t));return}if(e.type===N){let t=e.props;n.push(...j(t.children,A(t.label)));return}if(e.type!==M)return;let r=e.props,i=A(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function M(e){return null}function N(e){return null}function P(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function F(e){let t=(0,_.c)(66),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:s,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,g.useId)(),v=m==null?``:String(m),b,x,S,C,w,T,E,D,O,A;if(t[13]!==r||t[14]!==i||t[15]!==s||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==v){let e=j(r);C=e.find(L),x=C!==void 0,S=C?.label||u||``,D=s||void 0,t[31]===i?O=t[32]:(O=P(i),t[31]=i,t[32]=O),A=d.name,b=k,w=c??h,T=v,E=e.filter(I),t[13]=r,t[14]=i,t[15]=s,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=v,t[21]=b,t[22]=x,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E,t[28]=D,t[29]=O,t[30]=A}else b=t[21],x=t[22],S=t[23],C=t[24],w=t[25],T=t[26],E=t[27],D=t[28],O=t[29],A=t[30];let M=u??S,N=C?.disabled===!0,F=d[`aria-label`],R=d[`aria-labelledby`],z=d.title,B;t[33]!==i||t[34]!==p?(B=o(i,p),t[33]=i,t[34]=p,t[35]=B):B=t[35];let V;t[36]===l?V=t[37]:(V=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=V);let H;t[38]!==b||t[39]!==n||t[40]!==x||t[41]!==a||t[42]!==s||t[43]!==S||t[44]!==d.title||t[45]!==f||t[46]!==w||t[47]!==R||t[48]!==B||t[49]!==V||t[50]!==T||t[51]!==E||t[52]!==M||t[53]!==N||t[54]!==F?(H=(0,y.jsx)(b,{id:w,value:T,options:E,placeholder:M,allowEmpty:x,emptyLabel:S,emptyDisabled:N,disabled:s,ariaLabel:F,ariaLabelledBy:R,title:z,side:f,align:n,triggerClassName:B,contentClassName:a,onChange:V}),t[38]=b,t[39]=n,t[40]=x,t[41]=a,t[42]=s,t[43]=S,t[44]=d.title,t[45]=f,t[46]=w,t[47]=R,t[48]=B,t[49]=V,t[50]=T,t[51]=E,t[52]=M,t[53]=N,t[54]=F,t[55]=H):H=t[55];let U;t[56]!==s||t[57]!==d.name||t[58]!==v?(U=(0,y.jsx)(`input`,{name:d.name,value:v,readOnly:!0,hidden:!0,disabled:s}),t[56]=s,t[57]=d.name,t[58]=v,t[59]=U):U=t[59];let W;return t[60]!==H||t[61]!==U||t[62]!==D||t[63]!==O||t[64]!==A?(W=(0,y.jsxs)(`div`,{"aria-disabled":D,className:O,"data-select-name":A,children:[H,U]}),t[60]=H,t[61]=U,t[62]=D,t[63]=O,t[64]=A,t[65]=W):W=t[65],W}function I(e){return e.value!==``}function L(e){return e.value===``}export{D as a,T as c,h as d,E as i,C as l,F as n,O as o,M as r,S as s,k as t,v as u};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{n as a}from"./interaction-BdhHBbYa.js";import{n as o}from"./electron-env-Dit0bHgy.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=o()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=o()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-on-accent shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-0WouolD0.js";import{n as a}from"./interaction-BdhHBbYa.js";import{n as o}from"./electron-env-Dit0bHgy.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=o()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=o()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,a.transition,a.press,a.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-on-accent shadow-sm`,a.transition,a.press,a.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a}from"./locale-store-CeoW7A5a.js";import{a as o,r as s}from"./product-delivery-BAks11S4.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BwbyijEw.js";import{Kn as u}from"./index-B3BVcMQj.js";import{t as d}from"./open-route-MyZ2sB9C.js";var f=e(),p=t();function m(){let e=(0,f.c)(14),t=i(),r=a(h)===`zh`,m=s(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=c(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=r?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=o({...m,title:m.id,capabilities:[`open`]}),i;return e[3]!==t||e[4]!==r?(i=t?(0,p.jsx)(n,{to:t,replace:!0}):(0,p.jsx)(g,{message:r?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?r?`找不到这个应用,它可能已被删除。`:`This app was not found and may have been deleted.`:y instanceof Error?y.message:r?`无法打开这个应用。`:`Unable to open this app.`,n;return e[6]!==t||e[7]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[6]=t,e[7]=r,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 r;return e[11]===t?r=e[12]:(r=(0,p.jsx)(n,{to:t,replace:!0}),e[11]=t,e[12]=r),r}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)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{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:i}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=i?`查看应用`:`View apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(r,{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{r as n,t as r,u as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as a}from"./locale-store-pmT2B_By.js";import{a as o,r as s}from"./product-delivery-BAks11S4.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BI5TyibZ.js";import{Kn as u}from"./index-DxydK_AA.js";import{t as d}from"./open-route-MyZ2sB9C.js";var f=e(),p=t();function m(){let e=(0,f.c)(14),t=i(),r=a(h)===`zh`,m=s(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=c(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=r?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=o({...m,title:m.id,capabilities:[`open`]}),i;return e[3]!==t||e[4]!==r?(i=t?(0,p.jsx)(n,{to:t,replace:!0}):(0,p.jsx)(g,{message:r?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?r?`找不到这个应用,它可能已被删除。`:`This app was not found and may have been deleted.`:y instanceof Error?y.message:r?`无法打开这个应用。`:`Unable to open this app.`,n;return e[6]!==t||e[7]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[6]=t,e[7]=r,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 r;return e[11]===t?r=e[12]:(r=(0,p.jsx)(n,{to:t,replace:!0}),e[11]=t,e[12]=r),r}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)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{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:i}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=i?`查看应用`:`View apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(r,{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-BMYIfy9x.js";import{t as r}from"./markdown-view-CdqdeQqI.js";import{t as i}from"./messages-BpEhZm54.js";import{c as a,n as o,r as s}from"./locale-store-CeoW7A5a.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{Ci as l,Jn as u,Kn as d,br as f,gn as p,h as m,l as h,mr as g,v as _}from"./index-B3BVcMQj.js";import{i as v}from"./automation-display-DCkjVzA0.js";import{t as y}from"./open-route-MyZ2sB9C.js";var b=e(),x=t();async function S(e){switch(e.kind){case`project`:return{kind:e.kind,value:await l(e.id)};case`workflow_run`:return{kind:e.kind,value:await m(e.id,{ownerAgentId:e.ownerAgentId})};case`workflow_definition`:{let t=await _();return{kind:e.kind,value:t.find(t=>t.id===e.id||t.name===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 d(e.id),n=e.sourceHash?await u(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var C={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 w(e){let t=(0,b.c)(138),{target:r}=e,l=a(k),u=o(O),d=u===`zh`,m=i(u),h;t[0]===d?h=t[1]:(h=e=>C[e]?.[+!d]||e,t[0]=d,t[1]=h);let _=h,w;t[2]!==r.href||t[3]!==l?(w=[`chat-product-preview`,r.href,l],t[2]=r.href,t[3]=l,t[4]=w):w=t[4];let A;t[5]===r?A=t[6]:(A=()=>S(r),t[5]=r,t[6]=A);let j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j={shouldRetryOnError:!1,refreshInterval:D},t[7]=j):j=t[7];let{data:M,error:N,isLoading:P}=c(w,A,j);if(P){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(p,{}),t[8]=e):e=t[8],e}if(N){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,x.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!M?.value){let e=d?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let F=E;if(M.kind===`project`){let e=M.value,n;t[13]===e.name?n=t[14]:(n=(0,x.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]!==_?(r=_(e.status),t[15]=e.status,t[16]=_,t[17]=r):r=t[17];let i;t[18]!==e.health||t[19]!==_?(i=_(e.health),t[18]=e.health,t[19]=_,t[20]=i):i=t[20];let a;t[21]!==r||t[22]!==i?(a=(0,x.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]!==F||t[25]!==e.description?(o=F(e.description),t[24]=F,t[25]=e.description,t[26]=o):o=t[26];let s;t[27]!==F||t[28]!==e.brief?(s=F(e.brief),t[27]=F,t[28]=e.brief,t[29]=s):s=t[29];let c;t[30]!==F||t[31]!==e.outcome?(c=F(e.outcome),t[30]=F,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,x.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,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`完成标准`:`Success criteria`}),(0,x.jsx)(`ul`,{className:`list-disc space-y-2 pl-5 text-sm text-fg`,children:e.successCriteria.map(T)})]}),t[39]=e.successCriteria,t[40]=d,t[41]=u):u=t[41];let f;t[42]!==e.milestones||t[43]!==_||t[44]!==d?(f=e.milestones?.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`里程碑`:`Milestones`}),e.milestones.slice(0,8).map(e=>(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,_(e.status)]},e.id))]}),t[42]=e.milestones,t[43]=_,t[44]=d,t[45]=f):f=t[45];let p;t[46]!==F||t[47]!==e.recentUpdates||t[48]!==d?(p=e.recentUpdates?.[0]&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`最近进展`:`Latest update`}),F(e.recentUpdates[0].summary)]}),t[46]=F,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,x.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(M.kind===`workflow_run`){let{run:e,phases:n}=M.value,r;t[55]===e.title?r=t[56]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.title}),t[55]=e.title,t[56]=r);let i;t[57]!==e.status||t[58]!==_?(i=_(e.status),t[57]=e.status,t[58]=_,t[59]=i):i=t[59];let a=e.metrics?` · ${e.metrics.doneAgentCount}/${e.metrics.agentCount} ${d?`执行单元完成`:`agents completed`}`:``,o;t[60]!==i||t[61]!==a?(o=(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i,a]}),t[60]=i,t[61]=a,t[62]=o):o=t[62];let s;t[63]!==r||t[64]!==o?(s=(0,x.jsxs)(`div`,{className:`space-y-3`,children:[r,o]}),t[63]=r,t[64]=o,t[65]=s):s=t[65];let c;t[66]===e.error?c=t[67]:(c=e.error&&(0,x.jsx)(`p`,{role:`alert`,className:`rounded-lg border border-edge p-3 text-sm text-danger`,children:e.error.message}),t[66]=e.error,t[67]=c);let l;t[68]!==F||t[69]!==e.result||t[70]!==d?(l=g(e.result)?F(f(e.result)):(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`尚无运行结果。`:`No result yet.`}),t[68]=F,t[69]=e.result,t[70]=d,t[71]=l):l=t[71];let u;t[72]!==n||t[73]!==_||t[74]!==d?(u=n.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`运行进度`:`Progress`}),n.map(e=>(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,_(e.status)]},e.id))]}),t[72]=n,t[73]=_,t[74]=d,t[75]=u):u=t[75];let p;return t[76]!==c||t[77]!==l||t[78]!==u||t[79]!==s?(p=(0,x.jsxs)(`div`,{className:`space-y-6`,children:[s,c,l,u]}),t[76]=c,t[77]=l,t[78]=u,t[79]=s,t[80]=p):p=t[80],p}if(M.kind===`workflow_definition`){let e=M.value,n=e.title||e.name,r;t[81]===n?r=t[82]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:n}),t[81]=n,t[82]=r);let i;t[83]!==e.description||t[84]!==F?(i=F(e.description),t[83]=e.description,t[84]=F,t[85]=i):i=t[85];let a=e.metadata?.whenToUse,o;t[86]!==F||t[87]!==a?(o=F(a),t[86]=F,t[87]=a,t[88]=o):o=t[88];let s;t[89]!==e.phases||t[90]!==F||t[91]!==d?(s=e.phases.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`执行阶段`:`Phases`}),e.phases.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:e.title}),F(e.description)]},e.id))]}),t[89]=e.phases,t[90]=F,t[91]=d,t[92]=s):s=t[92];let c;return t[93]!==s||t[94]!==r||t[95]!==i||t[96]!==o?(c=(0,x.jsxs)(`div`,{className:`space-y-6`,children:[r,i,o,s]}),t[93]=s,t[94]=r,t[95]=i,t[96]=o,t[97]=c):c=t[97],c}if(M.kind===`automation`){let e=M.value,n=e.action.kind===`agent`?e.action.instruction:e.action.kind===`workflow`?e.action.goal:void 0,r;t[98]===e.name?r=t[99]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[98]=e.name,t[99]=r);let i;t[100]!==e.description||t[101]!==F?(i=F(e.description),t[100]=e.description,t[101]=F,t[102]=i):i=t[102];let a;t[103]!==n||t[104]!==F?(a=F(n),t[103]=n,t[104]=F,t[105]=a):a=t[105];let o;t[106]!==e.state.nextRunAtMs||t[107]!==d?(o=e.state.nextRunAtMs&&(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[d?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),t[106]=e.state.nextRunAtMs,t[107]=d,t[108]=o):o=t[108];let s;t[109]===e.state.lastError?s=t[110]:(s=e.state.lastError&&(0,x.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[109]=e.state.lastError,t[110]=s);let c=d?`最近运行`:`Recent runs`,l;t[111]===c?l=t[112]:(l=(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:c}),t[111]=c,t[112]=l);let f;t[113]!==M.runs||t[114]!==F||t[115]!==_||t[116]!==d?(f=M.runs.length?M.runs.map(e=>(0,x.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[_(e.status),` · `,new Date(e.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),F(e.summary),e.error&&(0,x.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无运行记录。`:`No runs yet.`}),t[113]=M.runs,t[114]=F,t[115]=_,t[116]=d,t[117]=f):f=t[117];let p;return t[118]!==l||t[119]!==f?(p=(0,x.jsxs)(`section`,{className:`space-y-3`,children:[l,f]}),t[118]=l,t[119]=f,t[120]=p):p=t[120],(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.enabled?d?`已启用`:`Enabled`:d?`已停用`:`Disabled`,` · `,v(e.trigger,m.automations,m.cron,u)]}),i,a,o,s]}),p]})}let I=M.value,L;t[121]===I.name?L=t[122]:(L=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:I.name}),t[121]=I.name,t[122]=L);let R=I.description||I.idea,z;t[123]!==F||t[124]!==R?(z=F(R),t[123]=F,t[124]=R,t[125]=z):z=t[125];let B;t[126]!==I.name||t[127]!==M.previewUrl||t[128]!==d?(B=M.previewUrl&&(0,x.jsx)(`iframe`,{title:d?`${I.name} 交互预览`:`${I.name} interactive preview`,src:s(M.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[126]=I.name,t[127]=M.previewUrl,t[128]=d,t[129]=B):B=t[129];let V;t[130]!==I||t[131]!==d?(V=I.installationState===`installed`&&I.enabled&&I.status===`installed`&&(0,x.jsx)(n,{to:y(I),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[130]=I,t[131]=d,t[132]=V):V=t[132];let H;return t[133]!==L||t[134]!==z||t[135]!==B||t[136]!==V?(H=(0,x.jsxs)(`div`,{className:`space-y-5`,children:[L,z,B,V]}),t[133]=L,t[134]=z,t[135]=B,t[136]=V,t[137]=H):H=t[137],H}function T(e,t){return(0,x.jsx)(`li`,{children:e},t)}function E(e){return e?.trim()?(0,x.jsx)(r,{content:e,mermaidActions:!1}):null}function D(e){return e?.kind===`workflow_run`&&[`queued`,`running`].includes(e.value.run.status)||e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function O(e){return e.language}function k(e){return e.conversationId}export{w as default};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as r}from"./markdown-view-CZlvyzow.js";import{t as i}from"./messages-Ib6DaUTo.js";import{c as a,n as o,r as s}from"./locale-store-pmT2B_By.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{Ci as l,Jn as u,Kn as d,br as f,gn as p,h as m,l as h,mr as g,v as _}from"./index-DxydK_AA.js";import{i as v}from"./automation-display-DCkjVzA0.js";import{t as y}from"./open-route-MyZ2sB9C.js";var b=e(),x=t();async function S(e){switch(e.kind){case`project`:return{kind:e.kind,value:await l(e.id)};case`workflow_run`:return{kind:e.kind,value:await m(e.id,{ownerAgentId:e.ownerAgentId})};case`workflow_definition`:{let t=await _();return{kind:e.kind,value:t.find(t=>t.id===e.id||t.name===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 d(e.id),n=e.sourceHash?await u(e.id,e.sourceHash):void 0;return{kind:e.kind,value:t,previewUrl:n?.previewUrl||t.draftPreviewUrl}}}}var C={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 w(e){let t=(0,b.c)(138),{target:r}=e,l=a(k),u=o(O),d=u===`zh`,m=i(u),h;t[0]===d?h=t[1]:(h=e=>C[e]?.[+!d]||e,t[0]=d,t[1]=h);let _=h,w;t[2]!==r.href||t[3]!==l?(w=[`chat-product-preview`,r.href,l],t[2]=r.href,t[3]=l,t[4]=w):w=t[4];let A;t[5]===r?A=t[6]:(A=()=>S(r),t[5]=r,t[6]=A);let j;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(j={shouldRetryOnError:!1,refreshInterval:D},t[7]=j):j=t[7];let{data:M,error:N,isLoading:P}=c(w,A,j);if(P){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(p,{}),t[8]=e):e=t[8],e}if(N){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,x.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:e}),t[9]=e,t[10]=n),n}if(!M?.value){let e=d?`内容不存在或已删除。`:`This content is unavailable or has been deleted.`,n;return t[11]===e?n=t[12]:(n=(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e}),t[11]=e,t[12]=n),n}let F=E;if(M.kind===`project`){let e=M.value,n;t[13]===e.name?n=t[14]:(n=(0,x.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]!==_?(r=_(e.status),t[15]=e.status,t[16]=_,t[17]=r):r=t[17];let i;t[18]!==e.health||t[19]!==_?(i=_(e.health),t[18]=e.health,t[19]=_,t[20]=i):i=t[20];let a;t[21]!==r||t[22]!==i?(a=(0,x.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]!==F||t[25]!==e.description?(o=F(e.description),t[24]=F,t[25]=e.description,t[26]=o):o=t[26];let s;t[27]!==F||t[28]!==e.brief?(s=F(e.brief),t[27]=F,t[28]=e.brief,t[29]=s):s=t[29];let c;t[30]!==F||t[31]!==e.outcome?(c=F(e.outcome),t[30]=F,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,x.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,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`完成标准`:`Success criteria`}),(0,x.jsx)(`ul`,{className:`list-disc space-y-2 pl-5 text-sm text-fg`,children:e.successCriteria.map(T)})]}),t[39]=e.successCriteria,t[40]=d,t[41]=u):u=t[41];let f;t[42]!==e.milestones||t[43]!==_||t[44]!==d?(f=e.milestones?.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`里程碑`:`Milestones`}),e.milestones.slice(0,8).map(e=>(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,_(e.status)]},e.id))]}),t[42]=e.milestones,t[43]=_,t[44]=d,t[45]=f):f=t[45];let p;t[46]!==F||t[47]!==e.recentUpdates||t[48]!==d?(p=e.recentUpdates?.[0]&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`最近进展`:`Latest update`}),F(e.recentUpdates[0].summary)]}),t[46]=F,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,x.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(M.kind===`workflow_run`){let{run:e,phases:n}=M.value,r;t[55]===e.title?r=t[56]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.title}),t[55]=e.title,t[56]=r);let i;t[57]!==e.status||t[58]!==_?(i=_(e.status),t[57]=e.status,t[58]=_,t[59]=i):i=t[59];let a=e.metrics?` · ${e.metrics.doneAgentCount}/${e.metrics.agentCount} ${d?`执行单元完成`:`agents completed`}`:``,o;t[60]!==i||t[61]!==a?(o=(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[i,a]}),t[60]=i,t[61]=a,t[62]=o):o=t[62];let s;t[63]!==r||t[64]!==o?(s=(0,x.jsxs)(`div`,{className:`space-y-3`,children:[r,o]}),t[63]=r,t[64]=o,t[65]=s):s=t[65];let c;t[66]===e.error?c=t[67]:(c=e.error&&(0,x.jsx)(`p`,{role:`alert`,className:`rounded-lg border border-edge p-3 text-sm text-danger`,children:e.error.message}),t[66]=e.error,t[67]=c);let l;t[68]!==F||t[69]!==e.result||t[70]!==d?(l=g(e.result)?F(f(e.result)):(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`尚无运行结果。`:`No result yet.`}),t[68]=F,t[69]=e.result,t[70]=d,t[71]=l):l=t[71];let u;t[72]!==n||t[73]!==_||t[74]!==d?(u=n.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`运行进度`:`Progress`}),n.map(e=>(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.title,` · `,_(e.status)]},e.id))]}),t[72]=n,t[73]=_,t[74]=d,t[75]=u):u=t[75];let p;return t[76]!==c||t[77]!==l||t[78]!==u||t[79]!==s?(p=(0,x.jsxs)(`div`,{className:`space-y-6`,children:[s,c,l,u]}),t[76]=c,t[77]=l,t[78]=u,t[79]=s,t[80]=p):p=t[80],p}if(M.kind===`workflow_definition`){let e=M.value,n=e.title||e.name,r;t[81]===n?r=t[82]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:n}),t[81]=n,t[82]=r);let i;t[83]!==e.description||t[84]!==F?(i=F(e.description),t[83]=e.description,t[84]=F,t[85]=i):i=t[85];let a=e.metadata?.whenToUse,o;t[86]!==F||t[87]!==a?(o=F(a),t[86]=F,t[87]=a,t[88]=o):o=t[88];let s;t[89]!==e.phases||t[90]!==F||t[91]!==d?(s=e.phases.length>0&&(0,x.jsxs)(`section`,{className:`space-y-3`,children:[(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:d?`执行阶段`:`Phases`}),e.phases.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:e.title}),F(e.description)]},e.id))]}),t[89]=e.phases,t[90]=F,t[91]=d,t[92]=s):s=t[92];let c;return t[93]!==s||t[94]!==r||t[95]!==i||t[96]!==o?(c=(0,x.jsxs)(`div`,{className:`space-y-6`,children:[r,i,o,s]}),t[93]=s,t[94]=r,t[95]=i,t[96]=o,t[97]=c):c=t[97],c}if(M.kind===`automation`){let e=M.value,n=e.action.kind===`agent`?e.action.instruction:e.action.kind===`workflow`?e.action.goal:void 0,r;t[98]===e.name?r=t[99]:(r=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:e.name}),t[98]=e.name,t[99]=r);let i;t[100]!==e.description||t[101]!==F?(i=F(e.description),t[100]=e.description,t[101]=F,t[102]=i):i=t[102];let a;t[103]!==n||t[104]!==F?(a=F(n),t[103]=n,t[104]=F,t[105]=a):a=t[105];let o;t[106]!==e.state.nextRunAtMs||t[107]!==d?(o=e.state.nextRunAtMs&&(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[d?`下次运行`:`Next run`,` · `,new Date(e.state.nextRunAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),t[106]=e.state.nextRunAtMs,t[107]=d,t[108]=o):o=t[108];let s;t[109]===e.state.lastError?s=t[110]:(s=e.state.lastError&&(0,x.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:e.state.lastError}),t[109]=e.state.lastError,t[110]=s);let c=d?`最近运行`:`Recent runs`,l;t[111]===c?l=t[112]:(l=(0,x.jsx)(`h3`,{className:`font-medium text-fg`,children:c}),t[111]=c,t[112]=l);let f;t[113]!==M.runs||t[114]!==F||t[115]!==_||t[116]!==d?(f=M.runs.length?M.runs.map(e=>(0,x.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[_(e.status),` · `,new Date(e.createdAtMs).toLocaleString(d?`zh-CN`:`en-US`)]}),F(e.summary),e.error&&(0,x.jsx)(`p`,{className:`text-sm text-danger`,children:e.error})]},e.id)):(0,x.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d?`暂无运行记录。`:`No runs yet.`}),t[113]=M.runs,t[114]=F,t[115]=_,t[116]=d,t[117]=f):f=t[117];let p;return t[118]!==l||t[119]!==f?(p=(0,x.jsxs)(`section`,{className:`space-y-3`,children:[l,f]}),t[118]=l,t[119]=f,t[120]=p):p=t[120],(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsxs)(`div`,{className:`space-y-3`,children:[r,(0,x.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.enabled?d?`已启用`:`Enabled`:d?`已停用`:`Disabled`,` · `,v(e.trigger,m.automations,m.cron,u)]}),i,a,o,s]}),p]})}let I=M.value,L;t[121]===I.name?L=t[122]:(L=(0,x.jsx)(`h2`,{className:`break-words text-lg font-semibold text-fg`,children:I.name}),t[121]=I.name,t[122]=L);let R=I.description||I.idea,z;t[123]!==F||t[124]!==R?(z=F(R),t[123]=F,t[124]=R,t[125]=z):z=t[125];let B;t[126]!==I.name||t[127]!==M.previewUrl||t[128]!==d?(B=M.previewUrl&&(0,x.jsx)(`iframe`,{title:d?`${I.name} 交互预览`:`${I.name} interactive preview`,src:s(M.previewUrl),sandbox:`allow-scripts allow-forms`,className:`h-[min(30rem,55dvh)] w-full rounded-lg border border-edge bg-white`}),t[126]=I.name,t[127]=M.previewUrl,t[128]=d,t[129]=B):B=t[129];let V;t[130]!==I||t[131]!==d?(V=I.installationState===`installed`&&I.enabled&&I.status===`installed`&&(0,x.jsx)(n,{to:y(I),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[130]=I,t[131]=d,t[132]=V):V=t[132];let H;return t[133]!==L||t[134]!==z||t[135]!==B||t[136]!==V?(H=(0,x.jsxs)(`div`,{className:`space-y-5`,children:[L,z,B,V]}),t[133]=L,t[134]=z,t[135]=B,t[136]=V,t[137]=H):H=t[137],H}function T(e,t){return(0,x.jsx)(`li`,{children:e},t)}function E(e){return e?.trim()?(0,x.jsx)(r,{content:e,mermaidActions:!1}):null}function D(e){return e?.kind===`workflow_run`&&[`queued`,`running`].includes(e.value.run.status)||e?.kind===`automation`&&e.value?.state.runningRunId?3e3:0}function O(e){return e.language}function k(e){return e.conversationId}export{w as default};