@polka-codes/core 0.0.4 → 0.1.1
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.
- package/README.md +69 -0
- package/dist/Agent/AgentBase.d.ts +49 -0
- package/dist/Agent/AgentBase.js +158 -0
- package/dist/Agent/AgentBase.js.map +1 -0
- package/dist/Agent/CoderAgent/index.d.ts +17 -0
- package/dist/Agent/CoderAgent/index.js +32 -0
- package/dist/Agent/CoderAgent/index.js.map +1 -0
- package/dist/Agent/CoderAgent/prompts.d.ts +20 -0
- package/dist/Agent/CoderAgent/prompts.js +165 -0
- package/dist/Agent/CoderAgent/prompts.js.map +1 -0
- package/dist/Agent/CoderAgent/prompts.test.d.ts +1 -0
- package/dist/Agent/CoderAgent/prompts.test.js +20 -0
- package/dist/Agent/CoderAgent/prompts.test.js.map +1 -0
- package/dist/Agent/index.d.ts +2 -0
- package/dist/Agent/index.js +3 -0
- package/dist/Agent/index.js.map +1 -0
- package/dist/Agent/parseAssistantMessage.d.ts +45 -0
- package/dist/Agent/parseAssistantMessage.js +103 -0
- package/dist/Agent/parseAssistantMessage.js.map +1 -0
- package/dist/Agent/parseAssistantMessage.test.d.ts +1 -0
- package/dist/Agent/parseAssistantMessage.test.js +172 -0
- package/dist/Agent/parseAssistantMessage.test.js.map +1 -0
- package/dist/Agent/prompts.d.ts +7 -0
- package/dist/Agent/prompts.js +93 -0
- package/dist/Agent/prompts.js.map +1 -0
- package/dist/AiService/AiServiceBase.d.ts +29 -0
- package/dist/AiService/AiServiceBase.js +3 -0
- package/dist/AiService/AiServiceBase.js.map +1 -0
- package/dist/AiService/AnthropicService.d.ts +11 -0
- package/dist/AiService/AnthropicService.js +185 -0
- package/dist/AiService/AnthropicService.js.map +1 -0
- package/dist/AiService/DeepSeekService.d.ts +11 -0
- package/dist/AiService/DeepSeekService.js +64 -0
- package/dist/AiService/DeepSeekService.js.map +1 -0
- package/dist/AiService/ModelInfo.d.ts +79 -0
- package/dist/AiService/ModelInfo.js +67 -0
- package/dist/AiService/ModelInfo.js.map +1 -0
- package/dist/AiService/OllamaService.d.ts +11 -0
- package/dist/AiService/OllamaService.js +47 -0
- package/dist/AiService/OllamaService.js.map +1 -0
- package/dist/AiService/index.d.ts +12 -0
- package/dist/AiService/index.js +20 -0
- package/dist/AiService/index.js.map +1 -0
- package/dist/AiService/utils.d.ts +4 -0
- package/dist/AiService/utils.js +187 -0
- package/dist/AiService/utils.js.map +1 -0
- package/dist/AiService/utils.test.d.ts +1 -0
- package/dist/AiService/utils.test.js +275 -0
- package/dist/AiService/utils.test.js.map +1 -0
- package/dist/index.d.ts +4 -10
- package/dist/index.js +4 -10
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +5 -0
- package/dist/logger.js +25 -0
- package/dist/logger.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/tools.d.ts +200 -0
- package/dist/tools/tools.js +329 -0
- package/dist/tools/tools.js.map +1 -0
- package/dist/tools/types.d.ts +49 -0
- package/dist/tools/types.js +9 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +9 -2
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import { convertToAnthropicMessage, convertToOpenAiMessages } from './utils';
|
|
3
|
+
describe('convertToOpenAiMessages', () => {
|
|
4
|
+
it('should convert simple text messages', () => {
|
|
5
|
+
const anthropicMessages = [
|
|
6
|
+
{ role: 'user', content: 'Hello' },
|
|
7
|
+
{ role: 'assistant', content: 'Hi there!' },
|
|
8
|
+
];
|
|
9
|
+
const result = convertToOpenAiMessages(anthropicMessages);
|
|
10
|
+
expect(result).toEqual([
|
|
11
|
+
{ role: 'user', content: 'Hello' },
|
|
12
|
+
{ role: 'assistant', content: 'Hi there!' },
|
|
13
|
+
]);
|
|
14
|
+
});
|
|
15
|
+
it('should handle user messages with images', () => {
|
|
16
|
+
const anthropicMessages = [
|
|
17
|
+
{
|
|
18
|
+
role: 'user',
|
|
19
|
+
content: [
|
|
20
|
+
{ type: 'text', text: 'Check this image:' },
|
|
21
|
+
{
|
|
22
|
+
type: 'image',
|
|
23
|
+
source: {
|
|
24
|
+
type: 'base64',
|
|
25
|
+
media_type: 'image/jpeg',
|
|
26
|
+
data: 'base64data',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
const result = convertToOpenAiMessages(anthropicMessages);
|
|
33
|
+
expect(result).toEqual([
|
|
34
|
+
{
|
|
35
|
+
role: 'user',
|
|
36
|
+
content: [
|
|
37
|
+
{ type: 'text', text: 'Check this image:' },
|
|
38
|
+
{
|
|
39
|
+
type: 'image_url',
|
|
40
|
+
image_url: {
|
|
41
|
+
url: 'data:image/jpeg;base64,base64data',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
47
|
+
});
|
|
48
|
+
it('should handle assistant messages with tool calls', () => {
|
|
49
|
+
const anthropicMessages = [
|
|
50
|
+
{
|
|
51
|
+
role: 'assistant',
|
|
52
|
+
content: [
|
|
53
|
+
{ type: 'text', text: 'Let me help you with that.' },
|
|
54
|
+
{
|
|
55
|
+
type: 'tool_use',
|
|
56
|
+
id: 'tool123',
|
|
57
|
+
name: 'search',
|
|
58
|
+
input: { query: 'test' },
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
const result = convertToOpenAiMessages(anthropicMessages);
|
|
64
|
+
expect(result).toEqual([
|
|
65
|
+
{
|
|
66
|
+
role: 'assistant',
|
|
67
|
+
content: 'Let me help you with that.',
|
|
68
|
+
tool_calls: [
|
|
69
|
+
{
|
|
70
|
+
id: 'tool123',
|
|
71
|
+
type: 'function',
|
|
72
|
+
function: {
|
|
73
|
+
name: 'search',
|
|
74
|
+
arguments: '{"query":"test"}',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
]);
|
|
80
|
+
});
|
|
81
|
+
it('should handle tool results', () => {
|
|
82
|
+
const anthropicMessages = [
|
|
83
|
+
{
|
|
84
|
+
role: 'user',
|
|
85
|
+
content: [
|
|
86
|
+
{
|
|
87
|
+
type: 'tool_result',
|
|
88
|
+
tool_use_id: 'tool123',
|
|
89
|
+
content: 'Search results found',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
const result = convertToOpenAiMessages(anthropicMessages);
|
|
95
|
+
expect(result).toEqual([
|
|
96
|
+
{
|
|
97
|
+
role: 'tool',
|
|
98
|
+
tool_call_id: 'tool123',
|
|
99
|
+
content: 'Search results found',
|
|
100
|
+
},
|
|
101
|
+
]);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe('convertToAnthropicMessage', () => {
|
|
105
|
+
it('should convert simple text completion', () => {
|
|
106
|
+
const openAiCompletion = {
|
|
107
|
+
id: 'cmpl-123',
|
|
108
|
+
choices: [
|
|
109
|
+
{
|
|
110
|
+
message: {
|
|
111
|
+
role: 'assistant',
|
|
112
|
+
content: 'Hello there!',
|
|
113
|
+
refusal: null,
|
|
114
|
+
},
|
|
115
|
+
finish_reason: 'stop',
|
|
116
|
+
index: 0,
|
|
117
|
+
logprobs: null,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
created: 1234567890,
|
|
121
|
+
model: 'gpt-4',
|
|
122
|
+
object: 'chat.completion',
|
|
123
|
+
usage: {
|
|
124
|
+
prompt_tokens: 10,
|
|
125
|
+
completion_tokens: 20,
|
|
126
|
+
total_tokens: 30,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
const result = convertToAnthropicMessage(openAiCompletion);
|
|
130
|
+
expect(result).toEqual({
|
|
131
|
+
id: 'cmpl-123',
|
|
132
|
+
type: 'message',
|
|
133
|
+
role: 'assistant',
|
|
134
|
+
content: [
|
|
135
|
+
{
|
|
136
|
+
type: 'text',
|
|
137
|
+
text: 'Hello there!',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
model: 'gpt-4',
|
|
141
|
+
stop_reason: 'end_turn',
|
|
142
|
+
stop_sequence: null,
|
|
143
|
+
usage: {
|
|
144
|
+
input_tokens: 10,
|
|
145
|
+
output_tokens: 20,
|
|
146
|
+
cache_creation_input_tokens: null,
|
|
147
|
+
cache_read_input_tokens: null,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
it('should handle tool calls in completion', () => {
|
|
152
|
+
const openAiCompletion = {
|
|
153
|
+
id: 'cmpl-123',
|
|
154
|
+
choices: [
|
|
155
|
+
{
|
|
156
|
+
message: {
|
|
157
|
+
role: 'assistant',
|
|
158
|
+
content: 'Let me search that for you.',
|
|
159
|
+
refusal: null,
|
|
160
|
+
tool_calls: [
|
|
161
|
+
{
|
|
162
|
+
id: 'call_123',
|
|
163
|
+
type: 'function',
|
|
164
|
+
function: {
|
|
165
|
+
name: 'search',
|
|
166
|
+
arguments: '{"query":"test"}',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
finish_reason: 'tool_calls',
|
|
172
|
+
index: 0,
|
|
173
|
+
logprobs: null,
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
created: 1234567890,
|
|
177
|
+
model: 'gpt-4',
|
|
178
|
+
object: 'chat.completion',
|
|
179
|
+
usage: {
|
|
180
|
+
prompt_tokens: 10,
|
|
181
|
+
completion_tokens: 20,
|
|
182
|
+
total_tokens: 30,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
const result = convertToAnthropicMessage(openAiCompletion);
|
|
186
|
+
expect(result).toEqual({
|
|
187
|
+
id: 'cmpl-123',
|
|
188
|
+
type: 'message',
|
|
189
|
+
role: 'assistant',
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
text: 'Let me search that for you.',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'tool_use',
|
|
197
|
+
id: 'call_123',
|
|
198
|
+
name: 'search',
|
|
199
|
+
input: { query: 'test' },
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
model: 'gpt-4',
|
|
203
|
+
stop_reason: 'tool_use',
|
|
204
|
+
stop_sequence: null,
|
|
205
|
+
usage: {
|
|
206
|
+
input_tokens: 10,
|
|
207
|
+
output_tokens: 20,
|
|
208
|
+
cache_creation_input_tokens: null,
|
|
209
|
+
cache_read_input_tokens: null,
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
it('should handle invalid tool call arguments', () => {
|
|
214
|
+
const openAiCompletion = {
|
|
215
|
+
id: 'cmpl-123',
|
|
216
|
+
choices: [
|
|
217
|
+
{
|
|
218
|
+
message: {
|
|
219
|
+
role: 'assistant',
|
|
220
|
+
content: 'Testing invalid arguments',
|
|
221
|
+
refusal: null,
|
|
222
|
+
tool_calls: [
|
|
223
|
+
{
|
|
224
|
+
id: 'call_123',
|
|
225
|
+
type: 'function',
|
|
226
|
+
function: {
|
|
227
|
+
name: 'test',
|
|
228
|
+
arguments: 'invalid json',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
finish_reason: 'tool_calls',
|
|
234
|
+
index: 0,
|
|
235
|
+
logprobs: null,
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
created: 1234567890,
|
|
239
|
+
model: 'gpt-4',
|
|
240
|
+
object: 'chat.completion',
|
|
241
|
+
};
|
|
242
|
+
const result = convertToAnthropicMessage(openAiCompletion);
|
|
243
|
+
expect(result.content).toHaveLength(2);
|
|
244
|
+
expect(result.content[1]).toEqual({
|
|
245
|
+
type: 'tool_use',
|
|
246
|
+
id: 'call_123',
|
|
247
|
+
name: 'test',
|
|
248
|
+
input: {},
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
it('should handle different finish reasons', () => {
|
|
252
|
+
const createCompletion = (finish_reason) => ({
|
|
253
|
+
id: 'cmpl-123',
|
|
254
|
+
choices: [
|
|
255
|
+
{
|
|
256
|
+
message: {
|
|
257
|
+
role: 'assistant',
|
|
258
|
+
content: 'Test',
|
|
259
|
+
refusal: null,
|
|
260
|
+
},
|
|
261
|
+
finish_reason: finish_reason,
|
|
262
|
+
index: 0,
|
|
263
|
+
logprobs: null,
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
created: 1234567890,
|
|
267
|
+
model: 'gpt-4',
|
|
268
|
+
object: 'chat.completion',
|
|
269
|
+
});
|
|
270
|
+
expect(convertToAnthropicMessage(createCompletion('stop')).stop_reason).toBe('end_turn');
|
|
271
|
+
expect(convertToAnthropicMessage(createCompletion('length')).stop_reason).toBe('max_tokens');
|
|
272
|
+
expect(convertToAnthropicMessage(createCompletion('tool_calls')).stop_reason).toBe('tool_use');
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
//# sourceMappingURL=utils.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../src/AiService/utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAI/C,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAE5E,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,iBAAiB,GAAsC;YAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE;YAClC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE;SAC5C,CAAA;QAED,MAAM,MAAM,GAAG,uBAAuB,CAAC,iBAAiB,C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CAAC,UAAU,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare class PolkaCore {
|
|
7
|
-
private config;
|
|
8
|
-
constructor(config: PolkaConfig);
|
|
9
|
-
getConfig(): PolkaConfig;
|
|
10
|
-
}
|
|
1
|
+
export * from './AiService';
|
|
2
|
+
export * from './Agent';
|
|
3
|
+
export * from './tools';
|
|
4
|
+
export * from './logger';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
this.config = config;
|
|
6
|
-
}
|
|
7
|
-
getConfig() {
|
|
8
|
-
return this.config;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
export * from './AiService';
|
|
2
|
+
export * from './Agent';
|
|
3
|
+
export * from './tools';
|
|
4
|
+
export * from './logger';
|
|
11
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import pino from 'pino';
|
|
2
|
+
export declare const getLogger: () => pino.Logger<never, boolean>;
|
|
3
|
+
export declare const setLogger: (newLogger: pino.Logger) => void;
|
|
4
|
+
export declare const createServiceLogger: (service: string) => pino.Logger<never, boolean>;
|
|
5
|
+
export type Logger = pino.Logger;
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import pino from 'pino';
|
|
2
|
+
let logger = undefined;
|
|
3
|
+
export const getLogger = () => {
|
|
4
|
+
if (!logger) {
|
|
5
|
+
logger = pino({
|
|
6
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
7
|
+
redact: ['apiKey'],
|
|
8
|
+
transport: {
|
|
9
|
+
target: 'pino-pretty',
|
|
10
|
+
options: {
|
|
11
|
+
colorize: true,
|
|
12
|
+
translateTime: 'SYS:standard',
|
|
13
|
+
ignore: 'pid,hostname',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return logger;
|
|
19
|
+
};
|
|
20
|
+
export const setLogger = (newLogger) => {
|
|
21
|
+
logger = newLogger;
|
|
22
|
+
};
|
|
23
|
+
// Create namespaced loggers for different services
|
|
24
|
+
export const createServiceLogger = (service) => getLogger().child({ service });
|
|
25
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,IAAI,MAAM,GAA4B,SAAS,CAAA;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,CAAC;YACZ,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,MAAM;YACtC,MAAM,EAAE,CAAC,QAAQ,CAAC;YAClB,SAAS,EAAE;gBACT,MAAM,EAAE,aAAa;gBACrB,OAAO,EAAE;oBACP,QAAQ,EAAE,IAAI;oBACd,aAAa,EAAE,cAAc;oBAC7B,MAAM,EAAE,cAAc;iBACvB;aACF;SACF,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAsB,EAAE,EAAE;IAClD,MAAM,GAAG,SAAS,CAAA;AACpB,CAAC,CAAA;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AAEvB,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export declare const executeCommand: {
|
|
2
|
+
readonly name: "execute_command";
|
|
3
|
+
readonly 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.";
|
|
4
|
+
readonly parameters: [{
|
|
5
|
+
readonly name: "command";
|
|
6
|
+
readonly 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.";
|
|
7
|
+
readonly required: true;
|
|
8
|
+
readonly usageValue: "Your command here";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "requires_approval";
|
|
11
|
+
readonly 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.";
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly usageValue: "true or false";
|
|
14
|
+
}];
|
|
15
|
+
readonly examples: [{
|
|
16
|
+
readonly description: "Request to execute a command";
|
|
17
|
+
readonly parameters: [{
|
|
18
|
+
readonly name: "command";
|
|
19
|
+
readonly value: "npm run dev";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "requires_approval";
|
|
22
|
+
readonly value: "false";
|
|
23
|
+
}];
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
export declare const readFile: {
|
|
27
|
+
readonly name: "read_file";
|
|
28
|
+
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.";
|
|
29
|
+
readonly parameters: [{
|
|
30
|
+
readonly name: "path";
|
|
31
|
+
readonly description: "The path of the file to read";
|
|
32
|
+
readonly required: true;
|
|
33
|
+
readonly usageValue: "Comma separated paths here";
|
|
34
|
+
}];
|
|
35
|
+
readonly examples: [{
|
|
36
|
+
readonly description: "Request to read the contents of a file";
|
|
37
|
+
readonly parameters: [{
|
|
38
|
+
readonly name: "path";
|
|
39
|
+
readonly value: "src/main.js";
|
|
40
|
+
}];
|
|
41
|
+
}, {
|
|
42
|
+
readonly description: "Request to read multiple files";
|
|
43
|
+
readonly parameters: [{
|
|
44
|
+
readonly name: "path";
|
|
45
|
+
readonly value: "src/main.js,src/index.js";
|
|
46
|
+
}];
|
|
47
|
+
}];
|
|
48
|
+
};
|
|
49
|
+
export declare const writeToFile: {
|
|
50
|
+
readonly name: "write_to_file";
|
|
51
|
+
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.";
|
|
52
|
+
readonly parameters: [{
|
|
53
|
+
readonly name: "path";
|
|
54
|
+
readonly description: "The path of the file to write to";
|
|
55
|
+
readonly required: true;
|
|
56
|
+
readonly usageValue: "File path here";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "content";
|
|
59
|
+
readonly 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.";
|
|
60
|
+
readonly required: true;
|
|
61
|
+
readonly usageValue: "Your file content here";
|
|
62
|
+
}];
|
|
63
|
+
readonly examples: [{
|
|
64
|
+
readonly description: "Request to write content to a file";
|
|
65
|
+
readonly parameters: [{
|
|
66
|
+
readonly name: "path";
|
|
67
|
+
readonly value: "src/main.js";
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "content";
|
|
70
|
+
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
71
|
+
}];
|
|
72
|
+
}];
|
|
73
|
+
};
|
|
74
|
+
export declare const replaceInFile: {
|
|
75
|
+
readonly name: "replace_in_file";
|
|
76
|
+
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.";
|
|
77
|
+
readonly parameters: [{
|
|
78
|
+
readonly name: "path";
|
|
79
|
+
readonly description: "The path of the file to modify";
|
|
80
|
+
readonly required: true;
|
|
81
|
+
readonly usageValue: "File path here";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "diff";
|
|
84
|
+
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";
|
|
85
|
+
readonly required: true;
|
|
86
|
+
readonly usageValue: "Search and replace blocks here";
|
|
87
|
+
}];
|
|
88
|
+
readonly examples: [{
|
|
89
|
+
readonly description: "Request to replace sections of content in a file";
|
|
90
|
+
readonly parameters: [{
|
|
91
|
+
readonly name: "path";
|
|
92
|
+
readonly value: "src/main.js";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "diff";
|
|
95
|
+
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";
|
|
96
|
+
}];
|
|
97
|
+
}];
|
|
98
|
+
};
|
|
99
|
+
export declare const searchFiles: {
|
|
100
|
+
readonly name: "search_files";
|
|
101
|
+
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.";
|
|
102
|
+
readonly parameters: [{
|
|
103
|
+
readonly name: "path";
|
|
104
|
+
readonly description: "The path of the directory to search in (relative to the current working directory). This directory will be recursively searched.";
|
|
105
|
+
readonly required: true;
|
|
106
|
+
readonly usageValue: "Directory path here";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "regex";
|
|
109
|
+
readonly description: "The regular expression pattern to search for. Uses Rust regex syntax.";
|
|
110
|
+
readonly required: true;
|
|
111
|
+
readonly usageValue: "Your regex pattern here";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "file_pattern";
|
|
114
|
+
readonly description: "Glob pattern to filter files (e.g., \"*.ts\" for TypeScript files). If not provided, it will search all files (*).";
|
|
115
|
+
readonly required: false;
|
|
116
|
+
readonly usageValue: "file pattern here (optional)";
|
|
117
|
+
}];
|
|
118
|
+
readonly examples: [{
|
|
119
|
+
readonly description: "Request to perform a regex search across files";
|
|
120
|
+
readonly parameters: [{
|
|
121
|
+
readonly name: "path";
|
|
122
|
+
readonly value: "src";
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "regex";
|
|
125
|
+
readonly value: "^src/components/";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "file_pattern";
|
|
128
|
+
readonly value: "*.ts";
|
|
129
|
+
}];
|
|
130
|
+
}];
|
|
131
|
+
};
|
|
132
|
+
export declare const listFiles: {
|
|
133
|
+
readonly name: "list_files";
|
|
134
|
+
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.";
|
|
135
|
+
readonly parameters: [{
|
|
136
|
+
readonly name: "path";
|
|
137
|
+
readonly description: "The path of the directory to list contents for (relative to the current working directory)";
|
|
138
|
+
readonly required: true;
|
|
139
|
+
readonly usageValue: "Directory path here";
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "depth";
|
|
142
|
+
readonly 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.";
|
|
143
|
+
readonly required: false;
|
|
144
|
+
readonly usageValue: "a number (optional)";
|
|
145
|
+
}];
|
|
146
|
+
readonly examples: [{
|
|
147
|
+
readonly description: "Request to list files";
|
|
148
|
+
readonly parameters: [{
|
|
149
|
+
readonly name: "path";
|
|
150
|
+
readonly value: "src";
|
|
151
|
+
}, {
|
|
152
|
+
readonly name: "recursive";
|
|
153
|
+
readonly value: "true";
|
|
154
|
+
}];
|
|
155
|
+
}];
|
|
156
|
+
};
|
|
157
|
+
export declare const listCodeDefinitionNames: {
|
|
158
|
+
readonly name: "list_code_definition_names";
|
|
159
|
+
readonly 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.";
|
|
160
|
+
readonly parameters: [{
|
|
161
|
+
readonly name: "path";
|
|
162
|
+
readonly description: "The path of the directory (relative to the current working directory ${cwd.toPosix()}) to list top level source code definitions for.";
|
|
163
|
+
readonly required: true;
|
|
164
|
+
readonly usageValue: "Directory path here";
|
|
165
|
+
}];
|
|
166
|
+
};
|
|
167
|
+
export declare const askFollowupQuestion: {
|
|
168
|
+
readonly name: "ask_followup_question";
|
|
169
|
+
readonly 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.";
|
|
170
|
+
readonly parameters: [{
|
|
171
|
+
readonly name: "question";
|
|
172
|
+
readonly description: "The question to ask the user. This should be a clear, specific question that addresses the information you need.";
|
|
173
|
+
readonly required: true;
|
|
174
|
+
readonly usageValue: "Your question here";
|
|
175
|
+
}];
|
|
176
|
+
readonly examples: [{
|
|
177
|
+
readonly description: "Request to ask a question";
|
|
178
|
+
readonly parameters: [{
|
|
179
|
+
readonly name: "question";
|
|
180
|
+
readonly value: "What is the name of the project?";
|
|
181
|
+
}];
|
|
182
|
+
}];
|
|
183
|
+
};
|
|
184
|
+
export declare const attemptCompletion: {
|
|
185
|
+
readonly name: "attempt_completion";
|
|
186
|
+
readonly 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.";
|
|
187
|
+
readonly parameters: [{
|
|
188
|
+
readonly name: "result";
|
|
189
|
+
readonly 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.";
|
|
190
|
+
readonly required: true;
|
|
191
|
+
readonly usageValue: "Your final result description here";
|
|
192
|
+
}];
|
|
193
|
+
readonly examples: [{
|
|
194
|
+
readonly description: "Request to present the result of the task";
|
|
195
|
+
readonly parameters: [{
|
|
196
|
+
readonly name: "result";
|
|
197
|
+
readonly value: "Your final result description here";
|
|
198
|
+
}];
|
|
199
|
+
}];
|
|
200
|
+
};
|