@agentclientprotocol/claude-agent-acp 0.64.2 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/acp-agent.d.ts +43 -0
- package/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +206 -3
- package/dist/goal-extension.d.ts +36 -0
- package/dist/goal-extension.d.ts.map +1 -0
- package/dist/goal-extension.js +50 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
|
|
|
16
16
|
- Interactive (and background) terminals
|
|
17
17
|
- Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)
|
|
18
18
|
- Client MCP servers
|
|
19
|
+
- Session-scoped long-running goals through the provider-neutral [goal extension](docs/goal-extension.md)
|
|
19
20
|
|
|
20
21
|
Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/).
|
|
21
22
|
|
package/dist/acp-agent.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AuthenticateRequest, CancelNotification, ClientCapabilities, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, DisableProviderRequest, DisableProviderResponse, ForkSessionRequest, ForkSessionResponse, InitializeRequest, InitializeResponse, ListProvidersRequest, ListProvidersResponse, LlmProtocol, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, LogoutRequest, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ReadTextFileRequest, ReadTextFileResponse, SetProviderRequest, SetProviderResponse, RequestPermissionRequest, RequestPermissionResponse, ResumeSessionRequest, ResumeSessionResponse, SessionConfigOption, SessionModeState, SessionNotification, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, CloseSessionResponse, DeleteSessionRequest, DeleteSessionResponse, WriteTextFileRequest, WriteTextFileResponse } from "@agentclientprotocol/sdk";
|
|
2
2
|
import { AgentInfo, CanUseTool, FastModeDisabledReason, FastModeState, ModelInfo, Options, PermissionMode, Query, SDKMessageOrigin, SDKPartialAssistantMessage, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
3
|
+
import { GoalRequest, GoalControlResponse, GoalSnapshot } from "./goal-extension.js";
|
|
3
4
|
import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
|
|
4
5
|
import { BetaContentBlock, BetaRawContentBlockDelta } from "@anthropic-ai/sdk/resources/beta.mjs";
|
|
5
6
|
import { SettingsManager } from "./settings.js";
|
|
@@ -146,6 +147,26 @@ type Turn = {
|
|
|
146
147
|
* pre-hold behavior (pending wakes are not countable: notifications can
|
|
147
148
|
* batch into one followup). */
|
|
148
149
|
deferredSettle?: PromptResponse;
|
|
150
|
+
/** Uuids of `steer()`-injected messages the SDK has not replayed back yet.
|
|
151
|
+
*
|
|
152
|
+
* A steer is delivered at {@link STEER_PRIORITY} (`now`), so the CLI ABORTS
|
|
153
|
+
* the running cycle: it emits its own human-origin `result` —
|
|
154
|
+
* indistinguishable from a turn's terminal one — and the steered message runs
|
|
155
|
+
* as a SECOND cycle. Settling at that result would answer `session/prompt`
|
|
156
|
+
* mid-work, so a steered turn's results only RECORD their outcome
|
|
157
|
+
* (`steeredSettle`) and it settles at the SDK's `idle`, the only signal
|
|
158
|
+
* spanning both cycles (CLI 2.1.220).
|
|
159
|
+
*
|
|
160
|
+
* A non-empty set at an idle means the steered cycle hasn't started — the CLI
|
|
161
|
+
* replays a message only when it picks it up, always after the interrupted
|
|
162
|
+
* cycle's result — so that idle is swallowed. Drained by the replay handler.
|
|
163
|
+
*
|
|
164
|
+
* Residual: a message the CLI drops unreplayed parks the turn until
|
|
165
|
+
* `session/cancel` or the next prompt (both settle it). */
|
|
166
|
+
steeredEchoes?: Set<string>;
|
|
167
|
+
/** What a steered turn settles with once its steered work has run: the outcome
|
|
168
|
+
* of its latest result, so its usage covers every cycle the turn ran. */
|
|
169
|
+
steeredSettle?: PromptResponse;
|
|
149
170
|
resolve: (response: PromptResponse) => void;
|
|
150
171
|
reject: (error: unknown) => void;
|
|
151
172
|
};
|
|
@@ -159,6 +180,20 @@ type Session = {
|
|
|
159
180
|
/** The turn whose messages the consumer is currently attributing output to
|
|
160
181
|
* (the head of `turnQueue` once its user message has been echoed). */
|
|
161
182
|
activeTurn?: Turn | null;
|
|
183
|
+
/** Optimistic goal state published for a submitted `/goal` command whose
|
|
184
|
+
* matching runtime update has not arrived yet. Runtime updates for the old
|
|
185
|
+
* goal are suppressed until this command is echoed or completes, otherwise
|
|
186
|
+
* a late old-goal update can overwrite a replacement that the runtime never
|
|
187
|
+
* announces (the compatibility case the optimistic update exists for). */
|
|
188
|
+
pendingGoalUpdate?: {
|
|
189
|
+
commandUuid: string;
|
|
190
|
+
expected: GoalSnapshot | null;
|
|
191
|
+
previous: GoalSnapshot | null | undefined;
|
|
192
|
+
started: boolean;
|
|
193
|
+
};
|
|
194
|
+
/** Last goal snapshot sent to the ACP client, used to roll back an
|
|
195
|
+
* optimistic `/goal` update when the command itself fails. */
|
|
196
|
+
lastPublishedGoal?: GoalSnapshot | null;
|
|
162
197
|
/** Count of result messages the consumer should treat as orphans and skip
|
|
163
198
|
* (not promote/attribute to the current head). When cancel() settles+removes
|
|
164
199
|
* a queued turn, that turn's user message was already pushed to the SDK, so
|
|
@@ -669,6 +704,10 @@ export declare class ClaudeAcpAgent {
|
|
|
669
704
|
resolveProviderConfig(): ProviderConfig | null;
|
|
670
705
|
logout(_params: LogoutRequest): Promise<void>;
|
|
671
706
|
prompt(params: PromptRequest): Promise<PromptResponse>;
|
|
707
|
+
goal(params: GoalRequest): Promise<GoalControlResponse>;
|
|
708
|
+
private publishGoal;
|
|
709
|
+
private publishGoalFromPrompt;
|
|
710
|
+
private publishRuntimeGoal;
|
|
672
711
|
/** Steer the session per the ACP steering wire protocol: inject a follow-up
|
|
673
712
|
* message into the turn that is currently running. If that turn already
|
|
674
713
|
* settled, the established default starts a new detached turn; Hosts may opt
|
|
@@ -685,6 +724,10 @@ export declare class ClaudeAcpAgent {
|
|
|
685
724
|
* calls). The steered message's own output streams via `session/update`, not
|
|
686
725
|
* this response.
|
|
687
726
|
*
|
|
727
|
+
* Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
|
|
728
|
+
* own and the steered message runs as a second one, so the turn is marked
|
|
729
|
+
* (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
|
|
730
|
+
*
|
|
688
731
|
* When the session is idle, the opt-in path returns `promptRequired` WITHOUT
|
|
689
732
|
* calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
|
|
690
733
|
* stays Host-owned so the Host can submit it through a standard
|
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,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EAGb,iBAAiB,EACjB,kBAAkB,EAElB,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,oBAAoB,EAEpB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB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AM;;;EAgDrB"}
|
package/dist/acp-agent.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { agent as acpAgent, methods, ndJsonStream, RequestError, } from "@agentclientprotocol/sdk";
|
|
2
2
|
import { deleteSession, getSessionInfo, getSessionMessages, listSessions, query, } from "@anthropic-ai/claude-agent-sdk";
|
|
3
|
+
import { GOAL_ACTIONS, GOAL_CONTROL_METHOD, GOAL_EXTENSION_VERSION, goalUpdateFromPrompt, parseGoalRequest, toGoalSnapshot, } from "./goal-extension.js";
|
|
3
4
|
import { execFile } from "node:child_process";
|
|
4
5
|
import { randomUUID } from "node:crypto";
|
|
5
6
|
import * as fs from "node:fs/promises";
|
|
@@ -118,6 +119,11 @@ const AUTONOMOUS_RESULT_ORIGINS = new Set([
|
|
|
118
119
|
function isHeldOpen(turn) {
|
|
119
120
|
return turn != null && turn.deferredSettle !== undefined && !turn.settled;
|
|
120
121
|
}
|
|
122
|
+
/** Whether a steer moved this turn's settlement off the next result and onto the
|
|
123
|
+
* SDK's `idle` (see Turn.steeredEchoes). Shared by the consumer's settle lanes. */
|
|
124
|
+
function isSteering(turn) {
|
|
125
|
+
return turn != null && turn.steeredEchoes !== undefined && !turn.settled;
|
|
126
|
+
}
|
|
121
127
|
/** Disarm the force-cancel backstop (see Session.forceCancelTimer). Every
|
|
122
128
|
* path that settles the active turn must run this so a timer can never fire
|
|
123
129
|
* on an already-settled turn — and must leave the field undefined, or the
|
|
@@ -731,6 +737,11 @@ export class ClaudeAcpAgent {
|
|
|
731
737
|
steering: {
|
|
732
738
|
supported: true,
|
|
733
739
|
},
|
|
740
|
+
goal: {
|
|
741
|
+
version: GOAL_EXTENSION_VERSION,
|
|
742
|
+
controlMethod: GOAL_CONTROL_METHOD,
|
|
743
|
+
actions: [...GOAL_ACTIONS],
|
|
744
|
+
},
|
|
734
745
|
},
|
|
735
746
|
};
|
|
736
747
|
}
|
|
@@ -981,8 +992,64 @@ export class ClaudeAcpAgent {
|
|
|
981
992
|
session.turnQueue.push(turn);
|
|
982
993
|
session.input.push(userMessage);
|
|
983
994
|
this.ensureConsumer(session, params.sessionId);
|
|
995
|
+
await this.publishGoalFromPrompt(params.sessionId, firstText, promptUuid);
|
|
984
996
|
return response;
|
|
985
997
|
}
|
|
998
|
+
async goal(params) {
|
|
999
|
+
const command = params.action === "set" ? `/goal ${params.objective}` : "/goal clear";
|
|
1000
|
+
const prompt = [{ type: "text", text: command }];
|
|
1001
|
+
const steering = await this.steer({
|
|
1002
|
+
sessionId: params.sessionId,
|
|
1003
|
+
prompt,
|
|
1004
|
+
_meta: { steering: { idleBehavior: "promptRequired" } },
|
|
1005
|
+
});
|
|
1006
|
+
if (steering.outcome === "promptRequired") {
|
|
1007
|
+
await this.prompt({ sessionId: params.sessionId, prompt });
|
|
1008
|
+
}
|
|
1009
|
+
return {};
|
|
1010
|
+
}
|
|
1011
|
+
async publishGoal(sessionId, goal) {
|
|
1012
|
+
const session = this.sessions[sessionId];
|
|
1013
|
+
if (session) {
|
|
1014
|
+
session.lastPublishedGoal = goal;
|
|
1015
|
+
}
|
|
1016
|
+
await this.client.sessionUpdate({
|
|
1017
|
+
sessionId,
|
|
1018
|
+
update: {
|
|
1019
|
+
sessionUpdate: "session_info_update",
|
|
1020
|
+
_meta: { goal },
|
|
1021
|
+
},
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
async publishGoalFromPrompt(sessionId, prompt, commandUuid) {
|
|
1025
|
+
const goalUpdate = goalUpdateFromPrompt(prompt);
|
|
1026
|
+
if (goalUpdate !== undefined) {
|
|
1027
|
+
const session = this.sessions[sessionId];
|
|
1028
|
+
if (session) {
|
|
1029
|
+
session.pendingGoalUpdate = {
|
|
1030
|
+
commandUuid,
|
|
1031
|
+
expected: goalUpdate,
|
|
1032
|
+
previous: session.lastPublishedGoal,
|
|
1033
|
+
started: false,
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
await this.publishGoal(sessionId, goalUpdate);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
async publishRuntimeGoal(sessionId, goal) {
|
|
1040
|
+
const session = this.sessions[sessionId];
|
|
1041
|
+
const pending = session?.pendingGoalUpdate;
|
|
1042
|
+
if (pending) {
|
|
1043
|
+
const matchesPending = pending.expected === null
|
|
1044
|
+
? goal === null
|
|
1045
|
+
: goal !== null && goal.objective === pending.expected.objective;
|
|
1046
|
+
if (!matchesPending) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
session.pendingGoalUpdate = undefined;
|
|
1050
|
+
}
|
|
1051
|
+
await this.publishGoal(sessionId, goal);
|
|
1052
|
+
}
|
|
986
1053
|
/** Steer the session per the ACP steering wire protocol: inject a follow-up
|
|
987
1054
|
* message into the turn that is currently running. If that turn already
|
|
988
1055
|
* settled, the established default starts a new detached turn; Hosts may opt
|
|
@@ -999,6 +1066,10 @@ export class ClaudeAcpAgent {
|
|
|
999
1066
|
* calls). The steered message's own output streams via `session/update`, not
|
|
1000
1067
|
* this response.
|
|
1001
1068
|
*
|
|
1069
|
+
* Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
|
|
1070
|
+
* own and the steered message runs as a second one, so the turn is marked
|
|
1071
|
+
* (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
|
|
1072
|
+
*
|
|
1002
1073
|
* When the session is idle, the opt-in path returns `promptRequired` WITHOUT
|
|
1003
1074
|
* calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
|
|
1004
1075
|
* stays Host-owned so the Host can submit it through a standard
|
|
@@ -1018,7 +1089,7 @@ export class ClaudeAcpAgent {
|
|
|
1018
1089
|
// which is exactly the window in which steering is meaningful. This check
|
|
1019
1090
|
// and the active-path push below stay in one synchronous section so the
|
|
1020
1091
|
// turn cannot settle in the gap between deciding to inject and enqueueing.
|
|
1021
|
-
const turnInFlight = (session.turnQueue ?? []).
|
|
1092
|
+
const turnInFlight = (session.turnQueue ?? []).find((turn) => !turn.settled);
|
|
1022
1093
|
if (!turnInFlight) {
|
|
1023
1094
|
const promptRequest = {
|
|
1024
1095
|
sessionId,
|
|
@@ -1041,11 +1112,26 @@ export class ClaudeAcpAgent {
|
|
|
1041
1112
|
prompt: params.prompt,
|
|
1042
1113
|
};
|
|
1043
1114
|
const userMessage = promptToClaude(promptRequest);
|
|
1044
|
-
|
|
1115
|
+
const steeredUuid = randomUUID();
|
|
1116
|
+
userMessage.uuid = steeredUuid;
|
|
1045
1117
|
// Deliver into the running turn rather than queuing behind it as a fresh
|
|
1046
1118
|
// prompt would.
|
|
1047
1119
|
userMessage.priority = STEER_PRIORITY;
|
|
1120
|
+
// Mark before the push and in the same synchronous section as the in-flight
|
|
1121
|
+
// check: the interrupt can have the CLI finalizing the aborted cycle by the
|
|
1122
|
+
// time the consumer next runs, and an unmarked result would settle the turn
|
|
1123
|
+
// (see Turn.steeredEchoes).
|
|
1124
|
+
(turnInFlight.steeredEchoes ??= new Set()).add(steeredUuid);
|
|
1125
|
+
// A turn already held for background subagents has a recorded outcome the
|
|
1126
|
+
// steer supersedes: move it into the steer lane so one lane owns settlement.
|
|
1127
|
+
// The idle handler re-applies the hold through the subagent gate.
|
|
1128
|
+
if (turnInFlight.deferredSettle !== undefined) {
|
|
1129
|
+
turnInFlight.steeredSettle = turnInFlight.deferredSettle;
|
|
1130
|
+
turnInFlight.deferredSettle = undefined;
|
|
1131
|
+
}
|
|
1048
1132
|
session.input.push(userMessage);
|
|
1133
|
+
const firstText = params.prompt[0]?.type === "text" ? params.prompt[0].text : "";
|
|
1134
|
+
await this.publishGoalFromPrompt(sessionId, firstText, steeredUuid);
|
|
1049
1135
|
return { outcome: "injected" };
|
|
1050
1136
|
}
|
|
1051
1137
|
/** Lazily start the per-session consumer that drains the SDK query stream for
|
|
@@ -1364,6 +1450,14 @@ export class ClaudeAcpAgent {
|
|
|
1364
1450
|
* calling settleActive directly bypasses the hold and re-opens the
|
|
1365
1451
|
* out-of-turn permission deadlock (issue #866) through its lane. */
|
|
1366
1452
|
const settleOrDefer = (outcome) => {
|
|
1453
|
+
// No result ends a steered turn: the steer aborted the cycle this result
|
|
1454
|
+
// may belong to, and the steered one is still to come. Record the outcome
|
|
1455
|
+
// for the idle lane (see Turn.steeredEchoes); later cycles overwrite it,
|
|
1456
|
+
// so the last result and its usage win.
|
|
1457
|
+
if (isSteering(session.activeTurn)) {
|
|
1458
|
+
session.activeTurn.steeredSettle = outcome;
|
|
1459
|
+
return;
|
|
1460
|
+
}
|
|
1367
1461
|
if (session.activeTurn &&
|
|
1368
1462
|
!session.activeTurn.settled &&
|
|
1369
1463
|
turnAwaitingSubagents(session.activeTurn)) {
|
|
@@ -1668,6 +1762,14 @@ export class ClaudeAcpAgent {
|
|
|
1668
1762
|
}
|
|
1669
1763
|
continue;
|
|
1670
1764
|
}
|
|
1765
|
+
// `active_goal` is emitted by the Claude runtime but is not currently
|
|
1766
|
+
// included in the public SDKMessage union. Handle it before the
|
|
1767
|
+
// exhaustive switch and publish only the provider-neutral ACP shape.
|
|
1768
|
+
if (message.type === "active_goal") {
|
|
1769
|
+
const activeGoal = message;
|
|
1770
|
+
await this.publishRuntimeGoal(params.sessionId, toGoalSnapshot(activeGoal));
|
|
1771
|
+
continue;
|
|
1772
|
+
}
|
|
1671
1773
|
switch (message.type) {
|
|
1672
1774
|
case "system":
|
|
1673
1775
|
switch (message.subtype) {
|
|
@@ -1835,8 +1937,33 @@ export class ClaudeAcpAgent {
|
|
|
1835
1937
|
// this lagged idle (no active turn to settle): the idle
|
|
1836
1938
|
// still belongs to that settled turn, and skipping the
|
|
1837
1939
|
// decrement would leak the debt permanently.
|
|
1940
|
+
// Deliberately BEFORE the steer lane below: an owed idle
|
|
1941
|
+
// belongs to an earlier turn, and reading it as the steered
|
|
1942
|
+
// sequence's turn-over signal would settle a turn whose
|
|
1943
|
+
// steered cycle is still running. Steered results owe none.
|
|
1838
1944
|
session.owedTrailingIdles--;
|
|
1839
1945
|
}
|
|
1946
|
+
else if (isSteering(session.activeTurn)) {
|
|
1947
|
+
// A steered turn settles here, not at a result: this idle is
|
|
1948
|
+
// the only signal spanning the interrupted and steered cycles
|
|
1949
|
+
// (see Turn.steeredEchoes). An idle before the steered echo,
|
|
1950
|
+
// or before any result was recorded, means the answer is
|
|
1951
|
+
// still ahead — swallow it, and never let it reach the #825
|
|
1952
|
+
// fail below, which would reject a prompt about to answer.
|
|
1953
|
+
//
|
|
1954
|
+
// Plain Turn so the fields can be cleared below; isSteering
|
|
1955
|
+
// narrows steeredEchoes to non-optional.
|
|
1956
|
+
const steered = session.activeTurn;
|
|
1957
|
+
if (steered.steeredEchoes?.size === 0 && steered.steeredSettle !== undefined) {
|
|
1958
|
+
// Via the subagent gate, not settleActive: a steered turn
|
|
1959
|
+
// can also have spawned background subagents, which own it
|
|
1960
|
+
// from here (settles now if none is live, holds otherwise).
|
|
1961
|
+
steered.deferredSettle = steered.steeredSettle;
|
|
1962
|
+
steered.steeredEchoes = undefined;
|
|
1963
|
+
steered.steeredSettle = undefined;
|
|
1964
|
+
settleDeferredIfDrained();
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1840
1967
|
else if (!session.cancelled &&
|
|
1841
1968
|
session.activeTurn &&
|
|
1842
1969
|
!session.activeTurn.settled) {
|
|
@@ -2213,6 +2340,20 @@ export class ClaudeAcpAgent {
|
|
|
2213
2340
|
if (!isAutonomousResult) {
|
|
2214
2341
|
recordResultForOrphanCommands();
|
|
2215
2342
|
ensureActiveTurn();
|
|
2343
|
+
// Once the submitted goal command has produced its own result,
|
|
2344
|
+
// no older runtime update can still precede it in the ordered
|
|
2345
|
+
// SDK stream. Stop suppressing updates even when this runtime
|
|
2346
|
+
// omitted the matching active_goal notification entirely.
|
|
2347
|
+
if (session.pendingGoalUpdate?.started) {
|
|
2348
|
+
const pendingGoalUpdate = session.pendingGoalUpdate;
|
|
2349
|
+
session.pendingGoalUpdate = undefined;
|
|
2350
|
+
const goalCommandFailed = message.is_error ||
|
|
2351
|
+
message.stop_reason === "refusal" ||
|
|
2352
|
+
("result" in message && message.result.includes("Please run /login"));
|
|
2353
|
+
if (goalCommandFailed) {
|
|
2354
|
+
await this.publishGoal(params.sessionId, pendingGoalUpdate.previous ?? null);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2216
2357
|
}
|
|
2217
2358
|
// A result closes the stretch of output it terminates: snapshot
|
|
2218
2359
|
// the delivery record — AFTER ensureActiveTurn, whose held-turn
|
|
@@ -2256,7 +2397,14 @@ export class ClaudeAcpAgent {
|
|
|
2256
2397
|
// turn's OWN result — a followup result arriving inside the
|
|
2257
2398
|
// cancel window still gets its own trailer and must be counted,
|
|
2258
2399
|
// or that idle would later false-fail the next prompt.
|
|
2259
|
-
|
|
2400
|
+
// A second exclusion: a steered turn's own results (see
|
|
2401
|
+
// Turn.steeredEchoes). One idle covers the whole interrupted +
|
|
2402
|
+
// steered sequence and that idle settles the turn, so counting
|
|
2403
|
+
// either result would leave a debt that swallows it. Autonomous
|
|
2404
|
+
// results inside a steered turn keep their own trailers.
|
|
2405
|
+
const owesTrailingIdle = isAutonomousResult || !isSteering(session.activeTurn);
|
|
2406
|
+
if (owesTrailingIdle &&
|
|
2407
|
+
(isAutonomousResult || !session.cancelled || !session.activeTurn)) {
|
|
2260
2408
|
session.owedTrailingIdles++;
|
|
2261
2409
|
}
|
|
2262
2410
|
// Accumulate usage into the user turn's tally. Skip autonomous
|
|
@@ -2385,6 +2533,17 @@ export class ClaudeAcpAgent {
|
|
|
2385
2533
|
settleOrDefer({ stopReason: "refusal", usage: sessionUsage(session) });
|
|
2386
2534
|
break;
|
|
2387
2535
|
}
|
|
2536
|
+
// A priority:'now' steer can make the SDK terminate the
|
|
2537
|
+
// interrupted cycle with an error-shaped diagnostic result
|
|
2538
|
+
// before it replays the injected message's echo. That result is
|
|
2539
|
+
// not the steered command's outcome: keep it on the steer lane
|
|
2540
|
+
// and let the cycle after the pending echo decide the turn.
|
|
2541
|
+
if (message.is_error &&
|
|
2542
|
+
isSteering(session.activeTurn) &&
|
|
2543
|
+
session.activeTurn.steeredEchoes.size > 0) {
|
|
2544
|
+
settleOrDefer({ stopReason: "end_turn", usage: sessionUsage(session) });
|
|
2545
|
+
break;
|
|
2546
|
+
}
|
|
2388
2547
|
switch (message.subtype) {
|
|
2389
2548
|
case "success": {
|
|
2390
2549
|
if (message.result.includes("Please run /login")) {
|
|
@@ -2621,6 +2780,9 @@ export class ClaudeAcpAgent {
|
|
|
2621
2780
|
// is still promoted — activateTurn() clears the flag. The turn's own
|
|
2622
2781
|
// echo is then dropped from the feed (the client already shows it).
|
|
2623
2782
|
if (message.type === "user" && "uuid" in message && message.uuid) {
|
|
2783
|
+
if (session.pendingGoalUpdate?.commandUuid === message.uuid) {
|
|
2784
|
+
session.pendingGoalUpdate.started = true;
|
|
2785
|
+
}
|
|
2624
2786
|
const queued = findUnsettledTurn(message.uuid);
|
|
2625
2787
|
if (queued) {
|
|
2626
2788
|
// Only (re)activate if this isn't already the active turn — a
|
|
@@ -2660,6 +2822,22 @@ export class ClaudeAcpAgent {
|
|
|
2660
2822
|
// when the drain idle eventually arrives.
|
|
2661
2823
|
settleActive(session.activeTurn.deferredSettle);
|
|
2662
2824
|
}
|
|
2825
|
+
else if (isSteering(session.activeTurn) &&
|
|
2826
|
+
session.activeTurn.steeredSettle !== undefined) {
|
|
2827
|
+
// Same for a turn with an open steer (see
|
|
2828
|
+
// Turn.steeredEchoes): the user moving on outranks the
|
|
2829
|
+
// steered continuation, but its last result's stop reason
|
|
2830
|
+
// stands. With no result yet it falls through to the
|
|
2831
|
+
// end_turn hand-off below, owing nothing there.
|
|
2832
|
+
//
|
|
2833
|
+
// The steer lane normally pays for that result's trailing
|
|
2834
|
+
// idle by settling on it; this hand-off settles instead,
|
|
2835
|
+
// so count it here or it arrives un-owed against the fresh
|
|
2836
|
+
// turn and false-fails it (issue #825). Harmless if it
|
|
2837
|
+
// never comes: the debt absorbs one future idle.
|
|
2838
|
+
session.owedTrailingIdles++;
|
|
2839
|
+
settleActive(session.activeTurn.steeredSettle);
|
|
2840
|
+
}
|
|
2663
2841
|
else {
|
|
2664
2842
|
settleActive({ stopReason: "end_turn", usage: sessionUsage(session) });
|
|
2665
2843
|
}
|
|
@@ -2676,6 +2854,13 @@ export class ClaudeAcpAgent {
|
|
|
2676
2854
|
break;
|
|
2677
2855
|
}
|
|
2678
2856
|
if ("isReplay" in message && message.isReplay) {
|
|
2857
|
+
// A steered message's echo matches no turn (steer() creates
|
|
2858
|
+
// none), but it marks the steered cycle as running — how the idle
|
|
2859
|
+
// lane tells "the answer is still ahead" from "the turn is over"
|
|
2860
|
+
// (see Turn.steeredEchoes).
|
|
2861
|
+
if (isSteering(session.activeTurn)) {
|
|
2862
|
+
session.activeTurn.steeredEchoes.delete(message.uuid);
|
|
2863
|
+
}
|
|
2679
2864
|
// Unrelated replay (e.g. the echo of an already-settled turn).
|
|
2680
2865
|
break;
|
|
2681
2866
|
}
|
|
@@ -2993,6 +3178,14 @@ export class ClaudeAcpAgent {
|
|
|
2993
3178
|
return;
|
|
2994
3179
|
}
|
|
2995
3180
|
session.cancelled = true;
|
|
3181
|
+
// A priority steer may still be queued in the SDK when cancellation
|
|
3182
|
+
// settles its owning turn. Its later echo matches no live turn, and its
|
|
3183
|
+
// result must be skipped rather than promoted onto the next prompt.
|
|
3184
|
+
if (isSteering(session.activeTurn)) {
|
|
3185
|
+
for (const uuid of session.activeTurn.steeredEchoes) {
|
|
3186
|
+
this.trackOrphanCommand(session, uuid, "pending");
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
2996
3189
|
// Capture the orphan-accounting lane before anything can await: the
|
|
2997
3190
|
// consumer latches msgLifecycleV1 when it drains the first system/init,
|
|
2998
3191
|
// which can happen DURING the awaited interrupt() below — the receipt
|
|
@@ -3104,6 +3297,15 @@ export class ClaudeAcpAgent {
|
|
|
3104
3297
|
active.resolve({ stopReason: "cancelled", usage: active.deferredSettle.usage });
|
|
3105
3298
|
}
|
|
3106
3299
|
}
|
|
3300
|
+
// A steered active turn (see Turn.steeredEchoes) settles "cancelled" in the
|
|
3301
|
+
// consumer at the interrupt's trailing idle, like any live turn. But the
|
|
3302
|
+
// steer lane pays for its last result's trailer by settling on it, which
|
|
3303
|
+
// this cancel pre-empts, so count that trailer here or it arrives un-owed
|
|
3304
|
+
// against the next prompt and false-fails it (issue #825). Over-counting
|
|
3305
|
+
// when only one trailer comes absorbs a future idle.
|
|
3306
|
+
if (isSteering(session.activeTurn) && session.activeTurn.steeredSettle !== undefined) {
|
|
3307
|
+
session.owedTrailingIdles++;
|
|
3308
|
+
}
|
|
3107
3309
|
// Arm a backstop before interrupting: if a turn is actively consuming the
|
|
3108
3310
|
// query and interrupt() doesn't make the SDK yield (e.g. a wedged TaskOutput
|
|
3109
3311
|
// block — issue #680), force the consumer to settle the active turn
|
|
@@ -6141,6 +6343,7 @@ export function runAcp() {
|
|
|
6141
6343
|
.onRequest(methods.agent.session.prompt, (ctx) => runPromptWithCancellation(agent, ctx.params, ctx.signal))
|
|
6142
6344
|
.onNotification(methods.agent.session.cancel, (ctx) => agent.cancel(ctx.params))
|
|
6143
6345
|
.onRequest(STEER_METHOD, { parse: parseSteerRequest }, (ctx) => agent.steer(ctx.params))
|
|
6346
|
+
.onRequest(GOAL_CONTROL_METHOD, { parse: parseGoalRequest }, (ctx) => agent.goal(ctx.params))
|
|
6144
6347
|
.connect(stream);
|
|
6145
6348
|
agent = new ClaudeAcpAgent(new ClientConnection(connection.client));
|
|
6146
6349
|
return { connection, agent };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SDKActiveGoalMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
export declare const GOAL_EXTENSION_VERSION: 1;
|
|
3
|
+
export declare const GOAL_CONTROL_METHOD = "_session/goal";
|
|
4
|
+
export declare const GOAL_ACTIONS: readonly ["set", "clear"];
|
|
5
|
+
export type GoalAction = (typeof GOAL_ACTIONS)[number];
|
|
6
|
+
export type GoalCapability = {
|
|
7
|
+
version: typeof GOAL_EXTENSION_VERSION;
|
|
8
|
+
controlMethod: typeof GOAL_CONTROL_METHOD;
|
|
9
|
+
actions: GoalAction[];
|
|
10
|
+
};
|
|
11
|
+
export type GoalStatus = "active" | "paused" | "blocked" | "limited" | "complete";
|
|
12
|
+
export type GoalSnapshot = {
|
|
13
|
+
objective: string;
|
|
14
|
+
status: GoalStatus;
|
|
15
|
+
iterations?: number;
|
|
16
|
+
lastReason?: string | null;
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
updatedAt?: number;
|
|
19
|
+
tokenBudget?: number | null;
|
|
20
|
+
tokensUsed?: number;
|
|
21
|
+
timeUsedSeconds?: number;
|
|
22
|
+
controlMethod: typeof GOAL_CONTROL_METHOD;
|
|
23
|
+
};
|
|
24
|
+
export type GoalRequest = {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
action: "clear";
|
|
27
|
+
} | {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
action: "set";
|
|
30
|
+
objective: string;
|
|
31
|
+
};
|
|
32
|
+
export type GoalControlResponse = Record<string, never>;
|
|
33
|
+
export declare function goalUpdateFromPrompt(prompt: string): GoalSnapshot | null | undefined;
|
|
34
|
+
export declare function parseGoalRequest(params: unknown): GoalRequest;
|
|
35
|
+
export declare function toGoalSnapshot(message: SDKActiveGoalMessage): GoalSnapshot | null;
|
|
36
|
+
//# sourceMappingURL=goal-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-extension.d.ts","sourceRoot":"","sources":["../src/goal-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AACjD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,eAAO,MAAM,YAAY,2BAA4B,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,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agentclientprotocol/sdk";
|
|
2
|
+
export const GOAL_EXTENSION_VERSION = 1;
|
|
3
|
+
export const GOAL_CONTROL_METHOD = "_session/goal";
|
|
4
|
+
export const GOAL_ACTIONS = ["set", "clear"];
|
|
5
|
+
export function goalUpdateFromPrompt(prompt) {
|
|
6
|
+
const match = /^\/goal(?:\s+([\s\S]*))?$/.exec(prompt);
|
|
7
|
+
const argument = match?.[1]?.trim();
|
|
8
|
+
if (!argument) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
if (argument === "clear") {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
objective: argument,
|
|
16
|
+
status: "active",
|
|
17
|
+
controlMethod: GOAL_CONTROL_METHOD,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function parseGoalRequest(params) {
|
|
21
|
+
if (!params || typeof params !== "object") {
|
|
22
|
+
throw RequestError.invalidParams(undefined, "goal params must be an object");
|
|
23
|
+
}
|
|
24
|
+
const { sessionId, action, objective } = params;
|
|
25
|
+
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
26
|
+
throw RequestError.invalidParams(undefined, "goal params require a non-empty sessionId");
|
|
27
|
+
}
|
|
28
|
+
if (!GOAL_ACTIONS.includes(action)) {
|
|
29
|
+
throw RequestError.invalidParams(undefined, 'goal action must be "set" or "clear"');
|
|
30
|
+
}
|
|
31
|
+
if (action === "set" && (typeof objective !== "string" || objective.trim().length === 0)) {
|
|
32
|
+
throw RequestError.invalidParams(undefined, 'goal action "set" requires a non-empty objective');
|
|
33
|
+
}
|
|
34
|
+
return action === "set"
|
|
35
|
+
? { sessionId, action, objective: objective.trim() }
|
|
36
|
+
: { sessionId, action: "clear" };
|
|
37
|
+
}
|
|
38
|
+
export function toGoalSnapshot(message) {
|
|
39
|
+
if (message.value === null) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
objective: message.value.condition.trim(),
|
|
44
|
+
status: "active",
|
|
45
|
+
iterations: message.value.iterations,
|
|
46
|
+
lastReason: message.value.last_reason ?? null,
|
|
47
|
+
createdAt: message.value.set_at,
|
|
48
|
+
controlMethod: GOAL_CONTROL_METHOD,
|
|
49
|
+
};
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.66.0",
|
|
7
7
|
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -29,11 +29,13 @@
|
|
|
29
29
|
"build": "tsc",
|
|
30
30
|
"start": "node dist/index.js",
|
|
31
31
|
"dev": "npm run build && npm run start",
|
|
32
|
+
"example:simple-client": "node --experimental-strip-types --disable-warning=ExperimentalWarning examples/simple-client.ts",
|
|
32
33
|
"lint": "eslint src --ext .ts",
|
|
33
34
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
34
35
|
"format": "prettier --write .",
|
|
35
36
|
"format:check": "prettier --check .",
|
|
36
37
|
"check": "npm run lint && npm run format:check",
|
|
38
|
+
"release:preflight": "bash scripts/release-preflight.sh",
|
|
37
39
|
"test": "vitest",
|
|
38
40
|
"test:integration": "RUN_INTEGRATION_TESTS=true vitest run",
|
|
39
41
|
"test:run": "vitest run",
|
|
@@ -76,7 +78,7 @@
|
|
|
76
78
|
"@typescript-eslint/parser": "8.65.0",
|
|
77
79
|
"eslint": "10.8.0",
|
|
78
80
|
"eslint-config-prettier": "10.1.8",
|
|
79
|
-
"globals": "17.
|
|
81
|
+
"globals": "17.9.0",
|
|
80
82
|
"prettier": "3.9.6",
|
|
81
83
|
"ts-node": "10.9.2",
|
|
82
84
|
"typescript": "6.0.3",
|