Question
Port the TUI sidebar (tui/index.tsx, tui/slots/sidebar-content.tsx) to the v2 CLI-plugin API:
- Module contract: v2 default export
{ id, setup(ctx) } (v1's (api, options, meta) TuiPlugin is rejected; our current { id, tui } shape would fail isPlugin).
- Slot:
api.slots.register({ order, slots: { sidebar_content } }) → ctx.ui.slot({ target: "sidebar.content", placement, render }) (check exact claim schema in packages/plugin/src/tui/* on the sst/opencode beta branch; placement kinds prepend/append/before/after/replace).
- Rebuild data flow: v1 read matched-rule state via
api.client + file reads; v2 CLI-plugin ctx has data stores (cached session/message stores + data.on event bus), client (OpenCodeClient), theme/themeMode. Check whether matched-rule state (still written to ~/.opencode/state/opencode-rules/{sessionID}.json by the server) is best read via the new client, storage, or direct fs read.
- Keep peer deps (solid-js ≥1.9, @opentui/* ≥0.5.10); verify the build (
build-tui.mjs) still emits dist/tui/index.js with the right shape for Host.resolve (./tui entry).
Question
Port the TUI sidebar (
tui/index.tsx,tui/slots/sidebar-content.tsx) to the v2 CLI-plugin API:{ id, setup(ctx) }(v1's(api, options, meta)TuiPlugin is rejected; our current{ id, tui }shape would failisPlugin).api.slots.register({ order, slots: { sidebar_content } })→ctx.ui.slot({ target: "sidebar.content", placement, render })(check exact claim schema inpackages/plugin/src/tui/*on the sst/opencodebetabranch; placement kinds prepend/append/before/after/replace).api.client+ file reads; v2 CLI-plugin ctx hasdatastores (cached session/message stores +data.onevent bus),client(OpenCodeClient),theme/themeMode. Check whether matched-rule state (still written to~/.opencode/state/opencode-rules/{sessionID}.jsonby the server) is best read via the new client,storage, or direct fs read.build-tui.mjs) still emitsdist/tui/index.jswith the right shape for Host.resolve (./tuientry).