@siteboon/claude-code-ui 1.8.2
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.
- package/.env.example +12 -0
- package/.nvmrc +1 -0
- package/LICENSE +675 -0
- package/README.md +275 -0
- package/index.html +48 -0
- package/package.json +84 -0
- package/postcss.config.js +6 -0
- package/public/convert-icons.md +53 -0
- package/public/favicon.png +0 -0
- package/public/favicon.svg +9 -0
- package/public/generate-icons.js +49 -0
- package/public/icons/claude-ai-icon.svg +1 -0
- package/public/icons/cursor.svg +1 -0
- package/public/icons/generate-icons.md +19 -0
- package/public/icons/icon-128x128.png +0 -0
- package/public/icons/icon-128x128.svg +12 -0
- package/public/icons/icon-144x144.png +0 -0
- package/public/icons/icon-144x144.svg +12 -0
- package/public/icons/icon-152x152.png +0 -0
- package/public/icons/icon-152x152.svg +12 -0
- package/public/icons/icon-192x192.png +0 -0
- package/public/icons/icon-192x192.svg +12 -0
- package/public/icons/icon-384x384.png +0 -0
- package/public/icons/icon-384x384.svg +12 -0
- package/public/icons/icon-512x512.png +0 -0
- package/public/icons/icon-512x512.svg +12 -0
- package/public/icons/icon-72x72.png +0 -0
- package/public/icons/icon-72x72.svg +12 -0
- package/public/icons/icon-96x96.png +0 -0
- package/public/icons/icon-96x96.svg +12 -0
- package/public/icons/icon-template.svg +12 -0
- package/public/logo.svg +9 -0
- package/public/manifest.json +61 -0
- package/public/screenshots/cli-selection.png +0 -0
- package/public/screenshots/desktop-main.png +0 -0
- package/public/screenshots/mobile-chat.png +0 -0
- package/public/screenshots/tools-modal.png +0 -0
- package/public/sw.js +49 -0
- package/server/claude-cli.js +391 -0
- package/server/cursor-cli.js +250 -0
- package/server/database/db.js +86 -0
- package/server/database/init.sql +16 -0
- package/server/index.js +1167 -0
- package/server/middleware/auth.js +80 -0
- package/server/projects.js +1063 -0
- package/server/routes/auth.js +135 -0
- package/server/routes/cursor.js +794 -0
- package/server/routes/git.js +823 -0
- package/server/routes/mcp-utils.js +48 -0
- package/server/routes/mcp.js +552 -0
- package/server/routes/taskmaster.js +1971 -0
- package/server/utils/mcp-detector.js +198 -0
- package/server/utils/taskmaster-websocket.js +129 -0
- package/src/App.jsx +751 -0
- package/src/components/ChatInterface.jsx +3485 -0
- package/src/components/ClaudeLogo.jsx +11 -0
- package/src/components/ClaudeStatus.jsx +107 -0
- package/src/components/CodeEditor.jsx +422 -0
- package/src/components/CreateTaskModal.jsx +88 -0
- package/src/components/CursorLogo.jsx +9 -0
- package/src/components/DarkModeToggle.jsx +35 -0
- package/src/components/DiffViewer.jsx +41 -0
- package/src/components/ErrorBoundary.jsx +73 -0
- package/src/components/FileTree.jsx +480 -0
- package/src/components/GitPanel.jsx +1283 -0
- package/src/components/ImageViewer.jsx +54 -0
- package/src/components/LoginForm.jsx +110 -0
- package/src/components/MainContent.jsx +577 -0
- package/src/components/MicButton.jsx +272 -0
- package/src/components/MobileNav.jsx +88 -0
- package/src/components/NextTaskBanner.jsx +695 -0
- package/src/components/PRDEditor.jsx +871 -0
- package/src/components/ProtectedRoute.jsx +44 -0
- package/src/components/QuickSettingsPanel.jsx +262 -0
- package/src/components/Settings.jsx +2023 -0
- package/src/components/SetupForm.jsx +135 -0
- package/src/components/Shell.jsx +663 -0
- package/src/components/Sidebar.jsx +1665 -0
- package/src/components/StandaloneShell.jsx +106 -0
- package/src/components/TaskCard.jsx +210 -0
- package/src/components/TaskDetail.jsx +406 -0
- package/src/components/TaskIndicator.jsx +108 -0
- package/src/components/TaskList.jsx +1054 -0
- package/src/components/TaskMasterSetupWizard.jsx +603 -0
- package/src/components/TaskMasterStatus.jsx +86 -0
- package/src/components/TodoList.jsx +91 -0
- package/src/components/Tooltip.jsx +91 -0
- package/src/components/ui/badge.jsx +31 -0
- package/src/components/ui/button.jsx +46 -0
- package/src/components/ui/input.jsx +19 -0
- package/src/components/ui/scroll-area.jsx +23 -0
- package/src/contexts/AuthContext.jsx +158 -0
- package/src/contexts/TaskMasterContext.jsx +324 -0
- package/src/contexts/TasksSettingsContext.jsx +95 -0
- package/src/contexts/ThemeContext.jsx +94 -0
- package/src/contexts/WebSocketContext.jsx +29 -0
- package/src/hooks/useAudioRecorder.js +109 -0
- package/src/hooks/useVersionCheck.js +39 -0
- package/src/index.css +822 -0
- package/src/lib/utils.js +6 -0
- package/src/main.jsx +10 -0
- package/src/utils/api.js +141 -0
- package/src/utils/websocket.js +109 -0
- package/src/utils/whisper.js +37 -0
- package/tailwind.config.js +63 -0
- package/vite.config.js +29 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP SERVER DETECTION UTILITY
|
|
3
|
+
* ============================
|
|
4
|
+
*
|
|
5
|
+
* Centralized utility for detecting MCP server configurations.
|
|
6
|
+
* Used across TaskMaster integration and other MCP-dependent features.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { promises as fsPromises } from 'fs';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
import os from 'os';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Check if task-master-ai MCP server is configured
|
|
15
|
+
* Reads directly from Claude configuration files like claude-cli.js does
|
|
16
|
+
* @returns {Promise<Object>} MCP detection result
|
|
17
|
+
*/
|
|
18
|
+
export async function detectTaskMasterMCPServer() {
|
|
19
|
+
try {
|
|
20
|
+
// Read Claude configuration files directly (same logic as mcp.js)
|
|
21
|
+
const homeDir = os.homedir();
|
|
22
|
+
const configPaths = [
|
|
23
|
+
path.join(homeDir, '.claude.json'),
|
|
24
|
+
path.join(homeDir, '.claude', 'settings.json')
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
let configData = null;
|
|
28
|
+
let configPath = null;
|
|
29
|
+
|
|
30
|
+
// Try to read from either config file
|
|
31
|
+
for (const filepath of configPaths) {
|
|
32
|
+
try {
|
|
33
|
+
const fileContent = await fsPromises.readFile(filepath, 'utf8');
|
|
34
|
+
configData = JSON.parse(fileContent);
|
|
35
|
+
configPath = filepath;
|
|
36
|
+
break;
|
|
37
|
+
} catch (error) {
|
|
38
|
+
// File doesn't exist or is not valid JSON, try next
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!configData) {
|
|
44
|
+
return {
|
|
45
|
+
hasMCPServer: false,
|
|
46
|
+
reason: 'No Claude configuration file found',
|
|
47
|
+
hasConfig: false
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Look for task-master-ai in user-scoped MCP servers
|
|
52
|
+
let taskMasterServer = null;
|
|
53
|
+
if (configData.mcpServers && typeof configData.mcpServers === 'object') {
|
|
54
|
+
const serverEntry = Object.entries(configData.mcpServers).find(([name, config]) =>
|
|
55
|
+
name === 'task-master-ai' ||
|
|
56
|
+
name.includes('task-master') ||
|
|
57
|
+
(config && config.command && config.command.includes('task-master'))
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
if (serverEntry) {
|
|
61
|
+
const [name, config] = serverEntry;
|
|
62
|
+
taskMasterServer = {
|
|
63
|
+
name,
|
|
64
|
+
scope: 'user',
|
|
65
|
+
config,
|
|
66
|
+
type: config.command ? 'stdio' : (config.url ? 'http' : 'unknown')
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Also check project-specific MCP servers if not found globally
|
|
72
|
+
if (!taskMasterServer && configData.projects) {
|
|
73
|
+
for (const [projectPath, projectConfig] of Object.entries(configData.projects)) {
|
|
74
|
+
if (projectConfig.mcpServers && typeof projectConfig.mcpServers === 'object') {
|
|
75
|
+
const serverEntry = Object.entries(projectConfig.mcpServers).find(([name, config]) =>
|
|
76
|
+
name === 'task-master-ai' ||
|
|
77
|
+
name.includes('task-master') ||
|
|
78
|
+
(config && config.command && config.command.includes('task-master'))
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (serverEntry) {
|
|
82
|
+
const [name, config] = serverEntry;
|
|
83
|
+
taskMasterServer = {
|
|
84
|
+
name,
|
|
85
|
+
scope: 'local',
|
|
86
|
+
projectPath,
|
|
87
|
+
config,
|
|
88
|
+
type: config.command ? 'stdio' : (config.url ? 'http' : 'unknown')
|
|
89
|
+
};
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (taskMasterServer) {
|
|
97
|
+
const isValid = !!(taskMasterServer.config &&
|
|
98
|
+
(taskMasterServer.config.command || taskMasterServer.config.url));
|
|
99
|
+
const hasEnvVars = !!(taskMasterServer.config &&
|
|
100
|
+
taskMasterServer.config.env &&
|
|
101
|
+
Object.keys(taskMasterServer.config.env).length > 0);
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
hasMCPServer: true,
|
|
105
|
+
isConfigured: isValid,
|
|
106
|
+
hasApiKeys: hasEnvVars,
|
|
107
|
+
scope: taskMasterServer.scope,
|
|
108
|
+
config: {
|
|
109
|
+
command: taskMasterServer.config?.command,
|
|
110
|
+
args: taskMasterServer.config?.args || [],
|
|
111
|
+
url: taskMasterServer.config?.url,
|
|
112
|
+
envVars: hasEnvVars ? Object.keys(taskMasterServer.config.env) : [],
|
|
113
|
+
type: taskMasterServer.type
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
} else {
|
|
117
|
+
// Get list of available servers for debugging
|
|
118
|
+
const availableServers = [];
|
|
119
|
+
if (configData.mcpServers) {
|
|
120
|
+
availableServers.push(...Object.keys(configData.mcpServers));
|
|
121
|
+
}
|
|
122
|
+
if (configData.projects) {
|
|
123
|
+
for (const projectConfig of Object.values(configData.projects)) {
|
|
124
|
+
if (projectConfig.mcpServers) {
|
|
125
|
+
availableServers.push(...Object.keys(projectConfig.mcpServers).map(name => `local:${name}`));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
hasMCPServer: false,
|
|
132
|
+
reason: 'task-master-ai not found in configured MCP servers',
|
|
133
|
+
hasConfig: true,
|
|
134
|
+
configPath,
|
|
135
|
+
availableServers
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error('Error detecting MCP server config:', error);
|
|
140
|
+
return {
|
|
141
|
+
hasMCPServer: false,
|
|
142
|
+
reason: `Error checking MCP config: ${error.message}`,
|
|
143
|
+
hasConfig: false
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Get all configured MCP servers (not just TaskMaster)
|
|
150
|
+
* @returns {Promise<Object>} All MCP servers configuration
|
|
151
|
+
*/
|
|
152
|
+
export async function getAllMCPServers() {
|
|
153
|
+
try {
|
|
154
|
+
const homeDir = os.homedir();
|
|
155
|
+
const configPaths = [
|
|
156
|
+
path.join(homeDir, '.claude.json'),
|
|
157
|
+
path.join(homeDir, '.claude', 'settings.json')
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
let configData = null;
|
|
161
|
+
let configPath = null;
|
|
162
|
+
|
|
163
|
+
// Try to read from either config file
|
|
164
|
+
for (const filepath of configPaths) {
|
|
165
|
+
try {
|
|
166
|
+
const fileContent = await fsPromises.readFile(filepath, 'utf8');
|
|
167
|
+
configData = JSON.parse(fileContent);
|
|
168
|
+
configPath = filepath;
|
|
169
|
+
break;
|
|
170
|
+
} catch (error) {
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (!configData) {
|
|
176
|
+
return {
|
|
177
|
+
hasConfig: false,
|
|
178
|
+
servers: {},
|
|
179
|
+
projectServers: {}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
hasConfig: true,
|
|
185
|
+
configPath,
|
|
186
|
+
servers: configData.mcpServers || {},
|
|
187
|
+
projectServers: configData.projects || {}
|
|
188
|
+
};
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.error('Error getting all MCP servers:', error);
|
|
191
|
+
return {
|
|
192
|
+
hasConfig: false,
|
|
193
|
+
error: error.message,
|
|
194
|
+
servers: {},
|
|
195
|
+
projectServers: {}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TASKMASTER WEBSOCKET UTILITIES
|
|
3
|
+
* ==============================
|
|
4
|
+
*
|
|
5
|
+
* Utilities for broadcasting TaskMaster state changes via WebSocket.
|
|
6
|
+
* Integrates with the existing WebSocket system to provide real-time updates.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Broadcast TaskMaster project update to all connected clients
|
|
11
|
+
* @param {WebSocket.Server} wss - WebSocket server instance
|
|
12
|
+
* @param {string} projectName - Name of the updated project
|
|
13
|
+
* @param {Object} taskMasterData - Updated TaskMaster data
|
|
14
|
+
*/
|
|
15
|
+
export function broadcastTaskMasterProjectUpdate(wss, projectName, taskMasterData) {
|
|
16
|
+
if (!wss || !projectName) {
|
|
17
|
+
console.warn('TaskMaster WebSocket broadcast: Missing wss or projectName');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const message = {
|
|
22
|
+
type: 'taskmaster-project-updated',
|
|
23
|
+
projectName,
|
|
24
|
+
taskMasterData,
|
|
25
|
+
timestamp: new Date().toISOString()
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
wss.clients.forEach((client) => {
|
|
30
|
+
if (client.readyState === 1) { // WebSocket.OPEN
|
|
31
|
+
try {
|
|
32
|
+
client.send(JSON.stringify(message));
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error('Error sending TaskMaster project update:', error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Broadcast TaskMaster tasks update for a specific project
|
|
42
|
+
* @param {WebSocket.Server} wss - WebSocket server instance
|
|
43
|
+
* @param {string} projectName - Name of the project with updated tasks
|
|
44
|
+
* @param {Object} tasksData - Updated tasks data
|
|
45
|
+
*/
|
|
46
|
+
export function broadcastTaskMasterTasksUpdate(wss, projectName, tasksData) {
|
|
47
|
+
if (!wss || !projectName) {
|
|
48
|
+
console.warn('TaskMaster WebSocket broadcast: Missing wss or projectName');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const message = {
|
|
53
|
+
type: 'taskmaster-tasks-updated',
|
|
54
|
+
projectName,
|
|
55
|
+
tasksData,
|
|
56
|
+
timestamp: new Date().toISOString()
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
wss.clients.forEach((client) => {
|
|
61
|
+
if (client.readyState === 1) { // WebSocket.OPEN
|
|
62
|
+
try {
|
|
63
|
+
client.send(JSON.stringify(message));
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error('Error sending TaskMaster tasks update:', error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Broadcast MCP server status change
|
|
73
|
+
* @param {WebSocket.Server} wss - WebSocket server instance
|
|
74
|
+
* @param {Object} mcpStatus - Updated MCP server status
|
|
75
|
+
*/
|
|
76
|
+
export function broadcastMCPStatusChange(wss, mcpStatus) {
|
|
77
|
+
if (!wss) {
|
|
78
|
+
console.warn('TaskMaster WebSocket broadcast: Missing wss');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const message = {
|
|
83
|
+
type: 'taskmaster-mcp-status-changed',
|
|
84
|
+
mcpStatus,
|
|
85
|
+
timestamp: new Date().toISOString()
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
wss.clients.forEach((client) => {
|
|
90
|
+
if (client.readyState === 1) { // WebSocket.OPEN
|
|
91
|
+
try {
|
|
92
|
+
client.send(JSON.stringify(message));
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error('Error sending TaskMaster MCP status update:', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Broadcast general TaskMaster update notification
|
|
102
|
+
* @param {WebSocket.Server} wss - WebSocket server instance
|
|
103
|
+
* @param {string} updateType - Type of update (e.g., 'initialization', 'configuration')
|
|
104
|
+
* @param {Object} data - Additional data about the update
|
|
105
|
+
*/
|
|
106
|
+
export function broadcastTaskMasterUpdate(wss, updateType, data = {}) {
|
|
107
|
+
if (!wss || !updateType) {
|
|
108
|
+
console.warn('TaskMaster WebSocket broadcast: Missing wss or updateType');
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const message = {
|
|
113
|
+
type: 'taskmaster-update',
|
|
114
|
+
updateType,
|
|
115
|
+
data,
|
|
116
|
+
timestamp: new Date().toISOString()
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
wss.clients.forEach((client) => {
|
|
121
|
+
if (client.readyState === 1) { // WebSocket.OPEN
|
|
122
|
+
try {
|
|
123
|
+
client.send(JSON.stringify(message));
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error('Error sending TaskMaster update:', error);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|