Log records a command invocation with "command attempted" semantics — it fires
immediately after flag validation, before the underlying operation completes.
Skips silently if TTAL_AGENT_NAME is not set. Never fails the caller.
Summary returns usage counts for an agent since a given time, grouped by subcommand and target.
Returns (nil, err) if the database is unavailable (e.g., daemon has not yet run); callers
should treat this as non-fatal and fall back gracefully.