@polka-codes/core 0.8.11 → 0.8.12

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.
@@ -8,6 +8,7 @@ declare abstract class AgentBase {
8
8
  protected readonly config: Readonly<AgentBaseConfig>;
9
9
  protected readonly handlers: Record<string, FullToolInfo>;
10
10
  constructor(name: string, ai: AiServiceBase, config: AgentBaseConfig);
11
+ get parameters(): Readonly<any>;
11
12
  get messages(): Readonly<MessageParam[]>;
12
13
  setMessages(messages: Readonly<MessageParam[]>): void;
13
14
  start(prompt: string): Promise<ExitReason>;
@@ -93,7 +94,8 @@ export { agentsPrompt as agentsPrompt_alias_2 }
93
94
 
94
95
  declare abstract class AiServiceBase {
95
96
  readonly usageMeter: UsageMeter;
96
- constructor(usageMeter: UsageMeter);
97
+ readonly options: AiServiceOptions;
98
+ constructor(options: AiServiceOptions);
97
99
  abstract get model(): {
98
100
  provider: string;
99
101
  id: string;
@@ -162,19 +164,19 @@ export { allAgents as allAgents_alias_1 }
162
164
 
163
165
  export declare namespace allTools {
164
166
  export {
165
- _default as askFollowupQuestion,
166
- _default_2 as attemptCompletion,
167
- _default_3 as delegate,
168
- _default_4 as executeCommand,
169
- _default_5 as listFiles,
170
- _default_6 as readFile,
171
- _default_7 as replaceInFile,
167
+ _default_2 as askFollowupQuestion,
168
+ _default_3 as attemptCompletion,
169
+ _default_4 as delegate,
170
+ _default_5 as executeCommand,
171
+ _default_6 as listFiles,
172
+ _default_7 as readFile,
172
173
  _default_8 as searchFiles,
173
174
  _default_9 as updateKnowledge,
174
175
  _default_10 as writeToFile,
175
176
  _default_11 as handOver,
176
177
  _default_12 as removeFile,
177
- _default_13 as renameFile
178
+ _default_13 as renameFile,
179
+ _default_14 as editFile
178
180
  }
179
181
  }
180
182
 
@@ -773,133 +775,60 @@ export declare class DeepSeekService extends AiServiceBase {
773
775
 
774
776
  declare const _default: {
775
777
  handler: ToolHandler<{
776
- readonly name: "ask_followup_question";
777
- readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
778
+ readonly name: "replace_in_file";
779
+ 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.";
778
780
  readonly parameters: [{
779
- readonly name: "questions";
780
- readonly description: "One or more follow-up questions you need answered before you can continue.";
781
+ readonly name: "path";
782
+ readonly description: "The path of the file to modify";
781
783
  readonly required: true;
782
- readonly allowMultiple: true;
783
- readonly usageValue: "questions here";
784
- readonly children: [{
785
- readonly name: "prompt";
786
- readonly description: "The text of the question.";
787
- readonly required: true;
788
- readonly usageValue: "question text here";
789
- }, {
790
- readonly name: "options";
791
- readonly description: "Ordered list of suggested answers (omit if none).";
792
- readonly required: false;
793
- readonly allowMultiple: true;
794
- readonly usageValue: "suggested answer here";
795
- }];
784
+ readonly usageValue: "File path here";
785
+ }, {
786
+ readonly name: "diff";
787
+ 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";
788
+ readonly required: true;
789
+ readonly usageValue: "Search and replace blocks here";
796
790
  }];
797
791
  readonly examples: [{
798
- readonly description: "Single clarifying question (no options)";
799
- readonly parameters: [{
800
- readonly name: "questions";
801
- readonly value: {
802
- readonly prompt: "What is the target deployment environment?";
803
- };
804
- }];
805
- }, {
806
- readonly description: "Single question with multiple-choice options";
807
- readonly parameters: [{
808
- readonly name: "questions";
809
- readonly value: {
810
- readonly prompt: "Which frontend framework are you using?";
811
- readonly options: ["React", "Angular", "Vue", "Svelte"];
812
- };
813
- }];
814
- }, {
815
- readonly description: "Two related questions in one call";
816
- readonly parameters: [{
817
- readonly name: "questions";
818
- readonly value: [{
819
- readonly prompt: "What type of application are you building?";
820
- }, {
821
- readonly prompt: "Preferred programming language?";
822
- readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
823
- }];
824
- }];
825
- }, {
826
- readonly description: "Binary (yes/no) confirmation";
792
+ readonly description: "Request to replace sections of content in a file";
827
793
  readonly parameters: [{
828
- readonly name: "questions";
829
- readonly value: {
830
- readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
831
- readonly options: ["Yes", "No"];
832
- };
794
+ readonly name: "path";
795
+ readonly value: "src/main.js";
796
+ }, {
797
+ readonly name: "diff";
798
+ 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
799
  }];
834
800
  }];
835
- readonly permissionLevel: PermissionLevel.None;
836
- }, InteractionProvider>;
837
- isAvailable: (provider: InteractionProvider) => boolean;
838
- name: "ask_followup_question";
839
- description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
801
+ readonly permissionLevel: PermissionLevel.Write;
802
+ }, FilesystemProvider>;
803
+ isAvailable: (provider: FilesystemProvider) => boolean;
804
+ name: "replace_in_file";
805
+ 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.";
840
806
  parameters: [{
841
- readonly name: "questions";
842
- readonly description: "One or more follow-up questions you need answered before you can continue.";
807
+ readonly name: "path";
808
+ readonly description: "The path of the file to modify";
843
809
  readonly required: true;
844
- readonly allowMultiple: true;
845
- readonly usageValue: "questions here";
846
- readonly children: [{
847
- readonly name: "prompt";
848
- readonly description: "The text of the question.";
849
- readonly required: true;
850
- readonly usageValue: "question text here";
851
- }, {
852
- readonly name: "options";
853
- readonly description: "Ordered list of suggested answers (omit if none).";
854
- readonly required: false;
855
- readonly allowMultiple: true;
856
- readonly usageValue: "suggested answer here";
857
- }];
810
+ readonly usageValue: "File path here";
811
+ }, {
812
+ readonly name: "diff";
813
+ 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";
814
+ readonly required: true;
815
+ readonly usageValue: "Search and replace blocks here";
858
816
  }];
859
817
  examples: [{
860
- readonly description: "Single clarifying question (no options)";
861
- readonly parameters: [{
862
- readonly name: "questions";
863
- readonly value: {
864
- readonly prompt: "What is the target deployment environment?";
865
- };
866
- }];
867
- }, {
868
- readonly description: "Single question with multiple-choice options";
869
- readonly parameters: [{
870
- readonly name: "questions";
871
- readonly value: {
872
- readonly prompt: "Which frontend framework are you using?";
873
- readonly options: ["React", "Angular", "Vue", "Svelte"];
874
- };
875
- }];
876
- }, {
877
- readonly description: "Two related questions in one call";
878
- readonly parameters: [{
879
- readonly name: "questions";
880
- readonly value: [{
881
- readonly prompt: "What type of application are you building?";
882
- }, {
883
- readonly prompt: "Preferred programming language?";
884
- readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
885
- }];
886
- }];
887
- }, {
888
- readonly description: "Binary (yes/no) confirmation";
818
+ readonly description: "Request to replace sections of content in a file";
889
819
  readonly parameters: [{
890
- readonly name: "questions";
891
- readonly value: {
892
- readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
893
- readonly options: ["Yes", "No"];
894
- };
820
+ readonly name: "path";
821
+ readonly value: "src/main.js";
822
+ }, {
823
+ readonly name: "diff";
824
+ 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";
895
825
  }];
896
826
  }];
897
- permissionLevel: PermissionLevel.None;
827
+ permissionLevel: PermissionLevel.Write;
898
828
  };
899
- export { _default as askFollowupQuestion }
900
- export { _default as askFollowupQuestion_alias_1 }
901
- export { _default as askFollowupQuestion_alias_2 }
902
- export { _default as default_alias_4 }
829
+ export { _default as default_alias_14 }
830
+ export { _default as replaceInFile }
831
+ export { _default as replaceInFile_alias_1 }
903
832
 
904
833
  declare const _default_10: {
905
834
  handler: ToolHandler<{
@@ -954,7 +883,7 @@ declare const _default_10: {
954
883
  }];
955
884
  permissionLevel: PermissionLevel.Write;
956
885
  };
957
- export { _default_10 as default_alias_16 }
886
+ export { _default_10 as default_alias_17 }
958
887
  export { _default_10 as writeToFile }
959
888
  export { _default_10 as writeToFile_alias_1 }
960
889
  export { _default_10 as writeToFile_alias_2 }
@@ -1044,7 +973,7 @@ declare const _default_11: {
1044
973
  }];
1045
974
  permissionLevel: PermissionLevel.None;
1046
975
  };
1047
- export { _default_11 as default_alias_8 }
976
+ export { _default_11 as default_alias_9 }
1048
977
  export { _default_11 as handOver }
1049
978
  export { _default_11 as handOver_alias_1 }
1050
979
  export { _default_11 as handOver_alias_2 }
@@ -1086,7 +1015,7 @@ declare const _default_12: {
1086
1015
  }];
