# Agent Smith UI — Project Navigation Map > **Purpose**: Single-reference map for AI coding agents to understand, navigate, and modify the Agent Smith UI codebase. > **See also**: `.agents/documentation/decision-tree.md` to find the right doc for your task. > **See also**: `.agents/documentation/project-overview.md` for concise project overview. --- ## 1. Project Overview | Module | Path | Purpose | |--------|------|---------| | `@agent-smith/ui` | `/workspace/` | Vue 3 dashboard for AI agent management with optional Node.js server binary | --- ## 2. Architecture Principles | Principle | Detail | Key Files | |-----------|--------|-----------| | Component-Based Layout | App.vue orchestrates header, sidebar dispatch, and router-view | `src/App.vue`, `src/components/sidebars/SidebarsDispatch.vue` | | Centralized Reactive State | Single state object via Vue `reactive()` + `@snowind/state` User class | `src/state.ts` | | Service Layer Isolation | Modular services for API, history, notifications, streaming events | `src/services/*.ts` | | Runtime Theme Switching | 14 SCSS themes switchable via CSS class on `` element | `src/scss/*.scss` | | Plugin Route Extension | Apps dynamically extend routes via server-side import | `src/apps/debate.js`, `src/bin/index.ts` | --- ## 3. Dependency Graph ``` @agent-smith/ui (Vue 3 + TypeScript) ├── @agent-smith/server — Backend HTTP/WebSocket server ├── @agent-smith/wscli — WebSocket client features ├── @agent-smith/types — Shared TypeScript types ├── @snowind/state — Reactive state management ├── @vueuse/core — Vue utilities (useStorage) ├── restmix — REST API client ├── markstream-vue — Streaming markdown renderer ├── stream-monaco — Streaming code editor └── @agent-smith/app-debate — Example plugin app ``` **Prose**: The UI layer depends on `@agent-smith/server` for backend communication and `@agent-smith/wscli` for real-time WebSocket features. State management uses a centralized reactive store with optional persistence via `useStorage()`. Plugins extend the application dynamically through server-side imports. --- ## 4. Packages/Modules ### src/main.ts — Vue App Bootstrap - **Purpose**: Create the Vue app, register the router and notification service, mount App component - **Key imports**: `App.vue`, `src/router.js`, `src/services/notify.js` ### src/App.vue — Root Layout - **Purpose**: Orchestrate header, sidebar dispatch, router-view, toast/confirmation dialogs - **Key components**: `TheHeader`, `SidebarsDispatch`, `` ### src/router.ts — Application Routing - **Purpose**: Define 9 routes for home, config, init, workflow, app, task run/view, agent run/view - **Key patterns**: Route meta with sidebar association ### src/state.ts — Central Reactive State - **Purpose**: Manage agent state, models, backends, workspaces, UI preferences - **Key types**: `AgentState`, `User` (from `@snowind/state`) - **Persistence**: UI preferences via `useStorage()` from `@vueuse/core` ### src/views/ — Page Components - **Purpose**: Top-level page components for each route - **Components**: HomeView, ConfigView, ConfigInitView, AppView, WorkflowView, TaskRunView, TaskViewView ### src/components/ — Core UI Components - **Purpose**: Reusable UI components (15 core components) - **Key components**: AgentParamsPicker, InferenceParamsForm, SamplingPresets, TaskTools, ViewAgent, TheHeader - **Subdirectories**: `sidebars/` (9 components: 7 named sidebars + SidebarsDispatch orchestrator + AgentHistoryNode helper), `navbars/` (2 toolbars), `vibe/toast/` (quick-message toast system), `vibe/notification/` (notification service) ### src/widgets/ — Reusable Widgets - **Purpose**: Small reusable UI elements - **Components**: ToolCallDetails, AutoTextarea, LoadingSpinner, HistoryTurnStatsBar, TurnTitle - **Subdirectory**: `icons/` (34 icon components with `*Icon.vue` suffix) ### src/services/ — Service Layer - **Purpose**: Isolated concerns for API, history, notifications, streaming - **Services**: agent-history, api, history, notify, task_events, perf, str, template (stats handling moved to history.ts) - **Key patterns**: task_events handles real-time streaming with markdown parsing (~20 parses/sec) ### src/scss/ — Theme System - **Purpose**: 14 SCSS themes with CSS custom properties for runtime switching - **Themes** (registered in `src/conf.ts`): airy-soft, black, cloud, default, forest, graphite, navy, pearl, royal, sandstone, slate, stone, teal - **Entry point**: `main.scss` aggregates 13 theme files; `default.scss` is an alias theme ### src/bin/index.ts — Server Binary - **Purpose**: Node.js HTTP server (`lmui`) with static asset serving and dynamic route loading - **Key patterns**: Server-side import for plugin apps ### src/apps/ — Plugin Applications - **Purpose**: Dynamically extend routes via server-side import - **Example**: `debate.js` demonstrates the plugin pattern --- ## 5. UI/Frontend ### Component Architecture - **Framework**: Vue 3 with Composition API and `