Architecture
One Node process, one SQLite file, a channel to each paired daemon, and sources Console reads.
browser or script ── HTTP + one WebSocket (/api/v1/live) ──► Console server (Node >= 22.13)
│ SQLite: <home>/console.db (WAL)
│ identity: keychain, or identity.json (0600)
┌──────────────────────────┬───────────────────────────┼─────────────────────────┐
▼ ▼ ▼ ▼
daemons (Noise, L3) HITL gates Evals results dirs receipt chains
Direct or Relay signed deliveries in, served as static JSONL files or HITL
signed reviews out files, read-only stores, read-onlyThe encrypted channel to a daemon ends in the Console server, not in the browser. A daemon is paired once per Console install. The inbox spans every daemon and gate, and history stays readable when a daemon goes offline.
Components
| Component | Does |
|---|---|
DaemonHub | One connection per paired daemon: reconnect with backoff, the session list kept live by session.updated, event streams subscribed while someone watches (60 s linger), a cache that tracks which seqs it holds and fills gaps |
Inbox | Merges daemon approvals and HITL deliveries into one item model; answers go through a durable outbox |
Sources | Evals results directories, receipt chains, trajectory stores, HITL gates and HITL stores |
Auth | Local sign-in, proxy identity proofs, named scoped tokens, roles and tenant scope |
| Live gateway | The browser WebSocket: topics, per-socket backpressure |
| API | Hono routes, Fetch-native: app.fetch mounts anywhere |
Daemons through one interface
Console talks to daemons only through DaemonTransport: send a request, get its result, receive pushes, watch
the connection state. Two implementations exist. One is the daemon's own client (Noise over Direct or Relay, plus
the local socket for pairing). The other is inProcessDaemon(supervisor), which tests and examples use. One
contract suite (describeDaemonTransport in @viewportai/console/testing/vitest) runs against both.
Storage
| Table | Holds | Kept |
|---|---|---|
daemons | Pairings, relay tokens sealed | Until unpaired |
sessions | Latest SessionInfo per session, applied only when last_seq is not lower | 30 days after Console saw it end (by its own clock); a pruned session is not taken back |
events | Cached session events by (daemon, session, seq), plus which seqs are held | With the session; output capped at 50 MB per session |
inbox, outbox | Items, answers, exact bytes sent | 90 days after resolution |
receipts | Console's hash chains, one per tenant | Never deleted by Console |
Retention runs at start and then every hour; retention: { sessions_days, inbox_days } in console.yaml changes
the 30 and 90 days.
Per-daemon quotas keep one bad daemon from crowding out others: 10,000 cached sessions, 200 pending inbox items, 500 MB of cached events and a write-rate limit.
Runs from durable runtimes
Agents on a durable runtime write their trajectories with core's durableTrace to a trajectory store. A
trajectories source reads them back stitched across processes and episodes:
/** One execution of the workflow body. The same code runs in each process; core seeds ids per episode. */
async function episode(store: string, episodeId: string): Promise<void> {
await durableTrace(
async () => {
if (episodeId === "ep_1") {
emit({
type: "tool_call",
tool_name: "lookup_order",
args: { order_id: "A-1002" },
result: { total: 900 },
} as never);
emit({
type: "suspend",
wait_id: "apr_refund_A-1002",
wait_for: "approval",
reason: "Refunds need a human",
} as never);
} else {
emit({ type: "resume", wait_id: "apr_refund_A-1002", reason: "approved by console:dana" } as never);
emit({
type: "tool_call",
tool_name: "issue_refund",
args: { order_id: "A-1002", amount: 900 },
result: "R-1002",
} as never);
}
},
{ store: jsonl(store), trajectoryId: "run_refund_A-1002", episodeId, tenant: "acme" },
);
}const { source } = await app.sources.add({ kind: "trajectories", dir: store, name: "refunds" });
const listening = await app.listen({ port: 0 });
const { token } = await app.tokens.create("reader", ["read"], ["acme"]); // a reader scoped to tenant acme
const vc = await connect({ url: listening.url, token });
const [summary] = await vc.runs.list({ source_id: source.id });
const run = await vc.runs.get(source.id, "run_refund_A-1002");
console.log(`Run ${summary?.trajectory_id}: ${run.status}, ${run.episodes} episodes`);
for (const e of run.trajectory.events)
console.log(` ${e.episode_id} ${e.type}${"tool_name" in e ? ` ${e.tool_name}` : ""}`);