This release adds OpenCode 2.0.6+ support alongside the existing OpenCode v1 integration. It also raises the minimum supported OpenCode v1 version to 1.18.29.
Highlights
- Added OpenCode 2.0.6+ support, using the same policy, analyzer, and audit behavior as the v1 integration. (#123)
Added
- Added protection on OpenCode v2 through its tool hook, covering
shellcommands and read, edit, write, patch, grep, glob, and unknown-tool inputs, with typed tool denials. Code Mode child tool calls pass through the same hook. (#122) - Added v2 installation and updates to
npx -y cc-safety-net@latest install --opencode, which detects the host version and usesopencode plugin addandopencode plugin update, then confirms the plugin is registered inopencode plugin list. - Added a
shellplugin option for OpenCode v2 that sets the expected dialect (posixorpowershell). The plugin defaults to POSIX on Unix and PowerShell on Windows, verifies the actual executable before a shell starts, and rejects a mismatched or unsupported shell rather than analyzing it with the wrong parser. Seedocs/opencode-compatibility.md. - Added the
/cc-safety-netcommand on OpenCode v2. A command of that name already present when the plugin loads is preserved. - Added the
cc-safety-net/opencode/v2entry point for TypeScript consumers using the OpenCode v2 SDK. v1 consumers continue to useCCSafetyNetPluginfromcc-safety-net.
Changed
- Changed
install --opencodeto stop with a migration message when an OpenCode v2 config already listscc-safety-netunder a spec other thancc-safety-net@latest, instead of creating a duplicate plugin ID. Change that entry's package spec, keeping its options and comments, then retry.
Fixed
- Fixed OpenCode config discovery to honor the
OPENCODE_CONFIG_DIRoverride, which affects both integration detection and uninstall. - Fixed
uninstallto removecc-safety-netentries from every detected OpenCode config file instead of stopping at the first one, and to report accurately whether an entry was removed. - Fixed OpenCode detection and uninstall to recognize both the
pluginandpluginsarrays and object-form plugin entries, and to match only thecc-safety-netpackage spec instead of any entry whose name contains it. - Improved OpenCode config editing so removing a plugin entry preserves neighboring comments in JSONC configs.
Breaking Changes
- Raised the minimum supported OpenCode v1 version to 1.18.29, up from 1.18.3.
install --opencodenow stops with a version error on older releases.- Migration: Upgrade OpenCode to 1.18.29+ or 2.0.6+ before updating CC Safety Net.