/** * Read a prompt file, resolving `@path/to/file` includes recursively. * Missing files, unreadable files, circular includes, and depth-limited * includes are skipped and logged. * Max include depth: 5 (depths 0-4 inclusive; depth >= 5 returns ''). * * The `visited` Set is intentionally shared across all recursive calls * within one top-level invocation. This means a file included from one * branch is never re-included from a sibling branch, preventing duplicate * content and infinite loops across non-trivially circular graphs. */ export declare function readPromptFile(filePath: string, visited?: Set, depth?: number): string; /** * Load system prompt by chain-loading SYSTEM.md + global + project GOODVIBES.md files. * * @param getConfigPath Optional injector for the config-specified systemPromptFile path. * Defaults to reading from configManager (used in production). */ export interface LoadSystemPromptOptions { readonly workingDirectory: string; readonly homeDirectory: string; readonly getConfigPath?: (() => string | undefined) | undefined; readonly argv?: readonly string[] | undefined; } /** * Which instruction file a loaded chain segment came from. * * - `cli` , an explicit `--system-prompt-file` argument (exclusive path) * - `base` , `~/.goodvibes/SYSTEM.md` * - `global` , `~/.goodvibes/GOODVIBES.md` * - `agents` , the nearest `AGENTS.md` walking up from the working directory * - `project`, `/.goodvibes/GOODVIBES.md` * - `config` , the `provider.systemPromptFile` config value */ export type PromptSourceKind = 'cli' | 'base' | 'global' | 'agents' | 'project' | 'config'; /** One instruction file that actually contributed content to the system prompt. */ export interface PromptSource { readonly kind: PromptSourceKind; /** Absolute path of the file that was read. */ readonly path: string; } /** The assembled system prompt plus the provenance of every file that fed it. */ export interface SystemPromptResult { readonly prompt: string; /** Loaded instruction files, in the order they were concatenated. */ readonly sources: readonly PromptSource[]; } /** * Walk from `startDir` upward toward the filesystem root and return the path of * the nearest `AGENTS.md` (nearest-file-wins). Returns `null` when none is * found on the way up. The walk stops at the root (when `dirname(dir) === dir`) * so it always terminates. */ export declare function findNearestAgentsFile(startDir: string): string | null; /** * Load the system prompt chain and report the provenance of every file that * contributed. See {@link loadSystemPrompt} for the plain-string variant. * * Layering (each present, non-empty file is concatenated in this order): * 1. `--system-prompt-file` CLI arg, exclusive; when set and readable it is * the only source. * 2. `~/.goodvibes/SYSTEM.md` * 3. `~/.goodvibes/GOODVIBES.md` * 4. nearest `AGENTS.md` (walking up from the working directory), a * convention fallback/addition. It is placed BEFORE the project's own * `GOODVIBES.md` so the project-specific file keeps precedence (it is * concatenated later, and later sources win in the append order). * 5. `/.goodvibes/GOODVIBES.md` * 6. `provider.systemPromptFile` (appended last) */ export declare function loadSystemPromptWithSources(options: LoadSystemPromptOptions): SystemPromptResult; /** * Load system prompt by chain-loading SYSTEM.md + global + nearest AGENTS.md + * project GOODVIBES.md files. Returns the concatenated prompt string. * * @param getConfigPath Optional injector for the config-specified systemPromptFile path. * Defaults to reading from configManager (used in production). */ export declare function loadSystemPrompt(options: LoadSystemPromptOptions): string; //# sourceMappingURL=prompt-loader.d.ts.map