@tencent-ai/agent-harness 0.2.0-beta.1 → 0.2.0-beta.3

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 (226) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/cli/CHANGELOG.md +135 -0
  4. package/cli/dist-server/shared.cjs +455 -387
  5. package/cli/dist-server/types/node/acp/acp-protocol.d.ts +40 -12
  6. package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +21 -0
  7. package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-protocol.d.ts +3 -0
  8. package/cli/dist-server/types/node/cli/cli-protocol.d.ts +3 -0
  9. package/cli/dist-server/types/node/cli/stream-json-protocol.d.ts +23 -2
  10. package/cli/dist-server/types/node/data-fs/index.d.ts +13 -1
  11. package/cli/dist-server/types/node/hooks/hook-protocol.d.ts +2 -2
  12. package/cli/dist-server/types/node/sensitive-content/sensitive-content-protocol.d.ts +7 -0
  13. package/cli/dist-server/types/node/server/boot.d.ts +7 -4
  14. package/{lib/components → cli/dist-server/types/node/server/formats}/acp/acp-error-model.d.ts +1 -1
  15. package/{lib/components → cli/dist-server/types/node/server/formats}/acp/acp-protocol.d.ts +2 -3
  16. package/cli/dist-server/types/node/server/formats/acp/index.d.ts +12 -0
  17. package/cli/dist-server/types/node/server/formats/acp/projection.d.ts +10 -0
  18. package/cli/dist-server/types/node/server/index.d.ts +1 -1
  19. package/cli/dist-server/types/node/server/sessions.d.ts +27 -2
  20. package/cli/dist-server/types/node/server/types.d.ts +65 -7
  21. package/cli/dist-server/types/node/settings/settings-protocol.d.ts +5 -0
  22. package/cli/dist-server/types/node/tools/tool-protocol.d.ts +128 -4
  23. package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-protocol.d.ts +60 -2
  24. package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-purpose-protocol.d.ts +8 -4
  25. package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-purpose-scope.d.ts +46 -0
  26. package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-service.d.ts +28 -3
  27. package/cli/dist-server/types/vendor/cbc-core/node/agent/index.d.ts +4 -0
  28. package/cli/dist-server/types/vendor/cbc-core/node/agent/interceptors/input-interceptors.d.ts +1 -6
  29. package/cli/dist-server/types/vendor/cbc-core/node/agent/model-call-failure.d.ts +9 -0
  30. package/cli/dist-server/types/vendor/cbc-core/node/agent/model-step-sequence.d.ts +11 -0
  31. package/cli/dist-server/types/vendor/cbc-core/node/agent/runner-factory.d.ts +56 -20
  32. package/cli/dist-server/types/vendor/cbc-core/node/agent/speaker-label.d.ts +44 -0
  33. package/cli/dist-server/types/vendor/cbc-core/node/agent/tool-call-loop-detector-service.d.ts +5 -4
  34. package/cli/dist-server/types/vendor/cbc-core/node/agent/tool-call-loop-guard-protocol.d.ts +1 -1
  35. package/cli/dist-server/types/vendor/cbc-core/node/agent/tool-call-loop-pattern.d.ts +16 -4
  36. package/cli/dist-server/types/vendor/cbc-core/node/context/compaction-lineage.d.ts +39 -0
  37. package/cli/dist-server/types/vendor/cbc-core/node/context/context-compact-summarizer.d.ts +2 -0
  38. package/cli/dist-server/types/vendor/cbc-core/node/context/context-protocol.d.ts +17 -0
  39. package/cli/dist-server/types/vendor/cbc-core/node/context/index.d.ts +1 -0
  40. package/cli/dist-server/types/vendor/cbc-core/node/context/pre-message-compact-strategy.d.ts +1 -2
  41. package/cli/dist-server/types/vendor/cbc-core/node/hooks/agent-trigger.d.ts +6 -22
  42. package/cli/dist-server/types/vendor/cbc-core/node/hooks/hook-protocol.d.ts +4 -1
  43. package/cli/dist-server/types/vendor/cbc-core/node/session/idle-queue-drain-service.d.ts +4 -56
  44. package/cli/dist-server/types/vendor/cbc-core/node/session/index.d.ts +4 -0
  45. package/cli/dist-server/types/vendor/cbc-core/node/session/interruption-service.d.ts +63 -9
  46. package/cli/dist-server/types/vendor/cbc-core/node/session/model-request-retry-phase.d.ts +16 -0
  47. package/cli/dist-server/types/vendor/cbc-core/node/session/model-response-interceptors.d.ts +33 -0
  48. package/cli/dist-server/types/vendor/cbc-core/node/session/recovery-budget.d.ts +55 -0
  49. package/cli/dist-server/types/vendor/cbc-core/node/session/session-hook-manager.d.ts +15 -0
  50. package/cli/dist-server/types/vendor/cbc-core/node/session/session-manager-host-protocol.d.ts +3 -2
  51. package/cli/dist-server/types/vendor/cbc-core/node/session/session-manager.d.ts +17 -4
  52. package/cli/dist-server/types/vendor/cbc-core/node/session/session-persistence-error.d.ts +43 -0
  53. package/cli/dist-server/types/vendor/cbc-core/node/session/session-protocol.d.ts +110 -9
  54. package/cli/dist-server/types/vendor/cbc-core/node/session/session-run-state-machine-protocol.d.ts +15 -1
  55. package/cli/dist-server/types/vendor/cbc-core/node/session/session-runtime-lifecycle.d.ts +5 -0
  56. package/cli/dist-server/types/vendor/cbc-core/node/session/session-store.d.ts +150 -4
  57. package/cli/dist-server/types/vendor/cbc-core/node/session/stream-timeout-retry-budget.d.ts +20 -1
  58. package/cli/dist-server/types/vendor/cbc-core/node/trace/turn-context.d.ts +28 -1
  59. package/cli/dist-server/types/vendor/cbc-core/node/utils/command-message-utils.d.ts +20 -0
  60. package/cli/dist-server/types/vendor/cbc-core/node/utils/history-utils.d.ts +27 -4
  61. package/cli/dist-server/types/vendor/cbc-core/node/utils/index.d.ts +1 -0
  62. package/cli/dist-server/types/vendor/cbc-core/node/utils/input-item-utils.d.ts +8 -0
  63. package/cli/dist-server/types/vendor/cbc-core/node/utils/message-utils.d.ts +12 -0
  64. package/cli/dist-server/types/vendor/cbc-core/node/utils/model-utils.d.ts +7 -0
  65. package/cli/dist-server/types/vendor/cbc-core/node/utils/queue-dispatch-utils.d.ts +24 -2
  66. package/cli/dist-server/types/vendor/cbc-core/node/utils/session-utils.d.ts +4 -1
  67. package/cli/dist-server/types/vendor/cbc-core/node/utils/string-retention-utils.d.ts +4 -0
  68. package/cli/dist-server/types/vendor/cbc-core/node/utils/token-utils.d.ts +3 -1
  69. package/cli/dist-server/types/vendor/cbc-shared/node/agent/openai-agents-types.d.ts +1 -0
  70. package/cli/dist-server/types/vendor/cbc-shared/node/checkpoint/checkpoint-types.d.ts +6 -0
  71. package/cli/dist-server/types/vendor/cbc-shared/node/hooks/hook-types.d.ts +7 -1
  72. package/cli/dist-server/types/vendor/cbc-shared/node/index.d.ts +2 -0
  73. package/cli/dist-server/types/vendor/cbc-shared/node/model/model-errors.d.ts +36 -4
  74. package/cli/dist-server/types/vendor/cbc-shared/node/tools/tool-names.d.ts +1 -0
  75. package/cli/dist-server/types/vendor/cbc-shared/node/utils/retry-backoff.d.ts +30 -0
  76. package/cli/dist-server/types/vendor/cbc-shared/node/utils/retry-policy.d.ts +26 -0
  77. package/cli/dist-server/types/workspace/agent-client-protocol/lib/common/index.d.ts +1 -0
  78. package/cli/dist-server/types/workspace/agent-client-protocol/lib/common/sandbox-rule-context.d.ts +38 -0
  79. package/cli/dist-server/types/workspace/authentication/lib/common/account-scoped-external-link-authentication-provider.d.ts +5 -5
  80. package/cli/dist-server/types/workspace/authentication/lib/common/account-utils.d.ts +25 -0
  81. package/cli/dist-server/types/workspace/authentication/lib/common/authentication-manager.d.ts +8 -2
  82. package/cli/dist-server/types/workspace/authentication/lib/common/authentication-observation.d.ts +36 -0
  83. package/cli/dist-server/types/workspace/authentication/lib/common/authentication-protocol.d.ts +40 -2
  84. package/cli/dist-server/types/workspace/authentication/lib/common/external-link-authentication-provider.d.ts +21 -5
  85. package/cli/dist-server/types/workspace/authentication/lib/common/index.d.ts +1 -0
  86. package/cli/dist-server/types/workspace/authentication/lib/common/wx-authentication-provider.d.ts +2 -2
  87. package/cli/dist-server/types/workspace/cbc-checkpoint/lib/node/checkpoint/checkpoint-protocol.d.ts +2 -0
  88. package/cli/dist-server/types/workspace/cbc-checkpoint/lib/node/checkpoint/checkpoint-service.d.ts +1 -0
  89. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-protocol.d.ts +60 -2
  90. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-purpose-protocol.d.ts +8 -4
  91. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-purpose-scope.d.ts +46 -0
  92. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-service.d.ts +28 -3
  93. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/index.d.ts +4 -0
  94. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/interceptors/input-interceptors.d.ts +1 -6
  95. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/model-call-failure.d.ts +9 -0
  96. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/model-step-sequence.d.ts +11 -0
  97. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/runner-factory.d.ts +56 -20
  98. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/speaker-label.d.ts +44 -0
  99. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/tool-call-loop-detector-service.d.ts +5 -4
  100. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/tool-call-loop-guard-protocol.d.ts +1 -1
  101. package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/tool-call-loop-pattern.d.ts +16 -4
  102. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/compaction-lineage.d.ts +39 -0
  103. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/context-compact-summarizer.d.ts +2 -0
  104. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/context-protocol.d.ts +17 -0
  105. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/index.d.ts +1 -0
  106. package/cli/dist-server/types/workspace/cbc-core/lib/node/context/pre-message-compact-strategy.d.ts +1 -2
  107. package/cli/dist-server/types/workspace/cbc-core/lib/node/hooks/agent-trigger.d.ts +6 -22
  108. package/cli/dist-server/types/workspace/cbc-core/lib/node/hooks/hook-protocol.d.ts +4 -1
  109. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/idle-queue-drain-service.d.ts +4 -56
  110. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/index.d.ts +4 -0
  111. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/interruption-service.d.ts +63 -9
  112. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/model-request-retry-phase.d.ts +16 -0
  113. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/model-response-interceptors.d.ts +33 -0
  114. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/recovery-budget.d.ts +55 -0
  115. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-hook-manager.d.ts +15 -0
  116. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-manager-host-protocol.d.ts +3 -2
  117. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-manager.d.ts +17 -4
  118. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-persistence-error.d.ts +43 -0
  119. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-protocol.d.ts +110 -9
  120. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-run-state-machine-protocol.d.ts +15 -1
  121. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-runtime-lifecycle.d.ts +5 -0
  122. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-store.d.ts +150 -4
  123. package/cli/dist-server/types/workspace/cbc-core/lib/node/session/stream-timeout-retry-budget.d.ts +20 -1
  124. package/cli/dist-server/types/workspace/cbc-core/lib/node/trace/turn-context.d.ts +28 -1
  125. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/command-message-utils.d.ts +20 -0
  126. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/history-utils.d.ts +27 -4
  127. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/index.d.ts +1 -0
  128. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/input-item-utils.d.ts +8 -0
  129. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/message-utils.d.ts +12 -0
  130. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/model-utils.d.ts +7 -0
  131. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/queue-dispatch-utils.d.ts +24 -2
  132. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/session-utils.d.ts +4 -1
  133. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/string-retention-utils.d.ts +4 -0
  134. package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/token-utils.d.ts +3 -1
  135. package/cli/dist-server/types/workspace/cbc-shared/lib/node/agent/openai-agents-types.d.ts +1 -0
  136. package/cli/dist-server/types/workspace/cbc-shared/lib/node/checkpoint/checkpoint-types.d.ts +6 -0
  137. package/cli/dist-server/types/workspace/cbc-shared/lib/node/hooks/hook-types.d.ts +7 -1
  138. package/cli/dist-server/types/workspace/cbc-shared/lib/node/index.d.ts +2 -0
  139. package/cli/dist-server/types/workspace/cbc-shared/lib/node/model/model-errors.d.ts +36 -4
  140. package/cli/dist-server/types/workspace/cbc-shared/lib/node/tools/tool-names.d.ts +1 -0
  141. package/cli/dist-server/types/workspace/cbc-shared/lib/node/utils/retry-backoff.d.ts +30 -0
  142. package/cli/dist-server/types/workspace/cbc-shared/lib/node/utils/retry-policy.d.ts +26 -0
  143. package/cli/dist-server/types/workspace/cbc-workflow/lib/node/workflow/workflow-execution.d.ts +14 -1
  144. package/cli/dist-server/types/workspace/cbc-workflow/lib/node/workflow/workflow-manager.d.ts +7 -0
  145. package/cli/dist-server/types/workspace/cbc-worktree/lib/node/worktree/worktree-service.d.ts +5 -0
  146. package/cli/dist-server/types/workspace/cbc-worktree/lib/node/worktree/worktree-session.d.ts +3 -0
  147. package/cli/dist-server/types/workspace/core/lib/common/protocol.d.ts +8 -1
  148. package/cli/dist-server/types/workspace/product/lib/common/cloud-product-provider.d.ts +9 -0
  149. package/cli/dist-server/types/workspace/product/lib/common/index.d.ts +2 -0
  150. package/cli/dist-server/types/workspace/product/lib/common/pick-market-skill-id.d.ts +13 -0
  151. package/cli/dist-server/types/workspace/product/lib/common/tencent-docs-endpoint.d.ts +37 -0
  152. package/cli/dist-server/types/workspace/product/lib/common/tool-control-catalog.d.ts +2 -2
  153. package/cli/dist-server/types/workspace/product/lib/common/types/config.d.ts +12 -0
  154. package/cli/dist-server/types/workspace/product/lib/common/types/features.d.ts +63 -11
  155. package/cli/dist-server/types/workspace/product/lib/common/types/language-model.d.ts +66 -0
  156. package/cli/dist-server/types/workspace/product/lib/common/types/product.d.ts +22 -1
  157. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/backup-policy.d.ts +10 -1
  158. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/center-protocol.generated.d.ts +375 -4
  159. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/file-policy.d.ts +5 -2
  160. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/http-policy.d.ts +20 -0
  161. package/cli/dist-server/types/workspace/sandbox-cli/lib/common/rule-config.d.ts +10 -0
  162. package/cli/dist-server/types/workspace/sandbox-cli/lib/node/sandbox-center-client.d.ts +219 -0
  163. package/cli/dist-server/types/workspace/telemetry/lib/common/event/types/craft.d.ts +43 -3
  164. package/cli/package.json +1 -1
  165. package/cli/product.cloudhosted.json +4 -4
  166. package/cli/product.internal.json +268 -45
  167. package/cli/product.ioa.json +354 -161
  168. package/cli/product.json +338 -352
  169. package/cli/product.selfhosted.json +2 -2
  170. package/cli/vendor/shim/brokered-bin/7z +675 -0
  171. package/cli/vendor/shim/brokered-bin/7za +675 -0
  172. package/cli/vendor/shim/brokered-bin/7zz +675 -0
  173. package/cli/vendor/shim/brokered-bin/rar +675 -0
  174. package/cli/vendor/shim/brokered-bin/tar +675 -0
  175. package/cli/vendor/shim/brokered-bin/zip +187 -0
  176. package/docs/README.md +1 -0
  177. package/docs/in-process.md +42 -2
  178. package/docs/protocol.md +7 -1
  179. package/docs/server.md +2 -0
  180. package/lib/agent/v2.js +1 -1
  181. package/lib/application/services.d.ts +3 -1
  182. package/lib/application/services.js +1 -1
  183. package/lib/client/client.js +1 -1
  184. package/lib/client/mcp.d.ts +1 -1
  185. package/lib/client/mcp.js +1 -1
  186. package/lib/components/acp-mcp-transport.d.mts +84 -1
  187. package/lib/components/question-elicitation.d.mts +20 -1
  188. package/lib/components/sandbox-center.d.mts +2 -0
  189. package/lib/components/sandbox-center.mjs +1 -0
  190. package/lib/components/{acp/acp-prompt-input.d.ts → session/prompt-input.d.ts} +1 -1
  191. package/lib/components/session-config.d.mts +2 -0
  192. package/lib/components/session-config.mjs +1 -1
  193. package/lib/components/session-replay.d.mts +6 -7
  194. package/lib/components/session-replay.mjs +1 -1
  195. package/lib/effect-runtime/mcp-lifecycle.mjs +1 -1
  196. package/lib/harness/create-harness.js +1 -1
  197. package/lib/harness/runtime.js +1 -1
  198. package/lib/harness/types.d.ts +3 -0
  199. package/lib/integration/agent-integration.d.ts +5 -0
  200. package/lib/integration/executor-supervisor.js +1 -1
  201. package/lib/public.d.ts +1 -0
  202. package/lib/runtime/private-runtime-role.js +1 -1
  203. package/lib/runtime/sandbox-center.d.ts +21 -0
  204. package/lib/runtime/sandbox-center.js +1 -0
  205. package/lib/server/public.d.ts +1 -0
  206. package/lib/session/agent-backend.d.ts +5 -0
  207. package/lib/session/agent-backend.js +1 -1
  208. package/lib/session/config-defaults.d.ts +4 -0
  209. package/lib/session/config-defaults.js +1 -0
  210. package/lib/session/config-store.d.ts +1 -1
  211. package/lib/session/config-store.js +1 -1
  212. package/lib/session/local-fs.js +1 -1
  213. package/lib/session/replay.d.ts +2 -2
  214. package/lib/session/replay.js +1 -1
  215. package/lib/session/server-config.d.ts +11 -2
  216. package/lib/session/server-config.js +1 -1
  217. package/lib/session/server-events.d.ts +10 -8
  218. package/lib/session/server-events.js +1 -1
  219. package/lib/session/server-interactions.js +1 -1
  220. package/lib/session/server-mcp.js +1 -1
  221. package/package.json +27 -16
  222. package/lib/components/acp/acp-client-channel.d.ts +0 -36
  223. package/lib/components/acp/acp-mcp-transport.d.ts +0 -84
  224. package/lib/components/acp/acp-question-elicitation.d.ts +0 -20
  225. package/lib/session/local-options.d.ts +0 -50
  226. package/lib/session/local-options.js +0 -1
