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