@automatalabs/acp-agents 0.15.0 → 0.16.0
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-client.d.ts +3 -1
- package/dist/acp-client.d.ts.map +1 -1
- package/dist/acp-client.js +121 -5
- package/dist/capabilities.d.ts +10 -7
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +15 -9
- package/dist/client-handlers.d.ts +12 -3
- package/dist/client-handlers.d.ts.map +1 -1
- package/dist/client-handlers.js +22 -7
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/protocol-coverage.js +3 -3
- package/package.json +2 -2
package/dist/acp-client.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare class SessionState {
|
|
|
21
21
|
readonly elicitationResolver?: ElicitationResolver | undefined;
|
|
22
22
|
readonly label?: string | undefined;
|
|
23
23
|
readonly runId?: string | undefined;
|
|
24
|
+
readonly mcpServerIds: readonly string[];
|
|
24
25
|
private readonly retainSessionLog;
|
|
25
26
|
readonly textChunks: string[];
|
|
26
27
|
readonly history: AgentHistoryEntry[];
|
|
@@ -28,12 +29,13 @@ declare class SessionState {
|
|
|
28
29
|
readonly pendingPermissions: Set<(outcome: RequestPermissionResponse) => void>;
|
|
29
30
|
readonly pendingElicitations: Set<(outcome: CreateElicitationResponse) => void>;
|
|
30
31
|
readonly urlElicitationIds: Set<string>;
|
|
32
|
+
readonly mcpConnectionIds: Set<string>;
|
|
31
33
|
rawResultSuccess: RawResultSuccess | undefined;
|
|
32
34
|
modes: SessionModeState | null | undefined;
|
|
33
35
|
private turnStartIndex;
|
|
34
36
|
/** `label`/`runId` are carried here ONLY so the MultiplexClient can stamp them onto emitted
|
|
35
37
|
* events as context — they never affect routing or the wire request. */
|
|
36
|
-
constructor(cwd: string, policy: ToolPolicy, permissionResolver?: PermissionResolver | undefined, elicitationResolver?: ElicitationResolver | undefined, label?: string | undefined, runId?: string | undefined, modes?: SessionModeState | null, retainSessionLog?: boolean);
|
|
38
|
+
constructor(cwd: string, policy: ToolPolicy, permissionResolver?: PermissionResolver | undefined, elicitationResolver?: ElicitationResolver | undefined, label?: string | undefined, runId?: string | undefined, modes?: SessionModeState | null, mcpServerIds?: readonly string[], retainSessionLog?: boolean);
|
|
37
39
|
/** Mark the start of a new turn so currentTurnText()/structured_output read only this turn.
|
|
38
40
|
* Long-lived interactive sessions can opt out of retaining old text/history because hosts
|
|
39
41
|
* stream live events and keep their own transcript; clearing here prevents dead logs from
|
package/dist/acp-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-client.d.ts","sourceRoot":"","sources":["../src/acp-client.ts"],"names":[],"mappings":"AAwBA,OAAO,
|
|
1
|
+
{"version":3,"file":"acp-client.d.ts","sourceRoot":"","sources":["../src/acp-client.ts"],"names":[],"mappings":"AAwBA,OAAO,EAcL,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAGlC,KAAK,oBAAoB,EAIzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAQzB,KAAK,aAAa,EAClB,KAAK,cAAc,EAMnB,KAAK,yBAAyB,EAG9B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAGxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAO5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc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E,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAoB7G,2DAA2D;IAC3D,eAAe,IAAI,MAAM;IAIzB,qFAAqF;IACrF,mBAAmB,IAAI,OAAO;IAI9B,gGAAgG;IAC1F,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,6EAA6E;IACvE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO/B"}
|
package/dist/acp-client.js
CHANGED
|
@@ -28,7 +28,7 @@ import { adaptPromptContent, describeLifecycleAdvertisement, gateCustomMeta, isS
|
|
|
28
28
|
import { emitSessionUpdate } from "./events.js";
|
|
29
29
|
import { decidePermission, } from "./permissions.js";
|
|
30
30
|
import { UsageAccumulator } from "./usage.js";
|
|
31
|
-
import { clientCapabilitiesFor, } from "./client-handlers.js";
|
|
31
|
+
import { clientCapabilitiesFor, hasFullMcpHandlers, } from "./client-handlers.js";
|
|
32
32
|
/** A benign client identity. NOT JetBrains/IntelliJ 2026.1 — that exact identity makes
|
|
33
33
|
* codex-acp disable session config options (our model/effort routing channel). */
|
|
34
34
|
const CLIENT_INFO = {
|
|
@@ -51,6 +51,10 @@ const GUARDED_STATEFUL_REQUESTS = new Map([
|
|
|
51
51
|
"no driven wrapper yet; raw forked sessions cannot be routed (permissions auto-cancel)",
|
|
52
52
|
],
|
|
53
53
|
]);
|
|
54
|
+
const parseConnectMcpRequest = (params) => params;
|
|
55
|
+
const parseMessageMcpRequest = (params) => params;
|
|
56
|
+
const parseMessageMcpNotification = (params) => params;
|
|
57
|
+
const parseDisconnectMcpRequest = (params) => params;
|
|
54
58
|
/** Per-session accumulator: assistant text, tool history, usage, the Claude raw structured_output,
|
|
55
59
|
* and the permission policy/resolver used to answer permission requests for THIS session. */
|
|
56
60
|
class SessionState {
|
|
@@ -60,6 +64,7 @@ class SessionState {
|
|
|
60
64
|
elicitationResolver;
|
|
61
65
|
label;
|
|
62
66
|
runId;
|
|
67
|
+
mcpServerIds;
|
|
63
68
|
retainSessionLog;
|
|
64
69
|
textChunks = [];
|
|
65
70
|
history = [];
|
|
@@ -67,18 +72,20 @@ class SessionState {
|
|
|
67
72
|
pendingPermissions = new Set();
|
|
68
73
|
pendingElicitations = new Set();
|
|
69
74
|
urlElicitationIds = new Set();
|
|
75
|
+
mcpConnectionIds = new Set();
|
|
70
76
|
rawResultSuccess;
|
|
71
77
|
modes;
|
|
72
78
|
turnStartIndex = 0;
|
|
73
79
|
/** `label`/`runId` are carried here ONLY so the MultiplexClient can stamp them onto emitted
|
|
74
80
|
* events as context — they never affect routing or the wire request. */
|
|
75
|
-
constructor(cwd, policy, permissionResolver, elicitationResolver, label, runId, modes, retainSessionLog = true) {
|
|
81
|
+
constructor(cwd, policy, permissionResolver, elicitationResolver, label, runId, modes, mcpServerIds = [], retainSessionLog = true) {
|
|
76
82
|
this.cwd = cwd;
|
|
77
83
|
this.policy = policy;
|
|
78
84
|
this.permissionResolver = permissionResolver;
|
|
79
85
|
this.elicitationResolver = elicitationResolver;
|
|
80
86
|
this.label = label;
|
|
81
87
|
this.runId = runId;
|
|
88
|
+
this.mcpServerIds = mcpServerIds;
|
|
82
89
|
this.retainSessionLog = retainSessionLog;
|
|
83
90
|
this.modes = modes;
|
|
84
91
|
}
|
|
@@ -172,6 +179,8 @@ class MultiplexClient {
|
|
|
172
179
|
elicitationResolver;
|
|
173
180
|
sessions = new Map();
|
|
174
181
|
urlElicitationContexts = new Map();
|
|
182
|
+
mcpServerSessions = new Map();
|
|
183
|
+
mcpConnectionSessions = new Map();
|
|
175
184
|
/** Recently unregistered sessions kept ONLY for the teardown window: ACP agents may
|
|
176
185
|
* legitimately release terminals (or finish fs/terminal cleanup) after this client releases
|
|
177
186
|
* the session because session/close is cancel + free resources and the Agent owns terminal
|
|
@@ -208,14 +217,22 @@ class MultiplexClient {
|
|
|
208
217
|
register(sessionId, state) {
|
|
209
218
|
this.tombstones.delete(sessionId);
|
|
210
219
|
this.sessions.set(sessionId, state);
|
|
220
|
+
for (const serverId of state.mcpServerIds)
|
|
221
|
+
this.mcpServerSessions.set(serverId, sessionId);
|
|
211
222
|
this.onEvent?.("session_open", this.contextFor(sessionId, state));
|
|
212
223
|
}
|
|
213
224
|
unregister(sessionId) {
|
|
214
225
|
const state = this.sessions.get(sessionId);
|
|
215
226
|
state?.settlePendingPermissions();
|
|
216
227
|
state?.settlePendingElicitations();
|
|
228
|
+
if (state)
|
|
229
|
+
this.disconnectMcpConnectionsForSession(sessionId, state);
|
|
217
230
|
this.sessions.delete(sessionId);
|
|
218
231
|
if (state) {
|
|
232
|
+
for (const serverId of state.mcpServerIds) {
|
|
233
|
+
if (this.mcpServerSessions.get(serverId) === sessionId)
|
|
234
|
+
this.mcpServerSessions.delete(serverId);
|
|
235
|
+
}
|
|
219
236
|
for (const elicitationId of state.urlElicitationIds)
|
|
220
237
|
this.urlElicitationContexts.delete(elicitationId);
|
|
221
238
|
this.tombstones.set(sessionId, {
|
|
@@ -248,6 +265,12 @@ class MultiplexClient {
|
|
|
248
265
|
state.settlePendingElicitations();
|
|
249
266
|
}
|
|
250
267
|
}
|
|
268
|
+
disconnectAllMcpConnections() {
|
|
269
|
+
for (const [sessionId, state] of this.sessions) {
|
|
270
|
+
this.disconnectMcpConnectionsForSession(sessionId, state);
|
|
271
|
+
}
|
|
272
|
+
this.mcpServerSessions.clear();
|
|
273
|
+
}
|
|
251
274
|
requestPermission(params) {
|
|
252
275
|
const state = this.sessions.get(params.sessionId);
|
|
253
276
|
// Unknown/closed session: refuse rather than silently allow a tool we can't attribute.
|
|
@@ -373,6 +396,51 @@ class MultiplexClient {
|
|
|
373
396
|
killTerminal(params) {
|
|
374
397
|
return this.dispatch(params, CLIENT_METHODS.terminal_kill, this.handlers?.terminal?.killTerminal);
|
|
375
398
|
}
|
|
399
|
+
async mcpConnect(params) {
|
|
400
|
+
const handler = this.handlers?.mcp?.connect;
|
|
401
|
+
if (typeof handler !== "function")
|
|
402
|
+
throw methodNotAdvertised(CLIENT_METHODS.mcp_connect);
|
|
403
|
+
const sessionId = this.mcpServerSessions.get(params.serverId);
|
|
404
|
+
if (!sessionId)
|
|
405
|
+
throw unknownMcpServer(params.serverId);
|
|
406
|
+
const response = await handler(params, this.handlerContext({ sessionId }));
|
|
407
|
+
this.mcpConnectionSessions.set(response.connectionId, sessionId);
|
|
408
|
+
this.sessions.get(sessionId)?.mcpConnectionIds.add(response.connectionId);
|
|
409
|
+
return response;
|
|
410
|
+
}
|
|
411
|
+
async mcpMessage(params) {
|
|
412
|
+
const handler = this.handlers?.mcp?.message;
|
|
413
|
+
if (typeof handler !== "function")
|
|
414
|
+
throw methodNotAdvertised(CLIENT_METHODS.mcp_message);
|
|
415
|
+
const ctx = this.handlerContext({ sessionId: this.sessionIdForMcpConnection(params.connectionId) });
|
|
416
|
+
return handler(params, ctx);
|
|
417
|
+
}
|
|
418
|
+
mcpMessageNotification(params) {
|
|
419
|
+
const handler = this.handlers?.mcp?.message;
|
|
420
|
+
if (typeof handler !== "function")
|
|
421
|
+
return;
|
|
422
|
+
const sessionId = this.mcpConnectionSessions.get(params.connectionId);
|
|
423
|
+
if (!sessionId)
|
|
424
|
+
return;
|
|
425
|
+
try {
|
|
426
|
+
Promise.resolve(handler(params, this.handlerContext({ sessionId }))).catch(() => { });
|
|
427
|
+
}
|
|
428
|
+
catch {
|
|
429
|
+
// Notifications have no response path; teardown remains best-effort and non-fatal.
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
async mcpDisconnect(params) {
|
|
433
|
+
const handler = this.handlers?.mcp?.disconnect;
|
|
434
|
+
if (typeof handler !== "function")
|
|
435
|
+
throw methodNotAdvertised(CLIENT_METHODS.mcp_disconnect);
|
|
436
|
+
const sessionId = this.sessionIdForMcpConnection(params.connectionId);
|
|
437
|
+
try {
|
|
438
|
+
return (await handler(params, this.handlerContext({ sessionId }))) ?? {};
|
|
439
|
+
}
|
|
440
|
+
finally {
|
|
441
|
+
this.dropMcpConnection(params.connectionId, sessionId);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
376
444
|
sessionUpdate(params) {
|
|
377
445
|
const state = this.sessions.get(params.sessionId);
|
|
378
446
|
// Fold into the accumulator FIRST (the drain contract), THEN bubble the event up unchanged.
|
|
@@ -406,10 +474,42 @@ class MultiplexClient {
|
|
|
406
474
|
this.sessions.get(ctx.sessionId)?.urlElicitationIds.delete(params.elicitationId);
|
|
407
475
|
this.onEvent?.("elicitation_complete", { ...ctx, notification: params });
|
|
408
476
|
}
|
|
477
|
+
sessionIdForMcpConnection(connectionId) {
|
|
478
|
+
const sessionId = this.mcpConnectionSessions.get(connectionId);
|
|
479
|
+
if (!sessionId)
|
|
480
|
+
throw unknownMcpConnection(connectionId);
|
|
481
|
+
return sessionId;
|
|
482
|
+
}
|
|
483
|
+
dropMcpConnection(connectionId, sessionId) {
|
|
484
|
+
this.mcpConnectionSessions.delete(connectionId);
|
|
485
|
+
this.sessions.get(sessionId)?.mcpConnectionIds.delete(connectionId);
|
|
486
|
+
}
|
|
487
|
+
disconnectMcpConnectionsForSession(sessionId, state) {
|
|
488
|
+
const handler = this.handlers?.mcp?.disconnect;
|
|
489
|
+
const ctx = { sessionId, cwd: state.cwd, label: state.label, runId: state.runId };
|
|
490
|
+
for (const connectionId of [...state.mcpConnectionIds]) {
|
|
491
|
+
this.mcpConnectionSessions.delete(connectionId);
|
|
492
|
+
state.mcpConnectionIds.delete(connectionId);
|
|
493
|
+
if (typeof handler !== "function")
|
|
494
|
+
continue;
|
|
495
|
+
try {
|
|
496
|
+
Promise.resolve(handler({ connectionId }, ctx)).catch(() => { });
|
|
497
|
+
}
|
|
498
|
+
catch {
|
|
499
|
+
// Best-effort teardown: a broken MCP cleanup hook must not block session release/death.
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
409
503
|
}
|
|
410
504
|
function unknownSession(sessionId) {
|
|
411
505
|
return RequestError.invalidParams({ sessionId }, `unknown session: ${sessionId}`);
|
|
412
506
|
}
|
|
507
|
+
function unknownMcpServer(serverId) {
|
|
508
|
+
return RequestError.invalidParams({ serverId }, `unknown MCP-over-ACP server: ${serverId}`);
|
|
509
|
+
}
|
|
510
|
+
function unknownMcpConnection(connectionId) {
|
|
511
|
+
return RequestError.invalidParams({ connectionId }, `unknown MCP-over-ACP connection: ${connectionId}`);
|
|
512
|
+
}
|
|
413
513
|
function cancelledPermissionResponse() {
|
|
414
514
|
return { outcome: { outcome: "cancelled" } };
|
|
415
515
|
}
|
|
@@ -479,6 +579,11 @@ function layerMeta(...layers) {
|
|
|
479
579
|
return undefined;
|
|
480
580
|
return Object.assign({}, ...present);
|
|
481
581
|
}
|
|
582
|
+
function acpMcpServerIds(servers) {
|
|
583
|
+
return servers
|
|
584
|
+
?.filter((server) => "type" in server && server.type === "acp")
|
|
585
|
+
.map((server) => server.serverId) ?? [];
|
|
586
|
+
}
|
|
482
587
|
/** Merge the engine runId correlation stamp into a backend's session/new `_meta`. Returns the
|
|
483
588
|
* meta unchanged when no runId is given (so a backend that sends no `_meta` keeps sending none). */
|
|
484
589
|
function stampRunId(meta, runId) {
|
|
@@ -583,6 +688,10 @@ export class PooledConnection {
|
|
|
583
688
|
.onRequest(CLIENT_METHODS.terminal_release, ({ params }) => this.client.releaseTerminal(params))
|
|
584
689
|
.onRequest(CLIENT_METHODS.terminal_wait_for_exit, ({ params }) => this.client.waitForTerminalExit(params))
|
|
585
690
|
.onRequest(CLIENT_METHODS.terminal_kill, ({ params }) => this.client.killTerminal(params))
|
|
691
|
+
.onRequest(CLIENT_METHODS.mcp_connect, parseConnectMcpRequest, ({ params }) => this.client.mcpConnect(params))
|
|
692
|
+
.onRequest(CLIENT_METHODS.mcp_message, parseMessageMcpRequest, ({ params }) => this.client.mcpMessage(params))
|
|
693
|
+
.onRequest(CLIENT_METHODS.mcp_disconnect, parseDisconnectMcpRequest, ({ params }) => this.client.mcpDisconnect(params))
|
|
694
|
+
.onNotification(CLIENT_METHODS.mcp_message, parseMessageMcpNotification, ({ params }) => this.client.mcpMessageNotification(params))
|
|
586
695
|
.connect(stream);
|
|
587
696
|
// Death detection. The connection's `signal` aborts the INSTANT the underlying stream closes
|
|
588
697
|
// (process crash or our own dispose) — in the SAME close() that rejects pending requests — so
|
|
@@ -622,10 +731,16 @@ export class PooledConnection {
|
|
|
622
731
|
}
|
|
623
732
|
assertSupportedMcpServers(opts) {
|
|
624
733
|
const unsupported = this.negotiated
|
|
625
|
-
? unsupportedMcpServer(opts.mcpServers, this.negotiated.agent
|
|
734
|
+
? unsupportedMcpServer(opts.mcpServers, this.negotiated.agent, {
|
|
735
|
+
clientCanServeAcp: hasFullMcpHandlers(this.clientHandlers?.mcp),
|
|
736
|
+
})
|
|
626
737
|
: undefined;
|
|
627
738
|
if (!unsupported)
|
|
628
739
|
return;
|
|
740
|
+
if (unsupported.reason === "client") {
|
|
741
|
+
throw new WorkflowError(`MCP server "${unsupported.name}" uses the "acp" transport, but this runner has no ` +
|
|
742
|
+
"complete clientHandlers.mcp implementation to serve it", WorkflowErrorCode.SCRIPT_VALIDATION_ERROR, { recoverable: false, agentLabel: opts.label });
|
|
743
|
+
}
|
|
629
744
|
throw new WorkflowError(`MCP server "${unsupported.name}" uses the "${unsupported.transport}" transport, which the ` +
|
|
630
745
|
`${this.backendId} agent does not support`, WorkflowErrorCode.SCRIPT_VALIDATION_ERROR, { recoverable: false, agentLabel: opts.label });
|
|
631
746
|
}
|
|
@@ -658,6 +773,7 @@ export class PooledConnection {
|
|
|
658
773
|
this.resolveDead();
|
|
659
774
|
this.client.settleAllPendingPermissions();
|
|
660
775
|
this.client.settleAllPendingElicitations();
|
|
776
|
+
this.client.disconnectAllMcpConnections();
|
|
661
777
|
// A crash (not a graceful dispose) is worth surfacing for observability; the engine still
|
|
662
778
|
// handles it by retrying the run on a fresh process. Best-effort, after death is recorded.
|
|
663
779
|
if (this.onEvent && !this.disposing) {
|
|
@@ -754,7 +870,7 @@ export class PooledConnection {
|
|
|
754
870
|
...(meta ? { _meta: meta } : {}),
|
|
755
871
|
};
|
|
756
872
|
const response = await this.race(this.connection.agent.request(AGENT_METHODS.session_new, request));
|
|
757
|
-
const state = new SessionState(opts.cwd, opts.policy, opts.permissionResolver, opts.elicitationResolver, opts.label, opts.runId, response.modes, opts.retainSessionLog ?? true);
|
|
873
|
+
const state = new SessionState(opts.cwd, opts.policy, opts.permissionResolver, opts.elicitationResolver, opts.label, opts.runId, response.modes, acpMcpServerIds(opts.mcpServers), opts.retainSessionLog ?? true);
|
|
758
874
|
this.client.register(response.sessionId, state);
|
|
759
875
|
return new SessionHandle(this, response.sessionId, state, response.configOptions ?? [], opts);
|
|
760
876
|
}
|
|
@@ -781,7 +897,7 @@ export class PooledConnection {
|
|
|
781
897
|
async reattachSession(method, sessionId, opts) {
|
|
782
898
|
this._activeSessions += 1;
|
|
783
899
|
let registered = false;
|
|
784
|
-
const state = new SessionState(opts.cwd, opts.policy, opts.permissionResolver, opts.elicitationResolver, opts.label, opts.runId, undefined, opts.retainSessionLog ?? true);
|
|
900
|
+
const state = new SessionState(opts.cwd, opts.policy, opts.permissionResolver, opts.elicitationResolver, opts.label, opts.runId, undefined, acpMcpServerIds(opts.mcpServers), opts.retainSessionLog ?? true);
|
|
785
901
|
try {
|
|
786
902
|
await this.ready;
|
|
787
903
|
this.assertLifecycleSupported(method, opts.label);
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -56,13 +56,16 @@ export declare function gateCustomMeta(meta: Record<string, unknown> | undefined
|
|
|
56
56
|
* bracketed text notes so context is never silently lost. Returns the SAME array reference when
|
|
57
57
|
* no block changes and never mutates the input or any surviving block. */
|
|
58
58
|
export declare function adaptPromptContent(blocks: ContentBlock[], agent: AgentCapabilities, backendId: string): ContentBlock[];
|
|
59
|
-
/** The first client-provided MCP server whose transport
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
export declare function unsupportedMcpServer(servers: McpServerConfig[] | undefined, agent: AgentCapabilities
|
|
59
|
+
/** The first client-provided MCP server whose transport cannot be served, or undefined when every
|
|
60
|
+
* server is serviceable. stdio is ALWAYS serviceable (the baseline transport); http/sse keep the
|
|
61
|
+
* legacy leniency and gate only after any mcpCapabilities block exists. ACP transport is stricter:
|
|
62
|
+
* both sides must be explicit because the client is the MCP server host and an unwired declaration
|
|
63
|
+
* would otherwise spend tokens before failing at mcp/connect. */
|
|
64
|
+
export declare function unsupportedMcpServer(servers: McpServerConfig[] | undefined, agent: AgentCapabilities, options?: {
|
|
65
|
+
clientCanServeAcp?: boolean;
|
|
66
|
+
}): {
|
|
65
67
|
name: string;
|
|
66
|
-
transport: "http" | "sse";
|
|
68
|
+
transport: "http" | "sse" | "acp";
|
|
69
|
+
reason?: "client";
|
|
67
70
|
} | undefined;
|
|
68
71
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQ5C;;;iGAGiG;AACjG,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAInD,CAAC;AAEF,qFAAqF;AACrF,MAAM,WAAW,sBAAsB;IACrC;0FACsF;IACtF,eAAe,EAAE,MAAM,CAAC;IACxB;4DACwD;IACxD,KAAK,EAAE,iBAAiB,CAAC;IACzB,+DAA+D;IAC/D,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,sFAAsF;IACtF,aAAa,EAAE,OAAO,CAAC;IACvB;mGAC+F;IAC/F,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0CAA0C;IAC1C,oBAAoB,EAAE,OAAO,CA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EAC5C,SAAS,GAAE,SAAS,MAAM,EAA2B,GACpD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAWrC;AAED;;;;;2EAK2E;AAC3E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EAAE,EACtB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,GAChB,YAAY,EAAE,CAchB;AAkCD;;;;kEAIkE;AAClE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS,EACtC,KAAK,EAAE,iBAAiB,EACxB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;CAAE,GAAG,SAAS,CAkBpF"}
|
package/dist/capabilities.js
CHANGED
|
@@ -153,22 +153,28 @@ function unsupportedPromptBlockNote(block, agent, backendId) {
|
|
|
153
153
|
return undefined;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
/** The first client-provided MCP server whose transport
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
export function unsupportedMcpServer(servers, agent) {
|
|
156
|
+
/** The first client-provided MCP server whose transport cannot be served, or undefined when every
|
|
157
|
+
* server is serviceable. stdio is ALWAYS serviceable (the baseline transport); http/sse keep the
|
|
158
|
+
* legacy leniency and gate only after any mcpCapabilities block exists. ACP transport is stricter:
|
|
159
|
+
* both sides must be explicit because the client is the MCP server host and an unwired declaration
|
|
160
|
+
* would otherwise spend tokens before failing at mcp/connect. */
|
|
161
|
+
export function unsupportedMcpServer(servers, agent, options = {}) {
|
|
162
162
|
const mcp = agent.mcpCapabilities;
|
|
163
|
-
if (!
|
|
163
|
+
if (!servers)
|
|
164
164
|
return undefined;
|
|
165
165
|
for (const server of servers) {
|
|
166
|
-
if ("type" in server && server.type === "http" && mcp.http !== true) {
|
|
166
|
+
if ("type" in server && server.type === "http" && mcp && mcp.http !== true) {
|
|
167
167
|
return { name: server.name, transport: "http" };
|
|
168
168
|
}
|
|
169
|
-
if ("type" in server && server.type === "sse" && mcp.sse !== true) {
|
|
169
|
+
if ("type" in server && server.type === "sse" && mcp && mcp.sse !== true) {
|
|
170
170
|
return { name: server.name, transport: "sse" };
|
|
171
171
|
}
|
|
172
|
+
if ("type" in server && server.type === "acp" && mcp?.acp !== true) {
|
|
173
|
+
return { name: server.name, transport: "acp" };
|
|
174
|
+
}
|
|
175
|
+
if ("type" in server && server.type === "acp" && options.clientCanServeAcp !== true) {
|
|
176
|
+
return { name: server.name, transport: "acp", reason: "client" };
|
|
177
|
+
}
|
|
172
178
|
}
|
|
173
179
|
return undefined;
|
|
174
180
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientCapabilities, CreateTerminalRequest, CreateTerminalResponse, KillTerminalRequest, KillTerminalResponse, ReadTextFileRequest, ReadTextFileResponse, ReleaseTerminalRequest, ReleaseTerminalResponse, TerminalOutputRequest, TerminalOutputResponse, WaitForTerminalExitRequest, WaitForTerminalExitResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
|
|
1
|
+
import type { ClientCapabilities, ConnectMcpRequest, ConnectMcpResponse, CreateTerminalRequest, CreateTerminalResponse, DisconnectMcpRequest, DisconnectMcpResponse, KillTerminalRequest, KillTerminalResponse, MessageMcpRequest, MessageMcpResponse, ReadTextFileRequest, ReadTextFileResponse, ReleaseTerminalRequest, ReleaseTerminalResponse, TerminalOutputRequest, TerminalOutputResponse, WaitForTerminalExitRequest, WaitForTerminalExitResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
|
|
2
2
|
export interface AcpSessionContext {
|
|
3
3
|
readonly sessionId: string;
|
|
4
4
|
readonly cwd: string;
|
|
@@ -16,9 +16,15 @@ export interface TerminalHandlers {
|
|
|
16
16
|
killTerminal(params: KillTerminalRequest, ctx: AcpSessionContext): Promise<KillTerminalResponse | void> | KillTerminalResponse | void;
|
|
17
17
|
releaseTerminal(params: ReleaseTerminalRequest, ctx: AcpSessionContext): Promise<ReleaseTerminalResponse | void> | ReleaseTerminalResponse | void;
|
|
18
18
|
}
|
|
19
|
+
export interface McpHandlers {
|
|
20
|
+
connect(params: ConnectMcpRequest, ctx: AcpSessionContext): Promise<ConnectMcpResponse> | ConnectMcpResponse;
|
|
21
|
+
message(params: MessageMcpRequest, ctx: AcpSessionContext): Promise<MessageMcpResponse> | MessageMcpResponse;
|
|
22
|
+
disconnect(params: DisconnectMcpRequest, ctx: AcpSessionContext): Promise<DisconnectMcpResponse | void> | DisconnectMcpResponse | void;
|
|
23
|
+
}
|
|
19
24
|
export interface ClientHandlers {
|
|
20
25
|
fs?: FsHandlers;
|
|
21
26
|
terminal?: TerminalHandlers;
|
|
27
|
+
mcp?: McpHandlers;
|
|
22
28
|
}
|
|
23
29
|
export interface ClientCapabilityOptions {
|
|
24
30
|
/** Advertise unstable ACP elicitation support only when this connection has a runner-wide
|
|
@@ -29,8 +35,11 @@ export interface ClientCapabilityOptions {
|
|
|
29
35
|
/** The client capability advertisement: fs/terminal derived solely from registered consumer
|
|
30
36
|
* handlers, plus the capabilities this client supports natively regardless of handlers —
|
|
31
37
|
* boolean session config options (SessionHandle drives the catalog programmatically and
|
|
32
|
-
* handles `type: "boolean"` entries, e.g. codex-acp's Fast-mode toggle).
|
|
38
|
+
* handles `type: "boolean"` entries, e.g. codex-acp's Fast-mode toggle). The installed ACP SDK
|
|
39
|
+
* has no ClientCapabilities field for MCP-over-ACP; support is declared by sending
|
|
40
|
+
* `mcpServers[{ type: "acp" }]` on session/new and then gated against handlers at that site. */
|
|
33
41
|
export declare function clientCapabilitiesFor(handlers: ClientHandlers | undefined, options?: ClientCapabilityOptions): ClientCapabilities;
|
|
34
|
-
/** Fail-fast validation for JavaScript consumers bypassing the
|
|
42
|
+
/** Fail-fast validation for JavaScript consumers bypassing the grouped handler types. */
|
|
35
43
|
export declare function validateClientHandlers(handlers: ClientHandlers | undefined): void;
|
|
44
|
+
export declare function hasFullMcpHandlers(mcp: McpHandlers | undefined): mcp is McpHandlers;
|
|
36
45
|
//# sourceMappingURL=client-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-handlers.d.ts","sourceRoot":"","sources":["../src/client-handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,CACX,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC;IACxD,aAAa,CAAC,CACZ,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,GAAG,qBAAqB,GAAG,IAAI,CAAC;CACzE;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CACZ,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,sBAAsB,CAAC,GAAG,sB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G,EAAE,iBAAiB,GACrB,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IACpD,UAAU,CACR,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,GAAG,qBAAqB,GAAG,IAAI,CAAC;CACzE;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,GAAG,CAAC,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC;;0EAEsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAYD;;;;;iGAKiG;AACjG,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,OAAO,GAAE,uBAA4B,GACpC,kBAAkB,CAapB;AAED,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAajF;AAMD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,GAAG,GAAG,IAAI,WAAW,CAEnF"}
|
package/dist/client-handlers.js
CHANGED
|
@@ -5,10 +5,13 @@ const TERMINAL_HANDLER_METHODS = [
|
|
|
5
5
|
"killTerminal",
|
|
6
6
|
"releaseTerminal",
|
|
7
7
|
];
|
|
8
|
+
const MCP_HANDLER_METHODS = ["connect", "message", "disconnect"];
|
|
8
9
|
/** The client capability advertisement: fs/terminal derived solely from registered consumer
|
|
9
10
|
* handlers, plus the capabilities this client supports natively regardless of handlers —
|
|
10
11
|
* boolean session config options (SessionHandle drives the catalog programmatically and
|
|
11
|
-
* handles `type: "boolean"` entries, e.g. codex-acp's Fast-mode toggle).
|
|
12
|
+
* handles `type: "boolean"` entries, e.g. codex-acp's Fast-mode toggle). The installed ACP SDK
|
|
13
|
+
* has no ClientCapabilities field for MCP-over-ACP; support is declared by sending
|
|
14
|
+
* `mcpServers[{ type: "acp" }]` on session/new and then gated against handlers at that site. */
|
|
12
15
|
export function clientCapabilitiesFor(handlers, options = {}) {
|
|
13
16
|
const capabilities = { session: { configOptions: { boolean: {} } } };
|
|
14
17
|
if (options.elicitation)
|
|
@@ -27,18 +30,30 @@ export function clientCapabilitiesFor(handlers, options = {}) {
|
|
|
27
30
|
capabilities.terminal = true;
|
|
28
31
|
return capabilities;
|
|
29
32
|
}
|
|
30
|
-
/** Fail-fast validation for JavaScript consumers bypassing the
|
|
33
|
+
/** Fail-fast validation for JavaScript consumers bypassing the grouped handler types. */
|
|
31
34
|
export function validateClientHandlers(handlers) {
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
if (handlers?.terminal) {
|
|
36
|
+
const missing = missingTerminalMethods(handlers.terminal);
|
|
37
|
+
if (missing.length > 0) {
|
|
38
|
+
throw new Error(`clientHandlers.terminal missing required methods: ${missing.join(", ")}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (handlers?.mcp) {
|
|
42
|
+
const missing = missingMcpMethods(handlers.mcp);
|
|
43
|
+
if (missing.length > 0) {
|
|
44
|
+
throw new Error(`clientHandlers.mcp missing required methods: ${missing.join(", ")}`);
|
|
45
|
+
}
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
function hasFullTerminalHandlers(terminal) {
|
|
40
49
|
return Boolean(terminal && missingTerminalMethods(terminal).length === 0);
|
|
41
50
|
}
|
|
51
|
+
export function hasFullMcpHandlers(mcp) {
|
|
52
|
+
return Boolean(mcp && missingMcpMethods(mcp).length === 0);
|
|
53
|
+
}
|
|
42
54
|
function missingTerminalMethods(terminal) {
|
|
43
55
|
return TERMINAL_HANDLER_METHODS.filter((method) => typeof terminal[method] !== "function");
|
|
44
56
|
}
|
|
57
|
+
function missingMcpMethods(mcp) {
|
|
58
|
+
return MCP_HANDLER_METHODS.filter((method) => typeof mcp[method] !== "function");
|
|
59
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { AcpRunnerOptions, DeleteSessionOptions, ListSessionsOptions, Reatt
|
|
|
3
3
|
export { InteractiveSession } from "./interactive.js";
|
|
4
4
|
export type { InteractiveSessionOptions, InteractiveTurn } from "./interactive.js";
|
|
5
5
|
export { AGENT_METHODS, CLIENT_METHODS } from "@agentclientprotocol/sdk";
|
|
6
|
-
export type { AgentNotificationMethod, AgentNotificationParamsByMethod, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DeleteSessionRequest, DeleteSessionResponse, ElicitationAcceptAction, ElicitationCapabilities, ElicitationContentValue, ElicitationFormCapabilities, ElicitationFormMode, ElicitationId, ElicitationPropertySchema, ElicitationRequestScope, ElicitationSchema, ElicitationSchemaType, ElicitationSessionScope, ElicitationUrlCapabilities, ElicitationUrlMode, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionMode, SessionModeState, SessionInfo, SendRequestOptions, } from "@agentclientprotocol/sdk";
|
|
6
|
+
export type { AgentNotificationMethod, AgentNotificationParamsByMethod, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, CompleteElicitationNotification, ConnectMcpRequest, ConnectMcpResponse, CreateElicitationRequest, CreateElicitationResponse, DeleteSessionRequest, DeleteSessionResponse, DisconnectMcpRequest, DisconnectMcpResponse, ElicitationAcceptAction, ElicitationCapabilities, ElicitationContentValue, ElicitationFormCapabilities, ElicitationFormMode, ElicitationId, ElicitationPropertySchema, ElicitationRequestScope, ElicitationSchema, ElicitationSchemaType, ElicitationSessionScope, ElicitationUrlCapabilities, ElicitationUrlMode, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, McpConnectionId, McpServerAcp, McpServerAcpId, MessageMcpNotification, MessageMcpRequest, MessageMcpResponse, ResumeSessionRequest, ResumeSessionResponse, SessionMode, SessionModeState, SessionInfo, SendRequestOptions, } from "@agentclientprotocol/sdk";
|
|
7
7
|
export { BACKENDS_ENV, registryWithRunBackends, resolveBackendRegistry } from "./registry.js";
|
|
8
8
|
export type { BackendRegistry, CustomBackendConfig, RegisteredBackend } from "./registry.js";
|
|
9
9
|
export { PooledConnection, SessionHandle } from "./acp-client.js";
|
|
@@ -15,7 +15,7 @@ export type { NegotiatedCapabilities } from "./capabilities.js";
|
|
|
15
15
|
export { AcpAgentPool, resolvePoolSize } from "./pool.js";
|
|
16
16
|
export type { AcpPoolOptions, AcpPoolDeps } from "./pool.js";
|
|
17
17
|
export { clientCapabilitiesFor } from "./client-handlers.js";
|
|
18
|
-
export type { AcpSessionContext, ClientCapabilityOptions, ClientHandlers, FsHandlers, TerminalHandlers, } from "./client-handlers.js";
|
|
18
|
+
export type { AcpSessionContext, ClientCapabilityOptions, ClientHandlers, FsHandlers, McpHandlers, TerminalHandlers, } from "./client-handlers.js";
|
|
19
19
|
export { ACP_CROSS_CUTTING_EVENT_NAMES, TypedEventEmitter, emitSessionUpdate } from "./events.js";
|
|
20
20
|
export type { AcpRunnerEventMap, AcpEventName, AcpEventListener, AcpEventContext, AcpEventSink, AcpSessionUpdate, AcpUpdateKind, AcpElicitationCompleteEvent, AcpElicitationEvent, AcpElicitationPendingEvent, AcpPermissionPendingEvent, AcpPermissionEvent, AcpRawMessageEvent, AcpBackendErrorEvent, } from "./events.js";
|
|
21
21
|
export type { Backend, BackendId, BuiltinBackendId, SessionMetaInputs, SpawnConfig, StructuredSource, } from "./backend.js";
|
|
@@ -25,6 +25,7 @@ export { CustomAcpBackend } from "./backends/custom.js";
|
|
|
25
25
|
export { decidePermission } from "./permissions.js";
|
|
26
26
|
export type { ElicitationResolver, PermissionResolver, ToolPolicy } from "./permissions.js";
|
|
27
27
|
export { UsageAccumulator } from "./usage.js";
|
|
28
|
+
export type { McpAcpServerConfig, McpServerConfig } from "@automatalabs/shared-types";
|
|
28
29
|
export { toJsonSchema, toStrictJsonSchema } from "./schema-strict.js";
|
|
29
30
|
export { extractValidated, findJsonBlock, parseFinalJson, resolveStructuredOutput, validateValue, } from "./structured-output.js";
|
|
30
31
|
export type { ResolveOptions, StructuredSession } from "./structured-output.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7E,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC7B,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,e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,iBAAiB,CAAC"}
|
|
@@ -11,9 +11,9 @@ export const CLIENT_METHOD_COVERAGE = {
|
|
|
11
11
|
[CLIENT_METHODS.terminal_release]: "served",
|
|
12
12
|
[CLIENT_METHODS.terminal_wait_for_exit]: "served",
|
|
13
13
|
[CLIENT_METHODS.terminal_kill]: "served",
|
|
14
|
-
[CLIENT_METHODS.mcp_connect]: "
|
|
15
|
-
[CLIENT_METHODS.mcp_message]: "
|
|
16
|
-
[CLIENT_METHODS.mcp_disconnect]: "
|
|
14
|
+
[CLIENT_METHODS.mcp_connect]: "served",
|
|
15
|
+
[CLIENT_METHODS.mcp_message]: "served",
|
|
16
|
+
[CLIENT_METHODS.mcp_disconnect]: "served",
|
|
17
17
|
[CLIENT_METHODS.elicitation_create]: "served",
|
|
18
18
|
[CLIENT_METHODS.elicitation_complete]: "served",
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automatalabs/acp-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@agentclientprotocol/claude-agent-acp": "0.56.0",
|
|
32
32
|
"@automatalabs/codex-acp": "1.4.0",
|
|
33
33
|
"typebox": "1.3.2",
|
|
34
|
-
"@automatalabs/shared-types": "0.
|
|
34
|
+
"@automatalabs/shared-types": "0.10.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc -b",
|