@askalf/dario 3.13.3 → 3.15.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 +218 -9
  2. package/package.json +1 -1
@@ -146,6 +146,44 @@ 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
+ },
185
+ // Note: Hermes `terminal` tool uses the same {command} shape — covered
186
+ // by the `terminal` entry above.
149
187
  process: {
150
188
  ccTool: 'Bash',
151
189
  translateArgs: (a) => ({ command: a.action || a.cmd || '' }),
@@ -159,8 +197,20 @@ const TOOL_MAP = {
159
197
  },
160
198
  read_file: {
161
199
  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 ?? '' }),
200
+ translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || a.target_file || '' }),
201
+ translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', target_file: a.file_path ?? '' }),
202
+ },
203
+ // Windsurf
204
+ view_file: {
205
+ ccTool: 'Read',
206
+ 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 } : {}) }),
207
+ translateBack: (a) => ({ AbsolutePath: a.file_path ?? '', StartLine: Number(a.offset ?? 1), EndLine: Number(a.offset ?? 1) + Number(a.limit ?? 200) - 1 }),
208
+ },
209
+ // Continue.dev
210
+ builtin_read_file: {
211
+ ccTool: 'Read',
212
+ translateArgs: (a) => ({ file_path: a.path || '' }),
213
+ translateBack: (a) => ({ path: a.file_path ?? '' }),
164
214
  },
