Help us shape the future of Go! Take the 2026 Go Developer Survey

clients

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvDispatchActive blocks nested Agent Dispatch calls inside dispatched children.
	EnvDispatchActive = "AL_DISPATCH_ACTIVE"
)

Variables

This section is empty.

Functions

func BuildEnv

func BuildEnv(base []string, projectEnv map[string]string, runInfo *run.Info) []string

BuildEnv merges base env with project env and run metadata. It strips AL_SHIM_ACTIVE because child processes are new execution contexts that should be free to dispatch independently; the dispatch guard is only meaningful for the exec replacement chain. It also strips AL_DISPATCH_ACTIVE so a leaked marker from the parent shell does not poison normal (non-dispatch) launches; the dispatch flow re-sets the marker explicitly on the dispatched child.

func ExecHandoff added in v0.12.0

func ExecHandoff(path string, argv []string, env []string) error

ExecHandoff replaces the current al process with the target binary. On success it never returns. argv[0] must be the program name.

func GetEnv

func GetEnv(env []string, key string) (string, bool)

GetEnv returns the value for the key from an env slice.

func MergeArgs added in v0.23.1

func MergeArgs(defaults, passArgs []string, aliases map[string]string, valueOptions []string, additive ...string) []string

MergeArgs removes generated options explicitly supplied by the caller before appending passArgs unchanged. defaults must contain only options, with values either joined by '=' or following options named in valueOptions. aliases maps native alternative spellings to the generated spelling; an empty mapping marks a valueless short option that can precede a value option in a cluster. additive explicitly names native repeatable value options: retain their generated entries unless the caller supplies the same value. Repeated caller options remain unchanged. This is not a full native argument parser: flag-shaped separate caller values may still be mistaken for options. Use --option=value for such literal values.

func ResolvePath added in v0.8.5

func ResolvePath(path string) string

ResolvePath returns the absolute, symlink-resolved form of a path. If resolution fails at any step, it returns the best result available.

func Run

func Run(ctx context.Context, root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, currentVersion string) error

Run performs the standard client launch pipeline: load config, sync, create run dir, launch. Warnings from sync are printed to stderr before launching.

func RunNoSync added in v0.5.8

func RunNoSync(root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string) error

RunNoSync performs the standard client launch pipeline without running sync.

func RunNoSyncWithStderr added in v0.8.1

func RunNoSyncWithStderr(root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, stderr io.Writer) error

RunNoSyncWithStderr is like RunNoSync but allows specifying a custom stderr writer for testing.

func RunWithStderr

func RunWithStderr(ctx context.Context, root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, currentVersion string, stderr io.Writer) error

RunWithStderr is like Run but allows specifying a custom stderr writer for testing.

func SamePath added in v0.8.5

func SamePath(a, b string) bool

SamePath returns true if two paths resolve to the same filesystem location, accounting for symlinks and relative paths.

func SetEnv

func SetEnv(env []string, key string, value string) []string

SetEnv sets or appends a key=value entry in an env slice.

func UnsetEnv added in v0.6.1

func UnsetEnv(env []string, key string) []string

UnsetEnv removes all entries for the given key from an env slice. If key is empty, it returns env unchanged.

Types

type EnabledSelector

type EnabledSelector func(cfg *config.Config) *bool

EnabledSelector returns the enabled flag for a client.

type LaunchFunc

type LaunchFunc func(project *config.ProjectConfig, runInfo *run.Info, env []string, args []string) error

LaunchFunc launches a client after sync and run setup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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