Documentation
¶
Overview ¶
Package schedule parses cron expressions and runs the ledger's jobs when they come due. The parser handles standard five-field cron (minute hour day-of-month month day-of-week) plus a few @macros and an @every duration form, which covers what the agent and the cron command need without pulling in a dependency.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Tool ¶
Tool lets the agent schedule its own follow-up work. It is bound to one chat: the job it creates runs later as a background turn in this same conversation and delivers its result here. The router builds a fresh tool per turn so channel and chat always match the caller.
Scheduling writes a row to the ledger, so the tool is a write action and the policy gate treats it as one.
Types ¶
type Poster ¶
Poster pushes a message to a chat on its own, outside a reply. The scheduler needs it to deliver background results. A front door that can only answer when spoken to (the web chat, which has no durable client to push to) simply does not provide one, and its jobs run and record but deliver nothing.
type RunFunc ¶
RunFunc executes a job's prompt as a background turn and returns the assistant's text. The router supplies it.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler ticks once a minute, runs the jobs that have come due, records each run, and delivers any output to the job's channel.