@polka-codes/core 0.9.1 → 0.9.2

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.
@@ -135,14 +135,14 @@ export declare namespace allTools {
135
135
  _default_3 as delegate,
136
136
  _default_4 as executeCommand,
137
137
  _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
138
+ _default_6 as handOver,
139
+ _default_7 as listFiles,
140
+ _default_8 as readFile,
141
+ _default_9 as removeFile,
142
+ _default_10 as renameFile,
143
+ _default_11 as replaceInFile,
144
+ _default_12 as searchFiles,
145
+ _default_13 as writeToFile
146
146
  }
147
147
  }
148
148
 
@@ -197,7 +197,7 @@ export declare const basePrompt = "You are a highly skilled software engineer sp
197
197
 
198
198
  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
199
 
200
- declare const capabilities: (toolNamePrefix: string) => string;
200
+ declare const capabilities: (_toolNamePrefix: string) => string;
201
201
  export { capabilities }
202
202
  export { capabilities as capabilities_alias_1 }
203
203
  export { capabilities as capabilities_alias_2 }
@@ -209,7 +209,7 @@ export { capabilities as capabilities_alias_2 }
209
209
  declare class CodeFixerAgent extends AgentBase {
210
210
  #private;
211
211
  constructor(options: CodeFixerAgentOptions);
212
- protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
212
+ protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
213
213
  }
214
214
  export { CodeFixerAgent }
215
215
  export { CodeFixerAgent as CodeFixerAgent_alias_1 }
@@ -238,7 +238,7 @@ export declare const codeFixingStrategies = "\n====\n\nCODE FIXING STRATEGIES\n\
238
238
  */
239
239
  declare class CoderAgent extends AgentBase {
240
240
  constructor(options: CoderAgentOptions);
241
- protected onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
241
+ protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
242
242
  }
243
243
  export { CoderAgent }
244
244
  export { CoderAgent as CoderAgent_alias_1 }
@@ -467,187 +467,241 @@ export { _default as default_alias_4 }
467
467
 
468
468
  declare const _default_10: {
469
469
  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.";
470
+ readonly name: "rename_file";
471
+ readonly description: "Request to rename a file from source path to target path.";
472
472
  readonly parameters: z.ZodObject<{
473
- path: z.ZodString;
474
- content: z.ZodString;
473
+ source_path: z.ZodString;
474
+ target_path: z.ZodString;
475
475
  }, z.core.$strip>;
476
476
  readonly examples: [{
477
- readonly description: "Request to write content to a file";
477
+ readonly description: "Request to rename a file";
478
478
  readonly parameters: [{
479
- readonly name: "path";
480
- readonly value: "src/main.js";
479
+ readonly name: "source_path";
480
+ readonly value: "src/old-name.js";
481
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";
482
+ readonly name: "target_path";
483
+ readonly value: "src/new-name.js";
484
484
  }];
485
485
  }];
486
486
  readonly permissionLevel: PermissionLevel.Write;
487
487
  }, FilesystemProvider>;
488
488
  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.";
489
+ name: "rename_file";
490
+ description: "Request to rename a file from source path to target path.";
491
491
  parameters: z.ZodObject<{
492
- path: z.ZodString;
493
- content: z.ZodString;
492
+ source_path: z.ZodString;
493
+ target_path: z.ZodString;
494
494
  }, z.core.$strip>;
495
495
  examples: [{
496
- readonly description: "Request to write content to a file";
496
+ readonly description: "Request to rename a file";
497
497
  readonly parameters: [{
498
- readonly name: "path";
499
- readonly value: "src/main.js";
498
+ readonly name: "source_path";
499
+ readonly value: "src/old-name.js";
500
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";
501
+ readonly name: "target_path";
502
+ readonly value: "src/new-name.js";
503
503
  }];
504
504
  }];
505
505
  permissionLevel: PermissionLevel.Write;
506
506
  };
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 }
507
+ export { _default_10 as default_alias_13 }
508
+ export { _default_10 as renameFile }
509
+ export { _default_10 as renameFile_alias_1 }
510
+ export { _default_10 as renameFile_alias_2 }
511
511
 
512
512
  declare const _default_11: {
513
513
  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.";
514
+ readonly name: "replace_in_file";
515
+ 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
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>>>;
517
+ path: z.ZodString;
518
+ diff: z.ZodString;
521
519
  }, z.core.$strip>;
