//#region src/workflow/workspaces/worktree.d.ts /** * A provisioned repository worktree and the commit it was cut from. * * @group Runtime and resources */ interface Worktree { /** The named repository binding in the factory configuration. */ binding: string; /** The binding's GitHub installation, as named on the hub, that reaches its repository. */ installationName: string; path: string; branch: string; defaultBranch: string; baseSha: string; } /** * A worktree checked out at a pull request's head commit, with no branch of its own. * * @remarks * It is for checking the pull request as it stands, so it cannot be pushed. Pass `headSha` to * `mergePullRequest` to merge exactly the commit that was checked. Commits made in it are not * kept when the run's resources are released. * * @group Runtime and resources */ interface PullRequestWorktree { /** The named repository binding in the factory configuration. */ binding: string; /** The binding's GitHub installation, as named on the hub, that reaches its repository. */ installationName: string; path: string; /** The pull request's head commit, which the worktree is checked out at. */ headSha: string; } //#endregion //#region src/workflow/git/committed-work.d.ts /** What the factory's `readBranchState` step reports about a worktree's branch. */ interface BranchState { /** The number of commits reachable from HEAD but not the base commit. */ commits: number; /** The current HEAD commit SHA. */ headSha: string; /** Whether the worktree has uncommitted changes or its status could not be read. */ dirty: boolean; } /** The factory's `readBranchState` step: the branch state, counting commits since `baseSha`. */ type ReadBranchState = (worktree: Worktree, baseSha?: string) => Promise; /** Where `committedWork` counts commits from. */ interface CommittedWorkOptions { /** A commit SHA to count new commits from. Defaults to the worktree's base commit. */ since?: string | undefined; } /** * Durable steps the Git routines run. * * @group Factory plumbing */ interface GitSteps { readBranchState: ReadBranchState; } /** * Connect the Git routines to the factory's durable steps. * * @group Factory plumbing */ declare function bindGitSteps(steps: GitSteps): { committedWork: (worktree: Worktree, options?: CommittedWorkOptions) => Promise; }; //#endregion //#region src/steps/git/branch.d.ts /** * Inspect branch readiness, counting commits since the worktree's base unless overridden. * * @group Inspect changes */ declare function readBranchState(worktree: Worktree, baseSha?: string): Promise; /** * Push the worktree's current HEAD and register a GitHub branch resource when applicable. * * @group Publish changes */ declare function pushBranch(worktree: Worktree): Promise<{ /** The worktree's HEAD commit after the push succeeds. */ headSha: string; }>; /** * Push a reviewed commit only while it is still HEAD and the worktree is clean. * * Safe to retry after a successful push. Rejects if HEAD moved or any uncommitted change exists. * * @group Publish changes */ declare function pushApprovedChange(worktree: Worktree, approvedCommit: string): Promise<{ /** The approved commit SHA that was pushed. */ headSha: string; }>; /** * Read a raw patch from the merge base of `baseSha` and HEAD, truncating after 200,000 characters. * Defaults to the worktree's base commit. * * @group Inspect changes */ declare function readWorktreeDiff(worktree: Worktree, baseSha?: string): Promise; //#endregion //#region src/workflow/git/change.d.ts /** * How a file differs between the base and head trees. * * @group Git/change data */ type ChangeStatus = "added" | "modified" | "deleted" | "renamed" | "other"; /** * One file changed between the base and head trees. * * @group Git/change data */ interface FileChange { /** The changed path. Renames use the path in the head tree. */ path: string; /** How the path differs between the two trees. */ status: ChangeStatus; /** The number of added lines, or zero for a binary file. */ additions: number; /** The number of deleted lines, or zero for a binary file. */ deletions: number; } /** * A bounded description of the committed changes between two Git refs. * * @group Git/change data */ interface ChangeSummary { /** The resolved base commit. */ base: string; /** The resolved head commit. */ head: string; /** Files that differ directly between the base and head trees. */ files: FileChange[]; /** Commits reachable from head but not base, newest first. */ commits: { /** The full commit SHA. */ sha: string; /** The first line of the commit message. */ subject: string; /** The author name recorded by Git, without mailmap rewriting. */ authorName: string; }[]; /** Whether file or commit limits caused results to be omitted. */ truncated: boolean; } /** * Patches for selected paths between two resolved commits. * * @group Git/change data */ interface ChangePatch { /** Patch text for each selected path, in first-requested order. */ patches: { /** The literal path that was selected. */ path: string; /** The Git patch for this path, which may be empty or truncated. */ text: string; }[]; /** Whether the shared text limit cut off any patch text. */ truncated: boolean; } /** * Render a Markdown review summary with commits, totals and up to 60 changed-file rows. * * @group Git/change data */ declare function renderChangeSummary(summary: ChangeSummary): string; //#endregion export { renderChangeSummary as a, readBranchState as c, CommittedWorkOptions as d, GitSteps as f, Worktree as g, PullRequestWorktree as h, FileChange as i, readWorktreeDiff as l, bindGitSteps as m, ChangeStatus as n, pushApprovedChange as o, ReadBranchState as p, ChangeSummary as r, pushBranch as s, ChangePatch as t, BranchState as u };