@polka-codes/core 0.9.0 → 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 }
@@ -284,6 +284,9 @@ declare const configSchema: z.ZodObject<{
284
284
  apiKey: z.ZodOptional<z.ZodString>;
285
285
  defaultModel: z.ZodOptional<z.ZodString>;
286
286
  defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
287
+ location: z.ZodOptional<z.ZodString>;
288
+ project: z.ZodOptional<z.ZodString>;
289
+ keyFile: z.ZodOptional<z.ZodString>;
287
290
  }, z.core.$strip>>>;
288
291
  defaultProvider: z.ZodOptional<z.ZodString>;
289
292
  defaultModel: z.ZodOptional<z.ZodString>;
@@ -464,187 +467,241 @@ export { _default as default_alias_4 }
464
467
 
465
468
  declare const _default_10: {
466
469
  handler: ToolHandler<{
467
- readonly name: "write_to_file";
468
- readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&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.";
469
472
  readonly parameters: z.ZodObject<{
470
- path: z.ZodString;
471
- content: z.ZodString;
473
+ source_path: z.ZodString;
474
+ target_path: z.ZodString;
472
475
  }, z.core.$strip>;
473
476
  readonly examples: [{
474
- readonly description: "Request to write content to a file";
477
+ readonly description: "Request to rename a file";
475
478
  readonly parameters: [{
476
- readonly name: "path";
477
- readonly value: "src/main.js";
479
+ readonly name: "source_path";
480
+ readonly value: "src/old-name.js";
478
481
  }, {
479
- readonly name: "content";
480
- 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";
481
484
  }];
482
485
  }];
483
486
  readonly permissionLevel: PermissionLevel.Write;
484
487
  }, FilesystemProvider>;
485
488
  isAvailable: (provider: FilesystemProvider) => boolean;
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.";
489
+ name: "rename_file";
490
+ description: "Request to rename a file from source path to target path.";
488
491
  parameters: z.ZodObject<{
489
- path: z.ZodString;
490
- content: z.ZodString;
492
+ source_path: z.ZodString;
493
+ target_path: z.ZodString;
491
494
  }, z.core.$strip>;
492
495
  examples: [{
493
- readonly description: "Request to write content to a file";
496
+ readonly description: "Request to rename a file";
494
497
  readonly parameters: [{
495
- readonly name: "path";
496
- readonly value: "src/main.js";
498
+ readonly name: "source_path";
499
+ readonly value: "src/old-name.js";
497
500
  }, {
498
- readonly name: "content";
499
- 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";
500
503
  }];
501
504
  }];
502
505
  permissionLevel: PermissionLevel.Write;
503
506
  };
504
- export { _default_10 as default_alias_16 }
505
- export { _default_10 as writeToFile }
506
- export { _default_10 as writeToFile_alias_1 }
507
- export { _default_10 as writeToFile_alias_2 }
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 }
508
511
 