522
520
  readonly examples: [{
523
- readonly description: "Hand over a coding task to the coder agent";
521
+ readonly description: "Request to replace sections of content in a file";
524
522
  readonly parameters: [{
525
- readonly name: "agentName";
526
- readonly value: "coder";
523
+ readonly name: "path";
524
+ readonly value: "src/main.js";
527
525
  }, {
528
- readonly name: "task";
529
- readonly value: "Implement the login feature";
526
+ readonly name: "diff";
527
+ 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";
528
+ }];
529
+ }, {
530
+ readonly description: "Request to perform a simple, single-line replacement";
531
+ readonly parameters: [{
532
+ readonly name: "path";
533
+ readonly value: "src/config.js";
530
534
  }, {
531
- readonly name: "context";
532
- readonly value: "We need a secure login system with email and password";
535
+ readonly name: "diff";
536
+ readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
537
+ }];
538
+ }, {
539
+ readonly description: "Request to add a new function to a file";
540
+ readonly parameters: [{
541
+ readonly name: "path";
542
+ readonly value: "src/utils.js";
533
543
  }, {
534
- readonly name: "files";
535
- readonly value: "src/auth/login.ts,src/auth/types.ts";
544
+ readonly name: "diff";
545
+ readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
546
+ }];
547
+ }, {
548
+ readonly description: "Request to delete a block of code from a file";
549
+ readonly parameters: [{
550
+ readonly name: "path";
551
+ readonly value: "src/app.js";
552
+ }, {
553
+ readonly name: "diff";
554
+ readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
536
555
  }];
537
556
  }];
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.";
557
+ readonly permissionLevel: PermissionLevel.Write;
558
+ }, FilesystemProvider>;
559
+ isAvailable: (provider: FilesystemProvider) => boolean;
560
+ name: "replace_in_file";
561
+ 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
562
  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>>>;
563
+ path: z.ZodString;
564
+ diff: z.ZodString;
548
565
  }, z.core.$strip>;
549
566
  examples: [{
550
- readonly description: "Hand over a coding task to the coder agent";
567
+ readonly description: "Request to replace sections of content in a file";
551
568
  readonly parameters: [{
552
- readonly name: "agentName";
553
- readonly value: "coder";
569
+ readonly name: "path";
570
+ readonly value: "src/main.js";
554
571
  }, {
555
- readonly name: "task";
556
- readonly value: "Implement the login feature";
572
+ readonly name: "diff";
573
+ 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";
574
+ }];
575
+ }, {
576
+ readonly description: "Request to perform a simple, single-line replacement";
577
+ readonly parameters: [{
578
+ readonly name: "path";
579
+ readonly value: "src/config.js";
557
580
  }, {
558
- readonly name: "context";
559
- readonly value: "We need a secure login system with email and password";
581
+ readonly name: "diff";
582
+ readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
583
+ }];
584
+ }, {
585
+ readonly description: "Request to add a new function to a file";
586
+ readonly parameters: [{
587
+ readonly name: "path";
588
+ readonly value: "src/utils.js";
560
589
  }, {
561
- readonly name: "files";
562
- readonly value: "src/auth/login.ts,src/auth/types.ts";
590
+ readonly name: "diff";
591
+ readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
592
+ }];
593
+ }, {
594
+ readonly description: "Request to delete a block of code from a file";
595
+ readonly parameters: [{
596
+ readonly name: "path";
597
+ readonly value: "src/app.js";
598
+ }, {
599
+ readonly name: "diff";
600
+ readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
563
601
  }];
564
602
  }];
565
- permissionLevel: PermissionLevel.None;
603
+ permissionLevel: PermissionLevel.Write;
566
604
  };
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 }
605
+ export { _default_11 as default_alias_14 }
606
+ export { _default_11 as replaceInFile }
607
+ export { _default_11 as replaceInFile_alias_1 }
608
+ export { _default_11 as replaceInFile_alias_2 }
571
609
 
