@lucascouts/claude-agent-acp-plus 0.32.0 → 0.34.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.
Files changed (66) hide show
  1. package/README.md +33 -3
  2. package/dist/accounts.d.ts +1 -1
  3. package/dist/accounts.d.ts.map +1 -1
  4. package/dist/acp-agent.d.ts +41 -2
  5. package/dist/acp-agent.d.ts.map +1 -1
  6. package/dist/acp-agent.js +387 -23
  7. package/dist/acp-subagents.d.ts +20 -0
  8. package/dist/acp-subagents.d.ts.map +1 -0
  9. package/dist/acp-subagents.js +14 -0
  10. package/dist/child-session-history.d.ts +26 -0
  11. package/dist/child-session-history.d.ts.map +1 -0
  12. package/dist/child-session-history.js +42 -0
  13. package/dist/child-sessions.d.ts +95 -0
  14. package/dist/child-sessions.d.ts.map +1 -0
  15. package/dist/child-sessions.js +247 -0
  16. package/dist/classifier-escalation.d.ts +1 -1
  17. package/dist/classifier-escalation.d.ts.map +1 -1
  18. package/dist/clear-context-coordinator.d.ts +1 -1
  19. package/dist/clear-context-coordinator.d.ts.map +1 -1
  20. package/dist/context-compaction.d.ts +1 -1
  21. package/dist/context-compaction.d.ts.map +1 -1
  22. package/dist/elicitation.d.ts +2 -2
  23. package/dist/elicitation.d.ts.map +1 -1
  24. package/dist/elicitation.js +1 -1
  25. package/dist/exit-plan.d.ts +1 -1
  26. package/dist/exit-plan.d.ts.map +1 -1
  27. package/dist/goal-extension.js +1 -1
  28. package/dist/permissions/effects.d.ts +1 -1
  29. package/dist/permissions/effects.d.ts.map +1 -1
  30. package/dist/permissions/options/filesystem.d.ts +1 -1
  31. package/dist/permissions/options/filesystem.d.ts.map +1 -1
  32. package/dist/permissions/options/shared.d.ts +1 -1
  33. package/dist/permissions/options/shared.d.ts.map +1 -1
  34. package/dist/permissions/options/shell.d.ts +1 -1
  35. package/dist/permissions/options/shell.d.ts.map +1 -1
  36. package/dist/permissions/options/tools.d.ts +1 -1
  37. package/dist/permissions/options/tools.d.ts.map +1 -1
  38. package/dist/permissions/options.d.ts +1 -1
  39. package/dist/permissions/options.d.ts.map +1 -1
  40. package/dist/permissions/presentation.d.ts +1 -1
  41. package/dist/permissions/presentation.d.ts.map +1 -1
  42. package/dist/permissions/response.d.ts +2 -2
  43. package/dist/permissions/response.d.ts.map +1 -1
  44. package/dist/plan-updates.d.ts +1 -1
  45. package/dist/plan-updates.d.ts.map +1 -1
  46. package/dist/session-failure-extension.d.ts +1 -1
  47. package/dist/session-failure-extension.d.ts.map +1 -1
  48. package/dist/session-mode.d.ts +1 -1
  49. package/dist/session-mode.d.ts.map +1 -1
  50. package/dist/session-mode.js +1 -1
  51. package/dist/session-notices.d.ts +1 -1
  52. package/dist/session-notices.d.ts.map +1 -1
  53. package/dist/session-titles.d.ts +1 -1
  54. package/dist/session-titles.d.ts.map +1 -1
  55. package/dist/task-feed.d.ts +3 -0
  56. package/dist/task-feed.d.ts.map +1 -1
  57. package/dist/thinking-option.d.ts +33 -5
  58. package/dist/thinking-option.d.ts.map +1 -1
  59. package/dist/thinking-option.js +47 -10
  60. package/dist/tools.d.ts +1 -1
  61. package/dist/tools.d.ts.map +1 -1
  62. package/dist/ultracode.d.ts +1 -1
  63. package/dist/ultracode.d.ts.map +1 -1
  64. package/dist/usage-markdown.d.ts.map +1 -1
  65. package/dist/usage-markdown.js +74 -4
  66. package/package.json +4 -4
