routines

package
v0.30.20 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const RunStatusRecorded = "recorded"

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

Types

type AddRequest

type AddRequest struct {
	Schedule string
	Prompt   string
	CWD      string
	Provider string
}

type Definition

type Definition struct {
	ID        string       `json:"id"`
	Schedule  string       `json:"schedule"`
	Prompt    string       `json:"prompt"`
	CWD       string       `json:"cwd,omitempty"`
	Provider  string       `json:"provider,omitempty"`
	Paused    bool         `json:"paused"`
	CreatedAt time.Time    `json:"createdAt"`
	UpdatedAt time.Time    `json:"updatedAt"`
	LastRun   *RunMetadata `json:"lastRun,omitempty"`
}

type Run

type Run struct {
	ID        string    `json:"id"`
	RoutineID string    `json:"routineId"`
	Status    string    `json:"status"`
	Prompt    string    `json:"prompt"`
	CWD       string    `json:"cwd,omitempty"`
	Provider  string    `json:"provider,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
}

type RunMetadata

type RunMetadata struct {
	RunID  string    `json:"runId"`
	Status string    `json:"status"`
	At     time.Time `json:"at"`
}

type Store

type Store struct {
	Definitions map[string]Definition `json:"definitions"`
	Runs        map[string]Run        `json:"runs"`
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Store, error)

func LoadDefault

func LoadDefault() (*Store, error)

func (*Store) Add

func (s *Store) Add(req AddRequest) (Definition, error)

func (*Store) Get

func (s *Store) Get(id string) (Definition, bool)

func (*Store) List

func (s *Store) List() []Definition

func (*Store) Pause

func (s *Store) Pause(id string) error

func (*Store) Remove

func (s *Store) Remove(id string) error

func (*Store) Resume

func (s *Store) Resume(id string) error

func (*Store) RunManual

func (s *Store) RunManual(id string) (Run, error)

func (*Store) RunsForRoutine

func (s *Store) RunsForRoutine(id string) []Run

func (*Store) Save

func (s *Store) Save() error

Jump to

Keyboard shortcuts

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