بنقرة واحدة
assistant-ui
Project-specific guide for the chat UI -- components, terminal theme, message rendering, runtime setup
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Project-specific guide for the chat UI -- components, terminal theme, message rendering, runtime setup
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | assistant-ui |
| description | Project-specific guide for the chat UI -- components, terminal theme, message rendering, runtime setup |
| version | 0.0.1 |
| license | MIT |
How ComfyUI Assistant uses the assistant-ui library. For generic library reference, see ./references/.
| File | Purpose |
|---|---|
ui/src/components/assistant-ui/thread.tsx | Main Thread component: messages, composer, slash command autocomplete, branch picker |
ui/src/components/assistant-ui/markdown-text.tsx | Markdown rendering (MarkdownText, MarkdownBlock) for assistant messages (syntax highlighting, code blocks) |
ui/src/components/assistant-ui/interleaved-message-content.tsx | Renders message content in execution order: text blocks interleaved with tools and reasoning (avoids "text first, tools after" layout) |
ui/src/components/assistant-ui/tool-fallback.tsx | Renders tool calls as terminal log lines (prefix ›, name, status icon); details (args, result, error) expand on click |
ui/src/components/assistant-ui/attachment.tsx | File attachment display |
ui/src/components/assistant-ui/onboarding.tsx | First-time onboarding flow (personality, goals) |
ui/src/components/assistant-ui/thread-list.tsx | Thread list (hidden in UI; sessions managed via slash commands) |
ui/src/components/assistant-ui/terminal-theme.css | Terminal-style CSS variables and theme |
ui/src/components/assistant-ui/tooltip-icon-button.tsx | Reusable icon button with tooltip |
The chat uses a terminal aesthetic, not a typical chat bubble UI:
> (prompt character), dark background rgba(0, 0, 0, 0.22)* (bullet), no backgroundterminal-theme.css
--terminal-prompt: prompt/accent color--terminal-dim: secondary/muted textInterleavedMessageContent iterates over message.content in order, rendering text blocks (markdown) and tools/reasoning interleaved (text → tool → text → tool). Consecutive text parts are merged and deduplicated to avoid streaming duplicates.MarkdownBlock (markdown with syntax highlighting, code blocks)<details> block with "Chain of Thought" summaryToolFallback component. Each tool appears as a single terminal-style log line (prefix ›, status icon, tool name, chevron). Collapsed by default; click to expand args, result, or error. Styling matches terminal dim/foreground; no card or box so the chat stays readable.> prefix| Change | File | What to Edit |
|---|---|---|
| Message appearance | thread.tsx | AssistantMessage or UserMessage component |
| Message layout (order text/tools) | interleaved-message-content.tsx | InterleavedMessageContent component |
| Markdown rendering | markdown-text.tsx | MarkdownText, MarkdownBlock, remark/rehype plugins |
| Tool result display | tool-fallback.tsx | ToolFallback component |
| Theme colors | terminal-theme.css | CSS custom properties |
| Empty state / ASCII logo | thread.tsx | ThreadEmpty component |
| Composer behavior | thread.tsx | Composer component and slash command integration |
| Onboarding flow | onboarding.tsx | Onboarding component |
| Bottom panel config | main.tsx | bottomPanelTabs in registerExtension() |
App.tsxAssistantRuntimeProvider
runtime = useChatRuntime({
transport: AssistantChatTransport({ api: '/api/chat' }),
sendAutomaticallyWhen: shouldResubmitAfterToolResult
})
└── ChatWithTools
├── useComfyTools() → registers tools into ModelContext
└── Thread
AssistantChatTransport handles SSE communication with /api/chatshouldResubmitAfterToolResult checks if the last message part is a tool invocation; if so, automatically resubmits for the next LLM responseuseComfyTools() hook creates tools via createTools(context) and registers themEdit AssistantMessage or UserMessage in thread.tsx. For markdown rendering, edit markdown-text.tsx. For tool results, edit tool-fallback.tsx.
Edit terminal-theme.css. The main variables are --terminal-prompt (accent) and --terminal-dim (muted).
Add a new component and include it in the MessagePrimitive.Parts rendering in AssistantMessage within thread.tsx.
Edit main.tsx -- modify the bottomPanelTabs configuration in registerExtension(). See ui-integration skill for details.
thread-list.tsx exists but the thread list is hidden in the UI. Sessions are managed via slash commands (/new, /session, /sessions, /rename).
ui-integration -- how the React app registers with ComfyUIarchitecture-overview -- runtime and agentic loop explanationbackend-tools-declaration -- tool definitions that drive ToolFallback renderingInstall ComfyUI Assistant as a ComfyUI custom node. Use when performing or troubleshooting installation (clone, Python deps, frontend build, restart).
For complex user requests — evaluate, investigate, ask questions, propose a plan, accept modifications, then execute. Use when the request is multi-step, ambiguous, or high-impact.
Workflow execution and complete workflow generation tools (executeWorkflow, applyWorkflowJson). Use when the user wants to run a workflow or build a complete workflow from a description.
Python backend modules, chat request lifecycle, SSE format, and API endpoints
System prompt assembly from system_context, user_context, and environment sources
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.