Help us shape the future of Go! Take the 2026 Go Developer Survey

harness

package
v1.133.0 Latest Latest
Warning

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

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

Documentation

Overview

Package harness defines the contract between the runtime and external coding harnesses (Claude Code, Codex, ...) that agents configured with `harness:` delegate to. It carries no driver: pkg/codingharness implements it, and the runtime only links a driver once one is registered with runtime.RegisterHarness.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type       EventType
	Text       string
	Result     string
	SessionID  string
	Usage      *Usage
	ToolID     string
	ToolName   string
	ToolArgs   string
	ToolOutput string
	ToolError  bool
	Reasoning  string
}

Event is one streamed event from an external coding harness.

type EventType

type EventType string

EventType identifies an Event.

const (
	EventText          EventType = "text"
	EventResult        EventType = "result"
	EventToolCallStart EventType = "tool_call_start"
	EventToolCallDelta EventType = "tool_call_delta"
	EventToolCall      EventType = "tool_call"
	EventToolResult    EventType = "tool_result"
	EventReasoning     EventType = "reasoning"
	EventSessionID     EventType = "session_id"
)

type Factory

type Factory func(cfg *latest.HarnessConfig) (Provider, error)

Factory builds the Provider for a harness configuration.

type Provider

type Provider interface {
	Name() string
	Run(ctx context.Context, prompt string, handle func(Event)) error
	Resume(ctx context.Context, sessionID, prompt string, handle func(Event)) error
}

Provider drives one external coding harness for an agent.

type Usage

type Usage struct {
	InputTokens              int
	OutputTokens             int
	CacheReadInputTokens     int
	CacheCreationInputTokens int
	TotalCostUSD             float64
}

Usage is the token and cost report a harness emits with its result.

Jump to

Keyboard shortcuts

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