clanka 0.8.6 → 0.10.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 (96) hide show
  1. package/dist/Acp.d.ts +6 -1
  2. package/dist/Acp.d.ts.map +1 -1
  3. package/dist/Acp.js +34 -3
  4. package/dist/Acp.js.map +1 -1
  5. package/dist/Acp.test.js +178 -2
  6. package/dist/Acp.test.js.map +1 -1
  7. package/dist/AcpImage.test.js +7 -1
  8. package/dist/AcpImage.test.js.map +1 -1
  9. package/dist/Agent.d.ts +82 -8
  10. package/dist/Agent.d.ts.map +1 -1
  11. package/dist/Agent.js +556 -113
  12. package/dist/Agent.js.map +1 -1
  13. package/dist/Agent.test.js +86 -5
  14. package/dist/Agent.test.js.map +1 -1
  15. package/dist/AgentCallerConfig.test.d.ts +2 -0
  16. package/dist/AgentCallerConfig.test.d.ts.map +1 -0
  17. package/dist/AgentCallerConfig.test.js +335 -0
  18. package/dist/AgentCallerConfig.test.js.map +1 -0
  19. package/dist/AgentEnvironment.d.ts +76 -0
  20. package/dist/AgentEnvironment.d.ts.map +1 -0
  21. package/dist/AgentEnvironment.js +119 -0
  22. package/dist/AgentEnvironment.js.map +1 -0
  23. package/dist/AgentEnvironment.test.d.ts +2 -0
  24. package/dist/AgentEnvironment.test.d.ts.map +1 -0
  25. package/dist/AgentEnvironment.test.js +304 -0
  26. package/dist/AgentEnvironment.test.js.map +1 -0
  27. package/dist/AgentExecutor.d.ts +342 -183
  28. package/dist/AgentExecutor.d.ts.map +1 -1
  29. package/dist/AgentExecutor.js +607 -127
  30. package/dist/AgentExecutor.js.map +1 -1
  31. package/dist/AgentExecutor.test.js +287 -31
  32. package/dist/AgentExecutor.test.js.map +1 -1
  33. package/dist/AgentExecutorImage.test.js +5 -1
  34. package/dist/AgentExecutorImage.test.js.map +1 -1
  35. package/dist/AgentImage.test.js +15 -2
  36. package/dist/AgentImage.test.js.map +1 -1
  37. package/dist/AgentOutput.d.ts +70 -5
  38. package/dist/AgentOutput.d.ts.map +1 -1
  39. package/dist/AgentOutput.js +65 -0
  40. package/dist/AgentOutput.js.map +1 -1
  41. package/dist/AgentSkills.d.ts +37 -0
  42. package/dist/AgentSkills.d.ts.map +1 -1
  43. package/dist/AgentSkills.js +96 -32
  44. package/dist/AgentSkills.js.map +1 -1
  45. package/dist/AgentSkills.test.js +14 -2
  46. package/dist/AgentSkills.test.js.map +1 -1
  47. package/dist/AgentSubagents.test.d.ts +2 -0
  48. package/dist/AgentSubagents.test.d.ts.map +1 -0
  49. package/dist/AgentSubagents.test.js +494 -0
  50. package/dist/AgentSubagents.test.js.map +1 -0
  51. package/dist/AgentTools.d.ts +356 -14
  52. package/dist/AgentTools.d.ts.map +1 -1
  53. package/dist/AgentTools.js +214 -35
  54. package/dist/AgentTools.js.map +1 -1
  55. package/dist/OutputFormatter.d.ts.map +1 -1
  56. package/dist/OutputFormatter.js +19 -2
  57. package/dist/OutputFormatter.js.map +1 -1
  58. package/dist/ToolkitRenderer.d.ts.map +1 -1
  59. package/dist/ToolkitRenderer.js +6 -1
  60. package/dist/ToolkitRenderer.js.map +1 -1
  61. package/dist/bin/{Effect-rADALOOD.mjs → Effect-2jPlJ8eu.mjs} +43 -38
  62. package/dist/bin/Effect-2jPlJ8eu.mjs.map +1 -0
  63. package/dist/bin/{McpClient-NazR2OwL.mjs → McpClient-1W508adc.mjs} +3 -3
  64. package/dist/bin/{McpClient-NazR2OwL.mjs.map → McpClient-1W508adc.mjs.map} +1 -1
  65. package/dist/bin/{OutputFormatter-BVHbgF2b.mjs → OutputFormatter-BFAv48k9.mjs} +17 -5
  66. package/dist/bin/{OutputFormatter-BVHbgF2b.mjs.map → OutputFormatter-BFAv48k9.mjs.map} +1 -1
  67. package/dist/bin/{Schema-C7NXAOWA.mjs → Schema-D-7VuCiC.mjs} +2 -2
  68. package/dist/bin/{Schema-C7NXAOWA.mjs.map → Schema-D-7VuCiC.mjs.map} +1 -1
  69. package/dist/bin/{SemanticSearch-4Jes3jCl.mjs → SemanticSearch-Cb8aqvGv.mjs} +4 -4
  70. package/dist/bin/{SemanticSearch-4Jes3jCl.mjs.map → SemanticSearch-Cb8aqvGv.mjs.map} +1 -1
  71. package/dist/bin/{Stream-CSLA1_GD.mjs → Stream-DEu2tfCV.mjs} +12 -3
  72. package/dist/bin/Stream-DEu2tfCV.mjs.map +1 -0
  73. package/dist/bin/cli.mjs +13333 -12470
  74. package/dist/bin/cli.mjs.map +1 -1
  75. package/package.json +1 -1
  76. package/src/Acp.test.ts +279 -3
  77. package/src/Acp.ts +34 -4
  78. package/src/AcpImage.test.ts +7 -1
  79. package/src/Agent.test.ts +109 -4
  80. package/src/Agent.ts +874 -140
  81. package/src/AgentCallerConfig.test.ts +522 -0
  82. package/src/AgentEnvironment.test.ts +504 -0
  83. package/src/AgentEnvironment.ts +161 -0
  84. package/src/AgentExecutor.test.ts +414 -37
  85. package/src/AgentExecutor.ts +1028 -191
  86. package/src/AgentExecutorImage.test.ts +5 -1
  87. package/src/AgentImage.test.ts +21 -3
  88. package/src/AgentOutput.ts +91 -1
  89. package/src/AgentSkills.test.ts +14 -2
  90. package/src/AgentSkills.ts +117 -34
  91. package/src/AgentSubagents.test.ts +824 -0
  92. package/src/AgentTools.ts +377 -53
  93. package/src/OutputFormatter.ts +19 -2
  94. package/src/ToolkitRenderer.ts +7 -1
  95. package/dist/bin/Effect-rADALOOD.mjs.map +0 -1
  96. package/dist/bin/Stream-CSLA1_GD.mjs.map +0 -1
