mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
feat: initialize monorepo with package.json for CCW workflow platform
This commit is contained in:
@@ -415,6 +415,18 @@ export class CoreMemoryStore {
|
||||
stmt.run(new Date().toISOString(), id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unarchive a memory
|
||||
*/
|
||||
unarchiveMemory(id: string): void {
|
||||
const stmt = this.db.prepare(`
|
||||
UPDATE memories
|
||||
SET archived = 0, updated_at = ?
|
||||
WHERE id = ?
|
||||
`);
|
||||
stmt.run(new Date().toISOString(), id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a memory
|
||||
*/
|
||||
|
||||
@@ -141,6 +141,34 @@ export async function handleCoreMemoryRoutes(ctx: RouteContext): Promise<boolean
|
||||
return true;
|
||||
}
|
||||
|
||||
// API: Core Memory - Unarchive memory
|
||||
if (pathname.startsWith('/api/core-memory/memories/') && pathname.endsWith('/unarchive') && req.method === 'POST') {
|
||||
const memoryId = pathname.replace('/api/core-memory/memories/', '').replace('/unarchive', '');
|
||||
const projectPath = url.searchParams.get('path') || initialPath;
|
||||
|
||||
try {
|
||||
const store = getCoreMemoryStore(projectPath);
|
||||
store.unarchiveMemory(memoryId);
|
||||
|
||||
// Broadcast update event
|
||||
broadcastToClients({
|
||||
type: 'CORE_MEMORY_UPDATED',
|
||||
payload: {
|
||||
memoryId,
|
||||
archived: false,
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
});
|
||||
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ success: true }));
|
||||
} catch (error: unknown) {
|
||||
res.writeHead(500, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ error: (error as Error).message }));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// API: Core Memory - Delete memory
|
||||
if (pathname.startsWith('/api/core-memory/memories/') && req.method === 'DELETE') {
|
||||
const memoryId = pathname.replace('/api/core-memory/memories/', '');
|
||||
|
||||
@@ -69,7 +69,9 @@ export async function startReactFrontend(port: number): Promise<void> {
|
||||
}
|
||||
|
||||
// Spawn React dev server
|
||||
reactProcess = spawn('npm', ['run', 'dev', '--', '--port', port.toString()], {
|
||||
// Use 'dev:vite' directly instead of 'dev' to avoid the 'concurrently' wrapper
|
||||
// which doesn't properly pass the --port argument to vite
|
||||
reactProcess = spawn('npm', ['run', 'dev:vite', '--', '--port', port.toString(), '--strictPort'], {
|
||||
cwd: frontendDir,
|
||||
stdio: 'pipe',
|
||||
shell: true,
|
||||
@@ -106,11 +108,13 @@ export async function startReactFrontend(port: number): Promise<void> {
|
||||
const chunk = data.toString();
|
||||
output += chunk;
|
||||
|
||||
// Check for ready signals
|
||||
// Check for ready signals (Vite 5/6 output format)
|
||||
if (
|
||||
chunk.includes('Local:') ||
|
||||
chunk.includes('ready in') ||
|
||||
chunk.includes('VITE') && chunk.includes(port.toString())
|
||||
chunk.includes('VITE') && chunk.includes(port.toString()) ||
|
||||
chunk.includes(`http://localhost:${port}`) ||
|
||||
chunk.includes(`https://localhost:${port}`)
|
||||
) {
|
||||
cleanup();
|
||||
console.log(chalk.green(` React frontend ready at http://localhost:${port}`));
|
||||
|
||||
Reference in New Issue
Block a user