Versions in this module Expand all Collapse all v1 v1.24.0 Oct 27, 2026 v1.23.0 Oct 27, 2026 Changes in this version + const DefaultTimeout + const EnvLastRun + const EnvName + const EnvStateDir + const MaxInterval + const MaxOutputBytes + const MaxRuns + const MaxStoredOutput + const MaxStoredResponse + const MaxStoredStderr + const MaxTimeout + const MinInterval + var ErrNotFound = errors.New("watcher not found") + var RunScript = runScript + func Clip(s string, max int) string + func ClipTail(s string, max int) string + func DefPath(r Ref) string + func Delete(r Ref) error + func Dir() string + func MutateState(fn func(*State) error) error + func NextDue(d Def, st *Status) time.Time + func ProjectDir(project string) string + func ProjectOf(dir string) string + func Prompt(d Def, res ScriptResult, at time.Time) string + func ReadScript(r Ref) (string, error) + func ScriptPath(r Ref) string + func StateDir(r Ref) string + func StatePath() string + func Summary(d Def, st *Status) string + func ValidName(name string) error + type Def struct + Agent string + Command string + CreatedAt time.Time + Cwd string + Description string + HasScript bool + Instructions string + Model string + Name string + Paused bool + Project string + Provider string + Schedule string + TimeoutSecs int + Workflow string + func Get(r Ref) (Def, error) + func List() []Def + func Resolve(project, name string) (Def, error) + func Save(old Ref, d Def, script *string) (Def, error) + func SetPaused(r Ref, paused bool) (Def, error) + func (d Def) ID() string + func (d Def) Ref() Ref + func (d Def) RunsLabel() string + func (d Def) Target() TargetKind + func (d Def) TargetLabel() string + func (d Def) Timeout() time.Duration + func (d Def) Validate() error + type Lead struct + func TryLead() (*Lead, error) + func (l *Lead) Release() + type Leader struct + PID int + Since time.Time + type Phase string + const PhaseApproval + const PhaseIdle + const PhaseModel + const PhaseScript + type Ref struct + Name string + Project string + func (r Ref) ID() string + type Run struct + CostKnown bool + CostUSD float64 + EndedAt time.Time + Error string + ExitCode int + ID string + Model string + Output string + OutputBytes int + Provider string + Response string + SessionCwd string + SessionID string + StartedAt time.Time + Status RunStatus + Stderr string + Target string + func (r Run) Finished() bool + type RunStatus string + const RunDone + const RunFailed + const RunRunning + const RunStopped + type Schedule struct + func ParseSchedule(s string) (Schedule, error) + func (s Schedule) IsInterval() bool + func (s Schedule) Next(lastEnd, anchor time.Time) time.Time + func (s Schedule) String() string + type ScriptResult struct + Cancelled bool + Err error + ExitCode int + Stderr string + Stdout string + StdoutBytes int + TimedOut bool + func (r ScriptResult) Failed() bool + func (r ScriptResult) FailureText() string + type ScriptSpec struct + Command string + Dir string + Env []string + Path string + Shell string + Timeout time.Duration + func SpecFor(d Def, shell string, lastCheck time.Time) ScriptSpec + type State struct + Leader Leader + Version int + Watchers map[string]*Status + func LoadState() (State, error) + func (s *State) Watcher(name string) *Status + func (s State) Clone() State + type StateStamp struct + ModTime time.Time + Size int64 + func CurrentStateStamp() (StateStamp, bool) + type Status struct + Activity string + Approval string + LastCheck time.Time + LastEnded time.Time + LastNote string + NextRun time.Time + Phase Phase + RunRequested time.Time + Runs []Run + SeenRun string + StopRequested string + func (st *Status) AddRun(r Run) + func (st *Status) LatestRun() (Run, bool) + func (st *Status) Unseen() bool + func (st *Status) UpdateRun(id string, fn func(*Run)) bool + type TargetKind int + const TargetAgent + const TargetChat + const TargetWorkflow