Repository navigation
Closed
Description
Overview
Build the complete frontend for interacting with both local and external agents. This includes the AI entry point in the sidebar, a first-launch onboarding dialog, the chat interface, agent management, and model settings.
Develop entirely with mock backends — wire to real Tauri commands in #1007 (Tauri Command Layer).
Acceptance Criteria
- Side nav AI item opens the AI panel
- First-launch onboarding dialog presents two paths: existing LLM provider (ACP) or local model download
- ACP path shows detected agents with availability indicators
- Local model path auto-recommends RAM-appropriate model with download button
- Download progress bar updates in real-time (mock events for dev)
- After onboarding, subsequent clicks go straight to chat panel
- Chat panel renders message history with proper styling
- Streaming text appears token-by-token (mock with setTimeout for dev)
- Tool calls render in collapsible cards within the conversation
- Agent selector switches between local and ACP agents
- Model manager in Settings displays catalog models with correct status
- Keyboard: Enter to send, Shift+Enter newline, Escape to close panel
- All stores use Svelte 5 runes ($state, $derived, $effect)
- Uses
createLoggerfor logging, no raw console.log - Unit tests for stores and key component behaviors
- Code passes
bun run quality:fix
Technical Specifications
AI Entry Point and Onboarding
Side nav item:
- AI icon in the left sidebar (use existing
ai-icon.sveltefrom design system) - Opens AI panel in the main content area (same region as node viewers)
First-launch modal (AiOnboardingDialog.svelte):
- Shown when: user clicks AI nav item for first time, OR no model downloaded AND no ACP agents detected
- Two paths presented as cards:
Path 1: "Use an existing AI provider"
- Shows detected ACP agents (Claude Code, Gemini CLI, Mistral Vibe)
- Each with availability status (Installed/Not installed/Not configured)
- Click an available agent to start a session
- If none detected: show install instructions with links
Path 2: "Download a local model"
- Auto-recommend model based on
recommended_model()from backend - Display: model name, size, estimated download time
- Single "Download and Start" button
- Progress bar during download
- Note: "You can switch models later in Settings"
Chat Interface Components
Location: packages/desktop-app/src/lib/components/chat/
ChatPanel.svelte— Main panel with message list and inputChatMessage.svelte— Message bubble: user text, assistant text (streaming), tool calls, errorsChatInput.svelte— Text input with send button, Shift+Enter for multiline, disabled during processingToolCallDisplay.svelte— Collapsible card: tool name, args, result, duration, success/failure color
Agent Management Components
Location: packages/desktop-app/src/lib/components/agents/
AgentSelector.svelte— Dropdown/tabs for Local Agent vs ACP agents with availabilityAgentStatusBar.svelte— Compact indicator: current agent state (Idle, Thinking, Tool Execution)
Model Settings Components
Location: packages/desktop-app/src/lib/components/settings/
ModelManager.svelte— List models with status, download/delete buttons, progress barsModelPicker.svelte— Compact model selector for chat panel header
State Management (Svelte 5 Runes)
Location: packages/desktop-app/src/lib/stores/
chatStore.ts— Conversation history, current session, streaming stateagentStore.ts— Agent availability, selected agent, session statemodelStore.ts— Model list, download progress, loaded model, recommended model
Tauri Event Listeners (mocked for dev)
local-agent://chunk— streaming tokenslocal-agent://tool— tool execution updateslocal-agent://status— agent status changesmodel://download-progress— model download progressacp://session-state— ACP session state changes
Reference Files
packages/desktop-app/src/lib/design/icons/components/ai-icon.svelte— existing AI iconpackages/desktop-app/src/lib/design/components/— design system patternspackages/desktop-app/src/lib/stores/— existing store patterns- TypeScript interfaces from Shared types, traits, and interface contracts for agent subsystems #998
Dependencies
- Shared types, traits, and interface contracts for agent subsystems #998 (TypeScript event/command interfaces)
Related Issues
- ACP Integration and Local LLM Capability #997 (parent epic)
Activity
malibio commentedon Apr 3, 2026
Architecture Update (from planning session 2026-04-03)
Based on ADR-028 and ADR-029, several aspects of this issue are refined:
Chat UI is an AiChatNodeViewer
The chat panel is NOT a standalone floating panel — it's an
AiChatNodeViewerfollowing theQueryNodeViewerpattern (page-level viewer, opens in a tab like any other node type). The/ai-chatslash command creates a newai-chatnode and opens it.Write Buffering (frontend responsibility)
Messages are buffered in memory during active conversation. The frontend chatStore is the source of truth during active chat:
chatStore.tsneeds to manage the buffer and flush lifecycleTool Result Archival (at write time)
When flushing messages to the backend, tool call results should be archived:
result_summarystringresultpayloadSoft Message Cap UX
At ~500 messages, show a gentle prompt suggesting a new conversation. Not a hard limit — user can dismiss and continue.
SearchScope
Semantic search uses
SearchScopeenum (notexclude_types). DefaultKnowledgescope excludes ai-chat. The search UI should offer scope options when available.References
malibio commentedon Apr 3, 2026
Scope Boundary: #1003 vs #1017
These two issues overlap on chat UI. Here's the delineation:
#1003 (this issue) owns:
agentStore.ts,modelStore.ts#1017 owns:
AiChatNodeViewer.svelte(the page-level viewer for ai-chat nodes)ChatMessage.svelte,ChatInput.svelte,ToolCallDisplay.svelteAiOnboardingDialog.svelte(first-launch modal)chatStore.ts(conversation state, write buffering, message cap)aiChatNodePluginin core-plugins.ts (slash command, viewer registration)Shared: Both issues use the TypeScript interfaces from #998. The
AiChatNodeVieweruses the agent selector and model picker from #1003.Implementation Guide
Plugin Registration Pattern
Read
packages/desktop-app/src/lib/plugins/core-plugins.ts— every node type follows this:Register it alongside other plugins in the same file.
Tab/Navigation System
Read
packages/desktop-app/src/lib/stores/navigation.ts:Tabinterface (line 10) —{ id, title, type: 'node', content: { nodeId, nodeType } }addTab()(line 471) — creates tab, optionally makes activepluginRegistry.getViewer(nodeType)— onceaiChatNodePluginis registered, tabs withnodeType: 'ai-chat'automatically route to yourAiChatNodeViewerExisting Stores
All stores live in
packages/desktop-app/src/lib/stores/:navigation.ts— tabs and panes (primary navigation)collections.ts,schemas.ts,settings.ts,layout.tschatStore.ts,agentStore.ts,modelStore.ts) go hereViewer Pattern
Read
packages/desktop-app/src/lib/components/viewers/query-node-viewer.svelte— this is the closest pattern toAiChatNodeViewer:malibio commentedon Apr 3, 2026
Baseline: 119 test files, 3748 tests passed (37.73s)
feat: Chat UI, agent panel, model settings, and AI onboarding (closes #…
feat: Chat UI, agent panel, model settings, and AI onboarding (closes #…
feat: Chat UI, agent panel, model settings, and AI onboarding (closes #…