@@ -1,9 +1,10 @@
1
- import { AgentTools, CurrentDirectory, DirectoryChanger, ImageAttacher, type ImageAttachment, SubagentExecutor, TaskCompleter } from "./AgentTools.ts";
1
+ import { type DelegateResult, AgentTools, AgentToolsWithSearch, CurrentDirectory, DirectoryChanger, type ExcludableTool, ImageAttacher, type ImageAttachment, SubagentExecutor, type Subagents, TaskCompleter } from "./AgentTools.ts";
2
2
  import { ToolkitRenderer } from "./ToolkitRenderer.ts";
3
3
  import * as AgentSkills from "./AgentSkills.ts";
4
4
  import type * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
5
5
  import type * as HttpClient from "effect/http/HttpClient";
6
6
  import * as Context from "effect/Context";
7
+ import * as Duration from "effect/Duration";
7
8
  import * as Effect from "effect/Effect";
8
9
  import * as Stream from "effect/Stream";
9
10
  import * as FileSystem from "effect/FileSystem";
@@ -17,22 +18,34 @@ import * as RpcServer from "effect/rpc/RpcServer";
17
18
  import * as Schema from "effect/Schema";
18
19
  import * as RpcGroup from "effect/rpc/RpcGroup";
19
20
  import * as Rpc from "effect/rpc/Rpc";
20
- import { SemanticSearch } from "./SemanticSearch/Service.ts";
21
21
  declare const AgentExecutor_base: Context.ServiceClass<AgentExecutor, "clanka/AgentExecutor", {
22
22
  readonly capabilities: Effect.Effect<Capabilities>;
23
- execute(options: {
24
- readonly script: string;
25
- readonly onTaskComplete: (summary: string) => Effect.Effect<void>;
26
- readonly onSubagent: (message: string) => Effect.Effect<string>;
27
- /**
28
- * Receives every image `readFile` attached while the script ran.
29
- */
30
- readonly onImage: (image: ImageAttachment) => Effect.Effect<void>;
31
- }): Stream.Stream<string>;
23
+ execute(options: ExecuteOptions): Stream.Stream<string>;
32
24
  executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
33
25
  readonly tool: Tool;
34
26
  readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
27
+ /**
28
+ * The environment the tool runs in. Defaults to the startup
29
+ * environment. Changes made by the tool are not returned.
30
+ */
31
+ readonly environment?: ExecutionEnvironment | undefined;
35
32
  }): Effect.Effect<Schema.Json>;