1087
1016
  permissionLevel: PermissionLevel.Write;
1088
1017
  };
1089
- export { _default_12 as default_alias_11 }
1018
+ export { _default_12 as default_alias_12 }
1090
1019
  export { _default_12 as removeFile }
1091
1020
  export { _default_12 as removeFile_alias_1 }
1092
1021
  export { _default_12 as removeFile_alias_2 }
@@ -1096,60 +1025,370 @@ declare const _default_13: {
1096
1025
  readonly name: "rename_file";
1097
1026
  readonly description: "Request to rename a file from source path to target path.";
1098
1027
  readonly parameters: [{
1099
- readonly name: "sourcePath";
1100
- readonly description: "The current path of the file";
1101
- readonly required: true;
1102
- readonly usageValue: "Source file path here";
1103
- }, {
1104
- readonly name: "targetPath";
1105
- readonly description: "The new path for the file";
1106
- readonly required: true;
1107
- readonly usageValue: "Target file path here";
1028
+ readonly name: "source_path";
1029
+ readonly description: "The current path of the file";
1030
+ readonly required: true;
1031
+ readonly usageValue: "Source file path here";
1032
+ }, {
1033
+ readonly name: "target_path";
1034
+ readonly description: "The new path for the file";
1035
+ readonly required: true;
1036
+ readonly usageValue: "Target file path here";
1037
+ }];
1038
+ readonly examples: [{
1039
+ readonly description: "Request to rename a file";
1040
+ readonly parameters: [{
1041
+ readonly name: "source_path";
1042
+ readonly value: "src/old-name.js";
1043
+ }, {
1044
+ readonly name: "target_path";
1045
+ readonly value: "src/new-name.js";
1046
+ }];
1047
+ }];
1048
+ readonly permissionLevel: PermissionLevel.Write;
1049
+ }, FilesystemProvider>;
1050
+ isAvailable: (provider: FilesystemProvider) => boolean;
1051
+ name: "rename_file";
1052
+ description: "Request to rename a file from source path to target path.";
1053
+ parameters: [{
1054
+ readonly name: "source_path";
1055
+ readonly description: "The current path of the file";
1056
+ readonly required: true;
1057
+ readonly usageValue: "Source file path here";
1058
+ }, {
1059
+ readonly name: "target_path";
1060
+ readonly description: "The new path for the file";
1061
+ readonly required: true;
1062
+ readonly usageValue: "Target file path here";
1063
+ }];
1064
+ examples: [{
1065
+ readonly description: "Request to rename a file";
1066
+ readonly parameters: [{
1067
+ readonly name: "source_path";
1068
+ readonly value: "src/old-name.js";
1069
+ }, {
1070
+ readonly name: "target_path";
1071
+ readonly value: "src/new-name.js";
1072
+ }];
1073
+ }];
1074
+ permissionLevel: PermissionLevel.Write;
1075
+ };
1076
+ export { _default_13 as default_alias_13 }
1077
+ export { _default_13 as renameFile }
1078
+ export { _default_13 as renameFile_alias_1 }
1079
+ export { _default_13 as renameFile_alias_2 }
1080
+
1081
+ declare const _default_14: {
1082
+ handler: ToolHandler<{
1083
+ readonly name: "edit_file";
1084
+ readonly description: "Request to edit file contents using before/after text anchors with flexible operations. Supports multiple edit operations in a single call.";
1085
+ readonly parameters: [{
1086
+ readonly name: "path";
1087
+ readonly description: "The path of the file to edit";
1088
+ readonly required: true;
1089
+ readonly usageValue: "File path here";
1090
+ }, {
1091
+ readonly name: "operations";
1092
+ readonly description: "Edit operation with before_text, after_text, new_text, and optional line range hints";
1093
+ readonly required: true;
1094
+ readonly allowMultiple: true;
1095
+ readonly children: [{
1096
+ readonly name: "before_text";
1097
+ readonly description: "Text to find as the start anchor (use <<<START_OF_FILE>>> for file start)";
1098
+ readonly required: false;
1099
+ readonly usageValue: "Text before the edit location";
1100
+ }, {
1101
+ readonly name: "after_text";
1102
+ readonly description: "Text to find as the end anchor (use <<<END_OF_FILE>>> for file end)";
1103
+ readonly required: false;
1104
+ readonly usageValue: "Text after the edit location";
1105
+ }, {
1106
+ readonly name: "new_text";
1107
+ readonly description: "Text to replace the content between before_text and after_text";
1108
+ readonly required: true;
1109
+ readonly usageValue: "New text content";
1110
+ }, {
1111
+ readonly name: "before_text_line_start";
1112
+ readonly description: "Optional line number hint for before_text location (1-based)";
1113
+ readonly required: false;
1114
+ readonly usageValue: "10";
1115
+ }, {
1116
+ readonly name: "after_text_line_start";
1117
+ readonly description: "Optional line number hint for after_text location (1-based)";
1118
+ readonly required: false;
1119
+ readonly usageValue: "20";
1120
+ }];
1121
+ readonly usageValue: "operations here";
1122
+ }];
1123
+ readonly examples: [{
1124
+ readonly description: "Replace content between two text anchors";
1125
+ readonly parameters: [{
1126
+ readonly name: "path";
1127
+ readonly value: "src/main.ts";
1128
+ }, {
1129
+ readonly name: "operations";
1130
+ readonly value: {
1131
+ readonly before_text: "function oldFunction() {";
1132
+ readonly after_text: "}";
1133
+ readonly new_text: "\n return \"new implementation\";\n";
1134
+ };
1135
+ }];
1136
+ }, {
1137
+ readonly description: "Insert at start of file";
1138
+ readonly parameters: [{
1139
+ readonly name: "path";
1140
+ readonly value: "src/header.ts";
1141
+ }, {
1142
+ readonly name: "operations";
1143
+ readonly value: {
1144
+ readonly before_text: "<<<START_OF_FILE>>>";
1145
+ readonly after_text: "export";
1146
+ readonly new_text: "// File header comment\n";
1147
+ };
1148
+ }];
1149
+ }, {
1150
+ readonly description: "Multiple operations in one call";
1151
+ readonly parameters: [{
1152
+ readonly name: "path";
1153
+ readonly value: "src/utils.ts";
1154
+ }, {
1155
+ readonly name: "operations";
1156
+ readonly value: [{
1157
+ readonly before_text: "import React";
1158
+ readonly after_text: "from \"react\"";
1159
+ readonly new_text: ", { useState }";
1160
+ }, {
1161
+ readonly before_text: "function Component() {";
1162
+ readonly after_text: "return (";
1163
+ readonly new_text: "\n const [state, setState] = useState(false);\n ";
1164
+ }];
1165
+ }];
1166
+ }];
1167
+ readonly permissionLevel: PermissionLevel.Write;
1168
+ }, FilesystemProvider>;
1169
+ isAvailable: (provider: FilesystemProvider) => boolean;
1170
+ name: "edit_file";
1171
+ description: "Request to edit file contents using before/after text anchors with flexible operations. Supports multiple edit operations in a single call.";
1172
+ parameters: [{
1173
+ readonly name: "path";
1174
+ readonly description: "The path of the file to edit";
1175
+ readonly required: true;
1176
+ readonly usageValue: "File path here";
1177
+ }, {
1178
+ readonly name: "operations";
1179
+ readonly description: "Edit operation with before_text, after_text, new_text, and optional line range hints";
1180
+ readonly required: true;
1181
+ readonly allowMultiple: true;
1182
+ readonly children: [{
1183
+ readonly name: "before_text";
1184
+ readonly description: "Text to find as the start anchor (use <<<START_OF_FILE>>> for file start)";
1185
+ readonly required: false;
1186
+ readonly usageValue: "Text before the edit location";
1187
+ }, {
1188
+ readonly name: "after_text";
1189
+ readonly description: "Text to find as the end anchor (use <<<END_OF_FILE>>> for file end)";
1190
+ readonly required: false;
1191
+ readonly usageValue: "Text after the edit location";
1192
+ }, {
1193
+ readonly name: "new_text";
1194
+ readonly description: "Text to replace the content between before_text and after_text";
1195
+ readonly required: true;
1196
+ readonly usageValue: "New text content";
1197
+ }, {
1198
+ readonly name: "before_text_line_start";
1199
+ readonly description: "Optional line number hint for before_text location (1-based)";
1200
+ readonly required: false;
1201
+ readonly usageValue: "10";
1202
+ }, {
1203
+ readonly name: "after_text_line_start";
1204
+ readonly description: "Optional line number hint for after_text location (1-based)";
1205
+ readonly required: false;
1206
+ readonly usageValue: "20";
1207
+ }];
1208
+ readonly usageValue: "operations here";
1209
+ }];
1210
+ examples: [{
1211
+ readonly description: "Replace content between two text anchors";
1212
+ readonly parameters: [{
1213
+ readonly name: "path";
1214
+ readonly value: "src/main.ts";
1215
+ }, {
1216
+ readonly name: "operations";
1217
+ readonly value: {
1218
+ readonly before_text: "function oldFunction() {";
1219
+ readonly after_text: "}";
1220
+ readonly new_text: "\n return \"new implementation\";\n";
1221
+ };
1222
+ }];
1223
+ }, {
1224
+ readonly description: "Insert at start of file";
1225
+ readonly parameters: [{
1226
+ readonly name: "path";
1227
+ readonly value: "src/header.ts";
1228
+ }, {
1229
+ readonly name: "operations";
1230
+ readonly value: {
1231
+ readonly before_text: "<<<START_OF_FILE>>>";
1232
+ readonly after_text: "export";
1233
+ readonly new_text: "// File header comment\n";
1234
+ };
1235
+ }];
1236
+ }, {
1237
+ readonly description: "Multiple operations in one call";
1238
+ readonly parameters: [{
1239
+ readonly name: "path";
1240
+ readonly value: "src/utils.ts";
1241
+ }, {
1242
+ readonly name: "operations";
1243
+ readonly value: [{
1244
+ readonly before_text: "import React";
1245
+ readonly after_text: "from \"react\"";
1246
+ readonly new_text: ", { useState }";
1247
+ }, {
1248
+ readonly before_text: "function Component() {";
1249
+ readonly after_text: "return (";
1250
+ readonly new_text: "\n const [state, setState] = useState(false);\n ";
1251
+ }];
1252
+ }];
1253
+ }];
1254
+ permissionLevel: PermissionLevel.Write;
1255
+ };
1256
+ export { _default_14 as default_alias_7 }
1257
+ export { _default_14 as editFile }
1258
+ export { _default_14 as editFile_alias_1 }
1259
+ export { _default_14 as editFile_alias_2 }
1260
+
1261
+ declare const _default_2: {
1262
+ handler: ToolHandler<{
1263
+ readonly name: "ask_followup_question";
1264
+ readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
1265
+ readonly parameters: [{
1266
+ readonly name: "questions";
1267
+ readonly description: "One or more follow-up questions you need answered before you can continue.";
1268
+ readonly required: true;
1269
+ readonly allowMultiple: true;
1270
+ readonly usageValue: "questions here";
1271
+ readonly children: [{
1272
+ readonly name: "prompt";
1273
+ readonly description: "The text of the question.";
1274
+ readonly required: true;
1275
+ readonly usageValue: "question text here";
1276
+ }, {
1277
+ readonly name: "options";
1278
+ readonly description: "Ordered list of suggested answers (omit if none).";
1279
+ readonly required: false;
1280
+ readonly allowMultiple: true;
1281
+ readonly usageValue: "suggested answer here";
1282
+ }];
1283
+ }];
1284
+ readonly examples: [{
1285
+ readonly description: "Single clarifying question (no options)";
1286
+ readonly parameters: [{
1287
+ readonly name: "questions";
1288
+ readonly value: {
1289
+ readonly prompt: "What is the target deployment environment?";
1290
+ };
1291
+ }];
1292
+ }, {
1293
+ readonly description: "Single question with multiple-choice options";
1294
+ readonly parameters: [{
1295
+ readonly name: "questions";
1296
+ readonly value: {
1297
+ readonly prompt: "Which frontend framework are you using?";
1298
+ readonly options: ["React", "Angular", "Vue", "Svelte"];
1299
+ };
1300
+ }];
1301
+ }, {
1302
+ readonly description: "Two related questions in one call";
1303
+ readonly parameters: [{
1304
+ readonly name: "questions";
1305
+ readonly value: [{
1306
+ readonly prompt: "What type of application are you building?";
1307
+ }, {
1308
+ readonly prompt: "Preferred programming language?";
1309
+ readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
1310
+ }];
1311
+ }];
1312
+ }, {
1313
+ readonly description: "Binary (yes/no) confirmation";
1314
+ readonly parameters: [{
1315
+ readonly name: "questions";
1316
+ readonly value: {
1317
+ readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
1318
+ readonly options: ["Yes", "No"];
1319
+ };
1320
+ }];
1321
+ }];
1322
+ readonly permissionLevel: PermissionLevel.None;
1323
+ }, InteractionProvider>;
1324
+ isAvailable: (provider: InteractionProvider) => boolean;
1325
+ name: "ask_followup_question";
1326
+ description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
1327
+ parameters: [{
1328
+ readonly name: "questions";
1329
+ readonly description: "One or more follow-up questions you need answered before you can continue.";
1330
+ readonly required: true;
1331
+ readonly allowMultiple: true;
1332
+ readonly usageValue: "questions here";
1333
+ readonly children: [{
1334
+ readonly name: "prompt";
1335
+ readonly description: "The text of the question.";
1336
+ readonly required: true;
1337
+ readonly usageValue: "question text here";
1338
+ }, {
1339
+ readonly name: "options";
1340
+ readonly description: "Ordered list of suggested answers (omit if none).";
1341
+ readonly required: false;
1342
+ readonly allowMultiple: true;
1343
+ readonly usageValue: "suggested answer here";
1344
+ }];
1345
+ }];
1346
+ examples: [{
1347
+ readonly description: "Single clarifying question (no options)";
1348
+ readonly parameters: [{
1349
+ readonly name: "questions";
1350
+ readonly value: {
1351
+ readonly prompt: "What is the target deployment environment?";
1352
+ };
1108
1353
  }];
1109
- readonly examples: [{
1110
- readonly description: "Request to rename a file";
1111
- readonly parameters: [{
1112
- readonly name: "sourcePath";
1113
- readonly value: "src/old-name.js";
1354
+ }, {
1355
+ readonly description: "Single question with multiple-choice options";
1356
+ readonly parameters: [{
1357
+ readonly name: "questions";
1358
+ readonly value: {
1359
+ readonly prompt: "Which frontend framework are you using?";
1360
+ readonly options: ["React", "Angular", "Vue", "Svelte"];
1361
+ };
1362
+ }];
1363
+ }, {
1364
+ readonly description: "Two related questions in one call";
1365
+ readonly parameters: [{
1366
+ readonly name: "questions";
1367
+ readonly value: [{
1368
+ readonly prompt: "What type of application are you building?";
1114
1369
  }, {
1115
- readonly name: "targetPath";
1116
- readonly value: "src/new-name.js";
1370
+ readonly prompt: "Preferred programming language?";
1371
+ readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
1117
1372
  }];
1118
1373
  }];
1119
- readonly permissionLevel: PermissionLevel.Write;
1120
- }, FilesystemProvider>;
1121
- isAvailable: (provider: FilesystemProvider) => boolean;
1122
- name: "rename_file";
1123
- description: "Request to rename a file from source path to target path.";
1124
- parameters: [{
1125
- readonly name: "sourcePath";
1126
- readonly description: "The current path of the file";
1127
- readonly required: true;
1128
- readonly usageValue: "Source file path here";
1129
1374
  }, {
1130
- readonly name: "targetPath";
1131
- readonly description: "The new path for the file";
1132
- readonly required: true;
1133
- readonly usageValue: "Target file path here";
1134
- }];
1135
- examples: [{
1136
- readonly description: "Request to rename a file";
1375
+ readonly description: "Binary (yes/no) confirmation";
1137
1376
  readonly parameters: [{
1138
- readonly name: "sourcePath";
1139
- readonly value: "src/old-name.js";
1140
- }, {
1141
- readonly name: "targetPath";
1142
- readonly value: "src/new-name.js";
1377
+ readonly name: "questions";
1378
+ readonly value: {
1379
+ readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
1380
+ readonly options: ["Yes", "No"];
1381
+ };
1143
1382
  }];
1144
1383
  }];
1145
- permissionLevel: PermissionLevel.Write;
1384
+ permissionLevel: PermissionLevel.None;
1146
1385
  };
1147
- export { _default_13 as default_alias_12 }
1148
- export { _default_13 as renameFile }
1149
- export { _default_13 as renameFile_alias_1 }
1150
- export { _default_13 as renameFile_alias_2 }
1386
+ export { _default_2 as askFollowupQuestion }
1387
+ export { _default_2 as askFollowupQuestion_alias_1 }
1388
+ export { _default_2 as askFollowupQuestion_alias_2 }
1389
+ export { _default_2 as default_alias_4 }
1151
1390
 
1152
- declare const _default_2: {
1391
+ declare const _default_3: {
1153
1392
  handler: ToolHandler<{
1154
1393
  readonly name: "attempt_completion";
1155
1394
  readonly description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
@@ -1186,12 +1425,12 @@ declare const _default_2: {
1186
1425
  }];
1187
1426
  permissionLevel: PermissionLevel.None;
1188
1427
  };
1189
- export { _default_2 as attemptCompletion }
1190
- export { _default_2 as attemptCompletion_alias_1 }
1191
- export { _default_2 as attemptCompletion_alias_2 }
1192
- export { _default_2 as default_alias_5 }
1428
+ export { _default_3 as attemptCompletion }
1429
+ export { _default_3 as attemptCompletion_alias_1 }
1430
+ export { _default_3 as attemptCompletion_alias_2 }
1431
+ export { _default_3 as default_alias_5 }
1193
1432
 
1194
- declare const _default_3: {
1433
+ declare const _default_4: {
1195
1434
  handler: ToolHandler<{
1196
1435
  readonly name: "delegate";
1197
1436
  readonly description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
@@ -1276,12 +1515,12 @@ declare const _default_3: {
1276
1515
  }];
1277
1516
  permissionLevel: PermissionLevel.None;
1278
1517
  };
1279
- export { _default_3 as default_alias_6 }
1280
- export { _default_3 as delegate }
1281
- export { _default_3 as delegate_alias_1 }
1282
- export { _default_3 as delegate_alias_2 }
1518
+ export { _default_4 as default_alias_6 }
1519
+ export { _default_4 as delegate }
1520
+ export { _default_4 as delegate_alias_1 }
1521
+ export { _default_4 as delegate_alias_2 }
1283
1522
 
1284
- declare const _default_4: {
1523
+ declare const _default_5: {
1285
1524
  handler: ToolHandler<{
1286
1525
  readonly name: "execute_command";
1287
1526
  readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. After an `execute_command` call, no other tool calls are allowed in the same assistant response.";
@@ -1334,12 +1573,12 @@ declare const _default_4: {
1334
1573
  }];
1335
1574
  permissionLevel: PermissionLevel.Arbitrary;
1336
1575
  };
1337
- export { _default_4 as default_alias_7 }
1338
- export { _default_4 as executeCommand }
1339
- export { _default_4 as executeCommand_alias_1 }
1340
- export { _default_4 as executeCommand_alias_2 }
1576
+ export { _default_5 as default_alias_8 }
1577
+ export { _default_5 as executeCommand }
1578
+ export { _default_5 as executeCommand_alias_1 }
1579
+ export { _default_5 as executeCommand_alias_2 }
1341
1580
 
1342
- declare const _default_5: {
1581
+ declare const _default_6: {
1343
1582
  handler: ToolHandler<{
1344
1583
  readonly name: "list_files";
1345
1584
  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.";
@@ -1402,12 +1641,12 @@ declare const _default_5: {
1402
1641
  }];
1403
1642
  permissionLevel: PermissionLevel.Read;
1404
1643
  };
1405
- export { _default_5 as default_alias_9 }
1406
- export { _default_5 as listFiles }
1407
- export { _default_5 as listFiles_alias_1 }
1408
- export { _default_5 as listFiles_alias_2 }
1644
+ export { _default_6 as default_alias_10 }
1645
+ export { _default_6 as listFiles }
1646
+ export { _default_6 as listFiles_alias_1 }
1647
+ export { _default_6 as listFiles_alias_2 }
1409
1648
 
1410
- declare const _default_6: {
1649
+ declare const _default_7: {
1411
1650
  handler: ToolHandler<{
1412
1651
  readonly name: "read_file";
1413
1652
  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.";
@@ -1456,68 +1695,10 @@ declare const _default_6: {
1456
1695
  }];
1457
1696
  permissionLevel: PermissionLevel.Read;
1458
1697
  };
1459
- export { _default_6 as default_alias_10 }
1460
- export { _default_6 as readFile }
1461
- export { _default_6 as readFile_alias_1 }
1462
- export { _default_6 as readFile_alias_2 }
1463
-
1464
- declare const _default_7: {
1465
- handler: ToolHandler<{
1466
- readonly name: "replace_in_file";
1467
- 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.";
1468
- readonly parameters: [{
1469
- readonly name: "path";
1470
- readonly description: "The path of the file to modify";
1471
- readonly required: true;
1472
- readonly usageValue: "File path here";
1473
- }, {
1474
- readonly name: "diff";
1475
- 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";
1476
- readonly required: true;
1477
- readonly usageValue: "Search and replace blocks here";
1478
- }];
1479
- readonly examples: [{
1480
- readonly description: "Request to replace sections of content in a file";
1481
- readonly parameters: [{
1482
- readonly name: "path";
1483
- readonly value: "src/main.js";
1484
- }, {
1485
- readonly name: "diff";
1486
- 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";
1487
- }];
1488
- }];
1489
- readonly permissionLevel: PermissionLevel.Write;
1490
- }, FilesystemProvider>;
1491
- isAvailable: (provider: FilesystemProvider) => boolean;
1492
- name: "replace_in_file";
1493
- 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.";
1494
- parameters: [{
1495
- readonly name: "path";
1496
- readonly description: "The path of the file to modify";
1497
- readonly required: true;
1498
- readonly usageValue: "File path here";
1499
- }, {
1500
- readonly name: "diff";
1501
- 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";
1502
- readonly required: true;
1503
- readonly usageValue: "Search and replace blocks here";
1504
- }];
1505
- examples: [{
1506
- readonly description: "Request to replace sections of content in a file";
1507
- readonly parameters: [{
1508
- readonly name: "path";
1509
- readonly value: "src/main.js";
1510
- }, {
1511
- readonly name: "diff";
1512
- 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";
1513
- }];
1514
- }];
1515
- permissionLevel: PermissionLevel.Write;
1516
- };
1517
- export { _default_7 as default_alias_13 }
1518
- export { _default_7 as replaceInFile }
1519
- export { _default_7 as replaceInFile_alias_1 }
1520
- export { _default_7 as replaceInFile_alias_2 }
1698
+ export { _default_7 as default_alias_11 }
1699
+ export { _default_7 as readFile }
1700
+ export { _default_7 as readFile_alias_1 }
1701
+ export { _default_7 as readFile_alias_2 }
1521
1702
 
1522
1703
  declare const _default_8: {
1523
1704
  handler: ToolHandler<{
@@ -1588,7 +1769,7 @@ declare const _default_8: {
1588
1769
  }];
1589
1770
  permissionLevel: PermissionLevel.Read;
1590
1771
  };
1591
- export { _default_8 as default_alias_14 }
1772
+ export { _default_8 as default_alias_15 }
1592
1773
  export { _default_8 as searchFiles }
1593
1774
  export { _default_8 as searchFiles_alias_1 }
1594
1775
  export { _default_8 as searchFiles_alias_2 }
@@ -1718,7 +1899,7 @@ declare const _default_9: {
1718
1899
  }];
1719
1900
  permissionLevel: PermissionLevel.Write;
1720
1901
  };
1721
- export { _default_9 as default_alias_15 }
1902
+ export { _default_9 as default_alias_16 }
1722
1903
  export { _default_9 as updateKnowledge }
1723
1904
  export { _default_9 as updateKnowledge_alias_1 }
1724
1905
  export { _default_9 as updateKnowledge_alias_2 }
@@ -1777,8 +1958,33 @@ declare const defaultModels: {
1777
1958
  export { defaultModels }
1778
1959
  export { defaultModels as defaultModels_alias_1 }
1779
1960
 
1961
+ /**
1962
+ * Apply multiple edit operations to file content using before/after text anchors
1963
+ * @param fileContent - The original file content
1964
+ * @param operations - Array of edit operations to apply
1965
+ * @returns The modified file content
1966
+ */
1967
+ declare const editFile_2: (fileContent: string, operations: EditOperation[]) => Promise<string>;
1968
+ export { editFile_2 as editFileHelper }
1969
+ export { editFile_2 as editFile_alias_3 }
1970
+ export { editFile_2 as editFile_alias_4 }
1971
+
1780
1972
  export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
1781
1973
 
1974
+ declare interface EditOperation {
1975
+ before_text?: string;
1976
+ after_text?: string;
1977
+ new_text: string;
1978
+ before_text_line_start?: number;
1979
+ after_text_line_start?: number;
1980
+ }
1981
+ export { EditOperation }
1982
+ export { EditOperation as EditOperation_alias_1 }
1983
+
1984
+ declare const END_OF_FILE = "<<<END_OF_FILE>>>";
1985
+ export { END_OF_FILE }
1986
+ export { END_OF_FILE as END_OF_FILE_alias_1 }
1987
+
1782
1988
  declare const executeAgentTool: <T extends AiToolDefinition<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
1783
1989
  export { executeAgentTool }
1784
1990
  export { executeAgentTool as executeAgentTool_alias_1 }
@@ -1942,13 +2148,15 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
1942
2148
 
1943
2149
  export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
1944
2150
 
2151
+ export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
2152
+
1945
2153
  export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
1946
2154
 
1947
- export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
2155
+ export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, FilesystemProvider>;
1948
2156
 
1949
- export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, any>;
2157
+ export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, CommandProvider>;
1950
2158
 
1951
- export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, FilesystemProvider>;
2159
+ export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, any>;
1952
2160
 
1953
2161
  export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
1954
2162
 
@@ -1983,13 +2191,15 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
1983
2191
 
1984
2192
  export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
1985
2193
 
2194
+ export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
2195
+
1986
2196
  export declare const isAvailable_alias_2: (_provider: any) => boolean;
1987
2197
 
1988
- export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
2198
+ export declare const isAvailable_alias_3: (provider: FilesystemProvider) => boolean;
1989
2199
 
1990
- export declare const isAvailable_alias_4: (_provider: any) => boolean;
2200
+ export declare const isAvailable_alias_4: (provider: CommandProvider) => boolean;
1991
2201
 
1992
- export declare const isAvailable_alias_5: (provider: FilesystemProvider) => boolean;
2202
+ export declare const isAvailable_alias_5: (_provider: any) => boolean;
1993
2203
 
1994
2204
  export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
1995
2205
 
@@ -2414,15 +2624,16 @@ export { PermissionLevel }
2414
2624
  export { PermissionLevel as PermissionLevel_alias_1 }
2415
2625
 
2416
2626
  declare enum Policies {
2417
- KnowledgeManagement = "knowledgemanagement"
2627
+ KnowledgeManagement = "knowledgemanagement",
2628
+ TruncateContext = "truncatecontext"
2418
2629
  }
2419
2630
  export { Policies }
2420
2631
  export { Policies as Policies_alias_1 }
2421
2632
 
2422
2633
  declare const replaceInFile_2: (fileContent: string, diff: string) => Promise<string>;
2423
2634
  export { replaceInFile_2 as replaceInFileHelper }
2635
+ export { replaceInFile_2 as replaceInFile_alias_2 }
2424
2636
  export { replaceInFile_2 as replaceInFile_alias_3 }
2425
- export { replaceInFile_2 as replaceInFile_alias_4 }
2426
2637
 
2427
2638
  declare const responsePrompts: {
2428
2639
  readonly errorInvokeTool: (tool: string, error: unknown) => string;
@@ -2457,6 +2668,10 @@ export { SharedAgentOptions }
2457
2668
  export { SharedAgentOptions as SharedAgentOptions_alias_1 }
2458
2669
  export { SharedAgentOptions as SharedAgentOptions_alias_2 }
2459
2670
 
2671
+ declare const START_OF_FILE = "<<<START_OF_FILE>>>";
2672
+ export { START_OF_FILE }
2673
+ export { START_OF_FILE as START_OF_FILE_alias_1 }
2674
+
2460
2675
  declare const systemInformation: (info: {
2461
2676
  os: string;
2462
2677
  }) => string;
@@ -2739,6 +2954,33 @@ export declare const toolInfo_alias_1: {
2739
2954
  };
2740
2955
 
2741
2956
  export declare const toolInfo_alias_10: {
2957
+ readonly name: "replace_in_file";
2958
+ 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.";
2959
+ readonly parameters: [{
2960
+ readonly name: "path";
2961
+ readonly description: "The path of the file to modify";
2962
+ readonly required: true;
2963
+ readonly usageValue: "File path here";
2964
+ }, {
2965
+ readonly name: "diff";
2966
+ 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";
2967
+ readonly required: true;
2968
+ readonly usageValue: "Search and replace blocks here";
2969
+ }];
2970
+ readonly examples: [{
2971
+ readonly description: "Request to replace sections of content in a file";
2972
+ readonly parameters: [{
2973
+ readonly name: "path";
2974
+ readonly value: "src/main.js";
2975
+ }, {
2976
+ readonly name: "diff";
2977
+ 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";
2978
+ }];
2979
+ }];
2980
+ readonly permissionLevel: PermissionLevel.Write;
2981
+ };
2982
+
2983
+ export declare const toolInfo_alias_11: {
2742
2984
  readonly name: "search_files";
2743
2985
  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.";
2744
2986
  readonly parameters: [{
@@ -2773,7 +3015,7 @@ export declare const toolInfo_alias_10: {
2773
3015
  readonly permissionLevel: PermissionLevel.Read;
2774
3016
  };
2775
3017
 
2776
- export declare const toolInfo_alias_11: {
3018
+ export declare const toolInfo_alias_12: {
2777
3019
  readonly name: "update_knowledge";
2778
3020
  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.";
2779
3021
  readonly parameters: [{
@@ -2836,7 +3078,7 @@ export declare const toolInfo_alias_11: {
2836
3078
  readonly permissionLevel: PermissionLevel.Write;
2837
3079
  };
2838
3080
 
2839
- export declare const toolInfo_alias_12: {
3081
+ export declare const toolInfo_alias_13: {
2840
3082
  readonly name: "write_to_file";
2841
3083
  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;`.";
2842
3084
  readonly parameters: [{
@@ -2907,6 +3149,94 @@ export declare const toolInfo_alias_2: {
2907
3149
  };
2908
3150
 
2909
3151
  export declare const toolInfo_alias_3: {
3152
+ readonly name: "edit_file";
3153
+ readonly description: "Request to edit file contents using before/after text anchors with flexible operations. Supports multiple edit operations in a single call.";
3154
+ readonly parameters: [{
3155
+ readonly name: "path";
3156
+ readonly description: "The path of the file to edit";
3157
+ readonly required: true;
3158
+ readonly usageValue: "File path here";
3159
+ }, {
3160
+ readonly name: "operations";
3161
+ readonly description: "Edit operation with before_text, after_text, new_text, and optional line range hints";
3162
+ readonly required: true;
3163
+ readonly allowMultiple: true;
3164
+ readonly children: [{
3165
+ readonly name: "before_text";
3166
+ readonly description: "Text to find as the start anchor (use <<<START_OF_FILE>>> for file start)";
3167
+ readonly required: false;
3168
+ readonly usageValue: "Text before the edit location";
3169
+ }, {
3170
+ readonly name: "after_text";
3171
+ readonly description: "Text to find as the end anchor (use <<<END_OF_FILE>>> for file end)";
3172
+ readonly required: false;
3173
+ readonly usageValue: "Text after the edit location";
3174
+ }, {
3175
+ readonly name: "new_text";
3176
+ readonly description: "Text to replace the content between before_text and after_text";
3177
+ readonly required: true;
3178
+ readonly usageValue: "New text content";
3179
+ }, {
3180
+ readonly name: "before_text_line_start";
3181
+ readonly description: "Optional line number hint for before_text location (1-based)";
3182
+ readonly required: false;
3183
+ readonly usageValue: "10";
3184
+ }, {
3185
+ readonly name: "after_text_line_start";
3186
+ readonly description: "Optional line number hint for after_text location (1-based)";
3187
+ readonly required: false;
3188
+ readonly usageValue: "20";
3189
+ }];
3190
+ readonly usageValue: "operations here";
3191
+ }];
3192
+ readonly examples: [{
3193
+ readonly description: "Replace content between two text anchors";
3194
+ readonly parameters: [{
3195
+ readonly name: "path";
3196
+ readonly value: "src/main.ts";
3197
+ }, {
3198
+ readonly name: "operations";
3199
+ readonly value: {
3200
+ readonly before_text: "function oldFunction() {";
3201
+ readonly after_text: "}";
3202
+ readonly new_text: "\n return \"new implementation\";\n";
3203
+ };
3204
+ }];
3205
+ }, {
3206
+ readonly description: "Insert at start of file";
3207
+ readonly parameters: [{
3208
+ readonly name: "path";
3209
+ readonly value: "src/header.ts";
3210
+ }, {
3211
+ readonly name: "operations";
3212
+ readonly value: {
3213
+ readonly before_text: "<<<START_OF_FILE>>>";
3214
+ readonly after_text: "export";
3215
+ readonly new_text: "// File header comment\n";
3216
+ };
3217
+ }];
3218
+ }, {
3219
+ readonly description: "Multiple operations in one call";
3220
+ readonly parameters: [{
3221
+ readonly name: "path";
3222
+ readonly value: "src/utils.ts";
3223
+ }, {
3224
+ readonly name: "operations";
3225
+ readonly value: [{
3226
+ readonly before_text: "import React";
3227
+ readonly after_text: "from \"react\"";
3228
+ readonly new_text: ", { useState }";
3229
+ }, {
3230
+ readonly before_text: "function Component() {";
3231
+ readonly after_text: "return (";
3232
+ readonly new_text: "\n const [state, setState] = useState(false);\n ";
3233
+ }];
3234
+ }];
3235
+ }];
3236
+ readonly permissionLevel: PermissionLevel.Write;
3237
+ };
3238
+
3239
+ export declare const toolInfo_alias_4: {
2910
3240
  readonly name: "execute_command";
2911
3241
  readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. After an `execute_command` call, no other tool calls are allowed in the same assistant response.";
2912
3242
  readonly parameters: [{
@@ -2933,7 +3263,7 @@ export declare const toolInfo_alias_3: {
2933
3263
  readonly permissionLevel: PermissionLevel.Arbitrary;
2934
3264
  };
2935
3265
 
2936
- export declare const toolInfo_alias_4: {
3266
+ export declare const toolInfo_alias_5: {
2937
3267
  readonly name: "hand_over";
2938
3268
  readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
2939
3269
  readonly parameters: [{
@@ -2976,7 +3306,7 @@ export declare const toolInfo_alias_4: {
2976
3306
  readonly permissionLevel: PermissionLevel.None;
2977
3307
  };
2978
3308
 
2979
- export declare const toolInfo_alias_5: {
3309
+ export declare const toolInfo_alias_6: {
2980
3310
  readonly name: "list_files";
2981
3311
  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.";
2982
3312
  readonly parameters: [{
@@ -3008,7 +3338,7 @@ export declare const toolInfo_alias_5: {
3008
3338
  readonly permissionLevel: PermissionLevel.Read;
3009
3339
  };
3010
3340
 
3011
- export declare const toolInfo_alias_6: {
3341
+ export declare const toolInfo_alias_7: {
3012
3342
  readonly name: "read_file";
3013
3343
  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.";
3014
3344
  readonly parameters: [{
@@ -3033,7 +3363,7 @@ export declare const toolInfo_alias_6: {
3033
3363
  readonly permissionLevel: PermissionLevel.Read;
3034
3364
  };
3035
3365
 
3036
- export declare const toolInfo_alias_7: {
3366
+ export declare const toolInfo_alias_8: {
3037
3367
  readonly name: "remove_file";
3038
3368
  readonly description: "Request to remove a file at the specified path.";
3039
3369
  readonly parameters: [{
@@ -3052,16 +3382,16 @@ export declare const toolInfo_alias_7: {
3052
3382
  readonly permissionLevel: PermissionLevel.Write;
3053
3383
  };
3054
3384
 
3055
- export declare const toolInfo_alias_8: {
3385
+ export declare const toolInfo_alias_9: {
3056
3386
  readonly name: "rename_file";
3057
3387
  readonly description: "Request to rename a file from source path to target path.";
3058
3388
  readonly parameters: [{
3059
- readonly name: "sourcePath";
3389
+ readonly name: "source_path";
3060
3390
  readonly description: "The current path of the file";
3061
3391
  readonly required: true;
3062
3392
  readonly usageValue: "Source file path here";
3063
3393
  }, {
3064
- readonly name: "targetPath";
3394
+ readonly name: "target_path";
3065
3395
  readonly description: "The new path for the file";
3066
3396
  readonly required: true;
3067
3397
  readonly usageValue: "Target file path here";
@@ -3069,43 +3399,16 @@ export declare const toolInfo_alias_8: {
3069
3399
  readonly examples: [{
3070
3400
  readonly description: "Request to rename a file";
3071
3401
  readonly parameters: [{
3072
- readonly name: "sourcePath";
3402
+ readonly name: "source_path";
3073
3403
  readonly value: "src/old-name.js";
3074
3404
  }, {
3075
- readonly name: "targetPath";
3405
+ readonly name: "target_path";
3076
3406
  readonly value: "src/new-name.js";
3077
3407
  }];
3078
3408
  }];
3079
3409
  readonly permissionLevel: PermissionLevel.Write;
3080
3410
  };
3081
3411
 
3082
- export declare const toolInfo_alias_9: {
3083
- readonly name: "replace_in_file";
3084
- 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.";
3085
- readonly parameters: [{
3086
- readonly name: "path";
3087
- readonly description: "The path of the file to modify";
3088
- readonly required: true;
3089
- readonly usageValue: "File path here";
3090
- }, {
3091
- readonly name: "diff";
3092
- 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";
3093
- readonly required: true;
3094
- readonly usageValue: "Search and replace blocks here";
3095
- }];
3096
- readonly examples: [{
3097
- readonly description: "Request to replace sections of content in a file";
3098
- readonly parameters: [{
3099
- readonly name: "path";
3100
- readonly value: "src/main.js";
3101
- }, {
3102
- readonly name: "diff";
3103
- 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";
3104
- }];
3105
- }];
3106
- readonly permissionLevel: PermissionLevel.Write;
3107
- };
3108
-
3109
3412
  declare type ToolParameter = {
3110
3413
  name: string;
3111
3414
  description: string;
@@ -3238,6 +3541,15 @@ export { toolUsePrompt }
3238
3541
  export { toolUsePrompt as toolUsePrompt_alias_1 }
3239
3542
  export { toolUsePrompt as toolUsePrompt_alias_2 }
3240
3543
 
3544
+ declare const TruncateContextPolicy: (tools: Parameters<AgentPolicy>[0]) => {
3545
+ name: Policies;
3546
+ onBeforeRequest(agent: AgentBase): Promise<void>;
3547
+ };
3548
+ export { TruncateContextPolicy }
3549
+ export { TruncateContextPolicy as TruncateContextPolicy_alias_1 }
3550
+ export { TruncateContextPolicy as TruncateContextPolicy_alias_2 }
3551
+ export { TruncateContextPolicy as TruncateContextPolicy_alias_3 }
3552
+
3241
3553
  declare class UsageMeter {
3242
3554
  #private;
3243
3555
  readonly maxCost: number;