Commit 400a665
committed
feat: map more Cursor tools onto opencode native renderers
Generalize the edit→diff-viewer mapping into a table-driven adapter so
more of Cursor's internal tool activity renders with opencode's native
UI in blocks mode instead of generic cursor_* JSON blocks.
Native mappings (provider-executed + dynamic, never re-run on disk):
- shell→bash, read→read, write→write, glob→glob, grep→grep, ls→list,
updateTodos→todowrite, task→task
- web search (Cursor runs it as an MCP tool) → websearch
Cleaner fallbacks for tools with no opencode counterpart:
- readLints → formatted cursor_readLints diagnostics list
- delete → one-line cursor_delete confirmation
- any MCP tool's content[] flattened to readable text
Arg shapes are translated to opencode's (path→filePath, globPattern→
pattern, fileText→content, …). Tools without a mapping, or results with
an unexpected shape, still fall back to a safe cursor_* block.1 parent ae75b3f commit 400a665
4 files changed
Lines changed: 1010 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
7 | 25 | | |
8 | 26 | | |
9 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
339 | 353 | | |
340 | 354 | | |
341 | 355 | | |
| |||
0 commit comments