You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime(bun-compat): provide plugin / Bun.plugin as an inert registrar so OpenTUI's runtime-plugin support installs #10100
At TUI startup OpenCode runs ensureRuntimePluginSupport() (packages/opencode/src/plugin/tui/runtime.ts:44). That code does import { plugin as registerBunPlugin } from "bun" (node_modules/@opentui/solid/scripts/runtime-plugin-support-configure.js:1 and scripts/solid-plugin.js:1) and calls registerBunPlugin(createSolidTransformPlugin()) and registerBunPlugin(createRuntimePlugin(...)) (the @opentui/core/runtime-plugin specifier rewriter for user TUI plugins). Bun's plugin(p) invokes p.setup(build) synchronously; the plugin registers build.onLoad(...) loaders and records state.installed = true on globalThis[Symbol.for("opentui.solid.transform")].
Perry's bun module exposes stringWidth, file, write, stdin, hash, semver, JSONL, deepEquals, stripANSI, wrapAnsi, which, zstdDecompress*, gc, generateHeapSnapshot, Glob, pathToFileURL, fileURLToPath, TOML, YAML, spawn, … (crates/perry-hir/src/lower/expr_member.rs:340-360, crates/perry-runtime/src/bun_compat/) but no plugin; the member falls to js_bun_unsupported and the TUI dies before its first frame.
Scope
Add plugin(p) to the bun module and Bun.plugin: accept { name, setup } (object) or a function; call setup(build) synchronously with an inert build object (onLoad, onResolve, onStart, onEnd, config, module are accepted and ignored); return undefined (or a resolved promise if setup returns one), matching Bun's shape. Also accept Bun.plugin.clearAll() as a no-op.
import { plugin } from "bun"; plugin({ name: "x", setup(b) { b.onLoad({ filter: /a/ }, () => ({})); } }) compiles and returns without throwing; Bun.plugin(fn) likewise.
ensureRuntimePluginSupport() from @opentui/solid/runtime-plugin-support/configure returns true under perry and a second call returns false (installed-state bookkeeping works).
The OpenCode TUI proceeds past src/plugin/tui/runtime.ts module init in the native binary.
API manifest / docs drift gate updated (--print-api-manifest).
Activity
proggeramlug commentedon Sep 12, 2026
Fixed by #10130, landed on
mainvia merge train #10139 at5fbd9e527f.The close keyword does not fire through a train branch, so closing manually.