execution

package
v0.174.0-rc.35 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package execution manages owned harness processes on SSH execution hosts. Transport reachability never establishes whether a task or process ended.

Index

Constants

View Source
const (
	MessageWake = "wake"

	Stored    = "stored"
	Accepted  = "accepted"
	Uncertain = "uncertain"
	Resolved  = "resolved"
)
View Source
const (
	HarnessClaude = "claude"
	HarnessCodex  = "codex"
	Preparing     = "preparing"
	Activating    = "activating"
	Applied       = "applied"
	ControlNote   = "note"
	ControlPark   = "park"
	ControlReport = "report"

	Protocol       = 1
	EnvID          = "BEEKEEPER_EXECUTION_ID"
	EnvCoordinator = "BEEKEEPER_EXECUTION_COORDINATOR"
	MaxWire        = 1 << 20
	MaxLog         = 256 << 10
	Prepared       = "prepared"
	Running        = "running"
	Exited         = "exited"
	Failed         = "failed"
	Unknown        = "unknown"
	Reachable      = "reachable"
	Unreachable    = "unreachable"
)
View Source
const ClaudeVersions = ">= 2.1.268, < 3.0.0"

The adapter relies on restricted settings and auth status's configDirectory contract. Pin an exact installed version inside this supported CLI family.

View Source
const CodexVersions = ">= 0.165.0, < 1.0.0"

The codex adapter relies on `exec --json` thread events, `exec resume`, PreToolUse hooks from CODEX_HOME and --dangerously-bypass-hook-trust.

View Source
const LeaseDuration = 90 * time.Second
View Source
const LeaseRenewal = 20 * time.Second
View Source
const MaxSourceBundle = 64 << 20
View Source
const MergeSucceeded = "merged"
View Source
const SourceChunkSize = 256 << 10

Variables

View Source
var ErrNotFound = errors.New("execution journal not found")

ErrNotFound means an inspected execution has no host journal. Other inspection failures never authorize creating or changing a preparation.

View Source
var ErrUnsupported = errors.New("message acceptance is unavailable for this SSH execution or adapter; inspect the original execution before recovery")

Functions

func CoordinatorCall

func CoordinatorCall(ctx context.Context, endpoint Endpoint, host, op string, ref Ref, payload any, key string, result any, run CommandRunner) error

func Decode

func Decode(raw []byte, v any) error

func Digest

func Digest(b []byte) string

func HostPath

func HostPath(s string) bool

func NewControlKey

func NewControlKey() (string, error)

func PublicKey

func PublicKey(k ed25519.PrivateKey) string

func RepositoryIdentity

func RepositoryIdentity(raw string) string

RepositoryIdentity accepts the canonical public GitHub transport forms, without passwords, query strings or a caller-selected credential helper.

func SSHArgv

func SSHArgv(e Endpoint, connect time.Duration, command string) []string

func SSHCommand

func SSHCommand(ctx context.Context, argv []string, stdin []byte) ([]byte, error)

func Sign

func Sign(r StartRequest, key ed25519.PrivateKey, now time.Time) string

func SigningKey

func SigningKey(root string) (ed25519.PrivateKey, error)

SigningKey creates a coordinator key once. Only its public half is ever returned to an operator; provision that half on the host independently.

func SupportedHarness added in v0.174.0

func SupportedHarness(h string) bool

SupportedHarness names the harnesses with a remote adapter. Every other harness starts on the coordinating machine only.

func UnitName

func UnitName(r Ref) string

func ValidDigest

func ValidDigest(s string) bool

func ValidIdentity

func ValidIdentity(s string) bool

func ValidateHandle

func ValidateHandle(h Host, r StartRequest, x Handle) error

func Verify

func Verify(r StartRequest, key string, now time.Time) error

func VerifyCallback

func VerifyCallback(r CallbackRequest, key string) bool

func VerifyLease

