checks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package checks provides diagnostic check implementations for the doctor command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A2ACheck

type A2ACheck struct{}

A2ACheck validates A2A protocol configuration.

func (*A2ACheck) Fix

func (c *A2ACheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*A2ACheck) Name

func (c *A2ACheck) Name() string

Name returns the check name.

func (*A2ACheck) Run

func (c *A2ACheck) Run(_ context.Context, cfg *config.Config) Result

Run checks A2A configuration validity.

type APIKeySecurityCheck

type APIKeySecurityCheck struct{}

APIKeySecurityCheck validates that API keys use environment variable references rather than plaintext values.

func (*APIKeySecurityCheck) Fix

Fix suggests using environment variables.

func (*APIKeySecurityCheck) Name

func (c *APIKeySecurityCheck) Name() string

Name returns the check name.

func (*APIKeySecurityCheck) Run

Run checks if any provider API keys are stored as plaintext.

type AgentRegistryCheck added in v0.4.0

type AgentRegistryCheck struct{}

AgentRegistryCheck validates agent registry configuration.

func (*AgentRegistryCheck) Fix added in v0.4.0

Fix delegates to Run as automatic fixing is not supported.

func (*AgentRegistryCheck) Name added in v0.4.0

func (c *AgentRegistryCheck) Name() string

Name returns the check name.

func (*AgentRegistryCheck) Run added in v0.4.0

Run checks agent registry configuration and agents directory.

type ApprovalCheck added in v0.4.0

type ApprovalCheck struct{}

ApprovalCheck validates the approval system configuration.

func (*ApprovalCheck) Fix added in v0.4.0

func (c *ApprovalCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*ApprovalCheck) Name added in v0.4.0

func (c *ApprovalCheck) Name() string

Name returns the check name.

func (*ApprovalCheck) Run added in v0.4.0

func (c *ApprovalCheck) Run(_ context.Context, cfg *config.Config) Result

Run checks approval system configuration.

type ChannelCheck

type ChannelCheck struct{}

ChannelCheck validates channel token configurations.

func (*ChannelCheck) Fix

