@polka-codes/core 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,11 +2,13 @@ import type { FilePart } from 'ai';
2
2
  import type { ImagePart } from 'ai';
3
3
  import type { LanguageModelV2 } from '@ai-sdk/provider';
4
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';
5
+ import type { ModelMessage } from '@ai-sdk/provider-utils';
6
+ import type { ModelMessage as ModelMessage_2 } from 'ai';
7
7
  import type { TextPart } from 'ai';
8
+ import type { ToolModelMessage } from '@ai-sdk/provider-utils';
8
9
  import type { UserContent } from '@ai-sdk/provider-utils';
9
10
  import type { UserContent as UserContent_2 } from 'ai';
11
+ import type { UserModelMessage } from '@ai-sdk/provider-utils';
10
12
  import { z } from 'zod';
11
13
 
12
14
  declare abstract class AgentBase {
@@ -17,13 +19,13 @@ declare abstract class AgentBase {
17
19
  constructor(name: string, ai: LanguageModelV2, config: AgentBaseConfig);
18
20
  abort(): void;
19
21
  get parameters(): Readonly<Record<string, any>>;
20
- get messages(): Readonly<ModelMessage_2[]>;
21
- setMessages(messages: Readonly<ModelMessage_2[]>): void;
22
+ get messages(): Readonly<ModelMessage[]>;
23
+ setMessages(messages: Readonly<ModelMessage[]>): void;
22
24
  start(prompt: UserContent): Promise<ExitReason>;
23
25
  step(prompt: UserContent): Promise<AssistantMessageContent[]>;
24
26
  handleStepResponse(response: AssistantMessageContent[]): Promise<{
25
27
  type: "reply";
26
- message: UserContent;
28
+ message: UserModelMessage | ToolModelMessage;
27
29
  } | {
28
30
  type: "exit";
29
31
  reason: ExitReason;
@@ -89,7 +91,7 @@ declare type AgentPolicyInstance = {
89
91
  prompt?: string;
90
92
  onBeforeInvokeTool?: (name: string, args: Record<string, string>) => Promise<ToolResponse | undefined>;
91
93
  onBeforeRequest?: (agent: AgentBase) => Promise<void>;
92
- prepareMessages?: (agent: AgentBase, messages: ModelMessage[]) => Promise<ModelMessage[]>;
94
+ prepareMessages?: (agent: AgentBase, messages: ModelMessage_2[]) => Promise<ModelMessage_2[]>;
93
95
  };
94
96
  export { AgentPolicyInstance }
95
97
  export { AgentPolicyInstance as AgentPolicyInstance_alias_1 }
@@ -106,12 +108,19 @@ declare type AiToolDefinition<Input, Output = string> = {
106
108
  prompt: string;
107
109
  formatInput: (params: Input) => string;
108
110
  parseOutput: (output: string) => Output;
109
- agent?: AgentNameType;
110
111
  };
111
112
  export { AiToolDefinition }
112
113
  export { AiToolDefinition as AiToolDefinition_alias_1 }
113
114
  export { AiToolDefinition as AiToolDefinition_alias_2 }
114
115
 
116
+ export declare type AiToolDefinitionWithAgent<Input, Output = string> = AiToolDefinition<Input, Output> & {
117
+ agent: (options: SharedAgentOptions) => AgentBase;
118
+ };
119
+
120
+ export declare type AiToolDefinitionWithMultiAgent<Input, Output = string> = AiToolDefinition<Input, Output> & {
121
+ agent: AgentNameType;
122
+ };
123
+
115
124
  declare const allAgents: readonly [{
116
125
  readonly name: "architect";
117
126
  readonly responsibilities: ["Analyzing the user’s overall task and requirements.", "Creating plans and making higher-level decisions about system structure and design.", "Reviewing and analyzing existing code or components for maintainability and scalability.", "Laying out the roadmap for implementation."];
@@ -135,14 +144,14 @@ export declare namespace allTools {
135
144
  _default_3 as delegate,
136
145
  _default_4 as executeCommand,
137
146
  _default_5 as fetchUrl,
138
- _default_6 as listFiles,
139
- _default_7 as readFile,
140
- _default_8 as replaceInFile,
141
- _default_9 as searchFiles,
142
- _default_10 as writeToFile,
143
- _default_11 as handOver,
144
- _default_12 as removeFile,
145
- _default_13 as renameFile
147
+ _default_6 as handOver,
148
+ _default_7 as listFiles,
149
+ _default_8 as readFile,
150
+ _default_9 as removeFile,
151
+ _default_10 as renameFile,
152
+ _default_11 as replaceInFile,
153
+ _default_12 as searchFiles,
154
+ _default_13 as writeToFile
146
155
  }
147
156
  }
148
157
 
@@ -197,7 +206,7 @@ export declare const basePrompt = "You are a highly skilled software engineer sp
197
206
 
198
207
  export declare const basePrompt_alias_1 = "You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.";
199
208
 
200
- declare const capabilities: (toolNamePrefix: string) => string;
209
+ declare const capabilities: (_toolNamePrefix: string) => string;
201
210
  export { capabilities }
202
211
  export { capabilities as capabilities_alias_1 }
203
212
  export { capabilities as capabilities_alias_2 }
@@ -209,7 +218,7 @@ export { capabilities as capabilities_alias_2 }
209
218
  declare class CodeFixerAgent extends AgentBase {
210
219
  #private;
211
220
  constructor(options: CodeFixerAgentOptions);
212
- protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
221
+ protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
213
222
  }
214
223
  export { CodeFixerAgent }
215
224
  export { CodeFixerAgent as CodeFixerAgent_alias_1 }
@@ -238,7 +247,7 @@ export declare const codeFixingStrategies = "\n====\n\nCODE FIXING STRATEGIES\n\
238
247
  */
239
248
  declare class CoderAgent extends AgentBase {
240
249
  constructor(options: CoderAgentOptions);
241
- protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
250
+ protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
242
251
  }
243
252
  export { CoderAgent }
244
253
  export { CoderAgent as CoderAgent_alias_1 }
@@ -371,44 +380,6 @@ declare const _default: {
371
380
  options: z.ZodDefault<z.ZodArray<z.ZodString>>;
372
381
  }, z.core.$strip>>;
373
382
  }, z.core.$strip>;
374
- readonly examples: [{
375
- readonly description: "Single clarifying question (no options)";
376
- readonly parameters: [{
377
- readonly name: "questions";
378
- readonly value: {
379
- readonly prompt: "What is the target deployment environment?";
380
- };
381
- }];
382
- }, {
383
- readonly description: "Single question with multiple-choice options";
384
- readonly parameters: [{
385
- readonly name: "questions";
386
- readonly value: {
387
- readonly prompt: "Which frontend framework are you using?";
388
- readonly options: ["React", "Angular", "Vue", "Svelte"];
389
- };
390
- }];
391
- }, {
392
- readonly description: "Two related questions in one call";
393
- readonly parameters: [{
394
- readonly name: "questions";
395
- readonly value: [{
396
- readonly prompt: "What type of application are you building?";
397
- }, {
398
- readonly prompt: "Preferred programming language?";
399
- readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
400
- }];
401
- }];
402
- }, {
403
- readonly description: "Binary (yes/no) confirmation";
404
- readonly parameters: [{
405
- readonly name: "questions";
406
- readonly value: {
407
- readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
408
- readonly options: ["Yes", "No"];
409
- };
410
- }];
411
- }];
412
383
  readonly permissionLevel: PermissionLevel.None;
413
384
  }, InteractionProvider>;
414
385
  isAvailable: (provider: InteractionProvider) => boolean;
@@ -420,234 +391,110 @@ declare const _default: {
420
391
  options: z.ZodDefault<z.ZodArray<z.ZodString>>;
421
392
  }, z.core.$strip>>;
422
393
  }, z.core.$strip>;
423
- examples: [{
424
- readonly description: "Single clarifying question (no options)";
425
- readonly parameters: [{
426
- readonly name: "questions";
427
- readonly value: {
428
- readonly prompt: "What is the target deployment environment?";
429
- };
430
- }];
431
- }, {
432
- readonly description: "Single question with multiple-choice options";
433
- readonly parameters: [{
434
- readonly name: "questions";
435
- readonly value: {
436
- readonly prompt: "Which frontend framework are you using?";
437
- readonly options: ["React", "Angular", "Vue", "Svelte"];
438
- };
439
- }];
440
- }, {
441
- readonly description: "Two related questions in one call";
442
- readonly parameters: [{
443
- readonly name: "questions";
444
- readonly value: [{
445
- readonly prompt: "What type of application are you building?";
446
- }, {
447
- readonly prompt: "Preferred programming language?";
448
- readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
449
- }];
450
- }];
451
- }, {
452
- readonly description: "Binary (yes/no) confirmation";
453
- readonly parameters: [{
454
- readonly name: "questions";
455
- readonly value: {
456
- readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
457
- readonly options: ["Yes", "No"];
458
- };
459
- }];
460
- }];
461
394
  permissionLevel: PermissionLevel.None;
462
395
  };
463
396
  export { _default as askFollowupQuestion }