33
+ /**
34
+ * Render the AGENTS.md files and skills that apply to the environment's
35
+ * directory and that the model has not seen yet. The agent calls it once
36
+ * after the scripts of a model response, so one update covers all of
37
+ * them; `execute` itself never renders one.
38
+ *
39
+ * With `reset`, everything sent since the system prompt is forgotten and
40
+ * rendered again. Any operation that rewrites the history, such as
41
+ * compaction, must do this, so the environment's record of what the
42
+ * model has seen matches the history.
43
+ *
44
+ * Optional: without it the agent sends no updates.
45
+ */
46
+ readonly renderEnvironment?: ((environment: ExecutionEnvironment, options?: {
47
+ readonly reset?: boolean | undefined;
48
+ } | undefined) => Effect.Effect<EnvironmentUpdate>) | undefined;
36
49
  }>;
37
50
  /**
38
51
  * @since 1.0.0
@@ -40,10 +53,123 @@ declare const AgentExecutor_base: Context.ServiceClass<AgentExecutor, "clanka/Ag
40
53
  */
41
54
  export declare class AgentExecutor extends AgentExecutor_base {
42
55
  }
56
+ /**
57
+ * @since 1.0.0
58
+ * @category Models
59
+ */
60
+ export interface ExecuteOptions {
61
+ readonly script: string;
62
+ /**
63
+ * The environment the script starts in: the `environment` of the last
64
+ * `onEnvironment` call for this agent, or `Capabilities.environment` for
65
+ * its first script.
66
+ */
67
+ readonly environment: ExecutionEnvironment;
68
+ /**
69
+ * Receives the environment the script left behind, once, when the script
70
+ * ends. It is also called when the script fails, times out or is
71
+ * interrupted. Pass it to the next `execute` of the same agent.
72
+ */
73
+ readonly onEnvironment: (environment: ExecutionEnvironment) => Effect.Effect<void>;
74
+ /**
75
+ * Fails with a message for the script when the task cannot be completed
76
+ * yet, for example while sub-agents are still running.
77
+ */
78
+ readonly onTaskComplete: (summary: string) => Effect.Effect<void, string>;
79
+ /**
80
+ * The sub-agents of the agent running the script.
81
+ */
82
+ readonly subagents: ExecuteSubagents;
83
+ /**
84
+ * Receives every image `readFile` attached while the script ran.
85
+ */
86
+ readonly onImage: (image: ImageAttachment) => Effect.Effect<void>;
87
+ /**
88
+ * Functions added to the script sandbox whose handlers run on the loop
89
+ * side, next to the Agent.
90
+ */
91
+ readonly loopTools?: LoopToolHandlers | undefined;
92
+ }
93
+ /**
94
+ * The sub-agents of the agent running a script. `delegate` also receives the
95
+ * environment the new agent starts in: the script's directory at the moment
96
+ * `delegate` was called, with an update holding everything that applies to
97
+ * it beyond the system prompt.
98
+ *
99
+ * @since 1.0.0
100
+ * @category Models
101
+ */
102
+ export interface ExecuteSubagents extends Omit<Subagents, "delegate"> {
103
+ readonly delegate: (options: {
104
+ readonly prompt: string;
105
+ readonly background: boolean;
106
+ readonly environment: EnvironmentUpdate;
107
+ }) => Effect.Effect<DelegateResult>;
108
+ }
109
+ declare const ExecutionEnvironment_base: Schema.Class<ExecutionEnvironment, Schema.Struct<{
110
+ readonly cwd: Schema.String;
111
+ /**
112
+ * Ids of the context items already in the system prompt.
113
+ */
114
+ readonly baseline: Schema.$Array<Schema.String>;
115
+ /**
116
+ * Ids of the context items sent to the model in the history since.
117
+ */
118
+ readonly seen: Schema.$Array<Schema.String>;
119
+ }>, {}>;
120
+ /**
121
+ * The state the executor keeps for one agent, such as its working directory.
122
+ * Only the executor reads its fields. The agent stores the value it last
123
+ * received from `onEnvironment` and passes it to its next `execute`, so every
124
+ * agent has its own working directory.
125
+ *
126
+ * @since 1.0.0
127
+ * @category Models
128
+ */
129
+ export declare class ExecutionEnvironment extends ExecutionEnvironment_base {
130
+ }
131
+ declare const EnvironmentUpdate_base: Schema.Class<EnvironmentUpdate, Schema.Struct<{
132
+ /**
133
+ * The environment once `update` is in the history: what it describes
134
+ * counts as seen. Store it only together with the update.
135
+ */
136
+ readonly environment: typeof ExecutionEnvironment;
137
+ /**
138
+ * AGENTS.md files and skills the model has not seen yet, or `None` when
139
+ * nothing is new. The agent wraps it in an `<environment-update>` message.
140
+ */
141
+ readonly update: Schema.Option<Schema.String>;
142
+ }>, {}>;
143
+ /**
144
+ * @since 1.0.0
145
+ * @category Models
146
+ */
147
+ export declare class EnvironmentUpdate extends EnvironmentUpdate_base {
148
+ }
149
+ /**
150
+ * Loop-side tool handlers by function name. A handler receives the script's
151
+ * argument undecoded; a failure rejects the script's call with the string as
152
+ * the error message.
153
+ *
154
+ * @since 1.0.0
155
+ * @category Models
156
+ */
157
+ export type LoopToolHandlers = Readonly<Record<string, (params: unknown) => Effect.Effect<unknown, string>>>;
43
158
  declare const Capabilities_base: Schema.Class<Capabilities, Schema.Struct<{
44
159
  readonly toolsDts: Schema.String;
45
- readonly agentsMd: Schema.Option<Schema.String>;
160
+ /**
161
+ * The startup AGENTS.md as rendered for the system prompt, with its path.
162
+ */
163
+ readonly instructions: Schema.Option<Schema.String>;
46
164
  readonly supportsSearch: Schema.Boolean;
165
+ /**
166
+ * The environment of an agent's first script.
167
+ */
168
+ readonly environment: typeof ExecutionEnvironment;
169
+ /**
170
+ * The names of the script functions the executor offers.
171
+ */
172
+ readonly tools: Schema.$Array<Schema.String>;
47
173
  /**
48
174
  * Skills available on the executor filesystem.
49
175
  */
@@ -56,180 +182,99 @@ declare const Capabilities_base: Schema.Class<Capabilities, Schema.Struct<{
56
182
  export declare class Capabilities extends Capabilities_base {
57
183
  }
58
184
  /**
185
+ * Limits applied by the executor that runs the tools. With `layerRpcServer`
186
+ * they are set on the server, next to the commands they bound.
187
+ *
59
188
  * @since 1.0.0
60
- * @category Constructors
189
+ * @category Models
190
+ */
191
+ export interface Limits {
192
+ /**
193
+ * The longest a single `bash` or `gh` command may run. For `bash` it is
194
+ * also the default when the model passes no `timeoutMs`, and the `bash`
195
+ * description states it.
196
+ *
197
+ * Defaults to 10 minutes for `bash` and no limit for `gh`, as before.
198
+ */
199
+ readonly commandTimeout?: Duration.Input | undefined;
200
+ /**
201
+ * The longest a single `execute` script may run, including the tool calls
202
+ * it awaits. A script that runs out of time is interrupted, and its output
203
+ * so far ends with a line saying it timed out.
204
+ *
205
+ * Defaults to no limit.
206
+ */
207
+ readonly scriptTimeout?: Duration.Input | undefined;
208
+ /**
209
+ * The most characters of `bash` and `gh` output held in memory per command.
210
+ * Longer output keeps its start and end, with a marker in place of the
211
+ * middle.
212
+ *
213
+ * Defaults to no limit.
214
+ */
215
+ readonly commandOutputChars?: number | undefined;
216
+ }
217
+ /**
218
+ * Options for an executor that runs scripts in this process.
219
+ *
220
+ * @since 1.0.0
221
+ * @category Models
61
222
  */
62
- export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: {
223
+ export interface LocalOptions<Toolkit extends Toolkit.Any = never> {
63
224
  readonly directory: string;
64
225
  readonly tools?: Toolkit | undefined;
65
- }) => Effect.Effect<{
66
- readonly capabilities: Effect.Effect<Capabilities>;
67
- execute(options: {
68
- readonly script: string;
69
- readonly onTaskComplete: (summary: string) => Effect.Effect<void>;
70
- readonly onSubagent: (message: string) => Effect.Effect<string>;
71
- /**
72
- * Receives every image `readFile` attached while the script ran.
73
- */
74
- readonly onImage: (image: ImageAttachment) => Effect.Effect<void>;
75
- }): Stream.Stream<string>;
76
- executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
77
- readonly tool: Tool;
78
- readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
79
- }): Effect.Effect<Schema.Json>;
80
- }, never, FileSystem.FileSystem | Path.Path | ToolkitRenderer | Exclude<Toolkit extends Toolkit.Toolkit<infer T extends Record<string, Tool.Any>> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | ImageAttacher | SubagentExecutor | TaskCompleter> | Tool.HandlersFor<{
81
- readonly applyPatch: Tool.Tool<"applyPatch", {
82
- readonly parameters: Schema.String;
83
- readonly success: Schema.String;
84
- readonly failure: Schema.Never;
85
- readonly failureMode: "error";
86
- }, CurrentDirectory>;
87
- readonly bash: Tool.Tool<"bash", {
88
- readonly parameters: Schema.Struct<{
89
- readonly command: Schema.String;
90
- readonly timeoutMs: Schema.optional<Schema.Finite>;
91
- }>;
92
- readonly success: Schema.String;
93
- readonly failure: Schema.Never;
94
- readonly failureMode: "error";
95
- }, CurrentDirectory>;
96
- readonly changeDirectory: Tool.Tool<"changeDirectory", {
97
- readonly parameters: Schema.String;
98
- readonly success: Schema.String;
99
- readonly failure: Schema.Never;
100
- readonly failureMode: "error";
101
- }, DirectoryChanger>;
102
- readonly delegate: Tool.Tool<"delegate", {
103
- readonly parameters: Schema.String;
104
- readonly success: Schema.String;
105
- readonly failure: Schema.Never;
106
- readonly failureMode: "error";
107
- }, SubagentExecutor>;
108
- readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
109
- readonly parameters: Schema.String;
110
- readonly success: Schema.String;
111
- readonly failure: Schema.Never;
112
- readonly failureMode: "error";
113
- }, never>;
114
- readonly gh: Tool.Tool<"gh", {
115
- readonly parameters: Schema.$Array<Schema.String>;
116
- readonly success: Schema.String;
117
- readonly failure: Schema.Never;
118
- readonly failureMode: "error";
119
- }, CurrentDirectory>;
120
- readonly glob: Tool.Tool<"glob", {
121
- readonly parameters: Schema.String;
122
- readonly success: Schema.$Array<Schema.String>;
123
- readonly failure: Schema.Never;
124
- readonly failureMode: "error";
125
- }, CurrentDirectory>;
126
- readonly ls: Tool.Tool<"ls", {
127
- readonly parameters: Schema.String;
128
- readonly success: Schema.$Array<Schema.String>;
129
- readonly failure: Schema.Never;
130
- readonly failureMode: "error";
131
- }, CurrentDirectory>;
132
- readonly readFile: Tool.Tool<"readFile", {
133
- readonly parameters: Schema.Struct<{
134
- readonly path: Schema.String;
135
- readonly startLine: Schema.optional<Schema.Number>;
136
- readonly endLine: Schema.optional<Schema.Number>;
137
- }>;
138
- readonly success: Schema.NullOr<Schema.String>;
139
- readonly failure: Schema.Never;
140
- readonly failureMode: "error";
141
- }, CurrentDirectory | ImageAttacher>;
142
- readonly removeFile: Tool.Tool<"removeFile", {
143
- readonly parameters: Schema.String;
144
- readonly success: Schema.Void;
145
- readonly failure: Schema.Never;
146
- readonly failureMode: "error";
147
- }, CurrentDirectory>;
148
- readonly renameFile: Tool.Tool<"renameFile", {
149
- readonly parameters: Schema.Struct<{
150
- readonly from: Schema.String;
151
- readonly to: Schema.String;
152
- }>;
153
- readonly success: Schema.Void;
154
- readonly failure: Schema.Never;
155
- readonly failureMode: "error";
156
- }, CurrentDirectory>;
157
- readonly rg: Tool.Tool<"rg", {
158
- readonly parameters: Schema.Struct<{
159
- readonly pattern: Schema.String;
160
- readonly glob: Schema.optional<Schema.String>;
161
- readonly filesOnly: Schema.optional<Schema.Boolean>;
162
- readonly maxLines: Schema.optional<Schema.Finite>;
163
- }>;
164
- readonly success: Schema.String;
165
- readonly failure: Schema.Never;
166
- readonly failureMode: "error";
167
- }, CurrentDirectory>;
168
- readonly search: Tool.Tool<"search", {
169
- readonly parameters: Schema.String;
170
- readonly success: Schema.String;
171
- readonly failure: Schema.Never;
172
- readonly failureMode: "error";
173
- }, SemanticSearch>;
174
- readonly sleep: Tool.Tool<"sleep", {
175
- readonly parameters: Schema.Finite;
176
- readonly success: Schema.Void;
177
- readonly failure: Schema.Never;
178
- readonly failureMode: "error";
179
- }, never>;
180
- readonly taskComplete: Tool.Tool<"taskComplete", {
181
- readonly parameters: Schema.String;
182
- readonly success: Schema.Void;
183
- readonly failure: Schema.String;
184
- readonly failureMode: "error";
185
- }, TaskCompleter>;
186
- readonly webSearch: Tool.Tool<"webSearch", {
187
- readonly parameters: Schema.Struct<{
188
- readonly query: Schema.String;
189
- readonly numResults: Schema.optional<Schema.Number>;
190
- }>;
191
- readonly success: Schema.String;
192
- readonly failure: Schema.Never;
193
- readonly failureMode: "error";
194
- }, never>;
195
- readonly writeFile: Tool.Tool<"writeFile", {
196
- readonly parameters: Schema.Struct<{
197
- readonly path: Schema.String;
198
- readonly content: Schema.String;
199
- }>;
200
- readonly success: Schema.Void;
201
- readonly failure: Schema.Never;
202
- readonly failureMode: "error";
203
- }, CurrentDirectory>;
204
- }>>;
226
+ readonly limits?: Limits | undefined;
227
+ /**
228
+ * Built-in tools to leave out of the sandbox and the type declarations.
229
+ * Leaving out `delegate` also leaves out the tools that address its
230
+ * sub-agents.
231
+ */
232
+ readonly excludeTools?: ReadonlyArray<ExcludableTool> | undefined;
233
+ }
234
+ type LocalServices<Toolkit> = ToolkitRenderer | FileSystem.FileSystem | Path.Path | Tool.HandlersFor<typeof AgentToolsWithSearch.tools> | Exclude<Toolkit extends Toolkit.Toolkit<infer T> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | SubagentExecutor | TaskCompleter | ImageAttacher>;
235
+ /**
236
+ * @since 1.0.0
237
+ * @category Constructors
238
+ */
239
+ export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: LocalOptions<Toolkit>) => Effect.Effect<AgentExecutor["Service"], never, LocalServices<Toolkit>>;
205
240
  /**
206
241
  * @since 1.0.0
207
242
  * @category Constructors
208
243
  */
