agentstudio 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +481 -37
  2. package/README.zh-CN.md +525 -0
  3. package/{dist → backend/dist}/bin/agentstudio.js +7 -5
  4. package/backend/dist/bin/agentstudio.js.map +1 -0
  5. package/backend/dist/index.d.ts +3 -0
  6. package/backend/dist/index.d.ts.map +1 -0
  7. package/{dist → backend/dist}/index.js +9 -28
  8. package/{dist → backend/dist}/index.js.map +1 -1
  9. package/{dist → backend/dist}/routes/settings.js +1 -1
  10. package/{dist → backend/dist}/routes/settings.js.map +1 -1
  11. package/package.json +30 -52
  12. package/.cc-sessions/ppt-editor/session_1756253549429_uau1hm6lh.json +0 -665
  13. package/.cc-sessions/ppt-editor/session_1756257240855_v0wa26mde.json +0 -394
  14. package/.env +0 -15
  15. package/dist/bin/agentstudio.js.map +0 -1
  16. package/dist/index.d.ts +0 -2
  17. package/dist/index.d.ts.map +0 -1
  18. package/docs/chat-clean-1.svg +0 -1
  19. package/docs/chat-clean.md +0 -60
  20. package/docs/chat-comprehensive-1.svg +0 -1
  21. package/docs/chat-comprehensive.md +0 -166
  22. package/docs/chat_api_sequence_diagram.md +0 -58
  23. package/docs/command-detection-logic.md +0 -306
  24. package/docs/command-detection-sequence.md +0 -186
  25. package/frontend/dist/assets/AgentsPage-Dqb_aqAA.js +0 -1
  26. package/frontend/dist/assets/ChatPage-BvQmXfcP.css +0 -1
  27. package/frontend/dist/assets/ChatPage-L8Paywyc.js +0 -91
  28. package/frontend/dist/assets/CommandForm-DLl7EIMS.js +0 -7
  29. package/frontend/dist/assets/CommandsPage-Bzavq0Ec.js +0 -1
  30. package/frontend/dist/assets/DashboardPage-B3o4AYFT.js +0 -15
  31. package/frontend/dist/assets/FileBrowser-DL3ayaqb.js +0 -1
  32. package/frontend/dist/assets/GeneralSettingsPage-CBN_de-V.js +0 -1
  33. package/frontend/dist/assets/LandingPage-Dl4ioKos.js +0 -1
  34. package/frontend/dist/assets/LoginPage-4QqRdiSi.js +0 -12
  35. package/frontend/dist/assets/McpPage-CY3tYiqj.js +0 -39
  36. package/frontend/dist/assets/MemorySettingsPage-DGxrok5K.js +0 -1
  37. package/frontend/dist/assets/ProjectSelector-hgmGYVFh.js +0 -1
  38. package/frontend/dist/assets/ProjectsPage-D399IM0c.js +0 -14
  39. package/frontend/dist/assets/SettingsLayout-CL_K-lzJ.js +0 -1
  40. package/frontend/dist/assets/SubagentForm-DXtTTIKg.js +0 -7
  41. package/frontend/dist/assets/SubagentsPage-Chbhj8p2.js +0 -1
  42. package/frontend/dist/assets/ToastTestPage-DT4wuN5C.js +0 -1
  43. package/frontend/dist/assets/UnifiedToolSelector-CsM9qBvs.js +0 -1
  44. package/frontend/dist/assets/VersionSettingsPage-74Q-LVgA.js +0 -5
  45. package/frontend/dist/assets/agents-ClAzIJTw.js +0 -1
  46. package/frontend/dist/assets/agents-DwCY2K8p.css +0 -1
  47. package/frontend/dist/assets/authFetch-BATQyPG5.js +0 -1
  48. package/frontend/dist/assets/data-structures-DLJedtzx.js +0 -27
  49. package/frontend/dist/assets/dateFormat-CXa8VnEC.js +0 -1
  50. package/frontend/dist/assets/index-B9YHa7XT.css +0 -1
  51. package/frontend/dist/assets/index-B_CTNvca.js +0 -268
  52. package/frontend/dist/assets/monaco-editor-C7Z4sOhS.js +0 -19
  53. package/frontend/dist/assets/syntax-highlighting-YWvMU4Hm.js +0 -24
  54. package/frontend/dist/assets/tabManager-DV8urRBM.js +0 -30
  55. package/frontend/dist/assets/table-D6q1rytw.js +0 -1
  56. package/frontend/dist/assets/tools-C4EPanYi.js +0 -1
  57. package/frontend/dist/assets/ui-components-Cw21Epuw.js +0 -481
  58. package/frontend/dist/assets/useAgents-DwnOE1_k.js +0 -2
  59. package/frontend/dist/assets/useClaudeVersions-CQdGnCqv.js +0 -1
  60. package/frontend/dist/assets/useCommands-CCVaurbt.js +0 -1
  61. package/frontend/dist/cc-studio.png +0 -0
  62. package/frontend/dist/index.html +0 -70
  63. package/frontend/dist/vite.svg +0 -1
  64. package/scripts/README.md +0 -76
  65. package/scripts/fix-project-names.js +0 -113
  66. package/scripts/migrate-projects.js +0 -159
  67. package/shared/index.d.ts +0 -6
  68. package/shared/index.d.ts.map +0 -1
  69. package/shared/index.js +0 -7
  70. package/shared/types/agents.d.ts +0 -80
  71. package/shared/types/agents.d.ts.map +0 -1
  72. package/shared/types/agents.js +0 -145
  73. package/shared/types/claude-history.d.ts +0 -61
  74. package/shared/types/claude-history.d.ts.map +0 -1
  75. package/shared/types/claude-history.js +0 -2
  76. package/shared/types/claude-versions.d.ts +0 -40
  77. package/shared/types/claude-versions.d.ts.map +0 -1
  78. package/shared/types/claude-versions.js +0 -1
  79. package/shared/types/commands.d.ts +0 -48
  80. package/shared/types/commands.d.ts.map +0 -1
  81. package/shared/types/commands.js +0 -19
  82. package/shared/types/projects.d.ts +0 -35
  83. package/shared/types/projects.d.ts.map +0 -1
  84. package/shared/types/projects.js +0 -2
  85. package/shared/types/subagents.d.ts +0 -26
  86. package/shared/types/subagents.d.ts.map +0 -1
  87. package/shared/types/subagents.js +0 -1
  88. package/shared/utils/agentStorage.d.ts +0 -27
  89. package/shared/utils/agentStorage.d.ts.map +0 -1
  90. package/shared/utils/agentStorage.js +0 -392
  91. package/shared/utils/claudeVersionStorage.d.ts +0 -16
  92. package/shared/utils/claudeVersionStorage.d.ts.map +0 -1
  93. package/shared/utils/claudeVersionStorage.js +0 -230
  94. package/shared/utils/projectMetadataStorage.d.ts +0 -94
  95. package/shared/utils/projectMetadataStorage.d.ts.map +0 -1
  96. package/shared/utils/projectMetadataStorage.js +0 -422
  97. package/shared/utils/toolMapping.d.ts +0 -56
  98. package/shared/utils/toolMapping.d.ts.map +0 -1
  99. package/shared/utils/toolMapping.js +0 -71
  100. package/src/bin/agentstudio.ts +0 -130
  101. package/src/index.ts +0 -183
  102. package/src/middleware/auth.ts +0 -26
  103. package/src/routes/agents.ts +0 -884
  104. package/src/routes/auth.ts +0 -73
  105. package/src/routes/commands.ts +0 -441
  106. package/src/routes/files.ts +0 -352
  107. package/src/routes/mcp.ts +0 -751
  108. package/src/routes/media.ts +0 -140
  109. package/src/routes/projects.ts +0 -601
  110. package/src/routes/sessions.ts +0 -809
  111. package/src/routes/settings.ts +0 -718
  112. package/src/routes/slides.ts +0 -170
  113. package/src/routes/subagents.ts +0 -364
  114. package/src/services/claudeSession.ts +0 -293
  115. package/src/services/messageQueue.ts +0 -71
  116. package/src/services/sessionManager.ts +0 -532
  117. package/src/utils/jwt.ts +0 -36
  118. package/tsconfig.json +0 -27
  119. /package/{dist → backend/dist}/bin/agentstudio.d.ts +0 -0
  120. /package/{dist → backend/dist}/bin/agentstudio.d.ts.map +0 -0
  121. /package/{dist → backend/dist}/middleware/auth.d.ts +0 -0
  122. /package/{dist → backend/dist}/middleware/auth.d.ts.map +0 -0
  123. /package/{dist → backend/dist}/middleware/auth.js +0 -0
  124. /package/{dist → backend/dist}/middleware/auth.js.map +0 -0
  125. /package/{dist → backend/dist}/routes/agents.d.ts +0 -0
  126. /package/{dist → backend/dist}/routes/agents.d.ts.map +0 -0
  127. /package/{dist → backend/dist}/routes/agents.js +0 -0
  128. /package/{dist → backend/dist}/routes/agents.js.map +0 -0
  129. /package/{dist → backend/dist}/routes/auth.d.ts +0 -0
  130. /package/{dist → backend/dist}/routes/auth.d.ts.map +0 -0
  131. /package/{dist → backend/dist}/routes/auth.js +0 -0
  132. /package/{dist → backend/dist}/routes/auth.js.map +0 -0
  133. /package/{dist → backend/dist}/routes/commands.d.ts +0 -0
  134. /package/{dist → backend/dist}/routes/commands.d.ts.map +0 -0
  135. /package/{dist → backend/dist}/routes/commands.js +0 -0
  136. /package/{dist → backend/dist}/routes/commands.js.map +0 -0
  137. /package/{dist → backend/dist}/routes/files.d.ts +0 -0
  138. /package/{dist → backend/dist}/routes/files.d.ts.map +0 -0
  139. /package/{dist → backend/dist}/routes/files.js +0 -0
  140. /package/{dist → backend/dist}/routes/files.js.map +0 -0
  141. /package/{dist → backend/dist}/routes/mcp.d.ts +0 -0
  142. /package/{dist → backend/dist}/routes/mcp.d.ts.map +0 -0
  143. /package/{dist → backend/dist}/routes/mcp.js +0 -0
  144. /package/{dist → backend/dist}/routes/mcp.js.map +0 -0
  145. /package/{dist → backend/dist}/routes/media.d.ts +0 -0
  146. /package/{dist → backend/dist}/routes/media.d.ts.map +0 -0
  147. /package/{dist → backend/dist}/routes/media.js +0 -0
  148. /package/{dist → backend/dist}/routes/media.js.map +0 -0
  149. /package/{dist → backend/dist}/routes/projects.d.ts +0 -0
  150. /package/{dist → backend/dist}/routes/projects.d.ts.map +0 -0
  151. /package/{dist → backend/dist}/routes/projects.js +0 -0
  152. /package/{dist → backend/dist}/routes/projects.js.map +0 -0
  153. /package/{dist → backend/dist}/routes/sessions.d.ts +0 -0
  154. /package/{dist → backend/dist}/routes/sessions.d.ts.map +0 -0
  155. /package/{dist → backend/dist}/routes/sessions.js +0 -0
  156. /package/{dist → backend/dist}/routes/sessions.js.map +0 -0
  157. /package/{dist → backend/dist}/routes/settings.d.ts +0 -0
  158. /package/{dist → backend/dist}/routes/settings.d.ts.map +0 -0
  159. /package/{dist → backend/dist}/routes/slides.d.ts +0 -0
  160. /package/{dist → backend/dist}/routes/slides.d.ts.map +0 -0
  161. /package/{dist → backend/dist}/routes/slides.js +0 -0
  162. /package/{dist → backend/dist}/routes/slides.js.map +0 -0
  163. /package/{dist → backend/dist}/routes/subagents.d.ts +0 -0
  164. /package/{dist → backend/dist}/routes/subagents.d.ts.map +0 -0
  165. /package/{dist → backend/dist}/routes/subagents.js +0 -0
  166. /package/{dist → backend/dist}/routes/subagents.js.map +0 -0
  167. /package/{dist → backend/dist}/services/claudeSession.d.ts +0 -0
  168. /package/{dist → backend/dist}/services/claudeSession.d.ts.map +0 -0
  169. /package/{dist → backend/dist}/services/claudeSession.js +0 -0
  170. /package/{dist → backend/dist}/services/claudeSession.js.map +0 -0
  171. /package/{dist → backend/dist}/services/messageQueue.d.ts +0 -0
  172. /package/{dist → backend/dist}/services/messageQueue.d.ts.map +0 -0
  173. /package/{dist → backend/dist}/services/messageQueue.js +0 -0
  174. /package/{dist → backend/dist}/services/messageQueue.js.map +0 -0
  175. /package/{dist → backend/dist}/services/sessionManager.d.ts +0 -0
  176. /package/{dist → backend/dist}/services/sessionManager.d.ts.map +0 -0
  177. /package/{dist → backend/dist}/services/sessionManager.js +0 -0
  178. /package/{dist → backend/dist}/services/sessionManager.js.map +0 -0
  179. /package/{dist → backend/dist}/utils/jwt.d.ts +0 -0
  180. /package/{dist → backend/dist}/utils/jwt.d.ts.map +0 -0
  181. /package/{dist → backend/dist}/utils/jwt.js +0 -0
  182. /package/{dist → backend/dist}/utils/jwt.js.map +0 -0