165
215
  write: {
166
216
  ccTool: 'Write',
@@ -172,12 +222,71 @@ const TOOL_MAP = {
172
222
  translateArgs: (a) => ({ file_path: a.filePath || a.path || a.file_path || '', content: a.content || '' }),
173
223
  translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', content: a.content ?? '' }),
174
224
  },
225
+ // Cline / Roo Code / Windsurf (#40)
226
+ write_to_file: {
227
+ ccTool: 'Write',
228
+ translateArgs: (a) => ({ file_path: a.path || a.filePath || a.file_path || a.TargetFile || '', content: a.content || a.CodeContent || '' }),
229
+ translateBack: (a) => ({ path: a.file_path ?? '', filePath: a.file_path ?? '', content: a.content ?? '', TargetFile: a.file_path ?? '' }),
230
+ },
231
+ // Continue.dev
232
+ builtin_create_new_file: {
233
+ ccTool: 'Write',
234
+ translateArgs: (a) => ({ file_path: a.path || '', content: a.content || '' }),
235
+ translateBack: (a) => ({ path: a.file_path ?? '', content: a.content ?? '' }),
236
+ },
175
237
  edit: {
176
238
  ccTool: 'Edit',
177
239
  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
240
  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
241
  },
180
- edit_file: { ccTool: 'Edit' },
242
+ edit_file: {
243
+ ccTool: 'Edit',
244
+ 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 || '' }),
245
+ translateBack: (a) => ({ file_path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
246
+ },
247
+ // Cline / Roo Code (#40)
248
+ replace_in_file: {
249
+ ccTool: 'Edit',
250
+ 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 || '' }),
251
+ translateBack: (a) => ({ path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
252
+ },
253
+ // Roo Code
254
+ apply_diff: {
255
+ ccTool: 'Edit',
256
+ translateArgs: (a) => ({ file_path: a.path || a.file_path || '', old_string: a.old_string || '', new_string: a.new_string || '' }),
257
+ translateBack: (a) => ({ path: a.file_path ?? '', diff: '' }),
258
+ reverseScore: 1,
259
+ },
260
+ // Roo Code / Cursor
261
+ search_replace: {
262
+ ccTool: 'Edit',
263
+ translateArgs: (a) => ({ file_path: a.file_path || a.path || '', old_string: a.old_string || '', new_string: a.new_string || '' }),
264
+ translateBack: (a) => ({ file_path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '' }),
265
+ },
266
+ // Continue.dev
267
+ builtin_edit_existing_file: {
268
+ ccTool: 'Edit',
269
+ translateArgs: (a) => ({ file_path: a.path || '', old_string: a.old_string || '', new_string: a.replacement || a.new_string || '' }),
270
+ translateBack: (a) => ({ path: a.file_path ?? '', replacement: a.new_string ?? '' }),
271
+ },
272
+ // Copilot
273
+ insert_edit_into_file: {
274
+ ccTool: 'Edit',
275
+ translateArgs: (a) => ({ file_path: a.filePath || a.file_path || '', old_string: a.old_string || '', new_string: a.code || a.new_string || '' }),
276
+ translateBack: (a) => ({ filePath: a.file_path ?? '', code: a.new_string ?? '', explanation: '' }),
277
+ },
278
+ // OpenHands
279
+ str_replace_editor: {
280
+ ccTool: 'Edit',
281
+ translateArgs: (a) => ({ file_path: a.path || '', old_string: a.old_str || '', new_string: a.new_str || '' }),
282
+ translateBack: (a) => ({ command: 'str_replace', path: a.file_path ?? '', old_str: a.old_string ?? '', new_str: a.new_string ?? '', security_risk: 'LOW' }),
283
+ },
284
+ // Hermes — `patch` tool in "replace" mode maps to Edit
285
+ patch: {
286
+ ccTool: 'Edit',
287
+ translateArgs: (a) => ({ file_path: a.path || '', old_string: a.old_string || '', new_string: a.new_string || '' }),
288
+ translateBack: (a) => ({ mode: 'replace', path: a.file_path ?? '', old_string: a.old_string ?? '', new_string: a.new_string ?? '', replace_all: false }),
289
+ },
181
290
  glob: { ccTool: 'Glob' },
182
291
  find_files: {
183
292
  ccTool: 'Glob',
@@ -186,8 +295,40 @@ const TOOL_MAP = {
186
295
  },
187
296
  list_files: {
188
297
  ccTool: 'Glob',
189
- translateArgs: (a) => ({ pattern: a.pattern || '*' }),
190
- translateBack: (a) => ({ pattern: a.pattern ?? '' }),
298
+ translateArgs: (a) => ({ pattern: a.pattern || '*', ...(a.path ? { path: a.path } : {}) }),
299
+ translateBack: (a) => ({ pattern: a.pattern ?? '', path: a.path ?? '.', recursive: false }),
300
+ },
301
+ // Cursor
302
+ file_search: {
303
+ ccTool: 'Glob',
304
+ translateArgs: (a) => ({ pattern: a.glob_pattern || a.query || a.pattern || '' }),
305
+ translateBack: (a) => ({ glob_pattern: a.pattern ?? '', query: a.pattern ?? '' }),
306
+ },
307
+ // Cursor / Windsurf / Copilot
308
+ list_dir: {
309
+ ccTool: 'Glob',
310
+ translateArgs: (a) => ({ pattern: '*', ...(a.target_directory || a.DirectoryPath || a.path ? { path: a.target_directory || a.DirectoryPath || a.path } : {}) }),
311
+ translateBack: (a) => ({ target_directory: a.path ?? '.', DirectoryPath: a.path ?? '.', path: a.path ?? '.' }),
312
+ reverseScore: 3,
313
+ },
314
+ // Windsurf
315
+ find_by_name: {
316
+ ccTool: 'Glob',
317
+ translateArgs: (a) => ({ pattern: a.Pattern || a.pattern || '*', ...(a.SearchDirectory ? { path: a.SearchDirectory } : {}) }),
318
+ translateBack: (a) => ({ Pattern: a.pattern ?? '', SearchDirectory: a.path ?? '.' }),
319
+ reverseScore: 5,
320
+ },
321
+ // Continue.dev
322
+ builtin_file_glob_search: {
323
+ ccTool: 'Glob',
324
+ translateArgs: (a) => ({ pattern: a.glob || a.pattern || '' }),
325
+ translateBack: (a) => ({ glob: a.pattern ?? '' }),
326
+ },
327
+ builtin_ls: {
328
+ ccTool: 'Glob',
329
+ translateArgs: (a) => ({ pattern: '*', ...(a.path ? { path: a.path } : {}) }),
330
+ translateBack: (a) => ({ path: a.path ?? '.' }),
331
+ reverseScore: 1,
191
332
  },
192
333
  grep: { ccTool: 'Grep' },
193
334
  search: {
@@ -197,13 +338,39 @@ const TOOL_MAP = {
197
338
  },
198
339
  search_files: {
199
340
  ccTool: 'Grep',
200
- translateArgs: (a) => ({ pattern: a.query || a.pattern || a.regex || '', ...(a.path ? { path: a.path } : {}), ...(a.filePattern ? { glob: a.filePattern } : {}) }),
201
- translateBack: (a) => ({ query: a.pattern ?? '', pattern: a.pattern ?? '', regex: a.pattern ?? '', path: a.path ?? '.', filePattern: a.glob ?? '' }),
341
+ 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 } : {}) }),
342
+ translateBack: (a) => ({ query: a.pattern ?? '', pattern: a.pattern ?? '', regex: a.pattern ?? '', path: a.path ?? '.', filePattern: a.glob ?? '', file_pattern: a.glob ?? '' }),
343
+ },
344
+ // Cursor / Windsurf
345
+ grep_search: {
346
+ ccTool: 'Grep',
347
+ 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] } : {}) }),
348
+ translateBack: (a) => ({ pattern: a.pattern ?? '', Query: a.pattern ?? '', path: a.path ?? '.', SearchPath: a.path ?? '.', ...(a.glob ? { glob: a.glob } : {}) }),
349
+ },
350
+ // Cursor / Windsurf / Roo Code / Copilot
351
+ codebase_search: {
352
+ ccTool: 'Grep',
353
+ translateArgs: (a) => ({ pattern: a.query || a.Query || a.pattern || '' }),
354
+ translateBack: (a) => ({ query: a.pattern ?? '', Query: a.pattern ?? '' }),
355
+ reverseScore: 3,
356
+ },
357
+ // Continue.dev
358
+ builtin_grep_search: {
359
+ ccTool: 'Grep',
360
+ translateArgs: (a) => ({ pattern: a.pattern || '', ...(a.path ? { path: a.path } : {}) }),
361
+ translateBack: (a) => ({ pattern: a.pattern ?? '', path: a.path ?? '.' }),
362
+ },
363
+ // Copilot
364
+ semantic_search: {
365
+ ccTool: 'Grep',
366
+ translateArgs: (a) => ({ pattern: a.query || '' }),
367
+ translateBack: (a) => ({ query: a.pattern ?? '' }),
368
+ reverseScore: 2,
202
369
  },
