@tencent-ai/agent-harness 0.2.0-beta.6 → 0.2.0-beta.8

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 (868) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/cli/CHANGELOG.md +123 -0
  3. package/cli/dist-server/lite/in-memory-session-store.js +1 -1
  4. package/cli/dist-server/shared.cjs +338 -291
  5. package/cli/dist-server/types/node/a2a/a2a-protocol.d.ts +516 -0
  6. package/cli/dist-server/types/node/agent/agent-completion-waiter.d.ts +28 -0
  7. package/cli/dist-server/types/node/agent/agent-controller.d.ts +147 -0
  8. package/cli/dist-server/types/node/agent/agent-display.d.ts +77 -0
  9. package/cli/dist-server/types/node/agent/agent-manager.d.ts +964 -0
  10. package/cli/dist-server/types/node/agent/agent-memory.d.ts +72 -0
  11. package/cli/dist-server/types/node/agent/agent-runtime-adapter.d.ts +71 -0
  12. package/cli/dist-server/types/node/agent/builtin-agent-modes.d.ts +47 -0
  13. package/cli/dist-server/types/node/agent/custom-agent-identity.d.ts +54 -0
  14. package/cli/dist-server/types/node/agent/custom-agent-manager.d.ts +43 -0
  15. package/cli/dist-server/types/node/agent/custom-agent-path-registry.d.ts +19 -0
  16. package/cli/dist-server/types/node/agent/exit-planmode-visibility.d.ts +64 -0
  17. package/cli/dist-server/types/node/agent/index.d.ts +22 -0
  18. package/cli/dist-server/types/node/agent/insights-data-agent-run-interceptor.d.ts +67 -0
  19. package/cli/dist-server/types/node/agent/interceptors/command-interceptors.d.ts +89 -0
  20. package/cli/dist-server/types/node/agent/interceptors/deep-research-pending-interceptor.d.ts +30 -0
  21. package/cli/dist-server/types/node/agent/interceptors/env-interceptor.d.ts +7 -0
  22. package/cli/dist-server/types/node/agent/interceptors/file-interceptors.d.ts +45 -0
  23. package/cli/dist-server/types/node/agent/interceptors/image-interceptors.d.ts +47 -0
  24. package/cli/dist-server/types/node/agent/interceptors/index.d.ts +16 -0
  25. package/cli/dist-server/types/node/agent/interceptors/initial-prompt-interceptor.d.ts +29 -0
  26. package/cli/dist-server/types/node/agent/interceptors/manual-compact-request-handler.d.ts +29 -0
  27. package/cli/dist-server/types/node/agent/interceptors/model-interceptors.d.ts +43 -0
  28. package/cli/dist-server/types/node/agent/interceptors/sandbox-interceptor.d.ts +84 -0
  29. package/cli/dist-server/types/node/agent/interceptors/sensitive-user-input-interceptor.d.ts +7 -0
  30. package/cli/dist-server/types/node/agent/interceptors/system-reminder-interceptor.d.ts +101 -0
  31. package/cli/dist-server/types/node/agent/interceptors/team-resume-intent-interceptor.d.ts +31 -0
  32. package/cli/dist-server/types/node/agent/interceptors/telemetry-interceptors.d.ts +43 -0
  33. package/cli/dist-server/types/node/agent/interceptors/ultracode-effort-reminder-interceptor.d.ts +21 -0
  34. package/cli/dist-server/types/node/agent/interceptors/ultracode-keyword-interceptor.d.ts +34 -0
  35. package/cli/dist-server/types/node/agent/main-agent-policy.d.ts +33 -0
  36. package/cli/dist-server/types/node/agent/main-agent-preset.d.ts +32 -0
  37. package/cli/dist-server/types/node/agent/main-agent-resolver.d.ts +156 -0
  38. package/cli/dist-server/types/node/agent/main-agent-session.d.ts +212 -0
  39. package/cli/dist-server/types/node/agent/memory-context-interceptor.d.ts +84 -0
  40. package/cli/dist-server/types/node/agent/standing-main-agent.d.ts +12 -0
  41. package/cli/dist-server/types/node/agent/stream-json-init-interceptor.d.ts +9 -0
  42. package/cli/dist-server/types/node/agent/subagent-limits.d.ts +90 -0
  43. package/cli/dist-server/types/node/agent/team-context-interceptor.d.ts +42 -0
  44. package/cli/dist-server/types/node/agent/teammate-failure-interceptor.d.ts +67 -0
  45. package/cli/dist-server/types/node/agent-home/agent-home-attachments.d.ts +83 -0
  46. package/cli/dist-server/types/node/agent-home/agent-home-channel-system-event.d.ts +15 -0
  47. package/cli/dist-server/types/node/agent-home/agent-home-channel-task-event.d.ts +24 -0
  48. package/cli/dist-server/types/node/agent-home/agent-home-channel-wake.d.ts +115 -0
  49. package/cli/dist-server/types/node/agent-home/agent-home-channel-widget.d.ts +45 -0
  50. package/cli/dist-server/types/node/agent-home/agent-home-directory.d.ts +304 -0
  51. package/cli/dist-server/types/node/agent-home/agent-home-limits.d.ts +73 -0
  52. package/cli/dist-server/types/node/agent-home/agent-home-membership.d.ts +34 -0
  53. package/cli/dist-server/types/node/agent-home/agent-home-mentions.d.ts +39 -0
  54. package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +51 -0
  55. package/cli/dist-server/types/node/agent-home/channel-wake-service.d.ts +69 -0
  56. package/cli/dist-server/types/node/agent-task/agent-task-manager.d.ts +242 -0
  57. package/cli/dist-server/types/node/agent-task/agent-task-output-manager.d.ts +55 -0
  58. package/cli/dist-server/types/node/agent-task/agent-task-protocol.d.ts +687 -0
  59. package/cli/dist-server/types/node/agent-task/agent-task.d.ts +405 -0
  60. package/cli/dist-server/types/node/agent-task/background-task-notifier.d.ts +212 -0
  61. package/cli/dist-server/types/node/agent-task/background-task-tool-approval-service.d.ts +36 -0
  62. package/cli/dist-server/types/node/agent-task/index.d.ts +9 -0
  63. package/cli/dist-server/types/node/agent-task/retained-agent-task.d.ts +11 -0
  64. package/cli/dist-server/types/node/agent-task/stream-json-drain-trigger.d.ts +23 -0
  65. package/cli/dist-server/types/node/agent-task/subagent-output-scanner.d.ts +53 -0
  66. package/cli/dist-server/types/node/agent-team/backends/teammate-backend-protocol.d.ts +119 -0
  67. package/cli/dist-server/types/node/agent-team/team-member.d.ts +391 -0
  68. package/cli/dist-server/types/node/agent-team/team-protocol.d.ts +375 -0
  69. package/cli/dist-server/types/node/agent-view/agent-view-actions.d.ts +209 -0
  70. package/cli/dist-server/types/node/agent-view/agent-view-protocol.d.ts +714 -0
  71. package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +80 -0
  72. package/cli/dist-server/types/node/agent-view/launch-workspace.d.ts +9 -0
  73. package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +161 -0
  74. package/cli/dist-server/types/node/ask/ask-protoctol.d.ts +102 -0
  75. package/cli/dist-server/types/node/ask/ask-service.d.ts +62 -0
  76. package/cli/dist-server/types/node/ask/index.d.ts +3 -0
  77. package/cli/dist-server/types/node/ask/session-ask-user-question-handler.d.ts +25 -0
  78. package/cli/dist-server/types/node/authentication/api-key-authentication-storage.d.ts +17 -0
  79. package/cli/dist-server/types/node/authentication/custom-token-authentication-storage.d.ts +10 -0
  80. package/cli/dist-server/types/node/authentication/file-authentication-storage.d.ts +71 -0
  81. package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +125 -0
  82. package/cli/dist-server/types/node/bash-sandbox/index.d.ts +4 -0
  83. package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-protocol.d.ts +33 -0
  84. package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +33 -0
  85. package/cli/dist-server/types/node/blob-store/blob-store-protocol.d.ts +104 -0
  86. package/cli/dist-server/types/node/blob-store/blob-store-service.d.ts +22 -0
  87. package/cli/dist-server/types/node/blob-store/image-blob-service.d.ts +121 -0
  88. package/cli/dist-server/types/node/blob-store/index.d.ts +4 -0
  89. package/cli/dist-server/types/node/blob-store/tool-result-blob-service.d.ts +109 -0
  90. package/cli/dist-server/types/node/channel/channel-event-service.d.ts +18 -0
  91. package/cli/dist-server/types/node/channel/channel-manager.d.ts +41 -0
  92. package/cli/dist-server/types/node/channel/channel-permission-adapter.d.ts +27 -0
  93. package/cli/dist-server/types/node/channel/channel-protocol.d.ts +192 -0
  94. package/cli/dist-server/types/node/channel/channel-security-manager.d.ts +12 -0
  95. package/cli/dist-server/types/node/channel/index.d.ts +5 -0
  96. package/cli/dist-server/types/node/cli/tui-mode-service.d.ts +20 -0
  97. package/cli/dist-server/types/node/code-ratio/cli-git-commit-watcher.d.ts +142 -0
  98. package/cli/dist-server/types/node/code-ratio/cli-svn-commit-watcher.d.ts +111 -0
  99. package/cli/dist-server/types/node/code-ratio/code-ratio-reporting-service.d.ts +90 -0
  100. package/cli/dist-server/types/node/code-ratio/fs-file-reader.d.ts +26 -0
  101. package/cli/dist-server/types/node/code-ratio/index.d.ts +5 -0
  102. package/cli/dist-server/types/node/code-ratio/vcs-repo-resolver.d.ts +51 -0
  103. package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +11 -0
  104. package/cli/dist-server/types/node/command/agent-mode-command-executor.d.ts +11 -0
  105. package/cli/dist-server/types/node/command/agents-command-executor.d.ts +9 -0
  106. package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +20 -0
  107. package/cli/dist-server/types/node/command/background-command-executor.d.ts +29 -0
  108. package/cli/dist-server/types/node/command/bash-command-executor.d.ts +62 -0
  109. package/cli/dist-server/types/node/command/btw-command-executor.d.ts +13 -0
  110. package/cli/dist-server/types/node/command/clear-command-executor.d.ts +17 -0
  111. package/cli/dist-server/types/node/command/command-manager.d.ts +54 -0
  112. package/cli/dist-server/types/node/command/command-protocol.d.ts +106 -0
  113. package/cli/dist-server/types/node/command/config-command-executor.d.ts +15 -0
  114. package/cli/dist-server/types/node/command/context-command-executor.d.ts +42 -0
  115. package/cli/dist-server/types/node/command/copy-command-executor.d.ts +10 -0
  116. package/cli/dist-server/types/node/command/cost-command-executor.d.ts +13 -0
  117. package/cli/dist-server/types/node/command/custom-command-renderer.d.ts +29 -0
  118. package/cli/dist-server/types/node/command/debug-command-executor.d.ts +15 -0
  119. package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +27 -0
  120. package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +7 -0
  121. package/cli/dist-server/types/node/command/effort-command-executor.d.ts +68 -0
  122. package/cli/dist-server/types/node/command/exit-command-executor.d.ts +14 -0
  123. package/cli/dist-server/types/node/command/export-command-executor.d.ts +7 -0
  124. package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +9 -0
  125. package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +29 -0
  126. package/cli/dist-server/types/node/command/fork-command-executor.d.ts +28 -0
  127. package/cli/dist-server/types/node/command/goal-command-executor.d.ts +50 -0
  128. package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +9 -0
  129. package/cli/dist-server/types/node/command/help-command-executor.d.ts +9 -0
  130. package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +9 -0
  131. package/cli/dist-server/types/node/command/ide-command-executor.d.ts +11 -0
  132. package/cli/dist-server/types/node/command/index.d.ts +66 -0
  133. package/cli/dist-server/types/node/command/local-shell.d.ts +31 -0
  134. package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +15 -0
  135. package/cli/dist-server/types/node/command/mcp-prompt-renderer.d.ts +44 -0
  136. package/cli/dist-server/types/node/command/memory-command-executor.d.ts +17 -0
  137. package/cli/dist-server/types/node/command/model-command-executor.d.ts +11 -0
  138. package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +17 -0
  139. package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +17 -0
  140. package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +17 -0
  141. package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +17 -0
  142. package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +17 -0
  143. package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +17 -0
  144. package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +9 -0
  145. package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +9 -0
  146. package/cli/dist-server/types/node/command/plan-command-executor.d.ts +11 -0
  147. package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +25 -0
  148. package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +21 -0
  149. package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +18 -0
  150. package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +22 -0
  151. package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +44 -0
  152. package/cli/dist-server/types/node/command/rename-command-executor.d.ts +11 -0
  153. package/cli/dist-server/types/node/command/reset-command-executor.d.ts +9 -0
  154. package/cli/dist-server/types/node/command/resume-command-executor.d.ts +21 -0
  155. package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +10 -0
  156. package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +20 -0
  157. package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +43 -0
  158. package/cli/dist-server/types/node/command/skills-command-executor.d.ts +9 -0
  159. package/cli/dist-server/types/node/command/stats-command-executor.d.ts +11 -0
  160. package/cli/dist-server/types/node/command/status-command-executor.d.ts +11 -0
  161. package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +9 -0
  162. package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +7 -0
  163. package/cli/dist-server/types/node/command/theme-command-executor.d.ts +7 -0
  164. package/cli/dist-server/types/node/command/todos-command-executor.d.ts +16 -0
  165. package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +13 -0
  166. package/cli/dist-server/types/node/command/vim-command-executor.d.ts +11 -0
  167. package/cli/dist-server/types/node/command/web-command-executor.d.ts +18 -0
  168. package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +26 -0
  169. package/cli/dist-server/types/node/command-parser/command-parser-protocol.d.ts +81 -0
  170. package/cli/dist-server/types/node/console/console-manager.d.ts +37 -0
  171. package/cli/dist-server/types/node/console/console-protocol.d.ts +112 -0
  172. package/cli/dist-server/types/node/console/index.d.ts +2 -0
  173. package/cli/dist-server/types/node/context/deferred-tools-description-builder.d.ts +145 -0
  174. package/cli/dist-server/types/node/context/token-calculator/token-calculator-protocol.d.ts +27 -0
  175. package/cli/dist-server/types/node/debug/debug-middleware.d.ts +8 -0
  176. package/cli/dist-server/types/node/debug/debug-protocol.d.ts +63 -0
  177. package/cli/dist-server/types/node/debug/debug-service.d.ts +26 -0
  178. package/cli/dist-server/types/node/debug/index.d.ts +3 -0
  179. package/cli/dist-server/types/node/elicitation/elicitation-service.d.ts +100 -0
  180. package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +32 -0
  181. package/cli/dist-server/types/node/feedback/feedback-service.d.ts +19 -0
  182. package/cli/dist-server/types/node/feedback/index.d.ts +2 -0
  183. package/cli/dist-server/types/node/galileo/agent-metrics-aggregator.d.ts +115 -0
  184. package/cli/dist-server/types/node/galileo/error-category.d.ts +65 -0
  185. package/cli/dist-server/types/node/galileo/galileo-chat-reporter.d.ts +302 -0
  186. package/cli/dist-server/types/node/galileo/galileo-protocol.d.ts +78 -0
  187. package/cli/dist-server/types/node/galileo/galileo-service.d.ts +171 -0
  188. package/cli/dist-server/types/node/galileo/galileo-session-bridge-protocol.d.ts +134 -0
  189. package/cli/dist-server/types/node/galileo/galileo-session-bridge.d.ts +105 -0
  190. package/cli/dist-server/types/node/galileo/galileo-timing-hook.d.ts +115 -0
  191. package/cli/dist-server/types/node/galileo/galileo-tool-error-report-hook.d.ts +32 -0
  192. package/cli/dist-server/types/node/galileo/galileo-tool-post-hook.d.ts +18 -0
  193. package/cli/dist-server/types/node/galileo/galileo-tool-pre-hook.d.ts +16 -0
  194. package/cli/dist-server/types/node/galileo/galileo-tool-start-report-hook.d.ts +14 -0
  195. package/cli/dist-server/types/node/galileo/galileo-tool-success-report-hook.d.ts +14 -0
  196. package/cli/dist-server/types/node/galileo/index.d.ts +15 -0
  197. package/cli/dist-server/types/node/galileo/session-error-tracker.d.ts +44 -0
  198. package/cli/dist-server/types/node/galileo/task-outcome-resolver.d.ts +28 -0
  199. package/cli/dist-server/types/node/galileo/task-outcome.d.ts +35 -0
  200. package/cli/dist-server/types/node/hooks/functional-hooks-protocol.d.ts +78 -0
  201. package/cli/dist-server/types/node/hooks/functional-hooks.d.ts +23 -0
  202. package/cli/dist-server/types/node/http/certificate-manager.d.ts +50 -0
  203. package/cli/dist-server/types/node/http/classify-network-error.d.ts +21 -0
  204. package/cli/dist-server/types/node/http/custom-header-http-interceptor.d.ts +14 -0
  205. package/cli/dist-server/types/node/http/custom-headers-provider.d.ts +26 -0
  206. package/cli/dist-server/types/node/http/fetch-proxy.d.ts +22 -0
  207. package/cli/dist-server/types/node/http/http-proxy-interceptor.d.ts +116 -0
  208. package/cli/dist-server/types/node/http/index.d.ts +6 -0
  209. package/cli/dist-server/types/node/ide-integration/ide-edit-manager.d.ts +53 -0
  210. package/cli/dist-server/types/node/ide-integration/ide-protocol.d.ts +450 -0
  211. package/cli/dist-server/types/node/install/index.d.ts +6 -0
  212. package/cli/dist-server/types/node/install/install-controller.d.ts +15 -0
  213. package/cli/dist-server/types/node/install/install-env.d.ts +12 -0
  214. package/cli/dist-server/types/node/install/install-protocol.d.ts +83 -0
  215. package/cli/dist-server/types/node/install/install-service.d.ts +36 -0
  216. package/cli/dist-server/types/node/install/releases-service.d.ts +29 -0
  217. package/cli/dist-server/types/node/install/shell-setup.d.ts +36 -0
  218. package/cli/dist-server/types/node/library-runtime.d.ts +9 -0
  219. package/cli/dist-server/types/node/loopback/endpoint-provider.d.ts +9 -0
  220. package/cli/dist-server/types/node/loopback/error-provider.d.ts +9 -0
  221. package/cli/dist-server/types/node/loopback/index.d.ts +4 -0
  222. package/cli/dist-server/types/node/loopback/loopback-body-limit.d.ts +52 -0
  223. package/cli/dist-server/types/node/lsp/index.d.ts +6 -0
  224. package/cli/dist-server/types/node/lsp/lsp-client.d.ts +104 -0
  225. package/cli/dist-server/types/node/lsp/lsp-manager.d.ts +90 -0
  226. package/cli/dist-server/types/node/lsp/lsp-protocol.d.ts +245 -0
  227. package/cli/dist-server/types/node/mcp/agent-scoped-mcp-manager.d.ts +38 -0
  228. package/cli/dist-server/types/node/mcp/index.d.ts +32 -0
  229. package/cli/dist-server/types/node/mcp/mcp-cli-config-initializer.d.ts +18 -0
  230. package/cli/dist-server/types/node/mcp/mcp-config-diagnostics-manager.d.ts +29 -0
  231. package/cli/dist-server/types/node/mcp/mcp-config-env-expand-service.d.ts +45 -0
  232. package/cli/dist-server/types/node/mcp/mcp-config-fingerprint.d.ts +28 -0
  233. package/cli/dist-server/types/node/mcp/mcp-config-manager.d.ts +110 -0
  234. package/cli/dist-server/types/node/mcp/mcp-config-store.d.ts +18 -0
  235. package/cli/dist-server/types/node/mcp/mcp-connection-manager.d.ts +35 -0
  236. package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +56 -0
  237. package/cli/dist-server/types/node/mcp/mcp-descriptor-environment.d.ts +5 -0
  238. package/cli/dist-server/types/node/mcp/mcp-first-run-status-service.d.ts +37 -0
  239. package/cli/dist-server/types/node/mcp/mcp-log-service.d.ts +5 -0
  240. package/cli/dist-server/types/node/mcp/mcp-manager.d.ts +339 -0
  241. package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +26 -0
  242. package/cli/dist-server/types/node/mcp/mcp-oauth-manager.d.ts +33 -0
  243. package/cli/dist-server/types/node/mcp/mcp-oauth-store.d.ts +30 -0
  244. package/cli/dist-server/types/node/mcp/mcp-permissions-manager.d.ts +52 -0
  245. package/cli/dist-server/types/node/mcp/mcp-plugin-registry.d.ts +39 -0
  246. package/cli/dist-server/types/node/mcp/mcp-ready-service.d.ts +94 -0
  247. package/cli/dist-server/types/node/mcp/mcp-resource-catalog-protocol.d.ts +62 -0
  248. package/cli/dist-server/types/node/mcp/mcp-resource-catalog.d.ts +32 -0
  249. package/cli/dist-server/types/node/mcp/mcp-server-manager.d.ts +283 -0
  250. package/cli/dist-server/types/node/mcp/mcp-server-model-manager.d.ts +14 -0
  251. package/cli/dist-server/types/node/mcp/mcp-subagent-tool-manager.d.ts +36 -0
  252. package/cli/dist-server/types/node/mcp/mcp-toggle-manager.d.ts +45 -0
  253. package/cli/dist-server/types/node/mcp/mcp-transport-manager.d.ts +34 -0
  254. package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +25 -0
  255. package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +38 -0
  256. package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +17 -0
  257. package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +149 -0
  258. package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +97 -0
  259. package/cli/dist-server/types/node/memory/conditional-rules-service.d.ts +21 -0
  260. package/cli/dist-server/types/node/memory/glob-matcher.d.ts +16 -0
  261. package/cli/dist-server/types/node/memory/index.d.ts +20 -0
  262. package/cli/dist-server/types/node/memory/memory-age.d.ts +44 -0
  263. package/cli/dist-server/types/node/memory/memory-cache.d.ts +8 -0
  264. package/cli/dist-server/types/node/memory/memory-controller.d.ts +62 -0
  265. package/cli/dist-server/types/node/memory/memory-extraction-prompts.d.ts +11 -0
  266. package/cli/dist-server/types/node/memory/memory-extraction-service.d.ts +56 -0
  267. package/cli/dist-server/types/node/memory/memory-extraction-stop-hook.d.ts +18 -0
  268. package/cli/dist-server/types/node/memory/memory-freshness-post-tool-hook.d.ts +22 -0
  269. package/cli/dist-server/types/node/memory/memory-loader.d.ts +62 -0
  270. package/cli/dist-server/types/node/memory/memory-manager.d.ts +24 -0
  271. package/cli/dist-server/types/node/memory/memory-parser.d.ts +15 -0
  272. package/cli/dist-server/types/node/memory/memory-prompt-builder.d.ts +38 -0
  273. package/cli/dist-server/types/node/memory/memory-protocol.d.ts +235 -0
  274. package/cli/dist-server/types/node/memory/memory-relevance-protocol.d.ts +33 -0
  275. package/cli/dist-server/types/node/memory/memory-relevance-service.d.ts +30 -0
  276. package/cli/dist-server/types/node/memory/memory-scan.d.ts +35 -0
  277. package/cli/dist-server/types/node/memory/memory-types.d.ts +49 -0
  278. package/cli/dist-server/types/node/memory/memory-validator.d.ts +6 -0
  279. package/cli/dist-server/types/node/memory/subdirectory-memory-loader.d.ts +55 -0
  280. package/cli/dist-server/types/node/model/model-protocol.d.ts +22 -0
  281. package/cli/dist-server/types/node/multitask/session-flags.d.ts +110 -0
  282. package/cli/dist-server/types/node/multitask/types.d.ts +123 -0
  283. package/cli/dist-server/types/node/navigation/index.d.ts +2 -0
  284. package/cli/dist-server/types/node/navigation/navigation-manager.d.ts +12 -0
  285. package/cli/dist-server/types/node/navigation/navigation-protocol.d.ts +23 -0
  286. package/cli/dist-server/types/node/notification/notification-protocol.d.ts +19 -0
  287. package/cli/dist-server/types/node/output-style/output-style-protocol.d.ts +60 -0
  288. package/cli/dist-server/types/node/permission/brokered-sandbox/approval-coordinator.d.ts +32 -0
  289. package/cli/dist-server/types/node/permission/brokered-sandbox/host-protocol.d.ts +103 -0
  290. package/cli/dist-server/types/node/permission/canonicalize-command.d.ts +30 -0
  291. package/cli/dist-server/types/node/permission/codebuddy-sandbox-env.d.ts +35 -0
  292. package/cli/dist-server/types/node/permission/directory-trust-service.d.ts +45 -0
  293. package/cli/dist-server/types/node/permission/file-policy-assessment.d.ts +35 -0
  294. package/cli/dist-server/types/node/permission/index.d.ts +16 -0
  295. package/cli/dist-server/types/node/permission/permission-protocol.d.ts +9 -0
  296. package/cli/dist-server/types/node/permission/sandbox-attribution-analyzer.d.ts +108 -0
  297. package/cli/dist-server/types/node/permission/sandbox-audit-service.d.ts +40 -0
  298. package/cli/dist-server/types/node/permission/sandbox-exec-policy-builtin.d.ts +30 -0
  299. package/cli/dist-server/types/node/permission/sandbox-exec-policy-protocol.d.ts +67 -0
  300. package/cli/dist-server/types/node/permission/sandbox-exec-policy.d.ts +13 -0
  301. package/cli/dist-server/types/node/permission/sandbox-orchestrator-protocol.d.ts +239 -0
  302. package/cli/dist-server/types/node/permission/sandbox-orchestrator.d.ts +308 -0
  303. package/cli/dist-server/types/node/permission/sandbox-permission-gateway.d.ts +36 -0
  304. package/cli/dist-server/types/node/permission/sandbox-telemetry-context.d.ts +27 -0
  305. package/cli/dist-server/types/node/permission/sensitive-command-detector.d.ts +71 -0
  306. package/cli/dist-server/types/node/prewarm/prewarm-protocol.d.ts +296 -0
  307. package/cli/dist-server/types/node/product/api-key-helper-product-provider.d.ts +105 -0
  308. package/cli/dist-server/types/node/product/cli-options-product-provider.d.ts +30 -0
  309. package/cli/dist-server/types/node/product/cloud-pre-product-provider.d.ts +76 -0
  310. package/cli/dist-server/types/node/product/config-watch-service.d.ts +201 -0
  311. package/cli/dist-server/types/node/product/craft-to-cli-agent-models-sync-provider.d.ts +16 -0
  312. package/cli/dist-server/types/node/product/custom-agents-product-provider.d.ts +67 -0
  313. package/cli/dist-server/types/node/product/custom-commands-product-provider.d.ts +49 -0
  314. package/cli/dist-server/types/node/product/custom-product-config-provider.d.ts +6 -0
  315. package/cli/dist-server/types/node/product/index.d.ts +21 -0
  316. package/cli/dist-server/types/node/product/internet-enviroment-product-provider.d.ts +61 -0
  317. package/cli/dist-server/types/node/product/mcp-prompt-product-provider.d.ts +17 -0
  318. package/cli/dist-server/types/node/product/mcp-watch-service.d.ts +31 -0
  319. package/cli/dist-server/types/node/product/models-product-provider.d.ts +41 -0
  320. package/cli/dist-server/types/node/product/plugin-product-provider.d.ts +13 -0
  321. package/cli/dist-server/types/node/product/product-capabilities.d.ts +55 -0
  322. package/cli/dist-server/types/node/product/product-config-controller.d.ts +27 -0
  323. package/cli/dist-server/types/node/product/product-env-service.d.ts +20 -0
  324. package/cli/dist-server/types/node/product/product-identity.d.ts +57 -0
  325. package/cli/dist-server/types/node/product/product-protocol.d.ts +7 -0
  326. package/cli/dist-server/types/node/product/sdk-initialize-product-provider.d.ts +17 -0
  327. package/cli/dist-server/types/node/product/settings-endpoint-product-provider.d.ts +20 -0
  328. package/cli/dist-server/types/node/product/skill-product-provider.d.ts +62 -0
  329. package/cli/dist-server/types/node/references/index.d.ts +2 -0
  330. package/cli/dist-server/types/node/references/reference-protocol.d.ts +20 -0
  331. package/cli/dist-server/types/node/references/reference-service.d.ts +42 -0
  332. package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +288 -0
  333. package/cli/dist-server/types/node/runtime/add-dir-middleware.d.ts +13 -0
  334. package/cli/dist-server/types/node/runtime/cli-capabilities.d.ts +28 -0
  335. package/cli/dist-server/types/node/runtime/external-uri-opener.d.ts +8 -0
  336. package/cli/dist-server/types/node/runtime/file-local-storage.d.ts +17 -0
  337. package/cli/dist-server/types/node/runtime/host-capability-provider.d.ts +57 -0
  338. package/cli/dist-server/types/node/runtime/host-detection.d.ts +34 -0
  339. package/cli/dist-server/types/node/runtime/index.d.ts +8 -0
  340. package/cli/dist-server/types/node/runtime/workspace-folder-manager.d.ts +45 -0
  341. package/cli/dist-server/types/node/runtime/workspace.d.ts +5 -0
  342. package/cli/dist-server/types/node/sandbox-cli/sandbox-backend-support.d.ts +7 -0
  343. package/cli/dist-server/types/node/sandbox-cli/sandbox-cli-lifecycle-protocol.d.ts +109 -0
  344. package/cli/dist-server/types/node/sandbox-cli/sandbox-cli-protocol.d.ts +376 -0
  345. package/cli/dist-server/types/node/sandbox-cli/sandbox-rule-sync-service.d.ts +310 -0
  346. package/cli/dist-server/types/node/sandbox-cli/sandbox-session-preparation.d.ts +49 -0
  347. package/cli/dist-server/types/node/sandbox-cli/sandbox-turn-config.d.ts +32 -0
  348. package/cli/dist-server/types/node/sandbox-cli/threat-domain-checker.d.ts +137 -0
  349. package/cli/dist-server/types/node/security-review/gate.d.ts +13 -0
  350. package/cli/dist-server/types/node/security-review/index.d.ts +2 -0
  351. package/cli/dist-server/types/node/security-review/protocol.d.ts +14 -0
  352. package/cli/dist-server/types/node/sensitive-content/index.d.ts +15 -0
  353. package/cli/dist-server/types/node/sensitive-content/managed-cipher-stream-restorer.d.ts +22 -0
  354. package/cli/dist-server/types/node/sensitive-content/sandbox-center-ipc-client-protocol.d.ts +3 -0
  355. package/cli/dist-server/types/node/sensitive-content/sandbox-center-ipc-client.d.ts +7 -0
  356. package/cli/dist-server/types/node/sensitive-content/sandbox-center-port.d.ts +17 -0
  357. package/cli/dist-server/types/node/sensitive-content/sensitive-approval-port.d.ts +22 -0
  358. package/cli/dist-server/types/node/sensitive-content/sensitive-content-mediation.d.ts +6 -0
  359. package/cli/dist-server/types/node/sensitive-content/sensitive-decision-mediation.d.ts +69 -0
  360. package/cli/dist-server/types/node/sensitive-content/sensitive-history-admission.d.ts +42 -0
  361. package/cli/dist-server/types/node/sensitive-content/sensitive-history-replay.d.ts +6 -0
  362. package/cli/dist-server/types/node/sensitive-content/sensitive-local-sideband.d.ts +21 -0
  363. package/cli/dist-server/types/node/sensitive-content/sensitive-model-boundary.d.ts +22 -0
  364. package/cli/dist-server/types/node/sensitive-content/sensitive-protection-metadata.d.ts +7 -0
  365. package/cli/dist-server/types/node/sensitive-content/sensitive-session-grants.d.ts +41 -0
  366. package/cli/dist-server/types/node/sensitive-content/sensitive-tool-egress-guard.d.ts +7 -0
  367. package/cli/dist-server/types/node/sensitive-content/sensitive-user-input-review.d.ts +7 -0
  368. package/cli/dist-server/types/node/sensitive-content/settings-sensitive-protection-policy.d.ts +14 -0
  369. package/cli/dist-server/types/node/server/types.d.ts +11 -2
  370. package/cli/dist-server/types/node/session/index.d.ts +15 -0
  371. package/cli/dist-server/types/node/session/input-history-service.d.ts +47 -0
  372. package/cli/dist-server/types/node/session/input-item-processors.d.ts +70 -0
  373. package/cli/dist-server/types/node/session/session-abort-middleware.d.ts +22 -0
  374. package/cli/dist-server/types/node/session/session-controller.d.ts +126 -0
  375. package/cli/dist-server/types/node/session/session-history-clean-flag.d.ts +2 -0
  376. package/cli/dist-server/types/node/session/session-history-clean-service.d.ts +49 -0
  377. package/cli/dist-server/types/node/session/session-hook-host-adapter.d.ts +21 -0
  378. package/cli/dist-server/types/node/session/session-host-adapter.d.ts +34 -0
  379. package/cli/dist-server/types/node/session/session-http-protocol.d.ts +1 -0
  380. package/cli/dist-server/types/node/session/session-interruption-host-adapter.d.ts +115 -0
  381. package/cli/dist-server/types/node/session/session-manager-host-adapter.d.ts +100 -0
  382. package/cli/dist-server/types/node/session/session-middleware.d.ts +68 -0
  383. package/cli/dist-server/types/node/session/session-response-host-adapter.d.ts +9 -0
  384. package/cli/dist-server/types/node/session/session-store-host-adapter.d.ts +23 -0
  385. package/cli/dist-server/types/node/session/tasks-controller.d.ts +80 -0
  386. package/cli/dist-server/types/node/settings/current-session-model-transition-protocol.d.ts +23 -0
  387. package/cli/dist-server/types/node/settings/current-session-model-transition.d.ts +15 -0
  388. package/cli/dist-server/types/node/settings/index.d.ts +8 -0
  389. package/cli/dist-server/types/node/settings/settings-controller.d.ts +23 -0
  390. package/cli/dist-server/types/node/settings/settings-manager.d.ts +1 -0
  391. package/cli/dist-server/types/node/settings/settings-protocol.d.ts +4 -0
  392. package/cli/dist-server/types/node/settings/settings-validate-middleware.d.ts +9 -0
  393. package/cli/dist-server/types/node/shell/delegating-shell-service.d.ts +44 -0
  394. package/cli/dist-server/types/node/shell/driver-shell-service.d.ts +8 -0
  395. package/cli/dist-server/types/node/shell/index.d.ts +10 -0
  396. package/cli/dist-server/types/node/shell/language-shim-env.d.ts +11 -0
  397. package/cli/dist-server/types/node/shell/output-spiller.d.ts +39 -0
  398. package/cli/dist-server/types/node/shell/powershell-safe-delete.d.ts +16 -0
  399. package/cli/dist-server/types/node/shell/safe-delete/bulk-guard/contract.d.ts +61 -0
  400. package/cli/dist-server/types/node/shell/safe-delete/bulk-guard/index.d.ts +3 -0
  401. package/cli/dist-server/types/node/shell/safe-delete/bulk-guard/marker.d.ts +5 -0
  402. package/cli/dist-server/types/node/shell/safe-delete/bulk-guard/service.d.ts +12 -0
  403. package/cli/dist-server/types/node/shell/safe-delete/index.d.ts +17 -0
  404. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-attribution.d.ts +16 -0
  405. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-bootstrap.d.ts +1 -0
  406. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-env.d.ts +42 -0
  407. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-report.d.ts +18 -0
  408. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-sandbox-helpers.d.ts +39 -0
  409. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-settings.d.ts +42 -0
  410. package/cli/dist-server/types/node/shell/safe-delete/safe-delete-trash-service.d.ts +12 -0
  411. package/cli/dist-server/types/node/shell/shell-protocol.d.ts +287 -0
  412. package/cli/dist-server/types/node/shell/shell-runtime-paths.d.ts +23 -0
  413. package/cli/dist-server/types/node/shell/shell-service.d.ts +257 -0
  414. package/cli/dist-server/types/node/shell/shell-snapshot-protocol.d.ts +75 -0
  415. package/cli/dist-server/types/node/shell/shell-snapshot-service.d.ts +86 -0
  416. package/cli/dist-server/types/node/shell/terminal-serializer.d.ts +26 -0
  417. package/cli/dist-server/types/node/shell/truncate-buffer.d.ts +24 -0
  418. package/cli/dist-server/types/node/shell/windows-process-utils.d.ts +42 -0
  419. package/cli/dist-server/types/node/shortcut/shortcut-protocol.d.ts +41 -0
  420. package/cli/dist-server/types/node/skills/skill-approval.d.ts +31 -0
  421. package/cli/dist-server/types/node/stats/index.d.ts +5 -0
  422. package/cli/dist-server/types/node/stats/insights-protocol.d.ts +59 -0
  423. package/cli/dist-server/types/node/stats/insights-report-service.d.ts +17 -0
  424. package/cli/dist-server/types/node/stats/session-facet-service.d.ts +46 -0
  425. package/cli/dist-server/types/node/stats/stats-protocol.d.ts +145 -0
  426. package/cli/dist-server/types/node/stats/stats-service.d.ts +48 -0
  427. package/cli/dist-server/types/node/telemetry/cost-protocol.d.ts +67 -0
  428. package/cli/dist-server/types/node/telemetry/cost-service.d.ts +21 -0
  429. package/cli/dist-server/types/node/telemetry/extension-info-processor.d.ts +13 -0
  430. package/cli/dist-server/types/node/telemetry/friction-analysis.d.ts +54 -0
  431. package/cli/dist-server/types/node/telemetry/friction-recall-client.d.ts +15 -0
  432. package/cli/dist-server/types/node/telemetry/host-ide-info-processor.d.ts +11 -0
  433. package/cli/dist-server/types/node/telemetry/index.d.ts +21 -0
  434. package/cli/dist-server/types/node/telemetry/logger/index.d.ts +1 -0
  435. package/cli/dist-server/types/node/telemetry/logger/storage-path-provider.d.ts +4 -0
  436. package/cli/dist-server/types/node/telemetry/plugin-telemetry-protocol.d.ts +68 -0
  437. package/cli/dist-server/types/node/telemetry/plugin-telemetry-service.d.ts +31 -0
  438. package/cli/dist-server/types/node/telemetry/qimei-env-detector.d.ts +16 -0
  439. package/cli/dist-server/types/node/telemetry/sandbox-telemetry-protocol.d.ts +164 -0
  440. package/cli/dist-server/types/node/telemetry/sandbox-telemetry-service.d.ts +181 -0
  441. package/cli/dist-server/types/node/telemetry/startup-profiler.d.ts +32 -0
  442. package/cli/dist-server/types/node/telemetry/status-reporter.d.ts +39 -0
  443. package/cli/dist-server/types/node/telemetry/telemetry-client-carrier.d.ts +14 -0
  444. package/cli/dist-server/types/node/telemetry/telemetry-client-info-event-processor.d.ts +8 -0
  445. package/cli/dist-server/types/node/telemetry/telemetry-protocol.d.ts +137 -0
  446. package/cli/dist-server/types/node/telemetry/telemetry-service.d.ts +115 -0
  447. package/cli/dist-server/types/node/telemetry/turn-baggage-processor.d.ts +23 -0
  448. package/cli/dist-server/types/node/telemetry/vcs-event-processor.d.ts +19 -0
  449. package/cli/dist-server/types/node/tips/builtin-tips.d.ts +2 -0
  450. package/cli/dist-server/types/node/tips/index.d.ts +4 -0
  451. package/cli/dist-server/types/node/tips/tips-manager.d.ts +14 -0
  452. package/cli/dist-server/types/node/tips/tips-protocol.d.ts +42 -0
  453. package/cli/dist-server/types/node/tips/user-state-manager.d.ts +25 -0
  454. package/cli/dist-server/types/node/tool-control/index.d.ts +1 -0
  455. package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +34 -0
  456. package/cli/dist-server/types/node/tools/a2a-cancel-task-tool.d.ts +55 -0
  457. package/cli/dist-server/types/node/tools/a2a-get-agent-card-tool.d.ts +59 -0
  458. package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +334 -0
  459. package/cli/dist-server/types/node/tools/a2a-send-message-tool.d.ts +168 -0
  460. package/cli/dist-server/types/node/tools/a2a-tool-guards.d.ts +48 -0
  461. package/cli/dist-server/types/node/tools/agent-tool.d.ts +202 -0
  462. package/cli/dist-server/types/node/tools/artifact-control-tool.d.ts +103 -0
  463. package/cli/dist-server/types/node/tools/artifact-tool.d.ts +96 -0
  464. package/cli/dist-server/types/node/tools/ask-user-for-structured-input-tool.d.ts +127 -0
  465. package/cli/dist-server/types/node/tools/ask-user-question-tool.d.ts +237 -0
  466. package/cli/dist-server/types/node/tools/audio-transcribe-service.d.ts +61 -0
  467. package/cli/dist-server/types/node/tools/audio-transcribe-tool.d.ts +66 -0
  468. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-allow-filter.d.ts +33 -0
  469. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-classifier-client.d.ts +230 -0
  470. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +51 -0
  471. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-defaults.d.ts +16 -0
  472. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-denial-tracker.d.ts +114 -0
  473. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-permission-service.d.ts +51 -0
  474. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-project-instructions.d.ts +26 -0
  475. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-protocol.d.ts +140 -0
  476. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-settings.d.ts +36 -0
  477. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +21 -0
  478. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-system-prompt-builder.d.ts +28 -0
  479. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-timeout.d.ts +16 -0
  480. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-transcript-limit.d.ts +29 -0
  481. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-transcript.d.ts +50 -0
  482. package/cli/dist-server/types/node/tools/auto-mode/index.d.ts +15 -0
  483. package/cli/dist-server/types/node/tools/auto-mode/permission-mode-policy.d.ts +63 -0
  484. package/cli/dist-server/types/node/tools/bash-output-tool.d.ts +34 -0
  485. package/cli/dist-server/types/node/tools/bash-sandbox-approval-requester.d.ts +55 -0
  486. package/cli/dist-server/types/node/tools/bash-tool.d.ts +211 -0
  487. package/cli/dist-server/types/node/tools/brief-mode-service.d.ts +26 -0
  488. package/cli/dist-server/types/node/tools/channel-tasks-tool.d.ts +174 -0
  489. package/cli/dist-server/types/node/tools/computer-use-tool.d.ts +86 -0
  490. package/cli/dist-server/types/node/tools/create-channel-tool.d.ts +82 -0
  491. package/cli/dist-server/types/node/tools/create-colleague-tool.d.ts +64 -0
  492. package/cli/dist-server/types/node/tools/cron-create-tool.d.ts +46 -0
  493. package/cli/dist-server/types/node/tools/cron-delete-tool.d.ts +28 -0
  494. package/cli/dist-server/types/node/tools/cron-list-tool.d.ts +27 -0
  495. package/cli/dist-server/types/node/tools/defer-execute-tool.d.ts +265 -0
  496. package/cli/dist-server/types/node/tools/defer-tool-config-protocol.d.ts +88 -0
  497. package/cli/dist-server/types/node/tools/defer-tool-config-service.d.ts +23 -0
  498. package/cli/dist-server/types/node/tools/deferred-tool-bridge.d.ts +50 -0
  499. package/cli/dist-server/types/node/tools/delegate-tool.d.ts +71 -0
  500. package/cli/dist-server/types/node/tools/edit-tool.d.ts +83 -0
  501. package/cli/dist-server/types/node/tools/enter-planmode-tool.d.ts +29 -0
  502. package/cli/dist-server/types/node/tools/enter-worktree-tool.d.ts +59 -0
  503. package/cli/dist-server/types/node/tools/exit-planmode-tool.d.ts +86 -0
  504. package/cli/dist-server/types/node/tools/file-change-artifact-publisher.d.ts +82 -0
  505. package/cli/dist-server/types/node/tools/glob-tool.d.ts +102 -0
  506. package/cli/dist-server/types/node/tools/grep-tool.d.ts +141 -0
  507. package/cli/dist-server/types/node/tools/image-edit-tool.d.ts +94 -0
  508. package/cli/dist-server/types/node/tools/image-gen-tool.d.ts +107 -0
  509. package/cli/dist-server/types/node/tools/image-service.d.ts +113 -0
  510. package/cli/dist-server/types/node/tools/index.d.ts +109 -0
  511. package/cli/dist-server/types/node/tools/kill-shell-tool.d.ts +27 -0
  512. package/cli/dist-server/types/node/tools/leave-worktree-tool.d.ts +54 -0
  513. package/cli/dist-server/types/node/tools/library-upload-tool.d.ts +70 -0
  514. package/cli/dist-server/types/node/tools/list-colleagues-tool.d.ts +35 -0
  515. package/cli/dist-server/types/node/tools/list-mcp-resources-tool.d.ts +58 -0
  516. package/cli/dist-server/types/node/tools/lsp-tool.d.ts +68 -0
  517. package/cli/dist-server/types/node/tools/main-agent-meta-tools.d.ts +107 -0
  518. package/cli/dist-server/types/node/tools/memory-tool.d.ts +33 -0
  519. package/cli/dist-server/types/node/tools/message-colleague-tool.d.ts +83 -0
  520. package/cli/dist-server/types/node/tools/monitor-tool.d.ts +216 -0
  521. package/cli/dist-server/types/node/tools/multi-edit-tool.d.ts +109 -0
  522. package/cli/dist-server/types/node/tools/notebook-edit-tool.d.ts +75 -0
  523. package/cli/dist-server/types/node/tools/notebook-read-tool.d.ts +55 -0
  524. package/cli/dist-server/types/node/tools/notebook-write-tool.d.ts +7 -0
  525. package/cli/dist-server/types/node/tools/plan-storage-service.d.ts +68 -0
  526. package/cli/dist-server/types/node/tools/powershell-clm-types.d.ts +30 -0
  527. package/cli/dist-server/types/node/tools/powershell-command-semantics.d.ts +23 -0
  528. package/cli/dist-server/types/node/tools/powershell-dangerous-cmdlets.d.ts +72 -0
  529. package/cli/dist-server/types/node/tools/powershell-destructive-warning.d.ts +12 -0
  530. package/cli/dist-server/types/node/tools/powershell-detection.d.ts +51 -0
  531. package/cli/dist-server/types/node/tools/powershell-git-safety.d.ts +60 -0
  532. package/cli/dist-server/types/node/tools/powershell-security.d.ts +93 -0
  533. package/cli/dist-server/types/node/tools/powershell-tool.d.ts +174 -0
  534. package/cli/dist-server/types/node/tools/produced-artifact-report.d.ts +35 -0
  535. package/cli/dist-server/types/node/tools/push-notification-tool.d.ts +55 -0
  536. package/cli/dist-server/types/node/tools/read-file-state-service.d.ts +27 -0
  537. package/cli/dist-server/types/node/tools/read-mcp-resource-tool.d.ts +71 -0
  538. package/cli/dist-server/types/node/tools/read-tool.d.ts +71 -0
  539. package/cli/dist-server/types/node/tools/repl/index.d.ts +10 -0
  540. package/cli/dist-server/types/node/tools/repl/repl-bridge-broker.d.ts +150 -0
  541. package/cli/dist-server/types/node/tools/repl/repl-bridge-host.d.ts +29 -0
  542. package/cli/dist-server/types/node/tools/repl/repl-catalog-protocol.d.ts +149 -0
  543. package/cli/dist-server/types/node/tools/repl/repl-catalog-render.d.ts +56 -0
  544. package/cli/dist-server/types/node/tools/repl/repl-catalog-source.d.ts +108 -0
  545. package/cli/dist-server/types/node/tools/repl/repl-import-rewrite.d.ts +17 -0
  546. package/cli/dist-server/types/node/tools/repl/repl-protocol.d.ts +210 -0
  547. package/cli/dist-server/types/node/tools/repl/repl-tool.d.ts +142 -0
  548. package/cli/dist-server/types/node/tools/repl/repl-worker-manager.d.ts +103 -0
  549. package/cli/dist-server/types/node/tools/repl/repl-worker-source.d.ts +16 -0
  550. package/cli/dist-server/types/node/tools/repl/repl-worker-source.generated.d.ts +2 -0
  551. package/cli/dist-server/types/node/tools/report-findings-tool.d.ts +97 -0
  552. package/cli/dist-server/types/node/tools/sandbox-approval-review.d.ts +40 -0
  553. package/cli/dist-server/types/node/tools/sandbox-permission-file-tool.d.ts +14 -0
  554. package/cli/dist-server/types/node/tools/sandbox-write-rule-guard.d.ts +126 -0
  555. package/cli/dist-server/types/node/tools/send-message-tool.d.ts +116 -0
  556. package/cli/dist-server/types/node/tools/send-user-message-attachments.d.ts +22 -0
  557. package/cli/dist-server/types/node/tools/send-user-message-tool.d.ts +60 -0
  558. package/cli/dist-server/types/node/tools/shell-stream-pusher.d.ts +25 -0
  559. package/cli/dist-server/types/node/tools/skill-manage-tool.d.ts +77 -0
  560. package/cli/dist-server/types/node/tools/skill-tool.d.ts +129 -0
  561. package/cli/dist-server/types/node/tools/slash-command-tool.d.ts +51 -0
  562. package/cli/dist-server/types/node/tools/space-upload/errors.d.ts +14 -0
  563. package/cli/dist-server/types/node/tools/space-upload/index.d.ts +4 -0
  564. package/cli/dist-server/types/node/tools/space-upload/local-file-source.d.ts +33 -0
  565. package/cli/dist-server/types/node/tools/space-upload/types.d.ts +65 -0
  566. package/cli/dist-server/types/node/tools/space-upload/upload-file.d.ts +27 -0
  567. package/cli/dist-server/types/node/tools/speak-in-channel-tool.d.ts +182 -0
  568. package/cli/dist-server/types/node/tools/structured-output-tool.d.ts +43 -0
  569. package/cli/dist-server/types/node/tools/task-create-tool.d.ts +71 -0
  570. package/cli/dist-server/types/node/tools/task-get-tool.d.ts +31 -0
  571. package/cli/dist-server/types/node/tools/task-list-tool.d.ts +20 -0
  572. package/cli/dist-server/types/node/tools/task-output-tool.d.ts +142 -0
  573. package/cli/dist-server/types/node/tools/task-stop-tool.d.ts +61 -0
  574. package/cli/dist-server/types/node/tools/task-storage-service.d.ts +161 -0
  575. package/cli/dist-server/types/node/tools/task-update-tool.d.ts +79 -0
  576. package/cli/dist-server/types/node/tools/team-create-tool.d.ts +84 -0
  577. package/cli/dist-server/types/node/tools/team-delete-tool.d.ts +38 -0
  578. package/cli/dist-server/types/node/tools/todo-storage-service.d.ts +48 -0
  579. package/cli/dist-server/types/node/tools/todo-write-tool.d.ts +117 -0
  580. package/cli/dist-server/types/node/tools/tool-always-approval-service.d.ts +73 -0
  581. package/cli/dist-server/types/node/tools/tool-argument-rewrite-service.d.ts +4 -0
  582. package/cli/dist-server/types/node/tools/tool-error-codes.d.ts +140 -0
  583. package/cli/dist-server/types/node/tools/tool-hook-manager.d.ts +61 -0
  584. package/cli/dist-server/types/node/tools/tool-manager.d.ts +585 -0
  585. package/cli/dist-server/types/node/tools/tool-permission-service.d.ts +145 -0
  586. package/cli/dist-server/types/node/tools/tool-permission-strategy.d.ts +83 -0
  587. package/cli/dist-server/types/node/tools/tool-protocol.d.ts +2 -0
  588. package/cli/dist-server/types/node/tools/tool-risk-review/content-history-admission.d.ts +10 -0
  589. package/cli/dist-server/types/node/tools/tool-risk-review/content-review.d.ts +56 -0
  590. package/cli/dist-server/types/node/tools/tool-risk-review/execution-approval-adapter.d.ts +11 -0
  591. package/cli/dist-server/types/node/tools/tool-risk-review/index.d.ts +7 -0
  592. package/cli/dist-server/types/node/tools/tool-risk-review/mcp-permission-review.d.ts +15 -0
  593. package/cli/dist-server/types/node/tools/tool-risk-review/mcp-projector.d.ts +5 -0
  594. package/cli/dist-server/types/node/tools/tool-risk-review/permission-metadata.d.ts +8 -0
  595. package/cli/dist-server/types/node/tools/tool-risk-review/projector-registry.d.ts +22 -0
  596. package/cli/dist-server/types/node/tools/tool-risk-review/projectors/index.d.ts +5 -0
  597. package/cli/dist-server/types/node/tools/tool-risk-review/prompt.d.ts +6 -0
  598. package/cli/dist-server/types/node/tools/tool-risk-review/protocol.d.ts +231 -0
  599. package/cli/dist-server/types/node/tools/tool-risk-review/review-context-build.d.ts +2 -0
  600. package/cli/dist-server/types/node/tools/tool-risk-review/review-context.d.ts +42 -0
  601. package/cli/dist-server/types/node/tools/tool-risk-review/review-runtime.d.ts +6 -0
  602. package/cli/dist-server/types/node/tools/tool-risk-review/reviewer-client-impl.d.ts +3 -0
  603. package/cli/dist-server/types/node/tools/tool-risk-review/reviewer-client.d.ts +37 -0
  604. package/cli/dist-server/types/node/tools/tool-risk-review/scope.d.ts +6 -0
  605. package/cli/dist-server/types/node/tools/tool-risk-review/service.d.ts +75 -0
  606. package/cli/dist-server/types/node/tools/tool-risk-review/session-state.d.ts +49 -0
  607. package/cli/dist-server/types/node/tools/tool-risk-review/trusted-builtin-code.d.ts +25 -0
  608. package/cli/dist-server/types/node/tools/tool-search-protocol.d.ts +286 -0
  609. package/cli/dist-server/types/node/tools/tool-search-service.d.ts +137 -0
  610. package/cli/dist-server/types/node/tools/tool-search-tool.d.ts +103 -0
  611. package/cli/dist-server/types/node/tools/tool-spec/agent-tool-defer-overlay-cache.d.ts +45 -0
  612. package/cli/dist-server/types/node/tools/tool-spec/index.d.ts +6 -0
  613. package/cli/dist-server/types/node/tools/tool-spec/legacy-ide-tool-names.d.ts +2 -0
  614. package/cli/dist-server/types/node/tools/tool-spec/tool-defer-overlay.d.ts +70 -0
  615. package/cli/dist-server/types/node/tools/tool-spec/tool-spec-augment.d.ts +17 -0
  616. package/cli/dist-server/types/node/tools/tool-spec/tool-spec-parser.d.ts +38 -0
  617. package/cli/dist-server/types/node/tools/tool-spec/tool-spec-protocol.d.ts +83 -0
  618. package/cli/dist-server/types/node/tools/video-gen-tool.d.ts +88 -0
  619. package/cli/dist-server/types/node/tools/video-service.d.ts +57 -0
  620. package/cli/dist-server/types/node/tools/wait-for-mcp-servers-tool.d.ts +79 -0
  621. package/cli/dist-server/types/node/tools/web-fetch-tool.d.ts +164 -0
  622. package/cli/dist-server/types/node/tools/web-search-tool.d.ts +79 -0
  623. package/cli/dist-server/types/node/tools/wechat-reply-tool.d.ts +43 -0
  624. package/cli/dist-server/types/node/tools/wecom-reply-tool.d.ts +65 -0
  625. package/cli/dist-server/types/node/tools/workflow-background-task.d.ts +54 -0
  626. package/cli/dist-server/types/node/tools/workflow-tool.d.ts +83 -0
  627. package/cli/dist-server/types/node/tools/write-tool.d.ts +80 -0
  628. package/cli/dist-server/types/node/trace/trace-collector-protocol.d.ts +203 -0
  629. package/cli/dist-server/types/node/utils/installation-utils.d.ts +35 -0
  630. package/cli/dist-server/types/node/utils/osc-protocol-utils.d.ts +209 -0
  631. package/cli/dist-server/types/node/utils/process-identity.d.ts +40 -0
  632. package/cli/dist-server/types/node/utils/security-audit-log.d.ts +134 -0
  633. package/cli/dist-server/types/node/utils/terminal-detector-utils.d.ts +78 -0
  634. package/cli/dist-server/types/node/vim/index.d.ts +2 -0
  635. package/cli/dist-server/types/node/vim/vim-manager.d.ts +12 -0
  636. package/cli/dist-server/types/node/vim/vim-protocol.d.ts +24 -0
  637. package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-protocol.d.ts +12 -2
  638. package/cli/dist-server/types/vendor/cbc-core/node/agent/reviewer-recovery.d.ts +7 -0
  639. package/cli/dist-server/types/vendor/cbc-core/node/context/mods-bridge.d.ts +38 -2
  640. package/cli/dist-server/types/vendor/cbc-core/node/session/background-task-protocol.d.ts +14 -0
  641. package/cli/dist-server/types/vendor/cbc-core/node/session/interruption-service.d.ts +4 -0
  642. package/cli/dist-server/types/vendor/cbc-core/node/session/session-hook-host-protocol.d.ts +2 -1
  643. package/cli/dist-server/types/vendor/cbc-core/node/session/session-interruption-host-protocol.d.ts +3 -0
  644. package/cli/dist-server/types/vendor/cbc-core/node/session/session-protocol.d.ts +8 -2
  645. package/cli/dist-server/types/vendor/cbc-core/node/session/session-store.d.ts +59 -7
  646. package/cli/dist-server/types/vendor/cbc-core/node/session/truncation-recovery.d.ts +8 -0
  647. package/cli/dist-server/types/vendor/cbc-core/node/session-title/session-title-utils.d.ts +36 -0
  648. package/cli/dist-server/types/vendor/cbc-core/node/utils/history-utils.d.ts +37 -9
  649. package/cli/dist-server/types/vendor/cbc-core/node/utils/input-item-utils.d.ts +28 -0
  650. package/cli/dist-server/types/vendor/cbc-core/node/utils/message-utils.d.ts +1 -0
  651. package/cli/dist-server/types/vendor/cbc-core/node/utils/model-utils.d.ts +9 -5
  652. package/cli/dist-server/types/vendor/cbc-shared/node/agent/custom-input-item-types.d.ts +20 -0
  653. package/cli/dist-server/types/vendor/cbc-shared/node/agent/openai-agents-types.d.ts +2 -2
  654. package/cli/dist-server/types/vendor/cbc-shared/node/index.d.ts +1 -0
  655. package/cli/dist-server/types/vendor/cbc-shared/node/model/model-errors.d.ts +23 -6
  656. package/cli/dist-server/types/vendor/cbc-shared/node/tools/tool-names.d.ts +2 -0
  657. package/cli/dist-server/types/vendor/cbc-shared/node/utils/concurrency-utils.d.ts +5 -0
  658. package/cli/dist-server/types/workspace/agent-client-protocol/lib/common/prompt-codec.d.ts +2 -0
  659. package/cli/dist-server/types/workspace/agent-client-protocol/lib/common/security-review-reason-code.d.ts +0 -10
  660. package/cli/dist-server/types/workspace/cbc-checkpoint/lib/node/checkpoint/checkpoint-path-utils.d.ts +10 -0
  661. package/cli/dist-server/types/workspace/cbc-checkpoint/lib/node/checkpoint/checkpoint-service.d.ts +2 -0
  662. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-protocol.d.ts +12 -2
  663. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/reviewer-recovery.d.ts +7 -0
  664. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/mods-bridge.d.ts +38 -2
  665. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/background-task-protocol.d.ts +14 -0
  666. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/interruption-service.d.ts +4 -0
  667. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-hook-host-protocol.d.ts +2 -1
  668. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-interruption-host-protocol.d.ts +3 -0
  669. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-protocol.d.ts +8 -2
  670. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-store.d.ts +59 -7
  671. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/truncation-recovery.d.ts +8 -0
  672. package/cli/dist-server/types/workspace/cbc-core/lib/node/session-title/session-title-utils.d.ts +36 -0
  673. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/history-utils.d.ts +37 -9
  674. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/input-item-utils.d.ts +28 -0
  675. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/message-utils.d.ts +1 -0
  676. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/model-utils.d.ts +9 -5
  677. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-parser.d.ts +34 -0
  678. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-protocol.d.ts +191 -0
  679. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-scheduler-service.d.ts +131 -0
  680. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-scheduler.d.ts +20 -0
  681. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-state-manager.d.ts +50 -0
  682. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-storage.d.ts +61 -0
  683. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/cron-task-session.d.ts +1 -0
  684. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/index.d.ts +8 -0
  685. package/cli/dist-server/types/workspace/cbc-cron/lib/node/cron/loop-skill-provider.d.ts +36 -0
  686. package/cli/dist-server/types/workspace/cbc-cron/lib/node/index.d.ts +10 -0
  687. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/bg-session-handler.d.ts +88 -0
  688. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-auto-restart.d.ts +61 -0
  689. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-channel-autoconnect.d.ts +28 -0
  690. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-enhancements-lifecycle.d.ts +45 -0
  691. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-process.d.ts +77 -0
  692. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-protocol.d.ts +324 -0
  693. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-service.d.ts +45 -0
  694. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/index.d.ts +10 -0
  695. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/session-registry.d.ts +39 -0
  696. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/system-service.d.ts +60 -0
  697. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/wake-detector.d.ts +47 -0
  698. package/cli/dist-server/types/workspace/cbc-daemon/lib/node/index.d.ts +11 -0
  699. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-format.d.ts +25 -0
  700. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-policy.d.ts +55 -0
  701. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-protocol.d.ts +204 -0
  702. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-service.d.ts +353 -0
  703. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-session-start-hook.d.ts +25 -0
  704. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/goal-utils.d.ts +23 -0
  705. package/cli/dist-server/types/workspace/cbc-goal/lib/node/goal/index.d.ts +6 -0
  706. package/cli/dist-server/types/workspace/cbc-goal/lib/node/index.d.ts +12 -0
  707. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/index.d.ts +35 -0
  708. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/builtin/index.d.ts +14 -0
  709. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/builtin/sec-default.d.ts +32 -0
  710. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/builtin/telemetry.d.ts +43 -0
  711. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/enable-flag.d.ts +41 -0
  712. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/engine-builder.d.ts +61 -0
  713. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/hooks-registry.d.ts +188 -0
  714. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/index.d.ts +6 -0
  715. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/mods-runtime.d.ts +101 -0
  716. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/op-table.d.ts +37 -0
  717. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/pattern.d.ts +20 -0
  718. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/core-handler.d.ts +78 -0
  719. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/host-bindings.d.ts +215 -0
  720. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/index.d.ts +6 -0
  721. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/plugin-store.d.ts +22 -0
  722. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/render-component.d.ts +115 -0
  723. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/render-registry.d.ts +99 -0
  724. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/host/terminal-play.d.ts +56 -0
  725. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/index.d.ts +9 -0
  726. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/legacy-adapter/fan-out.d.ts +23 -0
  727. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/legacy-adapter/hook-result-mapper.d.ts +27 -0
  728. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/legacy-adapter/index.d.ts +2 -0
  729. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/bootstrap.d.ts +104 -0
  730. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/bundle-cache.d.ts +59 -0
  731. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/index.d.ts +8 -0
  732. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/isolated-import.d.ts +20 -0
  733. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/load-mod.d.ts +151 -0
  734. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/manifest-dir.d.ts +33 -0
  735. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/mounted-import.d.ts +12 -0
  736. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/ts-runtime.d.ts +64 -0
  737. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/types-emitter.d.ts +105 -0
  738. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/testing/harness.d.ts +84 -0
  739. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/testing/index.d.ts +1 -0
  740. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events/agent.d.ts +188 -0
  741. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events/command.d.ts +114 -0
  742. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events/prompt.d.ts +310 -0
  743. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events/tool.d.ts +308 -0
  744. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events/upstream.d.ts +8777 -0
  745. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/events.d.ts +651 -0
  746. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/types/index.d.ts +1 -0
  747. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/concurrency.d.ts +1 -0
  748. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/dependency-resolver.d.ts +43 -0
  749. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/directory-plugin-cache-projection.d.ts +2 -0
  750. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/guards/index.d.ts +2 -0
  751. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/guards/weixinpay-integrity-guard.d.ts +48 -0
  752. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/index.d.ts +42 -0
  753. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/installers/git-plugin-installer.d.ts +42 -0
  754. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/installers/git-subdir-plugin-installer.d.ts +19 -0
  755. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/installers/index.d.ts +4 -0
  756. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/installers/local-plugin-installer.d.ts +40 -0
  757. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/installers/npm-plugin-installer.d.ts +23 -0
  758. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/agent-loader.d.ts +43 -0
  759. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/command-loader.d.ts +39 -0
  760. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/hook-loader.d.ts +55 -0
  761. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/index.d.ts +8 -0
  762. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/lsp-loader.d.ts +47 -0
  763. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/mcp-loader.d.ts +75 -0
  764. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/output-style-loader.d.ts +49 -0
  765. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/plugin-loader-manager.d.ts +73 -0
  766. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/loaders/skill-loader.d.ts +45 -0
  767. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplace-name-validator.d.ts +50 -0
  768. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplace-path-safety.d.ts +86 -0
  769. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/base-marketplace.d.ts +48 -0
  770. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +47 -0
  771. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/directory-marketplace.d.ts +19 -0
  772. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/git-availability-detector.d.ts +62 -0
  773. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/git-fallback-coordinator.d.ts +42 -0
  774. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +50 -0
  775. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/github-marketplace.d.ts +41 -0
  776. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/http-marketplace.d.ts +47 -0
  777. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/index.d.ts +13 -0
  778. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/marketplace-config-manager.d.ts +43 -0
  779. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/marketplace-factory.d.ts +12 -0
  780. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/marketplace-storage.d.ts +142 -0
  781. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/marketplace-update-checker.d.ts +41 -0
  782. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/marketplaces/zip-marketplace.d.ts +150 -0
  783. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/mcpb-handler.d.ts +29 -0
  784. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-controller.d.ts +77 -0
  785. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-environment.d.ts +36 -0
  786. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-error-collector.d.ts +17 -0
  787. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-install-stats-service.d.ts +20 -0
  788. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-manager.d.ts +765 -0
  789. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-mcp-snapshot.d.ts +63 -0
  790. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-options-storage.d.ts +87 -0
  791. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-policy-service.d.ts +55 -0
  792. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-protocol.d.ts +1567 -0
  793. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-read-summary.d.ts +61 -0
  794. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-runtime-refresh-service.d.ts +262 -0
  795. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/plugin-validator.d.ts +48 -0
  796. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/session-plugin-snapshot.d.ts +5 -0
  797. package/cli/dist-server/types/workspace/cbc-plugins/lib/node/plugins/zip-utils.d.ts +94 -0
  798. package/cli/dist-server/types/workspace/cbc-shared/lib/node/agent/custom-input-item-types.d.ts +20 -0
  799. package/cli/dist-server/types/workspace/cbc-shared/lib/node/agent/openai-agents-types.d.ts +2 -2
  800. package/cli/dist-server/types/workspace/cbc-shared/lib/node/index.d.ts +1 -0
  801. package/cli/dist-server/types/workspace/cbc-shared/lib/node/model/model-errors.d.ts +23 -6
  802. package/cli/dist-server/types/workspace/cbc-shared/lib/node/tools/tool-names.d.ts +2 -0
  803. package/cli/dist-server/types/workspace/cbc-shared/lib/node/utils/concurrency-utils.d.ts +5 -0
  804. package/cli/dist-server/types/workspace/code-ratio/lib/common/code-ratio-protocol.d.ts +124 -0
  805. package/cli/dist-server/types/workspace/code-ratio/lib/common/code-ratio-reporter.d.ts +57 -0
  806. package/cli/dist-server/types/workspace/code-ratio/lib/common/diff/unified-diff.d.ts +37 -0
  807. package/cli/dist-server/types/workspace/code-ratio/lib/common/feature-gate.d.ts +59 -0
  808. package/cli/dist-server/types/workspace/code-ratio/lib/common/filters/file-filter.d.ts +41 -0
  809. package/cli/dist-server/types/workspace/code-ratio/lib/common/index.d.ts +6 -0
  810. package/cli/dist-server/types/workspace/code-ratio/lib/common/vcs-repo-resolver-protocol.d.ts +50 -0
  811. package/cli/dist-server/types/workspace/product/lib/common/index.d.ts +1 -0
  812. package/cli/dist-server/types/workspace/product/lib/common/repo-params.d.ts +14 -0
  813. package/cli/dist-server/types/workspace/product/lib/common/types/features.d.ts +69 -44
  814. package/cli/dist-server/types/workspace/product/lib/common/types/language-model.d.ts +6 -1
  815. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/protocol.generated.d.ts +392 -0
  816. package/cli/dist-server/types/workspace/sandbox-cli/lib/node/file-policy.d.ts +48 -0
  817. package/cli/dist-server/types/workspace/sandbox-cli/lib/node/resolver.d.ts +95 -0
  818. package/cli/dist-server/types/workspace/sandbox-cli/lib/node/sandbox-cli-client.d.ts +78 -0
  819. package/cli/dist-server/types/workspace/telemetry/lib/common/event/types/security-review.d.ts +35 -6
  820. package/cli/dist-server/types/workspace/telemetry/lib/common/tracing/index.d.ts +1 -1
  821. package/cli/dist-server/types/workspace/telemetry/lib/common/tracing/otel-env.d.ts +1 -0
  822. package/cli/package.json +1 -1
  823. package/cli/product.cloudhosted.json +1 -1
  824. package/cli/product.internal.json +1 -1
  825. package/cli/product.ioa.json +1 -1
  826. package/cli/product.json +1 -1
  827. package/cli/product.selfhosted.json +1 -1
  828. package/docs/client.md +62 -0
  829. package/docs/in-process.md +151 -14
  830. package/docs/server.md +40 -1
  831. package/executor/lib/capsule/THIRD_PARTY_LICENSES.md +2 -2
  832. package/executor/lib/capsule/entry.mjs +8 -8
  833. package/executor/lib/capsule/manifest.json +2 -2
  834. package/executor/lib/private-protocol.cjs +33 -2
  835. package/executor/lib/private-protocol.d.cts +21 -1
  836. package/executor/lib/types.d.cts +15 -0
  837. package/lib/agent/v2.d.ts +1 -1
  838. package/lib/agent/v2.js +1 -1
  839. package/lib/application/services.d.ts +13 -1
  840. package/lib/application/services.js +1 -1
  841. package/lib/cli/main.js +3 -3
  842. package/lib/client/rpc.d.ts +16 -0
  843. package/lib/components/functional-hooks.d.mts +4 -0
  844. package/lib/components/functional-hooks.mjs +1 -0
  845. package/lib/harness/create-harness.js +1 -1
  846. package/lib/harness/hooks.d.ts +8 -0
  847. package/lib/harness/hooks.js +1 -0
  848. package/lib/harness/runtime.js +1 -1
  849. package/lib/harness/types.d.ts +7 -2
  850. package/lib/integration/agent-integration.d.ts +5 -1
  851. package/lib/integration/agent-integration.js +1 -1
  852. package/lib/integration/client-mcp-attachment.d.ts +5 -1
  853. package/lib/integration/client-mcp-attachment.js +1 -1
  854. package/lib/integration/executor-supervisor.d.ts +10 -1
  855. package/lib/integration/executor-supervisor.js +1 -1
  856. package/lib/integration/session-mcp-scope.d.ts +5 -1
  857. package/lib/integration/session-mcp-scope.js +1 -1
  858. package/lib/integration/session-mcp-view.d.ts +6 -1
  859. package/lib/integration/session-mcp-view.js +1 -1
  860. package/lib/mcp-server/module.d.ts +22 -2
  861. package/lib/mcp-server/module.js +1 -1
  862. package/lib/mcp-server/rpcs.d.ts +174 -123
  863. package/lib/mcp-server/rpcs.js +1 -1
  864. package/lib/mcp-server/schemas.d.ts +33 -0
  865. package/lib/mcp-server/schemas.js +1 -1
  866. package/lib/protocol/rpc.d.ts +73 -3
  867. package/lib/public.d.ts +1 -1
  868. package/package.json +24 -20
