@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
@@ -2,6 +2,7 @@ import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
3
  import { TaskRepository, init_task_repository } from "./task-repository.js";
4
4
  import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
5
+ import { resolveTaskLocale } from "./task-language.js";
5
6
  import { TaskApplicationService } from "./task-application-service.js";
6
7
  //#region src/tasks/task-run-dispatcher.ts
7
8
  init_logger();
@@ -42,27 +43,28 @@ var TaskRunDispatcher = class {
42
43
  for (const run of this.#runs.listExpiredLeasedRunning()) {
43
44
  if (this.#activeRunIds.has(run.id)) continue;
44
45
  try {
46
+ const zh = resolveTaskLocale(this.#tasks.require(run.taskId)) === "zh";
45
47
  this.#application.completeRun({
46
48
  runId: run.id,
47
49
  expectedRunVersion: run.version,
48
50
  terminalCode: "execution_interrupted",
49
- terminalMessage: "Task execution stopped before its result could be confirmed",
51
+ terminalMessage: zh ? "任务执行已停止,结果尚未确认" : "Task execution stopped before its result could be confirmed",
50
52
  receipt: {
51
53
  status: "failed",
52
- summary: "Execution interrupted; verify external effects before retrying",
54
+ summary: zh ? "执行已中断;重试前请检查外部操作的影响" : "Execution interrupted; verify external effects before retrying",
53
55
  changes: [],
54
56
  evidence: [],
55
57
  verification: {
56
58
  status: "unverified",
57
59
  checks: []
58
60
  },
59
- remainingWork: ["Verify whether the previous execution made external changes"],
61
+ remainingWork: [zh ? "检查上次执行是否已产生外部变更" : "Verify whether the previous execution made external changes"],
60
62
  needsUser: true,
61
63
  completionVerdict: "not_achieved",
62
64
  failure: {
63
65
  code: "execution_interrupted",
64
66
  phase: "execution",
65
- recoveryAction: "Inspect effects before retrying"
67
+ recoveryAction: zh ? "重试前检查执行影响" : "Inspect effects before retrying"
66
68
  }
67
69
  }
68
70
  });
@@ -136,7 +138,7 @@ var TaskRunDispatcher = class {
136
138
  terminalMessage: error instanceof Error ? error.message : String(error),
137
139
  receipt: {
138
140
  status: "failed",
139
- summary: "TaskRun dispatch failed",
141
+ summary: resolveTaskLocale(task) === "zh" ? "任务执行调度失败" : "TaskRun dispatch failed",
140
142
  changes: [],
141
143
  evidence: [],
142
144
  verification: {
@@ -149,7 +151,7 @@ var TaskRunDispatcher = class {
149
151
  failure: {
150
152
  code: "dispatch_failed",
151
153
  phase: "dispatch",
152
- recoveryAction: "Retry the task run"
154
+ recoveryAction: resolveTaskLocale(task) === "zh" ? "重试任务执行" : "Retry the task run"
153
155
  }
154
156
  }
155
157
  });
@@ -31,6 +31,7 @@ export declare function requirePlatformVoiceModel(id: string, mode: VoiceModeCap
31
31
  gender?: "female" | "male";
32
32
  style?: string;
33
33
  description?: string;
34
+ modes?: ("conversation" | "transcription" | "speech" | "transcription.stream" | "speech.stream")[];
34
35
  }[];
35
36
  limits: {
36
37
  maxFrameBytes: number;
@@ -1,4 +1,4 @@
1
- import type { VoiceSelection, VoiceSettingsCatalog } from '@xopcai/realtime-protocol/voice';
1
+ import { type VoiceSelection, type VoiceSettingsCatalog } from '@xopcai/realtime-protocol/voice';
2
2
  import { type Config } from '../config/schema.js';
3
3
  export declare function voiceSettingsCatalog(config: Config): VoiceSettingsCatalog;
4
4
  export declare function selectPlatformVoice(config: Config, selection: VoiceSelection): Config;
@@ -1,8 +1,11 @@
1
1
  import { ConfigSchema, init_schema } from "../config/schema.js";
2
+ import { voiceSupportsMode } from "../../packages/realtime-protocol/src/voice-catalog.js";
3
+ import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
2
4
  import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
3
5
  import { requirePlatformVoiceModel } from "./platform-catalog.js";
4
6
  import { createHash } from "node:crypto";
5
7
  //#region src/voice/platform-settings.ts
8
+ init_voice();
6
9
  init_schema();
7
10
  init_model_catalog_store();
8
11
  function voiceSettingsCatalog(config) {
@@ -47,8 +50,9 @@ function voiceSettingsCatalog(config) {
47
50
  function selectPlatformVoice(config, selection) {
48
51
  const model = requirePlatformVoiceModel(selection.model, selection.mode);
49
52
  const output = selection.mode === "speech" || selection.mode === "speech.stream" || selection.mode === "conversation";
50
- const voice = selection.voice ?? model.voice.defaultVoice ?? model.voice.voices[0]?.id;
51
- if (output && (!voice || !model.voice.voices.some((item) => item.id === voice))) throw new Error("Choose an available model voice");
53
+ const voices = model.voice.voices.filter((item) => voiceSupportsMode(item, selection.mode));
54
+ const voice = selection.voice ?? voices.find((item) => item.id === model.voice.defaultVoice)?.id ?? voices[0]?.id;
55
+ if (output && (!voice || !voices.some((item) => item.id === voice))) throw new Error("Choose an available model voice");
52
56
  const next = structuredClone(config);
53
57
  const selected = {
54
58
  provider: "xopc-cloud",
@@ -10,6 +10,8 @@ var PlatformVoiceError = class extends Error {
10
10
  this.name = "PlatformVoiceError";
11
11
  }
12
12
  get clientMessage() {
13
+ if (this.code === "unsupported_voice") return "The selected voice is unavailable. Refresh the voice catalog or choose another voice.";
14
+ if (this.status === 409) return "The voice model publication changed. Refresh the voice catalog and try again.";
13
15
  if (this.code === "realtime_quota_session_limit") return "The funded transcription duration has been reached. Start a new voice session to continue.";
14
16
  if (this.code === "realtime_quota_workspace_budget") return "XOPC Cloud voice workspace budget is exhausted. Increase the workspace budget or choose another voice provider.";
15
17
  if (this.status === 402 || this.code === "realtime_quota_user_credits") return "XOPC Cloud voice has insufficient Credit or quota. Check your Cloud balance and workspace budget, or choose another voice provider.";
@@ -81,7 +83,7 @@ function connect(url, token, signal, onEvent, onFailure) {
81
83
  response.once("aborted", reject);
82
84
  });
83
85
  socket.on("error", fail);
84
- socket.on("close", (code, reason) => fail(new PlatformVoiceError(`Platform voice disconnected before completion (close ${code}${reason.length ? `: ${reason.toString("utf8").slice(0, 256)}` : ""})`, void 0, "provider_disconnected")));
86
+ socket.on("close", (code, reason) => fail(new PlatformVoiceError(`Platform voice disconnected before completion (close ${code}${reason.length ? `: ${reason.toString("utf8").slice(0, 256)}` : ""})`, void 0, code === 4400 && reason.toString("utf8") === "Unsupported voice" ? "unsupported_voice" : "provider_disconnected")));
85
87
  return {
86
88
  socket,
87
89
  close,
@@ -124,6 +126,7 @@ async function openPlatformStt(request) {
124
126
  if (!ready || typeof event.item_id !== "string" || typeof event.text !== "string") throw new Error("Invalid platform transcript");
125
127
  let sentence = sentences.get(event.item_id);
126
128
  if (sentence?.final) return;
129
+ if (!sentence && !event.text.trim()) return;
127
130
  if (!sentence) {
128
131
  if (sentences.size >= 1e4) throw new Error("Transcript limit exceeded");
129
132
  sentence = {
@@ -46,6 +46,8 @@ function createAgentVoiceEngine(options) {
46
46
  const deliveredReplies = /* @__PURE__ */ new Set();
47
47
  let lastUserSpeechAt = 0;
48
48
  let openingInputSeen = false;
49
+ let preparedGreeting;
50
+ const greetingAbort = new AbortController();
49
51
  const turn = new TurnCoordinator(claim.silenceDurationMs, (text, decision, turnId) => {
50
52
  if (closed || muted) return;
51
53
  const receivedAtMs = turnReceivedAtMs ?? Date.now();
@@ -131,6 +133,11 @@ function createAgentVoiceEngine(options) {
131
133
  }
132
134
  function openSpeech(response, job) {
133
135
  if (job.opening) return job.opening;
136
+ if (response.opening && preparedGreeting?.responseId === response.id) {
137
+ job.opening = preparedGreeting.audio;
138
+ preparedGreeting = void 0;
139
+ return job.opening;
140
+ }
134
141
  if (response.firstSynthesisAtMs === void 0) {
135
142
  response.firstSynthesisAtMs = Date.now();
136
143
  log.info({
@@ -348,7 +355,7 @@ function createAgentVoiceEngine(options) {
348
355
  }
349
356
  }, Math.max(0, opening.deadlineAt - Date.now()));
350
357
  try {
351
- const speechOpening = prepareSpeechStreamSession(claim.tts.config, {
358
+ const speechOpening = opening && preparedGreeting?.responseId === response.id ? void 0 : prepareSpeechStreamSession(claim.tts.config, {
352
359
  appConfig: claim.config,
353
360
  signal: response.abortController.signal,
354
361
  allowFallback: false
@@ -710,6 +717,46 @@ function createAgentVoiceEngine(options) {
710
717
  taskUpdateQueued = false;
711
718
  });
712
719
  },
720
+ async prepareOpeningGreeting(input) {
721
+ if (!claim.tts || closed || preparedGreeting) return;
722
+ const audio = (async () => {
723
+ const result = await speakStream(input.text, claim.tts.config, {
724
+ appConfig: claim.config,
725
+ parseDirectives: false,
726
+ allowFallback: false,
727
+ signal: AbortSignal.any([
728
+ options.signal,
729
+ greetingAbort.signal,
730
+ AbortSignal.timeout(1e4)
731
+ ])
732
+ });
733
+ try {
734
+ if (result.outputFormat !== "pcm") throw new Error("Opening greeting requires PCM audio");
735
+ const chunks = [];
736
+ let bytes = 0;
737
+ for await (const chunk of result.audioStream) {
738
+ bytes += chunk.byteLength;
739
+ if (bytes > 48e4) throw new Error("Opening greeting audio exceeds ten seconds");
740
+ chunks.push(Uint8Array.from(chunk));
741
+ }
742
+ return { result: {
743
+ ...result,
744
+ release: async () => {},
745
+ audioStream: new ReadableStream({ start(controller) {
746
+ for (const chunk of chunks) controller.enqueue(chunk);
747
+ controller.close();
748
+ } })
749
+ } };
750
+ } finally {
751
+ await result.release();
752
+ }
753
+ })().catch((error) => ({ error }));
754
+ preparedGreeting = {
755
+ responseId: input.responseId,
756
+ audio
757
+ };
758
+ await audio;
759
+ },
713
760
  async offerOpeningGreeting(input) {
714
761
  if (openingInputSeen || !canOfferTaskUpdateInput() || options.runtime.sessionBusy(claim.request.conversationId)) return "skipped";
715
762
  const opening = {
@@ -719,7 +766,7 @@ function createAgentVoiceEngine(options) {
719
766
  const attempt = conversationTail.then(async () => {
720
767
  if (Date.now() >= input.deadlineAt) return "expired";
721
768
  if (openingInputSeen || !canOfferTaskUpdateInput() || options.runtime.sessionBusy(claim.request.conversationId)) return "skipped";
722
- await runAssistantTurn(input.text, input.responseId, void 0, input.deadlineAt - 2e3, Date.now(), opening);
769
+ await runAssistantTurn(input.text, input.responseId, void 0, Date.now(), Date.now(), opening);
723
770
  return opening.result;
724
771
  });
725
772
  conversationTail = attempt.then(() => {}, () => {});
@@ -802,6 +849,8 @@ function createAgentVoiceEngine(options) {
802
849
  close() {
803
850
  if (closing) return closing;
804
851
  closed = true;
852
+ greetingAbort.abort("session_closed");
853
+ preparedGreeting = void 0;
805
854
  turn.reset();
806
855
  echoCandidates.clear();
807
856
  cancelActiveResponse("session_closed");
@@ -5,6 +5,10 @@ export type VoiceEventSink = <T extends VoiceServerEvent['type']>(type: T, paylo
5
5
  }>['payload']) => void;
6
6
  export interface VoiceEngine {
7
7
  start(): Promise<void>;
8
+ prepareOpeningGreeting?(input: {
9
+ responseId: string;
10
+ text: string;
11
+ }): Promise<void>;
8
12
  offerOpeningGreeting?(input: {
9
13
  responseId: string;
10
14
  text: string;
@@ -1,4 +1,4 @@
1
- import type { VoiceProviderRoute } from '@xopcai/realtime-protocol/voice';
1
+ import { type VoiceProviderRoute } from '@xopcai/realtime-protocol/voice';
2
2
  import type { Config } from '../../config/schema.js';
3
3
  export interface OmniRoute {
4
4
  route: VoiceProviderRoute;
@@ -1,7 +1,10 @@
1
+ import { voiceSupportsMode } from "../../../packages/realtime-protocol/src/voice-catalog.js";
2
+ import { init_voice } from "../../../packages/realtime-protocol/src/voice.js";
1
3
  import { init_xopc_cloud_config, resolveXopcModelRouterUrl } from "../../providers/xopc-cloud-config.js";
2
4
  import { getProviderAuthService, init_provider_auth_service } from "../../providers/provider-auth-service.js";
3
5
  import { requirePlatformVoiceModel } from "../platform-catalog.js";
4
6
  //#region src/voice/realtime/omniRoute.ts
7
+ init_voice();
5
8
  init_provider_auth_service();
6
9
  init_xopc_cloud_config();
7
10
  async function resolveOmniRoute(config) {
@@ -13,7 +16,7 @@ async function resolveOmniRoute(config) {
13
16
  const model = requirePlatformVoiceModel(slice.model, "conversation");
14
17
  maxSessionSeconds = model.voice.limits.maxSessionSeconds;
15
18
  serviceVersion = model.voice.serviceVersion;
16
- if (!model.voice.voices.some((voice) => voice.id === slice.voice)) throw new Error("Selected voice is unavailable");
19
+ if (!model.voice.voices.some((voice) => voice.id === slice.voice && voiceSupportsMode(voice, "conversation"))) throw new Error("Selected voice is unavailable");
17
20
  }
18
21
  const managed = slice.provider === "xopc-cloud";
19
22
  const url = new URL(managed ? `${resolveXopcModelRouterUrl(slice.baseUrl)}/audio/conversations/realtime` : slice.baseUrl ?? "wss://dashscope.aliyuncs.com/api-ws/v1/realtime");
@@ -599,7 +599,7 @@ var VoiceRealtimeRuntime = class {
599
599
  sendAudio,
600
600
  onClose: shutdown
601
601
  });
602
- await engine.start();
602
+ await Promise.all([engine.start(), consumed.openingGreeting ? engine.prepareOpeningGreeting?.(consumed.openingGreeting) : void 0]);
603
603
  if (closed) return;
604
604
  const active = this.activeSessions.get(consumed.sessionId);
605
605
  if (active?.socket === socket) active.engine = engine;
@@ -761,7 +761,7 @@ var VoiceRealtimeRuntime = class {
761
761
  }, "Opening greeting claim failed");
762
762
  return;
763
763
  }
764
- const deadlineAt = Date.now() + 2e3;
764
+ const deadlineAt = Date.now() + 1e4;
765
765
  pendingGreeting = identity;
766
766
  openingTimer = setTimeout(() => {
767
767
  openingTimer = void 0;
@@ -789,7 +789,7 @@ var VoiceRealtimeRuntime = class {
789
789
  phase: "opening_greeting"
790
790
  }, "Opening greeting failed");
791
791
  });
792
- }, 300);
792
+ }, 0);
793
793
  } else if (message.type === "session.stop") shutdown(message.payload.reason, true);
794
794
  else if (message.type === "session.metric") {
795
795
  const { responseId, metric, durationMs } = message.payload;
@@ -1,3 +1,5 @@
1
+ import { voiceSupportsMode } from "../../../../packages/realtime-protocol/src/voice-catalog.js";
2
+ import { init_voice } from "../../../../packages/realtime-protocol/src/voice.js";
1
3
  import { getModelCatalogStore, init_model_catalog_store } from "../../../providers/model-catalog-store.js";
2
4
  import { init_xopc_cloud_config, resolveXopcModelRouterUrl } from "../../../providers/xopc-cloud-config.js";
3
5
  import { getProviderAuthService, init_provider_auth_service } from "../../../providers/provider-auth-service.js";
@@ -10,6 +12,7 @@ import { requirePlatformVoiceModel } from "../../platform-catalog.js";
10
12
  import { registerSpeechProvider } from "../speech-registry.js";
11
13
  //#region src/voice/tts/providers/xopc-cloud-speech.ts
12
14
  init_model_catalog_store();
15
+ init_voice();
13
16
  init_provider_auth_service();
14
17
  init_xopc_cloud_config();
15
18
  function availableModels() {
@@ -55,10 +58,10 @@ const xopcCloudSpeechProvider = {
55
58
  const config = readConfig(providerConfig);
56
59
  return Boolean(config.model && config.voice && availableModels().some((model) => model.id === config.model));
57
60
  },
58
- listVoices: async ({ providerConfig }) => {
61
+ listVoices: async ({ providerConfig, mode = "speech" }) => {
59
62
  const config = readConfig(providerConfig ?? {});
60
63
  if (!config.model) return [];
61
- return availableModels().find((model) => model.id === config.model)?.voice?.voices.map(({ id, name, displayNames }) => ({
64
+ return availableModels().find((model) => model.id === config.model)?.voice?.voices.filter((voice) => voiceSupportsMode(voice, mode)).map(({ id, name, displayNames }) => ({
62
65
  id,
63
66
  name,
64
67
  ...displayNames ? { displayNames } : {}
@@ -127,6 +130,7 @@ const xopcCloudSpeechProvider = {
127
130
  relayUrl.protocol = relayUrl.protocol === "https:" ? "wss:" : "ws:";
128
131
  relayUrl.searchParams.set("model", model);
129
132
  relayUrl.searchParams.set("service_version", String(catalogModel.voice.serviceVersion));
133
+ relayUrl.searchParams.set("voice", voice);
130
134
  const instructions = typeof request.providerOverrides?.instructions === "string" ? request.providerOverrides.instructions.trim() : config.instructions;
131
135
  return openPlatformTts({
132
136
  apiKey: token,
@@ -109,6 +109,7 @@ export interface SpeechVoiceOption {
109
109
  personalities?: string[];
110
110
  }
111
111
  export interface SpeechListVoicesRequest {
112
+ mode?: 'speech' | 'speech.stream';
112
113
  cfg?: Config;
113
114
  providerConfig?: SpeechProviderConfig;
114
115
  apiKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xopcai/xopc",
3
- "version": "0.0.378",
3
+ "version": "0.0.381",
4
4
  "description": "Local-first personal AI with Ada, task delegation, files, projects, workflows, and automations. Use cloud or local models.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -166,13 +166,13 @@
166
166
  "vitest": "4.1.5",
167
167
  "vue": "^3.5.35",
168
168
  "@xopcai/computer-control-contract": "0.1.0",
169
- "@xopcai/endpoint-tools-client": "0.0.0",
170
- "@xopcai/browser-control-contract": "0.1.0",
171
- "@xopcai/endpoint-tools-protocol": "0.0.0",
172
- "@xopcai/image-providers": "0.1.0",
173
169
  "@xopcai/gateway-contract": "0.0.0",
174
170
  "@xopcai/realtime-client": "0.0.0",
175
- "@xopcai/realtime-protocol": "0.0.0"
171
+ "@xopcai/endpoint-tools-protocol": "0.0.0",
172
+ "@xopcai/endpoint-tools-client": "0.0.0",
173
+ "@xopcai/browser-control-contract": "0.1.0",
174
+ "@xopcai/realtime-protocol": "0.0.0",
175
+ "@xopcai/image-providers": "0.1.0"
176
176
  },
177
177
  "scripts": {
178
178
  "generate:device-tools": "tsx scripts/devices/generate-mobile-tools.mts",
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,t as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./popover-select-BgSdSbCL.js";import{t as s}from"./circle-check-C23XjkUj.js";import{t as c}from"./mic-CuUb7zc-.js";import{t as l}from"./search-DA7gz22f.js";import{t as u}from"./sparkles-DHlfQFAF.js";import{t as d}from"./cn-JdwAhgNB.js";import{c as f,n as p}from"./locale-store-CeoW7A5a.js";import{n as m,r as h}from"./cloud-credits-BMYMiiNn.js";import{i as g}from"./vendor-swr-BIWyz7Rc.js";import{t as ee}from"./button-CS04eWY9.js";import{r as _}from"./gateway-config-swr-ArYo4YFd.js";import{n as v,t as y}from"./registry-api-Dzl61MkW.js";import{t as b}from"./skeleton-BwbyijEw.js";import{t as x}from"./electron-env-Dit0bHgy.js";import{$r as te,Cn as S,Es as C,Io as ne,Jo as w,Js as re,Lc as T,No as E,W as ie,Xr as D,_n as O,v as ae,vn as k,zc as A}from"./index-B3BVcMQj.js";import{t as oe}from"./number-input-DDeqHK-G.js";import{n as j,r as se}from"./settings-page-layout-X1x-2Cp9.js";import{n as M,t as N}from"./use-autosave-BtTE5X_M.js";import{s as P}from"./voice-config-api-69Yqf0QM.js";import{t as F}from"./fallback-models-pBVU4PxA.js";import{r as ce}from"./image-generation-api-B5FwRmo9.js";var le=e(t(),1),ue=n(),I=r(),L={"xopc-cloud":`XOPC Cloud`,alibaba:`Alibaba Cloud`,edge:`Microsoft Edge`,groq:`Groq`,minimax:`MiniMax`,openai:`OpenAI`};function R(e,t,n){let r=e?.[t]?.[n];return typeof r==`string`&&r.trim()?r.trim():void 0}function z(e){return L[e]??e}function B(e){let t=(0,ue.c)(17),{icon:n,label:r,enabled:i,details:a,zh:o}=e,s;t[0]===n?s=t[1]:(s=(0,I.jsx)(`div`,{className:`rounded-lg bg-accent/10 p-2 text-accent`,children:(0,I.jsx)(n,{className:`size-4`,"aria-hidden":!0})}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,I.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:r}),t[2]=r,t[3]=c);let l=i?o?`已启用`:`On`:o?`已关闭`:`Off`,u;t[4]===l?u=t[5]:(u=(0,I.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-fg-muted`,children:l}),t[4]=l,t[5]=u);let d;t[6]!==c||t[7]!==u?(d=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[c,u]}),t[6]=c,t[7]=u,t[8]=d):d=t[8];let f=i?a:o?`不处理语音`:`Voice processing is disabled`,p;t[9]===f?p=t[10]:(p=(0,I.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted`,children:f}),t[9]=f,t[10]=p);let m;t[11]!==d||t[12]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0`,children:[d,p]}),t[11]=d,t[12]=p,t[13]=m):m=t[13];let h;return t[14]!==s||t[15]!==m?(h=(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4`,children:[s,m]}),t[14]=s,t[15]=m,t[16]=h):h=t[16],h}function V(e){let t=(0,ue.c)(27),{zh:n}=e,{data:r,error:i,isLoading:o}=_(!0),s=r?.payload?.config,l,u,d;if(t[0]!==s){d=s===void 0?void 0:P(s);let e=d?R(d.stt.providers,d.stt.provider,`model`):void 0,n=d?R(d.tts.providers,d.tts.provider,`model`):void 0,r=d?R(d.tts.providers,d.tts.provider,`voice`):void 0;l=d?[z(d.stt.provider),e].filter(Boolean).join(` · `):void 0,u=d?[z(d.tts.provider),n,r].filter(Boolean).join(` · `):void 0,t[0]=s,t[1]=l,t[2]=u,t[3]=d}else l=t[1],u=t[2],d=t[3];let f=u,p=n?`语音能力`:`Voice capabilities`,m;t[4]===p?m=t[5]:(m=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:p}),t[4]=p,t[5]=m);let h=n?`语音识别和朗读由所有智能体共用,在语音设置中统一管理。`:`STT and TTS are shared by every agent and managed in global voice settings.`,g;t[6]===h?g=t[7]:(g=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:h}),t[6]=h,t[7]=g);let v;t[8]!==m||t[9]!==g?(v=(0,I.jsxs)(`div`,{children:[m,g]}),t[8]=m,t[9]=g,t[10]=v):v=t[10];let y=n?`管理语音设置`:`Manage voice settings`,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,I.jsx)(A,{className:`size-4`,"aria-hidden":!0}),t[11]=x):x=t[11];let te;t[12]===y?te=t[13]:(te=(0,I.jsx)(ee,{asChild:!0,variant:`secondary`,className:`shrink-0`,children:(0,I.jsxs)(a,{to:`/settings/capabilities/voice`,children:[y,x]})}),t[12]=y,t[13]=te);let S;t[14]!==v||t[15]!==te?(S=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[v,te]}),t[14]=v,t[15]=te,t[16]=S):S=t[16];let C;t[17]!==i||t[18]!==o||t[19]!==l||t[20]!==f||t[21]!==d||t[22]!==n?(C=o||!d?i?(0,I.jsx)(`p`,{className:`mt-4 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:n?`暂时无法读取语音配置。`:`Voice settings could not be loaded.`}):(0,I.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsx)(b,{className:`h-20 rounded-xl`}),(0,I.jsx)(b,{className:`h-20 rounded-xl`})]}):(0,I.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsx)(B,{icon:c,label:n?`语音转文字(STT)`:`Speech to text (STT)`,enabled:d.stt.enabled,details:l,zh:n}),(0,I.jsx)(B,{icon:T,label:n?`文字转语音(TTS)`:`Text to speech (TTS)`,enabled:d.tts.enabled,details:f,zh:n})]}),t[17]=i,t[18]=o,t[19]=l,t[20]=f,t[21]=d,t[22]=n,t[23]=C):C=t[23];let ne;return t[24]!==S||t[25]!==C?(ne=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[S,C]}),t[24]=S,t[25]=C,t[26]=ne):ne=t[26],ne}var H=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],U=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`,W={en:{fast:[`Fast tasks`,`Short, low-latency work`],reasoning:[`Complex reasoning`,`Planning and multi-step analysis`],coding:[`Coding`,`Implementation and debugging`],review:[`Review`,`Critique and verification`],vision:[`Vision`,`Image and visual analysis`],understanding:[`Understanding`,`Long-form content comprehension`]},zh:{fast:[`快速任务`,`简短、低延迟的工作`],reasoning:[`复杂推理`,`规划和多步骤分析`],coding:[`编程`,`实现、调试和代码修改`],review:[`审查`,`检查、批评和验证`],vision:[`视觉任务`,`图片和视觉内容分析`],understanding:[`内容理解`,`长内容阅读和理解`]}};function G(e,t){return{primary:t,fallbacks:e?.fallbacks??[]}}function de(e){let t=(0,ue.c)(132),{draft:n,setDraft:r,zh:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},t[0]=a):a=t[0];let o=g(y,v,a),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s={revalidateOnFocus:!1},t[1]=s):s=t[1];let c=g(`agent-defaults-image-models`,ce,s),l;t[2]===o.data?l=t[3]:(l=o.data??[],t[2]=o.data,t[3]=l);let u=l,d;t[4]===c.data?d=t[5]:(d=c.data??[],t[4]=c.data,t[5]=d);let f;t[6]===d?f=t[7]:(f=d.flatMap(K),t[6]=d,t[7]=f);let p=f,m=i?W.zh:W.en,h;t[8]!==n||t[9]!==r?(h=(e,t)=>{let i={...n.models.intents};t?i[e]=G(i[e],t):delete i[e],r({...n,models:{...n.models,intents:i}})},t[8]=n,t[9]=r,t[10]=h):h=t[10];let _=h,b=i?`默认对话模型`:`Default conversation model`,x;t[11]===b?x=t[12]:(x=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:b}),t[11]=b,t[12]=x);let te=i?`大多数对话和没有专用路由的任务都会使用它。`:`Used for most conversations and every task without a dedicated route.`,S;t[13]===te?S=t[14]:(S=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:te}),t[13]=te,t[14]=S);let C;t[15]!==S||t[16]!==x?(C=(0,I.jsxs)(`div`,{children:[x,S]}),t[15]=S,t[16]=x,t[17]=C):C=t[17];let ne=i?`主模型`:`Primary model`,w;t[18]===ne?w=t[19]:(w=(0,I.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:ne}),t[18]=ne,t[19]=w);let re=i?`选择模型`:`Select a model`,T=i?`搜索模型或服务商`:`Search models or providers`,E=i?`没有匹配的模型`:`No matching models`,O=i?`默认对话模型`:`Default conversation model`,ae;t[20]!==n||t[21]!==r?(ae=e=>r({...n,models:{...n.models,chat:{...n.models.chat,primary:e}}}),t[20]=n,t[21]=r,t[22]=ae):ae=t[22];let k;t[23]!==n.models.chat.primary||t[24]!==re||t[25]!==T||t[26]!==E||t[27]!==O||t[28]!==ae?(k=(0,I.jsx)(D,{value:n.models.chat.primary,placeholder:re,searchPlaceholder:T,noMatches:E,showProviderSettingsFooter:!0,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:O,onChange:ae}),t[23]=n.models.chat.primary,t[24]=re,t[25]=T,t[26]=E,t[27]=O,t[28]=ae,t[29]=k):k=t[29];let A;t[30]!==w||t[31]!==k?(A=(0,I.jsxs)(`div`,{className:`mt-5 max-w-xl`,children:[w,k]}),t[30]=w,t[31]=k,t[32]=A):A=t[32];let j=i?`模型回退`:`Model fallbacks`,se=i?`已配置 ${n.models.chat.fallbacks.length} 个备用模型;主模型选择仍在上方。`:`${n.models.chat.fallbacks.length} fallback models configured.`,M;t[33]!==n||t[34]!==r?(M=e=>r({...n,models:{...n.models,chat:{...n.models.chat,fallbacks:e}}}),t[33]=n,t[34]=r,t[35]=M):M=t[35];let N;t[36]!==n.models.chat.fallbacks||t[37]!==n.models.chat.primary||t[38]!==u||t[39]!==o.error||t[40]!==o.isLoading||t[41]!==M||t[42]!==i?(N=(0,I.jsx)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:(0,I.jsx)(F,{primary:n.models.chat.primary,value:n.models.chat.fallbacks,models:u,loading:o.isLoading,error:o.error,zh:i,onChange:M})}),t[36]=n.models.chat.fallbacks,t[37]=n.models.chat.primary,t[38]=u,t[39]=o.error,t[40]=o.isLoading,t[41]=M,t[42]=i,t[43]=N):N=t[43];let P;t[44]!==j||t[45]!==se||t[46]!==N?(P=(0,I.jsx)(ie,{title:j,summary:se,children:N}),t[44]=j,t[45]=se,t[46]=N,t[47]=P):P=t[47];let le;t[48]!==C||t[49]!==A||t[50]!==P?(le=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[C,A,P]}),t[48]=C,t[49]=A,t[50]=P,t[51]=le):le=t[51];let L=i?`图片能力`:`Image capabilities`,R;t[52]===L?R=t[53]:(R=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:L}),t[52]=L,t[53]=R);let z=i?`没有图片任务时可以保持关闭。`:`Leave these off when the agents do not work with images.`,B;t[54]===z?B=t[55]:(B=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:z}),t[54]=z,t[55]=B);let de=i?`图片理解模型`:`Image understanding model`,q;t[56]===de?q=t[57]:(q=(0,I.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:de}),t[56]=de,t[57]=q);let J=n.models.imageUnderstanding?.primary??``,Y=i?`关闭图片理解`:`Image understanding off`,X=i?`搜索视觉模型`:`Search vision models`,fe=i?`没有可用的视觉模型`:`No vision models available`,Z=i?`关闭图片理解`:`Image understanding off`,pe=i?`图片理解模型`:`Image understanding model`,Q;t[58]!==n||t[59]!==r?(Q=e=>{let t={...n.models};e?t.imageUnderstanding=G(t.imageUnderstanding,e):delete t.imageUnderstanding,r({...n,models:t})},t[58]=n,t[59]=r,t[60]=Q):Q=t[60];let me;t[61]!==J||t[62]!==Y||t[63]!==X||t[64]!==fe||t[65]!==Z||t[66]!==pe||t[67]!==Q?(me=(0,I.jsx)(D,{value:J,placeholder:Y,searchPlaceholder:X,noMatches:fe,capabilitiesFilter:`vision`,allowEmpty:!0,emptyLabel:Z,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:pe,onChange:Q}),t[61]=J,t[62]=Y,t[63]=X,t[64]=fe,t[65]=Z,t[66]=pe,t[67]=Q,t[68]=me):me=t[68];let he;t[69]!==q||t[70]!==me?(he=(0,I.jsxs)(`div`,{children:[q,me]}),t[69]=q,t[70]=me,t[71]=he):he=t[71];let ge=i?`图片生成模型`:`Image generation model`,_e;t[72]===ge?_e=t[73]:(_e=(0,I.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:ge}),t[72]=ge,t[73]=_e);let ve=n.models.imageGeneration?.primary??``,ye=i?`关闭图片生成`:`Image generation off`,be=i?`搜索图片模型或服务商`:`Search image models or providers`,xe=i?`没有可用的图片生成模型`:`No image generation models available`,Se=i?`关闭图片生成`:`Image generation off`,Ce=i?`图片生成模型`:`Image generation model`,we;t[74]!==n||t[75]!==r?(we=e=>{let t={...n.models};e?t.imageGeneration={primary:e,fallbacks:t.imageGeneration?.fallbacks??[],timeoutMs:t.imageGeneration?.timeoutMs,autoProviderFallback:t.imageGeneration?.autoProviderFallback??!0}:delete t.imageGeneration,r({...n,models:t})},t[74]=n,t[75]=r,t[76]=we):we=t[76];let Te;t[77]!==p||t[78]!==c.error||t[79]!==c.isLoading||t[80]!==ve||t[81]!==ye||t[82]!==be||t[83]!==xe||t[84]!==Se||t[85]!==Ce||t[86]!==we?(Te=(0,I.jsx)(D,{value:ve,models:p,modelsLoading:c.isLoading,modelsError:c.error,placeholder:ye,searchPlaceholder:be,noMatches:xe,allowEmpty:!0,emptyLabel:Se,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:Ce,onChange:we}),t[77]=p,t[78]=c.error,t[79]=c.isLoading,t[80]=ve,t[81]=ye,t[82]=be,t[83]=xe,t[84]=Se,t[85]=Ce,t[86]=we,t[87]=Te):Te=t[87];let Ee;t[88]!==_e||t[89]!==Te?(Ee=(0,I.jsxs)(`div`,{children:[_e,Te]}),t[88]=_e,t[89]=Te,t[90]=Ee):Ee=t[90];let De;t[91]!==he||t[92]!==Ee?(De=(0,I.jsxs)(`div`,{className:`mt-5 grid gap-5 lg:grid-cols-2`,children:[he,Ee]}),t[91]=he,t[92]=Ee,t[93]=De):De=t[93];let $;t[94]!==n||t[95]!==r||t[96]!==i?($=n.models.imageGeneration?(0,I.jsx)(ie,{title:i?`图片执行策略`:`Image execution policy`,summary:i?`当前超时与回退策略继续生效。`:`The current timeout and fallback policy remains active.`,children:(0,I.jsxs)(`div`,{className:`mt-5 grid gap-4 rounded-xl bg-surface-base/45 p-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[i?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,className:`${U} mt-2`,value:n.models.imageGeneration.timeoutMs??``,onChange:e=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,timeoutMs:e.target.value?Number(e.target.value):void 0}}})})]}),(0,I.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,I.jsx)(`span`,{children:i?`服务商自动回退`:`Automatic provider fallback`}),(0,I.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:[!0,!1].map(e=>(0,I.jsx)(ee,{variant:n.models.imageGeneration?.autoProviderFallback===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,models:{...n.models,imageGeneration:{...n.models.imageGeneration,autoProviderFallback:e}}}),children:e?i?`开启`:`On`:i?`关闭`:`Off`},String(e)))})]})]})}):null,t[94]=n,t[95]=r,t[96]=i,t[97]=$):$=t[97];let Oe;t[98]!==R||t[99]!==B||t[100]!==De||t[101]!==$?(Oe=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[R,B,De,$]}),t[98]=R,t[99]=B,t[100]=De,t[101]=$,t[102]=Oe):Oe=t[102];let ke;t[103]===i?ke=t[104]:(ke=(0,I.jsx)(V,{zh:i}),t[103]=i,t[104]=ke);let Ae=i?`任务模型路由`:`Task model routing`,je;t[105]!==n.models.intents||t[106]!==i?(je=i?`已配置 ${Object.keys(n.models.intents).length} 类任务路由;其他任务使用默认模型。`:`${Object.keys(n.models.intents).length} task routes configured; other tasks use the default model.`,t[105]=n.models.intents,t[106]=i,t[107]=je):je=t[107];let Me=i?`按任务选择模型`:`Route by task`,Ne;t[108]===Me?Ne=t[109]:(Ne=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:Me}),t[108]=Me,t[109]=Ne);let Pe=i?`仅在确实需要不同模型时设置;否则保持“使用默认对话模型”。`:`Set a route only when a task genuinely needs another model; otherwise keep the default.`,Fe;t[110]===Pe?Fe=t[111]:(Fe=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Pe}),t[110]=Pe,t[111]=Fe);let Ie;t[112]!==m||t[113]!==n.models.intents||t[114]!==_||t[115]!==i?(Ie=H.map(e=>(0,I.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,I.jsxs)(`div`,{className:`mb-3`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:m[e][0]}),(0,I.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:m[e][1]})]}),(0,I.jsx)(D,{value:n.models.intents[e]?.primary??``,placeholder:i?`使用默认对话模型`:`Use default conversation model`,searchPlaceholder:i?`搜索模型或服务商`:`Search models or providers`,noMatches:i?`没有匹配的模型`:`No matching models`,allowEmpty:!0,emptyLabel:i?`使用默认对话模型`:`Use default conversation model`,showProviderInTrigger:!1,contentAlign:`start`,className:`w-full`,ariaLabel:i?`${m[e][0]}模型`:`${m[e][0]} model`,onChange:t=>_(e,t)})]},e)),t[112]=m,t[113]=n.models.intents,t[114]=_,t[115]=i,t[116]=Ie):Ie=t[116];let Le;t[117]===Ie?Le=t[118]:(Le=(0,I.jsx)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-2`,children:Ie}),t[117]=Ie,t[118]=Le);let Re;t[119]!==Ne||t[120]!==Fe||t[121]!==Le?(Re=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Ne,Fe,Le]}),t[119]=Ne,t[120]=Fe,t[121]=Le,t[122]=Re):Re=t[122];let ze;t[123]!==Ae||t[124]!==je||t[125]!==Re?(ze=(0,I.jsx)(ie,{title:Ae,summary:je,children:Re}),t[123]=Ae,t[124]=je,t[125]=Re,t[126]=ze):ze=t[126];let Be;return t[127]!==le||t[128]!==Oe||t[129]!==ke||t[130]!==ze?(Be=(0,I.jsxs)(`div`,{className:`space-y-5`,children:[le,Oe,ke,ze]}),t[127]=le,t[128]=Oe,t[129]=ke,t[130]=ze,t[131]=Be):Be=t[131],Be}function K(e){return e.models.map(t=>({id:`${e.id}/${t}`,name:t,provider:e.label}))}var q=`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function J(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function Y({draft:e,setDraft:t,zh:n}){let[r,i]=(0,le.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?m(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,le.useState)(!1);return(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,I.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${q} mt-2`,onChange:n=>{let r=n.target.value;i(r);try{let n=r===``?void 0:h(r);if(n===`0`||n&&n.length>15)throw Error(`Invalid limit`);o(!1),t({...e,runtime:{...e.runtime,cloudCreditLimitPerRunMicro:n}})}catch{o(!0)}},onBlur:()=>{a&&i(e.runtime.cloudCreditLimitPerRunMicro?m(e.runtime.cloudCreditLimitPerRunMicro):``),o(!1)}}),(0,I.jsx)(`span`,{className:`mt-2 block font-normal ${a?`text-danger`:`text-fg-subtle`}`,children:a?n?`请输入大于零、最多四位小数的 Credits。无效输入不会保存。`:`Enter positive Credits with up to four decimals. Invalid input is not saved.`:n?`模型、图片和文件语音调用共享上限;不支持实时语音或 Cloud 电脑控制,不包含运行前后的后台调用。达到上限后停止,调整后需手动继续。`:`Shared by model, image and file audio calls during a run. Does not support realtime voice or Cloud computer use; excludes background calls outside the run. Stops at the limit; continue manually after adjusting it.`})]})}function X(e){let t=(0,ue.c)(186),{draft:n,setDraft:r,zh:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},t[0]=a):a=t[0];let s=g(`agent-defaults-workflows`,ae,a),c;t[1]===s.data?c=t[2]:(c=s.data??[],t[1]=s.data,t[2]=c);let l;t[3]===c?l=t[4]:(l=c.map(fe),t[3]=c,t[4]=l);let u=l,f=n.workflows.allowed===void 0,p;t[5]!==n||t[6]!==r?(p=(e,t)=>{let i=n.workflows.allowed??[],a=t?[...new Set([...i,e])]:i.filter(t=>t!==e);r({...n,workflows:{...n.workflows,allowed:a}})},t[5]=n,t[6]=r,t[7]=p):p=t[7];let m=p,h=i?`费用控制`:`Spending control`,_;t[8]===h?_=t[9]:(_=(0,I.jsx)(`h2`,{className:`mb-4 text-base font-semibold text-fg`,children:h}),t[8]=h,t[9]=_);let v;t[10]!==n||t[11]!==r||t[12]!==i?(v=(0,I.jsx)(Y,{draft:n,setDraft:r,zh:i}),t[10]=n,t[11]=r,t[12]=i,t[13]=v):v=t[13];let y;t[14]!==_||t[15]!==v?(y=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[_,v]}),t[14]=_,t[15]=v,t[16]=y):y=t[16];let b=i?`执行与缓存策略`:`Execution and cache policy`,x=i?`轮数:${n.runtime.maxTurns??`默认`} · 超时:${n.runtime.timeoutMs??`默认`} · 缓存:${n.runtime.promptCache?.mode??`默认`} · Codemode:${n.runtime.codemode?.enabled?`开启`:`关闭`}`:`Turns: ${n.runtime.maxTurns??`default`} · Timeout: ${n.runtime.timeoutMs??`default`} · Cache: ${n.runtime.promptCache?.mode??`default`} · Codemode: ${n.runtime.codemode?.enabled?`on`:`off`}`,te=n.runtime.codemode?.enabled??!1,S;t[17]!==n||t[18]!==r?(S=e=>r({...n,runtime:{...n.runtime,codemode:{...n.runtime.codemode,enabled:e.target.checked}}}),t[17]=n,t[18]=r,t[19]=S):S=t[19];let C;t[20]!==te||t[21]!==S?(C=(0,I.jsx)(`input`,{type:`checkbox`,checked:te,onChange:S,className:`mt-1 size-4 accent-[var(--color-accent)]`}),t[20]=te,t[21]=S,t[22]=C):C=t[22];let ne=i?`Codemode 读取试点`:`Codemode read pilot`,w;t[23]===ne?w=t[24]:(w=(0,I.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:ne}),t[23]=ne,t[24]=w);let re=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,T;t[25]===re?T=t[26]:(T=(0,I.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:re}),t[25]=re,t[26]=T);let E;t[27]!==w||t[28]!==T?(E=(0,I.jsxs)(`span`,{children:[w,T]}),t[27]=w,t[28]=T,t[29]=E):E=t[29];let D;t[30]!==C||t[31]!==E?(D=(0,I.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[C,E]})}),t[30]=C,t[31]=E,t[32]=D):D=t[32];let O=i?`执行限制`:`Execution limits`,k;t[33]===O?k=t[34]:(k=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:O}),t[33]=O,t[34]=k);let A=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,j;t[35]===A?j=t[36]:(j=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:A}),t[35]=A,t[36]=j);let se=i?`每次运行最多轮数`:`Maximum turns per run`,M=n.runtime.maxTurns??``,N=i?`系统默认`:`System default`,P;t[37]!==n||t[38]!==r?(P=e=>r({...n,runtime:{...n.runtime,maxTurns:J(e.target.value)}}),t[37]=n,t[38]=r,t[39]=P):P=t[39];let F;t[40]!==M||t[41]!==N||t[42]!==P?(F=(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,value:M,placeholder:N,onChange:P,className:`${q} mt-2`}),t[40]=M,t[41]=N,t[42]=P,t[43]=F):F=t[43];let ce;t[44]!==se||t[45]!==F?(ce=(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[se,F]}),t[44]=se,t[45]=F,t[46]=ce):ce=t[46];let le=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,L=n.runtime.timeoutMs??``,R=i?`系统默认`:`System default`,z;t[47]!==n||t[48]!==r?(z=e=>r({...n,runtime:{...n.runtime,timeoutMs:J(e.target.value)}}),t[47]=n,t[48]=r,t[49]=z):z=t[49];let B;t[50]!==L||t[51]!==R||t[52]!==z?(B=(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,value:L,placeholder:R,onChange:z,className:`${q} mt-2`}),t[50]=L,t[51]=R,t[52]=z,t[53]=B):B=t[53];let V;t[54]!==le||t[55]!==B?(V=(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[le,B]}),t[54]=le,t[55]=B,t[56]=V):V=t[56];let H=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,U=n.runtime.maxToolFailuresPerTurn??``,W=i?`系统默认`:`System default`,G;t[57]!==n||t[58]!==r?(G=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:J(e.target.value)}}),t[57]=n,t[58]=r,t[59]=G):G=t[59];let de;t[60]!==U||t[61]!==W||t[62]!==G?(de=(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,value:U,placeholder:W,onChange:G,className:`${q} mt-2`}),t[60]=U,t[61]=W,t[62]=G,t[63]=de):de=t[63];let K;t[64]!==H||t[65]!==de?(K=(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[H,de]}),t[64]=H,t[65]=de,t[66]=K):K=t[66];let X;t[67]!==ce||t[68]!==V||t[69]!==K?(X=(0,I.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[ce,V,K]}),t[67]=ce,t[68]=V,t[69]=K,t[70]=X):X=t[70];let Z;t[71]!==k||t[72]!==j||t[73]!==X?(Z=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[k,j,X]}),t[71]=k,t[72]=j,t[73]=X,t[74]=Z):Z=t[74];let pe=i?`提示词缓存`:`Prompt cache`,Q;t[75]===pe?Q=t[76]:(Q=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:pe}),t[75]=pe,t[76]=Q);let me=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,he;t[77]===me?he=t[78]:(he=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:me}),t[77]=me,t[78]=he);let ge=i?`缓存模式`:`Cache mode`,_e;t[79]===ge?_e=t[80]:(_e=(0,I.jsx)(`span`,{children:ge}),t[79]=ge,t[80]=_e);let ve;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ve=[`auto`,`off`],t[81]=ve):ve=t[81];let ye;t[82]!==n||t[83]!==r||t[84]!==i?(ye=(0,I.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:ve.map(e=>(0,I.jsx)(ee,{variant:n.runtime.promptCache?.mode===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:e,lifetime:n.runtime.promptCache?.lifetime??`short`}}}),children:e===`auto`?i?`自动`:`Automatic`:i?`关闭`:`Off`},e))}),t[82]=n,t[83]=r,t[84]=i,t[85]=ye):ye=t[85];let be;t[86]!==_e||t[87]!==ye?(be=(0,I.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[_e,ye]}),t[86]=_e,t[87]=ye,t[88]=be):be=t[88];let xe;t[89]!==n||t[90]!==r||t[91]!==i?(xe=n.runtime.promptCache?.mode===`auto`?(0,I.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,I.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,I.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:[`short`,`long`].map(e=>(0,I.jsx)(ee,{variant:n.runtime.promptCache?.lifetime===e?`secondary`:`ghost`,className:`flex-1 py-1.5 text-xs`,onClick:()=>r({...n,runtime:{...n.runtime,promptCache:{mode:`auto`,lifetime:e}}}),children:e===`short`?i?`短期`:`Short`:i?`长期`:`Long`},e))})]}):null,t[89]=n,t[90]=r,t[91]=i,t[92]=xe):xe=t[92];let Se;t[93]!==be||t[94]!==xe?(Se=(0,I.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[be,xe]}),t[93]=be,t[94]=xe,t[95]=Se):Se=t[95];let Ce;t[96]!==Q||t[97]!==he||t[98]!==Se?(Ce=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Q,he,Se]}),t[96]=Q,t[97]=he,t[98]=Se,t[99]=Ce):Ce=t[99];let we;t[100]!==x||t[101]!==D||t[102]!==Z||t[103]!==Ce||t[104]!==b?(we=(0,I.jsxs)(ie,{title:b,summary:x,children:[D,Z,Ce]}),t[100]=x,t[101]=D,t[102]=Z,t[103]=Ce,t[104]=b,t[105]=we):we=t[105];let Te=i?`工作流`:`Workflows`,Ee;t[106]===Te?Ee=t[107]:(Ee=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:Te}),t[106]=Te,t[107]=Ee);let De=i?`设置默认工作流,并决定智能体可以调用哪些工作流。`:`Set a default workflow and control which workflows agents may invoke.`,$;t[108]===De?$=t[109]:($=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:De}),t[108]=De,t[109]=$);let Oe=i?`默认工作流`:`Default workflow`,ke=n.workflows.default||(i?`未自动绑定工作流`:`No workflow bound automatically`),Ae=i?`默认工作流`:`Default workflow`,je;t[110]===Ae?je=t[111]:(je=(0,I.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:Ae}),t[110]=Ae,t[111]=je);let Me=n.workflows.default??``,Ne=s.isLoading?i?`正在加载…`:`Loading…`:i?`不设置默认工作流`:`No default workflow`,Pe=i?`不设置默认工作流`:`No default workflow`,Fe=i?`默认工作流`:`Default workflow`,Ie;t[112]!==n||t[113]!==r?(Ie=e=>r({...n,workflows:{...n.workflows,default:e||void 0}}),t[112]=n,t[113]=r,t[114]=Ie):Ie=t[114];let Le;t[115]!==Me||t[116]!==Ne||t[117]!==Pe||t[118]!==Fe||t[119]!==Ie||t[120]!==u||t[121]!==s.isLoading?(Le=(0,I.jsx)(o,{value:Me,options:u,placeholder:Ne,emptyLabel:Pe,disabled:s.isLoading,ariaLabel:Fe,onChange:Ie,triggerClassName:`mt-2`}),t[115]=Me,t[116]=Ne,t[117]=Pe,t[118]=Fe,t[119]=Ie,t[120]=u,t[121]=s.isLoading,t[122]=Le):Le=t[122];let Re;t[123]!==je||t[124]!==Le?(Re=(0,I.jsxs)(`div`,{className:`mt-5 max-w-xl`,children:[je,Le]}),t[123]=je,t[124]=Le,t[125]=Re):Re=t[125];let ze;t[126]!==Oe||t[127]!==ke||t[128]!==Re?(ze=(0,I.jsx)(ie,{title:Oe,summary:ke,children:Re}),t[126]=Oe,t[127]=ke,t[128]=Re,t[129]=ze):ze=t[129];let Be;t[130]===s.error?Be=t[131]:(Be=s.error?(0,I.jsx)(`p`,{className:`mt-3 text-sm text-red-600`,children:s.error instanceof Error?s.error.message:String(s.error)}):null,t[130]=s.error,t[131]=Be);let Ve=i?`允许调用的工作流`:`Allowed workflows`,He;t[132]===Ve?He=t[133]:(He=(0,I.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:Ve}),t[132]=Ve,t[133]=He);let Ue;t[134]!==n||t[135]!==r?(Ue=()=>r({...n,workflows:{...n.workflows,allowed:void 0}}),t[134]=n,t[135]=r,t[136]=Ue):Ue=t[136];let We=f?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,Ge;t[137]===We?Ge=t[138]:(Ge=d(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,We),t[137]=We,t[138]=Ge);let Ke=i?`允许全部工作流`:`Allow every workflow`,qe;t[139]===Ke?qe=t[140]:(qe=(0,I.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Ke}),t[139]=Ke,t[140]=qe);let Je=i?`新增工作流也会自动可用。`:`New workflows become available automatically.`,Ye;t[141]===Je?Ye=t[142]:(Ye=(0,I.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:Je}),t[141]=Je,t[142]=Ye);let Xe;t[143]!==Ue||t[144]!==Ge||t[145]!==qe||t[146]!==Ye?(Xe=(0,I.jsxs)(`button`,{type:`button`,onClick:Ue,className:Ge,children:[qe,Ye]}),t[143]=Ue,t[144]=Ge,t[145]=qe,t[146]=Ye,t[147]=Xe):Xe=t[147];let Ze;t[148]!==n||t[149]!==r?(Ze=()=>r({...n,workflows:{...n.workflows,allowed:[]}}),t[148]=n,t[149]=r,t[150]=Ze):Ze=t[150];let Qe=f?`hover:bg-surface-hover`:`bg-accent-soft shadow-surface`,$e;t[151]===Qe?$e=t[152]:($e=d(`rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,Qe),t[151]=Qe,t[152]=$e);let et=i?`只允许选中的工作流`:`Allow selected workflows only`,tt;t[153]===et?tt=t[154]:(tt=(0,I.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:et}),t[153]=et,t[154]=tt);let nt=i?`未选中的工作流不能被调用。`:`Unselected workflows cannot be invoked.`,rt;t[155]===nt?rt=t[156]:(rt=(0,I.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:nt}),t[155]=nt,t[156]=rt);let it;t[157]!==Ze||t[158]!==$e||t[159]!==tt||t[160]!==rt?(it=(0,I.jsxs)(`button`,{type:`button`,onClick:Ze,className:$e,children:[tt,rt]}),t[157]=Ze,t[158]=$e,t[159]=tt,t[160]=rt,t[161]=it):it=t[161];let at;t[162]!==Xe||t[163]!==it?(at=(0,I.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[Xe,it]}),t[162]=Xe,t[163]=it,t[164]=at):at=t[164];let ot;t[165]!==f||t[166]!==n.workflows.allowed||t[167]!==m||t[168]!==s.data||t[169]!==s.isLoading||t[170]!==i?(ot=f?null:(0,I.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1 rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[(s.data??[]).map(e=>(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:n.workflows.allowed?.includes(e.id)??!1,onChange:t=>m(e.id,t.target.checked),className:`mt-0.5 size-4 accent-[var(--color-accent)]`}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title||e.name}),e.description?(0,I.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description}):null]})]},e.id)),(s.data??[]).length===0&&!s.isLoading?(0,I.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`还没有工作流。`:`No workflows yet.`}):null]}),t[165]=f,t[166]=n.workflows.allowed,t[167]=m,t[168]=s.data,t[169]=s.isLoading,t[170]=i,t[171]=ot):ot=t[171];let st;t[172]!==He||t[173]!==at||t[174]!==ot?(st=(0,I.jsxs)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:[He,at,ot]}),t[172]=He,t[173]=at,t[174]=ot,t[175]=st):st=t[175];let ct;t[176]!==Ee||t[177]!==$||t[178]!==ze||t[179]!==Be||t[180]!==st?(ct=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Ee,$,ze,Be,st]}),t[176]=Ee,t[177]=$,t[178]=ze,t[179]=Be,t[180]=st,t[181]=ct):ct=t[181];let lt;return t[182]!==we||t[183]!==y||t[184]!==ct?(lt=(0,I.jsxs)(`div`,{className:`space-y-5`,children:[y,we,ct]}),t[182]=we,t[183]=y,t[184]=ct,t[185]=lt):lt=t[185],lt}function fe(e){return{value:e.id,label:e.title||e.name}}function Z(e){return[...new Set(e)].sort()}var pe=[{id:`core`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`],en:`Core`,zh:`核心`},{id:`office`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`docx`,`pdf`,`pptx`,`xlsx`],en:`Office`,zh:`办公成果`},{id:`local-app`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`build-xopc-local-app`,`frontend-design`,`theme-factory`],en:`Local App`,zh:`本地应用`},{id:`developer`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`diagnose`,`github`,`tdd`,`webapp-testing`],en:`Developer`,zh:`开发者`},{id:`desktop-pet`,names:[`doc-coauthoring`,`define-task`,`find-skills`,`summarize`,`hatch-pet`],en:`Desktop Pet`,zh:`桌面宠物`}];function Q(e){let t=(0,ue.c)(115),{draft:n,setDraft:r,zh:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},t[0]=a):a=t[0];let{data:o,error:c,isLoading:u}=g(`agent-defaults-skills-catalog`,te,a),[f,p]=(0,le.useState)(``),m=n.skills.mode===`selected`?n.skills.include:n.skills.exclude;o?.catalog;let h;if(t[1]!==m||t[2]!==o?.catalog||t[3]!==f){let e=[...o?.catalog??[]],n=new Set(e.map(ve));for(let t of m)n.has(t)||e.push({name:t,description:``,enabled:!0});let r=f.trim().toLowerCase();h=e.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r)).sort(_e),t[1]=m,t[2]=o?.catalog,t[3]=f,t[4]=h}else h=t[4];let ee=h,_;t[5]!==n.skills.exclude||t[6]!==n.skills.include||t[7]!==n.skills.mode?(_=e=>n.skills.mode===`selected`?n.skills.include.includes(e):!n.skills.exclude.includes(e),t[5]=n.skills.exclude,t[6]=n.skills.include,t[7]=n.skills.mode,t[8]=_):_=t[8];let v=_,y;t[9]!==n||t[10]!==r?(y=e=>{if(n.skills.mode===`selected`){let t=n.skills.include.includes(e)?n.skills.include.filter(t=>t!==e):Z([...n.skills.include,e]);r({...n,skills:{mode:`selected`,include:t}});return}let t=n.skills.exclude.includes(e)?n.skills.exclude.filter(t=>t!==e):Z([...n.skills.exclude,e]);r({...n,skills:{mode:`all-enabled`,exclude:t}})},t[9]=n,t[10]=r,t[11]=y):y=t[11];let b=y,x;t[12]===o?.catalog?x=t[13]:(x=o?.catalog??[],t[12]=o?.catalog,t[13]=x);let S;if(t[14]!==v||t[15]!==x){let e;t[17]===v?e=t[18]:(e=e=>e.enabled&&v(e.name),t[17]=v,t[18]=e),S=x.filter(e),t[14]=v,t[15]=x,t[16]=S}else S=t[16];let ne=S.length,w;t[19]!==o?.catalog||t[20]!==n||t[21]!==r?(w=e=>{let t=new Set((o?.catalog??[]).filter(ge).map(he));r({...n,skills:{mode:`selected`,include:Z(e.filter(e=>t.has(e)))}})},t[19]=o?.catalog,t[20]=n,t[21]=r,t[22]=w):w=t[22];let re=w,T=i?`技能策略`:`Skill policy`,E;t[23]===T?E=t[24]:(E=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:T}),t[23]=T,t[24]=E);let ie=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,D;t[25]===ie?D=t[26]:(D=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ie}),t[25]=ie,t[26]=D);let O;t[27]!==n||t[28]!==r?(O=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=O):O=t[29];let ae=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,k;t[30]===ae?k=t[31]:(k=d(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,ae),t[30]=ae,t[31]=k);let A;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,I.jsx)(s,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=A):A=t[32];let oe=i?`使用所有已启用技能`:`Use every enabled skill`,j;t[33]===oe?j=t[34]:(j=(0,I.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:oe}),t[33]=oe,t[34]=j);let se=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,M;t[35]===se?M=t[36]:(M=(0,I.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:se}),t[35]=se,t[36]=M);let N;t[37]!==j||t[38]!==M?(N=(0,I.jsxs)(`span`,{children:[j,M]}),t[37]=j,t[38]=M,t[39]=N):N=t[39];let P;t[40]!==O||t[41]!==k||t[42]!==N?(P=(0,I.jsxs)(`button`,{type:`button`,onClick:O,className:k,children:[A,N]}),t[40]=O,t[41]=k,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==n||t[45]!==r?(F=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=F):F=t[46];let ce=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,L;t[47]===ce?L=t[48]:(L=d(`flex items-start gap-3 rounded-xl bg-surface-base/55 p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,ce),t[47]=ce,t[48]=L);let R;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,I.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=R):R=t[49];let z=i?`只使用选中的技能`:`Use selected skills only`,B;t[50]===z?B=t[51]:(B=(0,I.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:z}),t[50]=z,t[51]=B);let V=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,H;t[52]===V?H=t[53]:(H=(0,I.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:V}),t[52]=V,t[53]=H);let U;t[54]!==B||t[55]!==H?(U=(0,I.jsxs)(`span`,{children:[B,H]}),t[54]=B,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==F||t[58]!==L||t[59]!==U?(W=(0,I.jsxs)(`button`,{type:`button`,onClick:F,className:L,children:[R,U]}),t[57]=F,t[58]=L,t[59]=U,t[60]=W):W=t[60];let G;t[61]!==P||t[62]!==W?(G=(0,I.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[P,W]}),t[61]=P,t[62]=W,t[63]=G):G=t[63];let de=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,K;t[64]===de?K=t[65]:(K=(0,I.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:de}),t[64]=de,t[65]=K);let q;t[66]!==re||t[67]!==o||t[68]!==i?(q=pe.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>re(e.names),disabled:!o,className:`rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,children:i?e.zh:e.en},e.id)),t[66]=re,t[67]=o,t[68]=i,t[69]=q):q=t[69];let J;t[70]===q?J=t[71]:(J=(0,I.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:q}),t[70]=q,t[71]=J);let Y;t[72]!==K||t[73]!==J?(Y=(0,I.jsxs)(`div`,{className:`mt-4`,children:[K,J]}),t[72]=K,t[73]=J,t[74]=Y):Y=t[74];let X;t[75]!==D||t[76]!==G||t[77]!==Y||t[78]!==E?(X=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[E,D,G,Y]}),t[75]=D,t[76]=G,t[77]=Y,t[78]=E,t[79]=X):X=t[79];let fe=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,Q;t[80]===fe?Q=t[81]:(Q=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:fe}),t[80]=fe,t[81]=Q);let ye=i?`当前默认可用 ${ne} 个技能。`:`${ne} skills are available by default.`,be;t[82]===ye?be=t[83]:(be=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ye}),t[82]=ye,t[83]=be);let xe;t[84]!==Q||t[85]!==be?(xe=(0,I.jsxs)(`div`,{children:[Q,be]}),t[84]=Q,t[85]=be,t[86]=xe):xe=t[86];let Se=i?`搜索技能`:`Search skills`,Ce;t[87]===Se?Ce=t[88]:(Ce=(0,I.jsx)(`span`,{className:`sr-only`,children:Se}),t[87]=Se,t[88]=Ce);let we;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,I.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[89]=we):we=t[89];let Te;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>p(e.target.value),t[90]=Te):Te=t[90];let Ee=i?`搜索技能`:`Search skills`,De;t[91]!==f||t[92]!==Ee?(De=(0,I.jsx)(`input`,{type:`search`,value:f,onChange:Te,placeholder:Ee,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[91]=f,t[92]=Ee,t[93]=De):De=t[93];let $;t[94]!==Ce||t[95]!==De?($=(0,I.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[Ce,we,De]}),t[94]=Ce,t[95]=De,t[96]=$):$=t[96];let Oe;t[97]!==xe||t[98]!==$?(Oe=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[xe,$]}),t[97]=xe,t[98]=$,t[99]=Oe):Oe=t[99];let ke;t[100]===c?ke=t[101]:(ke=c?(0,I.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:c instanceof Error?c.message:String(c)}):null,t[100]=c,t[101]=ke);let Ae;t[102]!==v||t[103]!==u||t[104]!==ee||t[105]!==b||t[106]!==i?(Ae=u?(0,I.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(me)}):(0,I.jsxs)(`div`,{className:`mt-4 flex max-h-[32rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>label]:rounded-lg [&>label]:bg-surface-panel/55`,children:[ee.map(e=>{let t=v(e.name);return(0,I.jsxs)(`label`,{className:d(`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,!e.enabled&&`cursor-not-allowed opacity-55`),children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!e.enabled,onChange:()=>b(e.name),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,I.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[10px] text-fg-muted`,children:i?`全局未启用`:`Disabled globally`})]}),e.description?(0,I.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description}):null]})]},e.name)}),ee.length===0?(0,I.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`没有匹配的技能。`:`No matching skills.`}):null]}),t[102]=v,t[103]=u,t[104]=ee,t[105]=b,t[106]=i,t[107]=Ae):Ae=t[107];let je;t[108]!==Oe||t[109]!==ke||t[110]!==Ae?(je=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Oe,ke,Ae]}),t[108]=Oe,t[109]=ke,t[110]=Ae,t[111]=je):je=t[111];let Me;return t[112]!==X||t[113]!==je?(Me=(0,I.jsxs)(`div`,{className:`space-y-5`,children:[X,je]}),t[112]=X,t[113]=je,t[114]=Me):Me=t[114],Me}function me(e){return(0,I.jsx)(b,{className:`h-14 rounded-xl`},e)}function he(e){return e.name}function ge(e){return e.enabled}function _e(e,t){return e.name.localeCompare(t.name)}function ve(e){return e.name}function ye(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function be(e){let t=(0,ue.c)(98),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,o=S(),[s,c]=(0,le.useState)(``),[u,f]=(0,le.useState)(`all`),[p,m]=(0,le.useState)(),h;t[0]===i?h=t[1]:(h=new Map(i.map(Ce)),t[0]=i,t[1]=h);let g=h,_;t[2]!==i||t[3]!==n.tools?(_=[...new Set([...i.map(Se),...Object.keys(n.tools)])].filter(xe).sort(),t[2]=i,t[3]=n.tools,t[4]=_):_=t[4];let v=_,y;if(t[5]!==v||t[6]!==n.tools){let e;t[8]===n.tools?e=t[9]:(e=e=>(n.tools[e]?.mode??`allow`)===`allow`,t[8]=n.tools,t[9]=e),y=v.filter(e),t[5]=v,t[6]=n.tools,t[7]=y}else y=t[7];let b=y.length,x;if(t[10]!==v||t[11]!==n.tools){let e;t[13]===n.tools?e=t[14]:(e=e=>n.tools[e]?.mode===`ask`,t[13]=n.tools,t[14]=e),x=v.filter(e),t[10]=v,t[11]=n.tools,t[12]=x}else x=t[12];let te=x.length,C;if(t[15]!==v||t[16]!==n.tools){let e;t[18]===n.tools?e=t[19]:(e=e=>n.tools[e]?.mode===`deny`,t[18]=n.tools,t[19]=e),C=v.filter(e),t[15]=v,t[16]=n.tools,t[17]=C}else C=t[17];let ne;t[20]!==y.length||t[21]!==x.length||t[22]!==C.length?(ne={allow:b,ask:te,deny:C.length},t[20]=y.length,t[21]=x.length,t[22]=C.length,t[23]=ne):ne=t[23];let w=ne,re;if(t[24]!==v||t[25]!==g||t[26]!==n.tools||t[27]!==u||t[28]!==s){let e=s.trim().toLowerCase();re=v.filter(t=>{let r=n.tools[t]?.mode??`allow`,i=g.get(t),a=`${t} ${i?.en??``} ${i?.zh??``}`.toLowerCase();return(!e||a.includes(e))&&(u===`all`||r===u)}),t[24]=v,t[25]=g,t[26]=n.tools,t[27]=u,t[28]=s,t[29]=re}else re=t[29];let T=re,D;t[30]!==n||t[31]!==r?(D=(e,t)=>{let i=n.tools[e]??{mode:`allow`};r({...n,tools:{...n.tools,[e]:{...i,...t}}})},t[30]=n,t[31]=r,t[32]=D):D=t[32];let O=D,ae=a?`全部 ${v.length}`:`All ${v.length}`,k;t[33]===ae?k=t[34]:(k={id:`all`,label:ae},t[33]=ae,t[34]=k);let A=a?`允许 ${w.allow}`:`Allow ${w.allow}`,j;t[35]===A?j=t[36]:(j={id:`allow`,label:A},t[35]=A,t[36]=j);let se=a?`询问 ${w.ask}`:`Ask ${w.ask}`,M;t[37]===se?M=t[38]:(M={id:`ask`,label:se},t[37]=se,t[38]=M);let N=a?`禁用 ${w.deny}`:`Deny ${w.deny}`,P;t[39]===N?P=t[40]:(P={id:`deny`,label:N},t[39]=N,t[40]=P);let F;t[41]!==k||t[42]!==j||t[43]!==M||t[44]!==P?(F=[k,j,M,P],t[41]=k,t[42]=j,t[43]=M,t[44]=P,t[45]=F):F=t[45];let ce=F,L=a?`默认工具权限`:`Default tool permissions`,R;t[46]===L?R=t[47]:(R=(0,I.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:L}),t[46]=L,t[47]=R);let z=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,B;t[48]===z?B=t[49]:(B=(0,I.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:z}),t[48]=z,t[49]=B);let V;t[50]!==R||t[51]!==B?(V=(0,I.jsxs)(`div`,{children:[R,B]}),t[50]=R,t[51]=B,t[52]=V):V=t[52];let H;t[53]!==u||t[54]!==ce?(H=(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,children:ce.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>f(e.id),className:d(`rounded-lg px-3 py-1.5 text-xs font-medium`,u===e.id?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:e.label},e.id))}),t[53]=u,t[54]=ce,t[55]=H):H=t[55];let U=a?`搜索工具`:`Search tools`,W;t[56]===U?W=t[57]:(W=(0,I.jsx)(`span`,{className:`sr-only`,children:U}),t[56]=U,t[57]=W);let G;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,I.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[58]=G):G=t[58];let de;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>c(e.target.value),t[59]=de):de=t[59];let K=a?`搜索工具`:`Search tools`,q;t[60]!==s||t[61]!==K?(q=(0,I.jsx)(`input`,{type:`search`,value:s,onChange:de,placeholder:K,className:`w-full rounded-lg border border-edge bg-surface-panel py-2 pl-9 pr-3 text-sm text-fg outline-none focus:border-accent`}),t[60]=s,t[61]=K,t[62]=q):q=t[62];let J;t[63]!==W||t[64]!==q?(J=(0,I.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[W,G,q]}),t[63]=W,t[64]=q,t[65]=J):J=t[65];let Y;t[66]!==H||t[67]!==J?(Y=(0,I.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[H,J]}),t[66]=H,t[67]=J,t[68]=Y):Y=t[68];let X=a?`工具调用限制`:`Tool call limits`,fe=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,Z;t[69]!==X||t[70]!==fe?(Z=(0,I.jsx)(ie,{title:X,summary:fe,children:null}),t[69]=X,t[70]=fe,t[71]=Z):Z=t[71];let pe;if(t[72]!==g||t[73]!==n.tools||t[74]!==p||t[75]!==o||t[76]!==O||t[77]!==T||t[78]!==a){let e;t[80]!==g||t[81]!==n.tools||t[82]!==p||t[83]!==o||t[84]!==O||t[85]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=g.get(e),i=p===e;return(0,I.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,I.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`flex rounded-lg bg-surface-base p-1`,children:[`allow`,`ask`,`deny`].map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>O(e,{mode:n}),className:d(`rounded-md px-2.5 py-1 text-xs font-medium capitalize`,t.mode===n?`bg-accent text-on-accent`:`text-fg-muted hover:text-fg`),children:n===`allow`?a?`允许`:`Allow`:n===`ask`?a?`询问`:`Ask`:a?`禁用`:`Deny`},n))}),o?(0,I.jsx)(ee,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>m(i?void 0:e),children:(0,I.jsx)(E,{className:`size-4`})}):null]})]}),i&&o?(0,I.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>O(e,{maxCallsPerTurn:ye(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]}),(0,I.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,I.jsx)(oe,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>O(e,{timeoutMs:ye(t.target.value)}),className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none focus:border-accent`})]})]}):null]},e)},t[80]=g,t[81]=n.tools,t[82]=p,t[83]=o,t[84]=O,t[85]=a,t[86]=e):e=t[86],pe=T.map(e),t[72]=g,t[73]=n.tools,t[74]=p,t[75]=o,t[76]=O,t[77]=T,t[78]=a,t[79]=pe}else pe=t[79];let Q;t[87]!==T.length||t[88]!==a?(Q=T.length===0?(0,I.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[87]=T.length,t[88]=a,t[89]=Q):Q=t[89];let me;t[90]!==pe||t[91]!==Q?(me=(0,I.jsxs)(`div`,{className:`mt-4 flex max-h-[38rem] flex-col gap-1 overflow-y-auto rounded-xl bg-surface-base/45 p-1 [&>*]:rounded-lg [&>*]:bg-surface-panel/55`,children:[pe,Q]}),t[90]=pe,t[91]=Q,t[92]=me):me=t[92];let he;return t[93]!==V||t[94]!==Y||t[95]!==Z||t[96]!==me?(he=(0,I.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[V,Y,Z,me]}),t[93]=V,t[94]=Y,t[95]=Z,t[96]=me,t[97]=he):he=t[97],he}function xe(e){return e!==`computer_use`||x()}function Se(e){return e.id}function Ce(e){return[e.id,e.description]}function we(){let e=(0,ue.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsxs)(se,{gap:`gap-5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(b,{className:`h-7 w-56`}),(0,I.jsx)(b,{className:`h-4 w-96 max-w-full`})]}),(0,I.jsx)(b,{className:`h-9 w-28`})]}),(0,I.jsx)(b,{className:`h-20 rounded-2xl`}),(0,I.jsx)(b,{className:`h-12 rounded-xl`}),(0,I.jsx)(b,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Te(e){let t=(0,ue.c)(73),{initial:n,builtinTools:r,zh:a}=e,[o,s]=i(),c;t[0]===o?c=t[1]:(c=o.get(`panel`),t[0]=o,t[1]=c);let l=c,f=l===`skills`||l===`tools`||l===`runtime`?l:`models`,p;t[2]!==o||t[3]!==s?(p=e=>{let t=new URLSearchParams(o);t.set(`panel`,e),s(t,{replace:!0})},t[2]=o,t[3]=s,t[4]=p):p=t[4];let m=p,h;t[5]===n?h=t[6]:(h=()=>structuredClone(n),t[5]=n,t[6]=h);let[g,_]=(0,le.useState)(h),v;t[7]===n?v=t[8]:(v=()=>structuredClone(n),t[7]=n,t[8]=v);let[y,b]=(0,le.useState)(v),x;t[9]===g?x=t[10]:(x=JSON.stringify(g),t[9]=g,t[10]=x);let te;t[11]===y?te=t[12]:(te=JSON.stringify(y),t[11]=y,t[12]=te);let S=x!==te,C=a?`模型`:`Models`,T;t[13]===C?T=t[14]:(T={id:`models`,label:C,icon:u},t[13]=C,t[14]=T);let E=a?`技能`:`Skills`,ie;t[15]===E?ie=t[16]:(ie={id:`skills`,label:E,icon:w},t[15]=E,t[16]=ie);let D=a?`工具`:`Tools`,O;t[17]===D?O=t[18]:(O={id:`tools`,label:D,icon:ne},t[17]=D,t[18]=O);let ae=a?`运行`:`Runtime`,A;t[19]===ae?A=t[20]:(A={id:`runtime`,label:ae,icon:re},t[19]=ae,t[20]=A);let oe;t[21]!==ie||t[22]!==O||t[23]!==A||t[24]!==T?(oe=[T,ie,O,A],t[21]=ie,t[22]=O,t[23]=A,t[24]=T,t[25]=oe):oe=t[25];let P=oe,F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=async e=>{let t=structuredClone(e),n=await k(t),r=structuredClone(n.defaults);_(e=>JSON.stringify(e)===JSON.stringify(t)?r:e),b(structuredClone(r))},t[26]=F):F=t[26];let ce=F,L;t[27]!==S||t[28]!==g?(L={value:g,dirty:S,onSave:ce,delayMs:0},t[27]=S,t[28]=g,t[29]=L):L=t[29];let R=N(L),z=R.onBlurCapture,B=a?`智能体设置`:`Agent settings`,V;t[30]!==R.error||t[31]!==R.status?(V=(0,I.jsx)(M,{status:R.status,error:R.error}),t[30]=R.error,t[31]=R.status,t[32]=V):V=t[32];let H;t[33]!==B||t[34]!==V?(H=(0,I.jsx)(j,{title:B,actions:V}),t[33]=B,t[34]=V,t[35]=H):H=t[35];let U;t[36]!==R.error||t[37]!==R.retry||t[38]!==a?(U=R.error?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:[(0,I.jsx)(`span`,{children:R.error}),(0,I.jsx)(ee,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:R.retry,children:a?`重试`:`Retry`})]}):null,t[36]=R.error,t[37]=R.retry,t[38]=a,t[39]=U):U=t[39];let W=a?`默认配置分区`:`Default configuration sections`,G;t[40]!==f||t[41]!==m||t[42]!==P?(G=P.map(e=>{let{id:t,label:n,icon:r}=e;return(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":f===t,onClick:()=>m(t),className:d(`flex min-w-0 items-center justify-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f===t?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,I.jsx)(r,{className:d(`size-4 shrink-0`,f===t?`text-accent`:`text-fg-subtle`)}),(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[40]=f,t[41]=m,t[42]=P,t[43]=G):G=t[43];let K;t[44]!==W||t[45]!==G?(K=(0,I.jsx)(`nav`,{className:`grid grid-cols-2 gap-1 rounded-xl bg-surface-hover/20 p-1 lg:grid-cols-4`,"aria-label":W,children:G}),t[44]=W,t[45]=G,t[46]=K):K=t[46];let q;t[47]!==f||t[48]!==g||t[49]!==a?(q=f===`models`?(0,I.jsx)(de,{draft:g,setDraft:_,zh:a}):null,t[47]=f,t[48]=g,t[49]=a,t[50]=q):q=t[50];let J;t[51]!==f||t[52]!==g||t[53]!==a?(J=f===`skills`?(0,I.jsx)(Q,{draft:g,setDraft:_,zh:a}):null,t[51]=f,t[52]=g,t[53]=a,t[54]=J):J=t[54];let Y;t[55]!==f||t[56]!==r||t[57]!==g||t[58]!==a?(Y=f===`tools`?(0,I.jsx)(be,{draft:g,setDraft:_,builtinTools:r,zh:a}):null,t[55]=f,t[56]=r,t[57]=g,t[58]=a,t[59]=Y):Y=t[59];let fe;t[60]!==f||t[61]!==g||t[62]!==a?(fe=f===`runtime`?(0,I.jsx)(X,{draft:g,setDraft:_,zh:a}):null,t[60]=f,t[61]=g,t[62]=a,t[63]=fe):fe=t[63];let Z;return t[64]!==R.onBlurCapture||t[65]!==H||t[66]!==U||t[67]!==K||t[68]!==q||t[69]!==J||t[70]!==Y||t[71]!==fe?(Z=(0,I.jsxs)(se,{gap:`gap-5`,onBlurCapture:z,children:[H,U,K,q,J,Y,fe]}),t[64]=R.onBlurCapture,t[65]=H,t[66]=U,t[67]=K,t[68]=q,t[69]=J,t[70]=Y,t[71]=fe,t[72]=Z):Z=t[72],Z}function Ee(){let e=(0,ue.c)(17),t=f($),n=p(De)===`zh`,{data:r,error:i,isLoading:a,mutate:o}=g(t?`settings-agent-defaults`:null,O);if(!t){let t=n?`需要本机服务令牌。`:`Local service token required.`,r;return e[0]===t?r=e[1]:(r=(0,I.jsx)(se,{children:(0,I.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t})}),e[0]=t,e[1]=r),r}if(i&&!r){let t=String(i),r;e[2]===t?r=e[3]:(r=(0,I.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:t}),e[2]=t,e[3]=r);let a;e[4]===o?a=e[5]:(a=()=>void o(),e[4]=o,e[5]=a);let s=n?`重试`:`Retry`,c;e[6]!==a||e[7]!==s?(c=(0,I.jsx)(ee,{onClick:a,children:s}),e[6]=a,e[7]=s,e[8]=c):c=e[8];let l;return e[9]!==r||e[10]!==c?(l=(0,I.jsxs)(se,{children:[r,c]}),e[9]=r,e[10]=c,e[11]=l):l=e[11],l}if(a||!r){let t;return e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(we,{}),e[12]=t):t=e[12],t}let s;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(s=(0,I.jsx)(Te,{initial:r.defaults,builtinTools:r.builtinTools,zh:n}),e[13]=r.builtinTools,e[14]=r.defaults,e[15]=n,e[16]=s):s=e[16],s}function De(e){return e.language}function $(e){return e.conversationId}export{Ee as AgentDefaultsSettingsPanel};