Documentation
¶
Overview ¶
Package agentsupport owns user-selected agent integrations and their reconciliation with Rmote-owned hook configuration.
Index ¶
- func BypassEnabled(id agents.ID) (bool, error)
- func Disable(id agents.ID) error
- func Enable(id agents.ID) error
- func Enabled(id agents.ID) (bool, error)
- func InstalledIDs() []agents.ID
- func IsEnabled(id agents.ID) bool
- func Ready(id agents.ID) (bool, error)
- func ResetForTest()
- func SetBypass(id agents.ID, on bool) error
- type Presentation
- type Selection
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BypassEnabled ¶
BypassEnabled reports whether an agent is opted into bypass (yolo) launch mode. The launch-line builder consults this to decide whether to append the agent's YoloArgs.
func InstalledIDs ¶
InstalledIDs returns the catalog agents detected as installed on this host, in stable ID-sorted order. It is a pure probe — no agents.json load, no hook discovery — so it is safe to call from first-run defaults and as the cheap fallback when Snapshot() errors. This is the single source of truth for "which agents are installed", replacing the former config-dir heuristic in the discovery package (which could disagree with Snapshot()'s binary probe).
func IsEnabled ¶
IsEnabled reports whether an agent is enabled, from the in-memory cache. Cheap (RLock + map lookup) — safe for per-tick callers. Fail-open on a cache that failed to load so a transient disk error never masks an agent.
func Ready ¶
Ready reports whether an enabled agent is installed and its Rmote-owned integration is configured (or no integration is required).
func ResetForTest ¶
func ResetForTest()
ResetForTest clears the in-memory enabled cache and its once-token so the next IsEnabled/ensureCache re-reads from the current RMOTE_AGENT_DIR. Tests set a per-test RMOTE_AGENT_DIR via t.Setenv; without this reset the process-global cacheOnce would pin whichever agent set the first test loaded for the whole binary, breaking isolation (and any resume path gated on IsEnabled). Test-only — never call from production code.
Types ¶
type Presentation ¶
type Selection ¶
type Selection struct {
Enabled map[agents.ID]bool
Bypass map[agents.ID]bool
// Explicit reports whether agents.json existed (false on first run, so
// callers know detected-current agents are an implicit default).
Explicit bool
}
Selection is the persisted user intent for agent integrations: which agents are enabled, and which are opted into bypass (yolo) launch mode. Both default empty; an absent file means "no explicit selection" (see Load).
type Status ¶
type Status struct {
ID agents.ID `json:"id"`
DisplayName string `json:"display_name"`
Installed bool `json:"installed"`
Enabled bool `json:"enabled"`
Configuration string `json:"configuration"`
Capabilities []agents.Capability `json:"capabilities"`
Diagnostics []string `json:"diagnostics,omitempty"`
Availability string `json:"availability"`
Presentation Presentation `json:"presentation"`
SkillInvocation string `json:"skill_invocation,omitempty"`
AutoPickPriority int `json:"auto_pick_priority"`
Bypass bool `json:"bypass"`
PasteReadyMarker string `json:"paste_ready_marker,omitempty"`
}