/** A GitHub issue, flattened to the fields a triage workflow needs. */ export interface IssueDTO { number: number; title: string; body: string; /** html_url of the issue. */ url: string; /** Existing label names on the issue. */ labels: string[]; /** ISO 8601 creation timestamp. */ createdAt: string; /** Login of the issue author, or null. */ author: string | null; } export interface ListNewIssuesInput { /** "owner/name", e.g. "render-lab/demo". */ repo: string; /** Only issues created/updated at or after this ISO timestamp. */ sinceISO?: string; /** Max issues to return. Default 50. */ limit?: number; } export interface ApplyLabelsInput { /** "owner/name". */ repo: string; issueNumber: number; labels: string[]; } export interface ApplyLabelsResult { issueNumber: number; /** Labels that were requested to be added. */ labels: string[]; } export interface OpenPRInput { /** "owner/name". */ repo: string; title: string; /** Source branch (or "owner:branch" for a fork). */ head: string; /** Target branch, e.g. "main". */ base: string; body?: string; draft?: boolean; } /** A GitHub pull request, flattened to the fields a workflow needs. */ export interface PullRequestDTO { number: number; /** PR title. */ title: string; /** html_url of the PR. */ url: string; state: string; merged: boolean; /** ISO 8601 merge timestamp, or null if the PR is not merged. */ mergedAt: string | null; /** Login of the PR author, or null. */ author: string | null; /** Head branch ref. */ head: string; /** Base branch ref. */ base: string; } /** * An inline review comment. `position` is a position in the PR's unified diff, * not a file line number (for a file added by the PR, position ≈ line index + 1); * `line`/`side` address the file directly and take precedence when GitHub * supports them for the diff. */ export interface ReviewCommentInput { path: string; position?: number; line?: number; side?: "LEFT" | "RIGHT"; body: string; } export interface ReviewPRInput { /** "owner/name". */ repo: string; number: number; event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; body?: string; /** Inline comments to attach to the review. */ comments?: ReviewCommentInput[]; } export interface ReviewResult { number: number; reviewId: number; event: string; } export interface MergeWhenGreenInput { /** "owner/name". */ repo: string; number: number; /** Merge strategy. Default "merge". */ method?: "merge" | "squash" | "rebase"; } /** Result of a merge. Throws-to-retry while checks are pending. */ export interface MergeResult { number: number; merged: boolean; state: string; sha?: string; } export interface DispatchWorkflowInput { /** "owner/name". */ repo: string; /** Workflow file name (e.g. "ci.yml") or numeric id. */ workflowId: string; /** Git ref to run against, e.g. "main". */ ref: string; inputs?: Record; } export interface DispatchResult { workflowId: string; ref: string; dispatched: boolean; } export interface CreateIssueInput { /** "owner/name". */ repo: string; title: string; body?: string; /** Label names to apply on creation. */ labels?: string[]; /** Logins to assign on creation. */ assignees?: string[]; } export interface GetIssueInput { /** "owner/name". */ repo: string; number: number; } export interface CommentOnIssueInput { /** "owner/name". */ repo: string; number: number; body: string; } /** A created issue comment, flattened to JSON-serializable fields. */ export interface CommentResult { /** Numeric comment id. */ id: number; /** html_url of the comment. */ url: string; } export interface UpdateIssueInput { /** "owner/name". */ repo: string; number: number; /** New state, if changing it. */ state?: "open" | "closed"; /** Replacement body, if changing it. */ body?: string; /** Replacement assignee logins, if changing them. */ assignees?: string[]; /** Replacement label set, if changing it. */ labels?: string[]; } export interface GetPRInput { /** "owner/name". */ repo: string; number: number; } /** A pull request, flattened to the review- and analytics-relevant fields a * workflow needs. */ export interface PullRequestDetailDTO { number: number; /** PR title. */ title: string; /** html_url of the PR. */ url: string; state: string; merged: boolean; /** GitHub's mergeability verdict; null while it is still being computed. */ mergeable: boolean | null; draft: boolean; /** Head branch ref. */ head: string; /** Base branch ref. */ base: string; /** Login of the PR author, or null. */ author: string | null; /** ISO 8601 merge timestamp, or null if the PR is not merged. */ mergedAt: string | null; /** Login of the user who merged the PR, or null if not merged. */ mergedBy: string | null; /** Lines added by the PR. */ additions: number; /** Lines deleted by the PR. */ deletions: number; /** Number of issue comments on the PR. */ comments: number; } export interface GetFileContentsInput { /** "owner/name". */ repo: string; /** Path to the file within the repo. */ path: string; /** Git ref (branch, tag, or SHA). Defaults to the repo's default branch. */ ref?: string; } /** A file's contents at a ref, decoded to UTF-8. */ export interface FileContentsDTO { path: string; /** Decoded UTF-8 file contents. */ content: string; /** Blob SHA — pass this back to `commitFile` to update the file. */ sha: string; /** Encoding of `content` (always "utf-8"; the base64 blob is decoded here). */ encoding: string; } export interface CommitFileInput { /** "owner/name". */ repo: string; /** Path to the file within the repo. */ path: string; /** New file contents (UTF-8); base64-encoded before upload. */ content: string; /** Commit message. */ message: string; /** Branch to commit to. Defaults to the repo's default branch. */ branch?: string; /** Blob SHA of the file being replaced. Omit to create, or to let the task * look up the existing file's SHA so an update doesn't 409. */ sha?: string; } /** Result of a create-or-update file commit. */ export interface CommitFileResult { /** SHA of the commit that was created. */ commitSha: string; /** Blob SHA of the written file. */ contentSha: string; path: string; } export type RepositoryVisibility = "public" | "private" | "internal"; export interface RepositoryDTO { id: number; nodeId: string; owner: string; name: string; fullName: string; htmlUrl: string; cloneUrl: string; sshUrl: string; defaultBranch: string; visibility: RepositoryVisibility; isTemplate: boolean; archived: boolean; disabled: boolean; createdAt: string; updatedAt: string; pushedAt: string | null; stars: number; forks: number; isFork: boolean; language: string | null; topics: string[]; openIssues: number; } export interface GetRepositoryInput { owner: string; repo: string; } export interface GetRepositoryResult { repository: RepositoryDTO; } export interface EnsureOrganizationRepositoryInput { org: string; name: string; description?: string; homepage?: string; visibility?: RepositoryVisibility; hasIssues?: boolean; hasProjects?: boolean; hasWiki?: boolean; hasDiscussions?: boolean; isTemplate?: boolean; autoInit?: boolean; gitignoreTemplate?: string; licenseTemplate?: string; } export interface EnsureOrganizationRepositoryResult { repository: RepositoryDTO; created: boolean; } export interface UpdateRepositoryInput { owner: string; repo: string; name?: string; description?: string; homepage?: string; visibility?: RepositoryVisibility; defaultBranch?: string; hasIssues?: boolean; hasProjects?: boolean; hasWiki?: boolean; hasDiscussions?: boolean; isTemplate?: boolean; archived?: boolean; } export interface UpdateRepositoryResult { repository: RepositoryDTO; } export interface DeleteRepositoryInput { owner: string; repo: string; } export interface DeleteRepositoryResult { owner: string; repo: string; deleted: true; alreadyMissing: boolean; } export interface ListOrganizationRepositoriesInput { org: string; type?: "all" | "public" | "private" | "forks" | "sources" | "member"; sort?: "created" | "updated" | "pushed" | "full_name"; direction?: "asc" | "desc"; pageSize?: number; startPage?: number; limit?: number; namePrefix?: string; } export interface ListOrganizationRepositoriesResult { repositories: RepositoryDTO[]; nextPage: number | null; } export interface GetBranchInput { owner: string; repo: string; branch: string; } export interface BranchDTO { name: string; commitSha: string; protected: boolean; } export interface GetBranchResult { branch: BranchDTO; } export interface CreateBranchInput { owner: string; repo: string; /** Name of the branch to create. */ branch: string; /** Base branch to fork from. Defaults to the repository's default branch. */ from?: string; } export interface DeleteBranchInput { owner: string; repo: string; branch: string; } export interface DeleteBranchResult { branch: string; deleted: boolean; /** True when the branch was already gone (convergent no-op). */ alreadyMissing: boolean; } export interface ListPRsInput { /** "owner/name". */ repo: string; /** Filter by head branch name (scoped to the repo owner). */ head?: string; /** Filter by base branch name. */ base?: string; /** Default "open". */ state?: "open" | "closed" | "all"; /** Default 30. */ limit?: number; } export interface CreateBranchResult { branch: string; /** Head SHA of the branch (the base head on create; the existing head when it already existed). */ sha: string; /** False when the branch already existed (convergent no-op). */ created: boolean; } export interface CommitFilesFileInput { path: string; content: string; encoding?: "utf8" | "base64"; mode?: "100644" | "100755"; } export interface CommitFilesInput { owner: string; repo: string; branch: string; message: string; files: CommitFilesFileInput[]; expectedHeadSha?: string; } export interface CommitFilesResult { commitSha: string; treeSha: string; branch: string; fileCount: number; } export interface SearchCodeInput { query: string; /** Max hits to return. Default 30. */ limit?: number; } /** A single code-search hit, flattened to JSON-serializable fields. */ export interface CodeHitDTO { /** "owner/name" of the repo the hit is in. */ repo: string; path: string; /** html_url of the file. */ url: string; } export interface SearchRepositoriesInput { query: string; /** Max repositories to return. Default 30. */ limit?: number; } export interface ListTreeInput { /** "owner/name". */ repo: string; /** Git ref (branch, tag, or SHA). Defaults to the repo's default branch. */ ref?: string; /** Recurse into subdirectories. Default true. */ recursive?: boolean; } /** Every blob path in a repo tree, plus whether GitHub truncated the result. */ export interface ListTreeResult { /** Blob (file) paths in the tree. */ paths: string[]; /** True if GitHub's tree API truncated the result (repo has too many entries * for a single response); callers should not treat `paths` as complete. */ truncated: boolean; } //# sourceMappingURL=types.d.ts.map