@polka-codes/core 0.8.28 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.ts +379 -1640
- package/dist/index.d.ts +9 -30
- package/dist/index.js +824 -1960
- package/package.json +5 -4
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { FilePart } from 'ai';
|
|
2
|
+
import type { ImagePart } from 'ai';
|
|
3
|
+
import type { LanguageModelV2 } from '@ai-sdk/provider';
|
|
4
|
+
import type { LanguageModelV2Usage } from '@ai-sdk/provider';
|
|
5
|
+
import type { ModelMessage } from 'ai';
|
|
6
|
+
import type { ModelMessage as ModelMessage_2 } from '@ai-sdk/provider-utils';
|
|
7
|
+
import type { TextPart } from 'ai';
|
|
8
|
+
import type { UserContent } from '@ai-sdk/provider-utils';
|
|
9
|
+
import type { UserContent as UserContent_2 } from 'ai';
|
|
3
10
|
import { z } from 'zod';
|
|
4
11
|
|
|
5
12
|
declare abstract class AgentBase {
|
|
6
13
|
#private;
|
|
7
|
-
|
|
14
|
+
readonly ai: LanguageModelV2;
|
|
8
15
|
protected readonly config: Readonly<AgentBaseConfig>;
|
|
9
|
-
protected readonly handlers: Record<string,
|
|
10
|
-
constructor(name: string, ai:
|
|
16
|
+
protected readonly handlers: Record<string, FullToolInfoV2>;
|
|
17
|
+
constructor(name: string, ai: LanguageModelV2, config: AgentBaseConfig);
|
|
11
18
|
abort(): void;
|
|
12
|
-
get parameters(): Readonly<any
|
|
13
|
-
get messages(): Readonly<
|
|
14
|
-
setMessages(messages: Readonly<
|
|
19
|
+
get parameters(): Readonly<Record<string, any>>;
|
|
20
|
+
get messages(): Readonly<ModelMessage_2[]>;
|
|
21
|
+
setMessages(messages: Readonly<ModelMessage_2[]>): void;
|
|
15
22
|
start(prompt: UserContent): Promise<ExitReason>;
|
|
16
23
|
step(prompt: UserContent): Promise<AssistantMessageContent[]>;
|
|
17
24
|
handleStepResponse(response: AssistantMessageContent[]): Promise<{
|
|
@@ -23,18 +30,13 @@ declare abstract class AgentBase {
|
|
|
23
30
|
}>;
|
|
24
31
|
continueTask(userMessage: UserContent): Promise<ExitReason>;
|
|
25
32
|
protected abstract onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
|
|
26
|
-
get model():
|
|
27
|
-
provider: string;
|
|
28
|
-
id: string;
|
|
29
|
-
info: ModelInfo;
|
|
30
|
-
};
|
|
33
|
+
get model(): string;
|
|
31
34
|
get usage(): {
|
|
32
35
|
messageCount: number;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
totalCost: number;
|
|
36
|
+
input: number;
|
|
37
|
+
output: number;
|
|
38
|
+
cachedRead: number;
|
|
39
|
+
cost: number;
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
export { AgentBase }
|
|
@@ -43,7 +45,7 @@ export { AgentBase as AgentBase_alias_2 }
|
|
|
43
45
|
|
|
44
46
|
declare type AgentBaseConfig = {
|
|
45
47
|
systemPrompt: string;
|
|
46
|
-
tools:
|
|
48
|
+
tools: FullToolInfoV2[];
|
|
47
49
|
toolNamePrefix: string;
|
|
48
50
|
provider: ToolProvider;
|
|
49
51
|
interactive: boolean;
|
|
@@ -56,6 +58,9 @@ declare type AgentBaseConfig = {
|
|
|
56
58
|
policies: AgentPolicy[];
|
|
57
59
|
retryCount?: number;
|
|
58
60
|
requestTimeoutSeconds?: number;
|
|
61
|
+
toolFormat: ToolFormat;
|
|
62
|
+
parameters: Record<string, any>;
|
|
63
|
+
usageMeter: UsageMeter;
|
|
59
64
|
};
|
|
60
65
|
export { AgentBaseConfig }
|
|
61
66
|
export { AgentBaseConfig as AgentBaseConfig_alias_1 }
|
|
@@ -73,18 +78,18 @@ declare type AgentNameType = (typeof allAgents)[number]['name'];
|
|
|
73
78
|
export { AgentNameType }
|
|
74
79
|
export { AgentNameType as AgentNameType_alias_1 }
|
|
75
80
|
|
|
76
|
-
declare type AgentPolicy = (tools: Record<string,
|
|
81
|
+
declare type AgentPolicy = (tools: Record<string, FullToolInfoV2>, parameters: Record<string, any>) => AgentPolicyInstance | undefined;
|
|
77
82
|
export { AgentPolicy }
|
|
78
83
|
export { AgentPolicy as AgentPolicy_alias_1 }
|
|
79
84
|
export { AgentPolicy as AgentPolicy_alias_2 }
|
|
80
85
|
|
|
81
86
|
declare type AgentPolicyInstance = {
|
|
82
87
|
name: string;
|
|
83
|
-
tools?:
|
|
88
|
+
tools?: FullToolInfoV2[];
|
|
84
89
|
prompt?: string;
|
|
85
|
-
updateResponse?: (response: AssistantMessageContent[]) => Promise<AssistantMessageContent[]>;
|
|
86
90
|
onBeforeInvokeTool?: (name: string, args: Record<string, string>) => Promise<ToolResponse | undefined>;
|
|
87
91
|
onBeforeRequest?: (agent: AgentBase) => Promise<void>;
|
|
92
|
+
prepareMessages?: (agent: AgentBase, messages: ModelMessage[]) => Promise<ModelMessage[]>;
|
|
88
93
|
};
|
|
89
94
|
export { AgentPolicyInstance }
|
|
90
95
|
export { AgentPolicyInstance as AgentPolicyInstance_alias_1 }
|
|
@@ -95,50 +100,6 @@ export { agentsPrompt }
|
|
|
95
100
|
export { agentsPrompt as agentsPrompt_alias_1 }
|
|
96
101
|
export { agentsPrompt as agentsPrompt_alias_2 }
|
|
97
102
|
|
|
98
|
-
declare abstract class AiServiceBase {
|
|
99
|
-
#private;
|
|
100
|
-
readonly usageMeter: UsageMeter;
|
|
101
|
-
readonly options: AiServiceOptions;
|
|
102
|
-
constructor(options: AiServiceOptions);
|
|
103
|
-
abstract get model(): {
|
|
104
|
-
provider: string;
|
|
105
|
-
id: string;
|
|
106
|
-
info: ModelInfo;
|
|
107
|
-
};
|
|
108
|
-
abstract sendImpl(systemPrompt: string, messages: MessageParam[], signal: AbortSignal): ApiStream;
|
|
109
|
-
abort(): void;
|
|
110
|
-
send(systemPrompt: string, messages: MessageParam[]): ApiStream;
|
|
111
|
-
request(systemPrompt: string, messages: MessageParam[]): Promise<{
|
|
112
|
-
response: string;
|
|
113
|
-
reasoning: string;
|
|
114
|
-
usage: ApiUsage;
|
|
115
|
-
}>;
|
|
116
|
-
}
|
|
117
|
-
export { AiServiceBase }
|
|
118
|
-
export { AiServiceBase as AiServiceBase_alias_1 }
|
|
119
|
-
export { AiServiceBase as AiServiceBase_alias_2 }
|
|
120
|
-
|
|
121
|
-
declare interface AiServiceOptions {
|
|
122
|
-
model?: string;
|
|
123
|
-
apiKey?: string;
|
|
124
|
-
baseUrl?: string;
|
|
125
|
-
usageMeter: UsageMeter;
|
|
126
|
-
enableCache?: boolean;
|
|
127
|
-
parameters: Record<string, any>;
|
|
128
|
-
}
|
|
129
|
-
export { AiServiceOptions }
|
|
130
|
-
export { AiServiceOptions as AiServiceOptions_alias_1 }
|
|
131
|
-
export { AiServiceOptions as AiServiceOptions_alias_2 }
|
|
132
|
-
|
|
133
|
-
declare enum AiServiceProvider {
|
|
134
|
-
Anthropic = "anthropic",
|
|
135
|
-
Ollama = "ollama",
|
|
136
|
-
DeepSeek = "deepseek",
|
|
137
|
-
OpenRouter = "openrouter"
|
|
138
|
-
}
|
|
139
|
-
export { AiServiceProvider }
|
|
140
|
-
export { AiServiceProvider as AiServiceProvider_alias_1 }
|
|
141
|
-
|
|
142
103
|
declare type AiToolDefinition<Input, Output = string> = {
|
|
143
104
|
name: string;
|
|
144
105
|
description: string;
|
|
@@ -178,11 +139,10 @@ export declare namespace allTools {
|
|
|
178
139
|
_default_7 as readFile,
|
|
179
140
|
_default_8 as replaceInFile,
|
|
180
141
|
_default_9 as searchFiles,
|
|
181
|
-
_default_10 as
|
|
182
|
-
_default_11 as
|
|
183
|
-
_default_12 as
|
|
184
|
-
_default_13 as
|
|
185
|
-
_default_14 as renameFile
|
|
142
|
+
_default_10 as writeToFile,
|
|
143
|
+
_default_11 as handOver,
|
|
144
|
+
_default_12 as removeFile,
|
|
145
|
+
_default_13 as renameFile
|
|
186
146
|
}
|
|
187
147
|
}
|
|
188
148
|
|
|
@@ -207,142 +167,6 @@ export { AnalyzerAgentOptions }
|
|
|
207
167
|
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_1 }
|
|
208
168
|
export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_2 }
|
|
209
169
|
|
|
210
|
-
declare const anthropicDefaultModelId: AnthropicModelId;
|
|
211
|
-
export { anthropicDefaultModelId }
|
|
212
|
-
export { anthropicDefaultModelId as anthropicDefaultModelId_alias_1 }
|
|
213
|
-
|
|
214
|
-
declare type AnthropicModelId = keyof typeof anthropicModels;
|
|
215
|
-
export { AnthropicModelId }
|
|
216
|
-
export { AnthropicModelId as AnthropicModelId_alias_1 }
|
|
217
|
-
|
|
218
|
-
declare const anthropicModels: {
|
|
219
|
-
readonly 'claude-opus-4-20250514': {
|
|
220
|
-
readonly maxTokens: 32000;
|
|
221
|
-
readonly contextWindow: 200000;
|
|
222
|
-
readonly supportsImages: true;
|
|
223
|
-
readonly supportsComputerUse: true;
|
|
224
|
-
readonly supportsPromptCache: true;
|
|
225
|
-
readonly inputPrice: 15;
|
|
226
|
-
readonly outputPrice: 75;
|
|
227
|
-
readonly cacheWritesPrice: 18.75;
|
|
228
|
-
readonly cacheReadsPrice: 1.5;
|
|
229
|
-
readonly reasoning: true;
|
|
230
|
-
};
|
|
231
|
-
readonly 'claude-sonnet-4-20250514': {
|
|
232
|
-
readonly maxTokens: 64000;
|
|
233
|
-
readonly contextWindow: 200000;
|
|
234
|
-
readonly supportsImages: true;
|
|
235
|
-
readonly supportsComputerUse: true;
|
|
236
|
-
readonly supportsPromptCache: true;
|
|
237
|
-
readonly inputPrice: 3;
|
|
238
|
-
readonly outputPrice: 15;
|
|
239
|
-
readonly cacheWritesPrice: 3.75;
|
|
240
|
-
readonly cacheReadsPrice: 0.3;
|
|
241
|
-
readonly reasoning: true;
|
|
242
|
-
};
|
|
243
|
-
readonly 'claude-3-7-sonnet-20250219': {
|
|
244
|
-
readonly maxTokens: 64000;
|
|
245
|
-
readonly contextWindow: 200000;
|
|
246
|
-
readonly supportsImages: true;
|
|
247
|
-
readonly supportsComputerUse: true;
|
|
248
|
-
readonly supportsPromptCache: true;
|
|
249
|
-
readonly inputPrice: 3;
|
|
250
|
-
readonly outputPrice: 15;
|
|
251
|
-
readonly cacheWritesPrice: 3.75;
|
|
252
|
-
readonly cacheReadsPrice: 0.3;
|
|
253
|
-
readonly reasoning: true;
|
|
254
|
-
};
|
|
255
|
-
readonly 'claude-3-5-sonnet-20241022': {
|
|
256
|
-
readonly maxTokens: 8192;
|
|
257
|
-
readonly contextWindow: 200000;
|
|
258
|
-
readonly supportsImages: true;
|
|
259
|
-
readonly supportsComputerUse: true;
|
|
260
|
-
readonly supportsPromptCache: true;
|
|
261
|
-
readonly inputPrice: 3;
|
|
262
|
-
readonly outputPrice: 15;
|
|
263
|
-
readonly cacheWritesPrice: 3.75;
|
|
264
|
-
readonly cacheReadsPrice: 0.3;
|
|
265
|
-
};
|
|
266
|
-
readonly 'claude-3-5-haiku-20241022': {
|
|
267
|
-
readonly maxTokens: 8192;
|
|
268
|
-
readonly contextWindow: 200000;
|
|
269
|
-
readonly supportsImages: false;
|
|
270
|
-
readonly supportsPromptCache: true;
|
|
271
|
-
readonly inputPrice: 0.8;
|
|
272
|
-
readonly outputPrice: 4;
|
|
273
|
-
readonly cacheWritesPrice: 1;
|
|
274
|
-
readonly cacheReadsPrice: 0.08;
|
|
275
|
-
};
|
|
276
|
-
readonly 'claude-3-opus-20240229': {
|
|
277
|
-
readonly maxTokens: 4096;
|
|
278
|
-
readonly contextWindow: 200000;
|
|
279
|
-
readonly supportsImages: true;
|
|
280
|
-
readonly supportsPromptCache: true;
|
|
281
|
-
readonly inputPrice: 15;
|
|
282
|
-
readonly outputPrice: 75;
|
|
283
|
-
readonly cacheWritesPrice: 18.75;
|
|
284
|
-
readonly cacheReadsPrice: 1.5;
|
|
285
|
-
};
|
|
286
|
-
readonly 'claude-3-haiku-20240307': {
|
|
287
|
-
readonly maxTokens: 4096;
|
|
288
|
-
readonly contextWindow: 200000;
|
|
289
|
-
readonly supportsImages: true;
|
|
290
|
-
readonly supportsPromptCache: true;
|
|
291
|
-
readonly inputPrice: 0.25;
|
|
292
|
-
readonly outputPrice: 1.25;
|
|
293
|
-
readonly cacheWritesPrice: 0.3;
|
|
294
|
-
readonly cacheReadsPrice: 0.03;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
export { anthropicModels }
|
|
298
|
-
export { anthropicModels as anthropicModels_alias_1 }
|
|
299
|
-
|
|
300
|
-
export declare class AnthropicService extends AiServiceBase {
|
|
301
|
-
#private;
|
|
302
|
-
readonly model: {
|
|
303
|
-
provider: 'anthropic';
|
|
304
|
-
id: AnthropicModelId;
|
|
305
|
-
info: ModelInfo;
|
|
306
|
-
};
|
|
307
|
-
constructor(options: AiServiceOptions);
|
|
308
|
-
sendImpl(systemPrompt: string, messages: MessageParam[], signal: AbortSignal): ApiStream;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
declare type ApiStream = AsyncGenerator<ApiStreamChunk>;
|
|
312
|
-
export { ApiStream }
|
|
313
|
-
export { ApiStream as ApiStream_alias_1 }
|
|
314
|
-
export { ApiStream as ApiStream_alias_2 }
|
|
315
|
-
|
|
316
|
-
declare type ApiStreamChunk = ApiStreamTextChunk | ApiStreamUsageChunk | ApiStreamReasoningTextChunk;
|
|
317
|
-
export { ApiStreamChunk }
|
|
318
|
-
export { ApiStreamChunk as ApiStreamChunk_alias_1 }
|
|
319
|
-
export { ApiStreamChunk as ApiStreamChunk_alias_2 }
|
|
320
|
-
|
|
321
|
-
export declare interface ApiStreamReasoningTextChunk {
|
|
322
|
-
type: 'reasoning';
|
|
323
|
-
text: string;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export declare interface ApiStreamTextChunk {
|
|
327
|
-
type: 'text';
|
|
328
|
-
text: string;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export declare interface ApiStreamUsageChunk extends Partial<ApiUsage> {
|
|
332
|
-
type: 'usage';
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
declare type ApiUsage = {
|
|
336
|
-
inputTokens: number;
|
|
337
|
-
outputTokens: number;
|
|
338
|
-
cacheWriteTokens: number;
|
|
339
|
-
cacheReadTokens: number;
|
|
340
|
-
totalCost?: number;
|
|
341
|
-
};
|
|
342
|
-
export { ApiUsage }
|
|
343
|
-
export { ApiUsage as ApiUsage_alias_1 }
|
|
344
|
-
export { ApiUsage as ApiUsage_alias_2 }
|
|
345
|
-
|
|
346
170
|
declare class ArchitectAgent extends AgentBase {
|
|
347
171
|
constructor(options: ArchitectAgentOptions);
|
|
348
172
|
onBeforeInvokeTool(): Promise<undefined>;
|
|
@@ -455,33 +279,19 @@ declare const configSchema: z.ZodObject<{
|
|
|
455
279
|
outputPrice: z.ZodOptional<z.ZodNumber>;
|
|
456
280
|
cacheWritesPrice: z.ZodOptional<z.ZodNumber>;
|
|
457
281
|
cacheReadsPrice: z.ZodOptional<z.ZodNumber>;
|
|
458
|
-
},
|
|
459
|
-
inputPrice?: number | undefined;
|
|
460
|
-
outputPrice?: number | undefined;
|
|
461
|
-
cacheWritesPrice?: number | undefined;
|
|
462
|
-
cacheReadsPrice?: number | undefined;
|
|
463
|
-
}, {
|
|
464
|
-
inputPrice?: number | undefined;
|
|
465
|
-
outputPrice?: number | undefined;
|
|
466
|
-
cacheWritesPrice?: number | undefined;
|
|
467
|
-
cacheReadsPrice?: number | undefined;
|
|
468
|
-
}>>>>;
|
|
282
|
+
}, z.core.$strip>>>>;
|
|
469
283
|
providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
470
284
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
471
285
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
472
286
|
defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
473
|
-
},
|
|
474
|
-
apiKey?: string | undefined;
|
|
475
|
-
defaultModel?: string | undefined;
|
|
476
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
477
|
-
}, {
|
|
478
|
-
apiKey?: string | undefined;
|
|
479
|
-
defaultModel?: string | undefined;
|
|
480
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
481
|
-
}>>>;
|
|
287
|
+
}, z.core.$strip>>>;
|
|
482
288
|
defaultProvider: z.ZodOptional<z.ZodString>;
|
|
483
289
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
484
290
|
defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
291
|
+
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
292
|
+
native: "native";
|
|
293
|
+
"polka-codes": "polka-codes";
|
|
294
|
+
}>>;
|
|
485
295
|
maxMessageCount: z.ZodOptional<z.ZodNumber>;
|
|
486
296
|
budget: z.ZodOptional<z.ZodNumber>;
|
|
487
297
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -489,279 +299,52 @@ declare const configSchema: z.ZodObject<{
|
|
|
489
299
|
scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
490
300
|
command: z.ZodString;
|
|
491
301
|
description: z.ZodString;
|
|
492
|
-
},
|
|
493
|
-
|
|
494
|
-
description: string;
|
|
495
|
-
}, {
|
|
496
|
-
command: string;
|
|
497
|
-
description: string;
|
|
498
|
-
}>]>>>;
|
|
499
|
-
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<z.objectUtil.extendShape<{
|
|
302
|
+
}, z.core.$strip>]>>>;
|
|
303
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
500
304
|
provider: z.ZodOptional<z.ZodString>;
|
|
501
305
|
model: z.ZodOptional<z.ZodString>;
|
|
502
306
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
503
|
-
|
|
307
|
+
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
308
|
+
native: "native";
|
|
309
|
+
"polka-codes": "polka-codes";
|
|
310
|
+
}>>;
|
|
504
311
|
initialContext: z.ZodOptional<z.ZodObject<{
|
|
505
312
|
maxFileCount: z.ZodOptional<z.ZodNumber>;
|
|
506
|
-
excludes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
507
|
-
},
|
|
508
|
-
maxFileCount?: number | undefined;
|
|
509
|
-
excludes?: string[] | undefined;
|
|
510
|
-
}, {
|
|
511
|
-
maxFileCount?: number | undefined;
|
|
512
|
-
excludes?: string[] | undefined;
|
|
513
|
-
}>>;
|
|
313
|
+
excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
314
|
+
}, z.core.$strip>>;
|
|
514
315
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
515
316
|
requestTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
516
|
-
}
|
|
517
|
-
provider?: string | undefined;
|
|
518
|
-
model?: string | undefined;
|
|
519
|
-
parameters?: Record<string, any> | undefined;
|
|
520
|
-
initialContext?: {
|
|
521
|
-
maxFileCount?: number | undefined;
|
|
522
|
-
excludes?: string[] | undefined;
|
|
523
|
-
} | undefined;
|
|
524
|
-
retryCount?: number | undefined;
|
|
525
|
-
requestTimeoutSeconds?: number | undefined;
|
|
526
|
-
}, {
|
|
527
|
-
provider?: string | undefined;
|
|
528
|
-
model?: string | undefined;
|
|
529
|
-
parameters?: Record<string, any> | undefined;
|
|
530
|
-
initialContext?: {
|
|
531
|
-
maxFileCount?: number | undefined;
|
|
532
|
-
excludes?: string[] | undefined;
|
|
533
|
-
} | undefined;
|
|
534
|
-
retryCount?: number | undefined;
|
|
535
|
-
requestTimeoutSeconds?: number | undefined;
|
|
536
|
-
}>>>;
|
|
317
|
+
}, z.core.$strip>>>;
|
|
537
318
|
commands: z.ZodOptional<z.ZodObject<{
|
|
538
319
|
default: z.ZodOptional<z.ZodObject<{
|
|
539
320
|
provider: z.ZodOptional<z.ZodString>;
|
|
540
321
|
model: z.ZodOptional<z.ZodString>;
|
|
541
322
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
model?: string | undefined;
|
|
549
|
-
parameters?: Record<string, any> | undefined;
|
|
550
|
-
}>>;
|
|
551
|
-
}, "strip", z.ZodObject<{
|
|
323
|
+
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
324
|
+
native: "native";
|
|
325
|
+
"polka-codes": "polka-codes";
|
|
326
|
+
}>>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
}, z.core.$catchall<z.ZodObject<{
|
|
552
329
|
provider: z.ZodOptional<z.ZodString>;
|
|
553
330
|
model: z.ZodOptional<z.ZodString>;
|
|
554
331
|
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
parameters?: Record<string, any> | undefined;
|
|
559
|
-
}, {
|
|
560
|
-
provider?: string | undefined;
|
|
561
|
-
model?: string | undefined;
|
|
562
|
-
parameters?: Record<string, any> | undefined;
|
|
563
|
-
}>, z.objectOutputType<{
|
|
564
|
-
default: z.ZodOptional<z.ZodObject<{
|
|
565
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
566
|
-
model: z.ZodOptional<z.ZodString>;
|
|
567
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
568
|
-
}, "strip", z.ZodTypeAny, {
|
|
569
|
-
provider?: string | undefined;
|
|
570
|
-
model?: string | undefined;
|
|
571
|
-
parameters?: Record<string, any> | undefined;
|
|
572
|
-
}, {
|
|
573
|
-
provider?: string | undefined;
|
|
574
|
-
model?: string | undefined;
|
|
575
|
-
parameters?: Record<string, any> | undefined;
|
|
332
|
+
toolFormat: z.ZodOptional<z.ZodEnum<{
|
|
333
|
+
native: "native";
|
|
334
|
+
"polka-codes": "polka-codes";
|
|
576
335
|
}>>;
|
|
577
|
-
}, z.
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
provider?: string | undefined;
|
|
583
|
-
model?: string | undefined;
|
|
584
|
-
parameters?: Record<string, any> | undefined;
|
|
585
|
-
}, {
|
|
586
|
-
provider?: string | undefined;
|
|
587
|
-
model?: string | undefined;
|
|
588
|
-
parameters?: Record<string, any> | undefined;
|
|
589
|
-
}>, "strip">, z.objectInputType<{
|
|
590
|
-
default: z.ZodOptional<z.ZodObject<{
|
|
591
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
592
|
-
model: z.ZodOptional<z.ZodString>;
|
|
593
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
594
|
-
}, "strip", z.ZodTypeAny, {
|
|
595
|
-
provider?: string | undefined;
|
|
596
|
-
model?: string | undefined;
|
|
597
|
-
parameters?: Record<string, any> | undefined;
|
|
598
|
-
}, {
|
|
599
|
-
provider?: string | undefined;
|
|
600
|
-
model?: string | undefined;
|
|
601
|
-
parameters?: Record<string, any> | undefined;
|
|
602
|
-
}>>;
|
|
603
|
-
}, z.ZodObject<{
|
|
604
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
605
|
-
model: z.ZodOptional<z.ZodString>;
|
|
606
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
607
|
-
}, "strip", z.ZodTypeAny, {
|
|
608
|
-
provider?: string | undefined;
|
|
609
|
-
model?: string | undefined;
|
|
610
|
-
parameters?: Record<string, any> | undefined;
|
|
611
|
-
}, {
|
|
612
|
-
provider?: string | undefined;
|
|
613
|
-
model?: string | undefined;
|
|
614
|
-
parameters?: Record<string, any> | undefined;
|
|
615
|
-
}>, "strip">>>;
|
|
616
|
-
rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodString, "many">>, z.ZodString]>>;
|
|
617
|
-
excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
618
|
-
policies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
619
|
-
}, "strict", z.ZodTypeAny, {
|
|
620
|
-
retryCount?: number | undefined;
|
|
621
|
-
requestTimeoutSeconds?: number | undefined;
|
|
622
|
-
agent?: string | undefined;
|
|
623
|
-
prices?: Record<string, Record<string, {
|
|
624
|
-
inputPrice?: number | undefined;
|
|
625
|
-
outputPrice?: number | undefined;
|
|
626
|
-
cacheWritesPrice?: number | undefined;
|
|
627
|
-
cacheReadsPrice?: number | undefined;
|
|
628
|
-
}>> | undefined;
|
|
629
|
-
defaultModel?: string | undefined;
|
|
630
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
631
|
-
providers?: Record<string, {
|
|
632
|
-
apiKey?: string | undefined;
|
|
633
|
-
defaultModel?: string | undefined;
|
|
634
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
635
|
-
}> | undefined;
|
|
636
|
-
defaultProvider?: string | undefined;
|
|
637
|
-
maxMessageCount?: number | undefined;
|
|
638
|
-
budget?: number | undefined;
|
|
639
|
-
scripts?: Record<string, string | {
|
|
640
|
-
command: string;
|
|
641
|
-
description: string;
|
|
642
|
-
}> | undefined;
|
|
643
|
-
agents?: Record<string, {
|
|
644
|
-
provider?: string | undefined;
|
|
645
|
-
model?: string | undefined;
|
|
646
|
-
parameters?: Record<string, any> | undefined;
|
|
647
|
-
initialContext?: {
|
|
648
|
-
maxFileCount?: number | undefined;
|
|
649
|
-
excludes?: string[] | undefined;
|
|
650
|
-
} | undefined;
|
|
651
|
-
retryCount?: number | undefined;
|
|
652
|
-
requestTimeoutSeconds?: number | undefined;
|
|
653
|
-
}> | undefined;
|
|
654
|
-
commands?: z.objectOutputType<{
|
|
655
|
-
default: z.ZodOptional<z.ZodObject<{
|
|
656
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
657
|
-
model: z.ZodOptional<z.ZodString>;
|
|
658
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
659
|
-
}, "strip", z.ZodTypeAny, {
|
|
660
|
-
provider?: string | undefined;
|
|
661
|
-
model?: string | undefined;
|
|
662
|
-
parameters?: Record<string, any> | undefined;
|
|
663
|
-
}, {
|
|
664
|
-
provider?: string | undefined;
|
|
665
|
-
model?: string | undefined;
|
|
666
|
-
parameters?: Record<string, any> | undefined;
|
|
667
|
-
}>>;
|
|
668
|
-
}, z.ZodObject<{
|
|
669
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
670
|
-
model: z.ZodOptional<z.ZodString>;
|
|
671
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
672
|
-
}, "strip", z.ZodTypeAny, {
|
|
673
|
-
provider?: string | undefined;
|
|
674
|
-
model?: string | undefined;
|
|
675
|
-
parameters?: Record<string, any> | undefined;
|
|
676
|
-
}, {
|
|
677
|
-
provider?: string | undefined;
|
|
678
|
-
model?: string | undefined;
|
|
679
|
-
parameters?: Record<string, any> | undefined;
|
|
680
|
-
}>, "strip"> | undefined;
|
|
681
|
-
rules?: string | string[] | undefined;
|
|
682
|
-
excludeFiles?: string[] | undefined;
|
|
683
|
-
policies?: string[] | undefined;
|
|
684
|
-
}, {
|
|
685
|
-
retryCount?: number | undefined;
|
|
686
|
-
requestTimeoutSeconds?: number | undefined;
|
|
687
|
-
agent?: string | undefined;
|
|
688
|
-
prices?: Record<string, Record<string, {
|
|
689
|
-
inputPrice?: number | undefined;
|
|
690
|
-
outputPrice?: number | undefined;
|
|
691
|
-
cacheWritesPrice?: number | undefined;
|
|
692
|
-
cacheReadsPrice?: number | undefined;
|
|
693
|
-
}>> | undefined;
|
|
694
|
-
defaultModel?: string | undefined;
|
|
695
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
696
|
-
providers?: Record<string, {
|
|
697
|
-
apiKey?: string | undefined;
|
|
698
|
-
defaultModel?: string | undefined;
|
|
699
|
-
defaultParameters?: Record<string, any> | undefined;
|
|
700
|
-
}> | undefined;
|
|
701
|
-
defaultProvider?: string | undefined;
|
|
702
|
-
maxMessageCount?: number | undefined;
|
|
703
|
-
budget?: number | undefined;
|
|
704
|
-
scripts?: Record<string, string | {
|
|
705
|
-
command: string;
|
|
706
|
-
description: string;
|
|
707
|
-
}> | undefined;
|
|
708
|
-
agents?: Record<string, {
|
|
709
|
-
provider?: string | undefined;
|
|
710
|
-
model?: string | undefined;
|
|
711
|
-
parameters?: Record<string, any> | undefined;
|
|
712
|
-
initialContext?: {
|
|
713
|
-
maxFileCount?: number | undefined;
|
|
714
|
-
excludes?: string[] | undefined;
|
|
715
|
-
} | undefined;
|
|
716
|
-
retryCount?: number | undefined;
|
|
717
|
-
requestTimeoutSeconds?: number | undefined;
|
|
718
|
-
}> | undefined;
|
|
719
|
-
commands?: z.objectInputType<{
|
|
720
|
-
default: z.ZodOptional<z.ZodObject<{
|
|
721
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
722
|
-
model: z.ZodOptional<z.ZodString>;
|
|
723
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
724
|
-
}, "strip", z.ZodTypeAny, {
|
|
725
|
-
provider?: string | undefined;
|
|
726
|
-
model?: string | undefined;
|
|
727
|
-
parameters?: Record<string, any> | undefined;
|
|
728
|
-
}, {
|
|
729
|
-
provider?: string | undefined;
|
|
730
|
-
model?: string | undefined;
|
|
731
|
-
parameters?: Record<string, any> | undefined;
|
|
732
|
-
}>>;
|
|
733
|
-
}, z.ZodObject<{
|
|
734
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
735
|
-
model: z.ZodOptional<z.ZodString>;
|
|
736
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
737
|
-
}, "strip", z.ZodTypeAny, {
|
|
738
|
-
provider?: string | undefined;
|
|
739
|
-
model?: string | undefined;
|
|
740
|
-
parameters?: Record<string, any> | undefined;
|
|
741
|
-
}, {
|
|
742
|
-
provider?: string | undefined;
|
|
743
|
-
model?: string | undefined;
|
|
744
|
-
parameters?: Record<string, any> | undefined;
|
|
745
|
-
}>, "strip"> | undefined;
|
|
746
|
-
rules?: string | string[] | undefined;
|
|
747
|
-
excludeFiles?: string[] | undefined;
|
|
748
|
-
policies?: string[] | undefined;
|
|
749
|
-
}>;
|
|
336
|
+
}, z.core.$strip>>>>;
|
|
337
|
+
rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodString]>>;
|
|
338
|
+
excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
339
|
+
policies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
340
|
+
}, z.core.$strict>;
|
|
750
341
|
export { configSchema }
|
|
751
342
|
export { configSchema as configSchema_alias_1 }
|
|
752
343
|
|
|
753
|
-
export declare function convertToAnthropicMessage(completion: OpenAI.Chat.Completions.ChatCompletion): Anthropic.Messages.Message;
|
|
754
|
-
|
|
755
|
-
export declare function convertToOpenAiMessages(anthropicMessages: Anthropic.Messages.MessageParam[]): OpenAI.Chat.ChatCompletionMessageParam[];
|
|
756
|
-
|
|
757
344
|
declare const createNewProject: (agent: MultiAgent, params: string) => Promise<string>;
|
|
758
345
|
export { createNewProject }
|
|
759
346
|
export { createNewProject as createNewProject_alias_1 }
|
|
760
347
|
|
|
761
|
-
declare const createService: (provider: AiServiceProvider, options: AiServiceOptions) => AnthropicService | DeepSeekService | OllamaService | OpenRouterService;
|
|
762
|
-
export { createService }
|
|
763
|
-
export { createService as createService_alias_1 }
|
|
764
|
-
|
|
765
348
|
declare const customInstructions: (customInstructions: string[]) => string;
|
|
766
349
|
export { customInstructions }
|
|
767
350
|
export { customInstructions as customInstructions_alias_1 }
|
|
@@ -775,73 +358,16 @@ export { customScripts }
|
|
|
775
358
|
export { customScripts as customScripts_alias_1 }
|
|
776
359
|
export { customScripts as customScripts_alias_2 }
|
|
777
360
|
|
|
778
|
-
declare const deepSeekDefaultModelId: DeepSeekModelId;
|
|
779
|
-
export { deepSeekDefaultModelId }
|
|
780
|
-
export { deepSeekDefaultModelId as deepSeekDefaultModelId_alias_1 }
|
|
781
|
-
|
|
782
|
-
declare type DeepSeekModelId = keyof typeof deepSeekModels;
|
|
783
|
-
export { DeepSeekModelId }
|
|
784
|
-
export { DeepSeekModelId as DeepSeekModelId_alias_1 }
|
|
785
|
-
|
|
786
|
-
declare const deepSeekModels: {
|
|
787
|
-
readonly 'deepseek-chat': {
|
|
788
|
-
readonly maxTokens: 8000;
|
|
789
|
-
readonly contextWindow: 64000;
|
|
790
|
-
readonly supportsImages: false;
|
|
791
|
-
readonly supportsPromptCache: true;
|
|
792
|
-
readonly inputPrice: 0;
|
|
793
|
-
readonly outputPrice: 1.1;
|
|
794
|
-
readonly cacheWritesPrice: 0.27;
|
|
795
|
-
readonly cacheReadsPrice: 0.07;
|
|
796
|
-
};
|
|
797
|
-
readonly 'deepseek-reasoner': {
|
|
798
|
-
readonly maxTokens: 8000;
|
|
799
|
-
readonly contextWindow: 64000;
|
|
800
|
-
readonly supportsImages: false;
|
|
801
|
-
readonly supportsPromptCache: true;
|
|
802
|
-
readonly inputPrice: 0;
|
|
803
|
-
readonly outputPrice: 2.19;
|
|
804
|
-
readonly cacheWritesPrice: 0.55;
|
|
805
|
-
readonly cacheReadsPrice: 0.14;
|
|
806
|
-
};
|
|
807
|
-
};
|
|
808
|
-
export { deepSeekModels }
|
|
809
|
-
export { deepSeekModels as deepSeekModels_alias_1 }
|
|
810
|
-
|
|
811
|
-
export declare class DeepSeekService extends AiServiceBase {
|
|
812
|
-
#private;
|
|
813
|
-
readonly model: {
|
|
814
|
-
provider: string;
|
|
815
|
-
id: string;
|
|
816
|
-
info: ModelInfo;
|
|
817
|
-
};
|
|
818
|
-
constructor(options: AiServiceOptions);
|
|
819
|
-
sendImpl(systemPrompt: string, messages: MessageParam[], signal: AbortSignal): ApiStream;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
361
|
declare const _default: {
|
|
823
362
|
handler: ToolHandler<{
|
|
824
363
|
readonly name: "ask_followup_question";
|
|
825
364
|
readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
|
|
826
|
-
readonly parameters:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
readonly children: [{
|
|
833
|
-
readonly name: "prompt";
|
|
834
|
-
readonly description: "The text of the question.";
|
|
835
|
-
readonly required: true;
|
|
836
|
-
readonly usageValue: "question text here";
|
|
837
|
-
}, {
|
|
838
|
-
readonly name: "options";
|
|
839
|
-
readonly description: "Ordered list of suggested answers (omit if none).";
|
|
840
|
-
readonly required: false;
|
|
841
|
-
readonly allowMultiple: true;
|
|
842
|
-
readonly usageValue: "suggested answer here";
|
|
843
|
-
}];
|
|
844
|
-
}];
|
|
365
|
+
readonly parameters: z.ZodObject<{
|
|
366
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
367
|
+
prompt: z.ZodString;
|
|
368
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
369
|
+
}, z.core.$strip>>;
|
|
370
|
+
}, z.core.$strip>;
|
|
845
371
|
readonly examples: [{
|
|
846
372
|
readonly description: "Single clarifying question (no options)";
|
|
847
373
|
readonly parameters: [{
|
|
@@ -885,25 +411,12 @@ declare const _default: {
|
|
|
885
411
|
isAvailable: (provider: InteractionProvider) => boolean;
|
|
886
412
|
name: "ask_followup_question";
|
|
887
413
|
description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
|
|
888
|
-
parameters:
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
readonly children: [{
|
|
895
|
-
readonly name: "prompt";
|
|
896
|
-
readonly description: "The text of the question.";
|
|
897
|
-
readonly required: true;
|
|
898
|
-
readonly usageValue: "question text here";
|
|
899
|
-
}, {
|
|
900
|
-
readonly name: "options";
|
|
901
|
-
readonly description: "Ordered list of suggested answers (omit if none).";
|
|
902
|
-
readonly required: false;
|
|
903
|
-
readonly allowMultiple: true;
|
|
904
|
-
readonly usageValue: "suggested answer here";
|
|
905
|
-
}];
|
|
906
|
-
}];
|
|
414
|
+
parameters: z.ZodObject<{
|
|
415
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
416
|
+
prompt: z.ZodString;
|
|
417
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
}, z.core.$strip>;
|
|
907
420
|
examples: [{
|
|
908
421
|
readonly description: "Single clarifying question (no options)";
|
|
909
422
|
readonly parameters: [{
|
|
@@ -950,150 +463,13 @@ export { _default as askFollowupQuestion_alias_2 }
|
|
|
950
463
|
export { _default as default_alias_4 }
|
|
951
464
|
|
|
952
465
|
declare const _default_10: {
|
|
953
|
-
handler: ToolHandler<{
|
|
954
|
-
readonly name: "update_knowledge";
|
|
955
|
-
readonly description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
|
|
956
|
-
readonly parameters: [{
|
|
957
|
-
readonly name: "path";
|
|
958
|
-
readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
|
|
959
|
-
readonly required: true;
|
|
960
|
-
readonly usageValue: "Directory path here";
|
|
961
|
-
}, {
|
|
962
|
-
readonly name: "knowledge";
|
|
963
|
-
readonly description: "YAML content to merge into the knowledge file";
|
|
964
|
-
readonly required: true;
|
|
965
|
-
readonly usageValue: "YAML content with knowledge to update";
|
|
966
|
-
}];
|
|
967
|
-
readonly examples: [{
|
|
968
|
-
readonly description: "Add a new file entry";
|
|
969
|
-
readonly parameters: [{
|
|
970
|
-
readonly name: "path";
|
|
971
|
-
readonly value: "src/utils";
|
|
972
|
-
}, {
|
|
973
|
-
readonly name: "knowledge";
|
|
974
|
-
readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
|
|
975
|
-
}];
|
|
976
|
-
}, {
|
|
977
|
-
readonly description: "Update an existing file description";
|
|
978
|
-
readonly parameters: [{
|
|
979
|
-
readonly name: "path";
|
|
980
|
-
readonly value: "src/utils";
|
|
981
|
-
}, {
|
|
982
|
-
readonly name: "knowledge";
|
|
983
|
-
readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
|
|
984
|
-
}];
|
|
985
|
-
}, {
|
|
986
|
-
readonly description: "Add a new rule";
|
|
987
|
-
readonly parameters: [{
|
|
988
|
-
readonly name: "path";
|
|
989
|
-
readonly value: "src";
|
|
990
|
-
}, {
|
|
991
|
-
readonly name: "knowledge";
|
|
992
|
-
readonly value: "rules:\n 10: \"New rule to follow\"";
|
|
993
|
-
}];
|
|
994
|
-
}, {
|
|
995
|
-
readonly description: "Remove a rule";
|
|
996
|
-
readonly parameters: [{
|
|
997
|
-
readonly name: "path";
|
|
998
|
-
readonly value: "src";
|
|
999
|
-
}, {
|
|
1000
|
-
readonly name: "knowledge";
|
|
1001
|
-
readonly value: "rules:\n 5: null";
|
|
1002
|
-
}];
|
|
1003
|
-
}, {
|
|
1004
|
-
readonly description: "Update nested properties using dot notation";
|
|
1005
|
-
readonly parameters: [{
|
|
1006
|
-
readonly name: "path";
|
|
1007
|
-
readonly value: "src/components";
|
|
1008
|
-
}, {
|
|
1009
|
-
readonly name: "knowledge";
|
|
1010
|
-
readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
|
|
1011
|
-
}];
|
|
1012
|
-
}];
|
|
1013
|
-
readonly permissionLevel: PermissionLevel.Write;
|
|
1014
|
-
}, FilesystemProvider>;
|
|
1015
|
-
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1016
|
-
name: "update_knowledge";
|
|
1017
|
-
description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
|
|
1018
|
-
parameters: [{
|
|
1019
|
-
readonly name: "path";
|
|
1020
|
-
readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
|
|
1021
|
-
readonly required: true;
|
|
1022
|
-
readonly usageValue: "Directory path here";
|
|
1023
|
-
}, {
|
|
1024
|
-
readonly name: "knowledge";
|
|
1025
|
-
readonly description: "YAML content to merge into the knowledge file";
|
|
1026
|
-
readonly required: true;
|
|
1027
|
-
readonly usageValue: "YAML content with knowledge to update";
|
|
1028
|
-
}];
|
|
1029
|
-
examples: [{
|
|
1030
|
-
readonly description: "Add a new file entry";
|
|
1031
|
-
readonly parameters: [{
|
|
1032
|
-
readonly name: "path";
|
|
1033
|
-
readonly value: "src/utils";
|
|
1034
|
-
}, {
|
|
1035
|
-
readonly name: "knowledge";
|
|
1036
|
-
readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
|
|
1037
|
-
}];
|
|
1038
|
-
}, {
|
|
1039
|
-
readonly description: "Update an existing file description";
|
|
1040
|
-
readonly parameters: [{
|
|
1041
|
-
readonly name: "path";
|
|
1042
|
-
readonly value: "src/utils";
|
|
1043
|
-
}, {
|
|
1044
|
-
readonly name: "knowledge";
|
|
1045
|
-
readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
|
|
1046
|
-
}];
|
|
1047
|
-
}, {
|
|
1048
|
-
readonly description: "Add a new rule";
|
|
1049
|
-
readonly parameters: [{
|
|
1050
|
-
readonly name: "path";
|
|
1051
|
-
readonly value: "src";
|
|
1052
|
-
}, {
|
|
1053
|
-
readonly name: "knowledge";
|
|
1054
|
-
readonly value: "rules:\n 10: \"New rule to follow\"";
|
|
1055
|
-
}];
|
|
1056
|
-
}, {
|
|
1057
|
-
readonly description: "Remove a rule";
|
|
1058
|
-
readonly parameters: [{
|
|
1059
|
-
readonly name: "path";
|
|
1060
|
-
readonly value: "src";
|
|
1061
|
-
}, {
|
|
1062
|
-
readonly name: "knowledge";
|
|
1063
|
-
readonly value: "rules:\n 5: null";
|
|
1064
|
-
}];
|
|
1065
|
-
}, {
|
|
1066
|
-
readonly description: "Update nested properties using dot notation";
|
|
1067
|
-
readonly parameters: [{
|
|
1068
|
-
readonly name: "path";
|
|
1069
|
-
readonly value: "src/components";
|
|
1070
|
-
}, {
|
|
1071
|
-
readonly name: "knowledge";
|
|
1072
|
-
readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
|
|
1073
|
-
}];
|
|
1074
|
-
}];
|
|
1075
|
-
permissionLevel: PermissionLevel.Write;
|
|
1076
|
-
};
|
|
1077
|
-
export { _default_10 as default_alias_16 }
|
|
1078
|
-
export { _default_10 as updateKnowledge }
|
|
1079
|
-
export { _default_10 as updateKnowledge_alias_1 }
|
|
1080
|
-
export { _default_10 as updateKnowledge_alias_2 }
|
|
1081
|
-
|
|
1082
|
-
declare const _default_11: {
|
|
1083
466
|
handler: ToolHandler<{
|
|
1084
467
|
readonly name: "write_to_file";
|
|
1085
468
|
readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
1086
|
-
readonly parameters:
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
readonly usageValue: "File path here";
|
|
1091
|
-
}, {
|
|
1092
|
-
readonly name: "content";
|
|
1093
|
-
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.";
|
|
1094
|
-
readonly required: true;
|
|
1095
|
-
readonly usageValue: "Your file content here";
|
|
1096
|
-
}];
|
|
469
|
+
readonly parameters: z.ZodObject<{
|
|
470
|
+
path: z.ZodString;
|
|
471
|
+
content: z.ZodString;
|
|
472
|
+
}, z.core.$strip>;
|
|
1097
473
|
readonly examples: [{
|
|
1098
474
|
readonly description: "Request to write content to a file";
|
|
1099
475
|
readonly parameters: [{
|
|
@@ -1109,17 +485,10 @@ declare const _default_11: {
|
|
|
1109
485
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1110
486
|
name: "write_to_file";
|
|
1111
487
|
description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
1112
|
-
parameters:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
readonly usageValue: "File path here";
|
|
1117
|
-
}, {
|
|
1118
|
-
readonly name: "content";
|
|
1119
|
-
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.";
|
|
1120
|
-
readonly required: true;
|
|
1121
|
-
readonly usageValue: "Your file content here";
|
|
1122
|
-
}];
|
|
488
|
+
parameters: z.ZodObject<{
|
|
489
|
+
path: z.ZodString;
|
|
490
|
+
content: z.ZodString;
|
|
491
|
+
}, z.core.$strip>;
|
|
1123
492
|
examples: [{
|
|
1124
493
|
readonly description: "Request to write content to a file";
|
|
1125
494
|
readonly parameters: [{
|
|
@@ -1132,40 +501,25 @@ declare const _default_11: {
|
|
|
1132
501
|
}];
|
|
1133
502
|
permissionLevel: PermissionLevel.Write;
|
|
1134
503
|
};
|
|
1135
|
-
export {
|
|
1136
|
-
export {
|
|
1137
|
-
export {
|
|
1138
|
-
export {
|
|
504
|
+
export { _default_10 as default_alias_16 }
|
|
505
|
+
export { _default_10 as writeToFile }
|
|
506
|
+
export { _default_10 as writeToFile_alias_1 }
|
|
507
|
+
export { _default_10 as writeToFile_alias_2 }
|
|
1139
508
|
|
|
1140
|
-
declare const
|
|
509
|
+
declare const _default_11: {
|
|
1141
510
|
handler: ToolHandler<{
|
|
1142
511
|
readonly name: "hand_over";
|
|
1143
512
|
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
1144
|
-
readonly parameters:
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
readonly name: "task";
|
|
1151
|
-
readonly description: "The task to be completed by the target agent";
|
|
1152
|
-
readonly required: true;
|
|
1153
|
-
readonly usageValue: "Task description";
|
|
1154
|
-
}, {
|
|
1155
|
-
readonly name: "context";
|
|
1156
|
-
readonly description: "The context information for the task";
|
|
1157
|
-
readonly required: true;
|
|
1158
|
-
readonly usageValue: "Context information";
|
|
1159
|
-
}, {
|
|
1160
|
-
readonly name: "files";
|
|
1161
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
1162
|
-
readonly required: false;
|
|
1163
|
-
readonly usageValue: "Relevant files";
|
|
1164
|
-
}];
|
|
513
|
+
readonly parameters: z.ZodObject<{
|
|
514
|
+
agentName: z.ZodString;
|
|
515
|
+
task: z.ZodString;
|
|
516
|
+
context: z.ZodString;
|
|
517
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
518
|
+
}, z.core.$strip>;
|
|
1165
519
|
readonly examples: [{
|
|
1166
520
|
readonly description: "Hand over a coding task to the coder agent";
|
|
1167
521
|
readonly parameters: [{
|
|
1168
|
-
readonly name: "
|
|
522
|
+
readonly name: "agentName";
|
|
1169
523
|
readonly value: "coder";
|
|
1170
524
|
}, {
|
|
1171
525
|
readonly name: "task";
|
|
@@ -1183,31 +537,16 @@ declare const _default_12: {
|
|
|
1183
537
|
isAvailable: (_provider: any) => boolean;
|
|
1184
538
|
name: "hand_over";
|
|
1185
539
|
description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
1186
|
-
parameters:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
},
|
|
1192
|
-
readonly name: "task";
|
|
1193
|
-
readonly description: "The task to be completed by the target agent";
|
|
1194
|
-
readonly required: true;
|
|
1195
|
-
readonly usageValue: "Task description";
|
|
1196
|
-
}, {
|
|
1197
|
-
readonly name: "context";
|
|
1198
|
-
readonly description: "The context information for the task";
|
|
1199
|
-
readonly required: true;
|
|
1200
|
-
readonly usageValue: "Context information";
|
|
1201
|
-
}, {
|
|
1202
|
-
readonly name: "files";
|
|
1203
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
1204
|
-
readonly required: false;
|
|
1205
|
-
readonly usageValue: "Relevant files";
|
|
1206
|
-
}];
|
|
540
|
+
parameters: z.ZodObject<{
|
|
541
|
+
agentName: z.ZodString;
|
|
542
|
+
task: z.ZodString;
|
|
543
|
+
context: z.ZodString;
|
|
544
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
545
|
+
}, z.core.$strip>;
|
|
1207
546
|
examples: [{
|
|
1208
547
|
readonly description: "Hand over a coding task to the coder agent";
|
|
1209
548
|
readonly parameters: [{
|
|
1210
|
-
readonly name: "
|
|
549
|
+
readonly name: "agentName";
|
|
1211
550
|
readonly value: "coder";
|
|
1212
551
|
}, {
|
|
1213
552
|
readonly name: "task";
|
|
@@ -1222,21 +561,18 @@ declare const _default_12: {
|
|
|
1222
561
|
}];
|
|
1223
562
|
permissionLevel: PermissionLevel.None;
|
|
1224
563
|
};
|
|
1225
|
-
export {
|
|
1226
|
-
export {
|
|
1227
|
-
export {
|
|
1228
|
-
export {
|
|
564
|
+
export { _default_11 as default_alias_9 }
|
|
565
|
+
export { _default_11 as handOver }
|
|
566
|
+
export { _default_11 as handOver_alias_1 }
|
|
567
|
+
export { _default_11 as handOver_alias_2 }
|
|
1229
568
|
|
|
1230
|
-
declare const
|
|
569
|
+
declare const _default_12: {
|
|
1231
570
|
handler: ToolHandler<{
|
|
1232
571
|
readonly name: "remove_file";
|
|
1233
572
|
readonly description: "Request to remove a file at the specified path.";
|
|
1234
|
-
readonly parameters:
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
readonly required: true;
|
|
1238
|
-
readonly usageValue: "File path here";
|
|
1239
|
-
}];
|
|
573
|
+
readonly parameters: z.ZodObject<{
|
|
574
|
+
path: z.ZodString;
|
|
575
|
+
}, z.core.$strip>;
|
|
1240
576
|
readonly examples: [{
|
|
1241
577
|
readonly description: "Request to remove a file";
|
|
1242
578
|
readonly parameters: [{
|
|
@@ -1249,12 +585,9 @@ declare const _default_13: {
|
|
|
1249
585
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1250
586
|
name: "remove_file";
|
|
1251
587
|
description: "Request to remove a file at the specified path.";
|
|
1252
|
-
parameters:
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
readonly required: true;
|
|
1256
|
-
readonly usageValue: "File path here";
|
|
1257
|
-
}];
|
|
588
|
+
parameters: z.ZodObject<{
|
|
589
|
+
path: z.ZodString;
|
|
590
|
+
}, z.core.$strip>;
|
|
1258
591
|
examples: [{
|
|
1259
592
|
readonly description: "Request to remove a file";
|
|
1260
593
|
readonly parameters: [{
|
|
@@ -1264,26 +597,19 @@ declare const _default_13: {
|
|
|
1264
597
|
}];
|
|
1265
598
|
permissionLevel: PermissionLevel.Write;
|
|
1266
599
|
};
|
|
1267
|
-
export {
|
|
1268
|
-
export {
|
|
1269
|
-
export {
|
|
1270
|
-
export {
|
|
600
|
+
export { _default_12 as default_alias_12 }
|
|
601
|
+
export { _default_12 as removeFile }
|
|
602
|
+
export { _default_12 as removeFile_alias_1 }
|
|
603
|
+
export { _default_12 as removeFile_alias_2 }
|
|
1271
604
|
|
|
1272
|
-
declare const
|
|
605
|
+
declare const _default_13: {
|
|
1273
606
|
handler: ToolHandler<{
|
|
1274
607
|
readonly name: "rename_file";
|
|
1275
608
|
readonly description: "Request to rename a file from source path to target path.";
|
|
1276
|
-
readonly parameters:
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
readonly usageValue: "Source file path here";
|
|
1281
|
-
}, {
|
|
1282
|
-
readonly name: "target_path";
|
|
1283
|
-
readonly description: "The new path for the file";
|
|
1284
|
-
readonly required: true;
|
|
1285
|
-
readonly usageValue: "Target file path here";
|
|
1286
|
-
}];
|
|
609
|
+
readonly parameters: z.ZodObject<{
|
|
610
|
+
source_path: z.ZodString;
|
|
611
|
+
target_path: z.ZodString;
|
|
612
|
+
}, z.core.$strip>;
|
|
1287
613
|
readonly examples: [{
|
|
1288
614
|
readonly description: "Request to rename a file";
|
|
1289
615
|
readonly parameters: [{
|
|
@@ -1299,17 +625,10 @@ declare const _default_14: {
|
|
|
1299
625
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1300
626
|
name: "rename_file";
|
|
1301
627
|
description: "Request to rename a file from source path to target path.";
|
|
1302
|
-
parameters:
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
readonly usageValue: "Source file path here";
|
|
1307
|
-
}, {
|
|
1308
|
-
readonly name: "target_path";
|
|
1309
|
-
readonly description: "The new path for the file";
|
|
1310
|
-
readonly required: true;
|
|
1311
|
-
readonly usageValue: "Target file path here";
|
|
1312
|
-
}];
|
|
628
|
+
parameters: z.ZodObject<{
|
|
629
|
+
source_path: z.ZodString;
|
|
630
|
+
target_path: z.ZodString;
|
|
631
|
+
}, z.core.$strip>;
|
|
1313
632
|
examples: [{
|
|
1314
633
|
readonly description: "Request to rename a file";
|
|
1315
634
|
readonly parameters: [{
|
|
@@ -1322,21 +641,18 @@ declare const _default_14: {
|
|
|
1322
641
|
}];
|
|
1323
642
|
permissionLevel: PermissionLevel.Write;
|
|
1324
643
|
};
|
|
1325
|
-
export {
|
|
1326
|
-
export {
|
|
1327
|
-
export {
|
|
1328
|
-
export {
|
|
644
|
+
export { _default_13 as default_alias_13 }
|
|
645
|
+
export { _default_13 as renameFile }
|
|
646
|
+
export { _default_13 as renameFile_alias_1 }
|
|
647
|
+
export { _default_13 as renameFile_alias_2 }
|
|
1329
648
|
|
|
1330
649
|
declare const _default_2: {
|
|
1331
650
|
handler: ToolHandler<{
|
|
1332
651
|
readonly name: "attempt_completion";
|
|
1333
652
|
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.";
|
|
1334
|
-
readonly parameters:
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
readonly required: true;
|
|
1338
|
-
readonly usageValue: "Your final result description here";
|
|
1339
|
-
}];
|
|
653
|
+
readonly parameters: z.ZodObject<{
|
|
654
|
+
result: z.ZodString;
|
|
655
|
+
}, z.core.$strip>;
|
|
1340
656
|
readonly examples: [{
|
|
1341
657
|
readonly description: "Request to present the result of the task";
|
|
1342
658
|
readonly parameters: [{
|
|
@@ -1349,12 +665,9 @@ declare const _default_2: {
|
|
|
1349
665
|
isAvailable: (provider: InteractionProvider) => boolean;
|
|
1350
666
|
name: "attempt_completion";
|
|
1351
667
|
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.";
|
|
1352
|
-
parameters:
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
readonly required: true;
|
|
1356
|
-
readonly usageValue: "Your final result description here";
|
|
1357
|
-
}];
|
|
668
|
+
parameters: z.ZodObject<{
|
|
669
|
+
result: z.ZodString;
|
|
670
|
+
}, z.core.$strip>;
|
|
1358
671
|
examples: [{
|
|
1359
672
|
readonly description: "Request to present the result of the task";
|
|
1360
673
|
readonly parameters: [{
|
|
@@ -1373,31 +686,16 @@ declare const _default_3: {
|
|
|
1373
686
|
handler: ToolHandler<{
|
|
1374
687
|
readonly name: "delegate";
|
|
1375
688
|
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.";
|
|
1376
|
-
readonly parameters:
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
},
|
|
1382
|
-
readonly name: "task";
|
|
1383
|
-
readonly description: "The task to be completed by the target agent";
|
|
1384
|
-
readonly required: true;
|
|
1385
|
-
readonly usageValue: "Task description";
|
|
1386
|
-
}, {
|
|
1387
|
-
readonly name: "context";
|
|
1388
|
-
readonly description: "The context information for the task";
|
|
1389
|
-
readonly required: true;
|
|
1390
|
-
readonly usageValue: "Context information";
|
|
1391
|
-
}, {
|
|
1392
|
-
readonly name: "files";
|
|
1393
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
1394
|
-
readonly required: false;
|
|
1395
|
-
readonly usageValue: "Relevant files";
|
|
1396
|
-
}];
|
|
689
|
+
readonly parameters: z.ZodObject<{
|
|
690
|
+
agentName: z.ZodString;
|
|
691
|
+
task: z.ZodString;
|
|
692
|
+
context: z.ZodString;
|
|
693
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
694
|
+
}, z.core.$strip>;
|
|
1397
695
|
readonly examples: [{
|
|
1398
696
|
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
1399
697
|
readonly parameters: [{
|
|
1400
|
-
readonly name: "
|
|
698
|
+
readonly name: "agentName";
|
|
1401
699
|
readonly value: "analyzer";
|
|
1402
700
|
}, {
|
|
1403
701
|
readonly name: "task";
|
|
@@ -1415,31 +713,16 @@ declare const _default_3: {
|
|
|
1415
713
|
isAvailable: (_provider: any) => boolean;
|
|
1416
714
|
name: "delegate";
|
|
1417
715
|
description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
|
|
1418
|
-
parameters:
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
},
|
|
1424
|
-
readonly name: "task";
|
|
1425
|
-
readonly description: "The task to be completed by the target agent";
|
|
1426
|
-
readonly required: true;
|
|
1427
|
-
readonly usageValue: "Task description";
|
|
1428
|
-
}, {
|
|
1429
|
-
readonly name: "context";
|
|
1430
|
-
readonly description: "The context information for the task";
|
|
1431
|
-
readonly required: true;
|
|
1432
|
-
readonly usageValue: "Context information";
|
|
1433
|
-
}, {
|
|
1434
|
-
readonly name: "files";
|
|
1435
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
1436
|
-
readonly required: false;
|
|
1437
|
-
readonly usageValue: "Relevant files";
|
|
1438
|
-
}];
|
|
716
|
+
parameters: z.ZodObject<{
|
|
717
|
+
agentName: z.ZodString;
|
|
718
|
+
task: z.ZodString;
|
|
719
|
+
context: z.ZodString;
|
|
720
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
721
|
+
}, z.core.$strip>;
|
|
1439
722
|
examples: [{
|
|
1440
723
|
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
1441
724
|
readonly parameters: [{
|
|
1442
|
-
readonly name: "
|
|
725
|
+
readonly name: "agentName";
|
|
1443
726
|
readonly value: "analyzer";
|
|
1444
727
|
}, {
|
|
1445
728
|
readonly name: "task";
|
|
@@ -1463,24 +746,17 @@ declare const _default_4: {
|
|
|
1463
746
|
handler: ToolHandler<{
|
|
1464
747
|
readonly name: "execute_command";
|
|
1465
748
|
readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
|
|
1466
|
-
readonly parameters:
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
readonly usageValue: "your-command-here";
|
|
1471
|
-
}, {
|
|
1472
|
-
readonly name: "requires_approval";
|
|
1473
|
-
readonly description: "Set to `true` for commands that install/uninstall software, modify or delete files, change system settings, perform network operations, or have other side effects. Use `false` for safe, read-only, or purely local development actions (e.g., listing files, make a build, running tests).";
|
|
1474
|
-
readonly required: false;
|
|
1475
|
-
readonly usageValue: "true | false";
|
|
1476
|
-
}];
|
|
749
|
+
readonly parameters: z.ZodObject<{
|
|
750
|
+
command: z.ZodString;
|
|
751
|
+
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
752
|
+
}, z.core.$strip>;
|
|
1477
753
|
readonly examples: [{
|
|
1478
754
|
readonly description: "Make a build";
|
|
1479
755
|
readonly parameters: [{
|
|
1480
756
|
readonly name: "command";
|
|
1481
757
|
readonly value: "npm run build";
|
|
1482
758
|
}, {
|
|
1483
|
-
readonly name: "
|
|
759
|
+
readonly name: "requiresApproval";
|
|
1484
760
|
readonly value: "false";
|
|
1485
761
|
}];
|
|
1486
762
|
}];
|
|
@@ -1489,24 +765,17 @@ declare const _default_4: {
|
|
|
1489
765
|
isAvailable: (provider: CommandProvider) => boolean;
|
|
1490
766
|
name: "execute_command";
|
|
1491
767
|
description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
|
|
1492
|
-
parameters:
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
readonly usageValue: "your-command-here";
|
|
1497
|
-
}, {
|
|
1498
|
-
readonly name: "requires_approval";
|
|
1499
|
-
readonly description: "Set to `true` for commands that install/uninstall software, modify or delete files, change system settings, perform network operations, or have other side effects. Use `false` for safe, read-only, or purely local development actions (e.g., listing files, make a build, running tests).";
|
|
1500
|
-
readonly required: false;
|
|
1501
|
-
readonly usageValue: "true | false";
|
|
1502
|
-
}];
|
|
768
|
+
parameters: z.ZodObject<{
|
|
769
|
+
command: z.ZodString;
|
|
770
|
+
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
771
|
+
}, z.core.$strip>;
|
|
1503
772
|
examples: [{
|
|
1504
773
|
readonly description: "Make a build";
|
|
1505
774
|
readonly parameters: [{
|
|
1506
775
|
readonly name: "command";
|
|
1507
776
|
readonly value: "npm run build";
|
|
1508
777
|
}, {
|
|
1509
|
-
readonly name: "
|
|
778
|
+
readonly name: "requiresApproval";
|
|
1510
779
|
readonly value: "false";
|
|
1511
780
|
}];
|
|
1512
781
|
}];
|
|
@@ -1521,11 +790,9 @@ declare const _default_5: {
|
|
|
1521
790
|
handler: ToolHandler<{
|
|
1522
791
|
readonly name: "fetch_url";
|
|
1523
792
|
readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
|
|
1524
|
-
readonly parameters:
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
readonly required: true;
|
|
1528
|
-
}];
|
|
793
|
+
readonly parameters: z.ZodObject<{
|
|
794
|
+
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
795
|
+
}, z.core.$strip>;
|
|
1529
796
|
readonly examples: [{
|
|
1530
797
|
readonly description: "Fetch a single webpage";
|
|
1531
798
|
readonly parameters: [{
|
|
@@ -1550,11 +817,9 @@ declare const _default_5: {
|
|
|
1550
817
|
isAvailable: (provider: WebProvider) => boolean;
|
|
1551
818
|
name: "fetch_url";
|
|
1552
819
|
description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
|
|
1553
|
-
parameters:
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
readonly required: true;
|
|
1557
|
-
}];
|
|
820
|
+
parameters: z.ZodObject<{
|
|
821
|
+
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
822
|
+
}, z.core.$strip>;
|
|
1558
823
|
examples: [{
|
|
1559
824
|
readonly description: "Fetch a single webpage";
|
|
1560
825
|
readonly parameters: [{
|
|
@@ -1585,29 +850,18 @@ declare const _default_6: {
|
|
|
1585
850
|
handler: ToolHandler<{
|
|
1586
851
|
readonly name: "list_files";
|
|
1587
852
|
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.";
|
|
1588
|
-
readonly parameters:
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
}, {
|
|
1594
|
-
readonly name: "max_count";
|
|
1595
|
-
readonly description: "The maximum number of files to list. Default to 2000";
|
|
1596
|
-
readonly required: false;
|
|
1597
|
-
readonly usageValue: "Maximum number of files to list (optional)";
|
|
1598
|
-
}, {
|
|
1599
|
-
readonly name: "recursive";
|
|
1600
|
-
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
1601
|
-
readonly required: false;
|
|
1602
|
-
readonly usageValue: "true or false (optional)";
|
|
1603
|
-
}];
|
|
853
|
+
readonly parameters: z.ZodObject<{
|
|
854
|
+
path: z.ZodString;
|
|
855
|
+
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
856
|
+
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
857
|
+
}, z.core.$strip>;
|
|
1604
858
|
readonly examples: [{
|
|
1605
859
|
readonly description: "Request to list files";
|
|
1606
860
|
readonly parameters: [{
|
|
1607
861
|
readonly name: "path";
|
|
1608
862
|
readonly value: "src";
|
|
1609
863
|
}, {
|
|
1610
|
-
readonly name: "
|
|
864
|
+
readonly name: "maxCount";
|
|
1611
865
|
readonly value: "100";
|
|
1612
866
|
}];
|
|
1613
867
|
}];
|
|
@@ -1616,29 +870,18 @@ declare const _default_6: {
|
|
|
1616
870
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1617
871
|
name: "list_files";
|
|
1618
872
|
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.";
|
|
1619
|
-
parameters:
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
}, {
|
|
1625
|
-
readonly name: "max_count";
|
|
1626
|
-
readonly description: "The maximum number of files to list. Default to 2000";
|
|
1627
|
-
readonly required: false;
|
|
1628
|
-
readonly usageValue: "Maximum number of files to list (optional)";
|
|
1629
|
-
}, {
|
|
1630
|
-
readonly name: "recursive";
|
|
1631
|
-
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
1632
|
-
readonly required: false;
|
|
1633
|
-
readonly usageValue: "true or false (optional)";
|
|
1634
|
-
}];
|
|
873
|
+
parameters: z.ZodObject<{
|
|
874
|
+
path: z.ZodString;
|
|
875
|
+
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
876
|
+
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
877
|
+
}, z.core.$strip>;
|
|
1635
878
|
examples: [{
|
|
1636
879
|
readonly description: "Request to list files";
|
|
1637
880
|
readonly parameters: [{
|
|
1638
881
|
readonly name: "path";
|
|
1639
882
|
readonly value: "src";
|
|
1640
883
|
}, {
|
|
1641
|
-
readonly name: "
|
|
884
|
+
readonly name: "maxCount";
|
|
1642
885
|
readonly value: "100";
|
|
1643
886
|
}];
|
|
1644
887
|
}];
|
|
@@ -1653,12 +896,9 @@ declare const _default_7: {
|
|
|
1653
896
|
handler: ToolHandler<{
|
|
1654
897
|
readonly name: "read_file";
|
|
1655
898
|
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.";
|
|
1656
|
-
readonly parameters:
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
readonly required: true;
|
|
1660
|
-
readonly usageValue: "Comma separated paths here";
|
|
1661
|
-
}];
|
|
899
|
+
readonly parameters: z.ZodObject<{
|
|
900
|
+
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
901
|
+
}, z.core.$strip>;
|
|
1662
902
|
readonly examples: [{
|
|
1663
903
|
readonly description: "Request to read the contents of a file";
|
|
1664
904
|
readonly parameters: [{
|
|
@@ -1677,12 +917,9 @@ declare const _default_7: {
|
|
|
1677
917
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1678
918
|
name: "read_file";
|
|
1679
919
|
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.";
|
|
1680
|
-
parameters:
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
readonly required: true;
|
|
1684
|
-
readonly usageValue: "Comma separated paths here";
|
|
1685
|
-
}];
|
|
920
|
+
parameters: z.ZodObject<{
|
|
921
|
+
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
922
|
+
}, z.core.$strip>;
|
|
1686
923
|
examples: [{
|
|
1687
924
|
readonly description: "Request to read the contents of a file";
|
|
1688
925
|
readonly parameters: [{
|
|
@@ -1707,17 +944,10 @@ declare const _default_8: {
|
|
|
1707
944
|
handler: ToolHandler<{
|
|
1708
945
|
readonly name: "replace_in_file";
|
|
1709
946
|
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.";
|
|
1710
|
-
readonly parameters:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
readonly usageValue: "File path here";
|
|
1715
|
-
}, {
|
|
1716
|
-
readonly name: "diff";
|
|
1717
|
-
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```\nCritical rules:\n1. 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.\n2. 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.\n3. 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.\n4. 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";
|
|
1718
|
-
readonly required: true;
|
|
1719
|
-
readonly usageValue: "Search and replace blocks here";
|
|
1720
|
-
}];
|
|
947
|
+
readonly parameters: z.ZodObject<{
|
|
948
|
+
path: z.ZodString;
|
|
949
|
+
diff: z.ZodString;
|
|
950
|
+
}, z.core.$strip>;
|
|
1721
951
|
readonly examples: [{
|
|
1722
952
|
readonly description: "Request to replace sections of content in a file";
|
|
1723
953
|
readonly parameters: [{
|
|
@@ -1725,7 +955,7 @@ declare const _default_8: {
|
|
|
1725
955
|
readonly value: "src/main.js";
|
|
1726
956
|
}, {
|
|
1727
957
|
readonly name: "diff";
|
|
1728
|
-
readonly value: "
|
|
958
|
+
readonly value: "<<<<<<< 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";
|
|
1729
959
|
}];
|
|
1730
960
|
}, {
|
|
1731
961
|
readonly description: "Request to perform a simple, single-line replacement";
|
|
@@ -1734,7 +964,7 @@ declare const _default_8: {
|
|
|
1734
964
|
readonly value: "src/config.js";
|
|
1735
965
|
}, {
|
|
1736
966
|
readonly name: "diff";
|
|
1737
|
-
readonly value: "
|
|
967
|
+
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
1738
968
|
}];
|
|
1739
969
|
}, {
|
|
1740
970
|
readonly description: "Request to add a new function to a file";
|
|
@@ -1743,7 +973,7 @@ declare const _default_8: {
|
|
|
1743
973
|
readonly value: "src/utils.js";
|
|
1744
974
|
}, {
|
|
1745
975
|
readonly name: "diff";
|
|
1746
|
-
readonly value: "
|
|
976
|
+
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
1747
977
|
}];
|
|
1748
978
|
}, {
|
|
1749
979
|
readonly description: "Request to delete a block of code from a file";
|
|
@@ -1752,7 +982,7 @@ declare const _default_8: {
|
|
|
1752
982
|
readonly value: "src/app.js";
|
|
1753
983
|
}, {
|
|
1754
984
|
readonly name: "diff";
|
|
1755
|
-
readonly value: "
|
|
985
|
+
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
1756
986
|
}];
|
|
1757
987
|
}];
|
|
1758
988
|
readonly permissionLevel: PermissionLevel.Write;
|
|
@@ -1760,17 +990,10 @@ declare const _default_8: {
|
|
|
1760
990
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1761
991
|
name: "replace_in_file";
|
|
1762
992
|
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.";
|
|
1763
|
-
parameters:
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
readonly usageValue: "File path here";
|
|
1768
|
-
}, {
|
|
1769
|
-
readonly name: "diff";
|
|
1770
|
-
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```\nCritical rules:\n1. 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.\n2. 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.\n3. 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.\n4. 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";
|
|
1771
|
-
readonly required: true;
|
|
1772
|
-
readonly usageValue: "Search and replace blocks here";
|
|
1773
|
-
}];
|
|
993
|
+
parameters: z.ZodObject<{
|
|
994
|
+
path: z.ZodString;
|
|
995
|
+
diff: z.ZodString;
|
|
996
|
+
}, z.core.$strip>;
|
|
1774
997
|
examples: [{
|
|
1775
998
|
readonly description: "Request to replace sections of content in a file";
|
|
1776
999
|
readonly parameters: [{
|
|
@@ -1778,7 +1001,7 @@ declare const _default_8: {
|
|
|
1778
1001
|
readonly value: "src/main.js";
|
|
1779
1002
|
}, {
|
|
1780
1003
|
readonly name: "diff";
|
|
1781
|
-
readonly value: "
|
|
1004
|
+
readonly value: "<<<<<<< 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";
|
|
1782
1005
|
}];
|
|
1783
1006
|
}, {
|
|
1784
1007
|
readonly description: "Request to perform a simple, single-line replacement";
|
|
@@ -1787,7 +1010,7 @@ declare const _default_8: {
|
|
|
1787
1010
|
readonly value: "src/config.js";
|
|
1788
1011
|
}, {
|
|
1789
1012
|
readonly name: "diff";
|
|
1790
|
-
readonly value: "
|
|
1013
|
+
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
1791
1014
|
}];
|
|
1792
1015
|
}, {
|
|
1793
1016
|
readonly description: "Request to add a new function to a file";
|
|
@@ -1796,7 +1019,7 @@ declare const _default_8: {
|
|
|
1796
1019
|
readonly value: "src/utils.js";
|
|
1797
1020
|
}, {
|
|
1798
1021
|
readonly name: "diff";
|
|
1799
|
-
readonly value: "
|
|
1022
|
+
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
1800
1023
|
}];
|
|
1801
1024
|
}, {
|
|
1802
1025
|
readonly description: "Request to delete a block of code from a file";
|
|
@@ -1805,7 +1028,7 @@ declare const _default_8: {
|
|
|
1805
1028
|
readonly value: "src/app.js";
|
|
1806
1029
|
}, {
|
|
1807
1030
|
readonly name: "diff";
|
|
1808
|
-
readonly value: "
|
|
1031
|
+
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
1809
1032
|
}];
|
|
1810
1033
|
}];
|
|
1811
1034
|
permissionLevel: PermissionLevel.Write;
|
|
@@ -1819,22 +1042,11 @@ declare const _default_9: {
|
|
|
1819
1042
|
handler: ToolHandler<{
|
|
1820
1043
|
readonly name: "search_files";
|
|
1821
1044
|
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.";
|
|
1822
|
-
readonly parameters:
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
}, {
|
|
1828
|
-
readonly name: "regex";
|
|
1829
|
-
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
1830
|
-
readonly required: true;
|
|
1831
|
-
readonly usageValue: "Your regex pattern here";
|
|
1832
|
-
}, {
|
|
1833
|
-
readonly name: "file_pattern";
|
|
1834
|
-
readonly description: "Comma-separated glob pattern to filter files (e.g., \"*.ts\" for TypeScript files or \"*.ts,*.js\" for both TypeScript and JavaScript files). If not provided, it will search all files (*).";
|
|
1835
|
-
readonly required: false;
|
|
1836
|
-
readonly usageValue: "file pattern here (optional)";
|
|
1837
|
-
}];
|
|
1045
|
+
readonly parameters: z.ZodObject<{
|
|
1046
|
+
path: z.ZodString;
|
|
1047
|
+
regex: z.ZodString;
|
|
1048
|
+
filePattern: z.ZodOptional<z.ZodString>;
|
|
1049
|
+
}, z.core.$strip>;
|
|
1838
1050
|
readonly examples: [{
|
|
1839
1051
|
readonly description: "Request to perform a regex search across files";
|
|
1840
1052
|
readonly parameters: [{
|
|
@@ -1844,7 +1056,7 @@ declare const _default_9: {
|
|
|
1844
1056
|
readonly name: "regex";
|
|
1845
1057
|
readonly value: "^components/";
|
|
1846
1058
|
}, {
|
|
1847
|
-
readonly name: "
|
|
1059
|
+
readonly name: "filePattern";
|
|
1848
1060
|
readonly value: "*.ts,*.tsx";
|
|
1849
1061
|
}];
|
|
1850
1062
|
}];
|
|
@@ -1853,22 +1065,11 @@ declare const _default_9: {
|
|
|
1853
1065
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
1854
1066
|
name: "search_files";
|
|
1855
1067
|
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.";
|
|
1856
|
-
parameters:
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
}, {
|
|
1862
|
-
readonly name: "regex";
|
|
1863
|
-
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
1864
|
-
readonly required: true;
|
|
1865
|
-
readonly usageValue: "Your regex pattern here";
|
|
1866
|
-
}, {
|
|
1867
|
-
readonly name: "file_pattern";
|
|
1868
|
-
readonly description: "Comma-separated glob pattern to filter files (e.g., \"*.ts\" for TypeScript files or \"*.ts,*.js\" for both TypeScript and JavaScript files). If not provided, it will search all files (*).";
|
|
1869
|
-
readonly required: false;
|
|
1870
|
-
readonly usageValue: "file pattern here (optional)";
|
|
1871
|
-
}];
|
|
1068
|
+
parameters: z.ZodObject<{
|
|
1069
|
+
path: z.ZodString;
|
|
1070
|
+
regex: z.ZodString;
|
|
1071
|
+
filePattern: z.ZodOptional<z.ZodString>;
|
|
1072
|
+
}, z.core.$strip>;
|
|
1872
1073
|
examples: [{
|
|
1873
1074
|
readonly description: "Request to perform a regex search across files";
|
|
1874
1075
|
readonly parameters: [{
|
|
@@ -1878,7 +1079,7 @@ declare const _default_9: {
|
|
|
1878
1079
|
readonly name: "regex";
|
|
1879
1080
|
readonly value: "^components/";
|
|
1880
1081
|
}, {
|
|
1881
|
-
readonly name: "
|
|
1082
|
+
readonly name: "filePattern";
|
|
1882
1083
|
readonly value: "*.ts,*.tsx";
|
|
1883
1084
|
}];
|
|
1884
1085
|
}];
|
|
@@ -1934,15 +1135,6 @@ export declare const default_alias_3: {
|
|
|
1934
1135
|
readonly agent: "analyzer";
|
|
1935
1136
|
};
|
|
1936
1137
|
|
|
1937
|
-
declare const defaultModels: {
|
|
1938
|
-
anthropic: string;
|
|
1939
|
-
ollama: string;
|
|
1940
|
-
deepseek: string;
|
|
1941
|
-
openrouter: string;
|
|
1942
|
-
};
|
|
1943
|
-
export { defaultModels }
|
|
1944
|
-
export { defaultModels as defaultModels_alias_1 }
|
|
1945
|
-
|
|
1946
1138
|
/**
|
|
1947
1139
|
* Returns the directory portion of a path string.
|
|
1948
1140
|
* Strips trailing slashes, then takes everything up to the last slash.
|
|
@@ -1951,14 +1143,17 @@ export declare function dirname(path: string): string;
|
|
|
1951
1143
|
|
|
1952
1144
|
export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
|
|
1953
1145
|
|
|
1146
|
+
declare const EnableCachePolicy: AgentPolicy;
|
|
1147
|
+
export { EnableCachePolicy }
|
|
1148
|
+
export { EnableCachePolicy as EnableCachePolicy_alias_1 }
|
|
1149
|
+
export { EnableCachePolicy as EnableCachePolicy_alias_2 }
|
|
1150
|
+
export { EnableCachePolicy as EnableCachePolicy_alias_3 }
|
|
1151
|
+
|
|
1954
1152
|
declare const executeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1955
1153
|
export { executeAgentTool }
|
|
1956
1154
|
export { executeAgentTool as executeAgentTool_alias_1 }
|
|
1957
1155
|
|
|
1958
|
-
declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai:
|
|
1959
|
-
response: GetOutput<T>;
|
|
1960
|
-
usage: ApiUsage;
|
|
1961
|
-
}>;
|
|
1156
|
+
declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
|
|
1962
1157
|
export { executeTool }
|
|
1963
1158
|
export { executeTool as executeTool_alias_1 }
|
|
1964
1159
|
|
|
@@ -1993,28 +1188,28 @@ export declare const fullSystemPrompt: (info: {
|
|
|
1993
1188
|
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1994
1189
|
command: string;
|
|
1995
1190
|
description: string;
|
|
1996
|
-
}
|
|
1191
|
+
}>, useNativeTool: boolean) => string;
|
|
1997
1192
|
|
|
1998
1193
|
export declare const fullSystemPrompt_alias_1: (info: {
|
|
1999
1194
|
os: string;
|
|
2000
1195
|
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
2001
1196
|
command: string;
|
|
2002
1197
|
description: string;
|
|
2003
|
-
}
|
|
1198
|
+
}>, useNativeTool: boolean) => string;
|
|
2004
1199
|
|
|
2005
1200
|
export declare const fullSystemPrompt_alias_2: (info: {
|
|
2006
1201
|
os: string;
|
|
2007
1202
|
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
2008
1203
|
command: string;
|
|
2009
1204
|
description: string;
|
|
2010
|
-
}>, interactive: boolean) => string;
|
|
1205
|
+
}>, interactive: boolean, useNativeTool: boolean) => string;
|
|
2011
1206
|
|
|
2012
1207
|
export declare const fullSystemPrompt_alias_3: (info: {
|
|
2013
1208
|
os: string;
|
|
2014
1209
|
}, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
2015
1210
|
command: string;
|
|
2016
1211
|
description: string;
|
|
2017
|
-
}
|
|
1212
|
+
}>, useNativeTool: boolean) => string;
|
|
2018
1213
|
|
|
2019
1214
|
declare type FullToolInfo = ToolInfo & {
|
|
2020
1215
|
handler: ToolHandler<ToolInfo, any>;
|
|
@@ -2023,27 +1218,28 @@ declare type FullToolInfo = ToolInfo & {
|
|
|
2023
1218
|
export { FullToolInfo }
|
|
2024
1219
|
export { FullToolInfo as FullToolInfo_alias_1 }
|
|
2025
1220
|
|
|
2026
|
-
declare
|
|
1221
|
+
declare type FullToolInfoV2 = ToolInfoV2 & {
|
|
1222
|
+
handler: ToolHandler<ToolInfoV2, any>;
|
|
1223
|
+
isAvailable: (provider: any) => boolean;
|
|
1224
|
+
};
|
|
1225
|
+
export { FullToolInfoV2 }
|
|
1226
|
+
export { FullToolInfoV2 as FullToolInfoV2_alias_1 }
|
|
1227
|
+
|
|
1228
|
+
declare const generateGitCommitMessage: (ai: LanguageModelV2, params: {
|
|
2027
1229
|
diff: string;
|
|
2028
1230
|
context?: string;
|
|
2029
|
-
}) => Promise<
|
|
2030
|
-
response: string;
|
|
2031
|
-
usage: ApiUsage;
|
|
2032
|
-
}>;
|
|
1231
|
+
}, usageMeter: UsageMeter) => Promise<string>;
|
|
2033
1232
|
export { generateGitCommitMessage }
|
|
2034
1233
|
export { generateGitCommitMessage as generateGitCommitMessage_alias_1 }
|
|
2035
1234
|
|
|
2036
|
-
declare const generateGithubPullRequestDetails: (ai:
|
|
1235
|
+
declare const generateGithubPullRequestDetails: (ai: LanguageModelV2, params: {
|
|
2037
1236
|
commitMessages: string;
|
|
2038
1237
|
commitDiff: string;
|
|
2039
1238
|
context?: string;
|
|
2040
1239
|
branchName: string;
|
|
2041
|
-
}) => Promise<{
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
description: string;
|
|
2045
|
-
};
|
|
2046
|
-
usage: ApiUsage;
|
|
1240
|
+
}, usageMeter: UsageMeter) => Promise<{
|
|
1241
|
+
title: string;
|
|
1242
|
+
description: string;
|
|
2047
1243
|
}>;
|
|
2048
1244
|
export { generateGithubPullRequestDetails }
|
|
2049
1245
|
export { generateGithubPullRequestDetails as generateGithubPullRequestDetails_alias_1 }
|
|
@@ -2052,10 +1248,7 @@ declare const generateProjectConfig: (agent: MultiAgent, params: unknown) => Pro
|
|
|
2052
1248
|
export { generateProjectConfig }
|
|
2053
1249
|
export { generateProjectConfig as generateProjectConfig_alias_1 }
|
|
2054
1250
|
|
|
2055
|
-
declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
|
|
2056
|
-
export { getArray }
|
|
2057
|
-
export { getArray as getArray_alias_1 }
|
|
2058
|
-
export { getArray as getArray_alias_2 }
|
|
1251
|
+
export declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
|
|
2059
1252
|
|
|
2060
1253
|
/**
|
|
2061
1254
|
* Get the available tools based on the provider and agent availability
|
|
@@ -2066,45 +1259,33 @@ export { getArray as getArray_alias_2 }
|
|
|
2066
1259
|
* @param interactive Determines whether the `askFollowupQuestion` tool is available.
|
|
2067
1260
|
* @returns The available tools
|
|
2068
1261
|
*/
|
|
2069
|
-
declare const getAvailableTools: ({ provider, allTools, hasAgent, permissionLevel, interactive, }: {
|
|
1262
|
+
declare const getAvailableTools: <T extends FullToolInfoV2 | FullToolInfo>({ provider, allTools, hasAgent, permissionLevel, interactive, }: {
|
|
2070
1263
|
provider: any;
|
|
2071
|
-
allTools:
|
|
1264
|
+
allTools: T[];
|
|
2072
1265
|
hasAgent: boolean;
|
|
2073
1266
|
permissionLevel: PermissionLevel;
|
|
2074
1267
|
interactive: boolean;
|
|
2075
|
-
}) =>
|
|
1268
|
+
}) => T[];
|
|
2076
1269
|
export { getAvailableTools }
|
|
2077
1270
|
export { getAvailableTools as getAvailableTools_alias_1 }
|
|
2078
1271
|
|
|
2079
|
-
declare const getBoolean: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: boolean) => boolean;
|
|
2080
|
-
export { getBoolean }
|
|
2081
|
-
export { getBoolean as getBoolean_alias_1 }
|
|
2082
|
-
export { getBoolean as getBoolean_alias_2 }
|
|
1272
|
+
export declare const getBoolean: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: boolean) => boolean;
|
|
2083
1273
|
|
|
2084
1274
|
declare type GetInput<T> = T extends AiToolDefinition<infer Input, any> ? Input : never;
|
|
2085
1275
|
export { GetInput }
|
|
2086
1276
|
export { GetInput as GetInput_alias_1 }
|
|
2087
1277
|
export { GetInput as GetInput_alias_2 }
|
|
2088
1278
|
|
|
2089
|
-
declare const getInt: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: number) => number;
|
|
2090
|
-
export { getInt }
|
|
2091
|
-
export { getInt as getInt_alias_1 }
|
|
2092
|
-
export { getInt as getInt_alias_2 }
|
|
1279
|
+
export declare const getInt: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: number) => number;
|
|
2093
1280
|
|
|
2094
1281
|
declare type GetOutput<T> = T extends AiToolDefinition<any, infer Output> ? Output : never;
|
|
2095
1282
|
export { GetOutput }
|
|
2096
1283
|
export { GetOutput as GetOutput_alias_1 }
|
|
2097
1284
|
export { GetOutput as GetOutput_alias_2 }
|
|
2098
1285
|
|
|
2099
|
-
declare const getString: <T extends string>(args: Partial<Record<T, string>> | ToolParameterValue, name: T, defaultValue?: string) => string;
|
|
2100
|
-
export { getString }
|
|
2101
|
-
export { getString as getString_alias_1 }
|
|
2102
|
-
export { getString as getString_alias_2 }
|
|
1286
|
+
export declare const getString: <T extends string>(args: Partial<Record<T, string>> | ToolParameterValue, name: T, defaultValue?: string) => string;
|
|
2103
1287
|
|
|
2104
|
-
declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
|
|
2105
|
-
export { getStringArray }
|
|
2106
|
-
export { getStringArray as getStringArray_alias_1 }
|
|
2107
|
-
export { getStringArray as getStringArray_alias_2 }
|
|
1288
|
+
export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
|
|
2108
1289
|
|
|
2109
1290
|
export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
|
|
2110
1291
|
|
|
@@ -2116,8 +1297,6 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
|
|
|
2116
1297
|
|
|
2117
1298
|
export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
|
|
2118
1299
|
|
|
2119
|
-
export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
|
|
2120
|
-
|
|
2121
1300
|
export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
|
|
2122
1301
|
|
|
2123
1302
|
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
|
|
@@ -2134,8 +1313,6 @@ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, Files
|
|
|
2134
1313
|
|
|
2135
1314
|
export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
|
|
2136
1315
|
|
|
2137
|
-
export declare type ImageBlockParam = Anthropic.Messages.ImageBlockParam;
|
|
2138
|
-
|
|
2139
1316
|
declare type Input = {
|
|
2140
1317
|
commitMessages: string;
|
|
2141
1318
|
commitDiff: string;
|
|
@@ -2161,8 +1338,6 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
|
|
|
2161
1338
|
|
|
2162
1339
|
export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
|
|
2163
1340
|
|
|
2164
|
-
export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
|
|
2165
|
-
|
|
2166
1341
|
export declare const isAvailable_alias_2: (_provider: any) => boolean;
|
|
2167
1342
|
|
|
2168
1343
|
export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
|
|
@@ -2184,166 +1359,14 @@ export declare const isAvailable_alias_9: (provider: FilesystemProvider) => bool
|
|
|
2184
1359
|
*/
|
|
2185
1360
|
export declare function join(...parts: string[]): string;
|
|
2186
1361
|
|
|
2187
|
-
declare const KnowledgeManagementPolicy: (tools: Parameters<AgentPolicy>[0]) => {
|
|
2188
|
-
name: Policies;
|
|
2189
|
-
tools: {
|
|
2190
|
-
handler: ToolHandler< {
|
|
2191
|
-
readonly name: "update_knowledge";
|
|
2192
|
-
readonly description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
|
|
2193
|
-
readonly parameters: [{
|
|
2194
|
-
readonly name: "path";
|
|
2195
|
-
readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
|
|
2196
|
-
readonly required: true;
|
|
2197
|
-
readonly usageValue: "Directory path here";
|
|
2198
|
-
}, {
|
|
2199
|
-
readonly name: "knowledge";
|
|
2200
|
-
readonly description: "YAML content to merge into the knowledge file";
|
|
2201
|
-
readonly required: true;
|
|
2202
|
-
readonly usageValue: "YAML content with knowledge to update";
|
|
2203
|
-
}];
|
|
2204
|
-
readonly examples: [{
|
|
2205
|
-
readonly description: "Add a new file entry";
|
|
2206
|
-
readonly parameters: [{
|
|
2207
|
-
readonly name: "path";
|
|
2208
|
-
readonly value: "src/utils";
|
|
2209
|
-
}, {
|
|
2210
|
-
readonly name: "knowledge";
|
|
2211
|
-
readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
|
|
2212
|
-
}];
|
|
2213
|
-
}, {
|
|
2214
|
-
readonly description: "Update an existing file description";
|
|
2215
|
-
readonly parameters: [{
|
|
2216
|
-
readonly name: "path";
|
|
2217
|
-
readonly value: "src/utils";
|
|
2218
|
-
}, {
|
|
2219
|
-
readonly name: "knowledge";
|
|
2220
|
-
readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
|
|
2221
|
-
}];
|
|
2222
|
-
}, {
|
|
2223
|
-
readonly description: "Add a new rule";
|
|
2224
|
-
readonly parameters: [{
|
|
2225
|
-
readonly name: "path";
|
|
2226
|
-
readonly value: "src";
|
|
2227
|
-
}, {
|
|
2228
|
-
readonly name: "knowledge";
|
|
2229
|
-
readonly value: "rules:\n 10: \"New rule to follow\"";
|
|
2230
|
-
}];
|
|
2231
|
-
}, {
|
|
2232
|
-
readonly description: "Remove a rule";
|
|
2233
|
-
readonly parameters: [{
|
|
2234
|
-
readonly name: "path";
|
|
2235
|
-
readonly value: "src";
|
|
2236
|
-
}, {
|
|
2237
|
-
readonly name: "knowledge";
|
|
2238
|
-
readonly value: "rules:\n 5: null";
|
|
2239
|
-
}];
|
|
2240
|
-
}, {
|
|
2241
|
-
readonly description: "Update nested properties using dot notation";
|
|
2242
|
-
readonly parameters: [{
|
|
2243
|
-
readonly name: "path";
|
|
2244
|
-
readonly value: "src/components";
|
|
2245
|
-
}, {
|
|
2246
|
-
readonly name: "knowledge";
|
|
2247
|
-
readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
|
|
2248
|
-
}];
|
|
2249
|
-
}];
|
|
2250
|
-
readonly permissionLevel: import("../..").PermissionLevel.Write;
|
|
2251
|
-
}, FilesystemProvider>;
|
|
2252
|
-
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
2253
|
-
name: "update_knowledge";
|
|
2254
|
-
description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
|
|
2255
|
-
parameters: [{
|
|
2256
|
-
readonly name: "path";
|
|
2257
|
-
readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
|
|
2258
|
-
readonly required: true;
|
|
2259
|
-
readonly usageValue: "Directory path here";
|
|
2260
|
-
}, {
|
|
2261
|
-
readonly name: "knowledge";
|
|
2262
|
-
readonly description: "YAML content to merge into the knowledge file";
|
|
2263
|
-
readonly required: true;
|
|
2264
|
-
readonly usageValue: "YAML content with knowledge to update";
|
|
2265
|
-
}];
|
|
2266
|
-
examples: [{
|
|
2267
|
-
readonly description: "Add a new file entry";
|
|
2268
|
-
readonly parameters: [{
|
|
2269
|
-
readonly name: "path";
|
|
2270
|
-
readonly value: "src/utils";
|
|
2271
|
-
}, {
|
|
2272
|
-
readonly name: "knowledge";
|
|
2273
|
-
readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
|
|
2274
|
-
}];
|
|
2275
|
-
}, {
|
|
2276
|
-
readonly description: "Update an existing file description";
|
|
2277
|
-
readonly parameters: [{
|
|
2278
|
-
readonly name: "path";
|
|
2279
|
-
readonly value: "src/utils";
|
|
2280
|
-
}, {
|
|
2281
|
-
readonly name: "knowledge";
|
|
2282
|
-
readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
|
|
2283
|
-
}];
|
|
2284
|
-
}, {
|
|
2285
|
-
readonly description: "Add a new rule";
|
|
2286
|
-
readonly parameters: [{
|
|
2287
|
-
readonly name: "path";
|
|
2288
|
-
readonly value: "src";
|
|
2289
|
-
}, {
|
|
2290
|
-
readonly name: "knowledge";
|
|
2291
|
-
readonly value: "rules:\n 10: \"New rule to follow\"";
|
|
2292
|
-
}];
|
|
2293
|
-
}, {
|
|
2294
|
-
readonly description: "Remove a rule";
|
|
2295
|
-
readonly parameters: [{
|
|
2296
|
-
readonly name: "path";
|
|
2297
|
-
readonly value: "src";
|
|
2298
|
-
}, {
|
|
2299
|
-
readonly name: "knowledge";
|
|
2300
|
-
readonly value: "rules:\n 5: null";
|
|
2301
|
-
}];
|
|
2302
|
-
}, {
|
|
2303
|
-
readonly description: "Update nested properties using dot notation";
|
|
2304
|
-
readonly parameters: [{
|
|
2305
|
-
readonly name: "path";
|
|
2306
|
-
readonly value: "src/components";
|
|
2307
|
-
}, {
|
|
2308
|
-
readonly name: "knowledge";
|
|
2309
|
-
readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
|
|
2310
|
-
}];
|
|
2311
|
-
}];
|
|
2312
|
-
permissionLevel: import("../..").PermissionLevel.Write;
|
|
2313
|
-
}[];
|
|
2314
|
-
prompt: string | undefined;
|
|
2315
|
-
getKnowledgeFilePaths(inputFiles: string[]): Promise<string[]>;
|
|
2316
|
-
updateResponse(response: AssistantMessageContent[]): Promise<(TextContent | ToolUse | {
|
|
2317
|
-
readonly type: "tool_use";
|
|
2318
|
-
readonly name: "read_file";
|
|
2319
|
-
readonly params: {
|
|
2320
|
-
readonly path: string;
|
|
2321
|
-
};
|
|
2322
|
-
})[]>;
|
|
2323
|
-
} | undefined;
|
|
2324
|
-
export { KnowledgeManagementPolicy }
|
|
2325
|
-
export { KnowledgeManagementPolicy as KnowledgeManagementPolicy_alias_1 }
|
|
2326
|
-
export { KnowledgeManagementPolicy as KnowledgeManagementPolicy_alias_2 }
|
|
2327
|
-
export { KnowledgeManagementPolicy as KnowledgeManagementPolicy_alias_3 }
|
|
2328
|
-
|
|
2329
|
-
export declare type KnowledgeManagementPolicyInstance = NonNullable<ReturnType<typeof KnowledgeManagementPolicy>>;
|
|
2330
|
-
|
|
2331
1362
|
declare const makeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
2332
1363
|
export { makeAgentTool }
|
|
2333
1364
|
export { makeAgentTool as makeAgentTool_alias_1 }
|
|
2334
1365
|
|
|
2335
|
-
declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai:
|
|
2336
|
-
response: GetOutput<T>;
|
|
2337
|
-
usage: ApiUsage;
|
|
2338
|
-
}>;
|
|
1366
|
+
declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
|
|
2339
1367
|
export { makeTool }
|
|
2340
1368
|
export { makeTool as makeTool_alias_1 }
|
|
2341
1369
|
|
|
2342
|
-
declare type MessageParam = Anthropic.Messages.MessageParam;
|
|
2343
|
-
export { MessageParam }
|
|
2344
|
-
export { MessageParam as MessageParam_alias_1 }
|
|
2345
|
-
export { MessageParam as MessageParam_alias_2 }
|
|
2346
|
-
|
|
2347
1370
|
declare class MockProvider implements ToolProvider {
|
|
2348
1371
|
readFile(path: string): Promise<string>;
|
|
2349
1372
|
writeFile(path: string, content: string): Promise<void>;
|
|
@@ -2363,127 +1386,14 @@ export { MockProvider }
|
|
|
2363
1386
|
export { MockProvider as MockProvider_alias_1 }
|
|
2364
1387
|
export { MockProvider as MockProvider_alias_2 }
|
|
2365
1388
|
|
|
2366
|
-
declare
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
inputPrice?: number;
|
|
2373
|
-
outputPrice?: number;
|
|
2374
|
-
cacheWritesPrice?: number;
|
|
2375
|
-
cacheReadsPrice?: number;
|
|
2376
|
-
reasoning?: boolean;
|
|
2377
|
-
}
|
|
1389
|
+
declare type ModelInfo = {
|
|
1390
|
+
inputPrice: number;
|
|
1391
|
+
outputPrice: number;
|
|
1392
|
+
cacheWritesPrice: number;
|
|
1393
|
+
cacheReadsPrice: number;
|
|
1394
|
+
};
|
|
2378
1395
|
export { ModelInfo }
|
|
2379
1396
|
export { ModelInfo as ModelInfo_alias_1 }
|
|
2380
|
-
export { ModelInfo as ModelInfo_alias_2 }
|
|
2381
|
-
|
|
2382
|
-
declare const modelInfos: {
|
|
2383
|
-
anthropic: {
|
|
2384
|
-
readonly 'claude-opus-4-20250514': {
|
|
2385
|
-
readonly maxTokens: 32000;
|
|
2386
|
-
readonly contextWindow: 200000;
|
|
2387
|
-
readonly supportsImages: true;
|
|
2388
|
-
readonly supportsComputerUse: true;
|
|
2389
|
-
readonly supportsPromptCache: true;
|
|
2390
|
-
readonly inputPrice: 15;
|
|
2391
|
-
readonly outputPrice: 75;
|
|
2392
|
-
readonly cacheWritesPrice: 18.75;
|
|
2393
|
-
readonly cacheReadsPrice: 1.5;
|
|
2394
|
-
readonly reasoning: true;
|
|
2395
|
-
};
|
|
2396
|
-
readonly 'claude-sonnet-4-20250514': {
|
|
2397
|
-
readonly maxTokens: 64000;
|
|
2398
|
-
readonly contextWindow: 200000;
|
|
2399
|
-
readonly supportsImages: true;
|
|
2400
|
-
readonly supportsComputerUse: true;
|
|
2401
|
-
readonly supportsPromptCache: true;
|
|
2402
|
-
readonly inputPrice: 3;
|
|
2403
|
-
readonly outputPrice: 15;
|
|
2404
|
-
readonly cacheWritesPrice: 3.75;
|
|
2405
|
-
readonly cacheReadsPrice: 0.3;
|
|
2406
|
-
readonly reasoning: true;
|
|
2407
|
-
};
|
|
2408
|
-
readonly 'claude-3-7-sonnet-20250219': {
|
|
2409
|
-
readonly maxTokens: 64000;
|
|
2410
|
-
readonly contextWindow: 200000;
|
|
2411
|
-
readonly supportsImages: true;
|
|
2412
|
-
readonly supportsComputerUse: true;
|
|
2413
|
-
readonly supportsPromptCache: true;
|
|
2414
|
-
readonly inputPrice: 3;
|
|
2415
|
-
readonly outputPrice: 15;
|
|
2416
|
-
readonly cacheWritesPrice: 3.75;
|
|
2417
|
-
readonly cacheReadsPrice: 0.3;
|
|
2418
|
-
readonly reasoning: true;
|
|
2419
|
-
};
|
|
2420
|
-
readonly 'claude-3-5-sonnet-20241022': {
|
|
2421
|
-
readonly maxTokens: 8192;
|
|
2422
|
-
readonly contextWindow: 200000;
|
|
2423
|
-
readonly supportsImages: true;
|
|
2424
|
-
readonly supportsComputerUse: true;
|
|
2425
|
-
readonly supportsPromptCache: true;
|
|
2426
|
-
readonly inputPrice: 3;
|
|
2427
|
-
readonly outputPrice: 15;
|
|
2428
|
-
readonly cacheWritesPrice: 3.75;
|
|
2429
|
-
readonly cacheReadsPrice: 0.3;
|
|
2430
|
-
};
|
|
2431
|
-
readonly 'claude-3-5-haiku-20241022': {
|
|
2432
|
-
readonly maxTokens: 8192;
|
|
2433
|
-
readonly contextWindow: 200000;
|
|
2434
|
-
readonly supportsImages: false;
|
|
2435
|
-
readonly supportsPromptCache: true;
|
|
2436
|
-
readonly inputPrice: 0.8;
|
|
2437
|
-
readonly outputPrice: 4;
|
|
2438
|
-
readonly cacheWritesPrice: 1;
|
|
2439
|
-
readonly cacheReadsPrice: 0.08;
|
|
2440
|
-
};
|
|
2441
|
-
readonly 'claude-3-opus-20240229': {
|
|
2442
|
-
readonly maxTokens: 4096;
|
|
2443
|
-
readonly contextWindow: 200000;
|
|
2444
|
-
readonly supportsImages: true;
|
|
2445
|
-
readonly supportsPromptCache: true;
|
|
2446
|
-
readonly inputPrice: 15;
|
|
2447
|
-
readonly outputPrice: 75;
|
|
2448
|
-
readonly cacheWritesPrice: 18.75;
|
|
2449
|
-
readonly cacheReadsPrice: 1.5;
|
|
2450
|
-
};
|
|
2451
|
-
readonly 'claude-3-haiku-20240307': {
|
|
2452
|
-
readonly maxTokens: 4096;
|
|
2453
|
-
readonly contextWindow: 200000;
|
|
2454
|
-
readonly supportsImages: true;
|
|
2455
|
-
readonly supportsPromptCache: true;
|
|
2456
|
-
readonly inputPrice: 0.25;
|
|
2457
|
-
readonly outputPrice: 1.25;
|
|
2458
|
-
readonly cacheWritesPrice: 0.3;
|
|
2459
|
-
readonly cacheReadsPrice: 0.03;
|
|
2460
|
-
};
|
|
2461
|
-
};
|
|
2462
|
-
deepseek: {
|
|
2463
|
-
readonly 'deepseek-chat': {
|
|
2464
|
-
readonly maxTokens: 8000;
|
|
2465
|
-
readonly contextWindow: 64000;
|
|
2466
|
-
readonly supportsImages: false;
|
|
2467
|
-
readonly supportsPromptCache: true;
|
|
2468
|
-
readonly inputPrice: 0;
|
|
2469
|
-
readonly outputPrice: 1.1;
|
|
2470
|
-
readonly cacheWritesPrice: 0.27;
|
|
2471
|
-
readonly cacheReadsPrice: 0.07;
|
|
2472
|
-
};
|
|
2473
|
-
readonly 'deepseek-reasoner': {
|
|
2474
|
-
readonly maxTokens: 8000;
|
|
2475
|
-
readonly contextWindow: 64000;
|
|
2476
|
-
readonly supportsImages: false;
|
|
2477
|
-
readonly supportsPromptCache: true;
|
|
2478
|
-
readonly inputPrice: 0;
|
|
2479
|
-
readonly outputPrice: 2.19;
|
|
2480
|
-
readonly cacheWritesPrice: 0.55;
|
|
2481
|
-
readonly cacheReadsPrice: 0.14;
|
|
2482
|
-
};
|
|
2483
|
-
};
|
|
2484
|
-
};
|
|
2485
|
-
export { modelInfos }
|
|
2486
|
-
export { modelInfos as modelInfos_alias_1 }
|
|
2487
1397
|
|
|
2488
1398
|
declare class MultiAgent {
|
|
2489
1399
|
#private;
|
|
@@ -2511,39 +1421,6 @@ export { MultiAgentConfig as MultiAgentConfig_alias_2 }
|
|
|
2511
1421
|
|
|
2512
1422
|
export declare const objectives: (toolNamePrefix: string) => string;
|
|
2513
1423
|
|
|
2514
|
-
export declare class OllamaService extends AiServiceBase {
|
|
2515
|
-
#private;
|
|
2516
|
-
readonly model: {
|
|
2517
|
-
provider: string;
|
|
2518
|
-
id: string;
|
|
2519
|
-
info: ModelInfo;
|
|
2520
|
-
};
|
|
2521
|
-
constructor(options: AiServiceOptions);
|
|
2522
|
-
sendImpl(systemPrompt: string, messages: MessageParam[], signal: AbortSignal): ApiStream;
|
|
2523
|
-
}
|
|
2524
|
-
|
|
2525
|
-
declare const openAiModelInfoSaneDefaults: {
|
|
2526
|
-
readonly maxTokens: -1;
|
|
2527
|
-
readonly contextWindow: 128000;
|
|
2528
|
-
readonly supportsImages: true;
|
|
2529
|
-
readonly supportsPromptCache: false;
|
|
2530
|
-
readonly inputPrice: 0;
|
|
2531
|
-
readonly outputPrice: 0;
|
|
2532
|
-
};
|
|
2533
|
-
export { openAiModelInfoSaneDefaults }
|
|
2534
|
-
export { openAiModelInfoSaneDefaults as openAiModelInfoSaneDefaults_alias_1 }
|
|
2535
|
-
|
|
2536
|
-
export declare class OpenRouterService extends AiServiceBase {
|
|
2537
|
-
#private;
|
|
2538
|
-
readonly model: {
|
|
2539
|
-
provider: string;
|
|
2540
|
-
id: string;
|
|
2541
|
-
info: ModelInfo;
|
|
2542
|
-
};
|
|
2543
|
-
constructor(options: AiServiceOptions);
|
|
2544
|
-
sendImpl(systemPrompt: string, messages: MessageParam[], signal: AbortSignal): ApiStream;
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
1424
|
declare type Output = {
|
|
2548
1425
|
title: string;
|
|
2549
1426
|
description: string;
|
|
@@ -2625,8 +1502,8 @@ export { PermissionLevel }
|
|
|
2625
1502
|
export { PermissionLevel as PermissionLevel_alias_1 }
|
|
2626
1503
|
|
|
2627
1504
|
declare enum Policies {
|
|
2628
|
-
|
|
2629
|
-
|
|
1505
|
+
TruncateContext = "truncatecontext",
|
|
1506
|
+
EnableCache = "enablecache"
|
|
2630
1507
|
}
|
|
2631
1508
|
export { Policies }
|
|
2632
1509
|
export { Policies as Policies_alias_1 }
|
|
@@ -2648,7 +1525,7 @@ export { ReplaceResult as ReplaceResult_alias_1 }
|
|
|
2648
1525
|
declare const responsePrompts: {
|
|
2649
1526
|
readonly errorInvokeTool: (tool: string, error: unknown) => string;
|
|
2650
1527
|
readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
|
|
2651
|
-
readonly toolResults: (tool: string, result:
|
|
1528
|
+
readonly toolResults: (tool: string, result: UserContent_2) => Array<TextPart | ImagePart | FilePart>;
|
|
2652
1529
|
readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
|
|
2653
1530
|
};
|
|
2654
1531
|
export { responsePrompts }
|
|
@@ -2660,11 +1537,11 @@ export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before
|
|
|
2660
1537
|
export declare const rules: (toolNamePrefix: string) => string;
|
|
2661
1538
|
|
|
2662
1539
|
declare type SharedAgentOptions = {
|
|
2663
|
-
ai:
|
|
1540
|
+
ai: LanguageModelV2;
|
|
2664
1541
|
os: string;
|
|
2665
1542
|
provider: ToolProvider;
|
|
2666
1543
|
interactive: boolean;
|
|
2667
|
-
additionalTools?:
|
|
1544
|
+
additionalTools?: FullToolInfoV2[];
|
|
2668
1545
|
customInstructions?: string[];
|
|
2669
1546
|
scripts?: Record<string, string | {
|
|
2670
1547
|
command: string;
|
|
@@ -2675,6 +1552,9 @@ declare type SharedAgentOptions = {
|
|
|
2675
1552
|
policies: AgentPolicy[];
|
|
2676
1553
|
retryCount?: number;
|
|
2677
1554
|
requestTimeoutSeconds?: number;
|
|
1555
|
+
toolFormat: ToolFormat;
|
|
1556
|
+
parameters?: Record<string, any>;
|
|
1557
|
+
usageMeter?: UsageMeter;
|
|
2678
1558
|
};
|
|
2679
1559
|
export { SharedAgentOptions }
|
|
2680
1560
|
export { SharedAgentOptions as SharedAgentOptions_alias_1 }
|
|
@@ -2846,8 +1726,6 @@ export { TaskEventUsageExceeded }
|
|
|
2846
1726
|
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
|
|
2847
1727
|
export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
|
|
2848
1728
|
|
|
2849
|
-
export declare type TextBlockParam = Anthropic.Messages.TextBlockParam;
|
|
2850
|
-
|
|
2851
1729
|
declare interface TextContent {
|
|
2852
1730
|
type: 'text';
|
|
2853
1731
|
content: string;
|
|
@@ -2866,7 +1744,11 @@ declare type ToolExample = {
|
|
|
2866
1744
|
export { ToolExample }
|
|
2867
1745
|
export { ToolExample as ToolExample_alias_1 }
|
|
2868
1746
|
|
|
2869
|
-
declare type
|
|
1747
|
+
declare type ToolFormat = 'native' | 'polka-codes';
|
|
1748
|
+
export { ToolFormat }
|
|
1749
|
+
export { ToolFormat as ToolFormat_alias_1 }
|
|
1750
|
+
|
|
1751
|
+
declare type ToolHandler<T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
|
|
2870
1752
|
export { ToolHandler }
|
|
2871
1753
|
export { ToolHandler as ToolHandler_alias_1 }
|
|
2872
1754
|
|
|
@@ -2883,25 +1765,12 @@ export { ToolInfo as ToolInfo_alias_1 }
|
|
|
2883
1765
|
export declare const toolInfo: {
|
|
2884
1766
|
readonly name: "ask_followup_question";
|
|
2885
1767
|
readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
|
|
2886
|
-
readonly parameters:
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
readonly children: [{
|
|
2893
|
-
readonly name: "prompt";
|
|
2894
|
-
readonly description: "The text of the question.";
|
|
2895
|
-
readonly required: true;
|
|
2896
|
-
readonly usageValue: "question text here";
|
|
2897
|
-
}, {
|
|
2898
|
-
readonly name: "options";
|
|
2899
|
-
readonly description: "Ordered list of suggested answers (omit if none).";
|
|
2900
|
-
readonly required: false;
|
|
2901
|
-
readonly allowMultiple: true;
|
|
2902
|
-
readonly usageValue: "suggested answer here";
|
|
2903
|
-
}];
|
|
2904
|
-
}];
|
|
1768
|
+
readonly parameters: z.ZodObject<{
|
|
1769
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
1770
|
+
prompt: z.ZodString;
|
|
1771
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1772
|
+
}, z.core.$strip>>;
|
|
1773
|
+
}, z.core.$strip>;
|
|
2905
1774
|
readonly examples: [{
|
|
2906
1775
|
readonly description: "Single clarifying question (no options)";
|
|
2907
1776
|
readonly parameters: [{
|
|
@@ -2946,12 +1815,9 @@ export declare const toolInfo: {
|
|
|
2946
1815
|
export declare const toolInfo_alias_1: {
|
|
2947
1816
|
readonly name: "attempt_completion";
|
|
2948
1817
|
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.";
|
|
2949
|
-
readonly parameters:
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
readonly required: true;
|
|
2953
|
-
readonly usageValue: "Your final result description here";
|
|
2954
|
-
}];
|
|
1818
|
+
readonly parameters: z.ZodObject<{
|
|
1819
|
+
result: z.ZodString;
|
|
1820
|
+
}, z.core.$strip>;
|
|
2955
1821
|
readonly examples: [{
|
|
2956
1822
|
readonly description: "Request to present the result of the task";
|
|
2957
1823
|
readonly parameters: [{
|
|
@@ -2965,17 +1831,10 @@ export declare const toolInfo_alias_1: {
|
|
|
2965
1831
|
export declare const toolInfo_alias_10: {
|
|
2966
1832
|
readonly name: "replace_in_file";
|
|
2967
1833
|
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.";
|
|
2968
|
-
readonly parameters:
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
readonly usageValue: "File path here";
|
|
2973
|
-
}, {
|
|
2974
|
-
readonly name: "diff";
|
|
2975
|
-
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```\nCritical rules:\n1. 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.\n2. 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.\n3. 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.\n4. 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";
|
|
2976
|
-
readonly required: true;
|
|
2977
|
-
readonly usageValue: "Search and replace blocks here";
|
|
2978
|
-
}];
|
|
1834
|
+
readonly parameters: z.ZodObject<{
|
|
1835
|
+
path: z.ZodString;
|
|
1836
|
+
diff: z.ZodString;
|
|
1837
|
+
}, z.core.$strip>;
|
|
2979
1838
|
readonly examples: [{
|
|
2980
1839
|
readonly description: "Request to replace sections of content in a file";
|
|
2981
1840
|
readonly parameters: [{
|
|
@@ -2983,7 +1842,7 @@ export declare const toolInfo_alias_10: {
|
|
|
2983
1842
|
readonly value: "src/main.js";
|
|
2984
1843
|
}, {
|
|
2985
1844
|
readonly name: "diff";
|
|
2986
|
-
readonly value: "
|
|
1845
|
+
readonly value: "<<<<<<< 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";
|
|
2987
1846
|
}];
|
|
2988
1847
|
}, {
|
|
2989
1848
|
readonly description: "Request to perform a simple, single-line replacement";
|
|
@@ -2992,7 +1851,7 @@ export declare const toolInfo_alias_10: {
|
|
|
2992
1851
|
readonly value: "src/config.js";
|
|
2993
1852
|
}, {
|
|
2994
1853
|
readonly name: "diff";
|
|
2995
|
-
readonly value: "
|
|
1854
|
+
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
2996
1855
|
}];
|
|
2997
1856
|
}, {
|
|
2998
1857
|
readonly description: "Request to add a new function to a file";
|
|
@@ -3001,7 +1860,7 @@ export declare const toolInfo_alias_10: {
|
|
|
3001
1860
|
readonly value: "src/utils.js";
|
|
3002
1861
|
}, {
|
|
3003
1862
|
readonly name: "diff";
|
|
3004
|
-
readonly value: "
|
|
1863
|
+
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
3005
1864
|
}];
|
|
3006
1865
|
}, {
|
|
3007
1866
|
readonly description: "Request to delete a block of code from a file";
|
|
@@ -3010,7 +1869,7 @@ export declare const toolInfo_alias_10: {
|
|
|
3010
1869
|
readonly value: "src/app.js";
|
|
3011
1870
|
}, {
|
|
3012
1871
|
readonly name: "diff";
|
|
3013
|
-
readonly value: "
|
|
1872
|
+
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
3014
1873
|
}];
|
|
3015
1874
|
}];
|
|
3016
1875
|
readonly permissionLevel: PermissionLevel.Write;
|
|
@@ -3019,22 +1878,11 @@ export declare const toolInfo_alias_10: {
|
|
|
3019
1878
|
export declare const toolInfo_alias_11: {
|
|
3020
1879
|
readonly name: "search_files";
|
|
3021
1880
|
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.";
|
|
3022
|
-
readonly parameters:
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
}, {
|
|
3028
|
-
readonly name: "regex";
|
|
3029
|
-
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
3030
|
-
readonly required: true;
|
|
3031
|
-
readonly usageValue: "Your regex pattern here";
|
|
3032
|
-
}, {
|
|
3033
|
-
readonly name: "file_pattern";
|
|
3034
|
-
readonly description: "Comma-separated glob pattern to filter files (e.g., \"*.ts\" for TypeScript files or \"*.ts,*.js\" for both TypeScript and JavaScript files). If not provided, it will search all files (*).";
|
|
3035
|
-
readonly required: false;
|
|
3036
|
-
readonly usageValue: "file pattern here (optional)";
|
|
3037
|
-
}];
|
|
1881
|
+
readonly parameters: z.ZodObject<{
|
|
1882
|
+
path: z.ZodString;
|
|
1883
|
+
regex: z.ZodString;
|
|
1884
|
+
filePattern: z.ZodOptional<z.ZodString>;
|
|
1885
|
+
}, z.core.$strip>;
|
|
3038
1886
|
readonly examples: [{
|
|
3039
1887
|
readonly description: "Request to perform a regex search across files";
|
|
3040
1888
|
readonly parameters: [{
|
|
@@ -3044,7 +1892,7 @@ export declare const toolInfo_alias_11: {
|
|
|
3044
1892
|
readonly name: "regex";
|
|
3045
1893
|
readonly value: "^components/";
|
|
3046
1894
|
}, {
|
|
3047
|
-
readonly name: "
|
|
1895
|
+
readonly name: "filePattern";
|
|
3048
1896
|
readonly value: "*.ts,*.tsx";
|
|
3049
1897
|
}];
|
|
3050
1898
|
}];
|
|
@@ -3052,82 +1900,12 @@ export declare const toolInfo_alias_11: {
|
|
|
3052
1900
|
};
|
|
3053
1901
|
|
|
3054
1902
|
export declare const toolInfo_alias_12: {
|
|
3055
|
-
readonly name: "update_knowledge";
|
|
3056
|
-
readonly description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
|
|
3057
|
-
readonly parameters: [{
|
|
3058
|
-
readonly name: "path";
|
|
3059
|
-
readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
|
|
3060
|
-
readonly required: true;
|
|
3061
|
-
readonly usageValue: "Directory path here";
|
|
3062
|
-
}, {
|
|
3063
|
-
readonly name: "knowledge";
|
|
3064
|
-
readonly description: "YAML content to merge into the knowledge file";
|
|
3065
|
-
readonly required: true;
|
|
3066
|
-
readonly usageValue: "YAML content with knowledge to update";
|
|
3067
|
-
}];
|
|
3068
|
-
readonly examples: [{
|
|
3069
|
-
readonly description: "Add a new file entry";
|
|
3070
|
-
readonly parameters: [{
|
|
3071
|
-
readonly name: "path";
|
|
3072
|
-
readonly value: "src/utils";
|
|
3073
|
-
}, {
|
|
3074
|
-
readonly name: "knowledge";
|
|
3075
|
-
readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
|
|
3076
|
-
}];
|
|
3077
|
-
}, {
|
|
3078
|
-
readonly description: "Update an existing file description";
|
|
3079
|
-
readonly parameters: [{
|
|
3080
|
-
readonly name: "path";
|
|
3081
|
-
readonly value: "src/utils";
|
|
3082
|
-
}, {
|
|
3083
|
-
readonly name: "knowledge";
|
|
3084
|
-
readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
|
|
3085
|
-
}];
|
|
3086
|
-
}, {
|
|
3087
|
-
readonly description: "Add a new rule";
|
|
3088
|
-
readonly parameters: [{
|
|
3089
|
-
readonly name: "path";
|
|
3090
|
-
readonly value: "src";
|
|
3091
|
-
}, {
|
|
3092
|
-
readonly name: "knowledge";
|
|
3093
|
-
readonly value: "rules:\n 10: \"New rule to follow\"";
|
|
3094
|
-
}];
|
|
3095
|
-
}, {
|
|
3096
|
-
readonly description: "Remove a rule";
|
|
3097
|
-
readonly parameters: [{
|
|
3098
|
-
readonly name: "path";
|
|
3099
|
-
readonly value: "src";
|
|
3100
|
-
}, {
|
|
3101
|
-
readonly name: "knowledge";
|
|
3102
|
-
readonly value: "rules:\n 5: null";
|
|
3103
|
-
}];
|
|
3104
|
-
}, {
|
|
3105
|
-
readonly description: "Update nested properties using dot notation";
|
|
3106
|
-
readonly parameters: [{
|
|
3107
|
-
readonly name: "path";
|
|
3108
|
-
readonly value: "src/components";
|
|
3109
|
-
}, {
|
|
3110
|
-
readonly name: "knowledge";
|
|
3111
|
-
readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
|
|
3112
|
-
}];
|
|
3113
|
-
}];
|
|
3114
|
-
readonly permissionLevel: PermissionLevel.Write;
|
|
3115
|
-
};
|
|
3116
|
-
|
|
3117
|
-
export declare const toolInfo_alias_13: {
|
|
3118
1903
|
readonly name: "write_to_file";
|
|
3119
1904
|
readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
3120
|
-
readonly parameters:
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
readonly usageValue: "File path here";
|
|
3125
|
-
}, {
|
|
3126
|
-
readonly name: "content";
|
|
3127
|
-
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.";
|
|
3128
|
-
readonly required: true;
|
|
3129
|
-
readonly usageValue: "Your file content here";
|
|
3130
|
-
}];
|
|
1905
|
+
readonly parameters: z.ZodObject<{
|
|
1906
|
+
path: z.ZodString;
|
|
1907
|
+
content: z.ZodString;
|
|
1908
|
+
}, z.core.$strip>;
|
|
3131
1909
|
readonly examples: [{
|
|
3132
1910
|
readonly description: "Request to write content to a file";
|
|
3133
1911
|
readonly parameters: [{
|
|
@@ -3144,31 +1922,16 @@ export declare const toolInfo_alias_13: {
|
|
|
3144
1922
|
export declare const toolInfo_alias_2: {
|
|
3145
1923
|
readonly name: "delegate";
|
|
3146
1924
|
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.";
|
|
3147
|
-
readonly parameters:
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
},
|
|
3153
|
-
readonly name: "task";
|
|
3154
|
-
readonly description: "The task to be completed by the target agent";
|
|
3155
|
-
readonly required: true;
|
|
3156
|
-
readonly usageValue: "Task description";
|
|
3157
|
-
}, {
|
|
3158
|
-
readonly name: "context";
|
|
3159
|
-
readonly description: "The context information for the task";
|
|
3160
|
-
readonly required: true;
|
|
3161
|
-
readonly usageValue: "Context information";
|
|
3162
|
-
}, {
|
|
3163
|
-
readonly name: "files";
|
|
3164
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
3165
|
-
readonly required: false;
|
|
3166
|
-
readonly usageValue: "Relevant files";
|
|
3167
|
-
}];
|
|
1925
|
+
readonly parameters: z.ZodObject<{
|
|
1926
|
+
agentName: z.ZodString;
|
|
1927
|
+
task: z.ZodString;
|
|
1928
|
+
context: z.ZodString;
|
|
1929
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
1930
|
+
}, z.core.$strip>;
|
|
3168
1931
|
readonly examples: [{
|
|
3169
1932
|
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
3170
1933
|
readonly parameters: [{
|
|
3171
|
-
readonly name: "
|
|
1934
|
+
readonly name: "agentName";
|
|
3172
1935
|
readonly value: "analyzer";
|
|
3173
1936
|
}, {
|
|
3174
1937
|
readonly name: "task";
|
|
@@ -3187,24 +1950,17 @@ export declare const toolInfo_alias_2: {
|
|
|
3187
1950
|
export declare const toolInfo_alias_3: {
|
|
3188
1951
|
readonly name: "execute_command";
|
|
3189
1952
|
readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
|
|
3190
|
-
readonly parameters:
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
readonly usageValue: "your-command-here";
|
|
3195
|
-
}, {
|
|
3196
|
-
readonly name: "requires_approval";
|
|
3197
|
-
readonly description: "Set to `true` for commands that install/uninstall software, modify or delete files, change system settings, perform network operations, or have other side effects. Use `false` for safe, read-only, or purely local development actions (e.g., listing files, make a build, running tests).";
|
|
3198
|
-
readonly required: false;
|
|
3199
|
-
readonly usageValue: "true | false";
|
|
3200
|
-
}];
|
|
1953
|
+
readonly parameters: z.ZodObject<{
|
|
1954
|
+
command: z.ZodString;
|
|
1955
|
+
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1956
|
+
}, z.core.$strip>;
|
|
3201
1957
|
readonly examples: [{
|
|
3202
1958
|
readonly description: "Make a build";
|
|
3203
1959
|
readonly parameters: [{
|
|
3204
1960
|
readonly name: "command";
|
|
3205
1961
|
readonly value: "npm run build";
|
|
3206
1962
|
}, {
|
|
3207
|
-
readonly name: "
|
|
1963
|
+
readonly name: "requiresApproval";
|
|
3208
1964
|
readonly value: "false";
|
|
3209
1965
|
}];
|
|
3210
1966
|
}];
|
|
@@ -3214,11 +1970,9 @@ export declare const toolInfo_alias_3: {
|
|
|
3214
1970
|
export declare const toolInfo_alias_4: {
|
|
3215
1971
|
readonly name: "fetch_url";
|
|
3216
1972
|
readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
|
|
3217
|
-
readonly parameters:
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
readonly required: true;
|
|
3221
|
-
}];
|
|
1973
|
+
readonly parameters: z.ZodObject<{
|
|
1974
|
+
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1975
|
+
}, z.core.$strip>;
|
|
3222
1976
|
readonly examples: [{
|
|
3223
1977
|
readonly description: "Fetch a single webpage";
|
|
3224
1978
|
readonly parameters: [{
|
|
@@ -3244,31 +1998,16 @@ export declare const toolInfo_alias_4: {
|
|
|
3244
1998
|
export declare const toolInfo_alias_5: {
|
|
3245
1999
|
readonly name: "hand_over";
|
|
3246
2000
|
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
3247
|
-
readonly parameters:
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
},
|
|
3253
|
-
readonly name: "task";
|
|
3254
|
-
readonly description: "The task to be completed by the target agent";
|
|
3255
|
-
readonly required: true;
|
|
3256
|
-
readonly usageValue: "Task description";
|
|
3257
|
-
}, {
|
|
3258
|
-
readonly name: "context";
|
|
3259
|
-
readonly description: "The context information for the task";
|
|
3260
|
-
readonly required: true;
|
|
3261
|
-
readonly usageValue: "Context information";
|
|
3262
|
-
}, {
|
|
3263
|
-
readonly name: "files";
|
|
3264
|
-
readonly description: "The files relevant to the task. Comma separated paths";
|
|
3265
|
-
readonly required: false;
|
|
3266
|
-
readonly usageValue: "Relevant files";
|
|
3267
|
-
}];
|
|
2001
|
+
readonly parameters: z.ZodObject<{
|
|
2002
|
+
agentName: z.ZodString;
|
|
2003
|
+
task: z.ZodString;
|
|
2004
|
+
context: z.ZodString;
|
|
2005
|
+
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
2006
|
+
}, z.core.$strip>;
|
|
3268
2007
|
readonly examples: [{
|
|
3269
2008
|
readonly description: "Hand over a coding task to the coder agent";
|
|
3270
2009
|
readonly parameters: [{
|
|
3271
|
-
readonly name: "
|
|
2010
|
+
readonly name: "agentName";
|
|
3272
2011
|
readonly value: "coder";
|
|
3273
2012
|
}, {
|
|
3274
2013
|
readonly name: "task";
|
|
@@ -3287,29 +2026,18 @@ export declare const toolInfo_alias_5: {
|
|
|
3287
2026
|
export declare const toolInfo_alias_6: {
|
|
3288
2027
|
readonly name: "list_files";
|
|
3289
2028
|
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.";
|
|
3290
|
-
readonly parameters:
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
}, {
|
|
3296
|
-
readonly name: "max_count";
|
|
3297
|
-
readonly description: "The maximum number of files to list. Default to 2000";
|
|
3298
|
-
readonly required: false;
|
|
3299
|
-
readonly usageValue: "Maximum number of files to list (optional)";
|
|
3300
|
-
}, {
|
|
3301
|
-
readonly name: "recursive";
|
|
3302
|
-
readonly description: "Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.";
|
|
3303
|
-
readonly required: false;
|
|
3304
|
-
readonly usageValue: "true or false (optional)";
|
|
3305
|
-
}];
|
|
2029
|
+
readonly parameters: z.ZodObject<{
|
|
2030
|
+
path: z.ZodString;
|
|
2031
|
+
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
2032
|
+
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
2033
|
+
}, z.core.$strip>;
|
|
3306
2034
|
readonly examples: [{
|
|
3307
2035
|
readonly description: "Request to list files";
|
|
3308
2036
|
readonly parameters: [{
|
|
3309
2037
|
readonly name: "path";
|
|
3310
2038
|
readonly value: "src";
|
|
3311
2039
|
}, {
|
|
3312
|
-
readonly name: "
|
|
2040
|
+
readonly name: "maxCount";
|
|
3313
2041
|
readonly value: "100";
|
|
3314
2042
|
}];
|
|
3315
2043
|
}];
|
|
@@ -3319,12 +2047,9 @@ export declare const toolInfo_alias_6: {
|
|
|
3319
2047
|
export declare const toolInfo_alias_7: {
|
|
3320
2048
|
readonly name: "read_file";
|
|
3321
2049
|
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.";
|
|
3322
|
-
readonly parameters:
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
readonly required: true;
|
|
3326
|
-
readonly usageValue: "Comma separated paths here";
|
|
3327
|
-
}];
|
|
2050
|
+
readonly parameters: z.ZodObject<{
|
|
2051
|
+
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
2052
|
+
}, z.core.$strip>;
|
|
3328
2053
|
readonly examples: [{
|
|
3329
2054
|
readonly description: "Request to read the contents of a file";
|
|
3330
2055
|
readonly parameters: [{
|
|
@@ -3344,12 +2069,9 @@ export declare const toolInfo_alias_7: {
|
|
|
3344
2069
|
export declare const toolInfo_alias_8: {
|
|
3345
2070
|
readonly name: "remove_file";
|
|
3346
2071
|
readonly description: "Request to remove a file at the specified path.";
|
|
3347
|
-
readonly parameters:
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
readonly required: true;
|
|
3351
|
-
readonly usageValue: "File path here";
|
|
3352
|
-
}];
|
|
2072
|
+
readonly parameters: z.ZodObject<{
|
|
2073
|
+
path: z.ZodString;
|
|
2074
|
+
}, z.core.$strip>;
|
|
3353
2075
|
readonly examples: [{
|
|
3354
2076
|
readonly description: "Request to remove a file";
|
|
3355
2077
|
readonly parameters: [{
|
|
@@ -3363,17 +2085,10 @@ export declare const toolInfo_alias_8: {
|
|
|
3363
2085
|
export declare const toolInfo_alias_9: {
|
|
3364
2086
|
readonly name: "rename_file";
|
|
3365
2087
|
readonly description: "Request to rename a file from source path to target path.";
|
|
3366
|
-
readonly parameters:
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
readonly usageValue: "Source file path here";
|
|
3371
|
-
}, {
|
|
3372
|
-
readonly name: "target_path";
|
|
3373
|
-
readonly description: "The new path for the file";
|
|
3374
|
-
readonly required: true;
|
|
3375
|
-
readonly usageValue: "Target file path here";
|
|
3376
|
-
}];
|
|
2088
|
+
readonly parameters: z.ZodObject<{
|
|
2089
|
+
source_path: z.ZodString;
|
|
2090
|
+
target_path: z.ZodString;
|
|
2091
|
+
}, z.core.$strip>;
|
|
3377
2092
|
readonly examples: [{
|
|
3378
2093
|
readonly description: "Request to rename a file";
|
|
3379
2094
|
readonly parameters: [{
|
|
@@ -3387,6 +2102,16 @@ export declare const toolInfo_alias_9: {
|
|
|
3387
2102
|
readonly permissionLevel: PermissionLevel.Write;
|
|
3388
2103
|
};
|
|
3389
2104
|
|
|
2105
|
+
declare type ToolInfoV2 = {
|
|
2106
|
+
name: string;
|
|
2107
|
+
description: string;
|
|
2108
|
+
parameters: z.ZodObject<any>;
|
|
2109
|
+
examples?: ToolExample[];
|
|
2110
|
+
permissionLevel: PermissionLevel;
|
|
2111
|
+
};
|
|
2112
|
+
export { ToolInfoV2 }
|
|
2113
|
+
export { ToolInfoV2 as ToolInfoV2_alias_1 }
|
|
2114
|
+
|
|
3390
2115
|
declare type ToolParameter = {
|
|
3391
2116
|
name: string;
|
|
3392
2117
|
description: string;
|
|
@@ -3517,7 +2242,16 @@ export { toolUsePrompt }
|
|
|
3517
2242
|
export { toolUsePrompt as toolUsePrompt_alias_1 }
|
|
3518
2243
|
export { toolUsePrompt as toolUsePrompt_alias_2 }
|
|
3519
2244
|
|
|
3520
|
-
declare
|
|
2245
|
+
declare type Totals = {
|
|
2246
|
+
input: number;
|
|
2247
|
+
output: number;
|
|
2248
|
+
cachedRead: number;
|
|
2249
|
+
cost: number;
|
|
2250
|
+
};
|
|
2251
|
+
|
|
2252
|
+
export declare function toToolInfoV1(tool: FullToolInfoV2): FullToolInfo;
|
|
2253
|
+
|
|
2254
|
+
declare const TruncateContextPolicy: () => {
|
|
3521
2255
|
name: Policies;
|
|
3522
2256
|
onBeforeRequest(agent: AgentBase): Promise<void>;
|
|
3523
2257
|
};
|
|
@@ -3526,53 +2260,58 @@ export { TruncateContextPolicy as TruncateContextPolicy_alias_1 }
|
|
|
3526
2260
|
export { TruncateContextPolicy as TruncateContextPolicy_alias_2 }
|
|
3527
2261
|
export { TruncateContextPolicy as TruncateContextPolicy_alias_3 }
|
|
3528
2262
|
|
|
2263
|
+
/**
|
|
2264
|
+
* Tracks token / cost usage across any mix of LLM models.
|
|
2265
|
+
* Supports optional caps on total messages and total cost.
|
|
2266
|
+
*/
|
|
3529
2267
|
declare class UsageMeter {
|
|
3530
2268
|
#private;
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
constructor(options?: {
|
|
2269
|
+
constructor(modelInfos?: Record<string, Record<string, Partial<ModelInfo>>>, opts?: {
|
|
2270
|
+
maxMessages?: number;
|
|
3534
2271
|
maxCost?: number;
|
|
3535
|
-
maxMessageCount?: number;
|
|
3536
|
-
prices?: Record<string, Record<string, ModelInfo>>;
|
|
3537
2272
|
});
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
2273
|
+
addUsage(llm: LanguageModelV2, resp: {
|
|
2274
|
+
usage: LanguageModelV2Usage;
|
|
2275
|
+
providerMetadata?: any;
|
|
2276
|
+
} | {
|
|
2277
|
+
totalUsage: LanguageModelV2Usage;
|
|
2278
|
+
providerMetadata?: any;
|
|
2279
|
+
}, options?: {
|
|
2280
|
+
modelInfo?: ModelInfo;
|
|
3544
2281
|
}): void;
|
|
3545
|
-
|
|
3546
|
-
|
|
2282
|
+
/** Override the running totals (e.g., restore from saved state). */
|
|
2283
|
+
setUsage(newUsage: Partial<Totals & {
|
|
2284
|
+
calls: number;
|
|
2285
|
+
}>): void;
|
|
2286
|
+
/** Manually bump the message count (useful if you record some calls without token info). */
|
|
2287
|
+
incrementMessageCount(n?: number): void;
|
|
2288
|
+
/** Return true once either messages or cost exceed the configured caps. */
|
|
3547
2289
|
isLimitExceeded(): {
|
|
3548
2290
|
messageCount: boolean;
|
|
3549
|
-
|
|
2291
|
+
maxMessages: number;
|
|
3550
2292
|
cost: boolean;
|
|
3551
2293
|
maxCost: number;
|
|
3552
2294
|
result: boolean;
|
|
3553
2295
|
};
|
|
2296
|
+
/** Same as isLimitExceeded but throws an error if a limit is hit. */
|
|
3554
2297
|
checkLimit(): void;
|
|
3555
|
-
/**
|
|
3556
|
-
* Get current usage totals
|
|
3557
|
-
*/
|
|
2298
|
+
/** Getter for the aggregated totals (immutable copy). */
|
|
3558
2299
|
get usage(): {
|
|
3559
2300
|
messageCount: number;
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
totalCost: number;
|
|
2301
|
+
input: number;
|
|
2302
|
+
output: number;
|
|
2303
|
+
cachedRead: number;
|
|
2304
|
+
cost: number;
|
|
3565
2305
|
};
|
|
2306
|
+
/** Print a concise usage summary to console. */
|
|
3566
2307
|
printUsage(): void;
|
|
2308
|
+
onFinishHandler(llm: LanguageModelV2): (evt: {
|
|
2309
|
+
totalUsage: LanguageModelV2Usage;
|
|
2310
|
+
providerMetadata: any;
|
|
2311
|
+
}) => void;
|
|
3567
2312
|
}
|
|
3568
2313
|
export { UsageMeter }
|
|
3569
2314
|
export { UsageMeter as UsageMeter_alias_1 }
|
|
3570
|
-
export { UsageMeter as UsageMeter_alias_2 }
|
|
3571
|
-
|
|
3572
|
-
declare type UserContent = string | (TextBlockParam | ImageBlockParam)[];
|
|
3573
|
-
export { UserContent }
|
|
3574
|
-
export { UserContent as UserContent_alias_1 }
|
|
3575
|
-
export { UserContent as UserContent_alias_2 }
|
|
3576
2315
|
|
|
3577
2316
|
declare type WebProvider = {
|
|
3578
2317
|
fetchUrl?: (url: string) => Promise<string>;
|