@polka-codes/core 0.8.22 → 0.8.24

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.
@@ -11,16 +11,16 @@ declare abstract class AgentBase {
11
11
  get parameters(): Readonly<any>;
12
12
  get messages(): Readonly<MessageParam[]>;
13
13
  setMessages(messages: Readonly<MessageParam[]>): void;
14
- start(prompt: string): Promise<ExitReason>;
15
- step(prompt: string): Promise<AssistantMessageContent[]>;
14
+ start(prompt: UserContent): Promise<ExitReason>;
15
+ step(prompt: UserContent): Promise<AssistantMessageContent[]>;
16
16
  handleStepResponse(response: AssistantMessageContent[]): Promise<{
17
17
  type: "reply";
18
- message: string;
18
+ message: UserContent;
19
19
  } | {
20
20
  type: "exit";
21
21
  reason: ExitReason;
22
22
  }>;
23
- continueTask(userMessage: string): Promise<ExitReason>;
23
+ continueTask(userMessage: UserContent): Promise<ExitReason>;
24
24
  protected abstract onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
25
25
  get model(): {
26
26
  provider: string;
@@ -168,15 +168,16 @@ export declare namespace allTools {
168
168
  _default_2 as attemptCompletion,
169
169
  _default_3 as delegate,
170
170
  _default_4 as executeCommand,
171
- _default_5 as listFiles,
172
- _default_6 as readFile,
173
- _default_7 as replaceInFile,
174
- _default_8 as searchFiles,
175
- _default_9 as updateKnowledge,
176
- _default_10 as writeToFile,
177
- _default_11 as handOver,
178
- _default_12 as removeFile,
179
- _default_13 as renameFile
171
+ _default_5 as fetchUrl,
172
+ _default_6 as listFiles,
173
+ _default_7 as readFile,
174
+ _default_8 as replaceInFile,
175
+ _default_9 as searchFiles,
176
+ _default_10 as updateKnowledge,
177
+ _default_11 as writeToFile,
178
+ _default_12 as handOver,
179
+ _default_13 as removeFile,
180
+ _default_14 as renameFile
180
181
  }
181
182
  }
182
183
 
@@ -928,9 +929,139 @@ export { _default as askFollowupQuestion_alias_2 }
928
929
  export { _default as default_alias_4 }
929
930
 
930
931
  declare const _default_10: {
932
+ handler: ToolHandler<{
933
+ readonly name: "update_knowledge";
934
+ 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.";
935
+ readonly parameters: [{
936
+ readonly name: "path";
937
+ readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
938
+ readonly required: true;
939
+ readonly usageValue: "Directory path here";
940
+ }, {
941
+ readonly name: "knowledge";
942
+ readonly description: "YAML content to merge into the knowledge file";
943
+ readonly required: true;
944
+ readonly usageValue: "YAML content with knowledge to update";
945
+ }];
946
+ readonly examples: [{
947
+ readonly description: "Add a new file entry";
948
+ readonly parameters: [{
949
+ readonly name: "path";
950
+ readonly value: "src/utils";
951
+ }, {
952
+ readonly name: "knowledge";
953
+ 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\"";
954
+ }];
955
+ }, {
956
+ readonly description: "Update an existing file description";
957
+ readonly parameters: [{
958
+ readonly name: "path";
959
+ readonly value: "src/utils";
960
+ }, {
961
+ readonly name: "knowledge";
962
+ readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
963
+ }];
964
+ }, {
965
+ readonly description: "Add a new rule";
966
+ readonly parameters: [{
967
+ readonly name: "path";
968
+ readonly value: "src";
969
+ }, {
970
+ readonly name: "knowledge";
971
+ readonly value: "rules:\n 10: \"New rule to follow\"";
972
+ }];
973
+ }, {
974
+ readonly description: "Remove a rule";
975
+ readonly parameters: [{
976
+ readonly name: "path";
977
+ readonly value: "src";
978
+ }, {
979
+ readonly name: "knowledge";
980
+ readonly value: "rules:\n 5: null";
981
+ }];
982
+ }, {
983
+ readonly description: "Update nested properties using dot notation";
984
+ readonly parameters: [{
985
+ readonly name: "path";
986
+ readonly value: "src/components";
987
+ }, {
988
+ readonly name: "knowledge";
989
+ readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
990
+ }];
991
+ }];
992
+ readonly permissionLevel: PermissionLevel.Write;
993
+ }, FilesystemProvider>;
994
+ isAvailable: (provider: FilesystemProvider) => boolean;
995
+ name: "update_knowledge";
996
+ 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.";
997
+ parameters: [{
998
+ readonly name: "path";
999
+ readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1000
+ readonly required: true;
1001
+ readonly usageValue: "Directory path here";
1002
+ }, {
1003
+ readonly name: "knowledge";
1004
+ readonly description: "YAML content to merge into the knowledge file";
1005
+ readonly required: true;
1006
+ readonly usageValue: "YAML content with knowledge to update";
1007
+ }];
1008
+ examples: [{
1009
+ readonly description: "Add a new file entry";
1010
+ readonly parameters: [{
1011
+ readonly name: "path";
1012
+ readonly value: "src/utils";
1013
+ }, {
1014
+ readonly name: "knowledge";
1015
+ 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\"";
1016
+ }];
1017
+ }, {
1018
+ readonly description: "Update an existing file description";
1019
+ readonly parameters: [{
1020
+ readonly name: "path";
1021
+ readonly value: "src/utils";
1022
+ }, {
1023
+ readonly name: "knowledge";
1024
+ readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1025
+ }];
1026
+ }, {
1027
+ readonly description: "Add a new rule";
1028
+ readonly parameters: [{
1029
+ readonly name: "path";
1030
+ readonly value: "src";
1031
+ }, {
1032
+ readonly name: "knowledge";
1033
+ readonly value: "rules:\n 10: \"New rule to follow\"";
1034
+ }];
1035
+ }, {
1036
+ readonly description: "Remove a rule";
1037
+ readonly parameters: [{
1038
+ readonly name: "path";
1039
+ readonly value: "src";
1040
+ }, {
1041
+ readonly name: "knowledge";
1042
+ readonly value: "rules:\n 5: null";
1043
+ }];
1044
+ }, {
1045
+ readonly description: "Update nested properties using dot notation";
1046
+ readonly parameters: [{
1047
+ readonly name: "path";
1048
+ readonly value: "src/components";
1049
+ }, {
1050
+ readonly name: "knowledge";
1051
+ readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1052
+ }];
1053
+ }];
1054
+ permissionLevel: PermissionLevel.Write;
1055
+ };
1056
+ export { _default_10 as default_alias_16 }
1057
+ export { _default_10 as updateKnowledge }
1058
+ export { _default_10 as updateKnowledge_alias_1 }
1059
+ export { _default_10 as updateKnowledge_alias_2 }
1060
+
1061
+ declare const _default_11: {
931
1062
  handler: ToolHandler<{
932
1063
  readonly name: "write_to_file";
933
- 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;`.";
1064
+ readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
934
1065
  readonly parameters: [{
935
1066
  readonly name: "path";
936
1067
  readonly description: "The path of the file to write to";
@@ -956,7 +1087,7 @@ declare const _default_10: {
956
1087
  }, FilesystemProvider>;
957
1088
  isAvailable: (provider: FilesystemProvider) => boolean;
958
1089
  name: "write_to_file";
959
- 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;`.";
1090
+ description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
960
1091
  parameters: [{
961
1092
  readonly name: "path";
962
1093
  readonly description: "The path of the file to write to";
@@ -980,12 +1111,12 @@ declare const _default_10: {
980
1111
  }];
981
1112
  permissionLevel: PermissionLevel.Write;
982
1113
  };
983
- export { _default_10 as default_alias_16 }
984
- export { _default_10 as writeToFile }
985
- export { _default_10 as writeToFile_alias_1 }
986
- export { _default_10 as writeToFile_alias_2 }
1114
+ export { _default_11 as default_alias_17 }
1115
+ export { _default_11 as writeToFile }
1116
+ export { _default_11 as writeToFile_alias_1 }
1117
+ export { _default_11 as writeToFile_alias_2 }
987
1118
 
988
- declare const _default_11: {
1119
+ declare const _default_12: {
989
1120
  handler: ToolHandler<{
990
1121
  readonly name: "hand_over";
991
1122
  readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
@@ -1070,12 +1201,12 @@ declare const _default_11: {
1070
1201
  }];
1071
1202
  permissionLevel: PermissionLevel.None;
1072
1203
  };
1073
- export { _default_11 as default_alias_8 }
1074
- export { _default_11 as handOver }
1075
- export { _default_11 as handOver_alias_1 }
1076
- export { _default_11 as handOver_alias_2 }
1204
+ export { _default_12 as default_alias_9 }
1205
+ export { _default_12 as handOver }
1206
+ export { _default_12 as handOver_alias_1 }
1207
+ export { _default_12 as handOver_alias_2 }
1077
1208
 
1078
- declare const _default_12: {
1209
+ declare const _default_13: {
1079
1210
  handler: ToolHandler<{
1080
1211
  readonly name: "remove_file";
1081
1212
  readonly description: "Request to remove a file at the specified path.";
@@ -1112,12 +1243,12 @@ declare const _default_12: {
1112
1243
  }];
1113
1244
  permissionLevel: PermissionLevel.Write;
1114
1245
  };
1115
- export { _default_12 as default_alias_11 }
1116
- export { _default_12 as removeFile }
1117
- export { _default_12 as removeFile_alias_1 }
1118
- export { _default_12 as removeFile_alias_2 }
1246
+ export { _default_13 as default_alias_12 }
1247
+ export { _default_13 as removeFile }
1248
+ export { _default_13 as removeFile_alias_1 }
1249
+ export { _default_13 as removeFile_alias_2 }
1119
1250
 
1120
- declare const _default_13: {
1251
+ declare const _default_14: {
1121
1252
  handler: ToolHandler<{
1122
1253
  readonly name: "rename_file";
1123
1254
  readonly description: "Request to rename a file from source path to target path.";
@@ -1170,10 +1301,10 @@ declare const _default_13: {
1170
1301
  }];
1171
1302
  permissionLevel: PermissionLevel.Write;
1172
1303
  };
1173
- export { _default_13 as default_alias_12 }
1174
- export { _default_13 as renameFile }
1175
- export { _default_13 as renameFile_alias_1 }
1176
- export { _default_13 as renameFile_alias_2 }
1304
+ export { _default_14 as default_alias_13 }
1305
+ export { _default_14 as renameFile }
1306
+ export { _default_14 as renameFile_alias_1 }
1307
+ export { _default_14 as renameFile_alias_2 }
1177
1308
 
1178
1309
  declare const _default_2: {
1179
1310
  handler: ToolHandler<{
@@ -1366,6 +1497,70 @@ export { _default_4 as executeCommand_alias_1 }
1366
1497
  export { _default_4 as executeCommand_alias_2 }
1367
1498
 
1368
1499
  declare const _default_5: {
1500
+ handler: ToolHandler<{
1501
+ readonly name: "fetch_url";
1502
+ readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
1503
+ readonly parameters: [{
1504
+ readonly name: "url";
1505
+ readonly description: "One or more URLs to fetch, separated by commas if multiple.";
1506
+ readonly required: true;
1507
+ }];
1508
+ readonly examples: [{
1509
+ readonly description: "Fetch a single webpage";
1510
+ readonly parameters: [{
1511
+ readonly name: "url";
1512
+ readonly value: "https://example.com";
1513
+ }];
1514
+ }, {
1515
+ readonly description: "Fetch multiple webpages";
1516
+ readonly parameters: [{
1517
+ readonly name: "url";
1518
+ readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
1519
+ }];
1520
+ }, {
1521
+ readonly description: "Fetch a raw file from GitHub";
1522
+ readonly parameters: [{
1523
+ readonly name: "url";
1524
+ readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
1525
+ }];
1526
+ }];
1527
+ readonly permissionLevel: PermissionLevel.Read;
1528
+ }, WebProvider>;
1529
+ isAvailable: (provider: WebProvider) => boolean;
1530
+ name: "fetch_url";
1531
+ description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
1532
+ parameters: [{
1533
+ readonly name: "url";
1534
+ readonly description: "One or more URLs to fetch, separated by commas if multiple.";
1535
+ readonly required: true;
1536
+ }];
1537
+ examples: [{
1538
+ readonly description: "Fetch a single webpage";
1539
+ readonly parameters: [{
1540
+ readonly name: "url";
1541
+ readonly value: "https://example.com";
1542
+ }];
1543
+ }, {
1544
+ readonly description: "Fetch multiple webpages";
1545
+ readonly parameters: [{
1546
+ readonly name: "url";
1547
+ readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
1548
+ }];
1549
+ }, {
1550
+ readonly description: "Fetch a raw file from GitHub";
1551
+ readonly parameters: [{
1552
+ readonly name: "url";
1553
+ readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
1554
+ }];
1555
+ }];
1556
+ permissionLevel: PermissionLevel.Read;
1557
+ };
1558
+ export { _default_5 as default_alias_8 }
1559
+ export { _default_5 as fetchUrl }
1560
+ export { _default_5 as fetchUrl_alias_1 }
1561
+ export { _default_5 as fetchUrl_alias_2 }
1562
+
1563
+ declare const _default_6: {
1369
1564
  handler: ToolHandler<{
1370
1565
  readonly name: "list_files";
1371
1566
  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.";
@@ -1428,12 +1623,12 @@ declare const _default_5: {
1428
1623
  }];
1429
1624
  permissionLevel: PermissionLevel.Read;
1430
1625
  };
1431
- export { _default_5 as default_alias_9 }
1432
- export { _default_5 as listFiles }
1433
- export { _default_5 as listFiles_alias_1 }
1434
- export { _default_5 as listFiles_alias_2 }
1626
+ export { _default_6 as default_alias_10 }
1627
+ export { _default_6 as listFiles }
1628
+ export { _default_6 as listFiles_alias_1 }
1629
+ export { _default_6 as listFiles_alias_2 }
1435
1630
 
1436
- declare const _default_6: {
1631
+ declare const _default_7: {
1437
1632
  handler: ToolHandler<{
1438
1633
  readonly name: "read_file";
1439
1634
  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.";
@@ -1482,12 +1677,12 @@ declare const _default_6: {
1482
1677
  }];
1483
1678
  permissionLevel: PermissionLevel.Read;
1484
1679
  };
1485
- export { _default_6 as default_alias_10 }
1486
- export { _default_6 as readFile }
1487
- export { _default_6 as readFile_alias_1 }
1488
- export { _default_6 as readFile_alias_2 }
1680
+ export { _default_7 as default_alias_11 }
1681
+ export { _default_7 as readFile }
1682
+ export { _default_7 as readFile_alias_1 }
1683
+ export { _default_7 as readFile_alias_2 }
1489
1684
 
1490
- declare const _default_7: {
1685
+ declare const _default_8: {
1491
1686
  handler: ToolHandler<{
1492
1687
  readonly name: "replace_in_file";
1493
1688
  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.";
@@ -1594,12 +1789,12 @@ declare const _default_7: {
1594
1789
  }];
1595
1790
  permissionLevel: PermissionLevel.Write;
1596
1791
  };
1597
- export { _default_7 as default_alias_13 }
1598
- export { _default_7 as replaceInFile }
1599
- export { _default_7 as replaceInFile_alias_1 }
1600
- export { _default_7 as replaceInFile_alias_2 }
1792
+ export { _default_8 as default_alias_14 }
1793
+ export { _default_8 as replaceInFile }
1794
+ export { _default_8 as replaceInFile_alias_1 }
1795
+ export { _default_8 as replaceInFile_alias_2 }
1601
1796
 
1602
- declare const _default_8: {
1797
+ declare const _default_9: {
1603
1798
  handler: ToolHandler<{
1604
1799
  readonly name: "search_files";
1605
1800
  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.";
@@ -1668,140 +1863,10 @@ declare const _default_8: {
1668
1863
  }];
1669
1864
  permissionLevel: PermissionLevel.Read;
1670
1865
  };
1671
- export { _default_8 as default_alias_14 }
1672
- export { _default_8 as searchFiles }
1673
- export { _default_8 as searchFiles_alias_1 }
1674
- export { _default_8 as searchFiles_alias_2 }
1675
-
1676
- declare const _default_9: {
1677
- handler: ToolHandler<{
1678
- readonly name: "update_knowledge";
1679
- 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.";
1680
- readonly parameters: [{
1681
- readonly name: "path";
1682
- readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1683
- readonly required: true;
1684
- readonly usageValue: "Directory path here";
1685
- }, {
1686
- readonly name: "knowledge";
1687
- readonly description: "YAML content to merge into the knowledge file";
1688
- readonly required: true;
1689
- readonly usageValue: "YAML content with knowledge to update";
1690
- }];
1691
- readonly examples: [{
1692
- readonly description: "Add a new file entry";
1693
- readonly parameters: [{
1694
- readonly name: "path";
1695
- readonly value: "src/utils";
1696
- }, {
1697
- readonly name: "knowledge";
1698
- 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\"";
1699
- }];
1700
- }, {
1701
- readonly description: "Update an existing file description";
1702
- readonly parameters: [{
1703
- readonly name: "path";
1704
- readonly value: "src/utils";
1705
- }, {
1706
- readonly name: "knowledge";
1707
- readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1708
- }];
1709
- }, {
1710
- readonly description: "Add a new rule";
1711
- readonly parameters: [{
1712
- readonly name: "path";
1713
- readonly value: "src";
1714
- }, {
1715
- readonly name: "knowledge";
1716
- readonly value: "rules:\n 10: \"New rule to follow\"";
1717
- }];
1718
- }, {
1719
- readonly description: "Remove a rule";
1720
- readonly parameters: [{
1721
- readonly name: "path";
1722
- readonly value: "src";
1723
- }, {
1724
- readonly name: "knowledge";
1725
- readonly value: "rules:\n 5: null";
1726
- }];
1727
- }, {
1728
- readonly description: "Update nested properties using dot notation";
1729
- readonly parameters: [{
1730
- readonly name: "path";
1731
- readonly value: "src/components";
1732
- }, {
1733
- readonly name: "knowledge";
1734
- readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1735
- }];
1736
- }];
1737
- readonly permissionLevel: PermissionLevel.Write;
1738
- }, FilesystemProvider>;
1739
- isAvailable: (provider: FilesystemProvider) => boolean;
1740
- name: "update_knowledge";
1741
- 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.";
1742
- parameters: [{
1743
- readonly name: "path";
1744
- readonly description: "Directory containing (or where to create) the knowledge.ai.yml file";
1745
- readonly required: true;
1746
- readonly usageValue: "Directory path here";
1747
- }, {
1748
- readonly name: "knowledge";
1749
- readonly description: "YAML content to merge into the knowledge file";
1750
- readonly required: true;
1751
- readonly usageValue: "YAML content with knowledge to update";
1752
- }];
1753
- examples: [{
1754
- readonly description: "Add a new file entry";
1755
- readonly parameters: [{
1756
- readonly name: "path";
1757
- readonly value: "src/utils";
1758
- }, {
1759
- readonly name: "knowledge";
1760
- 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\"";
1761
- }];
1762
- }, {
1763
- readonly description: "Update an existing file description";
1764
- readonly parameters: [{
1765
- readonly name: "path";
1766
- readonly value: "src/utils";
1767
- }, {
1768
- readonly name: "knowledge";
1769
- readonly value: "files:\n \"existingFile.ts\":\n description: \"Updated description for the file\"";
1770
- }];
1771
- }, {
1772
- readonly description: "Add a new rule";
1773
- readonly parameters: [{
1774
- readonly name: "path";
1775
- readonly value: "src";
1776
- }, {
1777
- readonly name: "knowledge";
1778
- readonly value: "rules:\n 10: \"New rule to follow\"";
1779
- }];
1780
- }, {
1781
- readonly description: "Remove a rule";
1782
- readonly parameters: [{
1783
- readonly name: "path";
1784
- readonly value: "src";
1785
- }, {
1786
- readonly name: "knowledge";
1787
- readonly value: "rules:\n 5: null";
1788
- }];
1789
- }, {
1790
- readonly description: "Update nested properties using dot notation";
1791
- readonly parameters: [{
1792
- readonly name: "path";
1793
- readonly value: "src/components";
1794
- }, {
1795
- readonly name: "knowledge";
1796
- readonly value: "files.Button.tsx.api.functions.1.description: \"Updated function description\"";
1797
- }];
1798
- }];
1799
- permissionLevel: PermissionLevel.Write;
1800
- };
1801
1866
  export { _default_9 as default_alias_15 }
1802
- export { _default_9 as updateKnowledge }
1803
- export { _default_9 as updateKnowledge_alias_1 }
1804
- export { _default_9 as updateKnowledge_alias_2 }
1867
+ export { _default_9 as searchFiles }
1868
+ export { _default_9 as searchFiles_alias_1 }
1869
+ export { _default_9 as searchFiles_alias_2 }
1805
1870
 
1806
1871
  /**
1807
1872
  * AI tool for creating new projects based on user specifications.
@@ -2028,13 +2093,15 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
2028
2093
 
2029
2094
  export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
2030
2095
 
2096
+ export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
2097
+
2031
2098
  export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
2032
2099
 
2033
2100
  export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
2034
2101
 
2035
- export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, any>;
2102
+ export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, WebProvider>;
2036
2103
 
2037
- export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, FilesystemProvider>;
2104
+ export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, any>;
2038
2105
 
2039
2106
  export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
2040
2107
 
@@ -2044,6 +2111,8 @@ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, Files
2044
2111
 
2045
2112
  export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
2046
2113
 
2114
+ export declare type ImageBlockParam = Anthropic.Messages.ImageBlockParam;
2115
+
2047
2116
  declare type Input = {
2048
2117
  commitMessages: string;
2049
2118
  commitDiff: string;
@@ -2069,13 +2138,15 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
2069
2138
 
2070
2139
  export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
2071
2140
 
2141
+ export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
2142
+
2072
2143
  export declare const isAvailable_alias_2: (_provider: any) => boolean;
2073
2144
 
2074
2145
  export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
2075
2146
 
2076
- export declare const isAvailable_alias_4: (_provider: any) => boolean;
2147
+ export declare const isAvailable_alias_4: (provider: WebProvider) => boolean;
2077
2148
 
2078
- export declare const isAvailable_alias_5: (provider: FilesystemProvider) => boolean;
2149
+ export declare const isAvailable_alias_5: (_provider: any) => boolean;
2079
2150
 
2080
2151
  export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
2081
2152
 
@@ -2543,8 +2614,8 @@ export { replaceInFile_2 as replaceInFile_alias_4 }
2543
2614
 
2544
2615
  declare const responsePrompts: {
2545
2616
  readonly errorInvokeTool: (tool: string, error: unknown) => string;
2546
- readonly requireUseTool: "Error: You MUST use a tool before proceeding using XCM tags. e.g. <tool_tool_name>tool_name</tool_tool_name>";
2547
- readonly toolResults: (tool: string, result: string) => string;
2617
+ readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
2618
+ readonly toolResults: (tool: string, result: UserContent) => (TextBlockParam | ImageBlockParam)[];
2548
2619
  readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
2549
2620
  };
2550
2621
  export { responsePrompts }
@@ -2657,7 +2728,7 @@ export { TaskEventKind as TaskEventKind_alias_2 }
2657
2728
  */
2658
2729
  declare interface TaskEventStartRequest extends TaskEventBase {
2659
2730
  kind: TaskEventKind.StartRequest;
2660
- userMessage: string;
2731
+ userMessage: UserContent;
2661
2732
  }
2662
2733
  export { TaskEventStartRequest }
2663
2734
  export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
@@ -2740,6 +2811,8 @@ export { TaskEventUsageExceeded }
2740
2811
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
2741
2812
  export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
2742
2813
 
2814
+ export declare type TextBlockParam = Anthropic.Messages.TextBlockParam;
2815
+
2743
2816
  declare interface TextContent {
2744
2817
  type: 'text';
2745
2818
  content: string;
@@ -2855,6 +2928,60 @@ export declare const toolInfo_alias_1: {
2855
2928
  };
2856
2929
 
2857
2930
  export declare const toolInfo_alias_10: {
2931
+ readonly name: "replace_in_file";
2932
+ 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.";
2933
+ readonly parameters: [{
2934
+ readonly name: "path";
2935
+ readonly description: "The path of the file to modify";
2936
+ readonly required: true;
2937
+ readonly usageValue: "File path here";
2938
+ }, {
2939
+ readonly name: "diff";
2940
+ 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```\nCritical rules:\n1. 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.\n2. 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.\n3. 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.\n4. 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";
2941
+ readonly required: true;
2942
+ readonly usageValue: "Search and replace blocks here";
2943
+ }];
2944
+ readonly examples: [{
2945
+ readonly description: "Request to replace sections of content in a file";
2946
+ readonly parameters: [{
2947
+ readonly name: "path";
2948
+ readonly value: "src/main.js";
2949
+ }, {
2950
+ readonly name: "diff";
2951
+ 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";
2952
+ }];
2953
+ }, {
2954
+ readonly description: "Request to perform a simple, single-line replacement";
2955
+ readonly parameters: [{
2956
+ readonly name: "path";
2957
+ readonly value: "src/config.js";
2958
+ }, {
2959
+ readonly name: "diff";
2960
+ readonly value: "\n<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE\n";
2961
+ }];
2962
+ }, {
2963
+ readonly description: "Request to add a new function to a file";
2964
+ readonly parameters: [{
2965
+ readonly name: "path";
2966
+ readonly value: "src/utils.js";
2967
+ }, {
2968
+ readonly name: "diff";
2969
+ readonly value: "\n<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE\n";
2970
+ }];
2971
+ }, {
2972
+ readonly description: "Request to delete a block of code from a file";
2973
+ readonly parameters: [{
2974
+ readonly name: "path";
2975
+ readonly value: "src/app.js";
2976
+ }, {
2977
+ readonly name: "diff";
2978
+ readonly value: "\n<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE\n";
2979
+ }];
2980
+ }];
2981
+ readonly permissionLevel: PermissionLevel.Write;
2982
+ };
2983
+
2984
+ export declare const toolInfo_alias_11: {
2858
2985
  readonly name: "search_files";
2859
2986
  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.";
2860
2987
  readonly parameters: [{
@@ -2889,7 +3016,7 @@ export declare const toolInfo_alias_10: {
2889
3016
  readonly permissionLevel: PermissionLevel.Read;
2890
3017
  };
2891
3018
 
2892
- export declare const toolInfo_alias_11: {
3019
+ export declare const toolInfo_alias_12: {
2893
3020
  readonly name: "update_knowledge";
2894
3021
  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.";
2895
3022
  readonly parameters: [{
@@ -2952,9 +3079,9 @@ export declare const toolInfo_alias_11: {
2952
3079
  readonly permissionLevel: PermissionLevel.Write;
2953
3080
  };
2954
3081
 
2955
- export declare const toolInfo_alias_12: {
3082
+ export declare const toolInfo_alias_13: {
2956
3083
  readonly name: "write_to_file";
2957
- 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;`.";
3084
+ readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
2958
3085
  readonly parameters: [{
2959
3086
  readonly name: "path";
2960
3087
  readonly description: "The path of the file to write to";
@@ -3050,6 +3177,36 @@ export declare const toolInfo_alias_3: {
3050
3177
  };
3051
3178
 
3052
3179
  export declare const toolInfo_alias_4: {
3180
+ readonly name: "fetch_url";
3181
+ readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
3182
+ readonly parameters: [{
3183
+ readonly name: "url";
3184
+ readonly description: "One or more URLs to fetch, separated by commas if multiple.";
3185
+ readonly required: true;
3186
+ }];
3187
+ readonly examples: [{
3188
+ readonly description: "Fetch a single webpage";
3189
+ readonly parameters: [{
3190
+ readonly name: "url";
3191
+ readonly value: "https://example.com";
3192
+ }];
3193
+ }, {
3194
+ readonly description: "Fetch multiple webpages";
3195
+ readonly parameters: [{
3196
+ readonly name: "url";
3197
+ readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
3198
+ }];
3199
+ }, {
3200
+ readonly description: "Fetch a raw file from GitHub";
3201
+ readonly parameters: [{
3202
+ readonly name: "url";
3203
+ readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
3204
+ }];
3205
+ }];
3206
+ readonly permissionLevel: PermissionLevel.Read;
3207
+ };
3208
+
3209
+ export declare const toolInfo_alias_5: {
3053
3210
  readonly name: "hand_over";
3054
3211
  readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
3055
3212
  readonly parameters: [{
@@ -3092,7 +3249,7 @@ export declare const toolInfo_alias_4: {
3092
3249
  readonly permissionLevel: PermissionLevel.None;
3093
3250
  };
3094
3251
 
3095
- export declare const toolInfo_alias_5: {
3252
+ export declare const toolInfo_alias_6: {
3096
3253
  readonly name: "list_files";
3097
3254
  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.";
3098
3255
  readonly parameters: [{
@@ -3124,7 +3281,7 @@ export declare const toolInfo_alias_5: {
3124
3281
  readonly permissionLevel: PermissionLevel.Read;
3125
3282
  };
3126
3283
 
3127
- export declare const toolInfo_alias_6: {
3284
+ export declare const toolInfo_alias_7: {
3128
3285
  readonly name: "read_file";
3129
3286
  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.";
3130
3287
  readonly parameters: [{
@@ -3149,7 +3306,7 @@ export declare const toolInfo_alias_6: {
3149
3306
  readonly permissionLevel: PermissionLevel.Read;
3150
3307
  };
3151
3308
 
3152
- export declare const toolInfo_alias_7: {
3309
+ export declare const toolInfo_alias_8: {
3153
3310
  readonly name: "remove_file";
3154
3311
  readonly description: "Request to remove a file at the specified path.";
3155
3312
  readonly parameters: [{
@@ -3168,7 +3325,7 @@ export declare const toolInfo_alias_7: {
3168
3325
  readonly permissionLevel: PermissionLevel.Write;
3169
3326
  };
3170
3327
 
3171
- export declare const toolInfo_alias_8: {
3328
+ export declare const toolInfo_alias_9: {
3172
3329
  readonly name: "rename_file";
3173
3330
  readonly description: "Request to rename a file from source path to target path.";
3174
3331
  readonly parameters: [{
@@ -3195,60 +3352,6 @@ export declare const toolInfo_alias_8: {
3195
3352
  readonly permissionLevel: PermissionLevel.Write;
3196
3353
  };
3197
3354
 
3198
- export declare const toolInfo_alias_9: {
3199
- readonly name: "replace_in_file";
3200
- 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.";
3201
- readonly parameters: [{
3202
- readonly name: "path";
3203
- readonly description: "The path of the file to modify";
3204
- readonly required: true;
3205
- readonly usageValue: "File path here";
3206
- }, {
3207
- readonly name: "diff";
3208
- 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```\nCritical rules:\n1. 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.\n2. 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.\n3. 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.\n4. 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";
3209
- readonly required: true;
3210
- readonly usageValue: "Search and replace blocks here";
3211
- }];
3212
- readonly examples: [{
3213
- readonly description: "Request to replace sections of content in a file";
3214
- readonly parameters: [{
3215
- readonly name: "path";
3216
- readonly value: "src/main.js";
3217
- }, {
3218
- readonly name: "diff";
3219
- 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";
3220
- }];
3221
- }, {
3222
- readonly description: "Request to perform a simple, single-line replacement";
3223
- readonly parameters: [{
3224
- readonly name: "path";
3225
- readonly value: "src/config.js";
3226
- }, {
3227
- readonly name: "diff";
3228
- readonly value: "\n<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE\n";
3229
- }];
3230
- }, {
3231
- readonly description: "Request to add a new function to a file";
3232
- readonly parameters: [{
3233
- readonly name: "path";
3234
- readonly value: "src/utils.js";
3235
- }, {
3236
- readonly name: "diff";
3237
- readonly value: "\n<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE\n";
3238
- }];
3239
- }, {
3240
- readonly description: "Request to delete a block of code from a file";
3241
- readonly parameters: [{
3242
- readonly name: "path";
3243
- readonly value: "src/app.js";
3244
- }, {
3245
- readonly name: "diff";
3246
- readonly value: "\n<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE\n";
3247
- }];
3248
- }];
3249
- readonly permissionLevel: PermissionLevel.Write;
3250
- };
3251
-
3252
3355
  declare type ToolParameter = {
3253
3356
  name: string;
3254
3357
  description: string;
@@ -3266,7 +3369,7 @@ declare type ToolParameterValue = string | {
3266
3369
  export { ToolParameterValue }
3267
3370
  export { ToolParameterValue as ToolParameterValue_alias_1 }
3268
3371
 
3269
- declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider;
3372
+ declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider;
3270
3373
  export { ToolProvider }
3271
3374
  export { ToolProvider as ToolProvider_alias_1 }
3272
3375
  export { ToolProvider as ToolProvider_alias_2 }
@@ -3328,7 +3431,7 @@ export { ToolResponseInvalid as ToolResponseInvalid_alias_1 }
3328
3431
  declare type ToolResponseOrToolPause = {
3329
3432
  type: 'response';
3330
3433
  tool: string;
3331
- response: string;
3434
+ response: UserContent;
3332
3435
  } | {
3333
3436
  type: 'pause';
3334
3437
  tool: string;
@@ -3347,7 +3450,7 @@ export { ToolResponsePause as ToolResponsePause_alias_1 }
3347
3450
 
3348
3451
  declare type ToolResponseReply = {
3349
3452
  type: ToolResponseType.Reply;
3350
- message: string;
3453
+ message: UserContent;
3351
3454
  };
3352
3455
  export { ToolResponseReply }
3353
3456
  export { ToolResponseReply as ToolResponseReply_alias_1 }
@@ -3431,4 +3534,16 @@ export { UsageMeter }
3431
3534
  export { UsageMeter as UsageMeter_alias_1 }
3432
3535
  export { UsageMeter as UsageMeter_alias_2 }
3433
3536
 
3537
+ declare type UserContent = string | (TextBlockParam | ImageBlockParam)[];
3538
+ export { UserContent }
3539
+ export { UserContent as UserContent_alias_1 }
3540
+ export { UserContent as UserContent_alias_2 }
3541
+
3542
+ declare type WebProvider = {
3543
+ fetchUrl?: (url: string) => Promise<string>;
3544
+ };
3545
+ export { WebProvider }
3546
+ export { WebProvider as WebProvider_alias_1 }
3547
+ export { WebProvider as WebProvider_alias_2 }
3548
+
3434
3549
  export { }