package/README.md CHANGED
@@ -1,83 +1,527 @@
1
1
  # AgentStudio
2
2
 
3
- AI-powered presentation editor with Claude integration
3
+ <div align="center">
4
4
 
5
- ## Installation
5
+ ![AgentStudio](./frontend/public/cc-studio.png)
6
+
7
+ **A Claude Code-powered Personal Agent Workspace Platform**
8
+
9
+ [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
10
+ [![GitHub stars](https://img.shields.io/github/stars/git-men/agentstudio.svg)](https://github.com/git-men/agentstudio/stargazers)
11
+ [![GitHub issues](https://img.shields.io/github/issues/git-men/agentstudio.svg)](https://github.com/git-men/agentstudio/issues)
12
+
13
+ [English](README.md) | [中文](README.zh-CN.md)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## English
20
+
21
+ ### Overview
22
+
23
+ AgentStudio is a modern, web-based personal agent workspace platform built on top of Claude Code SDK. It extends Claude Code's capabilities with a professional web interface, making AI-powered development accessible to everyone.
24
+
25
+ ### ✨ Key Features
26
+
27
+ #### 🎨 **Modern Web Interface**
28
+ - Professional, intuitive web UI designed for both developers and general users
29
+ - Real-time streaming responses for immediate feedback
30
+ - Split-panel layout with chat interface and live preview
31
+ - Responsive design optimized for desktop and mobile
32
+
33
+ #### 🤖 **Multi-LLM Support**
34
+ - **Claude Integration**: Built on Claude Code SDK with full API support
35
+ - **Multiple Providers**: Support for OpenAI, GLM, DeepSeek, and other popular LLMs
36
+ - **Flexible Configuration**: Easy switching between different AI models
37
+ - **Streaming Input**: Real-time response streaming for better user experience
38
+
39
+ #### 🛠️ **Advanced Agent System**
40
+ - **Built-in Agents**: PPT Editor, Code Assistant, Document Writer
41
+ - **Custom Agents**: Create and configure your own specialized agents
42
+ - **Subagents**: User-defined AI agents with custom system prompts
43
+ - **Agent Marketplace**: Extensible agent development framework
44
+ - **Message-level Tool Customization**: Fine-grained control over agent capabilities
45
+
46
+ #### 📁 **Integrated File Management**
47
+ - **Built-in File Browser**: Navigate and manage project files seamlessly
48
+ - **File Content Viewer**: Preview and edit files directly in the interface
49
+ - **Project-aware Operations**: Context-sensitive file operations
50
+ - **Version Control Integration**: Git-aware file management
51
+
52
+ #### 🎯 **Specialized Tools**
53
+ - **Slide Agent**: Create and edit presentations with AI assistance
54
+ - **Code Explorer**: Navigate codebases with intelligent search
55
+ - **Document Outline**: Structured document editing and management
56
+ - **Image Upload**: Support for visual content analysis
57
+ - **Tool Renderer**: Dynamic visualization of tool usage and results
58
+
59
+ #### 🔧 **Developer-Friendly**
60
+ - **TypeScript Throughout**: Full type safety for better development experience
61
+ - **Modern Stack**: React 18, Vite, TailwindCSS, Zustand
62
+ - **Testing Suite**: Comprehensive test coverage with Vitest
63
+ - **Hot Reload**: Fast development with instant code updates
64
+
65
+ #### 🌐 **Deployment Ready**
66
+ - **Local Development**: Easy setup for development environments
67
+ - **One-Click Installation**: Simplified deployment for end users
68
+ - **Production Builds**: Optimized builds for performance
69
+ - **Cross-Platform**: Support for Linux, macOS, and Windows
70
+
71
+ ### 🚀 Quick Start
72
+
73
+ #### 🐳 Docker Deployment (Recommended for Quick Testing)
74
+
75
+ **One-Command Setup:**
6
76
 
7
77
  ```bash
8
- npm install -g agentstudio
78
+ # Build and run with docker-compose
79
+ docker build -t agentstudio:latest .
80
+ docker-compose up -d
9
81
  ```
10
82
 
11
- ## Quick Start
83
+ Then open http://localhost in your browser.
12
84
 
13
- ### Initialize Configuration
85
+ **What you get:**
86
+ - ✅ **All-in-One Container**: Frontend + Backend in a single container
87
+ - ✅ **Data Persistence**: Automatic data backup via Docker volumes
88
+ - ✅ **Zero Configuration**: Works out of the box
89
+ - ✅ **Easy Updates**: Simple rebuild and restart
90
+
91
+ 📖 **Full Documentation:**
92
+ - [Docker Deployment Guide](DOCKER.md) - Detailed setup and configuration
93
+ - [Quick Start Guide](QUICKSTART.md) - Step-by-step tutorial with examples
94
+
95
+ ---
96
+
97
+ #### For End Users (One-Click Installation)
98
+
99
+ **🐧 Linux & 🍎 macOS - User Installation (Recommended - No sudo required)**
100
+
101
+ ```bash
102
+ # Install Agent Studio backend in user space
103
+ curl -fsSL https://raw.githubusercontent.com/git-men/agentstudio/main/scripts/remote-install.sh | bash
104
+ ```
105
+
106
+ The installer will:
107
+ - ✅ **Auto-detect and install Node.js 18+** (via system package manager or NVM)
108
+ - ✅ **Auto-install pnpm** for faster package management (optional)
109
+ - ✅ **Handle all dependencies** automatically
110
+ - ✅ **Support all major Linux distributions** (Ubuntu, CentOS, Fedora, Arch, etc.)
111
+ - ✅ **Work with both root and regular users**
112
+
113
+ The installer will ask if you want to start the backend immediately. If you choose not to start now, you can start it later:
14
114
 
15
115
  ```bash
16
- agentstudio init
116
+ # Start the backend
117
+ ~/.agent-studio/start.sh
118
+
119
+ # Stop the backend
120
+ ~/.agent-studio/stop.sh
17
121
  ```
18
122
 
19
- This creates a `.env` file with default configuration. Edit it to add your API keys:
123
+ **🪟 Windows - PowerShell Installation**
124
+
125
+ ```powershell
126
+ # Run as Administrator in PowerShell
127
+ PowerShell -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/git-men/agentstudio/main/scripts/windows-install.ps1'))"
128
+ ```
129
+
130
+ The Windows installer will:
131
+ - ✅ **Auto-install Node.js** (via Chocolatey, winget, or direct download)
132
+ - ✅ **Auto-install Git** if not available
133
+ - ✅ **Handle all dependencies** automatically
134
+ - ✅ **Create start/stop batch scripts**
135
+
136
+ **Windows Alternative - Simple Batch Script**
137
+ If you already have Node.js and Git installed:
138
+
139
+ ```batch
140
+ # Download and run the simple installer
141
+ curl -o windows-install-simple.bat https://raw.githubusercontent.com/git-men/agentstudio/main/scripts/windows-install-simple.bat
142
+ windows-install-simple.bat
143
+ ```
144
+
145
+ **Access the application:**
146
+ 1. Open your browser and visit: **https://agentstudio-frontend.vercel.app/**
147
+ 2. In the web interface, go to **Settings → API Configuration**
148
+ 3. Enter your backend URL: `http://localhost:4936`
149
+ 4. Click "Test Connection" to verify
150
+
151
+ **Option 2: System Service Installation (Requires sudo)**
152
+
153
+ For production deployments with automatic startup on boot:
154
+
155
+ ```bash
156
+ # Install as system service with auto-start
157
+ curl -fsSL https://raw.githubusercontent.com/git-men/agentstudio/main/scripts/remote-install.sh | sudo bash
158
+ ```
159
+
160
+ After installation, manage the service:
161
+ ```bash
162
+ agent-studio start # Start the service
163
+ agent-studio stop # Stop the service
164
+ agent-studio restart # Restart the service
165
+ agent-studio status # Check service status
166
+ agent-studio logs # View logs
167
+ agent-studio config # Edit configuration
168
+ ```
169
+
170
+ Then access the web interface at **https://agentstudio-frontend.vercel.app/** and configure the backend URL in Settings.
171
+
172
+ #### For Developers (Development Setup)
173
+
174
+ **Prerequisites:**
175
+ - Node.js 18+
176
+ - pnpm (recommended) or npm
177
+ - Git
178
+
179
+ **Installation:**
180
+ ```bash
181
+ # Clone the repository
182
+ git clone https://github.com/git-men/agentstudio.git
183
+ cd agentstudio
184
+
185
+ # Install dependencies
186
+ pnpm install
187
+
188
+ # Start development servers (both frontend and backend)
189
+ pnpm run dev
190
+
191
+ # Or start them separately
192
+ pnpm run dev:frontend # Frontend only (port 3000)
193
+ pnpm run dev:backend # Backend only (port 4936)
194
+ ```
195
+
196
+ **Build for production:**
197
+ ```bash
198
+ pnpm run build
199
+ pnpm start
200
+ ```
201
+
202
+ ### 📁 Project Structure
203
+
204
+ ```
205
+ agentstudio/
206
+ ├── frontend/ # React frontend application
207
+ │ ├── src/
208
+ │ │ ├── components/ # Reusable UI components
209
+ │ │ ├── pages/ # Page components
210
+ │ │ ├── agents/ # Agent-specific components
211
+ │ │ ├── hooks/ # React hooks and data fetching
212
+ │ │ └── stores/ # State management (Zustand)
213
+ │ └── public/ # Static assets
214
+ ├── backend/ # Node.js backend server
215
+ │ ├── src/
216
+ │ │ ├── routes/ # API endpoints
217
+ │ │ ├── services/ # Business logic
218
+ │ │ └── index.ts # Server entry point
219
+ │ └── dist/ # Built backend code
220
+ ├── shared/ # Shared types and utilities
221
+ └── scripts/ # Installation and deployment scripts
222
+ ```
223
+
224
+ ### ⚙️ Configuration
225
+
226
+ #### Environment Variables
227
+
228
+ **For Development:**
229
+ Create a `.env` file in the `backend/` directory:
20
230
 
21
231
  ```env
22
- # AI Provider (choose one)
23
- OPENAI_API_KEY=your_openai_api_key_here
232
+ # AI Provider Configuration (choose one or more)
24
233
  ANTHROPIC_API_KEY=your_anthropic_api_key_here
234
+ OPENAI_API_KEY=your_openai_api_key_here
25
235
 
26
236
  # Server Configuration
27
237
  PORT=4936
28
- NODE_ENV=production
238
+ NODE_ENV=development
29
239
 
30
240
  # File System
31
- SLIDES_DIR=./slides
241
+ SLIDES_DIR=../slides
32
242
 
33
- # CORS Configuration (optional)
34
- CORS_ORIGINS=https://your-frontend.vercel.app,https://custom-domain.com
243
+ # CORS Configuration (for production)
244
+ CORS_ORIGINS=https://your-frontend-domain.com
35
245
  ```
36
246
 
37
- ### Start AgentStudio
247
+ **For System Service Installation:**
248
+ Edit the configuration file at `/etc/agent-studio/config.env`:
38
249
 
39
250
  ```bash
40
- agentstudio start
251
+ # Edit configuration
252
+ agent-studio config
253
+ ```
254
+
255
+ Configuration options:
256
+ ```env
257
+ # Server configuration
258
+ NODE_ENV=production
259
+ PORT=4936
260
+ SLIDES_DIR=/opt/slides
261
+
262
+ # Optional: AI provider keys (configure if needed)
263
+ # ANTHROPIC_API_KEY=your_anthropic_api_key_here
264
+ # OPENAI_API_KEY=your_openai_api_key_here
265
+
266
+ # Optional: CORS configuration for custom frontends
267
+ # CORS_ORIGINS=https://your-frontend.vercel.app,https://custom-domain.com
41
268
  ```
42
269
 
43
- This starts both the backend API server and serves the frontend application.
270
+ #### API Configuration
44
271
 
45
- ## Usage
272
+ The frontend is hosted at **https://agentstudio-frontend.vercel.app/** and can connect to different backend instances:
46
273
 
47
- ### Start Backend Only
274
+ **For Local Backend:**
275
+ 1. Open **Settings → API Configuration** in the web interface
276
+ 2. Enter: `http://localhost:4936` (or your custom port)
277
+ 3. Click "Test Connection" to verify
48
278
 
279
+ **For Remote Backend:**
280
+ 1. Deploy your backend to a server with a public IP or domain
281
+ 2. Configure the backend URL in Settings (e.g., `https://your-backend.com`)
282
+ 3. Ensure CORS is properly configured in your backend's `.env` file
283
+
284
+ ### 📋 Service Management
285
+
286
+ #### System Service Commands (when installed with sudo)
287
+
288
+ ```bash
289
+ # Basic service operations
290
+ agent-studio start # Start the service
291
+ agent-studio stop # Stop the service
292
+ agent-studio restart # Restart the service
293
+ agent-studio status # Check service status
294
+
295
+ # Monitoring and logs
296
+ agent-studio logs # View real-time logs
297
+ agent-studio health # Check service health
298
+
299
+ # Configuration
300
+ agent-studio config # Edit configuration file
301
+
302
+ # Service details
303
+ agent-studio uninstall # Remove the service
304
+ ```
305
+
306
+ #### Service Details
307
+
308
+ **Installation Directories:**
309
+
310
+ For user installation (no sudo):
311
+ - Application: `~/.agent-studio`
312
+ - Configuration: `~/.agent-studio-config/config.env`
313
+ - Logs: `~/.agent-studio-logs/`
314
+ - Slides: `~/slides`
315
+ - Start script: `~/.agent-studio/start.sh`
316
+ - Stop script: `~/.agent-studio/stop.sh`
317
+
318
+ For system service installation (with sudo):
319
+ - Application: `~/.agent-studio`
320
+ - Configuration: `~/.agent-studio-config/config.env`
321
+ - Logs: `~/.agent-studio-logs/`
322
+ - Slides: `~/slides`
323
+
324
+ **Log Files:**
325
+ - Output log: `/var/log/agent-studio/output.log`
326
+ - Error log: `/var/log/agent-studio/error.log`
327
+ - Log rotation: Daily (30 days retention)
328
+
329
+ **Service Integration:**
330
+ - Linux: systemd service (`/etc/systemd/system/agent-studio.service`)
331
+ - macOS: launchd service (`/Library/LaunchDaemons/com.agent-studio.backend.plist`)
332
+ - Auto-start on boot enabled by default
333
+
334
+ ### 🔧 Troubleshooting
335
+
336
+ #### Installation Issues
337
+
338
+ **Node.js Installation Problems:**
339
+ The installer automatically handles Node.js installation, but if you encounter issues:
340
+
341
+ ```bash
342
+ # For Linux/macOS - Manual Node.js installation via NVM
343
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
344
+ source ~/.bashrc
345
+ nvm install --lts
346
+ nvm use --lts
347
+
348
+ # For Windows - Download from official website
349
+ # Visit: https://nodejs.org/
350
+ ```
351
+
352
+ **Ubuntu/Debian Specific Issues:**
353
+ - **Root User Detection**: Fixed in latest installer - now properly supports both root and regular users
354
+ - **TTY Issues**: Installer sets `CI=true` to handle non-interactive environments
355
+ - **Build Failures**: Installer automatically retries with dev dependencies
356
+
357
+ **Windows Installation Issues:**
358
+ - **PowerShell Execution Policy**: Run `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
359
+ - **Missing Dependencies**: Installer will prompt to install Node.js, Git, and other requirements
360
+ - **Permission Issues**: Run PowerShell as Administrator for system-wide installations
361
+
362
+ #### Service Won't Start
363
+
364
+ **For User Installation:**
365
+ ```bash
366
+ # Check if backend is running
367
+ curl http://localhost:4936/api/health
368
+
369
+ # View logs
370
+ cat ~/.agent-studio-logs/output.log
371
+ cat ~/.agent-studio-logs/error.log
372
+
373
+ # Restart backend
374
+ ~/.agent-studio/stop.sh
375
+ ~/.agent-studio/start.sh
376
+ ```
377
+
378
+ **For System Service Installation:**
379
+ ```bash
380
+ # Check service status
381
+ agent-studio status
382
+
383
+ # View logs for errors
384
+ agent-studio logs
385
+
386
+ # Verify configuration
387
+ agent-studio config
388
+
389
+ # Check if port is available
390
+ lsof -i :4936
391
+ ```
392
+
393
+ #### Common Issues
394
+
395
+ **Permission Errors (User Installation):**
396
+ ```bash
397
+ # Fix script permissions
398
+ chmod +x ~/.agent-studio/start.sh
399
+ chmod +x ~/.agent-studio/stop.sh
400
+
401
+ # Fix directory permissions
402
+ chmod -R 755 ~/.agent-studio
403
+ ```
404
+
405
+ **Permission Errors (System Service):**
406
+ ```bash
407
+ sudo chown -R agent-studio:agent-studio /opt/agent-studio
408
+ sudo chown -R agent-studio:agent-studio /var/log/agent-studio
409
+ ```
410
+
411
+ **Port Already in Use:**
412
+ ```bash
413
+ # Find process using the port
414
+ lsof -i :4936
415
+
416
+ # Kill the process (replace PID with actual process ID)
417
+ kill -9 <PID>
418
+
419
+ # Or change port in configuration
420
+ # Edit ~/.agent-studio-config/config.env and change PORT=8080
421
+ ```
422
+
423
+ **Build Failures:**
424
+ The installer now automatically handles build failures by:
425
+ 1. Installing dev dependencies
426
+ 2. Retrying the build
427
+ 3. Falling back to development mode if build still fails
428
+
429
+ **Health Check:**
49
430
  ```bash
50
- agentstudio backend
431
+ # For user installation
432
+ curl http://localhost:4936/api/health
433
+
434
+ # For system service
435
+ agent-studio health
436
+ ```
437
+
438
+ **Windows Specific Issues:**
439
+ ```batch
440
+ REM Check if Node.js is available
441
+ node --version
442
+
443
+ REM Check if backend is running
444
+ curl http://localhost:4936/api/health
445
+
446
+ REM Start backend manually
447
+ cd %USERPROFILE%\.agent-studio
448
+ start.bat
449
+
450
+ REM Stop backend
451
+ stop.bat
51
452
  ```
52
453
 
53
- ### Start with Custom Ports
454
+ ### 📦 Updates
455
+
456
+ To update an existing installation:
54
457
 
55
458
  ```bash
56
- agentstudio start --port 8080 --frontend-port 3000
459
+ # Stop the service
460
+ agent-studio stop
461
+
462
+ # Update the code
463
+ cd /opt/agent-studio
464
+ git pull
465
+ pnpm install
466
+ pnpm run build:backend
467
+
468
+ # Start the service
469
+ agent-studio start
57
470
  ```
58
471
 
59
- ### Development Mode (No Authentication)
472
+ ### 🧪 Testing
60
473
 
61
474
  ```bash
62
- agentstudio start --no-auth
475
+ # Run all tests
476
+ pnpm test
477
+
478
+ # Run frontend tests only
479
+ cd frontend && pnpm test
480
+
481
+ # Run tests with coverage
482
+ cd frontend && pnpm run test:coverage
483
+
484
+ # Run tests with UI
485
+ cd frontend && pnpm run test:ui
63
486
  ```
64
487
 
65
- ## API Endpoints
488
+ ### 🛡️ Security
489
+
490
+ - **API Key Protection**: Environment-based API key management
491
+ - **CORS Configuration**: Configurable cross-origin policies
492
+ - **Input Validation**: Comprehensive input sanitization
493
+ - **Secure File Operations**: Sandboxed file system access
494
+
495
+ ### 🤝 Contributing
496
+
497
+ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
498
+
499
+ 1. Fork the repository
500
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
501
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
502
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
503
+ 5. Open a Pull Request
504
+
505
+ ### 📄 License
506
+
507
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
508
+
509
+ ### 🙏 Acknowledgments
510
+
511
+ - Built on top of [Claude Code SDK](https://claude.ai/code)
512
+ - Inspired by modern development workflows
513
+ - Community feedback and contributions
514
+
515
+
516
+ ## Links
66
517
 
67
- - `GET /api/health` - Health check
68
- - `POST /api/agents/chat` - AI chat with agents
69
- - `GET /api/slides/:index` - Get slide content
70
- - `PUT /api/slides/:index` - Update slide content
518
+ | link | type | service | description |
519
+ |:---|:---|:---|:---|
520
+ | **[ctok.ai](https://ctok.ai/)** | 🤝 community | <small>✅ Claude Code<br>✅ Codex CLI</small> | Claude Code / Codex CLI carpool service. |
71
521
 
72
- ## Environment Variables
73
522
 
74
- - `PORT` - Backend server port (default: 4936)
75
- - `NODE_ENV` - Environment (development/production)
76
- - `SLIDES_DIR` - Directory for slide files
77
- - `OPENAI_API_KEY` - OpenAI API key
78
- - `ANTHROPIC_API_KEY` - Anthropic API key
79
- - `CORS_ORIGINS` - Allowed CORS origins
523
+ ## 中文文档
80
524
 
81
- ## License
525
+ 请查看 [README.zh-CN.md](README.zh-CN.md) 获取中文文档。
82
526
 
83
- MIT
527
+ ---