feat(cli): wire mode dispatch ke server interfaces — --api/--ws/--grpc/--web start server; add tsconfig paths
This commit is contained in:
@@ -11,7 +11,11 @@
|
||||
"dependencies": {
|
||||
"@zesdex/domain": "workspace:*",
|
||||
"@zesdex/application": "workspace:*",
|
||||
"@zesdex/infrastructure": "workspace:*"
|
||||
"@zesdex/infrastructure": "workspace:*",
|
||||
"@zesdex/api": "workspace:*",
|
||||
"@zesdex/ws": "workspace:*",
|
||||
"@zesdex/grpc": "workspace:*",
|
||||
"@zesdex/web": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.2.0"
|
||||
|
||||
@@ -127,23 +127,36 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
if (opts.daemon) {
|
||||
console.info("daemon mode not yet wired (Fase 5) — falling back to REPL");
|
||||
console.info("daemon mode not yet wired — falling back to REPL");
|
||||
await runRepl();
|
||||
} else if (opts.attach !== null) {
|
||||
console.info(`attach mode for session '${opts.attach}' not yet wired (Fase 5)`);
|
||||
console.info(`attach mode for session '${opts.attach}' not yet wired`);
|
||||
process.exit(1);
|
||||
} else if (opts.api) {
|
||||
console.info(`api mode port ${opts.apiPort} not yet wired (Fase 5)`);
|
||||
process.exit(1);
|
||||
const { newApiState, startApiServer } = await import("@zesdex/api");
|
||||
const baseDir =
|
||||
process.env.ZESDEX_STORE ?? path.join(os.homedir(), ".local", "share", "zesdex");
|
||||
const state = newApiState(
|
||||
baseDir,
|
||||
process.env.ZESDEX_JWT_SECRET ?? "dev-secret-change-me",
|
||||
process.env.OPENAI_API_KEY ?? "",
|
||||
process.env.ZESDEX_MODEL ?? "claude-opus-5",
|
||||
process.env.OPENAI_API_BASE ?? undefined,
|
||||
);
|
||||
startApiServer(state, opts.apiPort);
|
||||
await new Promise(() => {});
|
||||
} else if (opts.ws) {
|
||||
console.info(`ws mode port ${opts.wsPort} not yet wired (Fase 5)`);
|
||||
process.exit(1);
|
||||
const { startWsServer } = await import("@zesdex/ws");
|
||||
startWsServer(opts.wsPort);
|
||||
await new Promise(() => {});
|
||||
} else if (opts.grpc) {
|
||||
console.info(`grpc mode port ${opts.grpcPort} not yet wired (Fase 5)`);
|
||||
process.exit(1);
|
||||
const { startGrpcServer } = await import("@zesdex/grpc");
|
||||
startGrpcServer(opts.grpcPort);
|
||||
await new Promise(() => {});
|
||||
} else if (opts.web) {
|
||||
console.info(`web mode port ${opts.webPort} not yet wired (Fase 5)`);
|
||||
process.exit(1);
|
||||
const { startWebServer } = await import("@zesdex/web");
|
||||
startWebServer(opts.webPort, process.env.ZESDEX_WEB_DIR ?? undefined);
|
||||
await new Promise(() => {});
|
||||
} else {
|
||||
// Default: single-process REPL.
|
||||
await runRepl();
|
||||
|
||||
Reference in New Issue
Block a user