572
610
  declare const _default_12: {
573
611
  handler: ToolHandler<{
574
- readonly name: "remove_file";
575
- readonly description: "Request to remove a file at the specified path.";
612
+ readonly name: "search_files";
613
+ 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
614
  readonly parameters: z.ZodObject<{
577
615
  path: z.ZodString;
616
+ regex: z.ZodString;
617
+ filePattern: z.ZodOptional<z.ZodString>;
578
618
  }, z.core.$strip>;
579
619
  readonly examples: [{
580
- readonly description: "Request to remove a file";
620
+ readonly description: "Request to perform a regex search across files";
581
621
  readonly parameters: [{
582
622
  readonly name: "path";
583
- readonly value: "src/main.js";
623
+ readonly value: "src";
624
+ }, {
625
+ readonly name: "regex";
626
+ readonly value: "^components/";
627
+ }, {
628
+ readonly name: "filePattern";
629
+ readonly value: "*.ts,*.tsx";
584
630
  }];
585
631
  }];
586
- readonly permissionLevel: PermissionLevel.Write;
632
+ readonly permissionLevel: PermissionLevel.Read;
587
633
  }, FilesystemProvider>;
588
634
  isAvailable: (provider: FilesystemProvider) => boolean;
589
- name: "remove_file";
590
- description: "Request to remove a file at the specified path.";
635
+ name: "search_files";
636
+ 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
637
  parameters: z.ZodObject<{
592
638
  path: z.ZodString;
639
+ regex: z.ZodString;
640
+ filePattern: z.ZodOptional<z.ZodString>;
593
641
  }, z.core.$strip>;
594
642
  examples: [{
595
- readonly description: "Request to remove a file";
643
+ readonly description: "Request to perform a regex search across files";
596
644
  readonly parameters: [{
597
645
  readonly name: "path";
598
- readonly value: "src/main.js";
646
+ readonly value: "src";
647
+ }, {
648
+ readonly name: "regex";
649
+ readonly value: "^components/";
650
+ }, {
651
+ readonly name: "filePattern";
652
+ readonly value: "*.ts,*.tsx";
599
653
  }];
600
654
  }];
601
- permissionLevel: PermissionLevel.Write;
655
+ permissionLevel: PermissionLevel.Read;
602
656
  };
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 }
657
+ export { _default_12 as default_alias_15 }
658
+ export { _default_12 as searchFiles }
659
+ export { _default_12 as searchFiles_alias_1 }
660
+ export { _default_12 as searchFiles_alias_2 }
607
661
 
608
662
  declare const _default_13: {
609
663
  handler: ToolHandler<{
610
- readonly name: "rename_file";
611
- readonly description: "Request to rename a file from source path to target path.";
664
+ readonly name: "write_to_file";
665
+ 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
666
  readonly parameters: z.ZodObject<{
613
- source_path: z.ZodString;
614
- target_path: z.ZodString;
667
+ path: z.ZodString;
668
+ content: z.ZodString;
615
669
  }, z.core.$strip>;
616
670
  readonly examples: [{
617
- readonly description: "Request to rename a file";
671
+ readonly description: "Request to write content to a file";
618
672
  readonly parameters: [{
619
- readonly name: "source_path";
620
- readonly value: "src/old-name.js";
673
+ readonly name: "path";
674
+ readonly value: "src/main.js";
621
675
  }, {
622
- readonly name: "target_path";
623
- readonly value: "src/new-name.js";
676
+ readonly name: "content";
677
+ 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";
624
678
  }];
625
679
  }];
626
680
  readonly permissionLevel: PermissionLevel.Write;
627
681
  }, FilesystemProvider>;
628
682
  isAvailable: (provider: FilesystemProvider) => boolean;
629
- name: "rename_file";
630
- description: "Request to rename a file from source path to target path.";
683
+ name: "write_to_file";
684
+ 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
685
  parameters: z.ZodObject<{
632
- source_path: z.ZodString;
633
- target_path: z.ZodString;
686
+ path: z.ZodString;
687
+ content: z.ZodString;
634
688
  }, z.core.$strip>;
635
689
  examples: [{
636
- readonly description: "Request to rename a file";
690
+ readonly description: "Request to write content to a file";
637
691
  readonly parameters: [{
638
- readonly name: "source_path";
639
- readonly value: "src/old-name.js";
692
+ readonly name: "path";
693
+ readonly value: "src/main.js";
640
694
  }, {
641
- readonly name: "target_path";
642
- readonly value: "src/new-name.js";
695
+ readonly name: "content";
696
+ 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";
643
697
  }];
644
698
  }];
645
699
  permissionLevel: PermissionLevel.Write;
646
700
  };
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 }
701
+ export { _default_13 as default_alias_16 }
702
+ export { _default_13 as writeToFile }
703
+ export { _default_13 as writeToFile_alias_1 }
704
+ export { _default_13 as writeToFile_alias_2 }
651
705
 
