/** * Sub-agents defined in a Markdown file. * * Skills are defined this way one directory over (`skills/loader.ts`): YAML * frontmatter for what the thing IS, a Markdown body for what it is told. * An agent file is the same shape for a delegate — a name the `Agent` tool * can be asked for, a description the model chooses by, and optionally a * tool allowlist, a model and a read-only flag — so a repository can say * "our reviewer uses these tools and this model" once, and every host that * builds delegates from this kernel offers the same reviewer. * * ```md * --- * name: reviewer * description: Reviews a diff for correctness and convention drift. * tools: read, grep, glob # optional allowlist, intersected with the parent's set * model: claude-sonnet-4-5 # optional override * readOnly: true # optional; keeps only read-only tools * --- * You review changes for this repository. Cite file:line for every finding … * ``` * * `tools` is one comma-separated line: this kernel's frontmatter reader * refuses block lists and flow sequences by design, so there is no other * form to accept. * * This module decides what a file MEANS. Where files live — which * directories, in which order, which one shadows which — is the host's * decision, passed in as an ordered list of roots; later roots win. A file * that cannot be loaded is REPORTED with its path and reason rather than * silently absent, and never takes the rest of the roster with it: an * agent whose `tools` line failed to parse would otherwise run with the * parent's whole set, which is the opposite of what the line was for. */ import { type Logger } from '../utils/logger.js'; /** Per-file character budget for the prompt body. */ export declare const MAX_AGENT_FILE_CHARS = 32000; /** The names a file may not claim by default: the delegate types a host ships. */ export declare const DEFAULT_RESERVED_AGENT_NAMES: ReadonlySet; export interface AgentFileDefinition { readonly name: string; readonly description: string; /** The system prompt: the file's body, already cut to the budget. */ readonly prompt: string; /** Tool names the agent may use; absent means the parent's working set. */ readonly tools?: readonly string[]; readonly model?: string; readonly readOnly: boolean; readonly path: string; /** The host's label for the root this file came from (`user`, `project`, …). */ readonly source: string; } export interface SkippedAgentFile { readonly path: string; readonly reason: string; } export interface AgentDefinitionRoot { readonly dir: string; readonly source: string; } export interface DiscoveredAgentDefinitions { /** In first-seen order; a later root's file replaces an earlier one's by name. */ readonly definitions: readonly AgentFileDefinition[]; readonly skipped: readonly SkippedAgentFile[]; } export interface DiscoverAgentDefinitionsOptions { /** Names refused in a file. Defaults to `DEFAULT_RESERVED_AGENT_NAMES`. */ readonly reserved?: ReadonlySet; readonly log?: Logger; } /** * Every `*.md` in every root, later roots shadowing earlier ones by name. * A root that is not there contributes nothing; a file that is there and * wrong is reported. */ export declare function discoverAgentDefinitions(roots: readonly AgentDefinitionRoot[], options?: DiscoverAgentDefinitionsOptions): Promise; export declare function parseAgentFile(path: string, source: string, reserved?: ReadonlySet): Promise; /** Pure: the file's text to a definition, or the reason it is refused. */ export declare function parseAgentMarkdown(raw: string, path: string, source: string, reserved?: ReadonlySet): AgentFileDefinition | SkippedAgentFile; //# sourceMappingURL=file-definitions.d.ts.map