@robota-sdk/agent-tools 3.0.0-beta.63 → 3.0.0-beta.64
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/browser/browser.d.ts +176 -192
- package/dist/browser/browser.d.ts.map +1 -0
- package/dist/browser/browser.js +2 -1
- package/dist/browser/browser.js.map +1 -0
- package/dist/node/index.cjs +1534 -1663
- package/dist/node/index.d.ts +300 -304
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +1512 -1657
- package/dist/node/index.js.map +1 -0
- package/package.json +7 -7
- package/dist/node/index.d.cts +0 -504
package/dist/node/index.d.ts
CHANGED
|
@@ -1,303 +1,301 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEventService, IFunctionTool, IOpenAPIToolConfig, IParameterValidationResult, ITool, IToolExecutionContext, IToolRegistry, IToolResult, IToolSchema, TToolExecutor, TToolParameters, TUniversalValue } from "@robota-sdk/agent-core";
|
|
2
2
|
|
|
3
|
+
//#region src/types/tool-result.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Result returned by a CLI tool invocation
|
|
5
6
|
*/
|
|
6
7
|
interface TToolResult {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
8
|
+
success: boolean;
|
|
9
|
+
output: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
exitCode?: number;
|
|
12
|
+
/** Start line number of the edit in the original file (Edit tool only) */
|
|
13
|
+
startLine?: number;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/sandbox/types.d.ts
|
|
15
17
|
interface ISandboxRunOptions {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
workingDirectory?: string;
|
|
18
20
|
}
|
|
19
21
|
interface ISandboxRunResult {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
stdout: string;
|
|
23
|
+
stderr?: string;
|
|
24
|
+
exitCode: number;
|
|
23
25
|
}
|
|
24
26
|
interface IWorkspaceManifestFileEntry {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
type: 'file';
|
|
28
|
+
content: string;
|
|
29
|
+
encoding?: 'utf8';
|
|
28
30
|
}
|
|
29
31
|
interface IWorkspaceManifestDirectoryEntry {
|
|
30
|
-
|
|
32
|
+
type: 'dir';
|
|
31
33
|
}
|
|
32
34
|
interface IWorkspaceManifestLocalFileEntry {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
type: 'localFile';
|
|
36
|
+
src: string;
|
|
35
37
|
}
|
|
36
38
|
interface IWorkspaceManifestLocalDirectoryEntry {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
type: 'localDir';
|
|
40
|
+
src: string;
|
|
39
41
|
}
|
|
40
42
|
interface IWorkspaceManifestGitRepositoryEntry {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
type: 'gitRepo';
|
|
44
|
+
url: string;
|
|
45
|
+
ref?: string;
|
|
46
|
+
shallow?: boolean;
|
|
45
47
|
}
|
|
46
48
|
interface IWorkspaceManifestS3MountEntry {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
type: 's3Mount';
|
|
50
|
+
bucket: string;
|
|
51
|
+
prefix?: string;
|
|
52
|
+
region: string;
|
|
51
53
|
}
|
|
52
54
|
interface IWorkspaceManifestGcsMountEntry {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
type: 'gcsMount';
|
|
56
|
+
bucket: string;
|
|
57
|
+
prefix?: string;
|
|
56
58
|
}
|
|
57
59
|
interface IWorkspaceManifestR2MountEntry {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
type: 'r2Mount';
|
|
61
|
+
bucket: string;
|
|
62
|
+
accountId: string;
|
|
63
|
+
prefix?: string;
|
|
62
64
|
}
|
|
63
65
|
interface IWorkspaceManifestAzureBlobMountEntry {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
type: 'azureBlobMount';
|
|
67
|
+
container: string;
|
|
68
|
+
account: string;
|
|
69
|
+
prefix?: string;
|
|
68
70
|
}
|
|
69
71
|
type TWorkspaceManifestEntry = IWorkspaceManifestFileEntry | IWorkspaceManifestDirectoryEntry | IWorkspaceManifestLocalFileEntry | IWorkspaceManifestLocalDirectoryEntry | IWorkspaceManifestGitRepositoryEntry | IWorkspaceManifestS3MountEntry | IWorkspaceManifestGcsMountEntry | IWorkspaceManifestR2MountEntry | IWorkspaceManifestAzureBlobMountEntry;
|
|
70
72
|
interface IWorkspaceManifestPermissions {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
read?: string[];
|
|
74
|
+
write?: string[];
|
|
73
75
|
}
|
|
74
76
|
interface IWorkspaceManifest {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
entries: Record<string, TWorkspaceManifestEntry>;
|
|
78
|
+
environment?: Record<string, string>;
|
|
79
|
+
permissions?: IWorkspaceManifestPermissions;
|
|
78
80
|
}
|
|
79
81
|
interface IWorkspaceManifestApplyOptions {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
targetRoot?: string;
|
|
83
|
+
hostRoot?: string;
|
|
82
84
|
}
|
|
83
85
|
type TWorkspaceManifestApplyStatus = 'applied' | 'unsupported';
|
|
84
86
|
interface IWorkspaceManifestAppliedEntry {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
path: string;
|
|
88
|
+
type: TWorkspaceManifestEntry['type'];
|
|
89
|
+
status: TWorkspaceManifestApplyStatus;
|
|
90
|
+
message?: string;
|
|
89
91
|
}
|
|
90
92
|
interface IWorkspaceManifestApplyResult {
|
|
91
|
-
|
|
93
|
+
entries: IWorkspaceManifestAppliedEntry[];
|
|
92
94
|
}
|
|
93
95
|
interface ISandboxClient {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
run(command: string, options?: ISandboxRunOptions): Promise<ISandboxRunResult>;
|
|
97
|
+
readFile(path: string): Promise<string>;
|
|
98
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
99
|
+
applyManifest?(manifest: IWorkspaceManifest, options?: IWorkspaceManifestApplyOptions): Promise<IWorkspaceManifestApplyResult>;
|
|
100
|
+
/** Return a provider-owned resumable workspace reference. */
|
|
101
|
+
snapshot?(): Promise<string>;
|
|
102
|
+
/** Hydrate this client from a provider-owned workspace reference. */
|
|
103
|
+
restore?(snapshotId: string): Promise<void>;
|
|
102
104
|
}
|
|
103
105
|
interface ISandboxToolOptions {
|
|
104
|
-
|
|
106
|
+
sandboxClient?: ISandboxClient;
|
|
105
107
|
}
|
|
106
|
-
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/sandbox/e2b-sandbox-client.d.ts
|
|
107
110
|
interface IE2BCommandStartOptions {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
timeoutMs?: number;
|
|
112
|
+
cwd?: string;
|
|
113
|
+
background?: false;
|
|
111
114
|
}
|
|
112
115
|
interface IE2BCommandResult {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
stdout?: string;
|
|
117
|
+
stderr?: string;
|
|
118
|
+
exitCode?: number;
|
|
119
|
+
exit_code?: number;
|
|
117
120
|
}
|
|
118
121
|
interface IE2BCommands {
|
|
119
|
-
|
|
122
|
+
run(command: string, options?: IE2BCommandStartOptions): Promise<IE2BCommandResult>;
|
|
120
123
|
}
|
|
121
124
|
interface IE2BFiles {
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
read(path: string): Promise<string | Uint8Array>;
|
|
126
|
+
write(path: string, content: string): Promise<void>;
|
|
124
127
|
}
|
|
125
128
|
interface IE2BSnapshot {
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
snapshotId?: string;
|
|
130
|
+
id?: string;
|
|
128
131
|
}
|
|
129
132
|
interface IE2BSandboxAdapter {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
sandboxId?: string;
|
|
134
|
+
commands: IE2BCommands;
|
|
135
|
+
files: IE2BFiles;
|
|
136
|
+
pause?(): Promise<boolean | string | void>;
|
|
137
|
+
connect?(): Promise<IE2BSandboxAdapter>;
|
|
138
|
+
createSnapshot?(): Promise<IE2BSnapshot>;
|
|
136
139
|
}
|
|
137
140
|
interface IE2BSandboxClientOptions {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
sandbox: IE2BSandboxAdapter;
|
|
142
|
+
connectSandbox?: (sandboxId: string) => Promise<IE2BSandboxAdapter>;
|
|
143
|
+
createSandboxFromSnapshot?: (snapshotId: string) => Promise<IE2BSandboxAdapter>;
|
|
141
144
|
}
|
|
142
145
|
declare class E2BSandboxClient implements ISandboxClient {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
146
|
+
private sandbox;
|
|
147
|
+
private readonly connectSandbox?;
|
|
148
|
+
private readonly createSandboxFromSnapshot?;
|
|
149
|
+
constructor(options: IE2BSandboxClientOptions);
|
|
150
|
+
run(command: string, options?: ISandboxRunOptions): Promise<ISandboxRunResult>;
|
|
151
|
+
readFile(path: string): Promise<string>;
|
|
152
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
153
|
+
snapshot(): Promise<string>;
|
|
154
|
+
restore(snapshotId: string): Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/sandbox/in-memory-sandbox-client.d.ts
|
|
154
158
|
type TInMemorySandboxRunHandler = (command: string, options: ISandboxRunOptions | undefined, files: ReadonlyMap<string, string>) => Promise<ISandboxRunResult> | ISandboxRunResult;
|
|
155
159
|
interface IInMemorySandboxClientOptions {
|
|
156
|
-
|
|
157
|
-
|
|
160
|
+
files?: Record<string, string>;
|
|
161
|
+
runHandler?: TInMemorySandboxRunHandler;
|
|
158
162
|
}
|
|
159
163
|
declare class InMemorySandboxClient implements ISandboxClient {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
164
|
+
private readonly files;
|
|
165
|
+
private readonly snapshots;
|
|
166
|
+
private readonly runHandler?;
|
|
167
|
+
private snapshotSequence;
|
|
168
|
+
constructor(options?: IInMemorySandboxClientOptions);
|
|
169
|
+
run(command: string, options?: ISandboxRunOptions): Promise<ISandboxRunResult>;
|
|
170
|
+
readFile(path: string): Promise<string>;
|
|
171
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
172
|
+
snapshot(): Promise<string>;
|
|
173
|
+
restore(snapshotId: string): Promise<void>;
|
|
174
|
+
getFile(path: string): string | undefined;
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/sandbox/workspace-manifest.d.ts
|
|
173
178
|
declare function applyWorkspaceManifest(sandboxClient: ISandboxClient, manifest: IWorkspaceManifest, options?: IWorkspaceManifestApplyOptions): Promise<IWorkspaceManifestApplyResult>;
|
|
174
179
|
declare function validateWorkspaceManifestPath(path: string): string;
|
|
175
|
-
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/registry/tool-registry.d.ts
|
|
176
182
|
/**
|
|
177
183
|
* Tool registry implementation
|
|
178
184
|
* Manages tool registration, validation, and retrieval
|
|
179
185
|
*/
|
|
180
186
|
declare class ToolRegistry implements IToolRegistry {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
* FunctionTool - Type definitions for Facade pattern implementation
|
|
230
|
-
*
|
|
231
|
-
* REASON: Complex Zod schema type compatibility requires separation of concerns
|
|
232
|
-
* ALTERNATIVES_CONSIDERED:
|
|
233
|
-
* 1. Fix all Zod undefined issues in single file (creates maintenance burden)
|
|
234
|
-
* 2. Use any types strategically (reduces type safety)
|
|
235
|
-
* 3. Remove Zod support entirely (breaks existing functionality)
|
|
236
|
-
* 4. Create complex conditional types (adds cognitive overhead)
|
|
237
|
-
* 5. Use type assertions everywhere (increases runtime risk)
|
|
238
|
-
* NOTE: Tool functionality is now integrated into @robota-sdk/agent-tools package
|
|
239
|
-
*/
|
|
240
|
-
|
|
187
|
+
private tools;
|
|
188
|
+
/**
|
|
189
|
+
* Register a tool
|
|
190
|
+
*/
|
|
191
|
+
register(tool: ITool): void;
|
|
192
|
+
/**
|
|
193
|
+
* Unregister a tool
|
|
194
|
+
*/
|
|
195
|
+
unregister(name: string): void;
|
|
196
|
+
/**
|
|
197
|
+
* Get tool by name
|
|
198
|
+
*/
|
|
199
|
+
get(name: string): ITool | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Get all registered tools
|
|
202
|
+
*/
|
|
203
|
+
getAll(): ITool[];
|
|
204
|
+
/**
|
|
205
|
+
* Get tool schemas
|
|
206
|
+
*/
|
|
207
|
+
getSchemas(): IToolSchema[];
|
|
208
|
+
/**
|
|
209
|
+
* Check if tool exists
|
|
210
|
+
*/
|
|
211
|
+
has(name: string): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Clear all tools
|
|
214
|
+
*/
|
|
215
|
+
clear(): void;
|
|
216
|
+
/**
|
|
217
|
+
* Get tool names
|
|
218
|
+
*/
|
|
219
|
+
getToolNames(): string[];
|
|
220
|
+
/**
|
|
221
|
+
* Get tools by pattern
|
|
222
|
+
*/
|
|
223
|
+
getToolsByPattern(pattern: string | RegExp): ITool[];
|
|
224
|
+
/**
|
|
225
|
+
* Get tool count
|
|
226
|
+
*/
|
|
227
|
+
size(): number;
|
|
228
|
+
/**
|
|
229
|
+
* Validate tool schema
|
|
230
|
+
*/
|
|
231
|
+
private validateToolSchema;
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/implementations/function-tool/types.d.ts
|
|
241
235
|
/**
|
|
242
236
|
* Zod schema compatibility types
|
|
237
|
+
*
|
|
238
|
+
* Widened to `unknown` so that actual Zod schemas (ZodObject<...>) are structurally
|
|
239
|
+
* assignable without `as unknown as IZodSchema` casts at call sites.
|
|
243
240
|
*/
|
|
244
241
|
interface IZodParseResult {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
success: boolean;
|
|
243
|
+
data?: unknown;
|
|
244
|
+
error?: unknown;
|
|
248
245
|
}
|
|
249
246
|
interface IZodSchemaDef {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
247
|
+
typeName?: string;
|
|
248
|
+
innerType?: IZodSchema;
|
|
249
|
+
valueType?: IZodSchema;
|
|
250
|
+
checks?: Array<{
|
|
251
|
+
kind: string;
|
|
252
|
+
value?: TUniversalValue;
|
|
253
|
+
}>;
|
|
254
|
+
shape?: () => Record<string, IZodSchema>;
|
|
255
|
+
type?: IZodSchema;
|
|
256
|
+
values?: TUniversalValue[];
|
|
257
|
+
description?: string;
|
|
258
|
+
unknownKeys?: 'passthrough' | 'strip' | 'strict';
|
|
262
259
|
}
|
|
263
260
|
interface IZodSchema {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
parse(value: unknown): unknown;
|
|
262
|
+
safeParse(value: unknown): IZodParseResult;
|
|
263
|
+
_def?: IZodSchemaDef;
|
|
267
264
|
}
|
|
268
265
|
/**
|
|
269
266
|
* Parameter type validation options
|
|
270
267
|
*/
|
|
271
268
|
interface IFunctionToolValidationOptions {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
269
|
+
strict?: boolean;
|
|
270
|
+
allowUnknown?: boolean;
|
|
271
|
+
validateTypes?: boolean;
|
|
275
272
|
}
|
|
276
273
|
/**
|
|
277
274
|
* Schema conversion options
|
|
278
275
|
*/
|
|
279
276
|
interface ISchemaConversionOptions {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
includeDescription?: boolean;
|
|
278
|
+
strictTypes?: boolean;
|
|
279
|
+
allowAdditionalProperties?: boolean;
|
|
283
280
|
}
|
|
284
281
|
/**
|
|
285
282
|
* Tool execution metadata
|
|
286
283
|
*/
|
|
287
284
|
interface IFunctionToolExecutionMetadata {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
executionTime: number;
|
|
286
|
+
toolName: string;
|
|
287
|
+
parameters: TToolParameters;
|
|
291
288
|
}
|
|
292
289
|
/**
|
|
293
290
|
* Tool result with metadata
|
|
294
291
|
*/
|
|
295
292
|
interface IFunctionToolResult {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
293
|
+
success: boolean;
|
|
294
|
+
data: TUniversalValue;
|
|
295
|
+
metadata?: IFunctionToolExecutionMetadata;
|
|
299
296
|
}
|
|
300
|
-
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/implementations/function-tool.d.ts
|
|
301
299
|
/**
|
|
302
300
|
* Function tool implementation
|
|
303
301
|
* Wraps a JavaScript function as a tool with schema validation
|
|
@@ -306,40 +304,40 @@ interface IFunctionToolResult {
|
|
|
306
304
|
* circular runtime dependency (tools → agents → tools).
|
|
307
305
|
*/
|
|
308
306
|
declare class FunctionTool implements IFunctionTool {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
307
|
+
readonly schema: IToolSchema;
|
|
308
|
+
readonly fn: TToolExecutor;
|
|
309
|
+
private eventService;
|
|
310
|
+
constructor(schema: IToolSchema, fn: TToolExecutor);
|
|
311
|
+
/**
|
|
312
|
+
* Get tool name
|
|
313
|
+
*/
|
|
314
|
+
getName(): string;
|
|
315
|
+
/**
|
|
316
|
+
* Set EventService for post-construction injection.
|
|
317
|
+
* Accepts EventService as-is without transformation.
|
|
318
|
+
* Caller is responsible for providing properly configured EventService.
|
|
319
|
+
*/
|
|
320
|
+
setEventService(eventService: IEventService | undefined): void;
|
|
321
|
+
/**
|
|
322
|
+
* Execute the function tool
|
|
323
|
+
*/
|
|
324
|
+
execute(parameters: TToolParameters, context?: IToolExecutionContext): Promise<IToolResult>;
|
|
325
|
+
/**
|
|
326
|
+
* Validate parameters (simple boolean result)
|
|
327
|
+
*/
|
|
328
|
+
validate(parameters: TToolParameters): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Validate tool parameters with detailed result
|
|
331
|
+
*/
|
|
332
|
+
validateParameters(parameters: TToolParameters): IParameterValidationResult;
|
|
333
|
+
/**
|
|
334
|
+
* Get tool description
|
|
335
|
+
*/
|
|
336
|
+
getDescription(): string;
|
|
337
|
+
/**
|
|
338
|
+
* Validate constructor inputs
|
|
339
|
+
*/
|
|
340
|
+
private validateConstructorInputs;
|
|
343
341
|
}
|
|
344
342
|
/**
|
|
345
343
|
* Helper function to create a function tool from a simple function
|
|
@@ -349,7 +347,8 @@ declare function createFunctionTool(name: string, description: string, parameter
|
|
|
349
347
|
* Helper function to create a function tool from Zod schema
|
|
350
348
|
*/
|
|
351
349
|
declare function createZodFunctionTool(name: string, description: string, zodSchema: IZodSchema, fn: TToolExecutor): FunctionTool;
|
|
352
|
-
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/implementations/openapi-tool.d.ts
|
|
353
352
|
/**
|
|
354
353
|
* OpenAPI tool implementation
|
|
355
354
|
* Executes API calls based on OpenAPI 3.0 specifications
|
|
@@ -358,74 +357,63 @@ declare function createZodFunctionTool(name: string, description: string, zodSch
|
|
|
358
357
|
* circular runtime dependency (tools → agents → tools).
|
|
359
358
|
*/
|
|
360
359
|
declare class OpenAPITool implements ITool {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
360
|
+
readonly schema: IToolSchema;
|
|
361
|
+
private readonly apiSpec;
|
|
362
|
+
private readonly operationId;
|
|
363
|
+
private readonly baseURL;
|
|
364
|
+
private readonly config;
|
|
365
|
+
private eventService;
|
|
366
|
+
constructor(config: IOpenAPIToolConfig);
|
|
367
|
+
/**
|
|
368
|
+
* Execute the OpenAPI tool
|
|
369
|
+
*/
|
|
370
|
+
execute(parameters: TToolParameters, context?: IToolExecutionContext): Promise<IToolResult>;
|
|
371
|
+
/**
|
|
372
|
+
* Validate tool parameters
|
|
373
|
+
*/
|
|
374
|
+
validate(parameters: TToolParameters): boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Validate tool parameters with detailed result
|
|
377
|
+
*/
|
|
378
|
+
validateParameters(parameters: TToolParameters): IParameterValidationResult;
|
|
379
|
+
/**
|
|
380
|
+
* Get tool name
|
|
381
|
+
*/
|
|
382
|
+
getName(): string;
|
|
383
|
+
/**
|
|
384
|
+
* Set EventService for post-construction injection.
|
|
385
|
+
*/
|
|
386
|
+
setEventService(eventService: IEventService | undefined): void;
|
|
387
|
+
/**
|
|
388
|
+
* Get tool description
|
|
389
|
+
*/
|
|
390
|
+
getDescription(): string;
|
|
391
|
+
/**
|
|
392
|
+
* Execute the actual API call
|
|
393
|
+
* @private
|
|
394
|
+
*/
|
|
395
|
+
private executeAPICall;
|
|
396
|
+
/**
|
|
397
|
+
* Build HTTP request configuration from OpenAPI operation and parameters
|
|
398
|
+
*/
|
|
399
|
+
private buildRequestConfig;
|
|
400
|
+
/**
|
|
401
|
+
* Create tool schema from OpenAPI operation specification
|
|
402
|
+
*/
|
|
403
|
+
private createSchemaFromOpenAPI;
|
|
405
404
|
}
|
|
406
405
|
/**
|
|
407
406
|
* Factory function to create OpenAPI tools from specification
|
|
408
407
|
*/
|
|
409
408
|
declare function createOpenAPITool(config: IOpenAPIToolConfig): OpenAPITool;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
* FunctionTool - Schema conversion utilities for Facade pattern
|
|
413
|
-
*
|
|
414
|
-
* REASON: Complex Zod to JSON schema conversion requires isolated utility functions
|
|
415
|
-
* ALTERNATIVES_CONSIDERED:
|
|
416
|
-
* 1. Keep conversion logic in main class (violates single responsibility)
|
|
417
|
-
* 2. Use third-party library (adds external dependency)
|
|
418
|
-
* 3. Manual conversion each time (code duplication)
|
|
419
|
-
* 4. Runtime type checking only (loses compile-time safety)
|
|
420
|
-
* 5. Remove Zod support (breaks backward compatibility)
|
|
421
|
-
* TODO: Consider caching conversion results for performance
|
|
422
|
-
*/
|
|
423
|
-
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/implementations/function-tool/schema-converter.d.ts
|
|
424
411
|
/**
|
|
425
412
|
* Convert Zod schema to JSON Schema format with safe undefined handling
|
|
426
413
|
*/
|
|
427
414
|
declare function zodToJsonSchema(schema: IZodSchema, options?: ISchemaConversionOptions): IToolSchema['parameters'];
|
|
428
|
-
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/builtins/bash-tool.d.ts
|
|
429
417
|
/**
|
|
430
418
|
* Create a BashTool instance — register with Robota agent tools registry.
|
|
431
419
|
*/
|
|
@@ -434,7 +422,8 @@ declare function createBashTool(options?: ISandboxToolOptions): FunctionTool;
|
|
|
434
422
|
* BashTool instance — register with Robota agent tools registry.
|
|
435
423
|
*/
|
|
436
424
|
declare const bashTool: FunctionTool;
|
|
437
|
-
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/builtins/read-tool.d.ts
|
|
438
427
|
/**
|
|
439
428
|
* Create a ReadTool instance — register with Robota agent tools registry.
|
|
440
429
|
*/
|
|
@@ -443,7 +432,8 @@ declare function createReadTool(options?: ISandboxToolOptions): FunctionTool;
|
|
|
443
432
|
* ReadTool instance — register with Robota agent tools registry.
|
|
444
433
|
*/
|
|
445
434
|
declare const readTool: FunctionTool;
|
|
446
|
-
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/builtins/write-tool.d.ts
|
|
447
437
|
/**
|
|
448
438
|
* Create a WriteTool instance — register with Robota agent tools registry.
|
|
449
439
|
*/
|
|
@@ -452,7 +442,8 @@ declare function createWriteTool(options?: ISandboxToolOptions): FunctionTool;
|
|
|
452
442
|
* WriteTool instance — register with Robota agent tools registry.
|
|
453
443
|
*/
|
|
454
444
|
declare const writeTool: FunctionTool;
|
|
455
|
-
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/builtins/edit-tool.d.ts
|
|
456
447
|
/**
|
|
457
448
|
* Create an EditTool instance — register with Robota agent tools registry.
|
|
458
449
|
*/
|
|
@@ -461,7 +452,8 @@ declare function createEditTool(options?: ISandboxToolOptions): FunctionTool;
|
|
|
461
452
|
* EditTool instance — register with Robota agent tools registry.
|
|
462
453
|
*/
|
|
463
454
|
declare const editTool: FunctionTool;
|
|
464
|
-
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/builtins/glob-tool.d.ts
|
|
465
457
|
/**
|
|
466
458
|
* GlobTool — fast file pattern search using fast-glob.
|
|
467
459
|
*
|
|
@@ -472,7 +464,8 @@ declare const editTool: FunctionTool;
|
|
|
472
464
|
* GlobTool instance — register with Robota agent tools registry.
|
|
473
465
|
*/
|
|
474
466
|
declare const globTool: FunctionTool;
|
|
475
|
-
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/builtins/grep-tool.d.ts
|
|
476
469
|
/**
|
|
477
470
|
* GrepTool — recursive regex content search.
|
|
478
471
|
*
|
|
@@ -484,7 +477,8 @@ declare const globTool: FunctionTool;
|
|
|
484
477
|
* GrepTool instance — register with Robota agent tools registry.
|
|
485
478
|
*/
|
|
486
479
|
declare const grepTool: FunctionTool;
|
|
487
|
-
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/builtins/web-fetch-tool.d.ts
|
|
488
482
|
/**
|
|
489
483
|
* WebFetchTool — fetch a URL and return its content as text.
|
|
490
484
|
*
|
|
@@ -492,7 +486,8 @@ declare const grepTool: FunctionTool;
|
|
|
492
486
|
* Output is capped at 30K chars (same as other tools).
|
|
493
487
|
*/
|
|
494
488
|
declare const webFetchTool: FunctionTool;
|
|
495
|
-
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/builtins/web-search-tool.d.ts
|
|
496
491
|
/**
|
|
497
492
|
* WebSearchTool — search the web and return results.
|
|
498
493
|
*
|
|
@@ -500,5 +495,6 @@ declare const webFetchTool: FunctionTool;
|
|
|
500
495
|
* Returns an error with setup instructions otherwise.
|
|
501
496
|
*/
|
|
502
497
|
declare const webSearchTool: FunctionTool;
|
|
503
|
-
|
|
498
|
+
//#endregion
|
|
504
499
|
export { E2BSandboxClient, FunctionTool, type IE2BSandboxAdapter, type IE2BSandboxClientOptions, type IFunctionToolExecutionMetadata, type IFunctionToolResult, type IFunctionToolValidationOptions, type IInMemorySandboxClientOptions, type ISandboxClient, type ISandboxRunOptions, type ISandboxRunResult, type ISandboxToolOptions, type ISchemaConversionOptions, type IWorkspaceManifest, type IWorkspaceManifestAppliedEntry, type IWorkspaceManifestApplyOptions, type IWorkspaceManifestApplyResult, type IWorkspaceManifestAzureBlobMountEntry, type IWorkspaceManifestDirectoryEntry, type IWorkspaceManifestFileEntry, type IWorkspaceManifestGcsMountEntry, type IWorkspaceManifestGitRepositoryEntry, type IWorkspaceManifestLocalDirectoryEntry, type IWorkspaceManifestLocalFileEntry, type IWorkspaceManifestPermissions, type IWorkspaceManifestR2MountEntry, type IWorkspaceManifestS3MountEntry, type IZodParseResult, type IZodSchema, type IZodSchemaDef, InMemorySandboxClient, OpenAPITool, type TInMemorySandboxRunHandler, type TToolResult, type TWorkspaceManifestApplyStatus, type TWorkspaceManifestEntry, ToolRegistry, applyWorkspaceManifest, bashTool, createBashTool, createEditTool, createFunctionTool, createOpenAPITool, createReadTool, createWriteTool, createZodFunctionTool, editTool, globTool, grepTool, readTool, validateWorkspaceManifestPath, webFetchTool, webSearchTool, writeTool, zodToJsonSchema };
|
|
500
|
+
//# sourceMappingURL=index.d.ts.map
|