@builder.io/dev-tools
Version:
Builder.io Visual CMS Devtools
45 lines (44 loc) • 1.43 kB
TypeScript
/**
* Agent definition parsing utilities
* Handles parsing of custom agent definition files
*/
import type { CodeGenMode } from "$/ai-utils";
export interface SubAgent {
name: string;
description?: string;
systemPrompt?: string;
tools?: string[];
model?: string;
mode?: CodeGenMode;
filePath?: string;
includeMemories?: boolean;
needDevServer?: boolean;
needValidation?: boolean;
}
/**
* Resolves model shortcut to full model name
* @param modelOrShortcut - Model name or shortcut
* @returns Resolved model name or undefined
*/
export declare function resolveModelShortcut(modelOrShortcut?: string): string | undefined;
/**
* Parses an agent definition file (Markdown with YAML frontmatter)
* Expected format (following Claude Code sub-agents format):
* ```yaml
* ---
* name: Agent Name
* description: Description of what the agent does
* model: sonnet # Optional: supports shortcuts like sonnet, opus, haiku, mini
* tools: # Optional: list of tools to enable
* - Read
* - Grep
* - WebSearch
* mode: quality-v4-agent # Optional: agent mode
* ---
* System prompt content here (Markdown)
* ```
* @param fileContent - The raw file content
* @param filePath - The file path (used for fallback name)
* @returns Parsed SubAgent or null if parsing fails
*/
export declare function parseAgentFile(fileContent: string, filePath: string): SubAgent | null;