@@ -0,0 +1,219 @@
1
+ import { type ChildProcess } from 'child_process';
2
+ import { type RuleCategory, SANDBOX_RULES_COMMANDS, type SandboxCommand } from '../common/center-protocol.generated.js';
3
+ export { SANDBOX_BACKUP_COMMANDS, SANDBOX_CENTER_LIFECYCLE_COMMANDS, SANDBOX_RULES_COMMANDS, } from '../common/center-protocol.generated.js';
4
+ export type { BackupReason, CheckMaliciousDomainResponse, CommitModifyBackupResponse, DecideNetworkResponse, EnableModifyBackupRequest, EnableModifyBackupResponse, HttpInterceptConfig, HttpInterceptRuleItem, ModifyBackupCommitEntry, ModifyBackupFileEntry, ModifyBackupRequest, QueryModifyBackupCommitsResponse, RestoreModifyBackupResponse, SetHttpInterceptRequest, SetRulesConfigRequest, SetThreatDatabaseResponse, ShutdownCenterResponse, } from '../common/center-protocol.generated.js';
5
+ export interface SandboxCenterRuntimeContext {
6
+ appHome: string;
7
+ executablePath?: string;
8
+ socketPath: string;
9
+ uid: string;
10
+ }
11
+ export interface SandboxCenterRequestOptions {
12
+ messageId?: string;
13
+ sessionId?: string;
14
+ signal?: AbortSignal;
15
+ timeoutMs?: number;
16
+ }
17
+ export type SandboxRulesCommand = (typeof SANDBOX_RULES_COMMANDS)[keyof typeof SANDBOX_RULES_COMMANDS];
18
+ export type SandboxCenterCommand = SandboxCommand;
19
+ export interface SandboxCenterFileRule {
20
+ ruleRef?: string;
21
+ path: string;
22
+ action: string;
23
+ comment?: string;
24
+ isDirectory: boolean;
25
+ }
26
+ export interface SandboxCenterNetworkRule {
27
+ ruleRef?: string;
28
+ endpoint: string;
29
+ action: string;
30
+ comment?: string;
31
+ }
32
+ export interface SandboxCenterMachRule {
33
+ name: string;
34
+ action: string;
35
+ comment?: string;
36
+ }
37
+ export interface SandboxCenterCmdRule {
38
+ ruleRef?: string;
39
+ cmd: string;
40
+ args: string[];
41
+ action: string;
42
+ comment?: string;
43
+ }
44
+ export interface SandboxCenterAddFileRulesRequest {
45
+ rules: SandboxCenterFileRule[];
46
+ category?: RuleCategory;
47
+ }
48
+ export interface SandboxCenterRemoveFileRulesRequest {
49
+ paths: string[];
50
+ category?: RuleCategory;
51
+ }
52
+ export interface SandboxCenterSetFileRulesRequest {
53
+ rules: SandboxCenterFileRule[];
54
+ category?: RuleCategory;
55
+ }
56
+ export interface SandboxCenterMatchFileRuleRequest {
57
+ path: string;
58
+ }
59
+ export interface SandboxCenterMatchFileRuleResponse {
60
+ matched: boolean;
61
+ path: string;
62
+ action: string;
63
+ category?: RuleCategory;
64
+ matchedPattern?: string;
65
+ }
66
+ export interface SandboxCenterSetNetworkRulesRequest {
67
+ rules: SandboxCenterNetworkRule[];
68
+ category?: RuleCategory;
69
+ }
70
+ export interface SandboxCenterAddNetworkRulesRequest {
71
+ rules: SandboxCenterNetworkRule[];
72
+ category?: RuleCategory;
73
+ }
74
+ export interface SandboxCenterRemoveNetworkRulesRequest {
75
+ endpoints: string[];
76
+ category?: RuleCategory;
77
+ }
78
+ export interface SandboxCenterAddMachRulesRequest {
79
+ rules: SandboxCenterMachRule[];
80
+ category?: RuleCategory;
81
+ }
82
+ export interface SandboxCenterRemoveMachRulesRequest {
83
+ names: string[];
84
+ category?: RuleCategory;
85
+ }
86
+ export interface SandboxCenterSetMachRulesRequest {
87
+ rules: SandboxCenterMachRule[];
88
+ category?: RuleCategory;
89
+ }
90
+ export interface SandboxCenterAddCmdRulesRequest {
91
+ rules: SandboxCenterCmdRule[];
92
+ category?: RuleCategory;
93
+ }
94
+ export interface SandboxCenterRemoveCmdRulesRequest {
95
+ cmds: string[];
96
+ category?: RuleCategory;
97
+ }
98
+ export interface SandboxCenterSetCmdRulesRequest {
99
+ rules: SandboxCenterCmdRule[];
100
+ category?: RuleCategory;
101
+ }
102
+ export interface SandboxCenterAddForbiddenProgramRequest {
103
+ program: string;
104
+ category?: RuleCategory;
105
+ }
106
+ export interface SandboxCenterRemoveForbiddenProgramRequest {
107
+ programs: string[];
108
+ category?: RuleCategory;
109
+ }
110
+ export interface SandboxCenterGetRulesResponse {
111
+ forbiddenProgramRules: Array<{
112
+ program: string;
113
+ comment?: string;
114
+ }>;
115
+ }
116
+ export interface SandboxCenterClient {
117
+ request<T>(command: SandboxCenterCommand, data: object, options?: SandboxCenterRequestOptions): Promise<T>;
118
+ close(): void;
119
+ getConnectionGeneration?(): number;
120
+ isConnected?(): boolean;
121
+ /**
122
+ * 订阅重连事件:每次成功建立**新连接**(此前无活连接——首连或断线重连)后触发。
123
+ * 返回取消订阅函数。
124
+ *
125
+ * 用途(#126618 规则空窗修复):center 重启(crash/升级/机器重启)后其内存态全部
126
+ * 丢失(运行时规则、会话授权),client 若只重连不重推,到下一轮全量下发前所有
127
+ * 判定都会 RuleMissing → fail-closed Ask(误弹确认框)。订阅方(如
128
+ * SandboxRuleSyncService)应在回调里立即重推全量规则。回调异常静默吞掉。
129
+ */
130
+ onReconnect?(listener: () => void): () => void;
131
+ }
132
+ export interface SandboxCenterClientOptions {
133
+ clientRole?: string;
134
+ startMode?: 'connect-only' | 'spawn-if-missing';
135
+ resolveRuntimeContext(options?: SandboxCenterRequestOptions): SandboxCenterRuntimeContext | Promise<SandboxCenterRuntimeContext>;
136
+ }
137
+ type SandboxCenterClientBaseOptions = Omit<SandboxCenterClientOptions, 'resolveRuntimeContext'> & {
138
+ resolveRuntimeContext?: SandboxCenterClientOptions['resolveRuntimeContext'];
139
+ };
140
+ /** 纪元 IPC 地址环境变量名:拉起方(Desktop/standalone agent-cli)构造后注入,
141
+ * 经 spawn env 继承透传进程树内所有 center client(agent-cli/sandbox-cli)。 */
142
+ export declare const SANDBOX_CENTER_IPC_ADDRESS_ENV = "SANDBOX_CENTER_IPC_ADDRESS";
143
+ /** A host-owned center uses connect-only; standalone Agent CLI keeps its existing lazy spawn default. */
144
+ export declare const SANDBOX_CENTER_START_MODE_ENV = "CODEBUDDY_SANDBOX_CENTER_START_MODE";
145
+ /**
146
+ * 回退派生(FNV-1a 64-bit 哈希 appHome → 完整平台路径)——与 sandbox-center 侧
147
+ * `cipher::ipc_address` 逐字节对齐(未注入 env 的 e2e/dev 场景两侧行为一致)。
148
+ */
149
+ export declare function resolveSandboxCenterSocketPath(appHome: string, platform?: NodeJS.Platform): string;
150
+ /**
151
+ * **纪元地址唯一构造函数**(按拉起方主进程 pid 派生):`<回退地址逻辑段>_<launcherPid>`。
152
+ *
153
+ * 纪元地址模型(2026-09):新主进程 = 新地址 = 新纪元——center 的 IPC 地址与纪元锁
154
+ * 都以该地址为键,crash 残留旧 center(持旧地址锁)不再阻塞新实例;同 uid 跨纪元的
155
+ * 存储单写者由 center 侧数据锁(security/&lt;uid&gt;/data.lock)守卫。
156
+ *
157
+ * **调用权规则**:只有「即将 spawn center 的拉起方」允许调用本函数并写
158
+ * `SANDBOX_CENTER_IPC_ADDRESS` env;树内其余 client 一律经
159
+ * {@link consumeEpochCenterAddress} 消费(env 优先,缺失回退旧派生)。
160
+ * 双入口:Desktop 主进程(workbuddy-desktop)与 standalone agent-cli
161
+ * (startMode='spawn-if-missing' 且 env 未注入时,以自身 pid 兜底构造)。
162
+ */
163
+ export declare function buildEpochCenterAddress(appHome: string, launcherPid: number, platform?: NodeJS.Platform): string;
164
+ /**
165
+ * 消费纪元地址(树内 client 统一入口):env 已注入 → 忠实返回(不再派生,防双算法漂移);
166
+ * env 缺失/空白 → 回退 {@link resolveSandboxCenterSocketPath}(e2e/dev 兼容)。
167
+ *
168
+ * standalone agent-cli 的 spawn-if-missing 入口额外允许 `deriveIfMissing`:
169
+ * env 缺失且自己是拉起方时,以自身 pid 构造纪元地址并写回 env(供随后 spawn 的
170
+ * center 与更深的子进程继承)。Desktop 拓扑恒 connect-only,不走该分支。
171
+ */
172
+ export declare function consumeEpochCenterAddress(appHome: string, options?: {
173
+ deriveIfMissing?: boolean;
174
+ platform?: NodeJS.Platform;
175
+ }): string;
176
+ /** Start a center with the same configuration used by the lazy CLI client.
177
+ * The caller owns the returned child and may shut it down through IPC.
178
+ * The address is passed in both config and env so all clients in its process tree
179
+ * use the same epoch. UID stays in the child env and never appears in argv.
180
+ */
181
+ export declare function spawnSandboxCenter(runtime: SandboxCenterRuntimeContext): Promise<ChildProcess>;
182
+ export declare function createSandboxCenterClient(options: SandboxCenterClientOptions): SandboxCenterClient;
183
+ export declare class SandboxCenterClientBase implements SandboxCenterClient {
184
+ private readonly options;
185
+ private socket;
186
+ private connectedRuntimeKey;
187
+ private connectPromise;
188
+ private connectPromiseGeneration;
189
+ private connectionGeneration;
190
+ private decoder;
191
+ private lineBuffer;
192
+ private messageSequence;
193
+ private readonly pendingRequests;
194
+ /** 重连监听器(onReconnect 订阅)。 */
195
+ private readonly reconnectListeners;
196
+ constructor(options?: SandboxCenterClientBaseOptions);
197
+ getConnectionGeneration(): number;
198
+ isConnected(): boolean;
199
+ onReconnect(listener: () => void): () => void;
200
+ /** 通知所有重连监听器(边沿触发:新连接建立成功)。异常静默。 */
201
+ private notifyReconnect;
202
+ request<T>(command: SandboxCenterCommand, data: object, requestOptions?: SandboxCenterRequestOptions): Promise<T>;
203
+ close(): void;
204
+ protected spawnCenter(runtime: SandboxCenterRuntimeContext): Promise<void>;
205
+ protected resolveRuntimeContext(requestOptions?: SandboxCenterRequestOptions): SandboxCenterRuntimeContext | Promise<SandboxCenterRuntimeContext>;
206
+ private ensureConnected;
207
+ private connectWithStart;
208
+ private waitForConnection;
209
+ private openSocket;
210
+ private handleData;
211
+ private handleResponse;
212
+ private handleDisconnect;
213
+ private isCurrentConnection;
214
+ private finishPending;
215
+ private rejectAllPending;
216
+ private withClientMetadata;
217
+ private nextMessageId;
218
+ private isRetryableConnectionError;
219
+ }
@@ -22,10 +22,29 @@ export interface CraftRequest {
22
22
  actionCode: string;
23
23
  }
