@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,71 +0,0 @@
1
- import { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { ToolArg, ToolNames } from '../../vendor/cbc-shared/node/index.js';
3
- import { Workspace } from '@genie/runtime';
4
- import { Logger } from '@genie/telemetry';
5
- import type { RunContext } from '@openai/agents';
6
- import { z } from 'zod';
7
- import { ImageBlobService } from '../blob-store';
8
- import { BaseTool } from './base-tool';
9
- import { ReadFileStateService, Tool, ToolCallArgumentRenderer, ToolResult } from './tool-protocol';
10
- declare const ReadParameters: z.ZodObject<{
11
- file_path: z.ZodString;
12
- offset: z.ZodOptional<z.ZodNumber>;
13
- limit: z.ZodOptional<z.ZodNumber>;
14
- }, "strip", z.ZodTypeAny, {
15
- file_path: string;
16
- offset?: number | undefined;
17
- limit?: number | undefined;
18
- }, {
19
- file_path: string;
20
- offset?: number | undefined;
21
- limit?: number | undefined;
22
- }>;
23
- export declare class ReadTool extends BaseTool implements Tool {
24
- protected readonly workspace: Workspace;
25
- protected readonly readFileStateService: ReadFileStateService;
26
- protected readonly logger: Logger;
27
- protected readonly imageBlobService: ImageBlobService;
28
- name: ToolNames;
29
- aliases: string[];
30
- parameters: z.ZodObject<{
31
- file_path: z.ZodString;
32
- offset: z.ZodOptional<z.ZodNumber>;
33
- limit: z.ZodOptional<z.ZodNumber>;
34
- }, "strip", z.ZodTypeAny, {
35
- file_path: string;
36
- offset?: number | undefined;
37
- limit?: number | undefined;
38
- }, {
39
- file_path: string;
40
- offset?: number | undefined;
41
- limit?: number | undefined;
42
- }>;
43
- argumentRenderer: ToolCallArgumentRenderer;
44
- resolveNeedPermissionArgs(runContext: RunContext, input: z.infer<typeof ReadParameters>, callId?: string): ToolArg[];
45
- /**
46
- * Auto mode classifier projection: the file path (Claude alignment, decision
47
- * D1). Read is in the read-only history set (dropped from history), so this is
48
- * only consulted if Read is the current action being classified.
49
- */
50
- toAutoClassifierInput(input: unknown): string;
51
- execute(input: z.infer<typeof ReadParameters>, context: RunContext<Session>): Promise<ToolResult>;
52
- private validateToolParams;
53
- private readFileContent;
54
- private readFileContentStreaming;
55
- private processFileContent;
56
- private formatContentWithLineNumbers;
57
- private readJupyterNotebook;
58
- private formatJupyterNotebook;
59
- /**
60
- * 检查文件是否为图片文件
61
- */
62
- private isImageFile;
63
- /**
64
- * 读取图片文件并返回包含图片内容的 ToolResult
65
- *
66
- * 去重策略:同一 agent run 中相同内容的图片(相同 blob_id)只返回一次完整 base64,
67
- * 后续重复读取返回文本占位符,避免向模型发送冗余的大体积图片数据。
68
- */
69
- private readImageFile;
70
- }
71
- export {};
@@ -1,10 +0,0 @@
1
- export * from './repl-protocol';
2
- export * from './repl-catalog-protocol';
3
- export * from './repl-catalog-render';
4
- export * from './repl-catalog-source';
5
- export * from './repl-import-rewrite';
6
- export * from './repl-worker-source';
7
- export * from './repl-bridge-broker';
8
- export * from './repl-bridge-host';
9
- export * from './repl-tool';
10
- export * from './repl-worker-manager';
@@ -1,109 +0,0 @@
1
- /**
2
- * REPLBridgeBroker —— worker 的 toolCall / replApi / resolve / bridgeOp 落点(主线程)。
3
- *
4
- * 三条分流(见 docs/repl-code-mode/mcp-code-mode-design.md §4.1):
5
- * - 工具调用 callTool → 主动 checkPermission → 产品交互工具走 nested interruption,
6
- * 其余 DeferExecuteTool.routeToolCall
7
- * - 工具发现 searchTools / describeTool(s) → ToolSearchService(只读,不过权限判定)
8
- * - 外部桥 resolve / invoke → BridgeHost
9
- *
10
- * agent-cli 对外部桥零业务:只认 BridgeHost SPI,不知道 browser/computer 具体是什么。
11
- */
12
- import { InterruptionService, Session } from '../../../vendor/cbc-core/node/index.js';
13
- import { Logger } from '@genie/telemetry';
14
- import type { RunContext } from '@openai/agents';
15
- import { McpManager } from '../../mcp/mcp-protocol';
16
- import { ToolManager } from '../tool-protocol';
17
- import { ToolSearchService } from '../tool-search-protocol';
18
- import { AgentToolDeferOverlayCache } from '../tool-spec';
19
- import { BridgeEntry, SearchToolsOptions, ToolDescriptor, ToolSearchHit } from './repl-catalog-protocol';
20
- import { BridgeApiDescriptor, BridgeCallOpts, BridgeHost, BridgeInvokeOp, BridgeResult, REPLBridgeBroker } from './repl-protocol';
21
- export declare class REPLBridgeBrokerImpl implements REPLBridgeBroker {
22
- protected readonly logger: Logger;
23
- protected readonly host?: BridgeHost;
24
- protected readonly toolSearchService: ToolSearchService;
25
- protected readonly toolManager: ToolManager;
26
- protected readonly overlayCache: AgentToolDeferOverlayCache;
27
- protected readonly mcpManager?: McpManager;
28
- protected readonly interruptionService?: InterruptionService;
29
- resolve(_session: Session, specifier: string): Promise<BridgeApiDescriptor | null>;
30
- invoke(session: Session, op: BridgeInvokeOp, opts?: BridgeCallOpts): Promise<BridgeResult>;
31
- listBridges(_session: Session): Promise<BridgeEntry[]>;
32
- callTool(context: RunContext<Session>, toolName: string, params: Record<string, unknown>, opts?: BridgeCallOpts): Promise<{
33
- result?: unknown;
34
- error?: string;
35
- }>;
36
- private callProductInteractionTool;
37
- /**
38
- * 主动跑权限判定。**必须主动调**:REPL 的 toolCall 不经 AgentService,不调则
39
- * deny rules 与命令安全检查全被绕过(模型可在 code 里写 Bash({command:"rm -rf /"}))。
40
- *
41
- * 拦截口径分两类:
42
- * - **deny**:恒拦(deny 规则 / --disallowed-tools / dontAsk 转 deny / auto 分类器 deny)。
43
- * - **危险操作的 ask**:命令安全检查(CRITICAL/HIGH/unsafe 命令,`type:'toolValidation'`)
44
- * 与敏感文件访问(`type:'sensitiveFile'`)产出的是 `ask` 而非 `deny`。直连 Bash 会
45
- * 对这类 ask 弹窗让用户拦下,但 REPL 内层不弹窗——若同 deny 一样只看 behavior,
46
- * 模型把 `rm -rf` / 读 SSH key 包进 code 就能绕过这道安全确认(比直连更弱)。故这里
47
- * 把安全类 ask 也视为拦截,回错误给沙箱(不 abort 父 REPL,模型可 r.error 改路)。
48
- *
49
- * 其余 ask(`strategy`/`default`/`mode` 等"该工具默认需审批")仍放行:用户已对整段
50
- * code 批准过一次,不对 code 内每个普通工具重复打扰。见 §4.8。
51
- *
52
- * @returns 被拒时返回错误文案;通过返回 undefined。
53
- */
54
- private checkPermission;
55
- /**
56
- * checkPermission 自身异常时的 fail 方向。返回 true = 拒绝(fail-closed)。
57
- *
58
- * 只有同时满足以下三条才允许放行(fail-open)——即正常路径上 deny 无从产生:
59
- * 1. 无任何 deny 规则(settings `permissions.deny` 各 scope + `--disallowed-tools`);
60
- * 2. 非 print 模式(`shouldAvoidPermissionPrompts` 会把未 allow 的工具默认 deny);
61
- * 3. 权限模式在白名单内:Default / AcceptEdits(ask 在 broker 本就不拦)、
62
- * BypassPermissions / FullAccess(用户显式全放行)。DontAsk(ask→deny)、
63
- * Auto(分类器可 deny)、Plan / Delegate / 未知模式一律 fail-closed。
64
- */
65
- private mustFailClosedOnPermissionError;
66
- /**
67
- * 本会话是否配置了任何 deny 规则(settings `permissions.deny` 各 scope +
68
- * `--disallowedTools`)。口径与 ToolPermissionService Phase 1 的
69
- * `allDenyRules = [...denyRules, ...disallowedTools]` 同源。
70
- */
71
- private hasAnyDenyRule;
72
- searchTools(context: RunContext<Session>, query: string | string[], opts?: SearchToolsOptions): Promise<ToolSearchHit[]>;
73
- describeTool(context: RunContext<Session>, name: string): Promise<ToolDescriptor | null>;
74
- describeTools(context: RunContext<Session>, names: string[]): Promise<Record<string, ToolDescriptor | null>>;
75
- private overlayOf;
76
- /**
77
- * `Defer(X)` overlay 命中的内置工具可能尚未索引(索引按 product 静态配置建)。
78
- * 点名查只索引问到的那个;关键词搜索引全部精确条目。
79
- * 通配条目(`Defer(mcp__*)`)不处理——模式反向枚举不出工具名,且 MCP 索引由
80
- * mcp-manager 异步驱动。见 §4.3.3 易漏点 ③。
81
- */
82
- private ensureForceDeferIndexed;
83
- /**
84
- * 模型面名 → canonical 路由名。
85
- * `mcp_github.list_prs` → `mcp__github__list_prs`;内置单段名原样返回。
86
- * sandbox global 一律带 `mcp_` 前缀(§4.7),此处还原成真 server 名。
87
- */
88
- private toCanonicalName;
89
- private toHit;
90
- private toDescriptor;
91
- /** 目录教 `mcp_github`,hit.server 仍是裸 id `github`,两边都认。 */
92
- private matchesSearchServer;
93
- private serverNameOf;
94
- /**
95
- * 子代理 MCP 白名单:只约束 `mcp__` 前缀工具;裸名 MCP 是透明代理的全局能力,
96
- * 走白名单会误杀。agent 未注册白名单时全部放行。
97
- */
98
- private isMcpToolAllowedForAgent;
99
- /**
100
- * repl_expose 白名单(执行层,与 repl-catalog-source.ts 同口径):只约束 `mcp__`
101
- * 前缀工具的 server 级 opt-in。裸名 MCP 是透明代理全局能力、内置工具不带前缀,两者
102
- * 都不走此路径直接放行。
103
- *
104
- * **fail-closed**:查不到 server config / McpManager 缺失 / list() 抛错时一律拒绝
105
- * (返回 false)。理由与发现层一致——白名单默认 false,"拿不到配置"必须等价于"未
106
- * 暴露",否则查询失败会变成绕过白名单的旁路。
107
- */
108
- private isMcpToolReplExposed;
109
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * RemoteBridgeHost —— BridgeHost 的真实现(agent-cli 侧客户端)。
3
- *
4
- * 传输 = 一条**本地 socket / 命名管道**(Unix domain socket / Windows 命名管道),零端口。
5
- * 由 spawn agent-cli 的一方(如 WorkBuddy)经 env 传入:
6
- * - `CODEBUDDY_REPL_HOST_PIPE_PATH` —— Unix domain socket 路径(mac/linux)或命名管道 `\\.\pipe\...`(Windows)。
7
- * - `CODEBUDDY_REPL_HOST_TOKEN` —— 授权 token(**强制**)。
8
- * agent-cli 只 `net.connect(path)`(跨平台透明)、写 `{op,...,token}\n`、读 `<json>\n`。
9
- *
10
- * 安全:**token 强制**——host 是高权限(浏览器/电脑控制),裸 socket 会被同机其它进程利用。
11
- * pipe 或 token 任一未配置 → 无桥(不连接)→ `import("@wb/x")` 抛 not available。
12
- * 跨平台:Node `net` 对 Unix socket / Windows 命名管道透明,由提供方按平台给正确的 path。
13
- * 二进制:参数/返回值里的 Uint8Array/ArrayBuffer 在 socket 边界自动 ⇄ `{ $bytes: base64 }`,对模型/桥透明。
14
- * 超时:单次桥调用超时随 cell 预算(opts.timeoutMs / opts.signal),不写死。
15
- * 端到端验证需真提供方 + 真能力(本环境不具备);此为客户端半边 + 协议契约。见 docs/repl-code-mode/bridge-contract.md。
16
- */
17
- import { Logger } from '@genie/telemetry';
18
- import { BridgeApiDescriptor, BridgeCallOpts, BridgeHost, BridgeInvokeRequest, BridgeResult } from './repl-protocol';
19
- export declare class RemoteBridgeHost implements BridgeHost {
20
- protected readonly logger: Logger;
21
- listBridges(): Promise<string[]>;
22
- resolveBridge(specifier: string): Promise<BridgeApiDescriptor | null>;
23
- invokeBridge(req: BridgeInvokeRequest, opts?: BridgeCallOpts): Promise<BridgeResult>;
24
- /**
25
- * 一次连接一次请求:写 `{...,token}\n`,读 `<json>\n`。
26
- * pipe 或 token 未配置 → undefined(无桥,不连接)。失败/超时 → undefined(调用方降级)。
27
- */
28
- private post;
29
- }
@@ -1,136 +0,0 @@
1
- /**
2
- * REPL 目录契约 —— 骨架目录(进 prompt)与发现 API(沙箱运行时)的共享类型。
3
- *
4
- * 设计见 docs/repl-code-mode/mcp-code-mode-design.md §4.3。
5
- * 要点:
6
- * - 只有一份目录产物(骨架目录),档 A 给工具级明细 / 档 B 给 server 级索引,合起来全量收录。
7
- * - 没有枚举 API:"有哪些工具"读骨架目录即可,零调用零 token。
8
- * - 发现 API 只补骨架做不到的两件事:档 B 里找工具(searchTools)、完整 schema(describeTool)。
9
- */
10
- import type { RunContext } from '@openai/agents';
11
- import type { Session } from '../../../vendor/cbc-core/node/index.js';
12
- /** 工具归属:内置工具占顶层全局,MCP 工具收在 server 二级命名空间下。 */
13
- export type REPLToolCategory = 'builtin' | 'mcp';
14
- /** 采集层产出的单个工具元信息(渲染骨架与注入 sandbox 共用)。 */
15
- export interface REPLCatalogTool {
16
- /** canonical 路由名:"Bash" / "mcp__github__list_pull_requests"。 */
17
- name: string;
18
- /** 模型面调用名:"Bash" / "mcp_github.list_pull_requests"(§4.7 统一前缀)。 */
19
- displayName: string;
20
- category: REPLToolCategory;
21
- /** 一行摘要(渲染时再按预算截断)。 */
22
- summary: string;
23
- /**
24
- * 沙箱返回值形状,渲染在参数骨架后面、摘要前面。
25
- * 必须单独成字段:摘要会被 SUMMARY_MAX_CHARS 截断,返回值不能被吃掉。
26
- */
27
- returns?: string;
28
- /** JSON Schema;渲染骨架与 describeTool 都用它。 */
29
- parameters: Record<string, unknown>;
30
- /** MCP 所属 server 名(category==='mcp' 时必有)。 */
31
- server?: string;
32
- /** MCP 原始 tool name。 */
33
- serverToolName?: string;
34
- }
35
- /** 一个 MCP server 及其工具(分档的最小单位——整组降档,不半截)。 */
36
- export interface REPLCatalogServerGroup {
37
- /** 真实 server 名(用于 canonical 名与 `{server}` 过滤)。 */
38
- server: string;
39
- /** sandbox 全局键名;一律 `mcp_<server>`(§4.7),不是撞保留字才加前缀。 */
40
- globalName: string;
41
- description?: string;
42
- tools: REPLCatalogTool[];
43
- }
44
- /** 采集层产物。骨架渲染与 sandbox 注入同源于此,避免两处口径漂移。 */
45
- export interface REPLCatalog {
46
- /** 内置工具(延迟 + 非延迟合并后)。 */
47
- builtin: REPLCatalogTool[];
48
- mcp: REPLCatalogServerGroup[];
49
- /** 目录版本号 = ToolSearchService.indexEpoch,用于新鲜度对账(§4.3.4)。 */
50
- epoch: number;
51
- }
52
- export declare const ReplCatalogSource: unique symbol;
53
- /**
54
- * 目录采集层 —— **无状态**:每次 collect 现采,不缓存。
55
- *
56
- * 不缓存的理由:调用频率极低(agent 构建时一次,见 §4.3.4「注入时机与生产次数」),
57
- * 而缓存 key 需覆盖 agent 白名单 / session --tools / overlay / 动态 shouldShow 四个维度
58
- * 并跟随 indexEpoch 失效——失效逻辑比重新采集更贵,且易出 stale bug。
59
- */
60
- export interface ReplCatalogSource {
61
- /**
62
- * 采集当前会话可见的全部工具。
63
- *
64
- * 收 `RunContext` 而非 `Session`:agent 工具白名单入口
65
- * `getAllowedToolsForAgent(agentName, context)` 需要 RunContext 才能跑
66
- * `isEnabled`,且 RunContext 无法从 Session 反推(§4.3.3 易漏点 ①)。
67
- */
68
- collect(context: RunContext<Session>): Promise<REPLCatalog>;
69
- }
70
- export interface SearchToolsOptions {
71
- /** 默认 10,钳制到 [1, 50]。上限防止拿它当枚举用——枚举应读骨架目录。 */
72
- topK?: number;
73
- category?: REPLToolCategory;
74
- /** 只搜某个 MCP server(隐含 category: 'mcp')。 */
75
- server?: string;
76
- }
77
- export interface ToolSearchHit {
78
- /** 模型面调用名,可直接当 describeTool 的入参。 */
79
- name: string;
80
- category: REPLToolCategory;
81
- server?: string;
82
- /** 一行摘要(按 SUMMARY_MAX_CHARS 截断——索引里存的是 full description)。 */
83
- description: string;
84
- /** BM25 相关度,降序。 */
85
- score: number;
86
- }
87
- export interface ToolDescriptor {
88
- name: string;
89
- category: REPLToolCategory;
90
- description: string;
91
- /** 完整 JSON Schema(含嵌套结构、约束与逐字段描述)。 */
92
- parameters: Record<string, unknown>;
93
- server?: string;
94
- serverToolName?: string;
95
- }
96
- export interface BridgeEntry {
97
- /** 桥标识:"@wb/browser"。 */
98
- specifier: string;
99
- }
100
- /** worker 侧注入 sandbox 全局所需的最小描述(结构化克隆友好)。 */
101
- export interface REPLToolDescriptor {
102
- name: string;
103
- displayName: string;
104
- category: REPLToolCategory;
105
- server?: string;
106
- serverToolName?: string;
107
- }
108
- /** init / toolsUpdate 推给 worker 的载荷。 */
109
- export interface REPLToolsPayload {
110
- epoch: number;
111
- builtins: REPLToolDescriptor[];
112
- /** globalName → 该 server 下工具的 displayName 尾段与 canonical 名映射。 */
113
- servers: Array<{
114
- globalName: string;
115
- server: string;
116
- tools: Array<{
117
- method: string;
118
- canonical: string;
119
- }>;
120
- }>;
121
- }
122
- export declare const REPL_SEARCH_TOOLS_DEFAULT_TOP_K = 10;
123
- export declare const REPL_SEARCH_TOOLS_MAX_TOP_K = 50;
124
- /** describeTools 的条数上限:精准批量,不是全量拉取。 */
125
- export declare const REPL_DESCRIBE_TOOLS_MAX = 10;
126
- /**
127
- * 所有 MCP server 的 sandbox global 统一前缀(§4.7)。
128
- *
129
- * 沙箱里 MCP 工具的可调用名是 `<前缀><serverName>.<rawToolName>`,其中
130
- * `serverName` / `rawToolName` 取自 `DeferredToolInfo`(见 mcp-manager 的索引段),
131
- * **不是** canonical 名 `mcp__server__tool` 的字符串切分——transparent_proxy 场景下
132
- * canonical 段可能与 serverName 不同(例如 connector-proxy 代管的服务)。
133
- * 放在 protocol 里是为了让目录构造(repl-catalog-source)与引导文案
134
- * (main-agent-session)用同一个前缀,避免两处各写一份漂移。
135
- */
136
- export declare const MCP_SANDBOX_GLOBAL_PREFIX = "mcp_";
@@ -1,56 +0,0 @@
1
- /**
2
- * 骨架目录渲染 —— 把 REPLCatalog 渲成拼进 `code` 参数描述的纯文本。
3
- *
4
- * 设计见 docs/repl-code-mode/mcp-code-mode-design.md §4.3.2。
5
- *
6
- * 分档降级(档 A/B)是本文件的核心:
7
- * - 档 A(工具级,~100B/工具):每工具一行 `name({ 参数骨架 }) — 描述`
8
- * - 档 B(server 级,~70B/server):一行 `name (N tools) — 描述`
9
- *
10
- * 降级单位是 **server 整组**,不半截——半截会让模型以为该 server 只有那几个工具。
11
- * 档 B 体积几乎不随工具数增长,所以任意规模都装得下:装不下的只是档 A。
12
- */
13
- import { REPLCatalog, REPLCatalogServerGroup, REPLCatalogTool } from './repl-catalog-protocol';
14
- /** 骨架总预算,对齐 DEFAULT_DEFERRED_TOOLS_CHAR_BUDGET(~20000 chars ≈ ~5000 tokens)。 */
15
- export declare const SKELETON_CHAR_BUDGET = 20000;
16
- /** 单工具最多列几个顶层参数,超出记 `…+N`。 */
17
- export declare const MAX_PARAMS_PER_TOOL = 6;
18
- /** 单工具一行摘要的截断长度(searchTools 的出参共用该常量)。 */
19
- export declare const SUMMARY_MAX_CHARS = 80;
20
- /** 档 B 里 server 描述的截断长度。 */
21
- export declare const SERVER_DESC_MAX_CHARS = 100;
22
- export declare function truncate(text: string, max: number): string;
23
- /**
24
- * 类型渲染:枚举原样列出(≤4 项),数组给壳,嵌套对象一律折叠成 `object`。
25
- *
26
- * 折叠是刻意的——完整嵌套 schema 可达数 KB(实测 AskUserQuestion 3966B vs 骨架 73B,
27
- * 54 倍)。代价是 `object` 对模型是信息不足的信号,因此兜底说明必须告诉它
28
- * "看到 object 就调 describeTool",否则模型会把它当成"接受任意对象"。
29
- */
30
- export declare function renderType(def: unknown): string;
31
- /**
32
- * 从 JSON Schema 派生单个参数对象的骨架:只取顶层 properties,必填优先。
33
- *
34
- * REPL 预注入函数的运行时契约始终是 `Tool(params)`,不是多个位置参数。这里必须
35
- * 保留对象花括号;否则 `Artifact(filePath: string, ...)` 会误导模型传入字符串,导致
36
- * 工具侧收到的 `input.filePath` 为 undefined。
37
- */
38
- export declare function renderParameterSkeleton(schema: Record<string, unknown> | undefined): string;
39
- /** 档 B 一行:`name (N tools) — description`。 */
40
- export declare function renderServerTierB(group: REPLCatalogServerGroup): string;
41
- export interface TierAllocation {
42
- tierA: REPLCatalogServerGroup[];
43
- tierB: REPLCatalogServerGroup[];
44
- }
45
- /**
46
- * 档 A/B 分配:builtin 无条件档 A(不参与预算竞争);MCP 按工具数升序填至预算,
47
- * 溢出的整组降档 B。
48
- *
49
- * 按工具数升序是性价比优先:一个小 server 只要几百字节,先进档 A 能覆盖更多 server。
50
- */
51
- export declare function allocateTiers(builtin: REPLCatalogTool[], mcpGroups: REPLCatalogServerGroup[], budget?: number): TierAllocation;
52
- /**
53
- * 渲染骨架目录全文。档 A + 档 B 合起来**全量收录**——所以模型读它即知会话里有什么,
54
- * 不需要任何枚举 API。
55
- */
56
- export declare function renderSkeletonCatalog(catalog: REPLCatalog, budget?: number): string;
@@ -1,117 +0,0 @@
1
- /**
2
- * ReplCatalogSource —— 骨架目录与发现 API 的统一采集层(主线程)。
3
- *
4
- * 设计见 docs/repl-code-mode/mcp-code-mode-design.md §4.3.2「目录数据源」。
5
- *
6
- * 三个数据源,各补一块:
7
- * - ToolSearchService.listDeferredToolInfos() → 延迟工具(builtin + MCP),带 parameters
8
- * - ToolManager.listRegisteredTools() → 非延迟内置工具(不在延迟索引里)
9
- * - McpManager.getConnectedServers() → 补"已连接但尚无工具"的空分组
10
- *
11
- * **无状态**:每次 collect 现采、不缓存。理由见 protocol 里 ReplCatalogSource 的注释。
12
- */
13
- import { Logger } from '@genie/telemetry';
14
- import type { RunContext } from '@openai/agents';
15
- import { CliRuntimeOptions } from '../../cli/cli-runtime-options';
16
- import { McpManager } from '../../mcp/mcp-protocol';
17
- import type { Session } from '../../../vendor/cbc-core/node/index.js';
18
- import { ToolManager } from '../tool-protocol';
19
- import { ToolSearchService } from '../tool-search-protocol';
20
- import { AgentToolDeferOverlayCache } from '../tool-spec';
21
- import { REPLCatalog, ReplCatalogSource } from './repl-catalog-protocol';
22
- /**
23
- * 所有 MCP server 的 sandbox global 统一加 `mcp_` 前缀(§4.7,常量定义在 protocol)。
24
- * 与内置工具 / 基础设施(Bash、Read、REPL、tools…)彻底隔离,骨架目录里
25
- * 看到 `mcp_xxx:` 就能照抄。canonical 全名(mcp__server__tool)不受影响。
26
- * worker 侧 `INFRA_GLOBALS` 仍是第二道防线,防止漏改名的 catalog 顶掉 SDK。
27
- */
28
- export declare class ReplCatalogSourceImpl implements ReplCatalogSource {
29
- protected readonly logger: Logger;
30
- protected readonly toolSearchService: ToolSearchService;
31
- protected readonly toolManager: ToolManager;
32
- protected readonly overlayCache: AgentToolDeferOverlayCache;
33
- protected readonly mcpManager?: McpManager;
34
- protected readonly cliRuntimeOptions?: CliRuntimeOptions;
35
- collect(context: RunContext<Session>): Promise<REPLCatalog>;
36
- /**
37
- * 构建期兜底:当 live session 未携带 `--tools`(agent 构建早于会话建立,
38
- * getCurrent() 为 undefined)时,用进程级 CliRuntimeOptions 的 `--tools`
39
- * 合成一个带 options.tools 的 context,交给 getAllowedToolsForAgent 走同一套
40
- * 白名单解析。
41
- *
42
- * 优先级与 ToolManager.resolveSessionToolContext 对齐:live session 已有
43
- * options.tools 时**不覆盖**(它是权威值);仅在缺失时才回退到 CLI 快照。
44
- * 未装配 CliRuntimeOptions(headless/单测)或无 `--tools` 时原样返回。
45
- */
46
- private contextWithCliTools;
47
- private ensureGroup;
48
- private appendEmptyServerGroups;
49
- /**
50
- * 采集全部 MCP server 的配置,建立 serverName → McpConfig 映射,供 repl_expose 判定用。
51
- * 失败时返回空 map —— 白名单默认 false,等价于"任何 MCP 都不暴露给沙箱",安全兜底。
52
- */
53
- private collectServerConfigs;
54
- /**
55
- * repl_expose 白名单判定(仅约束 MCP 工具,内置工具不走此路径)。
56
- * 只认 server 级:显式 repl_expose:true 才暴露,其余(含未配置)一律默认 false。
57
- */
58
- private isReplExposed;
59
- private toBuiltinTool;
60
- /**
61
- * 合并本会话的全部 deny 规则来源,口径与 ToolPermissionService Phase 1 的
62
- * `allDenyRules = [...mergeRulesFromAllSources(denyRules), ...disallowedTools]` 同源。
63
- */
64
- private collectDenyRules;
65
- /**
66
- * 名字(含别名)是否命中**整工具级** deny 规则。
67
- *
68
- * 只有 `rule === '*'` 才整体隐藏;带参规则(`Bash(rm:*)`)交给执行期
69
- * ToolPermissionService Phase 1,工具本身必须留在目录里,否则模型连
70
- * 合法用法都看不到。
71
- */
72
- private isWholeToolDenied;
73
- /**
74
- * 整工具级 deny 规则命中的**内置**工具名集合(MCP 由调用方按单名逐个判)。
75
- *
76
- * 与 `AgentManager.isToolDisallowed` 严格同口径:匹配时**带上 aliases**——
77
- * `--disallowed-tools read` 要能同时命中 LSP / BashOutput 等把 `read` 声明为
78
- * 别名的工具(isToolDisallowed 用的是 `[toolName, ...aliases]`)。
79
- *
80
- * 无任何 deny 规则时立刻返回,避免为绝大多数会话白跑一遍 O(工具数×规则数)。
81
- */
82
- private collectWholeToolDenyNames;
83
- private toMcpTool;
84
- /** 裸名 MCP 工具没有 serverName 也不带 mcp__ 前缀,此时返回 undefined 归入 builtin 段。 */
85
- private serverNameOf;
86
- /**
87
- * 内置工具的 agent 白名单判定:与 ToolSearchService.isAllowedByAgentTools 同口径
88
- * (MCP 工具豁免,内置工具必须显式启用)。
89
- */
90
- private isAllowedBuiltin;
91
- /**
92
- * REPL 自己与 defer 机制的两个工具不进目录:
93
- * REPL 不能自我递归调用;ToolSearch/DeferExecuteTool 在沙箱里被
94
- * searchTools/describeTool 取代,暴露它们只会让模型混淆两条调用路径。
95
- */
96
- private isHiddenFromCatalog;
97
- /**
98
- * PTC 跳过直连白名单之后,仍要过工具自己的 isEnabled。
99
- * 否则 WorkBuddy 的沙箱骨架会列出 SpeakInChannel / MessageColleague。
100
- */
101
- private isSandboxToolEnabled;
102
- /**
103
- * 归一化成 JSON Schema。三种入参形态都要处理:
104
- * - 已是 JSON Schema 对象 → 原样
105
- * - zod schema → `zodToJsonSchema`
106
- * - **函数**(`parameters(): ZodTypeAny` / `async () => ...`)→ 先调用再转
107
- *
108
- * 第三种必须处理:`ToolManager.init()` 对函数式 `parameters` **刻意跳过**转换
109
- * (留给 `get()` 时动态生成),而这里走 `listRegisteredTools()` 拿的是原始 toolMap,
110
- * `parameters` 仍是函数。漏掉它会让 Bash / PowerShell / Agent / StructuredOutput
111
- * 在骨架目录里渲染成无参的 `Bash()` —— 而 Bash 恰是价值最高的工具。
112
- *
113
- * 函数必须带 `thisArg`:Agent 的 `parameters()` 是 `return this.buildParametersSchema()`,
114
- * 抽成裸 `()` 调用会在 strict 下把 schema 打成 `{}`。
115
- */
116
- private asJsonSchema;
117
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * 预处理用户 REPL 代码,在包进 async-IIFE 之前用 acorn 做两趟变换:
3
- * 1. 动态 import(x) → __replImport(x)(bridge resolver 全局;Bun 的 vm.SyntheticModule 有 bug,只能源码改写)。
4
- * 2. 顶层声明提升 + 末尾表达式 → return:
5
- * - const/let/var/function/class 改写成对持久 vm.Context 的 global 赋值,让变量跨 cell 存活
6
- * (kernel/cell 模型的关键——否则 IIFE 一结束声明就没了,`const x = 5` 下个 cell 就读不到);
7
- * - 最后一条裸表达式前缀 `return`,所以 `return` 和末尾表达式两种写法都能拿到结果。
8
- *
9
- * 变换后由 manager 包进 (async () => { ... })()。顶层 await/return 落进这个 async 函数;顶层声明已经被改成
10
- * 对 global 的 bare 赋值——非严格模式下 bare 赋值写到 vm.Context 的 global,于是跨 cell 持久。
11
- */
12
- /** import() → __replImport() + 顶层声明提升到 global + 末尾表达式 → return。解析失败则原样返回(交给 vm.Script 报错)。
13
- *
14
- * async:内部走 acorn/acorn-walk lazy chunk(standby 不 parse);本函数是 hot path
15
- * 上唯一使用者。caller `repl-worker-manager.executeCell` 在 async 上下文,加 await 即可。
16
- */
17
- export declare function transformReplCode(source: string): Promise<string>;
@@ -1,32 +0,0 @@
1
- /**
2
- * Nested product-interaction from inside a REPL cell.
3
- *
4
- * Broker `checkPermission` skips upgrading `ask` to a popup (the user already
5
- * approved the cell). That is correct for Write/Bash and wrong for tools whose
6
- * job *is* the interaction: AskUserQuestion needs `toolCallId` + `setAsk`,
7
- * ExitPlanMode needs the plan-approval panel.
8
- *
9
- * Do not use `session.state.approve/reject` here. CLI UI reject of a normal
10
- * tool interruption aborts the session (`interruption-service` ~833). Nested
11
- * calls must settle the cell without aborting the parent REPL run.
12
- *
13
- * Reuse the sandbox settle pattern (`_sandboxResolve` + `enqueueSandboxApproval`)
14
- * without sandbox UI flags. TUI/ACP dispatch on `rawItem.name`.
15
- */
16
- import type { RunContext } from '@openai/agents';
17
- import type { InterruptionService as IInterruptionService, Session } from '../../../vendor/cbc-core/node/index.js';
18
- import { type ToolResult } from '../tool-protocol';
19
- export declare const REPL_PLAN_REJECTED_MESSAGE = "The user rejected the plan. Stay in plan mode, revise the plan, then call ExitPlanMode again.";
20
- export declare const REPL_NESTED_NONINTERACTIVE_MESSAGE: string;
21
- export interface ReplNestedInteractionDeps {
22
- interruptionService: Pick<IInterruptionService, 'enqueueSandboxApproval' | 'reject'>;
23
- execute: (toolName: string, params: Record<string, unknown>, context: RunContext<Session>, details: {
24
- toolCall: {
25
- callId: string;
26
- id: string;
27
- name: string;
28
- arguments: string;
29
- };
30
- }) => Promise<ToolResult>;
31
- }
32
- export declare function runReplProductInteraction(deps: ReplNestedInteractionDeps, context: RunContext<Session>, toolName: string, params: Record<string, unknown>, cellSignal?: AbortSignal): Promise<ToolResult>;