scanner

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPServer

type MCPServer struct {
	Name       string            `json:"name"`
	Tool       string            `json:"tool"`              // Which AI tool config this came from
	ConfigPath string            `json:"config_path"`       // File where this was found
	Project    string            `json:"project,omitempty"` // Project path (for per-project configs like ~/.claude.json)
	Type       string            `json:"type"`              // stdio, http, sse, url
	Command    string            `json:"command,omitempty"`
	Args       []string          `json:"args,omitempty"`
	URL        string            `json:"url,omitempty"`
	Env        map[string]string `json:"env,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	RawConfig  json.RawMessage   `json:"raw_config"`
}

MCPServer represents a discovered MCP server entry.

type ManagedConfig

type ManagedConfig struct {
	Tool     string `json:"tool"`
	Path     string `json:"path"`
	Present  bool   `json:"present"`
	Readable bool   `json:"readable"`
}

ManagedConfig tracks whether managed configuration is deployed.

type PathConfig

type PathConfig struct {
	MacOS   PlatformConfig `yaml:"macos"`
	Linux   PlatformConfig `yaml:"linux"`
	Windows PlatformConfig `yaml:"windows"`
}

PathConfig holds the full path configuration across platforms.

func LoadPaths

func LoadPaths(configDir string) (*PathConfig, error)

LoadPaths loads config path definitions from YAML. If configDir is empty, it looks in the default configs/ directory relative to the binary, then falls back to embedded defaults.

func (*PathConfig) GetPlatformPaths

func (pc *PathConfig) GetPlatformPaths(goos string) []ToolPaths

GetPlatformPaths returns the tool paths for the given OS.

type PlatformConfig

type PlatformConfig struct {
	Tools []ToolPaths `yaml:"tools"`
}

PlatformConfig defines all tool paths for a specific platform.

type ScanResult

type ScanResult struct {
	Hostname       string          `json:"hostname"`
	Platform       string          `json:"platform"`
	Username       string          `json:"username"`
	ToolConfigs    []ToolConfig    `json:"tool_configs"`
	MCPServers     []MCPServer     `json:"mcp_servers"`
	ManagedConfigs []ManagedConfig `json:"managed_configs"`
}

ScanResult contains all discovered configurations from one endpoint.

func Scan

func Scan(paths *PathConfig) *ScanResult

Scan discovers AI tool configurations on the current endpoint.

func (*ScanResult) Summary

func (r *ScanResult) Summary() string

Summary returns a human-readable summary of the scan.

type ToolConfig

type ToolConfig struct {
	Tool      string `json:"tool"`
	Path      string `json:"path"`
	Exists    bool   `json:"exists"`
	Readable  bool   `json:"readable"`
	SizeBytes int64  `json:"size_bytes,omitempty"`
}

ToolConfig represents a discovered AI tool configuration file.

type ToolPaths

type ToolPaths struct {
	Tool         string   `yaml:"tool"`
	ConfigPaths  []string `yaml:"config_paths"`
	ManagedPaths []string `yaml:"managed_paths,omitempty"`
}

ToolPaths defines config file locations for one AI tool on one platform.

Jump to

Keyboard shortcuts

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