@tencent-ai/agent-harness 0.2.0-beta.10 → 0.2.0-beta.11
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.
- package/CHANGELOG.md +9 -0
- package/cli/CHANGELOG.md +42 -0
- package/cli/dist-server/shared.cjs +316 -315
- package/cli/dist-server/types/node/agent/agent-controller.d.ts +1 -0
- package/cli/dist-server/types/node/agent/index.d.ts +1 -0
- package/cli/dist-server/types/node/agent/interceptors/image-interceptors.d.ts +1 -2
- package/cli/dist-server/types/node/agent/interceptors/sandbox-interceptor.d.ts +1 -0
- package/cli/dist-server/types/node/agent/steer-model-input-preparer.d.ts +11 -0
- package/cli/dist-server/types/node/agent-task/agent-task.d.ts +12 -0
- package/cli/dist-server/types/node/agent-team/backends/teammate-backend-protocol.d.ts +2 -0
- package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +7 -0
- package/cli/dist-server/types/node/channel/channel-protocol.d.ts +8 -8
- package/cli/dist-server/types/node/cli/cli-runtime-options.d.ts +24 -1
- package/cli/dist-server/types/node/command/clear-command-executor.d.ts +2 -0
- package/cli/dist-server/types/node/hooks/hook-protocol.d.ts +3 -67
- package/cli/dist-server/types/node/loopback/endpoint-provider.d.ts +3 -0
- package/cli/dist-server/types/node/loopback/server-protocol.d.ts +7 -0
- package/cli/dist-server/types/node/memory/memory-relevance-protocol.d.ts +6 -1
- package/cli/dist-server/types/node/memory/memory-relevance-service.d.ts +3 -2
- package/cli/dist-server/types/node/model/model-protocol.d.ts +4 -0
- package/cli/dist-server/types/node/security-review/gate.d.ts +1 -0
- package/cli/dist-server/types/node/security-review/protocol.d.ts +2 -0
- package/cli/dist-server/types/node/session/session-hook-host-adapter.d.ts +2 -2
- package/cli/dist-server/types/node/settings/current-session-model-transition.d.ts +5 -4
- package/cli/dist-server/types/node/settings/settings-protocol.d.ts +2 -0
- package/cli/dist-server/types/node/tools/a2a-cancel-task-tool.d.ts +4 -4
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +4 -4
- package/cli/dist-server/types/node/tools/audio-transcribe-tool.d.ts +1 -2
- package/cli/dist-server/types/node/tools/grep-tool.d.ts +2 -0
- package/cli/dist-server/types/node/tools/image-service.d.ts +3 -1
- package/cli/dist-server/types/node/tools/index.d.ts +1 -0
- package/cli/dist-server/types/node/tools/media-file-writer.d.ts +12 -0
- package/cli/dist-server/types/node/tools/multi-edit-tool.d.ts +4 -4
- package/cli/dist-server/types/node/tools/powershell-tool.d.ts +2 -0
- package/cli/dist-server/types/node/tools/send-message-tool.d.ts +2 -2
- package/cli/dist-server/types/node/tools/tool-hook-manager.d.ts +2 -2
- package/cli/dist-server/types/node/tools/tool-manager.d.ts +1 -0
- package/cli/dist-server/types/node/tools/tool-protocol.d.ts +2 -2
- package/cli/dist-server/types/node/tools/video-service.d.ts +2 -0
- package/cli/dist-server/types/node/tools/wecom-reply-tool.d.ts +2 -2
- package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-protocol.d.ts +12 -0
- package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-service.d.ts +11 -0
- package/cli/dist-server/types/vendor/cbc-core/node/agent/index.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-core/node/agent/runner-factory.d.ts +6 -0
- package/cli/dist-server/types/vendor/cbc-core/node/context/compact-strategy-base.d.ts +17 -5
- package/cli/dist-server/types/vendor/cbc-core/node/context/pre-switch-model.d.ts +34 -0
- package/cli/dist-server/types/vendor/cbc-core/node/hooks/hook-protocol.d.ts +118 -3
- package/cli/dist-server/types/vendor/cbc-core/node/message-queue/index.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-core/node/message-queue/injectable-content.d.ts +15 -18
- package/cli/dist-server/types/vendor/cbc-core/node/message-queue/steer-input-buffer-protocol.d.ts +12 -13
- package/cli/dist-server/types/vendor/cbc-core/node/message-queue/steer-input-buffer.d.ts +1 -2
- package/cli/dist-server/types/vendor/cbc-core/node/message-queue/steer-model-input-preparer-protocol.d.ts +13 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/interruption-service.d.ts +11 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-fork-guard.d.ts +2 -1
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-hook-manager.d.ts +2 -2
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-manager.d.ts +9 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-protocol.d.ts +9 -2
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-store.d.ts +3 -3
- package/cli/dist-server/types/vendor/cbc-core/node/trace/trace-turn-gate.d.ts +13 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/error-utils.d.ts +7 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/index.d.ts +2 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/markdown-code-utils.d.ts +15 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/message-content-utils.d.ts +3 -1
- package/cli/dist-server/types/vendor/cbc-core/node/utils/responses-api-utils.d.ts +21 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/session-utils.d.ts +20 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/usage-utils.d.ts +18 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/agent/openai-agents-types.d.ts +3 -1
- package/cli/dist-server/types/vendor/cbc-shared/node/index.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/logging/structured-event-log.d.ts +64 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/model/model-errors.d.ts +10 -0
- package/cli/dist-server/types/workspace/authentication/lib/common/authentication-http-interceptor.d.ts +1 -15
- package/cli/dist-server/types/workspace/authentication/lib/common/authentication-manager.d.ts +13 -0
- package/cli/dist-server/types/workspace/authentication/lib/common/authentication-protocol.d.ts +7 -0
- package/cli/dist-server/types/workspace/authentication/lib/common/authentication-refresh-bypass.d.ts +9 -0
- package/cli/dist-server/types/workspace/authentication/lib/common/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-protocol.d.ts +12 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-service.d.ts +11 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/runner-factory.d.ts +6 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/context/compact-strategy-base.d.ts +17 -5
- package/cli/dist-server/types/workspace/cbc-core/lib/node/context/pre-switch-model.d.ts +34 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/hooks/hook-protocol.d.ts +118 -3
- package/cli/dist-server/types/workspace/cbc-core/lib/node/message-queue/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/message-queue/injectable-content.d.ts +15 -18
- package/cli/dist-server/types/workspace/cbc-core/lib/node/message-queue/steer-input-buffer-protocol.d.ts +12 -13
- package/cli/dist-server/types/workspace/cbc-core/lib/node/message-queue/steer-input-buffer.d.ts +1 -2
- package/cli/dist-server/types/workspace/cbc-core/lib/node/message-queue/steer-model-input-preparer-protocol.d.ts +13 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/interruption-service.d.ts +11 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-fork-guard.d.ts +2 -1
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-hook-manager.d.ts +2 -2
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-manager.d.ts +9 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-protocol.d.ts +9 -2
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-store.d.ts +3 -3
- package/cli/dist-server/types/workspace/cbc-core/lib/node/trace/trace-turn-gate.d.ts +13 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/error-utils.d.ts +7 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/index.d.ts +2 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/markdown-code-utils.d.ts +15 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/message-content-utils.d.ts +3 -1
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/responses-api-utils.d.ts +21 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/session-utils.d.ts +20 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/usage-utils.d.ts +18 -0
- package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-auto-restart.d.ts +2 -2
- package/cli/dist-server/types/workspace/cbc-daemon/lib/node/daemon/daemon-protocol.d.ts +17 -1
- package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/engine/enable-flag.d.ts +28 -24
- package/cli/dist-server/types/workspace/cbc-plugins/lib/node/mods/loader/bootstrap.d.ts +2 -2
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/agent/openai-agents-types.d.ts +3 -1
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/logging/structured-event-log.d.ts +64 -0
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/model/model-errors.d.ts +10 -0
- package/cli/dist-server/types/workspace/core/lib/common/utils/env-utils.d.ts +12 -1
- package/cli/dist-server/types/workspace/product/lib/common/model-catalog/index.d.ts +2 -0
- package/cli/dist-server/types/workspace/product/lib/common/types/features.d.ts +36 -0
- package/cli/dist-server/types/workspace/product/lib/common/types/language-model.d.ts +7 -0
- package/cli/dist-server/types/workspace/sandbox-cli/lib/node/sandbox-center-client.d.ts +1 -1
- package/cli/dist-server/types/workspace/telemetry/lib/common/event/types/craft.d.ts +2 -1
- package/cli/dist-server/types/workspace/telemetry/lib/common/tracing/index.d.ts +2 -2
- package/cli/dist-server/types/workspace/telemetry/lib/common/tracing/otel-env.d.ts +16 -5
- package/cli/dist-server/types/workspace/telemetry/lib/common/tracing/trace-protocol.d.ts +9 -0
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +1 -1
- package/cli/product.internal.json +1 -1
- package/cli/product.ioa.json +1 -1
- package/cli/product.json +1 -1
- package/cli/product.selfhosted.json +1 -1
- package/cli/vendor/shim/node-safe-delete-shim.cjs +20 -3
- package/cli/vendor/shim/sitecustomize.py +17 -4
- package/docs/acp-v2.md +21 -2
- package/docs/client.md +44 -0
- package/docs/errors.md +1 -0
- package/docs/in-process.md +1 -0
- package/lib/agent/v2.js +1 -1
- package/lib/application/services.d.ts +1 -0
- package/lib/application/services.js +1 -1
- package/lib/cli/main.js +3 -3
- package/lib/cli/options.d.ts +2 -1
- package/lib/cli/options.js +4 -2
- package/lib/harness/runtime.js +1 -1
- package/lib/harness/types.d.ts +2 -0
- package/lib/runtime/component-protocol.js +1 -1
- package/package.json +9 -9
|
@@ -38,6 +38,7 @@ export declare class AgentController {
|
|
|
38
38
|
* 本 slot 只归本特性所有且 run() 每轮执行一次,故无需 finally 恢复。
|
|
39
39
|
*/
|
|
40
40
|
private applyCustomPassthroughHeaders;
|
|
41
|
+
private applyPrivateDataStickyFromPrompt;
|
|
41
42
|
/**
|
|
42
43
|
* Filter and keep only custom/extension headers
|
|
43
44
|
* Standard HTTP headers are filtered out
|
|
@@ -9,6 +9,7 @@ export * from './agent-manager';
|
|
|
9
9
|
export * from './exit-planmode-visibility';
|
|
10
10
|
export * from './agent-controller';
|
|
11
11
|
export * from './interceptors';
|
|
12
|
+
export * from './steer-model-input-preparer';
|
|
12
13
|
export * from './stream-json-init-interceptor';
|
|
13
14
|
export * from './memory-context-interceptor';
|
|
14
15
|
export * from './team-context-interceptor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { AgentRunInterceptor, AgentRunInterceptorPriority, AgentRunRequest } from '../../../vendor/cbc-core/node/index.js';
|
|
1
2
|
import { Logger } from '../../../workspace/telemetry/lib/common/index.js';
|
|
2
3
|
import { ImageBlobService } from '../../blob-store';
|
|
3
4
|
import { SettingsManager } from '../../settings';
|
|
4
|
-
import { AgentRunInterceptor, AgentRunInterceptorPriority, AgentRunRequest } from '../../../vendor/cbc-core/node/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* ImageRehydration 拦截器
|
|
7
7
|
*
|
|
@@ -43,5 +43,4 @@ export declare class ImageCompressionAgentRunInterceptor implements AgentRunInte
|
|
|
43
43
|
protected init(): void;
|
|
44
44
|
intercept(request: AgentRunRequest): Promise<void>;
|
|
45
45
|
private compressImagesInMessage;
|
|
46
|
-
private compressInputImageBlock;
|
|
47
46
|
}
|
|
@@ -70,6 +70,7 @@ export declare class SandboxAgentRunInterceptor implements AgentRunInterceptor {
|
|
|
70
70
|
* {@link _startSessionPrepareBarrier} fire-and-forget 调用。
|
|
71
71
|
*/
|
|
72
72
|
private _prepareTurn;
|
|
73
|
+
private enableTrace;
|
|
73
74
|
private syncModifyBackupConfig;
|
|
74
75
|
/** 固化当前轮次的 SandboxTurnConfig 日志快照,避免输出后被下游 interceptor/hook 改写。 */
|
|
75
76
|
private snapshotSandboxTurnConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Session, SteerModelInputPreparer } from '../../vendor/cbc-core/node/index.js';
|
|
2
|
+
import type { AgentInputItem } from '../../vendor/cbc-shared/node/index.js';
|
|
3
|
+
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* steer 插入点的模型输入加工(#140576):与 ImageFilter / ImageCompression 拦截器同一实现,
|
|
6
|
+
* 只作用于模型输入副本,历史保留原图。
|
|
7
|
+
*/
|
|
8
|
+
export declare class SteerModelInputPreparerImpl implements SteerModelInputPreparer {
|
|
9
|
+
protected readonly logger: Logger;
|
|
10
|
+
prepare(session: Session, items: AgentInputItem[]): Promise<void>;
|
|
11
|
+
}
|
|
@@ -124,6 +124,18 @@ export declare class AgentTaskImpl implements AgentTask {
|
|
|
124
124
|
* 也不吃 lastUsed:空白父会话未盖章时 fork 必须跟父身份 / 设为默认,不能变成 chip 记忆。
|
|
125
125
|
*/
|
|
126
126
|
private resolveForkParentAgent;
|
|
127
|
+
/**
|
|
128
|
+
* 跟随 leader 站立模式时,给模式 agent 视图叠加子代理自身的角色指令。
|
|
129
|
+
*
|
|
130
|
+
* 模式 agent(ptc / minimal / create 等)的 instructions 是主会话 system prompt,只负责
|
|
131
|
+
* 工具面与 Code Mode 契约;子代理预设(`--agents` 自定义、内置 Explore 等)的 instructions
|
|
132
|
+
* 才定义「你是谁、做什么、返回什么」。两者都要:模式在前,角色在后。
|
|
133
|
+
*
|
|
134
|
+
* 子代理就是模式自身(如 subagent_type === 'ptc')或预设不可解析时,原样返回。
|
|
135
|
+
* 用 `Object.create(base)` 只覆盖 instructions,tools / model 等沿原型链共享,
|
|
136
|
+
* 与 sandboxScopedAgentView 的视图语义一致(不登记 managed、不写回 agentMap)。
|
|
137
|
+
*/
|
|
138
|
+
private withSubagentRoleInstructions;
|
|
127
139
|
/**
|
|
128
140
|
* Phase 1: One-time setup - session, subscriptions, etc.
|
|
129
141
|
* This only runs once, not repeated during retries
|
|
@@ -96,6 +96,8 @@ export interface SessionHandoffInput {
|
|
|
96
96
|
* 该值会覆盖 inheritFlags 里从 argv 回放出来的陈旧 --permission-mode。
|
|
97
97
|
*/
|
|
98
98
|
permissionMode?: PermissionMode;
|
|
99
|
+
/** 源 Session 已锁定隐私数据时,通过 M5 隐藏参数恢复到 worker。 */
|
|
100
|
+
privateDataSticky?: true;
|
|
99
101
|
/** 用户显式命名 */
|
|
100
102
|
name?: string;
|
|
101
103
|
/**
|
|
@@ -148,6 +150,11 @@ export declare function handOffSessionToBackground(deps: SessionHandoffDeps, inp
|
|
|
148
150
|
* 模式也不会丢。未提供模式时原样返回 inheritFlags。
|
|
149
151
|
*/
|
|
150
152
|
export declare function mergePermissionModeFlag(inheritFlags?: readonly string[], permissionMode?: PermissionMode): string[];
|
|
153
|
+
/**
|
|
154
|
+
* 隐私锁定是无值布尔 flag,不能用会吞掉下一个 token 的键值 flag 替换逻辑。
|
|
155
|
+
* 无论 inheritFlags 是否含旧值,都先剥离,再只对严格 true 追加一次。
|
|
156
|
+
*/
|
|
157
|
+
export declare function mergePrivateDataStickyFlag(inheritFlags: readonly string[], privateDataSticky?: true): string[];
|
|
151
158
|
/**
|
|
152
159
|
* 后台 worker 的启动参数。
|
|
153
160
|
*
|
|
@@ -43,29 +43,29 @@ export declare const ChannelPermissionRequestSchema: z.ZodObject<{
|
|
|
43
43
|
input_preview: z.ZodString;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
45
|
description: string;
|
|
46
|
-
tool_name: string;
|
|
47
46
|
request_id: string;
|
|
47
|
+
tool_name: string;
|
|
48
48
|
input_preview: string;
|
|
49
49
|
}, {
|
|
50
50
|
description: string;
|
|
51
|
-
tool_name: string;
|
|
52
51
|
request_id: string;
|
|
52
|
+
tool_name: string;
|
|
53
53
|
input_preview: string;
|
|
54
54
|
}>;
|
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
56
|
method: "notifications/claude/channel/permission_request";
|
|
57
57
|
params: {
|
|
58
58
|
description: string;
|
|
59
|
-
tool_name: string;
|
|
60
59
|
request_id: string;
|
|
60
|
+
tool_name: string;
|
|
61
61
|
input_preview: string;
|
|
62
62
|
};
|
|
63
63
|
}, {
|
|
64
64
|
method: "notifications/claude/channel/permission_request";
|
|
65
65
|
params: {
|
|
66
66
|
description: string;
|
|
67
|
-
tool_name: string;
|
|
68
67
|
request_id: string;
|
|
68
|
+
tool_name: string;
|
|
69
69
|
input_preview: string;
|
|
70
70
|
};
|
|
71
71
|
}>;
|
|
@@ -75,23 +75,23 @@ export declare const ChannelPermissionResponseSchema: z.ZodObject<{
|
|
|
75
75
|
request_id: z.ZodString;
|
|
76
76
|
behavior: z.ZodEnum<["allow", "allow_always", "deny", "deny_and_exit_plan"]>;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
|
-
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
79
78
|
request_id: string;
|
|
80
|
-
}, {
|
|
81
79
|
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
80
|
+
}, {
|
|
82
81
|
request_id: string;
|
|
82
|
+
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
83
83
|
}>;
|
|
84
84
|
}, "strip", z.ZodTypeAny, {
|
|
85
85
|
method: "notifications/claude/channel/permission";
|
|
86
86
|
params: {
|
|
87
|
-
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
88
87
|
request_id: string;
|
|
88
|
+
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
89
89
|
};
|
|
90
90
|
}, {
|
|
91
91
|
method: "notifications/claude/channel/permission";
|
|
92
92
|
params: {
|
|
93
|
-
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
94
93
|
request_id: string;
|
|
94
|
+
behavior: "allow" | "deny" | "allow_always" | "deny_and_exit_plan";
|
|
95
95
|
};
|
|
96
96
|
}>;
|
|
97
97
|
export type ChannelNotification = z.infer<typeof ChannelNotificationSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Observable } from 'rxjs';
|
|
2
1
|
import { SessionOptions } from '../../vendor/cbc-core/node/index.js';
|
|
2
|
+
import { type Observable } from 'rxjs';
|
|
3
3
|
/**
|
|
4
4
|
* Fields of `SessionOptions` that are set on a per-session basis AND
|
|
5
5
|
* are also accepted as process-level CLI flags (e.g. `--permission-mode`,
|
|
@@ -53,6 +53,8 @@ export declare function resolveCliProcessDefaults(snapshot: {
|
|
|
53
53
|
export type CliSessionInitialOptions = Pick<SessionOptions, 'sessionId' | 'permissionMode' | 'permissionModeBeforePlan' | 'subagentPermissionMode' | 'dangerouslySkipPermissions' | 'model' | 'fallbackModel' | 'textToImageModel' | 'imageToImageModel' | 'tools' | 'allowedTools' | 'disallowedTools' | 'addDir' | 'channels' | 'dangerouslyLoadDevelopmentChannels' | 'mcpConfig' | 'strictMcpConfig' | 'sessionPersistence'> & {
|
|
54
54
|
/** `--agent`:进程默认主 agent。不是 SessionOptions 字段,不摊进 session.options。 */
|
|
55
55
|
agent?: string;
|
|
56
|
+
/** 内部恢复通道;只在显式传入时进入 `/internal/agent` 请求。 */
|
|
57
|
+
privateDataSticky?: true;
|
|
56
58
|
};
|
|
57
59
|
/**
|
|
58
60
|
* Full argv-derived option bag accepted by {@link CliRuntimeOptions.set}.
|
|
@@ -61,6 +63,11 @@ export type CliSessionInitialOptions = Pick<SessionOptions, 'sessionId' | 'permi
|
|
|
61
63
|
* and `serve` through dedicated helpers on `CliRuntimeOptions`.
|
|
62
64
|
*/
|
|
63
65
|
export type CliRuntimeInputOptions = CliSessionInitialOptions & Record<string, unknown>;
|
|
66
|
+
export interface PrivateDataStickyReservation {
|
|
67
|
+
readonly reserved: boolean;
|
|
68
|
+
commit(): void;
|
|
69
|
+
release(): void;
|
|
70
|
+
}
|
|
64
71
|
/**
|
|
65
72
|
* Process-level snapshot of CLI-provided session initialisation options.
|
|
66
73
|
*
|
|
@@ -75,6 +82,7 @@ export type CliRuntimeInputOptions = CliSessionInitialOptions & Record<string, u
|
|
|
75
82
|
*/
|
|
76
83
|
export declare class CliRuntimeOptions {
|
|
77
84
|
private snapshot;
|
|
85
|
+
private privateDataStickyReservation?;
|
|
78
86
|
/**
|
|
79
87
|
* 全量 CLI opts 序列,用于变更去重。
|
|
80
88
|
*
|
|
@@ -114,6 +122,21 @@ export declare class CliRuntimeOptions {
|
|
|
114
122
|
* override this to resolve installation snapshots without starting MCP.
|
|
115
123
|
*/
|
|
116
124
|
isPluginSnapshotOnly(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* 为一次 Session admission 预留进程级隐私恢复标记。
|
|
127
|
+
*
|
|
128
|
+
* 标记只有在 admission 成功后才由 `commit()` 消费;失败调用 `release()` 后,
|
|
129
|
+
* 下一次初始化仍可继承。预留未决期间其他调用会等待,避免持有者失败时另一个
|
|
130
|
+
* Session 无标记穿过。
|
|
131
|
+
*
|
|
132
|
+
* 并发语义(MR 评审 B1 的澄清,2026-09-22):`while` 里的 await 只用来「等待
|
|
133
|
+
* 已有持有者」;循环一旦退出,「判空 → 占位」是同一段同步代码(两者之间没有
|
|
134
|
+
* await),因此不存在两个等待者同时占位、或等待者拿到别人 reservation 的窗口:
|
|
135
|
+
* A 持有 → B/C 一起等 A → A settle 后 B 先同步占位 R_B,C 只能接着等 R_B。
|
|
136
|
+
* 串行是刻意的——一次性标记必须只交付给一个成功 admission 的 Session;而
|
|
137
|
+
* 「持有者永不 settle」这条尾部风险由调用方兜底(见 AcpAgent 的 admission 超时)。
|
|
138
|
+
*/
|
|
139
|
+
reservePrivateDataSticky(): Promise<PrivateDataStickyReservation>;
|
|
117
140
|
/**
|
|
118
141
|
* Whether marketplace and Plugin lifecycle writes are owned by another
|
|
119
142
|
* process. Plugin discovery is cache-first in every runtime; this switch
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SessionHookManager, SessionManager } from '../../vendor/cbc-core/node/index.js';
|
|
2
2
|
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
3
|
+
import { SecurityReviewGate } from '../security-review/protocol';
|
|
3
4
|
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
5
|
export declare class ClearCommandExecutor implements CommandExecutor {
|
|
5
6
|
name: string;
|
|
@@ -8,6 +9,7 @@ export declare class ClearCommandExecutor implements CommandExecutor {
|
|
|
8
9
|
protected readonly sessionManager: SessionManager;
|
|
9
10
|
protected readonly sessionHookManager: SessionHookManager;
|
|
10
11
|
protected readonly logger: Logger;
|
|
12
|
+
protected readonly securityReviewGate?: SecurityReviewGate;
|
|
11
13
|
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
12
14
|
/**
|
|
13
15
|
* Notify ACP clients that session has been reset via session_info_update.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Hook mechanism protocol definitions
|
|
3
3
|
* Compatible with Claude Code hooks specification
|
|
4
4
|
*/
|
|
5
|
-
import type { HookInput } from '../../vendor/cbc-core/node/index.js';
|
|
5
|
+
import type { HookInput, InternalHookContext } from '../../vendor/cbc-core/node/index.js';
|
|
6
6
|
import { HookEvent, type HookExecutionOptions, type HookExecutionResult, type PromptHookResult } from '../../vendor/cbc-shared/node/index.js';
|
|
7
7
|
export { HookBlockedError, HookEvent, NotificationType } from '../../vendor/cbc-shared/node/index.js';
|
|
8
8
|
export type { BackgroundTaskInfo, CronTaskInfo, FinalStopReason, HookBlockingDetail, HookExecutionOptions, HookExecutionResult, HookOutput, HookPermissionMode, PromptHookResult, SessionEndReason, SessionStartSource, } from '../../vendor/cbc-shared/node/index.js';
|
|
@@ -241,7 +241,7 @@ export type HookDefinition = CommandHookDefinition | PromptHookDefinition | Agen
|
|
|
241
241
|
* Input data passed to hook script via stdin
|
|
242
242
|
* Format matches Claude Code hooks specification exactly
|
|
243
243
|
*/
|
|
244
|
-
export type
|
|
244
|
+
export { Hook, type HookInput, HookPriority } from '../../vendor/cbc-core/node/index.js';
|
|
245
245
|
/**
|
|
246
246
|
* Hook Manager interface
|
|
247
247
|
*/
|
|
@@ -255,7 +255,7 @@ export interface HookManager {
|
|
|
255
255
|
* @param options - Execution options (timeout, env, hookEvent for UI, etc)
|
|
256
256
|
* @returns Execution result indicating whether to proceed
|
|
257
257
|
*/
|
|
258
|
-
executeHooks(event: HookEvent, input: HookInput, options?: HookExecutionOptions): Promise<HookExecutionResult>;
|
|
258
|
+
executeHooks(event: HookEvent, input: HookInput, options?: HookExecutionOptions, internalContext?: InternalHookContext): Promise<HookExecutionResult>;
|
|
259
259
|
/**
|
|
260
260
|
* Check if any hooks are configured for an event
|
|
261
261
|
*
|
|
@@ -316,70 +316,6 @@ export interface PromptHookExecuteOptions {
|
|
|
316
316
|
*/
|
|
317
317
|
includeHistory?: boolean;
|
|
318
318
|
}
|
|
319
|
-
/**
|
|
320
|
-
* Internal Hook Provider interface
|
|
321
|
-
*
|
|
322
|
-
* Use @Component(Hook) to register internal hooks that execute
|
|
323
|
-
* alongside external shell hooks in HookManager.executeHooks()
|
|
324
|
-
*
|
|
325
|
-
* @example
|
|
326
|
-
* ```typescript
|
|
327
|
-
* @Component(Hook)
|
|
328
|
-
* export class MyStopHook implements Hook {
|
|
329
|
-
* readonly event = HookEvent.STOP;
|
|
330
|
-
* readonly priority = HookPriority.Normal;
|
|
331
|
-
*
|
|
332
|
-
* async execute(input: HookInput): Promise<HookExecutionResult | undefined> {
|
|
333
|
-
* // Return undefined to skip, or HookExecutionResult to participate
|
|
334
|
-
* return undefined;
|
|
335
|
-
* }
|
|
336
|
-
* }
|
|
337
|
-
* ```
|
|
338
|
-
*/
|
|
339
|
-
export declare const Hook: unique symbol;
|
|
340
|
-
export interface Hook {
|
|
341
|
-
/**
|
|
342
|
-
* Hook event type this hook responds to
|
|
343
|
-
*/
|
|
344
|
-
readonly event: HookEvent;
|
|
345
|
-
/**
|
|
346
|
-
* Priority for execution order (lower = earlier)
|
|
347
|
-
*/
|
|
348
|
-
readonly priority: number;
|
|
349
|
-
/**
|
|
350
|
-
* Optional matcher pattern (regex) for filtering
|
|
351
|
-
* - PreToolUse/PostToolUse: matches tool_name
|
|
352
|
-
* - SessionStart: matches source
|
|
353
|
-
* - SessionEnd: matches reason
|
|
354
|
-
* - Other events: not used
|
|
355
|
-
*/
|
|
356
|
-
readonly matcher?: string;
|
|
357
|
-
/**
|
|
358
|
-
* Execute the hook logic
|
|
359
|
-
*
|
|
360
|
-
* @param input - Hook input data
|
|
361
|
-
* @returns HookExecutionResult or undefined to skip
|
|
362
|
-
*/
|
|
363
|
-
execute(input: HookInput): Promise<HookExecutionResult | undefined>;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Priority levels for internal hooks
|
|
367
|
-
* Lower values execute first
|
|
368
|
-
*/
|
|
369
|
-
export declare enum HookPriority {
|
|
370
|
-
/** Highest priority - runs first */
|
|
371
|
-
Highest = 0,
|
|
372
|
-
/** High priority */
|
|
373
|
-
High = 100,
|
|
374
|
-
/** Structured output processing */
|
|
375
|
-
StructuredOutput = 200,
|
|
376
|
-
/** Normal priority - default */
|
|
377
|
-
Normal = 500,
|
|
378
|
-
/** Low priority */
|
|
379
|
-
Low = 800,
|
|
380
|
-
/** Lowest priority - runs last */
|
|
381
|
-
Lowest = 1000
|
|
382
|
-
}
|
|
383
319
|
/**
|
|
384
320
|
* HookInputProcessor enriches HookInput before hooks are dispatched.
|
|
385
321
|
*
|
|
@@ -4,6 +4,9 @@ import { Server } from 'http';
|
|
|
4
4
|
import { EndpointProvider } from './server-protocol';
|
|
5
5
|
export declare class EndpointProviderImpl implements EndpointProvider, ServerAware {
|
|
6
6
|
protected endpointDeferred: Deferred<string>;
|
|
7
|
+
protected listenFailedDeferred: Deferred<Error>;
|
|
7
8
|
get(): Promise<string>;
|
|
9
|
+
whenListenFailed(): Promise<Error>;
|
|
8
10
|
setServer(server: Server): Promise<void>;
|
|
11
|
+
protected resolveEndpoint(server: Server): Promise<void>;
|
|
9
12
|
}
|
|
@@ -2,6 +2,11 @@ import { SessionOptions } from '../../vendor/cbc-core/node/index.js';
|
|
|
2
2
|
export declare const EndpointProvider: unique symbol;
|
|
3
3
|
export interface EndpointProvider {
|
|
4
4
|
get(): Promise<string>;
|
|
5
|
+
/**
|
|
6
|
+
* HTTP server 绑定失败(如 EADDRINUSE)时 resolve 为该错误;成功时永不 settle。
|
|
7
|
+
* get() 在绑定失败时仍保持 pending(既有语义),需要快速失败的调用方自行 race。
|
|
8
|
+
*/
|
|
9
|
+
whenListenFailed?(): Promise<Error>;
|
|
5
10
|
}
|
|
6
11
|
export interface CommonRequest extends SessionOptions {
|
|
7
12
|
/**
|
|
@@ -14,6 +19,8 @@ export interface CommonRequest extends SessionOptions {
|
|
|
14
19
|
debugToStderr?: boolean;
|
|
15
20
|
/** Automatically connect to a single available IDE on startup. */
|
|
16
21
|
ide?: boolean;
|
|
22
|
+
/** 内部恢复通道;只接受 true,SessionMiddleware 会在合并 options 前剥离。 */
|
|
23
|
+
privateDataSticky?: true;
|
|
17
24
|
}
|
|
18
25
|
export interface ResumeRequest {
|
|
19
26
|
resume: boolean | string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Session } from '../../vendor/cbc-core/node/index.js';
|
|
1
2
|
export declare const MemoryRelevanceService: unique symbol;
|
|
2
3
|
/**
|
|
3
4
|
* 相关记忆信息
|
|
@@ -23,9 +24,13 @@ export interface MemoryRelevanceService {
|
|
|
23
24
|
* @param recentTools 最近使用的工具名称列表
|
|
24
25
|
* @param alreadySurfaced 已经展示过的记忆路径集合
|
|
25
26
|
* @param signal 中断信号
|
|
27
|
+
* @param parentSession 触发本次选择的会话。实现会新建一个临时 session 作为
|
|
28
|
+
* runOneTime 的 context,该临时 session 不走 AgentService
|
|
29
|
+
* 「从当前会话继承」分支,必须由调用方显式传入父会话才能
|
|
30
|
+
* 继承会话级隐私锁定位(X-Private-Data)。
|
|
26
31
|
* @returns 相关记忆列表(最多 5 个)
|
|
27
32
|
*/
|
|
28
|
-
selectRelevantMemories(query: string, memoryDir: string, recentTools?: readonly string[], alreadySurfaced?: ReadonlySet<string>, signal?: AbortSignal): Promise<RelevantMemory[]>;
|
|
33
|
+
selectRelevantMemories(query: string, memoryDir: string, recentTools?: readonly string[], alreadySurfaced?: ReadonlySet<string>, signal?: AbortSignal, parentSession?: Session): Promise<RelevantMemory[]>;
|
|
29
34
|
/**
|
|
30
35
|
* 检查功能是否启用
|
|
31
36
|
*/
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* - 轻量单次调用,不需要对话历史
|
|
6
6
|
* - 返回最多 5 个相关记忆
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import type { Session } from '../../vendor/cbc-core/node/index.js';
|
|
9
9
|
import { SessionManager } from '../../vendor/cbc-core/node/index.js';
|
|
10
|
+
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
10
11
|
import { SettingsManager } from '../settings';
|
|
11
12
|
import { MemoryRelevanceService, RelevantMemory } from './memory-relevance-protocol';
|
|
12
13
|
export declare class MemoryRelevanceServiceImpl implements MemoryRelevanceService {
|
|
@@ -15,7 +16,7 @@ export declare class MemoryRelevanceServiceImpl implements MemoryRelevanceServic
|
|
|
15
16
|
protected readonly logger: Logger;
|
|
16
17
|
protected init(): void;
|
|
17
18
|
isEnabled(): Promise<boolean>;
|
|
18
|
-
selectRelevantMemories(query: string, memoryDir: string, recentTools?: readonly string[], alreadySurfaced?: ReadonlySet<string>, signal?: AbortSignal): Promise<RelevantMemory[]>;
|
|
19
|
+
selectRelevantMemories(query: string, memoryDir: string, recentTools?: readonly string[], alreadySurfaced?: ReadonlySet<string>, signal?: AbortSignal, parentSession?: Session): Promise<RelevantMemory[]>;
|
|
19
20
|
/**
|
|
20
21
|
* 使用 memorySelector agent 进行 AI 语义匹配
|
|
21
22
|
*
|
|
@@ -11,6 +11,8 @@ export interface ModelErrorAnalyzer {
|
|
|
11
11
|
analyze(error: unknown, axiosConfig: any): Promise<Response>;
|
|
12
12
|
createErrorResponse(body: string, status: number, statusText: string, headers?: Record<string, string>): Response;
|
|
13
13
|
}
|
|
14
|
+
/** Request body shape: chat completions `messages`, or Responses API `input` (pi `api`). */
|
|
15
|
+
export type ModelRequestWire = 'chat-completions' | 'responses';
|
|
14
16
|
export interface ModelRequestProcessor {
|
|
15
17
|
/**
|
|
16
18
|
* Priority of the processor. Lower values execute first.
|
|
@@ -18,5 +20,7 @@ export interface ModelRequestProcessor {
|
|
|
18
20
|
* to ensure it runs after all other processors that need to access the raw body.
|
|
19
21
|
*/
|
|
20
22
|
priority?: number;
|
|
23
|
+
/** Wires whose bodies the processor understands; every wire when omitted. */
|
|
24
|
+
readonly wires?: readonly ModelRequestWire[];
|
|
21
25
|
process(axiosConfig: any): Promise<void>;
|
|
22
26
|
}
|
|
@@ -5,6 +5,7 @@ export declare class SecurityReviewGateImpl implements SecurityReviewGateContrac
|
|
|
5
5
|
private readonly pendingPolicies;
|
|
6
6
|
private readonly policies;
|
|
7
7
|
setSessionConfig(session: Session, rawConfig: unknown): TurnSecurityReviewPolicy;
|
|
8
|
+
inheritSessionConfig(source: Session, target: Session): void;
|
|
8
9
|
beginTurn(session: Session): TurnSecurityReviewPolicy;
|
|
9
10
|
getTurnPolicy(session: Session): TurnSecurityReviewPolicy;
|
|
10
11
|
isModelBehaviorReviewEnabled(session: Session): boolean;
|
|
@@ -6,6 +6,8 @@ export declare function isToolRiskApprovalEnabled(policy: TurnSecurityReviewPoli
|
|
|
6
6
|
export declare const SecurityReviewGate: unique symbol;
|
|
7
7
|
export interface SecurityReviewGate {
|
|
8
8
|
setSessionConfig(session: Session, rawConfig: unknown): TurnSecurityReviewPolicy;
|
|
9
|
+
/** Carry standing host configuration across /clear, never the old turn policy. */
|
|
10
|
+
inheritSessionConfig(source: Session, target: Session): void;
|
|
9
11
|
beginTurn(session: Session): TurnSecurityReviewPolicy;
|
|
10
12
|
getTurnPolicy(session: Session): TurnSecurityReviewPolicy;
|
|
11
13
|
isModelBehaviorReviewEnabled(session: Session): boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CoreHookExecutor, type HookInput, type Session, SessionHookHost } from '../../vendor/cbc-core/node/index.js';
|
|
1
|
+
import { CoreHookExecutor, type HookInput, type InternalHookContext, type Session, SessionHookHost } from '../../vendor/cbc-core/node/index.js';
|
|
2
2
|
import type { HookEvent, HookExecutionOptions, HookExecutionResult, NotificationType } from '../../vendor/cbc-shared/node/index.js';
|
|
3
3
|
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
4
4
|
import { HookManager } from '../hooks/hook-protocol';
|
|
5
5
|
import { TerminalNotificationService } from '../notification/notification-protocol';
|
|
6
6
|
export declare class CoreHookExecutorAdapter implements CoreHookExecutor {
|
|
7
7
|
protected readonly hooks: HookManager;
|
|
8
|
-
executeHooks(event: HookEvent, input: HookInput, options?: HookExecutionOptions): Promise<HookExecutionResult>;
|
|
8
|
+
executeHooks(event: HookEvent, input: HookInput, options?: HookExecutionOptions, internalContext?: InternalHookContext): Promise<HookExecutionResult>;
|
|
9
9
|
hasHooks(event: HookEvent, toolName?: string): Promise<boolean>;
|
|
10
10
|
}
|
|
11
11
|
export declare class SessionHookHostAdapter implements SessionHookHost {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { AgentManager,
|
|
1
|
+
import { AgentManager, SessionManager, SessionRunStateMachine } from '../../vendor/cbc-core/node/index.js';
|
|
2
2
|
import { CliSettingsProvider } from './cli-settings-provider';
|
|
3
3
|
import { type CurrentSessionModelTransition as CurrentSessionModelTransitionContract, type CurrentSessionModelTransitionResult } from './current-session-model-transition-protocol';
|
|
4
4
|
import { SettingsManager } from './settings-protocol';
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* CLI `/model` 的当前会话切换。切换立即生效,不在这里压缩。
|
|
7
|
+
* 若新模型窗口放不下,下一次预压缩按新模型的阈值触发,并用切换前的模型做摘要。
|
|
8
|
+
*/
|
|
6
9
|
export declare class CurrentSessionModelTransitionImpl implements CurrentSessionModelTransitionContract {
|
|
7
10
|
protected readonly agentManager: AgentManager;
|
|
8
11
|
protected readonly sessionManager: SessionManager;
|
|
9
12
|
protected readonly stateMachine: SessionRunStateMachine;
|
|
10
13
|
protected readonly settingsManager: SettingsManager;
|
|
11
14
|
protected readonly cliSettingsProvider: CliSettingsProvider;
|
|
12
|
-
protected readonly manualCompactRequestHandler: ManualCompactRequestHandlerContract;
|
|
13
15
|
transition(input: Parameters<CurrentSessionModelTransitionContract['transition']>[0]): Promise<CurrentSessionModelTransitionResult>;
|
|
14
|
-
private getModelInputHistory;
|
|
15
16
|
}
|
|
@@ -105,6 +105,8 @@ export declare const ENV_KEY_CODEBUDDY_WAIT_FOR_MCP_SERVERS_ENABLED = "CODEBUDDY
|
|
|
105
105
|
export declare const ENV_KEY_CODEBUDDY_REPORT_FINDINGS_ENABLED = "CODEBUDDY_REPORT_FINDINGS_ENABLED";
|
|
106
106
|
export declare const ENV_KEY_CODEBUDDY_MONITOR_ENABLED = "CODEBUDDY_MONITOR_ENABLED";
|
|
107
107
|
export declare const ENV_KEY_CODEBUDDY_DISABLE_HOT_RELOAD = "CODEBUDDY_DISABLE_HOT_RELOAD";
|
|
108
|
+
/** Turns sensitive data protection off for the process without touching the shared settings.json (wb rollout). */
|
|
109
|
+
export declare const ENV_KEY_CODEBUDDY_DISABLE_SENSITIVE_PROTECTION = "CODEBUDDY_DISABLE_SENSITIVE_PROTECTION";
|
|
108
110
|
/**
|
|
109
111
|
* `--setting-sources` 的进程级注册通道(同一套语法:'user,project,local' /
|
|
110
112
|
* 'none')。供无 argv 形态(@tencent-ai/agent-cli/server 库模式)使用:served
|
|
@@ -11,11 +11,11 @@ declare const A2ACancelTaskParameters: z.ZodObject<{
|
|
|
11
11
|
agent_id: z.ZodString;
|
|
12
12
|
task_id: z.ZodString;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
agent_id: string;
|
|
15
14
|
task_id: string;
|
|
16
|
-
}, {
|
|
17
15
|
agent_id: string;
|
|
16
|
+
}, {
|
|
18
17
|
task_id: string;
|
|
18
|
+
agent_id: string;
|
|
19
19
|
}>;
|
|
20
20
|
/**
|
|
21
21
|
* A2ACancelTask — request cancellation of a previously created A2A task
|
|
@@ -40,11 +40,11 @@ export declare class A2ACancelTaskTool extends BaseTool implements Tool {
|
|
|
40
40
|
agent_id: z.ZodString;
|
|
41
41
|
task_id: z.ZodString;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
agent_id: string;
|
|
44
43
|
task_id: string;
|
|
45
|
-
}, {
|
|
46
44
|
agent_id: string;
|
|
45
|
+
}, {
|
|
47
46
|
task_id: string;
|
|
47
|
+
agent_id: string;
|
|
48
48
|
}>;
|
|
49
49
|
argumentRenderer: ToolCallArgumentRenderer;
|
|
50
50
|
isEnabled: (args: {
|
|
@@ -12,11 +12,11 @@ declare const A2AGetTaskParameters: z.ZodObject<{
|
|
|
12
12
|
agent_id: z.ZodString;
|
|
13
13
|
task_id: z.ZodString;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
agent_id: string;
|
|
16
15
|
task_id: string;
|
|
17
|
-
}, {
|
|
18
16
|
agent_id: string;
|
|
17
|
+
}, {
|
|
19
18
|
task_id: string;
|
|
19
|
+
agent_id: string;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const ENV_POLL_INTERVAL_MS = "CODEBUDDY_A2A_POLL_INTERVAL_MS";
|
|
22
22
|
export declare const ENV_POLL_MAX_DURATION_MS = "CODEBUDDY_A2A_POLL_MAX_DURATION_MS";
|
|
@@ -128,11 +128,11 @@ export declare class A2AGetTaskTool extends BaseTool implements Tool {
|
|
|
128
128
|
agent_id: z.ZodString;
|
|
129
129
|
task_id: z.ZodString;
|
|
130
130
|
}, "strip", z.ZodTypeAny, {
|
|
131
|
-
agent_id: string;
|
|
132
131
|
task_id: string;
|
|
133
|
-
}, {
|
|
134
132
|
agent_id: string;
|
|
133
|
+
}, {
|
|
135
134
|
task_id: string;
|
|
135
|
+
agent_id: string;
|
|
136
136
|
}>;
|
|
137
137
|
argumentRenderer: ToolCallArgumentRenderer;
|
|
138
138
|
isEnabled: (args: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
2
2
|
import { Agent, ToolNames } from '../../vendor/cbc-shared/node/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ProductManager } from '../../workspace/product/lib/common/index.js';
|
|
4
4
|
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
5
5
|
import type { RunContext } from '@openai/agents';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -27,7 +27,6 @@ declare const AudioTranscribeParameters: z.ZodObject<{
|
|
|
27
27
|
export declare class AudioTranscribeTool extends BaseTool implements Tool {
|
|
28
28
|
protected readonly audioTranscribeService: AudioTranscribeService;
|
|
29
29
|
protected readonly productManager: ProductManager;
|
|
30
|
-
protected readonly abTestService?: AbTestService;
|
|
31
30
|
protected readonly logger: Logger;
|
|
32
31
|
name: ToolNames;
|
|
33
32
|
description: string;
|
|
@@ -123,6 +123,8 @@ export declare class GrepTool extends BaseTool implements Tool {
|
|
|
123
123
|
* 根据有效的上下文或行号选项推断 content 模式。
|
|
124
124
|
*/
|
|
125
125
|
private normalizeGrepParams;
|
|
126
|
+
/** 仅对正则语法错误尝试转义失衡括号,其余错误(路径、权限、超时、中断)保持原样。 */
|
|
127
|
+
private repairRejectedPattern;
|
|
126
128
|
/**
|
|
127
129
|
* 将底层异常映射到 search_content 细分错误码:
|
|
128
130
|
* 权限(EACCES/EPERM) → 7104;路径(ENOENT/ENOTDIR) → 7101;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { RestOperations } from '@celljs/http';
|
|
2
2
|
import { AuthenticationManager } from '../../workspace/authentication/lib/common/index.js';
|
|
3
|
+
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
3
4
|
import { LanguageModel, ProductConfiguration, ProductManager } from '../../workspace/product/lib/common/index.js';
|
|
4
5
|
import { Logger } from '../../workspace/telemetry/lib/common/index.js';
|
|
5
6
|
import type { RunContext } from '@openai/agents';
|
|
6
|
-
import { Session } from '../../vendor/cbc-core/node/index.js';
|
|
7
7
|
import { SettingsManager } from '../settings';
|
|
8
|
+
import { MediaFileWriter } from './media-file-writer';
|
|
8
9
|
import { EditImageParams, GenerateImageParams, ImageGenData, type ImageGenerationResult, ImageService } from './tool-protocol';
|
|
9
10
|
/**
|
|
10
11
|
* 图片服务实现
|
|
@@ -16,6 +17,7 @@ export declare class ImageServiceImpl implements ImageService {
|
|
|
16
17
|
protected readonly productManager: ProductManager;
|
|
17
18
|
protected readonly logger: Logger;
|
|
18
19
|
protected readonly settingsManager: SettingsManager;
|
|
20
|
+
protected readonly mediaFileWriter: MediaFileWriter;
|
|
19
21
|
private outputDir;
|
|
20
22
|
/**
|
|
21
23
|
* 初始化输出目录
|
|
@@ -47,6 +47,7 @@ export * from './tool-always-approval-service';
|
|
|
47
47
|
export * from './tool-hook-manager';
|
|
48
48
|
export * from './tool-permission-service';
|
|
49
49
|
export * from './sandbox-write-rule-guard';
|
|
50
|
+
export * from './media-file-writer';
|
|
50
51
|
export * from './ask-user-question-tool';
|
|
51
52
|
export * from './ask-user-for-structured-input-tool';
|
|
52
53
|
export * from './lsp-tool';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Logger } from '@celljs/core';
|
|
2
|
+
import { type ISandboxCLILifecycle } from '../sandbox-cli/sandbox-cli-lifecycle-protocol';
|
|
3
|
+
import { SandboxTurnConfig } from '../sandbox-cli/sandbox-turn-config';
|
|
4
|
+
import { SandboxCenterIpcClient } from '../sensitive-content/sandbox-center-ipc-client-protocol';
|
|
5
|
+
/** 媒体产物只接文件备份,不参与路径和网络权限裁决。 */
|
|
6
|
+
export declare class MediaFileWriter {
|
|
7
|
+
protected readonly turnConfig?: SandboxTurnConfig;
|
|
8
|
+
protected readonly lifecycle?: ISandboxCLILifecycle;
|
|
9
|
+
protected readonly centerClient?: SandboxCenterIpcClient;
|
|
10
|
+
protected readonly logger: Logger;
|
|
11
|
+
writeFile(filePath: string, data: Buffer): Promise<void>;
|
|
12
|
+
}
|