Files
hermeven/apps/even-client/src/device/port.ts
T
DanandClaude Fable 5.2 4687cc0114 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>
2026-11-18 18:21:49 -08:00

20 lines
965 B
TypeScript

import type { HudFrame } from '../core/hud.ts';
import type { DeviceEvent } from './events.ts';
/** Everything Hermeven needs from the glasses runtime. Implemented by the Even adapter and by test fakes. */
export interface DevicePort {
/** Create the HUD page. Resolves false when the host refused it. */
init(frame: HudFrame): Promise<boolean>;
/** Show a frame. Calls are serialised and coalesced; only the latest pending frame is sent. */
show(frame: HudFrame): void;
/** Open the glasses microphone. Resolves false when the host refused (for example no permission). */
startMic(): Promise<boolean>;
stopMic(): Promise<void>;
onEvent(listener: (event: DeviceEvent) => void): () => void;
onConnection(listener: (connected: boolean) => void): () => void;
/** Ask the OS to show its own exit confirmation. */
requestExit(): Promise<void>;
storageGet(key: string): Promise<string>;
storageSet(key: string, value: string): Promise<void>;
}