|
| 1 | +# `@agenter/web-heartbeat-view` SPEC |
| 2 | + |
| 3 | +This document records durable package-level law for the Heartbeat presentation atom. |
| 4 | + |
| 5 | +## 1. Package Role |
| 6 | + |
| 7 | +`@agenter/web-heartbeat-view` owns the reusable Heartbeat runtime observation surface. |
| 8 | + |
| 9 | +It owns: |
| 10 | + |
| 11 | +- grouped Heartbeat presentation over existing runtime-store facts |
| 12 | +- parser/materialization helpers for grouped `before-call`, `call`, `compact`, and `before-call-pending` records |
| 13 | +- structured rendering for text, thinking, JSON/config facts, tool calls/results, compact cards, and footer status |
| 14 | +- explicit `readonly | configable` capability presentation |
| 15 | +- host-neutral `AgenterHeartbeatConnection` types |
| 16 | + |
| 17 | +It does not own: |
| 18 | + |
| 19 | +- backend Heartbeat truth or new backend endpoints |
| 20 | +- Studio route/controller state |
| 21 | +- example app routing/bootstrap |
| 22 | +- authentication or authorization policy |
| 23 | + |
| 24 | +## 2. Truth Boundary |
| 25 | + |
| 26 | +Heartbeat truth remains the grouped runtime/session DB projection supplied by `@agenter/client-sdk`. |
| 27 | + |
| 28 | +The package must not rebuild Heartbeat truth from raw chat, raw `request_aux`, raw `heartbeat_part`, or model-call histories in the browser. |
| 29 | + |
| 30 | +## 3. Capability Boundary |
| 31 | + |
| 32 | +`readonly` is a frontend presentation mode that keeps the surface clean by hiding compact/config write controls. |
| 33 | + |
| 34 | +`configable` may expose bottom-statusbar compact/config actions, but those actions must call explicit host callbacks. |
| 35 | + |
| 36 | +Transport isolation belongs to authentication and authorization, not to the package's presentation mode. |
| 37 | + |
| 38 | +## 4. Host Boundary |
| 39 | + |
| 40 | +The package must not import `apps/studio`. Studio may later import this package through a thin adapter after standalone example acceptance. |
| 41 | + |
| 42 | +Framework7 page wrappers are optional host conveniences; the core `HeartbeatView` remains host-neutral. |
| 43 | + |
| 44 | +## 5. Verification Contract |
| 45 | + |
| 46 | +High-value package verification requires: |
| 47 | + |
| 48 | +- `bun run --filter '@agenter/web-heartbeat-view' typecheck` |
| 49 | +- `bun run --filter '@agenter/web-heartbeat-view' test` |
| 50 | + |
| 51 | +Standalone user acceptance belongs to `packages/web-heartbeat-view/example`. |
0 commit comments