clanka 0.20.0 → 0.22.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.
Files changed (45) hide show
  1. package/dist/Acp.test.js +20 -8
  2. package/dist/Acp.test.js.map +1 -1
  3. package/dist/Agent.d.ts +4 -4
  4. package/dist/Agent.d.ts.map +1 -1
  5. package/dist/Agent.js +140 -99
  6. package/dist/Agent.js.map +1 -1
  7. package/dist/Agent.test.js +5 -4
  8. package/dist/Agent.test.js.map +1 -1
  9. package/dist/AgentBashJobs.test.js +51 -32
  10. package/dist/AgentBashJobs.test.js.map +1 -1
  11. package/dist/AgentCallerConfig.test.js +26 -7
  12. package/dist/AgentCallerConfig.test.js.map +1 -1
  13. package/dist/AgentExecutor.d.ts +71 -41
  14. package/dist/AgentExecutor.d.ts.map +1 -1
  15. package/dist/AgentExecutor.js +86 -78
  16. package/dist/AgentExecutor.js.map +1 -1
  17. package/dist/AgentExecutor.test.js +173 -72
  18. package/dist/AgentExecutor.test.js.map +1 -1
  19. package/dist/AgentExecutorImage.test.js +2 -2
  20. package/dist/AgentExecutorImage.test.js.map +1 -1
  21. package/dist/AgentImage.test.js +3 -2
  22. package/dist/AgentImage.test.js.map +1 -1
  23. package/dist/AgentSubagents.test.js +220 -31
  24. package/dist/AgentSubagents.test.js.map +1 -1
  25. package/dist/AgentTools.d.ts +369 -257
  26. package/dist/AgentTools.d.ts.map +1 -1
  27. package/dist/AgentTools.js +247 -190
  28. package/dist/AgentTools.js.map +1 -1
  29. package/dist/AgentTools.test.js +2 -2
  30. package/dist/AgentTools.test.js.map +1 -1
  31. package/dist/bin/cli.mjs +330 -281
  32. package/dist/bin/cli.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/src/Acp.test.ts +32 -11
  35. package/src/Agent.test.ts +5 -4
  36. package/src/Agent.ts +175 -137
  37. package/src/AgentBashJobs.test.ts +74 -38
  38. package/src/AgentCallerConfig.test.ts +39 -7
  39. package/src/AgentExecutor.test.ts +229 -72
  40. package/src/AgentExecutor.ts +120 -104
  41. package/src/AgentExecutorImage.test.ts +2 -2
  42. package/src/AgentImage.test.ts +4 -3
  43. package/src/AgentSubagents.test.ts +825 -562
  44. package/src/AgentTools.test.ts +2 -2
  45. package/src/AgentTools.ts +370 -278
@@ -35,106 +35,126 @@ declare const TaskCompleter_base: Context.ServiceClass<TaskCompleter, "clanka/Ag
35
35
  export declare class TaskCompleter extends TaskCompleter_base {
36
36
  }
37
37
  /**
38
+ * What a task is: a background `bash` command or a sub-agent started with
39
+ * `delegate`.
40
+ *
38
41
  * @since 1.0.0
39
42
  * @category Models
40
43
  */
41
- export declare const SubagentStatus: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
44
+ export declare const TaskKind: Schema.Literals<readonly ["bash", "agent"]>;
42
45
  /**
43
46
  * @since 1.0.0
44
47
  * @category Models
45
48
  */
46
- export type SubagentStatus = typeof SubagentStatus.Type;
49
+ export type TaskKind = typeof TaskKind.Type;
47
50
  /**
48
51
  * @since 1.0.0
49
52
  * @category Models
50
53
  */
51
- export declare const SubagentResult: Schema.Struct<{
52
- readonly id: Schema.String;
53
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
54
- readonly output: Schema.optional<Schema.String>;
55
- }>;
54
+ export declare const TaskStatus: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
56
55
  /**
57
56
  * @since 1.0.0
58
57
  * @category Models
59
58
  */
60
- export type SubagentResult = typeof SubagentResult.Type;
61
- /**
62
- * @since 1.0.0
63
- * @category Models
64
- */
65
- export declare const DelegateResult: Schema.Struct<{
66
- readonly id: Schema.String;
67
- readonly output: Schema.optional<Schema.String>;
68
- readonly status: Schema.Literals<readonly ["completed", "running"]>;
69
- }>;
70
- /**
71
- * @since 1.0.0
72
- * @category Models
73
- */
74
- export type DelegateResult = typeof DelegateResult.Type;
59
+ export type TaskStatus = typeof TaskStatus.Type;
75
60
  /**
61
+ * A background `bash` command or a sub-agent, as returned by the task
62
+ * functions. Both kinds share one id space per executor.
63
+ *
76
64
  * @since 1.0.0
77
65
  * @category Models
78
66
  */