209
244
  export declare const makeRpc: Effect.Effect<{
210
245
  readonly capabilities: Effect.Effect<Capabilities>;
211
- execute(options: {
212
- readonly script: string;
213
- readonly onTaskComplete: (summary: string) => Effect.Effect<void>;
214
- readonly onSubagent: (message: string) => Effect.Effect<string>;
215
- /**
216
- * Receives every image `readFile` attached while the script ran.
217
- */
218
- readonly onImage: (image: ImageAttachment) => Effect.Effect<void>;
219
- }): Stream.Stream<string>;
246
+ execute(options: ExecuteOptions): Stream.Stream<string>;
220
247
  executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
221
248
  readonly tool: Tool;
222
249
  readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
250
+ /**
251
+ * The environment the tool runs in. Defaults to the startup
252
+ * environment. Changes made by the tool are not returned.
253
+ */
254
+ readonly environment?: ExecutionEnvironment | undefined;
223
255
  }): Effect.Effect<Schema.Json>;
256
+ /**
257
+ * Render the AGENTS.md files and skills that apply to the environment's
258
+ * directory and that the model has not seen yet. The agent calls it once
259
+ * after the scripts of a model response, so one update covers all of
260
+ * them; `execute` itself never renders one.
261
+ *
262
+ * With `reset`, everything sent since the system prompt is forgotten and
263
+ * rendered again. Any operation that rewrites the history, such as
264
+ * compaction, must do this, so the environment's record of what the
265
+ * model has seen matches the history.
266
+ *
267
+ * Optional: without it the agent sends no updates.
268
+ */
269
+ readonly renderEnvironment?: ((environment: ExecutionEnvironment, options?: {
270
+ readonly reset?: boolean | undefined;
271
+ } | undefined) => Effect.Effect<EnvironmentUpdate>) | undefined;
224
272
  }, never, RpcClient.Protocol | Scope.Scope>;
