Documentation
¶
Overview ¶
Package cronjob loads and runs workspace cronjob prompts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnDemandCronTarget ¶ added in v0.0.7
OnDemandCronTarget extracts one deterministic top-level cron target from connector text.
func ValidateRuntimeDefinitions ¶ added in v0.0.25
ValidateRuntimeDefinitions loads cron definitions from runtimeDir without mutating scheduler state.
Types ¶
type Manager ¶
type Manager struct {
SendTextChannel func(context.Context, string, string, string, string, string, []events.OutboundAttachment) error
// contains filtered or unexported fields
}
Manager loads and runs workspace cron definitions.
func New ¶
func New(workspace, runtimeDir string, bus *events.Bus, store cronScheduleStore, run RunFunc, logger *slog.Logger) *Manager
New constructs a cronjob manager using runtimeDir for effective runtime cron definitions.
func (*Manager) LoadOneOffCronjob ¶
func (m *Manager) LoadOneOffCronjob(target string) (OneOffCronjob, error)
LoadOneOffCronjob resolves and loads one live cronjob for a managed Slack thread run.
func (*Manager) RunOneOffCronjob ¶
func (m *Manager) RunOneOffCronjob(ctx context.Context, job OneOffCronjob, progress *harnessbridge.RawRunProgress, finish func(context.Context, RunResult, error))
RunOneOffCronjob executes a loaded cronjob once with optional progress delivery.
type OneOffCronjob ¶
type OneOffCronjob struct {
Agent, Prompt, RelativePath, TextChannel string
}
OneOffCronjob captures a live one-off cronjob prompt loaded from disk.
type RunFunc ¶
type RunFunc func(context.Context, string, string, *slog.Logger, *harnessbridge.RawRunProgress) (RunResult, error)
RunFunc executes one cronjob prompt and returns the cronjob result.
type RunResult ¶
type RunResult struct {
Text, VerbatimMessage string
Attachments []events.OutboundAttachment
}
RunResult captures the observable result of one cronjob run.