harness

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package harness detects and checks AI agent integration health.

Index

Constants

View Source
const (
	// CodexMarketplaceSource is the Git marketplace repository containing Basecamp.
	CodexMarketplaceSource = "basecamp/claude-plugins"
	// CodexPluginName is the plugin identifier to install.
	CodexPluginName = "basecamp"
	// CodexMarketplaceName is the marketplace name published by 37signals.
	CodexMarketplaceName = "37signals"
	// CodexExpectedPluginKey is the fully qualified Basecamp plugin ID.
	CodexExpectedPluginKey = CodexPluginName + "@" + CodexMarketplaceName
)
View Source
const AutoUpdateHint = "In Claude Code: /plugins → Marketplaces → 37signals → Enable auto-update"

AutoUpdateHint is the user-facing instruction for enabling plugin auto-update.

View Source
const ClaudeExpectedPluginKey = ClaudePluginName + "@" + ClaudeMarketplaceName

ClaudeExpectedPluginKey is the fully-qualified key for a correctly installed plugin.

View Source
const ClaudeMarketplaceName = "37signals"

ClaudeMarketplaceName is the marketplace name as it appears in plugin keys.

View Source
const ClaudeMarketplaceSource = "basecamp/claude-plugins"

ClaudeMarketplaceSource is the marketplace repository for the Basecamp plugin. Migrating from basecamp/basecamp-cli → basecamp/claude-plugins.

View Source
const ClaudePluginName = "basecamp"

ClaudePluginName is the plugin identifier to install.

Variables

This section is empty.

Functions

func DetectClaude

func DetectClaude() bool

DetectClaude returns true if Claude Code is installed. Checks ~/.claude/ directory first, then falls back to binary on PATH.

func DetectCodex added in v0.8.0

func DetectCodex() bool

DetectCodex returns true when Codex has a home directory or executable.

func FindClaudeBinary added in v0.3.0

func FindClaudeBinary() string

FindClaudeBinary returns the path to the claude binary, or "" if not found.

func FindCodexBinary added in v0.8.0

func FindCodexBinary() string

FindCodexBinary returns the Codex executable path, or an empty string.

func InstalledPluginVersion added in v0.7.0

func InstalledPluginVersion() string

InstalledPluginVersion reads the installed plugin version from ~/.claude/plugins/installed_plugins.json. Returns "" if unreadable.

func IsPluginNeeded added in v0.3.0

func IsPluginNeeded() bool

IsPluginNeeded returns true if Claude Code is installed but the plugin is not.

func RegisterAgent added in v0.3.0

func RegisterAgent(info AgentInfo)

RegisterAgent adds an agent to the global registry. Typically called from init() in agent-specific files. Panics on empty or duplicate IDs to keep registry state well-defined.

Types

type AgentInfo added in v0.3.0

type AgentInfo struct {
	Name   string                // "Claude Code"
	ID     string                // "claude"
	Detect func() bool           // returns true if the agent is installed
	Checks func() []*StatusCheck // cheap health checks gating setup wizard behavior

	// Diagnostics returns the full doctor check suite, including checks that
	// are too slow or noisy for the wizard (e.g. version comparisons).
	// When nil, doctor falls back to Checks.
	Diagnostics func(ctx context.Context) []*StatusCheck
}

AgentInfo describes a coding agent integration.

func AllAgents added in v0.3.0

func AllAgents() []AgentInfo

AllAgents returns every registered agent.

func DetectedAgents added in v0.3.0

func DetectedAgents() []AgentInfo

DetectedAgents returns all agents whose Detect function returns true. Copies the registry under the lock before calling Detect callbacks to avoid holding the lock during potentially slow I/O.

func FindAgent added in v0.3.0

func FindAgent(id string) *AgentInfo

FindAgent returns the agent with the given ID, or nil.

type StalePlugin added in v0.7.0

type StalePlugin struct {
	Key    string
	Scopes []string // empty = unknown, fall back to unscoped uninstall
}

StalePlugin carries a stale plugin key along with the scopes it was found in.

func StalePluginKeys added in v0.7.0

func StalePluginKeys() []StalePlugin

StalePluginKeys returns stale plugin entries from installed_plugins.json that belong to old/dead marketplaces.

type StatusCheck

type StatusCheck struct {
	Name    string `json:"name"`
	Status  string `json:"status"` // "pass", "warn", "fail"
	Message string `json:"message"`
	Hint    string `json:"hint,omitempty"`
}

StatusCheck represents a single agent integration health check result.

func CheckClaudePlugin

func CheckClaudePlugin() *StatusCheck

CheckClaudePlugin checks whether the basecamp plugin is installed in Claude Code.

func CheckClaudePluginVersion added in v0.7.0

func CheckClaudePluginVersion() *StatusCheck

CheckClaudePluginVersion compares the installed plugin version against the running CLI version. Returns a warn check when they differ.

func CheckClaudeSkillLink() *StatusCheck

CheckClaudeSkillLink checks whether ~/.claude/skills/basecamp contains a valid SKILL.md.

func CheckCodexPlugin added in v0.8.0

func CheckCodexPlugin() *StatusCheck

CheckCodexPlugin verifies that Basecamp is installed and enabled in Codex.

func CheckCodexPluginContext added in v0.8.0

func CheckCodexPluginContext(ctx context.Context) *StatusCheck

CheckCodexPluginContext verifies the plugin using the caller's context.

func CheckCodexPluginDiagnosticsContext added in v0.8.0

func CheckCodexPluginDiagnosticsContext(ctx context.Context) []*StatusCheck

CheckCodexPluginDiagnosticsContext checks plugin health and version from one Codex query.

func CheckCodexPluginVersion added in v0.8.0

func CheckCodexPluginVersion() *StatusCheck

CheckCodexPluginVersion compares the installed plugin and CLI versions.

func CheckCodexPluginVersionContext added in v0.8.0

func CheckCodexPluginVersionContext(ctx context.Context) *StatusCheck

CheckCodexPluginVersionContext compares plugin and CLI versions using the caller's context.

Jump to

Keyboard shortcuts

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