@xopcai/xopc 0.0.389 → 0.0.390

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 (302) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/src/plugin.js +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{activity-store-dvik6t7Z.js → activity-store-DGMAYkw8.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-bWMd5TDC.js → agent-avatar-dicebear-B4AsZzJR.js} +1 -1
  6. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-9NUY1sO3.js +1 -0
  7. package/dist/gateway/static/root/assets/agent-plugin-dialog-CNc6ntzP.js +1 -0
  8. package/dist/gateway/static/root/assets/agents-QNY9Vkrf.js +77 -0
  9. package/dist/gateway/static/root/assets/{agents-admin-api-BlNGyXpm.js → agents-admin-api-DxdaiFWn.js} +1 -1
  10. package/dist/gateway/static/root/assets/app-management-settings-panel-DHRfLkYD.js +1 -0
  11. package/dist/gateway/static/root/assets/{appearance-settings-CUAdx44v.js → appearance-settings-DtKSapgb.js} +1 -1
  12. package/dist/gateway/static/root/assets/{apps-page-D5zDB6gp.js → apps-page-B9kuRt_z.js} +1 -1
  13. package/dist/gateway/static/root/assets/{archive-plugin-Du6dJNcl.js → archive-plugin-AgySTXp_.js} +1 -1
  14. package/dist/gateway/static/root/assets/{automations-page-BO8Ig5Z4.js → automations-page-D1o7ZtUW.js} +1 -1
  15. package/dist/gateway/static/root/assets/automations-workspace-BJenz0P1.js +6 -0
  16. package/dist/gateway/static/root/assets/{binary-plugins-D7VJjwnr.js → binary-plugins-A1AXOsO6.js} +1 -1
  17. package/dist/gateway/static/root/assets/{block-editor-CaJlWTAn.js → block-editor-DUNLkLKF.js} +3 -3
  18. package/dist/gateway/static/root/assets/{browser-automation-inputs-iyMBJmQX.js → browser-automation-inputs-BvUC6OiW.js} +1 -1
  19. package/dist/gateway/static/root/assets/browser-automations-page-Dq2LlVMh.js +3 -0
  20. package/dist/gateway/static/root/assets/browser-settings-page-BOZ-1g51.js +3 -0
  21. package/dist/gateway/static/root/assets/{capabilities-MCKRMZDK.js → capabilities-BkCutK0V.js} +1 -1
  22. package/dist/gateway/static/root/assets/{capabilities-CEH1AnXc.js → capabilities-D61uSJPy.js} +1 -1
  23. package/dist/gateway/static/root/assets/capabilities-page-BDP6gzlv.js +2 -0
  24. package/dist/gateway/static/root/assets/capabilities-settings-panel-D6PL3Mfl.js +8 -0
  25. package/dist/gateway/static/root/assets/{capability-header-actions-BIA0Lwt5.js → capability-header-actions-D9uGs4Pw.js} +1 -1
  26. package/dist/gateway/static/root/assets/channels-xb7n8rwF.js +1 -0
  27. package/dist/gateway/static/root/assets/chat-terminal-dock-Dgn09YDs.js +36 -0
  28. package/dist/gateway/static/root/assets/{computer-settings-page-DvY3zgyY.js → computer-settings-page-C66P4ifT.js} +1 -1
  29. package/dist/gateway/static/root/assets/{connector-service-page-St2-Fj3y.js → connector-service-page-Dp35XdYf.js} +1 -1
  30. package/dist/gateway/static/root/assets/connectors-page-BHcRxYib.js +1 -0
  31. package/dist/gateway/static/root/assets/{date-picker-C0-D80ny.js → date-picker-CddHY982.js} +1 -1
  32. package/dist/gateway/static/root/assets/{dependency-picker-CNd7mwMU.js → dependency-picker-Ob6BZTqv.js} +1 -1
  33. package/dist/gateway/static/root/assets/{desktop-pet-C-2wDANn.js → desktop-pet-dmwCV-I4.js} +1 -1
  34. package/dist/gateway/static/root/assets/{desktop-pet-settings-DyhxLrdJ.js → desktop-pet-settings-B-TBkZAZ.js} +1 -1
  35. package/dist/gateway/static/root/assets/device-pairing-wizard-SWHwRgG3.js +1 -0
  36. package/dist/gateway/static/root/assets/{directory-picker-path-field-CNivVIPT.js → directory-picker-path-field-6VZa4fT1.js} +1 -1
  37. package/dist/gateway/static/root/assets/{extension-debug-page-CGYO3JPw.js → extension-debug-page-C0_njMva.js} +1 -1
  38. package/dist/gateway/static/root/assets/{extension-page-Dc51ALAg.js → extension-page-BeBLMFmW.js} +1 -1
  39. package/dist/gateway/static/root/assets/{extension-provider-BXPILdlw.js → extension-provider-DWI0KAKT.js} +1 -1
  40. package/dist/gateway/static/root/assets/extension-settings-page-BiLUwoKx.js +1 -0
  41. package/dist/gateway/static/root/assets/{gateway-config-swr-Bc2MytsF.js → gateway-config-swr-CmYcOqhb.js} +1 -1
  42. package/dist/gateway/static/root/assets/{gateway-realtime-BFK-vlME.js → gateway-realtime-Ci1Jst5g.js} +1 -1
  43. package/dist/gateway/static/root/assets/gateway-realtime-store-BMUiUQMk.js +1 -0
  44. package/dist/gateway/static/root/assets/gateway-settings-CzWT_v09.js +1 -0
  45. package/dist/gateway/static/root/assets/{gateway-startup-retry-BDPMttPx.js → gateway-startup-retry-C-BG5M7H.js} +1 -1
  46. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DAlRGMge.js → highlighted-body-KQOG7T2V-CsA7lCVc.js} +1 -1
  47. package/dist/gateway/static/root/assets/home-page-BeXJfxsg.js +2 -0
  48. package/dist/gateway/static/root/assets/image-generation-api-B_DqCwtV.js +1 -0
  49. package/dist/gateway/static/root/assets/imports-page-oAvAF9QS.js +1 -0
  50. package/dist/gateway/static/root/assets/index-W9ls-0Yd.css +1 -0
  51. package/dist/gateway/static/root/assets/index-xTL-vb51.js +260 -0
  52. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BYYC9Qmw.js → keyboard-shortcuts-settings--MjYe-Pb.js} +1 -1
  53. package/dist/gateway/static/root/assets/{local-app-workbench-page-BKZfn-MS.js → local-app-workbench-page-DL33dtd7.js} +1 -1
  54. package/dist/gateway/static/root/assets/{local-apps-page-BU8pUsVM.js → local-apps-page-DOa7mxjB.js} +1 -1
  55. package/dist/gateway/static/root/assets/{local-session-drafts-kFc_MAA9.js → local-session-drafts-DAtLkTPg.js} +1 -1
  56. package/dist/gateway/static/root/assets/{locale-store-Dr43FCty.js → locale-store-DMy9W6IG.js} +1 -1
  57. package/dist/gateway/static/root/assets/logs-page-C-GbTYsM.js +2 -0
  58. package/dist/gateway/static/root/assets/management-settings-C0TzuD3-.js +1 -0
  59. package/dist/gateway/static/root/assets/{markdown-view-CdKlPjJM.js → markdown-view-wyOHdXEg.js} +1 -1
  60. package/dist/gateway/static/root/assets/{media-plugins-DE9zt88i.js → media-plugins-Pb2zr_-L.js} +1 -1
  61. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-BxyGGa4D.js +1 -0
  62. package/dist/gateway/static/root/assets/messages-O0BEUKnx.js +3 -0
  63. package/dist/gateway/static/root/assets/models-hub-cache-DdH1MODX.js +1 -0
  64. package/dist/gateway/static/root/assets/note-detail-panel-BFpEqskQ.js +5 -0
  65. package/dist/gateway/static/root/assets/{notes-api-BHouNL6-.js → notes-api-CYt2pGsm.js} +1 -1
  66. package/dist/gateway/static/root/assets/notes-page-h-qqFJ6Z.js +8 -0
  67. package/dist/gateway/static/root/assets/{page-context-capture-button-TQr8NnSc.js → page-context-capture-button-3uj5EcQC.js} +1 -1
  68. package/dist/gateway/static/root/assets/personal-page-BGyW6cdt.js +1 -0
  69. package/dist/gateway/static/root/assets/{product-open-page-BEl6syFp.js → product-open-page-hI13tPS1.js} +1 -1
  70. package/dist/gateway/static/root/assets/{product-preview-content-BxSHnbqz.js → product-preview-content-lT_in0-Q.js} +1 -1
  71. package/dist/gateway/static/root/assets/project-detail-page-Baj7fQ7N.js +1 -0
  72. package/dist/gateway/static/root/assets/projects-page-D7DyQFU3.js +1 -0
  73. package/dist/gateway/static/root/assets/{registry-api-BD5IgDOA.js → registry-api-CgQrCqL6.js} +1 -1
  74. package/dist/gateway/static/root/assets/remote-access-hub-DU_d93Tm.js +1 -0
  75. package/dist/gateway/static/root/assets/{runtime-tools-api-CjTRoQWT.js → runtime-tools-api-D12qVKeC.js} +1 -1
  76. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DOSPOfCU.js +1 -0
  77. package/dist/gateway/static/root/assets/scenes-page-swyUIF5A.js +2 -0
  78. package/dist/gateway/static/root/assets/{schema-form-ByG-R6N2.js → schema-form-CwOFgsyh.js} +1 -1
  79. package/dist/gateway/static/root/assets/{send-session-input-UAVStisp.js → send-session-input-nH8Cw0US.js} +1 -1
  80. package/dist/gateway/static/root/assets/{session-api-DvgEiNRS.js → session-api-B9HrwF-c.js} +1 -1
  81. package/dist/gateway/static/root/assets/{session-manager-BOb1tC_Z.js → session-manager-aXqXuqDX.js} +1 -1
  82. package/dist/gateway/static/root/assets/sessions-page-CI_PJmlX.js +1 -0
  83. package/dist/gateway/static/root/assets/settings-advanced-gate-DCVaeBLW.js +1 -0
  84. package/dist/gateway/static/root/assets/{settings-page-C1e9m23j.js → settings-page-BN70wE6R.js} +1 -1
  85. package/dist/gateway/static/root/assets/setup-status-panel-CHzcVRi-.js +1 -0
  86. package/dist/gateway/static/root/assets/{share-link-dialog-kE_6v5Dp.js → share-link-dialog-B1TDyhPt.js} +1 -1
  87. package/dist/gateway/static/root/assets/{share-preview-page-BT-_yR1h.js → share-preview-page-Br-eAZaP.js} +1 -1
  88. package/dist/gateway/static/root/assets/{shares-api-Dg_SqHQE.js → shares-api-Bl1ZBh5S.js} +1 -1
  89. package/dist/gateway/static/root/assets/shares-settings-jgCC_E4Y.js +1 -0
  90. package/dist/gateway/static/root/assets/{skill-api-BslUYMnX.js → skill-api-ClUw3SRC.js} +1 -1
  91. package/dist/gateway/static/root/assets/{skill-reload-api-BQ2rTOP1.js → skill-reload-api--1BfIPzb.js} +1 -1
  92. package/dist/gateway/static/root/assets/skills-page-C9oRZSuL.js +2 -0
  93. package/dist/gateway/static/root/assets/{system-settings-panel-GpbPfWwo.js → system-settings-panel-tWrqu7ai.js} +1 -1
  94. package/dist/gateway/static/root/assets/{task-detail-page-5B5ZVAu0.js → task-detail-page-BYRW7Rrr.js} +2 -2
  95. package/dist/gateway/static/root/assets/{task-expandable-content-DJrrEBB4.js → task-expandable-content-D2t4ahzR.js} +1 -1
  96. package/dist/gateway/static/root/assets/{theme-store-BKpYnggg.js → theme-store-BBLjE0fi.js} +1 -1
  97. package/dist/gateway/static/root/assets/{tracing-settings-page-D71w7dwV.js → tracing-settings-page-5ATxQH5c.js} +1 -1
  98. package/dist/gateway/static/root/assets/{tunnel-api-BV46CvS8.js → tunnel-api-CF1Qh4wU.js} +1 -1
  99. package/dist/gateway/static/root/assets/{usage-page-rMuwNpJi.js → usage-page-CuEHzXil.js} +1 -1
  100. package/dist/gateway/static/root/assets/{use-autosave-CzyqRffr.js → use-autosave-tY3keIbm.js} +1 -1
  101. package/dist/gateway/static/root/assets/{use-composer-attachments-Dviq-1f6.js → use-composer-attachments-CXsocZjt.js} +1 -1
  102. package/dist/gateway/static/root/assets/{use-file-preview-expanded-D5Kk7Hon.js → use-file-preview-expanded-CEsxnDnQ.js} +2 -2
  103. package/dist/gateway/static/root/assets/user-model-page-Dvt5TIZ6.js +2 -0
  104. package/dist/gateway/static/root/assets/{voice-api-key-field-DWtbmacd.js → voice-api-key-field-COTNLUU3.js} +1 -1
  105. package/dist/gateway/static/root/assets/{voice-config-api-DnIjZm_9.js → voice-config-api-DrxBjSja.js} +1 -1
  106. package/dist/gateway/static/root/assets/voice-transcribe-api-B47j0_xA.js +1 -0
  107. package/dist/gateway/static/root/assets/{work-discovery-overlay-ChEG71hz.js → work-discovery-overlay-PByMJrhV.js} +1 -1
  108. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-pdiRKLxP.js → workflow-run-setup-panel-CSUkMo63.js} +2 -2
  109. package/dist/gateway/static/root/assets/{workflows-page-D9LMxINt.js → workflows-page-BUDvFo3R.js} +3 -3
  110. package/dist/gateway/static/root/assets/{workspace-api-CZDvu7uA.js → workspace-api-Bmx1O449.js} +2 -2
  111. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CbUgg1SK.js → xopc-cloud-account-card-DVsAbvwP.js} +1 -1
  112. package/dist/gateway/static/root/index.html +28 -27
  113. package/dist/package.js +1 -1
  114. package/dist/packages/gateway-contract/src/discussions.js +3 -2
  115. package/dist/packages/gateway-contract/src/index.js +4 -0
  116. package/dist/packages/gateway-contract/src/provider-setup.js +6 -0
  117. package/dist/packages/gateway-contract/src/recording-outcome.js +6 -0
  118. package/dist/packages/image-providers/src/catalog.js +10 -0
  119. package/dist/packages/image-providers/src/execute.js +5 -1
  120. package/dist/packages/image-providers/src/validation.js +19 -1
  121. package/dist/src/agent/background-review/run-background-review.d.ts +0 -1
  122. package/dist/src/agent/background-review/run-background-review.js +10 -2
  123. package/dist/src/agent/embedded/run-for-session.js +26 -3
  124. package/dist/src/agent/embedded/run-turn.js +12 -0
  125. package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -0
  126. package/dist/src/agent/image/generation/runtime.js +12 -14
  127. package/dist/src/agent/image/understanding/runtime.js +5 -0
  128. package/dist/src/agent/inbound/inbound-loop.d.ts +1 -15
  129. package/dist/src/agent/inbound/inbound-loop.js +5 -0
  130. package/dist/src/agent/mcp/connection-errors.d.ts +3 -0
  131. package/dist/src/agent/mcp/connection-errors.js +32 -0
  132. package/dist/src/agent/mcp/connection-setup.d.ts +2 -0
  133. package/dist/src/agent/mcp/connection-setup.js +38 -18
  134. package/dist/src/agent/memory/compaction.js +5 -1
  135. package/dist/src/agent/memory/idle-compaction-scheduler.js +3 -1
  136. package/dist/src/agent/models/manager.d.ts +1 -0
  137. package/dist/src/agent/models/manager.js +4 -2
  138. package/dist/src/agent/orchestration/agent-orchestrator.d.ts +1 -6
  139. package/dist/src/agent/orchestration/agent-orchestrator.js +5 -0
  140. package/dist/src/agent/service/process-direct-one-shot.js +5 -0
  141. package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
  142. package/dist/src/agent/service/process-direct-streaming.js +17 -1
  143. package/dist/src/agent/tools/image-generate-tool.js +5 -1
  144. package/dist/src/agent-config/resolver.js +5 -0
  145. package/dist/src/agent-config/schema.d.ts +26 -6
  146. package/dist/src/agent-config/schema.js +2 -0
  147. package/dist/src/ai-assist/text-assist.js +5 -16
  148. package/dist/src/automations/service/action-executor.js +3 -1
  149. package/dist/src/channels/index.js +1 -1
  150. package/dist/src/channels/manager.js +1 -1
  151. package/dist/src/cli/commands/channels.js +1 -1
  152. package/dist/src/cli/commands/connectors.js +1 -1
  153. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  154. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  155. package/dist/src/cli/commands/models.js +1 -1
  156. package/dist/src/cli/commands/onboard.js +1 -1
  157. package/dist/src/config/agent-model-intents.js +4 -1
  158. package/dist/src/config/schema.d.ts +11 -5
  159. package/dist/src/config/schema.js +11 -3
  160. package/dist/src/discussions/analyzer.d.ts +2 -0
  161. package/dist/src/discussions/analyzer.js +38 -9
  162. package/dist/src/discussions/audio-clip.d.ts +3 -0
  163. package/dist/src/discussions/audio-clip.js +72 -0
  164. package/dist/src/discussions/live-worker.js +3 -1
  165. package/dist/src/discussions/long-review.d.ts +17 -0
  166. package/dist/src/discussions/long-review.js +278 -0
  167. package/dist/src/discussions/media-timeline.d.ts +21 -0
  168. package/dist/src/discussions/media-timeline.js +134 -0
  169. package/dist/src/discussions/organizer-worker.d.ts +4 -1
  170. package/dist/src/discussions/organizer-worker.js +17 -12
  171. package/dist/src/discussions/organizer.js +2 -0
  172. package/dist/src/discussions/processing.d.ts +43 -0
  173. package/dist/src/discussions/processing.js +125 -0
  174. package/dist/src/discussions/recording.js +202 -42
  175. package/dist/src/discussions/recordingJobs.js +2 -0
  176. package/dist/src/discussions/repository.js +4 -2
  177. package/dist/src/discussions/review.d.ts +8 -0
  178. package/dist/src/discussions/review.js +183 -0
  179. package/dist/src/discussions/sealer.d.ts +7 -1
  180. package/dist/src/discussions/sealer.js +163 -87
  181. package/dist/src/discussions/service.d.ts +7 -1
  182. package/dist/src/discussions/service.js +51 -15
  183. package/dist/src/discussions/types.d.ts +2 -1
  184. package/dist/src/extensions/sdk/index.js +1 -1
  185. package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
  186. package/dist/src/gateway/global-defaults-admin.d.ts +3 -1
  187. package/dist/src/gateway/global-defaults-admin.js +14 -2
  188. package/dist/src/gateway/hono/lib/config-payload.d.ts +11 -2
  189. package/dist/src/gateway/hono/lib/config-payload.js +2 -0
  190. package/dist/src/gateway/hono/lib/voice-settings-revisions.d.ts +5 -0
  191. package/dist/src/gateway/hono/lib/voice-settings-revisions.js +23 -0
  192. package/dist/src/gateway/hono/routes/config-patch/misc.js +8 -1
  193. package/dist/src/gateway/hono/routes/config.js +12 -0
  194. package/dist/src/gateway/hono/routes/discussions.js +63 -1
  195. package/dist/src/gateway/hono/routes/global-defaults.js +8 -1
  196. package/dist/src/gateway/hono/routes/models.js +12 -4
  197. package/dist/src/gateway/hono/routes/provider-setup.d.ts +3 -0
  198. package/dist/src/gateway/hono/routes/provider-setup.js +106 -0
  199. package/dist/src/gateway/hono/routes/status.js +2 -0
  200. package/dist/src/gateway/hono/routes/voice.js +23 -10
  201. package/dist/src/gateway/provider-model-setup.d.ts +4 -0
  202. package/dist/src/gateway/provider-model-setup.js +56 -0
  203. package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
  204. package/dist/src/gateway/service.js +7 -7
  205. package/dist/src/home-intelligence/host.js +2 -2
  206. package/dist/src/media-shared/http/provider-http.d.ts +0 -6
  207. package/dist/src/media-shared/http/provider-http.js +5 -4
  208. package/dist/src/media-understanding/runner.d.ts +0 -28
  209. package/dist/src/media-understanding/runner.js +4 -0
  210. package/dist/src/platform/client.d.ts +1 -1
  211. package/dist/src/platform/contracts.d.ts +1 -1
  212. package/dist/src/providers/env-keys.js +3 -0
  213. package/dist/src/providers/extension-stream-bridge.js +3 -0
  214. package/dist/src/providers/index.js +15 -0
  215. package/dist/src/providers/model-call.d.ts +5 -2
  216. package/dist/src/providers/model-call.js +13 -2
  217. package/dist/src/providers/model-reference-auditor.js +1 -0
  218. package/dist/src/providers/model-response.js +1 -1
  219. package/dist/src/providers/model-usage.d.ts +15 -0
  220. package/dist/src/providers/model-usage.js +50 -0
  221. package/dist/src/providers/presentation.js +8 -0
  222. package/dist/src/providers/setup/engine.d.ts +37 -0
  223. package/dist/src/providers/setup/engine.js +177 -0
  224. package/dist/src/providers/setup/profiles.d.ts +4 -0
  225. package/dist/src/providers/setup/profiles.js +94 -0
  226. package/dist/src/providers/setup/voice.d.ts +23 -0
  227. package/dist/src/providers/setup/voice.js +234 -0
  228. package/dist/src/scenes/agentExecutor.d.ts +1 -0
  229. package/dist/src/scenes/agentExecutor.js +5 -0
  230. package/dist/src/storage/sqlite/migrations/253_discussion_processing_recovery.sql +20 -0
  231. package/dist/src/storage/sqlite/migrations/254_discussion_annotations.sql +17 -0
  232. package/dist/src/storage/sqlite/migrations/255_discussion_chapter_progress.sql +10 -0
  233. package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
  234. package/dist/src/storage/sqlite/migrations/runner.js +3 -3
  235. package/dist/src/storage/sqlite/schema.js +1 -1
  236. package/dist/src/usage/recorder.js +2 -1
  237. package/dist/src/usage/scenario-registry.js +128 -123
  238. package/dist/src/voice/dashscope/streaming-stt-session.js +3 -0
  239. package/dist/src/voice/dashscope/streaming-tts-stream.js +3 -0
  240. package/dist/src/voice/dictation.d.ts +12 -0
  241. package/dist/src/voice/dictation.js +22 -0
  242. package/dist/src/voice/metadata/builtin.js +54 -0
  243. package/dist/src/voice/platform-streams.js +3 -0
  244. package/dist/src/voice/realtime/omniEngine.js +3 -0
  245. package/dist/src/voice/realtime/omniRoute.js +3 -2
  246. package/dist/src/voice/realtime/runtime.js +4 -2
  247. package/dist/src/voice/stt/factory.js +9 -3
  248. package/dist/src/voice/stt/providers/bailian-plan-transcription.d.ts +2 -0
  249. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +32 -0
  250. package/dist/src/voice/stt/providers/index.d.ts +1 -0
  251. package/dist/src/voice/stt/providers/index.js +2 -1
  252. package/dist/src/voice/token-plan.d.ts +8 -0
  253. package/dist/src/voice/token-plan.js +11 -0
  254. package/dist/src/voice/tts/factory.js +4 -1
  255. package/dist/src/voice/tts/providers/bailian-plan-speech.d.ts +2 -0
  256. package/dist/src/voice/tts/providers/bailian-plan-speech.js +84 -0
  257. package/dist/src/voice/tts/providers/index.d.ts +1 -0
  258. package/dist/src/voice/tts/providers/index.js +2 -1
  259. package/dist/src/voice/tts/speak-core.js +10 -1
  260. package/package.json +4 -4
  261. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Ds0Ue2FB.js +0 -1
  262. package/dist/gateway/static/root/assets/agent-plugin-dialog-UunIxc1q.js +0 -1
  263. package/dist/gateway/static/root/assets/agents-BLRM4o-U.js +0 -77
  264. package/dist/gateway/static/root/assets/app-management-settings-panel-Dmy828Pe.js +0 -1
  265. package/dist/gateway/static/root/assets/automations-workspace-UcCneEs3.js +0 -6
  266. package/dist/gateway/static/root/assets/browser-automations-page-BjvQnYfO.js +0 -3
  267. package/dist/gateway/static/root/assets/browser-settings-page-D5ZghI28.js +0 -3
  268. package/dist/gateway/static/root/assets/capabilities-page-MC8qIrXo.js +0 -2
  269. package/dist/gateway/static/root/assets/capabilities-settings-panel-Blz3hEzp.js +0 -8
  270. package/dist/gateway/static/root/assets/channels-DSg_iCVC.js +0 -1
  271. package/dist/gateway/static/root/assets/chat-terminal-dock-C97SJEwd.js +0 -36
  272. package/dist/gateway/static/root/assets/connectors-page-DXk-GAsd.js +0 -1
  273. package/dist/gateway/static/root/assets/device-pairing-wizard-BeSuq__I.js +0 -1
  274. package/dist/gateway/static/root/assets/extension-settings-page-jYu6qpY2.js +0 -1
  275. package/dist/gateway/static/root/assets/fallback-models-CoyzvDo7.js +0 -1
  276. package/dist/gateway/static/root/assets/gateway-realtime-store-C3vH-Iup.js +0 -1
  277. package/dist/gateway/static/root/assets/gateway-settings-JlT1dlSj.js +0 -1
  278. package/dist/gateway/static/root/assets/home-page-DOVl8s-1.js +0 -2
  279. package/dist/gateway/static/root/assets/image-generation-api-BZBiYDmV.js +0 -1
  280. package/dist/gateway/static/root/assets/imports-page-DgdBTp_0.js +0 -1
  281. package/dist/gateway/static/root/assets/index-CmC8JkSM.js +0 -260
  282. package/dist/gateway/static/root/assets/index-Dgzc0oBu.css +0 -1
  283. package/dist/gateway/static/root/assets/logs-page-BSepiACn.js +0 -2
  284. package/dist/gateway/static/root/assets/management-settings-dE_ykPNY.js +0 -1
  285. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-65SE6j-_.js +0 -1
  286. package/dist/gateway/static/root/assets/messages-DlTNQI92.js +0 -3
  287. package/dist/gateway/static/root/assets/models-hub-cache-C7FAsEe_.js +0 -1
  288. package/dist/gateway/static/root/assets/note-detail-panel-D9oqhdyk.js +0 -5
  289. package/dist/gateway/static/root/assets/notes-page-Bd4_7ph8.js +0 -8
  290. package/dist/gateway/static/root/assets/personal-page-BvWzq4Wp.js +0 -1
  291. package/dist/gateway/static/root/assets/project-detail-page-D-qkIXVT.js +0 -1
  292. package/dist/gateway/static/root/assets/projects-page-BQtw1Dfn.js +0 -1
  293. package/dist/gateway/static/root/assets/remote-access-hub-CYFNz0Jc.js +0 -1
  294. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Qq_NyYx_.js +0 -1
  295. package/dist/gateway/static/root/assets/scenes-page-hGr-ppYk.js +0 -2
  296. package/dist/gateway/static/root/assets/sessions-page-CpX1Rluw.js +0 -1
  297. package/dist/gateway/static/root/assets/settings-advanced-gate-D2s_MlxR.js +0 -1
  298. package/dist/gateway/static/root/assets/settings-loading-skeleton-BTqvr_Fw.js +0 -1
  299. package/dist/gateway/static/root/assets/setup-status-panel-BiHRYDHq.js +0 -1
  300. package/dist/gateway/static/root/assets/shares-settings-DfcAu08T.js +0 -1
  301. package/dist/gateway/static/root/assets/skills-page-CvKc5nBN.js +0 -2
  302. package/dist/gateway/static/root/assets/user-model-page-Dhqw3v_u.js +0 -2
