Source file: docs/issues/2026-04-22-opentui-example-migration-01-adapter-foundation.md
Labels: ui, frontend, opentui, foundation
Priority: P1
Depends on: none
Goal
Create the compatibility layer that allows the active OpenTUI frontend to absorb sample-tree behavior without importing upstream runtime assumptions directly.
Why First
The sample tree assumes a different runtime, richer store shape, and different rendering contracts. Without an adapter layer, every imported slice will couple the maintained frontend back to the old architecture.
Scope
- Add a Lite-facing adapter/view-model layer under
ui/src/
- Normalize current protocol/store shapes into component-friendly types
- Pre-create target directories for staged migration
Suggested Paths
ui/src/view-model/
ui/src/adapters/
ui/src/components/messages/
ui/src/components/permissions/
ui/src/components/mcp/
ui/src/components/teams/
ui/src/components/shell/
ui/src/components/PromptInput/
ui/src/components/StructuredDiff/
Inputs
Active frontend:
ui/src/ipc/protocol.ts
ui/src/store/app-state.ts
ui/src/store/message-model.ts
ui/src/components/App.tsx
Reference corpus:
ui/examples/upstream-patterns/src/components/**
Tasks
- Define a normalized message/tool/status view model for the maintained frontend.
- Add mapping utilities from current
FrontendContentBlock, ConversationMessage, and RawMessage shapes.
- Add adapter helpers for:
- assistant text
- thinking
- tool use / tool result
- image blocks
- system messages
- permission requests
- Pre-create destination component directories even if most files are still placeholders.
- Add tests for the adapter layer where current store logic is already covered by unit tests.
Acceptance Criteria
- No new active code depends on
ui/examples/upstream-patterns/ imports.
- The adapter layer compiles under the current OpenTUI build.
- Later issues can consume normalized types without touching raw protocol parsing.
bun run build succeeds in ui/.
Out Of Scope
- replacing the current message UI
- replacing the composer
- introducing the sample-tree runtime
Verification
bun run build in ui/
- adapter-focused tests if new mapper logic is introduced
Epic
Parent epic: #89
Source file: docs/issues/2026-04-22-opentui-example-migration-01-adapter-foundation.md
Labels:
ui,frontend,opentui,foundationPriority:
P1Depends on: none
Goal
Create the compatibility layer that allows the active OpenTUI frontend to absorb sample-tree behavior without importing upstream runtime assumptions directly.
Why First
The sample tree assumes a different runtime, richer store shape, and different rendering contracts. Without an adapter layer, every imported slice will couple the maintained frontend back to the old architecture.
Scope
ui/src/Suggested Paths
ui/src/view-model/ui/src/adapters/ui/src/components/messages/ui/src/components/permissions/ui/src/components/mcp/ui/src/components/teams/ui/src/components/shell/ui/src/components/PromptInput/ui/src/components/StructuredDiff/Inputs
Active frontend:
ui/src/ipc/protocol.tsui/src/store/app-state.tsui/src/store/message-model.tsui/src/components/App.tsxReference corpus:
ui/examples/upstream-patterns/src/components/**Tasks
FrontendContentBlock,ConversationMessage, andRawMessageshapes.Acceptance Criteria
ui/examples/upstream-patterns/imports.bun run buildsucceeds inui/.Out Of Scope
Verification
bun run buildinui/Epic
Parent epic: #89