@xopcai/xopc 0.0.419 → 0.0.421

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 (610) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
  3. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  4. package/dist/extensions/telegram/src/inbound-processor.js +2 -2
  5. package/dist/extensions/telegram/src/outbound-sender.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +2 -2
  7. package/dist/extensions/telegram/xopc.extension.json +1 -1
  8. package/dist/extensions/weixin/src/api/api.js +2 -2
  9. package/dist/extensions/weixin/src/auth/accounts.js +12 -12
  10. package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
  11. package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
  12. package/dist/gateway/static/root/assets/{activity-store-DnqOM8GN.js → activity-store-CKrylgib.js} +1 -1
  13. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-1UABT2KS.js → agent-avatar-dicebear-Dv5Rda4y.js} +1 -1
  14. package/dist/gateway/static/root/assets/agent-avatar-display-B1ycycx2.js +2 -0
  15. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-D285zy0S.js +1 -0
  16. package/dist/gateway/static/root/assets/agent-plugin-dialog-D3yCqVan.js +1 -0
  17. package/dist/gateway/static/root/assets/{agents-O7mago-m.js → agents-DyAuR3rG.js} +5 -5
  18. package/dist/gateway/static/root/assets/{agents-admin-api-CyjykMEh.js → agents-admin-api-CASGzvkW.js} +1 -1
  19. package/dist/gateway/static/root/assets/{api-C1dxxDZx.js → api-C4LxuNzq.js} +1 -1
  20. package/dist/gateway/static/root/assets/{api-Ddrs70xV.js → api-Uk05lF9i.js} +1 -1
  21. package/dist/gateway/static/root/assets/app-management-settings-panel-CDnZNKHt.js +1 -0
  22. package/dist/gateway/static/root/assets/appearance-settings-CmCF7PZ5.js +1 -0
  23. package/dist/gateway/static/root/assets/apps-page-BR9qoA2P.js +1 -0
  24. package/dist/gateway/static/root/assets/{archive-plugin-n5lPr79c.js → archive-plugin-nuHYYVty.js} +1 -1
  25. package/dist/gateway/static/root/assets/automation-api-DtJfd1QM.js +1 -0
  26. package/dist/gateway/static/root/assets/automation-display-BlGt8MAC.js +2 -0
  27. package/dist/gateway/static/root/assets/automation-task-card-Cp3RIw5d.js +2 -0
  28. package/dist/gateway/static/root/assets/{automations-page-oLsNzu_6.js → automations-page-DM4IdUJh.js} +1 -1
  29. package/dist/gateway/static/root/assets/automations-workspace-CXLu04I-.js +9 -0
  30. package/dist/gateway/static/root/assets/{binary-plugins-D9VW7dWP.js → binary-plugins-CHCAr8jt.js} +1 -1
  31. package/dist/gateway/static/root/assets/{block-editor-C477bTtO.js → block-editor-B0v8KxsO.js} +4 -4
  32. package/dist/gateway/static/root/assets/{browser-automation-inputs-CCiYXxmh.js → browser-automation-inputs-DjUW7PEB.js} +1 -1
  33. package/dist/gateway/static/root/assets/browser-automations-page-Cf8AoQz1.js +3 -0
  34. package/dist/gateway/static/root/assets/{browser-control-api-Y3fvmeBk.js → browser-control-api-C6NZgaA1.js} +1 -1
  35. package/dist/gateway/static/root/assets/{browser-settings-page-DjkGahlz.js → browser-settings-page-DV2FNEDf.js} +2 -2
  36. package/dist/gateway/static/root/assets/{capabilities-DAyA681v.js → capabilities-CwdjWz2r.js} +1 -1
  37. package/dist/gateway/static/root/assets/{capabilities-DRVXLssH.js → capabilities-D0-HCZ5J.js} +1 -1
  38. package/dist/gateway/static/root/assets/capabilities-page-DwDkritH.js +2 -0
  39. package/dist/gateway/static/root/assets/capabilities-settings-panel-mme16Fbp.js +8 -0
  40. package/dist/gateway/static/root/assets/channels-lKFLu8p-.js +1 -0
  41. package/dist/gateway/static/root/assets/{chat-agents-api-D5nR_JVe.js → chat-agents-api-l80cvSac.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-chart-block-K2t333qv.js → chat-chart-block-BwP5QXEk.js} +1 -1
  43. package/dist/gateway/static/root/assets/chat-page-CT3K7lFT.js +71 -0
  44. package/dist/gateway/static/root/assets/{chat-terminal-dock-CkFG6mA3.js → chat-terminal-dock-D2bV9YUL.js} +2 -2
  45. package/dist/gateway/static/root/assets/{list-filter-COkzTdOz.js → clipboard-copy-DuJk5WD6.js} +1 -1
  46. package/dist/gateway/static/root/assets/{command-palette-api-Do_66X1B.js → command-palette-api-CtapG8ck.js} +1 -1
  47. package/dist/gateway/static/root/assets/composer-payload-handoff-DYuhKZRC.js +1 -0
  48. package/dist/gateway/static/root/assets/{computer-settings-page-DBxOcMko.js → computer-settings-page-DZtMuihL.js} +1 -1
  49. package/dist/gateway/static/root/assets/connected-providers-grid-BQH5k3iC.js +1 -0
  50. package/dist/gateway/static/root/assets/{connector-service-page-rWpnchb3.js → connector-service-page-DrvFdP3G.js} +1 -1
  51. package/dist/gateway/static/root/assets/{connectors-api-DIBG72k4.js → connectors-api-BzkgVBYC.js} +1 -1
  52. package/dist/gateway/static/root/assets/connectors-page-BtRNVCFy.js +1 -0
  53. package/dist/gateway/static/root/assets/{date-picker-CE-cZFCU.js → date-picker-ByTasrfl.js} +1 -1
  54. package/dist/gateway/static/root/assets/{dependency-picker-7SpSfDSg.js → dependency-picker-Dh8hPmsT.js} +1 -1
  55. package/dist/gateway/static/root/assets/desktop-pet-CFz8bqyI.js +1 -0
  56. package/dist/gateway/static/root/assets/desktop-pet-settings-COaboNn1.js +1 -0
  57. package/dist/gateway/static/root/assets/{dev-view-store-57HgVuZ6.js → dev-view-store-D8XYHVqG.js} +1 -1
  58. package/dist/gateway/static/root/assets/device-pairing-wizard-BKMpLdIA.js +1 -0
  59. package/dist/gateway/static/root/assets/{directory-picker-path-field-D4jMhpka.js → directory-picker-path-field-Cjv7rdo3.js} +1 -1
  60. package/dist/gateway/static/root/assets/discussion-annotation-sync-YvlVw17j.js +1 -0
  61. package/dist/gateway/static/root/assets/{dist-DNCdG_qB.js → dist-D3lWNSe7.js} +1 -1
  62. package/dist/gateway/static/root/assets/{extension-debug-page-BsK2LMXQ.js → extension-debug-page-CXx3m5-B.js} +1 -1
  63. package/dist/gateway/static/root/assets/extension-iframe-host-CnOdNwbo.js +1 -0
  64. package/dist/gateway/static/root/assets/{extension-marketplace-api-CVJPqJOB.js → extension-marketplace-api-BABmUY2s.js} +1 -1
  65. package/dist/gateway/static/root/assets/extension-page-C1nGr4DD.js +1 -0
  66. package/dist/gateway/static/root/assets/{extension-provider-Byrd8Sor.js → extension-provider-BA0Y2Rvs.js} +1 -1
  67. package/dist/gateway/static/root/assets/extension-settings-page-QIPI8e7k.js +1 -0
  68. package/dist/gateway/static/root/assets/{file-preview-surface-BlprUrIs.js → file-preview-surface-BsB7bnFH.js} +1 -1
  69. package/dist/gateway/static/root/assets/{gateway-config-swr-BAmUhiP1.js → gateway-config-swr-Bt8w0Iio.js} +1 -1
  70. package/dist/gateway/static/root/assets/{gateway-realtime-CsykKL4l.js → gateway-realtime-CyCCNUxm.js} +1 -1
  71. package/dist/gateway/static/root/assets/gateway-realtime-store-0gmDfPeP.js +1 -0
  72. package/dist/gateway/static/root/assets/gateway-restart-Ty4AzDxa.js +1 -0
  73. package/dist/gateway/static/root/assets/{gateway-settings-BA5-Uuwx.js → gateway-settings-BvKq7vuz.js} +1 -1
  74. package/dist/gateway/static/root/assets/{gateway-startup-retry-CtUB3g6N.js → gateway-startup-retry-N3k-C7c2.js} +1 -1
  75. package/dist/gateway/static/root/assets/{global-defaults-api-CINf-C6a.js → global-defaults-api-D8EB2vfY.js} +1 -1
  76. package/dist/gateway/static/root/assets/home-page-eRuAzi58.js +2 -0
  77. package/dist/gateway/static/root/assets/image-generation-api-C99Fsofm.js +1 -0
  78. package/dist/gateway/static/root/assets/{imports-page-BWShtGRQ.js → imports-page-Cp9RquVb.js} +1 -1
  79. package/dist/gateway/static/root/assets/index-6vVrWfwM.js +11 -0
  80. package/dist/gateway/static/root/assets/index-DDGK6klk.css +1 -0
  81. package/dist/gateway/static/root/assets/install-connector-dialog-CsoAidXp.js +1 -0
  82. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CdM4BQwp.js → keyboard-shortcuts-settings-DFhOP2aD.js} +1 -1
  83. package/dist/gateway/static/root/assets/list-filter-CIPvpfLA.js +1 -0
  84. package/dist/gateway/static/root/assets/local-app-workbench-page-DbtU_A-l.js +1 -0
  85. package/dist/gateway/static/root/assets/{local-apps-page-CxyRVfjD.js → local-apps-page-rjhHfLpe.js} +1 -1
  86. package/dist/gateway/static/root/assets/{local-session-drafts-B9ZPwotC.js → local-session-drafts-DHM4vWDO.js} +1 -1
  87. package/dist/gateway/static/root/assets/{locale-store-lIXD1FMw.js → locale-store-5Hf8J8-_.js} +1 -1
  88. package/dist/gateway/static/root/assets/logs-page-Dx_JIOpF.js +2 -0
  89. package/dist/gateway/static/root/assets/management-settings-CuSzixOw.js +1 -0
  90. package/dist/gateway/static/root/assets/{markdown-view-CJt-i2Dp.js → markdown-view-pzSRu7av.js} +3 -3
  91. package/dist/gateway/static/root/assets/{media-plugins-D_bR23mA.js → media-plugins-3cJuHbO7.js} +1 -1
  92. package/dist/gateway/static/root/assets/messages-uXxg5p54.js +3 -0
  93. package/dist/gateway/static/root/assets/model-selector-ksLo-5B_.js +1 -0
  94. package/dist/gateway/static/root/assets/{models-hub-cache-za2fWJLg.js → models-hub-cache-DhZng2nF.js} +1 -1
  95. package/dist/gateway/static/root/assets/navigation-D62kPsA9.js +1 -0
  96. package/dist/gateway/static/root/assets/note-detail-panel-B6RbjwJq.js +5 -0
  97. package/dist/gateway/static/root/assets/note-image-lightbox-BCjvBqwy.js +1 -0
  98. package/dist/gateway/static/root/assets/{notes-api-C_458rv5.js → notes-api-DocbsBbT.js} +1 -1
  99. package/dist/gateway/static/root/assets/notes-page-B7889s6-.js +8 -0
  100. package/dist/gateway/static/root/assets/{oauth-api-C3X9FLYw.js → oauth-api-CCFIPbA0.js} +1 -1
  101. package/dist/gateway/static/root/assets/{oauth-provider-connect-H81se_3n.js → oauth-provider-connect-GxkF0vWJ.js} +1 -1
  102. package/dist/gateway/static/root/assets/open-capability-settings-Cvb65hQB.js +1 -0
  103. package/dist/gateway/static/root/assets/{page-context-capture-button-BkAlQ7cB.js → page-context-capture-button-CvWLVeRA.js} +1 -1
  104. package/dist/gateway/static/root/assets/{page-context-draft-ClLgaOaD.js → page-context-draft-CMRDNv4d.js} +1 -1
  105. package/dist/gateway/static/root/assets/page-header-store-reh1es-3.js +1 -0
  106. package/dist/gateway/static/root/assets/{personal-avatar-BLtHt8fV.js → personal-avatar-CqNJ48Ge.js} +1 -1
  107. package/dist/gateway/static/root/assets/personal-page-D95FHaw9.js +1 -0
  108. package/dist/gateway/static/root/assets/personal-settings-panel-DAcl8DU4.js +1 -0
  109. package/dist/gateway/static/root/assets/{phone-dependencies-card-DISHarj8.js → phone-dependencies-card-DLWblGj7.js} +1 -1
  110. package/dist/gateway/static/root/assets/phone-model-picker-ugrT9GJu.js +1 -0
  111. package/dist/gateway/static/root/assets/phone-settings-page-DIIt7JOE.js +1 -0
  112. package/dist/gateway/static/root/assets/{phone-workspace-store-fhnZrgy_.js → phone-workspace-store-mawKT5kV.js} +1 -1
  113. package/dist/gateway/static/root/assets/plugin-details-dialog-BdueMT3q.js +1 -0
  114. package/dist/gateway/static/root/assets/popover-select-DD8fmrxH.js +1 -0
  115. package/dist/gateway/static/root/assets/preference-select-fields-CmLZNwbm.js +1 -0
  116. package/dist/gateway/static/root/assets/product-automation-feedback-DYwhL37Y.js +7 -0
  117. package/dist/gateway/static/root/assets/{product-open-page-xn9G4hSI.js → product-open-page-B5G4X71t.js} +1 -1
  118. package/dist/gateway/static/root/assets/{product-preview-content-DcoK-iZe.js → product-preview-content-BUheyLqt.js} +1 -1
  119. package/dist/gateway/static/root/assets/{product-preview-modal-Ruw9WSKK.js → product-preview-modal-Cj_Zxu4G.js} +2 -2
  120. package/dist/gateway/static/root/assets/project-detail-page-CRJb69vP.js +7 -0
  121. package/dist/gateway/static/root/assets/project-understanding-D3w8cZEm.js +1 -0
  122. package/dist/gateway/static/root/assets/projects-page-CkifzKjz.js +1 -0
  123. package/dist/gateway/static/root/assets/{providers-api-CzVkFKFg.js → providers-api-CKFg2PZQ.js} +1 -1
  124. package/dist/gateway/static/root/assets/{recording-upload-0jxahBMo.js → recording-upload-ZkmRf0GR.js} +1 -1
  125. package/dist/gateway/static/root/assets/{registry-api-n8TwtJ_j.js → registry-api-B1Mh3bNo.js} +1 -1
  126. package/dist/gateway/static/root/assets/{remote-access-hub-cZpBi4Rk.js → remote-access-hub-Dw5rG-aA.js} +1 -1
  127. package/dist/gateway/static/root/assets/resource-unavailable-BUWsH3fp.js +1 -0
  128. package/dist/gateway/static/root/assets/route-preload-CRKbVwQ1.js +2 -0
  129. package/dist/gateway/static/root/assets/runtime-impact-DbySfhdp.js +1 -0
  130. package/dist/gateway/static/root/assets/{runtime-tools-api-D-8KjYK6.js → runtime-tools-api-BXvn5ImA.js} +1 -1
  131. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-BALcypHp.js +1 -0
  132. package/dist/gateway/static/root/assets/schema-form-BKeP5G7b.js +1 -0
  133. package/dist/gateway/static/root/assets/service-recommendation-list-CpVUnz89.js +1 -0
  134. package/dist/gateway/static/root/assets/{session-api-CsCoI2im.js → session-api-VquhIBHI.js} +1 -1
  135. package/dist/gateway/static/root/assets/session-manager-DNMosCtW.js +23 -0
  136. package/dist/gateway/static/root/assets/sessions-page-DlvPkE5Y.js +1 -0
  137. package/dist/gateway/static/root/assets/settings-advanced-gate-Ckc1aCLG.js +1 -0
  138. package/dist/gateway/static/root/assets/{settings-advanced-section-BqoVSko2.js → settings-advanced-section-c9_iZ-46.js} +1 -1
  139. package/dist/gateway/static/root/assets/{settings-mode-store-CBsJ-Qg2.js → settings-mode-store-Dem6-TBe.js} +1 -1
  140. package/dist/gateway/static/root/assets/{settings-page-DROUGyJl.js → settings-page-B_wNfFQe.js} +1 -1
  141. package/dist/gateway/static/root/assets/{settings-page-header-Bv-kQFTm.js → settings-page-header-C8a_oOyw.js} +1 -1
  142. package/dist/gateway/static/root/assets/{settings-page-layout-DHP6MrrL.js → settings-page-layout-CTSRWljG.js} +1 -1
  143. package/dist/gateway/static/root/assets/setup-status-panel-BNZoqF40.js +1 -0
  144. package/dist/gateway/static/root/assets/{share-link-dialog-BJHRQVKC.js → share-link-dialog-C5JTTxsy.js} +1 -1
  145. package/dist/gateway/static/root/assets/share-preview-page-D-KxzXgm.js +2 -0
  146. package/dist/gateway/static/root/assets/{shares-api-rtWVHA_d.js → shares-api-CztKbxdd.js} +1 -1
  147. package/dist/gateway/static/root/assets/shares-settings-CzR21j6e.js +1 -0
  148. package/dist/gateway/static/root/assets/skill-api-B7kWl6LK.js +1 -0
  149. package/dist/gateway/static/root/assets/{skill-list-api-BzlKXPsE.js → skill-list-api-Cn07P6qZ.js} +1 -1
  150. package/dist/gateway/static/root/assets/{skill-reload-api-Cff2GgZb.js → skill-reload-api-Bhl0u16_.js} +1 -1
  151. package/dist/gateway/static/root/assets/skills-page-BmkuxHZe.js +2 -0
  152. package/dist/gateway/static/root/assets/{system-settings-panel-BeQeUUMH.js → system-settings-panel-Ce6zIcki.js} +1 -1
  153. package/dist/gateway/static/root/assets/task-detail-page-CysJhG3B.js +2 -0
  154. package/dist/gateway/static/root/assets/task-result-evidence-CGZKMnNo.js +1 -0
  155. package/dist/gateway/static/root/assets/{terminal-panel-store-5Fzctajw.js → terminal-panel-store-YwLUkuyV.js} +1 -1
  156. package/dist/gateway/static/root/assets/{theme-store-DW45fWYQ.js → theme-store-DOJ9tu-j.js} +1 -1
  157. package/dist/gateway/static/root/assets/tracing-settings-page-BplBpTdL.js +1 -0
  158. package/dist/gateway/static/root/assets/tunnel-api-B5-Ypvqa.js +1 -0
  159. package/dist/gateway/static/root/assets/{understanding-activity-store-CTe6TFB0.js → understanding-activity-store-CmwtE8Kd.js} +1 -1
  160. package/dist/gateway/static/root/assets/{understanding-refresh-store-mE9OKG6q.js → understanding-refresh-store-9apSmAVL.js} +1 -1
  161. package/dist/gateway/static/root/assets/usage-page-cPbirpXX.js +1 -0
  162. package/dist/gateway/static/root/assets/{use-autosave-Cs2Ga_Y_.js → use-autosave-B3p2QWaF.js} +1 -1
  163. package/dist/gateway/static/root/assets/use-composer-attachments-D-AEYC85.js +2 -0
  164. package/dist/gateway/static/root/assets/use-file-preview-expanded-CO4SC-LX.js +2 -0
  165. package/dist/gateway/static/root/assets/{use-personal-profile-BHL2AxWU.js → use-personal-profile-DocmhC9I.js} +1 -1
  166. package/dist/gateway/static/root/assets/{use-workspace-tree-CnmPZrpx.js → use-workspace-tree-VraTGKx-.js} +1 -1
  167. package/dist/gateway/static/root/assets/user-model-page-DuRALzhe.js +2 -0
  168. package/dist/gateway/static/root/assets/{voice-api-key-field-3gyc2UV3.js → voice-api-key-field-DbSQHZZW.js} +1 -1
  169. package/dist/gateway/static/root/assets/{voice-config-api-Cda2uBIC.js → voice-config-api-D9iNJSvm.js} +1 -1
  170. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DtYHsPLF.js → voice-input-shortcut-events-hso9_VvT.js} +1 -1
  171. package/dist/gateway/static/root/assets/voice-transcribe-api-BqIs0jgv.js +1 -0
  172. package/dist/gateway/static/root/assets/{work-discovery-overlay-Dqu5CQCS.js → work-discovery-overlay-fsL9RJqB.js} +1 -1
  173. package/dist/gateway/static/root/assets/work-discovery-page-DAQPKVDs.js +1 -0
  174. package/dist/gateway/static/root/assets/{working-directory-picker-modal-DHl2cZY1.js → working-directory-picker-modal-Ta73QrNw.js} +1 -1
  175. package/dist/gateway/static/root/assets/{workspace-api-CtDbI6T7.js → workspace-api-CgrcNyBc.js} +2 -2
  176. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Dw6wtadX.js +1 -0
  177. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-CTIbUfKb.js → workspace-file-preview-dialog-B7uBuPtA.js} +1 -1
  178. package/dist/gateway/static/root/assets/{workspace-open-location-menu-BwxouqdZ.js → workspace-open-location-menu-Bi2vRvaQ.js} +1 -1
  179. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CFb-23rS.js → xopc-cloud-account-card-CCOOBG-7.js} +1 -1
  180. package/dist/gateway/static/root/index.html +86 -81
  181. package/dist/package.js +1 -1
  182. package/dist/packages/gateway-contract/src/index.js +2 -0
  183. package/dist/packages/gateway-contract/src/task-display.js +14 -0
  184. package/dist/src/agent/agent-manager.js +18 -18
  185. package/dist/src/agent/agent-scope.js +2 -2
  186. package/dist/src/agent/background-review/prompts.js +1 -1
  187. package/dist/src/agent/background-review/run-background-review.js +13 -13
  188. package/dist/src/agent/child-agent-factory.js +2 -2
  189. package/dist/src/agent/coding/repository-instructions.js +1 -1
  190. package/dist/src/agent/context/coordinator.js +2 -2
  191. package/dist/src/agent/context/execution-context.js +4 -4
  192. package/dist/src/agent/context/execution-scope.js +10 -5
  193. package/dist/src/agent/context/project-context.js +3 -3
  194. package/dist/src/agent/data-acquisition/service.js +1 -1
  195. package/dist/src/agent/embedded/codemode-extension.js +1 -1
  196. package/dist/src/agent/embedded/execution-tool-policy.js +1 -1
  197. package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
  198. package/dist/src/agent/embedded/run-for-session.js +5 -5
  199. package/dist/src/agent/embedded/run-turn.js +15 -15
  200. package/dist/src/agent/embedded/session-runner.js +4 -4
  201. package/dist/src/agent/embedded/session-tool-result-guard.js +2 -2
  202. package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
  203. package/dist/src/agent/embedded/xopc-tools-bridge.js +1 -1
  204. package/dist/src/agent/external-tools/cliProvider.js +4 -4
  205. package/dist/src/agent/external-tools/composio-provider.js +4 -4
  206. package/dist/src/agent/external-tools/endpoint-provider.js +6 -6
  207. package/dist/src/agent/external-tools/extension-provider.js +1 -1
  208. package/dist/src/agent/external-tools/gateway-tools.js +3 -3
  209. package/dist/src/agent/external-tools/memory-provider.js +1 -1
  210. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  211. package/dist/src/agent/image/generation/runtime.js +1 -1
  212. package/dist/src/agent/image/index.js +1 -1
  213. package/dist/src/agent/image/load-image-media.js +1 -1
  214. package/dist/src/agent/inbound/attachment-pipeline.js +3 -3
  215. package/dist/src/agent/inbound/inbound-loop.js +2 -2
  216. package/dist/src/agent/independent-execution.js +1 -1
  217. package/dist/src/agent/index.js +3 -3
  218. package/dist/src/agent/mcp/connection-drafts.js +1 -1
  219. package/dist/src/agent/memory/context-budget.js +1 -1
  220. package/dist/src/agent/memory/context-recovery.js +1 -1
  221. package/dist/src/agent/memory/index.js +1 -1
  222. package/dist/src/agent/orchestration/llm-turn-retry.js +1 -1
  223. package/dist/src/agent/prompt/response-language.js +1 -1
  224. package/dist/src/agent/prompt/service-prompt-builder.js +4 -4
  225. package/dist/src/agent/prompt/system-prompt-params.js +1 -1
  226. package/dist/src/agent/sandbox/exec-policy.js +1 -1
  227. package/dist/src/agent/service/direct-turn-helpers.js +4 -4
  228. package/dist/src/agent/service/process-direct-streaming.js +7 -7
  229. package/dist/src/agent/service/webchat-tts.js +2 -2
  230. package/dist/src/agent/service.js +23 -23
  231. package/dist/src/agent/session/session-config-service.js +2 -2
  232. package/dist/src/agent/session/session-hydrator.js +1 -1
  233. package/dist/src/agent/session/session-inspector.js +1 -1
  234. package/dist/src/agent/skills/filesystem-watcher.js +1 -1
  235. package/dist/src/agent/skills/hub-lock.js +1 -1
  236. package/dist/src/agent/skills/hub-pull.js +2 -2
  237. package/dist/src/agent/skills/index.js +1 -1
  238. package/dist/src/agent/skills/managed-store.js +1 -1
  239. package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
  240. package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
  241. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  242. package/dist/src/agent/skills/skill-manager.js +1 -1
  243. package/dist/src/agent/skills/skill-sources.js +1 -1
  244. package/dist/src/agent/source-context/index.js +1 -1
  245. package/dist/src/agent/tasks/task-judge-service.js +8 -8
  246. package/dist/src/agent/tools/automation-tool.d.ts +2 -1
  247. package/dist/src/agent/tools/automation-tool.js +10 -3
  248. package/dist/src/agent/tools/create-share-tool.js +3 -3
  249. package/dist/src/agent/tools/dataBatch.js +1 -1
  250. package/dist/src/agent/tools/delegate-tool.js +3 -3
  251. package/dist/src/agent/tools/exec-command.js +1 -1
  252. package/dist/src/agent/tools/executor.js +1 -1
  253. package/dist/src/agent/tools/factory.js +19 -18
  254. package/dist/src/agent/tools/fetch-text.js +1 -1
  255. package/dist/src/agent/tools/image-generate-tool.js +3 -3
  256. package/dist/src/agent/tools/index.js +5 -5
  257. package/dist/src/agent/tools/list-dir.js +1 -1
  258. package/dist/src/agent/tools/personal-attention-tool.js +2 -2
  259. package/dist/src/agent/tools/personal-read-tool.js +2 -2
  260. package/dist/src/agent/tools/personal-request-result-tool.js +1 -1
  261. package/dist/src/agent/tools/personal-request-tool.js +4 -4
  262. package/dist/src/agent/tools/personal-result-tool.js +1 -1
  263. package/dist/src/agent/tools/personal-task-tool.js +7 -6
  264. package/dist/src/agent/tools/publish-artifacts.js +2 -2
  265. package/dist/src/agent/tools/read.js +2 -2
  266. package/dist/src/agent/tools/review-workspace.js +1 -1
  267. package/dist/src/agent/tools/send-media.js +1 -1
  268. package/dist/src/agent/tools/session-search-tool.js +1 -1
  269. package/dist/src/agent/tools/skills-tools.js +1 -1
  270. package/dist/src/agent/tools/task-collaboration-tool.js +2 -2
  271. package/dist/src/agent/tools/tts-tool.js +1 -1
  272. package/dist/src/agent/tools/user-context-tool.js +2 -2
  273. package/dist/src/agent/tools/web.js +1 -1
  274. package/dist/src/agent/tools/write.js +2 -2
  275. package/dist/src/agent/tools/xopc-use-tool.js +12 -10
  276. package/dist/src/agent/transcript/index.js +2 -2
  277. package/dist/src/agent/transcript/transcript-hygiene.js +2 -2
  278. package/dist/src/agent-catalog/capabilities.js +2 -2
  279. package/dist/src/agent-catalog/repository.js +1 -1
  280. package/dist/src/agent-matching/delegation-service.js +1 -1
  281. package/dist/src/ai-assist/text-assist.js +1 -1
  282. package/dist/src/auth/credentials.js +1 -1
  283. package/dist/src/auth/oauth/openai.js +1 -1
  284. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  285. package/dist/src/auth/profiles/store.js +1 -1
  286. package/dist/src/automations/api/routes.js +38 -0
  287. package/dist/src/automations/capabilities/drafts.js +1 -1
  288. package/dist/src/automations/capabilities/write.js +25 -9
  289. package/dist/src/automations/configuration-conversation.d.ts +16 -0
  290. package/dist/src/automations/configuration-conversation.js +120 -0
  291. package/dist/src/automations/delivery/delivery-router.d.ts +2 -0
  292. package/dist/src/automations/delivery/delivery-router.js +30 -9
  293. package/dist/src/automations/domain/index.js +1 -1
  294. package/dist/src/automations/domain/types.d.ts +1 -0
  295. package/dist/src/automations/draft/automation-draft-service.js +1 -1
  296. package/dist/src/automations/index.js +6 -6
  297. package/dist/src/automations/service/action-executor.js +42 -13
  298. package/dist/src/automations/service/automation-service.d.ts +6 -0
  299. package/dist/src/automations/service/automation-service.js +47 -12
  300. package/dist/src/automations/service/index.js +2 -2
  301. package/dist/src/browser/native-messaging-host.js +1 -1
  302. package/dist/src/browser/providers/browser-ext-install.js +2 -2
  303. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  304. package/dist/src/capabilities/runtime/product.js +1 -1
  305. package/dist/src/capabilities/store-connector.js +1 -1
  306. package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
  307. package/dist/src/channels/index.js +2 -2
  308. package/dist/src/channels/outbound-sender.js +1 -1
  309. package/dist/src/channels/pairing/allow-from-file.js +9 -9
  310. package/dist/src/channels/pairing/pairing-store.js +6 -6
  311. package/dist/src/chat-commands/agent-edit.js +1 -1
  312. package/dist/src/chat-commands/builtins/config.js +3 -3
  313. package/dist/src/chat-commands/builtins/session.js +1 -1
  314. package/dist/src/chat-commands/builtins/thinking.js +1 -1
  315. package/dist/src/chat-commands/builtins/tts.js +1 -1
  316. package/dist/src/chat-commands/context.js +1 -1
  317. package/dist/src/chat-commands/index.js +3 -3
  318. package/dist/src/cli/commands/agent.js +8 -8
  319. package/dist/src/cli/commands/agents.js +1 -1
  320. package/dist/src/cli/commands/config.js +1 -1
  321. package/dist/src/cli/commands/connectors.js +1 -1
  322. package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
  323. package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
  324. package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
  325. package/dist/src/cli/commands/extension-dev.js +1 -1
  326. package/dist/src/cli/commands/extension.js +2 -2
  327. package/dist/src/cli/commands/image.js +1 -1
  328. package/dist/src/cli/commands/init.js +1 -1
  329. package/dist/src/cli/commands/mcp.js +2 -2
  330. package/dist/src/cli/commands/models.js +3 -3
  331. package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
  332. package/dist/src/cli/commands/onboard/model.js +1 -1
  333. package/dist/src/cli/commands/onboard.js +1 -1
  334. package/dist/src/cli/commands/project.js +1 -1
  335. package/dist/src/cli/commands/skills.js +2 -2
  336. package/dist/src/cli/commands/tunnel.js +4 -4
  337. package/dist/src/cli/extension-cli-register.js +6 -6
  338. package/dist/src/cli/utils/gateway-client.js +1 -1
  339. package/dist/src/cli/utils/init-workspace-core.js +3 -3
  340. package/dist/src/cli/utils/session.js +1 -1
  341. package/dist/src/computer/broker.js +16 -3
  342. package/dist/src/computer/diagnostics.js +1 -1
  343. package/dist/src/computer/errors.js +4 -0
  344. package/dist/src/computer/flows.js +1 -1
  345. package/dist/src/computer/model-adapter.js +1 -1
  346. package/dist/src/computer/runtime.js +3 -3
  347. package/dist/src/config/agent-profile.js +1 -1
  348. package/dist/src/config/index.js +4 -4
  349. package/dist/src/config/loader.js +1 -1
  350. package/dist/src/config/models-json.js +1 -1
  351. package/dist/src/connectors/cli/authorization.js +1 -1
  352. package/dist/src/connectors/composio-sessions.js +1 -1
  353. package/dist/src/connectors/composio.js +1 -1
  354. package/dist/src/connectors/connected-source-ingestion.js +3 -3
  355. package/dist/src/connectors/connected-source-understanding.js +5 -5
  356. package/dist/src/connectors/connection-recovery-service.js +4 -4
  357. package/dist/src/connectors/content-enrichment.js +1 -1
  358. package/dist/src/connectors/health.js +1 -1
  359. package/dist/src/discussions/live-worker.js +1 -1
  360. package/dist/src/discussions/sealer.js +1 -1
  361. package/dist/src/endpoint-tools/index.js +1 -1
  362. package/dist/src/endpoint-tools/runtime.js +2 -2
  363. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  364. package/dist/src/extensions/activation-context.js +3 -3
  365. package/dist/src/extensions/agent-plugins/auth.js +1 -1
  366. package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -3
  367. package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
  368. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  369. package/dist/src/extensions/api.js +3 -3
  370. package/dist/src/extensions/bundled-extension-activation.js +1 -1
  371. package/dist/src/extensions/index.js +3 -3
  372. package/dist/src/extensions/loader.js +2 -2
  373. package/dist/src/extensions/lockfile.js +1 -1
  374. package/dist/src/extensions/sdk/index.js +1 -1
  375. package/dist/src/extensions/sdk/media.js +1 -1
  376. package/dist/src/gateway/agents-admin.js +2 -2
  377. package/dist/src/gateway/automation-completion-delivery.d.ts +4 -0
  378. package/dist/src/gateway/automation-completion-delivery.js +14 -0
  379. package/dist/src/gateway/device-routes.js +2 -2
  380. package/dist/src/gateway/file-path-classifier.js +1 -1
  381. package/dist/src/gateway/global-defaults-admin.js +1 -1
  382. package/dist/src/gateway/hono/app.js +3 -3
  383. package/dist/src/gateway/hono/lib/config-payload.js +3 -3
  384. package/dist/src/gateway/hono/routes/agents.js +1 -1
  385. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  386. package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
  387. package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
  388. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  389. package/dist/src/gateway/hono/routes/context-sources.js +1 -1
  390. package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -1
  391. package/dist/src/gateway/hono/routes/home.js +1 -1
  392. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  393. package/dist/src/gateway/hono/routes/memory-learning.js +3 -3
  394. package/dist/src/gateway/hono/routes/models.js +4 -4
  395. package/dist/src/gateway/hono/routes/notes.js +3 -3
  396. package/dist/src/gateway/hono/routes/phone-dependencies.js +1 -1
  397. package/dist/src/gateway/hono/routes/phone-setup.js +2 -2
  398. package/dist/src/gateway/hono/routes/phone.js +2 -2
  399. package/dist/src/gateway/hono/routes/projects.js +5 -5
  400. package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
  401. package/dist/src/gateway/hono/routes/session-command-handler.js +2 -2
  402. package/dist/src/gateway/hono/routes/session-input-handler.js +5 -5
  403. package/dist/src/gateway/hono/routes/sessions.js +3 -3
  404. package/dist/src/gateway/hono/routes/shares.js +2 -2
  405. package/dist/src/gateway/hono/routes/side-chats.js +1 -1
  406. package/dist/src/gateway/hono/routes/site-shares.js +1 -1
  407. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  408. package/dist/src/gateway/hono/routes/user-model.js +7 -7
  409. package/dist/src/gateway/hono/routes/voice.js +7 -7
  410. package/dist/src/gateway/image-generation-setup.js +1 -1
  411. package/dist/src/gateway/lock.js +11 -11
  412. package/dist/src/gateway/media-access.js +1 -1
  413. package/dist/src/gateway/mobile-privacy.js +2 -2
  414. package/dist/src/gateway/ports.js +6 -6
  415. package/dist/src/gateway/provider-model-setup.js +1 -1
  416. package/dist/src/gateway/respawn.js +2 -1
  417. package/dist/src/gateway/server.js +1 -1
  418. package/dist/src/gateway/service/agent-runner.js +3 -3
  419. package/dist/src/gateway/service/config-coordinator.js +2 -2
  420. package/dist/src/gateway/service/marketplace-service.js +2 -2
  421. package/dist/src/gateway/service/run-gateway-agent.js +4 -4
  422. package/dist/src/gateway/service/session-command-service.js +2 -2
  423. package/dist/src/gateway/service.js +46 -46
  424. package/dist/src/gateway/session-context-summary.js +4 -4
  425. package/dist/src/gateway/workspace-editor-path.js +2 -2
  426. package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
  427. package/dist/src/home-intelligence/generator.js +2 -2
  428. package/dist/src/imports/importService.js +1 -1
  429. package/dist/src/imports/inventory.js +2 -2
  430. package/dist/src/imports/productImport.js +1 -1
  431. package/dist/src/imports/runtime.js +1 -1
  432. package/dist/src/infra/gateway-processes.js +2 -2
  433. package/dist/src/infra/path-env.js +3 -3
  434. package/dist/src/infra/update-global.js +9 -9
  435. package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
  436. package/dist/src/knowledge/index.js +1 -1
  437. package/dist/src/knowledge-memory/repository.js +1 -1
  438. package/dist/src/knowledge-memory/usage-policy.js +1 -1
  439. package/dist/src/local-apps/service.js +3 -3
  440. package/dist/src/mcp/gateway-http-client.js +1 -1
  441. package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
  442. package/dist/src/memory-learning/source-learning.js +5 -5
  443. package/dist/src/memory-learning/task-receipts.js +1 -1
  444. package/dist/src/notes/agent-context.js +4 -4
  445. package/dist/src/notes/index.js +1 -1
  446. package/dist/src/notes/service.js +3 -3
  447. package/dist/src/observability/store.d.ts +9 -0
  448. package/dist/src/observability/store.js +77 -32
  449. package/dist/src/personal-agent/capability-service.js +2 -2
  450. package/dist/src/personal-agent/communication.d.ts +1 -1
  451. package/dist/src/personal-agent/communication.js +3 -6
  452. package/dist/src/personal-agent/proactivity/routes.js +1 -1
  453. package/dist/src/personal-agent/proactivity/service.js +7 -7
  454. package/dist/src/personal-agent/prompt-context.js +7 -7
  455. package/dist/src/personal-agent/prompts.js +1 -1
  456. package/dist/src/personal-agent/reply-composer.js +10 -10
  457. package/dist/src/personal-agent/request-delivery.js +2 -2
  458. package/dist/src/personal-agent/request-service.js +9 -8
  459. package/dist/src/personal-agent/result-reader.js +1 -1
  460. package/dist/src/personal-agent/service.js +2 -2
  461. package/dist/src/personal-agent/task-cancel.js +1 -1
  462. package/dist/src/phone/repository.js +1 -1
  463. package/dist/src/phone/runtime.js +4 -4
  464. package/dist/src/projects/index.js +1 -1
  465. package/dist/src/projects/project-agent-suggestion.js +1 -1
  466. package/dist/src/projects/project-service.js +1 -1
  467. package/dist/src/projects/project-skill-service.js +2 -2
  468. package/dist/src/projects/workspace.js +1 -1
  469. package/dist/src/providers/model-reference-auditor.js +1 -1
  470. package/dist/src/realtime/runtime.js +1 -1
  471. package/dist/src/remote-access/exposure-manager.js +1 -1
  472. package/dist/src/routing/agent-session-key.js +1 -1
  473. package/dist/src/runtime-tools/archive.js +1 -1
  474. package/dist/src/runtime-tools/phone-dependencies.js +2 -2
  475. package/dist/src/session/index.js +2 -2
  476. package/dist/src/session/init-session-turn.js +1 -1
  477. package/dist/src/session/resolve-session.js +1 -1
  478. package/dist/src/session/store.js +5 -5
  479. package/dist/src/session/thinking-resolve.js +1 -1
  480. package/dist/src/share/hosted-session-share.js +2 -2
  481. package/dist/src/share/session-share-service.js +1 -1
  482. package/dist/src/share/share-store.js +1 -1
  483. package/dist/src/share/share-thumbnail.js +1 -1
  484. package/dist/src/share/site-share-store.js +1 -1
  485. package/dist/src/storage/sqlite/connection.js +9 -9
  486. package/dist/src/tasks/capabilities/read.js +2 -2
  487. package/dist/src/tasks/capabilities/write.js +2 -2
  488. package/dist/src/tasks/home-query-service.js +1 -1
  489. package/dist/src/tasks/index.js +4 -4
  490. package/dist/src/tasks/task-allocation-service.js +6 -6
  491. package/dist/src/tasks/task-application-service.js +6 -6
  492. package/dist/src/tasks/task-collaboration-delivery.js +1 -1
  493. package/dist/src/tasks/task-context-assembler.js +2 -2
  494. package/dist/src/tasks/task-contract-planner.js +3 -2
  495. package/dist/src/tasks/task-handoff-service.js +1 -1
  496. package/dist/src/tasks/task-handoff.js +5 -5
  497. package/dist/src/tasks/task-main-update-decision-service.js +3 -3
  498. package/dist/src/tasks/task-model-call.js +1 -1
  499. package/dist/src/tasks/task-research-result.js +4 -4
  500. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  501. package/dist/src/tasks/task-result-delivery-service.js +2 -2
  502. package/dist/src/tasks/task-run-coordinator.js +4 -4
  503. package/dist/src/tasks/task-run-dispatcher.js +1 -1
  504. package/dist/src/tui/backends/embedded-backend.js +12 -12
  505. package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
  506. package/dist/src/tui/extension-host/load-extensions.js +2 -2
  507. package/dist/src/tui/tui-commands.js +5 -5
  508. package/dist/src/tui/tui-picker-overlay.js +1 -1
  509. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  510. package/dist/src/tui/tui-startup-resources.js +4 -4
  511. package/dist/src/tui/tui.js +4 -4
  512. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  513. package/dist/src/user-context/access-policy.js +2 -2
  514. package/dist/src/user-model/bootstrap.js +1 -1
  515. package/dist/src/user-model/capture/executor.js +1 -1
  516. package/dist/src/user-model/index.js +2 -2
  517. package/dist/src/user-model/usage-policy.js +1 -1
  518. package/dist/src/voice/realtime/memory-context.js +5 -5
  519. package/dist/src/voice/realtime/omniRoute.js +1 -1
  520. package/dist/src/voice/realtime/persona-context.js +1 -1
  521. package/dist/src/voice/realtime/runtime.js +4 -4
  522. package/dist/src/voice/stt/index.js +2 -2
  523. package/dist/src/voice/stt/preflight.js +1 -1
  524. package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
  525. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +1 -1
  526. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
  527. package/dist/src/voice/stt/transcribe-core.js +1 -1
  528. package/dist/src/voice/tts/index.js +3 -3
  529. package/dist/src/voice/tts/merge-config.js +1 -1
  530. package/dist/src/voice/tts/payload.js +1 -1
  531. package/dist/src/voice/tts/providers/bailian-plan-speech.js +1 -1
  532. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
  533. package/dist/src/voice/tts/speak-core.js +1 -1
  534. package/dist/src/work-discovery/service.js +7 -7
  535. package/package.json +3 -3
  536. package/dist/gateway/static/root/assets/agent-avatar-display-Cy50vjbq.js +0 -2
  537. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-V4NX_cWz.js +0 -1
  538. package/dist/gateway/static/root/assets/agent-plugin-dialog-CQ5LLDMO.js +0 -1
  539. package/dist/gateway/static/root/assets/app-management-settings-panel-C1Zs-eha.js +0 -1
  540. package/dist/gateway/static/root/assets/appearance-settings-lIfGokbz.js +0 -1
  541. package/dist/gateway/static/root/assets/apps-page-CUvtsRYD.js +0 -1
  542. package/dist/gateway/static/root/assets/automation-api-Bld8blNl.js +0 -1
  543. package/dist/gateway/static/root/assets/automation-display-BcfZOQTC.js +0 -2
  544. package/dist/gateway/static/root/assets/automations-workspace-BgtYY2Mm.js +0 -8
  545. package/dist/gateway/static/root/assets/browser-automations-page-DIUNY94X.js +0 -3
  546. package/dist/gateway/static/root/assets/capabilities-page-DFW4Y0x8.js +0 -2
  547. package/dist/gateway/static/root/assets/capabilities-settings-panel-uOHSMQPZ.js +0 -8
  548. package/dist/gateway/static/root/assets/channels-D2a69dSt.js +0 -1
  549. package/dist/gateway/static/root/assets/chat-page-CG38tCHE.js +0 -71
  550. package/dist/gateway/static/root/assets/composer-payload-handoff-BU3B-C26.js +0 -1
  551. package/dist/gateway/static/root/assets/connected-providers-grid-Dmnu2zle.js +0 -1
  552. package/dist/gateway/static/root/assets/connectors-page-DT_WrC1y.js +0 -1
  553. package/dist/gateway/static/root/assets/desktop-pet-lorocS9j.js +0 -1
  554. package/dist/gateway/static/root/assets/desktop-pet-settings-CEcohlZq.js +0 -1
  555. package/dist/gateway/static/root/assets/device-pairing-wizard-CLCPuf4R.js +0 -1
  556. package/dist/gateway/static/root/assets/discussion-annotation-sync-BKjf9gWe.js +0 -1
  557. package/dist/gateway/static/root/assets/extension-iframe-host-Dhkk5JV2.js +0 -1
  558. package/dist/gateway/static/root/assets/extension-page-Brps2XDP.js +0 -1
  559. package/dist/gateway/static/root/assets/extension-settings-page-CHY68DpG.js +0 -1
  560. package/dist/gateway/static/root/assets/gateway-realtime-store-DQqMBruB.js +0 -1
  561. package/dist/gateway/static/root/assets/gateway-restart-Ch128Lrr.js +0 -1
  562. package/dist/gateway/static/root/assets/home-page-DaMFBYo1.js +0 -2
  563. package/dist/gateway/static/root/assets/image-generation-api-I_JgLL_m.js +0 -1
  564. package/dist/gateway/static/root/assets/index-DS60ZSdQ.js +0 -11
  565. package/dist/gateway/static/root/assets/index-DY2Y83b9.css +0 -1
  566. package/dist/gateway/static/root/assets/install-connector-dialog-DU1Tz7B3.js +0 -1
  567. package/dist/gateway/static/root/assets/local-app-workbench-page-qPflPuQD.js +0 -1
  568. package/dist/gateway/static/root/assets/logs-page-CbY1N-zi.js +0 -2
  569. package/dist/gateway/static/root/assets/management-settings-Diy12JfQ.js +0 -1
  570. package/dist/gateway/static/root/assets/messages-DRR9N3HC.js +0 -3
  571. package/dist/gateway/static/root/assets/model-selector-DCYA_ntf.js +0 -1
  572. package/dist/gateway/static/root/assets/navigation-BkjnOw30.js +0 -1
  573. package/dist/gateway/static/root/assets/note-detail-panel-DBs1yHLy.js +0 -5
  574. package/dist/gateway/static/root/assets/note-image-lightbox-CivkB6LB.js +0 -1
  575. package/dist/gateway/static/root/assets/notes-page-DL3c-41a.js +0 -8
  576. package/dist/gateway/static/root/assets/page-header-store-DH8K0xii.js +0 -1
  577. package/dist/gateway/static/root/assets/personal-page-B5DP3lO-.js +0 -1
  578. package/dist/gateway/static/root/assets/personal-settings-panel-DjDc5Kaz.js +0 -1
  579. package/dist/gateway/static/root/assets/phone-model-picker-u8YIQCgo.js +0 -1
  580. package/dist/gateway/static/root/assets/phone-settings-page-el3pT0PD.js +0 -1
  581. package/dist/gateway/static/root/assets/plugin-details-dialog-CTBs1Jde.js +0 -1
  582. package/dist/gateway/static/root/assets/popover-select-DniHw2dy.js +0 -1
  583. package/dist/gateway/static/root/assets/preference-select-fields-D7oluyHN.js +0 -1
  584. package/dist/gateway/static/root/assets/product-automation-feedback-DsUSqCOX.js +0 -7
  585. package/dist/gateway/static/root/assets/project-detail-page-BKvWLiMw.js +0 -7
  586. package/dist/gateway/static/root/assets/project-understanding-BCQr0AZ_.js +0 -1
  587. package/dist/gateway/static/root/assets/projects-page-D4g7bB7X.js +0 -1
  588. package/dist/gateway/static/root/assets/route-preload-B5UiReO7.js +0 -2
  589. package/dist/gateway/static/root/assets/runtime-tools-settings-panel-MKlLFuow.js +0 -1
  590. package/dist/gateway/static/root/assets/schema-form-v4N4lawq.js +0 -1
  591. package/dist/gateway/static/root/assets/service-recommendation-list-B1xuVT3N.js +0 -1
  592. package/dist/gateway/static/root/assets/session-manager-5l9q0cd5.js +0 -16
  593. package/dist/gateway/static/root/assets/sessions-page-DsLw2aMD.js +0 -1
  594. package/dist/gateway/static/root/assets/settings-advanced-gate-B5lQeVNi.js +0 -1
  595. package/dist/gateway/static/root/assets/setup-status-panel-MJE3B_LX.js +0 -1
  596. package/dist/gateway/static/root/assets/share-preview-page-Bsrv_zOQ.js +0 -2
  597. package/dist/gateway/static/root/assets/shares-settings-CfIRv4uX.js +0 -1
  598. package/dist/gateway/static/root/assets/skill-api-B_W1K3sv.js +0 -1
  599. package/dist/gateway/static/root/assets/skills-page-DtBloYeU.js +0 -2
  600. package/dist/gateway/static/root/assets/task-detail-page-Drrv-Hp0.js +0 -2
  601. package/dist/gateway/static/root/assets/task-result-evidence-D1Kyskm_.js +0 -1
  602. package/dist/gateway/static/root/assets/tracing-settings-page-B12u5D9A.js +0 -1
  603. package/dist/gateway/static/root/assets/tunnel-api-DGO56LQU.js +0 -1
  604. package/dist/gateway/static/root/assets/usage-page-Ud2U9UG1.js +0 -1
  605. package/dist/gateway/static/root/assets/use-composer-attachments-BCbMj-MN.js +0 -2
  606. package/dist/gateway/static/root/assets/use-file-preview-expanded-DSpCRXUW.js +0 -2
  607. package/dist/gateway/static/root/assets/user-model-page-p5iPfnwl.js +0 -2
  608. package/dist/gateway/static/root/assets/voice-transcribe-api-TInEfIYo.js +0 -1
  609. package/dist/gateway/static/root/assets/work-discovery-page-p-8ciZ0i.js +0 -1
  610. package/dist/gateway/static/root/assets/workspace-editor-agent-store-B94Q2nN8.js +0 -1
