@lucascouts/claude-agent-acp-plus 0.34.1 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-agent.d.ts +49 -5
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +267 -48
- package/dist/child-sessions.d.ts +14 -1
- package/dist/child-sessions.d.ts.map +1 -1
- package/dist/child-sessions.js +41 -1
- package/dist/clear-context-coordinator.d.ts +4 -1
- package/dist/clear-context-coordinator.d.ts.map +1 -1
- package/dist/clear-context-coordinator.js +1 -1
- package/dist/exit-plan.d.ts.map +1 -1
- package/dist/exit-plan.js +8 -1
- package/dist/session-notices.d.ts +10 -0
- package/dist/session-notices.d.ts.map +1 -1
- package/dist/session-notices.js +22 -1
- package/dist/startup-failure.d.ts +16 -0
- package/dist/startup-failure.d.ts.map +1 -0
- package/dist/startup-failure.js +38 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/package.json +3 -3
package/dist/acp-agent.d.ts
CHANGED
|
@@ -428,6 +428,10 @@ export type Session = {
|
|
|
428
428
|
/** Serialized `system`/init `plugin_errors` last logged, so the per-turn
|
|
429
429
|
* init re-emit logs a plugin load failure once, not every turn. */
|
|
430
430
|
loggedPluginErrors?: string;
|
|
431
|
+
/** Names of client-provided MCP servers already reported as failed or
|
|
432
|
+
* needing authentication. `system`/init re-emits on every turn with the
|
|
433
|
+
* same statuses, and each server is reported once per session. */
|
|
434
|
+
reportedMcpServers?: Set<string>;
|
|
431
435
|
/** The long-lived consumer task. Lazily started on the first `prompt()` and
|
|
432
436
|
* kept alive for the session so between-turn/background messages are still
|
|
433
437
|
* drained and forwarded. */
|
|
@@ -725,6 +729,11 @@ export type Session = {
|
|
|
725
729
|
liveBackgroundTasks: Map<string, {
|
|
726
730
|
parentToolUseId?: string;
|
|
727
731
|
isSubagent: boolean;
|
|
732
|
+
/** Upstream #1466: where the task runs, from `task_started.is_backgrounded` and later
|
|
733
|
+
* `task_updated` patches, and the task that launched it. Together they answer
|
|
734
|
+
* `blocksForeground`: a cancelled permission request of background work is a denial. */
|
|
735
|
+
backgrounded?: boolean;
|
|
736
|
+
parentTaskId?: string;
|
|
728
737
|
/** Absent-from-level lifecycle, one field so the illegal
|
|
729
738
|
* armed-but-not-ended state is unrepresentable: undefined = live per
|
|
730
739
|
* the level signal; "ended" = a level omitted the task (holds stop
|
|
@@ -970,6 +979,16 @@ export type ToolUseCache = {
|
|
|
970
979
|
input: unknown;
|
|
971
980
|
};
|
|
972
981
|
};
|
|
982
|
+
/**
|
|
983
|
+
* The RFD labels for a child (upstream #1479). The title is what tells siblings apart: the
|
|
984
|
+
* agent's name when it has one, else the task's short description (never the prompt), else its
|
|
985
|
+
* role. The description is the role, its `subagent_type`, unless the role is already the title.
|
|
986
|
+
* Before this, siblings of one type all read "Explore".
|
|
987
|
+
*/
|
|
988
|
+
export declare function subagentLabels(name: string | undefined, task: string | undefined, role: string | undefined): {
|
|
989
|
+
title: string;
|
|
990
|
+
description?: string;
|
|
991
|
+
};
|
|
973
992
|
type StreamedToolInput = {
|
|
974
993
|
id: string;
|
|
975
994
|
name: string;
|
|
@@ -1011,6 +1030,14 @@ export declare function stripLocalCommandMetadata(content: unknown): unknown | n
|
|
|
1011
1030
|
*/
|
|
1012
1031
|
export declare function isReplayHiddenMetaMessage(message: unknown): boolean;
|
|
1013
1032
|
export declare function isLocalCommandMetadata(content: unknown): boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* True when CLI error text tells the user to sign in with `/login`. The CLI
|
|
1035
|
+
* words this several ways — "Not logged in · Please run /login", "Not logged
|
|
1036
|
+
* in · Run /login", "Login expired · Run /login to sign in again, or
|
|
1037
|
+
* re-authenticate your Anthropic profile" — so match the "run /login"
|
|
1038
|
+
* instruction rather than one sentence.
|
|
1039
|
+
*/
|
|
1040
|
+
export declare function isLoginRequiredText(text: string): boolean;
|
|
1014
1041
|
/**
|
|
1015
1042
|
* True for the synthetic assistant message the CLI injects into the transcript
|
|
1016
1043
|
* when a turn fails authentication (e.g. "Not logged in · Please run /login",
|
|
@@ -1023,9 +1050,13 @@ export declare function isLocalCommandMetadata(content: unknown): boolean;
|
|
|
1023
1050
|
* session/load even after the user has logged back in.
|
|
1024
1051
|
*
|
|
1025
1052
|
* Takes the API message (`message.message`), which replay only knows as
|
|
1026
|
-
* `unknown`. The persisted record's structured `error
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1053
|
+
* `unknown`. The persisted record's structured `error` marker is stripped by
|
|
1054
|
+
* `getSessionMessages`, and the CLI does not always set it to
|
|
1055
|
+
* `authentication_failed` anyway: an expired login with no refresh token
|
|
1056
|
+
* ("Login expired · Run /login to sign in again, …") arrives as
|
|
1057
|
+
* `invalid_request`. So the synthetic model + text is what both paths match on.
|
|
1058
|
+
* Usage-limit banners are excluded because some of them also mention `/login`
|
|
1059
|
+
* (to switch accounts) and have their own handling.
|
|
1029
1060
|
*/
|
|
1030
1061
|
export declare function isSyntheticLoginMessage(apiMessage: unknown): boolean;
|
|
1031
1062
|
/**
|
|
@@ -1186,6 +1217,10 @@ export declare class ClaudeAcpAgent {
|
|
|
1186
1217
|
* the same invalid-params error the `_claude/tasks` methods answer.
|
|
1187
1218
|
*/
|
|
1188
1219
|
refreshUsage(params: UsageRefreshRequest): Promise<UsageRefreshResponse>;
|
|
1220
|
+
/** Upstream #1464: a session notice when a client-provided MCP server reports `failed` or
|
|
1221
|
+
* `needs-auth` at init, once per server per session. Plus has no MCP OAuth flow, so a
|
|
1222
|
+
* `needs-auth` server is always reported; its tools stay unavailable until it is authenticated. */
|
|
1223
|
+
private reportMcpServerStartupFailures;
|
|
1189
1224
|
private publishGoalFromPrompt;
|
|
1190
1225
|
private publishRuntimeGoal;
|
|
1191
1226
|
/** Steer the session per the ACP steering wire protocol: inject a follow-up
|
|
@@ -1384,8 +1419,10 @@ export declare class ClaudeAcpAgent {
|
|
|
1384
1419
|
canUseTool(sessionId: string): CanUseTool;
|
|
1385
1420
|
/**
|
|
1386
1421
|
* Handle elicitation requests that originate from MCP servers by forwarding
|
|
1387
|
-
* them to the client over ACP.
|
|
1388
|
-
*
|
|
1422
|
+
* them to the client over ACP. Only the user's own decline reaches the MCP
|
|
1423
|
+
* server as `decline`. A request the user never saw, because the client did
|
|
1424
|
+
* not advertise its mode, we can't represent it, or the client answered with
|
|
1425
|
+
* an error, is a `cancel`.
|
|
1389
1426
|
*/
|
|
1390
1427
|
private handleMcpElicitation;
|
|
1391
1428
|
/**
|
|
@@ -1656,6 +1693,13 @@ export declare function matchResumedModel(models: ModelInfo[], liveModel: string
|
|
|
1656
1693
|
* catalog).
|
|
1657
1694
|
*/
|
|
1658
1695
|
export declare function applyAvailableModelsAllowlist(sdkModels: ModelInfo[], allowlist: string[], settingsModelOverrides?: Record<string, string>, logger?: Logger): ModelInfo[];
|
|
1696
|
+
/** Upstream #1286 (issue #1246): an allowlist can list an alias and pinned ids that inherit the
|
|
1697
|
+
* same SDK label, so a name-only picker shows identical rows. A name that occurs more than once
|
|
1698
|
+
* gets its model id appended; every row stays, and distinct names are unchanged. */
|
|
1699
|
+
export declare function withDistinctModelNames<T extends {
|
|
1700
|
+
modelId: string;
|
|
1701
|
+
name: string;
|
|
1702
|
+
}>(models: T[]): T[];
|
|
1659
1703
|
export declare function promptToClaude(prompt: PromptRequest): SDKUserMessage;
|
|
1660
1704
|
/**
|
|
1661
1705
|
* Resolves the ACP `messageId` for a Claude SDK message (live) or a persisted
|
package/dist/acp-agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAGnB,kBAAkB,EAClB,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBA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A0B,EACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAgIvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EAoErC;AA2ND;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,mBAAmB,CAgBrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,GAAG,IAAI,CAUf"}
|
package/dist/acp-agent.js
CHANGED
|
@@ -30,8 +30,8 @@ import { buildClaudePermissionPresentation } from "./permissions/presentation.js
|
|
|
30
30
|
import { decodeClaudePermissionResponse } from "./permissions/response.js";
|
|
31
31
|
import { activeUsageLimitMessage, airSessionFailureCapabilityMeta, assistantMessageText, createSessionFailureState, isSyntheticUsageLimitMessage, providerFailureCategory, SessionFailureController, sessionFailureMeta, supportsAirSessionFailures, } from "./session-failure-extension.js";
|
|
32
32
|
import { AGENT_FILE_CHANGE_REPORT_CAPABILITY, agentFileChangeReportMeta, agentFileChangeReportRequestId, containsFileChangeAuditMarker, createFileChangeAuditSupport, createFileChangeAuditTurnState, FILE_CHANGE_AUDIT_SERVER_NAME, isFileChangeAuditReportPhase, isFileChangeAuditTool, supportsAgentFileChangeReport, } from "./file-change-audit.js";
|
|
33
|
-
import { clientSupportsNotices, MAX_NOTICE_TITLE_LENGTH, normalizeNoticeText, noticeOrTranscriptUpdate, sentenceCase, splitNoticeText, } from "./session-notices.js";
|
|
34
|
-
import { applyTaskCreate, applyTaskList, applyTaskUpdate, createPostToolUseHook, createTaskHook, parseTaskCreateOutput, parseTaskListOutput, parseTaskUpdateOutput, planEntries, registerHookCallback, shellDescription, taskStateToPlanEntries, toolInfoFromToolUse, toolUpdateFromDiffToolResponse, toolUpdateFromToolResult, } from "./tools.js";
|
|
33
|
+
import { clientSupportsNotices, collapseHookSpeaker, MAX_NOTICE_TITLE_LENGTH, normalizeNoticeText, noticeOrTranscriptUpdate, sentenceCase, splitNoticeText, } from "./session-notices.js";
|
|
34
|
+
import { applyTaskCreate, applyTaskList, applyTaskUpdate, createPostToolUseHook, createTaskHook, parseTaskCreateOutput, parseTaskListOutput, parseTaskUpdateOutput, planEntries, registerHookCallback, shellDescription, unregisterHookCallback, taskStateToPlanEntries, toolInfoFromToolUse, toolUpdateFromDiffToolResponse, toolUpdateFromToolResult, } from "./tools.js";
|
|
35
35
|
import { nodeToWebReadable, nodeToWebWritable, Pushable, unreachable } from "./utils.js";
|
|
36
36
|
import { acceptedPlanToolResult, ExitPlanCoordinator, exitPlanModeRawOutput, isExitPlanInterruptionResult, observeExitPlanToolResults, } from "./exit-plan.js";
|
|
37
37
|
import { DEFAULT_AGENT_ID, EFFORT_CONFIG_ID, PLAN_UPDATES_CONFIG_ID, } from "./session-config-ids.js";
|
|
@@ -45,6 +45,7 @@ import { AccountUsageTracker } from "./account-usage.js";
|
|
|
45
45
|
import { readFreshLimits, sharedSampleMaxAgeMs, writeLimits } from "./quota-cache.js";
|
|
46
46
|
import { ACCOUNT_CONFIG_ID, accountForValue, accountInForce, createAccountConfigOption, envForAccount, readDeclaredAccounts, } from "./accounts.js";
|
|
47
47
|
import { isUsageCommandText, structuredUsageMarkdown, syntheticLocalCommand, } from "./usage-markdown.js";
|
|
48
|
+
import { STARTUP_FAILURE_RESULTS_ENV, startupFailureError } from "./startup-failure.js";
|
|
48
49
|
export { DEFAULT_AGENT_ID, EFFORT_CONFIG_ID } from "./session-config-ids.js";
|
|
49
50
|
import { MODE_CONFIG_ID, SessionModeManager } from "./session-mode.js";
|
|
50
51
|
import { TASKS_CONTRACT_VERSION, TASKS_META_KEY, normaliseStatus, TailPoller, TaskFeed, TaskFeedPublisher, } from "./task-feed.js";
|
|
@@ -418,30 +419,55 @@ function subagentLaunchOf(parentSessionId, session, message) {
|
|
|
418
419
|
launcherTaskId: message.parent_task_id,
|
|
419
420
|
toolUseId: message.tool_use_id,
|
|
420
421
|
agentId: message.task_id,
|
|
421
|
-
|
|
422
|
-
description: message.description,
|
|
422
|
+
...subagentLabels(name, message.description, message.subagent_type),
|
|
423
423
|
prompt,
|
|
424
424
|
cancellable: typeof session.query.stopTask === "function",
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* The RFD labels for a child (upstream #1479). The title is what tells siblings apart: the
|
|
429
|
+
* agent's name when it has one, else the task's short description (never the prompt), else its
|
|
430
|
+
* role. The description is the role, its `subagent_type`, unless the role is already the title.
|
|
431
|
+
* Before this, siblings of one type all read "Explore".
|
|
432
|
+
*/
|
|
433
|
+
export function subagentLabels(name, task, role) {
|
|
434
|
+
const text = (value) => (value && value.trim() ? value : undefined);
|
|
435
|
+
const agentRole = text(role);
|
|
436
|
+
const title = text(name) ?? text(task) ?? agentRole ?? "Subagent";
|
|
437
|
+
return { title, ...(agentRole && agentRole !== title ? { description: agentRole } : {}) };
|
|
438
|
+
}
|
|
427
439
|
/** A child read back from a transcript, in the shape `ChildSessionRouter`
|
|
428
440
|
* announces: the same title rule as a live launch (`subagentLaunchOf`). */
|
|
429
441
|
function childLaunchOf(parentSessionId, session, toolUseId, record, input) {
|
|
430
442
|
const text = (value) => (typeof value === "string" && value.trim() ? value : undefined);
|
|
431
|
-
const description = record.description ?? text(input.description) ?? "";
|
|
432
443
|
return {
|
|
433
444
|
parentSessionId,
|
|
434
445
|
launcherTaskId: record.launcherAgentId,
|
|
435
446
|
toolUseId,
|
|
436
447
|
agentId: record.agentId,
|
|
437
|
-
|
|
438
|
-
description,
|
|
448
|
+
...subagentLabels(record.name ?? text(input.name), record.description ?? text(input.description), record.agentType ?? text(input.subagent_type)),
|
|
439
449
|
prompt: text(input.prompt),
|
|
440
450
|
// History, not a task the CLI holds: no Stop until it runs again, when its
|
|
441
451
|
// live launch advertises what the SDK can stop (design.md, Security).
|
|
442
452
|
cancellable: false,
|
|
443
453
|
};
|
|
444
454
|
}
|
|
455
|
+
/** Whether a permission request from `agentID` belongs to work that blocks the turn: the main
|
|
456
|
+
* thread (no agent id), a foreground subagent, or a subagent launched by one. A task this
|
|
457
|
+
* session never registered is not foreground work (upstream #1466, `blocksForeground`). */
|
|
458
|
+
function blocksForeground(session, agentID) {
|
|
459
|
+
const seen = new Set();
|
|
460
|
+
for (let id = agentID; id !== undefined && !seen.has(id);) {
|
|
461
|
+
seen.add(id);
|
|
462
|
+
const task = session.liveBackgroundTasks.get(id);
|
|
463
|
+
if (!task)
|
|
464
|
+
return false;
|
|
465
|
+
if (task.backgrounded)
|
|
466
|
+
return false;
|
|
467
|
+
id = task.parentTaskId;
|
|
468
|
+
}
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
445
471
|
/** The text of a user message whose content is a string or one text block. */
|
|
446
472
|
function userText(content) {
|
|
447
473
|
if (typeof content === "string")
|
|
@@ -750,6 +776,16 @@ export function isReplayHiddenMetaMessage(message) {
|
|
|
750
776
|
export function isLocalCommandMetadata(content) {
|
|
751
777
|
return stripLocalCommandMetadata(content) === null;
|
|
752
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* True when CLI error text tells the user to sign in with `/login`. The CLI
|
|
781
|
+
* words this several ways — "Not logged in · Please run /login", "Not logged
|
|
782
|
+
* in · Run /login", "Login expired · Run /login to sign in again, or
|
|
783
|
+
* re-authenticate your Anthropic profile" — so match the "run /login"
|
|
784
|
+
* instruction rather than one sentence.
|
|
785
|
+
*/
|
|
786
|
+
export function isLoginRequiredText(text) {
|
|
787
|
+
return /\brun \/login\b/i.test(text);
|
|
788
|
+
}
|
|
753
789
|
/**
|
|
754
790
|
* True for the synthetic assistant message the CLI injects into the transcript
|
|
755
791
|
* when a turn fails authentication (e.g. "Not logged in · Please run /login",
|
|
@@ -762,9 +798,13 @@ export function isLocalCommandMetadata(content) {
|
|
|
762
798
|
* session/load even after the user has logged back in.
|
|
763
799
|
*
|
|
764
800
|
* Takes the API message (`message.message`), which replay only knows as
|
|
765
|
-
* `unknown`. The persisted record's structured `error
|
|
766
|
-
*
|
|
767
|
-
*
|
|
801
|
+
* `unknown`. The persisted record's structured `error` marker is stripped by
|
|
802
|
+
* `getSessionMessages`, and the CLI does not always set it to
|
|
803
|
+
* `authentication_failed` anyway: an expired login with no refresh token
|
|
804
|
+
* ("Login expired · Run /login to sign in again, …") arrives as
|
|
805
|
+
* `invalid_request`. So the synthetic model + text is what both paths match on.
|
|
806
|
+
* Usage-limit banners are excluded because some of them also mention `/login`
|
|
807
|
+
* (to switch accounts) and have their own handling.
|
|
768
808
|
*/
|
|
769
809
|
export function isSyntheticLoginMessage(apiMessage) {
|
|
770
810
|
if (!apiMessage || typeof apiMessage !== "object") {
|
|
@@ -778,7 +818,8 @@ export function isSyntheticLoginMessage(apiMessage) {
|
|
|
778
818
|
return (!!block &&
|
|
779
819
|
block.type === "text" &&
|
|
780
820
|
typeof block.text === "string" &&
|
|
781
|
-
block.text
|
|
821
|
+
isLoginRequiredText(block.text) &&
|
|
822
|
+
!isSyntheticUsageLimitMessage(apiMessage));
|
|
782
823
|
}
|
|
783
824
|
/**
|
|
784
825
|
* Bridges {@link AcpClient} to the connection-scoped {@link AgentContext}
|
|
@@ -1702,6 +1743,44 @@ export class ClaudeAcpAgent {
|
|
|
1702
1743
|
log(refreshed ? "published" : "nothing", coalesced ? "coalesced" : undefined);
|
|
1703
1744
|
return { refreshed };
|
|
1704
1745
|
}
|
|
1746
|
+
/** Upstream #1464: a session notice when a client-provided MCP server reports `failed` or
|
|
1747
|
+
* `needs-auth` at init, once per server per session. Plus has no MCP OAuth flow, so a
|
|
1748
|
+
* `needs-auth` server is always reported; its tools stay unavailable until it is authenticated. */
|
|
1749
|
+
async reportMcpServerStartupFailures(session, servers, supportsNotices, sendUpdate, sessionId) {
|
|
1750
|
+
if (!servers?.length)
|
|
1751
|
+
return;
|
|
1752
|
+
const clientServers = new Set((session.creationParams?.mcpServers ?? []).map((server) => server.name));
|
|
1753
|
+
for (const server of servers) {
|
|
1754
|
+
if (!clientServers.has(server.name) || session.reportedMcpServers?.has(server.name)) {
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
let notice;
|
|
1758
|
+
if (server.status === "failed") {
|
|
1759
|
+
notice = {
|
|
1760
|
+
severity: "warning",
|
|
1761
|
+
title: `MCP server "${server.name}" failed to start`,
|
|
1762
|
+
description: "Its tools are unavailable in this session. Run /mcp for the error.",
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
else if (server.status === "needs-auth") {
|
|
1766
|
+
notice = {
|
|
1767
|
+
severity: "info",
|
|
1768
|
+
title: `MCP server "${server.name}" needs authentication`,
|
|
1769
|
+
description: "Its tools are unavailable until the server is authenticated.",
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
else {
|
|
1773
|
+
continue;
|
|
1774
|
+
}
|
|
1775
|
+
(session.reportedMcpServers ??= new Set()).add(server.name);
|
|
1776
|
+
await sendUpdate({
|
|
1777
|
+
sessionId,
|
|
1778
|
+
update: noticeOrTranscriptUpdate(notice, supportsNotices, undefined, {
|
|
1779
|
+
claudeCode: { kind: "mcpServerStatus", server: server.name, status: server.status },
|
|
1780
|
+
}),
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1705
1784
|
async publishGoalFromPrompt(sessionId, prompt, commandUuid) {
|
|
1706
1785
|
const goalUpdate = goalUpdateFromPrompt(prompt);
|
|
1707
1786
|
if (goalUpdate !== undefined) {
|
|
@@ -1986,6 +2065,10 @@ export class ClaudeAcpAgent {
|
|
|
1986
2065
|
let lastAssistantTotalUsage = null;
|
|
1987
2066
|
let lastAssistantUsage = null;
|
|
1988
2067
|
let lastAssistantModel = null;
|
|
2068
|
+
// A `rate_limit_event` that arrived before the turn had a context total to
|
|
2069
|
+
// send it with (upstream #1534): with partial messages on, the SDK sends it
|
|
2070
|
+
// ahead of the first assistant frame. It rides the turn's next usage_update.
|
|
2071
|
+
let pendingRateLimit = null;
|
|
1989
2072
|
// When the Claude SDK classifies a turn as failed (e.g. rate limit, auth
|
|
1990
2073
|
// problem, billing), it sets a categorical `error` field on the
|
|
1991
2074
|
// `SDKAssistantMessage` that precedes the final `result` message. We capture
|
|
@@ -2141,10 +2224,23 @@ export class ClaudeAcpAgent {
|
|
|
2141
2224
|
await sessionFailures.clear((failure) => failure.recoveryPolicy === "next_attempt" && failure.turnId !== activeTurnId);
|
|
2142
2225
|
};
|
|
2143
2226
|
const internalErrorForClient = (data, rawDetail) => RequestError.internalError(data, supportsAirSessionFailures(this.clientCapabilities) ? undefined : rawDetail);
|
|
2227
|
+
/** Attach a pending rate limit to a usage_update, once. A `_claude/rateLimit`
|
|
2228
|
+
* the update already carries wins, the same precedence upstream uses. */
|
|
2229
|
+
const withPendingRateLimit = (update) => {
|
|
2230
|
+
if (pendingRateLimit === null)
|
|
2231
|
+
return update;
|
|
2232
|
+
const rateLimit = pendingRateLimit;
|
|
2233
|
+
pendingRateLimit = null;
|
|
2234
|
+
return { ...update, _meta: { "_claude/rateLimit": rateLimit, ...(update._meta ?? {}) } };
|
|
2235
|
+
};
|
|
2144
2236
|
const resetTurnScratch = () => {
|
|
2145
2237
|
lastAssistantTotalUsage = null;
|
|
2146
2238
|
lastAssistantUsage = null;
|
|
2147
2239
|
lastAssistantModel = null;
|
|
2240
|
+
// A pending event belongs to the turn that measured it; one that found no
|
|
2241
|
+
// usage_update to ride must not be attributed to the next turn. The
|
|
2242
|
+
// tracker already remembers its status (R1.6).
|
|
2243
|
+
pendingRateLimit = null;
|
|
2148
2244
|
lastAssistantError = undefined;
|
|
2149
2245
|
lastAssistantWasUsageLimit = false;
|
|
2150
2246
|
lastAssistantFailureTitle = undefined;
|
|
@@ -3051,6 +3147,7 @@ export class ClaudeAcpAgent {
|
|
|
3051
3147
|
}
|
|
3052
3148
|
}
|
|
3053
3149
|
}
|
|
3150
|
+
await this.reportMcpServerStartupFailures(session, message.mcp_servers, supportsNotices, sendUpdate, params.sessionId);
|
|
3054
3151
|
break;
|
|
3055
3152
|
case "status": {
|
|
3056
3153
|
// Compaction is reported as ONE tool lifecycle rather than the
|
|
@@ -3110,11 +3207,11 @@ export class ClaudeAcpAgent {
|
|
|
3110
3207
|
session.contextUsedTokens = usedTokens ?? 0;
|
|
3111
3208
|
await sendUpdate({
|
|
3112
3209
|
sessionId: params.sessionId,
|
|
3113
|
-
update: {
|
|
3210
|
+
update: withPendingRateLimit({
|
|
3114
3211
|
sessionUpdate: "usage_update",
|
|
3115
3212
|
used: lastAssistantTotalUsage,
|
|
3116
3213
|
size: session.contextWindowSize,
|
|
3117
|
-
},
|
|
3214
|
+
}),
|
|
3118
3215
|
});
|
|
3119
3216
|
break;
|
|
3120
3217
|
}
|
|
@@ -3474,9 +3571,10 @@ export class ClaudeAcpAgent {
|
|
|
3474
3571
|
}
|
|
3475
3572
|
}
|
|
3476
3573
|
const severity = message.level === "warning" ? "warning" : "info";
|
|
3574
|
+
const transcriptContent = collapseHookSpeaker(message.content);
|
|
3477
3575
|
const transcriptText = message.level === "info"
|
|
3478
|
-
?
|
|
3479
|
-
: `**${sentenceCase(message.level)}:** ${
|
|
3576
|
+
? transcriptContent
|
|
3577
|
+
: `**${sentenceCase(message.level)}:** ${transcriptContent}`;
|
|
3480
3578
|
await sendUpdate({
|
|
3481
3579
|
sessionId: params.sessionId,
|
|
3482
3580
|
update: noticeOrTranscriptUpdate({
|
|
@@ -3530,6 +3628,10 @@ export class ClaudeAcpAgent {
|
|
|
3530
3628
|
session.liveBackgroundTasks.set(message.task_id, {
|
|
3531
3629
|
parentToolUseId: message.tool_use_id,
|
|
3532
3630
|
isSubagent: !!message.subagent_type,
|
|
3631
|
+
...(message.is_backgrounded !== undefined
|
|
3632
|
+
? { backgrounded: message.is_backgrounded }
|
|
3633
|
+
: {}),
|
|
3634
|
+
...(message.parent_task_id ? { parentTaskId: message.parent_task_id } : {}),
|
|
3533
3635
|
});
|
|
3534
3636
|
if (message.subagent_type && session.activeTurn && !session.activeTurn.settled) {
|
|
3535
3637
|
(session.activeTurn.spawnedTaskIds ??= new Set()).add(message.task_id);
|
|
@@ -3568,6 +3670,12 @@ export class ClaudeAcpAgent {
|
|
|
3568
3670
|
this.logger.log(`[task/late-run] dropped=task_updated task=${message.task_id} run=${message.run_id}`);
|
|
3569
3671
|
break;
|
|
3570
3672
|
}
|
|
3673
|
+
// A task moved to the background no longer blocks the foreground (#1466).
|
|
3674
|
+
if (message.patch.is_backgrounded !== undefined) {
|
|
3675
|
+
const task = session.liveBackgroundTasks.get(message.task_id);
|
|
3676
|
+
if (task)
|
|
3677
|
+
task.backgrounded = message.patch.is_backgrounded;
|
|
3678
|
+
}
|
|
3571
3679
|
// terminal-status task_updated patch and a (deduplicated)
|
|
3572
3680
|
// task_notification when a task settles, but only the patch is
|
|
3573
3681
|
// guaranteed per transition — prune on it too so the registry
|
|
@@ -3847,7 +3955,7 @@ export class ClaudeAcpAgent {
|
|
|
3847
3955
|
message.stop_reason === "refusal" ||
|
|
3848
3956
|
("result" in message &&
|
|
3849
3957
|
message.is_error &&
|
|
3850
|
-
message.result
|
|
3958
|
+
isLoginRequiredText(message.result));
|
|
3851
3959
|
if (goalCommandFailed) {
|
|
3852
3960
|
await this.publishGoal(params.sessionId, pendingGoalUpdate.previous ?? null);
|
|
3853
3961
|
}
|
|
@@ -3973,7 +4081,7 @@ export class ClaudeAcpAgent {
|
|
|
3973
4081
|
if (lastAssistantTotalUsage !== null) {
|
|
3974
4082
|
await sendUpdate({
|
|
3975
4083
|
sessionId: params.sessionId,
|
|
3976
|
-
update: {
|
|
4084
|
+
update: withPendingRateLimit({
|
|
3977
4085
|
sessionUpdate: "usage_update",
|
|
3978
4086
|
used: lastAssistantTotalUsage,
|
|
3979
4087
|
size: session.contextWindowSize,
|
|
@@ -3984,7 +4092,7 @@ export class ClaudeAcpAgent {
|
|
|
3984
4092
|
...(message.origin && {
|
|
3985
4093
|
_meta: { "_claude/origin": message.origin },
|
|
3986
4094
|
}),
|
|
3987
|
-
},
|
|
4095
|
+
}),
|
|
3988
4096
|
});
|
|
3989
4097
|
}
|
|
3990
4098
|
if (session.cancelled) {
|
|
@@ -4008,7 +4116,7 @@ export class ClaudeAcpAgent {
|
|
|
4008
4116
|
// drained hold at their results is as good as the idle
|
|
4009
4117
|
// fallback.) Then stop: everything below is user-turn
|
|
4010
4118
|
// lifecycle, and an autonomous outcome must never touch it —
|
|
4011
|
-
// its is_error or "
|
|
4119
|
+
// its is_error or "run /login" text would otherwise
|
|
4012
4120
|
// failActive a live turn (the held one, or the user's next
|
|
4013
4121
|
// prompt) whose own result recorded a different outcome.
|
|
4014
4122
|
if (isAutonomousResult) {
|
|
@@ -4128,7 +4236,7 @@ export class ClaudeAcpAgent {
|
|
|
4128
4236
|
}
|
|
4129
4237
|
switch (message.subtype) {
|
|
4130
4238
|
case "success": {
|
|
4131
|
-
if (message.is_error && message.result
|
|
4239
|
+
if (message.is_error && isLoginRequiredText(message.result)) {
|
|
4132
4240
|
await failActiveWithSessionFailure("auth_required", RequestError.authRequired(), message.result);
|
|
4133
4241
|
break;
|
|
4134
4242
|
}
|
|
@@ -4391,11 +4499,11 @@ export class ClaudeAcpAgent {
|
|
|
4391
4499
|
session.contextUsedTokens = nextUsage;
|
|
4392
4500
|
await sendUpdate({
|
|
4393
4501
|
sessionId: params.sessionId,
|
|
4394
|
-
update: {
|
|
4502
|
+
update: withPendingRateLimit({
|
|
4395
4503
|
sessionUpdate: "usage_update",
|
|
4396
4504
|
used: nextUsage,
|
|
4397
4505
|
size: session.contextWindowSize,
|
|
4398
|
-
},
|
|
4506
|
+
}),
|
|
4399
4507
|
});
|
|
4400
4508
|
}
|
|
4401
4509
|
}
|
|
@@ -4532,6 +4640,13 @@ export class ClaudeAcpAgent {
|
|
|
4532
4640
|
message.parent_tool_use_id === null &&
|
|
4533
4641
|
message.message.model === "<synthetic>" &&
|
|
4534
4642
|
compaction.hasDeliveredOutput) {
|
|
4643
|
+
if (isSyntheticUsageLimitMessage(message.message)) {
|
|
4644
|
+
lastAssistantWasUsageLimit = true;
|
|
4645
|
+
lastAssistantFailureTitle = assistantMessageText(message.message);
|
|
4646
|
+
if (message.error) {
|
|
4647
|
+
lastAssistantError = message.error;
|
|
4648
|
+
}
|
|
4649
|
+
}
|
|
4535
4650
|
break;
|
|
4536
4651
|
}
|
|
4537
4652
|
// Snapshot the latest top-level assistant usage and model so the
|
|
@@ -4660,6 +4775,7 @@ export class ClaudeAcpAgent {
|
|
|
4660
4775
|
}
|
|
4661
4776
|
}
|
|
4662
4777
|
let content;
|
|
4778
|
+
let toolUseResult = message.type === "user" ? message.tool_use_result : undefined;
|
|
4663
4779
|
if (message.type === "assistant" && message.parent_tool_use_id === null) {
|
|
4664
4780
|
// Top-level assistant message: each text/thinking block may have
|
|
4665
4781
|
// already been streamed live as deltas. Diff each against what
|
|
@@ -4734,6 +4850,18 @@ export class ClaudeAcpAgent {
|
|
|
4734
4850
|
// `parentToolUseId` stamped by toAcpNotifications.
|
|
4735
4851
|
content = message.message.content.filter((item) => item.type !== "text" && item.type !== "thinking");
|
|
4736
4852
|
}
|
|
4853
|
+
else if (message.parent_tool_use_id !== null &&
|
|
4854
|
+
Array.isArray(message.message.content)) {
|
|
4855
|
+
// Upstream #1431 (#1389): a foreground fork inherits a placeholder result for its
|
|
4856
|
+
// own launch. It completed the Agent call and dropped its tracked state, so the
|
|
4857
|
+
// fork's real report, arriving later, was lost. Only the launching side completes
|
|
4858
|
+
// that call. The message-level sidecar cannot describe a remaining result once its
|
|
4859
|
+
// launch result is removed.
|
|
4860
|
+
const launchId = message.parent_tool_use_id;
|
|
4861
|
+
content = message.message.content.filter((block) => block.type !== "tool_result" || block.tool_use_id !== launchId);
|
|
4862
|
+
if (content.length !== message.message.content.length)
|
|
4863
|
+
toolUseResult = undefined;
|
|
4864
|
+
}
|
|
4737
4865
|
else {
|
|
4738
4866
|
content = message.message.content;
|
|
4739
4867
|
}
|
|
@@ -4761,7 +4889,7 @@ export class ClaudeAcpAgent {
|
|
|
4761
4889
|
taskState: session.taskState,
|
|
4762
4890
|
emittedToolCalls: session.emittedToolCalls,
|
|
4763
4891
|
messageId: messageIdForGrouping(message),
|
|
4764
|
-
toolUseResult
|
|
4892
|
+
toolUseResult,
|
|
4765
4893
|
// On the wire since CLI 2.1.216 but not in SDKUserMessage's
|
|
4766
4894
|
// type, hence the cast. Validated by parseToolResultMeta.
|
|
4767
4895
|
toolResultMeta: message.type === "user"
|
|
@@ -4846,12 +4974,15 @@ export class ClaudeAcpAgent {
|
|
|
4846
4974
|
//
|
|
4847
4975
|
// Recorded OUTSIDE the emission guard below, and before it: the
|
|
4848
4976
|
// memory is fed by the event itself, not by our ability to forward
|
|
4849
|
-
// it, and before the first assistant message of a
|
|
4850
|
-
//
|
|
4851
|
-
//
|
|
4852
|
-
//
|
|
4977
|
+
// it, and before the first assistant message of a turn that guard
|
|
4978
|
+
// is false. The forwarding still sends `rate_limit_info` verbatim on
|
|
4979
|
+
// the same notification shape (R1.8); when the turn has no context
|
|
4980
|
+
// total yet, it waits for the turn's next usage_update (#1534).
|
|
4853
4981
|
this.accountUsageTracker(session).recordMeasured(message.rate_limit_info);
|
|
4854
|
-
if (lastAssistantTotalUsage
|
|
4982
|
+
if (lastAssistantTotalUsage === null) {
|
|
4983
|
+
pendingRateLimit = message.rate_limit_info;
|
|
4984
|
+
}
|
|
4985
|
+
else {
|
|
4855
4986
|
await sendUpdate({
|
|
4856
4987
|
sessionId: params.sessionId,
|
|
4857
4988
|
update: {
|
|
@@ -5510,16 +5641,6 @@ export class ClaudeAcpAgent {
|
|
|
5510
5641
|
? option.options.flatMap((o) => ("options" in o ? o.options : [o]))
|
|
5511
5642
|
: [];
|
|
5512
5643
|
let validValue = allValues.find((o) => o.value === params.value);
|
|
5513
|
-
// The option's reported currentValue is always a valid target, even when
|
|
5514
|
-
// it has no options entry: a session running an out-of-picker model
|
|
5515
|
-
// (resumed onto an allowlist-excluded model, or a refusal fallback)
|
|
5516
|
-
// reports a currentValue that isn't selectable, and a client
|
|
5517
|
-
// round-tripping it must not get "Invalid value". It flows through the
|
|
5518
|
-
// normal apply path below — re-asserting an already-current value is
|
|
5519
|
-
// harmless and can repair SDK drift.
|
|
5520
|
-
if (!validValue && option.currentValue === params.value) {
|
|
5521
|
-
validValue = { value: params.value, name: params.value };
|
|
5522
|
-
}
|
|
5523
5644
|
// For model options, fall back to resolveModelPreference when the exact
|
|
5524
5645
|
// value doesn't match. This lets callers use human-friendly aliases like
|
|
5525
5646
|
// "opus" or "sonnet" instead of full model IDs like "claude-opus-4-6".
|
|
@@ -5703,7 +5824,7 @@ export class ClaudeAcpAgent {
|
|
|
5703
5824
|
if (replaySession && replayMessageId && message.uuid) {
|
|
5704
5825
|
replaySession.messageIdToUuid.set(replayMessageId, message.uuid);
|
|
5705
5826
|
}
|
|
5706
|
-
// The live prompt loop converts the synthetic "
|
|
5827
|
+
// The live prompt loop converts the synthetic "run /login"
|
|
5707
5828
|
// assistant message into an authRequired error instead of showing its
|
|
5708
5829
|
// TUI-specific text; skip it on replay too (issue #863).
|
|
5709
5830
|
if (message.type === "assistant" && isSyntheticLoginMessage(message.message)) {
|
|
@@ -6056,6 +6177,21 @@ export class ClaudeAcpAgent {
|
|
|
6056
6177
|
}
|
|
6057
6178
|
if (signal.aborted)
|
|
6058
6179
|
throw new Error("Tool use aborted");
|
|
6180
|
+
// On `session/cancel` the client answers every open permission request
|
|
6181
|
+
// `cancelled`, including those of a background subagent, which the
|
|
6182
|
+
// cancel does not stop. Answer such a request with a denial so the
|
|
6183
|
+
// subagent reads "the user refused" and goes on. Throwing instead makes
|
|
6184
|
+
// Claude Code deny it as "Tool permission request failed".
|
|
6185
|
+
if (response.outcome?.outcome === "cancelled" &&
|
|
6186
|
+
this.sessions[sessionId] === session &&
|
|
6187
|
+
!blocksForeground(session, agentID)) {
|
|
6188
|
+
return {
|
|
6189
|
+
behavior: "deny",
|
|
6190
|
+
message: "User refused permission to run tool",
|
|
6191
|
+
toolUseID,
|
|
6192
|
+
decisionClassification: "user_reject",
|
|
6193
|
+
};
|
|
6194
|
+
}
|
|
6059
6195
|
const decodedPermission = decodeClaudePermissionResponse(response, toolName, toolInput, toolUseID, permissionOptions, durableChangeSet);
|
|
6060
6196
|
let permissionResult = decodedPermission.permissionResult;
|
|
6061
6197
|
const autoFallback = this.sessionModes.applyPermissionFallback(session, permissionResult);
|
|
@@ -6103,18 +6239,20 @@ export class ClaudeAcpAgent {
|
|
|
6103
6239
|
}
|
|
6104
6240
|
/**
|
|
6105
6241
|
* Handle elicitation requests that originate from MCP servers by forwarding
|
|
6106
|
-
* them to the client over ACP.
|
|
6107
|
-
*
|
|
6242
|
+
* them to the client over ACP. Only the user's own decline reaches the MCP
|
|
6243
|
+
* server as `decline`. A request the user never saw, because the client did
|
|
6244
|
+
* not advertise its mode, we can't represent it, or the client answered with
|
|
6245
|
+
* an error, is a `cancel`.
|
|
6108
6246
|
*/
|
|
6109
6247
|
handleMcpElicitation(sessionId, support) {
|
|
6110
6248
|
return async (request, { signal }) => {
|
|
6111
6249
|
const isUrl = request.mode === "url";
|
|
6112
6250
|
if ((isUrl && !support.url) || (!isUrl && !support.form)) {
|
|
6113
|
-
return { action: "
|
|
6251
|
+
return { action: "cancel" };
|
|
6114
6252
|
}
|
|
6115
6253
|
const createRequest = mcpElicitationToCreateRequest(request, sessionId);
|
|
6116
6254
|
if (!createRequest) {
|
|
6117
|
-
return { action: "
|
|
6255
|
+
return { action: "cancel" };
|
|
6118
6256
|
}
|
|
6119
6257
|
try {
|
|
6120
6258
|
const response = await this.withPendingUserInput(sessionId, () => this.client.unstable_createElicitation(createRequest, signal));
|
|
@@ -6129,8 +6267,11 @@ export class ClaudeAcpAgent {
|
|
|
6129
6267
|
if (signal.aborted) {
|
|
6130
6268
|
return { action: "cancel" };
|
|
6131
6269
|
}
|
|
6270
|
+
// The client answered with an error, e.g. -32602 for a form it cannot
|
|
6271
|
+
// render, so the user never saw the request. MCP's `decline` means the
|
|
6272
|
+
// user refused; `cancel` means they made no explicit choice.
|
|
6132
6273
|
this.logger.error(`Failed to forward MCP elicitation: ${error}`);
|
|
6133
|
-
return { action: "
|
|
6274
|
+
return { action: "cancel" };
|
|
6134
6275
|
}
|
|
6135
6276
|
};
|
|
6136
6277
|
}
|
|
@@ -7188,6 +7329,7 @@ export class ClaudeAcpAgent {
|
|
|
7188
7329
|
...providerEnv,
|
|
7189
7330
|
// Opt-in to session state events like when the agent is idle
|
|
7190
7331
|
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS: "1",
|
|
7332
|
+
...STARTUP_FAILURE_RESULTS_ENV,
|
|
7191
7333
|
};
|
|
7192
7334
|
// Plan updates (story 062): the todo tools are on unless an env the user
|
|
7193
7335
|
// wrote -- this spawn env or the settings tier the CLI applies after it --
|
|
@@ -7308,6 +7450,30 @@ export class ClaudeAcpAgent {
|
|
|
7308
7450
|
],
|
|
7309
7451
|
}
|
|
7310
7452
|
: {}),
|
|
7453
|
+
// Upstream #1496: a subagent's working directory, from its own SubagentStart hook,
|
|
7454
|
+
// which Claude Code runs (and waits for) before the child's first model request.
|
|
7455
|
+
...(this.childSessions
|
|
7456
|
+
? {
|
|
7457
|
+
SubagentStart: [
|
|
7458
|
+
...(userProvidedOptions?.hooks?.SubagentStart || []),
|
|
7459
|
+
{
|
|
7460
|
+
hooks: [
|
|
7461
|
+
async (input) => {
|
|
7462
|
+
const childSessions = this.childSessions;
|
|
7463
|
+
if (childSessions &&
|
|
7464
|
+
typeof input.agent_id === "string" &&
|
|
7465
|
+
typeof input.cwd === "string") {
|
|
7466
|
+
await childSessions
|
|
7467
|
+
.reportCwd(input.agent_id, input.cwd, params.cwd)
|
|
7468
|
+
.catch((error) => this.logger.error(`Session ${sessionId}: failed to report subagent cwd: ${error}`));
|
|
7469
|
+
}
|
|
7470
|
+
return { continue: true };
|
|
7471
|
+
},
|
|
7472
|
+
],
|
|
7473
|
+
},
|
|
7474
|
+
],
|
|
7475
|
+
}
|
|
7476
|
+
: {}),
|
|
7311
7477
|
TaskCreated: [
|
|
7312
7478
|
...(userProvidedOptions?.hooks?.TaskCreated || []),
|
|
7313
7479
|
{
|
|
@@ -7376,13 +7542,23 @@ export class ClaudeAcpAgent {
|
|
|
7376
7542
|
initializationResult = await q.initializationResult();
|
|
7377
7543
|
}
|
|
7378
7544
|
catch (error) {
|
|
7545
|
+
// The CLI refused or exited: release the query so nothing of it is left behind (upstream
|
|
7546
|
+
// closes it here too).
|
|
7547
|
+
try {
|
|
7548
|
+
q.close();
|
|
7549
|
+
}
|
|
7550
|
+
catch (closeError) {
|
|
7551
|
+
this.logger.error(`Failed to close a query that did not initialize: ${closeError}`);
|
|
7552
|
+
}
|
|
7379
7553
|
if (creationOpts.resume &&
|
|
7380
7554
|
error instanceof Error &&
|
|
7381
7555
|
(error.message === "Query closed before response received" ||
|
|
7382
7556
|
error.message.includes("No conversation found with session ID"))) {
|
|
7383
7557
|
throw RequestError.resourceNotFound(sessionId);
|
|
7384
7558
|
}
|
|
7385
|
-
|
|
7559
|
+
// Upstream #1508: the CLI's own reason (bad proxy URL, wrong org sign-in, …) as an ACP
|
|
7560
|
+
// error, instead of "Claude Code process exited with code 1".
|
|
7561
|
+
throw startupFailureError(error) ?? error;
|
|
7386
7562
|
}
|
|
7387
7563
|
if (shouldHideClaudeAuth() &&
|
|
7388
7564
|
initializationResult.account.subscriptionType &&
|
|
@@ -8019,6 +8195,21 @@ planUpdates) {
|
|
|
8019
8195
|
}),
|
|
8020
8196
|
},
|
|
8021
8197
|
];
|
|
8198
|
+
// Upstream #1463: ACP requires `currentValue` to be one of `options`
|
|
8199
|
+
// (agent-client-protocol#2557). A session can run a model the picker does not list --
|
|
8200
|
+
// resumed onto a model the `availableModels` allowlist excludes, or switched by a refusal
|
|
8201
|
+
// fallback -- so list it as its own entry. It is not added to `availableModels`, so the
|
|
8202
|
+
// next rebuild after switching to a listed model drops it.
|
|
8203
|
+
const modelOption = options[1];
|
|
8204
|
+
const modelRows = modelOption.options;
|
|
8205
|
+
if (!modelRows.some((row) => row.value === models.currentModelId)) {
|
|
8206
|
+
const info = modelInfos.find((model) => model.value === models.currentModelId);
|
|
8207
|
+
modelRows.push({
|
|
8208
|
+
value: models.currentModelId,
|
|
8209
|
+
name: info?.displayName || models.currentModelId,
|
|
8210
|
+
...(info?.description ? { description: info.description } : {}),
|
|
8211
|
+
});
|
|
8212
|
+
}
|
|
8022
8213
|
// Add effort level option based on the currently selected model
|
|
8023
8214
|
const currentModelInfo = modelInfos.find((m) => m.value === models.currentModelId);
|
|
8024
8215
|
const supportedLevels = currentModelInfo?.supportsEffort
|
|
@@ -8626,17 +8817,26 @@ resumedSessionId) {
|
|
|
8626
8817
|
// not the raw catalog upstream maps here: the filter is visibility-only,
|
|
8627
8818
|
// so preference resolution and capability lookups elsewhere keep reading
|
|
8628
8819
|
// the unfiltered catalog (R4.3).
|
|
8629
|
-
availableModels: pickerModels.map((model) => ({
|
|
8820
|
+
availableModels: withDistinctModelNames(pickerModels.map((model) => ({
|
|
8630
8821
|
modelId: model.value,
|
|
8631
8822
|
name: model.displayName,
|
|
8632
8823
|
description: model.description,
|
|
8633
|
-
})),
|
|
8824
|
+
}))),
|
|
8634
8825
|
currentModelId: currentModel.value,
|
|
8635
8826
|
},
|
|
8636
8827
|
resumedContextWindow,
|
|
8637
8828
|
resumedContextUsedTokens,
|
|
8638
8829
|
};
|
|
8639
8830
|
}
|
|
8831
|
+
/** Upstream #1286 (issue #1246): an allowlist can list an alias and pinned ids that inherit the
|
|
8832
|
+
* same SDK label, so a name-only picker shows identical rows. A name that occurs more than once
|
|
8833
|
+
* gets its model id appended; every row stays, and distinct names are unchanged. */
|
|
8834
|
+
export function withDistinctModelNames(models) {
|
|
8835
|
+
const counts = new Map();
|
|
8836
|
+
for (const model of models)
|
|
8837
|
+
counts.set(model.name, (counts.get(model.name) ?? 0) + 1);
|
|
8838
|
+
return models.map((model) => counts.get(model.name) === 1 ? model : { ...model, name: `${model.name} (${model.modelId})` });
|
|
8839
|
+
}
|
|
8640
8840
|
function getAvailableSlashCommands(commands,
|
|
8641
8841
|
// Names the CLI tagged terminal-bound on `system`/init (their UX lives in
|
|
8642
8842
|
// the CLI's own terminal, which ACP clients aren't) — filtered alongside
|
|
@@ -9144,6 +9344,26 @@ export function toAcpNotifications(content, role, sessionId, toolUseCache, clien
|
|
|
9144
9344
|
}
|
|
9145
9345
|
break;
|
|
9146
9346
|
}
|
|
9347
|
+
case "advisor_tool_result": {
|
|
9348
|
+
// Advisor results arrive in assistant content, including encrypted advice.
|
|
9349
|
+
// Resolve the server tool through the normal result path without rendering
|
|
9350
|
+
// opaque ciphertext. Server tools have no later PostToolUse hook to await.
|
|
9351
|
+
const result = chunk.content;
|
|
9352
|
+
unregisterHookCallback(chunk.tool_use_id);
|
|
9353
|
+
output.push(...toAcpNotifications([
|
|
9354
|
+
{
|
|
9355
|
+
type: "tool_result",
|
|
9356
|
+
tool_use_id: chunk.tool_use_id,
|
|
9357
|
+
is_error: result.type === "advisor_tool_result_error",
|
|
9358
|
+
content: result.type === "advisor_result"
|
|
9359
|
+
? result.text
|
|
9360
|
+
: result.type === "advisor_redacted_result"
|
|
9361
|
+
? "Advisor guidance applied server-side."
|
|
9362
|
+
: `Advisor error: ${result.error_code}`,
|
|
9363
|
+
},
|
|
9364
|
+
], role, sessionId, toolUseCache, client, logger, options));
|
|
9365
|
+
break;
|
|
9366
|
+
}
|
|
9147
9367
|
case "tool_result":
|
|
9148
9368
|
case "tool_search_tool_result":
|
|
9149
9369
|
case "web_fetch_tool_result":
|
|
@@ -9316,7 +9536,6 @@ export function toAcpNotifications(content, role, sessionId, toolUseCache, clien
|
|
|
9316
9536
|
case "container_upload":
|
|
9317
9537
|
case "compaction":
|
|
9318
9538
|
case "compaction_delta":
|
|
9319
|
-
case "advisor_tool_result":
|
|
9320
9539
|
case "fallback":
|
|
9321
9540
|
case "mcp_tool_listing":
|
|
9322
9541
|
break;
|
package/dist/child-sessions.d.ts
CHANGED
|
@@ -25,7 +25,8 @@ export type ChildLaunch = {
|
|
|
25
25
|
/** The SDK agent id — the child's session id. */
|
|
26
26
|
agentId: string;
|
|
27
27
|
title: string;
|
|
28
|
-
|
|
28
|
+
/** The child's role; absent when it is already the title (upstream #1479). */
|
|
29
|
+
description?: string;
|
|
29
30
|
prompt?: string;
|
|
30
31
|
/** True when the SDK can stop this subagent on its own (`Query.stopTask`). */
|
|
31
32
|
cancellable: boolean;
|
|
@@ -45,6 +46,9 @@ export declare class ChildSessionRouter {
|
|
|
45
46
|
* stamp (a progress beat, an edit diff) follows its call, even after its
|
|
46
47
|
* child settled. Keyed like `byToolUse`; bounded by `place`. */
|
|
47
48
|
private readonly toolCalls;
|
|
49
|
+
/** A child's working directory reported before its announcement, when it differs from its
|
|
50
|
+
* parent's. Taken by the announcement. */
|
|
51
|
+
private readonly pendingCwds;
|
|
48
52
|
constructor(send: Send, debug: (line: string) => void);
|
|
49
53
|
isChild(sessionId: string): boolean;
|
|
50
54
|
/** The parent session a child belongs to. */
|
|
@@ -73,6 +77,15 @@ export declare class ChildSessionRouter {
|
|
|
73
77
|
restore(launch: ChildLaunch, options: {
|
|
74
78
|
announce: boolean;
|
|
75
79
|
}): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Upstream #1496: the child's working directory, from the `cwd` of its own hook. A child that
|
|
82
|
+
* Claude Code runs elsewhere (Agent `isolation: "worktree"`) reports its worktree. The client
|
|
83
|
+
* gets it only when it differs from the parent's -- in the announcement, or in a
|
|
84
|
+
* `subagent_update` right after it -- and `null` when the child is back in the parent's.
|
|
85
|
+
* SubagentStart runs before the child's first model request, so the `cwd` reaches the client
|
|
86
|
+
* before the child's first tool call.
|
|
87
|
+
*/
|
|
88
|
+
reportCwd(childId: string, cwd: string, parentCwd: string): Promise<void>;
|
|
76
89
|
private announce;
|
|
77
90
|
private sendPrompt;
|
|
78
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-sessions.d.ts","sourceRoot":"","sources":["../src/child-sessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"child-sessions.d.ts","sourceRoot":"","sources":["../src/child-sessions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AAEH,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;AA0BjE,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,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;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AM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAmBjE,QAAQ;YAwBR,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"}
|
package/dist/child-sessions.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
/** Hooks can report a child's `cwd` before it is announced; bound what waits for one. */
|
|
3
|
+
const MAX_PENDING_CWDS = 64;
|
|
1
4
|
/** A subagent's SDK task status mapped onto the RFD's idle stop reason. */
|
|
2
5
|
export function childStopReasonOf(status) {
|
|
3
6
|
switch (status) {
|
|
@@ -28,6 +31,9 @@ export class ChildSessionRouter {
|
|
|
28
31
|
* stamp (a progress beat, an edit diff) follows its call, even after its
|
|
29
32
|
* child settled. Keyed like `byToolUse`; bounded by `place`. */
|
|
30
33
|
toolCalls = new Map();
|
|
34
|
+
/** A child's working directory reported before its announcement, when it differs from its
|
|
35
|
+
* parent's. Taken by the announcement. */
|
|
36
|
+
pendingCwds = new Map();
|
|
31
37
|
constructor(send, debug) {
|
|
32
38
|
this.send = send;
|
|
33
39
|
this.debug = debug;
|
|
@@ -159,14 +165,48 @@ export class ChildSessionRouter {
|
|
|
159
165
|
await this.announce(record, launch);
|
|
160
166
|
await this.sendPrompt(record, launch);
|
|
161
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Upstream #1496: the child's working directory, from the `cwd` of its own hook. A child that
|
|
170
|
+
* Claude Code runs elsewhere (Agent `isolation: "worktree"`) reports its worktree. The client
|
|
171
|
+
* gets it only when it differs from the parent's -- in the announcement, or in a
|
|
172
|
+
* `subagent_update` right after it -- and `null` when the child is back in the parent's.
|
|
173
|
+
* SubagentStart runs before the child's first model request, so the `cwd` reaches the client
|
|
174
|
+
* before the child's first tool call.
|
|
175
|
+
*/
|
|
176
|
+
async reportCwd(childId, cwd, parentCwd) {
|
|
177
|
+
if (!path.isAbsolute(cwd))
|
|
178
|
+
return;
|
|
179
|
+
const value = path.resolve(cwd) === path.resolve(parentCwd) ? undefined : cwd;
|
|
180
|
+
const record = this.byChild.get(childId);
|
|
181
|
+
if (!record || record.unannounced) {
|
|
182
|
+
if (value === undefined)
|
|
183
|
+
this.pendingCwds.delete(childId);
|
|
184
|
+
else if (this.pendingCwds.has(childId) || this.pendingCwds.size < MAX_PENDING_CWDS) {
|
|
185
|
+
this.pendingCwds.set(childId, value);
|
|
186
|
+
}
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (record.reportedCwd === value)
|
|
190
|
+
return;
|
|
191
|
+
record.reportedCwd = value;
|
|
192
|
+
await this.send({
|
|
193
|
+
sessionId: record.announcedOn,
|
|
194
|
+
update: { sessionUpdate: "subagent_update", sessionId: record.childId, cwd: value ?? null },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
162
197
|
async announce(record, launch, state) {
|
|
198
|
+
const cwd = this.pendingCwds.get(record.childId);
|
|
199
|
+
this.pendingCwds.delete(record.childId);
|
|
200
|
+
if (cwd !== undefined)
|
|
201
|
+
record.reportedCwd = cwd;
|
|
163
202
|
await this.send({
|
|
164
203
|
sessionId: record.announcedOn,
|
|
165
204
|
update: {
|
|
166
205
|
sessionUpdate: "subagent_update",
|
|
167
206
|
sessionId: record.childId,
|
|
168
207
|
title: launch.title,
|
|
169
|
-
description: launch.description,
|
|
208
|
+
...(launch.description ? { description: launch.description } : {}),
|
|
209
|
+
...(record.reportedCwd ? { cwd: record.reportedCwd } : {}),
|
|
170
210
|
// `SubagentSessionCapabilities.cancel` is an object when supported;
|
|
171
211
|
// absent, Zed disables Stop for the child (design.md, Security).
|
|
172
212
|
...(launch.cancellable ? { capabilities: { cancel: {} } } : {}),
|
|
@@ -33,6 +33,7 @@ export type ClearContextSession<Turn extends ClearContextTurn = ClearContextTurn
|
|
|
33
33
|
turnQueue?: Turn[];
|
|
34
34
|
pendingExitPlanContextReset?: ClearContextReset;
|
|
35
35
|
contextUsedTokens?: number;
|
|
36
|
+
contextWindowSize: number;
|
|
36
37
|
input: {
|
|
37
38
|
push(message: SDKUserMessage): unknown;
|
|
38
39
|
};
|
|
@@ -45,7 +46,9 @@ export type ClearContextCoordinatorHost<Session extends ClearContextSession<Turn
|
|
|
45
46
|
permissionMode: PermissionMode;
|
|
46
47
|
}): Promise<Session>;
|
|
47
48
|
applyFastMode(session: Session, enabled: boolean): Promise<void>;
|
|
48
|
-
|
|
49
|
+
/** Publishes the fresh context's mode, config options, and usage: the
|
|
50
|
+
* context starts empty in a window of `contextWindowSize` tokens (upstream #1484). */
|
|
51
|
+
publishSessionState(sessionId: string, mode: PermissionMode, configOptions: SessionConfigOption[], contextWindowSize: number): Promise<void>;
|
|
49
52
|
continuationMessage(sessionId: string, plan: string, promptUuid: string): SDKUserMessage;
|
|
50
53
|
ensureConsumer(session: Session, sessionId: string): void;
|
|
51
54
|
logError(message: string, error: unknown): void;
|
|
@@ -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,mCAAmC,CAAC;AAChG,OAAO,KAAK,EAGV,cAAc,EACd,cAAc,EACf,MAAM,gCAAgC,CAAC;AAGxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE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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,CAsDf"}
|
|
@@ -67,7 +67,7 @@ export async function continuePlanInFreshContext(sessionId, oldSession, reset, h
|
|
|
67
67
|
freshSession.turnQueue = [turn];
|
|
68
68
|
freshSession.contextUsedTokens = 0;
|
|
69
69
|
try {
|
|
70
|
-
await host.publishSessionState(sessionId, reset.mode, freshSession.configOptions);
|
|
70
|
+
await host.publishSessionState(sessionId, reset.mode, freshSession.configOptions, freshSession.contextWindowSize);
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
73
73
|
host.logError("Failed to publish clear-context session state:", error);
|
package/dist/exit-plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-plan.d.ts","sourceRoot":"","sources":["../src/exit-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAEtB,MAAM,gCAAgC,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,mBAAmB,EACjC,SAAS,EAAE,MAAM,GA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AmB,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;CAwE/F"}
|
package/dist/exit-plan.js
CHANGED
|
@@ -106,7 +106,7 @@ export class ExitPlanCoordinator {
|
|
|
106
106
|
try {
|
|
107
107
|
const clearContextHost = {
|
|
108
108
|
...this.host,
|
|
109
|
-
publishSessionState: async (id, mode, configOptions) => {
|
|
109
|
+
publishSessionState: async (id, mode, configOptions, contextWindowSize) => {
|
|
110
110
|
await this.host.sessionUpdate({
|
|
111
111
|
sessionId: id,
|
|
112
112
|
update: { sessionUpdate: "current_mode_update", currentModeId: mode },
|
|
@@ -115,6 +115,13 @@ export class ExitPlanCoordinator {
|
|
|
115
115
|
sessionId: id,
|
|
116
116
|
update: { sessionUpdate: "config_option_update", configOptions },
|
|
117
117
|
});
|
|
118
|
+
// Upstream #1484: otherwise the client shows the old context's usage until the
|
|
119
|
+
// fresh context first reports its own. `used: 0` understates it slightly (the
|
|
120
|
+
// system prompt and the plan) until Claude's next usage report.
|
|
121
|
+
await this.host.sessionUpdate({
|
|
122
|
+
sessionId: id,
|
|
123
|
+
update: { sessionUpdate: "usage_update", used: 0, size: contextWindowSize },
|
|
124
|
+
});
|
|
118
125
|
},
|
|
119
126
|
continuationMessage: (id, plan, promptUuid) => ({
|
|
120
127
|
type: "user",
|
|
@@ -24,6 +24,16 @@ export declare function noticeTranscriptText(notice: SessionNotice): string;
|
|
|
24
24
|
* bold-label rendering of the notice) and `transcriptMeta`, so clients
|
|
25
25
|
* without the capability can still tell the line apart from Claude's reply. */
|
|
26
26
|
export declare function noticeOrTranscriptUpdate(notice: SessionNotice, supportsNotices: boolean, transcriptText?: string, transcriptMeta?: Record<string, unknown>): SessionNotification["update"];
|
|
27
|
+
/** Clients render consecutive agent_message_chunks as one markdown stream, so
|
|
28
|
+
* a bare `**Notice:** …` chunk lands mid-sentence: "…all done.**Notice:** Stop
|
|
29
|
+
* says: …". Put it in its own blockquote paragraph, blank lines on both sides,
|
|
30
|
+
* so it starts on a new line and Claude's next chunk does not continue the
|
|
31
|
+
* quote. */
|
|
32
|
+
export declare function transcriptBlock(text: string): string;
|
|
33
|
+
/** Claude Code prefixes every line of a hook's `systemMessage` with
|
|
34
|
+
* "<HookEvent> says: ", so a two-line message reads "Stop says: a\nStop says:
|
|
35
|
+
* b". Keep the prefix on the first line only when every line repeats it. */
|
|
36
|
+
export declare function collapseHookSpeaker(text: string): string;
|
|
27
37
|
/** Fragments that read on after a bold label stand alone as a notice
|
|
28
38
|
* description, so start them with a capital. */
|
|
29
39
|
export declare function sentenceCase(text: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-notices.d.ts","sourceRoot":"","sources":["../src/session-notices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAEjG;;8DAE8D;AAC9D,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACvC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;kEACkE;AAClE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;oEAEoE;AACpE,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAGvF;AAED,wBAAgB,YAAY,CAAC,MA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GAAG,OAAO,CAGvF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAOjF;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAElE;AAED;;;gFAGgF;AAChF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,EACrB,eAAe,EAAE,OAAO,EACxB,cAAc,GAAE,MAAqC,EACrD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,mBAAmB,CAAC,QAAQ,CAAC,CAO/B;AAED;;;;aAIa;AACb,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAID;;6EAE6E;AAC7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED;iDACiD;AACjD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;4EAC4E;AAC5E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;4DAE4D;AAC5D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;0DAE0D;AAC1D,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,aAAa,CAAC,CAU9C"}
|
package/dist/session-notices.js
CHANGED
|
@@ -29,10 +29,31 @@ export function noticeOrTranscriptUpdate(notice, supportsNotices, transcriptText
|
|
|
29
29
|
return noticeUpdate(notice);
|
|
30
30
|
return {
|
|
31
31
|
sessionUpdate: "agent_message_chunk",
|
|
32
|
-
content: { type: "text", text: transcriptText },
|
|
32
|
+
content: { type: "text", text: transcriptBlock(transcriptText) },
|
|
33
33
|
...(transcriptMeta ? { _meta: transcriptMeta } : {}),
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
+
/** Clients render consecutive agent_message_chunks as one markdown stream, so
|
|
37
|
+
* a bare `**Notice:** …` chunk lands mid-sentence: "…all done.**Notice:** Stop
|
|
38
|
+
* says: …". Put it in its own blockquote paragraph, blank lines on both sides,
|
|
39
|
+
* so it starts on a new line and Claude's next chunk does not continue the
|
|
40
|
+
* quote. */
|
|
41
|
+
export function transcriptBlock(text) {
|
|
42
|
+
const lines = text.trim().split(/\r?\n/);
|
|
43
|
+
return `\n\n${lines.map((line) => (line ? `> ${line}` : ">")).join("\n")}\n\n`;
|
|
44
|
+
}
|
|
45
|
+
const HOOK_SPEAKER = /^[^\n:]{1,80} says: /;
|
|
46
|
+
/** Claude Code prefixes every line of a hook's `systemMessage` with
|
|
47
|
+
* "<HookEvent> says: ", so a two-line message reads "Stop says: a\nStop says:
|
|
48
|
+
* b". Keep the prefix on the first line only when every line repeats it. */
|
|
49
|
+
export function collapseHookSpeaker(text) {
|
|
50
|
+
const lines = text.split(/\r?\n/);
|
|
51
|
+
const prefix = lines[0].match(HOOK_SPEAKER)?.[0];
|
|
52
|
+
if (!prefix || lines.length < 2 || !lines.every((line) => line.startsWith(prefix))) {
|
|
53
|
+
return text;
|
|
54
|
+
}
|
|
55
|
+
return [lines[0], ...lines.slice(1).map((line) => line.slice(prefix.length))].join("\n");
|
|
56
|
+
}
|
|
36
57
|
/** Fragments that read on after a bold label stand alone as a notice
|
|
37
58
|
* description, so start them with a capital. */
|
|
38
59
|
export function sentenceCase(text) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
|
2
|
+
/** Makes the CLI write an `error_during_execution` result with a
|
|
3
|
+
* `startup_failure_reason` before it exits on a known startup failure. Without
|
|
4
|
+
* it, some failures (e.g. `proxy_invalid`) end with stderr and an exit code
|
|
5
|
+
* alone. The SDK then rejects `initializationResult()` with an error that
|
|
6
|
+
* carries the reason as `startupFailureReason`. */
|
|
7
|
+
export declare const STARTUP_FAILURE_RESULTS_ENV: {
|
|
8
|
+
CLAUDE_CODE_STARTUP_FAILURE_RESULTS: string;
|
|
9
|
+
};
|
|
10
|
+
/** The ACP error for a CLI that refused to start, or `undefined` when `error`
|
|
11
|
+
* carries no `startupFailureReason` (older CLIs, failures without a known
|
|
12
|
+
* cause). The message is the CLI's own, which says what to fix, e.g.
|
|
13
|
+
* `Invalid proxy URL in HTTPS_PROXY: … Fix or unset HTTPS_PROXY and restart
|
|
14
|
+
* Claude Code.`; `data.startupFailureReason` carries the reason. */
|
|
15
|
+
export declare function startupFailureError(error: unknown): RequestError | undefined;
|
|
16
|
+
//# sourceMappingURL=startup-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startup-failure.d.ts","sourceRoot":"","sources":["../src/startup-failure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjE;;;;oDAIoD;AACpD,eAAO,MAAM,2BAA2B;;CAA+C,CAAC;AAYxF;;;;qEAIqE;AACrE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAgB5E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
|
2
|
+
/** Makes the CLI write an `error_during_execution` result with a
|
|
3
|
+
* `startup_failure_reason` before it exits on a known startup failure. Without
|
|
4
|
+
* it, some failures (e.g. `proxy_invalid`) end with stderr and an exit code
|
|
5
|
+
* alone. The SDK then rejects `initializationResult()` with an error that
|
|
6
|
+
* carries the reason as `startupFailureReason`. */
|
|
7
|
+
export const STARTUP_FAILURE_RESULTS_ENV = { CLAUDE_CODE_STARTUP_FAILURE_RESULTS: "1" };
|
|
8
|
+
/** The SDK's prefix on the message of an error built from an error result. */
|
|
9
|
+
const ERROR_RESULT_PREFIX = "Claude Code returned an error result: ";
|
|
10
|
+
/** Reasons that signing in again, or with another account, can fix. */
|
|
11
|
+
const AUTH_REQUIRED_REASONS = new Set([
|
|
12
|
+
"gateway_signin_required",
|
|
13
|
+
"org_pin_mismatch",
|
|
14
|
+
"org_config_refused",
|
|
15
|
+
]);
|
|
16
|
+
/** The ACP error for a CLI that refused to start, or `undefined` when `error`
|
|
17
|
+
* carries no `startupFailureReason` (older CLIs, failures without a known
|
|
18
|
+
* cause). The message is the CLI's own, which says what to fix, e.g.
|
|
19
|
+
* `Invalid proxy URL in HTTPS_PROXY: … Fix or unset HTTPS_PROXY and restart
|
|
20
|
+
* Claude Code.`; `data.startupFailureReason` carries the reason. */
|
|
21
|
+
export function startupFailureError(error) {
|
|
22
|
+
if (!(error instanceof Error))
|
|
23
|
+
return undefined;
|
|
24
|
+
const reason = error.startupFailureReason;
|
|
25
|
+
if (typeof reason !== "string" || reason === "")
|
|
26
|
+
return undefined;
|
|
27
|
+
const message = error.message.startsWith(ERROR_RESULT_PREFIX)
|
|
28
|
+
? error.message.slice(ERROR_RESULT_PREFIX.length)
|
|
29
|
+
: error.message;
|
|
30
|
+
const data = { startupFailureReason: reason };
|
|
31
|
+
if (AUTH_REQUIRED_REASONS.has(reason)) {
|
|
32
|
+
return RequestError.authRequired(data, message);
|
|
33
|
+
}
|
|
34
|
+
if (reason === "cwd_unavailable") {
|
|
35
|
+
return RequestError.invalidParams(data, message);
|
|
36
|
+
}
|
|
37
|
+
return RequestError.internalError(data, message);
|
|
38
|
+
}
|
package/dist/tools.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare function toolUpdateFromDiffToolResponse(toolResponse: unknown): {
|
|
|
95
95
|
export declare const registerHookCallback: (toolUseID: string, { onPostToolUseHook, }: {
|
|
96
96
|
onPostToolUseHook?: (toolUseID: string, toolInput: unknown, toolResponse: unknown) => Promise<void>;
|
|
97
97
|
}) => void;
|
|
98
|
+
export declare function unregisterHookCallback(toolUseID: string): void;
|
|
98
99
|
export declare const createPostToolUseHook: (options?: {
|
|
99
100
|
onEnterPlanMode?: () => Promise<void>;
|
|
100
101
|
}) => HookCallback;
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACT,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAaL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAKjB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,oBAAoB,EAEpB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,yCAAyC,EAGzC,qCAAqC,EAGrC,kCAAkC,EAGlC,+CAA+C,EAI/C,wBAAwB,EACxB,kCAAkC,EAIlC,gCAAgC,EAEhC,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AA2B9C,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,eAAe,CAAC,EAAE;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,oEAAoE;YACpE,SAAS,EAAE,MAAM,GAAG,IA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AAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAMpE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAeD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,OAAO,GAAG;IACrE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CA4CA;AAcD,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,wBAEG;IACD,iBAAiB,CAAC,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,SAKF,CAAC;AAIF,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE9D;AAGD,eAAO,MAAM,qBAAqB,GAC/B,UAAU;IAAE,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAiBtD,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACxB,SAAS;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,KAAG,YAsBpE,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -373,6 +373,10 @@ export function toolInfoFromToolUse(toolUse, supportsTerminalOutput = false, cwd
|
|
|
373
373
|
content: [],
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
+
// EnterPlanMode switches the session to plan mode, so it has the `switch_mode` kind like
|
|
377
|
+
// ExitPlanMode (upstream #1467, agentclientprotocol/agent-client-protocol#2543).
|
|
378
|
+
case "EnterPlanMode":
|
|
379
|
+
return { title: "EnterPlanMode", kind: "switch_mode", content: [] };
|
|
376
380
|
case "ExitPlanMode": {
|
|
377
381
|
const planInput = toolUse.input;
|
|
378
382
|
return {
|
|
@@ -1235,6 +1239,11 @@ export const registerHookCallback = (toolUseID, { onPostToolUseHook, }) => {
|
|
|
1235
1239
|
onPostToolUseHook,
|
|
1236
1240
|
};
|
|
1237
1241
|
};
|
|
1242
|
+
/* Drops a tool's callbacks when no PostToolUse hook will come for it: a server tool, such as
|
|
1243
|
+
the advisor, settles from its result in assistant content (upstream #1247). */
|
|
1244
|
+
export function unregisterHookCallback(toolUseID) {
|
|
1245
|
+
delete toolUseCallbacks[toolUseID];
|
|
1246
|
+
}
|
|
1238
1247
|
/* A callback for Claude Code that is called when receiving a PostToolUse hook */
|
|
1239
1248
|
export const createPostToolUseHook = (options) => async (input, toolUseID) => {
|
|
1240
1249
|
if (input.hook_event_name === "PostToolUse") {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.35.0",
|
|
7
7
|
"description": "Claude Code in Zed and other ACP clients with the VS Code extension's UX — multi-select questions, refusal consent, live quota windows, background tasks, Ultracode effort and session notices. Fork of claude-agent-acp.",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@agentclientprotocol/sdk": "2.4.0",
|
|
73
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
73
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.319",
|
|
74
74
|
"zod": "^4.0.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@anthropic-ai/sdk": "1.
|
|
77
|
+
"@anthropic-ai/sdk": "1.6.0",
|
|
78
78
|
"@eslint/js": "10.0.1",
|
|
79
79
|
"@tsconfig/node24": "24.0.5",
|
|
80
80
|
"@types/node": "26.6.6",
|