@@ -1,4 +1,6 @@
1
+ import { Context, Layer } from 'effect';
1
2
  import type { QueryOptions } from '#agent-harness-codebuddy/server';
3
+ import type { HarnessHooks } from '#agent-harness-components/functional-hooks';
2
4
  import { composeAgentHarnessModules } from '../module/compose.js';
3
5
  import { type AgentHarnessClientIdentity } from '../runtime/client-identity.js';
4
6
  import { CodeBuddyProcessContainment } from '../runtime/process-containment.js';
@@ -18,6 +20,7 @@ export interface ApplicationServicesOptions {
18
20
  readonly sandboxCenter?: SandboxCenterOption;
19
21
  readonly signal?: AbortSignal;
20
22
  readonly tools?: QueryOptions['tools'];
23
+ readonly hooks?: HarnessHooks;
21
24
  readonly strictMcpConfig: boolean;
22
25
  readonly mcp?: {
23
26
  readonly toolsSyncTtlMs?: number | null;
@@ -32,5 +35,14 @@ export interface ApplicationServices {
32
35
  readonly containment: CodeBuddyProcessContainment;
33
36
  readonly runtimeShutdown: AbortController;
34
37
  readonly recordLifecycle: RuntimeLifecycleRecorder;
38
+ /** Stop protocol admission and drain modules; the application Scope releases its dependencies. */
39
+ close(reason?: unknown): Promise<void>;
35
40
  }
36
- export declare function createApplicationServices({ clientIdentity, clientIdentityEnv, dependencies, packageVersion, processRuntime, productConfig, sandboxCenter, tools, strictMcpConfig, mcp, shutdown, telemetryOptions, signal, }: ApplicationServicesOptions): Promise<ApplicationServices>;
41
+ declare const Application_base: Context.ServiceClass<Application, "@genie/agent-harness/application/Application", ApplicationServices>;
42
+ /** The shared composition root for the CLI and embedded Harness. */
43
+ export declare class Application extends Application_base {
44
+ static layer(options: ApplicationServicesOptions): Layer.Layer<Application, unknown>;
45
+ }
46
+ /** Promise boundary shared by both hosts. No Effect types escape the public Harness API. */
47
+ export declare function createApplicationServices(options: ApplicationServicesOptions): Promise<ApplicationServices>;
48
+ export {};
@@ -1 +1 @@
1
- var Ve=Object.defineProperty;var t=(E,H)=>Ve(E,"name",{value:H,configurable:!0});import{homedir as we}from"node:os";import*as k from"node:path";import{isDeepStrictEqual as Xe}from"node:util";import{Context as d,Effect as m,Exit as y,Layer as s,Logger as u,Option as Qe,Scope as h}from"effect";import{WORKBUDDY_ENABLE_LINUX_SANDBOX_CLI as Ae}from"#agent-harness-components/sandbox";import{createAgentProtocolModule as Je}from"../agent/router.js";import{createAgentV2Facade as Ze}from"../agent/v2.js";import{ManagedAuthLocal as $e}from"../auth/local.js";import{ManagedAuth as er}from"../auth/managed.js";import{createAuthProtocolModule as rr}from"../auth/module.js";import{Checkpoints as _e}from"../checkpoint/service.js";import{ConfigFiles as re}from"../config/files.js";import{createDefaultAgentMcpIntegration as tr}from"../integration/agent-integration.js";import{PluginMcp as be}from"../integration/plugin-mcp.js";import{UserMcp as ke}from"../integration/user-mcp.js";import{requestWithEnvironment as or}from"../internal/http.js";import{createMcpServerProtocolModule as nr}from"../mcp-server/module.js";import{composeAgentHarnessModules as ir}from"../module/compose.js";import{PluginComponents as te}from"../plugin/components.js";import{createProductProtocolModule as ar}from"../product/module.js";import{preflightCodeBuddyCode as sr}from"../runtime/agent-runtime.js";import{buildAgentHarnessClientIdentityEnv as cr,buildAgentHarnessClientIdentityHeaders as dr}from"../runtime/client-identity.js";import{createCodeBuddyAuthRuntime as ur}from"../runtime/codebuddy-auth.js";import{createCodeBuddyProductLifecycle as pr}from"../runtime/codebuddy-product.js";import{DEFAULT_HOST_HEALTH_TIMEOUT_MS as mr,DEFAULT_READY_TIMEOUT_MS as lr}from"../runtime/codebuddy-resource-timeouts.js";import{CodeBuddyProcessContainment as fr}from"../runtime/process-containment.js";import{parseAgentHarnessProductConfig as hr,parseHarnessProductInput as gr}from"../runtime/product-config.js";import{ProductManager as yr}from"../runtime/product-manager.js";import{ProductResolver as De}from"../runtime/product-resolver.js";import{ProductResolverRequestError as Er}from"../runtime/product-resolver-error.js";import{loadProductSource as Sr}from"../runtime/product-source.js";import{HarnessSandboxCenter as vr}from"../runtime/sandbox-center.js";import{AgentHarnessServer as Cr,DEFAULT_LIFECYCLE_HOOK_TIMEOUT_MS as Pr}from"../server/index.js";import{makeServiceRpcs as wr}from"../server/rpc-services.js";import{AgentBackend as Ar,workspaceQueryOptions as _r}from"../session/agent-backend.js";import{AgentServer as Ie}from"../session/agent-server.js";import{readSessionConfigDefaults as br}from"../session/config-defaults.js";import{SessionConfigStore as kr}from"../session/config-store.js";import{SessionFiles as Dr}from"../session/files.js";import{localFs as Me}from"../session/local-fs.js";import{SessionReplay as Le}from"../session/replay.js";import{SessionRuntime as Ir}from"../session/runtime.js";import{Sessions as Te}from"../session/service.js";import{toExecutorPrivateProxyPolicy as Oe}from"../settings/proxy-policy.js";import{createHarnessSettingsRuntime as Mr}from"../settings/runtime.js";import{Settings as Lr}from"../settings/service.js";import{createSubagentProtocolModule as Tr}from"../subagent/module.js";import{createEffectTelemetryMetricAggregator as Or}from"../telemetry/effect-metric-aggregation.js";import{createTelemetry as Rr}from"../telemetry/runtime.js";import{measureStartup as oe,startupProfiler as i}from"../telemetry/startup-profile.js";import{closeInPhases as ne,closeTelemetry as Fr,createCloseOnce as _,DEFAULT_TELEMETRY_CLOSE_TIMEOUT_MS as xr}from"./lifecycle.js";export async function createApplicationServices({clientIdentity:E,clientIdentityEnv:H,dependencies:v,packageVersion:Re,processRuntime:g,productConfig:O,sandboxCenter:Fe,tools:ie,strictMcpConfig:xe,mcp:Ue,shutdown:B,telemetryOptions:ae,signal:p}){p?.throwIfAborted();const C=t(r=>m.runPromise(r,{signal:p}),"runStartupEffect"),z=B,se={name:"@genie/agent-harness",title:"Agent Harness",version:Re},ce=(v.preflightCodeBuddyCode??sr)(),D=new fr,R=new AbortController,l=Rr(ae),W=_(()=>Fr(l,g,Math.max(1,Math.min(B.remainingMs(),ae.flushTimeoutMs??xr))));B.registerTelemetryCloser(W);const de=Or(r=>l.recordEffectMetrics(r));try{g.addFinalizer(W)}catch(r){throw await W(),r}try{g.setTelemetryObserver({log:t(r=>l.recordEffectLog(r),"log"),metrics:t(r=>de.record("harness",r),"metrics"),span:t(r=>l.recordEffectSpan(r),"span")})}catch{}const b=t(r=>l.recordLifecycle(r),"recordLifecycle"),F=new vr(process.env.CODEBUDDY_CONFIG_DIR?.trim()?k.resolve(process.env.CODEBUDDY_CONFIG_DIR.trim()):k.join(we(),".codebuddy"),Fe,process.env.SANDBOX_CENTER_IPC_ADDRESS?.trim()),N=_(()=>F.close());g.addFinalizer(N);let ue=!1;const Y=t((r,c,T)=>{ue||(ue=!0,b({component:"server",error:r,phase:"runtime",process:{pid:process.pid},reason:T,state:c}))},"recordRootFailure");D.signal.addEventListener("abort",()=>{Y(D.signal.reason,"containment_tripped","containment_failed")},{once:!0});const He={log(r){try{l.recordEffectLog(r)}catch{}},metrics(r){de.record("executor",r)},span(r){try{l.recordEffectSpan(r)}catch{}}};let P,n,x,I,a,A,M,w;const L=h.makeUnsafe(),G=_(r=>m.runPromise(h.close(L,r===void 0?y.void:y.fail(r))));g.addFinalizer(()=>G(void 0));const j=t(()=>{x&&m.runPromise(m.forkIn(x.prepare,L,{startImmediately:!0})).catch(()=>{})},"prepareRuntime"),pe=h.makeUnsafe(),q=_(async r=>{try{await a?.close(r)}finally{await m.runPromise(h.close(pe,r===void 0?y.void:y.fail(r)))}});g.addFinalizer(()=>q(void 0));const K=h.makeUnsafe(),V=_(r=>m.runPromise(h.close(K,r===void 0?y.void:y.fail(r))));g.addFinalizer(()=>V(void 0));const me=h.makeUnsafe(),X=_(r=>m.runPromise(h.close(me,r===void 0?y.void:y.fail(r))));g.addFinalizer(()=>X(void 0));const le=h.makeUnsafe(),Q=_(async r=>{try{await n?.close(r)}finally{await m.runPromise(h.close(le,r===void 0?y.void:y.fail(r)))}});g.addFinalizer(()=>Q(void 0));try{const r={...process.env},c={...H,...F.environment},T=typeof O=="object"?gr(O):Sr(O,{parse:hr});p?.throwIfAborted(),i()?.markStart("harness.product");const Be=await C(s.buildWithScope(De.layer({projection:T.projection,baseConfiguration:O===void 0?void 0:{},packageRoot:ce.productRoot??k.dirname(ce.packageJsonPath),clientIdentity:{ideName:E.ideName,ideType:E.ideType,ideVersion:E.ideVersion,...E.userAgent===void 0?{}:{userAgent:E.userAgent}},environment:t(()=>({...r,...c}),"environment")}),pe));a=await(v.createProductManager??((e,o)=>yr.create(e,o)))({bootstrap:T.bootstrap,projection:T.projection,resolver:d.get(Be,De)},p),i()?.markEnd("harness.product");const ze=t(()=>{if(!a)throw new Error("Product manager is not ready");return a.getLaunchSnapshot()},"productLaunch");p?.throwIfAborted(),i()?.markStart("harness.config");const We=await C(s.buildWithScope(re.layer.pipe(s.provide(u.layer([u.withConsoleError(u.formatLogFmt)]))),K));i()?.markEnd("harness.config");const J=d.get(We,re),he=t((e,o)=>br(J,e,o),"sessionConfigDefaults");p?.throwIfAborted(),i()?.markStart("harness.settings"),A=await(v.createSettingsRuntime??Mr)({ambientEnvironment:r,config:J,environment:c,observe:t(e=>l.recordEffectLog({annotations:{component:"harness",operation:"refresh",reason:e.reason,resource:"policy","runtime.role":"harness",status:e.status,...e.policy===void 0?{}:{mode:e.policy.mode,noProxyCount:e.policy.noProxyCount,proxyConfigured:e.policy.proxyConfigured,proxySupport:e.policy.proxySupport,revision:e.policy.revision}},level:e.status==="failed"?"warn":"info",message:"harness.settings.proxy"}),"observe"),processRuntime:g}),i()?.markEnd("harness.settings");const ge=kr.layer(k.join(r.CODEBUDDY_CONFIG_DIR?.trim()?k.resolve(r.CODEBUDDY_CONFIG_DIR.trim()):k.join(we(),".codebuddy"),"harness","sessions"));p?.throwIfAborted(),i()?.markStart("harness.session-runtime");const ye=process.platform==="linux"?r[Ae]??((await import("#agent-harness-components/session-config")).isLinuxSandboxCLIInstalled()?"1":"0"):void 0,Ee=await C(s.buildWithScope(v.sessionRuntimeLayer??Ar({checkpoints:!0,headers:dr(E),prepareSandboxCenter:t((e,o)=>F.prepare(e.account?.uid,o),"prepareSandboxCenter"),resolveOptions:t(e=>m.map(_r(e),o=>({...o,...ie===void 0?{}:{tools:ie}})),"resolveOptions"),resolveConfigDefaults:t(e=>m.tryPromise({try:t(()=>he(e.workspace?.canonicalCwd??e.cwd??process.cwd(),e.signal),"try"),catch:t(o=>o,"catch")}),"resolveConfigDefaults")}).pipe(s.provideMerge(Ie.layer({product:{},fs:Me,settingSources:["user","project","local"],env:{...cr(E),CODEBUDDY_API_KEY_DISABLED:"1",CODEBUDDY_REMOTE_CONFIG_DISABLED:"1",CODEBUDDY_INCLUDE_TOPIC_MESSAGE:"true",...ye===void 0?{}:{[Ae]:ye},...F.environment,CODEBUDDY_CODE_DISABLE_FILE_CHECKPOINTING:r.CODEBUDDY_CODE_DISABLE_FILE_CHECKPOINTING??"0"}})),s.provide(ge)),L));i()?.markEnd("harness.session-runtime"),x=d.get(Ee,Ir),p?.throwIfAborted(),i()?.markStart("harness.replay");const Ne=d.get(await C(s.buildWithScope(Le.layer({},e=>Me.readFileBuffer(e),he).pipe(s.provide(ge)),L)),Le);i()?.markEnd("harness.replay"),p?.throwIfAborted(),i()?.markStart("harness.storage");const Se=await C(s.buildWithScope(s.mergeAll(Te.layer,_e.layer).pipe(s.provide(Dr.layer),s.provide(u.layer([u.withConsoleError(u.formatLogFmt)]))),L));i()?.markEnd("harness.storage");const Ye=d.get(Se,Te),Ge=d.get(Se,_e);I=(v.createMcpIntegration??(e=>tr({containment:e.containment,recordEffectTelemetry:e.recordEffectTelemetry,recordLifecycle:e.recordLifecycle,supervisor:{environment:e.environment,toolsSyncTtlMs:Ue?.toolsSyncTtlMs,proxyPolicy:e.proxyPolicy}})))({containment:D,environment:c,proxyPolicy:Oe(A.currentProxyPolicy,c),recordEffectTelemetry:He,recordLifecycle:b}),M=A.subscribe(e=>{const o=Oe(e,c);I?.configureProxy?.(o).catch(()=>{l.recordEffectLog({annotations:{component:"harness",operation:"update",resource:"policy","runtime.role":"harness",status:"failed"},level:"warn",message:"harness.settings.proxy"})})});const ve=Qe.getOrUndefined(d.getOption(Ee,Ie));p?.throwIfAborted(),i()?.markStart("harness.mcp-services");const Z=await C(s.buildWithScope(s.mergeAll(ke.layer({environment:t(()=>({...r,...c}),"environment")}),be.layer).pipe(s.provideMerge(te.layer({environment:t(()=>({...r,...c}),"environment"),product:t(()=>a.getConfiguration(),"product"),writeContext:t(async()=>{await n?.prepareHostExecution(R.signal);const e=t(()=>({environment:{...r,...c},product:structuredClone(a.getConfiguration()),authentication:n?.currentSessionAuthentication()}),"capture");return n?n.runConsistentRead(e):e()},"writeContext"),onConfigChange:ve?async(e,o)=>{const f=o.authentication;ve.notifyConfigChange({source:e.source,filePath:e.file_path,cwd:e.cwd},{product:o.product,environment:o.environment,fetch:t((ee,U)=>or(ee,U,o.environment),"fetch"),auth:f?{accessToken:f.credential.accessToken,method:f.credential.type,refresh:t(async({signal:ee})=>{if(!n||!a)throw new Error("Hook authentication is unavailable");const U=t(()=>{if(!Xe(o.product,a.getConfiguration()))throw new Error("Hook Product changed")},"checkProduct");await n.runConsistentRead(U);const Pe=await n.refreshHostAuthentication(f,ee);return await n.runConsistentRead(U),{accessToken:Pe.credential.accessToken,method:Pe.credential.type}},"refresh")}:void 0,account:f?{uid:f.account.id,enterpriseId:f.account.organization?.id}:void 0}).catch(()=>m.runSync(m.logWarning("harness.config-change.failed").pipe(m.provide(u.layer([u.withConsoleError(u.formatLogFmt)])))))}:void 0,reloadUserConfig:t(e=>P?.reloadUserConfig(e)??Promise.resolve(),"reloadUserConfig")})),s.provide(u.layer([u.withConsoleError(u.formatLogFmt)]))),me));i()?.markEnd("harness.mcp-services"),p?.throwIfAborted(),i()?.markStart("harness.agent-facade"),P=await(v.createAgentFacade??Ze)({userMcp:d.get(Z,ke),pluginMcp:d.get(Z,be),checkpoints:Ge,sessions:Ye,initialProductGeneration:ze().productGeneration,mcpIntegration:I,strictMcpConfig:xe,onPermanentFailure:t(e=>{Y(e,"fused","recovery_failed"),R.abort(e)},"onPermanentFailure"),prepareSessionRuntime:t((e,o)=>{if(!n)throw new Error("Authentication runtime is not ready");return n.prepareSessionRuntime(e,o.connectionSignal)},"prepareSessionRuntime"),prepareSessionWorkspace:t(async(e,o)=>{if(!n||!a)throw new Error("Product manager is not ready");try{return await a.prepareWorkspace(e,{signal:o})}catch(f){if(!(f instanceof Er&&f.code==="AUTH_REFRESH_REQUIRED"))throw f;return await n.refreshProductAuthentication(o),a.prepareWorkspace(e,{force:!0,signal:o})}},"prepareSessionWorkspace"),releaseSessionWorkspace:t((e,o)=>a?a.releaseWorkspace(e,o):Promise.resolve(),"releaseSessionWorkspace"),refreshAuthentication:t((e,o)=>{if(!n)throw new Error("Authentication runtime is not ready");return n.refreshAuthentication(e,{signal:o?.signal??AbortSignal.abort(new Error("Authentication refresh has no operation signal"))})},"refreshAuthentication"),serverInfo:se,sessionRuntime:x,sessionReplay:Ne}),i()?.markEnd("harness.agent-facade");const Ce=pr({facade:P,onExecutionProductCommitted:j,product:a});p?.throwIfAborted(),i()?.markStart("harness.auth-service");const je=await C(s.buildWithScope(v.managedAuthLayer??$e({...a.resolveLoginProduct?{resolveLoginProduct:t((e,o)=>a.resolveLoginProduct(e,o),"resolveLoginProduct")}:{},environment:t(()=>({...r,...c}),"environment"),product:t(()=>a.getConfiguration(),"product")}).pipe(s.provide(u.layer([u.withConsoleError(u.formatLogFmt)]))),le));i()?.markEnd("harness.auth-service"),n=ur({consumer:P,getAuthMethods:t(()=>a.getAuthMethods(),"getAuthMethods"),managedAuth:d.get(je,er),onRuntimePreparing:j,onRuntimePrepared:j,productLifecycle:Ce});const S=await rr(n);n.bindProtocolBridge(S.bridge);const $=ar({selectConnectionProductProfile:t((e,o)=>n.selectConnectionProductProfile(e,o),"selectConnectionProductProfile"),provisionProduct:t((e,o)=>S.runAuthMutation(()=>n.provisionProduct(e,o),{signal:o.signal}),"provisionProduct"),readProduct:t((e,o)=>n.readProduct(e,o),"readProduct"),provisionWorkspaceProduct:t((e,o)=>S.runAuthMutation(()=>n.provisionWorkspaceProduct(e,o),{signal:o.signal}),"provisionWorkspaceProduct"),readWorkspaceProduct:t((e,o)=>a.readWorkspaceProduct(e,o),"readWorkspaceProduct")});a.bindPublisher({notifyProductUpdated:t(()=>$.publisher.notifyProductUpdated(Ce.currentProductSnapshot()),"notifyProductUpdated"),notifyWorkspaceProductUpdated:t(e=>$.publisher.notifyWorkspaceProductUpdated(e),"notifyWorkspaceProductUpdated")});const qe=d.empty().pipe(d.add(Lr,A),d.add(re,J),d.add(te,d.get(Z,te)));p?.throwIfAborted(),i()?.markStart("harness.rpc-services");const Ke=await C(m.provide(wr.pipe(h.provide(K)),qe));i()?.markEnd("harness.rpc-services"),w=ir([{name:"private-runtime-lifecycle",capabilities:{},initialize:t(async(e,o)=>{await oe("harness.initialize.settings",()=>A?.initialize(o.connectionSignal))},"initialize"),close:t(async e=>{M?.(),M=void 0,await X(e),await A?.close(e),await ne([[()=>G(e),()=>I?.close(e)??Promise.resolve()],[()=>N()],[()=>q(e)]],z,"private runtime shutdown")},"close")},Je({v2:P}),nr({backend:P}),Tr({backend:P}),$,{name:S.name,capabilities:S.capabilities,initialize:t(async(e,o)=>oe("harness.initialize.auth",()=>S.initialize(e,o)),"initialize"),initialized:S.initialized,notificationHandlers:S.notificationHandlers,requestHandlers:S.requestHandlers,close:Q},{...Ke,close:V}])}catch(r){throw M?.(),M=void 0,b({component:"server",error:r,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),await ne([[()=>V(r)],[()=>Q(r)],[()=>P?.close(r)??Promise.resolve(),()=>G(r)],[()=>I?.close(r)??Promise.resolve()],[()=>X(r)],[()=>A?.close(r)??Promise.resolve()],[()=>N()],[()=>q(r)]],z,"module startup cleanup").catch(()=>{}),r}let fe;try{p?.throwIfAborted(),fe=(v.createServer??(r=>new Cr(r)))({serverInfo:se,capabilities:w.capabilities,initializeHookTimeoutMs:lr+mr+Pr,initialize:t(async(r,c)=>(i()?.markEnd("harness.wait-initialize"),oe("harness.initialize",()=>w.initialize(r,c))),"initialize"),initialized:w.initialized,notificationHandlers:w.notificationHandlers,onContainmentFailure:t(r=>{Y(r,"containment_tripped","containment_failed"),R.abort(r)},"onContainmentFailure"),readinessSignal:D.signal,requestHandlers:w.requestHandlers,telemetryRuntime:l})}catch(r){b({component:"server",error:r,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"});try{await ne([[()=>w.close(r)]],z,"server construction cleanup")}catch(c){b({component:"server",error:c,phase:"cleanup",process:{pid:process.pid},reason:"cleanup_failed",state:"shutdown_failed"})}throw r}return{server:fe,modules:w,telemetry:l,containment:D,runtimeShutdown:R,recordLifecycle:b}}t(createApplicationServices,"createApplicationServices");
1
+ var ir=Object.defineProperty;var t=(l,P)=>ir(l,"name",{value:P,configurable:!0});import{homedir as Le}from"node:os";import*as I from"node:path";import{isDeepStrictEqual as ar}from"node:util";import{Cause as Te,Context as d,Effect as a,Exit as h,Layer as p,Logger as ie,Option as sr,Scope as m}from"effect";import{WORKBUDDY_ENABLE_LINUX_SANDBOX_CLI as xe}from"#agent-harness-components/sandbox";import{createAgentProtocolModule as cr}from"../agent/router.js";import{createAgentV2Facade as dr}from"../agent/v2.js";import{ManagedAuthLocal as ur}from"../auth/local.js";import{ManagedAuth as pr}from"../auth/managed.js";import{createAuthProtocolModule as mr}from"../auth/module.js";import{Checkpoints as Oe}from"../checkpoint/service.js";import{ConfigFiles as ae}from"../config/files.js";import{HostHooks as Ue}from"../harness/hooks.js";import{createDefaultAgentMcpIntegration as lr}from"../integration/agent-integration.js";import{PluginMcp as He}from"../integration/plugin-mcp.js";import{UserMcp as Fe}from"../integration/user-mcp.js";import{requestWithEnvironment as fr}from"../internal/http.js";import{createMcpServerProtocolModule as hr}from"../mcp-server/module.js";import{composeAgentHarnessModules as gr}from"../module/compose.js";import{PluginComponents as se}from"../plugin/components.js";import{createProductProtocolModule as yr}from"../product/module.js";import{preflightCodeBuddyCode as vr}from"../runtime/agent-runtime.js";import{buildAgentHarnessClientIdentityEnv as Er,buildAgentHarnessClientIdentityHeaders as Sr}from"../runtime/client-identity.js";import{createCodeBuddyAuthRuntime as Pr}from"../runtime/codebuddy-auth.js";import{createCodeBuddyProductLifecycle as Cr}from"../runtime/codebuddy-product.js";import{DEFAULT_HOST_HEALTH_TIMEOUT_MS as wr,DEFAULT_READY_TIMEOUT_MS as Ar}from"../runtime/codebuddy-resource-timeouts.js";import{CodeBuddyProcessContainment as kr}from"../runtime/process-containment.js";import{parseAgentHarnessProductConfig as _r,parseHarnessProductInput as br}from"../runtime/product-config.js";import{ProductManager as Dr}from"../runtime/product-manager.js";import{ProductResolver as Be}from"../runtime/product-resolver.js";import{ProductResolverRequestError as Mr}from"../runtime/product-resolver-error.js";import{loadProductSource as Ir}from"../runtime/product-source.js";import{HarnessSandboxCenter as Rr}from"../runtime/sandbox-center.js";import{AgentHarnessServer as Lr,DEFAULT_LIFECYCLE_HOOK_TIMEOUT_MS as Tr}from"../server/index.js";import{makeServiceRpcs as xr}from"../server/rpc-services.js";import{AgentBackend as Or,workspaceQueryOptions as Ur}from"../session/agent-backend.js";import{AgentServer as ze}from"../session/agent-server.js";import{readSessionConfigDefaults as Hr}from"../session/config-defaults.js";import{SessionConfigStore as Fr}from"../session/config-store.js";import{SessionFiles as Br}from"../session/files.js";import{localFs as Ne}from"../session/local-fs.js";import{SessionReplay as We}from"../session/replay.js";import{SessionRuntime as zr}from"../session/runtime.js";import{Sessions as Ye}from"../session/service.js";import{toExecutorPrivateProxyPolicy as qe}from"../settings/proxy-policy.js";import{createHarnessSettingsRuntime as Nr}from"../settings/runtime.js";import{Settings as Wr}from"../settings/service.js";import{createSubagentProtocolModule as Yr}from"../subagent/module.js";import{createEffectTelemetryMetricAggregator as qr}from"../telemetry/effect-metric-aggregation.js";import{createTelemetry as Gr}from"../telemetry/runtime.js";import{measureStartup as ce,startupProfiler as s}from"../telemetry/startup-profile.js";import{closeInPhases as H,closeTelemetry as jr,createCloseOnce as k,DEFAULT_TELEMETRY_CLOSE_TIMEOUT_MS as Kr,withNativeShutdownTimeout as Vr}from"./lifecycle.js";const F=ie.layer([ie.withConsoleError(ie.formatLogFmt)]);export class Application extends d.Service()("@genie/agent-harness/application/Application"){static{t(this,"Application")}static layer(P){return p.fromBuildMemo((f,R)=>a.gen(function*(){const g=yield*a.tryPromise({try:t(()=>Xr(P,R,f),"try"),catch:t(b=>b,"catch")});return d.make(Application,g)}).pipe(a.uninterruptible))}}export async function createApplicationServices(l){const P=m.makeUnsafe(),f=k(g=>a.runPromise(m.close(P,g===void 0?h.void:h.fail(g)))),R=l.processRuntime.addFinalizer(()=>f());try{return d.get(await a.runPromise(p.buildWithScope(Application.layer(l),P)),Application)}catch(g){throw await H([[()=>f(g)]],l.shutdown,"application acquisition cleanup").then(R,()=>{}),g}}t(createApplicationServices,"createApplicationServices");async function Xr({clientIdentity:l,clientIdentityEnv:P,dependencies:f,packageVersion:R,processRuntime:g,productConfig:b,sandboxCenter:Ge,tools:de,hooks:je,strictMcpConfig:Ke,mcp:Ve,shutdown:D,telemetryOptions:ue,signal:u},pe,me){u?.throwIfAborted();const le=t(async e=>{const i=await a.runPromiseExit(e,{signal:u});if(h.isSuccess(i))return i.value;throw u?.aborted&&Te.hasInterruptsOnly(i.cause)?u.reason:Te.squash(i.cause)},"runStartupEffect"),C=t((e,i)=>le(p.buildWithMemoMap(e,me,i)),"build"),w=t(e=>a.runSync(m.addFinalizerExit(pe,()=>a.promise(()=>Vr(Promise.resolve().then(e),Math.max(1,Math.min(D.phaseMs,D.remainingMs())),"application resource release")))),"addFinalizer"),Y=D,fe={name:"@genie/agent-harness",title:"Agent Harness",version:R},he=(f.preflightCodeBuddyCode??vr)(),L=new kr,B=new AbortController,y=Gr(ue),q=k(()=>jr(y,g,Math.max(1,Math.min(D.remainingMs(),ue.flushTimeoutMs??Kr))));D.registerTelemetryCloser(q);const ge=qr(e=>y.recordEffectMetrics(e));try{w(q)}catch(e){throw await q(),e}try{g.setTelemetryObserver({log:t(e=>y.recordEffectLog(e),"log"),metrics:t(e=>ge.record("harness",e),"metrics"),span:t(e=>y.recordEffectSpan(e),"span")})}catch{}const M=t(e=>y.recordLifecycle(e),"recordLifecycle"),z=new Rr(process.env.CODEBUDDY_CONFIG_DIR?.trim()?I.resolve(process.env.CODEBUDDY_CONFIG_DIR.trim()):I.join(Le(),".codebuddy"),Ge,process.env.SANDBOX_CENTER_IPC_ADDRESS?.trim()),G=k(()=>z.close());w(G);let ye=!1;const j=t((e,i,U)=>{ye||(ye=!0,M({component:"server",error:e,phase:"runtime",process:{pid:process.pid},reason:U,state:i}))},"recordRootFailure");L.signal.addEventListener("abort",()=>{j(L.signal.reason,"containment_tripped","containment_failed")},{once:!0});const Xe={log(e){try{y.recordEffectLog(e)}catch{}},metrics(e){ge.record("executor",e)},span(e){try{y.recordEffectSpan(e)}catch{}}};let A,n,N,T,c,_,x,E;const ve=d.get(await C(Ue.layer(je??(()=>{})),pe),Ue),O=m.makeUnsafe(),K=k(e=>a.runPromise(m.close(O,e===void 0?h.void:h.fail(e))));w(()=>K(void 0));const V=t(()=>{N&&a.runPromise(a.forkIn(N.prepare,O,{startImmediately:!0})).catch(()=>{})},"prepareRuntime"),Ee=m.makeUnsafe(),X=k(async e=>{try{await c?.close(e)}finally{await a.runPromise(m.close(Ee,e===void 0?h.void:h.fail(e)))}});w(()=>X(void 0));const Q=m.makeUnsafe(),J=k(e=>a.runPromise(m.close(Q,e===void 0?h.void:h.fail(e))));w(()=>J(void 0));const Se=m.makeUnsafe(),Z=k(e=>a.runPromise(m.close(Se,e===void 0?h.void:h.fail(e))));w(()=>Z(void 0));const Pe=m.makeUnsafe(),$=k(async e=>{try{await n?.close(e)}finally{await a.runPromise(m.close(Pe,e===void 0?h.void:h.fail(e)))}});w(()=>$(void 0));try{const e={...process.env},i={...P,...z.environment},U=typeof b=="object"?br(b):Ir(b,{parse:_r});u?.throwIfAborted(),s()?.markStart("harness.product");const Qe=await C(Be.layer({projection:U.projection,baseConfiguration:b===void 0?void 0:{},packageRoot:he.productRoot??I.dirname(he.packageJsonPath),clientIdentity:{ideName:l.ideName,ideType:l.ideType,ideVersion:l.ideVersion,...l.userAgent===void 0?{}:{userAgent:l.userAgent}},environment:t(()=>({...e,...i}),"environment")}),Ee);c=await(f.createProductManager??((r,o)=>Dr.create(r,o)))({bootstrap:U.bootstrap,projection:U.projection,resolver:d.get(Qe,Be)},u),s()?.markEnd("harness.product");const Je=t(()=>{if(!c)throw new Error("Product manager is not ready");return c.getLaunchSnapshot()},"productLaunch");u?.throwIfAborted(),s()?.markStart("harness.config");const Ze=await C(ae.layer.pipe(p.provide(F)),Q);s()?.markEnd("harness.config");const re=d.get(Ze,ae),Ae=t((r,o)=>Hr(re,r,o),"sessionConfigDefaults");u?.throwIfAborted(),s()?.markStart("harness.settings"),_=await(f.createSettingsRuntime??Nr)({ambientEnvironment:e,config:re,environment:i,observe:t(r=>y.recordEffectLog({annotations:{component:"harness",operation:"refresh",reason:r.reason,resource:"policy","runtime.role":"harness",status:r.status,...r.policy===void 0?{}:{mode:r.policy.mode,noProxyCount:r.policy.noProxyCount,proxyConfigured:r.policy.proxyConfigured,proxySupport:r.policy.proxySupport,revision:r.policy.revision}},level:r.status==="failed"?"warn":"info",message:"harness.settings.proxy"}),"observe"),processRuntime:g}),s()?.markEnd("harness.settings");const ke=Fr.layer(I.join(e.CODEBUDDY_CONFIG_DIR?.trim()?I.resolve(e.CODEBUDDY_CONFIG_DIR.trim()):I.join(Le(),".codebuddy"),"harness","sessions"));u?.throwIfAborted(),s()?.markStart("harness.session-runtime");const _e=process.platform==="linux"?e[xe]??((await import("#agent-harness-components/session-config")).isLinuxSandboxCLIInstalled()?"1":"0"):void 0,be=await C(f.sessionRuntimeLayer??Or({checkpoints:!0,headers:Sr(l),prepareSandboxCenter:t((r,o)=>z.prepare(r.account?.uid,o),"prepareSandboxCenter"),resolveOptions:t(r=>a.map(Ur(r),o=>({...o,...de===void 0?{}:{tools:de},...ve===void 0?{}:{mods:ve.bridge}})),"resolveOptions"),resolveConfigDefaults:t(r=>a.tryPromise({try:t(()=>Ae(r.workspace?.canonicalCwd??r.cwd??process.cwd(),r.signal),"try"),catch:t(o=>o,"catch")}),"resolveConfigDefaults")}).pipe(p.provideMerge(ze.layer({product:{},fs:Ne,settingSources:["user","project","local"],env:{...Er(l),CODEBUDDY_API_KEY_DISABLED:"1",CODEBUDDY_REMOTE_CONFIG_DISABLED:"1",CODEBUDDY_INCLUDE_TOPIC_MESSAGE:"true",..._e===void 0?{}:{[xe]:_e},...z.environment,CODEBUDDY_CODE_DISABLE_FILE_CHECKPOINTING:e.CODEBUDDY_CODE_DISABLE_FILE_CHECKPOINTING??"0"}})),p.provide(ke)),O);s()?.markEnd("harness.session-runtime"),N=d.get(be,zr),u?.throwIfAborted(),s()?.markStart("harness.replay");const $e=d.get(await C(We.layer({},r=>Ne.readFileBuffer(r),Ae).pipe(p.provide(ke)),O),We);s()?.markEnd("harness.replay"),u?.throwIfAborted(),s()?.markStart("harness.storage");const De=await C(p.mergeAll(Ye.layer,Oe.layer).pipe(p.provide(Br.layer),p.provide(F)),O);s()?.markEnd("harness.storage");const er=d.get(De,Ye),rr=d.get(De,Oe);T=(f.createMcpIntegration??(r=>lr({containment:r.containment,recordEffectTelemetry:r.recordEffectTelemetry,recordLifecycle:r.recordLifecycle,supervisor:{environment:r.environment,toolsSyncTtlMs:Ve?.toolsSyncTtlMs,proxyPolicy:r.proxyPolicy}})))({containment:L,environment:i,proxyPolicy:qe(_.currentProxyPolicy,i),recordEffectTelemetry:Xe,recordLifecycle:M}),x=_.subscribe(r=>{const o=qe(r,i);T?.configureProxy?.(o).catch(()=>{y.recordEffectLog({annotations:{component:"harness",operation:"update",resource:"policy","runtime.role":"harness",status:"failed"},level:"warn",message:"harness.settings.proxy"})})});const Me=sr.getOrUndefined(d.getOption(be,ze));u?.throwIfAborted(),s()?.markStart("harness.mcp-services");const te=await C(p.mergeAll(Fe.layer({environment:t(()=>({...e,...i}),"environment")}),He.layer).pipe(p.provideMerge(se.layer({environment:t(()=>({...e,...i}),"environment"),product:t(()=>c.getConfiguration(),"product"),writeContext:t(async()=>{await n?.prepareHostExecution(B.signal);const r=t(()=>({environment:{...e,...i},product:structuredClone(c.getConfiguration()),authentication:n?.currentSessionAuthentication()}),"capture");return n?n.runConsistentRead(r):r()},"writeContext"),onConfigChange:Me?async(r,o)=>{const v=o.authentication;Me.notifyConfigChange({source:r.source,filePath:r.file_path,cwd:r.cwd},{product:o.product,environment:o.environment,fetch:t((ne,W)=>fr(ne,W,o.environment),"fetch"),auth:v?{accessToken:v.credential.accessToken,method:v.credential.type,refresh:t(async({signal:ne})=>{if(!n||!c)throw new Error("Hook authentication is unavailable");const W=t(()=>{if(!ar(o.product,c.getConfiguration()))throw new Error("Hook Product changed")},"checkProduct");await n.runConsistentRead(W);const Re=await n.refreshHostAuthentication(v,ne);return await n.runConsistentRead(W),{accessToken:Re.credential.accessToken,method:Re.credential.type}},"refresh")}:void 0,account:v?{uid:v.account.id,enterpriseId:v.account.organization?.id}:void 0}).catch(()=>a.runSync(a.logWarning("harness.config-change.failed").pipe(a.provide(F))))}:void 0,reloadUserConfig:t(r=>A?.reloadUserConfig(r)??Promise.resolve(),"reloadUserConfig")})),p.provide(F)),Se);s()?.markEnd("harness.mcp-services"),u?.throwIfAborted(),s()?.markStart("harness.agent-facade"),A=await(f.createAgentFacade??dr)({userMcp:d.get(te,Fe),pluginMcp:d.get(te,He),checkpoints:rr,sessions:er,initialProductGeneration:Je().productGeneration,mcpIntegration:T,strictMcpConfig:Ke,onPermanentFailure:t(r=>{j(r,"fused","recovery_failed"),B.abort(r)},"onPermanentFailure"),prepareSessionRuntime:t((r,o)=>{if(!n)throw new Error("Authentication runtime is not ready");return n.prepareSessionRuntime(r,o.connectionSignal)},"prepareSessionRuntime"),prepareSessionWorkspace:t(async(r,o)=>{if(!n||!c)throw new Error("Product manager is not ready");try{return await c.prepareWorkspace(r,{signal:o})}catch(v){if(!(v instanceof Mr&&v.code==="AUTH_REFRESH_REQUIRED"))throw v;return await n.refreshProductAuthentication(o),c.prepareWorkspace(r,{force:!0,signal:o})}},"prepareSessionWorkspace"),releaseSessionWorkspace:t((r,o)=>c?c.releaseWorkspace(r,o):Promise.resolve(),"releaseSessionWorkspace"),refreshAuthentication:t((r,o)=>{if(!n)throw new Error("Authentication runtime is not ready");return n.refreshAuthentication(r,{signal:o?.signal??AbortSignal.abort(new Error("Authentication refresh has no operation signal"))})},"refreshAuthentication"),serverInfo:fe,sessionRuntime:N,sessionReplay:$e}),s()?.markEnd("harness.agent-facade");const Ie=Cr({facade:A,onExecutionProductCommitted:V,product:c});u?.throwIfAborted(),s()?.markStart("harness.auth-service");const tr=await C(f.managedAuthLayer??ur({...c.resolveLoginProduct?{resolveLoginProduct:t((r,o)=>c.resolveLoginProduct(r,o),"resolveLoginProduct")}:{},environment:t(()=>({...e,...i}),"environment"),product:t(()=>c.getConfiguration(),"product")}).pipe(p.provide(F)),Pe);s()?.markEnd("harness.auth-service"),n=Pr({consumer:A,getAuthMethods:t(()=>c.getAuthMethods(),"getAuthMethods"),managedAuth:d.get(tr,pr),onRuntimePreparing:V,onRuntimePrepared:V,productLifecycle:Ie});const S=await mr(n);n.bindProtocolBridge(S.bridge);const oe=yr({selectConnectionProductProfile:t((r,o)=>n.selectConnectionProductProfile(r,o),"selectConnectionProductProfile"),provisionProduct:t((r,o)=>S.runAuthMutation(()=>n.provisionProduct(r,o),{signal:o.signal}),"provisionProduct"),readProduct:t((r,o)=>n.readProduct(r,o),"readProduct"),provisionWorkspaceProduct:t((r,o)=>S.runAuthMutation(()=>n.provisionWorkspaceProduct(r,o),{signal:o.signal}),"provisionWorkspaceProduct"),readWorkspaceProduct:t((r,o)=>c.readWorkspaceProduct(r,o),"readWorkspaceProduct")});c.bindPublisher({notifyProductUpdated:t(()=>oe.publisher.notifyProductUpdated(Ie.currentProductSnapshot()),"notifyProductUpdated"),notifyWorkspaceProductUpdated:t(r=>oe.publisher.notifyWorkspaceProductUpdated(r),"notifyWorkspaceProductUpdated")});const or=d.empty().pipe(d.add(Wr,_),d.add(ae,re),d.add(se,d.get(te,se)));u?.throwIfAborted(),s()?.markStart("harness.rpc-services");const nr=await le(a.provide(xr.pipe(m.provide(Q),a.provideService(p.CurrentMemoMap,me)),or));s()?.markEnd("harness.rpc-services"),E=gr([{name:"private-runtime-lifecycle",capabilities:{},initialize:t(async(r,o)=>{await ce("harness.initialize.settings",()=>_?.initialize(o.connectionSignal))},"initialize"),close:t(async r=>{x?.(),x=void 0,await Z(r),await _?.close(r),await H([[()=>K(r),()=>T?.close(r)??Promise.resolve()],[()=>G()],[()=>X(r)]],Y,"private runtime shutdown")},"close")},cr({v2:A}),hr({backend:A}),Yr({backend:A}),oe,{name:S.name,capabilities:S.capabilities,initialize:t(async(r,o)=>ce("harness.initialize.auth",()=>S.initialize(r,o)),"initialize"),initialized:S.initialized,notificationHandlers:S.notificationHandlers,requestHandlers:S.requestHandlers,close:$},{...nr,close:J}])}catch(e){throw x?.(),x=void 0,M({component:"server",error:e,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),await H([[()=>J(e)],[()=>$(e)],[()=>A?.close(e)??Promise.resolve(),()=>K(e)],[()=>T?.close(e)??Promise.resolve()],[()=>Z(e)],[()=>_?.close(e)??Promise.resolve()],[()=>G()],[()=>X(e)]],Y,"module startup cleanup").catch(()=>{}),e}let ee;try{u?.throwIfAborted(),ee=(f.createServer??(e=>new Lr(e)))({serverInfo:fe,capabilities:E.capabilities,initializeHookTimeoutMs:Ar+wr+Tr,initialize:t(async(e,i)=>(s()?.markEnd("harness.wait-initialize"),ce("harness.initialize",()=>E.initialize(e,i))),"initialize"),initialized:E.initialized,notificationHandlers:E.notificationHandlers,onContainmentFailure:t(e=>{j(e,"containment_tripped","containment_failed"),B.abort(e)},"onContainmentFailure"),readinessSignal:L.signal,requestHandlers:E.requestHandlers,telemetryRuntime:y})}catch(e){M({component:"server",error:e,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"});try{await H([[()=>E.close(e)]],Y,"server construction cleanup")}catch(i){M({component:"server",error:i,phase:"cleanup",process:{pid:process.pid},reason:"cleanup_failed",state:"shutdown_failed"})}throw e}let Ce;const we=t(e=>Ce??=H([[()=>ee.close(e),()=>E.close(e)]],D,"application services shutdown"),"close");return w(()=>Ce?Promise.resolve():we()),{server:ee,modules:E,telemetry:y,containment:L,runtimeShutdown:B,recordLifecycle:M,close:we}}t(Xr,"acquireApplicationServices");
package/lib/cli/main.js CHANGED
@@ -1,3 +1,3 @@
1
- var x=Object.defineProperty;var c=(e,t)=>x(e,"name",{value:t,configurable:!0});import{readFileSync as $}from"node:fs";import{homedir as N}from"node:os";import*as v from"node:path";import{closeAll as B,closeHarnessProcessRuntime as P,closeInPhases as S,closeWithLifecycleTelemetry as F,createCloseOnce as _,resolveShutdownCoordinator as J,runUntilClosed as L,withNativeShutdownTimeout as V}from"../application/lifecycle.js";import{createApplicationServices as j}from"../application/services.js";import{buildAgentHarnessClientIdentityEnv as W,resolveAgentHarnessClientIdentity as z}from"../runtime/client-identity.js";import{createDailyJsonlFileSink as U}from"../telemetry/daily-jsonl-file-sink.js";import{startupProfiler as O}from"../telemetry/startup-profile.js";import{createBearerTokenAuthenticator as Y,createSignedBearerTokenAuthenticator as q}from"../transport/auth.js";import{parseAgentHarnessListenAddress as G}from"../transport/listen.js";import{createAgentHarnessNetworkListener as K}from"../transport/network.js";import{serveStdio as Q}from"../transport/stdio.js";import{parseAgentHarnessCliOptions as X}from"./options.js";import{traceShutdown as D}from"./shutdown-diagnostics.js";export function resolveAgentHarnessProgramConfig(e,t={}){const r=X(e),s=t.packageVersion??ne();if(r.help||r.version)return{cli:r,packageVersion:s};const o=(t.parseListenAddress??G)(r.listen);return Z(r,o),{cli:r,listen:o,packageVersion:s}}c(resolveAgentHarnessProgramConfig,"resolveAgentHarnessProgramConfig");export async function startAgentHarnessProgramApplication(e,t={},r={}){if(e.listen===void 0||e.listen.kind==="off")throw new Error("Agent Harness application cannot start without a listener");const s=J(t),o=r.processRuntime===void 0,n=r.processRuntime??await(t.createProcessRuntime??(await import("../effect-runtime/process-runtime.mjs")).createHarnessProcessRuntime)();try{const a=ee({cli:e.cli,dependencies:t,listen:e.listen,packageVersion:e.packageVersion,processRuntime:n,shutdown:s,stderr:t.stderr??process.stderr});let i;return{close:c((f,p)=>(i??=te(a,f,p),i),"close"),running:a.running}}catch(a){if(!o)throw a;s.start();try{await P(n,s)}catch(i){throw new AggregateError([a,i],"Agent Harness startup and cleanup both failed")}throw a}}c(startAgentHarnessProgramApplication,"startAgentHarnessProgramApplication");export async function runAgentHarnessCli(e=process.argv.slice(2),t={}){const[{Effect:r},{makeHarnessCliMain:s}]=await Promise.all([import("effect"),import("./program.mjs")]);await r.runPromise(s(e,t))}c(runAgentHarnessCli,"runAgentHarnessCli");function Z(e,t){if((t.kind==="stdio"||t.kind==="off")&&e.wsAuth!==void 0)throw new Error(`--ws-auth cannot be used with ${t.address}`);if((t.kind==="stdio"||t.kind==="off")&&e.allowedOrigins.length>0)throw new Error(`--allowed-origin cannot be used with ${t.address}`);if(t.kind==="npipe"&&e.wsAuth===void 0)throw new Error("Windows named-pipe listeners require --ws-auth");if(t.kind!=="streamable-http"&&t.kind!=="websocket"&&e.allowInsecureRemote)throw new Error(`--allow-insecure-remote cannot be used with ${t.address}`)}c(Z,"validateHarnessListenOptions");function ee({cli:e,dependencies:t,listen:r,packageVersion:s,processRuntime:o,shutdown:n,stderr:a}){const i=new AbortController,f=new Error("Agent Harness is shutting down"),p=o.run(async g=>{let d;e.wsAuth==="capability-token"?d=await(t.createTokenAuthenticator??Y)({tokenFile:e.wsTokenFile,tokenSha256:e.wsTokenSha256}):e.wsAuth==="signed-bearer-token"&&(d=await(t.createSignedTokenAuthenticator??q)({audience:e.wsAudience,issuer:e.wsIssuer,maxClockSkewSeconds:e.wsMaxClockSkewSeconds,sharedSecretFile:e.wsSharedSecretFile}));const k=z(e.clientIdentity,s);await re({allowInsecureRemote:e.allowInsecureRemote,allowedOrigins:e.allowedOrigins,authenticator:d,clientIdentity:k,clientIdentityEnv:W(k),dependencies:t,gracefulShutdownSignal:i.signal,listen:r,logDir:e.logDir,packageVersion:s,processRuntime:o,processSignal:g,productConfig:e.productConfig,strictMcpConfig:e.strictMcpConfig,shutdown:n,stderr:a})});return p.catch(()=>{}),{closeReason:f,closeSignal:i,processRuntime:o,running:p,shutdown:n}}c(ee,"startHarnessApplication");async function te(e,t,r){D("application","started"),e.shutdown.start(),e.closeSignal.abort(e.closeReason);let s,o=!1;try{const i=Math.max(1,e.shutdown.remainingMs());await V(e.running,i,"application shutdown")}catch(i){s=i,o=!0}let n,a=!1;try{await P(e.processRuntime,e.shutdown,t)}catch(i){n=i,a=!0}if(!r&&o&&a)throw new AggregateError([s,n],"Agent Harness runtime and cleanup both failed");if(!r&&o)throw s;if(a)throw n;D("application","completed")}c(te,"closeHarnessApplication");async function re({allowInsecureRemote:e,allowedOrigins:t,authenticator:r,clientIdentity:s,clientIdentityEnv:o,dependencies:n,listen:a,logDir:i,packageVersion:f,processRuntime:p,processSignal:g,gracefulShutdownSignal:d,productConfig:k,strictMcpConfig:M,shutdown:C,stderr:H}){const w=C,{server:m,modules:A,telemetry:E,containment:T,runtimeShutdown:R,recordLifecycle:h}=await j({clientIdentity:s,clientIdentityEnv:o,dependencies:n,packageVersion:f,processRuntime:p,productConfig:k,strictMcpConfig:M,shutdown:C,telemetryOptions:se(n,i)});if(O()?.markEvent("harness-services-ready"),O()?.markStart("harness.wait-initialize","Transport setup and wait for first initialize"),a.kind==="stdio"){let l;try{l=(n.serveStdio??Q)(m)}catch(u){throw await S([[()=>m.close(u),()=>A.close(u)]],w,"stdio construction cleanup").catch(()=>{}),h({component:"server",error:u,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),u}const I=_(u=>l.close(u));h({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),await L(l.closed,u=>F(E,()=>B([()=>I(u),()=>m.close(u),()=>A.close(u)],w,"stdio shutdown")),n.signalTarget,d,[T.signal,R.signal,g],{forceClose:c(u=>I(u),"forceClose"),timeouts:w}),h({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"});return}let y;try{y=await(n.createNetworkListener??K)({acceptor:m,allowInsecureRemote:e,allowedOrigins:t,listen:a,authenticator:r,onWarning:c(l=>H.write(`[agent-harness] warning: ${l}
2
- `),"onWarning")})}catch(l){throw await S([[()=>m.close(l),()=>A.close(l)]],w,"listener construction cleanup").catch(()=>{}),h({component:"server",error:l,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),l}H.write(`[agent-harness] listening on ${y.address}
3
- `);const b=_(()=>y.close());h({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),await L(y.closed,l=>F(E,()=>S([[()=>m.close(l),()=>A.close(l)],[()=>b()]],w,"network shutdown")),n.signalTarget,d,[T.signal,R.signal,g],{forceClose:c(()=>b(),"forceClose"),timeouts:w}),h({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"})}c(re,"runAgentHarnessCliRuntime");function se(e,t){if(e.telemetry!==void 0)return e.telemetry;if(process.env.DISABLE_TELEMETRY)return{};try{const r=process.env.CODEBUDDY_CONFIG_DIR?.trim(),s=t??v.join(r?v.resolve(r):v.join(N(),".codebuddy"),"logs","harness");return{sink:(e.createTelemetryFileSink??U)({directory:s})}}catch{return{}}}c(se,"resolveCliTelemetry");function ne(){const e=v.resolve(import.meta.dirname,"../../package.json"),t=JSON.parse($(e,"utf8"));if(typeof t.version!="string"||t.version.length===0)throw new Error(`Agent Harness package version is missing in ${e}`);return t.version}c(ne,"readPackageVersion");
1
+ var M=Object.defineProperty;var c=(e,t)=>M(e,"name",{value:t,configurable:!0});import{readFileSync as x}from"node:fs";import{homedir as $}from"node:os";import*as y from"node:path";import{closeAll as N,closeHarnessProcessRuntime as I,closeInPhases as B,closeWithLifecycleTelemetry as P,createCloseOnce as F,resolveShutdownCoordinator as J,runUntilClosed as _,withNativeShutdownTimeout as V}from"../application/lifecycle.js";import{createApplicationServices as j}from"../application/services.js";import{buildAgentHarnessClientIdentityEnv as W,resolveAgentHarnessClientIdentity as z}from"../runtime/client-identity.js";import{createDailyJsonlFileSink as U}from"../telemetry/daily-jsonl-file-sink.js";import{startupProfiler as L}from"../telemetry/startup-profile.js";import{createBearerTokenAuthenticator as Y,createSignedBearerTokenAuthenticator as q}from"../transport/auth.js";import{parseAgentHarnessListenAddress as G}from"../transport/listen.js";import{createAgentHarnessNetworkListener as K}from"../transport/network.js";import{serveStdio as Q}from"../transport/stdio.js";import{parseAgentHarnessCliOptions as X}from"./options.js";import{traceShutdown as O}from"./shutdown-diagnostics.js";export function resolveAgentHarnessProgramConfig(e,t={}){const r=X(e),s=t.packageVersion??ne();if(r.help||r.version)return{cli:r,packageVersion:s};const a=(t.parseListenAddress??G)(r.listen);return Z(r,a),{cli:r,listen:a,packageVersion:s}}c(resolveAgentHarnessProgramConfig,"resolveAgentHarnessProgramConfig");export async function startAgentHarnessProgramApplication(e,t={},r={}){if(e.listen===void 0||e.listen.kind==="off")throw new Error("Agent Harness application cannot start without a listener");const s=J(t),a=r.processRuntime===void 0,n=r.processRuntime??await(t.createProcessRuntime??(await import("../effect-runtime/process-runtime.mjs")).createHarnessProcessRuntime)();try{const i=ee({cli:e.cli,dependencies:t,listen:e.listen,packageVersion:e.packageVersion,processRuntime:n,shutdown:s,stderr:t.stderr??process.stderr});let o;return{close:c((m,p)=>(o??=te(i,m,p),o),"close"),running:i.running}}catch(i){if(!a)throw i;s.start();try{await I(n,s)}catch(o){throw new AggregateError([i,o],"Agent Harness startup and cleanup both failed")}throw i}}c(startAgentHarnessProgramApplication,"startAgentHarnessProgramApplication");export async function runAgentHarnessCli(e=process.argv.slice(2),t={}){const[{Effect:r},{makeHarnessCliMain:s}]=await Promise.all([import("effect"),import("./program.mjs")]);await r.runPromise(s(e,t))}c(runAgentHarnessCli,"runAgentHarnessCli");function Z(e,t){if((t.kind==="stdio"||t.kind==="off")&&e.wsAuth!==void 0)throw new Error(`--ws-auth cannot be used with ${t.address}`);if((t.kind==="stdio"||t.kind==="off")&&e.allowedOrigins.length>0)throw new Error(`--allowed-origin cannot be used with ${t.address}`);if(t.kind==="npipe"&&e.wsAuth===void 0)throw new Error("Windows named-pipe listeners require --ws-auth");if(t.kind!=="streamable-http"&&t.kind!=="websocket"&&e.allowInsecureRemote)throw new Error(`--allow-insecure-remote cannot be used with ${t.address}`)}c(Z,"validateHarnessListenOptions");function ee({cli:e,dependencies:t,listen:r,packageVersion:s,processRuntime:a,shutdown:n,stderr:i}){const o=new AbortController,m=new Error("Agent Harness is shutting down"),p=a.run(async h=>{let d;e.wsAuth==="capability-token"?d=await(t.createTokenAuthenticator??Y)({tokenFile:e.wsTokenFile,tokenSha256:e.wsTokenSha256}):e.wsAuth==="signed-bearer-token"&&(d=await(t.createSignedTokenAuthenticator??q)({audience:e.wsAudience,issuer:e.wsIssuer,maxClockSkewSeconds:e.wsMaxClockSkewSeconds,sharedSecretFile:e.wsSharedSecretFile}));const f=z(e.clientIdentity,s);await re({allowInsecureRemote:e.allowInsecureRemote,allowedOrigins:e.allowedOrigins,authenticator:d,clientIdentity:f,clientIdentityEnv:W(f),dependencies:t,gracefulShutdownSignal:o.signal,listen:r,logDir:e.logDir,packageVersion:s,processRuntime:a,processSignal:h,productConfig:e.productConfig,strictMcpConfig:e.strictMcpConfig,shutdown:n,stderr:i})});return p.catch(()=>{}),{closeReason:m,closeSignal:o,processRuntime:a,running:p,shutdown:n}}c(ee,"startHarnessApplication");async function te(e,t,r){O("application","started"),e.shutdown.start(),e.closeSignal.abort(e.closeReason);let s,a=!1;try{const o=Math.max(1,e.shutdown.remainingMs());await V(e.running,o,"application shutdown")}catch(o){o!==e.closeReason&&(s=o,a=!0)}let n,i=!1;try{await I(e.processRuntime,e.shutdown,t)}catch(o){n=o,i=!0}if(!r&&a&&i)throw new AggregateError([s,n],"Agent Harness runtime and cleanup both failed");if(!r&&a)throw s;if(i)throw n;O("application","completed")}c(te,"closeHarnessApplication");async function re({allowInsecureRemote:e,allowedOrigins:t,authenticator:r,clientIdentity:s,clientIdentityEnv:a,dependencies:n,listen:i,logDir:o,packageVersion:m,processRuntime:p,processSignal:h,gracefulShutdownSignal:d,productConfig:f,strictMcpConfig:D,shutdown:v,stderr:C}){const g=v,{server:S,close:k,telemetry:H,containment:E,runtimeShutdown:R,recordLifecycle:w}=await j({clientIdentity:s,clientIdentityEnv:a,dependencies:n,packageVersion:m,processRuntime:p,productConfig:f,strictMcpConfig:D,shutdown:v,telemetryOptions:se(n,o),signal:AbortSignal.any([h,d])});if(L()?.markEvent("harness-services-ready"),L()?.markStart("harness.wait-initialize","Transport setup and wait for first initialize"),i.kind==="stdio"){let l;try{l=(n.serveStdio??Q)(S)}catch(u){throw await k(u).catch(()=>{}),w({component:"server",error:u,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),u}const b=F(u=>l.close(u));w({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),await _(l.closed,u=>P(H,()=>N([()=>b(u),()=>k(u)],g,"stdio shutdown")),n.signalTarget,d,[E.signal,R.signal,h],{forceClose:c(u=>b(u),"forceClose"),timeouts:g}),w({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"});return}let A;try{A=await(n.createNetworkListener??K)({acceptor:S,allowInsecureRemote:e,allowedOrigins:t,listen:i,authenticator:r,onWarning:c(l=>C.write(`[agent-harness] warning: ${l}
2
+ `),"onWarning")})}catch(l){throw await k(l).catch(()=>{}),w({component:"server",error:l,phase:"startup",process:{pid:process.pid},reason:"startup_failed",state:"startup_failed"}),l}C.write(`[agent-harness] listening on ${A.address}
3
+ `);const T=F(()=>A.close());w({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),await _(A.closed,l=>P(H,()=>B([[()=>k(l)],[()=>T()]],g,"network shutdown")),n.signalTarget,d,[E.signal,R.signal,h],{forceClose:c(()=>T(),"forceClose"),timeouts:g}),w({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"})}c(re,"runAgentHarnessCliRuntime");function se(e,t){if(e.telemetry!==void 0)return e.telemetry;if(process.env.DISABLE_TELEMETRY)return{};try{const r=process.env.CODEBUDDY_CONFIG_DIR?.trim(),s=t??y.join(r?y.resolve(r):y.join($(),".codebuddy"),"logs","harness");return{sink:(e.createTelemetryFileSink??U)({directory:s})}}catch{return{}}}c(se,"resolveCliTelemetry");function ne(){const e=y.resolve(import.meta.dirname,"../../package.json"),t=JSON.parse(x(e,"utf8"));if(typeof t.version!="string"||t.version.length===0)throw new Error(`Agent Harness package version is missing in ${e}`);return t.version}c(ne,"readPackageVersion");
@@ -62,6 +62,22 @@ export declare const clientMethods: {
62
62
  readonly upgrade: "marketplace/upgrade";
63
63
  };
64
64
  readonly mcpServer: {
65
+ readonly oauth: {
66
+ readonly cancel: "mcpServer/oauth/cancel";
67
+ };
68
+ } & {
69
+ readonly oauth: {
70
+ readonly complete: "mcpServer/oauth/complete";
71
+ };
72
+ } & {
73
+ readonly oauth: {
74
+ readonly login: "mcpServer/oauth/login";
75
+ };
76
+ } & {
77
+ readonly oauth: {
78
+ readonly logout: "mcpServer/oauth/logout";
79
+ };
80
+ } & {
65
81
  readonly startupStatus: {
66
82
  readonly updated: "mcpServer/startupStatus/updated";
67
83
  };
@@ -0,0 +1,4 @@
1
+ export { createFunctionalHooks } from '../../cli/dist-server/types/node/hooks/functional-hooks.js';
2
+ export type { FunctionalHooks, FunctionalHooksHost } from '../../cli/dist-server/types/node/hooks/functional-hooks.js';
3
+ export type { FunctionalHooksRegister as HarnessHooks, FunctionalHookApi as HarnessHookApi, FunctionalHookOn as HarnessHookOn, } from '../../cli/dist-server/types/node/hooks/functional-hooks-protocol.js';
4
+ export { currentModsExecutionContext } from '../../cli/dist-server/types/vendor/cbc-core/node/index.js';
@@ -0,0 +1 @@
1
+ import o from"#agent-harness-runtime";const t=o["component-functional-hooks"]();export const{createFunctionalHooks,currentModsExecutionContext}=t;
@@ -1 +1 @@
1
- var l=Object.defineProperty;var r=(e,n)=>l(e,"name",{value:n,configurable:!0});import{isAbsolute as b}from"node:path";const o=Symbol.for("codebuddy.ai/agent-harness/application-owner");export async function createHarness(e={}){if(e.signal?.throwIfAborted(),e.configDir!==void 0&&!b(e.configDir))throw new TypeError("Harness configDir must be an absolute path");if(typeof e.sandboxCenter=="object"&&!e.sandboxCenter.address?.trim())throw new TypeError("sandboxCenter.address must be a non-empty IPC address");const n=globalThis;if(n[o]!==void 0)throw new Error("This process already owns a Harness. Reuse it for additional Clients and Sessions, or await its close() before creating another.");const d={};n[o]=d;const i=process.env.CODEBUDDY_CONFIG_DIR;e.configDir!==void 0&&(process.env.CODEBUDDY_CONFIG_DIR=e.configDir);const f=r(()=>{n[o]===d&&(delete n[o],e.configDir!==void 0&&process.env.CODEBUDDY_CONFIG_DIR===e.configDir&&(i===void 0?delete process.env.CODEBUDDY_CONFIG_DIR:process.env.CODEBUDDY_CONFIG_DIR=i))},"release");try{const t={...e,host:e.host===void 0?void 0:{...e.host},productConfig:typeof e.productConfig=="object"?structuredClone(e.productConfig):e.productConfig,sandboxCenter:typeof e.sandboxCenter=="object"?{...e.sandboxCenter}:e.sandboxCenter},{startHarness:u}=await import("./runtime.js"),s=await u(t),c=s.closed.then(f);c.catch(()=>{});const D=r(()=>(s.close().catch(()=>{}),c),"close");return{get ready(){return s.ready},connect:r((a,C)=>s.connect(a,C),"connect"),connectInMemory:r(a=>s.connectInMemory(a),"connectInMemory"),closed:c,close:D,[Symbol.asyncDispose]:D}}catch(t){throw f(),t}}r(createHarness,"createHarness");
1
+ var D=Object.defineProperty;var n=(e,t)=>D(e,"name",{value:t,configurable:!0});import{isAbsolute as m}from"node:path";const a=Symbol.for("codebuddy.ai/agent-harness/application-owner");function g(e){if(e===void 0)return;if(!Array.isArray(e))throw new TypeError("Harness tools must be an array of tool() definitions. Select tools in the plugin Agent configuration.");const t=new Set;return e.map((r,s)=>{if(!r||typeof r!="object"||typeof r.name!="string"||!r.name.trim()||typeof r.description!="string"||typeof r.handler!="function"||!r.inputSchema||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new TypeError(`Harness tools[${s}] must be a tool() definition. Select tool names in the plugin Agent configuration.`);if(t.has(r.name))throw new TypeError(`Duplicate Harness tool name: '${r.name}'`);return t.add(r.name),{...r,inputSchema:{...r.inputSchema}}})}n(g,"captureTools");export async function createHarness(e={}){e.signal?.throwIfAborted();const t=g(e.tools);if(e.configDir!==void 0&&!m(e.configDir))throw new TypeError("Harness configDir must be an absolute path");if(typeof e.sandboxCenter=="object"&&!e.sandboxCenter.address?.trim())throw new TypeError("sandboxCenter.address must be a non-empty IPC address");const r=globalThis;if(r[a]!==void 0)throw new Error("This process already owns a Harness. Reuse it for additional Clients and Sessions, or await its close() before creating another.");const s={};r[a]=s;const f=process.env.CODEBUDDY_CONFIG_DIR;e.configDir!==void 0&&(process.env.CODEBUDDY_CONFIG_DIR=e.configDir);const i=n(()=>{r[a]===s&&(delete r[a],e.configDir!==void 0&&process.env.CODEBUDDY_CONFIG_DIR===e.configDir&&(f===void 0?delete process.env.CODEBUDDY_CONFIG_DIR:process.env.CODEBUDDY_CONFIG_DIR=f))},"release");try{const c={...e,tools:t,host:e.host===void 0?void 0:{...e.host},productConfig:typeof e.productConfig=="object"?structuredClone(e.productConfig):e.productConfig,sandboxCenter:typeof e.sandboxCenter=="object"?{...e.sandboxCenter}:e.sandboxCenter},{startHarness:h}=await import("./runtime.js"),o=await h(c),d=o.closed.then(i);d.catch(()=>{});const l=n(()=>(o.close().catch(()=>{}),d),"close");return{get ready(){return o.ready},connect:n((u,y)=>o.connect(u,y),"connect"),connectInMemory:n(u=>o.connectInMemory(u),"connectInMemory"),closed:d,close:l,[Symbol.asyncDispose]:l}}catch(c){throw i(),c}}n(createHarness,"createHarness");
@@ -0,0 +1,8 @@
1
+ import { Context, Layer } from 'effect';
2
+ import type { FunctionalHooks, HarnessHooks } from '#agent-harness-components/functional-hooks';
3
+ declare const HostHooks_base: Context.ServiceClass<HostHooks, "@genie/agent-harness/HostHooks", FunctionalHooks>;
4
+ /** The application Scope owns registration and cancellation of Host middleware. */
5
+ export declare class HostHooks extends HostHooks_base {
6
+ static layer(register: HarnessHooks): Layer.Layer<HostHooks, unknown>;
7
+ }
8
+ export {};
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var o=(r,t)=>l(r,"name",{value:t,configurable:!0});import{Context as y,Effect as e,Layer as u}from"effect";export class HostHooks extends y.Service()("@genie/agent-harness/HostHooks"){static{o(this,"HostHooks")}static layer(t){return u.effect(this,e.gen(function*(){const{createFunctionalHooks:s,currentModsExecutionContext:i}=yield*e.tryPromise(()=>import("#agent-harness-components/functional-hooks")),c=e.runSyncWith(yield*e.context()),a=yield*e.acquireRelease(e.sync(()=>new AbortController),n=>e.sync(()=>n.abort(new Error("Harness hooks closed"))));return yield*e.tryPromise(()=>s(t,{name:"harness",signal:a.signal,getSession:i,report:o(n=>c(e.logWarning(n)),"report")}))}))}}
@@ -1 +1 @@
1
- var H=Object.defineProperty;var i=(e,s)=>H(e,"name",{value:s,configurable:!0});import{readFileSync as S}from"node:fs";import{closeHarnessProcessRuntime as P,closeInPhases as v,closeWithLifecycleTelemetry as M,resolveShutdownCoordinator as R,runUntilClosed as L}from"../application/lifecycle.js";import{createApplicationServices as k}from"../application/services.js";import{createHarnessProcessRuntime as x}from"../effect-runtime/process-runtime.mjs";import{buildAgentHarnessClientIdentityEnv as T,resolveAgentHarnessClientIdentity as N}from"../runtime/client-identity.js";import{startupProfiler as O}from"../telemetry/startup-profile.js";export async function startHarness(e,s={}){e.signal?.throwIfAborted();const l=e.mcp?.toolsSyncTtlMs;if(l!=null&&(!Number.isSafeInteger(l)||l<=0))throw new RangeError("mcp.toolsSyncTtlMs must be a positive integer or null");const g=s.packageVersion??JSON.parse(S(new URL("../../package.json",import.meta.url),"utf8")).version,p=N(e.host??{},g),a=R(s),m=await(s.createProcessRuntime??x)(),w=Promise.withResolvers(),n=new AbortController,d=new Error("Agent Harness is shutting down"),u=i(()=>n.abort(e.signal?.reason??d),"cancel");e.signal?.addEventListener("abort",u,{once:!0}),e.signal?.aborted&&u();const I=Promise.resolve().then(()=>m.run(async t=>{n.signal.throwIfAborted();const{server:r,modules:o,telemetry:E,containment:A,runtimeShutdown:C,recordLifecycle:h}=await k({signal:AbortSignal.any([n.signal,t]),clientIdentity:p,clientIdentityEnv:T(p),dependencies:s,packageVersion:g,processRuntime:m,productConfig:e.productConfig,sandboxCenter:e.sandboxCenter,tools:e.tools,strictMcpConfig:e.strictMcpConfig??!1,mcp:e.mcp,shutdown:a,telemetryOptions:e.telemetry??{}});if(!("connectInMemory"in r)||typeof r.connectInMemory!="function")throw await v([[()=>r.close(),()=>o.close()]],a),new TypeError("Application Server does not implement the in-memory endpoint");O()?.markEvent("harness-services-ready"),h({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),w.resolve(r),await L(new Promise(()=>{}),b=>M(E,()=>v([[()=>r.close(b),()=>o.close(b)]],a,"in-memory shutdown")),void 0,n.signal,[A.signal,C.signal,t],{timeouts:a}),h({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"})})),c=(async()=>{let t,r=!1;try{await I}catch(o){t=o,r=!0}n.abort(d),a.start();try{await P(m,a)}catch(o){throw r?new AggregateError([t,o],"Harness execution and cleanup failed"):o}finally{e.signal?.removeEventListener("abort",u)}if(r)throw t})();c.catch(()=>{});const f=await Promise.race([w.promise,c.then(()=>{throw new Error("Harness closed before startup completed")})]);e.signal?.aborted&&(await c,e.signal.throwIfAborted());const y=i(()=>(n.abort(d),c),"close");return{get ready(){return!n.signal.aborted&&f.ready},closed:c,connect:i((t,r)=>{if(n.signal.aborted)throw new Error("Harness is closing");return f.connect(t,r)},"connect"),connectInMemory:i(t=>{if(n.signal.aborted)throw new Error("Harness is closing");return f.connectInMemory(t)},"connectInMemory"),close:y,[Symbol.asyncDispose]:y}}i(startHarness,"startHarness");
1
+ var C=Object.defineProperty;var a=(e,s)=>C(e,"name",{value:s,configurable:!0});import{readFileSync as S}from"node:fs";import{closeHarnessProcessRuntime as H,closeWithLifecycleTelemetry as M,resolveShutdownCoordinator as P,runUntilClosed as R}from"../application/lifecycle.js";import{createApplicationServices as k}from"../application/services.js";import{createHarnessProcessRuntime as L}from"../effect-runtime/process-runtime.mjs";import{buildAgentHarnessClientIdentityEnv as x,resolveAgentHarnessClientIdentity as T}from"../runtime/client-identity.js";import{startupProfiler as N}from"../telemetry/startup-profile.js";export async function startHarness(e,s={}){e.signal?.throwIfAborted();const l=e.mcp?.toolsSyncTtlMs;if(l!=null&&(!Number.isSafeInteger(l)||l<=0))throw new RangeError("mcp.toolsSyncTtlMs must be a positive integer or null");const f=s.packageVersion??JSON.parse(S(new URL("../../package.json",import.meta.url),"utf8")).version,g=T(e.host??{},f),c=P(s),m=await(s.createProcessRuntime??L)(),w=Promise.withResolvers(),t=new AbortController,d=new Error("Agent Harness is shutting down"),u=a(()=>t.abort(e.signal?.reason??d),"cancel");e.signal?.addEventListener("abort",u,{once:!0}),e.signal?.aborted&&u();const b=Promise.resolve().then(()=>m.run(async r=>{t.signal.throwIfAborted();const{server:n,close:o,telemetry:v,containment:E,runtimeShutdown:I,recordLifecycle:h}=await k({signal:AbortSignal.any([t.signal,r]),clientIdentity:g,clientIdentityEnv:x(g),dependencies:s,packageVersion:f,processRuntime:m,productConfig:e.productConfig,sandboxCenter:e.sandboxCenter,tools:{type:"preset",preset:"default",append:e.tools},hooks:e.hooks,strictMcpConfig:e.strictMcpConfig??!1,mcp:e.mcp,shutdown:c,telemetryOptions:e.telemetry??{}});if(!("connectInMemory"in n)||typeof n.connectInMemory!="function")throw await o(),new TypeError("Application Server does not implement the in-memory endpoint");N()?.markEvent("harness-services-ready"),h({component:"server",phase:"startup",process:{pid:process.pid},reason:"startup_completed",state:"started"}),w.resolve(n),await R(new Promise(()=>{}),A=>M(v,()=>o(A)),void 0,t.signal,[E.signal,I.signal,r],{timeouts:c}),h({component:"server",phase:"shutdown",process:{pid:process.pid},reason:"shutdown_completed",state:"stopped"})})),i=(async()=>{let r,n=!1;try{await b}catch(o){r=o,n=!0}t.abort(d),c.start();try{await H(m,c)}catch(o){throw n?new AggregateError([r,o],"Harness execution and cleanup failed"):o}finally{e.signal?.removeEventListener("abort",u)}if(n)throw r})();i.catch(()=>{});const p=await Promise.race([w.promise,i.then(()=>{throw new Error("Harness closed before startup completed")})]);e.signal?.aborted&&(await i,e.signal.throwIfAborted());const y=a(()=>(t.abort(d),i),"close");return{get ready(){return!t.signal.aborted&&p.ready},closed:i,connect:a((r,n)=>{if(t.signal.aborted)throw new Error("Harness is closing");return p.connect(r,n)},"connect"),connectInMemory:a(r=>{if(t.signal.aborted)throw new Error("Harness is closing");return p.connectInMemory(r)},"connectInMemory"),close:y,[Symbol.asyncDispose]:y}}a(startHarness,"startHarness");
@@ -1,14 +1,16 @@
1
- import type { QueryOptions, SdkMcpToolDefinition } from '#agent-harness-codebuddy/server';
1
+ import type { SdkMcpToolDefinition } from '#agent-harness-codebuddy/server';
2
+ import type { HarnessHooks } from '#agent-harness-components/functional-hooks';
2
3
  import type { AgentHarnessClientIdentity } from '../runtime/client-identity.js';
3
4
  import type { AgentHarnessProductInput } from '../runtime/product-config.js';
4
5
  import type { SandboxCenterOption } from '../runtime/sandbox-center.js';
5
6
  import type { TelemetryOptions } from '../telemetry/public.js';
6
7
  import type { InMemoryEndpoint } from '../transport/effect.js';
7
8
  import type { AgentHarnessConnectionAcceptor } from '../transport/types.js';
9
+ export type { HarnessHooks } from '#agent-harness-components/functional-hooks';
8
10
  export type HostInfo = AgentHarnessClientIdentity;
9
11
  export type ProductConfig = AgentHarnessProductInput;
10
12
  export type ToolDefinition = SdkMcpToolDefinition;
11
- export type HarnessTools = NonNullable<QueryOptions['tools']>;
13
+ export type HarnessTools = readonly ToolDefinition[];
12
14
  export interface HarnessOptions {
13
15
  readonly host?: HostInfo;
14
16
  /** Complete Host startup Product or versioned file path; omission uses bundled defaults. */
@@ -17,7 +19,10 @@ export interface HarnessOptions {
17
19
  readonly configDir?: string;
18
20
  /** Managed by Harness by default; pass an IPC address to borrow a Host-owned center. */
19
21
  readonly sandboxCenter?: SandboxCenterOption;
22
+ /** Register Host tools alongside the defaults; plugin Agent declarations select visible tools. */
20
23
  readonly tools?: HarnessTools;
24
+ /** Functional hooks: register(on, options), once per Harness. Functions stay in this process. */
25
+ readonly hooks?: HarnessHooks;
21
26
  readonly strictMcpConfig?: boolean;
22
27
  readonly mcp?: {
23
28
  /** Catalog fallback refresh interval. Default: 15 minutes; null disables expiry. */
@@ -1,5 +1,5 @@
1
1
  import type { ExecutorPrivateProxyPolicy } from '#agent-harness-executor/private-protocol';
2
- import type { ExecutorMcpCallResult } from '#agent-harness-executor/types';
2
+ import type { ExecutorMcpCallResult, ExecutorOAuthLoginInput, ExecutorOAuthLoginResult } from '#agent-harness-executor/types';
3
3
  import type { AcpV2ConnectMcpRequest, AcpV2ConnectMcpResponse, AcpV2DisconnectMcpRequest, AcpV2McpServer, AcpV2MessageMcpNotification, AcpV2MessageMcpRequest } from '../protocol/acp-v2.js';
4
4
  import { CodeBuddyProcessContainment } from '../runtime/process-containment.js';
5
5
  import type { AgentHarnessHandlerContext } from '../server/types.js';
@@ -40,6 +40,10 @@ export interface AgentMcpSessionSetup {
40
40
  readonly userMcpSnapshot?: UserMcpSnapshot;
41
41
  }
42
42
  export interface AgentMcpAttachment {
43
+ startOAuth?(name: string, input: ExecutorOAuthLoginInput, signal?: AbortSignal): Promise<ExecutorOAuthLoginResult>;
44
+ completeOAuth?(name: string, state: string, code: string, signal?: AbortSignal): Promise<void>;
45
+ cancelOAuth?(name: string, state: string, signal?: AbortSignal): Promise<void>;
46
+ logoutOAuth?(name: string, signal?: AbortSignal): Promise<void>;
43
47
  bindSessionId(sessionId: string): void;
44
48
  connect(params: AcpV2ConnectMcpRequest, options: AgentMcpConnectOptions): Promise<AcpV2ConnectMcpResponse>;
45
49
  disconnect(params: AcpV2DisconnectMcpRequest, options: AgentMcpNotificationOptions): Promise<void>;
@@ -1 +1 @@
1
- var w=Object.defineProperty;var a=(s,e)=>w(s,"name",{value:e,configurable:!0});import{CodeBuddyProcessContainment as M}from"../runtime/process-containment.js";import"./agent-mcp-protocol.js";import{ClientMcpAttachment as P}from"./client-mcp-attachment.js";import{ExecutorProcessSupervisor as C}from"./executor-supervisor.js";import{ExecutorMcpIntegration as y}from"./session-mcp-view.js";import{McpSourceCompiler as E}from"./source-compiler.js";const u=128;let v;function x(){return v??=import("./session-mcp-scope.js"),v}a(x,"loadSessionMcpScope");class A{static{a(this,"DefaultAgentMcpAttachment")}constructor(e){this.options=e,this.controller=new AbortController}bindSessionId(e){if(this.sessionId&&this.sessionId!==e)throw new Error("MCP attachment is already bound to another session");this.sessionId=e,this.scope?.bindSessionId(e)}async connect(e,t){return await this.materialize(),this.requireScope().connect(e,t)}async disconnect(e,t){await this.scope?.disconnect(e,t)}async disconnectPeer(e){await this.scope?.disconnectPeer(e)}listServerStatuses(){return this.requireScope().listServerStatuses()}materialize(){return this.revokePromise?Promise.reject(new Error("MCP attachment is revoked")):(this.materialization??=this.materializeInternal(),this.materialization)}revoke(){return this.revokePromise??=this.revokeInternal(),this.revokePromise}async message(e,t){return await this.materialize(),this.requireScope().message(e,t)}notify(e,t){this.requireScope().notify(e,t)}callTool(e,t,r,i){return this.requireScope().callTool(e,t,r,i)}subscribeServerStatus(e){return this.requireScope().subscribeServerStatus(e)}async materializeInternal(){try{if(this.options.servers.length+this.options.reservedServerCount>u)throw new RangeError(`ACP MCP server limit exceeds ${u}`);const e=this.options.compiler.compilePluginSnapshot(this.options.pluginMcpSnapshot),t=this.options.userMcpSnapshot?this.options.compiler.compileUserSnapshot(this.options.userMcpSnapshot):[];if(this.controller.signal.aborted||this.revokePromise)throw this.controller.signal.reason??new Error("MCP attachment is revoked");const r=new Set(this.options.servers.map(c=>c.logicalName)),i=t.filter(c=>r.has(c.logicalName)?!1:(r.add(c.logicalName),!0)),o=Math.max(0,u-this.options.servers.length-this.options.reservedServerCount),n=i.slice(0,o),l=Math.max(0,o-n.length),h=e.slice(0,l),m={droppedPluginServerCount:e.length-h.length,droppedUserServerCount:t.length-n.length},f=[...this.options.servers,...n,...h];for(const c of h){if(r.has(c.logicalName))throw new Error(`Duplicate MCP server name "${c.logicalName}"`);r.add(c.logicalName)}const d=this.options.executor.createView({interaction:this.options.interaction,servers:f}),{SessionMcpScope:S}=await x(),p=new S(d);this.scope=p,this.sessionId&&p.bindSessionId(this.sessionId);const g=await p.materialize();return d.serverNames().length===0?{diagnostics:m,mcpServers:[]}:{diagnostics:m,mcpServers:g.mcpServers}}catch(e){throw await this.scope?.revoke().catch(()=>{}),e}}async revokeInternal(){this.controller.abort(new Error("MCP attachment is revoked"));try{await this.scope?.revoke()}finally{this.options.onRevoked()}}requireScope(){if(!this.scope)throw new Error("MCP attachment is not materialized");return this.scope}}export class DefaultAgentMcpIntegration{static{a(this,"DefaultAgentMcpIntegration")}constructor(e){this.options=e,this.closed=!1,this.attachments=new Set,this.compiler=e.compiler??new E}createAttachment(e){if(this.closed)throw new Error("Agent MCP integration is closed");const t=this.compiler.compileAcpServers(e.setup.mcpServers,e.setup.cwd),r=a((n=[])=>{const l=new A({compiler:this.compiler,executor:this.options.executor,interaction:e.interaction,onRevoked:a(()=>this.attachments.delete(l),"onRevoked"),pluginMcpSnapshot:e.setup.pluginMcpSnapshot,userMcpSnapshot:e.setup.userMcpSnapshot,servers:[...t,...n],reservedServerCount:e.setup.reservedServerCount??0});return e.setup.clientMcp?.servers.length||this.attachments.add(l),l},"createBase"),i=e.setup.clientMcp;if(!i?.servers.length)return r();const o=new P(r,i.servers,i.owner,i.router,this.options.executor,this.compiler,e.interaction,()=>{this.attachments.delete(o)});return this.attachments.add(o),o}configureProxy(e){return this.options.executor.configureProxy(e)}async close(e){if(this.closed)return;this.closed=!0;const t=[...this.attachments];this.attachments.clear();const r=await Promise.allSettled(t.map(n=>n.revoke())),[i]=await Promise.allSettled([this.options.executor.close(e)]),o=[...r,i].filter(n=>n.status==="rejected").map(n=>n.reason);if(o.length>0)throw new AggregateError(o,"Agent MCP integration cleanup failed")}}export function createDefaultAgentMcpIntegration(s={}){const e=s.containment??new M,t=s.recordLifecycle??s.supervisor?.recordLifecycle,r=s.recordEffectTelemetry??s.supervisor?.recordEffectTelemetry,i=y.create({createSupervisor:a(o=>new C({...s.supervisor,containment:e,onElicitation:o,...t===void 0?{}:{recordLifecycle:t},...r===void 0?{}:{recordEffectTelemetry:r}}),"createSupervisor")});return new DefaultAgentMcpIntegration({...s.compiler===void 0?{}:{compiler:s.compiler},executor:i})}a(createDefaultAgentMcpIntegration,"createDefaultAgentMcpIntegration");
1
+ var w=Object.defineProperty;var a=(i,e)=>w(i,"name",{value:e,configurable:!0});import{CodeBuddyProcessContainment as M}from"../runtime/process-containment.js";import"./agent-mcp-protocol.js";import{ClientMcpAttachment as P}from"./client-mcp-attachment.js";import{ExecutorProcessSupervisor as A}from"./executor-supervisor.js";import{ExecutorMcpIntegration as C}from"./session-mcp-view.js";import{McpSourceCompiler as y}from"./source-compiler.js";const p=128;let S;function E(){return S??=import("./session-mcp-scope.js"),S}a(E,"loadSessionMcpScope");class x{static{a(this,"DefaultAgentMcpAttachment")}constructor(e){this.options=e,this.controller=new AbortController}bindSessionId(e){if(this.sessionId&&this.sessionId!==e)throw new Error("MCP attachment is already bound to another session");this.sessionId=e,this.scope?.bindSessionId(e)}async connect(e,t){return await this.materialize(),this.requireScope().connect(e,t)}async disconnect(e,t){await this.scope?.disconnect(e,t)}async disconnectPeer(e){await this.scope?.disconnectPeer(e)}listServerStatuses(){return this.requireScope().listServerStatuses()}materialize(){return this.revokePromise?Promise.reject(new Error("MCP attachment is revoked")):(this.materialization??=this.materializeInternal(),this.materialization)}revoke(){return this.revokePromise??=this.revokeInternal(),this.revokePromise}async message(e,t){return await this.materialize(),this.requireScope().message(e,t)}notify(e,t){this.requireScope().notify(e,t)}startOAuth(e,t,r){return this.requireScope().startOAuth(e,t,r)}completeOAuth(e,t,r,s){return this.requireScope().completeOAuth(e,t,r,s)}cancelOAuth(e,t,r){return this.requireScope().cancelOAuth(e,t,r)}logoutOAuth(e,t){return this.requireScope().logoutOAuth(e,t)}callTool(e,t,r,s){return this.requireScope().callTool(e,t,r,s)}subscribeServerStatus(e){return this.requireScope().subscribeServerStatus(e)}async materializeInternal(){try{if(this.options.servers.length+this.options.reservedServerCount>p)throw new RangeError(`ACP MCP server limit exceeds ${p}`);const e=this.options.compiler.compilePluginSnapshot(this.options.pluginMcpSnapshot),t=this.options.userMcpSnapshot?this.options.compiler.compileUserSnapshot(this.options.userMcpSnapshot):[];if(this.controller.signal.aborted||this.revokePromise)throw this.controller.signal.reason??new Error("MCP attachment is revoked");const r=new Set(this.options.servers.map(c=>c.logicalName)),s=t.filter(c=>r.has(c.logicalName)?!1:(r.add(c.logicalName),!0)),o=Math.max(0,p-this.options.servers.length-this.options.reservedServerCount),n=s.slice(0,o),l=Math.max(0,o-n.length),h=e.slice(0,l),m={droppedPluginServerCount:e.length-h.length,droppedUserServerCount:t.length-n.length},v=[...this.options.servers,...n,...h];for(const c of h){if(r.has(c.logicalName))throw new Error(`Duplicate MCP server name "${c.logicalName}"`);r.add(c.logicalName)}const d=this.options.executor.createView({interaction:this.options.interaction,servers:v}),{SessionMcpScope:f}=await E(),u=new f(d);this.scope=u,this.sessionId&&u.bindSessionId(this.sessionId);const g=await u.materialize();return d.serverNames().length===0?{diagnostics:m,mcpServers:[]}:{diagnostics:m,mcpServers:g.mcpServers}}catch(e){throw await this.scope?.revoke().catch(()=>{}),e}}async revokeInternal(){this.controller.abort(new Error("MCP attachment is revoked"));try{await this.scope?.revoke()}finally{this.options.onRevoked()}}requireScope(){if(!this.scope)throw new Error("MCP attachment is not materialized");return this.scope}}export class DefaultAgentMcpIntegration{static{a(this,"DefaultAgentMcpIntegration")}constructor(e){this.options=e,this.closed=!1,this.attachments=new Set,this.compiler=e.compiler??new y}createAttachment(e){if(this.closed)throw new Error("Agent MCP integration is closed");const t=this.compiler.compileAcpServers(e.setup.mcpServers,e.setup.cwd),r=a((n=[])=>{const l=new x({compiler:this.compiler,executor:this.options.executor,interaction:e.interaction,onRevoked:a(()=>this.attachments.delete(l),"onRevoked"),pluginMcpSnapshot:e.setup.pluginMcpSnapshot,userMcpSnapshot:e.setup.userMcpSnapshot,servers:[...t,...n],reservedServerCount:e.setup.reservedServerCount??0});return e.setup.clientMcp?.servers.length||this.attachments.add(l),l},"createBase"),s=e.setup.clientMcp;if(!s?.servers.length)return r();const o=new P(r,s.servers,s.owner,s.router,this.options.executor,this.compiler,e.interaction,()=>{this.attachments.delete(o)});return this.attachments.add(o),o}configureProxy(e){return this.options.executor.configureProxy(e)}async close(e){if(this.closed)return;this.closed=!0;const t=[...this.attachments];this.attachments.clear();const r=await Promise.allSettled(t.map(n=>n.revoke())),[s]=await Promise.allSettled([this.options.executor.close(e)]),o=[...r,s].filter(n=>n.status==="rejected").map(n=>n.reason);if(o.length>0)throw new AggregateError(o,"Agent MCP integration cleanup failed")}}export function createDefaultAgentMcpIntegration(i={}){const e=i.containment??new M,t=i.recordLifecycle??i.supervisor?.recordLifecycle,r=i.recordEffectTelemetry??i.supervisor?.recordEffectTelemetry,s=C.create({createSupervisor:a(o=>new A({...i.supervisor,containment:e,onElicitation:o,...t===void 0?{}:{recordLifecycle:t},...r===void 0?{}:{recordEffectTelemetry:r}}),"createSupervisor")});return new DefaultAgentMcpIntegration({...i.compiler===void 0?{}:{compiler:i.compiler},executor:s})}a(createDefaultAgentMcpIntegration,"createDefaultAgentMcpIntegration");
@@ -1,5 +1,5 @@
1
1
  import { type ConnectMcpResponse, type McpServer, type MessageMcpRequest } from '@agentclientprotocol/sdk/experimental/v2';
2
- import type { CompiledSessionMcpServer } from '#agent-harness-executor/types';
2
+ import type { CompiledSessionMcpServer, ExecutorOAuthLoginInput, ExecutorOAuthLoginResult } from '#agent-harness-executor/types';
3
3
  import type { AgentHarnessHandlerContext } from '../server/types.js';
4
4
  import type { AgentMcpAttachment, AgentMcpMaterializationResult } from './agent-integration.js';
5
5
  import { type AgentMcpConnectOptions, type AgentMcpMessageOptions, type AgentMcpNotificationOptions } from './agent-mcp-protocol.js';
@@ -47,6 +47,10 @@ export declare class ClientMcpAttachment implements AgentMcpAttachment {
47
47
  }, options: AgentMcpNotificationOptions): Promise<void>;
48
48
  disconnectPeer(token: object): Promise<void>;
49
49
  listServerStatuses(): readonly SessionMcpServerStatus[];
50
+ startOAuth(name: string, input: ExecutorOAuthLoginInput, signal?: AbortSignal): Promise<ExecutorOAuthLoginResult>;
51
+ completeOAuth(name: string, state: string, code: string, signal?: AbortSignal): Promise<void>;
52
+ cancelOAuth(name: string, state: string, signal?: AbortSignal): Promise<void>;
53
+ logoutOAuth(name: string, signal?: AbortSignal): Promise<void>;
50
54
  callTool(name: string, tool: string, args: unknown, signal?: AbortSignal): ReturnType<AgentMcpAttachment['callTool']>;
51
55
  subscribeServerStatus(listener: (status: SessionMcpServerStatus) => void): () => void;
52
56
  revoke(): Promise<void>;
@@ -1 +1 @@
1
- var S=Object.defineProperty;var u=(w,e)=>S(w,"name",{value:e,configurable:!0});import{randomUUID as b}from"node:crypto";import{methods as m}from"@agentclientprotocol/sdk/experimental/v2";import{isRecord as p}from"../internal/guards.js";import{AgentMcpRequestError as h}from"./agent-mcp-protocol.js";import{ClientMcpSource as v}from"./client-mcp-source.js";export class ClientMcpRouter{static{u(this,"ClientMcpRouter")}constructor(){this.routes=new Map}async connect(e,n,t){const i=new AbortController,s=AbortSignal.any([e.connectionSignal,i.signal,...t.signal?[t.signal]:[]]);s.throwIfAborted();const o=await e.request(m.client.mcp.connect,{serverId:n},{signal:s});if(!p(o)||typeof o.connectionId!="string")throw new h(-32603,"Client returned an invalid MCP connectionId");const c=o.connectionId,r={id:b(),publicId:c,owner:e,peer:t,lifetime:i};if([...this.routes.values()].some(a=>a.owner.connectionSignal===e.connectionSignal&&a.publicId===c))throw new h(-32602,"Client reused an active MCP connectionId");return this.routes.set(r.id,r),s.aborted&&(await this.close(r),s.throwIfAborted()),r}message(e,n){const t=this.find(e.connectionId,n);return t.peer.peer.request({...e,connectionId:t.id},{signal:AbortSignal.any([n.signal,t.lifetime.signal])})}notify(e,n){const t=this.find(e.connectionId,n);return t.peer.peer.notify({...e,connectionId:t.id})}request(e,n,t){return e.owner.request(m.client.mcp.message,{...n,connectionId:e.publicId},{signal:AbortSignal.any([e.owner.connectionSignal,e.lifetime.signal,...t?[t]:[]])})}notification(e,n){return e.owner.notify(m.client.mcp.message,{...n,connectionId:e.publicId})}async close(e){this.routes.delete(e.id)&&(e.lifetime.abort(new Error("MCP session attachment closed")),e.owner.connectionSignal.aborted||await e.owner.request(m.client.mcp.disconnect,{connectionId:e.publicId},{timeoutMs:5e3}))}find(e,n){const t=[...this.routes.values()].find(i=>i.publicId===e&&i.owner.connectionSignal===n.connectionSignal);if(!t)throw new h(-32602,"Unknown MCP connectionId");return t}}export class ClientMcpAttachment{static{u(this,"ClientMcpAttachment")}constructor(e,n,t,i,s,o,c,r=()=>{}){this.onRevoked=r,this.sources=new Map,this.serverNames=new Map,this.connections=new Map;try{const a=n.map(l=>{const f=b(),g=o.compileClientServer(l.name,f,l._meta),I=new v(t,l.serverId,i,(d,y)=>c(d,{invocationId:b(),sessionId:this.sessionId,signal:y}));try{const d=s.registerClientSource(f,I);this.sources.set(l.name,{source:I,release:d})}catch(d){throw I.close().catch(()=>{}),d}return g});this.base=e(a)}catch(a){for(const{source:l,release:f}of this.sources.values())f(),l.close().catch(()=>{});throw this.sources.clear(),a}}bindSessionId(e){this.base.bindSessionId(e),this.sessionId=e}async materialize(){const e=await this.base.materialize();for(const n of e.mcpServers)n.type==="acp"&&typeof n.serverId=="string"&&typeof n.name=="string"&&this.sources.has(n.name)&&this.serverNames.set(n.serverId,n.name);return e}async connect(e,n){await this.materialize();const t=this.serverNames.get(e.serverId);if(t&&this.sources.get(t)?.source.closed)throw new h(-32602,"Client MCP owner is disconnected");const i=await this.base.connect(e,n),s=t?this.sources.get(t)?.source:void 0;return s&&(this.connections.set(i.connectionId,{source:s,token:n.peerToken}),s.bindPeer(n.peerToken,{request:u((o,c)=>n.peer.request({...o,connectionId:i.connectionId},c),"request"),notify:u(o=>n.peer.notify({...o,connectionId:i.connectionId}),"notify")})),i}async message(e,n){const t=this.source(e.connectionId,n.peerToken);if(!t||["initialize","tools/list","tools/call","ping"].includes(e.method)){const i=await this.base.message(e,n);if(t&&e.method==="initialize"&&p(i)){const s=t.capabilities;return{...i,capabilities:{...p(i.capabilities)?i.capabilities:{},...s?.resources?{resources:s.resources}:{},...s?.prompts?{prompts:s.prompts}:{}},...t.instructions?{instructions:t.instructions}:{}}}return i}return t.requestOther(e.method,e.params,n.signal)}notify(e,n){this.base.notify(e,n),["notifications/initialized","notifications/cancelled"].includes(e.method)||this.source(e.connectionId,n.peerToken)?.notify(e.method,e.params).catch(()=>{})}async disconnect(e,n){const t=this.source(e.connectionId,n.peerToken);await this.base.disconnect(e,n),this.connections.delete(e.connectionId),t?.unbindPeer(n.peerToken)}async disconnectPeer(e){await this.base.disconnectPeer(e);for(const[n,t]of this.connections)t.token===e&&(this.connections.delete(n),t.source.unbindPeer(e))}listServerStatuses(){return this.base.listServerStatuses()}callTool(e,n,t,i){return this.base.callTool(e,n,t,i)}subscribeServerStatus(e){return this.base.subscribeServerStatus(e)}revoke(){return this.closing??=(async()=>{const e=await Promise.allSettled([this.base.revoke()]);this.connections.clear(),e.push(...await Promise.allSettled([...this.sources.values()].map(async({source:t,release:i})=>{i(),await t.close()}))),this.sources.clear(),this.onRevoked();const n=e.flatMap(t=>t.status==="rejected"?[t.reason]:[]);if(n.length)throw new AggregateError(n,"Client MCP cleanup failed")})()}source(e,n){const t=this.connections.get(e);if(t&&t.token!==n)throw new h(-32602,"Unknown MCP connectionId");return t?.source}}
1
+ var y=Object.defineProperty;var d=(m,e)=>y(m,"name",{value:e,configurable:!0});import{randomUUID as p}from"node:crypto";import{methods as b}from"@agentclientprotocol/sdk/experimental/v2";import{isRecord as g}from"../internal/guards.js";import{AgentMcpRequestError as h}from"./agent-mcp-protocol.js";import{ClientMcpSource as S}from"./client-mcp-source.js";export class ClientMcpRouter{static{d(this,"ClientMcpRouter")}constructor(){this.routes=new Map}async connect(e,t,n){const s=new AbortController,i=AbortSignal.any([e.connectionSignal,s.signal,...n.signal?[n.signal]:[]]);i.throwIfAborted();const o=await e.request(b.client.mcp.connect,{serverId:t},{signal:i});if(!g(o)||typeof o.connectionId!="string")throw new h(-32603,"Client returned an invalid MCP connectionId");const c=o.connectionId,r={id:p(),publicId:c,owner:e,peer:n,lifetime:s};if([...this.routes.values()].some(a=>a.owner.connectionSignal===e.connectionSignal&&a.publicId===c))throw new h(-32602,"Client reused an active MCP connectionId");return this.routes.set(r.id,r),i.aborted&&(await this.close(r),i.throwIfAborted()),r}message(e,t){const n=this.find(e.connectionId,t);return n.peer.peer.request({...e,connectionId:n.id},{signal:AbortSignal.any([t.signal,n.lifetime.signal])})}notify(e,t){const n=this.find(e.connectionId,t);return n.peer.peer.notify({...e,connectionId:n.id})}request(e,t,n){return e.owner.request(b.client.mcp.message,{...t,connectionId:e.publicId},{signal:AbortSignal.any([e.owner.connectionSignal,e.lifetime.signal,...n?[n]:[]])})}notification(e,t){return e.owner.notify(b.client.mcp.message,{...t,connectionId:e.publicId})}async close(e){this.routes.delete(e.id)&&(e.lifetime.abort(new Error("MCP session attachment closed")),e.owner.connectionSignal.aborted||await e.owner.request(b.client.mcp.disconnect,{connectionId:e.publicId},{timeoutMs:5e3}))}find(e,t){const n=[...this.routes.values()].find(s=>s.publicId===e&&s.owner.connectionSignal===t.connectionSignal);if(!n)throw new h(-32602,"Unknown MCP connectionId");return n}}export class ClientMcpAttachment{static{d(this,"ClientMcpAttachment")}constructor(e,t,n,s,i,o,c,r=()=>{}){this.onRevoked=r,this.sources=new Map,this.serverNames=new Map,this.connections=new Map;try{const a=t.map(l=>{const f=p(),I=o.compileClientServer(l.name,f,l._meta),w=new S(n,l.serverId,s,(u,v)=>c(u,{invocationId:p(),sessionId:this.sessionId,signal:v}));try{const u=i.registerClientSource(f,w);this.sources.set(l.name,{source:w,release:u})}catch(u){throw w.close().catch(()=>{}),u}return I});this.base=e(a)}catch(a){for(const{source:l,release:f}of this.sources.values())f(),l.close().catch(()=>{});throw this.sources.clear(),a}}bindSessionId(e){this.base.bindSessionId(e),this.sessionId=e}async materialize(){const e=await this.base.materialize();for(const t of e.mcpServers)t.type==="acp"&&typeof t.serverId=="string"&&typeof t.name=="string"&&this.sources.has(t.name)&&this.serverNames.set(t.serverId,t.name);return e}async connect(e,t){await this.materialize();const n=this.serverNames.get(e.serverId);if(n&&this.sources.get(n)?.source.closed)throw new h(-32602,"Client MCP owner is disconnected");const s=await this.base.connect(e,t),i=n?this.sources.get(n)?.source:void 0;return i&&(this.connections.set(s.connectionId,{source:i,token:t.peerToken}),i.bindPeer(t.peerToken,{request:d((o,c)=>t.peer.request({...o,connectionId:s.connectionId},c),"request"),notify:d(o=>t.peer.notify({...o,connectionId:s.connectionId}),"notify")})),s}async message(e,t){const n=this.source(e.connectionId,t.peerToken);if(!n||["initialize","tools/list","tools/call","ping"].includes(e.method)){const s=await this.base.message(e,t);if(n&&e.method==="initialize"&&g(s)){const i=n.capabilities;return{...s,capabilities:{...g(s.capabilities)?s.capabilities:{},...i?.resources?{resources:i.resources}:{},...i?.prompts?{prompts:i.prompts}:{}},...n.instructions?{instructions:n.instructions}:{}}}return s}return n.requestOther(e.method,e.params,t.signal)}notify(e,t){this.base.notify(e,t),["notifications/initialized","notifications/cancelled"].includes(e.method)||this.source(e.connectionId,t.peerToken)?.notify(e.method,e.params).catch(()=>{})}async disconnect(e,t){const n=this.source(e.connectionId,t.peerToken);await this.base.disconnect(e,t),this.connections.delete(e.connectionId),n?.unbindPeer(t.peerToken)}async disconnectPeer(e){await this.base.disconnectPeer(e);for(const[t,n]of this.connections)n.token===e&&(this.connections.delete(t),n.source.unbindPeer(e))}listServerStatuses(){return this.base.listServerStatuses()}startOAuth(e,t,n){return this.base.startOAuth?this.base.startOAuth(e,t,n):Promise.reject(new Error("MCP OAuth unavailable"))}completeOAuth(e,t,n,s){return this.base.completeOAuth?this.base.completeOAuth(e,t,n,s):Promise.reject(new Error("MCP OAuth unavailable"))}cancelOAuth(e,t,n){return this.base.cancelOAuth?this.base.cancelOAuth(e,t,n):Promise.reject(new Error("MCP OAuth unavailable"))}logoutOAuth(e,t){return this.base.logoutOAuth?this.base.logoutOAuth(e,t):Promise.reject(new Error("MCP OAuth unavailable"))}callTool(e,t,n,s){return this.base.callTool(e,t,n,s)}subscribeServerStatus(e){return this.base.subscribeServerStatus(e)}revoke(){return this.closing??=(async()=>{const e=await Promise.allSettled([this.base.revoke()]);this.connections.clear(),e.push(...await Promise.allSettled([...this.sources.values()].map(async({source:n,release:s})=>{s(),await n.close()}))),this.sources.clear(),this.onRevoked();const t=e.flatMap(n=>n.status==="rejected"?[n.reason]:[]);if(t.length)throw new AggregateError(t,"Client MCP cleanup failed")})()}source(e,t){const n=this.connections.get(e);if(n&&n.token!==t)throw new h(-32602,"Unknown MCP connectionId");return n?.source}}
@@ -1,6 +1,6 @@
1
1
  import { type ChildProcess, fork, spawn } from 'node:child_process';
2
2
  import { type ExecutorPrivateProxyPolicy } from '#agent-harness-executor/private-protocol';
3
- import { type ExecutorElicitationRequest, type ExecutorElicitationResponse, type ExecutorMcpCallResult, type ExecutorRegistrationSnapshot, type ExecutorRegistrationSpec } from '#agent-harness-executor/types';
3
+ import { type ExecutorElicitationRequest, type ExecutorElicitationResponse, type ExecutorMcpCallResult, type ExecutorOAuthLoginInput, type ExecutorOAuthLoginResult, type ExecutorRegistrationSnapshot, type ExecutorRegistrationSpec } from '#agent-harness-executor/types';
4
4
  import type { WindowsJob } from '#agent-harness-executor/windows-job';
5
5
  import { type HarnessEffectTelemetryLog, type HarnessEffectTelemetryMetrics, type HarnessEffectTelemetrySpan, type HarnessProcessRuntimeHandle } from '../effect-runtime/process-runtime-context.js';
6
6
  import { type NodeRuntimeLaunch } from '../runtime/node-runtime.js';
@@ -31,6 +31,10 @@ export interface ExecutorClientMcpSource {
31
31
  subscribe(listener: () => void): () => void;
32
32
  }
33
33
  export interface ExecutorRuntimeBackend {
34
+ startOAuth?(registrationId: string, input: ExecutorOAuthLoginInput, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorOAuthLoginResult>;
35
+ completeOAuth?(registrationId: string, state: string, code: string, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
36
+ cancelOAuth?(registrationId: string, state: string, options?: ExecutorSupervisorRequestOptions): Promise<void>;
37
+ logoutOAuth?(registrationId: string, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
34
38
  registerClientSource?(sourceId: string, source: ExecutorClientMcpSource): () => void;
35
39
  readonly runtimeEpoch: string | undefined;
36
40
  callTool(registrationId: string, invocationId: string, executorAddress: string, args: unknown, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorMcpCallResult>;
@@ -164,6 +168,11 @@ export declare class ExecutorProcessSupervisor implements ExecutorRuntimeBackend
164
168
  configureProxy(policy: ExecutorPrivateProxyPolicy): Promise<void>;
165
169
  subscribeSnapshots(listener: (registrationId: string, snapshot: ExecutorRegistrationSnapshot | undefined) => void): () => void;
166
170
  upsertRegistration(spec: ExecutorRegistrationSpec, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
171
+ startOAuth(registrationId: string, input: ExecutorOAuthLoginInput, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorOAuthLoginResult>;
172
+ completeOAuth(registrationId: string, state: string, code: string, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
173
+ cancelOAuth(registrationId: string, state: string, options?: ExecutorSupervisorRequestOptions): Promise<void>;
174
+ logoutOAuth(registrationId: string, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
175
+ private mutateOAuth;
167
176
  refreshRegistration(registrationId: string, options?: ExecutorSupervisorRequestOptions): Promise<ExecutorRegistrationSnapshot>;
168
177
  getSnapshot(registrationId: string): ExecutorRegistrationSnapshot | undefined;
169
178
  removeRegistration(registrationId: string, options?: ExecutorSupervisorRequestOptions): Promise<void>;