Documentation
¶
Overview ¶
Package project locates the agentmod project that governs a directory. A directory is inside a project when it, or one of its ancestors, contains the marker file .agentmod/agentmod.toml. The nearest marker wins, so nested projects shadow outer ones.
Index ¶
Constants ¶
const ( DirName = ".agentmod" ConfigFileName = "agentmod.toml" )
Marker path components relative to a project root.
Variables ¶
var ErrNotFound = errors.New("not inside an agentmod project (no .agentmod/agentmod.toml here or in any parent directory)")
ErrNotFound is returned by Discover when no ancestor up to the filesystem root contains .agentmod/agentmod.toml.
Functions ¶
This section is empty.
Types ¶
type Project ¶
type Project struct {
Root string // absolute directory containing .agentmod/
AgentmodDir string // Root/.agentmod
ConfigPath string // Root/.agentmod/agentmod.toml
}
Project describes a discovered agentmod project.
func Discover ¶
Discover walks from startDir upward to the filesystem root and returns the nearest enclosing project. startDir may be relative; it is made absolute without resolving symlinks, so activation follows the path the user is actually in. The marker must be a regular file: a directory named agentmod.toml, or a bare .agentmod/ without the config, does not activate. Unreadable ancestors are skipped rather than treated as errors.