@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,44 +0,0 @@
1
- /** 频道上下文解析(只读免锁):工具与 HTTP 共用「读目录 → 认自己 → 找频道 → 列成员」,只给结构化错误码。 */
2
- import { type AgentHomeChannel, type AgentHomeDirectoryFile, type AgentHomeProfile } from './agent-home-directory';
3
- export type AgentHomeChannelContextError = 'DIRECTORY_UNAVAILABLE' | 'INVALID_ACTOR' | 'CHANNEL_NOT_FOUND' | 'CHANNEL_NEED_ID';
4
- export interface AgentHomeSelfContext {
5
- directory: AgentHomeDirectoryFile;
6
- self: AgentHomeProfile;
7
- }
8
- export type ResolveAgentHomeSelfResult = {
9
- ok: true;
10
- context: AgentHomeSelfContext;
11
- } | {
12
- ok: false;
13
- error: 'DIRECTORY_UNAVAILABLE' | 'INVALID_ACTOR';
14
- };
15
- export interface ResolveAgentHomeChannelContextInput {
16
- homeDir: string;
17
- jobId?: string;
18
- /** 频道 id;不传 = 唯一频道。 */
19
- channelRef?: string;
20
- /** 调用方已读过目录时传入,省一次读盘(必须是同一 homeDir 的最新快照)。 */
21
- directory?: AgentHomeDirectoryFile;
22
- }
23
- export type ResolveAgentHomeChannelContextResult = {
24
- ok: true;
25
- directory: AgentHomeDirectoryFile;
26
- self: AgentHomeProfile;
27
- channel: AgentHomeChannel;
28
- members: AgentHomeProfile[];
29
- /** 自己可见的全部频道(错误提示与「你在哪几个频道」用)。 */
30
- channels: AgentHomeChannel[];
31
- } | {
32
- ok: false;
33
- error: AgentHomeChannelContextError;
34
- channels: AgentHomeChannel[];
35
- };
36
- /** 认自己:没有 job 映射就是默认 Agent;目录读不到 / 认不出都是错误。 */
37
- export declare function resolveAgentHomeSelfContext(input: {
38
- homeDir: string;
39
- jobId?: string;
40
- directory?: AgentHomeDirectoryFile;
41
- }): Promise<ResolveAgentHomeSelfResult>;
42
- export declare function membersOfChannel(directory: AgentHomeDirectoryFile, channel: AgentHomeChannel): AgentHomeProfile[];
43
- /** 认自己 + 在自己可见的频道里找 channelRef。 */
44
- export declare function resolveAgentHomeChannelContext(input: ResolveAgentHomeChannelContextInput): Promise<ResolveAgentHomeChannelContextResult>;
@@ -1,73 +0,0 @@
1
- /**
2
- * 自治建频道 / 拉人:成员解析(id)、配额、lead、provenance、审计。
3
- *
4
- * 成员资格(与组队同一条,见 agent-home-membership):**只有常驻同事能进**。
5
- * 主 Agent 是委托侧的工作现场(随进程生灭、上下文是用户私有的现场),它**建频道、
6
- * 派单、读板、发言**都可以,但**不进成员表**——所以"创建者自动进频道"对主 Agent 不成立,
7
- * lead 也就不能缺省给创建者:缺省给"第一个成员同事"。invite 同上(主 Agent 加不进来)。
8
- */
9
- import { type AgentHomeChannel, type AgentHomeDirectoryFile, type AgentHomeProfile } from './agent-home-directory';
10
- import type { AgentHomeCreateErrorCode } from './agent-home-errors';
11
- type MemberResolution = {
12
- ok: true;
13
- profiles: AgentHomeProfile[];
14
- } | {
15
- ok: false;
16
- error: 'MEMBER_NOT_FOUND';
17
- };
18
- /**
19
- * 成员引用一律是 **id**(对齐上游:`createGroup` / `setGroupMembers` 只吃 memberIds,
20
- * `SendToAgent` 的 target_id 文档原话就是 "not a name")。显示名不是地址——名字只用于
21
- * 正文里的 @ 点名(撞名时同名的人全部叫上,见 agent-home-mentions)。
22
- * `only` 限定候选集(例:任务指派只能落在频道成员里)。
23
- */
24
- export declare function resolveMemberRefs(directory: AgentHomeDirectoryFile, refs: readonly string[], options?: {
25
- only?: ReadonlySet<string>;
26
- }): MemberResolution;
27
- export interface CreateChannelInput {
28
- homeDir: string;
29
- /** 发起者 agentId(工具必有;用户经 HTTP 建频道走 controller,不经过这里)。 */
30
- creatorAgentId: string;
31
- name?: string;
32
- memberRefs: readonly string[];
33
- /** lead 引用(id);缺省 = 创建者。 */
34
- leadRef?: string;
35
- now?: number;
36
- }
37
- export type CreateChannelResult = {
38
- ok: true;
39
- channel: AgentHomeChannel;
40
- members: AgentHomeProfile[];
41
- directory: AgentHomeDirectoryFile;
42
- /** 同一批人的频道已存在,直接复用了它(没有新建)。 */
43
- reused?: boolean;
44
- } | {
45
- ok: false;
46
- error: AgentHomeCreateErrorCode;
47
- };
48
- /**
49
- * trim + 去重(保序)。成员名单 / @ 名单 / mention 列表都从它走——
50
- * 原先 speech 与 HTTP 各写一份,空串与重复的边界容易只在一侧处理。
51
- */
52
- export declare function uniqueTrimmed(ids: readonly string[]): string[];
53
- /** 成员集合是否相同(顺序无关;上游 isSameMemberSet)。HTTP 侧复用同一份。 */
54
- export declare function isSameMemberSet(a: readonly string[], b: readonly string[]): boolean;
55
- export declare function createAgentHomeChannel(input: CreateChannelInput): Promise<CreateChannelResult>;
56
- export interface InviteToChannelInput {
57
- homeDir: string;
58
- channelId: string;
59
- actorAgentId: string;
60
- memberRefs: readonly string[];
61
- now?: number;
62
- }
63
- export type InviteToChannelResult = {
64
- ok: true;
65
- channel: AgentHomeChannel;
66
- added: AgentHomeProfile[];
67
- directory: AgentHomeDirectoryFile;
68
- } | {
69
- ok: false;
70
- error: AgentHomeCreateErrorCode;
71
- };
72
- export declare function inviteAgentHomeChannelMembers(input: InviteToChannelInput): Promise<InviteToChannelResult>;
73
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * 频道 jsonl 落盘后的进程内通知。
3
- * SSE 不能只靠 macOS fs.watch:append 经常丢,客户端还要等切走才重新 GET。
4
- */
5
- type ChannelChangedListener = (channelId: string) => void;
6
- export declare function notifyAgentHomeChannelChanged(channelId: string): void;
7
- export declare function onAgentHomeChannelChanged(listener: ChannelChangedListener): () => void;
8
- export {};
@@ -1,30 +0,0 @@
1
- /**
2
- * 频道寻址:id 分配 / 查找 / 默认命名。
3
- *
4
- * 从 agent-home-directory 拆出。规则对齐上游(group 只按 id 找,`ListGroups` 给的就是 id):
5
- * **找频道只认 id**;名字只是给人看的标签(重名允许,默认名顺手避开「群聊」纯粹为了侧栏好认)。
6
- * 本模块 → directory 只 import type。
7
- */
8
- import type { AgentHomeChannel, AgentHomeDirectoryFile } from './agent-home-directory';
9
- /** 人 / 房 / 频道共用的 id 集合,分配频道 id 时避开,避免串台。 */
10
- export declare function takenHomeIds(directory: AgentHomeDirectoryFile): Set<string>;
11
- /** 新频道的主键。UUID,且不与已有人/房/频道 id 碰撞。 */
12
- export declare function allocateUniqueChannelId(directory: AgentHomeDirectoryFile): string;
13
- export type ChannelLookup = {
14
- status: 'ok';
15
- channel: AgentHomeChannel;
16
- } | {
17
- status: 'missing';
18
- } | {
19
- status: 'need-id';
20
- };
21
- /**
22
- * 频道查找:只认 id(对齐上游:group 按 id 寻址)。
23
- * 没传 needle 且只有一间 → 那一间;多间 → need-id(让调用方去 ListColleagues 抄 id)。
24
- */
25
- export declare function lookupChannel(channels: readonly AgentHomeChannel[], wanted?: string): ChannelLookup;
26
- export declare function formatChannelChoice(channels: readonly AgentHomeChannel[]): string;
27
- /** 没起名时的标签。不是主键;重名允许,新建默认避开已有「群聊」纯粹为了列表好认。 */
28
- export declare function nextDefaultChannelName(existing: readonly {
29
- name: string;
30
- }[]): string;
@@ -1,72 +0,0 @@
1
- /**
2
- * 频道发言落盘:jsonl append + directory lastPreview/unread。
3
- * POST /channels/:id/messages 和 SpeakInChannel 共用。写 directory 必须带锁。
4
- */
5
- import { type ChannelAttachment } from './agent-home-attachments';
6
- import { type AgentHomeChannel, type AgentHomeChannelMessage, type AgentHomeDirectoryFile } from './agent-home-directory';
7
- export interface ApplyChannelSpeechInput {
8
- homeDir: string;
9
- channelId: string;
10
- text: string;
11
- from: 'user' | 'agent';
12
- agentId?: string;
13
- /** 锁内再 resolve 一次,避免解锁读到的 self 已过期。 */
14
- jobId?: string;
15
- mentionAgentIds?: readonly string[];
16
- messageId?: string;
17
- /**
18
- * 显式开一轮房间轮次(对齐上游的「用户发言开一轮」)。
19
- * 用户发言自动算;CreateChannel 的 kickoff 用这个标记显式开一轮。
20
- */
21
- startRoomTurn?: boolean;
22
- /**
23
- * 引用某条消息(对齐上游 SendMessage 的 reply_to):
24
- * 房间历史里的短地址(#xxxxxxxx)或消息 id,前缀唯一即可。
25
- */
26
- replyTo?: string;
27
- /**
28
- * 附件(对齐上游 SendMessage 的 type:attachment):本地文件路径。
29
- * 会复制进频道附件目录(内容寻址),房间据此长期可见。
30
- */
31
- attachments?: readonly string[];
32
- /**
33
- * 选项卡卡片(对齐上游 type:widget)。给了它就把这条消息发成卡片:
34
- * 正文用 prompt,且**本轮发言到此为止**——等用户点选(点选会作为
35
- * 用户发言开新一轮)。
36
- */
37
- widget?: unknown;
38
- }
39
- /** 附件收了之后的账:收进来的 + 没收成的(原因逐条转告模型)。 */
40
- interface IngestedAttachments {
41
- attachments: ChannelAttachment[];
42
- issues: string[];
43
- }
44
- export type ApplyChannelSpeechResult = {
45
- ok: true;
46
- message: AgentHomeChannelMessage;
47
- channel: AgentHomeChannel;
48
- directory: AgentHomeDirectoryFile;
49
- /** 这次发言是否推进/开启了房间轮次(false = 没推进:插话/发卡片/不在编排里)。 */
50
- advancedTurn: boolean;
51
- /** 给了 replyTo 但地址解析不到(已按普通消息落盘,调用方可以提醒模型)。 */
52
- replyToDropped?: boolean;
53
- /** 附件没收进来的原因(超限/读不到/不是文件),逐条转告模型。 */
54
- attachmentIssues?: string[];
55
- /** 卡片不合法(没有正确落盘),原因原样转告模型。 */
56
- widgetIssue?: string;
57
- } | {
58
- ok: false;
59
- error: 'CHANNEL_NOT_FOUND' | 'INVALID_SPEAKER' | 'DIRECTORY_UNAVAILABLE' | 'INVALID_WIDGET' | 'EMPTY_TEXT';
60
- /** INVALID_WIDGET 时给出人话原因,工具会原样转告模型。 */
61
- reason?: string;
62
- };
63
- export declare function applyChannelSpeech(input: ApplyChannelSpeechInput): Promise<ApplyChannelSpeechResult>;
64
- /**
65
- * 调用方已持有 withAgentHomeDirectoryLock。
66
- * `preIngested`:锁外已经收好的附件(见 applyChannelSpeech);不传则锁内现收
67
- * (已持锁的调用方——用户 HTTP 路径不带附件,走不到这条)。
68
- */
69
- export declare function applyChannelSpeechToDirectory(directory: AgentHomeDirectoryFile, input: ApplyChannelSpeechInput, options?: {
70
- preIngested?: IngestedAttachments;
71
- }): Promise<ApplyChannelSpeechResult>;
72
- export {};
@@ -1,45 +0,0 @@
1
- /**
2
- * 频道任务板的组合层:锁 → 读板 → 纯函数 mutate → 写板 → transcript 投影 → 算唤醒目标。
3
- *
4
- * 纪律:
5
- * - 板写必须在 withAgentHomeDirectoryLock 内;
6
- * - transcript 是投影不是真理:事件行写失败不回滚板;
7
- * - 唤醒永远在锁外(本模块只返回 wakeAgentIds / wakeText,调用方解锁后再叫)。
8
- */
9
- import { type AgentHomeChannelTask, type AgentHomeChannelTaskActor, type AgentHomeChannelTaskBoard, type ChannelTaskAction, type ChannelTaskEvent } from './agent-home-channel-tasks';
10
- import { type AgentHomeChannel, type AgentHomeDirectoryFile } from './agent-home-directory';
11
- import type { ChannelTaskErrorCode } from './agent-home-errors';
12
- export interface ApplyChannelTaskInput {
13
- homeDir: string;
14
- channelId: string;
15
- actor: AgentHomeChannelTaskActor;
16
- action: ChannelTaskAction;
17
- now?: number;
18
- }
19
- export type ApplyChannelTaskResult = {
20
- ok: true;
21
- tasks: AgentHomeChannelTask[];
22
- events: ChannelTaskEvent[];
23
- /** 板已扣预算的唤醒目标(解锁后由调用方叫)。 */
24
- wakeAgentIds: string[];
25
- /** 给被叫醒的人看的一行摘要。 */
26
- wakeText: string;
27
- directory: AgentHomeDirectoryFile;
28
- channel: AgentHomeChannel;
29
- } | {
30
- ok: false;
31
- error: ChannelTaskErrorCode;
32
- };
33
- /** 免锁读板 + 频道(GET / SSE 语义)。 */
34
- export declare function readChannelTaskBoard(input: {
35
- homeDir: string;
36
- channelId: string;
37
- }): Promise<{
38
- ok: true;
39
- board: AgentHomeChannelTaskBoard;
40
- channel: AgentHomeChannel;
41
- } | {
42
- ok: false;
43
- error: ChannelTaskErrorCode;
44
- }>;
45
- export declare function applyChannelTaskEvent(input: ApplyChannelTaskInput): Promise<ApplyChannelTaskResult>;
@@ -1,25 +0,0 @@
1
- /**
2
- * 任务板的**分组色调 + 组内顺序**:node 域与 web-ui 共用这一份。
3
- *
4
- * 两侧各写一份曾经漂过:done 组一边按 doneAt 排、一边按 updatedAt 排,而拖拽重排的
5
- * 目标位次是前端按自己那份算、服务端按自己那份算的(两份必须逐字一致才成立)。
6
- *
7
- * 零 import:它会被 web-ui 直接引用(见 agent-home-web-ui-shared-imports.spec.ts),
8
- * 别在这里引 node 侧模块。
9
- */
10
- /** 排序只关心这几个字段;node 的 AgentHomeChannelTask 与 web-ui 的 DTO 都结构化兼容。 */
11
- export interface ChannelTaskOrderFields {
12
- status: 'open' | 'claimed' | 'done';
13
- stalled?: boolean;
14
- sortIndex?: number;
15
- updatedAt: number;
16
- doneAt?: number;
17
- }
18
- export type ChannelTaskTone = 'stalled' | 'claimed' | 'open' | 'done';
19
- export declare function channelTaskTone(task: ChannelTaskOrderFields): ChannelTaskTone;
20
- /**
21
- * 组内顺序:手工顺序(`sortIndex` 升序)在前,没设过的按最近活动倒序跟在后面
22
- * (已完成的看完成时间,其余看更新时间)。
23
- * 新任务建的时候会拿到一个比全板都小的 `sortIndex`,于是落在自己那组的顶上。
24
- */
25
- export declare function compareChannelTasks(a: ChannelTaskOrderFields, b: ChannelTaskOrderFields): number;
@@ -1,156 +0,0 @@
1
- /**
2
- * 频道任务板(黑板):类型 + 落盘 IO + 纯函数 mutateBoard(领域层,无文案/HTTP/唤醒)。
3
- * 单写者纪律是产品语义:claim 走 CAS、只有 owner 能 complete/release、done 不可变、
4
- * 唤醒预算按「任务 × 人」计(超限标 stalled 停叫)。
5
- */
6
- import type { AgentHomeChannelTaskEventPayload } from './agent-home-channel-task-event';
7
- import type { ChannelTaskErrorCode } from './agent-home-errors';
8
- export { channelTaskTone, compareChannelTasks } from './agent-home-channel-task-order';
9
- export type AgentHomeChannelTaskStatus = 'open' | 'claimed' | 'done';
10
- export interface AgentHomeChannelTaskRef {
11
- kind: 'issue' | 'file' | 'pr' | 'commit' | 'url';
12
- value: string;
13
- }
14
- /** kind 的运行时白名单(类型只管编译期;盘上手改/旧数据可能是任意串)。HTTP 与 domain 共用这一份。 */
15
- export declare const TASK_REF_KINDS: ReadonlySet<string>;
16
- export interface AgentHomeChannelTask {
17
- id: string;
18
- subject: string;
19
- detail?: string;
20
- status: AgentHomeChannelTaskStatus;
21
- ownerId?: string;
22
- /** dispatch 指定的接收人:只有本人能 claim。 */
23
- assigneeId?: string;
24
- refs?: AgentHomeChannelTaskRef[];
25
- /**
26
- * 手工顺序(拖拽排序)。只在**同一个色调分组内**比较:小的在前;
27
- * 没设过的手工顺序(老数据 / 新任务的旧写法)排在最后,按 updatedAt 倒序。
28
- */
29
- sortIndex?: number;
30
- /** create / dispatch 的幂等键。 */
31
- requestId?: string;
32
- createdBy: 'user' | 'agent';
33
- creatorAgentId?: string;
34
- /** 每人对本任务的自动唤醒次数(只增不减)。 */
35
- wakeCounts?: Record<string, number>;
36
- stalled?: boolean;
37
- stalledReason?: 'wake_budget';
38
- createdAt: number;
39
- updatedAt: number;
40
- doneAt?: number;
41
- }
42
- export interface AgentHomeChannelTaskBoard {
43
- version: 1;
44
- tasks: AgentHomeChannelTask[];
45
- /**
46
- * 下一个要发的任务号。删了任务也要往上走——id 复用会让时间线里的 t3
47
- * 前后指的不是同一条活(历史是 append-only 的,不能重编号)。
48
- */
49
- nextTaskId?: number;
50
- }
51
- /** 任务板文件:channels/<id>.tasks.json。文件名 = channel.id,不是显示名。 */
52
- export declare function agentHomeChannelTasksPath(homeDir: string, channelId: string): string;
53
- export declare const EMPTY_CHANNEL_TASK_BOARD: AgentHomeChannelTaskBoard;
54
- export declare function parseAgentHomeChannelTaskBoard(raw: string): AgentHomeChannelTaskBoard;
55
- /** 免锁读(GET / 看板快照语义)。缺文件 / 坏文件都当空板。 */
56
- export declare function readAgentHomeChannelTasksSync(homeDir: string, channelId: string): AgentHomeChannelTaskBoard;
57
- /** 锁内写:tmp + rename,避免半截 JSON。 */
58
- export declare function writeAgentHomeChannelTasks(homeDir: string, channelId: string, board: AgentHomeChannelTaskBoard): Promise<void>;
59
- export type AgentHomeChannelTaskActor = {
60
- kind: 'agent';
61
- agentId: string;
62
- isLead: boolean;
63
- } | {
64
- kind: 'user';
65
- };
66
- export type ChannelTaskEventType = 'created' | 'claimed' | 'completed' | 'released' | 'dispatched' | 'nudged' | 'escalated' | 'stalled'
67
- /** 板上最后一项也完成了:这一批结束了,该有人回报委托人(lead 的活)。 */
68
- | 'batch_done'
69
- /** 改了任务本身(标题 / 细节 / 指派 / 引用):编排与用户都能纠错。 */
70
- | 'updated'
71
- /** 从板上撤掉一条(历史行留在时间线里,这一行记谁撤的)。 */
72
- | 'deleted';
73
- /**
74
- * 结构化事件:文案由 copy 层生成,这里只给数据。
75
- * 形状与落盘记录 / web-ui 共用 `agent-home-channel-task-event`(那份是 SSOT)。
76
- */
77
- export type ChannelTaskEvent = AgentHomeChannelTaskEventPayload & {
78
- type: ChannelTaskEventType;
79
- };
80
- export type ChannelTaskAction = {
81
- type: 'create';
82
- subject: string;
83
- detail?: string;
84
- assignAgentId?: string;
85
- refs?: AgentHomeChannelTaskRef[];
86
- requestId?: string;
87
- } | {
88
- type: 'claim';
89
- taskId: string;
90
- } | {
91
- type: 'update';
92
- taskId: string;
93
- /** 只传要改的字段;`null` 表示清空(细节 / 取消指派 / 清空引用),不传表示不动。 */
94
- subject?: string;
95
- detail?: string | null;
96
- assignAgentId?: string | null;
97
- /** 整表替换(UI 的加/删引用都在客户端算好整份传上来)。 */
98
- refs?: AgentHomeChannelTaskRef[] | null;
99
- } | {
100
- type: 'delete';
101
- taskId: string;
102
- }
103
- /** 同组内重排:`toIndex` 是这一组(停滞 / 进行中 / 待认领 / 已完成)里的目标位次。 */
104
- | {
105
- type: 'move';
106
- taskId: string;
107
- toIndex: number;
108
- } | {
109
- type: 'complete';
110
- taskId: string;
111
- refs?: AgentHomeChannelTaskRef[];
112
- } | {
113
- type: 'release';
114
- taskId: string;
115
- } | {
116
- type: 'dispatch';
117
- items: {
118
- subject: string;
119
- detail?: string;
120
- assignAgentId: string;
121
- refs?: AgentHomeChannelTaskRef[];
122
- }[];
123
- requestId?: string;
124
- } | {
125
- type: 'escalate';
126
- mode: 'nudge' | 'release';
127
- taskIds?: string[];
128
- maxStaleMs?: number;
129
- };
130
- export interface ChannelTaskMutationInput {
131
- board: AgentHomeChannelTaskBoard;
132
- actor: AgentHomeChannelTaskActor;
133
- action: ChannelTaskAction;
134
- now: number;
135
- /** 频道 lead(agentId);缺省 = user-as-lead。竞态外的唤醒目标用。 */
136
- leadAgentId?: string;
137
- /** 单板任务上限,默认 MAX_TASKS_PER_CHANNEL(测试可覆盖)。 */
138
- maxTasks?: number;
139
- /** 唤醒预算,默认 MAX_WAKE_PER_TASK_PER_AGENT(测试可覆盖)。 */
140
- wakeBudget?: number;
141
- }
142
- export interface ChannelTaskMutationSuccess {
143
- ok: true;
144
- board: AgentHomeChannelTaskBoard;
145
- events: ChannelTaskEvent[];
146
- /** 需要叫醒的人(已扣预算;预算耗尽的人不在内,任务已标 stalled)。 */
147
- wakeAgentIds: string[];
148
- /** 本次操作直接涉及的任务(工具返回值用)。 */
149
- tasks: AgentHomeChannelTask[];
150
- }
151
- export type ChannelTaskMutationResult = ChannelTaskMutationSuccess | {
152
- ok: false;
153
- error: ChannelTaskErrorCode;
154
- };
155
- export declare function normalizeTaskSubject(subject: string): string;
156
- export declare function mutateChannelTaskBoard(input: ChannelTaskMutationInput): ChannelTaskMutationResult;
@@ -1,35 +0,0 @@
1
- export interface ChannelWakeGuard {
2
- /** 去重桶:有 room turn 时 = 轮次号;没有时 = 时间窗序号。 */
3
- bucket: string;
4
- /** 该桶里已经被自动叫过的人。 */
5
- wokenIds: string[];
6
- /** 窗口内的自动唤醒时间戳(超过上限就抑制)。 */
7
- autoWakes: number[];
8
- }
9
- /** 护栏文件:channels/<id>.wake.json。文件名 = channel.id,不是显示名。 */
10
- export declare function agentHomeChannelWakeGuardPath(homeDir: string, channelId: string): string;
11
- /** 读护栏(容错:缺失 / 坏 JSON / 字段类型不对一律当空,绝不因为护栏挡住唤醒)。 */
12
- export declare function readChannelWakeGuard(homeDir: string, channelId: string): ChannelWakeGuard;
13
- /**
14
- * 预约这一棒能叫谁。
15
- * - `bucket` 变了(新一轮 / 新窗口)→ 已叫名单清空;
16
- * - 窗口内自动唤醒次数达上限 → 一个都不叫(`suppressed: 'rate'`);
17
- * - 同一桶里已经叫过的人 → 去重(进 `deduped`)。
18
- */
19
- export declare function reserveAutoWakes(input: {
20
- homeDir: string;
21
- channelId: string;
22
- bucket: string;
23
- now: number;
24
- targets: readonly string[];
25
- }): Promise<{
26
- allowed: string[];
27
- deduped: string[];
28
- suppressed: 'rate' | undefined;
29
- }>;
30
- /**
31
- * 去重桶键:
32
- * - 有进行中的轮次 → 用轮次号(**同一轮不重复叫同一个人**);
33
- * - 没有轮次(成员插话)→ 用时间窗序号(窗口内同样不重复叫人)。
34
- */
35
- export declare function channelWakeBucket(channelId: string, round: number | undefined, now: number): string;
@@ -1,102 +0,0 @@
1
- /** 落盘后叫醒频道成员。用户发言全员;同事发言只叫 @。 */
2
- import type { IDaemonProcessManager } from '@genie/cbc-daemon';
3
- import type { IJobStore } from '../agent-view/agent-view-protocol';
4
- import { type AgentHomeChannel, type AgentHomeChannelMessage, type AgentHomeDirectoryFile } from './agent-home-directory';
5
- /** 唤醒被跳过时给审计的原因(写进 audit.jsonl 的 wake_skipped)。 */
6
- export type ChannelWakeSkipReason = 'no-job' | 'error' | 'user-stopped' | 'dead' | 'flood' | 'deferred';
7
- /** 落盘成功后的叫醒出口:HTTP 回车和 SpeakInChannel 共用。 */
8
- export declare function wakeAfterChannelSpeech(input: {
9
- directory: AgentHomeDirectoryFile;
10
- channel: AgentHomeChannel;
11
- message: AgentHomeChannelMessage;
12
- /** speech 侧的结果:这次发言有没有推进轮次。false = 别叫人(待发言的人早就叫过了)。 */
13
- advancedTurn?: boolean;
14
- homeDir: string;
15
- store: IJobStore;
16
- processManager?: IDaemonProcessManager;
17
- canRespawn?: boolean;
18
- reloadDirectory?: () => Promise<AgentHomeDirectoryFile | undefined>;
19
- onSkip?: (agentId: string, reason: ChannelWakeSkipReason) => void;
20
- onDelivered?: (agentId: string) => void;
21
- log?: (message: string) => void;
22
- }): Promise<void>;
23
- export declare function wakeChannelMembers(input: {
24
- directory: AgentHomeDirectoryFile;
25
- channel: AgentHomeChannel;
26
- text: string;
27
- /** 说话人:user 或成员 agentId。 */
28
- from?: string;
29
- mentionNames?: string[];
30
- messageId?: string;
31
- /** 这条发言带的附件:信封会带绝对路径(只给名字同事读不到,会去磁盘翻同名旧图)。 */
32
- attachments?: readonly {
33
- name: string;
34
- file: string;
35
- }[];
36
- /** 轮转标记(如 "3/10"):这封是轮到你发言,不是被 @。 */
37
- round?: string;
38
- homeDir: string;
39
- store: IJobStore;
40
- processManager?: IDaemonProcessManager;
41
- /** 拉起接缝:默认走 respawnColleagueJob + processManager;单测注入假实现。 */
42
- respawn?: (jobId: string, options?: {
43
- resumeStopped?: boolean;
44
- }) => Promise<boolean>;
45
- /** 默认 true。job worker 里应 false,只写信 + wake 票,避免双 fork。 */
46
- canRespawn?: boolean;
47
- /**
48
- * 对方进程已死(被 reaper 回收,pid 没了)时**干脆不投**——默认 false(交给
49
- * respawn 拉起来)。只有「成员之间依次发言」这一条路传 true:那一棒不负责拉人,
50
- * 死人的信留在频道里,等用户发言 / 派单 / 看门狗走 respawn 那条路再拉。
51
- * 不能拿 `from` 代替——派单(from = 主 Agent id)与看门狗(from = 'system')
52
- * 都必须能把回收掉的同事拉起来,否则工具会返回"已派给 N 人"而实际谁也没收到。
53
- */
54
- skipIfDead?: boolean;
55
- /** 没开过 1:1 时按招人同一条路起 job,写上 primaryJobId。不要把 channel.id 写进 jobAssignments。 */
56
- ensureJob?: (agentId: string) => Promise<string | undefined>;
57
- onSkip?: (agentId: string, reason: ChannelWakeSkipReason) => void;
58
- /** 投递成功回调:信已经进对方的 job 收件箱。 */
59
- onDelivered?: (agentId: string) => void;
60
- /** 说话人自己不要再吃一封自己的入站。 */
61
- excludeAgentId?: string;
62
- /**
63
- * 只叫醒这些成员(仍会去掉 exclude)。
64
- * 不传 = 全员。传 [] = 谁也不叫(同事没 @ 任何人)。
65
- */
66
- onlyAgentIds?: readonly string[];
67
- /**
68
- * 这条消息里**用户真正 @ 到的人**(与 onlyAgentIds 不是一回事:用户发言开一轮时
69
- * 只叫指针第一位,但那位不一定是被 @ 的)。
70
- * 只用来判"要不要把被用户终止过的同事重新拉起"。不传 = 退回 onlyAgentIds(工具侧
71
- * 的定向叫醒本来就只有这一份名单)。
72
- */
73
- mentionedAgentIds?: readonly string[];
74
- /** 每人投递前再读一次目录,避免解锁后 primary 被改派。 */
75
- reloadDirectory?: () => Promise<AgentHomeDirectoryFile | undefined>;
76
- /**
77
- * 这是不是**自动链**(成员发言触发的那一棒):是则过互叫护栏(同轮去重 + 窗口限速)。
78
- * 用户发言 / @ 点名 / 派单不传,不受限。
79
- */
80
- autoWake?: boolean;
81
- }): Promise<void>;
82
- /** 叫醒计划:叫谁(已按叫醒池过滤)+ 这封要不要带轮次标记。 */
83
- export interface ChannelWakePlan {
84
- targets: string[];
85
- /** 轮次标记(如 "1/3 · 2/10")。没有进行中的轮次、或这次发言没推进轮次时不带。 */
86
- round?: string;
87
- }
88
- /**
89
- * 叫醒判定 —— **唯一一份**。HTTP 回执(要回 wokeAgentIds)与投递
90
- * (wakeAfterChannelSpeech)都调它;两边输入相同,结论就相同,不存在"两处要保持一致"。
91
- */
92
- export declare function planChannelWake(input: {
93
- directory: AgentHomeDirectoryFile;
94
- channel: AgentHomeChannel;
95
- /** 说话人:'user' 或成员 agentId。 */
96
- from?: string;
97
- mentionAgentIds?: readonly string[];
98
- /** speech 侧结果:这次发言有没有推进/开启轮次。false = 待发言的人早叫过了,别重复叫。 */
99
- advancedTurn?: boolean;
100
- /** 说话人自己不吃自己的入站。 */
101
- excludeAgentId?: string;
102
- }): ChannelWakePlan;
@@ -1,37 +0,0 @@
1
- /**
2
- * 同事的 job:还没开口的同事怎么被拉起来(招人 / 叫醒两处共用)。
3
- *
4
- * 从 agent-home-channel-wake 挪出来——唤醒模块只该负责「叫谁、怎么投递」,
5
- * 不该顺带管"给一个人起 job、写 primaryJobId"。这里只做创建侧的事:
6
- * 锁内规划 → 锁外 spawn → 锁内认领(拿不到就回收刚起的 job)。
7
- *
8
- * 不要写 channel.id 进 jobAssignments;默认 Agent / 极简不走这里。
9
- */
10
- import { type AgentViewActionDeps } from '../agent-view/agent-view-actions';
11
- import type { IJobStore } from '../agent-view/agent-view-protocol';
12
- import { type AgentHomeDirectoryFile, type AgentHomeProfile } from './agent-home-directory';
13
- /**
14
- * 「现在能不能给这个人起 job」的唯一判据(规划阶段与锁外 spawn 后的认领阶段共用)。
15
- *
16
- * 认领阶段要再问一次,是因为锁外 spawn 期间目录可能已经变了(别人先给他起了 job /
17
- * 他被删了 / 被改成极简)。两处必须同一组条件,否则会出现"规划说能起、认领说不行"
18
- * 的错配——那正是回收分支存在的原因。
19
- */
20
- type ColleagueJobVerdict = {
21
- kind: 'spawn';
22
- profile: AgentHomeProfile;
23
- } | {
24
- kind: 'existing';
25
- id: string;
26
- } | {
27
- kind: 'blocked';
28
- };
29
- export declare function planColleagueJob(directory: AgentHomeDirectoryFile | undefined, agentId: string): ColleagueJobVerdict;
30
- export declare function ensureAgentHomeColleagueJob(input: {
31
- homeDir: string;
32
- agentId: string;
33
- store: IJobStore;
34
- processManager: AgentViewActionDeps['processManager'];
35
- logDir?: string;
36
- }): Promise<string | undefined>;
37
- export {};