@polka-codes/core 0.7.1 → 0.7.3
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.cts +2453 -0
- package/dist/index.cjs +3457 -0
- package/dist/index.d.cts +97 -0
- package/package.json +2 -2
- package/dist/index.js +0 -16229
|
@@ -0,0 +1,2453 @@
|
|
|
1
|
+
import type { Anthropic } from '@anthropic-ai/sdk';
|
|
2
|
+
import type OpenAI from 'openai';
|
|
3
|
+
|
|
4
|
+
declare abstract class AgentBase {
|
|
5
|
+
#private;
|
|
6
|
+
protected readonly ai: AiServiceBase;
|
|
7
|
+
protected readonly config: Readonly<AgentBaseConfig>;
|
|
8
|
+
protected readonly handlers: Record<string, FullToolInfo>;
|
|
9
|
+
protected readonly messages: MessageParam[];
|
|
10
|
+
constructor(name: string, ai: AiServiceBase, config: AgentBaseConfig);
|
|
11
|
+
startTask({ task, context }: {
|
|
12
|
+
task: string;
|
|
13
|
+
context?: string;
|
|
14
|
+
}): Promise<ExitReason>;
|
|
15
|
+
continueTask(userMessage: string): Promise<ExitReason>;
|
|
16
|
+
protected abstract onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
17
|
+
get model(): {
|
|
18
|
+
provider: string;
|
|
19
|
+
id: string;
|
|
20
|
+
info: ModelInfo;
|
|
21
|
+
};
|
|
22
|
+
get usage(): ApiUsage;
|
|
23
|
+
}
|
|
24
|
+
export { AgentBase }
|
|
25
|
+
export { AgentBase as AgentBase_alias_1 }
|
|
26
|
+
export { AgentBase as AgentBase_alias_2 }
|
|
27
|
+
|
|
28
|
+
declare type AgentBaseConfig = {
|
|
29
|
+
systemPrompt: string;
|
|
30
|
+
tools: FullToolInfo[];
|
|
31
|
+
toolNamePrefix: string;
|
|
32
|
+
provider: ToolProvider;
|
|
33
|
+
interactive: boolean;
|
|
34
|
+
agents?: Readonly<AgentInfo[]>;
|
|
35
|
+
scripts?: Record<string, string | {
|
|
36
|
+
command: string;
|
|
37
|
+
description: string;
|
|
38
|
+
}>;
|
|
39
|
+
callback?: TaskEventCallback;
|
|
40
|
+
};
|
|
41
|
+
export { AgentBaseConfig }
|
|
42
|
+
export { AgentBaseConfig as AgentBaseConfig_alias_1 }
|
|
43
|
+
export { AgentBaseConfig as AgentBaseConfig_alias_2 }
|
|
44
|
+
|
|
45
|
+
declare type AgentInfo = {
|
|
46
|
+
name: string;
|
|
47
|
+
responsibilities: string[];
|
|
48
|
+
};
|
|
49
|
+
export { AgentInfo }
|
|
50
|
+
export { AgentInfo as AgentInfo_alias_1 }
|
|
51
|
+
export { AgentInfo as AgentInfo_alias_2 }
|
|
52
|
+
|
|
53
|
+
declare type AgentNameType = (typeof allAgents)[number]['name'];
|
|
54
|
+
export { AgentNameType }
|
|
55
|
+
export { AgentNameType as AgentNameType_alias_1 }
|
|
56
|
+
|
|
57
|
+
export declare const agentsPrompt: (agents: Readonly<AgentInfo[]>, name: string) => string;
|
|
58
|
+
|
|
59
|
+
declare abstract class AiServiceBase {
|
|
60
|
+
readonly usageMeter: UsageMeter;
|
|
61
|
+
constructor(usageMeter: UsageMeter);
|
|
62
|
+
abstract get model(): {
|
|
63
|
+
provider: string;
|
|
64
|
+
id: string;
|
|
65
|
+
info: ModelInfo;
|
|
66
|
+
};
|
|
67
|
+
abstract sendImpl(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
68
|
+
send(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
69
|
+
request(systemPrompt: string, messages: MessageParam[]): Promise<{
|
|
70
|
+
response: string;
|
|
71
|
+
reasoning: string;
|
|
72
|
+
usage: ApiUsage;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
export { AiServiceBase }
|
|
76
|
+
export { AiServiceBase as AiServiceBase_alias_1 }
|
|
77
|
+
export { AiServiceBase as AiServiceBase_alias_2 }
|
|
78
|
+
|
|
79
|
+
declare interface AiServiceOptions {
|
|
80
|
+
model?: string;
|
|
81
|
+
apiKey?: string;
|
|
82
|
+
baseUrl?: string;
|
|
83
|
+
usageMeter: UsageMeter;
|
|
84
|
+
enableCache?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export { AiServiceOptions }
|
|
87
|
+
export { AiServiceOptions as AiServiceOptions_alias_1 }
|
|
88
|
+
export { AiServiceOptions as AiServiceOptions_alias_2 }
|
|
89
|
+
|
|
90
|
+
declare enum AiServiceProvider {
|
|
91
|
+
Anthropic = "anthropic",
|
|
92
|
+
Ollama = "ollama",
|
|
93
|
+
DeepSeek = "deepseek",
|
|
94
|
+
OpenRouter = "openrouter"
|
|
95
|
+
}
|
|
96
|
+
export { AiServiceProvider }
|
|
97
|
+
export { AiServiceProvider as AiServiceProvider_alias_1 }
|
|
98
|
+
|
|
99
|
+
declare type AiToolDefinition<Input, Output = string> = {
|
|
100
|
+
name: string;
|
|
101
|
+
description: string;
|
|
102
|
+
prompt: string;
|
|
103
|
+
formatInput: (params: Input) => string;
|
|
104
|
+
parseOutput: (output: string) => Output;
|
|
105
|
+
agent?: AgentNameType;
|
|
106
|
+
};
|
|
107
|
+
export { AiToolDefinition }
|
|
108
|
+
export { AiToolDefinition as AiToolDefinition_alias_1 }
|
|
109
|
+
export { AiToolDefinition as AiToolDefinition_alias_2 }
|
|
110
|
+
|
|
111
|
+
declare const allAgents: readonly [{
|
|
112
|
+
readonly name: "architect";
|
|
113
|
+
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."];
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "coder";
|
|
116
|
+
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."];
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "analyzer";
|
|
119
|
+
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"];
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "codefixer";
|
|
122
|
+
readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
|
|
123
|
+
}];
|
|
124
|
+
export { allAgents }
|
|
125
|
+
export { allAgents as allAgents_alias_1 }
|
|
126
|
+
|
|
127
|
+
export declare namespace allTools {
|
|
128
|
+
export {
|
|
129
|
+
_default as askFollowupQuestion,
|
|
130
|
+
_default_2 as attemptCompletion,
|
|
131
|
+
_default_3 as delegate,
|
|
132
|
+
_default_4 as executeCommand,
|
|
133
|
+
_default_5 as listCodeDefinitionNames,
|
|
134
|
+
_default_6 as listFiles,
|
|
135
|
+
_default_7 as readFile,
|
|
136
|
+
_default_8 as replaceInFile,
|
|
137
|
+
_default_9 as searchFiles,
|
|
138
|
+
_default_10 as writeToFile,
|
|
139
|
+
_default_11 as handOver,
|
|
140
|
+
_default_12 as removeFile,
|
|
141
|
+
_default_13 as renameFile
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare class AnalyzerAgent extends AgentBase {
|
|
146
|
+
constructor(options: AnalyzerAgentOptions);
|
|
147
|
+
onBeforeInvokeTool(): Promise<undefined>;
|
|
148
|
+
}
|
|
149
|
+
export { AnalyzerAgent }
|
|
150
|
+
export { AnalyzerAgent as AnalyzerAgent_alias_1 }
|
|
151
|
+
export { AnalyzerAgent as AnalyzerAgent_alias_2 }
|
|
152
|
+
|
|
153
|
+
declare const analyzerAgentInfo: {
|
|
154
|
+
readonly name: "analyzer";
|
|
155
|
+
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"];
|
|
156
|
+
};
|
|
157
|
+
export { analyzerAgentInfo }
|
|
158
|
+
export { analyzerAgentInfo as analyzerAgentInfo_alias_1 }
|
|
159
|
+
export { analyzerAgentInfo as analyzerAgentInfo_alias_2 }
|
|
160
|
+
|
|
161
|
+
declare type AnalyzerAgentOptions = SharedAgentOptions;
|
|
162
|
+
export { AnalyzerAgentOptions }
|
|
163
|
+
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_1 }
|
|
164
|
+
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_2 }
|
|
165
|
+
|
|
166
|
+
declare const anthropicDefaultModelId: AnthropicModelId;
|
|
167
|
+
export { anthropicDefaultModelId }
|
|
168
|
+
export { anthropicDefaultModelId as anthropicDefaultModelId_alias_1 }
|
|
169
|
+
|
|
170
|
+
declare type AnthropicModelId = keyof typeof anthropicModels;
|
|
171
|
+
export { AnthropicModelId }
|
|
172
|
+
export { AnthropicModelId as AnthropicModelId_alias_1 }
|
|
173
|
+
|
|
174
|
+
declare const anthropicModels: {
|
|
175
|
+
readonly 'claude-3-7-sonnet-20250219': {
|
|
176
|
+
readonly maxTokens: 8192;
|
|
177
|
+
readonly contextWindow: 200000;
|
|
178
|
+
readonly supportsImages: true;
|
|
179
|
+
readonly supportsComputerUse: true;
|
|
180
|
+
readonly supportsPromptCache: true;
|
|
181
|
+
readonly inputPrice: 3;
|
|
182
|
+
readonly outputPrice: 15;
|
|
183
|
+
readonly cacheWritesPrice: 3.75;
|
|
184
|
+
readonly cacheReadsPrice: 0.3;
|
|
185
|
+
};
|
|
186
|
+
readonly 'claude-3-5-sonnet-20241022': {
|
|
187
|
+
readonly maxTokens: 8192;
|
|
188
|
+
readonly contextWindow: 200000;
|
|
189
|
+
readonly supportsImages: true;
|
|
190
|
+
readonly supportsComputerUse: true;
|
|
191
|
+
readonly supportsPromptCache: true;
|
|
192
|
+
readonly inputPrice: 3;
|
|
193
|
+
readonly outputPrice: 15;
|
|
194
|
+
readonly cacheWritesPrice: 3.75;
|
|
195
|
+
readonly cacheReadsPrice: 0.3;
|
|
196
|
+
};
|
|
197
|
+
readonly 'claude-3-5-haiku-20241022': {
|
|
198
|
+
readonly maxTokens: 8192;
|
|
199
|
+
readonly contextWindow: 200000;
|
|
200
|
+
readonly supportsImages: false;
|
|
201
|
+
readonly supportsPromptCache: true;
|
|
202
|
+
readonly inputPrice: 0.8;
|
|
203
|
+
readonly outputPrice: 4;
|
|
204
|
+
readonly cacheWritesPrice: 1;
|
|
205
|
+
readonly cacheReadsPrice: 0.08;
|
|
206
|
+
};
|
|
207
|
+
readonly 'claude-3-opus-20240229': {
|
|
208
|
+
readonly maxTokens: 4096;
|
|
209
|
+
readonly contextWindow: 200000;
|
|
210
|
+
readonly supportsImages: true;
|
|
211
|
+
readonly supportsPromptCache: true;
|
|
212
|
+
readonly inputPrice: 15;
|
|
213
|
+
readonly outputPrice: 75;
|
|
214
|
+
readonly cacheWritesPrice: 18.75;
|
|
215
|
+
readonly cacheReadsPrice: 1.5;
|
|
216
|
+
};
|
|
217
|
+
readonly 'claude-3-haiku-20240307': {
|
|
218
|
+
readonly maxTokens: 4096;
|
|
219
|
+
readonly contextWindow: 200000;
|
|
220
|
+
readonly supportsImages: true;
|
|
221
|
+
readonly supportsPromptCache: true;
|
|
222
|
+
readonly inputPrice: 0.25;
|
|
223
|
+
readonly outputPrice: 1.25;
|
|
224
|
+
readonly cacheWritesPrice: 0.3;
|
|
225
|
+
readonly cacheReadsPrice: 0.03;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
export { anthropicModels }
|
|
229
|
+
export { anthropicModels as anthropicModels_alias_1 }
|
|
230
|
+
|
|
231
|
+
export declare class AnthropicService extends AiServiceBase {
|
|
232
|
+
#private;
|
|
233
|
+
readonly model: {
|
|
234
|
+
provider: 'anthropic';
|
|
235
|
+
id: AnthropicModelId;
|
|
236
|
+
info: ModelInfo;
|
|
237
|
+
};
|
|
238
|
+
constructor(options: AiServiceOptions);
|
|
239
|
+
sendImpl(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export declare type ApiStream = AsyncGenerator<ApiStreamChunk>;
|
|
243
|
+
|
|
244
|
+
export declare type ApiStreamChunk = ApiStreamTextChunk | ApiStreamUsageChunk | ApiStreamReasoningTextChunk;
|
|
245
|
+
|
|
246
|
+
export declare interface ApiStreamReasoningTextChunk {
|
|
247
|
+
type: 'reasoning';
|
|
248
|
+
text: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export declare interface ApiStreamTextChunk {
|
|
252
|
+
type: 'text';
|
|
253
|
+
text: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export declare interface ApiStreamUsageChunk extends Partial<ApiUsage> {
|
|
257
|
+
type: 'usage';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare type ApiUsage = {
|
|
261
|
+
inputTokens: number;
|
|
262
|
+
outputTokens: number;
|
|
263
|
+
cacheWriteTokens: number;
|
|
264
|
+
cacheReadTokens: number;
|
|
265
|
+
totalCost?: number;
|
|
266
|
+
};
|
|
267
|
+
export { ApiUsage }
|
|
268
|
+
export { ApiUsage as ApiUsage_alias_1 }
|
|
269
|
+
export { ApiUsage as ApiUsage_alias_2 }
|
|
270
|
+
|
|
271
|
+
declare class ArchitectAgent extends AgentBase {
|
|
272
|
+
constructor(options: ArchitectAgentOptions);
|
|
273
|
+
onBeforeInvokeTool(): Promise<undefined>;
|
|
274
|
+
}
|
|
275
|
+
export { ArchitectAgent }
|
|
276
|
+
export { ArchitectAgent as ArchitectAgent_alias_1 }
|
|
277
|
+
export { ArchitectAgent as ArchitectAgent_alias_2 }
|
|
278
|
+
|
|
279
|
+
declare const architectAgentInfo: {
|
|
280
|
+
readonly name: "architect";
|
|
281
|
+
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."];
|
|
282
|
+
};
|
|
283
|
+
export { architectAgentInfo }
|
|
284
|
+
export { architectAgentInfo as architectAgentInfo_alias_1 }
|
|
285
|
+
export { architectAgentInfo as architectAgentInfo_alias_2 }
|
|
286
|
+
|
|
287
|
+
declare type ArchitectAgentOptions = SharedAgentOptions;
|
|
288
|
+
export { ArchitectAgentOptions }
|
|
289
|
+
export { ArchitectAgentOptions as ArchitectAgentOptions_alias_1 }
|
|
290
|
+
export { ArchitectAgentOptions as ArchitectAgentOptions_alias_2 }
|
|
291
|
+
|
|
292
|
+
export declare type AssistantMessageContent = TextContent | ToolUse;
|
|
293
|
+
|
|
294
|
+
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";
|
|
295
|
+
|
|
296
|
+
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.";
|
|
297
|
+
|
|
298
|
+
export declare const capabilities: (toolNamePrefix: string) => string;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* CodeFixer agent for fixing code issues like type errors and failing tests.
|
|
302
|
+
* Using Scripts: format, check, test
|
|
303
|
+
*/
|
|
304
|
+
declare class CodeFixerAgent extends AgentBase {
|
|
305
|
+
#private;
|
|
306
|
+
constructor(options: CodeFixerAgentOptions);
|
|
307
|
+
protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
308
|
+
}
|
|
309
|
+
export { CodeFixerAgent }
|
|
310
|
+
export { CodeFixerAgent as CodeFixerAgent_alias_1 }
|
|
311
|
+
export { CodeFixerAgent as CodeFixerAgent_alias_2 }
|
|
312
|
+
|
|
313
|
+
declare const codeFixerAgentInfo: {
|
|
314
|
+
readonly name: "codefixer";
|
|
315
|
+
readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
|
|
316
|
+
};
|
|
317
|
+
export { codeFixerAgentInfo }
|
|
318
|
+
export { codeFixerAgentInfo as codeFixerAgentInfo_alias_1 }
|
|
319
|
+
export { codeFixerAgentInfo as codeFixerAgentInfo_alias_2 }
|
|
320
|
+
|
|
321
|
+
declare type CodeFixerAgentOptions = SharedAgentOptions & {
|
|
322
|
+
maxRetries?: number;
|
|
323
|
+
};
|
|
324
|
+
export { CodeFixerAgentOptions }
|
|
325
|
+
export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_1 }
|
|
326
|
+
export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_2 }
|
|
327
|
+
|
|
328
|
+
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";
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Coder agent for writing code.
|
|
332
|
+
* Using Scripts: format, check, test
|
|
333
|
+
*/
|
|
334
|
+
declare class CoderAgent extends AgentBase {
|
|
335
|
+
constructor(options: CoderAgentOptions);
|
|
336
|
+
protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
337
|
+
}
|
|
338
|
+
export { CoderAgent }
|
|
339
|
+
export { CoderAgent as CoderAgent_alias_1 }
|
|
340
|
+
export { CoderAgent as CoderAgent_alias_2 }
|
|
341
|
+
|
|
342
|
+
declare const coderAgentInfo: {
|
|
343
|
+
readonly name: "coder";
|
|
344
|
+
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."];
|
|
345
|
+
};
|
|
346
|
+
export { coderAgentInfo }
|
|
347
|
+
export { coderAgentInfo as coderAgentInfo_alias_1 }
|
|
348
|
+
export { coderAgentInfo as coderAgentInfo_alias_2 }
|
|
349
|
+
|
|
350
|
+
declare type CoderAgentOptions = SharedAgentOptions;
|
|
351
|
+
export { CoderAgentOptions }
|
|
352
|
+
export { CoderAgentOptions as CoderAgentOptions_alias_1 }
|
|
353
|
+
export { CoderAgentOptions as CoderAgentOptions_alias_2 }
|
|
354
|
+
|
|
355
|
+
declare type CommandProvider = {
|
|
356
|
+
executeCommand?: (command: string, needApprove: boolean) => Promise<{
|
|
357
|
+
stdout: string;
|
|
358
|
+
stderr: string;
|
|
359
|
+
exitCode: number;
|
|
360
|
+
}>;
|
|
361
|
+
};
|
|
362
|
+
export { CommandProvider }
|
|
363
|
+
export { CommandProvider as CommandProvider_alias_1 }
|
|
364
|
+
export { CommandProvider as CommandProvider_alias_2 }
|
|
365
|
+
|
|
366
|
+
export declare function convertToAnthropicMessage(completion: OpenAI.Chat.Completions.ChatCompletion): Anthropic.Messages.Message;
|
|
367
|
+
|
|
368
|
+
export declare function convertToOpenAiMessages(anthropicMessages: Anthropic.Messages.MessageParam[]): OpenAI.Chat.ChatCompletionMessageParam[];
|
|
369
|
+
|
|
370
|
+
declare const createNewProject: (agent: MultiAgent, params: string) => Promise<string>;
|
|
371
|
+
export { createNewProject }
|
|
372
|
+
export { createNewProject as createNewProject_alias_1 }
|
|
373
|
+
|
|
374
|
+
declare const createService: (provider: AiServiceProvider, options: AiServiceOptions) => AnthropicService | DeepSeekService | OllamaService | OpenRouterService;
|
|
375
|
+
export { createService }
|
|
376
|
+
export { createService as createService_alias_1 }
|
|
377
|
+
|
|
378
|
+
export declare const customInstructions: (customInstructions: string[]) => string;
|
|
379
|
+
|
|
380
|
+
export declare const customScripts: (commands: Record<string, string | {
|
|
381
|
+
command: string;
|
|
382
|
+
description: string;
|
|
383
|
+
}>) => string;
|
|
384
|
+
|
|
385
|
+
declare const deepSeekDefaultModelId: DeepSeekModelId;
|
|
386
|
+
export { deepSeekDefaultModelId }
|
|
387
|
+
export { deepSeekDefaultModelId as deepSeekDefaultModelId_alias_1 }
|
|
388
|
+
|
|
389
|
+
declare type DeepSeekModelId = keyof typeof deepSeekModels;
|
|
390
|
+
export { DeepSeekModelId }
|
|
391
|
+
export { DeepSeekModelId as DeepSeekModelId_alias_1 }
|
|
392
|
+
|
|
393
|
+
declare const deepSeekModels: {
|
|
394
|
+
readonly 'deepseek-chat': {
|
|
395
|
+
readonly maxTokens: 8000;
|
|
396
|
+
readonly contextWindow: 64000;
|
|
397
|
+
readonly supportsImages: false;
|
|
398
|
+
readonly supportsPromptCache: true;
|
|
399
|
+
readonly inputPrice: 0;
|
|
400
|
+
readonly outputPrice: 1.1;
|
|
401
|
+
readonly cacheWritesPrice: 0.27;
|
|
402
|
+
readonly cacheReadsPrice: 0.07;
|
|
403
|
+
};
|
|
404
|
+
readonly 'deepseek-reasoner': {
|
|
405
|
+
readonly maxTokens: 8000;
|
|
406
|
+
readonly contextWindow: 64000;
|
|
407
|
+
readonly supportsImages: false;
|
|
408
|
+
readonly supportsPromptCache: true;
|
|
409
|
+
readonly inputPrice: 0;
|
|
410
|
+
readonly outputPrice: 2.19;
|
|
411
|
+
readonly cacheWritesPrice: 0.55;
|
|
412
|
+
readonly cacheReadsPrice: 0.14;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
export { deepSeekModels }
|
|
416
|
+
export { deepSeekModels as deepSeekModels_alias_1 }
|
|
417
|
+
|
|
418
|
+
export declare class DeepSeekService extends AiServiceBase {
|
|
419
|
+
#private;
|
|
420
|
+
readonly model: {
|
|
421
|
+
provider: string;
|
|
422
|
+
id: string;
|
|
423
|
+
info: ModelInfo;
|
|
424
|
+
};
|
|
425
|
+
constructor(options: AiServiceOptions);
|
|
426
|
+
sendImpl(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare const _default: {
|
|
430
|
+
handler: ToolHandler<{
|
|
431
|
+
readonly name: "ask_followup_question";
|
|
432
|
+
readonly description: "Whenever you need extra details or clarification to complete the task, pose a direct question to the user. Use this tool sparingly to avoid excessive back-and-forth. If helpful, offer multiple-choice options or examples to guide the user’s response.";
|
|
433
|
+
readonly parameters: [{
|
|
434
|
+
readonly name: "question";
|
|
435
|
+
readonly description: "The question to ask the user. This should be a clear, specific question that addresses the information you need.";
|
|
436
|
+
readonly required: true;
|
|
437
|
+
readonly usageValue: "Your question here";
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "options";
|
|
440
|
+
readonly description: "A comma separated list of possible answers to the question. Ordered by preference. If not provided, the user will be prompted to provide an answer.";
|
|
441
|
+
readonly required: false;
|
|
442
|
+
readonly usageValue: "A comma separated list of possible answers (optional)";
|
|
443
|
+
}];
|
|
444
|
+
readonly examples: [{
|
|
445
|
+
readonly description: "Request to ask a question";
|
|
446
|
+
readonly parameters: [{
|
|
447
|
+
readonly name: "question";
|
|
448
|
+
readonly value: "What is the name of the project?";
|
|
449
|
+
}];
|
|
450
|
+
}, {
|
|
451
|
+
readonly description: "Request to ask a question with options";
|
|
452
|
+
readonly parameters: [{
|
|
453
|
+
readonly name: "question";
|
|
454
|
+
readonly value: "What framework do you use?";
|
|
455
|
+
}, {
|
|
456
|
+
readonly name: "options";
|
|
457
|
+
readonly value: "React,Angular,Vue,Svelte";
|
|
458
|
+
}];
|
|
459
|
+
}];
|
|
460
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
461
|
+
}, InteractionProvider>;
|
|
462
|
+
isAvailable: (provider: InteractionProvider) => boolean;
|
|
463
|
+
name: "ask_followup_question";
|
|
464
|
+
description: "Whenever you need extra details or clarification to complete the task, pose a direct question to the user. Use this tool sparingly to avoid excessive back-and-forth. If helpful, offer multiple-choice options or examples to guide the user’s response.";
|
|
465
|
+
parameters: [{
|
|
466
|
+
readonly name: "question";
|
|
467
|
+
readonly description: "The question to ask the user. This should be a clear, specific question that addresses the information you need.";
|
|
468
|
+
readonly required: true;
|
|
469
|
+
readonly usageValue: "Your question here";
|
|
470
|
+
}, {
|
|
471
|
+
readonly name: "options";
|
|
472
|
+
readonly description: "A comma separated list of possible answers to the question. Ordered by preference. If not provided, the user will be prompted to provide an answer.";
|
|
473
|
+
readonly required: false;
|
|
474
|
+
readonly usageValue: "A comma separated list of possible answers (optional)";
|
|
475
|
+
}];
|
|
476
|
+
examples: [{
|
|
477
|
+
readonly description: "Request to ask a question";
|
|
478
|
+
readonly parameters: [{
|
|
479
|
+
readonly name: "question";
|
|
480
|
+
readonly value: "What is the name of the project?";
|
|
481
|
+
}];
|
|
482
|
+
}, {
|
|
483
|
+
readonly description: "Request to ask a question with options";
|
|
484
|
+
readonly parameters: [{
|
|
485
|
+
readonly name: "question";
|
|
486
|
+
readonly value: "What framework do you use?";
|
|
487
|
+
}, {
|
|
488
|
+
readonly name: "options";
|
|
489
|
+
readonly value: "React,Angular,Vue,Svelte";
|
|
490
|
+
}];
|
|
491
|
+
}];
|
|
492
|
+
permissionLevel: PermissionLevel.None;
|
|
493
|
+
};
|
|
494
|
+
export { _default as askFollowupQuestion }
|
|
495
|
+
export { _default as askFollowupQuestion_alias_1 }
|
|
496
|
+
export { _default as askFollowupQuestion_alias_2 }
|
|
497
|
+
export { _default as default_alias_4 }
|
|
498
|
+
|
|
499
|
+
declare const _default_10: {
|
|
500
|
+
handler: ToolHandler<{
|
|
501
|
+
readonly name: "write_to_file";
|
|
502
|
+
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.";
|
|
503
|
+
readonly parameters: [{
|
|
504
|
+
readonly name: "path";
|
|
505
|
+
readonly description: "The path of the file to write to";
|
|
506
|
+
readonly required: true;
|
|
507
|
+
readonly usageValue: "File path here";
|
|
508
|
+
}, {
|
|
509
|
+
readonly name: "content";
|
|
510
|
+
readonly description: "The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.";
|
|
511
|
+
readonly required: true;
|
|
512
|
+
readonly usageValue: "Your file content here";
|
|
513
|
+
}];
|
|
514
|
+
readonly examples: [{
|
|
515
|
+
readonly description: "Request to write content to a file";
|
|
516
|
+
readonly parameters: [{
|
|
517
|
+
readonly name: "path";
|
|
518
|
+
readonly value: "src/main.js";
|
|
519
|
+
}, {
|
|
520
|
+
readonly name: "content";
|
|
521
|
+
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
522
|
+
}];
|
|
523
|
+
}];
|
|
524
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
525
|
+
}, FilesystemProvider>;
|
|
526
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
527
|
+
name: "write_to_file";
|
|
528
|
+
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.";
|
|
529
|
+
parameters: [{
|
|
530
|
+
readonly name: "path";
|
|
531
|
+
readonly description: "The path of the file to write to";
|
|
532
|
+
readonly required: true;
|
|
533
|
+
readonly usageValue: "File path here";
|
|
534
|
+
}, {
|
|
535
|
+
readonly name: "content";
|
|
536
|
+
readonly description: "The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.";
|
|
537
|
+
readonly required: true;
|
|
538
|
+
readonly usageValue: "Your file content here";
|
|
539
|
+
}];
|
|
540
|
+
examples: [{
|
|
541
|
+
readonly description: "Request to write content to a file";
|
|
542
|
+
readonly parameters: [{
|
|
543
|
+
readonly name: "path";
|
|
544
|
+
readonly value: "src/main.js";
|
|
545
|
+
}, {
|
|
546
|
+
readonly name: "content";
|
|
547
|
+
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
548
|
+
}];
|
|
549
|
+
}];
|
|
550
|
+
permissionLevel: PermissionLevel.Write;
|
|
551
|
+
};
|
|
552
|
+
export { _default_10 as default_alias_16 }
|
|
553
|
+
export { _default_10 as writeToFile }
|
|
554
|
+
export { _default_10 as writeToFile_alias_1 }
|
|
555
|
+
export { _default_10 as writeToFile_alias_2 }
|
|
556
|
+
|
|
557
|
+
declare const _default_11: {
|
|
558
|
+
handler: ToolHandler<{
|
|
559
|
+
readonly name: "hand_over";
|
|
560
|
+
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
561
|
+
readonly parameters: [{
|
|
562
|
+
readonly name: "agent_name";
|
|
563
|
+
readonly description: "The name of the agent to hand over the task to";
|
|
564
|
+
readonly required: true;
|
|
565
|
+
readonly usageValue: "Name of the target agent";
|
|
566
|
+
}, {
|
|
567
|
+
readonly name: "task";
|
|
568
|
+
readonly description: "The task to be completed by the target agent";
|
|
569
|
+
readonly required: true;
|
|
570
|
+
readonly usageValue: "Task description";
|
|
571
|
+
}, {
|
|
572
|
+
readonly name: "context";
|
|
573
|
+
readonly description: "The context information for the task";
|
|
574
|
+
readonly required: true;
|
|
575
|
+
readonly usageValue: "Context information";
|
|
576
|
+
}, {
|
|
577
|
+
readonly name: "files";
|
|
578
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
579
|
+
readonly required: false;
|
|
580
|
+
readonly usageValue: "Relevant files";
|
|
581
|
+
}];
|
|
582
|
+
readonly examples: [{
|
|
583
|
+
readonly description: "Hand over a coding task to the coder agent";
|
|
584
|
+
readonly parameters: [{
|
|
585
|
+
readonly name: "agent_name";
|
|
586
|
+
readonly value: "coder";
|
|
587
|
+
}, {
|
|
588
|
+
readonly name: "task";
|
|
589
|
+
readonly value: "Implement the login feature";
|
|
590
|
+
}, {
|
|
591
|
+
readonly name: "context";
|
|
592
|
+
readonly value: "We need a secure login system with email and password";
|
|
593
|
+
}, {
|
|
594
|
+
readonly name: "files";
|
|
595
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
596
|
+
}];
|
|
597
|
+
}];
|
|
598
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
599
|
+
}, any>;
|
|
600
|
+
isAvailable: (_provider: any) => boolean;
|
|
601
|
+
name: "hand_over";
|
|
602
|
+
description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
603
|
+
parameters: [{
|
|
604
|
+
readonly name: "agent_name";
|
|
605
|
+
readonly description: "The name of the agent to hand over the task to";
|
|
606
|
+
readonly required: true;
|
|
607
|
+
readonly usageValue: "Name of the target agent";
|
|
608
|
+
}, {
|
|
609
|
+
readonly name: "task";
|
|
610
|
+
readonly description: "The task to be completed by the target agent";
|
|
611
|
+
readonly required: true;
|
|
612
|
+
readonly usageValue: "Task description";
|
|
613
|
+
}, {
|
|
614
|
+
readonly name: "context";
|
|
615
|
+
readonly description: "The context information for the task";
|
|
616
|
+
readonly required: true;
|
|
617
|
+
readonly usageValue: "Context information";
|
|
618
|
+
}, {
|
|
619
|
+
readonly name: "files";
|
|
620
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
621
|
+
readonly required: false;
|
|
622
|
+
readonly usageValue: "Relevant files";
|
|
623
|
+
}];
|
|
624
|
+
examples: [{
|
|
625
|
+
readonly description: "Hand over a coding task to the coder agent";
|
|
626
|
+
readonly parameters: [{
|
|
627
|
+
readonly name: "agent_name";
|
|
628
|
+
readonly value: "coder";
|
|
629
|
+
}, {
|
|
630
|
+
readonly name: "task";
|
|
631
|
+
readonly value: "Implement the login feature";
|
|
632
|
+
}, {
|
|
633
|
+
readonly name: "context";
|
|
634
|
+
readonly value: "We need a secure login system with email and password";
|
|
635
|
+
}, {
|
|
636
|
+
readonly name: "files";
|
|
637
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
638
|
+
}];
|
|
639
|
+
}];
|
|
640
|
+
permissionLevel: PermissionLevel.None;
|
|
641
|
+
};
|
|
642
|
+
export { _default_11 as default_alias_8 }
|
|
643
|
+
export { _default_11 as handOver }
|
|
644
|
+
export { _default_11 as handOver_alias_1 }
|
|
645
|
+
export { _default_11 as handOver_alias_2 }
|
|
646
|
+
|
|
647
|
+
declare const _default_12: {
|
|
648
|
+
handler: ToolHandler<{
|
|
649
|
+
readonly name: "remove_file";
|
|
650
|
+
readonly description: "Request to remove a file at the specified path.";
|
|
651
|
+
readonly parameters: [{
|
|
652
|
+
readonly name: "path";
|
|
653
|
+
readonly description: "The path of the file to remove";
|
|
654
|
+
readonly required: true;
|
|
655
|
+
readonly usageValue: "File path here";
|
|
656
|
+
}];
|
|
657
|
+
readonly examples: [{
|
|
658
|
+
readonly description: "Request to remove a file";
|
|
659
|
+
readonly parameters: [{
|
|
660
|
+
readonly name: "path";
|
|
661
|
+
readonly value: "src/main.js";
|
|
662
|
+
}];
|
|
663
|
+
}];
|
|
664
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
665
|
+
}, FilesystemProvider>;
|
|
666
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
667
|
+
name: "remove_file";
|
|
668
|
+
description: "Request to remove a file at the specified path.";
|
|
669
|
+
parameters: [{
|
|
670
|
+
readonly name: "path";
|
|
671
|
+
readonly description: "The path of the file to remove";
|
|
672
|
+
readonly required: true;
|
|
673
|
+
readonly usageValue: "File path here";
|
|
674
|
+
}];
|
|
675
|
+
examples: [{
|
|
676
|
+
readonly description: "Request to remove a file";
|
|
677
|
+
readonly parameters: [{
|
|
678
|
+
readonly name: "path";
|
|
679
|
+
readonly value: "src/main.js";
|
|
680
|
+
}];
|
|
681
|
+
}];
|
|
682
|
+
permissionLevel: PermissionLevel.Write;
|
|
683
|
+
};
|
|
684
|
+
export { _default_12 as default_alias_12 }
|
|
685
|
+
export { _default_12 as removeFile }
|
|
686
|
+
export { _default_12 as removeFile_alias_1 }
|
|
687
|
+
export { _default_12 as removeFile_alias_2 }
|
|
688
|
+
|
|
689
|
+
declare const _default_13: {
|
|
690
|
+
handler: ToolHandler<{
|
|
691
|
+
readonly name: "rename_file";
|
|
692
|
+
readonly description: "Request to rename a file from source path to target path.";
|
|
693
|
+
readonly parameters: [{
|
|
694
|
+
readonly name: "sourcePath";
|
|
695
|
+
readonly description: "The current path of the file";
|
|
696
|
+
readonly required: true;
|
|
697
|
+
readonly usageValue: "Source file path here";
|
|
698
|
+
}, {
|
|
699
|
+
readonly name: "targetPath";
|
|
700
|
+
readonly description: "The new path for the file";
|
|
701
|
+
readonly required: true;
|
|
702
|
+
readonly usageValue: "Target file path here";
|
|
703
|
+
}];
|
|
704
|
+
readonly examples: [{
|
|
705
|
+
readonly description: "Request to rename a file";
|
|
706
|
+
readonly parameters: [{
|
|
707
|
+
readonly name: "sourcePath";
|
|
708
|
+
readonly value: "src/old-name.js";
|
|
709
|
+
}, {
|
|
710
|
+
readonly name: "targetPath";
|
|
711
|
+
readonly value: "src/new-name.js";
|
|
712
|
+
}];
|
|
713
|
+
}];
|
|
714
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
715
|
+
}, FilesystemProvider>;
|
|
716
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
717
|
+
name: "rename_file";
|
|
718
|
+
description: "Request to rename a file from source path to target path.";
|
|
719
|
+
parameters: [{
|
|
720
|
+
readonly name: "sourcePath";
|
|
721
|
+
readonly description: "The current path of the file";
|
|
722
|
+
readonly required: true;
|
|
723
|
+
readonly usageValue: "Source file path here";
|
|
724
|
+
}, {
|
|
725
|
+
readonly name: "targetPath";
|
|
726
|
+
readonly description: "The new path for the file";
|
|
727
|
+
readonly required: true;
|
|
728
|
+
readonly usageValue: "Target file path here";
|
|
729
|
+
}];
|
|
730
|
+
examples: [{
|
|
731
|
+
readonly description: "Request to rename a file";
|
|
732
|
+
readonly parameters: [{
|
|
733
|
+
readonly name: "sourcePath";
|
|
734
|
+
readonly value: "src/old-name.js";
|
|
735
|
+
}, {
|
|
736
|
+
readonly name: "targetPath";
|
|
737
|
+
readonly value: "src/new-name.js";
|
|
738
|
+
}];
|
|
739
|
+
}];
|
|
740
|
+
permissionLevel: PermissionLevel.Write;
|
|
741
|
+
};
|
|
742
|
+
export { _default_13 as default_alias_13 }
|
|
743
|
+
export { _default_13 as renameFile }
|
|
744
|
+
export { _default_13 as renameFile_alias_1 }
|
|
745
|
+
export { _default_13 as renameFile_alias_2 }
|
|
746
|
+
|
|
747
|
+
declare const _default_2: {
|
|
748
|
+
handler: ToolHandler<{
|
|
749
|
+
readonly name: "attempt_completion";
|
|
750
|
+
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.";
|
|
751
|
+
readonly parameters: [{
|
|
752
|
+
readonly name: "result";
|
|
753
|
+
readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
|
|
754
|
+
readonly required: true;
|
|
755
|
+
readonly usageValue: "Your final result description here";
|
|
756
|
+
}];
|
|
757
|
+
readonly examples: [{
|
|
758
|
+
readonly description: "Request to present the result of the task";
|
|
759
|
+
readonly parameters: [{
|
|
760
|
+
readonly name: "result";
|
|
761
|
+
readonly value: "Your final result description here";
|
|
762
|
+
}];
|
|
763
|
+
}];
|
|
764
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
765
|
+
}, InteractionProvider>;
|
|
766
|
+
isAvailable: (provider: InteractionProvider) => boolean;
|
|
767
|
+
name: "attempt_completion";
|
|
768
|
+
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.";
|
|
769
|
+
parameters: [{
|
|
770
|
+
readonly name: "result";
|
|
771
|
+
readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
|
|
772
|
+
readonly required: true;
|
|
773
|
+
readonly usageValue: "Your final result description here";
|
|
774
|
+
}];
|
|
775
|
+
examples: [{
|
|
776
|
+
readonly description: "Request to present the result of the task";
|
|
777
|
+
readonly parameters: [{
|
|
778
|
+
readonly name: "result";
|
|
779
|
+
readonly value: "Your final result description here";
|
|
780
|
+
}];
|
|
781
|
+
}];
|
|
782
|
+
permissionLevel: PermissionLevel.None;
|
|
783
|
+
};
|
|
784
|
+
export { _default_2 as attemptCompletion }
|
|
785
|
+
export { _default_2 as attemptCompletion_alias_1 }
|
|
786
|
+
export { _default_2 as attemptCompletion_alias_2 }
|
|
787
|
+
export { _default_2 as default_alias_5 }
|
|
788
|
+
|
|
789
|
+
declare const _default_3: {
|
|
790
|
+
handler: ToolHandler<{
|
|
791
|
+
readonly name: "delegate";
|
|
792
|
+
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.";
|
|
793
|
+
readonly parameters: [{
|
|
794
|
+
readonly name: "agent_name";
|
|
795
|
+
readonly description: "The name of the agent to delegate the task to";
|
|
796
|
+
readonly required: true;
|
|
797
|
+
readonly usageValue: "Name of the target agent";
|
|
798
|
+
}, {
|
|
799
|
+
readonly name: "task";
|
|
800
|
+
readonly description: "The task to be completed by the target agent";
|
|
801
|
+
readonly required: true;
|
|
802
|
+
readonly usageValue: "Task description";
|
|
803
|
+
}, {
|
|
804
|
+
readonly name: "context";
|
|
805
|
+
readonly description: "The context information for the task";
|
|
806
|
+
readonly required: true;
|
|
807
|
+
readonly usageValue: "Context information";
|
|
808
|
+
}, {
|
|
809
|
+
readonly name: "files";
|
|
810
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
811
|
+
readonly required: false;
|
|
812
|
+
readonly usageValue: "Relevant files";
|
|
813
|
+
}];
|
|
814
|
+
readonly examples: [{
|
|
815
|
+
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
816
|
+
readonly parameters: [{
|
|
817
|
+
readonly name: "agent_name";
|
|
818
|
+
readonly value: "analyzer";
|
|
819
|
+
}, {
|
|
820
|
+
readonly name: "task";
|
|
821
|
+
readonly value: "Analyze the authentication implementation";
|
|
822
|
+
}, {
|
|
823
|
+
readonly name: "context";
|
|
824
|
+
readonly value: "Need to understand the security implications of the current auth system";
|
|
825
|
+
}, {
|
|
826
|
+
readonly name: "files";
|
|
827
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
828
|
+
}];
|
|
829
|
+
}];
|
|
830
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
831
|
+
}, any>;
|
|
832
|
+
isAvailable: (_provider: any) => boolean;
|
|
833
|
+
name: "delegate";
|
|
834
|
+
description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
|
|
835
|
+
parameters: [{
|
|
836
|
+
readonly name: "agent_name";
|
|
837
|
+
readonly description: "The name of the agent to delegate the task to";
|
|
838
|
+
readonly required: true;
|
|
839
|
+
readonly usageValue: "Name of the target agent";
|
|
840
|
+
}, {
|
|
841
|
+
readonly name: "task";
|
|
842
|
+
readonly description: "The task to be completed by the target agent";
|
|
843
|
+
readonly required: true;
|
|
844
|
+
readonly usageValue: "Task description";
|
|
845
|
+
}, {
|
|
846
|
+
readonly name: "context";
|
|
847
|
+
readonly description: "The context information for the task";
|
|
848
|
+
readonly required: true;
|
|
849
|
+
readonly usageValue: "Context information";
|
|
850
|
+
}, {
|
|
851
|
+
readonly name: "files";
|
|
852
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
853
|
+
readonly required: false;
|
|
854
|
+
readonly usageValue: "Relevant files";
|
|
855
|
+
}];
|
|
856
|
+
examples: [{
|
|
857
|
+
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
858
|
+
readonly parameters: [{
|
|
859
|
+
readonly name: "agent_name";
|
|
860
|
+
readonly value: "analyzer";
|
|
861
|
+
}, {
|
|
862
|
+
readonly name: "task";
|
|
863
|
+
readonly value: "Analyze the authentication implementation";
|
|
864
|
+
}, {
|
|
865
|
+
readonly name: "context";
|
|
866
|
+
readonly value: "Need to understand the security implications of the current auth system";
|
|
867
|
+
}, {
|
|
868
|
+
readonly name: "files";
|
|
869
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
870
|
+
}];
|
|
871
|
+
}];
|
|
872
|
+
permissionLevel: PermissionLevel.None;
|
|
873
|
+
};
|
|
874
|
+
export { _default_3 as default_alias_6 }
|
|
875
|
+
export { _default_3 as delegate }
|
|
876
|
+
export { _default_3 as delegate_alias_1 }
|
|
877
|
+
export { _default_3 as delegate_alias_2 }
|
|
878
|
+
|
|
879
|
+
declare const _default_4: {
|
|
880
|
+
handler: ToolHandler<{
|
|
881
|
+
readonly name: "execute_command";
|
|
882
|
+
readonly description: "Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will also be executed in the project root directory regardless of executed commands in previous tool uses.";
|
|
883
|
+
readonly parameters: [{
|
|
884
|
+
readonly name: "command";
|
|
885
|
+
readonly description: "The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.";
|
|
886
|
+
readonly required: true;
|
|
887
|
+
readonly usageValue: "Your command here";
|
|
888
|
+
}, {
|
|
889
|
+
readonly name: "requires_approval";
|
|
890
|
+
readonly description: "A boolean indicating whether this command requires explicit user approval before execution in case the user has auto-approve mode enabled. Set to 'true' for potentially impactful operations like installing/uninstalling packages, deleting/overwriting files, system configuration changes, network operations, or any commands that could have unintended side effects. Set to 'false' for safe operations like reading files/directories, running development servers, building projects, and other non-destructive operations.";
|
|
891
|
+
readonly required: false;
|
|
892
|
+
readonly usageValue: "true or false";
|
|
893
|
+
}];
|
|
894
|
+
readonly examples: [{
|
|
895
|
+
readonly description: "Request to execute a command";
|
|
896
|
+
readonly parameters: [{
|
|
897
|
+
readonly name: "command";
|
|
898
|
+
readonly value: "npm run dev";
|
|
899
|
+
}, {
|
|
900
|
+
readonly name: "requires_approval";
|
|
901
|
+
readonly value: "false";
|
|
902
|
+
}];
|
|
903
|
+
}];
|
|
904
|
+
readonly permissionLevel: PermissionLevel.Arbitrary;
|
|
905
|
+
}, CommandProvider>;
|
|
906
|
+
isAvailable: (provider: CommandProvider) => boolean;
|
|
907
|
+
name: "execute_command";
|
|
908
|
+
description: "Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will also be executed in the project root directory regardless of executed commands in previous tool uses.";
|
|
909
|
+
parameters: [{
|
|
910
|
+
readonly name: "command";
|
|
911
|
+
readonly description: "The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.";
|
|
912
|
+
readonly required: true;
|
|
913
|
+
readonly usageValue: "Your command here";
|
|
914
|
+
}, {
|
|
915
|
+
readonly name: "requires_approval";
|
|
916
|
+
readonly description: "A boolean indicating whether this command requires explicit user approval before execution in case the user has auto-approve mode enabled. Set to 'true' for potentially impactful operations like installing/uninstalling packages, deleting/overwriting files, system configuration changes, network operations, or any commands that could have unintended side effects. Set to 'false' for safe operations like reading files/directories, running development servers, building projects, and other non-destructive operations.";
|
|
917
|
+
readonly required: false;
|
|
918
|
+
readonly usageValue: "true or false";
|
|
919
|
+
}];
|
|
920
|
+
examples: [{
|
|
921
|
+
readonly description: "Request to execute a command";
|
|
922
|
+
readonly parameters: [{
|
|
923
|
+
readonly name: "command";
|
|
924
|
+
readonly value: "npm run dev";
|
|
925
|
+
}, {
|
|
926
|
+
readonly name: "requires_approval";
|
|
927
|
+
readonly value: "false";
|
|
928
|
+
}];
|
|
929
|
+
}];
|
|
930
|
+
permissionLevel: PermissionLevel.Arbitrary;
|
|
931
|
+
};
|
|
932
|
+
export { _default_4 as default_alias_7 }
|
|
933
|
+
export { _default_4 as executeCommand }
|
|
934
|
+
export { _default_4 as executeCommand_alias_1 }
|
|
935
|
+
export { _default_4 as executeCommand_alias_2 }
|
|
936
|
+
|
|
937
|
+
declare const _default_5: {
|
|
938
|
+
handler: ToolHandler<{
|
|
939
|
+
readonly name: "list_code_definition_names";
|
|
940
|
+
readonly description: "Request to list definition names (classes, functions, methods, etc.) used for all files in a directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.";
|
|
941
|
+
readonly parameters: [{
|
|
942
|
+
readonly name: "path";
|
|
943
|
+
readonly description: "The path of a code file to list top level source code definitions for.";
|
|
944
|
+
readonly required: true;
|
|
945
|
+
readonly usageValue: "Directory path here";
|
|
946
|
+
}];
|
|
947
|
+
readonly examples: [{
|
|
948
|
+
readonly description: "Request to list code definition names in a directory";
|
|
949
|
+
readonly parameters: [{
|
|
950
|
+
readonly name: "path";
|
|
951
|
+
readonly value: "src/utils";
|
|
952
|
+
}];
|
|
953
|
+
}];
|
|
954
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
955
|
+
}, FilesystemProvider>;
|
|
956
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
957
|
+
name: "list_code_definition_names";
|
|
958
|
+
description: "Request to list definition names (classes, functions, methods, etc.) used for all files in a directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.";
|
|
959
|
+
parameters: [{
|
|
960
|
+
readonly name: "path";
|
|
961
|
+
readonly description: "The path of a code file to list top level source code definitions for.";
|
|
962
|
+
readonly required: true;
|
|
963
|
+
readonly usageValue: "Directory path here";
|
|
964
|
+
}];
|
|
965
|
+
examples: [{
|
|
966
|
+
readonly description: "Request to list code definition names in a directory";
|
|
967
|
+
readonly parameters: [{
|
|
968
|
+
readonly name: "path";
|
|
969
|
+
readonly value: "src/utils";
|
|
970
|
+
}];
|
|
971
|
+
}];
|
|
972
|
+
permissionLevel: PermissionLevel.Read;
|
|
973
|
+
};
|
|
974
|
+
export { _default_5 as default_alias_9 }
|
|
975
|
+
export { _default_5 as listCodeDefinitionNames }
|
|
976
|
+
export { _default_5 as listCodeDefinitionNames_alias_1 }
|
|
977
|
+
export { _default_5 as listCodeDefinitionNames_alias_2 }
|
|
978
|
+
|
|
979
|
+
declare const _default_6: {
|
|
980
|
+
handler: ToolHandler<{
|
|
981
|
+
readonly name: "list_files";
|
|
982
|
+
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.";
|
|
983
|
+
readonly parameters: [{
|
|
984
|
+
readonly name: "path";
|
|
985
|
+
readonly description: "The path of the directory to list contents for (relative to the current working directory)";
|
|
986
|
+
readonly required: true;
|
|
987
|
+
readonly usageValue: "Directory path here";
|
|
988
|
+
}, {
|
|
989
|
+
readonly name: "max_count";
|
|
990
|
+
readonly description: "The maximum number of files to list. Default to 2000";
|
|
991
|
+
readonly required: false;
|
|
992
|
+
readonly usageValue: "Maximum number of files to list (optional)";
|
|
993
|
+
}, {
|
|
994
|
+
readonly name: "recursive";
|
|
995
|
+
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
996
|
+
readonly required: false;
|
|
997
|
+
readonly usageValue: "true or false (optional)";
|
|
998
|
+
}];
|
|
999
|
+
readonly examples: [{
|
|
1000
|
+
readonly description: "Request to list files";
|
|
1001
|
+
readonly parameters: [{
|
|
1002
|
+
readonly name: "path";
|
|
1003
|
+
readonly value: "src";
|
|
1004
|
+
}, {
|
|
1005
|
+
readonly name: "max_count";
|
|
1006
|
+
readonly value: "100";
|
|
1007
|
+
}];
|
|
1008
|
+
}];
|
|
1009
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
1010
|
+
}, FilesystemProvider>;
|
|
1011
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1012
|
+
name: "list_files";
|
|
1013
|
+
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.";
|
|
1014
|
+
parameters: [{
|
|
1015
|
+
readonly name: "path";
|
|
1016
|
+
readonly description: "The path of the directory to list contents for (relative to the current working directory)";
|
|
1017
|
+
readonly required: true;
|
|
1018
|
+
readonly usageValue: "Directory path here";
|
|
1019
|
+
}, {
|
|
1020
|
+
readonly name: "max_count";
|
|
1021
|
+
readonly description: "The maximum number of files to list. Default to 2000";
|
|
1022
|
+
readonly required: false;
|
|
1023
|
+
readonly usageValue: "Maximum number of files to list (optional)";
|
|
1024
|
+
}, {
|
|
1025
|
+
readonly name: "recursive";
|
|
1026
|
+
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
1027
|
+
readonly required: false;
|
|
1028
|
+
readonly usageValue: "true or false (optional)";
|
|
1029
|
+
}];
|
|
1030
|
+
examples: [{
|
|
1031
|
+
readonly description: "Request to list files";
|
|
1032
|
+
readonly parameters: [{
|
|
1033
|
+
readonly name: "path";
|
|
1034
|
+
readonly value: "src";
|
|
1035
|
+
}, {
|
|
1036
|
+
readonly name: "max_count";
|
|
1037
|
+
readonly value: "100";
|
|
1038
|
+
}];
|
|
1039
|
+
}];
|
|
1040
|
+
permissionLevel: PermissionLevel.Read;
|
|
1041
|
+
};
|
|
1042
|
+
export { _default_6 as default_alias_10 }
|
|
1043
|
+
export { _default_6 as listFiles }
|
|
1044
|
+
export { _default_6 as listFiles_alias_1 }
|
|
1045
|
+
export { _default_6 as listFiles_alias_2 }
|
|
1046
|
+
|
|
1047
|
+
declare const _default_7: {
|
|
1048
|
+
handler: ToolHandler<{
|
|
1049
|
+
readonly name: "read_file";
|
|
1050
|
+
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.";
|
|
1051
|
+
readonly parameters: [{
|
|
1052
|
+
readonly name: "path";
|
|
1053
|
+
readonly description: "The path of the file to read";
|
|
1054
|
+
readonly required: true;
|
|
1055
|
+
readonly usageValue: "Comma separated paths here";
|
|
1056
|
+
}];
|
|
1057
|
+
readonly examples: [{
|
|
1058
|
+
readonly description: "Request to read the contents of a file";
|
|
1059
|
+
readonly parameters: [{
|
|
1060
|
+
readonly name: "path";
|
|
1061
|
+
readonly value: "src/main.js";
|
|
1062
|
+
}];
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly description: "Request to read multiple files";
|
|
1065
|
+
readonly parameters: [{
|
|
1066
|
+
readonly name: "path";
|
|
1067
|
+
readonly value: "src/main.js,src/index.js";
|
|
1068
|
+
}];
|
|
1069
|
+
}];
|
|
1070
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
1071
|
+
}, FilesystemProvider>;
|
|
1072
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1073
|
+
name: "read_file";
|
|
1074
|
+
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.";
|
|
1075
|
+
parameters: [{
|
|
1076
|
+
readonly name: "path";
|
|
1077
|
+
readonly description: "The path of the file to read";
|
|
1078
|
+
readonly required: true;
|
|
1079
|
+
readonly usageValue: "Comma separated paths here";
|
|
1080
|
+
}];
|
|
1081
|
+
examples: [{
|
|
1082
|
+
readonly description: "Request to read the contents of a file";
|
|
1083
|
+
readonly parameters: [{
|
|
1084
|
+
readonly name: "path";
|
|
1085
|
+
readonly value: "src/main.js";
|
|
1086
|
+
}];
|
|
1087
|
+
}, {
|
|
1088
|
+
readonly description: "Request to read multiple files";
|
|
1089
|
+
readonly parameters: [{
|
|
1090
|
+
readonly name: "path";
|
|
1091
|
+
readonly value: "src/main.js,src/index.js";
|
|
1092
|
+
}];
|
|
1093
|
+
}];
|
|
1094
|
+
permissionLevel: PermissionLevel.Read;
|
|
1095
|
+
};
|
|
1096
|
+
export { _default_7 as default_alias_11 }
|
|
1097
|
+
export { _default_7 as readFile }
|
|
1098
|
+
export { _default_7 as readFile_alias_1 }
|
|
1099
|
+
export { _default_7 as readFile_alias_2 }
|
|
1100
|
+
|
|
1101
|
+
declare const _default_8: {
|
|
1102
|
+
handler: ToolHandler<{
|
|
1103
|
+
readonly name: "replace_in_file";
|
|
1104
|
+
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.";
|
|
1105
|
+
readonly parameters: [{
|
|
1106
|
+
readonly name: "path";
|
|
1107
|
+
readonly description: "The path of the file to modify";
|
|
1108
|
+
readonly required: true;
|
|
1109
|
+
readonly usageValue: "File path here";
|
|
1110
|
+
}, {
|
|
1111
|
+
readonly name: "diff";
|
|
1112
|
+
readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
|
|
1113
|
+
readonly required: true;
|
|
1114
|
+
readonly usageValue: "Search and replace blocks here";
|
|
1115
|
+
}];
|
|
1116
|
+
readonly examples: [{
|
|
1117
|
+
readonly description: "Request to replace sections of content in a file";
|
|
1118
|
+
readonly parameters: [{
|
|
1119
|
+
readonly name: "path";
|
|
1120
|
+
readonly value: "src/main.js";
|
|
1121
|
+
}, {
|
|
1122
|
+
readonly name: "diff";
|
|
1123
|
+
readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
|
|
1124
|
+
}];
|
|
1125
|
+
}];
|
|
1126
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
1127
|
+
}, FilesystemProvider>;
|
|
1128
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1129
|
+
name: "replace_in_file";
|
|
1130
|
+
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.";
|
|
1131
|
+
parameters: [{
|
|
1132
|
+
readonly name: "path";
|
|
1133
|
+
readonly description: "The path of the file to modify";
|
|
1134
|
+
readonly required: true;
|
|
1135
|
+
readonly usageValue: "File path here";
|
|
1136
|
+
}, {
|
|
1137
|
+
readonly name: "diff";
|
|
1138
|
+
readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
|
|
1139
|
+
readonly required: true;
|
|
1140
|
+
readonly usageValue: "Search and replace blocks here";
|
|
1141
|
+
}];
|
|
1142
|
+
examples: [{
|
|
1143
|
+
readonly description: "Request to replace sections of content in a file";
|
|
1144
|
+
readonly parameters: [{
|
|
1145
|
+
readonly name: "path";
|
|
1146
|
+
readonly value: "src/main.js";
|
|
1147
|
+
}, {
|
|
1148
|
+
readonly name: "diff";
|
|
1149
|
+
readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
|
|
1150
|
+
}];
|
|
1151
|
+
}];
|
|
1152
|
+
permissionLevel: PermissionLevel.Write;
|
|
1153
|
+
};
|
|
1154
|
+
export { _default_8 as default_alias_14 }
|
|
1155
|
+
export { _default_8 as replaceInFile }
|
|
1156
|
+
export { _default_8 as replaceInFile_alias_1 }
|
|
1157
|
+
export { _default_8 as replaceInFile_alias_2 }
|
|
1158
|
+
|
|
1159
|
+
declare const _default_9: {
|
|
1160
|
+
handler: ToolHandler<{
|
|
1161
|
+
readonly name: "search_files";
|
|
1162
|
+
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.";
|
|
1163
|
+
readonly parameters: [{
|
|
1164
|
+
readonly name: "path";
|
|
1165
|
+
readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
|
|
1166
|
+
readonly required: true;
|
|
1167
|
+
readonly usageValue: "Directory path here";
|
|
1168
|
+
}, {
|
|
1169
|
+
readonly name: "regex";
|
|
1170
|
+
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
1171
|
+
readonly required: true;
|
|
1172
|
+
readonly usageValue: "Your regex pattern here";
|
|
1173
|
+
}, {
|
|
1174
|
+
readonly name: "file_pattern";
|
|
1175
|
+
readonly description: "Glob pattern to filter files (e.g., \"*.ts\" for TypeScript files). If not provided, it will search all files (*).";
|
|
1176
|
+
readonly required: false;
|
|
1177
|
+
readonly usageValue: "file pattern here (optional)";
|
|
1178
|
+
}];
|
|
1179
|
+
readonly examples: [{
|
|
1180
|
+
readonly description: "Request to perform a regex search across files";
|
|
1181
|
+
readonly parameters: [{
|
|
1182
|
+
readonly name: "path";
|
|
1183
|
+
readonly value: "src";
|
|
1184
|
+
}, {
|
|
1185
|
+
readonly name: "regex";
|
|
1186
|
+
readonly value: "^components/";
|
|
1187
|
+
}, {
|
|
1188
|
+
readonly name: "file_pattern";
|
|
1189
|
+
readonly value: "*.ts";
|
|
1190
|
+
}];
|
|
1191
|
+
}];
|
|
1192
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
1193
|
+
}, FilesystemProvider>;
|
|
1194
|
+
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1195
|
+
name: "search_files";
|
|
1196
|
+
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.";
|
|
1197
|
+
parameters: [{
|
|
1198
|
+
readonly name: "path";
|
|
1199
|
+
readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
|
|
1200
|
+
readonly required: true;
|
|
1201
|
+
readonly usageValue: "Directory path here";
|
|
1202
|
+
}, {
|
|
1203
|
+
readonly name: "regex";
|
|
1204
|
+
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
1205
|
+
readonly required: true;
|
|
1206
|
+
readonly usageValue: "Your regex pattern here";
|
|
1207
|
+
}, {
|
|
1208
|
+
readonly name: "file_pattern";
|
|
1209
|
+
readonly description: "Glob pattern to filter files (e.g., \"*.ts\" for TypeScript files). If not provided, it will search all files (*).";
|
|
1210
|
+
readonly required: false;
|
|
1211
|
+
readonly usageValue: "file pattern here (optional)";
|
|
1212
|
+
}];
|
|
1213
|
+
examples: [{
|
|
1214
|
+
readonly description: "Request to perform a regex search across files";
|
|
1215
|
+
readonly parameters: [{
|
|
1216
|
+
readonly name: "path";
|
|
1217
|
+
readonly value: "src";
|
|
1218
|
+
}, {
|
|
1219
|
+
readonly name: "regex";
|
|
1220
|
+
readonly value: "^components/";
|
|
1221
|
+
}, {
|
|
1222
|
+
readonly name: "file_pattern";
|
|
1223
|
+
readonly value: "*.ts";
|
|
1224
|
+
}];
|
|
1225
|
+
}];
|
|
1226
|
+
permissionLevel: PermissionLevel.Read;
|
|
1227
|
+
};
|
|
1228
|
+
export { _default_9 as default_alias_15 }
|
|
1229
|
+
export { _default_9 as searchFiles }
|
|
1230
|
+
export { _default_9 as searchFiles_alias_1 }
|
|
1231
|
+
export { _default_9 as searchFiles_alias_2 }
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* AI tool for creating new projects based on user specifications.
|
|
1235
|
+
* Generated by polka.codes
|
|
1236
|
+
*/
|
|
1237
|
+
export declare const default_alias: {
|
|
1238
|
+
readonly name: "createNewProject";
|
|
1239
|
+
readonly description: "Creates a new project";
|
|
1240
|
+
readonly prompt: "You are an AiTool designed to assist users in creating new projects. Follow these guidelines:\n\n1. **Gather Information:**\n - Begin by asking the user for essential project details, including:\n - Project type (e.g., web, mobile, desktop, etc.)\n - Desired programming languages\n - Preferred frameworks or libraries\n - Build tools and package manager preferences\n - Testing frameworks and patterns\n - Code style and linting preferences\n - Any additional specifications or requirements\n\n2. **Clarification & Confirmation:**\n - Do not make any decisions or assumptions on behalf of the user.\n - Ask clarifying questions if any detail is ambiguous.\n - Confirm each piece of information with the user before proceeding to the next step.\n\n3. **Avoid Redundancy:**\n - Do not repeat questions or details that have already been confirmed.\n - Keep interactions concise and focused on gathering complete and accurate details.\n\n4. **Generate Configuration:**\n - Based on the collected information, generate a .polkacodes.yml configuration file that includes:\n - scripts section with common development commands (test, format, check, etc.)\n - rules section reflecting project conventions and tools\n - excludeFiles section for sensitive files only\n - Example structure:\n ```yaml\n scripts:\n test:\n command: \"[test-command]\"\n description: \"Run tests\"\n format:\n command: \"[format-command]\"\n description: \"Format code\"\n check:\n command: \"[check-command]\"\n description: \"Check code\"\n\n rules:\n - \"[package-manager-rule]\"\n - \"[testing-framework-rule]\"\n - \"[code-style-rule]\"\n - \"[other-rule]\"\n\n excludeFiles:\n - \".env\"\n - \".env.*\"\n ```\n\n5. **Generate Essential Project Files:**\n - Create a .gitattributes file with appropriate configurations:\n - Mark lock files as generated and exclude them from diffs\n - Example for different package managers:\n \n # For Bun\n bun.lock linguist-generated=true\n bun.lock -diff\n \n # For npm\n package-lock.json linguist-generated=true\n package-lock.json -diff\n \n # For Yarn\n yarn.lock linguist-generated=true\n yarn.lock -diff\n \n # For pnpm\n pnpm-lock.yaml linguist-generated=true\n pnpm-lock.yaml -diff\n \n - Include other common configurations as needed based on project type\n\n6. **Handover to Coder Agent:**\n - Once all required information is collected and validated by the user, compile:\n 1. The final project specifications\n 2. The .polkacodes.yml configuration content\n - Clearly hand over these details to the coder agent, instructing them to:\n 1. Create the new project based on the confirmed specifications\n 2. Include the .polkacodes.yml file in the project root\n 3. Include the .gitattributes file with appropriate configurations\n 4. Ensure all specified tools and configurations are properly set up";
|
|
1241
|
+
readonly formatInput: (params: string) => string;
|
|
1242
|
+
readonly parseOutput: (output: string) => string;
|
|
1243
|
+
readonly agent: "architect";
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
export declare const default_alias_1: {
|
|
1247
|
+
readonly name: "generateGitCommitMessage";
|
|
1248
|
+
readonly description: "Generates git commit messages from git diff output";
|
|
1249
|
+
readonly prompt: "\nYou are an advanced assistant specialized in creating concise and accurate Git commit messages. When you receive:\n- A Git diff inside the <tool_input> tag.\n- Additional user-supplied context inside the <tool_input_context> tag (if any).\n\nYou will produce a single commit message enclosed within <tool_output> tags. The commit message must accurately reflect the changes shown in the diff and should be clear, descriptive, and devoid of unnecessary or repeated information. If a context is provided, it MUST be incorporated into the commit message.\n\nHere’s an example of the input and the expected output format:\n\n<tool_input>\n--- a/example_file.py\n+++ b/example_file.py\n@@ -10,7 +10,7 @@ def example_function():\n- print(\"Old behavior\")\n+ print(\"New behavior\")\n</tool_input>\n<tool_input_context>\nChanging print statement to update the user-facing message.\n</tool_input_context>\n\nExample Output:\n\n<tool_output>\nUpdate print statement for revised user-facing message\n</tool_output>\n\nFollow the same structure for any new input. Never repeat questions; focus on generating a concise commit message that captures the essence of the changes.\n";
|
|
1250
|
+
readonly formatInput: (params: {
|
|
1251
|
+
diff: string;
|
|
1252
|
+
context?: string;
|
|
1253
|
+
}) => string;
|
|
1254
|
+
readonly parseOutput: (output: string) => string;
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
export declare const default_alias_2: {
|
|
1258
|
+
readonly name: "generateGithubPullRequestDetails";
|
|
1259
|
+
readonly description: "Generates a GitHub pull request title and description from git commits";
|
|
1260
|
+
readonly prompt: "\n# Generate Github Pull Request Details\n\nYou are given:\n- A branch name in <tool_input_branch_name>.\n- An optional context message in <tool_input_context> (which may or may not be present).\n- All commit messages combined in <tool_input_commit_messages>.\n- All diffs combined in <tool_input_commit_diff>.\n\nYour task:\n1. Consider the optional context (if provided).\n - If an issue number is found, add \"Closes #xxx\" at the beginning of the PR description\n - IMPORTANT: Use ONLY the exact format \"Closes #xxx\" at the beginning of the description\n - DO NOT use variations like \"Closes issue #xxx\" or other formats\n2. Analyze the combined commit messages and diffs.\n3. Produce a single GitHub Pull Request title.\n4. Produce a Pull Request description that explains the changes.\n\nUse the following template for the Pull Request description:\n\n---\n**Context (if provided)**:\n- Acknowledge any guiding concerns or instructions.\n\n**Summary of Changes**:\n- Provide a concise list or overview of what changed.\n\n**Highlights of Changed Code**:\n- Mention only the specific sections or functionalities updated, without showing full surrounding context.\n\n**Additional Information (if needed)**:\n- Testing steps (if applicable).\n- Any notes or caveats.\n\n---\n\nOutput format:\n<tool_output>\n <tool_output_pr_title>YOUR PR TITLE HERE</tool_output_pr_title>\n <tool_output_pr_description>\n YOUR PR DESCRIPTION HERE\n </tool_output_pr_description>\n</tool_output>\n\nBelow is an **example** of the input and output:\n\nExample Input:\n<tool_input>\n<tool_input_branch_name>feature/refactor-logging</tool_input_branch_name>\n<tool_input_context>Implementing changes for issue #123 - Focus on clean code and maintainability</tool_input_context>\n<tool_input_commit_messages>\nRemove debug logs\nRefactor order validation logic\n</tool_input_commit_messages>\n<tool_input_commit_diff>\ndiff --git a/user_service.py b/user_service.py\n- print(\"Debug info\")\n+ # Removed debug print statements\n\ndiff --git a/order_service.py b/order_service.py\n- if is_valid_order(order):\n- process_order(order)\n+ validate_and_process(order)\n</tool_input_commit_diff>\n</tool_input>\n\nExample Output:\n<tool_output>\n<tool_output_pr_title>Refactor Order Validation and Remove Debug Logs</tool_output_pr_title>\n<tool_output_pr_description>\ncloses #123\n\nThis PR removes unnecessary debug print statements and updates order validation\nto use the new validate_and_process method for improved maintainability.\n</tool_output_pr_description>\n</tool_output>\n\n---\n\nUse the above format whenever you receive <tool_input> that may include a branch name, an optional context, aggregated commit messages in a single tag, and a combined diff in a single tag. Provide your final output strictly in <tool_output> with <tool_output_pr_title> and <tool_output_pr_description>. Only highlight the changed code and avoid including the context around the changes in the description.\n";
|
|
1261
|
+
readonly formatInput: (params: Input) => string;
|
|
1262
|
+
readonly parseOutput: (output: string) => Output;
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* AI tool for analyzing project files and generating polkacodes config sections.
|
|
1267
|
+
* Generated by polka.codes
|
|
1268
|
+
*/
|
|
1269
|
+
export declare const default_alias_3: {
|
|
1270
|
+
readonly name: "generateProjectConfig";
|
|
1271
|
+
readonly description: "Analyzes project files to generate polkacodes config sections";
|
|
1272
|
+
readonly prompt: "You are an analyzer agent responsible for examining project files and generating appropriate polkacodes configuration. Your task is to:\n\n1. Read and analyze the provided files using tool_read_file to understand:\n - Build tools and package manager (e.g., bun, npm)\n - Testing frameworks and patterns\n - Code style tools and rules\n - Project structure and conventions\n - Common development workflows\n\n2. Generate a YAML configuration that captures:\n - scripts section based on package.json scripts and CI workflows. If applicable, generate following scripts:\n - format: Format the code using a code formatter tool\n - check: Check the code for errors using a linter tool\n - test: Run tests using a test runner tool\n - include other relevant scripts based on project conventions, tools, and patterns\n - rules section based on project conventions, tools, and patterns\n - excludeFiles section for sensitive files\n\n3. Use tool_attempt_completion to return the final configuration in this format:\n\n<tool_attempt_completion>\n<tool_parameter_result>\nscripts:\n test:\n command: \"bun test\"\n description: \"Run tests with bun:test\"\n lint:\n command: \"biome check .\"\n description: \"Check code style with Biome\"\n\nrules:\n - \"Use `bun` as package manager\"\n - \"Write tests using bun:test with snapshots\"\n - \"Follow Biome code style\"\n\nexcludeFiles:\n # Sensitive files\n - \".env\"\n - \".env.*\"\n - \".npmrc\"\n</tool_parameter_result>\n</tool_attempt_completion>\n\nFocus on:\n- Package manager and dependency management\n- Testing frameworks and patterns\n- Code style and linting rules\n- File organization and naming conventions\n- Build and development workflows\n- Sensitive files that should not be committed:\n - Environment files (.env*)\n - Configuration files with potential secrets\n- Generated files to exclude:\n - Lock files from package managers\n - Build artifacts and outputs\n - Generated file that are not ignored by .gitignore\n\nThe configuration should accurately reflect the project's structure, tools, and conventions.\n";
|
|
1273
|
+
readonly formatInput: () => string;
|
|
1274
|
+
readonly parseOutput: (output: string) => string;
|
|
1275
|
+
readonly agent: "analyzer";
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
declare const defaultModels: {
|
|
1279
|
+
anthropic: string;
|
|
1280
|
+
ollama: string;
|
|
1281
|
+
deepseek: string;
|
|
1282
|
+
openrouter: string;
|
|
1283
|
+
};
|
|
1284
|
+
export { defaultModels }
|
|
1285
|
+
export { defaultModels as defaultModels_alias_1 }
|
|
1286
|
+
|
|
1287
|
+
export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
|
|
1288
|
+
|
|
1289
|
+
declare const executeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1290
|
+
export { executeAgentTool }
|
|
1291
|
+
export { executeAgentTool as executeAgentTool_alias_1 }
|
|
1292
|
+
|
|
1293
|
+
declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: AiServiceBase, params: GetInput<T>) => Promise<{
|
|
1294
|
+
response: GetOutput<T>;
|
|
1295
|
+
usage: ApiUsage;
|
|
1296
|
+
}>;
|
|
1297
|
+
export { executeTool }
|
|
1298
|
+
export { executeTool as executeTool_alias_1 }
|
|
1299
|
+
|
|
1300
|
+
declare type ExitReason = {
|
|
1301
|
+
type: 'UsageExceeded';
|
|
1302
|
+
} | {
|
|
1303
|
+
type: 'WaitForUserInput';
|
|
1304
|
+
} | ToolResponseExit | ToolResponseInterrupted | ToolResponseHandOver | ToolResponseDelegate;
|
|
1305
|
+
export { ExitReason }
|
|
1306
|
+
export { ExitReason as ExitReason_alias_1 }
|
|
1307
|
+
export { ExitReason as ExitReason_alias_2 }
|
|
1308
|
+
|
|
1309
|
+
declare type FilesystemProvider = {
|
|
1310
|
+
readFile?: (path: string) => Promise<string>;
|
|
1311
|
+
writeFile?: (path: string, content: string) => Promise<void>;
|
|
1312
|
+
removeFile?: (path: string) => Promise<void>;
|
|
1313
|
+
renameFile?: (sourcePath: string, targetPath: string) => Promise<void>;
|
|
1314
|
+
listFiles?: (path: string, recursive: boolean, maxCount: number) => Promise<[string[], boolean]>;
|
|
1315
|
+
searchFiles?: (path: string, regex: string, filePattern: string) => Promise<string[]>;
|
|
1316
|
+
listCodeDefinitionNames?: (path: string) => Promise<string>;
|
|
1317
|
+
};
|
|
1318
|
+
export { FilesystemProvider }
|
|
1319
|
+
export { FilesystemProvider as FilesystemProvider_alias_1 }
|
|
1320
|
+
export { FilesystemProvider as FilesystemProvider_alias_2 }
|
|
1321
|
+
|
|
1322
|
+
export declare const fullSystemPrompt: (info: {
|
|
1323
|
+
os: string;
|
|
1324
|
+
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1325
|
+
command: string;
|
|
1326
|
+
description: string;
|
|
1327
|
+
}>) => string;
|
|
1328
|
+
|
|
1329
|
+
export declare const fullSystemPrompt_alias_1: (info: {
|
|
1330
|
+
os: string;
|
|
1331
|
+
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1332
|
+
command: string;
|
|
1333
|
+
description: string;
|
|
1334
|
+
}>) => string;
|
|
1335
|
+
|
|
1336
|
+
export declare const fullSystemPrompt_alias_2: (info: {
|
|
1337
|
+
os: string;
|
|
1338
|
+
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1339
|
+
command: string;
|
|
1340
|
+
description: string;
|
|
1341
|
+
}>, interactive: boolean) => string;
|
|
1342
|
+
|
|
1343
|
+
export declare const fullSystemPrompt_alias_3: (info: {
|
|
1344
|
+
os: string;
|
|
1345
|
+
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1346
|
+
command: string;
|
|
1347
|
+
description: string;
|
|
1348
|
+
}>) => string;
|
|
1349
|
+
|
|
1350
|
+
declare type FullToolInfo = ToolInfo & {
|
|
1351
|
+
handler: ToolHandler<ToolInfo, any>;
|
|
1352
|
+
isAvailable: (provider: any) => boolean;
|
|
1353
|
+
};
|
|
1354
|
+
export { FullToolInfo }
|
|
1355
|
+
export { FullToolInfo as FullToolInfo_alias_1 }
|
|
1356
|
+
|
|
1357
|
+
declare const generateGitCommitMessage: (ai: AiServiceBase, params: {
|
|
1358
|
+
diff: string;
|
|
1359
|
+
context?: string;
|
|
1360
|
+
}) => Promise<{
|
|
1361
|
+
response: string;
|
|
1362
|
+
usage: ApiUsage;
|
|
1363
|
+
}>;
|
|
1364
|
+
export { generateGitCommitMessage }
|
|
1365
|
+
export { generateGitCommitMessage as generateGitCommitMessage_alias_1 }
|
|
1366
|
+
|
|
1367
|
+
declare const generateGithubPullRequestDetails: (ai: AiServiceBase, params: {
|
|
1368
|
+
commitMessages: string;
|
|
1369
|
+
commitDiff: string;
|
|
1370
|
+
context?: string;
|
|
1371
|
+
branchName: string;
|
|
1372
|
+
}) => Promise<{
|
|
1373
|
+
response: {
|
|
1374
|
+
title: string;
|
|
1375
|
+
description: string;
|
|
1376
|
+
};
|
|
1377
|
+
usage: ApiUsage;
|
|
1378
|
+
}>;
|
|
1379
|
+
export { generateGithubPullRequestDetails }
|
|
1380
|
+
export { generateGithubPullRequestDetails as generateGithubPullRequestDetails_alias_1 }
|
|
1381
|
+
|
|
1382
|
+
declare const generateProjectConfig: (agent: MultiAgent, params: unknown) => Promise<string>;
|
|
1383
|
+
export { generateProjectConfig }
|
|
1384
|
+
export { generateProjectConfig as generateProjectConfig_alias_1 }
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* Get the available tools based on the provider and agent availability
|
|
1388
|
+
* @param provider The provider to use.
|
|
1389
|
+
* @param allTools All possible tools.
|
|
1390
|
+
* @param hasAgent Whether the agent has agents.
|
|
1391
|
+
* @param permissionLevel Determines which tools are available based on the agent's assigned level.
|
|
1392
|
+
* @param interactive Determines whether the `askFollowupQuestion` tool is available.
|
|
1393
|
+
* @returns The available tools
|
|
1394
|
+
*/
|
|
1395
|
+
declare const getAvailableTools: ({ provider, allTools, hasAgent, permissionLevel, interactive, }: {
|
|
1396
|
+
provider: any;
|
|
1397
|
+
allTools: FullToolInfo[];
|
|
1398
|
+
hasAgent: boolean;
|
|
1399
|
+
permissionLevel: PermissionLevel;
|
|
1400
|
+
interactive: boolean;
|
|
1401
|
+
}) => FullToolInfo[];
|
|
1402
|
+
export { getAvailableTools }
|
|
1403
|
+
export { getAvailableTools as getAvailableTools_alias_1 }
|
|
1404
|
+
|
|
1405
|
+
declare const getBoolean: <T extends string>(args: Partial<Record<T, string>>, name: T, defaultValue?: boolean) => boolean;
|
|
1406
|
+
export { getBoolean }
|
|
1407
|
+
export { getBoolean as getBoolean_alias_1 }
|
|
1408
|
+
|
|
1409
|
+
declare type GetInput<T> = T extends AiToolDefinition<infer Input, any> ? Input : never;
|
|
1410
|
+
export { GetInput }
|
|
1411
|
+
export { GetInput as GetInput_alias_1 }
|
|
1412
|
+
export { GetInput as GetInput_alias_2 }
|
|
1413
|
+
|
|
1414
|
+
declare const getInt: <T extends string>(args: Partial<Record<T, string>>, name: T, defaultValue?: number) => number;
|
|
1415
|
+
export { getInt }
|
|
1416
|
+
export { getInt as getInt_alias_1 }
|
|
1417
|
+
|
|
1418
|
+
declare type GetOutput<T> = T extends AiToolDefinition<any, infer Output> ? Output : never;
|
|
1419
|
+
export { GetOutput }
|
|
1420
|
+
export { GetOutput as GetOutput_alias_1 }
|
|
1421
|
+
export { GetOutput as GetOutput_alias_2 }
|
|
1422
|
+
|
|
1423
|
+
declare const getString: <T extends string>(args: Partial<Partial<Record<T, string>>>, name: T, defaultValue?: string) => string;
|
|
1424
|
+
export { getString }
|
|
1425
|
+
export { getString as getString_alias_1 }
|
|
1426
|
+
|
|
1427
|
+
declare const getStringArray: <T extends string>(args: Partial<Record<T, string>>, name: T, defaultValue?: string[]) => string[];
|
|
1428
|
+
export { getStringArray }
|
|
1429
|
+
export { getStringArray as getStringArray_alias_1 }
|
|
1430
|
+
|
|
1431
|
+
export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
|
|
1432
|
+
|
|
1433
|
+
export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, InteractionProvider>;
|
|
1434
|
+
|
|
1435
|
+
export declare const handler_alias_10: ToolHandler<typeof toolInfo_alias_10, FilesystemProvider>;
|
|
1436
|
+
|
|
1437
|
+
export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, FilesystemProvider>;
|
|
1438
|
+
|
|
1439
|
+
export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
|
|
1440
|
+
|
|
1441
|
+
export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
|
|
1442
|
+
|
|
1443
|
+
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
|
|
1444
|
+
|
|
1445
|
+
export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, any>;
|
|
1446
|
+
|
|
1447
|
+
export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, FilesystemProvider>;
|
|
1448
|
+
|
|
1449
|
+
export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
|
|
1450
|
+
|
|
1451
|
+
export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, FilesystemProvider>;
|
|
1452
|
+
|
|
1453
|
+
export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, FilesystemProvider>;
|
|
1454
|
+
|
|
1455
|
+
export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
|
|
1456
|
+
|
|
1457
|
+
declare type Input = {
|
|
1458
|
+
commitMessages: string;
|
|
1459
|
+
commitDiff: string;
|
|
1460
|
+
context?: string;
|
|
1461
|
+
branchName: string;
|
|
1462
|
+
};
|
|
1463
|
+
|
|
1464
|
+
declare type InteractionProvider = {
|
|
1465
|
+
askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
|
|
1466
|
+
attemptCompletion?: (result: string) => Promise<string | undefined>;
|
|
1467
|
+
};
|
|
1468
|
+
export { InteractionProvider }
|
|
1469
|
+
export { InteractionProvider as InteractionProvider_alias_1 }
|
|
1470
|
+
export { InteractionProvider as InteractionProvider_alias_2 }
|
|
1471
|
+
|
|
1472
|
+
export declare const isAvailable: (provider: InteractionProvider) => boolean;
|
|
1473
|
+
|
|
1474
|
+
export declare const isAvailable_alias_1: (provider: InteractionProvider) => boolean;
|
|
1475
|
+
|
|
1476
|
+
export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
|
|
1477
|
+
|
|
1478
|
+
export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boolean;
|
|
1479
|
+
|
|
1480
|
+
export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
|
|
1481
|
+
|
|
1482
|
+
export declare const isAvailable_alias_2: (_provider: any) => boolean;
|
|
1483
|
+
|
|
1484
|
+
export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
|
|
1485
|
+
|
|
1486
|
+
export declare const isAvailable_alias_4: (_provider: any) => boolean;
|
|
1487
|
+
|
|
1488
|
+
export declare const isAvailable_alias_5: (provider: FilesystemProvider) => boolean;
|
|
1489
|
+
|
|
1490
|
+
export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
|
|
1491
|
+
|
|
1492
|
+
export declare const isAvailable_alias_7: (provider: FilesystemProvider) => boolean;
|
|
1493
|
+
|
|
1494
|
+
export declare const isAvailable_alias_8: (provider: FilesystemProvider) => boolean;
|
|
1495
|
+
|
|
1496
|
+
export declare const isAvailable_alias_9: (provider: FilesystemProvider) => boolean;
|
|
1497
|
+
|
|
1498
|
+
declare const makeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1499
|
+
export { makeAgentTool }
|
|
1500
|
+
export { makeAgentTool as makeAgentTool_alias_1 }
|
|
1501
|
+
|
|
1502
|
+
declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: AiServiceBase, params: GetInput<T>) => Promise<{
|
|
1503
|
+
response: GetOutput<T>;
|
|
1504
|
+
usage: ApiUsage;
|
|
1505
|
+
}>;
|
|
1506
|
+
export { makeTool }
|
|
1507
|
+
export { makeTool as makeTool_alias_1 }
|
|
1508
|
+
|
|
1509
|
+
declare type MessageParam = Anthropic.Messages.MessageParam;
|
|
1510
|
+
export { MessageParam }
|
|
1511
|
+
export { MessageParam as MessageParam_alias_1 }
|
|
1512
|
+
export { MessageParam as MessageParam_alias_2 }
|
|
1513
|
+
|
|
1514
|
+
declare class MockProvider implements ToolProvider {
|
|
1515
|
+
readFile(path: string): Promise<string>;
|
|
1516
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
1517
|
+
removeFile(path: string): Promise<void>;
|
|
1518
|
+
renameFile(sourcePath: string, targetPath: string): Promise<void>;
|
|
1519
|
+
listFiles(path: string, recursive: boolean, maxCount: number): Promise<[string[], boolean]>;
|
|
1520
|
+
searchFiles(path: string, regex: string, filePattern: string): Promise<string[]>;
|
|
1521
|
+
listCodeDefinitionNames(path: string): Promise<string>;
|
|
1522
|
+
executeCommand(command: string, needApprove: boolean): Promise<{
|
|
1523
|
+
stdout: string;
|
|
1524
|
+
stderr: string;
|
|
1525
|
+
exitCode: number;
|
|
1526
|
+
}>;
|
|
1527
|
+
askFollowupQuestion(question: string, options?: string[]): Promise<string>;
|
|
1528
|
+
attemptCompletion(result: string): Promise<string | undefined>;
|
|
1529
|
+
}
|
|
1530
|
+
export { MockProvider }
|
|
1531
|
+
export { MockProvider as MockProvider_alias_1 }
|
|
1532
|
+
export { MockProvider as MockProvider_alias_2 }
|
|
1533
|
+
|
|
1534
|
+
declare interface ModelInfo {
|
|
1535
|
+
maxTokens?: number;
|
|
1536
|
+
contextWindow?: number;
|
|
1537
|
+
supportsImages?: boolean;
|
|
1538
|
+
supportsComputerUse?: boolean;
|
|
1539
|
+
supportsPromptCache?: boolean;
|
|
1540
|
+
inputPrice?: number;
|
|
1541
|
+
outputPrice?: number;
|
|
1542
|
+
cacheWritesPrice?: number;
|
|
1543
|
+
cacheReadsPrice?: number;
|
|
1544
|
+
}
|
|
1545
|
+
export { ModelInfo }
|
|
1546
|
+
export { ModelInfo as ModelInfo_alias_1 }
|
|
1547
|
+
export { ModelInfo as ModelInfo_alias_2 }
|
|
1548
|
+
|
|
1549
|
+
declare const modelInfos: {
|
|
1550
|
+
anthropic: {
|
|
1551
|
+
readonly 'claude-3-7-sonnet-20250219': {
|
|
1552
|
+
readonly maxTokens: 8192;
|
|
1553
|
+
readonly contextWindow: 200000;
|
|
1554
|
+
readonly supportsImages: true;
|
|
1555
|
+
readonly supportsComputerUse: true;
|
|
1556
|
+
readonly supportsPromptCache: true;
|
|
1557
|
+
readonly inputPrice: 3;
|
|
1558
|
+
readonly outputPrice: 15;
|
|
1559
|
+
readonly cacheWritesPrice: 3.75;
|
|
1560
|
+
readonly cacheReadsPrice: 0.3;
|
|
1561
|
+
};
|
|
1562
|
+
readonly 'claude-3-5-sonnet-20241022': {
|
|
1563
|
+
readonly maxTokens: 8192;
|
|
1564
|
+
readonly contextWindow: 200000;
|
|
1565
|
+
readonly supportsImages: true;
|
|
1566
|
+
readonly supportsComputerUse: true;
|
|
1567
|
+
readonly supportsPromptCache: true;
|
|
1568
|
+
readonly inputPrice: 3;
|
|
1569
|
+
readonly outputPrice: 15;
|
|
1570
|
+
readonly cacheWritesPrice: 3.75;
|
|
1571
|
+
readonly cacheReadsPrice: 0.3;
|
|
1572
|
+
};
|
|
1573
|
+
readonly 'claude-3-5-haiku-20241022': {
|
|
1574
|
+
readonly maxTokens: 8192;
|
|
1575
|
+
readonly contextWindow: 200000;
|
|
1576
|
+
readonly supportsImages: false;
|
|
1577
|
+
readonly supportsPromptCache: true;
|
|
1578
|
+
readonly inputPrice: 0.8;
|
|
1579
|
+
readonly outputPrice: 4;
|
|
1580
|
+
readonly cacheWritesPrice: 1;
|
|
1581
|
+
readonly cacheReadsPrice: 0.08;
|
|
1582
|
+
};
|
|
1583
|
+
readonly 'claude-3-opus-20240229': {
|
|
1584
|
+
readonly maxTokens: 4096;
|
|
1585
|
+
readonly contextWindow: 200000;
|
|
1586
|
+
readonly supportsImages: true;
|
|
1587
|
+
readonly supportsPromptCache: true;
|
|
1588
|
+
readonly inputPrice: 15;
|
|
1589
|
+
readonly outputPrice: 75;
|
|
1590
|
+
readonly cacheWritesPrice: 18.75;
|
|
1591
|
+
readonly cacheReadsPrice: 1.5;
|
|
1592
|
+
};
|
|
1593
|
+
readonly 'claude-3-haiku-20240307': {
|
|
1594
|
+
readonly maxTokens: 4096;
|
|
1595
|
+
readonly contextWindow: 200000;
|
|
1596
|
+
readonly supportsImages: true;
|
|
1597
|
+
readonly supportsPromptCache: true;
|
|
1598
|
+
readonly inputPrice: 0.25;
|
|
1599
|
+
readonly outputPrice: 1.25;
|
|
1600
|
+
readonly cacheWritesPrice: 0.3;
|
|
1601
|
+
readonly cacheReadsPrice: 0.03;
|
|
1602
|
+
};
|
|
1603
|
+
};
|
|
1604
|
+
deepseek: {
|
|
1605
|
+
readonly 'deepseek-chat': {
|
|
1606
|
+
readonly maxTokens: 8000;
|
|
1607
|
+
readonly contextWindow: 64000;
|
|
1608
|
+
readonly supportsImages: false;
|
|
1609
|
+
readonly supportsPromptCache: true;
|
|
1610
|
+
readonly inputPrice: 0;
|
|
1611
|
+
readonly outputPrice: 1.1;
|
|
1612
|
+
readonly cacheWritesPrice: 0.27;
|
|
1613
|
+
readonly cacheReadsPrice: 0.07;
|
|
1614
|
+
};
|
|
1615
|
+
readonly 'deepseek-reasoner': {
|
|
1616
|
+
readonly maxTokens: 8000;
|
|
1617
|
+
readonly contextWindow: 64000;
|
|
1618
|
+
readonly supportsImages: false;
|
|
1619
|
+
readonly supportsPromptCache: true;
|
|
1620
|
+
readonly inputPrice: 0;
|
|
1621
|
+
readonly outputPrice: 2.19;
|
|
1622
|
+
readonly cacheWritesPrice: 0.55;
|
|
1623
|
+
readonly cacheReadsPrice: 0.14;
|
|
1624
|
+
};
|
|
1625
|
+
};
|
|
1626
|
+
};
|
|
1627
|
+
export { modelInfos }
|
|
1628
|
+
export { modelInfos as modelInfos_alias_1 }
|
|
1629
|
+
|
|
1630
|
+
declare class MultiAgent {
|
|
1631
|
+
#private;
|
|
1632
|
+
constructor(config: MultiAgentConfig);
|
|
1633
|
+
startTask(options: {
|
|
1634
|
+
agentName: string;
|
|
1635
|
+
task: string;
|
|
1636
|
+
context?: string;
|
|
1637
|
+
}): Promise<ExitReason>;
|
|
1638
|
+
continueTask(userMessage: string): Promise<ExitReason>;
|
|
1639
|
+
get hasActiveAgent(): boolean;
|
|
1640
|
+
}
|
|
1641
|
+
export { MultiAgent }
|
|
1642
|
+
export { MultiAgent as MultiAgent_alias_1 }
|
|
1643
|
+
export { MultiAgent as MultiAgent_alias_2 }
|
|
1644
|
+
|
|
1645
|
+
declare type MultiAgentConfig = {
|
|
1646
|
+
createAgent: (name: string) => Promise<AgentBase>;
|
|
1647
|
+
getContext?: (name: string, context?: string, files?: string[]) => Promise<string>;
|
|
1648
|
+
};
|
|
1649
|
+
export { MultiAgentConfig }
|
|
1650
|
+
export { MultiAgentConfig as MultiAgentConfig_alias_1 }
|
|
1651
|
+
export { MultiAgentConfig as MultiAgentConfig_alias_2 }
|
|
1652
|
+
|
|
1653
|
+
export declare const objectives: (toolNamePrefix: string) => string;
|
|
1654
|
+
|
|
1655
|
+
export declare class OllamaService extends AiServiceBase {
|
|
1656
|
+
#private;
|
|
1657
|
+
readonly model: {
|
|
1658
|
+
provider: string;
|
|
1659
|
+
id: string;
|
|
1660
|
+
info: ModelInfo;
|
|
1661
|
+
};
|
|
1662
|
+
constructor(options: AiServiceOptions);
|
|
1663
|
+
sendImpl(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
declare const openAiModelInfoSaneDefaults: {
|
|
1667
|
+
readonly maxTokens: -1;
|
|
1668
|
+
readonly contextWindow: 128000;
|
|
1669
|
+
readonly supportsImages: true;
|
|
1670
|
+
readonly supportsPromptCache: false;
|
|
1671
|
+
readonly inputPrice: 0;
|
|
1672
|
+
readonly outputPrice: 0;
|
|
1673
|
+
};
|
|
1674
|
+
export { openAiModelInfoSaneDefaults }
|
|
1675
|
+
export { openAiModelInfoSaneDefaults as openAiModelInfoSaneDefaults_alias_1 }
|
|
1676
|
+
|
|
1677
|
+
export declare class OpenRouterService extends AiServiceBase {
|
|
1678
|
+
#private;
|
|
1679
|
+
readonly model: {
|
|
1680
|
+
provider: string;
|
|
1681
|
+
id: string;
|
|
1682
|
+
info: ModelInfo;
|
|
1683
|
+
};
|
|
1684
|
+
constructor(options: AiServiceOptions);
|
|
1685
|
+
sendImpl(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
declare type Output = {
|
|
1689
|
+
title: string;
|
|
1690
|
+
description: string;
|
|
1691
|
+
};
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Parse an assistant's message into an array of text content and tool use content.
|
|
1695
|
+
*
|
|
1696
|
+
* @example
|
|
1697
|
+
* const tools = [
|
|
1698
|
+
* {
|
|
1699
|
+
* name: "search",
|
|
1700
|
+
* parameters: [
|
|
1701
|
+
* {name: "query", type: "string"}
|
|
1702
|
+
* ]
|
|
1703
|
+
* }
|
|
1704
|
+
* ]
|
|
1705
|
+
*
|
|
1706
|
+
* // Text only
|
|
1707
|
+
* parseAssistantMessage("Hello world", tools, "tool_")
|
|
1708
|
+
* // Returns: [{type: "text", content: "Hello world"}]
|
|
1709
|
+
*
|
|
1710
|
+
* // Tool use with parameters
|
|
1711
|
+
* parseAssistantMessage(
|
|
1712
|
+
* `Let me search that for you
|
|
1713
|
+
* <tool_search>
|
|
1714
|
+
* <tool_parameter_query>cats</tool_parameter_query>
|
|
1715
|
+
* </tool_search>
|
|
1716
|
+
* Here are the results`,
|
|
1717
|
+
* tools,
|
|
1718
|
+
* "tool_"
|
|
1719
|
+
* )
|
|
1720
|
+
* // Returns: [
|
|
1721
|
+
* // {type: "text", content: "Let me search that for you"},
|
|
1722
|
+
* // {type: "tool_use", name: "search", params: {query: "cats"}},
|
|
1723
|
+
* // {type: "text", content: "Here are the results"}
|
|
1724
|
+
* // ]
|
|
1725
|
+
*/
|
|
1726
|
+
export declare function parseAssistantMessage(assistantMessage: string, tools: ToolInfo[], toolNamePrefix: string): AssistantMessageContent[];
|
|
1727
|
+
|
|
1728
|
+
declare enum PermissionLevel {
|
|
1729
|
+
None = 0,
|
|
1730
|
+
Read = 1,
|
|
1731
|
+
Write = 2,
|
|
1732
|
+
Arbitrary = 3
|
|
1733
|
+
}
|
|
1734
|
+
export { PermissionLevel }
|
|
1735
|
+
export { PermissionLevel as PermissionLevel_alias_1 }
|
|
1736
|
+
|
|
1737
|
+
declare const replaceInFile_2: (fileContent: string, diff: string) => Promise<string>;
|
|
1738
|
+
export { replaceInFile_2 as replaceInFile_alias_3 }
|
|
1739
|
+
export { replaceInFile_2 as replaceInFile_alias_4 }
|
|
1740
|
+
|
|
1741
|
+
export declare const responsePrompts: {
|
|
1742
|
+
readonly errorInvokeTool: (tool: string, error: unknown) => string;
|
|
1743
|
+
readonly requireUseTool: "Error: You MUST use a tool before proceeding using XCM tags. e.g. <tool_tool_name>tool_name</tool_tool_name>";
|
|
1744
|
+
readonly toolResults: (tool: string, result: string) => string;
|
|
1745
|
+
readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1748
|
+
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";
|
|
1749
|
+
|
|
1750
|
+
export declare const rules: (toolNamePrefix: string) => string;
|
|
1751
|
+
|
|
1752
|
+
declare type SharedAgentOptions = {
|
|
1753
|
+
ai: AiServiceBase;
|
|
1754
|
+
os: string;
|
|
1755
|
+
provider: ToolProvider;
|
|
1756
|
+
interactive: boolean;
|
|
1757
|
+
additionalTools?: FullToolInfo[];
|
|
1758
|
+
customInstructions?: string[];
|
|
1759
|
+
scripts?: Record<string, string | {
|
|
1760
|
+
command: string;
|
|
1761
|
+
description: string;
|
|
1762
|
+
}>;
|
|
1763
|
+
agents?: Readonly<AgentInfo[]>;
|
|
1764
|
+
callback?: TaskEventCallback;
|
|
1765
|
+
};
|
|
1766
|
+
export { SharedAgentOptions }
|
|
1767
|
+
export { SharedAgentOptions as SharedAgentOptions_alias_1 }
|
|
1768
|
+
export { SharedAgentOptions as SharedAgentOptions_alias_2 }
|
|
1769
|
+
|
|
1770
|
+
export declare const systemInformation: (info: {
|
|
1771
|
+
os: string;
|
|
1772
|
+
}) => string;
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* Union type of all possible task events
|
|
1776
|
+
*/
|
|
1777
|
+
declare type TaskEvent = TaskEventStartTask | TaskEventStartRequest | TaskEventEndRequest | TaskEventUsage | TaskEventText | TaskEventTool | TaskEventToolHandOverDelegate | TaskEventUsageExceeded | TaskEventEndTask;
|
|
1778
|
+
export { TaskEvent }
|
|
1779
|
+
export { TaskEvent as TaskEvent_alias_1 }
|
|
1780
|
+
export { TaskEvent as TaskEvent_alias_2 }
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* Base interface for all task events
|
|
1784
|
+
*/
|
|
1785
|
+
declare interface TaskEventBase {
|
|
1786
|
+
kind: TaskEventKind;
|
|
1787
|
+
agent: AgentBase;
|
|
1788
|
+
}
|
|
1789
|
+
export { TaskEventBase }
|
|
1790
|
+
export { TaskEventBase as TaskEventBase_alias_1 }
|
|
1791
|
+
export { TaskEventBase as TaskEventBase_alias_2 }
|
|
1792
|
+
|
|
1793
|
+
declare type TaskEventCallback = (event: TaskEvent) => void | Promise<void>;
|
|
1794
|
+
export { TaskEventCallback }
|
|
1795
|
+
export { TaskEventCallback as TaskEventCallback_alias_1 }
|
|
1796
|
+
export { TaskEventCallback as TaskEventCallback_alias_2 }
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Event for request end
|
|
1800
|
+
*/
|
|
1801
|
+
declare interface TaskEventEndRequest extends TaskEventBase {
|
|
1802
|
+
kind: TaskEventKind.EndRequest;
|
|
1803
|
+
}
|
|
1804
|
+
export { TaskEventEndRequest }
|
|
1805
|
+
export { TaskEventEndRequest as TaskEventEndRequest_alias_1 }
|
|
1806
|
+
export { TaskEventEndRequest as TaskEventEndRequest_alias_2 }
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* Event for task end
|
|
1810
|
+
*/
|
|
1811
|
+
declare interface TaskEventEndTask extends TaskEventBase {
|
|
1812
|
+
kind: TaskEventKind.EndTask;
|
|
1813
|
+
exitReason: ExitReason;
|
|
1814
|
+
}
|
|
1815
|
+
export { TaskEventEndTask }
|
|
1816
|
+
export { TaskEventEndTask as TaskEventEndTask_alias_1 }
|
|
1817
|
+
export { TaskEventEndTask as TaskEventEndTask_alias_2 }
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* Enum representing different kinds of task events
|
|
1821
|
+
*/
|
|
1822
|
+
declare enum TaskEventKind {
|
|
1823
|
+
StartTask = "StartTask",
|
|
1824
|
+
StartRequest = "StartRequest",
|
|
1825
|
+
EndRequest = "EndRequest",
|
|
1826
|
+
Usage = "Usage",
|
|
1827
|
+
Text = "Text",
|
|
1828
|
+
Reasoning = "Reasoning",
|
|
1829
|
+
ToolUse = "ToolUse",
|
|
1830
|
+
ToolReply = "ToolReply",
|
|
1831
|
+
ToolInvalid = "ToolInvalid",
|
|
1832
|
+
ToolError = "ToolError",
|
|
1833
|
+
ToolInterrupted = "ToolInterrupted",
|
|
1834
|
+
ToolHandOver = "ToolHandOver",
|
|
1835
|
+
ToolDelegate = "ToolDelegate",
|
|
1836
|
+
UsageExceeded = "UsageExceeded",
|
|
1837
|
+
EndTask = "EndTask"
|
|
1838
|
+
}
|
|
1839
|
+
export { TaskEventKind }
|
|
1840
|
+
export { TaskEventKind as TaskEventKind_alias_1 }
|
|
1841
|
+
export { TaskEventKind as TaskEventKind_alias_2 }
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Event for request start
|
|
1845
|
+
*/
|
|
1846
|
+
declare interface TaskEventStartRequest extends TaskEventBase {
|
|
1847
|
+
kind: TaskEventKind.StartRequest;
|
|
1848
|
+
userMessage: string;
|
|
1849
|
+
}
|
|
1850
|
+
export { TaskEventStartRequest }
|
|
1851
|
+
export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
|
|
1852
|
+
export { TaskEventStartRequest as TaskEventStartRequest_alias_2 }
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Event for task start
|
|
1856
|
+
*/
|
|
1857
|
+
declare interface TaskEventStartTask extends TaskEventBase {
|
|
1858
|
+
kind: TaskEventKind.StartTask;
|
|
1859
|
+
systemPrompt: string;
|
|
1860
|
+
}
|
|
1861
|
+
export { TaskEventStartTask }
|
|
1862
|
+
export { TaskEventStartTask as TaskEventStartTask_alias_1 }
|
|
1863
|
+
export { TaskEventStartTask as TaskEventStartTask_alias_2 }
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* Event for text/reasoning updates
|
|
1867
|
+
*/
|
|
1868
|
+
declare interface TaskEventText extends TaskEventBase {
|
|
1869
|
+
kind: TaskEventKind.Text | TaskEventKind.Reasoning;
|
|
1870
|
+
newText: string;
|
|
1871
|
+
}
|
|
1872
|
+
export { TaskEventText }
|
|
1873
|
+
export { TaskEventText as TaskEventText_alias_1 }
|
|
1874
|
+
export { TaskEventText as TaskEventText_alias_2 }
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* Event for tool-related updates
|
|
1878
|
+
*/
|
|
1879
|
+
declare interface TaskEventTool extends TaskEventBase {
|
|
1880
|
+
kind: TaskEventKind.ToolUse | TaskEventKind.ToolReply | TaskEventKind.ToolInvalid | TaskEventKind.ToolError | TaskEventKind.ToolInterrupted;
|
|
1881
|
+
tool: string;
|
|
1882
|
+
}
|
|
1883
|
+
export { TaskEventTool }
|
|
1884
|
+
export { TaskEventTool as TaskEventTool_alias_1 }
|
|
1885
|
+
export { TaskEventTool as TaskEventTool_alias_2 }
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Event for tool handover
|
|
1889
|
+
*/
|
|
1890
|
+
declare interface TaskEventToolHandOverDelegate extends TaskEventBase {
|
|
1891
|
+
kind: TaskEventKind.ToolHandOver | TaskEventKind.ToolDelegate;
|
|
1892
|
+
tool: string;
|
|
1893
|
+
agentName: string;
|
|
1894
|
+
task: string;
|
|
1895
|
+
context?: string;
|
|
1896
|
+
files?: string[];
|
|
1897
|
+
}
|
|
1898
|
+
export { TaskEventToolHandOverDelegate }
|
|
1899
|
+
export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_1 }
|
|
1900
|
+
export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_2 }
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* Event for API usage updates
|
|
1904
|
+
*/
|
|
1905
|
+
declare interface TaskEventUsage extends TaskEventBase {
|
|
1906
|
+
kind: TaskEventKind.Usage;
|
|
1907
|
+
}
|
|
1908
|
+
export { TaskEventUsage }
|
|
1909
|
+
export { TaskEventUsage as TaskEventUsage_alias_1 }
|
|
1910
|
+
export { TaskEventUsage as TaskEventUsage_alias_2 }
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* Event for task usage exceeded
|
|
1914
|
+
*/
|
|
1915
|
+
declare interface TaskEventUsageExceeded extends TaskEventBase {
|
|
1916
|
+
kind: TaskEventKind.UsageExceeded;
|
|
1917
|
+
}
|
|
1918
|
+
export { TaskEventUsageExceeded }
|
|
1919
|
+
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
|
|
1920
|
+
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
|
|
1921
|
+
|
|
1922
|
+
export declare interface TextContent {
|
|
1923
|
+
type: 'text';
|
|
1924
|
+
content: string;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
declare type ToolExample = {
|
|
1928
|
+
description: string;
|
|
1929
|
+
parameters: {
|
|
1930
|
+
name: string;
|
|
1931
|
+
value: string;
|
|
1932
|
+
}[];
|
|
1933
|
+
};
|
|
1934
|
+
export { ToolExample }
|
|
1935
|
+
export { ToolExample as ToolExample_alias_1 }
|
|
1936
|
+
|
|
1937
|
+
declare type ToolHandler<T extends ToolInfo, P> = (provider: P, args: Partial<Record<T['parameters'][number]['name'], string>>) => Promise<ToolResponse>;
|
|
1938
|
+
export { ToolHandler }
|
|
1939
|
+
export { ToolHandler as ToolHandler_alias_1 }
|
|
1940
|
+
|
|
1941
|
+
declare type ToolInfo = {
|
|
1942
|
+
name: string;
|
|
1943
|
+
description: string;
|
|
1944
|
+
parameters: ToolParameter[];
|
|
1945
|
+
examples?: ToolExample[];
|
|
1946
|
+
permissionLevel: PermissionLevel;
|
|
1947
|
+
};
|
|
1948
|
+
export { ToolInfo }
|
|
1949
|
+
export { ToolInfo as ToolInfo_alias_1 }
|
|
1950
|
+
|
|
1951
|
+
export declare const toolInfo: {
|
|
1952
|
+
readonly name: "ask_followup_question";
|
|
1953
|
+
readonly description: "Whenever you need extra details or clarification to complete the task, pose a direct question to the user. Use this tool sparingly to avoid excessive back-and-forth. If helpful, offer multiple-choice options or examples to guide the user’s response.";
|
|
1954
|
+
readonly parameters: [{
|
|
1955
|
+
readonly name: "question";
|
|
1956
|
+
readonly description: "The question to ask the user. This should be a clear, specific question that addresses the information you need.";
|
|
1957
|
+
readonly required: true;
|
|
1958
|
+
readonly usageValue: "Your question here";
|
|
1959
|
+
}, {
|
|
1960
|
+
readonly name: "options";
|
|
1961
|
+
readonly description: "A comma separated list of possible answers to the question. Ordered by preference. If not provided, the user will be prompted to provide an answer.";
|
|
1962
|
+
readonly required: false;
|
|
1963
|
+
readonly usageValue: "A comma separated list of possible answers (optional)";
|
|
1964
|
+
}];
|
|
1965
|
+
readonly examples: [{
|
|
1966
|
+
readonly description: "Request to ask a question";
|
|
1967
|
+
readonly parameters: [{
|
|
1968
|
+
readonly name: "question";
|
|
1969
|
+
readonly value: "What is the name of the project?";
|
|
1970
|
+
}];
|
|
1971
|
+
}, {
|
|
1972
|
+
readonly description: "Request to ask a question with options";
|
|
1973
|
+
readonly parameters: [{
|
|
1974
|
+
readonly name: "question";
|
|
1975
|
+
readonly value: "What framework do you use?";
|
|
1976
|
+
}, {
|
|
1977
|
+
readonly name: "options";
|
|
1978
|
+
readonly value: "React,Angular,Vue,Svelte";
|
|
1979
|
+
}];
|
|
1980
|
+
}];
|
|
1981
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1984
|
+
export declare const toolInfo_alias_1: {
|
|
1985
|
+
readonly name: "attempt_completion";
|
|
1986
|
+
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.";
|
|
1987
|
+
readonly parameters: [{
|
|
1988
|
+
readonly name: "result";
|
|
1989
|
+
readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
|
|
1990
|
+
readonly required: true;
|
|
1991
|
+
readonly usageValue: "Your final result description here";
|
|
1992
|
+
}];
|
|
1993
|
+
readonly examples: [{
|
|
1994
|
+
readonly description: "Request to present the result of the task";
|
|
1995
|
+
readonly parameters: [{
|
|
1996
|
+
readonly name: "result";
|
|
1997
|
+
readonly value: "Your final result description here";
|
|
1998
|
+
}];
|
|
1999
|
+
}];
|
|
2000
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
2001
|
+
};
|
|
2002
|
+
|
|
2003
|
+
export declare const toolInfo_alias_10: {
|
|
2004
|
+
readonly name: "replace_in_file";
|
|
2005
|
+
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.";
|
|
2006
|
+
readonly parameters: [{
|
|
2007
|
+
readonly name: "path";
|
|
2008
|
+
readonly description: "The path of the file to modify";
|
|
2009
|
+
readonly required: true;
|
|
2010
|
+
readonly usageValue: "File path here";
|
|
2011
|
+
}, {
|
|
2012
|
+
readonly name: "diff";
|
|
2013
|
+
readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
|
|
2014
|
+
readonly required: true;
|
|
2015
|
+
readonly usageValue: "Search and replace blocks here";
|
|
2016
|
+
}];
|
|
2017
|
+
readonly examples: [{
|
|
2018
|
+
readonly description: "Request to replace sections of content in a file";
|
|
2019
|
+
readonly parameters: [{
|
|
2020
|
+
readonly name: "path";
|
|
2021
|
+
readonly value: "src/main.js";
|
|
2022
|
+
}, {
|
|
2023
|
+
readonly name: "diff";
|
|
2024
|
+
readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
|
|
2025
|
+
}];
|
|
2026
|
+
}];
|
|
2027
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
2028
|
+
};
|
|
2029
|
+
|
|
2030
|
+
export declare const toolInfo_alias_11: {
|
|
2031
|
+
readonly name: "search_files";
|
|
2032
|
+
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.";
|
|
2033
|
+
readonly parameters: [{
|
|
2034
|
+
readonly name: "path";
|
|
2035
|
+
readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
|
|
2036
|
+
readonly required: true;
|
|
2037
|
+
readonly usageValue: "Directory path here";
|
|
2038
|
+
}, {
|
|
2039
|
+
readonly name: "regex";
|
|
2040
|
+
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
2041
|
+
readonly required: true;
|
|
2042
|
+
readonly usageValue: "Your regex pattern here";
|
|
2043
|
+
}, {
|
|
2044
|
+
readonly name: "file_pattern";
|
|
2045
|
+
readonly description: "Glob pattern to filter files (e.g., \"*.ts\" for TypeScript files). If not provided, it will search all files (*).";
|
|
2046
|
+
readonly required: false;
|
|
2047
|
+
readonly usageValue: "file pattern here (optional)";
|
|
2048
|
+
}];
|
|
2049
|
+
readonly examples: [{
|
|
2050
|
+
readonly description: "Request to perform a regex search across files";
|
|
2051
|
+
readonly parameters: [{
|
|
2052
|
+
readonly name: "path";
|
|
2053
|
+
readonly value: "src";
|
|
2054
|
+
}, {
|
|
2055
|
+
readonly name: "regex";
|
|
2056
|
+
readonly value: "^components/";
|
|
2057
|
+
}, {
|
|
2058
|
+
readonly name: "file_pattern";
|
|
2059
|
+
readonly value: "*.ts";
|
|
2060
|
+
}];
|
|
2061
|
+
}];
|
|
2062
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
export declare const toolInfo_alias_12: {
|
|
2066
|
+
readonly name: "write_to_file";
|
|
2067
|
+
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.";
|
|
2068
|
+
readonly parameters: [{
|
|
2069
|
+
readonly name: "path";
|
|
2070
|
+
readonly description: "The path of the file to write to";
|
|
2071
|
+
readonly required: true;
|
|
2072
|
+
readonly usageValue: "File path here";
|
|
2073
|
+
}, {
|
|
2074
|
+
readonly name: "content";
|
|
2075
|
+
readonly description: "The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.";
|
|
2076
|
+
readonly required: true;
|
|
2077
|
+
readonly usageValue: "Your file content here";
|
|
2078
|
+
}];
|
|
2079
|
+
readonly examples: [{
|
|
2080
|
+
readonly description: "Request to write content to a file";
|
|
2081
|
+
readonly parameters: [{
|
|
2082
|
+
readonly name: "path";
|
|
2083
|
+
readonly value: "src/main.js";
|
|
2084
|
+
}, {
|
|
2085
|
+
readonly name: "content";
|
|
2086
|
+
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
2087
|
+
}];
|
|
2088
|
+
}];
|
|
2089
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
2090
|
+
};
|
|
2091
|
+
|
|
2092
|
+
export declare const toolInfo_alias_2: {
|
|
2093
|
+
readonly name: "delegate";
|
|
2094
|
+
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.";
|
|
2095
|
+
readonly parameters: [{
|
|
2096
|
+
readonly name: "agent_name";
|
|
2097
|
+
readonly description: "The name of the agent to delegate the task to";
|
|
2098
|
+
readonly required: true;
|
|
2099
|
+
readonly usageValue: "Name of the target agent";
|
|
2100
|
+
}, {
|
|
2101
|
+
readonly name: "task";
|
|
2102
|
+
readonly description: "The task to be completed by the target agent";
|
|
2103
|
+
readonly required: true;
|
|
2104
|
+
readonly usageValue: "Task description";
|
|
2105
|
+
}, {
|
|
2106
|
+
readonly name: "context";
|
|
2107
|
+
readonly description: "The context information for the task";
|
|
2108
|
+
readonly required: true;
|
|
2109
|
+
readonly usageValue: "Context information";
|
|
2110
|
+
}, {
|
|
2111
|
+
readonly name: "files";
|
|
2112
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
2113
|
+
readonly required: false;
|
|
2114
|
+
readonly usageValue: "Relevant files";
|
|
2115
|
+
}];
|
|
2116
|
+
readonly examples: [{
|
|
2117
|
+
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
2118
|
+
readonly parameters: [{
|
|
2119
|
+
readonly name: "agent_name";
|
|
2120
|
+
readonly value: "analyzer";
|
|
2121
|
+
}, {
|
|
2122
|
+
readonly name: "task";
|
|
2123
|
+
readonly value: "Analyze the authentication implementation";
|
|
2124
|
+
}, {
|
|
2125
|
+
readonly name: "context";
|
|
2126
|
+
readonly value: "Need to understand the security implications of the current auth system";
|
|
2127
|
+
}, {
|
|
2128
|
+
readonly name: "files";
|
|
2129
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
2130
|
+
}];
|
|
2131
|
+
}];
|
|
2132
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
2133
|
+
};
|
|
2134
|
+
|
|
2135
|
+
export declare const toolInfo_alias_3: {
|
|
2136
|
+
readonly name: "execute_command";
|
|
2137
|
+
readonly description: "Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will also be executed in the project root directory regardless of executed commands in previous tool uses.";
|
|
2138
|
+
readonly parameters: [{
|
|
2139
|
+
readonly name: "command";
|
|
2140
|
+
readonly description: "The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.";
|
|
2141
|
+
readonly required: true;
|
|
2142
|
+
readonly usageValue: "Your command here";
|
|
2143
|
+
}, {
|
|
2144
|
+
readonly name: "requires_approval";
|
|
2145
|
+
readonly description: "A boolean indicating whether this command requires explicit user approval before execution in case the user has auto-approve mode enabled. Set to 'true' for potentially impactful operations like installing/uninstalling packages, deleting/overwriting files, system configuration changes, network operations, or any commands that could have unintended side effects. Set to 'false' for safe operations like reading files/directories, running development servers, building projects, and other non-destructive operations.";
|
|
2146
|
+
readonly required: false;
|
|
2147
|
+
readonly usageValue: "true or false";
|
|
2148
|
+
}];
|
|
2149
|
+
readonly examples: [{
|
|
2150
|
+
readonly description: "Request to execute a command";
|
|
2151
|
+
readonly parameters: [{
|
|
2152
|
+
readonly name: "command";
|
|
2153
|
+
readonly value: "npm run dev";
|
|
2154
|
+
}, {
|
|
2155
|
+
readonly name: "requires_approval";
|
|
2156
|
+
readonly value: "false";
|
|
2157
|
+
}];
|
|
2158
|
+
}];
|
|
2159
|
+
readonly permissionLevel: PermissionLevel.Arbitrary;
|
|
2160
|
+
};
|
|
2161
|
+
|
|
2162
|
+
export declare const toolInfo_alias_4: {
|
|
2163
|
+
readonly name: "hand_over";
|
|
2164
|
+
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
2165
|
+
readonly parameters: [{
|
|
2166
|
+
readonly name: "agent_name";
|
|
2167
|
+
readonly description: "The name of the agent to hand over the task to";
|
|
2168
|
+
readonly required: true;
|
|
2169
|
+
readonly usageValue: "Name of the target agent";
|
|
2170
|
+
}, {
|
|
2171
|
+
readonly name: "task";
|
|
2172
|
+
readonly description: "The task to be completed by the target agent";
|
|
2173
|
+
readonly required: true;
|
|
2174
|
+
readonly usageValue: "Task description";
|
|
2175
|
+
}, {
|
|
2176
|
+
readonly name: "context";
|
|
2177
|
+
readonly description: "The context information for the task";
|
|
2178
|
+
readonly required: true;
|
|
2179
|
+
readonly usageValue: "Context information";
|
|
2180
|
+
}, {
|
|
2181
|
+
readonly name: "files";
|
|
2182
|
+
readonly description: "The files relevant to the task. Comma separated paths";
|
|
2183
|
+
readonly required: false;
|
|
2184
|
+
readonly usageValue: "Relevant files";
|
|
2185
|
+
}];
|
|
2186
|
+
readonly examples: [{
|
|
2187
|
+
readonly description: "Hand over a coding task to the coder agent";
|
|
2188
|
+
readonly parameters: [{
|
|
2189
|
+
readonly name: "agent_name";
|
|
2190
|
+
readonly value: "coder";
|
|
2191
|
+
}, {
|
|
2192
|
+
readonly name: "task";
|
|
2193
|
+
readonly value: "Implement the login feature";
|
|
2194
|
+
}, {
|
|
2195
|
+
readonly name: "context";
|
|
2196
|
+
readonly value: "We need a secure login system with email and password";
|
|
2197
|
+
}, {
|
|
2198
|
+
readonly name: "files";
|
|
2199
|
+
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
2200
|
+
}];
|
|
2201
|
+
}];
|
|
2202
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
export declare const toolInfo_alias_5: {
|
|
2206
|
+
readonly name: "list_code_definition_names";
|
|
2207
|
+
readonly description: "Request to list definition names (classes, functions, methods, etc.) used for all files in a directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.";
|
|
2208
|
+
readonly parameters: [{
|
|
2209
|
+
readonly name: "path";
|
|
2210
|
+
readonly description: "The path of a code file to list top level source code definitions for.";
|
|
2211
|
+
readonly required: true;
|
|
2212
|
+
readonly usageValue: "Directory path here";
|
|
2213
|
+
}];
|
|
2214
|
+
readonly examples: [{
|
|
2215
|
+
readonly description: "Request to list code definition names in a directory";
|
|
2216
|
+
readonly parameters: [{
|
|
2217
|
+
readonly name: "path";
|
|
2218
|
+
readonly value: "src/utils";
|
|
2219
|
+
}];
|
|
2220
|
+
}];
|
|
2221
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
2222
|
+
};
|
|
2223
|
+
|
|
2224
|
+
export declare const toolInfo_alias_6: {
|
|
2225
|
+
readonly name: "list_files";
|
|
2226
|
+
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.";
|
|
2227
|
+
readonly parameters: [{
|
|
2228
|
+
readonly name: "path";
|
|
2229
|
+
readonly description: "The path of the directory to list contents for (relative to the current working directory)";
|
|
2230
|
+
readonly required: true;
|
|
2231
|
+
readonly usageValue: "Directory path here";
|
|
2232
|
+
}, {
|
|
2233
|
+
readonly name: "max_count";
|
|
2234
|
+
readonly description: "The maximum number of files to list. Default to 2000";
|
|
2235
|
+
readonly required: false;
|
|
2236
|
+
readonly usageValue: "Maximum number of files to list (optional)";
|
|
2237
|
+
}, {
|
|
2238
|
+
readonly name: "recursive";
|
|
2239
|
+
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
2240
|
+
readonly required: false;
|
|
2241
|
+
readonly usageValue: "true or false (optional)";
|
|
2242
|
+
}];
|
|
2243
|
+
readonly examples: [{
|
|
2244
|
+
readonly description: "Request to list files";
|
|
2245
|
+
readonly parameters: [{
|
|
2246
|
+
readonly name: "path";
|
|
2247
|
+
readonly value: "src";
|
|
2248
|
+
}, {
|
|
2249
|
+
readonly name: "max_count";
|
|
2250
|
+
readonly value: "100";
|
|
2251
|
+
}];
|
|
2252
|
+
}];
|
|
2253
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
2254
|
+
};
|
|
2255
|
+
|
|
2256
|
+
export declare const toolInfo_alias_7: {
|
|
2257
|
+
readonly name: "read_file";
|
|
2258
|
+
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.";
|
|
2259
|
+
readonly parameters: [{
|
|
2260
|
+
readonly name: "path";
|
|
2261
|
+
readonly description: "The path of the file to read";
|
|
2262
|
+
readonly required: true;
|
|
2263
|
+
readonly usageValue: "Comma separated paths here";
|
|
2264
|
+
}];
|
|
2265
|
+
readonly examples: [{
|
|
2266
|
+
readonly description: "Request to read the contents of a file";
|
|
2267
|
+
readonly parameters: [{
|
|
2268
|
+
readonly name: "path";
|
|
2269
|
+
readonly value: "src/main.js";
|
|
2270
|
+
}];
|
|
2271
|
+
}, {
|
|
2272
|
+
readonly description: "Request to read multiple files";
|
|
2273
|
+
readonly parameters: [{
|
|
2274
|
+
readonly name: "path";
|
|
2275
|
+
readonly value: "src/main.js,src/index.js";
|
|
2276
|
+
}];
|
|
2277
|
+
}];
|
|
2278
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
2279
|
+
};
|
|
2280
|
+
|
|
2281
|
+
export declare const toolInfo_alias_8: {
|
|
2282
|
+
readonly name: "remove_file";
|
|
2283
|
+
readonly description: "Request to remove a file at the specified path.";
|
|
2284
|
+
readonly parameters: [{
|
|
2285
|
+
readonly name: "path";
|
|
2286
|
+
readonly description: "The path of the file to remove";
|
|
2287
|
+
readonly required: true;
|
|
2288
|
+
readonly usageValue: "File path here";
|
|
2289
|
+
}];
|
|
2290
|
+
readonly examples: [{
|
|
2291
|
+
readonly description: "Request to remove a file";
|
|
2292
|
+
readonly parameters: [{
|
|
2293
|
+
readonly name: "path";
|
|
2294
|
+
readonly value: "src/main.js";
|
|
2295
|
+
}];
|
|
2296
|
+
}];
|
|
2297
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
2298
|
+
};
|
|
2299
|
+
|
|
2300
|
+
export declare const toolInfo_alias_9: {
|
|
2301
|
+
readonly name: "rename_file";
|
|
2302
|
+
readonly description: "Request to rename a file from source path to target path.";
|
|
2303
|
+
readonly parameters: [{
|
|
2304
|
+
readonly name: "sourcePath";
|
|
2305
|
+
readonly description: "The current path of the file";
|
|
2306
|
+
readonly required: true;
|
|
2307
|
+
readonly usageValue: "Source file path here";
|
|
2308
|
+
}, {
|
|
2309
|
+
readonly name: "targetPath";
|
|
2310
|
+
readonly description: "The new path for the file";
|
|
2311
|
+
readonly required: true;
|
|
2312
|
+
readonly usageValue: "Target file path here";
|
|
2313
|
+
}];
|
|
2314
|
+
readonly examples: [{
|
|
2315
|
+
readonly description: "Request to rename a file";
|
|
2316
|
+
readonly parameters: [{
|
|
2317
|
+
readonly name: "sourcePath";
|
|
2318
|
+
readonly value: "src/old-name.js";
|
|
2319
|
+
}, {
|
|
2320
|
+
readonly name: "targetPath";
|
|
2321
|
+
readonly value: "src/new-name.js";
|
|
2322
|
+
}];
|
|
2323
|
+
}];
|
|
2324
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
declare type ToolParameter = {
|
|
2328
|
+
name: string;
|
|
2329
|
+
description: string;
|
|
2330
|
+
required: boolean;
|
|
2331
|
+
usageValue: string;
|
|
2332
|
+
};
|
|
2333
|
+
export { ToolParameter }
|
|
2334
|
+
export { ToolParameter as ToolParameter_alias_1 }
|
|
2335
|
+
|
|
2336
|
+
declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider;
|
|
2337
|
+
export { ToolProvider }
|
|
2338
|
+
export { ToolProvider as ToolProvider_alias_1 }
|
|
2339
|
+
export { ToolProvider as ToolProvider_alias_2 }
|
|
2340
|
+
|
|
2341
|
+
declare type ToolResponse = ToolResponseReply | ToolResponseExit | ToolResponseInvalid | ToolResponseError | ToolResponseInterrupted | ToolResponseHandOver | ToolResponseDelegate;
|
|
2342
|
+
export { ToolResponse }
|
|
2343
|
+
export { ToolResponse as ToolResponse_alias_1 }
|
|
2344
|
+
|
|
2345
|
+
declare type ToolResponseDelegate = {
|
|
2346
|
+
type: ToolResponseType.Delegate;
|
|
2347
|
+
agentName: string;
|
|
2348
|
+
task: string;
|
|
2349
|
+
context?: string;
|
|
2350
|
+
files?: string[];
|
|
2351
|
+
};
|
|
2352
|
+
export { ToolResponseDelegate }
|
|
2353
|
+
export { ToolResponseDelegate as ToolResponseDelegate_alias_1 }
|
|
2354
|
+
|
|
2355
|
+
declare type ToolResponseError = {
|
|
2356
|
+
type: ToolResponseType.Error;
|
|
2357
|
+
message: string;
|
|
2358
|
+
canRetry?: boolean;
|
|
2359
|
+
};
|
|
2360
|
+
export { ToolResponseError }
|
|
2361
|
+
export { ToolResponseError as ToolResponseError_alias_1 }
|
|
2362
|
+
|
|
2363
|
+
declare type ToolResponseExit = {
|
|
2364
|
+
type: ToolResponseType.Exit;
|
|
2365
|
+
message: string;
|
|
2366
|
+
};
|
|
2367
|
+
export { ToolResponseExit }
|
|
2368
|
+
export { ToolResponseExit as ToolResponseExit_alias_1 }
|
|
2369
|
+
|
|
2370
|
+
declare type ToolResponseHandOver = {
|
|
2371
|
+
type: ToolResponseType.HandOver;
|
|
2372
|
+
agentName: string;
|
|
2373
|
+
task: string;
|
|
2374
|
+
context?: string;
|
|
2375
|
+
files?: string[];
|
|
2376
|
+
};
|
|
2377
|
+
export { ToolResponseHandOver }
|
|
2378
|
+
export { ToolResponseHandOver as ToolResponseHandOver_alias_1 }
|
|
2379
|
+
|
|
2380
|
+
declare type ToolResponseInterrupted = {
|
|
2381
|
+
type: ToolResponseType.Interrupted;
|
|
2382
|
+
message: string;
|
|
2383
|
+
};
|
|
2384
|
+
export { ToolResponseInterrupted }
|
|
2385
|
+
export { ToolResponseInterrupted as ToolResponseInterrupted_alias_1 }
|
|
2386
|
+
|
|
2387
|
+
declare type ToolResponseInvalid = {
|
|
2388
|
+
type: ToolResponseType.Invalid;
|
|
2389
|
+
message: string;
|
|
2390
|
+
};
|
|
2391
|
+
export { ToolResponseInvalid }
|
|
2392
|
+
export { ToolResponseInvalid as ToolResponseInvalid_alias_1 }
|
|
2393
|
+
|
|
2394
|
+
declare type ToolResponseReply = {
|
|
2395
|
+
type: ToolResponseType.Reply;
|
|
2396
|
+
message: string;
|
|
2397
|
+
};
|
|
2398
|
+
export { ToolResponseReply }
|
|
2399
|
+
export { ToolResponseReply as ToolResponseReply_alias_1 }
|
|
2400
|
+
|
|
2401
|
+
declare enum ToolResponseType {
|
|
2402
|
+
Reply = "Reply",
|
|
2403
|
+
Exit = "Exit",
|
|
2404
|
+
Invalid = "Invalid",
|
|
2405
|
+
Error = "Error",
|
|
2406
|
+
Interrupted = "Interrupted",
|
|
2407
|
+
HandOver = "HandOver",
|
|
2408
|
+
Delegate = "Delegate"
|
|
2409
|
+
}
|
|
2410
|
+
export { ToolResponseType }
|
|
2411
|
+
export { ToolResponseType as ToolResponseType_alias_1 }
|
|
2412
|
+
|
|
2413
|
+
export declare interface ToolUse {
|
|
2414
|
+
type: 'tool_use';
|
|
2415
|
+
name: string;
|
|
2416
|
+
params: Record<string, string>;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
export declare const toolUsePrompt: (tools: ToolInfo[], toolNamePrefix: string) => string;
|
|
2420
|
+
|
|
2421
|
+
declare class UsageMeter {
|
|
2422
|
+
#private;
|
|
2423
|
+
readonly maxCost: number;
|
|
2424
|
+
readonly maxMessageCount: number;
|
|
2425
|
+
constructor(options?: {
|
|
2426
|
+
maxCost?: number;
|
|
2427
|
+
maxMessageCount?: number;
|
|
2428
|
+
prices?: Record<string, Record<string, ModelInfo>>;
|
|
2429
|
+
});
|
|
2430
|
+
/**
|
|
2431
|
+
* Add usage metrics to the current totals
|
|
2432
|
+
*/
|
|
2433
|
+
addUsage(usage: Partial<ApiUsage>, model?: {
|
|
2434
|
+
provider: string;
|
|
2435
|
+
id: string;
|
|
2436
|
+
}): void;
|
|
2437
|
+
incrementMessageCount(count?: number): void;
|
|
2438
|
+
isLimitExceeded(): {
|
|
2439
|
+
messageCount: boolean;
|
|
2440
|
+
cost: boolean;
|
|
2441
|
+
result: boolean;
|
|
2442
|
+
};
|
|
2443
|
+
/**
|
|
2444
|
+
* Get current usage totals
|
|
2445
|
+
*/
|
|
2446
|
+
get usage(): ApiUsage;
|
|
2447
|
+
printUsage(): void;
|
|
2448
|
+
}
|
|
2449
|
+
export { UsageMeter }
|
|
2450
|
+
export { UsageMeter as UsageMeter_alias_1 }
|
|
2451
|
+
export { UsageMeter as UsageMeter_alias_2 }
|
|
2452
|
+
|
|
2453
|
+
export { }
|