@xopcai/xopc 0.0.399 → 0.0.401

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 (382) 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-CpQYvwOW.js → agent-avatar-dicebear-ByXMoFsY.js} +1 -1
  25. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BQxtFjlw.js → agent-defaults-settings-panel-DTWNXsbp.js} +1 -1
  26. package/dist/gateway/static/root/assets/{agents-AuBMS_Pf.js → agents-CaB8tdC-.js} +3 -3
  27. package/dist/gateway/static/root/assets/{app-management-settings-panel-QMCJPUuH.js → app-management-settings-panel-X9szJlYD.js} +1 -1
  28. package/dist/gateway/static/root/assets/{appearance-settings-BGPmyRLn.js → appearance-settings-BfE1yedW.js} +1 -1
  29. package/dist/gateway/static/root/assets/{apps-page-DtqV9r9m.js → apps-page-B4temKvg.js} +1 -1
  30. package/dist/gateway/static/root/assets/{archive-plugin-H2rWTIwC.js → archive-plugin-PQHi2w72.js} +1 -1
  31. package/dist/gateway/static/root/assets/{automations-page-jENavthQ.js → automations-page-KIyLxqyX.js} +1 -1
  32. package/dist/gateway/static/root/assets/{automations-workspace-CImof0cA.js → automations-workspace-C99c2Mps.js} +1 -1
  33. package/dist/gateway/static/root/assets/{binary-plugins-DPyR9xd5.js → binary-plugins-DPDgIi0y.js} +1 -1
  34. package/dist/gateway/static/root/assets/{block-editor-LrMWBpSq.js → block-editor-BL6uYJRu.js} +1 -1
  35. package/dist/gateway/static/root/assets/{browser-automation-inputs-CyjyiwCe.js → browser-automation-inputs-BMe7eqyS.js} +1 -1
  36. package/dist/gateway/static/root/assets/{browser-automations-page-BwuUYfOv.js → browser-automations-page-Cxy3o5SG.js} +1 -1
  37. package/dist/gateway/static/root/assets/{browser-settings-page-C2B2U1px.js → browser-settings-page-Dn-LW9q4.js} +1 -1
  38. package/dist/gateway/static/root/assets/{capabilities-page-D95AkBeY.js → capabilities-page-CHWxG2ns.js} +2 -2
  39. package/dist/gateway/static/root/assets/{capabilities-settings-panel-Dibaaecx.js → capabilities-settings-panel-Da9ak03p.js} +1 -1
  40. package/dist/gateway/static/root/assets/{capability-header-actions-DIAfw_sB.js → capability-header-actions-WRaPQFq0.js} +1 -1
  41. package/dist/gateway/static/root/assets/{channels-BDsCl-WU.js → channels-Cx2WkRWN.js} +1 -1
  42. package/dist/gateway/static/root/assets/{chat-terminal-dock-B_JFEyRy.js → chat-terminal-dock-63FqSsS_.js} +1 -1
  43. package/dist/gateway/static/root/assets/{computer-settings-page-B2vSOHPO.js → computer-settings-page-Cr6u_6gd.js} +1 -1
  44. package/dist/gateway/static/root/assets/{connector-service-page-D2cCQJWy.js → connector-service-page-FJwMon8U.js} +1 -1
  45. package/dist/gateway/static/root/assets/{connectors-page-C9t9v36q.js → connectors-page-BBH388aG.js} +1 -1
  46. package/dist/gateway/static/root/assets/{date-picker-BYz1BvpE.js → date-picker-D5Xit3eb.js} +1 -1
  47. package/dist/gateway/static/root/assets/{dependency-picker-B5onlFRJ.js → dependency-picker-1aJOOQPo.js} +1 -1
  48. package/dist/gateway/static/root/assets/{desktop-pet-IsOXKVI4.js → desktop-pet-ggDJ99Z6.js} +1 -1
  49. package/dist/gateway/static/root/assets/{desktop-pet-settings-BZhPDsCp.js → desktop-pet-settings-ChfLbqqO.js} +1 -1
  50. package/dist/gateway/static/root/assets/{device-pairing-wizard-Hf-xMRH5.js → device-pairing-wizard-3OvOHf6N.js} +1 -1
  51. package/dist/gateway/static/root/assets/{directory-picker-path-field-C7mO36eo.js → directory-picker-path-field-ummF1SFe.js} +1 -1
  52. package/dist/gateway/static/root/assets/{extension-debug-page-BkSnNO_a.js → extension-debug-page-SmrPvYO6.js} +1 -1
  53. package/dist/gateway/static/root/assets/{extension-page-CTXu0lgl.js → extension-page-CGVGUA3i.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-settings-page-DzsZI4dz.js → extension-settings-page-nns2sDcu.js} +1 -1
  55. package/dist/gateway/static/root/assets/{gateway-settings-DDfLdRFy.js → gateway-settings-CFhtbGZh.js} +1 -1
  56. package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-Dy3ktsqG.js → highlighted-body-KQOG7T2V-BOfrdIh2.js} +1 -1
  57. package/dist/gateway/static/root/assets/{home-page-Cw0YZFEE.js → home-page-GtF10ylS.js} +1 -1
  58. package/dist/gateway/static/root/assets/{image-generation-api-CsX0tJA9.js → image-generation-api-D0EUiJdS.js} +1 -1
  59. package/dist/gateway/static/root/assets/{imports-page-BnaJaGsz.js → imports-page-CoQLVDRZ.js} +1 -1
  60. package/dist/gateway/static/root/assets/{index-dViajQ_4.js → index-Cmrvxc_s.js} +8 -8
  61. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B0-L_-9C.js → keyboard-shortcuts-settings-Big_fVjG.js} +1 -1
  62. package/dist/gateway/static/root/assets/{local-app-workbench-page-DCU-MUm0.js → local-app-workbench-page-BQq4v2h9.js} +1 -1
  63. package/dist/gateway/static/root/assets/{local-apps-page-CYB-jS8K.js → local-apps-page-BEJLnf07.js} +1 -1
  64. package/dist/gateway/static/root/assets/{logs-page-Dd_Miu5W.js → logs-page-t85fyv9m.js} +1 -1
  65. package/dist/gateway/static/root/assets/{management-settings-EhbGOA7d.js → management-settings-BNah9d9e.js} +1 -1
  66. package/dist/gateway/static/root/assets/{media-plugins-Gg2S_-0J.js → media-plugins-DJBhcY1R.js} +1 -1
  67. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CILrbgBf.js +1 -0
  68. package/dist/gateway/static/root/assets/{note-detail-panel-b0LhcM8E.js → note-detail-panel-C2lBQc4t.js} +3 -3
  69. package/dist/gateway/static/root/assets/{notes-page-CrrJhf22.js → notes-page-WnkqzfLz.js} +1 -1
  70. package/dist/gateway/static/root/assets/{page-context-capture-button-CVkaHzKp.js → page-context-capture-button-BJVRA9-x.js} +1 -1
  71. package/dist/gateway/static/root/assets/{personal-page-C5bS9Zox.js → personal-page-Cm2wT4by.js} +1 -1
  72. package/dist/gateway/static/root/assets/{plugin-details-dialog-BEmOUy9T.js → plugin-details-dialog-BWEc8nwk.js} +1 -1
  73. package/dist/gateway/static/root/assets/{plugin-presentation-B9Am-_vW.js → plugin-presentation-BcZHPy_6.js} +1 -1
  74. package/dist/gateway/static/root/assets/{preview-open-alternatives-BsblzqIi.js → preview-open-alternatives-DKLblfvY.js} +1 -1
  75. package/dist/gateway/static/root/assets/{product-open-page-OZZTYmjY.js → product-open-page-CMMI-Lvy.js} +1 -1
  76. package/dist/gateway/static/root/assets/{product-preview-content-BECp_NcY.js → product-preview-content-Dik_ORgj.js} +1 -1
  77. package/dist/gateway/static/root/assets/{project-detail-page-BIXCksxe.js → project-detail-page-RnKTj04F.js} +1 -1
  78. package/dist/gateway/static/root/assets/{projects-page-XzE2Lrf2.js → projects-page-BhTpBKMy.js} +1 -1
  79. package/dist/gateway/static/root/assets/{remote-access-hub-DdeFnheH.js → remote-access-hub-LUQUvC84.js} +1 -1
  80. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DTEruUBq.js → runtime-tools-settings-panel-Bo4YiO7D.js} +1 -1
  81. package/dist/gateway/static/root/assets/{schema-form-v4qyepTr.js → schema-form-B3bVaQx1.js} +1 -1
  82. package/dist/gateway/static/root/assets/{sessions-page-D6ff4Ntg.js → sessions-page-fseCCI6W.js} +1 -1
  83. package/dist/gateway/static/root/assets/settings-advanced-gate-CBn8SVz7.js +1 -0
  84. package/dist/gateway/static/root/assets/{settings-form-section-Bg4VGpOS.js → settings-form-section-vezTIqZ6.js} +1 -1
  85. package/dist/gateway/static/root/assets/{settings-page-DWnJiiZ3.js → settings-page-DC4NPD9q.js} +1 -1
  86. package/dist/gateway/static/root/assets/{setup-status-panel-ShBGdTLC.js → setup-status-panel-B7__vDF3.js} +1 -1
  87. package/dist/gateway/static/root/assets/{share-preview-page-CajYPnal.js → share-preview-page-rXG53c7x.js} +1 -1
  88. package/dist/gateway/static/root/assets/{shares-settings-CbkMauXr.js → shares-settings-8trvsXe5.js} +1 -1
  89. package/dist/gateway/static/root/assets/{skill-api-CViUmvY5.js → skill-api-DS7l6xfp.js} +1 -1
  90. package/dist/gateway/static/root/assets/{skill-reload-api-BBJFG6Sa.js → skill-reload-api-B5xkDw4T.js} +1 -1
  91. package/dist/gateway/static/root/assets/{skills-page-Xz71fZ-2.js → skills-page-DANnetBA.js} +1 -1
  92. package/dist/gateway/static/root/assets/{style-C06V_QkC.js → style-DMaxcb-J.js} +1 -1
  93. package/dist/gateway/static/root/assets/{system-settings-panel-ygHZouKG.js → system-settings-panel-x1QJgZjs.js} +1 -1
  94. package/dist/gateway/static/root/assets/{task-detail-page-yrk_lymf.js → task-detail-page-CKYCAG5-.js} +1 -1
  95. package/dist/gateway/static/root/assets/{tracing-settings-page-BpwIY_cs.js → tracing-settings-page-BcLJq6Jq.js} +1 -1
  96. package/dist/gateway/static/root/assets/{tunnel-api-DJwLyVlX.js → tunnel-api-GdTAmuHs.js} +1 -1
  97. package/dist/gateway/static/root/assets/{usage-page-B7nIyRrc.js → usage-page-DgOCrgPr.js} +1 -1
  98. package/dist/gateway/static/root/assets/{use-autosave-CYG5ELoQ.js → use-autosave-BZw6SkOF.js} +1 -1
  99. package/dist/gateway/static/root/assets/{user-model-page-BYt2yFNk.js → user-model-page-BTIjtFxG.js} +1 -1
  100. package/dist/gateway/static/root/assets/{voice-api-key-field-CTvb35O3.js → voice-api-key-field-D1R1yQNb.js} +1 -1
  101. package/dist/gateway/static/root/assets/{work-discovery-overlay-DQJpheuI.js → work-discovery-overlay-R2dBw9bp.js} +1 -1
  102. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BDK1g07U.js → workflow-run-setup-panel-CtqK25lT.js} +1 -1
  103. package/dist/gateway/static/root/assets/{workflows-page-DFsw6QAX.js → workflows-page-C01mllUo.js} +1 -1
  104. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CbASlMPP.js → xopc-cloud-account-card-BjPp3a2X.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.d.ts +1 -0
  109. package/dist/src/agent/agent-manager.js +14 -10
  110. package/dist/src/agent/background-review/run-background-review.js +4 -4
  111. package/dist/src/agent/coding/repository-instructions.js +1 -1
  112. package/dist/src/agent/coding/workspace-revision.js +2 -2
  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 +8 -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/cliProvider.js +2 -2
  122. package/dist/src/agent/external-tools/composio-provider.js +2 -2
  123. package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
  124. package/dist/src/agent/external-tools/index.js +1 -1
  125. package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
  126. package/dist/src/agent/image/generation/providers/xopc-cloud.js +2 -2
  127. package/dist/src/agent/image/load-image-media.js +1 -1
  128. package/dist/src/agent/image/tool-model-config.js +1 -1
  129. package/dist/src/agent/independent-execution.js +1 -1
  130. package/dist/src/agent/mcp/connection-drafts.js +1 -1
  131. package/dist/src/agent/mcp/credential-store-modules.d.ts +5 -0
  132. package/dist/src/agent/mcp/credential-store-modules.js +13 -0
  133. package/dist/src/agent/mcp/credential-store.js +2 -3
  134. package/dist/src/agent/sandbox/path-policy.js +1 -1
  135. package/dist/src/agent/service/direct-turn-helpers.js +1 -1
  136. package/dist/src/agent/service.js +4 -4
  137. package/dist/src/agent/skills/hub-pull.js +2 -2
  138. package/dist/src/agent/skills/index.js +1 -1
  139. package/dist/src/agent/skills/installer.js +3 -3
  140. package/dist/src/agent/skills/skill-manager.js +2 -1
  141. package/dist/src/agent/skills/skill-sources.js +10 -5
  142. package/dist/src/agent/skills/test-framework.js +1 -1
  143. package/dist/src/agent/tasks/task-judge-service.js +1 -1
  144. package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
  145. package/dist/src/agent/tool-manuals/computer.js +2 -2
  146. package/dist/src/agent/tools/computer-use-tool.js +9 -3
  147. package/dist/src/agent/tools/executor.js +1 -1
  148. package/dist/src/agent/tools/factory.js +1 -1
  149. package/dist/src/agent/tools/personal-read-tool.js +2 -2
  150. package/dist/src/agent/tools/read.js +1 -1
  151. package/dist/src/agent/tools/review-workspace.js +1 -1
  152. package/dist/src/agent/tools/send-media.js +1 -1
  153. package/dist/src/agent/tools/task-collaboration-tool.js +1 -1
  154. package/dist/src/agent/tools/write.js +1 -1
  155. package/dist/src/agent/tools/xopc-use-tool.js +5 -5
  156. package/dist/src/agent-catalog/capabilities.js +2 -2
  157. package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +3 -3
  158. package/dist/src/agent-catalog/repository.js +3 -3
  159. package/dist/src/auth/oauth-provider-lock.js +1 -1
  160. package/dist/src/automations/capabilities/drafts.js +1 -1
  161. package/dist/src/backup/archive.js +2 -2
  162. package/dist/src/bootstrap/application-state.js +1 -1
  163. package/dist/src/browser/cache-dir-policy.js +1 -1
  164. package/dist/src/browser/native-messaging-host.js +1 -1
  165. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  166. package/dist/src/capabilities/readiness/from-config.js +2 -2
  167. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  168. package/dist/src/capabilities/runtime/product.js +1 -1
  169. package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
  170. package/dist/src/channels/format.js +1 -1
  171. package/dist/src/channels/index.js +3 -3
  172. package/dist/src/channels/pairing/pairing-service.js +1 -1
  173. package/dist/src/chat-commands/builtins/config.js +2 -2
  174. package/dist/src/chat-commands/builtins/session.js +1 -1
  175. package/dist/src/chat-commands/context.js +2 -2
  176. package/dist/src/chat-commands/index.js +1 -1
  177. package/dist/src/cli/commands/agent.js +1 -1
  178. package/dist/src/cli/commands/agents.js +1 -1
  179. package/dist/src/cli/commands/channels.js +2 -2
  180. package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -1
  181. package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
  182. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  183. package/dist/src/cli/commands/extension-agent-plugin.js +1 -1
  184. package/dist/src/cli/commands/extension-marketplace.js +3 -3
  185. package/dist/src/cli/commands/extension-pack.js +1 -1
  186. package/dist/src/cli/commands/mcp.js +1 -1
  187. package/dist/src/cli/commands/models.js +3 -3
  188. package/dist/src/cli/commands/onboard/model.js +3 -3
  189. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  190. package/dist/src/computer/broker.js +1 -1
  191. package/dist/src/computer/diagnostics.js +1 -0
  192. package/dist/src/computer/errors.js +1 -0
  193. package/dist/src/computer/flows.js +1 -1
  194. package/dist/src/computer/runtime.d.ts +23 -0
  195. package/dist/src/computer/runtime.js +92 -9
  196. package/dist/src/config/agent-model-intents.js +1 -1
  197. package/dist/src/config/agent-profile.js +1 -1
  198. package/dist/src/config/index.js +4 -4
  199. package/dist/src/config/loader.js +1 -1
  200. package/dist/src/config/models-json.js +1 -1
  201. package/dist/src/config/paths-state.js +1 -1
  202. package/dist/src/config/schema.js +7 -7
  203. package/dist/src/config/workspace-path.js +1 -1
  204. package/dist/src/connectors/connected-source-ingestion.js +1 -1
  205. package/dist/src/connectors/content-enrichment.js +1 -1
  206. package/dist/src/daemon/constants.js +1 -1
  207. package/dist/src/daemon/install-plan.js +1 -1
  208. package/dist/src/daemon/launchd.js +1 -1
  209. package/dist/src/daemon/schtasks.js +1 -1
  210. package/dist/src/daemon/systemd.js +1 -1
  211. package/dist/src/discussions/action-tasks.js +1 -1
  212. package/dist/src/discussions/live-worker.js +2 -2
  213. package/dist/src/discussions/recording.js +1 -1
  214. package/dist/src/discussions/repository.js +1 -1
  215. package/dist/src/discussions/sealer.js +2 -2
  216. package/dist/src/discussions/service.js +1 -1
  217. package/dist/src/execution-environments/worktree-safety.js +1 -1
  218. package/dist/src/extensions/activation-context.js +2 -2
  219. package/dist/src/extensions/agent-plugins/auth.js +1 -1
  220. package/dist/src/extensions/agent-plugins/capability-access.d.ts +23 -0
  221. package/dist/src/extensions/agent-plugins/capability-access.js +101 -0
  222. package/dist/src/extensions/agent-plugins/cli-authorization.d.ts +1 -0
  223. package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -2
  224. package/dist/src/extensions/agent-plugins/inventory.js +1 -1
  225. package/dist/src/extensions/agent-plugins/mcp-adapter.js +5 -5
  226. package/dist/src/extensions/agent-plugins/refresh-runtime-access.d.ts +3 -0
  227. package/dist/src/extensions/agent-plugins/refresh-runtime-access.js +36 -0
  228. package/dist/src/extensions/agent-plugins/setup-contract.d.ts +1 -0
  229. package/dist/src/extensions/agent-plugins/setup-contract.js +1 -0
  230. package/dist/src/extensions/agent-plugins/setup.d.ts +4 -1
  231. package/dist/src/extensions/agent-plugins/setup.js +70 -37
  232. package/dist/src/extensions/agent-plugins/skill-catalog.js +2 -2
  233. package/dist/src/extensions/agent-plugins/source-catalog.js +1 -1
  234. package/dist/src/extensions/agent-plugins/source-http-fetch.js +1 -1
  235. package/dist/src/extensions/agent-plugins/sources.js +1 -1
  236. package/dist/src/extensions/agent-plugins/store.d.ts +1 -0
  237. package/dist/src/extensions/agent-plugins/store.js +10 -3
  238. package/dist/src/extensions/agent-plugins/validation.js +12 -2
  239. package/dist/src/extensions/api.js +1 -1
  240. package/dist/src/extensions/install.js +1 -1
  241. package/dist/src/extensions/loader.js +1 -1
  242. package/dist/src/extensions/sdk/index.js +1 -1
  243. package/dist/src/extensions/update.js +1 -1
  244. package/dist/src/gateway/agents-admin.js +2 -2
  245. package/dist/src/gateway/file-path-classifier.js +2 -2
  246. package/dist/src/gateway/hono/lib/config-payload.js +1 -1
  247. package/dist/src/gateway/hono/lib/static-ui.js +1 -1
  248. package/dist/src/gateway/hono/routes/agent-plugins.js +2 -2
  249. package/dist/src/gateway/hono/routes/agents.js +1 -1
  250. package/dist/src/gateway/hono/routes/browser.js +1 -1
  251. package/dist/src/gateway/hono/routes/channels.js +1 -1
  252. package/dist/src/gateway/hono/routes/config-patch/misc.js +6 -6
  253. package/dist/src/gateway/hono/routes/discussions.js +1 -1
  254. package/dist/src/gateway/hono/routes/host-fs.js +1 -1
  255. package/dist/src/gateway/hono/routes/mcp.js +1 -1
  256. package/dist/src/gateway/hono/routes/memory-learning.js +1 -1
  257. package/dist/src/gateway/hono/routes/models.js +6 -6
  258. package/dist/src/gateway/hono/routes/notes.js +3 -3
  259. package/dist/src/gateway/hono/routes/observability.js +1 -1
  260. package/dist/src/gateway/hono/routes/projects.js +3 -3
  261. package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
  262. package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
  263. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  264. package/dist/src/gateway/hono/routes/shares.js +1 -1
  265. package/dist/src/gateway/hono/routes/status.js +1 -1
  266. package/dist/src/gateway/hono/routes/tasks.js +2 -2
  267. package/dist/src/gateway/hono/routes/voice.js +5 -5
  268. package/dist/src/gateway/image-generation-setup.js +3 -3
  269. package/dist/src/gateway/mobile-privacy.js +1 -1
  270. package/dist/src/gateway/provider-model-setup.js +1 -1
  271. package/dist/src/gateway/service/agent-runner.js +1 -1
  272. package/dist/src/gateway/service/config-coordinator.js +1 -1
  273. package/dist/src/gateway/service/marketplace-service.js +2 -2
  274. package/dist/src/gateway/service.js +12 -12
  275. package/dist/src/gateway/session-context-summary.js +1 -1
  276. package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
  277. package/dist/src/home-intelligence/repository.js +1 -1
  278. package/dist/src/imports/importService.js +1 -1
  279. package/dist/src/imports/inventory.js +1 -1
  280. package/dist/src/imports/sources.js +1 -1
  281. package/dist/src/infra/brew.js +1 -1
  282. package/dist/src/infra/package-runtime-check.js +1 -1
  283. package/dist/src/infra/path-env.js +1 -1
  284. package/dist/src/infra/process-diagnostics.js +1 -1
  285. package/dist/src/infra/update-check.js +1 -1
  286. package/dist/src/local-apps/service.js +3 -3
  287. package/dist/src/markdown/index.js +1 -1
  288. package/dist/src/media/session-references.js +1 -1
  289. package/dist/src/media-shared/http/provider-http.js +1 -1
  290. package/dist/src/media-understanding/runner.js +1 -1
  291. package/dist/src/memory-learning/source-learning.js +2 -2
  292. package/dist/src/notes/agent-context.js +1 -1
  293. package/dist/src/notifications/store.js +1 -1
  294. package/dist/src/observability/runtime.js +1 -1
  295. package/dist/src/personal-agent/onboarding.d.ts +1 -1
  296. package/dist/src/personal-agent/proactivity/repository.js +2 -2
  297. package/dist/src/personal-agent/proactivity/service.js +2 -2
  298. package/dist/src/personal-agent/reply-composer.js +1 -1
  299. package/dist/src/personal-agent/request-delivery.js +1 -1
  300. package/dist/src/personal-agent/request-service.js +1 -1
  301. package/dist/src/personal-agent/result-reader.js +2 -2
  302. package/dist/src/personal-agent/service.js +3 -3
  303. package/dist/src/personal-agent/unread.js +1 -1
  304. package/dist/src/platform/index.js +1 -1
  305. package/dist/src/process/run-process.js +1 -1
  306. package/dist/src/project-trust/trust-store.js +1 -1
  307. package/dist/src/projects/workspace-project.js +1 -1
  308. package/dist/src/providers/extension-stream-bridge.js +1 -1
  309. package/dist/src/providers/index.js +4 -4
  310. package/dist/src/providers/model-call.js +3 -3
  311. package/dist/src/providers/model-catalog-persistence.js +1 -1
  312. package/dist/src/providers/model-registry.js +3 -3
  313. package/dist/src/providers/provider-disconnect-core.js +1 -1
  314. package/dist/src/providers/register-runtime-providers.js +1 -1
  315. package/dist/src/providers/setup/voice.js +1 -1
  316. package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
  317. package/dist/src/providers/xopc-cloud-credit-budget.js +1 -1
  318. package/dist/src/review/review-git.js +1 -1
  319. package/dist/src/session/store.js +1 -1
  320. package/dist/src/share/hosted-session-share.js +1 -1
  321. package/dist/src/share/share-zip.js +1 -1
  322. package/dist/src/share/site-proxy.js +1 -1
  323. package/dist/src/share/site-static-serve.js +1 -1
  324. package/dist/src/storage/sqlite/ai-usage-repository.js +1 -1
  325. package/dist/src/storage/sqlite/clarification-wait-repository.js +2 -2
  326. package/dist/src/storage/sqlite/connection.js +1 -1
  327. package/dist/src/storage/sqlite/conversation-repository.js +2 -2
  328. package/dist/src/storage/sqlite/device-access-repository.js +1 -1
  329. package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
  330. package/dist/src/storage/sqlite/migrations/runner.js +2 -2
  331. package/dist/src/storage/sqlite/session-creation-repository.js +1 -1
  332. package/dist/src/storage/sqlite/session-repository.js +1 -1
  333. package/dist/src/tasks/capabilities/management.js +1 -1
  334. package/dist/src/tasks/capabilities/read.js +2 -2
  335. package/dist/src/tasks/capabilities/relations.js +1 -1
  336. package/dist/src/tasks/capabilities/write.js +1 -1
  337. package/dist/src/tasks/task-allocation-service.js +3 -3
  338. package/dist/src/tasks/task-application-service.js +1 -1
  339. package/dist/src/tasks/task-context-assembler.js +2 -2
  340. package/dist/src/tasks/task-criterion-review-repository.js +1 -1
  341. package/dist/src/tasks/task-handoff-service.js +1 -1
  342. package/dist/src/tasks/task-handoff.js +2 -2
  343. package/dist/src/tasks/task-research-repair.js +1 -1
  344. package/dist/src/tasks/task-research-result.js +2 -2
  345. package/dist/src/tasks/task-result-delivery-repository.js +1 -1
  346. package/dist/src/tasks/task-result-delivery-service.js +1 -1
  347. package/dist/src/tasks/task-signal-service.js +1 -1
  348. package/dist/src/tui/backends/embedded-backend.js +6 -6
  349. package/dist/src/tui/clipboard-image.js +2 -2
  350. package/dist/src/tui/extension-host/load-extensions.js +1 -1
  351. package/dist/src/tui/tui-skills-autocomplete.js +1 -1
  352. package/dist/src/tui/tui-startup-resources.js +2 -2
  353. package/dist/src/tui/tui.js +3 -3
  354. package/dist/src/tunnel/frpc-binary.js +1 -1
  355. package/dist/src/usage/cloud-capability.js +1 -1
  356. package/dist/src/usage/cloud-receipts.js +1 -1
  357. package/dist/src/usage/recorder.js +2 -2
  358. package/dist/src/user-context/access-policy.js +2 -2
  359. package/dist/src/utils/index.js +1 -1
  360. package/dist/src/utils/logger/index.js +1 -1
  361. package/dist/src/utils/logger.js +1 -1
  362. package/dist/src/voice/audio/normalize.js +1 -1
  363. package/dist/src/voice/platform-settings.js +1 -1
  364. package/dist/src/voice/realtime/memory-context.js +3 -3
  365. package/dist/src/voice/realtime/persona-context.js +1 -1
  366. package/dist/src/voice/realtime/runtime.js +2 -2
  367. package/dist/src/voice/stt/factory.js +1 -1
  368. package/dist/src/voice/stt/index.js +2 -2
  369. package/dist/src/voice/stt/preflight.js +2 -2
  370. package/dist/src/voice/stt/providers/bailian-plan-transcription.js +3 -3
  371. package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +3 -3
  372. package/dist/src/voice/stt/transcribe-core.js +1 -1
  373. package/dist/src/voice/tts/factory.js +1 -1
  374. package/dist/src/voice/tts/providers/bailian-plan-speech.js +2 -2
  375. package/dist/src/voice/tts/providers/edge-speech.js +1 -1
  376. package/dist/src/voice/tts/providers/xopc-cloud-speech.js +2 -2
  377. package/dist/src/work-discovery/candidate-discovery.js +2 -2
  378. package/dist/src/work-discovery/probe.js +2 -2
  379. package/dist/src/work-discovery/service.js +3 -3
  380. package/package.json +3 -3
  381. package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-B491wqqw.js +0 -1
  382. package/dist/gateway/static/root/assets/settings-advanced-gate-ewl9-rd5.js +0 -1
