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,34 @@
|
||||
// Writes dist-manifest/app.json from app.template.json.
|
||||
//
|
||||
// Even Hub enforces a per-app network whitelist of exact origins, so the bridge
|
||||
// origin has to be in the packaged manifest. It is supplied at build time and is
|
||||
// never committed: no deployment hostname lives in this repository.
|
||||
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url));
|
||||
const raw = process.env.HERMEVEN_BRIDGE_ORIGIN ?? '';
|
||||
if (!raw) {
|
||||
console.warn('[manifest] HERMEVEN_BRIDGE_ORIGIN is not set: skipping app.json. Set it before `npm run pack`.');
|
||||
process.exit(0);
|
||||
}
|
||||
let origin;
|
||||
try {
|
||||
origin = new URL(raw).origin;
|
||||
} catch {
|
||||
console.error('[manifest] HERMEVEN_BRIDGE_ORIGIN is not a URL.');
|
||||
process.exit(1);
|
||||
}
|
||||
if (origin !== raw) {
|
||||
console.error(`[manifest] HERMEVEN_BRIDGE_ORIGIN must be a bare origin (scheme://host[:port]), got a path or trailing slash.`);
|
||||
process.exit(1);
|
||||
}
|
||||
if (!origin.startsWith('https://')) {
|
||||
console.warn('[manifest] The bridge origin is not https. Acceptable only for a local development build.');
|
||||
}
|
||||
const template = readFileSync(resolve(here, '../app.template.json'), 'utf8');
|
||||
const out = resolve(here, '../dist-manifest/app.json');
|
||||
mkdirSync(dirname(out), { recursive: true });
|
||||
writeFileSync(out, template.replace('__HERMEVEN_BRIDGE_ORIGIN__', origin));
|
||||
console.log(`[manifest] wrote ${out}`);
|
||||
Reference in New Issue
Block a user