@polka-codes/core 0.1.6 → 0.1.7

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.
Files changed (55) hide show
  1. package/dist/index.js +8851 -5
  2. package/package.json +4 -1
  3. package/dist/Agent/AgentBase.d.ts +0 -49
  4. package/dist/Agent/AgentBase.js +0 -158
  5. package/dist/Agent/AgentBase.js.map +0 -1
  6. package/dist/Agent/CoderAgent/index.d.ts +0 -17
  7. package/dist/Agent/CoderAgent/index.js +0 -32
  8. package/dist/Agent/CoderAgent/index.js.map +0 -1
  9. package/dist/Agent/CoderAgent/prompts.d.ts +0 -20
  10. package/dist/Agent/CoderAgent/prompts.js +0 -165
  11. package/dist/Agent/CoderAgent/prompts.js.map +0 -1
  12. package/dist/Agent/index.d.ts +0 -2
  13. package/dist/Agent/index.js +0 -3
  14. package/dist/Agent/index.js.map +0 -1
  15. package/dist/Agent/parseAssistantMessage.d.ts +0 -45
  16. package/dist/Agent/parseAssistantMessage.js +0 -103
  17. package/dist/Agent/parseAssistantMessage.js.map +0 -1
  18. package/dist/Agent/prompts.d.ts +0 -7
  19. package/dist/Agent/prompts.js +0 -93
  20. package/dist/Agent/prompts.js.map +0 -1
  21. package/dist/AiService/AiServiceBase.d.ts +0 -29
  22. package/dist/AiService/AiServiceBase.js +0 -3
  23. package/dist/AiService/AiServiceBase.js.map +0 -1
  24. package/dist/AiService/AnthropicService.d.ts +0 -11
  25. package/dist/AiService/AnthropicService.js +0 -185
  26. package/dist/AiService/AnthropicService.js.map +0 -1
  27. package/dist/AiService/DeepSeekService.d.ts +0 -11
  28. package/dist/AiService/DeepSeekService.js +0 -64
  29. package/dist/AiService/DeepSeekService.js.map +0 -1
  30. package/dist/AiService/ModelInfo.d.ts +0 -79
  31. package/dist/AiService/ModelInfo.js +0 -67
  32. package/dist/AiService/ModelInfo.js.map +0 -1
  33. package/dist/AiService/OllamaService.d.ts +0 -11
  34. package/dist/AiService/OllamaService.js +0 -47
  35. package/dist/AiService/OllamaService.js.map +0 -1
  36. package/dist/AiService/index.d.ts +0 -12
  37. package/dist/AiService/index.js +0 -20
  38. package/dist/AiService/index.js.map +0 -1
  39. package/dist/AiService/utils.d.ts +0 -4
  40. package/dist/AiService/utils.js +0 -187
  41. package/dist/AiService/utils.js.map +0 -1
  42. package/dist/index.d.ts +0 -4
  43. package/dist/index.js.map +0 -1
  44. package/dist/logger.d.ts +0 -5
  45. package/dist/logger.js +0 -25
  46. package/dist/logger.js.map +0 -1
  47. package/dist/tools/index.d.ts +0 -3
  48. package/dist/tools/index.js +0 -4
  49. package/dist/tools/index.js.map +0 -1
  50. package/dist/tools/tools.d.ts +0 -200
  51. package/dist/tools/tools.js +0 -329
  52. package/dist/tools/tools.js.map +0 -1
  53. package/dist/tools/types.d.ts +0 -49
  54. package/dist/tools/types.js +0 -9
  55. package/dist/tools/types.js.map +0 -1
