@e2e-dev/acp 0.1.0 → 0.1.1-nightly-20261101030202
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/README.md +2 -4
- package/dist/.build.json +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/session.js +17 -16
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @e2e-dev/acp
|
|
2
2
|
|
|
3
|
-
Run `agent.act` and `agent.assert` on
|
|
4
|
-
Claude Code, Codex, or Cursor, over the
|
|
3
|
+
Run `agent.act` and `agent.assert` on Claude Code or Codex over the
|
|
5
4
|
[Agent Client Protocol](https://agentclientprotocol.com). The agent signs in
|
|
6
5
|
with its own login, so e2e needs no model provider.
|
|
7
6
|
|
|
@@ -22,8 +21,7 @@ export default {
|
|
|
22
21
|
|
|
23
22
|
- `claudeCode()` starts Claude Code through `@agentclientprotocol/claude-agent-acp`.
|
|
24
23
|
- `codex()` starts Codex through `@agentclientprotocol/codex-acp`.
|
|
25
|
-
- `acp({ command, args })` starts any other agent that speaks ACP on stdio.
|
|
26
24
|
|
|
27
25
|
The runner records every action, so steps replay from the cache without the
|
|
28
|
-
agent. See the [guide](https://e2e.tester.army/docs/
|
|
26
|
+
agent. See the [guide](https://e2e.tester.army/docs/subscriptions#use-your-coding-agent) for options,
|
|
29
27
|
containment, and limits.
|
package/dist/.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.1.
|
|
1
|
+
{"version":"0.1.1-nightly-20261101030202"}
|
package/dist/session.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* else is rejected. Each `prompt` is one `session/prompt` and resolves when
|
|
10
10
|
* the agent's turn ends.
|
|
11
11
|
*/
|
|
12
|
-
import { type Usage } from '@agentclientprotocol/sdk';
|
|
12
|
+
import { type Usage } from '@agentclientprotocol/sdk/unstable';
|
|
13
13
|
import { type ServedTool } from './mcp.ts';
|
|
14
14
|
/** How to start one agent and what its session gets. */
|
|
15
15
|
export interface AgentLaunch {
|
package/dist/session.js
CHANGED
|
@@ -14,7 +14,7 @@ import { mkdtempSync, rmSync } from 'node:fs';
|
|
|
14
14
|
import { tmpdir } from 'node:os';
|
|
15
15
|
import { join } from 'node:path';
|
|
16
16
|
import { Readable, Writable } from 'node:stream';
|
|
17
|
-
import {
|
|
17
|
+
import { client, methods, ndJsonStream, PROTOCOL_VERSION, } from '@agentclientprotocol/sdk/unstable';
|
|
18
18
|
import { ConfigurationError } from 'e2e/engine';
|
|
19
19
|
import { MCP_SERVER_NAME, serveTools } from './mcp.js';
|
|
20
20
|
/** Tool kinds an agent uses for its own tools and subagents; never a call of ours without an adapter's mark. */
|
|
@@ -62,12 +62,13 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
62
62
|
const ours = new Set(tools.map((tool) => tool.name));
|
|
63
63
|
const calls = new Map();
|
|
64
64
|
const turn = { cost: undefined, text: '', own: { allowed: new Set(), rejected: new Map(), ran: new Map() } };
|
|
65
|
-
const
|
|
66
|
-
requestPermission
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
65
|
+
const connection = client({ name: 'e2e' })
|
|
66
|
+
.onRequest(methods.client.session.requestPermission, ({ params }) => answerPermission(params, ours, calls, turn.own))
|
|
67
|
+
.onNotification(methods.client.session.update, ({ params }) => observe(params, ours, calls, turn, onOwnTool))
|
|
68
|
+
.connect(ndJsonStream(Writable.toWeb(child.stdin), Readable.toWeb(child.stdout)));
|
|
69
|
+
const agent = connection.agent;
|
|
70
70
|
const teardown = () => {
|
|
71
|
+
connection.close();
|
|
71
72
|
child.stdin.end();
|
|
72
73
|
child.kill('SIGTERM');
|
|
73
74
|
setTimeout(() => {
|
|
@@ -82,7 +83,7 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
82
83
|
let modelId;
|
|
83
84
|
try {
|
|
84
85
|
server = await startup(serving);
|
|
85
|
-
initialize = await startup(
|
|
86
|
+
initialize = await startup(agent.request(methods.agent.initialize, {
|
|
86
87
|
protocolVersion: PROTOCOL_VERSION,
|
|
87
88
|
clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false },
|
|
88
89
|
clientInfo: { name: 'e2e', version: '1' },
|
|
@@ -90,7 +91,7 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
90
91
|
if (initialize.agentCapabilities?.mcpCapabilities?.http !== true) {
|
|
91
92
|
throw new ConfigurationError('INVALID_CONFIG', `${launch.command} does not accept MCP servers over HTTP, which the step tools need`);
|
|
92
93
|
}
|
|
93
|
-
const session = await startup(
|
|
94
|
+
const session = await startup(agent.request(methods.agent.session.new, {
|
|
94
95
|
cwd,
|
|
95
96
|
mcpServers: [{ type: 'http', name: MCP_SERVER_NAME, url: server.url, headers: [] }],
|
|
96
97
|
...(launch.sessionMeta === undefined ? {} : { _meta: { ...launch.sessionMeta } }),
|
|
@@ -102,14 +103,14 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
102
103
|
if (modelOption === undefined || !offered.includes(launch.model)) {
|
|
103
104
|
throw new ConfigurationError('INVALID_CONFIG', `the agent does not offer model ${launch.model}${offered.length === 0 ? '' : `; it offers ${offered.join(', ')}`}`);
|
|
104
105
|
}
|
|
105
|
-
await startup(
|
|
106
|
+
await startup(agent.request(methods.agent.session.setConfigOption, { sessionId, configId: modelOption.id, value: launch.model }));
|
|
106
107
|
modelId = launch.model;
|
|
107
108
|
}
|
|
108
109
|
else if (modelOption?.type === 'select') {
|
|
109
110
|
modelId = String(modelOption.currentValue);
|
|
110
111
|
}
|
|
111
112
|
if (launch.mode !== undefined)
|
|
112
|
-
await startup(selectMode(
|
|
113
|
+
await startup(selectMode(agent, session, launch.mode));
|
|
113
114
|
}
|
|
114
115
|
catch (error) {
|
|
115
116
|
teardown();
|
|
@@ -131,7 +132,7 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
131
132
|
turn.own = { allowed: new Set(), rejected: new Map(), ran: new Map() };
|
|
132
133
|
const costBefore = turn.cost;
|
|
133
134
|
const started = Date.now();
|
|
134
|
-
const response = await Promise.race([
|
|
135
|
+
const response = await Promise.race([agent.request(methods.agent.session.prompt, { sessionId, prompt: [{ type: 'text', text }] }), exited]).catch((error) => {
|
|
135
136
|
throw withDetails(error);
|
|
136
137
|
});
|
|
137
138
|
const costUsd = turn.cost === undefined ? undefined : turn.cost - (costBefore ?? 0);
|
|
@@ -147,7 +148,7 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
147
148
|
};
|
|
148
149
|
},
|
|
149
150
|
cancel() {
|
|
150
|
-
void
|
|
151
|
+
void agent.notify(methods.agent.session.cancel, { sessionId }).catch(() => undefined);
|
|
151
152
|
},
|
|
152
153
|
close() {
|
|
153
154
|
if (closed)
|
|
@@ -155,7 +156,7 @@ export async function startSession(launch, tools, signal, onOwnTool = () => unde
|
|
|
155
156
|
closed = true;
|
|
156
157
|
// Synchronous to the end, so a worker exiting right after the attempt still stops the agent.
|
|
157
158
|
if (initialize.agentCapabilities?.sessionCapabilities?.close != null) {
|
|
158
|
-
void
|
|
159
|
+
void agent.request(methods.agent.session.close, { sessionId }).catch(() => undefined);
|
|
159
160
|
}
|
|
160
161
|
teardown();
|
|
161
162
|
},
|
|
@@ -180,13 +181,13 @@ function detailsOf(error) {
|
|
|
180
181
|
function isAuthRequired(error) {
|
|
181
182
|
return typeof error === 'object' && error !== null && error.code === AUTH_REQUIRED;
|
|
182
183
|
}
|
|
183
|
-
async function selectMode(
|
|
184
|
+
async function selectMode(agent, session, mode) {
|
|
184
185
|
const option = session.configOptions?.find((entry) => entry.category === 'mode');
|
|
185
186
|
if (option !== undefined && selectValues(option).includes(mode)) {
|
|
186
|
-
await
|
|
187
|
+
await agent.request(methods.agent.session.setConfigOption, { sessionId: session.sessionId, configId: option.id, value: mode });
|
|
187
188
|
}
|
|
188
189
|
else if (session.modes?.availableModes.some((entry) => entry.id === mode) === true) {
|
|
189
|
-
await
|
|
190
|
+
await agent.request(methods.agent.session.setMode, { sessionId: session.sessionId, modeId: mode });
|
|
190
191
|
}
|
|
191
192
|
else {
|
|
192
193
|
throw new ConfigurationError('INVALID_CONFIG', `the agent has no mode ${mode}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e2e-dev/acp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1-nightly-20261101030202",
|
|
4
4
|
"description": "Run e2e agent steps on a coding agent you already use (Claude Code, Codex, Cursor, ...) over the Agent Client Protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"e2e",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
"NOTICE"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@agentclientprotocol/sdk": "
|
|
43
|
+
"@agentclientprotocol/sdk": "2.2.0",
|
|
44
44
|
"@modelcontextprotocol/server": "2.4.0",
|
|
45
45
|
"zod": "4.6.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"e2e": "
|
|
48
|
+
"e2e": "0.22.1-nightly-20261101030202"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@modelcontextprotocol/client": "2.4.0",
|
|
52
|
-
"@types/node": "26.6.
|
|
53
|
-
"e2e": "0.22.
|
|
52
|
+
"@types/node": "26.6.6",
|
|
53
|
+
"e2e": "0.22.1-nightly-20261101030202",
|
|
54
54
|
"typescript": "7.0.2",
|
|
55
55
|
"vitest": "5.0.5"
|
|
56
56
|
},
|