Documentation
¶
Overview ¶
Package promptfiles centralises the search rules used to resolve add_prompt_files entries (typically AGENTS.md, CLAUDE.md, ...). The rules are shared by:
- the runtime add_prompt_files hook, which executes inside the sandbox at turn-start;
- the docker-agent kit builder, which walks the same paths on the host before sandbox launch so it can stage every relevant file into the kit (see pkg/sandbox/kit).
Keeping the rules in one place guarantees both ends pick the same files and avoids drift when, for example, the kit ships a redacted copy of ~/AGENTS.md that the in-sandbox lookup must then prefer over the now-missing host $HOME entry.
Index ¶
Constants ¶
const KitSubdir = "prompt_files"
KitSubdir is the subdirectory inside a docker-agent kit that holds staged prompt files. The host writes to it; the in-sandbox lookup reads from it.
Variables ¶
This section is empty.
Functions ¶
func FindInHierarchy ¶
FindInHierarchy searches for filename starting at startDir and walking up the directory tree. Returns the path of the first match, or "" if none.
func Paths ¶
Paths returns the prompt-file paths to load for filename, in order:
- The closest match found while walking up from workDir, if any.
- Either a kitDir match (when kitDir is non-empty — running inside a sandbox with a staged kit), or a homeDir match.
kitDir takes precedence over homeDir because, in the sandbox, $HOME does not contain the host's prompt files; the kit is what brought them along (already redacted). Returns at most two paths. Passing homeDir == "" disables the home-dir lookup — useful in tests so they don't need to touch the real $HOME.
func PathsFromEnv ¶
PathsFromEnv is a convenience wrapper around Paths that reads the kit directory from skills.KitDirEnv. The runtime in-sandbox hook uses it; host-side callers (the kit builder) pass kitDir explicitly to Paths instead.
Types ¶
This section is empty.