/** * Prompt file utilities for preventing tool output truncation. * * Instead of inlining large prompts in tool outputs, we write them to files * and pass file references. This keeps tool output sizes bounded while * preserving full prompt content for workers. * * Security: All file operations are restricted to workspace/.hive paths. */ /** * Result of resolving prompt content from a file. */ export interface PromptFileResult { /** The prompt content if successfully read */ content?: string; /** Error message if reading failed */ error?: string; } /** * Find the workspace root by walking up from a start directory. * * The workspace root is identified as the directory that contains a .hive folder. * Returns null if no .hive directory is found. */ export declare function findWorkspaceRoot(startDir: string): string | null; /** * Check if a file path is valid for prompt file operations. * * Security: Only allows paths within the workspace directory. * Rejects path traversal attempts (../). * * @param filePath - The path to validate * @param workspaceRoot - The workspace root directory * @returns true if the path is valid and safe */ export declare function isValidPromptFilePath(filePath: string, workspaceRoot: string): boolean; /** * Resolve prompt content from a file. * * Security: Validates that the file path is within the workspace. * * @param promptFilePath - Path to the prompt file * @param workspaceRoot - The workspace root directory for security validation * @returns The prompt content or an error */ export declare function resolvePromptFromFile(promptFilePath: string, workspaceRoot: string): Promise; /** * Write worker prompt to a file and return the path. * * Creates the directory structure if it doesn't exist. * * @param feature - Feature name * @param task - Task folder name * @param prompt - The full worker prompt content * @param hiveDir - The .hive directory path * @returns The path to the written prompt file */ export declare function writeWorkerPromptFile(feature: string, task: string, prompt: string, hiveDir: string): string;