import type { GitAction } from './common/index.js';
import type { GeneratedDocument } from './docs.js';
export interface GitConfig {
    branchPrefix?: Record<string, string>;
    commitFormat?: 'conventional' | 'spec-id' | 'custom';
    customCommitTemplate?: string;
    autoCreateBranch?: boolean;
    requireSpecInCommit?: boolean;
    protectedBranches?: string[];
    baseBranch?: string;
    stalenessThreshold?: number;
    changelogFormat?: 'technical' | 'user-facing';
    /** cleanup action: when true, drop stale stashes immediately instead of only reporting them */
    force?: boolean;
    /** GitHub Issues sync: issue number to import from, export to, or sync with */
    issueNumber?: number;
    /** GitHub Issues sync: repository in "owner/repo" format (auto-detected from git remote if omitted) */
    repo?: string;
    /** worktree-start: custom name for the worktree when no specId is provided */
    customName?: string;
    /** worktree-cleanup: when true, generate removal commands for ALL non-main worktrees */
    removeAll?: boolean;
    /** worktree-cleanup: name of a specific worktree to remove */
    name?: string;
}
export interface PrTemplate {
    title: string;
    body: string;
    labels: string[];
    reviewers?: string[];
    linkedIssues?: string[];
}
export interface LinkedCommit {
    hash: string;
    message: string;
    specId: string;
    author: string;
    date: string;
    filesChanged: string[];
}
export interface GitSpecStatus {
    currentBranch: string;
    linkedSpec?: string;
    uncommittedChanges: number;
    commitsAhead: number;
    specsCoveredByCommits: string[];
    specsInProgress: string[];
}
export interface SessionResumeInfo {
    command: string;
    description: string;
    prNumber?: number;
}
export interface ManageGitResult {
    action: GitAction;
    branchName?: string;
    prTemplate?: PrTemplate;
    linkedCommits?: LinkedCommit[];
    changelog?: GeneratedDocument;
    hooksInstalled?: string[];
    status?: GitSpecStatus;
    message: string;
    sessionResume?: SessionResumeInfo;
}
export interface PreCommitHookConfig {
    validateSpecExists: boolean;
    validateBranchName: boolean;
    runLinting: boolean;
    runTests: boolean;
    checkEnvSecrets: boolean;
    maxFilesPerCommit?: number;
}
export interface ManageGitInput {
    projectId: string;
    action: GitAction;
    specId?: string;
    config?: GitConfig;
    files?: string[];
}
export type ChangelogFormat = 'technical' | 'user-facing';
export type HookManager = 'husky' | 'lefthook' | 'simple-git-hooks' | 'native';
export type GitFlowType = 'gitflow' | 'github-flow' | 'trunk-based';
export type BreakingChangeType = 'breaking' | 'non-breaking' | 'deprecation';
export interface BranchConvention {
    prefix: string;
    specId: string;
    slug: string;
    fullName: string;
}
export interface GitChangelogEntry {
    type: string;
    specId?: string;
    description: string;
    commits: string[];
    version?: string;
}
export interface HookConfig {
    type: 'commit-msg' | 'pre-commit' | 'pre-push';
    manager: HookManager;
    script: string;
    enabled: boolean;
}
export interface GitStatusView {
    specsInProgress: string[];
    activeBranches: string[];
    unmergedChanges: number;
    branchesCommitsBehind: Record<string, number>;
}
export interface BreakingChange {
    type: BreakingChangeType;
    description: string;
    file?: string;
    consumers?: string[];
    migrationPlan?: string;
}
export interface ReleaseInfo {
    version: string;
    bumpType: 'major' | 'minor' | 'patch';
    tagName: string;
    releaseBranch?: string;
    releaseNotes: string;
    mergeInstructions: string[];
}
export interface SyncBranchResult {
    commitsBehinds: number;
    strategy: 'rebase' | 'merge';
    gitFlowType: GitFlowType;
    conflictingFiles?: string[];
    message: string;
}
export interface BreakingCheckResult {
    hasBreakingChanges: boolean;
    changes: BreakingChange[];
    summary: string;
}
export interface OrphanCommit {
    hash: string;
    message: string;
    author: string;
    date: string;
    suggestedSpecId?: string;
}
export interface GitSetupResult {
    data: Record<string, unknown>;
    branch: string;
}
export interface AutoSetupResult {
    action: 'auto-setup';
    gitFlowType: GitFlowType;
    baseBranch: string;
    newBranch: string;
    syncedBase: boolean;
    message: string;
}
export interface StaleStash {
    index: number;
    ref: string;
    message: string;
    daysOld: number;
}
export interface CleanupReport {
    action: 'cleanup';
    worktreesRemoved: string[];
    branchesRemoved: string[];
    remotePruned: boolean;
    stalesStashes: StaleStash[];
    stashesDropped: number;
    errors: string[];
    message: string;
    autoCompleted?: string[];
}
export interface SpecDoneCleanupResult {
    worktreeRemoved: string | null;
    localBranchRemoved: string | null;
    remoteBranchRemoved: string | null;
    errors: string[];
}
export interface GitHubIssueImportResult {
    action: 'import-issue';
    specId: string;
    issueNumber: number;
    issueUrl: string;
    specPath: string;
    message: string;
}
export interface GitHubIssueExportResult {
    action: 'export-to-issue';
    specId: string;
    issueNumber: number;
    issueUrl: string;
    message: string;
}
export interface GitHubIssueSyncResult {
    action: 'sync-issue';
    specId: string;
    issueNumber: number;
    issueUrl: string;
    syncedAction: 'closed' | 'commented' | 'none';
    message: string;
}
export interface GitHubIssueShape {
    number: number;
    title: string;
    body: string | null;
    html_url: string;
    state: 'open' | 'closed';
    labels: {
        name: string;
    }[];
}
export interface GitHubIssueCreatePayload {
    title: string;
    body: string;
    labels?: string[];
}
export interface GitHubIssuePatchPayload {
    state?: 'open' | 'closed';
}
export interface GitHubIssueComment {
    body: string;
}
export interface DiffStats {
    /** Number of files changed in the diff */
    filesChanged: number;
    /** Total lines added */
    linesAdded: number;
    /** Total lines removed */
    linesRemoved: number;
    /** List of changed file paths */
    files: string[];
}
export interface AssessMergeRiskOptions {
    /** Branch to assess (default: current branch) */
    branch?: string;
    /** Base branch to compare against (default: main) */
    baseBranch?: string;
    /** Description of the change for spec compliance check */
    context?: string;
}
export interface AnalyzerResult {
    /** Risk score for this category (0-100) */
    score: number;
    /** Human-readable explanation */
    reason: string;
}
export interface RiskBreakdown {
    /** Category name (e.g. "Security Surface") */
    category: string;
    /** Score for this category (0-100) */
    score: number;
    /** Weight contribution to final score (all weights sum to 1.0) */
    weight: number;
    /** Human-readable explanation of the score */
    reason: string;
}
export interface MergeRiskResult {
    /** Weighted composite risk score (0-100) */
    riskScore: number;
    /** Merge recommendation based on risk score */
    recommendation: 'auto-merge' | 'human-review' | 'block';
    /** Per-category breakdown of the risk score */
    breakdown: RiskBreakdown[];
    /** Number of files changed in the diff */
    filesChanged: number;
    /** Lines added in the diff */
    linesAdded: number;
    /** Lines removed in the diff */
    linesRemoved: number;
    /** Plain-language summary for humans */
    humanSummary: string;
}
export type HookSystem = 'husky' | 'lefthook' | 'simple-git-hooks' | 'native' | 'none';
export interface PlanuAutoStageResult {
    injected: boolean;
    hookSystem: HookSystem;
    hookFile: string;
    alreadyPresent: boolean;
    manualInstructions?: string;
}
export interface PrDescriptionResult {
    specId: string;
    specTitle: string;
    markdown: string;
    titleSuggestion: string;
    labels: string[];
    generatedAt: string;
}
export interface PrLink {
    specId: string;
    prUrl: string;
    prNumber?: number;
    platform: 'github' | 'gitlab' | 'linear' | 'other';
    linkedAt: string;
}
export interface GeneratePrDescriptionInput {
    projectPath: string;
    specId: string;
    platform?: 'github' | 'gitlab' | 'linear';
    audience?: 'developer' | 'reviewer' | 'stakeholder';
    includeChecklist?: boolean;
}
export interface LinkPrToSpecInput {
    projectPath: string;
    specId: string;
    prUrl: string;
    prNumber?: number;
    platform?: 'github' | 'gitlab' | 'linear' | 'other';
}
export interface ListSpecPrsInput {
    projectPath: string;
    specId?: string;
}
export type PlanuAutocommitSkipReason = 'disabled' | 'no-staged-changes' | 'mid-merge' | 'detached-head';
export type PlanuAutocommitReason = 'mark-done' | 'sync-release' | 'status-update' | 'session-checkpoint';
export interface PlanuAutocommitResult {
    committed: boolean;
    commitSha?: string;
    skipped?: PlanuAutocommitSkipReason;
    warning?: string;
}
export interface PlanuAutocommitOptions {
    /** Absolute path to the project root (git working tree). */
    projectPath: string;
    /** When provided, included in the commit message (e.g. "SPEC-575"). */
    specId?: string;
    /** Determines the commit message template. */
    reason: PlanuAutocommitReason;
}
//# sourceMappingURL=git.d.ts.map