@tencent-ai/agent-sdk 0.3.263-dev.90f0e98.202609190050 → 0.3.263

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 (264) hide show
  1. package/cli/dist/codebuddy-headless.js +1 -1
  2. package/cli/dist/codebuddy-lite-wb.mjs +1 -1
  3. package/cli/dist-server/codebuddy.js +1 -1
  4. package/cli/dist-server/types/node/references/index.d.ts +2 -0
  5. package/cli/dist-server/types/node/settings/settings-controller.d.ts +23 -0
  6. package/cli/dist-server/types/node/settings/settings-validate-middleware.d.ts +9 -0
  7. package/cli/dist-server/types/node/utils/compress-path.source.d.ts +59 -0
  8. package/cli/package.json +2 -3
  9. package/cli/product.cloudhosted.json +2 -2
  10. package/cli/product.internal.json +2 -2
  11. package/cli/product.ioa.json +2 -2
  12. package/cli/product.json +2 -2
  13. package/cli/product.selfhosted.json +2 -2
  14. package/package.json +2 -3
  15. package/cli/dist-server/types/node/a2a/a2a-artifact-download-service.d.ts +0 -51
  16. package/cli/dist-server/types/node/a2a/a2a-context-store.d.ts +0 -100
  17. package/cli/dist-server/types/node/a2a/a2a-remote-cancel.d.ts +0 -111
  18. package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
  19. package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
  20. package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
  21. package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
  22. package/cli/dist-server/types/node/agent/agent-config-cli-fields.d.ts +0 -57
  23. package/cli/dist-server/types/node/agent/agent-controller.d.ts +0 -127
  24. package/cli/dist-server/types/node/agent/agent-display.d.ts +0 -77
  25. package/cli/dist-server/types/node/agent/agent-runtime-adapter.d.ts +0 -69
  26. package/cli/dist-server/types/node/agent/custom-agent-identity.d.ts +0 -54
  27. package/cli/dist-server/types/node/agent/custom-agent-manager.d.ts +0 -43
  28. package/cli/dist-server/types/node/agent/custom-agent-path-registry.d.ts +0 -19
  29. package/cli/dist-server/types/node/agent/insights-data-agent-run-interceptor.d.ts +0 -67
  30. package/cli/dist-server/types/node/agent/interceptor-name-registry.d.ts +0 -4
  31. package/cli/dist-server/types/node/agent/interceptors/channel-event-interceptor.d.ts +0 -44
  32. package/cli/dist-server/types/node/agent/interceptors/command-interceptors.d.ts +0 -71
  33. package/cli/dist-server/types/node/agent/interceptors/deep-research-pending-interceptor.d.ts +0 -30
  34. package/cli/dist-server/types/node/agent/interceptors/env-interceptor.d.ts +0 -7
  35. package/cli/dist-server/types/node/agent/interceptors/file-interceptors.d.ts +0 -38
  36. package/cli/dist-server/types/node/agent/interceptors/image-interceptors.d.ts +0 -47
  37. package/cli/dist-server/types/node/agent/interceptors/index.d.ts +0 -15
  38. package/cli/dist-server/types/node/agent/interceptors/initial-prompt-interceptor.d.ts +0 -29
  39. package/cli/dist-server/types/node/agent/interceptors/model-interceptors.d.ts +0 -43
  40. package/cli/dist-server/types/node/agent/interceptors/sandbox-interceptor.d.ts +0 -68
  41. package/cli/dist-server/types/node/agent/interceptors/sensitive-user-input-interceptor.d.ts +0 -7
  42. package/cli/dist-server/types/node/agent/interceptors/system-reminder-interceptor.d.ts +0 -76
  43. package/cli/dist-server/types/node/agent/interceptors/team-resume-intent-interceptor.d.ts +0 -31
  44. package/cli/dist-server/types/node/agent/interceptors/telemetry-interceptors.d.ts +0 -43
  45. package/cli/dist-server/types/node/agent/interceptors/ultracode-effort-reminder-interceptor.d.ts +0 -21
  46. package/cli/dist-server/types/node/agent/interceptors/ultracode-keyword-interceptor.d.ts +0 -34
  47. package/cli/dist-server/types/node/agent/main-agent-acp-handler.d.ts +0 -203
  48. package/cli/dist-server/types/node/agent/main-agent-policy.d.ts +0 -33
  49. package/cli/dist-server/types/node/agent/memory-context-interceptor.d.ts +0 -84
  50. package/cli/dist-server/types/node/agent/stream-json-init-interceptor.d.ts +0 -9
  51. package/cli/dist-server/types/node/agent/subagent-limits.d.ts +0 -75
  52. package/cli/dist-server/types/node/agent/team-context-interceptor.d.ts +0 -42
  53. package/cli/dist-server/types/node/agent/team-resume-intent.d.ts +0 -20
  54. package/cli/dist-server/types/node/agent/teammate-failure-interceptor.d.ts +0 -67
  55. package/cli/dist-server/types/node/agent-home/agent-home-acp-forward.d.ts +0 -11
  56. package/cli/dist-server/types/node/agent-home/agent-home-agent-create.d.ts +0 -31
  57. package/cli/dist-server/types/node/agent-home/agent-home-audit.d.ts +0 -54
  58. package/cli/dist-server/types/node/agent-home/agent-home-channel-context.d.ts +0 -44
  59. package/cli/dist-server/types/node/agent-home/agent-home-channel-create.d.ts +0 -73
  60. package/cli/dist-server/types/node/agent-home/agent-home-channel-events.d.ts +0 -8
  61. package/cli/dist-server/types/node/agent-home/agent-home-channel-lookup.d.ts +0 -30
  62. package/cli/dist-server/types/node/agent-home/agent-home-channel-speech.d.ts +0 -72
  63. package/cli/dist-server/types/node/agent-home/agent-home-channel-task-events.d.ts +0 -45
  64. package/cli/dist-server/types/node/agent-home/agent-home-channel-task-order.d.ts +0 -25
  65. package/cli/dist-server/types/node/agent-home/agent-home-channel-tasks.d.ts +0 -156
  66. package/cli/dist-server/types/node/agent-home/agent-home-channel-wake-guard.d.ts +0 -35
  67. package/cli/dist-server/types/node/agent-home/agent-home-channel-wake.d.ts +0 -102
  68. package/cli/dist-server/types/node/agent-home/agent-home-colleague-job.d.ts +0 -37
  69. package/cli/dist-server/types/node/agent-home/agent-home-colleague-memory.d.ts +0 -52
  70. package/cli/dist-server/types/node/agent-home/agent-home-deliver.d.ts +0 -76
  71. package/cli/dist-server/types/node/agent-home/agent-home-directory-lock.d.ts +0 -22
  72. package/cli/dist-server/types/node/agent-home/agent-home-errors.d.ts +0 -17
  73. package/cli/dist-server/types/node/agent-home/agent-home-inbox.d.ts +0 -101
  74. package/cli/dist-server/types/node/agent-home/agent-home-main-session.d.ts +0 -33
  75. package/cli/dist-server/types/node/agent-home/agent-home-recipients.d.ts +0 -38
  76. package/cli/dist-server/types/node/agent-home/agent-home-room-context-interceptor.d.ts +0 -30
  77. package/cli/dist-server/types/node/agent-home/agent-home-runtime-arm-state.d.ts +0 -14
  78. package/cli/dist-server/types/node/agent-home/agent-home-runtime.d.ts +0 -87
  79. package/cli/dist-server/types/node/agent-home/agent-home-settings.d.ts +0 -39
  80. package/cli/dist-server/types/node/agent-home/agent-home-tool-gate.d.ts +0 -53
  81. package/cli/dist-server/types/node/agent-home/channel-wake-service.d.ts +0 -69
  82. package/cli/dist-server/types/node/agent-task/categorize-failure.d.ts +0 -65
  83. package/cli/dist-server/types/node/agent-team/shutdown-coordinator.d.ts +0 -98
  84. package/cli/dist-server/types/node/agent-team/team-runtime-adopter.d.ts +0 -13
  85. package/cli/dist-server/types/node/agent-team/team-runtime-manifest.d.ts +0 -66
  86. package/cli/dist-server/types/node/agent-team/team-runtime-status.d.ts +0 -34
  87. package/cli/dist-server/types/node/agent-view/agent-view-actions.d.ts +0 -205
  88. package/cli/dist-server/types/node/agent-view/job-reclaim-gate.d.ts +0 -13
  89. package/cli/dist-server/types/node/ask/index.d.ts +0 -3
  90. package/cli/dist-server/types/node/bash-sandbox/index.d.ts +0 -4
  91. package/cli/dist-server/types/node/code-ratio/cli-git-commit-watcher.d.ts +0 -159
  92. package/cli/dist-server/types/node/code-ratio/cli-svn-commit-watcher.d.ts +0 -111
  93. package/cli/dist-server/types/node/code-ratio/code-ratio-reporting-service.d.ts +0 -90
  94. package/cli/dist-server/types/node/code-ratio/fs-file-reader.d.ts +0 -26
  95. package/cli/dist-server/types/node/code-ratio/index.d.ts +0 -5
  96. package/cli/dist-server/types/node/code-ratio/repo-discovery.d.ts +0 -32
  97. package/cli/dist-server/types/node/code-ratio/vcs-repo-resolver.d.ts +0 -51
  98. package/cli/dist-server/types/node/control-signal/stdout-writer.d.ts +0 -99
  99. package/cli/dist-server/types/node/elicitation/elicitation-service.d.ts +0 -100
  100. package/cli/dist-server/types/node/hooks/admin-trusted.d.ts +0 -41
  101. package/cli/dist-server/types/node/http/api-galileo-metrics.d.ts +0 -19
  102. package/cli/dist-server/types/node/http/classify-network-error.d.ts +0 -21
  103. package/cli/dist-server/types/node/http/custom-header-http-interceptor.d.ts +0 -14
  104. package/cli/dist-server/types/node/http/fetch-proxy.d.ts +0 -22
  105. package/cli/dist-server/types/node/http/http-proxy-interceptor.d.ts +0 -74
  106. package/cli/dist-server/types/node/http/index.d.ts +0 -6
  107. package/cli/dist-server/types/node/http/workbuddy-config-dir.d.ts +0 -17
  108. package/cli/dist-server/types/node/lsp/index.d.ts +0 -6
  109. package/cli/dist-server/types/node/lsp/lsp-client.d.ts +0 -104
  110. package/cli/dist-server/types/node/lsp/lsp-exit-registry.d.ts +0 -16
  111. package/cli/dist-server/types/node/lsp/lsp-manager.d.ts +0 -91
  112. package/cli/dist-server/types/node/lsp/lsp-protocol.d.ts +0 -245
  113. package/cli/dist-server/types/node/model/effort-capabilities.d.ts +0 -64
  114. package/cli/dist-server/types/node/model/passthrough-header-policy.d.ts +0 -25
  115. package/cli/dist-server/types/node/multitask/completion-bus.d.ts +0 -36
  116. package/cli/dist-server/types/node/multitask/coordinator-acp-bridge.d.ts +0 -41
  117. package/cli/dist-server/types/node/multitask/coordinator-interceptor.d.ts +0 -7
  118. package/cli/dist-server/types/node/multitask/coordinator-tool-policy.d.ts +0 -18
  119. package/cli/dist-server/types/node/multitask/delegation-planner.d.ts +0 -6
  120. package/cli/dist-server/types/node/multitask/entry-guard.d.ts +0 -12
  121. package/cli/dist-server/types/node/multitask/host-api.d.ts +0 -63
  122. package/cli/dist-server/types/node/multitask/inspect-self-tool.d.ts +0 -18
  123. package/cli/dist-server/types/node/multitask/multitask-log.d.ts +0 -2
  124. package/cli/dist-server/types/node/multitask/multitask-metrics.d.ts +0 -2
  125. package/cli/dist-server/types/node/multitask/planner-runtime.d.ts +0 -7
  126. package/cli/dist-server/types/node/multitask/sandbox-reveal.d.ts +0 -35
  127. package/cli/dist-server/types/node/multitask/self-model.d.ts +0 -7
  128. package/cli/dist-server/types/node/multitask/slash-entry.d.ts +0 -14
  129. package/cli/dist-server/types/node/multitask/spawn-detached.d.ts +0 -9
  130. package/cli/dist-server/types/node/multitask/subagent-alias.d.ts +0 -5
  131. package/cli/dist-server/types/node/multitask/surface-reminder.d.ts +0 -5
  132. package/cli/dist-server/types/node/multitask/types.d.ts +0 -123
  133. package/cli/dist-server/types/node/multitask/wakeup-gate.d.ts +0 -21
  134. package/cli/dist-server/types/node/navigation/index.d.ts +0 -2
  135. package/cli/dist-server/types/node/runtime/add-dir-middleware.d.ts +0 -13
  136. package/cli/dist-server/types/node/runtime/external-uri-opener.d.ts +0 -8
  137. package/cli/dist-server/types/node/runtime/file-local-storage.d.ts +0 -17
  138. package/cli/dist-server/types/node/runtime/workspace-folder-manager.d.ts +0 -45
  139. package/cli/dist-server/types/node/runtime/workspace.d.ts +0 -5
  140. package/cli/dist-server/types/node/sandbox-cli/network-block-records.d.ts +0 -18
  141. package/cli/dist-server/types/node/shortcut/shortcut-protocol.d.ts +0 -41
  142. package/cli/dist-server/types/node/stats/index.d.ts +0 -5
  143. package/cli/dist-server/types/node/tools/a2a-cancel-task-tool.d.ts +0 -55
  144. package/cli/dist-server/types/node/tools/a2a-get-agent-card-tool.d.ts +0 -59
  145. package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +0 -316
  146. package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +0 -46
  147. package/cli/dist-server/types/node/tools/a2a-send-message-tool.d.ts +0 -138
  148. package/cli/dist-server/types/node/tools/a2a-tool-guards.d.ts +0 -48
  149. package/cli/dist-server/types/node/tools/agent-tool.d.ts +0 -154
  150. package/cli/dist-server/types/node/tools/artifact-common.d.ts +0 -80
  151. package/cli/dist-server/types/node/tools/artifact-control-tool.d.ts +0 -103
  152. package/cli/dist-server/types/node/tools/artifact-tool.d.ts +0 -109
  153. package/cli/dist-server/types/node/tools/ask-user-for-structured-input-tool.d.ts +0 -127
  154. package/cli/dist-server/types/node/tools/ask-user-question-tool.d.ts +0 -237
  155. package/cli/dist-server/types/node/tools/ask-user-question-validation.d.ts +0 -22
  156. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
  157. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -21
  158. package/cli/dist-server/types/node/tools/auto-mode/index.d.ts +0 -15
  159. package/cli/dist-server/types/node/tools/background-output-files.d.ts +0 -39
  160. package/cli/dist-server/types/node/tools/background-output-tail-poller.d.ts +0 -60
  161. package/cli/dist-server/types/node/tools/bash-output-tool.d.ts +0 -34
  162. package/cli/dist-server/types/node/tools/bash-sandbox-approval-requester.d.ts +0 -48
  163. package/cli/dist-server/types/node/tools/bash-security-windows.d.ts +0 -34
  164. package/cli/dist-server/types/node/tools/bash-tool.d.ts +0 -204
  165. package/cli/dist-server/types/node/tools/channel-tasks-tool.d.ts +0 -174
  166. package/cli/dist-server/types/node/tools/computer-use-capabilities.d.ts +0 -23
  167. package/cli/dist-server/types/node/tools/computer-use-executor.d.ts +0 -130
  168. package/cli/dist-server/types/node/tools/computer-use-tool.d.ts +0 -86
  169. package/cli/dist-server/types/node/tools/create-channel-tool.d.ts +0 -82
  170. package/cli/dist-server/types/node/tools/create-colleague-tool.d.ts +0 -64
  171. package/cli/dist-server/types/node/tools/create-mode-write-guard.d.ts +0 -3
  172. package/cli/dist-server/types/node/tools/cron-create-tool.d.ts +0 -41
  173. package/cli/dist-server/types/node/tools/cron-delete-tool.d.ts +0 -28
  174. package/cli/dist-server/types/node/tools/cron-list-tool.d.ts +0 -27
  175. package/cli/dist-server/types/node/tools/defer-execute-tool.d.ts +0 -260
  176. package/cli/dist-server/types/node/tools/delegate-tool.d.ts +0 -71
  177. package/cli/dist-server/types/node/tools/edit-tool.d.ts +0 -78
  178. package/cli/dist-server/types/node/tools/enter-planmode-tool.d.ts +0 -29
  179. package/cli/dist-server/types/node/tools/enter-worktree-tool.d.ts +0 -59
  180. package/cli/dist-server/types/node/tools/exit-planmode-tool.d.ts +0 -86
  181. package/cli/dist-server/types/node/tools/file-action-report-utils.d.ts +0 -35
  182. package/cli/dist-server/types/node/tools/glob-tool.d.ts +0 -102
  183. package/cli/dist-server/types/node/tools/grep-tool.d.ts +0 -141
  184. package/cli/dist-server/types/node/tools/image-edit-tool.d.ts +0 -94
  185. package/cli/dist-server/types/node/tools/image-gen-tool.d.ts +0 -107
  186. package/cli/dist-server/types/node/tools/kill-shell-tool.d.ts +0 -27
  187. package/cli/dist-server/types/node/tools/leave-worktree-tool.d.ts +0 -54
  188. package/cli/dist-server/types/node/tools/list-colleagues-tool.d.ts +0 -35
  189. package/cli/dist-server/types/node/tools/list-mcp-resources-tool.d.ts +0 -58
  190. package/cli/dist-server/types/node/tools/lsp-tool.d.ts +0 -68
  191. package/cli/dist-server/types/node/tools/main-agent-meta-tools.d.ts +0 -107
  192. package/cli/dist-server/types/node/tools/malicious-block-guidance.d.ts +0 -11
  193. package/cli/dist-server/types/node/tools/memory-tool.d.ts +0 -33
  194. package/cli/dist-server/types/node/tools/message-colleague-tool.d.ts +0 -79
  195. package/cli/dist-server/types/node/tools/monitor-tool.d.ts +0 -216
  196. package/cli/dist-server/types/node/tools/monitor-ws-network-policy.d.ts +0 -64
  197. package/cli/dist-server/types/node/tools/monitor-ws-source.d.ts +0 -72
  198. package/cli/dist-server/types/node/tools/multi-edit-tool.d.ts +0 -104
  199. package/cli/dist-server/types/node/tools/notebook-edit-tool.d.ts +0 -75
  200. package/cli/dist-server/types/node/tools/notebook-read-tool.d.ts +0 -55
  201. package/cli/dist-server/types/node/tools/notebook-write-tool.d.ts +0 -7
  202. package/cli/dist-server/types/node/tools/powershell-clm-types.d.ts +0 -30
  203. package/cli/dist-server/types/node/tools/powershell-command-semantics.d.ts +0 -23
  204. package/cli/dist-server/types/node/tools/powershell-dangerous-cmdlets.d.ts +0 -72
  205. package/cli/dist-server/types/node/tools/powershell-destructive-warning.d.ts +0 -12
  206. package/cli/dist-server/types/node/tools/powershell-detection.d.ts +0 -51
  207. package/cli/dist-server/types/node/tools/powershell-git-safety.d.ts +0 -60
  208. package/cli/dist-server/types/node/tools/powershell-pty-utils.d.ts +0 -13
  209. package/cli/dist-server/types/node/tools/powershell-security.d.ts +0 -93
  210. package/cli/dist-server/types/node/tools/powershell-tool.d.ts +0 -174
  211. package/cli/dist-server/types/node/tools/product-interaction-tools.d.ts +0 -23
  212. package/cli/dist-server/types/node/tools/push-notification-tool.d.ts +0 -55
  213. package/cli/dist-server/types/node/tools/read-mcp-resource-tool.d.ts +0 -71
  214. package/cli/dist-server/types/node/tools/read-state-guard.d.ts +0 -22
  215. package/cli/dist-server/types/node/tools/read-tool.d.ts +0 -71
  216. package/cli/dist-server/types/node/tools/repl/index.d.ts +0 -10
  217. package/cli/dist-server/types/node/tools/repl/repl-bridge-broker.d.ts +0 -109
  218. package/cli/dist-server/types/node/tools/repl/repl-bridge-host.d.ts +0 -29
  219. package/cli/dist-server/types/node/tools/repl/repl-catalog-protocol.d.ts +0 -136
  220. package/cli/dist-server/types/node/tools/repl/repl-catalog-render.d.ts +0 -56
  221. package/cli/dist-server/types/node/tools/repl/repl-catalog-source.d.ts +0 -117
  222. package/cli/dist-server/types/node/tools/repl/repl-import-rewrite.d.ts +0 -17
  223. package/cli/dist-server/types/node/tools/repl/repl-nested-interaction.d.ts +0 -32
  224. package/cli/dist-server/types/node/tools/repl/repl-sandbox-result.d.ts +0 -111
  225. package/cli/dist-server/types/node/tools/repl/repl-tool.d.ts +0 -128
  226. package/cli/dist-server/types/node/tools/repl/repl-worker-manager.d.ts +0 -95
  227. package/cli/dist-server/types/node/tools/repl/repl-worker-source.d.ts +0 -16
  228. package/cli/dist-server/types/node/tools/repl/repl-worker-source.generated.d.ts +0 -2
  229. package/cli/dist-server/types/node/tools/report-findings-tool.d.ts +0 -97
  230. package/cli/dist-server/types/node/tools/running-background-tasks.d.ts +0 -26
  231. package/cli/dist-server/types/node/tools/sandbox-approval-helpers.d.ts +0 -19
  232. package/cli/dist-server/types/node/tools/sandbox-intercept-message.d.ts +0 -22
  233. package/cli/dist-server/types/node/tools/sandbox-network-intercept-message.d.ts +0 -25
  234. package/cli/dist-server/types/node/tools/sandbox-permission-file-tool.d.ts +0 -14
  235. package/cli/dist-server/types/node/tools/sandbox-program-blacklist-message.d.ts +0 -9
  236. package/cli/dist-server/types/node/tools/send-message-tool.d.ts +0 -116
  237. package/cli/dist-server/types/node/tools/send-user-message-attachments.d.ts +0 -22
  238. package/cli/dist-server/types/node/tools/send-user-message-tool.d.ts +0 -60
  239. package/cli/dist-server/types/node/tools/shell-stream-pusher.d.ts +0 -25
  240. package/cli/dist-server/types/node/tools/skill-manage-tool.d.ts +0 -77
  241. package/cli/dist-server/types/node/tools/skill-tool.d.ts +0 -129
  242. package/cli/dist-server/types/node/tools/slash-command-tool.d.ts +0 -45
  243. package/cli/dist-server/types/node/tools/speak-in-channel-tool.d.ts +0 -178
  244. package/cli/dist-server/types/node/tools/structured-output-tool.d.ts +0 -43
  245. package/cli/dist-server/types/node/tools/task-create-tool.d.ts +0 -72
  246. package/cli/dist-server/types/node/tools/task-get-tool.d.ts +0 -31
  247. package/cli/dist-server/types/node/tools/task-list-tool.d.ts +0 -21
  248. package/cli/dist-server/types/node/tools/task-output-tool.d.ts +0 -127
  249. package/cli/dist-server/types/node/tools/task-stop-tool.d.ts +0 -61
  250. package/cli/dist-server/types/node/tools/task-update-tool.d.ts +0 -79
  251. package/cli/dist-server/types/node/tools/team-delete-tool.d.ts +0 -38
  252. package/cli/dist-server/types/node/tools/todo-write-tool.d.ts +0 -117
  253. package/cli/dist-server/types/node/tools/tool-permission-strategy.d.ts +0 -83
  254. package/cli/dist-server/types/node/tools/tool-search-tool.d.ts +0 -113
  255. package/cli/dist-server/types/node/tools/video-gen-tool.d.ts +0 -82
  256. package/cli/dist-server/types/node/tools/wait-for-mcp-servers-tool.d.ts +0 -79
  257. package/cli/dist-server/types/node/tools/web-fetch-tool.d.ts +0 -164
  258. package/cli/dist-server/types/node/tools/web-search-tool.d.ts +0 -79
  259. package/cli/dist-server/types/node/tools/webfetch-resource-kind.d.ts +0 -25
  260. package/cli/dist-server/types/node/tools/wechat-reply-tool.d.ts +0 -43
  261. package/cli/dist-server/types/node/tools/wecom-reply-tool.d.ts +0 -65
  262. package/cli/dist-server/types/node/tools/workflow-tool.d.ts +0 -100
  263. package/cli/dist-server/types/node/tools/write-tool.d.ts +0 -74
  264. package/cli/dist-server/types/node/utils/stdio-persistence.d.ts +0 -39
