Documentation
¶
Index ¶
- Constants
- func Fingerprint(content []byte) string
- func SaveManifest(path string, manifest Manifest) error
- func VerifyOwnership(entry ManifestEntry, content []byte) error
- type AdapterDeps
- type AntigravityAdapter
- func (a *AntigravityAdapter) Detect(root string) Detection
- func (a *AntigravityAdapter) Inspect(root string, scope Scope) (HostState, error)
- func (a *AntigravityAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
- func (a *AntigravityAdapter) Name() string
- func (a *AntigravityAdapter) Plan(root string, scope Scope) (HostPlan, error)
- func (a *AntigravityAdapter) Scopes() []Scope
- func (a *AntigravityAdapter) Verify(root string) Verification
- type ClaudeCodeAdapter
- func (a *ClaudeCodeAdapter) Detect(root string) Detection
- func (a *ClaudeCodeAdapter) Inspect(root string, scope Scope) (HostState, error)
- func (a *ClaudeCodeAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)
- func (a *ClaudeCodeAdapter) Name() string
- func (a *ClaudeCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)
- func (a *ClaudeCodeAdapter) Scopes() []Scope
- func (a *ClaudeCodeAdapter) Verify(root string) Verification
- type CodexAdapter
- func (a *CodexAdapter) Detect(root string) Detection
- func (a *CodexAdapter) Inspect(root string, scope Scope) (HostState, error)
- func (a *CodexAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)
- func (a *CodexAdapter) Name() string
- func (a *CodexAdapter) Plan(root string, scope Scope) (HostPlan, error)
- func (a *CodexAdapter) Scopes() []Scope
- func (a *CodexAdapter) Verify(root string) Verification
- type CommandRunner
- type Confidence
- type CursorAdapter
- func (a *CursorAdapter) Detect(root string) Detection
- func (a *CursorAdapter) Inspect(root string, scope Scope) (HostState, error)
- func (a *CursorAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
- func (a *CursorAdapter) Name() string
- func (a *CursorAdapter) Plan(root string, scope Scope) (HostPlan, error)
- func (a *CursorAdapter) Scopes() []Scope
- func (a *CursorAdapter) Verify(root string) Verification
- type Detection
- type DetectionProbe
- type Detector
- type HostAction
- type HostAdapter
- type HostPlan
- type HostResult
- type HostState
- type JSONMergeOptions
- type JSONMergeResult
- type Manifest
- type ManifestEntry
- type Registry
- func (r *Registry) Adapters() []HostAdapter
- func (r *Registry) Detect(root string) []Detection
- func (r *Registry) Get(name string) (HostAdapter, bool)
- func (r *Registry) Install(ctx context.Context, plan HostPlan) (HostResult, error)
- func (r *Registry) Names() []string
- func (r *Registry) Plan(name, root string, scope Scope) (HostPlan, error)
- type Scope
- type Selection
- type VSCodeAdapter
- func (a *VSCodeAdapter) Detect(root string) Detection
- func (a *VSCodeAdapter) Inspect(root string, scope Scope) (HostState, error)
- func (a *VSCodeAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
- func (a *VSCodeAdapter) Name() string
- func (a *VSCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)
- func (a *VSCodeAdapter) Scopes() []Scope
- func (a *VSCodeAdapter) Verify(root string) Verification
- type Verification
Constants ¶
const ManifestVersion = 1
Variables ¶
This section is empty.
Functions ¶
func Fingerprint ¶
func SaveManifest ¶
func VerifyOwnership ¶
func VerifyOwnership(entry ManifestEntry, content []byte) error
Types ¶
type AdapterDeps ¶
type AdapterDeps struct {
Detector Detector
Run CommandRunner
Now func() time.Time
}
type AntigravityAdapter ¶
type AntigravityAdapter struct {
// contains filtered or unexported fields
}
func NewAntigravityAdapter ¶
func NewAntigravityAdapter() *AntigravityAdapter
func NewAntigravityAdapterWithDeps ¶
func NewAntigravityAdapterWithDeps(deps AdapterDeps) *AntigravityAdapter
func (*AntigravityAdapter) Detect ¶
func (a *AntigravityAdapter) Detect(root string) Detection
func (*AntigravityAdapter) Inspect ¶
func (a *AntigravityAdapter) Inspect(root string, scope Scope) (HostState, error)
func (*AntigravityAdapter) Install ¶
func (a *AntigravityAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
func (*AntigravityAdapter) Name ¶
func (a *AntigravityAdapter) Name() string
func (*AntigravityAdapter) Plan ¶
func (a *AntigravityAdapter) Plan(root string, scope Scope) (HostPlan, error)
func (*AntigravityAdapter) Scopes ¶
func (a *AntigravityAdapter) Scopes() []Scope
func (*AntigravityAdapter) Verify ¶
func (a *AntigravityAdapter) Verify(root string) Verification
type ClaudeCodeAdapter ¶
type ClaudeCodeAdapter struct {
// contains filtered or unexported fields
}
func NewClaudeCodeAdapter ¶
func NewClaudeCodeAdapter() *ClaudeCodeAdapter
func NewClaudeCodeAdapterWithDeps ¶
func NewClaudeCodeAdapterWithDeps(deps AdapterDeps) *ClaudeCodeAdapter
func (*ClaudeCodeAdapter) Detect ¶
func (a *ClaudeCodeAdapter) Detect(root string) Detection
func (*ClaudeCodeAdapter) Inspect ¶
func (a *ClaudeCodeAdapter) Inspect(root string, scope Scope) (HostState, error)
func (*ClaudeCodeAdapter) Install ¶
func (a *ClaudeCodeAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)
func (*ClaudeCodeAdapter) Name ¶
func (a *ClaudeCodeAdapter) Name() string
func (*ClaudeCodeAdapter) Plan ¶
func (a *ClaudeCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)
func (*ClaudeCodeAdapter) Scopes ¶
func (a *ClaudeCodeAdapter) Scopes() []Scope
func (*ClaudeCodeAdapter) Verify ¶
func (a *ClaudeCodeAdapter) Verify(root string) Verification
type CodexAdapter ¶
type CodexAdapter struct {
NativeProjectCLI bool
// contains filtered or unexported fields
}
CodexAdapter uses a manual project config by default because the current official `codex mcp add` command writes user configuration and has no project scope flag. NativeProjectCLI is an explicit capability switch for a future Codex release that provides project-scoped registration.
func NewCodexAdapter ¶
func NewCodexAdapter() *CodexAdapter
func NewCodexAdapterWithDeps ¶
func NewCodexAdapterWithDeps(deps AdapterDeps, nativeProjectCLI bool) *CodexAdapter
func (*CodexAdapter) Detect ¶
func (a *CodexAdapter) Detect(root string) Detection
func (*CodexAdapter) Inspect ¶
func (a *CodexAdapter) Inspect(root string, scope Scope) (HostState, error)
func (*CodexAdapter) Install ¶
func (a *CodexAdapter) Install(ctx context.Context, plan HostPlan) (HostResult, error)
func (*CodexAdapter) Name ¶
func (a *CodexAdapter) Name() string
func (*CodexAdapter) Scopes ¶
func (a *CodexAdapter) Scopes() []Scope
func (*CodexAdapter) Verify ¶
func (a *CodexAdapter) Verify(root string) Verification
type CommandRunner ¶
type Confidence ¶
type Confidence string
Confidence describes how strongly detection evidence identifies a host.
const ( ConfidenceNone Confidence = "none" ConfidenceLow Confidence = "low" ConfidenceMedium Confidence = "medium" ConfidenceHigh Confidence = "high" )
type CursorAdapter ¶
type CursorAdapter struct {
// contains filtered or unexported fields
}
func NewCursorAdapter ¶
func NewCursorAdapter() *CursorAdapter
func NewCursorAdapterWithDeps ¶
func NewCursorAdapterWithDeps(deps AdapterDeps) *CursorAdapter
func (*CursorAdapter) Detect ¶
func (a *CursorAdapter) Detect(root string) Detection
func (*CursorAdapter) Inspect ¶
func (a *CursorAdapter) Inspect(root string, scope Scope) (HostState, error)
func (*CursorAdapter) Install ¶
func (a *CursorAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
func (*CursorAdapter) Name ¶
func (a *CursorAdapter) Name() string
func (*CursorAdapter) Plan ¶
func (a *CursorAdapter) Plan(root string, scope Scope) (HostPlan, error)
func (*CursorAdapter) Scopes ¶
func (a *CursorAdapter) Scopes() []Scope
func (*CursorAdapter) Verify ¶
func (a *CursorAdapter) Verify(root string) Verification
type Detection ¶
type Detection struct {
Host string `json:"host"`
Detected bool `json:"detected"`
Executable string `json:"executable"`
ProjectConfig string `json:"projectConfig"`
Scopes []Scope `json:"scopes"`
Method string `json:"method"`
Confidence Confidence `json:"confidence"`
Reason string `json:"reason"`
}
Detection is evidence gathered without executing or modifying the host.
type DetectionProbe ¶
DetectionProbe describes passive evidence for one host.
type Detector ¶
type Detector struct {
LookPath func(string) (string, error)
Stat func(string) (os.FileInfo, error)
}
Detector permits hermetic PATH and filesystem tests.
func DefaultDetector ¶
func DefaultDetector() Detector
type HostAction ¶
type HostAction struct {
Kind string `json:"kind"`
Target string `json:"target"`
Command string `json:"command"`
Args []string `json:"args"`
Description string `json:"description"`
}
HostAction is one deterministic install step. Command and Args are separate so adapters never need shell concatenation.
type HostAdapter ¶
type HostAdapter interface {
Name() string
Scopes() []Scope
Detect(root string) Detection
Plan(root string, scope Scope) (HostPlan, error)
Install(ctx context.Context, plan HostPlan) (HostResult, error)
Inspect(root string, scope Scope) (HostState, error)
Verify(root string) Verification
}
HostAdapter isolates host-specific schemas and commands from init orchestration.
type HostPlan ¶
type HostPlan struct {
Host string `json:"host"`
Root string `json:"root"`
Scope Scope `json:"scope"`
Actions []HostAction `json:"actions"`
Warnings []string `json:"warnings"`
}
HostPlan describes a proposed host mutation.
type HostResult ¶
type HostResult struct {
Host string `json:"host"`
Status string `json:"status"`
Changed bool `json:"changed"`
Targets []string `json:"targets"`
Backups []string `json:"backups"`
Warnings []string `json:"warnings"`
NextAction string `json:"nextAction"`
}
HostResult describes the outcome of applying a HostPlan.
type HostState ¶
type HostState struct {
Host string `json:"host"`
Scope Scope `json:"scope"`
Registered bool `json:"registered"`
Owned bool `json:"owned"`
Target string `json:"target"`
Fingerprint string `json:"fingerprint"`
Reason string `json:"reason"`
}
HostState is the inspectable registration state of an adapter.
type JSONMergeOptions ¶
type JSONMergeResult ¶
type JSONMergeResult struct {
Changed bool `json:"changed"`
Target string `json:"target"`
Backup string `json:"backup"`
}
func MergeJSONServer ¶
func MergeJSONServer(options JSONMergeOptions) (JSONMergeResult, error)
MergeJSONServer mutates one named nested server entry, preserving all other semantic JSON values. Existing files are backed up before atomic replacement.
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Entries []ManifestEntry `json:"entries"`
}
func LoadManifest ¶
func NewManifest ¶
func NewManifest() Manifest
type ManifestEntry ¶
type ManifestEntry struct {
Host string `json:"host"`
Scope Scope `json:"scope"`
ServerName string `json:"serverName"`
Root string `json:"root"`
RootStrategy string `json:"rootStrategy"`
Method string `json:"method"`
Target string `json:"target"`
Fingerprint string `json:"fingerprint"`
InstalledAt string `json:"installedAt,omitempty"`
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores adapters by stable CLI name.
func DefaultRegistry ¶
func DefaultRegistry() *Registry
DefaultRegistry contains the supported project-scoped coding-agent adapters.
func MustRegistry ¶
func MustRegistry(adapters ...HostAdapter) *Registry
func NewRegistry ¶
func NewRegistry(adapters ...HostAdapter) (*Registry, error)
func (*Registry) Adapters ¶
func (r *Registry) Adapters() []HostAdapter
type Selection ¶
type Selection struct {
Selected []string `json:"selected"`
Suggestions []string `json:"suggestions"`
Ambiguous bool `json:"ambiguous"`
Reason string `json:"reason"`
}
Selection is a non-mutating resolution of an --agent choice.
type VSCodeAdapter ¶
type VSCodeAdapter struct {
// contains filtered or unexported fields
}
func NewVSCodeAdapter ¶
func NewVSCodeAdapter() *VSCodeAdapter
func NewVSCodeAdapterWithDeps ¶
func NewVSCodeAdapterWithDeps(deps AdapterDeps) *VSCodeAdapter
func (*VSCodeAdapter) Detect ¶
func (a *VSCodeAdapter) Detect(root string) Detection
func (*VSCodeAdapter) Inspect ¶
func (a *VSCodeAdapter) Inspect(root string, scope Scope) (HostState, error)
func (*VSCodeAdapter) Install ¶
func (a *VSCodeAdapter) Install(_ context.Context, plan HostPlan) (HostResult, error)
func (*VSCodeAdapter) Name ¶
func (a *VSCodeAdapter) Name() string
func (*VSCodeAdapter) Plan ¶
func (a *VSCodeAdapter) Plan(root string, scope Scope) (HostPlan, error)
func (*VSCodeAdapter) Scopes ¶
func (a *VSCodeAdapter) Scopes() []Scope
func (*VSCodeAdapter) Verify ¶
func (a *VSCodeAdapter) Verify(root string) Verification