Documentation
¶
Overview ¶
Package app implements use cases shared by agentcron's interfaces.
Index ¶
- func AddJob(ctx context.Context, opts Options, c clock.Clock, j Job, dry bool) (string, error)
- func ApproveJob(ctx context.Context, opts Options, c clock.Clock, name string) error
- func BoundedError(err error) error
- func CancelRun(ctx context.Context, opts Options, c clock.Clock, id string) error
- func CheckMCPWrite(opts Options) error
- func DefaultMemory(opts Options) (bool, error)
- func ErrorText(err error) string
- func Init(ctx context.Context, opts Options) error
- func LogTail(ctx context.Context, opts Options, c clock.Clock, id string, stderr bool) (string, error)
- func Logs(ctx context.Context, opts Options, c clock.Clock, id string, ...) error
- func Memory(ctx context.Context, opts Options, name string) (string, error)
- func PauseJob(ctx context.Context, opts Options, c clock.Clock, name string, paused bool) error
- func QueueMessage(opts Options) string
- func RemoveJob(ctx context.Context, opts Options, c clock.Clock, name string, dry bool) error
- func Schedule(ctx context.Context, opts Options, c clock.Clock, loop bool, noWait bool, ...) error
- func Service(ctx context.Context, opts Options, action string, dry bool, target string) (any, error)
- type Error
- type ExitCode
- type Fire
- type Health
- type Job
- type JobDetail
- type JobView
- type Options
- type Run
- func EnqueueMCPRun(ctx context.Context, opts Options, c clock.Clock, name string) (Run, error)
- func Prune(ctx context.Context, opts Options, c clock.Clock, dry, force bool) ([]Run, error)
- func RunJob(ctx context.Context, opts Options, c clock.Clock, name string, now, wait bool) (Run, error)
- func Runs(ctx context.Context, opts Options, c clock.Clock, job, state string, limit int) ([]Run, error)
- func Worktrees(ctx context.Context, opts Options, c clock.Clock) ([]Run, error)
- type RunOutput
- type TUI
- func (a TUI) Approve(ctx context.Context, name string) error
- func (a TUI) Cancel(ctx context.Context, id string) error
- func (a TUI) DaemonRunning(context.Context) (bool, error)
- func (a TUI) Enqueue(ctx context.Context, name string) error
- func (a TUI) Jobs(ctx context.Context) ([]JobView, error)
- func (a TUI) Pause(ctx context.Context, name string, paused bool) error
- func (a TUI) Runs(ctx context.Context, name string) ([]Run, error)
- func (a TUI) Tail(ctx context.Context, id string, stderr bool) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproveJob ¶
ApproveJob enables firing and resumes an agent-created job; repeated approval is harmless.
func BoundedError ¶
func CheckMCPWrite ¶
CheckMCPWrite prevents a scheduled agent from recursively changing schedules.
func DefaultMemory ¶
DefaultMemory enables new jobs only when their configured mdkb is present.
func ErrorText ¶
ErrorText bounds displayed diagnostics, including echoed user input. Keep the original error for exit codes and errors.Is/errors.As.
func Init ¶
Init creates directories, default settings and the ledger, preserving existing settings.
func LogTail ¶
func LogTail(ctx context.Context, opts Options, c clock.Clock, id string, stderr bool) (string, error)
LogTail reads at most 64 KiB from the end of a ledger run's output.
func QueueMessage ¶
Types ¶
type Health ¶
type Health struct {
Service service.State `json:"service"`
DaemonPID int `json:"daemon_pid"`
ConfigDir bool `json:"config_dir"`
DataDir bool `json:"data_dir"`
SchemaVersion int `json:"schema_version"`
Git bool `json:"git"`
Claude bool `json:"claude"`
Codex bool `json:"codex"`
MDKB bool `json:"mdkb"`
MDKBVersion string `json:"mdkb_version"`
KBRoot string `json:"kb_root"`
KBInitialised bool `json:"kb_initialised"`
Warnings []string `json:"warnings,omitempty"`
ConfigPath string `json:"-"`
DataPath string `json:"-"`
}
type JobDetail ¶
type JobDetail struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
Job Job `json:"job"`
State store.JobState `json:"state"`
Next []time.Time `json:"next"`
Runs []store.Run `json:"runs"`
}
func CreateMCPJob ¶
type JobView ¶
type RunOutput ¶
type TUI ¶
TUI exposes the interactive use cases without exposing storage or runner internals.
func (TUI) DaemonRunning ¶
DaemonRunning uses the same lock-holder check as Doctor, without invoking service tools.