464
397
  export { _default as askFollowupQuestion_alias_1 }
465
398
  export { _default as askFollowupQuestion_alias_2 }
466
- export { _default as default_alias_4 }
399
+ export { _default as default_alias_6 }
467
400
 
468
401
  declare const _default_10: {
469
402
  handler: ToolHandler<{
470
- readonly name: "write_to_file";
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.";
403
+ readonly name: "rename_file";
404
+ readonly description: "Request to rename a file from source path to target path.";
472
405
  readonly parameters: z.ZodObject<{
473
- path: z.ZodString;
474
- content: z.ZodString;
406
+ source_path: z.ZodString;
407
+ target_path: z.ZodString;
475
408
  }, z.core.$strip>;
476
- readonly examples: [{
477
- readonly description: "Request to write content to a file";
478
- readonly parameters: [{
479
- readonly name: "path";
480
- readonly value: "src/main.js";
481
- }, {
482
- readonly name: "content";
483
- readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
484
- }];
485
- }];
486
409
  readonly permissionLevel: PermissionLevel.Write;
487
410
  }, FilesystemProvider>;
488
411
  isAvailable: (provider: FilesystemProvider) => boolean;
489
- name: "write_to_file";
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.";
412
+ name: "rename_file";
413
+ description: "Request to rename a file from source path to target path.";
491
414
  parameters: z.ZodObject<{
492
- path: z.ZodString;
493
- content: z.ZodString;
415
+ source_path: z.ZodString;
416
+ target_path: z.ZodString;
494
417
  }, z.core.$strip>;
495
- examples: [{
496
- readonly description: "Request to write content to a file";
497
- readonly parameters: [{
498
- readonly name: "path";
499
- readonly value: "src/main.js";
500
- }, {
501
- readonly name: "content";
502
- readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
503
- }];
504
- }];
505
418
  permissionLevel: PermissionLevel.Write;
506
419
  };
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 }
420
+ export { _default_10 as default_alias_15 }
421
+ export { _default_10 as renameFile }
422
+ export { _default_10 as renameFile_alias_1 }
423
+ export { _default_10 as renameFile_alias_2 }
511
424
 
512
425
  declare const _default_11: {
513
426
  handler: ToolHandler<{
514
- readonly name: "hand_over";
515
- readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
427
+ readonly name: "replace_in_file";
428
+ 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.";
516
429
  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>>>;
430
+ path: z.ZodString;
431
+ diff: z.ZodString;
521
432
  }, z.core.$strip>;
522
- readonly examples: [{
523
- readonly description: "Hand over a coding task to the coder agent";
524
- readonly parameters: [{
525
- readonly name: "agentName";
526
- readonly value: "coder";
527
- }, {
528
- readonly name: "task";
529
- readonly value: "Implement the login feature";
530
- }, {
531
- readonly name: "context";
532
- readonly value: "We need a secure login system with email and password";
533
- }, {
534
- readonly name: "files";
535
- readonly value: "src/auth/login.ts,src/auth/types.ts";
536
- }];
537
- }];
538
- readonly permissionLevel: PermissionLevel.None;
539
- }, any>;
540
- isAvailable: (_provider: any) => boolean;
541
- name: "hand_over";
542
- description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
433
+ readonly permissionLevel: PermissionLevel.Write;
434
+ }, FilesystemProvider>;
435
+ isAvailable: (provider: FilesystemProvider) => boolean;
436
+ name: "replace_in_file";
437
+ 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.";
543
438
  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>>>;
439
+ path: z.ZodString;
440
+ diff: z.ZodString;
548
441
  }, z.core.$strip>;
549
- examples: [{
550
- readonly description: "Hand over a coding task to the coder agent";
551
- readonly parameters: [{
552
- readonly name: "agentName";
553
- readonly value: "coder";
554
- }, {
555
- readonly name: "task";
556
- readonly value: "Implement the login feature";
557
- }, {
558
- readonly name: "context";
559
- readonly value: "We need a secure login system with email and password";
560
- }, {
561
- readonly name: "files";
562
- readonly value: "src/auth/login.ts,src/auth/types.ts";
563
- }];
564
- }];
565
- permissionLevel: PermissionLevel.None;
442
+ permissionLevel: PermissionLevel.Write;
566
443
  };
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 }
444
+ export { _default_11 as default_alias_16 }
445
+ export { _default_11 as replaceInFile }
446
+ export { _default_11 as replaceInFile_alias_1 }
447
+ export { _default_11 as replaceInFile_alias_2 }
571
448
 
572
449
  declare const _default_12: {
573
450
  handler: ToolHandler<{
574
- readonly name: "remove_file";
575
- readonly description: "Request to remove a file at the specified path.";
451
+ readonly name: "search_files";
452
+ 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.";
576
453
  readonly parameters: z.ZodObject<{
577
454
  path: z.ZodString;
455
+ regex: z.ZodString;
456
+ filePattern: z.ZodOptional<z.ZodString>;
578
457
  }, z.core.$strip>;
579
- readonly examples: [{
580
- readonly description: "Request to remove a file";
581
- readonly parameters: [{
582
- readonly name: "path";
583
- readonly value: "src/main.js";
584
- }];
585
- }];
586
- readonly permissionLevel: PermissionLevel.Write;
458
+ readonly permissionLevel: PermissionLevel.Read;
587
459
  }, FilesystemProvider>;
588
460
  isAvailable: (provider: FilesystemProvider) => boolean;
589
- name: "remove_file";
590
- description: "Request to remove a file at the specified path.";
461
+ name: "search_files";
462
+ 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.";
591
463
  parameters: z.ZodObject<{
592
464
  path: z.ZodString;
465
+ regex: z.ZodString;
466
+ filePattern: z.ZodOptional<z.ZodString>;
593
467
  }, z.core.$strip>;
594
- examples: [{
595
- readonly description: "Request to remove a file";
596
- readonly parameters: [{
597
- readonly name: "path";
598
- readonly value: "src/main.js";
599
- }];
600
- }];
601
- permissionLevel: PermissionLevel.Write;
468
+ permissionLevel: PermissionLevel.Read;
602
469
  };
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 }
470
+ export { _default_12 as default_alias_17 }
471
+ export { _default_12 as searchFiles }
472
+ export { _default_12 as searchFiles_alias_1 }
473
+ export { _default_12 as searchFiles_alias_2 }
607
474
 
608
475
  declare const _default_13: {
609
476
  handler: ToolHandler<{
610
- readonly name: "rename_file";
611
- readonly description: "Request to rename a file from source path to target path.";
477
+ readonly name: "write_to_file";
478
+ 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.";
612
479
  readonly parameters: z.ZodObject<{
613
- source_path: z.ZodString;
614
- target_path: z.ZodString;
480
+ path: z.ZodString;
481
+ content: z.ZodString;
615
482
  }, z.core.$strip>;
616
- readonly examples: [{
617
- readonly description: "Request to rename a file";
618
- readonly parameters: [{
619
- readonly name: "source_path";
620
- readonly value: "src/old-name.js";
621
- }, {
622
- readonly name: "target_path";
623
- readonly value: "src/new-name.js";
624
- }];
625
- }];
626
483
  readonly permissionLevel: PermissionLevel.Write;
627
484
  }, FilesystemProvider>;
628
485
  isAvailable: (provider: FilesystemProvider) => boolean;
629
- name: "rename_file";
630
- description: "Request to rename a file from source path to target path.";
486
+ name: "write_to_file";
487
+ description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
631
488
  parameters: z.ZodObject<{
632
- source_path: z.ZodString;
633
- target_path: z.ZodString;
489
+ path: z.ZodString;
490
+ content: z.ZodString;
634
491
  }, z.core.$strip>;
635
- examples: [{
636
- readonly description: "Request to rename a file";
637
- readonly parameters: [{
638
- readonly name: "source_path";
639
- readonly value: "src/old-name.js";
640
- }, {
641
- readonly name: "target_path";
642
- readonly value: "src/new-name.js";
643
- }];
644
- }];
645
492
  permissionLevel: PermissionLevel.Write;
646
493
  };
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 }
494
+ export { _default_13 as default_alias_18 }
495
+ export { _default_13 as writeToFile }
496
+ export { _default_13 as writeToFile_alias_1 }
497
+ export { _default_13 as writeToFile_alias_2 }
651
498
 
