Documentation
¶
Index ¶
- type AgentAdapterService
- type AgentTaskAdapter
- type AgentTaskService
- func (s *AgentTaskService) AddTaskStep(ctx context.Context, description string) error
- func (s *AgentTaskService) CreateTask(ctx context.Context, title, desc string, userID string, ...) (*Task, error)
- func (s *AgentTaskService) CurrentTask() *Task
- func (s *AgentTaskService) FormatTaskProgress() string
- func (s *AgentTaskService) GetTask(ctx context.Context, taskID string) (*Task, error)
- func (s *AgentTaskService) ListTasks(ctx context.Context, userID string) ([]*Task, error)
- func (s *AgentTaskService) LogTaskDebug(ctx context.Context, message string) error
- func (s *AgentTaskService) LogTaskError(ctx context.Context, message string) error
- func (s *AgentTaskService) LogTaskInfo(ctx context.Context, message string) error
- func (s *AgentTaskService) ResetCurrentTask()
- func (s *AgentTaskService) StartTask(ctx context.Context, taskID string) (*Task, error)
- func (s *AgentTaskService) UpdateTaskStatus(ctx context.Context, status Status) error
- func (s *AgentTaskService) UpdateTaskStep(ctx context.Context, stepID string, status Status, output string, err error) error
- type ApproveTaskPlanRequest
- type CreateTaskRequest
- type LogEntry
- type Plan
- type SimpleBridgeAdapter
- func (a *SimpleBridgeAdapter) AddTaskLog(ctx context.Context, taskID string, message string, level string) error
- func (a *SimpleBridgeAdapter) ApproveTaskPlan(ctx context.Context, taskID string, req ApproveTaskPlanRequest) (*Task, error)
- func (a *SimpleBridgeAdapter) CreateTask(ctx context.Context, req CreateTaskRequest) (*Task, error)
- func (a *SimpleBridgeAdapter) GetTask(ctx context.Context, taskID string) (*Task, error)
- func (a *SimpleBridgeAdapter) ListTasks(ctx context.Context, filter TaskFilter) ([]*Task, error)
- func (a *SimpleBridgeAdapter) UpdateTask(ctx context.Context, taskID string, updates []TaskUpdate) (*Task, error)
- type SimpleExecutor
- type SimpleMemoryService
- func (s *SimpleMemoryService) AddTaskLog(ctx context.Context, taskID string, message string, level string) error
- func (s *SimpleMemoryService) ApproveTaskPlan(ctx context.Context, taskID string, req interface{}) (interface{}, error)
- func (s *SimpleMemoryService) CreateTask(ctx context.Context, req interface{}) (interface{}, error)
- func (s *SimpleMemoryService) GetTask(ctx context.Context, taskID string) (interface{}, error)
- func (s *SimpleMemoryService) ListTasks(ctx context.Context, filter interface{}) ([]interface{}, error)
- func (s *SimpleMemoryService) UpdateTask(ctx context.Context, taskID string, updates interface{}) (interface{}, error)
- type SimplePlanner
- type SimplePlannerCore
- type Status
- type Step
- type Task
- type TaskFilter
- type TaskUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAdapterService ¶ added in v0.0.3
type AgentAdapterService interface {
CreateTask(ctx context.Context, req CreateTaskRequest) (*Task, error)
GetTask(ctx context.Context, taskID string) (*Task, error)
ListTasks(ctx context.Context, filter TaskFilter) ([]*Task, error)
ApproveTaskPlan(ctx context.Context, taskID string, req ApproveTaskPlanRequest) (*Task, error)
UpdateTask(ctx context.Context, taskID string, updates []TaskUpdate) (*Task, error)
AddTaskLog(ctx context.Context, taskID string, message string, level string) error
}
AgentAdapterService is the interface used by the AgentTaskService This is defined here to avoid import cycles
type AgentTaskAdapter ¶ added in v0.0.3
type AgentTaskAdapter interface {
CreateTaskRequestToCore(req CreateTaskRequest) core.CreateTaskRequest
CoreTaskToTask(coreTask *core.Task) *Task
}
AgentTaskAdapter is the interface used by the AgentTaskService to convert requests This is defined here to avoid import cycles
type AgentTaskService ¶
type AgentTaskService struct {
// contains filtered or unexported fields
}
AgentTaskService provides a complete implementation for the AgentTaskServiceInterface Agents can use this directly without additional wrapper.
func NewAgentTaskService ¶
func NewAgentTaskService(logger logging.Logger) (*AgentTaskService, error)
NewAgentTaskService creates a new TaskService for agents
func NewAgentTaskServiceWithAdapter ¶ added in v0.0.3
func NewAgentTaskServiceWithAdapter(logger logging.Logger, service AgentAdapterService) *AgentTaskService
NewAgentTaskServiceWithAdapter creates a new TaskService for agents using a custom service adapter
func (*AgentTaskService) AddTaskStep ¶ added in v0.0.3
func (s *AgentTaskService) AddTaskStep(ctx context.Context, description string) error
AddTaskStep adds a step to the current task
func (*AgentTaskService) CreateTask ¶
func (s *AgentTaskService) CreateTask(ctx context.Context, title, desc string, userID string, metadata map[string]interface{}) (*Task, error)
CreateTask creates a new task with the given parameters
func (*AgentTaskService) CurrentTask ¶ added in v0.0.3
func (s *AgentTaskService) CurrentTask() *Task
CurrentTask returns the current task being worked on, if any
func (*AgentTaskService) FormatTaskProgress ¶ added in v0.0.3
func (s *AgentTaskService) FormatTaskProgress() string
FormatTaskProgress formats a string with the task progress
func (*AgentTaskService) LogTaskDebug ¶ added in v0.0.3
func (s *AgentTaskService) LogTaskDebug(ctx context.Context, message string) error
LogTaskDebug adds a debug log entry to the current task
func (*AgentTaskService) LogTaskError ¶ added in v0.0.3
func (s *AgentTaskService) LogTaskError(ctx context.Context, message string) error
LogTaskError adds an error log entry to the current task
func (*AgentTaskService) LogTaskInfo ¶ added in v0.0.3
func (s *AgentTaskService) LogTaskInfo(ctx context.Context, message string) error
LogTaskInfo adds an info log entry to the current task
func (*AgentTaskService) ResetCurrentTask ¶ added in v0.0.3
func (s *AgentTaskService) ResetCurrentTask()
ResetCurrentTask clears the current task
func (*AgentTaskService) StartTask ¶ added in v0.0.3
StartTask sets the current task to a specific task ID
func (*AgentTaskService) UpdateTaskStatus ¶ added in v0.0.3
func (s *AgentTaskService) UpdateTaskStatus(ctx context.Context, status Status) error
UpdateTaskStatus updates the status of the current task
func (*AgentTaskService) UpdateTaskStep ¶ added in v0.0.3
func (s *AgentTaskService) UpdateTaskStep(ctx context.Context, stepID string, status Status, output string, err error) error
UpdateTaskStep updates a step in the current task
type ApproveTaskPlanRequest ¶
type ApproveTaskPlanRequest struct {
Approved bool `json:"approved"`
Feedback string `json:"feedback,omitempty"`
}
ApproveTaskPlanRequest represents the request to approve a task plan
type CreateTaskRequest ¶
type CreateTaskRequest struct {
Description string `json:"description"`
UserID string `json:"user_id"`
Title string `json:"title,omitempty"`
TaskKind string `json:"task_kind,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
CreateTaskRequest represents the request to create a new task
type LogEntry ¶
type LogEntry struct {
ID string `json:"id"`
TaskID string `json:"task_id"`
StepID string `json:"step_id,omitempty"` // Optional reference to a specific step
Message string `json:"message"`
Level string `json:"level"` // info, warning, error
Timestamp time.Time `json:"timestamp"`
}
LogEntry represents a log entry for a task
type Plan ¶
type Plan struct {
ID string `json:"id"`
TaskID string `json:"task_id"`
Steps []Step `json:"steps"`
CreatedAt time.Time `json:"created_at"`
ApprovedAt *time.Time `json:"approved_at,omitempty"`
IsApproved bool `json:"is_approved"`
}
Plan represents the execution plan for a task
type SimpleBridgeAdapter ¶ added in v0.0.3
type SimpleBridgeAdapter struct {
// contains filtered or unexported fields
}
SimpleBridgeAdapter implements AgentAdapterService
func (*SimpleBridgeAdapter) AddTaskLog ¶ added in v0.0.3
func (a *SimpleBridgeAdapter) AddTaskLog(ctx context.Context, taskID string, message string, level string) error
AddTaskLog adds a log to a task
func (*SimpleBridgeAdapter) ApproveTaskPlan ¶ added in v0.0.3
func (a *SimpleBridgeAdapter) ApproveTaskPlan(ctx context.Context, taskID string, req ApproveTaskPlanRequest) (*Task, error)
ApproveTaskPlan approves or rejects a plan
func (*SimpleBridgeAdapter) CreateTask ¶ added in v0.0.3
func (a *SimpleBridgeAdapter) CreateTask(ctx context.Context, req CreateTaskRequest) (*Task, error)
CreateTask creates a task using the core service
func (*SimpleBridgeAdapter) ListTasks ¶ added in v0.0.3
func (a *SimpleBridgeAdapter) ListTasks(ctx context.Context, filter TaskFilter) ([]*Task, error)
ListTasks returns tasks based on filter
func (*SimpleBridgeAdapter) UpdateTask ¶ added in v0.0.3
func (a *SimpleBridgeAdapter) UpdateTask(ctx context.Context, taskID string, updates []TaskUpdate) (*Task, error)
UpdateTask updates a task
type SimpleExecutor ¶ added in v0.0.3
type SimpleExecutor struct{}
SimpleExecutor implements TaskExecutor with minimal functionality
func (*SimpleExecutor) ExecuteStep ¶ added in v0.0.3
ExecuteStep implements TaskExecutor.ExecuteStep
func (*SimpleExecutor) ExecuteTask ¶ added in v0.0.3
func (e *SimpleExecutor) ExecuteTask(ctx context.Context, task *Task) error
ExecuteTask implements TaskExecutor.ExecuteTask
type SimpleMemoryService ¶ added in v0.0.3
type SimpleMemoryService struct {
// contains filtered or unexported fields
}
SimpleMemoryService implements interfaces.TaskService
func (*SimpleMemoryService) AddTaskLog ¶ added in v0.0.3
func (s *SimpleMemoryService) AddTaskLog(ctx context.Context, taskID string, message string, level string) error
AddTaskLog adds a log to a task
func (*SimpleMemoryService) ApproveTaskPlan ¶ added in v0.0.3
func (s *SimpleMemoryService) ApproveTaskPlan(ctx context.Context, taskID string, req interface{}) (interface{}, error)
ApproveTaskPlan approves or rejects a plan
func (*SimpleMemoryService) CreateTask ¶ added in v0.0.3
func (s *SimpleMemoryService) CreateTask(ctx context.Context, req interface{}) (interface{}, error)
CreateTask creates a new task
func (*SimpleMemoryService) GetTask ¶ added in v0.0.3
func (s *SimpleMemoryService) GetTask(ctx context.Context, taskID string) (interface{}, error)
GetTask gets a task by ID
func (*SimpleMemoryService) ListTasks ¶ added in v0.0.3
func (s *SimpleMemoryService) ListTasks(ctx context.Context, filter interface{}) ([]interface{}, error)
ListTasks returns tasks filtered by criteria
func (*SimpleMemoryService) UpdateTask ¶ added in v0.0.3
func (s *SimpleMemoryService) UpdateTask(ctx context.Context, taskID string, updates interface{}) (interface{}, error)
UpdateTask updates a task
type SimplePlanner ¶ added in v0.0.3
type SimplePlanner struct{}
SimplePlanner implements TaskPlanner with minimal functionality
func (*SimplePlanner) CreatePlan ¶ added in v0.0.3
CreatePlan implements TaskPlanner.CreatePlan
type SimplePlannerCore ¶ added in v0.0.3
type SimplePlannerCore struct {
// contains filtered or unexported fields
}
SimplePlannerCore implements interfaces.TaskPlanner
func (*SimplePlannerCore) CreatePlan ¶ added in v0.0.3
func (p *SimplePlannerCore) CreatePlan(ctx context.Context, task interface{}) (string, error)
CreatePlan creates a simple plan
type Status ¶
type Status string
Status represents the current status of a task or step
type Step ¶
type Step struct {
ID string `json:"id"`
PlanID string `json:"plan_id"`
Description string `json:"description"`
Status Status `json:"status"`
Order int `json:"order"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Step represents a single step in an execution plan
type Task ¶
type Task struct {
ID string `json:"id"`
Description string `json:"description"`
Status Status `json:"status"`
Title string `json:"title,omitempty"`
TaskKind string `json:"task_kind,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Steps []Step `json:"steps,omitempty"` // Direct access to steps
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
UserID string `json:"user_id"`
Logs []LogEntry `json:"logs,omitempty"`
Requirements interface{} `json:"requirements,omitempty"` // JSON of TaskRequirements
Feedback string `json:"feedback,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"` // For extensibility
}
Task represents an infrastructure task to be executed
type TaskFilter ¶
type TaskFilter struct {
UserID string `json:"user_id,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Status []Status `json:"status,omitempty"`
TaskKind string `json:"task_kind,omitempty"`
CreatedAfter *time.Time `json:"created_after,omitempty"`
CreatedBefore *time.Time `json:"created_before,omitempty"`
}
TaskFilter represents filters for querying tasks
type TaskUpdate ¶
type TaskUpdate struct {
Type string `json:"type"` // add_step, modify_step, remove_step, add_comment, update_status
StepID string `json:"step_id,omitempty"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
}
TaskUpdate represents an update to a task