225
273
  /**
226
274
  * @since 1.0.0
227
275
  * @category Layers
228
276
  */
229
- export declare const layerLocal: <Toolkit extends Toolkit.Any = never>(options: {
230
- readonly directory: string;
231
- readonly tools?: Toolkit | undefined;
232
- }) => Layer.Layer<AgentExecutor, never, FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner | HttpClient.HttpClient | Exclude<Toolkit extends Toolkit.Toolkit<infer T> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | SubagentExecutor | TaskCompleter | ImageAttacher>>;
277
+ export declare const layerLocal: <Toolkit extends Toolkit.Any = never>(options: LocalOptions<Toolkit>) => Layer.Layer<AgentExecutor, never, FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner | HttpClient.HttpClient | Exclude<Toolkit extends Toolkit.Toolkit<infer T> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | SubagentExecutor | TaskCompleter | ImageAttacher>>;
233
278
  /**
234
279
  * Create an AgentExecutor that communicates with a remote RpcServer serving the
235
280
  * AgentExecutor protocol.
@@ -246,26 +291,97 @@ export declare const layerRpc: Layer.Layer<AgentExecutor, never, RpcClient.Proto
246
291
  * @since 1.0.0
247
292
  * @category Layers
248
293
  */
249
- export declare const layerRpcServer: <Toolkit extends Toolkit.Any = never>(options: {
250
- readonly directory: string;
251
- readonly tools?: Toolkit | undefined;
252
- }) => Layer.Layer<never, never, RpcServer.Protocol | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | ChildProcessSpawner.ChildProcessSpawner | Exclude<Toolkit extends Toolkit.Toolkit<infer T> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | SubagentExecutor | TaskCompleter | ImageAttacher>>;
294
+ export declare const layerRpcServer: <Toolkit extends Toolkit.Any = never>(options: LocalOptions<Toolkit>) => Layer.Layer<never, never, RpcServer.Protocol | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | ChildProcessSpawner.ChildProcessSpawner | Exclude<Toolkit extends Toolkit.Toolkit<infer T> ? Tool.HandlersFor<T> | Tool.HandlerServices<T[keyof T]> : never, CurrentDirectory | DirectoryChanger | SubagentExecutor | TaskCompleter | ImageAttacher>>;
295
+ /**
296
+ * @since 1.0.0
297
+ * @category Rpcs
298
+ */
299
+ export declare const AgentRequest: Schema.TaggedUnion<{
300
+ readonly Delegate: Schema.TaggedStruct<"Delegate", {
301
+ readonly prompt: Schema.String;
302
+ readonly background: Schema.Boolean;
303
+ readonly environment: typeof EnvironmentUpdate;
304
+ }>;
305
+ readonly EnvironmentChanged: Schema.TaggedStruct<"EnvironmentChanged", {
306
+ readonly environment: typeof ExecutionEnvironment;
307
+ }>;
308
+ readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
309
+ readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
310
+ readonly name: Schema.String;
311
+ readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
312
+ }>;
313
+ readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
314
+ readonly id: Schema.String;
315
+ readonly message: Schema.String;
316
+ }>;
317
+ readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
318
+ readonly id: Schema.String;
319
+ }>;
320
+ readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
321
+ readonly summary: Schema.String;
322
+ }>;
323
+ readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
324
+ readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
325
+ }>;
326
+ }>;
327
+ /**
328
+ * The client's answer to a `Request`. `Failure` carries a message for the
329
+ * script; a failed foreground `delegate` is raised there as a defect.
330
+ *
331
+ * @since 1.0.0
332
+ * @category Rpcs
333
+ */
334
+ export declare const AgentResponse: Schema.TaggedUnion<{
335
+ readonly Failure: Schema.TaggedStruct<"Failure", {
336
+ readonly message: Schema.String;
337
+ }>;
338
+ readonly Success: Schema.TaggedStruct<"Success", {
339
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
340
+ }>;
341
+ }>;
253
342
  /**
254
343
  * @since 1.0.0
255
344
  * @category Rpcs
256
345
  */