203
370
  web_search: {
204
371
  ccTool: 'WebSearch',
205
- translateArgs: (a) => ({ query: a.query || a.q || '' }),
206
- translateBack: (a) => ({ query: a.query ?? '' }),
372
+ translateArgs: (a) => ({ query: a.query || a.search_term || a.q || '' }),
373
+ translateBack: (a) => ({ query: a.query ?? '', search_term: a.query ?? '' }),
207
374
  },
208
375
  websearch: {
209
376
  ccTool: 'WebSearch',
@@ -230,6 +397,36 @@ const TOOL_MAP = {
230
397
  translateArgs: (a) => ({ url: a.url || '' }),
231
398
  translateBack: (a) => ({ url: a.url ?? '' }),
232
399
  },
400
+ // Windsurf
401
+ read_url_content: {
402
+ ccTool: 'WebFetch',
403
+ translateArgs: (a) => ({ url: a.Url || a.url || '' }),
404
+ translateBack: (a) => ({ Url: a.url ?? '', url: a.url ?? '' }),
405
+ },
406
+ // Hermes — web_extract takes {urls: [...]} but we map the first URL
407
+ web_extract: {
408
+ ccTool: 'WebFetch',
409
+ translateArgs: (a) => ({ url: Array.isArray(a.urls) ? String(a.urls[0] || '') : a.url || '' }),
410
+ translateBack: (a) => ({ urls: [a.url ?? ''] }),
411
+ },
412
+ // Copilot
413
+ fetch_webpage: {
414
+ ccTool: 'WebFetch',
415
+ translateArgs: (a) => ({ url: a.url || '' }),
416
+ translateBack: (a) => ({ url: a.url ?? '' }),
417
+ },
418
+ // Windsurf
419
+ search_web: {
420
+ ccTool: 'WebSearch',
421
+ translateArgs: (a) => ({ query: a.query || '' }),
422
+ translateBack: (a) => ({ query: a.query ?? '' }),
423
+ },
424
+ // Continue.dev
425
+ builtin_search_web: {
426
+ ccTool: 'WebSearch',
427
+ translateArgs: (a) => ({ query: a.query || '' }),
428
+ translateBack: (a) => ({ query: a.query ?? '', num_results: 5 }),
429
+ },
233
430
  notebook: { ccTool: 'NotebookEdit' },
234
431
  notebook_edit: { ccTool: 'NotebookEdit' },
235
432
  // Additional client tool mappings
@@ -243,6 +440,18 @@ const TOOL_MAP = {
243
440
  translateArgs: (a) => ({ question: String(a.message || a.content || '') }),
244
441
  translateBack: (a) => ({ message: a.question ?? '' }),
245
442
  },
443
+ // Cline / Roo Code
444
+ ask_followup_question: {
445
+ ccTool: 'AskUserQuestion',
446
+ translateArgs: (a) => ({ question: String(a.question || '') }),
447
+ translateBack: (a) => ({ question: a.question ?? '' }),
448
+ },
449
+ // Hermes
450
+ clarify: {
451
+ ccTool: 'AskUserQuestion',
452
+ translateArgs: (a) => ({ question: String(a.question || '') }),
453
+ translateBack: (a) => ({ question: a.question ?? '' }),
454
+ },
246
455
  todo_read: {
247
456
  ccTool: 'TodoWrite',
248
457
  translateArgs: () => ({ todos: [] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "3.13.3",
3
+ "version": "3.15.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": {