feat(v2): add TUI plugin entry with /preset switcher
Task 5 of the phase-2 plan: new v2 TUI plugin entry (./tui export -> dist/tui2.js) providing /preset on v2 hosts via ui.dialog.select + ui.toast + keymap.layer, persisted through the shared switchPresetOnDisk helper (dialog pick or /preset <name>; applies on next reload). Composition instead of a v2-only module: ./tui already shipped the dual-contract plugin (dist/tui.js, #1002), so src/v2/tui.ts re-exports the identical v1 tui factory and wraps the existing v2 setup (sidebar) with the preset keymap layer - v1 loading is unchanged, v2 gains both surfaces in one entry. dist/tui.js is still built (release artifact checks require it); the release smoke contract (id 'oh-my-opencode-slim: tui', tui fn, setup fn) holds for the new entry. v1 loader tolerance for the added `tui: true` field on the default export: the v1.18.13 clone was unavailable locally, but docs/opencode-v2-compatibility.md (phase-1 research on that same clone) records that readV1Plugin only probes for a `server` field and ignores extra keys; the shipped dual-contract precedent (#1002) confirms both hosts ignore unknown fields. `tui: true` is inert on v1. Also closes the Task 2 review gap: MultiplexerSessionManager is created unconditionally and self-gates only on env, so on a v2 host inside tmux it could self-enable. New sessionManagerMultiplexerConfig() forces type 'none' for hostFlavor === 'v2' (all manager methods no-op when disabled); v1 hosts receive the same config object untouched. build:tui externals mirror build:plugin (opentui/solid/plugin/sdk) with zod inlined like dist/server.js; types point at dist/v2/tui.d.ts (tsc mirrors the src tree).
G
GoldJohnKing committed
3866277c9ffe5cb0de16785c7945c67dcfb5e9e0
Parent: 34ad9eb