@lucascouts/claude-agent-acp-plus 0.25.3 → 0.26.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
@@ -76,24 +76,37 @@ back in `auto`. A deny rule always wins over a grant.
76
76
 
77
77
  The agent's background shells, subagents, monitors and workflows are published as one table per
78
78
  session, under `session_info_update._meta["_claude/tasks"]`. The `initialize` response advertises
79
- it as `agentCapabilities._meta["_claude/tasks"] = { "version": 1 }`; clients should gate on that
80
- capability, never on the agent's name.
79
+ it as `agentCapabilities._meta["_claude/tasks"] = { "version": 2 }`; clients should gate on that
80
+ capability, never on the agent's name. Version 2 added `hasOutput`, `tail` and
81
+ `_claude/tasks/output`; a client that reads only version 1 fields keeps working.
81
82
 
82
83
  Each update is a **snapshot, not a delta**: `{ "tasks": [...] }` carries every live task, so a
83
84
  client replaces its list instead of merging. Each entry has `id`, `toolCallId`, `type`
84
85
  (`shell` · `subagent` · …), `description`, `background`, `depth`, `status`
85
86
  (`running` · `completed` · `failed` · `stopped` · `interrupted`), `startedAt` and `endedAt`
86
87
  (epoch milliseconds, `endedAt` null while running), `usage` (`{ tokens, toolUses, durationMs }`
87
- or null), `lastTool` and `summary`. An ended task appears in exactly one snapshot with its final
88
+ or null), `lastTool`, `summary`, `hasOutput` and `tail`. An ended task appears in exactly one snapshot with its final
88
89
  status, then drops out. Progress is published at most once per second; an ending is published at
89
90
  once. When the agent's stream ends, running tasks are published once as `interrupted`.
90
91
  Command lines are never copied into an entry.
91
92
 
92
- Two JSON-RPC methods act on a task:
93
+ `hasOutput` is true when the task's output file can be read through `_claude/tasks/output`
94
+ (shell tasks only). `tail` holds the last 10 lines of a **running** shell's output, refreshed about
95
+ once a second, each line stripped of terminal escapes and control characters and cut to 240
96
+ characters (a cut line ends in `…`); it is null for every other task and once the task ends.
97
+
98
+ Three JSON-RPC methods act on a task:
93
99
 
94
100
  - `_claude/tasks/stop` — params `{ sessionId, taskId }`, result `{}`
95
101
  - `_claude/tasks/background` — params `{ sessionId, toolCallId }`, result `{ backgrounded }`;
96
102
  moves a foreground tool call's task to the background
103
+ - `_claude/tasks/output` — params `{ sessionId, taskId, maxBytes }`, result
104
+ `{ content, totalBytes, truncated }`; the last `min(maxBytes, 1 MiB)` bytes of a shell task's
105
+ output, starting at a line boundary when truncated. It serves only the file the feed recorded
106
+ for that task, also after the task ended (the last 256 ended outputs per session are kept) and
107
+ after the session's stream ended. A task with no recorded output is invalid-params (`-32602`);
108
+ a file that is gone or no longer a regular file is an internal error (`-32603`). Its log line
109
+ names the session, task and byte count, never the content.
97
110
 
98
111
  An unknown session or a task that is not running is an invalid-params error (`-32602`); a session
99
112
  whose stream already ended is an internal error (`-32603`).
@@ -15,7 +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
+ import { TASKS_META_KEY, TailPoller, TaskFeed, TaskFeedPublisher } from "./task-feed.js";
19
19
  import { EscalationRegistry, GrantStore } from "./classifier-escalation.js";
20
20
  export declare const CLAUDE_CONFIG_DIR: string;
21
21
  /**
@@ -74,15 +74,29 @@ export declare const TASKS_STOP_METHOD = "_claude/tasks/stop";
74
74
  /** Move a foreground tool call's task to the background (story 012, R2.3).
75
75
  * Params {@link TasksBackgroundRequest}, result {@link TasksBackgroundResponse}. */
76
76
  export declare const TASKS_BACKGROUND_METHOD = "_claude/tasks/background";
77
- /** `agentCapabilities._meta` key advertising the task feed and its two
78
- * methods (R2.7). Zeo gates on this, never on the agent's name — the name is
77
+ /** Read the end of a task's output file (story 041, R2.1). Params
78
+ * {@link TasksOutputRequest}, result {@link TasksOutputResponse}. Version 2. */
79
+ export declare const TASKS_OUTPUT_METHOD = "_claude/tasks/output";
80
+ /** `agentCapabilities._meta` key advertising the task feed and its methods
81
+ * (R2.7). Zeo gates on this, never on the agent's name — the name is
79
82
  * `package.json`'s, and differs between this fork and the published mirror. */
80
83
  export declare const TASKS_CAPABILITY_KEY = "_claude/tasks";
81
- export declare const TASKS_CAPABILITY_VERSION = 1;
84
+ /** Version 2 (story 041) adds `hasOutput`, `tail` and `_claude/tasks/output`. */
85
+ export declare const TASKS_CAPABILITY_VERSION = 2;
82
86
  export type TasksStopRequest = {
83
87
  sessionId: string;
84
88
  taskId: string;
85
89
  };