func VerifyLease(grant LeaseGrant, request LeaseRequest, ref Ref, coordinator, key string) error

func WriteMergeAuthorization

func WriteMergeAuthorization(root string, grant MergeAuthorization, action string, now time.Time) error

The caller serializes this durable ledger with the coordinating state lock. It records consumption before invoking GitHub, so a crash can never replay a merge. Reconciliation may read GitHub but never repeats a consumed attempt.

Types

type Ack

type Ack struct {
	ID       string `json:"id"`
	Sequence uint64 `json:"sequence"`
	Stage    string `json:"stage"`
}

type ActivationDecision

type ActivationDecision struct {
	Allowed bool `json:"allowed"`
}

ActivationDecision is a fresh coordinator answer, never a cached grant.

type CallbackRequest

type CallbackRequest struct {
	WireRequest
	Proof string `json:"proof"`
}

type Capabilities

type Capabilities struct {
	Publication  bool              `json:"publication"`
	Protocol     int               `json:"protocol"`
	Identity     HostID            `json:"identity"`
	Version      string            `json:"version"`
	PolicyDigest string            `json:"policyDigest"`
	Harnesses    map[string]string `json:"harnesses"`
	// Unavailable names each configured harness that failed its version,
	// login or guard probe. The host advertises only the passing ones.
	Unavailable map[string]string `json:"unavailable,omitempty"`
	Resources   Resources         `json:"resources"`
}

type CommandRunner

type CommandRunner func(context.Context, []string, []byte) ([]byte, error)

CommandRunner is replaced by tests; production uses SSHCommand.

type ControlLedger

type ControlLedger struct {
	Sequence uint64                   `json:"sequence"`
	Results  map[string]ControlResult `json:"results,omitempty"`
}

ControlLedger belongs to one registered execution on the coordinator. Persist it in the same transaction as the mutation apply performs.

func (*ControlLedger) Apply

func (l *ControlLedger) Apply(expected Ref, request ControlRequest, apply func() (string, error)) (ControlResult, error)

Apply returns the original receipt for an exact replay, including an application refusal. Protocol conflicts and gaps call apply zero times. The callback must validate before mutation: a refusal is acknowledged and persisted, so its domain state must remain unchanged on an error.

type ControlRequest

type ControlRequest struct {
	Ref       Ref             `json:"ref"`
	ID        string          `json:"id"`
	Sequence  uint64          `json:"sequence"`
	Operation string          `json:"operation"`
	Data      json.RawMessage `json:"data"`
}

ControlRequest is a host-to-coordinator mutation. Its sequence and receipt survive both processes; it cannot grant authority or select a caller.

func (ControlRequest) ContentDigest

func (r ControlRequest) ContentDigest() string

type ControlResult

type ControlResult struct {
	ID       string `json:"id"`
	Sequence uint64 `json:"sequence"`
	Digest   string `json:"digest"`
	Output   string `json:"output"`
	Error    string `json:"error,omitempty"`
}

type ControlSyncer

type ControlSyncer interface {
	SyncControl(context.Context, Ref) (ControlResult, error)
}

ControlSyncer is the optional host outbox reconciliation operation. It does not implement worker wake acceptance, which remains unsupported.

type Coordinator

type Coordinator struct {
	PublicKey string   `yaml:"publicKey" json:"publicKey"`
	Callback  Endpoint `yaml:"callback" json:"callback"`
}

type Delivery

type Delivery struct {
	Resolution string   `json:"resolution,omitempty"`
	Envelope   Envelope `json:"envelope"`
	Digest     string   `json:"digest"`
	Stage      string   `json:"stage"`
}

func (Delivery) Ack

func (d Delivery) Ack() Ack

type Endpoint

type Endpoint struct {
	SSH        string `yaml:"ssh" json:"ssh"`
	Executable string `yaml:"executable" json:"executable"`
	Config     string `yaml:"config" json:"config"`
}

Endpoint names an operator-provisioned SSH route, never shell source.