@@ -1,329 +0,0 @@
1
- // source: https://github.com/cline/cline/blob/f6c19c29a64ca84e9360df7ab2c07d128dcebe64/src/core/prompts/system.ts#L1
2
- export const executeCommand = {
3
- name: 'execute_command',
4
- description: `Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Commands will be executed in the current working directory.`,
5
- parameters: [
6
- {
7
- name: 'command',
8
- description: 'The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.',
9
- required: true,
10
- usageValue: 'Your command here',
11
- },
12
- {
13
- name: 'requires_approval',
14
- description: `A boolean indicating whether this command requires explicit user approval before execution in case the user has auto-approve mode enabled. Set to 'true' for potentially impactful operations like installing/uninstalling packages, deleting/overwriting files, system configuration changes, network operations, or any commands that could have unintended side effects. Set to 'false' for safe operations like reading files/directories, running development servers, building projects, and other non-destructive operations.`,
15
- required: false,
16
- usageValue: 'true or false',
17
- },
18
- ],
19
- examples: [
20
- {
21
- description: 'Request to execute a command',
22
- parameters: [
23
- {
24
- name: 'command',
25
- value: 'npm run dev',
26
- },
27
- {
28
- name: 'requires_approval',
29
- value: 'false',
30
- },
31
- ],
32
- },
33
- ],
34
- };
35
- export const readFile = {
36
- name: 'read_file',
37
- 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.',
38
- parameters: [
39
- {
40
- name: 'path',
41
- description: 'The path of the file to read',
42
- required: true,
43
- usageValue: 'Comma separated paths here',
44
- },
45
- ],
46
- examples: [
47
- {
48
- description: 'Request to read the contents of a file',
49
- parameters: [
50
- {
51
- name: 'path',
52
- value: 'src/main.js',
53
- },
54
- ],
55
- },
56
- {
57
- description: 'Request to read multiple files',
58
- parameters: [
59
- {
60
- name: 'path',
61
- value: 'src/main.js,src/index.js',
62
- },
63
- ],
64
- },
65
- ],
66
- };
67
- export const writeToFile = {
68
- name: 'write_to_file',
69
- 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.",
70
- parameters: [
71
- {
72
- name: 'path',
73
- description: 'The path of the file to write to',
74
- required: true,
75
- usageValue: 'File path here',
76
- },
77
- {
78
- name: 'content',
79
- description: "The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.",
80
- required: true,
81
- usageValue: 'Your file content here',
82
- },
83
- ],
84
- examples: [
85
- {
86
- description: 'Request to write content to a file',
87
- parameters: [
88
- {
89
- name: 'path',
90
- value: 'src/main.js',
91
- },
92
- {
93
- name: 'content',
94
- value: `import React from 'react';
95
-
96
- function App() {
97
- return (
98
- <div>
99
- <h1>Hello, World!</h1>
100
- </div>
101
- );
102
- }
103
-
104
- export default App;
105
- `,
106
- },
107
- ],
108
- },
109
- ],
110
- };
111
- export const replaceInFile = {
112
- name: 'replace_in_file',
113
- 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.',
114
- parameters: [
115
- {
116
- name: 'path',
117
- description: 'The path of the file to modify',
118
- required: true,
119
- usageValue: 'File path here',
120
- },
121
- {
122
- name: 'diff',
123
- description: `One or more SEARCH/REPLACE blocks following this exact format:
124
- \`\`\`
125
- <<<<<<< SEARCH
126
- [exact content to find]
127
- =======
128
- [new content to replace with]
129
- >>>>>>> REPLACE
130
- \`\`\`
131
- Critical rules:
132
- 1. SEARCH content must match the associated file section to find EXACTLY:
133
- * Match character-for-character including whitespace, indentation, line endings
134
- * Include all comments, docstrings, etc.
135
- 2. SEARCH/REPLACE blocks will ONLY replace the first match occurrence.
136
- * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes.
137
- * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change.
138
- * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file.
139
- 3. Keep SEARCH/REPLACE blocks concise:
140
- * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file.
141
- * Include just the changing lines, and a few surrounding lines if needed for uniqueness.
142
- * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks.
143
- * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures.
144
- 4. Special operations:
145
- * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
146
- * To delete code: Use empty REPLACE section`,
147
- required: true,
148
- usageValue: 'Search and replace blocks here',
149
- },
150
- ],
151
- examples: [
152
- {
153
- description: 'Request to replace sections of content in a file',
154
- parameters: [
155
- {
156
- name: 'path',
157
- value: 'src/main.js',
158
- },
159
- {
160
- name: 'diff',
161
- value: `
162
- <<<<<<< SEARCH
163
- import React from 'react';
164
- =======
165
- import React, { useState } from 'react';
166
- >>>>>>> REPLACE
167
-
168
- <<<<<<< SEARCH
169
- function handleSubmit() {
170
- saveData();
171
- setLoading(false);
172
- }
173
-
174
- =======
175
- >>>>>>> REPLACE
176
-
177
- <<<<<<< SEARCH
178
- return (
179
- <div>
180
- =======
181
- function handleSubmit() {
182
- saveData();
183
- setLoading(false);
184
- }
185
-
186
- return (
187
- <div>
188
- >>>>>>> REPLACE
189
- `,
190
- },
191
- ],
192
- },
193
- ],
194
- };
195
- export const searchFiles = {
196
- name: 'search_files',
197
- 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.',
198
- parameters: [
199
- {
200
- name: 'path',
201
- description: 'The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.',
202
- required: true,
203
- usageValue: 'Directory path here',
204
- },
205
- {
206
- name: 'regex',
207
- description: 'The regular expression pattern to search for. Uses Rust regex syntax.',
208
- required: true,
209
- usageValue: 'Your regex pattern here',
210
- },
211
- {
212
- name: 'file_pattern',
213
- description: 'Glob pattern to filter files (e.g., "*.ts" for TypeScript files). If not provided, it will search all files (*).',
214
- required: false,
215
- usageValue: 'file pattern here (optional)',
216
- },
217
- ],
218
- examples: [
219
- {
220
- description: 'Request to perform a regex search across files',
221
- parameters: [
222
- {
223
- name: 'path',
224
- value: 'src',
225
- },
226
- {
227
- name: 'regex',
228
- value: '^src/components/',
229
- },
230
- {
231
- name: 'file_pattern',
232
- value: '*.ts',
233
- },
234
- ],
235
- },
236
- ],
237
- };
238
- export const listFiles = {
239
- name: 'list_files',
240
- 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.',
241
- parameters: [
242
- {
243
- name: 'path',
244
- description: 'The path of the directory to list contents for (relative to the current working directory)',
245
- required: true,
246
- usageValue: 'Directory path here',
247
- },
248
- {
249
- name: 'depth',
250
- description: 'The depth of the directory to list contents for. Use 0 for the top-level directory only, 1 for the top-level directory and its children, and so on.',
251
- required: false,
252
- usageValue: 'a number (optional)',
253
- },
254
- ],
255
- examples: [
256
- {
257
- description: 'Request to list files',
258
- parameters: [
259
- {
260
- name: 'path',
261
- value: 'src',
262
- },
263
- {
264
- name: 'recursive',
265
- value: 'true',
266
- },
267
- ],
268
- },
269
- ],
270
- };
271
- export const listCodeDefinitionNames = {
272
- name: 'list_code_definition_names',
273
- description: 'Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.',
274
- parameters: [
275
- {
276
- name: 'path',
277
- description: 'The path of the directory (relative to the current working directory ${cwd.toPosix()}) to list top level source code definitions for.',
278
- required: true,
279
- usageValue: 'Directory path here',
280
- },
281
- ],
282
- };
283
- export const askFollowupQuestion = {
284
- name: 'ask_followup_question',
285
- description: 'Ask the user a question to gather additional information needed to complete the task. This tool should be used when you encounter ambiguities, need clarification, or require more details to proceed effectively. It allows for interactive problem-solving by enabling direct communication with the user. Use this tool judiciously to maintain a balance between gathering necessary information and avoiding excessive back-and-forth.',
286
- parameters: [
287
- {
288
- name: 'question',
289
- description: 'The question to ask the user. This should be a clear, specific question that addresses the information you need.',
290
- required: true,
291
- usageValue: 'Your question here',
292
- },
293
- ],
294
- examples: [
295
- {
296
- description: 'Request to ask a question',
297
- parameters: [
298
- {
299
- name: 'question',
300
- value: 'What is the name of the project?',
301
- },
302
- ],
303
- },
304
- ],
305
- };
306
- export const attemptCompletion = {
307
- name: 'attempt_completion',
308
- description: "After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.",
309
- parameters: [
310
- {
311
- name: 'result',
312
- description: "The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.",
313
- required: true,
314
- usageValue: 'Your final result description here',
315
- },
316
- ],
317
- examples: [
318
- {
319
- description: 'Request to present the result of the task',
320
- parameters: [
321
- {
322
- name: 'result',
323
- value: 'Your final result description here',
324
- },
325
- ],
326
- },
327
- ],
328
- };
329
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,qHAAqH;AAIrH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,ucAAuc;IACpd,UAAU,EAAE;QACV;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EACT,4KAA4K;YAC9K,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,mBAAmB;SAChC;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,sgBAAsgB;YACnhB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,eAAe;SAC5B;KACF;IACD,QAAQ,EAAE;QACR;YACE,WAAW,EAAE,8BAA8B;YAC3C,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,aAAa;iBACrB;gBACD;oBACE,IAAI,EAAE,mBAAmB;oBACzB,KAAK,EAAE,OAAO;iBACf;aACF;SACF;KACF;CAC0B,CAAA;AAE7B,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,saAAsa;IACxa,UAAU,EAAE;QACV;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,4BAA4B;SACzC;KACF;IACD,QAAQ,EAAE;QACR;YACE,WAAW,EAAE,wCAAwC;YACrD,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,aAAa;iBACrB;aACF;SACF;QACD;YACE,WAAW,EAAE,gCAAgC;YAC7C,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,0BAA0B;iBAClC;aACF;SACF;KAC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AC0B,CAAA;AAE7B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACT,gVAAgV;IAClV,UAAU,EAAE;QACV;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,uIAAuI;YACzI,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,qBAAqB;SAClC;KACF;CAC0B,CAAA;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,6aAA6a;IAC/a,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,kHAAkH;YAC/H,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,oBAAoB;SACjC;KACF;IACD,QAAQ,EAAE;QACR;YACE,WAAW,EAAE,2BAA2B;YACxC,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,kCAAkC;iBAC1C;aACF;SACF;KACF;CAC0B,CAAA;AAE7B,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,ySAAyS;IAC3S,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+LAA+L;YACjM,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,oCAAoC;SACjD;KACF;IACD,QAAQ,EAAE;QACR;YACE,WAAW,EAAE,2CAA2C;YACxD,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,oCAAoC;iBAC5C;aACF;SACF;KACF;CAC0B,CAAA"}
@@ -1,49 +0,0 @@
1
- export type ToolParameter = {
2
- name: string;
3
- description: string;
4
- required: boolean;
5
- usageValue: string;
6
- };
7
- export type ToolExample = {
8
- description: string;
9
- parameters: {
10
- name: string;
11
- value: string;
12
- }[];
13
- };
14
- export type ToolInfo = {
15
- name: string;
16
- description: string;
17
- parameters: ToolParameter[];
18
- examples?: ToolExample[];
19
- };
20
- export declare enum ToolResponseType {
21
- Reply = "Reply",
22
- Exit = "Exit",
23
- Invalid = "Invalid",
24
- Error = "Error",
25
- Interrupted = "Interrupted"
26
- }
27
- export type ToolResponseReply = {
28
- type: ToolResponseType.Reply;
29
- message: string;
30
- };
31
- export type ToolResponseExit = {
32
- type: ToolResponseType.Exit;
33
- message: string;
34
- };
35
- export type ToolResponseInvalid = {
36
- type: ToolResponseType.Invalid;
37
- message: string;
38
- };
39
- export type ToolResponseError = {
40
- type: ToolResponseType.Error;
41
- message: string;
42
- canRetry?: boolean;
43
- };
44
- export type ToolResponseInterrupted = {
45
- type: ToolResponseType.Interrupted;
46
- message: string;
47
- };
48
- export type ToolResponse = ToolResponseReply | ToolResponseExit | ToolResponseInvalid | ToolResponseError | ToolResponseInterrupted;
49
- export type ToolHandler = (tool: string, args: Record<string, string>) => Promise<ToolResponse>;
@@ -1,9 +0,0 @@
1
- export var ToolResponseType;
2
- (function (ToolResponseType) {
3
- ToolResponseType["Reply"] = "Reply";
4
- ToolResponseType["Exit"] = "Exit";
5
- ToolResponseType["Invalid"] = "Invalid";
6
- ToolResponseType["Error"] = "Error";
7
- ToolResponseType["Interrupted"] = "Interrupted";
8
- })(ToolResponseType || (ToolResponseType = {}));
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,+CAA2B,CAAA;AAC7B,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B"}