agentsupport

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package agentsupport owns user-selected agent integrations and their reconciliation with Rmote-owned hook configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BypassEnabled

func BypassEnabled(id agents.ID) (bool, error)

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 Disable

func Disable(id agents.ID) error

Disable deselects one supported agent and removes only Rmote-owned hooks.

func Enable

func Enable(id agents.ID) error

Enable selects one supported agent and applies its current hook adapter.

func Enabled

func Enabled(id agents.ID) (bool, error)

func InstalledIDs

func InstalledIDs() []agents.ID

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

func IsEnabled(id agents.ID) bool

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

func Ready(id agents.ID) (bool, error)

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.

func SetBypass

func SetBypass(id agents.ID, on bool) error

SetBypass opts an agent into (on=true) or out of bypass launch mode. It persists intent only; the launch path reads it via BypassEnabled. An agent with no YoloArgs cannot be opted in (no flag to append).

Types

type Presentation

type Presentation struct {
	DisplayName string `json:"display_name"`
	Badge       string `json:"badge"`
	Color       string `json:"color,omitempty"`
}

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).

func Load

func Load() (Selection, error)

Load returns the persisted selection. When agents.json is absent, detected current agents are marked enabled (nothing bypassed) for upgrade compatibility; Explicit is false. Schema v1 (pre-bypass) files migrate forward with an empty Bypass set.

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"`
}

func Snapshot

func Snapshot() ([]Status, error)

Snapshot returns a deterministic, local inspection of every supported agent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL