@automatalabs/acp-agents 0.35.2 → 0.36.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/README.md +52 -0
- package/dist/acp-client.d.ts +219 -0
- package/dist/acp-client.d.ts.map +1 -1
- package/dist/acp-client.js +320 -1
- package/dist/backends/opencode.d.ts.map +1 -1
- package/dist/backends/opencode.js +42 -15
- package/dist/capabilities.d.ts +6 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +15 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/interactive.d.ts +333 -1
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +662 -5
- package/dist/protocol-coverage.d.ts +14 -4
- package/dist/protocol-coverage.d.ts.map +1 -1
- package/dist/protocol-coverage.js +30 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +12 -1
- package/package.json +3 -3
package/dist/acp-client.js
CHANGED
|
@@ -42,6 +42,17 @@ const CLIENT_INFO = {
|
|
|
42
42
|
const CLAUDE_RAW_MESSAGE_METHOD = "_claude/sdkMessage";
|
|
43
43
|
/** Cross-agent vendor extension for injecting content into a live prompt turn. */
|
|
44
44
|
export const SESSION_STEERING_METHOD = "_session/steering";
|
|
45
|
+
/** Cross-agent vendor extension carrying turn-TERMINAL state for LOADED sessions (the re-attach
|
|
46
|
+
* arm's authoritative completion evidence — see `InteractiveSession.awaitCurrentTurn`): the
|
|
47
|
+
* `_session/loaded_turn/query` request answers whether the loaded session's founding turn is
|
|
48
|
+
* still running at the backend ("running"), observably completed while the host was down
|
|
49
|
+
* ("completed" — the replay's trailing assistant message is the turn's FINAL message), or ended
|
|
50
|
+
* without a terminal message ("interrupted" — nothing is running, re-issue is safe), and the
|
|
51
|
+
* `_session/loaded_turn/ended` notification fires when a turn that was "running" at query time
|
|
52
|
+
* ends (with its stop reason, or its error). Backends without the extension degrade
|
|
53
|
+
* guest-visibly through the same strict advertisement gate as steering. */
|
|
54
|
+
export const LOADED_TURN_QUERY_METHOD = "_session/loaded_turn/query";
|
|
55
|
+
export const LOADED_TURN_ENDED_METHOD = "_session/loaded_turn/ended";
|
|
45
56
|
/** Bound the best-effort session/close round-trip so a slow agent can't hang run()'s finally. */
|
|
46
57
|
const CLOSE_SESSION_TIMEOUT_MS = 5_000;
|
|
47
58
|
/** Grace for a cancelled prompt/config lifecycle to settle before close + process quarantine. */
|
|
@@ -198,6 +209,56 @@ class SessionState {
|
|
|
198
209
|
modes;
|
|
199
210
|
turnStartIndex = 0;
|
|
200
211
|
finalMessageStartIndex = 0;
|
|
212
|
+
/** The re-attach arm's transcript probe (phase D): where the LOADED
|
|
213
|
+
* session's founding turn starts — the assistant-text length after the
|
|
214
|
+
* LAST replayed user message (the founding turn's prompt). Tracked from
|
|
215
|
+
* the session/update stream; only meaningful for sessions re-opened via
|
|
216
|
+
* `session/load` (whose replay streams in BEFORE the load response). */
|
|
217
|
+
loadedTurnStartIndex = 0;
|
|
218
|
+
/** Whether the transcript ever showed a user message (a turn started at
|
|
219
|
+
* all — a session whose replay has none never received its prompt). */
|
|
220
|
+
sawUserMessage = false;
|
|
221
|
+
/** The KIND of the transcript's last content event: an assistant message
|
|
222
|
+
* chunk is a PROGRESS event, never a terminal marker by itself — the
|
|
223
|
+
* re-attach arm's completion evidence is a terminal assistant message
|
|
224
|
+
* on a SETTLED stream (no updates for the loaded-turn settle grace),
|
|
225
|
+
* not a trailing chunk at an arbitrary instant (phase-D review: a
|
|
226
|
+
* trailing chunk used to be treated as proof of completion, so partial
|
|
227
|
+
* output of a still-streaming turn could be settled as success). Any
|
|
228
|
+
* other trailing content (a user message, a tool call, a thought, a
|
|
229
|
+
* plan) means the founding turn ended without a terminal message —
|
|
230
|
+
* not observable as a successful completion. */
|
|
231
|
+
trailingContentKind = 'other';
|
|
232
|
+
/** Monotonic wall-clock of the session's most recent update (the
|
|
233
|
+
* re-attach arm's stream-settled probe — `applyUpdate` is synchronous
|
|
234
|
+
* on the wire, so this is the authoritative last-progress instant). */
|
|
235
|
+
lastUpdateAt = Date.now();
|
|
236
|
+
/** The re-attach arm's update watchers (woken by every session/update). */
|
|
237
|
+
updateWatchers = new Set();
|
|
238
|
+
/**
|
|
239
|
+
* The load boundary — the phase-D review round-2 fix for the re-attach
|
|
240
|
+
* arm's completion evidence. `session/load` obliges the agent to replay
|
|
241
|
+
* the ENTIRE persisted conversation and only then resolve the request,
|
|
242
|
+
* so the transcript is complete AT load resolution; anything applied
|
|
243
|
+
* after that instant is LIVE CONTINUATION evidence of a turn still
|
|
244
|
+
* running at the backend. `markLoadBoundary()` (called by the runner
|
|
245
|
+
* synchronously after the load response) snapshots the replay-complete
|
|
246
|
+
* state, and every CONTENT update applied after the mark flips
|
|
247
|
+
* `sawPostLoadContentUpdate` — the seam's "the turn may still be
|
|
248
|
+
* running" signal. Bookkeeping updates (usage, mode, available
|
|
249
|
+
* commands, session info) are NOT continuation evidence (claude's
|
|
250
|
+
* adapter emits an `available_commands_update` right after every
|
|
251
|
+
* load).
|
|
252
|
+
*/
|
|
253
|
+
loadBoundary = null;
|
|
254
|
+
sawPostLoadContentUpdate = false;
|
|
255
|
+
/** The loaded-turn TERMINAL state (the `_session/loaded_turn` extension's authoritative
|
|
256
|
+
* completion evidence): the `_session/loaded_turn/ended` notification this session received
|
|
257
|
+
* (a turn that was running at load ended), or null when no such notification arrived. The
|
|
258
|
+
* seam's `awaitCurrentTurn` waits on this instead of guessing from a quiet gap. */
|
|
259
|
+
loadedTurnEnded = null;
|
|
260
|
+
/** The loaded-turn-ended watchers (woken by every ended notification). */
|
|
261
|
+
loadedTurnEndedWatchers = new Set();
|
|
201
262
|
/** `label`/`runId`/`callIndex` are carried here ONLY so the MultiplexClient can stamp them onto emitted
|
|
202
263
|
* events as context — they never affect routing or the wire request. */
|
|
203
264
|
constructor(cwd, policy, permissionResolver, elicitationResolver, label, runId, callIndex, initializeMeta, modes, mcpServerIds = [], retainSessionLog = true) {
|
|
@@ -241,8 +302,17 @@ class SessionState {
|
|
|
241
302
|
return this.textChunks.slice(this.finalMessageStartIndex).join("");
|
|
242
303
|
}
|
|
243
304
|
applyUpdate(update) {
|
|
305
|
+
this.lastUpdateAt = Date.now();
|
|
306
|
+
// A CONTENT update applied after the load boundary is live-continuation
|
|
307
|
+
// evidence (a turn still running at the backend). Bookkeeping update
|
|
308
|
+
// kinds never flip the flag — the seam must not mistake claude's
|
|
309
|
+
// post-load `available_commands_update` for a running turn.
|
|
310
|
+
if (this.loadBoundary !== null && isContentUpdate(update.sessionUpdate)) {
|
|
311
|
+
this.sawPostLoadContentUpdate = true;
|
|
312
|
+
}
|
|
244
313
|
switch (update.sessionUpdate) {
|
|
245
314
|
case "agent_message_chunk": {
|
|
315
|
+
this.trailingContentKind = 'assistant-message';
|
|
246
316
|
if (update.content.type === "text") {
|
|
247
317
|
this.textChunks.push(update.content.text);
|
|
248
318
|
this.history.push({
|
|
@@ -255,6 +325,7 @@ class SessionState {
|
|
|
255
325
|
break;
|
|
256
326
|
}
|
|
257
327
|
case "tool_call": {
|
|
328
|
+
this.trailingContentKind = 'other';
|
|
258
329
|
this.finalMessageStartIndex = this.textChunks.length;
|
|
259
330
|
this.history.push({
|
|
260
331
|
role: "tool",
|
|
@@ -267,13 +338,32 @@ class SessionState {
|
|
|
267
338
|
}
|
|
268
339
|
// Any other CONTENT event also ends the in-flight assistant message — text streamed after
|
|
269
340
|
// it belongs to a new message. Bookkeeping updates (usage, mode) never break a message.
|
|
270
|
-
case "user_message_chunk":
|
|
341
|
+
case "user_message_chunk": {
|
|
342
|
+
// The loaded-session founding-turn probe (see the fields above): the
|
|
343
|
+
// LAST user message in the replay is the founding turn's prompt, and
|
|
344
|
+
// its assistant text starts after it.
|
|
345
|
+
this.sawUserMessage = true;
|
|
346
|
+
this.loadedTurnStartIndex = this.textChunks.length;
|
|
347
|
+
this.trailingContentKind = 'other';
|
|
348
|
+
this.finalMessageStartIndex = this.textChunks.length;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
271
351
|
case "agent_thought_chunk":
|
|
272
352
|
case "tool_call_update":
|
|
273
353
|
case "plan": {
|
|
354
|
+
// A trailing thought/tool/plan event means the model is still
|
|
355
|
+
// working — the founding turn is not observably complete.
|
|
356
|
+
this.trailingContentKind = 'other';
|
|
274
357
|
this.finalMessageStartIndex = this.textChunks.length;
|
|
275
358
|
break;
|
|
276
359
|
}
|
|
360
|
+
case "plan_update":
|
|
361
|
+
case "plan_removed": {
|
|
362
|
+
// Plan mutations are content progress but never a completed
|
|
363
|
+
// assistant message; they do not segment the final message.
|
|
364
|
+
this.trailingContentKind = 'other';
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
277
367
|
case "usage_update": {
|
|
278
368
|
this.usage.recordCost(update.cost);
|
|
279
369
|
// Also feed the context token counts so AgentUsage.total is non-zero for backends
|
|
@@ -294,12 +384,121 @@ class SessionState {
|
|
|
294
384
|
default:
|
|
295
385
|
break;
|
|
296
386
|
}
|
|
387
|
+
// Wake the re-attach arm's stream watchers after EVERY update kind
|
|
388
|
+
// (any update — chunk, thought, tool call, usage — resets the loaded
|
|
389
|
+
// turn's settle clock; the seam's quiet wait keys on this).
|
|
390
|
+
for (const watcher of this.updateWatchers)
|
|
391
|
+
watcher();
|
|
297
392
|
}
|
|
298
393
|
applyRawMessage(message) {
|
|
299
394
|
if (message && message.type === "result" && message.subtype === "success") {
|
|
300
395
|
this.rawResultSuccess = message;
|
|
301
396
|
}
|
|
302
397
|
}
|
|
398
|
+
/** The loaded-session founding-turn observability probe: whether the
|
|
399
|
+
* transcript shows a turn ever started (a user message) and the KIND of
|
|
400
|
+
* the trailing content event. The trailing kind is PROGRESS evidence,
|
|
401
|
+
* not completion by itself — the re-attach arm classifies completion
|
|
402
|
+
* from the LOAD BOUNDARY (the transcript as of load resolution) plus
|
|
403
|
+
* whether any content update followed the load (see
|
|
404
|
+
* `loadBoundaryState` and `InteractiveSession.awaitCurrentTurn`). */
|
|
405
|
+
loadedTurnState() {
|
|
406
|
+
return {
|
|
407
|
+
hasUserMessage: this.sawUserMessage,
|
|
408
|
+
trailingContentKind: this.trailingContentKind,
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
/** The most recent instant a session/update arrived for this session
|
|
412
|
+
* (the re-attach arm's stream-settled clock; `applyUpdate` runs
|
|
413
|
+
* synchronously on the wire, so the timestamp is authoritative). */
|
|
414
|
+
lastUpdateAtMs() {
|
|
415
|
+
return this.lastUpdateAt;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Mark the load boundary (see the field docs): called by the runner
|
|
419
|
+
* synchronously after the `session/load` response, when the replay is
|
|
420
|
+
* complete and the transcript holds the entire persisted conversation.
|
|
421
|
+
* Idempotent: the FIRST mark wins (a re-load over the same handle keeps
|
|
422
|
+
* the original boundary).
|
|
423
|
+
*/
|
|
424
|
+
markLoadBoundary() {
|
|
425
|
+
if (this.loadBoundary !== null)
|
|
426
|
+
return;
|
|
427
|
+
this.loadBoundary = {
|
|
428
|
+
hasUserMessage: this.sawUserMessage,
|
|
429
|
+
trailingContentKind: this.trailingContentKind,
|
|
430
|
+
};
|
|
431
|
+
this.sawPostLoadContentUpdate = false;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* The load-boundary probe (the re-attach arm's completion evidence;
|
|
435
|
+
* see `InteractiveSession.awaitCurrentTurn`): the replay-complete
|
|
436
|
+
* transcript state captured at load resolution, plus whether any
|
|
437
|
+
* CONTENT update arrived after the boundary (live-continuation
|
|
438
|
+
* evidence). `marked: false` when the handle was never load-marked (a
|
|
439
|
+
* session that did not come from the runner's `loadSession` path) —
|
|
440
|
+
* the seam refuses rather than guessing.
|
|
441
|
+
*/
|
|
442
|
+
loadBoundaryState() {
|
|
443
|
+
return {
|
|
444
|
+
marked: this.loadBoundary !== null,
|
|
445
|
+
hasUserMessage: this.loadBoundary?.hasUserMessage ?? this.sawUserMessage,
|
|
446
|
+
trailingContentKind: this.loadBoundary?.trailingContentKind ?? this.trailingContentKind,
|
|
447
|
+
sawPostLoadContentUpdate: this.sawPostLoadContentUpdate,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
/** Record the loaded-turn terminal notification (a turn that was
|
|
451
|
+
* running at load ended — with its stop reason, or its error) and
|
|
452
|
+
* wake the seam's watchers. Idempotent per session: the FIRST ended
|
|
453
|
+
* notification wins (a re-sent notification after a reconnect cannot
|
|
454
|
+
* overwrite the recorded terminal state). */
|
|
455
|
+
recordLoadedTurnEnded(notification) {
|
|
456
|
+
if (this.loadedTurnEnded !== null)
|
|
457
|
+
return;
|
|
458
|
+
this.loadedTurnEnded = {
|
|
459
|
+
...(notification.stopReason !== undefined ? { stopReason: notification.stopReason } : {}),
|
|
460
|
+
...(notification.error !== undefined ? { error: notification.error } : {}),
|
|
461
|
+
};
|
|
462
|
+
for (const watcher of this.loadedTurnEndedWatchers)
|
|
463
|
+
watcher();
|
|
464
|
+
}
|
|
465
|
+
/** The recorded loaded-turn terminal state, or null when the running
|
|
466
|
+
* turn has not ended (yet). */
|
|
467
|
+
loadedTurnEndedState() {
|
|
468
|
+
return this.loadedTurnEnded;
|
|
469
|
+
}
|
|
470
|
+
/** Watch the loaded-turn-ended channel: the listener fires when the
|
|
471
|
+
* `_session/loaded_turn/ended` notification arrives (and immediately
|
|
472
|
+
* for a notification that already arrived). Returns the unsubscribe
|
|
473
|
+
* thunk. The re-attach arm's authoritative terminal wait. */
|
|
474
|
+
subscribeLoadedTurnEnded(listener) {
|
|
475
|
+
if (this.loadedTurnEnded !== null) {
|
|
476
|
+
queueMicrotask(listener);
|
|
477
|
+
return () => { };
|
|
478
|
+
}
|
|
479
|
+
this.loadedTurnEndedWatchers.add(listener);
|
|
480
|
+
return () => {
|
|
481
|
+
this.loadedTurnEndedWatchers.delete(listener);
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
/** Watch the session/update stream: the listener fires after every
|
|
485
|
+
* applied update. Returns the unsubscribe thunk. The re-attach arm
|
|
486
|
+
* waits on this instead of polling, so a long still-running turn is
|
|
487
|
+
* observed with zero busy work. */
|
|
488
|
+
subscribeUpdates(listener) {
|
|
489
|
+
this.updateWatchers.add(listener);
|
|
490
|
+
return () => {
|
|
491
|
+
this.updateWatchers.delete(listener);
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
/** The founding turn's assistant text: the transcript accumulated after
|
|
495
|
+
* the last user-message boundary (the outcome text the re-attach arm
|
|
496
|
+
* resolves with — identical to `finalMessageText()` exactly when the
|
|
497
|
+
* trailing content event is an assistant message, which is the probe's
|
|
498
|
+
* completeness condition). */
|
|
499
|
+
loadedTurnText() {
|
|
500
|
+
return this.textChunks.slice(this.loadedTurnStartIndex).join('');
|
|
501
|
+
}
|
|
303
502
|
/** Settle every deferred permission still parked on this session. Used by release/cancel/death
|
|
304
503
|
* teardown so an interactive resolver can never strand an ACP prompt turn. */
|
|
305
504
|
settlePendingPermissions() {
|
|
@@ -661,6 +860,31 @@ class MultiplexClient {
|
|
|
661
860
|
}
|
|
662
861
|
}
|
|
663
862
|
extNotification(method, params) {
|
|
863
|
+
if (method === LOADED_TURN_ENDED_METHOD) {
|
|
864
|
+
// The loaded-turn terminal notification (the re-attach arm's
|
|
865
|
+
// authoritative completion evidence): route by sessionId and record
|
|
866
|
+
// the terminal state on the session (the seam's wait target).
|
|
867
|
+
const sessionId = typeof params.sessionId === "string" ? params.sessionId : undefined;
|
|
868
|
+
if (!sessionId)
|
|
869
|
+
return;
|
|
870
|
+
const state = this.sessions.get(sessionId);
|
|
871
|
+
if (!state)
|
|
872
|
+
return;
|
|
873
|
+
const raw = params.error;
|
|
874
|
+
const error = raw !== undefined && typeof raw === "object" && raw !== null
|
|
875
|
+
? {
|
|
876
|
+
name: typeof raw.name === "string" ? raw.name : "Error",
|
|
877
|
+
message: typeof raw.message === "string"
|
|
878
|
+
? raw.message
|
|
879
|
+
: String(raw.message),
|
|
880
|
+
}
|
|
881
|
+
: undefined;
|
|
882
|
+
const stopReason = typeof params.stopReason === "string"
|
|
883
|
+
? params.stopReason
|
|
884
|
+
: undefined;
|
|
885
|
+
state.recordLoadedTurnEnded({ ...(stopReason !== undefined ? { stopReason } : {}), ...(error !== undefined ? { error } : {}) });
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
664
888
|
if (method !== CLAUDE_RAW_MESSAGE_METHOD)
|
|
665
889
|
return;
|
|
666
890
|
// claude-agent-acp stamps the owning sessionId on every raw _claude/sdkMessage; route by it
|
|
@@ -984,6 +1208,7 @@ export class PooledConnection {
|
|
|
984
1208
|
this.connection = client({ name: CLIENT_INFO.name })
|
|
985
1209
|
.onNotification(CLIENT_METHODS.session_update, ({ params }) => this.client.sessionUpdate(params))
|
|
986
1210
|
.onNotification(CLAUDE_RAW_MESSAGE_METHOD, (params) => (params ?? {}), ({ params }) => this.client.extNotification(CLAUDE_RAW_MESSAGE_METHOD, params))
|
|
1211
|
+
.onNotification(LOADED_TURN_ENDED_METHOD, (params) => (params ?? {}), ({ params }) => this.client.extNotification(LOADED_TURN_ENDED_METHOD, params))
|
|
987
1212
|
.onNotification(CLIENT_METHODS.elicitation_complete, ({ params }) => this.client.elicitationComplete(params))
|
|
988
1213
|
.onRequest(CLIENT_METHODS.session_request_permission, ({ params }) => this.client.requestPermission(params))
|
|
989
1214
|
.onRequest(CLIENT_METHODS.elicitation_create, ({ params }) => this.client.requestElicitation(params))
|
|
@@ -1592,6 +1817,23 @@ export class PooledConnection {
|
|
|
1592
1817
|
this.client.steeringResponse(request.sessionId, response.outcome);
|
|
1593
1818
|
return response;
|
|
1594
1819
|
}
|
|
1820
|
+
/** Driven `_session/loaded_turn/query` extension request (the re-attach
|
|
1821
|
+
* arm's authoritative founding-turn classification): asks whether the
|
|
1822
|
+
* loaded session's founding turn is still running at the backend, or
|
|
1823
|
+
* ended while the host was down. Strictly capability-gated on the
|
|
1824
|
+
* initialize `_meta.loadedTurn.supported === true` advertisement — a
|
|
1825
|
+
* backend without the extension rejects before any wire request (the
|
|
1826
|
+
* "same gate" the seam's degradation keys on). */
|
|
1827
|
+
async queryLoadedTurn(sessionId, label) {
|
|
1828
|
+
await this.ready;
|
|
1829
|
+
if (this.negotiated?.supportsLoadedTurnTerminalState !== true) {
|
|
1830
|
+
throw new WorkflowError(`ACP agent (${this.backendId}) does not advertise ${LOADED_TURN_QUERY_METHOD}; ` +
|
|
1831
|
+
"InitializeResponse._meta.loadedTurn.supported was not exactly true", WorkflowErrorCode.SCRIPT_VALIDATION_ERROR, { recoverable: false, agentLabel: label });
|
|
1832
|
+
}
|
|
1833
|
+
return this.rawAgentRequest(LOADED_TURN_QUERY_METHOD, {
|
|
1834
|
+
sessionId,
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1595
1837
|
/** session/set_config_option on this connection, raced against process death. */
|
|
1596
1838
|
setSessionConfigOption(request) {
|
|
1597
1839
|
return this.race(this.connection.agent.request(AGENT_METHODS.session_set_config_option, request));
|
|
@@ -1968,6 +2210,61 @@ export class SessionHandle {
|
|
|
1968
2210
|
rawStructuredOutput() {
|
|
1969
2211
|
return this.state.rawResultSuccess?.structured_output;
|
|
1970
2212
|
}
|
|
2213
|
+
/** The loaded-session founding-turn observability probe (see
|
|
2214
|
+
* `InteractiveSession.awaitCurrentTurn`): whether the replayed transcript
|
|
2215
|
+
* shows a turn ever started, and the KIND of the trailing content event.
|
|
2216
|
+
* The trailing kind is PROGRESS evidence, never completion by itself —
|
|
2217
|
+
* the seam classifies completion from the LOAD BOUNDARY plus whether
|
|
2218
|
+
* any content update followed the load (see `loadBoundaryState`).
|
|
2219
|
+
* Added for the REPL broker's re-attach arm; additive passthrough to
|
|
2220
|
+
* `SessionState`. */
|
|
2221
|
+
loadedTurnState() {
|
|
2222
|
+
return this.state.loadedTurnState();
|
|
2223
|
+
}
|
|
2224
|
+
/** Mark the load boundary (see `markLoadBoundary` on `SessionState`):
|
|
2225
|
+
* the runner calls this synchronously after the `session/load` response
|
|
2226
|
+
* — the replay is complete at that instant, and any CONTENT update
|
|
2227
|
+
* applied afterwards is live-continuation evidence. */
|
|
2228
|
+
markLoadBoundary() {
|
|
2229
|
+
this.state.markLoadBoundary();
|
|
2230
|
+
}
|
|
2231
|
+
/** The load-boundary probe (see `loadBoundaryState` on `SessionState`). */
|
|
2232
|
+
loadBoundaryState() {
|
|
2233
|
+
return this.state.loadBoundaryState();
|
|
2234
|
+
}
|
|
2235
|
+
/** The most recent instant a session/update arrived for this session
|
|
2236
|
+
* (the re-attach arm's stream-settled clock). Added for the REPL
|
|
2237
|
+
* broker's re-attach arm; additive passthrough to `SessionState`. */
|
|
2238
|
+
lastUpdateAtMs() {
|
|
2239
|
+
return this.state.lastUpdateAtMs();
|
|
2240
|
+
}
|
|
2241
|
+
/** Watch the session/update stream (fires after every applied update;
|
|
2242
|
+
* returns the unsubscribe thunk). Added for the REPL broker's re-attach
|
|
2243
|
+
* arm; additive passthrough to `SessionState`. */
|
|
2244
|
+
subscribeUpdates(listener) {
|
|
2245
|
+
return this.state.subscribeUpdates(listener);
|
|
2246
|
+
}
|
|
2247
|
+
/** The founding turn's assistant text (the transcript accumulated after
|
|
2248
|
+
* the last user-message boundary). Added for the REPL broker's re-attach
|
|
2249
|
+
* arm; additive passthrough to `SessionState`. */
|
|
2250
|
+
loadedTurnText() {
|
|
2251
|
+
return this.state.loadedTurnText();
|
|
2252
|
+
}
|
|
2253
|
+
/** The recorded `_session/loaded_turn/ended` terminal state (the
|
|
2254
|
+
* re-attach arm's authoritative completion evidence), or null when a
|
|
2255
|
+
* running founding turn has not ended yet. Added for the REPL broker's
|
|
2256
|
+
* re-attach arm; additive passthrough to `SessionState`. */
|
|
2257
|
+
loadedTurnEndedState() {
|
|
2258
|
+
return this.state.loadedTurnEndedState();
|
|
2259
|
+
}
|
|
2260
|
+
/** Watch the loaded-turn-ended channel (fires when the
|
|
2261
|
+
* `_session/loaded_turn/ended` notification arrives — and immediately
|
|
2262
|
+
* when one already arrived). Returns the unsubscribe thunk. Added for
|
|
2263
|
+
* the REPL broker's re-attach arm; additive passthrough to
|
|
2264
|
+
* `SessionState`. */
|
|
2265
|
+
subscribeLoadedTurnEnded(listener) {
|
|
2266
|
+
return this.state.subscribeLoadedTurnEnded(listener);
|
|
2267
|
+
}
|
|
1971
2268
|
/** Cancel the active turn. A backend that does not settle within the grace window is closed and
|
|
1972
2269
|
* its pooled child is quarantined for recycle after sibling sessions drain. */
|
|
1973
2270
|
async cancel() {
|
|
@@ -2053,3 +2350,25 @@ function flattenSelectOptions(options) {
|
|
|
2053
2350
|
}
|
|
2054
2351
|
return out;
|
|
2055
2352
|
}
|
|
2353
|
+
/** Is this update kind CONTENT (a live turn's progress) rather than
|
|
2354
|
+
* bookkeeping? The re-attach arm's load-boundary classification: only
|
|
2355
|
+
* content updates are continuation evidence (a resumed turn streams
|
|
2356
|
+
* chunks/thoughts/tool calls/plans; usage/mode/command/session-info
|
|
2357
|
+
* updates are ambient bookkeeping — claude's adapter emits an
|
|
2358
|
+
* `available_commands_update` right after every load, live turn or
|
|
2359
|
+
* not). */
|
|
2360
|
+
function isContentUpdate(kind) {
|
|
2361
|
+
switch (kind) {
|
|
2362
|
+
case "user_message_chunk":
|
|
2363
|
+
case "agent_message_chunk":
|
|
2364
|
+
case "agent_thought_chunk":
|
|
2365
|
+
case "tool_call":
|
|
2366
|
+
case "tool_call_update":
|
|
2367
|
+
case "plan":
|
|
2368
|
+
case "plan_update":
|
|
2369
|
+
case "plan_removed":
|
|
2370
|
+
return true;
|
|
2371
|
+
default:
|
|
2372
|
+
return false;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/backends/opencode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../src/backends/opencode.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EACV,OAAO,EACP,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EACjB,MAAM,eAAe,CAAC;AA+DvB,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,EAAE,WAIjC,CAAC;AAEF,qBAAa,eAAgB,YAAW,OAAO;IAGjC,QAAQ,CAAC,WAAW,EAAE,WAAW;IAF7C,QAAQ,CAAC,EAAE,EAAG,UAAU,CAAU;gBAEb,WAAW,GAAE,WAAiC;IAEnE,QAAQ,CAAC,mBAAmB,QAAQ;IACpC,QAAQ,CAAC,0BAA0B,QAAQ;IAE3C,qBAAqB,CACnB,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,2BAA2B,GAAG,SAAS;IAW1C,WAAW,IAAI,WAAW;IA2B1B,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAKlD,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAO5E,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO;CAKpD;AAED,eAAO,MAAM,yBAAyB,4DAmBpC,CAAC"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// a native structured-output result channel and ignores request._meta today, so the backend uses
|
|
3
3
|
// the repo's generic schema dialect plus prompt embedding. When OpenCode advertises HTTP MCP, the
|
|
4
4
|
// runner can also inject the client-hosted StructuredOutput MCP tool.
|
|
5
|
-
import { randomUUID } from "node:crypto";
|
|
6
5
|
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
|
|
7
|
-
import { homedir
|
|
6
|
+
import { homedir } from "node:os";
|
|
8
7
|
import { dirname, join } from "node:path";
|
|
9
8
|
import { createRequire } from "node:module";
|
|
10
9
|
import { META_KEYS } from "@automatalabs/shared-types";
|
|
@@ -14,20 +13,44 @@ import { toJsonSchema } from "../schema-strict.js";
|
|
|
14
13
|
import { parseFinalJson } from "../structured-output.js";
|
|
15
14
|
import { defineBuiltinBackend } from "./define.js";
|
|
16
15
|
const require = createRequire(import.meta.url);
|
|
17
|
-
/** Per-spawn OpenCode isolation env:
|
|
16
|
+
/** Per-spawn OpenCode isolation env: dedicated XDG data/state/cache trees seeded with the user's
|
|
18
17
|
* credentials, plus autoupdate off so a concurrent TUI upgrade never swaps state formats
|
|
19
|
-
* underneath a running server. Config (XDG_CONFIG_HOME) is deliberately NOT overridden.
|
|
18
|
+
* underneath a running server. Config (XDG_CONFIG_HOME) is deliberately NOT overridden.
|
|
19
|
+
*
|
|
20
|
+
* The root is STABLE per user+host (phase-D review: it used to be a fresh random tmpdir per
|
|
21
|
+
* spawn, so agent-persisted sessions lived in a tree no later process could reach — cross-
|
|
22
|
+
* process `session/load` fell back to the runner's fresh-session path, and re-attachment was
|
|
23
|
+
* not real for the opencode built-in despite it advertising `loadSession: true`). The stable
|
|
24
|
+
* root keeps every spawned server's persisted sessions reachable by later processes — pool
|
|
25
|
+
* recycles within one daemon AND daemon restarts — so the restore path's re-attach arm and the
|
|
26
|
+
* lazy followUp re-attach both work. It lives OUTSIDE the user's real opencode data dir (a
|
|
27
|
+
* sibling `agentprism/opencode` tree under the same data home), so the daemon's instances
|
|
28
|
+
* never contend with the user's own interactive TUI for the sqlite store; the contention
|
|
29
|
+
* protection that motivated the original isolation is retained for exactly that overlap. The
|
|
30
|
+
* residual tradeoff: CONCURRENT daemon-spawned opencode processes (pool size > 1, or a recycle
|
|
31
|
+
* overlapping its predecessor) share the stable tree, like every other backend shares the
|
|
32
|
+
* user's real state — the documented anomalyco/opencode#31307 busy-wait risk is bounded to
|
|
33
|
+
* that overlap instead of being traded away entirely.
|
|
34
|
+
*
|
|
35
|
+
* `AGENTPRISM_OPENCODE_DATA_ROOT` overrides the root (tests and ops); the stable default is
|
|
36
|
+
* `<data home>/agentprism/opencode` where the data home is the user's `XDG_DATA_HOME` (or
|
|
37
|
+
* `~/.local/share`). */
|
|
20
38
|
function isolatedOpenCodeEnv(base) {
|
|
21
|
-
const
|
|
22
|
-
const dataHome =
|
|
23
|
-
|
|
39
|
+
const override = base.AGENTPRISM_OPENCODE_DATA_ROOT;
|
|
40
|
+
const dataHome = base.XDG_DATA_HOME && base.XDG_DATA_HOME.trim() !== ""
|
|
41
|
+
? base.XDG_DATA_HOME
|
|
42
|
+
: join(homedir(), ".local", "share");
|
|
43
|
+
const root = override && override.trim() !== ""
|
|
44
|
+
? override.trim()
|
|
45
|
+
: join(dataHome, "agentprism", "opencode");
|
|
46
|
+
const dataDir = join(root, "data", "opencode");
|
|
24
47
|
const stateHome = join(root, "state");
|
|
25
48
|
const cacheHome = join(root, "cache");
|
|
26
49
|
mkdirSync(dataDir, { recursive: true });
|
|
27
50
|
mkdirSync(stateHome, { recursive: true });
|
|
28
51
|
mkdirSync(cacheHome, { recursive: true });
|
|
29
52
|
// Credentials live in the REAL data dir; seed them so the isolated instance authenticates.
|
|
30
|
-
// Refresh-token write-back stays in the
|
|
53
|
+
// Refresh-token write-back stays in the dedicated tree — re-auth churn is the accepted cost of
|
|
31
54
|
// not letting concurrent instances revoke each other's tokens (anomalyco/opencode#37059).
|
|
32
55
|
const sourceData = base.XDG_DATA_HOME && base.XDG_DATA_HOME.trim() !== ""
|
|
33
56
|
? join(base.XDG_DATA_HOME, "opencode")
|
|
@@ -38,7 +61,7 @@ function isolatedOpenCodeEnv(base) {
|
|
|
38
61
|
copyFileSync(source, join(dataDir, file));
|
|
39
62
|
}
|
|
40
63
|
return {
|
|
41
|
-
XDG_DATA_HOME:
|
|
64
|
+
XDG_DATA_HOME: join(root, "data"),
|
|
42
65
|
XDG_STATE_HOME: stateHome,
|
|
43
66
|
XDG_CACHE_HOME: cacheHome,
|
|
44
67
|
OPENCODE_DISABLE_AUTOUPDATE: "1",
|
|
@@ -76,12 +99,16 @@ export class OpenCodeBackend {
|
|
|
76
99
|
// auth.json. Overlapping processes — routine since process-exclusive injected pooling
|
|
77
100
|
// (#292) — surface that as mid-run "ACP connection closed" and cross-instance auth
|
|
78
101
|
// revocation (upstream: anomalyco/opencode#31307, #29395, #21215, #38366, #37059).
|
|
79
|
-
//
|
|
80
|
-
// (OPENCODE_DB alone is insufficient per #33321 — the snapshot gitdir stays
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
102
|
+
// Every spawned server gets its own dedicated XDG data/state/cache trees with credentials
|
|
103
|
+
// seeded in (OPENCODE_DB alone is insufficient per #33321 — the snapshot gitdir stays
|
|
104
|
+
// shared). The root is STABLE per user+host (phase-D review: it used to be a random
|
|
105
|
+
// tmpdir per spawn, which made cross-process session/load|resume fall back to the
|
|
106
|
+
// runner's fresh-session path — re-attachment was not real for opencode); persisted
|
|
107
|
+
// sessions therefore survive pool recycles and daemon restarts. The dedicated tree sits
|
|
108
|
+
// OUTSIDE the user's live opencode data dir, so the daemon's instances never overlap the
|
|
109
|
+
// user's own TUI — the contention the isolation exists for — and XDG_CONFIG_HOME stays
|
|
110
|
+
// shared so the user's opencode.jsonc and providers apply. An explicitly exported
|
|
111
|
+
// OPENCODE_DB still wins over the dedicated tree's database.
|
|
85
112
|
const env = { ...process.env, ...isolatedOpenCodeEnv(process.env) };
|
|
86
113
|
const override = env.AGENTPRISM_OPENCODE_ACP_CMD;
|
|
87
114
|
if (override) {
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -24,6 +24,12 @@ export interface NegotiatedCapabilities {
|
|
|
24
24
|
* top-level initialize-response `_meta.steering.supported === true` contract. This is
|
|
25
25
|
* intentionally independent of agentCapabilities._meta, which gates outgoing custom metadata. */
|
|
26
26
|
supportsSteering: boolean;
|
|
27
|
+
/** Whether the agent advertises the `_session/loaded_turn` vendor extension through the
|
|
28
|
+
* top-level initialize-response `_meta.loadedTurn.supported === true` contract: the
|
|
29
|
+
* loaded-session founding-turn TERMINAL STATE channel (the re-attach arm's authoritative
|
|
30
|
+
* completion evidence — see `InteractiveSession.awaitCurrentTurn`). Same strict parse and
|
|
31
|
+
* same independence from agentCapabilities._meta as steering. */
|
|
32
|
+
supportsLoadedTurnTerminalState: boolean;
|
|
27
33
|
/** Whether session/close is advertised (gates the best-effort release-time close). */
|
|
28
34
|
supportsClose: boolean;
|
|
29
35
|
/** Whether session/load is advertised. The current SDK keeps this as the legacy top-level
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,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,kGAAkG;IAClG,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,cAAc,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IACxD;;sGAEkG;IAClG,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sFAAsF;IACtF,aAAa,EAAE,OAAO,CAAC;IACvB;mGAC+F;IAC/F,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0CAA0C;IAC1C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,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AAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;gEAGgE;AAChE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,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
|
@@ -45,6 +45,9 @@ export function negotiateCapabilities(response, customCapabilities) {
|
|
|
45
45
|
// Steering is an initialize-response extension advertisement. Never infer it from the
|
|
46
46
|
// backend name/version or from agentCapabilities._meta (the separate outgoing-meta gate).
|
|
47
47
|
supportsSteering: advertisesSteering(response._meta),
|
|
48
|
+
// The loaded-turn terminal-state extension rides the same initialize-response `_meta`
|
|
49
|
+
// advertisement channel (strict `loadedTurn.supported === true`), never inferred.
|
|
50
|
+
supportsLoadedTurnTerminalState: advertisesLoadedTurn(response._meta),
|
|
48
51
|
supportsClose: advertised(sessionCapabilities?.close),
|
|
49
52
|
supportsLoadSession: agent.loadSession === true || advertised(sessionCapabilities?.load),
|
|
50
53
|
supportsListSessions: advertised(sessionCapabilities?.list),
|
|
@@ -59,6 +62,18 @@ export function negotiateCapabilities(response, customCapabilities) {
|
|
|
59
62
|
gatedKeys: customCapabilities ? [...customCapabilities.gatedKeys] : undefined,
|
|
60
63
|
};
|
|
61
64
|
}
|
|
65
|
+
/** Strict, defensive parser for the top-level loaded-turn extension advertisement. Only the
|
|
66
|
+
* exact boolean true is support; absent, null, malformed, array, string, numeric, and truthy
|
|
67
|
+
* values are all unsupported. */
|
|
68
|
+
function advertisesLoadedTurn(meta) {
|
|
69
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta))
|
|
70
|
+
return false;
|
|
71
|
+
const loadedTurn = meta.loadedTurn;
|
|
72
|
+
return Boolean(loadedTurn &&
|
|
73
|
+
typeof loadedTurn === "object" &&
|
|
74
|
+
!Array.isArray(loadedTurn) &&
|
|
75
|
+
loadedTurn.supported === true);
|
|
76
|
+
}
|
|
62
77
|
/** Strict, defensive parser for the top-level steering extension advertisement. Only the exact
|
|
63
78
|
* boolean true is support; absent, null, malformed, array, string, numeric, and truthy values are
|
|
64
79
|
* all unsupported. */
|
package/dist/index.d.ts
CHANGED
|
@@ -9,13 +9,14 @@ export type { ProviderIntent } from "./provider-store.js";
|
|
|
9
9
|
export { claudeAuthProfile, codexAuthProfile, opencodeAuthProfile, piAuthProfile } from "./auth/auth-profiles.js";
|
|
10
10
|
export type { AuthProfile, TerminalLaunch } from "./auth/auth-profile.js";
|
|
11
11
|
export { InteractiveSession } from "./interactive.js";
|
|
12
|
+
export { LoadedTurnFailedError, LoadedTurnStillRunningError, isLoadedTurnFailedError, isLoadedTurnStillRunningError, } from "./interactive.js";
|
|
12
13
|
export type { InteractiveSessionOptions, InteractiveTurn } from "./interactive.js";
|
|
13
14
|
export { AGENT_METHODS, CLIENT_METHODS } from "@agentclientprotocol/sdk";
|
|
14
15
|
export type { AgentNotificationMethod, AgentNotificationParamsByMethod, AgentAuthCapabilities, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, AuthCapabilities, AuthEnvVar, AuthenticateRequest, AuthenticateResponse, AuthMethod, AuthMethodAgent, AuthMethodEnvVar, AuthMethodId, AuthMethodTerminal, DisableProviderRequest, DisableProviderResponse, CompleteElicitationNotification, ConnectMcpRequest, ConnectMcpResponse, CreateElicitationRequest, CreateElicitationResponse, DeleteSessionRequest, DeleteSessionResponse, DisconnectMcpRequest, DisconnectMcpResponse, ElicitationAcceptAction, ElicitationCapabilities, ElicitationContentValue, ElicitationFormCapabilities, ElicitationFormMode, ElicitationId, ElicitationPropertySchema, ElicitationRequestScope, ElicitationSchema, ElicitationSchemaType, ElicitationSessionScope, ElicitationUrlCapabilities, ElicitationUrlMode, ForkSessionRequest, ForkSessionResponse, ListProvidersRequest, ListProvidersResponse, ListSessionsRequest, ListSessionsResponse, LlmProtocol, LoadSessionRequest, LoadSessionResponse, LogoutCapabilities, LogoutRequest, LogoutResponse, McpConnectionId, McpServerAcp, McpServerAcpId, MessageMcpNotification, MessageMcpRequest, MessageMcpResponse, ResumeSessionRequest, ResumeSessionResponse, ProviderCurrentConfig, ProviderId, ProviderInfo, ProvidersCapabilities, SessionMode, SessionModeState, SessionConfigOption, SessionInfo, SendRequestOptions, SetProviderRequest, SetProviderResponse, } from "@agentclientprotocol/sdk";
|
|
15
16
|
export { BACKENDS_ENV, registryWithRunBackends, resolveBackendRegistry } from "./registry.js";
|
|
16
17
|
export type { BackendRegistry, CustomBackendConfig, RegisteredBackend } from "./registry.js";
|
|
17
|
-
export { CANCEL_NOT_HONORED_GRACE_MS, PI_CHILD_CLEANUP_DEADLINE_MS, PI_CLOSE_DELIVERY_MARGIN_MS, PI_CLOSE_SESSION_TIMEOUT_MS, PI_DISPOSE_SIGKILL_GRACE_MS, PI_PROCESS_EXIT_MARGIN_MS, PI_PROCESS_SHUTDOWN_ENVELOPE_MS, PooledConnection, SESSION_STEERING_METHOD, SessionHandle, isChildCleanupError, } from "./acp-client.js";
|
|
18
|
-
export type { AcpSessionOptions, PooledConnectionDeps, SteeringOutcome, SteeringRequest, SteeringResponse, } from "./acp-client.js";
|
|
18
|
+
export { CANCEL_NOT_HONORED_GRACE_MS, PI_CHILD_CLEANUP_DEADLINE_MS, PI_CLOSE_DELIVERY_MARGIN_MS, PI_CLOSE_SESSION_TIMEOUT_MS, PI_DISPOSE_SIGKILL_GRACE_MS, PI_PROCESS_EXIT_MARGIN_MS, PI_PROCESS_SHUTDOWN_ENVELOPE_MS, PooledConnection, SESSION_STEERING_METHOD, LOADED_TURN_QUERY_METHOD, LOADED_TURN_ENDED_METHOD, SessionHandle, isChildCleanupError, } from "./acp-client.js";
|
|
19
|
+
export type { AcpSessionOptions, PooledConnectionDeps, SteeringOutcome, SteeringRequest, SteeringResponse, LoadedTurnQueryRequest, LoadedTurnQueryResponse, LoadedTurnEndedNotification, LoadedTurnStatus, } from "./acp-client.js";
|
|
19
20
|
export { AGENT_METHOD_COVERAGE, ACP_EXTENSION_SUPPORT_MATRIX, ACP_AUTH_REQUIRED_CODE_EXCLUSIVE, AUTH_CAPABILITY_KEYS, AUTH_META_CONVENTION_KEYS, AUTH_META_MATRIX, CLIENT_METHOD_COVERAGE, CODEX_SPAWN_AUTH_ENV, HANDLED_AUTH_METHOD_TYPES, PI_ACP_PROTOCOL_CONTRACT, BUILTIN_PROTOCOL_COVERAGE, assertAuthCapabilityShape, } from "./protocol-coverage.js";
|
|
20
21
|
export type { AgentMethodCoverage, AcpExtensionSupportMatrixRow, AuthMetaMatrixRow, BuiltinProtocolCoverageRow, ClientMethodCoverage, } from "./protocol-coverage.js";
|
|
21
22
|
export { GATED_CUSTOM_META_KEYS, adaptPromptContent, gateCustomMeta, isSupportedProtocolVersion, negotiateCapabilities, unsupportedMcpServer, } from "./capabilities.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,c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AkB,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEvG,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EAAE,4BAA4B,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1F,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,10 +15,11 @@ export { ProviderStore } from "./provider-store.js";
|
|
|
15
15
|
// backends supply none (conformance-by-absence, §3.5).
|
|
16
16
|
export { claudeAuthProfile, codexAuthProfile, opencodeAuthProfile, piAuthProfile } from "./auth/auth-profiles.js";
|
|
17
17
|
export { InteractiveSession } from "./interactive.js";
|
|
18
|
+
export { LoadedTurnFailedError, LoadedTurnStillRunningError, isLoadedTurnFailedError, isLoadedTurnStillRunningError, } from "./interactive.js";
|
|
18
19
|
export { AGENT_METHODS, CLIENT_METHODS } from "@agentclientprotocol/sdk";
|
|
19
20
|
// The custom-backend registry: run ANY ACP agent as an agent() target.
|
|
20
21
|
export { BACKENDS_ENV, registryWithRunBackends, resolveBackendRegistry } from "./registry.js";
|
|
21
|
-
export { CANCEL_NOT_HONORED_GRACE_MS, PI_CHILD_CLEANUP_DEADLINE_MS, PI_CLOSE_DELIVERY_MARGIN_MS, PI_CLOSE_SESSION_TIMEOUT_MS, PI_DISPOSE_SIGKILL_GRACE_MS, PI_PROCESS_EXIT_MARGIN_MS, PI_PROCESS_SHUTDOWN_ENVELOPE_MS, PooledConnection, SESSION_STEERING_METHOD, SessionHandle, isChildCleanupError, } from "./acp-client.js";
|
|
22
|
+
export { CANCEL_NOT_HONORED_GRACE_MS, PI_CHILD_CLEANUP_DEADLINE_MS, PI_CLOSE_DELIVERY_MARGIN_MS, PI_CLOSE_SESSION_TIMEOUT_MS, PI_DISPOSE_SIGKILL_GRACE_MS, PI_PROCESS_EXIT_MARGIN_MS, PI_PROCESS_SHUTDOWN_ENVELOPE_MS, PooledConnection, SESSION_STEERING_METHOD, LOADED_TURN_QUERY_METHOD, LOADED_TURN_ENDED_METHOD, SessionHandle, isChildCleanupError, } from "./acp-client.js";
|
|
22
23
|
export { AGENT_METHOD_COVERAGE, ACP_EXTENSION_SUPPORT_MATRIX, ACP_AUTH_REQUIRED_CODE_EXCLUSIVE, AUTH_CAPABILITY_KEYS, AUTH_META_CONVENTION_KEYS, AUTH_META_MATRIX, CLIENT_METHOD_COVERAGE, CODEX_SPAWN_AUTH_ENV, HANDLED_AUTH_METHOD_TYPES, PI_ACP_PROTOCOL_CONTRACT, BUILTIN_PROTOCOL_COVERAGE, assertAuthCapabilityShape, } from "./protocol-coverage.js";
|
|
23
24
|
// ACP capability negotiation: parse/validate the initialize response and gate what the client
|
|
24
25
|
// sends (custom `_meta` keys, MCP transports) on what the connected agent advertised.
|