Issue 01: Adapter foundation for sample migration - #97
Merged
Conversation
Adds the view-model and adapter layer that later OpenTUI sample migration slices will consume, so components can render from normalized types instead of parsing raw `FrontendContentBlock`, `ConversationMessage`, or `PermissionRequest` shapes directly. - `ui/src/view-model/` — message/tool/status/permission types - `ui/src/adapters/` — content-block, message, permission, tool-status, and tool-input normalization helpers - Placeholder `index.ts` barrels for the staged migration targets: messages, permissions, mcp, teams, shell, PromptInput, StructuredDiff - 40 new tests covering the adapter surface Closes Crsei#90. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FrontendContentBlock/ConversationMessage/PermissionRequestshapes.messages/,permissions/,mcp/,teams/,shell/,PromptInput/,StructuredDiff/) with placeholderindex.tsbarrels, per the paths listed in Issue 01: Adapter Foundation For Sample Migration #90.Base:
tui— built on top of2255908 Retire the old ink-terminal frontend path.New files
ui/src/view-model/types.ts—MessageViewModelunion (user text/image, assistant message segmented on tool_use, tool use/result, system info),PermissionRequestViewModel,ImageRef,ToolStatus,PermissionCategoryui/src/adapters/content-blocks.ts—FrontendContentBlock[]/ToolResultContent/ToolResultContentInfo[]normalizationui/src/adapters/messages.ts—mapRawMessageToViewModels/mapConversationMessageToViewModelswith assistant-segment splitting, user image extraction, embedded tool_result handling, redacted-thinking flaggingui/src/adapters/permissions.ts— option hotkey parsing and tool categorization (bash / file_edit / file_write / web_fetch / tool_generic)ui/src/adapters/tool-status.ts,ui/src/adapters/tool-input.ts— status classification and input description helpers that mirror the existing store heuristicsConstraints honored (per #89)
ui/examples/upstream-patterns/imports.bun run buildsucceeds inui/.Test plan
bun run buildinui/— bundled 70 modules, 2.74 MB entrybun test src/adapters— 40 pass / 0 fail (5 files, 99 assertions)bun testfull suite — 82 pass / 1 unrelated env failure (missing Rust binary for IPC integration test)grepconfirms no activeimport ... from '.../upstream-patterns/...'inui/srcCloses #90.
🤖 Generated with Claude Code