@polka-codes/core 0.8.28 → 0.9.1

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.
@@ -1,17 +1,24 @@
1
- import type { Anthropic } from '@anthropic-ai/sdk';
2
- import type OpenAI from 'openai';
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
- protected readonly ai: AiServiceBase;
14
+ readonly ai: LanguageModelV2;
8
15
  protected readonly config: Readonly<AgentBaseConfig>;
9
- protected readonly handlers: Record<string, FullToolInfo>;
10
- constructor(name: string, ai: AiServiceBase, config: AgentBaseConfig);
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<MessageParam[]>;
14
- setMessages(messages: Readonly<MessageParam[]>): void;
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
- inputTokens: number;
34
- outputTokens: number;
35
- cacheWriteTokens: number;
36
- cacheReadTokens: number;
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: FullToolInfo[];
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, FullToolInfo>) => AgentPolicyInstance | undefined;
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?: FullToolInfo[];
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 updateKnowledge,
182
- _default_11 as writeToFile,
183
- _default_12 as handOver,
184
- _default_13 as removeFile,
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,22 @@ 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
- }, "strip", z.ZodTypeAny, {
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
- }, "strip", z.ZodTypeAny, {
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
+ location: z.ZodOptional<z.ZodString>;
288
+ project: z.ZodOptional<z.ZodString>;
289
+ keyFile: z.ZodOptional<z.ZodString>;
290
+ }, z.core.$strip>>>;
482
291
  defaultProvider: z.ZodOptional<z.ZodString>;
483
292
  defaultModel: z.ZodOptional<z.ZodString>;
484
293
  defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
294
+ toolFormat: z.ZodOptional<z.ZodEnum<{
295
+ native: "native";
296
+ "polka-codes": "polka-codes";
297
+ }>>;
485
298
  maxMessageCount: z.ZodOptional<z.ZodNumber>;
486
299
  budget: z.ZodOptional<z.ZodNumber>;
487
300
  retryCount: z.ZodOptional<z.ZodNumber>;
@@ -489,279 +302,52 @@ declare const configSchema: z.ZodObject<{
489
302
  scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
490
303
  command: z.ZodString;
491
304
  description: z.ZodString;
492
- }, "strip", z.ZodTypeAny, {
493
- command: string;
494
- description: string;
495
- }, {
496
- command: string;
497
- description: string;
498
- }>]>>>;
499
- agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<z.objectUtil.extendShape<{
305
+ }, z.core.$strip>]>>>;
306
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
500
307
  provider: z.ZodOptional<z.ZodString>;
501
308
  model: z.ZodOptional<z.ZodString>;
502
309
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
503
- }, {
310
+ toolFormat: z.ZodOptional<z.ZodEnum<{
311
+ native: "native";
312
+ "polka-codes": "polka-codes";
313
+ }>>;
504
314
  initialContext: z.ZodOptional<z.ZodObject<{
505
315
  maxFileCount: z.ZodOptional<z.ZodNumber>;
506
- excludes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
507
- }, "strip", z.ZodTypeAny, {
508
- maxFileCount?: number | undefined;
509
- excludes?: string[] | undefined;
510
- }, {
511
- maxFileCount?: number | undefined;
512
- excludes?: string[] | undefined;
513
- }>>;
316
+ excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
317
+ }, z.core.$strip>>;
514
318
  retryCount: z.ZodOptional<z.ZodNumber>;
515
319
  requestTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
516
- }>, "strip", z.ZodTypeAny, {
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
- }>>>;
320
+ }, z.core.$strip>>>;
537
321
  commands: z.ZodOptional<z.ZodObject<{
538
322
  default: z.ZodOptional<z.ZodObject<{
539
323
  provider: z.ZodOptional<z.ZodString>;
540
324
  model: z.ZodOptional<z.ZodString>;
541
325
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
542
- }, "strip", z.ZodTypeAny, {
543
- provider?: string | undefined;
544
- model?: string | undefined;
545
- parameters?: Record<string, any> | undefined;
546
- }, {
547
- provider?: string | undefined;
548
- model?: string | undefined;
549
- parameters?: Record<string, any> | undefined;
550
- }>>;
551
- }, "strip", z.ZodObject<{
326
+ toolFormat: z.ZodOptional<z.ZodEnum<{
327
+ native: "native";
328
+ "polka-codes": "polka-codes";
329
+ }>>;
330
+ }, z.core.$strip>>;
331
+ }, z.core.$catchall<z.ZodObject<{
552
332
  provider: z.ZodOptional<z.ZodString>;
553
333
  model: z.ZodOptional<z.ZodString>;
554
334
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
555
- }, "strip", z.ZodTypeAny, {
556
- provider?: string | undefined;
557
- model?: string | undefined;
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;
335
+ toolFormat: z.ZodOptional<z.ZodEnum<{
336
+ native: "native";
337
+ "polka-codes": "polka-codes";
576
338
  }>>;
577
- }, z.ZodObject<{
578
- provider: z.ZodOptional<z.ZodString>;
579
- model: z.ZodOptional<z.ZodString>;
580
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
581
- }, "strip", z.ZodTypeAny, {
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
- }>;
339
+ }, z.core.$strip>>>>;
340
+ rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodString]>>;
341
+ excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
342
+ policies: z.ZodOptional<z.ZodArray<z.ZodString>>;
343
+ }, z.core.$strict>;
750
344
  export { configSchema }
751
345
  export { configSchema as configSchema_alias_1 }
752
346
 
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
347
  declare const createNewProject: (agent: MultiAgent, params: string) => Promise<string>;
758
348
  export { createNewProject }
759
349
  export { createNewProject as createNewProject_alias_1 }
760
350
 
761
- declare const createService: (provider: AiServiceProvider, options: AiServiceOptions) => AnthropicService | DeepSeekService | OllamaService | OpenRouterService;
762
- export { createService }
763
- export { createService as createService_alias_1 }
764
-
765
351
  declare const customInstructions: (customInstructions: string[]) => string;
766
352
  export { customInstructions }
767
353
  export { customInstructions as customInstructions_alias_1 }
@@ -775,73 +361,16 @@ export { customScripts }
775
361
  export { customScripts as customScripts_alias_1 }
776
362
  export { customScripts as customScripts_alias_2 }
