runtime

package
v0.1.3 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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	LLM            llm.Gateway
	Tools          ToolRegistry
	Memory         map[string]memory.Repository
	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 Logger
}

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) 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 interface {
	Warn(ctx context.Context, msg string, keysAndValues ...any)
	Error(ctx context.Context, msg string, keysAndValues ...any)
}

Logger is a minimal structured-logging interface. Wire an implementation via Dependencies.Logger or WithLogger to capture warning and error messages from the runtime (e.g. silent save failures, retry events).

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