24
24
  /**
25
- * 聊天请求发送遥测数据接口
25
+ * Role of a model call, mirroring Claude Code's `x-claude-code-request-class`: main /
26
+ * subagent / team agent loops, `compaction` summary calls, and `auxiliary` for other
27
+ * one-shot helpers (title, WebFetch analysis, ...) on any Session.
28
+ */
29
+ export type AgentType = 'main' | 'subagent' | 'team' | 'auxiliary' | 'compaction';
30
+ /**
31
+ * Compaction class, with the values of Claude Code's `x-claude-code-compaction` /
32
+ * `x-claude-code-context-compacted` headers.
33
+ */
34
+ export type CompactionKind = 'manual' | 'auto' | 'reactive';
35
+ /**
36
+ * Why the harness compacted (`blocking_limit` / `ptl` are Claude Code's terms):
37
+ *
38
+ * | trigger | kind | condition |
39
+ * |---|---|---|
40
+ * | `manual` | manual | `/compact` from any entry (TUI, IM, /server, typed command) |
41
+ * | `pre_message_threshold` | auto | before a user message, tokens ≥ `tokenUsageThresholds.inputTokens.preMessage` |
42
+ * | `cache_expired` | auto | before a user message, the used prompt cache is ≥ 1h old and tokens ≥ 50% of the budget |
43
+ * | `emergency_threshold` | auto | before a model call, tokens ≥ `tokenUsageThresholds.inputTokens.emergency`; the call is sent, then interrupted |
44
+ * | `blocking_limit` | auto | before a model call, tokens + max output would exceed the context budget; the call waits |
45
+ * | `ptl` | reactive | the model rejected the prompt as too long |
26
46
  */
