import { type FabricThinking } from "../thinking.js"; /** * Named agent files: Markdown with YAML frontmatter that agents.run and * agents.spawn resolve through their `agent` field. * * This module and the yaml parser it loads are first-use only (see * lazyEntryPoints in scripts/build.mjs). Nothing here runs at startup. */ export type AgentFileScope = "user" | "project"; export interface AgentFileRoots { /** Directory that holds the project's .pi folder; the root Fabric already uses for the mesh. */ projectRoot: string; /** Project files are repository content: they load only for a trusted project. */ projectTrusted: boolean; /** Pi agent directory (resolveAgentDir() in the host). */ agentDir: string; } /** Folders searched for agent files, lowest to highest precedence. The one place that names them. */ export declare const AGENT_FILE_FOLDERS: ReadonlyArray<{ scope: AgentFileScope; dir(roots: { agentDir: string; projectRoot: string; }): string; }>; /** Request fields an agent file can fill. A field the caller passes on the call always wins. */ export interface AgentFileRequest { systemPrompt?: string; model?: string; tools?: string[]; thinking?: FabricThinking; runner?: string; kernel?: "typescript" | "python" | "inherit"; timeoutMs?: number; readOnly?: boolean; /** Top-level `skills` and `context.skills`, resolved by name when the agent runs (see child-skills.ts). */ skills?: { preload: Array<{ name: string; required: boolean; }>; inherit: boolean; }; } export interface AgentDefinition { name: string; description: string; path: string; scope: AgentFileScope; request: AgentFileRequest; warnings: string[]; } export interface AgentFileListing { name: string; description: string; path: string; scope: AgentFileScope; /** Path of the lower-precedence file this one replaces. */ shadows?: string; warnings: string[]; /** Set when the file cannot be used; name is then the file name without .md. */ error?: string; } export declare class AgentFileError extends Error { } /** Parse one agent file. Every refusal names the file and, where it can, the line. */ export declare const parseAgentFile: (source: string, file: string, scope: AgentFileScope) => AgentDefinition; /** * Read-only listing for agents.definitions(): the effective file for each name, plus files that * cannot load. onNotice receives folder-level problems such as an untrusted project. */ export declare const listAgentFiles: (roots: AgentFileRoots, onNotice?: (notice: string) => void) => AgentFileListing[]; /** Find one agent by name. An unknown name or an unusable file throws before any child starts. */ export declare const resolveAgentFile: (name: string, roots: AgentFileRoots) => AgentDefinition; /** * Fill the request from the file. A field the caller passed, even an empty one, is never replaced. * The run is named after the agent unless the caller names it. */ export declare const applyAgentDefinition: (args: Record, definition: AgentDefinition) => Record; //# sourceMappingURL=agent-files.d.ts.map