| 1 | /** One check on the pull request's head commit, as Diffinery reports it. */ |
| 2 | export type CheckState = 'pass' | 'fail' | 'run' | 'wait' | 'skip' |
| 3 | |
| 4 | export type Check = { |
| 5 | name: string |
| 6 | workflow: string | null |
| 7 | state: CheckState |
| 8 | url: string | null |
| 9 | startedAt: string | null |
| 10 | completedAt: string | null |
| 11 | } |
| 12 | |
| 13 | /** What the checks come to: any failure fails, else anything unfinished runs. */ |
| 14 | export type Rollup = 'pass' | 'fail' | 'run' | 'none' |
| 15 | |
| 16 | /** The branch's pull request and its checks. */ |
| 17 | export type Pr = { |
| 18 | host: string |
| 19 | repo: string |
| 20 | branch: string |
| 21 | number: number |
| 22 | title: string |
| 23 | url: string |
| 24 | state: 'OPEN' | 'MERGED' | 'CLOSED' |
| 25 | isDraft: boolean |
| 26 | review: string | null |
| 27 | mergeState: string | null |
| 28 | autoMerge: boolean |
| 29 | sha: string |
| 30 | rollup: Rollup |
| 31 | checks: Check[] |
| 32 | } |
| 33 | |
| 34 | /** Why the band has no pull request to show, when that is worth a word. */ |
| 35 | export type Note = { kind: 'signin' | 'error'; text: string } |
| 36 | |
| 37 | declare module 'claude-code' { |
| 38 | interface PluginState { |
| 39 | 'diffinery-ci': { |
| 40 | pr: Shaped<Pr | null> |
| 41 | note: Shaped<Note | null> |
| 42 | watching: boolean |
| 43 | isHidden: boolean |
| 44 | } |
| 45 | } |
| 46 | } |