@@ -1,55 +0,0 @@
1
- import { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { AbTestService } from '@genie/product';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { A2aAgentRegistry, A2aClientService, A2aDiscoveryReadyService } from '../a2a/a2a-protocol';
8
- import { BaseTool } from './base-tool';
9
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
10
- declare const A2ACancelTaskParameters: z.ZodObject<{
11
- agent_id: z.ZodString;
12
- task_id: z.ZodString;
13
- }, "strip", z.ZodTypeAny, {
14
- agent_id: string;
15
- task_id: string;
16
- }, {
17
- agent_id: string;
18
- task_id: string;
19
- }>;
20
- /**
21
- * A2ACancelTask — request cancellation of a previously created A2A task
22
- * (issue #99451, CloudAgent Phase 1). Cancellation is a best-effort request,
23
- * not a guarantee per the A2A spec: an already-terminal task cannot be
24
- * canceled (surfaced as `A2ATaskNotCancelableError`), and the remote agent
25
- * may still be mid-flight when this call returns.
26
- *
27
- * Restricted to the main session, same recursive-delegation guard as
28
- * `A2ASendMessageTool` (see that tool's doc comment).
29
- */
30
- export declare class A2ACancelTaskTool extends BaseTool implements Tool {
31
- protected readonly registry?: A2aAgentRegistry;
32
- protected readonly client?: A2aClientService;
33
- protected readonly abTestService?: AbTestService;
34
- protected readonly discoveryReadyService?: A2aDiscoveryReadyService;
35
- protected readonly logger: Logger;
36
- name: ToolNames;
37
- description: string;
38
- needsApproval: boolean;
39
- parameters: z.ZodObject<{
40
- agent_id: z.ZodString;
41
- task_id: z.ZodString;
42
- }, "strip", z.ZodTypeAny, {
43
- agent_id: string;
44
- task_id: string;
45
- }, {
46
- agent_id: string;
47
- task_id: string;
48
- }>;
49
- argumentRenderer: ToolCallArgumentRenderer;
50
- isEnabled: (args: {
51
- runContext: RunContext<Session>;
52
- }) => Promise<boolean>;
53
- execute(input: z.infer<typeof A2ACancelTaskParameters>, context: RunContext<Session>): Promise<ToolResult>;
54
- }
55
- export {};
@@ -1,59 +0,0 @@
1
- import { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { AbTestService } from '@genie/product';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { A2aAgentRegistry, A2aDiscoveryReadyService } from '../a2a/a2a-protocol';
8
- import { BaseTool } from './base-tool';
9
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
10
- declare const A2AGetAgentCardParameters: z.ZodObject<{
11
- agent_id: z.ZodString;
12
- }, "strip", z.ZodTypeAny, {
13
- agent_id: string;
14
- }, {
15
- agent_id: string;
16
- }>;
17
- /**
18
- * A2AGetAgentCard — resolve one outbound A2A agent by its stable `agent_id`
19
- * and return its full Agent Card (issue #99451; id-only addressing per issue
20
- * #114840). The available agents are advertised in this tool's description
21
- * (`<available_A2A_agents>`, each line prefixed with its `[id]`), populated
22
- * dynamically at render time from the process-global `A2aAgentRegistry` (see
23
- * the `A2A_GET_AGENT_CARD` case in tool-manager.ts). The registry is filled by
24
- * lazy discovery against `CODEBUDDY_REMOTE_AGENTS_URL` (see
25
- * `A2aDiscoveryReadyService`) plus a background startup trigger and a bounded
26
- * first-run prewait, so the block reflects the currently authorized agents
27
- * with no session-startup network cost. The model calls this to get an agent's
28
- * full skills/interfaces before `A2ASendMessage`; the `agent_id` it passes here
29
- * is the same one it passes to the send/get/cancel tools.
30
- *
31
- * Lookup is an exact `agentId` match (`deriveA2aAgentId` gives distinct ids to
32
- * distinct endpoints, so it is never ambiguous). A miss returns
33
- * `AGENT_NOT_FOUND` listing the available `name (id)` pairs.
34
- *
35
- * Restricted to the main session, same recursive-delegation guard as the
36
- * other 3 A2A tools (see `isSubSession` in a2a-tool-guards.ts).
37
- */
38
- export declare class A2AGetAgentCardTool extends BaseTool implements Tool {
39
- protected readonly registry?: A2aAgentRegistry;
40
- protected readonly abTestService?: AbTestService;
41
- protected readonly discoveryReadyService?: A2aDiscoveryReadyService;
42
- protected readonly logger: Logger;
43
- name: ToolNames;
44
- description: string;
45
- needsApproval: boolean;
46
- parameters: z.ZodObject<{
47
- agent_id: z.ZodString;
48
- }, "strip", z.ZodTypeAny, {
49
- agent_id: string;
50
- }, {
51
- agent_id: string;
52
- }>;
53
- argumentRenderer: ToolCallArgumentRenderer;
54
- isEnabled: (args: {
55
- runContext: RunContext<Session>;
56
- }) => Promise<boolean>;
57
- execute(input: z.infer<typeof A2AGetAgentCardParameters>, context: RunContext<Session>): Promise<ToolResult>;
58
- }
59
- export {};
@@ -1,316 +0,0 @@
1
- import { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { FunctionCallItem, ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { AbTestService } from '@genie/product';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { A2aAgentRegistry, A2aArtifactDownloadService, A2aClientService, A2aDiscoveryReadyService, A2aTaskStatus } from '../a2a/a2a-protocol';
8
- import { ElicitationService } from '../elicitation/elicitation-service';
9
- import { BaseTool } from './base-tool';
10
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
11
- declare const A2AGetTaskParameters: z.ZodObject<{
12
- agent_id: z.ZodString;
13
- task_id: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- agent_id: string;
16
- task_id: string;
17
- }, {
18
- agent_id: string;
19
- task_id: string;
20
- }>;
21
- export declare const ENV_POLL_INTERVAL_MS = "CODEBUDDY_A2A_POLL_INTERVAL_MS";
22
- export declare const ENV_POLL_MAX_DURATION_MS = "CODEBUDDY_A2A_POLL_MAX_DURATION_MS";
23
- export interface A2APollPolicy {
24
- /**
25
- * Constant gap between polls, ms. Default 500ms.
26
- *
27
- * Flat rather than exponentially backed off. Backoff optimizes for the
28
- * long tail, but the tail is exactly where it hurts: it used to stretch
29
- * to a 30s gap, so a task finishing at second 31 was reported up to 30
30
- * seconds late, and the user watching the progress line saw a stall. A
31
- * remote task the user is actively waiting on is worth one cheap request
32
- * every half second.
33
- */
34
- intervalMs: number;
35
- /**
36
- * Wall-clock budget for the whole loop, ms. Default 30 minutes.
37
- *
38
- * A HARD cap: when it runs out the remote task is canceled, so this is
39
- * the longest a single outbound task may run — not merely the longest a
40
- * single call waits.
41
- */
42
- maxDurationMs: number;
43
- }
44
- /**
45
- * Resolve the effective poll policy, applying any env overrides on top of
46
- * `DEFAULT_POLL_POLICY`. Read fresh on every `execute()` call — not cached
47
- * — so a test/host can change the env between calls.
48
- *
49
- * Only these two knobs are exposed. The retry schedule for a FAILED request
50
- * (see a2a-poll-retry.ts) is fixed, because the cadence and the budget are
51
- * the only two a host has a reason to tune and every additional dial is one
52
- * more way to configure the loop into a request storm.
53
- */
54
- export declare function resolvePollPolicy(): A2APollPolicy;
55
- /** Exported so `A2ASendMessageTool` can classify its own (single, non-looping) result the same way — see that tool's artifact-download integration. */
56
- export declare function isTerminal(status: A2aTaskStatus): boolean;
57
- /** Test-only reset of {@link userStoppedTasks} (process-lifetime map in production). */
58
- export declare function __resetUserStoppedTasksForTest(): void;
59
- /**
60
- * A2AGetTask — wait for a previously created outbound A2A task to finish
61
- * (issue #99451 CloudAgent Phase 1; Phase 2 revises this from a bare
62
- * single-shot query into the tool that owns the ENTIRE bounded, streamed
63
- * poll loop — see the design doc's "A.7 Tool ownership split" section).
64
- *
65
- * Every non-terminal status — including `input-required`/`auth-required` —
66
- * is relayed (A.2's live-progress mechanism, reusing the foreground Bash
67
- * tool's `session.inputSubject.next({status: 'in_progress', ...})` pattern)
68
- * and polled straight through at a fixed interval (A.3), never treated as a
69
- * stop condition (A.5).
70
- *
71
- * Three things stop the loop, and only one of them is a plain success:
72
- *
73
- * - one of the 4 terminal states (`completed`/`failed`/`canceled`/`rejected`);
74
- * - the wall-clock budget running out;
75
- * - `tasks/get` failing in a way that survives the retry schedule.
76
- *
77
- * The last two both END the remote task: the loop issues `tasks/cancel` and
78
- * reports what that cancel actually did. This is a deliberate reversal of the
79
- * older "give up for now, let the model re-poll" contract, which left a
80
- * remote task running with nobody watching it whenever the model chose not to
81
- * call back. The cost is that the budget is now a ceiling on the TASK, not
82
- * just on the call — a task that needs longer than `maxDurationMs` cannot
83
- * finish, and the host has to raise the budget for it.
84
- *
85
- * **One exception, added in issue #107183: approval interrupts.** When a poll
86
- * observes a `snapshot.approval` payload (an out-of-band approval the remote
87
- * agent is waiting on — see `A2aTaskSnapshot.approval`), relaying opaque
88
- * `(N pending approval)` text and polling on until the budget runs out gives
89
- * the user no way to act. So the loop PAUSES and raises an ACP `elicitation/create`
90
- * card carrying the approval tokens, then resumes or stops per the answer:
91
- *
92
- * - `accept` — resume polling and do nothing else. The host delivers the
93
- * approval out of band (agent-cli never submits it: it has neither the
94
- * approving system's endpoint nor the user's credentials there), so the
95
- * task's own recovery is what the next poll observes.
96
- * - `decline` — the user said no. Cancel the remote task and report the real
97
- * cancel outcome, so nothing is left orphaned waiting on an approval that
98
- * will never come.
99
- * - `cancel` — no answer (card dismissed, or the host's 10-minute fallback).
100
- * Same handling as `decline`, but the model is told nobody answered rather
101
- * than that the user refused.
102
- *
103
- * If the session has no elicitation channel at all (TUI, or an SDK client
104
- * that never declared `elicitation.form`), this falls back to exactly the
105
- * pre-#107183 behavior: relay and keep polling. The branch is additive.
106
- *
107
- * Restricted to the main session, same recursive-delegation guard as
108
- * `A2ASendMessageTool` (see that tool's doc comment).
109
- */
110
- export declare class A2AGetTaskTool extends BaseTool implements Tool {
111
- protected readonly registry?: A2aAgentRegistry;
112
- protected readonly client?: A2aClientService;
113
- protected readonly abTestService?: AbTestService;
114
- protected readonly discoveryReadyService?: A2aDiscoveryReadyService;
115
- protected readonly downloadService?: A2aArtifactDownloadService;
116
- /**
117
- * Optional so a session without any elicitation channel — and the unit
118
- * tests, which construct this tool directly without a DI container —
119
- * fall back to the pre-#107183 relay-and-keep-polling behavior instead
120
- * of failing.
121
- */
122
- protected readonly elicitationService?: ElicitationService;
123
- protected readonly logger: Logger;
124
- name: ToolNames;
125
- description: string;
126
- needsApproval: boolean;
127
- parameters: z.ZodObject<{
128
- agent_id: z.ZodString;
129
- task_id: z.ZodString;
130
- }, "strip", z.ZodTypeAny, {
131
- agent_id: string;
132
- task_id: string;
133
- }, {
134
- agent_id: string;
135
- task_id: string;
136
- }>;
137
- argumentRenderer: ToolCallArgumentRenderer;
138
- isEnabled: (args: {
139
- runContext: RunContext<Session>;
140
- }) => Promise<boolean>;
141
- execute(input: z.infer<typeof A2AGetTaskParameters>, context: RunContext<Session>, details?: {
142
- toolCall: FunctionCallItem;
143
- }): Promise<ToolResult>;
144
- /**
145
- * One logical poll: a `tasks/get`, plus up to
146
- * {@link POLL_RETRY_MAX_ATTEMPTS} retries when the failure looks
147
- * transient.
148
- *
149
- * Retrying at all is the point. Before this, a single hiccup — a 502 from
150
- * a load balancer mid-deploy, a reset socket — ended a poll the user had
151
- * been waiting minutes for. What is NOT retried is a 400-409: those say
152
- * the request itself is wrong (bad task id, no permission), and repeating
153
- * it five times just delays telling the model something it needs to act
154
- * on. See `classifyPollFailure` for where that line is drawn and why it
155
- * is not simply "all of 4xx".
156
- *
157
- * Three ways out:
158
- * - a snapshot, on the first try or a later one;
159
- * - a THROWN `ToolExecutionError`, for a non-retryable failure or a user
160
- * abort — the model gets the error, the task is left alone;
161
- * - `give-up`, when the retries (or the budget) ran out. The caller ends
162
- * the remote task and reports; this is not an exception because it is a
163
- * reportable outcome, not a broken call.
164
- */
165
- private pollWithRetry;
166
- private abortedError;
167
- /**
168
- * Error text for a failure the model has to act on itself.
169
- *
170
- * Leads with the HTTP status because that is what tells a 404 (wrong task
171
- * id — the model may have one from an earlier turn) apart from a 403
172
- * (this agent is not allowed here — retrying will never help), and
173
- * carries the remote's own response body, which is where an agent
174
- * normally puts the part a human can act on.
175
- */
176
- private formatRequestFailure;
177
- /**
178
- * A.2's live-progress relay — the SAME `session.inputSubject.next({...})`
179
- * shape the foreground Bash tool uses for its own streaming updates
180
- * (`bash-tool.ts`'s `updateToolResult()`), reusing the tool call's own
181
- * `callId` and a single `streamingResultId` held for the whole loop.
182
- * `providerData.toolResult.rawResponse.a2a` carries the FULL snapshot
183
- * (including `snapshot.raw`'s structured `parts`/`metadata`), not just
184
- * the derived text — required for a frontend that knows how to render a
185
- * structured interrupt payload (e.g. a WeCom `wecom_part_type: 'approval'`
186
- * card, see A.2) to have the data it needs.
187
- *
188
- * **Also pushes the SAME item to `session.combineSubject`** — traced
189
- * empirically (issue #99451 Phase 2 e2e work) that `inputSubject.next()`
190
- * alone, exactly as Bash's own `updateToolResult()` does it, never
191
- * reaches either transport's actual subscription: both
192
- * `stream-json-view.ts` and `acp-agent.ts` subscribe ONLY to
193
- * `session.combineSubject` (`{type: 'input', data: item}`), and nothing
194
- * bridges `inputSubject` into `combineSubject` except
195
- * `SessionManager.addHistory()`'s explicit dual-push for REAL history
196
- * items — which a live, ephemeral, non-terminal relay frame like this
197
- * one deliberately is not (it's never persisted to `session.history`).
198
- * Confirmed live: Bash's OWN in-progress streaming updates do NOT
199
- * currently reach stream-json `-p` output either (only its terminal
200
- * result does) — that's a pre-existing gap in `bash-tool.ts`, out of
201
- * scope to fix here, but exactly why this method can't just copy Bash's
202
- * `inputSubject`-only call and call it done: A.2's actual requirement is
203
- * multiple live relay frames on BOTH transports, so this pushes to both
204
- * subjects explicitly rather than reproducing that gap.
205
- */
206
- private relayProgress;
207
- /**
208
- * Raise an approval card for an out-of-band approval interrupt and turn
209
- * the user's answer into a poll-loop decision (issue #107183).
210
- *
211
- * No timeout is passed. `elicit()` cannot be told to wait forever anyway
212
- * (a `0`/absent `timeoutMs` falls back to its 10-minute default), and the
213
- * host already guarantees an answer arrives: sandbox-proxy synthesizes a
214
- * `cancel` response after 10 minutes of its own. So "wait for the host's
215
- * signal" needs no timeout code here — a host/CLI timeout simply shows up
216
- * as the `cancel` branch.
217
- */
218
- private handleApprovalInterrupt;
219
- /**
220
- * Model-facing result after a user ended a task from an approval card.
221
- *
222
- * Written as named sections — what was shown, what happened, and the
223
- * host's reason — rather than one prose paragraph, because the single
224
- * line that has to win was getting buried mid-sentence: this tool's own
225
- * `description` tells the model in MUST-level wording to immediately
226
- * re-poll any non-final result, so the text has to say plainly that
227
- * polling is over.
228
- *
229
- * Only counter-intuitive instructions are spelled out. Telling the user
230
- * the action did not happen is what a model does anyway; not re-polling,
231
- * closing an unconfirmed cancel out with `A2ACancelTask`, and reporting a
232
- * real terminal state instead of the refusal are the three it would
233
- * otherwise get wrong.
234
- *
235
- * When the cancel revealed the task was already terminal — commonly
236
- * because the approval was granted through the approving system's own UI
237
- * while our card sat open — the REAL state is reported through the
238
- * existing `formatTerminalContent()`, so a completed task is never
239
- * reported as a refusal.
240
- *
241
- * No agent id anywhere: it is the registry's routing key and is not
242
- * guaranteed to match the card's display name (see `A2aRegisteredAgent`),
243
- * while `taskId` alone already identifies the task uniquely.
244
- */
245
- private buildApprovalStopResult;
246
- /** Blank line between sections, reasons always last — see {@link appendApprovalResponseNotes}. */
247
- private composeSections;
248
- /**
249
- * Append host-supplied reasons as the LAST section of the result.
250
- *
251
- * The JSON encoding is the actual guard, not formatting: it collapses
252
- * newlines and heading-looking text into a single string literal, so a
253
- * reason cannot forge a section of its own. Keeping it last means no
254
- * instruction ever follows client-controlled text.
255
- *
256
- * A lone reason needs no action label — the section above it already said
257
- * what the user did. Several reasons only happen when one call raised more
258
- * than one card (accepting one approval, then declining another), and
259
- * there the labels are what keep two opposite answers apart.
260
- */
261
- private appendApprovalResponseNotes;
262
- /**
263
- * Make the terminal STATE explicit in the model-facing content.
264
- * `normalizeTask` derives the snapshot `text` from the task's
265
- * `status.message`/artifacts — which for a `canceled`/`failed`/`rejected`
266
- * task is frequently the remote agent's own progress narration (e.g.
267
- * "...正在发送 hello"), reading like success and causing the model to
268
- * misreport a non-success terminal task as done (issue #99451 follow-up:
269
- * observed a user-cancelled task reported back as "message sent"). Only
270
- * `completed` needs no prefix — its text IS the answer. The other three
271
- * terminal states are prefixed with an unmissable header so the model
272
- * cannot mistake the trailing narration for a success confirmation. The
273
- * raw state is still available in `rawResponse.a2a.status` for any
274
- * consumer that reads it structurally.
275
- */
276
- private formatTerminalContent;
277
- /**
278
- * The ordinary end of a poll: the task reached a terminal state, so wait
279
- * out its artifact downloads and hand the model the result.
280
- *
281
- * Shared with the stop path below, which lands here whenever a cancel
282
- * discovers the task had already finished. That sharing is the point —
283
- * a task that completed WITH attachments in the second before we tried to
284
- * cancel it must not lose them to a different, artifact-unaware code
285
- * path.
286
- *
287
- * Assumes its snapshot's downloads have already been kicked off; both
288
- * callers do that, the loop on every tick and the stop path for the
289
- * snapshot the cancel read back.
290
- */
291
- private buildTerminalResult;
292
- /**
293
- * End the remote task and tell the model what that actually did.
294
- *
295
- * Reached when the loop gives up on a task that never finished — the
296
- * budget ran out, or `tasks/get` kept failing. Both used to return "still
297
- * running, call me again", which read fine but left a real task running
298
- * on the remote agent for as long as it liked whenever the model decided
299
- * not to call back. Ending it here means the ceiling is enforced rather
300
- * than merely reported.
301
- *
302
- * The cancel is what produces the text, not a guess made before it:
303
- *
304
- * - `already-terminal` — the task crossed the finish line while we were
305
- * canceling it, so there is nothing to narrate. It goes back through
306
- * the normal terminal path and the model sees an ordinary result,
307
- * artifacts and all.
308
- * - `canceled` — say so, and name the state the remote reported rather
309
- * than assuming CANCELED; nothing in the spec pins `tasks/cancel` to
310
- * one value.
311
- * - `unknown` — we could not confirm anything, so the model is told the
312
- * task may still be running and pointed at `A2ACancelTask`.
313
- */
314
- private buildPollStoppedResult;
315
- }
316
- export {};
@@ -1,46 +0,0 @@
1
- /**
2
- * Retry policy for a FAILED `tasks/get` REQUEST — distinct from
3
- * `A2APollPolicy`, which governs the cadence of SUCCESSFUL polls. A request
4
- * that never produced a task snapshot is retried on this schedule; a request
5
- * that did is subject to the poll interval instead.
6
- *
7
- * Fixed rather than env-overridable: the poll interval and the overall budget
8
- * are the two knobs a host has a legitimate reason to tune, and every extra
9
- * one is a way to misconfigure the loop into a request storm.
10
- */
11
- export declare const POLL_RETRY_MAX_ATTEMPTS = 5;
12
- export declare const POLL_RETRY_BASE_INTERVAL_MS = 1000;
13
- export declare const POLL_RETRY_BACKOFF_MULTIPLIER = 1.5;
14
- export interface PollFailureClassification {
15
- /**
16
- * The HTTP status behind this failure, when one could be established.
17
- * Absent for transport failures that never got a response at all (DNS,
18
- * connection reset, the client's own timeout) — deliberately not defaulted
19
- * to 500, so the model is never told a status the wire did not carry.
20
- */
21
- httpStatus?: number;
22
- /** Whether the poll loop should retry rather than give up. */
23
- retryable: boolean;
24
- /** The SDK's error text, verbatim. */
25
- message: string;
26
- /**
27
- * What the remote actually said: the `Response:` tail of the SDK's HTTP
28
- * error text, or a JSON-RPC error's structured `data`. Absent when the
29
- * failure produced no body.
30
- */
31
- responseBody?: string;
32
- }
33
- /**
34
- * Decide whether a failed `tasks/get` request is worth retrying, and pull out
35
- * the detail the model needs either way.
36
- *
37
- * Knows nothing about aborts on purpose. A user cancel and the client's own
38
- * 120s request timeout reach this function as the SAME error text (see
39
- * `A2aClientService.withAbortAndClient`), so only the caller — which can read
40
- * `session.abortSignal` — can tell them apart. This classifies the timeout
41
- * reading of that message (retryable) and leaves the cancel reading to the
42
- * poll loop.
43
- */
44
- export declare function classifyPollFailure(err: unknown): PollFailureClassification;
45
- /** Wait before the `retryIndex`-th (0-based) retry: 1s, 1.5s, 2.25s, 3.375s, 5.0625s. */
46
- export declare function pollRetryDelayMs(retryIndex: number): number;
@@ -1,138 +0,0 @@
1
- import { Session, SessionManager } from '../../vendor/cbc-core/node/index.js';
2
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { AbTestService } from '@genie/product';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { A2aAgentRegistry, A2aArtifactDownloadService, A2aClientService, A2aDiscoveryReadyService } from '../a2a/a2a-protocol';
8
- import { BaseTool } from './base-tool';
9
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
10
- declare const A2ASendMessageParameters: z.ZodObject<{
11
- agent_id: z.ZodString;
12
- message: z.ZodString;
13
- skill_id: z.ZodOptional<z.ZodString>;
14
- attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
- url: z.ZodString;
16
- filename: z.ZodOptional<z.ZodString>;
17
- media_type: z.ZodOptional<z.ZodString>;
18
- }, "strip", z.ZodTypeAny, {
19
- url: string;
20
- filename?: string | undefined;
21
- media_type?: string | undefined;
22
- }, {
23
- url: string;
24
- filename?: string | undefined;
25
- media_type?: string | undefined;
26
- }>, "many">>;
27
- }, "strip", z.ZodTypeAny, {
28
- agent_id: string;
29
- message: string;
30
- skill_id?: string | undefined;
31
- attachments?: {
32
- url: string;
33
- filename?: string | undefined;
34
- media_type?: string | undefined;
35
- }[] | undefined;
36
- }, {
37
- agent_id: string;
38
- message: string;
39
- skill_id?: string | undefined;
40
- attachments?: {
41
- url: string;
42
- filename?: string | undefined;
43
- media_type?: string | undefined;
44
- }[] | undefined;
45
- }>;
46
- /**
47
- * A2ASendMessage — invoke one outbound A2A agent (issue #99451 CloudAgent
48
- * Phase 1; ownership split revised in Phase 2, see the design doc's "A.7
49
- * Tool ownership split" section). Single, non-looping RPC call: makes
50
- * exactly one `message/send` request and returns whatever it gets back to
51
- * the model UNMODIFIED — terminal, `working`, `input-required`, anything.
52
- * No polling, no streaming, no waiting for a terminal state — that's
53
- * `A2AGetTaskTool`'s job (see its doc comment), which this tool's own
54
- * description tells the model to call when the result isn't final.
55
- *
56
- * Restricted to the main session: subagent/team sessions never see this tool
57
- * enabled, which is the enforcement point that prevents A2A-triggered
58
- * recursive delegation (a subagent cannot itself call out to another A2A
59
- * agent). Multiple `@` targets are handled by the model issuing several
60
- * parallel `A2ASendMessage` calls in one turn — there is no separate
61
- * "multi-agent" tool.
62
- *
63
- * Conversation continuity is handled here, not by the model: the A2A
64
- * `contextId` returned by a call is remembered per `(session, agentId)` and
65
- * replayed on the next call to that agent, so the remote side sees one
66
- * continuing conversation. The model never sees or supplies the id. See
67
- * a2a-context-store.ts for the storage, isolation and expiry rules.
68
- */
69
- export declare class A2ASendMessageTool extends BaseTool implements Tool {
70
- protected readonly registry?: A2aAgentRegistry;
71
- protected readonly client?: A2aClientService;
72
- protected readonly abTestService?: AbTestService;
73
- protected readonly discoveryReadyService?: A2aDiscoveryReadyService;
74
- protected readonly downloadService?: A2aArtifactDownloadService;
75
- protected readonly sessionManager?: SessionManager;
76
- protected readonly logger: Logger;
77
- name: ToolNames;
78
- description: string;
79
- needsApproval: boolean;
80
- parameters: z.ZodObject<{
81
- agent_id: z.ZodString;
82
- message: z.ZodString;
83
- skill_id: z.ZodOptional<z.ZodString>;
84
- attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
- url: z.ZodString;
86
- filename: z.ZodOptional<z.ZodString>;
87
- media_type: z.ZodOptional<z.ZodString>;
88
- }, "strip", z.ZodTypeAny, {
89
- url: string;
90
- filename?: string | undefined;
91
- media_type?: string | undefined;
92
- }, {
93
- url: string;
94
- filename?: string | undefined;
95
- media_type?: string | undefined;
96
- }>, "many">>;
97
- }, "strip", z.ZodTypeAny, {
98
- agent_id: string;
99
- message: string;
100
- skill_id?: string | undefined;
101
- attachments?: {
102
- url: string;
103
- filename?: string | undefined;
104
- media_type?: string | undefined;
105
- }[] | undefined;
106
- }, {
107
- agent_id: string;
108
- message: string;
109
- skill_id?: string | undefined;
110
- attachments?: {
111
- url: string;
112
- filename?: string | undefined;
113
- media_type?: string | undefined;
114
- }[] | undefined;
115
- }>;
116
- argumentRenderer: ToolCallArgumentRenderer;
117
- isEnabled: (args: {
118
- runContext: RunContext<Session>;
119
- }) => Promise<boolean>;
120
- execute(input: z.infer<typeof A2ASendMessageParameters>, context: RunContext<Session>): Promise<ToolResult>;
121
- /**
122
- * Flush the updated continuation map to the session transcript, following
123
- * the same "mutate session.meta, then save" shape the other whitelisted
124
- * meta keys use (see main-agent-session.ts).
125
- *
126
- * Two deliberate properties:
127
- *
128
- * - **No-op for served sessions.** `save()` returns early when session
129
- * persistence is disabled, so ACP / gateway sessions keep the
130
- * in-memory map and simply write nothing.
131
- * - **Never fails the A2A call.** The remote agent has already done the
132
- * work by this point; losing the continuation pointer costs the next
133
- * call its context, which is a far smaller loss than turning a
134
- * succeeded call into a tool error.
135
- */
136
- private persistContinuation;
137
- }
138
- export {};
@@ -1,48 +0,0 @@
1
- import { AbTestService } from '@genie/product';
2
- import type { Logger } from '@genie/telemetry';
3
- import { A2aDirectoryView, A2aDiscoveryReadyService, A2aRegisteredAgent } from '../a2a/a2a-protocol';
4
- import { Session } from '../../vendor/cbc-core/node/index.js';
5
- import { ToolErrorCode } from './tool-error-codes';
6
- /**
7
- * Shared guard rails for every model-facing A2A tool (issue #99451):
8
- * gate check (exposure + execution layer, per `ProductFeature.A2AOutbound`
9
- * doc comment), main-session-only restriction (recursive-delegation guard),
10
- * discovery readiness (issue #99451 follow-up: URL-based discovery is lazy,
11
- * so every tool must await it before touching the registry), and agent
12
- * lookup with a consistent "not registered" error. Centralized so
13
- * `A2ASendMessageTool` / `A2AGetTaskTool` / `A2ACancelTaskTool` can't drift
14
- * on wording or accidentally skip a layer.
15
- */
16
- export declare function isSubSession(session: Session | undefined): boolean;
17
- /**
18
- * Execution-layer guard run at the top of every A2A tool's `execute()`.
19
- * Throws a `ToolExecutionError` if the gate is off or the call originates
20
- * from a sub-agent/team session — this is the defense-in-depth re-check
21
- * beyond `isEnabled` (stale cached tool-call / history replay / resumed
22
- * session must not bypass a runtime kill-switch just because `isEnabled`
23
- * gated it once already).
24
- *
25
- * Also awaits `A2aDiscoveryReadyService.waitForDiscovery()` — the shared
26
- * freshness/single-flight gate for discovery (see that interface's doc comment
27
- * for why each tool does not manage caching independently). Optional/no-op
28
- * when the component isn't
29
- * assembled (e.g. a headless build without the A2A feature), matching this
30
- * function's existing tolerance for missing components via `hasRequiredComponents`.
31
- */
32
- export declare function assertA2AToolAllowed(hasRequiredComponents: boolean, session: Session | undefined, abTestService: AbTestService | undefined, discoveryReadyService?: A2aDiscoveryReadyService, logger?: Pick<Logger, 'debug'>): Promise<void>;
33
- /**
34
- * Look up an agent by its stable `agentId` — the sole addressing key for every
35
- * model-facing A2A tool (issue #114840). The id is a `${slug(name)}-${hash(url)}`
36
- * key derived at discovery (see `deriveA2aAgentId`), surfaced to the model in
37
- * `<available_A2A_agents>` and by `A2AGetAgentCard`, and copied verbatim into
38
- * the send/get/cancel tools the same way a `task_id` is. Exact match only:
39
- * distinct endpoints get distinct ids, so a lookup is never ambiguous. Throws a
40
- * consistent "not registered" error listing the available `name (id)` pairs so
41
- * the model can correct a mistyped id.
42
- */
43
- export declare function requireA2AAgent(registry: A2aDirectoryView, agentId: string): A2aRegisteredAgent;
44
- /** Classify a thrown A2aClientService error into the right ToolErrorCode by matching known message patterns (see a2a-client-service.ts's doc comment on why we match text rather than `instanceof` typed SDK errors — this SDK version's JSON-RPC transport doesn't reconstruct semantic error subclasses). */
45
- export declare function classifyA2AError(err: unknown): {
46
- message: string;
47
- code: ToolErrorCode;
48
- };