Documentation
¶
Overview ¶
Package agents keeps the synchronisation state of the project's ADE integrations. The project agent registry itself is the Bootstrap's (its ADE registry and participation state); this package only records what the CLI observed and did, and that record can always be rebuilt.
Index ¶
Constants ¶
const ( ArtifactSynchronized = "synchronized" ArtifactChanged = "changed" ArtifactMissing = "missing" ArtifactUnexpected = "unexpected" )
States of one managed artifact.
const ( Synchronized = "synchronized" Missing = "missing or changed" NotRequired = "not required" )
Context states of one agent.
Variables ¶
This section is empty.
Functions ¶
func ArtifactStatus ¶
ArtifactStatus maps a Bootstrap ownership status to an artifact state. An unknown status is passed through rather than guessed.
Types ¶
type Adapter ¶
Adapter is the AgentAdapter built from one Bootstrap registry entry.
func (Adapter) ContextLocations ¶
ContextLocations returns the project paths the Bootstrap declares as owned.
func (Adapter) InstructionEntry ¶
InstructionEntry returns the file the agent reads first.
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"` // participating: the human chose it
Primary bool `json:"primary"` // workflow identifier, no authority
Excluded bool `json:"excluded"` // the human declined it
Detected bool `json:"detected"`
Signals []string `json:"signals,omitempty"`
Context string `json:"context"`
Detail string `json:"detail,omitempty"`
// From the agent's adapter and the Bootstrap ownership ledger.
AdapterVersion int `json:"adapter_version,omitempty"`
Entry string `json:"instruction_entry,omitempty"`
Locations []string `json:"context_locations,omitempty"`
Artifacts []Artifact `json:"artifacts,omitempty"`
}
Agent is one registry ADE seen from this project and this machine.
type Artifact ¶
type Artifact struct {
Path string `json:"path"`
Status string `json:"status"`
Basis string `json:"basis,omitempty"`
}
Artifact is one file of an agent's managed context, as the Bootstrap ownership ledger reports it.
type Environment ¶
type Environment struct {
Schema int `json:"schema"`
Configured bool `json:"configured"`
Agents []Agent `json:"agents"`
Undeclared []string `json:"undeclared_detected"`
Problems []string `json:"problems"`
}
Environment is the result of an agent check.
func (Environment) OK ¶
func (e Environment) OK() bool
OK reports whether every declared agent has its context.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the AgentRegistry over the Bootstrap ADE registry.
func NewRegistry ¶
NewRegistry builds one adapter per registry entry, in registry order.
func (Registry) Adapter ¶
func (r Registry) Adapter(id string) (ports.AgentAdapter, bool)
Adapter returns the adapter of one agent. An unknown id has none: GTT does not synchronise an environment it has no integration for.
func (Registry) Adapters ¶
func (r Registry) Adapters() []ports.AgentAdapter
Adapters returns every adapter.
type State ¶
type State struct {
Version int `json:"version"`
Notice string `json:"notice"`
Agents map[string]Record `json:"agents"`
}
State is .gtt/cli/agents.json.