feat: initialize monorepo with package.json for CCW workflow platform

This commit is contained in:
catlog22
2026-02-03 14:42:20 +08:00
parent 5483a72e9f
commit 39b80b3386
267 changed files with 99597 additions and 2658 deletions

View File

@@ -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
*/

View File

@@ -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/', '');

View File

@@ -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}`));