refactor: replace primary/secondary engine pattern with uniform ProjectEngineManager
Remove the anti-pattern where the cwd project was treated as "primary" with a special engine, and other projects got "secondary" engines through a separate code path. Every project now gets an identical ProjectEngine created through ProjectEngineManager. Key changes: - Add ProjectEngineManager class to @fusion/engine for uniform engine lifecycle - Replace manual engine maps in dashboard.ts and serve.ts with engineManager - Add engineManager to ServerOptions for per-project engine resolution - Add getProjectContext() helper in routes.ts (replaces 199 getScopedStore calls) - Merge and automation routes now resolve engine subsystems per-request - SSE endpoint uses engine's store when available (same EventEmitter) - Fix tsx not found in dev-with-memory.mjs startup script - Add invalidateAllGlobalSettingsCaches for cross-project settings sync Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,6 @@ if (args.length === 0) {
|
||||
});
|
||||
} else {
|
||||
// Forward all arguments (e.g., "dashboard", "task list", etc.)
|
||||
const cmd = spawn("pnpm", ["build", "&&", "tsx", "packages/cli/src/bin.ts", ...args], { stdio: "inherit", shell: true });
|
||||
const cmd = spawn("pnpm", ["build", "&&", "pnpm", "exec", "tsx", "packages/cli/src/bin.ts", ...args], { stdio: "inherit", shell: true });
|
||||
cmd.on("close", (c) => process.exit(c ?? 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user