@@ -0,0 +1,101 @@
1
+ import { pluginAuthorizations } from "./setup-contract.js";
2
+ import { join } from "node:path";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { z } from "zod";
5
+ //#region src/extensions/agent-plugins/capability-access.ts
6
+ const authorization = z.union([z.string().min(1), z.strictObject({
7
+ id: z.string().min(1),
8
+ scopes: z.array(z.string().min(1)).max(100)
9
+ })]);
10
+ const requirement = z.strictObject({
11
+ authorizations: z.array(authorization).max(20).default([]),
12
+ servers: z.array(z.string().min(1)).max(20).default([])
13
+ });
14
+ const accessSchema = z.strictObject({
15
+ skills: z.record(z.string(), requirement).default({}),
16
+ mcp: z.record(z.string(), requirement).default({})
17
+ });
18
+ function pluginCapabilityAccess(manifest) {
19
+ const extension = manifest.extensions?.["ai.xopc"];
20
+ return accessSchema.parse(extension?.setup?.capabilityAccess ?? {});
21
+ }
22
+ const stateSchema = z.object({
23
+ packageRevision: z.string(),
24
+ state: z.string(),
25
+ installed: z.boolean().optional(),
26
+ resources: z.string(),
27
+ connections: z.array(z.object({
28
+ name: z.string(),
29
+ state: z.string()
30
+ })),
31
+ authorizations: z.array(z.object({
32
+ id: z.string(),
33
+ state: z.string(),
34
+ expiresAt: z.number().finite().optional(),
35
+ issues: z.array(z.object({ scopes: z.array(z.string()).default([]) })).default([])
36
+ })).default([])
37
+ });
38
+ /** One fail-closed access decision shared by Skill discovery and MCP projection. */
39
+ function resolvePluginCapabilityAccess(plugin, store, now = Date.now()) {
40
+ let declarations, access;
41
+ try {
42
+ declarations = pluginAuthorizations(plugin.manifest);
43
+ access = pluginCapabilityAccess(plugin.manifest);
44
+ } catch {
45
+ return {
46
+ skill: (_name) => false,
47
+ server: (_name) => false
48
+ };
49
+ }
50
+ const path = join(store.stateDir, "plugin-setup", `${plugin.id}.json`);
51
+ let state, damaged = false;
52
+ if (existsSync(path)) try {
53
+ const parsed = stateSchema.parse(JSON.parse(readFileSync(path, "utf8")));
54
+ if (parsed.packageRevision === plugin.receipt.revision) state = parsed;
55
+ } catch {
56
+ damaged = true;
57
+ }
58
+ const extension = plugin.manifest.extensions?.["ai.xopc"];
59
+ const prepared = !damaged && plugin.readiness !== "blocked" && (state ? state.resources === "ready" && (state.installed === true || state.state === "completed") && state.state !== "cancelled" : !extension?.setup?.resources?.length);
60
+ const connected = (name) => state?.connections.find((value) => value.name === name)?.state === "connected";
61
+ const requiresConnection = (name) => {
62
+ const server = plugin.servers[name];
63
+ if (!server) return true;
64
+ return server.type !== "stdio" ? server.connectionAuth?.mode !== "none" : Object.values(server.env ?? {}).some((value) => Object.entries(plugin.layout?.userConfig ?? {}).some(([key, field]) => field.sensitive && value.includes(`\${user_config.${key}}`)));
65
+ };
66
+ const granted = (entry) => {
67
+ const id = typeof entry === "string" ? entry : entry.id;
68
+ const declaration = declarations.find((value) => value.id === id);
69
+ const saved = state?.authorizations.find((value) => value.id === id);
70
+ if (!declaration || saved?.state !== "connected" || saved.expiresAt !== void 0 && saved.expiresAt <= now || !declaration.servers.every(connected)) return false;
71
+ return saved.issues.every((issue) => typeof entry !== "string" && issue.scopes.length > 0 && !issue.scopes.some((scope) => entry.scopes.includes(scope)));
72
+ };
73
+ const allows = (rule) => prepared && rule.authorizations.every(granted) && rule.servers.every(connected);
74
+ const defaults = {
75
+ authorizations: declarations.map((value) => value.id),
76
+ servers: declarations.length ? [] : Object.keys(plugin.servers).filter(requiresConnection)
77
+ };
78
+ return {
79
+ skill: (name) => allows(access.skills[name] ?? defaults),
80
+ server: (name) => {
81
+ const owners = declarations.filter((value) => value.servers.includes(name));
82
+ return allows(access.mcp[name] ?? {
83
+ authorizations: (owners.length ? owners : declarations).map((value) => value.id),
84
+ servers: []
85
+ }) && (state ? connected(name) : !requiresConnection(name));
86
+ }
87
+ };
88
+ }
89
+ function pluginRuntimeAccessKey(store, workspace, agentId) {
90
+ return JSON.stringify(store.active(agentId, workspace).map((plugin) => {
91
+ const access = resolvePluginCapabilityAccess(plugin, store);
92
+ return [
93
+ plugin.id,
94
+ plugin.receipt.revision,
95
+ plugin.skills.filter((skill) => access.skill(skill.name)).map((skill) => skill.name),
96
+ Object.keys(plugin.servers).filter(access.server)
97
+ ];
98
+ }));
99
+ }
100
+ //#endregion
101
+ export { pluginCapabilityAccess, pluginRuntimeAccessKey, resolvePluginCapabilityAccess };
@@ -24,6 +24,7 @@ export declare function inspectPluginCliAuthorization(store: AgentPluginStore, p
24
24
  method?: string;
25
25
  helpUrl?: string;
26
26
  }[];
