/** * Helper Functions for File Operations * * This file contains utility functions for file system operations, * path manipulation, and other common tasks used by the CLI */ import { Assistant, TemplateFormat } from './types'; /** * Parse comma-separated assistant values into an array * @param value - Comma-separated string of assistant names * @returns Array of assistant names * @throws Error if invalid assistant names are provided */ export declare function parseAssistants(value: string): Assistant[]; /** * Validate that all assistants are supported * @param assistants - Array of assistants to validate * @throws Error if any assistant is invalid or array is empty */ export declare function validateAssistants(assistants: Assistant[]): void; /** * Get the template format for a specific assistant * @param assistant - The assistant type * @returns The template format to use ('md' for Claude/Open Code, 'toml' for Gemini) */ export declare function getTemplateFormat(assistant: Assistant): TemplateFormat; /** * Interface for parsed markdown frontmatter */ export interface MarkdownFrontmatter { [key: string]: unknown; } /** * Parse YAML frontmatter from markdown content * @param content - The markdown content with frontmatter * @returns Object containing frontmatter and body content */ export declare function parseFrontmatter(content: string): { frontmatter: MarkdownFrontmatter; body: string; }; /** * Escape a string for TOML format * @param str - The string to escape * @returns The escaped string suitable for TOML */ export declare function escapeTomlString(str: string): string; /** * Escape a string for TOML triple-quoted format * Triple-quoted strings in TOML do NOT interpret escape sequences, * so we preserve newlines and only escape triple-quote boundaries. * However, some TOML parsers (notably Gemini's) treat backslashes as escape * characters even in triple-quoted strings, so we must escape them. * @param str - The string to escape * @returns The escaped string suitable for TOML triple-quoted strings */ export declare function escapeTomlTripleQuotedString(str: string): string; /** * Convert markdown template content to TOML format for Gemini * @param mdContent - The markdown template content * @returns The converted TOML content */ export declare function convertMdToToml(mdContent: string): string; /** * Convert markdown template content to GitHub Copilot prompt file format * @param mdContent - The markdown template content * @returns The converted prompt file content */ export declare function convertMdToGitHubPrompt(mdContent: string): string; /** * Read a markdown template file and optionally convert to TOML or GitHub prompt format * @param templatePath - Path to the markdown template * @param targetFormat - Target format ('md' or 'toml') * @param assistant - Optional assistant type for format-specific processing * @returns The template content in the requested format */ export declare function readAndProcessTemplate(templatePath: string, targetFormat: TemplateFormat, assistant?: Assistant): Promise; /** * Write processed template content to destination * @param content - The template content to write * @param destPath - Destination file path */ export declare function writeProcessedTemplate(content: string, destPath: string): Promise; //# sourceMappingURL=utils.d.ts.map