Documentation
¶
Index ¶
- Variables
- type AddChildRequest
- type AgentEdge
- type AgentID
- type AgentNode
- type AgentStatus
- type ClaimNextRequest
- type ClaimTaskRequest
- type Coordinator
- func (c *Coordinator) AddChild(ctx context.Context, parentID AgentID, child AgentNode) error
- func (c *Coordinator) ApprovePlanExit(ctx context.Context, req PlanExitApproval) (taskstate.PlanRef, error)
- func (c *Coordinator) CancelTask(ctx context.Context, req TaskOwnerRequest) (taskstate.TaskNode, error)
- func (c *Coordinator) ClaimNext(ctx context.Context, req ClaimNextRequest) (taskstate.TaskNode, error)
- func (c *Coordinator) ClaimTask(ctx context.Context, req ClaimTaskRequest) (taskstate.TaskNode, error)
- func (c *Coordinator) DescendantsBFS(ctx context.Context, parentID AgentID) ([]AgentNode, error)
- func (c *Coordinator) ReleaseTask(ctx context.Context, req TaskOwnerRequest) (taskstate.TaskNode, error)
- type CoordinatorOptions
- type FileGraphStore
- func (s *FileGraphStore) AddChild(ctx context.Context, req AddChildRequest) error
- func (s *FileGraphStore) DescendantsBFS(ctx context.Context, parentID AgentID) ([]AgentNode, error)
- func (s *FileGraphStore) ListAgents(ctx context.Context) ([]AgentNode, error)
- func (s *FileGraphStore) RegisterAgent(ctx context.Context, node AgentNode) error
- func (s *FileGraphStore) SetClock(now func() time.Time)
- func (s *FileGraphStore) UpdateAgentStatus(ctx context.Context, id AgentID, status AgentStatus) (AgentNode, error)
- type GraphStore
- type PlanExitApproval
- type TaskOwnerRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAgentCycle = errors.New("team: agent graph cycle") ErrAgentExists = errors.New("team: agent already exists") ErrAgentNotFound = errors.New("team: agent not found") ErrConcurrencyLimit = errors.New("team: concurrency limit reached") ErrCorruptState = errors.New("team: graph state corrupt") ErrInvalidAgent = errors.New("team: invalid agent") ErrLeaderApprovalRequired = errors.New("team: leader approval required") ErrTaskOwnerMismatch = errors.New("team: task owner mismatch") )
Functions ¶
This section is empty.
Types ¶
type AddChildRequest ¶
type AgentNode ¶
type AgentNode struct {
ID AgentID `json:"id"`
Name subagent.AgentName `json:"name,omitempty"`
Type subagent.AgentType `json:"type"`
Status AgentStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type AgentStatus ¶
type AgentStatus string
const ( AgentStatusRunning AgentStatus = "running" AgentStatusCompleted AgentStatus = "completed" AgentStatusCancelled AgentStatus = "cancelled" )
type ClaimNextRequest ¶
type ClaimTaskRequest ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func NewCoordinator ¶
func NewCoordinator(tasks taskstate.Store, graph GraphStore, opts CoordinatorOptions) *Coordinator
func (*Coordinator) ApprovePlanExit ¶
func (c *Coordinator) ApprovePlanExit(ctx context.Context, req PlanExitApproval) (taskstate.PlanRef, error)
func (*Coordinator) CancelTask ¶
func (c *Coordinator) CancelTask(ctx context.Context, req TaskOwnerRequest) (taskstate.TaskNode, error)
func (*Coordinator) ClaimNext ¶
func (c *Coordinator) ClaimNext(ctx context.Context, req ClaimNextRequest) (taskstate.TaskNode, error)
func (*Coordinator) ClaimTask ¶
func (c *Coordinator) ClaimTask(ctx context.Context, req ClaimTaskRequest) (taskstate.TaskNode, error)
func (*Coordinator) DescendantsBFS ¶
func (*Coordinator) ReleaseTask ¶
func (c *Coordinator) ReleaseTask(ctx context.Context, req TaskOwnerRequest) (taskstate.TaskNode, error)
type CoordinatorOptions ¶
type FileGraphStore ¶
type FileGraphStore struct {
// contains filtered or unexported fields
}
func NewFileGraphStore ¶
func NewFileGraphStore(path string) *FileGraphStore
func (*FileGraphStore) AddChild ¶
func (s *FileGraphStore) AddChild(ctx context.Context, req AddChildRequest) error
func (*FileGraphStore) DescendantsBFS ¶
func (*FileGraphStore) ListAgents ¶
func (s *FileGraphStore) ListAgents(ctx context.Context) ([]AgentNode, error)
func (*FileGraphStore) RegisterAgent ¶
func (s *FileGraphStore) RegisterAgent(ctx context.Context, node AgentNode) error
func (*FileGraphStore) SetClock ¶
func (s *FileGraphStore) SetClock(now func() time.Time)
func (*FileGraphStore) UpdateAgentStatus ¶
func (s *FileGraphStore) UpdateAgentStatus(ctx context.Context, id AgentID, status AgentStatus) (AgentNode, error)
type GraphStore ¶
type GraphStore interface {
RegisterAgent(ctx context.Context, node AgentNode) error
AddChild(ctx context.Context, req AddChildRequest) error
UpdateAgentStatus(ctx context.Context, id AgentID, status AgentStatus) (AgentNode, error)
DescendantsBFS(ctx context.Context, parentID AgentID) ([]AgentNode, error)
}
type PlanExitApproval ¶
type TaskOwnerRequest ¶
Click to show internal directories.
Click to hide internal directories.