Documentation
¶
Overview ¶
Package toolchain owns harness compatibility and managed CLI installations. Clients consume its decisions; none of the installation commands or compatibility rules live in a mobile app.
Index ¶
- Constants
- func CommandContext(ctx context.Context, binary string, args ...string) *exec.Cmd
- func Environment() []string
- func Executable(binary string) string
- func InspectInstallation(ctx context.Context, spec Spec) (string, error)
- func ParseVersion(output string) string
- func Root() string
- func Shell(script string) string
- func WithInstallProgress(ctx context.Context, report func(stage string)) context.Context
- type Catalog
- type DaemonRange
- type Exclusion
- type Harness
- type Manager
- func (m *Manager) Catalog() Catalog
- func (m *Manager) Check(ctx context.Context, spec Spec) (string, error)
- func (m *Manager) CheckAdmission(ctx context.Context, spec Spec) error
- func (m *Manager) Install(ctx context.Context, spec Spec, update bool) (string, error)
- func (m *Manager) RefreshSoftware(ctx context.Context, spec Spec, force bool) Software
- func (m *Manager) Software(ctx context.Context, spec Spec) Software
- func (m *Manager) Version(ctx context.Context, spec Spec) string
- type Release
- type Software
- type Spec
Constants ¶
const CatalogURL = "https://raw.githubusercontent.com/oblien/mindwire/main/daemon/internal/toolchain/catalog.json"
const PolicyVersion = 1
Variables ¶
This section is empty.
Functions ¶
func CommandContext ¶
func Environment ¶
func Environment() []string
func Executable ¶
Executable resolves the same selection for native exec, help/schema discovery, auth and turns. A broken selected install must fail visibly; it never falls through to another CLI.
func InspectInstallation ¶
InspectInstallation checks the executable selected for native execution without launching the harness, authenticating, or contacting a package/catalog server. A damaged managed selection remains visible for repair instead of falling back to a different installation. An interrupted shell lookup is not proof of absence.
func ParseVersion ¶
ParseVersion understands both plain versions and native banners ("codex-cli 0.155.0").
Types ¶
type Catalog ¶
type Catalog struct {
SchemaVersion int `json:"schemaVersion"`
Revision int `json:"revision"`
Harnesses map[string]Harness `json:"harnesses"`
}
func DecodeCatalog ¶
type DaemonRange ¶
type Exclusion ¶
type Exclusion struct {
Min string `json:"min"`
MaxExclusive string `json:"maxExclusive"`
Daemon []DaemonRange `json:"daemon"`
Reason string `json:"reason"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Check ¶
Check is a setup probe, not an update. An installed, untested external CLI stays installed. A known incompatible version is rejected before it can start another turn.
func (*Manager) CheckAdmission ¶
Admission is an explicit action, unlike passive UI reads. Probe the actual binary so a user-driven external upgrade or a damaged managed install cannot reuse stale readiness. Compatibility metadata remains cached: sending a message never waits on the catalog host.
func (*Manager) Install ¶
Install is invoked inside the supervisor's idle-harness gate and shared package-manager lock. It stages an exact approved version, verifies it, then atomically selects it. Previous versions and external installations are never removed or changed.
func (*Manager) RefreshSoftware ¶
type Release ¶
type Release struct {
Version string `json:"version"`
Daemon []DaemonRange `json:"daemon"`
}
type Software ¶
type Software struct {
PolicyVersion int `json:"policyVersion"`
InstalledVersion string `json:"installedVersion"`
RecommendedVersion string `json:"recommendedVersion,omitempty"`
LatestVersion string `json:"latestVersion,omitempty"` // latest approved catalog entry, not npm latest
Compatibility string `json:"compatibility"` // supported | untested | incompatible | unavailable | not_installed
Managed bool `json:"managed"`
UpdateAvailable bool `json:"updateAvailable"`
RepairAvailable bool `json:"repairAvailable,omitempty"`
RequiresDaemonUpdate bool `json:"requiresDaemonUpdate"`
RequiredDaemonVersion string `json:"requiredDaemonVersion,omitempty"`
Message string `json:"message,omitempty"`
CatalogRevision int `json:"catalogRevision"`
CatalogSource string `json:"catalogSource"` // bundled | cached | remote
CatalogStale bool `json:"catalogStale"`
MissingDependencies []string `json:"missingDependencies,omitempty"`
}
Software is the authoritative update/readiness decision exposed through HTTP and both SDKs.
type Spec ¶
type Spec struct {
ID string
Name string
Binary string
Package string
VersionArgs []string
Environment map[string]string
}
Spec is compiled into an adapter. The remote catalog can approve versions, but cannot change a package, execute shell code, or redirect an install to a different registry.