@tencent-ai/agent-sdk 0.3.252 → 0.3.253

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 (208) hide show
  1. package/cli/CHANGELOG.md +22 -0
  2. package/cli/dist/codebuddy-headless.js +73 -58
  3. package/cli/dist/codebuddy-lite-wb.mjs +96 -81
  4. package/cli/dist/lazy/{427.68132a34.js → 427.74b982af.js} +4 -4
  5. package/cli/dist/lazy-headless/{834.391fb41e.js → 834.3b674e07.js} +9 -9
  6. package/cli/dist-server/3556.codebuddy.js +1 -1
  7. package/cli/dist-server/6037.codebuddy.js +1 -1
  8. package/cli/dist-server/6784.codebuddy.js +1 -1
  9. package/cli/dist-server/codebuddy.js +45 -30
  10. package/cli/dist-server/types/node/agent/openai-agents-types.d.ts +5 -5
  11. package/cli/dist-server/types/node/mcp/mcp-sdk-values.d.ts +1 -1
  12. package/cli/dist-server/types/node/model/model-provider.d.ts +3 -1
  13. package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +139 -34
  14. package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +46 -0
  15. package/cli/package.json +1 -1
  16. package/cli/product.cloudhosted.json +2 -2
  17. package/cli/product.internal.json +2 -2
  18. package/cli/product.ioa.json +2 -2
  19. package/cli/product.json +4 -4
  20. package/cli/product.selfhosted.json +2 -2
  21. package/package.json +1 -1
  22. package/cli/dist-server/types/node/acp/acp-view-rewind-to.d.ts +0 -34
  23. package/cli/dist-server/types/node/acp/acp-web-ui-client.d.ts +0 -22
  24. package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
  25. package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
  26. package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
  27. package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
  28. package/cli/dist-server/types/node/agent-home/agent-home-envelope-body.d.ts +0 -54
  29. package/cli/dist-server/types/node/agent-home/agent-home-inbox-events.d.ts +0 -14
  30. package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +0 -30
  31. package/cli/dist-server/types/node/agent-team/permission-bridge-client.d.ts +0 -32
  32. package/cli/dist-server/types/node/agent-team/permission-bridge-protocol.d.ts +0 -47
  33. package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +0 -80
  34. package/cli/dist-server/types/node/agent-view/job-respawn-prefs.d.ts +0 -12
  35. package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +0 -161
  36. package/cli/dist-server/types/node/ask/index.d.ts +0 -3
  37. package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +0 -125
  38. package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +0 -33
  39. package/cli/dist-server/types/node/bash-sandbox/managed-security-policy.d.ts +0 -6
  40. package/cli/dist-server/types/node/bash-sandbox/workbuddy-directory-protection.d.ts +0 -12
  41. package/cli/dist-server/types/node/checkpoint/checkpoint-service.d.ts +0 -70
  42. package/cli/dist-server/types/node/checkpoint/file-changes-controller.d.ts +0 -29
  43. package/cli/dist-server/types/node/checkpoint/file-track-service.d.ts +0 -11
  44. package/cli/dist-server/types/node/checkpoint/file-version-manager.d.ts +0 -10
  45. package/cli/dist-server/types/node/checkpoint/file-version-store.d.ts +0 -9
  46. package/cli/dist-server/types/node/checkpoint/file-version-update-strategies.d.ts +0 -62
  47. package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +0 -11
  48. package/cli/dist-server/types/node/command/agents-command-executor.d.ts +0 -9
  49. package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +0 -20
  50. package/cli/dist-server/types/node/command/background-command-executor.d.ts +0 -29
  51. package/cli/dist-server/types/node/command/btw-command-executor.d.ts +0 -19
  52. package/cli/dist-server/types/node/command/clear-command-executor.d.ts +0 -17
  53. package/cli/dist-server/types/node/command/config-command-executor.d.ts +0 -15
  54. package/cli/dist-server/types/node/command/context-command-executor.d.ts +0 -42
  55. package/cli/dist-server/types/node/command/copy-command-executor.d.ts +0 -10
  56. package/cli/dist-server/types/node/command/cost-command-executor.d.ts +0 -13
  57. package/cli/dist-server/types/node/command/debug-command-executor.d.ts +0 -15
  58. package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +0 -25
  59. package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +0 -7
  60. package/cli/dist-server/types/node/command/effort-command-executor.d.ts +0 -46
  61. package/cli/dist-server/types/node/command/exit-command-executor.d.ts +0 -14
  62. package/cli/dist-server/types/node/command/export-command-executor.d.ts +0 -7
  63. package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +0 -9
  64. package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +0 -30
  65. package/cli/dist-server/types/node/command/fork-command-executor.d.ts +0 -28
  66. package/cli/dist-server/types/node/command/goal-command-executor.d.ts +0 -50
  67. package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +0 -9
  68. package/cli/dist-server/types/node/command/help-command-executor.d.ts +0 -9
  69. package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +0 -9
  70. package/cli/dist-server/types/node/command/ide-command-executor.d.ts +0 -11
  71. package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +0 -15
  72. package/cli/dist-server/types/node/command/memory-command-executor.d.ts +0 -17
  73. package/cli/dist-server/types/node/command/mode-command-executor.d.ts +0 -11
  74. package/cli/dist-server/types/node/command/model-command-executor.d.ts +0 -11
  75. package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +0 -17
  76. package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +0 -17
  77. package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +0 -17
  78. package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +0 -17
  79. package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +0 -17
  80. package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +0 -17
  81. package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +0 -9
  82. package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +0 -9
  83. package/cli/dist-server/types/node/command/plan-command-executor.d.ts +0 -11
  84. package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +0 -25
  85. package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +0 -21
  86. package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +0 -18
  87. package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +0 -24
  88. package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +0 -44
  89. package/cli/dist-server/types/node/command/rename-command-executor.d.ts +0 -11
  90. package/cli/dist-server/types/node/command/reset-command-executor.d.ts +0 -9
  91. package/cli/dist-server/types/node/command/resume-command-executor.d.ts +0 -21
  92. package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +0 -10
  93. package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +0 -20
  94. package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +0 -43
  95. package/cli/dist-server/types/node/command/session-reset-notifier.d.ts +0 -23
  96. package/cli/dist-server/types/node/command/skills-command-executor.d.ts +0 -9
  97. package/cli/dist-server/types/node/command/stats-command-executor.d.ts +0 -11
  98. package/cli/dist-server/types/node/command/status-command-executor.d.ts +0 -11
  99. package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +0 -9
  100. package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +0 -7
  101. package/cli/dist-server/types/node/command/theme-command-executor.d.ts +0 -7
  102. package/cli/dist-server/types/node/command/todos-command-executor.d.ts +0 -16
  103. package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +0 -13
  104. package/cli/dist-server/types/node/command/vim-command-executor.d.ts +0 -11
  105. package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +0 -26
  106. package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +0 -32
  107. package/cli/dist-server/types/node/feedback/feedback-service.d.ts +0 -19
  108. package/cli/dist-server/types/node/feedback/index.d.ts +0 -2
  109. package/cli/dist-server/types/node/goal/goal-policy.d.ts +0 -55
  110. package/cli/dist-server/types/node/goal/goal-protocol.d.ts +0 -178
  111. package/cli/dist-server/types/node/goal/goal-service.d.ts +0 -201
  112. package/cli/dist-server/types/node/goal/goal-session-start-hook.d.ts +0 -24
  113. package/cli/dist-server/types/node/hooks/parse-frontmatter-hooks.d.ts +0 -42
  114. package/cli/dist-server/types/node/install/index.d.ts +0 -6
  115. package/cli/dist-server/types/node/install/install-controller.d.ts +0 -15
  116. package/cli/dist-server/types/node/install/install-env.d.ts +0 -12
  117. package/cli/dist-server/types/node/install/install-errors.d.ts +0 -46
  118. package/cli/dist-server/types/node/install/install-protocol.d.ts +0 -83
  119. package/cli/dist-server/types/node/install/install-service.d.ts +0 -36
  120. package/cli/dist-server/types/node/install/install-utils.d.ts +0 -7
  121. package/cli/dist-server/types/node/install/releases-service.d.ts +0 -18
  122. package/cli/dist-server/types/node/install/shell-setup.d.ts +0 -36
  123. package/cli/dist-server/types/node/mcp/mcp-cancellation.d.ts +0 -65
  124. package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +0 -56
  125. package/cli/dist-server/types/node/mcp/mcp-model-id-header-helper.d.ts +0 -12
  126. package/cli/dist-server/types/node/mcp/mcp-oauth-callback-html.d.ts +0 -6
  127. package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +0 -26
  128. package/cli/dist-server/types/node/mcp/mcp-output-storage.d.ts +0 -57
  129. package/cli/dist-server/types/node/mcp/mcp-server-override-impl.d.ts +0 -136
  130. package/cli/dist-server/types/node/mcp/mcp-server-override.d.ts +0 -29
  131. package/cli/dist-server/types/node/mcp/mcp-tool-result-sideband.d.ts +0 -26
  132. package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +0 -25
  133. package/cli/dist-server/types/node/mcp/models/mcp-server.d.ts +0 -18
  134. package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +0 -38
  135. package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +0 -17
  136. package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +0 -143
  137. package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +0 -97
  138. package/cli/dist-server/types/node/message-queue/followup-queue.d.ts +0 -35
  139. package/cli/dist-server/types/node/message-queue/index.d.ts +0 -11
  140. package/cli/dist-server/types/node/plugins/concurrency.d.ts +0 -1
  141. package/cli/dist-server/types/node/plugins/dependency-resolver.d.ts +0 -43
  142. package/cli/dist-server/types/node/plugins/directory-plugin-cache-projection.d.ts +0 -2
  143. package/cli/dist-server/types/node/plugins/guards/index.d.ts +0 -2
  144. package/cli/dist-server/types/node/plugins/guards/weixinpay-integrity-guard.d.ts +0 -15
  145. package/cli/dist-server/types/node/plugins/installers/git-plugin-installer.d.ts +0 -42
  146. package/cli/dist-server/types/node/plugins/installers/git-subdir-plugin-installer.d.ts +0 -19
  147. package/cli/dist-server/types/node/plugins/installers/index.d.ts +0 -4
  148. package/cli/dist-server/types/node/plugins/installers/local-plugin-installer.d.ts +0 -40
  149. package/cli/dist-server/types/node/plugins/installers/npm-plugin-installer.d.ts +0 -23
  150. package/cli/dist-server/types/node/plugins/loaders/agent-loader.d.ts +0 -43
  151. package/cli/dist-server/types/node/plugins/loaders/command-loader.d.ts +0 -37
  152. package/cli/dist-server/types/node/plugins/loaders/hook-loader.d.ts +0 -55
  153. package/cli/dist-server/types/node/plugins/loaders/index.d.ts +0 -8
  154. package/cli/dist-server/types/node/plugins/loaders/lsp-loader.d.ts +0 -47
  155. package/cli/dist-server/types/node/plugins/loaders/mcp-loader.d.ts +0 -75
  156. package/cli/dist-server/types/node/plugins/loaders/output-style-loader.d.ts +0 -49
  157. package/cli/dist-server/types/node/plugins/loaders/plugin-loader-manager.d.ts +0 -49
  158. package/cli/dist-server/types/node/plugins/loaders/skill-loader.d.ts +0 -45
  159. package/cli/dist-server/types/node/plugins/marketplace-name-validator.d.ts +0 -50
  160. package/cli/dist-server/types/node/plugins/marketplace-path-safety.d.ts +0 -86
  161. package/cli/dist-server/types/node/plugins/marketplaces/base-marketplace.d.ts +0 -43
  162. package/cli/dist-server/types/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +0 -22
  163. package/cli/dist-server/types/node/plugins/marketplaces/directory-marketplace.d.ts +0 -19
  164. package/cli/dist-server/types/node/plugins/marketplaces/git-availability-detector.d.ts +0 -62
  165. package/cli/dist-server/types/node/plugins/marketplaces/git-fallback-coordinator.d.ts +0 -42
  166. package/cli/dist-server/types/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +0 -50
  167. package/cli/dist-server/types/node/plugins/marketplaces/github-marketplace.d.ts +0 -41
  168. package/cli/dist-server/types/node/plugins/marketplaces/http-marketplace.d.ts +0 -47
  169. package/cli/dist-server/types/node/plugins/marketplaces/index.d.ts +0 -13
  170. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-config-manager.d.ts +0 -39
  171. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-factory.d.ts +0 -11
  172. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-storage.d.ts +0 -141
  173. package/cli/dist-server/types/node/plugins/marketplaces/marketplace-update-checker.d.ts +0 -38
  174. package/cli/dist-server/types/node/plugins/marketplaces/workspace-project-root.d.ts +0 -14
  175. package/cli/dist-server/types/node/plugins/marketplaces/zip-marketplace.d.ts +0 -134
  176. package/cli/dist-server/types/node/plugins/mcpb-handler.d.ts +0 -29
  177. package/cli/dist-server/types/node/plugins/plugin-controller.d.ts +0 -75
  178. package/cli/dist-server/types/node/plugins/plugin-error-collector.d.ts +0 -17
  179. package/cli/dist-server/types/node/plugins/plugin-install-stats-service.d.ts +0 -20
  180. package/cli/dist-server/types/node/plugins/plugin-manager.d.ts +0 -692
  181. package/cli/dist-server/types/node/plugins/plugin-policy-service.d.ts +0 -53
  182. package/cli/dist-server/types/node/plugins/plugin-validator.d.ts +0 -48
  183. package/cli/dist-server/types/node/plugins/zip-utils.d.ts +0 -93
  184. package/cli/dist-server/types/node/remote-control/clients/liveness-watchdog.d.ts +0 -56
  185. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-activity.d.ts +0 -23
  186. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-auth.d.ts +0 -64
  187. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client-factory.d.ts +0 -47
  188. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client.d.ts +0 -191
  189. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-inbound.d.ts +0 -7
  190. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-interaction.d.ts +0 -142
  191. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-live.d.ts +0 -78
  192. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-media.d.ts +0 -35
  193. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-qr-bind.d.ts +0 -49
  194. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-respond-queue.d.ts +0 -33
  195. package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-types.d.ts +0 -207
  196. package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +0 -288
  197. package/cli/dist-server/types/node/remote-gateway/gateway-protocol.d.ts +0 -502
  198. package/cli/dist-server/types/node/remote-gateway/utils/qrcode-utils.d.ts +0 -16
  199. package/cli/dist-server/types/node/session/session-preview-utils.d.ts +0 -30
  200. package/cli/dist-server/types/node/settings/model-setting-utils.d.ts +0 -2
  201. package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +0 -35
  202. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
  203. package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -19
  204. package/cli/dist-server/types/node/utils/add-dir-utils.d.ts +0 -20
  205. package/cli/dist-server/types/node/utils/compress-path.source.d.ts +0 -59
  206. package/cli/dist-server/types/node/vim/index.d.ts +0 -2
  207. package/cli/dist-server/types/node/vim/vim-manager.d.ts +0 -12
  208. package/cli/dist-server/types/node/vim/vim-protocol.d.ts +0 -24
