@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,83 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { RunContext, ToolExecuteArgument } from '../../vendor/cbc-shared/node/index.js';
3
- import { Session } from '../../vendor/cbc-core/node/index.js';
4
- import { PermissionMode } from '../../vendor/cbc-shared/node/index.js';
5
- import { SettingsManager } from '../settings';
6
- import { BaseTool } from './base-tool';
7
- import { ToolArg } from '../../vendor/cbc-shared/node/index.js';
8
- import { ToolPermissionStrategy } from './tool-protocol';
9
- export declare class ToolPermissionDefaultStrategy implements ToolPermissionStrategy {
10
- mode: PermissionMode;
11
- protected readonly settingsManager: SettingsManager;
12
- protected readonly logger: Logger;
13
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
14
- }
15
- export declare class ToolPermissionAcceptEditsStrategy implements ToolPermissionStrategy {
16
- mode: PermissionMode;
17
- protected readonly settingsManager: SettingsManager;
18
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
19
- }
20
- export declare class ToolPermissionPlanStrategy implements ToolPermissionStrategy {
21
- mode: PermissionMode;
22
- protected readonly settingsManager: SettingsManager;
23
- protected readonly logger: Logger;
24
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
25
- /**
26
- * 委托给进入 plan 模式前的权限策略
27
- * 如果没有前置模式,则使用 Default 策略
28
- */
29
- private delegateToPrePlanStrategy;
30
- /**
31
- * 检查是否为计划文件的编辑操作
32
- * 在计划模式下,写入当前 session 的计划文件不需要授权
33
- */
34
- private isPlanFileEdit;
35
- }
36
- export declare class ToolPermissionBypassPermissionsStrategy implements ToolPermissionStrategy {
37
- mode: PermissionMode;
38
- protected readonly settingsManager: SettingsManager;
39
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
40
- }
41
- /**
42
- * Work 权限策略
43
- * - Read: 不需要授权(不检查信任目录)
44
- * - Edit: 在信任目录中不需要授权,否则需要授权
45
- * - Bash: 安全命令不需要授权,否则需要授权
46
- */
47
- export declare class ToolPermissionWorkStrategy implements ToolPermissionStrategy {
48
- mode: PermissionMode;
49
- protected readonly settingsManager: SettingsManager;
50
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
51
- }
52
- /**
53
- * Delegate 权限策略
54
- * Delegate 模式下所有允许的工具(协调类)自动批准。
55
- * 实现类工具已在 isEnabled 层被过滤,不会到达此策略。
56
- */
57
- export declare class ToolPermissionDelegateStrategy implements ToolPermissionStrategy {
58
- mode: PermissionMode;
59
- protected readonly settingsManager: SettingsManager;
60
- needApproval(_tool: BaseTool, _runContext: RunContext<Session>, _input: ToolExecuteArgument<any>, _checkArgs: ToolArg[], _callId?: string): Promise<boolean>;
61
- }
62
- /**
63
- * DontAsk 权限策略(安全基线)
64
- *
65
- * 对齐 Claude Code 的 dontAsk 语义:"Don't prompt for permissions, deny if not
66
- * pre-approved" —— 只放行 baseline(default 模式)下本就不会弹权限提示的动作,
67
- * 其余一律走统一出口转 deny。
68
- *
69
- * - Read: 信任目录内不需要授权(与 default 一致);否则需要授权 → deny
70
- * - Bash: 始终需要授权 → deny。即使命令名在 SAFE_COMMAND_WHITELIST 中(npm/node/
71
- * git/python 等),它们能执行任意代码,不属于"预批准"的免提示动作;与 Claude
72
- * 对齐(如 `npm test` 在 dontAsk 下被拒)。用户可通过 allow 规则显式预批准,
73
- * 那会在更早的 allow 阶段命中、不会到达本策略。
74
- * - Edit / 其他: 需要授权 → deny
75
- *
76
- * 这里返回 true(需要授权)的情形,由 ToolPermissionService 的统一 ask 收口在
77
- * dontAsk 模式下转成 deny(不弹权限确认)。
78
- */
79
- export declare class ToolPermissionDontAskStrategy implements ToolPermissionStrategy {
80
- mode: PermissionMode;
81
- protected readonly settingsManager: SettingsManager;
82
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
83
- }
@@ -1,113 +0,0 @@
1
- import type { RunContext } from '@openai/agents';
2
- import { z } from 'zod';
3
- import type { Session } from '../../vendor/cbc-core/node/index.js';
4
- import { BaseTool } from './base-tool';
5
- import { DeferToolConfigService } from './defer-tool-config-protocol';
6
- import { Tool, ToolCallArgumentRenderer, ToolManager, ToolResult } from './tool-protocol';
7
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
8
- import { ToolSearchService } from './tool-search-protocol';
9
- import { AgentToolDeferOverlayCache } from './tool-spec';
10
- /**
11
- * Parameters for the tool_search tool
12
- */
13
- declare const ToolSearchParameters: z.ZodObject<{
14
- queries: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>>;
15
- tool_names: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>>;
16
- top_k: z.ZodDefault<z.ZodNumber>;
17
- }, "strip", z.ZodTypeAny, {
18
- queries?: string[] | undefined;
19
- tool_names?: string[] | undefined;
20
- top_k: number;
21
- }, {
22
- queries?: unknown;
23
- tool_names?: unknown;
24
- top_k?: number | undefined;
25
- }>;
26
- /**
27
- * Tool for searching deferred tools and returning their metadata (name, description, parameter schema).
28
- *
29
- * Supports two operations via separate parameters:
30
- * - "queries": Search by keywords, return top_k results with full details, show remaining as candidates.
31
- * - "tool_names": Look up tools by exact name(s), with fuzzy search fallback.
32
- *
33
- * Tools found by ToolSearch are NOT injected into the LLM tools list.
34
- * Instead, the model should use DeferExecuteTool to invoke them, passing the
35
- * tool name and parameters learned from the schema returned here.
36
- */
37
- export declare class ToolSearchTool extends BaseTool implements Tool {
38
- protected readonly toolSearchService: ToolSearchService;
39
- protected readonly deferToolConfigService: DeferToolConfigService;
40
- protected readonly toolManager: ToolManager;
41
- protected readonly agentToolDeferOverlayCache: AgentToolDeferOverlayCache;
42
- name: ToolNames;
43
- readonly promptCacheStability: 'volatile';
44
- isEnabled: () => Promise<boolean>;
45
- parameters: z.ZodObject<{
46
- queries: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>>;
47
- tool_names: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>>;
48
- top_k: z.ZodDefault<z.ZodNumber>;
49
- }, "strip", z.ZodTypeAny, {
50
- queries?: string[] | undefined;
51
- tool_names?: string[] | undefined;
52
- top_k: number;
53
- }, {
54
- queries?: unknown;
55
- tool_names?: unknown;
56
- top_k?: number | undefined;
57
- }>;
58
- argumentRenderer: ToolCallArgumentRenderer;
59
- /**
60
- * Tool search does not need user approval
61
- */
62
- needsApproval: boolean;
63
- /**
64
- * Maximum output characters, resolved from env var or default.
65
- */
66
- private readonly maxOutputChars;
67
- execute(input: z.infer<typeof ToolSearchParameters>, context: RunContext<Session>): Promise<ToolResult>;
68
- /**
69
- * 子代理 MCP 白名单判定(对齐 CC:ToolSearch 严格在子代理白名单解析后的工具池内
70
- * 搜索,白名单外 MCP 工具不可发现)。agent 未注册白名单时全部放行。
71
- * 仅约束 `mcp__` 前缀工具;裸名 MCP 工具是透明代理的全局能力,不走该白名单。
72
- */
73
- private isMcpToolAllowedForAgent;
74
- /**
75
- * Search mode: search by keywords, return top_k with full schema, show remaining as candidates.
76
- */
77
- private executeSearchMode;
78
- /**
79
- * Lookup mode: look up tools by exact name(s).
80
- * Falls back to search(name, 1) when exact match is not found.
81
- */
82
- private executeLookupMode;
83
- /**
84
- * Format search mode results with primary tools (including schema) and optional candidates.
85
- */
86
- private formatSearchResults;
87
- /**
88
- * Format lookup mode results with full tool info.
89
- */
90
- private formatLookupResults;
91
- /**
92
- * 会话级 `Defer(...)` 命中的内置工具如果未被 product 索引,先懒索引一次。
93
- *
94
- * - tool_names 模式:只索引用户显式问到的那些(避免 queries 模式无谓全扫)
95
- * - queries 模式:把 overlay.forceDefer 精确条目全量索引
96
- *
97
- * 通配条目(`Defer(mcp__*)`)不在此处理:
98
- * 1) MCP 工具的索引由 mcp-manager 异步驱动;
99
- * 2) 通配反向枚举不出具体工具名。
100
- */
101
- private ensureForceDeferIndexed;
102
- /**
103
- * Resolve max output chars from environment variable, falling back to default.
104
- * Follows the same pattern as tool-manager.ts initSkillCharBudget().
105
- */
106
- private initMaxOutputChars;
107
- /**
108
- * Truncate output string to maxOutputChars limit.
109
- * Appends a truncation notice when content exceeds the limit.
110
- */
111
- private truncateOutput;
112
- }
113
- export {};
@@ -1,82 +0,0 @@
1
- import { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { Agent, ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { ProductManager } from '@genie/product';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { BaseTool } from './base-tool';
8
- import { ImageService, Tool, ToolResult, VideoService } from './tool-protocol';
9
- /**
10
- * 文生视频 + 图生视频参数 Schema
11
- * image 或 last_image 任意一个存在时为图生视频,否则为文生视频
12
- */
13
- declare const VideoGenParameters: z.ZodObject<{
14
- prompt: z.ZodOptional<z.ZodString>;
15
- image: z.ZodOptional<z.ZodString>;
16
- last_image: z.ZodOptional<z.ZodString>;
17
- resolution: z.ZodOptional<z.ZodEnum<["720P", "1080P"]>>;
18
- aspect_ratio: z.ZodOptional<z.ZodEnum<["16:9", "9:16", "1:1"]>>;
19
- negative_prompt: z.ZodOptional<z.ZodString>;
20
- enable_audio: z.ZodOptional<z.ZodBoolean>;
21
- output_dir: z.ZodOptional<z.ZodString>;
22
- }, "strip", z.ZodTypeAny, {
23
- prompt?: string | undefined;
24
- image?: string | undefined;
25
- last_image?: string | undefined;
26
- resolution?: "1080P" | "720P" | undefined;
27
- aspect_ratio?: "16:9" | "1:1" | "9:16" | undefined;
28
- negative_prompt?: string | undefined;
29
- enable_audio?: boolean | undefined;
30
- output_dir?: string | undefined;
31
- }, {
32
- prompt?: string | undefined;
33
- image?: string | undefined;
34
- last_image?: string | undefined;
35
- resolution?: "1080P" | "720P" | undefined;
36
- aspect_ratio?: "16:9" | "1:1" | "9:16" | undefined;
37
- negative_prompt?: string | undefined;
38
- enable_audio?: boolean | undefined;
39
- output_dir?: string | undefined;
40
- }>;
41
- export declare class VideoGenTool extends BaseTool implements Tool {
42
- protected readonly videoService: VideoService;
43
- protected readonly imageService: ImageService;
44
- protected readonly productManager: ProductManager;
45
- protected readonly logger: Logger;
46
- name: ToolNames;
47
- description: string;
48
- parameters: z.ZodObject<{
49
- prompt: z.ZodOptional<z.ZodString>;
50
- image: z.ZodOptional<z.ZodString>;
51
- last_image: z.ZodOptional<z.ZodString>;
52
- resolution: z.ZodOptional<z.ZodEnum<["720P", "1080P"]>>;
53
- aspect_ratio: z.ZodOptional<z.ZodEnum<["16:9", "9:16", "1:1"]>>;
54
- negative_prompt: z.ZodOptional<z.ZodString>;
55
- enable_audio: z.ZodOptional<z.ZodBoolean>;
56
- output_dir: z.ZodOptional<z.ZodString>;
57
- }, "strip", z.ZodTypeAny, {
58
- prompt?: string | undefined;
59
- image?: string | undefined;
60
- last_image?: string | undefined;
61
- resolution?: "1080P" | "720P" | undefined;
62
- aspect_ratio?: "16:9" | "1:1" | "9:16" | undefined;
63
- negative_prompt?: string | undefined;
64
- enable_audio?: boolean | undefined;
65
- output_dir?: string | undefined;
66
- }, {
67
- prompt?: string | undefined;
68
- image?: string | undefined;
69
- last_image?: string | undefined;
70
- resolution?: "1080P" | "720P" | undefined;
71
- aspect_ratio?: "16:9" | "1:1" | "9:16" | undefined;
72
- negative_prompt?: string | undefined;
73
- enable_audio?: boolean | undefined;
74
- output_dir?: string | undefined;
75
- }>;
76
- isEnabled: (_args: {
77
- runContext: RunContext<Session>;
78
- agent: Agent;
79
- }) => Promise<boolean>;
80
- execute(input: z.infer<typeof VideoGenParameters>, context: RunContext<Session>): Promise<ToolResult>;
81
- }
82
- export {};
@@ -1,79 +0,0 @@
1
- import { Logger } from '@celljs/core';
2
- import { z } from 'zod';
3
- import { RunContext } from '../../vendor/cbc-shared/node/index.js';
4
- import { McpManager } from '../mcp/mcp-protocol';
5
- import { Session } from '../../vendor/cbc-core/node/index.js';
6
- import { BaseTool } from './base-tool';
7
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
8
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
9
- declare const WaitForMcpServersParameters: z.ZodObject<{
10
- servers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
- }, "strip", z.ZodTypeAny, {
12
- servers?: string[] | undefined;
13
- }, {
14
- servers?: string[] | undefined;
15
- }>;
16
- type WaitForMcpServersInput = z.infer<typeof WaitForMcpServersParameters>;
17
- interface WaitForMcpServersOutput {
18
- ready: boolean;
19
- connected: string[];
20
- failed: string[];
21
- stillPending: string[];
22
- needsAuth: string[];
23
- disabled: string[];
24
- unknown: string[];
25
- }
26
- /**
27
- * WaitForMcpServers — wait for MCP servers that are still connecting.
28
- *
29
- * When a user's request needs tools from a still-connecting server, the LLM
30
- * can call this tool to block until the server finishes connecting. Once
31
- * connected, its tools are added to the tool list and can be used directly.
32
- *
33
- * Returns ready=true when all target servers are connected, ready=false if
34
- * any failed to connect, need authentication, or are disabled.
35
- */
36
- export declare class WaitForMcpServersTool extends BaseTool implements Tool {
37
- protected readonly mcpManager: McpManager;
38
- protected readonly logger: Logger;
39
- name: ToolNames;
40
- description: string;
41
- parameters: z.ZodObject<{
42
- servers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
- }, "strip", z.ZodTypeAny, {
44
- servers?: string[] | undefined;
45
- }, {
46
- servers?: string[] | undefined;
47
- }>;
48
- argumentRenderer: ToolCallArgumentRenderer;
49
- /** No approval needed — this is a read-only wait operation. */
50
- needsApproval: boolean;
51
- /**
52
- * Enabled iff the feature is not explicitly disabled via env
53
- * CODEBUDDY_WAIT_FOR_MCP_SERVERS_ENABLED=0/false.
54
- *
55
- * Historically this also returned false when no MCP server was in
56
- * CONNECTING state. That coupling caused a time-of-check race with the
57
- * ToolSearch description: the description is rendered once per session
58
- * with the "still connecting" hint baked in, but isEnabled() was
59
- * re-evaluated on every LLM request — so a server that finished
60
- * connecting between description-render and tool-list-fetch would leave
61
- * the hint pointing at a tool the LLM no longer had access to.
62
- *
63
- * Always exposing the tool removes that drift: when no server is
64
- * connecting, execute() returns ready=true immediately (cost ~1ms) and
65
- * the tool description itself tells the LLM what it is for, so the
66
- * model won't invoke it gratuitously.
67
- *
68
- * Default: enabled. WB sets this env var to '0' to disable.
69
- */
70
- isEnabled: () => Promise<boolean>;
71
- execute(input: WaitForMcpServersInput, _context: RunContext<Session>): Promise<ToolResult>;
72
- private getPendingServerNames;
73
- private matchTargets;
74
- private classifyResults;
75
- private buildResult;
76
- private sleep;
77
- }
78
- export { WaitForMcpServersParameters };
79
- export type { WaitForMcpServersInput, WaitForMcpServersOutput };
@@ -1,164 +0,0 @@
1
- import { AuthenticationManager } from '@genie/authentication';
2
- import { PromptRenderer, Session } from '../../vendor/cbc-core/node/index.js';
3
- import { type FunctionCallItem, RunContext, ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
4
- import { ClientInfoProvider, ProductManager } from '@genie/product';
5
- import { Logger } from '@genie/telemetry';
6
- import { z } from 'zod';
7
- import { GalileoService } from '../galileo';
8
- import { CustomHeadersProvider } from '../http';
9
- import { ThreatDomainChecker } from '../sandbox-cli/threat-domain-checker';
10
- import { type SandboxCenterIpcClient } from '../sensitive-content/sandbox-center-ipc-client-protocol';
11
- import { SettingsManager } from '../settings';
12
- import { type SandboxTelemetryReporter as ISandboxTelemetryReporter } from '../telemetry/sandbox-telemetry-protocol';
13
- import { BaseTool } from './base-tool';
14
- import { type SandboxWriteRuleGuard } from './sandbox-write-rule-guard';
15
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
16
- declare const WebFetchParameters: z.ZodObject<{
17
- url: z.ZodString;
18
- prompt: z.ZodString;
19
- }, "strip", z.ZodTypeAny, {
20
- url: string;
21
- prompt: string;
22
- }, {
23
- url: string;
24
- prompt: string;
25
- }>;
26
- export declare class WebFetchTool extends BaseTool implements Tool {
27
- protected readonly promptRenderer: PromptRenderer;
28
- protected readonly logger: Logger;
29
- protected readonly sandboxCenterClient?: SandboxCenterIpcClient;
30
- protected readonly sandboxWriteRuleGuard?: SandboxWriteRuleGuard;
31
- protected readonly productManager: ProductManager;
32
- protected readonly authenticationManager: AuthenticationManager;
33
- protected readonly clientInfoProvider: ClientInfoProvider;
34
- protected readonly settingsManager: SettingsManager;
35
- protected readonly customHeadersProvider: CustomHeadersProvider;
36
- protected readonly galileoService: GalileoService;
37
- protected readonly threatDomainChecker?: ThreatDomainChecker;
38
- protected readonly sandboxTelemetryReporter?: ISandboxTelemetryReporter;
39
- private readonly WEB_FETCH_API_PATH;
40
- name: ToolNames;
41
- resolveSensitiveEgress(input: z.infer<typeof WebFetchParameters>, context: RunContext<Session>): Promise<{
42
- source: 'web-fetch';
43
- inspectionContent: string;
44
- destinationKey: string;
45
- } | undefined>;
46
- parameters: z.ZodObject<{
47
- url: z.ZodString;
48
- prompt: z.ZodString;
49
- }, "strip", z.ZodTypeAny, {
50
- url: string;
51
- prompt: string;
52
- }, {
53
- url: string;
54
- prompt: string;
55
- }>;
56
- argumentRenderer: ToolCallArgumentRenderer;
57
- private static cache;
58
- /**
59
- * 已落审计的恶意域名拦截,键为 `sessionId + requestId + target`。
60
- *
61
- * 模型在同一个 turn 里换 path / query 反复访问同一个恶意域名很常见,逐次落审计会把
62
- * 安全中心刷成同一条内容的重复记录。沙箱侧有 `dedupeMaliciousNetworkBlockRecords` 做同样的事,
63
- * WebFetch 这条旁路缺了等价保护。静态成员按进程共享,与 `cache` 一致。
64
- */
65
- private static auditedMaliciousBlocks;
66
- resolveNeedPermissionArgs(_runContext: RunContext, input: z.infer<typeof WebFetchParameters>, _callId?: string): ToolArg[];
67
- needsApproval: (runContext: RunContext<Session>, input: z.infer<typeof WebFetchParameters>, callId?: string) => Promise<boolean>;
68
- /** Auto mode classifier projection: `${url}: ${prompt}` (Claude alignment, decision D1). */
69
- toAutoClassifierInput(input: unknown): string;
70
- execute(params: z.infer<typeof WebFetchParameters>, context: RunContext<Session>, details?: {
71
- toolCall: FunctionCallItem;
72
- }): Promise<ToolResult>;
73
- /**
74
- * 图片 / 二进制没有可摘要文本。直接返回 Bash+Read 指引,
75
- * 跳过 AI summary,也不写入缓存——同一 URL 下次可能变成普通页面。
76
- */
77
- private returnNonTextResourceGuidance;
78
- private recordMaliciousWebsiteAudit;
79
- /** Check whether the remote API is disabled via environment variable or product feature. */
80
- private isRemoteApiDisabled;
81
- /**
82
- * Race strategy: launch remote API and local fetch concurrently.
83
- * - If remote succeeds within WEB_FETCH_API_TIMEOUT_MS (20s), use remote result.
84
- * - If remote fails or times out, use local fetch result (already in-flight).
85
- * This eliminates sequential latency — local fetch warms up in parallel.
86
- *
87
- * When CODEBUDDY_DISABLE_WEB_FETCH_REMOTE_API=true, skip remote API entirely and use local fetch only.
88
- */
89
- private fetchWithFallback;
90
- private validateParams;
91
- private normalizeUrl;
92
- private getCachedEntry;
93
- private setCachedContent;
94
- private cleanExpiredCache;
95
- /**
96
- * Fetch content via the backend /agenttool/v1/webfetch API which returns markdown directly.
97
- * The caller owns the deadline via `abortSignal` — when triggered, both the promise rejects
98
- * and the underlying socket is closed.
99
- */
100
- private fetchContentViaApi;
101
- private resolveCurrentModelName;
102
- /**
103
- * Local fallback: fetch the URL directly and convert HTML to markdown using turndown.
104
- */
105
- private fetchAndProcessLocally;
106
- /**
107
- * Extract useful information from HTML meta tags when body content is empty.
108
- * This is particularly useful for SPA pages where the actual content is rendered by JavaScript.
109
- */
110
- private extractMetaContent;
111
- private fetchWithTimeout;
112
- /**
113
- * WebFetch 的统一 URL 放行入口。
114
- *
115
- * 判定层级:有序规则首命中 → 恶意库。命中 allow 则跳过恶意库;其余再查
116
- * sandbox-cli/Rust 只读 SQLite,与沙箱网络请求共用同一套哈希、主域和子域匹配。
117
- */
118
- private assertUrlAllowed;
119
- private networkTargetKey;
120
- /**
121
- * 恶意域名库判定:命中抛 `MaliciousWebsiteBlockedError`,其余情形静默返回。
122
- *
123
- * 从 `assertUrlAllowed` 拆出来,是为了让 `*` deny / default_rule 排在本检查之后。
124
- * 写成一段顺序代码的话,中间那几个「不查库」的早退(没有 checker、IP 字面量、
125
- * 库不可用)会连这条有序规则一起跳过,把 catch-all deny 放成通过。
126
- */
127
- private assertNotMaliciousDomain;
128
- private processContentWithAI;
129
- private createAnalysisPrompt;
130
- private createFallbackPrompt;
131
- private createFallbackResponse;
132
- private createContentSummary;
133
- /**
134
- * 安全中心:网络拒绝/放行域名检查。
135
- *
136
- * allow/ask/deny 与是否命中 allow 一律来自 Center `decide_network`。
137
- * 有序规则首命中后才查恶意库。`*` deny 在 sandbox 侧会映射成 `cfg.default_rule`,
138
- * Center 带 `deferToThreatCheck`,好让恶意库先认领归因——否则 catch-all 期间
139
- * 所有恶意命中都会被记成普通策略拒绝。判决两种顺序都是拦,差的只有归因。
140
- *
141
- * 规则同步和运行时裁决都由 Center 负责,避免 Genie 与 Sandbox 使用不同的
142
- * 本地配置快照。
143
- */
144
- private checkNetworkPolicy;
145
- private interpretCenterNetworkDecision;
146
- /**
147
- * Emit a structured webfetch event to Galileo. Captures:
148
- * - which fetch path won (cache / api / local fallback)
149
- * - whether AI summary was triggered
150
- * - per-branch content lengths and durations (so the dashboard can compare api vs. local)
151
- * - URL host only (no full URL — avoid PII / sensitive query strings)
152
- * Failures are swallowed; telemetry must not break the tool's main flow.
153
- */
154
- private reportTelemetry;
155
- /**
156
- * Extract host + path from URL safely. Returns host/path separately so the dashboard
157
- * can group by host or drill into a specific page. Querystring is intentionally dropped
158
- * to avoid leaking tokens / search keywords / other PII embedded in URL params.
159
- */
160
- private safeUrlParts;
161
- /** Truncate string to N chars to keep telemetry attribute payloads bounded. */
162
- private truncate;
163
- }
164
- export {};
@@ -1,79 +0,0 @@
1
- import { AuthenticationManager } from '@genie/authentication';
2
- import { ClientInfoProvider, ProductManager } from '@genie/product';
3
- import { Logger } from '@genie/telemetry';
4
- import type { RunContext } from '@openai/agents';
5
- import { z } from 'zod';
6
- import { type FunctionCallItem } from '../../vendor/cbc-shared/node/index.js';
7
- import { CustomHeadersProvider } from '../http';
8
- import { ThreatDomainChecker } from '../sandbox-cli/threat-domain-checker';
9
- import { Session } from '../../vendor/cbc-core/node/index.js';
10
- import { SettingsManager } from '../settings';
11
- import type { SandboxTelemetryReporter as ISandboxTelemetryReporter } from '../telemetry/sandbox-telemetry-protocol';
12
- import { BaseTool } from './base-tool';
13
- import { Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
14
- import { ToolNames } from '../../vendor/cbc-shared/node/index.js';
15
- declare const WebSearchParameters: z.ZodObject<{
16
- query: z.ZodString;
17
- allowed_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
- blocked_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
- freshness: z.ZodOptional<z.ZodString>;
20
- }, "strip", z.ZodTypeAny, {
21
- query: string;
22
- allowed_domains?: string[] | undefined;
23
- blocked_domains?: string[] | undefined;
24
- freshness?: string | undefined;
25
- }, {
26
- query: string;
27
- allowed_domains?: string[] | undefined;
28
- blocked_domains?: string[] | undefined;
29
- freshness?: string | undefined;
30
- }>;
31
- export declare class WebSearchTool extends BaseTool implements Tool {
32
- protected readonly productManager: ProductManager;
33
- protected readonly authenticationManager: AuthenticationManager;
34
- protected readonly clientInfoProvider: ClientInfoProvider;
35
- protected readonly settingsManager: SettingsManager;
36
- protected readonly customHeadersProvider: CustomHeadersProvider;
37
- protected readonly logger: Logger;
38
- protected readonly threatDomainChecker?: ThreatDomainChecker;
39
- protected readonly sandboxTelemetryReporter?: ISandboxTelemetryReporter;
40
- private readonly WEB_SEARCH_API_PATH;
41
- private readonly WEB_SEARCH_TIMEOUT_MS;
42
- name: ToolNames;
43
- resolveSensitiveEgress(input: z.infer<typeof WebSearchParameters>): {
44
- source: 'web-search';
45
- inspectionContent: string;
46
- destinationKey: string;
47
- } | undefined;
48
- parameters: z.ZodObject<{
49
- query: z.ZodString;
50
- allowed_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
51
- blocked_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
52
- freshness: z.ZodOptional<z.ZodString>;
53
- }, "strip", z.ZodTypeAny, {
54
- query: string;
55
- allowed_domains?: string[] | undefined;
56
- blocked_domains?: string[] | undefined;
57
- freshness?: string | undefined;
58
- }, {
59
- query: string;
60
- allowed_domains?: string[] | undefined;
61
- blocked_domains?: string[] | undefined;
62
- freshness?: string | undefined;
63
- }>;
64
- argumentRenderer: ToolCallArgumentRenderer;
65
- aliases: string[];
66
- /** Auto mode classifier projection: the search query (Claude alignment, decision D1). */
67
- toAutoClassifierInput(input: unknown): string;
68
- execute(params: z.infer<typeof WebSearchParameters>, _context: RunContext<Session>, _details?: {
69
- toolCall: FunctionCallItem;
70
- }): Promise<ToolResult>;
71
- private filterUnsafeResults;
72
- private recordMaliciousDomainHit;
73
- private validateParams;
74
- private performWebSearch;
75
- private buildRequestBody;
76
- private buildStructuredResult;
77
- private formatSearchResults;
78
- }
79
- export {};
@@ -1,25 +0,0 @@
1
- /**
2
- * WebFetch 只处理可读文本。图片 / 二进制资源既没有可摘要的正文,
3
- * 走 AI summary 还会白烧几十秒。分类与指引文案集中在这里,
4
- * 供工具 description 与运行时兜底共用同一套措辞。
5
- */
6
- export type WebFetchResourceKind = 'text' | 'image' | 'binary';
7
- export type WebFetchResourceSource = 'api' | 'local';
8
- export declare function normalizeContentType(contentType: string | undefined): string;
9
- export declare function classifyResourceKind(contentType: string | undefined): WebFetchResourceKind;
10
- export declare function suggestedExtensionForContentType(contentType: string | undefined): string;
11
- /**
12
- * 图片资源一旦确认,竞速必须立刻结束:远端 EdgeBrowser 对图片通常直接拒,
13
- * 等 20s 超时再 summary 是线上 SLA 的主要浪费。binary 不抢跑,
14
- * 避免把少数误标成 application/octet-stream 的 HTML 页提前掐掉。
15
- */
16
- export declare function isDecisiveNonTextResourceError(error: unknown): error is NonTextResourceError;
17
- export declare class NonTextResourceError extends Error {
18
- readonly kind: Exclude<WebFetchResourceKind, 'text'>;
19
- readonly contentType: string;
20
- readonly source: WebFetchResourceSource;
21
- constructor(kind: Exclude<WebFetchResourceKind, 'text'>, contentType: string, source: WebFetchResourceSource);
22
- }
23
- export declare function buildNonTextResourceGuidance(url: string, contentType: string | undefined, kind: Exclude<WebFetchResourceKind, 'text'>): string;
24
- /** Best-effort: 释放未消费的响应体,避免把几 MB 二进制读进内存再丢掉。 */
25
- export declare function discardResponseBody(response: Response): Promise<void>;
@@ -1,43 +0,0 @@
1
- /**
2
- * WechatReply Tool
3
- *
4
- * Allows the AI to send replies back to WeChat users via the WechatChannelBridge.
5
- * Dynamically enabled/disabled based on WeChat connection status.
6
- */
7
- import { z } from 'zod';
8
- import type { RunContext } from '../../vendor/cbc-shared/node/index.js';
9
- import type { Session } from '../../vendor/cbc-core/node/index.js';
10
- import { BaseTool } from './base-tool';
11
- import { Tool, type ToolResult } from './tool-protocol';
12
- export declare class WechatReplyTool extends BaseTool implements Tool {
13
- name: string;
14
- description: string;
15
- needsApproval: boolean;
16
- /**
17
- * Only enabled when WeChat is connected.
18
- * Checks WechatClient status dynamically at each agent run.
19
- */
20
- isEnabled: () => boolean;
21
- parameters: z.ZodObject<{
22
- chat_id: z.ZodString;
23
- text: z.ZodOptional<z.ZodString>;
24
- file_path: z.ZodOptional<z.ZodString>;
25
- context_token: z.ZodOptional<z.ZodString>;
26
- }, "strip", z.ZodTypeAny, {
27
- chat_id: string;
28
- text?: string | undefined;
29
- file_path?: string | undefined;
30
- context_token?: string | undefined;
31
- }, {
32
- chat_id: string;
33
- text?: string | undefined;
34
- file_path?: string | undefined;
35
- context_token?: string | undefined;
36
- }>;
37
- execute(input: {
38
- chat_id: string;
39
- text?: string;
40
- file_path?: string;
41
- context_token?: string;
42
- }, context?: RunContext<Session>): Promise<ToolResult>;
43
- }