@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,216 +0,0 @@
1
- /**
2
- * MonitorTool —— 后台监视一个事件源,把增量内容主动推回主 agent。
3
- *
4
- * 事件源有两种(互斥):
5
- * - `command`(issue #74426):后台跑命令,把其增量输出推回。
6
- * - `ws`(issue #74436):连一个 `ws://`/`wss://` URL,把服务端推来的每条消息推回。
7
- *
8
- * 背景 / 设计取舍
9
- * ================
10
- * 对齐 Claude Code Tools Reference 的 `Monitor` 章节:模型后台监视某个东西,有新内容
11
- * 时不用主动轮询 `BashOutput`/`TaskOutput`,而是被系统"主动唤醒"看到增量内容。
12
- *
13
- * 关键发现(调研已核实):这不是一个新基础设施,而是把两个已存在的能力接起来:
14
- * 1. **反应式推送通道**:`BackgroundTaskNotifier`(`enqueueMessage` + 忙闲判断的
15
- * `scheduleDrain`)——本工具复用其新增的 `notifyEvent()` 方法(区别于
16
- * `notifyCompletion()`:不做 per-task `notified` 幂等,因为"多次增量 tick"本身
17
- * 就是预期语义,不是重复通知)。
18
- * 2. **文件 tail 能力**:`BackgroundOutputTailPoller`——本工具复用其新增的 `onChunk`
19
- * 回调(bash-tool/powershell-tool 不传,行为不变),每次 tick 读到新内容时触发。
20
- *
21
- * command 源的拉起复用 `SandboxOrchestrator`(与 BashTool 同一条沙箱优先执行路径),
22
- * 输出走文件 fd 模式(`prepareBackgroundOutputFiles`),保证子进程/孙进程的
23
- * stdout/stderr 落盘、父进程不持有写端。
24
- *
25
- * ws 源不经过 shell / 沙箱 / 文件 fd(没有进程可言),直接把 socket 消息写进
26
- * `TruncateBuffer` 并推事件;生命周期仍复用同一个 `BackgroundTask` 契约,
27
- * 因此 `TaskStop` / `TaskOutput` / `TaskList` 全部零改动可用
28
- * (已核实 `TaskOutput.executeBackgroundShellTask` 只读 stdout/stderr buffer,
29
- * 不依赖 `outputFilePath`,所以纯内存的 ws 任务能正常被查询)。
30
- *
31
- * 与 BashTool `run_in_background` 的关键区别:
32
- * - BashTool 的通知只在任务**终态**(completed/failed/killed)时推送一次。
33
- * - MonitorTool 在任务**运行期间**的每个增量 tick 都推送(command 模式合并同一 tick
34
- * 内的多行输出成一条 `<monitor-event>`;ws 模式严格一条消息一个事件,见下),
35
- * 任务终态时改推一条 status=done 的收尾事件。
36
- *
37
- * **command 与 ws 的事件粒度刻意不同**:command 模式按 tick 合并多行(避免逐行刷屏);
38
- * ws 模式一条消息 = 一个事件、即使消息跨多行也不拆,因为消息边界是 WebSocket 的协议
39
- * 语义,合并会破坏它。(附注:CC 文档描述 command 模式为逐行回传,我们是按 tick 合并,
40
- * 这是 #74426 既有的有意偏差,本 issue 不改动 command 侧行为。)
41
- *
42
- * 停止机制:复用 `TaskStopTool` / `ToolManager.killBackgroundTask` 现有的后台任务
43
- * 终止路径——本工具注册的 task 与 bash-tool 的 task 走同一个 `BackgroundTask` 契约,
44
- * `TaskStop` 无需任何改动即可停止一个 Monitor(两种事件源都是)。
45
- *
46
- * 开关:默认开启(cbc-cli 场景不需要任何额外配置)。理由见 issue #74426 的"三次审计
47
- * 修正"结论——WorkBuddy 侧 `mode-tools-config.ts` 已有独立生效的工具白名单天然隔离,
48
- * agent-cli 侧不需要再叠加一道默认关闭的环境变量;`CODEBUDDY_MONITOR_ENABLED=false`
49
- * 仍可显式关闭(与 ReportFindings/PushNotification 同档)。
50
- *
51
- * ws 源的安全边界(issue #74436,务必理解后再改动)
52
- * ================================================
53
- * 出站连接的闸门是 **`execute()` 内每次调用都跑的 `checkWsNetworkPolicy`**,
54
- * 不是审批弹窗。审批可以被用户的"本会话不再询问"缓存跳过,但网络策略检查不会被跳过,
55
- * 所以私有地址 / cloud metadata / 有序网络 deny 规则命中的主机在任何情况下都连不上。
56
- * **不要把网络策略检查挪到 `needsApproval` 里**,那样会被审批缓存绕过。
57
- *
58
- * 已知不对齐 CC 的两项(有意为之,见 monitor-ws-network-policy.ts 文件头详述):
59
- * 不做 DNS 解析(与 WebFetch 现状一致);无 `allowManagedDomainsOnly` 概念(本仓库不存在该配置)。
60
- * 另:CC 要求 ws 审批不提供"同 host 免询问"选项,我们目前提供 —— 这需要改动全局审批
61
- * 服务(影响所有工具),风险面与本功能不成比例,故本轮不做;相关的既有缺陷
62
- * (`ToolAlwaysApprovalServiceImpl.resolveApprovalRules` 落裸 `[{ toolName }]` 规则,
63
- * 叠加 Phase 2 早于 Phase 3 安全检查返回)已单独立项跟踪。
64
- */
65
- import { Session } from '../../vendor/cbc-core/node/index.js';
66
- import { FunctionCallItem, ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
67
- import { Logger } from '@genie/telemetry';
68
- import type { RunContext } from '@openai/agents';
69
- import { z } from 'zod';
70
- import { BackgroundTaskNotifier } from '../agent-task/agent-task-protocol';
71
- import { BashSandboxManager } from '../bash-sandbox/bash-sandbox-protocol';
72
- import { type SandboxOrchestrator as ISandboxOrchestrator, type SandboxPermissionGateway as ISandboxPermissionGateway } from '../permission';
73
- import { type SandboxCenterIpcClient as ISandboxCenterIpcClient } from '../sensitive-content/sandbox-center-ipc-client-protocol';
74
- import { BaseTool } from './base-tool';
75
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
76
- /**
77
- * `command` 与 `ws` 互斥。
78
- *
79
- * **互斥校验刻意放在 `validateRuntimeInput()` 里,不用 `.superRefine()`。** 原因:`superRefine()`
80
- * 返回的是 `ZodEffects` 而非 `ZodObject`,而 SDK 的 `ToolExecuteArgument<TParameters>`
81
- * 依赖 `TParameters extends ZodObjectLike`(= `ZodObject<any, any>`,见
82
- * `@openai/agents-core/dist/utils/zodCompat.d.ts`)。一旦退化成 `ZodEffects`,
83
- * `execute(input)` 的 input 类型会从推断出的对象塌成 `string`,编译期就丢掉类型保护
84
- * (JSON Schema 侧虽然仍能正确产出 properties,但类型链已断)。
85
- *
86
- * 同理也没用 `z.union`:union 产出的 `anyOf` 在部分模型上表达力较差、容易生成两个
87
- * 字段都带的调用,且同样不是 `ZodObject`。平铺 optional 字段 + 运行时校验,既保住
88
- * 类型链,也能给模型明确的错误信息。
89
- */
90
- declare const MonitorParameters: z.ZodObject<{
91
- command: z.ZodOptional<z.ZodString>;
92
- ws: z.ZodOptional<z.ZodObject<{
93
- url: z.ZodString;
94
- protocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
95
- }, "strip", z.ZodTypeAny, {
96
- url: string;
97
- protocols?: string[] | undefined;
98
- }, {
99
- url: string;
100
- protocols?: string[] | undefined;
101
- }>>;
102
- timeout_ms: z.ZodOptional<z.ZodNumber>;
103
- persistent: z.ZodOptional<z.ZodBoolean>;
104
- }, "strip", z.ZodTypeAny, {
105
- command?: string | undefined;
106
- ws?: {
107
- url: string;
108
- protocols?: string[] | undefined;
109
- } | undefined;
110
- timeout_ms?: number | undefined;
111
- persistent?: boolean | undefined;
112
- }, {
113
- command?: string | undefined;
114
- ws?: {
115
- url: string;
116
- protocols?: string[] | undefined;
117
- } | undefined;
118
- timeout_ms?: number | undefined;
119
- persistent?: boolean | undefined;
120
- }>;
121
- type MonitorInput = z.infer<typeof MonitorParameters>;
122
- /**
123
- * 单 tick 内可能有多行输出,合并成一条 `<monitor-event>`,避免逐行刷屏(issue 验收标准)。
124
- * 导出供单测直接校验 XML 结构,避免测试依赖完整 IoC 装配跑一次真实 execute()。
125
- */
126
- export declare function buildMonitorEventXml(taskId: string, chunk: string): string;
127
- /** 收尾事件的终止原因。ws 源新增 `closed` / `oversized` / `error` 三种(issue #74436)。 */
128
- export type MonitorDoneReason = 'timeout' | 'exit' | 'stopped' | 'closed' | 'oversized' | 'error';
129
- export declare function buildMonitorDoneEventXml(taskId: string, reason: MonitorDoneReason, detail?: string): string;
130
- export declare class MonitorTool extends BaseTool implements Tool {
131
- protected readonly sandboxOrchestrator: ISandboxOrchestrator;
132
- protected readonly sandboxPermissionGateway: ISandboxPermissionGateway;
133
- protected readonly logger: Logger;
134
- protected readonly backgroundTaskNotifier: BackgroundTaskNotifier;
135
- protected readonly bashSandboxManager: BashSandboxManager;
136
- protected readonly sandboxCenterClient?: ISandboxCenterIpcClient;
137
- name: ToolNames;
138
- description: string;
139
- parameters: z.ZodObject<{
140
- command: z.ZodOptional<z.ZodString>;
141
- ws: z.ZodOptional<z.ZodObject<{
142
- url: z.ZodString;
143
- protocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
- }, "strip", z.ZodTypeAny, {
145
- url: string;
146
- protocols?: string[] | undefined;
147
- }, {
148
- url: string;
149
- protocols?: string[] | undefined;
150
- }>>;
151
- timeout_ms: z.ZodOptional<z.ZodNumber>;
152
- persistent: z.ZodOptional<z.ZodBoolean>;
153
- }, "strip", z.ZodTypeAny, {
154
- command?: string | undefined;
155
- ws?: {
156
- url: string;
157
- protocols?: string[] | undefined;
158
- } | undefined;
159
- timeout_ms?: number | undefined;
160
- persistent?: boolean | undefined;
161
- }, {
162
- command?: string | undefined;
163
- ws?: {
164
- url: string;
165
- protocols?: string[] | undefined;
166
- } | undefined;
167
- timeout_ms?: number | undefined;
168
- persistent?: boolean | undefined;
169
- }>;
170
- /**
171
- * `displayProperties` 是给 command 分支用的(工具调用头只显示命令本身)。
172
- * ws 分支没有 `command` 字段,若不加 `formatText` 兜底,`displayProperties`
173
- * 的默认渲染逻辑在找不到该属性时会降级成展示完整参数 JSON(含 `ws.url` 等),
174
- * 体验上是"未格式化"而非"崩溃",但既然有专门的格式化钩子就应该用上。
175
- */
176
- argumentRenderer: ToolCallArgumentRenderer;
177
- isEnabled: () => boolean;
178
- /**
179
- * 权限投影。
180
- *
181
- * **安全关键**:必须按事件源分流。此前只有 command 源时这里硬取 `input.command`,
182
- * ws-only 调用会投影出 `value: undefined`,导致权限规则匹配拿到空值 —— 那等于
183
- * 静默放行(规则匹配不到任何东西,也就拦不住任何东西)。新增任何非 command
184
- * 事件源时都必须同步扩展这里,否则就是开一个权限旁路。
185
- */
186
- resolveNeedPermissionArgs(_runContext: RunContext, input: MonitorInput, _callId?: string): ToolArg[];
187
- /**
188
- * Auto mode classifier projection:命令本身即为该动作的风险面,与 BashTool 对齐。
189
- * ws 源投影 URL,理由同 `resolveNeedPermissionArgs` —— 不能给 classifier 空输入,
190
- * 否则 auto 模式会因「无相关输入」短路放行而不做任何风险评估。
191
- */
192
- toAutoClassifierInput(input: unknown): string;
193
- needsApproval: (runContext: RunContext<Session>, input: unknown) => Promise<boolean>;
194
- /**
195
- * 按事件源分派。互斥校验由 `validateRuntimeInput()` 完成,原因见 `MonitorParameters`
196
- * 上方注释(`superRefine` 会把 schema 退化成 `ZodEffects`,破坏 SDK 的输入类型推断)。
197
- */
198
- execute(input: MonitorInput, context: RunContext<Session>, details?: {
199
- toolCall: FunctionCallItem;
200
- }): Promise<ToolResult>;
201
- /** ws 事件源(issue #74436):连一个出站 WebSocket,把每条消息当事件推回。 */
202
- private executeWsSource;
203
- /** 把 ws 源的终止原因映射成 BackgroundTask 状态 + 收尾事件措辞。 */
204
- private finishWsByReason;
205
- /** 解析 timeout_ms / persistent,两种事件源共用。 */
206
- private resolveTimeout;
207
- /** command 事件源(issue #74426):后台跑命令,把增量输出推回。行为与本 issue 之前完全一致。 */
208
- private executeCommandSource;
209
- /** 单 tick 增量文本入队 —— 复用 BackgroundTaskNotifier 的忙闲判断 + drain 调度。 */
210
- private pushMonitorEvent;
211
- private closeFdSafely;
212
- validateRuntimeInput(input: unknown): ToolResult | undefined;
213
- private invalidParameterResult;
214
- private generateTaskId;
215
- }
216
- export {};
@@ -1,64 +0,0 @@
1
- /**
2
- * MonitorTool `ws` 事件源的连接前网络策略校验(issue #74436)。
3
- *
4
- * 设计取舍
5
- * ========
6
- * 1. **校验时机在 `execute()` 内、真正建连之前**,不在 `needsApproval` 链路里 ——
7
- * 与 WebFetch 的既有分层保持一致(`web-fetch-tool.ts:270` 调 `checkNetworkPolicy`):
8
- * 「工具调用审批」与「网络策略」是两道独立串行的门。这一点很关键:审批可以被
9
- * 用户的「本会话不再询问」缓存跳过,但本函数每次 execute 都会重跑,所以私有地址 /
10
- * metadata 地址 / 有序网络 deny 规则命中的主机在任何情况下都连不上。
11
- *
12
- * 2. **本模块保留 WebSocket 与 SSRF 校验,域名规则复用统一策略。**
13
- * WebFetch 的 http/https、settings 缓存刷新和 fetch 降级仍由其自身负责;两者只共享
14
- * 与传输协议无关的域名匹配和有序规则首命中。
15
- *
16
- * 3. **私有地址判定逻辑刻意与 `web-fetch-tool.ts:101-144` 保持一致**(含
17
- * `169.254.0.0/16`,覆盖 cloud metadata `169.254.169.254`)。
18
- * **禁止改用 `UrlUtils.isPrivateIp`(`utils/url-utils.ts:15-32`)—— 它缺
19
- * 169.254 段**,用它会留下 metadata 地址可达的真实漏洞。
20
- *
21
- * 已知不对齐 CC 的两项(有意为之,不是遗漏)
22
- * ==========================================
23
- * - **不做 DNS 解析**:CC 会拒绝「解析到私有地址的主机名」,我们只判断 IP 字面量与
24
- * localhost 别名,因此 `evil.com → 127.0.0.1` 会被放过。与 WebFetch 今天的行为
25
- * 一致。补 DNS 需要处理 TOCTOU(解析通过到实际建连之间目标可变),应单独设计并
26
- * 同时修 WebFetch,不在本 issue 内单方面加严。
27
- * - **无 `allowManagedDomainsOnly` 概念**:该配置在本仓库不存在(全仓 0 命中),
28
- * 因此 CC 的「managed allowlist 之外全拒」无法对齐。
29
- */
30
- import type { SandboxCenterClient } from '@genie/sandbox-cli/sandbox-center-client';
31
- /** 校验结果。失败时 `reason` 直接透给模型,需可读且不泄露内部配置细节。 */
32
- export type WsPolicyResult = {
33
- allowed: true;
34
- action?: 'allow' | 'ask';
35
- } | {
36
- allowed: false;
37
- reason: string;
38
- };
39
- /**
40
- * hostname 是否为私有/内网地址。判定范围与 `web-fetch-tool.ts:101-112` 对齐,
41
- * 但额外做了 IPv6 方括号剥离(见 `normalizeHost`)。
42
- * 只判断 IP 字面量与 localhost 别名,**不做 DNS 解析**(见文件头说明)。
43
- */
44
- export declare function isPrivateWsHost(hostname: string): boolean;
45
- /** 与 `web-fetch-tool.ts:114-144` 对齐,含 169.254/16(cloud metadata)。 */
46
- export declare function isPrivateIP(ip: string): boolean;
47
- /**
48
- * URL 静态校验(不依赖任何配置,纯函数,便于单测)。
49
- *
50
- * 对齐 CC 对 `ws.url` 的约束:`ws://`/`wss://`、无内嵌凭据、无空白、仅 ASCII。
51
- * 仓库现有的 `UrlUtils.validateUrl`(`utils/url-utils.ts:48-62`)只做 http/https
52
- * 协议判断,这三项一个都不覆盖,所以这里必须自己写。
53
- */
54
- export declare function validateWsUrl(rawUrl: string): WsPolicyResult;
55
- /** `ws.protocols` 校验:合法 subprotocol token、无重复。 */
56
- export declare function validateWsProtocols(protocols?: string[]): WsPolicyResult;
57
- /**
58
- * 完整的连接前校验:静态 URL 校验 → SSRF → 域名策略 → protocols。
59
- *
60
- * 域名语义与 WebFetch、SandboxWriteRuleGuard 和 sandbox-cli 规则下发对齐:
61
- * - 运行时 action 统一由 Center `decide_network` 返回;`ask` 的交互审批由执行前统一网络 Guard 处理
62
- * - Genie 不读取本地 orderedRules 做网络裁决,规则统一由 Center `decide_network` 返回
63
- */
64
- export declare function checkWsNetworkPolicy(rawUrl: string, protocols: string[] | undefined, sandboxCenterClient?: SandboxCenterClient, sessionId?: string): Promise<WsPolicyResult>;
@@ -1,72 +0,0 @@
1
- /**
2
- * MonitorTool `ws` 事件源的 WebSocket 客户端(issue #74436)。
3
- *
4
- * 为什么不复用现有实现
5
- * ====================
6
- * - `mcp/node-websocket-transport.ts`:实现的是 MCP SDK `Transport` 接口,`onmessage`
7
- * 签名硬编码为 `JSONRPCMessage`、收到消息即 `JSON.parse`。本工具要的是「任意文本
8
- * 原样透传」,协议假设完全不同。更关键的是它**完全不处理 close code**
9
- * (`:106-108,125-127` 的 close 回调不接任何参数),而 CC 明确要求把 close code
10
- * 回传给模型。
11
- * - `remote-control/clients/centrifugo/centrifugo-client.ts`:绑定 Centrifugo pub/sub
12
- * 协议与其鉴权模型,不是通用客户端。
13
- *
14
- * 因此新写一个薄封装。职责边界刻意收窄:**只负责把 socket 活动翻译成回调**,
15
- * 不碰 BackgroundTask / 事件 XML / 权限 —— 那些留在 monitor-tool.ts,便于单测。
16
- *
17
- * 对齐 CC 的 socket 活动语义(Tools Reference `WebSocket source`)
18
- * ==============================================================
19
- * | socket 活动 | 行为 |
20
- * |----------------------|---------------------------------------------|
21
- * | 文本消息 | 一条消息 = 一个事件(**即使跨多行也不拆**) |
22
- * | 二进制帧 | 不透传,替换为 `[binary frame, N bytes]` |
23
- * | 单条消息 > 1 MiB | **结束 watch** |
24
- * | socket 关闭 | **结束 watch,并把 close code 交给模型** |
25
- *
26
- * 注意「一条消息 = 一个事件」与 command 模式不同:command 模式按 500ms tick 合并多行
27
- * 成一条事件(`monitor-tool.ts:97`「避免逐行刷屏」)。ws 侧严格不合并,因为消息边界
28
- * 是协议语义,合并会破坏它。
29
- */
30
- /** CC 规定的单条消息上限:超过即结束 watch。 */
31
- export declare const WS_MAX_MESSAGE_BYTES: number;
32
- /** watch 的终止原因,决定收尾事件的措辞。 */
33
- export type WsEndReason =
34
- /** 对端关闭(或本地 close 后对端回 close 帧),带 close code。 */
35
- {
36
- kind: 'closed';
37
- code?: number;
38
- reason?: string;
39
- }
40
- /** 单条消息超过 1 MiB。 */
41
- | {
42
- kind: 'oversized';
43
- bytes: number;
44
- }
45
- /** 连接层错误(握手失败、网络中断等)。 */
46
- | {
47
- kind: 'error';
48
- message: string;
49
- };
50
- export interface MonitorWsHandlers {
51
- /** 一条文本消息。原样透传,不做 JSON 解析、不按行拆分。 */
52
- onText(text: string): void;
53
- /** 一个二进制帧。CC 不透传内容,只给占位符所需的字节数。 */
54
- onBinary(byteLength: number): void;
55
- /** watch 终止。保证**最多调用一次**,且之后不再有 onText/onBinary。 */
56
- onEnd(reason: WsEndReason): void;
57
- }
58
- /** 已建立的 ws 事件源句柄。 */
59
- export interface MonitorWsHandle {
60
- /** 主动关闭。幂等;不会触发 `onEnd`(调用方自己知道是主动停的)。 */
61
- close(): void;
62
- }
63
- /** CC 的二进制帧占位符文案,形如 `[binary frame, 512 bytes]`。 */
64
- export declare function formatBinaryFramePlaceholder(byteLength: number): string;
65
- /**
66
- * 建立 ws 连接。**在 resolve 之前完成握手**,因此调用方 `await` 返回后即可认为已连上;
67
- * 握手失败会 reject,让 `execute()` 能直接把错误回给模型,而不是先返回一个
68
- * task_id、稍后才通过事件告知连不上(后者对模型很难处理)。
69
- *
70
- * 安全前提:调用方**必须**先跑 `checkWsNetworkPolicy`。本函数不做任何 URL 校验。
71
- */
72
- export declare function openMonitorWsSource(url: string, protocols: string[] | undefined, handlers: MonitorWsHandlers): Promise<MonitorWsHandle>;
@@ -1,104 +0,0 @@
1
- import { Workspace } from '@genie/runtime';
2
- import type { RunContext } from '@openai/agents';
3
- import { z } from 'zod';
4
- import { CodeRatioReportingService } from '../code-ratio';
5
- import { Session } from '../../vendor/cbc-core/node/index.js';
6
- import { TelemetryService } from '../telemetry';
7
- import { SandboxPermissionFileTool } from './sandbox-permission-file-tool';
8
- import { ReadFileStateService, Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
9
- import { ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
10
- declare const MultiEditFileParameters: z.ZodObject<{
11
- file_path: z.ZodString;
12
- edits: z.ZodArray<z.ZodObject<{
13
- old_string: z.ZodString;
14
- new_string: z.ZodString;
15
- replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
16
- }, "strip", z.ZodTypeAny, {
17
- old_string: string;
18
- new_string: string;
19
- replace_all: boolean;
20
- }, {
21
- old_string: string;
22
- new_string: string;
23
- replace_all?: boolean | undefined;
24
- }>, "many">;
25
- }, "strip", z.ZodTypeAny, {
26
- file_path: string;
27
- edits: {
28
- old_string: string;
29
- new_string: string;
30
- replace_all: boolean;
31
- }[];
32
- }, {
33
- file_path: string;
34
- edits: {
35
- old_string: string;
36
- new_string: string;
37
- replace_all?: boolean | undefined;
38
- }[];
39
- }>;
40
- export declare class MultiEditTool extends SandboxPermissionFileTool implements Tool {
41
- protected readonly workspace: Workspace;
42
- protected readonly telemetryService: TelemetryService;
43
- protected readonly readFileStateService: ReadFileStateService;
44
- protected readonly codeRatioReportingService?: CodeRatioReportingService;
45
- name: ToolNames;
46
- aliases: string[];
47
- parameters: z.ZodObject<{
48
- file_path: z.ZodString;
49
- edits: z.ZodArray<z.ZodObject<{
50
- old_string: z.ZodString;
51
- new_string: z.ZodString;
52
- replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
53
- }, "strip", z.ZodTypeAny, {
54
- old_string: string;
55
- new_string: string;
56
- replace_all: boolean;
57
- }, {
58
- old_string: string;
59
- new_string: string;
60
- replace_all?: boolean | undefined;
61
- }>, "many">;
62
- }, "strip", z.ZodTypeAny, {
63
- file_path: string;
64
- edits: {
65
- old_string: string;
66
- new_string: string;
67
- replace_all: boolean;
68
- }[];
69
- }, {
70
- file_path: string;
71
- edits: {
72
- old_string: string;
73
- new_string: string;
74
- replace_all?: boolean | undefined;
75
- }[];
76
- }>;
77
- argumentRenderer: ToolCallArgumentRenderer;
78
- resolveNeedPermissionArgs(_runContext: RunContext, input: z.infer<typeof MultiEditFileParameters>, _callId?: string): ToolArg[];
79
- /**
80
- * Auto mode classifier projection: `${file_path}: ${all new_strings}` (Claude
81
- * Edit-content alignment, decision D1) — every edit's new content is inspected
82
- * for a dangerous payload.
83
- */
84
- toAutoClassifierInput(input: unknown): string;
85
- /**
86
- * 多步编辑的核心逻辑,顺序应用所有编辑操作
87
- * 所有编辑操作是原子性的 - 要么全部成功,要么全部失败
88
- * 每个编辑操作都在前一个编辑的结果上进行
89
- */
90
- private applyMultiEdits;
91
- /**
92
- * 计算多步编辑的最终结果
93
- * 验证所有编辑操作的有效性,并计算最终的文件内容
94
- */
95
- private calculateMultiEdit;
96
- /**
97
- * 执行多步编辑操作
98
- * 原子性操作:要么所有编辑都成功应用,要么全部回滚
99
- */
100
- execute(params: z.infer<typeof MultiEditFileParameters>, context: RunContext<Session>): Promise<ToolResult>;
101
- private classifyReadError;
102
- private reportFileAction;
103
- }
104
- export {};
@@ -1,75 +0,0 @@
1
- import type { RunContext } from '@openai/agents';
2
- import { z } from 'zod';
3
- import { CodeRatioReportingService } from '../code-ratio';
4
- import { Session } from '../../vendor/cbc-core/node/index.js';
5
- import { TelemetryService } from '../telemetry';
6
- import { SandboxPermissionFileTool } from './sandbox-permission-file-tool';
7
- import { ReadFileStateService, Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
8
- import { ToolArg } from '../../vendor/cbc-shared/node/index.js';
9
- declare const NotebookEditParameters: z.ZodObject<{
10
- notebook_path: z.ZodString;
11
- cell_id: z.ZodOptional<z.ZodString>;
12
- new_source: z.ZodString;
13
- cell_type: z.ZodOptional<z.ZodEnum<["code", "markdown"]>>;
14
- edit_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["replace", "insert", "delete"]>>>;
15
- }, "strip", z.ZodTypeAny, {
16
- notebook_path: string;
17
- cell_id?: string | undefined;
18
- new_source: string;
19
- cell_type?: "code" | "markdown" | undefined;
20
- edit_mode: "delete" | "insert" | "replace";
21
- }, {
22
- notebook_path: string;
23
- cell_id?: string | undefined;
24
- new_source: string;
25
- cell_type?: "code" | "markdown" | undefined;
26
- edit_mode?: "delete" | "insert" | "replace" | undefined;
27
- }>;
28
- export declare class NotebookEditTool extends SandboxPermissionFileTool implements Tool {
29
- protected readonly telemetryService: TelemetryService;
30
- protected readonly readFileStateService: ReadFileStateService;
31
- protected readonly codeRatioReportingService?: CodeRatioReportingService;
32
- name: string;
33
- aliases: string[];
34
- description: string;
35
- parameters: z.ZodObject<{
36
- notebook_path: z.ZodString;
37
- cell_id: z.ZodOptional<z.ZodString>;
38
- new_source: z.ZodString;
39
- cell_type: z.ZodOptional<z.ZodEnum<["code", "markdown"]>>;
40
- edit_mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["replace", "insert", "delete"]>>>;
41
- }, "strip", z.ZodTypeAny, {
42
- notebook_path: string;
43
- cell_id?: string | undefined;
44
- new_source: string;
45
- cell_type?: "code" | "markdown" | undefined;
46
- edit_mode: "delete" | "insert" | "replace";
47
- }, {
48
- notebook_path: string;
49
- cell_id?: string | undefined;
50
- new_source: string;
51
- cell_type?: "code" | "markdown" | undefined;
52
- edit_mode?: "delete" | "insert" | "replace" | undefined;
53
- }>;
54
- argumentRenderer: ToolCallArgumentRenderer;
55
- resolveNeedPermissionArgs(_runContext: RunContext, input: z.infer<typeof NotebookEditParameters>, _callId?: string): ToolArg[];
56
- /**
57
- * Auto mode classifier projection: `${notebook_path} ${edit_mode}: ${new_source}`
58
- * (strict Claude alignment, decision D1) — the new cell source is inspected
59
- * for a dangerous payload.
60
- */
61
- toAutoClassifierInput(input: unknown): string;
62
- private validateToolParams;
63
- private readNotebookFile;
64
- private createNewNotebook;
65
- private writeNotebookFile;
66
- private findCellIndexById;
67
- private generateCellId;
68
- private createNewCell;
69
- private normalizeSource;
70
- execute(params: z.infer<typeof NotebookEditParameters>, _context: RunContext<Session>): Promise<ToolResult>;
71
- /** 把 ipynb 的 cell source(string | string[])还原为字符串。ipynb 约定每行已含结尾 '\n',join('') 即原文。 */
72
- private sourceToString;
73
- private reportFileAction;
74
- }
75
- export {};
@@ -1,55 +0,0 @@
1
- import { Workspace } from '@genie/runtime';
2
- import type { RunContext } from '@openai/agents';
3
- import { z } from 'zod';
4
- import { Session } from '../../vendor/cbc-core/node/index.js';
5
- import { BaseTool } from './base-tool';
6
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
7
- import { ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
8
- declare const NotebookReadParameters: z.ZodObject<{
9
- notebook_path: z.ZodString;
10
- cell_id: z.ZodOptional<z.ZodString>;
11
- }, "strip", z.ZodTypeAny, {
12
- notebook_path: string;
13
- cell_id?: string | undefined;
14
- }, {
15
- notebook_path: string;
16
- cell_id?: string | undefined;
17
- }>;
18
- export declare class NotebookReadTool extends BaseTool implements Tool {
19
- protected readonly workspace: Workspace;
20
- name: ToolNames;
21
- aliases: string[];
22
- parameters: z.ZodObject<{
23
- notebook_path: z.ZodString;
24
- cell_id: z.ZodOptional<z.ZodString>;
25
- }, "strip", z.ZodTypeAny, {
26
- notebook_path: string;
27
- cell_id?: string | undefined;
28
- }, {
29
- notebook_path: string;
30
- cell_id?: string | undefined;
31
- }>;
32
- argumentRenderer: ToolCallArgumentRenderer;
33
- resolveNeedPermissionArgs(runContext: RunContext, input: z.infer<typeof NotebookReadParameters>, callId?: string): ToolArg[];
34
- /**
35
- * 验证工具参数
36
- */
37
- private validateToolParams;
38
- /**
39
- * 读取和解析 Jupyter notebook 文件
40
- */
41
- private readNotebookFile;
42
- /**
43
- * 格式化单个 cell 内容
44
- */
45
- private formatCell;
46
- /**
47
- * 根据 cell_id 查找特定的 cell
48
- */
49
- private findCellById;
50
- /**
51
- * 执行 notebook 读取操作
52
- */
53
- execute(params: z.infer<typeof NotebookReadParameters>, context: RunContext<Session>): Promise<ToolResult>;
54
- }
55
- export {};
@@ -1,7 +0,0 @@
1
- import { NotebookEditTool } from './notebook-edit-tool';
2
- import { Tool } from './tool-protocol';
3
- export declare class NotebookWriteTool extends NotebookEditTool implements Tool {
4
- name: string;
5
- defer_loading: boolean;
6
- aliases: string[];
7
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * PowerShell Constrained Language Mode (CLM) allowed types.
3
- *
4
- * Microsoft's CLM restricts .NET type usage to this allowlist when PowerShell
5
- * runs under AppLocker/WDAC system lockdown. Any type NOT in this set is
6
- * considered unsafe for untrusted code execution.
7
- *
8
- * We invert this: type literals not in this set -> ask. One canonical check
9
- * replaces enumerating individual dangerous types (named pipes, reflection,
10
- * process spawning, P/Invoke marshaling, etc.). Microsoft maintains the list.
11
- *
12
- * Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes
13
- *
14
- * Aligned with Claude Code's clmTypes.ts.
15
- *
16
- * Normalization: entries stored lowercase, short AND full names where both
17
- * exist (PS resolves type accelerators like [int] -> System.Int32 at runtime;
18
- * we match against the literal text from the command).
19
- */
20
- export declare const CLM_ALLOWED_TYPES: ReadonlySet<string>;
21
- /**
22
- * Normalize a type name from command text.
23
- * Handles array suffix ([]) and generic brackets.
24
- */
25
- export declare function normalizeTypeName(name: string): string;
26
- /**
27
- * True if typeName is in Microsoft's CLM allowlist.
28
- * Types NOT in this set trigger ask — they access system APIs CLM blocks.
29
- */
30
- export declare function isClmAllowedType(typeName: string): boolean;
@@ -1,23 +0,0 @@
1
- /**
2
- * Windows command exit code semantic interpretation.
3
- *
4
- * Some Windows commands use non-zero exit codes for non-error conditions.
5
- * Without this mapping, the model (and user) would interpret any non-zero
6
- * exit code as a failure, leading to unnecessary retries.
7
- *
8
- * Reference: Claude Code's commandSemantics.ts
9
- */
10
- export interface CommandSemantic {
11
- /** Whether this exit code represents an actual error */
12
- isError: boolean;
13
- /** Human-readable explanation of the exit code */
14
- message?: string;
15
- }
16
- /**
17
- * Interpret the exit code of a command, accounting for Windows-specific semantics.
18
- *
19
- * @param command - The original command string
20
- * @param exitCode - The process exit code
21
- * @returns Semantic interpretation, or null if no special handling needed
22
- */
23
- export declare function interpretCommandResult(command: string, exitCode: number | null): CommandSemantic | null;