Checkpoint: Phase 13: Seed data for agents and orchestrator
- server/seed.ts: 6 default system agents (Orchestrator, Browser, Tool Builder, Agent Compiler, Coder, Researcher) - Idempotent: runs only when agents table is empty - Integrated into server/_core/index.ts startup - server/seed.test.ts: 18 vitest tests, all pass - Total: 69 tests pass (7 test files)
This commit is contained in:
@@ -7,6 +7,7 @@ import { registerOAuthRoutes } from "./oauth";
|
||||
import { appRouter } from "../routers";
|
||||
import { createContext } from "./context";
|
||||
import { serveStatic, setupVite } from "./vite";
|
||||
import { seedDefaults } from "../seed";
|
||||
|
||||
function isPortAvailable(port: number): Promise<boolean> {
|
||||
return new Promise(resolve => {
|
||||
@@ -57,6 +58,9 @@ async function startServer() {
|
||||
console.log(`Port ${preferredPort} is busy, using port ${port} instead`);
|
||||
}
|
||||
|
||||
// Run idempotent seed on every startup (no-op if data already exists)
|
||||
await seedDefaults();
|
||||
|
||||
server.listen(port, () => {
|
||||
console.log(`Server running on http://localhost:${port}/`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user