79
- export declare const SubagentInfo: Schema.Struct<{
67
+ export declare const Task: Schema.Struct<{
80
68
  readonly id: Schema.String;
81
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
82
- readonly prompt: Schema.String;
69
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
70
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
71
+ /** The bash command, or the sub-agent's prompt. */
72
+ readonly description: Schema.String;
73
+ /** Output so far while running; the final output, or the error, once ended. */
74
+ readonly output: Schema.String;
75
+ /** bash only: set when the command exited on its own. */
76
+ readonly exitCode: Schema.optional<Schema.Number>;
83
77
  }>;
84
78
  /**
85
79
  * @since 1.0.0
86
80
  * @category Models
87
81
  */
88
- export type SubagentInfo = typeof SubagentInfo.Type;
82
+ export type Task = typeof Task.Type;
89
83
  /**
90
- * Manages the sub-agents of one agent. Every function only sees the agents
91
- * spawned by that agent.
84
+ * The sub-agent side of the task functions, for one agent. The executor
85
+ * resolves bash tasks itself and hands agent tasks to these, so every
86
+ * function only receives ids of agents that this agent started.
92
87
  *
93
88
  * @since 1.0.0
94
89
  * @category Models
95
90
  */
96
- export interface Subagents {
91
+ export interface AgentTasks {
97
92
  /**
98
- * Start a sub-agent. In the foreground it resolves once the agent has
99
- * finished, and dies if the agent failed. In the background it resolves
100
- * straight away with `status: "running"`.
93
+ * Start a sub-agent under the id the executor allocated. In the foreground
94
+ * it resolves once the agent has finished, and dies if the agent failed.
95
+ * In the background it resolves straight away with `status: "running"`.
101
96
  */
102
97
  readonly delegate: (options: {
98
+ readonly id: string;
103
99
  readonly prompt: string;
104
100
  readonly background: boolean;
105
- }) => Effect.Effect<DelegateResult>;
101
+ }) => Effect.Effect<Task>;
102
+ /**
103
+ * The agent's status and output so far. A final status counts as reported.
104
+ */
105
+ readonly taskOutput: (id: string) => Effect.Effect<Task, string>;
106
106
  /**
107
- * Wait for the listed agents, or all of them when `ids` is undefined.
108
- * Failures are returned as results, not raised.
107
+ * Wait up to `timeoutMs` for the listed agents to end, then report the
108
+ * ones that ended all at once. Agents still running at the deadline are
109
+ * returned as running and keep going. Failures are returned as tasks, not
110
+ * raised. The executor calls it once per batch, after waiting for any bash
111
+ * tasks in the batch, with the time left, so nothing is reported while the
112
+ * batch is still waiting.
109
113
  */
110
- readonly waitAgents: (ids: ReadonlyArray<string> | undefined) => Effect.Effect<ReadonlyArray<SubagentResult>, string>;
114
+ readonly waitTasks: (ids: ReadonlyArray<string>, options: {
115
+ readonly timeoutMs: number;
116
+ }) => Effect.Effect<ReadonlyArray<Task>, string>;
111
117
  /**
112
118
  * Steer a running agent, or start a new turn on a finished one.
113
119
  */
114
120
  readonly messageAgent: (options: {
115
121
  readonly id: string;
116
122
  readonly message: string;
117
- }) => Effect.Effect<SubagentResult, string>;
123
+ }) => Effect.Effect<void, string>;
118
124
  /**
119
125
  * Interrupt an agent and everything it spawned.
120
126
  */
121
- readonly stopAgent: (id: string) => Effect.Effect<SubagentResult, string>;
122
- readonly listAgents: Effect.Effect<ReadonlyArray<SubagentInfo>>;
127
+ readonly stopTask: (id: string) => Effect.Effect<Task, string>;
128
+ /**
129
+ * The agents this agent started.
130
+ */
131
+ readonly listTasks: Effect.Effect<ReadonlyArray<Task>>;
123
132
  }
124
- declare const SubagentExecutor_base: Context.ServiceClass<SubagentExecutor, "clanka/AgentTools/SubagentExecutor", Subagents>;
133
+ declare const AgentTaskExecutor_base: Context.ServiceClass<AgentTaskExecutor, "clanka/AgentTools/AgentTaskExecutor", AgentTasks>;
125
134
  /**
126
135
  * @since 1.0.0
127
136
  * @category Context
128
137
  */
