cronjob

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 18 Imported by: 0

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

func OnDemandCronTarget(text string, prefixes ...string) (string, bool)

OnDemandCronTarget extracts one deterministic top-level cron target from connector text.

func ValidateRuntimeDefinitions added in v0.0.25

func ValidateRuntimeDefinitions(workspace, runtimeDir string) error

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.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start loads cron definitions and starts scheduling them.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop shuts the cron manager down.

type OneOffCronjob

type OneOffCronjob struct {
	Agent, Prompt, RelativePath, TextChannel string
}

OneOffCronjob captures a live one-off cronjob prompt loaded from disk.

type RunFunc

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.

Jump to

Keyboard shortcuts

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