adapter

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package adapter defines the agent adapter contract and built-in adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Run(ctx context.Context, input RunInput) (*RunResult, error)
}

Adapter runs an agent against a scenario.

type CLIAdapter

type CLIAdapter struct{}

CLIAdapter launches an agent as an external process.

func NewCLIAdapter

func NewCLIAdapter() *CLIAdapter

NewCLIAdapter returns a new CLIAdapter.

func (*CLIAdapter) Run

func (a *CLIAdapter) Run(ctx context.Context, input RunInput) (*RunResult, error)

Run executes the agent command with environment variables for kubeconfig, workspace, and prompt path, and captures stdout/stderr.

type MCPAdapter

type MCPAdapter struct{}

MCPAdapter launches an MCP-capable agent process via stdio transport. The agent is expected to connect to configured MCP tool servers and use them to interact with the cluster.

func NewMCPAdapter

func NewMCPAdapter() *MCPAdapter

NewMCPAdapter returns a new MCPAdapter.

func (*MCPAdapter) Run

func (a *MCPAdapter) Run(ctx context.Context, input RunInput) (*RunResult, error)

Run executes the MCP agent command. The agent is launched with environment variables pointing to the kubeconfig, workspace, and prompt. The agent is expected to be MCP-aware and connect to tool servers as configured.

type RunInput

type RunInput struct {
	ScenarioID     string
	PromptPath     string
	WorkspaceDir   string
	KubeconfigPath string
	Timeout        time.Duration
	Tools          map[string]any
	AgentCommand   string
	AgentArgs      []string
	Model          string
	Env            map[string]string
}

RunInput is the input given to an agent adapter.

type RunResult

type RunResult struct {
	ExitCode   int
	Transcript string
	Stdout     string
	Stderr     string
	ToolCalls  []ToolCallRecord
	Metadata   map[string]string
}

RunResult is the normalized output from an agent adapter.

type ToolCallRecord

type ToolCallRecord struct {
	Tool      string         `json:"tool"`
	Args      map[string]any `json:"args,omitempty"`
	Result    string         `json:"result,omitempty"`
	Timestamp time.Time      `json:"timestamp"`
}

ToolCallRecord is an historical record of a tool invocation by the agent, written to run artifacts. Not to be confused with agent.ToolCall, which is the in-flight request the LLM sends over the provider protocol.

Jump to

Keyboard shortcuts

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