Presence semantics
agent-presence counts agents that are actually working, not merely open terminal windows.
SessionStart / UserPromptSubmit / PreToolUse / PostToolUse -> running / heartbeatPi before_agent_start / turn_start / tool_execution_* -> running / heartbeatStop / SessionEnd / session.idle / agent_end / shutdown -> finishedNo heartbeat for 3 minutes -> expiredExpired + later live heartbeat -> running againLaptop sleep / lid close / screen sleep -> reset to 0finished is explicit and ignores late heartbeats. expired is TTL-inferred, so a later live heartbeat reopens the same session. Opening the Pi TUI alone is not counted — presence activates once you submit a task.