/** * `generacy cockpit queue ` — enqueue every eligible ref * listed under the matched `### ` heading in the epic body. * * Pipeline: * 1. resolveEpic(epicRef) → matchPhaseHeading(phase). * 2. Per ref in the matched phase: gh issue view → classifyRow → eligible or [SKIP: …]. * 3. Print preview; if !--yes, prompt; on confirm, assign + label best-effort. */ import { Command } from 'commander'; import { loadCockpitConfig, type CommandRunner, type GhWrapper, type IssueRef, type ParsedPhase, type ResolvedEpic } from '@generacy-ai/cockpit'; import { type DependencyRef } from './plan-dependency-extractor.js'; export interface QueueOptions { label?: string; repo?: string; assignee?: string; yes?: boolean; /** #935: single-issue form — mutually exclusive with positional . */ issue?: string; } export interface QueueIssueResult { ref: IssueRef; workflowLabel: string; assignee: string; row: QueueRow; confirmed: boolean; exitCode: 0 | 1 | 2; } export type EligibilityStatus = { kind: 'eligible'; workflowLabel: string; } | { kind: 'skip'; reason: 'closed' | 'cross-repo' | 'already-labeled' | 'not-found'; }; export type MutationOutcome = { kind: 'ok'; } | { kind: 'already'; } | { kind: 'error'; reason: string; }; /** Warning state observed at queue time for a plan.md-declared dependency (#864). */ export type DependencyWarningState = 'unresolved' | 'closed-unmerged'; export interface DependencyWarning { ref: DependencyRef; state: DependencyWarningState; } export interface QueueRow { ref: IssueRef; title: string; labels: string[]; assignees: string[]; eligibility: EligibilityStatus; /** * Present only when eligibility.kind === 'eligible', the phase heading matches * /implement/i, and plan.md-declared prerequisites are not yet merged (#864). */ dependencyWarnings?: DependencyWarning[]; assignResult?: MutationOutcome; labelResult?: MutationOutcome; } export interface QueueResult { epic: ResolvedEpic; phase: ParsedPhase; targetRepo: string; workflowLabel: string; assignee: string; rows: QueueRow[]; confirmed: boolean; exitCode: 0 | 1 | 2; } /** * Fetches the raw `plan.md` for a given issue via the GitHub API. * Returns `null` when the file (or spec directory) doesn't exist yet. */ export type PlanFetcher = (ref: IssueRef) => Promise; export interface QueueCommandDeps { runner?: CommandRunner; gh?: GhWrapper; cockpitGh?: GhWrapper; loadConfig?: typeof loadCockpitConfig; env?: NodeJS.ProcessEnv; prompt?: (message: string) => Promise; stdout?: (line: string) => void; stderr?: (line: string) => void; /** Optional plan.md fetcher — defaults to a `gh api` call via `deps.runner`. */ fetchPlan?: PlanFetcher; } export declare function renderPreview(epic: ResolvedEpic, phase: ParsedPhase, targetRepo: string, workflowLabel: string, assignee: string, rows: QueueRow[]): string[]; export declare function renderSummary(rows: QueueRow[]): string[]; export declare function runQueue(epicRef: string | undefined, phaseArg: string | undefined, opts: QueueOptions, deps: QueueCommandDeps): Promise; /** * Single-issue queue form (#935). Bypasses `resolveEpic` — the caller supplies * one specific issue ref; classify and mutate as a single row. */ export declare function runQueueSingleIssue(issueArg: string, opts: QueueOptions, deps: QueueCommandDeps): Promise; export declare function queueCommand(deps?: QueueCommandDeps): Command; //# sourceMappingURL=queue.d.ts.map