agent

package
v0.8.19 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package agent defines and validates the process specifications used by Relayer. It intentionally contains no process-launching logic.

Index

Constants

View Source
const (
	// BackendPTY selects Relayer's built-in pseudo-terminal implementation.
	BackendPTY = "pty"
	// BackendTmux selects detached tmux sessions with an interactive attach path.
	BackendTmux = "tmux"
	// BackendAuto prefers tmux when it is available and falls back to PTY.
	BackendAuto = "auto"

	// AdapterGeneric selects the built-in prompt adapter that works with any
	// command-line program.
	AdapterGeneric = "generic"
)

Variables

This section is empty.

Functions

func IsSensitiveEnvName

func IsSensitiveEnvName(name string) bool

IsSensitiveEnvName reports whether an environment variable name commonly carries credentials. It is deliberately conservative because callers use this classification to prevent accidental display of values.

func IsSupportedBackend

func IsSupportedBackend(name string) bool

IsSupportedBackend reports whether name is a backend selector understood by Relayer. BackendAuto is a selector rather than a concrete runtime backend.

Types

type Spec

type Spec struct {
	ID      string
	Name    string
	Command []string
	Shell   string
	Cwd     string
	Env     map[string]string
	Adapter string
	Backend string
}

Spec describes one agent process. Command contains an executable followed by its arguments, while Shell contains a script interpreted by the platform shell. Exactly one of Command and Shell must be configured.

func ValidateAll

func ValidateAll(specs []Spec, baseDir, defaultBackend string) ([]Spec, error)

ValidateAll validates every specification and rejects identifiers that only differ by case. The returned slice and every mutable field are independent from the input.

func ValidateSpec

func ValidateSpec(spec Spec, baseDir, defaultBackend string) (Spec, error)

ValidateSpec validates and normalizes spec without retaining any of its mutable storage. Relative working directories are resolved from baseDir.

Jump to

Keyboard shortcuts

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