@@ -1,502 +0,0 @@
1
- /**
2
- * Remote Gateway Protocol
3
- *
4
- * 定义通用远程网关模块的所有类型、接口和 DI Symbols。
5
- * 支持两种网络模式:
6
- * - 模式 A: 云端 Gateway 中转(AgentOS + Centrifugo WebSocket)
7
- * - 模式 B: 本地 Gateway + Cloudflare Tunnel(HTTP + SSE)
8
- *
9
- * Web UI 直接复用 ACP 协议,不使用 Gateway Protocol。
10
- * Gateway Protocol 仅用于企业机器人等第三方平台的 Webhook 接入。
11
- */
12
- import type { Subject } from 'rxjs';
13
- export declare const GatewayAcpBridge: unique symbol;
14
- export declare const GatewayConfigService: unique symbol;
15
- export declare const GatewayTunnelService: unique symbol;
16
- export declare const GatewayLocalServer: unique symbol;
17
- export declare const GatewayAuthMiddleware: unique symbol;
18
- export declare const GatewayRateLimiter: unique symbol;
19
- export declare const GatewayAdapterRegistry: unique symbol;
20
- export declare const GatewayCorsService: unique symbol;
21
- export declare const HostValidationMiddleware: unique symbol;
22
- export declare const GatewayAuditLog: unique symbol;
23
- export declare const CloudGatewayClient: unique symbol;
24
- export declare const CloudGatewayApiClient: unique symbol;
25
- /**
26
- * 自定义请求头名称。
27
- * 所有 API 请求必须携带此头(值为 '1'),用于:
28
- * 1. 强制浏览器对跨域请求发送 preflight (OPTIONS)
29
- * 2. 服务端校验,防止简单请求绕过 CORS 预检
30
- */
31
- export declare const CUSTOM_REQUEST_HEADER = "x-codebuddy-request";
32
- /**
33
- * E2B envd 兼容的凭据头(issue #78178)。
34
- *
35
- * 值为 Gateway 密码,语义与 `Authorization: Bearer <password>` 完全等价。
36
- * 存在的意义是让按 E2B `envd` 习惯集成的客户端能直接复用同一套调用代码
37
- * —— envd 用 `X-Access-Token` 承载 sandbox 的 access token
38
- * (见 e2b-dev/infra `packages/envd/internal/api/auth.go`)。
39
- */
40
- export declare const ACCESS_TOKEN_HEADER = "x-access-token";
41
- /**
42
- * 将安全请求头合并到 headers 对象中。
43
- * 统一入口,避免在每个 HTTP 调用点重复 `[CUSTOM_REQUEST_HEADER]: '1'`。
44
- *
45
- * @example
46
- * // Node.js http.request
47
- * http.request({ headers: withSecurityHeader({ 'Content-Type': 'application/json' }) })
48
- *
49
- * // CellJS RestOperations
50
- * restOperations.post(url, body, { headers: withSecurityHeader({ ... }) })
51
- *
52
- * // fetch
53
- * fetch(url, { headers: withSecurityHeader({ Authorization: `Bearer ${token}` }) })
54
- */
55
- export declare function withSecurityHeader<T extends Record<string, string>>(headers?: T): T & Record<string, string>;
56
- export declare const GATEWAY_PROTOCOL_VERSION = "1.0";
57
- export declare const DEFAULT_GATEWAY_PORT = 8321;
58
- export declare const DEFAULT_RATE_LIMIT_PER_MINUTE = 60;
59
- export declare const DEFAULT_MAX_CONCURRENT = 3;
60
- export type GatewayMode = 'cloud' | 'tunnel' | 'local';
61
- /** Gateway 认证模式(与 settings `gateway.auth` 取值一致)。 */
62
- export type GatewayAuthMode = 'password' | 'none';
63
- export type GatewayConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
64
- export interface GatewayConnectionState {
65
- status: GatewayConnectionStatus;
66
- mode: GatewayMode;
67
- /** 本地服务地址 (模式 B) */
68
- localUrl?: string;
69
- /** Tunnel 公网地址 (模式 B + tunnel) */
70
- tunnelUrl?: string;
71
- /** 认证 token */
72
- gatewayToken?: string;
73
- /** 连接时间 */
74
- connectedAt?: number;
75
- /** 错误信息 */
76
- error?: string;
77
- /** Tunnel 启动失败的原因(Gateway 本身仍正常运行) */
78
- tunnelError?: string;
79
- }
80
- /**
81
- * 通用入站消息格式。
82
- * 各平台适配器将平台特定格式转换为此格式。
83
- */
84
- export interface GatewayInboundMessage {
85
- /** 协议版本 */
86
- version: typeof GATEWAY_PROTOCOL_VERSION;
87
- /** 消息唯一 ID */
88
- id: string;
89
- /** 消息类型 */
90
- type: 'message' | 'action';
91
- /** 消息来源 */
92
- source: GatewayMessageSource;
93
- /** 消息载荷 */
94
- payload: GatewayMessagePayload;
95
- /** 控制动作(type='action' 时使用) */
96
- action?: 'cancel' | 'status';
97
- /** 回调配置(模式 B 用于异步回传结果) */
98
- callback?: GatewayCallback;
99
- /**
100
- * 任务执行超时时间(毫秒)。单次消息覆盖,优先级高于 settings.gateway.runTimeoutMs。
101
- * 通常由 adapter 从 HTTP 请求头 `X-Codebuddy-Run-Timeout` 解析写入。
102
- * 设为 0 或负数表示关闭超时保护。未设置时走 settings / 默认值。
103
- */
104
- timeoutMs?: number;
105
- }
106
- export interface GatewayMessageSource {
107
- /** 平台标识 */
108
- platform: string;
109
- /** 发送者信息 */
110
- sender: {
111
- id: string;
112
- name?: string;
113
- };
114
- /** 会话信息 */
115
- conversation: {
116
- id: string;
117
- type: 'direct' | 'group';
118
- };
119
- }
120
- export interface GatewayMessagePayload {
121
- /** 文本内容 */
122
- text?: string;
123
- /** 附件列表 */
124
- attachments?: GatewayAttachment[];
125
- }
126
- export interface GatewayAttachment {
127
- type: 'image' | 'voice' | 'video' | 'file';
128
- /**
129
- * 附件位置。根据 `urlType` 解读:
130
- * - 'local-path' (默认): 绝对文件系统路径,模型可用 Read 等工具直接打开
131
- * - 'url': HTTP(S) URL,模型可用 WebFetch 抓取
132
- */
133
- url: string;
134
- /** 原始文件名(含扩展名),供 prompt 展示 */
135
- name?: string;
136
- mimeType?: string;
137
- size?: number;
138
- /** 路径语义。未指定时按 'local-path' 处理(与适配器当前产出一致) */
139
- urlType?: 'local-path' | 'url';
140
- }
141
- export interface GatewayCallback {
142
- /** 回调 URL */
143
- url: string;
144
- /** 额外请求头 */
145
- headers?: Record<string, string>;
146
- }
147
- /**
148
- * 通用出站消息格式。
149
- * 各平台适配器将此格式转换为平台特定格式。
150
- */
151
- export interface GatewayOutboundMessage {
152
- /** 协议版本 */
153
- version: typeof GATEWAY_PROTOCOL_VERSION;
154
- /** 对应的入站消息 ID */
155
- replyTo: string;
156
- /** 处理状态 */
157
- status: GatewayOutboundStatus;
158
- /** 响应内容 */
159
- content?: GatewayOutboundContent;
160
- /** Agent 执行信息 */
161
- agent?: GatewayAgentInfo;
162
- /** 错误信息 */
163
- error?: GatewayError;
164
- }
165
- export type GatewayOutboundStatus = 'accepted' | 'streaming' | 'completed' | 'error';
166
- export interface GatewayOutboundContent {
167
- /** 纯文本(适合所有平台) */
168
- text?: string;
169
- /** Markdown 富文本 */
170
- markdown?: string;
171
- /** 流式片段 */
172
- chunk?: string;
173
- }
174
- export interface GatewayAgentInfo {
175
- /** 会话 ID */
176
- sessionId?: string;
177
- /** 工具调用列表 */
178
- toolCalls?: GatewayToolCallInfo[];
179
- }
180
- export interface GatewayToolCallInfo {
181
- /** 工具名称 */
182
- name: string;
183
- /** 执行状态 */
184
- status: 'started' | 'completed' | 'failed';
185
- /** 执行摘要 */
186
- summary?: string;
187
- }
188
- export interface GatewayError {
189
- /** 错误代码 */
190
- code: string;
191
- /** 错误描述 */
192
- message: string;
193
- }
194
- /**
195
- * 平台 URL 验证结果。
196
- * 部分平台(如企业微信)在设置回调 URL 时会发送 GET 请求做验证,
197
- * 适配器需返回此结构表示验证结果。
198
- */
199
- export interface VerificationResult {
200
- /** 是否验证成功 */
201
- verified: boolean;
202
- /** 成功时的响应内容(如企微的 echostr 明文,需直接作为 HTTP 响应体返回) */
203
- response?: string;
204
- /** 失败时的错误信息 */
205
- error?: string;
206
- }
207
- /**
208
- * 平台适配器接口。
209
- * 每个支持的平台需要实现此接口,负责:
210
- * 1. 将平台 Webhook 请求解析为 GatewayInboundMessage
211
- * 2. 将 GatewayOutboundMessage 格式化为平台 API 格式
212
- * 3. 验证平台 Webhook 签名
213
- * 4. (可选)处理平台 URL 验证请求
214
- */
215
- export interface PlatformAdapter {
216
- /** 平台标识(wecom、dingtalk、feishu、slack、generic) */
217
- readonly platform: string;
218
- /** 将平台 Webhook 请求解析为通用入站消息(支持异步,如微信客服需要拉取消息) */
219
- parseInbound(req: GatewayHttpRequest, config?: PlatformAdapterConfig): GatewayInboundMessage | Promise<GatewayInboundMessage>;
220
- /** 将通用出站消息格式化为平台 API 格式 */
221
- formatOutbound(msg: GatewayOutboundMessage, context: AdapterContext): unknown;
222
- /** 验证平台 Webhook 签名 */
223
- verifySignature(req: GatewayHttpRequest, config: PlatformAdapterConfig): boolean;
224
- /**
225
- * 处理平台 URL 验证请求(GET)。
226
- * 不是所有平台都需要此方法(如 generic 不需要)。
227
- * 实现了此方法的平台,webhook controller 会在 GET 请求时调用,
228
- * 并跳过 Gateway 自身的认证(因为平台有自己的签名机制)。
229
- */
230
- handleVerification?(req: GatewayHttpRequest, config: PlatformAdapterConfig): VerificationResult;
231
- /**
232
- * 主动发送回复消息到平台用户。
233
- * 在 agent 执行完成后由 bridge 调用,将最终结果推送给消息发送者。
234
- * 不是所有平台都支持此方法(如 generic 不需要,通过 SSE 流式输出)。
235
- *
236
- * @param userId - 目标用户 ID(来自入站消息的 source.sender.id)
237
- * @param content - 文本内容
238
- * @returns true if the message was sent successfully
239
- */
240
- sendReply?(userId: string, content: string): Promise<boolean>;
241
- }
242
- export interface GatewayHttpRequest {
243
- method: string;
244
- url: string;
245
- headers: Record<string, string | string[] | undefined>;
246
- body: unknown;
247
- query: Record<string, string>;
248
- }
249
- export interface AdapterContext {
250
- /** 会话 ID */
251
- conversationId: string;
252
- /** 原始入站消息 */
253
- inboundMessage: GatewayInboundMessage;
254
- /** 平台特定配置 */
255
- platformConfig?: PlatformAdapterConfig;
256
- }
257
- export interface PlatformAdapterConfig {
258
- [key: string]: unknown;
259
- }
260
- export interface IGatewayAdapterRegistry {
261
- /** 注册适配器 */
262
- register(adapter: PlatformAdapter): void;
263
- /** 获取适配器 */
264
- get(platform: string): PlatformAdapter | undefined;
265
- /** 获取所有已注册的平台 */
266
- platforms(): string[];
267
- }
268
- /**
269
- * Gateway ACP Bridge 接口。
270
- * 核心桥接层,将 Gateway 消息转化为 AgentService 调用。
271
- */
272
- export interface IGatewayAcpBridge {
273
- /**
274
- * 同步处理消息(等待完成后返回结果)。
275
- * 适用于模式 A (云端 Gateway) 通过 API 回传结果。
276
- */
277
- handleMessage(msg: GatewayInboundMessage): Promise<GatewayOutboundMessage>;
278
- /**
279
- * 异步流式处理消息(通过事件流回传中间结果)。
280
- * 适用于模式 B (本地 Gateway) 的 SSE 流式输出。
281
- */
282
- handleMessageAsync(taskId: string, msg: GatewayInboundMessage): Promise<void>;
283
- /**
284
- * 获取任务的事件流(供 SSE 端点使用)。
285
- */
286
- getTaskStream(taskId: string): Subject<GatewayOutboundMessage> | undefined;
287
- /**
288
- * 取消正在执行的任务。
289
- */
290
- cancelTask(taskId: string): boolean;
291
- /**
292
- * 设置主 session(交互模式的 session)。
293
- * 设置后,外部消息将汇聚到该 session 的消息队列中,
294
- * 实现终端交互和 HTTP API 共享同一个对话。
295
- */
296
- setPrimarySession(session: import('../session/index.js').Session): void;
297
- }
298
- /**
299
- * Tunnel 服务接口。
300
- */
301
- export interface IGatewayTunnelService {
302
- /** 公网 URL */
303
- readonly publicUrl: string | null;
304
- /** 启动 Quick Tunnel(零配置,临时 URL) */
305
- startQuickTunnel(localPort: number): Promise<string>;
306
- /** 启动 Named Tunnel(持久域名,需要 CF 账号) */
307
- startNamedTunnel(config: {
308
- token: string;
309
- hostname: string;
310
- cloudflaredPath?: string;
311
- }): Promise<string>;
312
- /** 停止 Tunnel */
313
- stop(): Promise<void>;
314
- }
315
- /**
316
- * 本地 Gateway 服务接口。
317
- */
318
- export interface IGatewayLocalServer {
319
- /** 当前连接状态 */
320
- readonly connectionState: GatewayConnectionState;
321
- /** 状态变更事件 */
322
- readonly onStatusChange: Subject<GatewayConnectionState>;
323
- /** 启动服务 */
324
- start(options?: GatewayStartOptions): Promise<GatewayConnectionState>;
325
- /** 停止服务 */
326
- stop(): Promise<void>;
327
- /** 重新生成认证密码 */
328
- regenerateToken(): Promise<string>;
329
- }
330
- export interface GatewayStartOptions {
331
- /** 监听端口 */
332
- port?: number;
333
- /** 是否启动 Tunnel */
334
- tunnel?: boolean;
335
- /** Tunnel 配置 */
336
- tunnelConfig?: {
337
- type: 'quick' | 'named';
338
- token?: string;
339
- hostname?: string;
340
- cloudflaredPath?: string;
341
- };
342
- }
343
- /**
344
- * `IGatewayAuthMiddleware.setup()` 的入参。
345
- *
346
- * 认证模式优先级 (高→低):
347
- * `CODEBUDDY_GATEWAY_AUTH` env > `cliAuthMode` (`--auth`) > `forceAuth` > settings `gateway.auth` > `defaultMode`
348
- *
349
- * 显式 `--auth none` 是用户明确要求的逃生门,因此可以覆盖 forceAuth;仅 settings
350
- * 不能覆盖 forceAuth(避免非 loopback 绑定被 settings 意外放开)。
351
- */
352
- export interface GatewayAuthSetupOptions {
353
- /** 强制开启密码认证,忽略 settings(`/gateway` 显式启动 / tunnel 对外暴露时使用) */
354
- forceAuth?: boolean;
355
- /** CLI 显式指定的模式(`--auth`)。低于 env,高于 forceAuth/settings */
356
- cliAuthMode?: GatewayAuthMode;
357
- /**
358
- * 用户未做任何显式配置时的兜底模式(缺省 `'none'`)。
359
- *
360
- * `--serve` 传 `'password'` 实现 secure-by-default(issue #78178):既翻转默认值,
361
- * 又保留 settings `gateway.auth: 'none'` 的显式退出路径——这是相比 `forceAuth: true`
362
- * 的关键差异,后者会连用户在 settings 里的显式选择一起覆盖掉。
363
- */
364
- defaultMode?: GatewayAuthMode;
365
- }
366
- /**
367
- * 认证中间件接口。
368
- */
369
- /**
370
- * 认证中间件接口。
371
- * 参考 code-server 设计: 支持 password / none 两种模式。
372
- */
373
- export interface IGatewayAuthMiddleware {
374
- /** 认证是否已启用 */
375
- isEnabled(): boolean;
376
- /**
377
- * 根据 settings + env 初始化认证。
378
- * 优先级见 {@link GatewayAuthSetupOptions}。
379
- * @returns 启用时返回密码,未启用时返回 undefined
380
- */
381
- setup(options?: GatewayAuthSetupOptions): Promise<{
382
- enabled: boolean;
383
- password?: string;
384
- }>;
385
- /** 验证请求是否已认证 */
386
- authenticate(req: GatewayHttpRequest): boolean;
387
- /** 获取当前密码 (未启用返回空) */
388
- getPassword(): string;
389
- /** 获取密码的 SHA256 哈希 (用于 Cookie 比对) */
390
- getHashedPassword(): string;
391
- /** 重新生成密码 */
392
- regeneratePassword(): Promise<string>;
393
- /** 记录一次失败的登录尝试,返回是否被限流 */
394
- recordFailedAttempt(): boolean;
395
- }
396
- /**
397
- * 速率限制器接口。
398
- */
399
- export interface IGatewayRateLimiter {
400
- /** 检查是否允许请求 */
401
- check(senderId: string): boolean;
402
- /** 释放并发计数(请求完成时调用) */
403
- release(senderId: string): void;
404
- /** 重置限制 */
405
- reset(senderId?: string): void;
406
- }
407
- /**
408
- * CORS 服务接口。
409
- * 管理允许的来源列表,提供 CORS header 设置。
410
- */
411
- export interface IGatewayCorsService {
412
- /**
413
- * 初始化 CORS 配置。
414
- * @param serverEndpoint 本地服务端点 URL (如 http://localhost:7878)
415
- * @param tunnelUrl 可选的 Tunnel URL
416
- */
417
- setup(serverEndpoint: string, tunnelUrl?: string): Promise<void>;
418
- /**
419
- * 添加允许的来源。
420
- */
421
- addAllowedOrigin(origin: string): void;
422
- /**
423
- * 获取请求对应的 CORS origin header 值。
424
- * 如果请求来源在白名单中返回该来源,否则返回 undefined。
425
- * @param requestOrigin 请求的 Origin header
426
- */
427
- getAllowedOrigin(requestOrigin: string | undefined): string | undefined;
428
- /**
429
- * 设置 CORS 响应头到 response 对象上。
430
- * @param response HTTP 响应对象
431
- * @param requestOrigin 请求的 Origin header
432
- * @returns true 如果来源被允许
433
- */
434
- applyCorsHeaders(response: any, requestOrigin: string | undefined): boolean;
435
- }
436
- /**
437
- * Host 头验证中间件接口。
438
- *
439
- * 防止 DNS Rebinding 攻击。
440
- * 验证请求的 Host 头是否在白名单中,防止攻击者通过 DNS 重绑定访问本地服务。
441
- */
442
- export interface IHostValidationMiddleware {
443
- /**
444
- * 初始化允许的 Host 列表。
445
- * @param port 本地 Gateway 监听端口
446
- * @param tunnelUrl 可选的 Tunnel URL
447
- */
448
- setup(port: number, tunnelUrl?: string): Promise<void>;
449
- /**
450
- * 验证请求的 Host 头是否有效。
451
- * @param host 请求的 Host 头
452
- * @returns true 如果 Host 有效,false 如果应拒绝请求
453
- */
454
- isValidHost(host: string | undefined): boolean;
455
- /**
456
- * 添加自定义允许的 Host。
457
- */
458
- addAllowedHost(host: string): void;
459
- /**
460
- * 获取所有允许的 Host 列表(仅用于日志/诊断)。
461
- */
462
- getAllowedHosts(): string[];
463
- }
464
- /**
465
- * 审计事件类型。
466
- */
467
- export type AuditEventType = 'connection.open' | 'connection.close' | 'auth.success' | 'auth.failure' | 'auth.rate_limited' | 'token.issued' | 'token.revoked' | 'token.invalid' | 'cors.rejected' | 'session.created' | 'tool.executed' | 'tool.denied' | 'connection.limit_reached';
468
- /**
469
- * 审计日志条目。
470
- */
471
- export interface AuditEntry {
472
- timestamp: number;
473
- event: AuditEventType;
474
- /** 远程地址 */
475
- remoteAddress?: string;
476
- /** 连接 ID */
477
- connectionId?: string;
478
- /** 附加信息 */
479
- details?: Record<string, unknown>;
480
- }
481
- /**
482
- * 审计日志服务接口。
483
- */
484
- export interface IGatewayAuditLog {
485
- /**
486
- * 记录审计事件。
487
- */
488
- log(event: AuditEventType, context?: {
489
- remoteAddress?: string;
490
- connectionId?: string;
491
- details?: Record<string, unknown>;
492
- }): void;
493
- /**
494
- * 获取最近的审计日志。
495
- * @param limit 最大条目数 (默认 100)
496
- */
497
- getRecent(limit?: number): AuditEntry[];
498
- /**
499
- * 获取指定连接的审计日志。
500
- */
501
- getByConnection(connectionId: string): AuditEntry[];
502
- }
@@ -1,16 +0,0 @@
1
- export interface QRCodeOptions {
2
- /** QR 码版本(1-40),版本越高矩阵越大。不指定时自动选择最小版本。 */
3
- version?: number;
4
- }
5
- /**
6
- * 生成终端友好的 UTF-8 QR 码字符串。
7
- *
8
- * 使用 Unicode 半块字符(▀▄█ 等)渲染,在终端中紧凑显示。
9
- * 适合手机扫码场景。
10
- */
11
- export declare function generateTerminalQRCode(data: string, options?: QRCodeOptions): Promise<string>;
12
- /**
13
- * 计算给定数据所需的最小 QR 码版本。
14
- * 用于在多个 QR 码之间统一尺寸。
15
- */
16
- export declare function getQRCodeVersion(data: string): Promise<number>;
@@ -1,30 +0,0 @@
1
- /**
2
- * 会话卡片的首尾提问预览。
3
- *
4
- * 「最新提问」取的是最后一条**用户消息**而非最后一条消息:后者绝大多数情况是模型回复或工具调用结果,既
5
- * 有大量噪音,也无法唤起「我当时在问什么」的记忆。清洗规则与 resumable 列表的 label 保持一致,否则同一
6
- * 张卡片上标题与首条提问会呈现两种不同的文本形态。
7
- *
8
- * 纯图片消息(截图不配文字)在预览里整条跳过,不像标题那样回退成「图片」:标题必须始终有值,它承担的是
9
- * 「这个会话是什么」的告知;预览是补充信息,目的是唤起「我当时在问什么」,两个字的「图片」没有这种价
10
- * 值,反而会和同卡片的标题重复。跳过后展示的是相邻的真实提问,信息量更高。
11
- */
12
- import type { AgentInputItem } from '../agent/openai-agents-types';
13
- /** 截断上限。大于展示所需(卡片最多两行),留余量给前端按实际宽度截行。 */
14
- export declare const PREVIEW_MAX_LENGTH = 200;
15
- export interface SessionPreviews {
16
- firstUserMessage?: string;
17
- lastUserMessage?: string;
18
- }
19
- export declare function extractSessionPreviews(activeHistory: AgentInputItem[]): SessionPreviews;
20
- /**
21
- * 会话文本的统一清洗:预览与 resumable 列表的 label 共用同一套规则。两处必须一致——同一句提问若在标题和
22
- * 首条提问处显示成不同文字,用户会误以为那是两条不同的消息。
23
- *
24
- * 占位符判定复用标题侧的 {@link isGeneratedPlaceholderTitle}:`(No content)` 之类的取值是普通英文,剥标
25
- * 签与折叠空白都拦不住,只有共用同一份定义才能保证卡片上标题与预览对「这条消息没有可读正文」的判断一致。
26
- * 判定放在清洗之后:`(No content)` 这类取值要等剥标签与折叠空白都做完才能确定;纯图片消息不需要在清洗前
27
- * 再判一次——`extractTextContent` 已经把 `<image_local_path>` 块整块跳过,到这里拿到的本来就是
28
- * `(No content)`。
29
- */
30
- export declare function cleanSessionText(raw: string | undefined): string | undefined;
@@ -1,2 +0,0 @@
1
- import { SettingsManager } from './settings-protocol';
2
- export declare function getModelSwitchSuccessMessage(settingsManager: SettingsManager, modelName: string, successPrefix?: string): Promise<string>;
@@ -1,35 +0,0 @@
1
- import { SettingsManager } from '../settings';
2
- export declare const TOOL_CONTROL_BLOCKED_MARKER = "WORKBUDDY_TOOL_CONTROL_BLOCKED";
3
- export declare const TOOL_CONTROL_SETTINGS_READ_TIMEOUT_MS = 1000;
4
- export declare const ToolControlPolicy: unique symbol;
5
- export type ToolControlBlockReason = 'tool_disabled' | 'mcp_server_disabled' | 'mcp_tool_disabled' | 'custom_mcp_disabled';
6
- export interface ToolControlAuditContext {
7
- sessionId?: string;
8
- requestId?: string;
9
- toolCallId?: string;
10
- }
11
- export interface ToolControlMcpContext extends ToolControlAuditContext {
12
- serverId: string;
13
- toolName: string;
14
- custom: boolean;
15
- }
16
- export interface ToolControlPolicy {
17
- assertToolExecutionAllowed(toolName: string, context?: ToolControlAuditContext): Promise<void>;
18
- assertMcpToolExecutionAllowed(context: ToolControlMcpContext): Promise<void>;
19
- }
20
- export declare class ToolControlBlockedError extends Error {
21
- readonly code = "WORKBUDDY_TOOL_CONTROL_BLOCKED";
22
- readonly retryable = false;
23
- readonly reason: ToolControlBlockReason;
24
- readonly toolId: string;
25
- readonly serverId?: string;
26
- constructor(toolId: string, toolName: string, reason: ToolControlBlockReason, serverId?: string);
27
- }
28
- export declare function isToolControlBlockedError(error: unknown): error is ToolControlBlockedError;
29
- export declare class ToolControlPolicyImpl implements ToolControlPolicy {
30
- protected readonly settingsManager: SettingsManager;
31
- private readSettings;
32
- private block;
33
- assertToolExecutionAllowed(toolName: string, context?: ToolControlAuditContext): Promise<void>;
34
- assertMcpToolExecutionAllowed(context: ToolControlMcpContext): Promise<void>;
35
- }
@@ -1,51 +0,0 @@
1
- import { PromptManager } from '@genie/prompts';
2
- import { AutoModeSettings } from '../../settings';
3
- import { AutoModeRules } from './auto-mode-protocol';
4
- import { AutoModeSystemPromptBuilder } from './auto-mode-system-prompt-builder';
5
- export declare const AutoModeCritiqueClient: unique symbol;
6
- /** True if any section has a custom entry beyond the `$defaults` token (Claude `is6`). */
7
- export declare function hasCustomRules(raw: AutoModeSettings | undefined): boolean;
8
- /**
9
- * Runs the auto mode rule critique (read-only).
10
- *
11
- * Implementation: spawns a standard `codebuddy -p` (print/headless) subprocess.
12
- * This reuses the project's canonical "cold-start, run once, exit" path — the
13
- * child waits for its own runtime to be fully ready, so the critique command
14
- * never races agent registration during startup (which a direct in-process
15
- * `runOneTime` would, since this runs from a short-lived dispatch strategy).
16
- *
17
- * Prompt / context assembly is aligned with Claude Code 2.1.179 `MIT`/`rs6`:
18
- * - system prompt = the "expert reviewer" critique instructions template
19
- * - the user message embeds the FULL classifier system prompt plus the user's
20
- * custom rules, each section annotated as replacing or extending the defaults
21
- * - only the user's CUSTOM rules are reviewed (the strategy gates on
22
- * `hasCustomRules` before calling this)
23
- *
24
- * Does not participate in permission decisions.
25
- */
26
- export declare class AutoModeCritiqueClientImpl {
27
- protected readonly systemPromptBuilder: AutoModeSystemPromptBuilder;
28
- protected readonly promptManager: PromptManager;
29
- /**
30
- * @param resolved effective rules after `$defaults` expansion — used to render
31
- * the classifier system prompt the critique reviews against.
32
- * @param raw merged-but-unexpanded custom rules (`$defaults` preserved) —
33
- * used to show only the user's own entries with replace/extend
34
- * annotations.
35
- */
36
- critique(resolved: AutoModeRules, raw: AutoModeSettings): Promise<string>;
37
- /** Load the critique "expert reviewer" system prompt template text. */
38
- private loadCritiqueSystemPrompt;
39
- /**
40
- * Spawn `codebuddy -p --model lite --system-prompt <critique> -` with the
41
- * critique user message on stdin, and return the printed text.
42
- */
43
- private runPrintSubprocess;
44
- protected buildCritiqueInput(resolved: AutoModeRules, raw: AutoModeSettings): Promise<string>;
45
- /**
46
- * Format one section's custom rules, noting whether they extend (contain
47
- * `$defaults`) or replace the built-in defaults. Mirrors Claude `rs6`.
48
- * Returns '' when the section has no custom entries.
49
- */
50
- private formatSection;
51
- }
@@ -1,19 +0,0 @@
1
- import { RunContext, ToolExecuteArgument } from '../../agent';
2
- import { Session } from '../../session';
3
- import { PermissionMode, SettingsManager } from '../../settings';
4
- import { BaseTool } from '../base-tool';
5
- import { ToolArg, ToolPermissionStrategy } from '../tool-protocol';
6
- /**
7
- * Auto permission strategy — deterministic fast paths only.
8
- *
9
- * 1. acceptEdits fast path: anything acceptEdits would auto-allow, auto allows too.
10
- * 2. safe tool allowlist: read-only / metadata built-ins auto-allow.
11
- * 3. everything else returns `ask` → the service's unified outlet routes it into
12
- * the classifier (AutoModePermissionService). The classifier call deliberately
13
- * lives outside the strategy so the permission chain stays synchronous/testable.
14
- */
15
- export declare class ToolPermissionAutoStrategy implements ToolPermissionStrategy {
16
- mode: PermissionMode;
17
- protected readonly settingsManager: SettingsManager;
18
- needApproval(tool: BaseTool, runContext: RunContext<Session>, input: ToolExecuteArgument<any>, checkArgs: ToolArg[], callId?: string): Promise<boolean>;
19
- }
@@ -1,20 +0,0 @@
1
- export declare enum VerificationResultType {
2
- EMPTY_PATH = "emptyPath",
3
- PATH_NOT_FOUND = "pathNotFound",
4
- NOT_A_DIRECTORY = "notADirectory",
5
- SUCCESS = "success",
6
- ALREADY_IN_WORKING_DIRECTORY = "alreadyInWorkingDirectory"
7
- }
8
- export interface VerificationResult {
9
- resultType: VerificationResultType;
10
- directoryPath?: string;
11
- absolutePath?: string;
12
- workingDir?: string;
13
- }
14
- export declare abstract class AddDirUtils {
15
- static getAbsolutePath(dirpath: string): string;
16
- static normalizePath(path: string): string;
17
- static isSamePath(addDir: string, hasDir: string): boolean;
18
- static directoryVerification(directoryPath: string, additionalDirectories: string[]): VerificationResult;
19
- static getVerificationMsg(verificationInfo: VerificationResult): string;
20
- }