Repository navigation
fix(plugin): lower the @opentui peer floor to 0.8.0 and stop raising it on upgrades - #65819
Conversation
There was a problem hiding this comment.
I found no problems with this change. I compared the @opentui/core 0.8.4, 0.9.0 and 0.9.4 type definitions from npm. MarkdownCodeBlockRenderer changed in 0.9.0, and from 0.9.0 to 0.9.4 nothing the plugin API imports changed except a few lines added to Renderable, so a 0.9.0 floor holds. typecheck:tsc passes in packages/plugin. Running script/upgrade-opentui.ts 0.9.3 in a scratch worktree updated the catalog and lockfile and left the plugin's peer ranges alone.
Public API: the @opencode/plugin peers @opentui/core and @opentui/solid go from >=0.9.4 to >=0.9.0. They're still optional. This only widens the range, so it is backwards compatible.
There was a problem hiding this comment.
I found nothing that should block lowering the floor to >=0.8.0. Under Bun, @opentui/solid's runtime plugin support (loaded by packages/tui) redirects plugins' @opentui/core and @opentui/solid imports to opencode's own copies. The installed version therefore only affects install resolution and types. typecheck:tsc in packages/plugin passes with the catalog temporarily set to OpenTUI 0.8.0.
One trade-off: a plugin built on 0.8 types is told its code-block renderer gets a Tokens.Code. At runtime it gets a MarkdownCodeBlock, which keeps text, raw, lang and type but has no codeBlockStyle or escaped. Your scan of published plugins found none reading those two fields, so this is only a note.
Public API: the @opencode/plugin peers @opentui/core and @opentui/solid go from >=0.9.4 to >=0.8.0. They're still optional. This only widens the range, so it is backwards compatible.
Issue for this PR
Related: #59222
Type of change
What does this PR do?
script/upgrade-opentui.tsset every@opentui/*peer range to>=<new version>on each OpenTUI upgrade. So@opencode/pluginraised its peer floor with every TUI bump (>=0.6.8→0.7.0→>=0.8.0→>=0.8.1→>=0.8.4→>=0.9.4), even when nothing it exports had changed. Plugins with a capped@opentuirange then fail to install withunable to resolve dependency tree.packages/plugin/package.json: lower the@opentui/coreand@opentui/solidpeers from>=0.9.4to>=0.8.0, the floor before the 0.9 bump. Under Bun, OpenTUI's runtime plugin support (ensureRuntimePluginSupportinpackages/tui/src/plugin/runtime-plugin-support.bun.ts) rewrites plugins'@opentui/*imports to the host's modules, so the installed version only affects install and types. A scan of 132 published plugins found none using the APIs 0.9.0 removed, apart from one passing the removedinternalBlockModeprop. The two usingregisterCodeBlockRendererreadtext, whichMarkdownCodeBlockstill has.script/upgrade-opentui.ts: stop editingpeerDependencies. Dependencies, devDependencies, the catalog and overrides still update as before. A peer range is public API and should only move when an exported type changes.bun.lock: the matching peer range.This makes plugins capped at
<0.9or pinned to 0.8.x installable again (e.g.opencode-subagent-statusline@2.1.1,@joe-broadhead/opencode-messaging). It doesn't fix plugins that cap@opentuibelow 0.8. The installer resolves them against the latest@opencode/plugin, so they still conflict. That needs the plugin installer to stop failing on peer conflicts for packages opencode ships itself, which is a separate change.How did you verify your code works?
bun install --frozen-lockfilepasses with the updated lockfile.bun run typecheckinpackages/pluginpasses against the catalog's OpenTUI 0.9.4 and against 0.8.0, 0.8.4 and 0.9.0 (catalog temporarily changed, then reverted).bun run lint:changedreports no changed TypeScript files under its scope.Screenshots / recordings
Not a UI change.
Checklist
Requested by: @kommander (Sebastian via Slack)
Added by the opencode bot (AI-generated).
Related: #59222, #58807
Public API: lowers @opencode/plugin's @opentui/core and @opentui/solid peer ranges from >=0.9.4 to >=0.8.0 (backwards compatible)