652
706
  declare const _default_2: {
653
707
  handler: ToolHandler<{
@@ -665,7 +719,7 @@ declare const _default_2: {
665
719
  }];
666
720
  readonly permissionLevel: PermissionLevel.None;
667
721
  }, InteractionProvider>;
668
- isAvailable: (provider: InteractionProvider) => boolean;
722
+ isAvailable: (_provider: InteractionProvider) => boolean;
669
723
  name: "attempt_completion";
670
724
  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
725
  parameters: z.ZodObject<{
@@ -850,6 +904,66 @@ export { _default_5 as fetchUrl_alias_1 }
850
904
  export { _default_5 as fetchUrl_alias_2 }
851
905
 
852
906
  declare const _default_6: {
907
+ handler: ToolHandler<{
908
+ readonly name: "hand_over";
909
+ readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
910
+ readonly parameters: z.ZodObject<{
911
+ agentName: z.ZodString;
912
+ task: z.ZodString;
913
+ context: z.ZodString;
914
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
915
+ }, z.core.$strip>;
916
+ readonly examples: [{
917
+ readonly description: "Hand over a coding task to the coder agent";
918
+ readonly parameters: [{
919
+ readonly name: "agentName";
920
+ readonly value: "coder";
921
+ }, {
922
+ readonly name: "task";
923
+ readonly value: "Implement the login feature";
924
+ }, {
925
+ readonly name: "context";
926
+ readonly value: "We need a secure login system with email and password";
927
+ }, {
928
+ readonly name: "files";
929
+ readonly value: "src/auth/login.ts,src/auth/types.ts";
930
+ }];
931
+ }];
932
+ readonly permissionLevel: PermissionLevel.None;
933
+ }, any>;
934
+ isAvailable: (_provider: any) => boolean;
935
+ name: "hand_over";
936
+ description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
937
+ parameters: z.ZodObject<{
938
+ agentName: z.ZodString;
939
+ task: z.ZodString;
940
+ context: z.ZodString;
941
+ files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
942
+ }, z.core.$strip>;
943
+ examples: [{
944
+ readonly description: "Hand over a coding task to the coder agent";
945
+ readonly parameters: [{
946
+ readonly name: "agentName";
947
+ readonly value: "coder";
948
+ }, {
949
+ readonly name: "task";
950
+ readonly value: "Implement the login feature";
951
+ }, {
952
+ readonly name: "context";
953
+ readonly value: "We need a secure login system with email and password";
954
+ }, {
955
+ readonly name: "files";
956
+ readonly value: "src/auth/login.ts,src/auth/types.ts";
957
+ }];
958
+ }];
959
+ permissionLevel: PermissionLevel.None;
960
+ };
961
+ export { _default_6 as default_alias_9 }
962
+ export { _default_6 as handOver }
963
+ export { _default_6 as handOver_alias_1 }
964
+ export { _default_6 as handOver_alias_2 }
965
+
966
+ declare const _default_7: {
853
967
  handler: ToolHandler<{
854
968
  readonly name: "list_files";
855
969
  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.";
@@ -890,12 +1004,12 @@ declare const _default_6: {
890
1004
  }];
891
1005
  permissionLevel: PermissionLevel.Read;
892
1006
  };
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 }
1007
+ export { _default_7 as default_alias_10 }
1008
+ export { _default_7 as listFiles }
1009
+ export { _default_7 as listFiles_alias_1 }
1010
+ export { _default_7 as listFiles_alias_2 }
897
1011
 
898
- declare const _default_7: {
1012
+ declare const _default_8: {
899
1013
  handler: ToolHandler<{
900
1014
  readonly name: "read_file";
901
1015
  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.";
@@ -938,160 +1052,46 @@ declare const _default_7: {
938
1052
  }];
939
1053
  permissionLevel: PermissionLevel.Read;
940
1054
  };
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 }
1055
+ export { _default_8 as default_alias_11 }
1056
+ export { _default_8 as readFile }
1057
+ export { _default_8 as readFile_alias_1 }
1058
+ export { _default_8 as readFile_alias_2 }
945
1059
 
