schedule

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSchedule

func NewSchedule(cfg ScheduleConfig, deps ScheduleDeps) (agentkit.ToolPack, error)

NewSchedule registers tool/schedule: Let the agent list, add and remove its own cron jobs.

Best practices:

  • Ids are assigned by the registry (agent-1, agent-2, ...); read them back with op=list before op=remove.
  • Needs a schedule registry that platform/worker also uses, or nothing will fire the jobs.

Types

type ScheduleConfig

type ScheduleConfig struct {
	// MaxJobs is cap on agent-created jobs, default 32; jobs declared in config do not count against it.
	MaxJobs int `json:"maxJobs"`
}

type ScheduleDeps

type ScheduleDeps struct {
	Schedule schedule.Registry `json:"schedule"`
}

type ScheduleEntry

type ScheduleEntry struct {
	ID       string `json:"id"`
	Cron     string `json:"cron"`
	Prompt   string `json:"prompt"`
	Source   string `json:"source"`
	Note     string `json:"note,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
	NextRun  string `json:"nextRun,omitempty"`
}

ScheduleEntry is one job as reported to the model, with the next fire time resolved so the agent can reason about it without parsing cron itself.

type ScheduleInput

type ScheduleInput struct {
	Op     string `json:"op" jsonschema:"required,description=list to see the schedule; add to create a job; remove to delete one"`
	Cron   string `` /* 158-byte string literal not displayed */
	Prompt string `json:"prompt" jsonschema:"description=The task to run when the schedule fires; required for add"`
	ID     string `json:"id" jsonschema:"description=Job id; required for remove"`
	Note   string `json:"note" jsonschema:"description=Optional context for your future self"`
}

type ScheduleOutput

type ScheduleOutput struct {
	Jobs        []ScheduleEntry `json:"jobs"`
	Instruction string          `json:"instruction,omitempty"`
}

Jump to

Keyboard shortcuts

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