setup

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package setup checks, installs and removes what the loop needs in the configuration homes of the coding agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallCommand

func InstallCommand(command, home string) string

InstallCommand is the command that installs the loop into one home.

func SessionValue

func SessionValue(vars []string) string

SessionValue is the value, in the loop's MCP registration, that the agent expands to the handle its manager gave the session: the first of vars that is set, as ${A:-${B}}.

func TrustCommand

func TrustCommand(command, home, folder string) string

TrustCommand is the command that trusts the repository of folder in home.

Types

type AgentHome

type AgentHome interface {
	Check(ctx context.Context, home string) ([]Finding, error)
	Install(ctx context.Context, home string, dryRun bool) ([]string, error)
	Remove(ctx context.Context, home string, dryRun bool) ([]string, error)
}

AgentHome is one agent's configuration home. Install and Remove return a line per entry they add, change, back up or remove.

type Finding

type Finding struct {
	// Problem is "" when the entry is present and right.
	Home, Entry, Problem, Fix string
}

Finding is one entry the loop needs in an agent home.

type HomeKind

type HomeKind interface {
	New(s HomeSpec) AgentHome
	// Find lists the homes of this kind on this machine.
	Find(s HomeSpec) []string
	// Default is the home the agent reads with no override.
	Default(userHome string) string
	// SkillsRoot is the directory whose skills/<name>/SKILL.md the agent reads in home, "" for none.
	SkillsRoot(home string) string
}

HomeKind is one agent's configuration homes.

type HomeOwner

type HomeOwner interface {
	Owns(dir string) bool
}

HomeOwner is a HomeKind that can tell its homes from another kind's.

type HomeSpec

type HomeSpec struct {
	Command, MCPURL, UserHome string
	// MCPKey is the secret the MCP endpoint requires, "" before install writes one.
	MCPKey string
	// CallerHome is the home of the session running the loop, "" when unset.
	CallerHome string
	// SessionVars are the variables the enabled workspace managers set, in a
	// session's agent process, to the handle of its process; one manager's
	// sessions leave every other's unset.
	SessionVars []string
	// ManagerHomes are the homes of this kind the workspace manager keeps.
	ManagerHomes []string
	// AtOnceTools are the tools that post as the user at once, as an agent names them, which an install
	// allows without a prompt.
	AtOnceTools []string
	Now         func() time.Time
}

HomeSpec is what an agent's home installer needs from this process.

type Service

type Service struct{ Home AgentHome }

func (Service) Check

func (s Service) Check(ctx context.Context, homes []string) ([]Finding, error)

func (Service) Install

func (s Service) Install(ctx context.Context, homes []string, dryRun bool) ([]string, error)

func (Service) Remove

func (s Service) Remove(ctx context.Context, homes []string, dryRun bool) ([]string, error)

Jump to

Keyboard shortcuts

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