@polka-codes/core 0.9.83 → 0.9.84

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.
@@ -0,0 +1,2303 @@
1
+ import type { FilePart } from 'ai';
2
+ import type { ImagePart } from 'ai';
3
+ import type { JSONValue } from '@ai-sdk/provider';
4
+ import type { LanguageModelV2 } from '@ai-sdk/provider';
5
+ import type { LanguageModelV2ToolResultOutput } from '@ai-sdk/provider';
6
+ import type { LanguageModelV2Usage } from '@ai-sdk/provider';
7
+ import type { ModelMessage } from '@ai-sdk/provider-utils';
8
+ import type { ProviderOptions } from '@ai-sdk/provider-utils';
9
+ import type { ReasoningPart } from '@ai-sdk/provider-utils';
10
+ import type { SystemModelMessage } from '@ai-sdk/provider-utils';
11
+ import type { TextPart } from 'ai';
12
+ import type { TextPart as TextPart_2 } from '@ai-sdk/provider-utils';
13
+ import type { ToolModelMessage } from '@ai-sdk/provider-utils';
14
+ import type { ToolResultPart } from '@ai-sdk/provider-utils';
15
+ import { ToolSet } from 'ai';
16
+ import { z } from 'zod';
17
+
18
+ declare type AgentToolRegistry = {
19
+ generateText: {
20
+ input: {
21
+ messages: JsonModelMessage[];
22
+ tools: ToolSet;
23
+ model?: string;
24
+ };
25
+ output: JsonResponseMessage[];
26
+ };
27
+ taskEvent: {
28
+ input: TaskEvent;
29
+ output: void;
30
+ };
31
+ invokeTool: {
32
+ input: {
33
+ toolName: string;
34
+ input: any;
35
+ };
36
+ output: ToolResponse;
37
+ };
38
+ };
39
+ export { AgentToolRegistry }
40
+ export { AgentToolRegistry as AgentToolRegistry_alias_1 }
41
+ export { AgentToolRegistry as AgentToolRegistry_alias_2 }
42
+
43
+ declare const agentWorkflow: WorkflowFn<AgentWorkflowInput, ExitReason, AgentToolRegistry>;
44
+ export { agentWorkflow }
45
+ export { agentWorkflow as agentWorkflow_alias_1 }
46
+ export { agentWorkflow as agentWorkflow_alias_2 }
47
+
48
+ declare type AgentWorkflowInput = {
49
+ tools: Readonly<FullToolInfo[]>;
50
+ maxToolRoundTrips?: number;
51
+ userMessage: readonly JsonUserModelMessage[];
52
+ outputSchema?: z.ZodSchema;
53
+ model?: string;
54
+ } & ({
55
+ messages: JsonModelMessage[];
56
+ } | {
57
+ systemPrompt: string;
58
+ });
59
+ export { AgentWorkflowInput }
60
+ export { AgentWorkflowInput as AgentWorkflowInput_alias_1 }
61
+ export { AgentWorkflowInput as AgentWorkflowInput_alias_2 }
62
+
63
+ declare type BreakStep = z.infer<typeof BreakStepSchema>;
64
+ export { BreakStep }
65
+ export { BreakStep as BreakStep_alias_1 }
66
+ export { BreakStep as BreakStep_alias_2 }
67
+
68
+ /**
69
+ * Break statement - exits the nearest enclosing loop
70
+ */
71
+ declare const BreakStepSchema: z.ZodObject<{
72
+ break: z.ZodLiteral<true>;
73
+ }, z.core.$strip>;
74
+ export { BreakStepSchema }
75
+ export { BreakStepSchema as BreakStepSchema_alias_1 }
76
+ export { BreakStepSchema as BreakStepSchema_alias_2 }
77
+
78
+ declare type CommandProvider = {
79
+ executeCommand?: (command: string, needApprove: boolean) => Promise<{
80
+ stdout: string;
81
+ stderr: string;
82
+ exitCode: number;
83
+ summary?: string;
84
+ }>;
85
+ };
86
+ export { CommandProvider }
87
+ export { CommandProvider as CommandProvider_alias_1 }
88
+ export { CommandProvider as CommandProvider_alias_2 }
89
+
90
+ /**
91
+ * Utility to compute exponential backoff delays for rate-limit handling. generated by polka.codes
92
+ *
93
+ * The backoff starts at baseSeconds and doubles each time, capped at capSeconds.
94
+ * Example with base=2, cap=60: 2, 4, 8, 16, 32, 60, 60, ...
95
+ */
96
+ declare function computeRateLimitBackoffSeconds(count: number, baseSeconds?: number, capSeconds?: number): number;
97
+ export { computeRateLimitBackoffSeconds }
98
+ export { computeRateLimitBackoffSeconds as computeRateLimitBackoffSeconds_alias_1 }
99
+
100
+ declare type Config = NonNullable<z.infer<typeof configSchema>>;
101
+ export { Config }
102
+ export { Config as Config_alias_1 }
103
+
104
+ declare type ConfigRule = z.infer<typeof ruleSchema>;
105
+ export { ConfigRule }
106
+ export { ConfigRule as ConfigRule_alias_1 }
107
+
108
+ declare const configSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
109
+ prices: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
110
+ inputPrice: z.ZodOptional<z.ZodNumber>;
111
+ outputPrice: z.ZodOptional<z.ZodNumber>;
112
+ cacheWritesPrice: z.ZodOptional<z.ZodNumber>;
113
+ cacheReadsPrice: z.ZodOptional<z.ZodNumber>;
114
+ }, z.core.$strip>>>>;
115
+ providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
116
+ apiKey: z.ZodOptional<z.ZodString>;
117
+ defaultModel: z.ZodOptional<z.ZodString>;
118
+ defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
119
+ location: z.ZodOptional<z.ZodString>;
120
+ project: z.ZodOptional<z.ZodString>;
121
+ keyFile: z.ZodOptional<z.ZodString>;
122
+ baseUrl: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>>>;
124
+ defaultProvider: z.ZodOptional<z.ZodString>;
125
+ defaultModel: z.ZodOptional<z.ZodString>;
126
+ defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
127
+ maxMessageCount: z.ZodOptional<z.ZodNumber>;
128
+ budget: z.ZodOptional<z.ZodNumber>;
129
+ retryCount: z.ZodOptional<z.ZodNumber>;
130
+ requestTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
131
+ summaryThreshold: z.ZodOptional<z.ZodNumber>;
132
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
133
+ command: z.ZodString;
134
+ description: z.ZodString;
135
+ }, z.core.$strict>, z.ZodObject<{
136
+ workflow: z.ZodString;
137
+ description: z.ZodOptional<z.ZodString>;
138
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
139
+ }, z.core.$strict>, z.ZodObject<{
140
+ script: z.ZodString;
141
+ description: z.ZodOptional<z.ZodString>;
142
+ permissions: z.ZodOptional<z.ZodObject<{
143
+ fs: z.ZodOptional<z.ZodEnum<{
144
+ read: "read";
145
+ write: "write";
146
+ none: "none";
147
+ }>>;
148
+ network: z.ZodOptional<z.ZodBoolean>;
149
+ subprocess: z.ZodOptional<z.ZodBoolean>;
150
+ }, z.core.$strip>>;
151
+ timeout: z.ZodOptional<z.ZodNumber>;
152
+ memory: z.ZodOptional<z.ZodNumber>;
153
+ }, z.core.$strict>]>>>;
154
+ commands: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
155
+ provider: z.ZodOptional<z.ZodString>;
156
+ model: z.ZodOptional<z.ZodString>;
157
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
158
+ budget: z.ZodOptional<z.ZodNumber>;
159
+ rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
160
+ path: z.ZodString;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ url: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ repo: z.ZodString;
165
+ path: z.ZodString;
166
+ tag: z.ZodOptional<z.ZodString>;
167
+ commit: z.ZodOptional<z.ZodString>;
168
+ branch: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strict>]>>>, z.ZodString]>>;
170
+ }, z.core.$strip>>>;
171
+ tools: z.ZodOptional<z.ZodObject<{
172
+ search: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
173
+ provider: z.ZodOptional<z.ZodString>;
174
+ model: z.ZodOptional<z.ZodString>;
175
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
176
+ budget: z.ZodOptional<z.ZodNumber>;
177
+ rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
178
+ path: z.ZodString;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ url: z.ZodString;
181
+ }, z.core.$strict>, z.ZodObject<{
182
+ repo: z.ZodString;
183
+ path: z.ZodString;
184
+ tag: z.ZodOptional<z.ZodString>;
185
+ commit: z.ZodOptional<z.ZodString>;
186
+ branch: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strict>]>>>, z.ZodString]>>;
188
+ }, z.core.$strip>, z.ZodBoolean]>>;
189
+ }, z.core.$strip>>;
190
+ mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
191
+ command: z.ZodString;
192
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
193
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
194
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
195
+ provider: z.ZodOptional<z.ZodString>;
196
+ model: z.ZodOptional<z.ZodString>;
197
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
198
+ }, z.core.$strict>]>>>;
199
+ }, z.core.$strict>>>;
200
+ rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
201
+ path: z.ZodString;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ url: z.ZodString;
204
+ }, z.core.$strict>, z.ZodObject<{
205
+ repo: z.ZodString;
206
+ path: z.ZodString;
207
+ tag: z.ZodOptional<z.ZodString>;
208
+ commit: z.ZodOptional<z.ZodString>;
209
+ branch: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strict>]>>>, z.ZodString]>>;
211
+ excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ }, z.core.$strict>>>;
213
+ export { configSchema }
214
+ export { configSchema as configSchema_alias_1 }
215
+
216
+ declare type ContinueStep = z.infer<typeof ContinueStepSchema>;
217
+ export { ContinueStep }
218
+ export { ContinueStep as ContinueStep_alias_1 }
219
+ export { ContinueStep as ContinueStep_alias_2 }
220
+
221
+ /**
222
+ * Continue statement - skips to next iteration of nearest enclosing loop
223
+ */
224
+ declare const ContinueStepSchema: z.ZodObject<{
225
+ continue: z.ZodLiteral<true>;
226
+ }, z.core.$strip>;
227
+ export { ContinueStepSchema }
228
+ export { ContinueStepSchema as ContinueStepSchema_alias_1 }
229
+ export { ContinueStepSchema as ContinueStepSchema_alias_2 }
230
+
231
+ declare function createContext<TTools extends ToolRegistry>(tools: WorkflowTools<TTools>, stepFn?: StepFn, logger?: Logger): WorkflowContext<TTools>;
232
+ export { createContext }
233
+ export { createContext as createContext_alias_1 }
234
+ export { createContext as createContext_alias_2 }
235
+
236
+ declare function createDynamicWorkflow<TTools extends ToolRegistry = DynamicWorkflowRegistry>(definition: WorkflowFile | string, options?: DynamicWorkflowRunnerOptions): (workflowId: string, input: Record<string, any>, context: WorkflowContext<TTools>) => Promise<any>;
237
+ export { createDynamicWorkflow }
238
+ export { createDynamicWorkflow as createDynamicWorkflow_alias_1 }
239
+ export { createDynamicWorkflow as createDynamicWorkflow_alias_2 }
240
+
241
+ /**
242
+ * Create a file content XML element
243
+ */
244
+ export declare function createFileElement(tagName: string, path: string, content?: string, attrs?: Record<string, string>): string;
245
+
246
+ /**
247
+ * Create a standardized error response for provider method not available
248
+ */
249
+ export declare function createProviderError(action: string): ToolResponse;
250
+
251
+ declare const _default: {
252
+ handler: ToolHandler<{
253
+ readonly name: "askFollowupQuestion";
254
+ readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
255
+ readonly parameters: z.ZodObject<{
256
+ questions: z.ZodArray<z.ZodObject<{
257
+ prompt: z.ZodString;
258
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
259
+ }, z.core.$strip>>;
260
+ }, z.core.$strip>;
261
+ }, InteractionProvider>;
262
+ name: "askFollowupQuestion";
263
+ description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
264
+ parameters: z.ZodObject<{
265
+ questions: z.ZodArray<z.ZodObject<{
266
+ prompt: z.ZodString;
267
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
268
+ }, z.core.$strip>>;
269
+ }, z.core.$strip>;
270
+ };
271
+ export { _default as askFollowupQuestion }
272
+ export { _default as askFollowupQuestion_alias_1 }
273
+ export { _default as default_alias }
274
+
275
+ declare const _default_10: {
276
+ handler: ToolHandler<{
277
+ readonly name: "search";
278
+ readonly description: "Search the web for information using Google Search. Use this tool to find current information, facts, news, documentation, or research that is not available in your training data. Returns comprehensive search results with relevant content extracted from the web.";
279
+ readonly parameters: z.ZodObject<{
280
+ query: z.ZodString;
281
+ }, z.core.$strip>;
282
+ }, WebProvider>;
283
+ name: "search";
284
+ description: "Search the web for information using Google Search. Use this tool to find current information, facts, news, documentation, or research that is not available in your training data. Returns comprehensive search results with relevant content extracted from the web.";
285
+ parameters: z.ZodObject<{
286
+ query: z.ZodString;
287
+ }, z.core.$strip>;
288
+ };
289
+ export { _default_10 as default_alias_9 }
290
+ export { _default_10 as search }
291
+ export { _default_10 as search_alias_1 }
292
+
293
+ declare const _default_11: {
294
+ handler: ToolHandler<{
295
+ readonly name: "searchFiles";
296
+ readonly description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
297
+ readonly parameters: z.ZodObject<{
298
+ path: z.ZodString;
299
+ regex: z.ZodString;
300
+ filePattern: z.ZodOptional<z.ZodString>;
301
+ }, z.core.$strip>;
302
+ }, FilesystemProvider>;
303
+ name: "searchFiles";
304
+ description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
305
+ parameters: z.ZodObject<{
306
+ path: z.ZodString;
307
+ regex: z.ZodString;
308
+ filePattern: z.ZodOptional<z.ZodString>;
309
+ }, z.core.$strip>;
310
+ };
311
+ export { _default_11 as default_alias_10 }
312
+ export { _default_11 as searchFiles }
313
+ export { _default_11 as searchFiles_alias_1 }
314
+
315
+ declare const _default_12: {
316
+ handler: ToolHandler<{
317
+ readonly name: "writeToFile";
318
+ readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
319
+ readonly parameters: z.ZodObject<{
320
+ path: z.ZodString;
321
+ content: z.ZodString;
322
+ }, z.core.$strip>;
323
+ }, FilesystemProvider>;
324
+ name: "writeToFile";
325
+ description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
326
+ parameters: z.ZodObject<{
327
+ path: z.ZodString;
328
+ content: z.ZodString;
329
+ }, z.core.$strip>;
330
+ };
331
+ export { _default_12 as default_alias_11 }
332
+ export { _default_12 as writeToFile }
333
+ export { _default_12 as writeToFile_alias_1 }
334
+
335
+ declare const _default_2: {
336
+ handler: ToolHandler<{
337
+ readonly name: "executeCommand";
338
+ readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
339
+ readonly parameters: z.ZodObject<{
340
+ command: z.ZodString;
341
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
342
+ }, z.core.$strip>;
343
+ }, CommandProvider>;
344
+ name: "executeCommand";
345
+ description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
346
+ parameters: z.ZodObject<{
347
+ command: z.ZodString;
348
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
349
+ }, z.core.$strip>;
350
+ };
351
+ export { _default_2 as default_alias_1 }
352
+ export { _default_2 as executeCommand }
353
+ export { _default_2 as executeCommand_alias_1 }
354
+
355
+ declare const _default_3: {
356
+ handler: ToolHandler<{
357
+ readonly name: "fetchUrl";
358
+ readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
359
+ readonly parameters: z.ZodObject<{
360
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
361
+ }, z.core.$strip>;
362
+ }, WebProvider>;
363
+ name: "fetchUrl";
364
+ description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
365
+ parameters: z.ZodObject<{
366
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
367
+ }, z.core.$strip>;
368
+ };
369
+ export { _default_3 as default_alias_2 }
370
+ export { _default_3 as fetchUrl }
371
+ export { _default_3 as fetchUrl_alias_1 }
372
+
373
+ declare const _default_4: {
374
+ handler: ToolHandler<{
375
+ readonly name: "listFiles";
376
+ readonly description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
377
+ readonly parameters: z.ZodObject<{
378
+ path: z.ZodString;
379
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
380
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
381
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
382
+ }, z.core.$strip>;
383
+ }, FilesystemProvider>;
384
+ name: "listFiles";
385
+ description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
386
+ parameters: z.ZodObject<{
387
+ path: z.ZodString;
388
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
389
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
390
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
391
+ }, z.core.$strip>;
392
+ };
393
+ export { _default_4 as default_alias_3 }
394
+ export { _default_4 as listFiles }
395
+ export { _default_4 as listFiles_alias_1 }
396
+
397
+ declare const _default_5: {
398
+ handler: ToolHandler<{
399
+ readonly name: "readBinaryFile";
400
+ readonly description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
401
+ readonly parameters: z.ZodObject<{
402
+ url: z.ZodString;
403
+ }, z.core.$strip>;
404
+ }, FilesystemProvider>;
405
+ name: "readBinaryFile";
406
+ description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
407
+ parameters: z.ZodObject<{
408
+ url: z.ZodString;
409
+ }, z.core.$strip>;
410
+ };
411
+ export { _default_5 as default_alias_4 }
412
+ export { _default_5 as readBinaryFile }
413
+ export { _default_5 as readBinaryFile_alias_1 }
414
+
415
+ declare const _default_6: {
416
+ handler: ToolHandler<{
417
+ readonly name: "readFile";
418
+ readonly description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
419
+ readonly parameters: z.ZodObject<{
420
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
421
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
422
+ }, z.core.$strip>;
423
+ }, FilesystemProvider>;
424
+ name: "readFile";
425
+ description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
426
+ parameters: z.ZodObject<{
427
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
428
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
429
+ }, z.core.$strip>;
430
+ };
431
+ export { _default_6 as default_alias_5 }
432
+ export { _default_6 as readFile }
433
+ export { _default_6 as readFile_alias_1 }
434
+
435
+ declare const _default_7: {
436
+ handler: ToolHandler<{
437
+ readonly name: "removeFile";
438
+ readonly description: "Request to remove a file at the specified path.";
439
+ readonly parameters: z.ZodObject<{
440
+ path: z.ZodString;
441
+ }, z.core.$strip>;
442
+ }, FilesystemProvider>;
443
+ name: "removeFile";
444
+ description: "Request to remove a file at the specified path.";
445
+ parameters: z.ZodObject<{
446
+ path: z.ZodString;
447
+ }, z.core.$strip>;
448
+ };
449
+ export { _default_7 as default_alias_6 }
450
+ export { _default_7 as removeFile }
451
+ export { _default_7 as removeFile_alias_1 }
452
+
453
+ declare const _default_8: {
454
+ handler: ToolHandler<{
455
+ readonly name: "renameFile";
456
+ readonly description: "Request to rename a file from source path to target path.";
457
+ readonly parameters: z.ZodObject<{
458
+ source_path: z.ZodString;
459
+ target_path: z.ZodString;
460
+ }, z.core.$strip>;
461
+ }, FilesystemProvider>;
462
+ name: "renameFile";
463
+ description: "Request to rename a file from source path to target path.";
464
+ parameters: z.ZodObject<{
465
+ source_path: z.ZodString;
466
+ target_path: z.ZodString;
467
+ }, z.core.$strip>;
468
+ };
469
+ export { _default_8 as default_alias_7 }
470
+ export { _default_8 as renameFile }
471
+ export { _default_8 as renameFile_alias_1 }
472
+
473
+ declare const _default_9: {
474
+ handler: ToolHandler<{
475
+ readonly name: "replaceInFile";
476
+ readonly description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
477
+ readonly parameters: z.ZodObject<{
478
+ path: z.ZodString;
479
+ diff: z.ZodString;
480
+ }, z.core.$strip>;
481
+ }, FilesystemProvider>;
482
+ name: "replaceInFile";
483
+ description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
484
+ parameters: z.ZodObject<{
485
+ path: z.ZodString;
486
+ diff: z.ZodString;
487
+ }, z.core.$strip>;
488
+ };
489
+ export { _default_9 as default_alias_8 }
490
+ export { _default_9 as replaceInFile }
491
+ export { _default_9 as replaceInFile_alias_1 }
492
+
493
+ /**
494
+ * Represents a directory entry
495
+ */
496
+ declare interface DirectoryEntry {
497
+ name: string;
498
+ isDirectory: boolean;
499
+ isFile: boolean;
500
+ }
501
+ export { DirectoryEntry }
502
+ export { DirectoryEntry as DirectoryEntry_alias_1 }
503
+ export { DirectoryEntry as DirectoryEntry_alias_2 }
504
+
505
+ /**
506
+ * Returns the directory portion of a path string.
507
+ * Strips trailing slashes, then takes everything up to the last slash.
508
+ */
509
+ export declare function dirname(path: string): string;
510
+
511
+ declare type DynamicStepRuntimeContext<TTools extends ToolRegistry> = {
512
+ workflowId: string;
513
+ stepId: string;
514
+ input: Record<string, any>;
515
+ state: Record<string, any>;
516
+ tools: WorkflowTools<TTools>;
517
+ logger: Logger;
518
+ step: StepFn;
519
+ runWorkflow: (workflowId: string, input?: Record<string, any>) => Promise<any>;
520
+ toolInfo: Readonly<FullToolInfo[]> | undefined;
521
+ agentTools: Record<string, (input: any) => Promise<any>>;
522
+ };
523
+ export { DynamicStepRuntimeContext }
524
+ export { DynamicStepRuntimeContext as DynamicStepRuntimeContext_alias_1 }
525
+ export { DynamicStepRuntimeContext as DynamicStepRuntimeContext_alias_2 }
526
+
527
+ declare type DynamicWorkflowParseResult = {
528
+ success: true;
529
+ definition: WorkflowFile;
530
+ } | {
531
+ success: false;
532
+ error: string;
533
+ };
534
+ export { DynamicWorkflowParseResult }
535
+ export { DynamicWorkflowParseResult as DynamicWorkflowParseResult_alias_1 }
536
+ export { DynamicWorkflowParseResult as DynamicWorkflowParseResult_alias_2 }
537
+
538
+ declare type DynamicWorkflowRegistry = ToolRegistry & {
539
+ runWorkflow: RunWorkflowTool;
540
+ };
541
+ export { DynamicWorkflowRegistry }
542
+ export { DynamicWorkflowRegistry as DynamicWorkflowRegistry_alias_1 }
543
+ export { DynamicWorkflowRegistry as DynamicWorkflowRegistry_alias_2 }
544
+
545
+ declare type DynamicWorkflowRunnerOptions = {
546
+ /**
547
+ * Tool definitions used when a step does not have persisted `code`
548
+ * and needs to be executed via `agentWorkflow`.
549
+ */
550
+ toolInfo?: Readonly<FullToolInfo[]>;
551
+ /**
552
+ * Model id forwarded to `agentWorkflow` for agent-executed steps.
553
+ */
554
+ model?: string;
555
+ /**
556
+ * Maximum round trips for agent-executed steps.
557
+ */
558
+ maxToolRoundTrips?: number;
559
+ /**
560
+ * Customize per-step system prompt for agent-executed steps.
561
+ */
562
+ stepSystemPrompt?: (args: {
563
+ workflowId: string;
564
+ step: WorkflowStepDefinition;
565
+ input: any;
566
+ state: any;
567
+ }) => string;
568
+ /**
569
+ * Whether to wrap plain text agent responses in an object { result: ... }.
570
+ * Defaults to false.
571
+ */
572
+ wrapAgentResultInObject?: boolean;
573
+ /**
574
+ * Built-in workflows that can be called by name if not found in the definition.
575
+ */
576
+ builtInWorkflows?: Record<string, WorkflowFn<any, any, any>>;
577
+ /**
578
+ * Allow unsafe code execution in condition expressions.
579
+ * When false (default), only simple comparisons and property access are allowed.
580
+ * When true, arbitrary JavaScript code can be executed in conditions.
581
+ * WARNING: Setting to true with untrusted workflow definitions is a security risk.
582
+ * @default false
583
+ */
584
+ allowUnsafeCodeExecution?: boolean;
585
+ };
586
+ export { DynamicWorkflowRunnerOptions }
587
+ export { DynamicWorkflowRunnerOptions as DynamicWorkflowRunnerOptions_alias_1 }
588
+ export { DynamicWorkflowRunnerOptions as DynamicWorkflowRunnerOptions_alias_2 }
589
+
590
+ declare type ExitReason = {
591
+ type: 'UsageExceeded';
592
+ messages: JsonModelMessage[];
593
+ } | {
594
+ type: 'Exit';
595
+ message: string;
596
+ object?: any;
597
+ messages: JsonModelMessage[];
598
+ } | {
599
+ type: 'Error';
600
+ error: {
601
+ message: string;
602
+ stack?: string;
603
+ };
604
+ messages: JsonModelMessage[];
605
+ };
606
+ export { ExitReason }
607
+ export { ExitReason as ExitReason_alias_1 }
608
+ export { ExitReason as ExitReason_alias_2 }
609
+
610
+ /**
611
+ * File statistics
612
+ */
613
+ declare interface FileStats {
614
+ size: number;
615
+ isDirectory: boolean;
616
+ isFile: boolean;
617
+ }
618
+ export { FileStats }
619
+ export { FileStats as FileStats_alias_1 }
620
+ export { FileStats as FileStats_alias_2 }
621
+
622
+ /**
623
+ * File system provider interface for abstracting file operations.
624
+ * This allows the core package to run in different environments:
625
+ * - Node.js (local filesystem)
626
+ * - Cloudflare edge runtime (remote storage, KV, R2, etc.)
627
+ */
628
+ declare interface FileSystemProvider {
629
+ /**
630
+ * Check if a path exists
631
+ */
632
+ exists(path: string): Promise<boolean> | boolean;
633
+ /**
634
+ * Read a directory and return entries
635
+ */
636
+ readdir(path: string): Promise<DirectoryEntry[]>;
637
+ /**
638
+ * Read file content as text
639
+ */
640
+ readFile(path: string): Promise<string>;
641
+ /**
642
+ * Read file content as a buffer
643
+ */
644
+ readFileAsBuffer(path: string): Promise<Uint8Array>;
645
+ /**
646
+ * Get file statistics
647
+ */
648
+ stat(path: string): Promise<FileStats>;
649
+ /**
650
+ * Join path segments
651
+ */
652
+ join(...paths: string[]): string;
653
+ /**
654
+ * Normalize a path
655
+ */
656
+ normalize(path: string): string;
657
+ }
658
+ export { FileSystemProvider }
659
+ export { FileSystemProvider as FileSystemProvider_alias_1 }
660
+ export { FileSystemProvider as FileSystemProvider_alias_2 }
661
+
662
+ declare type FilesystemProvider = {
663
+ readFile?: (path: string, includeIgnored: boolean) => Promise<string | undefined>;
664
+ writeFile?: (path: string, content: string) => Promise<void>;
665
+ removeFile?: (path: string) => Promise<void>;
666
+ renameFile?: (sourcePath: string, targetPath: string) => Promise<void>;
667
+ listFiles?: (path: string, recursive: boolean, maxCount: number, includeIgnored: boolean) => Promise<[string[], boolean]>;
668
+ searchFiles?: (path: string, regex: string, filePattern: string) => Promise<string[]>;
669
+ readBinaryFile?: (url: string) => Promise<{
670
+ base64Data: string;
671
+ mediaType: string;
672
+ }>;
673
+ };
674
+ export { FilesystemProvider }
675
+ export { FilesystemProvider as FilesystemProvider_alias_1 }
676
+ export { FilesystemProvider as FilesystemProvider_alias_2 }
677
+
678
+ /**
679
+ * Options for configuring the file system provider
680
+ */
681
+ declare interface FileSystemProviderOptions {
682
+ /**
683
+ * Base directory for relative paths
684
+ */
685
+ baseDir?: string;
686
+ }
687
+ export { FileSystemProviderOptions }
688
+ export { FileSystemProviderOptions as FileSystemProviderOptions_alias_1 }
689
+ export { FileSystemProviderOptions as FileSystemProviderOptions_alias_2 }
690
+
691
+ declare const fromJsonModelMessage: (msg: JsonModelMessage) => ModelMessage;
692
+ export { fromJsonModelMessage }
693
+ export { fromJsonModelMessage as fromJsonModelMessage_alias_1 }
694
+ export { fromJsonModelMessage as fromJsonModelMessage_alias_2 }
695
+
696
+ declare type FullToolInfo = ToolInfo & {
697
+ handler: ToolHandler<ToolInfo, any>;
698
+ };
699
+ export { FullToolInfo }
700
+ export { FullToolInfo as FullToolInfo_alias_1 }
701
+
702
+ /**
703
+ * Get file statistics for a skill
704
+ */
705
+ declare function getSkillStats(skill: Skill): {
706
+ totalSize: number;
707
+ fileCount: number;
708
+ largestFile: {
709
+ name: string;
710
+ size: number;
711
+ };
712
+ };
713
+ export { getSkillStats }
714
+ export { getSkillStats as getSkillStats_alias_1 }
715
+ export { getSkillStats as getSkillStats_alias_2 }
716
+
717
+ declare type GetTodoItemOutput = TodoItem & {
718
+ subItems: {
719
+ id: string;
720
+ title: string;
721
+ }[];
722
+ };
723
+ export { GetTodoItemOutput }
724
+ export { GetTodoItemOutput as GetTodoItemOutput_alias_1 }
725
+ export { GetTodoItemOutput as GetTodoItemOutput_alias_2 }
726
+
727
+ export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
728
+
729
+ export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, CommandProvider>;
730
+
731
+ export declare const handler_alias_10: ToolHandler<typeof toolInfo_alias_10, FilesystemProvider>;
732
+
733
+ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, FilesystemProvider>;
734
+
735
+ export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, WebProvider>;
736
+
737
+ export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, FilesystemProvider>;
738
+
739
+ export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, FilesystemProvider>;
740
+
741
+ export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, FilesystemProvider>;
742
+
743
+ export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
744
+
745
+ export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, FilesystemProvider>;
746
+
747
+ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, FilesystemProvider>;
748
+
749
+ export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, WebProvider>;
750
+
751
+ declare type IfElseStep = z.infer<typeof IfElseStepSchema>;
752
+ export { IfElseStep }
753
+ export { IfElseStep as IfElseStep_alias_1 }
754
+ export { IfElseStep as IfElseStep_alias_2 }
755
+
756
+ /**
757
+ * If/else branch - conditionally executes steps
758
+ */
759
+ declare const IfElseStepSchema: any;
760
+ export { IfElseStepSchema }
761
+ export { IfElseStepSchema as IfElseStepSchema_alias_1 }
762
+ export { IfElseStepSchema as IfElseStepSchema_alias_2 }
763
+
764
+ declare const IGNORED_DIRECTORIES: readonly [".git", "node_modules", ".next", ".turbo", "dist", "build", "coverage", ".cache", ".vscode", ".idea", "tmp", "temp", ".DS_Store"];
765
+ export { IGNORED_DIRECTORIES }
766
+ export { IGNORED_DIRECTORIES as IGNORED_DIRECTORIES_alias_1 }
767
+ export { IGNORED_DIRECTORIES as IGNORED_DIRECTORIES_alias_2 }
768
+
769
+ declare type InteractionProvider = {
770
+ askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
771
+ };
772
+ export { InteractionProvider }
773
+ export { InteractionProvider as InteractionProvider_alias_1 }
774
+ export { InteractionProvider as InteractionProvider_alias_2 }
775
+
776
+ /**
777
+ * Joins all given path segments, then normalizes the result.
778
+ */
779
+ export declare function join(...parts: string[]): string;
780
+
781
+ /**
782
+ Content of an assistant message.
783
+ It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
784
+ */
785
+ declare type JsonAssistantContent = string | Array<TextPart_2 | JsonFilePart | ReasoningPart | JsonToolCallPart | ToolResultPart>;
786
+
787
+ /**
788
+ An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
789
+ */
790
+ declare type JsonAssistantModelMessage = {
791
+ role: 'assistant';
792
+ content: JsonAssistantContent;
793
+ /**
794
+ Additional provider-specific metadata. They are passed through
795
+ to the provider from the AI SDK and enable provider-specific
796
+ functionality that can be fully encapsulated in the provider.
797
+ */
798
+ providerOptions?: ProviderOptions;
799
+ };
800
+
801
+ declare type JsonDataContent = {
802
+ type: 'base64' | 'url';
803
+ value: string;
804
+ };
805
+
806
+ /**
807
+ File content part of a prompt. It contains a file.
808
+ */
809
+ declare interface JsonFilePart {
810
+ type: 'file';
811
+ /**
812
+ File data. Can either be:
813
+
814
+ - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
815
+ - URL: a URL that points to the image
816
+ */
817
+ data: JsonDataContent;
818
+ /**
819
+ Optional filename of the file.
820
+ */
821
+ filename?: string;
822
+ /**
823
+ IANA media type of the file.
824
+
825
+ @see https://www.iana.org/assignments/media-types/media-types.xhtml
826
+ */
827
+ mediaType: string;
828
+ /**
829
+ Additional provider-specific metadata. They are passed through
830
+ to the provider from the AI SDK and enable provider-specific
831
+ functionality that can be fully encapsulated in the provider.
832
+ */
833
+ providerOptions?: ProviderOptions;
834
+ }
835
+ export { JsonFilePart }
836
+ export { JsonFilePart as JsonFilePart_alias_1 }
837
+ export { JsonFilePart as JsonFilePart_alias_2 }
838
+
839
+ declare interface JsonImagePart {
840
+ type: 'image';
841
+ /**
842
+ Image data. Can either be:
843
+
844
+ - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
845
+ - URL: a URL that points to the image
846
+ */
847
+ image: JsonDataContent;
848
+ /**
849
+ Optional IANA media type of the image.
850
+
851
+ @see https://www.iana.org/assignments/media-types/media-types.xhtml
852
+ */
853
+ mediaType?: string;
854
+ /**
855
+ Additional provider-specific metadata. They are passed through
856
+ to the provider from the AI SDK and enable provider-specific
857
+ functionality that can be fully encapsulated in the provider.
858
+ */
859
+ providerOptions?: ProviderOptions;
860
+ }
861
+ export { JsonImagePart }
862
+ export { JsonImagePart as JsonImagePart_alias_1 }
863
+ export { JsonImagePart as JsonImagePart_alias_2 }
864
+
865
+ declare type JsonModelMessage = SystemModelMessage | JsonUserModelMessage | JsonAssistantModelMessage | ToolModelMessage;
866
+ export { JsonModelMessage }
867
+ export { JsonModelMessage as JsonModelMessage_alias_1 }
868
+ export { JsonModelMessage as JsonModelMessage_alias_2 }
869
+
870
+ declare type JsonResponseMessage = JsonAssistantModelMessage | ToolModelMessage;
871
+ export { JsonResponseMessage }
872
+ export { JsonResponseMessage as JsonResponseMessage_alias_1 }
873
+ export { JsonResponseMessage as JsonResponseMessage_alias_2 }
874
+
875
+ declare interface JsonToolCallPart {
876
+ type: 'tool-call';
877
+ /**
878
+ ID of the tool call. This ID is used to match the tool call with the tool result.
879
+ */
880
+ toolCallId: string;
881
+ /**
882
+ Name of the tool that is being called.
883
+ */
884
+ toolName: string;
885
+ /**
886
+ Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
887
+ */
888
+ input: JSONValue;
889
+ /**
890
+ Additional provider-specific metadata. They are passed through
891
+ to the provider from the AI SDK and enable provider-specific
892
+ functionality that can be fully encapsulated in the provider.
893
+ */
894
+ providerOptions?: ProviderOptions;
895
+ /**
896
+ Whether the tool call was executed by the provider.
897
+ */
898
+ providerExecuted?: boolean;
899
+ }
900
+
901
+ /**
902
+ Content of a user message. It can be a string or an array of text and image parts.
903
+ */
904
+ declare type JsonUserContent = string | Array<TextPart_2 | JsonImagePart | JsonFilePart>;
905
+ export { JsonUserContent }
906
+ export { JsonUserContent as JsonUserContent_alias_1 }
907
+ export { JsonUserContent as JsonUserContent_alias_2 }
908
+
909
+ /**
910
+ A user message. It can contain text or a combination of text and images.
911
+ */
912
+ declare type JsonUserModelMessage = {
913
+ role: 'user';
914
+ content: JsonUserContent;
915
+ /**
916
+ Additional provider-specific metadata. They are passed through
917
+ to the provider from the AI SDK and enable provider-specific
918
+ functionality that can be fully encapsulated in the provider.
919
+ */
920
+ providerOptions?: ProviderOptions;
921
+ };
922
+ export { JsonUserModelMessage }
923
+ export { JsonUserModelMessage as JsonUserModelMessage_alias_1 }
924
+ export { JsonUserModelMessage as JsonUserModelMessage_alias_2 }
925
+
926
+ /**
927
+ * List all available skills with their descriptions
928
+ *
929
+ * This tool enables agents to discover what specialized capabilities
930
+ * are available based on task context.
931
+ */
932
+ declare function listSkills(input: ListSkillsInput, context: SkillContext): Promise<ListSkillsOutput>;
933
+ export { listSkills }
934
+ export { listSkills as listSkills_alias_1 }
935
+ export { listSkills as listSkills_alias_2 }
936
+
937
+ declare type ListSkillsInput = z.infer<typeof ListSkillsInputSchema>;
938
+ export { ListSkillsInput }
939
+ export { ListSkillsInput as ListSkillsInput_alias_1 }
940
+ export { ListSkillsInput as ListSkillsInput_alias_2 }
941
+
942
+ /**
943
+ * Tool input parameters for listing skills
944
+ */
945
+ declare const ListSkillsInputSchema: z.ZodObject<{
946
+ filter: z.ZodOptional<z.ZodString>;
947
+ }, z.core.$strip>;
948
+ export { ListSkillsInputSchema }
949
+ export { ListSkillsInputSchema as ListSkillsInputSchema_alias_1 }
950
+ export { ListSkillsInputSchema as ListSkillsInputSchema_alias_2 }
951
+
952
+ declare type ListSkillsOutput = z.infer<typeof ListSkillsOutputSchema>;
953
+ export { ListSkillsOutput }
954
+ export { ListSkillsOutput as ListSkillsOutput_alias_1 }
955
+ export { ListSkillsOutput as ListSkillsOutput_alias_2 }
956
+
957
+ /**
958
+ * Tool output for listing skills
959
+ */
960
+ declare const ListSkillsOutputSchema: z.ZodObject<{
961
+ skills: z.ZodArray<z.ZodObject<{
962
+ name: z.ZodString;
963
+ description: z.ZodString;
964
+ source: z.ZodEnum<{
965
+ project: "project";
966
+ personal: "personal";
967
+ plugin: "plugin";
968
+ }>;
969
+ }, z.core.$strip>>;
970
+ total: z.ZodNumber;
971
+ }, z.core.$strip>;
972
+ export { ListSkillsOutputSchema }
973
+ export { ListSkillsOutputSchema as ListSkillsOutputSchema_alias_1 }
974
+ export { ListSkillsOutputSchema as ListSkillsOutputSchema_alias_2 }
975
+
976
+ /**
977
+ * Tool info for listSkills (used in agent workflow)
978
+ */
979
+ declare const listSkillsToolInfo: {
980
+ readonly name: "listSkills";
981
+ readonly description: "List all available skills with their descriptions. Use this to discover what specialized capabilities are available.";
982
+ readonly parameters: z.ZodObject<{
983
+ filter: z.ZodOptional<z.ZodString>;
984
+ }, z.core.$strip>;
985
+ readonly returns: z.ZodObject<{
986
+ skills: z.ZodArray<z.ZodObject<{
987
+ name: z.ZodString;
988
+ description: z.ZodString;
989
+ source: z.ZodEnum<{
990
+ project: "project";
991
+ personal: "personal";
992
+ plugin: "plugin";
993
+ }>;
994
+ }, z.core.$strip>>;
995
+ total: z.ZodNumber;
996
+ }, z.core.$strip>;
997
+ };
998
+ export { listSkillsToolInfo }
999
+ export { listSkillsToolInfo as listSkillsToolInfo_alias_1 }
1000
+ export { listSkillsToolInfo as listSkillsToolInfo_alias_2 }
1001
+
1002
+ declare type ListTodoItemsOutput = TodoItem[];
1003
+ export { ListTodoItemsOutput }
1004
+ export { ListTodoItemsOutput as ListTodoItemsOutput_alias_1 }
1005
+ export { ListTodoItemsOutput as ListTodoItemsOutput_alias_2 }
1006
+
1007
+ /**
1008
+ * Load a skill by name to access its instructions and resources
1009
+ *
1010
+ * This tool enables agents to autonomously load specialized knowledge
1011
+ * and capabilities based on task context.
1012
+ */
1013
+ declare function loadSkill(input: LoadSkillInput, context: SkillContext): Promise<LoadSkillOutput>;
1014
+ export { loadSkill }
1015
+ export { loadSkill as loadSkill_alias_1 }
1016
+ export { loadSkill as loadSkill_alias_2 }
1017
+
1018
+ declare type LoadSkillInput = z.infer<typeof LoadSkillInputSchema>;
1019
+ export { LoadSkillInput }
1020
+ export { LoadSkillInput as LoadSkillInput_alias_1 }
1021
+ export { LoadSkillInput as LoadSkillInput_alias_2 }
1022
+
1023
+ /**
1024
+ * Tool input parameters for loading a skill
1025
+ */
1026
+ declare const LoadSkillInputSchema: z.ZodObject<{
1027
+ skillName: z.ZodString;
1028
+ }, z.core.$strip>;
1029
+ export { LoadSkillInputSchema }
1030
+ export { LoadSkillInputSchema as LoadSkillInputSchema_alias_1 }
1031
+ export { LoadSkillInputSchema as LoadSkillInputSchema_alias_2 }
1032
+
1033
+ declare type LoadSkillOutput = z.infer<typeof LoadSkillOutputSchema>;
1034
+ export { LoadSkillOutput }
1035
+ export { LoadSkillOutput as LoadSkillOutput_alias_1 }
1036
+ export { LoadSkillOutput as LoadSkillOutput_alias_2 }
1037
+
1038
+ /**
1039
+ * Tool output for loading a skill
1040
+ */
1041
+ declare const LoadSkillOutputSchema: z.ZodObject<{
1042
+ success: z.ZodBoolean;
1043
+ skill: z.ZodOptional<z.ZodObject<{
1044
+ name: z.ZodString;
1045
+ description: z.ZodString;
1046
+ content: z.ZodString;
1047
+ availableFiles: z.ZodArray<z.ZodString>;
1048
+ }, z.core.$strip>>;
1049
+ error: z.ZodOptional<z.ZodString>;
1050
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1051
+ }, z.core.$strip>;
1052
+ export { LoadSkillOutputSchema }
1053
+ export { LoadSkillOutputSchema as LoadSkillOutputSchema_alias_1 }
1054
+ export { LoadSkillOutputSchema as LoadSkillOutputSchema_alias_2 }
1055
+
1056
+ /**
1057
+ * Tool info for loadSkill (used in agent workflow)
1058
+ */
1059
+ declare const loadSkillToolInfo: {
1060
+ readonly name: "loadSkill";
1061
+ readonly description: "Load a skill by name to access its instructions and resources. Use this when you need specialized knowledge or capabilities for a specific task.";
1062
+ readonly parameters: z.ZodObject<{
1063
+ skillName: z.ZodString;
1064
+ }, z.core.$strip>;
1065
+ readonly returns: z.ZodObject<{
1066
+ success: z.ZodBoolean;
1067
+ skill: z.ZodOptional<z.ZodObject<{
1068
+ name: z.ZodString;
1069
+ description: z.ZodString;
1070
+ content: z.ZodString;
1071
+ availableFiles: z.ZodArray<z.ZodString>;
1072
+ }, z.core.$strip>>;
1073
+ error: z.ZodOptional<z.ZodString>;
1074
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1075
+ }, z.core.$strip>;
1076
+ };
1077
+ export { loadSkillToolInfo }
1078
+ export { loadSkillToolInfo as loadSkillToolInfo_alias_1 }
1079
+ export { loadSkillToolInfo as loadSkillToolInfo_alias_2 }
1080
+
1081
+ declare interface Logger {
1082
+ debug: (...args: any[]) => void;
1083
+ info: (...args: any[]) => void;
1084
+ warn: (...args: any[]) => void;
1085
+ error: (...args: any[]) => void;
1086
+ }
1087
+ export { Logger }
1088
+ export { Logger as Logger_alias_1 }
1089
+ export { Logger as Logger_alias_2 }
1090
+
1091
+ declare const makeStepFn: () => StepFn;
1092
+ export { makeStepFn }
1093
+ export { makeStepFn as makeStepFn_alias_1 }
1094
+ export { makeStepFn as makeStepFn_alias_2 }
1095
+
1096
+ declare type McpServerConfig = z.infer<typeof mcpServerConfigSchema>;
1097
+ export { McpServerConfig }
1098
+ export { McpServerConfig as McpServerConfig_alias_1 }
1099
+
1100
+ declare const mcpServerConfigSchema: z.ZodObject<{
1101
+ command: z.ZodString;
1102
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1103
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1104
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
1105
+ provider: z.ZodOptional<z.ZodString>;
1106
+ model: z.ZodOptional<z.ZodString>;
1107
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1108
+ }, z.core.$strict>]>>>;
1109
+ }, z.core.$strict>;
1110
+ export { mcpServerConfigSchema }
1111
+ export { mcpServerConfigSchema as mcpServerConfigSchema_alias_1 }
1112
+
1113
+ declare interface MemoryProvider {
1114
+ listMemoryTopics: () => Promise<string[]>;
1115
+ readMemory: (topic?: string) => Promise<string | undefined>;
1116
+ updateMemory: (operation: 'append' | 'replace' | 'remove', topic: string | undefined, content: string | undefined) => Promise<void>;
1117
+ }
1118
+ export { MemoryProvider }
1119
+ export { MemoryProvider as MemoryProvider_alias_1 }
1120
+ export { MemoryProvider as MemoryProvider_alias_2 }
1121
+
1122
+ declare class MockProvider implements ToolProvider {
1123
+ listTodoItems(id?: string | null, _status?: string | null): Promise<{
1124
+ id: string;
1125
+ title: string;
1126
+ status: "open";
1127
+ description: string;
1128
+ }[]>;
1129
+ getTodoItem(id: string): Promise<GetTodoItemOutput | undefined>;
1130
+ updateTodoItem(input: UpdateTodoItemInput): Promise<{
1131
+ id: string;
1132
+ }>;
1133
+ readFile(_path: string, _includeIgnored?: boolean): Promise<string>;
1134
+ writeFile(_path: string, _content: string): Promise<void>;
1135
+ removeFile(_path: string): Promise<void>;
1136
+ renameFile(_sourcePath: string, _targetPath: string): Promise<void>;
1137
+ listFiles(_path: string, _recursive: boolean, _maxCount: number, _includeIgnored?: boolean): Promise<[string[], boolean]>;
1138
+ searchFiles(_path: string, _regex: string, _filePattern: string): Promise<string[]>;
1139
+ executeCommand(_command: string, _needApprove: boolean): Promise<{
1140
+ stdout: string;
1141
+ stderr: string;
1142
+ exitCode: number;
1143
+ summary?: string;
1144
+ }>;
1145
+ askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
1146
+ search(_query: string): Promise<string>;
1147
+ listMemoryTopics(): Promise<string[]>;
1148
+ readMemory(_topic?: string): Promise<string | undefined>;
1149
+ updateMemory(_operation: 'append' | 'replace' | 'remove', _topic?: string, _content?: string): Promise<void>;
1150
+ }
1151
+ export { MockProvider }
1152
+ export { MockProvider as MockProvider_alias_1 }
1153
+ export { MockProvider as MockProvider_alias_2 }
1154
+
1155
+ declare type ModelInfo = {
1156
+ inputPrice: number;
1157
+ outputPrice: number;
1158
+ cacheWritesPrice: number;
1159
+ cacheReadsPrice: number;
1160
+ };
1161
+ export { ModelInfo }
1162
+ export { ModelInfo as ModelInfo_alias_1 }
1163
+
1164
+ /**
1165
+ * Node.js file system provider implementation
1166
+ * Uses the node:fs module for file operations
1167
+ */
1168
+ declare class NodeFileSystemProvider implements FileSystemProvider {
1169
+ readonly _options: FileSystemProviderOptions;
1170
+ constructor(_options?: FileSystemProviderOptions);
1171
+ exists(path: string): boolean;
1172
+ readdir(path: string): Promise<DirectoryEntry[]>;
1173
+ readFile(path: string): Promise<string>;
1174
+ readFileAsBuffer(path: string): Promise<Uint8Array>;
1175
+ stat(path: string): Promise<FileStats>;
1176
+ join(...paths: string[]): string;
1177
+ normalize(path: string): string;
1178
+ }
1179
+ export { NodeFileSystemProvider }
1180
+ export { NodeFileSystemProvider as NodeFileSystemProvider_alias_1 }
1181
+ export { NodeFileSystemProvider as NodeFileSystemProvider_alias_2 }
1182
+
1183
+ declare function parseDynamicWorkflowDefinition(source: string): DynamicWorkflowParseResult;
1184
+ export { parseDynamicWorkflowDefinition }
1185
+ export { parseDynamicWorkflowDefinition as parseDynamicWorkflowDefinition_alias_1 }
1186
+ export { parseDynamicWorkflowDefinition as parseDynamicWorkflowDefinition_alias_2 }
1187
+
1188
+ declare const parseJsonFromMarkdown: (markdown: string) => ParseOutputResult<any>;
1189
+ export { parseJsonFromMarkdown }
1190
+ export { parseJsonFromMarkdown as parseJsonFromMarkdown_alias_1 }
1191
+ export { parseJsonFromMarkdown as parseJsonFromMarkdown_alias_2 }
1192
+
1193
+ declare type ParseOutputResult<T> = {
1194
+ success: true;
1195
+ data: T;
1196
+ } | {
1197
+ success: false;
1198
+ error?: string;
1199
+ };
1200
+ export { ParseOutputResult }
1201
+ export { ParseOutputResult as ParseOutputResult_alias_1 }
1202
+ export { ParseOutputResult as ParseOutputResult_alias_2 }
1203
+
1204
+ /**
1205
+ * Simplify boolean string preprocessing
1206
+ * Converts 'true'/'false' strings to actual booleans
1207
+ */
1208
+ export declare function preprocessBoolean(val: unknown): unknown;
1209
+
1210
+ declare type ProviderConfig = z.infer<typeof providerConfigSchema>;
1211
+ export { ProviderConfig }
1212
+ export { ProviderConfig as ProviderConfig_alias_1 }
1213
+
1214
+ declare const providerConfigSchema: z.ZodObject<{
1215
+ apiKey: z.ZodOptional<z.ZodString>;
1216
+ defaultModel: z.ZodOptional<z.ZodString>;
1217
+ defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1218
+ location: z.ZodOptional<z.ZodString>;
1219
+ project: z.ZodOptional<z.ZodString>;
1220
+ keyFile: z.ZodOptional<z.ZodString>;
1221
+ baseUrl: z.ZodOptional<z.ZodString>;
1222
+ }, z.core.$strip>;
1223
+ export { providerConfigSchema }
1224
+ export { providerConfigSchema as providerConfigSchema_alias_1 }
1225
+
1226
+ declare const providerModelSchema: z.ZodObject<{
1227
+ provider: z.ZodOptional<z.ZodString>;
1228
+ model: z.ZodOptional<z.ZodString>;
1229
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1230
+ budget: z.ZodOptional<z.ZodNumber>;
1231
+ rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1232
+ path: z.ZodString;
1233
+ }, z.core.$strict>, z.ZodObject<{
1234
+ url: z.ZodString;
1235
+ }, z.core.$strict>, z.ZodObject<{
1236
+ repo: z.ZodString;
1237
+ path: z.ZodString;
1238
+ tag: z.ZodOptional<z.ZodString>;
1239
+ commit: z.ZodOptional<z.ZodString>;
1240
+ branch: z.ZodOptional<z.ZodString>;
1241
+ }, z.core.$strict>]>>>, z.ZodString]>>;
1242
+ }, z.core.$strip>;
1243
+ export { providerModelSchema }
1244
+ export { providerModelSchema as providerModelSchema_alias_1 }
1245
+
1246
+ /**
1247
+ * Read a supporting file from a loaded skill
1248
+ *
1249
+ * This tool enables agents to access supporting files bundled with skills,
1250
+ * such as reference documentation, examples, scripts, or templates.
1251
+ * Files are returned as plain text content.
1252
+ */
1253
+ declare function readSkillFile(input: ReadSkillFileInput, context: SkillContext): Promise<ReadSkillFileOutput>;
1254
+ export { readSkillFile }
1255
+ export { readSkillFile as readSkillFile_alias_1 }
1256
+ export { readSkillFile as readSkillFile_alias_2 }
1257
+
1258
+ declare type ReadSkillFileInput = z.infer<typeof ReadSkillFileInputSchema>;
1259
+ export { ReadSkillFileInput }
1260
+ export { ReadSkillFileInput as ReadSkillFileInput_alias_1 }
1261
+ export { ReadSkillFileInput as ReadSkillFileInput_alias_2 }
1262
+
1263
+ /**
1264
+ * Tool input parameters for reading a skill file
1265
+ */
1266
+ declare const ReadSkillFileInputSchema: z.ZodObject<{
1267
+ skillName: z.ZodString;
1268
+ filename: z.ZodString;
1269
+ }, z.core.$strip>;
1270
+ export { ReadSkillFileInputSchema }
1271
+ export { ReadSkillFileInputSchema as ReadSkillFileInputSchema_alias_1 }
1272
+ export { ReadSkillFileInputSchema as ReadSkillFileInputSchema_alias_2 }
1273
+
1274
+ declare type ReadSkillFileOutput = z.infer<typeof ReadSkillFileOutputSchema>;
1275
+ export { ReadSkillFileOutput }
1276
+ export { ReadSkillFileOutput as ReadSkillFileOutput_alias_1 }
1277
+ export { ReadSkillFileOutput as ReadSkillFileOutput_alias_2 }
1278
+
1279
+ /**
1280
+ * Tool output for reading a skill file
1281
+ */
1282
+ declare const ReadSkillFileOutputSchema: z.ZodObject<{
1283
+ success: z.ZodBoolean;
1284
+ content: z.ZodOptional<z.ZodString>;
1285
+ error: z.ZodOptional<z.ZodString>;
1286
+ }, z.core.$strip>;
1287
+ export { ReadSkillFileOutputSchema }
1288
+ export { ReadSkillFileOutputSchema as ReadSkillFileOutputSchema_alias_1 }
1289
+ export { ReadSkillFileOutputSchema as ReadSkillFileOutputSchema_alias_2 }
1290
+
1291
+ /**
1292
+ * Tool info for readSkillFile (used in agent workflow)
1293
+ */
1294
+ declare const readSkillFileToolInfo: {
1295
+ readonly name: "readSkillFile";
1296
+ readonly description: "Read a supporting file from a skill. Use this to access reference documentation, examples, scripts, or templates bundled with a skill. First use loadSkill to see available files, then use this tool to read specific files.";
1297
+ readonly parameters: z.ZodObject<{
1298
+ skillName: z.ZodString;
1299
+ filename: z.ZodString;
1300
+ }, z.core.$strip>;
1301
+ readonly returns: z.ZodObject<{
1302
+ success: z.ZodBoolean;
1303
+ content: z.ZodOptional<z.ZodString>;
1304
+ error: z.ZodOptional<z.ZodString>;
1305
+ }, z.core.$strip>;
1306
+ };
1307
+ export { readSkillFileToolInfo }
1308
+ export { readSkillFileToolInfo as readSkillFileToolInfo_alias_1 }
1309
+ export { readSkillFileToolInfo as readSkillFileToolInfo_alias_2 }
1310
+
1311
+ declare const replaceInFile_2: (fileContent: string, diff: string) => ReplaceResult;
1312
+ export { replaceInFile_2 as replaceInFileHelper }
1313
+ export { replaceInFile_2 as replaceInFile_alias_2 }
1314
+ export { replaceInFile_2 as replaceInFile_alias_3 }
1315
+
1316
+ declare type ReplaceResult = {
1317
+ content: string;
1318
+ status: 'no_diff_applied' | 'some_diff_applied' | 'all_diff_applied';
1319
+ appliedCount: number;
1320
+ totalCount: number;
1321
+ };
1322
+ export { ReplaceResult }
1323
+ export { ReplaceResult as ReplaceResult_alias_1 }
1324
+
1325
+ declare const responsePrompts: {
1326
+ readonly errorInvokeTool: (tool: string, error: unknown) => string;
1327
+ readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
1328
+ readonly requireUseToolNative: "Error: No tool use detected. You MUST use a tool before proceeding.\n";
1329
+ readonly toolResults: (tool: string, result: LanguageModelV2ToolResultOutput) => Array<TextPart | ImagePart | FilePart>;
1330
+ readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
1331
+ };
1332
+ export { responsePrompts }
1333
+ export { responsePrompts as responsePrompts_alias_1 }
1334
+ export { responsePrompts as responsePrompts_alias_2 }
1335
+
1336
+ declare const ruleSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1337
+ path: z.ZodString;
1338
+ }, z.core.$strict>, z.ZodObject<{
1339
+ url: z.ZodString;
1340
+ }, z.core.$strict>, z.ZodObject<{
1341
+ repo: z.ZodString;
1342
+ path: z.ZodString;
1343
+ tag: z.ZodOptional<z.ZodString>;
1344
+ commit: z.ZodOptional<z.ZodString>;
1345
+ branch: z.ZodOptional<z.ZodString>;
1346
+ }, z.core.$strict>]>;
1347
+ export { ruleSchema }
1348
+ export { ruleSchema as ruleSchema_alias_1 }
1349
+
1350
+ declare type RunWorkflowTool = {
1351
+ input: {
1352
+ workflowId: string;
1353
+ input?: any;
1354
+ };
1355
+ output: any;
1356
+ };
1357
+ export { RunWorkflowTool }
1358
+ export { RunWorkflowTool as RunWorkflowTool_alias_1 }
1359
+ export { RunWorkflowTool as RunWorkflowTool_alias_2 }
1360
+
1361
+ declare type ScriptConfig = z.infer<typeof scriptSchema>;
1362
+ export { ScriptConfig }
1363
+ export { ScriptConfig as ScriptConfig_alias_1 }
1364
+
1365
+ declare const scriptSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1366
+ command: z.ZodString;
1367
+ description: z.ZodString;
1368
+ }, z.core.$strict>, z.ZodObject<{
1369
+ workflow: z.ZodString;
1370
+ description: z.ZodOptional<z.ZodString>;
1371
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1372
+ }, z.core.$strict>, z.ZodObject<{
1373
+ script: z.ZodString;
1374
+ description: z.ZodOptional<z.ZodString>;
1375
+ permissions: z.ZodOptional<z.ZodObject<{
1376
+ fs: z.ZodOptional<z.ZodEnum<{
1377
+ read: "read";
1378
+ write: "write";
1379
+ none: "none";
1380
+ }>>;
1381
+ network: z.ZodOptional<z.ZodBoolean>;
1382
+ subprocess: z.ZodOptional<z.ZodBoolean>;
1383
+ }, z.core.$strip>>;
1384
+ timeout: z.ZodOptional<z.ZodNumber>;
1385
+ memory: z.ZodOptional<z.ZodNumber>;
1386
+ }, z.core.$strict>]>;
1387
+ export { scriptSchema }
1388
+ export { scriptSchema as scriptSchema_alias_1 }
1389
+
1390
+ /**
1391
+ * Represents a loaded Agent Skill with all its content
1392
+ */
1393
+ declare interface Skill extends SkillReference {
1394
+ /**
1395
+ * Main instructions content (SKILL.md without frontmatter)
1396
+ */
1397
+ content: string;
1398
+ /**
1399
+ * Additional files bundled with the skill
1400
+ * Key is relative path from skill directory (e.g., "reference.md", "scripts/helper.py")
1401
+ * Value is file content
1402
+ */
1403
+ files: Map<string, string>;
1404
+ }
1405
+ export { Skill }
1406
+ export { Skill as Skill_alias_1 }
1407
+ export { Skill as Skill_alias_2 }
1408
+
1409
+ declare const SKILL_ERROR_MESSAGES: {
1410
+ readonly MISSING_FRONTMATTER: "SKILL.md must begin with YAML frontmatter enclosed in ---";
1411
+ readonly FRONTMATTER_INVALID: "Invalid frontmatter: {message}";
1412
+ readonly SKILL_NOT_FOUND: "Skill not found";
1413
+ readonly CONTEXT_NOT_INITIALIZED: "Skill context not initialized";
1414
+ };
1415
+ export { SKILL_ERROR_MESSAGES }
1416
+ export { SKILL_ERROR_MESSAGES as SKILL_ERROR_MESSAGES_alias_1 }
1417
+ export { SKILL_ERROR_MESSAGES as SKILL_ERROR_MESSAGES_alias_2 }
1418
+
1419
+ /**
1420
+ * Constants for Agent Skills system
1421
+ */
1422
+ declare const SKILL_LIMITS: {
1423
+ readonly MAX_FILE_SIZE: number;
1424
+ readonly MAX_SKILL_SIZE: number;
1425
+ readonly MAX_DEPTH: 10;
1426
+ readonly MAX_FILES: 500;
1427
+ readonly MIN_DESCRIPTION_LENGTH: 20;
1428
+ readonly MAX_DESCRIPTION_LENGTH: 1024;
1429
+ readonly MAX_NAME_LENGTH: 64;
1430
+ };
1431
+ export { SKILL_LIMITS }
1432
+ export { SKILL_LIMITS as SKILL_LIMITS_alias_1 }
1433
+ export { SKILL_LIMITS as SKILL_LIMITS_alias_2 }
1434
+
1435
+ /**
1436
+ * Context object passed to agents and tools for skill operations
1437
+ */
1438
+ declare interface SkillContext {
1439
+ /**
1440
+ * Currently active/loaded skill (if any)
1441
+ */
1442
+ activeSkill: Skill | null;
1443
+ /**
1444
+ * All available skills discovered from all sources (metadata only)
1445
+ */
1446
+ availableSkills: SkillReference[];
1447
+ /**
1448
+ * History of skills loaded during the session (for debugging/telemetry)
1449
+ */
1450
+ skillLoadingHistory: string[];
1451
+ /**
1452
+ * Load a skill by name
1453
+ */
1454
+ loadSkill: (name: string) => Promise<Skill | null>;
1455
+ }
1456
+ export { SkillContext }
1457
+ export { SkillContext as SkillContext_alias_1 }
1458
+ export { SkillContext as SkillContext_alias_2 }
1459
+
1460
+ /**
1461
+ * Error thrown when skill discovery fails
1462
+ */
1463
+ declare class SkillDiscoveryError extends Error {
1464
+ path: string;
1465
+ constructor(message: string, path: string);
1466
+ }
1467
+ export { SkillDiscoveryError }
1468
+ export { SkillDiscoveryError as SkillDiscoveryError_alias_1 }
1469
+ export { SkillDiscoveryError as SkillDiscoveryError_alias_2 }
1470
+
1471
+ /**
1472
+ * Service for discovering and loading Agent Skills from filesystem
1473
+ *
1474
+ * Skills are discovered from three sources with priority:
1475
+ * 1. Project skills at .claude/skills/ (highest priority)
1476
+ * 2. Personal skills at ~/.claude/skills/
1477
+ * 3. Plugin skills at node_modules (lowest priority)
1478
+ */
1479
+ declare class SkillDiscoveryService {
1480
+ private fs;
1481
+ private personalSkillsDir;
1482
+ private projectSkillsDir;
1483
+ private pluginSkillsDirs;
1484
+ constructor(options: {
1485
+ cwd: string;
1486
+ personalSkillsDir?: string;
1487
+ pluginSkillsDirs?: string[];
1488
+ fs?: FileSystemProvider;
1489
+ });
1490
+ /**
1491
+ * Discover all available skills from all sources
1492
+ * Removes duplicates (project skills take priority over personal/plugin)
1493
+ */
1494
+ discoverAll(): Promise<SkillReference[]>;
1495
+ /**
1496
+ * Discover skills in a specific directory
1497
+ */
1498
+ discoverInDirectory(dir: string, source: 'personal' | 'project' | 'plugin'): Promise<SkillReference[]>;
1499
+ /**
1500
+ * Discover skills from plugin directories (node_modules)
1501
+ */
1502
+ discoverPlugins(): Promise<SkillReference[]>;
1503
+ /**
1504
+ * Load a single skill from its directory
1505
+ */
1506
+ loadSkill(skillPath: string, source: 'personal' | 'project' | 'plugin'): Promise<Skill>;
1507
+ /**
1508
+ * Parse SKILL.md content and extract frontmatter
1509
+ */
1510
+ private parseSkillMd;
1511
+ /**
1512
+ * Parse and validate YAML frontmatter
1513
+ */
1514
+ private parseMetadata;
1515
+ /**
1516
+ * Recursively load files from a directory into the files map
1517
+ * @returns The total size of all files loaded (in bytes)
1518
+ */
1519
+ private loadDirectoryFiles;
1520
+ /**
1521
+ * Create an initial skill context object
1522
+ */
1523
+ createContext(): Promise<SkillContext>;
1524
+ }
1525
+ export { SkillDiscoveryService }
1526
+ export { SkillDiscoveryService as SkillDiscoveryService_alias_1 }
1527
+ export { SkillDiscoveryService as SkillDiscoveryService_alias_2 }
1528
+
1529
+ declare type SkillMetadata = z.infer<typeof skillMetadataSchema>;
1530
+ export { SkillMetadata }
1531
+ export { SkillMetadata as SkillMetadata_alias_1 }
1532
+ export { SkillMetadata as SkillMetadata_alias_2 }
1533
+
1534
+ /**
1535
+ * Zod schema for skill metadata (YAML frontmatter in SKILL.md)
1536
+ */
1537
+ declare const skillMetadataSchema: z.ZodObject<{
1538
+ name: z.ZodString;
1539
+ description: z.ZodString;
1540
+ allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1541
+ }, z.core.$strip>;
1542
+ export { skillMetadataSchema }
1543
+ export { skillMetadataSchema as skillMetadataSchema_alias_1 }
1544
+ export { skillMetadataSchema as skillMetadataSchema_alias_2 }
1545
+
1546
+ /**
1547
+ * Represents a reference to a discovered skill (metadata only)
1548
+ */
1549
+ declare interface SkillReference {
1550
+ /**
1551
+ * Parsed metadata from SKILL.md frontmatter
1552
+ */
1553
+ metadata: SkillMetadata;
1554
+ /**
1555
+ * Absolute path to the skill directory on disk
1556
+ */
1557
+ path: string;
1558
+ /**
1559
+ * Where the skill was loaded from
1560
+ */
1561
+ source: 'personal' | 'project' | 'plugin';
1562
+ }
1563
+ export { SkillReference }
1564
+ export { SkillReference as SkillReference_alias_1 }
1565
+ export { SkillReference as SkillReference_alias_2 }
1566
+
1567
+ declare type SkillSource = keyof typeof SOURCE_ICONS;
1568
+ export { SkillSource }
1569
+ export { SkillSource as SkillSource_alias_1 }
1570
+ export { SkillSource as SkillSource_alias_2 }
1571
+
1572
+ /**
1573
+ * Error thrown when skill validation fails
1574
+ */
1575
+ declare class SkillValidationError extends Error {
1576
+ path: string;
1577
+ constructor(message: string, path: string);
1578
+ }
1579
+ export { SkillValidationError }
1580
+ export { SkillValidationError as SkillValidationError_alias_1 }
1581
+ export { SkillValidationError as SkillValidationError_alias_2 }
1582
+
1583
+ declare const SOURCE_ICONS: {
1584
+ readonly project: "📁";
1585
+ readonly personal: "🏠";
1586
+ readonly plugin: "🔌";
1587
+ };
1588
+ export { SOURCE_ICONS }
1589
+ export { SOURCE_ICONS as SOURCE_ICONS_alias_1 }
1590
+ export { SOURCE_ICONS as SOURCE_ICONS_alias_2 }
1591
+
1592
+ declare interface StepFn {
1593
+ <T>(name: string, fn: () => Promise<T>): Promise<T>;
1594
+ <T>(name: string, options: StepOptions, fn: () => Promise<T>): Promise<T>;
1595
+ }
1596
+ export { StepFn }
1597
+ export { StepFn as StepFn_alias_1 }
1598
+ export { StepFn as StepFn_alias_2 }
1599
+
1600
+ declare type StepOptions = {
1601
+ retry?: number;
1602
+ };
1603
+ export { StepOptions }
1604
+ export { StepOptions as StepOptions_alias_1 }
1605
+ export { StepOptions as StepOptions_alias_2 }
1606
+
1607
+ /**
1608
+ * Security validation patterns to detect suspicious content
1609
+ *
1610
+ * Note: Patterns use case-insensitive flag (/i) but NOT global (/g) to avoid
1611
+ * stateful lastIndex issues when RegExp.test() is called multiple times.
1612
+ */
1613
+ declare const SUSPICIOUS_PATTERNS: readonly [RegExp, RegExp, RegExp];
1614
+ export { SUSPICIOUS_PATTERNS }
1615
+ export { SUSPICIOUS_PATTERNS as SUSPICIOUS_PATTERNS_alias_1 }
1616
+ export { SUSPICIOUS_PATTERNS as SUSPICIOUS_PATTERNS_alias_2 }
1617
+
1618
+ /**
1619
+ * Union type of all possible task events
1620
+ */
1621
+ declare type TaskEvent = TaskEventStartTask | TaskEventStartRequest | TaskEventEndRequest | TaskEventText | TaskEventToolUse | TaskEventToolResult | TaskEventToolError | TaskEventUsageExceeded | TaskEventEndTask;
1622
+ export { TaskEvent }
1623
+ export { TaskEvent as TaskEvent_alias_1 }
1624
+ export { TaskEvent as TaskEvent_alias_2 }
1625
+
1626
+ /**
1627
+ * Base interface for all task events
1628
+ */
1629
+ declare interface TaskEventBase {
1630
+ kind: TaskEventKind;
1631
+ }
1632
+ export { TaskEventBase }
1633
+ export { TaskEventBase as TaskEventBase_alias_1 }
1634
+ export { TaskEventBase as TaskEventBase_alias_2 }
1635
+
1636
+ declare type TaskEventCallback = (event: TaskEvent) => void | Promise<void>;
1637
+ export { TaskEventCallback }
1638
+ export { TaskEventCallback as TaskEventCallback_alias_1 }
1639
+ export { TaskEventCallback as TaskEventCallback_alias_2 }
1640
+
1641
+ /**
1642
+ * Event for request end
1643
+ */
1644
+ declare interface TaskEventEndRequest extends TaskEventBase {
1645
+ kind: TaskEventKind.EndRequest;
1646
+ message: string;
1647
+ }
1648
+ export { TaskEventEndRequest }
1649
+ export { TaskEventEndRequest as TaskEventEndRequest_alias_1 }
1650
+ export { TaskEventEndRequest as TaskEventEndRequest_alias_2 }
1651
+
1652
+ /**
1653
+ * Event for task end
1654
+ */
1655
+ declare interface TaskEventEndTask extends TaskEventBase {
1656
+ kind: TaskEventKind.EndTask;
1657
+ exitReason: ExitReason;
1658
+ }
1659
+ export { TaskEventEndTask }
1660
+ export { TaskEventEndTask as TaskEventEndTask_alias_1 }
1661
+ export { TaskEventEndTask as TaskEventEndTask_alias_2 }
1662
+
1663
+ /**
1664
+ * Enum representing different kinds of task events
1665
+ */
1666
+ declare enum TaskEventKind {
1667
+ StartTask = "StartTask",
1668
+ StartRequest = "StartRequest",
1669
+ EndRequest = "EndRequest",
1670
+ Text = "Text",
1671
+ Reasoning = "Reasoning",
1672
+ ToolUse = "ToolUse",
1673
+ ToolReply = "ToolReply",
1674
+ ToolError = "ToolError",
1675
+ UsageExceeded = "UsageExceeded",
1676
+ EndTask = "EndTask"
1677
+ }
1678
+ export { TaskEventKind }
1679
+ export { TaskEventKind as TaskEventKind_alias_1 }
1680
+ export { TaskEventKind as TaskEventKind_alias_2 }
1681
+
1682
+ /**
1683
+ * Event for request start
1684
+ */
1685
+ declare interface TaskEventStartRequest extends TaskEventBase {
1686
+ kind: TaskEventKind.StartRequest;
1687
+ userMessage: readonly JsonModelMessage[];
1688
+ }
1689
+ export { TaskEventStartRequest }
1690
+ export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
1691
+ export { TaskEventStartRequest as TaskEventStartRequest_alias_2 }
1692
+
1693
+ /**
1694
+ * Event for task start
1695
+ */
1696
+ declare interface TaskEventStartTask extends TaskEventBase {
1697
+ kind: TaskEventKind.StartTask;
1698
+ systemPrompt: string;
1699
+ }
1700
+ export { TaskEventStartTask }
1701
+ export { TaskEventStartTask as TaskEventStartTask_alias_1 }
1702
+ export { TaskEventStartTask as TaskEventStartTask_alias_2 }
1703
+
1704
+ /**
1705
+ * Event for text/reasoning updates
1706
+ */
1707
+ declare interface TaskEventText extends TaskEventBase {
1708
+ kind: TaskEventKind.Text | TaskEventKind.Reasoning;
1709
+ newText: string;
1710
+ }
1711
+ export { TaskEventText }
1712
+ export { TaskEventText as TaskEventText_alias_1 }
1713
+ export { TaskEventText as TaskEventText_alias_2 }
1714
+
1715
+ declare interface TaskEventToolError extends TaskEventBase {
1716
+ kind: TaskEventKind.ToolError;
1717
+ tool: string;
1718
+ error: ToolResponseResult;
1719
+ }
1720
+ export { TaskEventToolError }
1721
+ export { TaskEventToolError as TaskEventToolError_alias_1 }
1722
+ export { TaskEventToolError as TaskEventToolError_alias_2 }
1723
+
1724
+ declare interface TaskEventToolResult extends TaskEventBase {
1725
+ kind: TaskEventKind.ToolReply;
1726
+ tool: string;
1727
+ content: ToolResponseResult;
1728
+ }
1729
+ export { TaskEventToolResult }
1730
+ export { TaskEventToolResult as TaskEventToolResult_alias_1 }
1731
+ export { TaskEventToolResult as TaskEventToolResult_alias_2 }
1732
+
1733
+ /**
1734
+ * Event for tool-related updates
1735
+ */
1736
+ declare interface TaskEventToolUse extends TaskEventBase {
1737
+ kind: TaskEventKind.ToolUse;
1738
+ tool: string;
1739
+ params: Record<string, any>;
1740
+ }
1741
+ export { TaskEventToolUse }
1742
+ export { TaskEventToolUse as TaskEventToolUse_alias_1 }
1743
+ export { TaskEventToolUse as TaskEventToolUse_alias_2 }
1744
+
1745
+ /**
1746
+ * Event for task usage exceeded
1747
+ */
1748
+ declare interface TaskEventUsageExceeded extends TaskEventBase {
1749
+ kind: TaskEventKind.UsageExceeded;
1750
+ }
1751
+ export { TaskEventUsageExceeded }
1752
+ export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
1753
+ export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
1754
+
1755
+ declare type TodoItem = z.infer<typeof TodoItemSchema>;
1756
+ export { TodoItem }
1757
+ export { TodoItem as TodoItem_alias_1 }
1758
+ export { TodoItem as TodoItem_alias_2 }
1759
+
1760
+ declare const TodoItemSchema: z.ZodObject<{
1761
+ id: z.ZodString;
1762
+ title: z.ZodString;
1763
+ description: z.ZodString;
1764
+ status: z.ZodEnum<{
1765
+ open: "open";
1766
+ completed: "completed";
1767
+ closed: "closed";
1768
+ }>;
1769
+ }, z.core.$strip>;
1770
+ export { TodoItemSchema }
1771
+ export { TodoItemSchema as TodoItemSchema_alias_1 }
1772
+ export { TodoItemSchema as TodoItemSchema_alias_2 }
1773
+
1774
+ declare type TodoProvider = {
1775
+ listTodoItems: (id?: string | null, status?: string | null) => Promise<ListTodoItemsOutput>;
1776
+ getTodoItem: (id: string) => Promise<GetTodoItemOutput | undefined>;
1777
+ updateTodoItem: (input: UpdateTodoItemInput) => Promise<UpdateTodoItemOutput>;
1778
+ };
1779
+ export { TodoProvider }
1780
+ export { TodoProvider as TodoProvider_alias_1 }
1781
+ export { TodoProvider as TodoProvider_alias_2 }
1782
+
1783
+ declare const TodoStatus: z.ZodEnum<{
1784
+ open: "open";
1785
+ completed: "completed";
1786
+ closed: "closed";
1787
+ }>;
1788
+ export { TodoStatus }
1789
+ export { TodoStatus as TodoStatus_alias_1 }
1790
+ export { TodoStatus as TodoStatus_alias_2 }
1791
+
1792
+ declare const toJsonModelMessage: (msg: ModelMessage) => JsonModelMessage;
1793
+ export { toJsonModelMessage }
1794
+ export { toJsonModelMessage as toJsonModelMessage_alias_1 }
1795
+ export { toJsonModelMessage as toJsonModelMessage_alias_2 }
1796
+
1797
+ /**
1798
+ * Tool groups that can be used in step.tools arrays.
1799
+ * - "readonly": File reading operations only
1800
+ * - "readwrite": Full file system access
1801
+ * - "internet": Network operations (fetch, search)
1802
+ * - "all": All available tools (special keyword, not in this map)
1803
+ */
1804
+ declare const TOOL_GROUPS: Record<string, string[]>;
1805
+ export { TOOL_GROUPS }
1806
+ export { TOOL_GROUPS as TOOL_GROUPS_alias_1 }
1807
+ export { TOOL_GROUPS as TOOL_GROUPS_alias_2 }
1808
+
1809
+ declare type ToolHandler<_T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1810
+ export { ToolHandler }
1811
+ export { ToolHandler as ToolHandler_alias_1 }
1812
+
1813
+ declare type ToolInfo = {
1814
+ name: string;
1815
+ description: string;
1816
+ parameters: z.ZodObject<any>;
1817
+ };
1818
+ export { ToolInfo }
1819
+ export { ToolInfo as ToolInfo_alias_1 }
1820
+
1821
+ export declare const toolInfo: {
1822
+ readonly name: "askFollowupQuestion";
1823
+ readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
1824
+ readonly parameters: z.ZodObject<{
1825
+ questions: z.ZodArray<z.ZodObject<{
1826
+ prompt: z.ZodString;
1827
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
1828
+ }, z.core.$strip>>;
1829
+ }, z.core.$strip>;
1830
+ };
1831
+
1832
+ export declare const toolInfo_alias_1: {
1833
+ readonly name: "executeCommand";
1834
+ readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
1835
+ readonly parameters: z.ZodObject<{
1836
+ command: z.ZodString;
1837
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1838
+ }, z.core.$strip>;
1839
+ };
1840
+
1841
+ export declare const toolInfo_alias_10: {
1842
+ readonly name: "searchFiles";
1843
+ readonly description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
1844
+ readonly parameters: z.ZodObject<{
1845
+ path: z.ZodString;
1846
+ regex: z.ZodString;
1847
+ filePattern: z.ZodOptional<z.ZodString>;
1848
+ }, z.core.$strip>;
1849
+ };
1850
+
1851
+ export declare const toolInfo_alias_11: {
1852
+ readonly name: "writeToFile";
1853
+ readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
1854
+ readonly parameters: z.ZodObject<{
1855
+ path: z.ZodString;
1856
+ content: z.ZodString;
1857
+ }, z.core.$strip>;
1858
+ };
1859
+
1860
+ export declare const toolInfo_alias_2: {
1861
+ readonly name: "fetchUrl";
1862
+ readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
1863
+ readonly parameters: z.ZodObject<{
1864
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
1865
+ }, z.core.$strip>;
1866
+ };
1867
+
1868
+ export declare const toolInfo_alias_3: {
1869
+ readonly name: "listFiles";
1870
+ readonly description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
1871
+ readonly parameters: z.ZodObject<{
1872
+ path: z.ZodString;
1873
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
1874
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1875
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1876
+ }, z.core.$strip>;
1877
+ };
1878
+
1879
+ export declare const toolInfo_alias_4: {
1880
+ readonly name: "readBinaryFile";
1881
+ readonly description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
1882
+ readonly parameters: z.ZodObject<{
1883
+ url: z.ZodString;
1884
+ }, z.core.$strip>;
1885
+ };
1886
+
1887
+ export declare const toolInfo_alias_5: {
1888
+ readonly name: "readFile";
1889
+ readonly description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
1890
+ readonly parameters: z.ZodObject<{
1891
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
1892
+ includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>>;
1893
+ }, z.core.$strip>;
1894
+ };
1895
+
1896
+ export declare const toolInfo_alias_6: {
1897
+ readonly name: "removeFile";
1898
+ readonly description: "Request to remove a file at the specified path.";
1899
+ readonly parameters: z.ZodObject<{
1900
+ path: z.ZodString;
1901
+ }, z.core.$strip>;
1902
+ };
1903
+
1904
+ export declare const toolInfo_alias_7: {
1905
+ readonly name: "renameFile";
1906
+ readonly description: "Request to rename a file from source path to target path.";
1907
+ readonly parameters: z.ZodObject<{
1908
+ source_path: z.ZodString;
1909
+ target_path: z.ZodString;
1910
+ }, z.core.$strip>;
1911
+ };
1912
+
1913
+ export declare const toolInfo_alias_8: {
1914
+ readonly name: "replaceInFile";
1915
+ readonly description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
1916
+ readonly parameters: z.ZodObject<{
1917
+ path: z.ZodString;
1918
+ diff: z.ZodString;
1919
+ }, z.core.$strip>;
1920
+ };
1921
+
1922
+ export declare const toolInfo_alias_9: {
1923
+ readonly name: "search";
1924
+ readonly description: "Search the web for information using Google Search. Use this tool to find current information, facts, news, documentation, or research that is not available in your training data. Returns comprehensive search results with relevant content extracted from the web.";
1925
+ readonly parameters: z.ZodObject<{
1926
+ query: z.ZodString;
1927
+ }, z.core.$strip>;
1928
+ };
1929
+
1930
+ declare type ToolParameter = {
1931
+ name: string;
1932
+ description: string;
1933
+ required: boolean;
1934
+ usageValue?: string;
1935
+ allowMultiple?: boolean;
1936
+ children?: ToolParameter[];
1937
+ };
1938
+ export { ToolParameter }
1939
+ export { ToolParameter as ToolParameter_alias_1 }
1940
+
1941
+ declare type ToolParameterValue = string | {
1942
+ [key: string]: ToolParameterValue;
1943
+ } | ToolParameterValue[];
1944
+ export { ToolParameterValue }
1945
+ export { ToolParameterValue as ToolParameterValue_alias_1 }
1946
+
1947
+ declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider & Partial<MemoryProvider> & Partial<TodoProvider>;
1948
+ export { ToolProvider }
1949
+ export { ToolProvider as ToolProvider_alias_1 }
1950
+ export { ToolProvider as ToolProvider_alias_2 }
1951
+
1952
+ declare type ToolRegistry = Record<string, ToolSignature<any, any>>;
1953
+ export { ToolRegistry }
1954
+ export { ToolRegistry as ToolRegistry_alias_1 }
1955
+ export { ToolRegistry as ToolRegistry_alias_2 }
1956
+
1957
+ declare type ToolResponse = {
1958
+ success: boolean;
1959
+ message: ToolResponseResult;
1960
+ };
1961
+ export { ToolResponse }
1962
+ export { ToolResponse as ToolResponse_alias_1 }
1963
+
1964
+ declare type ToolResponseResult = {
1965
+ type: 'text';
1966
+ value: string;
1967
+ } | {
1968
+ type: 'json';
1969
+ value: JSONValue;
1970
+ } | {
1971
+ type: 'error-text';
1972
+ value: string;
1973
+ } | {
1974
+ type: 'error-json';
1975
+ value: JSONValue;
1976
+ } | {
1977
+ type: 'content';
1978
+ value: Array<{
1979
+ type: 'text';
1980
+ text: string;
1981
+ } | ToolResponseResultMedia>;
1982
+ };
1983
+ export { ToolResponseResult }
1984
+ export { ToolResponseResult as ToolResponseResult_alias_1 }
1985
+
1986
+ declare type ToolResponseResultMedia = {
1987
+ type: 'media';
1988
+ data: string;
1989
+ mediaType: string;
1990
+ url: string;
1991
+ };
1992
+ export { ToolResponseResultMedia }
1993
+ export { ToolResponseResultMedia as ToolResponseResultMedia_alias_1 }
1994
+
1995
+ declare type ToolSignature<I, O> = {
1996
+ input: I;
1997
+ output: O;
1998
+ };
1999
+ export { ToolSignature }
2000
+ export { ToolSignature as ToolSignature_alias_1 }
2001
+ export { ToolSignature as ToolSignature_alias_2 }
2002
+
2003
+ declare type Totals = {
2004
+ input: number;
2005
+ output: number;
2006
+ cachedRead: number;
2007
+ cost: number;
2008
+ messageCount: number;
2009
+ };
2010
+
2011
+ declare type TryCatchStep = z.infer<typeof TryCatchStepSchema>;
2012
+ export { TryCatchStep }
2013
+ export { TryCatchStep as TryCatchStep_alias_1 }
2014
+ export { TryCatchStep as TryCatchStep_alias_2 }
2015
+
2016
+ /**
2017
+ * Try/catch block - error handling
2018
+ */
2019
+ declare const TryCatchStepSchema: z.ZodObject<{
2020
+ id: z.ZodString;
2021
+ try: z.ZodObject<{
2022
+ trySteps: z.ZodArray<z.ZodLazy<any>>;
2023
+ catchSteps: z.ZodArray<z.ZodLazy<any>>;
2024
+ }, z.core.$strip>;
2025
+ output: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2026
+ }, z.core.$strip>;
2027
+ export { TryCatchStepSchema }
2028
+ export { TryCatchStepSchema as TryCatchStepSchema_alias_1 }
2029
+ export { TryCatchStepSchema as TryCatchStepSchema_alias_2 }
2030
+
2031
+ declare type UpdateTodoItemInput = z.infer<typeof UpdateTodoItemInputSchema>;
2032
+ export { UpdateTodoItemInput }
2033
+ export { UpdateTodoItemInput as UpdateTodoItemInput_alias_1 }
2034
+ export { UpdateTodoItemInput as UpdateTodoItemInput_alias_2 }
2035
+
2036
+ declare const UpdateTodoItemInputSchema: z.ZodObject<{
2037
+ operation: z.ZodEnum<{
2038
+ add: "add";
2039
+ update: "update";
2040
+ }>;
2041
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2042
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2043
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2044
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2045
+ status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
2046
+ open: "open";
2047
+ completed: "completed";
2048
+ closed: "closed";
2049
+ }>>>;
2050
+ }, z.core.$strip>;
2051
+ export { UpdateTodoItemInputSchema }
2052
+ export { UpdateTodoItemInputSchema as UpdateTodoItemInputSchema_alias_1 }
2053
+ export { UpdateTodoItemInputSchema as UpdateTodoItemInputSchema_alias_2 }
2054
+
2055
+ declare type UpdateTodoItemOutput = z.infer<typeof UpdateTodoItemOutputSchema>;
2056
+ export { UpdateTodoItemOutput }
2057
+ export { UpdateTodoItemOutput as UpdateTodoItemOutput_alias_1 }
2058
+ export { UpdateTodoItemOutput as UpdateTodoItemOutput_alias_2 }
2059
+
2060
+ declare const UpdateTodoItemOutputSchema: z.ZodObject<{
2061
+ id: z.ZodString;
2062
+ }, z.core.$strip>;
2063
+ export { UpdateTodoItemOutputSchema }
2064
+ export { UpdateTodoItemOutputSchema as UpdateTodoItemOutputSchema_alias_1 }
2065
+ export { UpdateTodoItemOutputSchema as UpdateTodoItemOutputSchema_alias_2 }
2066
+
2067
+ /**
2068
+ * Tracks token / cost usage across any mix of LLM models.
2069
+ * Supports optional caps on total messages and total cost.
2070
+ */
2071
+ declare class UsageMeter {
2072
+ #private;
2073
+ constructor(modelInfos?: Record<string, Record<string, Partial<ModelInfo>>>, opts?: {
2074
+ maxMessages?: number;
2075
+ maxCost?: number;
2076
+ });
2077
+ addUsage(llm: LanguageModelV2, resp: {
2078
+ usage: LanguageModelV2Usage;
2079
+ providerMetadata?: any;
2080
+ } | {
2081
+ totalUsage: LanguageModelV2Usage;
2082
+ providerMetadata?: any;
2083
+ }, options?: {
2084
+ modelInfo?: ModelInfo;
2085
+ }): void;
2086
+ /** Override the running totals (e.g., restore from saved state). */
2087
+ setUsage(newUsage: Partial<Totals>): void;
2088
+ /** Manually bump the message count (useful if you record some messages without token info). */
2089
+ incrementMessageCount(n?: number): void;
2090
+ /** Reset the running totals. */
2091
+ resetUsage(): void;
2092
+ /** Return true once either messages or cost exceed the configured caps. */
2093
+ isLimitExceeded(): {
2094
+ messageCount: boolean;
2095
+ maxMessages: number;
2096
+ cost: boolean;
2097
+ maxCost: number;
2098
+ result: boolean;
2099
+ };
2100
+ /** Same as isLimitExceeded but throws an error if a limit is hit. */
2101
+ checkLimit(): void;
2102
+ /** Getter for the aggregated totals (immutable copy). */
2103
+ get usage(): {
2104
+ input: number;
2105
+ output: number;
2106
+ cachedRead: number;
2107
+ cost: number;
2108
+ messageCount: number;
2109
+ };
2110
+ /** Merge another UsageMeter's totals into this one. */
2111
+ merge(other: UsageMeter): void;
2112
+ getUsageText(): string;
2113
+ onFinishHandler(llm: LanguageModelV2): (evt: {
2114
+ totalUsage: LanguageModelV2Usage;
2115
+ providerMetadata: any;
2116
+ }) => void;
2117
+ }
2118
+ export { UsageMeter }
2119
+ export { UsageMeter as UsageMeter_alias_1 }
2120
+
2121
+ /**
2122
+ * Validate a skill's metadata
2123
+ * Note: Zod already validates name format, max length, and description max length
2124
+ * This function only validates requirements not covered by Zod
2125
+ */
2126
+ declare function validateSkillMetadata(skill: Skill): string[];
2127
+ export { validateSkillMetadata }
2128
+ export { validateSkillMetadata as validateSkillMetadata_alias_1 }
2129
+ export { validateSkillMetadata as validateSkillMetadata_alias_2 }
2130
+
2131
+ /**
2132
+ * Validate file references in skill content
2133
+ *
2134
+ * Warns about external references and absolute paths
2135
+ */
2136
+ declare function validateSkillReferences(skill: Skill): string[];
2137
+ export { validateSkillReferences }
2138
+ export { validateSkillReferences as validateSkillReferences_alias_1 }
2139
+ export { validateSkillReferences as validateSkillReferences_alias_2 }
2140
+
2141
+ /**
2142
+ * Validate a skill's security constraints
2143
+ *
2144
+ * @throws {SkillValidationError} if validation fails
2145
+ */
2146
+ declare function validateSkillSecurity(skill: Skill): void;
2147
+ export { validateSkillSecurity }
2148
+ export { validateSkillSecurity as validateSkillSecurity_alias_1 }
2149
+ export { validateSkillSecurity as validateSkillSecurity_alias_2 }
2150
+
2151
+ /**
2152
+ * Validate a workflow file for common issues
2153
+ */
2154
+ declare function validateWorkflowFile(definition: WorkflowFile): ValidationResult;
2155
+ export { validateWorkflowFile }
2156
+ export { validateWorkflowFile as validateWorkflowFile_alias_1 }
2157
+ export { validateWorkflowFile as validateWorkflowFile_alias_2 }
2158
+
2159
+ declare type ValidationResult = {
2160
+ success: true;
2161
+ } | {
2162
+ success: false;
2163
+ errors: string[];
2164
+ };
2165
+ export { ValidationResult }
2166
+ export { ValidationResult as ValidationResult_alias_1 }
2167
+ export { ValidationResult as ValidationResult_alias_2 }
2168
+
2169
+ declare type WebProvider = {
2170
+ fetchUrl?: (url: string) => Promise<string>;
2171
+ search?: (query: string) => Promise<string>;
2172
+ };
2173
+ export { WebProvider }
2174
+ export { WebProvider as WebProvider_alias_1 }
2175
+ export { WebProvider as WebProvider_alias_2 }
2176
+
2177
+ declare type WhileLoopStep = z.infer<typeof WhileLoopStepSchema>;
2178
+ export { WhileLoopStep }
2179
+ export { WhileLoopStep as WhileLoopStep_alias_1 }
2180
+ export { WhileLoopStep as WhileLoopStep_alias_2 }
2181
+
2182
+ /**
2183
+ * While loop - repeats steps while condition is true
2184
+ */
2185
+ declare const WhileLoopStepSchema: any;
2186
+ export { WhileLoopStepSchema }
2187
+ export { WhileLoopStepSchema as WhileLoopStepSchema_alias_1 }
2188
+ export { WhileLoopStepSchema as WhileLoopStepSchema_alias_2 }
2189
+
2190
+ declare type WorkflowContext<TTools extends ToolRegistry> = {
2191
+ step: StepFn;
2192
+ logger: Logger;
2193
+ tools: WorkflowTools<TTools>;
2194
+ };
2195
+ export { WorkflowContext }
2196
+ export { WorkflowContext as WorkflowContext_alias_1 }
2197
+ export { WorkflowContext as WorkflowContext_alias_2 }
2198
+
2199
+ declare type WorkflowControlFlowStep = z.infer<typeof WorkflowControlFlowStepSchema>;
2200
+ export { WorkflowControlFlowStep }
2201
+ export { WorkflowControlFlowStep as WorkflowControlFlowStep_alias_1 }
2202
+ export { WorkflowControlFlowStep as WorkflowControlFlowStep_alias_2 }
2203
+
2204
+ /**
2205
+ * Any step that can appear in a workflow's steps array
2206
+ * Can be a basic step, control flow, or jump statement
2207
+ */
2208
+ declare const WorkflowControlFlowStepSchema: any;
2209
+ export { WorkflowControlFlowStepSchema }
2210
+ export { WorkflowControlFlowStepSchema as WorkflowControlFlowStepSchema_alias_1 }
2211
+ export { WorkflowControlFlowStepSchema as WorkflowControlFlowStepSchema_alias_2 }
2212
+
2213
+ declare type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
2214
+ export { WorkflowDefinition }
2215
+ export { WorkflowDefinition as WorkflowDefinition_alias_1 }
2216
+ export { WorkflowDefinition as WorkflowDefinition_alias_2 }
2217
+
2218
+ /**
2219
+ * Workflow definition - now supports control flow in steps
2220
+ */
2221
+ declare const WorkflowDefinitionSchema: z.ZodObject<{
2222
+ task: z.ZodString;
2223
+ inputs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
2224
+ id: z.ZodString;
2225
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2226
+ default: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
2227
+ }, z.core.$strip>>>>;
2228
+ steps: z.ZodArray<any>;
2229
+ output: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2230
+ }, z.core.$strip>;
2231
+ export { WorkflowDefinitionSchema }
2232
+ export { WorkflowDefinitionSchema as WorkflowDefinitionSchema_alias_1 }
2233
+ export { WorkflowDefinitionSchema as WorkflowDefinitionSchema_alias_2 }
2234
+
2235
+ declare type WorkflowFile = z.infer<typeof WorkflowFileSchema>;
2236
+ export { WorkflowFile }
2237
+ export { WorkflowFile as WorkflowFile_alias_1 }
2238
+ export { WorkflowFile as WorkflowFile_alias_2 }
2239
+
2240
+ declare const WorkflowFileSchema: z.ZodObject<{
2241
+ workflows: z.ZodRecord<z.ZodString, z.ZodObject<{
2242
+ task: z.ZodString;
2243
+ inputs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
2244
+ id: z.ZodString;
2245
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2246
+ default: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
2247
+ }, z.core.$strip>>>>;
2248
+ steps: z.ZodArray<any>;
2249
+ output: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2250
+ }, z.core.$strip>>;
2251
+ }, z.core.$strip>;
2252
+ export { WorkflowFileSchema }
2253
+ export { WorkflowFileSchema as WorkflowFileSchema_alias_1 }
2254
+ export { WorkflowFileSchema as WorkflowFileSchema_alias_2 }
2255
+
2256
+ declare type WorkflowFn<TInput, TOutput, TTools extends ToolRegistry> = (input: TInput, context: WorkflowContext<TTools>) => Promise<TOutput>;
2257
+ export { WorkflowFn }
2258
+ export { WorkflowFn as WorkflowFn_alias_1 }
2259
+ export { WorkflowFn as WorkflowFn_alias_2 }
2260
+
2261
+ declare type WorkflowInputDefinition = z.infer<typeof WorkflowInputDefinitionSchema>;
2262
+ export { WorkflowInputDefinition }
2263
+ export { WorkflowInputDefinition as WorkflowInputDefinition_alias_1 }
2264
+ export { WorkflowInputDefinition as WorkflowInputDefinition_alias_2 }
2265
+
2266
+ declare const WorkflowInputDefinitionSchema: z.ZodObject<{
2267
+ id: z.ZodString;
2268
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2269
+ default: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
2270
+ }, z.core.$strip>;
2271
+ export { WorkflowInputDefinitionSchema }
2272
+ export { WorkflowInputDefinitionSchema as WorkflowInputDefinitionSchema_alias_1 }
2273
+ export { WorkflowInputDefinitionSchema as WorkflowInputDefinitionSchema_alias_2 }
2274
+
2275
+ declare type WorkflowStepDefinition = z.infer<typeof WorkflowStepDefinitionSchema>;
2276
+ export { WorkflowStepDefinition }
2277
+ export { WorkflowStepDefinition as WorkflowStepDefinition_alias_1 }
2278
+ export { WorkflowStepDefinition as WorkflowStepDefinition_alias_2 }
2279
+
2280
+ /**
2281
+ * Basic workflow step - executes a task
2282
+ */
2283
+ declare const WorkflowStepDefinitionSchema: z.ZodObject<{
2284
+ id: z.ZodString;
2285
+ tools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
2286
+ task: z.ZodString;
2287
+ output: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2288
+ expected_outcome: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2289
+ outputSchema: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
2290
+ timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2291
+ }, z.core.$strip>;
2292
+ export { WorkflowStepDefinitionSchema }
2293
+ export { WorkflowStepDefinitionSchema as WorkflowStepDefinitionSchema_alias_1 }
2294
+ export { WorkflowStepDefinitionSchema as WorkflowStepDefinitionSchema_alias_2 }
2295
+
2296
+ declare type WorkflowTools<TTools extends ToolRegistry> = {
2297
+ [K in keyof TTools]: (input: TTools[K]['input']) => Promise<TTools[K]['output']>;
2298
+ };
2299
+ export { WorkflowTools }
2300
+ export { WorkflowTools as WorkflowTools_alias_1 }
2301
+ export { WorkflowTools as WorkflowTools_alias_2 }
2302
+
2303
+ export { }