runtime

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRunAlreadyCompleted = errors.New("runtime: run already completed")
	ErrRunCancelled        = errors.New("runtime: run is cancelled")
)

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	LLM            llm.Gateway
	Tools          ToolRegistry
	Memory         map[string]memory.Repository
	TierMemory     map[string]tier.Manager
	Cognitive      map[string]memory.CognitiveMemory
	Runs           runstate.Repository
	Blobs          runstate.BlobStore
	Events         core.EventSink
	HumanGate      core.HumanGate
	Policy         security.Policy
	Audit          audit.Sink
	ToolPolicy     governance.ToolPolicy
	OutputRedactor governance.OutputRedactor
	// Recorder receives metric observations. If nil, metrics are discarded.
	Recorder observability.Recorder
	// Tracer receives distributed tracing spans. If nil, tracing is a no-op.
	Tracer observability.Tracer
	// Logger receives structured log messages for warning and error paths.
	// If nil, messages are silently discarded.
	Logger log.Logger
	// EnqueueMemoryReconcile enqueues async tier reconcile jobs after tier writes.
	EnqueueMemoryReconcile func(context.Context, async.Job) error
}

type Engine

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

func NewEngine

func NewEngine(scenario core.Scenario, deps Dependencies) (*Engine, error)

func (*Engine) ContinueAfterCheckpoint added in v0.1.2

func (e *Engine) ContinueAfterCheckpoint(ctx context.Context, runID string) (RunResult, error)

ContinueAfterCheckpoint resumes execution for a run that was approved at a checkpoint.

func (*Engine) ReconcileTierMemory added in v0.1.9

func (e *Engine) ReconcileTierMemory(ctx context.Context, runID, memoryName, agentName string) error

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, req RunRequest) (RunResult, error)

func (*Engine) RunAgent

func (e *Engine) RunAgent(ctx context.Context, agentName string, input core.AgentInput) (core.AgentOutput, error)

func (*Engine) RunHybrid added in v0.1.1

func (e *Engine) RunHybrid(ctx context.Context, req RunRequest) (RunResult, error)

RunHybrid continues an existing run – created and partially populated by a workflow phase – by executing the autonomous agent. It does NOT create a new RunSnapshot; instead it loads the one already saved for req.RunID, updates it on completion.

func (*Engine) RunStructured

func (e *Engine) RunStructured(ctx context.Context, req RunRequest) (RunResult, error)

func (*Engine) Stream

func (e *Engine) Stream(ctx context.Context, req RunRequest) (<-chan llm.ChatChunk, error)

type Logger added in v0.1.1

type Logger = log.Logger

Logger is the runtime logging port. Prefer pkg/log.Logger in new code.

type RunPausedError added in v0.1.2

type RunPausedError struct {
	RunID string
	Token string
	Kind  string
}

RunPausedError indicates the run paused and requires human approval before continuing.

func (RunPausedError) Error added in v0.1.2

func (e RunPausedError) Error() string

type RunRequest

type RunRequest struct {
	RunID   string          `json:"run_id"`
	Agent   string          `json:"agent,omitempty"`
	Prompt  string          `json:"prompt,omitempty"`
	Context json.RawMessage `json:"context,omitempty"`
}

type RunResult

type RunResult struct {
	RunID            string             `json:"run_id"`
	Status           runstate.RunStatus `json:"status"`
	Token            string             `json:"token,omitempty"`
	Output           string             `json:"output,omitempty"`
	StructuredOutput json.RawMessage    `json:"structured_output,omitempty"`
}

type ToolRegistry

type ToolRegistry interface {
	ResolveTool(ctx context.Context, tool core.Tool) (core.ToolExecutor, bool, error)
}

Jump to

Keyboard shortcuts

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