feat: default to blocks tool display + native edit diff viewer#12
Merged
Conversation
Default toolDisplay to "blocks" so Cursor's tool activity renders as structured tool blocks out of the box. "reasoning" stays available as the documented fallback for pre-1.16 / non-V3 opencode hosts. Map Cursor `edit` activity onto opencode's native `edit` tool so its built-in diff viewer renders: the real unified diff is passed via metadata.diff and oldString/newString are reconstructed from it (the call is provider-executed, so they are never applied to disk). Edits without a usable diff fall back to a safe cursor_edit block; all other tools remain cursor_* prefixed blocks. Test infra: typecheck now covers test/ via a dedicated build config (tsconfig.build.json handles src-only emit), surfacing and fixing 10 stale-type test bugs that the excluded test dir had hidden.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
"blocks"the default tool display and render Cursor file edits with opencode's native diff viewer.Cursor's internal tool activity previously defaulted to compact
"reasoning"lines. This switches the default to"blocks"(structured, provider-executed tool parts) and, for edits specifically, lights up opencode's built-in diff viewer.Changes
Default →
"blocks"cursorEventsToStream/cursorEventsToContentdefault to"blocks";createCursorsetstoolDisplay: options.toolDisplay ?? "blocks"."reasoning"remains the documented fallback for older / non-V3 hosts (opencode < 1.16). README + CHANGELOG updated.Native diff viewer for edits
editactivity is emitted under opencode's registerededittool so its built-in diff viewer renders; the real unified diff (Cursor'sresult.value.diffString) is passed viametadata.diff.editschema requiresoldString/newString, which Cursor does not expose — these are reconstructed from the diff's-/+lines purely to satisfy schema validation. The call is provider-executed, so they are never applied to disk.edittool) falls back to a safecursor_editblock. All other tools remaincursor_*prefixed blocks.Test infrastructure
tsconfig.jsonnow coverstest/; a newtsconfig.build.jsonhandles the src-only declaration emit (wired into tsup). This surfaced and fixed 10 stale-type test bugs the previously-excludedtest/dir had hidden.Verification
npm run typecheck,npm run build, andnpm test(128 tests) all pass.cursor_*blocks.Notes
oldString/newStringare faithful for single-hunk edits and approximate (concatenated) for multi-hunk; they appear in the transcript but are never executed.