import type { ModelTier } from './multi-agent.js';
/** Work unit enriched with resolved file assignments. */
export interface MappedUnit {
    id: string;
    title: string;
    criteria: string[];
    /** Concrete file paths assigned to this unit (may overlap before resolution). */
    files: string[];
    recommendedModel: ModelTier;
    estimatedHours: number;
}
/** A raw work unit before file ownership is assigned. */
export interface WorkUnit {
    /** Slug-based identifier (e.g. "unit-types", "unit-engine"). */
    id: string;
    /** Short human-readable title. */
    title: string;
    /** Acceptance criteria lines belonging to this unit. */
    criteria: string[];
    /** Files detected as likely relevant to these criteria. */
    suggestedFiles: string[];
    /** Model tier recommendation based on content analysis. */
    recommendedModel: ModelTier;
    /** Estimated hours (heuristic). */
    estimatedHours: number;
}
/** A single agent task produced by spec decomposition. */
export interface AgentTask {
    /** Unique task identifier (e.g. "task-1-types"). */
    id: string;
    /** Short human-readable title. */
    title: string;
    /** Full description of what the agent should implement. */
    description: string;
    /** Acceptance criteria covered by this task. */
    criteria: string[];
    /** Files this agent exclusively owns (no other task may touch these). */
    ownedFiles: string[];
    /** IDs of tasks that must complete before this one starts. */
    dependencies: string[];
    /** Recommended model tier for this task. */
    recommendedModel: ModelTier;
    /** Estimated hours to complete this task. */
    estimatedHours: number;
    /** Whether this task can run in parallel with others. */
    canRunParallel: boolean;
    /** SPEC-641: Per-criterion model routing for fine-grained execution. */
    criterionRoutes?: CriterionRoute[];
}
/** SPEC-641: Per-criterion model routing with cost/token budget. */
export interface CriterionRoute {
    /** The original criterion text. */
    text: string;
    /** Model to use for this criterion. */
    recommendedModel: ModelTier;
    /** Token budget estimate for this criterion. */
    tokenBudget: number;
    /** Estimated cost in USD for this criterion. */
    estimatedCost: number;
    /** Short rationale for the model choice. */
    rationale: string;
}
/** Ownership record linking a file path to a task ID. */
export interface FileOwnership {
    /** Absolute or repo-relative file path. */
    filePath: string;
    /** ID of the task that owns this file. */
    taskId: string;
}
/** Conflict detected between two tasks that both claim the same file. */
export interface OwnershipConflict {
    /** File path claimed by multiple tasks. */
    filePath: string;
    /** IDs of the tasks competing for this file. */
    conflictingTaskIds: string[];
    /** Resolution applied: one task was given ownership, others receive dependency. */
    resolution: string;
}
/** Result of resolving file ownership conflicts across mapped units. */
export interface OwnershipResolutionResult {
    tasks: AgentTask[];
    fileOwnership: FileOwnership[];
    conflicts: OwnershipConflict[];
    executionPhases: DecomposeExecutionPhase[];
}
/** Result returned by the decomposeSpec() engine function. */
export interface SpecDecomposeResult {
    /** Spec identifier. */
    specId: string;
    /** Total number of tasks generated. */
    taskCount: number;
    /** Generated agent tasks. */
    tasks: AgentTask[];
    /** File ownership map (file → task). */
    fileOwnership: FileOwnership[];
    /** Conflicts detected and resolved during ownership assignment. */
    conflicts: OwnershipConflict[];
    /** Execution phases (tasks within a phase run in parallel). */
    executionPhases: DecomposeExecutionPhase[];
    /** Human-readable warnings (e.g. tasks with no files, oversized groups). */
    warnings: string[];
    /** Whether the result is ready to be fed into orchestrate_runtime. */
    orchestrationReady: boolean;
}
/** A group of tasks that can run in parallel during the same phase. */
export interface DecomposeExecutionPhase {
    /** Phase number (1-based). */
    phase: number;
    /** Task IDs in this phase. */
    taskIds: string[];
    /** Reason for this grouping (e.g. "no shared files"). */
    reason: string;
}
/** Input for the decompose_spec MCP tool. */
export interface DecomposeSpecInput {
    /** Project identifier (used to locate spec files). */
    projectId?: string;
    /** Absolute path to the project root. Derives projectId automatically. */
    projectPath?: string;
    /** Spec ID to decompose (e.g. "SPEC-042"). */
    specId: string;
    /** Maximum number of agent tasks to generate (default: 5). */
    maxTasks?: number;
}
//# sourceMappingURL=spec-decomposer.d.ts.map