import { z } from 'zod';

/**
 * Rebase-snapshot re-uses the same mechanics as squash: backup, delete
 * branch-only files, reset snapshot to base, regenerate one migration. The
 * semantic difference is context: this CLI is meant to run AFTER a rebase
 * that left the ModelSnapshot.cs in a conflicted state. The base ref should
 * be whatever the branch was rebased onto.
 */
export const RebaseSnapshotSpecSchema = z.object({
  cwd: z.string().min(1),
  contextName: z.string().min(1),
  description: z.string().min(1),
  assembly: z.string().optional(),
  baseBranch: z.string().optional(),
  dryRun: z.boolean().optional().default(false),
  /**
   * Override the "branch is behind its reference" guard. After a clean rebase
   * you are not behind the reference, so this is rarely needed — but it is
   * available for the case where you rebased onto an older base on purpose.
   */
  allowBehindBase: z.boolean().optional().default(false),
});
export type RebaseSnapshotSpec = z.infer<typeof RebaseSnapshotSpecSchema>;

export type { SquashAssemblyResult as RebaseAssemblyResult, SquashResult as RebaseSnapshotResult } from '../squash/types.js';