652
499
  declare const _default_2: {
653
500
  handler: ToolHandler<{
@@ -656,34 +503,20 @@ declare const _default_2: {
656
503
  readonly parameters: z.ZodObject<{
657
504
  result: z.ZodString;
658
505
  }, z.core.$strip>;
659
- readonly examples: [{
660
- readonly description: "Request to present the result of the task";
661
- readonly parameters: [{
662
- readonly name: "result";
663
- readonly value: "Your final result description here";
664
- }];
665
- }];
666
506
  readonly permissionLevel: PermissionLevel.None;
667
507
  }, InteractionProvider>;
668
- isAvailable: (provider: InteractionProvider) => boolean;
508
+ isAvailable: (_provider: InteractionProvider) => boolean;
669
509
  name: "attempt_completion";
670
510
  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.";
671
511
  parameters: z.ZodObject<{
672
512
  result: z.ZodString;
673
513
  }, z.core.$strip>;
674
- examples: [{
675
- readonly description: "Request to present the result of the task";
676
- readonly parameters: [{
677
- readonly name: "result";
678
- readonly value: "Your final result description here";
679
- }];
680
- }];
681
514
  permissionLevel: PermissionLevel.None;
682
515
  };
683
516
  export { _default_2 as attemptCompletion }
684
517
  export { _default_2 as attemptCompletion_alias_1 }
685
518
  export { _default_2 as attemptCompletion_alias_2 }
686
- export { _default_2 as default_alias_5 }
519
+ export { _default_2 as default_alias_7 }
687
520
 
688
521
  declare const _default_3: {
689
522
  handler: ToolHandler<{
@@ -695,22 +528,6 @@ declare const _default_3: {
695
528
  context: z.ZodString;
696
529
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
697
530
  }, z.core.$strip>;
698
- readonly examples: [{
699
- readonly description: "Delegate a code analysis task to the analyzer agent";
700
- readonly parameters: [{
701
- readonly name: "agentName";
702
- readonly value: "analyzer";
703
- }, {
704
- readonly name: "task";
705
- readonly value: "Analyze the authentication implementation";
706
- }, {
707
- readonly name: "context";
708
- readonly value: "Need to understand the security implications of the current auth system";
709
- }, {
710
- readonly name: "files";
711
- readonly value: "src/auth/login.ts,src/auth/types.ts";
712
- }];
713
- }];
714
531
  readonly permissionLevel: PermissionLevel.None;
715
532
  }, any>;
716
533
  isAvailable: (_provider: any) => boolean;
@@ -722,25 +539,9 @@ declare const _default_3: {
722
539
  context: z.ZodString;
723
540
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
724
541
  }, z.core.$strip>;
725
- examples: [{
726
- readonly description: "Delegate a code analysis task to the analyzer agent";
727
- readonly parameters: [{
728
- readonly name: "agentName";
729
- readonly value: "analyzer";
730
- }, {
731
- readonly name: "task";
732
- readonly value: "Analyze the authentication implementation";
733
- }, {
734
- readonly name: "context";
735
- readonly value: "Need to understand the security implications of the current auth system";
736
- }, {
737
- readonly name: "files";
738
- readonly value: "src/auth/login.ts,src/auth/types.ts";
739
- }];
740
- }];
741
542
  permissionLevel: PermissionLevel.None;
742
543
  };
743
- export { _default_3 as default_alias_6 }
544
+ export { _default_3 as default_alias_8 }
744
545
  export { _default_3 as delegate }
745
546
  export { _default_3 as delegate_alias_1 }
746
547
  export { _default_3 as delegate_alias_2 }
@@ -753,16 +554,6 @@ declare const _default_4: {
753
554
  command: z.ZodString;
754
555
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
755
556
  }, z.core.$strip>;
756
- readonly examples: [{
757
- readonly description: "Make a build";
758
- readonly parameters: [{
759
- readonly name: "command";
760
- readonly value: "npm run build";
761
- }, {
762
- readonly name: "requiresApproval";
763
- readonly value: "false";
764
- }];
765
- }];
766
557
  readonly permissionLevel: PermissionLevel.Arbitrary;
767
558
  }, CommandProvider>;
768
559
  isAvailable: (provider: CommandProvider) => boolean;
@@ -772,19 +563,9 @@ declare const _default_4: {
772
563
  command: z.ZodString;
773
564
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
774
565
  }, z.core.$strip>;
775
- examples: [{
776
- readonly description: "Make a build";
777
- readonly parameters: [{
778
- readonly name: "command";
779
- readonly value: "npm run build";
780
- }, {
781
- readonly name: "requiresApproval";
782
- readonly value: "false";
783
- }];
784
- }];
785
566
  permissionLevel: PermissionLevel.Arbitrary;
786
567
  };
787
- export { _default_4 as default_alias_7 }
568
+ export { _default_4 as default_alias_9 }
788
569
  export { _default_4 as executeCommand }
789
570
  export { _default_4 as executeCommand_alias_1 }
790
571
  export { _default_4 as executeCommand_alias_2 }
@@ -796,25 +577,6 @@ declare const _default_5: {
796
577
  readonly parameters: z.ZodObject<{
797
578
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
798
579
  }, z.core.$strip>;
799
- readonly examples: [{
800
- readonly description: "Fetch a single webpage";
801
- readonly parameters: [{
802
- readonly name: "url";
803
- readonly value: "https://example.com";
804
- }];
805
- }, {
806
- readonly description: "Fetch multiple webpages";
807
- readonly parameters: [{
808
- readonly name: "url";
809
- readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
810
- }];
811
- }, {
812
- readonly description: "Fetch a raw file from GitHub";
813
- readonly parameters: [{
814
- readonly name: "url";
815
- readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
816
- }];
817
- }];
818
580
  readonly permissionLevel: PermissionLevel.Read;
819
581
  }, WebProvider>;
820
582
  isAvailable: (provider: WebProvider) => boolean;
@@ -823,33 +585,42 @@ declare const _default_5: {
823
585
  parameters: z.ZodObject<{
824
586
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
825
587
  }, z.core.$strip>;
826
- examples: [{
827
- readonly description: "Fetch a single webpage";
828
- readonly parameters: [{
829
- readonly name: "url";
830
- readonly value: "https://example.com";
831
- }];
832
- }, {
833
- readonly description: "Fetch multiple webpages";
834
- readonly parameters: [{
835
- readonly name: "url";
836
- readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
837
- }];
838
- }, {
839
- readonly description: "Fetch a raw file from GitHub";
840
- readonly parameters: [{
841
- readonly name: "url";
842
- readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
843
- }];
844
- }];
845
588
  permissionLevel: PermissionLevel.Read;
846
589
  };
847
- export { _default_5 as default_alias_8 }
590
+ export { _default_5 as default_alias_10 }
848
591
  export { _default_5 as fetchUrl }
849
592
  export { _default_5 as fetchUrl_alias_1 }
850
593
  export { _default_5 as fetchUrl_alias_2 }
851
594
 
852
595
  declare const _default_6: {
596
+ handler: ToolHandler<{
597
+ readonly name: "hand_over";
598
+ readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
599
+ readonly parameters: z.ZodObject<{
600
+ agentName: z.ZodString;
601
+ task: z.ZodString;
602
+ context: z.ZodString;
603
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
604
+ }, z.core.$strip>;
605
+ readonly permissionLevel: PermissionLevel.None;
606
+ }, any>;
607
+ isAvailable: (_provider: any) => boolean;
608
+ name: "hand_over";
609
+ description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
610
+ parameters: z.ZodObject<{
611
+ agentName: z.ZodString;
612
+ task: z.ZodString;
613
+ context: z.ZodString;
614
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
615
+ }, z.core.$strip>;
616
+ permissionLevel: PermissionLevel.None;
617
+ };
618
+ export { _default_6 as default_alias_11 }
619
+ export { _default_6 as handOver }
620
+ export { _default_6 as handOver_alias_1 }
621
+ export { _default_6 as handOver_alias_2 }
622
+
623
+ declare const _default_7: {
853
624
  handler: ToolHandler<{
854
625
  readonly name: "list_files";
855
626
  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.";
@@ -858,16 +629,6 @@ declare const _default_6: {
858
629
  maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
859
630
  recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
860
631
  }, z.core.$strip>;
861
- readonly examples: [{
862
- readonly description: "Request to list files";
863
- readonly parameters: [{
864
- readonly name: "path";
865
- readonly value: "src";
866
- }, {
867
- readonly name: "maxCount";
868
- readonly value: "100";
869
- }];
870
- }];
871
632
  readonly permissionLevel: PermissionLevel.Read;
872
633
  }, FilesystemProvider>;
873
634
  isAvailable: (provider: FilesystemProvider) => boolean;
@@ -878,43 +639,20 @@ declare const _default_6: {
878
639
  maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
879
640
  recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
880
641
  }, z.core.$strip>;
881
- examples: [{
882
- readonly description: "Request to list files";
883
- readonly parameters: [{
884
- readonly name: "path";
885
- readonly value: "src";
886
- }, {
887
- readonly name: "maxCount";
888
- readonly value: "100";
889
- }];
890
- }];
891
642
  permissionLevel: PermissionLevel.Read;
892
643
  };
893
- export { _default_6 as default_alias_10 }
894
- export { _default_6 as listFiles }
895
- export { _default_6 as listFiles_alias_1 }
896
- export { _default_6 as listFiles_alias_2 }
644
+ export { _default_7 as default_alias_12 }
645
+ export { _default_7 as listFiles }
646
+ export { _default_7 as listFiles_alias_1 }
647
+ export { _default_7 as listFiles_alias_2 }
897
648
 
