Skip to content

Commit cb49614

Browse files
committed
feat: add ACP (Agent Client Protocol) server mode and update dependencies
1 parent f0e9f51 commit cb49614

4 files changed

Lines changed: 709 additions & 1 deletion

File tree

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"scripts"
4848
],
4949
"dependencies": {
50+
"@agentclientprotocol/sdk": "^0.14.1",
5051
"ssh2": "^1.17.0",
5152
"ws": "^8.14.2"
5253
},

source/cli.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ process.emitWarning = function (warning: any, ...args: any[]) {
9191
const args = process.argv.slice(2);
9292
const isQuickCommand = args.some(
9393
arg =>
94-
arg === '--version' || arg === '-v' || arg === '--help' || arg === '-h',
94+
arg === '--version' ||
95+
arg === '-v' ||
96+
arg === '--help' ||
97+
arg === '-h' ||
98+
arg === '--acp' ||
99+
arg === '--sse' ||
100+
arg === '--sse-daemon',
95101
);
96102

97103
// Show loading indicator only for non-quick commands
@@ -216,6 +222,8 @@ Options
216222
--sse-port SSE server port (default: 3000)
217223
--sse-timeout SSE server interaction timeout in milliseconds (default: 300000, i.e. 5 minutes)
218224
--work-dir Working directory for SSE server (default: current directory)
225+
--acp Start ACP (Agent Client Protocol) server mode for external integration
226+
Uses stdin/stdout for JSON-RPC 2.0 communication
219227
`,
220228
{
221229
importMeta: import.meta,
@@ -297,6 +305,10 @@ Options
297305
type: 'string',
298306
alias: 'work-dir',
299307
},
308+
acp: {
309+
type: 'boolean',
310+
default: false,
311+
},
300312
},
301313
},
302314
);
@@ -490,6 +502,15 @@ if (cli.flags.sse) {
490502
}
491503
}
492504

505+
// Handle ACP (Agent Client Protocol) server mode
506+
if (cli.flags.acp) {
507+
const {acpManager} = await import('./utils/acp/acpManager.js');
508+
509+
// Start ACP server with stdin/stdout
510+
await acpManager.start(process.stdin, process.stdout);
511+
process.exit(0);
512+
}
513+
493514
// Handle task creation - create and execute in background
494515
if (cli.flags.task) {
495516
const {taskManager} = await import('./utils/task/taskManager.js');

0 commit comments

Comments
 (0)