@lucascouts/claude-agent-acp-plus 0.23.6 → 0.24.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 CHANGED
@@ -32,6 +32,7 @@ On top of upstream, aimed at parity with the Claude Code VS Code extension:
32
32
  - **Refusal consent dialog** — when the model refuses, the CLI's fallback prompt is shown as a dialog instead of a bare error
33
33
  - **Live quota windows** — every usage window from the account's usage report, refreshed while the session is idle and shared between adapter processes
34
34
  - **Background tasks** — the live set of background tasks is published to the client
35
+ - **Task feed** — every task the agent runs, with status, usage and timing, plus stop and send-to-background actions (see [Task feed](#task-feed))
35
36
  - **Session notices** — live advisories sent as ACP session notices, and context compaction reported rather than inferred
36
37
  - **Ultracode** in the effort picker, and a model picker that offers only the newest model of each family
37
38
  - **Per-session account selection**, and an agent name taken from the installed package
@@ -48,6 +49,36 @@ with `_meta.claudeCode.subagent = true`.
48
49
  Clients that do not advertise the capability retain the legacy flattened behavior. In both modes,
49
50
  the normal Agent/Task tool result is preserved as the protocol-compatible fallback.
50
51
 
52
+ ### Task feed
53
+
54
+ The agent's background shells, subagents, monitors and workflows are published as one table per
55
+ session, under `session_info_update._meta["_claude/tasks"]`. The `initialize` response advertises
56
+ it as `agentCapabilities._meta["_claude/tasks"] = { "version": 1 }`; clients should gate on that
57
+ capability, never on the agent's name.
58
+
59
+ Each update is a **snapshot, not a delta**: `{ "tasks": [...] }` carries every live task, so a
60
+ client replaces its list instead of merging. Each entry has `id`, `toolCallId`, `type`
61
+ (`shell` · `subagent` · …), `description`, `background`, `depth`, `status`
62
+ (`running` · `completed` · `failed` · `stopped` · `interrupted`), `startedAt` and `endedAt`
63
+ (epoch milliseconds, `endedAt` null while running), `usage` (`{ tokens, toolUses, durationMs }`
64
+ or null), `lastTool` and `summary`. An ended task appears in exactly one snapshot with its final
65
+ status, then drops out. Progress is published at most once per second; an ending is published at
66
+ once. When the agent's stream ends, running tasks are published once as `interrupted`.
67
+ Command lines are never copied into an entry.
68
+
69
+ Two JSON-RPC methods act on a task:
70
+
71
+ - `_claude/tasks/stop` — params `{ sessionId, taskId }`, result `{}`
72
+ - `_claude/tasks/background` — params `{ sessionId, toolCallId }`, result `{ backgrounded }`;
73
+ moves a foreground tool call's task to the background
74
+
75
+ An unknown session or a task that is not running is an invalid-params error (`-32602`); a session
76
+ whose stream already ended is an internal error (`-32603`).
77
+
78
+ Subagent entries can carry a short model-written progress `summary`. It is off by default, because
79
+ each summary is a model call billed to the user; set `CLAUDE_ACP_PROGRESS_SUMMARIES=1` (or `true`)
80
+ in the agent's environment to turn it on.
81
+
51
82
  ## Install
52
83
 
53
84
  ```bash
@@ -15,6 +15,7 @@ import { AccountUsageTracker } from "./account-usage.js";
15
15
  import { type AccountOptionState, type DeclaredAccount } from "./accounts.js";
16
16
  export { DEFAULT_AGENT_ID, EFFORT_CONFIG_ID } from "./session-config-ids.js";
17
17
  import { MODE_CONFIG_ID } from "./session-mode.js";
18
+ import { TASKS_META_KEY, TaskFeed, TaskFeedPublisher } from "./task-feed.js";
18
19
  export declare const CLAUDE_CONFIG_DIR: string;
19
20
  /**
20
21
  * Logger interface for customizing logging output
@@ -46,6 +47,10 @@ type SteerMeta = {
46
47
  * reports in `background_tasks_changed`, so a client can tell an idle thread
47
48
  * from one whose turn ended while a shell or subagent keeps running. */
48
49
  export declare const BACKGROUND_TASKS_META_KEY = "_claude/backgroundTasks";
50
+ /** `session_info_update._meta` key carrying the task feed snapshot
51
+ * (story 012) — see `task-feed.ts`. Published beside, never instead of,
52
+ * {@link BACKGROUND_TASKS_META_KEY}. */
53
+ export { TASKS_META_KEY };
49
54
  export type SteerRequest = {
50
55
  sessionId: string;
51
56
  prompt: PromptRequest["prompt"];
@@ -62,6 +67,32 @@ export type SteerResponse = {
62
67
  outcome: "promptRequired";
63
68
  reason: "noRunningTurn";
64
69
  };
70
+ /** Stop one of the agent's tasks (story 012, R2.1). Params
71
+ * {@link TasksStopRequest}, result `{}`. */
72
+ export declare const TASKS_STOP_METHOD = "_claude/tasks/stop";
73
+ /** Move a foreground tool call's task to the background (story 012, R2.3).
74
+ * Params {@link TasksBackgroundRequest}, result {@link TasksBackgroundResponse}. */
75
+ export declare const TASKS_BACKGROUND_METHOD = "_claude/tasks/background";
76
+ /** `agentCapabilities._meta` key advertising the task feed and its two
77
+ * methods (R2.7). Zeo gates on this, never on the agent's name — the name is
78
+ * `package.json`'s, and differs between this fork and the published mirror. */
79
+ export declare const TASKS_CAPABILITY_KEY = "_claude/tasks";
80
+ export declare const TASKS_CAPABILITY_VERSION = 1;
81
+ export type TasksStopRequest = {
82
+ sessionId: string;
83
+ taskId: string;
84
+ };
85
+ export type TasksBackgroundRequest = {
86
+ sessionId: string;
87
+ toolCallId: string;
88
+ };
89
+ export type TasksBackgroundResponse = {
90
+ backgrounded: boolean;
91
+ };
92
+ /** Validate raw JSON-RPC params into a {@link TasksStopRequest}. */
93
+ export declare function parseTasksStopRequest(params: unknown): TasksStopRequest;
94
+ /** Validate raw JSON-RPC params into a {@link TasksBackgroundRequest}. */
95
+ export declare function parseTasksBackgroundRequest(params: unknown): TasksBackgroundRequest;
65
96
  /** Internal model-selection state. Mirrors the shape the ACP SDK exposed as
66
97
  * `SessionModelState` before model selection moved entirely into
67
98
  * `SessionConfigOption` (category "model"). Retained internally to track the
@@ -229,6 +260,11 @@ type Turn = {
229
260
  /** Settles after the ACP prompt request completes, regardless of outcome. */
230
261
  completion?: Promise<void>;
231
262
  };
263
+ /** Whether sessions ask the SDK for progress summaries on subagent tasks
264
+ * (`CLAUDE_ACP_PROGRESS_SUMMARIES`). Only `1` or `true` turn it on; anything
265
+ * else — unset included — leaves it off, because each summary is a model
266
+ * call the user pays for. */
267
+ export declare function progressSummariesEnabled(raw?: string | undefined): boolean;
232
268
  /** Resolve the poll interval from the environment, clamped. An unparseable or
233
269
  * negative value falls back to the default rather than disabling the refresh:
234
270
  * a typo should not silently return the bars to the stale behaviour this
@@ -610,6 +646,13 @@ export type Session = {
610
646
  * entry on its two-activation clock. */
611
647
  endedPerLevel?: "ended" | "sweep-armed";
612
648
  }>;
649
+ /** The task feed (story 012): every task message folded into the
650
+ * `_claude/tasks` snapshot, published through `taskFeedPublisher`. Both
651
+ * live as long as the SESSION, not the consumer — a query recreate keeps
652
+ * them, because the restart's `interrupted` endings must go out through
653
+ * them (R1.9). Absent only on hand-built test sessions. */
654
+ taskFeed?: TaskFeed;
655
+ taskFeedPublisher?: TaskFeedPublisher;
613
656
  /** Whether any top-level assistant text reached the client since the last
614
657
  * stretch boundary. Set as a side effect of sending in the consumer's
615
658
  * `sendUpdate`, never at an emission site; read at the terminal `result`
@@ -1018,6 +1061,15 @@ export declare class ClaudeAcpAgent {
1018
1061
  * stays Host-owned so the Host can submit it through a standard
1019
1062
  * `session/prompt`. Without the opt-in, the existing detached `prompt()` and
1020
1063
  * `startedNewTurn` result are preserved for compatibility. */
1064
+ /** `_claude/tasks/stop`: stop a task the feed holds as running (R2.1, R2.2). */
1065
+ stopTask(params: TasksStopRequest): Promise<Record<string, never>>;
1066
+ /** `_claude/tasks/background`: background the task a foreground tool call
1067
+ * started (R2.3, R2.4). `false` means the id matched no foreground task. */
1068
+ backgroundTask(params: TasksBackgroundRequest): Promise<TasksBackgroundResponse>;
1069
+ /** Resolve the session, run the action, and write its one `[tasks/action]`
1070
+ * line (R2.6). The line carries ids and the outcome only — never a command
1071
+ * line, a description or a summary. */
1072
+ private taskAction;
1021
1073
  steer(params: SteerRequest): Promise<SteerResponse>;
1022
1074
  /** Publish the audit terminal for every turn path that did not reach the
1023
1075
  * report tool. The support flips the turn state synchronously before its
@@ -1076,6 +1128,18 @@ export declare class ClaudeAcpAgent {
1076
1128
  * on the next closeSession/deleteSession or when the connection's `dispose()`
1077
1129
  * runs. */
1078
1130
  private closeQueryStream;
1131
+ /** The session's CLI process is gone for good: whatever it was running did
1132
+ * not survive (R1.9), and the publisher must not outlive the session object
1133
+ * — a clear-context restart or a provider switch replaces that object under
1134
+ * the SAME id, and a stale timer would overwrite the new feed's level. The
1135
+ * query recreate is the one exit that keeps the feed, and does not come
1136
+ * through here. */
1137
+ private retireTaskFeed;
1138
+ /** One session's task feed and its publisher (story 012). The send goes
1139
+ * straight to the client rather than through a consumer's `sendUpdate`:
1140
+ * the publisher outlives consumers (a query recreate replaces them), and a
1141
+ * `session_info_update` is never subject to that chokepoint's filters. */
1142
+ private createTaskFeed;
1079
1143
  /** Cleanly tear down a session: cancel in-flight work, release stream
1080
1144
  * resources, and remove it from the session map. */
1081
1145
  private teardownSession;
@@ -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,EAClB,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,EAEV,sBAAsB,EACtB,aAAa,EAIb,SAAS,EAIT,OAAO,EACP,cAAc,EAEd,KAAK,EAKL,gBAAgB,EA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b,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;;;EA0DrC"}
package/dist/acp-agent.js CHANGED
@@ -42,6 +42,7 @@ import { ACCOUNT_CONFIG_ID, accountForValue, accountInForce, createAccountConfig
42
42
  import { isUsageCommandText, structuredUsageMarkdown, syntheticLocalCommand, } from "./usage-markdown.js";
43
43
  export { DEFAULT_AGENT_ID, EFFORT_CONFIG_ID } from "./session-config-ids.js";
44
44
  import { MODE_CONFIG_ID, SessionModeManager } from "./session-mode.js";
45
+ import { TASKS_META_KEY, TaskFeed, TaskFeedPublisher } from "./task-feed.js";
45
46
  export const CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
46
47
  const execFileAsync = promisify(execFile);
47
48
  const ZERO_USAGE = Object.freeze({
@@ -103,6 +104,10 @@ const STEER_PRIORITY_LATER = "later";
103
104
  * reports in `background_tasks_changed`, so a client can tell an idle thread
104
105
  * from one whose turn ended while a shell or subagent keeps running. */
105
106
  export const BACKGROUND_TASKS_META_KEY = "_claude/backgroundTasks";
107
+ /** `session_info_update._meta` key carrying the task feed snapshot
108
+ * (story 012) — see `task-feed.ts`. Published beside, never instead of,
109
+ * {@link BACKGROUND_TASKS_META_KEY}. */
110
+ export { TASKS_META_KEY };
106
111
  /** Validate raw JSON-RPC params into a {@link SteerRequest}. Kept minimal — the
107
112
  * content blocks are handed to `promptToClaude`, which tolerates unknown block
108
113
  * types — but `sessionId` and a non-empty `prompt` array are required. */
@@ -130,6 +135,48 @@ function parseSteerRequest(params) {
130
135
  _meta: _meta,
131
136
  };
132
137
  }
138
+ /** Stop one of the agent's tasks (story 012, R2.1). Params
139
+ * {@link TasksStopRequest}, result `{}`. */
140
+ export const TASKS_STOP_METHOD = "_claude/tasks/stop";
141
+ /** Move a foreground tool call's task to the background (story 012, R2.3).
142
+ * Params {@link TasksBackgroundRequest}, result {@link TasksBackgroundResponse}. */
143
+ export const TASKS_BACKGROUND_METHOD = "_claude/tasks/background";
144
+ /** `agentCapabilities._meta` key advertising the task feed and its two
145
+ * methods (R2.7). Zeo gates on this, never on the agent's name — the name is
146
+ * `package.json`'s, and differs between this fork and the published mirror. */
147
+ export const TASKS_CAPABILITY_KEY = TASKS_META_KEY;
148
+ export const TASKS_CAPABILITY_VERSION = 1;
149
+ /** The SDK's own text for a rejected control request, passed through to the
150
+ * client as the internal error's message (R2.4). */
151
+ function errorMessage(error) {
152
+ return error instanceof Error ? error.message : String(error);
153
+ }
154
+ /** A value made safe for one `key=value` field: ids come from the client and
155
+ * could otherwise carry a space, a newline or an `=` that forges a field. */
156
+ function logValue(value) {
157
+ return value.replace(/[\s=]+/g, "_");
158
+ }
159
+ function requireIdField(params, method, field) {
160
+ const value = params && typeof params === "object" ? params[field] : undefined;
161
+ if (typeof value !== "string" || value.length === 0) {
162
+ throw RequestError.invalidParams(undefined, `${method} params require a non-empty ${field}`);
163
+ }
164
+ return value;
165
+ }
166
+ /** Validate raw JSON-RPC params into a {@link TasksStopRequest}. */
167
+ export function parseTasksStopRequest(params) {
168
+ return {
169
+ sessionId: requireIdField(params, TASKS_STOP_METHOD, "sessionId"),
170
+ taskId: requireIdField(params, TASKS_STOP_METHOD, "taskId"),
171
+ };
172
+ }
173
+ /** Validate raw JSON-RPC params into a {@link TasksBackgroundRequest}. */
174
+ export function parseTasksBackgroundRequest(params) {
175
+ return {
176
+ sessionId: requireIdField(params, TASKS_BACKGROUND_METHOD, "sessionId"),
177
+ toolCallId: requireIdField(params, TASKS_BACKGROUND_METHOD, "toolCallId"),
178
+ };
179
+ }
133
180
  /** How often the account quota windows are refreshed while a session sits idle,
134
181
  * in milliseconds; `0` disables polling entirely.
135
182
  *
@@ -144,6 +191,14 @@ function parseSteerRequest(params) {
144
191
  * loop to show anything a 15-second one would miss. */
145
192
  const QUOTA_POLL_DEFAULT_MS = 60_000;
146
193
  const QUOTA_POLL_FLOOR_MS = 15_000;
194
+ /** Whether sessions ask the SDK for progress summaries on subagent tasks
195
+ * (`CLAUDE_ACP_PROGRESS_SUMMARIES`). Only `1` or `true` turn it on; anything
196
+ * else — unset included — leaves it off, because each summary is a model
197
+ * call the user pays for. */
198
+ export function progressSummariesEnabled(raw = process.env.CLAUDE_ACP_PROGRESS_SUMMARIES) {
199
+ const value = raw?.trim().toLowerCase();
200
+ return value === "1" || value === "true";
201
+ }
147
202
  /** Resolve the poll interval from the environment, clamped. An unparseable or
148
203
  * negative value falls back to the default rather than disabling the refresh:
149
204
  * a typo should not silently return the bars to the stale behaviour this
@@ -789,6 +844,7 @@ export class ClaudeAcpAgent {
789
844
  claudeCode: {
790
845
  promptQueueing: true,
791
846
  },
847
+ [TASKS_CAPABILITY_KEY]: { version: TASKS_CAPABILITY_VERSION },
792
848
  },
793
849
  promptCapabilities: {
794
850
  image: true,
@@ -1438,6 +1494,59 @@ export class ClaudeAcpAgent {
1438
1494
  * stays Host-owned so the Host can submit it through a standard
1439
1495
  * `session/prompt`. Without the opt-in, the existing detached `prompt()` and
1440
1496
  * `startedNewTurn` result are preserved for compatibility. */
1497
+ /** `_claude/tasks/stop`: stop a task the feed holds as running (R2.1, R2.2). */
1498
+ async stopTask(params) {
1499
+ const { sessionId, taskId } = params;
1500
+ return this.taskAction(TASKS_STOP_METHOD, sessionId, `taskId=${logValue(taskId)}`, async (session) => {
1501
+ if (!session.taskFeed?.isRunning(taskId)) {
1502
+ throw RequestError.invalidParams(undefined, `task ${taskId} is not running`);
1503
+ }
1504
+ try {
1505
+ await session.query.stopTask(taskId);
1506
+ }
1507
+ catch (error) {
1508
+ throw RequestError.internalError(undefined, errorMessage(error));
1509
+ }
1510
+ return {};
1511
+ });
1512
+ }
1513
+ /** `_claude/tasks/background`: background the task a foreground tool call
1514
+ * started (R2.3, R2.4). `false` means the id matched no foreground task. */
1515
+ async backgroundTask(params) {
1516
+ const { sessionId, toolCallId } = params;
1517
+ return this.taskAction(TASKS_BACKGROUND_METHOD, sessionId, `toolCallId=${logValue(toolCallId)}`, async (session) => {
1518
+ try {
1519
+ return { backgrounded: await session.query.backgroundTasks(toolCallId) };
1520
+ }
1521
+ catch (error) {
1522
+ // Thrown when background tasks are disabled for the session.
1523
+ throw RequestError.internalError(undefined, errorMessage(error));
1524
+ }
1525
+ });
1526
+ }
1527
+ /** Resolve the session, run the action, and write its one `[tasks/action]`
1528
+ * line (R2.6). The line carries ids and the outcome only — never a command
1529
+ * line, a description or a summary. */
1530
+ async taskAction(method, sessionId, target, action) {
1531
+ const log = (outcome, reason) => this.logger.log(`[tasks/action] method=${method} sessionId=${logValue(sessionId)} ${target} outcome=${outcome}` +
1532
+ (reason ? ` reason=${logValue(reason)}` : ""));
1533
+ try {
1534
+ const session = this.sessions[sessionId];
1535
+ if (!session) {
1536
+ throw RequestError.invalidParams(undefined, `unknown session ${sessionId}`);
1537
+ }
1538
+ if (session.queryClosed) {
1539
+ throw RequestError.internalError(undefined, SESSION_ENDED_MESSAGE);
1540
+ }
1541
+ const result = await action(session);
1542
+ log("ok");
1543
+ return result;
1544
+ }
1545
+ catch (error) {
1546
+ log("error", error instanceof RequestError ? `code_${error.code}` : "unexpected");
1547
+ throw error;
1548
+ }
1549
+ }
1441
1550
  async steer(params) {
1442
1551
  const sessionId = params.sessionId;
1443
1552
  const session = this.sessions[sessionId];
@@ -2928,7 +3037,9 @@ export class ClaudeAcpAgent {
2928
3037
  case "hook_progress":
2929
3038
  case "hook_response":
2930
3039
  case "files_persisted":
3040
+ break;
2931
3041
  case "task_progress":
3042
+ session.taskFeedPublisher?.notify(session.taskFeed.onProgress(message));
2932
3043
  break;
2933
3044
  case "task_started":
2934
3045
  // For subagent tasks `task_id` is the subagent's agent id (the
@@ -2956,11 +3067,13 @@ export class ClaudeAcpAgent {
2956
3067
  if (message.subagent_type && session.activeTurn && !session.activeTurn.settled) {
2957
3068
  (session.activeTurn.spawnedTaskIds ??= new Set()).add(message.task_id);
2958
3069
  }
3070
+ session.taskFeedPublisher?.notify(session.taskFeed.onStarted(message));
2959
3071
  break;
2960
3072
  case "task_notification":
2961
3073
  // The task settled — no further tool calls can originate
2962
3074
  // from it, so its registry entry can be dropped.
2963
3075
  session.liveBackgroundTasks.delete(message.task_id);
3076
+ session.taskFeedPublisher?.notify(session.taskFeed.onNotification(message));
2964
3077
  break;
2965
3078
  case "task_updated":
2966
3079
  // terminal-status task_updated patch and a (deduplicated)
@@ -2973,6 +3086,7 @@ export class ClaudeAcpAgent {
2973
3086
  message.patch.status === "killed") {
2974
3087
  session.liveBackgroundTasks.delete(message.task_id);
2975
3088
  }
3089
+ session.taskFeedPublisher?.notify(session.taskFeed.onUpdated(message));
2976
3090
  break;
2977
3091
  case "worker_shutting_down":
2978
3092
  // Defer until stream end. The announcement is durable and may be
@@ -3165,6 +3279,7 @@ export class ClaudeAcpAgent {
3165
3279
  // (watchers, skip_transcript work) are excluded because the
3166
3280
  // SDK marks them as "not activity" for exactly this use.
3167
3281
  await publishBackgroundTasks(message.tasks.filter((task) => !task.ambient));
3282
+ session.taskFeedPublisher?.notify(session.taskFeed.onLevel(message.tasks));
3168
3283
  break;
3169
3284
  default:
3170
3285
  unreachable(message, this.logger);
@@ -4585,6 +4700,35 @@ export class ClaudeAcpAgent {
4585
4700
  session.settingsManager.dispose();
4586
4701
  session.input.end();
4587
4702
  session.query.close();
4703
+ this.retireTaskFeed(session);
4704
+ }
4705
+ /** The session's CLI process is gone for good: whatever it was running did
4706
+ * not survive (R1.9), and the publisher must not outlive the session object
4707
+ * — a clear-context restart or a provider switch replaces that object under
4708
+ * the SAME id, and a stale timer would overwrite the new feed's level. The
4709
+ * query recreate is the one exit that keeps the feed, and does not come
4710
+ * through here. */
4711
+ retireTaskFeed(session) {
4712
+ const publisher = session.taskFeedPublisher;
4713
+ if (!publisher)
4714
+ return;
4715
+ publisher.notify(session.taskFeed.onProcessRestart());
4716
+ publisher.dispose({ flush: true });
4717
+ }
4718
+ /** One session's task feed and its publisher (story 012). The send goes
4719
+ * straight to the client rather than through a consumer's `sendUpdate`:
4720
+ * the publisher outlives consumers (a query recreate replaces them), and a
4721
+ * `session_info_update` is never subject to that chokepoint's filters. */
4722
+ createTaskFeed(sessionId) {
4723
+ const taskFeed = new TaskFeed(() => Date.now(),
4724
+ // Degraded but self-recovered: the Logger has no warn level, so the
4725
+ // line carries it as a field rather than being raised to error.
4726
+ { warn: (message) => this.logger.log(`${message} level=warn`) }, sessionId);
4727
+ const taskFeedPublisher = new TaskFeedPublisher(taskFeed, (snapshot) => this.client.sessionUpdate({
4728
+ sessionId,
4729
+ update: { sessionUpdate: "session_info_update", _meta: { [TASKS_META_KEY]: snapshot } },
4730
+ }), undefined, (error) => this.logger.error(`[tasks/feed] sessionId=${logValue(sessionId)} outcome=send_failed reason=${logValue(errorMessage(error))}`));
4731
+ return { taskFeed, taskFeedPublisher };
4588
4732
  }
4589
4733
  /** Cleanly tear down a session: cancel in-flight work, release stream
4590
4734
  * resources, and remove it from the session map. */
@@ -4614,6 +4758,9 @@ export class ClaudeAcpAgent {
4614
4758
  // here the client has asked us to close the session, so signalling abort is
4615
4759
  // appropriate; query.close() above has already torn the subprocess down.
4616
4760
  session.abortController.abort();
4761
+ // A pending throttle, retry or reconcile timer must not send to a closed
4762
+ // session.
4763
+ session.taskFeedPublisher?.dispose();
4617
4764
  delete this.sessions[sessionId];
4618
4765
  }
4619
4766
  /** Tear down all active sessions. Called when the ACP connection closes. */
@@ -5754,6 +5901,10 @@ export class ClaudeAcpAgent {
5754
5901
  // after the swap above is complete.
5755
5902
  oldInput.end();
5756
5903
  oldQuery.close();
5904
+ // Whatever the old process was running did not survive it (R1.9). The
5905
+ // feed and publisher are the session's, so the endings go out through
5906
+ // the same throttle the replacement query keeps using.
5907
+ session.taskFeedPublisher?.notify(session.taskFeed.onProcessRestart());
5757
5908
  }
5758
5909
  catch (error) {
5759
5910
  // Keep the OLD query fully usable and the pending flag set (the next
@@ -6131,6 +6282,10 @@ export class ClaudeAcpAgent {
6131
6282
  // (story 006, R3.3). Placed before the user spread so an explicit user
6132
6283
  // `enableFileCheckpointing` still wins.
6133
6284
  enableFileCheckpointing: true,
6285
+ // Model-written one-line summaries on a subagent's `task_progress`
6286
+ // (story 012, R3), opt-in because each costs tokens. Before the user
6287
+ // spread, so an explicit `agentProgressSummaries` still wins.
6288
+ agentProgressSummaries: progressSummariesEnabled(),
6134
6289
  ...userProvidedOptions,
6135
6290
  ...(settings && { settings }),
6136
6291
  env,
@@ -6504,6 +6659,7 @@ export class ClaudeAcpAgent {
6504
6659
  toolUseCache: {},
6505
6660
  emittedToolCalls: new Set(),
6506
6661
  liveBackgroundTasks: new Map(),
6662
+ ...this.createTaskFeed(sessionId),
6507
6663
  emittedAssistantText: false,
6508
6664
  owedTrailingIdles: 0,
6509
6665
  messageIdToUuid: new Map(),
@@ -8392,6 +8548,8 @@ export function runAcp(logger) {
8392
8548
  .onRequest(methods.agent.session.prompt, (ctx) => runPromptWithCancellation(agent, ctx.params, ctx.signal))
8393
8549
  .onNotification(methods.agent.session.cancel, (ctx) => agent.cancel(ctx.params))
8394
8550
  .onRequest(STEER_METHOD, { parse: parseSteerRequest }, (ctx) => agent.steer(ctx.params))
8551
+ .onRequest(TASKS_STOP_METHOD, { parse: parseTasksStopRequest }, (ctx) => agent.stopTask(ctx.params))
8552
+ .onRequest(TASKS_BACKGROUND_METHOD, { parse: parseTasksBackgroundRequest }, (ctx) => agent.backgroundTask(ctx.params))
8395
8553
  .onRequest(GOAL_CONTROL_METHOD, { parse: parseGoalRequest }, (ctx) => agent.goal(ctx.params))
8396
8554
  .connect(stream);
8397
8555
  agent = new ClaudeAcpAgent(new ClientConnection(connection.client), logger);
@@ -0,0 +1,157 @@
1
+ /**
2
+ * The agent's task feed: background shells, subagents, monitors and workflows,
3
+ * folded from the SDK's task messages into the `_claude/tasks` snapshot.
4
+ *
5
+ * The SDK reports tasks as a stream of bookends (`task_started`,
6
+ * `task_progress`, `task_updated`, `task_notification`) plus a level
7
+ * (`background_tasks_changed`). Zeo needs one table it can render, so
8
+ * `TaskFeed` keeps that table per session and renders it as a snapshot. The
9
+ * snapshot is a LEVEL, not a stream: every publish carries every live task,
10
+ * so a lost update is repaired by the next one, and the client replaces its
11
+ * list instead of merging.
12
+ *
13
+ * An ended task appears in exactly one successful snapshot with its final
14
+ * status, then drops out. `snapshot()` marks nothing; the publisher calls
15
+ * `markPublished()` only after the send carrying the endings succeeded, so a
16
+ * failed send never loses an ending.
17
+ *
18
+ * `TaskFeedPublisher` decides WHEN to publish: at most once per second during
19
+ * progress, at once on an ending, and once more after a burst so the latest
20
+ * values are not lost.
21
+ *
22
+ * Neither class ever copies a command line (`SDKTaskStartedMessage.prompt`)
23
+ * into an entry or a log line.
24
+ */
25
+ import type { SDKTaskNotificationMessage, SDKTaskProgressMessage, SDKTaskStartedMessage, SDKTaskUpdatedMessage } from "@anthropic-ai/claude-agent-sdk";
26
+ /** The `session_info_update._meta` key the snapshot is published under. */
27
+ export declare const TASKS_META_KEY = "_claude/tasks";
28
+ export type TaskStatus = "running" | "completed" | "failed" | "stopped" | "interrupted";
29
+ export type TaskUsage = {
30
+ tokens: number;
31
+ toolUses: number;
32
+ durationMs: number;
33
+ };
34
+ /** One row of the snapshot — design.md's Data Models, field for field. */
35
+ export type TaskEntry = {
36
+ id: string;
37
+ toolCallId: string | null;
38
+ type: string;
39
+ description: string;
40
+ background: boolean;
41
+ depth: number;
42
+ status: TaskStatus;
43
+ startedAt: number;
44
+ endedAt: number | null;
45
+ usage: TaskUsage | null;
46
+ lastTool: string | null;
47
+ summary: string | null;
48
+ };
49
+ export type TasksSnapshot = {
50
+ tasks: TaskEntry[];
51
+ };
52
+ /** What a message did to the table; the publisher decides timing from it. */
53
+ export type TaskChange = "none" | "progress" | "terminal";
54
+ /** How long a running background task may be missing from the level before
55
+ * it is ended as `interrupted`. The level and the bookends race (the level
56
+ * may arrive first), so a real ending gets this long to land. */
57
+ export declare const RECONCILE_GRACE_MS = 2000;
58
+ /** Minimum gap between two progress publishes of one session. */
59
+ export declare const PUBLISH_INTERVAL_MS = 1000;
60
+ export type TaskFeedLog = {
61
+ /** Diagnostics nobody acts on (an unknown task id). Omitted = dropped. */
62
+ debug?: (message: string) => void;
63
+ /** Degraded but self-recovered (a task ended by reconciliation). */
64
+ warn?: (message: string) => void;
65
+ };
66
+ /**
67
+ * The one place the SDK's ending vocabulary becomes the wire's. The same stop
68
+ * arrives as `task_updated.patch.status = "killed"` and as
69
+ * `task_notification.status = "stopped"`; both are `stopped`. Returns null for
70
+ * a non-terminal status (`pending`, `running`, `paused`).
71
+ */
72
+ export declare function normaliseStatus(status: string | undefined, reason?: string): Exclude<TaskStatus, "running"> | null;
73
+ export declare class TaskFeed {
74
+ private readonly clock;
75
+ private readonly log;
76
+ private readonly sessionId;
77
+ private readonly tasks;
78
+ /** Ended tasks whose final snapshot was sent successfully: never shown again. */
79
+ private readonly published;
80
+ /** Ambient task ids: never shown, and their later messages are not news. */
81
+ private readonly ambient;
82
+ /** task id → its current life; bumped on every start. */
83
+ private readonly lives;
84
+ /** task id → the life the latest snapshot carried as ended. */
85
+ private readonly snapshotLives;
86
+ /** task id → time after which a missing bookend means `interrupted`. */
87
+ private readonly deadlines;
88
+ constructor(clock: () => number, log?: TaskFeedLog, sessionId?: string);
89
+ onStarted(msg: SDKTaskStartedMessage): TaskChange;
90
+ onProgress(msg: SDKTaskProgressMessage): TaskChange;
91
+ onUpdated(msg: SDKTaskUpdatedMessage): TaskChange;
92
+ onNotification(msg: SDKTaskNotificationMessage): TaskChange;
93
+ /**
94
+ * The SDK's level: every live background task. It never adds or ends a task
95
+ * by itself — it may precede the `task_started` that names a task, or the
96
+ * bookend that ends one. A running background task the level omits gets a
97
+ * reconcile deadline; a level that lists it again clears it.
98
+ */
99
+ onLevel(level: {
100
+ task_id: string;
101
+ }[]): TaskChange;
102
+ nextReconcileAt(): number | null;
103
+ /** Ends as `interrupted` every task whose deadline passed with no bookend. */
104
+ reconcile(now: number): TaskChange;
105
+ /** The CLI process restarted: whatever was running did not survive it. */
106
+ onProcessRestart(): TaskChange;
107
+ /** True when the feed holds `taskId` as running — the stop request's gate. */
108
+ isRunning(taskId: string): boolean;
109
+ /** Running tasks plus ended tasks not yet published, oldest start first.
110
+ * Marks nothing: see `markPublished`. */
111
+ snapshot(): {
112
+ snapshot: TasksSnapshot;
113
+ endedIds: string[];
114
+ };
115
+ /** Called after the send carrying these endings succeeded. Their entries are
116
+ * dropped; the ids are remembered so a late bookend cannot resurrect them. */
117
+ markPublished(endedIds: string[]): void;
118
+ private running;
119
+ private end;
120
+ }
121
+ export type PublisherTimers = {
122
+ now: () => number;
123
+ setTimeout: (fn: () => void, ms: number) => unknown;
124
+ clearTimeout: (handle: any) => void;
125
+ };
126
+ export declare class TaskFeedPublisher {
127
+ private readonly feed;
128
+ private readonly send;
129
+ private readonly timers;
130
+ private readonly onSendError;
131
+ private lastSendAt;
132
+ /** One send at a time: a snapshot taken while another is in flight would
133
+ * carry that one's endings again, and both would succeed. */
134
+ private inFlight;
135
+ /** A publish requested while a send was in flight; `"terminal"` skips the
136
+ * throttle when it runs. */
137
+ private queued;
138
+ /** The trailing publish or the retry after a failed send — never both. */
139
+ private pending;
140
+ private reconcileTimer;
141
+ private reconcileAt;
142
+ private closed;
143
+ /** Set by `dispose({ flush: true })`: a publish queued behind an in-flight
144
+ * send still goes out once — a retirement's `interrupted` endings. */
145
+ private flushOnSettle;
146
+ constructor(feed: TaskFeed, send: (snapshot: TasksSnapshot) => Promise<void>, timers?: PublisherTimers, onSendError?: (error: unknown) => void);
147
+ notify(change: TaskChange): void;
148
+ dispose(options?: {
149
+ flush?: boolean;
150
+ }): void;
151
+ private publishNow;
152
+ private settle;
153
+ private arm;
154
+ private cancelPending;
155
+ private armReconcile;
156
+ }
157
+ //# sourceMappingURL=task-feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-feed.d.ts","sourceRoot":"","sources":["../src/task-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAExC,2EAA2E;AAC3E,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAExF,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAA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IACzB;iCAC6B;IAC7B,OAAO,CAAC,MAAM,CAAsB;IACpC,0EAA0E;IAC1E,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,MAAM,CAAS;IACvB;2EACuE;IACvE,OAAO,CAAC,aAAa,CAAS;gBAGX,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,EAChD,MAAM,GAAE,eAA4B,EACpC,WAAW,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAe;IAGnE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAYhC,OAAO,CAAC,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAShD,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,MAAM;IAsBd,OAAO,CAAC,GAAG;IAOX,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;CAerB"}
@@ -0,0 +1,400 @@
1
+ /**
2
+ * The agent's task feed: background shells, subagents, monitors and workflows,
3
+ * folded from the SDK's task messages into the `_claude/tasks` snapshot.
4
+ *
5
+ * The SDK reports tasks as a stream of bookends (`task_started`,
6
+ * `task_progress`, `task_updated`, `task_notification`) plus a level
7
+ * (`background_tasks_changed`). Zeo needs one table it can render, so
8
+ * `TaskFeed` keeps that table per session and renders it as a snapshot. The
9
+ * snapshot is a LEVEL, not a stream: every publish carries every live task,
10
+ * so a lost update is repaired by the next one, and the client replaces its
11
+ * list instead of merging.
12
+ *
13
+ * An ended task appears in exactly one successful snapshot with its final
14
+ * status, then drops out. `snapshot()` marks nothing; the publisher calls
15
+ * `markPublished()` only after the send carrying the endings succeeded, so a
16
+ * failed send never loses an ending.
17
+ *
18
+ * `TaskFeedPublisher` decides WHEN to publish: at most once per second during
19
+ * progress, at once on an ending, and once more after a burst so the latest
20
+ * values are not lost.
21
+ *
22
+ * Neither class ever copies a command line (`SDKTaskStartedMessage.prompt`)
23
+ * into an entry or a log line.
24
+ */
25
+ /** The `session_info_update._meta` key the snapshot is published under. */
26
+ export const TASKS_META_KEY = "_claude/tasks";
27
+ /** How long a running background task may be missing from the level before
28
+ * it is ended as `interrupted`. The level and the bookends race (the level
29
+ * may arrive first), so a real ending gets this long to land. */
30
+ export const RECONCILE_GRACE_MS = 2_000;
31
+ /** Minimum gap between two progress publishes of one session. */
32
+ export const PUBLISH_INTERVAL_MS = 1_000;
33
+ const TASK_TYPES = {
34
+ local_bash: "shell",
35
+ local_agent: "subagent",
36
+ local_workflow: "workflow",
37
+ mcp_task: "mcp",
38
+ monitor: "monitor",
39
+ };
40
+ function normaliseType(raw) {
41
+ if (!raw)
42
+ return "shell";
43
+ return TASK_TYPES[raw] ?? raw;
44
+ }
45
+ /**
46
+ * The one place the SDK's ending vocabulary becomes the wire's. The same stop
47
+ * arrives as `task_updated.patch.status = "killed"` and as
48
+ * `task_notification.status = "stopped"`; both are `stopped`. Returns null for
49
+ * a non-terminal status (`pending`, `running`, `paused`).
50
+ */
51
+ export function normaliseStatus(status, reason) {
52
+ if (reason === "worker_restart")
53
+ return "interrupted";
54
+ switch (status) {
55
+ case "completed":
56
+ return "completed";
57
+ case "failed":
58
+ return "failed";
59
+ case "killed":
60
+ case "stopped":
61
+ return "stopped";
62
+ default:
63
+ return null;
64
+ }
65
+ }
66
+ /** The SDK types usage as `number`; Zeo parses it as an unsigned integer and
67
+ * rejects the whole snapshot on one fractional or negative value. */
68
+ function wholeNumber(value) {
69
+ return Number.isFinite(value) ? Math.max(0, Math.round(value)) : 0;
70
+ }
71
+ function usageOf(usage) {
72
+ if (!usage)
73
+ return null;
74
+ return {
75
+ tokens: wholeNumber(usage.total_tokens),
76
+ toolUses: wholeNumber(usage.tool_uses),
77
+ durationMs: wholeNumber(usage.duration_ms),
78
+ };
79
+ }
80
+ export class TaskFeed {
81
+ clock;
82
+ log;
83
+ sessionId;
84
+ tasks = new Map();
85
+ /** Ended tasks whose final snapshot was sent successfully: never shown again. */
86
+ published = new Set();
87
+ /** Ambient task ids: never shown, and their later messages are not news. */
88
+ ambient = new Set();
89
+ /** task id → its current life; bumped on every start. */
90
+ lives = new Map();
91
+ /** task id → the life the latest snapshot carried as ended. */
92
+ snapshotLives = new Map();
93
+ /** task id → time after which a missing bookend means `interrupted`. */
94
+ deadlines = new Map();
95
+ constructor(clock, log = {}, sessionId = "") {
96
+ this.clock = clock;
97
+ this.log = log;
98
+ this.sessionId = sessionId;
99
+ }
100
+ onStarted(msg) {
101
+ if (msg.ambient) {
102
+ this.ambient.add(msg.task_id);
103
+ return "none";
104
+ }
105
+ if (this.tasks.get(msg.task_id)?.status === "running")
106
+ return "none";
107
+ // A known id starting again is a new life of the same task — a resumed
108
+ // subagent is re-registered under its agent id. It replaces the ended
109
+ // entry, published or not: the running state supersedes an ending the
110
+ // client has not seen yet, and a published id must be shown again.
111
+ this.published.delete(msg.task_id);
112
+ this.lives.set(msg.task_id, (this.lives.get(msg.task_id) ?? 0) + 1);
113
+ this.tasks.set(msg.task_id, {
114
+ id: msg.task_id,
115
+ toolCallId: msg.tool_use_id ?? null,
116
+ type: normaliseType(msg.task_type),
117
+ description: msg.description,
118
+ background: msg.is_backgrounded ?? false,
119
+ depth: msg.spawn_depth ?? 0,
120
+ status: "running",
121
+ startedAt: this.clock(),
122
+ endedAt: null,
123
+ usage: null,
124
+ lastTool: null,
125
+ summary: null,
126
+ });
127
+ return "progress";
128
+ }
129
+ onProgress(msg) {
130
+ const task = this.running(msg.task_id, "task_progress");
131
+ if (!task)
132
+ return "none";
133
+ task.usage = usageOf(msg.usage);
134
+ task.lastTool = msg.last_tool_name ?? task.lastTool;
135
+ task.summary = msg.summary ?? task.summary;
136
+ return "progress";
137
+ }
138
+ onUpdated(msg) {
139
+ const task = this.running(msg.task_id, "task_updated");
140
+ if (!task)
141
+ return "none";
142
+ const ending = normaliseStatus(msg.patch.status);
143
+ if (msg.patch.description !== undefined)
144
+ task.description = msg.patch.description;
145
+ if (msg.patch.is_backgrounded !== undefined)
146
+ task.background = msg.patch.is_backgrounded;
147
+ if (ending) {
148
+ this.end(task, ending);
149
+ return "terminal";
150
+ }
151
+ return "progress";
152
+ }
153
+ onNotification(msg) {
154
+ const task = this.running(msg.task_id, "task_notification");
155
+ if (!task)
156
+ return "none";
157
+ const ending = normaliseStatus(msg.status, msg.reason) ?? "completed";
158
+ if (msg.summary)
159
+ task.summary = msg.summary;
160
+ const usage = usageOf(msg.usage);
161
+ if (usage)
162
+ task.usage = usage;
163
+ this.end(task, ending);
164
+ return "terminal";
165
+ }
166
+ /**
167
+ * The SDK's level: every live background task. It never adds or ends a task
168
+ * by itself — it may precede the `task_started` that names a task, or the
169
+ * bookend that ends one. A running background task the level omits gets a
170
+ * reconcile deadline; a level that lists it again clears it.
171
+ */
172
+ onLevel(level) {
173
+ const listed = new Set(level.map((t) => t.task_id));
174
+ const now = this.clock();
175
+ for (const task of this.tasks.values()) {
176
+ if (task.status !== "running" || !task.background)
177
+ continue;
178
+ if (listed.has(task.id))
179
+ this.deadlines.delete(task.id);
180
+ else if (!this.deadlines.has(task.id))
181
+ this.deadlines.set(task.id, now + RECONCILE_GRACE_MS);
182
+ }
183
+ return "none";
184
+ }
185
+ nextReconcileAt() {
186
+ let next = null;
187
+ for (const at of this.deadlines.values())
188
+ if (next === null || at < next)
189
+ next = at;
190
+ return next;
191
+ }
192
+ /** Ends as `interrupted` every task whose deadline passed with no bookend. */
193
+ reconcile(now) {
194
+ let change = "none";
195
+ for (const [id, at] of this.deadlines) {
196
+ if (at > now)
197
+ continue;
198
+ const task = this.tasks.get(id);
199
+ if (task?.status === "running") {
200
+ this.log.warn?.(`[tasks/reconcile] sessionId=${this.sessionId} taskId=${id} outcome=interrupted reason=missing_from_level`);
201
+ this.end(task, "interrupted", now);
202
+ change = "terminal";
203
+ }
204
+ this.deadlines.delete(id);
205
+ }
206
+ return change;
207
+ }
208
+ /** The CLI process restarted: whatever was running did not survive it. */
209
+ onProcessRestart() {
210
+ let change = "none";
211
+ for (const task of this.tasks.values()) {
212
+ if (task.status !== "running")
213
+ continue;
214
+ this.end(task, "interrupted");
215
+ change = "terminal";
216
+ }
217
+ return change;
218
+ }
219
+ /** True when the feed holds `taskId` as running — the stop request's gate. */
220
+ isRunning(taskId) {
221
+ return this.tasks.get(taskId)?.status === "running";
222
+ }
223
+ /** Running tasks plus ended tasks not yet published, oldest start first.
224
+ * Marks nothing: see `markPublished`. */
225
+ snapshot() {
226
+ const tasks = [...this.tasks.values()]
227
+ .filter((t) => t.status === "running" || !this.published.has(t.id))
228
+ .sort((a, b) => a.startedAt - b.startedAt)
229
+ .map((t) => ({ ...t, usage: t.usage ? { ...t.usage } : null }));
230
+ const endedIds = tasks.filter((t) => t.status !== "running").map((t) => t.id);
231
+ for (const id of endedIds)
232
+ this.snapshotLives.set(id, this.lives.get(id) ?? 0);
233
+ return { snapshot: { tasks }, endedIds };
234
+ }
235
+ /** Called after the send carrying these endings succeeded. Their entries are
236
+ * dropped; the ids are remembered so a late bookend cannot resurrect them. */
237
+ markPublished(endedIds) {
238
+ for (const id of endedIds) {
239
+ // Only the life the snapshot carried: a task that started again while
240
+ // the send was in flight is a new life the client has not seen end.
241
+ if (this.snapshotLives.get(id) !== this.lives.get(id))
242
+ continue;
243
+ if (this.tasks.get(id)?.status === "running")
244
+ continue;
245
+ this.snapshotLives.delete(id);
246
+ this.published.add(id);
247
+ this.tasks.delete(id);
248
+ }
249
+ }
250
+ running(taskId, kind) {
251
+ const task = this.tasks.get(taskId);
252
+ if (task?.status === "running")
253
+ return task;
254
+ if (!task && !this.published.has(taskId) && !this.ambient.has(taskId)) {
255
+ this.log.debug?.(`[tasks/feed] sessionId=${this.sessionId} taskId=${taskId} ignored=${kind}`);
256
+ }
257
+ return undefined;
258
+ }
259
+ end(task, status, at = this.clock()) {
260
+ task.status = status;
261
+ task.endedAt = at;
262
+ this.deadlines.delete(task.id);
263
+ }
264
+ }
265
+ const realTimers = {
266
+ now: () => Date.now(),
267
+ setTimeout: (fn, ms) => setTimeout(fn, ms),
268
+ clearTimeout: (handle) => clearTimeout(handle),
269
+ };
270
+ export class TaskFeedPublisher {
271
+ feed;
272
+ send;
273
+ timers;
274
+ onSendError;
275
+ lastSendAt = Number.NEGATIVE_INFINITY;
276
+ /** One send at a time: a snapshot taken while another is in flight would
277
+ * carry that one's endings again, and both would succeed. */
278
+ inFlight = false;
279
+ /** A publish requested while a send was in flight; `"terminal"` skips the
280
+ * throttle when it runs. */
281
+ queued = "none";
282
+ /** The trailing publish or the retry after a failed send — never both. */
283
+ pending = null;
284
+ reconcileTimer = null;
285
+ reconcileAt = null;
286
+ closed = false;
287
+ /** Set by `dispose({ flush: true })`: a publish queued behind an in-flight
288
+ * send still goes out once — a retirement's `interrupted` endings. */
289
+ flushOnSettle = false;
290
+ constructor(feed, send, timers = realTimers, onSendError = () => { }) {
291
+ this.feed = feed;
292
+ this.send = send;
293
+ this.timers = timers;
294
+ this.onSendError = onSendError;
295
+ }
296
+ notify(change) {
297
+ if (this.closed)
298
+ return;
299
+ if (change === "terminal") {
300
+ this.publishNow();
301
+ }
302
+ else if (change === "progress") {
303
+ const wait = this.lastSendAt + PUBLISH_INTERVAL_MS - this.timers.now();
304
+ if (wait <= 0)
305
+ this.publishNow();
306
+ else if (this.pending === null)
307
+ this.arm(wait);
308
+ }
309
+ this.armReconcile();
310
+ }
311
+ dispose(options = {}) {
312
+ this.closed = true;
313
+ this.flushOnSettle = options.flush ?? false;
314
+ this.cancelPending();
315
+ if (this.reconcileTimer !== null)
316
+ this.timers.clearTimeout(this.reconcileTimer);
317
+ this.reconcileTimer = null;
318
+ this.reconcileAt = null;
319
+ }
320
+ publishNow() {
321
+ this.cancelPending();
322
+ if (this.inFlight) {
323
+ this.queued = "terminal";
324
+ return;
325
+ }
326
+ this.inFlight = true;
327
+ this.lastSendAt = this.timers.now();
328
+ const { snapshot, endedIds } = this.feed.snapshot();
329
+ // The SDK message loop calls notify; nothing here may throw into it — not
330
+ // a synchronous throw from `send`, and not a throwing error handler.
331
+ void Promise.resolve()
332
+ .then(() => this.send(snapshot))
333
+ .then(() => {
334
+ this.feed.markPublished(endedIds);
335
+ this.settle();
336
+ }, (error) => {
337
+ try {
338
+ this.onSendError(error);
339
+ }
340
+ catch {
341
+ // The retry below matters more than the log line.
342
+ }
343
+ this.settle();
344
+ if (!this.closed && !this.inFlight && this.pending === null) {
345
+ this.arm(PUBLISH_INTERVAL_MS);
346
+ }
347
+ });
348
+ }
349
+ settle() {
350
+ this.inFlight = false;
351
+ const queued = this.queued;
352
+ this.queued = "none";
353
+ if (queued === "none")
354
+ return;
355
+ if (!this.closed) {
356
+ this.notify(queued);
357
+ }
358
+ else if (this.flushOnSettle) {
359
+ // One last send, no retry: the publisher is closed.
360
+ this.flushOnSettle = false;
361
+ void Promise.resolve()
362
+ .then(() => this.send(this.feed.snapshot().snapshot))
363
+ .catch((error) => {
364
+ try {
365
+ this.onSendError(error);
366
+ }
367
+ catch {
368
+ // Nothing left to arm.
369
+ }
370
+ });
371
+ }
372
+ }
373
+ arm(ms) {
374
+ this.pending = this.timers.setTimeout(() => {
375
+ this.pending = null;
376
+ if (!this.closed)
377
+ this.publishNow();
378
+ }, ms);
379
+ }
380
+ cancelPending() {
381
+ if (this.pending !== null)
382
+ this.timers.clearTimeout(this.pending);
383
+ this.pending = null;
384
+ }
385
+ armReconcile() {
386
+ const at = this.feed.nextReconcileAt();
387
+ if (at === null || at === this.reconcileAt)
388
+ return;
389
+ if (this.reconcileTimer !== null)
390
+ this.timers.clearTimeout(this.reconcileTimer);
391
+ this.reconcileAt = at;
392
+ this.reconcileTimer = this.timers.setTimeout(() => {
393
+ this.reconcileTimer = null;
394
+ this.reconcileAt = null;
395
+ if (this.closed)
396
+ return;
397
+ this.notify(this.feed.reconcile(this.timers.now()));
398
+ }, Math.max(0, at - this.timers.now()));
399
+ }
400
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.23.6",
6
+ "version": "0.24.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",