509
512
  declare const _default_11: {
510
513
  handler: ToolHandler<{
511
- readonly name: "hand_over";
512
- 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.";
513
516
  readonly parameters: z.ZodObject<{
514
- agentName: z.ZodString;
515
- task: z.ZodString;
516
- context: z.ZodString;
517
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
517
+ path: z.ZodString;
518
+ diff: z.ZodString;
518
519
  }, z.core.$strip>;
519
520
  readonly examples: [{
520
- readonly description: "Hand over a coding task to the coder agent";
521
+ readonly description: "Request to replace sections of content in a file";
521
522
  readonly parameters: [{
522
- readonly name: "agentName";
523
- readonly value: "coder";
523
+ readonly name: "path";
524
+ readonly value: "src/main.js";
524
525
  }, {
525
- readonly name: "task";
526
- 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";
527
534
  }, {
528
- readonly name: "context";
529
- 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";
530
543
  }, {
531
- readonly name: "files";
532
- 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";
533
555
  }];
534
556
  }];
535
- readonly permissionLevel: PermissionLevel.None;
536
- }, any>;
537
- isAvailable: (_provider: any) => boolean;
538
- name: "hand_over";
539
- 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.";
540
562
  parameters: z.ZodObject<{
541
- agentName: z.ZodString;
542
- task: z.ZodString;
543
- context: z.ZodString;
544
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
563
+ path: z.ZodString;
564
+ diff: z.ZodString;
545
565
  }, z.core.$strip>;
546
566
  examples: [{
547
- readonly description: "Hand over a coding task to the coder agent";
567
+ readonly description: "Request to replace sections of content in a file";
548
568
  readonly parameters: [{
549
- readonly name: "agentName";
550
- readonly value: "coder";
569
+ readonly name: "path";
570
+ readonly value: "src/main.js";
551
571
  }, {
552
- readonly name: "task";
553
- 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";
554
580
  }, {
555
- readonly name: "context";
556
- 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";
557
589
  }, {
558
- readonly name: "files";
559
- 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";
560
601
  }];
561
602
  }];
562
- permissionLevel: PermissionLevel.None;
603
+ permissionLevel: PermissionLevel.Write;
563
604
  };
564
- export { _default_11 as default_alias_9 }
565
- export { _default_11 as handOver }
566
- export { _default_11 as handOver_alias_1 }
567
- export { _default_11 as handOver_alias_2 }
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 }
568
609
 
569
610
  declare const _default_12: {
570
611
  handler: ToolHandler<{
571
- readonly name: "remove_file";
572
- 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.";
573
614
  readonly parameters: z.ZodObject<{
574
615
  path: z.ZodString;
616
+ regex: z.ZodString;
617
+ filePattern: z.ZodOptional<z.ZodString>;
575
618
  }, z.core.$strip>;
576
619
  readonly examples: [{
577
- readonly description: "Request to remove a file";
620
+ readonly description: "Request to perform a regex search across files";
578
621
  readonly parameters: [{
579
622
  readonly name: "path";
580
- 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";
581
630
  }];
582
631
  }];
583
- readonly permissionLevel: PermissionLevel.Write;
632
+ readonly permissionLevel: PermissionLevel.Read;
584
633
  }, FilesystemProvider>;
585
634
  isAvailable: (provider: FilesystemProvider) => boolean;
586
- name: "remove_file";
587
- 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.";
588
637
  parameters: z.ZodObject<{
589
638
  path: z.ZodString;
639
+ regex: z.ZodString;
640
+ filePattern: z.ZodOptional<z.ZodString>;
590
641
  }, z.core.$strip>;
591
642
  examples: [{
592
- readonly description: "Request to remove a file";
643
+ readonly description: "Request to perform a regex search across files";
593
644
  readonly parameters: [{
594
645
  readonly name: "path";
595
- 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";
596
653
  }];
597
654
  }];
598
- permissionLevel: PermissionLevel.Write;
655
+ permissionLevel: PermissionLevel.Read;
599
656
  };
600
- export { _default_12 as default_alias_12 }
601
- export { _default_12 as removeFile }
602
- export { _default_12 as removeFile_alias_1 }
603
- export { _default_12 as removeFile_alias_2 }
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 }
604
661
 
