Console

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-only

The 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

ComponentDoes
DaemonHubOne 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
InboxMerges daemon approvals and HITL deliveries into one item model; answers go through a durable outbox
SourcesEvals results directories, receipt chains, trajectory stores, HITL gates and HITL stores
AuthLocal sign-in, proxy identity proofs, named scoped tokens, roles and tenant scope
Live gatewayThe browser WebSocket: topics, per-socket backpressure
APIHono 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

TableHoldsKept
daemonsPairings, relay tokens sealedUntil unpaired
sessionsLatest SessionInfo per session, applied only when last_seq is not lower30 days after Console saw it end (by its own clock); a pruned session is not taken back
eventsCached session events by (daemon, session, seq), plus which seqs are heldWith the session; output capped at 50 MB per session
inbox, outboxItems, answers, exact bytes sent90 days after resolution
receiptsConsole's hash chains, one per tenantNever 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:

examples/ts/browse-durable-run/main.ts
/** 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" },
  );
}
examples/ts/browse-durable-run/main.ts
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}` : ""}`);

On this page