refactor: restructure to monorepo architecture

- Move core agent engine to packages/core/
- Add packages/types/ for shared TypeScript types
- Add packages/utils/ for utility functions
- Add apps/cli/ for command-line interface
- Add apps/gateway/ for NestJS WebSocket gateway
- Add apps/server/ for REST API server
- Restructure desktop app (electron/ → src/main/, src/preload/)
- Update pnpm workspace configuration
- Remove legacy src/ directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing 2026-02-10 17:54:22 +08:00
parent 5ba8c87744
commit 6ef58a0cab
304 changed files with 5699 additions and 3635 deletions

21
apps/server/main.ts Normal file
View file

@ -0,0 +1,21 @@
import "reflect-metadata";
import { NestFactory } from "@nestjs/core";
import { Logger } from "nestjs-pino";
import { AppModule } from "./app.module.js";
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.enableCors();
app.useLogger(app.get(Logger));
const port = process.env["PORT"] ?? 4000;
await app.listen(port);
const logger = app.get(Logger);
logger.log(`Console is running on http://localhost:${port}`);
}
bootstrap().catch((err) => {
console.error("Failed to start console:", err);
process.exit(1);
});