func (Endpoint) Validate

func (e Endpoint) Validate() error

type Envelope

type Envelope struct {
	Sender   Sender `json:"sender"`
	ID       string `json:"id"`
	Sequence uint64 `json:"sequence"`
	From     Ref    `json:"from"`
	To       Ref    `json:"to"`
	Kind     string `json:"kind"`
	Text     string `json:"text"`
}

type ExecutionID

type ExecutionID string

type Handle

type Handle struct {
	Ref            Ref    `json:"ref"`
	Repository     string `json:"repository"`
	Commit         string `json:"commit"`
	Workspace      string `json:"workspace"`
	Unit           string `json:"unit"`
	ConversationID string `json:"conversationID"`
}

type HarnessConfig

type HarnessConfig struct {
	Executable string `yaml:"executable" json:"executable"`
	Version    string `yaml:"version" json:"version"`
	ConfigDir  string `yaml:"configDir,omitempty" json:"configDir,omitempty"`
}

type Host

type Host struct {
	Endpoint         `yaml:",inline"`
	Identity         HostID            `yaml:"identity" json:"identity"`
	WorkspaceRoot    string            `yaml:"workspaceRoot" json:"workspaceRoot"`
	Repositories     map[string]string `yaml:"repositories" json:"repositories"`
	Harnesses        []string          `yaml:"harnesses" json:"harnesses"`
	PolicyDigest     string            `yaml:"policyDigest" json:"policyDigest"`
	MaxBusy          int               `yaml:"maxBusy" json:"maxBusy"`
	ConnectTimeout   string            `yaml:"connectTimeout,omitempty" json:"connectTimeout,omitempty"`
	OperationTimeout string            `yaml:"operationTimeout,omitempty" json:"operationTimeout,omitempty"`
}

Host is the coordinator's agents.hosts entry. Timeouts are seconds so the execution contract has no dependency on the configuration package.

func (Host) Supports added in v0.174.0

func (h Host) Supports(harness string) bool

Supports reports whether the operator lists harness for this host.

func (Host) Validate

func (h Host) Validate() error

type HostCommand

type HostCommand func(context.Context, string, []string, string, ...string) ([]byte, error)

type HostConfig

type HostConfig struct {
	RulesFile     string                   `yaml:"rulesFile" json:"rulesFile"`
	Identity      HostID                   `yaml:"identity" json:"identity"`
	WorkspaceRoot string                   `yaml:"workspaceRoot" json:"workspaceRoot"`
	Repositories  map[string]string        `yaml:"repositories" json:"repositories"`
	Harnesses     map[string]HarnessConfig `yaml:"harnesses" json:"harnesses"`
	Coordinators  map[string]Coordinator   `yaml:"coordinators" json:"coordinators"`
	MaxBusy       int                      `yaml:"maxBusy" json:"maxBusy"`
}

HostConfig is operator-owned configuration on the execution host. It is never replaced by a request, a brief or the coordinator's filesystem paths.

func (HostConfig) Validate

func (c HostConfig) Validate() error

type HostID

type HostID string

type Inspector

type Inspector interface {
	Inspect(context.Context, Ref) (Observation, error)
}

type Journal

type Journal struct {
	Lease               *LeaseGrant   `json:"lease,omitempty"`
	LeasePending        *LeaseRequest `json:"leasePending,omitempty"`
	Completed           bool          `json:"completed,omitempty"`
	Messages            MessageLedger `json:"messages,omitempty"`
	ActivationAttempted bool          `json:"activationAttempted"`
	RunnerPID           int           `json:"runnerPID,omitempty"`
	RunnerStarted       time.Time     `json:"runnerStarted,omitempty"`
	LastActive          time.Time     `json:"lastActive,omitzero"`
	Request             StartRequest  `json:"request"`
	Digest              string        `json:"digest"`
	Handle              Handle        `json:"handle"`
	Phase               string        `json:"phase"`
	Ready               bool          `json:"ready"`
	InTurn              bool          `json:"inTurn,omitempty"`
	StopRequest         *StopRequest  `json:"stopRequest,omitempty"`
	StopAcknowledged    bool          `json:"stopAcknowledged"`
	LastError           string        `json:"lastError,omitempty"`
	// Thread is the codex thread the first turn created; every later turn
	// resumes it and the codex guard binds tool calls to it. Claude's
	// conversation is the request's own identity and leaves it empty.
	Thread string `json:"thread,omitempty"`
}