@@ -0,0 +1,84 @@
1
+ import { assertProviderUsage, init_model_usage } from "../../../providers/model-usage.js";
2
+ import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../../auth/sync-provider-auth.js";
3
+ import { getProviderAuthService, init_provider_auth_service } from "../../../providers/provider-auth-service.js";
4
+ import { fetchWithTimeoutGuarded, postJsonRequest } from "../../../media-shared/http/provider-http.js";
5
+ import "../../../media-shared/http/index.js";
6
+ import { BAILIAN_PLAN_HOST, BAILIAN_PLAN_PROVIDER, BAILIAN_PLAN_TTS_MODEL, BAILIAN_PLAN_TTS_VOICE } from "../../token-plan.js";
7
+ import { registerSpeechProvider } from "../speech-registry.js";
8
+ //#region src/voice/tts/providers/bailian-plan-speech.ts
9
+ init_sync_provider_auth();
10
+ init_provider_auth_service();
11
+ init_model_usage();
12
+ const secret = () => resolveProviderApiKeyForAgentSync("qwen-token-plan-cn") ?? process.env.QWEN_TOKEN_PLAN_CN_API_KEY;
13
+ const bailianPlanSpeechProvider = {
14
+ id: BAILIAN_PLAN_PROVIDER,
15
+ resolveConfig: ({ rawConfig }) => {
16
+ return {
17
+ model: BAILIAN_PLAN_TTS_MODEL,
18
+ voice: BAILIAN_PLAN_TTS_VOICE,
19
+ ...rawConfig[BAILIAN_PLAN_PROVIDER],
20
+ baseUrl: `${BAILIAN_PLAN_HOST}/api/v1/services/audio/tts/SpeechSynthesizer`
21
+ };
22
+ },
23
+ isConfigured: () => Boolean(secret()),
24
+ listVoices: async () => [{
25
+ id: BAILIAN_PLAN_TTS_VOICE,
26
+ name: "Long Anhuan"
27
+ }],
28
+ synthesize: async (req) => {
29
+ assertProviderUsage(BAILIAN_PLAN_PROVIDER);
30
+ const apiKey = await getProviderAuthService().resolveApiKey(BAILIAN_PLAN_PROVIDER);
31
+ if (!apiKey) throw new Error("Bailian subscription TTS credential is unavailable");
32
+ const model = String(req.providerOverrides?.model ?? req.providerConfig.model ?? "qwen-audio-3.0-tts-plus");
33
+ if (model !== "qwen-audio-3.0-tts-plus") throw new Error("Unsupported Bailian subscription TTS model");
34
+ const response = await postJsonRequest(`${BAILIAN_PLAN_HOST}/api/v1/services/audio/tts/SpeechSynthesizer`, {
35
+ timeoutMs: req.timeoutMs,
36
+ signal: req.signal,
37
+ label: "Bailian subscription TTS",
38
+ headers: { Authorization: `Bearer ${apiKey}` },
39
+ body: {
40
+ model,
41
+ input: {
42
+ text: req.text,
43
+ voice: req.providerOverrides?.voice ?? req.providerConfig.voice ?? "longanhuan_v3.6",
44
+ format: "mp3",
45
+ sample_rate: 24e3
46
+ }
47
+ }
48
+ });
49
+ let audioResponse = response;
50
+ let inline;
51
+ if (response.headers.get("content-type")?.includes("json")) {
52
+ const audio = (await response.json()).output?.audio;
53
+ if (audio?.data) inline = Buffer.from(audio.data.replace(/^data:audio\/[^;]+;base64,/, ""), "base64");
54
+ else if (audio?.url) {
55
+ const audioUrl = new URL(audio.url);
56
+ if (audioUrl.protocol === "http:") audioUrl.protocol = "https:";
57
+ if (audioUrl.protocol !== "https:") throw new Error("Bailian subscription returned an unsupported audio URL");
58
+ audioResponse = await fetchWithTimeoutGuarded(audioUrl.toString(), {
59
+ timeoutMs: req.timeoutMs,
60
+ signal: req.signal,
61
+ label: "Bailian subscription audio download",
62
+ allowPrivateNetwork: false,
63
+ init: { redirect: "error" }
64
+ });
65
+ if (!audioResponse.ok) throw new Error(`Bailian subscription audio download failed: HTTP ${audioResponse.status}`);
66
+ } else throw new Error("Bailian subscription TTS returned no audio");
67
+ }
68
+ const audioBuffer = inline ?? Buffer.from(await audioResponse.arrayBuffer());
69
+ if (!audioBuffer.length) throw new Error("Bailian subscription TTS returned empty audio");
70
+ const mime = inline ? void 0 : audioResponse.headers.get("content-type")?.split(";")[0]?.trim();
71
+ if (mime && !mime.startsWith("audio/") && mime !== "application/octet-stream") throw new Error("Bailian subscription TTS returned an unsupported audio content type");
72
+ const magic = audioBuffer.subarray(0, 4).toString("ascii");
73
+ const format = magic === "RIFF" ? "wav" : magic === "fLaC" ? "flac" : magic === "OggS" ? "ogg" : mime === "audio/wav" || mime === "audio/x-wav" ? "wav" : "mp3";
74
+ return {
75
+ audioBuffer,
76
+ outputFormat: format,
77
+ fileExtension: format,
78
+ voiceCompatible: false
79
+ };
80
+ }
81
+ };
82
+ registerSpeechProvider(bailianPlanSpeechProvider);
83
+ //#endregion
84
+ export { bailianPlanSpeechProvider };
@@ -13,6 +13,7 @@
13
13
  */
