runtime

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCodeForStopReason added in v0.1.0

func ExitCodeForStopReason(stopReason string) int

ExitCodeForStopReason returns Avenor's locked process exit code for a terminal ACP stop reason.

func StopReasonForExitCode added in v0.7.2

func StopReasonForExitCode(exitCode int) string

StopReasonForExitCode is the inverse of ExitCodeForStopReason. Returns an empty string for exit code 1 (generic failure) since there is no canonical stop reason for that case.

Types

type Capabilities

type Capabilities struct {
	Backend             string
	Permissions         bool
	Resume              bool
	ExternalServerURL   bool
	SubprocessDiscovery bool
	ModelSelection      bool
}

Capabilities describes what a runtime backend supports.

type PermissionResponse

type PermissionResponse struct {
	Allow    bool
	OptionID string
	Message  string
}

PermissionResponse is the response to a permission request.

type Provider

type Provider interface {
	Start(ctx context.Context, opts StartOptions) (Session, error)
	Resume(ctx context.Context, sessionID string) (Session, error)
	Prompt(ctx context.Context, sessionID string, prompt string) error
	Cancel(ctx context.Context, sessionID string) error
	Events(ctx context.Context, sessionID string) (<-chan events.Event, error)
	AnswerPermission(ctx context.Context, sessionID string, requestID string, response PermissionResponse) error
	Capabilities(ctx context.Context) (Capabilities, error)
}

Provider is the interface that all ACP runtime backends must implement.

type Session

type Session struct {
	SessionID string
	Backend   string
	Dir       string
	PID       int // Consumed by longe halt (SIGTERM); set by opencode-acp backend. 0 otherwise.
}

Session represents an active ACP session.

type StartOptions

type StartOptions struct {
	Agent     string
	Label     string
	Dir       string
	ServerURL string
	Model     string
}

StartOptions holds options for starting a new session.

Directories

Path Synopsis
Package opencodehttp implements a runtime.Provider that communicates with opencode serve over its HTTP API (SSE event stream + REST endpoints).
Package opencodehttp implements a runtime.Provider that communicates with opencode serve over its HTTP API (SSE event stream + REST endpoints).

Jump to

Keyboard shortcuts

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