@polka-codes/core 0.9.46 → 0.9.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.ts +202 -1020
- package/dist/index.d.ts +4 -66
- package/dist/index.js +449 -2376
- package/package.json +1 -5
|
@@ -1,238 +1,12 @@
|
|
|
1
1
|
import type { FilePart } from 'ai';
|
|
2
2
|
import type { ImagePart } from 'ai';
|
|
3
3
|
import type { JSONValue } from '@ai-sdk/provider';
|
|
4
|
-
import { LanguageModelUsage } from 'ai';
|
|
5
4
|
import type { LanguageModelV2 } from '@ai-sdk/provider';
|
|
6
5
|
import type { LanguageModelV2ToolResultOutput } from '@ai-sdk/provider';
|
|
7
6
|
import type { LanguageModelV2Usage } from '@ai-sdk/provider';
|
|
8
|
-
import type { ModelMessage } from '@ai-sdk/provider-utils';
|
|
9
|
-
import type { ModelMessage as ModelMessage_2 } from 'ai';
|
|
10
7
|
import type { TextPart } from 'ai';
|
|
11
|
-
import type { ToolModelMessage } from '@ai-sdk/provider-utils';
|
|
12
|
-
import type { UserContent } from '@ai-sdk/provider-utils';
|
|
13
|
-
import type { UserContent as UserContent_2 } from 'ai';
|
|
14
|
-
import type { UserModelMessage } from '@ai-sdk/provider-utils';
|
|
15
8
|
import { z } from 'zod';
|
|
16
9
|
|
|
17
|
-
declare abstract class AgentBase {
|
|
18
|
-
#private;
|
|
19
|
-
readonly ai: LanguageModelV2;
|
|
20
|
-
protected readonly config: Readonly<AgentBaseConfig>;
|
|
21
|
-
protected readonly handlers: Record<string, FullToolInfoV2>;
|
|
22
|
-
constructor(name: string, ai: LanguageModelV2, config: AgentBaseConfig);
|
|
23
|
-
abort(): void;
|
|
24
|
-
get parameters(): Readonly<Record<string, any>>;
|
|
25
|
-
get messages(): Readonly<ModelMessage[]>;
|
|
26
|
-
setMessages(messages: Readonly<ModelMessage[]>): void;
|
|
27
|
-
start(prompt: UserContent): Promise<ExitReason>;
|
|
28
|
-
step(message: (UserModelMessage | ToolModelMessage)[]): Promise<AssistantMessageContent[]>;
|
|
29
|
-
handleStepResponse(response: AssistantMessageContent[]): Promise<{
|
|
30
|
-
type: "reply";
|
|
31
|
-
message: (UserModelMessage | ToolModelMessage)[];
|
|
32
|
-
} | {
|
|
33
|
-
type: "exit";
|
|
34
|
-
reason: ExitReason;
|
|
35
|
-
}>;
|
|
36
|
-
continueTask(userMessage: UserContent): Promise<ExitReason>;
|
|
37
|
-
protected abstract onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
38
|
-
get model(): string;
|
|
39
|
-
get usage(): {
|
|
40
|
-
input: number;
|
|
41
|
-
output: number;
|
|
42
|
-
cachedRead: number;
|
|
43
|
-
cost: number;
|
|
44
|
-
messageCount: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export { AgentBase }
|
|
48
|
-
export { AgentBase as AgentBase_alias_1 }
|
|
49
|
-
export { AgentBase as AgentBase_alias_2 }
|
|
50
|
-
|
|
51
|
-
declare type AgentBaseConfig = {
|
|
52
|
-
systemPrompt: string;
|
|
53
|
-
tools: FullToolInfoV2[];
|
|
54
|
-
toolNamePrefix: string;
|
|
55
|
-
provider: ToolProvider;
|
|
56
|
-
agents?: Readonly<AgentInfo[]>;
|
|
57
|
-
scripts?: Record<string, string | {
|
|
58
|
-
command: string;
|
|
59
|
-
description: string;
|
|
60
|
-
}>;
|
|
61
|
-
callback?: TaskEventCallback;
|
|
62
|
-
policies: AgentPolicy[];
|
|
63
|
-
retryCount?: number;
|
|
64
|
-
requestTimeoutSeconds?: number;
|
|
65
|
-
toolFormat: ToolFormat;
|
|
66
|
-
parameters: Record<string, any>;
|
|
67
|
-
usageMeter: UsageMeter;
|
|
68
|
-
requireToolUse: boolean;
|
|
69
|
-
};
|
|
70
|
-
export { AgentBaseConfig }
|
|
71
|
-
export { AgentBaseConfig as AgentBaseConfig_alias_1 }
|
|
72
|
-
export { AgentBaseConfig as AgentBaseConfig_alias_2 }
|
|
73
|
-
|
|
74
|
-
declare type AgentInfo = {
|
|
75
|
-
name: string;
|
|
76
|
-
responsibilities: string[];
|
|
77
|
-
};
|
|
78
|
-
export { AgentInfo }
|
|
79
|
-
export { AgentInfo as AgentInfo_alias_1 }
|
|
80
|
-
export { AgentInfo as AgentInfo_alias_2 }
|
|
81
|
-
|
|
82
|
-
declare type AgentNameType = (typeof allAgents)[number]['name'];
|
|
83
|
-
export { AgentNameType }
|
|
84
|
-
export { AgentNameType as AgentNameType_alias_1 }
|
|
85
|
-
|
|
86
|
-
declare type AgentPolicy = (tools: Record<string, FullToolInfoV2>, parameters: Record<string, any>) => AgentPolicyInstance | undefined;
|
|
87
|
-
export { AgentPolicy }
|
|
88
|
-
export { AgentPolicy as AgentPolicy_alias_1 }
|
|
89
|
-
export { AgentPolicy as AgentPolicy_alias_2 }
|
|
90
|
-
|
|
91
|
-
declare type AgentPolicyInstance = {
|
|
92
|
-
name: string;
|
|
93
|
-
tools?: FullToolInfoV2[];
|
|
94
|
-
prompt?: string;
|
|
95
|
-
onBeforeInvokeTool?: (name: string, args: Record<string, string>) => Promise<ToolResponse | undefined>;
|
|
96
|
-
onBeforeRequest?: (agent: AgentBase) => Promise<void>;
|
|
97
|
-
prepareMessages?: (agent: AgentBase, messages: ModelMessage_2[]) => Promise<ModelMessage_2[]>;
|
|
98
|
-
};
|
|
99
|
-
export { AgentPolicyInstance }
|
|
100
|
-
export { AgentPolicyInstance as AgentPolicyInstance_alias_1 }
|
|
101
|
-
export { AgentPolicyInstance as AgentPolicyInstance_alias_2 }
|
|
102
|
-
|
|
103
|
-
declare const agentsPrompt: (agents: Readonly<AgentInfo[]>, name: string) => string;
|
|
104
|
-
export { agentsPrompt }
|
|
105
|
-
export { agentsPrompt as agentsPrompt_alias_1 }
|
|
106
|
-
export { agentsPrompt as agentsPrompt_alias_2 }
|
|
107
|
-
|
|
108
|
-
declare const allAgents: readonly [{
|
|
109
|
-
readonly name: "architect";
|
|
110
|
-
readonly responsibilities: ["Analyzing the user’s overall task and requirements.", "Creating plans and making higher-level decisions about system structure and design.", "Reviewing and analyzing existing code or components for maintainability and scalability.", "Laying out the roadmap for implementation."];
|
|
111
|
-
}, {
|
|
112
|
-
readonly name: "coder";
|
|
113
|
-
readonly responsibilities: ["Editing and refactoring existing code.", "Creating new features or modules.", "Running tests and analyzing test results.", "Maintaining coding standards, lint rules, and general code quality."];
|
|
114
|
-
}, {
|
|
115
|
-
readonly name: "analyzer";
|
|
116
|
-
readonly responsibilities: ["Analyzing project structure and organization", "Identifying key source code files and their relationships", "Understanding common coding patterns and conventions", "Examining development workflow and tooling", "Analyzing dependencies and their usage patterns"];
|
|
117
|
-
}, {
|
|
118
|
-
readonly name: "codefixer";
|
|
119
|
-
readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
|
|
120
|
-
}];
|
|
121
|
-
export { allAgents }
|
|
122
|
-
export { allAgents as allAgents_alias_1 }
|
|
123
|
-
|
|
124
|
-
declare class AnalyzerAgent extends AgentBase {
|
|
125
|
-
constructor(options: AnalyzerAgentOptions);
|
|
126
|
-
onBeforeInvokeTool(): Promise<undefined>;
|
|
127
|
-
}
|
|
128
|
-
export { AnalyzerAgent }
|
|
129
|
-
export { AnalyzerAgent as AnalyzerAgent_alias_1 }
|
|
130
|
-
export { AnalyzerAgent as AnalyzerAgent_alias_2 }
|
|
131
|
-
|
|
132
|
-
declare const analyzerAgentInfo: {
|
|
133
|
-
readonly name: "analyzer";
|
|
134
|
-
readonly responsibilities: ["Analyzing project structure and organization", "Identifying key source code files and their relationships", "Understanding common coding patterns and conventions", "Examining development workflow and tooling", "Analyzing dependencies and their usage patterns"];
|
|
135
|
-
};
|
|
136
|
-
export { analyzerAgentInfo }
|
|
137
|
-
export { analyzerAgentInfo as analyzerAgentInfo_alias_1 }
|
|
138
|
-
export { analyzerAgentInfo as analyzerAgentInfo_alias_2 }
|
|
139
|
-
|
|
140
|
-
declare type AnalyzerAgentOptions = SharedAgentOptions;
|
|
141
|
-
export { AnalyzerAgentOptions }
|
|
142
|
-
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_1 }
|
|
143
|
-
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_2 }
|
|
144
|
-
|
|
145
|
-
declare class ArchitectAgent extends AgentBase {
|
|
146
|
-
constructor(options: ArchitectAgentOptions);
|
|
147
|
-
onBeforeInvokeTool(): Promise<undefined>;
|
|
148
|
-
}
|
|
149
|
-
export { ArchitectAgent }
|
|
150
|
-
export { ArchitectAgent as ArchitectAgent_alias_1 }
|
|
151
|
-
export { ArchitectAgent as ArchitectAgent_alias_2 }
|
|
152
|
-
|
|
153
|
-
declare const architectAgentInfo: {
|
|
154
|
-
readonly name: "architect";
|
|
155
|
-
readonly responsibilities: ["Analyzing the user’s overall task and requirements.", "Creating plans and making higher-level decisions about system structure and design.", "Reviewing and analyzing existing code or components for maintainability and scalability.", "Laying out the roadmap for implementation."];
|
|
156
|
-
};
|
|
157
|
-
export { architectAgentInfo }
|
|
158
|
-
export { architectAgentInfo as architectAgentInfo_alias_1 }
|
|
159
|
-
export { architectAgentInfo as architectAgentInfo_alias_2 }
|
|
160
|
-
|
|
161
|
-
declare type ArchitectAgentOptions = SharedAgentOptions;
|
|
162
|
-
export { ArchitectAgentOptions }
|
|
163
|
-
export { ArchitectAgentOptions as ArchitectAgentOptions_alias_1 }
|
|
164
|
-
export { ArchitectAgentOptions as ArchitectAgentOptions_alias_2 }
|
|
165
|
-
|
|
166
|
-
declare type AssistantMessageContent = TextContent | ToolUse;
|
|
167
|
-
export { AssistantMessageContent }
|
|
168
|
-
export { AssistantMessageContent as AssistantMessageContent_alias_1 }
|
|
169
|
-
export { AssistantMessageContent as AssistantMessageContent_alias_2 }
|
|
170
|
-
|
|
171
|
-
export declare const basePrompt = "You are a highly skilled software engineer specializing in debugging and fixing code issues. You have extensive experience with:\n- Type systems and type checking\n- Test frameworks and debugging test failures\n- Code quality tools and best practices\n- Systematic debugging approaches";
|
|
172
|
-
|
|
173
|
-
export declare const basePrompt_alias_1 = "You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.";
|
|
174
|
-
|
|
175
|
-
declare const capabilities: (_toolNamePrefix: string) => string;
|
|
176
|
-
export { capabilities }
|
|
177
|
-
export { capabilities as capabilities_alias_1 }
|
|
178
|
-
export { capabilities as capabilities_alias_2 }
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* CodeFixer agent for fixing code issues like type errors and failing tests.
|
|
182
|
-
* Using Scripts: format, check, test
|
|
183
|
-
*/
|
|
184
|
-
declare class CodeFixerAgent extends AgentBase {
|
|
185
|
-
#private;
|
|
186
|
-
constructor(options: CodeFixerAgentOptions);
|
|
187
|
-
protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
188
|
-
}
|
|
189
|
-
export { CodeFixerAgent }
|
|
190
|
-
export { CodeFixerAgent as CodeFixerAgent_alias_1 }
|
|
191
|
-
export { CodeFixerAgent as CodeFixerAgent_alias_2 }
|
|
192
|
-
|
|
193
|
-
declare const codeFixerAgentInfo: {
|
|
194
|
-
readonly name: "codefixer";
|
|
195
|
-
readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
|
|
196
|
-
};
|
|
197
|
-
export { codeFixerAgentInfo }
|
|
198
|
-
export { codeFixerAgentInfo as codeFixerAgentInfo_alias_1 }
|
|
199
|
-
export { codeFixerAgentInfo as codeFixerAgentInfo_alias_2 }
|
|
200
|
-
|
|
201
|
-
declare type CodeFixerAgentOptions = SharedAgentOptions & {
|
|
202
|
-
maxRetries?: number;
|
|
203
|
-
};
|
|
204
|
-
export { CodeFixerAgentOptions }
|
|
205
|
-
export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_1 }
|
|
206
|
-
export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_2 }
|
|
207
|
-
|
|
208
|
-
export declare const codeFixingStrategies = "\n====\n\nCODE FIXING STRATEGIES\n\n1. Type Errors\n - Analyze type error messages carefully\n - Check type definitions and imports\n - Consider type assertions only as a last resort\n - Verify type compatibility across function boundaries\n - Look for null/undefined handling issues\n\n2. Test Failures\n - Examine test output and error messages\n - Check test setup and fixtures\n - Verify assertions and expectations\n - Look for async/timing issues\n - Consider edge cases and input validation\n\n3. Code Quality Issues\n - Follow project's coding standards\n - Address linter warnings systematically\n - Improve code readability\n - Fix potential runtime issues\n - Consider performance implications\n\n4. General Approach\n - Start with the most critical issues\n - Make minimal necessary changes\n - Verify fixes don't introduce new issues\n - Document complex fixes with comments\n - Track attempted solutions for each issue";
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Coder agent for writing code.
|
|
212
|
-
* Using Scripts: format, check, test
|
|
213
|
-
*/
|
|
214
|
-
declare class CoderAgent extends AgentBase {
|
|
215
|
-
#private;
|
|
216
|
-
constructor(options: CoderAgentOptions);
|
|
217
|
-
protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
218
|
-
}
|
|
219
|
-
export { CoderAgent }
|
|
220
|
-
export { CoderAgent as CoderAgent_alias_1 }
|
|
221
|
-
export { CoderAgent as CoderAgent_alias_2 }
|
|
222
|
-
|
|
223
|
-
declare const coderAgentInfo: {
|
|
224
|
-
readonly name: "coder";
|
|
225
|
-
readonly responsibilities: ["Editing and refactoring existing code.", "Creating new features or modules.", "Running tests and analyzing test results.", "Maintaining coding standards, lint rules, and general code quality."];
|
|
226
|
-
};
|
|
227
|
-
export { coderAgentInfo }
|
|
228
|
-
export { coderAgentInfo as coderAgentInfo_alias_1 }
|
|
229
|
-
export { coderAgentInfo as coderAgentInfo_alias_2 }
|
|
230
|
-
|
|
231
|
-
declare type CoderAgentOptions = SharedAgentOptions;
|
|
232
|
-
export { CoderAgentOptions }
|
|
233
|
-
export { CoderAgentOptions as CoderAgentOptions_alias_1 }
|
|
234
|
-
export { CoderAgentOptions as CoderAgentOptions_alias_2 }
|
|
235
|
-
|
|
236
10
|
declare type CommandProvider = {
|
|
237
11
|
executeCommand?: (command: string, needApprove: boolean) => Promise<{
|
|
238
12
|
stdout: string;
|
|
@@ -260,7 +34,6 @@ export { Config }
|
|
|
260
34
|
export { Config as Config_alias_1 }
|
|
261
35
|
|
|
262
36
|
declare const configSchema: z.ZodObject<{
|
|
263
|
-
agent: z.ZodOptional<z.ZodString>;
|
|
264
37
|
prices: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
265
38
|
inputPrice: z.ZodOptional<z.ZodNumber>;
|
|
266
39
|
outputPrice: z.ZodOptional<z.ZodNumber>;
|
|
@@ -278,10 +51,6 @@ declare const configSchema: z.ZodObject<{
|
|
|
278
51
|
defaultProvider: z.ZodOptional<z.ZodString>;
|
|
279
52
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
280
53
|
defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
281
|
-
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
282
|
-
native: "native";
|
|
283
|
-
"polka-codes": "polka-codes";
|
|
284
|
-
}>>;
|
|
285
54
|
maxMessageCount: z.ZodOptional<z.ZodNumber>;
|
|
286
55
|
budget: z.ZodOptional<z.ZodNumber>;
|
|
287
56
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -291,63 +60,26 @@ declare const configSchema: z.ZodObject<{
|
|
|
291
60
|
command: z.ZodString;
|
|
292
61
|
description: z.ZodString;
|
|
293
62
|
}, z.core.$strip>]>>>;
|
|
294
|
-
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
295
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
296
|
-
model: z.ZodOptional<z.ZodString>;
|
|
297
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
298
|
-
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
299
|
-
native: "native";
|
|
300
|
-
"polka-codes": "polka-codes";
|
|
301
|
-
}>>;
|
|
302
|
-
initialContext: z.ZodOptional<z.ZodObject<{
|
|
303
|
-
maxFileCount: z.ZodOptional<z.ZodNumber>;
|
|
304
|
-
excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
|
-
}, z.core.$strip>>;
|
|
306
|
-
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
307
|
-
requestTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
308
|
-
}, z.core.$strip>>>;
|
|
309
63
|
commands: z.ZodOptional<z.ZodObject<{
|
|
310
64
|
default: z.ZodOptional<z.ZodObject<{
|
|
311
65
|
provider: z.ZodOptional<z.ZodString>;
|
|
312
66
|
model: z.ZodOptional<z.ZodString>;
|
|
313
67
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
314
|
-
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
315
|
-
native: "native";
|
|
316
|
-
"polka-codes": "polka-codes";
|
|
317
|
-
}>>;
|
|
318
68
|
}, z.core.$strip>>;
|
|
319
69
|
}, z.core.$catchall<z.ZodObject<{
|
|
320
70
|
provider: z.ZodOptional<z.ZodString>;
|
|
321
71
|
model: z.ZodOptional<z.ZodString>;
|
|
322
72
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
323
|
-
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
324
|
-
native: "native";
|
|
325
|
-
"polka-codes": "polka-codes";
|
|
326
|
-
}>>;
|
|
327
73
|
}, z.core.$strip>>>>;
|
|
328
74
|
rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodString]>>;
|
|
329
75
|
excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
330
|
-
policies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
331
76
|
}, z.core.$strict>;
|
|
332
77
|
export { configSchema }
|
|
333
78
|
export { configSchema as configSchema_alias_1 }
|
|
334
79
|
|
|
335
|
-
declare const customInstructions: (customInstructions: string[]) => string;
|
|
336
|
-
export { customInstructions }
|
|
337
|
-
export { customInstructions as customInstructions_alias_1 }
|
|
338
|
-
export { customInstructions as customInstructions_alias_2 }
|
|
339
|
-
|
|
340
|
-
declare const customScripts: (commands: Record<string, string | {
|
|
341
|
-
command: string;
|
|
342
|
-
description: string;
|
|
343
|
-
}>) => string;
|
|
344
|
-
export { customScripts }
|
|
345
|
-
export { customScripts as customScripts_alias_1 }
|
|
346
|
-
export { customScripts as customScripts_alias_2 }
|
|
347
|
-
|
|
348
80
|
declare const _default: {
|
|
349
81
|
handler: ToolHandler<{
|
|
350
|
-
readonly name: "
|
|
82
|
+
readonly name: "askFollowupQuestion";
|
|
351
83
|
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.";
|
|
352
84
|
readonly parameters: z.ZodObject<{
|
|
353
85
|
questions: z.ZodArray<z.ZodObject<{
|
|
@@ -356,8 +88,7 @@ declare const _default: {
|
|
|
356
88
|
}, z.core.$strip>>;
|
|
357
89
|
}, z.core.$strip>;
|
|
358
90
|
}, InteractionProvider>;
|
|
359
|
-
|
|
360
|
-
name: "ask_followup_question";
|
|
91
|
+
name: "askFollowupQuestion";
|
|
361
92
|
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.";
|
|
362
93
|
parameters: z.ZodObject<{
|
|
363
94
|
questions: z.ZodArray<z.ZodObject<{
|
|
@@ -372,68 +103,47 @@ export { _default as default_alias }
|
|
|
372
103
|
|
|
373
104
|
declare const _default_10: {
|
|
374
105
|
handler: ToolHandler<{
|
|
375
|
-
readonly name: "
|
|
376
|
-
readonly description: "Request to remove a file at the specified path.";
|
|
377
|
-
readonly parameters: z.ZodObject<{
|
|
378
|
-
path: z.ZodString;
|
|
379
|
-
}, z.core.$strip>;
|
|
380
|
-
}, FilesystemProvider>;
|
|
381
|
-
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
382
|
-
name: "remove_file";
|
|
383
|
-
description: "Request to remove a file at the specified path.";
|
|
384
|
-
parameters: z.ZodObject<{
|
|
385
|
-
path: z.ZodString;
|
|
386
|
-
}, z.core.$strip>;
|
|
387
|
-
};
|
|
388
|
-
export { _default_10 as default_alias_9 }
|
|
389
|
-
export { _default_10 as removeFile }
|
|
390
|
-
export { _default_10 as removeFile_alias_1 }
|
|
391
|
-
|
|
392
|
-
declare const _default_11: {
|
|
393
|
-
handler: ToolHandler<{
|
|
394
|
-
readonly name: "rename_file";
|
|
106
|
+
readonly name: "renameFile";
|
|
395
107
|
readonly description: "Request to rename a file from source path to target path.";
|
|
396
108
|
readonly parameters: z.ZodObject<{
|
|
397
109
|
source_path: z.ZodString;
|
|
398
110
|
target_path: z.ZodString;
|
|
399
111
|
}, z.core.$strip>;
|
|
400
112
|
}, FilesystemProvider>;
|
|
401
|
-
|
|
402
|
-
name: "rename_file";
|
|
113
|
+
name: "renameFile";
|
|
403
114
|
description: "Request to rename a file from source path to target path.";
|
|
404
115
|
parameters: z.ZodObject<{
|
|
405
116
|
source_path: z.ZodString;
|
|
406
117
|
target_path: z.ZodString;
|
|
407
118
|
}, z.core.$strip>;
|
|
408
119
|
};
|
|
409
|
-
export {
|
|
410
|
-
export {
|
|
411
|
-
export {
|
|
120
|
+
export { _default_10 as default_alias_9 }
|
|
121
|
+
export { _default_10 as renameFile }
|
|
122
|
+
export { _default_10 as renameFile_alias_1 }
|
|
412
123
|
|
|
413
|
-
declare const
|
|
124
|
+
declare const _default_11: {
|
|
414
125
|
handler: ToolHandler<{
|
|
415
|
-
readonly name: "
|
|
126
|
+
readonly name: "replaceInFile";
|
|
416
127
|
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.";
|
|
417
128
|
readonly parameters: z.ZodObject<{
|
|
418
129
|
path: z.ZodString;
|
|
419
130
|
diff: z.ZodString;
|
|
420
131
|
}, z.core.$strip>;
|
|
421
132
|
}, FilesystemProvider>;
|
|
422
|
-
|
|
423
|
-
name: "replace_in_file";
|
|
133
|
+
name: "replaceInFile";
|
|
424
134
|
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.";
|
|
425
135
|
parameters: z.ZodObject<{
|
|
426
136
|
path: z.ZodString;
|
|
427
137
|
diff: z.ZodString;
|
|
428
138
|
}, z.core.$strip>;
|
|
429
139
|
};
|
|
430
|
-
export {
|
|
431
|
-
export {
|
|
432
|
-
export {
|
|
140
|
+
export { _default_11 as default_alias_10 }
|
|
141
|
+
export { _default_11 as replaceInFile }
|
|
142
|
+
export { _default_11 as replaceInFile_alias_1 }
|
|
433
143
|
|
|
434
|
-
declare const
|
|
144
|
+
declare const _default_12: {
|
|
435
145
|
handler: ToolHandler<{
|
|
436
|
-
readonly name: "
|
|
146
|
+
readonly name: "searchFiles";
|
|
437
147
|
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.";
|
|
438
148
|
readonly parameters: z.ZodObject<{
|
|
439
149
|
path: z.ZodString;
|
|
@@ -441,8 +151,7 @@ declare const _default_13: {
|
|
|
441
151
|
filePattern: z.ZodOptional<z.ZodString>;
|
|
442
152
|
}, z.core.$strip>;
|
|
443
153
|
}, FilesystemProvider>;
|
|
444
|
-
|
|
445
|
-
name: "search_files";
|
|
154
|
+
name: "searchFiles";
|
|
446
155
|
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.";
|
|
447
156
|
parameters: z.ZodObject<{
|
|
448
157
|
path: z.ZodString;
|
|
@@ -450,21 +159,50 @@ declare const _default_13: {
|
|
|
450
159
|
filePattern: z.ZodOptional<z.ZodString>;
|
|
451
160
|
}, z.core.$strip>;
|
|
452
161
|
};
|
|
162
|
+
export { _default_12 as default_alias_11 }
|
|
163
|
+
export { _default_12 as searchFiles }
|
|
164
|
+
export { _default_12 as searchFiles_alias_1 }
|
|
165
|
+
|
|
166
|
+
declare const _default_13: {
|
|
167
|
+
handler: ToolHandler<{
|
|
168
|
+
readonly name: "updateMemory";
|
|
169
|
+
readonly description: "Appends, replaces, or removes content from a memory topic.";
|
|
170
|
+
readonly parameters: z.ZodObject<{
|
|
171
|
+
operation: z.ZodEnum<{
|
|
172
|
+
append: "append";
|
|
173
|
+
replace: "replace";
|
|
174
|
+
remove: "remove";
|
|
175
|
+
}>;
|
|
176
|
+
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
content: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
}, MemoryProvider>;
|
|
180
|
+
name: "updateMemory";
|
|
181
|
+
description: "Appends, replaces, or removes content from a memory topic.";
|
|
182
|
+
parameters: z.ZodObject<{
|
|
183
|
+
operation: z.ZodEnum<{
|
|
184
|
+
append: "append";
|
|
185
|
+
replace: "replace";
|
|
186
|
+
remove: "remove";
|
|
187
|
+
}>;
|
|
188
|
+
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
content: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
};
|
|
453
192
|
export { _default_13 as default_alias_12 }
|
|
454
|
-
export { _default_13 as
|
|
455
|
-
export { _default_13 as
|
|
193
|
+
export { _default_13 as updateMemory }
|
|
194
|
+
export { _default_13 as updateMemory_alias_1 }
|
|
456
195
|
|
|
457
196
|
declare const _default_14: {
|
|
458
197
|
handler: ToolHandler<{
|
|
459
|
-
readonly name: "
|
|
198
|
+
readonly name: "writeToFile";
|
|
460
199
|
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 `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
461
200
|
readonly parameters: z.ZodObject<{
|
|
462
201
|
path: z.ZodString;
|
|
463
202
|
content: z.ZodString;
|
|
464
203
|
}, z.core.$strip>;
|
|
465
204
|
}, FilesystemProvider>;
|
|
466
|
-
|
|
467
|
-
name: "write_to_file";
|
|
205
|
+
name: "writeToFile";
|
|
468
206
|
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 `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
469
207
|
parameters: z.ZodObject<{
|
|
470
208
|
path: z.ZodString;
|
|
@@ -477,116 +215,45 @@ export { _default_14 as writeToFile_alias_1 }
|
|
|
477
215
|
|
|
478
216
|
declare const _default_2: {
|
|
479
217
|
handler: ToolHandler<{
|
|
480
|
-
readonly name: "
|
|
481
|
-
readonly description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
|
|
482
|
-
readonly parameters: z.ZodObject<{
|
|
483
|
-
result: z.ZodString;
|
|
484
|
-
}, z.core.$strip>;
|
|
485
|
-
}, InteractionProvider>;
|
|
486
|
-
isAvailable: (_provider: InteractionProvider) => boolean;
|
|
487
|
-
name: "attempt_completion";
|
|
488
|
-
description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
|
|
489
|
-
parameters: z.ZodObject<{
|
|
490
|
-
result: z.ZodString;
|
|
491
|
-
}, z.core.$strip>;
|
|
492
|
-
};
|
|
493
|
-
export { _default_2 as attemptCompletion }
|
|
494
|
-
export { _default_2 as attemptCompletion_alias_1 }
|
|
495
|
-
export { _default_2 as default_alias_1 }
|
|
496
|
-
|
|
497
|
-
declare const _default_3: {
|
|
498
|
-
handler: ToolHandler<{
|
|
499
|
-
readonly name: "delegate";
|
|
500
|
-
readonly description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
|
|
501
|
-
readonly parameters: z.ZodObject<{
|
|
502
|
-
agentName: z.ZodString;
|
|
503
|
-
task: z.ZodString;
|
|
504
|
-
context: z.ZodString;
|
|
505
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
506
|
-
}, z.core.$strip>;
|
|
507
|
-
}, any>;
|
|
508
|
-
isAvailable: (_provider: any) => boolean;
|
|
509
|
-
name: "delegate";
|
|
510
|
-
description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
|
|
511
|
-
parameters: z.ZodObject<{
|
|
512
|
-
agentName: z.ZodString;
|
|
513
|
-
task: z.ZodString;
|
|
514
|
-
context: z.ZodString;
|
|
515
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
516
|
-
}, z.core.$strip>;
|
|
517
|
-
};
|
|
518
|
-
export { _default_3 as default_alias_2 }
|
|
519
|
-
export { _default_3 as delegate }
|
|
520
|
-
export { _default_3 as delegate_alias_1 }
|
|
521
|
-
|
|
522
|
-
declare const _default_4: {
|
|
523
|
-
handler: ToolHandler<{
|
|
524
|
-
readonly name: "execute_command";
|
|
218
|
+
readonly name: "executeCommand";
|
|
525
219
|
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.";
|
|
526
220
|
readonly parameters: z.ZodObject<{
|
|
527
221
|
command: z.ZodString;
|
|
528
222
|
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
529
223
|
}, z.core.$strip>;
|
|
530
224
|
}, CommandProvider>;
|
|
531
|
-
|
|
532
|
-
name: "execute_command";
|
|
225
|
+
name: "executeCommand";
|
|
533
226
|
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.";
|
|
534
227
|
parameters: z.ZodObject<{
|
|
535
228
|
command: z.ZodString;
|
|
536
229
|
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
537
230
|
}, z.core.$strip>;
|
|
538
231
|
};
|
|
539
|
-
export {
|
|
540
|
-
export {
|
|
541
|
-
export {
|
|
232
|
+
export { _default_2 as default_alias_1 }
|
|
233
|
+
export { _default_2 as executeCommand }
|
|
234
|
+
export { _default_2 as executeCommand_alias_1 }
|
|
542
235
|
|
|
543
|
-
declare const
|
|
236
|
+
declare const _default_3: {
|
|
544
237
|
handler: ToolHandler<{
|
|
545
|
-
readonly name: "
|
|
238
|
+
readonly name: "fetchUrl";
|
|
546
239
|
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.";
|
|
547
240
|
readonly parameters: z.ZodObject<{
|
|
548
241
|
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
549
242
|
}, z.core.$strip>;
|
|
550
243
|
}, WebProvider>;
|
|
551
|
-
|
|
552
|
-
name: "fetch_url";
|
|
244
|
+
name: "fetchUrl";
|
|
553
245
|
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.";
|
|
554
246
|
parameters: z.ZodObject<{
|
|
555
247
|
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
556
248
|
}, z.core.$strip>;
|
|
557
249
|
};
|
|
558
|
-
export {
|
|
559
|
-
export {
|
|
560
|
-
export {
|
|
561
|
-
|
|
562
|
-
declare const _default_6: {
|
|
563
|
-
handler: ToolHandler<{
|
|
564
|
-
readonly name: "hand_over";
|
|
565
|
-
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
566
|
-
readonly parameters: z.ZodObject<{
|
|
567
|
-
agentName: z.ZodString;
|
|
568
|
-
task: z.ZodString;
|
|
569
|
-
context: z.ZodString;
|
|
570
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
571
|
-
}, z.core.$strip>;
|
|
572
|
-
}, any>;
|
|
573
|
-
isAvailable: (_provider: any) => boolean;
|
|
574
|
-
name: "hand_over";
|
|
575
|
-
description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
576
|
-
parameters: z.ZodObject<{
|
|
577
|
-
agentName: z.ZodString;
|
|
578
|
-
task: z.ZodString;
|
|
579
|
-
context: z.ZodString;
|
|
580
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
581
|
-
}, z.core.$strip>;
|
|
582
|
-
};
|
|
583
|
-
export { _default_6 as default_alias_5 }
|
|
584
|
-
export { _default_6 as handOver }
|
|
585
|
-
export { _default_6 as handOver_alias_1 }
|
|
250
|
+
export { _default_3 as default_alias_2 }
|
|
251
|
+
export { _default_3 as fetchUrl }
|
|
252
|
+
export { _default_3 as fetchUrl_alias_1 }
|
|
586
253
|
|
|
587
|
-
declare const
|
|
254
|
+
declare const _default_4: {
|
|
588
255
|
handler: ToolHandler<{
|
|
589
|
-
readonly name: "
|
|
256
|
+
readonly name: "listFiles";
|
|
590
257
|
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.";
|
|
591
258
|
readonly parameters: z.ZodObject<{
|
|
592
259
|
path: z.ZodString;
|
|
@@ -595,8 +262,7 @@ declare const _default_7: {
|
|
|
595
262
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
596
263
|
}, z.core.$strip>;
|
|
597
264
|
}, FilesystemProvider>;
|
|
598
|
-
|
|
599
|
-
name: "list_files";
|
|
265
|
+
name: "listFiles";
|
|
600
266
|
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.";
|
|
601
267
|
parameters: z.ZodObject<{
|
|
602
268
|
path: z.ZodString;
|
|
@@ -605,49 +271,97 @@ declare const _default_7: {
|
|
|
605
271
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
606
272
|
}, z.core.$strip>;
|
|
607
273
|
};
|
|
608
|
-
export {
|
|
609
|
-
export {
|
|
610
|
-
export {
|
|
274
|
+
export { _default_4 as default_alias_3 }
|
|
275
|
+
export { _default_4 as listFiles }
|
|
276
|
+
export { _default_4 as listFiles_alias_1 }
|
|
611
277
|
|
|
612
|
-
declare const
|
|
278
|
+
declare const _default_5: {
|
|
613
279
|
handler: ToolHandler<{
|
|
614
|
-
readonly name: "
|
|
280
|
+
readonly name: "listMemoryTopics";
|
|
281
|
+
readonly description: "Lists all topics in memory.";
|
|
282
|
+
readonly parameters: z.ZodObject<{}, z.core.$strip>;
|
|
283
|
+
}, MemoryProvider>;
|
|
284
|
+
name: "listMemoryTopics";
|
|
285
|
+
description: "Lists all topics in memory.";
|
|
286
|
+
parameters: z.ZodObject<{}, z.core.$strip>;
|
|
287
|
+
};
|
|
288
|
+
export { _default_5 as default_alias_4 }
|
|
289
|
+
export { _default_5 as listMemoryTopics }
|
|
290
|
+
export { _default_5 as listMemoryTopics_alias_1 }
|
|
291
|
+
|
|
292
|
+
declare const _default_6: {
|
|
293
|
+
handler: ToolHandler<{
|
|
294
|
+
readonly name: "readBinaryFile";
|
|
615
295
|
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.";
|
|
616
296
|
readonly parameters: z.ZodObject<{
|
|
617
297
|
url: z.ZodString;
|
|
618
298
|
}, z.core.$strip>;
|
|
619
299
|
}, FilesystemProvider>;
|
|
620
|
-
|
|
621
|
-
name: "read_binary_file";
|
|
300
|
+
name: "readBinaryFile";
|
|
622
301
|
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.";
|
|
623
302
|
parameters: z.ZodObject<{
|
|
624
303
|
url: z.ZodString;
|
|
625
304
|
}, z.core.$strip>;
|
|
626
305
|
};
|
|
627
|
-
export {
|
|
628
|
-
export {
|
|
629
|
-
export {
|
|
306
|
+
export { _default_6 as default_alias_5 }
|
|
307
|
+
export { _default_6 as readBinaryFile }
|
|
308
|
+
export { _default_6 as readBinaryFile_alias_1 }
|
|
630
309
|
|
|
631
|
-
declare const
|
|
310
|
+
declare const _default_7: {
|
|
632
311
|
handler: ToolHandler<{
|
|
633
|
-
readonly name: "
|
|
312
|
+
readonly name: "readFile";
|
|
634
313
|
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.";
|
|
635
314
|
readonly parameters: z.ZodObject<{
|
|
636
315
|
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
637
316
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
638
317
|
}, z.core.$strip>;
|
|
639
318
|
}, FilesystemProvider>;
|
|
640
|
-
|
|
641
|
-
name: "read_file";
|
|
319
|
+
name: "readFile";
|
|
642
320
|
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.";
|
|
643
321
|
parameters: z.ZodObject<{
|
|
644
322
|
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
645
323
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
646
324
|
}, z.core.$strip>;
|
|
647
325
|
};
|
|
326
|
+
export { _default_7 as default_alias_6 }
|
|
327
|
+
export { _default_7 as readFile }
|
|
328
|
+
export { _default_7 as readFile_alias_1 }
|
|
329
|
+
|
|
330
|
+
declare const _default_8: {
|
|
331
|
+
handler: ToolHandler<{
|
|
332
|
+
readonly name: "readMemory";
|
|
333
|
+
readonly description: "Reads content from a memory topic.";
|
|
334
|
+
readonly parameters: z.ZodObject<{
|
|
335
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
}, MemoryProvider>;
|
|
338
|
+
name: "readMemory";
|
|
339
|
+
description: "Reads content from a memory topic.";
|
|
340
|
+
parameters: z.ZodObject<{
|
|
341
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
};
|
|
344
|
+
export { _default_8 as default_alias_7 }
|
|
345
|
+
export { _default_8 as readMemory }
|
|
346
|
+
export { _default_8 as readMemory_alias_1 }
|
|
347
|
+
|
|
348
|
+
declare const _default_9: {
|
|
349
|
+
handler: ToolHandler<{
|
|
350
|
+
readonly name: "removeFile";
|
|
351
|
+
readonly description: "Request to remove a file at the specified path.";
|
|
352
|
+
readonly parameters: z.ZodObject<{
|
|
353
|
+
path: z.ZodString;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
}, FilesystemProvider>;
|
|
356
|
+
name: "removeFile";
|
|
357
|
+
description: "Request to remove a file at the specified path.";
|
|
358
|
+
parameters: z.ZodObject<{
|
|
359
|
+
path: z.ZodString;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
};
|
|
648
362
|
export { _default_9 as default_alias_8 }
|
|
649
|
-
export { _default_9 as
|
|
650
|
-
export { _default_9 as
|
|
363
|
+
export { _default_9 as removeFile }
|
|
364
|
+
export { _default_9 as removeFile_alias_1 }
|
|
651
365
|
|
|
652
366
|
/**
|
|
653
367
|
* Returns the directory portion of a path string.
|
|
@@ -655,28 +369,6 @@ export { _default_9 as readFile_alias_1 }
|
|
|
655
369
|
*/
|
|
656
370
|
export declare function dirname(path: string): string;
|
|
657
371
|
|
|
658
|
-
export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
|
|
659
|
-
|
|
660
|
-
declare const EnableCachePolicy: AgentPolicy;
|
|
661
|
-
export { EnableCachePolicy }
|
|
662
|
-
export { EnableCachePolicy as EnableCachePolicy_alias_1 }
|
|
663
|
-
export { EnableCachePolicy as EnableCachePolicy_alias_2 }
|
|
664
|
-
export { EnableCachePolicy as EnableCachePolicy_alias_3 }
|
|
665
|
-
|
|
666
|
-
declare type ExitReason = {
|
|
667
|
-
type: 'UsageExceeded';
|
|
668
|
-
} | {
|
|
669
|
-
type: 'WaitForUserInput';
|
|
670
|
-
} | {
|
|
671
|
-
type: 'Aborted';
|
|
672
|
-
} | ToolResponseExit | ToolResponseInterrupted | ToolResponseHandOver | ToolResponseDelegate | {
|
|
673
|
-
type: 'Pause';
|
|
674
|
-
responses: ToolResponseOrToolPause[];
|
|
675
|
-
};
|
|
676
|
-
export { ExitReason }
|
|
677
|
-
export { ExitReason as ExitReason_alias_1 }
|
|
678
|
-
export { ExitReason as ExitReason_alias_2 }
|
|
679
|
-
|
|
680
372
|
declare type FilesystemProvider = {
|
|
681
373
|
readFile?: (path: string, includeIgnored: boolean) => Promise<string | undefined>;
|
|
682
374
|
writeFile?: (path: string, content: string) => Promise<void>;
|
|
@@ -693,96 +385,35 @@ export { FilesystemProvider }
|
|
|
693
385
|
export { FilesystemProvider as FilesystemProvider_alias_1 }
|
|
694
386
|
export { FilesystemProvider as FilesystemProvider_alias_2 }
|
|
695
387
|
|
|
696
|
-
export declare const fullSystemPrompt: (info: {
|
|
697
|
-
os: string;
|
|
698
|
-
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
699
|
-
command: string;
|
|
700
|
-
description: string;
|
|
701
|
-
}>, useNativeTool: boolean) => string;
|
|
702
|
-
|
|
703
|
-
export declare const fullSystemPrompt_alias_1: (info: {
|
|
704
|
-
os: string;
|
|
705
|
-
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
706
|
-
command: string;
|
|
707
|
-
description: string;
|
|
708
|
-
}>, useNativeTool: boolean) => string;
|
|
709
|
-
|
|
710
|
-
export declare const fullSystemPrompt_alias_2: (info: {
|
|
711
|
-
os: string;
|
|
712
|
-
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
713
|
-
command: string;
|
|
714
|
-
description: string;
|
|
715
|
-
}>, useNativeTool: boolean) => string;
|
|
716
|
-
|
|
717
|
-
export declare const fullSystemPrompt_alias_3: (info: {
|
|
718
|
-
os: string;
|
|
719
|
-
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
720
|
-
command: string;
|
|
721
|
-
description: string;
|
|
722
|
-
}>, useNativeTool: boolean) => string;
|
|
723
|
-
|
|
724
388
|
declare type FullToolInfo = ToolInfo & {
|
|
725
389
|
handler: ToolHandler<ToolInfo, any>;
|
|
726
|
-
isAvailable: (provider: any) => boolean;
|
|
727
390
|
};
|
|
728
391
|
export { FullToolInfo }
|
|
729
392
|
export { FullToolInfo as FullToolInfo_alias_1 }
|
|
730
393
|
|
|
731
|
-
declare type FullToolInfoV2 = ToolInfoV2 & {
|
|
732
|
-
handler: ToolHandler<ToolInfoV2, any>;
|
|
733
|
-
isAvailable: (provider: any) => boolean;
|
|
734
|
-
};
|
|
735
|
-
export { FullToolInfoV2 }
|
|
736
|
-
export { FullToolInfoV2 as FullToolInfoV2_alias_1 }
|
|
737
|
-
|
|
738
|
-
export declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Get the available tools based on the provider and agent availability
|
|
742
|
-
* @param provider The provider to use.
|
|
743
|
-
* @param allTools All possible tools.
|
|
744
|
-
* @param hasAgent Whether the agent has agents.
|
|
745
|
-
* @returns The available tools
|
|
746
|
-
*/
|
|
747
|
-
declare const getAvailableTools: <T extends FullToolInfoV2 | FullToolInfo>({ provider, allTools, hasAgent, }: {
|
|
748
|
-
provider: any;
|
|
749
|
-
allTools: T[];
|
|
750
|
-
hasAgent: boolean;
|
|
751
|
-
}) => T[];
|
|
752
|
-
export { getAvailableTools }
|
|
753
|
-
export { getAvailableTools as getAvailableTools_alias_1 }
|
|
754
|
-
|
|
755
|
-
export declare const getBoolean: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: boolean) => boolean;
|
|
756
|
-
|
|
757
|
-
export declare const getInt: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: number) => number;
|
|
758
|
-
|
|
759
|
-
export declare const getString: <T extends string>(args: Partial<Record<T, string>> | ToolParameterValue, name: T, defaultValue?: string) => string;
|
|
760
|
-
|
|
761
|
-
export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
|
|
762
|
-
|
|
763
394
|
export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
|
|
764
395
|
|
|
765
|
-
export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1,
|
|
396
|
+
export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, CommandProvider>;
|
|
766
397
|
|
|
767
398
|
export declare const handler_alias_10: ToolHandler<typeof toolInfo_alias_10, FilesystemProvider>;
|
|
768
399
|
|
|
769
400
|
export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, FilesystemProvider>;
|
|
770
401
|
|
|
771
|
-
export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12,
|
|
402
|
+
export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, MemoryProvider>;
|
|
772
403
|
|
|
773
404
|
export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
|
|
774
405
|
|
|
775
|
-
export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2,
|
|
406
|
+
export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, WebProvider>;
|
|
776
407
|
|
|
777
|
-
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3,
|
|
408
|
+
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, FilesystemProvider>;
|
|
778
409
|
|
|
779
|
-
export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4,
|
|
410
|
+
export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, MemoryProvider>;
|
|
780
411
|
|
|
781
|
-
export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5,
|
|
412
|
+
export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, FilesystemProvider>;
|
|
782
413
|
|
|
783
414
|
export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
|
|
784
415
|
|
|
785
|
-
export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7,
|
|
416
|
+
export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, MemoryProvider>;
|
|
786
417
|
|
|
787
418
|
export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, FilesystemProvider>;
|
|
788
419
|
|
|
@@ -790,45 +421,25 @@ export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, Files
|
|
|
790
421
|
|
|
791
422
|
declare type InteractionProvider = {
|
|
792
423
|
askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
|
|
793
|
-
attemptCompletion?: (result: string) => Promise<string | undefined>;
|
|
794
424
|
};
|
|
795
425
|
export { InteractionProvider }
|
|
796
426
|
export { InteractionProvider as InteractionProvider_alias_1 }
|
|
797
427
|
export { InteractionProvider as InteractionProvider_alias_2 }
|
|
798
428
|
|
|
799
|
-
export declare const isAvailable: (provider: InteractionProvider) => boolean;
|
|
800
|
-
|
|
801
|
-
export declare const isAvailable_alias_1: (_provider: InteractionProvider) => boolean;
|
|
802
|
-
|
|
803
|
-
export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
|
|
804
|
-
|
|
805
|
-
export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boolean;
|
|
806
|
-
|
|
807
|
-
export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
|
|
808
|
-
|
|
809
|
-
export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
|
|
810
|
-
|
|
811
|
-
export declare const isAvailable_alias_2: (_provider: any) => boolean;
|
|
812
|
-
|
|
813
|
-
export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
|
|
814
|
-
|
|
815
|
-
export declare const isAvailable_alias_4: (provider: WebProvider) => boolean;
|
|
816
|
-
|
|
817
|
-
export declare const isAvailable_alias_5: (_provider: any) => boolean;
|
|
818
|
-
|
|
819
|
-
export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
|
|
820
|
-
|
|
821
|
-
export declare const isAvailable_alias_7: (provider: FilesystemProvider) => boolean;
|
|
822
|
-
|
|
823
|
-
export declare const isAvailable_alias_8: (provider: FilesystemProvider) => boolean;
|
|
824
|
-
|
|
825
|
-
export declare const isAvailable_alias_9: (provider: FilesystemProvider) => boolean;
|
|
826
|
-
|
|
827
429
|
/**
|
|
828
430
|
* Joins all given path segments, then normalizes the result.
|
|
829
431
|
*/
|
|
830
432
|
export declare function join(...parts: string[]): string;
|
|
831
433
|
|
|
434
|
+
declare interface MemoryProvider {
|
|
435
|
+
listMemoryTopics: () => Promise<string[]>;
|
|
436
|
+
readMemory: (topic?: string) => Promise<string | undefined>;
|
|
437
|
+
updateMemory: (operation: 'append' | 'replace' | 'remove', topic: string | undefined, content: string | undefined) => Promise<void>;
|
|
438
|
+
}
|
|
439
|
+
export { MemoryProvider }
|
|
440
|
+
export { MemoryProvider as MemoryProvider_alias_1 }
|
|
441
|
+
export { MemoryProvider as MemoryProvider_alias_2 }
|
|
442
|
+
|
|
832
443
|
declare class MockProvider implements ToolProvider {
|
|
833
444
|
readFile(_path: string, _includeIgnored?: boolean): Promise<string>;
|
|
834
445
|
writeFile(_path: string, _content: string): Promise<void>;
|
|
@@ -843,7 +454,9 @@ declare class MockProvider implements ToolProvider {
|
|
|
843
454
|
summary?: string;
|
|
844
455
|
}>;
|
|
845
456
|
askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
|
|
846
|
-
|
|
457
|
+
listMemoryTopics(): Promise<string[]>;
|
|
458
|
+
readMemory(_topic?: string): Promise<string | undefined>;
|
|
459
|
+
updateMemory(_operation: 'append' | 'replace' | 'remove', _topic?: string, _content?: string): Promise<void>;
|
|
847
460
|
}
|
|
848
461
|
export { MockProvider }
|
|
849
462
|
export { MockProvider as MockProvider_alias_1 }
|
|
@@ -858,99 +471,6 @@ declare type ModelInfo = {
|
|
|
858
471
|
export { ModelInfo }
|
|
859
472
|
export { ModelInfo as ModelInfo_alias_1 }
|
|
860
473
|
|
|
861
|
-
declare class MultiAgent {
|
|
862
|
-
#private;
|
|
863
|
-
constructor(config: MultiAgentConfig);
|
|
864
|
-
startTask(options: {
|
|
865
|
-
agentName: string;
|
|
866
|
-
task: string;
|
|
867
|
-
context: string;
|
|
868
|
-
files?: (ImagePart | FilePart)[];
|
|
869
|
-
}): Promise<ExitReason>;
|
|
870
|
-
continueTask(userMessage: UserContent_2): Promise<ExitReason>;
|
|
871
|
-
get hasActiveAgent(): boolean;
|
|
872
|
-
abort(): void;
|
|
873
|
-
}
|
|
874
|
-
export { MultiAgent }
|
|
875
|
-
export { MultiAgent as MultiAgent_alias_1 }
|
|
876
|
-
export { MultiAgent as MultiAgent_alias_2 }
|
|
877
|
-
|
|
878
|
-
declare type MultiAgentConfig = {
|
|
879
|
-
createAgent: (name: string) => Promise<AgentBase>;
|
|
880
|
-
getPrompt?: (name: string, task: string, context: string | undefined, files: string[] | undefined, originalTask: string | undefined) => Promise<string>;
|
|
881
|
-
};
|
|
882
|
-
export { MultiAgentConfig }
|
|
883
|
-
export { MultiAgentConfig as MultiAgentConfig_alias_1 }
|
|
884
|
-
export { MultiAgentConfig as MultiAgentConfig_alias_2 }
|
|
885
|
-
|
|
886
|
-
export declare const objectives: (toolNamePrefix: string) => string;
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Parse an assistant's message into an array of text content and tool use content.
|
|
890
|
-
*
|
|
891
|
-
* @example
|
|
892
|
-
* const tools = [
|
|
893
|
-
* {
|
|
894
|
-
* name: "search",
|
|
895
|
-
* parameters: [
|
|
896
|
-
* {name: "query", type: "string"}
|
|
897
|
-
* ]
|
|
898
|
-
* }
|
|
899
|
-
* ]
|
|
900
|
-
*
|
|
901
|
-
* // Text only
|
|
902
|
-
* parseAssistantMessage("Hello world", tools, "tool_")
|
|
903
|
-
* // Returns: [{type: "text", content: "Hello world"}]
|
|
904
|
-
*
|
|
905
|
-
* // Tool use with parameters
|
|
906
|
-
* parseAssistantMessage(
|
|
907
|
-
* `Let me search that for you
|
|
908
|
-
* <tool_search>
|
|
909
|
-
* <tool_parameter_query>cats</tool_parameter_query>
|
|
910
|
-
* </tool_search>
|
|
911
|
-
* Here are the results`,
|
|
912
|
-
* tools,
|
|
913
|
-
* "tool_"
|
|
914
|
-
* )
|
|
915
|
-
* // Returns: [
|
|
916
|
-
* // {type: "text", content: "Let me search that for you"},
|
|
917
|
-
* // {type: "tool_use", name: "search", params: {query: "cats"}},
|
|
918
|
-
* // {type: "text", content: "Here are the results"}
|
|
919
|
-
* // ]
|
|
920
|
-
*
|
|
921
|
-
* // Array mode (multiple occurrences of the same parameter)
|
|
922
|
-
* parseAssistantMessage(
|
|
923
|
-
* `<tool_read_file>
|
|
924
|
-
* <tool_parameter_path>test.ts</tool_parameter_path>
|
|
925
|
-
* <tool_parameter_path>main.ts</tool_parameter_path>
|
|
926
|
-
* </tool_read_file>`,
|
|
927
|
-
* tools,
|
|
928
|
-
* "tool_"
|
|
929
|
-
* )
|
|
930
|
-
* // Returns: [
|
|
931
|
-
* // {type: "tool_use", name: "read_file", params: {path: ["test.ts", "main.ts"]}}
|
|
932
|
-
* // ]
|
|
933
|
-
*
|
|
934
|
-
* // Nested objects
|
|
935
|
-
* parseAssistantMessage(
|
|
936
|
-
* `<tool_example>
|
|
937
|
-
* <tool_parameter_key>
|
|
938
|
-
* <tool_parameter_key2>value</tool_parameter_key2>
|
|
939
|
-
* <tool_parameter_key3>value2</tool_parameter_key3>
|
|
940
|
-
* </tool_parameter_key>
|
|
941
|
-
* </tool_example>`,
|
|
942
|
-
* tools,
|
|
943
|
-
* "tool_"
|
|
944
|
-
* )
|
|
945
|
-
* // Returns: [
|
|
946
|
-
* // {type: "tool_use", name: "example", params: {key: {key2: "value", key3: "value2"}}}
|
|
947
|
-
* // ]
|
|
948
|
-
*/
|
|
949
|
-
declare function parseAssistantMessage(assistantMessage: string, tools: ToolInfo[], toolNamePrefix: string): AssistantMessageContent[];
|
|
950
|
-
export { parseAssistantMessage }
|
|
951
|
-
export { parseAssistantMessage as parseAssistantMessage_alias_1 }
|
|
952
|
-
export { parseAssistantMessage as parseAssistantMessage_alias_2 }
|
|
953
|
-
|
|
954
474
|
declare const parseJsonFromMarkdown: (markdown: string) => ParseOutputResult<any>;
|
|
955
475
|
export { parseJsonFromMarkdown }
|
|
956
476
|
export { parseJsonFromMarkdown as parseJsonFromMarkdown_alias_1 }
|
|
@@ -967,13 +487,6 @@ export { ParseOutputResult }
|
|
|
967
487
|
export { ParseOutputResult as ParseOutputResult_alias_1 }
|
|
968
488
|
export { ParseOutputResult as ParseOutputResult_alias_2 }
|
|
969
489
|
|
|
970
|
-
declare enum Policies {
|
|
971
|
-
TruncateContext = "truncatecontext",
|
|
972
|
-
EnableCache = "enablecache"
|
|
973
|
-
}
|
|
974
|
-
export { Policies }
|
|
975
|
-
export { Policies as Policies_alias_1 }
|
|
976
|
-
|
|
977
490
|
declare const replaceInFile_2: (fileContent: string, diff: string) => ReplaceResult;
|
|
978
491
|
export { replaceInFile_2 as replaceInFileHelper }
|
|
979
492
|
export { replaceInFile_2 as replaceInFile_alias_2 }
|
|
@@ -999,238 +512,6 @@ export { responsePrompts }
|
|
|
999
512
|
export { responsePrompts as responsePrompts_alias_1 }
|
|
1000
513
|
export { responsePrompts as responsePrompts_alias_2 }
|
|
1001
514
|
|
|
1002
|
-
export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before Retrying\n - Analyze previous attempt's failure\n - Consider alternative approaches\n - Check if similar issues were fixed\n - Verify no new issues were introduced\n\n2. When to Retry\n - Error message changed but issue persists\n - New information available about the root cause\n - Different fixing strategy available\n - Previous attempt partially successful\n\n3. When to Stop\n - Maximum retry limit reached\n - Same error occurs repeatedly\n - Fix would require major refactoring\n - Issue requires human intervention\n\n4. After Maximum Retries\n - Document attempted solutions\n - Explain why the issue remains\n - Suggest manual intervention steps\n - Report any partial improvements";
|
|
1003
|
-
|
|
1004
|
-
export declare const rules: (toolNamePrefix: string) => string;
|
|
1005
|
-
|
|
1006
|
-
declare type SharedAgentOptions = {
|
|
1007
|
-
ai: LanguageModelV2;
|
|
1008
|
-
os: string;
|
|
1009
|
-
provider: ToolProvider;
|
|
1010
|
-
additionalTools?: FullToolInfoV2[];
|
|
1011
|
-
customInstructions?: string[];
|
|
1012
|
-
scripts?: Record<string, string | {
|
|
1013
|
-
command: string;
|
|
1014
|
-
description: string;
|
|
1015
|
-
}>;
|
|
1016
|
-
agents?: Readonly<AgentInfo[]>;
|
|
1017
|
-
callback?: TaskEventCallback;
|
|
1018
|
-
policies: AgentPolicy[];
|
|
1019
|
-
retryCount?: number;
|
|
1020
|
-
requestTimeoutSeconds?: number;
|
|
1021
|
-
toolFormat: ToolFormat;
|
|
1022
|
-
parameters?: Record<string, any>;
|
|
1023
|
-
usageMeter?: UsageMeter;
|
|
1024
|
-
requireToolUse?: boolean;
|
|
1025
|
-
};
|
|
1026
|
-
export { SharedAgentOptions }
|
|
1027
|
-
export { SharedAgentOptions as SharedAgentOptions_alias_1 }
|
|
1028
|
-
export { SharedAgentOptions as SharedAgentOptions_alias_2 }
|
|
1029
|
-
|
|
1030
|
-
declare const systemInformation: (info: {
|
|
1031
|
-
os: string;
|
|
1032
|
-
}) => string;
|
|
1033
|
-
export { systemInformation }
|
|
1034
|
-
export { systemInformation as systemInformation_alias_1 }
|
|
1035
|
-
export { systemInformation as systemInformation_alias_2 }
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
* Union type of all possible task events
|
|
1039
|
-
*/
|
|
1040
|
-
declare type TaskEvent = TaskEventStartTask | TaskEventStartRequest | TaskEventEndRequest | TaskEventUsage | TaskEventText | TaskEventToolUse | TaskEventToolResult | TaskEventToolError | TaskEventToolPause | TaskEventToolHandOverDelegate | TaskEventUsageExceeded | TaskEventEndTask;
|
|
1041
|
-
export { TaskEvent }
|
|
1042
|
-
export { TaskEvent as TaskEvent_alias_1 }
|
|
1043
|
-
export { TaskEvent as TaskEvent_alias_2 }
|
|
1044
|
-
|
|
1045
|
-
/**
|
|
1046
|
-
* Base interface for all task events
|
|
1047
|
-
*/
|
|
1048
|
-
declare interface TaskEventBase {
|
|
1049
|
-
kind: TaskEventKind;
|
|
1050
|
-
}
|
|
1051
|
-
export { TaskEventBase }
|
|
1052
|
-
export { TaskEventBase as TaskEventBase_alias_1 }
|
|
1053
|
-
export { TaskEventBase as TaskEventBase_alias_2 }
|
|
1054
|
-
|
|
1055
|
-
declare type TaskEventCallback = (event: TaskEvent) => void | Promise<void>;
|
|
1056
|
-
export { TaskEventCallback }
|
|
1057
|
-
export { TaskEventCallback as TaskEventCallback_alias_1 }
|
|
1058
|
-
export { TaskEventCallback as TaskEventCallback_alias_2 }
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* Event for request end
|
|
1062
|
-
*/
|
|
1063
|
-
declare interface TaskEventEndRequest extends TaskEventBase {
|
|
1064
|
-
kind: TaskEventKind.EndRequest;
|
|
1065
|
-
message: string;
|
|
1066
|
-
}
|
|
1067
|
-
export { TaskEventEndRequest }
|
|
1068
|
-
export { TaskEventEndRequest as TaskEventEndRequest_alias_1 }
|
|
1069
|
-
export { TaskEventEndRequest as TaskEventEndRequest_alias_2 }
|
|
1070
|
-
|
|
1071
|
-
/**
|
|
1072
|
-
* Event for task end
|
|
1073
|
-
*/
|
|
1074
|
-
declare interface TaskEventEndTask extends TaskEventBase {
|
|
1075
|
-
kind: TaskEventKind.EndTask;
|
|
1076
|
-
exitReason: ExitReason;
|
|
1077
|
-
}
|
|
1078
|
-
export { TaskEventEndTask }
|
|
1079
|
-
export { TaskEventEndTask as TaskEventEndTask_alias_1 }
|
|
1080
|
-
export { TaskEventEndTask as TaskEventEndTask_alias_2 }
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
* Enum representing different kinds of task events
|
|
1084
|
-
*/
|
|
1085
|
-
declare enum TaskEventKind {
|
|
1086
|
-
StartTask = "StartTask",
|
|
1087
|
-
StartRequest = "StartRequest",
|
|
1088
|
-
EndRequest = "EndRequest",
|
|
1089
|
-
Usage = "Usage",
|
|
1090
|
-
Text = "Text",
|
|
1091
|
-
Reasoning = "Reasoning",
|
|
1092
|
-
ToolUse = "ToolUse",
|
|
1093
|
-
ToolReply = "ToolReply",
|
|
1094
|
-
ToolInvalid = "ToolInvalid",
|
|
1095
|
-
ToolError = "ToolError",
|
|
1096
|
-
ToolInterrupted = "ToolInterrupted",
|
|
1097
|
-
ToolHandOver = "ToolHandOver",
|
|
1098
|
-
ToolDelegate = "ToolDelegate",
|
|
1099
|
-
ToolPause = "ToolPause",
|
|
1100
|
-
UsageExceeded = "UsageExceeded",
|
|
1101
|
-
EndTask = "EndTask"
|
|
1102
|
-
}
|
|
1103
|
-
export { TaskEventKind }
|
|
1104
|
-
export { TaskEventKind as TaskEventKind_alias_1 }
|
|
1105
|
-
export { TaskEventKind as TaskEventKind_alias_2 }
|
|
1106
|
-
|
|
1107
|
-
/**
|
|
1108
|
-
* Event for request start
|
|
1109
|
-
*/
|
|
1110
|
-
declare interface TaskEventStartRequest extends TaskEventBase {
|
|
1111
|
-
kind: TaskEventKind.StartRequest;
|
|
1112
|
-
userMessage: ModelMessage[];
|
|
1113
|
-
}
|
|
1114
|
-
export { TaskEventStartRequest }
|
|
1115
|
-
export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
|
|
1116
|
-
export { TaskEventStartRequest as TaskEventStartRequest_alias_2 }
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* Event for task start
|
|
1120
|
-
*/
|
|
1121
|
-
declare interface TaskEventStartTask extends TaskEventBase {
|
|
1122
|
-
kind: TaskEventKind.StartTask;
|
|
1123
|
-
systemPrompt: string;
|
|
1124
|
-
}
|
|
1125
|
-
export { TaskEventStartTask }
|
|
1126
|
-
export { TaskEventStartTask as TaskEventStartTask_alias_1 }
|
|
1127
|
-
export { TaskEventStartTask as TaskEventStartTask_alias_2 }
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* Event for text/reasoning updates
|
|
1131
|
-
*/
|
|
1132
|
-
declare interface TaskEventText extends TaskEventBase {
|
|
1133
|
-
kind: TaskEventKind.Text | TaskEventKind.Reasoning;
|
|
1134
|
-
newText: string;
|
|
1135
|
-
}
|
|
1136
|
-
export { TaskEventText }
|
|
1137
|
-
export { TaskEventText as TaskEventText_alias_1 }
|
|
1138
|
-
export { TaskEventText as TaskEventText_alias_2 }
|
|
1139
|
-
|
|
1140
|
-
declare interface TaskEventToolError extends TaskEventBase {
|
|
1141
|
-
kind: TaskEventKind.ToolError;
|
|
1142
|
-
tool: string;
|
|
1143
|
-
error: ToolResponseError | ToolResponseResult;
|
|
1144
|
-
}
|
|
1145
|
-
export { TaskEventToolError }
|
|
1146
|
-
export { TaskEventToolError as TaskEventToolError_alias_1 }
|
|
1147
|
-
export { TaskEventToolError as TaskEventToolError_alias_2 }
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* Event for tool handover
|
|
1151
|
-
*/
|
|
1152
|
-
declare interface TaskEventToolHandOverDelegate extends TaskEventBase {
|
|
1153
|
-
kind: TaskEventKind.ToolHandOver | TaskEventKind.ToolDelegate;
|
|
1154
|
-
tool: string;
|
|
1155
|
-
agentName: string;
|
|
1156
|
-
task: string;
|
|
1157
|
-
context?: string;
|
|
1158
|
-
files?: string[];
|
|
1159
|
-
}
|
|
1160
|
-
export { TaskEventToolHandOverDelegate }
|
|
1161
|
-
export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_1 }
|
|
1162
|
-
export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_2 }
|
|
1163
|
-
|
|
1164
|
-
declare interface TaskEventToolPause extends TaskEventBase {
|
|
1165
|
-
kind: TaskEventKind.ToolPause;
|
|
1166
|
-
tool: string;
|
|
1167
|
-
object: any;
|
|
1168
|
-
}
|
|
1169
|
-
export { TaskEventToolPause }
|
|
1170
|
-
export { TaskEventToolPause as TaskEventToolPause_alias_1 }
|
|
1171
|
-
export { TaskEventToolPause as TaskEventToolPause_alias_2 }
|
|
1172
|
-
|
|
1173
|
-
declare interface TaskEventToolResult extends TaskEventBase {
|
|
1174
|
-
kind: TaskEventKind.ToolReply | TaskEventKind.ToolInvalid | TaskEventKind.ToolInterrupted;
|
|
1175
|
-
tool: string;
|
|
1176
|
-
content: ToolResponseResult;
|
|
1177
|
-
}
|
|
1178
|
-
export { TaskEventToolResult }
|
|
1179
|
-
export { TaskEventToolResult as TaskEventToolResult_alias_1 }
|
|
1180
|
-
export { TaskEventToolResult as TaskEventToolResult_alias_2 }
|
|
1181
|
-
|
|
1182
|
-
/**
|
|
1183
|
-
* Event for tool-related updates
|
|
1184
|
-
*/
|
|
1185
|
-
declare interface TaskEventToolUse extends TaskEventBase {
|
|
1186
|
-
kind: TaskEventKind.ToolUse;
|
|
1187
|
-
tool: string;
|
|
1188
|
-
params: Record<string, any>;
|
|
1189
|
-
}
|
|
1190
|
-
export { TaskEventToolUse }
|
|
1191
|
-
export { TaskEventToolUse as TaskEventToolUse_alias_1 }
|
|
1192
|
-
export { TaskEventToolUse as TaskEventToolUse_alias_2 }
|
|
1193
|
-
|
|
1194
|
-
/**
|
|
1195
|
-
* Event for API usage updates
|
|
1196
|
-
*/
|
|
1197
|
-
declare interface TaskEventUsage extends TaskEventBase {
|
|
1198
|
-
kind: TaskEventKind.Usage;
|
|
1199
|
-
usage: LanguageModelUsage;
|
|
1200
|
-
}
|
|
1201
|
-
export { TaskEventUsage }
|
|
1202
|
-
export { TaskEventUsage as TaskEventUsage_alias_1 }
|
|
1203
|
-
export { TaskEventUsage as TaskEventUsage_alias_2 }
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* Event for task usage exceeded
|
|
1207
|
-
*/
|
|
1208
|
-
declare interface TaskEventUsageExceeded extends TaskEventBase {
|
|
1209
|
-
kind: TaskEventKind.UsageExceeded;
|
|
1210
|
-
}
|
|
1211
|
-
export { TaskEventUsageExceeded }
|
|
1212
|
-
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
|
|
1213
|
-
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
|
|
1214
|
-
|
|
1215
|
-
declare interface TextContent {
|
|
1216
|
-
type: 'text';
|
|
1217
|
-
content: string;
|
|
1218
|
-
}
|
|
1219
|
-
export { TextContent }
|
|
1220
|
-
export { TextContent as TextContent_alias_1 }
|
|
1221
|
-
export { TextContent as TextContent_alias_2 }
|
|
1222
|
-
|
|
1223
|
-
declare type ToolExample = {
|
|
1224
|
-
description: string;
|
|
1225
|
-
input: Record<string, ToolParameterValue>;
|
|
1226
|
-
};
|
|
1227
|
-
export { ToolExample }
|
|
1228
|
-
export { ToolExample as ToolExample_alias_1 }
|
|
1229
|
-
|
|
1230
|
-
declare type ToolFormat = 'native' | 'polka-codes';
|
|
1231
|
-
export { ToolFormat }
|
|
1232
|
-
export { ToolFormat as ToolFormat_alias_1 }
|
|
1233
|
-
|
|
1234
515
|
declare type ToolHandler<_T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
|
|
1235
516
|
export { ToolHandler }
|
|
1236
517
|
export { ToolHandler as ToolHandler_alias_1 }
|
|
@@ -1238,14 +519,13 @@ export { ToolHandler as ToolHandler_alias_1 }
|
|
|
1238
519
|
declare type ToolInfo = {
|
|
1239
520
|
name: string;
|
|
1240
521
|
description: string;
|
|
1241
|
-
parameters:
|
|
1242
|
-
examples?: ToolExample[];
|
|
522
|
+
parameters: z.ZodObject<any>;
|
|
1243
523
|
};
|
|
1244
524
|
export { ToolInfo }
|
|
1245
525
|
export { ToolInfo as ToolInfo_alias_1 }
|
|
1246
526
|
|
|
1247
527
|
export declare const toolInfo: {
|
|
1248
|
-
readonly name: "
|
|
528
|
+
readonly name: "askFollowupQuestion";
|
|
1249
529
|
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.";
|
|
1250
530
|
readonly parameters: z.ZodObject<{
|
|
1251
531
|
questions: z.ZodArray<z.ZodObject<{
|
|
@@ -1256,24 +536,16 @@ export declare const toolInfo: {
|
|
|
1256
536
|
};
|
|
1257
537
|
|
|
1258
538
|
export declare const toolInfo_alias_1: {
|
|
1259
|
-
readonly name: "
|
|
1260
|
-
readonly description: "
|
|
539
|
+
readonly name: "executeCommand";
|
|
540
|
+
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.";
|
|
1261
541
|
readonly parameters: z.ZodObject<{
|
|
1262
|
-
|
|
542
|
+
command: z.ZodString;
|
|
543
|
+
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1263
544
|
}, z.core.$strip>;
|
|
1264
545
|
};
|
|
1265
546
|
|
|
1266
547
|
export declare const toolInfo_alias_10: {
|
|
1267
|
-
readonly name: "
|
|
1268
|
-
readonly description: "Request to rename a file from source path to target path.";
|
|
1269
|
-
readonly parameters: z.ZodObject<{
|
|
1270
|
-
source_path: z.ZodString;
|
|
1271
|
-
target_path: z.ZodString;
|
|
1272
|
-
}, z.core.$strip>;
|
|
1273
|
-
};
|
|
1274
|
-
|
|
1275
|
-
export declare const toolInfo_alias_11: {
|
|
1276
|
-
readonly name: "replace_in_file";
|
|
548
|
+
readonly name: "replaceInFile";
|
|
1277
549
|
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.";
|
|
1278
550
|
readonly parameters: z.ZodObject<{
|
|
1279
551
|
path: z.ZodString;
|
|
@@ -1281,8 +553,8 @@ export declare const toolInfo_alias_11: {
|
|
|
1281
553
|
}, z.core.$strip>;
|
|
1282
554
|
};
|
|
1283
555
|
|
|
1284
|
-
export declare const
|
|
1285
|
-
readonly name: "
|
|
556
|
+
export declare const toolInfo_alias_11: {
|
|
557
|
+
readonly name: "searchFiles";
|
|
1286
558
|
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.";
|
|
1287
559
|
readonly parameters: z.ZodObject<{
|
|
1288
560
|
path: z.ZodString;
|
|
@@ -1291,8 +563,22 @@ export declare const toolInfo_alias_12: {
|
|
|
1291
563
|
}, z.core.$strip>;
|
|
1292
564
|
};
|
|
1293
565
|
|
|
566
|
+
export declare const toolInfo_alias_12: {
|
|
567
|
+
readonly name: "updateMemory";
|
|
568
|
+
readonly description: "Appends, replaces, or removes content from a memory topic.";
|
|
569
|
+
readonly parameters: z.ZodObject<{
|
|
570
|
+
operation: z.ZodEnum<{
|
|
571
|
+
append: "append";
|
|
572
|
+
replace: "replace";
|
|
573
|
+
remove: "remove";
|
|
574
|
+
}>;
|
|
575
|
+
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
576
|
+
content: z.ZodOptional<z.ZodString>;
|
|
577
|
+
}, z.core.$strip>;
|
|
578
|
+
};
|
|
579
|
+
|
|
1294
580
|
export declare const toolInfo_alias_13: {
|
|
1295
|
-
readonly name: "
|
|
581
|
+
readonly name: "writeToFile";
|
|
1296
582
|
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 `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
1297
583
|
readonly parameters: z.ZodObject<{
|
|
1298
584
|
path: z.ZodString;
|
|
@@ -1301,88 +587,72 @@ export declare const toolInfo_alias_13: {
|
|
|
1301
587
|
};
|
|
1302
588
|
|
|
1303
589
|
export declare const toolInfo_alias_2: {
|
|
1304
|
-
readonly name: "
|
|
1305
|
-
readonly description: "
|
|
590
|
+
readonly name: "fetchUrl";
|
|
591
|
+
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.";
|
|
1306
592
|
readonly parameters: z.ZodObject<{
|
|
1307
|
-
|
|
1308
|
-
task: z.ZodString;
|
|
1309
|
-
context: z.ZodString;
|
|
1310
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
593
|
+
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1311
594
|
}, z.core.$strip>;
|
|
1312
595
|
};
|
|
1313
596
|
|
|
1314
597
|
export declare const toolInfo_alias_3: {
|
|
1315
|
-
readonly name: "
|
|
1316
|
-
readonly description: "
|
|
598
|
+
readonly name: "listFiles";
|
|
599
|
+
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.";
|
|
1317
600
|
readonly parameters: z.ZodObject<{
|
|
1318
|
-
|
|
1319
|
-
|
|
601
|
+
path: z.ZodString;
|
|
602
|
+
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
603
|
+
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
604
|
+
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1320
605
|
}, z.core.$strip>;
|
|
1321
606
|
};
|
|
1322
607
|
|
|
1323
608
|
export declare const toolInfo_alias_4: {
|
|
1324
|
-
readonly name: "
|
|
1325
|
-
readonly description: "
|
|
1326
|
-
readonly parameters: z.ZodObject<{
|
|
1327
|
-
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1328
|
-
}, z.core.$strip>;
|
|
609
|
+
readonly name: "listMemoryTopics";
|
|
610
|
+
readonly description: "Lists all topics in memory.";
|
|
611
|
+
readonly parameters: z.ZodObject<{}, z.core.$strip>;
|
|
1329
612
|
};
|
|
1330
613
|
|
|
1331
614
|
export declare const toolInfo_alias_5: {
|
|
1332
|
-
readonly name: "
|
|
1333
|
-
readonly description: "
|
|
615
|
+
readonly name: "readBinaryFile";
|
|
616
|
+
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.";
|
|
1334
617
|
readonly parameters: z.ZodObject<{
|
|
1335
|
-
|
|
1336
|
-
task: z.ZodString;
|
|
1337
|
-
context: z.ZodString;
|
|
1338
|
-
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
618
|
+
url: z.ZodString;
|
|
1339
619
|
}, z.core.$strip>;
|
|
1340
620
|
};
|
|
1341
621
|
|
|
1342
622
|
export declare const toolInfo_alias_6: {
|
|
1343
|
-
readonly name: "
|
|
1344
|
-
readonly description: "Request to
|
|
623
|
+
readonly name: "readFile";
|
|
624
|
+
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.";
|
|
1345
625
|
readonly parameters: z.ZodObject<{
|
|
1346
|
-
path: z.ZodString
|
|
1347
|
-
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
1348
|
-
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
626
|
+
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1349
627
|
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1350
628
|
}, z.core.$strip>;
|
|
1351
629
|
};
|
|
1352
630
|
|
|
1353
631
|
export declare const toolInfo_alias_7: {
|
|
1354
|
-
readonly name: "
|
|
1355
|
-
readonly description: "
|
|
632
|
+
readonly name: "readMemory";
|
|
633
|
+
readonly description: "Reads content from a memory topic.";
|
|
1356
634
|
readonly parameters: z.ZodObject<{
|
|
1357
|
-
|
|
635
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
1358
636
|
}, z.core.$strip>;
|
|
1359
637
|
};
|
|
1360
638
|
|
|
1361
639
|
export declare const toolInfo_alias_8: {
|
|
1362
|
-
readonly name: "
|
|
1363
|
-
readonly description: "Request to
|
|
640
|
+
readonly name: "removeFile";
|
|
641
|
+
readonly description: "Request to remove a file at the specified path.";
|
|
1364
642
|
readonly parameters: z.ZodObject<{
|
|
1365
|
-
path: z.
|
|
1366
|
-
includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
643
|
+
path: z.ZodString;
|
|
1367
644
|
}, z.core.$strip>;
|
|
1368
645
|
};
|
|
1369
646
|
|
|
1370
647
|
export declare const toolInfo_alias_9: {
|
|
1371
|
-
readonly name: "
|
|
1372
|
-
readonly description: "Request to
|
|
648
|
+
readonly name: "renameFile";
|
|
649
|
+
readonly description: "Request to rename a file from source path to target path.";
|
|
1373
650
|
readonly parameters: z.ZodObject<{
|
|
1374
|
-
|
|
651
|
+
source_path: z.ZodString;
|
|
652
|
+
target_path: z.ZodString;
|
|
1375
653
|
}, z.core.$strip>;
|
|
1376
654
|
};
|
|
1377
655
|
|
|
1378
|
-
declare type ToolInfoV2 = {
|
|
1379
|
-
name: string;
|
|
1380
|
-
description: string;
|
|
1381
|
-
parameters: z.ZodObject<any>;
|
|
1382
|
-
};
|
|
1383
|
-
export { ToolInfoV2 }
|
|
1384
|
-
export { ToolInfoV2 as ToolInfoV2_alias_1 }
|
|
1385
|
-
|
|
1386
656
|
declare type ToolParameter = {
|
|
1387
657
|
name: string;
|
|
1388
658
|
description: string;
|
|
@@ -1400,29 +670,18 @@ declare type ToolParameterValue = string | {
|
|
|
1400
670
|
export { ToolParameterValue }
|
|
1401
671
|
export { ToolParameterValue as ToolParameterValue_alias_1 }
|
|
1402
672
|
|
|
1403
|
-
declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider
|
|
673
|
+
declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider & Partial<MemoryProvider>;
|
|
1404
674
|
export { ToolProvider }
|
|
1405
675
|
export { ToolProvider as ToolProvider_alias_1 }
|
|
1406
676
|
export { ToolProvider as ToolProvider_alias_2 }
|
|
1407
677
|
|
|
1408
|
-
declare type ToolResponse = ToolResponseReply | ToolResponseExit |
|
|
678
|
+
declare type ToolResponse = ToolResponseReply | ToolResponseExit | ToolResponseError;
|
|
1409
679
|
export { ToolResponse }
|
|
1410
680
|
export { ToolResponse as ToolResponse_alias_1 }
|
|
1411
681
|
|
|
1412
|
-
declare type ToolResponseDelegate = {
|
|
1413
|
-
type: ToolResponseType.Delegate;
|
|
1414
|
-
agentName: string;
|
|
1415
|
-
task: string;
|
|
1416
|
-
context?: string;
|
|
1417
|
-
files?: string[];
|
|
1418
|
-
};
|
|
1419
|
-
export { ToolResponseDelegate }
|
|
1420
|
-
export { ToolResponseDelegate as ToolResponseDelegate_alias_1 }
|
|
1421
|
-
|
|
1422
682
|
declare type ToolResponseError = {
|
|
1423
683
|
type: ToolResponseType.Error;
|
|
1424
684
|
message: ToolResponseResult;
|
|
1425
|
-
canRetry?: boolean;
|
|
1426
685
|
};
|
|
1427
686
|
export { ToolResponseError }
|
|
1428
687
|
export { ToolResponseError as ToolResponseError_alias_1 }
|
|
@@ -1435,52 +694,6 @@ declare type ToolResponseExit = {
|
|
|
1435
694
|
export { ToolResponseExit }
|
|
1436
695
|
export { ToolResponseExit as ToolResponseExit_alias_1 }
|
|
1437
696
|
|
|
1438
|
-
declare type ToolResponseHandOver = {
|
|
1439
|
-
type: ToolResponseType.HandOver;
|
|
1440
|
-
agentName: string;
|
|
1441
|
-
task: string;
|
|
1442
|
-
context?: string;
|
|
1443
|
-
files?: string[];
|
|
1444
|
-
};
|
|
1445
|
-
export { ToolResponseHandOver }
|
|
1446
|
-
export { ToolResponseHandOver as ToolResponseHandOver_alias_1 }
|
|
1447
|
-
|
|
1448
|
-
declare type ToolResponseInterrupted = {
|
|
1449
|
-
type: ToolResponseType.Interrupted;
|
|
1450
|
-
message: string;
|
|
1451
|
-
};
|
|
1452
|
-
export { ToolResponseInterrupted }
|
|
1453
|
-
export { ToolResponseInterrupted as ToolResponseInterrupted_alias_1 }
|
|
1454
|
-
|
|
1455
|
-
declare type ToolResponseInvalid = {
|
|
1456
|
-
type: ToolResponseType.Invalid;
|
|
1457
|
-
message: ToolResponseResult;
|
|
1458
|
-
};
|
|
1459
|
-
export { ToolResponseInvalid }
|
|
1460
|
-
export { ToolResponseInvalid as ToolResponseInvalid_alias_1 }
|
|
1461
|
-
|
|
1462
|
-
declare type ToolResponseOrToolPause = {
|
|
1463
|
-
type: 'response';
|
|
1464
|
-
tool: string;
|
|
1465
|
-
response: LanguageModelV2ToolResultOutput;
|
|
1466
|
-
id?: string;
|
|
1467
|
-
} | {
|
|
1468
|
-
type: 'pause';
|
|
1469
|
-
tool: string;
|
|
1470
|
-
object: any;
|
|
1471
|
-
id?: string;
|
|
1472
|
-
};
|
|
1473
|
-
export { ToolResponseOrToolPause }
|
|
1474
|
-
export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_1 }
|
|
1475
|
-
export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_2 }
|
|
1476
|
-
|
|
1477
|
-
declare type ToolResponsePause = {
|
|
1478
|
-
type: ToolResponseType.Pause;
|
|
1479
|
-
object: any;
|
|
1480
|
-
};
|
|
1481
|
-
export { ToolResponsePause }
|
|
1482
|
-
export { ToolResponsePause as ToolResponsePause_alias_1 }
|
|
1483
|
-
|
|
1484
697
|
declare type ToolResponseReply = {
|
|
1485
698
|
type: ToolResponseType.Reply;
|
|
1486
699
|
message: ToolResponseResult;
|
|
@@ -1522,31 +735,11 @@ export { ToolResponseResultMedia as ToolResponseResultMedia_alias_1 }
|
|
|
1522
735
|
declare enum ToolResponseType {
|
|
1523
736
|
Reply = "Reply",
|
|
1524
737
|
Exit = "Exit",
|
|
1525
|
-
|
|
1526
|
-
Error = "Error",
|
|
1527
|
-
Interrupted = "Interrupted",
|
|
1528
|
-
HandOver = "HandOver",
|
|
1529
|
-
Delegate = "Delegate",
|
|
1530
|
-
Pause = "Pause"
|
|
738
|
+
Error = "Error"
|
|
1531
739
|
}
|
|
1532
740
|
export { ToolResponseType }
|
|
1533
741
|
export { ToolResponseType as ToolResponseType_alias_1 }
|
|
1534
742
|
|
|
1535
|
-
declare interface ToolUse {
|
|
1536
|
-
id?: string;
|
|
1537
|
-
type: 'tool_use';
|
|
1538
|
-
name: string;
|
|
1539
|
-
params: Record<string, any>;
|
|
1540
|
-
}
|
|
1541
|
-
export { ToolUse }
|
|
1542
|
-
export { ToolUse as ToolUse_alias_1 }
|
|
1543
|
-
export { ToolUse as ToolUse_alias_2 }
|
|
1544
|
-
|
|
1545
|
-
declare const toolUsePrompt: (useNativeTool: boolean, tools: FullToolInfoV2[], toolNamePrefix: string) => string;
|
|
1546
|
-
export { toolUsePrompt }
|
|
1547
|
-
export { toolUsePrompt as toolUsePrompt_alias_1 }
|
|
1548
|
-
export { toolUsePrompt as toolUsePrompt_alias_2 }
|
|
1549
|
-
|
|
1550
743
|
declare type Totals = {
|
|
1551
744
|
input: number;
|
|
1552
745
|
output: number;
|
|
@@ -1555,17 +748,6 @@ declare type Totals = {
|
|
|
1555
748
|
messageCount: number;
|
|
1556
749
|
};
|
|
1557
750
|
|
|
1558
|
-
export declare function toToolInfoV1(tool: FullToolInfoV2): FullToolInfo;
|
|
1559
|
-
|
|
1560
|
-
declare const TruncateContextPolicy: () => {
|
|
1561
|
-
name: Policies;
|
|
1562
|
-
onBeforeRequest(agent: AgentBase): Promise<void>;
|
|
1563
|
-
};
|
|
1564
|
-
export { TruncateContextPolicy }
|
|
1565
|
-
export { TruncateContextPolicy as TruncateContextPolicy_alias_1 }
|
|
1566
|
-
export { TruncateContextPolicy as TruncateContextPolicy_alias_2 }
|
|
1567
|
-
export { TruncateContextPolicy as TruncateContextPolicy_alias_3 }
|
|
1568
|
-
|
|
1569
751
|
/**
|
|
1570
752
|
* Tracks token / cost usage across any mix of LLM models.
|
|
1571
753
|
* Supports optional caps on total messages and total cost.
|