controlplane

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedControl = errors.New("unsupported control operation")

ErrUnsupportedControl is a sentinel error for unsupported control operations.

Functions

This section is empty.

Types

type Control

type Control string

Control identifies a logical control-plane operation.

const (
	ControlInitialize        Control = "initialize"
	ControlInterrupt         Control = "interrupt"
	ControlSetModel          Control = "set_model"
	ControlSetPermissionMode Control = "set_permission_mode"
	ControlRewindFiles       Control = "rewind_files"
	ControlMCPStatus         Control = "mcp_status"
)

type Controller

type Controller interface {
	Initialize(ctx context.Context) error
	Interrupt(ctx context.Context) error
	SetPermissionMode(ctx context.Context, mode string) error
	SetModel(ctx context.Context, model *string) error
	GetMCPStatus(ctx context.Context) (*mcp.Status, error)
	RewindFiles(ctx context.Context, userMessageID string) error
}

Controller handles mutable runtime control operations.

func NewLocalController

func NewLocalController(host Host) Controller

NewLocalController returns an in-process controller for runtime state.

type Host

type Host interface {
	Connected() bool
	CurrentCancel() context.CancelFunc
	Options() *config.Options
	Runner() Runner
	ActiveSessionID() string
	Rewind(sessionID, userMessageID string) error
	SetMCPStatus(map[string]mcp.ServerStatus)
	MCPStatus() map[string]mcp.ServerStatus
}

Host exposes client state needed by the local control plane.

type Runner

type Runner interface {
	SetPermissionMode(mode string)
}

Runner exposes runner methods needed for control operations.

type UnsupportedControlError

type UnsupportedControlError struct {
	Control Control
	Backend string
	Reason  string
}

UnsupportedControlError is returned when a control op has no backend equivalent.

func (*UnsupportedControlError) Error

func (e *UnsupportedControlError) Error() string

func (*UnsupportedControlError) Unwrap

func (e *UnsupportedControlError) Unwrap() error

Jump to

Keyboard shortcuts

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