refactor(acp): migrate to @agentclientprotocol/sdk and clean up handlers

- Replace deprecated ACP session manager with new SDK integration
- Add acpFileHandler test coverage
- Remove obsolete acpMessageHandler and acpSessionManager
- Update type definitions and connection handlers
- Apply code formatting fixes

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mingholy.lmh 2026-03-05 19:05:48 +08:00
parent 180dcd8b36
commit c044d4dba1
28 changed files with 959 additions and 1959 deletions

View file

@ -48,10 +48,11 @@ export class AcpFileHandler {
`[ACP] Successfully read file: ${params.path} (${content.length} bytes)`,
);
// Handle line offset and limit
// Handle line offset and limit.
// ACP spec: `line` is 1-based (first line = 1).
if (params.line !== null || params.limit !== null) {
const lines = content.split('\n');
const startLine = params.line || 0;
const startLine = Math.max(0, (params.line ?? 1) - 1);
const endLine = params.limit ? startLine + params.limit : lines.length;
const selectedLines = lines.slice(startLine, endLine);
const result = { content: selectedLines.join('\n') };