Documentation
¶
Index ¶
- func SaveConfig(config *Config, configPath string) error
- func SaveIndividualAgentConfig(config *IndividualAgentConfig, agentsDir string) error
- type Action
- type Agent
- func (a *Agent) GetPermissionRequestChan() <-chan PermissionRequest
- func (a *Agent) GetStatus() Status
- func (a *Agent) InitializeWithDependencies(taskService task.Service, eventBus *event.EventBus, ...) error
- func (a *Agent) IsAvailable() bool
- func (a *Agent) SendPermissionResponse(response PermissionResponse)
- func (a *Agent) Start(ctx context.Context) error
- func (a *Agent) Stop() error
- func (a *Agent) UpdateStatus(status Status)
- type AgentConfig
- type AgentRegistry
- type ApprovalRequest
- type AutoScaler
- type BaseExecutor
- type ClaudeCodeExecutor
- func (e *ClaudeCodeExecutor) CanExecute(work *WorkItem) bool
- func (e *ClaudeCodeExecutor) Cleanup() error
- func (e *ClaudeCodeExecutor) Connect(ctx context.Context) error
- func (e *ClaudeCodeExecutor) Disconnect() error
- func (e *ClaudeCodeExecutor) Execute(ctx context.Context, work *WorkItem) (*ExecutionResult, error)
- func (e *ClaudeCodeExecutor) Initialize(ctx context.Context, config ExecutorConfig) error
- func (e *ClaudeCodeExecutor) IsConnected() bool
- type Config
- type DefaultExecutorFactory
- type ExecutionResult
- type Executor
- type ExecutorConfig
- type ExecutorFactory
- type IndividualAgentConfig
- type Manager
- func (m *Manager) CreateAgent(config *AgentConfig) (*Agent, error)
- func (m *Manager) GetAgent(agentID string) (*Agent, bool)
- func (m *Manager) GetAgentsByName(name string) []*Agent
- func (m *Manager) GetAvailableAgents() []*Agent
- func (m *Manager) ListAgents() []*Agent
- func (m *Manager) RemoveAgent(agentID string) error
- func (m *Manager) Start(ctx context.Context) error
- type PermissionRequest
- type PermissionResponse
- type ScalingConfig
- type Status
- type WorkItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveConfig ¶
func SaveIndividualAgentConfig ¶
func SaveIndividualAgentConfig(config *IndividualAgentConfig, agentsDir string) error
Types ¶
type Agent ¶
type Agent struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Type string `yaml:"type"`
Process string `yaml:"process"` // The process this agent handles
Description string `yaml:"description,omitempty"`
Version string `yaml:"version,omitempty"`
Instructions string `yaml:"instructions,omitempty"`
Scaling *ScalingConfig `yaml:"scaling,omitempty"`
Status Status `yaml:"status"`
TaskID string `yaml:"task_id,omitempty"`
ProcessName string `yaml:"process_name,omitempty"` // Currently executing process
WorktreePath string `yaml:"worktree_path,omitempty"`
CreatedAt time.Time `yaml:"created_at"`
UpdatedAt time.Time `yaml:"updated_at"`
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(id string, config *AgentConfig, factory ExecutorFactory) (*Agent, error)
func (*Agent) GetPermissionRequestChan ¶
func (a *Agent) GetPermissionRequestChan() <-chan PermissionRequest
GetPermissionRequestChan returns the channel for receiving permission requests This can be used by UI/CLI to handle permission requests from the executor
func (*Agent) InitializeWithDependencies ¶
func (a *Agent) InitializeWithDependencies(taskService task.Service, eventBus *event.EventBus, worktreeManager *worktree.Manager) error
InitializeWithDependencies injects dependencies and initializes the executor
func (*Agent) IsAvailable ¶
func (*Agent) SendPermissionResponse ¶
func (a *Agent) SendPermissionResponse(response PermissionResponse)
SendPermissionResponse sends a permission response to the executor
func (*Agent) UpdateStatus ¶
type AgentConfig ¶
type AgentConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Process string `yaml:"process"` // The process this agent handles (e.g., "implement", "review", "qa")
Instructions string `yaml:"instructions,omitempty"`
Scaling *ScalingConfig `yaml:"scaling,omitempty"`
}
type AgentRegistry ¶
type AgentRegistry interface {
GetAgentsByName(name string) []*Agent
CreateAgent(config *AgentConfig) (*Agent, error)
RemoveAgent(agentID string) error
ListAgents() []*Agent
}
AgentRegistry defines the interface for agent registry operations
type ApprovalRequest ¶
type AutoScaler ¶
type AutoScaler struct {
// contains filtered or unexported fields
}
AutoScaler manages automatic scaling of agents
func NewAutoScaler ¶
func NewAutoScaler(config *Config, factory ExecutorFactory, registry AgentRegistry) *AutoScaler
NewAutoScaler creates a new auto scaler
func (*AutoScaler) SetMonitorInterval ¶
func (s *AutoScaler) SetMonitorInterval(interval time.Duration)
SetMonitorInterval sets the monitoring interval
type BaseExecutor ¶
type BaseExecutor struct {
Config ExecutorConfig
// contains filtered or unexported fields
}
BaseExecutor provides common functionality for all executors
func (*BaseExecutor) Connect ¶
func (e *BaseExecutor) Connect(ctx context.Context) error
Connect is a no-op for base executor (override in streaming executors)
func (*BaseExecutor) Disconnect ¶
func (e *BaseExecutor) Disconnect() error
Disconnect is a no-op for base executor (override in streaming executors)
func (*BaseExecutor) Initialize ¶
func (e *BaseExecutor) Initialize(ctx context.Context, config ExecutorConfig) error
Initialize sets up the base executor
func (*BaseExecutor) IsConnected ¶
func (e *BaseExecutor) IsConnected() bool
IsConnected returns false for base executor (override in streaming executors)
type ClaudeCodeExecutor ¶
type ClaudeCodeExecutor struct {
BaseExecutor
// contains filtered or unexported fields
}
ClaudeCodeExecutor implements the Executor interface for Claude Code using persistent streaming connection for interactive communication
func NewClaudeCodeExecutor ¶
func NewClaudeCodeExecutor() *ClaudeCodeExecutor
NewClaudeCodeExecutor creates a new Claude Code executor
func (*ClaudeCodeExecutor) CanExecute ¶
func (e *ClaudeCodeExecutor) CanExecute(work *WorkItem) bool
CanExecute checks if this executor can handle the work item
func (*ClaudeCodeExecutor) Cleanup ¶
func (e *ClaudeCodeExecutor) Cleanup() error
Cleanup releases resources
func (*ClaudeCodeExecutor) Connect ¶
func (e *ClaudeCodeExecutor) Connect(ctx context.Context) error
Connect establishes a persistent connection to Claude Code
func (*ClaudeCodeExecutor) Disconnect ¶
func (e *ClaudeCodeExecutor) Disconnect() error
Disconnect closes the persistent connection
func (*ClaudeCodeExecutor) Execute ¶
func (e *ClaudeCodeExecutor) Execute(ctx context.Context, work *WorkItem) (*ExecutionResult, error)
Execute executes a work item using Claude Code
func (*ClaudeCodeExecutor) Initialize ¶
func (e *ClaudeCodeExecutor) Initialize(ctx context.Context, config ExecutorConfig) error
Initialize initializes the executor with configuration
func (*ClaudeCodeExecutor) IsConnected ¶
func (e *ClaudeCodeExecutor) IsConnected() bool
IsConnected returns true if the executor has an active connection
type Config ¶
type Config struct {
Agents []*AgentConfig `yaml:"agents"`
}
func LoadConfig ¶
func (*Config) GetAgentConfig ¶
func (c *Config) GetAgentConfig(name string) (*AgentConfig, bool)
func (*Config) GetScalableAgents ¶
func (c *Config) GetScalableAgents() []*AgentConfig
type DefaultExecutorFactory ¶
type DefaultExecutorFactory struct {
// contains filtered or unexported fields
}
DefaultExecutorFactory implements ExecutorFactory
func NewDefaultExecutorFactory ¶
func NewDefaultExecutorFactory(taskService task.Service, eventBus *event.EventBus, worktreeManager *worktree.Manager) *DefaultExecutorFactory
NewDefaultExecutorFactory creates a new default executor factory
func (*DefaultExecutorFactory) CreateExecutor ¶
func (f *DefaultExecutorFactory) CreateExecutor(executorType string) (Executor, error)
CreateExecutor creates the appropriate executor based on type
type ExecutionResult ¶
type ExecutionResult struct {
Success bool
NextStatus string
Message string
Artifacts []string
Error error
}
ExecutionResult represents the result of work execution
type Executor ¶
type Executor interface {
// Initialize the executor with configuration
Initialize(ctx context.Context, config ExecutorConfig) error
// Connect establishes a persistent connection (for streaming executors)
Connect(ctx context.Context) error
// Disconnect closes the persistent connection
Disconnect() error
// IsConnected returns true if the executor has an active connection
IsConnected() bool
// Execute a work item (task or event)
Execute(ctx context.Context, work *WorkItem) (*ExecutionResult, error)
// Check if the executor can handle this work item
CanExecute(work *WorkItem) bool
// Cleanup resources
Cleanup() error
}
Executor defines the interface for executing agent-specific logic
type ExecutorConfig ¶
type ExecutorConfig struct {
AgentID string
Name string
Process string // The process type this executor handles
Instructions string
WorktreePath string
// Permission handling
PermissionRequestChan chan<- PermissionRequest // Channel to send permission requests
PermissionResponseChan <-chan PermissionResponse // Channel to receive permission responses
// Dependency injection
TaskService task.Service
EventBus *event.EventBus
WorktreeManager *worktree.Manager
}
ExecutorConfig holds configuration for executor initialization
type ExecutorFactory ¶
ExecutorFactory creates executors
type IndividualAgentConfig ¶
type IndividualAgentConfig struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Process string `yaml:"process"` // The process this agent handles
Scaling *ScalingConfig `yaml:"scaling,omitempty"`
Description string `yaml:"description,omitempty"`
Version string `yaml:"version,omitempty"`
Instructions string `yaml:"instructions,omitempty"`
}
IndividualAgentConfig represents a single agent's configuration file
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CreateAgent ¶
func (m *Manager) CreateAgent(config *AgentConfig) (*Agent, error)
CreateAgent creates a new agent and starts it (implements AgentRegistry)
func (*Manager) GetAgentsByName ¶
func (*Manager) GetAvailableAgents ¶
func (*Manager) ListAgents ¶
func (*Manager) RemoveAgent ¶
RemoveAgent removes an agent and stops it (implements AgentRegistry)
type PermissionRequest ¶
type PermissionRequest struct {
ID string // Unique request ID
ToolName string // Tool being requested (e.g., "Bash", "Write", "Edit")
Input map[string]interface{} // Tool input parameters
TaskID string // Associated task ID
AgentID string // Agent making the request
Timestamp int64 // Request timestamp
}
PermissionRequest represents a tool permission request from Claude
type PermissionResponse ¶
type PermissionResponse struct {
RequestID string // Matching request ID
Allowed bool // Whether the action is allowed
Message string // Optional message (e.g., reason for denial)
UpdatedInput map[string]interface{} // Optional: modified input parameters
}
PermissionResponse represents the user's response to a permission request