import { Effect } from 'effect'; import { GitError } from '../types/errors.js'; export interface GitStatus { filesAdded: number; filesDeleted: number; aheadCount: number; behindCount: number; parentBranch: string | null; } /** * Get comprehensive Git status for a worktree * * Retrieves file changes, ahead/behind counts, and parent branch information * using Effect-based error handling. * * @param {string} worktreePath - Absolute path to the worktree directory * @returns {Effect.Effect} Effect containing git status or GitError * * @example * ```typescript * import {Effect} from 'effect'; * import {getGitStatus} from './utils/gitStatus.js'; * * // Execute with Effect.runPromise * const status = await Effect.runPromise( * getGitStatus('/path/to/worktree') * ); * console.log(`Files added: ${status.filesAdded}, deleted: ${status.filesDeleted}`); * console.log(`Ahead: ${status.aheadCount}, behind: ${status.behindCount}`); * * // Or use Effect.map for transformation * const formatted = await Effect.runPromise( * Effect.map( * getGitStatus('/path/to/worktree'), * (status) => `+${status.filesAdded} -${status.filesDeleted}` * ) * ); * ``` * * @throws {GitError} When git commands fail or worktree path is invalid */ export declare const getGitStatus: (worktreePath: string) => Effect.Effect; export declare const getGitStatusLimited: (worktreePath: string) => Effect.Effect; /** * Get the last commit date for a worktree * * @param worktreePath - Absolute path to the worktree directory * @returns Effect containing the commit date or GitError */ export declare const getLastCommitDate: (worktreePath: string) => Effect.Effect; export declare const getLastCommitDateLimited: (worktreePath: string) => Effect.Effect; export declare function formatGitFileChanges(status: GitStatus): string; export declare function formatGitAheadBehind(status: GitStatus): string; export declare function formatGitStatus(status: GitStatus): string; export declare function formatParentBranch(parentBranch: string | null, currentBranch: string): string;