@grackle-ai/runtime-acp 0.82.2
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.d.ts +67 -0
- package/dist/acp.d.ts.map +1 -0
- package/dist/acp.js +444 -0
- package/dist/acp.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +47 -0
package/dist/acp.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AgentSession, AgentEvent } from "@grackle-ai/runtime-sdk";
|
|
2
|
+
import { BaseAgentRuntime } from "@grackle-ai/runtime-sdk";
|
|
3
|
+
/** Configuration for an ACP-based agent runtime. */
|
|
4
|
+
export interface AcpAgentConfig {
|
|
5
|
+
/** Runtime name for registry lookup (e.g., "codex-acp"). */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Command to spawn (e.g., "codex", "copilot", "claude"). */
|
|
8
|
+
command: string;
|
|
9
|
+
/** CLI arguments passed to the agent command (e.g., ["--acp", "--stdio"]). */
|
|
10
|
+
args: string[];
|
|
11
|
+
/** Additional environment variables for the subprocess. */
|
|
12
|
+
env?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/** @internal SDK module shape — exported only for `_setAcpSdkForTesting`. */
|
|
15
|
+
export interface AcpSdkModule {
|
|
16
|
+
ClientSideConnection: new (toClient: (agent: any) => any, stream: any) => any;
|
|
17
|
+
ndJsonStream: (output: any, input: any) => any;
|
|
18
|
+
PROTOCOL_VERSION: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal For testing only — inject a mock SDK to bypass the dynamic import.
|
|
22
|
+
* Pass `undefined` to reset the cache so the real import is attempted again.
|
|
23
|
+
*/
|
|
24
|
+
export declare function _setAcpSdkForTesting(mock: AcpSdkModule | undefined): void;
|
|
25
|
+
/**
|
|
26
|
+
* Map an ACP SessionUpdate to zero or more AgentEvents.
|
|
27
|
+
*
|
|
28
|
+
* The update is a discriminated union keyed on the `sessionUpdate` field.
|
|
29
|
+
* Only actionable update types are mapped; intermediate progress is skipped.
|
|
30
|
+
*/
|
|
31
|
+
export declare function mapSessionUpdate(update: Record<string, unknown>): AgentEvent[];
|
|
32
|
+
/**
|
|
33
|
+
* Auto-approve an ACP permission request by selecting the first allow option.
|
|
34
|
+
*
|
|
35
|
+
* Prefers `allow_once` or `allow_always` options, falling back to the first option
|
|
36
|
+
* if no allow option is available.
|
|
37
|
+
*/
|
|
38
|
+
export declare function autoApprovePermission(params: {
|
|
39
|
+
options: Array<{
|
|
40
|
+
optionId: string;
|
|
41
|
+
kind: string;
|
|
42
|
+
}>;
|
|
43
|
+
}): {
|
|
44
|
+
outcome: {
|
|
45
|
+
outcome: string;
|
|
46
|
+
optionId: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Select the first `env_var` auth method from an ACP `initialize` response
|
|
51
|
+
* whose required env vars are all present in the provided environment.
|
|
52
|
+
*
|
|
53
|
+
* Returns the `methodId` string to pass to `connection.authenticate()`, or
|
|
54
|
+
* `undefined` if no matching method is found.
|
|
55
|
+
*/
|
|
56
|
+
export declare function selectEnvVarAuthMethod(authMethods: Array<Record<string, unknown>>, env: Record<string, string | undefined>): string | undefined;
|
|
57
|
+
/** Runtime that delegates to an agent CLI via the Agent Client Protocol (ACP) over stdio. */
|
|
58
|
+
export declare class AcpRuntime extends BaseAgentRuntime {
|
|
59
|
+
name: string;
|
|
60
|
+
private readonly config;
|
|
61
|
+
constructor(config: AcpAgentConfig);
|
|
62
|
+
protected createSession(id: string, prompt: string, model: string, maxTurns: number, resumeSessionId?: string, branch?: string, workingDirectory?: string, systemContext?: string, mcpServers?: Record<string, unknown>, _hooks?: Record<string, unknown>, mcpBroker?: {
|
|
63
|
+
url: string;
|
|
64
|
+
token: string;
|
|
65
|
+
}, useWorktrees?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;IAAE,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAUpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC3C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC,MAAM,GAAG,SAAS,CAapB;AAqTD,6FAA6F;AAC7F,qBAAa,UAAW,SAAQ,gBAAgB;IACvC,IAAI,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;gBAErB,MAAM,EAAE,cAAc;IAMzC,SAAS,CAAC,aAAa,CACrB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,aAAa,CAAC,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAC1C,YAAY,CAAC,EAAE,OAAO,GACrB,YAAY;CAiBhB"}
|
package/dist/acp.js
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { Readable, Writable } from "node:stream";
|
|
3
|
+
import { BaseAgentSession, BaseAgentRuntime, resolveWorkingDirectory, resolveMcpServers, convertMcpServers, logger, ensureRuntimeInstalled, importFromRuntime, getRuntimeBinDirectory } from "@grackle-ai/runtime-sdk";
|
|
4
|
+
/** Per-runtime cached SDK import promises to avoid race conditions. */
|
|
5
|
+
const sdkPromiseMap = new Map();
|
|
6
|
+
/** Global mock SDK for testing — when set, all getAcpSdk() calls return this. */
|
|
7
|
+
let globalMockSdk;
|
|
8
|
+
/**
|
|
9
|
+
* @internal For testing only — inject a mock SDK to bypass the dynamic import.
|
|
10
|
+
* Pass `undefined` to reset the cache so the real import is attempted again.
|
|
11
|
+
*/
|
|
12
|
+
export function _setAcpSdkForTesting(mock) {
|
|
13
|
+
globalMockSdk = mock;
|
|
14
|
+
sdkPromiseMap.clear();
|
|
15
|
+
}
|
|
16
|
+
/** Lazily import the ACP SDK for the given runtime, installing packages on demand. */
|
|
17
|
+
function getAcpSdk(runtimeName) {
|
|
18
|
+
// Test mock bypass
|
|
19
|
+
if (globalMockSdk) {
|
|
20
|
+
return Promise.resolve(globalMockSdk);
|
|
21
|
+
}
|
|
22
|
+
const existing = sdkPromiseMap.get(runtimeName);
|
|
23
|
+
if (existing) {
|
|
24
|
+
return existing;
|
|
25
|
+
}
|
|
26
|
+
const promise = (async () => {
|
|
27
|
+
try {
|
|
28
|
+
await ensureRuntimeInstalled(runtimeName);
|
|
29
|
+
const mod = await importFromRuntime(runtimeName, "@agentclientprotocol/sdk");
|
|
30
|
+
if (typeof mod.ClientSideConnection !== "function") {
|
|
31
|
+
throw new Error("ClientSideConnection not found in @agentclientprotocol/sdk");
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
ClientSideConnection: mod.ClientSideConnection,
|
|
35
|
+
ndJsonStream: mod.ndJsonStream,
|
|
36
|
+
PROTOCOL_VERSION: (mod.PROTOCOL_VERSION ?? 1),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (importErr) {
|
|
40
|
+
sdkPromiseMap.delete(runtimeName);
|
|
41
|
+
const detail = importErr instanceof Error ? importErr.message : String(importErr);
|
|
42
|
+
throw new Error(`ACP SDK not installed or failed to load for runtime "${runtimeName}": ${detail}\n` +
|
|
43
|
+
`ACP runtimes are installed in isolated directories (e.g. ~/.grackle/runtimes/${runtimeName}/).\n` +
|
|
44
|
+
"Please check that directory or rerun/repair the runtime installation for this ACP runtime.");
|
|
45
|
+
}
|
|
46
|
+
})();
|
|
47
|
+
sdkPromiseMap.set(runtimeName, promise);
|
|
48
|
+
return promise;
|
|
49
|
+
}
|
|
50
|
+
// ─── Pure helper functions ──────────────────────────────────
|
|
51
|
+
/**
|
|
52
|
+
* Map an ACP SessionUpdate to zero or more AgentEvents.
|
|
53
|
+
*
|
|
54
|
+
* The update is a discriminated union keyed on the `sessionUpdate` field.
|
|
55
|
+
* Only actionable update types are mapped; intermediate progress is skipped.
|
|
56
|
+
*/
|
|
57
|
+
export function mapSessionUpdate(update) {
|
|
58
|
+
const ts = new Date().toISOString();
|
|
59
|
+
const raw = update;
|
|
60
|
+
const updateType = update.sessionUpdate;
|
|
61
|
+
switch (updateType) {
|
|
62
|
+
case "agent_message_chunk": {
|
|
63
|
+
const content = update.content;
|
|
64
|
+
if (content?.type === "text") {
|
|
65
|
+
return [{ type: "text", timestamp: ts, content: (content.text || ""), raw }];
|
|
66
|
+
}
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
case "agent_thought_chunk": {
|
|
70
|
+
const content = update.content;
|
|
71
|
+
if (content?.type === "text") {
|
|
72
|
+
return [{ type: "text", timestamp: ts, content: `[thinking] ${(content.text || "")}`, raw }];
|
|
73
|
+
}
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
case "tool_call": {
|
|
77
|
+
return [{
|
|
78
|
+
type: "tool_use",
|
|
79
|
+
timestamp: ts,
|
|
80
|
+
content: JSON.stringify({
|
|
81
|
+
tool: (update.title || "unknown"),
|
|
82
|
+
args: update.rawInput,
|
|
83
|
+
}),
|
|
84
|
+
raw,
|
|
85
|
+
}];
|
|
86
|
+
}
|
|
87
|
+
case "tool_call_update": {
|
|
88
|
+
const status = update.status;
|
|
89
|
+
if (status === "completed") {
|
|
90
|
+
const output = update.rawOutput !== null && update.rawOutput !== undefined
|
|
91
|
+
? JSON.stringify(update.rawOutput)
|
|
92
|
+
: (update.content || "");
|
|
93
|
+
return [{ type: "tool_result", timestamp: ts, content: output, raw }];
|
|
94
|
+
}
|
|
95
|
+
if (status === "failed") {
|
|
96
|
+
const rawOutput = update.rawOutput;
|
|
97
|
+
const errorContent = rawOutput?.error ?? update.content ?? "Tool call failed";
|
|
98
|
+
return [{
|
|
99
|
+
type: "tool_result",
|
|
100
|
+
timestamp: ts,
|
|
101
|
+
content: typeof errorContent === "string" ? errorContent : JSON.stringify(errorContent),
|
|
102
|
+
raw,
|
|
103
|
+
}];
|
|
104
|
+
}
|
|
105
|
+
// Skip intermediate progress (pending, in_progress)
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
case "plan": {
|
|
109
|
+
const entries = (update.entries || []);
|
|
110
|
+
if (entries.length === 0) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const formatted = entries
|
|
114
|
+
.map((e) => `[${(e.status || "pending")}] ${(e.content || "")}`)
|
|
115
|
+
.join("\n");
|
|
116
|
+
return [{ type: "system", timestamp: ts, content: formatted, raw }];
|
|
117
|
+
}
|
|
118
|
+
case "usage_update": {
|
|
119
|
+
const cost = update.cost;
|
|
120
|
+
const rawAmount = cost?.currency === "USD" ? Number(cost.amount) : 0;
|
|
121
|
+
const costAmount = Number.isFinite(rawAmount) ? rawAmount : 0;
|
|
122
|
+
if (costAmount > 0) {
|
|
123
|
+
return [{ type: "usage", timestamp: ts, content: JSON.stringify({
|
|
124
|
+
input_tokens: 0, output_tokens: 0, cost_usd: costAmount,
|
|
125
|
+
}), raw }];
|
|
126
|
+
}
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
default:
|
|
130
|
+
// Skip unrecognized update types (config_option_update, etc.)
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Auto-approve an ACP permission request by selecting the first allow option.
|
|
136
|
+
*
|
|
137
|
+
* Prefers `allow_once` or `allow_always` options, falling back to the first option
|
|
138
|
+
* if no allow option is available.
|
|
139
|
+
*/
|
|
140
|
+
export function autoApprovePermission(params) {
|
|
141
|
+
const allowOption = params.options.find((opt) => opt.kind === "allow_once" || opt.kind === "allow_always");
|
|
142
|
+
return {
|
|
143
|
+
outcome: {
|
|
144
|
+
outcome: "selected",
|
|
145
|
+
optionId: (allowOption ?? params.options[0]).optionId,
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Select the first `env_var` auth method from an ACP `initialize` response
|
|
151
|
+
* whose required env vars are all present in the provided environment.
|
|
152
|
+
*
|
|
153
|
+
* Returns the `methodId` string to pass to `connection.authenticate()`, or
|
|
154
|
+
* `undefined` if no matching method is found.
|
|
155
|
+
*/
|
|
156
|
+
export function selectEnvVarAuthMethod(authMethods, env) {
|
|
157
|
+
for (const method of authMethods) {
|
|
158
|
+
if (method.type !== "env_var") {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const vars = (method.vars || []);
|
|
162
|
+
const allSet = vars.every((v) => v.optional || !!env[v.name]);
|
|
163
|
+
const anyRequired = vars.some((v) => !v.optional);
|
|
164
|
+
if (anyRequired && allSet) {
|
|
165
|
+
return method.id;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
// ─── Session ────────────────────────────────────────────────
|
|
171
|
+
/** An in-progress agent session that communicates via the Agent Client Protocol over stdio. */
|
|
172
|
+
class AcpSession extends BaseAgentSession {
|
|
173
|
+
runtimeName;
|
|
174
|
+
runtimeDisplayName;
|
|
175
|
+
noMessagesError;
|
|
176
|
+
config;
|
|
177
|
+
child;
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
+
connection;
|
|
180
|
+
acpSessionId;
|
|
181
|
+
messageCount = 0;
|
|
182
|
+
/** Last cumulative cost reported by usage_update (for delta computation). */
|
|
183
|
+
lastReportedCost = 0;
|
|
184
|
+
constructor(config, id, prompt, model, maxTurns, resumeSessionId, branch, workingDirectory, systemContext, mcpServers, hooks, mcpBroker, useWorktrees) {
|
|
185
|
+
super(id, prompt, model, maxTurns, resumeSessionId, branch, workingDirectory, systemContext, mcpServers, hooks, mcpBroker, useWorktrees);
|
|
186
|
+
this.config = config;
|
|
187
|
+
this.runtimeName = config.name;
|
|
188
|
+
this.runtimeDisplayName = config.name;
|
|
189
|
+
const fullCommand = [config.command, ...config.args].join(" ");
|
|
190
|
+
this.noMessagesError =
|
|
191
|
+
`${config.name} returned no messages. Check that '${fullCommand}' is installed and supports ACP.`;
|
|
192
|
+
}
|
|
193
|
+
// ─── BaseAgentSession hooks ──────────────────────────────
|
|
194
|
+
async setupSdk() {
|
|
195
|
+
const ts = () => new Date().toISOString();
|
|
196
|
+
const sdk = await getAcpSdk(this.config.name);
|
|
197
|
+
// Resolve working directory
|
|
198
|
+
const cwd = await resolveWorkingDirectory({
|
|
199
|
+
branch: this.branch,
|
|
200
|
+
workingDirectory: this.workingDirectory,
|
|
201
|
+
useWorktrees: this.useWorktrees,
|
|
202
|
+
eventQueue: this.eventQueue,
|
|
203
|
+
});
|
|
204
|
+
// Resolve MCP servers (shared config + spawn-provided servers + broker)
|
|
205
|
+
const mcpConfig = resolveMcpServers(this.mcpServers, this.mcpBroker);
|
|
206
|
+
// Spawn agent subprocess in the resolved working directory
|
|
207
|
+
const spawnCwd = cwd || process.cwd();
|
|
208
|
+
const pathSeparator = process.platform === "win32" ? ";" : ":";
|
|
209
|
+
const runtimeBinDir = getRuntimeBinDirectory(this.config.name);
|
|
210
|
+
const childEnv = {
|
|
211
|
+
...process.env,
|
|
212
|
+
...this.config.env,
|
|
213
|
+
PATH: `${runtimeBinDir}${pathSeparator}${process.env.PATH || ""}`,
|
|
214
|
+
};
|
|
215
|
+
this.child = spawn(this.config.command, this.config.args, {
|
|
216
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
217
|
+
cwd: spawnCwd,
|
|
218
|
+
env: childEnv,
|
|
219
|
+
shell: process.platform === "win32",
|
|
220
|
+
});
|
|
221
|
+
this.eventQueue.push({
|
|
222
|
+
type: "system",
|
|
223
|
+
timestamp: ts(),
|
|
224
|
+
content: `Spawned ${this.config.command} ${this.config.args.join(" ")} (pid: ${String(this.child.pid)}, cwd: ${spawnCwd})`,
|
|
225
|
+
});
|
|
226
|
+
// Register exit/error handlers immediately to catch early termination
|
|
227
|
+
this.child.on("error", (err) => {
|
|
228
|
+
if (!this.killed) {
|
|
229
|
+
this.eventQueue.push({
|
|
230
|
+
type: "error",
|
|
231
|
+
timestamp: ts(),
|
|
232
|
+
content: `Failed to spawn ${this.config.command}: ${err.message}`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
this.child.on("exit", (code, signal) => {
|
|
237
|
+
if (!this.killed) {
|
|
238
|
+
this.eventQueue.push({
|
|
239
|
+
type: "error",
|
|
240
|
+
timestamp: ts(),
|
|
241
|
+
content: `Agent process exited unexpectedly (code: ${String(code)}, signal: ${String(signal)})`,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
// Create ACP stream over stdio
|
|
246
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
247
|
+
const stream = sdk.ndJsonStream(Writable.toWeb(this.child.stdin), Readable.toWeb(this.child.stdout));
|
|
248
|
+
// Create client-side ACP connection with event handlers
|
|
249
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
250
|
+
this.connection = new sdk.ClientSideConnection(() => ({
|
|
251
|
+
sessionUpdate: (params) => {
|
|
252
|
+
const update = params.update;
|
|
253
|
+
const events = mapSessionUpdate(update);
|
|
254
|
+
for (const event of events) {
|
|
255
|
+
// Apply cumulative→delta conversion for ACP usage_update cost
|
|
256
|
+
if (event.type === "usage") {
|
|
257
|
+
try {
|
|
258
|
+
const data = JSON.parse(event.content);
|
|
259
|
+
if (data.cost_usd > 0) {
|
|
260
|
+
const delta = data.cost_usd - this.lastReportedCost;
|
|
261
|
+
this.lastReportedCost = data.cost_usd;
|
|
262
|
+
if (delta <= 0) {
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
this.eventQueue.push({ ...event, content: JSON.stringify({ ...data, cost_usd: delta }) });
|
|
266
|
+
this.messageCount++;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch { /* fall through to normal push */ }
|
|
271
|
+
}
|
|
272
|
+
this.eventQueue.push(event);
|
|
273
|
+
this.messageCount++;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
requestPermission: async (params) => {
|
|
277
|
+
return autoApprovePermission(params);
|
|
278
|
+
},
|
|
279
|
+
}), stream);
|
|
280
|
+
// Initialize ACP protocol
|
|
281
|
+
let initResult;
|
|
282
|
+
try {
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
284
|
+
initResult = await this.connection.initialize({
|
|
285
|
+
protocolVersion: sdk.PROTOCOL_VERSION,
|
|
286
|
+
clientInfo: { name: "grackle-powerline", version: "1.0.0" },
|
|
287
|
+
clientCapabilities: {},
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
catch (err) {
|
|
291
|
+
const message = err instanceof Error ? err.message : JSON.stringify(err);
|
|
292
|
+
logger.error({ err }, "ACP initialize failed");
|
|
293
|
+
throw new Error(`ACP initialize failed: ${message}`);
|
|
294
|
+
}
|
|
295
|
+
this.eventQueue.push({
|
|
296
|
+
type: "system",
|
|
297
|
+
timestamp: ts(),
|
|
298
|
+
content: "ACP connection initialized",
|
|
299
|
+
});
|
|
300
|
+
// Some ACP bridges (e.g. @github/copilot) require an explicit authenticate()
|
|
301
|
+
// call even when credential files are on disk. Attempt auth with the first
|
|
302
|
+
// env_var method whose required vars are present in the subprocess environment.
|
|
303
|
+
const envVarMethodId = selectEnvVarAuthMethod((initResult.authMethods || []), process.env);
|
|
304
|
+
if (envVarMethodId) {
|
|
305
|
+
try {
|
|
306
|
+
await this.connection.authenticate({ methodId: envVarMethodId });
|
|
307
|
+
this.eventQueue.push({
|
|
308
|
+
type: "system",
|
|
309
|
+
timestamp: ts(),
|
|
310
|
+
content: `ACP authenticated via ${envVarMethodId}`,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
// Non-fatal: bridge may not require this call (claude-code-acp, codex-acp)
|
|
315
|
+
logger.warn({ err, methodId: envVarMethodId }, "ACP authenticate() failed — continuing");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
// Create a new ACP session (or reuse existing for resume)
|
|
319
|
+
if (this.resumeSessionId) {
|
|
320
|
+
this.acpSessionId = this.resumeSessionId;
|
|
321
|
+
this.runtimeSessionId = this.resumeSessionId;
|
|
322
|
+
this.eventQueue.push({ type: "runtime_session_id", timestamp: ts(), content: this.runtimeSessionId });
|
|
323
|
+
this.eventQueue.push({
|
|
324
|
+
type: "system",
|
|
325
|
+
timestamp: ts(),
|
|
326
|
+
content: `ACP session resuming (id: ${this.runtimeSessionId})`,
|
|
327
|
+
});
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
let sessionResult;
|
|
331
|
+
try {
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
333
|
+
sessionResult = await this.connection.newSession({
|
|
334
|
+
cwd: spawnCwd,
|
|
335
|
+
mcpServers: convertMcpServers(mcpConfig.servers),
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
catch (err) {
|
|
339
|
+
const message = err instanceof Error ? err.message : JSON.stringify(err);
|
|
340
|
+
logger.error({ err }, "ACP newSession failed");
|
|
341
|
+
throw new Error(`ACP newSession failed: ${message}`);
|
|
342
|
+
}
|
|
343
|
+
this.acpSessionId = sessionResult.sessionId;
|
|
344
|
+
this.runtimeSessionId = this.acpSessionId || "";
|
|
345
|
+
this.eventQueue.push({ type: "runtime_session_id", timestamp: ts(), content: this.runtimeSessionId });
|
|
346
|
+
this.eventQueue.push({
|
|
347
|
+
type: "system",
|
|
348
|
+
timestamp: ts(),
|
|
349
|
+
content: `ACP session created (id: ${this.runtimeSessionId})`,
|
|
350
|
+
});
|
|
351
|
+
// Set model if specified
|
|
352
|
+
if (this.model) {
|
|
353
|
+
try {
|
|
354
|
+
await this.connection.unstable_setSessionModel({
|
|
355
|
+
sessionId: this.acpSessionId,
|
|
356
|
+
modelId: this.model,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
try {
|
|
361
|
+
await this.connection.setSessionConfigOption({
|
|
362
|
+
sessionId: this.acpSessionId,
|
|
363
|
+
configId: "model",
|
|
364
|
+
value: this.model,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
logger.warn({ model: this.model }, "Failed to set model via ACP");
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
async setupForResume() {
|
|
374
|
+
// setupSdk() already handled resume by setting acpSessionId = resumeSessionId
|
|
375
|
+
this.eventQueue.push({
|
|
376
|
+
type: "system",
|
|
377
|
+
timestamp: new Date().toISOString(),
|
|
378
|
+
content: `ACP session resumed (id: ${this.resumeSessionId || ""})`,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
async runInitialQuery(prompt) {
|
|
382
|
+
this.messageCount = 0;
|
|
383
|
+
try {
|
|
384
|
+
await this.connection.prompt({
|
|
385
|
+
sessionId: this.acpSessionId,
|
|
386
|
+
prompt: [{ type: "text", text: prompt }],
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
catch (err) {
|
|
390
|
+
const message = err instanceof Error ? err.message : JSON.stringify(err);
|
|
391
|
+
logger.error({ err }, "ACP prompt failed");
|
|
392
|
+
throw new Error(`ACP prompt failed: ${message}`);
|
|
393
|
+
}
|
|
394
|
+
return this.messageCount;
|
|
395
|
+
}
|
|
396
|
+
async executeFollowUp(text) {
|
|
397
|
+
this.messageCount = 0;
|
|
398
|
+
await this.connection.prompt({
|
|
399
|
+
sessionId: this.acpSessionId,
|
|
400
|
+
prompt: [{ type: "text", text }],
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
canAcceptInput() {
|
|
404
|
+
return !!this.connection && !!this.acpSessionId;
|
|
405
|
+
}
|
|
406
|
+
abortActive() {
|
|
407
|
+
if (this.connection && this.acpSessionId) {
|
|
408
|
+
this.connection.cancel({ sessionId: this.acpSessionId }).catch(() => { });
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/** Forcefully terminate the session and subprocess. */
|
|
412
|
+
kill() {
|
|
413
|
+
// Cancel ACP session before super.kill() calls abortActive()
|
|
414
|
+
if (this.connection && this.acpSessionId) {
|
|
415
|
+
this.connection.cancel({ sessionId: this.acpSessionId }).catch(() => { });
|
|
416
|
+
}
|
|
417
|
+
// Kill the subprocess
|
|
418
|
+
if (this.child) {
|
|
419
|
+
this.child.kill("SIGTERM");
|
|
420
|
+
}
|
|
421
|
+
// Delegate to base: sets killed, closes queue, calls releaseResources
|
|
422
|
+
super.kill();
|
|
423
|
+
}
|
|
424
|
+
releaseResources() {
|
|
425
|
+
this.connection = undefined;
|
|
426
|
+
this.child = undefined;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
// ─── Runtime ────────────────────────────────────────────────
|
|
430
|
+
/** Runtime that delegates to an agent CLI via the Agent Client Protocol (ACP) over stdio. */
|
|
431
|
+
export class AcpRuntime extends BaseAgentRuntime {
|
|
432
|
+
name;
|
|
433
|
+
config;
|
|
434
|
+
constructor(config) {
|
|
435
|
+
super();
|
|
436
|
+
this.name = config.name;
|
|
437
|
+
this.config = config;
|
|
438
|
+
}
|
|
439
|
+
createSession(id, prompt, model, maxTurns, resumeSessionId, branch, workingDirectory, systemContext, mcpServers, _hooks, mcpBroker, useWorktrees) {
|
|
440
|
+
return new AcpSession(this.config, id, prompt, model, maxTurns, resumeSessionId, branch, workingDirectory, systemContext, mcpServers, undefined, // hooks — not supported by ACP
|
|
441
|
+
mcpBroker, useWorktrees);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=acp.js.map
|
package/dist/acp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp.js","sourceRoot":"","sources":["../src/acp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AA2BvN,uEAAuE;AACvE,MAAM,aAAa,GAAuC,IAAI,GAAG,EAAE,CAAC;AAEpE,iFAAiF;AACjF,IAAI,aAAuC,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA8B;IACjE,aAAa,GAAG,IAAI,CAAC;IACrB,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC;AAED,sFAAsF;AACtF,SAAS,SAAS,CAAC,WAAmB;IACpC,mBAAmB;IACnB,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,KAAK,IAA2B,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAC1C,MAAM,GAAG,GAAG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F;AAC7F,MAAM,OAAO,UAAW,SAAQ,gBAAgB;IACvC,IAAI,CAAS;IACH,MAAM,CAAiB;IAExC,YAAmB,MAAsB;QACvC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAES,aAAa,CACrB,EAAU,EACV,MAAc,EACd,KAAa,EACb,QAAgB,EAChB,eAAwB,EACxB,MAAe,EACf,gBAAyB,EACzB,aAAsB,EACtB,UAAoC,EACpC,MAAgC,EAChC,SAA0C,EAC1C,YAAsB;QAEtB,OAAO,IAAI,UAAU,CACnB,IAAI,CAAC,MAAM,EACX,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,SAAS,EAAE,+BAA+B;QAC1C,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC7H,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.57.7"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grackle-ai/runtime-acp",
|
|
3
|
+
"version": "0.82.2",
|
|
4
|
+
"description": "Grackle Agent Client Protocol (ACP) runtime implementation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nick-pape/grackle.git",
|
|
9
|
+
"directory": "packages/runtime-acp"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"grackle",
|
|
13
|
+
"runtime",
|
|
14
|
+
"acp",
|
|
15
|
+
"agent-client-protocol"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/nick-pape/grackle#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/nick-pape/grackle/issues"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.0.0"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@grackle-ai/common": "0.82.2",
|
|
32
|
+
"@grackle-ai/runtime-sdk": "0.82.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@rushstack/heft": "1.2.7",
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"vitest": "^3.1.1",
|
|
38
|
+
"@grackle-ai/heft-rig": "0.0.1"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "heft build --clean",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"clean": "heft clean",
|
|
44
|
+
"_phase:build": "heft run --only build -- --clean",
|
|
45
|
+
"_phase:test": "vitest run"
|
|
46
|
+
}
|
|
47
|
+
}
|