controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package controller implements the single-writer orchestrator that coordinates agentic loops, manages executions, and communicates with local and remote agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EventLogBuilder executor.EventLogBuilder
	PlannerBuilder  PlannerBuilder
}

Config configures the controller.

type Controller

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

Controller is the main controller that coordinates all components. It acts as a single-writer system for managing agentic loops.

func New

func New(ctx context.Context, cfg Config) (*Controller, error)

New creates a new controller instance.

func (*Controller) Close

func (d *Controller) Close() error

Close gracefully shuts down the controller.

func (*Controller) Delete

func (d *Controller) Delete(ctx context.Context, conversationID string) error

Delete deletes all events for a specific conversation ID.

func (*Controller) Exec

func (d *Controller) Exec(ctx context.Context, req *proto.ExecRequest, handler ExecHandler) error

Exec executes a new agentic loop execution or resumes an existing one. If id is empty, a UUID will be generated. If the execution already exists, it will be resumed with optional new inputs.

func (*Controller) Fork

func (d *Controller) Fork(ctx context.Context, srcConversationID string, srcSeq int32, destConversationID string) (string, error)

Fork forks an event log from a specific conversation up to a checkpoint.

func (*Controller) Registry

func (d *Controller) Registry() *Registry

Registry returns the agent registry.

type ExecHandler

type ExecHandler func(resp *proto.ExecResponse) error

type PlannerBuilder

type PlannerBuilder func(ctx context.Context, r *Registry) (agent.Agent, error)

PlannerBuilder is a function that creates a PlanFunc given a Registry.

type Registry

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

Registry manages a collection of local and remote agents. It provides agent discovery, health monitoring, and load balancing.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new agent registry.

func (*Registry) Close

func (r *Registry) Close() error

Close stops the registry and closes all agents.

func (*Registry) Get

func (r *Registry) Get(id string) (agent.Agent, error)

Get retrieves an agent by ID.

func (*Registry) GetInfo

func (r *Registry) GetInfo(id string) (*agent.AgentInfo, error)

GetInfo retrieves agent metadata by ID.

func (*Registry) List

func (r *Registry) List() []string

List returns all registered agent IDs.

func (*Registry) Map

func (r *Registry) Map() map[string]agent.Agent

func (*Registry) RegisterATE

func (r *Registry) RegisterATE(ctx context.Context, ateTarget string, cfg config.SubstrateAgentConfig) error

RegisterATE returns an error stating that ATE support is not compiled in.

func (*Registry) RegisterColab

func (r *Registry) RegisterColab(cfg config.ColabAgentConfig) error

RegisterColab registers a Colab agent that executes a local Python file on a remote Colab session via the colab CLI.

func (*Registry) RegisterLocal

func (r *Registry) RegisterLocal(cfg config.LocalAgentConfig) error

RegisterLocal registers a local (in-process) agent.

func (*Registry) RegisterRemote

func (r *Registry) RegisterRemote(ctx context.Context, cfg config.RemoteAgentConfig) error

RegisterRemote registers a remote agent by creating a remote agent client. The protocol field determines what kind of remote agent to register (matched case-insensitively):

  • "axp" (default): AX's proto.AgentService.
  • "a2a": A2A protocol.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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