clanka 0.8.6 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acp.d.ts.map +1 -1
- package/dist/Acp.js +9 -3
- package/dist/Acp.js.map +1 -1
- package/dist/Acp.test.js +72 -1
- package/dist/Acp.test.js.map +1 -1
- package/dist/AcpImage.test.js +1 -0
- package/dist/AcpImage.test.js.map +1 -1
- package/dist/Agent.d.ts +65 -8
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +481 -113
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +77 -4
- package/dist/Agent.test.js.map +1 -1
- package/dist/AgentCallerConfig.test.d.ts +2 -0
- package/dist/AgentCallerConfig.test.d.ts.map +1 -0
- package/dist/AgentCallerConfig.test.js +327 -0
- package/dist/AgentCallerConfig.test.js.map +1 -0
- package/dist/AgentExecutor.d.ts +254 -54
- package/dist/AgentExecutor.d.ts.map +1 -1
- package/dist/AgentExecutor.js +416 -99
- package/dist/AgentExecutor.js.map +1 -1
- package/dist/AgentExecutor.test.js +201 -31
- package/dist/AgentExecutor.test.js.map +1 -1
- package/dist/AgentExecutorImage.test.js +2 -1
- package/dist/AgentExecutorImage.test.js.map +1 -1
- package/dist/AgentImage.test.js +5 -1
- package/dist/AgentImage.test.js.map +1 -1
- package/dist/AgentOutput.d.ts +54 -2
- package/dist/AgentOutput.d.ts.map +1 -1
- package/dist/AgentOutput.js +52 -0
- package/dist/AgentOutput.js.map +1 -1
- package/dist/AgentSkills.d.ts +22 -0
- package/dist/AgentSkills.d.ts.map +1 -1
- package/dist/AgentSkills.js +36 -0
- package/dist/AgentSkills.js.map +1 -1
- package/dist/AgentSkills.test.js +2 -0
- package/dist/AgentSkills.test.js.map +1 -1
- package/dist/AgentSubagents.test.d.ts +2 -0
- package/dist/AgentSubagents.test.d.ts.map +1 -0
- package/dist/AgentSubagents.test.js +452 -0
- package/dist/AgentSubagents.test.js.map +1 -0
- package/dist/AgentTools.d.ts +356 -14
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +213 -34
- package/dist/AgentTools.js.map +1 -1
- package/dist/OutputFormatter.d.ts.map +1 -1
- package/dist/OutputFormatter.js +16 -2
- package/dist/OutputFormatter.js.map +1 -1
- package/dist/ToolkitRenderer.d.ts.map +1 -1
- package/dist/ToolkitRenderer.js +6 -1
- package/dist/ToolkitRenderer.js.map +1 -1
- package/dist/bin/{Effect-rADALOOD.mjs → Effect-2jPlJ8eu.mjs} +43 -38
- package/dist/bin/Effect-2jPlJ8eu.mjs.map +1 -0
- package/dist/bin/{McpClient-NazR2OwL.mjs → McpClient-1W508adc.mjs} +3 -3
- package/dist/bin/{McpClient-NazR2OwL.mjs.map → McpClient-1W508adc.mjs.map} +1 -1
- package/dist/bin/{OutputFormatter-BVHbgF2b.mjs → OutputFormatter-DXXKo4E8.mjs} +16 -5
- package/dist/bin/{OutputFormatter-BVHbgF2b.mjs.map → OutputFormatter-DXXKo4E8.mjs.map} +1 -1
- package/dist/bin/{Schema-C7NXAOWA.mjs → Schema-D-7VuCiC.mjs} +2 -2
- package/dist/bin/{Schema-C7NXAOWA.mjs.map → Schema-D-7VuCiC.mjs.map} +1 -1
- package/dist/bin/{SemanticSearch-4Jes3jCl.mjs → SemanticSearch-Cb8aqvGv.mjs} +4 -4
- package/dist/bin/{SemanticSearch-4Jes3jCl.mjs.map → SemanticSearch-Cb8aqvGv.mjs.map} +1 -1
- package/dist/bin/{Stream-CSLA1_GD.mjs → Stream-DEu2tfCV.mjs} +12 -3
- package/dist/bin/Stream-DEu2tfCV.mjs.map +1 -0
- package/dist/bin/cli.mjs +914 -273
- package/dist/bin/cli.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Acp.test.ts +121 -2
- package/src/Acp.ts +10 -3
- package/src/AcpImage.test.ts +1 -0
- package/src/Agent.test.ts +100 -3
- package/src/Agent.ts +752 -142
- package/src/AgentCallerConfig.test.ts +514 -0
- package/src/AgentExecutor.test.ts +297 -37
- package/src/AgentExecutor.ts +707 -159
- package/src/AgentExecutorImage.test.ts +2 -1
- package/src/AgentImage.test.ts +11 -2
- package/src/AgentOutput.ts +74 -1
- package/src/AgentSkills.test.ts +2 -0
- package/src/AgentSkills.ts +43 -0
- package/src/AgentSubagents.test.ts +758 -0
- package/src/AgentTools.ts +376 -52
- package/src/OutputFormatter.ts +16 -2
- package/src/ToolkitRenderer.ts +7 -1
- package/dist/bin/Effect-rADALOOD.mjs.map +0 -1
- package/dist/bin/Stream-CSLA1_GD.mjs.map +0 -1
package/dist/AgentExecutor.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { AgentTools, CurrentDirectory, DirectoryChanger, ImageAttacher, type ImageAttachment, SubagentExecutor, TaskCompleter } from "./AgentTools.ts";
|
|
1
|
+
import { AgentTools, 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";
|
|
@@ -20,15 +21,7 @@ import * as Rpc from "effect/rpc/Rpc";
|
|
|
20
21
|
import { SemanticSearch } from "./SemanticSearch/Service.ts";
|
|
21
22
|
declare const AgentExecutor_base: Context.ServiceClass<AgentExecutor, "clanka/AgentExecutor", {
|
|
22
23
|
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>;
|
|
24
|
+
execute(options: ExecuteOptions): Stream.Stream<string>;
|
|
32
25
|
executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
|
|
33
26
|
readonly tool: Tool;
|
|
34
27
|
readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
|
|
@@ -40,10 +33,48 @@ declare const AgentExecutor_base: Context.ServiceClass<AgentExecutor, "clanka/Ag
|
|
|
40
33
|
*/
|
|
41
34
|
export declare class AgentExecutor extends AgentExecutor_base {
|
|
42
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
* @category Models
|
|
39
|
+
*/
|
|
40
|
+
export interface ExecuteOptions {
|
|
41
|
+
readonly script: string;
|
|
42
|
+
/**
|
|
43
|
+
* Fails with a message for the script when the task cannot be completed
|
|
44
|
+
* yet, for example while sub-agents are still running.
|
|
45
|
+
*/
|
|
46
|
+
readonly onTaskComplete: (summary: string) => Effect.Effect<void, string>;
|
|
47
|
+
/**
|
|
48
|
+
* The sub-agents of the agent running the script.
|
|
49
|
+
*/
|
|
50
|
+
readonly subagents: Subagents;
|
|
51
|
+
/**
|
|
52
|
+
* Receives every image `readFile` attached while the script ran.
|
|
53
|
+
*/
|
|
54
|
+
readonly onImage: (image: ImageAttachment) => Effect.Effect<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Functions added to the script sandbox whose handlers run on the loop
|
|
57
|
+
* side, next to the Agent.
|
|
58
|
+
*/
|
|
59
|
+
readonly loopTools?: LoopToolHandlers | undefined;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Loop-side tool handlers by function name. A handler receives the script's
|
|
63
|
+
* argument undecoded; a failure rejects the script's call with the string as
|
|
64
|
+
* the error message.
|
|
65
|
+
*
|
|
66
|
+
* @since 1.0.0
|
|
67
|
+
* @category Models
|
|
68
|
+
*/
|
|
69
|
+
export type LoopToolHandlers = Readonly<Record<string, (params: unknown) => Effect.Effect<unknown, string>>>;
|
|
43
70
|
declare const Capabilities_base: Schema.Class<Capabilities, Schema.Struct<{
|
|
44
71
|
readonly toolsDts: Schema.String;
|
|
45
72
|
readonly agentsMd: Schema.Option<Schema.String>;
|
|
46
73
|
readonly supportsSearch: Schema.Boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The names of the script functions the executor offers.
|
|
76
|
+
*/
|
|
77
|
+
readonly tools: Schema.$Array<Schema.String>;
|
|
47
78
|
/**
|
|
48
79
|
* Skills available on the executor filesystem.
|
|
49
80
|
*/
|
|
@@ -56,23 +87,62 @@ declare const Capabilities_base: Schema.Class<Capabilities, Schema.Struct<{
|
|
|
56
87
|
export declare class Capabilities extends Capabilities_base {
|
|
57
88
|
}
|
|
58
89
|
/**
|
|
90
|
+
* Limits applied by the executor that runs the tools. With `layerRpcServer`
|
|
91
|
+
* they are set on the server, next to the commands they bound.
|
|
92
|
+
*
|
|
59
93
|
* @since 1.0.0
|
|
60
|
-
* @category
|
|
94
|
+
* @category Models
|
|
95
|
+
*/
|
|
96
|
+
export interface Limits {
|
|
97
|
+
/**
|
|
98
|
+
* The longest a single `bash` or `gh` command may run. For `bash` it is
|
|
99
|
+
* also the default when the model passes no `timeoutMs`, and the `bash`
|
|
100
|
+
* description states it.
|
|
101
|
+
*
|
|
102
|
+
* Defaults to 10 minutes for `bash` and no limit for `gh`, as before.
|
|
103
|
+
*/
|
|
104
|
+
readonly commandTimeout?: Duration.Input | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The longest a single `execute` script may run, including the tool calls
|
|
107
|
+
* it awaits. A script that runs out of time is interrupted, and its output
|
|
108
|
+
* so far ends with a line saying it timed out.
|
|
109
|
+
*
|
|
110
|
+
* Defaults to no limit.
|
|
111
|
+
*/
|
|
112
|
+
readonly scriptTimeout?: Duration.Input | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* The most characters of `bash` and `gh` output held in memory per command.
|
|
115
|
+
* Longer output keeps its start and end, with a marker in place of the
|
|
116
|
+
* middle.
|
|
117
|
+
*
|
|
118
|
+
* Defaults to no limit.
|
|
119
|
+
*/
|
|
120
|
+
readonly commandOutputChars?: number | undefined;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Options for an executor that runs scripts in this process.
|
|
124
|
+
*
|
|
125
|
+
* @since 1.0.0
|
|
126
|
+
* @category Models
|
|
61
127
|
*/
|
|
62
|
-
export
|
|
128
|
+
export interface LocalOptions<Toolkit extends Toolkit.Any = never> {
|
|
63
129
|
readonly directory: string;
|
|
64
130
|
readonly tools?: Toolkit | undefined;
|
|
65
|
-
|
|
131
|
+
readonly limits?: Limits | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Built-in tools to leave out of the sandbox and the type declarations.
|
|
134
|
+
* Leaving out `delegate` also leaves out the tools that address its
|
|
135
|
+
* sub-agents.
|
|
136
|
+
*/
|
|
137
|
+
readonly excludeTools?: ReadonlyArray<ExcludableTool> | undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @since 1.0.0
|
|
141
|
+
* @category Constructors
|
|
142
|
+
*/
|
|
143
|
+
export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: LocalOptions<Toolkit>) => Effect.Effect<{
|
|
66
144
|
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>;
|
|
145
|
+
execute(options: ExecuteOptions): Stream.Stream<string>;
|
|
76
146
|
executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
|
|
77
147
|
readonly tool: Tool;
|
|
78
148
|
readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
|
|
@@ -100,9 +170,16 @@ export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: {
|
|
|
100
170
|
readonly failureMode: "error";
|
|
101
171
|
}, DirectoryChanger>;
|
|
102
172
|
readonly delegate: Tool.Tool<"delegate", {
|
|
103
|
-
readonly parameters: Schema.
|
|
104
|
-
|
|
105
|
-
|
|
173
|
+
readonly parameters: Schema.Struct<{
|
|
174
|
+
readonly prompt: Schema.String;
|
|
175
|
+
readonly background: Schema.optional<Schema.Boolean>;
|
|
176
|
+
}>;
|
|
177
|
+
readonly success: Schema.Struct<{
|
|
178
|
+
readonly id: Schema.String;
|
|
179
|
+
readonly output: Schema.optional<Schema.String>;
|
|
180
|
+
readonly status: Schema.Literals<readonly ["completed", "running"]>;
|
|
181
|
+
}>;
|
|
182
|
+
readonly failure: Schema.String;
|
|
106
183
|
readonly failureMode: "error";
|
|
107
184
|
}, SubagentExecutor>;
|
|
108
185
|
readonly fetchMarkdown: Tool.Tool<"fetchMarkdown", {
|
|
@@ -123,12 +200,35 @@ export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: {
|
|
|
123
200
|
readonly failure: Schema.Never;
|
|
124
201
|
readonly failureMode: "error";
|
|
125
202
|
}, CurrentDirectory>;
|
|
203
|
+
readonly listAgents: Tool.Tool<"listAgents", {
|
|
204
|
+
readonly parameters: Schema.Void;
|
|
205
|
+
readonly success: Schema.$Array<Schema.Struct<{
|
|
206
|
+
readonly id: Schema.String;
|
|
207
|
+
readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
|
|
208
|
+
readonly prompt: Schema.String;
|
|
209
|
+
}>>;
|
|
210
|
+
readonly failure: Schema.Never;
|
|
211
|
+
readonly failureMode: "error";
|
|
212
|
+
}, SubagentExecutor>;
|
|
126
213
|
readonly ls: Tool.Tool<"ls", {
|
|
127
214
|
readonly parameters: Schema.String;
|
|
128
215
|
readonly success: Schema.$Array<Schema.String>;
|
|
129
216
|
readonly failure: Schema.Never;
|
|
130
217
|
readonly failureMode: "error";
|
|
131
218
|
}, CurrentDirectory>;
|
|
219
|
+
readonly messageAgent: Tool.Tool<"messageAgent", {
|
|
220
|
+
readonly parameters: Schema.Struct<{
|
|
221
|
+
readonly id: Schema.String;
|
|
222
|
+
readonly message: Schema.String;
|
|
223
|
+
}>;
|
|
224
|
+
readonly success: Schema.Struct<{
|
|
225
|
+
readonly id: Schema.String;
|
|
226
|
+
readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
|
|
227
|
+
readonly output: Schema.optional<Schema.String>;
|
|
228
|
+
}>;
|
|
229
|
+
readonly failure: Schema.String;
|
|
230
|
+
readonly failureMode: "error";
|
|
231
|
+
}, SubagentExecutor>;
|
|
132
232
|
readonly readFile: Tool.Tool<"readFile", {
|
|
133
233
|
readonly parameters: Schema.Struct<{
|
|
134
234
|
readonly path: Schema.String;
|
|
@@ -177,12 +277,32 @@ export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: {
|
|
|
177
277
|
readonly failure: Schema.Never;
|
|
178
278
|
readonly failureMode: "error";
|
|
179
279
|
}, never>;
|
|
280
|
+
readonly stopAgent: Tool.Tool<"stopAgent", {
|
|
281
|
+
readonly parameters: Schema.String;
|
|
282
|
+
readonly success: Schema.Struct<{
|
|
283
|
+
readonly id: Schema.String;
|
|
284
|
+
readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
|
|
285
|
+
readonly output: Schema.optional<Schema.String>;
|
|
286
|
+
}>;
|
|
287
|
+
readonly failure: Schema.String;
|
|
288
|
+
readonly failureMode: "error";
|
|
289
|
+
}, SubagentExecutor>;
|
|
180
290
|
readonly taskComplete: Tool.Tool<"taskComplete", {
|
|
181
291
|
readonly parameters: Schema.String;
|
|
182
292
|
readonly success: Schema.Void;
|
|
183
293
|
readonly failure: Schema.String;
|
|
184
294
|
readonly failureMode: "error";
|
|
185
295
|
}, TaskCompleter>;
|
|
296
|
+
readonly waitAgents: Tool.Tool<"waitAgents", {
|
|
297
|
+
readonly parameters: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
|
|
298
|
+
readonly success: Schema.$Array<Schema.Struct<{
|
|
299
|
+
readonly id: Schema.String;
|
|
300
|
+
readonly status: Schema.Literals<readonly ["completed", "running", "failed", "cancelled"]>;
|
|
301
|
+
readonly output: Schema.optional<Schema.String>;
|
|
302
|
+
}>>;
|
|
303
|
+
readonly failure: Schema.String;
|
|
304
|
+
readonly failureMode: "error";
|
|
305
|
+
}, SubagentExecutor>;
|
|
186
306
|
readonly webSearch: Tool.Tool<"webSearch", {
|
|
187
307
|
readonly parameters: Schema.Struct<{
|
|
188
308
|
readonly query: Schema.String;
|
|
@@ -208,15 +328,7 @@ export declare const makeLocal: <Toolkit extends Toolkit.Any = never>(options: {
|
|
|
208
328
|
*/
|
|
209
329
|
export declare const makeRpc: Effect.Effect<{
|
|
210
330
|
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>;
|
|
331
|
+
execute(options: ExecuteOptions): Stream.Stream<string>;
|
|
220
332
|
executeUnsafe<Tool extends keyof typeof AgentTools.tools>(options: {
|
|
221
333
|
readonly tool: Tool;
|
|
222
334
|
readonly params: (typeof AgentTools.tools)[Tool]["parametersSchema"]["Encoded"];
|
|
@@ -226,10 +338,7 @@ export declare const makeRpc: Effect.Effect<{
|
|
|
226
338
|
* @since 1.0.0
|
|
227
339
|
* @category Layers
|
|
228
340
|
*/
|
|
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>>;
|
|
341
|
+
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
342
|
/**
|
|
234
343
|
* Create an AgentExecutor that communicates with a remote RpcServer serving the
|
|
235
344
|
* AgentExecutor protocol.
|
|
@@ -246,10 +355,50 @@ export declare const layerRpc: Layer.Layer<AgentExecutor, never, RpcClient.Proto
|
|
|
246
355
|
* @since 1.0.0
|
|
247
356
|
* @category Layers
|
|
248
357
|
*/
|
|
249
|
-
export declare const layerRpcServer: <Toolkit extends Toolkit.Any = never>(options:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
358
|
+
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>>;
|
|
359
|
+
/**
|
|
360
|
+
* @since 1.0.0
|
|
361
|
+
* @category Rpcs
|
|
362
|
+
*/
|
|
363
|
+
export declare const AgentRequest: Schema.TaggedUnion<{
|
|
364
|
+
readonly Delegate: Schema.TaggedStruct<"Delegate", {
|
|
365
|
+
readonly prompt: Schema.String;
|
|
366
|
+
readonly background: Schema.Boolean;
|
|
367
|
+
}>;
|
|
368
|
+
readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
|
|
369
|
+
readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
|
|
370
|
+
readonly name: Schema.String;
|
|
371
|
+
readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
372
|
+
}>;
|
|
373
|
+
readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
|
|
374
|
+
readonly id: Schema.String;
|
|
375
|
+
readonly message: Schema.String;
|
|
376
|
+
}>;
|
|
377
|
+
readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
|
|
378
|
+
readonly id: Schema.String;
|
|
379
|
+
}>;
|
|
380
|
+
readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
|
|
381
|
+
readonly summary: Schema.String;
|
|
382
|
+
}>;
|
|
383
|
+
readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
|
|
384
|
+
readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
|
|
385
|
+
}>;
|
|
386
|
+
}>;
|
|
387
|
+
/**
|
|
388
|
+
* The client's answer to a `Request`. `Failure` carries a message for the
|
|
389
|
+
* script; a failed foreground `delegate` is raised there as a defect.
|
|
390
|
+
*
|
|
391
|
+
* @since 1.0.0
|
|
392
|
+
* @category Rpcs
|
|
393
|
+
*/
|
|
394
|
+
export declare const AgentResponse: Schema.TaggedUnion<{
|
|
395
|
+
readonly Failure: Schema.TaggedStruct<"Failure", {
|
|
396
|
+
readonly message: Schema.String;
|
|
397
|
+
}>;
|
|
398
|
+
readonly Success: Schema.TaggedStruct<"Success", {
|
|
399
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
400
|
+
}>;
|
|
401
|
+
}>;
|
|
253
402
|
/**
|
|
254
403
|
* @since 1.0.0
|
|
255
404
|
* @category Rpcs
|
|
@@ -260,12 +409,32 @@ export declare const ExecuteOutput: Schema.TaggedUnion<{
|
|
|
260
409
|
readonly mediaType: Schema.Literals<readonly ["image/png", "image/jpeg", "image/gif", "image/webp"]>;
|
|
261
410
|
readonly data: Schema.Uint8Array;
|
|
262
411
|
}>;
|
|
263
|
-
readonly
|
|
412
|
+
readonly Request: Schema.TaggedStruct<"Request", {
|
|
264
413
|
readonly id: Schema.Finite;
|
|
265
|
-
readonly
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
414
|
+
readonly request: Schema.TaggedUnion<{
|
|
415
|
+
readonly Delegate: Schema.TaggedStruct<"Delegate", {
|
|
416
|
+
readonly prompt: Schema.String;
|
|
417
|
+
readonly background: Schema.Boolean;
|
|
418
|
+
}>;
|
|
419
|
+
readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
|
|
420
|
+
readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
|
|
421
|
+
readonly name: Schema.String;
|
|
422
|
+
readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
423
|
+
}>;
|
|
424
|
+
readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
|
|
425
|
+
readonly id: Schema.String;
|
|
426
|
+
readonly message: Schema.String;
|
|
427
|
+
}>;
|
|
428
|
+
readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
|
|
429
|
+
readonly id: Schema.String;
|
|
430
|
+
}>;
|
|
431
|
+
readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
|
|
432
|
+
readonly summary: Schema.String;
|
|
433
|
+
}>;
|
|
434
|
+
readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
|
|
435
|
+
readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
|
|
436
|
+
}>;
|
|
437
|
+
}>;
|
|
269
438
|
}>;
|
|
270
439
|
readonly Text: Schema.TaggedStruct<"Text", {
|
|
271
440
|
readonly text: Schema.String;
|
|
@@ -273,18 +442,42 @@ export declare const ExecuteOutput: Schema.TaggedUnion<{
|
|
|
273
442
|
}>;
|
|
274
443
|
declare const Rpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"capabilities", Schema.Void, typeof Capabilities, Schema.Never, never, never> | Rpc.Rpc<"execute", Schema.Struct<{
|
|
275
444
|
readonly script: Schema.String;
|
|
445
|
+
/**
|
|
446
|
+
* The loop-side tools to add to the script sandbox.
|
|
447
|
+
*/
|
|
448
|
+
readonly loopTools: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
276
449
|
}>, import("effect/rpc/RpcSchema").Stream<Schema.TaggedUnion<{
|
|
277
450
|
readonly Image: Schema.TaggedStruct<"Image", {
|
|
278
451
|
readonly fileName: Schema.String;
|
|
279
452
|
readonly mediaType: Schema.Literals<readonly ["image/png", "image/jpeg", "image/gif", "image/webp"]>;
|
|
280
453
|
readonly data: Schema.Uint8Array;
|
|
281
454
|
}>;
|
|
282
|
-
readonly
|
|
455
|
+
readonly Request: Schema.TaggedStruct<"Request", {
|
|
283
456
|
readonly id: Schema.Finite;
|
|
284
|
-
readonly
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
457
|
+
readonly request: Schema.TaggedUnion<{
|
|
458
|
+
readonly Delegate: Schema.TaggedStruct<"Delegate", {
|
|
459
|
+
readonly prompt: Schema.String;
|
|
460
|
+
readonly background: Schema.Boolean;
|
|
461
|
+
}>;
|
|
462
|
+
readonly ListAgents: Schema.TaggedStruct<"ListAgents", {}>;
|
|
463
|
+
readonly LoopTool: Schema.TaggedStruct<"LoopTool", {
|
|
464
|
+
readonly name: Schema.String;
|
|
465
|
+
readonly params: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
466
|
+
}>;
|
|
467
|
+
readonly MessageAgent: Schema.TaggedStruct<"MessageAgent", {
|
|
468
|
+
readonly id: Schema.String;
|
|
469
|
+
readonly message: Schema.String;
|
|
470
|
+
}>;
|
|
471
|
+
readonly StopAgent: Schema.TaggedStruct<"StopAgent", {
|
|
472
|
+
readonly id: Schema.String;
|
|
473
|
+
}>;
|
|
474
|
+
readonly TaskComplete: Schema.TaggedStruct<"TaskComplete", {
|
|
475
|
+
readonly summary: Schema.String;
|
|
476
|
+
}>;
|
|
477
|
+
readonly WaitAgents: Schema.TaggedStruct<"WaitAgents", {
|
|
478
|
+
readonly ids: Schema.UndefinedOr<Schema.$Array<Schema.String>>;
|
|
479
|
+
}>;
|
|
480
|
+
}>;
|
|
288
481
|
}>;
|
|
289
482
|
readonly Text: Schema.TaggedStruct<"Text", {
|
|
290
483
|
readonly text: Schema.String;
|
|
@@ -292,9 +485,16 @@ declare const Rpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"capabilities", Schema.Void,
|
|
|
292
485
|
}>, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"executeUnsafe", Schema.Struct<{
|
|
293
486
|
readonly tool: Schema.String;
|
|
294
487
|
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<"
|
|
488
|
+
}>, Schema.Codec<Schema.Json, Schema.Json, never, never>, Schema.Never, never, never> | Rpc.Rpc<"respond", Schema.Struct<{
|
|
296
489
|
id: Schema.Finite;
|
|
297
|
-
|
|
490
|
+
response: Schema.TaggedUnion<{
|
|
491
|
+
readonly Failure: Schema.TaggedStruct<"Failure", {
|
|
492
|
+
readonly message: Schema.String;
|
|
493
|
+
}>;
|
|
494
|
+
readonly Success: Schema.TaggedStruct<"Success", {
|
|
495
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
496
|
+
}>;
|
|
497
|
+
}>;
|
|
298
498
|
}>, Schema.Void, Schema.Never, never, never>>;
|
|
299
499
|
/**
|
|
300
500
|
* @since 1.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentExecutor.d.ts","sourceRoot":"","sources":["../src/AgentExecutor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentExecutor.d.ts","sourceRoot":"","sources":["../src/AgentExecutor.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,UAAU,EAGV,gBAAgB,EAEhB,gBAAgB,EAChB,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,eAAe,EAEpB,gBAAgB,EAChB,KAAK,SAAS,EAEd,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;AAEzC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,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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