First vertical slice: Even client, bridge, contract v1, tests, docs
Client (apps/even-client): pure interaction reducer with generation-based stale-result rejection, HUD renderer, measured pagination, Even Hub SDK 0.0.16 adapter, bridge HTTP client, phone pairing/status/diagnostics page. Bridge (services/bridge): device pairing and revocable expiring credentials, turn engine with idempotent submit, cancel, deadlines and restart recovery, Hermes Runs API adapter, OpenAI-compatible STT adapter, operator CLI. Contract (packages/contracts): versioned schemas, types and error codes. Tests: 122 unit/integration (fakes), 6 simulator scenarios (Even Hub simulator 0.9.5), 9 scenarios against a real Hermes v0.23.1 gateway with a stub model. No real STT, real model or physical device has been exercised; see docs/test-evidence.md and docs/device-test-plan.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { LOG_REDACT, createBridge } from './app.ts';
|
||||
import { ConfigError, loadConfig } from './config.ts';
|
||||
import { loadEnvFile } from './env.ts';
|
||||
|
||||
async function main(): Promise<void> {
|
||||
loadEnvFile();
|
||||
const config = loadConfig();
|
||||
const bridge = await createBridge(config, {
|
||||
logger: { level: config.logLevel, redact: { paths: LOG_REDACT, censor: '[redacted]' } },
|
||||
});
|
||||
await bridge.app.listen({ host: config.host, port: config.port });
|
||||
|
||||
let closing = false;
|
||||
const stop = (signal: string) => {
|
||||
if (closing) return;
|
||||
closing = true;
|
||||
bridge.app.log.info({ signal }, 'bridge.stopping');
|
||||
bridge.close().then(
|
||||
() => process.exit(0),
|
||||
() => process.exit(1),
|
||||
);
|
||||
};
|
||||
process.on('SIGINT', () => stop('SIGINT'));
|
||||
process.on('SIGTERM', () => stop('SIGTERM'));
|
||||
}
|
||||
|
||||
main().catch((err: unknown) => {
|
||||
// Configuration problems are operator-facing; never print the environment.
|
||||
console.error(err instanceof ConfigError ? `Configuration error: ${err.message}` : err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user