import { GuueyJsonV1 } from './schema.js'; import { type GuueyAppTheme } from './theme.js'; /** How many parent directories `findGuueyJson` will walk by default. */ export declare const DEFAULT_FIND_MAX_DEPTH = 8; /** * Walk up from `startDir` (default: `process.cwd()`) looking for a * `guuey.json`. Returns the absolute path to the first match, or * `null` if no file is found within `maxDepth` levels. * * Stops when the filesystem root is reached, regardless of `maxDepth`. * Never throws — a missing file is a valid result (not in a guuey project), * not an error. */ export declare function findGuueyJson(startDir?: string, maxDepth?: number): string | null; /** * Read + parse `guuey.json` from `path`. Throws if the file is missing, * unreadable, malformed JSON, declares a `schema` version this package * cannot honor (`GuueyJsonSchemaError` — `SCHEMA_TOO_NEW` / `SCHEMA_UNSUPPORTED`, * see `assertSupportedGuueyJsonSchema`), or fails schema validation. * * Does NOT resolve `agent.systemPrompt.file` references. Use * {@link loadGuueyJson} for file resolution. */ export declare function readGuueyJsonFile(path: string): GuueyJsonV1; /** * Write a `guuey.json` to disk at `path` with stable 2-space indentation * and a trailing newline. * * Validates the document against {@link GuueyJsonV1} before writing — bad * data never lands on disk. */ export declare function writeGuueyJsonFile(path: string, doc: GuueyJsonV1): void; /** * Result of resolving file-references inside a `guuey.json` document. * * `doc` is the original document (with `{ file: '...' }` references intact); * `resolvedSystemPrompt` is the inlined string the pod will use at boot. */ export interface ResolvedGuueyJson { /** The original parsed document. */ doc: GuueyJsonV1; /** * The resolved system prompt — either the inline string from * `agent.systemPrompt`, or the file contents when it was a * `{ file: '...' }` reference, or `undefined` when no prompt was set * (caller falls back to `GUUEY_DEFAULT_SYSTEM_PROMPT`). */ resolvedSystemPrompt: string | undefined; /** * The resolved app theme — the inline document from `app.theme`, or the * file's parsed content when it was a `{ file: '...' }` reference * (guuey#400), or `undefined` when no theme was set. */ resolvedTheme: GuueyAppTheme | undefined; /** * Resolved per-mode prompts (guuey#545): for every `agent.modes[key]` * whose `systemPrompt` / `systemPromptAppend` is present, the FINAL * string — the inline value as-is, or the file contents when it was a * `{ file: '...' }` reference. Before this, a file-shaped mode prompt * rode into the snapshot unresolved and reached the pod (which has no * repo filesystem) — a silently broken deploy. `undefined` when the * document declares no modes. */ resolvedModePrompts: Record | undefined; /** Absolute path the document was loaded from (for diagnostics). */ sourcePath: string; } /** * Load + parse `guuey.json` from `path`, then resolve any * `agent.systemPrompt.file` reference into an inlined string. * * The resolved prompt is returned alongside the parsed document so callers * can choose how to use it. The deploy snapshot inlines it into a string * shape; the pod runtime reads the resolved prompt directly. * * Throws if the file is missing, unreadable, malformed, fails schema * validation, OR the systemPrompt.file / app.theme.file path resolves to * a missing or unreadable file. */ export declare function loadGuueyJson(path: string): ResolvedGuueyJson; /** * Build the snapshot the deploy upload + pod boot consume. * * Replaces `agent.systemPrompt = { file }` with `agent.systemPrompt = ` * and `app.theme = { file }` with the file's parsed document so the * snapshot is self-contained. Returns a deep-cloned document * (caller mutations don't leak back). */ export declare function buildDeploySnapshot(loaded: ResolvedGuueyJson): GuueyJsonV1; //# sourceMappingURL=loader.d.ts.map