aiagentconfig

package
v1.82.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverAll

func DiscoverAll(basePath string) (map[string][]string, error)

DiscoverAll searches basePath for AI agent configuration files and groups them by agent. Only agents with at least one exclusive file match are included. Shared files are appended to each detected agent's file list. Returns a map of agent name → sorted, deduplicated relative paths.

Types

type Agent

type Agent struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

Agent identifies the AI agent provider

type ConfigFile

type ConfigFile struct {
	Path    string `json:"path"`
	SHA256  string `json:"sha256"`
	Size    int64  `json:"size"`
	Content string `json:"content"`
}

ConfigFile represents a single discovered configuration file

type Evidence

type Evidence struct {
	SchemaVersion string       `json:"schema_version"`
	Agent         Agent        `json:"agent"`
	ConfigHash    string       `json:"config_hash"`
	CapturedAt    string       `json:"captured_at"`
	GitContext    *GitContext  `json:"git_context,omitempty"`
	ConfigFiles   []ConfigFile `json:"config_files"`
	// Future fields for richer analysis
	Permissions any `json:"permissions,omitempty"`
	MCPServers  any `json:"mcp_servers,omitempty"`
	Subagents   any `json:"subagents,omitempty"`
}

Evidence is the AI agent configuration payload

func Build

func Build(basePath string, filePaths []string, agentName string, gitCtx *GitContext) (*Evidence, error)

Build reads discovered files and constructs the AI agent config payload. basePath is the base directory, filePaths are relative to basePath. agentName identifies the AI agent (e.g. "claude", "cursor"). gitCtx may be nil if not in a git repository.

type GitContext

type GitContext struct {
	Repository string `json:"repository,omitempty"`
	Branch     string `json:"branch,omitempty"`
	CommitSHA  string `json:"commit_sha,omitempty"`
}

GitContext holds optional git information at capture time

Jump to

Keyboard shortcuts

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