257
346
  export declare const ExecuteOutput: Schema.TaggedUnion<{
347
+ readonly Environment: Schema.TaggedStruct<"Environment", {
348
+ readonly environment: typeof ExecutionEnvironment;
349
+ }>;
258
350
  readonly Image: Schema.TaggedStruct<"Image", {
259
351
  readonly fileName: Schema.String;
260
352
  readonly mediaType: Schema.Literals<readonly ["image/png", "image/jpeg", "image/gif", "image/webp"]>;
261
353
  readonly data: Schema.Uint8Array;
262
354
  }>;
263
- readonly Subagent: Schema.TaggedStruct<"Subagent", {
355
+ readonly Request: Schema.TaggedStruct<"Request", {
264
356
  readonly id: Schema.Finite;
265
- readonly prompt: Schema.String;
266
- }>;
267
- readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
268
- readonly summary: Schema.String;
357
+ readonly request: Schema.TaggedUnion<{
358
+ readonly Delegate: Schema.TaggedStruct<"Delegate", {
359
+ readonly prompt: Schema.String;
360
+ readonly background: Schema.Boolean;
361
+ readonly environment: typeof EnvironmentUpdate;
362
+ }>;
363
+ readonly EnvironmentChanged: Schema.TaggedStruct<"EnvironmentChanged", {
364
+ readonly environment: typeof ExecutionEnvironment;
365
+ }>;
366
+ readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
367
+ readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
368
+ readonly name: Schema.String;
369
+ readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
370
+ }>;
371
+ readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
372
+ readonly id: Schema.String;
373
+ readonly message: Schema.String;
374
+ }>;
375
+ readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
376
+ readonly id: Schema.String;
377
+ }>;
378
+ readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
379
+ readonly summary: Schema.String;
380
+ }>;
381
+ readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
382
+ readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
383
+ }>;
384
+ }>;
269
385
  }>;