@@ -0,0 +1,20 @@
1
+ import type { ClientCapabilities } from "@agentclientprotocol/sdk/unstable";
2
+ /**
3
+ * How a client gets native subagent sessions.
4
+ *
5
+ * `rfd`: the subagents RFD (agentclientprotocol/agent-client-protocol#1992,
6
+ * as revised) — `subagent_update` and `session_message`, which the SDK types.
7
+ * Ported from upstream `src/acp-subagents.ts` without its `air` form: AIR's
8
+ * earlier draft of the RFD has no client in this chain (story 065, design.md).
9
+ */
10
+ export type SubagentForm = "rfd";
11
+ /** The form of native subagent sessions that the client gets, or none. */
12
+ export declare function subagentForm(capabilities?: ClientCapabilities | null): SubagentForm | undefined;
13
+ /**
14
+ * The schema's `SubagentCapabilities` is an object (`{}` or `{ _meta }`); any
15
+ * other shape is not a declaration. Zed drops `subagent_update` and
16
+ * `session_message` from a client that did not advertise it, so a false yes
17
+ * here loses the subagents entirely.
18
+ */
19
+ export declare function clientSupportsSubagents(capabilities?: ClientCapabilities | null): boolean;
20
+ //# sourceMappingURL=acp-subagents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-subagents.d.ts","sourceRoot":"","sources":["../src/acp-subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AAEjC,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,YAAY,GAAG,SAAS,CAE/F;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAGzF"}
@@ -0,0 +1,14 @@
1
+ /** The form of native subagent sessions that the client gets, or none. */
2
+ export function subagentForm(capabilities) {
3
+ return clientSupportsSubagents(capabilities) ? "rfd" : undefined;
4
+ }
5
+ /**
6
+ * The schema's `SubagentCapabilities` is an object (`{}` or `{ _meta }`); any
7
+ * other shape is not a declaration. Zed drops `subagent_update` and
8
+ * `session_message` from a client that did not advertise it, so a false yes
9
+ * here loses the subagents entirely.
10
+ */
11
+ export function clientSupportsSubagents(capabilities) {
12
+ const subagents = capabilities?.subagents;
13
+ return typeof subagents === "object" && subagents !== null && !Array.isArray(subagents);
14
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Story 065, Task 4.1 — which Agent call launched which subagent, read back
3
+ * from a session's transcripts so a replayed or restored child keeps the id it
4
+ * had live (R4.1, R4.3).
5
+ *
6
+ * The bundled CLI writes, beside each subagent transcript
7
+ * `<session>/subagents/agent-<agentId>.jsonl`, a metadata file
8
+ * `agent-<agentId>.meta.json` whose `toolUseId` names the launching call
9
+ * (the same layout upstream's `subagent-history.ts` reads). The child id is
10
+ * the `<agentId>` of the file name — never generated: a launch without
11
+ * metadata has no known id and is left nested, as before.
12
+ */
13
+ export type SubagentLaunchRecord = {
14
+ agentId: string;
15
+ name?: string;
16
+ agentType?: string;
17
+ description?: string;
18
+ /** `parentAgentId`: the subagent whose agent launched this one (a nested
19
+ * subagent, whose launch is in that agent's transcript, not the parent's). */
20
+ launcherAgentId?: string;
21
+ /** `spawnDepth`: 1 for a launch by the main thread. */
22
+ depth: number;
23
+ };
24
+ /** The subagents of `sessionId`, keyed by the tool use id that launched each. */
25
+ export declare function readSubagentLaunches(configDir: string, sessionId: string): Promise<Map<string, SubagentLaunchRecord>>;
26
+ //# sourceMappingURL=child-session-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-session-history.d.ts","sourceRoot":"","sources":["../src/child-session-history.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;mFAC+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,iFAAiF;AACjF,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAoC5C"}
@@ -0,0 +1,42 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import * as path from "node:path";
3
+ import { findTranscript } from "./transcript-path.js";
4
+ const META_FILE = /^agent-(.+)\.meta\.json$/;
5
+ /** The subagents of `sessionId`, keyed by the tool use id that launched each. */
6
+ export async function readSubagentLaunches(configDir, sessionId) {
7
+ const launches = new Map();
8
+ const transcript = await findTranscript(configDir, sessionId);
9
+ if (!transcript)
10
+ return launches;
11
+ const directory = path.join(path.dirname(transcript), sessionId, "subagents");
12
+ let names;
13
+ try {
14
+ names = await readdir(directory);
15
+ }
16
+ catch {
17
+ return launches;
18
+ }
19
+ const text = (value) => (typeof value === "string" && value ? value : undefined);
20
+ await Promise.all(names.map(async (name) => {
21
+ const agentId = name.match(META_FILE)?.[1];
22
+ if (!agentId)
23
+ return;
24
+ try {
25
+ const meta = JSON.parse(await readFile(path.join(directory, name), "utf8"));
26
+ if (typeof meta?.toolUseId !== "string")
27
+ return;
28
+ launches.set(meta.toolUseId, {
29
+ agentId,
30
+ name: text(meta.name),
31
+ agentType: text(meta.agentType),
32
+ description: text(meta.description),
33
+ launcherAgentId: text(meta.parentAgentId),
34
+ depth: typeof meta.spawnDepth === "number" ? meta.spawnDepth : 1,
35
+ });
36
+ }
37
+ catch {
38
+ // A damaged metadata file leaves its subagent nested, as without the RFD.
39
+ }
40
+ }));
41
+ return launches;
42
+ }
@@ -0,0 +1,95 @@
1
+ import type { SessionNotification } from "@agentclientprotocol/sdk/unstable";
2
+ /**
3
+ * Story 065 — each Agent-tool subagent as a child session under the ACP
4
+ * subagents RFD (agentclientprotocol/agent-client-protocol#1992).
5
+ *
6
+ * The fork's tool-call conversion is unchanged: a subagent's updates still
7
+ * leave it stamped with `_meta.claudeCode.parentToolUseId`, and `route` only
8
+ * swaps their `sessionId` for the child's. The child's id is the SDK agent id
9
+ * (`task_started.task_id`, the name of its transcript
10
+ * `subagents/agent-<id>.jsonl`), never a fresh one, so a replay or a restore
11
+ * names the same child (design.md, Data Models).
12
+ *
13
+ * Zed `a5c4ca8b`'s v1 client has no early-traffic buffer: a child's traffic
14
+ * before its `subagent_update` is dropped, so `launch` is awaited before the
15
+ * stream that follows `task_started` is converted.
16
+ */
17
+ /** Why a child stopped, in the RFD's `IdleStateUpdate.stopReason` vocabulary. */
18
+ export type ChildStopReason = "end_turn" | "cancelled" | "error";
19
+ export type ChildLaunch = {
20
+ parentSessionId: string;
21
+ /** `task_started.parent_task_id`: the subagent whose agent launched this one, if any. */
22
+ launcherTaskId?: string;
23
+ /** The Agent call's tool use id: what the child's stream names as its parent. */
24
+ toolUseId: string;
25
+ /** The SDK agent id — the child's session id. */
26
+ agentId: string;
27
+ title: string;
28
+ description: string;
29
+ prompt?: string;
30
+ /** True when the SDK can stop this subagent on its own (`Query.stopTask`). */
31
+ cancellable: boolean;
32
+ };
33
+ type Send = (notification: SessionNotification) => Promise<void>;
34
+ /** A subagent's SDK task status mapped onto the RFD's idle stop reason. */
35
+ export declare function childStopReasonOf(status: string | undefined): ChildStopReason | undefined;
36
+ export declare class ChildSessionRouter {
37
+ private readonly send;
38
+ private readonly debug;
39
+ private readonly byChild;
40
+ /** Keyed by parent and tool use id: tool use ids are unique only within a session. */
41
+ private readonly byToolUse;
42
+ /** Tool calls already placed — on a child, or (`null`) nested in the parent
43
+ * because they went out before their launch was known. A tool call never
44
+ * moves once the client has seen it, and an update the conversion did not
45
+ * stamp (a progress beat, an edit diff) follows its call, even after its
46
+ * child settled. Keyed like `byToolUse`; bounded by `place`. */
47
+ private readonly toolCalls;
48
+ constructor(send: Send, debug: (line: string) => void);
49
+ isChild(sessionId: string): boolean;
50
+ /** The parent session a child belongs to. */
51
+ parentOf(childId: string): string | undefined;
52
+ /** The child a parent's Agent call launched, if that call launched one. */
53
+ childFor(parentSessionId: string, toolUseId: string | null | undefined): string | undefined;
54
+ /** The child whose traffic a notification belongs to, if any. */
55
+ private childOf;
56
+ /** Record where a tool call went; the oldest entries go first past the cap,
57
+ * so a long connection does not keep every tool call it ever saw. */
58
+ private place;
59
+ /**
60
+ * Announce a child on its parent — `subagent_update` with title,
61
+ * description, capabilities and `running` — then the parent's outgoing
62
+ * `session_message` carrying the prompt (R2.1, R2.2). A second launch of a
63
+ * known child (a resumed subagent) only reports it running again.
64
+ */
65
+ launch(launch: ChildLaunch): Promise<void>;
66
+ /**
67
+ * Register a child read back from its parent's transcript, under the id it
68
+ * had live (R4.1, R4.3). With `announce`, a replay: title, description and
69
+ * prompt go out with no state — replayed history is not live work (R4.2).
70
+ * Without it, a resume: nothing is sent until the child runs again. A child
71
+ * already registered for another parent is left to that parent.
72
+ */
73
+ restore(launch: ChildLaunch, options: {
74
+ announce: boolean;
75
+ }): Promise<void>;
76
+ private announce;
77
+ private sendPrompt;
78
+ /**
79
+ * The notification as it should cross the wire: a subagent's update moves
80
+ * to its child's session; everything else is returned unchanged. A
81
+ * `parentToolUseId` naming no launch stays nested in the parent (R2.3).
82
+ */
83
+ route(notification: SessionNotification): SessionNotification;
84
+ /** A permission request or elicitation opened on the child (R2.4). */
85
+ askOpened(childId: string): Promise<void>;
86
+ /** A permission request or elicitation on the child was answered (R2.4). */
87
+ askClosed(childId: string): Promise<void>;
88
+ /** True once the child was cancelled, until it is resumed. */
89
+ isCancelled(childId: string): boolean;
90
+ /** The subagent ended: `idle` with its stop reason, sent once (R2.4). */
91
+ settle(childId: string, stopReason: ChildStopReason): Promise<void>;
92
+ private setState;
93
+ }
94
+ export {};
95
+ //# sourceMappingURL=child-sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-sessions.d.ts","sourceRoot":"","sources":["../src/child-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AAEH,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;AAoBjE,MAAM,MAAM,WAAW,GAAG;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,OAA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AAE,GAAG,OAAO,CAAC,IAAI,CAAC;YA6BnE,QAAQ;YAoBR,UAAU;IAgBxB;;;;OAIG;IACH,KAAK,CAAC,YAAY,EAAE,mBAAmB,GAAG,mBAAmB;IAM7D,sEAAsE;IAChE,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C,4EAA4E;IACtE,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/C,8DAA8D;IAC9D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIrC,yEAAyE;IACnE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAQ3D,QAAQ;CAYvB"}
@@ -0,0 +1,247 @@
1
+ /** A subagent's SDK task status mapped onto the RFD's idle stop reason. */
2
+ export function childStopReasonOf(status) {
3
+ switch (status) {
4
+ case "completed":
5
+ return "end_turn";
6
+ case "failed":
7
+ return "error";
8
+ case "stopped":
9
+ case "killed":
10
+ return "cancelled";
11
+ default:
12
+ return undefined;
13
+ }
14
+ }
15
+ /** Far above the tool calls one turn keeps in flight; only the oldest, long
16
+ * finished placements are ever evicted. */
17
+ const TOOL_CALL_PLACEMENT_CAP = 4096;
18
+ const launchKey = (parentSessionId, toolUseId) => `${parentSessionId}\0${toolUseId}`;
19
+ export class ChildSessionRouter {
20
+ send;
21
+ debug;
22
+ byChild = new Map();
23
+ /** Keyed by parent and tool use id: tool use ids are unique only within a session. */
24
+ byToolUse = new Map();
25
+ /** Tool calls already placed — on a child, or (`null`) nested in the parent
26
+ * because they went out before their launch was known. A tool call never
27
+ * moves once the client has seen it, and an update the conversion did not
28
+ * stamp (a progress beat, an edit diff) follows its call, even after its
29
+ * child settled. Keyed like `byToolUse`; bounded by `place`. */
30
+ toolCalls = new Map();
31
+ constructor(send, debug) {
32
+ this.send = send;
33
+ this.debug = debug;
34
+ }
35
+ isChild(sessionId) {
36
+ return this.byChild.has(sessionId);
37
+ }
38
+ /** The parent session a child belongs to. */
39
+ parentOf(childId) {
40
+ return this.byChild.get(childId)?.parentSessionId;
41
+ }
42
+ /** The child a parent's Agent call launched, if that call launched one. */
43
+ childFor(parentSessionId, toolUseId) {
44
+ if (!toolUseId)
45
+ return undefined;
46
+ return this.byToolUse.get(launchKey(parentSessionId, toolUseId))?.childId;
47
+ }
48
+ /** The child whose traffic a notification belongs to, if any. */
49
+ childOf(notification) {
50
+ const update = notification.update;
51
+ const toolCallId = typeof update.toolCallId === "string" ? update.toolCallId : undefined;
52
+ const callKey = toolCallId ? launchKey(notification.sessionId, toolCallId) : undefined;
53
+ if (callKey && this.toolCalls.has(callKey))
54
+ return this.toolCalls.get(callKey) ?? undefined;
55
+ const parentToolUseId = update._meta?.claudeCode
56
+ ?.parentToolUseId;
57
+ if (typeof parentToolUseId !== "string") {
58
+ // An unstamped call is the parent's own — or a subagent's, sent before
59
+ // its `task_started` was consumed (`canUseTool` racing the stream).
60
+ // Either way the client saw it on the parent, so it stays there.
61
+ if (callKey && notification.update.sessionUpdate === "tool_call")
62
+ this.place(callKey, null);
63
+ return undefined;
64
+ }
65
+ const childId = this.childFor(notification.sessionId, parentToolUseId);
66
+ if (!childId) {
67
+ this.debug(`[subagents/route] outcome=nested reason=unknown_launch sessionId=${notification.sessionId} parentToolUseId=${parentToolUseId}`);
68
+ }
69
+ if (callKey)
70
+ this.place(callKey, childId ?? null);
71
+ return childId;
72
+ }
73
+ /** Record where a tool call went; the oldest entries go first past the cap,
74
+ * so a long connection does not keep every tool call it ever saw. */
75
+ place(callKey, childId) {
76
+ this.toolCalls.set(callKey, childId);
77
+ if (this.toolCalls.size > TOOL_CALL_PLACEMENT_CAP) {
78
+ this.toolCalls.delete(this.toolCalls.keys().next().value);
79
+ }
80
+ }
81
+ /**
82
+ * Announce a child on its parent — `subagent_update` with title,
83
+ * description, capabilities and `running` — then the parent's outgoing
84
+ * `session_message` carrying the prompt (R2.1, R2.2). A second launch of a
85
+ * known child (a resumed subagent) only reports it running again.
86
+ */
87
+ async launch(launch) {
88
+ const known = this.byChild.get(launch.agentId);
89
+ if (known?.unannounced) {
90
+ // Known from the transcript of a resumed parent, never shown on this
91
+ // connection: the client gets the whole announcement now (R4.3).
92
+ known.unannounced = false;
93
+ known.cancelled = false;
94
+ known.state = "running";
95
+ // A launcher the client was never shown cannot carry it: Zed v1 drops
96
+ // updates for a session it does not know, so it goes on the root.
97
+ if (this.byChild.get(known.announcedOn)?.unannounced) {
98
+ known.announcedOn = known.parentSessionId;
99
+ }
100
+ this.byToolUse.set(launchKey(known.parentSessionId, launch.toolUseId), known);
101
+ await this.announce(known, launch, { state: "running" });
102
+ await this.sendPrompt(known, launch);
103
+ return;
104
+ }
105
+ if (known) {
106
+ // A resumed subagent keeps its task id but runs under a new Agent call
107
+ // (sdk.d.ts SDKTaskStartedMessage): its stream names that call.
108
+ this.byToolUse.set(launchKey(known.parentSessionId, launch.toolUseId), known);
109
+ known.cancelled = false;
110
+ await this.setState(known, { state: "running" });
111
+ await this.sendPrompt(known, launch);
112
+ return;
113
+ }
114
+ const launcher = launch.launcherTaskId ? this.byChild.get(launch.launcherTaskId) : undefined;
115
+ const record = {
116
+ childId: launch.agentId,
117
+ parentSessionId: launch.parentSessionId,
118
+ announcedOn: launcher?.parentSessionId === launch.parentSessionId
119
+ ? launcher.childId
120
+ : launch.parentSessionId,
121
+ state: "running",
122
+ openAsks: 0,
123
+ };
124
+ this.byChild.set(record.childId, record);
125
+ this.byToolUse.set(launchKey(record.parentSessionId, launch.toolUseId), record);
126
+ await this.announce(record, launch, { state: "running" });
127
+ await this.sendPrompt(record, launch);
128
+ }
129
+ /**
130
+ * Register a child read back from its parent's transcript, under the id it
131
+ * had live (R4.1, R4.3). With `announce`, a replay: title, description and
132
+ * prompt go out with no state — replayed history is not live work (R4.2).
133
+ * Without it, a resume: nothing is sent until the child runs again. A child
134
+ * already registered for another parent is left to that parent.
135
+ */
136
+ async restore(launch, options) {
137
+ const known = this.byChild.get(launch.agentId);
138
+ if (known && known.parentSessionId !== launch.parentSessionId) {
139
+ this.debug(`[subagents/restore] outcome=skipped reason=other_parent childSessionId=${launch.agentId} sessionId=${launch.parentSessionId} owner=${known.parentSessionId}`);
140
+ return;
141
+ }
142
+ const launcher = launch.launcherTaskId ? this.byChild.get(launch.launcherTaskId) : undefined;
143
+ const record = known ?? {
144
+ childId: launch.agentId,
145
+ parentSessionId: launch.parentSessionId,
146
+ announcedOn: launcher?.parentSessionId === launch.parentSessionId
147
+ ? launcher.childId
148
+ : launch.parentSessionId,
149
+ openAsks: 0,
150
+ };
151
+ this.byChild.set(record.childId, record);
152
+ this.byToolUse.set(launchKey(record.parentSessionId, launch.toolUseId), record);
153
+ if (!options.announce) {
154
+ if (!known)
155
+ record.unannounced = true;
156
+ return;
157
+ }
158
+ record.unannounced = false;
159
+ await this.announce(record, launch);
160
+ await this.sendPrompt(record, launch);
161
+ }
162
+ async announce(record, launch, state) {
163
+ await this.send({
164
+ sessionId: record.announcedOn,
165
+ update: {
166
+ sessionUpdate: "subagent_update",
167
+ sessionId: record.childId,
168
+ title: launch.title,
169
+ description: launch.description,
170
+ // `SubagentSessionCapabilities.cancel` is an object when supported;
171
+ // absent, Zed disables Stop for the child (design.md, Security).
172
+ ...(launch.cancellable ? { capabilities: { cancel: {} } } : {}),
173
+ ...(state ? { state } : {}),
174
+ },
175
+ });
176
+ }
177
+ async sendPrompt(record, launch) {
178
+ if (!launch.prompt)
179
+ return;
180
+ await this.send({
181
+ sessionId: record.announcedOn,
182
+ update: {
183
+ sessionUpdate: "session_message",
184
+ // Derived, not random: a replay of the same launch upserts the same
185
+ // message, and each run of a resumed child gets its own.
186
+ messageId: `subagent-prompt-${record.childId}-${launch.toolUseId}`,
187
+ senderSessionId: record.announcedOn,
188
+ recipientSessionId: record.childId,
189
+ content: [{ type: "text", text: launch.prompt }],
190
+ },
191
+ });
192
+ }
193
+ /**
194
+ * The notification as it should cross the wire: a subagent's update moves
195
+ * to its child's session; everything else is returned unchanged. A
196
+ * `parentToolUseId` naming no launch stays nested in the parent (R2.3).
197
+ */
198
+ route(notification) {
199
+ if (this.byChild.has(notification.sessionId))
200
+ return notification;
201
+ const childId = this.childOf(notification);
202
+ return childId ? { ...notification, sessionId: childId } : notification;
203
+ }
204
+ /** A permission request or elicitation opened on the child (R2.4). */
205
+ async askOpened(childId) {
206
+ const record = this.byChild.get(childId);
207
+ if (!record)
208
+ return;
209
+ record.openAsks += 1;
210
+ if (record.state !== "idle")
211
+ await this.setState(record, { state: "requires_action" });
212
+ }
213
+ /** A permission request or elicitation on the child was answered (R2.4). */
214
+ async askClosed(childId) {
215
+ const record = this.byChild.get(childId);
216
+ if (!record)
217
+ return;
218
+ record.openAsks = Math.max(0, record.openAsks - 1);
219
+ if (record.openAsks === 0 && record.state === "requires_action") {
220
+ await this.setState(record, { state: "running" });
221
+ }
222
+ }
223
+ /** True once the child was cancelled, until it is resumed. */
224
+ isCancelled(childId) {
225
+ return this.byChild.get(childId)?.cancelled === true;
226
+ }
227
+ /** The subagent ended: `idle` with its stop reason, sent once (R2.4). */
228
+ async settle(childId, stopReason) {
229
+ const record = this.byChild.get(childId);
230
+ if (!record)
231
+ return;
232
+ if (stopReason === "cancelled")
233
+ record.cancelled = true;
234
+ if (record.state === "idle")
235
+ return;
236
+ await this.setState(record, { state: "idle", stopReason });
237
+ }
238
+ async setState(record, state) {
239
+ if (record.state === state.state && state.state !== "idle")
240
+ return;
241
+ record.state = state.state;
242
+ await this.send({
243
+ sessionId: record.announcedOn,
244
+ update: { sessionUpdate: "subagent_update", sessionId: record.childId, state },
245
+ });
246
+ }
247
+ }
@@ -3,7 +3,7 @@
3
3
  * of failing. An approval becomes a grant — memory only, scoped to one
4
4
  * session — that the next matching call consumes to skip the classifier.
5
5
  */
6
- import type { SessionNotification } from "@agentclientprotocol/sdk";
6
+ import type { SessionNotification } from "@agentclientprotocol/sdk/unstable";
7
7
  import type { HookCallback } from "@anthropic-ai/claude-agent-sdk";
8
8
  import type { ClaudeAcpAgent, Logger, ToolUpdateMeta } from "./acp-agent.js";
9
9
  import { type ClassifierEscalationAnswer } from "./permissions/response.js";
@@ -1 +1 @@
1
- {"version":3,"file":"classifier-escalation.d.ts","sourceRoot":"","sources":["../src/classifier-escalation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,gCAAgC,CAAC;AAGnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAC;AAoBnC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAqBhF;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3C,6EAA6E;AAC7E,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAE7C,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI3B,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI9B,qDAAqD;IACrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAM1C,2DAA2D;IAC3D,SAAS,IAAI,IAAI;IAIjB,wBAAwB;IACxB,KAAK,IAAI,IAAI;CAId;AAED,sFAAsF;AACtF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAEtE,kEAAkE;AAClE,MAAM,MAAM,WA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wB,GAAG;IACrC,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,UAAU,CAAA;KAAE,CAAC;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;IAC3F,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAYF;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,wBAAwB,GAAG,YAAY,CAkGvF;AA6DD;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,UAAU,CAAA;CAAE,EAC5D,MAAM,EAAE,MAAM,GACb,YAAY,CA2Bd"}
@@ -1,4 +1,4 @@
1
- import type { NewSessionRequest, SessionConfigOption } from "@agentclientprotocol/sdk";
1
+ import type { NewSessionRequest, SessionConfigOption } from "@agentclientprotocol/sdk/unstable";
2
2
  import type { PermissionMode, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
3
3
  export type ClearContextReset = {
4
4
  toolUseId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"clear-context-coordinator.d.ts","sourceRoot":"","sources":["../src/clear-context-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EAGV,cAAc,EACd,cAAc,EACf,MAAM,gCAAgC,CAAC;AAGxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,E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aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,mBAAmB,CACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,cAAc,EACpB,aAAa,EAAE,mBAAmB,EAAE,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC;IACzF,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACjD,CAAC;AAoCF;;kEAEkE;AAClE,wBAAsB,0BAA0B,CAC9C,IAAI,SAAS,gBAAgB,EAC7B,OAAO,SAAS,mBAAmB,CAAC,IAAI,CAAC,EAEzC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,2BAA2B,CAAC,OAAO,EAAE,IAAI,CAAC,EAChD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAiDf"}
@@ -48,7 +48,7 @@
48
48
  * `acp-agent.ts` is a ~9,700-line file that changes upstream almost daily, so
49
49
  * every coupling to it is paid again at each sync.
50
50
  */
51
- import { SessionNotification } from "@agentclientprotocol/sdk";
51
+ import { SessionNotification } from "@agentclientprotocol/sdk/unstable";
52
52
  import { ContextCompactionMetadata } from "./context-compaction-meta.js";
53
53
  /** The phases a compaction can END in. `in_progress` is not terminal. */
54
54
  type CompactionStatus = "completed" | "failed";
@@ -1 +1 @@
1
- {"version":3,"file":"context-compaction.d.ts","sourceRoot":"","sources":["../src/context-compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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otocol/sdk";
1
+ import { CreateElicitationResponse } from "@agentclientprotocol/sdk/unstable";
2
+ import type { CreateElicitationRequest } from "@agentclientprotocol/sdk/unstable";
3
3
  import type { ElicitationRequest, ElicitationResult } from "@anthropic-ai/claude-agent-sdk";
4
4
  import type { AskUserQuestionInput } from "@anthropic-ai/claude-agent-sdk/sdk-tools.js";
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../src/elicitation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EACV,wBAAwB,EAKzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAChB,wBAAwB,GAAG,IAAI,CAyBjC;AAgBD;;;GAGG;AACH,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,yBAAyB,GAClC,iBAAiB,CAUnB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,EAAE,GAAG,IAAI,CAUhG;AAgCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,eAAe,EAAE,EAC5B,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,EAAE,eAAe,EAAE,GAC3B,sBAAsB,CAgExB;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,qBAAqB,GAAG,IAAI,CAW9B;AAYD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,qBAAqB,EAC7B,SAAS,EAAE,MAAM,GAChB,wBAAwB,CA+B1B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,CAG7F"}
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { CreateElicitationResponse } from "@agentclientprotocol/sdk";
2
+ import { CreateElicitationResponse } from "@agentclientprotocol/sdk/unstable";
3
3
  /**
4
4
  * Convert an MCP elicitation request (from the SDK's `onElicitation` callback)
5
5
  * into an ACP `CreateElicitationRequest`. Returns `null` when the request can't
@@ -1,4 +1,4 @@
1
- import type { SessionNotification } from "@agentclientprotocol/sdk";
1
+ import type { SessionNotification } from "@agentclientprotocol/sdk/unstable";
2
2
  import type { SDKResultMessage } from "@anthropic-ai/claude-agent-sdk";
3
3
  import { type ClearContextCoordinatorHost, type ClearContextReset, type ClearContextSession, type ClearContextTurn } from "./clear-context-coordinator.js";
4
4
  export declare function acceptedPlanToolResult(notification: SessionNotification, toolUseId: string | undefined): SessionNotification;
@@ -1 +1 @@
1
- {"version":3,"file":"exit-plan.d.ts","sourceRoot":"","sources":["../src/exit-plan.ts"],"names":[],"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AE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9D,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IACjF,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1E,CAAC;AAEF;;oEAEoE;AACpE,qBAAa,mBAAmB,CAC9B,OAAO,SAAS,mBAAmB,CAAC,IAAI,CAAC,EACzC,IAAI,SAAS,gBAAgB;IAIjB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;gBAElC,IAAI,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC;IAErE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIzB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiE/F"}
@@ -1,4 +1,4 @@
1
- import { RequestError } from "@agentclientprotocol/sdk";
1
+ import { RequestError } from "@agentclientprotocol/sdk/unstable";
2
2
  export const GOAL_EXTENSION_VERSION = 1;
3
3
  export const GOAL_CONTROL_METHOD = "_session/goal";
4
4
  export const GOAL_ACTIONS = ["set", "clear"];
@@ -1,4 +1,4 @@
1
- import type { RequestPermissionResponse } from "@agentclientprotocol/sdk";
1
+ import type { RequestPermissionResponse } from "@agentclientprotocol/sdk/unstable";
2
2
  import type { PermissionMode, PermissionResult } from "@anthropic-ai/claude-agent-sdk";
3
3
  import type { DurablePermissionChangeSet } from "./normalization.js";
4
4
  export interface ClaudePermissionSelection {
@@ -1 +1 @@
1
- {"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../../src/permissions/effects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,E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AO,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C;AAED,gFAAgF;AAChF,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,yBAAyB,EACnC,QAAQ,EAAE,MAAM,GACf,yBAAyB,CAM3B;AA6FD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAWrF;AAqDD,iFAAiF;AACjF,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,yBAAyB,EACpC,OAAO,EAAE,6BAA6B,GACrC,gBAAgB,CA8BlB"}
@@ -1,4 +1,4 @@
1
- import type { PermissionOption } from "@agentclientprotocol/sdk";
1
+ import type { PermissionOption } from "@agentclientprotocol/sdk/unstable";
2
2
  import { type PermissionOptionContext } from "./shared.js";
3
3
  export declare function buildReadPermissionOptions(context: PermissionOptionContext): PermissionOption[];
4
4
  export declare function buildGlobPermissionOptions(context: PermissionOptionContext): PermissionOption[];
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/permissions/options/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,OAAO,EAAe,KAAK,uBAAuB,EAAsB,MAAM,aAAa,CAAC;AA6J5F,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAEhG;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,uBAAuB,GAC/B,gBAAgB,EAAE,CAEpB"}
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/permissions/options/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAI1E,OAAO,EAAe,KAAK,uBAAuB,EAAsB,MAAM,aAAa,CAAC;AA6J5F,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAE/F;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,EAAE,CAEhG;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,uBAAuB,GAC/B,gBAAgB,EAAE,CAEpB"}
@@ -1,4 +1,4 @@
1
- import type { PermissionOption } from "@agentclientprotocol/sdk";
1
+ import type { PermissionOption } from "@agentclientprotocol/sdk/unstable";
2
2
  import type { DurablePermissionChangeSet } from "../normalization.js";
3
3
  export declare const PERMISSION_OPTION_ID: {
4
4
  readonly allowOnce: "allow-once";