14
14
  export { openAiSpeechProvider, OPENAI_TTS_MODELS, OPENAI_TTS_VOICES } from './openai-speech.js';
15
15
  export { alibabaSpeechProvider } from './alibaba-speech.js';
16
+ export { bailianPlanSpeechProvider } from './bailian-plan-speech.js';
16
17
  export { edgeSpeechProvider } from './edge-speech.js';
17
18
  export { xopcCloudSpeechProvider } from './xopc-cloud-speech.js';
18
19
  export { minimaxSpeechProvider, MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, } from './minimax-speech.js';
@@ -1,6 +1,7 @@
1
1
  import { OPENAI_TTS_MODELS, OPENAI_TTS_VOICES, openAiSpeechProvider } from "./openai-speech.js";
2
2
  import { alibabaSpeechProvider } from "./alibaba-speech.js";
3
+ import { bailianPlanSpeechProvider } from "./bailian-plan-speech.js";
3
4
  import { edgeSpeechProvider } from "./edge-speech.js";
4
5
  import { xopcCloudSpeechProvider } from "./xopc-cloud-speech.js";
5
6
  import { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, minimaxSpeechProvider } from "./minimax-speech.js";
6
- export { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, OPENAI_TTS_MODELS, OPENAI_TTS_VOICES, alibabaSpeechProvider, edgeSpeechProvider, minimaxSpeechProvider, openAiSpeechProvider, xopcCloudSpeechProvider };
7
+ export { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, OPENAI_TTS_MODELS, OPENAI_TTS_VOICES, alibabaSpeechProvider, bailianPlanSpeechProvider, edgeSpeechProvider, minimaxSpeechProvider, openAiSpeechProvider, xopcCloudSpeechProvider };
@@ -1,10 +1,12 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
+ import { assertProviderUsage, init_model_usage, isProviderUsageScopeError } from "../../providers/model-usage.js";
3
4
  import { parseTtsDirectives } from "./directives.js";
