import { z } from 'zod';
export const GitFileStatusSchema = z.enum([
    'added',
    'modified',
    'deleted',
    'renamed',
    'copied',
    'type-changed',
    'unmerged',
    'unknown',
]);
export const GitChangedFileSchema = z.object({
    status: GitFileStatusSchema,
    path: z.string(),
    oldPath: z.string().optional(),
    similarity: z.number().optional(),
    binary: z.boolean().optional(),
});
export const GitNumstatSchema = z.object({
    path: z.string(),
    oldPath: z.string().optional(),
    added: z.number().nullable(),
    deleted: z.number().nullable(),
    binary: z.boolean().optional(),
});
export const GitRangeKindSchema = z.enum(['three-dot', 'two-dot', 'working-tree', 'staged', 'commit']);
export const GitRangeSchema = z.object({
    base: z.string().optional(),
    head: z.string().optional(),
    kind: GitRangeKindSchema,
    mergeBase: z.string().optional(),
    resolvedBase: z.string().optional(),
    resolvedHead: z.string().optional(),
    describe: z.string(),
});
export const GitDiffSummarySchema = z.object({
    range: GitRangeSchema,
    files: z.array(GitChangedFileSchema),
    numstat: z.array(GitNumstatSchema),
    totalAdded: z.number(),
    totalDeleted: z.number(),
    filesChanged: z.number(),
    binaryFiles: z.number(),
});
export const GitDiffPatchSchema = z.object({
    range: GitRangeSchema,
    patch: z.string(),
    truncated: z.boolean(),
    tokensUsed: z.number(),
    tokenBudget: z.number().optional(),
    filesIncluded: z.number(),
    filesOmitted: z.number(),
});
export const GitDiffHunkSchema = z.object({
    path: z.string(),
    oldPath: z.string().optional(),
    oldStart: z.number(),
    oldLines: z.number(),
    newStart: z.number(),
    newLines: z.number(),
    newEnd: z.number(),
    header: z.string(),
    addedLines: z.array(z.number()),
    deletedLines: z.array(z.number()),
    deletedLineTexts: z
        .array(z.object({
        line: z.number(),
        text: z.string(),
    }))
        .optional(),
});
export const GitFileHunksSchema = z.object({
    path: z.string(),
    oldPath: z.string().optional(),
    binary: z.boolean(),
    hunks: z.array(GitDiffHunkSchema),
});
export const GitDiffHunksSchema = z.object({
    range: GitRangeSchema,
    files: z.array(GitFileHunksSchema),
});
export const GitCommitSchema = z.object({
    hash: z.string(),
    shortHash: z.string(),
    authorName: z.string(),
    authorEmail: z.string(),
    authorDate: z.string(),
    committerDate: z.string(),
    subject: z.string(),
    body: z.string().optional(),
});
export const GitCommitHistorySchema = z.object({
    commits: z.array(GitCommitSchema),
    total: z.number(),
    truncated: z.boolean(),
    pathFilter: z.string().optional(),
});
export const GitFileHistoryEntrySchema = GitCommitSchema.extend({
    added: z.number().nullable(),
    deleted: z.number().nullable(),
});
export const GitFileHistorySchema = z.object({
    path: z.string(),
    lineRange: z.object({ start: z.number(), end: z.number() }).optional(),
    entries: z.array(GitFileHistoryEntrySchema),
    total: z.number(),
    truncated: z.boolean(),
});
export const GitChurnEntrySchema = z.object({
    path: z.string(),
    commits: z.number(),
    added: z.number(),
    deleted: z.number(),
    net: z.number(),
    churn: z.number(),
    lastTouched: z.string(),
});
export const GitChurnSortSchema = z.enum(['churn', 'commits', 'added', 'deleted', 'net']);
export const GitChurnSummarySchema = z.object({
    range: GitRangeSchema,
    entries: z.array(GitChurnEntrySchema),
    totalCommits: z.number(),
    sortedBy: GitChurnSortSchema,
});
export const GitCochangePairSchema = z.object({
    fileA: z.string(),
    fileB: z.string(),
    count: z.number(),
    lift: z.number(),
    lastCochangedAt: z.string(),
});
export const GitCochangeAggregationOptionsSchema = z.object({
    target: z.string().optional(),
    limit: z.number().int().positive().optional(),
    maxCommitFiles: z.number().int().positive().optional(),
});
export const GitCochangeSummarySchema = z.object({
    range: GitRangeSchema,
    pairs: z.array(GitCochangePairSchema),
    totalCommits: z.number(),
    consideredCommits: z.number(),
    skippedCommits: z.number(),
    maxCommitFiles: z.number(),
    target: z.string().optional(),
});
export const GitRepoInfoSchema = z.object({
    repoRoot: z.string(),
    defaultBranch: z.string().optional(),
    head: z.string().optional(),
    isDirty: z.boolean(),
    currentBranch: z.string().optional(),
    shallow: z.boolean(),
    detached: z.boolean(),
    gitVersion: z.string().optional(),
});
//# sourceMappingURL=types.js.map