Documentation
¶
Overview ¶
Package setup owns local coding-client detection and MCP registration.
Index ¶
- Variables
- func CheckRegistration(client Client, home string) (bool, string, error)
- func CodexSkillInstalled(home string) (bool, string, error)
- func CodexSkillPath(home string) string
- func ResolveNPMVersion(version string) (string, error)
- func ValidateLauncher(launcher Launcher) error
- type ActivationRollbackError
- type Client
- type CodexSkillResult
- type Launcher
- type Operation
- type Options
- type RegistrationInspection
- type RegistrationStatus
- type Report
- func ActivateExisting(ctx context.Context, opts Options) (Report, error)
- func ActivateExistingAndVerify(ctx context.Context, opts Options, verify func() error) (_ Report, returnErr error)
- func RepairExisting(ctx context.Context, home string, clients []Client) (_ Report, returnErr error)
- func Run(opts Options) (_ Report, returnErr error)
- type Result
Constants ¶
This section is empty.
Variables ¶
var AllClients = adapterClients()
AllClients lists supported adapters in deterministic application order.
Functions ¶
func CheckRegistration ¶
CheckRegistration reports whether the selected client has a GitContribute MCP entry without changing its configuration.
func CodexSkillInstalled ¶ added in v0.8.0
CodexSkillInstalled reports whether the managed discovery skill is current.
func CodexSkillPath ¶ added in v0.8.0
CodexSkillPath returns the managed discovery skill path for a home directory.
func ResolveNPMVersion ¶
ResolveNPMVersion returns a registry-safe package version for CLI installation and private runtime directory names. It removes one release-tag "v" prefix and maps empty or development versions to the explicit "latest" tag.
func ValidateLauncher ¶ added in v0.15.0
ValidateLauncher checks the durable command shape accepted by the current GitContribute MCP server. It does not execute the command.
Types ¶
type ActivationRollbackError ¶ added in v0.9.0
ActivationRollbackError reports an activation failure whose rollback could not safely restore every registration.
func (*ActivationRollbackError) Error ¶ added in v0.9.0
func (e *ActivationRollbackError) Error() string
func (*ActivationRollbackError) Unwrap ¶ added in v0.9.0
func (e *ActivationRollbackError) Unwrap() []error
Unwrap exposes both the activation and rollback failures.
type CodexSkillResult ¶ added in v0.8.0
type CodexSkillResult struct {
Path string `json:"path,omitempty"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
}
CodexSkillResult reports the managed discovery-skill effect.
type Launcher ¶
Launcher is the exact process command stored in a coding client's MCP configuration.
func CanonicalLauncher ¶ added in v0.15.0
CanonicalLauncher returns the current MCP launcher for an already resolved durable executable path.
func ReadCommand ¶ added in v0.13.0
ReadCommand reads the durable launcher stored in a client-owned config. Parsing remains inside the client adapter; callers receive the product-owned Launcher contract rather than a client-specific representation.
func ReadCommandFile ¶ added in v0.13.0
ReadCommandFile is the path-oriented form used by setup-owned tests and recovery tooling. The config parser remains owned by the selected adapter.
func ResolveLauncher ¶
ResolveLauncher returns a durable absolute MCP command. The setup application must first install an ephemeral package-runner executable into a stable product-owned location and pass that path explicitly.
type Operation ¶
type Operation string
Operation identifies whether client-owned MCP entries are configured or removed.
type Options ¶
type Options struct {
Operation Operation
Clients []Client
All bool
DryRun bool
Home string
Executable string
}
Options controls coding-client MCP registration.
type RegistrationInspection ¶ added in v0.15.0
type RegistrationInspection struct {
Client Client `json:"client"`
Path string `json:"path"`
Status RegistrationStatus `json:"status"`
Launcher Launcher `json:"launcher,omitempty"`
Message string `json:"message,omitempty"`
}
RegistrationInspection is a read-only, client-neutral view of one MCP entry.
func InspectRegistration ¶ added in v0.15.0
func InspectRegistration(client Client, home string) (RegistrationInspection, error)
InspectRegistration parses and validates the complete GitContribute launcher without changing client-owned configuration.
type RegistrationStatus ¶ added in v0.15.0
type RegistrationStatus string
RegistrationStatus describes whether an existing GitContribute MCP entry satisfies the current launcher contract.
const ( RegistrationAbsent RegistrationStatus = "absent" RegistrationCurrent RegistrationStatus = "current" RegistrationStale RegistrationStatus = "stale" )
type Report ¶
type Report struct {
Operation Operation `json:"operation"`
DryRun bool `json:"dry_run"`
Launcher Launcher `json:"launcher"`
Results []Result `json:"results"`
CodexSkill CodexSkillResult `json:"codex_skill,omitempty"`
}
func ActivateExisting ¶ added in v0.9.0
ActivateExisting updates a set of existing GitContribute registrations as one rollback-safe operation. It never creates a new client registration or changes the optional Codex discovery skill. If activation or verification is interrupted, every selected client configuration is restored.
func ActivateExistingAndVerify ¶ added in v0.9.0
func ActivateExistingAndVerify(ctx context.Context, opts Options, verify func() error) (_ Report, returnErr error)
ActivateExistingAndVerify keeps the registration snapshots until verify succeeds, allowing callers to include executable and schema checks in the same rollback boundary.
func RepairExisting ¶ added in v0.15.0
RepairExisting rewrites existing registrations to the canonical MCP arguments while preserving each registration's durable executable path. The selected registrations are repaired as one rollback-safe operation.