import { RawContextKey } from "../../../../platform/contextkey/common/contextkey.js"; import { IChatWidget } from "../../../../workbench/contrib/chat/browser/chat.js"; import { GitHubPullRequestCIModel } from "../../github/browser/models/githubPullRequestCIModel.js"; import { IGitHubCICheck } from "../../github/common/types.js"; import { PullRequestCheck } from "../../../../platform/github/common/githubPullRequestService.js"; import { RequiredPullRequestChecks } from "../../../../platform/github/common/pullRequestRequiredChecks.js"; export declare const hasActiveSessionFailedCIChecks: RawContextKey; /** * True when the user has already requested a CI fix for the active session's * current PR head commit. Used to hide the "Fix Checks" action until a new * commit lands on the PR. */ export declare const activeSessionCIFixRequested: RawContextKey; /** Command that sends the `fix-ci` prompt for the active session's failed checks. */ export declare const FIX_CI_CHECKS_COMMAND_ID = "sessions.action.fixCIChecks"; /** Command that opens the Changes view and reveals (expands + focuses) the CI checks section. */ export declare const REVEAL_CI_CHECKS_COMMAND_ID = "sessions.action.revealCIChecks"; export declare enum CICheckGroup { Running = 0, Pending = 1, Failed = 2, Successful = 3 } /** Groups a check run by how it stands (see {@link getPullRequestCheckState}), telling running checks from queued ones. */ export declare function getCheckGroup(check: IGitHubCICheck): CICheckGroup; /** * Counts the checks that count (see {@link GitHubPullRequestCIModel.requiredChecks}): * those that failed, those that finished, and those yet to finish, including * required checks that have not reported yet. */ export declare function countRequiredChecks(required: RequiredPullRequestChecks): { readonly failed: number; readonly completed: number; readonly pending: number; }; export declare function getCheckStateLabel(check: IGitHubCICheck): string; /** Builds the GitHub pull request URL for a CI model's coordinates. */ export declare function getPullRequestUrl(coords: { owner: string; repo: string; prNumber: number; }): string; export declare function buildFixChecksPrompt(failedChecks: ReadonlyArray<{ check: PullRequestCheck; annotations: string; }>, prUrl?: string, query?: string): string; /** * Builds the `fix-ci` prompt for the failed checks that count (see * {@link GitHubPullRequestCIModel.requiredChecks}): fetches the annotations of * each failed check run and assembles the prompt text. Returns `undefined` when * no check that counts failed, including while that is still loading. Shared by * the widget-based active-session action and the blocked-sessions list's * background fix. */ export declare function buildFixCIPrompt(ciModel: GitHubPullRequestCIModel, query?: string): Promise; /** * Submits the `fix-ci` prompt for a session's failing CI checks: builds the * prompt, sends it to the given chat widget, and marks the fix as requested so * the "Fix Checks" affordances hide until a new commit lands. Used by the * active-session action; the blocked-sessions list sends in the background via * {@link buildFixCIPrompt} instead. */ export declare function submitFixCIChecks(ciModel: GitHubPullRequestCIModel, chatWidget: IChatWidget, query?: string): Promise;