@askalf/dario 3.13.2 → 3.14.0

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 (2) hide show
  1. package/dist/cc-template.js +199 -10
  2. package/package.json +1 -1
@@ -146,6 +146,42 @@ const TOOL_MAP = {
146
146
  // reverse lookup picks the bash-family mapping for CC's Bash tool slot
147
147
  // instead of routing CC tool calls through process's action-based shape
148
148
  // and breaking every Bash call with "Unknown action" (dario#37).
149
+ // Cline / Roo Code (#40)
150
+ execute_command: {
151
+ ccTool: 'Bash',
152
+ translateArgs: (a) => ({ command: a.command || a.cmd || '', ...(a.description ? { description: a.description } : {}) }),
153
+ translateBack: (a) => ({ command: a.command ?? '', ...(a.description ? { description: a.description } : { description: a.command ?? '' }) }),
154
+ },
155
+ // Cursor
156
+ run_terminal_cmd: {
157
+ ccTool: 'Bash',
158
+ translateArgs: (a) => ({ command: a.command || '', ...(a.explanation ? { description: a.explanation } : {}) }),
159
+ translateBack: (a) => ({ command: a.command ?? '', is_background: false, ...(a.description ? { explanation: a.description } : {}) }),
160
+ },
161
+ // Windsurf
162
+ run_command: {
163
+ ccTool: 'Bash',
164
+ translateArgs: (a) => ({ command: a.CommandLine || a.command || '' }),
165
+ translateBack: (a) => ({ CommandLine: a.command ?? '', Blocking: true }),
166
+ },
167
+ // Continue.dev
168
+ builtin_run_terminal_command: {
169
+ ccTool: 'Bash',
170
+ translateArgs: (a) => ({ command: a.command || '' }),
171
+ translateBack: (a) => ({ command: a.command ?? '' }),
172
+ },
173
+ // Copilot
174
+ run_in_terminal: {
175
+ ccTool: 'Bash',
176
+ translateArgs: (a) => ({ command: a.command || '', ...(a.explanation ? { description: a.explanation } : {}) }),
177
+ translateBack: (a) => ({ command: a.command ?? '', ...(a.description ? { explanation: a.description } : {}) }),
178
+ },
179
+ // OpenHands
180
+ execute_bash: {
181
+ ccTool: 'Bash',
182
+ translateArgs: (a) => ({ command: a.command || '' }),
183
+ translateBack: (a) => ({ command: a.command ?? '', is_input: 'false', security_risk: 'LOW' }),
184
+ },
149
185
  process: {
150
186
  ccTool: 'Bash',
151
187
  translateArgs: (a) => ({ command: a.action || a.cmd || '' }),
@@ -159,8 +195,20 @@ const TOOL_MAP = {
159
195
  },
160
196
  read_file: {
161
197
  ccTool: 'Read',
162
- translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || '' }),
163
- translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '' }),
198
+ translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || a.target_file || '' }),
199
+ translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', target_file: a.file_path ?? '' }),
200
+ },
201
+ // Windsurf
202
+ view_file: {
203
+ ccTool: 'Read',
204
+ translateArgs: (a) => ({ file_path: a.AbsolutePath || a.path || '', ...(a.StartLine ? { offset: a.StartLine } : {}), ...(a.EndLine && a.StartLine ? { limit: Number(a.EndLine) - Number(a.StartLine) + 1 } : {}) }),
205
+ translateBack: (a) => ({ AbsolutePath: a.file_path ?? '', StartLine: Number(a.offset ?? 1), EndLine: Number(a.offset ?? 1) + Number(a.limit ?? 200) - 1 }),
206
+ },
207
+ // Continue.dev
208
+ builtin_read_file: {
209
+ ccTool: 'Read',
210
+ translateArgs: (a) => ({ file_path: a.path || '' }),
211
+ translateBack: (a) => ({ path: a.file_path ?? '' }),
164
212
  },
165
213
  write: {
166
214
  ccTool: 'Write',
@@ -172,12 +220,65 @@ const TOOL_MAP = {
172
220
  translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || '', content: a.content || '' }),
173
221
  translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', content: a.content ?? '' }),
174
222
  },
