export declare const DEFAULT_TEMPLATES_PATH: string; export declare const REQUIRED_DIRECTORIES: readonly string[]; /** Which canonical AGENTS body: the general framework vs the WordPress edition. */ export type AgentsKind = "general" | "wp"; /** * Glob patterns for the two canonical AGENTS bodies in the Templates root. * Strict 3-part semver so: * - the `general` pattern never matches `AGENTS_WP_v…` (after `AGENTS_` comes * `v`, not `WP_`); and * - neither matches the historical 4-part typo `AGENTS_v2.0.0.0.md` (which is * archived anyway). * Discovering the body by glob is what lets a canonical filename bump * (`AGENTS_v2.13.0.md` → `AGENTS_v2.14.0.md`) flow through with NO code change. */ export declare const AGENTS_FILE_RE: Record; export declare class TemplatesError extends Error { constructor(message: string); } /** * Resolves the Templates folder path and verifies required entries are present. * * @param override - optional explicit Templates path (e.g. from --templates-path). * Tildes are NOT expanded; pass an already-absolute path. * @returns the absolute, verified Templates path. * @throws TemplatesError when the folder is missing, not a directory, or is * missing any required file/subdirectory. */ export declare function resolveTemplatesPath(override?: string): Promise; /** * Reads a single template file fresh from disk. No caching. * * @param name - the template file name relative to the Templates root * (e.g. "AGENTS_v2.13.0.md", "Resources/README.md"). * @param templatesPath - optional absolute path to the Templates root. When * omitted, resolveTemplatesPath() is called with no * override (i.e. the default location is used). * @returns the file contents as a UTF-8 string. * @throws TemplatesError when the file is missing, is a directory, escapes the * Templates root, or otherwise cannot be read. */ export declare function readTemplate(name: string, templatesPath?: string): Promise; /** Parse the `X.Y.Z` version out of a canonical AGENTS filename, or null. */ export declare function agentsVersionFromName(name: string): string | null; /** * Discover the canonical AGENTS body for `kind` by globbing `root`. * * Archive-first discipline keeps exactly one match in the Templates root. If * more than one is present (a missed archive), we WARN and pick the highest * semver so the CLI keeps working rather than silently hiding the slip. Zero * matches throws — the folder is incomplete or misnamed. * * @returns `{ name, version }` — the on-disk filename and the version parsed * out of it (the single source of truth for `{{framework_version}}`). */ export declare function discoverAgentsTemplate(root: string, kind: AgentsKind, onWarn?: (message: string) => void): Promise<{ name: string; version: string; }>; /** * Options for {@link resolveAgentsTemplate}. * Every field is optional; defaults preserve the documented production behavior. */ export interface ReadTemplateOptions { /** * Explicit Templates folder path (e.g. from `--templates-path`). * When set, ONLY this folder is consulted. If the path is invalid or the * AGENTS body is missing there, the call throws. */ templatesPath?: string; /** Where to write user-facing warnings (e.g. the multiple-bodies notice). */ onWarn?: (message: string) => void; } /** * Resolve the canonical AGENTS body for `kind`, returning the content, the * version parsed from its filename, and the filename. * * Local-folder only: an explicit `templatesPath` override, or the default * location. Either way the filename is glob-discovered, then read fresh — so a * canonical filename bump (AGENTS_v2.13.0 → v2.14.0) flows through with no code * change. When no local folder is present the call hard-fails (via * {@link resolveTemplatesPath}) with a `--templates-path` hint; the v0.2.0 * hosted-mirror fallback was retired 2026-06-23. */ export declare function resolveAgentsTemplate(kind: AgentsKind, opts?: ReadTemplateOptions): Promise<{ content: string; version: string; name: string; }>;