@agentclientprotocol/claude-agent-acp 0.106.1-preview.5 → 0.106.1-preview.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -76
- package/dist/native-subagents.d.ts +72 -9
- package/dist/native-subagents.d.ts.map +1 -1
- package/dist/native-subagents.js +130 -12
- package/dist/session-fast-mode.d.ts +16 -10
- package/dist/session-fast-mode.d.ts.map +1 -1
- package/dist/session-fast-mode.js +36 -25
- package/dist/subagent-replay.d.ts +16 -1
- package/dist/subagent-replay.d.ts.map +1 -1
- package/dist/subagent-replay.js +28 -1
- package/dist/v1/acp-agent.d.ts +18 -6
- package/dist/v1/acp-agent.d.ts.map +1 -1
- package/dist/v1/acp-agent.js +26 -6
- package/dist/v2/agent.js +10 -4
- package/dist/v2/subagent-replay.js +2 -2
- package/dist/v2/tasks.d.ts +29 -11
- package/dist/v2/tasks.d.ts.map +1 -1
- package/dist/v2/tasks.js +69 -19
- package/dist/v2/tool-call.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,81 +53,6 @@ npm run build:binary
|
|
|
53
53
|
npm run smoke:binary # add `-- --full` to drive a real session; needs a Claude login
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### Subagent sessions
|
|
57
|
-
|
|
58
|
-
A client that declares `clientCapabilities.subagents`, other than JetBrains AIR, gets each Agent or
|
|
59
|
-
Task subagent as its own child session, following the [subagents RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/subagents.mdx):
|
|
60
|
-
|
|
61
|
-
- `subagent_update` on the parent announces the child before any of its traffic, with the
|
|
62
|
-
parent's `title` and `description` for it, and reports its work state: `running`,
|
|
63
|
-
`requires_action` while one of its requests is open (and `running` again when the last one ends,
|
|
64
|
-
unless a cancel withdrew it: the child is stopping then), and `idle` when its work ends, with
|
|
65
|
-
`end_turn` or `cancelled` when the SDK gives the reason. A failure is `idle` with the `error`
|
|
66
|
-
stop reason and the SDK's error text as its `error`. The child keeps its session for every
|
|
67
|
-
delegation to it.
|
|
68
|
-
- A child that runs outside its parent's working directory, such as an Agent call with
|
|
69
|
-
`isolation: "worktree"`, gets its `cwd` on `subagent_update` before its first tool call. The
|
|
70
|
-
adapter takes it from the `cwd` of the child's own hooks: its SubagentStart hook runs before its
|
|
71
|
-
first model request. It sends `cwd: null` when the child is back in its parent's directory. A
|
|
72
|
-
child in its parent's directory gets no `cwd`, and no child gets `additionalDirectories`: Claude
|
|
73
|
-
Code gives a subagent the session's additional directories, so it inherits them. A replay
|
|
74
|
-
announces a child with the `cwd` that its transcript recorded, and clears it after the response
|
|
75
|
-
when that directory no longer exists.
|
|
76
|
-
- Session messages replace the Agent or Task call that launches the child, which its parent is
|
|
77
|
-
not shown:
|
|
78
|
-
- The launch's prompt is a `session_message` in both transcripts: the parent's outgoing view and
|
|
79
|
-
the child's incoming one. Both use the launch's tool use id, and each names the other with the
|
|
80
|
-
draft RFD's `recipientMessageId` and `senderMessageId`.
|
|
81
|
-
- A foreground child's answer, from the launch's result, is the child's `session_message` to
|
|
82
|
-
the parent. In Claude Code's hand-back mode, the child's `SubagentHandback` call is its
|
|
83
|
-
message to the parent instead, in both transcripts and linked the same way.
|
|
84
|
-
- A launch whose child is never exposed is shown as a tool call after all, with its final
|
|
85
|
-
status.
|
|
86
|
-
- The message of a SendMessage call that resumes the child is a `session_message` in the child's
|
|
87
|
-
transcript. The SendMessage call stays a tool call of the session that made it.
|
|
88
|
-
- `session/cancel` on the parent interrupts Claude Code, which stops the foreground children that
|
|
89
|
-
the turn waits on. Background children keep running, as the RFD prefers; a client stops one with
|
|
90
|
-
its own `cancel`. Each stopped child reports `idle` with `cancelled` from Claude Code's own
|
|
91
|
-
events, and its open requests are withdrawn. The adapter ends no child at a cancel itself, so a
|
|
92
|
-
child that keeps running keeps its open requests and its open tool calls. To spare background
|
|
93
|
-
children, the adapter declares the SDK option `perTaskStopAffordance`, which a client can turn
|
|
94
|
-
off in `_meta.claudeCode.options`. That option spares background workflows too, which a client
|
|
95
|
-
cannot stop, so the adapter stops them after the interrupt, as Claude Code did without it.
|
|
96
|
-
Background commands keep running after a cancel either way. A tool call of a stopped child that Claude Code reports no
|
|
97
|
-
result for, such as the command it was running, ends in the child's session before the cancelled
|
|
98
|
-
prompt resolves. When Claude Code stops a background child after that, or while no prompt runs,
|
|
99
|
-
the tool call ends right after the child reports `idle`. A child that still runs when Claude Code
|
|
100
|
-
exits is `idle` with no stop reason.
|
|
101
|
-
- A child whose parent is not yet known when it ends is not exposed, since the RFD forbids
|
|
102
|
-
guessing its parent.
|
|
103
|
-
- A replay restores each child under its live session id, from its own transcript, with the same
|
|
104
|
-
session messages as live, and its end is an `idle` before the response.
|
|
105
|
-
A launch without Claude Code's metadata file for the child stays an ordinary tool call of the
|
|
106
|
-
parent, and a notice, for a client that takes notices, says that subagent history is missing.
|
|
107
|
-
- After a load or resume, with or without replay, a SendMessage that resumes an agent from before
|
|
108
|
-
it runs that agent in its session from before. Before the agent's traffic, each of its ancestors
|
|
109
|
-
that the client was not told about in this connection is announced, parent before child and
|
|
110
|
-
with no work state, as the RFD requires. An agent whose launch the session's history does not
|
|
111
|
-
record stays unexposed.
|
|
112
|
-
- Each running child is announced with the `cancel` capability. `session/cancel` with the child's
|
|
113
|
-
session id stops that child's current work, through the SDK's `Query.stopTask`, and not its
|
|
114
|
-
parent's: Claude Code also stops the foreground children it waits on, and the parent's turn goes
|
|
115
|
-
on. Each stopped child reports `idle` with `cancelled` from Claude Code's own events, and its
|
|
116
|
-
requests that the stop withdraws report no `running` first. A replayed child, which no longer
|
|
117
|
-
runs, gets no capabilities. A client cannot prompt or otherwise change a child.
|
|
118
|
-
|
|
119
|
-
An [ACP v2](#experimental-acp-v2) client gets the same without declaring anything, since subagents
|
|
120
|
-
are part of v2's baseline. Each child also reports its work state as its own `state_update`, right
|
|
121
|
-
after the parent's copy.
|
|
122
|
-
|
|
123
|
-
JetBrains AIR keeps the earlier draft of the RFD (`subagent_spawned`, `subagent_state_update`),
|
|
124
|
-
which it enables with `nativeSubagentSessions` in `_meta.jetbrains.air.capabilities`. See
|
|
125
|
-
[AIR extensions](docs/air-extensions.md#native-subagent-sessions).
|
|
126
|
-
|
|
127
|
-
Without either signal, Agent and Task stay ordinary tool calls and child interactions stay on the
|
|
128
|
-
root session. Clients that use the historical `_meta["subagent-transcript"]` capability or the
|
|
129
|
-
`forwardSubagentText` session option retain the flattened child transcript.
|
|
130
|
-
|
|
131
56
|
### Experimental ACP v2
|
|
132
57
|
|
|
133
58
|
The adapter also serves the [draft ACP v2](https://agentclientprotocol.com/protocol/v2/overview):
|
|
@@ -143,7 +68,7 @@ with replay, `session/close`, `session/prompt`, `session/cancel`), `session/dele
|
|
|
143
68
|
`session/fork`, `session/status`, `session/options` (with initial `configOptions` on `session/new` and
|
|
144
69
|
`session/resume`), `session/set_title`, additional directories, config options (the mode is one), plans, notices,
|
|
145
70
|
compaction, display terminals for commands, permission requests, elicitation, providers, auth, and
|
|
146
|
-
[subagents](
|
|
71
|
+
[subagents](docs/subagent-sessions.md). Steering is v1 only for now.
|
|
147
72
|
|
|
148
73
|
v2 is served by the v2 agent in `src/v2/`, which runs straight on Claude
|
|
149
74
|
Code instead of translating to v1. A v2 client that declares JetBrains AIR
|
|
@@ -97,10 +97,15 @@ export type TaskEnd = {
|
|
|
97
97
|
/** The SDK's reason for an unusual end, such as `worker_restart`. */
|
|
98
98
|
reason?: string;
|
|
99
99
|
/**
|
|
100
|
-
* The adapter knows that the work ended, but not why: the stream ended
|
|
101
|
-
*
|
|
100
|
+
* The adapter knows that the work ended, but not why: the stream ended
|
|
101
|
+
* with the task still running.
|
|
102
102
|
*/
|
|
103
103
|
unexplained?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The adapter stops following the task, which may still run: the
|
|
106
|
+
* conversation was reset, and the runtime forgets its children.
|
|
107
|
+
*/
|
|
108
|
+
unobservable?: boolean;
|
|
104
109
|
};
|
|
105
110
|
type TaskStarted = {
|
|
106
111
|
taskId: string;
|
|
@@ -193,6 +198,11 @@ export declare class NativeSubagentRuntime {
|
|
|
193
198
|
* input, and the call that delegated the run.
|
|
194
199
|
*/
|
|
195
200
|
private readonly handbacks;
|
|
201
|
+
/**
|
|
202
|
+
* The RFD form: the agent that each TaskStop or SendMessage call names (see
|
|
203
|
+
* {@link targetAgentId}), until the call's final update.
|
|
204
|
+
*/
|
|
205
|
+
private readonly targetByToolCall;
|
|
196
206
|
private readonly generationByTaskId;
|
|
197
207
|
private readonly pending;
|
|
198
208
|
private pendingCount;
|
|
@@ -307,12 +317,24 @@ export declare class NativeSubagentRuntime {
|
|
|
307
317
|
finishTask(taskId: string, status: unknown, deliver: Publish, toolUseId?: string | null, end?: TaskEnd): Promise<void>;
|
|
308
318
|
/**
|
|
309
319
|
* Ends every child that still runs, because the stream ended or the
|
|
310
|
-
* conversation was reset. AIR's draft reports `state` for each.
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
320
|
+
* conversation was reset. AIR's draft reports `state` for each.
|
|
321
|
+
*
|
|
322
|
+
* The RFD form, at the end of the stream: Claude Code's process ran the
|
|
323
|
+
* children and is gone, or the caller closes the query next, which
|
|
324
|
+
* terminates it, so their work ended. Its cause is unknown, so each is idle with no stop reason: a
|
|
325
|
+
* child that a cancel stopped already reported it from the SDK's events,
|
|
326
|
+
* and a background child that outlived the cancel was not cancelled.
|
|
327
|
+
*
|
|
328
|
+
* The RFD form, at a conversation reset (`mayStillRun`): Claude Code can
|
|
329
|
+
* keep the old conversation's subagents running, and the caller forgets
|
|
330
|
+
* them next (`clear`), so no later event of theirs is reported. Their work
|
|
331
|
+
* did not end as far as the adapter knows, so each is `unknown`, as the
|
|
332
|
+
* RFD requires when a child can no longer be observed, and loses its
|
|
333
|
+
* `cancel` capability. A child that is idle keeps its state.
|
|
314
334
|
*/
|
|
315
|
-
finishAll(state: SubagentState, deliver: Publish
|
|
335
|
+
finishAll(state: SubagentState, deliver: Publish, { mayStillRun }?: {
|
|
336
|
+
mayStillRun?: boolean;
|
|
337
|
+
}): Promise<void>;
|
|
316
338
|
/**
|
|
317
339
|
* The parent session got `session/cancel`. AIR's draft ends every child as
|
|
318
340
|
* cancelled here. The RFD form reports nothing: acknowledging a cancel is no
|
|
@@ -423,7 +445,10 @@ export declare class NativeSubagentRuntime {
|
|
|
423
445
|
* then its configuration. A runtime without a form never does.
|
|
424
446
|
*/
|
|
425
447
|
private announce;
|
|
426
|
-
/**
|
|
448
|
+
/**
|
|
449
|
+
* The RFD form: publishes the work state of `child` on its parent, with
|
|
450
|
+
* `capabilities` when the child's change with it.
|
|
451
|
+
*/
|
|
427
452
|
private reportState;
|
|
428
453
|
/**
|
|
429
454
|
* Routes an update to the child session. It never goes to the root session:
|
|
@@ -473,6 +498,23 @@ export declare class NativeSubagentRuntime {
|
|
|
473
498
|
* final status. Any other update is returned as is.
|
|
474
499
|
*/
|
|
475
500
|
private routeRfdSendMessage;
|
|
501
|
+
/** The RFD form: remembers the agent that a TaskStop or SendMessage call names. */
|
|
502
|
+
private rememberTarget;
|
|
503
|
+
/**
|
|
504
|
+
* The RFD form: `notification`, an update that the client is shown, with
|
|
505
|
+
* the RFD's `session` reference when it is of a tool call that operates on
|
|
506
|
+
* an announced child of another session (see {@link withSessionReference}):
|
|
507
|
+
*
|
|
508
|
+
* - a TaskStop or SendMessage call that names the child by its agent id;
|
|
509
|
+
* - a SendMessage call that resumed the child, and stays shown because a
|
|
510
|
+
* permission request showed it;
|
|
511
|
+
* - an Agent/Task call that launched the child, and stays shown for the
|
|
512
|
+
* same reason.
|
|
513
|
+
*
|
|
514
|
+
* The RFD requires the announcement before the reference, so a call whose
|
|
515
|
+
* child is not announced yet gets none.
|
|
516
|
+
*/
|
|
517
|
+
private withTarget;
|
|
476
518
|
/** Whether `update` is of an Agent/Task call, by its tool name or, in the
|
|
477
519
|
* RFD form, by the id of a call the client is not shown. */
|
|
478
520
|
private isControlUpdate;
|
|
@@ -550,10 +592,28 @@ export declare function finishNativeSubagent(session: NativeSubagentSession, tas
|
|
|
550
592
|
* prompt goes from the parent to the child, a SendMessage call, whose message
|
|
551
593
|
* goes from its sender to a child, or a child's SubagentHandback call, whose
|
|
552
594
|
* report goes from the child to the parent. Both views use the
|
|
553
|
-
* call's tool use id, and each names the other with the
|
|
595
|
+
* call's tool use id, and each names the other with the RFD's
|
|
554
596
|
* `recipientMessageId` and `senderMessageId`.
|
|
555
597
|
*/
|
|
556
598
|
export declare function linkedSessionMessages(toolUseId: string, senderSessionId: string, recipientSessionId: string, text: string): AcpSessionNotification[];
|
|
599
|
+
/**
|
|
600
|
+
* The RFD form: the agent that a tool call names as the one it operates on:
|
|
601
|
+
* the `task_id` of a TaskStop call, or the `to` of a SendMessage call. It is
|
|
602
|
+
* an agent only if it is the id of one: an agent's id is its child session's
|
|
603
|
+
* id. Both tools also take a name, which is not resolved here: Claude Code
|
|
604
|
+
* resolves it, and the adapter cannot tell which agent it picked. `undefined`
|
|
605
|
+
* for any other call.
|
|
606
|
+
*/
|
|
607
|
+
export declare function targetAgentId(toolName: unknown, rawInput: unknown): string | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* The RFD form: `notification`, a tool call's report, with a `session`
|
|
610
|
+
* reference to `sessionId` after its content: `{ "type": "session",
|
|
611
|
+
* "sessionId": "..." }`, which links the call to the session it operates on.
|
|
612
|
+
* A `tool_call_update` replaces the content that the client holds, so the
|
|
613
|
+
* reference goes on every report that carries content, and a
|
|
614
|
+
* `tool_call_update` without content is returned as it is.
|
|
615
|
+
*/
|
|
616
|
+
export declare function withSessionReference(notification: AcpSessionNotification, sessionId: string): AcpSessionNotification;
|
|
557
617
|
/**
|
|
558
618
|
* The tool with which a child hands its report to its parent, when Claude
|
|
559
619
|
* Code runs in hand-back mode. The Agent/Task result then only says that the
|
|
@@ -586,6 +646,9 @@ export declare function launchReply(launchId: string, childSessionId: string, pa
|
|
|
586
646
|
* A task that a worker restart orphaned, or that was still running when the
|
|
587
647
|
* stream ended, is idle with no stop reason: its work ended, but the adapter
|
|
588
648
|
* did not see a cancellation or a failure, which the RFD forbids claiming.
|
|
649
|
+
*
|
|
650
|
+
* A child that the adapter can no longer observe and that may still run is
|
|
651
|
+
* not idle but `unknown` (see `NativeSubagentRuntime.finishAll`).
|
|
589
652
|
*/
|
|
590
653
|
export declare function rfdEndState(state: SubagentState, end: TaskEnd | undefined): WorkState;
|
|
591
654
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-subagents.d.ts","sourceRoot":"","sources":["../src/native-subagents.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAM9F,kFAAkF;AAClF,MAAM,MAAM,SAAS,GAAG,WAAW,CACjC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE;IAAE,aAAa,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAAC,OAAO,CAAC,CACtF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5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B,GAAG,SAAS,EAC3C,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,MAAM,GAChB,sBAAsB,CAgDxB;AA0CD,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAU7E;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,IAAI,EAAE,gBAAgB,GACrB,gBAAgB,CAOlB;AA0CD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKjF"}
|
package/dist/native-subagents.js
CHANGED
|
@@ -64,6 +64,11 @@ export class NativeSubagentRuntime {
|
|
|
64
64
|
* input, and the call that delegated the run.
|
|
65
65
|
*/
|
|
66
66
|
handbacks = new Map();
|
|
67
|
+
/**
|
|
68
|
+
* The RFD form: the agent that each TaskStop or SendMessage call names (see
|
|
69
|
+
* {@link targetAgentId}), until the call's final update.
|
|
70
|
+
*/
|
|
71
|
+
targetByToolCall = new Map();
|
|
67
72
|
generationByTaskId = new Map();
|
|
68
73
|
pending = new Map();
|
|
69
74
|
pendingCount = 0;
|
|
@@ -112,7 +117,11 @@ export class NativeSubagentRuntime {
|
|
|
112
117
|
if (!routed)
|
|
113
118
|
return routed;
|
|
114
119
|
this.rememberSendMessage(routed);
|
|
115
|
-
|
|
120
|
+
if (this.form !== "rfd")
|
|
121
|
+
return routed;
|
|
122
|
+
this.rememberTarget(routed);
|
|
123
|
+
const shown = this.routeRfdSendMessage(routed, forcedSessionId);
|
|
124
|
+
return shown && this.withTarget(shown);
|
|
116
125
|
}
|
|
117
126
|
/**
|
|
118
127
|
* The RFD form: the work state that the client holds for the announced child
|
|
@@ -587,7 +596,11 @@ export class NativeSubagentRuntime {
|
|
|
587
596
|
for (const pending of this.takePending(child.parentToolUseId))
|
|
588
597
|
await deliver(pending);
|
|
589
598
|
}
|
|
590
|
-
if (this.form === "rfd") {
|
|
599
|
+
if (this.form === "rfd" && end?.unobservable) {
|
|
600
|
+
// The child's `cancel` goes with it: a forgotten child cannot be stopped.
|
|
601
|
+
await this.reportState(child, { state: "unknown" }, { capabilities: null });
|
|
602
|
+
}
|
|
603
|
+
else if (this.form === "rfd") {
|
|
591
604
|
await this.reportState(child, rfdEndState(state, end));
|
|
592
605
|
child.missingError = state === "failed" && !end?.error && !end?.unexplained;
|
|
593
606
|
if (child.parentToolUseId)
|
|
@@ -616,14 +629,28 @@ export class NativeSubagentRuntime {
|
|
|
616
629
|
}
|
|
617
630
|
/**
|
|
618
631
|
* Ends every child that still runs, because the stream ended or the
|
|
619
|
-
* conversation was reset. AIR's draft reports `state` for each.
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
*
|
|
632
|
+
* conversation was reset. AIR's draft reports `state` for each.
|
|
633
|
+
*
|
|
634
|
+
* The RFD form, at the end of the stream: Claude Code's process ran the
|
|
635
|
+
* children and is gone, or the caller closes the query next, which
|
|
636
|
+
* terminates it, so their work ended. Its cause is unknown, so each is idle with no stop reason: a
|
|
637
|
+
* child that a cancel stopped already reported it from the SDK's events,
|
|
638
|
+
* and a background child that outlived the cancel was not cancelled.
|
|
639
|
+
*
|
|
640
|
+
* The RFD form, at a conversation reset (`mayStillRun`): Claude Code can
|
|
641
|
+
* keep the old conversation's subagents running, and the caller forgets
|
|
642
|
+
* them next (`clear`), so no later event of theirs is reported. Their work
|
|
643
|
+
* did not end as far as the adapter knows, so each is `unknown`, as the
|
|
644
|
+
* RFD requires when a child can no longer be observed, and loses its
|
|
645
|
+
* `cancel` capability. A child that is idle keeps its state.
|
|
623
646
|
*/
|
|
624
|
-
async finishAll(state, deliver) {
|
|
647
|
+
async finishAll(state, deliver, { mayStillRun = false } = {}) {
|
|
625
648
|
const errors = [];
|
|
626
|
-
const end = this.form
|
|
649
|
+
const end = this.form !== "rfd"
|
|
650
|
+
? undefined
|
|
651
|
+
: mayStillRun
|
|
652
|
+
? { unobservable: true }
|
|
653
|
+
: { unexplained: true };
|
|
627
654
|
try {
|
|
628
655
|
for (const taskId of [...this.children.keys()].reverse()) {
|
|
629
656
|
try {
|
|
@@ -966,13 +993,21 @@ export class NativeSubagentRuntime {
|
|
|
966
993
|
await this.publishCwd(child);
|
|
967
994
|
await this.publishConfiguration(child);
|
|
968
995
|
}
|
|
969
|
-
/**
|
|
970
|
-
|
|
996
|
+
/**
|
|
997
|
+
* The RFD form: publishes the work state of `child` on its parent, with
|
|
998
|
+
* `capabilities` when the child's change with it.
|
|
999
|
+
*/
|
|
1000
|
+
async reportState(child, state, capabilities) {
|
|
971
1001
|
child.workState = state.state;
|
|
972
1002
|
child.missingError = false;
|
|
973
1003
|
await this.publish({
|
|
974
1004
|
sessionId: child.parentSessionId,
|
|
975
|
-
update: {
|
|
1005
|
+
update: {
|
|
1006
|
+
sessionUpdate: "subagent_update",
|
|
1007
|
+
sessionId: child.sessionId,
|
|
1008
|
+
...capabilities,
|
|
1009
|
+
state,
|
|
1010
|
+
},
|
|
976
1011
|
});
|
|
977
1012
|
}
|
|
978
1013
|
/**
|
|
@@ -1147,6 +1182,43 @@ export class NativeSubagentRuntime {
|
|
|
1147
1182
|
return null;
|
|
1148
1183
|
return unexposedControlFallback(sendMessage.initial, notification, sendMessage.sender);
|
|
1149
1184
|
}
|
|
1185
|
+
/** The RFD form: remembers the agent that a TaskStop or SendMessage call names. */
|
|
1186
|
+
rememberTarget({ update }) {
|
|
1187
|
+
if (update.sessionUpdate !== "tool_call" && update.sessionUpdate !== "tool_call_update")
|
|
1188
|
+
return;
|
|
1189
|
+
const claudeMeta = update._meta?.claudeCode;
|
|
1190
|
+
const agentId = targetAgentId(claudeMeta?.toolName, update.rawInput);
|
|
1191
|
+
if (agentId !== undefined)
|
|
1192
|
+
this.targetByToolCall.set(update.toolCallId, agentId);
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* The RFD form: `notification`, an update that the client is shown, with
|
|
1196
|
+
* the RFD's `session` reference when it is of a tool call that operates on
|
|
1197
|
+
* an announced child of another session (see {@link withSessionReference}):
|
|
1198
|
+
*
|
|
1199
|
+
* - a TaskStop or SendMessage call that names the child by its agent id;
|
|
1200
|
+
* - a SendMessage call that resumed the child, and stays shown because a
|
|
1201
|
+
* permission request showed it;
|
|
1202
|
+
* - an Agent/Task call that launched the child, and stays shown for the
|
|
1203
|
+
* same reason.
|
|
1204
|
+
*
|
|
1205
|
+
* The RFD requires the announcement before the reference, so a call whose
|
|
1206
|
+
* child is not announced yet gets none.
|
|
1207
|
+
*/
|
|
1208
|
+
withTarget(notification) {
|
|
1209
|
+
const { update } = notification;
|
|
1210
|
+
if (update.sessionUpdate !== "tool_call" && update.sessionUpdate !== "tool_call_update") {
|
|
1211
|
+
return notification;
|
|
1212
|
+
}
|
|
1213
|
+
const agentId = this.targetByToolCall.get(update.toolCallId);
|
|
1214
|
+
if (isFinalToolCallStatus(update.status))
|
|
1215
|
+
this.targetByToolCall.delete(update.toolCallId);
|
|
1216
|
+
const child = this.childByParentToolUse.get(update.toolCallId) ??
|
|
1217
|
+
(agentId !== undefined ? this.children.get(agentId) : undefined);
|
|
1218
|
+
if (!child?.announced || child.sessionId === notification.sessionId)
|
|
1219
|
+
return notification;
|
|
1220
|
+
return withSessionReference(notification, child.sessionId);
|
|
1221
|
+
}
|
|
1150
1222
|
/** Whether `update` is of an Agent/Task call, by its tool name or, in the
|
|
1151
1223
|
* RFD form, by the id of a call the client is not shown. */
|
|
1152
1224
|
isControlUpdate(update) {
|
|
@@ -1206,6 +1278,7 @@ export class NativeSubagentRuntime {
|
|
|
1206
1278
|
this.hiddenLaunches.clear();
|
|
1207
1279
|
this.hiddenSendMessages.clear();
|
|
1208
1280
|
this.handbacks.clear();
|
|
1281
|
+
this.targetByToolCall.clear();
|
|
1209
1282
|
this.generationByTaskId.clear();
|
|
1210
1283
|
this.pending.clear();
|
|
1211
1284
|
this.pendingCount = 0;
|
|
@@ -1486,7 +1559,7 @@ async function publishPrompt(child, prompt, toolUseId, sender, publish, { replac
|
|
|
1486
1559
|
* prompt goes from the parent to the child, a SendMessage call, whose message
|
|
1487
1560
|
* goes from its sender to a child, or a child's SubagentHandback call, whose
|
|
1488
1561
|
* report goes from the child to the parent. Both views use the
|
|
1489
|
-
* call's tool use id, and each names the other with the
|
|
1562
|
+
* call's tool use id, and each names the other with the RFD's
|
|
1490
1563
|
* `recipientMessageId` and `senderMessageId`.
|
|
1491
1564
|
*/
|
|
1492
1565
|
export function linkedSessionMessages(toolUseId, senderSessionId, recipientSessionId, text) {
|
|
@@ -1508,6 +1581,48 @@ export function linkedSessionMessages(toolUseId, senderSessionId, recipientSessi
|
|
|
1508
1581
|
},
|
|
1509
1582
|
];
|
|
1510
1583
|
}
|
|
1584
|
+
/**
|
|
1585
|
+
* The RFD form: the agent that a tool call names as the one it operates on:
|
|
1586
|
+
* the `task_id` of a TaskStop call, or the `to` of a SendMessage call. It is
|
|
1587
|
+
* an agent only if it is the id of one: an agent's id is its child session's
|
|
1588
|
+
* id. Both tools also take a name, which is not resolved here: Claude Code
|
|
1589
|
+
* resolves it, and the adapter cannot tell which agent it picked. `undefined`
|
|
1590
|
+
* for any other call.
|
|
1591
|
+
*/
|
|
1592
|
+
export function targetAgentId(toolName, rawInput) {
|
|
1593
|
+
if (typeof rawInput !== "object" || rawInput === null)
|
|
1594
|
+
return undefined;
|
|
1595
|
+
const input = rawInput;
|
|
1596
|
+
if (toolName === "TaskStop")
|
|
1597
|
+
return nonBlankString(input.task_id);
|
|
1598
|
+
if (toolName === "SendMessage")
|
|
1599
|
+
return nonBlankString(input.to);
|
|
1600
|
+
return undefined;
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* The RFD form: `notification`, a tool call's report, with a `session`
|
|
1604
|
+
* reference to `sessionId` after its content: `{ "type": "session",
|
|
1605
|
+
* "sessionId": "..." }`, which links the call to the session it operates on.
|
|
1606
|
+
* A `tool_call_update` replaces the content that the client holds, so the
|
|
1607
|
+
* reference goes on every report that carries content, and a
|
|
1608
|
+
* `tool_call_update` without content is returned as it is.
|
|
1609
|
+
*/
|
|
1610
|
+
export function withSessionReference(notification, sessionId) {
|
|
1611
|
+
const { update } = notification;
|
|
1612
|
+
if (update.sessionUpdate !== "tool_call" && update.sessionUpdate !== "tool_call_update") {
|
|
1613
|
+
return notification;
|
|
1614
|
+
}
|
|
1615
|
+
if (update.sessionUpdate === "tool_call_update" && update.content == null)
|
|
1616
|
+
return notification;
|
|
1617
|
+
const content = update.content ?? [];
|
|
1618
|
+
if (content.some((item) => item.type === "session" && item.sessionId === sessionId)) {
|
|
1619
|
+
return notification;
|
|
1620
|
+
}
|
|
1621
|
+
return {
|
|
1622
|
+
...notification,
|
|
1623
|
+
update: { ...update, content: [...content, { type: "session", sessionId }] },
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1511
1626
|
/**
|
|
1512
1627
|
* The tool with which a child hands its report to its parent, when Claude
|
|
1513
1628
|
* Code runs in hand-back mode. The Agent/Task result then only says that the
|
|
@@ -1576,6 +1691,9 @@ function isWorking(child) {
|
|
|
1576
1691
|
* A task that a worker restart orphaned, or that was still running when the
|
|
1577
1692
|
* stream ended, is idle with no stop reason: its work ended, but the adapter
|
|
1578
1693
|
* did not see a cancellation or a failure, which the RFD forbids claiming.
|
|
1694
|
+
*
|
|
1695
|
+
* A child that the adapter can no longer observe and that may still run is
|
|
1696
|
+
* not idle but `unknown` (see `NativeSubagentRuntime.finishAll`).
|
|
1579
1697
|
*/
|
|
1580
1698
|
export function rfdEndState(state, end) {
|
|
1581
1699
|
if (end?.unexplained || end?.reason === "worker_restart")
|
|
@@ -10,11 +10,15 @@ export declare const FAST_MODE_OFF = "off";
|
|
|
10
10
|
* docs) keeps the toggle on so it reflects the user's intent — only an
|
|
11
11
|
* explicit `off` clears it. */
|
|
12
12
|
export declare function fastModeStateEnabled(state: FastModeState): boolean;
|
|
13
|
+
/** The user-facing explanation of a `fast_mode_disabled_reason`: `undefined`
|
|
14
|
+
* for no reason, `sdk_opt_in_required` or `pending`; the table text when there
|
|
15
|
+
* is one; else a generic text naming the code (a reason a newer SDK added). */
|
|
16
|
+
export declare function explainFastModeDisabledReason(reason: FastModeDisabledReason | undefined): string | undefined;
|
|
13
17
|
/** Normalize an SDK-reported `fast_mode_disabled_reason` to the one we retain:
|
|
14
|
-
* a reason
|
|
15
|
-
*
|
|
16
|
-
* exactly what the user can see, so
|
|
17
|
-
* `sdk_opt_in_required` never churn the config option. */
|
|
18
|
+
* a reason {@link explainFastModeDisabledReason} explains (including codes a
|
|
19
|
+
* newer SDK adds), else `undefined`. State comparisons (see
|
|
20
|
+
* `fastModeStateChange`) then track exactly what the user can see, so
|
|
21
|
+
* `sdk_opt_in_required` and `pending` never churn the config option. */
|
|
18
22
|
export declare function normalizeFastModeDisabledReason(reason: FastModeDisabledReason | undefined): FastModeDisabledReason | undefined;
|
|
19
23
|
/** Build the Fast mode config option. When the Client supports boolean config
|
|
20
24
|
* options we expose a native `type: "boolean"` toggle; otherwise we degrade to
|
|
@@ -53,15 +57,17 @@ export type FastModeOptionState = {
|
|
|
53
57
|
* off), or the same state with the same explainable reason.
|
|
54
58
|
*
|
|
55
59
|
* `reason` is the SDK's `fast_mode_disabled_reason`, reported alongside the
|
|
56
|
-
* state.
|
|
57
|
-
* {@link normalizeFastModeDisabledReason}
|
|
58
|
-
* `sdk_opt_in_required`
|
|
59
|
-
* option, while a real blocker updates the description even when the
|
|
60
|
+
* state. Every reason except `sdk_opt_in_required` and `pending` is retained
|
|
61
|
+
* (see {@link normalizeFastModeDisabledReason}; unknown future codes get the
|
|
62
|
+
* generic text), so `sdk_opt_in_required` on every turn's result can't churn
|
|
63
|
+
* the option, while a real blocker updates the description even when the
|
|
60
64
|
* toggle's own value is unchanged.
|
|
61
65
|
*
|
|
62
66
|
* `notice` is set when the user had Fast mode on and the SDK turned it off
|
|
63
|
-
*
|
|
64
|
-
*
|
|
67
|
+
* with a retained reason: the description carries the same explanation, but a
|
|
68
|
+
* toggle silently snapping back is worth saying out loud once. Off with no
|
|
69
|
+
* reason, `sdk_opt_in_required` or `pending` stays quiet: a `result` can carry
|
|
70
|
+
* the turn-start snapshot, so a notice there would falsely say "turned off". */
|
|
65
71
|
export declare function fastModeStateChange(current: {
|
|
66
72
|
enabled: boolean;
|
|
67
73
|
disabledReason?: FastModeDisabledReason;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-fast-mode.d.ts","sourceRoot":"","sources":["../src/session-fast-mode.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG5F,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C;+DAC+D;AAC/D,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,eAAO,MAAM,aAAa,QAAQ,CAAC;AAGnC;;;gCAGgC;AAChC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAElE;
|
|
1
|
+
{"version":3,"file":"session-fast-mode.d.ts","sourceRoot":"","sources":["../src/session-fast-mode.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG5F,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C;+DAC+D;AAC/D,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,eAAO,MAAM,aAAa,QAAQ,CAAC;AAGnC;;;gCAGgC;AAChC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAElE;AAyBD;;gFAEgF;AAChF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,sBAAsB,GAA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