605
662
  declare const _default_13: {
606
663
  handler: ToolHandler<{
607
- readonly name: "rename_file";
608
- 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.";
609
666
  readonly parameters: z.ZodObject<{
610
- source_path: z.ZodString;
611
- target_path: z.ZodString;
667
+ path: z.ZodString;
668
+ content: z.ZodString;
612
669
  }, z.core.$strip>;
613
670
  readonly examples: [{
614
- readonly description: "Request to rename a file";
671
+ readonly description: "Request to write content to a file";
615
672
  readonly parameters: [{
616
- readonly name: "source_path";
617
- readonly value: "src/old-name.js";
673
+ readonly name: "path";
674
+ readonly value: "src/main.js";
618
675
  }, {
619
- readonly name: "target_path";
620
- 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";
621
678
  }];
622
679
  }];
623
680
  readonly permissionLevel: PermissionLevel.Write;
624
681
  }, FilesystemProvider>;
625
682
  isAvailable: (provider: FilesystemProvider) => boolean;
626
- name: "rename_file";
627
- 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.";
628
685
  parameters: z.ZodObject<{
629
- source_path: z.ZodString;
630
- target_path: z.ZodString;
686
+ path: z.ZodString;
687
+ content: z.ZodString;
631
688
  }, z.core.$strip>;
632
689
  examples: [{
633
- readonly description: "Request to rename a file";
690
+ readonly description: "Request to write content to a file";
634
691
  readonly parameters: [{
635
- readonly name: "source_path";
636
- readonly value: "src/old-name.js";
692
+ readonly name: "path";
693
+ readonly value: "src/main.js";
637
694
  }, {
638
- readonly name: "target_path";
639
- 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";
640
697
  }];
641
698
  }];
642
699
  permissionLevel: PermissionLevel.Write;
643
700
  };
644
- export { _default_13 as default_alias_13 }
645
- export { _default_13 as renameFile }
646
- export { _default_13 as renameFile_alias_1 }
647
- export { _default_13 as renameFile_alias_2 }
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 }
648
705
 
649
706
  declare const _default_2: {
650
707
  handler: ToolHandler<{
@@ -662,7 +719,7 @@ declare const _default_2: {
662
719
  }];
663
720
  readonly permissionLevel: PermissionLevel.None;
664
721
  }, InteractionProvider>;
665
- isAvailable: (provider: InteractionProvider) => boolean;
722
+ isAvailable: (_provider: InteractionProvider) => boolean;
666
723
  name: "attempt_completion";
667
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.";
668
725
  parameters: z.ZodObject<{
@@ -847,6 +904,66 @@ export { _default_5 as fetchUrl_alias_1 }
847
904
  export { _default_5 as fetchUrl_alias_2 }
848
905
 
849
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: {
850
967
  handler: ToolHandler<{
851
968
  readonly name: "list_files";
852
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.";
@@ -887,12 +1004,12 @@ declare const _default_6: {
887
1004
  }];
888
1005
  permissionLevel: PermissionLevel.Read;
889
1006
  };
890
- export { _default_6 as default_alias_10 }
891
- export { _default_6 as listFiles }
892
- export { _default_6 as listFiles_alias_1 }
893
- 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 }
894
1011
 
895
- declare const _default_7: {
1012
+ declare const _default_8: {
896
1013
  handler: ToolHandler<{
897
1014
  readonly name: "read_file";
898
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.";
@@ -935,160 +1052,46 @@ declare const _default_7: {
935
1052
  }];
936
1053
  permissionLevel: PermissionLevel.Read;
937
1054
  };
938
- export { _default_7 as default_alias_11 }
939
- export { _default_7 as readFile }
940
- export { _default_7 as readFile_alias_1 }
941
- 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 }
942
1059
 