27
- /** Agent 角色类型:main = 主 agent,subagent = fork 子 agent,team = 团队成员 agent */
28
- export type AgentType = 'main' | 'subagent' | 'team';
47
+ export type CompactionTrigger = 'manual' | 'pre_message_threshold' | 'cache_expired' | 'emergency_threshold' | 'blocking_limit' | 'ptl';
29
48
  export interface UserTaskFailedCreditRefundTelemetry {
30
49
  /** 用户 ID,对齐公共 userId 字段;业务侧显式传入,避免特定宿主未注入 UserinfoProvider 时缺失。 */
31
50
  userId: string;
@@ -74,6 +93,9 @@ export interface ToolCallLoopTelemetry {
74
93
  /** 重复序列的周期长度;连续同工具为 1。 */
75
94
  total: number;
76
95
  }
96
+ /**
97
+ * 聊天请求发送遥测数据接口
98
+ */
77
99
  export interface ChatRequestSendTelemetry {
78
100
  /** 聊天模式,枚举值:ask / chat */
79
101
  mode: string;
@@ -307,6 +329,20 @@ export interface ChatMessageSendTelemetry {
307
329
  isContextTruncated: boolean;
308
330
  /** 当前 stepCount 数值 */
309
331
  currentStepCount: number;
332
+ /**
333
+ * Agent-loop model call number within this conversation. Unlike
334
+ * `currentStepCount` it never resets (runs, compaction, resume); retries of
335
+ * one call share the number.
336
+ */
337
+ totalStepCount?: number;
338
+ /** Completed context compactions of this conversation when the call is sent; never resets. */
339
+ compactionCount?: number;
340
+ /** Compaction the call's context starts from (`cmp_*`, the JSONL boundary item id). */
341
+ compactionId?: string;
342
+ /** First call after a compaction: the compaction's class. */
343
+ contextCompacted?: CompactionKind;
344
+ /** Set with `contextCompacted`: why the harness compacted. */
345
+ compactionTrigger?: CompactionTrigger;
310
346
  /** 是否是自定义模型 */
311
347
  isCustomModel?: boolean;
312
348
  /**
@@ -352,6 +388,8 @@ export interface ChatMessageResponseTelemetry {
352
388
  requestId: string;
353
389
  /** 模型调用 ID */
354
390
  messageId: string;
391
+ /** Same value as the paired `chat_message_send.totalStepCount`. */
392
+ totalStepCount?: number;
355
393
  /** 模型 ID */
356
394
  requestModelId: string;
357
395
  /** 模型名称 */
@@ -425,6 +463,8 @@ export interface ChatToolActionTelemetry {
425
463
  messageId: string;
426
464
  /** 当前 stepCount 数值 */
427
465
  stepCount: number;
466
+ /** Agent-loop step (`chat_message_send.totalStepCount`) whose response requested this tool call. */
467
+ totalStepCount?: number;
428
468
  /** 工具 ID */
429
469
  toolCallId: string;
430
470
  /** 工具名称 */
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencent-ai/codebuddy-code",
3
- "version": "2.156.0",
3
+ "version": "2.159.0",
4
4
  "private": true,
5
5
  "description": "CodeBuddy runtime embedded in @tencent-ai/agent-harness",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -666,8 +666,8 @@
666
666
  },
667
667
  "maxAllowedSize": 256000,
668
668
  "relatedModels": {
669
- "lite": "kimi-k2.6",
670
- "reasoning": "kimi-k2.6"
669
+ "lite": "kimi-k2.5",
670
+ "reasoning": "kimi-k2-thinking"
671
671
  }
672
672
  },
673
673
  {
@@ -798,6 +798,6 @@
798
798
  "SelectImage": true,
799
799
  "SkipToolCallSupportCheck": true
800
800
  },
801
- "commit": "dc049917f83480787e2618027a5efef739dfc3e0",
802
- "date": "2026-09-22T06:02:01.815Z"
801
+ "commit": "5fdb0502c8031c71fd947c537235505bdae49eec",
802
+ "date": "2026-09-28T07:49:01.626Z"
803
803
  }