@sudocode-ai/claude-code-acp 0.13.5 → 0.13.7
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/dist/acp-agent.d.ts +26 -2
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +72 -17
- package/dist/index.js +0 -0
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +48 -4
- package/dist/tools.d.ts +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +68 -7
- package/package.json +11 -11
package/dist/acp-agent.d.ts
CHANGED
|
@@ -27,6 +27,17 @@ type CompactionState = {
|
|
|
27
27
|
/** Whether a compaction is currently in progress */
|
|
28
28
|
isCompacting: boolean;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Information about a skill available in the session.
|
|
32
|
+
*/
|
|
33
|
+
export type SkillInfo = {
|
|
34
|
+
/** Skill name */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Skill description */
|
|
37
|
+
description?: string;
|
|
38
|
+
/** Source of the skill */
|
|
39
|
+
source?: "user" | "project" | "plugin";
|
|
40
|
+
};
|
|
30
41
|
type Session = {
|
|
31
42
|
query: Query;
|
|
32
43
|
input: Pushable<SDKUserMessage>;
|
|
@@ -39,6 +50,8 @@ type Session = {
|
|
|
39
50
|
sessionFilePath?: string;
|
|
40
51
|
/** Auto-compaction state tracking */
|
|
41
52
|
compaction: CompactionState;
|
|
53
|
+
/** Skills loaded for this session (populated from SDK init message) */
|
|
54
|
+
skills?: SkillInfo[];
|
|
42
55
|
};
|
|
43
56
|
type BackgroundTerminal = {
|
|
44
57
|
handle: TerminalHandle;
|
|
@@ -105,12 +118,12 @@ export type ToolUpdateMeta = {
|
|
|
105
118
|
toolResponse?: unknown;
|
|
106
119
|
};
|
|
107
120
|
};
|
|
108
|
-
type ToolUseCache = {
|
|
121
|
+
export type ToolUseCache = {
|
|
109
122
|
[key: string]: {
|
|
110
123
|
type: "tool_use" | "server_tool_use" | "mcp_tool_use";
|
|
111
124
|
id: string;
|
|
112
125
|
name: string;
|
|
113
|
-
input:
|
|
126
|
+
input: unknown;
|
|
114
127
|
};
|
|
115
128
|
};
|
|
116
129
|
export declare class ClaudeAcpAgent implements Agent {
|
|
@@ -182,6 +195,7 @@ export declare class ClaudeAcpAgent implements Agent {
|
|
|
182
195
|
* - `_session/inject`: Inject a message into an active session mid-execution
|
|
183
196
|
* - `_session/flush`: Flush a session to disk for fork-with-flush support
|
|
184
197
|
* - `_session/setCompaction`: Configure automatic context compaction for a session
|
|
198
|
+
* - `_session/listSkills`: List available skills for a session
|
|
185
199
|
*/
|
|
186
200
|
extMethod(method: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
187
201
|
/**
|
|
@@ -215,6 +229,16 @@ export declare class ClaudeAcpAgent implements Agent {
|
|
|
215
229
|
* @returns Success status and any error message
|
|
216
230
|
*/
|
|
217
231
|
private handleSessionSetCompaction;
|
|
232
|
+
/**
|
|
233
|
+
* List available skills for a session.
|
|
234
|
+
*
|
|
235
|
+
* Skills are loaded based on the session's settingSources and plugins configuration.
|
|
236
|
+
* This method returns the skills that were discovered during session initialization.
|
|
237
|
+
*
|
|
238
|
+
* @param params.sessionId - The session to query skills for
|
|
239
|
+
* @returns Success status, skills array, and any error message
|
|
240
|
+
*/
|
|
241
|
+
private handleSessionListSkills;
|
|
218
242
|
/**
|
|
219
243
|
* Flush a session to disk by aborting its query subprocess.
|
|
220
244
|
*
|
package/dist/acp-agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,mBAAmB,EACnB,mBAAmB,EAEnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EAEnB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAEpB,oBAAoB,EACpB,qBAAqB,EAErB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAEV,OAAO,EACP,cAAc,EACd,KAAK,EAEL,0BAA0B,EAC1B,cAAc,EACf,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAwC,QAAQ,EAAe,MAAM,YAAY,CAAC;AAYzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,mBAAmB,EACnB,mBAAmB,EAEnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EAEnB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAEpB,oBAAoB,EACpB,qBAAqB,EAErB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,UAAU,EAEV,OAA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3B,MAAM,EAAE,MAAM,GACb,mBAAmB,EAAE,CAsKvB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,MAAM,GACb,mBAAmB,EAAE,CAgCvB;AAED,wBAAgB,MAAM,SAMrB"}
|
package/dist/acp-agent.js
CHANGED
|
@@ -10,6 +10,7 @@ import { EDIT_TOOL_NAMES, acpToolNames } from "./tools.js";
|
|
|
10
10
|
import { toolInfoFromToolUse, planEntries, toolUpdateFromToolResult, registerHookCallback, createPostToolUseHook, createPreToolUseHook, } from "./tools.js";
|
|
11
11
|
import packageJson from "../package.json" with { type: "json" };
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
13
14
|
export const CLAUDE_CONFIG_DIR = process.env.CLAUDE ?? path.join(os.homedir(), ".claude");
|
|
14
15
|
// Bypass Permissions doesn't work if we are a root/sudo user
|
|
15
16
|
const IS_ROOT = (process.geteuid?.() ?? process.getuid?.()) === 0;
|
|
@@ -31,16 +32,16 @@ export class ClaudeAcpAgent {
|
|
|
31
32
|
id: "claude-login",
|
|
32
33
|
};
|
|
33
34
|
// If client supports terminal-auth capability, use that instead.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
if (request.clientCapabilities?._meta?.["terminal-auth"] === true) {
|
|
36
|
+
const cliPath = fileURLToPath(import.meta.resolve("@anthropic-ai/claude-agent-sdk/cli.js"));
|
|
37
|
+
authMethod._meta = {
|
|
38
|
+
"terminal-auth": {
|
|
39
|
+
command: "node",
|
|
40
|
+
args: [cliPath, "/login"],
|
|
41
|
+
label: "Claude Code Login",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
44
45
|
return {
|
|
45
46
|
protocolVersion: 1,
|
|
46
47
|
agentCapabilities: {
|
|
@@ -364,8 +365,18 @@ export class ClaudeAcpAgent {
|
|
|
364
365
|
switch (message.type) {
|
|
365
366
|
case "system":
|
|
366
367
|
switch (message.subtype) {
|
|
367
|
-
case "init":
|
|
368
|
+
case "init": {
|
|
369
|
+
// Capture skills from the SDK init message if available
|
|
370
|
+
const session = this.sessions[params.sessionId];
|
|
371
|
+
if (session && message.skills) {
|
|
372
|
+
session.skills = message.skills.map((s) => ({
|
|
373
|
+
name: s.name ?? s,
|
|
374
|
+
description: s.description,
|
|
375
|
+
source: s.source,
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
368
378
|
break;
|
|
379
|
+
}
|
|
369
380
|
case "compact_boundary": {
|
|
370
381
|
// Reset token count after compaction
|
|
371
382
|
const session = this.sessions[params.sessionId];
|
|
@@ -386,6 +397,9 @@ export class ClaudeAcpAgent {
|
|
|
386
397
|
}
|
|
387
398
|
break;
|
|
388
399
|
}
|
|
400
|
+
case "hook_started":
|
|
401
|
+
case "task_notification":
|
|
402
|
+
case "hook_progress":
|
|
389
403
|
case "hook_response":
|
|
390
404
|
case "status":
|
|
391
405
|
// Todo: process via status api: https://docs.claude.com/en/docs/claude-code/hooks#hook-output
|
|
@@ -417,7 +431,7 @@ export class ClaudeAcpAgent {
|
|
|
417
431
|
throw RequestError.internalError(undefined, message.result);
|
|
418
432
|
}
|
|
419
433
|
// Check if auto-compaction should be triggered
|
|
420
|
-
if (session && await this.shouldTriggerCompaction(params.sessionId)) {
|
|
434
|
+
if (session && (await this.shouldTriggerCompaction(params.sessionId))) {
|
|
421
435
|
await this.triggerAutoCompaction(params.sessionId);
|
|
422
436
|
// Continue processing - the compaction will happen in the background
|
|
423
437
|
}
|
|
@@ -456,6 +470,14 @@ export class ClaudeAcpAgent {
|
|
|
456
470
|
// their own docs: https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-slash-commands#%2Fcompact-compact-conversation-history
|
|
457
471
|
if (typeof message.message.content === "string" &&
|
|
458
472
|
message.message.content.includes("<local-command-stdout>")) {
|
|
473
|
+
// Handle /context by sending its reply as regular agent message.
|
|
474
|
+
if (message.message.content.includes("Context Usage")) {
|
|
475
|
+
for (const notification of toAcpNotifications(message.message.content
|
|
476
|
+
.replace("<local-command-stdout>", "")
|
|
477
|
+
.replace("</local-command-stdout>", ""), "assistant", params.sessionId, this.toolUseCache, this.client, this.logger)) {
|
|
478
|
+
await this.client.sessionUpdate(notification);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
459
481
|
this.logger.log(message.message.content);
|
|
460
482
|
break;
|
|
461
483
|
}
|
|
@@ -490,6 +512,7 @@ export class ClaudeAcpAgent {
|
|
|
490
512
|
break;
|
|
491
513
|
}
|
|
492
514
|
case "tool_progress":
|
|
515
|
+
case "tool_use_summary":
|
|
493
516
|
break;
|
|
494
517
|
case "auth_status":
|
|
495
518
|
break;
|
|
@@ -514,6 +537,7 @@ export class ClaudeAcpAgent {
|
|
|
514
537
|
* - `_session/inject`: Inject a message into an active session mid-execution
|
|
515
538
|
* - `_session/flush`: Flush a session to disk for fork-with-flush support
|
|
516
539
|
* - `_session/setCompaction`: Configure automatic context compaction for a session
|
|
540
|
+
* - `_session/listSkills`: List available skills for a session
|
|
517
541
|
*/
|
|
518
542
|
async extMethod(method, params) {
|
|
519
543
|
if (method === "_session/inject") {
|
|
@@ -525,6 +549,9 @@ export class ClaudeAcpAgent {
|
|
|
525
549
|
if (method === "_session/setCompaction") {
|
|
526
550
|
return this.handleSessionSetCompaction(params);
|
|
527
551
|
}
|
|
552
|
+
if (method === "_session/listSkills") {
|
|
553
|
+
return this.handleSessionListSkills(params);
|
|
554
|
+
}
|
|
528
555
|
throw RequestError.methodNotFound(method);
|
|
529
556
|
}
|
|
530
557
|
/**
|
|
@@ -608,6 +635,32 @@ export class ClaudeAcpAgent {
|
|
|
608
635
|
return { success: false, error: String(error) };
|
|
609
636
|
}
|
|
610
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* List available skills for a session.
|
|
640
|
+
*
|
|
641
|
+
* Skills are loaded based on the session's settingSources and plugins configuration.
|
|
642
|
+
* This method returns the skills that were discovered during session initialization.
|
|
643
|
+
*
|
|
644
|
+
* @param params.sessionId - The session to query skills for
|
|
645
|
+
* @returns Success status, skills array, and any error message
|
|
646
|
+
*/
|
|
647
|
+
handleSessionListSkills(params) {
|
|
648
|
+
const { sessionId } = params;
|
|
649
|
+
const session = this.sessions[sessionId];
|
|
650
|
+
if (!session) {
|
|
651
|
+
return { success: false, error: `Session ${sessionId} not found` };
|
|
652
|
+
}
|
|
653
|
+
try {
|
|
654
|
+
return {
|
|
655
|
+
success: true,
|
|
656
|
+
skills: session.skills ?? [],
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
catch (error) {
|
|
660
|
+
this.logger.error(`[claude-code-acp] Failed to list skills for session ${sessionId}:`, error);
|
|
661
|
+
return { success: false, error: String(error) };
|
|
662
|
+
}
|
|
663
|
+
}
|
|
611
664
|
/**
|
|
612
665
|
* Flush a session to disk by aborting its query subprocess.
|
|
613
666
|
*
|
|
@@ -980,7 +1033,8 @@ export class ClaudeAcpAgent {
|
|
|
980
1033
|
: undefined;
|
|
981
1034
|
const options = {
|
|
982
1035
|
systemPrompt,
|
|
983
|
-
|
|
1036
|
+
// Use user-provided settingSources or default to all sources
|
|
1037
|
+
settingSources: userProvidedOptions?.settingSources ?? ["user", "project", "local"],
|
|
984
1038
|
stderr: (err) => this.logger.error(err),
|
|
985
1039
|
...(maxThinkingTokens !== undefined && { maxThinkingTokens }),
|
|
986
1040
|
...userProvidedOptions,
|
|
@@ -1018,9 +1072,10 @@ export class ClaudeAcpAgent {
|
|
|
1018
1072
|
},
|
|
1019
1073
|
...creationOpts,
|
|
1020
1074
|
};
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1075
|
+
// Start with user-provided tools lists, then add ACP-managed tools
|
|
1076
|
+
const allowedTools = [...(userProvidedOptions?.allowedTools ?? [])];
|
|
1077
|
+
// Disable AskUserQuestion for now, not a great way to expose this over ACP at the moment (in progress work so we can revisit)
|
|
1078
|
+
const disallowedTools = ["AskUserQuestion", ...(userProvidedOptions?.disallowedTools ?? [])];
|
|
1024
1079
|
// Check if built-in tools should be disabled
|
|
1025
1080
|
const disableBuiltInTools = params._meta?.disableBuiltInTools === true;
|
|
1026
1081
|
if (!disableBuiltInTools) {
|
|
@@ -1147,7 +1202,6 @@ async function getAvailableModels(query) {
|
|
|
1147
1202
|
}
|
|
1148
1203
|
async function getAvailableSlashCommands(query) {
|
|
1149
1204
|
const UNSUPPORTED_COMMANDS = [
|
|
1150
|
-
"context",
|
|
1151
1205
|
"cost",
|
|
1152
1206
|
"login",
|
|
1153
1207
|
"logout",
|
|
@@ -1410,6 +1464,7 @@ export function toAcpNotifications(content, role, sessionId, toolUseCache, clien
|
|
|
1410
1464
|
toolCallId: chunk.tool_use_id,
|
|
1411
1465
|
sessionUpdate: "tool_call_update",
|
|
1412
1466
|
status: "is_error" in chunk && chunk.is_error ? "failed" : "completed",
|
|
1467
|
+
rawOutput: chunk.content,
|
|
1413
1468
|
...toolUpdateFromToolResult(chunk, toolUseCache[chunk.tool_use_id]),
|
|
1414
1469
|
};
|
|
1415
1470
|
}
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ClaudeAcpAgent, runAcp, toAcpNotifications, streamEventToAcpNotifications, type ToolUpdateMeta, type NewSessionMeta, type CompactionConfig, } from "./acp-agent.js";
|
|
1
|
+
export { ClaudeAcpAgent, runAcp, toAcpNotifications, streamEventToAcpNotifications, type ToolUpdateMeta, type NewSessionMeta, type CompactionConfig, type SkillInfo, } from "./acp-agent.js";
|
|
2
2
|
export { loadManagedSettings, applyEnvironmentSettings, nodeToWebReadable, nodeToWebWritable, Pushable, unreachable, } from "./utils.js";
|
|
3
3
|
export { createMcpServer } from "./mcp-server.js";
|
|
4
4
|
export { toolInfoFromToolUse, planEntries, toolUpdateFromToolResult, createPreToolUseHook, acpToolNames as toolNames, } from "./tools.js";
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,IAAI,SAAS,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AAGvB,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/mcp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,OAAO,EAAqB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAQlC,eAAO,MAAM,eAAe,iSAIT,CAAC;AA2BpB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GACjD,SAAS,
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,OAAO,EAAqB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAQlC,eAAO,MAAM,eAAe,iSAIT,CAAC;AA2BpB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GACjD,SAAS,CA+qBX;AA+DD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,GACD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAyF/C"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -272,7 +272,12 @@ Usage:
|
|
|
272
272
|
}
|
|
273
273
|
await writeTextFile(input);
|
|
274
274
|
return {
|
|
275
|
-
content: [
|
|
275
|
+
content: [
|
|
276
|
+
{
|
|
277
|
+
type: "text",
|
|
278
|
+
text: `The file ${input.file_path} has been updated successfully.`,
|
|
279
|
+
},
|
|
280
|
+
],
|
|
276
281
|
};
|
|
277
282
|
}
|
|
278
283
|
catch (error) {
|
|
@@ -530,15 +535,54 @@ Output: Create directory 'foo'`),
|
|
|
530
535
|
|
|
531
536
|
In sessions with ${acpToolNames.bashOutput} always use it for output from Bash commands instead of TaskOutput.`,
|
|
532
537
|
inputSchema: {
|
|
533
|
-
|
|
538
|
+
task_id: z
|
|
534
539
|
.string()
|
|
535
540
|
.describe(`The id of the background bash command as returned by \`${acpToolNames.bash}\``),
|
|
541
|
+
block: z.boolean().describe("Whether to wait for completion"),
|
|
542
|
+
timeout: z.number().describe("Max wait time in ms"),
|
|
536
543
|
},
|
|
537
544
|
}, async (input) => {
|
|
538
545
|
try {
|
|
539
|
-
const bgTerm = agent.backgroundTerminals[input.
|
|
546
|
+
const bgTerm = agent.backgroundTerminals[input.task_id];
|
|
540
547
|
if (!bgTerm) {
|
|
541
|
-
throw new Error(`Unknown shell ${input.
|
|
548
|
+
throw new Error(`Unknown shell ${input.task_id}`);
|
|
549
|
+
}
|
|
550
|
+
if (input.block && bgTerm.status === "started") {
|
|
551
|
+
const statusPromise = Promise.race([
|
|
552
|
+
bgTerm.handle
|
|
553
|
+
.waitForExit()
|
|
554
|
+
.then((exitStatus) => ({ status: "exited", exitStatus })),
|
|
555
|
+
sleep(input.timeout ?? 2 * 60 * 1000).then(async () => {
|
|
556
|
+
if (bgTerm.status === "started") {
|
|
557
|
+
await bgTerm.handle.kill();
|
|
558
|
+
}
|
|
559
|
+
return { status: "timedOut", exitStatus: null };
|
|
560
|
+
}),
|
|
561
|
+
]);
|
|
562
|
+
const { status, exitStatus } = await statusPromise;
|
|
563
|
+
const currentOutput = await bgTerm.handle.currentOutput();
|
|
564
|
+
const strippedOutput = stripCommonPrefix(bgTerm.lastOutput?.output ?? "", currentOutput.output);
|
|
565
|
+
agent.backgroundTerminals[input.task_id] = {
|
|
566
|
+
status,
|
|
567
|
+
pendingOutput: {
|
|
568
|
+
...currentOutput,
|
|
569
|
+
output: strippedOutput,
|
|
570
|
+
exitStatus: exitStatus ?? currentOutput.exitStatus,
|
|
571
|
+
},
|
|
572
|
+
};
|
|
573
|
+
await bgTerm.handle.release();
|
|
574
|
+
return {
|
|
575
|
+
content: [
|
|
576
|
+
{
|
|
577
|
+
type: "text",
|
|
578
|
+
text: toolCommandOutput(status, {
|
|
579
|
+
...currentOutput,
|
|
580
|
+
output: strippedOutput,
|
|
581
|
+
exitStatus: exitStatus ?? currentOutput.exitStatus,
|
|
582
|
+
}),
|
|
583
|
+
},
|
|
584
|
+
],
|
|
585
|
+
};
|
|
542
586
|
}
|
|
543
587
|
if (bgTerm.status === "started") {
|
|
544
588
|
const newOutput = await bgTerm.handle.currentOutput();
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PlanEntry, ToolCallContent, ToolCallLocation, ToolKind } from "@agentclientprotocol/sdk";
|
|
2
2
|
import { ToolResultBlockParam, WebSearchToolResultBlockParam } from "@anthropic-ai/sdk/resources";
|
|
3
|
+
import { BetaBashCodeExecutionToolResultBlockParam, BetaCodeExecutionToolResultBlockParam, BetaRequestMCPToolResultBlockParam, BetaTextEditorCodeExecutionToolResultBlockParam, BetaToolResultBlockParam, BetaToolSearchToolResultBlockParam, BetaWebFetchToolResultBlockParam, BetaWebSearchToolResultBlockParam } from "@anthropic-ai/sdk/resources/beta.mjs";
|
|
3
4
|
export declare const ACP_TOOL_NAME_PREFIX = "mcp__acp__";
|
|
4
5
|
export declare const acpToolNames: {
|
|
5
6
|
read: string;
|
|
@@ -10,7 +11,6 @@ export declare const acpToolNames: {
|
|
|
10
11
|
bashOutput: string;
|
|
11
12
|
};
|
|
12
13
|
export declare const EDIT_TOOL_NAMES: string[];
|
|
13
|
-
import { BetaBashCodeExecutionToolResultBlockParam, BetaCodeExecutionToolResultBlockParam, BetaRequestMCPToolResultBlockParam, BetaTextEditorCodeExecutionToolResultBlockParam, BetaToolSearchToolResultBlockParam, BetaWebFetchToolResultBlockParam, BetaWebSearchToolResultBlockParam } from "@anthropic-ai/sdk/resources/beta.mjs";
|
|
14
14
|
import { HookCallback } from "@anthropic-ai/claude-agent-sdk";
|
|
15
15
|
import { Logger } from "./acp-agent.js";
|
|
16
16
|
import { SettingsManager } from "./settings.js";
|
|
@@ -26,7 +26,7 @@ interface ToolUpdate {
|
|
|
26
26
|
locations?: ToolCallLocation[];
|
|
27
27
|
}
|
|
28
28
|
export declare function toolInfoFromToolUse(toolUse: any): ToolInfo;
|
|
29
|
-
export declare function toolUpdateFromToolResult(toolResult: ToolResultBlockParam | BetaWebSearchToolResultBlockParam | BetaWebFetchToolResultBlockParam | WebSearchToolResultBlockParam | BetaCodeExecutionToolResultBlockParam | BetaBashCodeExecutionToolResultBlockParam | BetaTextEditorCodeExecutionToolResultBlockParam | BetaRequestMCPToolResultBlockParam | BetaToolSearchToolResultBlockParam, toolUse: any | undefined): ToolUpdate;
|
|
29
|
+
export declare function toolUpdateFromToolResult(toolResult: ToolResultBlockParam | BetaToolResultBlockParam | BetaWebSearchToolResultBlockParam | BetaWebFetchToolResultBlockParam | WebSearchToolResultBlockParam | BetaCodeExecutionToolResultBlockParam | BetaBashCodeExecutionToolResultBlockParam | BetaTextEditorCodeExecutionToolResultBlockParam | BetaRequestMCPToolResultBlockParam | BetaToolSearchToolResultBlockParam, toolUse: any | undefined): ToolUpdate;
|
|
30
30
|
export type ClaudePlanEntry = {
|
|
31
31
|
content: string;
|
|
32
32
|
status: "pending" | "in_progress" | "completed";
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,oBA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MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,eAAe,EAAE,CAAA;CAAE,GAAG,SAAS,EAAE,CAM5E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAcD,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,wBAEG;IACD,iBAAiB,CAAC,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,SAKF,CAAC;AAGF,eAAO,MAAM,qBAAqB,GAC/B,SAAQ,MAAgB,KAAG,YAa3B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC9B,iBAAiB,eAAe,EAAE,SAAQ,MAAgB,KAAG,YA2C7D,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -448,17 +448,22 @@ export function toolUpdateFromToolResult(toolResult, toolUse) {
|
|
|
448
448
|
function toAcpContentUpdate(content, isError = false) {
|
|
449
449
|
if (Array.isArray(content) && content.length > 0) {
|
|
450
450
|
return {
|
|
451
|
-
content: content.map((
|
|
451
|
+
content: content.map((c) => ({
|
|
452
452
|
type: "content",
|
|
453
|
-
content: isError
|
|
454
|
-
? {
|
|
455
|
-
...content,
|
|
456
|
-
text: `\`\`\`\n${content.text}\n\`\`\``,
|
|
457
|
-
}
|
|
458
|
-
: content,
|
|
453
|
+
content: toAcpContentBlock(c, isError),
|
|
459
454
|
})),
|
|
460
455
|
};
|
|
461
456
|
}
|
|
457
|
+
else if (typeof content === "object" && content !== null && "type" in content) {
|
|
458
|
+
return {
|
|
459
|
+
content: [
|
|
460
|
+
{
|
|
461
|
+
type: "content",
|
|
462
|
+
content: toAcpContentBlock(content, isError),
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
};
|
|
466
|
+
}
|
|
462
467
|
else if (typeof content === "string" && content.length > 0) {
|
|
463
468
|
return {
|
|
464
469
|
content: [
|
|
@@ -474,6 +479,62 @@ function toAcpContentUpdate(content, isError = false) {
|
|
|
474
479
|
}
|
|
475
480
|
return {};
|
|
476
481
|
}
|
|
482
|
+
function toAcpContentBlock(content, isError) {
|
|
483
|
+
const wrapText = (text) => ({
|
|
484
|
+
type: "text",
|
|
485
|
+
text: isError ? `\`\`\`\n${text}\n\`\`\`` : text,
|
|
486
|
+
});
|
|
487
|
+
switch (content.type) {
|
|
488
|
+
case "text":
|
|
489
|
+
return {
|
|
490
|
+
type: "text",
|
|
491
|
+
text: isError ? `\`\`\`\n${content.text}\n\`\`\`` : content.text,
|
|
492
|
+
};
|
|
493
|
+
case "image":
|
|
494
|
+
if (content.source.type === "base64") {
|
|
495
|
+
return {
|
|
496
|
+
type: "image",
|
|
497
|
+
data: content.source.data,
|
|
498
|
+
mimeType: content.source.media_type,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
// URL and file-based images can't be converted to ACP format (requires data)
|
|
502
|
+
return wrapText(content.source.type === "url"
|
|
503
|
+
? `[image: ${content.source.url}]`
|
|
504
|
+
: "[image: file reference]");
|
|
505
|
+
case "tool_reference":
|
|
506
|
+
return wrapText(`Tool: ${content.tool_name}`);
|
|
507
|
+
case "tool_search_tool_search_result":
|
|
508
|
+
return wrapText(`Tools found: ${content.tool_references.map((r) => r.tool_name).join(", ") || "none"}`);
|
|
509
|
+
case "tool_search_tool_result_error":
|
|
510
|
+
return wrapText(`Error: ${content.error_code}${content.error_message ? ` - ${content.error_message}` : ""}`);
|
|
511
|
+
case "web_search_result":
|
|
512
|
+
return wrapText(`${content.title} (${content.url})`);
|
|
513
|
+
case "web_search_tool_result_error":
|
|
514
|
+
return wrapText(`Error: ${content.error_code}`);
|
|
515
|
+
case "web_fetch_result":
|
|
516
|
+
return wrapText(`Fetched: ${content.url}`);
|
|
517
|
+
case "web_fetch_tool_result_error":
|
|
518
|
+
return wrapText(`Error: ${content.error_code}`);
|
|
519
|
+
case "code_execution_result":
|
|
520
|
+
return wrapText(`Output: ${content.stdout || content.stderr || ""}`);
|
|
521
|
+
case "bash_code_execution_result":
|
|
522
|
+
return wrapText(`Output: ${content.stdout || content.stderr || ""}`);
|
|
523
|
+
case "code_execution_tool_result_error":
|
|
524
|
+
case "bash_code_execution_tool_result_error":
|
|
525
|
+
return wrapText(`Error: ${content.error_code}`);
|
|
526
|
+
case "text_editor_code_execution_view_result":
|
|
527
|
+
return wrapText(content.content);
|
|
528
|
+
case "text_editor_code_execution_create_result":
|
|
529
|
+
return wrapText(content.is_file_update ? "File updated" : "File created");
|
|
530
|
+
case "text_editor_code_execution_str_replace_result":
|
|
531
|
+
return wrapText(content.lines?.join("\n") || "");
|
|
532
|
+
case "text_editor_code_execution_tool_result_error":
|
|
533
|
+
return wrapText(`Error: ${content.error_code}${content.error_message ? ` - ${content.error_message}` : ""}`);
|
|
534
|
+
default:
|
|
535
|
+
return wrapText(JSON.stringify(content));
|
|
536
|
+
}
|
|
537
|
+
}
|
|
477
538
|
export function planEntries(input) {
|
|
478
539
|
return input.todos.map((input) => ({
|
|
479
540
|
content: input.content,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.13.
|
|
6
|
+
"version": "0.13.7",
|
|
7
7
|
"description": "An ACP-compatible coding agent powered by the Claude Code SDK (TypeScript)",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"format": "prettier --write .",
|
|
35
35
|
"format:check": "prettier --check .",
|
|
36
36
|
"check": "npm run lint && npm run format:check",
|
|
37
|
-
"sync-upstream": "git merge upstream/main",
|
|
37
|
+
"sync-upstream": "git fetch upstream && git merge upstream/main",
|
|
38
38
|
"test": "vitest",
|
|
39
39
|
"test:integration": "RUN_INTEGRATION_TESTS=true vitest run",
|
|
40
40
|
"test:run": "vitest run",
|
|
@@ -66,23 +66,23 @@
|
|
|
66
66
|
"author": "Sudocode AI",
|
|
67
67
|
"license": "Apache-2.0",
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@agentclientprotocol/sdk": "0.13.
|
|
70
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.
|
|
71
|
-
"@modelcontextprotocol/sdk": "1.25.
|
|
69
|
+
"@agentclientprotocol/sdk": "0.13.1",
|
|
70
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.22",
|
|
71
|
+
"@modelcontextprotocol/sdk": "1.25.3",
|
|
72
72
|
"diff": "8.0.3",
|
|
73
73
|
"minimatch": "10.1.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@anthropic-ai/sdk": "0.71.2",
|
|
77
|
-
"@types/node": "25.0.
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
79
|
-
"@typescript-eslint/parser": "8.
|
|
77
|
+
"@types/node": "25.0.10",
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "8.54.0",
|
|
79
|
+
"@typescript-eslint/parser": "8.54.0",
|
|
80
80
|
"eslint": "9.39.2",
|
|
81
81
|
"eslint-config-prettier": "10.1.8",
|
|
82
|
-
"globals": "17.
|
|
83
|
-
"prettier": "3.8.
|
|
82
|
+
"globals": "17.2.0",
|
|
83
|
+
"prettier": "3.8.1",
|
|
84
84
|
"ts-node": "10.9.2",
|
|
85
85
|
"typescript": "5.9.3",
|
|
86
|
-
"vitest": "4.0.
|
|
86
|
+
"vitest": "4.0.18"
|
|
87
87
|
}
|
|
88
88
|
}
|