Documentation
¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
SPDX-License-Identifier: AGPL-3.0-only
Index ¶
- func CreateLogger(cfg *config.Config) (*logging.Logger, error)
- type AITaskParams
- type MCPServer
- func (s *MCPServer) Done() <-chan struct{}
- func (s *MCPServer) Execute(ctx context.Context, task *model.Task, timeout time.Duration) error
- func (s *MCPServer) GetTaskResult(taskID string) (*model.Result, bool)
- func (s *MCPServer) GetTaskResults(taskID string, limit int) ([]*model.Result, error)
- func (s *MCPServer) Start(ctx context.Context) error
- func (s *MCPServer) Stop() error
- type QueryTaskResultParams
- type TaskIDParams
- type TaskParams
- type TaskResultParams
- type ToolDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AITaskParams ¶
type AITaskParams struct {
TaskParams
Prompt string `json:"prompt" description:"prompt for the AI to execute (required for AI tasks)"`
}
AITaskParams combines task parameters with AI-specific parameters
type MCPServer ¶
type MCPServer struct {
// contains filtered or unexported fields
}
MCPServer represents the MCP scheduler server
func NewMCPServer ¶
func NewMCPServer(cfg *config.Config, scheduler *scheduler.Scheduler, cmdExecutor *command.CommandExecutor, agentExecutor *agent.AgentExecutor, resultStore model.ResultStore, logger *logging.Logger) (*MCPServer, error)
NewMCPServer creates a new MCP scheduler server
func (*MCPServer) Done ¶ added in v0.1.2
func (s *MCPServer) Done() <-chan struct{}
Done returns a channel that is closed when the server's transport exits. For stdio mode, this fires when stdin is closed (parent process exited).
func (*MCPServer) Execute ¶
Execute implements the taskexec.Executor interface by routing tasks to the appropriate executor
func (*MCPServer) GetTaskResult ¶
GetTaskResult retrieves the latest execution result for a task.
func (*MCPServer) GetTaskResults ¶
GetTaskResults retrieves multiple execution results for a task.
type QueryTaskResultParams ¶ added in v0.8.0
type QueryTaskResultParams struct {
SQL string `json:"sql" description:"SQL SELECT query to execute against the database"`
}
QueryTaskResultParams holds parameters for the query_task_result tool
type TaskIDParams ¶
type TaskIDParams struct {
ID string `json:"id" description:"the ID of the task to get/remove/enable/disable"`
}
TaskIDParams holds the ID parameter used by multiple handlers
type TaskParams ¶
type TaskParams struct {
ID string `json:"id,omitempty" description:"task ID"`
Name string `json:"name" description:"task name (required)"`
Schedule string `` /* 169-byte string literal not displayed */
Type string `json:"type,omitempty" description:"task type: 'shell_command' or 'AI'"`
Command string `json:"command,omitempty" description:"shell command to execute (required for shell_command tasks)"`
Description string `json:"description,omitempty" description:"task description"`
Enabled bool `json:"enabled,omitempty" description:"whether the task is enabled (defaults to false; set to true to activate immediately)"`
}
TaskParams holds parameters for various task operations
type TaskResultParams ¶
type TaskResultParams struct {
ID string `json:"id" description:"the ID of the task to get results for"`
Limit int `json:"limit,omitempty" description:"number of recent results to return (default 1, max 100)"`
}
TaskResultParams holds parameters for the get_task_result tool
type ToolDefinition ¶
type ToolDefinition struct {
// Name is the name of the tool
Name string
// Description is a brief description of what the tool does
Description string
// Handler is the function that will be called when the tool is invoked
Handler func(context.Context, *mcp.CallToolRequest) (*mcp.CallToolResult, error)
// Parameters is the parameter schema for the tool (can be a struct)
Parameters interface{}
}
ToolDefinition represents a tool that can be registered with the MCP server