223
+ // Cline / Roo Code / Windsurf (#40)
224
+ write_to_file: {
225
+ ccTool: 'Write',
226
+ translateArgs: (a) => ({ file_path: a.path || a.filePath || a.file_path || a.TargetFile || '', content: a.content || a.CodeContent || '' }),
227
+ translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', content: a.content ?? '', TargetFile: a.file_path ?? '' }),
228
+ },
229
+ // Continue.dev
230
+ builtin_create_new_file: {
231
+ ccTool: 'Write',
232
+ translateArgs: (a) => ({ file_path: a.path || '', content: a.content || '' }),
233
+ translateBack: (a) => ({ path: a.file_path ?? '', content: a.content ?? '' }),
234
+ },
175
235
  edit: {
176
236
  ccTool: 'Edit',
177
237
  translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || '', old_string: a.oldString || a.old || a.old_string || '', new_string: a.newString || a.new || a.new_string || '' }),
178
238
  translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', old: a.old_string ?? '', oldString: a.old_string ?? '', new: a.new_string ?? '', newString: a.new_string ?? '' }),
179
239
  },
180
- edit_file: { ccTool: 'Edit' },
240
+ edit_file: {
241
+ ccTool: 'Edit',
242
+ translateArgs: (a) => ({ file_path: a.file_path || a.path || a.target_file || a.filePath || '', old_string: a.old_string || a.old || a.old_str || '', new_string: a.new_string || a.new || a.new_str || '' }),
243
+ translateBack: (a) => ({ file_path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
244
+ },
245
+ // Cline / Roo Code (#40)
246
+ replace_in_file: {
247
+ ccTool: 'Edit',
248
+ translateArgs: (a) => ({ file_path: a.path || a.filePath || a.file_path || '', old_string: a.old_string || a.old || '', new_string: a.new_string || a.new || '' }),
249
+ translateBack: (a) => ({ path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
250
+ },
251
+ // Roo Code
252
+ apply_diff: {
253
+ ccTool: 'Edit',
254
+ translateArgs: (a) => ({ file_path: a.path || a.file_path || '', old_string: a.old_string || '', new_string: a.new_string || '' }),
255
+ translateBack: (a) => ({ path: a.file_path ?? '', diff: '' }),
256
+ reverseScore: 1,
257
+ },
258
+ // Roo Code / Cursor
259
+ search_replace: {
260
+ ccTool: 'Edit',
261
+ translateArgs: (a) => ({ file_path: a.file_path || a.path || '', old_string: a.old_string || '', new_string: a.new_string || '' }),
262
+ translateBack: (a) => ({ file_path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
263
+ },
264
+ // Continue.dev
265
+ builtin_edit_existing_file: {
266
+ ccTool: 'Edit',
267
+ translateArgs: (a) => ({ file_path: a.path || '', old_string: a.old_string || '', new_string: a.replacement || a.new_string || '' }),
268
+ translateBack: (a) => ({ path: a.file_path ?? '', replacement: a.new_string ?? '' }),
269
+ },
270
+ // Copilot
271
+ insert_edit_into_file: {
272
+ ccTool: 'Edit',
273
+ translateArgs: (a) => ({ file_path: a.filePath || a.file_path || '', old_string: a.old_string || '', new_string: a.code || a.new_string || '' }),
274
+ translateBack: (a) => ({ filePath: a.file_path ?? '', code: a.new_string ?? '', explanation: '' }),
275
+ },
276
+ // OpenHands
277
+ str_replace_editor: {
278
+ ccTool: 'Edit',
279
+ translateArgs: (a) => ({ file_path: a.path || '', old_string: a.old_str || '', new_string: a.new_str || '' }),
280
+ translateBack: (a) => ({ command: 'str_replace', path: a.file_path ?? '', old_str: a.old_string ?? '', new_str: a.new_string ?? '', security_risk: 'LOW' }),
281
+ },
181
282
  glob: { ccTool: 'Glob' },
182
283
  find_files: {
183
284
  ccTool: 'Glob',
@@ -186,24 +287,82 @@ const TOOL_MAP = {
186
287
  },
187
288
  list_files: {
188
289
  ccTool: 'Glob',
189
- translateArgs: (a) => ({ pattern: a.pattern || '*' }),
190
- translateBack: (a) => ({ pattern: a.pattern ?? '' }),
290
+ translateArgs: (a) => ({ pattern: a.pattern || '*', ...(a.path ? { path: a.path } : {}) }),
291
+ translateBack: (a) => ({ pattern: a.pattern ?? '', path: a.path ?? '.', recursive: false }),
292
+ },
293
+ // Cursor
294
+ file_search: {
295
+ ccTool: 'Glob',
296
+ translateArgs: (a) => ({ pattern: a.glob_pattern || a.query || a.pattern || '' }),
297
+ translateBack: (a) => ({ glob_pattern: a.pattern ?? '', query: a.pattern ?? '' }),
298
+ },
299
+ // Cursor / Windsurf / Copilot
300
+ list_dir: {
301
+ ccTool: 'Glob',
302
+ translateArgs: (a) => ({ pattern: '*', ...(a.target_directory || a.DirectoryPath || a.path ? { path: a.target_directory || a.DirectoryPath || a.path } : {}) }),
303
+ translateBack: (a) => ({ target_directory: a.path ?? '.', DirectoryPath: a.path ?? '.', path: a.path ?? '.' }),
304
+ reverseScore: 3,
305
+ },
306
+ // Windsurf
307
+ find_by_name: {
308
+ ccTool: 'Glob',
309
+ translateArgs: (a) => ({ pattern: a.Pattern || a.pattern || '*', ...(a.SearchDirectory ? { path: a.SearchDirectory } : {}) }),
310
+ translateBack: (a) => ({ Pattern: a.pattern ?? '', SearchDirectory: a.path ?? '.' }),
311
+ reverseScore: 5,
312
+ },
313
+ // Continue.dev
314
+ builtin_file_glob_search: {
315
+ ccTool: 'Glob',
316
+ translateArgs: (a) => ({ pattern: a.glob || a.pattern || '' }),
317
+ translateBack: (a) => ({ glob: a.pattern ?? '' }),
318
+ },
319
+ builtin_ls: {
320
+ ccTool: 'Glob',
321
+ translateArgs: (a) => ({ pattern: '*', ...(a.path ? { path: a.path } : {}) }),
322
+ translateBack: (a) => ({ path: a.path ?? '.' }),
323
+ reverseScore: 1,
191
324
  },
192
325
  grep: { ccTool: 'Grep' },
193
326
  search: {
194
327
  ccTool: 'Grep',
195
- translateArgs: (a) => ({ pattern: a.query || a.pattern || '' }),
196
- translateBack: (a) => ({ query: a.pattern ?? '' }),
328
+ translateArgs: (a) => ({ pattern: a.query || a.pattern || '', ...(a.path ? { path: a.path } : {}) }),
329
+ translateBack: (a) => ({ query: a.pattern ?? '', pattern: a.pattern ?? '', path: a.path ?? '.' }),
197
330
  },
198
331
  search_files: {
199
332
  ccTool: 'Grep',
200
- translateArgs: (a) => ({ pattern: a.query || a.pattern || '' }),
333
+ translateArgs: (a) => ({ pattern: a.query || a.pattern || a.regex || '', ...(a.path ? { path: a.path } : {}), ...(a.filePattern || a.file_pattern ? { glob: a.filePattern || a.file_pattern } : {}) }),
334
+ translateBack: (a) => ({ query: a.pattern ?? '', pattern: a.pattern ?? '', regex: a.pattern ?? '', path: a.path ?? '.', filePattern: a.glob ?? '', file_pattern: a.glob ?? '' }),
335
+ },
336
+ // Cursor / Windsurf
337
+ grep_search: {
338
+ ccTool: 'Grep',
339
+ translateArgs: (a) => ({ pattern: a.pattern || a.query || a.Query || '', ...(a.path || a.SearchPath ? { path: a.path || a.SearchPath } : {}), ...(a.glob ? { glob: a.glob } : {}), ...(Array.isArray(a.Includes) && a.Includes[0] ? { glob: a.Includes[0] } : {}) }),
340
+ translateBack: (a) => ({ pattern: a.pattern ?? '', Query: a.pattern ?? '', path: a.path ?? '.', SearchPath: a.path ?? '.', ...(a.glob ? { glob: a.glob } : {}) }),
341
+ },
342
+ // Cursor / Windsurf / Roo Code / Copilot
343
+ codebase_search: {
344
+ ccTool: 'Grep',
345
+ translateArgs: (a) => ({ pattern: a.query || a.Query || a.pattern || '' }),
346
+ translateBack: (a) => ({ query: a.pattern ?? '', Query: a.pattern ?? '' }),
347
+ reverseScore: 3,
348
+ },
349
+ // Continue.dev
350
+ builtin_grep_search: {
351
+ ccTool: 'Grep',
352
+ translateArgs: (a) => ({ pattern: a.pattern || '', ...(a.path ? { path: a.path } : {}) }),
353
+ translateBack: (a) => ({ pattern: a.pattern ?? '', path: a.path ?? '.' }),
354
+ },
355
+ // Copilot
356
+ semantic_search: {
357
+ ccTool: 'Grep',
358
+ translateArgs: (a) => ({ pattern: a.query || '' }),
201
359
  translateBack: (a) => ({ query: a.pattern ?? '' }),
360
+ reverseScore: 2,
202
361
  },
203
362
  web_search: {
204
363
  ccTool: 'WebSearch',
205
- translateArgs: (a) => ({ query: a.query || a.q || '' }),
206
- translateBack: (a) => ({ query: a.query ?? '' }),
364
+ translateArgs: (a) => ({ query: a.query || a.search_term || a.q || '' }),
365
+ translateBack: (a) => ({ query: a.query ?? '', search_term: a.query ?? '' }),
207
366
  },
208
367
  websearch: {
209
368
  ccTool: 'WebSearch',
@@ -230,6 +389,30 @@ const TOOL_MAP = {
230
389
  translateArgs: (a) => ({ url: a.url || '' }),
231
390
  translateBack: (a) => ({ url: a.url ?? '' }),
232
391
  },
392
+ // Windsurf
393
+ read_url_content: {
394
+ ccTool: 'WebFetch',
395
+ translateArgs: (a) => ({ url: a.Url || a.url || '' }),
396
+ translateBack: (a) => ({ Url: a.url ?? '', url: a.url ?? '' }),
397
+ },
398
+ // Copilot
399
+ fetch_webpage: {
400
+ ccTool: 'WebFetch',
401
+ translateArgs: (a) => ({ url: a.url || '' }),
402
+ translateBack: (a) => ({ url: a.url ?? '' }),
403
+ },
404
+ // Windsurf
405
+ search_web: {
406
+ ccTool: 'WebSearch',
407
+ translateArgs: (a) => ({ query: a.query || '' }),
408
+ translateBack: (a) => ({ query: a.query ?? '' }),
409
+ },
410
+ // Continue.dev
411
+ builtin_search_web: {
412
+ ccTool: 'WebSearch',
413
+ translateArgs: (a) => ({ query: a.query || '' }),
414
+ translateBack: (a) => ({ query: a.query ?? '', num_results: 5 }),
415
+ },
233
416
  notebook: { ccTool: 'NotebookEdit' },
234
417
  notebook_edit: { ccTool: 'NotebookEdit' },
235
418
  // Additional client tool mappings
@@ -243,6 +426,12 @@ const TOOL_MAP = {
243
426
  translateArgs: (a) => ({ question: String(a.message || a.content || '') }),
244
427
  translateBack: (a) => ({ message: a.question ?? '' }),
245
428
  },
429
+ // Cline / Roo Code
430
+ ask_followup_question: {
431
+ ccTool: 'AskUserQuestion',
432
+ translateArgs: (a) => ({ question: String(a.question || '') }),
433
+ translateBack: (a) => ({ question: a.question ?? '' }),
434
+ },
246
435
  todo_read: {
247
436
  ccTool: 'TodoWrite',
248
437
  translateArgs: () => ({ todos: [] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "3.13.2",
3
+ "version": "3.14.0",
4
4
  "description": "A local LLM router. One endpoint, every provider — Claude subscriptions, OpenAI, OpenRouter, Groq, local LiteLLM, any OpenAI-compat endpoint — your tools don't need to change.",
5
5
  "type": "module",
6
6
  "bin": {