@agentclientprotocol/claude-agent-acp 0.102.1-preview.1 → 0.102.1-preview.3
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 +5 -1
- package/dist/acp-agent.d.ts +93 -622
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +369 -3474
- package/dist/acp-client.d.ts +28 -0
- package/dist/acp-client.d.ts.map +1 -0
- package/dist/acp-client.js +1 -0
- package/dist/acp-subagents.d.ts +1 -2
- package/dist/acp-subagents.d.ts.map +1 -1
- package/dist/auth-methods.d.ts +21 -0
- package/dist/auth-methods.d.ts.map +1 -0
- package/dist/auth-methods.js +68 -0
- package/dist/auth-status-reporter.d.ts +112 -0
- package/dist/auth-status-reporter.d.ts.map +1 -0
- package/dist/auth-status-reporter.js +253 -0
- package/dist/background-work.d.ts +12 -265
- package/dist/background-work.d.ts.map +1 -1
- package/dist/background-work.js +8 -558
- package/dist/client-system-prompt.d.ts +7 -0
- package/dist/client-system-prompt.d.ts.map +1 -1
- package/dist/client-system-prompt.js +24 -0
- package/dist/context-compaction.d.ts +20 -0
- package/dist/context-compaction.d.ts.map +1 -1
- package/dist/context-compaction.js +26 -0
- package/dist/context-window.d.ts +70 -0
- package/dist/context-window.d.ts.map +1 -0
- package/dist/context-window.js +132 -0
- package/dist/diff.d.ts +1 -1
- package/dist/diff.js +1 -1
- package/dist/elicitation.d.ts +66 -1
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/elicitation.js +109 -0
- package/dist/file-change-audit.d.ts +4 -3
- package/dist/file-change-audit.d.ts.map +1 -1
- package/dist/file-change-audit.js +3 -2
- package/dist/lib.d.ts +5 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +3 -1
- package/dist/logger.d.ts +10 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +1 -0
- package/dist/mcp-oauth.d.ts +44 -0
- package/dist/mcp-oauth.d.ts.map +1 -0
- package/dist/mcp-oauth.js +142 -0
- package/dist/mcp-servers.d.ts +10 -0
- package/dist/mcp-servers.d.ts.map +1 -0
- package/dist/mcp-servers.js +29 -0
- package/dist/message-filters.d.ts +43 -0
- package/dist/message-filters.d.ts.map +1 -0
- package/dist/message-filters.js +197 -0
- package/dist/native-subagents.d.ts +18 -8
- package/dist/native-subagents.d.ts.map +1 -1
- package/dist/native-subagents.js +7 -35
- package/dist/new-session-meta.d.ts +40 -0
- package/dist/new-session-meta.d.ts.map +1 -0
- package/dist/new-session-meta.js +1 -0
- package/dist/permissions/presentation.d.ts +29 -0
- package/dist/permissions/presentation.d.ts.map +1 -1
- package/dist/permissions/presentation.js +38 -11
- package/dist/prompt-suggestions.d.ts +29 -0
- package/dist/prompt-suggestions.d.ts.map +1 -1
- package/dist/prompt-suggestions.js +45 -0
- package/dist/prompt-to-claude.d.ts +10 -0
- package/dist/prompt-to-claude.d.ts.map +1 -0
- package/dist/prompt-to-claude.js +120 -0
- package/dist/providers.d.ts +139 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +286 -0
- package/dist/remote-control.d.ts +62 -0
- package/dist/remote-control.d.ts.map +1 -0
- package/dist/remote-control.js +78 -0
- package/dist/result-end.d.ts +68 -0
- package/dist/result-end.d.ts.map +1 -0
- package/dist/result-end.js +84 -0
- package/dist/sdk-to-acp.d.ts +93 -0
- package/dist/sdk-to-acp.d.ts.map +1 -0
- package/dist/sdk-to-acp.js +635 -0
- package/dist/serve.d.ts +9 -3
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +10 -5
- package/dist/session-config-ids.d.ts +1 -0
- package/dist/session-config-ids.d.ts.map +1 -1
- package/dist/session-config-ids.js +1 -0
- package/dist/session-config-options.d.ts +64 -0
- package/dist/session-config-options.d.ts.map +1 -0
- package/dist/session-config-options.js +162 -0
- package/dist/session-effort.d.ts +67 -0
- package/dist/session-effort.d.ts.map +1 -1
- package/dist/session-effort.js +98 -0
- package/dist/session-env.d.ts +22 -0
- package/dist/session-env.d.ts.map +1 -0
- package/dist/session-env.js +66 -0
- package/dist/session-fast-mode.d.ts +83 -0
- package/dist/session-fast-mode.d.ts.map +1 -0
- package/dist/session-fast-mode.js +142 -0
- package/dist/session-index/connection.d.ts +5 -6
- package/dist/session-index/connection.d.ts.map +1 -1
- package/dist/session-index/connection.js +3 -5
- package/dist/session-mode.d.ts +1 -0
- package/dist/session-mode.d.ts.map +1 -1
- package/dist/session-mode.js +1 -1
- package/dist/session-model.d.ts +41 -0
- package/dist/session-model.d.ts.map +1 -1
- package/dist/session-model.js +110 -45
- package/dist/session-notices.d.ts +44 -0
- package/dist/session-notices.d.ts.map +1 -1
- package/dist/session-notices.js +68 -0
- package/dist/session-titles.d.ts +34 -12
- package/dist/session-titles.d.ts.map +1 -1
- package/dist/session-titles.js +7 -6
- package/dist/session-usage.d.ts +125 -0
- package/dist/session-usage.d.ts.map +1 -0
- package/dist/session-usage.js +196 -0
- package/dist/slash-commands.d.ts +10 -0
- package/dist/slash-commands.d.ts.map +1 -0
- package/dist/slash-commands.js +99 -0
- package/dist/streamed-text.d.ts +33 -0
- package/dist/streamed-text.d.ts.map +1 -0
- package/dist/streamed-text.js +71 -0
- package/dist/subagent-configuration.d.ts +32 -0
- package/dist/subagent-configuration.d.ts.map +1 -0
- package/dist/subagent-configuration.js +70 -0
- package/dist/subagent-replay.d.ts +18 -0
- package/dist/subagent-replay.d.ts.map +1 -1
- package/dist/subagent-replay.js +25 -15
- package/dist/tool-calls/client-capabilities.d.ts +8 -8
- package/dist/tool-calls/client-capabilities.js +4 -4
- package/dist/tool-calls/renderer.d.ts +4 -5
- package/dist/tool-calls/renderer.d.ts.map +1 -1
- package/dist/tool-calls/renderer.js +4 -5
- package/dist/turn-events.d.ts +6 -46
- package/dist/turn-events.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/v2/agent.d.ts +7 -11
- package/dist/v2/agent.d.ts.map +1 -1
- package/dist/v2/agent.js +751 -331
- package/dist/v2/air.d.ts +33 -0
- package/dist/v2/air.d.ts.map +1 -0
- package/dist/v2/air.js +29 -0
- package/dist/v2/auth.d.ts +97 -0
- package/dist/v2/auth.d.ts.map +1 -0
- package/dist/v2/auth.js +216 -0
- package/dist/v2/background.d.ts +27 -16
- package/dist/v2/background.d.ts.map +1 -1
- package/dist/v2/background.js +4 -32
- package/dist/v2/child-config.d.ts +55 -0
- package/dist/v2/child-config.d.ts.map +1 -0
- package/dist/v2/child-config.js +92 -0
- package/dist/v2/clear-context.d.ts +94 -0
- package/dist/v2/clear-context.d.ts.map +1 -0
- package/dist/v2/clear-context.js +176 -0
- package/dist/v2/commands.d.ts +46 -0
- package/dist/v2/commands.d.ts.map +1 -0
- package/dist/v2/commands.js +54 -0
- package/dist/v2/config.d.ts +187 -0
- package/dist/v2/config.d.ts.map +1 -0
- package/dist/v2/config.js +494 -0
- package/dist/v2/elicitation.d.ts +93 -0
- package/dist/v2/elicitation.d.ts.map +1 -0
- package/dist/v2/elicitation.js +160 -0
- package/dist/v2/file-changes.d.ts +61 -0
- package/dist/v2/file-changes.d.ts.map +1 -0
- package/dist/v2/file-changes.js +108 -0
- package/dist/v2/file-preview.d.ts +18 -0
- package/dist/v2/file-preview.d.ts.map +1 -0
- package/dist/v2/file-preview.js +29 -0
- package/dist/v2/initialize.d.ts +10 -24
- package/dist/v2/initialize.d.ts.map +1 -1
- package/dist/v2/initialize.js +4 -111
- package/dist/v2/outcome.d.ts +81 -0
- package/dist/v2/outcome.d.ts.map +1 -0
- package/dist/v2/outcome.js +166 -0
- package/dist/v2/permissions.d.ts +92 -0
- package/dist/v2/permissions.d.ts.map +1 -0
- package/dist/v2/permissions.js +162 -0
- package/dist/v2/prompt.d.ts +2 -42
- package/dist/v2/prompt.d.ts.map +1 -1
- package/dist/v2/prompt.js +2 -119
- package/dist/v2/remote-control.d.ts +41 -0
- package/dist/v2/remote-control.d.ts.map +1 -0
- package/dist/v2/remote-control.js +63 -0
- package/dist/v2/reports.d.ts +198 -0
- package/dist/v2/reports.d.ts.map +1 -0
- package/dist/v2/reports.js +487 -0
- package/dist/v2/restarts.d.ts +128 -0
- package/dist/v2/restarts.d.ts.map +1 -0
- package/dist/v2/restarts.js +348 -0
- package/dist/v2/session-requests.d.ts +20 -0
- package/dist/v2/session-requests.d.ts.map +1 -0
- package/dist/v2/session-requests.js +108 -0
- package/dist/v2/session-update.d.ts +2 -13
- package/dist/v2/session-update.d.ts.map +1 -1
- package/dist/v2/session-update.js +2 -22
- package/dist/v2/session.d.ts +340 -41
- package/dist/v2/session.d.ts.map +1 -1
- package/dist/v2/session.js +1224 -141
- package/dist/v2/setup.d.ts +49 -0
- package/dist/v2/setup.d.ts.map +1 -0
- package/dist/v2/setup.js +62 -0
- package/dist/v2/stopped-work.d.ts +123 -0
- package/dist/v2/stopped-work.d.ts.map +1 -0
- package/dist/v2/stopped-work.js +210 -0
- package/dist/v2/stream.d.ts +229 -0
- package/dist/v2/stream.d.ts.map +1 -0
- package/dist/v2/stream.js +507 -0
- package/dist/v2/subagent-replay.d.ts +115 -0
- package/dist/v2/subagent-replay.d.ts.map +1 -0
- package/dist/v2/subagent-replay.js +479 -0
- package/dist/v2/subscription-guard.d.ts +60 -0
- package/dist/v2/subscription-guard.d.ts.map +1 -0
- package/dist/v2/subscription-guard.js +84 -0
- package/dist/v2/tasks.d.ts +492 -0
- package/dist/v2/tasks.d.ts.map +1 -0
- package/dist/v2/tasks.js +1728 -0
- package/dist/v2/terminal.d.ts.map +1 -1
- package/dist/v2/terminal.js +6 -1
- package/dist/v2/tool-call.d.ts +3 -2
- package/dist/v2/tool-call.d.ts.map +1 -1
- package/dist/v2/update-translator.d.ts +36 -0
- package/dist/v2/update-translator.d.ts.map +1 -0
- package/dist/v2/update-translator.js +80 -0
- package/dist/workflow-progress.d.ts +23 -0
- package/dist/workflow-progress.d.ts.map +1 -1
- package/dist/workflow-progress.js +31 -8
- package/package.json +1 -1
- package/dist/v2/permission.d.ts +0 -28
- package/dist/v2/permission.d.ts.map +0 -1
- package/dist/v2/permission.js +0 -41
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth for the MCP servers that Claude Code reports as `needs-auth`, as an
|
|
3
|
+
* ACP URL elicitation. Protocol-neutral: the v1 core and the v2 core
|
|
4
|
+
* both start it once a session's setup response is sent.
|
|
5
|
+
*/
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
/** Claude Code keeps the OAuth callback listener open in the background after
|
|
8
|
+
* `mcpAuthenticate` returns the authorization URL. The SDK does not expose
|
|
9
|
+
* that listener's completion promise, so watch the server status while the
|
|
10
|
+
* ACP client has the URL elicitation open. */
|
|
11
|
+
const MCP_OAUTH_STATUS_POLL_MS = 1_000;
|
|
12
|
+
const MCP_OAUTH_TIMEOUT_MS = 10 * 60_000;
|
|
13
|
+
export function supportsMcpOAuth(query) {
|
|
14
|
+
return typeof query.mcpAuthenticate === "function";
|
|
15
|
+
}
|
|
16
|
+
const mcpAuthentications = new WeakMap();
|
|
17
|
+
/** Start OAuth in the background for the servers in `requestedServers` that
|
|
18
|
+
* Claude reports as needing authentication. It does nothing while another
|
|
19
|
+
* OAuth run of the session is in progress. */
|
|
20
|
+
export function startMcpServerAuthentication(client, session, requestedServers) {
|
|
21
|
+
if (!client.urlElicitation || requestedServers.size === 0)
|
|
22
|
+
return;
|
|
23
|
+
const query = session.currentQuery();
|
|
24
|
+
if (!query || mcpAuthentications.has(session.key))
|
|
25
|
+
return;
|
|
26
|
+
const authentication = authenticateMcpServers(client, session, query, requestedServers)
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
if (!session.closed.aborted) {
|
|
29
|
+
client.logger.error(`Failed to inspect MCP servers for OAuth: ${error}`);
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.finally(() => {
|
|
33
|
+
if (mcpAuthentications.get(session.key) === authentication) {
|
|
34
|
+
mcpAuthentications.delete(session.key);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
mcpAuthentications.set(session.key, authentication);
|
|
38
|
+
}
|
|
39
|
+
async function authenticateMcpServers(client, session, query, requestedServers) {
|
|
40
|
+
if (!supportsMcpOAuth(query)) {
|
|
41
|
+
client.logger.error("The Claude Agent SDK does not expose MCP OAuth authentication.");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const statuses = await query.mcpServerStatus();
|
|
45
|
+
for (const status of statuses) {
|
|
46
|
+
if (status.status !== "needs-auth" || !requestedServers.has(status.name))
|
|
47
|
+
continue;
|
|
48
|
+
try {
|
|
49
|
+
await authenticateMcpServer(client, session, query, status.name);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (session.currentQuery() && !session.closed.aborted) {
|
|
53
|
+
client.logger.error(`Failed to authenticate MCP server ${status.name}: ${error}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Bridge Claude Code's startup MCP OAuth control to ACP URL elicitation.
|
|
59
|
+
* Claude opens and owns the localhost callback listener; the ACP client only
|
|
60
|
+
* needs to present the returned authorization URL. */
|
|
61
|
+
async function authenticateMcpServer(client, session, query, serverName) {
|
|
62
|
+
if (!session.currentQuery())
|
|
63
|
+
return;
|
|
64
|
+
const login = await query.mcpAuthenticate(serverName);
|
|
65
|
+
if (!login.requiresUserAction)
|
|
66
|
+
return;
|
|
67
|
+
if (!login.authUrl) {
|
|
68
|
+
throw new Error("Claude Code requested user action without returning an authorization URL");
|
|
69
|
+
}
|
|
70
|
+
const elicitationId = `mcp-oauth-${randomUUID()}`;
|
|
71
|
+
const flowAbort = new AbortController();
|
|
72
|
+
const abortFlow = () => flowAbort.abort(session.closed.reason);
|
|
73
|
+
session.closed.addEventListener("abort", abortFlow, { once: true });
|
|
74
|
+
if (session.closed.aborted)
|
|
75
|
+
abortFlow();
|
|
76
|
+
try {
|
|
77
|
+
const completed = waitForMcpAuthentication(session, query, serverName, flowAbort.signal);
|
|
78
|
+
const elicitation = client.createElicitation({
|
|
79
|
+
mode: "url",
|
|
80
|
+
sessionId: session.sessionId,
|
|
81
|
+
message: `Authenticate with MCP server ${serverName}`,
|
|
82
|
+
url: login.authUrl,
|
|
83
|
+
elicitationId,
|
|
84
|
+
}, flowAbort.signal);
|
|
85
|
+
const first = await Promise.race([
|
|
86
|
+
completed.then((authenticated) => ({ type: "completed", authenticated })),
|
|
87
|
+
elicitation.then((response) => ({ type: "elicitation", response })),
|
|
88
|
+
]);
|
|
89
|
+
// A url-mode accept carries no content to check. The guard
|
|
90
|
+
// `CreateElicitationResponse.isAccept` would also reject an accept whose
|
|
91
|
+
// `content` holds a v2-only value, such as an object.
|
|
92
|
+
if (first.type === "elicitation" && first.response.action !== "accept") {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (first.type === "elicitation") {
|
|
96
|
+
await completed;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
await client.completeElicitation({ elicitationId });
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
if (!flowAbort.signal.aborted) {
|
|
103
|
+
client.logger.error(`Failed to complete MCP OAuth elicitation: ${error}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
flowAbort.abort();
|
|
109
|
+
session.closed.removeEventListener("abort", abortFlow);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function waitForMcpAuthentication(session, query, serverName, signal) {
|
|
113
|
+
const deadline = Date.now() + MCP_OAUTH_TIMEOUT_MS;
|
|
114
|
+
while (!signal.aborted && Date.now() < deadline) {
|
|
115
|
+
if (session.currentQuery() !== query)
|
|
116
|
+
return false;
|
|
117
|
+
const status = (await query.mcpServerStatus()).find((server) => server.name === serverName);
|
|
118
|
+
if (!status || status.status === "failed" || status.status === "disabled")
|
|
119
|
+
return false;
|
|
120
|
+
if (status.status === "connected")
|
|
121
|
+
return true;
|
|
122
|
+
if (!(await waitUnlessAborted(MCP_OAUTH_STATUS_POLL_MS, signal)))
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
/** Wait for a polling interval, resolving false when the session is aborted. */
|
|
128
|
+
export function waitUnlessAborted(milliseconds, signal) {
|
|
129
|
+
if (signal.aborted)
|
|
130
|
+
return Promise.resolve(false);
|
|
131
|
+
return new Promise((resolve) => {
|
|
132
|
+
const timer = setTimeout(() => {
|
|
133
|
+
signal.removeEventListener("abort", onAbort);
|
|
134
|
+
resolve(true);
|
|
135
|
+
}, milliseconds);
|
|
136
|
+
const onAbort = () => {
|
|
137
|
+
clearTimeout(timer);
|
|
138
|
+
resolve(false);
|
|
139
|
+
};
|
|
140
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
141
|
+
});
|
|
142
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { McpServer } from "@agentclientprotocol/sdk/unstable";
|
|
2
|
+
import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
|
3
|
+
/**
|
|
4
|
+
* The SDK configs of a session's ACP MCP servers, by name. HTTP and SSE
|
|
5
|
+
* servers keep their URL and headers; a server without `type` is stdio. A
|
|
6
|
+
* server of any other transport is left out: the session's `initialize`
|
|
7
|
+
* advertises none.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sdkMcpServers(servers: readonly McpServer[] | null | undefined): Record<string, McpServerConfig>;
|
|
10
|
+
//# sourceMappingURL=mcp-servers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.d.ts","sourceRoot":"","sources":["../src/mcp-servers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,GAC/C,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAqBjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SDK configs of a session's ACP MCP servers, by name. HTTP and SSE
|
|
3
|
+
* servers keep their URL and headers; a server without `type` is stdio. A
|
|
4
|
+
* server of any other transport is left out: the session's `initialize`
|
|
5
|
+
* advertises none.
|
|
6
|
+
*/
|
|
7
|
+
export function sdkMcpServers(servers) {
|
|
8
|
+
const configs = {};
|
|
9
|
+
for (const server of servers ?? []) {
|
|
10
|
+
if ("type" in server && (server.type === "http" || server.type === "sse")) {
|
|
11
|
+
configs[server.name] = {
|
|
12
|
+
type: server.type,
|
|
13
|
+
url: server.url,
|
|
14
|
+
headers: server.headers
|
|
15
|
+
? Object.fromEntries(server.headers.map((e) => [e.name, e.value]))
|
|
16
|
+
: undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
else if (!("type" in server)) {
|
|
20
|
+
configs[server.name] = {
|
|
21
|
+
type: "stdio",
|
|
22
|
+
command: server.command,
|
|
23
|
+
args: server.args,
|
|
24
|
+
env: server.env ? Object.fromEntries(server.env.map((e) => [e.name, e.value])) : undefined,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return configs;
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const LOCAL_ONLY_COMMANDS: Set<string>;
|
|
2
|
+
/**
|
|
3
|
+
* Return user-message content with local-command and injected-context marker
|
|
4
|
+
* tags removed, or `null` if nothing meaningful remains (caller should skip
|
|
5
|
+
* the message). Preserves real prose that's mixed in alongside the markers —
|
|
6
|
+
* e.g. a message like `<command-name>…</command-name>hi` becomes `hi`, and
|
|
7
|
+
* `hi<system-reminder>…</system-reminder>` becomes `hi`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stripLocalCommandMetadata(content: unknown): unknown | null;
|
|
10
|
+
export declare function isLocalCommandMetadata(content: unknown): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* True for the synthetic assistant message the CLI injects into the transcript
|
|
13
|
+
* when a turn fails authentication (e.g. "Not logged in · Please run /login",
|
|
14
|
+
* "Session expired. Please run /login to sign in again."). The `/login`
|
|
15
|
+
* instruction is Claude Code TUI-specific and meaningless to ACP clients
|
|
16
|
+
* (issue #863). The live prompt loop suppresses the text and fails the turn
|
|
17
|
+
* with `authRequired` so the client can run its own auth flow; replay must
|
|
18
|
+
* skip it too — both for parity with what the client saw live and because the
|
|
19
|
+
* message stays in the transcript forever, so it would resurface on every
|
|
20
|
+
* session/load even after the user has logged back in.
|
|
21
|
+
*
|
|
22
|
+
* Takes the API message (`message.message`), which replay only knows as
|
|
23
|
+
* `unknown`. The persisted record's structured `error` marker is stripped by
|
|
24
|
+
* `getSessionMessages`, and the CLI does not always set it to
|
|
25
|
+
* `authentication_failed` anyway: an expired login with no refresh token
|
|
26
|
+
* ("Login expired · Run /login to sign in again, …") arrives as
|
|
27
|
+
* `invalid_request`. So the synthetic model + text is what both paths match on.
|
|
28
|
+
* Usage-limit banners are excluded because some of them also mention `/login`
|
|
29
|
+
* (to switch accounts) and have their own handling.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isSyntheticLoginMessage(apiMessage: unknown): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* True for a transcript message delivered to the model from another agent,
|
|
34
|
+
* session or channel. Since SDK 0.3.284 `getSessionMessages` returns these as
|
|
35
|
+
* `is_meta` user messages whose content is the full harness framing (envelope
|
|
36
|
+
* XML plus the "not typed by your user" preamble). The live prompt loop never
|
|
37
|
+
* renders them, so replay skips them too rather than presenting them as text
|
|
38
|
+
* the user typed. Other `is_meta` messages (compact summaries) are kept.
|
|
39
|
+
*
|
|
40
|
+
* `is_meta` and `origin` are runtime fields not declared on `SessionMessage`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isReplayHiddenMetaMessage(message: unknown): boolean;
|
|
43
|
+
//# sourceMappingURL=message-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-filters.d.ts","sourceRoot":"","sources":["../src/message-filters.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,aAAqD,CAAC;AA+FtF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAyB1E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEhE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAgBpE;AAYD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAanE"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Claude Code messages and content that a client never sees as the user's
|
|
3
|
+
* or the agent's text: local slash command markers, context the CLI injects,
|
|
4
|
+
* the synthetic `/login` message and meta messages from other agents. The live
|
|
5
|
+
* stream and the `session/load` replay both filter with these.
|
|
6
|
+
*/
|
|
7
|
+
import { isLoginRequiredText } from "./result-end.js";
|
|
8
|
+
import { isSyntheticUsageLimitMessage } from "./session-failure-extension.js";
|
|
9
|
+
import { markerTagText, TASK_NOTIFICATION_TAG } from "./task-notifications.js";
|
|
10
|
+
// Slash commands that the SDK handles locally without replaying the user
|
|
11
|
+
// message and without invoking the model.
|
|
12
|
+
export const LOCAL_ONLY_COMMANDS = new Set(["/context", "/heapdump", "/extra-usage"]);
|
|
13
|
+
// Commands whose marker-only transcript records are ACP/client-local UI noise,
|
|
14
|
+
// not model-visible user prompts. Marker-only custom slash skills are not in
|
|
15
|
+
// this list, so replay can reconstruct them from `<command-name>`/`<command-args>`.
|
|
16
|
+
const REPLAY_HIDDEN_COMMANDS = new Set([
|
|
17
|
+
...LOCAL_ONLY_COMMANDS,
|
|
18
|
+
"/compact",
|
|
19
|
+
"/model",
|
|
20
|
+
"/mcp",
|
|
21
|
+
"/status",
|
|
22
|
+
"/usage",
|
|
23
|
+
]);
|
|
24
|
+
// The Claude SDK persists local slash command invocations (e.g. `/model`) and
|
|
25
|
+
// their output as user messages in the session transcript, wrapping the
|
|
26
|
+
// payload in these XML-like markers that the CLI uses for its own display.
|
|
27
|
+
// The live prompt loop drops them; replay must strip them too or they leak
|
|
28
|
+
// into the UI on session/load.
|
|
29
|
+
const LOCAL_COMMAND_MARKERS = [
|
|
30
|
+
"command-name",
|
|
31
|
+
"command-message",
|
|
32
|
+
"command-args",
|
|
33
|
+
"local-command-stdout",
|
|
34
|
+
"local-command-stderr",
|
|
35
|
+
].map((tag) => ({ open: `<${tag}>`, close: `</${tag}>` }));
|
|
36
|
+
// Context the CLI injects into a user turn to steer the model, appended to
|
|
37
|
+
// whatever the user typed. Nobody wrote it and no client sees it live — the
|
|
38
|
+
// prompt loop's user-message skip covers the whole message — but it is
|
|
39
|
+
// persisted alongside that prose, so replay would hand the client a prompt
|
|
40
|
+
// with instructions in it the user never gave. A `task-notification` tells the
|
|
41
|
+
// model that a background task stopped; live, the SDK `task_notification`
|
|
42
|
+
// frame reports the same stop, so replay restores the task state from it (see
|
|
43
|
+
// taskNotificationsOf) instead of showing it.
|
|
44
|
+
const INJECTED_CONTEXT_MARKERS = ["system-reminder", TASK_NOTIFICATION_TAG].map((tag) => ({
|
|
45
|
+
open: `<${tag}>`,
|
|
46
|
+
close: `</${tag}>`,
|
|
47
|
+
}));
|
|
48
|
+
// Everything a replayed user message may be wrapped in that is not speech.
|
|
49
|
+
const TRANSCRIPT_MARKERS = [...LOCAL_COMMAND_MARKERS, ...INJECTED_CONTEXT_MARKERS];
|
|
50
|
+
// Single-pass scanner that removes each `<tag>…</tag>` marker (matching the
|
|
51
|
+
// nearest closing tag of the same name, like a lazy regex would).
|
|
52
|
+
function stripMarkerTags(text) {
|
|
53
|
+
const dead = new Set();
|
|
54
|
+
let result = "";
|
|
55
|
+
let copiedUpTo = 0;
|
|
56
|
+
let i = 0;
|
|
57
|
+
while (i < text.length) {
|
|
58
|
+
if (text[i] === "<") {
|
|
59
|
+
const marker = TRANSCRIPT_MARKERS.find((m) => !dead.has(m.open) && text.startsWith(m.open, i));
|
|
60
|
+
if (marker) {
|
|
61
|
+
const end = text.indexOf(marker.close, i + marker.open.length);
|
|
62
|
+
if (end !== -1) {
|
|
63
|
+
result += text.slice(copiedUpTo, i);
|
|
64
|
+
i = copiedUpTo = end + marker.close.length;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
// No closing marker remains anywhere ahead, and `indexOf` only ever
|
|
68
|
+
// searches forward from here on, so stop treating this tag as an
|
|
69
|
+
// opener — that avoids rescanning the tail for it on every match.
|
|
70
|
+
dead.add(marker.open);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
i++;
|
|
74
|
+
}
|
|
75
|
+
return result + text.slice(copiedUpTo);
|
|
76
|
+
}
|
|
77
|
+
function hasMarkerTag(text, tag) {
|
|
78
|
+
return markerTagText(text, tag) !== undefined;
|
|
79
|
+
}
|
|
80
|
+
function commandInvocationFromMarkerOnlyText(text) {
|
|
81
|
+
if (hasMarkerTag(text, "local-command-stdout") || hasMarkerTag(text, "local-command-stderr")) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const commandName = markerTagText(text, "command-name")?.trim();
|
|
85
|
+
if (!commandName?.startsWith("/"))
|
|
86
|
+
return null;
|
|
87
|
+
if (REPLAY_HIDDEN_COMMANDS.has(commandName.split(" ", 1)[0]))
|
|
88
|
+
return null;
|
|
89
|
+
const commandArgs = markerTagText(text, "command-args")?.trim();
|
|
90
|
+
return commandArgs ? `${commandName} ${commandArgs}` : commandName;
|
|
91
|
+
}
|
|
92
|
+
function stripLocalCommandMetadataText(text) {
|
|
93
|
+
const stripped = stripMarkerTags(text);
|
|
94
|
+
if (stripped.trim() !== "")
|
|
95
|
+
return stripped;
|
|
96
|
+
return commandInvocationFromMarkerOnlyText(text);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Return user-message content with local-command and injected-context marker
|
|
100
|
+
* tags removed, or `null` if nothing meaningful remains (caller should skip
|
|
101
|
+
* the message). Preserves real prose that's mixed in alongside the markers —
|
|
102
|
+
* e.g. a message like `<command-name>…</command-name>hi` becomes `hi`, and
|
|
103
|
+
* `hi<system-reminder>…</system-reminder>` becomes `hi`.
|
|
104
|
+
*/
|
|
105
|
+
export function stripLocalCommandMetadata(content) {
|
|
106
|
+
if (typeof content === "string") {
|
|
107
|
+
return stripLocalCommandMetadataText(content);
|
|
108
|
+
}
|
|
109
|
+
if (!Array.isArray(content))
|
|
110
|
+
return content;
|
|
111
|
+
const kept = [];
|
|
112
|
+
for (const block of content) {
|
|
113
|
+
if (block &&
|
|
114
|
+
typeof block === "object" &&
|
|
115
|
+
"type" in block &&
|
|
116
|
+
block.type === "text" &&
|
|
117
|
+
"text" in block &&
|
|
118
|
+
typeof block.text === "string") {
|
|
119
|
+
const stripped = stripLocalCommandMetadataText(block.text);
|
|
120
|
+
if (stripped === null)
|
|
121
|
+
continue;
|
|
122
|
+
kept.push({ ...block, text: stripped });
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
kept.push(block);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (kept.length === 0)
|
|
129
|
+
return null;
|
|
130
|
+
return kept;
|
|
131
|
+
}
|
|
132
|
+
export function isLocalCommandMetadata(content) {
|
|
133
|
+
return stripLocalCommandMetadata(content) === null;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* True for the synthetic assistant message the CLI injects into the transcript
|
|
137
|
+
* when a turn fails authentication (e.g. "Not logged in · Please run /login",
|
|
138
|
+
* "Session expired. Please run /login to sign in again."). The `/login`
|
|
139
|
+
* instruction is Claude Code TUI-specific and meaningless to ACP clients
|
|
140
|
+
* (issue #863). The live prompt loop suppresses the text and fails the turn
|
|
141
|
+
* with `authRequired` so the client can run its own auth flow; replay must
|
|
142
|
+
* skip it too — both for parity with what the client saw live and because the
|
|
143
|
+
* message stays in the transcript forever, so it would resurface on every
|
|
144
|
+
* session/load even after the user has logged back in.
|
|
145
|
+
*
|
|
146
|
+
* Takes the API message (`message.message`), which replay only knows as
|
|
147
|
+
* `unknown`. The persisted record's structured `error` marker is stripped by
|
|
148
|
+
* `getSessionMessages`, and the CLI does not always set it to
|
|
149
|
+
* `authentication_failed` anyway: an expired login with no refresh token
|
|
150
|
+
* ("Login expired · Run /login to sign in again, …") arrives as
|
|
151
|
+
* `invalid_request`. So the synthetic model + text is what both paths match on.
|
|
152
|
+
* Usage-limit banners are excluded because some of them also mention `/login`
|
|
153
|
+
* (to switch accounts) and have their own handling.
|
|
154
|
+
*/
|
|
155
|
+
export function isSyntheticLoginMessage(apiMessage) {
|
|
156
|
+
if (!apiMessage || typeof apiMessage !== "object") {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
const { model, content } = apiMessage;
|
|
160
|
+
if (model !== "<synthetic>" || !Array.isArray(content) || content.length !== 1) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
const block = content[0];
|
|
164
|
+
return (!!block &&
|
|
165
|
+
block.type === "text" &&
|
|
166
|
+
typeof block.text === "string" &&
|
|
167
|
+
isLoginRequiredText(block.text) &&
|
|
168
|
+
!isSyntheticUsageLimitMessage(apiMessage));
|
|
169
|
+
}
|
|
170
|
+
/** Origin kinds of the meta user messages `getSessionMessages` returns since
|
|
171
|
+
* SDK 0.3.284 (messages from other agents, sessions and channels). */
|
|
172
|
+
const REPLAY_HIDDEN_META_ORIGIN_KINDS = new Set([
|
|
173
|
+
"peer",
|
|
174
|
+
"channel",
|
|
175
|
+
"observer",
|
|
176
|
+
"observer-activity",
|
|
177
|
+
"slack-ping",
|
|
178
|
+
]);
|
|
179
|
+
/**
|
|
180
|
+
* True for a transcript message delivered to the model from another agent,
|
|
181
|
+
* session or channel. Since SDK 0.3.284 `getSessionMessages` returns these as
|
|
182
|
+
* `is_meta` user messages whose content is the full harness framing (envelope
|
|
183
|
+
* XML plus the "not typed by your user" preamble). The live prompt loop never
|
|
184
|
+
* renders them, so replay skips them too rather than presenting them as text
|
|
185
|
+
* the user typed. Other `is_meta` messages (compact summaries) are kept.
|
|
186
|
+
*
|
|
187
|
+
* `is_meta` and `origin` are runtime fields not declared on `SessionMessage`.
|
|
188
|
+
*/
|
|
189
|
+
export function isReplayHiddenMetaMessage(message) {
|
|
190
|
+
if (!message || typeof message !== "object")
|
|
191
|
+
return false;
|
|
192
|
+
const { type, is_meta, origin } = message;
|
|
193
|
+
return (type === "user" &&
|
|
194
|
+
is_meta === true &&
|
|
195
|
+
typeof origin?.kind === "string" &&
|
|
196
|
+
REPLAY_HIDDEN_META_ORIGIN_KINDS.has(origin.kind));
|
|
197
|
+
}
|
|
@@ -109,6 +109,12 @@ type TaskStarted = {
|
|
|
109
109
|
description?: unknown;
|
|
110
110
|
prompt?: unknown;
|
|
111
111
|
};
|
|
112
|
+
export type SubagentIdentity = {
|
|
113
|
+
name?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
prompt?: string;
|
|
116
|
+
subagentType?: string;
|
|
117
|
+
};
|
|
112
118
|
/** An agent of the session's subagent history, as the runtime restores it. */
|
|
113
119
|
export type HistoricalSubagent = {
|
|
114
120
|
agentId: string;
|
|
@@ -218,13 +224,6 @@ export declare class NativeSubagentRuntime {
|
|
|
218
224
|
* `sessionId` of this live session, or undefined when no such child runs here.
|
|
219
225
|
*/
|
|
220
226
|
liveWorkState(sessionId: string): WorkState["state"] | undefined;
|
|
221
|
-
/**
|
|
222
|
-
* The RFD form: the `subagent_update` that tells a client that holds nothing
|
|
223
|
-
* of the announced child `sessionId` of this live session what it is now:
|
|
224
|
-
* its labels, its directory, its `cancel` capability, and its work state.
|
|
225
|
-
* Undefined when no such child runs here.
|
|
226
|
-
*/
|
|
227
|
-
currentUpdate(sessionId: string): AcpSessionNotification | undefined;
|
|
228
227
|
/**
|
|
229
228
|
* Reports the model of a child response, an exact model id, as the entry of
|
|
230
229
|
* the root session's `model` option that matches it, else as the id (see
|
|
@@ -582,7 +581,7 @@ export declare function launchReply(launchId: string, childSessionId: string, pa
|
|
|
582
581
|
* A failure is idle with the `error` stop reason and, when the SDK gives its
|
|
583
582
|
* text, the JSON-RPC `error`, as the RFD asks: a v1 child has no prompt
|
|
584
583
|
* response, so this is how a client learns that its work failed. The error is
|
|
585
|
-
* an internal error, as for a failed turn on
|
|
584
|
+
* an internal error, as for a failed turn on v2.
|
|
586
585
|
*
|
|
587
586
|
* A task that a worker restart orphaned, or that was still running when the
|
|
588
587
|
* stream ended, is idle with no stop reason: its work ended, but the adapter
|
|
@@ -631,6 +630,17 @@ export declare function isNativeSubagentControlUpdate(update: AcpSessionNotifica
|
|
|
631
630
|
sessionUpdate: "tool_call" | "tool_call_update";
|
|
632
631
|
}>;
|
|
633
632
|
export declare function isNativeSubagentControlTool(toolName: unknown): boolean;
|
|
633
|
+
/**
|
|
634
|
+
* A tool call that the client was not shown, as one `tool_call` with its
|
|
635
|
+
* final status, shown after all: an Agent/Task call whose child was never
|
|
636
|
+
* exposed (AIR's draft shows only a failed one, the RFD form also a completed
|
|
637
|
+
* one), a SendMessage call whose message reached no announced child, or a
|
|
638
|
+
* failed SubagentHandback call.
|
|
639
|
+
*/
|
|
640
|
+
export declare function unexposedControlFallback(initial: AcpSessionNotification | undefined, terminal: AcpSessionNotification, sessionId: string): AcpSessionNotification;
|
|
641
|
+
/** The labels and prompt of a child, from the input of the Agent or Task call that launched it. */
|
|
642
|
+
export declare function subagentIdentity(input: unknown): SubagentIdentity | undefined;
|
|
643
|
+
export declare function mergeSubagentIdentity(previous: SubagentIdentity | undefined, next: SubagentIdentity): SubagentIdentity;
|
|
634
644
|
/**
|
|
635
645
|
* Whether `left` and `right` are the same directory, also when one is
|
|
636
646
|
* spelled through a symlink, e.g. `/tmp/project` and `/private/tmp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3C,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
|
@@ -3,6 +3,7 @@ import { realpath } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { AIR_SUBAGENT_KEY, airExtensionMeta } from "./air-extension.js";
|
|
5
5
|
import { MODEL_CONFIG_ID } from "./session-model.js";
|
|
6
|
+
import { orderedSubagentConfiguration } from "./subagent-configuration.js";
|
|
6
7
|
import { isFinalToolCallStatus } from "./tool-calls/renderer.js";
|
|
7
8
|
const MAX_PENDING_PARENTS = 64;
|
|
8
9
|
const MAX_PENDING_UPDATES = 256;
|
|
@@ -123,31 +124,6 @@ export class NativeSubagentRuntime {
|
|
|
123
124
|
const child = this.children.get(sessionId);
|
|
124
125
|
return child?.announced ? child.workState : undefined;
|
|
125
126
|
}
|
|
126
|
-
/**
|
|
127
|
-
* The RFD form: the `subagent_update` that tells a client that holds nothing
|
|
128
|
-
* of the announced child `sessionId` of this live session what it is now:
|
|
129
|
-
* its labels, its directory, its `cancel` capability, and its work state.
|
|
130
|
-
* Undefined when no such child runs here.
|
|
131
|
-
*/
|
|
132
|
-
currentUpdate(sessionId) {
|
|
133
|
-
if (this.form !== "rfd")
|
|
134
|
-
return undefined;
|
|
135
|
-
const child = this.childOfSession(sessionId);
|
|
136
|
-
if (!child?.announced || !child.workState)
|
|
137
|
-
return undefined;
|
|
138
|
-
return {
|
|
139
|
-
sessionId: child.parentSessionId,
|
|
140
|
-
update: {
|
|
141
|
-
sessionUpdate: "subagent_update",
|
|
142
|
-
sessionId: child.sessionId,
|
|
143
|
-
...(child.title ? { title: child.title } : {}),
|
|
144
|
-
...(child.description ? { description: child.description } : {}),
|
|
145
|
-
...(child.reportedCwd ? { cwd: child.reportedCwd } : {}),
|
|
146
|
-
capabilities: { cancel: {} },
|
|
147
|
-
state: { state: child.workState },
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
127
|
/**
|
|
152
128
|
* Reports the model of a child response, an exact model id, as the entry of
|
|
153
129
|
* the root session's `model` option that matches it, else as the id (see
|
|
@@ -228,12 +204,7 @@ export class NativeSubagentRuntime {
|
|
|
228
204
|
const publishing = config.publishing.then(async () => {
|
|
229
205
|
if (this.configBySession.get(child.sessionId) !== config || ended())
|
|
230
206
|
return;
|
|
231
|
-
const
|
|
232
|
-
const rank = (option) => {
|
|
233
|
-
const index = priority.indexOf(option.category ?? "");
|
|
234
|
-
return index < 0 ? priority.length : index;
|
|
235
|
-
};
|
|
236
|
-
const configOptions = [...config.options.values()].sort((left, right) => rank(left) - rank(right));
|
|
207
|
+
const configOptions = orderedSubagentConfiguration(config.options.values());
|
|
237
208
|
const snapshot = JSON.stringify(configOptions);
|
|
238
209
|
if (config.published === snapshot)
|
|
239
210
|
return;
|
|
@@ -1600,7 +1571,7 @@ function isWorking(child) {
|
|
|
1600
1571
|
* A failure is idle with the `error` stop reason and, when the SDK gives its
|
|
1601
1572
|
* text, the JSON-RPC `error`, as the RFD asks: a v1 child has no prompt
|
|
1602
1573
|
* response, so this is how a client learns that its work failed. The error is
|
|
1603
|
-
* an internal error, as for a failed turn on
|
|
1574
|
+
* an internal error, as for a failed turn on v2.
|
|
1604
1575
|
*
|
|
1605
1576
|
* A task that a worker restart orphaned, or that was still running when the
|
|
1606
1577
|
* stream ended, is idle with no stop reason: its work ended, but the adapter
|
|
@@ -1733,7 +1704,7 @@ function isFailedToolCallUpdate(update) {
|
|
|
1733
1704
|
* one), a SendMessage call whose message reached no announced child, or a
|
|
1734
1705
|
* failed SubagentHandback call.
|
|
1735
1706
|
*/
|
|
1736
|
-
function unexposedControlFallback(initial, terminal, sessionId) {
|
|
1707
|
+
export function unexposedControlFallback(initial, terminal, sessionId) {
|
|
1737
1708
|
if (terminal.update.sessionUpdate !== "tool_call" &&
|
|
1738
1709
|
terminal.update.sessionUpdate !== "tool_call_update") {
|
|
1739
1710
|
return { ...terminal, sessionId };
|
|
@@ -1805,7 +1776,8 @@ function subagentDescription(prompt, description) {
|
|
|
1805
1776
|
}
|
|
1806
1777
|
return "Delegated task";
|
|
1807
1778
|
}
|
|
1808
|
-
|
|
1779
|
+
/** The labels and prompt of a child, from the input of the Agent or Task call that launched it. */
|
|
1780
|
+
export function subagentIdentity(input) {
|
|
1809
1781
|
if (typeof input !== "object" || input === null || Array.isArray(input))
|
|
1810
1782
|
return undefined;
|
|
1811
1783
|
const value = input;
|
|
@@ -1817,7 +1789,7 @@ function subagentIdentity(input) {
|
|
|
1817
1789
|
};
|
|
1818
1790
|
return Object.values(identity).some(Boolean) ? identity : undefined;
|
|
1819
1791
|
}
|
|
1820
|
-
function mergeSubagentIdentity(previous, next) {
|
|
1792
|
+
export function mergeSubagentIdentity(previous, next) {
|
|
1821
1793
|
return {
|
|
1822
1794
|
name: next.name ?? previous?.name,
|
|
1823
1795
|
description: next.description ?? previous?.description,
|