import { z } from 'zod'; /** * One issue or pull request, flattened for the cockpit (`ForgeItem` server-side). * A protected shape — BACKWARD_COMPATIBILITY.md §2 forbids reshaping it. */ export declare const githubItemSchema: z.ZodObject<{ kind: z.ZodEnum<{ issue: "issue"; pr: "pr"; }>; number: z.ZodNumber; title: z.ZodString; author: z.ZodString; createdAt: z.ZodString; labels: z.ZodArray; body: z.ZodString; url: z.ZodString; comments: z.ZodNumber; isDraft: z.ZodOptional; additions: z.ZodOptional; deletions: z.ZodOptional; checks: z.ZodOptional>>; }, z.core.$strip>; export type GithubItem = z.infer; /** * `GET /api/v1/github` — the tab's issue + PR lists. * * NOT a discriminated union, unlike its siblings: `fetchGithub` always answers the full record and * merely flips `available`, so an unavailable payload still carries `issues: []` / `prs: []`. */ export declare const githubDataSchema: z.ZodObject<{ available: z.ZodBoolean; reason: z.ZodOptional; repo: z.ZodOptional; syncedAt: z.ZodOptional; issues: z.ZodArray; number: z.ZodNumber; title: z.ZodString; author: z.ZodString; createdAt: z.ZodString; labels: z.ZodArray; body: z.ZodString; url: z.ZodString; comments: z.ZodNumber; isDraft: z.ZodOptional; additions: z.ZodOptional; deletions: z.ZodOptional; checks: z.ZodOptional>>; }, z.core.$strip>>; prs: z.ZodArray; number: z.ZodNumber; title: z.ZodString; author: z.ZodString; createdAt: z.ZodString; labels: z.ZodArray; body: z.ZodString; url: z.ZodString; comments: z.ZodNumber; isDraft: z.ZodOptional; additions: z.ZodOptional; deletions: z.ZodOptional; checks: z.ZodOptional>>; }, z.core.$strip>>; labelColors: z.ZodOptional>; }, z.core.$strip>; export type GithubData = z.infer; /** * `GET /api/v1/github/checks?prs=…` (#664) — lazy PR checks glyphs, `number → glyph`. The list * call no longer ships `statusCheckRollup`, so a row's glyph is hydrated here for the on-screen * rows only. An absent number means "no checks / not found". */ export declare const githubChecksDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ available: z.ZodLiteral; checks: z.ZodRecord>>; }, z.core.$strip>, z.ZodObject<{ available: z.ZodLiteral; reason: z.ZodString; }, z.core.$strip>], "available">; export type GithubChecksData = z.infer; /** * Where a referenced PR or issue STANDS — the vocabulary a task's tracker chip paints. * * One flat enum rather than a per-kind union, because the chip renders one status and a union * would make every consumer narrow on `kind` before it could pick a color. The kinds share no * value on purpose: a closed PR (abandoned — red) and a closed issue (`completed` — done, violet) * are opposite outcomes wearing the same English word, and collapsing them is how a merged-looking * task turns out to have been dropped. * * PR values: `merged`, `closed` (closed WITHOUT merging), `draft`, `checks-pending`, * `changes-requested`, `checks-failing`, `review-required`, `ready`. Issue values: `open`, * `completed`, `not-planned`. * * Which one a PR gets is `derivePrReferenceStatus`'s ranking (server-side, and documented there): * it answers "what is this waiting on right now", so it ranks by how FRESH a signal is rather * than by how heavy a blocker it is — running checks mean a commit was just pushed, and a * requested change the author has already pushed past is not what the PR is waiting on. * * `ready` is the honest reading of "nothing is blocking it here": open, not a draft, no failing or * running checks, and no review the forge is still waiting on. It is NOT a mergeability probe — * that is `githubPrMergeStateResponseSchema`, which costs a request per PR; this is one batched * query for a whole table. */ export declare const referenceStatusSchema: z.ZodEnum<{ "changes-requested": "changes-requested"; "checks-failing": "checks-failing"; "checks-pending": "checks-pending"; closed: "closed"; completed: "completed"; draft: "draft"; merged: "merged"; "not-planned": "not-planned"; open: "open"; ready: "ready"; "review-required": "review-required"; }>; export type ReferenceStatus = z.infer; /** * `GET /api/v1/github/ref-status?prs=…&issues=…` — batched status for the PR/issue chips a task * table is painting. The additive sibling of `/github/checks`: same cache-behind-the-route shape, * same in-payload degrade, same "absent number = nothing known" rule (an unknown or unreachable * number is simply missing from the map, and its chip stays neutral). */ /** * How many numbers of ONE kind a single `/github/ref-status` request may name — the route 400s * past it, and the cockpit caps its batches to match. * * It lives in the contract because it is one: a client that believed a larger number would send * requests the server rejects outright, costing every chip in the batch its status rather than * just the tail. Two constants that must agree, in two packages, with nothing making them, is the * drift this export exists to prevent. */ export declare const REFERENCE_STATUS_MAX = 100; export declare const githubRefStatusDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ available: z.ZodLiteral; prs: z.ZodRecord>; issues: z.ZodRecord>; recheckAfterMs: z.ZodNullable; }, z.core.$strip>, z.ZodObject<{ available: z.ZodLiteral; reason: z.ZodString; recheckAfterMs: z.ZodNullable; }, z.core.$strip>], "available">; export type GithubRefStatusData = z.infer; /** One comment or PR review summary in an issue/PR thread (#499). */ export declare const githubCommentSchema: z.ZodObject<{ id: z.ZodNumber; author: z.ZodString; avatarUrl: z.ZodOptional; createdAt: z.ZodString; body: z.ZodString; kind: z.ZodEnum<{ comment: "comment"; review: "review"; }>; reviewState: z.ZodOptional>; url: z.ZodString; }, z.core.$strip>; export type GithubComment = z.infer; /** * The timeline event kinds the thread renders (#525) — an allowlist, so an unknown GitHub event * type is dropped server-side rather than reaching the client. */ export declare const githubTimelineEventKindSchema: z.ZodEnum<{ assigned: "assigned"; closed: "closed"; committed: "committed"; "cross-referenced": "cross-referenced"; head_ref_force_pushed: "head_ref_force_pushed"; labeled: "labeled"; merged: "merged"; renamed: "renamed"; reopened: "reopened"; unassigned: "unassigned"; unlabeled: "unlabeled"; }>; export type GithubTimelineEventKind = z.infer; /** * One non-comment timeline row (#525). Deliberately a separate shape from `GithubComment` rather * than a widened `kind`, which would break the client's narrowing. */ export declare const githubTimelineEventSchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<{ assigned: "assigned"; closed: "closed"; committed: "committed"; "cross-referenced": "cross-referenced"; head_ref_force_pushed: "head_ref_force_pushed"; labeled: "labeled"; merged: "merged"; renamed: "renamed"; reopened: "reopened"; unassigned: "unassigned"; unlabeled: "unlabeled"; }>; actor: z.ZodString; avatarUrl: z.ZodOptional; createdAt: z.ZodString; url: z.ZodOptional; sha: z.ZodOptional; message: z.ZodOptional; checks: z.ZodOptional>>; label: z.ZodOptional; }, z.core.$strip>>; subject: z.ZodOptional; refNumber: z.ZodOptional; refTitle: z.ZodOptional; refIsPr: z.ZodOptional; }, z.core.$strip>; export type GithubTimelineEvent = z.infer; /** * `GET /api/v1/github/comments/:kind/:number` — the full thread. Degrades to * `{ available: false, reason }` like the list fetch, never an error. */ export declare const githubCommentsDataSchema: z.ZodObject<{ available: z.ZodBoolean; reason: z.ZodOptional; comments: z.ZodArray; createdAt: z.ZodString; body: z.ZodString; kind: z.ZodEnum<{ comment: "comment"; review: "review"; }>; reviewState: z.ZodOptional>; url: z.ZodString; }, z.core.$strip>>; truncated: z.ZodOptional; events: z.ZodOptional; actor: z.ZodString; avatarUrl: z.ZodOptional; createdAt: z.ZodString; url: z.ZodOptional; sha: z.ZodOptional; message: z.ZodOptional; checks: z.ZodOptional>>; label: z.ZodOptional; }, z.core.$strip>>; subject: z.ZodOptional; refNumber: z.ZodOptional; refTitle: z.ZodOptional; refIsPr: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type GithubCommentsData = z.infer; export declare const githubMergeMethodSchema: z.ZodEnum<{ merge: "merge"; rebase: "rebase"; squash: "squash"; }>; export type GithubMergeMethod = z.infer; /** One check row of the merge panel. */ export declare const githubPrCheckSchema: z.ZodObject<{ name: z.ZodString; state: z.ZodEnum<{ failing: "failing"; passing: "passing"; pending: "pending"; unknown: "unknown"; }>; required: z.ZodNullable; url: z.ZodOptional; }, z.core.$strip>; export type GithubPrCheck = z.infer; /** Everything the merge panel needs about one PR. */ export declare const githubPrMergeStateSchema: z.ZodObject<{ number: z.ZodNumber; title: z.ZodString; url: z.ZodString; state: z.ZodEnum<{ closed: "closed"; merged: "merged"; open: "open"; }>; isDraft: z.ZodBoolean; headRef: z.ZodString; baseRef: z.ZodString; headSha: z.ZodString; mergeable: z.ZodEnum<{ conflicting: "conflicting"; mergeable: "mergeable"; unknown: "unknown"; }>; reviewDecision: z.ZodEnum<{ approved: "approved"; "changes-requested": "changes-requested"; "review-required": "review-required"; unknown: "unknown"; }>; checks: z.ZodArray; required: z.ZodNullable; url: z.ZodOptional; }, z.core.$strip>>; methods: z.ZodArray>; defaultMethod: z.ZodNullable>; eligibility: z.ZodEnum<{ blocked: "blocked"; pending: "pending"; ready: "ready"; terminal: "terminal"; unauthorized: "unauthorized"; unknown: "unknown"; }>; blockers: z.ZodArray>; canMerge: z.ZodBoolean; canOverride: z.ZodBoolean; }, z.core.$strip>; export type GithubPrMergeState = z.infer; /** `GET /api/v1/github/prs/:number/merge-state` — 200 either way; the reason is the degrade. */ export declare const githubPrMergeStateResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ available: z.ZodLiteral; mergeState: z.ZodObject<{ number: z.ZodNumber; title: z.ZodString; url: z.ZodString; state: z.ZodEnum<{ closed: "closed"; merged: "merged"; open: "open"; }>; isDraft: z.ZodBoolean; headRef: z.ZodString; baseRef: z.ZodString; headSha: z.ZodString; mergeable: z.ZodEnum<{ conflicting: "conflicting"; mergeable: "mergeable"; unknown: "unknown"; }>; reviewDecision: z.ZodEnum<{ approved: "approved"; "changes-requested": "changes-requested"; "review-required": "review-required"; unknown: "unknown"; }>; checks: z.ZodArray; required: z.ZodNullable; url: z.ZodOptional; }, z.core.$strip>>; methods: z.ZodArray>; defaultMethod: z.ZodNullable>; eligibility: z.ZodEnum<{ blocked: "blocked"; pending: "pending"; ready: "ready"; terminal: "terminal"; unauthorized: "unauthorized"; unknown: "unknown"; }>; blockers: z.ZodArray>; canMerge: z.ZodBoolean; canOverride: z.ZodBoolean; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ available: z.ZodLiteral; reason: z.ZodString; }, z.core.$strip>], "available">; export type GithubPrMergeStateResponse = z.infer; /** * `POST /api/v1/github/prs/:number/merge` — the 200 branch only. Every refusal (403/404/409/502) * is an `ApiError`, so `merged` is pinned to `true` here rather than a boolean to re-check. */ export declare const githubMergeResponseSchema: z.ZodObject<{ merged: z.ZodLiteral; number: z.ZodNumber; url: z.ZodString; method: z.ZodEnum<{ merge: "merge"; rebase: "rebase"; squash: "squash"; }>; mergeCommitSha: z.ZodOptional; }, z.core.$strip>; export type GithubMergeResponse = z.infer; /** One changed file of a pull request's diff. */ export declare const githubPrChangeSchema: z.ZodObject<{ path: z.ZodString; previousPath: z.ZodOptional; status: z.ZodEnum<{ added: "added"; changed: "changed"; copied: "copied"; modified: "modified"; removed: "removed"; renamed: "renamed"; }>; additions: z.ZodNumber; deletions: z.ZodNumber; patch: z.ZodOptional; patchUnavailableReason: z.ZodOptional>; truncated: z.ZodOptional; }, z.core.$strip>; export type GithubPrChange = z.infer; /** `GET /api/v1/github/prs/:number/changes` — bounded, read-only PR file changes. */ export declare const githubPrChangesDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ available: z.ZodLiteral; number: z.ZodNumber; headSha: z.ZodString; files: z.ZodArray; status: z.ZodEnum<{ added: "added"; changed: "changed"; copied: "copied"; modified: "modified"; removed: "removed"; renamed: "renamed"; }>; additions: z.ZodNumber; deletions: z.ZodNumber; patch: z.ZodOptional; patchUnavailableReason: z.ZodOptional>; truncated: z.ZodOptional; }, z.core.$strip>>; additions: z.ZodNumber; deletions: z.ZodNumber; truncated: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ available: z.ZodLiteral; reason: z.ZodString; }, z.core.$strip>], "available">; export type GithubPrChangesData = z.infer;