agentprotocol

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetKindLocalEnvironment = "local_environment"

	TargetStatusAvailable     = "available"
	TargetStatusConfigured    = "configured"
	TargetStatusNotConfigured = "not_configured"

	CapabilityLocalUI       = "local_ui"
	CapabilityRemoteControl = "remote_control"
	CapabilityFiles         = "files"
	CapabilityTerminal      = "terminal"
	CapabilityMonitor       = "monitor"
	CapabilityGit           = "git"
	CapabilityFlower        = "flower"
	CapabilityCodexGateway  = "codex_gateway"
)
View Source
const (
	ErrCodeAgentProtocol         = "AGENT_PROTOCOL_ERROR"
	ErrCodeTargetDiscoveryFailed = "TARGET_DISCOVERY_FAILED"
	ErrCodeTargetMissing         = "TARGET_MISSING"
	ErrCodeTargetNotFound        = "TARGET_NOT_FOUND"
)
View Source
const SchemaVersion = 1

Variables

View Source
var ErrTargetNotFound = errors.New("target not found")

Functions

func MarshalJSONLine

func MarshalJSONLine(resp Response) ([]byte, error)

Types

type DiscoverTargetsOptions

type DiscoverTargetsOptions struct {
	StateRoot string
}

type Response

type Response struct {
	SchemaVersion int            `json:"schema_version"`
	OK            bool           `json:"ok"`
	Data          any            `json:"data,omitempty"`
	Error         *ResponseError `json:"error,omitempty"`
	Trace         ResponseTrace  `json:"trace"`
}

func Failure

func Failure(code string, message string, targetID string) Response

func Success

func Success(data any, targetID string) Response

type ResponseError

type ResponseError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ResponseTrace

type ResponseTrace struct {
	RequestID string `json:"request_id"`
	TargetID  string `json:"target_id,omitempty"`
	Source    string `json:"source"`
}

type TargetCatalog

type TargetCatalog struct {
	Targets []TargetDescriptor `json:"targets"`
}

func DiscoverTargets

func DiscoverTargets(opts DiscoverTargetsOptions) (TargetCatalog, error)

type TargetDescriptor

type TargetDescriptor struct {
	ID                    string   `json:"id"`
	Kind                  string   `json:"kind"`
	Label                 string   `json:"label"`
	Status                string   `json:"status"`
	StateRoot             string   `json:"state_root,omitempty"`
	StateDir              string   `json:"state_dir,omitempty"`
	ConfigPath            string   `json:"config_path,omitempty"`
	RuntimeStatePath      string   `json:"runtime_state_path,omitempty"`
	LocalUIURL            string   `json:"local_ui_url,omitempty"`
	LocalUIURLs           []string `json:"local_ui_urls,omitempty"`
	PasswordRequired      bool     `json:"password_required,omitempty"`
	EffectiveRunMode      string   `json:"effective_run_mode,omitempty"`
	RemoteEnabled         bool     `json:"remote_enabled,omitempty"`
	DesktopManaged        bool     `json:"desktop_managed,omitempty"`
	ControlplaneBaseURL   string   `json:"controlplane_base_url,omitempty"`
	ControlplaneProvider  string   `json:"controlplane_provider_id,omitempty"`
	EnvPublicID           string   `json:"env_public_id,omitempty"`
	LocalEnvironmentID    string   `json:"local_environment_public_id,omitempty"`
	AgentHomeDir          string   `json:"agent_home_dir,omitempty"`
	Shell                 string   `json:"shell,omitempty"`
	Capabilities          []string `json:"capabilities"`
	UnavailableReasonCode string   `json:"unavailable_reason_code,omitempty"`
}

func ResolveTarget

func ResolveTarget(catalog TargetCatalog, rawTarget string) (TargetDescriptor, error)

Jump to

Keyboard shortcuts

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