@markusylisiurunen/tau 0.3.93 → 0.3.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code_mode/command.js +3 -1
- package/dist/code_mode/command.js.map +1 -1
- package/dist/code_mode/output.d.ts +3 -0
- package/dist/code_mode/output.js +8 -2
- package/dist/code_mode/output.js.map +1 -1
- package/dist/code_mode/runtime.d.ts +7 -1
- package/dist/code_mode/runtime.js +18 -14
- package/dist/code_mode/runtime.js.map +1 -1
- package/dist/core/code_mode/agents.js +434 -0
- package/dist/core/code_mode/agents.js.map +1 -0
- package/dist/core/code_mode/bash.js +14 -17
- package/dist/core/code_mode/bash.js.map +1 -1
- package/dist/core/code_mode/history.js +1 -0
- package/dist/core/code_mode/history.js.map +1 -1
- package/dist/core/code_mode/models.js +27 -4
- package/dist/core/code_mode/models.js.map +1 -1
- package/dist/core/code_mode/sdk.js +6 -0
- package/dist/core/code_mode/sdk.js.map +1 -1
- package/dist/core/config/content_loader.js +3 -13
- package/dist/core/config/content_loader.js.map +1 -1
- package/dist/core/config/schema.js.map +1 -1
- package/dist/core/debug.js +2 -2
- package/dist/core/debug.js.map +1 -1
- package/dist/core/history/history_manager.js +7 -4
- package/dist/core/history/history_manager.js.map +1 -1
- package/dist/core/index.js +0 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/mcp/manager.js +7 -0
- package/dist/core/mcp/manager.js.map +1 -1
- package/dist/core/models/openrouter.js +25 -1
- package/dist/core/models/openrouter.js.map +1 -1
- package/dist/core/personas.js +3 -11
- package/dist/core/personas.js.map +1 -1
- package/dist/core/runtime/chat_runtime.js +11 -10
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- package/dist/core/runtime/session_prompt_composer.js +9 -8
- package/dist/core/runtime/session_prompt_composer.js.map +1 -1
- package/dist/core/static/code_mode/history/documentation.md +2 -1
- package/dist/core/static/code_mode/sandbox_runner.mjs +4 -0
- package/dist/core/static/index.js +18 -5
- package/dist/core/static/index.js.map +1 -1
- package/dist/core/static/prompts/subagent-prefix.md +17 -0
- package/dist/core/static/tau_docs/client-tools.md +4 -0
- package/dist/core/static/tau_docs/code-mode.md +77 -0
- package/dist/core/static/tau_docs/config-reference.md +4 -2
- package/dist/core/static/tau_docs/history.md +5 -3
- package/dist/core/static/tau_docs/index.md +2 -1
- package/dist/core/static/tau_docs/manifest.json +1 -0
- package/dist/core/static/tau_docs/node-sdk.md +2 -0
- package/dist/core/static/tau_docs/openrouter.md +2 -0
- package/dist/core/static/tau_docs/pdf-unpacking.md +1 -1
- package/dist/core/static/tau_docs/personas.md +4 -5
- package/dist/core/static/tau_docs/prompts-and-project-context.md +1 -1
- package/dist/core/static/tau_docs/security.md +1 -1
- package/dist/core/static/tau_docs/sessions.md +1 -1
- package/dist/core/static/tau_docs/subagents.md +106 -27
- package/dist/core/static/tau_docs/telegram.md +20 -2
- package/dist/core/static/tau_docs/tools.md +32 -62
- package/dist/core/static/tau_docs/troubleshooting.md +2 -2
- package/dist/core/subagents/agent_supervisor.js +185 -339
- package/dist/core/subagents/agent_supervisor.js.map +1 -1
- package/dist/core/subagents/claude_code_protocol.js +4 -0
- package/dist/core/subagents/claude_code_protocol.js.map +1 -1
- package/dist/core/subagents/claude_code_runner.js +134 -11
- package/dist/core/subagents/claude_code_runner.js.map +1 -1
- package/dist/core/subagents/claude_code_runner.mjs +80 -77
- package/dist/core/subagents/claude_code_runtime.js +250 -9
- package/dist/core/subagents/claude_code_runtime.js.map +1 -1
- package/dist/core/subagents/errors.js +18 -0
- package/dist/core/subagents/errors.js.map +1 -0
- package/dist/core/subagents/events.js +25 -0
- package/dist/core/subagents/events.js.map +1 -0
- package/dist/core/subagents/format.js +2 -98
- package/dist/core/subagents/format.js.map +1 -1
- package/dist/core/subagents/native_subagent_runtime.js +270 -0
- package/dist/core/subagents/native_subagent_runtime.js.map +1 -0
- package/dist/core/subagents/prompt.js +3 -5
- package/dist/core/subagents/prompt.js.map +1 -1
- package/dist/core/subagents/registry.js +5 -3
- package/dist/core/subagents/registry.js.map +1 -1
- package/dist/core/subagents/runtime.js +13 -0
- package/dist/core/subagents/runtime.js.map +1 -0
- package/dist/core/subagents/trace.js +149 -0
- package/dist/core/subagents/trace.js.map +1 -0
- package/dist/core/telegram/adapter.js +40 -6
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/config.js +6 -0
- package/dist/core/telegram/config.js.map +1 -1
- package/dist/core/telegram/runtime.js +1 -0
- package/dist/core/telegram/runtime.js.map +1 -1
- package/dist/core/tools/agent_jobs.js +51 -0
- package/dist/core/tools/agent_jobs.js.map +1 -0
- package/dist/core/tools/background_jobs.js +205 -0
- package/dist/core/tools/background_jobs.js.map +1 -0
- package/dist/core/tools/bash.js +11 -45
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/bash_jobs.js +44 -238
- package/dist/core/tools/bash_jobs.js.map +1 -1
- package/dist/core/tools/catalog.js +37 -72
- package/dist/core/tools/catalog.js.map +1 -1
- package/dist/core/tools/code.js +177 -54
- package/dist/core/tools/code.js.map +1 -1
- package/dist/core/tools/code_jobs.js +128 -0
- package/dist/core/tools/code_jobs.js.map +1 -0
- package/dist/core/tools/code_mode.js +88 -101
- package/dist/core/tools/code_mode.js.map +1 -1
- package/dist/core/tools/code_mode_worker.js +13 -7
- package/dist/core/tools/code_mode_worker.js.map +1 -1
- package/dist/core/tools/job_output.js +53 -0
- package/dist/core/tools/job_output.js.map +1 -0
- package/dist/core/tools/output_file.js +38 -0
- package/dist/core/tools/output_file.js.map +1 -0
- package/dist/core/tools/presentation.js +19 -9
- package/dist/core/tools/presentation.js.map +1 -1
- package/dist/core/tools/tool_names.js +8 -6
- package/dist/core/tools/tool_names.js.map +1 -1
- package/dist/core/tools/wait_for_agents.js +41 -33
- package/dist/core/tools/wait_for_agents.js.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/diff_tool/app/dist/assets/{core-DaUcjNBm.js → core-NkxL1yZC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{github-dark-default-adAWTKmX.js → github-dark-default-CM8LCIj6.js} +1 -1
- package/dist/diff_tool/app/dist/assets/highlights-Coi8xHW0.js +3 -0
- package/dist/diff_tool/app/dist/assets/index-Jt-l2Q96.js +205 -0
- package/dist/diff_tool/app/dist/assets/langs-qJAo26KT.js +1 -0
- package/dist/diff_tool/app/dist/assets/{loader-DrMMfKhl.js → loader-DYYMIDWx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shiki-BDtWTy6K.js → shiki-B8l9Ufae.js} +2 -2
- package/dist/diff_tool/app/dist/assets/{stream-tokenizer-Dpnp6Te1.js → stream-tokenizer-h1lwRQEk.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{themes-snQUZ0v5.js → themes-D3P9yN9_.js} +2 -2
- package/dist/diff_tool/app/dist/index.html +1 -1
- package/dist/host/hosted_ephemeral_agent_session.js +13 -3
- package/dist/host/hosted_ephemeral_agent_session.js.map +1 -1
- package/dist/host/local_session_host.js +5 -5
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/sdk/code_mode.js +2 -2
- package/dist/sdk/code_mode.js.map +1 -1
- package/dist/store/session_snapshot_migrations.js +27 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/package.json +6 -6
- package/dist/core/static/prompts/subagent-wrapper.md +0 -20
- package/dist/core/tools/interrupt_agent.js +0 -142
- package/dist/core/tools/interrupt_agent.js.map +0 -1
- package/dist/core/tools/list_agents.js +0 -85
- package/dist/core/tools/list_agents.js.map +0 -1
- package/dist/core/tools/send_input_to_agent.js +0 -177
- package/dist/core/tools/send_input_to_agent.js.map +0 -1
- package/dist/core/tools/spawn_agent.js +0 -275
- package/dist/core/tools/spawn_agent.js.map +0 -1
- package/dist/diff_tool/app/dist/assets/highlights-ey_YWY7Q.js +0 -3
- package/dist/diff_tool/app/dist/assets/index-B7CqEx6P.js +0 -202
- package/dist/diff_tool/app/dist/assets/langs-BAlu0Oiy.js +0 -1
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AgentRequestError } from "../subagents/errors.js";
|
|
4
|
+
import { parseSubagentLaunchModel } from "../subagents/launch_model.js";
|
|
5
|
+
import { resolveSubagentEffectiveSettings } from "../subagents/registry.js";
|
|
6
|
+
const id = z.string().min(1).max(256);
|
|
7
|
+
const idOptions = z.strictObject({ id });
|
|
8
|
+
const message = z
|
|
9
|
+
.string()
|
|
10
|
+
.trim()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(256 * 1024);
|
|
13
|
+
const spawnOptions = z.strictObject({
|
|
14
|
+
title: z
|
|
15
|
+
.string()
|
|
16
|
+
.trim()
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(512)
|
|
19
|
+
.regex(/^[^\r\n]+$/),
|
|
20
|
+
prompt: message,
|
|
21
|
+
model: z.string().min(1).optional(),
|
|
22
|
+
workingDirectory: z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.regex(/^[^\r\n]+$/)
|
|
26
|
+
.optional(),
|
|
27
|
+
});
|
|
28
|
+
const traceOptions = z.strictObject({
|
|
29
|
+
id,
|
|
30
|
+
kinds: z
|
|
31
|
+
.array(z.enum(["input", "assistant", "tool_call", "tool_result", "notice", "status"]))
|
|
32
|
+
.max(6)
|
|
33
|
+
.optional(),
|
|
34
|
+
toolName: z.string().min(1).max(256).optional(),
|
|
35
|
+
limit: z.number().int().min(1).max(50).optional(),
|
|
36
|
+
cursor: z.string().max(4096).optional(),
|
|
37
|
+
});
|
|
38
|
+
export const agentsCapabilityMetadata = {
|
|
39
|
+
name: "agents",
|
|
40
|
+
description: "Start delegated workers, send them queued or steering input, interrupt and wait for them, and read selected parts of their conversations. Follow the delegation policy in your instructions. Workers keep running when a program ends or is cancelled.",
|
|
41
|
+
documentation: `# tau.agents
|
|
42
|
+
|
|
43
|
+
Start general-purpose workers, send them more input, and read what they did. Start workers only when the user or active instructions explicitly ask for delegation.
|
|
44
|
+
|
|
45
|
+
A worker has one conversation that grows with every input you send. Workers belong to the current session. They keep running when the program that started them ends or is cancelled, and they are lost when the session ends or Tau restarts. Results you need later must reach your conversation or a file before then.
|
|
46
|
+
|
|
47
|
+
Reading data into the program does not add it to your conversation. Only what you print does, so select and print the parts you need.
|
|
48
|
+
|
|
49
|
+
## Interface
|
|
50
|
+
|
|
51
|
+
\`\`\`ts
|
|
52
|
+
type AgentsApi = {
|
|
53
|
+
spawn(options: SpawnOptions): Promise<AgentState>;
|
|
54
|
+
list(): Promise<ListResult>;
|
|
55
|
+
read(options: { id: string }): Promise<AgentState>;
|
|
56
|
+
sendInput(options: SendInputOptions): Promise<AgentState>;
|
|
57
|
+
interrupt(options: InterruptOptions): Promise<AgentState>;
|
|
58
|
+
waitUntilIdle(options: { id: string }): Promise<AgentState>;
|
|
59
|
+
trace(options: TraceOptions): Promise<TracePage>;
|
|
60
|
+
readContent(options: ReadContentOptions): Promise<ContentPage>;
|
|
61
|
+
readText(options: ReadTextOptions): Promise<ReadTextResult>;
|
|
62
|
+
};
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
65
|
+
## Worker state
|
|
66
|
+
|
|
67
|
+
\`\`\`ts
|
|
68
|
+
type AgentState = {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
model: string; // provider/model:effort
|
|
72
|
+
workingDirectory: string;
|
|
73
|
+
pending: { queue: number; steer: number };
|
|
74
|
+
usage: {
|
|
75
|
+
input: number;
|
|
76
|
+
output: number;
|
|
77
|
+
cacheRead: number;
|
|
78
|
+
cacheWrite: number;
|
|
79
|
+
contextTokens: number;
|
|
80
|
+
contextWindow: number;
|
|
81
|
+
cost: number;
|
|
82
|
+
};
|
|
83
|
+
} & (
|
|
84
|
+
| { status: "working" | "stopping" }
|
|
85
|
+
| { status: "idle"; reason: "completed" | "interrupted" }
|
|
86
|
+
| { status: "idle"; reason: "failed"; error: { code: string; message: string } }
|
|
87
|
+
);
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
A worker is idle when it has no active turn and no pending input. \`reason\` tells how its latest turn ended. \`completed\` means the turn ended normally. It does not mean the task succeeded, so read the worker's answer before relying on it. A failed or interrupted turn may leave only a partial answer, or none.
|
|
91
|
+
|
|
92
|
+
\`pending\` counts input awaiting delivery by Tau. Delivery to a runtime does not confirm that the worker has read it. Token counts and \`cost\` are totals for the whole conversation. \`contextTokens\` estimates the current context size.
|
|
93
|
+
|
|
94
|
+
## \`tau.agents.spawn(options)\`
|
|
95
|
+
|
|
96
|
+
\`\`\`ts
|
|
97
|
+
type SpawnOptions = {
|
|
98
|
+
title: string;
|
|
99
|
+
prompt: string;
|
|
100
|
+
model?: string;
|
|
101
|
+
workingDirectory?: string;
|
|
102
|
+
};
|
|
103
|
+
\`\`\`
|
|
104
|
+
|
|
105
|
+
- \`title\`: required single line, 1–512 characters.
|
|
106
|
+
- \`prompt\`: required first message, at most 262,144 characters. The worker cannot see your conversation, so include everything it needs.
|
|
107
|
+
- \`model\`: omit it to use your own model and settings. Set it only when the user or active instructions ask for a specific model; it must exactly match an allowed override from your instructions.
|
|
108
|
+
- \`workingDirectory\`: absolute, or relative to your working directory. Defaults to your working directory.
|
|
109
|
+
|
|
110
|
+
Returns as soon as the worker starts. At most 8 workers can be working at once.
|
|
111
|
+
|
|
112
|
+
## \`tau.agents.list()\`
|
|
113
|
+
|
|
114
|
+
\`\`\`ts
|
|
115
|
+
type ListResult = {
|
|
116
|
+
agents: AgentState[];
|
|
117
|
+
capacity: { running: number; limit: number };
|
|
118
|
+
};
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
Lists every worker in this session, including idle ones.
|
|
122
|
+
|
|
123
|
+
## \`tau.agents.read(options)\`
|
|
124
|
+
|
|
125
|
+
Returns one worker's current state.
|
|
126
|
+
|
|
127
|
+
## \`tau.agents.sendInput(options)\`
|
|
128
|
+
|
|
129
|
+
\`\`\`ts
|
|
130
|
+
type SendInputOptions = {
|
|
131
|
+
id: string;
|
|
132
|
+
message: string;
|
|
133
|
+
mode: "queue" | "steer";
|
|
134
|
+
};
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
\`mode\` is required:
|
|
138
|
+
|
|
139
|
+
- \`queue\`: the worker finishes its current work first, then handles the message as a separate turn. Queued messages run in the order you send them.
|
|
140
|
+
- \`steer\`: the worker takes the message into account as soon as possible during its current turn. Use it to correct or narrow work in progress. Steering does not stop a running tool; use \`interrupt\` for that.
|
|
141
|
+
|
|
142
|
+
Either mode starts a new turn right away when the worker is idle. A steering message that arrives too late for the current turn is handled in a later turn. The worker keeps its conversation, model, tools, and working directory.
|
|
143
|
+
|
|
144
|
+
The call returns when the input is accepted, before the worker reads it. It fails while the worker is stopping, when 64 inputs are already pending, or when the worker is idle and 8 workers are already working.
|
|
145
|
+
|
|
146
|
+
## \`tau.agents.interrupt(options)\`
|
|
147
|
+
|
|
148
|
+
\`\`\`ts
|
|
149
|
+
type InterruptOptions = { id: string; wait?: boolean };
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
Stops the current turn and discards all pending input, so the worker does not continue with queued work. With the default \`wait: true\`, the call returns after the turn has ended. With \`wait: false\`, it returns right away, and the status may still be \`stopping\`. If the program's deadline passes first, the worker still stops, but the call does not confirm it. Interrupting an idle worker only returns its state.
|
|
153
|
+
|
|
154
|
+
Background Bash and code jobs that the worker started keep running. The worker stays available for more input.
|
|
155
|
+
|
|
156
|
+
## \`tau.agents.waitUntilIdle(options)\`
|
|
157
|
+
|
|
158
|
+
Waits until the worker has no active turn and no pending input, then returns its state. This includes queued messages. It returns immediately for an idle worker. A failed or interrupted worker returns idle state; the call does not throw for it. The wait does not include background jobs the worker started.
|
|
159
|
+
|
|
160
|
+
Cancelling the wait, for example when the program stops, leaves the worker running. Wait for several workers with \`Promise.all\`. The call returns state only; read the answer with \`trace\` and \`readText\`. Outside a program, use the \`wait_for_agents\` tool, which also returns each idle worker's latest answer.
|
|
161
|
+
|
|
162
|
+
An idle state is an observation at one moment. Another caller can send the worker new input afterwards.
|
|
163
|
+
|
|
164
|
+
## \`tau.agents.trace(options)\`
|
|
165
|
+
|
|
166
|
+
Reads a page of the worker's conversation.
|
|
167
|
+
|
|
168
|
+
\`\`\`ts
|
|
169
|
+
type TraceOptions = {
|
|
170
|
+
id: string;
|
|
171
|
+
kinds?: TraceKind[];
|
|
172
|
+
toolName?: string;
|
|
173
|
+
limit?: number;
|
|
174
|
+
cursor?: string;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
type TracePage = {
|
|
178
|
+
entries: TraceEntry[];
|
|
179
|
+
nextCursor: string | null;
|
|
180
|
+
historyEvicted: boolean;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
type TraceEntry = { seq: number; timestamp: number } & (
|
|
184
|
+
| { kind: "input"; mode: "initial" | "queue" | "steer"; content: Content }
|
|
185
|
+
| { kind: "assistant"; content: Content }
|
|
186
|
+
| { kind: "tool_call"; callId: string; toolName: string; arguments: Content }
|
|
187
|
+
| {
|
|
188
|
+
kind: "tool_result";
|
|
189
|
+
callId: string;
|
|
190
|
+
toolName: string;
|
|
191
|
+
outcome: "succeeded" | "failed" | "blocked" | "cancelled";
|
|
192
|
+
content: Content;
|
|
193
|
+
}
|
|
194
|
+
| { kind: "notice"; code: string; content: Content }
|
|
195
|
+
| {
|
|
196
|
+
kind: "status";
|
|
197
|
+
status: "working" | "stopping" | "idle";
|
|
198
|
+
reason?: "completed" | "failed" | "interrupted";
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
type TraceKind = TraceEntry["kind"];
|
|
203
|
+
|
|
204
|
+
type Content =
|
|
205
|
+
| { kind: "inline"; blocks: ContentBlock[] }
|
|
206
|
+
| { kind: "reference"; ref: string; bytes: number };
|
|
207
|
+
|
|
208
|
+
type ContentBlock =
|
|
209
|
+
| { type: "text"; text: string }
|
|
210
|
+
| { type: "json"; value: unknown }
|
|
211
|
+
| { type: "image"; mimeType: string; data: string } // base64
|
|
212
|
+
| { type: "unavailable"; reason: string };
|
|
213
|
+
\`\`\`
|
|
214
|
+
|
|
215
|
+
- \`kinds\`: only entries of these kinds. Omit for all kinds.
|
|
216
|
+
- \`toolName\`: only tool calls and results of this tool. Tool names are the worker's own, such as \`bash\` for a Tau worker or \`Bash\` for a Claude Code worker.
|
|
217
|
+
- \`limit\`: integer 1–50, default 20.
|
|
218
|
+
- \`cursor\`: \`nextCursor\` from an earlier page. Keep \`kinds\` and \`toolName\` unchanged.
|
|
219
|
+
|
|
220
|
+
The first page holds the newest matching entries, in chronological order. \`nextCursor\` leads to older entries. A cursor keeps its starting point, so new activity does not shift the pages. Call without a cursor to see the latest entries again. \`seq\` increases with every entry and identifies it for \`readText\`.
|
|
221
|
+
|
|
222
|
+
The trace contains:
|
|
223
|
+
|
|
224
|
+
- \`input\`: each message you sent, recorded when it was accepted.
|
|
225
|
+
- \`assistant\`: the worker's message text. Reasoning is not included.
|
|
226
|
+
- \`tool_call\`: the tool and its arguments as one JSON block.
|
|
227
|
+
- \`tool_result\`: the result exactly as the worker received it. Output that the tool itself shortened stays shortened.
|
|
228
|
+
- \`notice\`: events with a machine-readable \`code\`. \`input.discarded\` means an interrupt dropped pending input. \`compaction.compacted\`, \`compaction.skipped\`, \`compaction.aborted\`, and \`compaction.failed\` report context compaction. A failed turn adds a notice whose \`code\` matches the state's \`error.code\`.
|
|
229
|
+
- \`status\`: the worker started working, began stopping, or became idle.
|
|
230
|
+
|
|
231
|
+
System prompts are not included.
|
|
232
|
+
|
|
233
|
+
Content is inline when it is at most 4,096 bytes as JSON and has no images. Otherwise the entry holds a \`reference\`; read it with \`readText\` or \`readContent\`. A single content value larger than 6 MiB is replaced by an \`unavailable\` block.
|
|
234
|
+
|
|
235
|
+
Each worker keeps its newest 4,096 entries, up to 64 MiB in total. Older entries and their references are then removed, and \`historyEvicted\` is \`true\`.
|
|
236
|
+
|
|
237
|
+
## \`tau.agents.readText(options)\`
|
|
238
|
+
|
|
239
|
+
\`\`\`ts
|
|
240
|
+
type ReadTextOptions = { id: string; seq: number; maxChars?: number };
|
|
241
|
+
type ReadTextResult = { text: string; complete: boolean };
|
|
242
|
+
\`\`\`
|
|
243
|
+
|
|
244
|
+
Returns the text of one \`assistant\` or \`tool_result\` entry, whether it is inline or a reference. \`maxChars\` is 1–100,000 UTF-16 code units, default 30,000. \`complete\` is \`false\` when the text was cut at \`maxChars\` or the content contains an \`unavailable\` block. It does not detect output that the tool itself shortened. Content with JSON or images fails; use \`readContent\` for it.
|
|
245
|
+
|
|
246
|
+
## \`tau.agents.readContent(options)\`
|
|
247
|
+
|
|
248
|
+
\`\`\`ts
|
|
249
|
+
type ReadContentOptions = { id: string; ref: string; cursor?: string };
|
|
250
|
+
type ContentPage = { blocks: ContentBlock[]; nextCursor: string | null };
|
|
251
|
+
\`\`\`
|
|
252
|
+
|
|
253
|
+
Reads referenced content one block per page. Long text arrives in chunks of at most 16,384 UTF-16 code units; join the chunks to get the exact text. JSON and image blocks arrive whole. Pass \`nextCursor\` to read the next page, until it is \`null\`.
|
|
254
|
+
|
|
255
|
+
An image reaches your conversation only if you pass it to \`printImage\`.
|
|
256
|
+
|
|
257
|
+
## Errors
|
|
258
|
+
|
|
259
|
+
A failed call throws an error with a \`code\` and a \`message\`:
|
|
260
|
+
|
|
261
|
+
| \`code\` | Meaning |
|
|
262
|
+
| --- | --- |
|
|
263
|
+
| \`invalid_arguments\` | The options do not match the interface. |
|
|
264
|
+
| \`unknown_agent\` | No worker in this session has the ID. |
|
|
265
|
+
| \`invalid_cursor\` | The cursor is malformed, belongs to another query or reference, or comes from another worker. |
|
|
266
|
+
| \`expired_content\` | The entry or reference was removed by retention, or never existed. |
|
|
267
|
+
| \`content_type\` | \`readText\` was used on an entry of another kind, or on content with JSON or images. |
|
|
268
|
+
| \`operation_failed\` | The request was refused, for example at the capacity or pending-input limit. |
|
|
269
|
+
| \`cancelled\` | The program was cancelled during the call. |
|
|
270
|
+
|
|
271
|
+
A worker's failure is part of its state and trace, not an error from these calls. No call is retried automatically.
|
|
272
|
+
|
|
273
|
+
## Examples
|
|
274
|
+
|
|
275
|
+
Start a worker, wait for it, and print its answer:
|
|
276
|
+
|
|
277
|
+
\`\`\`js
|
|
278
|
+
const worker = await tau.agents.spawn({
|
|
279
|
+
title: "review authentication",
|
|
280
|
+
prompt: "Review the authentication changes in src/auth. Do not edit files. Report findings.",
|
|
281
|
+
});
|
|
282
|
+
const state = await tau.agents.waitUntilIdle({ id: worker.id });
|
|
283
|
+
if (state.status !== "idle" || state.reason !== "completed")
|
|
284
|
+
throw new Error(\`worker did not complete: \${JSON.stringify(state)}\`);
|
|
285
|
+
const page = await tau.agents.trace({ id: worker.id, kinds: ["assistant"], limit: 1 });
|
|
286
|
+
const answer = page.entries[0];
|
|
287
|
+
if (!answer) throw new Error("worker gave no answer");
|
|
288
|
+
const report = await tau.agents.readText({ id: worker.id, seq: answer.seq });
|
|
289
|
+
printText(report.text);
|
|
290
|
+
if (!report.complete) printText("(answer incomplete)");
|
|
291
|
+
\`\`\`
|
|
292
|
+
|
|
293
|
+
Redirect work in progress, then queue a separate task. Here and below, \`id\` is the ID of an earlier worker:
|
|
294
|
+
|
|
295
|
+
\`\`\`js
|
|
296
|
+
await tau.agents.sendInput({ id, mode: "steer", message: "Focus on expired sessions only." });
|
|
297
|
+
await tau.agents.sendInput({ id, mode: "queue", message: "Then review the logout flow." });
|
|
298
|
+
\`\`\`
|
|
299
|
+
|
|
300
|
+
Print the beginning of each recent failed Bash result:
|
|
301
|
+
|
|
302
|
+
\`\`\`js
|
|
303
|
+
const page = await tau.agents.trace({ id, kinds: ["tool_result"], toolName: "bash", limit: 10 });
|
|
304
|
+
for (const entry of page.entries) {
|
|
305
|
+
if (entry.outcome === "succeeded") continue;
|
|
306
|
+
const { text, complete } = await tau.agents.readText({ id, seq: entry.seq, maxChars: 2000 });
|
|
307
|
+
printText(\`#\${entry.seq}\${complete ? "" : " (shortened)"}: \${text}\`);
|
|
308
|
+
}
|
|
309
|
+
\`\`\`
|
|
310
|
+
`,
|
|
311
|
+
};
|
|
312
|
+
export function createAgentsCapability(options, originHistoryEntryId) {
|
|
313
|
+
const supervisor = options.supervisor;
|
|
314
|
+
const api = {
|
|
315
|
+
spawn: async (args, context) => {
|
|
316
|
+
const [input] = z.tuple([spawnOptions]).parse(args);
|
|
317
|
+
context.signal.throwIfAborted();
|
|
318
|
+
let launchModel;
|
|
319
|
+
if (input.model) {
|
|
320
|
+
const parsed = parseSubagentLaunchModel(input.model, {
|
|
321
|
+
resolveModel: options.modelResolver,
|
|
322
|
+
});
|
|
323
|
+
if (!parsed.launchModel ||
|
|
324
|
+
!options.persona.subagentLaunchModels.includes(parsed.launchModel.normalized))
|
|
325
|
+
throw new Error(parsed.error ?? "Subagent launch model is not allowed");
|
|
326
|
+
launchModel = parsed.launchModel;
|
|
327
|
+
}
|
|
328
|
+
const settings = resolveSubagentEffectiveSettings({
|
|
329
|
+
persona: options.persona,
|
|
330
|
+
launchModel,
|
|
331
|
+
});
|
|
332
|
+
const cwd = resolve(options.cwd, input.workingDirectory ?? ".");
|
|
333
|
+
let runtimeConfig;
|
|
334
|
+
if (settings.kind === "claude-code")
|
|
335
|
+
runtimeConfig = { ...settings, workingDirectory: cwd };
|
|
336
|
+
else {
|
|
337
|
+
const systemPrompt = cwd === resolve(options.cwd)
|
|
338
|
+
? options.subagentSystemPrompt
|
|
339
|
+
: await options.resolveSubagentPrompt?.({ cwd, persona: options.persona });
|
|
340
|
+
if (!systemPrompt)
|
|
341
|
+
throw new Error("Subagent working-directory instructions are unavailable");
|
|
342
|
+
runtimeConfig = { ...settings, workingDirectory: cwd, systemPrompt };
|
|
343
|
+
}
|
|
344
|
+
context.signal.throwIfAborted();
|
|
345
|
+
return supervisor.spawn({
|
|
346
|
+
...options,
|
|
347
|
+
runtimeConfig,
|
|
348
|
+
prompt: input.prompt,
|
|
349
|
+
title: input.title,
|
|
350
|
+
originHistoryEntryId,
|
|
351
|
+
personaId: options.persona.id,
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
list: (args) => {
|
|
355
|
+
z.tuple([]).parse(args);
|
|
356
|
+
return {
|
|
357
|
+
agents: supervisor.list(),
|
|
358
|
+
capacity: supervisor.getCapacity(),
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
read: (args) => {
|
|
362
|
+
const [input] = z.tuple([idOptions]).parse(args);
|
|
363
|
+
return supervisor.read(input.id);
|
|
364
|
+
},
|
|
365
|
+
sendInput: (args, context) => {
|
|
366
|
+
const [input] = z
|
|
367
|
+
.tuple([z.strictObject({ id, message, mode: z.enum(["queue", "steer"]) })])
|
|
368
|
+
.parse(args);
|
|
369
|
+
context.signal.throwIfAborted();
|
|
370
|
+
return supervisor.sendInput({
|
|
371
|
+
id: input.id,
|
|
372
|
+
prompt: input.message,
|
|
373
|
+
mode: input.mode,
|
|
374
|
+
});
|
|
375
|
+
},
|
|
376
|
+
interrupt: async (args, context) => {
|
|
377
|
+
const [input] = z.tuple([z.strictObject({ id, wait: z.boolean().optional() })]).parse(args);
|
|
378
|
+
context.signal.throwIfAborted();
|
|
379
|
+
return await supervisor.interrupt(input.id, context.signal, input.wait ?? true);
|
|
380
|
+
},
|
|
381
|
+
waitUntilIdle: async (args, context) => {
|
|
382
|
+
const [input] = z.tuple([idOptions]).parse(args);
|
|
383
|
+
const [state] = await supervisor.waitForAgents([input.id], context.signal);
|
|
384
|
+
return state;
|
|
385
|
+
},
|
|
386
|
+
trace: (args) => {
|
|
387
|
+
const [input] = z.tuple([traceOptions]).parse(args);
|
|
388
|
+
return supervisor.getTrace(input.id).trace(input);
|
|
389
|
+
},
|
|
390
|
+
readContent: (args) => {
|
|
391
|
+
const [input] = z
|
|
392
|
+
.tuple([
|
|
393
|
+
z.strictObject({
|
|
394
|
+
id,
|
|
395
|
+
ref: z.string().min(1).max(256),
|
|
396
|
+
cursor: z.string().max(4096).optional(),
|
|
397
|
+
}),
|
|
398
|
+
])
|
|
399
|
+
.parse(args);
|
|
400
|
+
return supervisor.getTrace(input.id).readContent(input);
|
|
401
|
+
},
|
|
402
|
+
readText: (args) => {
|
|
403
|
+
const [input] = z
|
|
404
|
+
.tuple([
|
|
405
|
+
z.strictObject({
|
|
406
|
+
id,
|
|
407
|
+
seq: z.number().int().positive(),
|
|
408
|
+
maxChars: z.number().int().min(1).max(100000).optional(),
|
|
409
|
+
}),
|
|
410
|
+
])
|
|
411
|
+
.parse(args);
|
|
412
|
+
return supervisor.getTrace(input.id).readText(input.seq, input.maxChars);
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
for (const [name, handler] of Object.entries(api)) {
|
|
416
|
+
api[name] = async (args, context) => {
|
|
417
|
+
try {
|
|
418
|
+
context.signal.throwIfAborted();
|
|
419
|
+
return await handler(args, context);
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
if (error instanceof AgentRequestError)
|
|
423
|
+
throw error;
|
|
424
|
+
throw new AgentRequestError(context.signal.aborted
|
|
425
|
+
? "cancelled"
|
|
426
|
+
: error instanceof z.ZodError
|
|
427
|
+
? "invalid_arguments"
|
|
428
|
+
: "operation_failed", error instanceof Error ? error.message : String(error));
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
return { ...agentsCapabilityMetadata, api };
|
|
433
|
+
}
|
|
434
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/core/code_mode/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0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AAiB,CACzB,OAAO,CAAC,MAAM,CAAC,OAAO;oBACpB,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,QAAQ;wBAC3B,CAAC,CAAC,mBAAmB;wBACrB,CAAC,CAAC,kBAAkB,EACxB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;YACJ,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,GAAG,wBAAwB,EAAE,GAAG,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { SESSION_PROTOCOL_MAX_EXEC_STDIN_BYTES } from "../../protocol/session_protocol.js";
|
|
4
|
+
import { JOB_WAIT_DEFAULT_MS, JOB_WAIT_MAX_MS } from "../tools/background_jobs.js";
|
|
4
5
|
import { BASH_DEFAULT_TIMEOUT_MS } from "../tools/bash.js";
|
|
5
|
-
import { BASH_JOB_WAIT_DEFAULT_MS, BASH_JOB_WAIT_MAX_MS, } from "../tools/bash_jobs.js";
|
|
6
6
|
import { MAX_COMMAND_CAPTURE_BYTES, } from "../tools/execution_backend.js";
|
|
7
|
-
const BASH_RUN_MAX_TIMEOUT_MS = 5 * 60 * 1000;
|
|
8
7
|
const commandOptions = {
|
|
9
8
|
command: z
|
|
10
9
|
.string()
|
|
@@ -22,13 +21,13 @@ const runOptions = z.strictObject({
|
|
|
22
21
|
.string()
|
|
23
22
|
.refine((value) => Buffer.byteLength(value, "utf8") <= SESSION_PROTOCOL_MAX_EXEC_STDIN_BYTES, "stdin exceeds its UTF-8 byte limit")
|
|
24
23
|
.optional(),
|
|
25
|
-
timeout: z.number().
|
|
24
|
+
timeout: z.number().positive().optional(),
|
|
26
25
|
});
|
|
27
26
|
const startOptions = z.strictObject(commandOptions);
|
|
28
27
|
const idOptions = z.strictObject({ id: z.string().min(1) });
|
|
29
28
|
const waitOptions = z.strictObject({
|
|
30
29
|
ids: z.array(z.string().min(1)).min(1).max(64),
|
|
31
|
-
timeout: z.number().int().positive().max(
|
|
30
|
+
timeout: z.number().int().positive().max(JOB_WAIT_MAX_MS).optional(),
|
|
32
31
|
});
|
|
33
32
|
export function createBashCapability(backend, cwd, jobs) {
|
|
34
33
|
return {
|
|
@@ -75,7 +74,7 @@ type RunOptions = {
|
|
|
75
74
|
- \`command\`: required, nonblank Bash source.
|
|
76
75
|
- \`stdin\`: optional UTF-8 text, at most ${SESSION_PROTOCOL_MAX_EXEC_STDIN_BYTES / 1024 / 1024} MiB. Written once, then closed so the command receives EOF. Omit for no stdin; an empty string supplies an empty stream. No interactive input or TTY is available. Pass data through stdin rather than interpolating it into command source.
|
|
77
76
|
- \`workingDirectory\`: optional, nonempty path without line breaks.
|
|
78
|
-
- \`timeout\`: optional positive
|
|
77
|
+
- \`timeout\`: optional positive number of milliseconds, default ${BASH_DEFAULT_TIMEOUT_MS}, with no upper limit. The enclosing program's deadline still cancels the command.
|
|
79
78
|
|
|
80
79
|
### Result
|
|
81
80
|
|
|
@@ -134,9 +133,7 @@ type StartOptions = {
|
|
|
134
133
|
type StartResult = { id: string };
|
|
135
134
|
\`\`\`
|
|
136
135
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Jobs survive program completion, turn interruption, and client disconnect while Tau remains running. Already launched jobs are not stopped when a program is interrupted. Jobs are not recovered after restart.
|
|
136
|
+
Started jobs also appear in your Bash job tools. Jobs survive program completion, turn interruption, and client disconnect while Tau remains running. Already launched jobs are not stopped when a program is interrupted. Jobs are not recovered after restart.
|
|
140
137
|
|
|
141
138
|
## Job types
|
|
142
139
|
|
|
@@ -154,21 +151,21 @@ type JobMetadata = {
|
|
|
154
151
|
aborted: boolean;
|
|
155
152
|
closeSignal: string | null;
|
|
156
153
|
}
|
|
157
|
-
| { status: "failed"
|
|
154
|
+
| { status: "failed" }
|
|
158
155
|
);
|
|
159
156
|
|
|
160
|
-
type Job = JobMetadata & { output: string };
|
|
157
|
+
type Job = JobMetadata & { output: string; error?: string };
|
|
161
158
|
\`\`\`
|
|
162
159
|
|
|
163
|
-
An exited command has \`exitCode\`, \`aborted\`, and \`closeSignal\`. An execution error
|
|
160
|
+
An exited command has \`exitCode\`, \`aborted\`, and \`closeSignal\`. An execution error has none of these fields. \`read\`, \`wait\`, and \`stop\` report its message in \`error\`, and \`list\` omits it. A \`failed\` status can represent either a nonzero command exit or an execution error; inspect the corresponding fields. A \`stopped\` status indicates the job was aborted.
|
|
164
161
|
|
|
165
|
-
\`command\` and \`workingDirectory\` are bounded display strings and may be truncated. Each job retains the last
|
|
162
|
+
\`command\` and \`workingDirectory\` are bounded display strings and may be truncated. Each job retains the last ${MAX_COMMAND_CAPTURE_BYTES / 1024 / 1024} MiB of combined output. \`truncated\` indicates that capture is incomplete.
|
|
166
163
|
|
|
167
164
|
Up to 64 job records are retained. Starting another job may evict an older completed record; if all records are running, launch fails. Unknown IDs throw and do not prove a command never ran. Check current process and output state before restarting it.
|
|
168
165
|
|
|
169
166
|
## \`tau.bash.list()\`
|
|
170
167
|
|
|
171
|
-
List retained jobs without their output.
|
|
168
|
+
List retained jobs without their output or error messages.
|
|
172
169
|
|
|
173
170
|
\`\`\`ts
|
|
174
171
|
type ListResult = JobMetadata[];
|
|
@@ -178,7 +175,7 @@ Takes no arguments. Use \`read\` for a selected job's output.
|
|
|
178
175
|
|
|
179
176
|
## \`tau.bash.read(options)\`
|
|
180
177
|
|
|
181
|
-
Read one job's current state and
|
|
178
|
+
Read one job's current state and retained output without waiting for completion.
|
|
182
179
|
|
|
183
180
|
\`\`\`ts
|
|
184
181
|
type ReadOptions = { id: string };
|
|
@@ -201,7 +198,7 @@ type WaitOptions = {
|
|
|
201
198
|
\`\`\`
|
|
202
199
|
|
|
203
200
|
- \`ids\`: required, 1 to 64 nonempty job IDs.
|
|
204
|
-
- \`timeout\`: optional positive integer in milliseconds, default ${
|
|
201
|
+
- \`timeout\`: optional positive integer in milliseconds, default ${JOB_WAIT_DEFAULT_MS}, maximum ${JOB_WAIT_MAX_MS}.
|
|
205
202
|
|
|
206
203
|
### Result
|
|
207
204
|
|
|
@@ -223,7 +220,7 @@ type StopOptions = { id: string };
|
|
|
223
220
|
type StopResult = Job;
|
|
224
221
|
\`\`\`
|
|
225
222
|
|
|
226
|
-
\`id\` is required. Returns the completed job record with its output
|
|
223
|
+
\`id\` is required. Returns the completed job record with its retained output. Stopping an already completed job returns its existing record. Execution errors throw.
|
|
227
224
|
|
|
228
225
|
## Limits and failures
|
|
229
226
|
|
|
@@ -255,7 +252,7 @@ Invalid arguments, unknown job IDs, and launch failures throw. Errors after a ba
|
|
|
255
252
|
},
|
|
256
253
|
wait: async (args, context) => {
|
|
257
254
|
const [options] = z.tuple([waitOptions]).parse(args);
|
|
258
|
-
const timedOut = await jobs.waitJobs(options.ids, options.timeout ??
|
|
255
|
+
const timedOut = await jobs.waitJobs(options.ids, options.timeout ?? JOB_WAIT_DEFAULT_MS, context.signal);
|
|
259
256
|
return { jobs: jobs.read(options.ids), timedOut };
|
|
260
257
|
},
|
|
261
258
|
stop: async (args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/code_mode/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qCAAqC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/code_mode/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,q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BACrD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,OAAO,CAAC,GAAG,EACX,OAAO,CAAC,OAAO,IAAI,mBAAmB,EACtC,OAAO,CAAC,MAAM,CACf,CAAC;gBACF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC;YACpD,CAAC;YACD,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACnB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACnD,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -23,6 +23,7 @@ const searchInputSchema = z
|
|
|
23
23
|
const readInputSchema = z
|
|
24
24
|
.object({
|
|
25
25
|
sessionId: z.string().trim().min(1).max(256),
|
|
26
|
+
source: z.literal("local").optional(),
|
|
26
27
|
limit: z.number().int().min(1).max(100).default(50),
|
|
27
28
|
cursor: z.string().min(1).max(2_048).optional(),
|
|
28
29
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/core/code_mode/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,WAAW,GAAG;IAClB,4GAA4G;IAC5G,qLAAqL;CACtL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,M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