@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,65 +0,0 @@
1
- /**
2
- * Pure helpers for classifying and sanitizing teammate sub-agent failures.
3
- *
4
- * Part of Issue 5 (teammate auth failure propagation):
5
- * docs/workbuddy/fix/task-status-sync/issue-5-teammate-auth-failure.md
6
- *
7
- * `categorizeFailure` is used by AgentTask.execute()'s failed branch to tag
8
- * the failure with a coarse category; `sanitizeErrorForPrompt` strips out
9
- * credentials / URL query strings before the reason is forwarded to UI or
10
- * injected into the team-lead system prompt.
11
- *
12
- * Both functions are pure, synchronous, and have no runtime dependencies so
13
- * they are straightforward to unit-test.
14
- */
15
- export type TeammateFailureCategory = 'auth' | 'network' | 'model' | 'unknown';
16
- /**
17
- * Canonical error message used throughout `agent-task.ts` when the user
18
- * actively cancels a running sub-agent (e.g. pressing Esc / Ctrl+C, or the
19
- * UI sending an interrupt). Exported as a constant so producers and the
20
- * `isUserInterruption` predicate stay in sync — drift here would silently
21
- * regress the "interrupted ≠ failed" classification (Issue 5 follow-up).
22
- */
23
- export declare const TASK_INTERRUPTED_BY_USER_MESSAGE = "Task was interrupted by user";
24
- /**
25
- * Identify whether a thrown error represents a **user-initiated**
26
- * interruption (Esc / Ctrl+C / UI cancel) as opposed to a real sub-agent
27
- * failure.
28
- *
29
- * Used by `AgentTask.execute()`'s catch branch to route interruptions to
30
- * `cancelled` (a benign terminal state) instead of `failed`. A failed
31
- * teammate would otherwise get its `lastFailure` recorded on the team
32
- * registry and surface as a `<teammate-failures>` block on the team-lead's
33
- * next turn — even though the teammate is healthy and will resume on the
34
- * next message.
35
- *
36
- * Detection is exact-match on `Error.message` because every producer in
37
- * `agent-task.ts` constructs the error via
38
- * `new Error(TASK_INTERRUPTED_BY_USER_MESSAGE)` (see the 5 reject sites in
39
- * `waitForAgentCompletion`). String-based fallback handles the rare case
40
- * where the same sentinel reaches us as a plain string.
41
- */
42
- export declare function isUserInterruption(error: unknown): boolean;
43
- /**
44
- * Classify a sub-agent failure into a coarse-grained category so the UI and
45
- * the team-lead prompt can adapt phrasing without needing to parse raw
46
- * model-provider errors.
47
- *
48
- * Detection is substring-based and case-insensitive; callers should treat
49
- * this as a best-effort hint rather than a contract.
50
- */
51
- export declare function categorizeFailure(error: unknown): TeammateFailureCategory;
52
- /**
53
- * Produce a version of the error message that is safe to embed into:
54
- * - UI tooltips shown to the end user
55
- * - `<teammate-failures>` system-reminder XML injected into team-lead prompts
56
- *
57
- * Responsibilities:
58
- * 1. Strip likely credentials (API keys, Bearer tokens, ?key=, etc.).
59
- * 2. Strip URL query strings entirely (they often carry auth / signatures).
60
- * 3. Collapse whitespace.
61
- * 4. Truncate to {@link ERROR_MESSAGE_MAX_LENGTH} characters.
62
- *
63
- * Never returns `undefined`. If the error is falsy, returns an empty string.
64
- */
65
- export declare function sanitizeErrorForPrompt(error: unknown): string;
@@ -1,98 +0,0 @@
1
- import type { TeamMember } from './team-member';
2
- /**
3
- * Shutdown Coordinator
4
- * ====================
5
- *
6
- * Block C of the "align CC Agent Teams three gaps" MR.
7
- *
8
- * Leader-side orchestration for graceful teammate shutdown with a
9
- * fail-safe force-kill. CC sends `shutdown_request` via mailbox and
10
- * *waits indefinitely* — if the teammate model never responds (hung,
11
- * crashed mid-turn, ignored the request), the pending request leaks.
12
- * cbc closes that gap by adding a timeout that force-kills the teammate
13
- * if no `shutdown_response` arrives within
14
- * `CODEBUDDY_TEAM_SHUTDOWN_GRACEFUL_TIMEOUT_MS` (default 15s).
15
- *
16
- * Public shape:
17
- *
18
- * const coord = ContainerUtil.get<ShutdownCoordinator>(ShutdownCoordinator);
19
- * const outcome = await coord.shutdown(member, { reason, timeoutMs });
20
- * // outcome: 'approved' | 'rejected' | 'timeout' | 'forced' | 'not-alive'
21
- *
22
- * `fulfillResponse(requestId, approved, reason?)` is invoked from the
23
- * SendMessageTool's `handleShutdownResponse` path when a teammate replies
24
- * — it matches the requestId into the pending map and resolves.
25
- *
26
- * Integration with Block A:
27
- * - Optional `waitForIdleFirst: true` — the coordinator waits up to a
28
- * third of `timeoutMs` for the teammate to become idle before
29
- * sending shutdown_request. Gives well-behaved teammates a chance
30
- * to finish the current turn cleanly.
31
- *
32
- * env:
33
- * - `CODEBUDDY_TEAM_SHUTDOWN_GRACEFUL_TIMEOUT_MS=15000` (default)
34
- * - Set to `0` to disable fail-safe forceKill (CC parity — wait forever)
35
- */
36
- export declare const ShutdownCoordinator: unique symbol;
37
- export type ShutdownOutcome = 'approved' | 'rejected' | 'timeout' | 'forced' | 'not-alive';
38
- export interface ShutdownOptions {
39
- /** Short reason string forwarded into the shutdown_request payload. */
40
- reason?: string;
41
- /**
42
- * Wall-clock ms budget. `undefined` → read env default. `0` → disable
43
- * fail-safe (wait indefinitely, resolve 'timeout' only if cancelAll
44
- * fires).
45
- */
46
- timeoutMs?: number;
47
- /**
48
- * If true, coord.shutdown() first awaits `tracker.waitForIdle(..., timeoutMs/3)`
49
- * so the teammate can drain the current turn. Relevant only if Block A
50
- * tracker is enabled (otherwise no-op and continues immediately).
51
- */
52
- waitForIdleFirst?: boolean;
53
- }
54
- export interface ShutdownCoordinator {
55
- /**
56
- * Orchestrated shutdown for a single teammate. Never throws; always
57
- * resolves an outcome string.
58
- */
59
- shutdown(member: TeamMember, opts?: ShutdownOptions): Promise<ShutdownOutcome>;
60
- /**
61
- * Called from `SendMessageTool.handleShutdownResponse` when a teammate
62
- * writes a shutdown_response to the leader mailbox. Looks up the
63
- * requestId and resolves the pending promise.
64
- *
65
- * Returns `true` if the requestId matched a pending shutdown, `false`
66
- * if no match. Callers (e.g. the lead-inbox poller) use this to decide
67
- * whether the response was an "internal" coordinator-driven shutdown
68
- * (match → silently consume) or a "tool-driven" shutdown initiated by
69
- * the LLM lead via SendMessage(type=shutdown_request) (no match → the
70
- * lead has no pending promise to resolve, so the response should be
71
- * surfaced into the lead session as a teammate message instead of
72
- * being silently dropped).
73
- *
74
- * Unknown requestId → logged + return `false` (safe: the pending slot
75
- * may have timed out already, or the request was tool-initiated).
76
- */
77
- fulfillResponse(requestId: string, approved: boolean, reason?: string): boolean;
78
- /**
79
- * Cancel every pending shutdown request (e.g. leader exit / team
80
- * deletion). All pending promises resolve 'timeout' (NOT 'forced' —
81
- * caller is responsible for subsequent forceKill).
82
- */
83
- cancelAll(reason: string): void;
84
- }
85
- export declare function resolveShutdownTimeoutMs(): number;
86
- export declare class ShutdownCoordinatorImpl implements ShutdownCoordinator {
87
- private readonly logger;
88
- private readonly pending;
89
- constructor();
90
- shutdown(member: TeamMember, opts?: ShutdownOptions): Promise<ShutdownOutcome>;
91
- fulfillResponse(requestId: string, approved: boolean, reason?: string): boolean;
92
- cancelAll(reason: string): void;
93
- private onTimeout;
94
- private resolvePending;
95
- private waitIdleBestEffort;
96
- private canReceiveShutdown;
97
- private newRequestId;
98
- }
@@ -1,13 +0,0 @@
1
- import { type Session } from '../../vendor/cbc-core/node/index.js';
2
- import { type AgentInputItem } from '../../vendor/cbc-shared/node/index.js';
3
- import type { Logger } from '@genie/telemetry';
4
- import { type TeamConfig } from './team-protocol';
5
- import { type TeamRuntimeManifest } from './team-runtime-manifest';
6
- export interface TeamRuntimeAdoption {
7
- manifest: TeamRuntimeManifest;
8
- config: TeamConfig;
9
- adoptedMembers: string[];
10
- unresumableMembers: string[];
11
- }
12
- export declare function adoptTeamRuntimeForSession(session: Session, logger?: Logger): Promise<TeamRuntimeAdoption | undefined>;
13
- export declare function buildTeamRuntimeResumeInput(session: Session, adoption?: TeamRuntimeAdoption, logger?: Logger): AgentInputItem | undefined;
@@ -1,66 +0,0 @@
1
- import type { TeammateBackendType } from './backends/teammate-backend-protocol';
2
- import type { TeamConfig, TeamMemberInfo } from './team-protocol';
3
- export declare const TEAM_RUNTIME_MANIFEST_VERSION = 1;
4
- export declare const TEAM_RUNTIME_MANIFEST_FILE = "runtime.json";
5
- export type TeamRuntimeStatus = 'active' | 'paused_after_cancel' | 'completed' | 'cancelled';
6
- export type TeamRuntimeMemberStatus = 'running' | 'idle' | 'paused' | 'completed' | 'failed' | 'cancelled' | 'killed' | 'unresumable';
7
- export type TeamRuntimeMemberLifecycle = 'alive' | 'terminated';
8
- export interface TeamRuntimeMember {
9
- name: string;
10
- agentId: string;
11
- taskId?: string;
12
- agentType: string;
13
- backendType: TeammateBackendType;
14
- model?: string;
15
- prompt?: string;
16
- cwd?: string;
17
- color?: string;
18
- permissionMode?: string;
19
- planApproved?: boolean;
20
- maxTurns?: number;
21
- taskDescription?: string;
22
- resumeSessionId?: string;
23
- transcriptPath?: string;
24
- status: TeamRuntimeMemberStatus;
25
- /** Logical actor lifecycle. Missing in legacy v1 manifests means alive. */
26
- lifecycle?: TeamRuntimeMemberLifecycle;
27
- updatedAt: number;
28
- }
29
- export interface TeamRuntimeManifest {
30
- version: typeof TEAM_RUNTIME_MANIFEST_VERSION;
31
- teamName: string;
32
- leadSessionId: string;
33
- leadAgentId: string;
34
- createdAt: number;
35
- updatedAt: number;
36
- status: TeamRuntimeStatus;
37
- members: TeamRuntimeMember[];
38
- }
39
- export interface TeamRuntimeMemberRecordOptions {
40
- taskId?: string;
41
- status?: TeamRuntimeMemberStatus;
42
- /** Permanent logical shutdown is monotonic for one durable member identity. */
43
- lifecycle?: 'terminated';
44
- permissionMode?: string;
45
- planApproved?: boolean;
46
- maxTurns?: number;
47
- taskDescription?: string;
48
- }
49
- export interface TeamRuntimeLookupResult {
50
- manifest: TeamRuntimeManifest;
51
- member: TeamRuntimeMember;
52
- }
53
- export declare function getTeamRuntimeManifestPath(teamName: string): string;
54
- export declare function getTeamMemberTranscriptPath(leadSessionId: string, taskId: string): string;
55
- export declare function readTeamConfig(teamName: string): Promise<TeamConfig | undefined>;
56
- export declare function findTeamConfigByLeadSessionId(leadSessionId: string): Promise<TeamConfig | undefined>;
57
- export declare function readTeamRuntimeManifest(teamName: string): Promise<TeamRuntimeManifest | undefined>;
58
- export declare function writeTeamRuntimeManifest(manifest: TeamRuntimeManifest): Promise<void>;
59
- export declare function createTeamRuntimeManifest(config: TeamConfig, status?: TeamRuntimeStatus): TeamRuntimeManifest;
60
- export declare function ensureTeamRuntimeManifest(config: TeamConfig, status?: TeamRuntimeStatus): Promise<TeamRuntimeManifest>;
61
- export declare function recordTeamRuntimeMember(teamName: string, leadSessionId: string, leadAgentId: string, member: TeamMemberInfo, options?: TeamRuntimeMemberRecordOptions): Promise<TeamRuntimeManifest>;
62
- export declare function updateTeamRuntimeMemberStatus(teamName: string, memberName: string, status: TeamRuntimeMemberStatus): Promise<void>;
63
- export declare function markTeamRuntimePausedAfterCancel(teamName: string, leadSessionId?: string): Promise<void>;
64
- export declare function markTeamRuntimeActiveAfterHumanResume(teamName: string, leadSessionId?: string): Promise<void>;
65
- export declare function findTeamRuntimeManifestByLeadSessionId(leadSessionId: string): Promise<TeamRuntimeManifest | undefined>;
66
- export declare function findTeamRuntimeMemberByReference(reference: string, leadSessionId?: string): Promise<TeamRuntimeLookupResult | undefined>;
@@ -1,34 +0,0 @@
1
- import type { Session } from '../../vendor/cbc-core/node/index.js';
2
- import { type TeamRuntimeLookupResult, type TeamRuntimeManifest, type TeamRuntimeMember, type TeamRuntimeMemberLifecycle, type TeamRuntimeMemberStatus, type TeamRuntimeStatus } from './team-runtime-manifest';
3
- export interface TeamRuntimeMemberStatusView {
4
- name: string;
5
- agentId: string;
6
- taskId?: string;
7
- agentType: string;
8
- backendType: TeamRuntimeMember['backendType'];
9
- status: TeamRuntimeMemberStatus;
10
- lifecycle: TeamRuntimeMemberLifecycle;
11
- taskDescription?: string;
12
- updatedAt: number;
13
- canResume: boolean;
14
- pausedAfterCancel: boolean;
15
- }
16
- export interface TeamRuntimeStatusView {
17
- teamName: string;
18
- leadSessionId: string;
19
- leadAgentId: string;
20
- status: TeamRuntimeStatus;
21
- updatedAt: number;
22
- pausedAfterCancel: boolean;
23
- hasPausedMembers: boolean;
24
- hasResumablePausedMembers: boolean;
25
- members: TeamRuntimeMemberStatusView[];
26
- }
27
- export interface TeamRuntimeMemberLookupStatus extends TeamRuntimeLookupResult {
28
- runtime: TeamRuntimeStatusView;
29
- memberStatus: TeamRuntimeMemberStatusView;
30
- }
31
- export declare function toTeamRuntimeMemberStatus(member: TeamRuntimeMember, manifest: TeamRuntimeManifest): TeamRuntimeMemberStatusView;
32
- export declare function toTeamRuntimeStatus(manifest: TeamRuntimeManifest): TeamRuntimeStatusView;
33
- export declare function readTeamRuntimeStatus(teamName: string, session?: Session): Promise<TeamRuntimeStatusView | undefined>;
34
- export declare function findTeamRuntimeMemberStatus(reference: string, leadSessionId?: string): Promise<TeamRuntimeMemberLookupStatus | undefined>;
@@ -1,205 +0,0 @@
1
- import { type AgentJobState, type AgentJobView, type IJobStore } from './agent-view-protocol';
2
- export interface AgentViewActionDeps {
3
- store: IJobStore;
4
- /** 复用 DaemonProcessManager 的 detached fork 与信号能力 */
5
- processManager: {
6
- forkBgSession(args: string[], options: {
7
- name?: string;
8
- cwd?: string;
9
- extraEnv?: Record<string, string>;
10
- skipPrintMode?: boolean;
11
- jobWorker?: boolean;
12
- }): Promise<{
13
- pid: number;
14
- logPath: string;
15
- }>;
16
- sendSignal(pid: number, signal: NodeJS.Signals): boolean;
17
- isProcessRunning(pid: number): boolean;
18
- waitForExit(pid: number, timeoutMs?: number): Promise<boolean>;
19
- };
20
- /** 日志目录,shell job 的输出落在这里 */
21
- logDir: string;
22
- /**
23
- * Optional override for tests. Default: kill(0) + process-start identity.
24
- * Identity mismatch ⇒ not alive (do not signal).
25
- */
26
- isJobProcessAlive?(pid: number | undefined, identity: {
27
- procStart?: string | null;
28
- procStartFt?: string | null;
29
- } | undefined): Promise<boolean>;
30
- }
31
- export interface DispatchOptions {
32
- prompt: string;
33
- cwd: string;
34
- /** 指定主 agent */
35
- agent?: string;
36
- /** 覆盖模型 */
37
- model?: string;
38
- /** 覆盖权限模式 */
39
- permissionMode?: string;
40
- /** 覆盖推理投入档位 */
41
- effort?: string;
42
- /** 用户显式命名 */
43
- name?: string;
44
- /** 后台首次写文件时是否自动进入隔离 worktree;缺省继续跟随 TUI/全局设置。 */
45
- bgIsolation?: 'none' | 'worktree';
46
- /**
47
- * 注入到首条 prompt 之前的隐藏上下文(如主会话受限预览)。
48
- * 只进入 spawn 的位置参数;intent/initialPrompt 保持干净 prompt,
49
- * 标题与列表不受污染。
50
- */
51
- contextPrefix?: string;
52
- /**
53
- * 打开 agent view 时给的配置 flag(`--effort` / `--settings` / `--add-dir`
54
- * / `--plugin-dir` / `--mcp-config` / `--strict-mcp-config` 等)。
55
- * 文档要求这些 flag 既作用于视图自身也透传给它派发的每个会话。
56
- */
57
- extraFlags?: readonly string[];
58
- }
59
- export interface DispatchResult {
60
- id: string;
61
- pid: number;
62
- logPath: string;
63
- }
64
- export interface DispatchLifecycle {
65
- /**
66
- * The durable job record now exists and can be selected by clients. Process
67
- * startup intentionally happens afterwards so HTTP callers do not wait for
68
- * the worker to finish booting before entering the agent view.
69
- */
70
- onJobCreated?: (job: {
71
- id: string;
72
- sessionId: string;
73
- }) => void | Promise<void>;
74
- /** Keep an already-visible row restartable when worker startup fails. */
75
- keepJobOnStartupFailure?: boolean;
76
- }
77
- /**
78
- * 派发一个新的后台会话。
79
- *
80
- * 顺序很关键:先生成 sessionId 并建好 job 目录,再 fork。
81
- * 反过来的话子进程可能在 job 目录存在之前就开始汇报状态,
82
- * 那些汇报会静默丢掉,行上就会一直停在 "starting…"。
83
- */
84
- export declare function dispatchBackgroundSession(deps: AgentViewActionDeps, options: DispatchOptions, lifecycle?: DispatchLifecycle): Promise<DispatchResult>;
85
- /**
86
- * 把一个历史会话作为后台 job 重新挂回列表(agent view 里的 `/resume` picker)。
87
- *
88
- * 靠 `--resume <sessionId>` 拉起常驻 worker:只恢复历史、不重放任何 prompt,
89
- * 回来后停在 idle 等你下一句话(与 respawn 同构,但这里 job 记录是新建的
90
- * —— 之前它可能已从列表删除,只剩磁盘上的 transcript)。
91
- */
92
- export declare function resumeSessionAsJob(deps: AgentViewActionDeps, options: {
93
- sessionId: string;
94
- cwd: string;
95
- name?: string;
96
- extraFlags?: readonly string[];
97
- }): Promise<DispatchResult>;
98
- /**
99
- * 还没开过 1:1 的同事:起一个空会话 job,停在 idle 等收件箱。
100
- * 不把频道信封当位置参数(那会画成用户气泡)。
101
- */
102
- export declare function spawnIdleBackgroundSession(deps: AgentViewActionDeps, options: {
103
- cwd: string;
104
- name?: string;
105
- agent?: string;
106
- /** 这个同事固定跑哪个模型 / 权限模式(建人时定,随 respawnArgs 一起持久化)。 */
107
- model?: string;
108
- permissionMode?: string;
109
- }): Promise<DispatchResult>;
110
- /**
111
- * 派发一个 shell job(输入框 `!` 前缀)。
112
- *
113
- * 不调用模型,输出也不进任何会话——就是把一条命令挂在后台跑,
114
- * 行上显示它最近一行输出。
115
- */
116
- export declare function dispatchShellJob(deps: AgentViewActionDeps, options: {
117
- command: string;
118
- cwd: string;
119
- }): Promise<DispatchResult>;
120
- /**
121
- * 读取日志尾部的若干非空行。
122
- *
123
- * 后台会话跑在 `-p` 模式下,模型的最终回答就是它写到日志里的内容,
124
- * 所以这是"不发起额外模型请求就能拿到结果摘要"的唯一来源
125
- * (对齐 Claude 的 15 秒无请求刷新路径)。
126
- */
127
- export declare function readLogTailLines(logPath: string, maxLines?: number): Promise<string[]>;
128
- /** 读取日志最后一行,作为 shell job 的行内摘要 */
129
- export declare function readLogTailLine(logPath: string): Promise<string | undefined>;
130
- /** 停止会话进程并把状态标记为 stopped */
131
- export declare function stopJob(deps: AgentViewActionDeps, job: AgentJobView): Promise<void>;
132
- export interface DeleteJobResult {
133
- deleted: boolean;
134
- /** 未删除时的原因,会渲染成行内 `not deleted` 提示 */
135
- reason?: string;
136
- /** 会话已删但 worktree 目录被保留在盘上时,报出它的路径 */
137
- keptWorktreePath?: string;
138
- }
139
- /** 判断 worktree 能否安全移除。返回 undefined 表示可以删 */
140
- export type WorktreeGuard = (job: AgentJobView) => Promise<string | undefined>;
141
- export interface DeleteJobOptions {
142
- worktreeGuard?: WorktreeGuard;
143
- /**
144
- * 守卫放行后移除会话代管的 worktree(含未提交更改)。
145
- * 抛错表示目录被保留 —— 会话照删,路径途经 keptWorktreePath 报出。
146
- */
147
- removeWorktree?: (worktreePath: string) => Promise<void>;
148
- }
149
- /**
150
- * 删除会话。
151
- *
152
- * 会话与它的 worktree 是绑定的:守卫拒绝(未推送 commit / 他会话占用)时
153
- * 会话也必须留下,否则用户就再也找不到那些提交在哪了(行上会显示
154
- * `not deleted` + 原因)。守卫放行后删会话,再尽力移除代管 worktree;
155
- * 移除失败(如 git 已不认识它)不回滚删除,只报出被保留的路径。
156
- */
157
- export declare function deleteJob(deps: AgentViewActionDeps, job: AgentJobView, options?: DeleteJobOptions | WorktreeGuard): Promise<DeleteJobResult>;
158
- /**
159
- * 重启会话,保留对话。
160
- *
161
- * 靠 `--resume <sessionId>` 让新进程接上原来的 transcript;
162
- * respawnArgs 里的模型/权限/agent 参数原样回放,避免重启后行为漂移。
163
- */
164
- export declare function respawnJob(deps: AgentViewActionDeps, job: AgentJobView): Promise<DispatchResult>;
165
- /** 去掉位置参数,只留 `--flag` 与它们的值 */
166
- export declare function stripPositionalArgs(args: readonly string[]): string[];
167
- export interface SendReplyResult {
168
- /** 已写入收件箱,运行中的会话会消费 */
169
- delivered: boolean;
170
- /** 进程不在,已存为下次启动的首个 prompt */
171
- saved: boolean;
172
- /** 给用户看的提示 */
173
- notice: string;
174
- }
175
- /**
176
- * 把回复送给一个会话。
177
- *
178
- * 进程活着就进收件箱,由会话进程内的 `JobInboxConsumer` 走**逻辑消息通道**
179
- * 送进对话(不是往 PTY 里模拟按键——那会在权限框、AskUserQuestion 之类的
180
- * 对话框上变成误操作)。进程已退出则存成 pending,会话下次启动时补发。
181
- *
182
- * `!` 开头的 Bash 回复两条路都走不了:会话层没有 `!` 这个概念,
183
- * 送过去只会以纯文本抵达,"执行命令"就变成了"说了句话",属于静默错误。
184
- * 所以明确拒绝,并告诉用户去哪儿才能执行。
185
- */
186
- export declare function sendReply(deps: AgentViewActionDeps, job: AgentJobView, reply: {
187
- text: string;
188
- bash?: boolean;
189
- }): Promise<SendReplyResult>;
190
- export interface AttachHandoff {
191
- /** 要执行的 CLI 入口 */
192
- entry: string;
193
- /** 传给入口的参数 */
194
- args: string[];
195
- /** 子进程工作目录 */
196
- cwd: string;
197
- }
198
- /**
199
- * 构造"接管一个会话"的启动参数。
200
- *
201
- * agent view 与后台会话是两个进程,接管的实现是在当前终端里用
202
- * `--resume <sessionId>` 拉起完整交互会话——transcript 已经在盘上,
203
- * 所以对话历史是完整的,不是只看日志。
204
- */
205
- export declare function buildAttachHandoff(job: AgentJobState, entry: string): AttachHandoff;
@@ -1,13 +0,0 @@
1
- export declare class JobReclaimGate {
2
- private active;
3
- private revision;
4
- private draining;
5
- private committed;
6
- enter(): () => void;
7
- prepare(): number | undefined;
8
- isPrepared(revision: number): boolean;
9
- commit(revision: number): boolean;
10
- cancel(revision: number): void;
11
- }
12
- export declare const jobReclaimGate: JobReclaimGate;
13
- export declare function enterJobActivity(): () => void;
@@ -1,3 +0,0 @@
1
- export * from './ask-protoctol';
2
- export * from './ask-service';
3
- export * from './session-ask-user-question-handler';
@@ -1,4 +0,0 @@
1
- export * from './bash-sandbox-protocol';
2
- export * from './bash-sandbox-manager';
3
- export * from './legacy-sandbox-shell-protocol';
4
- export * from './legacy-sandbox-shell-service';
@@ -1,159 +0,0 @@
1
- import { Application, ApplicationLifecycle } from '@celljs/core';
2
- import { type ICwdService } from '@genie/cbc-worktree';
3
- import { ProductManager } from '@genie/product';
4
- /**
5
- * CLI 端的 git commit 监听 + 上报。
6
- *
7
- * 设计要点(对齐 plugin-core 但只做 CLI 必要的部分):
8
- *
9
- * - **多仓**:从 `process.cwd()` 出发发现「全部」git 仓库——
10
- * 既兼容「直接打开仓库(或其子目录)」(沿父链向上找 `.git`),
11
- * 也兼容「打开一个父目录、其下挂多个独立仓库」(向下有限层扫描)。
12
- * 每个仓库各自监听 `.git/logs/HEAD`、各自维护 lastHead、各自上报。
13
- * - 监听 `.git/logs/HEAD`(reflog):覆盖手动 `git commit` / agent Bash 工具
14
- * 发起的 commit / `git commit --amend` / rebase 等所有动 HEAD 的操作。
15
- * - 进程退出前再 flush 一次:CLI 是短命进程,最后一次 commit 完成到 fs.watch
16
- * 回调真正触发之间可能有几十 ms 间隙,由 watcher.flushOnExit() 兜底。
17
- * - lastHead 持久化到 `~/.codebuddy/code-ratio/cli-watcher-lastHead-<hash>`(按 repoRoot 区分):
18
- * CLI 重启后能识别"上次跑完之后又有新 commit"并补上报,避免漏;同时也避免
19
- * 启动瞬间把当前 HEAD 当成新 commit 重复报。
20
- * - feature gate 不在 watcher 里判:`reporter.observeCommit()` 已经做过
21
- * `isCodeAdoptionRateEnabled` 检查,运行时切换开关也能立即生效。
22
- */
23
- export declare class CliGitCommitWatcher implements ApplicationLifecycle<Application> {
24
- protected readonly productManager?: ProductManager;
25
- protected readonly cwdService?: ICwdService;
26
- private logger?;
27
- private readonly repos;
28
- /** feature gate 是否已判定 enabled 并触发过挂载,保证只挂一次(幂等)。 */
29
- private gateResolved;
30
- /** 等待 late-enable 的配置订阅(未启用时挂,enabled 后退订)。 */
31
- private gateSubscription?;
32
- /** cwd 变更订阅(首轮种子值 attach、之后变更重绑)。 */
33
- private cwdChangeSubscription?;
34
- /** 标记是否已完成首轮 attach,区分种子值与后续 cwd 变更。 */
35
- private attachedOnce;
36
- initialize(): void;
37
- /**
38
- * 入库率 feature gate + late-enable 订阅(对齐 plugin-core GitCommitWatcher)。
39
- *
40
- * 仓库发现扫描(readdirSync 递归)、watcher attach、startup 扫描的开销都在
41
- * feature gate 之后才发生——未启用入库率能力时,进程**完全不做**仓库发现,
42
- * 避免预热池默认开启后对错误继承的 home 目录做大量无意义扫描。
43
- *
44
- * ProductManager 未注册(headless / 单测)时保守退回:直接走 cwd 订阅,
45
- * 不阻断原有采集路径。
46
- */
47
- private mountWhenEnabled;
48
- /**
49
- * 订阅 cwd 变更,把 attach 绑到最新 cwd(对齐 ConfigWatchService)。
50
- *
51
- * BehaviorSubject 语义:订阅瞬间即收到「当前 cwd」种子值 → 首轮 attach;
52
- * 之后任何 setCwdState(预热 activate 后 chdir、worktree 切换)都会再次推送
53
- * → 先 dispose 旧 watcher 再按新 cwd 重新 attach。
54
- *
55
- * **预热待机特判**:预热进程容器装配阶段 initialize 时,cwd 还是错误继承的
56
- * home,种子值此刻不能 attach。用 {@link isPrewarmStandby} 判定「仍在待机」
57
- * (argv 含 `--prewarm` 且 PrewarmServer 状态为 idle),是则跳过本次种子值、
58
- * 不置 attachedOnce;等 activate 到达后 dispatcher 的 `setCwdState(cwd, true)`
59
- * 广播(此刻状态已转为 activating,不再判为待机)再走首轮 attach,天然绑定
60
- * 到正确的 workspace cwd。
61
- *
62
- * CwdService 未注册(单测)时退回:直接 attach 一次。
63
- */
64
- private subscribeCwd;
65
- /**
66
- * 是否仍处于预热(prewarm)待机态:argv 含 `--prewarm` 且 PrewarmServer 状态
67
- * 为 `idle`(尚未收到 activate)。
68
- *
69
- * 组合两个条件而非单看其一:
70
- * - 只看 argv:普通冷启动本就无 `--prewarm`,天然不受影响;但预热 activate 后
71
- * dispatcher 在广播 cwd(`setCwdState`)之后才剔除 argv 里的 `--prewarm`,
72
- * 若只看 argv 会把 activate 的首个广播也误判为待机。
73
- * - 只看状态:非预热进程容器里 PrewarmServer 的初始状态也是 `idle`,只看状态
74
- * 会把普通启动误判为待机 → 永不 attach。
75
- * 因此以 argv 圈定「这是预热进程」,再用状态 `idle` 精确圈定「尚未 activate」。
76
- * activate 一到,PrewarmServer 立即置 `activating`(早于 cwd 广播),故广播时
77
- * 本方法返回 false,首轮 attach 正常发生并绑定到正确 cwd。
78
- *
79
- * PrewarmServer 未注册(headless / 单测)时按「非待机」处理,不影响普通路径。
80
- */
81
- private isPrewarmStandby;
82
- /**
83
- * 暴露给 process.ts 的 exit 钩子调用,确保最后一个 commit 不会被丢。
84
- * 永不抛错。
85
- */
86
- flushOnExit(): Promise<void>;
87
- /**
88
- * 让 Bash 工具的 post-exec hook 在跑完 `git commit` 后立即调一下,
89
- * 不必等 reflog 事件。永不抛错。
90
- */
91
- notifyExternalGitCommit(): Promise<void>;
92
- /** 关闭 watcher(测试 / 后续若引入显式 deactivate 时使用)。 */
93
- dispose(): void;
94
- /**
95
- * 关闭并清空所有仓库 watcher/timer,但**不**退订 gate/cwd。
96
- * 供 cwd 变更重绑复用(先 disposeWatchers 再 attachAll),dispose() 也调用它。
97
- */
98
- private disposeWatchers;
99
- private attachAll;
100
- private attachRepo;
101
- private scheduleScan;
102
- /**
103
- * 读 HEAD → 跟 lastHead 比 → 如果是新 commit 就走 `loadCommit` 上报。
104
- *
105
- * 若 HEAD↔lastHead 之间相差多个 commit(比如启动时补差量、rebase 后),
106
- * 用 `git rev-list lastHead..HEAD` 列出来按时间正序逐个上报,每个都加内存
107
- * 去重 + 持久化。失败时不更新 lastHead,下次再尝试。
108
- */
109
- private checkAndReport;
110
- /**
111
- * 计算需要上报的 commit 序列,时间正序。
112
- *
113
- * - lastHead 缺失:只取 HEAD 一个。
114
- * - lastHead 存在但 git rev-list 失败(被 git gc / rebase 抹掉):fallback 也只取 HEAD。
115
- */
116
- private listNewCommits;
117
- /**
118
- * 上报单个 commit。
119
- *
120
- * 返回值语义:
121
- * - `true`:成功上报
122
- * - `false`:明确不可归因(merge、initial、无文件、无 repoUrl 等),可安全跳过
123
- * - `'failed'`:上报失败(网络/内部错误),需要保留游标重试
124
- */
125
- private reportOne;
126
- /** 懒加载并缓存某仓库本地 `git config user.email`(归一化后)。读不到返回空串。 */
127
- private resolveLocalGitEmail;
128
- private trimReportedCache;
129
- }
130
- /**
131
- * 从 `cwd` 发现需要监听的全部 git 仓库根:
132
- *
133
- * 1. 先沿父链向上找:若 `cwd` 本身或其某个祖先是 git 仓库,则视为「打开了仓库
134
- * (或其子目录)」,直接返回该唯一根。
135
- * 2. 否则向下有限层扫描子目录,把每个 git 仓库根收集出来,命中后剪枝不再深入。
136
- *
137
- * 实际扫描逻辑复用 `discoverVcsRoots`(git/svn 通用),这里只注入 git 专属判定。
138
- */
139
- export declare function discoverGitRepos(cwd: string, deps?: GitRepoDiscoveryDeps): string[];
140
- export interface GitRepoDiscoveryDeps {
141
- /** 沿父链向上找仓库根;默认用 `findRepoRootFromCwd`。 */
142
- findUpRoot?: (startPath: string) => string | undefined;
143
- /** 判断某目录是否是 git 仓库根;默认用 `GitInfoExtractor.isGitRepository`。 */
144
- isRepo?: (dir: string) => boolean;
145
- /** 列出某目录下的直接「子目录绝对路径」;默认走 fs.readdirSync。 */
146
- listSubdirectories?: (dir: string) => string[];
147
- /** 向下扫描最大深度。 */
148
- maxDepth?: number;
149
- /** 发现的仓库数量上限。 */
150
- maxRepos?: number;
151
- /** 诊断回调:把扫描过程打到日志。 */
152
- onTrace?: (msg: string) => void;
153
- }
154
- /**
155
- * 从 cwd 起向上找最近的 git 仓库根。复用 GitInfoExtractor 已有的判定,与
156
- * `CwdRepoResolver.findRepoRoot` 行为一致;这里不直接 import 后者,避免
157
- * 把 watcher 的可测试性绑死在带状态的 resolver 上。
158
- */
159
- export declare function findRepoRootFromCwd(startPath: string): string | undefined;