27
+ expiresAt?: number;
27
28
  }>;
28
29
  export declare function checkPluginCliAuthorization(store: AgentPluginStore, plugin: InstalledAgentPlugin, authorization: string, method: CliMethod, signal: AbortSignal): Promise<boolean>;
29
30
  export declare function startPluginCliAuthorization(store: AgentPluginStore, plugin: InstalledAgentPlugin, authorization: string, method: CliMethod, owner: string): PluginCliAuthorization;
@@ -1,10 +1,10 @@
1
1
  import { CredentialResolver, init_credentials } from "../../auth/credentials.js";
2
- import { spawnProcess } from "../../process/run-process.js";
3
2
  import { parsePluginAuthorizationCheck, pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
4
3
  import { containedPath, expandPluginVariables, resolvePluginCwd, validatePluginServer } from "./validation.js";
4
+ import { spawnProcess } from "../../process/run-process.js";
5
5
  import { expandUserConfig, readPluginUserConfig } from "./user-config.js";
6
- import { homedir } from "node:os";
7
6
  import { join, resolve } from "node:path";
7
+ import { homedir } from "node:os";
8
8
  import { mkdirSync, readFileSync } from "node:fs";
9
9
  import { randomUUID } from "node:crypto";
10
10
  //#region src/extensions/agent-plugins/cli-authorization.ts
@@ -16,7 +16,7 @@ function agentPluginInventoryRow(plugin, store = new AgentPluginStore()) {
16
16
  try {
17
17
  authorizations = pluginAuthorizations(plugin.manifest);
18
18
  } catch {}
19
- const needsAuthorization = !!job && ((job.missingConfig?.length ?? 0) > 0 || job.connections?.some((value) => value.state !== "connected") || job.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length));
19
+ const needsAuthorization = !job && (authorizations.length > 0 || Object.values(plugin.servers).some((server) => server.type !== "stdio" && server.connectionAuth?.mode !== "none")) || !!job && ((job.missingConfig?.length ?? 0) > 0 || job.connections?.some((value) => value.state !== "connected") || job.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length || value.expiresAt !== void 0 && value.expiresAt <= Date.now()));
20
20
  return {
21
21
  id: `plugin:${plugin.id}`,
22
22
  pluginId: plugin.id,
@@ -1,10 +1,11 @@
1
+ import { resolvePluginCapabilityAccess } from "./capability-access.js";
1
2
  import { containedPath, expandPluginVariables, pluginServerId, resolvePluginCwd } from "./validation.js";
2
3
  import { AgentPluginStore } from "./store.js";
3
4
  import { applyPluginAuthBinding, readPluginAuthBinding } from "./auth.js";
4
5
  import { expandUserConfig, readPluginUserConfig } from "./user-config.js";
5
- import { homedir } from "node:os";
6
6
  import { join, resolve } from "node:path";
7
- import { existsSync, mkdirSync, readFileSync } from "node:fs";
7
+ import { homedir } from "node:os";
8
+ import { mkdirSync } from "node:fs";
8
9
  import { createHash } from "node:crypto";
9
10
  //#region src/extensions/agent-plugins/mcp-adapter.ts
10
11
  function pluginOAuthCredentialId(pluginId, revision, serverName) {
@@ -28,10 +29,9 @@ function materializePluginServers(plugin, store = new AgentPluginStore(), diagno
28
29
  };
29
30
  const expand = (value) => expandUserConfig(expandPluginVariables(value.replace(/\$\{PLUGIN_ACCOUNTS\}/g, join(data, "accounts", plugin.receipt.revision)).replace(/\$\{PLUGIN_RESOURCES\}/g, join(data, "resources", plugin.receipt.revision)), root, data), values);
30
31
  const servers = Object.create(null);
31
- const setupPath = join(store.stateDir, "plugin-setup", `${plugin.id}.json`);
32
- const job = !setup && existsSync(setupPath) ? JSON.parse(readFileSync(setupPath, "utf8")) : void 0;
32
+ const access = setup ? void 0 : resolvePluginCapabilityAccess(plugin, store);
33
33
  for (const [name, server] of Object.entries(plugin.servers)) try {
34
- if (job?.packageRevision === plugin.receipt.revision && (job.state !== "completed" && !job.installed || job.connections.find((c) => c.name === name)?.state !== "connected")) continue;
34
+ if (access && !access.server(name)) continue;
35
35
  const origin = {
36
36
  id: plugin.id,
37
37
  serverName: name,
@@ -0,0 +1,3 @@
1
+ import type { Config } from '../../config/schema.js';
2
+ /** Check provider-defined credentials before constructing a new turn's Skill index and MCP config. */
3
+ export declare function refreshPluginRuntimeAccess(config: Config, workspace: string, agentId?: string): Promise<boolean>;
@@ -0,0 +1,36 @@
1
+ import { createLogger } from "../../utils/logger/index.js";
2
+ import { init_logger } from "../../utils/logger.js";
3
+ import { pluginAuthorizations } from "./setup-contract.js";
4
+ import { resolvePluginCapabilityAccess } from "./capability-access.js";
5
+ import { AgentPluginStore } from "./store.js";
6
+ import { PluginSetupService } from "./setup.js";
7
+ //#region src/extensions/agent-plugins/refresh-runtime-access.ts
8
+ init_logger();
9
+ const log = createLogger("PluginRuntimeAccess");
10
+ /** Check provider-defined credentials before constructing a new turn's Skill index and MCP config. */
11
+ async function refreshPluginRuntimeAccess(config, workspace, agentId) {
12
+ const store = new AgentPluginStore(), service = new PluginSetupService(store);
13
+ const signature = () => JSON.stringify(store.active(agentId, workspace).map((plugin) => {
14
+ const access = resolvePluginCapabilityAccess(plugin, store);
15
+ return [
16
+ plugin.id,
17
+ plugin.skills.filter((s) => access.skill(s.name)).map((s) => s.name),
18
+ Object.keys(plugin.servers).filter(access.server)
19
+ ];
20
+ }));
21
+ const before = signature();
22
+ for (const plugin of store.active(agentId, workspace)) {
23
+ if (!pluginAuthorizations(plugin.manifest).length && !Object.values(plugin.layout?.userConfig ?? {}).some((field) => field.sensitive) && Object.values(plugin.servers).every((server) => server.type === "stdio" || server.connectionAuth?.mode === "none")) continue;
24
+ try {
25
+ await service.refreshRuntime(plugin.id, config, workspace);
26
+ } catch (err) {
27
+ log.warn({
28
+ err,
29
+ pluginId: plugin.id
30
+ }, "Could not refresh plugin authorization state");
31
+ }
32
+ }
33
+ return before !== signature();
34
+ }
35
+ //#endregion
36
+ export { refreshPluginRuntimeAccess };
@@ -71,4 +71,5 @@ export declare function parsePluginAuthorizationCheck(output: string, methodIds:
71
71
  method?: string;
72
72
  helpUrl?: string;
73
73
  }[];
74
+ expiresAt?: number;
74
75
  };
@@ -65,6 +65,7 @@ const pluginPermissionIssueSchema = z.strictObject({
65
65
  function parsePluginAuthorizationCheck(output, methodIds) {
66
66
  const result = z.object({
67
67
  authenticated: z.boolean(),
68
+ expiresAt: z.number().finite().optional(),
68
69
  issues: z.array(pluginPermissionIssueSchema).max(20).default([])
69
70
  }).parse(JSON.parse(output.trim().split("\n").at(-1)));
70
71
  for (const issue of result.issues) {
@@ -39,6 +39,7 @@ declare const schema: z.ZodObject<{
39
39
  deferred: z.ZodDefault<z.ZodBoolean>;
40
40
  authorizations: z.ZodDefault<z.ZodArray<z.ZodObject<{
41
41
  id: z.ZodString;
42
+ expiresAt: z.ZodOptional<z.ZodNumber>;
42
43
  state: z.ZodEnum<{
43
44
  error: "error";
44
45
  pending: "pending";
@@ -117,10 +118,12 @@ export declare class PluginSetupService {
117
118
  id: string;
118
119
  name: string;
119
120
  }>>>;
120
- authorization(id: string, owner: string, server: string, config: Config): Promise<import("../../agent/mcp/connection-setup.js").McpAuthorization | import("./cli-authorization.js").PluginCliAuthorization>;
121
+ authorization(id: string, owner: string, server: string, config: Config): Promise<import("./cli-authorization.js").PluginCliAuthorization | import("../../agent/mcp/connection-setup.js").McpAuthorization>;
121
122
  redirect(id: string, owner: string, server: string, url: string, config: Config): boolean;
122
123
  private config;
123
124
  startPrepare(id: string, owner: string, revision: number, config: Config, workspace: string, idempotencyKey?: string): PluginSetupJob;
125
+ /** Recheck an installed revision without login prompts or resource downloads. */
126
+ refreshRuntime(id: string, config: Config, workspace: string): Promise<void>;
124
127
  act(id: string, owner: string, input: z.infer<typeof setupActionSchema>, config: Config, workspace: string): Promise<PluginSetupJob>;
125
128
  private perform;
126
129
  }
@@ -11,8 +11,8 @@ import { readPluginAuthBinding, savePluginAuthBinding, savePluginOAuthReference
11
11
  import { pluginConfigMissing, readPluginUserConfig, savePluginUserConfig } from "./user-config.js";
12
12
  import { materializePluginServers } from "./mcp-adapter.js";
13
13
  import { getNativePiAgentDir } from "../../agent/mcp/native-mcp.js";
14
- import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
15
14
  import { cancelPluginCliAuthorizations, getPluginCliAuthorization, inspectPluginCliAuthorization, startPluginCliAuthorization } from "./cli-authorization.js";
15
+ import { cancelMcpAuthorization, getMcpAuthorization, probeMcpConnection, startMcpAuthorization, submitMcpRedirect } from "../../agent/mcp/connection-setup.js";
16
16
  import { join } from "node:path";
17
17
  import { existsSync, readFileSync } from "node:fs";
18
18
  import { randomUUID } from "node:crypto";
@@ -60,6 +60,7 @@ const schema = z.object({
60
60
  deferred: z.boolean().default(false),
61
61
  authorizations: z.array(z.object({
62
62
  id: z.string(),
63
+ expiresAt: z.number().finite().optional(),
63
64
  state: z.enum([
64
65
  "pending",
65
66
  "connected",
@@ -265,6 +266,21 @@ var PluginSetupService = class {
265
266
  });
266
267
  return this.get(id, owner);
267
268
  }
269
+ /** Recheck an installed revision without login prompts or resource downloads. */
270
+ async refreshRuntime(id, config, workspace) {
271
+ if (!existsSync(this.path(id)) || this.store.pending(id)) return;
272
+ const saved = schema.parse(JSON.parse(readFileSync(this.path(id), "utf8")));
273
+ if (saved.packageRevision !== this.store.receipt(id)?.revision || !saved.installed || saved.resources !== "ready" || !saved.connections.some((value) => value.state === "connected") && !saved.authorizations.some((value) => value.state === "connected") || saved.state === "cancelled" || running.has(this.key(id)) || lockfile.checkSync(this.path(id), { realpath: false })) return;
274
+ const release = lockfile.lockSync(this.path(id), { realpath: false });
275
+ try {
276
+ await this.perform(id, saved.owner, {
277
+ action: "prepare",
278
+ expectedRevision: saved.revision
279
+ }, config, workspace, true);
280
+ } finally {
281
+ release();
282
+ }
283
+ }
268
284
  async act(id, owner, input, config, workspace) {
269
285
  const current = this.get(id, owner);
270
286
  const previous = input.idempotencyKey && current?.operations.find((op) => op.key === input.idempotencyKey);
@@ -290,7 +306,7 @@ var PluginSetupService = class {
290
306
  release();
291
307
  }
292
308
  }
293
- async perform(id, owner, input, config, workspace) {
309
+ async perform(id, owner, input, config, workspace, refreshOnly = false) {
294
310
  const job = this.get(id, owner);
295
311
  if (!job) throw new Error("Setup not found");
296
312
  if (job.revision !== input.expectedRevision) throw new Error("Setup changed. Refresh and retry.");
@@ -428,49 +444,58 @@ var PluginSetupService = class {
428
444
  delete job.error;
429
445
  this.write(job);
430
446
  try {
431
- await preparePluginResources(this.store, plugin, controller.signal);
447
+ if (!refreshOnly) await preparePluginResources(this.store, plugin, controller.signal);
432
448
  job.resources = "ready";
433
449
  job.missingConfig = pluginConfigMissing(this.store, plugin);
434
450
  if (job.missingConfig.length) {
435
451
  job.state = "action_required";
436
452
  job.error = "Complete the required configuration fields.";
437
- } else {
438
- for (const target of job.authorizations) {
439
- const method = declarations.find((value) => value.id === target.id).methods.find((value) => value.id === target.method);
440
- if (method?.type === "cli") {
441
- const check = await inspectPluginCliAuthorization(this.store, plugin, target.id, method, controller.signal);
442
- target.state = check.authenticated ? "connected" : "pending";
443
- target.issues = check.issues;
444
- } else if (method?.type === "form") {
445
- const values = readPluginUserConfig(this.store, id, plugin.receipt.revision);
446
- target.state = method.fields.every((key) => values[key] !== void 0 && values[key] !== "") ? "connected" : "pending";
447
- }
453
+ }
454
+ for (const target of job.authorizations) {
455
+ const method = declarations.find((value) => value.id === target.id).methods.find((value) => value.id === target.method);
456
+ if (method?.type === "cli" && method.fields.some((key) => job.missingConfig.includes(key))) {
457
+ target.state = "pending";
458
+ continue;
448
459
  }
449
- for (const server of job.connections) {
450
- controller.signal.throwIfAborted();
451
- if (declarations.filter((value) => value.servers.includes(server.name)).some((gate) => {
452
- const target = job.authorizations.find((value) => value.id === gate.id);
453
- const method = gate.methods.find((value) => value.id === target.method);
454
- return !method || method.type !== "oauth" && target.state !== "connected";
455
- })) {
456
- server.state = "skipped";
457
- delete server.toolCount;
458
- continue;
459
- }
460
- const result = await probeMcpConnection(effective, workspace, pluginServerId(id, server.name), { signal: controller.signal });
461
- controller.signal.throwIfAborted();
462
- server.state = result.state;
463
- server.toolCount = result.toolCount;
464
- const persisted = this.get(id, owner);
465
- if (!persisted || persisted.id !== job.id || persisted.revision !== job.revision || persisted.state === "cancelled" || !this.store.receipt(id)) throw new Error("Setup changed");
466
- this.config(id, job.packageRevision, config);
467
- this.write(job);
460
+ if (method?.type === "cli") {
461
+ const check = await inspectPluginCliAuthorization(this.store, plugin, target.id, method, controller.signal);
462
+ target.state = check.authenticated && (check.expiresAt === void 0 || check.expiresAt > Date.now()) ? "connected" : "pending";
463
+ target.issues = check.issues;
464
+ target.expiresAt = check.expiresAt;
465
+ } else if (method?.type === "form") {
466
+ const values = readPluginUserConfig(this.store, id, plugin.receipt.revision);
467
+ target.state = method.fields.every((key) => values[key] !== void 0 && values[key] !== "") ? "connected" : "pending";
468
468
  }
469
- for (const target of job.authorizations) target.state = declarations.find((value) => value.id === target.id).servers.every((name) => job.connections.find((value) => value.name === name)?.state === "connected") ? "connected" : "pending";
470
- job.partial = plugin.diagnostics.length > 0;
471
- if (job.connections.some((value) => value.state === "error")) job.error = "Connection verification failed. Check the credentials or login status and try again.";
472
- job.state = "action_required";
473
469
  }
470
+ for (const server of job.connections) {
471
+ controller.signal.throwIfAborted();
472
+ const unavailable = declarations.filter((value) => value.servers.includes(server.name)).some((gate) => {
473
+ const target = job.authorizations.find((value) => value.id === gate.id);
474
+ const method = gate.methods.find((value) => value.id === target.method);
475
+ return !method || method.type !== "oauth" && target.state !== "connected";
476
+ });
477
+ const missingServerConfig = job.missingConfig.some((key) => JSON.stringify(plugin.servers[server.name]).includes(`\${user_config.${key}}`));
478
+ if (unavailable || missingServerConfig) {
479
+ server.state = "skipped";
480
+ delete server.toolCount;
481
+ continue;
482
+ }
483
+ const result = await probeMcpConnection(effective, workspace, pluginServerId(id, server.name), { signal: controller.signal });
484
+ controller.signal.throwIfAborted();
485
+ server.state = result.state;
486
+ server.toolCount = result.toolCount;
487
+ const persisted = this.get(id, owner);
488
+ if (!persisted || persisted.id !== job.id || persisted.revision !== job.revision || persisted.state === "cancelled" || !this.store.receipt(id)) throw new Error("Setup changed");
489
+ this.config(id, job.packageRevision, config);
490
+ this.write(job);
491
+ }
492
+ for (const target of job.authorizations) {
493
+ const declaration = declarations.find((value) => value.id === target.id);
494
+ target.state = (declaration.methods.find((value) => value.id === target.method)?.type === "oauth" || target.state === "connected") && declaration.servers.every((name) => job.connections.find((value) => value.name === name)?.state === "connected") ? "connected" : "pending";
495
+ }
496
+ job.partial = plugin.diagnostics.length > 0;
497
+ if (job.connections.some((value) => value.state === "error")) job.error = "Connection verification failed. Check the credentials or login status and try again.";
498
+ job.state = "action_required";
474
499
  this.config(id, job.packageRevision, config);
475
500
  controller.signal.throwIfAborted();
476
501
  if (this.get(id, owner)?.id !== job.id || this.get(id, owner)?.state === "cancelled") throw new Error("Setup changed");
@@ -478,6 +503,14 @@ var PluginSetupService = class {
478
503
  } catch {
479
504
  const current = this.get(id, owner);
480
505
  if (!controller.signal.aborted && current?.id === job.id && current.revision === job.revision && current.state !== "cancelled" && (this.store.pending(id) ?? this.store.get(id))?.receipt.revision === job.packageRevision) {
506
+ for (const target of job.authorizations) target.state = "pending";
507
+ for (const connection of job.connections) {
508
+ const server = plugin.servers[connection.name];
509
+ if (server && (server.type !== "stdio" ? server.connectionAuth?.mode !== "none" : Object.values(server.env ?? {}).some((value) => Object.entries(plugin.layout?.userConfig ?? {}).some(([key, field]) => field.sensitive && value.includes(`\${user_config.${key}}`))))) {
510
+ connection.state = "error";
511
+ delete connection.toolCount;
512
+ }
513
+ }
481
514
  job.state = "failed";
482
515
  if (job.resources !== "ready") job.resources = "error";
483
516
  job.error = "Preparation failed. Retry after checking resources and connections.";
@@ -1,8 +1,8 @@
1
1
  import { parseFrontmatter } from "../../markdown/frontmatter.js";
2
- import { createSkillConfigManager } from "../../agent/skills/config.js";
3
- import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
4
2
  import { containedPath } from "./validation.js";
5
3
  import { AgentPluginStore } from "./store.js";
4
+ import { createSkillConfigManager } from "../../agent/skills/config.js";
5
+ import { parseSkillLocalizations } from "../../agent/skills/parse-skill-metadata.js";
6
6
  import { buildSkillMarkdownPreviewFromRaw } from "../../agent/skills/skill-markdown-preview-from-raw.js";
7
7
  import { agentPluginInventoryRow } from "./inventory.js";
8
8
  import { basename, dirname } from "node:path";
@@ -1,8 +1,8 @@
1
1
  import { PLUGIN_MANIFEST_PATHS } from "./formats.js";
2
2
  import { containedPath } from "./validation.js";
3
3
  import { runExec } from "../../infra/exec.js";
4
- import { tmpdir } from "node:os";
5
4
  import { join, resolve } from "node:path";
5
+ import { tmpdir } from "node:os";
6
6
  import { existsSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync } from "node:fs";
7
7
  import { createHash } from "node:crypto";
8
8
  //#region src/extensions/agent-plugins/source-catalog.ts
@@ -1,5 +1,5 @@
1
- import { BlockList, isIP } from "node:net";
2
1
  import { Agent, fetch } from "undici";
2
+ import { BlockList, isIP } from "node:net";
3
3
  import { lookup } from "node:dns";
4
4
  //#region src/extensions/agent-plugins/source-http-fetch.ts
5
5
  const blocked = new BlockList();
@@ -1,8 +1,8 @@
1
1
  import { createPluginSourceFetch } from "./source-http-fetch.js";
2
2
  import { PLUGIN_MANIFEST_PATHS } from "./formats.js";
3
3
  import { PluginSourceRedirect, isGitPluginSource, withCatalogSource } from "./source-catalog.js";
4
- import { tmpdir } from "node:os";
5
4
  import { join } from "node:path";
5
+ import { tmpdir } from "node:os";
6
6
  import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
7
7
  import AdmZip from "adm-zip";
8
8
  //#region src/extensions/agent-plugins/sources.ts
@@ -98,6 +98,7 @@ export declare class AgentPluginStore {
98
98
  constructor(stateDir?: string);
99
99
  private receiptsDir;
100
100
  revisionKey(): string;
101
+ private authorizationExpiryState;
101
102
  dataDir(id: string): string;
102
103
  private revisionDir;
103
104
  private receiptPath;
@@ -7,8 +7,8 @@ import { prunePluginResourceCache } from "./resources.js";
7
7
  import { PLUGIN_MANIFEST_PATHS } from "./formats.js";
8
8
  import { containedPath, inspectAgentPlugin, pluginName } from "./validation.js";
9
9
  import { pluginSourceKey } from "./source-catalog.js";
10
- import { tmpdir } from "node:os";
11
10
  import { dirname, join, resolve } from "node:path";
11
+ import { tmpdir } from "node:os";
12
12
  import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
13
13
  import { createHash, randomUUID } from "node:crypto";
14
14
  import { z } from "zod";
@@ -66,12 +66,19 @@ var AgentPluginStore = class {
66
66
  return readdirSync(this.receiptsDir()).filter((name) => name.endsWith(".json")).sort().map((name) => {
67
67
  try {
68
68
  const setupPath = join(this.stateDir, "plugin-setup", name);
69
- return createHash("sha256").update(readFileSync(join(this.receiptsDir(), name))).update(existsSync(setupPath) ? readFileSync(setupPath) : "").digest("hex");
69
+ return createHash("sha256").update(readFileSync(join(this.receiptsDir(), name))).update(existsSync(setupPath) ? readFileSync(setupPath) : "").update(JSON.stringify(this.authorizationExpiryState(setupPath))).digest("hex");
70
70
  } catch {
71
71
  return "";
72
72
  }
73
73
  }).join("|");
74
74
  }
75
+ authorizationExpiryState(path) {
76
+ try {
77
+ return (JSON.parse(readFileSync(path, "utf8")).authorizations ?? []).map((value) => value.expiresAt !== void 0 && value.expiresAt <= Date.now());
78
+ } catch {
79
+ return [];
80
+ }
81
+ }
75
82
  dataDir(id) {
76
83
  return containedPath(this.stateDir, join(this.stateDir, "plugin-data", pluginName.parse(id)));
77
84
  }
@@ -127,7 +134,7 @@ var AgentPluginStore = class {
127
134
  });
128
135
  const setupPath = join(this.stateDir, "plugin-setup", `${id}.json`);
129
136
  const setup = existsSync(setupPath) ? JSON.parse(readFileSync(setupPath, "utf8")) : void 0;
130
- const readiness = !valid || adapterChanged || capabilityChanged || inspection.layout?.compatibility.some((item) => item.component === "hooks" || item.component === "authorizations" && item.support === "invalid") ? "blocked" : setup?.packageRevision === receipt.revision && setup.state !== "completed" && !setup.installed ? "setup_required" : inspection.diagnostics.length || setup?.packageRevision === receipt.revision && (setup.partial || setup.installed && (setup.missingConfig?.length || setup.connections?.some((value) => value.state !== "connected") || setup.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length))) ? "degraded" : "ready";
137
+ const readiness = !valid || adapterChanged || capabilityChanged || inspection.layout?.compatibility.some((item) => item.component === "hooks" || ["authorizations", "capability-access"].includes(item.component) && item.support === "invalid") ? "blocked" : setup?.packageRevision === receipt.revision && setup.state !== "completed" && !setup.installed ? "setup_required" : inspection.diagnostics.length || setup?.packageRevision === receipt.revision && (setup.partial || setup.installed && (setup.missingConfig?.length || setup.connections?.some((value) => value.state !== "connected") || setup.authorizations?.some((value) => value.state !== "connected" || !!value.issues?.length))) ? "degraded" : "ready";
131
138
  return {
132
139
  ...inspection,
133
140
  id,
@@ -1,13 +1,14 @@
1
- import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
2
1
  import { pluginAuthorizations, safeAuthorizationUrl } from "./setup-contract.js";
2
+ import { pluginCapabilityAccess } from "./capability-access.js";
3
3
  import { normalizePluginMcpServer } from "./mcp-format.js";
4
+ import { McpOAuthConfigSchema, init_schema } from "../../config/schema.js";
4
5
  import { pluginResources } from "./resources.js";
5
6
  import { collectPluginSkillFiles, readPluginLayout } from "./formats.js";
7
+ import yaml from "js-yaml";
6
8
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
9
  import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
8
10
  import { createHash } from "node:crypto";
9
11
  import { z } from "zod";
10
- import yaml from "js-yaml";
11
12
  import { validateHeaderName, validateHeaderValue } from "node:http";
12
13
  //#region src/extensions/agent-plugins/validation.ts
13
14
  init_schema();
@@ -309,6 +310,15 @@ function inspectAgentPlugin(rootDir, dataDir = join(rootDir, ".inspection-data")
309
310
  }
310
311
  }
311
312
  });
313
+ attempt("capability-access", () => {
314
+ const access = pluginCapabilityAccess(manifest);
315
+ const accounts = new Set(pluginAuthorizations(manifest).map((value) => value.id));
316
+ for (const [kind, rules] of Object.entries(access)) for (const [name, rule] of Object.entries(rules)) {
317
+ if (kind === "skills" ? !result.skills.some((skill) => skill.name === name) : !result.servers[name]) throw new Error(`Unknown ${kind} capability: ${name}`);
318
+ if (rule.servers.some((server) => !result.servers[server]) || rule.authorizations.some((value) => !accounts.has(typeof value === "string" ? value : value.id))) throw new Error(`Unknown capability dependency: ${name}`);
319
+ }
320
+ if (Object.keys(access.skills).length || Object.keys(access.mcp).length) result.capabilities.push(`runtime.capability-access:${JSON.stringify(access)}`);
321
+ });
312
322
  result.capabilities.sort();
313
323
  return result;
314
324
  }
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
+ import { registerMediaUnderstandingProvider } from "../media-understanding/registry.js";
3
4
  import { getProviderRegistry, init_plugin_registry } from "../providers/plugin-registry.js";
4
5
  import { registerMarketplaceAdapter, unregisterMarketplaceAdapter } from "../agent/skills/marketplace/registry.js";
5
- import { registerMediaUnderstandingProvider } from "../media-understanding/registry.js";
6
6
  import { registerSpeechProvider } from "../voice/tts/speech-registry.js";
7
7
  import { HOOK_EXECUTION_MODES } from "./types/hooks.js";
8
8
  import { commandRegistry } from "../chat-commands/registry.js";
@@ -9,8 +9,8 @@ import { collectExtensionPackageDependencyIssues } from "./package-contract.js";
9
9
  import { dirname, isAbsolute, join, resolve, sep } from "path";
10
10
  import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "fs";
11
11
  import { execFileSync } from "node:child_process";
12
- import semver from "semver";
13
12
  import AdmZip from "adm-zip";
13
+ import semver from "semver";
14
14
  import { tmpdir } from "os";
15
15
  //#region src/extensions/install.ts
16
16
  /**
@@ -19,9 +19,9 @@ import { EXTENSION_API_VERSION, EXTENSION_UI_API_VERSION, checkExtensionApiCompa
19
19
  import { DEFAULT_SECURITY_CONFIG, checkExtensionDirSafety, checkExtensionPathSafety, isExtensionAllowed, logSecurityIssue, provenanceTracker } from "./security.js";
20
20
  import { getSlotRegistry } from "./slots.js";
21
21
  import { getExtensionCache, getExtensionDiagnostics } from "./diagnostics.js";
22
- import { fileURLToPath, pathToFileURL } from "node:url";
23
22
  import { dirname, isAbsolute, join } from "path";
24
23
  import { existsSync, readFileSync } from "fs";
24
+ import { fileURLToPath, pathToFileURL } from "node:url";
25
25
  import { createJiti } from "jiti";
26
26
  //#region src/extensions/loader.ts
27
27
  /**
@@ -1,3 +1,4 @@
1
+ import { defineChannelPluginEntry } from "./channel-entry.js";
1
2
  import { ProviderPluginRegistry, getProviderRegistry, init_plugin_registry } from "../../providers/plugin-registry.js";
2
3
  import { HOOK_EXECUTION_MODES } from "../types/hooks.js";
3
4
  import { TypedEventBus } from "../typed-event-bus.js";
@@ -7,7 +8,6 @@ import { DEFAULT_SECURITY_CONFIG, checkExtensionDirSafety, checkExtensionPathSaf
7
8
  import { SlotRegistry, getSlotRegistry, registerSlotType } from "../slots.js";
8
9
  import { ExtensionDiagnostics, ExtensionLoaderCacheImpl, getExtensionCache, getExtensionDiagnostics } from "../diagnostics.js";
9
10
  import { ExtensionHookRunner, createHookContext, isHookEvent } from "../hooks.js";
10
- import { defineChannelPluginEntry } from "./channel-entry.js";
11
11
  import { registerExtensionCliProgram } from "./channel-helpers.js";
12
12
  import { lazyFunction, lazyModule } from "./lazy.js";
13
13
  import { createMockExtensionApi, createTestGateway } from "./testing.js";
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
3
  import { init_paths, resolveBundledExtensionsDir, resolveExtensionsDir } from "../config/paths.js";
4
- import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
5
4
  import { computeExtensionDirectoryIntegrity, getExtensionLockfileManager } from "./lockfile.js";
5
+ import { downloadExtensionStoreZipBuffer, resolveExtensionZipDownloadUrl, resolveExtensionsStoreBaseUrl, verifyStoreArtifactSha256 } from "../agent/skills/marketplace/adapters/store/store-api-client.js";
6
6
  import { loadConfig } from "../config/loader.js";
7
7
  import { commitStagedExtensionInstall, finalizeStagedExtensionInstall, rollbackStagedExtensionInstall, stageExtensionNpm, stageExtensionStoreZip } from "./install-transaction.js";
8
8
  import { findExtension } from "./marketplace.js";
@@ -1,10 +1,10 @@
1
1
  import { normalizeAgentId, validateAgentIdForNewAgent } from "../agent-catalog/id.js";
2
2
  import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
3
3
  import { init_agent_scope, listAgentEntries, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath } from "../agent/agent-scope.js";
4
- import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
5
- import { AgentCatalogService } from "../agent-catalog/service.js";
6
4
  import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
5
+ import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
7
6
  import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
7
+ import { AgentCatalogService } from "../agent-catalog/service.js";
8
8
  import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
9
9
  import { resolve } from "node:path";
10
10
  import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
@@ -1,11 +1,11 @@
1
1
  import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
2
2
  import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
3
- import { extractProfileAgentId } from "../config/agent-profile.js";
4
3
  import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
4
+ import { extractProfileAgentId } from "../config/agent-profile.js";
5
5
  import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
6
6
  import { isPathUnderWorkspace } from "./workspace-editor-path.js";
7
- import { homedir } from "node:os";
8
7
  import { basename, isAbsolute, resolve } from "node:path";
8
+ import { homedir } from "node:os";
9
9
  import { stat } from "node:fs/promises";
10
10
  //#region src/gateway/file-path-classifier.ts
11
11
  init_agent_scope();