270
386
  readonly Text: Schema.TaggedStruct<"Text", {
271
387
  readonly text: Schema.String;
@@ -273,18 +389,50 @@ export declare const ExecuteOutput: Schema.TaggedUnion<{
273
389
  }>;
274
390
  declare const Rpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"capabilities", Schema.Void, typeof Capabilities, Schema.Never, never, never> | Rpc.Rpc<"execute", Schema.Struct<{
275
391
  readonly script: Schema.String;
392
+ readonly environment: typeof ExecutionEnvironment;
393
+ /**
394
+ * The loop-side tools to add to the script sandbox.
395
+ */
396
+ readonly loopTools: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
276
397
  }>, import("effect/rpc/RpcSchema").Stream<Schema.TaggedUnion<{
398
+ readonly Environment: Schema.TaggedStruct<"Environment", {
399
+ readonly environment: typeof ExecutionEnvironment;
400
+ }>;
277
401
  readonly Image: Schema.TaggedStruct<"Image", {
278
402
  readonly fileName: Schema.String;
279
403
  readonly mediaType: Schema.Literals<readonly ["image/png", "image/jpeg", "image/gif", "image/webp"]>;
280
404
  readonly data: Schema.Uint8Array;
281
405
  }>;
282
- readonly Subagent: Schema.TaggedStruct<"Subagent", {
406
+ readonly Request: Schema.TaggedStruct<"Request", {
283
407
  readonly id: Schema.Finite;
284
- readonly prompt: Schema.String;
285
- }>;
286
- readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
287
- readonly summary: Schema.String;
408
+ readonly request: Schema.TaggedUnion<{
409
+ readonly Delegate: Schema.TaggedStruct<"Delegate", {
410
+ readonly prompt: Schema.String;
411
+ readonly background: Schema.Boolean;
412
+ readonly environment: typeof EnvironmentUpdate;
413
+ }>;
414
+ readonly EnvironmentChanged: Schema.TaggedStruct<"EnvironmentChanged", {
415
+ readonly environment: typeof ExecutionEnvironment;
416
+ }>;
417
+ readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
418
+ readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
419
+ readonly name: Schema.String;
420
+ readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
421
+ }>;
422
+ readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
423
+ readonly id: Schema.String;
424
+ readonly message: Schema.String;
425
+ }>;
426
+ readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
427
+ readonly id: Schema.String;
428
+ }>;
429
+ readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
430
+ readonly summary: Schema.String;
431
+ }>;
432
+ readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
433
+ readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
434
+ }>;
435
+ }>;
288
436
  }>;
