refactor(acp): migrate ACP integration to use @agentclientprotocol/sdk

- Remove acp.ts and schema.ts in favor of SDK types
- Refactor acpAgent.ts to leverage SDK client
- Update session management types and implementations
- Adjust all test cases for new SDK-based architecture
- Update integration tests and export utilities

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mingholy.lmh 2026-03-03 20:27:13 +08:00
parent 79adac930f
commit 180dcd8b36
21 changed files with 421 additions and 1709 deletions

View file

@ -23,7 +23,7 @@ import {
ToolConfirmationOutcome,
TodoWriteTool,
} from '@qwen-code/qwen-code-core';
import type * as acp from '../acp.js';
import type { AgentSideConnection } from '@agentclientprotocol/sdk';
import { EventEmitter } from 'node:events';
// Helper to create a mock SubAgentToolCallEvent with required fields
@ -116,7 +116,7 @@ function createStreamTextEvent(
describe('SubAgentTracker', () => {
let mockContext: SessionContext;
let mockClient: acp.Client;
let mockClient: AgentSideConnection;
let sendUpdateSpy: ReturnType<typeof vi.fn>;
let requestPermissionSpy: ReturnType<typeof vi.fn>;
let tracker: SubAgentTracker;
@ -143,7 +143,7 @@ describe('SubAgentTracker', () => {
mockClient = {
requestPermission: requestPermissionSpy,
} as unknown as acp.Client;
} as unknown as AgentSideConnection;
tracker = new SubAgentTracker(
mockContext,