@xopcai/xopc 0.0.401 → 0.0.402

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 (359) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/pairing/feishu-pairing-prompt.js +2 -2
  3. package/dist/extensions/feishu/src/plugin.js +2 -2
  4. package/dist/extensions/feishu/src/transport/socket-mode/monitor.js +1 -1
  5. package/dist/extensions/feishu/src/transport/webhook/monitor.js +1 -1
  6. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  7. package/dist/extensions/telegram/src/adapters/outbound-adapter.js +1 -1
  8. package/dist/extensions/telegram/src/adapters/security-adapter.js +1 -1
  9. package/dist/extensions/telegram/src/adapters/streaming-adapter.js +2 -2
  10. package/dist/extensions/telegram/src/command-handler.js +1 -1
  11. package/dist/extensions/telegram/src/doctor.js +2 -2
  12. package/dist/extensions/telegram/src/draft-stream.js +1 -1
  13. package/dist/extensions/telegram/src/exec-approval-handler.js +1 -1
  14. package/dist/extensions/telegram/src/focus-handler.js +1 -1
  15. package/dist/extensions/telegram/src/inbound-processor.js +6 -6
  16. package/dist/extensions/telegram/src/outbound-sender.js +3 -3
  17. package/dist/extensions/telegram/src/pairing-config-resolver.js +1 -1
  18. package/dist/extensions/telegram/src/plugin.js +24 -24
  19. package/dist/extensions/telegram/xopc.extension.json +1 -1
  20. package/dist/extensions/weixin/src/api/api.js +1 -1
  21. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  22. package/dist/extensions/weixin/src/pairing-config-resolver.js +1 -1
  23. package/dist/extensions/weixin/src/plugin.js +2 -2
  24. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-ByXMoFsY.js → agent-avatar-dicebear-DF_bLVLU.js} +1 -1
  25. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DTWNXsbp.js → agent-defaults-settings-panel-CB96Cbva.js} +1 -1
  26. package/dist/gateway/static/root/assets/{agents-CaB8tdC-.js → agents-C97HREhT.js} +3 -3
  27. package/dist/gateway/static/root/assets/{app-management-settings-panel-X9szJlYD.js → app-management-settings-panel-Cr_dcDOi.js} +1 -1
  28. package/dist/gateway/static/root/assets/{appearance-settings-BfE1yedW.js → appearance-settings-C5TsJu_t.js} +1 -1
  29. package/dist/gateway/static/root/assets/{apps-page-B4temKvg.js → apps-page-erjVBKui.js} +1 -1
  30. package/dist/gateway/static/root/assets/{archive-plugin-PQHi2w72.js → archive-plugin-CpsVjh9E.js} +1 -1
  31. package/dist/gateway/static/root/assets/{automations-page-KIyLxqyX.js → automations-page-Db1YnE2r.js} +1 -1
  32. package/dist/gateway/static/root/assets/{automations-workspace-C99c2Mps.js → automations-workspace-iTSZBSZf.js} +1 -1
  33. package/dist/gateway/static/root/assets/{binary-plugins-DPDgIi0y.js → binary-plugins-DYdnW_Fa.js} +1 -1
  34. package/dist/gateway/static/root/assets/{block-editor-BL6uYJRu.js → block-editor-HZ37eyhY.js} +1 -1
  35. package/dist/gateway/static/root/assets/{browser-automation-inputs-BMe7eqyS.js → browser-automation-inputs-B-V9Vc6B.js} +1 -1
  36. package/dist/gateway/static/root/assets/{browser-automations-page-Cxy3o5SG.js → browser-automations-page-D0lBDbJO.js} +1 -1
  37. package/dist/gateway/static/root/assets/{browser-settings-page-Dn-LW9q4.js → browser-settings-page-DIbXx7Ux.js} +1 -1
  38. package/dist/gateway/static/root/assets/{capabilities-page-CHWxG2ns.js → capabilities-page-DEZJFRU_.js} +2 -2
  39. package/dist/gateway/static/root/assets/{capabilities-settings-panel-Da9ak03p.js → capabilities-settings-panel-BfdoIjPK.js} +1 -1
  40. package/dist/gateway/static/root/assets/{capability-header-actions-WRaPQFq0.js → capability-header-actions-BBPBfpGd.js} +1 -1
  41. package/dist/gateway/static/root/assets/{channels-Cx2WkRWN.js → channels-CapZyaWK.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-terminal-dock-63FqSsS_.js → chat-terminal-dock-DQWv9Smb.js} +1 -1
  43. package/dist/gateway/static/root/assets/{computer-settings-page-Cr6u_6gd.js → computer-settings-page-CyPqxL6X.js} +1 -1
  44. package/dist/gateway/static/root/assets/{connector-service-page-FJwMon8U.js → connector-service-page-DmCt-Kgx.js} +1 -1
  45. package/dist/gateway/static/root/assets/{connectors-page-BBH388aG.js → connectors-page-3xUE-PGt.js} +1 -1
  46. package/dist/gateway/static/root/assets/{date-picker-D5Xit3eb.js → date-picker-aOgNPu_Y.js} +1 -1
  47. package/dist/gateway/static/root/assets/{dependency-picker-1aJOOQPo.js → dependency-picker-oALjIlhN.js} +1 -1
  48. package/dist/gateway/static/root/assets/{desktop-pet-ggDJ99Z6.js → desktop-pet-pp9_jT3M.js} +1 -1
  49. package/dist/gateway/static/root/assets/{desktop-pet-settings-ChfLbqqO.js → desktop-pet-settings-BZCCh5T4.js} +1 -1
  50. package/dist/gateway/static/root/assets/{device-pairing-wizard-3OvOHf6N.js → device-pairing-wizard-DpKzQlqA.js} +1 -1
  51. package/dist/gateway/static/root/assets/{directory-picker-path-field-ummF1SFe.js → directory-picker-path-field-LSNVNUaG.js} +1 -1
  52. package/dist/gateway/static/root/assets/{extension-debug-page-SmrPvYO6.js → extension-debug-page-Bvy_tPme.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-page-CGVGUA3i.js → extension-page-D3J8-8AM.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-settings-page-nns2sDcu.js → extension-settings-page-F6KLsxCY.js} +1 -1
  55. package/dist/gateway/static/root/assets/{gateway-settings-CFhtbGZh.js → gateway-settings-_YecsQF1.js} +1 -1
  56. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-BOfrdIh2.js → highlighted-body-KQOG7T2V-BCCIvIlA.js} +1 -1
  57. package/dist/gateway/static/root/assets/{home-page-GtF10ylS.js → home-page-DUoecphg.js} +1 -1
  58. package/dist/gateway/static/root/assets/{image-generation-api-D0EUiJdS.js → image-generation-api-DjQXmXWa.js} +1 -1
  59. package/dist/gateway/static/root/assets/{imports-page-CoQLVDRZ.js → imports-page-Bg5N_9Vg.js} +1 -1
  60. package/dist/gateway/static/root/assets/{index-Cmrvxc_s.js → index-cmsFpzI8.js} +8 -8
  61. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Big_fVjG.js → keyboard-shortcuts-settings-BxH3LBLL.js} +1 -1
  62. package/dist/gateway/static/root/assets/{local-app-workbench-page-BQq4v2h9.js → local-app-workbench-page-C7RejhJl.js} +1 -1
  63. package/dist/gateway/static/root/assets/{local-apps-page-BEJLnf07.js → local-apps-page-CsTZ1d01.js} +1 -1
  64. package/dist/gateway/static/root/assets/{logs-page-t85fyv9m.js → logs-page-uLju0b0e.js} +1 -1
  65. package/dist/gateway/static/root/assets/{management-settings-BNah9d9e.js → management-settings-BkTmllrn.js} +1 -1
  66. package/dist/gateway/static/root/assets/{media-plugins-DJBhcY1R.js → media-plugins-CGq_o7tI.js} +1 -1
  67. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DdlL1T6J.js +1 -0
  68. package/dist/gateway/static/root/assets/{note-detail-panel-C2lBQc4t.js → note-detail-panel-Cps8VMV6.js} +3 -3
  69. package/dist/gateway/static/root/assets/{notes-page-WnkqzfLz.js → notes-page-CdmoFpQ9.js} +1 -1
  70. package/dist/gateway/static/root/assets/{page-context-capture-button-BJVRA9-x.js → page-context-capture-button-BH9WwSgw.js} +1 -1
  71. package/dist/gateway/static/root/assets/{personal-page-Cm2wT4by.js → personal-page-UKNVJRDn.js} +1 -1
  72. package/dist/gateway/static/root/assets/{plugin-details-dialog-BWEc8nwk.js → plugin-details-dialog-gvBSFAhm.js} +1 -1
  73. package/dist/gateway/static/root/assets/{plugin-presentation-BcZHPy_6.js → plugin-presentation-C0la7V8t.js} +1 -1
  74. package/dist/gateway/static/root/assets/{preview-open-alternatives-DKLblfvY.js → preview-open-alternatives-rJ3l8Ii4.js} +1 -1
  75. package/dist/gateway/static/root/assets/{product-open-page-CMMI-Lvy.js → product-open-page-CuzuFyIk.js} +1 -1
  76. package/dist/gateway/static/root/assets/{product-preview-content-Dik_ORgj.js → product-preview-content-Dw2DstzN.js} +1 -1
  77. package/dist/gateway/static/root/assets/{project-detail-page-RnKTj04F.js → project-detail-page-C0XssfWQ.js} +1 -1
  78. package/dist/gateway/static/root/assets/{projects-page-BhTpBKMy.js → projects-page-cT6yy_Xk.js} +1 -1
  79. package/dist/gateway/static/root/assets/{remote-access-hub-LUQUvC84.js → remote-access-hub-CpEq4PU0.js} +1 -1
  80. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bo4YiO7D.js → runtime-tools-settings-panel-CNar1-_V.js} +1 -1
  81. package/dist/gateway/static/root/assets/{schema-form-B3bVaQx1.js → schema-form-D_cAMxj5.js} +1 -1
  82. package/dist/gateway/static/root/assets/{sessions-page-fseCCI6W.js → sessions-page-D5qR92KP.js} +1 -1
  83. package/dist/gateway/static/root/assets/settings-advanced-gate-eKqVXNOq.js +1 -0
  84. package/dist/gateway/static/root/assets/{settings-form-section-vezTIqZ6.js → settings-form-section-DvLxOebb.js} +1 -1
  85. package/dist/gateway/static/root/assets/{settings-page-DC4NPD9q.js → settings-page-C6Tl6TD4.js} +1 -1
  86. package/dist/gateway/static/root/assets/{setup-status-panel-B7__vDF3.js → setup-status-panel-DuN4e4iO.js} +1 -1
  87. package/dist/gateway/static/root/assets/{share-preview-page-rXG53c7x.js → share-preview-page-BLraXBAe.js} +1 -1
  88. package/dist/gateway/static/root/assets/{shares-settings-8trvsXe5.js → shares-settings-u2Y5Ljhu.js} +1 -1
  89. package/dist/gateway/static/root/assets/{skill-api-DS7l6xfp.js → skill-api-BE_i8VdM.js} +1 -1
  90. package/dist/gateway/static/root/assets/{skill-reload-api-B5xkDw4T.js → skill-reload-api-1xNCuBFH.js} +1 -1
  91. package/dist/gateway/static/root/assets/{skills-page-DANnetBA.js → skills-page-Clye5gro.js} +1 -1
  92. package/dist/gateway/static/root/assets/{style-DMaxcb-J.js → style-pk3FR76e.js} +1 -1
  93. package/dist/gateway/static/root/assets/{system-settings-panel-x1QJgZjs.js → system-settings-panel-M550B6Mj.js} +1 -1
  94. package/dist/gateway/static/root/assets/{task-detail-page-CKYCAG5-.js → task-detail-page-DqFhFqWu.js} +1 -1
  95. package/dist/gateway/static/root/assets/{tracing-settings-page-BcLJq6Jq.js → tracing-settings-page-nXw76P46.js} +1 -1
  96. package/dist/gateway/static/root/assets/{tunnel-api-GdTAmuHs.js → tunnel-api-CC_TCY7S.js} +1 -1
  97. package/dist/gateway/static/root/assets/{usage-page-DgOCrgPr.js → usage-page-BZ0t4KYM.js} +1 -1
  98. package/dist/gateway/static/root/assets/{use-autosave-BZw6SkOF.js → use-autosave-DrxAqqzV.js} +1 -1
  99. package/dist/gateway/static/root/assets/{user-model-page-BTIjtFxG.js → user-model-page-BAQOJoHC.js} +1 -1
  100. package/dist/gateway/static/root/assets/{voice-api-key-field-D1R1yQNb.js → voice-api-key-field-Bu4paIbu.js} +1 -1
  101. package/dist/gateway/static/root/assets/{work-discovery-overlay-R2dBw9bp.js → work-discovery-overlay-3TAUYZF4.js} +1 -1
  102. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CtqK25lT.js → workflow-run-setup-panel-sgFaaLoB.js} +1 -1
  103. package/dist/gateway/static/root/assets/{workflows-page-C01mllUo.js → workflows-page-CxNXNDNc.js} +1 -1
  104. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-BjPp3a2X.js → xopc-cloud-account-card-DMZelX5s.js} +1 -1
  105. package/dist/gateway/static/root/index.html +1 -1
  106. package/dist/package.js +1 -1
  107. package/dist/src/activity/emitter.js +1 -1
  108. package/dist/src/agent/agent-manager.js +6 -6
  109. package/dist/src/agent/background-review/run-background-review.js +2 -2
  110. package/dist/src/agent/coding/repository-instructions.js +1 -1
  111. package/dist/src/agent/coding/workspace-revision.js +2 -2
  112. package/dist/src/agent/commands/command-registry.js +1 -1
  113. package/dist/src/agent/context/workspace.js +1 -1
  114. package/dist/src/agent/data-acquisition/service.js +1 -1
  115. package/dist/src/agent/embedded/codemode-output.js +1 -1
  116. package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
  117. package/dist/src/agent/embedded/model-runtime.js +1 -1
  118. package/dist/src/agent/embedded/run-for-session.js +2 -2
  119. package/dist/src/agent/embedded/run-turn.js +2 -2
  120. package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -3
  121. package/dist/src/agent/external-tools/index.js +1 -1
  122. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  123. package/dist/src/agent/image/generation/providers/xopc-cloud.js +2 -2
  124. package/dist/src/agent/image/load-image-media.js +1 -1
  125. package/dist/src/agent/independent-execution.js +1 -1
  126. package/dist/src/agent/mcp/connection-drafts.js +3 -3
  127. package/dist/src/agent/mcp/connection-setup.js +1 -1
  128. package/dist/src/agent/sandbox/path-policy.js +1 -1
  129. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  130. package/dist/src/agent/service/process-direct-streaming.js +1 -1
  131. package/dist/src/agent/service.js +3 -3
  132. package/dist/src/agent/skills/hub-pull.js +2 -2
  133. package/dist/src/agent/skills/index.js +1 -1
  134. package/dist/src/agent/skills/installer.js +3 -3
  135. package/dist/src/agent/skills/managed-store.js +1 -1
  136. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  137. package/dist/src/agent/skills/skill-sources.js +1 -1
  138. package/dist/src/agent/skills/test-framework.js +1 -1
  139. package/dist/src/agent/tools/executor.js +1 -1
  140. package/dist/src/agent/tools/factory.js +1 -1
  141. package/dist/src/agent/tools/fetch-text.js +1 -1
  142. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  143. package/dist/src/agent/tools/read.js +1 -1
  144. package/dist/src/agent/tools/review-workspace.js +1 -1
  145. package/dist/src/agent/tools/send-media.js +1 -1
  146. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  147. package/dist/src/agent/tools/write.js +1 -1
  148. package/dist/src/agent/tools/xopc-use-tool.js +3 -3
  149. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +4 -4
  150. package/dist/src/agent-catalog/repository.js +2 -2
  151. package/dist/src/auth/oauth/xopc-cloud.js +1 -1
  152. package/dist/src/auth/oauth-provider-lock.js +1 -1
  153. package/dist/src/auth/sync-provider-auth.js +1 -1
  154. package/dist/src/automations/service/action-executor.js +1 -1
  155. package/dist/src/backup/archive.js +2 -2
  156. package/dist/src/browser/cache-dir-policy.js +1 -1
  157. package/dist/src/browser/native-messaging-host.js +1 -1
  158. package/dist/src/browser/providers/browser-ext-install.js +2 -2
  159. package/dist/src/capabilities/readiness/from-config.js +2 -2
  160. package/dist/src/capabilities/store-connector.js +48 -13
  161. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
  162. package/dist/src/channels/format.js +1 -1
  163. package/dist/src/channels/index.js +3 -3
  164. package/dist/src/channels/pairing/pairing-service.js +1 -1
  165. package/dist/src/chat-commands/agent-edit.js +1 -1
  166. package/dist/src/chat-commands/builtins/config.js +1 -1
  167. package/dist/src/chat-commands/builtins/session.js +1 -1
  168. package/dist/src/chat-commands/context.js +1 -1
  169. package/dist/src/chat-commands/index.js +1 -1
  170. package/dist/src/cli/commands/agent.js +2 -2
  171. package/dist/src/cli/commands/channels.js +2 -2
  172. package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -1
  173. package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
  174. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  175. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  176. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  177. package/dist/src/cli/commands/extension-pack.js +1 -1
  178. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  179. package/dist/src/cli/commands/models.js +2 -2
  180. package/dist/src/cli/commands/onboard/model.js +2 -2
  181. package/dist/src/computer/broker.js +1 -1
  182. package/dist/src/computer/flows.js +1 -1
  183. package/dist/src/computer/runtime.js +2 -2
  184. package/dist/src/config/index.js +3 -3
  185. package/dist/src/config/loader.js +1 -1
  186. package/dist/src/config/models-json.js +1 -1
  187. package/dist/src/config/paths-state.js +1 -1
  188. package/dist/src/config/schema.d.ts +69 -3
  189. package/dist/src/config/schema.js +8 -3
  190. package/dist/src/config/workspace-path.js +1 -1
  191. package/dist/src/connectors/connected-source-ingestion.js +1 -1
  192. package/dist/src/connectors/content-enrichment.js +1 -1
  193. package/dist/src/connectors/endpoint-policy.d.ts +7 -0
  194. package/dist/src/connectors/endpoint-policy.js +14 -0
  195. package/dist/src/connectors/materialize.js +16 -1
  196. package/dist/src/connectors/secret-store.js +4 -1
  197. package/dist/src/connectors/types.d.ts +2 -0
  198. package/dist/src/daemon/constants.js +1 -1
  199. package/dist/src/daemon/install-plan.js +1 -1
  200. package/dist/src/daemon/launchd.js +1 -1
  201. package/dist/src/daemon/schtasks.js +1 -1
  202. package/dist/src/daemon/systemd.js +1 -1
  203. package/dist/src/discussions/action-tasks.js +1 -1
  204. package/dist/src/discussions/live-worker.js +2 -2
  205. package/dist/src/discussions/recording.js +1 -1
  206. package/dist/src/discussions/repository.js +1 -1
  207. package/dist/src/discussions/sealer.js +2 -2
  208. package/dist/src/discussions/service.js +1 -1
  209. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  210. package/dist/src/execution-environments/worktree-safety.js +1 -1
  211. package/dist/src/extensions/activation-context.js +2 -2
  212. package/dist/src/extensions/agent-plugins/auth.js +1 -1
  213. package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -2
  214. package/dist/src/extensions/agent-plugins/credentials.js +1 -1
  215. package/dist/src/extensions/agent-plugins/mcp-adapter.js +1 -1
  216. package/dist/src/extensions/agent-plugins/setup.js +1 -1
  217. package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
  218. package/dist/src/extensions/agent-plugins/source-catalog.js +1 -1
  219. package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
  220. package/dist/src/extensions/agent-plugins/sources.js +1 -1
  221. package/dist/src/extensions/agent-plugins/store.js +1 -1
  222. package/dist/src/extensions/agent-plugins/user-config.js +1 -1
  223. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  224. package/dist/src/extensions/api.js +1 -1
  225. package/dist/src/extensions/loader.js +1 -1
  226. package/dist/src/extensions/sdk/index.js +1 -1
  227. package/dist/src/gateway/file-path-classifier.js +1 -1
  228. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  229. package/dist/src/gateway/hono/lib/static-ui.js +1 -1
  230. package/dist/src/gateway/hono/routes/agent-plugins.js +1 -1
  231. package/dist/src/gateway/hono/routes/browser.js +1 -1
  232. package/dist/src/gateway/hono/routes/channels.js +1 -1
  233. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  234. package/dist/src/gateway/hono/routes/connectors.js +1 -1
  235. package/dist/src/gateway/hono/routes/discussions.js +1 -1
  236. package/dist/src/gateway/hono/routes/host-fs.js +1 -1
  237. package/dist/src/gateway/hono/routes/models.js +6 -6
  238. package/dist/src/gateway/hono/routes/notes.js +1 -1
  239. package/dist/src/gateway/hono/routes/observability.js +1 -1
  240. package/dist/src/gateway/hono/routes/projects.js +1 -1
  241. package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
  242. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  243. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  244. package/dist/src/gateway/hono/routes/shares.js +1 -1
  245. package/dist/src/gateway/hono/routes/status.js +1 -1
  246. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  247. package/dist/src/gateway/hono/routes/voice.js +5 -5
  248. package/dist/src/gateway/image-generation-setup.js +2 -2
  249. package/dist/src/gateway/mobile-privacy.js +1 -1
  250. package/dist/src/gateway/provider-model-setup.js +1 -1
  251. package/dist/src/gateway/service/agent-runner.js +1 -1
  252. package/dist/src/gateway/service/config-coordinator.d.ts +23 -1
  253. package/dist/src/gateway/service/config-coordinator.js +1 -1
  254. package/dist/src/gateway/service.js +10 -10
  255. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  256. package/dist/src/home-intelligence/repository.js +1 -1
  257. package/dist/src/imports/importService.js +1 -1
  258. package/dist/src/imports/productImport.js +1 -1
  259. package/dist/src/imports/sources.js +1 -1
  260. package/dist/src/infra/brew.js +1 -1
  261. package/dist/src/infra/package-runtime-check.js +1 -1
  262. package/dist/src/infra/path-env.js +1 -1
  263. package/dist/src/infra/process-diagnostics.js +1 -1
  264. package/dist/src/infra/update-check.js +1 -1
  265. package/dist/src/infra/update-restart.js +1 -1
  266. package/dist/src/local-apps/service.js +2 -2
  267. package/dist/src/markdown/index.js +1 -1
  268. package/dist/src/media/session-references.js +1 -1
  269. package/dist/src/media-shared/http/provider-http.js +1 -1
  270. package/dist/src/media-understanding/runner.js +1 -1
  271. package/dist/src/memory-learning/source-learning.js +1 -1
  272. package/dist/src/notes/agent-context.js +1 -1
  273. package/dist/src/notifications/store.js +1 -1
  274. package/dist/src/observability/runtime.js +1 -1
  275. package/dist/src/personal-agent/proactivity/repository.js +2 -2
  276. package/dist/src/personal-agent/proactivity/service.js +2 -2
  277. package/dist/src/personal-agent/reply-composer.js +1 -1
  278. package/dist/src/personal-agent/request-delivery.js +1 -1
  279. package/dist/src/personal-agent/request-service.js +1 -1
  280. package/dist/src/personal-agent/result-reader.js +2 -2
  281. package/dist/src/personal-agent/service.js +2 -2
  282. package/dist/src/personal-agent/unread.js +1 -1
  283. package/dist/src/platform/index.js +1 -1
  284. package/dist/src/project-trust/trust-store.js +1 -1
  285. package/dist/src/projects/workspace-project.js +1 -1
  286. package/dist/src/providers/extension-stream-bridge.js +1 -1
  287. package/dist/src/providers/index.js +4 -4
  288. package/dist/src/providers/model-call.js +3 -3
  289. package/dist/src/providers/model-catalog-persistence.js +1 -1
  290. package/dist/src/providers/model-registry.js +3 -3
  291. package/dist/src/providers/provider-disconnect-core.js +1 -1
  292. package/dist/src/providers/register-runtime-providers.js +1 -1
  293. package/dist/src/providers/setup/voice.js +1 -1
  294. package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
  295. package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
  296. package/dist/src/review/review-git.js +1 -1
  297. package/dist/src/runtime-tools/archive.js +1 -1
  298. package/dist/src/session/store.js +1 -1
  299. package/dist/src/share/hosted-session-share.js +1 -1
  300. package/dist/src/share/share-zip.js +1 -1
  301. package/dist/src/share/site-proxy.js +1 -1
  302. package/dist/src/share/site-static-serve.js +1 -1
  303. package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
  304. package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
  305. package/dist/src/storage/sqlite/connection.js +1 -1
  306. package/dist/src/storage/sqlite/conversation-repository.js +2 -2
  307. package/dist/src/storage/sqlite/device-access-repository.js +1 -1
  308. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  309. package/dist/src/storage/sqlite/migrations/runner.js +2 -2
  310. package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
  311. package/dist/src/storage/sqlite/session-repository.js +1 -1
  312. package/dist/src/tasks/capabilities/management.js +1 -1
  313. package/dist/src/tasks/capabilities/relations.js +1 -1
  314. package/dist/src/tasks/task-allocation-service.js +3 -3
  315. package/dist/src/tasks/task-application-service.js +1 -1
  316. package/dist/src/tasks/task-context-assembler.js +2 -2
  317. package/dist/src/tasks/task-criterion-review-repository.js +1 -1
  318. package/dist/src/tasks/task-handoff-service.js +1 -1
  319. package/dist/src/tasks/task-handoff.js +2 -2
  320. package/dist/src/tasks/task-research-repair.js +1 -1
  321. package/dist/src/tasks/task-research-result.js +2 -2
  322. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  323. package/dist/src/tasks/task-result-delivery-service.js +1 -1
  324. package/dist/src/tasks/task-signal-service.js +1 -1
  325. package/dist/src/tui/backends/embedded-backend.js +4 -4
  326. package/dist/src/tui/clipboard-image.js +2 -2
  327. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  328. package/dist/src/tui/tui-commands.js +1 -1
  329. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  330. package/dist/src/tui/tui-startup-resources.js +1 -1
  331. package/dist/src/tui/tui.js +3 -3
  332. package/dist/src/tunnel/frpc-binary.js +1 -1
  333. package/dist/src/usage/cloud-capability.js +1 -1
  334. package/dist/src/usage/cloud-receipts.js +1 -1
  335. package/dist/src/usage/recorder.js +2 -2
  336. package/dist/src/user-context/access-policy.js +2 -2
  337. package/dist/src/utils/index.js +1 -1
  338. package/dist/src/utils/logger/index.js +1 -1
  339. package/dist/src/utils/logger.js +1 -1
  340. package/dist/src/voice/audio/normalize.js +1 -1
  341. package/dist/src/voice/platform-settings.js +1 -1
  342. package/dist/src/voice/realtime/memory-context.js +3 -3
  343. package/dist/src/voice/realtime/runtime.js +2 -2
  344. package/dist/src/voice/stt/factory.js +1 -1
  345. package/dist/src/voice/stt/index.js +2 -2
  346. package/dist/src/voice/stt/preflight.js +2 -2
  347. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +3 -3
  348. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +3 -3
  349. package/dist/src/voice/stt/transcribe-core.js +1 -1
  350. package/dist/src/voice/tts/factory.js +1 -1
  351. package/dist/src/voice/tts/providers/bailian-plan-speech.js +2 -2
  352. package/dist/src/voice/tts/providers/edge-speech.js +1 -1
  353. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +2 -2
  354. package/dist/src/work-discovery/candidate-discovery.js +2 -2
  355. package/dist/src/work-discovery/probe.js +2 -2
  356. package/dist/src/work-discovery/service.js +2 -2
  357. package/package.json +3 -3
  358. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CILrbgBf.js +0 -1
  359. package/dist/gateway/static/root/assets/settings-advanced-gate-CBn8SVz7.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,g as o,t as s}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as c}from"./ellipsis-0k4rZLoy.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./markdown-view-B58RypQ4.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-DBvKzlCl.js";import{t as m}from"./cn-0WouolD0.js";import{c as h,i as g,n as _,r as v}from"./locale-store-Jnhw2WMv.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./dist-BGTk37IG.js";import{a as T,i as E}from"./vendor-swr-BIWyz7Rc.js";import{o as D}from"./gateway-realtime-dE0XrVAT.js";import{$l as O,Al as k,Bo as A,Df as ee,Du as j,Go as M,Gu as N,Ho as P,Ic as F,Rc as I,Vo as L,Wc as R,Zl as te,ar as z,er as B,gf as V,is as ne,jl as re,jo as H,no as U,nr as W,of as G,rr as K,tr as q,zo as J}from"./index-Cmrvxc_s.js";import{n as Y,t as X}from"./capability-links-DzQWK1Fh.js";import{n as Z,t as ie}from"./capability-header-actions-WRaPQFq0.js";import{t as ae}from"./capability-icon-DVoZxEgW.js";import{i as oe,n as se,r as ce,t as le}from"./plugin-presentation-BcZHPy_6.js";var ue=n(),de=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,fe=`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`,pe=`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 me(e){return e===`builtin`||e===`user`?e:`marketplace`}async function he(e=``){let t=await g(v(`/api/marketplace${e.trim()?`?q=${encodeURIComponent(e.trim())}`:``}`),{cache:`no-store`});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!Array.isArray(n.extensions))throw Error(n.error??`Invalid response`);return n.extensions}async function ge(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function _e(e){let t=await g(v(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function ve(e){let t=await g(v(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function ye(e){let t=await g(v(`/api/extensions/${encodeURIComponent(e.extensionId.trim())}/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e.enabled})});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function be(e){let t=await g(v(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var $=r();function xe(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 Se={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function Ce({className:e,query:t}){let n=a(),r=i(),o=_(e=>e.language),s=p(o).extensionsPage,c=h(e=>!!e.conversationId),l=J(),{mutate:u}=T(),[d,f]=(0,Q.useReducer)(U,Se),{debounced:g,detailPkg:v,quickInstallPkg:y,rowBusy:b,actionError:x,restartHint:S}=d,C=c?`marketplace-${g}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>f({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:w,isLoading:O,error:k}=E(C,()=>he(g),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{u(`gateway-extensions-list`),D()},[u]),ee=(0,Q.useCallback)(async(e,t)=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await ve({name:e,overwrite:t});A(),n.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceInstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceInstallFailed,s.marketplaceRestartHint,A]),M=(0,Q.useCallback)(async e=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await be(e);A(),t.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceUninstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceRestartHint,s.marketplaceUninstallFailed,A]),P=w??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[k?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k instanceof Error?k.message:s.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,O&&!w?(0,$.jsx)(`ul`,{className:de,"aria-label":s.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)(I,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(I,{className:`h-5 w-full`}),(0,$.jsx)(I,{className:`h-3 w-2/3`})]}),(0,$.jsx)(I,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(I,{className:`h-4 w-full`}),(0,$.jsx)(I,{className:`h-4 w-full`}),(0,$.jsx)(I,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:de,children:P.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:s.marketplaceEmpty}):P.map(e=>{let t=xe(l,e.id),i=b===e.id,a=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[o.startsWith(`zh`)?`zh-CN`:`en`],u=c?.displayName??e.name,d=c?.description??e.description;return(0,$.jsxs)(`li`,{className:fe,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${u}, ${s.marketplaceDetailTitle}`,onClick:()=>a?.pluginId?n(X(a.pluginId,`installed`,!1,r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id}}),className:pe}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(ae,{iconUrl:e.branding?.iconUrl,fallback:j}),(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:u,children:u}),e.verified?(0,$.jsx)(G,{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:a&&ce(a)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:a&&ce(a)?o.startsWith(`zh`)?`需要授权`:`Authorization required`:s.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:s.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>a?.pluginId&&le(a)?n(Y(u,o.startsWith(`zh`))):a?.pluginId?n(X(a.pluginId,`installed`,ce(a),r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`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:a&&ce(a)?o.startsWith(`zh`)?`去授权`:`Connect account`:a&&le(a)?o.startsWith(`zh`)?`开始使用`:`Start using`:o.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(s.marketplaceUninstallConfirm)&&M(e.id).catch(()=>{})},className:m(`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)(N,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),s.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>f({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`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`?o.startsWith(`zh`)?`安装`:`Install`:s.marketplaceReview})})]}),d?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:d}):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)})}),v?(0,$.jsx)(we,{packageName:v,autoInstall:y===v,copy:s,extensions:l,onClose:()=>f({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:ee,onUninstall:M}):null]})}function we(e){let t=(0,ue.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:o,onInstall:c,onUninstall:l}=e,[d,p]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),v=h(ke)?`ext-mp-detail-${n}`:null,b;t[0]===n?b=t[1]:(b=async()=>_e(n),t[0]=n,t[1]=b);let T;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(T={revalidateOnFocus:!1},t[2]=T):T=t[2];let{data:D,error:O,isLoading:A}=E(v,b,T),j;t[3]!==a||t[4]!==n?(j=xe(a,n),t[3]=a,t[4]=n,t[5]=j):j=t[5];let M=j,P=M===`user`,F=D?.manifest?.permissions,L,R,z,B,V,ne,H,U,W,G,K,q;if(t[6]!==r||t[7]!==i||t[8]!==D||t[9]!==O||t[10]!==a||t[11]!==M||t[12]!==A||t[13]!==o||t[14]!==n||t[15]!==F||t[16]!==g){ne=Symbol.for(`react.early_return_sentinel`);bb0:{let e=F&&typeof F==`object`&&!Array.isArray(F)?Object.entries(F):[],s;t[29]!==i||t[30]!==D?(s=D?.readme?.trim()||(D?.description?.trim()?`### ${D.name}\n\n${D.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=D,t[31]=s):s=t[31];let c=s;if(D?.format===`agent-plugin`){let e;if(t[32]!==D||t[33]!==a||t[34]!==n){let r;t[36]!==D||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===D.manifest?.name,t[36]=D,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=D,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,s;t[39]!==r||t[40]!==D||t[41]!==o||t[42]!==e||t[43]!==i?(s=(0,$.jsx)(oe,{extension:e,initialSource:i,marketplace:D,autoInstall:r,onClose:o}),t[39]=r,t[40]=D,t[41]=o,t[42]=e,t[43]=i,t[44]=s):s=t[44],ne=s;break bb0}z=w,B=!0,t[45]===o?V=t[46]:(V=e=>!e&&o(),t[45]=o,t[46]=V),R=x,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=q):q=t[47],L=S,W=`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`,G=Oe;let l;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(ee,{className:`size-5`}),t[48]=l):l=t[48];let d;t[49]!==i.detailBack||t[50]!==o?(d=(0,$.jsx)(`button`,{type:`button`,onClick:o,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:l}),t[49]=i.detailBack,t[50]=o,t[51]=d):d=t[51];let p;t[52]===i.marketplaceDetailTitle?p=t[53]:(p=(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=p);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[54]=m):m=t[54];let h;t[55]!==i.detailClose||t[56]!==o?(h=(0,$.jsx)(`button`,{type:`button`,onClick:o,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]=o,t[57]=h):h=t[57],t[58]!==d||t[59]!==p||t[60]!==h?(K=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,p,h]}),t[58]=d,t[59]=p,t[60]=h,t[61]=K):K=t[61],H=`min-h-0 flex-1 overflow-y-auto p-5`,U=A&&!D?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(I,{className:`h-6 w-48`}),(0,$.jsx)(I,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(I,{className:`h-12`}),(0,$.jsx)(I,{className:`h-12`})]}),(0,$.jsx)(I,{className:`h-28 w-full`}),(0,$.jsx)(I,{className:`h-36 w-full`})]}):O?(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:O instanceof Error?O.message:i.marketplaceLoadFailed})]}):D?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:D.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:D.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:D.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:D.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:D.downloads})]})]}),M===`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:[D.installability.available?(0,$.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(k,{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:D.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:D.installability.available?i.marketplaceCodeRisk:D.installability.reason??i.marketplaceUnavailableBody})]})]}),D.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:D.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(De)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(D.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,D.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:g,onChange:e=>_(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),D.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)(u,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=D,t[9]=O,t[10]=a,t[11]=M,t[12]=A,t[13]=o,t[14]=n,t[15]=F,t[16]=g,t[17]=L,t[18]=R,t[19]=z,t[20]=B,t[21]=V,t[22]=ne,t[23]=H,t[24]=U,t[25]=W,t[26]=G,t[27]=K,t[28]=q}else L=t[17],R=t[18],z=t[19],B=t[20],V=t[21],ne=t[22],H=t[23],U=t[24],W=t[25],G=t[26],K=t[27],q=t[28];if(ne!==Symbol.for(`react.early_return_sentinel`))return ne;let J;t[62]!==H||t[63]!==U?(J=(0,$.jsx)(`div`,{className:H,children:U}),t[62]=H,t[63]=U,t[64]=J):J=t[64];let Y;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]!==D||t[74]!==M||t[75]!==o||t[76]!==c||t[77]!==l||t[78]!==n||t[79]!==g||t[80]!==P?(Y=D?(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:M===`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)(s,{to:`/capabilities/extensions?tab=builtin`,onClick:o,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||!D.installability.available||!g,onClick:()=>{P&&!window.confirm(i.marketplaceReinstallConfirm)||(p(!0),c(n,P).catch(Ee).finally(()=>p(!1)))},className:m(`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)(N,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,P?i.marketplaceReinstall:i.marketplaceInstall]}),P?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(p(!0),l(n).then(()=>o()).catch(Te).finally(()=>p(!1)))},className:m(`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)(re,{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]=D,t[74]=M,t[75]=o,t[76]=c,t[77]=l,t[78]=n,t[79]=g,t[80]=P,t[81]=Y):Y=t[81];let X;t[82]!==L||t[83]!==J||t[84]!==Y||t[85]!==W||t[86]!==G||t[87]!==K?(X=(0,$.jsxs)(L,{className:W,onOpenAutoFocus:G,children:[K,J,Y]}),t[82]=L,t[83]=J,t[84]=Y,t[85]=W,t[86]=G,t[87]=K,t[88]=X):X=t[88];let Z;t[89]!==R||t[90]!==X||t[91]!==q?(Z=(0,$.jsxs)(R,{children:[q,X]}),t[89]=R,t[90]=X,t[91]=q,t[92]=Z):Z=t[92];let ie;return t[93]!==z||t[94]!==B||t[95]!==V||t[96]!==Z?(ie=(0,$.jsx)(z,{defaultOpen:B,onOpenChange:V,children:Z}),t[93]=z,t[94]=B,t[95]=V,t[96]=Z,t[97]=ie):ie=t[97],ie}function Te(){}function Ee(){}function De(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 Oe(e){return e.preventDefault()}function ke(e){return!!e.conversationId}function Ae({embedded:e=!1,onHeaderActionChange:t}){let n=a(),r=i(),l=_(e=>e.language),u=p(l),f=M(e=>e.setPageHeader),h=M(e=>e.clearPageHeader),g=J(),v=A(),[y,b]=o(),x=me(y.get(`tab`)??(g.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),C=y.get(`q`)??``,[w,T]=(0,Q.useState)(x),[E,D]=(0,Q.useState)(C),[O,k]=(0,Q.useState)(null),[ee,j]=(0,Q.useState)(!1),N=y.toString(),P=(0,Q.useRef)(N);if(P.current!==N){P.current=N;let e=me(y.get(`tab`)),t=y.get(`q`)??``;T(t=>t===e?t:e),D(e=>e===t?e:t)}(0,Q.useEffect)(()=>{b(e=>{let t=new URLSearchParams(e),n=E.trim();return n?t.set(`q`,n):t.delete(`q`),w===`marketplace`?t.delete(`tab`):t.set(`tab`,w),t.toString()===e.toString()?e:t},{replace:!0})},[w,E,b]);let I=(0,Q.useMemo)(()=>g.filter(e=>e.source===`bundled`),[g]),L=(0,Q.useMemo)(()=>g.filter(e=>e.source!==`bundled`),[g]);(0,Q.useEffect)(()=>{v||S.current||(S.current=!0,!y.has(`tab`)&&L.length&&T(`user`))},[v,y,L.length]);let te=w===`builtin`?I:L,re=(0,Q.useMemo)(()=>{let e=E.trim().toLowerCase(),t=te;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,l):e.hasUi?-1:1)},[te,E,l]);(0,Q.useEffect)(()=>{k(e=>{if(!e)return e;let t=g.find(t=>t.id===e.id);return t?je(e)===je(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[g]);let H=(0,Q.useMemo)(()=>({searchLabel:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(Z,{value:E,onChange:D,placeholder:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(K,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(R,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(c,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(W,{children:(0,$.jsxs)(B,{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)(q,{className:m(`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`,F.transition),onSelect:()=>j(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(s,{to:`/local-apps`,className:m(`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`,F.transition),children:[(0,$.jsx)(V,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(R,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(s,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[l,u.capabilitiesHub.moreActions,u.extensionsPage,w,E]);(0,Q.useLayoutEffect)(()=>e?(t?.(H),()=>t?.(null)):(f({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)(ie,{contribution:H})}),()=>h()),[h,e,H,u.extensionsPage.title,t,f]);let U=[{id:`user`,label:u.extensionsPage.tabUser,count:v?void 0:L.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:v?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:m(`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)(ne,{items:U,activeTab:w,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),w===`marketplace`?(0,$.jsx)(Ce,{query:E}):v?(0,$.jsx)(Re,{}):w===`builtin`&&I.length===0?(0,$.jsx)(Be,{message:u.extensionsPage.emptyBuiltin}):w===`user`&&L.length===0?(0,$.jsx)(Be,{message:u.extensionsPage.emptyUser}):re.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:de,children:re.map(e=>(0,$.jsx)(Pe,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(X(e.pluginId,`installed`,!1,r.pathname+r.search)):k(e)},e.id))})]}),O?O.format===`agent-plugin`?(0,$.jsx)(oe,{extension:O,onClose:()=>k(null)},O.id):(0,$.jsx)(Ie,{extension:O,copy:u.extensionsPage,onClose:()=>k(null)},O.id):null,ee?(0,$.jsx)(oe,{onClose:()=>j(!1)}):null]})}function je(e){return e.activationEligible??e.active}function Me(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ne(e,t){let n=je(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Pe(e){let t=(0,ue.c)(56),{extension:n,copy:r,onOpen:o}=e,s=_(Fe),c,l;t[0]!==n||t[1]!==s?(l=s.startsWith(`zh`),c=se(n,l),t[0]=n,t[1]=s,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u=c,d;t[4]===n?d=t[5]:(d=ce(n),t[4]=n,t[5]=d);let f=d,p=n.localizations?.[l?`zh-CN`:`en`]?.description??n.description,m=a(),h=i(),g;t[6]===n?g=t[7]:(g=!!n.pluginId&&le(n),t[6]=n,t[7]=g);let v=g,y=f?l?`去授权`:`Connect account`:v?l?`开始使用`:`Start using`:l?`管理插件`:`Manage plugin`,b;t[8]!==v||t[9]!==n.pluginId||t[10]!==h||t[11]!==u||t[12]!==m||t[13]!==f||t[14]!==o||t[15]!==l?(b=()=>{v?m(Y(u,l)):f&&n.pluginId?m(X(n.pluginId,`installed`,!0,h.pathname+h.search)):o()},t[8]=v,t[9]=n.pluginId,t[10]=h,t[11]=u,t[12]=m,t[13]=f,t[14]=o,t[15]=l,t[16]=b):b=t[16];let x=b,S=`${u}, ${r.marketplaceDetailTitle}`,C;t[17]!==o||t[18]!==S?(C=(0,$.jsx)(`button`,{type:`button`,"aria-label":S,onClick:o,className:pe}),t[17]=o,t[18]=S,t[19]=C):C=t[19];let w=n.branding?.iconUrl,T;t[20]===w?T=t[21]:(T=(0,$.jsx)(ae,{iconUrl:w,fallback:V}),t[20]=w,t[21]=T);let E;t[22]===u?E=t[23]:(E=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),t[22]=u,t[23]=E);let D;t[24]===n.provenance?.publisherVerification?D=t[25]:(D=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(G,{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]=D);let O;t[26]!==E||t[27]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[E,D]}),t[26]=E,t[27]=D,t[28]=O):O=t[28];let k;t[29]===n.version?k=t[30]:(k=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=k);let A=f?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,ee=f?l?`需要授权`:`Authorization required`:je(n)?r.statusEnabled:r.runStateOff,j;t[31]!==A||t[32]!==ee?(j=(0,$.jsx)(`span`,{className:A,children:ee}),t[31]=A,t[32]=ee,t[33]=j):j=t[33];let M;t[34]!==k||t[35]!==j?(M=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[k,j]}),t[34]=k,t[35]=j,t[36]=M):M=t[36];let N;t[37]!==O||t[38]!==M?(N=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[O,M]}),t[37]=O,t[38]=M,t[39]=N):N=t[39];let P;t[40]!==y||t[41]!==x?(P=(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:x,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:y})}),t[40]=y,t[41]=x,t[42]=P):P=t[42];let F;t[43]!==N||t[44]!==P||t[45]!==T?(F=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[T,N,P]}),t[43]=N,t[44]=P,t[45]=T,t[46]=F):F=t[46];let I;t[47]!==r.cardNoDescription||t[48]!==p?(I=p?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=p,t[49]=I):I=t[49];let L;t[50]===I?L=t[51]:(L=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:I}),t[50]=I,t[51]=L);let R;return t[52]!==F||t[53]!==L||t[54]!==C?(R=(0,$.jsxs)(`article`,{className:fe,children:[C,F,L]}),t[52]=F,t[53]=L,t[54]=C,t[55]=R):R=t[55],R}function Fe(e){return e.language}function Ie({extension:e,copy:t,onClose:n}){let{mutate:r}=T(),[i,a]=(0,Q.useState)(null),[o,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),p=e.activationEligible===!0,h=(0,Q.useCallback)(async()=>{c(null),d(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ye({extensionId:e.id,enabled:!p});await r(`gateway-extensions-list`),D(),d(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[p,t.extensionToggleFailed,e.id,r]),g=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),d(!1),a(`uninstall`);try{await be(e.id),await r(`gateway-extensions-list`),D(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),_=e.ui?.contributions?.pages??[],v=e.ui?.contributions?.settingsPanels??[],E=e.ui?.contributions?.chatWidgets??[],k=_.find(e=>e.showInNav)??_[0],A=v[0],j=k?H(e.id,k):null,M=A?`/settings/ext/${e.id}/${A.id}`:e.hasConfigSchema||L(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(w,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(S,{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)(ee,{className:`size-5`})}),(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(b,{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)(f,{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,` `,Me(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:Ne(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)(R,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void h(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(N,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):p?t.builtinToggleDisable:t.builtinToggleEnable})]}),o?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:o}):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)(R,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void g(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(N,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(_.length>0||v.length>0||E.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)(Le,{template:t.badgePages,count:_.length,hidden:_.length===0}),(0,$.jsx)(Le,{template:t.badgeSettings,count:v.length,hidden:v.length===0}),(0,$.jsx)(Le,{template:t.badgeWidgets,count:E.length,hidden:E.length===0})]})]}):null,P(e)&&(j||M)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[j?(0,$.jsxs)(s,{to:j,onClick:n,className:m(`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)(l,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,M?(0,$.jsxs)(s,{to:M,onClick:n,className:m(`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)(O,{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 Le(e){let t=(0,ue.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 Re(){let e=(0,ue.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:de,"aria-busy":`true`,children:Array.from({length:6},ze)}),e[0]=t):t=e[0],t}function ze(e,t){return(0,$.jsx)(I,{className:`h-32 rounded-xl`},t)}function Be(e){let t=(0,ue.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{Ae as ExtensionsPage};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,g as o,t as s}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as c}from"./ellipsis-0k4rZLoy.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./markdown-view-B58RypQ4.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-DBvKzlCl.js";import{t as m}from"./cn-0WouolD0.js";import{c as h,i as g,n as _,r as v}from"./locale-store-Jnhw2WMv.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./dist-BGTk37IG.js";import{a as T,i as E}from"./vendor-swr-BIWyz7Rc.js";import{o as D}from"./gateway-realtime-dE0XrVAT.js";import{$l as O,Al as k,Bo as A,Df as ee,Du as j,Go as M,Gu as N,Ho as P,Ic as F,Rc as I,Vo as L,Wc as R,Zl as te,ar as z,er as B,gf as V,is as ne,jl as re,jo as H,no as U,nr as W,of as G,rr as K,tr as q,zo as J}from"./index-cmsFpzI8.js";import{n as Y,t as X}from"./capability-links-DzQWK1Fh.js";import{n as Z,t as ie}from"./capability-header-actions-BBPBfpGd.js";import{t as ae}from"./capability-icon-DVoZxEgW.js";import{i as oe,n as se,r as ce,t as le}from"./plugin-presentation-C0la7V8t.js";var ue=n(),de=`grid auto-rows-fr grid-cols-[repeat(auto-fill,minmax(min(100%,18rem),1fr))] items-stretch gap-4`,fe=`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`,pe=`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 me(e){return e===`builtin`||e===`user`?e:`marketplace`}async function he(e=``){let t=await g(v(`/api/marketplace${e.trim()?`?q=${encodeURIComponent(e.trim())}`:``}`),{cache:`no-store`});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!Array.isArray(n.extensions))throw Error(n.error??`Invalid response`);return n.extensions}async function ge(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function _e(e){let t=await g(v(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function ve(e){let t=await g(v(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function ye(e){let t=await g(v(`/api/extensions/${encodeURIComponent(e.extensionId.trim())}/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e.enabled})});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function be(e){let t=await g(v(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await ge(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var $=r();function xe(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 Se={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function Ce({className:e,query:t}){let n=a(),r=i(),o=_(e=>e.language),s=p(o).extensionsPage,c=h(e=>!!e.conversationId),l=J(),{mutate:u}=T(),[d,f]=(0,Q.useReducer)(U,Se),{debounced:g,detailPkg:v,quickInstallPkg:y,rowBusy:b,actionError:x,restartHint:S}=d,C=c?`marketplace-${g}`:null;(0,Q.useEffect)(()=>{let e=window.setTimeout(()=>f({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:w,isLoading:O,error:k}=E(C,()=>he(g),{revalidateOnFocus:!1}),A=(0,Q.useCallback)(()=>{u(`gateway-extensions-list`),D()},[u]),ee=(0,Q.useCallback)(async(e,t)=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await ve({name:e,overwrite:t});A(),n.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceInstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceInstallFailed,s.marketplaceRestartHint,A]),M=(0,Q.useCallback)(async e=>{f({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await be(e);A(),t.requiresGatewayRestart&&f({type:`patch`,patch:{restartHint:s.marketplaceRestartHint}})}catch(e){throw f({type:`patch`,patch:{actionError:e instanceof Error?e.message:s.marketplaceUninstallFailed}}),e}finally{f({type:`patch`,patch:{rowBusy:null}})}},[s.marketplaceRestartHint,s.marketplaceUninstallFailed,A]),P=w??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[k?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:k instanceof Error?k.message:s.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,O&&!w?(0,$.jsx)(`ul`,{className:de,"aria-label":s.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)(I,{className:`size-10 shrink-0 rounded-xl`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(I,{className:`h-5 w-full`}),(0,$.jsx)(I,{className:`h-3 w-2/3`})]}),(0,$.jsx)(I,{className:`h-9 w-16 shrink-0 rounded-lg`})]}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,$.jsx)(I,{className:`h-4 w-full`}),(0,$.jsx)(I,{className:`h-4 w-full`}),(0,$.jsx)(I,{className:`h-4 w-2/3`})]})]},e))}):(0,$.jsx)(`ul`,{className:de,children:P.length===0?(0,$.jsx)(`li`,{className:`col-span-full text-sm text-fg-muted`,children:s.marketplaceEmpty}):P.map(e=>{let t=xe(l,e.id),i=b===e.id,a=l.find(t=>t.pluginId===e.id||t.provenance?.packageName===e.id),c=e.localizations?.[o.startsWith(`zh`)?`zh-CN`:`en`],u=c?.displayName??e.name,d=c?.description??e.description;return(0,$.jsxs)(`li`,{className:fe,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`${u}, ${s.marketplaceDetailTitle}`,onClick:()=>a?.pluginId?n(X(a.pluginId,`installed`,!1,r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id}}),className:pe}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[(0,$.jsx)(ae,{iconUrl:e.branding?.iconUrl,fallback:j}),(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:u,children:u}),e.verified?(0,$.jsx)(G,{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:a&&ce(a)?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,children:a&&ce(a)?o.startsWith(`zh`)?`需要授权`:`Authorization required`:s.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:s.marketplaceBuiltin}):t===`user`?(0,$.jsx)($.Fragment,{children:e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>a?.pluginId&&le(a)?n(Y(u,o.startsWith(`zh`))):a?.pluginId?n(X(a.pluginId,`installed`,ce(a),r.pathname+r.search)):f({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`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:a&&ce(a)?o.startsWith(`zh`)?`去授权`:`Connect account`:a&&le(a)?o.startsWith(`zh`)?`开始使用`:`Start using`:o.startsWith(`zh`)?`管理插件`:`Manage plugin`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(s.marketplaceUninstallConfirm)&&M(e.id).catch(()=>{})},className:m(`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)(N,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),s.marketplaceUninstall]})}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>f({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`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`?o.startsWith(`zh`)?`安装`:`Install`:s.marketplaceReview})})]}),d?(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:d}):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)})}),v?(0,$.jsx)(we,{packageName:v,autoInstall:y===v,copy:s,extensions:l,onClose:()=>f({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:ee,onUninstall:M}):null]})}function we(e){let t=(0,ue.c)(98),{packageName:n,autoInstall:r,copy:i,extensions:a,onClose:o,onInstall:c,onUninstall:l}=e,[d,p]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),v=h(ke)?`ext-mp-detail-${n}`:null,b;t[0]===n?b=t[1]:(b=async()=>_e(n),t[0]=n,t[1]=b);let T;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(T={revalidateOnFocus:!1},t[2]=T):T=t[2];let{data:D,error:O,isLoading:A}=E(v,b,T),j;t[3]!==a||t[4]!==n?(j=xe(a,n),t[3]=a,t[4]=n,t[5]=j):j=t[5];let M=j,P=M===`user`,F=D?.manifest?.permissions,L,R,z,B,V,ne,H,U,W,G,K,q;if(t[6]!==r||t[7]!==i||t[8]!==D||t[9]!==O||t[10]!==a||t[11]!==M||t[12]!==A||t[13]!==o||t[14]!==n||t[15]!==F||t[16]!==g){ne=Symbol.for(`react.early_return_sentinel`);bb0:{let e=F&&typeof F==`object`&&!Array.isArray(F)?Object.entries(F):[],s;t[29]!==i||t[30]!==D?(s=D?.readme?.trim()||(D?.description?.trim()?`### ${D.name}\n\n${D.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=D,t[31]=s):s=t[31];let c=s;if(D?.format===`agent-plugin`){let e;if(t[32]!==D||t[33]!==a||t[34]!==n){let r;t[36]!==D||t[37]!==n?(r=e=>e.provenance?.packageName===n||e.pluginId===D.manifest?.name,t[36]=D,t[37]=n,t[38]=r):r=t[38],e=a.find(r),t[32]=D,t[33]=a,t[34]=n,t[35]=e}else e=t[35];let i=`store:${n}`,s;t[39]!==r||t[40]!==D||t[41]!==o||t[42]!==e||t[43]!==i?(s=(0,$.jsx)(oe,{extension:e,initialSource:i,marketplace:D,autoInstall:r,onClose:o}),t[39]=r,t[40]=D,t[41]=o,t[42]=e,t[43]=i,t[44]=s):s=t[44],ne=s;break bb0}z=w,B=!0,t[45]===o?V=t[46]:(V=e=>!e&&o(),t[45]=o,t[46]=V),R=x,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[47]=q):q=t[47],L=S,W=`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`,G=Oe;let l;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(ee,{className:`size-5`}),t[48]=l):l=t[48];let d;t[49]!==i.detailBack||t[50]!==o?(d=(0,$.jsx)(`button`,{type:`button`,onClick:o,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:l}),t[49]=i.detailBack,t[50]=o,t[51]=d):d=t[51];let p;t[52]===i.marketplaceDetailTitle?p=t[53]:(p=(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[52]=i.marketplaceDetailTitle,t[53]=p);let m;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[54]=m):m=t[54];let h;t[55]!==i.detailClose||t[56]!==o?(h=(0,$.jsx)(`button`,{type:`button`,onClick:o,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]=o,t[57]=h):h=t[57],t[58]!==d||t[59]!==p||t[60]!==h?(K=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,p,h]}),t[58]=d,t[59]=p,t[60]=h,t[61]=K):K=t[61],H=`min-h-0 flex-1 overflow-y-auto p-5`,U=A&&!D?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(I,{className:`h-6 w-48`}),(0,$.jsx)(I,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(I,{className:`h-12`}),(0,$.jsx)(I,{className:`h-12`})]}),(0,$.jsx)(I,{className:`h-28 w-full`}),(0,$.jsx)(I,{className:`h-36 w-full`})]}):O?(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:O instanceof Error?O.message:i.marketplaceLoadFailed})]}):D?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:D.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:D.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:D.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:D.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:D.downloads})]})]}),M===`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:[D.installability.available?(0,$.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(k,{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:D.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:D.installability.available?i.marketplaceCodeRisk:D.installability.reason??i.marketplaceUnavailableBody})]})]}),D.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:D.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(De)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(D.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,D.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:g,onChange:e=>_(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),D.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)(u,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=D,t[9]=O,t[10]=a,t[11]=M,t[12]=A,t[13]=o,t[14]=n,t[15]=F,t[16]=g,t[17]=L,t[18]=R,t[19]=z,t[20]=B,t[21]=V,t[22]=ne,t[23]=H,t[24]=U,t[25]=W,t[26]=G,t[27]=K,t[28]=q}else L=t[17],R=t[18],z=t[19],B=t[20],V=t[21],ne=t[22],H=t[23],U=t[24],W=t[25],G=t[26],K=t[27],q=t[28];if(ne!==Symbol.for(`react.early_return_sentinel`))return ne;let J;t[62]!==H||t[63]!==U?(J=(0,$.jsx)(`div`,{className:H,children:U}),t[62]=H,t[63]=U,t[64]=J):J=t[64];let Y;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]!==D||t[74]!==M||t[75]!==o||t[76]!==c||t[77]!==l||t[78]!==n||t[79]!==g||t[80]!==P?(Y=D?(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:M===`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)(s,{to:`/capabilities/extensions?tab=builtin`,onClick:o,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||!D.installability.available||!g,onClick:()=>{P&&!window.confirm(i.marketplaceReinstallConfirm)||(p(!0),c(n,P).catch(Ee).finally(()=>p(!1)))},className:m(`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)(N,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,P?i.marketplaceReinstall:i.marketplaceInstall]}),P?(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(p(!0),l(n).then(()=>o()).catch(Te).finally(()=>p(!1)))},className:m(`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)(re,{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]=D,t[74]=M,t[75]=o,t[76]=c,t[77]=l,t[78]=n,t[79]=g,t[80]=P,t[81]=Y):Y=t[81];let X;t[82]!==L||t[83]!==J||t[84]!==Y||t[85]!==W||t[86]!==G||t[87]!==K?(X=(0,$.jsxs)(L,{className:W,onOpenAutoFocus:G,children:[K,J,Y]}),t[82]=L,t[83]=J,t[84]=Y,t[85]=W,t[86]=G,t[87]=K,t[88]=X):X=t[88];let Z;t[89]!==R||t[90]!==X||t[91]!==q?(Z=(0,$.jsxs)(R,{children:[q,X]}),t[89]=R,t[90]=X,t[91]=q,t[92]=Z):Z=t[92];let ie;return t[93]!==z||t[94]!==B||t[95]!==V||t[96]!==Z?(ie=(0,$.jsx)(z,{defaultOpen:B,onOpenChange:V,children:Z}),t[93]=z,t[94]=B,t[95]=V,t[96]=Z,t[97]=ie):ie=t[97],ie}function Te(){}function Ee(){}function De(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 Oe(e){return e.preventDefault()}function ke(e){return!!e.conversationId}function Ae({embedded:e=!1,onHeaderActionChange:t}){let n=a(),r=i(),l=_(e=>e.language),u=p(l),f=M(e=>e.setPageHeader),h=M(e=>e.clearPageHeader),g=J(),v=A(),[y,b]=o(),x=me(y.get(`tab`)??(g.some(e=>e.source!==`bundled`)?`user`:null)),S=(0,Q.useRef)(!1),C=y.get(`q`)??``,[w,T]=(0,Q.useState)(x),[E,D]=(0,Q.useState)(C),[O,k]=(0,Q.useState)(null),[ee,j]=(0,Q.useState)(!1),N=y.toString(),P=(0,Q.useRef)(N);if(P.current!==N){P.current=N;let e=me(y.get(`tab`)),t=y.get(`q`)??``;T(t=>t===e?t:e),D(e=>e===t?e:t)}(0,Q.useEffect)(()=>{b(e=>{let t=new URLSearchParams(e),n=E.trim();return n?t.set(`q`,n):t.delete(`q`),w===`marketplace`?t.delete(`tab`):t.set(`tab`,w),t.toString()===e.toString()?e:t},{replace:!0})},[w,E,b]);let I=(0,Q.useMemo)(()=>g.filter(e=>e.source===`bundled`),[g]),L=(0,Q.useMemo)(()=>g.filter(e=>e.source!==`bundled`),[g]);(0,Q.useEffect)(()=>{v||S.current||(S.current=!0,!y.has(`tab`)&&L.length&&T(`user`))},[v,y,L.length]);let te=w===`builtin`?I:L,re=(0,Q.useMemo)(()=>{let e=E.trim().toLowerCase(),t=te;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,l):e.hasUi?-1:1)},[te,E,l]);(0,Q.useEffect)(()=>{k(e=>{if(!e)return e;let t=g.find(t=>t.id===e.id);return t?je(e)===je(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[g]);let H=(0,Q.useMemo)(()=>({searchLabel:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder,search:(0,$.jsx)(Z,{value:E,onChange:D,placeholder:w===`marketplace`?u.extensionsPage.marketplaceSearchPlaceholder:u.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(K,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(R,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":u.capabilitiesHub.moreActions,title:u.capabilitiesHub.moreActions,children:(0,$.jsx)(c,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(W,{children:(0,$.jsxs)(B,{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)(q,{className:m(`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`,F.transition),onSelect:()=>j(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),l.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(q,{asChild:!0,children:(0,$.jsxs)(s,{to:`/local-apps`,className:m(`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`,F.transition),children:[(0,$.jsx)(V,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),u.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(R,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(s,{to:`/local-apps/new`,"aria-label":u.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:u.extensionsPage.createLocalApp})]})})}),[l,u.capabilitiesHub.moreActions,u.extensionsPage,w,E]);(0,Q.useLayoutEffect)(()=>e?(t?.(H),()=>t?.(null)):(f({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)(ie,{contribution:H})}),()=>h()),[h,e,H,u.extensionsPage.title,t,f]);let U=[{id:`user`,label:u.extensionsPage.tabUser,count:v?void 0:L.length},{id:`marketplace`,label:u.extensionsPage.tabMarketplace},{id:`builtin`,label:u.extensionsPage.tabBuiltin,count:v?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:m(`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)(ne,{items:U,activeTab:w,onChange:T,ariaLabel:u.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),w===`marketplace`?(0,$.jsx)(Ce,{query:E}):v?(0,$.jsx)(Re,{}):w===`builtin`&&I.length===0?(0,$.jsx)(Be,{message:u.extensionsPage.emptyBuiltin}):w===`user`&&L.length===0?(0,$.jsx)(Be,{message:u.extensionsPage.emptyUser}):re.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:de,children:re.map(e=>(0,$.jsx)(Pe,{extension:e,copy:u.extensionsPage,onOpen:()=>e.pluginId?n(X(e.pluginId,`installed`,!1,r.pathname+r.search)):k(e)},e.id))})]}),O?O.format===`agent-plugin`?(0,$.jsx)(oe,{extension:O,onClose:()=>k(null)},O.id):(0,$.jsx)(Ie,{extension:O,copy:u.extensionsPage,onClose:()=>k(null)},O.id):null,ee?(0,$.jsx)(oe,{onClose:()=>j(!1)}):null]})}function je(e){return e.activationEligible??e.active}function Me(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function Ne(e,t){let n=je(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Pe(e){let t=(0,ue.c)(56),{extension:n,copy:r,onOpen:o}=e,s=_(Fe),c,l;t[0]!==n||t[1]!==s?(l=s.startsWith(`zh`),c=se(n,l),t[0]=n,t[1]=s,t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u=c,d;t[4]===n?d=t[5]:(d=ce(n),t[4]=n,t[5]=d);let f=d,p=n.localizations?.[l?`zh-CN`:`en`]?.description??n.description,m=a(),h=i(),g;t[6]===n?g=t[7]:(g=!!n.pluginId&&le(n),t[6]=n,t[7]=g);let v=g,y=f?l?`去授权`:`Connect account`:v?l?`开始使用`:`Start using`:l?`管理插件`:`Manage plugin`,b;t[8]!==v||t[9]!==n.pluginId||t[10]!==h||t[11]!==u||t[12]!==m||t[13]!==f||t[14]!==o||t[15]!==l?(b=()=>{v?m(Y(u,l)):f&&n.pluginId?m(X(n.pluginId,`installed`,!0,h.pathname+h.search)):o()},t[8]=v,t[9]=n.pluginId,t[10]=h,t[11]=u,t[12]=m,t[13]=f,t[14]=o,t[15]=l,t[16]=b):b=t[16];let x=b,S=`${u}, ${r.marketplaceDetailTitle}`,C;t[17]!==o||t[18]!==S?(C=(0,$.jsx)(`button`,{type:`button`,"aria-label":S,onClick:o,className:pe}),t[17]=o,t[18]=S,t[19]=C):C=t[19];let w=n.branding?.iconUrl,T;t[20]===w?T=t[21]:(T=(0,$.jsx)(ae,{iconUrl:w,fallback:V}),t[20]=w,t[21]=T);let E;t[22]===u?E=t[23]:(E=(0,$.jsx)(`h2`,{className:`line-clamp-2 break-words font-semibold leading-snug text-fg`,title:u,children:u}),t[22]=u,t[23]=E);let D;t[24]===n.provenance?.publisherVerification?D=t[25]:(D=n.provenance?.publisherVerification===`verified`?(0,$.jsx)(G,{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]=D);let O;t[26]!==E||t[27]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5`,children:[E,D]}),t[26]=E,t[27]=D,t[28]=O):O=t[28];let k;t[29]===n.version?k=t[30]:(k=n.version?(0,$.jsxs)(`span`,{children:[`v`,n.version]}):null,t[29]=n.version,t[30]=k);let A=f?`text-amber-700 dark:text-amber-400`:`text-fg-muted`,ee=f?l?`需要授权`:`Authorization required`:je(n)?r.statusEnabled:r.runStateOff,j;t[31]!==A||t[32]!==ee?(j=(0,$.jsx)(`span`,{className:A,children:ee}),t[31]=A,t[32]=ee,t[33]=j):j=t[33];let M;t[34]!==k||t[35]!==j?(M=(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[k,j]}),t[34]=k,t[35]=j,t[36]=M):M=t[36];let N;t[37]!==O||t[38]!==M?(N=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[O,M]}),t[37]=O,t[38]=M,t[39]=N):N=t[39];let P;t[40]!==y||t[41]!==x?(P=(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:x,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:y})}),t[40]=y,t[41]=x,t[42]=P):P=t[42];let F;t[43]!==N||t[44]!==P||t[45]!==T?(F=(0,$.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-3`,children:[T,N,P]}),t[43]=N,t[44]=P,t[45]=T,t[46]=F):F=t[46];let I;t[47]!==r.cardNoDescription||t[48]!==p?(I=p?.trim()||r.cardNoDescription,t[47]=r.cardNoDescription,t[48]=p,t[49]=I):I=t[49];let L;t[50]===I?L=t[51]:(L=(0,$.jsx)(`p`,{className:`pointer-events-none relative mt-3 line-clamp-3 text-sm leading-relaxed text-fg-muted`,children:I}),t[50]=I,t[51]=L);let R;return t[52]!==F||t[53]!==L||t[54]!==C?(R=(0,$.jsxs)(`article`,{className:fe,children:[C,F,L]}),t[52]=F,t[53]=L,t[54]=C,t[55]=R):R=t[55],R}function Fe(e){return e.language}function Ie({extension:e,copy:t,onClose:n}){let{mutate:r}=T(),[i,a]=(0,Q.useState)(null),[o,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),p=e.activationEligible===!0,h=(0,Q.useCallback)(async()=>{c(null),d(!1),a(`toggle`);try{let{requiresGatewayRestart:t}=await ye({extensionId:e.id,enabled:!p});await r(`gateway-extensions-list`),D(),d(t)}catch(e){c(e instanceof Error?e.message:t.extensionToggleFailed)}finally{a(null)}},[p,t.extensionToggleFailed,e.id,r]),g=(0,Q.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){c(null),d(!1),a(`uninstall`);try{await be(e.id),await r(`gateway-extensions-list`),D(),n()}catch(e){c(e instanceof Error?e.message:t.marketplaceUninstallFailed),a(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),_=e.ui?.contributions?.pages??[],v=e.ui?.contributions?.settingsPanels??[],E=e.ui?.contributions?.chatWidgets??[],k=_.find(e=>e.showInNav)??_[0],A=v[0],j=k?H(e.id,k):null,M=A?`/settings/ext/${e.id}/${A.id}`:e.hasConfigSchema||L(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(w,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(S,{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)(ee,{className:`size-5`})}),(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(b,{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)(f,{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,` `,Me(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:Ne(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)(R,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void h(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(N,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):p?t.builtinToggleDisable:t.builtinToggleEnable})]}),o?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:o}):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)(R,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void g(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(N,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(_.length>0||v.length>0||E.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)(Le,{template:t.badgePages,count:_.length,hidden:_.length===0}),(0,$.jsx)(Le,{template:t.badgeSettings,count:v.length,hidden:v.length===0}),(0,$.jsx)(Le,{template:t.badgeWidgets,count:E.length,hidden:E.length===0})]})]}):null,P(e)&&(j||M)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[j?(0,$.jsxs)(s,{to:j,onClick:n,className:m(`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)(l,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,M?(0,$.jsxs)(s,{to:M,onClick:n,className:m(`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)(O,{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 Le(e){let t=(0,ue.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 Re(){let e=(0,ue.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:de,"aria-busy":`true`,children:Array.from({length:6},ze)}),e[0]=t):t=e[0],t}function ze(e,t){return(0,$.jsx)(I,{className:`h-32 rounded-xl`},t)}function Be(e){let t=(0,ue.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{Ae as ExtensionsPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./messages-DBvKzlCl.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-DKLblfvY.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
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"./messages-DBvKzlCl.js";import{t as a}from"./jszip.min-DT31yWkU.js";import{t as o}from"./preview-open-alternatives-rJ3l8Ii4.js";var s=n(),c=e(a(),1),l=e(t(),1),u=r();function d(e){let t=(0,s.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,a]=(0,l.useState)(n),[d,m]=(0,l.useState)(null),h,g;if(t[1]===e.binaryBuffer?(h=t[2],g=t[3]):(h=()=>{if(!e.binaryBuffer)return;let t=!1;return c.default.loadAsync(e.binaryBuffer).then(e=>{t||a(Object.values(e.files).slice(0,500).map(p))}).catch(e=>{t||m(e instanceof Error?e.message:String(e))}),()=>{t=!0}},g=[e.binaryBuffer],t[1]=e.binaryBuffer,t[2]=h,t[3]=g),(0,l.useEffect)(h,g),d){let n;t[4]===e.language?n=t[5]:(n=i(e.language),t[4]=e.language,t[5]=n);let r=n,a;t[6]!==r.chat.attachmentPreviewDownloadFull||t[7]!==r.chat.attachmentPreviewOpenElsewhereHint||t[8]!==e.actions.onDownload?(a=(0,u.jsx)(o,{message:r.chat.attachmentPreviewOpenElsewhereHint,downloadLabel:r.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload}),t[6]=r.chat.attachmentPreviewDownloadFull,t[7]=r.chat.attachmentPreviewOpenElsewhereHint,t[8]=e.actions.onDownload,t[9]=a):a=t[9];let s;t[10]===d?s=t[11]:(s=(0,u.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:d}),t[10]=d,t[11]=s);let c;return t[12]!==a||t[13]!==s?(c=(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:[a,s]}),t[12]=a,t[13]=s,t[14]=c):c=t[14],c}let _;return t[15]===r?_=t[16]:(_=(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-edge bg-surface-panel`,children:r.length===0?(0,u.jsx)(`p`,{className:`p-4 text-sm text-fg-muted`,children:`Loading archive...`}):(0,u.jsx)(`table`,{className:`w-full text-left text-xs`,children:(0,u.jsx)(`tbody`,{children:r.map(f)})})})}),t[15]=r,t[16]=_),_}function f(e){return(0,u.jsxs)(`tr`,{className:`border-b border-edge-subtle last:border-b-0 dark:border-edge`,children:[(0,u.jsx)(`td`,{className:`max-w-0 truncate px-3 py-2 font-mono text-fg`,title:e.name,children:e.dir?`${e.name}/`:e.name}),(0,u.jsx)(`td`,{className:`w-24 px-3 py-2 text-right text-fg-muted`,children:e.dir?``:m(e.size)})]},e.name)}function p(e){return{name:e.name,dir:e.dir,size:e.dir?0:e._data?.uncompressedSize??0}}function m(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}export{d as ArchivePreviewPluginView};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-C99c2Mps.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./automations-workspace-iTSZBSZf.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AutomationsPage};