/** * Tool handlers for git commit operations. */ import type { ToolResponse } from './types.js'; /** * Commit rules reminder text. */ export declare const COMMIT_RULES = "\n## Commit Rules Reminder\n\n1. **Branch**: Must be on a feature branch, not main/master\n2. **Message length**: Subject line must be \u226472 characters\n3. **Imperative mood**: \"Add feature\" not \"Added feature\"\n4. **Single responsibility**: One logical change per commit\n5. **Body format**: Only \"Co-Authored-By: Claude \"\n\n**Signs of multi-responsibility** (split into separate commits):\n- Message contains \"and\" connecting actions\n- Message lists multiple changes with commas\n- Changes span unrelated files/features\n"; /** * Execute a git command safely using spawn with array arguments. */ export declare function gitSpawn(args: string[], options: { cwd: string; stdin?: string; }): Promise<{ stdout: string; stderr: string; }>; /** * Interface for git operations (for testability). */ export interface IGitOperations { getCurrentBranch(cwd: string): Promise; stageFiles(cwd: string, files: string[]): Promise; getStagedFiles(cwd: string): Promise; commit(cwd: string, message: string): Promise; unstageFiles(cwd: string, files: string[]): Promise; writeMarkerFile(projectPath: string): void; } /** * Default git operations implementation. */ export declare const defaultGitOperations: IGitOperations; /** * Context for commit tools. */ export interface CommitToolContext { projectPath: string; /** Optional git operations (for testing). */ gitOperations?: IGitOperations; } /** * Arguments for commit tool. */ export interface CommitArgs { message: string; files?: string[]; } /** * Parse and validate commit arguments. */ export declare function parseCommitArgs(args: Record | undefined): CommitArgs; /** * Validation result for commit message. */ export interface CommitValidationResult { valid: boolean; errors: string[]; warnings: string[]; } /** * Validate commit message and branch. */ export declare function validateCommit(message: string, context: CommitToolContext): Promise; /** * Format validation errors for response. */ export declare function formatValidationErrors(errors: string[], warnings: string[]): string; /** * Format successful commit response. */ export declare function formatCommitSuccess(output: string, warnings: string[]): string; /** * Handle commit tool. */ export declare function handleCommit(args: CommitArgs, context: CommitToolContext): Promise; //# sourceMappingURL=commit-handlers.d.ts.map