/** * `generacy cockpit context ` — classify the issue's current * `waiting-for:*` gate and emit the bundle that gate needs. Single JSON line * on stdout. * * Gates and bundle shapes are defined in * `specs/807-epic-generacy-ai-tetrad/contracts/*.schema.json`. * * Exit codes (per FR-004): * 0 — bundle emitted * 1 — gh IO failure * 2 — ref-parse failure (bare number without inferrable origin, etc.) * 3 — gate refusal (no waiting-for:*, completed:validate, unsupported gate, * PR-scoped gate with no resolvable PR) */ import { Command } from 'commander'; import { type CommandRunner, type GhWrapper } from '@generacy-ai/cockpit'; type ArtifactPathsGate = 'waiting-for:spec-review' | 'waiting-for:plan-review' | 'waiting-for:tasks-review'; export interface ArtifactOutput { path: string; body: string; } export interface ClarificationCommentOutput { body: string; author: string; createdAt: string; url: string; } export interface CodeReferencesOutput { prUrl: string; touchedFiles: string[]; diffPatch: string; } export interface ClarificationBundle { issue: string; gate: 'waiting-for:clarification'; clarificationComment: ClarificationCommentOutput | null; spec: ArtifactOutput | null; plan: ArtifactOutput | null; codeReferences: CodeReferencesOutput | null; } export interface ImplementationReviewBundle { issue: string; gate: 'waiting-for:implementation-review'; pr: { number: number; title: string; url: string; base: string; head: string; body: string; author: string | null; state: 'OPEN' | 'CLOSED' | 'MERGED'; draft: boolean; }; diff: string; diffTruncated: boolean; checks: Array<{ name: string; state: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'NEUTRAL' | 'SKIPPED' | 'CANCELLED'; conclusion?: string; url?: string; }>; } export interface ArtifactPathsBundle { issue: string; gate: ArtifactPathsGate; artifacts: { spec: ArtifactOutput | null; plan: ArtifactOutput | null; tasks: ArtifactOutput | null; }; } export type ContextBundle = ClarificationBundle | ImplementationReviewBundle | ArtifactPathsBundle; export interface ContextCommandDeps { runner?: CommandRunner; gh?: GhWrapper; /** Override `git branch --show-current`. */ getBranch?: () => Promise; /** Repo root for `specs//…` lookup; defaults to `process.cwd()`. */ cwd?: string; /** Base branch for the `git diff` fallback; defaults to `develop`. */ baseBranch?: string; stdout?: (line: string) => void; stderr?: (line: string) => void; } export declare function contextCommand(deps?: ContextCommandDeps): Command; export declare function runContext(issueArg: string, deps?: ContextCommandDeps): Promise; export {}; //# sourceMappingURL=context.d.ts.map