harness

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package harness defines the public execution seam for runner adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Probe(context.Context) (Info, error)
	Run(context.Context, Launch, Emit) (Result, error)
}

Adapter probes its executable and runs one isolated agent turn.

type Clarification

type Clarification struct {
	ID   string `json:"id"`
	Text string `json:"text"`
}

Clarification is a bounded product question that can be answered by a caller before resuming the existing harness session.

type Emit

type Emit func(Event) error

Emit receives adapter events. Implementations must treat an error as a terminal failure and stop producing events for the launch.

type Event

type Event struct {
	Type          string          `json:"type"`
	SessionID     string          `json:"sessionID,omitempty"`
	TurnID        string          `json:"turnID,omitempty"`
	Message       string          `json:"message,omitempty"`
	Data          json.RawMessage `json:"data,omitempty"`
	Clarification *Clarification  `json:"clarification,omitempty"`
}

Event is a bounded adapter event forwarded to the runner state engine.

type Info

type Info struct {
	Name    string   `json:"name"`
	Version string   `json:"version"`
	Ready   bool     `json:"ready"`
	Reasons []string `json:"reasons,omitempty"`
}

Info describes an adapter's executable and readiness state.

type Launch

type Launch struct {
	AttemptID    string `json:"attemptID"`
	Workdir      string `json:"workdir"`
	SessionID    string `json:"sessionID,omitempty"`
	Instructions string `json:"instructions"`
	Model        string `json:"model,omitempty"`
}

Launch identifies one worker attempt and the thread turn it should execute.

type Result

type Result struct {
	Phase         string         `json:"phase"`
	SessionID     string         `json:"sessionID,omitempty"`
	Blocker       string         `json:"blocker,omitempty"`
	Clarification *Clarification `json:"clarification,omitempty"`
}

Result is the terminal state of one adapter launch.

Directories

Path Synopsis
Package codex adapts the Codex app-server protocol to the runner harness.
Package codex adapts the Codex app-server protocol to the runner harness.

Jump to

Keyboard shortcuts

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