diff --git a/README.md b/README.md
index 0f23efc..df7c9ab 100644
--- a/README.md
+++ b/README.md
@@ -1,180 +1,224 @@
# AI Terminal Assistant
-**็ฑ kurihada ๅผๅ**
+
-ไธไธช่ฟ่กๅจ็ป็ซฏไธญ็ AI ็ผ็จๅฉๆ๏ผๅบไบ Claude API ๆๅปบใๅฏไปฅๅธฎๅฉๆจ่ฏปๅๅๅๅ
ฅๆไปถใๆง่ก bash ๅฝไปคใๆ็ดขไปฃ็ ๅๆไปถใๅ็ญ็ผ็จ้ฎ้ข็ญใ
+## ๐ Overview
-## โจ ็นๆง
+AI Terminal Assistant is a comprehensive AI-powered development toolkit that helps developers write code, debug issues, and manage projects more efficiently. Built as a modular monorepo, it provides multiple interfaces (CLI, Web, Desktop) to interact with Claude AI for various programming tasks.
-- ๐ **็ป็ซฏๅ็ไฝ้ช**๏ผ็ดๆฅๅจ็ป็ซฏไธญไธ AI ไบคไบ
-- ๐ง **ๅผบๅคง็ๅทฅๅ
ท้**๏ผ
- - ๆไปถ่ฏปๅๆไฝ
- - Bash ๅฝไปคๆง่ก
- - ็ฎๅฝๅ่กจๅๆไปถๆ็ดข
- - ไปฃ็ ๅๆๅๅปบ่ฎฎ
-- ๐ก๏ธ **ๅฎๅ
จ็ฌฌไธ**๏ผๅจๆง่กๅฏ่ฝๆ้ฃ้ฉ็ๅฝไปคๅไผ่ฏทๆฑ็กฎ่ฎค
-- ๐ฌ **ไธค็งๆจกๅผ**๏ผ
- - ไบคไบๆจกๅผ๏ผๆ็ปญๅฏน่ฏ
- - ๅๆฌกๆ้ฎๆจกๅผ๏ผๅฟซ้่ทๅ็ญๆก
-- โ๏ธ **ๅฏ้
็ฝฎ**๏ผๆฏๆๅค็ง AI ๆจกๅๅๅๆฐ้
็ฝฎ
+## โจ Features
-## ๐ฆ ๅฎ่ฃ
+### Core Capabilities
+- ๐ง **Advanced AI Agent** - Powered by Claude API with streaming responses
+- ๐ง **Rich Tool System** - File operations, bash commands, code search, and more
+- ๐ **Smart Code Editing** - Multiple edit modes (whole, diff, search-replace)
+- ๐ **Language Server Protocol** - IDE-like code intelligence
+- ๐พ **Checkpoint System** - Shadow Git for safe experimentation
+- ๐ **Model Context Protocol** - Extensible tool integration
+- ๐ฃ **Hook System** - Pre/post execution customization
-### ๅๆๆกไปถ
-- Node.js 18+
+### User Interfaces
+- ๐ฅ๏ธ **CLI** - Terminal-native experience with serve/attach modes
+- ๐ **Web UI** - Modern React interface with real-time updates
+- ๐ฑ๏ธ **Desktop App** - Tauri-based native application (Coming soon)
+
+### Developer Experience
+- ๐ฆ **Monorepo Architecture** - Clean separation of concerns
+- ๐ **Built with Bun** - Fast runtime and bundling
+- ๐ฅ **Hot Reload** - Development with instant feedback
+- ๐งช **Comprehensive Testing** - Unit and integration tests
+- ๐ **Type Safety** - Full TypeScript support
+
+## ๐ Quick Start
+
+### Prerequisites
+- Node.js 18+ or Bun 1.0+
+- pnpm 8.0+
- Anthropic API Key
-### ๅ
จๅฑๅฎ่ฃ
-```bash
-npm install -g .
-```
+### Installation
-### ๆฌๅฐๅผๅ
```bash
-# ๅ
้้กน็ฎ
-git clone
+# Clone the repository
+git clone
cd ai-terminal-assistant
-# ๅฎ่ฃ
ไพ่ต
-npm install
+# Install dependencies
+pnpm install
-# ๆๅปบ้กน็ฎ
-npm run build
+# Set up environment variables
+cp .env.example .env
+# Edit .env and add your ANTHROPIC_API_KEY
-# ้พๆฅๅฐๅ
จๅฑ
-npm link
+# Build all packages
+pnpm build
```
-## ๐ ๅฟซ้ๅผๅง
+### Running the Application
-### 1. ๅๅงๅ้
็ฝฎ
+#### Option 1: Web Interface
```bash
-ai-assist init
-```
-ๆ็
งๆ็คบ่ฎพ็ฝฎๆจ็ Anthropic API Keyใ
+# Start the server
+pnpm server:dev
-### 2. ๅฏๅจไบคไบๆจกๅผ
+# In another terminal, start the web UI
+pnpm web:dev
+
+# Open http://localhost:5173 in your browser
+```
+
+#### Option 2: CLI Mode
```bash
-ai-assist
+# Start the server
+cd packages/cli && bun run src/index.ts serve --port 3000
+
+# In another terminal, attach to the server
+cd packages/cli && bun run src/index.ts attach http://localhost:3000
```
-### 3. ๅๆฌกๆ้ฎๆจกๅผ
+## ๐ฆ Packages
+
+This monorepo contains four main packages:
+
+| Package | Description | Status |
+|---------|-------------|--------|
+| [@ai-assistant/core](./packages/core) | Core agent engine, tools, and integrations | โ
Stable |
+| [@ai-assistant/server](./packages/server) | HTTP/WebSocket server with REST API | โ
Stable |
+| [@ai-assistant/cli](./packages/cli) | Command-line interface | โ
Stable |
+| [@ai-assistant/web](./packages/web) | React-based web interface | โ
Stable |
+
+## ๐๏ธ Architecture
+
+```mermaid
+graph TD
+ Web[Web UI] --> Server
+ CLI[CLI] --> Server
+ Desktop[Desktop App] --> Server
+ Server --> Core[Core Engine]
+ Core --> Tools[Tool System]
+ Core --> LSP[Language Server]
+ Core --> MCP[Model Context Protocol]
+ Core --> Checkpoint[Checkpoint System]
+```
+
+### Technology Stack
+
+- **Runtime**: Bun / Node.js
+- **Language**: TypeScript
+- **Server**: Hono + Bun WebSocket
+- **Frontend**: React + Vite + Tailwind CSS
+- **Desktop**: Tauri (Rust + WebView)
+- **Testing**: Vitest
+- **Package Manager**: pnpm (monorepo)
+
+## ๐ Documentation
+
+Detailed documentation is available in the [docs](./docs) directory:
+
+- [Architecture Overview](./docs/design/architecture/gui-server-client.md)
+- [API Reference](./docs/api/README.md)
+- [Development Guide](./docs/development/README.md)
+- [Configuration Guide](./docs/configuration/README.md)
+
+## ๐ ๏ธ Development
+
+### Common Commands
+
```bash
-ai-assist ask "ๅฆไฝ่ฏปๅๅฝๅ็ฎๅฝไธ็ๆๆๆไปถ๏ผ"
+# Install dependencies
+pnpm install
+
+# Build all packages
+pnpm build
+
+# Run tests
+pnpm test
+pnpm test:coverage
+
+# Linting
+pnpm lint
+
+# Type checking
+pnpm typecheck
+
+# Clean build artifacts
+pnpm clean
```
-## ๐ฏ ไฝฟ็จ็คบไพ
+### Package-specific Development
-### ๆไปถๆไฝ
-```
-็จๆท๏ผ่ฏปๅ package.json ๆไปถ
-AI๏ผๆญฃๅจ่ฏปๅ package.json...
-๏ผๆพ็คบๆไปถๅ
ๅฎน๏ผ
-็จๆท๏ผไฟฎๆน็ๆฌๅทไธบ 1.0.1
-AI๏ผ็กฎ่ฎค่ฆไฟฎๆน package.json ๅ๏ผ (y/n)
+```bash
+# Work on a specific package
+pnpm --filter @ai-assistant/core dev
+pnpm --filter @ai-assistant/server test
+pnpm --filter @ai-assistant/web build
```
-### ไปฃ็ ๅๆ
-```
-็จๆท๏ผๅธฎๆๅๆ src/index.ts ไธญ็ไธป่ฆๅ่ฝ
-AI๏ผๆญฃๅจ่ฏปๅๆไปถ...
-๏ผๅๆไปฃ็ ็ปๆ๏ผ่งฃ้ไธป่ฆๅ่ฝ๏ผ
-```
+## ๐ง Configuration
-### ็ณป็ปๅฝไปค
-```
-็จๆท๏ผๆฅ็ๅฝๅ็ฎๅฝ็ๆไปถๅ่กจ
-AI๏ผๆญฃๅจๆง่ก ls -la...
-๏ผๆพ็คบ็ฎๅฝๅ
ๅฎน๏ผ
-็จๆท๏ผๅฎ่ฃ
lodash ๅ
-AI๏ผ็กฎ่ฎค่ฆๆง่ก npm install lodash ๅ๏ผ (y/n)
-```
+### Environment Variables
-## ๐ง ้
็ฝฎ
-
-### ็ฏๅขๅ้
-ๅๅปบ `.env` ๆไปถ๏ผๅ่ `.env.example`๏ผ๏ผ
+Create a `.env` file in the root directory:
```env
-# Anthropic API Key (ๅฟ
้)
+# Required
ANTHROPIC_API_KEY=sk-ant-xxxxx
-# ๅฏ้้
็ฝฎ
+# Optional
AI_MODEL=claude-sonnet-4-20250514
AI_MAX_TOKENS=4096
+SERVER_PORT=3000
+SERVER_HOST=localhost
```
-### ๆฏๆ็ AI ๆจกๅ
-- `claude-sonnet-4-20250514` (้ป่ฎค)
+### Supported Models
+
+- `claude-sonnet-4-20250514` (default)
- `claude-haiku-3-20251120`
-- ๅ
ถไป Claude ๆจกๅ
+- Other Claude models
-## ๐ ้กน็ฎ็ปๆ
+## ๐ค Contributing
-```
-ai-terminal-assistant/
-โโโ src/
-โ โโโ core/ # ๆ ธๅฟไปฃ็้ป่พ
-โ โโโ tools/ # ๅทฅๅ
ทๅฝๆฐ
-โ โ โโโ bash.ts # Bash ๅฝไปคๅทฅๅ
ท
-โ โ โโโ file.ts # ๆไปถๆไฝๅทฅๅ
ท
-โ โ โโโ index.ts # ๅทฅๅ
ทๅฏผๅบ
-โ โโโ ui/ # ็จๆท็้ข
-โ โโโ utils/ # ๅทฅๅ
ทๅฝๆฐ
-โ โโโ index.ts # ไธปๅ
ฅๅฃๆไปถ
-โโโ dist/ # ็ผ่ฏ่พๅบ
-โโโ package.json
-โโโ tsconfig.json
-โโโ README.md
-```
+We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
-## ๐ ๏ธ ๅผๅ
+1. Fork the repository
+2. Create your feature branch (`git checkout -b feature/amazing-feature`)
+3. Commit your changes (`git commit -m 'Add amazing feature'`)
+4. Push to the branch (`git push origin feature/amazing-feature`)
+5. Open a Pull Request
-### ๆๅปบ้กน็ฎ
-```bash
-npm run build
-```
+## ๐ License
-### ๅผๅๆจกๅผ
-```bash
-npm run dev
-```
+This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
-### ไปฃ็ ๆฃๆฅ
-```bash
-npm run lint
-```
+## ๐ Acknowledgments
-## โ ๏ธ ๅฎๅ
จๆณจๆไบ้กน
+- Built with [Claude API](https://docs.anthropic.com/claude/reference/getting-started-with-the-api) by Anthropic
+- Powered by [Bun](https://bun.sh) for fast JavaScript runtime
+- UI components from [Tailwind CSS](https://tailwindcss.com)
+- Desktop app built with [Tauri](https://tauri.app)
-1. **API Key ๅฎๅ
จ**๏ผไธ่ฆๅฐ `.env` ๆไปถๆไบคๅฐ็ๆฌๆงๅถ
-2. **ๅฝไปค็กฎ่ฎค**๏ผAI ๅจๆง่กไฟฎๆนๆไปถๆ่ฟ่ก็ณป็ปๅฝไปคๅไผ่ฏทๆฑ็กฎ่ฎค
-3. **ๆ้็ฎก็**๏ผ็กฎไฟ AI ๅฉๆๅชๆๅฟ
่ฆ็ๆไปถ่ฎฟ้ฎๆ้
+## ๐ Support
-## ๐ ่ฎธๅฏ่ฏ
-
-MIT License
-
-## ๐ค ่ดก็ฎ
-
-ๆฌข่ฟๆไบค Issue ๅ Pull Request๏ผ
-
-## ๐ ้ฎ้ขๅ้ฆ
-
-ๅฆๆๆจ้ๅฐไปปไฝ้ฎ้ข๏ผ่ฏท๏ผ
-1. ๆฃๆฅ API Key ๆฏๅฆๆญฃ็กฎ้
็ฝฎ
-2. ็กฎไฟๆ่ถณๅค็ API ้ขๅบฆ
-3. ๆฅ็็ป็ซฏ้่ฏฏไฟกๆฏ
-4. ๅจ GitHub ไธๆไบค Issue
-
-## ๐ ็ธๅ
ณๆๆฏ
-
-- [Claude API](https://docs.anthropic.com/claude/reference/getting-started-with-the-api)
-- [Node.js](https://nodejs.org/)
-- [TypeScript](https://www.typescriptlang.org/)
-- [Commander.js](https://github.com/tj/commander.js) - CLI ๆกๆถ
-- [Inquirer.js](https://github.com/SBoudrias/Inquirer.js) - ไบคไบๅผๅฝไปค่ก็้ข
+- ๐ง Email: support@example.com
+- ๐ฌ Discord: [Join our community](https://discord.gg/example)
+- ๐ Issues: [GitHub Issues](https://github.com/username/repo/issues)
---
-**ๆ็คบ**๏ผAI ๅฉๆไผๅฐฝๅๅธฎๅฉๆจ๏ผไฝ่ฏทๅง็ปๅฎกๆฅๅฎๅปบ่ฎฎ็ไปฃ็ ๆดๆนๅๅฝไปคๆง่ก๏ผ็นๅซๆฏๅจ็ไบง็ฏๅขไธญใ
\ No newline at end of file
+
+ Made with โค๏ธ by the AI Terminal Assistant Team
+
\ No newline at end of file
diff --git a/packages/cli/README.md b/packages/cli/README.md
new file mode 100644
index 0000000..6dfffa6
--- /dev/null
+++ b/packages/cli/README.md
@@ -0,0 +1,321 @@
+# @ai-assistant/cli
+
+Command-line interface for AI Terminal Assistant - interact with AI directly from your terminal.
+
+## ๐ฆ Installation
+
+```bash
+# Global installation
+pnpm add -g @ai-assistant/cli
+
+# Or run directly with npx/bunx
+npx @ai-assistant/cli
+bunx @ai-assistant/cli
+```
+
+## ๐ Features
+
+- **Dual Modes** - Server mode and client attach mode
+- **Interactive Chat** - Rich terminal UI with syntax highlighting
+- **Streaming Responses** - Real-time AI responses
+- **File Attachments** - Attach files to messages
+- **Command History** - Navigate through previous commands
+- **Auto-completion** - Tab completion for commands
+- **Colored Output** - Beautiful terminal formatting
+- **Session Management** - Persistent conversation history
+
+## ๐ Quick Start
+
+### Server Mode
+
+Start a local AI server:
+
+```bash
+# Start server on default port 3000
+ai-assist serve
+
+# Start on custom port
+ai-assist serve --port 8080
+
+# With specific model
+ai-assist serve --model claude-haiku-3-20251120
+
+# With verbose logging
+ai-assist serve --verbose
+```
+
+### Client Mode
+
+Attach to a running AI server:
+
+```bash
+# Attach to local server
+ai-assist attach
+
+# Attach to remote server
+ai-assist attach https://ai-server.example.com
+
+# Attach with authentication
+ai-assist attach https://ai-server.example.com --token YOUR_TOKEN
+
+# Attach to specific session
+ai-assist attach --session my-session-id
+```
+
+## ๐ Commands
+
+### Global Options
+
+```bash
+ai-assist [command] [options]
+
+Options:
+ -h, --help Show help
+ -v, --version Show version
+ --config Path to config file
+ --verbose Enable verbose logging
+```
+
+### Server Command
+
+```bash
+ai-assist serve [options]
+
+Options:
+ -p, --port Server port (default: 3000)
+ -h, --host Server host (default: localhost)
+ --api-key Anthropic API key (or use ANTHROPIC_API_KEY env)
+ --model AI model to use
+ --max-tokens Maximum response tokens
+ --no-auth Disable authentication
+ --cors-origin CORS allowed origins
+```
+
+### Attach Command
+
+```bash
+ai-assist attach [server-url] [options]
+
+Arguments:
+ server-url Server URL (default: http://localhost:3000)
+
+Options:
+ -s, --session Session ID to attach to
+ -t, --token Authentication token
+ --no-history Don't load session history
+ --stream Enable streaming mode
+```
+
+## โจ๏ธ Interactive Commands
+
+Once connected, use these commands in the chat interface:
+
+```
+/help Show available commands
+/clear Clear the screen
+/history Show message history
+/attach Attach a file to the next message
+/model Switch AI model
+/session new Start a new session
+/session list List available sessions
+/session switch Switch to another session
+/export Export conversation to file
+/quit Exit the CLI
+```
+
+## ๐จ Terminal UI Features
+
+### Message Display
+- **User messages** - Displayed with `>` prefix in cyan
+- **AI responses** - Formatted with syntax highlighting
+- **Code blocks** - Highlighted based on language
+- **Markdown** - Rendered with terminal formatting
+- **Progress indicators** - Animated spinners during processing
+
+### Keyboard Shortcuts
+- `โ/โ` - Navigate message history
+- `Tab` - Auto-complete commands
+- `Ctrl+C` - Cancel current operation
+- `Ctrl+D` - Exit (same as /quit)
+- `Ctrl+L` - Clear screen (same as /clear)
+- `PgUp/PgDn` - Scroll through long responses
+
+## ๐ง Configuration
+
+### Configuration File
+
+Create `~/.ai-assistant/config.json`:
+
+```json
+{
+ "defaultServer": "http://localhost:3000",
+ "apiKey": "sk-ant-xxxxx",
+ "model": "claude-sonnet-4-20250514",
+ "theme": "dark",
+ "editor": "vim",
+ "history": {
+ "enabled": true,
+ "maxSize": 1000
+ },
+ "display": {
+ "showTimestamps": true,
+ "syntax_highlighting": true,
+ "word_wrap": true,
+ "max_width": 120
+ }
+}
+```
+
+### Environment Variables
+
+```bash
+# API Configuration
+export ANTHROPIC_API_KEY=sk-ant-xxxxx
+export AI_MODEL=claude-sonnet-4-20250514
+
+# CLI Configuration
+export AI_CLI_SERVER=http://localhost:3000
+export AI_CLI_SESSION=my-session
+export AI_CLI_TOKEN=auth-token
+
+# Display Configuration
+export AI_CLI_COLOR=true
+export AI_CLI_EDITOR=vim
+```
+
+## ๐ Scripting and Automation
+
+### Pipe Input
+
+```bash
+# Send a single message
+echo "What is TypeScript?" | ai-assist attach
+
+# Process a file
+cat code.ts | ai-assist attach --message "Review this code"
+
+# Chain with other commands
+git diff | ai-assist attach --message "Explain these changes"
+```
+
+### Script Mode
+
+```bash
+#!/bin/bash
+
+# Create a script for batch processing
+ai-assist attach < debug.log
+```
+
+### Common Issues
+
+1. **"Cannot connect to server"**
+ - Check if server is running
+ - Verify server URL and port
+ - Check firewall settings
+
+2. **"Authentication failed"**
+ - Verify API key is set
+ - Check token expiration
+ - Ensure server auth is configured
+
+3. **"Session not found"**
+ - Session may have expired
+ - Use `/session list` to see available sessions
+ - Create new session with `/session new`
+
+## ๐ค Contributing
+
+Contributions are welcome! See the main repository's contributing guide.
+
+## ๐ License
+
+MIT License - see [LICENSE](../../LICENSE) for details.
+
+## ๐ Links
+
+- [Main Repository](https://github.com/username/ai-terminal-assistant)
+- [Documentation](https://docs.example.com/cli)
+- [Issue Tracker](https://github.com/username/ai-terminal-assistant/issues)
\ No newline at end of file
diff --git a/packages/core/README.md b/packages/core/README.md
new file mode 100644
index 0000000..3604465
--- /dev/null
+++ b/packages/core/README.md
@@ -0,0 +1,245 @@
+# @ai-assistant/core
+
+Core engine package for AI Terminal Assistant - provides the AI agent, tools, and integrations.
+
+## ๐ฆ Installation
+
+```bash
+pnpm add @ai-assistant/core
+```
+
+## ๐ Features
+
+- **AI Agent Engine** - Streaming text generation with Claude API
+- **Tool System** - Extensible tool registry with Zod validation
+- **Editor Modes** - Multiple editing strategies (whole, diff, search-replace)
+- **Language Server Protocol** - Code intelligence and analysis
+- **Checkpoint System** - Shadow Git for safe experimentation
+- **Hook System** - Pre/post execution customization
+- **Model Context Protocol** - MCP client for external tools
+- **Repository Mapping** - Tree-sitter based code analysis
+
+## ๐๏ธ Architecture
+
+```
+src/
+โโโ core/
+โ โโโ agent.ts # Main Agent class with streaming
+โ โโโ config.ts # Configuration management
+โ โโโ types.ts # Core type definitions
+โโโ tools/
+โ โโโ registry.ts # Tool registration system
+โ โโโ bash.ts # Bash command execution
+โ โโโ file.ts # File operations
+โ โโโ search.ts # Code search utilities
+โ โโโ index.ts # Tool exports
+โโโ editors/
+โ โโโ base.ts # Base editor interface
+โ โโโ whole.ts # Whole file replacement
+โ โโโ diff.ts # Diff-based editing
+โ โโโ search-replace.ts # Search and replace
+โโโ lsp/
+โ โโโ client.ts # LSP client implementation
+โ โโโ server.ts # LSP server management
+โโโ checkpoint/
+โ โโโ manager.ts # Checkpoint management
+โ โโโ git.ts # Shadow Git operations
+โโโ hooks/
+โ โโโ manager.ts # Hook execution system
+โ โโโ types.ts # Hook type definitions
+โโโ mcp/
+โ โโโ client.ts # MCP client implementation
+โ โโโ protocol.ts # Protocol definitions
+โโโ repomap/
+ โโโ generator.ts # Repository map generation
+ โโโ parser.ts # Tree-sitter parsing
+```
+
+## ๐ Quick Start
+
+### Basic Usage
+
+```typescript
+import { Agent, toolRegistry } from '@ai-assistant/core';
+
+// Create an agent instance
+const agent = new Agent({
+ apiKey: process.env.ANTHROPIC_API_KEY,
+ model: 'claude-sonnet-4-20250514',
+ maxTokens: 4096
+});
+
+// Chat with the agent
+const response = await agent.chat('Help me write a TypeScript function', {
+ onChunk: (chunk) => console.log(chunk),
+ onComplete: (response) => console.log('Done:', response)
+});
+```
+
+### Tool Registration
+
+```typescript
+import { toolRegistry } from '@ai-assistant/core/tools';
+import { z } from 'zod';
+
+// Register a custom tool
+toolRegistry.register({
+ name: 'my_tool',
+ description: 'Does something useful',
+ parameters: z.object({
+ input: z.string().describe('Input parameter')
+ }),
+ execute: async (params) => {
+ // Tool implementation
+ return { success: true, result: params.input.toUpperCase() };
+ }
+});
+```
+
+### Editor Modes
+
+```typescript
+import { createEditor } from '@ai-assistant/core/editors';
+
+// Whole file replacement
+const wholeEditor = createEditor('whole');
+await wholeEditor.edit('file.ts', 'new content');
+
+// Diff-based editing
+const diffEditor = createEditor('diff');
+await diffEditor.edit('file.ts', '--- old\n+++ new\n...');
+
+// Search and replace
+const searchEditor = createEditor('search-replace');
+await searchEditor.edit('file.ts', {
+ search: 'oldFunction',
+ replace: 'newFunction'
+});
+```
+
+### Checkpoint System
+
+```typescript
+import { CheckpointManager } from '@ai-assistant/core/checkpoint';
+
+const manager = new CheckpointManager('/project/path');
+
+// Create a checkpoint
+await manager.create('before-refactoring');
+
+// Make changes...
+
+// Restore if needed
+await manager.restore('before-refactoring');
+
+// List checkpoints
+const checkpoints = await manager.list();
+```
+
+### Language Server Protocol
+
+```typescript
+import { LSPClient } from '@ai-assistant/core/lsp';
+
+const lsp = new LSPClient({
+ serverCommand: 'typescript-language-server',
+ serverArgs: ['--stdio']
+});
+
+await lsp.initialize('/project/path');
+
+// Get diagnostics
+const diagnostics = await lsp.getDiagnostics('file.ts');
+
+// Get completions
+const completions = await lsp.getCompletions('file.ts', { line: 10, character: 5 });
+
+// Go to definition
+const definition = await lsp.getDefinition('file.ts', { line: 10, character: 5 });
+```
+
+## ๐ง Configuration
+
+```typescript
+interface AgentConfig {
+ apiKey: string; // Anthropic API key
+ model?: string; // Model name (default: claude-sonnet-4-20250514)
+ maxTokens?: number; // Max response tokens (default: 4096)
+ temperature?: number; // Sampling temperature (default: 0.7)
+ systemPrompt?: string; // System prompt
+ tools?: Tool[]; // Available tools
+ hooks?: HookConfig; // Hook configuration
+ checkpointDir?: string; // Checkpoint directory
+}
+```
+
+## ๐ API Reference
+
+### Agent
+
+```typescript
+class Agent {
+ constructor(config: AgentConfig);
+
+ chat(message: string, options?: ChatOptions): Promise;
+ streamChat(message: string, options?: StreamOptions): AsyncIterator;
+ reset(): void;
+ getHistory(): Message[];
+}
+```
+
+### Tool Registry
+
+```typescript
+class ToolRegistry {
+ register(tool: ToolDefinition): void;
+ unregister(name: string): void;
+ get(name: string): Tool | undefined;
+ list(): Tool[];
+ execute(name: string, params: any): Promise;
+}
+```
+
+### Editor Interface
+
+```typescript
+interface Editor {
+ edit(path: string, content: string | EditParams): Promise;
+ validate(content: string): boolean;
+ preview(path: string, content: string): string;
+}
+```
+
+## ๐งช Testing
+
+```bash
+# Run tests
+pnpm test
+
+# Run with coverage
+pnpm test:coverage
+
+# Watch mode
+pnpm test:watch
+```
+
+## ๐ค Contributing
+
+Contributions are welcome! Please follow these steps:
+
+1. Fork the repository
+2. Create a feature branch
+3. Make your changes
+4. Add tests for new functionality
+5. Ensure all tests pass
+6. Submit a pull request
+
+## ๐ License
+
+MIT License - see [LICENSE](../../LICENSE) for details.
+
+## ๐ Links
+
+- [Main Repository](https://github.com/username/ai-terminal-assistant)
+- [API Documentation](https://docs.example.com/core)
+- [Issue Tracker](https://github.com/username/ai-terminal-assistant/issues)
\ No newline at end of file
diff --git a/packages/desktop/README.md b/packages/desktop/README.md
new file mode 100644
index 0000000..20667db
--- /dev/null
+++ b/packages/desktop/README.md
@@ -0,0 +1,436 @@
+# @ai-assistant/desktop
+
+Native desktop application for AI Terminal Assistant - built with Tauri for cross-platform support.
+
+## ๐ฆ Installation
+
+```bash
+# Install dependencies
+pnpm install
+
+# Development
+pnpm dev
+
+# Build for current platform
+pnpm build
+
+# Build for all platforms
+pnpm build:all
+```
+
+## ๐ Features
+
+- **Native Performance** - Built with Rust and Tauri for speed
+- **Cross-Platform** - Windows, macOS, and Linux support
+- **Small Bundle Size** - ~10MB installer, ~30MB installed
+- **System Integration** - Native menus, notifications, and tray
+- **Secure by Default** - Sandboxed with minimal permissions
+- **Auto Updates** - Built-in update mechanism
+- **Local Storage** - SQLite for offline data
+- **WebView Based** - Modern web UI with native wrapper
+- **Global Shortcuts** - System-wide keyboard shortcuts
+- **File System Access** - Native file dialogs and operations
+
+## ๐๏ธ Architecture
+
+```
+src-tauri/
+โโโ src/
+โ โโโ main.rs # Main entry point
+โ โโโ app.rs # Application setup
+โ โโโ commands/ # Tauri commands
+โ โ โโโ chat.rs # Chat operations
+โ โ โโโ file.rs # File operations
+โ โ โโโ system.rs # System integration
+โ โ โโโ window.rs # Window management
+โ โโโ menu.rs # Native menu setup
+โ โโโ tray.rs # System tray
+โ โโโ updater.rs # Auto-updater logic
+โ โโโ store.rs # Local data storage
+โ โโโ utils/ # Utility functions
+โโโ Cargo.toml # Rust dependencies
+โโโ tauri.conf.json # Tauri configuration
+โโโ icons/ # App icons
+
+src/
+โโโ App.tsx # React app entry
+โโโ components/ # UI components (shared with web)
+โโโ hooks/ # Custom hooks
+โโโ services/ # Desktop-specific services
+โ โโโ ipc.ts # Tauri IPC communication
+โ โโโ storage.ts # Local storage
+โ โโโ shortcuts.ts # Keyboard shortcuts
+โโโ styles/ # Desktop-specific styles
+```
+
+## ๐ Quick Start
+
+### Prerequisites
+
+- **Node.js** 18+ and pnpm
+- **Rust** 1.70+ (install from [rustup.rs](https://rustup.rs))
+- **Platform Tools**:
+ - **Windows**: Visual Studio C++ Build Tools
+ - **macOS**: Xcode Command Line Tools
+ - **Linux**: `build-essential`, `libwebkit2gtk-4.0-dev`, `libssl-dev`
+
+### Development Setup
+
+```bash
+# Clone repository
+git clone
+cd ai-terminal-assistant/packages/desktop
+
+# Install dependencies
+pnpm install
+
+# Start development server
+pnpm dev
+
+# App will open automatically with hot reload enabled
+```
+
+### Building for Production
+
+```bash
+# Build for current platform
+pnpm build
+
+# Build for specific platform
+pnpm build:windows
+pnpm build:mac
+pnpm build:linux
+
+# Build universal binary for macOS
+pnpm build:mac-universal
+
+# Build and sign (requires certificates)
+pnpm build:signed
+```
+
+## ๐ฅ๏ธ Platform Features
+
+### Windows
+- **Installer Types**: MSI, NSIS, Portable
+- **Auto-start** on system boot
+- **Windows Store** distribution ready
+- **Native notifications**
+- **Jump list** integration
+
+### macOS
+- **Formats**: DMG, App Bundle
+- **Code signing** and notarization
+- **macOS App Store** ready
+- **Touch Bar** support
+- **Native menu bar**
+
+### Linux
+- **Packages**: AppImage, Deb, RPM
+- **System tray** support
+- **Desktop entry** creation
+- **Snap/Flatpak** ready
+- **Wayland/X11** compatible
+
+## โ๏ธ Configuration
+
+### Tauri Configuration
+
+`src-tauri/tauri.conf.json`:
+
+```json
+{
+ "package": {
+ "productName": "AI Terminal Assistant",
+ "version": "1.0.0"
+ },
+ "tauri": {
+ "allowlist": {
+ "all": false,
+ "shell": {
+ "execute": true,
+ "open": true
+ },
+ "fs": {
+ "all": true,
+ "scope": ["$HOME/**", "$RESOURCE/**"]
+ },
+ "http": {
+ "all": true,
+ "scope": ["http://localhost/*", "https://api.anthropic.com/*"]
+ },
+ "notification": {
+ "all": true
+ },
+ "globalShortcut": {
+ "all": true
+ }
+ },
+ "windows": [{
+ "title": "AI Terminal Assistant",
+ "width": 1200,
+ "height": 800,
+ "resizable": true,
+ "fullscreen": false
+ }],
+ "systemTray": {
+ "iconPath": "icons/icon.png",
+ "menuOnLeftClick": false
+ },
+ "updater": {
+ "active": true,
+ "endpoints": ["https://updates.example.com/check"]
+ }
+ }
+}
+```
+
+## ๐ Tauri Commands
+
+### IPC Communication
+
+```typescript
+// Frontend (TypeScript)
+import { invoke } from '@tauri-apps/api/tauri';
+
+// Call Rust command
+const result = await invoke('send_message', {
+ message: 'Hello from frontend'
+});
+
+// Listen to events
+import { listen } from '@tauri-apps/api/event';
+
+const unlisten = await listen('chat-update', (event) => {
+ console.log('New message:', event.payload);
+});
+```
+
+```rust
+// Backend (Rust)
+#[tauri::command]
+fn send_message(message: String) -> Result {
+ // Process message
+ Ok(format!("Received: {}", message))
+}
+
+// Emit events
+app.emit_all("chat-update", Payload {
+ message: "New update"
+}).unwrap();
+```
+
+## ๐จ Native Features
+
+### System Tray
+
+```typescript
+import { createTray } from './services/tray';
+
+const tray = await createTray({
+ icon: '/icons/tray.png',
+ menu: [
+ { label: 'Show', action: () => showWindow() },
+ { label: 'Hide', action: () => hideWindow() },
+ { separator: true },
+ { label: 'Quit', action: () => app.quit() }
+ ]
+});
+```
+
+### Global Shortcuts
+
+```typescript
+import { register } from '@tauri-apps/api/globalShortcut';
+
+// Register global hotkey
+await register('CommandOrControl+Shift+A', () => {
+ console.log('Shortcut triggered!');
+ window.show();
+});
+```
+
+### File Operations
+
+```typescript
+import { open, save } from '@tauri-apps/api/dialog';
+import { readTextFile, writeFile } from '@tauri-apps/api/fs';
+
+// Open file dialog
+const selected = await open({
+ multiple: false,
+ filters: [{
+ name: 'Text',
+ extensions: ['txt', 'md']
+ }]
+});
+
+// Read file
+const content = await readTextFile(selected);
+
+// Save file dialog
+const savePath = await save({
+ filters: [{ name: 'Text', extensions: ['txt'] }]
+});
+
+await writeFile(savePath, 'content');
+```
+
+### Notifications
+
+```typescript
+import { sendNotification } from '@tauri-apps/api/notification';
+
+await sendNotification({
+ title: 'AI Assistant',
+ body: 'Task completed successfully!',
+ icon: '/icons/icon.png'
+});
+```
+
+## ๐ Security
+
+### Permissions
+- Minimal permission model
+- Scoped file system access
+- Controlled shell execution
+- CSP headers enforced
+
+### Code Signing
+```bash
+# macOS
+codesign --deep --force --verify --verbose \
+ --sign "Developer ID Application: Your Name" \
+ target/release/bundle/osx/AI\ Terminal\ Assistant.app
+
+# Windows (using SignTool)
+signtool sign /a /tr http://timestamp.digicert.com \
+ /td SHA256 /fd SHA256 \
+ target/release/bundle/msi/AI_Terminal_Assistant.msi
+```
+
+## ๐ข Distribution
+
+### Auto Updates
+
+```rust
+// src-tauri/src/updater.rs
+use tauri::updater::builder::UpdateBuilder;
+
+pub fn check_for_updates(app: &tauri::App) {
+ let update = UpdateBuilder::new()
+ .current_version(&app.package_info().version)
+ .url("https://updates.example.com/check")
+ .build()
+ .unwrap();
+
+ if update.should_update {
+ update.download_and_install().unwrap();
+ }
+}
+```
+
+### GitHub Releases
+
+```yaml
+# .github/workflows/release.yml
+name: Release
+on:
+ push:
+ tags: ['v*']
+
+jobs:
+ release:
+ strategy:
+ matrix:
+ platform: [macos-latest, ubuntu-latest, windows-latest]
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - uses: actions/checkout@v3
+ - uses: tauri-apps/tauri-action@v0
+ with:
+ tagName: v__VERSION__
+ releaseName: 'v__VERSION__'
+ releaseBody: 'See CHANGELOG.md'
+ releaseDraft: true
+ prerelease: false
+```
+
+## ๐งช Testing
+
+```bash
+# Unit tests (Rust)
+cd src-tauri
+cargo test
+
+# Integration tests
+pnpm test:integration
+
+# E2E tests with WebDriver
+pnpm test:e2e
+```
+
+## ๐ Performance
+
+### Optimization Tips
+
+1. **Lazy Loading** - Load features on demand
+2. **IPC Batching** - Batch multiple commands
+3. **Asset Optimization** - Compress images/fonts
+4. **Memory Management** - Clean up listeners
+5. **Background Tasks** - Use Web Workers
+
+### Benchmarks
+
+| Metric | Value |
+|--------|-------|
+| Startup Time | < 500ms |
+| Memory Usage | ~50MB idle |
+| Bundle Size | ~10MB compressed |
+| CPU Usage | < 5% idle |
+
+## ๐ Debugging
+
+### Development Tools
+
+```bash
+# Enable dev tools
+pnpm dev -- --features devtools
+
+# Rust debugging
+RUST_LOG=debug pnpm dev
+
+# WebView debugging
+# Press F12 in the app window
+```
+
+### Logging
+
+```rust
+// Rust logging
+use log::{info, error};
+
+info!("Application started");
+error!("Failed to load: {}", error);
+```
+
+```typescript
+// Frontend logging
+import { info, error } from '@tauri-apps/api/log';
+
+await info('Application started');
+await error(`Failed to load: ${error}`);
+```
+
+## ๐ค Contributing
+
+See the main repository's contributing guide for details.
+
+## ๐ License
+
+MIT License - see [LICENSE](../../LICENSE) for details.
+
+## ๐ Links
+
+- [Main Repository](https://github.com/username/ai-terminal-assistant)
+- [Tauri Documentation](https://tauri.app/v1/guides/)
+- [Release Downloads](https://github.com/username/ai-terminal-assistant/releases)
\ No newline at end of file
diff --git a/packages/server/README.md b/packages/server/README.md
new file mode 100644
index 0000000..ad7b5a6
--- /dev/null
+++ b/packages/server/README.md
@@ -0,0 +1,354 @@
+# @ai-assistant/server
+
+HTTP/WebSocket server for AI Terminal Assistant - provides REST API, WebSocket, and SSE endpoints.
+
+## ๐ฆ Installation
+
+```bash
+pnpm add @ai-assistant/server
+```
+
+## ๐ Features
+
+- **REST API** - Full CRUD operations for sessions and tools
+- **WebSocket** - Real-time bidirectional communication
+- **Server-Sent Events** - Streaming status updates
+- **Authentication** - Token-based auth for non-localhost
+- **Session Management** - Persistent session handling
+- **CORS Support** - Configurable cross-origin access
+- **Built with Hono** - Lightweight, fast web framework
+- **Bun Runtime** - Native WebSocket and performance
+
+## ๐๏ธ Architecture
+
+```
+src/
+โโโ index.ts # Main server setup with Hono
+โโโ routes/
+โ โโโ sessions.ts # Session management endpoints
+โ โโโ tools.ts # Tool execution endpoints
+โ โโโ config.ts # Configuration endpoints
+โ โโโ health.ts # Health check endpoint
+โโโ ws.ts # WebSocket handler
+โโโ sse.ts # Server-Sent Events handler
+โโโ agent/
+โ โโโ adapter.ts # Core agent adapter
+โ โโโ session.ts # Session management
+โโโ auth/
+โ โโโ token.ts # Token generation/validation
+โ โโโ middleware.ts # Auth middleware
+โโโ middleware/
+โ โโโ cors.ts # CORS configuration
+โ โโโ error.ts # Error handling
+โ โโโ logging.ts # Request logging
+โโโ types/
+ โโโ index.ts # TypeScript definitions
+```
+
+## ๐ Quick Start
+
+### Basic Server Setup
+
+```typescript
+import { createServer } from '@ai-assistant/server';
+
+const server = createServer({
+ port: 3000,
+ host: 'localhost',
+ apiKey: process.env.ANTHROPIC_API_KEY
+});
+
+await server.start();
+console.log('Server running on http://localhost:3000');
+```
+
+### Standalone Usage
+
+```bash
+# Development mode with hot reload
+pnpm start:dev
+
+# Production mode
+pnpm start
+
+# With custom configuration
+ANTHROPIC_API_KEY=sk-ant-xxx SERVER_PORT=8080 pnpm start
+```
+
+## ๐ก API Endpoints
+
+### REST API
+
+#### Sessions
+```typescript
+// Create session
+POST /api/sessions
+Response: { id: string, status: 'idle' | 'busy', createdAt: string }
+
+// Get session
+GET /api/sessions/:id
+Response: { id: string, status: string, messages: Message[] }
+
+// List sessions
+GET /api/sessions
+Response: Session[]
+
+// Delete session
+DELETE /api/sessions/:id
+Response: { success: boolean }
+```
+
+#### Tools
+```typescript
+// List available tools
+GET /api/tools
+Response: Tool[]
+
+// Execute tool
+POST /api/tools/:name/execute
+Body: { params: any, sessionId?: string }
+Response: { result: any }
+```
+
+#### Configuration
+```typescript
+// Get configuration
+GET /api/config
+Response: { model: string, maxTokens: number, ... }
+
+// Update configuration
+PUT /api/config
+Body: { model?: string, maxTokens?: number, ... }
+Response: { success: boolean, config: Config }
+```
+
+### WebSocket Protocol
+
+```typescript
+// Connect
+ws://localhost:3000/api/ws/:sessionId
+
+// Client โ Server Messages
+{
+ type: 'message',
+ payload: {
+ content: string,
+ attachments?: Attachment[]
+ }
+}
+
+// Server โ Client Messages
+{
+ type: 'chunk' | 'done' | 'error' | 'status',
+ payload: {
+ content?: string, // For chunk
+ response?: Message, // For done
+ error?: string, // For error
+ status?: string // For status
+ }
+}
+```
+
+### Server-Sent Events
+
+```typescript
+// Connect for status updates
+GET /api/sse/:sessionId
+Accept: text/event-stream
+
+// Event format
+event: status
+data: { "status": "processing", "progress": 0.5 }
+
+event: complete
+data: { "result": "Task completed" }
+```
+
+## ๐ง Configuration
+
+### Environment Variables
+
+```env
+# Required
+ANTHROPIC_API_KEY=sk-ant-xxxxx
+
+# Optional
+SERVER_PORT=3000
+SERVER_HOST=localhost
+SERVER_CORS_ORIGIN=http://localhost:5173
+SERVER_AUTH_ENABLED=auto
+SERVER_LOG_LEVEL=info
+AI_MODEL=claude-sonnet-4-20250514
+AI_MAX_TOKENS=4096
+```
+
+### Programmatic Configuration
+
+```typescript
+interface ServerConfig {
+ port?: number; // Server port (default: 3000)
+ host?: string; // Server host (default: localhost)
+ apiKey: string; // Anthropic API key
+ cors?: {
+ origin: string | string[];
+ credentials?: boolean;
+ };
+ auth?: {
+ enabled: boolean | 'auto'; // Auto enables for non-localhost
+ tokenSecret?: string;
+ };
+ agent?: {
+ model?: string;
+ maxTokens?: number;
+ temperature?: number;
+ };
+ logging?: {
+ level: 'debug' | 'info' | 'warn' | 'error';
+ };
+}
+```
+
+## ๐ Authentication
+
+The server automatically enables token authentication when accessed from non-localhost addresses:
+
+```typescript
+// Generate token
+POST /api/auth/token
+Body: { password?: string }
+Response: { token: string, expiresIn: number }
+
+// Use token in requests
+Authorization: Bearer
+
+// Or in WebSocket
+ws://server/api/ws/:sessionId?token=
+```
+
+## ๐งช Testing
+
+```bash
+# Run tests
+pnpm test
+
+# Run with coverage
+pnpm test:coverage
+
+# E2E tests
+pnpm test:e2e
+```
+
+### Test Examples
+
+```typescript
+import { testClient } from '@ai-assistant/server/test';
+
+describe('Server API', () => {
+ const client = testClient({ port: 3001 });
+
+ beforeAll(() => client.start());
+ afterAll(() => client.stop());
+
+ test('create session', async () => {
+ const session = await client.post('/api/sessions');
+ expect(session.id).toBeDefined();
+ expect(session.status).toBe('idle');
+ });
+
+ test('websocket chat', async () => {
+ const ws = client.ws('/api/ws/test-session');
+
+ ws.send({ type: 'message', payload: { content: 'Hello' } });
+
+ const response = await ws.waitFor('done');
+ expect(response.payload.response).toBeDefined();
+ });
+});
+```
+
+## ๐ Integration Examples
+
+### With Express
+
+```typescript
+import express from 'express';
+import { createMiddleware } from '@ai-assistant/server';
+
+const app = express();
+app.use('/ai', createMiddleware({
+ apiKey: process.env.ANTHROPIC_API_KEY
+}));
+
+app.listen(3000);
+```
+
+### With Next.js
+
+```typescript
+// app/api/ai/[...path]/route.ts
+import { handleRequest } from '@ai-assistant/server/next';
+
+export const { GET, POST, PUT, DELETE } = handleRequest({
+ apiKey: process.env.ANTHROPIC_API_KEY
+});
+```
+
+## ๐ Monitoring
+
+### Health Check
+
+```bash
+curl http://localhost:3000/api/health
+# Response: { status: 'healthy', uptime: 123456, sessions: 5 }
+```
+
+### Metrics Endpoint
+
+```bash
+curl http://localhost:3000/api/metrics
+# Response: Prometheus-formatted metrics
+```
+
+## ๐ Deployment
+
+### Docker
+
+```dockerfile
+FROM oven/bun:1.0
+WORKDIR /app
+COPY package*.json ./
+RUN bun install
+COPY . .
+EXPOSE 3000
+CMD ["bun", "run", "start"]
+```
+
+### PM2
+
+```json
+{
+ "apps": [{
+ "name": "ai-server",
+ "script": "bun",
+ "args": "run start",
+ "env": {
+ "SERVER_PORT": 3000,
+ "ANTHROPIC_API_KEY": "sk-ant-xxx"
+ }
+ }]
+}
+```
+
+## ๐ค Contributing
+
+Contributions are welcome! Please follow the contribution guidelines in the main repository.
+
+## ๐ License
+
+MIT License - see [LICENSE](../../LICENSE) for details.
+
+## ๐ Links
+
+- [Main Repository](https://github.com/username/ai-terminal-assistant)
+- [API Documentation](https://docs.example.com/server)
+- [OpenAPI Spec](https://api.example.com/openapi.json)
\ No newline at end of file
diff --git a/packages/web/README.md b/packages/web/README.md
new file mode 100644
index 0000000..a66635c
--- /dev/null
+++ b/packages/web/README.md
@@ -0,0 +1,366 @@
+# @ai-assistant/web
+
+Modern web interface for AI Terminal Assistant - built with React, Vite, and Tailwind CSS.
+
+## ๐ฆ Installation
+
+```bash
+# Install dependencies
+pnpm install
+
+# Start development server
+pnpm dev
+
+# Build for production
+pnpm build
+```
+
+## ๐ Features
+
+- **Modern UI** - Clean, responsive interface with dark/light themes
+- **Real-time Chat** - WebSocket-based instant messaging
+- **Code Editor** - Syntax highlighting with Monaco Editor
+- **File Browser** - Browse and edit project files
+- **Terminal Integration** - Embedded terminal for command execution
+- **Markdown Rendering** - Rich text formatting for AI responses
+- **PWA Support** - Install as desktop/mobile app
+- **Mobile Responsive** - Optimized for all screen sizes
+- **Keyboard Shortcuts** - Efficient navigation and actions
+
+## ๐๏ธ Architecture
+
+```
+src/
+โโโ components/
+โ โโโ Chat/ # Chat interface components
+โ โ โโโ ChatWindow.tsx
+โ โ โโโ MessageList.tsx
+โ โ โโโ MessageInput.tsx
+โ โ โโโ CodeBlock.tsx
+โ โโโ Editor/ # Code editor components
+โ โ โโโ MonacoEditor.tsx
+โ โ โโโ EditorToolbar.tsx
+โ โโโ FileBrowser/ # File navigation
+โ โ โโโ FileTree.tsx
+โ โ โโโ FilePreview.tsx
+โ โโโ Terminal/ # Terminal emulator
+โ โ โโโ XTerminal.tsx
+โ โโโ Layout/ # Layout components
+โ โ โโโ Sidebar.tsx
+โ โ โโโ Header.tsx
+โ โ โโโ Tabs.tsx
+โ โโโ Common/ # Shared components
+โ โโโ Button.tsx
+โ โโโ Modal.tsx
+โ โโโ Loading.tsx
+โโโ hooks/ # Custom React hooks
+โ โโโ useChat.ts
+โ โโโ useWebSocket.ts
+โ โโโ useTheme.ts
+โ โโโ useKeyboard.ts
+โโโ services/ # API and service layer
+โ โโโ api.ts
+โ โโโ websocket.ts
+โ โโโ storage.ts
+โโโ store/ # State management
+โ โโโ chat.store.ts
+โ โโโ editor.store.ts
+โ โโโ settings.store.ts
+โโโ styles/ # Global styles
+โ โโโ index.css
+โโโ types/ # TypeScript definitions
+โโโ utils/ # Utility functions
+โโโ App.tsx # Main app component
+โโโ main.tsx # Entry point
+```
+
+## ๐ Quick Start
+
+### Development
+
+```bash
+# Start development server
+pnpm dev
+
+# The app will be available at http://localhost:5173
+# Hot module replacement is enabled for instant updates
+```
+
+### Production Build
+
+```bash
+# Create optimized build
+pnpm build
+
+# Preview production build
+pnpm preview
+
+# Build output in dist/ directory
+```
+
+## ๐จ User Interface
+
+### Main Features
+
+#### Chat Interface
+- **Message History** - Scrollable chat with persistent history
+- **Code Highlighting** - Syntax highlighting for code blocks
+- **File Attachments** - Drag & drop file support
+- **Message Actions** - Copy, edit, regenerate responses
+- **Streaming Responses** - Real-time AI response streaming
+
+#### Code Editor
+- **Monaco Editor** - VS Code's editor engine
+- **Multi-file Tabs** - Work with multiple files
+- **Syntax Highlighting** - 100+ language support
+- **IntelliSense** - Code completion and hints
+- **Diff View** - Side-by-side code comparison
+
+#### File Browser
+- **Tree View** - Hierarchical file structure
+- **Quick Actions** - Create, rename, delete files
+- **Search** - Fast file search with fuzzy matching
+- **Preview** - Quick file preview without opening
+- **Context Menu** - Right-click actions
+
+#### Terminal
+- **XTerm.js** - Full terminal emulation
+- **Command History** - Navigate previous commands
+- **Copy/Paste** - Standard clipboard operations
+- **Themes** - Multiple color schemes
+
+## ๐ฏ Component Examples
+
+### Using the Chat Component
+
+```tsx
+import { Chat } from '@ai-assistant/web/components';
+
+function App() {
+ return (
+ console.log('New message:', message)}
+ theme="dark"
+ />
+ );
+}
+```
+
+### Custom Hook Usage
+
+```tsx
+import { useChat } from '@ai-assistant/web/hooks';
+
+function MyComponent() {
+ const { messages, sendMessage, isLoading } = useChat({
+ serverUrl: 'http://localhost:3000',
+ sessionId: 'my-session'
+ });
+
+ return (
+
+ {messages.map(msg => (
+
{msg.content}
+ ))}
+
+
+ );
+}
+```
+
+## โ๏ธ Configuration
+
+### Environment Variables
+
+Create `.env` file:
+
+```env
+# API Configuration
+VITE_API_URL=http://localhost:3000
+VITE_WS_URL=ws://localhost:3000
+VITE_AUTH_TOKEN=your-token-here
+
+# Feature Flags
+VITE_ENABLE_TERMINAL=true
+VITE_ENABLE_FILE_BROWSER=true
+VITE_ENABLE_CODE_EDITOR=true
+
+# Theme
+VITE_DEFAULT_THEME=dark
+```
+
+### Build Configuration
+
+`vite.config.ts`:
+
+```typescript
+export default defineConfig({
+ plugins: [react()],
+ server: {
+ port: 5173,
+ proxy: {
+ '/api': 'http://localhost:3000'
+ }
+ },
+ build: {
+ outDir: 'dist',
+ sourcemap: true,
+ minify: 'esbuild'
+ }
+});
+```
+
+## ๐น Keyboard Shortcuts
+
+| Shortcut | Action |
+|----------|--------|
+| `Ctrl/Cmd + Enter` | Send message |
+| `Ctrl/Cmd + K` | Clear chat |
+| `Ctrl/Cmd + /` | Toggle sidebar |
+| `Ctrl/Cmd + ,` | Open settings |
+| `Ctrl/Cmd + Shift + P` | Command palette |
+| `Ctrl/Cmd + B` | Toggle file browser |
+| `Ctrl/Cmd + J` | Toggle terminal |
+| `Esc` | Close modal/popup |
+
+## ๐ฑ Progressive Web App
+
+The app can be installed as a PWA:
+
+1. Open in Chrome/Edge
+2. Click install icon in address bar
+3. Or use browser menu: "Install App"
+
+Features:
+- Offline support with service worker
+- Desktop/mobile app experience
+- Push notifications (coming soon)
+- Background sync
+
+## ๐งช Testing
+
+```bash
+# Run unit tests
+pnpm test
+
+# Run with coverage
+pnpm test:coverage
+
+# Run E2E tests
+pnpm test:e2e
+
+# Component testing
+pnpm test:components
+```
+
+### Testing Examples
+
+```tsx
+import { render, screen } from '@testing-library/react';
+import { Chat } from './Chat';
+
+test('renders chat interface', () => {
+ render();
+ expect(screen.getByPlaceholderText('Type a message...')).toBeInTheDocument();
+});
+```
+
+## ๐จ Theming
+
+### Custom Theme
+
+```css
+/* src/styles/themes/custom.css */
+:root[data-theme="custom"] {
+ --primary: #6366f1;
+ --background: #0f172a;
+ --foreground: #f8fafc;
+ --border: #334155;
+ --accent: #8b5cf6;
+}
+```
+
+### Apply Theme
+
+```tsx
+import { useTheme } from '@ai-assistant/web/hooks';
+
+function ThemeToggle() {
+ const { theme, setTheme } = useTheme();
+
+ return (
+
+ );
+}
+```
+
+## ๐ Performance
+
+### Optimization Tips
+
+1. **Code Splitting** - Routes are lazy loaded
+2. **Image Optimization** - WebP with fallbacks
+3. **Bundle Size** - Tree shaking enabled
+4. **Caching** - Service worker caching
+5. **Virtual Scrolling** - For long lists
+
+### Bundle Analysis
+
+```bash
+# Analyze bundle size
+pnpm build:analyze
+
+# Opens visualization in browser
+```
+
+## ๐ Deployment
+
+### Vercel
+
+```bash
+# Deploy to Vercel
+vercel deploy --prod
+```
+
+### Docker
+
+```dockerfile
+FROM node:20-alpine AS builder
+WORKDIR /app
+COPY package*.json ./
+RUN npm ci
+COPY . .
+RUN npm run build
+
+FROM nginx:alpine
+COPY --from=builder /app/dist /usr/share/nginx/html
+EXPOSE 80
+```
+
+### Static Hosting
+
+Build output in `dist/` can be served by any static host:
+- Netlify
+- GitHub Pages
+- CloudFlare Pages
+- AWS S3 + CloudFront
+
+## ๐ค Contributing
+
+See the main repository's contributing guide for details.
+
+## ๐ License
+
+MIT License - see [LICENSE](../../LICENSE) for details.
+
+## ๐ Links
+
+- [Main Repository](https://github.com/username/ai-terminal-assistant)
+- [Component Storybook](https://storybook.example.com)
+- [Design System](https://design.example.com)
\ No newline at end of file