/** * Sub-agents — named, scoped agent definitions the main ("orchestrator") agent * can delegate work to via the `delegate` tool. Each runs as a NESTED agent * loop with its own fresh context window, an optional tool allowlist, an * optional model override, and a role system prompt — then returns only its * final summary to the parent. This keeps the parent's context small and lets * each sub-task run with a specialist persona. * * Storage (mirrors personalities/skills): * - **Built-in**: hardcoded below (researcher, reviewer, tester). * - **Project**: `/.codeep/agents/.md` * - **Global**: `~/.codeep/agents/.md` * Project shadows global shadows built-in, by name. A project file that * shadows a built-in keeps at most the built-in's tools. * * File format — YAML-ish frontmatter + Markdown body (the role prompt): * ``` * --- * name: reviewer * description: Reviews a diff for correctness & security * tools: [read_file, search_code, execute_command] # allowlist; omit = all * model: glm-5.2 # optional provider/model or model override * personality: security # optional — reuse a personality preset * maxIterations: 15 # optional budget * --- * You are a senior reviewer. Find correctness & security issues… * ``` */ export type AgentScope = 'builtin' | 'project' | 'global'; export interface AgentDef { /** Slug (filename without .md, or built-in id). Lowercase, hyphens. */ name: string; /** Human display label. */ displayName: string; /** One-line description shown in the catalog + `/agents`. */ description: string; /** Markdown body — the role system prompt for the sub-agent. */ prompt: string; /** Tool allowlist. Undefined = inherit all of the parent's tools. */ tools?: string[]; /** Optional model override ("provider/model" or just "model"). */ model?: string; /** Optional personality preset to layer on (by name). */ personality?: string; /** Optional per-run iteration budget. */ maxIterations?: number; scope: AgentScope; } export declare function loadAgents(workspaceRoot?: string): AgentDef[]; export declare function findAgent(name: string, workspaceRoot?: string): AgentDef | null; /** * The catalog block appended to the orchestrator's system prompt so the model * knows which sub-agents it can `delegate` to. Empty string is never returned * (built-ins always exist), but callers can choose not to inject it. */ export declare function formatAgentsForSysprompt(agents: AgentDef[]): string; /** `/agents` list view (mirrors formatPersonalityList). */ export declare function formatAgentList(workspaceRoot?: string): string;