898
- declare const _default_7: {
649
+ declare const _default_8: {
899
650
  handler: ToolHandler<{
900
651
  readonly name: "read_file";
901
652
  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.";
902
653
  readonly parameters: z.ZodObject<{
903
654
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
904
655
  }, z.core.$strip>;
905
- readonly examples: [{
906
- readonly description: "Request to read the contents of a file";
907
- readonly parameters: [{
908
- readonly name: "path";
909
- readonly value: "src/main.js";
910
- }];
911
- }, {
912
- readonly description: "Request to read multiple files";
913
- readonly parameters: [{
914
- readonly name: "path";
915
- readonly value: "src/main.js,src/index.js";
916
- }];
917
- }];
918
656
  readonly permissionLevel: PermissionLevel.Read;
919
657
  }, FilesystemProvider>;
920
658
  isAvailable: (provider: FilesystemProvider) => boolean;
@@ -923,175 +661,34 @@ declare const _default_7: {
923
661
  parameters: z.ZodObject<{
924
662
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
925
663
  }, z.core.$strip>;
926
- examples: [{
927
- readonly description: "Request to read the contents of a file";
928
- readonly parameters: [{
929
- readonly name: "path";
930
- readonly value: "src/main.js";
931
- }];
932
- }, {
933
- readonly description: "Request to read multiple files";
934
- readonly parameters: [{
935
- readonly name: "path";
936
- readonly value: "src/main.js,src/index.js";
937
- }];
938
- }];
939
664
  permissionLevel: PermissionLevel.Read;
940
665
  };
941
- export { _default_7 as default_alias_11 }
942
- export { _default_7 as readFile }
943
- export { _default_7 as readFile_alias_1 }
944
- export { _default_7 as readFile_alias_2 }
666
+ export { _default_8 as default_alias_13 }
667
+ export { _default_8 as readFile }
668
+ export { _default_8 as readFile_alias_1 }
669
+ export { _default_8 as readFile_alias_2 }
945
670
 
946
- declare const _default_8: {
671
+ declare const _default_9: {
947
672
  handler: ToolHandler<{
948
- readonly name: "replace_in_file";
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.";
673
+ readonly name: "remove_file";
674
+ readonly description: "Request to remove a file at the specified path.";
950
675
  readonly parameters: z.ZodObject<{
951
676
  path: z.ZodString;
952
- diff: z.ZodString;
953
677
  }, z.core.$strip>;
954
- readonly examples: [{
955
- readonly description: "Request to replace sections of content in a file";
956
- readonly parameters: [{
957
- readonly name: "path";
958
- readonly value: "src/main.js";
959
- }, {
960
- readonly name: "diff";
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";
962
- }];
963
- }, {
964
- readonly description: "Request to perform a simple, single-line replacement";
965
- readonly parameters: [{
966
- readonly name: "path";
967
- readonly value: "src/config.js";
968
- }, {
969
- readonly name: "diff";
970
- readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
971
- }];
972
- }, {
973
- readonly description: "Request to add a new function to a file";
974
- readonly parameters: [{
975
- readonly name: "path";
976
- readonly value: "src/utils.js";
977
- }, {
978
- readonly name: "diff";
979
- readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
980
- }];
981
- }, {
982
- readonly description: "Request to delete a block of code from a file";
983
- readonly parameters: [{
984
- readonly name: "path";
985
- readonly value: "src/app.js";
986
- }, {
987
- readonly name: "diff";
988
- readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
989
- }];
990
- }];
991
678
  readonly permissionLevel: PermissionLevel.Write;
992
679
  }, FilesystemProvider>;
993
680
  isAvailable: (provider: FilesystemProvider) => boolean;
994
- name: "replace_in_file";
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.";
681
+ name: "remove_file";
682
+ description: "Request to remove a file at the specified path.";
996
683
  parameters: z.ZodObject<{
997
684
  path: z.ZodString;
998
- diff: z.ZodString;
999
685
  }, z.core.$strip>;
1000
- examples: [{
1001
- readonly description: "Request to replace sections of content in a file";
1002
- readonly parameters: [{
1003
- readonly name: "path";
1004
- readonly value: "src/main.js";
1005
- }, {
1006
- readonly name: "diff";
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";
1008
- }];
1009
- }, {
1010
- readonly description: "Request to perform a simple, single-line replacement";
1011
- readonly parameters: [{
1012
- readonly name: "path";
1013
- readonly value: "src/config.js";
1014
- }, {
1015
- readonly name: "diff";
1016
- readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
1017
- }];
1018
- }, {
1019
- readonly description: "Request to add a new function to a file";
1020
- readonly parameters: [{
1021
- readonly name: "path";
1022
- readonly value: "src/utils.js";
1023
- }, {
1024
- readonly name: "diff";
1025
- readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
1026
- }];
1027
- }, {
1028
- readonly description: "Request to delete a block of code from a file";
1029
- readonly parameters: [{
1030
- readonly name: "path";
1031
- readonly value: "src/app.js";
1032
- }, {
1033
- readonly name: "diff";
1034
- readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
1035
- }];
1036
- }];
1037
686
  permissionLevel: PermissionLevel.Write;
1038
687
  };
1039
- export { _default_8 as default_alias_14 }
1040
- export { _default_8 as replaceInFile }
1041
- export { _default_8 as replaceInFile_alias_1 }
1042
- export { _default_8 as replaceInFile_alias_2 }
1043
-
1044
- declare const _default_9: {
1045
- handler: ToolHandler<{
1046
- readonly name: "search_files";
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.";
1048
- readonly parameters: z.ZodObject<{
1049
- path: z.ZodString;
1050
- regex: z.ZodString;
1051
- filePattern: z.ZodOptional<z.ZodString>;
1052
- }, z.core.$strip>;
1053
- readonly examples: [{
1054
- readonly description: "Request to perform a regex search across files";
1055
- readonly parameters: [{
1056
- readonly name: "path";
1057
- readonly value: "src";
1058
- }, {
1059
- readonly name: "regex";
1060
- readonly value: "^components/";
1061
- }, {
1062
- readonly name: "filePattern";
1063
- readonly value: "*.ts,*.tsx";
1064
- }];
1065
- }];
1066
- readonly permissionLevel: PermissionLevel.Read;
1067
- }, FilesystemProvider>;
1068
- isAvailable: (provider: FilesystemProvider) => boolean;
1069
- name: "search_files";
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.";
1071
- parameters: z.ZodObject<{
1072
- path: z.ZodString;
1073
- regex: z.ZodString;
1074
- filePattern: z.ZodOptional<z.ZodString>;
1075
- }, z.core.$strip>;
1076
- examples: [{
1077
- readonly description: "Request to perform a regex search across files";
1078
- readonly parameters: [{
1079
- readonly name: "path";
1080
- readonly value: "src";
1081
- }, {
1082
- readonly name: "regex";
1083
- readonly value: "^components/";
1084
- }, {
1085
- readonly name: "filePattern";
1086
- readonly value: "*.ts,*.tsx";
1087
- }];
1088
- }];
1089
- permissionLevel: PermissionLevel.Read;
1090
- };
1091
- export { _default_9 as default_alias_15 }
1092
- export { _default_9 as searchFiles }
1093
- export { _default_9 as searchFiles_alias_1 }
1094
- export { _default_9 as searchFiles_alias_2 }
688
+ export { _default_9 as default_alias_14 }
689
+ export { _default_9 as removeFile }
690
+ export { _default_9 as removeFile_alias_1 }
691
+ export { _default_9 as removeFile_alias_2 }
1095
692
 
1096
693
  /**
1097
694
  * AI tool for creating new projects based on user specifications.
@@ -1100,7 +697,7 @@ export { _default_9 as searchFiles_alias_2 }
1100
697
  export declare const default_alias: {
1101
698
  readonly name: "createNewProject";
1102
699
  readonly description: "Creates a new project";
1103
- readonly prompt: "You are an AiTool designed to assist users in creating new projects. Follow these guidelines:\n\n1. **Gather Information:**\n - Begin by asking the user for essential project details, including:\n - Project type (e.g., web, mobile, desktop, etc.)\n - Desired programming languages\n - Preferred frameworks or libraries\n - Build tools and package manager preferences\n - Testing frameworks and patterns\n - Code style and linting preferences\n - Any additional specifications or requirements\n\n2. **Clarification & Confirmation:**\n - Do not make any decisions or assumptions on behalf of the user.\n - Ask clarifying questions if any detail is ambiguous.\n - Confirm each piece of information with the user before proceeding to the next step.\n\n3. **Avoid Redundancy:**\n - Do not repeat questions or details that have already been confirmed.\n - Keep interactions concise and focused on gathering complete and accurate details.\n\n4. **Generate Configuration:**\n - Based on the collected information, generate a .polkacodes.yml configuration file that includes:\n - scripts section with common development commands (test, format, check, etc.)\n - rules section reflecting project conventions and tools\n - excludeFiles section for sensitive files only\n - Example structure:\n ```yaml\n scripts:\n test:\n command: \"[test-command]\"\n description: \"Run tests\"\n format:\n command: \"[format-command]\"\n description: \"Format code\"\n check:\n command: \"[check-command]\"\n description: \"Check code\"\n\n rules:\n - \"[package-manager-rule]\"\n - \"[testing-framework-rule]\"\n - \"[code-style-rule]\"\n - \"[other-rule]\"\n\n excludeFiles:\n - \".env\"\n - \".env.*\"\n ```\n\n5. **Generate Essential Project Files:**\n - Create a .gitattributes file with appropriate configurations:\n - Mark lock files as generated and exclude them from diffs\n - Example for different package managers:\n \n # For Bun\n bun.lock linguist-generated=true\n bun.lock -diff\n \n # For npm\n package-lock.json linguist-generated=true\n package-lock.json -diff\n \n # For Yarn\n yarn.lock linguist-generated=true\n yarn.lock -diff\n \n # For pnpm\n pnpm-lock.yaml linguist-generated=true\n pnpm-lock.yaml -diff\n \n - Include other common configurations as needed based on project type\n\n6. **Handover to Coder Agent:**\n - Once all required information is collected and validated by the user, compile:\n 1. The final project specifications\n 2. The .polkacodes.yml configuration content\n - Clearly hand over these details to the coder agent, instructing them to:\n 1. Create the new project based on the confirmed specifications\n 2. Include the .polkacodes.yml file in the project root\n 3. Include the .gitattributes file with appropriate configurations\n 4. Ensure all specified tools and configurations are properly set up";
700
+ readonly prompt: "You are an AiTool designed to assist users in creating new projects. Follow these guidelines:\n\n1. **Gather Information:**\n - Begin by asking the user for essential project details, including:\n - Project type (e.g., web, mobile, desktop, etc.)\n - Desired programming languages\n - Preferred frameworks or libraries\n - Build tools and package manager preferences\n - Testing frameworks and patterns\n - Code style and linting preferences\n - Any additional specifications or requirements\n\n2. **Clarification & Confirmation:**\n - Do not make any decisions or assumptions on behalf of the user.\n - Ask clarifying questions if any detail is ambiguous.\n - Confirm each piece of information with the user before proceeding to the next step.\n\n3. **Avoid Redundancy:**\n - Do not repeat questions or details that have already been confirmed.\n - Keep interactions concise and focused on gathering complete and accurate details.\n\n4. **Generate Configuration:**\n - Based on the collected information, generate a .polkacodes.yml configuration file that includes:\n - scripts section with common development commands (test, format, check, etc.)\n - rules section reflecting project conventions and tools\n - excludeFiles section for sensitive files only\n - Example structure:\n ```yaml\n scripts:\n test:\n command: \"[test-command]\"\n description: \"Run tests\"\n format:\n command: \"[format-command]\"\n description: \"Format code\"\n check:\n command: \"[check-command]\"\n description: \"Check code\"\n\n rules:\n - \"[package-manager-rule]\"\n - \"[testing-framework-rule]\"\n - \"[code-style-rule]\"\n - \"[other-rule]\"\n\n excludeFiles:\n - \".env\"\n - \".env.*\"\n ```\n\n5. **Generate Essential Project Files:**\n - Create a .gitattributes file with appropriate configurations:\n - Mark lock files as generated and exclude them from diffs\n - Example for different package managers:\n\n # For Bun\n bun.lock linguist-generated=true\n bun.lock -diff\n\n # For npm\n package-lock.json linguist-generated=true\n package-lock.json -diff\n\n # For Yarn\n yarn.lock linguist-generated=true\n yarn.lock -diff\n\n # For pnpm\n pnpm-lock.yaml linguist-generated=true\n pnpm-lock.yaml -diff\n\n - Include other common configurations as needed based on project type\n\n6. **Handover to Coder Agent:**\n - Once all required information is collected and validated by the user, compile:\n 1. The final project specifications\n 2. The .polkacodes.yml configuration content\n - Clearly hand over these details to the coder agent, instructing them to:\n 1. Create the new project based on the confirmed specifications\n 2. Include the .polkacodes.yml file in the project root\n 3. Include the .gitattributes file with appropriate configurations\n 4. Ensure all specified tools and configurations are properly set up";
1104
701
  readonly formatInput: (params: string) => string;
1105
702
  readonly parseOutput: (output: string) => string;
1106
703
  readonly agent: "architect";
@@ -1138,6 +735,37 @@ export declare const default_alias_3: {
1138
735
  readonly agent: "analyzer";
1139
736
  };
1140
737
 
738
+ export declare const default_alias_4: {
739
+ readonly name: "reviewDiff";
740
+ readonly description: "Reviews a git diff";
741
+ readonly prompt: "\n# Code Review Prompt\n\nYou are a senior software engineer reviewing code changes.\n\n## Viewing Changes\n- Use **git_diff** to inspect code.\n - **Pull request**: use the provided commit range.\n - **Local changes**: diff staged or unstaged files.\n- If a pull request is present you may receive:\n - <pr_title>\n - <pr_description>\n - <commit_messages>\n- A <review_instructions> tag tells you the focus of the review.\n\n## Focus Areas\n- Readability and maintainability\n- Correctness, edge cases, potential bugs\n- Performance implications\n- Clarity of intent\n- Best-practice adherence\n\n## Output Format\nDo **not** include praise or positive feedback. Ignore generated files such as lock files.\n\nReturn your review as a JSON object inside a ```json block, wrapped like:\n<tool_attempt_completion>\n<tool_parameter_result>\n```json\n{\n \"overview\": \"Summary of overall concerns.\",\n \"specificReviews\": [\n {\n \"file\": \"path/filename.ext\",\n \"lines\": \"N or N-M\",\n \"review\": \"Describe the issue and actionable fix or improvement.\"\n }\n ]\n}\n```\n</tool_parameter_result>\n</tool_attempt_completion>\n";
742
+ readonly formatInput: (params: Input_2) => string;
743
+ readonly parseOutput: (output: string) => Output_2;
744
+ readonly agent: (options: SharedAgentOptions) => AnalyzerAgent;
745
+ };
746
+
747
+ export declare const default_alias_5: {
748
+ handler: ToolHandler<{
749
+ readonly name: "git_diff";
750
+ readonly description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
751
+ readonly parameters: z.ZodObject<{
752
+ staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
753
+ commitRange: z.ZodOptional<z.ZodString>;
754
+ file: z.ZodOptional<z.ZodString>;
755
+ }, z.core.$strip>;
756
+ readonly permissionLevel: PermissionLevel.Read;
757
+ }, CommandProvider>;
758
+ isAvailable: (provider: CommandProvider) => boolean;
759
+ name: "git_diff";
760
+ description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
761
+ parameters: z.ZodObject<{
762
+ staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
763
+ commitRange: z.ZodOptional<z.ZodString>;
764
+ file: z.ZodOptional<z.ZodString>;
765
+ }, z.core.$strip>;
766
+ permissionLevel: PermissionLevel.Read;
767
+ };
768
+
1141
769
  /**
1142
770
  * Returns the directory portion of a path string.
1143
771
  * Strips trailing slashes, then takes everything up to the last slash.
@@ -1152,10 +780,14 @@ export { EnableCachePolicy as EnableCachePolicy_alias_1 }
1152
780
  export { EnableCachePolicy as EnableCachePolicy_alias_2 }
1153
781
  export { EnableCachePolicy as EnableCachePolicy_alias_3 }
1154
782
 
1155
- declare const executeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
783
+ declare const executeAgentTool: <T extends AiToolDefinitionWithAgent<any, any>>(definition: T, options: SharedAgentOptions, params: GetInput<T>) => Promise<GetOutput<T>>;
1156
784
  export { executeAgentTool }
1157
785
  export { executeAgentTool as executeAgentTool_alias_1 }
1158
786
 
787
+ declare const executeMultiAgentTool: <T extends AiToolDefinitionWithMultiAgent<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
788
+ export { executeMultiAgentTool }
789
+ export { executeMultiAgentTool as executeMultiAgentTool_alias_1 }
790
+
1159
791
  declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
1160
792
  export { executeTool }
1161
793
  export { executeTool as executeTool_alias_1 }
@@ -1188,28 +820,28 @@ export { FilesystemProvider as FilesystemProvider_alias_2 }
1188
820
 
1189
821
  export declare const fullSystemPrompt: (info: {
1190
822
  os: string;
1191
- }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
823
+ }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1192
824
  command: string;
1193
825
  description: string;
1194
826
  }>, useNativeTool: boolean) => string;
1195
827
 
1196
828
  export declare const fullSystemPrompt_alias_1: (info: {
1197
829
  os: string;
1198
- }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
830
+ }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1199
831
  command: string;
1200
832
  description: string;
1201
833
  }>, useNativeTool: boolean) => string;
1202
834
 
1203
835
  export declare const fullSystemPrompt_alias_2: (info: {
1204
836
  os: string;
1205
- }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
837
+ }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1206
838
  command: string;
1207
839
  description: string;
1208
- }>, interactive: boolean, useNativeTool: boolean) => string;
840
+ }>, _interactive: boolean, useNativeTool: boolean) => string;
1209
841
 
1210
842
  export declare const fullSystemPrompt_alias_3: (info: {
1211
843
  os: string;
1212
- }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
844
+ }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1213
845
  command: string;
1214
846
  description: string;
1215
847
  }>, useNativeTool: boolean) => string;
@@ -1290,7 +922,7 @@ export declare const getString: <T extends string>(args: Partial<Record<T, strin
1290
922
 
1291
923
  export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
1292
924
 
1293
- export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
925
+ export declare const handler: ToolHandler<typeof toolInfo, CommandProvider>;
1294
926
 
1295
927
  export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, InteractionProvider>;
1296
928
 
@@ -1300,15 +932,17 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
1300
932
 
1301
933
  export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
1302
934
 
1303
- export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
935
+ export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
1304
936
 
1305
- export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
937
+ export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, InteractionProvider>;
1306
938
 
1307
- export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, WebProvider>;
939
+ export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, any>;
1308
940
 
1309
- export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, any>;
941
+ export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, CommandProvider>;
1310
942
 
1311
- export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
943
+ export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, WebProvider>;
944
+
945
+ export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, any>;
1312
946
 
1313
947
  export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, FilesystemProvider>;
1314
948
 
@@ -1323,6 +957,14 @@ declare type Input = {
1323
957
  branchName: string;
1324
958
  };
1325
959
 
960
+ declare type Input_2 = {
961
+ pullRequestTitle?: string;
962
+ pullRequestDescription?: string;
963
+ commitMessages?: string;
964
+ commitRange?: string;
965
+ staged?: boolean;
966
+ };
967
+
1326
968
  declare type InteractionProvider = {
1327
969
  askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
1328
970
  attemptCompletion?: (result: string) => Promise<string | undefined>;
@@ -1331,7 +973,7 @@ export { InteractionProvider }
1331
973
  export { InteractionProvider as InteractionProvider_alias_1 }
1332
974
  export { InteractionProvider as InteractionProvider_alias_2 }
1333
975
 
1334
- export declare const isAvailable: (provider: InteractionProvider) => boolean;
976
+ export declare const isAvailable: (provider: CommandProvider) => boolean;
1335
977
 
1336
978
  export declare const isAvailable_alias_1: (provider: InteractionProvider) => boolean;
1337
979
 
@@ -1341,15 +983,17 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
1341
983
 
1342
984
  export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
1343
985
 
1344
- export declare const isAvailable_alias_2: (_provider: any) => boolean;
986
+ export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
987
+
988
+ export declare const isAvailable_alias_2: (_provider: InteractionProvider) => boolean;
1345
989
 
1346
- export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
990
+ export declare const isAvailable_alias_3: (_provider: any) => boolean;
1347
991
 
1348
- export declare const isAvailable_alias_4: (provider: WebProvider) => boolean;
992
+ export declare const isAvailable_alias_4: (provider: CommandProvider) => boolean;
1349
993
 
1350
- export declare const isAvailable_alias_5: (_provider: any) => boolean;
994
+ export declare const isAvailable_alias_5: (provider: WebProvider) => boolean;
1351
995
 
1352
- export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
996
+ export declare const isAvailable_alias_6: (_provider: any) => boolean;
1353
997
 
1354
998
  export declare const isAvailable_alias_7: (provider: FilesystemProvider) => boolean;
1355
999
 
@@ -1362,28 +1006,32 @@ export declare const isAvailable_alias_9: (provider: FilesystemProvider) => bool
1362
1006
  */
1363
1007
  export declare function join(...parts: string[]): string;
1364
1008
 
1365
- declare const makeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
1009
+ declare const makeAgentTool: <T extends AiToolDefinitionWithAgent<any, any>>(definition: T) => (options: SharedAgentOptions, params: GetInput<T>) => Promise<GetOutput<T>>;
1366
1010
  export { makeAgentTool }
1367
1011
  export { makeAgentTool as makeAgentTool_alias_1 }
1368
1012
 
1013
+ declare const makeMultiAgentTool: <T extends AiToolDefinitionWithMultiAgent<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
1014
+ export { makeMultiAgentTool }
1015
+ export { makeMultiAgentTool as makeMultiAgentTool_alias_1 }
1016
+
1369
1017
  declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
1370
1018
  export { makeTool }
1371
1019
  export { makeTool as makeTool_alias_1 }
1372
1020
 
1373
1021
  declare class MockProvider implements ToolProvider {
1374
- readFile(path: string): Promise<string>;
1375
- writeFile(path: string, content: string): Promise<void>;
1376
- removeFile(path: string): Promise<void>;
1377
- renameFile(sourcePath: string, targetPath: string): Promise<void>;
1378
- listFiles(path: string, recursive: boolean, maxCount: number): Promise<[string[], boolean]>;
1379
- searchFiles(path: string, regex: string, filePattern: string): Promise<string[]>;
1380
- executeCommand(command: string, needApprove: boolean): Promise<{
1022
+ readFile(_path: string): Promise<string>;
1023
+ writeFile(_path: string, _content: string): Promise<void>;
1024
+ removeFile(_path: string): Promise<void>;
1025
+ renameFile(_sourcePath: string, _targetPath: string): Promise<void>;
1026
+ listFiles(_path: string, _recursive: boolean, _maxCount: number): Promise<[string[], boolean]>;
1027
+ searchFiles(_path: string, _regex: string, _filePattern: string): Promise<string[]>;
1028
+ executeCommand(_command: string, _needApprove: boolean): Promise<{
1381
1029
  stdout: string;
1382
1030
  stderr: string;
1383
1031
  exitCode: number;
1384
1032
  }>;
1385
- askFollowupQuestion(question: string, options?: string[]): Promise<string>;
1386
- attemptCompletion(result: string): Promise<string | undefined>;
1033
+ askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
1034
+ attemptCompletion(_result: string): Promise<string | undefined>;
1387
1035
  }
1388
1036
  export { MockProvider }
1389
1037
  export { MockProvider as MockProvider_alias_1 }
@@ -1429,6 +1077,11 @@ declare type Output = {
1429
1077
  description: string;
1430
1078
  };
1431
1079
 
1080
+ declare type Output_2 = {
1081
+ overview: string;
1082
+ specificReviews: SpecificReview[];
1083
+ };
1084
+
1432
1085
  /**
1433
1086
  * Parse an assistant's message into an array of text content and tool use content.
1434
1087
  *
@@ -1528,6 +1181,7 @@ export { ReplaceResult as ReplaceResult_alias_1 }
1528
1181
  declare const responsePrompts: {
1529
1182
  readonly errorInvokeTool: (tool: string, error: unknown) => string;
1530
1183
  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";
1184
+ readonly requireUseToolNative: "Error: No tool use detected. You MUST use a tool before proceeding.\n";
1531
1185
  readonly toolResults: (tool: string, result: UserContent_2) => Array<TextPart | ImagePart | FilePart>;
1532
1186
  readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
1533
1187
  };
@@ -1537,6 +1191,23 @@ export { responsePrompts as responsePrompts_alias_2 }
1537
1191
 
1538
1192
  export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before Retrying\n - Analyze previous attempt's failure\n - Consider alternative approaches\n - Check if similar issues were fixed\n - Verify no new issues were introduced\n\n2. When to Retry\n - Error message changed but issue persists\n - New information available about the root cause\n - Different fixing strategy available\n - Previous attempt partially successful\n\n3. When to Stop\n - Maximum retry limit reached\n - Same error occurs repeatedly\n - Fix would require major refactoring\n - Issue requires human intervention\n\n4. After Maximum Retries\n - Document attempted solutions\n - Explain why the issue remains\n - Suggest manual intervention steps\n - Report any partial improvements";
1539
1193
 
1194
+ declare const reviewDiff: (options: SharedAgentOptions, params: {
1195
+ pullRequestTitle?: string;
1196
+ pullRequestDescription?: string;
1197
+ commitMessages?: string;
1198
+ commitRange?: string;
1199
+ staged?: boolean;
1200
+ }) => Promise<{
1201
+ overview: string;
1202
+ specificReviews: {
1203
+ file: string;
1204
+ lines: string;
1205
+ review: string;
1206
+ }[];
1207
+ }>;
1208
+ export { reviewDiff }
1209
+ export { reviewDiff as reviewDiff_alias_1 }
1210
+
1540
1211
  export declare const rules: (toolNamePrefix: string) => string;
1541
1212
 
1542
1213
  declare type SharedAgentOptions = {
@@ -1563,6 +1234,12 @@ export { SharedAgentOptions }
1563
1234
  export { SharedAgentOptions as SharedAgentOptions_alias_1 }
1564
1235
  export { SharedAgentOptions as SharedAgentOptions_alias_2 }
1565
1236
 
1237
+ declare type SpecificReview = {
1238
+ file: string;
1239
+ lines: string;
1240
+ review: string;
1241
+ };
1242
+
1566
1243
  declare const systemInformation: (info: {
1567
1244
  os: string;
1568
1245
  }) => string;
@@ -1646,7 +1323,7 @@ export { TaskEventKind as TaskEventKind_alias_2 }
1646
1323
  */
1647
1324
  declare interface TaskEventStartRequest extends TaskEventBase {
1648
1325
  kind: TaskEventKind.StartRequest;
1649
- userMessage: UserContent;
1326
+ userMessage: ModelMessage;
1650
1327
  }
1651
1328
  export { TaskEventStartRequest }
1652
1329
  export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
@@ -1680,6 +1357,7 @@ export { TaskEventText as TaskEventText_alias_2 }
1680
1357
  declare interface TaskEventTool extends TaskEventBase {
1681
1358
  kind: TaskEventKind.ToolUse | TaskEventKind.ToolReply | TaskEventKind.ToolInvalid | TaskEventKind.ToolError | TaskEventKind.ToolInterrupted;
1682
1359
  tool: string;
1360
+ content: any;
1683
1361
  }
1684
1362
  export { TaskEventTool }
1685
1363
  export { TaskEventTool as TaskEventTool_alias_1 }
@@ -1739,10 +1417,7 @@ export { TextContent as TextContent_alias_2 }
1739
1417
 
1740
1418
  declare type ToolExample = {
1741
1419
  description: string;
1742
- parameters: {
1743
- name: string;
1744
- value: ToolParameterValue;
1745
- }[];
1420
+ input: Record<string, ToolParameterValue>;
1746
1421
  };
1747
1422
  export { ToolExample }
1748
1423
  export { ToolExample as ToolExample_alias_1 }
@@ -1751,7 +1426,7 @@ declare type ToolFormat = 'native' | 'polka-codes';
1751
1426
  export { ToolFormat }
1752
1427
  export { ToolFormat as ToolFormat_alias_1 }
1753
1428
 
1754
- declare type ToolHandler<T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1429
+ declare type ToolHandler<_T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1755
1430
  export { ToolHandler }
1756
1431
  export { ToolHandler as ToolHandler_alias_1 }
1757
1432
 
@@ -1766,6 +1441,17 @@ export { ToolInfo }
1766
1441
  export { ToolInfo as ToolInfo_alias_1 }
1767
1442
 
1768
1443
  export declare const toolInfo: {
1444
+ readonly name: "git_diff";
1445
+ readonly description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
1446
+ readonly parameters: z.ZodObject<{
1447
+ staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1448
+ commitRange: z.ZodOptional<z.ZodString>;
1449
+ file: z.ZodOptional<z.ZodString>;
1450
+ }, z.core.$strip>;
1451
+ readonly permissionLevel: PermissionLevel.Read;
1452
+ };
1453
+
1454
+ export declare const toolInfo_alias_1: {
1769
1455
  readonly name: "ask_followup_question";
1770
1456
  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.";
1771
1457
  readonly parameters: z.ZodObject<{
@@ -1774,111 +1460,30 @@ export declare const toolInfo: {
1774
1460
  options: z.ZodDefault<z.ZodArray<z.ZodString>>;
1775
1461
  }, z.core.$strip>>;
1776
1462
  }, z.core.$strip>;
1777
- readonly examples: [{
1778
- readonly description: "Single clarifying question (no options)";
1779
- readonly parameters: [{
1780
- readonly name: "questions";
1781
- readonly value: {
1782
- readonly prompt: "What is the target deployment environment?";
1783
- };
1784
- }];
1785
- }, {
1786
- readonly description: "Single question with multiple-choice options";
1787
- readonly parameters: [{
1788
- readonly name: "questions";
1789
- readonly value: {
1790
- readonly prompt: "Which frontend framework are you using?";
1791
- readonly options: ["React", "Angular", "Vue", "Svelte"];
1792
- };
1793
- }];
1794
- }, {
1795
- readonly description: "Two related questions in one call";
1796
- readonly parameters: [{
1797
- readonly name: "questions";
1798
- readonly value: [{
1799
- readonly prompt: "What type of application are you building?";
1800
- }, {
1801
- readonly prompt: "Preferred programming language?";
1802
- readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
1803
- }];
1804
- }];
1805
- }, {
1806
- readonly description: "Binary (yes/no) confirmation";
1807
- readonly parameters: [{
1808
- readonly name: "questions";
1809
- readonly value: {
1810
- readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
1811
- readonly options: ["Yes", "No"];
1812
- };
1813
- }];
1814
- }];
1815
1463
  readonly permissionLevel: PermissionLevel.None;
1816
1464
  };
1817
1465
 
1818
- export declare const toolInfo_alias_1: {
1819
- readonly name: "attempt_completion";
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.";
1466
+ export declare const toolInfo_alias_10: {
1467
+ readonly name: "rename_file";
1468
+ readonly description: "Request to rename a file from source path to target path.";
1821
1469
  readonly parameters: z.ZodObject<{
1822
- result: z.ZodString;
1470
+ source_path: z.ZodString;
1471
+ target_path: z.ZodString;
1823
1472
  }, z.core.$strip>;
1824
- readonly examples: [{
1825
- readonly description: "Request to present the result of the task";
1826
- readonly parameters: [{
1827
- readonly name: "result";
1828
- readonly value: "Your final result description here";
1829
- }];
1830
- }];
1831
- readonly permissionLevel: PermissionLevel.None;
1473
+ readonly permissionLevel: PermissionLevel.Write;
1832
1474
  };
1833
1475
 
1834
- export declare const toolInfo_alias_10: {
1476
+ export declare const toolInfo_alias_11: {
1835
1477
  readonly name: "replace_in_file";
1836
1478
  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.";
1837
1479
  readonly parameters: z.ZodObject<{
1838
1480
  path: z.ZodString;
1839
1481
  diff: z.ZodString;
1840
1482
  }, z.core.$strip>;
1841
- readonly examples: [{
1842
- readonly description: "Request to replace sections of content in a file";
1843
- readonly parameters: [{
1844
- readonly name: "path";
1845
- readonly value: "src/main.js";
1846
- }, {
1847
- readonly name: "diff";
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";
1849
- }];
1850
- }, {
1851
- readonly description: "Request to perform a simple, single-line replacement";
1852
- readonly parameters: [{
1853
- readonly name: "path";
1854
- readonly value: "src/config.js";
1855
- }, {
1856
- readonly name: "diff";
1857
- readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
1858
- }];
1859
- }, {
1860
- readonly description: "Request to add a new function to a file";
1861
- readonly parameters: [{
1862
- readonly name: "path";
1863
- readonly value: "src/utils.js";
1864
- }, {
1865
- readonly name: "diff";
1866
- readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
1867
- }];
1868
- }, {
1869
- readonly description: "Request to delete a block of code from a file";
1870
- readonly parameters: [{
1871
- readonly name: "path";
1872
- readonly value: "src/app.js";
1873
- }, {
1874
- readonly name: "diff";
1875
- readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
1876
- }];
1877
- }];
1878
1483
  readonly permissionLevel: PermissionLevel.Write;
1879
1484
  };
1880
1485
 
1881
- export declare const toolInfo_alias_11: {
1486
+ export declare const toolInfo_alias_12: {
1882
1487
  readonly name: "search_files";
1883
1488
  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.";
1884
1489
  readonly parameters: z.ZodObject<{
@@ -1886,43 +1491,29 @@ export declare const toolInfo_alias_11: {
1886
1491
  regex: z.ZodString;
1887
1492
  filePattern: z.ZodOptional<z.ZodString>;
1888
1493
  }, z.core.$strip>;
1889
- readonly examples: [{
1890
- readonly description: "Request to perform a regex search across files";
1891
- readonly parameters: [{
1892
- readonly name: "path";
1893
- readonly value: "src";
1894
- }, {
1895
- readonly name: "regex";
1896
- readonly value: "^components/";
1897
- }, {
1898
- readonly name: "filePattern";
1899
- readonly value: "*.ts,*.tsx";
1900
- }];
1901
- }];
1902
1494
  readonly permissionLevel: PermissionLevel.Read;
1903
1495
  };
1904
1496
 
1905
- export declare const toolInfo_alias_12: {
1497
+ export declare const toolInfo_alias_13: {
1906
1498
  readonly name: "write_to_file";
1907
1499
  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.";
1908
1500
  readonly parameters: z.ZodObject<{
1909
1501
  path: z.ZodString;
1910
1502
  content: z.ZodString;
1911
1503
  }, z.core.$strip>;
1912
- readonly examples: [{
1913
- readonly description: "Request to write content to a file";
1914
- readonly parameters: [{
1915
- readonly name: "path";
1916
- readonly value: "src/main.js";
1917
- }, {
1918
- readonly name: "content";
1919
- readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
1920
- }];
1921
- }];
1922
1504
  readonly permissionLevel: PermissionLevel.Write;
1923
1505
  };
1924
1506
 
1925
1507
  export declare const toolInfo_alias_2: {
1508
+ readonly name: "attempt_completion";
1509
+ 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.";
1510
+ readonly parameters: z.ZodObject<{
1511
+ result: z.ZodString;
1512
+ }, z.core.$strip>;
1513
+ readonly permissionLevel: PermissionLevel.None;
1514
+ };
1515
+
1516
+ export declare const toolInfo_alias_3: {
1926
1517
  readonly name: "delegate";
1927
1518
  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.";
1928
1519
  readonly parameters: z.ZodObject<{
@@ -1931,74 +1522,29 @@ export declare const toolInfo_alias_2: {
1931
1522
  context: z.ZodString;
1932
1523
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
1933
1524
  }, z.core.$strip>;
1934
- readonly examples: [{
1935
- readonly description: "Delegate a code analysis task to the analyzer agent";
1936
- readonly parameters: [{
1937
- readonly name: "agentName";
1938
- readonly value: "analyzer";
1939
- }, {
1940
- readonly name: "task";
1941
- readonly value: "Analyze the authentication implementation";
1942
- }, {
1943
- readonly name: "context";
1944
- readonly value: "Need to understand the security implications of the current auth system";
1945
- }, {
1946
- readonly name: "files";
1947
- readonly value: "src/auth/login.ts,src/auth/types.ts";
1948
- }];
1949
- }];
1950
1525
  readonly permissionLevel: PermissionLevel.None;
1951
1526
  };
1952
1527
 
1953
- export declare const toolInfo_alias_3: {
1528
+ export declare const toolInfo_alias_4: {
1954
1529
  readonly name: "execute_command";
1955
1530
  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.";
1956
1531
  readonly parameters: z.ZodObject<{
1957
1532
  command: z.ZodString;
1958
1533
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
1959
1534
  }, z.core.$strip>;
1960
- readonly examples: [{
1961
- readonly description: "Make a build";
1962
- readonly parameters: [{
1963
- readonly name: "command";
1964
- readonly value: "npm run build";
1965
- }, {
1966
- readonly name: "requiresApproval";
1967
- readonly value: "false";
1968
- }];
1969
- }];
1970
1535
  readonly permissionLevel: PermissionLevel.Arbitrary;
1971
1536
  };
1972
1537
 
1973
- export declare const toolInfo_alias_4: {
1538
+ export declare const toolInfo_alias_5: {
1974
1539
  readonly name: "fetch_url";
1975
1540
  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.";
1976
1541
  readonly parameters: z.ZodObject<{
1977
1542
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
1978
1543
  }, z.core.$strip>;
1979
- readonly examples: [{
1980
- readonly description: "Fetch a single webpage";
1981
- readonly parameters: [{
1982
- readonly name: "url";
1983
- readonly value: "https://example.com";
1984
- }];
1985
- }, {
1986
- readonly description: "Fetch multiple webpages";
1987
- readonly parameters: [{
1988
- readonly name: "url";
1989
- readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
1990
- }];
1991
- }, {
1992
- readonly description: "Fetch a raw file from GitHub";
1993
- readonly parameters: [{
1994
- readonly name: "url";
1995
- readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
1996
- }];
1997
- }];
1998
1544
  readonly permissionLevel: PermissionLevel.Read;
1999
1545
  };
2000
1546
 
2001
- export declare const toolInfo_alias_5: {
1547
+ export declare const toolInfo_alias_6: {
2002
1548
  readonly name: "hand_over";
2003
1549
  readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
2004
1550
  readonly parameters: z.ZodObject<{
@@ -2007,26 +1553,10 @@ export declare const toolInfo_alias_5: {
2007
1553
  context: z.ZodString;
2008
1554
  files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
2009
1555
  }, z.core.$strip>;
2010
- readonly examples: [{
2011
- readonly description: "Hand over a coding task to the coder agent";
2012
- readonly parameters: [{
2013
- readonly name: "agentName";
2014
- readonly value: "coder";
2015
- }, {
2016
- readonly name: "task";
2017
- readonly value: "Implement the login feature";
2018
- }, {
2019
- readonly name: "context";
2020
- readonly value: "We need a secure login system with email and password";
2021
- }, {
2022
- readonly name: "files";
2023
- readonly value: "src/auth/login.ts,src/auth/types.ts";
2024
- }];
2025
- }];
2026
1556
  readonly permissionLevel: PermissionLevel.None;
2027
1557
  };
2028
1558
 
2029
- export declare const toolInfo_alias_6: {
1559
+ export declare const toolInfo_alias_7: {
2030
1560
  readonly name: "list_files";
2031
1561
  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.";
2032
1562
  readonly parameters: z.ZodObject<{
@@ -2034,74 +1564,24 @@ export declare const toolInfo_alias_6: {
2034
1564
  maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
2035
1565
  recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
2036
1566
  }, z.core.$strip>;
2037
- readonly examples: [{
2038
- readonly description: "Request to list files";
2039
- readonly parameters: [{
2040
- readonly name: "path";
2041
- readonly value: "src";
2042
- }, {
2043
- readonly name: "maxCount";
2044
- readonly value: "100";
2045
- }];
2046
- }];
2047
1567
  readonly permissionLevel: PermissionLevel.Read;
2048
1568
  };
2049
1569
 
2050
- export declare const toolInfo_alias_7: {
1570
+ export declare const toolInfo_alias_8: {
2051
1571
  readonly name: "read_file";
2052
1572
  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.";
2053
1573
  readonly parameters: z.ZodObject<{
2054
1574
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
2055
1575
  }, z.core.$strip>;
2056
- readonly examples: [{
2057
- readonly description: "Request to read the contents of a file";
2058
- readonly parameters: [{
2059
- readonly name: "path";
2060
- readonly value: "src/main.js";
2061
- }];
2062
- }, {
2063
- readonly description: "Request to read multiple files";
2064
- readonly parameters: [{
2065
- readonly name: "path";
2066
- readonly value: "src/main.js,src/index.js";
2067
- }];
2068
- }];
2069
1576
  readonly permissionLevel: PermissionLevel.Read;
2070
1577
  };
2071
1578
 
2072
- export declare const toolInfo_alias_8: {
1579
+ export declare const toolInfo_alias_9: {
2073
1580
  readonly name: "remove_file";
2074
1581
  readonly description: "Request to remove a file at the specified path.";
2075
1582
  readonly parameters: z.ZodObject<{
2076
1583
  path: z.ZodString;
2077
1584
  }, z.core.$strip>;
2078
- readonly examples: [{
2079
- readonly description: "Request to remove a file";
2080
- readonly parameters: [{
2081
- readonly name: "path";
2082
- readonly value: "src/main.js";
2083
- }];
2084
- }];
2085
- readonly permissionLevel: PermissionLevel.Write;
2086
- };
2087
-
2088
- export declare const toolInfo_alias_9: {
2089
- readonly name: "rename_file";
2090
- readonly description: "Request to rename a file from source path to target path.";
2091
- readonly parameters: z.ZodObject<{
2092
- source_path: z.ZodString;
2093
- target_path: z.ZodString;
2094
- }, z.core.$strip>;
2095
- readonly examples: [{
2096
- readonly description: "Request to rename a file";
2097
- readonly parameters: [{
2098
- readonly name: "source_path";
2099
- readonly value: "src/old-name.js";
2100
- }, {
2101
- readonly name: "target_path";
2102
- readonly value: "src/new-name.js";
2103
- }];
2104
- }];
2105
1585
  readonly permissionLevel: PermissionLevel.Write;
2106
1586
  };
2107
1587
 
@@ -2109,7 +1589,6 @@ declare type ToolInfoV2 = {
2109
1589
  name: string;
2110
1590
  description: string;
2111
1591
  parameters: z.ZodObject<any>;
2112
- examples?: ToolExample[];
2113
1592
  permissionLevel: PermissionLevel;
2114
1593
  };
2115
1594
  export { ToolInfoV2 }
@@ -2195,10 +1674,12 @@ declare type ToolResponseOrToolPause = {
2195
1674
  type: 'response';
2196
1675
  tool: string;
2197
1676
  response: UserContent;
1677
+ id?: string;
2198
1678
  } | {
2199
1679
  type: 'pause';
2200
1680
  tool: string;
2201
1681
  object: any;
1682
+ id?: string;
2202
1683
  };
2203
1684
  export { ToolResponseOrToolPause }
2204
1685
  export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_1 }
@@ -2232,6 +1713,7 @@ export { ToolResponseType }
2232
1713
  export { ToolResponseType as ToolResponseType_alias_1 }
2233
1714
 
2234
1715
  declare interface ToolUse {
1716
+ id?: string;
2235
1717
  type: 'tool_use';
2236
1718
  name: string;
2237
1719
  params: Record<string, any>;
@@ -2240,7 +1722,7 @@ export { ToolUse }
2240
1722
  export { ToolUse as ToolUse_alias_1 }
2241
1723
  export { ToolUse as ToolUse_alias_2 }
2242
1724
 
2243
- declare const toolUsePrompt: (tools: ToolInfo[], toolNamePrefix: string) => string;
1725
+ declare const toolUsePrompt: (tools: FullToolInfoV2[], toolNamePrefix: string) => string;
2244
1726
  export { toolUsePrompt }
2245
1727
  export { toolUsePrompt as toolUsePrompt_alias_1 }
2246
1728
  export { toolUsePrompt as toolUsePrompt_alias_2 }
@@ -2288,6 +1770,8 @@ declare class UsageMeter {
2288
1770
  }>): void;
2289
1771
  /** Manually bump the message count (useful if you record some calls without token info). */
2290
1772
  incrementMessageCount(n?: number): void;
1773
+ /** Reset the running totals. */
1774
+ resetUsage(): void;
2291
1775
  /** Return true once either messages or cost exceed the configured caps. */
2292
1776
  isLimitExceeded(): {
2293
1777
  messageCount: boolean;