946
- declare const _default_8: {
1060
+ declare const _default_9: {
947
1061
  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.";
1062
+ readonly name: "remove_file";
1063
+ readonly description: "Request to remove a file at the specified path.";
950
1064
  readonly parameters: z.ZodObject<{
951
1065
  path: z.ZodString;
952
- diff: z.ZodString;
953
1066
  }, z.core.$strip>;
954
1067
  readonly examples: [{
955
- readonly description: "Request to replace sections of content in a file";
1068
+ readonly description: "Request to remove a file";
956
1069
  readonly parameters: [{
957
1070
  readonly name: "path";
958
1071
  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
1072
  }];
990
1073
  }];
991
1074
  readonly permissionLevel: PermissionLevel.Write;
992
1075
  }, FilesystemProvider>;
993
1076
  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.";
1077
+ name: "remove_file";
1078
+ description: "Request to remove a file at the specified path.";
996
1079
  parameters: z.ZodObject<{
997
1080
  path: z.ZodString;
998
- diff: z.ZodString;
999
1081
  }, z.core.$strip>;
1000
1082
  examples: [{
1001
- readonly description: "Request to replace sections of content in a file";
1083
+ readonly description: "Request to remove a file";
1002
1084
  readonly parameters: [{
1003
1085
  readonly name: "path";
1004
1086
  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
1087
  }];
1036
1088
  }];
1037
1089
  permissionLevel: PermissionLevel.Write;
1038
1090
  };
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 }
1091
+ export { _default_9 as default_alias_12 }
1092
+ export { _default_9 as removeFile }
1093
+ export { _default_9 as removeFile_alias_1 }
1094
+ export { _default_9 as removeFile_alias_2 }
1095
1095
 
1096
1096
  /**
1097
1097
  * AI tool for creating new projects based on user specifications.
@@ -1205,7 +1205,7 @@ export declare const fullSystemPrompt_alias_2: (info: {
1205
1205
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1206
1206
  command: string;
1207
1207
  description: string;
1208
- }>, interactive: boolean, useNativeTool: boolean) => string;
1208
+ }>, _interactive: boolean, useNativeTool: boolean) => string;
1209
1209
 
1210
1210
  export declare const fullSystemPrompt_alias_3: (info: {
1211
1211
  os: string;
@@ -1333,7 +1333,7 @@ export { InteractionProvider as InteractionProvider_alias_2 }
1333
1333
 
1334
1334
  export declare const isAvailable: (provider: InteractionProvider) => boolean;
1335
1335
 
1336
- export declare const isAvailable_alias_1: (provider: InteractionProvider) => boolean;
1336
+ export declare const isAvailable_alias_1: (_provider: InteractionProvider) => boolean;
1337
1337
 
1338
1338
  export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
1339
1339
 
@@ -1371,19 +1371,19 @@ export { makeTool }
1371
1371
  export { makeTool as makeTool_alias_1 }
1372
1372
 
1373
1373
  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<{
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<{
1381
1381
  stdout: string;
1382
1382
  stderr: string;
1383
1383
  exitCode: number;
1384
1384
  }>;
1385
- askFollowupQuestion(question: string, options?: string[]): Promise<string>;
1386
- attemptCompletion(result: string): Promise<string | undefined>;
1385
+ askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
1386
+ attemptCompletion(_result: string): Promise<string | undefined>;
1387
1387
  }
1388
1388
  export { MockProvider }
1389
1389
  export { MockProvider as MockProvider_alias_1 }
@@ -1751,7 +1751,7 @@ declare type ToolFormat = 'native' | 'polka-codes';
1751
1751
  export { ToolFormat }
1752
1752
  export { ToolFormat as ToolFormat_alias_1 }
1753
1753
 
1754
- declare type ToolHandler<T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1754
+ declare type ToolHandler<_T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1755
1755
  export { ToolHandler }
1756
1756
  export { ToolHandler as ToolHandler_alias_1 }
1757
1757
 
@@ -2288,6 +2288,8 @@ declare class UsageMeter {
2288
2288
  }>): void;
2289
2289
  /** Manually bump the message count (useful if you record some calls without token info). */
2290
2290
  incrementMessageCount(n?: number): void;
2291
+ /** Reset the running totals. */
2292
+ resetUsage(): void;
2291
2293
  /** Return true once either messages or cost exceed the configured caps. */
2292
2294
  isLimitExceeded(): {
2293
2295
  messageCount: boolean;