777
363
 
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
364
  declare const _default: {
823
365
  handler: ToolHandler<{
824
366
  readonly name: "ask_followup_question";
825
367
  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
- readonly name: "questions";
828
- readonly description: "One or more follow-up questions you need answered before you can continue.";
829
- readonly required: true;
830
- readonly allowMultiple: true;
831
- readonly usageValue: "questions here";
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
- }];
368
+ readonly parameters: z.ZodObject<{
369
+ questions: z.ZodArray<z.ZodObject<{
370
+ prompt: z.ZodString;
371
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
372
+ }, z.core.$strip>>;
373
+ }, z.core.$strip>;
845
374
  readonly examples: [{
846
375
  readonly description: "Single clarifying question (no options)";
847
376
  readonly parameters: [{
@@ -885,25 +414,12 @@ declare const _default: {
885
414
  isAvailable: (provider: InteractionProvider) => boolean;
886
415
  name: "ask_followup_question";
887
416
  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
- readonly name: "questions";
890
- readonly description: "One or more follow-up questions you need answered before you can continue.";
891
- readonly required: true;
892
- readonly allowMultiple: true;
893
- readonly usageValue: "questions here";
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
- }];
417
+ parameters: z.ZodObject<{
418
+ questions: z.ZodArray<z.ZodObject<{
419
+ prompt: z.ZodString;
420
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
421
+ }, z.core.$strip>>;
422
+ }, z.core.$strip>;
907
423
  examples: [{
908
424
  readonly description: "Single clarifying question (no options)";
909
425
  readonly parameters: [{
@@ -950,150 +466,13 @@ export { _default as askFollowupQuestion_alias_2 }
950
466
  export { _default as default_alias_4 }
951
467
 
952
468
  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
469
  handler: ToolHandler<{
1084
470
  readonly name: "write_to_file";
1085
471
  readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
1086
- readonly parameters: [{
1087
- readonly name: "path";
1088
- readonly description: "The path of the file to write to";
1089
- readonly required: true;
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
- }];
472
+ readonly parameters: z.ZodObject<{
473
+ path: z.ZodString;
474
+ content: z.ZodString;
475
+ }, z.core.$strip>;
1097
476
  readonly examples: [{
1098
477
  readonly description: "Request to write content to a file";
1099
478
  readonly parameters: [{
@@ -1109,17 +488,10 @@ declare const _default_11: {
1109
488
  isAvailable: (provider: FilesystemProvider) => boolean;
1110
489
  name: "write_to_file";
1111
490
  description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
1112
- parameters: [{
1113
- readonly name: "path";
1114
- readonly description: "The path of the file to write to";
1115
- readonly required: true;
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
- }];
491
+ parameters: z.ZodObject<{
492
+ path: z.ZodString;
493
+ content: z.ZodString;
494
+ }, z.core.$strip>;
1123
495
  examples: [{
1124
496
  readonly description: "Request to write content to a file";
1125
497
  readonly parameters: [{
@@ -1132,40 +504,25 @@ declare const _default_11: {
1132
504
  }];
1133
505
  permissionLevel: PermissionLevel.Write;
1134
506
  };
1135
- export { _default_11 as default_alias_17 }
1136
- export { _default_11 as writeToFile }
1137
- export { _default_11 as writeToFile_alias_1 }
1138
- export { _default_11 as writeToFile_alias_2 }
507
+ export { _default_10 as default_alias_16 }
508
+ export { _default_10 as writeToFile }
509
+ export { _default_10 as writeToFile_alias_1 }
510
+ export { _default_10 as writeToFile_alias_2 }
1139
511
 
1140
- declare const _default_12: {
512
+ declare const _default_11: {
1141
513
  handler: ToolHandler<{
1142
514
  readonly name: "hand_over";
1143
515
  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
- readonly name: "agent_name";
1146
- readonly description: "The name of the agent to hand over the task to";
1147
- readonly required: true;
1148
- readonly usageValue: "Name of the target agent";
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
- }];
516
+ readonly parameters: z.ZodObject<{
517
+ agentName: z.ZodString;
518
+ task: z.ZodString;
519
+ context: z.ZodString;
520
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
521
+ }, z.core.$strip>;
1165
522
  readonly examples: [{
1166
523
  readonly description: "Hand over a coding task to the coder agent";
1167
524
  readonly parameters: [{
1168
- readonly name: "agent_name";
525
+ readonly name: "agentName";
1169
526
  readonly value: "coder";
1170
527
  }, {
1171
528
  readonly name: "task";
@@ -1183,31 +540,16 @@ declare const _default_12: {
1183
540
  isAvailable: (_provider: any) => boolean;
1184
541
  name: "hand_over";
1185
542
  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
- readonly name: "agent_name";
1188
- readonly description: "The name of the agent to hand over the task to";
1189
- readonly required: true;
1190
- readonly usageValue: "Name of the target agent";
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
- }];
543
+ parameters: z.ZodObject<{
544
+ agentName: z.ZodString;
545
+ task: z.ZodString;
546
+ context: z.ZodString;
547
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
548
+ }, z.core.$strip>;
1207
549
  examples: [{
1208
550
  readonly description: "Hand over a coding task to the coder agent";
1209
551
  readonly parameters: [{
1210
- readonly name: "agent_name";
552
+ readonly name: "agentName";
1211
553
  readonly value: "coder";
1212
554
  }, {
1213
555
  readonly name: "task";
@@ -1222,21 +564,18 @@ declare const _default_12: {
1222
564
  }];
1223
565
  permissionLevel: PermissionLevel.None;
1224
566
  };
1225
- export { _default_12 as default_alias_9 }
1226
- export { _default_12 as handOver }
1227
- export { _default_12 as handOver_alias_1 }
1228
- export { _default_12 as handOver_alias_2 }
567
+ export { _default_11 as default_alias_9 }
568
+ export { _default_11 as handOver }
569
+ export { _default_11 as handOver_alias_1 }
570
+ export { _default_11 as handOver_alias_2 }
1229
571
 
1230
- declare const _default_13: {
572
+ declare const _default_12: {
1231
573
  handler: ToolHandler<{
1232
574
  readonly name: "remove_file";
1233
575
  readonly description: "Request to remove a file at the specified path.";
1234
- readonly parameters: [{
1235
- readonly name: "path";
1236
- readonly description: "The path of the file to remove";
1237
- readonly required: true;
1238
- readonly usageValue: "File path here";
1239
- }];
576
+ readonly parameters: z.ZodObject<{
577
+ path: z.ZodString;
578
+ }, z.core.$strip>;
1240
579
  readonly examples: [{
1241
580
  readonly description: "Request to remove a file";
1242
581
  readonly parameters: [{
@@ -1249,12 +588,9 @@ declare const _default_13: {
1249
588
  isAvailable: (provider: FilesystemProvider) => boolean;
1250
589
  name: "remove_file";
1251
590
  description: "Request to remove a file at the specified path.";
1252
- parameters: [{
1253
- readonly name: "path";
1254
- readonly description: "The path of the file to remove";
1255
- readonly required: true;
1256
- readonly usageValue: "File path here";
1257
- }];
591
+ parameters: z.ZodObject<{
592
+ path: z.ZodString;
593
+ }, z.core.$strip>;
1258
594
  examples: [{
1259
595
  readonly description: "Request to remove a file";
1260
596
  readonly parameters: [{
@@ -1264,26 +600,19 @@ declare const _default_13: {
1264
600
  }];
1265
601
  permissionLevel: PermissionLevel.Write;
1266
602
  };
1267
- export { _default_13 as default_alias_12 }
1268
- export { _default_13 as removeFile }
1269
- export { _default_13 as removeFile_alias_1 }
1270
- export { _default_13 as removeFile_alias_2 }
603
+ export { _default_12 as default_alias_12 }
604
+ export { _default_12 as removeFile }
605
+ export { _default_12 as removeFile_alias_1 }
606
+ export { _default_12 as removeFile_alias_2 }
1271
607
 
1272
- declare const _default_14: {
608
+ declare const _default_13: {
1273
609
  handler: ToolHandler<{
1274
610
  readonly name: "rename_file";
1275
611
  readonly description: "Request to rename a file from source path to target path.";
1276
- readonly parameters: [{
1277
- readonly name: "source_path";
1278
- readonly description: "The current path of the file";
1279
- readonly required: true;
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
- }];
612
+ readonly parameters: z.ZodObject<{
613
+ source_path: z.ZodString;
614
+ target_path: z.ZodString;
615
+ }, z.core.$strip>;
1287
616
  readonly examples: [{
1288
617
  readonly description: "Request to rename a file";
1289
618
  readonly parameters: [{
@@ -1299,17 +628,10 @@ declare const _default_14: {
1299
628
  isAvailable: (provider: FilesystemProvider) => boolean;
1300
629
  name: "rename_file";
1301
630
  description: "Request to rename a file from source path to target path.";
1302
- parameters: [{
1303
- readonly name: "source_path";
1304
- readonly description: "The current path of the file";
1305
- readonly required: true;
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
- }];
631
+ parameters: z.ZodObject<{
632
+ source_path: z.ZodString;
633
+ target_path: z.ZodString;
634
+ }, z.core.$strip>;
1313
635
  examples: [{
1314
636
  readonly description: "Request to rename a file";
1315
637
  readonly parameters: [{
@@ -1322,21 +644,18 @@ declare const _default_14: {
1322
644
  }];
1323
645
  permissionLevel: PermissionLevel.Write;
1324
646
  };
1325
- export { _default_14 as default_alias_13 }
1326
- export { _default_14 as renameFile }
1327
- export { _default_14 as renameFile_alias_1 }
1328
- export { _default_14 as renameFile_alias_2 }
647
+ export { _default_13 as default_alias_13 }
648
+ export { _default_13 as renameFile }
649
+ export { _default_13 as renameFile_alias_1 }
650
+ export { _default_13 as renameFile_alias_2 }
1329
651
 
1330
652
  declare const _default_2: {
1331
653
  handler: ToolHandler<{
1332
654
  readonly name: "attempt_completion";
1333
655
  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
- readonly name: "result";
1336
- readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
1337
- readonly required: true;
1338
- readonly usageValue: "Your final result description here";
1339
- }];
656
+ readonly parameters: z.ZodObject<{
657
+ result: z.ZodString;
658
+ }, z.core.$strip>;
1340
659
  readonly examples: [{
1341
660
  readonly description: "Request to present the result of the task";
1342
661
  readonly parameters: [{
@@ -1349,12 +668,9 @@ declare const _default_2: {
1349
668
  isAvailable: (provider: InteractionProvider) => boolean;
1350
669
  name: "attempt_completion";
1351
670
  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
- readonly name: "result";
1354
- readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
1355
- readonly required: true;
1356
- readonly usageValue: "Your final result description here";
1357
- }];
671
+ parameters: z.ZodObject<{
672
+ result: z.ZodString;
673
+ }, z.core.$strip>;
1358
674
  examples: [{
1359
675
  readonly description: "Request to present the result of the task";
1360
676
  readonly parameters: [{
@@ -1373,31 +689,16 @@ declare const _default_3: {
1373
689
  handler: ToolHandler<{
1374
690
  readonly name: "delegate";
1375
691
  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
- readonly name: "agent_name";
1378
- readonly description: "The name of the agent to delegate the task to";
1379
- readonly required: true;
1380
- readonly usageValue: "Name of the target agent";
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
- }];
692
+ readonly parameters: z.ZodObject<{
693
+ agentName: z.ZodString;
694
+ task: z.ZodString;
695
+ context: z.ZodString;
696
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
697
+ }, z.core.$strip>;
1397
698
  readonly examples: [{
1398
699
  readonly description: "Delegate a code analysis task to the analyzer agent";
1399
700
  readonly parameters: [{
1400
- readonly name: "agent_name";
701
+ readonly name: "agentName";
1401
702
  readonly value: "analyzer";
1402
703
  }, {
1403
704
  readonly name: "task";
@@ -1415,31 +716,16 @@ declare const _default_3: {
1415
716
  isAvailable: (_provider: any) => boolean;
1416
717
  name: "delegate";
1417
718
  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
- readonly name: "agent_name";
1420
- readonly description: "The name of the agent to delegate the task to";
1421
- readonly required: true;
1422
- readonly usageValue: "Name of the target agent";
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
- }];
719
+ parameters: z.ZodObject<{
720
+ agentName: z.ZodString;
721
+ task: z.ZodString;
722
+ context: z.ZodString;
723
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
724
+ }, z.core.$strip>;
1439
725
  examples: [{
1440
726
  readonly description: "Delegate a code analysis task to the analyzer agent";
1441
727
  readonly parameters: [{
1442
- readonly name: "agent_name";
728
+ readonly name: "agentName";
1443
729
  readonly value: "analyzer";
1444
730
  }, {
1445
731
  readonly name: "task";
@@ -1463,24 +749,17 @@ declare const _default_4: {
1463
749
  handler: ToolHandler<{
1464
750
  readonly name: "execute_command";
1465
751
  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
- readonly name: "command";
1468
- readonly description: "The exact command to run (valid for the current OS). It must be correctly formatted and free of harmful instructions.";
1469
- readonly required: true;
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
- }];
752
+ readonly parameters: z.ZodObject<{
753
+ command: z.ZodString;
754
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
755
+ }, z.core.$strip>;
1477
756
  readonly examples: [{
1478
757
  readonly description: "Make a build";
1479
758
  readonly parameters: [{
1480
759
  readonly name: "command";
1481
760
  readonly value: "npm run build";
1482
761
  }, {
1483
- readonly name: "requires_approval";
762
+ readonly name: "requiresApproval";
1484
763
  readonly value: "false";
1485
764
  }];
1486
765
  }];
@@ -1489,24 +768,17 @@ declare const _default_4: {
1489
768
  isAvailable: (provider: CommandProvider) => boolean;
1490
769
  name: "execute_command";
1491
770
  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
- readonly name: "command";
1494
- readonly description: "The exact command to run (valid for the current OS). It must be correctly formatted and free of harmful instructions.";
1495
- readonly required: true;
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
- }];
771
+ parameters: z.ZodObject<{
772
+ command: z.ZodString;
773
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
774
+ }, z.core.$strip>;
1503
775
  examples: [{
1504
776
  readonly description: "Make a build";
1505
777
  readonly parameters: [{
1506
778
  readonly name: "command";
1507
779
  readonly value: "npm run build";
1508
780
  }, {
1509
- readonly name: "requires_approval";
781
+ readonly name: "requiresApproval";
1510
782
  readonly value: "false";
1511
783
  }];
1512
784
  }];
@@ -1521,11 +793,9 @@ declare const _default_5: {
1521
793
  handler: ToolHandler<{
1522
794
  readonly name: "fetch_url";
1523
795
  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
- readonly name: "url";
1526
- readonly description: "One or more URLs to fetch, separated by commas if multiple.";
1527
- readonly required: true;
1528
- }];
796
+ readonly parameters: z.ZodObject<{
797
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
798
+ }, z.core.$strip>;
1529
799
  readonly examples: [{
1530
800
  readonly description: "Fetch a single webpage";
1531
801
  readonly parameters: [{
@@ -1550,11 +820,9 @@ declare const _default_5: {
1550
820
  isAvailable: (provider: WebProvider) => boolean;
1551
821
  name: "fetch_url";
1552
822
  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
- readonly name: "url";
1555
- readonly description: "One or more URLs to fetch, separated by commas if multiple.";
1556
- readonly required: true;
1557
- }];
823
+ parameters: z.ZodObject<{
824
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
825
+ }, z.core.$strip>;
1558
826
  examples: [{
1559
827
  readonly description: "Fetch a single webpage";
1560
828
  readonly parameters: [{
@@ -1585,29 +853,18 @@ declare const _default_6: {
1585
853
  handler: ToolHandler<{
1586
854
  readonly name: "list_files";
1587
855
  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
- readonly name: "path";
1590
- readonly description: "The path of the directory to list contents for (relative to the current working directory)";
1591
- readonly required: true;
1592
- readonly usageValue: "Directory path here";
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
- }];
856
+ readonly parameters: z.ZodObject<{
857
+ path: z.ZodString;
858
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
859
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
860
+ }, z.core.$strip>;
1604
861
  readonly examples: [{
1605
862
  readonly description: "Request to list files";
1606
863
  readonly parameters: [{
1607
864
  readonly name: "path";
1608
865
  readonly value: "src";
1609
866
  }, {
1610
- readonly name: "max_count";
867
+ readonly name: "maxCount";
1611
868
  readonly value: "100";
1612
869
  }];
1613
870
  }];
@@ -1616,29 +873,18 @@ declare const _default_6: {
1616
873
  isAvailable: (provider: FilesystemProvider) => boolean;
1617
874
  name: "list_files";
1618
875
  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
- readonly name: "path";
1621
- readonly description: "The path of the directory to list contents for (relative to the current working directory)";
1622
- readonly required: true;
1623
- readonly usageValue: "Directory path here";
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
- }];
876
+ parameters: z.ZodObject<{
877
+ path: z.ZodString;
878
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
879
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
880
+ }, z.core.$strip>;
1635
881
  examples: [{
1636
882
  readonly description: "Request to list files";
1637
883
  readonly parameters: [{
1638
884
  readonly name: "path";
1639
885
  readonly value: "src";
1640
886
  }, {
1641
- readonly name: "max_count";
887
+ readonly name: "maxCount";
1642
888
  readonly value: "100";
1643
889
  }];
1644
890
  }];
@@ -1653,12 +899,9 @@ declare const _default_7: {
1653
899
  handler: ToolHandler<{
1654
900
  readonly name: "read_file";
1655
901
  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
- readonly name: "path";
1658
- readonly description: "The path of the file to read";
1659
- readonly required: true;
1660
- readonly usageValue: "Comma separated paths here";
1661
- }];
902
+ readonly parameters: z.ZodObject<{
903
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
904
+ }, z.core.$strip>;
1662
905
  readonly examples: [{
1663
906
  readonly description: "Request to read the contents of a file";
1664
907
  readonly parameters: [{
@@ -1677,12 +920,9 @@ declare const _default_7: {
1677
920
  isAvailable: (provider: FilesystemProvider) => boolean;
1678
921
  name: "read_file";
1679
922
  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
- readonly name: "path";
1682
- readonly description: "The path of the file to read";
1683
- readonly required: true;
1684
- readonly usageValue: "Comma separated paths here";
1685
- }];
923
+ parameters: z.ZodObject<{
924
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
925
+ }, z.core.$strip>;
1686
926
  examples: [{
1687
927
  readonly description: "Request to read the contents of a file";
1688
928
  readonly parameters: [{
@@ -1707,17 +947,10 @@ declare const _default_8: {
1707
947
  handler: ToolHandler<{
1708
948
  readonly name: "replace_in_file";
1709
949
  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
- readonly name: "path";
1712
- readonly description: "The path of the file to modify";
1713
- readonly required: true;
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
- }];
950
+ readonly parameters: z.ZodObject<{
951
+ path: z.ZodString;
952
+ diff: z.ZodString;
953
+ }, z.core.$strip>;
1721
954
  readonly examples: [{
1722
955
  readonly description: "Request to replace sections of content in a file";
1723
956
  readonly parameters: [{
@@ -1725,7 +958,7 @@ declare const _default_8: {
1725
958
  readonly value: "src/main.js";
1726
959
  }, {
1727
960
  readonly name: "diff";
1728
- readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
961
+ 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
962
  }];
1730
963
  }, {
1731
964
  readonly description: "Request to perform a simple, single-line replacement";
@@ -1734,7 +967,7 @@ declare const _default_8: {
1734
967
  readonly value: "src/config.js";
1735
968
  }, {
1736
969
  readonly name: "diff";
1737
- readonly value: "\n<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE\n";
970
+ readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
1738
971
  }];
1739
972
  }, {
1740
973
  readonly description: "Request to add a new function to a file";
@@ -1743,7 +976,7 @@ declare const _default_8: {
1743
976
  readonly value: "src/utils.js";
1744
977
  }, {
1745
978
  readonly name: "diff";
1746
- readonly value: "\n<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE\n";
979
+ readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
1747
980
  }];
1748
981
  }, {
1749
982
  readonly description: "Request to delete a block of code from a file";
@@ -1752,7 +985,7 @@ declare const _default_8: {
1752
985
  readonly value: "src/app.js";
1753
986
  }, {
1754
987
  readonly name: "diff";
1755
- readonly value: "\n<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE\n";
988
+ readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
1756
989
  }];
1757
990
  }];
1758
991
  readonly permissionLevel: PermissionLevel.Write;
@@ -1760,17 +993,10 @@ declare const _default_8: {
1760
993
  isAvailable: (provider: FilesystemProvider) => boolean;
1761
994
  name: "replace_in_file";
1762
995
  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
- readonly name: "path";
1765
- readonly description: "The path of the file to modify";
1766
- readonly required: true;
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
- }];
996
+ parameters: z.ZodObject<{
997
+ path: z.ZodString;
998
+ diff: z.ZodString;
999
+ }, z.core.$strip>;
1774
1000
  examples: [{
1775
1001
  readonly description: "Request to replace sections of content in a file";
1776
1002
  readonly parameters: [{
@@ -1778,7 +1004,7 @@ declare const _default_8: {
1778
1004
  readonly value: "src/main.js";
1779
1005
  }, {
1780
1006
  readonly name: "diff";
1781
- readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
1007
+ 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
1008
  }];
1783
1009
  }, {
1784
1010
  readonly description: "Request to perform a simple, single-line replacement";
@@ -1787,7 +1013,7 @@ declare const _default_8: {
1787
1013
  readonly value: "src/config.js";
1788
1014
  }, {
1789
1015
  readonly name: "diff";
1790
- readonly value: "\n<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE\n";
1016
+ readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
1791
1017
  }];
1792
1018
  }, {
1793
1019
  readonly description: "Request to add a new function to a file";
@@ -1796,7 +1022,7 @@ declare const _default_8: {
1796
1022
  readonly value: "src/utils.js";
1797
1023
  }, {
1798
1024
  readonly name: "diff";
1799
- readonly value: "\n<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE\n";
1025
+ readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
1800
1026
  }];
1801
1027
  }, {
1802
1028
  readonly description: "Request to delete a block of code from a file";
@@ -1805,7 +1031,7 @@ declare const _default_8: {
1805
1031
  readonly value: "src/app.js";
1806
1032
  }, {
1807
1033
  readonly name: "diff";
1808
- readonly value: "\n<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE\n";
1034
+ readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
1809
1035
  }];
1810
1036
  }];
1811
1037
  permissionLevel: PermissionLevel.Write;
@@ -1819,22 +1045,11 @@ declare const _default_9: {
1819
1045
  handler: ToolHandler<{
1820
1046
  readonly name: "search_files";
1821
1047
  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
- readonly name: "path";
1824
- readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
1825
- readonly required: true;
1826
- readonly usageValue: "Directory path here";
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
- }];
1048
+ readonly parameters: z.ZodObject<{
1049
+ path: z.ZodString;
1050
+ regex: z.ZodString;
1051
+ filePattern: z.ZodOptional<z.ZodString>;
1052
+ }, z.core.$strip>;
1838
1053
  readonly examples: [{
1839
1054
  readonly description: "Request to perform a regex search across files";
1840
1055
  readonly parameters: [{
@@ -1844,7 +1059,7 @@ declare const _default_9: {
1844
1059
  readonly name: "regex";
1845
1060
  readonly value: "^components/";
1846
1061
  }, {
1847
- readonly name: "file_pattern";
1062
+ readonly name: "filePattern";
1848
1063
  readonly value: "*.ts,*.tsx";
1849
1064
  }];
1850
1065
  }];
@@ -1853,22 +1068,11 @@ declare const _default_9: {
1853
1068
  isAvailable: (provider: FilesystemProvider) => boolean;
1854
1069
  name: "search_files";
1855
1070
  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
- readonly name: "path";
1858
- readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
1859
- readonly required: true;
1860
- readonly usageValue: "Directory path here";
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
- }];
1071
+ parameters: z.ZodObject<{
1072
+ path: z.ZodString;
1073
+ regex: z.ZodString;
1074
+ filePattern: z.ZodOptional<z.ZodString>;
1075
+ }, z.core.$strip>;
1872
1076
  examples: [{
1873
1077
  readonly description: "Request to perform a regex search across files";
1874
1078
  readonly parameters: [{
@@ -1878,7 +1082,7 @@ declare const _default_9: {
1878
1082
  readonly name: "regex";
1879
1083
  readonly value: "^components/";
1880
1084
  }, {
1881
- readonly name: "file_pattern";
1085
+ readonly name: "filePattern";
1882
1086
  readonly value: "*.ts,*.tsx";
1883
1087
  }];
1884
1088
  }];
@@ -1934,15 +1138,6 @@ export declare const default_alias_3: {
1934
1138
  readonly agent: "analyzer";
1935
1139
  };
1936
1140
 
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
1141
  /**
1947
1142
  * Returns the directory portion of a path string.
1948
1143
  * Strips trailing slashes, then takes everything up to the last slash.
@@ -1951,14 +1146,17 @@ export declare function dirname(path: string): string;
1951
1146
 
1952
1147
  export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
1953
1148
 
1149
+ declare const EnableCachePolicy: AgentPolicy;
1150
+ export { EnableCachePolicy }
1151
+ export { EnableCachePolicy as EnableCachePolicy_alias_1 }
1152
+ export { EnableCachePolicy as EnableCachePolicy_alias_2 }
1153
+ export { EnableCachePolicy as EnableCachePolicy_alias_3 }
1154
+
1954
1155
  declare const executeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
1955
1156
  export { executeAgentTool }
1956
1157
  export { executeAgentTool as executeAgentTool_alias_1 }
1957
1158
 
1958
- declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: AiServiceBase, params: GetInput<T>) => Promise<{
1959
- response: GetOutput<T>;
1960
- usage: ApiUsage;
1961
- }>;
1159
+ declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
1962
1160
  export { executeTool }
1963
1161
  export { executeTool as executeTool_alias_1 }
1964
1162
 
@@ -1993,28 +1191,28 @@ export declare const fullSystemPrompt: (info: {
1993
1191
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1994
1192
  command: string;
1995
1193
  description: string;
1996
- }>) => string;
1194
+ }>, useNativeTool: boolean) => string;
1997
1195
 
1998
1196
  export declare const fullSystemPrompt_alias_1: (info: {
1999
1197
  os: string;
2000
1198
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
2001
1199
  command: string;
2002
1200
  description: string;
2003
- }>) => string;
1201
+ }>, useNativeTool: boolean) => string;
2004
1202
 
2005
1203
  export declare const fullSystemPrompt_alias_2: (info: {
2006
1204
  os: string;
2007
1205
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
2008
1206
  command: string;
2009
1207
  description: string;
2010
- }>, interactive: boolean) => string;
1208
+ }>, interactive: boolean, useNativeTool: boolean) => string;
2011
1209
 
2012
1210
  export declare const fullSystemPrompt_alias_3: (info: {
2013
1211
  os: string;
2014
1212
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
2015
1213
  command: string;
2016
1214
  description: string;
2017
- }>) => string;
1215
+ }>, useNativeTool: boolean) => string;
2018
1216
 
2019
1217
  declare type FullToolInfo = ToolInfo & {
2020
1218
  handler: ToolHandler<ToolInfo, any>;
@@ -2023,27 +1221,28 @@ declare type FullToolInfo = ToolInfo & {
2023
1221
  export { FullToolInfo }
2024
1222
  export { FullToolInfo as FullToolInfo_alias_1 }
2025
1223
 
2026
- declare const generateGitCommitMessage: (ai: AiServiceBase, params: {
1224
+ declare type FullToolInfoV2 = ToolInfoV2 & {
1225
+ handler: ToolHandler<ToolInfoV2, any>;
1226
+ isAvailable: (provider: any) => boolean;
1227
+ };
1228
+ export { FullToolInfoV2 }
1229
+ export { FullToolInfoV2 as FullToolInfoV2_alias_1 }
1230
+
1231
+ declare const generateGitCommitMessage: (ai: LanguageModelV2, params: {
2027
1232
  diff: string;
2028
1233
  context?: string;
2029
- }) => Promise<{
2030
- response: string;
2031
- usage: ApiUsage;
2032
- }>;
1234
+ }, usageMeter: UsageMeter) => Promise<string>;
2033
1235
  export { generateGitCommitMessage }
2034
1236
  export { generateGitCommitMessage as generateGitCommitMessage_alias_1 }
2035
1237
 
2036
- declare const generateGithubPullRequestDetails: (ai: AiServiceBase, params: {
1238
+ declare const generateGithubPullRequestDetails: (ai: LanguageModelV2, params: {
2037
1239
  commitMessages: string;
2038
1240
  commitDiff: string;
2039
1241
  context?: string;
2040
1242
  branchName: string;
2041
- }) => Promise<{
2042
- response: {
2043
- title: string;
2044
- description: string;
2045
- };
2046
- usage: ApiUsage;
1243
+ }, usageMeter: UsageMeter) => Promise<{
1244
+ title: string;
1245
+ description: string;
2047
1246
  }>;
2048
1247
  export { generateGithubPullRequestDetails }
2049
1248
  export { generateGithubPullRequestDetails as generateGithubPullRequestDetails_alias_1 }
@@ -2052,10 +1251,7 @@ declare const generateProjectConfig: (agent: MultiAgent, params: unknown) => Pro
2052
1251
  export { generateProjectConfig }
2053
1252
  export { generateProjectConfig as generateProjectConfig_alias_1 }
2054
1253
 
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 }
1254
+ export declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
2059
1255
 
2060
1256
  /**
2061
1257
  * Get the available tools based on the provider and agent availability
@@ -2066,45 +1262,33 @@ export { getArray as getArray_alias_2 }
2066
1262
  * @param interactive Determines whether the `askFollowupQuestion` tool is available.
2067
1263
  * @returns The available tools
2068
1264
  */
2069
- declare const getAvailableTools: ({ provider, allTools, hasAgent, permissionLevel, interactive, }: {
1265
+ declare const getAvailableTools: <T extends FullToolInfoV2 | FullToolInfo>({ provider, allTools, hasAgent, permissionLevel, interactive, }: {
2070
1266
  provider: any;
2071
- allTools: FullToolInfo[];
1267
+ allTools: T[];
2072
1268
  hasAgent: boolean;
2073
1269
  permissionLevel: PermissionLevel;
2074
1270
  interactive: boolean;
2075
- }) => FullToolInfo[];
1271
+ }) => T[];
2076
1272
  export { getAvailableTools }
2077
1273
  export { getAvailableTools as getAvailableTools_alias_1 }
2078
1274
 
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 }
1275
+ export declare const getBoolean: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: boolean) => boolean;
2083
1276
 
2084
1277
  declare type GetInput<T> = T extends AiToolDefinition<infer Input, any> ? Input : never;
2085
1278
  export { GetInput }
2086
1279
  export { GetInput as GetInput_alias_1 }
2087
1280
  export { GetInput as GetInput_alias_2 }
2088
1281
 
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 }
1282
+ export declare const getInt: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: number) => number;
2093
1283
 
2094
1284
  declare type GetOutput<T> = T extends AiToolDefinition<any, infer Output> ? Output : never;
2095
1285
  export { GetOutput }
2096
1286
  export { GetOutput as GetOutput_alias_1 }
2097
1287
  export { GetOutput as GetOutput_alias_2 }
2098
1288
 
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 }
1289
+ export declare const getString: <T extends string>(args: Partial<Record<T, string>> | ToolParameterValue, name: T, defaultValue?: string) => string;
2103
1290
 
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 }
1291
+ export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
2108
1292
 
2109
1293
  export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
2110
1294
 
@@ -2116,8 +1300,6 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
2116
1300
 
2117
1301
  export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
2118
1302
 
2119
- export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
2120
-
2121
1303
  export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
2122
1304
 
2123
1305
  export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
@@ -2134,8 +1316,6 @@ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, Files
2134
1316
 
2135
1317
  export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
2136
1318
 
2137
- export declare type ImageBlockParam = Anthropic.Messages.ImageBlockParam;
2138
-
2139
1319
  declare type Input = {
2140
1320
  commitMessages: string;
2141
1321
  commitDiff: string;
@@ -2161,8 +1341,6 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
2161
1341
 
2162
1342
  export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
2163
1343
 
2164
- export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
2165
-
2166
1344
  export declare const isAvailable_alias_2: (_provider: any) => boolean;
2167
1345
 
2168
1346
  export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
@@ -2184,166 +1362,14 @@ export declare const isAvailable_alias_9: (provider: FilesystemProvider) => bool
2184
1362
  */
2185
1363
  export declare function join(...parts: string[]): string;
2186
1364
 
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
1365
  declare const makeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
2332
1366
  export { makeAgentTool }
2333
1367
  export { makeAgentTool as makeAgentTool_alias_1 }
2334
1368
 
2335
- declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: AiServiceBase, params: GetInput<T>) => Promise<{
2336
- response: GetOutput<T>;
2337
- usage: ApiUsage;
2338
- }>;
1369
+ declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
2339
1370
  export { makeTool }
2340
1371
  export { makeTool as makeTool_alias_1 }
2341
1372
 
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
1373
  declare class MockProvider implements ToolProvider {
2348
1374
  readFile(path: string): Promise<string>;
2349
1375
  writeFile(path: string, content: string): Promise<void>;
@@ -2363,127 +1389,14 @@ export { MockProvider }
2363
1389
  export { MockProvider as MockProvider_alias_1 }
2364
1390
  export { MockProvider as MockProvider_alias_2 }
2365
1391
 
2366
- declare interface ModelInfo {
2367
- maxTokens?: number;
2368
- contextWindow?: number;
2369
- supportsImages?: boolean;
2370
- supportsComputerUse?: boolean;
2371
- supportsPromptCache?: boolean;
2372
- inputPrice?: number;
2373
- outputPrice?: number;
2374
- cacheWritesPrice?: number;
2375
- cacheReadsPrice?: number;
2376
- reasoning?: boolean;
2377
- }
1392
+ declare type ModelInfo = {
1393
+ inputPrice: number;
1394
+ outputPrice: number;
1395
+ cacheWritesPrice: number;
1396
+ cacheReadsPrice: number;
1397
+ };
2378
1398
  export { ModelInfo }
2379
1399
  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
1400
 
2488
1401
  declare class MultiAgent {
2489
1402
  #private;
@@ -2511,39 +1424,6 @@ export { MultiAgentConfig as MultiAgentConfig_alias_2 }
2511
1424
 
2512
1425
  export declare const objectives: (toolNamePrefix: string) => string;
2513
1426
 
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
1427
  declare type Output = {
2548
1428
  title: string;
2549
1429
  description: string;
@@ -2625,8 +1505,8 @@ export { PermissionLevel }
2625
1505
  export { PermissionLevel as PermissionLevel_alias_1 }
2626
1506
 
2627
1507
  declare enum Policies {
2628
- KnowledgeManagement = "knowledgemanagement",
2629
- TruncateContext = "truncatecontext"
1508
+ TruncateContext = "truncatecontext",
1509
+ EnableCache = "enablecache"
2630
1510
  }
2631
1511
  export { Policies }
2632
1512
  export { Policies as Policies_alias_1 }
@@ -2648,7 +1528,7 @@ export { ReplaceResult as ReplaceResult_alias_1 }
2648
1528
  declare const responsePrompts: {
2649
1529
  readonly errorInvokeTool: (tool: string, error: unknown) => string;
2650
1530
  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: UserContent) => (TextBlockParam | ImageBlockParam)[];
1531
+ readonly toolResults: (tool: string, result: UserContent_2) => Array<TextPart | ImagePart | FilePart>;
2652
1532
  readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
2653
1533
  };
2654
1534
  export { responsePrompts }
@@ -2660,11 +1540,11 @@ export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before
2660
1540
  export declare const rules: (toolNamePrefix: string) => string;
2661
1541
 
2662
1542
  declare type SharedAgentOptions = {
2663
- ai: AiServiceBase;
1543
+ ai: LanguageModelV2;
2664
1544
  os: string;
2665
1545
  provider: ToolProvider;
2666
1546
  interactive: boolean;
2667
- additionalTools?: FullToolInfo[];
1547
+ additionalTools?: FullToolInfoV2[];
2668
1548
  customInstructions?: string[];
2669
1549
  scripts?: Record<string, string | {
2670
1550
  command: string;
@@ -2675,6 +1555,9 @@ declare type SharedAgentOptions = {
2675
1555
  policies: AgentPolicy[];
2676
1556
  retryCount?: number;
2677
1557
  requestTimeoutSeconds?: number;
1558
+ toolFormat: ToolFormat;
1559
+ parameters?: Record<string, any>;
1560
+ usageMeter?: UsageMeter;
2678
1561
  };
2679
1562
  export { SharedAgentOptions }
2680
1563
  export { SharedAgentOptions as SharedAgentOptions_alias_1 }
@@ -2846,8 +1729,6 @@ export { TaskEventUsageExceeded }
2846
1729
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
2847
1730
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
2848
1731
 
2849
- export declare type TextBlockParam = Anthropic.Messages.TextBlockParam;
2850
-
2851
1732
  declare interface TextContent {
2852
1733
  type: 'text';
2853
1734
  content: string;
@@ -2866,7 +1747,11 @@ declare type ToolExample = {
2866
1747
  export { ToolExample }
2867
1748
  export { ToolExample as ToolExample_alias_1 }
2868
1749
 
2869
- declare type ToolHandler<T extends ToolInfo, P> = (provider: P, args: Partial<Record<T['parameters'][number]['name'], ToolParameterValue>>) => Promise<ToolResponse>;
1750
+ declare type ToolFormat = 'native' | 'polka-codes';
1751
+ export { ToolFormat }
1752
+ export { ToolFormat as ToolFormat_alias_1 }
1753
+
1754
+ declare type ToolHandler<T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
2870
1755
  export { ToolHandler }
2871
1756
  export { ToolHandler as ToolHandler_alias_1 }
2872
1757
 
@@ -2883,25 +1768,12 @@ export { ToolInfo as ToolInfo_alias_1 }
2883
1768
  export declare const toolInfo: {
2884
1769
  readonly name: "ask_followup_question";
2885
1770
  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
- readonly name: "questions";
2888
- readonly description: "One or more follow-up questions you need answered before you can continue.";
2889
- readonly required: true;
2890
- readonly allowMultiple: true;
2891
- readonly usageValue: "questions here";
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
- }];
1771
+ readonly parameters: z.ZodObject<{
1772
+ questions: z.ZodArray<z.ZodObject<{
1773
+ prompt: z.ZodString;
1774
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
1775
+ }, z.core.$strip>>;
1776
+ }, z.core.$strip>;
2905
1777
  readonly examples: [{
2906
1778
  readonly description: "Single clarifying question (no options)";
2907
1779
  readonly parameters: [{
@@ -2946,12 +1818,9 @@ export declare const toolInfo: {
2946
1818
  export declare const toolInfo_alias_1: {
2947
1819
  readonly name: "attempt_completion";
2948
1820
  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
- readonly name: "result";
2951
- readonly description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.";
2952
- readonly required: true;
2953
- readonly usageValue: "Your final result description here";
2954
- }];
1821
+ readonly parameters: z.ZodObject<{
1822
+ result: z.ZodString;
1823
+ }, z.core.$strip>;
2955
1824
  readonly examples: [{
2956
1825
  readonly description: "Request to present the result of the task";
2957
1826
  readonly parameters: [{
@@ -2965,17 +1834,10 @@ export declare const toolInfo_alias_1: {
2965
1834
  export declare const toolInfo_alias_10: {
2966
1835
  readonly name: "replace_in_file";
2967
1836
  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
- readonly name: "path";
2970
- readonly description: "The path of the file to modify";
2971
- readonly required: true;
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
- }];
1837
+ readonly parameters: z.ZodObject<{
1838
+ path: z.ZodString;
1839
+ diff: z.ZodString;
1840
+ }, z.core.$strip>;
2979
1841
  readonly examples: [{
2980
1842
  readonly description: "Request to replace sections of content in a file";
2981
1843
  readonly parameters: [{
@@ -2983,7 +1845,7 @@ export declare const toolInfo_alias_10: {
2983
1845
  readonly value: "src/main.js";
2984
1846
  }, {
2985
1847
  readonly name: "diff";
2986
- readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
1848
+ 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
1849
  }];
2988
1850
  }, {
2989
1851
  readonly description: "Request to perform a simple, single-line replacement";
@@ -2992,7 +1854,7 @@ export declare const toolInfo_alias_10: {
2992
1854
  readonly value: "src/config.js";
2993
1855
  }, {
2994
1856
  readonly name: "diff";
2995
- readonly value: "\n<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE\n";
1857
+ readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
2996
1858
  }];
2997
1859
  }, {
2998
1860
  readonly description: "Request to add a new function to a file";
@@ -3001,7 +1863,7 @@ export declare const toolInfo_alias_10: {
3001
1863
  readonly value: "src/utils.js";
3002
1864
  }, {
3003
1865
  readonly name: "diff";
3004
- readonly value: "\n<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE\n";
1866
+ readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
3005
1867
  }];
3006
1868
  }, {
3007
1869
  readonly description: "Request to delete a block of code from a file";
@@ -3010,7 +1872,7 @@ export declare const toolInfo_alias_10: {
3010
1872
  readonly value: "src/app.js";
3011
1873
  }, {
3012
1874
  readonly name: "diff";
3013
- readonly value: "\n<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE\n";
1875
+ readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
3014
1876
  }];
3015
1877
  }];
3016
1878
  readonly permissionLevel: PermissionLevel.Write;
@@ -3019,22 +1881,11 @@ export declare const toolInfo_alias_10: {
3019
1881
  export declare const toolInfo_alias_11: {
3020
1882
  readonly name: "search_files";
3021
1883
  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
- readonly name: "path";
3024
- readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
3025
- readonly required: true;
3026
- readonly usageValue: "Directory path here";
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
- }];
1884
+ readonly parameters: z.ZodObject<{
1885
+ path: z.ZodString;
1886
+ regex: z.ZodString;
1887
+ filePattern: z.ZodOptional<z.ZodString>;
1888
+ }, z.core.$strip>;
3038
1889
  readonly examples: [{
3039
1890
  readonly description: "Request to perform a regex search across files";
3040
1891
  readonly parameters: [{
@@ -3044,7 +1895,7 @@ export declare const toolInfo_alias_11: {
3044
1895
  readonly name: "regex";
3045
1896
  readonly value: "^components/";
3046
1897
  }, {
3047
- readonly name: "file_pattern";
1898
+ readonly name: "filePattern";
3048
1899
  readonly value: "*.ts,*.tsx";
3049
1900
  }];
3050
1901
  }];
@@ -3052,82 +1903,12 @@ export declare const toolInfo_alias_11: {
3052
1903
  };
3053
1904
 
3054
1905
  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
1906
  readonly name: "write_to_file";
3119
1907
  readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
3120
- readonly parameters: [{
3121
- readonly name: "path";
3122
- readonly description: "The path of the file to write to";
3123
- readonly required: true;
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
- }];
1908
+ readonly parameters: z.ZodObject<{
1909
+ path: z.ZodString;
1910
+ content: z.ZodString;
1911
+ }, z.core.$strip>;
3131
1912
  readonly examples: [{
3132
1913
  readonly description: "Request to write content to a file";
3133
1914
  readonly parameters: [{
@@ -3144,31 +1925,16 @@ export declare const toolInfo_alias_13: {
3144
1925
  export declare const toolInfo_alias_2: {
3145
1926
  readonly name: "delegate";
3146
1927
  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
- readonly name: "agent_name";
3149
- readonly description: "The name of the agent to delegate the task to";
3150
- readonly required: true;
3151
- readonly usageValue: "Name of the target agent";
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
- }];
1928
+ readonly parameters: z.ZodObject<{
1929
+ agentName: z.ZodString;
1930
+ task: z.ZodString;
1931
+ context: z.ZodString;
1932
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
1933
+ }, z.core.$strip>;
3168
1934
  readonly examples: [{
3169
1935
  readonly description: "Delegate a code analysis task to the analyzer agent";
3170
1936
  readonly parameters: [{
3171
- readonly name: "agent_name";
1937
+ readonly name: "agentName";
3172
1938
  readonly value: "analyzer";
3173
1939
  }, {
3174
1940
  readonly name: "task";
@@ -3187,24 +1953,17 @@ export declare const toolInfo_alias_2: {
3187
1953
  export declare const toolInfo_alias_3: {
3188
1954
  readonly name: "execute_command";
3189
1955
  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
- readonly name: "command";
3192
- readonly description: "The exact command to run (valid for the current OS). It must be correctly formatted and free of harmful instructions.";
3193
- readonly required: true;
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
- }];
1956
+ readonly parameters: z.ZodObject<{
1957
+ command: z.ZodString;
1958
+ requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1959
+ }, z.core.$strip>;
3201
1960
  readonly examples: [{
3202
1961
  readonly description: "Make a build";
3203
1962
  readonly parameters: [{
3204
1963
  readonly name: "command";
3205
1964
  readonly value: "npm run build";
3206
1965
  }, {
3207
- readonly name: "requires_approval";
1966
+ readonly name: "requiresApproval";
3208
1967
  readonly value: "false";
3209
1968
  }];
3210
1969
  }];
@@ -3214,11 +1973,9 @@ export declare const toolInfo_alias_3: {
3214
1973
  export declare const toolInfo_alias_4: {
3215
1974
  readonly name: "fetch_url";
3216
1975
  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
- readonly name: "url";
3219
- readonly description: "One or more URLs to fetch, separated by commas if multiple.";
3220
- readonly required: true;
3221
- }];
1976
+ readonly parameters: z.ZodObject<{
1977
+ url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
1978
+ }, z.core.$strip>;
3222
1979
  readonly examples: [{
3223
1980
  readonly description: "Fetch a single webpage";
3224
1981
  readonly parameters: [{
@@ -3244,31 +2001,16 @@ export declare const toolInfo_alias_4: {
3244
2001
  export declare const toolInfo_alias_5: {
3245
2002
  readonly name: "hand_over";
3246
2003
  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
- readonly name: "agent_name";
3249
- readonly description: "The name of the agent to hand over the task to";
3250
- readonly required: true;
3251
- readonly usageValue: "Name of the target agent";
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
- }];
2004
+ readonly parameters: z.ZodObject<{
2005
+ agentName: z.ZodString;
2006
+ task: z.ZodString;
2007
+ context: z.ZodString;
2008
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
2009
+ }, z.core.$strip>;
3268
2010
  readonly examples: [{
3269
2011
  readonly description: "Hand over a coding task to the coder agent";
3270
2012
  readonly parameters: [{
3271
- readonly name: "agent_name";
2013
+ readonly name: "agentName";
3272
2014
  readonly value: "coder";
3273
2015
  }, {
3274
2016
  readonly name: "task";
@@ -3287,29 +2029,18 @@ export declare const toolInfo_alias_5: {
3287
2029
  export declare const toolInfo_alias_6: {
3288
2030
  readonly name: "list_files";
3289
2031
  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
- readonly name: "path";
3292
- readonly description: "The path of the directory to list contents for (relative to the current working directory)";
3293
- readonly required: true;
3294
- readonly usageValue: "Directory path here";
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
- }];
2032
+ readonly parameters: z.ZodObject<{
2033
+ path: z.ZodString;
2034
+ maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
2035
+ recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
2036
+ }, z.core.$strip>;
3306
2037
  readonly examples: [{
3307
2038
  readonly description: "Request to list files";
3308
2039
  readonly parameters: [{
3309
2040
  readonly name: "path";
3310
2041
  readonly value: "src";
3311
2042
  }, {
3312
- readonly name: "max_count";
2043
+ readonly name: "maxCount";
3313
2044
  readonly value: "100";
3314
2045
  }];
3315
2046
  }];
@@ -3319,12 +2050,9 @@ export declare const toolInfo_alias_6: {
3319
2050
  export declare const toolInfo_alias_7: {
3320
2051
  readonly name: "read_file";
3321
2052
  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
- readonly name: "path";
3324
- readonly description: "The path of the file to read";
3325
- readonly required: true;
3326
- readonly usageValue: "Comma separated paths here";
3327
- }];
2053
+ readonly parameters: z.ZodObject<{
2054
+ path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
2055
+ }, z.core.$strip>;
3328
2056
  readonly examples: [{
3329
2057
  readonly description: "Request to read the contents of a file";
3330
2058
  readonly parameters: [{
@@ -3344,12 +2072,9 @@ export declare const toolInfo_alias_7: {
3344
2072
  export declare const toolInfo_alias_8: {
3345
2073
  readonly name: "remove_file";
3346
2074
  readonly description: "Request to remove a file at the specified path.";
3347
- readonly parameters: [{
3348
- readonly name: "path";
3349
- readonly description: "The path of the file to remove";
3350
- readonly required: true;
3351
- readonly usageValue: "File path here";
3352
- }];
2075
+ readonly parameters: z.ZodObject<{
2076
+ path: z.ZodString;
2077
+ }, z.core.$strip>;
3353
2078
  readonly examples: [{
3354
2079
  readonly description: "Request to remove a file";
3355
2080
  readonly parameters: [{
@@ -3363,17 +2088,10 @@ export declare const toolInfo_alias_8: {
3363
2088
  export declare const toolInfo_alias_9: {
3364
2089
  readonly name: "rename_file";
3365
2090
  readonly description: "Request to rename a file from source path to target path.";
3366
- readonly parameters: [{
3367
- readonly name: "source_path";
3368
- readonly description: "The current path of the file";
3369
- readonly required: true;
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
- }];
2091
+ readonly parameters: z.ZodObject<{
2092
+ source_path: z.ZodString;
2093
+ target_path: z.ZodString;
2094
+ }, z.core.$strip>;
3377
2095
  readonly examples: [{
3378
2096
  readonly description: "Request to rename a file";
3379
2097
  readonly parameters: [{
@@ -3387,6 +2105,16 @@ export declare const toolInfo_alias_9: {
3387
2105
  readonly permissionLevel: PermissionLevel.Write;
3388
2106
  };
3389
2107
 
2108
+ declare type ToolInfoV2 = {
2109
+ name: string;
2110
+ description: string;
2111
+ parameters: z.ZodObject<any>;
2112
+ examples?: ToolExample[];
2113
+ permissionLevel: PermissionLevel;
2114
+ };
2115
+ export { ToolInfoV2 }
2116
+ export { ToolInfoV2 as ToolInfoV2_alias_1 }
2117
+
3390
2118
  declare type ToolParameter = {
3391
2119
  name: string;
3392
2120
  description: string;
@@ -3517,7 +2245,16 @@ export { toolUsePrompt }
3517
2245
  export { toolUsePrompt as toolUsePrompt_alias_1 }
3518
2246
  export { toolUsePrompt as toolUsePrompt_alias_2 }
3519
2247
 
3520
- declare const TruncateContextPolicy: (tools: Parameters<AgentPolicy>[0]) => {
2248
+ declare type Totals = {
2249
+ input: number;
2250
+ output: number;
2251
+ cachedRead: number;
2252
+ cost: number;
2253
+ };
2254
+
2255
+ export declare function toToolInfoV1(tool: FullToolInfoV2): FullToolInfo;
2256
+
2257
+ declare const TruncateContextPolicy: () => {
3521
2258
  name: Policies;
3522
2259
  onBeforeRequest(agent: AgentBase): Promise<void>;
3523
2260
  };
@@ -3526,53 +2263,58 @@ export { TruncateContextPolicy as TruncateContextPolicy_alias_1 }
3526
2263
  export { TruncateContextPolicy as TruncateContextPolicy_alias_2 }
3527
2264
  export { TruncateContextPolicy as TruncateContextPolicy_alias_3 }
3528
2265
 
2266
+ /**
2267
+ * Tracks token / cost usage across any mix of LLM models.
2268
+ * Supports optional caps on total messages and total cost.
2269
+ */
3529
2270
  declare class UsageMeter {
3530
2271
  #private;
3531
- readonly maxCost: number;
3532
- readonly maxMessageCount: number;
3533
- constructor(options?: {
2272
+ constructor(modelInfos?: Record<string, Record<string, Partial<ModelInfo>>>, opts?: {
2273
+ maxMessages?: number;
3534
2274
  maxCost?: number;
3535
- maxMessageCount?: number;
3536
- prices?: Record<string, Record<string, ModelInfo>>;
3537
2275
  });
3538
- /**
3539
- * Add usage metrics to the current totals
3540
- */
3541
- addUsage(usage: Partial<ApiUsage>, model?: {
3542
- provider: string;
3543
- id: string;
2276
+ addUsage(llm: LanguageModelV2, resp: {
2277
+ usage: LanguageModelV2Usage;
2278
+ providerMetadata?: any;
2279
+ } | {
2280
+ totalUsage: LanguageModelV2Usage;
2281
+ providerMetadata?: any;
2282
+ }, options?: {
2283
+ modelInfo?: ModelInfo;
3544
2284
  }): void;
3545
- setUsage(usage: Partial<ApiUsage>, messageCount?: number): void;
3546
- incrementMessageCount(count?: number): void;
2285
+ /** Override the running totals (e.g., restore from saved state). */
2286
+ setUsage(newUsage: Partial<Totals & {
2287
+ calls: number;
2288
+ }>): void;
2289
+ /** Manually bump the message count (useful if you record some calls without token info). */
2290
+ incrementMessageCount(n?: number): void;
2291
+ /** Return true once either messages or cost exceed the configured caps. */
3547
2292
  isLimitExceeded(): {
3548
2293
  messageCount: boolean;
3549
- maxMessageCount: number;
2294
+ maxMessages: number;
3550
2295
  cost: boolean;
3551
2296
  maxCost: number;
3552
2297
  result: boolean;
3553
2298
  };
2299
+ /** Same as isLimitExceeded but throws an error if a limit is hit. */
3554
2300
  checkLimit(): void;
3555
- /**
3556
- * Get current usage totals
3557
- */
2301
+ /** Getter for the aggregated totals (immutable copy). */
3558
2302
  get usage(): {
3559
2303
  messageCount: number;
3560
- inputTokens: number;
3561
- outputTokens: number;
3562
- cacheWriteTokens: number;
3563
- cacheReadTokens: number;
3564
- totalCost: number;
2304
+ input: number;
2305
+ output: number;
2306
+ cachedRead: number;
2307
+ cost: number;
3565
2308
  };
2309
+ /** Print a concise usage summary to console. */
3566
2310
  printUsage(): void;
2311
+ onFinishHandler(llm: LanguageModelV2): (evt: {
2312
+ totalUsage: LanguageModelV2Usage;
2313
+ providerMetadata: any;
2314
+ }) => void;
3567
2315
  }
3568
2316
  export { UsageMeter }
3569
2317
  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
2318
 
3577
2319
  declare type WebProvider = {
3578
2320
  fetchUrl?: (url: string) => Promise<string>;