diff --git a/web/src/types.ts b/web/src/types.ts index 3f15719..c03aebd 100644 --- a/web/src/types.ts +++ b/web/src/types.ts @@ -9,8 +9,9 @@ export type IsoTimestamp = string; export type SessionStatus = "Running" | "Dead"; /** Daemon-inferred activity dimension, orthogonal to `SessionStatus` (NAP-340). - * Absent on payloads from daemons that predate the field. */ -export type ActivityState = "Active" | "Idle" | "AwaitingInput"; + * Absent on payloads from daemons that predate the field. `Error` is only set + * when an agent reports failure (#105); the daemon never infers it. */ +export type ActivityState = "Active" | "Idle" | "AwaitingInput" | "Error"; export interface Session { id: Uuid; @@ -27,6 +28,11 @@ export interface Session { activity?: ActivityState; /** Wall-clock of the most recent observed PTY output (NAP-340). */ last_activity_at?: IsoTimestamp; + /** Wall-clock of when the session entered its current `activity` state + * (#102) — distinct from `last_activity_at`, which only tracks PTY output. + * Defaults to the Unix epoch on payloads from daemons that predate the + * field. */ + activity_since?: IsoTimestamp; /** The pane's *current* working directory, as the daemon's activity watcher * observed it (`#{pane_current_path}`) — distinct from `cwd` (the spawn dir). * Drives the directory-based session tree. Absent until first observed. */