/** * Pre-loaded utilities for common document extraction patterns. * Feature #3: Built-in Helper Functions * * These functions are injected into every RLM sandbox environment. * They are pure functions with no side effects and can be serialized. */ /** * Code block representation. */ export interface CodeBlock { language: string; content: string; lineNumber: number; } /** * Feature representation from plan documents. */ export interface Feature { id: string; name: string; description?: string; status?: string; } /** * Agent representation from plan documents. */ export interface Agent { id: string; name: string; features: string[]; files: string[]; depends?: string[]; blocks?: string[]; } /** * Task representation from TDD sections. */ export interface Task { id: string; description: string; status: 'GAP' | 'WIP' | 'PASS' | 'BLOCKED'; testIds?: string[]; } /** * Match result from pattern search. */ export interface Match { text: string; line: number; index: number; } /** * Extract markdown sections by header. * Returns an object keyed by header text (e.g., "# Title", "## Subtitle"). * Content includes nested subsections. * * @param content - Markdown content * @returns Object mapping header text to section content */ export declare function extractSections(content: string): Record; /** * Extract YAML frontmatter and body. * Returns object with meta (parsed YAML) and body (rest of content). * * @param content - Content with optional YAML frontmatter * @returns Object with meta and body */ export declare function extractFrontmatter(content: string): { meta: Record; body: string; }; /** * Extract code blocks from markdown content. * Returns array of code blocks with language, content, and line number. * * @param content - Markdown content * @param lang - Optional language filter * @returns Array of code blocks */ export declare function extractCodeBlocks(content: string, lang?: string): CodeBlock[]; /** * Extract features from plan documents. * Parses feature headers in two formats for backward compatibility: * - New format: "### #N: Feature Name" with "Status: `GAP`" * - Legacy format: "## Feature N: Feature Name" with "**Status:** GAP" * * @param content - Plan document content * @returns Array of features */ export declare function extractFeatures(content: string): Feature[]; /** * Extract agents from plan documents. * Parses "## Agent N: Name" patterns with Features, Own, Depend on, Block fields. * * @param content - Plan document content * @returns Array of agents */ export declare function extractAgents(content: string): Agent[]; /** * Extract tasks from TDD sections. * Parses numbered list items with test IDs and descriptions. * * @param content - Content containing TDD section * @returns Array of tasks */ export declare function extractTasks(content: string): Task[]; /** * Find matches by regex pattern. * Returns array of matches with text, line number, and index. * * @param content - Content to search * @param regex - Regular expression (must have 'g' flag for multiple matches) * @returns Array of matches */ export declare function findByPattern(content: string, regex: RegExp): Match[]; /** * Summarize text by truncating to maxWords. * This is truncation, NOT AI summarization. * * @param text - Text to summarize * @param maxWords - Maximum number of words (default: 50) * @returns Truncated text with ellipsis */ export declare function summarize(text: string, maxWords?: number): string; //# sourceMappingURL=helpers.d.ts.map