Documentation
¶
Overview ¶
Package activity tracks whether a provider's CLI session is mid-turn, using signals written by limitping's hook command (see `limitping hook`). It is the hook-based replacement for process scanning: a session counts as active only between a prompt submission and the turn's Stop, not merely because the CLI process exists.
State lives under config.Dir()/activity:
activity/<provider>/<session>.json per-session marker {event, updated_at}
activity/<provider>.enabled sentinel: trust the hook signal
Index ¶
- func Active(provider string) (string, bool, error)
- func Clear(provider, sessionID string) error
- func Enabled(provider string) bool
- func IsRunningEvent(event string) bool
- func IsStopEvent(event string) bool
- func Mark(provider, sessionID, event string) error
- func SetEnabled(provider string, enabled bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Active ¶
Active reports whether any session of provider is mid-turn. A marker counts as live when its recorded time is within activityTTL and its event is a running event; stale markers are pruned opportunistically.
func Clear ¶
Clear removes the marker for sessionID. Called on stop events. A missing marker is not an error.
func IsRunningEvent ¶
IsRunningEvent reports whether a hook event means the session is mid-turn.
func IsStopEvent ¶
IsStopEvent reports whether a hook event means the session's turn ended.
func SetEnabled ¶
SetEnabled creates or removes the provider's sentinel, marking whether the hook signal should be trusted over the process-scan fallback.
Types ¶
This section is empty.