@@ -4,12 +4,12 @@ import { alibabaSpeechProvider } from "./providers/alibaba-speech.js";
4
4
  import { edgeSpeechProvider } from "./providers/edge-speech.js";
5
5
  import { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, minimaxSpeechProvider } from "./providers/minimax-speech.js";
6
6
  import "./providers/index.js";
7
- import { getAvailableProviders, isProviderConfigured, isTTSAvailable, listRegisteredSpeechProviderIds, resolveProviderOrder, resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
8
- import { appendTtsReadinessNote, formatTtsSetupHint, mergeTtsConfigFromAppConfig } from "./merge-config.js";
9
- import { TTSService, getChannelOutputFormat, getSupportedChannels, isVoiceCompatibleChannel, shouldUseTTS } from "./service.js";
10
7
  import { buildTtsSystemPromptHint, hasTtsDirectives, parseTtsDirectives, stripTtsDirectives } from "./directives.js";
8
+ import { getAvailableProviders, isProviderConfigured, isTTSAvailable, listRegisteredSpeechProviderIds, resolveProviderOrder, resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
11
9
  import { preprocessText } from "./preprocess.js";
12
10
  import { speak, speakStream, speakWithProvider } from "./speak-core.js";
11
+ import { appendTtsReadinessNote, formatTtsSetupHint, mergeTtsConfigFromAppConfig } from "./merge-config.js";
12
+ import { TTSService, getChannelOutputFormat, getSupportedChannels, isVoiceCompatibleChannel, shouldUseTTS } from "./service.js";
13
13
  import { recordTtsFailure, recordTtsSuccess, ttsStatusTracker } from "./status-tracker.js";
14
14
  import { isTtsEnabled, maybeApplyTtsToPayload, resolveTtsAutoMode } from "./payload.js";
15
15
  export { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES, OPENAI_TTS_MODELS, OPENAI_TTS_VOICES, TTSService, alibabaSpeechProvider, appendTtsReadinessNote, buildTtsSystemPromptHint, edgeSpeechProvider, formatTtsSetupHint, getAvailableProviders, getChannelOutputFormat, getSpeechProvider, getSupportedChannels, hasTtsDirectives, isProviderConfigured, isTTSAvailable, isTtsEnabled, isVoiceCompatibleChannel, listRegisteredSpeechProviderIds, listSpeechProviders, maybeApplyTtsToPayload, mergeTtsConfigFromAppConfig, minimaxSpeechProvider, openAiSpeechProvider, parseTtsDirectives, preprocessText, recordTtsFailure, recordTtsSuccess, registerSpeechProvider, resolveProviderOrder, resolveSpeechProvider, resolveSpeechProviderChain, resolveTtsAutoMode, shouldUseTTS, speak, speakStream, speakWithProvider, stripTtsDirectives, ttsStatusTracker };
@@ -1,5 +1,5 @@
1
- import { DEFAULT_TTS_CONFIG } from "./types.js";
2
1
  import { isTTSAvailable } from "./factory.js";
2
+ import { DEFAULT_TTS_CONFIG } from "./types.js";
3
3
  //#region src/voice/tts/merge-config.ts
4
4
  /**
5
5
  * Merge persisted app config `tts` with defaults to a full {@link TTSConfig}
@@ -1,7 +1,7 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
- import { getChannelOutputFormat, shouldUseTTS } from "./service.js";
4
3
  import { speak } from "./speak-core.js";
4
+ import { getChannelOutputFormat, shouldUseTTS } from "./service.js";
5
5
  import { compressAudio } from "./audio.js";
6
6
  import { recordTtsFailure, recordTtsSuccess } from "./status-tracker.js";
7
7
  //#region src/voice/tts/payload.ts
@@ -3,8 +3,8 @@ import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../.
3
3
  import { getProviderAuthService, init_provider_auth_service } from "../../../providers/provider-auth-service.js";
4
4
  import { fetchWithTimeoutGuarded, postJsonRequest } from "../../../media-shared/http/provider-http.js";
5
5
  import "../../../media-shared/http/index.js";
6
- import { registerSpeechProvider } from "../speech-registry.js";
7
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
8
  //#region src/voice/tts/providers/bailian-plan-speech.ts
9
9
  init_sync_provider_auth();
10
10
  init_provider_auth_service();
@@ -6,10 +6,10 @@ import { getProviderAuthService, init_provider_auth_service } from "../../../pro
6
6
  import { captureCloudUsageResponse } from "../../../usage/cloud-receipts.js";
7
7
  import { cloudCreditBudgetHeaders, rejectUnbudgetedCloudTransport, reportCloudCreditError } from "../../../providers/xopc-cloud-credit-budget.js";
8
8
  import { compareCatalogModels } from "../../../providers/model-catalog-ranking.js";
9
- import { registerSpeechProvider } from "../speech-registry.js";
10
9
  import { trackCloudCapabilityUsage } from "../../../usage/cloud-capability.js";
11
10
  import { openPlatformTts } from "../../platform-streams.js";
12
11
  import { requirePlatformVoiceModel } from "../../platform-catalog.js";
12
+ import { registerSpeechProvider } from "../speech-registry.js";
13
13
  //#region src/voice/tts/providers/xopc-cloud-speech.ts
14
14
  init_model_catalog_store();
15
15
  init_voice();
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../../utils/logger/index.js";
2
2
  import { init_logger } from "../../utils/logger.js";
3
3
  import { assertProviderUsage, init_model_usage, isProviderUsageScopeError } from "../../providers/model-usage.js";
4
- import { resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
5
4
  import { parseTtsDirectives } from "./directives.js";
5
+ import { resolveSpeechProvider, resolveSpeechProviderChain } from "./factory.js";
6
6
  import { preprocessText } from "./preprocess.js";
7
7
  import { summarizeForTts } from "./summarize.js";
8
8
  //#region src/voice/tts/speak-core.ts
@@ -5,19 +5,19 @@ import { createContextEvidence } from "../storage/sqlite/context-evidence-reposi
5
5
  import { ensureSessionRecord, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
6
6
  import "../storage/sqlite/index.js";
7
7
  import { ActivityService } from "../activity/service.js";
8
- import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
9
- import { init_session_key, resolveConversationId } from "../routing/session-key.js";
10
- import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
11
- import "../user-model/index.js";
12
- import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
13
8
  import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
9
+ import { init_session_key, resolveConversationId } from "../routing/session-key.js";
10
+ import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
11
+ import "../knowledge-memory/index.js";
14
12
  import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
15
13
  import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
16
14
  import { init_providers, resolveModel } from "../providers/index.js";
17
15
  import { isLocalModelBaseUrl } from "../providers/model-call.js";
16
+ import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
17
+ import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
18
+ import "../user-model/index.js";
19
+ import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
18
20
  import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
19
- import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
20
- import "../knowledge-memory/index.js";
21
21
  import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
22
22
  import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
23
23
  import { clusterActivityTopics } from "../user-context/sources/activity-clustering.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xopcai/xopc",
3
- "version": "0.0.419",
3
+ "version": "0.0.421",
4
4
  "description": "Local-first personal AI with Ada, task delegation, files, projects and automations. Use cloud or local models.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -96,7 +96,7 @@
96
96
  "chokidar": "^5.0.0",
97
97
  "cli-table3": "^0.6.5",
98
98
  "commander": "^14.0.3",
99
- "cron-parser": "^5.5.0",
99
+ "cron-parser": "^5.10.2",
100
100
  "dotenv": "^17.4.2",
101
101
  "glob": "^13.0.6",
102
102
  "grammy": "^1.43.0",
@@ -171,8 +171,8 @@
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
174
  "@xopcai/endpoint-tools-client": "0.0.0",
175
+ "@xopcai/computer-control-contract": "0.1.0",
176
176
  "@xopcai/endpoint-tools-protocol": "0.0.0",
177
177
  "@xopcai/gateway-contract": "0.0.0",
178
178
  "@xopcai/image-providers": "0.1.0",
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-avatar-dicebear-1UABT2KS.js","assets/rolldown-runtime-aKtaBQYM.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{t as i}from"./cn-0WouolD0.js";import{i as a,l as o}from"./locale-store-lIXD1FMw.js";import{t as s}from"./loopi-CNtmi9FU.js";var c=e(t(),1),l=new Map,u=`xopc-agent-avatar-updated`;function d(e){let t=(l.get(e)??0)+1;return l.set(e,t),typeof window<`u`&&window.dispatchEvent(new CustomEvent(u,{detail:{agentId:e}})),t}function f(e){return l.get(e)??0}var p=`xopc:custom`,m=`xopc:dicebear:`,h=[`adventurer`,`bottts`,`lorelei`,`thumbs`,`fun-emoji`];function g(e){return h.includes(e)}function _(e,t){return`${m}${e}:${t}`}function v(e){if(!e.startsWith(m))return null;let t=e.slice(14),n=t.indexOf(`:`);if(n<=0)return null;let r=t.slice(0,n),i=t.slice(n+1);return!g(r)||!i.trim()?null:{styleId:r,seed:i}}var y=n();function b(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return t}function x(e,t=128){let n=b(e)%360,r=(e.trim().charAt(0)||`A`).toUpperCase(),i=`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 ${t} ${t}"><rect width="100%" height="100%" rx="${t/2}" fill="hsl(${n} 58% 42%)"/><text x="50%" y="54%" text-anchor="middle" dominant-baseline="middle" font-family="Inter, system-ui, sans-serif" font-size="${Math.round(t*.42)}" font-weight="700" fill="white">${r}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`}function S(e,t,n,r){let i=t?.trim()??``,o=x(e,n);if(i.startsWith(`xopc:loopi:`)){let e=i.slice(11);if(e===`idle`||e===`listen`||e===`curious`||e===`care`)return{kind:`loopi`,mood:e}}if(!i)return{kind:`dicebear`,styleId:`adventurer`,seed:e,fallbackSrc:o};if(i===`xopc:custom`){let t=a(`/api/agents/${encodeURIComponent(e)}/avatar`),n=new URLSearchParams;r>0&&n.set(`v`,String(r));let i=n.toString();return{kind:`authenticated`,url:i?`${t}?${i}`:t,fallbackSrc:o}}if(/^https?:\/\//i.test(i))return{kind:`sync`,src:i};let s=v(i);return s?{kind:`dicebear`,styleId:s.styleId,seed:s.seed,fallbackSrc:o}:{kind:`dicebear`,styleId:`adventurer`,seed:e,fallbackSrc:o}}function C(e){let t=o(e=>e.conversationId),n=e.token===void 0?t:e.token,{agentId:a,avatar:l,size:d=44}=e,[,p]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=e=>{e.detail?.agentId===a&&p(e=>e+1)};return window.addEventListener(u,e),()=>window.removeEventListener(u,e)},[a]);let m=f(a),h=(0,c.useMemo)(()=>S(a,l,d,m),[a,l,n,d,m]),g=h.kind===`sync`?h.src:h.kind===`loopi`?x(a,d):h.fallbackSrc,[_,v]=(0,c.useState)(g);return(0,c.useEffect)(()=>{v(g)},[g]),(0,c.useEffect)(()=>{if(h.kind!==`authenticated`||(v(h.fallbackSrc),!n))return;let e=new AbortController,t;return fetch(h.url,{credentials:`same-origin`,signal:e.signal,redirect:`error`}).then(async n=>{if(!n.ok)return;let r=await n.blob();e.signal.aborted||(t=URL.createObjectURL(r),v(t))}).catch(()=>{}),()=>{e.abort(),t&&URL.revokeObjectURL(t)}},[h,n]),(0,c.useEffect)(()=>{if(h.kind!==`dicebear`)return;let e=!1;return r(async()=>{let{dicebearToDataUri:e}=await import(`./agent-avatar-dicebear-1UABT2KS.js`);return{dicebearToDataUri:e}},__vite__mapDeps([0,1])).then(({dicebearToDataUri:t})=>{e||v(t(h.styleId,h.seed,d))}).catch(()=>{e||v(h.fallbackSrc)}),()=>{e=!0}},[h,d]),h.kind===`loopi`?(0,y.jsx)(`span`,{className:i(`inline-flex items-center justify-center rounded-full bg-surface-hover`,e.className),style:{width:d,height:d},children:(0,y.jsx)(s,{variant:`avatar`,mood:h.mood,className:`size-full`})}):(0,y.jsx)(`img`,{src:_,alt:``,width:d,height:d,className:i(`rounded-full object-cover bg-surface-hover`,e.className),draggable:!1,onError:()=>{v(x(a,d))}})}export{g as a,_ as i,h as n,v as o,p as r,d as s,C as t};
@@ -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{m as i}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as a}from"./circle-check-C23XjkUj.js";import{t as o}from"./gauge-C78eD2BA.js";import{t as s}from"./list-checks-BbsExAoq.js";import{t as c}from"./puzzle-BptcPjKI.js";import{t as ee}from"./search-DA7gz22f.js";import{t as l}from"./shield-check-BU58siTV.js";import{t as te}from"./sliders-horizontal-DqsYor6I.js";import{t as u}from"./cn-0WouolD0.js";import{l as d,n as f}from"./locale-store-lIXD1FMw.js";import{i as p}from"./vendor-swr-CdRzEUwF.js";import{t as ne}from"./button-CnRSIP6m.js";import{t as m}from"./skeleton-BI5TyibZ.js";import{n as h,r as g}from"./cloud-credits-B-nbtkqv.js";import{t as _}from"./electron-env-DHOGevH3.js";import{t as re}from"./sliding-tab-list-DuQyViqe.js";import{t as v}from"./skill-list-api-BzlKXPsE.js";import{n as y}from"./settings-mode-store-CBsJ-Qg2.js";import{n as ie,t as b}from"./global-defaults-api-CINf-C6a.js";import{t as ae}from"./settings-advanced-section-BqoVSko2.js";import{t as x}from"./number-input-El7Szeln.js";import{n as oe,t as se}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{n as S,t as C}from"./use-autosave-Cs2Ga_Y_.js";var ce=n(),w=e(t(),1),T=r(),E=`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 D(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function le({draft:e,setDraft:t,zh:n}){let[r,i]=(0,w.useState)(()=>e.runtime.cloudCreditLimitPerRunMicro?h(e.runtime.cloudCreditLimitPerRunMicro):``),[a,o]=(0,w.useState)(!1);return(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[n?`每次运行的 Cloud 消费上限(Credits)`:`Cloud spend limit per run (Credits)`,(0,T.jsx)(`input`,{type:`text`,inputMode:`decimal`,value:r,"aria-invalid":a,placeholder:n?`不设置额外上限`:`No additional limit`,className:`${E} mt-2`,onChange:n=>{let r=n.target.value;i(r);try{let n=r===``?void 0:g(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?h(e.runtime.cloudCreditLimitPerRunMicro):``),o(!1)}}),(0,T.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 O(e){let t=(0,ce.c)(104),{draft:n,setDraft:r,zh:i}=e,a=i?`费用控制`:`Spending control`,o;t[0]===a?o=t[1]:(o=(0,T.jsx)(`h2`,{className:`mb-4 text-base font-semibold text-fg`,children:a}),t[0]=a,t[1]=o);let s;t[2]!==n||t[3]!==r||t[4]!==i?(s=(0,T.jsx)(le,{draft:n,setDraft:r,zh:i}),t[2]=n,t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;t[6]!==o||t[7]!==s?(c=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let ee=i?`执行与缓存策略`:`Execution and cache policy`,l=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,u;t[9]!==n||t[10]!==r?(u=e=>r({...n,runtime:{...n.runtime,codemode:{...n.runtime.codemode,enabled:e.target.checked}}}),t[9]=n,t[10]=r,t[11]=u):u=t[11];let d;t[12]!==te||t[13]!==u?(d=(0,T.jsx)(`input`,{type:`checkbox`,checked:te,onChange:u,className:`mt-1 size-4 accent-[var(--color-accent)]`}),t[12]=te,t[13]=u,t[14]=d):d=t[14];let f=i?`Codemode 读取试点`:`Codemode read pilot`,p;t[15]===f?p=t[16]:(p=(0,T.jsx)(`span`,{className:`block text-base font-semibold text-fg`,children:f}),t[15]=f,t[16]=p);let m=i?`允许智能体用脚本组合已授权的读取工具。默认关闭,保留普通工具调用。`:`Let agents combine authorized reads in scripts. Off by default; ordinary tool calls stay available.`,h;t[17]===m?h=t[18]:(h=(0,T.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:m}),t[17]=m,t[18]=h);let g;t[19]!==p||t[20]!==h?(g=(0,T.jsxs)(`span`,{children:[p,h]}),t[19]=p,t[20]=h,t[21]=g):g=t[21];let _;t[22]!==g||t[23]!==d?(_=(0,T.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:(0,T.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3`,children:[d,g]})}),t[22]=g,t[23]=d,t[24]=_):_=t[24];let v=i?`执行限制`:`Execution limits`,y;t[25]===v?y=t[26]:(y=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:v}),t[25]=v,t[26]=y);let ie=i?`为所有智能体设置安全上限;留空时使用系统默认值。`:`Set safe upper bounds for every agent. Empty fields use system defaults.`,b;t[27]===ie?b=t[28]:(b=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ie}),t[27]=ie,t[28]=b);let oe=i?`每次运行最多轮数`:`Maximum turns per run`,se=n.runtime.maxTurns??``,S=i?`系统默认`:`System default`,C;t[29]!==n||t[30]!==r?(C=e=>r({...n,runtime:{...n.runtime,maxTurns:D(e.target.value)}}),t[29]=n,t[30]=r,t[31]=C):C=t[31];let w;t[32]!==se||t[33]!==S||t[34]!==C?(w=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:se,placeholder:S,onChange:C,className:`${E} mt-2`}),t[32]=se,t[33]=S,t[34]=C,t[35]=w):w=t[35];let O;t[36]!==oe||t[37]!==w?(O=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[oe,w]}),t[36]=oe,t[37]=w,t[38]=O):O=t[38];let k=i?`单轮超时(毫秒)`:`Turn timeout (ms)`,A=n.runtime.timeoutMs??``,ue=i?`系统默认`:`System default`,j;t[39]!==n||t[40]!==r?(j=e=>r({...n,runtime:{...n.runtime,timeoutMs:D(e.target.value)}}),t[39]=n,t[40]=r,t[41]=j):j=t[41];let M;t[42]!==A||t[43]!==ue||t[44]!==j?(M=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:A,placeholder:ue,onChange:j,className:`${E} mt-2`}),t[42]=A,t[43]=ue,t[44]=j,t[45]=M):M=t[45];let N;t[46]!==k||t[47]!==M?(N=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[k,M]}),t[46]=k,t[47]=M,t[48]=N):N=t[48];let de=i?`每轮最多工具失败次数`:`Maximum tool failures per turn`,P=n.runtime.maxToolFailuresPerTurn??``,fe=i?`系统默认`:`System default`,F;t[49]!==n||t[50]!==r?(F=e=>r({...n,runtime:{...n.runtime,maxToolFailuresPerTurn:D(e.target.value)}}),t[49]=n,t[50]=r,t[51]=F):F=t[51];let pe;t[52]!==P||t[53]!==fe||t[54]!==F?(pe=(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:P,placeholder:fe,onChange:F,className:`${E} mt-2`}),t[52]=P,t[53]=fe,t[54]=F,t[55]=pe):pe=t[55];let I;t[56]!==de||t[57]!==pe?(I=(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[de,pe]}),t[56]=de,t[57]=pe,t[58]=I):I=t[58];let L;t[59]!==O||t[60]!==N||t[61]!==I?(L=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-4 md:grid-cols-3`,children:[O,N,I]}),t[59]=O,t[60]=N,t[61]=I,t[62]=L):L=t[62];let R;t[63]!==y||t[64]!==b||t[65]!==L?(R=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[y,b,L]}),t[63]=y,t[64]=b,t[65]=L,t[66]=R):R=t[66];let z=i?`提示词缓存`:`Prompt cache`,B;t[67]===z?B=t[68]:(B=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[67]=z,t[68]=B);let V=i?`复用稳定的上下文以降低响应延迟和模型费用。`:`Reuse stable context to reduce latency and model cost.`,H;t[69]===V?H=t[70]:(H=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:V}),t[69]=V,t[70]=H);let U=i?`缓存模式`:`Cache mode`,W;t[71]===U?W=t[72]:(W=(0,T.jsx)(`span`,{children:U}),t[71]=U,t[72]=W);let G=i?`缓存模式`:`Cache mode`,K;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(K=[`auto`,`off`],t[73]=K):K=t[73];let q;t[74]!==n||t[75]!==r||t[76]!==i?(q=K.map(e=>(0,T.jsx)(ne,{"aria-pressed":n.runtime.promptCache?.mode===e,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[74]=n,t[75]=r,t[76]=i,t[77]=q):q=t[77];let J;t[78]!==G||t[79]!==q?(J=(0,T.jsx)(re,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":G,children:q}),t[78]=G,t[79]=q,t[80]=J):J=t[80];let Y;t[81]!==W||t[82]!==J?(Y=(0,T.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[W,J]}),t[81]=W,t[82]=J,t[83]=Y):Y=t[83];let me;t[84]!==n||t[85]!==r||t[86]!==i?(me=n.runtime.promptCache?.mode===`auto`?(0,T.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,T.jsx)(`span`,{children:i?`缓存周期`:`Cache lifetime`}),(0,T.jsx)(re,{className:`mt-1.5 flex rounded-lg bg-surface-panel p-1`,role:`group`,"aria-label":i?`缓存周期`:`Cache lifetime`,children:[`short`,`long`].map(e=>(0,T.jsx)(ne,{"aria-pressed":n.runtime.promptCache?.lifetime===e,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[84]=n,t[85]=r,t[86]=i,t[87]=me):me=t[87];let X;t[88]!==Y||t[89]!==me?(X=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[Y,me]}),t[88]=Y,t[89]=me,t[90]=X):X=t[90];let Z;t[91]!==B||t[92]!==H||t[93]!==X?(Z=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[B,H,X]}),t[91]=B,t[92]=H,t[93]=X,t[94]=Z):Z=t[94];let Q;t[95]!==_||t[96]!==R||t[97]!==ee||t[98]!==Z||t[99]!==l?(Q=(0,T.jsxs)(ae,{title:ee,summary:l,children:[_,R,Z]}),t[95]=_,t[96]=R,t[97]=ee,t[98]=Z,t[99]=l,t[100]=Q):Q=t[100];let $;return t[101]!==c||t[102]!==Q?($=(0,T.jsxs)(`div`,{className:`space-y-5`,children:[c,Q]}),t[101]=c,t[102]=Q,t[103]=$):$=t[103],$}function k(e){return[...new Set(e)].sort()}var A=[{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 ue(e){let t=(0,ce.c)(115),{draft:n,setDraft:r,zh:i}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[0]=o):o=t[0];let{data:c,error:l,isLoading:te}=p(`agent-defaults-skills-catalog`,v,o),[d,f]=(0,w.useState)(``),ne=n.skills.mode===`selected`?n.skills.include:n.skills.exclude;c?.catalog;let m;if(t[1]!==ne||t[2]!==c?.catalog||t[3]!==d){let e=[...c?.catalog??[]],n=new Set(e.map(P));for(let t of ne)n.has(t)||e.push({name:t,description:``,enabled:!0});let r=d.trim().toLowerCase();m=e.filter(e=>!r||`${e.name} ${e.description}`.toLowerCase().includes(r)).sort(de),t[1]=ne,t[2]=c?.catalog,t[3]=d,t[4]=m}else m=t[4];let h=m,g;t[5]!==n.skills.exclude||t[6]!==n.skills.include||t[7]!==n.skills.mode?(g=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]=g):g=t[8];let _=g,re;t[9]!==n||t[10]!==r?(re=e=>{if(n.skills.mode===`selected`){let t=n.skills.include.includes(e)?n.skills.include.filter(t=>t!==e):k([...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):k([...n.skills.exclude,e]);r({...n,skills:{mode:`all-enabled`,exclude:t}})},t[9]=n,t[10]=r,t[11]=re):re=t[11];let y=re,ie;t[12]===c?.catalog?ie=t[13]:(ie=c?.catalog??[],t[12]=c?.catalog,t[13]=ie);let b;if(t[14]!==_||t[15]!==ie){let e;t[17]===_?e=t[18]:(e=e=>e.enabled&&_(e.name),t[17]=_,t[18]=e),b=ie.filter(e),t[14]=_,t[15]=ie,t[16]=b}else b=t[16];let ae=b.length,x;t[19]!==c?.catalog||t[20]!==n||t[21]!==r?(x=e=>{let t=new Set((c?.catalog??[]).filter(N).map(M));r({...n,skills:{mode:`selected`,include:k(e.filter(e=>t.has(e)))}})},t[19]=c?.catalog,t[20]=n,t[21]=r,t[22]=x):x=t[22];let oe=x,se=i?`技能策略`:`Skill policy`,S;t[23]===se?S=t[24]:(S=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:se}),t[23]=se,t[24]=S);let C=i?`决定所有智能体默认可以使用哪些技能。`:`Choose which skills every agent can discover and use by default.`,E;t[25]===C?E=t[26]:(E=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:C}),t[25]=C,t[26]=E);let D;t[27]!==n||t[28]!==r?(D=()=>r({...n,skills:{mode:`all-enabled`,exclude:[]}}),t[27]=n,t[28]=r,t[29]=D):D=t[29];let le=n.skills.mode===`all-enabled`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,O;t[30]===le?O=t[31]:(O=u(`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`,le),t[30]=le,t[31]=O);let ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,T.jsx)(a,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[32]=ue):ue=t[32];let fe=i?`使用所有已启用技能`:`Use every enabled skill`,F;t[33]===fe?F=t[34]:(F=(0,T.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:fe}),t[33]=fe,t[34]=F);let pe=i?`适合需要完整目录的高级智能体;新增技能会自动加入。`:`For advanced agents that need the full catalog; newly enabled skills are added automatically.`,I;t[35]===pe?I=t[36]:(I=(0,T.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:pe}),t[35]=pe,t[36]=I);let L;t[37]!==F||t[38]!==I?(L=(0,T.jsxs)(`span`,{children:[F,I]}),t[37]=F,t[38]=I,t[39]=L):L=t[39];let R;t[40]!==D||t[41]!==O||t[42]!==L?(R=(0,T.jsxs)(`button`,{type:`button`,onClick:D,className:O,children:[ue,L]}),t[40]=D,t[41]=O,t[42]=L,t[43]=R):R=t[43];let z;t[44]!==n||t[45]!==r?(z=()=>r({...n,skills:{mode:`selected`,include:[]}}),t[44]=n,t[45]=r,t[46]=z):z=t[46];let B=n.skills.mode===`selected`?`bg-accent-soft shadow-surface`:`hover:bg-surface-hover`,V;t[47]===B?V=t[48]:(V=u(`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`,B),t[47]=B,t[48]=V);let H;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(s,{className:`mt-0.5 size-5 shrink-0 text-accent`}),t[49]=H):H=t[49];let U=i?`只使用选中的技能`:`Use selected skills only`,W;t[50]===U?W=t[51]:(W=(0,T.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:U}),t[50]=U,t[51]=W);let G=i?`适合严格受控的环境;新增技能不会自动加入。`:`For tightly controlled environments; new skills are not added automatically.`,K;t[52]===G?K=t[53]:(K=(0,T.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:G}),t[52]=G,t[53]=K);let q;t[54]!==W||t[55]!==K?(q=(0,T.jsxs)(`span`,{children:[W,K]}),t[54]=W,t[55]=K,t[56]=q):q=t[56];let J;t[57]!==z||t[58]!==V||t[59]!==q?(J=(0,T.jsxs)(`button`,{type:`button`,onClick:z,className:V,children:[H,q]}),t[57]=z,t[58]=V,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==R||t[62]!==J?(Y=(0,T.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[R,J]}),t[61]=R,t[62]=J,t[63]=Y):Y=t[63];let me=i?`能力组合(会替换当前选择)`:`Capability packs (replaces the current selection)`,X;t[64]===me?X=t[65]:(X=(0,T.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:me}),t[64]=me,t[65]=X);let Z;t[66]!==oe||t[67]!==c||t[68]!==i?(Z=A.map(e=>(0,T.jsx)(`button`,{type:`button`,onClick:()=>oe(e.names),disabled:!c,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]=oe,t[67]=c,t[68]=i,t[69]=Z):Z=t[69];let Q;t[70]===Z?Q=t[71]:(Q=(0,T.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:Z}),t[70]=Z,t[71]=Q);let $;t[72]!==X||t[73]!==Q?($=(0,T.jsxs)(`div`,{className:`mt-4`,children:[X,Q]}),t[72]=X,t[73]=Q,t[74]=$):$=t[74];let he;t[75]!==E||t[76]!==Y||t[77]!==$||t[78]!==S?(he=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[S,E,Y,$]}),t[75]=E,t[76]=Y,t[77]=$,t[78]=S,t[79]=he):he=t[79];let ge=n.skills.mode===`selected`?i?`选择可用技能`:`Select available skills`:i?`管理例外`:`Manage exceptions`,_e;t[80]===ge?_e=t[81]:(_e=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:ge}),t[80]=ge,t[81]=_e);let ve=i?`当前默认可用 ${ae} 个技能。`:`${ae} skills are available by default.`,ye;t[82]===ve?ye=t[83]:(ye=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:ve}),t[82]=ve,t[83]=ye);let be;t[84]!==_e||t[85]!==ye?(be=(0,T.jsxs)(`div`,{children:[_e,ye]}),t[84]=_e,t[85]=ye,t[86]=be):be=t[86];let xe=i?`搜索技能`:`Search skills`,Se;t[87]===xe?Se=t[88]:(Se=(0,T.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,T.jsx)(ee,{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=>f(e.target.value),t[90]=we):we=t[90];let Te=i?`搜索技能`:`Search skills`,Ee;t[91]!==d||t[92]!==Te?(Ee=(0,T.jsx)(`input`,{type:`search`,value:d,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]=d,t[92]=Te,t[93]=Ee):Ee=t[93];let De;t[94]!==Se||t[95]!==Ee?(De=(0,T.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,T.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]===l?ke=t[101]:(ke=l?(0,T.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:l instanceof Error?l.message:String(l)}):null,t[100]=l,t[101]=ke);let Ae;t[102]!==_||t[103]!==te||t[104]!==h||t[105]!==y||t[106]!==i?(Ae=te?(0,T.jsx)(`div`,{className:`mt-4 space-y-2`,children:[0,1,2,3].map(j)}):(0,T.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:[h.map(e=>{let t=_(e.name);return(0,T.jsxs)(`label`,{className:u(`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,T.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!e.enabled,onChange:()=>y(e.name),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,T.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.name}),e.enabled?null:(0,T.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,T.jsx)(`span`,{className:`mt-1 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description}):null]})]},e.name)}),h.length===0?(0,T.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-fg-muted`,children:i?`没有匹配的技能。`:`No matching skills.`}):null]}),t[102]=_,t[103]=te,t[104]=h,t[105]=y,t[106]=i,t[107]=Ae):Ae=t[107];let je;t[108]!==Oe||t[109]!==ke||t[110]!==Ae?(je=(0,T.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]!==he||t[113]!==je?(Me=(0,T.jsxs)(`div`,{className:`space-y-5`,children:[he,je]}),t[112]=he,t[113]=je,t[114]=Me):Me=t[114],Me}function j(e){return(0,T.jsx)(m,{className:`h-14 rounded-xl`},e)}function M(e){return e.name}function N(e){return e.enabled}function de(e,t){return e.name.localeCompare(t.name)}function P(e){return e.name}function fe(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function F(e){let t=(0,ce.c)(101),{draft:n,setDraft:r,builtinTools:i,zh:a}=e,o=y(),[s,c]=(0,w.useState)(``),[l,d]=(0,w.useState)(`all`),[f,p]=(0,w.useState)(),m;t[0]===i?m=t[1]:(m=new Map(i.map(L)),t[0]=i,t[1]=m);let h=m,g;t[2]!==i||t[3]!==n.tools?(g=[...new Set([...i.map(I),...Object.keys(n.tools)])].filter(pe).sort(),t[2]=i,t[3]=n.tools,t[4]=g):g=t[4];let _=g,v;if(t[5]!==_||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),v=_.filter(e),t[5]=_,t[6]=n.tools,t[7]=v}else v=t[7];let ie=v.length,b;if(t[10]!==_||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),b=_.filter(e),t[10]=_,t[11]=n.tools,t[12]=b}else b=t[12];let oe=b.length,se;if(t[15]!==_||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),se=_.filter(e),t[15]=_,t[16]=n.tools,t[17]=se}else se=t[17];let S;t[20]!==v.length||t[21]!==b.length||t[22]!==se.length?(S={allow:ie,ask:oe,deny:se.length},t[20]=v.length,t[21]=b.length,t[22]=se.length,t[23]=S):S=t[23];let C=S,E;if(t[24]!==_||t[25]!==h||t[26]!==n.tools||t[27]!==l||t[28]!==s){let e=s.trim().toLowerCase();E=_.filter(t=>{let r=n.tools[t]?.mode??`allow`,i=h.get(t),a=`${t} ${i?.en??``} ${i?.zh??``}`.toLowerCase();return(!e||a.includes(e))&&(l===`all`||r===l)}),t[24]=_,t[25]=h,t[26]=n.tools,t[27]=l,t[28]=s,t[29]=E}else E=t[29];let D=E,le;t[30]!==n||t[31]!==r?(le=(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]=le):le=t[32];let O=le,k=a?`全部 ${_.length}`:`All ${_.length}`,A;t[33]===k?A=t[34]:(A={id:`all`,label:k},t[33]=k,t[34]=A);let ue=a?`允许 ${C.allow}`:`Allow ${C.allow}`,j;t[35]===ue?j=t[36]:(j={id:`allow`,label:ue},t[35]=ue,t[36]=j);let M=a?`询问 ${C.ask}`:`Ask ${C.ask}`,N;t[37]===M?N=t[38]:(N={id:`ask`,label:M},t[37]=M,t[38]=N);let de=a?`禁用 ${C.deny}`:`Deny ${C.deny}`,P;t[39]===de?P=t[40]:(P={id:`deny`,label:de},t[39]=de,t[40]=P);let F;t[41]!==A||t[42]!==j||t[43]!==N||t[44]!==P?(F=[A,j,N,P],t[41]=A,t[42]=j,t[43]=N,t[44]=P,t[45]=F):F=t[45];let R=F,z=a?`默认工具权限`:`Default tool permissions`,B;t[46]===z?B=t[47]:(B=(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:z}),t[46]=z,t[47]=B);let V=a?`允许:直接执行;询问:执行前确认;禁用:智能体无法使用。`:`Allow runs directly, Ask requires confirmation, and Deny makes the tool unavailable.`,H;t[48]===V?H=t[49]:(H=(0,T.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:V}),t[48]=V,t[49]=H);let U;t[50]!==B||t[51]!==H?(U=(0,T.jsxs)(`div`,{children:[B,H]}),t[50]=B,t[51]=H,t[52]=U):U=t[52];let W=a?`工具筛选`:`Tool filter`,G;t[53]!==l||t[54]!==R?(G=R.map(e=>(0,T.jsx)(`button`,{"aria-pressed":l===e.id,type:`button`,onClick:()=>d(e.id),className:u(`rounded-lg px-3 py-1.5 text-xs font-medium`,l===e.id?`bg-surface-base text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:e.label},e.id)),t[53]=l,t[54]=R,t[55]=G):G=t[55];let K;t[56]!==W||t[57]!==G?(K=(0,T.jsx)(re,{className:`flex flex-wrap gap-1 rounded-xl bg-surface-panel p-1`,role:`group`,"aria-label":W,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:G}),t[56]=W,t[57]=G,t[58]=K):K=t[58];let q=a?`搜索工具`:`Search tools`,J;t[59]===q?J=t[60]:(J=(0,T.jsx)(`span`,{className:`sr-only`,children:q}),t[59]=q,t[60]=J);let Y;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,T.jsx)(ee,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),t[61]=Y):Y=t[61];let me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>c(e.target.value),t[62]=me):me=t[62];let X=a?`搜索工具`:`Search tools`,Z;t[63]!==s||t[64]!==X?(Z=(0,T.jsx)(`input`,{type:`search`,value:s,onChange:me,placeholder:X,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[63]=s,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==J||t[67]!==Z?(Q=(0,T.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[J,Y,Z]}),t[66]=J,t[67]=Z,t[68]=Q):Q=t[68];let $;t[69]!==K||t[70]!==Q?($=(0,T.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[K,Q]}),t[69]=K,t[70]=Q,t[71]=$):$=t[71];let he=a?`工具调用限制`:`Tool call limits`,ge=a?`每个工具的调用次数和超时限制继续生效;授权可在下方直接修改。`:`Call and timeout limits remain active; edit permissions below.`,_e;t[72]!==he||t[73]!==ge?(_e=(0,T.jsx)(ae,{title:he,summary:ge,children:null}),t[72]=he,t[73]=ge,t[74]=_e):_e=t[74];let ve;if(t[75]!==h||t[76]!==n.tools||t[77]!==f||t[78]!==o||t[79]!==O||t[80]!==D||t[81]!==a){let e;t[83]!==h||t[84]!==n.tools||t[85]!==f||t[86]!==o||t[87]!==O||t[88]!==a?(e=e=>{let t=n.tools[e]??{mode:`allow`},r=h.get(e),i=f===e;return(0,T.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`code`,{className:`text-xs font-medium text-fg`,children:e}),r?(0,T.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:a?r.zh:r.en}):null]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(re,{className:`flex rounded-lg bg-surface-base p-1`,role:`group`,"aria-label":e,indicatorClassName:`rounded-md bg-accent`,children:[`allow`,`ask`,`deny`].map(n=>(0,T.jsx)(`button`,{"aria-pressed":t.mode===n,type:`button`,onClick:()=>O(e,{mode:n}),className:u(`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,T.jsx)(ne,{variant:`ghost`,className:`px-2 py-1`,"aria-label":a?`${e} 调用限制`:`${e} call limits`,onClick:()=>p(i?void 0:e),children:(0,T.jsx)(te,{className:`size-4`})}):null]})]}),i&&o?(0,T.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-surface-base p-3 sm:grid-cols-2`,children:[(0,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`每轮最多调用次数`:`Maximum calls per turn`,(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:t.maxCallsPerTurn??``,placeholder:a?`不限制`:`Unlimited`,onChange:t=>O(e,{maxCallsPerTurn:fe(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,T.jsxs)(`label`,{className:`block text-xs font-medium text-fg-muted`,children:[a?`单次超时(毫秒)`:`Call timeout (ms)`,(0,T.jsx)(x,{allowEmpty:!0,type:`number`,min:1,value:t.timeoutMs??``,placeholder:a?`使用系统默认值`:`Use system default`,onChange:t=>O(e,{timeoutMs:fe(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[83]=h,t[84]=n.tools,t[85]=f,t[86]=o,t[87]=O,t[88]=a,t[89]=e):e=t[89],ve=D.map(e),t[75]=h,t[76]=n.tools,t[77]=f,t[78]=o,t[79]=O,t[80]=D,t[81]=a,t[82]=ve}else ve=t[82];let ye;t[90]!==D.length||t[91]!==a?(ye=D.length===0?(0,T.jsx)(`p`,{className:`px-4 py-10 text-center text-sm text-fg-muted`,children:a?`没有匹配的工具。`:`No matching tools.`}):null,t[90]=D.length,t[91]=a,t[92]=ye):ye=t[92];let be;t[93]!==ve||t[94]!==ye?(be=(0,T.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:[ve,ye]}),t[93]=ve,t[94]=ye,t[95]=be):be=t[95];let xe;return t[96]!==U||t[97]!==$||t[98]!==_e||t[99]!==be?(xe=(0,T.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-5`,children:[U,$,_e,be]}),t[96]=U,t[97]=$,t[98]=_e,t[99]=be,t[100]=xe):xe=t[100],xe}function pe(e){return e!==`computer_use`||_()}function I(e){return e.id}function L(e){return[e.id,e.description]}function R(){let e=(0,ce.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,T.jsxs)(oe,{gap:`gap-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`space-y-2`,children:[(0,T.jsx)(m,{className:`h-7 w-56`}),(0,T.jsx)(m,{className:`h-4 w-96 max-w-full`})]}),(0,T.jsx)(m,{className:`h-9 w-28`})]}),(0,T.jsx)(m,{className:`h-20 rounded-2xl`}),(0,T.jsx)(m,{className:`h-12 rounded-xl`}),(0,T.jsx)(m,{className:`h-72 rounded-2xl`})]}),e[0]=t):t=e[0],t}function z(e){let t=(0,ce.c)(65),{initial:n,builtinTools:r,zh:a}=e,[s,ee]=i(),te;t[0]===s?te=t[1]:(te=s.get(`panel`),t[0]=s,t[1]=te);let d=te,f=d===`skills`||d===`tools`||d===`runtime`?d:`skills`,p;t[2]!==s||t[3]!==ee?(p=e=>{let t=new URLSearchParams(s);t.set(`panel`,e),ee(t,{replace:!0})},t[2]=s,t[3]=ee,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,w.useState)(h),v;t[7]===n?v=t[8]:(v=()=>structuredClone(n),t[7]=n,t[8]=v);let[y,ae]=(0,w.useState)(v),x;t[9]===g?x=t[10]:(x=JSON.stringify(g),t[9]=g,t[10]=x);let E;t[11]===y?E=t[12]:(E=JSON.stringify(y),t[11]=y,t[12]=E);let D=x!==E,le=a?`技能`:`Skills`,k;t[13]===le?k=t[14]:(k={id:`skills`,label:le,icon:c},t[13]=le,t[14]=k);let A=a?`工具`:`Tools`,j;t[15]===A?j=t[16]:(j={id:`tools`,label:A,icon:l},t[15]=A,t[16]=j);let M=a?`运行`:`Runtime`,N;t[17]===M?N=t[18]:(N={id:`runtime`,label:M,icon:o},t[17]=M,t[18]=N);let de;t[19]!==j||t[20]!==N||t[21]!==k?(de=[k,j,N],t[19]=j,t[20]=N,t[21]=k,t[22]=de):de=t[22];let P=de,fe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(fe=async e=>{let t=structuredClone(e),n=await b(),r=await ie({...t,models:n.defaults.models},{scope:`agent`}),i=structuredClone(r.defaults);_(e=>JSON.stringify(e)===JSON.stringify(t)?i:e),ae(structuredClone(i))},t[23]=fe):fe=t[23];let pe=fe,I;t[24]!==D||t[25]!==g?(I={value:g,dirty:D,onSave:pe,delayMs:0},t[24]=D,t[25]=g,t[26]=I):I=t[26];let L=C(I),R=L.onBlurCapture,z=a?`智能体设置`:`Agent settings`,B;t[27]!==L.error||t[28]!==L.status?(B=(0,T.jsx)(S,{status:L.status,error:L.error}),t[27]=L.error,t[28]=L.status,t[29]=B):B=t[29];let V;t[30]!==z||t[31]!==B?(V=(0,T.jsx)(se,{title:z,actions:B}),t[30]=z,t[31]=B,t[32]=V):V=t[32];let H;t[33]!==L.error||t[34]!==L.retry||t[35]!==a?(H=L.error?(0,T.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,T.jsx)(`span`,{children:L.error}),(0,T.jsx)(ne,{type:`button`,variant:`ghost`,className:`h-8 text-red-600`,onClick:L.retry,children:a?`重试`:`Retry`})]}):null,t[33]=L.error,t[34]=L.retry,t[35]=a,t[36]=H):H=t[36];let U=a?`默认配置分区`:`Default configuration sections`,W;t[37]!==f||t[38]!==m||t[39]!==P?(W=P.map(e=>{let{id:t,label:n,icon:r}=e;return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":f===t,onClick:()=>m(t),className:u(`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,T.jsx)(r,{className:u(`size-4 shrink-0`,f===t?`text-accent`:`text-fg-subtle`)}),(0,T.jsx)(`span`,{className:`text-sm font-medium`,children:n})]},t)}),t[37]=f,t[38]=m,t[39]=P,t[40]=W):W=t[40];let G;t[41]!==U||t[42]!==W?(G=(0,T.jsx)(re,{as:`nav`,className:`grid grid-cols-3 gap-1 rounded-xl bg-surface-hover/20 p-1`,"aria-label":U,indicatorClassName:`rounded-lg bg-surface-base shadow-surface`,children:W}),t[41]=U,t[42]=W,t[43]=G):G=t[43];let K;t[44]!==f||t[45]!==g||t[46]!==a?(K=f===`skills`?(0,T.jsx)(ue,{draft:g,setDraft:_,zh:a}):null,t[44]=f,t[45]=g,t[46]=a,t[47]=K):K=t[47];let q;t[48]!==f||t[49]!==r||t[50]!==g||t[51]!==a?(q=f===`tools`?(0,T.jsx)(F,{draft:g,setDraft:_,builtinTools:r,zh:a}):null,t[48]=f,t[49]=r,t[50]=g,t[51]=a,t[52]=q):q=t[52];let J;t[53]!==f||t[54]!==g||t[55]!==a?(J=f===`runtime`?(0,T.jsx)(O,{draft:g,setDraft:_,zh:a}):null,t[53]=f,t[54]=g,t[55]=a,t[56]=J):J=t[56];let Y;return t[57]!==L.onBlurCapture||t[58]!==V||t[59]!==H||t[60]!==G||t[61]!==K||t[62]!==q||t[63]!==J?(Y=(0,T.jsxs)(oe,{gap:`gap-5`,onBlurCapture:R,children:[V,H,G,K,q,J]}),t[57]=L.onBlurCapture,t[58]=V,t[59]=H,t[60]=G,t[61]=K,t[62]=q,t[63]=J,t[64]=Y):Y=t[64],Y}function B(){let e=(0,ce.c)(17),t=d(H),n=f(V)===`zh`,{data:r,error:i,isLoading:a,mutate:o}=p(t?`settings-agent-defaults`:null,b);if(!t){let t=n?`需要本机服务令牌。`:`Local service token required.`,r;return e[0]===t?r=e[1]:(r=(0,T.jsx)(oe,{children:(0,T.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,T.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,T.jsx)(ne,{onClick:a,children:s}),e[6]=a,e[7]=s,e[8]=c):c=e[8];let ee;return e[9]!==r||e[10]!==c?(ee=(0,T.jsxs)(oe,{children:[r,c]}),e[9]=r,e[10]=c,e[11]=ee):ee=e[11],ee}if(a||!r){let t;return e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,T.jsx)(R,{}),e[12]=t):t=e[12],t}let s;return e[13]!==r.builtinTools||e[14]!==r.defaults||e[15]!==n?(s=(0,T.jsx)(z,{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 V(e){return e.language}function H(e){return e.conversationId}export{B 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{l as i,t as a,u as o}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as s}from"./arrow-left-D880xG-P.js";import{t as c}from"./chevron-down-ccbiQQz_.js";import{t as l}from"./working-directory-picker-modal-DHl2cZY1.js";import{t as ee}from"./circle-alert-BEjgurr2.js";import{t as te}from"./circle-check-C23XjkUj.js";import{t as u}from"./circle-BoO4YvTx.js";import{t as ne}from"./file-archive-DanfQJNe.js";import{t as d}from"./folder-open-CyzJ19I9.js";import{t as re}from"./loader-circle-CifKLtgG.js";import{t as ie}from"./package-wATCyihJ.js";import{t as f}from"./shield-check-BU58siTV.js";import{t as p}from"./upload-rrb46c3c.js";import{t as m}from"./messages-DRR9N3HC.js";import{t as h}from"./cn-0WouolD0.js";import{i as ae,n as g,o as _}from"./locale-store-lIXD1FMw.js";import{a as v}from"./vendor-swr-CdRzEUwF.js";import{t as y}from"./button-CnRSIP6m.js";import{t as oe}from"./skeleton-BI5TyibZ.js";import{a as b,i as x,o as S,r as C,s as w,t as T}from"./dist-DfWfZ9iu.js";import{t as se}from"./capability-links-DzQWK1Fh.js";import{t as E}from"./browser-BLJWD7WI.js";import{t as D}from"./capability-icon-DVoZxEgW.js";var ce=n(),O=e(E(),1),k=e(t(),1),A=r();function j(e){let t=(0,ce.c)(6),{fields:n,values:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=Object.entries(n),t[0]=n,t[1]=a);let o;return t[2]!==i||t[3]!==a||t[4]!==r?(o=(0,A.jsx)(A.Fragment,{children:a.map(e=>{let[t,n]=e;return(0,A.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[(0,A.jsxs)(`span`,{children:[n.title,n.required?` *`:``]}),n.type===`boolean`?(0,A.jsx)(`input`,{type:`checkbox`,checked:r[t]===!0,onChange:e=>i({...r,[t]:e.target.checked})}):(0,A.jsx)(`input`,{className:`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2.5`,type:n.sensitive?`password`:n.type===`number`?`number`:`text`,required:n.required,autoComplete:`off`,value:String(r[t]??``),onChange:e=>i({...r,[t]:n.type===`number`?Number(e.target.value):e.target.value})})]},t)})}),t[2]=i,t[3]=a,t[4]=r,t[5]=o):o=t[5],o}function M(e){let t=(0,ce.c)(62),{account:n,fields:r,zh:i,busy:a,attempt:o,initialMethod:c,onBack:l,onConnect:ee,onSave:te,onRedirect:u,onSkip:ne}=e,[d,ie]=(0,k.useState)(c&&n.methods.some(e=>e.id===c)?c:n.methods[0]?.id??``),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={},t[0]=f):f=t[0];let[p,m]=(0,k.useState)(f),[h,ae]=(0,k.useState)(``),[g,_]=(0,k.useState)(),v;t[1]===d?v=t[2]:(v=e=>e.id===d,t[1]=d,t[2]=v);let b=n.methods.find(v),x;t[3]===i?x=t[4]:(x=(e,t)=>i?e:t,t[3]=i,t[4]=x);let S=x,C=o?.challenge?.type===`qr`?o.challenge.url:void 0,w,T;t[5]===C?(w=t[6],T=t[7]):(w=()=>{let e=!1;return _(void 0),C&&O.toDataURL(C,{width:240,margin:2}).then(t=>{e||_(t)}).catch(P),()=>{e=!0}},T=[C],t[5]=C,t[6]=w,t[7]=T),(0,k.useEffect)(w,T);let se;t[8]===o?se=t[9]:(se=o&&![`cancelled`,`error`,`connected`].includes(o.state),t[8]=o,t[9]=se);let E=se,D=o?.authorizationUrl??o?.challenge?.url,M=`连接 ${n.title}`,F=`Connect ${n.title}`,I;t[10]!==S||t[11]!==M||t[12]!==F?(I=S(M,F),t[10]=S,t[11]=M,t[12]=F,t[13]=I):I=t[13];let L;t[14]===S?L=t[15]:(L=S(`返回插件详情`,`Back to plugin details`),t[14]=S,t[15]=L);let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,A.jsx)(s,{className:`size-4`}),t[16]=R):R=t[16];let z;t[17]!==l||t[18]!==L?(z=(0,A.jsx)(y,{variant:`ghost`,className:`shrink-0`,onClick:l,"aria-label":L,children:R}),t[17]=l,t[18]=L,t[19]=z):z=t[19];let B;t[20]===S?B=t[21]:(B=S(`连接 `,`Connect `),t[20]=S,t[21]=B);let V;t[22]!==n.title||t[23]!==B?(V=(0,A.jsxs)(`h3`,{className:`text-base font-semibold`,children:[B,n.title]}),t[22]=n.title,t[23]=B,t[24]=V):V=t[24];let H;t[25]!==n.description||t[26]!==S?(H=n.description??S(`完成授权后自动检查连接。也可以稍后在详情页继续。`,`The connection is checked after authorization. You can also continue later in plugin details.`),t[25]=n.description,t[26]=S,t[27]=H):H=t[27];let U;t[28]===H?U=t[29]:(U=(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:H}),t[28]=H,t[29]=U);let W;t[30]!==V||t[31]!==U?(W=(0,A.jsxs)(`div`,{children:[V,U]}),t[30]=V,t[31]=U,t[32]=W):W=t[32];let G;t[33]!==z||t[34]!==W?(G=(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[z,W]}),t[33]=z,t[34]=W,t[35]=G):G=t[35];let K;t[36]!==n.methods||t[37]!==E||t[38]!==a||t[39]!==d||t[40]!==S?(K=n.methods.length>1?(0,A.jsx)(`div`,{role:`tablist`,"aria-label":S(`授权方式`,`Authorization methods`),className:`flex flex-wrap gap-2 rounded-lg bg-surface-inset p-1.5`,children:n.methods.map(e=>(0,A.jsx)(`button`,{role:`tab`,type:`button`,"aria-selected":d===e.id,className:`min-h-10 rounded-md px-3 text-sm ${d===e.id?`bg-surface-panel font-medium text-fg`:`text-fg-muted`}`,disabled:a||!!E,onClick:()=>{ie(e.id),m({})},children:e.title},e.id))}):null,t[36]=n.methods,t[37]=E,t[38]=a,t[39]=d,t[40]=S,t[41]=K):K=t[41];let q=b?.instructions?.length||b?.helpUrl?(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge bg-surface-inset p-4 text-sm text-fg-muted`,children:[b.instructions?.length?(0,A.jsx)(`ol`,{className:`list-decimal space-y-2 pl-5`,children:b.instructions.map(N)}):null,b.helpUrl?(0,A.jsx)(`a`,{className:`text-accent underline`,href:b.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:S(`打开官方配置说明`,`Open setup instructions`)}):null]}):null,J=(b?.type===`form`||b?.fields?.length)&&!E?(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),te(b.id,p)},children:[(0,A.jsx)(j,{fields:Object.fromEntries((b.fields??[]).filter(e=>r[e]).map(e=>[e,{...r[e],required:!0}])),values:p,onChange:m}),(0,A.jsxs)(y,{type:`submit`,disabled:a||!b.fields?.every(e=>p[e]!==void 0&&p[e]!==``),children:[a?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,S(`保存并连接`,`Save and connect`)]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[E?null:(0,A.jsx)(y,{disabled:a,onClick:()=>ee(d),children:S(`连接账号`,`Connect account`)}),E?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:o.challenge?.message??(o.state===`preparing`?S(`正在准备登录…`,`Preparing sign-in…`):S(`请完成登录,返回后会自动继续。`,`Finish signing in. Installation continues automatically.`))}):null,C&&E?g?(0,A.jsx)(`img`,{src:g,alt:S(`使用 ${n.title} 扫码授权`,`Scan to authorize ${n.title}`),className:`mx-auto size-60 max-w-full rounded-lg`}):(0,A.jsx)(oe,{className:`mx-auto size-60`}):null,D&&E?(0,A.jsx)(`a`,{href:D,target:`_blank`,rel:`noopener noreferrer`,className:`inline-block text-sm text-accent underline`,children:C?S(`也可以打开授权页面`,`Or open the authorization page`):S(`打开登录页面`,`Open sign-in page`)}):null,o?.expiresAt&&E?(0,A.jsxs)(`p`,{className:`text-center text-xs text-fg-muted`,children:[S(`本次授权有效期至 `,`This sign-in expires at `),new Date(o.expiresAt).toLocaleTimeString()]}):null,o?.error?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:o.error}):null,o?.acceptsRedirect&&E?(0,A.jsxs)(`details`,{className:`text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:S(`登录后没有自动返回?`,`Did sign-in not return automatically?`)}),(0,A.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:e=>{e.preventDefault(),u(h)},children:[(0,A.jsxs)(`label`,{children:[S(`登录回调地址`,`Sign-in callback URL`),(0,A.jsx)(`input`,{value:h,onChange:e=>ae(e.target.value),className:`mt-1 w-full rounded-lg border border-edge bg-surface-inset p-2`})]}),(0,A.jsx)(y,{type:`submit`,disabled:a||!h,children:S(`继续登录`,`Continue sign-in`)})]})]}):null]}),Y;t[42]===S?Y=t[43]:(Y=S(`暂时跳过`,`Skip for now`),t[42]=S,t[43]=Y);let X;t[44]!==a||t[45]!==ne||t[46]!==Y?(X=(0,A.jsx)(y,{variant:`secondary`,disabled:a,onClick:ne,children:Y}),t[44]=a,t[45]=ne,t[46]=Y,t[47]=X):X=t[47];let Z;t[48]===S?Z=t[49]:(Z=S(`相关功能暂不可用,可随时在插件详情中授权。`,`Features requiring this account stay unavailable. Connect later in plugin details.`),t[48]=S,t[49]=Z);let le;t[50]===Z?le=t[51]:(le=(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Z}),t[50]=Z,t[51]=le);let ue;t[52]!==X||t[53]!==le?(ue=(0,A.jsxs)(`div`,{className:`border-t border-edge pt-4`,children:[X,le]}),t[52]=X,t[53]=le,t[54]=ue):ue=t[54];let Q;return t[55]!==I||t[56]!==G||t[57]!==K||t[58]!==q||t[59]!==J||t[60]!==ue?(Q=(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":I,children:[G,K,q,J,ue]}),t[55]=I,t[56]=G,t[57]=K,t[58]=q,t[59]=J,t[60]=ue,t[61]=Q):Q=t[61],Q}function N(e,t){return(0,A.jsx)(`li`,{children:e},t)}function P(){}async function F(e,t=`GET`,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function I({extension:e,zh:t,onChanged:n,onStart:r,onInstalled:i,initialConnect:o=!1}){let s=`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,[c,l]=(0,k.useState)(),[ne,d]=(0,k.useState)({}),[ie,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(``),[h,ae]=(0,k.useState)({}),[g,_]=(0,k.useState)(null),[v,b]=(0,k.useState)(``),[x,S]=(0,k.useState)(null),[C,w]=(0,k.useState)(!1),T=(0,k.useRef)(new Set),se=(0,k.useRef)(new Set),E=(0,k.useRef)(void 0),D=(0,k.useRef)(null),ce=(0,k.useRef)(new Set),O=(e,n)=>t?e:n,N=e.setup?.authorizations??[],P=new Set(N.flatMap(e=>e.servers)),I=[...N,...(c?.connections??[]).filter(t=>!P.has(t.name)&&(e.components?.mcp.find(e=>e.name===t.name)?.type!==`stdio`||t.state===`token_required`)).map(t=>{let n=t.state===`token_required`||e.components?.mcp.find(e=>e.name===t.name)?.connectionAuth?.mode===`api-key`;return{id:t.name,title:t.name,servers:[t.name],methods:[{id:n?`api-key`:`oauth`,title:n?O(`访问令牌`,`Access token`):O(`浏览器登录`,`Browser sign-in`),type:n?`form`:`oauth`,...n?{fields:[`__apiKey`]}:{server:t.name}}]}})],L=e=>e.servers.every(e=>c?.connections.find(t=>t.name===e)?.state===`connected`)&&(!N.some(t=>t.id===e.id)||c?.authorizations?.find(t=>t.id===e.id)?.state===`connected`),R=(c?.authorizations??[]).flatMap(e=>(e.issues??[]).map(t=>({...t,account:I.find(t=>t.id===e.id)}))),z=I.filter(e=>!L(e)),B=c?.installed||c?.state===`completed`,V=e.setup?.userConfig??{},H=new Set(N.flatMap(e=>e.methods.flatMap(e=>e.fields??[]))),U=Object.fromEntries(Object.entries(V).filter(([e])=>!H.has(e))),W=c?.error===`Connection verification failed. Check the credentials or login status and try again.`?O(`连接验证未通过,请检查凭据或登录状态后重试。`,c.error):c?.error,G=Object.fromEntries(Object.entries(V).filter(([e])=>c?.missingConfig?.includes(e))),K=ie||c?.state===`running`,q=I.find(e=>e.id===x);(0,k.useEffect)(()=>{let e=!1;return F(`${s}/setup`).then(t=>{e||l(t)}).catch(t=>{e||(l(null),m(String(t)))}),()=>{e=!0}},[s]),(0,k.useEffect)(()=>{if(c?.state!==`running`)return;let e=!1,t=!1,r=setInterval(()=>{t||(t=!0,F(`${s}/setup`).then(t=>{e||(l(t),t?.state!==`running`&&n())}).catch(t=>{e||m(String(t))}).finally(()=>{t=!1}))},750);return()=>{e=!0,clearInterval(r)}},[s,c?.state]),(0,k.useEffect)(()=>{if(!c||!c.connections.some(e=>[`oauth_required`,`error`].includes(e.state)))return;let e=!1;return F(`${s}/setup/reusable`).then(t=>{e||ae(t)}).catch(()=>{e||ae({})}),()=>{e=!0}},[s,c?.revision]),(0,k.useEffect)(()=>{if(!v||c?.state===`completed`)return;let e=!1,t=!1,n=async()=>{if(!t){t=!0;try{let t=await F(`${s}/setup/auth/${encodeURIComponent(v)}`);e||_(t)}catch(t){e||m(String(t))}finally{t=!1}}};n();let r=setInterval(()=>void n(),1500),i=()=>void n();return window.addEventListener(`focus`,i),()=>{e=!0,clearInterval(r),window.removeEventListener(`focus`,i)}},[s,v,c?.state]),(0,k.useEffect)(()=>{let e=g?.authorizationUrl??(g?.challenge?.type===`url`?g.challenge.url:void 0);if(!g)return;if(g.error||[`cancelled`,`error`,`connected`].includes(g.state)){D.current?.close(),D.current=null;return}if(!e){g.challenge?.type===`qr`&&(D.current?.close(),D.current=null);return}let t=`${g.id}:${e}`;if(ce.current.has(t))return;ce.current.add(t);let n=D.current;D.current=null,n&&!n.closed?n.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)},[g]);async function J(e,t={},r=c?.revision){f(!0),m(``);try{let a=await F(`${s}/setup`,`POST`,{action:e,expectedRevision:r,...e===`start`?{}:{idempotencyKey:crypto.randomUUID()},...t}),o=e===`configure`&&N.find(e=>e.id===t.authorization)?.methods.some(e=>e.id===t.method&&e.type===`cli`);return([`reuse`,`start`].includes(e)||e===`configure`&&!o)&&(d({}),w(!1),a=await F(`${s}/setup`,`POST`,{action:`prepare`,expectedRevision:a.revision,idempotencyKey:crypto.randomUUID()})),l(a),await n(),[`complete`,`defer`].includes(e)&&(S(null),_(null),b(``),D.current?.close(),D.current=null,i?.()),a}catch(e){m(e instanceof Error?e.message:String(e));try{l(await F(`${s}/setup`))}catch{}return null}finally{f(!1)}}(0,k.useEffect)(()=>{if(!c||K||p||[`cancelled`,`running`,`failed`].includes(c.state)||c.state===`completed`)return;let e,t=``;if(c.state===`pending`?(e=`prepare`,t=`prepare:${s}:${c.revision}`):g?.state===`connected`&&(e=`prepare`,t=`auth:${s}:${g.id}`),e&&!T.current.has(t)){T.current.add(t),J(e);return}c.resources===`ready`&&!c.missingConfig?.length&&!c.partial&&c.connections.every(e=>e.state===`connected`)&&(c.authorizations??[]).every(e=>e.state===`connected`)&&(t=`complete:${s}:${c.revision}`,T.current.has(t)||(T.current.add(t),J(`complete`)))},[c,g,K,p,s]),(0,k.useEffect)(()=>{K||!c||c.state===`cancelled`||(q&&c.revision!==E.current&&L(q)?(S(null),_(null),b(``)):(!B||o)&&c.resources===`ready`&&(!c.missingConfig?.length||o&&!c.missingConfig.some(e=>e in U))&&!x&&z[0]&&!se.current.has(z[0].id)&&(se.current.add(z[0].id),E.current=c.revision,S(z[0].id)))},[c,K,B,x,o]);function Y(e,t){let n=e.methods.find(e=>e.id===t),r=n?.type===`oauth`||n?.type===`cli`?window.open(`about:blank`,`_blank`):null;r&&(r.opener=null),D.current=r,_(null),J(`authorize`,{server:e.id,...N.some(t=>t.id===e.id)?{method:t}:{}}).then(t=>{t?b(e.id):(r?.close(),D.current=null)})}async function X(t,n,r){if(n===`api-key`&&!N.some(e=>e.id===t.id)){f(!0),m(``);try{let n=e.components?.mcp.find(e=>e.name===t.id);await F(`${s}/mcp/${encodeURIComponent(t.id)}/auth`,`PUT`,{mode:`api-key`,secrets:[{target:n.type===`stdio`?`env`:`headers`,key:n.connectionAuth?.headerName??(n.type===`stdio`?`API_KEY`:`Authorization`),prefix:n.connectionAuth?.prefix??(n.type===`stdio`?``:`Bearer `),value:r.__apiKey}]});let i=await F(`${s}/setup`);l(i),f(!1),await J(`prepare`,{},i.revision);return}catch(e){m(String(e)),f(!1);return}f(!1)}else if(t.methods.find(e=>e.id===n)?.type===`cli`){let e=window.open(`about:blank`,`_blank`);e&&(e.opener=null),D.current=e,_(null);let i=await J(`configure`,{authorization:t.id,method:n,values:r},c?.revision);i&&await J(`authorize`,{server:t.id,method:n},i.revision)?b(t.id):(e?.close(),D.current=null)}else await J(`configure`,{authorization:t.id,method:n,values:r})}if(c===void 0)return(0,A.jsx)(oe,{className:`h-40 w-full`});let Z=()=>{J(`defer`)};return q?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(M,{initialMethod:c?.authorizations?.find(e=>e.id===q.id)?.method,account:q,fields:{...V,__apiKey:{type:`string`,title:O(`访问令牌`,`Access token`),required:!0,sensitive:!0}},zh:t,busy:K,attempt:g,onBack:()=>S(null),onConnect:e=>Y(q,e),onSave:(e,t)=>void X(q,e,t),onRedirect:e=>{f(!0),F(`${s}/setup/auth/${encodeURIComponent(v)}/redirect`,`POST`,{url:e}).catch(e=>m(String(e))).finally(()=>f(!1))},onSkip:Z},`${q.id}:${c?.authorizations?.find(e=>e.id===q.id)?.method??``}`),h[q.id]?.map(e=>(0,A.jsxs)(y,{disabled:K,variant:`secondary`,onClick:()=>void J(`reuse`,{server:q.id,sourceServerId:e.id}),children:[O(`使用已登录账号:`,`Use signed-in account: `),e.name]},e.id)),p||W&&q.servers.some(e=>c?.connections.find(t=>t.name===e)?.state===`error`)?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p||W}):null]}):(0,A.jsxs)(`section`,{className:`space-y-5`,"aria-label":O(`插件安装与授权`,`Plugin setup`),children:[B?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装完成`,`Installation complete`)}),(0,A.jsx)(`p`,{role:`status`,className:`mt-1 text-sm text-fg-muted`,children:e.activationEligible===!1?O(`插件已停用。`,`Plugin is disabled.`):c?.partial||z.length||R.length||c?.missingConfig?.length?O(`插件已安装,部分功能仍需要授权。`,`Plugin installed. Some features still need authorization.`):O(`所有 Agent 均可使用。可在 Agent 设置中单独调整。`,`Available to all agents. Customize individual agents in Agent settings.`)})]}):(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:O(`安装准备`,`Installation setup`)}),(0,A.jsx)(`ol`,{className:`mt-4 space-y-4 text-sm`,"aria-live":`polite`,children:[{name:O(`准备资源`,`Prepare resources`),done:c?.resources===`ready`,running:K&&c?.resources!==`ready`},{name:O(`授权账号`,`Authorize accounts`),done:c?.resources===`ready`&&!c?.missingConfig?.length&&z.length===0,running:!1},{name:O(`加载可用工具`,`Load available tools`),done:!1,running:K&&c?.resources===`ready`}].map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-3`,children:[e.done?(0,A.jsx)(te,{className:`size-5 text-accent`,"aria-hidden":!0}):e.running?(0,A.jsx)(re,{className:`size-5 animate-spin text-accent`,"aria-hidden":!0}):(0,A.jsx)(u,{className:`size-5 text-fg-muted`,"aria-hidden":!0}),e.name]},e.name))}),(0,A.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:O(`安装后所有 Agent 均可使用,可在各自的设置中调整。`,`Available to all agents after installation. Customize individual agents in Agent settings.`)})]}),!c||c.state===`cancelled`?(0,A.jsx)(y,{disabled:ie||e.readiness===`blocked`,onClick:()=>void J(`start`),children:O(`继续安装`,`Continue installation`)}):(0,A.jsxs)(A.Fragment,{children:[c.missingConfig?.length||C?(0,A.jsxs)(`form`,{className:`space-y-4 rounded-xl border border-edge p-4`,onSubmit:e=>{e.preventDefault(),J(`configure`,{values:ne})},children:[(0,A.jsx)(`h4`,{className:`font-medium`,children:O(`补充配置`,`Required configuration`)}),(0,A.jsx)(j,{fields:C?U:G,values:ne,onChange:d}),(0,A.jsx)(y,{type:`submit`,disabled:K||!Object.keys(ne).length,children:O(`继续`,`Continue`)})]}):null,B&&(z.length||c.missingConfig?.length)?(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(ee,{className:`mt-0.5 size-5 shrink-0`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium`,children:O(`需要授权`,`Authorization required`)}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:O(`授权后即可使用相关功能。已就绪的功能可继续使用。`,`Connect these accounts to use their features. Ready features remain available.`)})]})]}):null,R.length?(0,A.jsx)(`div`,{className:`space-y-3`,"aria-label":O(`需要补充权限`,`Additional permissions required`),children:R.map(e=>(0,A.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`text-fg-muted`,children:O(`账号已连接,以下权限尚未就绪;其他已授权功能可继续使用。`,`Account connected. These permissions are not ready; other authorized features remain available.`)}),e.scopes.length?(0,A.jsx)(`p`,{className:`break-all font-mono text-xs`,children:e.scopes.join(`, `)}):null,(0,A.jsx)(`ol`,{className:`list-inside list-decimal space-y-1 text-fg-muted`,children:e.instructions.map(e=>(0,A.jsx)(`li`,{children:e},e))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.helpUrl?(0,A.jsx)(y,{variant:`secondary`,asChild:!0,children:(0,A.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,children:O(`前往开通应用权限`,`Open application permissions`)})}):null,e.method&&e.account?(0,A.jsx)(y,{disabled:K,onClick:()=>{E.current=c.revision,S(e.account.id),Y(e.account,e.method)},children:O(`补充授权`,`Grant missing permissions`)}):null,(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`重新检查权限`,`Check permissions again`)})]})]},`${e.account?.id}:${e.id}`))}):null,I.length?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h4`,{className:`text-sm font-medium`,children:O(`账号与连接`,`Accounts and connections`)}),I.map(e=>(0,A.jsxs)(`div`,{role:`group`,"aria-label":e.title,className:`flex items-center justify-between gap-3 rounded-lg border border-edge p-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:L(e)?O(`已连接`,`Connected`):O(`需要授权`,`Authorization required`)})]}),(0,A.jsx)(y,{variant:L(e)?`secondary`:`primary`,disabled:K||c.resources!==`ready`,onClick:()=>{_(null),b(``),E.current=c.revision,S(e.id)},children:L(e)?O(`重新授权`,`Reconnect`):O(`连接账号`,`Connect account`)})]},e.id))]}):null,!B&&c.resources===`ready`?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:Z,children:O(`暂时跳过`,`Skip for now`)}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:O(`先完成安装,稍后在详情页授权。未授权的功能暂不可用。`,`Finish installation and connect later in plugin details. Unauthenticated features remain unavailable.`)})]}):null,B&&Object.keys(U).length&&!C?(0,A.jsx)(y,{variant:`ghost`,disabled:K,onClick:()=>w(!0),children:O(`修改插件配置`,`Edit plugin configuration`)}):null,B&&!R.length&&N.some(e=>e.methods.some(e=>e.type===`cli`))?(0,A.jsx)(y,{variant:`secondary`,disabled:K,onClick:()=>void J(`prepare`),children:O(`检查连接与权限`,`Check connection and permissions`)}):null,!K&&(p||[`failed`,`interrupted`].includes(c.state)||c.connections.some(e=>e.state===`error`))?(0,A.jsx)(y,{variant:`secondary`,onClick:()=>void J(`prepare`),children:O(`重试检查`,`Retry checks`)}):null,B?null:(0,A.jsx)(y,{variant:`ghost`,disabled:ie,onClick:()=>void J(`cancel`),children:O(`取消安装`,`Cancel installation`)}),B&&!z.length&&!c.missingConfig?.length?e.setup?.tasks?.map(t=>(0,A.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-inset p-4 text-sm`,children:[(0,A.jsx)(`p`,{children:t}),(0,A.jsx)(y,{asChild:!0,disabled:!e.active,children:(0,A.jsx)(a,{to:`/chat/new?${new URLSearchParams({draft:t,projectScope:`none`})}`,state:{forceNewChat:!0},onClick:t=>{e.active?r?.():t.preventDefault()},children:O(`开始这个任务`,`Start this task`)})})]},t)):null]}),K?(0,A.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:O(`正在准备,可关闭后继续。`,`Preparing. You can close this window and resume.`)}):null,c?.error&&!c.deferred&&!c.missingConfig?.length?(0,A.jsx)(`p`,{className:`text-sm text-fg-muted`,children:W}):null,p?(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-fg-muted`,children:p}):null]})}var L=`w-full rounded-lg border border-edge bg-surface-inset px-3 py-2 text-sm text-fg`;function R(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?`在 Gateway 上运行工具服务:${n}`:`Run a tool service on the Gateway: ${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.startsWith(`runtime.capability-access:`)?t?`按账号授权启用相关技能和工具`:`Enable skills and tools according to account authorization`:e.startsWith(`runtime.authorization:`)?t?`在本机运行账号登录程序:${e.split(`:`)[1]}`:`Run account sign-in locally: ${e.split(`:`)[1]}`:e.startsWith(`runtime.resource:`)?t?`下载可执行资源:${e.split(`:`)[1]}`:`Download executable resource: ${e.split(`:`)[1]}`:e.startsWith(`network.resource:`)?t?`下载并校验资源:${e.split(`:`)[1]}`:`Download and verify resource: ${e.split(`:`)[1]}`:e}function z(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 B(e,t,n){let r=await _(ae(e),{method:t,...n===void 0?{}:{body:JSON.stringify(n)}});if(!r.ok)throw Error(r.error??`Request failed`);return r.payload}function V({extension:e,onClose:t,onUninstalled:n,initialSource:r=``,marketplace:a,autoInstall:s=!1}){let ee=g(e=>e.language),u=ee.startsWith(`zh`),ae=a?.localizations?.[u?`zh-CN`:`en`],_=ae?.displayName??a?.name,oe=ae?.description??a?.description,E=(0,k.useId)(),{mutate:ce}=v(),[O,j]=(0,k.useState)(e),[M,N]=(0,k.useState)(r||e?.installationSource||``),[P,F]=(0,k.useState)(null),[V,H]=(0,k.useState)([]),[U,W]=(0,k.useState)(!1),[G,K]=(0,k.useState)(``),[q,J]=(0,k.useState)(!1),[Y,X]=(0,k.useState)(!1),[Z,le]=(0,k.useState)(!1),[ue,Q]=(0,k.useState)(!1),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(!1),he=o(),ge=i(),[_e,ve]=(0,k.useState)(!1),ye=(0,k.useRef)(!1),be=`/api/extensions/agent-plugins/${encodeURIComponent(O?.pluginId??``)}`,xe=M.trim().startsWith(`store:`),Se=()=>ce(`gateway-extensions-list`);async function $(e){W(!0),K(``);try{await e()}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}function Ce(e){N(e),F(null),H([]),K(``)}let we=typeof window<`u`?window.electronAPI?.file:void 0,Te=/^(?:\/|[A-Za-z]:[\\/])/.test(M.trim())?M.trim():void 0;async function Ee(){if(!we?.openDirectory){fe(!0);return}let e=await we.openDirectory(Te?{defaultPath:Te}:void 0);e&&Ce(e)}async function De(){if(!we?.openFile){fe(!0);return}let e=await we.openFile({...Te?{defaultPath:Te}:{},extensions:[`zip`]});e&&Ce(e)}function Oe(e){return[...e.dataTransfer.types].some(e=>e===`Files`||e===`text/plain`||e===`text/uri-list`)}function ke(e){if(!Oe(e))return;e.preventDefault(),Q(!1);let t=Array.from(e.dataTransfer.files);if(t.length){if(t.length>1){K(u?`一次只能选择一个插件目录或 ZIP。`:`Choose one plugin directory or ZIP at a time.`);return}let e=we?.getPathForFile?.(t[0]);e?Ce(e):K(u?`浏览器无法读取本机文件路径,请使用“选择文件或目录”选择安装包。`:`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()&&Ce(n.trim().split(/\r?\n/)[0])}async function Ae(e){let t=await B(`${be}/activation`,`POST`,{enabled:e});j(t),await Se()}async function je(e){let t=!O,n=await B(t?`/api/extensions/install`:`${be}/update`,`POST`,{source:M,reviewHash:e.reviewHash,...e.layout?{setup:!0}:{}});j(n),await Se(),!e.layout&&t&&!n.activationEligible&&n.readiness!==`blocked`&&n.pluginId&&(n=await B(`/api/extensions/agent-plugins/${encodeURIComponent(n.pluginId)}/activation`,`POST`,{enabled:!0}),j(n),await Se()),F(null),ve(!e.layout&&t&&n.activationEligible===!0)}async function Me(){let e=await B(`/api/extensions/inspect`,`POST`,{source:M});if(z(e,a)){F(e);return}await je(e)}(0,k.useEffect)(()=>{e&&!e.setup&&j(e)},[e]),(0,k.useEffect)(()=>{if(!e?.setup||!e.pluginId)return;let t=!1;return B(`/api/extensions/agent-plugins/${encodeURIComponent(e.pluginId)}`,`GET`).then(e=>{t||j(e)}).catch(()=>{}),()=>{t=!0}},[e?.pluginId]),(0,k.useEffect)(()=>{!s||O||!xe||ye.current||(ye.current=!0,$(Me))},[s,O,xe]);let Ne=s&&!O&&xe&&!ye.current;return(0,A.jsx)(T,{defaultOpen:!0,onOpenChange:e=>!e&&t(),children:(0,A.jsxs)(S,{children:[(0,A.jsx)(b,{className:`fixed inset-0 z-[130] bg-scrim`}),(0,A.jsxs)(C,{className:`fixed left-1/2 top-1/2 z-[131] flex max-h-[min(42rem,calc(100dvh-2rem))] w-[min(38rem,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,A.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsx)(D,{iconUrl:O?.branding?.iconUrl??a?.branding?.iconUrl,fallback:ie}),(0,A.jsx)(w,{className:`font-semibold`,children:O?.name??_??(u?`安装插件`:`Install plugin`)})]}),(0,A.jsx)(y,{variant:`ghost`,onClick:t,children:u?`关闭`:`Close`})]}),(0,A.jsx)(x,{className:`sr-only`,children:u?`安装、组件、账号连接和权限`:`Installation, components, connections and permissions`}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-auto space-y-4 overflow-y-auto overscroll-contain p-4`,children:[!O&&xe?(0,A.jsxs)(`section`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:_??P?.manifest.name??M.slice(6)}),oe?(0,A.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:oe}):null,(0,A.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:a?.publisher?.verification===`verified`?u?`已认证发布者 · 安装后所有 Agent 均可使用`:`Verified publisher · available to all agents after installation`:u?`安装前会检查来源和所需权限`:`Source and required permissions are checked before installation`})]})]}),P?null:(0,A.jsxs)(y,{className:`w-full`,disabled:U||Ne,onClick:()=>void $(Me),children:[U||Ne?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,U||Ne?u?`正在安全检查并安装…`:`Checking and installing…`:u?`一键安装`:`Install`]})]}):null,O?(0,A.jsxs)(A.Fragment,{children:[_e?(0,A.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,A.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-fg`,children:u?`插件已安装并启用`:`Plugin installed and enabled`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`现在可以直接在对话中使用它。`:`It is ready to use in your conversations.`})]})]}):null,(!O.setup||O.readiness!==`setup_required`)&&!O.activationEligible?(0,A.jsxs)(`div`,{role:`status`,className:`space-y-3 rounded-lg border border-accent/25 bg-accent-soft p-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium text-accent-fg`,children:u?`插件已安装,当前尚未启用`:`Plugin installed. It is not enabled yet.`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u?`启用后,Skills 和 MCP 才会加入 Agent 运行时。`:`Enable it to make its skills and MCP servers available to the Agent runtime.`})]}),(0,A.jsx)(y,{disabled:U||O.readiness===`blocked`,onClick:()=>void $(()=>Ae(!0)),children:u?`启用插件`:`Enable plugin`})]}):null,O.setup?(0,A.jsx)(I,{extension:O,zh:u,onStart:t,onInstalled:()=>{t(),he(se(O.pluginId,`installed`,!1,ge.pathname+ge.search))},onChanged:async()=>{let e=await B(`${be}`,`GET`);j(e),await Se()}}):null,(0,A.jsxs)(`details`,{className:`rounded-lg border border-edge p-3`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:u?`插件详情`:`Plugin details`}),(0,A.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[u?`插件`:`Plugin`,` · `,O.version,` · `,O.readiness&&{ready:u?`已就绪`:`Ready`,setup_required:u?`待连接`:`Setup required`,degraded:u?`部分不可用`:`Partially available`,blocked:u?`已阻止`:`Blocked`}[O.readiness]]}),O.provenance?(0,A.jsxs)(`p`,{className:`break-words text-xs text-fg-muted`,children:[O.provenance.publisherVerification===`verified`?u?`已认证发布者`:`Verified publisher`:u?`社区发布者`:`Community publisher`,` · `,O.provenance.packageName,`@`,O.provenance.version,` · SHA-256 `,O.provenance.sha256.slice(0,12),`…`,O.provenance.riskTier?` · ${O.provenance.riskTier}`:``]}):null,(0,A.jsx)(`p`,{className:`text-sm`,children:O.description}),O.installationSource?(0,A.jsxs)(`p`,{className:`break-all text-xs text-fg-muted`,children:[u?`来源:`:`Source: `,O.installationSource,O.resolvedCommit?` · ${O.resolvedCommit.slice(0,12)}`:``]}):null,O.activationEligible?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(()=>Ae(!1)),children:u?`停用`:`Disable`}):null,O.canRollback?(0,A.jsx)(y,{disabled:U,variant:`secondary`,onClick:()=>void $(async()=>{j(await B(`${be}/rollback`,`POST`)),await Se()}),children:u?`回滚上一版本`:`Roll back`}):null]})]}),O.diagnostics?.map((e,t)=>(0,A.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[e.component,`: `,e.message]},t))]}):null,O?(0,A.jsxs)(y,{variant:`ghost`,className:`px-0`,"aria-expanded":pe,onClick:()=>me(e=>!e),children:[(0,A.jsx)(c,{className:h(`size-4 transition-transform motion-reduce:transition-none`,pe&&`rotate-180`),"aria-hidden":!0}),u?`高级操作`:`Advanced actions`]}):null,!O&&!xe||pe?(0,A.jsxs)(`form`,{className:h(`space-y-3`,O&&`border-t border-edge pt-4`),onSubmit:e=>{e.preventDefault(),$(async()=>{let e=await B(`/api/extensions/inspect`,`POST`,{source:M});e.candidates?(H(e.candidates),F(null)):(H([]),F(e))})},children:[(0,A.jsxs)(`div`,{"data-testid":`plugin-source-dropzone`,className:h(`rounded-xl border border-dashed p-3 transition-colors`,ue?`border-accent bg-accent-soft`:`border-edge bg-surface-inset/40`),onDragEnter:e=>{Oe(e)&&(e.preventDefault(),Q(!0))},onDragOver:e=>{Oe(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,Q(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Q(!1)},onDrop:ke,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-start gap-2`,children:[(0,A.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:E,className:`block text-sm font-medium`,children:O?u?`更新包来源`:`Update package source`:u?`安装包来源`:`Package source`}),(0,A.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:u?`输入 github:组织/仓库、Git / ZIP 地址或宿主目录;marketplace 可选择插件。`:`Enter github:owner/repo, a Git / ZIP URL or a Gateway directory. Marketplaces let you choose a plugin.`})]})]}),(0,A.jsx)(`input`,{id:E,className:L,value:M,onChange:e=>Ce(e.target.value),placeholder:u?`/插件目录/或/插件.zip`:`/plugin/folder/or/plugin.zip`,autoComplete:`off`,spellCheck:!1,required:!0}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:we?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(Ee),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择目录`:`Choose directory`]}),(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>void $(De),children:[(0,A.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),u?`选择 ZIP`:`Choose ZIP`]})]}):(0,A.jsxs)(y,{type:`button`,variant:`secondary`,disabled:U,onClick:()=>fe(!0),children:[(0,A.jsx)(d,{className:`size-4`,"aria-hidden":!0}),u?`选择文件或目录`:`Choose file or folder`]})})]}),(0,A.jsx)(y,{type:`submit`,variant:`secondary`,disabled:U||!M,children:u?`检查安装包`:`Inspect package`})]}):null,V.length?(0,A.jsx)(`div`,{className:`space-y-2`,"aria-label":u?`选择插件`:`Choose a plugin`,children:V.map(e=>(0,A.jsx)(y,{variant:`secondary`,className:`w-full justify-start`,onClick:()=>{Ce(e.source),$(async()=>F(await B(`/api/extensions/inspect`,`POST`,{source:e.source})))},children:e.name},e.source))}):null,P?(0,A.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,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-amber-700 dark:text-amber-300`,"aria-hidden":!0}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{id:`plugin-authorization-title`,className:`font-medium text-fg`,children:u?`需要你的授权`:`Your authorization is required`}),(0,A.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:u?`此插件需要以下新增能力。确认后自动准备资源,按需登录账号,所有 Agent 均可使用。`:`Review these capabilities. Resources are prepared automatically; sign in if needed. Available to all agents.`})]})]}),(0,A.jsx)(`ul`,{tabIndex:0,"aria-label":u?`插件新增能力`:`Added plugin capabilities`,className:`max-h-[min(28vh,14rem)] space-y-2 overflow-y-auto overscroll-contain rounded-lg border border-edge bg-surface-panel p-3 break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:P.addedCapabilities.map(e=>(0,A.jsxs)(`li`,{className:`flex gap-2`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`•`}),(0,A.jsx)(`span`,{children:R(e,u)})]},e))}),P.diagnostics.map((e,t)=>(0,A.jsxs)(`p`,{children:[e.component,`: `,e.message]},t))]}):null,O&&pe?(0,A.jsx)(`div`,{className:`border-t border-edge pt-4`,children:Z?(0,A.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,A.jsx)(`p`,{children:u?`卸载保留账号凭据;服务端授权需到相应服务撤销。`:`Credentials are retained. Revoke provider authorization in the service itself.`}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:q,onChange:e=>J(e.target.checked)}),u?`同时删除插件数据`:`Also delete plugin data`]}),(0,A.jsxs)(`label`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:e=>X(e.target.checked)}),u?`同时删除本地凭据`:`Also delete local credentials`]}),(0,A.jsx)(y,{disabled:U,onClick:()=>void $(async()=>{await B(be,`DELETE`,{removeData:q,removeCredentials:Y}),await Se(),(n??t)()}),children:u?`确认卸载`:`Confirm uninstall`})]}):(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>le(!0),children:u?`卸载插件`:`Uninstall`})}):null,G?(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-fg-muted`,children:G}):null]}),P?(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge p-4`,children:[(0,A.jsx)(y,{variant:`ghost`,disabled:U,onClick:()=>F(null),children:u?`取消`:`Cancel`}),(0,A.jsxs)(y,{disabled:U||!!O&&P.manifest.name!==O.name,onClick:()=>void $(()=>je(P)),children:[U?(0,A.jsx)(re,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,u?`授权并安装`:`Authorize and install`]})]}):null]}),we?null:(0,A.jsx)(l,{open:de,onOpenChange:fe,initialAbsolutePath:Te,onConfirm:async e=>Ce(e),wd:m(ee).chat.workingDirectory,selectKind:`file-or-directory`,fileExtensions:[`zip`],title:u?`选择插件安装包`:`Choose plugin package`,description:u?`选择插件目录或 ZIP 文件。`:`Choose a plugin directory or ZIP file.`,confirmLabel:u?`使用此来源`:`Use this source`,nested:!0})]})})}export{I as n,V as t};
@@ -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 i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./package-wATCyihJ.js";import{t as s}from"./messages-DRR9N3HC.js";import{t as c}from"./cn-0WouolD0.js";import{i as l,n as u,o as d}from"./locale-store-lIXD1FMw.js";import{i as f}from"./vendor-swr-CdRzEUwF.js";import{t as p}from"./button-CnRSIP6m.js";import{t as m}from"./skeleton-BI5TyibZ.js";import{a as h,i as g,o as _,r as v,s as y,t as b}from"./dist-DfWfZ9iu.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as C}from"./copy-to-clipboard-HOJ79TWv.js";import{n as w}from"./interaction-BdhHBbYa.js";import{n as T}from"./electron-env-DHOGevH3.js";import{r as E}from"./settings-form-draft-Dy10ldo8.js";import{t as D}from"./settings-loading-skeleton-BTqvr_Fw.js";import{n as O,t as k}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{r as A,t as j}from"./settings-form-section-num14vSv.js";var M=n(),N=e(t(),1),P=r();function F(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function I(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function L(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var R={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function z({api:e,messages:t,embedded:n=!0}){let[r,s]=(0,N.useReducer)(E,R),{info:l,loadError:u,actionError:d,copiedField:f,clearDialogOpen:m,clearConfirmChecked:T,clearConfirmText:O,uninstallDialogOpen:k,removeUserDataOnUninstall:A,busy:M}=r,z=(0,N.useCallback)(async()=>{if(e?.getUninstallInfo){s({type:`patch`,patch:{loadError:null}});try{let t=await e.getUninstallInfo();s({type:`patch`,patch:{info:t}})}catch(e){s({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,N.useEffect)(()=>{z()},[z]);let B=async(e,n)=>{if(await C(e)){s({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>s({type:`patch`,patch:{copiedField:null}}),2e3);return}s({type:`patch`,patch:{actionError:t.copyFailed}})},V=async()=>{if(!(!e?.clearUserData||M)){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},H=async()=>{if(e?.uninstallApp){s({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:A});n.ok||s({type:`patch`,patch:{actionError:I(n.error,t.errors)}})}catch(e){s({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{s({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(u)return(0,P.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:u});if(!l)return(0,P.jsx)(D,{rows:2});let U=!l.packaged,W=M||l.pendingUpdate||U,G=!U&&l.uninstallMode!==`unsupported`,K=L(l,t),q=T&&O.trim()===t.clearDataConfirmPhrase;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(j,{children:[n?(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,P.jsx)(o,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,d?(0,P.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:d}):null,U?(0,P.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,l.pendingUpdate?(0,P.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,P.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.appPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.appPath,`app`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`app`?t.copied:t.copyPath]})]})]}),(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,P.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,P.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,P.jsx)(`code`,{className:`break-all text-xs text-fg`,children:l.dataPath}),(0,P.jsxs)(`button`,{type:`button`,className:c(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,w.press),onClick:()=>void B(l.dataPath,`data`),children:[(0,P.jsx)(i,{className:`size-3`,"aria-hidden":!0}),f===`data`?t.copied:t.copyPath]})]}),(0,P.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,F(l.dataSizeBytes,t.dataSizeUnknown)]}),(0,P.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),G?(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,P.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:K})]}),(0,P.jsx)(`button`,{type:`button`,disabled:W,className:c(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,w.press),onClick:()=>{s({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,P.jsx)(b,{open:m,onOpenChange:e=>{!e&&!M&&s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(30rem,calc(100dvh-2rem))] w-[min(100%-2rem,28rem)] flex-col overflow-hidden -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),onEscapeKeyDown:e=>{M&&e.preventDefault()},onInteractOutside:e=>{M&&e.preventDefault()},"aria-busy":M,children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,P.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,disabled:M,checked:T,onChange:e=>s({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,P.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,P.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,P.jsx)(`input`,{id:`clear-data-confirm`,disabled:M,type:`text`,autoComplete:`off`,spellCheck:!1,className:c(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:O,onChange:e=>s({type:`patch`,patch:{clearConfirmText:e.target.value}})}),M?(0,P.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-live":`polite`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.clearDataProgress}),(0,P.jsx)(`div`,{role:`progressbar`,"aria-label":t.clearDataProgress,className:`h-1.5 overflow-hidden rounded-full bg-surface-active`,children:(0,P.jsx)(`div`,{className:`xopc-clear-data-progress h-full w-1/3 rounded-full bg-accent`})}),(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataProgressHint})]}):(0,P.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]})]}),(0,P.jsxs)(`div`,{className:`mt-6 flex shrink-0 justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>{s({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,P.jsxs)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M||!q,onClick:()=>void V(),children:[M?(0,P.jsx)(a,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):null,M?t.clearDataProgress:t.confirmClear]})]})]})]})}),G?(0,P.jsx)(b,{open:k,onOpenChange:e=>{e||s({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,P.jsxs)(_,{children:[(0,P.jsx)(h,{className:c(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,S)}),(0,P.jsxs)(v,{className:c(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,x,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,P.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,P.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:K}),(0,P.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:A,onChange:e=>s({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,P.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),A?(0,P.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,P.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,P.jsx)(p,{type:`button`,variant:`secondary`,disabled:M,onClick:()=>s({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,P.jsx)(p,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:M,onClick:()=>void H(),children:t.confirmUninstall})]})]})]})}):null]})}async function B(){return(await d(l(`/api/migrations/status`))).payload}async function V(){await d(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function H({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=f(`settings-migration-status`,B,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,N.useState)(!1),[s,c]=(0,N.useState)(null);async function l(){o(!0),c(null);try{await V(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,P.jsx)(m,{className:`h-5 w-40 max-w-full`}),(0,P.jsx)(m,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),h=u.filter(e=>e.safety===`auto`&&e.status===`planned`),g=d.length>0||u.some(e=>e.safety!==`auto`);return(0,P.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:g?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(h.length))})]}),h.length>0&&!g?(0,P.jsx)(p,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,P.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,P.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,P.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,P.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function U(){let e=(0,M.c)(28),t=u(W),n;e[0]===t?n=e[1]:(n=s(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!T()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,P.jsx)(k,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,P.jsx)(H,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=A(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,P.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,P.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,P.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,P.jsxs)(O,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let o;e[18]===i.title?o=e[19]:(o=(0,P.jsx)(k,{title:i.title}),e[18]=i.title,e[19]=o);let c;e[20]===i.migrations?c=e[21]:(c=(0,P.jsx)(H,{messages:i.migrations}),e[20]=i.migrations,e[21]=c);let l;e[22]===i?l=e[23]:(l=(0,P.jsx)(z,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=l);let d;return e[24]!==o||e[25]!==c||e[26]!==l?(d=(0,P.jsxs)(O,{gap:`gap-6`,children:[o,c,l]}),e[24]=o,e[25]=c,e[26]=l,e[27]=d):d=e[27],d}function W(e){return e.language}export{U as AppManagementSettingsPanel};
@@ -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{n as i,r as a}from"./popover-select-DniHw2dy.js";import{t as o}from"./messages-DRR9N3HC.js";import{t as s}from"./cn-0WouolD0.js";import{i as c,n as l,o as u}from"./locale-store-lIXD1FMw.js";import{t as d}from"./skeleton-BI5TyibZ.js";import{n as f}from"./interaction-BdhHBbYa.js";import{n as p,r as m}from"./gateway-config-swr-BAmUhiP1.js";import{t as h}from"./preference-select-fields-D7oluyHN.js";import{i as g}from"./theme-store-DW45fWYQ.js";import{t as _}from"./dev-view-store-57HgVuZ6.js";import{n as v,t as y}from"./settings-page-header-Bv-kQFTm.js";import"./settings-page-layout-DHP6MrrL.js";import{t as b}from"./settings-advanced-gate-B5lQeVNi.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await u(c(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=s(`min-w-0`,a),t[0]=a,t[1]=o);let c;t[2]===n?c=t[3]:(c=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=u);let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,E.jsxs)(`section`,{className:o,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=l(F),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),a=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let u;e[4]!==r||e[5]!==i||e[6]!==a?(u=j.map(e=>{let{value:t,labelKey:n}=e,o=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>a(t),className:s(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,f.pressCard,o?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:s(`text-xs font-medium leading-none`,o?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=a,e[7]=u):u=e[7];let d;e[8]===u?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:u}),e[8]=u,e[9]=d);let p;return e[10]!==c||e[11]!==d?(p=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=p):p=e[12],p}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=l(L),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:c,isLoading:u}=m(!0),f=c?.payload?.config,p;e[2]===f?p=e[3]:(p=w(f),e[2]=f,e[3]=p);let h=p,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==u||e[14]!==g||e[15]!==v?(M=u?(0,E.jsx)(d,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(i,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(a,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(a,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(a,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=u,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:s(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=l(V),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),a=_(z),s;e[2]===r.showRawToolDataTitle?s=e[3]:(s=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=s);let c;e[4]===r.showRawToolDataDescription?c=e[5]:(c=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=c);let u;e[6]!==s||e[7]!==c?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[s,c]}),e[6]=s,e[7]=c,e[8]=u):u=e[8];let d;e[9]===a?d=e[10]:(d=e=>a(e.target.checked),e[9]=a,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=l(U),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(y,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,E.jsx)(D,{children:(0,E.jsx)(h,{variant:`page`,sections:[`language`]})}),e[4]=a):a=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsxs)(D,{children:[(0,E.jsx)(h,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsx)(R,{}),e[6]=c):c=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:c})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(v,{gap:`gap-6`,children:[i,a,s,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
@@ -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{l as i,m as a,t as o,u as s}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as c}from"./arrow-left-D880xG-P.js";import{t as l}from"./box-DvYoGszj.js";import{n as u,t as d}from"./extension-paths-DvuaZJuy.js";import{t as f}from"./ellipsis-0k4rZLoy.js";import{t as p}from"./external-link-DjqjBmc3.js";import{t as m}from"./loader-circle-CifKLtgG.js";import{t as h}from"./markdown-view-CJt-i2Dp.js";import{t as g}from"./package-wATCyihJ.js";import{t as _}from"./plus-Q2yW6OE7.js";import{t as v}from"./settings-uiTATseT.js";import{t as y}from"./shield-check-BU58siTV.js";import{t as b}from"./trash-2-DusmjVPV.js";import{t as x}from"./triangle-alert-2JXFNNKU.js";import{t as S}from"./x-B_N4OPjy.js";import{t as C}from"./messages-DRR9N3HC.js";import{t as w}from"./cn-0WouolD0.js";import{l as T,n as E}from"./locale-store-lIXD1FMw.js";import{a as D,i as O}from"./vendor-swr-CdRzEUwF.js";import{t as k}from"./button-CnRSIP6m.js";import{t as A}from"./skeleton-BI5TyibZ.js";import{a as j,i as M,o as N,r as P,s as F,t as I}from"./dist-DfWfZ9iu.js";import{i as L,o as R,r as z,s as B}from"./extension-provider-Byrd8Sor.js";import{n as V}from"./interaction-BdhHBbYa.js";import{o as H}from"./gateway-realtime-CsykKL4l.js";import{t as ee}from"./page-tabs-oeTY7z3_.js";import{t as U}from"./page-header-store-DH8K0xii.js";import{r as W}from"./settings-form-draft-Dy10ldo8.js";import{a as G,c as te,o as ne,r as K,t as q}from"./dist-DNCdG_qB.js";import{n as J,t as Y}from"./capability-links-DzQWK1Fh.js";import{t as re}from"./agent-plugin-dialog-CQ5LLDMO.js";import{t as X}from"./capability-icon-DVoZxEgW.js";import{a as Z,i as ie,n as ae,r as oe,t as se}from"./extension-marketplace-api-CVJPqJOB.js";import{n as ce,t as le}from"./capability-header-actions-CTUCuBlW.js";import{n as ue,r as de,t as fe}from"./plugin-presentation-CO5BFDGW.js";var pe=n(),me=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,he=`relative h-full min-w-0 rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:border-edge-strong hover:bg-surface-hover/30`,ge=`absolute inset-0 cursor-pointer rounded-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,Q=e(t(),1);function _e(e){return e===`builtin`||e===`user`?e:`marketplace`}var $=r();function ve(e,t){let n=e.find(e=>e.id===t||e.pluginId===t||e.provenance?.packageName===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var ye={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function be({className:e,query:t}){let n=s(),r=i(),a=E(e=>e.language),o=C(a).extensionsPage,c=T(e=>!!e.conversationId),l=z(),{mutate:d}=D(),[f,p]=(0,Q.useReducer)(W,ye),{debounced:h,detailPkg:_,quickInstallPkg:v,rowBusy:y,actionError:x,restartHint:S}=f,k=c?`marketplace-${h}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>p({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:j,isLoading:M,error:N}=O(k,()=>se(h),{revalidateOnFocus:!1}),P=(0,Q.useCallback)(()=>{d(`gateway-extensions-list`),H()},[d]),F=(0,Q.useCallback)(async(e,t)=>{p({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await oe({name:e,overwrite:t});P(),n.requiresGatewayRestart&&p({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw p({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceInstallFailed}}),e}finally{p({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceInstallFailed,o.marketplaceRestartHint,P]),I=(0,Q.useCallback)(async e=>{p({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await Z(e);P(),t.requiresGatewayRestart&&p({type:`patch`,patch:{restartHint:o.marketplaceRestartHint}})}catch(e){throw p({type:`patch`,patch:{actionError:e instanceof Error?e.message:o.marketplaceUninstallFailed}}),e}finally{p({type:`patch`,patch:{rowBusy:null}})}},[o.marketplaceRestartHint,o.marketplaceUninstallFailed,P]),L=j??[];return(0,$.jsxs)(`div`,{className:w(`flex flex-col gap-4`,e),children:[N?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:N instanceof Error?N.message:o.marketplaceLoadFailed}):null,x?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:x}):null,S?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:S}):null,M&&!j?(0,$.jsx)(`ul`,{className:me,"aria-label":o.marketplaceLoading,children:[0,1,2,3,4,5].map(e=>(0,$.jsxs)(`li`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(A,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(A,{className:`h-5 w-full`}),(0,$.jsx)(A,{className:`h-3 w-2/3`})]}),(0,$.jsx)(A,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(A,{className:`h-4 w-full`}),(0,$.jsx)(A,{className:`h-4 w-full`}),(0,$.jsx)(A,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:me,children:L.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:o.marketplaceEmpty}):L.map(e=>{let t=ve(l,e.id),i=y===e.id,s=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[a.startsWith(`zh`)?`zh-CN`:`en`],d=c?.displayName??e.name,f=c?.description??e.description;return(0,$.jsxs)(`li`,{className:he,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${d}, ${o.marketplaceDetailTitle}`,onClick:()=>s?.pluginId?n(Y(s.pluginId,`installed`,!1,r.pathname+r.search)):p({type:`patch`,patch:{detailPkg:e.id}}),className:ge}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:g}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[(0,$.jsx)(`h3`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:d,children:d}),e.verified?(0,$.jsx)(u,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null]}),(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[e.version?(0,$.jsxs)(`span`,{children:[`v`,e.version]}):null,t===`user`?(0,$.jsx)(`span`,{className:s&&de(s)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:s&&de(s)?a.startsWith(`zh`)?`需要授权`:`Authorization required`:o.marketplaceInstalled}):null]})]}),(0,$.jsx)(`div`,{role:`group`,className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:o.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>s?.pluginId&&fe(s)?n(J(d,a.startsWith(`zh`))):s?.pluginId?n(Y(s.pluginId,`installed`,de(s),r.pathname+r.search)):p({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:w(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:s&&de(s)?a.startsWith(`zh`)?`去授权`:`Connect account`:s&&fe(s)?a.startsWith(`zh`)?`开始使用`:`Start using`:a.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(o.marketplaceUninstallConfirm)&&I(e.id).catch(()=>{})},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(m,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(b,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),o.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>p({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:w(`inline-flex min-w-16 items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?a.startsWith(`zh`)?`安装`:`Install`:o.marketplaceReview})})]}),f?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:f}):null,(e.categories?.length??0)>0?(0,$.jsx)(`div`,{className:`pointer-events-none relative mt-3 flex flex-wrap gap-1.5`,children:e.categories?.map(e=>(0,$.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-edge px-2 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]},e.id)})}),_?(0,$.jsx)(xe,{packageName:_,autoInstall:v===_,copy:o,extensions:l,onClose:()=>p({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:F,onUninstall:I}):null]})}function xe(e){let t=(0,pe.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:s,onInstall:l,onUninstall:u}=e,[d,f]=(0,Q.useState)(!1),[p,g]=(0,Q.useState)(!1),_=T(Ee)?`ext-mp-detail-${n}`:null,v;t[0]===n?v=t[1]:(v=async()=>ae(n),t[0]=n,t[1]=v);let C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[2]=C):C=t[2];let{data:E,error:D,isLoading:k}=O(_,v,C),M;t[3]!==a||t[4]!==n?(M=ve(a,n),t[3]=a,t[4]=n,t[5]=M):M=t[5];let L=M,R=L===`user`,z=E?.manifest?.permissions,B,V,H,ee,U,W,G,te,ne,K,q,J;if(t[6]!==r||t[7]!==i||t[8]!==E||t[9]!==D||t[10]!==a||t[11]!==L||t[12]!==k||t[13]!==s||t[14]!==n||t[15]!==z||t[16]!==p){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=z&&typeof z==`object`&&!Array.isArray(z)?Object.entries(z):[],o;t[29]!==i||t[30]!==E?(o=E?.readme?.trim()||(E?.description?.trim()?`### ${E.name}\n\n${E.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=E,t[31]=o):o=t[31];let l=o;if(E?.format===`agent-plugin`){let e;if(t[32]!==E||t[33]!==a||t[34]!==n){let r;t[36]!==E||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===E.manifest?.name,t[36]=E,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=E,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,o;t[39]!==r||t[40]!==E||t[41]!==s||t[42]!==e||t[43]!==i?(o=(0,$.jsx)(re,{extension:e,initialSource:i,marketplace:E,autoInstall:r,onClose:s}),t[39]=r,t[40]=E,t[41]=s,t[42]=e,t[43]=i,t[44]=o):o=t[44],W=o;break bb0}H=I,ee=!0,t[45]===s?U=t[46]:(U=e=>!e&&s(),t[45]=s,t[46]=U),V=N,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=J):J=t[47],B=P,ne=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,K=Te;let u;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(c,{className:`size-5`}),t[48]=u):u=t[48];let d;t[49]!==i.detailBack||t[50]!==s?(d=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:u}),t[49]=i.detailBack,t[50]=s,t[51]=d):d=t[51];let f;t[52]===i.marketplaceDetailTitle?f=t[53]:(f=(0,$.jsx)(F,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=f);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(S,{className:`size-5`}),t[54]=m):m=t[54];let _;t[55]!==i.detailClose||t[56]!==s?(_=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:m}),t[55]=i.detailClose,t[56]=s,t[57]=_):_=t[57],t[58]!==d||t[59]!==f||t[60]!==_?(q=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,f,_]}),t[58]=d,t[59]=f,t[60]=_,t[61]=q):q=t[61],G=`min-h-0 flex-1 overflow-y-auto p-5`,te=k&&!E?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(A,{className:`h-6 w-48`}),(0,$.jsx)(A,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(A,{className:`h-12`}),(0,$.jsx)(A,{className:`h-12`})]}),(0,$.jsx)(A,{className:`h-28 w-full`}),(0,$.jsx)(A,{className:`h-36 w-full`})]}):D?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:D instanceof Error?D.message:i.marketplaceLoadFailed})]}):E?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:E.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:E.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:E.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:E.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:E.downloads})]})]}),L===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[E.installability.available?(0,$.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(x,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:E.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:E.installability.available?i.marketplaceCodeRisk:E.installability.reason??i.marketplaceUnavailableBody})]})]}),E.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:E.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(we)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(E.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,E.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>g(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),E.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(h,{content:l})})]}):null}t[6]=r,t[7]=i,t[8]=E,t[9]=D,t[10]=a,t[11]=L,t[12]=k,t[13]=s,t[14]=n,t[15]=z,t[16]=p,t[17]=B,t[18]=V,t[19]=H,t[20]=ee,t[21]=U,t[22]=W,t[23]=G,t[24]=te,t[25]=ne,t[26]=K,t[27]=q,t[28]=J}else B=t[17],V=t[18],H=t[19],ee=t[20],U=t[21],W=t[22],G=t[23],te=t[24],ne=t[25],K=t[26],q=t[27],J=t[28];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Y;t[62]!==G||t[63]!==te?(Y=(0,$.jsx)(`div`,{className:G,children:te}),t[62]=G,t[63]=te,t[64]=Y):Y=t[64];let X;t[65]!==d||t[66]!==i.marketplaceBuiltinGoBuiltin||t[67]!==i.marketplaceBuiltinManageHint||t[68]!==i.marketplaceInstall||t[69]!==i.marketplaceReinstall||t[70]!==i.marketplaceReinstallConfirm||t[71]!==i.marketplaceUninstall||t[72]!==i.marketplaceUninstallConfirm||t[73]!==E||t[74]!==L||t[75]!==s||t[76]!==l||t[77]!==u||t[78]!==n||t[79]!==p||t[80]!==R?(X=E?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:L===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(o,{to:`/capabilities/extensions?tab=builtin`,onClick:s,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:d||!E.installability.available||!p,onClick:()=>{R&&!window.confirm(i.marketplaceReinstallConfirm)||(f(!0),l(n,R).catch(Ce).finally(()=>f(!1)))},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[d?(0,$.jsx)(m,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,R?i.marketplaceReinstall:i.marketplaceInstall]}),R?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(f(!0),u(n).then(()=>s()).catch(Se).finally(()=>f(!1)))},className:w(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(b,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[65]=d,t[66]=i.marketplaceBuiltinGoBuiltin,t[67]=i.marketplaceBuiltinManageHint,t[68]=i.marketplaceInstall,t[69]=i.marketplaceReinstall,t[70]=i.marketplaceReinstallConfirm,t[71]=i.marketplaceUninstall,t[72]=i.marketplaceUninstallConfirm,t[73]=E,t[74]=L,t[75]=s,t[76]=l,t[77]=u,t[78]=n,t[79]=p,t[80]=R,t[81]=X):X=t[81];let Z;t[82]!==B||t[83]!==Y||t[84]!==X||t[85]!==ne||t[86]!==K||t[87]!==q?(Z=(0,$.jsxs)(B,{className:ne,onOpenAutoFocus:K,children:[q,Y,X]}),t[82]=B,t[83]=Y,t[84]=X,t[85]=ne,t[86]=K,t[87]=q,t[88]=Z):Z=t[88];let ie;t[89]!==V||t[90]!==Z||t[91]!==J?(ie=(0,$.jsxs)(V,{children:[J,Z]}),t[89]=V,t[90]=Z,t[91]=J,t[92]=ie):ie=t[92];let oe;return t[93]!==H||t[94]!==ee||t[95]!==U||t[96]!==ie?(oe=(0,$.jsx)(H,{defaultOpen:ee,onOpenChange:U,children:ie}),t[93]=H,t[94]=ee,t[95]=U,t[96]=ie,t[97]=oe):oe=t[97],oe}function Se(){}function Ce(){}function we(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function Te(e){return e.preventDefault()}function Ee(e){return!!e.conversationId}function De({embedded:e=!1,onHeaderActionChange:t}){let n=s(),r=i(),c=E(e=>e.language),u=C(c),d=U(e=>e.setPageHeader),p=U(e=>e.clearPageHeader),m=z(),h=L(),[g,v]=a(),y=_e(g.get(`tab`)??(m.some(e=>e.source!==`bundled`)?`user`:null)),b=(0,Q.useRef)(!1),x=g.get(`q`)??``,[S,T]=(0,Q.useState)(y),[D,O]=(0,Q.useState)(x),[A,j]=(0,Q.useState)(null),[M,N]=(0,Q.useState)(!1),P=g.toString(),F=(0,Q.useRef)(P);if(F.current!==P){F.current=P;let e=_e(g.get(`tab`)),t=g.get(`q`)??``;T(t=>t===e?t:e),O(e=>e===t?e:t)}(0,Q.useEffect)(()=>{v(e=>{let t=new URLSearchParams(e),n=D.trim();return n?t.set(`q`,n):t.delete(`q`),S===`marketplace`?t.delete(`tab`):t.set(`tab`,S),t.toString()===e.toString()?e:t},{replace:!0})},[S,D,v]);let I=(0,Q.useMemo)(()=>m.filter(e=>e.source===`bundled`),[m]),R=(0,Q.useMemo)(()=>m.filter(e=>e.source!==`bundled`),[m]);(0,Q.useEffect)(()=>{h||b.current||(b.current=!0,!g.has(`tab`)&&R.length&&T(`user`))},[h,g,R.length]);let B=S===`builtin`?I:R,H=(0,Q.useMemo)(()=>{let e=D.trim().toLowerCase(),t=B;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,c):e.hasUi?-1:1)},[B,D,c]);(0,Q.useEffect)(()=>{j(e=>{if(!e)return e;let t=m.find(t=>t.id===e.id);return t?Oe(e)===Oe(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[m]);let W=(0,Q.useMemo)(()=>({searchLabel:S===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(ce,{value:D,onChange:O,placeholder:S===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(ne,{children:[(0,$.jsx)(te,{asChild:!0,children:(0,$.jsx)(k,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(f,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(G,{children:(0,$.jsxs)(q,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[(0,$.jsxs)(K,{className:w(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,V.transition),onSelect:()=>N(!0),children:[(0,$.jsx)(_,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),c.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(K,{asChild:!0,children:(0,$.jsxs)(o,{to:`/local-apps`,className:w(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,V.transition),children:[(0,$.jsx)(l,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(k,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(o,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(_,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[c,u.capabilitiesHub.moreActions,u.extensionsPage,S,D]);(0,Q.useLayoutEffect)(()=>e?(t?.(W),()=>t?.(null)):(d({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u.extensionsPage.title})}),end:(0,$.jsx)(le,{contribution:W})}),()=>p()),[p,e,W,u.extensionsPage.title,t,d]);let J=[{id:`user`,label:u.extensionsPage.tabUser,count:h?void 0:R.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:h?void 0:I.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:w(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(ee,{items:J,activeTab:S,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),S===`marketplace`?(0,$.jsx)(be,{query:D}):h?(0,$.jsx)(Fe,{}):S===`builtin`&&I.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyBuiltin}):S===`user`&&R.length===0?(0,$.jsx)(Le,{message:u.extensionsPage.emptyUser}):H.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:u.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:me,children:H.map(e=>(0,$.jsx)(je,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(Y(e.pluginId,`installed`,!1,r.pathname+r.search)):j(e)},e.id))})]}),A?A.format===`agent-plugin`?(0,$.jsx)(re,{extension:A,onClose:()=>j(null)},A.id):(0,$.jsx)(Ne,{extension:A,copy:u.extensionsPage,onClose:()=>j(null)},A.id):null,M?(0,$.jsx)(re,{onClose:()=>N(!1)}):null]})}function Oe(e){return e.activationEligible??e.active}function ke(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ae(e,t){let n=Oe(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function je(e){let t=(0,pe.c)(56),{extension:n,copy:r,onOpen:a}=e,o=E(Me),c,d;t[0]!==n||t[1]!==o?(d=o.startsWith(`zh`),c=ue(n,d),t[0]=n,t[1]=o,t[2]=c,t[3]=d):(c=t[2],d=t[3]);let f=c,p;t[4]===n?p=t[5]:(p=de(n),t[4]=n,t[5]=p);let m=p,h=n.localizations?.[d?`zh-CN`:`en`]?.description??n.description,g=s(),_=i(),v;t[6]===n?v=t[7]:(v=!!n.pluginId&&fe(n),t[6]=n,t[7]=v);let y=v,b=m?d?`去授权`:`Connect account`:y?d?`开始使用`:`Start using`:d?`管理插件`:`Manage plugin`,x;t[8]!==y||t[9]!==n.pluginId||t[10]!==_||t[11]!==f||t[12]!==g||t[13]!==m||t[14]!==a||t[15]!==d?(x=()=>{y?g(J(f,d)):m&&n.pluginId?g(Y(n.pluginId,`installed`,!0,_.pathname+_.search)):a()},t[8]=y,t[9]=n.pluginId,t[10]=_,t[11]=f,t[12]=g,t[13]=m,t[14]=a,t[15]=d,t[16]=x):x=t[16];let S=x,C=`${f}, ${r.marketplaceDetailTitle}`,w;t[17]!==a||t[18]!==C?(w=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:a,className:ge}),t[17]=a,t[18]=C,t[19]=w):w=t[19];let T=n.branding?.iconUrl,D;t[20]===T?D=t[21]:(D=(0,$.jsx)(X,{iconUrl:T,fallback:l}),t[20]=T,t[21]=D);let O;t[22]===f?O=t[23]:(O=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:f,children:f}),t[22]=f,t[23]=O);let k;t[24]===n.provenance?.publisherVerification?k=t[25]:(k=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(u,{className:`mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,t[24]=n.provenance?.publisherVerification,t[25]=k);let A;t[26]!==O||t[27]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[O,k]}),t[26]=O,t[27]=k,t[28]=A):A=t[28];let j;t[29]===n.version?j=t[30]:(j=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=j);let M=m?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,N=m?d?`需要授权`:`Authorization required`:Oe(n)?r.statusEnabled:r.runStateOff,P;t[31]!==M||t[32]!==N?(P=(0,$.jsx)(`span`,{className:M,children:N}),t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;t[34]!==j||t[35]!==P?(F=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[j,P]}),t[34]=j,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==A||t[38]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[A,F]}),t[37]=A,t[38]=F,t[39]=I):I=t[39];let L;t[40]!==b||t[41]!==S?(L=(0,$.jsx)(`div`,{className:`pointer-events-auto relative z-10 flex max-w-[45%] shrink-0 items-start`,children:(0,$.jsx)(`button`,{type:`button`,onClick:S,className:`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg transition-colors hover:bg-surface-hover active:scale-[0.98] active:bg-surface-hover/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:b})}),t[40]=b,t[41]=S,t[42]=L):L=t[42];let R;t[43]!==I||t[44]!==L||t[45]!==D?(R=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[D,I,L]}),t[43]=I,t[44]=L,t[45]=D,t[46]=R):R=t[46];let z;t[47]!==r.cardNoDescription||t[48]!==h?(z=h?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=h,t[49]=z):z=t[49];let B;t[50]===z?B=t[51]:(B=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:z}),t[50]=z,t[51]=B);let V;return t[52]!==R||t[53]!==B||t[54]!==w?(V=(0,$.jsxs)(`article`,{className:he,children:[w,R,B]}),t[52]=R,t[53]=B,t[54]=w,t[55]=V):V=t[55],V}function Me(e){return e.language}function Ne({extension:e,copy:t,onClose:n}){let{mutate:r}=D(),[i,a]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(null),[u,f]=(0,Q.useState)(!1),h=e.activationEligible===!0,g=(0,Q.useCallback)(async()=>{l(null),f(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ie({extensionId:e.id,enabled:!h});await r(`gateway-extensions-list`),H(),f(t)}catch(e){l(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[h,t.extensionToggleFailed,e.id,r]),_=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){l(null),f(!1),a(`uninstall`);try{await Z(e.id),await r(`gateway-extensions-list`),H(),n()}catch(e){l(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),y=e.ui?.contributions?.pages??[],x=e.ui?.contributions?.settingsPanels??[],C=e.ui?.contributions?.chatWidgets??[],T=y.find(e=>e.showInNav)??y[0],E=x[0],O=T?d(e.id,T):null,A=E?`/settings/ext/${e.id}/${E.id}`:e.hasConfigSchema||R(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(I,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(N,{children:[(0,$.jsx)(j,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(P,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(c,{className:`size-5`})}),(0,$.jsx)(F,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(M,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(S,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,ke(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Ae(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(k,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void g(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):h?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,u?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(k,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void _(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(m,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(b,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(y.length>0||x.length>0||C.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Pe,{template:t.badgePages,count:y.length,hidden:y.length===0}),(0,$.jsx)(Pe,{template:t.badgeSettings,count:x.length,hidden:x.length===0}),(0,$.jsx)(Pe,{template:t.badgeWidgets,count:C.length,hidden:C.length===0})]})]}):null,B(e)&&(O||A)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[O?(0,$.jsxs)(o,{to:O,onClick:n,className:w(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(p,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,A?(0,$.jsxs)(o,{to:A,onClick:n,className:w(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(v,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Pe(e){let t=(0,pe.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function Fe(){let e=(0,pe.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:me,"aria-busy":`true`,children:Array.from({length:6},Ie)}),e[0]=t):t=e[0],t}function Ie(e,t){return(0,$.jsx)(A,{className:`h-32 rounded-xl`},t)}function Le(e){let t=(0,pe.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{De as ExtensionsPage};
@@ -1 +0,0 @@
1
- import{i as e,o as t}from"./locale-store-lIXD1FMw.js";var n={tasks:()=>t(e(`/api/tasks?limit=200`)),list:n=>{let r=new URLSearchParams;n?.projectId&&r.set(`projectId`,n.projectId);let i=r.toString();return t(e(`/api/automations${i?`?${i}`:``}`))},metrics:()=>t(e(`/api/automations/metrics`)),draft:(n,r=crypto.randomUUID())=>t(e(`/api/automations/draft`),{method:`POST`,headers:{"Idempotency-Key":r},body:JSON.stringify(n)}),simulate:n=>t(e(`/api/automations/simulate`),{method:`POST`,body:JSON.stringify(n)}),create:n=>t(e(`/api/automations`),{method:`POST`,body:JSON.stringify(n)}),update:(n,r)=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)}),remove:n=>t(e(`/api/automations/${encodeURIComponent(n)}`),{method:`DELETE`}),runNow:n=>t(e(`/api/automations/${encodeURIComponent(n)}/run`),{method:`POST`}),pause:n=>t(e(`/api/automations/${encodeURIComponent(n)}/pause`),{method:`POST`}),resume:n=>t(e(`/api/automations/${encodeURIComponent(n)}/resume`),{method:`POST`}),runs:(n=50,r,i)=>{let a=new URLSearchParams({limit:String(n)});return r&&a.set(`automationId`,r),!r&&i?.projectId&&a.set(`projectId`,i.projectId),t(e(`/api/automation-runs?${a.toString()}`))},productEventRuns:n=>{let r=new URLSearchParams({eventType:n.eventType,limit:String(n.limit??5)});return n.source&&r.set(`source`,n.source),n.payloadKey&&r.set(`payloadKey`,n.payloadKey),n.payloadValue!==void 0&&r.set(`payloadValue`,n.payloadValue),t(e(`/api/automation-runs/product-events?${r.toString()}`))},events:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.type&&r.set(`type`,n.type),n.source&&r.set(`source`,n.source),t(e(`/api/automation-events?${r.toString()}`))},deliveries:(n={})=>{let r=new URLSearchParams({limit:String(n.limit??50)});return n.runId&&r.set(`runId`,n.runId),n.status&&r.set(`status`,n.status),t(e(`/api/automation-deliveries?${r.toString()}`))},runEvents:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/events`)),rerun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/rerun`),{method:`POST`}),repairDraft:(n,r,i=crypto.randomUUID())=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/repair-draft`),{method:`POST`,headers:{"Idempotency-Key":i},body:JSON.stringify(r)}),cancelRun:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/cancel`),{method:`POST`}),markRunRead:n=>t(e(`/api/automation-runs/${encodeURIComponent(n)}/read`),{method:`POST`}),markAllRunsRead:n=>t(e(`/api/automation-runs/read-all${n?`?projectId=${encodeURIComponent(n)}`:``}`),{method:`POST`})};export{n as t};