installation

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

Package installation manages per-user node configuration and background startup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(cfg node.Config) string

func ApplyStartupChange added in v0.5.0

func ApplyStartupChange(ctx context.Context, config, dataDir, id string) error

ApplyStartupChange runs only in the detached helper after the old runtime exits. It validates the profile again and retains all identity and work files.

func BinPath

func BinPath() (string, error)

func CheckHybridSystem added in v0.5.0

func CheckHybridSystem(ctx context.Context, binary, config, mode string) error

CheckHybridSystem verifies the privileged install's ownership and startup context before consuming an invitation or registering a privileged service.

func CheckHybridUser added in v0.5.7

func CheckHybridUser() error

func CheckLocalAPI added in v0.5.7

func CheckLocalAPI(ctx context.Context, cfg node.Config, id *identity.Identity) error

CheckLocalAPI reports a local API port held by something other than this profile's own node. It allows a brief wait for a node that is still stopping.

func CheckServiceMode

func CheckServiceMode(mode string) error

func CheckServiceProfile

func CheckServiceProfile(config, mode string) error

CheckServiceProfile validates installation privileges before credentials are issued or an invitation is redeemed, including system-to-user migration.

func CheckUserStartup added in v0.5.7

func CheckUserStartup(ctx context.Context, mode string) error

CheckUserStartup verifies the login-session service manager that User startup depends on. Other modes have no such dependency or fall back to a process.

func ConfigPath

func ConfigPath() string

func FinishRetiredHelper

func FinishRetiredHelper(id string)

FinishRetiredHelper releases a one-shot service-manager registration after the helper has written its result. Linux transient units collect themselves.

func Home

func Home() string

func InstallAgent

func InstallAgent(ctx context.Context, agent, project, binary, config string, mcp, skill bool) error

func InstallSelf

func InstallSelf(ctx context.Context) (string, error)

func InstallSystemSelf added in v0.5.0

func InstallSystemSelf(ctx context.Context) (string, error)

InstallSystemSelf installs a private service executable without adding its administrator-only directory to the interactive user's PATH.

func PrepareStartupChange added in v0.5.0

func PrepareStartupChange(ctx context.Context, config, id, mode string) error

PrepareStartupChange never prompts for elevation. Only Windows supports an identity-preserving System migration. Hybrid and Unix need local installers.

func ReadConfig

func ReadConfig(path string) (node.Config, error)

func RefreshLegacyUnixStartup added in v0.8.4

func RefreshLegacyUnixStartup(ctx context.Context, profile UpdateStartup, directory string, selected update.RuntimeBinary) error

RefreshLegacyUnixStartup runs before the new child opens work admission. The old parent cannot exec at its child's request, but its original service manager can restart a refreshed entry point after propagating a deliberate child failure. Keep the job, its account, installation identity, and persisted selection intact.

func RemoveRetiredHelper added in v0.5.7

func RemoveRetiredHelper(config string)

RemoveRetiredHelper deletes the running uninstall helper of a retired Hybrid companion after cleanup succeeds. Other profiles reuse their state directory, and retry cleanup with the same helper if it fails.

func SaveAdmin

func SaveAdmin(p AdminProfile) error

func SaveUpdateAdmin

func SaveUpdateAdmin(p AdminProfile) error

func ScheduleRetiredUninstall

func ScheduleRetiredUninstall(config, id string) error

ScheduleRetiredUninstall starts an independent cleanup process. It must outlive the node runtime, including its service-manager process group. Unmanaged node processes have no installation to remove.

func Service

func Service(ctx context.Context, operation, binary, config, mode string) error

func ServiceMode

func ServiceMode(config, mode string) (string, error)

ServiceMode resolves the saved startup selection without changing the profile.

func StartTunnelService

func StartTunnelService(ctx context.Context, binary, dir string) error

StartTunnelService installs a separate user startup entry, never a fleet node.

func UninstallRetired

func UninstallRetired(ctx context.Context, config, dataDir, id string) error

UninstallRetired removes only an installation whose identity has a durable unregistration policy. The installation lock serializes cleanup with enrollment; the runtime and node locks ensure work has stopped before deleting the launcher.

func UserStartupWarning added in v0.5.7

func UserStartupWarning() string

func ValidateServiceMode

func ValidateServiceMode(mode string) error

ValidateServiceMode rejects unknown startup modes on every platform.

func WindowsRuntimePath

func WindowsRuntimePath(dir string) string

WindowsRuntimePath is the stable executable path covered by the node's firewall rules. Installation and temporary updaters publish copies between runs.

Types

type AdminProfile

type AdminProfile struct {
	Gateway string `json:"gateway"`
	Key     string `json:"key"`
}

func ReadAdmin

func ReadAdmin() (AdminProfile, error)

func ReadUpdateAdmin

func ReadUpdateAdmin() (AdminProfile, error)

type AgentPaths

type AgentPaths struct {
	MCP, Skill string
	ServerPath []string
	TOML       bool
}

func AgentLocations

func AgentLocations(agent, home, project string) (AgentPaths, error)

type UpdateResult

type UpdateResult struct {
	Path    string
	Version string
	Changed bool
}

func UpdateSelf

func UpdateSelf(ctx context.Context, repository, version string) (UpdateResult, error)

UpdateSelf replaces the invoked CLI, independently of gateway-managed services.

type UpdateStartup added in v0.8.4

type UpdateStartup struct{ Config, Binary, Mode, ID string }

UpdateStartup binds an update migration to one remembered installation.

func ReadUpdateStartup added in v0.8.4

func ReadUpdateStartup(config, directory string) (UpdateStartup, error)

Jump to

Keyboard shortcuts

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