type LeaseGrant

type LeaseGrant struct {
	Ref         Ref       `json:"ref"`
	Coordinator string    `json:"coordinator"`
	Sequence    uint64    `json:"sequence"`
	Nonce       string    `json:"nonce"`
	IssuedAt    time.Time `json:"issuedAt"`
	ExpiresAt   time.Time `json:"expiresAt"`
	Signature   string    `json:"signature"`
}

func IssueLease

func IssueLease(ref Ref, coordinator string, previous *LeaseGrant, request LeaseRequest, key ed25519.PrivateKey, now time.Time) (LeaseGrant, error)

IssueLease is called inside the coordinator's stop/renewal transaction. A repeated request returns its original deadline, never another lease interval.

type LeaseRequest

type LeaseRequest struct {
	Previous uint64 `json:"previous"`
	Nonce    string `json:"nonce"`
}

type LogPage

type LogPage struct {
	Data      []byte `json:"data"`
	Next      string `json:"next"`
	Truncated bool   `json:"truncated"`
}

type LogRequest

type LogRequest struct {
	After string `json:"after"`
	Limit int    `json:"limit"`
}

type Logger

type Logger interface {
	Logs(context.Context, Ref, LogRequest) (LogPage, error)
}

type MergeAudit

type MergeAudit struct {
	At     time.Time `json:"at"`
	Action string    `json:"action"`
}

type MergeAuthorization

type MergeAuthorization struct {
	ReviewDigest string       `json:"reviewDigest"`
	DeskReviewID string       `json:"deskReviewID"`
	ReviewID     string       `json:"reviewID"`
	ID           string       `json:"id"`
	Ref          Ref          `json:"ref"`
	Repository   string       `json:"repository"`
	PR           int          `json:"pr"`
	Head         string       `json:"head"`
	Issuer       string       `json:"issuer"`
	IssuedAt     time.Time    `json:"issuedAt"`
	ExpiresAt    time.Time    `json:"expiresAt"`
	Revoked      bool         `json:"revoked"`
	Consumed     bool         `json:"consumed"`
	Outcome      string       `json:"outcome,omitempty"`
	Audit        []MergeAudit `json:"audit"`
}

MergeAuthorization is coordinator-owned. It is never a bearer credential: every use also authenticates the exact owned execution with the live service.

func ReadMergeAuthorization

func ReadMergeAuthorization(root, id string) (MergeAuthorization, error)

func (MergeAuthorization) Admits

func (g MergeAuthorization) Admits(use MergeUse, now time.Time) error

type MergeResult

type MergeResult struct {
	ID      string `json:"id"`
	Outcome string `json:"outcome"`
}

func UseMerge

func UseMerge(ctx context.Context, root string, use MergeUse, now time.Time, live func(context.Context) error, merge func(context.Context) error) (MergeResult, error)

UseMerge performs one synchronous attempt under the caller's coordinating state transaction. Stop, holds and revocation therefore cannot commit between the live check and command execution. No detached child is permitted.

type MergeUse

type MergeUse struct {
	ID         string `json:"id"`
	Ref        Ref    `json:"ref"`
	Repository string `json:"repository"`
	PR         int    `json:"pr"`
	Head       string `json:"head"`
}

type MessageLedger

type MessageLedger struct {
	Sequence uint64              `json:"sequence"`
	Entries  map[string]Delivery `json:"entries,omitempty"`
}