943
- declare const _default_8: {
1060
+ declare const _default_9: {
944
1061
  handler: ToolHandler<{
945
- readonly name: "replace_in_file";
946
- readonly description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
1062
+ readonly name: "remove_file";
1063
+ readonly description: "Request to remove a file at the specified path.";
947
1064
  readonly parameters: z.ZodObject<{
948
1065
  path: z.ZodString;
949
- diff: z.ZodString;
950
1066
  }, z.core.$strip>;
951
1067
  readonly examples: [{
952
- readonly description: "Request to replace sections of content in a file";
1068
+ readonly description: "Request to remove a file";
953
1069
  readonly parameters: [{
954
1070
  readonly name: "path";
955
1071
  readonly value: "src/main.js";
956
- }, {
957
- readonly name: "diff";
958
- readonly value: "<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE";
959
- }];
960
- }, {
961
- readonly description: "Request to perform a simple, single-line replacement";
962
- readonly parameters: [{
963
- readonly name: "path";
964
- readonly value: "src/config.js";
965
- }, {
966
- readonly name: "diff";
967
- readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
968
- }];
969
- }, {
970
- readonly description: "Request to add a new function to a file";
971
- readonly parameters: [{
972
- readonly name: "path";
973
- readonly value: "src/utils.js";
974
- }, {
975
- readonly name: "diff";
976
- readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
977
- }];
978
- }, {
979
- readonly description: "Request to delete a block of code from a file";
980
- readonly parameters: [{
981
- readonly name: "path";
982
- readonly value: "src/app.js";
983
- }, {
984
- readonly name: "diff";
985
- readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
986
1072
  }];
987
1073
  }];
988
1074
  readonly permissionLevel: PermissionLevel.Write;
989
1075
  }, FilesystemProvider>;
990
1076
  isAvailable: (provider: FilesystemProvider) => boolean;
991
- name: "replace_in_file";
992
- description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
1077
+ name: "remove_file";
1078
+ description: "Request to remove a file at the specified path.";
993
1079
  parameters: z.ZodObject<{
994
1080
  path: z.ZodString;
995
- diff: z.ZodString;
996
1081
  }, z.core.$strip>;
997
1082
  examples: [{
998
- readonly description: "Request to replace sections of content in a file";
1083
+ readonly description: "Request to remove a file";
999
1084
  readonly parameters: [{
1000
1085
  readonly name: "path";
1001
1086
  readonly value: "src/main.js";
1002
- }, {
1003
- readonly name: "diff";
1004
- readonly value: "<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE";
1005
- }];
1006
- }, {
1007
- readonly description: "Request to perform a simple, single-line replacement";
1008
- readonly parameters: [{
1009
- readonly name: "path";
1010
- readonly value: "src/config.js";
1011
- }, {
1012
- readonly name: "diff";
1013
- readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
1014
- }];
1015
- }, {
1016
- readonly description: "Request to add a new function to a file";
1017
- readonly parameters: [{
1018
- readonly name: "path";
1019
- readonly value: "src/utils.js";
1020
- }, {
1021
- readonly name: "diff";
1022
- readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
1023
- }];
1024
- }, {
1025
- readonly description: "Request to delete a block of code from a file";
1026
- readonly parameters: [{
1027
- readonly name: "path";
1028
- readonly value: "src/app.js";
1029
- }, {
1030
- readonly name: "diff";
1031
- readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
1032
1087
  }];
1033
1088
  }];
1034
1089
  permissionLevel: PermissionLevel.Write;
1035
1090
  };
1036
- export { _default_8 as default_alias_14 }
1037
- export { _default_8 as replaceInFile }
1038
- export { _default_8 as replaceInFile_alias_1 }
1039
- export { _default_8 as replaceInFile_alias_2 }
1040
-
1041
- declare const _default_9: {
1042
- handler: ToolHandler<{
1043
- readonly name: "search_files";
1044
- readonly description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
1045
- readonly parameters: z.ZodObject<{
1046
- path: z.ZodString;
1047
- regex: z.ZodString;
1048
- filePattern: z.ZodOptional<z.ZodString>;
1049
- }, z.core.$strip>;
1050
- readonly examples: [{
1051
- readonly description: "Request to perform a regex search across files";
1052
- readonly parameters: [{
1053
- readonly name: "path";
1054
- readonly value: "src";
1055
- }, {
1056
- readonly name: "regex";
1057
- readonly value: "^components/";
1058
- }, {
1059
- readonly name: "filePattern";
1060
- readonly value: "*.ts,*.tsx";
1061
- }];
1062
- }];
1063
- readonly permissionLevel: PermissionLevel.Read;
1064
- }, FilesystemProvider>;
1065
- isAvailable: (provider: FilesystemProvider) => boolean;
1066
- name: "search_files";
1067
- description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
1068
- parameters: z.ZodObject<{
1069
- path: z.ZodString;
1070
- regex: z.ZodString;
1071
- filePattern: z.ZodOptional<z.ZodString>;
1072
- }, z.core.$strip>;
1073
- examples: [{
1074
- readonly description: "Request to perform a regex search across files";
1075
- readonly parameters: [{
1076
- readonly name: "path";
1077
- readonly value: "src";
1078
- }, {
1079
- readonly name: "regex";
1080
- readonly value: "^components/";
1081
- }, {
1082
- readonly name: "filePattern";
1083
- readonly value: "*.ts,*.tsx";
1084
- }];
1085
- }];
1086
- permissionLevel: PermissionLevel.Read;
1087
- };
1088
- export { _default_9 as default_alias_15 }
1089
- export { _default_9 as searchFiles }
1090
- export { _default_9 as searchFiles_alias_1 }
1091
- 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 }
1092
1095
 
