agent

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAgentType = errors.New("invalid agent type")

ErrInvalidAgentType is returned when an AgentType value is not one of the canonical domain values (ai, service, operator).

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID               string
	Name             string
	Type             AgentType
	Owner            string
	ModelVersion     string // applicable when Type == AgentTypeAI
	Endpoint         string // service or model endpoint used for invocation (if applicable)
	OperationalState OperationalState
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

Agent represents an autonomous actor (AI agent, automated service, human operator).

type AgentRepository

type AgentRepository interface {
	GetByID(ctx context.Context, id string) (*Agent, error)
	Create(ctx context.Context, a *Agent) error
	Update(ctx context.Context, a *Agent) error
	List(ctx context.Context) ([]*Agent, error)
}

AgentRepository is the persistence interface for Agent. All implementations live in internal/store/postgres.

type AgentType

type AgentType string

AgentType classifies what kind of actor an agent is.

const (
	AgentTypeAI       AgentType = "ai"
	AgentTypeService  AgentType = "service"
	AgentTypeOperator AgentType = "operator"
)

func (AgentType) IsValid

func (t AgentType) IsValid() bool

IsValid reports whether t is one of the canonical AgentType values.

func (AgentType) Validate

func (t AgentType) Validate() error

Validate returns ErrInvalidAgentType (wrapped with the offending value) if the type is not canonical. Callers should use errors.Is to check.

type OperationalState

type OperationalState string

OperationalState represents whether an agent is permitted to act globally. This is independent of authority grants, which are managed separately.

const (
	OperationalStateActive    OperationalState = "active"
	OperationalStateSuspended OperationalState = "suspended"
	OperationalStateRevoked   OperationalState = "revoked"
)

Jump to

Keyboard shortcuts

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