129
- export declare class SubagentExecutor extends SubagentExecutor_base {
138
+ export declare class AgentTaskExecutor extends AgentTaskExecutor_base {
130
139
  }
131
140
  /**
132
- * A `Subagents` implementation for contexts that cannot spawn agents.
141
+ * An `AgentTasks` implementation for contexts that cannot spawn agents.
142
+ *
143
+ * @since 1.0.0
144
+ * @category Context
145
+ */
146
+ export declare const agentTasksUnavailable: AgentTasks;
147
+ declare const TaskOwner_base: Context.Reference<string | undefined>;
148
+ /**
149
+ * The agent running the current script. Tasks are only visible to the agent
150
+ * that started them; scripts without an agent share the `undefined` owner.
151
+ * The executor sets it from `ExecuteOptions.agentId`.
133
152
  *
134
153
  * @since 1.0.0
135
154
  * @category Context
136
155
  */
137
- export declare const subagentsUnavailable: Subagents;
156
+ export declare class TaskOwner extends TaskOwner_base {
157
+ }
138
158
  /**
139
159
  * An image read by `readFile`, handed to the Agent so it can be spliced onto
140
160
  * the Prompt for the next model turn.
@@ -155,60 +175,34 @@ declare const ImageAttacher_base: Context.ServiceClass<ImageAttacher, "clanka/Ag
155
175
  export declare class ImageAttacher extends ImageAttacher_base {
156
176
  }
157
177
  /**
158
- * @since 1.0.0
159
- * @category Models
160
- */
161
- export declare const BashJobStatus: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
162
- /**
163
- * @since 1.0.0
164
- * @category Models
165
- */
166
- export type BashJobStatus = typeof BashJobStatus.Type;
167
- /**
168
- * A `bash` command running in the background, as returned by `jobOutput`
169
- * and `stopJob`.
170
- *
171
- * @since 1.0.0
172
- * @category Models
173
- */
174
- export declare const BashJob: Schema.Struct<{
175
- readonly id: Schema.String;
176
- readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
177
- readonly exitCode: Schema.optional<Schema.Number>;
178
- readonly output: Schema.String;
179
- }>;
180
- /**
181
- * @since 1.0.0
182
- * @category Models
183
- */
184
- export type BashJob = typeof BashJob.Type;
185
- /**
186
- * A background `bash` job, handed to the `JobWatcher` when it starts.
178
+ * A task that has started, handed to the `TaskWatcher`.
187
179
  *
188
180
  * @since 1.0.0
189
181
  * @category Models
190
182
  */
191
- export interface BackgroundJob {
183
+ export interface TaskHandle {
192
184
  readonly id: string;
193
- /** Waits for the job to end and succeeds with its final state. */
194
- readonly await: Effect.Effect<BashJob>;
185
+ readonly kind: TaskKind;
186
+ /** Waits for the task to end and succeeds with its final state. */
187
+ readonly await: Effect.Effect<Task>;
195
188
  /**
196
- * Marks the job's final state as reported. Succeeds with `false` when it
197
- * already was: by `stopJob`, by a `jobOutput` call that returned it, or by
198
- * an earlier `claim`.
189
+ * Marks the task's final state as reported. Succeeds with `false` when it
190
+ * already was: by `stopTask`, `waitTasks`, a `taskOutput` call that
191
+ * returned it, or an earlier `claim`.
199
192
  */
200
193
  readonly claim: Effect.Effect<boolean>;
201
194
  }
202
- declare const JobWatcher_base: Context.Reference<(job: BackgroundJob) => Effect.Effect<void>>;
195
+ declare const TaskWatcher_base: Context.Reference<(task: TaskHandle) => Effect.Effect<void>>;
203
196
  /**
204
- * Receives every background `bash` job as it starts: those started with
205
- * `background: true` and those moved to the background at their timeout.
206
- * The executor sets it from `ExecuteOptions.onJob`.
197
+ * Receives every background `bash` task as it starts: those started with
198
+ * `background: true` and those moved to the background at their timeout. A
199
+ * command that `bash` returns finished is never handed over.
200
+ * The executor sets it from `ExecuteOptions.onTask`.
207
201
  *
208
202
  * @since 1.0.0
209
203
  * @category Context
210
204
  */
211
- export declare class JobWatcher extends JobWatcher_base {
205
+ export declare class TaskWatcher extends TaskWatcher_base {
212
206
  }
213
207
  /**
214
208
  * The `bash` timeout when the caller sets none.
@@ -254,7 +248,17 @@ export declare const makeBashTool: (timeout: Duration.Duration) => Tool.Tool<"ba
254
248
  readonly timeoutMs: Schema.optional<Schema.Finite>;
255
249
  readonly background: Schema.optional<Schema.Boolean>;
256
250
  }>;
257
- readonly success: Schema.String;
251
+ readonly success: Schema.Struct<{
252
+ readonly id: Schema.String;
253
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
254
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
255
+ /** The bash command, or the sub-agent's prompt. */
256
+ readonly description: Schema.String;
257
+ /** Output so far while running; the final output, or the error, once ended. */
258
+ readonly output: Schema.String;
259
+ /** bash only: set when the command exited on its own. */
260
+ readonly exitCode: Schema.optional<Schema.Number>;
261
+ }>;
258
262
  readonly failure: Schema.Never;
259
263
  readonly failureMode: "error";
260
264
  }, CurrentDirectory>;
@@ -262,7 +266,7 @@ export declare const makeBashTool: (timeout: Duration.Duration) => Tool.Tool<"ba
262
266
  * @since 1.0.0
263
267
  * @category Context
264
268
  */
265
- export declare const makeContextNoop: (cwd?: string) => Context.Context<CurrentDirectory | DirectoryChanger | ImageAttacher | SubagentExecutor | TaskCompleter>;
269
+ export declare const makeContextNoop: (cwd?: string) => Context.Context<AgentTaskExecutor | CurrentDirectory | DirectoryChanger | ImageAttacher | TaskCompleter>;
266
270
  /**
267
271
  * @since 1.0.0
268
272
  * @category Toolkit
@@ -280,7 +284,17 @@ export declare const AgentTools: Toolkit.Toolkit<{
280
284
  readonly timeoutMs: Schema.optional<Schema.Finite>;
281
285
  readonly background: Schema.optional<Schema.Boolean>;
282
286
  }>;
283
- readonly success: Schema.String;
287
+ readonly success: Schema.Struct<{
288
+ readonly id: Schema.String;
289
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
290
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
291
+ /** The bash command, or the sub-agent's prompt. */
292
+ readonly description: Schema.String;
293
+ /** Output so far while running; the final output, or the error, once ended. */
294
+ readonly output: Schema.String;
295
+ /** bash only: set when the command exited on its own. */
296
+ readonly exitCode: Schema.optional<Schema.Number>;
297
+ }>;
284
298
  readonly failure: Schema.Never;
285
299
  readonly failureMode: "error";
286
300
  }, CurrentDirectory>;
@@ -297,12 +311,18 @@ export declare const AgentTools: Toolkit.Toolkit<{
297
311
  }>;
298
312
  readonly success: Schema.Struct<{
299
313
  readonly id: Schema.String;
300
- readonly output: Schema.optional<Schema.String>;
301
- readonly status: Schema.Literals<readonly ["completed", "running"]>;
314
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
315
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
316
+ /** The bash command, or the sub-agent's prompt. */
317
+ readonly description: Schema.String;
318
+ /** Output so far while running; the final output, or the error, once ended. */
319
+ readonly output: Schema.String;
320
+ /** bash only: set when the command exited on its own. */
321
+ readonly exitCode: Schema.optional<Schema.Number>;
302
322
  }>;
303
323
  readonly failure: Schema.String;
304
324
  readonly failureMode: "error";
305
- }, SubagentExecutor>;
325
+ }, AgentTaskExecutor>;
306
326
  readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
307
327
  readonly parameters: Schema.String;
308
328
  readonly success: Schema.String;
@@ -321,27 +341,22 @@ export declare const AgentTools: Toolkit.Toolkit<{
321
341
  readonly failure: Schema.Never;
322
342
  readonly failureMode: "error";
323
343
  }, CurrentDirectory>;