90
+ export type TasksOutputRequest = {
91
+ sessionId: string;
92
+ taskId: string;
93
+ maxBytes: number;
94
+ };
95
+ export type TasksOutputResponse = {
96
+ content: string;
97
+ totalBytes: number;
98
+ truncated: boolean;
99
+ };
86
100
  export type TasksBackgroundRequest = {
87
101
  sessionId: string;
88
102
  toolCallId: string;
@@ -92,6 +106,10 @@ export type TasksBackgroundResponse = {
92
106
  };
93
107
  /** Validate raw JSON-RPC params into a {@link TasksStopRequest}. */
94
108
  export declare function parseTasksStopRequest(params: unknown): TasksStopRequest;
109
+ /** Validate raw JSON-RPC params into a {@link TasksOutputRequest}. Extra keys —
110
+ * a `path` included — are ignored: only a file the adapter recorded is read
111
+ * (R2.5). */
112
+ export declare function parseTasksOutputRequest(params: unknown): TasksOutputRequest;
95
113
  /** Validate raw JSON-RPC params into a {@link TasksBackgroundRequest}. */
96
114
  export declare function parseTasksBackgroundRequest(params: unknown): TasksBackgroundRequest;
97
115
  /** Internal model-selection state. Mirrors the shape the ACP SDK exposed as
@@ -664,6 +682,10 @@ export type Session = {
664
682
  * them (R1.9). Absent only on hand-built test sessions. */
665
683
  taskFeed?: TaskFeed;
666
684
  taskFeedPublisher?: TaskFeedPublisher;
685
+ /** Story 041: publishes running shells' tails into `taskFeed`. Lives and
686
+ * dies with the feed — `retireTaskFeed` disposes it, a query recreate keeps
687
+ * it. Absent only on hand-built test sessions. */
688
+ tailPoller?: TailPoller;
667
689
  /** Whether any top-level assistant text reached the client since the last
668
690
  * stretch boundary. Set as a side effect of sending in the consumer's
669
691
  * `sendUpdate`, never at an emission site; read at the terminal `result`
@@ -1074,6 +1096,13 @@ export declare class ClaudeAcpAgent {
1074
1096
  * `startedNewTurn` result are preserved for compatibility. */
1075
1097
  /** `_claude/tasks/stop`: stop a task the feed holds as running (R2.1, R2.2). */
1076
1098
  stopTask(params: TasksStopRequest): Promise<Record<string, never>>;
1099
+ /**
1100
+ * `_claude/tasks/output`: the end of a task's output file (story 041, R2.1–R2.7).
1101
+ * Serves only a path the feed recorded for its own task, and works on an
1102
+ * ended session too, as long as the session object exists. One log line,
1103
+ * never the content.
1104
+ */
1105
+ taskOutput(params: TasksOutputRequest): Promise<TasksOutputResponse>;
1077
1106
  /** `_claude/tasks/background`: background the task a foreground tool call
1078
1107
  * started (R2.3, R2.4). `false` means the id matched no foreground task. */
1079
1108
  backgroundTask(params: TasksBackgroundRequest): Promise<TasksBackgroundResponse>;
@@ -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,EAC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C,CAAC;IAM/B,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAIxB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GACA,mBAAmB,EAAE,CAkavB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC7C,GACA,mBAAmB,EAAE,CAgIvB;AAED;;;;;;;;;;;oEAWoE;AACpE,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAC3D,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;;;EA+DrC"}
package/dist/acp-agent.js CHANGED
@@ -42,7 +42,8 @@ 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
+ import { TASKS_CONTRACT_VERSION, TASKS_META_KEY, normaliseStatus, TailPoller, TaskFeed, TaskFeedPublisher, } from "./task-feed.js";
46
+ import { OutputUnavailable, outputPathFromBashResult, readOutput } from "./task-output.js";
46
47
  import { EscalationRegistry, GrantStore, createAskOperator, createGrantPreToolUseHook, createPermissionDeniedHook, } from "./classifier-escalation.js";
47
48
  export const CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
48
49
  const execFileAsync = promisify(execFile);
@@ -142,11 +143,15 @@ export const TASKS_STOP_METHOD = "_claude/tasks/stop";
142
143
  /** Move a foreground tool call's task to the background (story 012, R2.3).
143
144
  * Params {@link TasksBackgroundRequest}, result {@link TasksBackgroundResponse}. */
144
145
  export const TASKS_BACKGROUND_METHOD = "_claude/tasks/background";
145
- /** `agentCapabilities._meta` key advertising the task feed and its two
146
- * methods (R2.7). Zeo gates on this, never on the agent's name — the name is
146
+ /** Read the end of a task's output file (story 041, R2.1). Params
147
+ * {@link TasksOutputRequest}, result {@link TasksOutputResponse}. Version 2. */
148
+ export const TASKS_OUTPUT_METHOD = "_claude/tasks/output";
149
+ /** `agentCapabilities._meta` key advertising the task feed and its methods
150
+ * (R2.7). Zeo gates on this, never on the agent's name — the name is
147
151
  * `package.json`'s, and differs between this fork and the published mirror. */
148
152
  export const TASKS_CAPABILITY_KEY = TASKS_META_KEY;
149
- export const TASKS_CAPABILITY_VERSION = 1;
153
+ /** Version 2 (story 041) adds `hasOutput`, `tail` and `_claude/tasks/output`. */
154
+ export const TASKS_CAPABILITY_VERSION = TASKS_CONTRACT_VERSION;
150
155
  /** The SDK's own text for a rejected control request, passed through to the
151
156
  * client as the internal error's message (R2.4). */
152
157
  function errorMessage(error) {
@@ -171,6 +176,18 @@ export function parseTasksStopRequest(params) {
171
176
  taskId: requireIdField(params, TASKS_STOP_METHOD, "taskId"),
172
177
  };
173
178
  }
179
+ /** Validate raw JSON-RPC params into a {@link TasksOutputRequest}. Extra keys —
180
+ * a `path` included — are ignored: only a file the adapter recorded is read
181
+ * (R2.5). */
182
+ export function parseTasksOutputRequest(params) {
183
+ const sessionId = requireIdField(params, TASKS_OUTPUT_METHOD, "sessionId");
184
+ const taskId = requireIdField(params, TASKS_OUTPUT_METHOD, "taskId");
185
+ const maxBytes = params && typeof params === "object" ? params.maxBytes : undefined;
186
+ if (typeof maxBytes !== "number" || !Number.isSafeInteger(maxBytes) || maxBytes <= 0) {
187
+ throw RequestError.invalidParams(undefined, `${TASKS_OUTPUT_METHOD} params require maxBytes, a positive integer`);
188
+ }
189
+ return { sessionId, taskId, maxBytes };
190
+ }
174
191
  /** Validate raw JSON-RPC params into a {@link TasksBackgroundRequest}. */
175
192
  export function parseTasksBackgroundRequest(params) {
176
193
  return {
@@ -1520,6 +1537,39 @@ export class ClaudeAcpAgent {
1520
1537
  return {};
1521
1538
  });
1522
1539
  }
1540
+ /**
1541
+ * `_claude/tasks/output`: the end of a task's output file (story 041, R2.1–R2.7).
1542
+ * Serves only a path the feed recorded for its own task, and works on an
1543
+ * ended session too, as long as the session object exists. One log line,
1544
+ * never the content.
1545
+ */
1546
+ async taskOutput(params) {
1547
+ const { sessionId, taskId, maxBytes } = params;
1548
+ const log = (outcome, detail) => this.logger.log(`[tasks/output] method=${TASKS_OUTPUT_METHOD} sessionId=${logValue(sessionId)} taskId=${logValue(taskId)} ${detail} outcome=${outcome}`);
1549
+ const refuse = (error, reason) => {
1550
+ log("error", `reason=${logValue(reason)}`);
1551
+ throw error;
1552
+ };
1553
+ const session = Object.hasOwn(this.sessions, sessionId) ? this.sessions[sessionId] : undefined;
1554
+ if (!session) {
1555
+ return refuse(RequestError.invalidParams(undefined, `unknown session ${sessionId}`), "unknown_session");
1556
+ }
1557
+ const path = session.taskFeed?.outputPathFor(taskId) ?? null;
1558
+ if (path === null) {
1559
+ return refuse(RequestError.invalidParams(undefined, `task ${taskId} has no recorded output`), "no_recorded_output");
1560
+ }
1561
+ try {
1562
+ const result = await readOutput(path, maxBytes);
1563
+ log("ok", `bytes=${Buffer.byteLength(result.content, "utf8")} truncated=${result.truncated}`);
1564
+ return result;
1565
+ }
1566
+ catch (error) {
1567
+ if (error instanceof OutputUnavailable) {
1568
+ return refuse(RequestError.internalError(undefined, `output of task ${taskId} is no longer available (${error.code})`), error.code);
1569
+ }
1570
+ return refuse(RequestError.internalError(undefined, logValue(errorMessage(error))), "unexpected");
1571
+ }
1572
+ }
1523
1573
  /** `_claude/tasks/background`: background the task a foreground tool call
1524
1574
  * started (R2.3, R2.4). `false` means the id matched no foreground task. */
1525
1575
  async backgroundTask(params) {
@@ -3114,7 +3164,14 @@ export class ClaudeAcpAgent {
3114
3164
  // The task settled — no further tool calls can originate
3115
3165
  // from it, so its registry entry can be dropped.
3116
3166
  session.liveBackgroundTasks.delete(message.task_id);
3117
- session.taskFeedPublisher?.notify(session.taskFeed.onNotification(message));
3167
+ if (session.taskFeed && session.taskFeedPublisher) {
3168
+ const readable = await endingOutputReadable(session, message.task_id, message.output_file);
3169
+ const change = session.taskFeed.onNotification(message);
3170
+ if (change === "terminal" && readable !== null) {
3171
+ session.taskFeed.setTail(message.task_id, null, readable);
3172
+ }
3173
+ session.taskFeedPublisher.notify(change);
3174
+ }
3118
3175
  break;
3119
3176
  case "task_updated":
3120
3177
  // terminal-status task_updated patch and a (deduplicated)
@@ -3127,7 +3184,19 @@ export class ClaudeAcpAgent {
3127
3184
  message.patch.status === "killed") {
3128
3185
  session.liveBackgroundTasks.delete(message.task_id);
3129
3186
  }
3130
- session.taskFeedPublisher?.notify(session.taskFeed.onUpdated(message));
3187
+ if (session.taskFeed && session.taskFeedPublisher) {
3188
+ // The CLI queues the terminal patch BEFORE the
3189
+ // task_notification, so this is usually where a shell ends
3190
+ // and its output check has to happen (story 041, R1.7).
3191
+ const readable = normaliseStatus(message.patch.status) !== null
3192
+ ? await endingOutputReadable(session, message.task_id)
3193
+ : null;
3194
+ const change = session.taskFeed.onUpdated(message);
3195
+ if (change === "terminal" && readable !== null) {
3196
+ session.taskFeed.setTail(message.task_id, null, readable);
3197
+ }
3198
+ session.taskFeedPublisher.notify(change);
3199
+ }
3131
3200
  break;
3132
3201
  case "worker_shutting_down":
3133
3202
  // Defer until stream end. The announcement is durable and may be
@@ -4249,6 +4318,9 @@ export class ClaudeAcpAgent {
4249
4318
  content = message.message.content;
4250
4319
  }
4251
4320
  const acceptedPlanToolUseId = observeExitPlanToolResults(message, content, session);
4321
+ // Before toAcpNotifications, which prunes the tool_use cache entry
4322
+ // that says the result is a Bash call's.
4323
+ observeBackgroundBashResult(message, content, session);
4252
4324
  for (const notification of toAcpNotifications(content, message.message.role, params.sessionId, session.toolUseCache, this.client, this.logger, {
4253
4325
  clientCapabilities: this.clientCapabilities,
4254
4326
  parentToolUseId: message.parent_tool_use_id,
@@ -4764,6 +4836,9 @@ export class ClaudeAcpAgent {
4764
4836
  * query recreate is the one exit that keeps the feed, and does not come
4765
4837
  * through here. */
4766
4838
  retireTaskFeed(session) {
4839
+ // Before the publisher: a tick landing after the flush would publish a
4840
+ // tail into a feed whose session is gone (story 041).
4841
+ session.tailPoller?.dispose();
4767
4842
  const publisher = session.taskFeedPublisher;
4768
4843
  if (!publisher)
4769
4844
  return;
@@ -4783,7 +4858,8 @@ export class ClaudeAcpAgent {
4783
4858
  sessionId,
4784
4859
  update: { sessionUpdate: "session_info_update", _meta: { [TASKS_META_KEY]: snapshot } },
4785
4860
  }), undefined, (error) => this.logger.error(`[tasks/feed] sessionId=${logValue(sessionId)} outcome=send_failed reason=${logValue(errorMessage(error))}`));
4786
- return { taskFeed, taskFeedPublisher };
4861
+ const tailPoller = new TailPoller(taskFeed, taskFeedPublisher, undefined, undefined, (line) => this.logger.log(line), sessionId);
4862
+ return { taskFeed, taskFeedPublisher, tailPoller };
4787
4863
  }
4788
4864
  /** Cleanly tear down a session: cancel in-flight work, release stream
4789
4865
  * resources, and remove it from the session map. */
@@ -8646,6 +8722,7 @@ export function runAcp(logger) {
8646
8722
  .onNotification(methods.agent.session.cancel, (ctx) => agent.cancel(ctx.params))
8647
8723
  .onRequest(STEER_METHOD, { parse: parseSteerRequest }, (ctx) => agent.steer(ctx.params))
8648
8724
  .onRequest(TASKS_STOP_METHOD, { parse: parseTasksStopRequest }, (ctx) => agent.stopTask(ctx.params))
8725
+ .onRequest(TASKS_OUTPUT_METHOD, { parse: parseTasksOutputRequest }, (ctx) => agent.taskOutput(ctx.params))
8649
8726
  .onRequest(TASKS_BACKGROUND_METHOD, { parse: parseTasksBackgroundRequest }, (ctx) => agent.backgroundTask(ctx.params))
8650
8727
  .onRequest(GOAL_CONTROL_METHOD, { parse: parseGoalRequest }, (ctx) => agent.goal(ctx.params))
8651
8728
  .connect(stream);
@@ -8821,3 +8898,58 @@ function getMatchingModelUsage(modelUsage, currentModel) {
8821
8898
  return { key: bestKey, usage: modelUsage[bestKey] };
8822
8899
  }
8823
8900
  }
8901
+ /**
8902
+ * Story 041 (R1.1, R1.6): a backgrounded Bash call's result names the file the
8903
+ * CLI writes its output to. When the structured `BashOutput` carries
8904
+ * `backgroundTaskId` and the text names exactly `<that id>.output` by an
8905
+ * absolute path, the path is recorded for the task's tail. Anything else
8906
+ * records nothing, so the task gets no tail. The rendered tool content is not
8907
+ * touched.
8908
+ */
8909
+ function observeBackgroundBashResult(message, content, session) {
8910
+ if (message.type !== "user" || !session.taskFeed || !Array.isArray(content))
8911
+ return;
8912
+ const result = message.tool_use_result;
8913
+ if (typeof result !== "object" || result === null || !("backgroundTaskId" in result))
8914
+ return;
8915
+ const taskId = result.backgroundTaskId;
8916
+ if (typeof taskId !== "string" || taskId === "")
8917
+ return;
8918
+ const blocks = content.filter((c) => typeof c === "object" && c !== null && c.type === "tool_result");
8919
+ // `tool_use_result` describes "the" tool_result of its message: only one.
8920
+ if (blocks.length !== 1)
8921
+ return;
8922
+ const [block] = blocks;
8923
+ if (session.toolUseCache[block.tool_use_id]?.name !== "Bash")
8924
+ return;
8925
+ const text = typeof block.content === "string"
8926
+ ? block.content
8927
+ : Array.isArray(block.content)
8928
+ ? block.content
8929
+ .filter((c) => typeof c === "object" &&
8930
+ c !== null &&
8931
+ c.type === "text" &&
8932
+ typeof c.text === "string")
8933
+ .map((c) => c.text)
8934
+ .join("\n")
8935
+ : "";
8936
+ const path = outputPathFromBashResult(text, taskId);
8937
+ if (path === null)
8938
+ return;
8939
+ session.taskFeedPublisher?.notify(session.taskFeed.onOutputPath(taskId, path));
8940
+ session.tailPoller?.kick();
8941
+ }
8942
+ /**
8943
+ * Story 041 (R1.7): whether an ending shell task's output file reads, checked
8944
+ * BEFORE the ending is folded into the feed — once the feed holds the ending,
8945
+ * any publish (a throttled trailer, a poller tick) could send it while the
8946
+ * check is still pending, and with `hasOutput: false`. Returns null without
8947
+ * awaiting anything when there is no file to check, so every other ending
8948
+ * keeps its synchronous place in the SDK message loop.
8949
+ */
8950
+ async function endingOutputReadable(session, taskId, outputFile) {
8951
+ const path = session.taskFeed?.endingOutputPath(taskId, outputFile) ?? null;
8952
+ if (path === null || !session.tailPoller)
8953
+ return null;
8954
+ return session.tailPoller.checkOutput(path);
8955
+ }
@@ -27,10 +27,21 @@
27
27
  *
28
28
  * Neither class ever copies a command line (`SDKTaskStartedMessage.prompt`)
29
29
  * into an entry or a log line.
30
+ *
31
+ * Version 2 (story 041) adds `hasOutput` and `tail`. A shell task's output
32
+ * path — named by the Bash result while it runs, by `task_notification` when
33
+ * it ends — is kept beside the table, never on the wire. Once an ended shell
34
+ * task leaves the table, its path moves to a bounded registry so
35
+ * `_claude/tasks/output` can still serve it.
30
36
  */
31
37
  import type { SDKTaskNotificationMessage, SDKTaskProgressMessage, SDKTaskStartedMessage, SDKTaskUpdatedMessage } from "@anthropic-ai/claude-agent-sdk";
32
38
  /** The `session_info_update._meta` key the snapshot is published under. */
33
39
  export declare const TASKS_META_KEY = "_claude/tasks";
40
+ /** The `_claude/tasks` contract version advertised at `initialize`. Version 2
41
+ * adds `hasOutput`, `tail` and `_claude/tasks/output`. */
42
+ export declare const TASKS_CONTRACT_VERSION = 2;
43
+ /** Ended shell outputs still servable per session, most recent kept. */
44
+ export declare const ENDED_OUTPUTS_MAX = 256;
34
45
  export type TaskStatus = "running" | "completed" | "failed" | "stopped" | "interrupted";
35
46
  export type TaskUsage = {
36
47
  tokens: number;
@@ -51,6 +62,10 @@ export type TaskEntry = {
51
62
  usage: TaskUsage | null;
52
63
  lastTool: string | null;
53
64
  summary: string | null;
65
+ /** True when `_claude/tasks/output` can serve this task (version 2). */
66
+ hasOutput: boolean;
67
+ /** A running shell's last lines, sanitized; null otherwise (version 2). */
68
+ tail: string[] | null;
54
69
  };
55
70
  export type TasksSnapshot = {
56
71
  tasks: TaskEntry[];
@@ -97,6 +112,10 @@ export declare class TaskFeed {
97
112
  private readonly held;
98
113
  /** Shell task ids labelled by their tool call: a patch never relabels them. */
99
114
  private readonly toolDescribed;
115
+ /** Shell task id → its output file, while the task is in the table. */
116
+ private readonly outputs;
117
+ /** Ended shell outputs that left the table, oldest first; see `ENDED_OUTPUTS_MAX`. */
118
+ private readonly endedOutputs;
100
119
  constructor(clock: () => number, log?: TaskFeedLog, sessionId?: string);
101
120
  /**
102
121
  * `toolDescription` is the spawning tool call's own `description` input. A
@@ -126,6 +145,33 @@ export declare class TaskFeed {
126
145
  /** The CLI process restarted: whatever was running did not survive it. A
127
146
  * held shell task was never shown, so it is dropped rather than ended. */
128
147
  onProcessRestart(): TaskChange;
148
+ /**
149
+ * Records the output file a Bash result named for a known shell task. Any
150
+ * other task, or an unknown id, is ignored: only a shell writes an output
151
+ * file, and only one the adapter recorded is ever read (R2.5).
152
+ */
153
+ onOutputPath(taskId: string, path: string): TaskChange;
154
+ /**
155
+ * Sets a shell task's tail and whether its output reads. A running task
156
+ * keeps `lines`; an ended one keeps none, so this only confirms its output.
157
+ * Returns `"none"` when nothing changed, so an idle file publishes nothing.
158
+ */
159
+ setTail(taskId: string, lines: string[] | null, readable: boolean): TaskChange;
160
+ /**
161
+ * The file the ending's existence check reads (R1.7), or null when there is
162
+ * nothing to check: `taskId` must be a running shell in the table. A non-empty
163
+ * `output_file` from the ending (the CLI's own) wins over the path the Bash result named.
164
+ * The caller checks BEFORE folding the ending in, so the snapshot that
165
+ * carries the ending already says whether the output can be served.
166
+ */
167
+ endingOutputPath(taskId: string, outputFile?: string): string | null;
168
+ /** Running shell tasks with a recorded output file: the tail poller's work. */
169
+ runningOutputs(): {
170
+ taskId: string;
171
+ path: string;
172
+ }[];
173
+ /** The output file `_claude/tasks/output` may read for `taskId`, or null. */
174
+ outputPathFor(taskId: string): string | null;
129
175
  /** True when the feed holds `taskId` as running — the stop request's gate. */
130
176
  isRunning(taskId: string): boolean;
131
177
  /** Running tasks plus ended tasks not yet published, oldest start first.
@@ -148,6 +194,8 @@ export declare class TaskFeed {
148
194
  * the tool call is never replaced. */
149
195
  private patch;
150
196
  private end;
197
+ /** Moves a task that left the table to the ended registry, newest last. */
198
+ private retireOutput;
151
199
  }
152
200
  export type PublisherTimers = {
153
201
  now: () => number;
@@ -192,4 +240,47 @@ export declare class TaskFeedPublisher {
192
240
  private armHold;
193
241
  private armReconcile;
194
242
  }
243
+ /** The longest the ending's existence check may hold the SDK message loop. */
244
+ export declare const ENDING_CHECK_TIMEOUT_MS = 2000;
245
+ /** How often the tail poller looks at running shells' output files (R1.4). */
246
+ export declare const TAIL_POLL_INTERVAL_MS = 1000;
247
+ export type PollerTimers = {
248
+ setInterval: (fn: () => void, ms: number) => unknown;
249
+ clearInterval: (handle: any) => void;
250
+ };
251
+ /**
252
+ * Publishes a running shell task's tail (story 041, R1.4, R1.5). One interval
253
+ * while any shell output is known; each tick `stat`s every file and reads the
254
+ * tail only when its size changed, shrinking included. A read error publishes
255
+ * `tail: null, hasOutput: false` and logs once per task until the file reads
256
+ * again. A tick never overlaps the previous one, and no rejection escapes it:
257
+ * the interval runs outside every caller that could handle one, and Node exits
258
+ * on an unhandled rejection.
259
+ */
260
+ export declare class TailPoller {
261
+ private readonly feed;
262
+ private readonly publisher;
263
+ private readonly timers;
264
+ private readonly readTailFn;
265
+ private readonly log;
266
+ private readonly sessionId;
267
+ private interval;
268
+ private busy;
269
+ private closed;
270
+ /** task id → the file size the last published tail was read at. */
271
+ private readonly sizes;
272
+ /** Task ids whose file failed to read: logged once, until it reads again. */
273
+ private readonly failing;
274
+ constructor(feed: TaskFeed, publisher: TaskFeedPublisher, timers?: PollerTimers, readTailFn?: (path: string) => Promise<string[]>, log?: (line: string) => void, sessionId?: string);
275
+ /** Arms the interval when there is output to watch. Called after a path is recorded. */
276
+ kick(): void;
277
+ /**
278
+ * The ending's existence check (R1.7): true when `path` reads as a regular
279
+ * file within `ENDING_CHECK_TIMEOUT_MS`. Never rejects.
280
+ */
281
+ checkOutput(path: string): Promise<boolean>;
282
+ dispose(): void;
283
+ private stop;
284
+ private tick;
285
+ }
195
286
  //# sourceMappingURL=task-feed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-feed.d.ts","sourceRoot":"","sources":["../src/task-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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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S;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAd5B,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;gBAG1B,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,iBAAiB,EAC5B,MAAM,GAAE,YAA+B,EACvC,UAAU,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAY,EAC1D,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAe,EACtC,SAAS,SAAK;IAGjC,wFAAwF;IACxF,IAAI,IAAI,IAAI;IAMZ;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkBjD,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,IAAI;YAKE,IAAI;CA0CnB"}
package/dist/task-feed.js CHANGED
@@ -27,9 +27,22 @@
27
27
  *
28
28
  * Neither class ever copies a command line (`SDKTaskStartedMessage.prompt`)
29
29
  * into an entry or a log line.
30
+ *
31
+ * Version 2 (story 041) adds `hasOutput` and `tail`. A shell task's output
32
+ * path — named by the Bash result while it runs, by `task_notification` when
33
+ * it ends — is kept beside the table, never on the wire. Once an ended shell
34
+ * task leaves the table, its path moves to a bounded registry so
35
+ * `_claude/tasks/output` can still serve it.
30
36
  */
37
+ import { stat } from "node:fs/promises";
38
+ import { readTail } from "./task-output.js";
31
39
  /** The `session_info_update._meta` key the snapshot is published under. */
32
40
  export const TASKS_META_KEY = "_claude/tasks";
41
+ /** The `_claude/tasks` contract version advertised at `initialize`. Version 2
42
+ * adds `hasOutput`, `tail` and `_claude/tasks/output`. */
43
+ export const TASKS_CONTRACT_VERSION = 2;
44
+ /** Ended shell outputs still servable per session, most recent kept. */
45
+ export const ENDED_OUTPUTS_MAX = 256;
33
46
  /** How long a foreground shell task is held back before it is published. */
34
47
  export const FOREGROUND_SHELL_HOLD_MS = 5000;
35
48
  /** How long a running background task may be missing from the level before
@@ -104,6 +117,10 @@ export class TaskFeed {
104
117
  held = new Map();
105
118
  /** Shell task ids labelled by their tool call: a patch never relabels them. */
106
119
  toolDescribed = new Set();
120
+ /** Shell task id → its output file, while the task is in the table. */
121
+ outputs = new Map();
122
+ /** Ended shell outputs that left the table, oldest first; see `ENDED_OUTPUTS_MAX`. */
123
+ endedOutputs = new Map();
107
124
  constructor(clock, log = {}, sessionId = "") {
108
125
  this.clock = clock;
109
126
  this.log = log;
@@ -141,6 +158,8 @@ export class TaskFeed {
141
158
  usage: null,
142
159
  lastTool: null,
143
160
  summary: null,
161
+ hasOutput: false,
162
+ tail: null,
144
163
  };
145
164
  if (shell && msg.is_backgrounded !== true) {
146
165
  this.held.set(msg.task_id, entry);
@@ -194,6 +213,7 @@ export class TaskFeed {
194
213
  else {
195
214
  if (normaliseStatus(msg.patch.status)) {
196
215
  this.held.delete(msg.task_id);
216
+ this.outputs.delete(msg.task_id);
197
217
  }
198
218
  else {
199
219
  this.patch(heldEntry, msg.patch);
@@ -214,14 +234,19 @@ export class TaskFeed {
214
234
  }
215
235
  onNotification(msg) {
216
236
  // A held shell task that ends was never shown: its ending is not news.
217
- if (this.held.delete(msg.task_id))
237
+ if (this.held.delete(msg.task_id)) {
238
+ this.outputs.delete(msg.task_id);
218
239
  return "none";
240
+ }
219
241
  const task = this.running(msg.task_id, "task_notification");
220
242
  if (!task)
221
243
  return "none";
222
244
  const ending = normaliseStatus(msg.status, msg.reason) ?? "completed";
223
245
  if (msg.summary)
224
246
  task.summary = msg.summary;
247
+ if (task.type === "shell" && typeof msg.output_file === "string" && msg.output_file !== "") {
248
+ this.outputs.set(task.id, msg.output_file);
249
+ }
225
250
  const usage = usageOf(msg.usage);
226
251
  if (usage)
227
252
  task.usage = usage;
@@ -273,6 +298,8 @@ export class TaskFeed {
273
298
  /** The CLI process restarted: whatever was running did not survive it. A
274
299
  * held shell task was never shown, so it is dropped rather than ended. */
275
300
  onProcessRestart() {
301
+ for (const id of this.held.keys())
302
+ this.outputs.delete(id);
276
303
  this.held.clear();
277
304
  let change = "none";
278
305
  for (const task of this.tasks.values()) {
@@ -283,6 +310,69 @@ export class TaskFeed {
283
310
  }
284
311
  return change;
285
312
  }
313
+ /**
314
+ * Records the output file a Bash result named for a known shell task. Any
315
+ * other task, or an unknown id, is ignored: only a shell writes an output
316
+ * file, and only one the adapter recorded is ever read (R2.5).
317
+ */
318
+ onOutputPath(taskId, path) {
319
+ const task = this.tasks.get(taskId) ?? this.held.get(taskId);
320
+ if (!task || task.type !== "shell" || task.status !== "running") {
321
+ this.log.debug?.(`[tasks/feed] sessionId=${this.sessionId} taskId=${taskId} ignored=output_path`);
322
+ return "none";
323
+ }
324
+ this.outputs.set(taskId, path);
325
+ return "progress";
326
+ }
327
+ /**
328
+ * Sets a shell task's tail and whether its output reads. A running task
329
+ * keeps `lines`; an ended one keeps none, so this only confirms its output.
330
+ * Returns `"none"` when nothing changed, so an idle file publishes nothing.
331
+ */
332
+ setTail(taskId, lines, readable) {
333
+ const task = this.tasks.get(taskId);
334
+ if (!task || task.type !== "shell")
335
+ return "none";
336
+ // An ended task's output is decided by the ending's check alone: a poller
337
+ // tick that started before the ending and failed after it must not undo it.
338
+ if (task.status !== "running" && !readable)
339
+ return "none";
340
+ const tail = task.status === "running" && readable ? lines : null;
341
+ if (task.hasOutput === readable && sameLines(task.tail, tail))
342
+ return "none";
343
+ task.hasOutput = readable;
344
+ task.tail = tail === null ? null : [...tail];
345
+ return "progress";
346
+ }
347
+ /**
348
+ * The file the ending's existence check reads (R1.7), or null when there is
349
+ * nothing to check: `taskId` must be a running shell in the table. A non-empty
350
+ * `output_file` from the ending (the CLI's own) wins over the path the Bash result named.
351
+ * The caller checks BEFORE folding the ending in, so the snapshot that
352
+ * carries the ending already says whether the output can be served.
353
+ */
354
+ endingOutputPath(taskId, outputFile) {
355
+ const task = this.tasks.get(taskId);
356
+ if (!task || task.type !== "shell" || task.status !== "running")
357
+ return null;
358
+ if (typeof outputFile === "string" && outputFile !== "")
359
+ return outputFile;
360
+ return this.outputs.get(taskId) ?? null;
361
+ }
362
+ /** Running shell tasks with a recorded output file: the tail poller's work. */
363
+ runningOutputs() {
364
+ const work = [];
365
+ for (const [taskId, path] of this.outputs) {
366
+ const task = this.tasks.get(taskId);
367
+ if (task?.status === "running" && task.type === "shell")
368
+ work.push({ taskId, path });
369
+ }
370
+ return work;
371
+ }
372
+ /** The output file `_claude/tasks/output` may read for `taskId`, or null. */
373
+ outputPathFor(taskId) {
374
+ return this.outputs.get(taskId) ?? this.endedOutputs.get(taskId) ?? null;
375
+ }
286
376
  /** True when the feed holds `taskId` as running — the stop request's gate. */
287
377
  isRunning(taskId) {
288
378
  return this.tasks.get(taskId)?.status === "running";
@@ -293,7 +383,11 @@ export class TaskFeed {
293
383
  const tasks = [...this.tasks.values()]
294
384
  .filter((t) => t.status === "running" || !this.published.has(t.id))
295
385
  .sort((a, b) => a.startedAt - b.startedAt)
296
- .map((t) => ({ ...t, usage: t.usage ? { ...t.usage } : null }));
386
+ .map((t) => ({
387
+ ...t,
388
+ usage: t.usage ? { ...t.usage } : null,
389
+ tail: t.tail ? [...t.tail] : null,
390
+ }));
297
391
  const endedIds = tasks.filter((t) => t.status !== "running").map((t) => t.id);
298
392
  for (const id of endedIds)
299
393
  this.snapshotLives.set(id, this.lives.get(id) ?? 0);
@@ -312,6 +406,7 @@ export class TaskFeed {
312
406
  this.snapshotLives.delete(id);
313
407
  this.published.add(id);
314
408
  this.tasks.delete(id);
409
+ this.retireOutput(id);
315
410
  }
316
411
  }
317
412
  running(taskId, kind) {
@@ -329,6 +424,12 @@ export class TaskFeed {
329
424
  * state supersedes an ending the client has not seen yet, and a published
330
425
  * id must be shown again. */
331
426
  admit(entry) {
427
+ // A new life writes a new file: the previous life's is not this one's. A
428
+ // held shell being promoted is the same life, and keeps the path it has.
429
+ if (this.tasks.has(entry.id) || this.published.has(entry.id)) {
430
+ this.outputs.delete(entry.id);
431
+ this.endedOutputs.delete(entry.id);
432
+ }
332
433
  this.published.delete(entry.id);
333
434
  this.lives.set(entry.id, (this.lives.get(entry.id) ?? 0) + 1);
334
435
  this.tasks.set(entry.id, entry);
@@ -345,8 +446,32 @@ export class TaskFeed {
345
446
  end(task, status, at = this.clock()) {
346
447
  task.status = status;
347
448
  task.endedAt = at;
449
+ // An ended task has no tail, and its output is claimed again only once the
450
+ // file was checked (R1.7).
451
+ task.tail = null;
452
+ task.hasOutput = false;
348
453
  this.deadlines.delete(task.id);
349
454
  }
455
+ /** Moves a task that left the table to the ended registry, newest last. */
456
+ retireOutput(taskId) {
457
+ const path = this.outputs.get(taskId);
458
+ this.outputs.delete(taskId);
459
+ if (path === undefined)
460
+ return;
461
+ this.endedOutputs.delete(taskId);
462
+ this.endedOutputs.set(taskId, path);
463
+ while (this.endedOutputs.size > ENDED_OUTPUTS_MAX) {
464
+ const oldest = this.endedOutputs.keys().next().value;
465
+ if (oldest === undefined)
466
+ break;
467
+ this.endedOutputs.delete(oldest);
468
+ }
469
+ }
470
+ }
471
+ function sameLines(a, b) {
472
+ if (a === null || b === null)
473
+ return a === b;
474
+ return a.length === b.length && a.every((line, i) => line === b[i]);
350
475
  }
351
476
  const realTimers = {
352
477
  now: () => Date.now(),
@@ -528,3 +653,136 @@ export class TaskFeedPublisher {
528
653
  }, Math.max(0, at - this.timers.now()));
529
654
  }
530
655
  }
656
+ /** The longest the ending's existence check may hold the SDK message loop. */
657
+ export const ENDING_CHECK_TIMEOUT_MS = 2_000;
658
+ /** How often the tail poller looks at running shells' output files (R1.4). */
659
+ export const TAIL_POLL_INTERVAL_MS = 1_000;
660
+ const realPollerTimers = {
661
+ setInterval: (fn, ms) => setInterval(fn, ms),
662
+ clearInterval: (handle) => clearInterval(handle),
663
+ };
664
+ /** A log field value with no whitespace or `=` to forge a second field. */
665
+ function field(value) {
666
+ return value.replace(/[\s=]+/g, "_");
667
+ }
668
+ function codeOf(error) {
669
+ return typeof error === "object" &&
670
+ error !== null &&
671
+ "code" in error &&
672
+ typeof error.code === "string"
673
+ ? error.code
674
+ : "unknown";
675
+ }
676
+ /**
677
+ * Publishes a running shell task's tail (story 041, R1.4, R1.5). One interval
678
+ * while any shell output is known; each tick `stat`s every file and reads the
679
+ * tail only when its size changed, shrinking included. A read error publishes
680
+ * `tail: null, hasOutput: false` and logs once per task until the file reads
681
+ * again. A tick never overlaps the previous one, and no rejection escapes it:
682
+ * the interval runs outside every caller that could handle one, and Node exits
683
+ * on an unhandled rejection.
684
+ */
685
+ export class TailPoller {
686
+ feed;
687
+ publisher;
688
+ timers;
689
+ readTailFn;
690
+ log;
691
+ sessionId;
692
+ interval = null;
693
+ busy = false;
694
+ closed = false;
695
+ /** task id → the file size the last published tail was read at. */
696
+ sizes = new Map();
697
+ /** Task ids whose file failed to read: logged once, until it reads again. */
698
+ failing = new Set();
699
+ constructor(feed, publisher, timers = realPollerTimers, readTailFn = readTail, log = () => { }, sessionId = "") {
700
+ this.feed = feed;
701
+ this.publisher = publisher;
702
+ this.timers = timers;
703
+ this.readTailFn = readTailFn;
704
+ this.log = log;
705
+ this.sessionId = sessionId;
706
+ }
707
+ /** Arms the interval when there is output to watch. Called after a path is recorded. */
708
+ kick() {
709
+ if (this.closed || this.interval !== null)
710
+ return;
711
+ if (this.feed.runningOutputs().length === 0)
712
+ return;
713
+ this.interval = this.timers.setInterval(() => void this.tick(), TAIL_POLL_INTERVAL_MS);
714
+ }
715
+ /**
716
+ * The ending's existence check (R1.7): true when `path` reads as a regular
717
+ * file within `ENDING_CHECK_TIMEOUT_MS`. Never rejects.
718
+ */
719
+ async checkOutput(path) {
720
+ let timer;
721
+ const timeout = new Promise((resolve) => {
722
+ timer = setTimeout(() => resolve(false), ENDING_CHECK_TIMEOUT_MS);
723
+ });
724
+ try {
725
+ return await Promise.race([
726
+ this.readTailFn(path).then(() => true, () => false),
727
+ timeout,
728
+ ]);
729
+ }
730
+ finally {
731
+ clearTimeout(timer);
732
+ }
733
+ }
734
+ dispose() {
735
+ this.closed = true;
736
+ this.stop();
737
+ }
738
+ stop() {
739
+ if (this.interval !== null)
740
+ this.timers.clearInterval(this.interval);
741
+ this.interval = null;
742
+ }
743
+ async tick() {
744
+ if (this.busy || this.closed)
745
+ return;
746
+ this.busy = true;
747
+ try {
748
+ const work = this.feed.runningOutputs();
749
+ if (work.length === 0) {
750
+ this.stop();
751
+ this.sizes.clear();
752
+ this.failing.clear();
753
+ return;
754
+ }
755
+ for (const { taskId, path } of work) {
756
+ if (this.closed)
757
+ return;
758
+ let lines = null;
759
+ let readable = false;
760
+ try {
761
+ const size = (await stat(path)).size;
762
+ if (this.sizes.get(taskId) === size)
763
+ continue;
764
+ lines = await this.readTailFn(path);
765
+ this.sizes.set(taskId, size);
766
+ this.failing.delete(taskId);
767
+ readable = true;
768
+ }
769
+ catch (error) {
770
+ this.sizes.delete(taskId);
771
+ if (!this.failing.has(taskId)) {
772
+ this.failing.add(taskId);
773
+ this.log(`[tasks/tail] level=warn sessionId=${field(this.sessionId)} taskId=${field(taskId)} code=${field(codeOf(error))}`);
774
+ }
775
+ }
776
+ if (this.closed)
777
+ return;
778
+ this.publisher.notify(this.feed.setTail(taskId, lines, readable));
779
+ }
780
+ }
781
+ catch (error) {
782
+ this.log(`[tasks/tail] level=warn sessionId=${field(this.sessionId)} outcome=tick_failed code=${field(codeOf(error))}`);
783
+ }
784
+ finally {
785
+ this.busy = false;
786
+ }
787
+ }
788
+ }
@@ -0,0 +1,32 @@
1
+ /** The most `_claude/tasks/output` ever serves, whatever the client asks for (R2.3). */
2
+ export declare const OUTPUT_MAX_BYTES = 1048576;
3
+ /** Lines kept in a running task's `tail` (R1.2). */
4
+ export declare const TAIL_MAX_LINES = 10;
5
+ /** Code points kept per tail line; a longer line ends in `…` (R1.3). */
6
+ export declare const TAIL_MAX_CHARS = 240;
7
+ /** Bytes read from the end of the file to build a tail. */
8
+ export declare const TAIL_READ_BYTES = 16384;
9
+ /** A file that could not be read. `code` is the fs code, or `not_regular`. */
10
+ export declare class OutputUnavailable extends Error {
11
+ readonly code: string;
12
+ constructor(code: string);
13
+ }
14
+ /** The end of `file`, at most `min(maxBytes, OUTPUT_MAX_BYTES)` bytes (R2.1, R2.3). */
15
+ export declare function readOutput(file: string, maxBytes: number): Promise<{
16
+ content: string;
17
+ totalBytes: number;
18
+ truncated: boolean;
19
+ }>;
20
+ /** The last `TAIL_MAX_LINES` lines of `file`, sanitized (R1.2, R1.3). */
21
+ export declare function readTail(file: string): Promise<string[]>;
22
+ /** One tail line as a terminal would leave it, without escapes or controls (R1.3). */
23
+ export declare function sanitizeLine(line: string): string;
24
+ /**
25
+ * The output path a Bash result names for `taskId`, or null. Only an absolute, normalized path
26
+ * whose file name is exactly `<taskId>.output` is accepted (R1.6): anything else could be
27
+ * another task's file, or no task's.
28
+ */
29
+ export declare function outputPathFromBashResult(text: string, taskId: string): string | null;
30
+ /** True for an absolute, normalized path whose file name is exactly `<taskId>.output`. */
31
+ export declare function isOutputPathFor(candidate: string, taskId: string): boolean;
32
+ //# sourceMappingURL=task-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-output.d.ts","sourceRoot":"","sources":["../src/task-output.ts"],"names":[],"mappings":"AAgBA,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,UAAY,CAAC;AAC1C,oDAAoD;AACpD,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,wEAAwE;AACxE,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,2DAA2D;AAC3D,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC,8EAA8E;AAC9E,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM;CAKzB;AAwDD,uFAAuF;AACvF,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAMtE;AAED,yEAAyE;AACzE,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAK9D;AASD,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUjD;AAMD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpF;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAM1E"}
@@ -0,0 +1,135 @@
1
+ // Reading a shell task's output file — story 041.
2
+ //
3
+ // The CLI writes a background shell's output to `<task id>.output` and names that path in the
4
+ // Bash result. This module reads the end of such a file safely, for two consumers: the tail the
5
+ // task feed publishes while the task runs, and `_claude/tasks/output` after it ends.
6
+ //
7
+ // Safety rules, each one a test in `tests/task-output.test.ts`:
8
+ // - only a regular file is read, opened with `O_NOFOLLOW` so a symlink planted at the recorded
9
+ // path is refused (Node's flag covers only the last component, hence the `isFile()` check on
10
+ // the handle as well);
11
+ // - a cut lands on a line boundary, never inside a line or a UTF-8 sequence;
12
+ // - an error carries the fs code and never the file's content.
13
+ import { constants, open } from "node:fs/promises";
14
+ import path from "node:path";
15
+ /** The most `_claude/tasks/output` ever serves, whatever the client asks for (R2.3). */
16
+ export const OUTPUT_MAX_BYTES = 1_048_576;
17
+ /** Lines kept in a running task's `tail` (R1.2). */
18
+ export const TAIL_MAX_LINES = 10;
19
+ /** Code points kept per tail line; a longer line ends in `…` (R1.3). */
20
+ export const TAIL_MAX_CHARS = 240;
21
+ /** Bytes read from the end of the file to build a tail. */
22
+ export const TAIL_READ_BYTES = 16_384;
23
+ /** A file that could not be read. `code` is the fs code, or `not_regular`. */
24
+ export class OutputUnavailable extends Error {
25
+ code;
26
+ constructor(code) {
27
+ super(`task output unavailable (${code})`);
28
+ this.name = "OutputUnavailable";
29
+ this.code = code;
30
+ }
31
+ }
32
+ function unavailable(error) {
33
+ if (error instanceof OutputUnavailable)
34
+ return error;
35
+ const code = typeof error === "object" && error !== null && "code" in error && typeof error.code === "string"
36
+ ? error.code
37
+ : "unknown";
38
+ return new OutputUnavailable(code);
39
+ }
40
+ /**
41
+ * Reads the last `maxBytes` of `file`, cut on a line boundary. When the file is longer, one byte
42
+ * before the window is read too: everything up to and including the first `\n` is dropped, so a
43
+ * window that already starts on a line keeps that line. A window holding no `\n` is kept whole.
44
+ */
45
+ async function readWindow(file, maxBytes) {
46
+ let handle;
47
+ try {
48
+ // O_NONBLOCK: opening a FIFO for reading would otherwise wait for a writer
49
+ // forever; with it the open returns, and `isFile()` below refuses the FIFO.
50
+ handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
51
+ }
52
+ catch (error) {
53
+ throw unavailable(error);
54
+ }
55
+ try {
56
+ const stats = await handle.stat();
57
+ if (!stats.isFile())
58
+ throw new OutputUnavailable("not_regular");
59
+ const totalBytes = stats.size;
60
+ const truncated = totalBytes > maxBytes;
61
+ const start = truncated ? totalBytes - maxBytes - 1 : 0;
62
+ const length = totalBytes - start;
63
+ const buffer = Buffer.alloc(length);
64
+ let read = 0;
65
+ while (read < length) {
66
+ const { bytesRead } = await handle.read(buffer, read, length - read, start + read);
67
+ if (bytesRead === 0)
68
+ break; // the file shrank between fstat and read
69
+ read += bytesRead;
70
+ }
71
+ let bytes = buffer.subarray(0, read);
72
+ if (truncated) {
73
+ const newline = bytes.indexOf(0x0a);
74
+ bytes = newline === -1 ? bytes.subarray(1) : bytes.subarray(newline + 1);
75
+ }
76
+ return { bytes, totalBytes, truncated };
77
+ }
78
+ catch (error) {
79
+ throw unavailable(error);
80
+ }
81
+ finally {
82
+ await handle.close().catch(() => { });
83
+ }
84
+ }
85
+ const decode = (bytes) => new TextDecoder("utf-8", { fatal: false }).decode(bytes);
86
+ /** The end of `file`, at most `min(maxBytes, OUTPUT_MAX_BYTES)` bytes (R2.1, R2.3). */
87
+ export async function readOutput(file, maxBytes) {
88
+ const { bytes, totalBytes, truncated } = await readWindow(file, Math.min(maxBytes, OUTPUT_MAX_BYTES));
89
+ return { content: decode(bytes), totalBytes, truncated };
90
+ }
91
+ /** The last `TAIL_MAX_LINES` lines of `file`, sanitized (R1.2, R1.3). */
92
+ export async function readTail(file) {
93
+ const { bytes } = await readWindow(file, TAIL_READ_BYTES);
94
+ const lines = decode(bytes).split("\n");
95
+ if (lines.at(-1) === "")
96
+ lines.pop();
97
+ return lines.slice(-TAIL_MAX_LINES).map(sanitizeLine);
98
+ }
99
+ /* eslint-disable no-control-regex -- these patterns exist to match terminal control bytes */
100
+ const CSI = /\x1b\[[0-?]*[ -/]*[@-~]/g;
101
+ const OSC = /\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g;
102
+ const OTHER_ESCAPE = /\x1b[\s\S]?/g;
103
+ const CONTROL = /[\x00-\x08\x0b-\x1f\x7f]/g;
104
+ /* eslint-enable no-control-regex */
105
+ /** One tail line as a terminal would leave it, without escapes or controls (R1.3). */
106
+ export function sanitizeLine(line) {
107
+ const redrawn = line.slice(line.lastIndexOf("\r") + 1);
108
+ const clean = redrawn
109
+ .replace(OSC, "")
110
+ .replace(CSI, "")
111
+ .replace(OTHER_ESCAPE, "")
112
+ .replace(CONTROL, "");
113
+ const chars = [...clean];
114
+ if (chars.length <= TAIL_MAX_CHARS)
115
+ return clean;
116
+ return chars.slice(0, TAIL_MAX_CHARS - 1).join("") + "…";
117
+ }
118
+ // The CLI ends the sentence with a period (2.1.285: "…/tasks/<id>.output."), so
119
+ // one trailing punctuation mark is not part of the path.
120
+ const OUTPUT_NOTICE = /Output is being written to: (\S+?)[.,;:]?(?:\s|$)/;
121
+ /**
122
+ * The output path a Bash result names for `taskId`, or null. Only an absolute, normalized path
123
+ * whose file name is exactly `<taskId>.output` is accepted (R1.6): anything else could be
124
+ * another task's file, or no task's.
125
+ */
126
+ export function outputPathFromBashResult(text, taskId) {
127
+ const candidate = text.match(OUTPUT_NOTICE)?.[1];
128
+ return candidate !== undefined && isOutputPathFor(candidate, taskId) ? candidate : null;
129
+ }
130
+ /** True for an absolute, normalized path whose file name is exactly `<taskId>.output`. */
131
+ export function isOutputPathFor(candidate, taskId) {
132
+ return (path.isAbsolute(candidate) &&
133
+ path.normalize(candidate) === candidate &&
134
+ path.basename(candidate) === `${taskId}.output`);
135
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.25.3",
6
+ "version": "0.26.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",