activity

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active(provider string) (string, bool, error)

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

func Clear(provider, sessionID string) error

Clear removes the marker for sessionID. Called on stop events. A missing marker is not an error.

func Enabled

func Enabled(provider string) bool

Enabled reports whether hook-based detection has been installed for provider.

func IsRunningEvent

func IsRunningEvent(event string) bool

IsRunningEvent reports whether a hook event means the session is mid-turn.

func IsStopEvent

func IsStopEvent(event string) bool

IsStopEvent reports whether a hook event means the session's turn ended.

func Mark

func Mark(provider, sessionID, event string) error

Mark records that sessionID for provider is mid-turn. Called on running events.

func SetEnabled

func SetEnabled(provider string, enabled bool) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL