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 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:"list to see the schedule; add to create a job; remove to delete one"`
Cron string `` /* 156-byte string literal not displayed */
Prompt string `json:"prompt,omitempty" jsonschema:"The task to run when the schedule fires; required for add"`
ID string `json:"id,omitempty" jsonschema:"Job id; required for remove"`
Note string `json:"note,omitempty" jsonschema:"Optional context for your future self"`
}
type ScheduleOutput ¶
type ScheduleOutput struct {
Jobs []ScheduleEntry `json:"jobs"`
Instruction string `json:"instruction,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.