2026-09-24 15:09:37 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 本地启动平台服务:node server/dist/bin/serve.js(或 pnpm dev:server)。
|
2026-09-28 16:01:04 +08:00
|
|
|
|
* 配置来源见 ADR-0011:环境变量 > ~/.aps/config.json > 默认值。
|
2026-09-24 15:09:37 +08:00
|
|
|
|
*/
|
2026-09-28 16:01:04 +08:00
|
|
|
|
import { loadConfig, isEngineConfigured, redactConfig } from '../config.js';
|
2026-09-24 15:09:37 +08:00
|
|
|
|
import { startServer } from '../index.js';
|
|
|
|
|
|
|
2026-09-28 16:01:04 +08:00
|
|
|
|
const config = loadConfig();
|
|
|
|
|
|
const server = await startServer({ host: config.server.host, port: config.server.port });
|
2026-09-24 15:09:37 +08:00
|
|
|
|
|
|
|
|
|
|
console.log(`平台服务已启动:${server.url}(协议 v1)`);
|
|
|
|
|
|
console.log(`健康检查:${server.url}/v1/health`);
|
2026-09-28 16:01:04 +08:00
|
|
|
|
console.log(`配置:${JSON.stringify(redactConfig(config))}`);
|
|
|
|
|
|
console.log(isEngineConfigured(config) ? '模型:已配置(真引擎在 A3.3 接入)' : '模型:未配置,当前走假引擎');
|
2026-09-24 15:09:37 +08:00
|
|
|
|
|
|
|
|
|
|
for (const signal of ['SIGINT', 'SIGTERM'] as const) {
|
|
|
|
|
|
process.on(signal, () => {
|
|
|
|
|
|
void server.close().then(() => process.exit(0));
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|