clients

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 14 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.1

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 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