MessageLedger keeps receipts for the execution's lifetime. Sequence only advances on acceptance; gaps stay stored and an uncertain send blocks replay.

func (*MessageLedger) Accept

func (l *MessageLedger) Accept(id string) error

func (*MessageLedger) Attempt

func (l *MessageLedger) Attempt(m Envelope) error

func (*MessageLedger) Next

func (l *MessageLedger) Next() (Envelope, bool)

func (*MessageLedger) Resolve

func (l *MessageLedger) Resolve(q MessageResolution) (Ack, error)

Resolve explicitly skips a blocked receipt. It records operator intent, not harness acceptance, and never retries an uncertain write.

func (MessageLedger) Status

func (l MessageLedger) Status() []Delivery

Status excludes message text but retains identity and evidence for operators.

func (*MessageLedger) Store

func (l *MessageLedger) Store(ref Ref, m Envelope) (Ack, error)

type MessageResolution

type MessageResolution struct {
	ID     string `json:"id"`
	Reason string `json:"reason"`
}

type MessageResolver

type MessageResolver interface {
	ResolveMessage(context.Context, Ref, MessageResolution) (Ack, error)
}

type Messenger

type Messenger interface {
	Message(context.Context, Ref, Envelope) (Ack, error)
}

type Observation

type Observation struct {
	Lease            *LeaseGrant `json:"lease,omitempty"`
	Messages         []Delivery  `json:"messages,omitempty"`
	MessageSequence  uint64      `json:"messageSequence,omitempty"`
	Handle           Handle      `json:"handle"`
	ProcessState     string      `json:"processState"`
	Reachability     string      `json:"reachability"`
	ObservedAt       time.Time   `json:"observedAt"`
	ReachabilityAt   time.Time   `json:"reachabilityAt"`
	LastActive       time.Time   `json:"lastActive,omitzero"`
	Ready            bool        `json:"ready"`
	InTurn           bool        `json:"inTurn,omitempty"`
	StopRequested    bool        `json:"stopRequested"`
	StopAcknowledged bool        `json:"stopAcknowledged"`
	LastError        string      `json:"lastError,omitempty"`
}

func (Observation) FailedContact

func (o Observation) FailedContact(err error, now time.Time) Observation

FailedContact preserves the last process evidence. A transport failure never establishes completion, releases capacity or changes a worker's task.

type Policy

type Policy struct {
	Protocol            int    `json:"protocol"`
	Version             string `json:"version"`
	ConfigurationDigest string `json:"configurationDigest"`
	RulesDigest         string `json:"rulesDigest"`
	SettingsDigest      string `json:"settingsDigest"`
	// CodexDigest binds the managed CODEX_HOME's config, hooks and rules. It
	// is empty on a host that runs no codex, leaving its policy unchanged.
	CodexDigest string `json:"codexDigest,omitempty"`
}

func (Policy) Digest

func (p Policy) Digest() string

type Receipt

type Receipt struct {
	Ref         Ref       `json:"ref"`
	Coordinator string    `json:"coordinator"`
	Digest      string    `json:"digest"`
	ExpiresAt   time.Time `json:"expiresAt"`
	Signature   string    `json:"signature"`
}

type Ref

type Ref struct {
	Host       HostID      `json:"host"`
	Execution  ExecutionID `json:"execution"`
	Generation uint64      `json:"generation"`
}

func (Ref) Key

func (r Ref) Key() string

func (Ref) Validate

func (r Ref) Validate() error

type Resources

type Resources struct {
	Blocks        []string  `json:"blocks,omitempty"`
	BuildBlocks   []string  `json:"buildBlocks,omitempty"`
	AvailableMiB  int       `json:"availableMiB"`
	Load1         float64   `json:"load1"`
	DiskFreeGiB   float64   `json:"diskFreeGiB"`
	SwapGrowthMiB int       `json:"swapGrowthMiB"`
	BuildBusy     bool      `json:"buildBusy"`
	ObservedAt    time.Time `json:"observedAt"`
}