1093
1096
  /**
1094
1097
  * AI tool for creating new projects based on user specifications.
@@ -1202,7 +1205,7 @@ export declare const fullSystemPrompt_alias_2: (info: {
1202
1205
  }, tools: ToolInfo[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
1203
1206
  command: string;
1204
1207
  description: string;
1205
- }>, interactive: boolean, useNativeTool: boolean) => string;
1208
+ }>, _interactive: boolean, useNativeTool: boolean) => string;
1206
1209
 
1207
1210
  export declare const fullSystemPrompt_alias_3: (info: {
1208
1211
  os: string;
@@ -1330,7 +1333,7 @@ export { InteractionProvider as InteractionProvider_alias_2 }
1330
1333
 
1331
1334
  export declare const isAvailable: (provider: InteractionProvider) => boolean;
1332
1335
 
1333
- export declare const isAvailable_alias_1: (provider: InteractionProvider) => boolean;
1336
+ export declare const isAvailable_alias_1: (_provider: InteractionProvider) => boolean;
1334
1337
 
1335
1338
  export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
1336
1339
 
@@ -1368,19 +1371,19 @@ export { makeTool }
1368
1371
  export { makeTool as makeTool_alias_1 }
1369
1372
 
1370
1373
  declare class MockProvider implements ToolProvider {
1371
- readFile(path: string): Promise<string>;
1372
- writeFile(path: string, content: string): Promise<void>;
1373
- removeFile(path: string): Promise<void>;
1374
- renameFile(sourcePath: string, targetPath: string): Promise<void>;
1375
- listFiles(path: string, recursive: boolean, maxCount: number): Promise<[string[], boolean]>;
1376
- searchFiles(path: string, regex: string, filePattern: string): Promise<string[]>;
1377
- 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<{
1378
1381
  stdout: string;
1379
1382
  stderr: string;
1380
1383
  exitCode: number;
1381
1384
  }>;
1382
- askFollowupQuestion(question: string, options?: string[]): Promise<string>;
1383
- attemptCompletion(result: string): Promise<string | undefined>;
1385
+ askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
1386
+ attemptCompletion(_result: string): Promise<string | undefined>;
1384
1387
  }
1385
1388
  export { MockProvider }
1386
1389
  export { MockProvider as MockProvider_alias_1 }
@@ -1748,7 +1751,7 @@ declare type ToolFormat = 'native' | 'polka-codes';
1748
1751
  export { ToolFormat }
1749
1752
  export { ToolFormat as ToolFormat_alias_1 }
1750
1753
 
1751
- 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>;
1752
1755
  export { ToolHandler }
1753
1756
  export { ToolHandler as ToolHandler_alias_1 }
1754
1757
 
@@ -2285,6 +2288,8 @@ declare class UsageMeter {
2285
2288
  }>): void;
2286
2289
  /** Manually bump the message count (useful if you record some calls without token info). */
2287
2290
  incrementMessageCount(n?: number): void;
2291
+ /** Reset the running totals. */
2292
+ resetUsage(): void;
2288
2293
  /** Return true once either messages or cost exceed the configured caps. */
2289
2294
  isLimitExceeded(): {
2290
2295
  messageCount: boolean;