324
- readonly jobOutput: Tool.Tool<"jobOutput", {
325
- readonly parameters: Schema.String;
326
- readonly success: Schema.Struct<{
327
- readonly id: Schema.String;
328
- readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
329
- readonly exitCode: Schema.optional<Schema.Number>;
330
- readonly output: Schema.String;
331
- }>;
332
- readonly failure: Schema.String;
333
- readonly failureMode: "error";
334
- }, never>;
335
- readonly listAgents: Tool.Tool<"listAgents", {
344
+ readonly listTasks: Tool.Tool<"listTasks", {
336
345
  readonly parameters: Schema.Void;
337
346
  readonly success: Schema.$Array<Schema.Struct<{
338
347
  readonly id: Schema.String;
339
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
340
- readonly prompt: Schema.String;
348
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
349
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
350
+ /** The bash command, or the sub-agent's prompt. */
351
+ readonly description: Schema.String;
352
+ /** Output so far while running; the final output, or the error, once ended. */
353
+ readonly output: Schema.String;
354
+ /** bash only: set when the command exited on its own. */
355
+ readonly exitCode: Schema.optional<Schema.Number>;
341
356
  }>>;
342
357
  readonly failure: Schema.Never;
343
358
  readonly failureMode: "error";
344
- }, SubagentExecutor>;
359
+ }, AgentTaskExecutor>;
345
360
  readonly ls: Tool.Tool<"ls", {
346
361
  readonly parameters: Schema.String;
347
362
  readonly success: Schema.$Array<Schema.String>;
@@ -353,14 +368,10 @@ export declare const AgentTools: Toolkit.Toolkit<{
353
368
  readonly id: Schema.String;
354
369
  readonly message: Schema.String;
355
370
  }>;
356
- readonly success: Schema.Struct<{
357
- readonly id: Schema.String;
358
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
359
- readonly output: Schema.optional<Schema.String>;
360
- }>;
371
+ readonly success: Schema.Void;
361
372
  readonly failure: Schema.String;
362
373
  readonly failureMode: "error";
363
- }, SubagentExecutor>;
374
+ }, AgentTaskExecutor>;
364
375
  readonly readFile: Tool.Tool<"readFile", {
365
376
  readonly parameters: Schema.Struct<{
366
377
  readonly path: Schema.String;
@@ -404,43 +415,63 @@ export declare const AgentTools: Toolkit.Toolkit<{
404
415
  readonly failure: Schema.Never;
405
416
  readonly failureMode: "error";
406
417
  }, never>;
407
- readonly stopAgent: Tool.Tool<"stopAgent", {
408
- readonly parameters: Schema.String;
409
- readonly success: Schema.Struct<{
410
- readonly id: Schema.String;
411
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
412
- readonly output: Schema.optional<Schema.String>;
413
- }>;
414
- readonly failure: Schema.String;
415
- readonly failureMode: "error";
416
- }, SubagentExecutor>;
417
- readonly stopJob: Tool.Tool<"stopJob", {
418
+ readonly stopTask: Tool.Tool<"stopTask", {
418
419
  readonly parameters: Schema.String;
419
420
  readonly success: Schema.Struct<{
420
421
  readonly id: Schema.String;
422
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
421
423
  readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
422
- readonly exitCode: Schema.optional<Schema.Number>;
424
+ /** The bash command, or the sub-agent's prompt. */
425
+ readonly description: Schema.String;
426
+ /** Output so far while running; the final output, or the error, once ended. */
423
427
  readonly output: Schema.String;
428
+ /** bash only: set when the command exited on its own. */
429
+ readonly exitCode: Schema.optional<Schema.Number>;
424
430
  }>;
425
431
  readonly failure: Schema.String;
426
432
  readonly failureMode: "error";
427
- }, never>;
433
+ }, AgentTaskExecutor>;
428
434
  readonly taskComplete: Tool.Tool<"taskComplete", {
429
435
  readonly parameters: Schema.String;
430
436
  readonly success: Schema.Void;
431
437
  readonly failure: Schema.String;
432
438
  readonly failureMode: "error";
433
439
  }, TaskCompleter>;
434
- readonly waitAgents: Tool.Tool<"waitAgents", {
435
- readonly parameters: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
440
+ readonly taskOutput: Tool.Tool<"taskOutput", {
441
+ readonly parameters: Schema.String;
442
+ readonly success: Schema.Struct<{
443
+ readonly id: Schema.String;
444
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
445
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
446
+ /** The bash command, or the sub-agent's prompt. */
447
+ readonly description: Schema.String;
448
+ /** Output so far while running; the final output, or the error, once ended. */
449
+ readonly output: Schema.String;
450
+ /** bash only: set when the command exited on its own. */
451
+ readonly exitCode: Schema.optional<Schema.Number>;
452
+ }>;
453
+ readonly failure: Schema.String;
454
+ readonly failureMode: "error";
455
+ }, AgentTaskExecutor>;
456
+ readonly waitTasks: Tool.Tool<"waitTasks", {
457
+ readonly parameters: Schema.Struct<{
458
+ readonly ids: Schema.$Array<Schema.String>;
459
+ readonly timeoutMs: Schema.optional<Schema.Finite>;
460
+ }>;
436
461
  readonly success: Schema.$Array<Schema.Struct<{
437
462
  readonly id: Schema.String;
438
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
439
- readonly output: Schema.optional<Schema.String>;
463
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
464
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
465
+ /** The bash command, or the sub-agent's prompt. */
466
+ readonly description: Schema.String;
467
+ /** Output so far while running; the final output, or the error, once ended. */
468
+ readonly output: Schema.String;
469
+ /** bash only: set when the command exited on its own. */
470
+ readonly exitCode: Schema.optional<Schema.Number>;
440
471
  }>>;
441
472
  readonly failure: Schema.String;
442
473
  readonly failureMode: "error";
443
- }, SubagentExecutor>;
474
+ }, AgentTaskExecutor>;
444
475
  readonly webSearch: Tool.Tool<"webSearch", {
445
476
  readonly parameters: Schema.Struct<{
446
477
  readonly query: Schema.String;
@@ -477,7 +508,17 @@ export declare const AgentToolsWithSearch: Toolkit.Toolkit<{
477
508
  readonly timeoutMs: Schema.optional<Schema.Finite>;
478
509
  readonly background: Schema.optional<Schema.Boolean>;
479
510
  }>;
480
- readonly success: Schema.String;
511
+ readonly success: Schema.Struct<{
512
+ readonly id: Schema.String;
513
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
514
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
515
+ /** The bash command, or the sub-agent's prompt. */
516
+ readonly description: Schema.String;
517
+ /** Output so far while running; the final output, or the error, once ended. */
518
+ readonly output: Schema.String;
519
+ /** bash only: set when the command exited on its own. */
520
+ readonly exitCode: Schema.optional<Schema.Number>;
521
+ }>;
481
522
  readonly failure: Schema.Never;
482
523
  readonly failureMode: "error";
483
524
  }, CurrentDirectory>;
@@ -494,12 +535,18 @@ export declare const AgentToolsWithSearch: Toolkit.Toolkit<{
494
535
  }>;
495
536
  readonly success: Schema.Struct<{
496
537
  readonly id: Schema.String;
497
- readonly output: Schema.optional<Schema.String>;
498
- readonly status: Schema.Literals<readonly ["completed", "running"]>;
538
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
539
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
540
+ /** The bash command, or the sub-agent's prompt. */
541
+ readonly description: Schema.String;
542
+ /** Output so far while running; the final output, or the error, once ended. */
543
+ readonly output: Schema.String;
544
+ /** bash only: set when the command exited on its own. */
545
+ readonly exitCode: Schema.optional<Schema.Number>;
499
546
  }>;
500
547
  readonly failure: Schema.String;
501
548
  readonly failureMode: "error";
502
- }, SubagentExecutor>;
549
+ }, AgentTaskExecutor>;
503
550
  readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
504
551
  readonly parameters: Schema.String;
505
552
  readonly success: Schema.String;
@@ -518,27 +565,22 @@ export declare const AgentToolsWithSearch: Toolkit.Toolkit<{
518
565
  readonly failure: Schema.Never;
519
566
  readonly failureMode: "error";
520
567
  }, CurrentDirectory>;
521
- readonly jobOutput: Tool.Tool<"jobOutput", {
522
- readonly parameters: Schema.String;
523
- readonly success: Schema.Struct<{
524
- readonly id: Schema.String;
525
- readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
526
- readonly exitCode: Schema.optional<Schema.Number>;
527
- readonly output: Schema.String;
528
- }>;
529
- readonly failure: Schema.String;
530
- readonly failureMode: "error";
531
- }, never>;
532
- readonly listAgents: Tool.Tool<"listAgents", {
568
+ readonly listTasks: Tool.Tool<"listTasks", {
533
569
  readonly parameters: Schema.Void;
534
570
  readonly success: Schema.$Array<Schema.Struct<{
535
571
  readonly id: Schema.String;
536
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
537
- readonly prompt: Schema.String;
572
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
573
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
574
+ /** The bash command, or the sub-agent's prompt. */
575
+ readonly description: Schema.String;
576
+ /** Output so far while running; the final output, or the error, once ended. */
577
+ readonly output: Schema.String;
578
+ /** bash only: set when the command exited on its own. */
579
+ readonly exitCode: Schema.optional<Schema.Number>;
538
580
  }>>;
539
581
  readonly failure: Schema.Never;
540
582
  readonly failureMode: "error";
541
- }, SubagentExecutor>;
583
+ }, AgentTaskExecutor>;
542
584
  readonly ls: Tool.Tool<"ls", {
543
585
  readonly parameters: Schema.String;
544
586
  readonly success: Schema.$Array<Schema.String>;
@@ -550,14 +592,10 @@ export declare const AgentToolsWithSearch: Toolkit.Toolkit<{
550
592
  readonly id: Schema.String;
551
593
  readonly message: Schema.String;
552
594
  }>;
553
- readonly success: Schema.Struct<{
554
- readonly id: Schema.String;
555
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
556
- readonly output: Schema.optional<Schema.String>;
557
- }>;
595
+ readonly success: Schema.Void;
558
596
  readonly failure: Schema.String;
559
597
  readonly failureMode: "error";
560
- }, SubagentExecutor>;
598
+ }, AgentTaskExecutor>;
561
599
  readonly readFile: Tool.Tool<"readFile", {
562
600
  readonly parameters: Schema.Struct<{
563
601
  readonly path: Schema.String;
@@ -607,43 +645,63 @@ export declare const AgentToolsWithSearch: Toolkit.Toolkit<{
607
645
  readonly failure: Schema.Never;
608
646
  readonly failureMode: "error";
609
647
  }, never>;
610
- readonly stopAgent: Tool.Tool<"stopAgent", {
611
- readonly parameters: Schema.String;
612
- readonly success: Schema.Struct<{
613
- readonly id: Schema.String;
614
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
615
- readonly output: Schema.optional<Schema.String>;
616
- }>;
617
- readonly failure: Schema.String;
618
- readonly failureMode: "error";
619
- }, SubagentExecutor>;
620
- readonly stopJob: Tool.Tool<"stopJob", {
648
+ readonly stopTask: Tool.Tool<"stopTask", {
621
649
  readonly parameters: Schema.String;
622
650
  readonly success: Schema.Struct<{
623
651
  readonly id: Schema.String;
652
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
624
653
  readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
625
- readonly exitCode: Schema.optional<Schema.Number>;
654
+ /** The bash command, or the sub-agent's prompt. */
655
+ readonly description: Schema.String;
656
+ /** Output so far while running; the final output, or the error, once ended. */
626
657
  readonly output: Schema.String;
658
+ /** bash only: set when the command exited on its own. */
659
+ readonly exitCode: Schema.optional<Schema.Number>;
627
660
  }>;
628
661
  readonly failure: Schema.String;
629
662
  readonly failureMode: "error";
630
- }, never>;
663
+ }, AgentTaskExecutor>;
631
664
  readonly taskComplete: Tool.Tool<"taskComplete", {
632
665
  readonly parameters: Schema.String;
633
666
  readonly success: Schema.Void;
634
667
  readonly failure: Schema.String;
635
668
  readonly failureMode: "error";
636
669
  }, TaskCompleter>;
637
- readonly waitAgents: Tool.Tool<"waitAgents", {
638
- readonly parameters: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
670
+ readonly taskOutput: Tool.Tool<"taskOutput", {
671
+ readonly parameters: Schema.String;
672
+ readonly success: Schema.Struct<{
673
+ readonly id: Schema.String;
674
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
675
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
676
+ /** The bash command, or the sub-agent's prompt. */
677
+ readonly description: Schema.String;
678
+ /** Output so far while running; the final output, or the error, once ended. */
679
+ readonly output: Schema.String;
680
+ /** bash only: set when the command exited on its own. */
681
+ readonly exitCode: Schema.optional<Schema.Number>;
682
+ }>;
683
+ readonly failure: Schema.String;
684
+ readonly failureMode: "error";
685
+ }, AgentTaskExecutor>;
686
+ readonly waitTasks: Tool.Tool<"waitTasks", {
687
+ readonly parameters: Schema.Struct<{
688
+ readonly ids: Schema.$Array<Schema.String>;
689
+ readonly timeoutMs: Schema.optional<Schema.Finite>;
690
+ }>;
639
691
  readonly success: Schema.$Array<Schema.Struct<{
640
692
  readonly id: Schema.String;
641
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
642
- readonly output: Schema.optional<Schema.String>;
693
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
694
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
695
+ /** The bash command, or the sub-agent's prompt. */
696
+ readonly description: Schema.String;
697
+ /** Output so far while running; the final output, or the error, once ended. */
698
+ readonly output: Schema.String;
699
+ /** bash only: set when the command exited on its own. */
700
+ readonly exitCode: Schema.optional<Schema.Number>;
643
701
  }>>;
644
702
  readonly failure: Schema.String;
645
703
  readonly failureMode: "error";
646
- }, SubagentExecutor>;
704
+ }, AgentTaskExecutor>;
647
705
  readonly webSearch: Tool.Tool<"webSearch", {
648
706
  readonly parameters: Schema.Struct<{
649
707
  readonly query: Schema.String;
@@ -687,7 +745,17 @@ export declare const AgentToolHandlersNoDeps: Layer.Layer<Tool.HandlersFor<{
687
745
  readonly timeoutMs: Schema.optional<Schema.Finite>;
688
746
  readonly background: Schema.optional<Schema.Boolean>;
689
747
  }>;
690
- readonly success: Schema.String;
748
+ readonly success: Schema.Struct<{
749
+ readonly id: Schema.String;
750
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
751
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
752
+ /** The bash command, or the sub-agent's prompt. */
753
+ readonly description: Schema.String;
754
+ /** Output so far while running; the final output, or the error, once ended. */
755
+ readonly output: Schema.String;
756
+ /** bash only: set when the command exited on its own. */
757
+ readonly exitCode: Schema.optional<Schema.Number>;
758
+ }>;
691
759
  readonly failure: Schema.Never;
692
760
  readonly failureMode: "error";
693
761
  }, CurrentDirectory>;
@@ -704,12 +772,18 @@ export declare const AgentToolHandlersNoDeps: Layer.Layer<Tool.HandlersFor<{
704
772
  }>;
705
773
  readonly success: Schema.Struct<{
706
774
  readonly id: Schema.String;
707
- readonly output: Schema.optional<Schema.String>;
708
- readonly status: Schema.Literals<readonly ["completed", "running"]>;
775
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
776
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
777
+ /** The bash command, or the sub-agent's prompt. */
778
+ readonly description: Schema.String;
779
+ /** Output so far while running; the final output, or the error, once ended. */
780
+ readonly output: Schema.String;
781
+ /** bash only: set when the command exited on its own. */
782
+ readonly exitCode: Schema.optional<Schema.Number>;
709
783
  }>;
710
784
  readonly failure: Schema.String;
711
785
  readonly failureMode: "error";
712
- }, SubagentExecutor>;
786
+ }, AgentTaskExecutor>;
713
787
  readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
714
788
  readonly parameters: Schema.String;
715
789
  readonly success: Schema.String;
@@ -728,27 +802,22 @@ export declare const AgentToolHandlersNoDeps: Layer.Layer<Tool.HandlersFor<{
728
802
  readonly failure: Schema.Never;
729
803
  readonly failureMode: "error";
730
804
  }, CurrentDirectory>;
731
- readonly jobOutput: Tool.Tool<"jobOutput", {
732
- readonly parameters: Schema.String;
733
- readonly success: Schema.Struct<{
734
- readonly id: Schema.String;
735
- readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
736
- readonly exitCode: Schema.optional<Schema.Number>;
737
- readonly output: Schema.String;
738
- }>;
739
- readonly failure: Schema.String;
740
- readonly failureMode: "error";
741
- }, never>;
742
- readonly listAgents: Tool.Tool<"listAgents", {
805
+ readonly listTasks: Tool.Tool<"listTasks", {
743
806
  readonly parameters: Schema.Void;
744
807
  readonly success: Schema.$Array<Schema.Struct<{
745
808
  readonly id: Schema.String;
746
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
747
- readonly prompt: Schema.String;
809
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
810
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
811
+ /** The bash command, or the sub-agent's prompt. */
812
+ readonly description: Schema.String;
813
+ /** Output so far while running; the final output, or the error, once ended. */
814
+ readonly output: Schema.String;
815
+ /** bash only: set when the command exited on its own. */
816
+ readonly exitCode: Schema.optional<Schema.Number>;
748
817
  }>>;
749
818
  readonly failure: Schema.Never;
750
819
  readonly failureMode: "error";
751
- }, SubagentExecutor>;
820
+ }, AgentTaskExecutor>;
752
821
  readonly ls: Tool.Tool<"ls", {
753
822
  readonly parameters: Schema.String;
754
823
  readonly success: Schema.$Array<Schema.String>;
@@ -760,14 +829,10 @@ export declare const AgentToolHandlersNoDeps: Layer.Layer<Tool.HandlersFor<{
760
829
  readonly id: Schema.String;
761
830
  readonly message: Schema.String;
762
831
  }>;
763
- readonly success: Schema.Struct<{
764
- readonly id: Schema.String;
765
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
766
- readonly output: Schema.optional<Schema.String>;
767
- }>;
832
+ readonly success: Schema.Void;
768
833
  readonly failure: Schema.String;
769
834
  readonly failureMode: "error";
770
- }, SubagentExecutor>;
835
+ }, AgentTaskExecutor>;
771
836
  readonly readFile: Tool.Tool<"readFile", {
772
837
  readonly parameters: Schema.Struct<{
773
838
  readonly path: Schema.String;
@@ -817,43 +882,63 @@ export declare const AgentToolHandlersNoDeps: Layer.Layer<Tool.HandlersFor<{
817
882
  readonly failure: Schema.Never;
818
883
  readonly failureMode: "error";
819
884
  }, never>;
820
- readonly stopAgent: Tool.Tool<"stopAgent", {
821
- readonly parameters: Schema.String;
822
- readonly success: Schema.Struct<{
823
- readonly id: Schema.String;
824
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
825
- readonly output: Schema.optional<Schema.String>;
826
- }>;
827
- readonly failure: Schema.String;
828
- readonly failureMode: "error";
829
- }, SubagentExecutor>;
830
- readonly stopJob: Tool.Tool<"stopJob", {
885
+ readonly stopTask: Tool.Tool<"stopTask", {
831
886
  readonly parameters: Schema.String;
832
887
  readonly success: Schema.Struct<{
833
888
  readonly id: Schema.String;
889
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
834
890
  readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
835
- readonly exitCode: Schema.optional<Schema.Number>;
891
+ /** The bash command, or the sub-agent's prompt. */
892
+ readonly description: Schema.String;
893
+ /** Output so far while running; the final output, or the error, once ended. */
836
894
  readonly output: Schema.String;
895
+ /** bash only: set when the command exited on its own. */
896
+ readonly exitCode: Schema.optional<Schema.Number>;
837
897
  }>;
838
898
  readonly failure: Schema.String;
839
899
  readonly failureMode: "error";
840
- }, never>;
900
+ }, AgentTaskExecutor>;
841
901
  readonly taskComplete: Tool.Tool<"taskComplete", {
842
902
  readonly parameters: Schema.String;
843
903
  readonly success: Schema.Void;
844
904
  readonly failure: Schema.String;
845
905
  readonly failureMode: "error";
846
906
  }, TaskCompleter>;
847
- readonly waitAgents: Tool.Tool<"waitAgents", {
848
- readonly parameters: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
907
+ readonly taskOutput: Tool.Tool<"taskOutput", {
908
+ readonly parameters: Schema.String;
909
+ readonly success: Schema.Struct<{
910
+ readonly id: Schema.String;
911
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
912
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
913
+ /** The bash command, or the sub-agent's prompt. */
914
+ readonly description: Schema.String;
915
+ /** Output so far while running; the final output, or the error, once ended. */
916
+ readonly output: Schema.String;
917
+ /** bash only: set when the command exited on its own. */
918
+ readonly exitCode: Schema.optional<Schema.Number>;
919
+ }>;
920
+ readonly failure: Schema.String;
921
+ readonly failureMode: "error";
922
+ }, AgentTaskExecutor>;
923
+ readonly waitTasks: Tool.Tool<"waitTasks", {
924
+ readonly parameters: Schema.Struct<{
925
+ readonly ids: Schema.$Array<Schema.String>;
926
+ readonly timeoutMs: Schema.optional<Schema.Finite>;
927
+ }>;
849
928
  readonly success: Schema.$Array<Schema.Struct<{
850
929
  readonly id: Schema.String;
851
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
852
- readonly output: Schema.optional<Schema.String>;
930
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
931
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
932
+ /** The bash command, or the sub-agent's prompt. */
933
+ readonly description: Schema.String;
934
+ /** Output so far while running; the final output, or the error, once ended. */
935
+ readonly output: Schema.String;
936
+ /** bash only: set when the command exited on its own. */
937
+ readonly exitCode: Schema.optional<Schema.Number>;
853
938
  }>>;
854
939
  readonly failure: Schema.String;
855
940
  readonly failureMode: "error";
856
- }, SubagentExecutor>;
941
+ }, AgentTaskExecutor>;
857
942
  readonly webSearch: Tool.Tool<"webSearch", {
858
943
  readonly parameters: Schema.Struct<{
859
944
  readonly query: Schema.String;
@@ -895,7 +980,17 @@ export declare const AgentToolHandlersTest: Layer.Layer<Tool.HandlersFor<{
895
980
  readonly timeoutMs: Schema.optional<Schema.Finite>;
896
981
  readonly background: Schema.optional<Schema.Boolean>;
897
982
  }>;
898
- readonly success: Schema.String;
983
+ readonly success: Schema.Struct<{
984
+ readonly id: Schema.String;
985
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
986
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
987
+ /** The bash command, or the sub-agent's prompt. */
988
+ readonly description: Schema.String;
989
+ /** Output so far while running; the final output, or the error, once ended. */
990
+ readonly output: Schema.String;
991
+ /** bash only: set when the command exited on its own. */
992
+ readonly exitCode: Schema.optional<Schema.Number>;
993
+ }>;
899
994
  readonly failure: Schema.Never;
900
995
  readonly failureMode: "error";
901
996
  }, CurrentDirectory>;
@@ -912,12 +1007,18 @@ export declare const AgentToolHandlersTest: Layer.Layer<Tool.HandlersFor<{
912
1007
  }>;
913
1008
  readonly success: Schema.Struct<{
914
1009
  readonly id: Schema.String;
915
- readonly output: Schema.optional<Schema.String>;
916
- readonly status: Schema.Literals<readonly ["completed", "running"]>;
1010
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
1011
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
1012
+ /** The bash command, or the sub-agent's prompt. */
1013
+ readonly description: Schema.String;
1014
+ /** Output so far while running; the final output, or the error, once ended. */
1015
+ readonly output: Schema.String;
1016
+ /** bash only: set when the command exited on its own. */
1017
+ readonly exitCode: Schema.optional<Schema.Number>;
917
1018
  }>;
918
1019
  readonly failure: Schema.String;
919
1020
  readonly failureMode: "error";
920
- }, SubagentExecutor>;
1021
+ }, AgentTaskExecutor>;
921
1022
  readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
922
1023
  readonly parameters: Schema.String;
923
1024
  readonly success: Schema.String;
@@ -936,27 +1037,22 @@ export declare const AgentToolHandlersTest: Layer.Layer<Tool.HandlersFor<{
936
1037
  readonly failure: Schema.Never;
937
1038
  readonly failureMode: "error";
938
1039
  }, CurrentDirectory>;
939
- readonly jobOutput: Tool.Tool<"jobOutput", {
940
- readonly parameters: Schema.String;
941
- readonly success: Schema.Struct<{
942
- readonly id: Schema.String;
943
- readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
944
- readonly exitCode: Schema.optional<Schema.Number>;
945
- readonly output: Schema.String;
946
- }>;
947
- readonly failure: Schema.String;
948
- readonly failureMode: "error";
949
- }, never>;
950
- readonly listAgents: Tool.Tool<"listAgents", {
1040
+ readonly listTasks: Tool.Tool<"listTasks", {
951
1041
  readonly parameters: Schema.Void;
952
1042
  readonly success: Schema.$Array<Schema.Struct<{
953
1043
  readonly id: Schema.String;
954
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
955
- readonly prompt: Schema.String;
1044
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
1045
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
1046
+ /** The bash command, or the sub-agent's prompt. */
1047
+ readonly description: Schema.String;
1048
+ /** Output so far while running; the final output, or the error, once ended. */
1049
+ readonly output: Schema.String;
1050
+ /** bash only: set when the command exited on its own. */
1051
+ readonly exitCode: Schema.optional<Schema.Number>;
956
1052
  }>>;
957
1053
  readonly failure: Schema.Never;
958
1054
  readonly failureMode: "error";
959
- }, SubagentExecutor>;
1055
+ }, AgentTaskExecutor>;
960
1056
  readonly ls: Tool.Tool<"ls", {
961
1057
  readonly parameters: Schema.String;
962
1058
  readonly success: Schema.$Array<Schema.String>;
@@ -968,14 +1064,10 @@ export declare const AgentToolHandlersTest: Layer.Layer<Tool.HandlersFor<{
968
1064
  readonly id: Schema.String;
969
1065
  readonly message: Schema.String;
970
1066
  }>;
971
- readonly success: Schema.Struct<{
972
- readonly id: Schema.String;
973
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
974
- readonly output: Schema.optional<Schema.String>;
975
- }>;
1067
+ readonly success: Schema.Void;
976
1068
  readonly failure: Schema.String;
977
1069
  readonly failureMode: "error";
978
- }, SubagentExecutor>;
1070
+ }, AgentTaskExecutor>;
979
1071
  readonly readFile: Tool.Tool<"readFile", {
980
1072
  readonly parameters: Schema.Struct<{
981
1073
  readonly path: Schema.String;
@@ -1025,43 +1117,63 @@ export declare const AgentToolHandlersTest: Layer.Layer<Tool.HandlersFor<{
1025
1117
  readonly failure: Schema.Never;
1026
1118
  readonly failureMode: "error";
1027
1119
  }, never>;
1028
- readonly stopAgent: Tool.Tool<"stopAgent", {
1029
- readonly parameters: Schema.String;
1030
- readonly success: Schema.Struct<{
1031
- readonly id: Schema.String;
1032
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
1033
- readonly output: Schema.optional<Schema.String>;
1034
- }>;
1035
- readonly failure: Schema.String;
1036
- readonly failureMode: "error";
1037
- }, SubagentExecutor>;
1038
- readonly stopJob: Tool.Tool<"stopJob", {
1120
+ readonly stopTask: Tool.Tool<"stopTask", {
1039
1121
  readonly parameters: Schema.String;
1040
1122
  readonly success: Schema.Struct<{
1041
1123
  readonly id: Schema.String;
1124
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
1042
1125
  readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
1043
- readonly exitCode: Schema.optional<Schema.Number>;
1126
+ /** The bash command, or the sub-agent's prompt. */
1127
+ readonly description: Schema.String;
1128
+ /** Output so far while running; the final output, or the error, once ended. */
1044
1129
  readonly output: Schema.String;
1130
+ /** bash only: set when the command exited on its own. */
1131
+ readonly exitCode: Schema.optional<Schema.Number>;
1045
1132
  }>;
1046
1133
  readonly failure: Schema.String;
1047
1134
  readonly failureMode: "error";
1048
- }, never>;
1135
+ }, AgentTaskExecutor>;
1049
1136
  readonly taskComplete: Tool.Tool<"taskComplete", {
1050
1137
  readonly parameters: Schema.String;
1051
1138
  readonly success: Schema.Void;
1052
1139
  readonly failure: Schema.String;
1053
1140
  readonly failureMode: "error";
1054
1141
  }, TaskCompleter>;
1055
- readonly waitAgents: Tool.Tool<"waitAgents", {
1056
- readonly parameters: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
1142
+ readonly taskOutput: Tool.Tool<"taskOutput", {
1143
+ readonly parameters: Schema.String;
1144
+ readonly success: Schema.Struct<{
1145
+ readonly id: Schema.String;
1146
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
1147
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
1148
+ /** The bash command, or the sub-agent's prompt. */
1149
+ readonly description: Schema.String;
1150
+ /** Output so far while running; the final output, or the error, once ended. */
1151
+ readonly output: Schema.String;
1152
+ /** bash only: set when the command exited on its own. */
1153
+ readonly exitCode: Schema.optional<Schema.Number>;
1154
+ }>;
1155
+ readonly failure: Schema.String;
1156
+ readonly failureMode: "error";
1157
+ }, AgentTaskExecutor>;
1158
+ readonly waitTasks: Tool.Tool<"waitTasks", {
1159
+ readonly parameters: Schema.Struct<{
1160
+ readonly ids: Schema.$Array<Schema.String>;
1161
+ readonly timeoutMs: Schema.optional<Schema.Finite>;
1162
+ }>;
1057
1163
  readonly success: Schema.$Array<Schema.Struct<{
1058
1164
  readonly id: Schema.String;
1059
- readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
1060
- readonly output: Schema.optional<Schema.String>;
1165
+ readonly kind: Schema.Literals<readonly ["bash", "agent"]>;
1166
+ readonly status: Schema.Literals<readonly ["running", "completed", "failed", "stopped"]>;
1167
+ /** The bash command, or the sub-agent's prompt. */
1168
+ readonly description: Schema.String;
1169
+ /** Output so far while running; the final output, or the error, once ended. */
1170
+ readonly output: Schema.String;
1171
+ /** bash only: set when the command exited on its own. */
1172
+ readonly exitCode: Schema.optional<Schema.Number>;
1061
1173
  }>>;
1062
1174
  readonly failure: Schema.String;
1063
1175
  readonly failureMode: "error";
1064
- }, SubagentExecutor>;
1176
+ }, AgentTaskExecutor>;
1065
1177
  readonly webSearch: Tool.Tool<"webSearch", {
1066
1178
  readonly parameters: Schema.Struct<{
1067
1179
  readonly query: Schema.String;