@lucascouts/claude-agent-acp-plus 0.5.2 → 0.7.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 +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 -10
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, PermissionUpdate, 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
|
|
@@ -715,6 +750,10 @@ export declare class ClaudeAcpAgent {
|
|
|
715
750
|
resolveProviderConfig(): ProviderConfig | null;
|
|
716
751
|
logout(_params: LogoutRequest): Promise<void>;
|
|
717
752
|
prompt(params: PromptRequest): Promise<PromptResponse>;
|
|
753
|
+
goal(params: GoalRequest): Promise<GoalControlResponse>;
|
|
754
|
+
private publishGoal;
|
|
755
|
+
private publishGoalFromPrompt;
|
|
756
|
+
private publishRuntimeGoal;
|
|
718
757
|
/** Steer the session per the ACP steering wire protocol: inject a follow-up
|
|
719
758
|
* message into the turn that is currently running. If that turn already
|
|
720
759
|
* settled, the established default starts a new detached turn; Hosts may opt
|
|
@@ -731,6 +770,10 @@ export declare class ClaudeAcpAgent {
|
|
|
731
770
|
* calls). The steered message's own output streams via `session/update`, not
|
|
732
771
|
* this response.
|
|
733
772
|
*
|
|
773
|
+
* Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
|
|
774
|
+
* own and the steered message runs as a second one, so the turn is marked
|
|
775
|
+
* (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
|
|
776
|
+
*
|
|
734
777
|
* When the session is idle, the opt-in path returns `promptRequired` WITHOUT
|
|
735
778
|
* calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
|
|
736
779
|
* 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,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,UAAU,EAGV,sBAAsB,EACtB,aAAa,EAKb,SAAS,EAIT,OAAO,EACP,cAAc,EAEd,gBAAgB,EAChB,KAAK,EAIL,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EAEf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MA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AAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,MAAM;;;EA2CrB"}
|
|
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,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,UAAU,EAGV,sBAAsB,EACtB,aAAa,EAKb,SAAS,EAIT,OAAO,EACP,cAAc,EAEd,gBAAgB,EAChB,KAAK,EAKL,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EAEf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAKL,WAAW,EACX,mBAAmB,EACnB,YAAY,EAIb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,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AAY,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;;;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";
|
|
@@ -132,6 +133,11 @@ const AUTONOMOUS_RESULT_ORIGINS = new Set([
|
|
|
132
133
|
function isHeldOpen(turn) {
|
|
133
134
|
return turn != null && turn.deferredSettle !== undefined && !turn.settled;
|
|
134
135
|
}
|
|
136
|
+
/** Whether a steer moved this turn's settlement off the next result and onto the
|
|
137
|
+
* SDK's `idle` (see Turn.steeredEchoes). Shared by the consumer's settle lanes. */
|
|
138
|
+
function isSteering(turn) {
|
|
139
|
+
return turn != null && turn.steeredEchoes !== undefined && !turn.settled;
|
|
140
|
+
}
|
|
135
141
|
/** Disarm the force-cancel backstop (see Session.forceCancelTimer). Every
|
|
136
142
|
* path that settles the active turn must run this so a timer can never fire
|
|
137
143
|
* on an already-settled turn — and must leave the field undefined, or the
|
|
@@ -787,6 +793,11 @@ export class ClaudeAcpAgent {
|
|
|
787
793
|
steering: {
|
|
788
794
|
supported: true,
|
|
789
795
|
},
|
|
796
|
+
goal: {
|
|
797
|
+
version: GOAL_EXTENSION_VERSION,
|
|
798
|
+
controlMethod: GOAL_CONTROL_METHOD,
|
|
799
|
+
actions: [...GOAL_ACTIONS],
|
|
800
|
+
},
|
|
790
801
|
},
|
|
791
802
|
};
|
|
792
803
|
}
|
|
@@ -1134,8 +1145,64 @@ export class ClaudeAcpAgent {
|
|
|
1134
1145
|
session.turnQueue.push(turn);
|
|
1135
1146
|
session.input.push(userMessage);
|
|
1136
1147
|
this.ensureConsumer(session, params.sessionId);
|
|
1148
|
+
await this.publishGoalFromPrompt(params.sessionId, firstText, promptUuid);
|
|
1137
1149
|
return response;
|
|
1138
1150
|
}
|
|
1151
|
+
async goal(params) {
|
|
1152
|
+
const command = params.action === "set" ? `/goal ${params.objective}` : "/goal clear";
|
|
1153
|
+
const prompt = [{ type: "text", text: command }];
|
|
1154
|
+
const steering = await this.steer({
|
|
1155
|
+
sessionId: params.sessionId,
|
|
1156
|
+
prompt,
|
|
1157
|
+
_meta: { steering: { idleBehavior: "promptRequired" } },
|
|
1158
|
+
});
|
|
1159
|
+
if (steering.outcome === "promptRequired") {
|
|
1160
|
+
await this.prompt({ sessionId: params.sessionId, prompt });
|
|
1161
|
+
}
|
|
1162
|
+
return {};
|
|
1163
|
+
}
|
|
1164
|
+
async publishGoal(sessionId, goal) {
|
|
1165
|
+
const session = this.sessions[sessionId];
|
|
1166
|
+
if (session) {
|
|
1167
|
+
session.lastPublishedGoal = goal;
|
|
1168
|
+
}
|
|
1169
|
+
await this.client.sessionUpdate({
|
|
1170
|
+
sessionId,
|
|
1171
|
+
update: {
|
|
1172
|
+
sessionUpdate: "session_info_update",
|
|
1173
|
+
_meta: { goal },
|
|
1174
|
+
},
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
async publishGoalFromPrompt(sessionId, prompt, commandUuid) {
|
|
1178
|
+
const goalUpdate = goalUpdateFromPrompt(prompt);
|
|
1179
|
+
if (goalUpdate !== undefined) {
|
|
1180
|
+
const session = this.sessions[sessionId];
|
|
1181
|
+
if (session) {
|
|
1182
|
+
session.pendingGoalUpdate = {
|
|
1183
|
+
commandUuid,
|
|
1184
|
+
expected: goalUpdate,
|
|
1185
|
+
previous: session.lastPublishedGoal,
|
|
1186
|
+
started: false,
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
await this.publishGoal(sessionId, goalUpdate);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
async publishRuntimeGoal(sessionId, goal) {
|
|
1193
|
+
const session = this.sessions[sessionId];
|
|
1194
|
+
const pending = session?.pendingGoalUpdate;
|
|
1195
|
+
if (pending) {
|
|
1196
|
+
const matchesPending = pending.expected === null
|
|
1197
|
+
? goal === null
|
|
1198
|
+
: goal !== null && goal.objective === pending.expected.objective;
|
|
1199
|
+
if (!matchesPending) {
|
|
1200
|
+
return;
|
|
1201
|
+
}
|
|
1202
|
+
session.pendingGoalUpdate = undefined;
|
|
1203
|
+
}
|
|
1204
|
+
await this.publishGoal(sessionId, goal);
|
|
1205
|
+
}
|
|
1139
1206
|
/** Steer the session per the ACP steering wire protocol: inject a follow-up
|
|
1140
1207
|
* message into the turn that is currently running. If that turn already
|
|
1141
1208
|
* settled, the established default starts a new detached turn; Hosts may opt
|
|
@@ -1152,6 +1219,10 @@ export class ClaudeAcpAgent {
|
|
|
1152
1219
|
* calls). The steered message's own output streams via `session/update`, not
|
|
1153
1220
|
* this response.
|
|
1154
1221
|
*
|
|
1222
|
+
* Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
|
|
1223
|
+
* own and the steered message runs as a second one, so the turn is marked
|
|
1224
|
+
* (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
|
|
1225
|
+
*
|
|
1155
1226
|
* When the session is idle, the opt-in path returns `promptRequired` WITHOUT
|
|
1156
1227
|
* calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
|
|
1157
1228
|
* stays Host-owned so the Host can submit it through a standard
|
|
@@ -1171,7 +1242,7 @@ export class ClaudeAcpAgent {
|
|
|
1171
1242
|
// which is exactly the window in which steering is meaningful. This check
|
|
1172
1243
|
// and the active-path push below stay in one synchronous section so the
|
|
1173
1244
|
// turn cannot settle in the gap between deciding to inject and enqueueing.
|
|
1174
|
-
const turnInFlight = (session.turnQueue ?? []).
|
|
1245
|
+
const turnInFlight = (session.turnQueue ?? []).find((turn) => !turn.settled);
|
|
1175
1246
|
if (!turnInFlight) {
|
|
1176
1247
|
const promptRequest = {
|
|
1177
1248
|
sessionId,
|
|
@@ -1194,11 +1265,26 @@ export class ClaudeAcpAgent {
|
|
|
1194
1265
|
prompt: params.prompt,
|
|
1195
1266
|
};
|
|
1196
1267
|
const userMessage = promptToClaude(promptRequest);
|
|
1197
|
-
|
|
1268
|
+
const steeredUuid = randomUUID();
|
|
1269
|
+
userMessage.uuid = steeredUuid;
|
|
1198
1270
|
// Deliver into the running turn rather than queuing behind it as a fresh
|
|
1199
1271
|
// prompt would.
|
|
1200
1272
|
userMessage.priority = STEER_PRIORITY;
|
|
1273
|
+
// Mark before the push and in the same synchronous section as the in-flight
|
|
1274
|
+
// check: the interrupt can have the CLI finalizing the aborted cycle by the
|
|
1275
|
+
// time the consumer next runs, and an unmarked result would settle the turn
|
|
1276
|
+
// (see Turn.steeredEchoes).
|
|
1277
|
+
(turnInFlight.steeredEchoes ??= new Set()).add(steeredUuid);
|
|
1278
|
+
// A turn already held for background subagents has a recorded outcome the
|
|
1279
|
+
// steer supersedes: move it into the steer lane so one lane owns settlement.
|
|
1280
|
+
// The idle handler re-applies the hold through the subagent gate.
|
|
1281
|
+
if (turnInFlight.deferredSettle !== undefined) {
|
|
1282
|
+
turnInFlight.steeredSettle = turnInFlight.deferredSettle;
|
|
1283
|
+
turnInFlight.deferredSettle = undefined;
|
|
1284
|
+
}
|
|
1201
1285
|
session.input.push(userMessage);
|
|
1286
|
+
const firstText = params.prompt[0]?.type === "text" ? params.prompt[0].text : "";
|
|
1287
|
+
await this.publishGoalFromPrompt(sessionId, firstText, steeredUuid);
|
|
1202
1288
|
return { outcome: "injected" };
|
|
1203
1289
|
}
|
|
1204
1290
|
/** Lazily start the per-session consumer that drains the SDK query stream for
|
|
@@ -1517,6 +1603,14 @@ export class ClaudeAcpAgent {
|
|
|
1517
1603
|
* calling settleActive directly bypasses the hold and re-opens the
|
|
1518
1604
|
* out-of-turn permission deadlock (issue #866) through its lane. */
|
|
1519
1605
|
const settleOrDefer = (outcome) => {
|
|
1606
|
+
// No result ends a steered turn: the steer aborted the cycle this result
|
|
1607
|
+
// may belong to, and the steered one is still to come. Record the outcome
|
|
1608
|
+
// for the idle lane (see Turn.steeredEchoes); later cycles overwrite it,
|
|
1609
|
+
// so the last result and its usage win.
|
|
1610
|
+
if (isSteering(session.activeTurn)) {
|
|
1611
|
+
session.activeTurn.steeredSettle = outcome;
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1520
1614
|
if (session.activeTurn &&
|
|
1521
1615
|
!session.activeTurn.settled &&
|
|
1522
1616
|
turnAwaitingSubagents(session.activeTurn)) {
|
|
@@ -1846,6 +1940,14 @@ export class ClaudeAcpAgent {
|
|
|
1846
1940
|
}
|
|
1847
1941
|
continue;
|
|
1848
1942
|
}
|
|
1943
|
+
// `active_goal` is emitted by the Claude runtime but is not currently
|
|
1944
|
+
// included in the public SDKMessage union. Handle it before the
|
|
1945
|
+
// exhaustive switch and publish only the provider-neutral ACP shape.
|
|
1946
|
+
if (message.type === "active_goal") {
|
|
1947
|
+
const activeGoal = message;
|
|
1948
|
+
await this.publishRuntimeGoal(params.sessionId, toGoalSnapshot(activeGoal));
|
|
1949
|
+
continue;
|
|
1950
|
+
}
|
|
1849
1951
|
switch (message.type) {
|
|
1850
1952
|
case "system":
|
|
1851
1953
|
switch (message.subtype) {
|
|
@@ -2013,8 +2115,33 @@ export class ClaudeAcpAgent {
|
|
|
2013
2115
|
// this lagged idle (no active turn to settle): the idle
|
|
2014
2116
|
// still belongs to that settled turn, and skipping the
|
|
2015
2117
|
// decrement would leak the debt permanently.
|
|
2118
|
+
// Deliberately BEFORE the steer lane below: an owed idle
|
|
2119
|
+
// belongs to an earlier turn, and reading it as the steered
|
|
2120
|
+
// sequence's turn-over signal would settle a turn whose
|
|
2121
|
+
// steered cycle is still running. Steered results owe none.
|
|
2016
2122
|
session.owedTrailingIdles--;
|
|
2017
2123
|
}
|
|
2124
|
+
else if (isSteering(session.activeTurn)) {
|
|
2125
|
+
// A steered turn settles here, not at a result: this idle is
|
|
2126
|
+
// the only signal spanning the interrupted and steered cycles
|
|
2127
|
+
// (see Turn.steeredEchoes). An idle before the steered echo,
|
|
2128
|
+
// or before any result was recorded, means the answer is
|
|
2129
|
+
// still ahead — swallow it, and never let it reach the #825
|
|
2130
|
+
// fail below, which would reject a prompt about to answer.
|
|
2131
|
+
//
|
|
2132
|
+
// Plain Turn so the fields can be cleared below; isSteering
|
|
2133
|
+
// narrows steeredEchoes to non-optional.
|
|
2134
|
+
const steered = session.activeTurn;
|
|
2135
|
+
if (steered.steeredEchoes?.size === 0 && steered.steeredSettle !== undefined) {
|
|
2136
|
+
// Via the subagent gate, not settleActive: a steered turn
|
|
2137
|
+
// can also have spawned background subagents, which own it
|
|
2138
|
+
// from here (settles now if none is live, holds otherwise).
|
|
2139
|
+
steered.deferredSettle = steered.steeredSettle;
|
|
2140
|
+
steered.steeredEchoes = undefined;
|
|
2141
|
+
steered.steeredSettle = undefined;
|
|
2142
|
+
settleDeferredIfDrained();
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2018
2145
|
else if (!session.cancelled &&
|
|
2019
2146
|
session.activeTurn &&
|
|
2020
2147
|
!session.activeTurn.settled) {
|
|
@@ -2391,6 +2518,20 @@ export class ClaudeAcpAgent {
|
|
|
2391
2518
|
if (!isAutonomousResult) {
|
|
2392
2519
|
recordResultForOrphanCommands();
|
|
2393
2520
|
ensureActiveTurn();
|
|
2521
|
+
// Once the submitted goal command has produced its own result,
|
|
2522
|
+
// no older runtime update can still precede it in the ordered
|
|
2523
|
+
// SDK stream. Stop suppressing updates even when this runtime
|
|
2524
|
+
// omitted the matching active_goal notification entirely.
|
|
2525
|
+
if (session.pendingGoalUpdate?.started) {
|
|
2526
|
+
const pendingGoalUpdate = session.pendingGoalUpdate;
|
|
2527
|
+
session.pendingGoalUpdate = undefined;
|
|
2528
|
+
const goalCommandFailed = message.is_error ||
|
|
2529
|
+
message.stop_reason === "refusal" ||
|
|
2530
|
+
("result" in message && message.result.includes("Please run /login"));
|
|
2531
|
+
if (goalCommandFailed) {
|
|
2532
|
+
await this.publishGoal(params.sessionId, pendingGoalUpdate.previous ?? null);
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2394
2535
|
}
|
|
2395
2536
|
// A result closes the stretch of output it terminates: snapshot
|
|
2396
2537
|
// the delivery record — AFTER ensureActiveTurn, whose held-turn
|
|
@@ -2434,7 +2575,14 @@ export class ClaudeAcpAgent {
|
|
|
2434
2575
|
// turn's OWN result — a followup result arriving inside the
|
|
2435
2576
|
// cancel window still gets its own trailer and must be counted,
|
|
2436
2577
|
// or that idle would later false-fail the next prompt.
|
|
2437
|
-
|
|
2578
|
+
// A second exclusion: a steered turn's own results (see
|
|
2579
|
+
// Turn.steeredEchoes). One idle covers the whole interrupted +
|
|
2580
|
+
// steered sequence and that idle settles the turn, so counting
|
|
2581
|
+
// either result would leave a debt that swallows it. Autonomous
|
|
2582
|
+
// results inside a steered turn keep their own trailers.
|
|
2583
|
+
const owesTrailingIdle = isAutonomousResult || !isSteering(session.activeTurn);
|
|
2584
|
+
if (owesTrailingIdle &&
|
|
2585
|
+
(isAutonomousResult || !session.cancelled || !session.activeTurn)) {
|
|
2438
2586
|
session.owedTrailingIdles++;
|
|
2439
2587
|
}
|
|
2440
2588
|
// Accumulate usage into the user turn's tally. Skip autonomous
|
|
@@ -2563,6 +2711,17 @@ export class ClaudeAcpAgent {
|
|
|
2563
2711
|
settleOrDefer({ stopReason: "refusal", usage: sessionUsage(session) });
|
|
2564
2712
|
break;
|
|
2565
2713
|
}
|
|
2714
|
+
// A priority:'now' steer can make the SDK terminate the
|
|
2715
|
+
// interrupted cycle with an error-shaped diagnostic result
|
|
2716
|
+
// before it replays the injected message's echo. That result is
|
|
2717
|
+
// not the steered command's outcome: keep it on the steer lane
|
|
2718
|
+
// and let the cycle after the pending echo decide the turn.
|
|
2719
|
+
if (message.is_error &&
|
|
2720
|
+
isSteering(session.activeTurn) &&
|
|
2721
|
+
session.activeTurn.steeredEchoes.size > 0) {
|
|
2722
|
+
settleOrDefer({ stopReason: "end_turn", usage: sessionUsage(session) });
|
|
2723
|
+
break;
|
|
2724
|
+
}
|
|
2566
2725
|
switch (message.subtype) {
|
|
2567
2726
|
case "success": {
|
|
2568
2727
|
if (message.result.includes("Please run /login")) {
|
|
@@ -2799,6 +2958,9 @@ export class ClaudeAcpAgent {
|
|
|
2799
2958
|
// is still promoted — activateTurn() clears the flag. The turn's own
|
|
2800
2959
|
// echo is then dropped from the feed (the client already shows it).
|
|
2801
2960
|
if (message.type === "user" && "uuid" in message && message.uuid) {
|
|
2961
|
+
if (session.pendingGoalUpdate?.commandUuid === message.uuid) {
|
|
2962
|
+
session.pendingGoalUpdate.started = true;
|
|
2963
|
+
}
|
|
2802
2964
|
const queued = findUnsettledTurn(message.uuid);
|
|
2803
2965
|
if (queued) {
|
|
2804
2966
|
// Only (re)activate if this isn't already the active turn — a
|
|
@@ -2838,6 +3000,22 @@ export class ClaudeAcpAgent {
|
|
|
2838
3000
|
// when the drain idle eventually arrives.
|
|
2839
3001
|
settleActive(session.activeTurn.deferredSettle);
|
|
2840
3002
|
}
|
|
3003
|
+
else if (isSteering(session.activeTurn) &&
|
|
3004
|
+
session.activeTurn.steeredSettle !== undefined) {
|
|
3005
|
+
// Same for a turn with an open steer (see
|
|
3006
|
+
// Turn.steeredEchoes): the user moving on outranks the
|
|
3007
|
+
// steered continuation, but its last result's stop reason
|
|
3008
|
+
// stands. With no result yet it falls through to the
|
|
3009
|
+
// end_turn hand-off below, owing nothing there.
|
|
3010
|
+
//
|
|
3011
|
+
// The steer lane normally pays for that result's trailing
|
|
3012
|
+
// idle by settling on it; this hand-off settles instead,
|
|
3013
|
+
// so count it here or it arrives un-owed against the fresh
|
|
3014
|
+
// turn and false-fails it (issue #825). Harmless if it
|
|
3015
|
+
// never comes: the debt absorbs one future idle.
|
|
3016
|
+
session.owedTrailingIdles++;
|
|
3017
|
+
settleActive(session.activeTurn.steeredSettle);
|
|
3018
|
+
}
|
|
2841
3019
|
else {
|
|
2842
3020
|
settleActive({ stopReason: "end_turn", usage: sessionUsage(session) });
|
|
2843
3021
|
}
|
|
@@ -2854,6 +3032,13 @@ export class ClaudeAcpAgent {
|
|
|
2854
3032
|
break;
|
|
2855
3033
|
}
|
|
2856
3034
|
if ("isReplay" in message && message.isReplay) {
|
|
3035
|
+
// A steered message's echo matches no turn (steer() creates
|
|
3036
|
+
// none), but it marks the steered cycle as running — how the idle
|
|
3037
|
+
// lane tells "the answer is still ahead" from "the turn is over"
|
|
3038
|
+
// (see Turn.steeredEchoes).
|
|
3039
|
+
if (isSteering(session.activeTurn)) {
|
|
3040
|
+
session.activeTurn.steeredEchoes.delete(message.uuid);
|
|
3041
|
+
}
|
|
2857
3042
|
// Unrelated replay (e.g. the echo of an already-settled turn).
|
|
2858
3043
|
break;
|
|
2859
3044
|
}
|
|
@@ -3187,6 +3372,14 @@ export class ClaudeAcpAgent {
|
|
|
3187
3372
|
return;
|
|
3188
3373
|
}
|
|
3189
3374
|
session.cancelled = true;
|
|
3375
|
+
// A priority steer may still be queued in the SDK when cancellation
|
|
3376
|
+
// settles its owning turn. Its later echo matches no live turn, and its
|
|
3377
|
+
// result must be skipped rather than promoted onto the next prompt.
|
|
3378
|
+
if (isSteering(session.activeTurn)) {
|
|
3379
|
+
for (const uuid of session.activeTurn.steeredEchoes) {
|
|
3380
|
+
this.trackOrphanCommand(session, uuid, "pending");
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3190
3383
|
// Capture the orphan-accounting lane before anything can await: the
|
|
3191
3384
|
// consumer latches msgLifecycleV1 when it drains the first system/init,
|
|
3192
3385
|
// which can happen DURING the awaited interrupt() below — the receipt
|
|
@@ -3298,6 +3491,15 @@ export class ClaudeAcpAgent {
|
|
|
3298
3491
|
active.resolve({ stopReason: "cancelled", usage: active.deferredSettle.usage });
|
|
3299
3492
|
}
|
|
3300
3493
|
}
|
|
3494
|
+
// A steered active turn (see Turn.steeredEchoes) settles "cancelled" in the
|
|
3495
|
+
// consumer at the interrupt's trailing idle, like any live turn. But the
|
|
3496
|
+
// steer lane pays for its last result's trailer by settling on it, which
|
|
3497
|
+
// this cancel pre-empts, so count that trailer here or it arrives un-owed
|
|
3498
|
+
// against the next prompt and false-fails it (issue #825). Over-counting
|
|
3499
|
+
// when only one trailer comes absorbs a future idle.
|
|
3500
|
+
if (isSteering(session.activeTurn) && session.activeTurn.steeredSettle !== undefined) {
|
|
3501
|
+
session.owedTrailingIdles++;
|
|
3502
|
+
}
|
|
3301
3503
|
// Arm a backstop before interrupting: if a turn is actively consuming the
|
|
3302
3504
|
// query and interrupt() doesn't make the SDK yield (e.g. a wedged TaskOutput
|
|
3303
3505
|
// block — issue #680), force the consumer to settle the active turn
|
|
@@ -6770,6 +6972,7 @@ export function runAcp() {
|
|
|
6770
6972
|
.onRequest(methods.agent.session.prompt, (ctx) => runPromptWithCancellation(agent, ctx.params, ctx.signal))
|
|
6771
6973
|
.onNotification(methods.agent.session.cancel, (ctx) => agent.cancel(ctx.params))
|
|
6772
6974
|
.onRequest(STEER_METHOD, { parse: parseSteerRequest }, (ctx) => agent.steer(ctx.params))
|
|
6975
|
+
.onRequest(GOAL_CONTROL_METHOD, { parse: parseGoalRequest }, (ctx) => agent.goal(ctx.params))
|
|
6773
6976
|
.connect(stream);
|
|
6774
6977
|
agent = new ClaudeAcpAgent(new ClientConnection(connection.client));
|
|
6775
6978
|
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,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,OAAO,sBAAsB,CAAC;IACvC,aAAa,EAAE,OAAO,mBAAmB,CAAC;IAC1C,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAElF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,OAAO,mBAAmB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,WAAW,GACrB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnG,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAExD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,CAcpF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAiB7D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAYjF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { RequestError } from "@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.7.0",
|
|
7
7
|
"description": "ACP adapter for the Claude Agent SDK with VS Code-parity UX for Zed and other ACP clients — checkbox multi-select questions, refusal consent dialog, dynamic agent name. Fork of claude-agent-acp.",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"format": "prettier --write .",
|
|
35
35
|
"format:check": "prettier --check .",
|
|
36
36
|
"check": "npm run lint && npm run format:check",
|
|
37
|
+
"release:preflight": "bash scripts/release-preflight.sh",
|
|
37
38
|
"ci:local": "npm run format:check && npm run lint && npm run build && npm run test:run",
|
|
38
39
|
"test": "vitest",
|
|
39
40
|
"test:integration": "RUN_INTEGRATION_TESTS=true vitest run",
|
|
@@ -65,16 +66,9 @@
|
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
68
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
69
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.224",
|
|
69
70
|
"zod": "^3.25.0 || ^4.0.0"
|
|
70
71
|
},
|
|
71
|
-
"overrides": {
|
|
72
|
-
"@hono/node-server": "~2.0.6",
|
|
73
|
-
"brace-expansion": "^5.0.9",
|
|
74
|
-
"fast-uri": "^3.1.5",
|
|
75
|
-
"hono": "^4.12.34",
|
|
76
|
-
"ip-address": "^10.4.0"
|
|
77
|
-
},
|
|
78
72
|
"devDependencies": {
|
|
79
73
|
"@anthropic-ai/sdk": "0.115.0",
|
|
80
74
|
"@eslint/js": "10.0.1",
|
|
@@ -84,7 +78,7 @@
|
|
|
84
78
|
"@typescript-eslint/parser": "8.65.0",
|
|
85
79
|
"eslint": "10.8.0",
|
|
86
80
|
"eslint-config-prettier": "10.1.8",
|
|
87
|
-
"globals": "17.
|
|
81
|
+
"globals": "17.9.0",
|
|
88
82
|
"prettier": "3.9.6",
|
|
89
83
|
"ts-node": "10.9.2",
|
|
90
84
|
"typescript": "6.0.3",
|