scheduler

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTools

func NewTools(s *Service) []types.Tool

NewTools creates a set of tools for interacting with the scheduler service

func RegisterAgentTaskHandler

func RegisterAgentTaskHandler(s *xcron.Scheduler, agentExecutor func(input string) error)

RegisterAgentTaskHandler registers a handler for agent tasks Deprecated: Use InitAgent instead for built-in integration

Types

type DeleteJobTool

type DeleteJobTool struct {
	// contains filtered or unexported fields
}

func (*DeleteJobTool) Description

func (t *DeleteJobTool) Description() string

func (*DeleteJobTool) Execute

func (t *DeleteJobTool) Execute(ctx context.Context, input map[string]interface{}) (interface{}, error)

func (*DeleteJobTool) Metadata

func (t *DeleteJobTool) Metadata() types.ToolMetadata

func (*DeleteJobTool) Name

func (t *DeleteJobTool) Name() string

func (*DeleteJobTool) Schema

func (t *DeleteJobTool) Schema() map[string]interface{}

type ListJobsOptions added in v1.7.0

type ListJobsOptions struct {
	Status    []string
	Type      []string
	SessionID string
	OrderBy   string
	Limit     int
	Offset    int
}

ListJobsOptions defines filter and sort for listing jobs

type ListJobsTool

type ListJobsTool struct {
	// contains filtered or unexported fields
}

func (*ListJobsTool) Description

func (t *ListJobsTool) Description() string

func (*ListJobsTool) Execute

func (t *ListJobsTool) Execute(ctx context.Context, input map[string]interface{}) (interface{}, error)

func (*ListJobsTool) Metadata

func (t *ListJobsTool) Metadata() types.ToolMetadata

func (*ListJobsTool) Name

func (t *ListJobsTool) Name() string

func (*ListJobsTool) Schema

func (t *ListJobsTool) Schema() map[string]interface{}

type ScheduleJobInput

type ScheduleJobInput struct {
	Name          string      `json:"name"`
	Type          string      `json:"type"`
	SessionID     string      `json:"session_id"`
	Schedule      string      `json:"schedule"`
	Payload       interface{} `json:"payload"`
	TaskType      string      `json:"task_type"`
	ExecutionMode string      `json:"execution_mode"` // "serial" to run one-at-a-time with other serial jobs
}

ScheduleJobInput defines the input for scheduling a job

type ScheduleJobTool

type ScheduleJobTool struct {
	// contains filtered or unexported fields
}

func (*ScheduleJobTool) Description

func (t *ScheduleJobTool) Description() string

func (*ScheduleJobTool) Execute

func (t *ScheduleJobTool) Execute(ctx context.Context, input map[string]interface{}) (interface{}, error)

func (*ScheduleJobTool) Metadata

func (t *ScheduleJobTool) Metadata() types.ToolMetadata

func (*ScheduleJobTool) Name

func (t *ScheduleJobTool) Name() string

func (*ScheduleJobTool) Schema

func (t *ScheduleJobTool) Schema() map[string]interface{}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(s *xcron.Scheduler) *Service

NewService creates a new scheduler service

func (*Service) ConfigureAgent

func (s *Service) ConfigureAgent(
	llmProvider types.LLMProvider,
	config *types.AgentConfig,
	memory types.MemoryProvider,
	toolRegistry *tools.Registry,
	skillRegistry *skills.Registry,
)

ConfigureAgent configures the base components for building agents for scheduled tasks

func (*Service) ConfigureAgentWithMemoryFactory

func (s *Service) ConfigureAgentWithMemoryFactory(
	llmProvider types.LLMProvider,
	config *types.AgentConfig,
	memoryFactory func(sessionID string) types.MemoryProvider,
	toolRegistry *tools.Registry,
	skillRegistry *skills.Registry,
)

ConfigureAgentWithMemoryFactory allows associating per-session memory via factory

func (*Service) DeleteJob

func (s *Service) DeleteJob(ctx context.Context, jobID string) error

DeleteJob removes a job

func (*Service) ListJobs

func (s *Service) ListJobs(ctx context.Context, limit, offset int) ([]*xcron.Job, int64, error)

ListJobs returns a list of scheduled jobs

func (*Service) ListJobsWithOptions added in v1.7.0

func (s *Service) ListJobsWithOptions(ctx context.Context, opts ListJobsOptions) ([]*xcron.Job, int64, error)

ListJobsWithOptions returns jobs with filter and sort

func (*Service) ScheduleJob

func (s *Service) ScheduleJob(ctx context.Context, input ScheduleJobInput) (string, error)

ScheduleJob schedules a new job

func (*Service) StopJob

func (s *Service) StopJob(ctx context.Context, jobID string) error

type StopJobTool

type StopJobTool struct {
	// contains filtered or unexported fields
}

func (*StopJobTool) Description

func (t *StopJobTool) Description() string

func (*StopJobTool) Execute

func (t *StopJobTool) Execute(ctx context.Context, input map[string]interface{}) (interface{}, error)

func (*StopJobTool) Metadata

func (t *StopJobTool) Metadata() types.ToolMetadata

func (*StopJobTool) Name

func (t *StopJobTool) Name() string

func (*StopJobTool) Schema

func (t *StopJobTool) Schema() map[string]interface{}

Jump to

Keyboard shortcuts

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