func (c *ChannelCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix cannot auto-fix channel tokens - requires user input.

func (*ChannelCheck) Name

func (c *ChannelCheck) Name() string

Name returns the check name.

func (*ChannelCheck) Run

func (c *ChannelCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if enabled channels have valid tokens configured.

type Check

type Check interface {
	// Name returns the human-readable name of the check.
	Name() string
	// Run executes the check and returns the result.
	Run(ctx context.Context, cfg *config.Config) Result
	// Fix attempts to repair the issue if possible.
	// Returns an updated result after the fix attempt.
	Fix(ctx context.Context, cfg *config.Config) Result
}

Check is the interface that all diagnostic checks must implement.

func AllChecks

func AllChecks() []Check

AllChecks returns all available diagnostic checks.

type CompanionConnectionCheck

type CompanionConnectionCheck struct{}

CompanionConnectionCheck checks if the Gateway is running and if companions are connected.

func (*CompanionConnectionCheck) Fix

func (*CompanionConnectionCheck) Name

func (c *CompanionConnectionCheck) Name() string

func (*CompanionConnectionCheck) Run

type ConfigCheck

type ConfigCheck struct{}

ConfigCheck validates the encrypted configuration profile.

func (*ConfigCheck) Fix

func (c *ConfigCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix guides the user to run 'lango onboard' for profile setup.

func (*ConfigCheck) Name

func (c *ConfigCheck) Name() string

Name returns the check name.

func (*ConfigCheck) Run

func (c *ConfigCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if an encrypted configuration profile exists and is valid.

type DatabaseCheck

type DatabaseCheck struct{}

DatabaseCheck validates the session database accessibility.

func (*DatabaseCheck) Fix

func (c *DatabaseCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix creates the database directory if missing.

func (*DatabaseCheck) Name

func (c *DatabaseCheck) Name() string

Name returns the check name.

func (*DatabaseCheck) Run

func (c *DatabaseCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if the session database is accessible.

type EmbeddingCheck

type EmbeddingCheck struct{}

EmbeddingCheck validates embedding/RAG configuration.

func (*EmbeddingCheck) Fix

func (c *EmbeddingCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*EmbeddingCheck) Name

func (c *EmbeddingCheck) Name() string

Name returns the check name.

func (*EmbeddingCheck) Run

Run checks embedding configuration validity.

type GraphStoreCheck

type GraphStoreCheck struct{}

GraphStoreCheck validates graph store configuration.

func (*GraphStoreCheck) Fix

func (c *GraphStoreCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*GraphStoreCheck) Name

func (c *GraphStoreCheck) Name() string

Name returns the check name.

func (*GraphStoreCheck) Run

Run checks graph store configuration validity.

type LibrarianCheck added in v0.4.0

type LibrarianCheck struct{}

LibrarianCheck validates the proactive librarian configuration.

func (*LibrarianCheck) Fix added in v0.4.0

func (c *LibrarianCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*LibrarianCheck) Name added in v0.4.0

func (c *LibrarianCheck) Name() string

Name returns the check name.

func (*LibrarianCheck) Run added in v0.4.0

Run checks librarian configuration.

type MultiAgentCheck

type MultiAgentCheck struct{}

MultiAgentCheck validates multi-agent orchestration configuration.

func (*MultiAgentCheck) Fix

func (c *MultiAgentCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*MultiAgentCheck) Name

func (c *MultiAgentCheck) Name() string

Name returns the check name.

func (*MultiAgentCheck) Run

Run checks multi-agent configuration validity.

type NetworkCheck

type NetworkCheck struct{}

NetworkCheck validates network-related configuration.

func (*NetworkCheck) Fix

func (c *NetworkCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix cannot auto-fix port conflicts.

func (*NetworkCheck) Name

func (c *NetworkCheck) Name() string

Name returns the check name.

func (*NetworkCheck) Run

func (c *NetworkCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if the configured server port is available.

type ObservationalMemoryCheck

type ObservationalMemoryCheck struct{}

ObservationalMemoryCheck validates observational memory configuration.

func (*ObservationalMemoryCheck) Fix

Fix delegates to Run as automatic fixing is not supported.

func (*ObservationalMemoryCheck) Name

func (c *ObservationalMemoryCheck) Name() string

Name returns the check name.

func (*ObservationalMemoryCheck) Run

Run checks observational memory configuration validity.

type OutputScanningCheck

type OutputScanningCheck struct{}

OutputScanningCheck validates output scanning and interceptor configuration.

func (*OutputScanningCheck) Fix

Fix delegates to Run as automatic fixing is not supported.

func (*OutputScanningCheck) Name

func (c *OutputScanningCheck) Name() string

Name returns the check name.

func (*OutputScanningCheck) Run

Run checks output scanning configuration and state.

type ProvidersCheck

type ProvidersCheck struct{}

ProvidersCheck validates the AI provider configurations.

func (*ProvidersCheck) Fix

func (c *ProvidersCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix suggests running onboard.

func (*ProvidersCheck) Name

func (c *ProvidersCheck) Name() string

Name returns the check name.

func (*ProvidersCheck) Run

func (c *ProvidersCheck) Run(ctx context.Context, cfg *config.Config) Result

Run checks if providers are correctly configured.

type Result

type Result struct {
	// Name is the human-readable name of the check.
	Name string `json:"name"`
	// Status is the result status.
	Status Status `json:"status"`
	// Message is the main result message.
	Message string `json:"message"`
	// Details provides additional information or hints.
	Details string `json:"details,omitempty"`
	// Fixable indicates if this issue can be auto-repaired.
	Fixable bool `json:"fixable,omitempty"`
	// FixAction is a description of the fix action.
	FixAction string `json:"fixAction,omitempty"`
}

Result represents the result of a single check.

type SecurityCheck

type SecurityCheck struct{}

SecurityCheck checks security configuration and state

func (*SecurityCheck) Fix

func (c *SecurityCheck) Fix(ctx context.Context, cfg *config.Config) Result

func (*SecurityCheck) Name

func (c *SecurityCheck) Name() string

func (*SecurityCheck) Run

func (c *SecurityCheck) Run(ctx context.Context, cfg *config.Config) Result

type Status

type Status int

Status represents the result status of a check.

const (
	// StatusPass indicates the check passed successfully.
	StatusPass Status = iota
	// StatusWarn indicates the check passed with warnings.
	StatusWarn
	// StatusFail indicates the check failed.
	StatusFail
	// StatusSkip indicates the check was skipped.
	StatusSkip
)

func (Status) String

func (s Status) String() string

String returns a string representation of the status.

type Summary

type Summary struct {
	Results  []Result `json:"results"`
	Passed   int      `json:"passed"`
	Warnings int      `json:"warnings"`
	Failed   int      `json:"failed"`
	Skipped  int      `json:"skipped"`
}

Summary aggregates multiple check results.

func NewSummary

func NewSummary(results []Result) Summary

NewSummary creates a Summary from a slice of Results.

func (Summary) HasErrors

func (s Summary) HasErrors() bool

HasErrors returns true if any check failed.

func (Summary) HasWarnings

func (s Summary) HasWarnings() bool

HasWarnings returns true if any check has warnings.

type ToolHooksCheck added in v0.4.0

type ToolHooksCheck struct{}

ToolHooksCheck validates tool hooks configuration.

func (*ToolHooksCheck) Fix added in v0.4.0

func (c *ToolHooksCheck) Fix(ctx context.Context, cfg *config.Config) Result

Fix delegates to Run as automatic fixing is not supported.

func (*ToolHooksCheck) Name added in v0.4.0

func (c *ToolHooksCheck) Name() string

Name returns the check name.

func (*ToolHooksCheck) Run added in v0.4.0

Run checks tool hooks configuration.

Jump to

Keyboard shortcuts

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