/** * Zod Schema for Watch PR Results * * CRITICAL PROJECT REQUIREMENT: All YAML-serializable types MUST be Zod schemas. * Use z.infer<> to derive TypeScript types. Manual interfaces only for non-serializable data. * * This schema defines the complete structure of watch-pr command output, * enabling runtime validation and JSON Schema generation. * * Output follows "Newspaper Philosophy" ordering: most important info first. * * @packageDocumentation */ import { z } from 'zod'; /** * Check Status Enum * * GitHub check run status */ export declare const CheckStatusSchema: z.ZodEnum<["queued", "in_progress", "completed"]>; /** * Check Conclusion Enum * * GitHub check run conclusion (present when status is 'completed') */ export declare const CheckConclusionSchema: z.ZodEnum<["success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"]>; /** * Merge State Status Enum * * GitHub PR merge state status */ export declare const MergeStateStatusSchema: z.ZodEnum<["BEHIND", "BLOCKED", "CLEAN", "DIRTY", "DRAFT", "HAS_HOOKS", "UNKNOWN", "UNSTABLE"]>; /** * Severity Enum * * Severity level for guidance and external checks */ export declare const SeveritySchema: z.ZodEnum<["error", "warning", "info"]>; /** * Linked Issue Schema * * GitHub issue linked to the PR (via closing keywords or manually) */ export declare const LinkedIssueSchema: z.ZodObject<{ /** Issue number */ number: z.ZodNumber; /** Issue title */ title: z.ZodString; /** Issue URL */ url: z.ZodString; }, "strip", z.ZodTypeAny, { number: number; title: string; url: string; }, { number: number; title: string; url: string; }>; /** * PR Metadata Schema * * Complete PR context including metadata, labels, and linked issues */ export declare const PRMetadataSchema: z.ZodObject<{ /** PR number */ number: z.ZodNumber; /** PR title */ title: z.ZodString; /** PR URL */ url: z.ZodString; /** Head branch name */ branch: z.ZodString; /** Base branch name (usually 'main' or 'develop') */ base_branch: z.ZodString; /** PR author username */ author: z.ZodString; /** Is this a draft PR? */ draft: z.ZodBoolean; /** Is the PR mergeable? */ mergeable: z.ZodBoolean; /** Merge state status (CLEAN, UNSTABLE, BLOCKED, etc.) */ merge_state_status: z.ZodEnum<["BEHIND", "BLOCKED", "CLEAN", "DIRTY", "DRAFT", "HAS_HOOKS", "UNKNOWN", "UNSTABLE"]>; /** PR labels */ labels: z.ZodArray; /** Issues linked to this PR (via closing keywords) */ linked_issues: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }, { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }>; /** * GitHub Actions Check Schema * * Check run from GitHub Actions workflow. * Includes run_id for drilling down with `gh run view`. * May include job_id for matrix strategy jobs (required for per-job log extraction). * May include extraction (from matrix or non-matrix mode). */ export declare const GitHubActionCheckSchema: z.ZodObject<{ /** Check name */ name: z.ZodString; /** Check status (queued, in_progress, completed) */ status: z.ZodEnum<["queued", "in_progress", "completed"]>; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** GitHub run ID for this check */ run_id: z.ZodNumber; /** * GitHub job ID for this check (optional) * * Present for matrix strategy jobs. Used to fetch job-specific logs via: * `gh run view --log --job ` * * Without job_id, `gh run view --log` returns combined logs from ALL jobs, * which makes error extraction unreliable for matrix runs. */ job_id: z.ZodOptional; /** Workflow name */ workflow: z.ZodString; /** When the check started (ISO 8601) */ started_at: z.ZodString; /** Human-readable duration (e.g., "2m15s") */ duration: z.ZodString; /** Local path to cached log file (if cached) */ log_file: z.ZodOptional; /** * Extraction result (CRITICAL: NEW FEATURE) * * Errors extracted from check logs using one of two modes: * - Matrix mode: Parsed from validate YAML output, passed through faithfully * - Non-matrix mode: Extracted from raw test output using extractors * * Both modes produce ErrorExtractorResult schema (from @vibe-validate/extractors) */ extraction: z.ZodOptional; line: z.ZodOptional; column: z.ZodOptional; message: z.ZodString; code: z.ZodOptional; severity: z.ZodOptional>; context: z.ZodOptional; guidance: z.ZodOptional; }, "strip", z.ZodTypeAny, { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }, { message: string; file?: string | undefined; line?: number | undefined; column? /** Total number of workflow runs for this PR branch */: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }>, "many">; guidance: z.ZodOptional; errorSummary: z.ZodOptional; metadata: z.ZodOptional; reason: z.ZodString; }, "strip", z.ZodTypeAny, { extractor: string; confidence: number; patterns: string[]; reason: string; }, { extractor: string; confidence: number; patterns: string[]; reason: string; }>>; confidence: z.ZodNumber; completeness: z.ZodNumber; issues: z.ZodArray; suggestions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }>>; }, "strip", z.ZodTypeAny, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }>; /** * External Check Details Schema * * Details extracted from external checks (codecov, SonarCloud, etc.) */ export declare const ExternalCheckDetailsSchema: z.ZodObject<{ /** Human-readable summary of the check result */ summary: z.ZodString; /** Additional details (provider-specific) */ details: z.ZodOptional>; /** Severity level */ severity: z.ZodOptional>; }, "strip", z.ZodTypeAny, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }>; /** * External Check Schema * * Status check from external provider (codecov, SonarCloud, etc.) * These don't have GitHub run IDs, only detailsUrl. */ export declare const ExternalCheckSchema: z.ZodObject<{ /** Check name (e.g., "codecov/patch", "SonarCloud Code Analysis") */ name: z.ZodString; /** Check status */ status: z.ZodEnum<["queued", "in_progress", "completed"]>; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** URL to view check details on external provider */ url: z.ZodString; /** Provider name (e.g., "codecov", "sonarcloud") */ provider: z.ZodOptional; /** Extracted details (if extraction succeeded) */ extracted: z.ZodNullable>; /** Severity level */ severity: z.ZodOptional>; }, "strip", z.ZodTypeAny, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }>>>; /** Error message if extraction failed */ extraction_error: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }>; /** * Check History Summary Schema * * Condensed history for pattern recognition (~75 tokens) * Provides recent pattern and success rate without full history details. */ export declare const CheckHistorySummarySchema: z.ZodObject<{ /** Total number of workflow runs for this PR branch */ total_runs: z.ZodNumber; /** Recent pattern description (e.g., "Passed last 2 runs", "Failed last 3 runs") */ recent_pattern: z.ZodString; /** Success rate percentage (e.g., "75%") based on last 10 runs */ success_rate: z.ZodOptional; }, "strip", z.ZodTypeAny, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }>; /** * Checks Summary Schema * * Complete check results with history context. * Ordered by newspaper philosophy: failed checks before passed checks. */ export declare const ChecksSummarySchema: z.ZodObject<{ /** Total number of checks */ total: z.ZodNumber; /** Number of passed checks */ passed: z.ZodNumber; /** Number of failed checks */ failed: z.ZodNumber; /** Number of pending checks */ pending: z.ZodNumber; /** Condensed history for pattern recognition (cheap tokens, high value) */ history_summary: z.ZodOptional; }, "strip", z.ZodTypeAny, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }>>; /** GitHub Actions checks (with run_id and optional extraction) */ github_actions: z.ZodArray; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** GitHub run ID for this check */ run_id: z.ZodNumber; /** * GitHub job ID for this check (optional) * * Present for matrix strategy jobs. Used to fetch job-specific logs via: * `gh run view --log --job ` * * Without job_id, `gh run view --log` returns combined logs from ALL jobs, * which makes error extraction unreliable for matrix runs. */ job_id: z.ZodOptional; /** Workflow name */ workflow: z.ZodString; /** When the check started (ISO 8601) */ started_at: z.ZodString; /** Human-readable duration (e.g., "2m15s") */ duration: z.ZodString; /** Local path to cached log file (if cached) */ log_file: z.ZodOptional; /** * Extraction result (CRITICAL: NEW FEATURE) * * Errors extracted from check logs using one of two modes: * - Matrix mode: Parsed from validate YAML output, passed through faithfully * - Non-matrix mode: Extracted from raw test output using extractors * * Both modes produce ErrorExtractorResult schema (from @vibe-validate/extractors) */ extraction: z.ZodOptional; line: z.ZodOptional; column: z.ZodOptional; message: z.ZodString; code: z.ZodOptional; severity: z.ZodOptional>; context: z.ZodOptional; guidance: z.ZodOptional; }, "strip", z.ZodTypeAny, { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }, { message: string; file?: string | undefined; line?: number | undefined; column? /** Total number of workflow runs for this PR branch */: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }>, "many">; guidance: z.ZodOptional; errorSummary: z.ZodOptional; metadata: z.ZodOptional; reason: z.ZodString; }, "strip", z.ZodTypeAny, { extractor: string; confidence: number; patterns: string[]; reason: string; }, { extractor: string; confidence: number; patterns: string[]; reason: string; }>>; confidence: z.ZodNumber; completeness: z.ZodNumber; issues: z.ZodArray; suggestions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }>>; }, "strip", z.ZodTypeAny, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }>, "many">; /** External checks (with detailsUrl and optional extraction) */ external_checks: z.ZodArray; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** URL to view check details on external provider */ url: z.ZodString; /** Provider name (e.g., "codecov", "sonarcloud") */ provider: z.ZodOptional; /** Extracted details (if extraction succeeded) */ extracted: z.ZodNullable>; /** Severity level */ severity: z.ZodOptional>; }, "strip", z.ZodTypeAny, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }>>>; /** Error message if extraction failed */ extraction_error: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }, { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }>; /** * File Change Schema * * Git diff statistics for a single file */ export declare const FileChangeSchema: z.ZodObject<{ /** File path */ file: z.ZodString; /** Number of lines inserted */ insertions: z.ZodNumber; /** Number of lines deleted */ deletions: z.ZodNumber; /** Is this a new file? */ new_file: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }>; /** * Changes Context Schema * * File change statistics for the PR * Helps understand scope and potential impact areas. */ export declare const ChangesContextSchema: z.ZodObject<{ /** Total number of files changed */ files_changed: z.ZodNumber; /** Total lines inserted across all files */ insertions: z.ZodNumber; /** Total lines deleted across all files */ deletions: z.ZodNumber; /** Number of commits in the PR */ commits: z.ZodNumber; /** Top files by lines changed (limited to 10 for token efficiency) */ top_files: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; }, { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; }>; /** * Next Step Schema * * Actionable next step with severity and context */ export declare const NextStepSchema: z.ZodObject<{ /** Action description */ action: z.ZodString; /** URL to perform the action (if applicable) */ url: z.ZodOptional; /** Severity level (prioritization) */ severity: z.ZodEnum<["error", "warning", "info"]>; /** Reason or context for this action */ reason: z.ZodOptional; }, "strip", z.ZodTypeAny, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }>; /** * Guidance Schema * * Intelligent guidance based on check results. * Provides context-aware next steps with severity-based prioritization. */ export declare const GuidanceSchema: z.ZodObject<{ /** Overall status (passed, failed, pending) */ status: z.ZodEnum<["passed", "failed", "pending"]>; /** Does this failure block merging? */ blocking: z.ZodBoolean; /** Overall severity */ severity: z.ZodEnum<["error", "warning", "info"]>; /** Human-readable summary */ summary: z.ZodString; /** Prioritized list of next steps */ next_steps: z.ZodOptional; /** Severity level (prioritization) */ severity: z.ZodEnum<["error", "warning", "info"]>; /** Reason or context for this action */ reason: z.ZodOptional; }, "strip", z.ZodTypeAny, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; }, { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; }>; /** * Cache Info Schema * * Metadata about the local cache */ export declare const CacheInfoSchema: z.ZodObject<{ /** Cache directory location */ location: z.ZodString; /** When the cache was created (ISO 8601) */ cached_at: z.ZodString; /** When the cache expires (ISO 8601) */ expires_at: z.ZodString; }, "strip", z.ZodTypeAny, { location: string; cached_at: string; expires_at: string; }, { location: string; cached_at: string; expires_at: string; }>; /** * Watch PR Result Schema * * Complete result structure from watch-pr command. * * Field ordering follows "Newspaper Philosophy": * 1. PR context & status (always needed) * 2. Check summary + history (quick overview) * 3. Failed checks FIRST (most actionable) * 4. Passed checks (confirmation) * 5. Guidance (what to do next) * 6. Changes (context) * 7. Cache (metadata, least important) * * If output is truncated, LLM still sees critical details. */ export declare const WatchPRResultSchema: z.ZodObject<{ /** PR metadata (number, title, branch, mergeable, labels, linked issues) */ pr: z.ZodObject<{ /** PR number */ number: z.ZodNumber; /** PR title */ title: z.ZodString; /** PR URL */ url: z.ZodString; /** Head branch name */ branch: z.ZodString; /** Base branch name (usually 'main' or 'develop') */ base_branch: z.ZodString; /** PR author username */ author: z.ZodString; /** Is this a draft PR? */ draft: z.ZodBoolean; /** Is the PR mergeable? */ mergeable: z.ZodBoolean; /** Merge state status (CLEAN, UNSTABLE, BLOCKED, etc.) */ merge_state_status: z.ZodEnum<["BEHIND", "BLOCKED", "CLEAN", "DIRTY", "DRAFT", "HAS_HOOKS", "UNKNOWN", "UNSTABLE"]>; /** PR labels */ labels: z.ZodArray; /** Issues linked to this PR (via closing keywords) */ linked_issues: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }, { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }>; /** Overall status (passed, failed, pending) */ status: z.ZodEnum<["passed", "failed", "pending"]>; /** Check results with history context */ checks: z.ZodObject<{ /** Total number of checks */ total: z.ZodNumber; /** Number of passed checks */ passed: z.ZodNumber; /** Number of failed checks */ failed: z.ZodNumber; /** Number of pending checks */ pending: z.ZodNumber; /** Condensed history for pattern recognition (cheap tokens, high value) */ history_summary: z.ZodOptional; }, "strip", z.ZodTypeAny, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }, { total_runs: number; recent_pattern: string; success_rate?: string | undefined; }>>; /** GitHub Actions checks (with run_id and optional extraction) */ github_actions: z.ZodArray; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** GitHub run ID for this check */ run_id: z.ZodNumber; /** * GitHub job ID for this check (optional) * * Present for matrix strategy jobs. Used to fetch job-specific logs via: * `gh run view --log --job ` * * Without job_id, `gh run view --log` returns combined logs from ALL jobs, * which makes error extraction unreliable for matrix runs. */ job_id: z.ZodOptional; /** Workflow name */ workflow: z.ZodString; /** When the check started (ISO 8601) */ started_at: z.ZodString; /** Human-readable duration (e.g., "2m15s") */ duration: z.ZodString; /** Local path to cached log file (if cached) */ log_file: z.ZodOptional; /** * Extraction result (CRITICAL: NEW FEATURE) * * Errors extracted from check logs using one of two modes: * - Matrix mode: Parsed from validate YAML output, passed through faithfully * - Non-matrix mode: Extracted from raw test output using extractors * * Both modes produce ErrorExtractorResult schema (from @vibe-validate/extractors) */ extraction: z.ZodOptional; line: z.ZodOptional; column: z.ZodOptional; message: z.ZodString; code: z.ZodOptional; severity: z.ZodOptional>; context: z.ZodOptional; guidance: z.ZodOptional; }, "strip", z.ZodTypeAny, { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }, { message: string; file?: string | undefined; line?: number | undefined; column? /** Total number of workflow runs for this PR branch */: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }>, "many">; guidance: z.ZodOptional; errorSummary: z.ZodOptional; metadata: z.ZodOptional; reason: z.ZodString; }, "strip", z.ZodTypeAny, { extractor: string; confidence: number; patterns: string[]; reason: string; }, { extractor: string; confidence: number; patterns: string[]; reason: string; }>>; confidence: z.ZodNumber; completeness: z.ZodNumber; issues: z.ZodArray; suggestions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }, { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }, { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; }>>; }, "strip", z.ZodTypeAny, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }, { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }>, "many">; /** External checks (with detailsUrl and optional extraction) */ external_checks: z.ZodArray; /** Check conclusion (present when completed) */ conclusion: z.ZodOptional>; /** URL to view check details on external provider */ url: z.ZodString; /** Provider name (e.g., "codecov", "sonarcloud") */ provider: z.ZodOptional; /** Extracted details (if extraction succeeded) */ extracted: z.ZodNullable>; /** Severity level */ severity: z.ZodOptional>; }, "strip", z.ZodTypeAny, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }, { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; }>>>; /** Error message if extraction failed */ extraction_error: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }, { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }, { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }>; /** File change context (optional, helps understand scope) */ changes: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }, { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; }, { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; }>>; /** Intelligent guidance with next steps (optional) */ guidance: z.ZodOptional; /** Does this failure block merging? */ blocking: z.ZodBoolean; /** Overall severity */ severity: z.ZodEnum<["error", "warning", "info"]>; /** Human-readable summary */ summary: z.ZodString; /** Prioritized list of next steps */ next_steps: z.ZodOptional; /** Severity level (prioritization) */ severity: z.ZodEnum<["error", "warning", "info"]>; /** Reason or context for this action */ reason: z.ZodOptional; }, "strip", z.ZodTypeAny, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }, { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; }, { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; }>>; /** Cache metadata (optional) */ cache: z.ZodOptional>; }, "strip", z.ZodTypeAny, { checks: { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context?: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }; status: "passed" | "failed" | "pending"; pr: { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }; cache?: { location: string; cached_at: string; expires_at: string; } | undefined; changes?: { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; } | undefined; guidance?: { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; } | undefined; }, { checks: { passed: number; failed: number; total: number; pending: number; github_actions: { name: string; workflow: string; status: "queued" | "in_progress" | "completed"; run_id: number; started_at: string; duration: string; extraction?: { summary: string; totalErrors: number; errors: { message: string; file?: string | undefined; line?: number | undefined; column?: number | undefined; code?: string | undefined; severity?: "error" | "warning" | undefined; context /** Cache directory location */ ? /** Cache directory location */: string | undefined; guidance?: string | undefined; }[]; guidance?: string | undefined; errorSummary?: string | undefined; metadata?: { issues: string[]; confidence: number; completeness: number; detection?: { extractor: string; confidence: number; patterns: string[]; reason: string; } | undefined; suggestions?: string[] | undefined; } | undefined; } | undefined; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; job_id?: number | undefined; log_file?: string | undefined; }[]; external_checks: { name: string; status: "queued" | "in_progress" | "completed"; url: string; conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined; provider?: string | undefined; extracted?: { summary: string; details?: Record | undefined; severity?: "error" | "warning" | "info" | undefined; } | null | undefined; extraction_error?: string | undefined; }[]; history_summary?: { total_runs: number; recent_pattern: string; success_rate?: string | undefined; } | undefined; }; status: "passed" | "failed" | "pending"; pr: { number: number; author: string; title: string; url: string; branch: string; base_branch: string; draft: boolean; mergeable: boolean; merge_state_status: "BEHIND" | "BLOCKED" | "CLEAN" | "DIRTY" | "DRAFT" | "HAS_HOOKS" | "UNKNOWN" | "UNSTABLE"; labels: string[]; linked_issues?: { number: number; title: string; url: string; }[] | undefined; }; cache?: { location: string; cached_at: string; expires_at: string; } | undefined; changes?: { insertions: number; deletions: number; files_changed: number; commits: number; top_files?: { file: string; insertions: number; deletions: number; new_file?: boolean | undefined; }[] | undefined; } | undefined; guidance?: { summary: string; status: "passed" | "failed" | "pending"; severity: "error" | "warning" | "info"; blocking: boolean; next_steps?: { severity: "error" | "warning" | "info"; action: string; url?: string | undefined; reason?: string | undefined; }[] | undefined; } | undefined; }>; export type CheckStatus = z.infer; export type CheckConclusion = z.infer; export type MergeStateStatus = z.infer; export type Severity = z.infer; export type LinkedIssue = z.infer; /** PR overall status type */ export type PRStatus = 'passed' | 'failed' | 'pending'; export type PRMetadata = z.infer; export type GitHubActionCheck = z.infer; export type ExternalCheckDetails = z.infer; export type ExternalCheck = z.infer; export type CheckHistorySummary = z.infer; export type ChecksSummary = z.infer; export type FileChange = z.infer; export type ChangesContext = z.infer; export type NextStep = z.infer; export type Guidance = z.infer; export type CacheInfo = z.infer; export type WatchPRResult = z.infer; //# sourceMappingURL=watch-pr-result.schema.d.ts.map