func (Resources) Validate

func (r Resources) Validate(now time.Time) error

type SSHTransport

type SSHTransport struct {
	Host Host
	Run  CommandRunner
}

func (SSHTransport) Call

func (t SSHTransport) Call(ctx context.Context, op string, ref Ref, payload, result any) error

func (SSHTransport) Check

func (t SSHTransport) Check(ctx context.Context) (Capabilities, error)

func (SSHTransport) Inspect

func (t SSHTransport) Inspect(ctx context.Context, r Ref) (Observation, error)

func (SSHTransport) Logs

func (t SSHTransport) Logs(ctx context.Context, r Ref, q LogRequest) (LogPage, error)

func (SSHTransport) Message

func (t SSHTransport) Message(ctx context.Context, r Ref, m Envelope) (Ack, error)

func (SSHTransport) ResolveMessage

func (t SSHTransport) ResolveMessage(ctx context.Context, r Ref, q MessageResolution) (Ack, error)

func (SSHTransport) Start

func (t SSHTransport) Start(ctx context.Context, r StartRequest) (Handle, error)

func (SSHTransport) Stop

func (t SSHTransport) Stop(ctx context.Context, r Ref, q StopRequest) (Ack, error)

func (SSHTransport) SyncControl

func (t SSHTransport) SyncControl(ctx context.Context, r Ref) (ControlResult, error)

func (SSHTransport) UploadSource added in v0.174.0

func (t SSHTransport) UploadSource(ctx context.Context, ref Ref, data []byte) error

type Sender

type Sender struct {
	Session string `json:"session"`
	Name    string `json:"name"`
	Host    string `json:"host"`
}

Sender is the coordinating caller, retained across SSH and login shells. From and To bind delivery to the owned execution and process generation.

type Server

type Server struct {
	Config                                                HostConfig
	Root, Executable, ConfigPath, Version, SecurityDigest string
	Rules                                                 []byte
	Launcher                                              platform.Launcher
	Command                                               HostCommand
	Combined                                              HostCommand
	Resources                                             func(context.Context) (Resources, error)
	GuardProbe                                            func() error
	Authorize                                             func(context.Context, StartRequest) error
	Callback                                              CommandRunner
	Now                                                   func() time.Time
	OwnUnit                                               func() string
}

Server operates only on journals it created. It never discovers or adopts another conversation, process or unit by name.

func (*Server) Caller

func (s *Server) Caller(id string) (Journal, error)

Caller verifies process ownership through the service cgroup. Environment variables alone cannot impersonate a different worker on the same host.

func (*Server) Check

func (s *Server) Check(ctx context.Context) (Capabilities, error)

func (*Server) Inspect

func (s *Server) Inspect(ctx context.Context, r Ref) (Observation, error)

func (*Server) InstalledPolicy

func (s *Server) InstalledPolicy() (Policy, error)

func (*Server) Logs

func (s *Server) Logs(_ context.Context, r Ref, q LogRequest) (LogPage, error)

func (*Server) Message

func (s *Server) Message(ctx context.Context, ref Ref, m Envelope) (ack Ack, err error)

func (*Server) Policy

func (s *Server) Policy() Policy

Policy describes precisely what prepare installs. ConfigurationDigest also binds the caller's host-local guard configuration, not just these fields.

func (*Server) Prepare

func (s *Server) Prepare(p Policy) (string, error)

func (*Server) Read

func (s *Server) Read(r Ref) (Journal, error)

func (*Server) ReceiveSource added in v0.174.0

func (s *Server) ReceiveSource(ctx context.Context, ref Ref, chunk SourceChunk) error

func (*Server) ResolveMessage

func (s *Server) ResolveMessage(ctx context.Context, ref Ref, q MessageResolution) (ack Ack, err error)

func (*Server) Run

