agent-orchestrator/backend/internal/domain/activity.go

28 lines
852 B
Go

package domain
import "time"
// ActivityState is how busy the agent is, derived from its output/JSONL.
type ActivityState string
// Activity states. WaitingInput is sticky (see IsSticky).
const (
ActivityActive ActivityState = "active"
ActivityIdle ActivityState = "idle"
ActivityWaitingInput ActivityState = "waiting_input"
ActivityExited ActivityState = "exited"
)
// IsSticky reports whether an activity state must NOT be aged/demoted by the
// passage of time (a paused agent is still paused until a new signal says so).
func (a ActivityState) IsSticky() bool {
return a == ActivityWaitingInput
}
// Activity captures the persisted activity reading: the state and when it was
// last observed.
type Activity struct {
State ActivityState `json:"state"`
LastActivityAt time.Time `json:"lastActivityAt"`
}