@agentclientprotocol/claude-agent-acp 0.113.0 → 0.113.1-preview.10
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 +5 -3
- package/dist/async-tasks.d.ts +27 -0
- package/dist/async-tasks.d.ts.map +1 -1
- package/dist/async-tasks.js +36 -0
- package/dist/claude-cli.d.ts +22 -16
- package/dist/claude-cli.d.ts.map +1 -1
- package/dist/claude-cli.js +40 -18
- package/dist/mcp-oauth.d.ts +3 -2
- package/dist/mcp-oauth.d.ts.map +1 -1
- package/dist/mcp-oauth.js +65 -27
- package/dist/resumed-session.d.ts +9 -2
- package/dist/resumed-session.d.ts.map +1 -1
- package/dist/resumed-session.js +51 -7
- package/dist/sdk-to-acp.js +4 -2
- package/dist/session-cursors.d.ts +1 -1
- package/dist/session-cursors.d.ts.map +1 -1
- package/dist/session-cursors.js +8 -2
- package/dist/session-index/service.d.ts.map +1 -1
- package/dist/session-index/service.js +9 -17
- package/dist/session-index/session-index.d.ts +1 -13
- package/dist/session-index/session-index.d.ts.map +1 -1
- package/dist/session-index/session-index.js +3 -29
- package/dist/session-index/transcript-scan.d.ts +17 -4
- package/dist/session-index/transcript-scan.d.ts.map +1 -1
- package/dist/session-index/transcript-scan.js +44 -3
- package/dist/session-mode.d.ts +38 -1
- package/dist/session-mode.d.ts.map +1 -1
- package/dist/session-mode.js +73 -15
- package/dist/session-read.d.ts +45 -0
- package/dist/session-read.d.ts.map +1 -0
- package/dist/session-read.js +300 -0
- package/dist/session-rewind.d.ts +6 -2
- package/dist/session-rewind.d.ts.map +1 -1
- package/dist/session-rewind.js +13 -4
- package/dist/session-ultracode.d.ts +14 -5
- package/dist/session-ultracode.d.ts.map +1 -1
- package/dist/session-ultracode.js +23 -11
- package/dist/startup-failure.d.ts +11 -1
- package/dist/startup-failure.d.ts.map +1 -1
- package/dist/startup-failure.js +33 -1
- package/dist/subagent-history.d.ts +9 -1
- package/dist/subagent-history.d.ts.map +1 -1
- package/dist/subagent-history.js +55 -13
- package/dist/v1/acp-agent.d.ts +8 -1
- package/dist/v1/acp-agent.d.ts.map +1 -1
- package/dist/v1/acp-agent.js +167 -87
- package/dist/v1/async-task-stop.d.ts +31 -0
- package/dist/v1/async-task-stop.d.ts.map +1 -1
- package/dist/v1/async-task-stop.js +41 -0
- package/dist/v1/session-read.d.ts +31 -0
- package/dist/v1/session-read.d.ts.map +1 -0
- package/dist/v1/session-read.js +62 -0
- package/dist/v2/agent.d.ts.map +1 -1
- package/dist/v2/agent.js +60 -25
- package/dist/v2/commands.d.ts +8 -3
- package/dist/v2/commands.d.ts.map +1 -1
- package/dist/v2/commands.js +4 -3
- package/dist/v2/config.d.ts +3 -3
- package/dist/v2/config.d.ts.map +1 -1
- package/dist/v2/config.js +11 -9
- package/dist/v2/session-read.d.ts +11 -0
- package/dist/v2/session-read.d.ts.map +1 -0
- package/dist/v2/session-read.js +28 -0
- package/dist/v2/session.d.ts.map +1 -1
- package/dist/v2/session.js +19 -2
- package/dist/v2/stream.d.ts +9 -13
- package/dist/v2/stream.d.ts.map +1 -1
- package/dist/v2/stream.js +10 -9
- package/dist/v2/subagent-replay.d.ts +16 -4
- package/dist/v2/subagent-replay.d.ts.map +1 -1
- package/dist/v2/subagent-replay.js +22 -10
- package/dist/v2/tasks.d.ts.map +1 -1
- package/dist/v2/tasks.js +5 -3
- package/package.json +8 -8
package/dist/v2/stream.d.ts
CHANGED
|
@@ -42,12 +42,6 @@ export declare class SessionOutput {
|
|
|
42
42
|
private readonly translator;
|
|
43
43
|
private readonly send;
|
|
44
44
|
private readonly logger;
|
|
45
|
-
/**
|
|
46
|
-
* Whether this is a subagent's session. Its messages keep the
|
|
47
|
-
* `parent_tool_use_id` of the Agent call that launched it, and its text
|
|
48
|
-
* streams (`forwardSubagentText`).
|
|
49
|
-
*/
|
|
50
|
-
private readonly subagent;
|
|
51
45
|
private readonly toolUseCache;
|
|
52
46
|
private readonly emittedToolCalls;
|
|
53
47
|
/** What the client holds of each open tool call: an update carries only what changed. */
|
|
@@ -91,13 +85,13 @@ export declare class SessionOutput {
|
|
|
91
85
|
route: OutputRoute | undefined;
|
|
92
86
|
/** Set by the session around one message: rewrites its updates before {@link route}. */
|
|
93
87
|
rewrite: ((notification: AcpSessionNotification) => AcpSessionNotification) | undefined;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
/** A subagent's own stream carries the launch call's `parent_tool_use_id`. */
|
|
89
|
+
private readonly subagent;
|
|
90
|
+
private readonly detached;
|
|
91
|
+
constructor(sessionId: string, cwd: string, translator: V2UpdateTranslator, send: (update: v2.SessionUpdate) => void, logger: Logger, { subagent, detached }?: {
|
|
92
|
+
subagent?: boolean;
|
|
93
|
+
detached?: boolean;
|
|
94
|
+
});
|
|
101
95
|
/** Tool updates that a hook callback sends outside the stream (an Edit's diff). */
|
|
102
96
|
private readonly hookClient;
|
|
103
97
|
/** A partial assistant message: one event of the streaming API response. */
|
|
@@ -186,6 +180,8 @@ export declare class SessionOutput {
|
|
|
186
180
|
* ran when Claude Code was killed, ends `failed` after the replay, as v2
|
|
187
181
|
* asks of replayed work that no longer runs. The calls that the live
|
|
188
182
|
* session holds open, and those in `live` (its background work), go on.
|
|
183
|
+
* A detached read keeps a tool call without a result pending, since the
|
|
184
|
+
* connection does not own the writer or know whether the call ended.
|
|
189
185
|
* `running` rewrites the replayed results of that background work as live,
|
|
190
186
|
* so that they do not end it (see `SessionTasks.replayedBackground`).
|
|
191
187
|
*/
|
package/dist/v2/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/v2/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,KAAK,EAAE,MAAM,mDAAmD,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;IACH,OAAO,CAAC,eAAe;IAQvB;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAYb,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAEhD,uEAAuE;IACvE,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAE3D,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,OAAO;CA0BhB;AAED,KAAK,mBAAmB,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC"}
|
package/dist/v2/stream.js
CHANGED
|
@@ -26,7 +26,6 @@ export class SessionOutput {
|
|
|
26
26
|
translator;
|
|
27
27
|
send;
|
|
28
28
|
logger;
|
|
29
|
-
subagent;
|
|
30
29
|
toolUseCache = {};
|
|
31
30
|
emittedToolCalls = new Set();
|
|
32
31
|
/** What the client holds of each open tool call: an update carries only what changed. */
|
|
@@ -72,19 +71,17 @@ export class SessionOutput {
|
|
|
72
71
|
route;
|
|
73
72
|
/** Set by the session around one message: rewrites its updates before {@link route}. */
|
|
74
73
|
rewrite;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* streams (`forwardSubagentText`).
|
|
80
|
-
*/
|
|
81
|
-
subagent = false) {
|
|
74
|
+
/** A subagent's own stream carries the launch call's `parent_tool_use_id`. */
|
|
75
|
+
subagent;
|
|
76
|
+
detached;
|
|
77
|
+
constructor(sessionId, cwd, translator, send, logger, { subagent = false, detached = false } = {}) {
|
|
82
78
|
this.sessionId = sessionId;
|
|
83
79
|
this.cwd = cwd;
|
|
84
80
|
this.translator = translator;
|
|
85
81
|
this.send = send;
|
|
86
82
|
this.logger = logger;
|
|
87
83
|
this.subagent = subagent;
|
|
84
|
+
this.detached = detached;
|
|
88
85
|
}
|
|
89
86
|
/** Tool updates that a hook callback sends outside the stream (an Edit's diff). */
|
|
90
87
|
hookClient = {
|
|
@@ -326,13 +323,15 @@ export class SessionOutput {
|
|
|
326
323
|
* ran when Claude Code was killed, ends `failed` after the replay, as v2
|
|
327
324
|
* asks of replayed work that no longer runs. The calls that the live
|
|
328
325
|
* session holds open, and those in `live` (its background work), go on.
|
|
326
|
+
* A detached read keeps a tool call without a result pending, since the
|
|
327
|
+
* connection does not own the writer or know whether the call ended.
|
|
329
328
|
* `running` rewrites the replayed results of that background work as live,
|
|
330
329
|
* so that they do not end it (see `SessionTasks.replayedBackground`).
|
|
331
330
|
*/
|
|
332
331
|
replay(messages, hooks, live = new Set(), running) {
|
|
333
332
|
this.replayCleared = new Set();
|
|
334
333
|
this.replayHooks = hooks;
|
|
335
|
-
const unfinished = (this.replayUnfinished = new Set());
|
|
334
|
+
const unfinished = (this.replayUnfinished = this.detached ? undefined : new Set());
|
|
336
335
|
try {
|
|
337
336
|
for (const [index, message] of messages.entries()) {
|
|
338
337
|
if (message.parent_tool_use_id !== null || isReplayHiddenMetaMessage(message))
|
|
@@ -379,6 +378,8 @@ export class SessionOutput {
|
|
|
379
378
|
this.replayHooks = undefined;
|
|
380
379
|
this.replayUnfinished = undefined;
|
|
381
380
|
}
|
|
381
|
+
if (!unfinished)
|
|
382
|
+
return;
|
|
382
383
|
for (const toolCallId of unfinished) {
|
|
383
384
|
if (this.unfinished.has(toolCallId) || live.has(toolCallId))
|
|
384
385
|
continue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The replay of a session's subagents, for `session/resume` with
|
|
3
|
-
* `replayFrom`, as the v1 core replays them (`RfdSubagentReplay`).
|
|
3
|
+
* `replayFrom` and `_session/read`, as the v1 core replays them (`RfdSubagentReplay`).
|
|
4
4
|
*
|
|
5
5
|
* Claude Code keeps each subagent's history in its own transcript, and its
|
|
6
6
|
* metadata file names the Agent or Task call that launched it (see
|
|
@@ -47,6 +47,7 @@ import type * as v2 from "@agentclientprotocol/sdk/experimental/v2/unstable";
|
|
|
47
47
|
import type { SessionConfigOption } from "@agentclientprotocol/sdk/unstable";
|
|
48
48
|
import type { SessionMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
49
49
|
import type { Logger } from "../logger.js";
|
|
50
|
+
import type { AcpSessionNotification } from "../acp-subagents.js";
|
|
50
51
|
import { type SubagentModels } from "../native-subagents.js";
|
|
51
52
|
import type { V2UpdateTranslator } from "./update-translator.js";
|
|
52
53
|
import { SessionOutput, type ReplayHooks } from "./stream.js";
|
|
@@ -58,7 +59,8 @@ export interface ReplayHost {
|
|
|
58
59
|
readonly translator: V2UpdateTranslator;
|
|
59
60
|
/** Sends an update of the root session or one of its children. */
|
|
60
61
|
send(notification: v2.UpdateSessionNotification): void;
|
|
61
|
-
|
|
62
|
+
/** The live model list for child configuration after a resume. */
|
|
63
|
+
models?(): SubagentModels;
|
|
62
64
|
}
|
|
63
65
|
/** What the live session knows of the replayed children. */
|
|
64
66
|
export interface LiveChildren {
|
|
@@ -67,12 +69,19 @@ export interface LiveChildren {
|
|
|
67
69
|
/** The configuration that the client last got for the live child `sessionId`, if any. */
|
|
68
70
|
configuration(sessionId: string): SessionConfigOption[] | undefined;
|
|
69
71
|
}
|
|
72
|
+
/** Sends the root and child history, then the children's and root's replay delimiters. */
|
|
73
|
+
export declare function replaySessionHistory(send: ReplayHost["send"], output: SessionOutput, messages: SessionMessage[], subagents: SubagentReplay | undefined, options?: {
|
|
74
|
+
background?: ReadonlySet<string>;
|
|
75
|
+
running?: (notification: AcpSessionNotification) => AcpSessionNotification;
|
|
76
|
+
beforeFinish?: () => void;
|
|
77
|
+
}): void;
|
|
70
78
|
export declare class SubagentReplay {
|
|
71
79
|
private readonly host;
|
|
72
80
|
private readonly history;
|
|
73
81
|
/** The transcript of each child, by agent id. */
|
|
74
82
|
private readonly transcripts;
|
|
75
83
|
private readonly live;
|
|
84
|
+
private readonly detached;
|
|
76
85
|
private readonly transcript;
|
|
77
86
|
/** Children whose transcript could not be read: only their association is replayed. */
|
|
78
87
|
private withoutHistory;
|
|
@@ -82,7 +91,10 @@ export declare class SubagentReplay {
|
|
|
82
91
|
* Reads the subagent history that `messages`, the session's transcript,
|
|
83
92
|
* launched, with every child's transcript. Undefined when it launched none.
|
|
84
93
|
*/
|
|
85
|
-
static load(host: ReplayHost, messages: SessionMessage[], live
|
|
94
|
+
static load(host: ReplayHost, messages: SessionMessage[], { live, transcript: transcriptPath, }?: {
|
|
95
|
+
live?: LiveChildren;
|
|
96
|
+
transcript?: string;
|
|
97
|
+
}): Promise<SubagentReplay | undefined>;
|
|
86
98
|
/** The hooks of the replay of the root session's history (`messages`). */
|
|
87
99
|
hooks(output: SessionOutput, messages: SessionMessage[]): ReplayHooks;
|
|
88
100
|
/** Whether the replay announced the child session `sessionId`. */
|
|
@@ -91,7 +103,7 @@ export declare class SubagentReplay {
|
|
|
91
103
|
* Ends the replay of the children. Every child's end goes out on its
|
|
92
104
|
* parent, whose history it is. Then each announced child gets its
|
|
93
105
|
* `replay_complete`, also one without history. The caller sends the root's
|
|
94
|
-
* `replay_complete` next
|
|
106
|
+
* `replay_complete` next. A resume then publishes the {@link currentStates}.
|
|
95
107
|
*/
|
|
96
108
|
finish(): void;
|
|
97
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-replay.d.ts","sourceRoot":"","sources":["../../src/v2/subagent-replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,KAAK,EAAE,MAAM,mDAAmD,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"subagent-replay.d.ts","sourceRoot":"","sources":["../../src/v2/subagent-replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AwDb;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAcjB,0FAA0F;IAC1F,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,QAAQ;IAiChB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAgBpB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,KAAK;CAKd"}
|
|
@@ -1,48 +1,60 @@
|
|
|
1
1
|
import { launchReply, linkedSessionMessages, nativeSubagentState, rfdLabels, } from "../native-subagents.js";
|
|
2
|
-
import { readSubagentMessages, subagentHistory, subagentLaunchIds, } from "../subagent-history.js";
|
|
2
|
+
import { readSubagentMessages, readSubagentMessagesOrFail, subagentHistory, subagentLaunchIds, } from "../subagent-history.js";
|
|
3
3
|
import { currentChildConfiguration, deliveredCall, isDelivery, isDirectory, missingHistoryNotice, ReplayTranscript, replayEndState, textOf, trackResponseModel, } from "../subagent-replay.js";
|
|
4
4
|
import { taskNotificationsOf } from "../task-notifications.js";
|
|
5
5
|
import { REPLAY_COMPLETE } from "./setup.js";
|
|
6
6
|
import { SessionOutput } from "./stream.js";
|
|
7
7
|
import { sameDirectory } from "./tasks.js";
|
|
8
8
|
const NO_LIVE_CHILDREN = { working: () => false, configuration: () => undefined };
|
|
9
|
+
/** Sends the root and child history, then the children's and root's replay delimiters. */
|
|
10
|
+
export function replaySessionHistory(send, output, messages, subagents, options = {}) {
|
|
11
|
+
output.replay(messages, subagents?.hooks(output, messages), options.background, options.running);
|
|
12
|
+
options.beforeFinish?.();
|
|
13
|
+
subagents?.finish();
|
|
14
|
+
send({ sessionId: output.sessionId, update: REPLAY_COMPLETE });
|
|
15
|
+
}
|
|
9
16
|
export class SubagentReplay {
|
|
10
17
|
host;
|
|
11
18
|
history;
|
|
12
19
|
transcripts;
|
|
13
20
|
live;
|
|
21
|
+
detached;
|
|
14
22
|
transcript;
|
|
15
23
|
/** Children whose transcript could not be read: only their association is replayed. */
|
|
16
24
|
withoutHistory = 0;
|
|
17
25
|
rootOutput;
|
|
18
26
|
constructor(host, history,
|
|
19
27
|
/** The transcript of each child, by agent id. */
|
|
20
|
-
transcripts, live) {
|
|
28
|
+
transcripts, live, detached) {
|
|
21
29
|
this.host = host;
|
|
22
30
|
this.history = history;
|
|
23
31
|
this.transcripts = transcripts;
|
|
24
32
|
this.live = live;
|
|
33
|
+
this.detached = detached;
|
|
25
34
|
this.transcript = new ReplayTranscript(history);
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
37
|
* Reads the subagent history that `messages`, the session's transcript,
|
|
29
38
|
* launched, with every child's transcript. Undefined when it launched none.
|
|
30
39
|
*/
|
|
31
|
-
static async load(host, messages, live = NO_LIVE_CHILDREN) {
|
|
40
|
+
static async load(host, messages, { live = NO_LIVE_CHILDREN, transcript: transcriptPath, } = {}) {
|
|
32
41
|
if (!messages.some((message) => launchIdsOf(message).length > 0))
|
|
33
42
|
return undefined;
|
|
34
|
-
const history = await subagentHistory(host.sessionId);
|
|
43
|
+
const history = await subagentHistory(host.sessionId, transcriptPath === undefined ? undefined : { strict: true, transcript: transcriptPath });
|
|
35
44
|
const transcripts = new Map();
|
|
36
45
|
const queue = messages.flatMap(launchIdsOf);
|
|
37
46
|
while (queue.length > 0) {
|
|
38
|
-
const
|
|
47
|
+
const launchId = queue.shift();
|
|
48
|
+
const record = history.agents.get(launchId);
|
|
39
49
|
if (!record || transcripts.has(record.agentId))
|
|
40
50
|
continue;
|
|
41
|
-
const transcript = (await
|
|
51
|
+
const transcript = (await (transcriptPath === undefined
|
|
52
|
+
? readSubagentMessages(host.sessionId, record.agentId, history, host.logger)
|
|
53
|
+
: readSubagentMessagesOrFail(host.sessionId, record.agentId, history, launchId))).map((message) => ({ ...message, parent_tool_use_id: null }));
|
|
42
54
|
transcripts.set(record.agentId, transcript);
|
|
43
55
|
queue.push(...transcript.flatMap(launchIdsOf));
|
|
44
56
|
}
|
|
45
|
-
return new SubagentReplay(host, history, transcripts, live);
|
|
57
|
+
return new SubagentReplay(host, history, transcripts, live, transcriptPath !== undefined);
|
|
46
58
|
}
|
|
47
59
|
/** The hooks of the replay of the root session's history (`messages`). */
|
|
48
60
|
hooks(output, messages) {
|
|
@@ -58,7 +70,7 @@ export class SubagentReplay {
|
|
|
58
70
|
* Ends the replay of the children. Every child's end goes out on its
|
|
59
71
|
* parent, whose history it is. Then each announced child gets its
|
|
60
72
|
* `replay_complete`, also one without history. The caller sends the root's
|
|
61
|
-
* `replay_complete` next
|
|
73
|
+
* `replay_complete` next. A resume then publishes the {@link currentStates}.
|
|
62
74
|
*/
|
|
63
75
|
finish() {
|
|
64
76
|
const announced = [...this.transcript.children.values()].filter((child) => child.announced);
|
|
@@ -113,7 +125,7 @@ export class SubagentReplay {
|
|
|
113
125
|
}
|
|
114
126
|
}
|
|
115
127
|
sendConfiguration(child) {
|
|
116
|
-
const configOptions = currentChildConfiguration(child, this.live.configuration(child.sessionId), this.host.models());
|
|
128
|
+
const configOptions = currentChildConfiguration(child, this.live.configuration(child.sessionId), this.host.models?.());
|
|
117
129
|
if (!configOptions)
|
|
118
130
|
return;
|
|
119
131
|
child.output.emitV1([
|
|
@@ -255,7 +267,7 @@ export class SubagentReplay {
|
|
|
255
267
|
state: { state: "running" },
|
|
256
268
|
},
|
|
257
269
|
});
|
|
258
|
-
child.output = new SessionOutput(child.sessionId, child.cwd ?? parentCwd, this.host.translator, (update) => this.host.send({ sessionId: child.sessionId, update }), this.host.logger, true);
|
|
270
|
+
child.output = new SessionOutput(child.sessionId, child.cwd ?? parentCwd, this.host.translator, (update) => this.host.send({ sessionId: child.sessionId, update }), this.host.logger, { subagent: true, detached: this.detached });
|
|
259
271
|
}
|
|
260
272
|
/**
|
|
261
273
|
* The rest of a child's user message to replay, or `null` when nothing is
|
package/dist/v2/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":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AoE;IACpE,WAAW,EAAG,CACZ,OAAO,EAAE,EAAE,CAAC,wBAAwB,EACpC,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC;IAE3C;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B,oFAAoF;IACpF,OAAO,CAAC,QAAQ;IAKhB;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAYf;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAWnB,0FAA0F;IAC1F,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,SAAS;IAWjB,kEAAkE;IAClE,OAAO,CAAC,KAAK;IAMb,OAAO,CAAC,QAAQ;IAKhB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAepB,qDAAqD;IACrD,OAAO,CAAC,YAAY;IAepB;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK;IA4Cb;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,UAAU;IAmBlB,6EAA6E;IAC7E,OAAO,CAAC,UAAU;IAelB;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAkBxB,yFAAyF;IACzF,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,OAAO;CAGhB;AAoBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CASlE"}
|
package/dist/v2/tasks.js
CHANGED
|
@@ -369,8 +369,10 @@ export class SessionTasks {
|
|
|
369
369
|
/** Reads the subagents that the history `messages` launched, for its replay. */
|
|
370
370
|
loadReplay(messages) {
|
|
371
371
|
return SubagentReplay.load(this.host, messages, {
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
live: {
|
|
373
|
+
working: (sessionId) => this.children.get(sessionId)?.working === true,
|
|
374
|
+
configuration: (sessionId) => this.hasChild(sessionId) ? this.configs.published(sessionId) : undefined,
|
|
375
|
+
},
|
|
374
376
|
});
|
|
375
377
|
}
|
|
376
378
|
/** Whether a subagent still runs, including in the background. */
|
|
@@ -1326,7 +1328,7 @@ export class SessionTasks {
|
|
|
1326
1328
|
child.description = labels.description;
|
|
1327
1329
|
const parentCwd = this.cwdOf(parentSessionId);
|
|
1328
1330
|
child.cwd = hook?.cwd && !sameDirectory(hook.cwd, parentCwd) ? hook.cwd : undefined;
|
|
1329
|
-
const output = new SessionOutput(child.sessionId, child.cwd ?? parentCwd, this.host.translator, (update) => this.host.send({ sessionId: child.sessionId, update }), this.host.logger, true);
|
|
1331
|
+
const output = new SessionOutput(child.sessionId, child.cwd ?? parentCwd, this.host.translator, (update) => this.host.send({ sessionId: child.sessionId, update }), this.host.logger, { subagent: true });
|
|
1330
1332
|
output.route = (notification) => this.route(output, notification, child);
|
|
1331
1333
|
child.output = output;
|
|
1332
1334
|
child.announced = true;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.113.
|
|
6
|
+
"version": "0.113.1-preview.10",
|
|
7
7
|
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -69,24 +69,24 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@agentclientprotocol/sdk": "2.12.0",
|
|
72
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
72
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.333",
|
|
73
73
|
"diff": "9.0.0",
|
|
74
74
|
"zod": "4.6.7"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@anthropic-ai/sdk": "1.
|
|
77
|
+
"@anthropic-ai/sdk": "1.15.0",
|
|
78
78
|
"@eslint/js": "10.0.1",
|
|
79
79
|
"@tsconfig/node22": "22.0.7",
|
|
80
|
-
"@types/node": "26.6.
|
|
80
|
+
"@types/node": "26.6.11",
|
|
81
81
|
"@typescript-eslint/eslint-plugin": "8.74.0",
|
|
82
82
|
"@typescript-eslint/parser": "8.74.0",
|
|
83
83
|
"ajv": "8.20.0",
|
|
84
84
|
"ajv-formats": "3.0.1",
|
|
85
|
-
"eslint": "10.
|
|
86
|
-
"eslint-config-prettier": "10.1.
|
|
87
|
-
"globals": "17.
|
|
85
|
+
"eslint": "10.16.0",
|
|
86
|
+
"eslint-config-prettier": "10.1.9",
|
|
87
|
+
"globals": "17.15.0",
|
|
88
88
|
"prettier": "3.10.1",
|
|
89
89
|
"typescript": "6.0.3",
|
|
90
|
-
"vitest": "5.1.
|
|
90
|
+
"vitest": "5.1.2"
|
|
91
91
|
}
|
|
92
92
|
}
|