import { bootstrap } from "./bootstrap";
import { readRuntimeConfig } from "./config";
import { createConsoleFallback } from "./logger";
import { readAppVersion } from "./version";

async function main() {
  const { configPath } = readRuntimeConfig();
  const version = await readAppVersion();
  await bootstrap({ configPath, mode: "production", version });
}

void main().catch((error) => {
  createConsoleFallback().fatal(`启动失败: ${error instanceof Error ? error.message : String(error)}`);
  process.exit(1);
});
