@polka-codes/core 0.8.18 → 0.8.19

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.
@@ -170,13 +170,13 @@ export declare namespace allTools {
170
170
  _default_5 as executeCommand,
171
171
  _default_6 as listFiles,
172
172
  _default_7 as readFile,
173
- _default_8 as searchFiles,
174
- _default_9 as updateKnowledge,
175
- _default_10 as writeToFile,
176
- _default_11 as handOver,
177
- _default_12 as removeFile,
178
- _default_13 as renameFile,
179
- _default_14 as editFile
173
+ _default_8 as replaceInFile,
174
+ _default_9 as searchFiles,
175
+ _default_10 as updateKnowledge,
176
+ _default_11 as writeToFile,
177
+ _default_12 as handOver,
178
+ _default_13 as removeFile,
179
+ _default_14 as renameFile
180
180
  }
181
181
  }
182
182
 
@@ -799,62 +799,300 @@ export declare class DeepSeekService extends AiServiceBase {
799
799
 
800
800
  declare const _default: {
801
801
  handler: ToolHandler<{
802
- readonly name: "replace_in_file";
803
- 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.";
802
+ readonly name: "edit_file";
803
+ readonly description: "Request to edit file contents using search/replace operations. Supports multiple edit operations in a single call.";
804
804
  readonly parameters: [{
805
805
  readonly name: "path";
806
- readonly description: "The path of the file to modify";
806
+ readonly description: "The path of the file to edit";
807
807
  readonly required: true;
808
808
  readonly usageValue: "File path here";
809
809
  }, {
810
- readonly name: "diff";
811
- readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
810
+ readonly name: "operations";
811
+ readonly description: "Edit operation with search and replace parameters";
812
812
  readonly required: true;
813
- readonly usageValue: "Search and replace blocks here";
813
+ readonly allowMultiple: true;
814
+ readonly children: [{
815
+ readonly name: "search";
816
+ readonly description: "Text to search for and replace (use <<<START_OF_FILE>>> to insert at file start, <<<END_OF_FILE>>> to insert at file end)";
817
+ readonly required: true;
818
+ readonly usageValue: "Text to find and replace";
819
+ }, {
820
+ readonly name: "replace";
821
+ readonly description: "Text to replace the search text with";
822
+ readonly required: true;
823
+ readonly usageValue: "Replacement text";
824
+ }];
825
+ readonly usageValue: "operations here";
814
826
  }];
815
827
  readonly examples: [{
816
- readonly description: "Request to replace sections of content in a file";
828
+ readonly description: "Replace specific text";
817
829
  readonly parameters: [{
818
830
  readonly name: "path";
819
- readonly value: "src/main.js";
831
+ readonly value: "src/main.ts";
820
832
  }, {
821
- readonly name: "diff";
822
- readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
833
+ readonly name: "operations";
834
+ readonly value: {
835
+ readonly search: "function oldFunction() {\n return 42;\n}";
836
+ readonly replace: "function newFunction() {\n return \"new implementation\";\n}";
837
+ };
838
+ }];
839
+ }, {
840
+ readonly description: "Insert at start of file";
841
+ readonly parameters: [{
842
+ readonly name: "path";
843
+ readonly value: "src/header.ts";
844
+ }, {
845
+ readonly name: "operations";
846
+ readonly value: {
847
+ readonly search: "<<<START_OF_FILE>>>";
848
+ readonly replace: "// File header comment\n";
849
+ };
850
+ }];
851
+ }, {
852
+ readonly description: "Multiple operations in one call";
853
+ readonly parameters: [{
854
+ readonly name: "path";
855
+ readonly value: "src/utils.ts";
856
+ }, {
857
+ readonly name: "operations";
858
+ readonly value: [{
859
+ readonly search: "import React from \"react\"";
860
+ readonly replace: "import React, { useState } from \"react\"";
861
+ }, {
862
+ readonly search: "function Component() {\n return (";
863
+ readonly replace: "function Component() {\n const [state, setState] = useState(false);\n return (";
864
+ }];
865
+ }];
866
+ }, {
867
+ readonly description: "Append content at end of file";
868
+ readonly parameters: [{
869
+ readonly name: "path";
870
+ readonly value: "src/footer.ts";
871
+ }, {
872
+ readonly name: "operations";
873
+ readonly value: {
874
+ readonly search: "<<<END_OF_FILE>>>";
875
+ readonly replace: "\n// End of file appended comment\n";
876
+ };
823
877
  }];
824
878
  }];
825
879
  readonly permissionLevel: PermissionLevel.Write;
826
880
  }, FilesystemProvider>;
827
881
  isAvailable: (provider: FilesystemProvider) => boolean;
828
- name: "replace_in_file";
829
- 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.";
882
+ name: "edit_file";
883
+ description: "Request to edit file contents using search/replace operations. Supports multiple edit operations in a single call.";
830
884
  parameters: [{
831
885
  readonly name: "path";
832
- readonly description: "The path of the file to modify";
886
+ readonly description: "The path of the file to edit";
833
887
  readonly required: true;
834
888
  readonly usageValue: "File path here";
835
889
  }, {
836
- readonly name: "diff";
837
- readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
890
+ readonly name: "operations";
891
+ readonly description: "Edit operation with search and replace parameters";
838
892
  readonly required: true;
839
- readonly usageValue: "Search and replace blocks here";
893
+ readonly allowMultiple: true;
894
+ readonly children: [{
895
+ readonly name: "search";
896
+ readonly description: "Text to search for and replace (use <<<START_OF_FILE>>> to insert at file start, <<<END_OF_FILE>>> to insert at file end)";
897
+ readonly required: true;
898
+ readonly usageValue: "Text to find and replace";
899
+ }, {
900
+ readonly name: "replace";
901
+ readonly description: "Text to replace the search text with";
902
+ readonly required: true;
903
+ readonly usageValue: "Replacement text";
904
+ }];
905
+ readonly usageValue: "operations here";
840
906
  }];
841
907
  examples: [{
842
- readonly description: "Request to replace sections of content in a file";
908
+ readonly description: "Replace specific text";
843
909
  readonly parameters: [{
844
910
  readonly name: "path";
845
- readonly value: "src/main.js";
911
+ readonly value: "src/main.ts";
846
912
  }, {
847
- readonly name: "diff";
848
- readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
913
+ readonly name: "operations";
914
+ readonly value: {
915
+ readonly search: "function oldFunction() {\n return 42;\n}";
916
+ readonly replace: "function newFunction() {\n return \"new implementation\";\n}";
917
+ };
918
+ }];
919
+ }, {
920
+ readonly description: "Insert at start of file";
921
+ readonly parameters: [{
922
+ readonly name: "path";
923
+ readonly value: "src/header.ts";
924
+ }, {
925
+ readonly name: "operations";
926
+ readonly value: {
927
+ readonly search: "<<<START_OF_FILE>>>";
928
+ readonly replace: "// File header comment\n";
929
+ };
930
+ }];
931
+ }, {
932
+ readonly description: "Multiple operations in one call";
933
+ readonly parameters: [{
934
+ readonly name: "path";
935
+ readonly value: "src/utils.ts";
936
+ }, {
937
+ readonly name: "operations";
938
+ readonly value: [{
939
+ readonly search: "import React from \"react\"";
940
+ readonly replace: "import React, { useState } from \"react\"";
941
+ }, {
942
+ readonly search: "function Component() {\n return (";
943
+ readonly replace: "function Component() {\n const [state, setState] = useState(false);\n return (";
944
+ }];
945
+ }];
946
+ }, {
947
+ readonly description: "Append content at end of file";
948
+ readonly parameters: [{
949
+ readonly name: "path";
950
+ readonly value: "src/footer.ts";
951
+ }, {
952
+ readonly name: "operations";
953
+ readonly value: {
954
+ readonly search: "<<<END_OF_FILE>>>";
955
+ readonly replace: "\n// End of file appended comment\n";
956
+ };
849
957
  }];
850
958
  }];
851
959
  permissionLevel: PermissionLevel.Write;
852
960
  };
853
- export { _default as default_alias_14 }
854
- export { _default as replaceInFile }
855
- export { _default as replaceInFile_alias_1 }
961
+ export { _default as default_alias_7 }
962
+ export { _default as editFile }
963
+ export { _default as editFile_alias_1 }
856
964
 
857
965
  declare const _default_10: {
966
+ handler: ToolHandler<{
967
+ readonly name: "update_knowledge";
968
+ readonly description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
969
+ readonly parameters: [{
970
+ readonly name: "path";
971
+ readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
972
+ readonly required: true;
973
+ readonly usageValue: "Directory path here";
974
+ }, {
975
+ readonly name: "knowledge";
976
+ readonly description: "YAML content to merge into the knowledge file";
977
+ readonly required: true;
978
+ readonly usageValue: "YAML content with knowledge to update";
979
+ }];
980
+ readonly examples: [{
981
+ readonly description: "Add a new file entry";
982
+ readonly parameters: [{
983
+ readonly name: "path";
984
+ readonly value: "src/utils";
985
+ }, {
986
+ readonly name: "knowledge";
987
+ readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
988
+ }];
989
+ }, {
990
+ readonly description: "Update an existing file description";
991
+ readonly parameters: [{
992
+ readonly name: "path";
993
+ readonly value: "src/utils";
994
+ }, {
995
+ readonly name: "knowledge";
996
+ readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
997
+ }];
998
+ }, {
999
+ readonly description: "Add a new rule";
1000
+ readonly parameters: [{
1001
+ readonly name: "path";
1002
+ readonly value: "src";
1003
+ }, {
1004
+ readonly name: "knowledge";
1005
+ readonly value: "rules:\n 10: \"New rule to follow\"";
1006
+ }];
1007
+ }, {
1008
+ readonly description: "Remove a rule";
1009
+ readonly parameters: [{
1010
+ readonly name: "path";
1011
+ readonly value: "src";
1012
+ }, {
1013
+ readonly name: "knowledge";
1014
+ readonly value: "rules:\n 5: null";
1015
+ }];
1016
+ }, {
1017
+ readonly description: "Update nested properties using dot notation";
1018
+ readonly parameters: [{
1019
+ readonly name: "path";
1020
+ readonly value: "src/components";
1021
+ }, {
1022
+ readonly name: "knowledge";
1023
+ readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1024
+ }];
1025
+ }];
1026
+ readonly permissionLevel: PermissionLevel.Write;
1027
+ }, FilesystemProvider>;
1028
+ isAvailable: (provider: FilesystemProvider) => boolean;
1029
+ name: "update_knowledge";
1030
+ description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
1031
+ parameters: [{
1032
+ readonly name: "path";
1033
+ readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1034
+ readonly required: true;
1035
+ readonly usageValue: "Directory path here";
1036
+ }, {
1037
+ readonly name: "knowledge";
1038
+ readonly description: "YAML content to merge into the knowledge file";
1039
+ readonly required: true;
1040
+ readonly usageValue: "YAML content with knowledge to update";
1041
+ }];
1042
+ examples: [{
1043
+ readonly description: "Add a new file entry";
1044
+ readonly parameters: [{
1045
+ readonly name: "path";
1046
+ readonly value: "src/utils";
1047
+ }, {
1048
+ readonly name: "knowledge";
1049
+ readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
1050
+ }];
1051
+ }, {
1052
+ readonly description: "Update an existing file description";
1053
+ readonly parameters: [{
1054
+ readonly name: "path";
1055
+ readonly value: "src/utils";
1056
+ }, {
1057
+ readonly name: "knowledge";
1058
+ readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1059
+ }];
1060
+ }, {
1061
+ readonly description: "Add a new rule";
1062
+ readonly parameters: [{
1063
+ readonly name: "path";
1064
+ readonly value: "src";
1065
+ }, {
1066
+ readonly name: "knowledge";
1067
+ readonly value: "rules:\n 10: \"New rule to follow\"";
1068
+ }];
1069
+ }, {
1070
+ readonly description: "Remove a rule";
1071
+ readonly parameters: [{
1072
+ readonly name: "path";
1073
+ readonly value: "src";
1074
+ }, {
1075
+ readonly name: "knowledge";
1076
+ readonly value: "rules:\n 5: null";
1077
+ }];
1078
+ }, {
1079
+ readonly description: "Update nested properties using dot notation";
1080
+ readonly parameters: [{
1081
+ readonly name: "path";
1082
+ readonly value: "src/components";
1083
+ }, {
1084
+ readonly name: "knowledge";
1085
+ readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1086
+ }];
1087
+ }];
1088
+ permissionLevel: PermissionLevel.Write;
1089
+ };
1090
+ export { _default_10 as default_alias_16 }
1091
+ export { _default_10 as updateKnowledge }
1092
+ export { _default_10 as updateKnowledge_alias_1 }
1093
+ export { _default_10 as updateKnowledge_alias_2 }
1094
+
1095
+ declare const _default_11: {
858
1096
  handler: ToolHandler<{
859
1097
  readonly name: "write_to_file";
860
1098
  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;` and `&gt;`.";
@@ -907,12 +1145,12 @@ declare const _default_10: {
907
1145
  }];
908
1146
  permissionLevel: PermissionLevel.Write;
909
1147
  };
910
- export { _default_10 as default_alias_17 }
911
- export { _default_10 as writeToFile }
912
- export { _default_10 as writeToFile_alias_1 }
913
- export { _default_10 as writeToFile_alias_2 }
1148
+ export { _default_11 as default_alias_17 }
1149
+ export { _default_11 as writeToFile }
1150
+ export { _default_11 as writeToFile_alias_1 }
1151
+ export { _default_11 as writeToFile_alias_2 }
914
1152
 
915
- declare const _default_11: {
1153
+ declare const _default_12: {
916
1154
  handler: ToolHandler<{
917
1155
  readonly name: "hand_over";
918
1156
  readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
@@ -997,12 +1235,12 @@ declare const _default_11: {
997
1235
  }];
998
1236
  permissionLevel: PermissionLevel.None;
999
1237
  };
1000
- export { _default_11 as default_alias_9 }
1001
- export { _default_11 as handOver }
1002
- export { _default_11 as handOver_alias_1 }
1003
- export { _default_11 as handOver_alias_2 }
1238
+ export { _default_12 as default_alias_9 }
1239
+ export { _default_12 as handOver }
1240
+ export { _default_12 as handOver_alias_1 }
1241
+ export { _default_12 as handOver_alias_2 }
1004
1242
 
1005
- declare const _default_12: {
1243
+ declare const _default_13: {
1006
1244
  handler: ToolHandler<{
1007
1245
  readonly name: "remove_file";
1008
1246
  readonly description: "Request to remove a file at the specified path.";
@@ -1027,246 +1265,80 @@ declare const _default_12: {
1027
1265
  parameters: [{
1028
1266
  readonly name: "path";
1029
1267
  readonly description: "The path of the file to remove";
1030
- readonly required: true;
1031
- readonly usageValue: "File path here";
1032
- }];
1033
- examples: [{
1034
- readonly description: "Request to remove a file";
1035
- readonly parameters: [{
1036
- readonly name: "path";
1037
- readonly value: "src/main.js";
1038
- }];
1039
- }];
1040
- permissionLevel: PermissionLevel.Write;
1041
- };
1042
- export { _default_12 as default_alias_12 }
1043
- export { _default_12 as removeFile }
1044
- export { _default_12 as removeFile_alias_1 }
1045
- export { _default_12 as removeFile_alias_2 }
1046
-
1047
- declare const _default_13: {
1048
- handler: ToolHandler<{
1049
- readonly name: "rename_file";
1050
- readonly description: "Request to rename a file from source path to target path.";
1051
- readonly parameters: [{
1052
- readonly name: "source_path";
1053
- readonly description: "The current path of the file";
1054
- readonly required: true;
1055
- readonly usageValue: "Source file path here";
1056
- }, {
1057
- readonly name: "target_path";
1058
- readonly description: "The new path for the file";
1059
- readonly required: true;
1060
- readonly usageValue: "Target file path here";
1061
- }];
1062
- readonly examples: [{
1063
- readonly description: "Request to rename a file";
1064
- readonly parameters: [{
1065
- readonly name: "source_path";
1066
- readonly value: "src/old-name.js";
1067
- }, {
1068
- readonly name: "target_path";
1069
- readonly value: "src/new-name.js";
1070
- }];
1071
- }];
1072
- readonly permissionLevel: PermissionLevel.Write;
1073
- }, FilesystemProvider>;
1074
- isAvailable: (provider: FilesystemProvider) => boolean;
1075
- name: "rename_file";
1076
- description: "Request to rename a file from source path to target path.";
1077
- parameters: [{
1078
- readonly name: "source_path";
1079
- readonly description: "The current path of the file";
1080
- readonly required: true;
1081
- readonly usageValue: "Source file path here";
1082
- }, {
1083
- readonly name: "target_path";
1084
- readonly description: "The new path for the file";
1085
- readonly required: true;
1086
- readonly usageValue: "Target file path here";
1087
- }];
1088
- examples: [{
1089
- readonly description: "Request to rename a file";
1090
- readonly parameters: [{
1091
- readonly name: "source_path";
1092
- readonly value: "src/old-name.js";
1093
- }, {
1094
- readonly name: "target_path";
1095
- readonly value: "src/new-name.js";
1096
- }];
1097
- }];
1098
- permissionLevel: PermissionLevel.Write;
1099
- };
1100
- export { _default_13 as default_alias_13 }
1101
- export { _default_13 as renameFile }
1102
- export { _default_13 as renameFile_alias_1 }
1103
- export { _default_13 as renameFile_alias_2 }
1104
-
1105
- declare const _default_14: {
1106
- handler: ToolHandler<{
1107
- readonly name: "edit_file";
1108
- readonly description: "Request to edit file contents using search/replace operations. Supports multiple edit operations in a single call.";
1109
- readonly parameters: [{
1110
- readonly name: "path";
1111
- readonly description: "The path of the file to edit";
1112
- readonly required: true;
1113
- readonly usageValue: "File path here";
1114
- }, {
1115
- readonly name: "operations";
1116
- readonly description: "Edit operation with search and replace parameters";
1117
- readonly required: true;
1118
- readonly allowMultiple: true;
1119
- readonly children: [{
1120
- readonly name: "search";
1121
- readonly description: "Text to search for and replace (use <<<START_OF_FILE>>> to insert at file start, <<<END_OF_FILE>>> to insert at file end)";
1122
- readonly required: true;
1123
- readonly usageValue: "Text to find and replace";
1124
- }, {
1125
- readonly name: "replace";
1126
- readonly description: "Text to replace the search text with";
1127
- readonly required: true;
1128
- readonly usageValue: "Replacement text";
1129
- }];
1130
- readonly usageValue: "operations here";
1131
- }];
1132
- readonly examples: [{
1133
- readonly description: "Replace specific text";
1134
- readonly parameters: [{
1135
- readonly name: "path";
1136
- readonly value: "src/main.ts";
1137
- }, {
1138
- readonly name: "operations";
1139
- readonly value: {
1140
- readonly search: "function oldFunction() {\n return 42;\n}";
1141
- readonly replace: "function newFunction() {\n return \"new implementation\";\n}";
1142
- };
1143
- }];
1144
- }, {
1145
- readonly description: "Insert at start of file";
1146
- readonly parameters: [{
1147
- readonly name: "path";
1148
- readonly value: "src/header.ts";
1149
- }, {
1150
- readonly name: "operations";
1151
- readonly value: {
1152
- readonly search: "<<<START_OF_FILE>>>";
1153
- readonly replace: "// File header comment\n";
1154
- };
1155
- }];
1156
- }, {
1157
- readonly description: "Multiple operations in one call";
1158
- readonly parameters: [{
1159
- readonly name: "path";
1160
- readonly value: "src/utils.ts";
1161
- }, {
1162
- readonly name: "operations";
1163
- readonly value: [{
1164
- readonly search: "import React from \"react\"";
1165
- readonly replace: "import React, { useState } from \"react\"";
1166
- }, {
1167
- readonly search: "function Component() {\n return (";
1168
- readonly replace: "function Component() {\n const [state, setState] = useState(false);\n return (";
1169
- }];
1170
- }];
1171
- }, {
1172
- readonly description: "Append content at end of file";
1173
- readonly parameters: [{
1174
- readonly name: "path";
1175
- readonly value: "src/footer.ts";
1176
- }, {
1177
- readonly name: "operations";
1178
- readonly value: {
1179
- readonly search: "<<<END_OF_FILE>>>";
1180
- readonly replace: "\n// End of file appended comment\n";
1181
- };
1182
- }];
1183
- }];
1184
- readonly permissionLevel: PermissionLevel.Write;
1185
- }, FilesystemProvider>;
1186
- isAvailable: (provider: FilesystemProvider) => boolean;
1187
- name: "edit_file";
1188
- description: "Request to edit file contents using search/replace operations. Supports multiple edit operations in a single call.";
1189
- parameters: [{
1190
- readonly name: "path";
1191
- readonly description: "The path of the file to edit";
1192
- readonly required: true;
1193
- readonly usageValue: "File path here";
1194
- }, {
1195
- readonly name: "operations";
1196
- readonly description: "Edit operation with search and replace parameters";
1197
- readonly required: true;
1198
- readonly allowMultiple: true;
1199
- readonly children: [{
1200
- readonly name: "search";
1201
- readonly description: "Text to search for and replace (use <<<START_OF_FILE>>> to insert at file start, <<<END_OF_FILE>>> to insert at file end)";
1202
- readonly required: true;
1203
- readonly usageValue: "Text to find and replace";
1204
- }, {
1205
- readonly name: "replace";
1206
- readonly description: "Text to replace the search text with";
1207
- readonly required: true;
1208
- readonly usageValue: "Replacement text";
1209
- }];
1210
- readonly usageValue: "operations here";
1211
- }];
1212
- examples: [{
1213
- readonly description: "Replace specific text";
1214
- readonly parameters: [{
1215
- readonly name: "path";
1216
- readonly value: "src/main.ts";
1217
- }, {
1218
- readonly name: "operations";
1219
- readonly value: {
1220
- readonly search: "function oldFunction() {\n return 42;\n}";
1221
- readonly replace: "function newFunction() {\n return \"new implementation\";\n}";
1222
- };
1223
- }];
1224
- }, {
1225
- readonly description: "Insert at start of file";
1268
+ readonly required: true;
1269
+ readonly usageValue: "File path here";
1270
+ }];
1271
+ examples: [{
1272
+ readonly description: "Request to remove a file";
1226
1273
  readonly parameters: [{
1227
1274
  readonly name: "path";
1228
- readonly value: "src/header.ts";
1229
- }, {
1230
- readonly name: "operations";
1231
- readonly value: {
1232
- readonly search: "<<<START_OF_FILE>>>";
1233
- readonly replace: "// File header comment\n";
1234
- };
1275
+ readonly value: "src/main.js";
1235
1276
  }];
1236
- }, {
1237
- readonly description: "Multiple operations in one call";
1277
+ }];
1278
+ permissionLevel: PermissionLevel.Write;
1279
+ };
1280
+ export { _default_13 as default_alias_12 }
1281
+ export { _default_13 as removeFile }
1282
+ export { _default_13 as removeFile_alias_1 }
1283
+ export { _default_13 as removeFile_alias_2 }
1284
+
1285
+ declare const _default_14: {
1286
+ handler: ToolHandler<{
1287
+ readonly name: "rename_file";
1288
+ readonly description: "Request to rename a file from source path to target path.";
1238
1289
  readonly parameters: [{
1239
- readonly name: "path";
1240
- readonly value: "src/utils.ts";
1290
+ readonly name: "source_path";
1291
+ readonly description: "The current path of the file";
1292
+ readonly required: true;
1293
+ readonly usageValue: "Source file path here";
1241
1294
  }, {
1242
- readonly name: "operations";
1243
- readonly value: [{
1244
- readonly search: "import React from \"react\"";
1245
- readonly replace: "import React, { useState } from \"react\"";
1295
+ readonly name: "target_path";
1296
+ readonly description: "The new path for the file";
1297
+ readonly required: true;
1298
+ readonly usageValue: "Target file path here";
1299
+ }];
1300
+ readonly examples: [{
1301
+ readonly description: "Request to rename a file";
1302
+ readonly parameters: [{
1303
+ readonly name: "source_path";
1304
+ readonly value: "src/old-name.js";
1246
1305
  }, {
1247
- readonly search: "function Component() {\n return (";
1248
- readonly replace: "function Component() {\n const [state, setState] = useState(false);\n return (";
1306
+ readonly name: "target_path";
1307
+ readonly value: "src/new-name.js";
1249
1308
  }];
1250
1309
  }];
1310
+ readonly permissionLevel: PermissionLevel.Write;
1311
+ }, FilesystemProvider>;
1312
+ isAvailable: (provider: FilesystemProvider) => boolean;
1313
+ name: "rename_file";
1314
+ description: "Request to rename a file from source path to target path.";
1315
+ parameters: [{
1316
+ readonly name: "source_path";
1317
+ readonly description: "The current path of the file";
1318
+ readonly required: true;
1319
+ readonly usageValue: "Source file path here";
1251
1320
  }, {
1252
- readonly description: "Append content at end of file";
1321
+ readonly name: "target_path";
1322
+ readonly description: "The new path for the file";
1323
+ readonly required: true;
1324
+ readonly usageValue: "Target file path here";
1325
+ }];
1326
+ examples: [{
1327
+ readonly description: "Request to rename a file";
1253
1328
  readonly parameters: [{
1254
- readonly name: "path";
1255
- readonly value: "src/footer.ts";
1329
+ readonly name: "source_path";
1330
+ readonly value: "src/old-name.js";
1256
1331
  }, {
1257
- readonly name: "operations";
1258
- readonly value: {
1259
- readonly search: "<<<END_OF_FILE>>>";
1260
- readonly replace: "\n// End of file appended comment\n";
1261
- };
1332
+ readonly name: "target_path";
1333
+ readonly value: "src/new-name.js";
1262
1334
  }];
1263
1335
  }];
1264
1336
  permissionLevel: PermissionLevel.Write;
1265
1337
  };
1266
- export { _default_14 as default_alias_7 }
1267
- export { _default_14 as editFile }
1268
- export { _default_14 as editFile_alias_1 }
1269
- export { _default_14 as editFile_alias_2 }
1338
+ export { _default_14 as default_alias_13 }
1339
+ export { _default_14 as renameFile }
1340
+ export { _default_14 as renameFile_alias_1 }
1341
+ export { _default_14 as renameFile_alias_2 }
1270
1342
 
1271
1343
  declare const _default_2: {
1272
1344
  handler: ToolHandler<{
@@ -1711,6 +1783,64 @@ export { _default_7 as readFile_alias_1 }
1711
1783
  export { _default_7 as readFile_alias_2 }
1712
1784
 
1713
1785
  declare const _default_8: {
1786
+ handler: ToolHandler<{
1787
+ readonly name: "replace_in_file";
1788
+ 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.";
1789
+ readonly parameters: [{
1790
+ readonly name: "path";
1791
+ readonly description: "The path of the file to modify";
1792
+ readonly required: true;
1793
+ readonly usageValue: "File path here";
1794
+ }, {
1795
+ readonly name: "diff";
1796
+ readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
1797
+ readonly required: true;
1798
+ readonly usageValue: "Search and replace blocks here";
1799
+ }];
1800
+ readonly examples: [{
1801
+ readonly description: "Request to replace sections of content in a file";
1802
+ readonly parameters: [{
1803
+ readonly name: "path";
1804
+ readonly value: "src/main.js";
1805
+ }, {
1806
+ readonly name: "diff";
1807
+ readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
1808
+ }];
1809
+ }];
1810
+ readonly permissionLevel: PermissionLevel.Write;
1811
+ }, FilesystemProvider>;
1812
+ isAvailable: (provider: FilesystemProvider) => boolean;
1813
+ name: "replace_in_file";
1814
+ 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.";
1815
+ parameters: [{
1816
+ readonly name: "path";
1817
+ readonly description: "The path of the file to modify";
1818
+ readonly required: true;
1819
+ readonly usageValue: "File path here";
1820
+ }, {
1821
+ readonly name: "diff";
1822
+ readonly description: "One or more SEARCH/REPLACE blocks following this exact format:\n ```\n <<<<<<< SEARCH\n [exact content to find]\n =======\n [new content to replace with]\n >>>>>>> REPLACE\n ```\n Critical rules:\n 1. SEARCH content must match the associated file section to find EXACTLY:\n * Match character-for-character including whitespace, indentation, line endings\n * Include all comments, docstrings, etc.\n 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.\n * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.\n * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.\n * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.\n 3. Keep SEARCH/REPLACE blocks concise:\n * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.\n * Include just the changing lines, and a few surrounding lines if needed for uniqueness.\n * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.\n * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.\n 4. Special operations:\n * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)\n * To delete code: Use empty REPLACE section";
1823
+ readonly required: true;
1824
+ readonly usageValue: "Search and replace blocks here";
1825
+ }];
1826
+ examples: [{
1827
+ readonly description: "Request to replace sections of content in a file";
1828
+ readonly parameters: [{
1829
+ readonly name: "path";
1830
+ readonly value: "src/main.js";
1831
+ }, {
1832
+ readonly name: "diff";
1833
+ readonly value: "\n<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE\n";
1834
+ }];
1835
+ }];
1836
+ permissionLevel: PermissionLevel.Write;
1837
+ };
1838
+ export { _default_8 as default_alias_14 }
1839
+ export { _default_8 as replaceInFile }
1840
+ export { _default_8 as replaceInFile_alias_1 }
1841
+ export { _default_8 as replaceInFile_alias_2 }
1842
+
1843
+ declare const _default_9: {
1714
1844
  handler: ToolHandler<{
1715
1845
  readonly name: "search_files";
1716
1846
  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.";
@@ -1779,140 +1909,10 @@ declare const _default_8: {
1779
1909
  }];
1780
1910
  permissionLevel: PermissionLevel.Read;
1781
1911
  };
1782
- export { _default_8 as default_alias_15 }
1783
- export { _default_8 as searchFiles }
1784
- export { _default_8 as searchFiles_alias_1 }
1785
- export { _default_8 as searchFiles_alias_2 }
1786
-
1787
- declare const _default_9: {
1788
- handler: ToolHandler<{
1789
- readonly name: "update_knowledge";
1790
- readonly description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
1791
- readonly parameters: [{
1792
- readonly name: "path";
1793
- readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1794
- readonly required: true;
1795
- readonly usageValue: "Directory path here";
1796
- }, {
1797
- readonly name: "knowledge";
1798
- readonly description: "YAML content to merge into the knowledge file";
1799
- readonly required: true;
1800
- readonly usageValue: "YAML content with knowledge to update";
1801
- }];
1802
- readonly examples: [{
1803
- readonly description: "Add a new file entry";
1804
- readonly parameters: [{
1805
- readonly name: "path";
1806
- readonly value: "src/utils";
1807
- }, {
1808
- readonly name: "knowledge";
1809
- readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
1810
- }];
1811
- }, {
1812
- readonly description: "Update an existing file description";
1813
- readonly parameters: [{
1814
- readonly name: "path";
1815
- readonly value: "src/utils";
1816
- }, {
1817
- readonly name: "knowledge";
1818
- readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1819
- }];
1820
- }, {
1821
- readonly description: "Add a new rule";
1822
- readonly parameters: [{
1823
- readonly name: "path";
1824
- readonly value: "src";
1825
- }, {
1826
- readonly name: "knowledge";
1827
- readonly value: "rules:\n 10: \"New rule to follow\"";
1828
- }];
1829
- }, {
1830
- readonly description: "Remove a rule";
1831
- readonly parameters: [{
1832
- readonly name: "path";
1833
- readonly value: "src";
1834
- }, {
1835
- readonly name: "knowledge";
1836
- readonly value: "rules:\n 5: null";
1837
- }];
1838
- }, {
1839
- readonly description: "Update nested properties using dot notation";
1840
- readonly parameters: [{
1841
- readonly name: "path";
1842
- readonly value: "src/components";
1843
- }, {
1844
- readonly name: "knowledge";
1845
- readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1846
- }];
1847
- }];
1848
- readonly permissionLevel: PermissionLevel.Write;
1849
- }, FilesystemProvider>;
1850
- isAvailable: (provider: FilesystemProvider) => boolean;
1851
- name: "update_knowledge";
1852
- description: "Update knowledge in a knowledge.ai.yml file with smart merging capabilities. This tool lets you add, update, or remove information using path-based updates and special directives.";
1853
- parameters: [{
1854
- readonly name: "path";
1855
- readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1856
- readonly required: true;
1857
- readonly usageValue: "Directory path here";
1858
- }, {
1859
- readonly name: "knowledge";
1860
- readonly description: "YAML content to merge into the knowledge file";
1861
- readonly required: true;
1862
- readonly usageValue: "YAML content with knowledge to update";
1863
- }];
1864
- examples: [{
1865
- readonly description: "Add a new file entry";
1866
- readonly parameters: [{
1867
- readonly name: "path";
1868
- readonly value: "src/utils";
1869
- }, {
1870
- readonly name: "knowledge";
1871
- readonly value: "files:\n \"newFile.ts\":\n description: \"A new utility file\"\n api:\n functions:\n 1:\n name: \"processData\"\n params:\n 1: { name: \"data\", type: \"object\" }\n returns: \"object\"";
1872
- }];
1873
- }, {
1874
- readonly description: "Update an existing file description";
1875
- readonly parameters: [{
1876
- readonly name: "path";
1877
- readonly value: "src/utils";
1878
- }, {
1879
- readonly name: "knowledge";
1880
- readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1881
- }];
1882
- }, {
1883
- readonly description: "Add a new rule";
1884
- readonly parameters: [{
1885
- readonly name: "path";
1886
- readonly value: "src";
1887
- }, {
1888
- readonly name: "knowledge";
1889
- readonly value: "rules:\n 10: \"New rule to follow\"";
1890
- }];
1891
- }, {
1892
- readonly description: "Remove a rule";
1893
- readonly parameters: [{
1894
- readonly name: "path";
1895
- readonly value: "src";
1896
- }, {
1897
- readonly name: "knowledge";
1898
- readonly value: "rules:\n 5: null";
1899
- }];
1900
- }, {
1901
- readonly description: "Update nested properties using dot notation";
1902
- readonly parameters: [{
1903
- readonly name: "path";
1904
- readonly value: "src/components";
1905
- }, {
1906
- readonly name: "knowledge";
1907
- readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1908
- }];
1909
- }];
1910
- permissionLevel: PermissionLevel.Write;
1911
- };
1912
- export { _default_9 as default_alias_16 }
1913
- export { _default_9 as updateKnowledge }
1914
- export { _default_9 as updateKnowledge_alias_1 }
1915
- export { _default_9 as updateKnowledge_alias_2 }
1912
+ export { _default_9 as default_alias_15 }
1913
+ export { _default_9 as searchFiles }
1914
+ export { _default_9 as searchFiles_alias_1 }
1915
+ export { _default_9 as searchFiles_alias_2 }
1916
1916
 
1917
1917
  /**
1918
1918
  * AI tool for creating new projects based on user specifications.
@@ -1976,8 +1976,8 @@ export { defaultModels as defaultModels_alias_1 }
1976
1976
  */
1977
1977
  declare const editFile_2: (fileContent: string, operations: EditOperation[]) => Promise<string>;
1978
1978
  export { editFile_2 as editFileHelper }
1979
+ export { editFile_2 as editFile_alias_2 }
1979
1980
  export { editFile_2 as editFile_alias_3 }
1980
- export { editFile_2 as editFile_alias_4 }
1981
1981
 
1982
1982
  export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
1983
1983
 
@@ -2667,8 +2667,8 @@ export { Policies as Policies_alias_1 }
2667
2667
 
2668
2668
  declare const replaceInFile_2: (fileContent: string, diff: string) => Promise<string>;
2669
2669
  export { replaceInFile_2 as replaceInFileHelper }
2670
- export { replaceInFile_2 as replaceInFile_alias_2 }
2671
2670
  export { replaceInFile_2 as replaceInFile_alias_3 }
2671
+ export { replaceInFile_2 as replaceInFile_alias_4 }
2672
2672
 
2673
2673
  declare const responsePrompts: {
2674
2674
  readonly errorInvokeTool: (tool: string, error: unknown) => string;