4
5
  import { resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
5
6
  import { preprocessText } from "./preprocess.js";
6
7
  import { summarizeForTts } from "./summarize.js";
7
8
  //#region src/voice/tts/speak-core.ts
9
+ init_model_usage();
8
10
  init_logger();
9
11
  const log = createLogger("TTS");
10
12
  /** Pulls the override bucket for a given provider id from the directive overrides. */
@@ -147,6 +149,7 @@ async function speak(text, config, options) {
147
149
  provider: resolved.providerId
148
150
  }, "Converting text to speech");
149
151
  const request = buildSynthesisRequest(resolved, prepared.text, prepared.ttsOptions, prepared.directiveOverrides, options?.appConfig, "audio-file", options?.signal);
152
+ assertProviderUsage(resolved.providerId, resolved.providerConfig?.baseUrl);
150
153
  const result = await resolved.plugin.synthesize(request);
151
154
  const durationSeconds = (Date.now() - startTime) / 1e3;
152
155
  attempts.push({
@@ -177,6 +180,7 @@ async function speak(text, config, options) {
177
180
  wasSummarized: prepared.wasSummarized
178
181
  };
179
182
  } catch (error) {
183
+ if (isProviderUsageScopeError(error)) throw error;
180
184
  const latencyMs = Date.now() - startTime;
181
185
  const reasonCode = classifyError(error);
182
186
  const errorMsg = error instanceof Error ? error.message : String(error);
@@ -211,6 +215,7 @@ async function speakWithProvider(text, config, providerName, options) {
211
215
  const prepared = await prepareTextForSynthesis(text, config, options);
212
216
  const startTime = Date.now();
213
217
  const request = buildSynthesisRequest(resolved, prepared.text, prepared.ttsOptions, prepared.directiveOverrides, options?.appConfig, "audio-file", options?.signal);
218
+ assertProviderUsage(resolved.providerId, resolved.providerConfig?.baseUrl);
214
219
  return {
215
220
  ...toTtsResult(resolved, await resolved.plugin.synthesize(request), (Date.now() - startTime) / 1e3),
216
221
  attempts: [{
@@ -242,6 +247,7 @@ async function speakStream(text, config, options) {
242
247
  options?.signal?.throwIfAborted();
243
248
  try {
244
249
  const baseRequest = buildSynthesisRequest(resolved, prepared.text, prepared.ttsOptions, prepared.directiveOverrides, options?.appConfig, "voice-note", options?.signal);
250
+ assertProviderUsage(resolved.providerId, resolved.providerConfig?.baseUrl);
245
251
  let streamResult;
246
252
  if (typeof resolved.plugin.synthesizeStream === "function") streamResult = await resolved.plugin.synthesizeStream(baseRequest);
247
253
  else if (typeof resolved.plugin.synthesize === "function") streamResult = wrapBufferAsStream(await resolved.plugin.synthesize(baseRequest));
@@ -269,6 +275,7 @@ async function speakStream(text, config, options) {
269
275
  wasSummarized: prepared.wasSummarized
270
276
  };
271
277
  } catch (error) {
278
+ if (isProviderUsageScopeError(error)) throw error;
272
279
  options?.signal?.throwIfAborted();
273
280
  lastError = error instanceof Error ? error : new Error(String(error));
274
281
  log.warn({
@@ -298,8 +305,10 @@ function prepareSpeechStreamSession(config, options) {
298
305
  if (!config.enabled) return void 0;
299
306
  const resolved = resolveSpeechProvider(config.provider, config);
300
307
  if (!resolved?.plugin.openStreamSession) return void 0;
308
+ const request = buildSynthesisRequest(resolved, "", options.tts, void 0, options.appConfig, "voice-note", options.signal);
309
+ assertProviderUsage(resolved.providerId, resolved.providerConfig?.baseUrl);
301
310
  const sessionRequest = {
302
- ...buildSynthesisRequest(resolved, "", options.tts, void 0, options.appConfig, "voice-note", options.signal),
311
+ ...request,
303
312
  signal: options.signal ?? new AbortController().signal
304
313
  };
305
314
  return resolved.plugin.openStreamSession(sessionRequest).then((session) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xopcai/xopc",
3
- "version": "0.0.389",
3
+ "version": "0.0.390",
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",
@@ -171,11 +171,11 @@
171
171
  "vue": "^3.5.35",
172
172
  "xlsx": "file:web/vendor/xlsx-0.20.3.tgz",
173
173
  "@xopcai/browser-control-contract": "0.1.0",
174
- "@xopcai/computer-control-contract": "0.1.0",
175
- "@xopcai/endpoint-tools-client": "0.0.0",
176
174
  "@xopcai/endpoint-tools-protocol": "0.0.0",
177
- "@xopcai/image-providers": "0.1.0",
175
+ "@xopcai/endpoint-tools-client": "0.0.0",
176
+ "@xopcai/computer-control-contract": "0.1.0",
178
177
  "@xopcai/gateway-contract": "0.0.0",
178
+ "@xopcai/image-providers": "0.1.0",
179
179
  "@xopcai/realtime-client": "0.0.0",
180
180
  "@xopcai/realtime-protocol": "0.0.0"
181
181
  },
@@ -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{_ as i,t as a}from"./chunk-KS7C4IRE--EKdQGRF.js";import{t as o}from"./popover-select-DHC7J4lG.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-0WouolD0.js";import{c as f,n as p}from"./locale-store-Dr43FCty.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-aIC072nz.js";import{r as _}from"./gateway-config-swr-Bc2MytsF.js";import{n as v,t as y}from"./registry-api-BD5IgDOA.js";import{t as b}from"./skeleton-BI5TyibZ.js";import{t as x}from"./electron-env-Dit0bHgy.js";import{$r as te,Cn as S,Hc as C,Ho as w,Ms as T,W as ne,Wc as E,Xr as D,_n as O,ec as k,es as re,v as A,vn as j,zo as M}from"./index-CmC8JkSM.js";import{t as ie}from"./number-input-DDeqHK-G.js";import{n as N,r as ae}from"./settings-page-layout-Dx5S-Msc.js";import{n as P,t as F}from"./use-autosave-CzyqRffr.js";import{s as I}from"./voice-config-api-DnIjZm_9.js";import{t as L}from"./fallback-models-CoyzvDo7.js";import{r as oe}from"./image-generation-api-BZBiYDmV.js";var se=e(t(),1),ce=n(),R=r(),z={"xopc-cloud":`XOPC Cloud`,alibaba:`Alibaba Cloud`,edge:`Microsoft Edge`,groq:`Groq`,minimax:`MiniMax`,openai:`OpenAI`};function B(e,t,n){let r=e?.[t]?.[n];return typeof r==`string`&&r.trim()?r.trim():void 0}function le(e){return z[e]??e}function V(e){let t=(0,ce.c)(17),{icon:n,label:r,enabled:i,details:a,zh:o}=e,s;t[0]===n?s=t[1]:(s=(0,R.jsx)(`div`,{className:`rounded-lg bg-accent/10 p-2 text-accent`,children:(0,R.jsx)(n,{className:`size-4`,"aria-hidden":!0})}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,R.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,R.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,R.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,R.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,R.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,R.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 H(e){let t=(0,ce.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:I(s);let e=d?B(d.stt.providers,d.stt.provider,`model`):void 0,n=d?B(d.tts.providers,d.tts.provider,`model`):void 0,r=d?B(d.tts.providers,d.tts.provider,`voice`):void 0;l=d?[le(d.stt.provider),e].filter(Boolean).join(` · `):void 0,u=d?[le(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,R.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,R.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,R.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,R.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t[11]=x):x=t[11];let te;t[12]===y?te=t[13]:(te=(0,R.jsx)(ee,{asChild:!0,variant:`secondary`,className:`shrink-0`,children:(0,R.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,R.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 w;t[17]!==i||t[18]!==o||t[19]!==l||t[20]!==f||t[21]!==d||t[22]!==n?(w=o||!d?i?(0,R.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,R.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,R.jsx)(b,{className:`h-20 rounded-xl`}),(0,R.jsx)(b,{className:`h-20 rounded-xl`})]}):(0,R.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,R.jsx)(V,{icon:c,label:n?`语音转文字(STT)`:`Speech to text (STT)`,enabled:d.stt.enabled,details:l,zh:n}),(0,R.jsx)(V,{icon:C,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]=w):w=t[23];let T;return t[24]!==S||t[25]!==w?(T=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[S,w]}),t[24]=S,t[25]=w,t[26]=T):T=t[26],T}var U=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],W=`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`,G={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 K(e,t){return{primary:t,fallbacks:e?.fallbacks??[]}}function ue(e){let t=(0,ce.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`,oe,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(q),t[6]=d,t[7]=f);let p=f,m=i?G.zh:G.en,h;t[8]!==n||t[9]!==r?(h=(e,t)=>{let i={...n.models.intents};t?i[e]=K(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,R.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,R.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,R.jsxs)(`div`,{children:[x,S]}),t[15]=S,t[16]=x,t[17]=C):C=t[17];let w=i?`主模型`:`Primary model`,T;t[18]===w?T=t[19]:(T=(0,R.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:w}),t[18]=w,t[19]=T);let E=i?`选择模型`:`Select a model`,O=i?`搜索模型或服务商`:`Search models or providers`,k=i?`没有匹配的模型`:`No matching models`,re=i?`默认对话模型`:`Default conversation model`,A;t[20]!==n||t[21]!==r?(A=e=>r({...n,models:{...n.models,chat:{...n.models.chat,primary:e}}}),t[20]=n,t[21]=r,t[22]=A):A=t[22];let j;t[23]!==n.models.chat.primary||t[24]!==E||t[25]!==O||t[26]!==k||t[27]!==re||t[28]!==A?(j=(0,R.jsx)(D,{value:n.models.chat.primary,placeholder:E,searchPlaceholder:O,noMatches:k,showProviderSettingsFooter:!0,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:re,onChange:A}),t[23]=n.models.chat.primary,t[24]=E,t[25]=O,t[26]=k,t[27]=re,t[28]=A,t[29]=j):j=t[29];let M;t[30]!==T||t[31]!==j?(M=(0,R.jsxs)(`div`,{className:`mt-5 max-w-xl`,children:[T,j]}),t[30]=T,t[31]=j,t[32]=M):M=t[32];let N=i?`模型回退`:`Model fallbacks`,ae=i?`已配置 ${n.models.chat.fallbacks.length} 个备用模型;主模型选择仍在上方。`:`${n.models.chat.fallbacks.length} fallback models configured.`,P;t[33]!==n||t[34]!==r?(P=e=>r({...n,models:{...n.models,chat:{...n.models.chat,fallbacks:e}}}),t[33]=n,t[34]=r,t[35]=P):P=t[35];let F;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]!==P||t[42]!==i?(F=(0,R.jsx)(`div`,{className:`mt-6 rounded-xl bg-surface-base/45 p-4`,children:(0,R.jsx)(L,{primary:n.models.chat.primary,value:n.models.chat.fallbacks,models:u,loading:o.isLoading,error:o.error,zh:i,onChange:P})}),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]=P,t[42]=i,t[43]=F):F=t[43];let I;t[44]!==N||t[45]!==ae||t[46]!==F?(I=(0,R.jsx)(ne,{title:N,summary:ae,children:F}),t[44]=N,t[45]=ae,t[46]=F,t[47]=I):I=t[47];let se;t[48]!==C||t[49]!==M||t[50]!==I?(se=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[C,M,I]}),t[48]=C,t[49]=M,t[50]=I,t[51]=se):se=t[51];let z=i?`图片能力`:`Image capabilities`,B;t[52]===z?B=t[53]:(B=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[52]=z,t[53]=B);let le=i?`没有图片任务时可以保持关闭。`:`Leave these off when the agents do not work with images.`,V;t[54]===le?V=t[55]:(V=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:le}),t[54]=le,t[55]=V);let ue=i?`图片理解模型`:`Image understanding model`,J;t[56]===ue?J=t[57]:(J=(0,R.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:ue}),t[56]=ue,t[57]=J);let Y=n.models.imageUnderstanding?.primary??``,X=i?`关闭图片理解`:`Image understanding off`,Z=i?`搜索视觉模型`:`Search vision models`,de=i?`没有可用的视觉模型`:`No vision models available`,Q=i?`关闭图片理解`:`Image understanding off`,fe=i?`图片理解模型`:`Image understanding model`,$;t[58]!==n||t[59]!==r?($=e=>{let t={...n.models};e?t.imageUnderstanding=K(t.imageUnderstanding,e):delete t.imageUnderstanding,r({...n,models:t})},t[58]=n,t[59]=r,t[60]=$):$=t[60];let pe;t[61]!==Y||t[62]!==X||t[63]!==Z||t[64]!==de||t[65]!==Q||t[66]!==fe||t[67]!==$?(pe=(0,R.jsx)(D,{value:Y,placeholder:X,searchPlaceholder:Z,noMatches:de,capabilitiesFilter:`vision`,allowEmpty:!0,emptyLabel:Q,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:fe,onChange:$}),t[61]=Y,t[62]=X,t[63]=Z,t[64]=de,t[65]=Q,t[66]=fe,t[67]=$,t[68]=pe):pe=t[68];let me;t[69]!==J||t[70]!==pe?(me=(0,R.jsxs)(`div`,{children:[J,pe]}),t[69]=J,t[70]=pe,t[71]=me):me=t[71];let he=i?`图片生成模型`:`Image generation model`,ge;t[72]===he?ge=t[73]:(ge=(0,R.jsx)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:he}),t[72]=he,t[73]=ge);let _e=n.models.imageGeneration?.primary??``,ve=i?`关闭图片生成`:`Image generation off`,ye=i?`搜索图片模型或服务商`:`Search image models or providers`,be=i?`没有可用的图片生成模型`:`No image generation models available`,xe=i?`关闭图片生成`:`Image generation off`,Se=i?`图片生成模型`:`Image generation model`,Ce;t[74]!==n||t[75]!==r?(Ce=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]=Ce):Ce=t[76];let we;t[77]!==p||t[78]!==c.error||t[79]!==c.isLoading||t[80]!==_e||t[81]!==ve||t[82]!==ye||t[83]!==be||t[84]!==xe||t[85]!==Se||t[86]!==Ce?(we=(0,R.jsx)(D,{value:_e,models:p,modelsLoading:c.isLoading,modelsError:c.error,placeholder:ve,searchPlaceholder:ye,noMatches:be,allowEmpty:!0,emptyLabel:xe,contentAlign:`start`,className:`mt-2 w-full`,ariaLabel:Se,onChange:Ce}),t[77]=p,t[78]=c.error,t[79]=c.isLoading,t[80]=_e,t[81]=ve,t[82]=ye,t[83]=be,t[84]=xe,t[85]=Se,t[86]=Ce,t[87]=we):we=t[87];let Te;t[88]!==ge||t[89]!==we?(Te=(0,R.jsxs)(`div`,{children:[ge,we]}),t[88]=ge,t[89]=we,t[90]=Te):Te=t[90];let Ee;t[91]!==me||t[92]!==Te?(Ee=(0,R.jsxs)(`div`,{className:`mt-5 grid gap-5 lg:grid-cols-2`,children:[me,Te]}),t[91]=me,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==n||t[95]!==r||t[96]!==i?(De=n.models.imageGeneration?(0,R.jsx)(ne,{title:i?`图片执行策略`:`Image execution policy`,summary:i?`当前超时与回退策略继续生效。`:`The current timeout and fallback policy remains active.`,children:(0,R.jsxs)(`div`,{className:`mt-5 grid gap-4 rounded-xl bg-surface-base/45 p-4 sm:grid-cols-2`,children:[(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[i?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,className:`${W} 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,R.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,R.jsx)(`span`,{children:i?`服务商自动回退`:`Automatic provider fallback`}),(0,R.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:[!0,!1].map(e=>(0,R.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]=De):De=t[97];let Oe;t[98]!==B||t[99]!==V||t[100]!==Ee||t[101]!==De?(Oe=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[B,V,Ee,De]}),t[98]=B,t[99]=V,t[100]=Ee,t[101]=De,t[102]=Oe):Oe=t[102];let ke;t[103]===i?ke=t[104]:(ke=(0,R.jsx)(H,{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,R.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,R.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=U.map(e=>(0,R.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 p-4`,children:[(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:m[e][0]}),(0,R.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:m[e][1]})]}),(0,R.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,R.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,R.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,R.jsx)(ne,{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]!==se||t[128]!==Oe||t[129]!==ke||t[130]!==ze?(Be=(0,R.jsxs)(`div`,{className:`space-y-5`,children:[se,Oe,ke,ze]}),t[127]=se,t[128]=Oe,t[129]=ke,t[130]=ze,t[131]=Be):Be=t[131],Be}function q(e){return e.models.map(t=>({id:`${e.id}/${t}`,name:t,provider:e.label}))}var J=`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 Y(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function X({draft:e,setDraft:t,zh:n}){let[r,i]=(0,se.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?m(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,se.useState)(!1);return(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,R.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${J} 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,R.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 Z(e){let t=(0,ce.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`,A,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(de),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,R.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,R.jsx)(X,{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,R.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,R.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 w=i?`Codemode 读取试点`:`Codemode read pilot`,T;t[23]===w?T=t[24]:(T=(0,R.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:w}),t[23]=w,t[24]=T);let E=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,D;t[25]===E?D=t[26]:(D=(0,R.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:E}),t[25]=E,t[26]=D);let O;t[27]!==T||t[28]!==D?(O=(0,R.jsxs)(`span`,{children:[T,D]}),t[27]=T,t[28]=D,t[29]=O):O=t[29];let k;t[30]!==C||t[31]!==O?(k=(0,R.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[C,O]})}),t[30]=C,t[31]=O,t[32]=k):k=t[32];let re=i?`执行限制`:`Execution limits`,j;t[33]===re?j=t[34]:(j=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:re}),t[33]=re,t[34]=j);let M=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,N;t[35]===M?N=t[36]:(N=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:M}),t[35]=M,t[36]=N);let ae=i?`每次运行最多轮数`:`Maximum turns per run`,P=n.runtime.maxTurns??``,F=i?`系统默认`:`System default`,I;t[37]!==n||t[38]!==r?(I=e=>r({...n,runtime:{...n.runtime,maxTurns:Y(e.target.value)}}),t[37]=n,t[38]=r,t[39]=I):I=t[39];let L;t[40]!==P||t[41]!==F||t[42]!==I?(L=(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,value:P,placeholder:F,onChange:I,className:`${J} mt-2`}),t[40]=P,t[41]=F,t[42]=I,t[43]=L):L=t[43];let oe;t[44]!==ae||t[45]!==L?(oe=(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[ae,L]}),t[44]=ae,t[45]=L,t[46]=oe):oe=t[46];let se=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,z=n.runtime.timeoutMs??``,B=i?`系统默认`:`System default`,le;t[47]!==n||t[48]!==r?(le=e=>r({...n,runtime:{...n.runtime,timeoutMs:Y(e.target.value)}}),t[47]=n,t[48]=r,t[49]=le):le=t[49];let V;t[50]!==z||t[51]!==B||t[52]!==le?(V=(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,value:z,placeholder:B,onChange:le,className:`${J} mt-2`}),t[50]=z,t[51]=B,t[52]=le,t[53]=V):V=t[53];let H;t[54]!==se||t[55]!==V?(H=(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[se,V]}),t[54]=se,t[55]=V,t[56]=H):H=t[56];let U=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,W=n.runtime.maxToolFailuresPerTurn??``,G=i?`系统默认`:`System default`,K;t[57]!==n||t[58]!==r?(K=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:Y(e.target.value)}}),t[57]=n,t[58]=r,t[59]=K):K=t[59];let ue;t[60]!==W||t[61]!==G||t[62]!==K?(ue=(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,value:W,placeholder:G,onChange:K,className:`${J} mt-2`}),t[60]=W,t[61]=G,t[62]=K,t[63]=ue):ue=t[63];let q;t[64]!==U||t[65]!==ue?(q=(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[U,ue]}),t[64]=U,t[65]=ue,t[66]=q):q=t[66];let Z;t[67]!==oe||t[68]!==H||t[69]!==q?(Z=(0,R.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[oe,H,q]}),t[67]=oe,t[68]=H,t[69]=q,t[70]=Z):Z=t[70];let Q;t[71]!==j||t[72]!==N||t[73]!==Z?(Q=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[j,N,Z]}),t[71]=j,t[72]=N,t[73]=Z,t[74]=Q):Q=t[74];let fe=i?`提示词缓存`:`Prompt cache`,$;t[75]===fe?$=t[76]:($=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:fe}),t[75]=fe,t[76]=$);let pe=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,me;t[77]===pe?me=t[78]:(me=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:pe}),t[77]=pe,t[78]=me);let he=i?`缓存模式`:`Cache mode`,ge;t[79]===he?ge=t[80]:(ge=(0,R.jsx)(`span`,{children:he}),t[79]=he,t[80]=ge);let _e;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(_e=[`auto`,`off`],t[81]=_e):_e=t[81];let ve;t[82]!==n||t[83]!==r||t[84]!==i?(ve=(0,R.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:_e.map(e=>(0,R.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]=ve):ve=t[85];let ye;t[86]!==ge||t[87]!==ve?(ye=(0,R.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[ge,ve]}),t[86]=ge,t[87]=ve,t[88]=ye):ye=t[88];let be;t[89]!==n||t[90]!==r||t[91]!==i?(be=n.runtime.promptCache?.mode===`auto`?(0,R.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,R.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,R.jsx)(`div`,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,children:[`short`,`long`].map(e=>(0,R.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]=be):be=t[92];let xe;t[93]!==ye||t[94]!==be?(xe=(0,R.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[ye,be]}),t[93]=ye,t[94]=be,t[95]=xe):xe=t[95];let Se;t[96]!==$||t[97]!==me||t[98]!==xe?(Se=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[$,me,xe]}),t[96]=$,t[97]=me,t[98]=xe,t[99]=Se):Se=t[99];let Ce;t[100]!==x||t[101]!==k||t[102]!==Q||t[103]!==Se||t[104]!==b?(Ce=(0,R.jsxs)(ne,{title:b,summary:x,children:[k,Q,Se]}),t[100]=x,t[101]=k,t[102]=Q,t[103]=Se,t[104]=b,t[105]=Ce):Ce=t[105];let we=i?`工作流`:`Workflows`,Te;t[106]===we?Te=t[107]:(Te=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:we}),t[106]=we,t[107]=Te);let Ee=i?`设置默认工作流,并决定智能体可以调用哪些工作流。`:`Set a default workflow and control which workflows agents may invoke.`,De;t[108]===Ee?De=t[109]:(De=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:Ee}),t[108]=Ee,t[109]=De);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,R.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,R.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,R.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,R.jsx)(ne,{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,R.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,R.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,R.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,R.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,R.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,R.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,R.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,R.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,R.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,R.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,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-surface-hover/60`,children:[(0,R.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,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title||e.name}),e.description?(0,R.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.description}):null]})]},e.id)),(s.data??[]).length===0&&!s.isLoading?(0,R.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,R.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]!==Te||t[177]!==De||t[178]!==ze||t[179]!==Be||t[180]!==st?(ct=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[Te,De,ze,Be,st]}),t[176]=Te,t[177]=De,t[178]=ze,t[179]=Be,t[180]=st,t[181]=ct):ct=t[181];let lt;return t[182]!==Ce||t[183]!==y||t[184]!==ct?(lt=(0,R.jsxs)(`div`,{className:`space-y-5`,children:[y,Ce,ct]}),t[182]=Ce,t[183]=y,t[184]=ct,t[185]=lt):lt=t[185],lt}function de(e){return{value:e.id,label:e.title||e.name}}function Q(e){return[...new Set(e)].sort()}var fe=[{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 $(e){let t=(0,ce.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,se.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(_e));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(ge),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):Q([...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):Q([...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 C=S.length,w;t[19]!==o?.catalog||t[20]!==n||t[21]!==r?(w=e=>{let t=new Set((o?.catalog??[]).filter(he).map(me));r({...n,skills:{mode:`selected`,include:Q(e.filter(e=>t.has(e)))}})},t[19]=o?.catalog,t[20]=n,t[21]=r,t[22]=w):w=t[22];let ne=w,E=i?`技能策略`:`Skill policy`,D;t[23]===E?D=t[24]:(D=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:E}),t[23]=E,t[24]=D);let O=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,k;t[25]===O?k=t[26]:(k=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:O}),t[25]=O,t[26]=k);let re;t[27]!==n||t[28]!==r?(re=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=re):re=t[29];let A=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,j;t[30]===A?j=t[31]:(j=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`,A),t[30]=A,t[31]=j);let M;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,R.jsx)(s,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=M):M=t[32];let ie=i?`使用所有已启用技能`:`Use every enabled skill`,N;t[33]===ie?N=t[34]:(N=(0,R.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:ie}),t[33]=ie,t[34]=N);let ae=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,P;t[35]===ae?P=t[36]:(P=(0,R.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:ae}),t[35]=ae,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,R.jsxs)(`span`,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let I;t[40]!==re||t[41]!==j||t[42]!==F?(I=(0,R.jsxs)(`button`,{type:`button`,onClick:re,className:j,children:[M,F]}),t[40]=re,t[41]=j,t[42]=F,t[43]=I):I=t[43];let L;t[44]!==n||t[45]!==r?(L=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=L):L=t[46];let oe=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,z;t[47]===oe?z=t[48]:(z=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`,oe),t[47]=oe,t[48]=z);let B;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,R.jsx)(T,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=B):B=t[49];let le=i?`只使用选中的技能`:`Use selected skills only`,V;t[50]===le?V=t[51]:(V=(0,R.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:le}),t[50]=le,t[51]=V);let H=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,U;t[52]===H?U=t[53]:(U=(0,R.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:H}),t[52]=H,t[53]=U);let W;t[54]!==V||t[55]!==U?(W=(0,R.jsxs)(`span`,{children:[V,U]}),t[54]=V,t[55]=U,t[56]=W):W=t[56];let G;t[57]!==L||t[58]!==z||t[59]!==W?(G=(0,R.jsxs)(`button`,{type:`button`,onClick:L,className:z,children:[B,W]}),t[57]=L,t[58]=z,t[59]=W,t[60]=G):G=t[60];let K;t[61]!==I||t[62]!==G?(K=(0,R.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[I,G]}),t[61]=I,t[62]=G,t[63]=K):K=t[63];let ue=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,q;t[64]===ue?q=t[65]:(q=(0,R.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:ue}),t[64]=ue,t[65]=q);let J;t[66]!==ne||t[67]!==o||t[68]!==i?(J=fe.map(e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>ne(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]=ne,t[67]=o,t[68]=i,t[69]=J):J=t[69];let Y;t[70]===J?Y=t[71]:(Y=(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:J}),t[70]=J,t[71]=Y);let X;t[72]!==q||t[73]!==Y?(X=(0,R.jsxs)(`div`,{className:`mt-4`,children:[q,Y]}),t[72]=q,t[73]=Y,t[74]=X):X=t[74];let Z;t[75]!==k||t[76]!==K||t[77]!==X||t[78]!==D?(Z=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[D,k,K,X]}),t[75]=k,t[76]=K,t[77]=X,t[78]=D,t[79]=Z):Z=t[79];let de=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,$;t[80]===de?$=t[81]:($=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:de}),t[80]=de,t[81]=$);let ve=i?`当前默认可用 ${C} 个技能。`:`${C} skills are available by default.`,ye;t[82]===ve?ye=t[83]:(ye=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ve}),t[82]=ve,t[83]=ye);let be;t[84]!==$||t[85]!==ye?(be=(0,R.jsxs)(`div`,{children:[$,ye]}),t[84]=$,t[85]=ye,t[86]=be):be=t[86];let xe=i?`搜索技能`:`Search skills`,Se;t[87]===xe?Se=t[88]:(Se=(0,R.jsx)(`span`,{className:`sr-only`,children:xe}),t[87]=xe,t[88]=Se);let Ce;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,R.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[89]=Ce):Ce=t[89];let we;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>p(e.target.value),t[90]=we):we=t[90];let Te=i?`搜索技能`:`Search skills`,Ee;t[91]!==f||t[92]!==Te?(Ee=(0,R.jsx)(`input`,{type:`search`,value:f,onChange:we,placeholder:Te,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]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==Se||t[95]!==Ee?(De=(0,R.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[Se,Ce,Ee]}),t[94]=Se,t[95]=Ee,t[96]=De):De=t[96];let Oe;t[97]!==be||t[98]!==De?(Oe=(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[be,De]}),t[97]=be,t[98]=De,t[99]=Oe):Oe=t[99];let ke;t[100]===c?ke=t[101]:(ke=c?(0,R.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,R.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(pe)}):(0,R.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,R.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,R.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,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,R.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,R.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,R.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,R.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]!==Z||t[113]!==je?(Me=(0,R.jsxs)(`div`,{className:`space-y-5`,children:[Z,je]}),t[112]=Z,t[113]=je,t[114]=Me):Me=t[114],Me}function pe(e){return(0,R.jsx)(b,{className:`h-14 rounded-xl`},e)}function me(e){return e.name}function he(e){return e.enabled}function ge(e,t){return e.name.localeCompare(t.name)}function _e(e){return e.name}function ve(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function ye(e){let t=(0,ce.c)(98),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,o=S(),[s,c]=(0,se.useState)(``),[u,f]=(0,se.useState)(`all`),[p,m]=(0,se.useState)(),h;t[0]===i?h=t[1]:(h=new Map(i.map(Se)),t[0]=i,t[1]=h);let g=h,_;t[2]!==i||t[3]!==n.tools?(_=[...new Set([...i.map(xe),...Object.keys(n.tools)])].filter(be).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 w;t[20]!==y.length||t[21]!==x.length||t[22]!==C.length?(w={allow:b,ask:te,deny:C.length},t[20]=y.length,t[21]=x.length,t[22]=C.length,t[23]=w):w=t[23];let T=w,E;if(t[24]!==v||t[25]!==g||t[26]!==n.tools||t[27]!==u||t[28]!==s){let e=s.trim().toLowerCase();E=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]=E}else E=t[29];let D=E,O;t[30]!==n||t[31]!==r?(O=(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]=O):O=t[32];let k=O,re=a?`全部 ${v.length}`:`All ${v.length}`,A;t[33]===re?A=t[34]:(A={id:`all`,label:re},t[33]=re,t[34]=A);let j=a?`允许 ${T.allow}`:`Allow ${T.allow}`,N;t[35]===j?N=t[36]:(N={id:`allow`,label:j},t[35]=j,t[36]=N);let ae=a?`询问 ${T.ask}`:`Ask ${T.ask}`,P;t[37]===ae?P=t[38]:(P={id:`ask`,label:ae},t[37]=ae,t[38]=P);let F=a?`禁用 ${T.deny}`:`Deny ${T.deny}`,I;t[39]===F?I=t[40]:(I={id:`deny`,label:F},t[39]=F,t[40]=I);let L;t[41]!==A||t[42]!==N||t[43]!==P||t[44]!==I?(L=[A,N,P,I],t[41]=A,t[42]=N,t[43]=P,t[44]=I,t[45]=L):L=t[45];let oe=L,z=a?`默认工具权限`:`Default tool permissions`,B;t[46]===z?B=t[47]:(B=(0,R.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[46]=z,t[47]=B);let le=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,V;t[48]===le?V=t[49]:(V=(0,R.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:le}),t[48]=le,t[49]=V);let H;t[50]!==B||t[51]!==V?(H=(0,R.jsxs)(`div`,{children:[B,V]}),t[50]=B,t[51]=V,t[52]=H):H=t[52];let U;t[53]!==u||t[54]!==oe?(U=(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,children:oe.map(e=>(0,R.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]=oe,t[55]=U):U=t[55];let W=a?`搜索工具`:`Search tools`,G;t[56]===W?G=t[57]:(G=(0,R.jsx)(`span`,{className:`sr-only`,children:W}),t[56]=W,t[57]=G);let K;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,R.jsx)(l,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[58]=K):K=t[58];let ue;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>c(e.target.value),t[59]=ue):ue=t[59];let q=a?`搜索工具`:`Search tools`,J;t[60]!==s||t[61]!==q?(J=(0,R.jsx)(`input`,{type:`search`,value:s,onChange:ue,placeholder:q,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]=q,t[62]=J):J=t[62];let Y;t[63]!==G||t[64]!==J?(Y=(0,R.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[G,K,J]}),t[63]=G,t[64]=J,t[65]=Y):Y=t[65];let X;t[66]!==U||t[67]!==Y?(X=(0,R.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[U,Y]}),t[66]=U,t[67]=Y,t[68]=X):X=t[68];let Z=a?`工具调用限制`:`Tool call limits`,de=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,Q;t[69]!==Z||t[70]!==de?(Q=(0,R.jsx)(ne,{title:Z,summary:de,children:null}),t[69]=Z,t[70]=de,t[71]=Q):Q=t[71];let fe;if(t[72]!==g||t[73]!==n.tools||t[74]!==p||t[75]!==o||t[76]!==k||t[77]!==D||t[78]!==a){let e;t[80]!==g||t[81]!==n.tools||t[82]!==p||t[83]!==o||t[84]!==k||t[85]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=g.get(e),i=p===e;return(0,R.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`flex rounded-lg bg-surface-base p-1`,children:[`allow`,`ask`,`deny`].map(n=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>k(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,R.jsx)(ee,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>m(i?void 0:e),children:(0,R.jsx)(M,{className:`size-4`})}):null]})]}),i&&o?(0,R.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>k(e,{maxCallsPerTurn:ve(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,R.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,R.jsx)(ie,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>k(e,{timeoutMs:ve(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]=k,t[85]=a,t[86]=e):e=t[86],fe=D.map(e),t[72]=g,t[73]=n.tools,t[74]=p,t[75]=o,t[76]=k,t[77]=D,t[78]=a,t[79]=fe}else fe=t[79];let $;t[87]!==D.length||t[88]!==a?($=D.length===0?(0,R.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[87]=D.length,t[88]=a,t[89]=$):$=t[89];let pe;t[90]!==fe||t[91]!==$?(pe=(0,R.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:[fe,$]}),t[90]=fe,t[91]=$,t[92]=pe):pe=t[92];let me;return t[93]!==H||t[94]!==X||t[95]!==Q||t[96]!==pe?(me=(0,R.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[H,X,Q,pe]}),t[93]=H,t[94]=X,t[95]=Q,t[96]=pe,t[97]=me):me=t[97],me}function be(e){return e!==`computer_use`||x()}function xe(e){return e.id}function Se(e){return[e.id,e.description]}function Ce(){let e=(0,ce.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsxs)(ae,{gap:`gap-5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(b,{className:`h-7 w-56`}),(0,R.jsx)(b,{className:`h-4 w-96 max-w-full`})]}),(0,R.jsx)(b,{className:`h-9 w-28`})]}),(0,R.jsx)(b,{className:`h-20 rounded-2xl`}),(0,R.jsx)(b,{className:`h-12 rounded-xl`}),(0,R.jsx)(b,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function we(e){let t=(0,ce.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,se.useState)(h),v;t[7]===n?v=t[8]:(v=()=>structuredClone(n),t[7]=n,t[8]=v);let[y,b]=(0,se.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 ne=a?`技能`:`Skills`,E;t[15]===ne?E=t[16]:(E={id:`skills`,label:ne,icon:re},t[15]=ne,t[16]=E);let D=a?`工具`:`Tools`,O;t[17]===D?O=t[18]:(O={id:`tools`,label:D,icon:w},t[17]=D,t[18]=O);let A=a?`运行`:`Runtime`,M;t[19]===A?M=t[20]:(M={id:`runtime`,label:A,icon:k},t[19]=A,t[20]=M);let ie;t[21]!==E||t[22]!==O||t[23]!==M||t[24]!==T?(ie=[T,E,O,M],t[21]=E,t[22]=O,t[23]=M,t[24]=T,t[25]=ie):ie=t[25];let I=ie,L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=async e=>{let t=structuredClone(e),n=await j(t),r=structuredClone(n.defaults);_(e=>JSON.stringify(e)===JSON.stringify(t)?r:e),b(structuredClone(r))},t[26]=L):L=t[26];let oe=L,z;t[27]!==S||t[28]!==g?(z={value:g,dirty:S,onSave:oe,delayMs:0},t[27]=S,t[28]=g,t[29]=z):z=t[29];let B=F(z),le=B.onBlurCapture,V=a?`智能体设置`:`Agent settings`,H;t[30]!==B.error||t[31]!==B.status?(H=(0,R.jsx)(P,{status:B.status,error:B.error}),t[30]=B.error,t[31]=B.status,t[32]=H):H=t[32];let U;t[33]!==V||t[34]!==H?(U=(0,R.jsx)(N,{title:V,actions:H}),t[33]=V,t[34]=H,t[35]=U):U=t[35];let W;t[36]!==B.error||t[37]!==B.retry||t[38]!==a?(W=B.error?(0,R.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,R.jsx)(`span`,{children:B.error}),(0,R.jsx)(ee,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:B.retry,children:a?`重试`:`Retry`})]}):null,t[36]=B.error,t[37]=B.retry,t[38]=a,t[39]=W):W=t[39];let G=a?`默认配置分区`:`Default configuration sections`,K;t[40]!==f||t[41]!==m||t[42]!==I?(K=I.map(e=>{let{id:t,label:n,icon:r}=e;return(0,R.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,R.jsx)(r,{className:d(`size-4 shrink-0`,f===t?`text-accent`:`text-fg-subtle`)}),(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[40]=f,t[41]=m,t[42]=I,t[43]=K):K=t[43];let q;t[44]!==G||t[45]!==K?(q=(0,R.jsx)(`nav`,{className:`grid grid-cols-2 gap-1 rounded-xl bg-surface-hover/20 p-1 lg:grid-cols-4`,"aria-label":G,children:K}),t[44]=G,t[45]=K,t[46]=q):q=t[46];let J;t[47]!==f||t[48]!==g||t[49]!==a?(J=f===`models`?(0,R.jsx)(ue,{draft:g,setDraft:_,zh:a}):null,t[47]=f,t[48]=g,t[49]=a,t[50]=J):J=t[50];let Y;t[51]!==f||t[52]!==g||t[53]!==a?(Y=f===`skills`?(0,R.jsx)($,{draft:g,setDraft:_,zh:a}):null,t[51]=f,t[52]=g,t[53]=a,t[54]=Y):Y=t[54];let X;t[55]!==f||t[56]!==r||t[57]!==g||t[58]!==a?(X=f===`tools`?(0,R.jsx)(ye,{draft:g,setDraft:_,builtinTools:r,zh:a}):null,t[55]=f,t[56]=r,t[57]=g,t[58]=a,t[59]=X):X=t[59];let de;t[60]!==f||t[61]!==g||t[62]!==a?(de=f===`runtime`?(0,R.jsx)(Z,{draft:g,setDraft:_,zh:a}):null,t[60]=f,t[61]=g,t[62]=a,t[63]=de):de=t[63];let Q;return t[64]!==B.onBlurCapture||t[65]!==U||t[66]!==W||t[67]!==q||t[68]!==J||t[69]!==Y||t[70]!==X||t[71]!==de?(Q=(0,R.jsxs)(ae,{gap:`gap-5`,onBlurCapture:le,children:[U,W,q,J,Y,X,de]}),t[64]=B.onBlurCapture,t[65]=U,t[66]=W,t[67]=q,t[68]=J,t[69]=Y,t[70]=X,t[71]=de,t[72]=Q):Q=t[72],Q}function Te(){let e=(0,ce.c)(17),t=f(De),n=p(Ee)===`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,R.jsx)(ae,{children:(0,R.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,R.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,R.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,R.jsxs)(ae,{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,R.jsx)(Ce,{}),e[12]=t):t=e[12],t}let s;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(s=(0,R.jsx)(we,{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 Ee(e){return e.language}function De(e){return e.conversationId}export{Te as AgentDefaultsSettingsPanel};
@@ -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{t as ee}from"./chunk-KS7C4IRE--EKdQGRF.js";import{t as i}from"./circle-check-C23XjkUj.js";import{t as a}from"./folder-open-CyzJ19I9.js";import{t as o}from"./loader-circle-CifKLtgG.js";import{t as s}from"./messages-DlTNQI92.js";import{t as c}from"./cn-0WouolD0.js";import{a as l,n as te,r as u}from"./locale-store-Dr43FCty.js";import{a as d,i as f,o as p,r as ne,s as m,t as re}from"./dist-BGTk37IG.js";import{a as h}from"./vendor-swr-BIWyz7Rc.js";import{t as g}from"./button-aIC072nz.js";import{Ac as _,Ho as v,di as y,uc as b,yo as x}from"./index-CmC8JkSM.js";var S=n(),C=e(t(),1),w=r(),T=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function E(e,t){if(e.startsWith(`content.skills:`)){let n=e.slice(15);return t?`提供技能:${n}`:`Add skill: ${n}`}if(e.startsWith(`runtime.mcp.stdio:`)){let n=e.slice(18).split(`:`,1)[0];return t?`在本机运行工具服务:${n}`:`Run a local tool service: ${n}`}if(e.startsWith(`network.mcp:`)){let n=e.slice(12).split(`:`,1)[0];return t?`连接外部工具服务:${n}`:`Connect to an external tool service: ${n}`}return e}function D(e,t){return t?.publisher?.verification!==`verified`||t.latestVersion.riskTier&&t.latestVersion.riskTier!==`content`?!0:e.addedCapabilities.some(e=>!e.startsWith(`content.skills:`))}async function O(e,t,n){let r=await l(u(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function k(e){let t=(0,S.c)(49),{pluginId:n,server:r,enabled:ee}=e,i=te(ie),a;t[0]===i?a=t[1]:(a=i.startsWith(`zh`),t[0]=i,t[1]=a);let o=a,[s,c]=(0,C.useState)(``),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)(``),[p,ne]=(0,C.useState)(r.type===`stdio`?`API_KEY`:`Authorization`),[m,re]=(0,C.useState)(r.type===`stdio`?``:`Bearer `),h;t[2]!==r.name||t[3]!==r.type?(h=(0,w.jsxs)(`p`,{className:`font-medium`,children:[r.name,` · `,r.type]}),t[2]=r.name,t[3]=r.type,t[4]=h):h=t[4];let _=r.type===`stdio`?`xopc mcp list`:`xopc mcp login ${r.id}`,v;t[5]===_?v=t[6]:(v=(0,w.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-fg-muted`,children:_}),t[5]=_,t[6]=v);let y;t[7]!==p||t[8]!==n||t[9]!==m||t[10]!==s||t[11]!==r.name||t[12]!==r.type||t[13]!==o?(y=e=>{e.preventDefault(),u(!0),f(``),O(`/api/extensions/agent-plugins/${encodeURIComponent(n)}/mcp/${encodeURIComponent(r.name)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:r.type===`stdio`?`env`:`headers`,key:p,value:s,prefix:m}]}).then(()=>{c(``),f(o?`已保存`:`Saved`)}).catch(e=>f(String(e))).finally(()=>u(!1))},t[7]=p,t[8]=n,t[9]=m,t[10]=s,t[11]=r.name,t[12]=r.type,t[13]=o,t[14]=y):y=t[14];let b=o?`字段名`:`Field name`,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>ne(e.target.value),t[15]=x):x=t[15];let E;t[16]===p?E=t[17]:(E=(0,w.jsx)(`input`,{className:T,value:p,onChange:x,required:!0}),t[16]=p,t[17]=E);let D;t[18]!==b||t[19]!==E?(D=(0,w.jsxs)(`label`,{className:`block`,children:[b,E]}),t[18]=b,t[19]=E,t[20]=D):D=t[20];let k=o?`前缀`:`Prefix`,A;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>re(e.target.value),t[21]=A):A=t[21];let j;t[22]===m?j=t[23]:(j=(0,w.jsx)(`input`,{className:T,value:m,onChange:A}),t[22]=m,t[23]=j);let M;t[24]!==k||t[25]!==j?(M=(0,w.jsxs)(`label`,{className:`block`,children:[k,j]}),t[24]=k,t[25]=j,t[26]=M):M=t[26];let ae=o?`密钥`:`Secret`,N;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>c(e.target.value),t[27]=N):N=t[27];let P;t[28]===s?P=t[29]:(P=(0,w.jsx)(`input`,{type:`password`,autoComplete:`off`,className:T,value:s,onChange:N,required:!0}),t[28]=s,t[29]=P);let F;t[30]!==ae||t[31]!==P?(F=(0,w.jsxs)(`label`,{className:`block`,children:[ae,P]}),t[30]=ae,t[31]=P,t[32]=F):F=t[32];let I=!ee||l||!s,L=o?`保存密钥`:`Save API key`,R;t[33]!==I||t[34]!==L?(R=(0,w.jsx)(g,{type:`submit`,disabled:I,children:L}),t[33]=I,t[34]=L,t[35]=R):R=t[35];let z;t[36]!==D||t[37]!==M||t[38]!==F||t[39]!==R||t[40]!==y?(z=(0,w.jsxs)(`form`,{className:`mt-3 space-y-2`,onSubmit:y,children:[D,M,F,R]}),t[36]=D,t[37]=M,t[38]=F,t[39]=R,t[40]=y,t[41]=z):z=t[41];let B;t[42]===d?B=t[43]:(B=d?(0,w.jsx)(`p`,{className:`mt-2 text-fg-muted`,children:d}):null,t[42]=d,t[43]=B);let V;return t[44]!==z||t[45]!==B||t[46]!==h||t[47]!==v?(V=(0,w.jsxs)(`div`,{className:`rounded-lg border border-edge p-3 text-sm`,children:[h,v,z,B]}),t[44]=z,t[45]=B,t[46]=h,t[47]=v,t[48]=V):V=t[48],V}function ie(e){return e.language}function A({extension:e,onClose:t,initialSource:n=``,marketplace:r,autoInstall:l=!1}){let u=te(e=>e.language),S=u.startsWith(`zh`),ie=r?.localizations?.[S?`zh-CN`:`en`],A=ie?.displayName??r?.name,j=ie?.description??r?.description,M=(0,C.useId)(),{mutate:ae}=h(),[N,P]=(0,C.useState)(e),[F,I]=(0,C.useState)(n),[L,R]=(0,C.useState)(null),[z,B]=(0,C.useState)(!1),[V,H]=(0,C.useState)(``),[oe,se]=(0,C.useState)(!1),[ce,le]=(0,C.useState)(!1),[ue,de]=(0,C.useState)(!1),[fe,U]=(0,C.useState)(!1),[pe,W]=(0,C.useState)(!1),[G,me]=(0,C.useState)(!1),[he,ge]=(0,C.useState)(!1),_e=(0,C.useRef)(!1),K=`/api/extensions/agent-plugins/${encodeURIComponent(N?.pluginId??``)}`,q=F.trim().startsWith(`store:`),J=()=>ae(`gateway-extensions-list`);async function Y(e){B(!0),H(``);try{await e()}catch(e){H(e instanceof Error?e.message:String(e))}finally{B(!1)}}function X(e){I(e),R(null),H(``)}let Z=typeof window<`u`?window.electronAPI?.file:void 0,Q=/^(?:\/|[A-Za-z]:[\\/])/.test(F.trim())?F.trim():void 0;async function ve(){if(!Z?.openDirectory){W(!0);return}let e=await Z.openDirectory(Q?{defaultPath:Q}:void 0);e&&X(e)}async function ye(){if(!Z?.openFile){W(!0);return}let e=await Z.openFile({...Q?{defaultPath:Q}:{},extensions:[`zip`]});e&&X(e)}function be(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function xe(e){if(!be(e))return;e.preventDefault(),U(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){H(S?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=Z?.getPathForFile?.(t[0]);e?X(e):H(S?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`The browser cannot read local file paths. Use Choose file or folder to select the package.`);return}let n=e.dataTransfer.getData(`text/uri-list`)||e.dataTransfer.getData(`text/plain`);n.trim()&&X(n.trim().split(/\r?\n/)[0])}async function Se(e){P(await O(`${K}/activation`,`POST`,{enabled:e})),await J()}async function Ce(e){let t=!N,n=await O(t?`/api/extensions/install`:`${K}/update`,`POST`,{source:F,reviewHash:e.reviewHash});P(n),await J(),t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await O(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),P(n),await J()),R(null),ge(t&&n.activationEligible===!0)}async function we(){let e=await O(`/api/extensions/inspect`,`POST`,{source:F});if(D(e,r)){R(e);return}await Ce(e)}(0,C.useEffect)(()=>{e&&P(e)},[e]),(0,C.useEffect)(()=>{!l||N||!q||_e.current||(_e.current=!0,Y(we))},[l,N,q]);let Te=l&&!N&&q&&!_e.current,$=N?.components;return(0,w.jsx)(re,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,w.jsxs)(p,{children:[(0,w.jsx)(d,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,w.jsxs)(ne,{className:`fixed left-1/2 top-1/2 z-[131] flex h-[min(76vh,30rem)] w-[min(34rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,w.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,w.jsx)(m,{className:`font-semibold`,children:N?.name??A??(S?`安装 Agent Plugin`:`Install Agent Plugin`)}),(0,w.jsx)(g,{variant:`ghost`,onClick:t,children:S?`关闭`:`Close`})]}),(0,w.jsx)(f,{className:`sr-only`,children:S?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,w.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[!N&&q?(0,w.jsxs)(`section`,{className:`space-y-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:A??L?.manifest.name??F.slice(6)}),j?(0,w.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:j}):null,(0,w.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:r?.publisher?.verification===`verified`?S?`已认证发布者 · 安装后自动启用`:`Verified publisher · enabled automatically after installation`:S?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),L?null:(0,w.jsxs)(g,{className:`w-full`,disabled:z||Te,onClick:()=>void Y(we),children:[z||Te?(0,w.jsx)(o,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,z||Te?S?`正在安全检查并安装…`:`Checking and installing…`:S?`一键安装`:`Install`]})]}):null,N?(0,w.jsxs)(w.Fragment,{children:[he?(0,w.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-4`,children:[(0,w.jsx)(i,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:S?`插件已安装并启用`:`Plugin installed and enabled`}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:S?`现在可以直接在对话中使用它。`:`It is ready to use in your conversations.`})]})]}):null,N.activationEligible?null:(0,w.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium text-accent-fg`,children:S?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:S?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,w.jsx)(g,{disabled:z||N.readiness===`blocked`,onClick:()=>void Y(()=>Se(!0)),children:S?`启用插件`:`Enable plugin`})]}),(0,w.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[`Agent Plugin · `,N.version,` · `,N.readiness&&{ready:S?`已就绪`:`Ready`,setup_required:S?`待连接`:`Setup required`,degraded:S?`部分不可用`:`Partially available`,blocked:S?`已阻止`:`Blocked`}[N.readiness]]}),N.provenance?(0,w.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[N.provenance.publisherVerification===`verified`?S?`已认证发布者`:`Verified publisher`:S?`社区发布者`:`Community publisher`,` · `,N.provenance.packageName,`@`,N.provenance.version,` · SHA-256 `,N.provenance.sha256.slice(0,12),`…`,N.provenance.riskTier?` · ${N.provenance.riskTier}`:``]}):null,(0,w.jsx)(`p`,{className:`text-sm`,children:N.description}),N.activationEligible?(0,w.jsx)(g,{disabled:z,variant:`secondary`,onClick:()=>void Y(()=>Se(!1)),children:S?`停用`:`Disable`}):null,N.canRollback?(0,w.jsx)(g,{disabled:z,variant:`secondary`,onClick:()=>void Y(async()=>{P(await O(`${K}/rollback`,`POST`)),await J()}),children:S?`回滚上一版本`:`Roll back`}):null,$?.skills.length||$?.mcp.length?(0,w.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge p-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-sm font-medium`,children:S?`此插件提供的能力`:`Capabilities from this plugin`}),$.skills.length?(0,w.jsxs)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:[`Skills: `,$.skills.map(e=>e.name).join(`, `)]}):null,$.mcp.length?(0,w.jsxs)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:[`MCP: `,$.mcp.map(e=>e.name).join(`, `)]}):null]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[$.skills.length?(0,w.jsx)(g,{asChild:!0,variant:`secondary`,children:(0,w.jsx)(ee,{to:`/capabilities/skills?source=plugin`,children:S?`管理技能`:`Manage skills`})}):null,$.mcp.length?(0,w.jsx)(g,{asChild:!0,variant:`secondary`,children:(0,w.jsx)(ee,{to:`/capabilities/connectors?tab=connected`,children:S?`管理连接`:`Manage connections`})}):null]})]}):null,N.components?.mcp.length?(0,w.jsxs)(`details`,{className:`group rounded-lg border border-edge p-3`,children:[(0,w.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,w.jsx)(`span`,{children:S?`连接与密钥(按需)`:`Connections and API keys (as needed)`}),(0,w.jsx)(_,{className:`size-4 text-fg-muted transition-transform group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,w.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:S?`仅当工具服务提示登录或缺少密钥时设置。`:`Only configure this when a tool service asks you to sign in or provide a key.`}),(0,w.jsx)(`div`,{className:`mt-3 space-y-3`,children:N.components.mcp.map(e=>(0,w.jsx)(k,{pluginId:N.pluginId,server:e,enabled:N.active},e.id))})]}):null,N.diagnostics?.map((e,t)=>(0,w.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,q&&N?(0,w.jsxs)(g,{variant:`ghost`,className:`px-0`,"aria-expanded":G,onClick:()=>me(e=>!e),children:[(0,w.jsx)(_,{className:c(`size-4 transition-transform motion-reduce:transition-none`,G&&`rotate-180`),"aria-hidden":!0}),S?`高级操作`:`Advanced actions`]}):null,!q||G?(0,w.jsxs)(`form`,{className:c(`space-y-3`,N&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),Y(async()=>{R(await O(`/api/extensions/inspect`,`POST`,{source:F}))})},children:[(0,w.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:c(`rounded-xl border border-dashed p-3 transition-colors`,fe?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{be(e)&&(e.preventDefault(),U(!0))},onDragOver:e=>{be(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,U(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||U(!1)},onDrop:xe,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,w.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:M,className:`block text-sm font-medium`,children:N?S?`更新包来源`:`Update package source`:S?`安装包来源`:`Package source`}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:S?`拖入插件目录或 ZIP,也可输入 HTTPS ZIP 或 store:包名`:`Drop a plugin directory or ZIP, or enter an HTTPS ZIP or store:package`})]})]}),(0,w.jsx)(`input`,{id:M,className:T,value:F,onChange:e=>X(e.target.value),placeholder:S?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,w.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Z?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(g,{type:`button`,variant:`secondary`,disabled:z,onClick:()=>void Y(ve),children:[(0,w.jsx)(a,{className:`size-4`,"aria-hidden":!0}),S?`选择目录`:`Choose directory`]}),(0,w.jsxs)(g,{type:`button`,variant:`secondary`,disabled:z,onClick:()=>void Y(ye),children:[(0,w.jsx)(b,{className:`size-4`,"aria-hidden":!0}),S?`选择 ZIP`:`Choose ZIP`]})]}):(0,w.jsxs)(g,{type:`button`,variant:`secondary`,disabled:z,onClick:()=>W(!0),children:[(0,w.jsx)(a,{className:`size-4`,"aria-hidden":!0}),S?`选择文件或目录`:`Choose file or folder`]})})]}),(0,w.jsx)(g,{type:`submit`,variant:`secondary`,disabled:z||!F,children:S?`检查安装包`:`Inspect package`})]}):null,L?(0,w.jsxs)(`div`,{role:`region`,"aria-labelledby":`plugin-authorization-title`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,w.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:S?`需要你的授权`:`Your authorization is required`}),(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:S?`此插件需要以下新增能力。确认后会自动完成安装并启用。`:`This plugin requests the capabilities below. After approval, installation and activation continue automatically.`})]})]}),(0,w.jsx)(`ul`,{className:`space-y-2 rounded-lg border border-edge bg-surface-panel p-3 break-words`,children:L.addedCapabilities.map(e=>(0,w.jsxs)(`li`,{className:`flex gap-2`,children:[(0,w.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,w.jsx)(`span`,{children:E(e,S)})]},e))}),L.diagnostics.map((e,t)=>(0,w.jsxs)(`p`,{children:[e.component,`: `,e.message]},t)),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsxs)(g,{disabled:z||!!N&&L.manifest.name!==N.pluginId,onClick:()=>void Y(()=>Ce(L)),children:[z?(0,w.jsx)(o,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,S?`授权并安装`:`Authorize and install`]}),(0,w.jsx)(g,{variant:`ghost`,disabled:z,onClick:()=>R(null),children:S?`取消`:`Cancel`})]})]}):null,N&&(!q||G)?(0,w.jsx)(`div`,{className:`border-t border-edge pt-4`,children:ue?(0,w.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,w.jsx)(`p`,{children:S?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,w.jsxs)(`label`,{className:`flex gap-2`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:oe,onChange:e=>se(e.target.checked)}),S?`同时删除插件数据`:`Also delete plugin data`]}),(0,w.jsxs)(`label`,{className:`flex gap-2`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:ce,onChange:e=>le(e.target.checked)}),S?`同时删除本地凭据`:`Also delete local credentials`]}),(0,w.jsx)(g,{disabled:z,onClick:()=>void Y(async()=>{await O(K,`DELETE`,{removeData:oe,removeCredentials:ce}),await J(),t()}),children:S?`确认卸载`:`Confirm uninstall`})]}):(0,w.jsx)(g,{variant:`ghost`,disabled:z,onClick:()=>de(!0),children:S?`卸载插件`:`Uninstall`})}):null,V?(0,w.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:V}):null]})]}),Z?null:(0,w.jsx)(y,{open:pe,onOpenChange:W,initialAbsolutePath:Q,onConfirm:async e=>X(e),wd:s(u).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:S?`选择插件安装包`:`Choose plugin package`,description:S?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:S?`使用此来源`:`Use this source`,nested:!0})]})})}export{k as n,A as t};