import { z } from 'zod';
import { ScmOperationErrorCodeSchema, ScmRemoteResponseSchema, ScmRequestBaseSchema, } from './scm.js';
export const ScmBranchTypeSchema = z.enum(['local', 'remote']);
export const ScmBranchListRequestSchema = ScmRequestBaseSchema.extend({
    includeRemotes: z.boolean().optional(),
});
export const ScmBranchListEntrySchema = z.object({
    name: z.string(),
    type: ScmBranchTypeSchema,
    upstream: z.string().nullable().optional(),
    isCurrent: z.boolean().optional(),
});
export const ScmBranchListResponseSchema = z.object({
    success: z.boolean(),
    branches: z.array(ScmBranchListEntrySchema).optional(),
    error: z.string().optional(),
    errorCode: ScmOperationErrorCodeSchema.optional(),
});
export const ScmBranchCreateRequestSchema = ScmRequestBaseSchema.extend({
    name: z.string().min(1),
    checkout: z.boolean().optional(),
    startPoint: z.string().optional(),
});
export const ScmBranchCreateResponseSchema = z.object({
    success: z.boolean(),
    stdout: z.string().optional(),
    stderr: z.string().optional(),
    error: z.string().optional(),
    errorCode: ScmOperationErrorCodeSchema.optional(),
});
export const ScmBranchCheckoutStrategySchema = z.enum(['stash_on_current_branch', 'bring_changes']);
export const ScmBranchCheckoutRequestSchema = ScmRequestBaseSchema.extend({
    name: z.string().min(1),
    strategy: ScmBranchCheckoutStrategySchema,
    overwriteCurrentBranchStash: z.boolean().optional(),
});
export const ScmBranchCheckoutResponseSchema = z.object({
    success: z.boolean(),
    stdout: z.string().optional(),
    stderr: z.string().optional(),
    didCreateStash: z.boolean().optional(),
    didPopStash: z.boolean().optional(),
    stashRef: z.string().nullable().optional(),
    error: z.string().optional(),
    errorCode: ScmOperationErrorCodeSchema.optional(),
});
export const ScmRemotePublishRequestSchema = ScmRequestBaseSchema.extend({
    remote: z.string().optional(),
});
export const ScmRemotePublishResponseSchema = ScmRemoteResponseSchema;
//# sourceMappingURL=scmBranches.js.map