UNPKG

@vfarcic/dot-ai

Version:

AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance

68 lines 2.21 kB
/** * Internal Agentic-Loop Tools (PRD #407, PRD #408) * * Tools that run locally in the MCP server, available to the AI * during investigation loops alongside plugin tools. NOT exposed * to client agents — only the AI inside toolLoop() calls these. * * Tools: * - git_clone: Clone a Git repo * - fs_list: List files at a path * - fs_read: Read a file at a path * - git_create_pr: Create a PR with file changes (PRD #408) * * All filesystem operations are scoped to ./tmp/gitops-clones/ * to prevent path traversal attacks. */ import type { AITool, ToolExecutor } from './ai-provider.interface.js'; /** * Validate that a relative path is safe and resolve it within the clones directory. * Uses sanitizeRelativePath for traversal checks, then resolves to absolute. * Exported for testing. */ export declare function validatePathWithinClones(inputPath: string): string; /** * Returns internal tools available to the AI during investigation. * Note: git_create_pr is executor-only and not exposed to investigation. */ export declare function getInternalTools(): AITool[]; export interface GitCreatePrInput { repoPath: string; files: Array<{ path: string; content: string; }>; title: string; body?: string; branchName: string; baseBranch?: string; } export type GitCreatePrResult = { success: true; prUrl: string; prNumber: number; branch: string; baseBranch: string; filesChanged: string[]; } | { success: true; branch: string; baseBranch: string; filesChanged: string[]; error: string; } | { success: false; error: string; }; /** * Create a ToolExecutor that handles internal agentic-loop tools. * Designed to be passed as the fallbackExecutor to pluginManager.createToolExecutor(). */ export declare function createInternalToolExecutor(sessionId: string): ToolExecutor; /** * Remove session clone directories older than the TTL. * Called at the start of each new remediate investigation. * Non-blocking: runs cleanup in the background without delaying investigation. */ export declare function cleanupOldClones(maxAgeMs?: number): void; //# sourceMappingURL=internal-tools.d.ts.map