runtime

package
v0.2.6 Latest Latest
Warning

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

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

Documentation

Overview

Package runtime provides agent execution environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalExpirer

type ApprovalExpirer interface {
	ExpireApprovals(ctx context.Context) (int, error)
}

ApprovalExpirer is implemented by services that can expire pending approvals.

type LocalRuntime

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

LocalRuntime is a simple in-process runtime.

func NewLocal

func NewLocal() *LocalRuntime

NewLocal creates a new LocalRuntime instance.

func NewLocalFromConfig

func NewLocalFromConfig(cfg config.RuntimeConfig) *LocalRuntime

NewLocalFromConfig creates a LocalRuntime with approval sweep settings from config.

func (*LocalRuntime) AddApprovalExpirer

func (r *LocalRuntime) AddApprovalExpirer(expirer ApprovalExpirer)

AddApprovalExpirer registers an expirer to be swept on the configured interval.

func (*LocalRuntime) Run

func (r *LocalRuntime) Run(ctx context.Context, agent core.Agent, input any) (any, error)

Run executes an agent using the provided context.

func (*LocalRuntime) SetApprovalSweepInterval

func (r *LocalRuntime) SetApprovalSweepInterval(interval time.Duration)

SetApprovalSweepInterval defines how often to sweep for expired approvals. Set to 0 to disable.

func (*LocalRuntime) SetApprovalSweepTimeout

func (r *LocalRuntime) SetApprovalSweepTimeout(timeout time.Duration)

SetApprovalSweepTimeout defines a per-sweep timeout.

func (*LocalRuntime) Start

func (r *LocalRuntime) Start(_ context.Context) error

Start marks the runtime as ready.

func (*LocalRuntime) Stop

func (r *LocalRuntime) Stop(_ context.Context) error

Stop marks the runtime as stopped.

type Runtime

type Runtime interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Run(ctx context.Context, agent core.Agent, input any) (any, error)
}

Runtime defines the minimal lifecycle for executing agents.

Jump to

Keyboard shortcuts

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