Documentation
¶
Index ¶
- Constants
- Variables
- func WrapperFor(_ Agent) string
- type Adapter
- type AdapterEnvironment
- type Agent
- type Capabilities
- type CommandRunner
- type Detection
- type Diagnosis
- type ExecRunner
- type ExecutableVersion
- type InstallOptions
- type Integrity
- type Manager
- func (m *Manager) Diagnose(ctx context.Context) ([]Diagnosis, error)
- func (m *Manager) DiagnoseAgents(ctx context.Context, selected []string) ([]Diagnosis, error)
- func (m *Manager) Install(options InstallOptions) (Result, error)
- func (m *Manager) Integrity() ([]Integrity, error)
- func (m *Manager) Remove(options InstallOptions) (Result, error)
- type Result
Constants ¶
const ( MethodManagedFile = "managed-file" MethodNativeCommand = "native-command" MethodPathProbe = "path-probe" )
Variables ¶
var SupportedAgents = func() []Agent { result := make([]Agent, 0, len(adapters)) for _, adapter := range adapters { result = append(result, adapter.Agent()) } return result }()
SupportedAgents preserves the existing setup/validation API while the adapters own operational behavior.
Functions ¶
func WrapperFor ¶
Types ¶
type Adapter ¶
type Adapter interface {
Agent() Agent
Capabilities() Capabilities
Detect(context.Context, AdapterEnvironment) Detection
Install(context.Context, adapterOperation) ([]targetFile, error)
Remove(context.Context, adapterOperation) ([]targetFile, error)
Diagnose(context.Context, diagnosticContext) Diagnosis
Version(context.Context, AdapterEnvironment, Detection) ExecutableVersion
}
Adapter is the capability boundary for a supported coding agent. Install and Remove return mutation plans so Manager can preserve its transactional multi-agent write, backup, rollback, and ownership guarantees.
func AdapterByID ¶
type AdapterEnvironment ¶
type AdapterEnvironment struct {
Home string
LookPath func(string) (string, error)
Runner CommandRunner
Environment []string
Timeout time.Duration
}
func DefaultAdapterEnvironment ¶
func DefaultAdapterEnvironment(home string) AdapterEnvironment
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `json:"name"`
Executable string `json:"executable"`
UserPath string `json:"user_path"`
ProjectPath string `json:"project_path"`
DetectionPath string `json:"detection_path"`
SingleFile bool `json:"single_file"`
}
Agent is the stable, user-visible identity and path contract for an integration. Operational behavior belongs to its Adapter.
func DetectWithEnvironment ¶
func DetectWithEnvironment(ctx context.Context, environment AdapterEnvironment) []Agent
type Capabilities ¶
type Capabilities struct {
DetectMethod string `json:"detect_method"`
InstallMethod string `json:"install_method"`
RemoveMethod string `json:"remove_method"`
DiagnoseMethod string `json:"diagnose_method"`
VersionMethod string `json:"version_method"`
Scopes []string `json:"scopes"`
}
Capabilities makes each adapter's mutation and inspection mechanisms explicit. NativeCommand is used only for the read-only version probe in the current catalog; installation and removal remain managed-file-backed.
type CommandRunner ¶
CommandRunner is the subprocess seam used by safe, side-effect-free adapter probes. Implementations receive argument arrays and an allowlisted environment; adapters never build shell command strings.
type Diagnosis ¶
type Diagnosis struct {
Agent Agent `json:"agent"`
Capabilities Capabilities `json:"capabilities"`
Detection Detection `json:"detection"`
ExecutableVersion ExecutableVersion `json:"executable_version"`
Installed bool `json:"installed"`
Status string `json:"status"`
Method string `json:"method"`
Scopes []string `json:"scopes,omitempty"`
ExpectedVersion string `json:"expected_version"`
InstalledVersion string `json:"installed_version,omitempty"`
RegistrationID string `json:"registration_id,omitempty"`
Files []Integrity `json:"files,omitempty"`
RepairCommands []string `json:"repair_commands,omitempty"`
ExecutableDiagnostic string `json:"executable_diagnostic,omitempty"`
}
type ExecRunner ¶
type ExecRunner struct{}
type ExecutableVersion ¶
type InstallOptions ¶
type Integrity ¶
type Integrity struct {
Path string `json:"path"`
Status string `json:"status"`
Agent string `json:"agent,omitempty"`
Method string `json:"method,omitempty"`
Scope string `json:"scope,omitempty"`
InstalledVersion string `json:"installed_version,omitempty"`
Expected string `json:"expected_digest,omitempty"`
Actual string `json:"actual_digest,omitempty"`
}
type Manager ¶
type Manager struct {
Assets fs.FS
Config *config.Store
Home string
Now func() time.Time
Runtime AdapterEnvironment
}