func (s *Server) Run(ctx context.Context, ref Ref) (runErr error)

Run owns one headless turn and its first-task acceptance evidence. Only the execution-run service calls it; caller verification is done by the command.

func (*Server) SendControl

func (s *Server) SendControl(ctx context.Context, j Journal, op string, data any, id string, run CommandRunner) (ControlResult, error)

SendControl stores a mutation before contacting the coordinator. A caller that retries identical data receives the original receipt, including a note number. Different work cannot overtake an unacknowledged mutation.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, input io.Reader, output io.Writer) error

Serve handles one bounded request. EOF and malformed data return a protocol refusal, never an empty successful reply. Diagnostics are not sent as data.

func (*Server) Start

func (s *Server) Start(ctx context.Context, r StartRequest) (Handle, error)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context, r Ref, q StopRequest) (Ack, error)

func (*Server) SyncControl

func (s *Server) SyncControl(ctx context.Context, r Ref, run CommandRunner) (ControlResult, error)

type SourceChunk added in v0.174.0

type SourceChunk struct {
	Offset int64  `json:"offset"`
	Total  int64  `json:"total"`
	Data   []byte `json:"data"`
}

type SourceUploader added in v0.174.0

type SourceUploader interface {
	UploadSource(context.Context, Ref, []byte) error
}

SourceUploader transfers coordinator-fetched objects before preparation. The digest and exact commit are bound into the durable start request.

type StartRequest

type StartRequest struct {
	LeaseRequired  bool   `json:"leaseRequired,omitempty"`
	Messaging      bool   `json:"messaging,omitempty"`
	Builds         bool   `json:"builds"`
	Ref            Ref    `json:"ref"`
	RequestID      string `json:"requestID"`
	Coordinator    string `json:"coordinator"`
	Name           string `json:"name"`
	Task           string `json:"task"`
	Repository     string `json:"repository"`
	GitRef         string `json:"gitRef"`
	SourceDigest   string `json:"sourceDigest,omitempty"`
	Harness        string `json:"harness"`
	Model          string `json:"model"`
	Prompt         string `json:"prompt"`
	PolicyDigest   string `json:"policyDigest"`
	ConversationID string `json:"conversationID"`
	// ControlKey authenticates component callbacks, never provider requests.
	// It travels only in the protected SSH request and owned journals.
	ControlKey          string `json:"controlKey"`
	RegistrationReceipt string `json:"registrationReceipt,omitempty"`
}

func (StartRequest) Digest

func (r StartRequest) Digest() string

func (StartRequest) Validate

func (r StartRequest) Validate() error

type Starter

type Starter interface {
	Start(context.Context, StartRequest) (Handle, error)
}

type StopRequest

type StopRequest struct {
	ID     string `json:"id"`
	Reason string `json:"reason"`
}

type Stopper

type Stopper interface {
	Stop(context.Context, Ref, StopRequest) (Ack, error)
}

type Transport

type Transport interface {
	Starter
	Inspector
	Messenger
	Stopper
	Logger
}

type UnreachableError

type UnreachableError struct {
	Operation string
	Cause     error
}

func (*UnreachableError) Error

func (e *UnreachableError) Error() string

func (*UnreachableError) Unwrap

func (e *UnreachableError) Unwrap() error

type WireRequest

type WireRequest struct {
	Protocol  int             `json:"protocol"`
	RequestID string          `json:"requestID"`
	Operation string          `json:"operation"`
	Ref       Ref             `json:"ref"`
	Payload   json.RawMessage `json:"payload,omitempty"`
}

type WireResponse

type WireResponse struct {
	Protocol  int             `json:"protocol"`
	RequestID string          `json:"requestID"`
	Ref       Ref             `json:"ref"`
	Payload   json.RawMessage `json:"payload,omitempty"`
	Error     string          `json:"error,omitempty"`
	Code      string          `json:"code,omitempty"`
}

Jump to

Keyboard shortcuts

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