289
437
  readonly Text: Schema.TaggedStruct<"Text", {
290
438
  readonly text: Schema.String;
@@ -292,9 +440,20 @@ declare const Rpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"capabilities", Schema.Void,
292
440
  }>, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"executeUnsafe", Schema.Struct<{
293
441
  readonly tool: Schema.String;
294
442
  readonly params: Schema.Codec<Schema.Json, Schema.Json, never, never>;
295
- }>, Schema.Codec<Schema.Json, Schema.Json, never, never>, Schema.Never, never, never> | Rpc.Rpc<"subagentOutput", Schema.Struct<{
443
+ readonly environment: Schema.optionalKey<typeof ExecutionEnvironment>;
444
+ }>, Schema.Codec<Schema.Json, Schema.Json, never, never>, Schema.Never, never, never> | Rpc.Rpc<"renderEnvironment", Schema.Struct<{
445
+ environment: typeof ExecutionEnvironment;
446
+ reset: Schema.Boolean;
447
+ }>, typeof EnvironmentUpdate, Schema.Never, never, never> | Rpc.Rpc<"respond", Schema.Struct<{
296
448
  id: Schema.Finite;
297
- output: Schema.String;
449
+ response: Schema.TaggedUnion<{
450
+ readonly Failure: Schema.TaggedStruct<"Failure", {
451
+ readonly message: Schema.String;
452
+ }>;
453
+ readonly Success: Schema.TaggedStruct<"Success", {
454
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
455
+ }>;
456
+ }>;
298
457
  }>, Schema.Void, Schema.Never, never, never>>;
299
458
  /**
300
459
  * @since 1.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"AgentExecutor.d.ts","sourceRoot":"","sources":["../src/AgentExecutor.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,UAAU,EAEV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,KAAK,eAAe,EACpB,gBAAgB,EAChB,aAAa,EACd,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,mBAAmB,MAAM,oCAAoC,CAAA;AAC9E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA;AAC5C,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAG3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAKrC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,6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