mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 01:27:35 +00:00
* chore: audit preload root comments and track repository coverage * docs: track repository comment audit coverage * chore: keep comment audit tracker local * chore: shorten preload API contract comments --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
175 lines
5.8 KiB
TypeScript
175 lines
5.8 KiB
TypeScript
import type {
|
|
GetProjectViewTableResult,
|
|
GitHubProjectCommentMutationResult,
|
|
GitHubProjectMutationResult,
|
|
ListAccessibleProjectsResult,
|
|
ListAssignableUsersBySlugResult,
|
|
ListIssueTypesBySlugResult,
|
|
ListLabelsBySlugResult,
|
|
ListProjectViewsResult,
|
|
ProjectWorkItemDetailsBySlugResult,
|
|
ResolveProjectRefResult
|
|
} from '../../shared/github/project-result-types'
|
|
import type {
|
|
AddIssueCommentBySlugArgs,
|
|
ClearProjectItemFieldArgs,
|
|
DeleteIssueCommentBySlugArgs,
|
|
GetProjectViewTableArgs,
|
|
ListAccessibleProjectsArgs,
|
|
ListAssignableUsersBySlugArgs,
|
|
ListIssueTypesBySlugArgs,
|
|
ListLabelsBySlugArgs,
|
|
ListProjectViewsArgs,
|
|
ProjectWorkItemDetailsBySlugArgs,
|
|
ResolveProjectRefArgs,
|
|
UpdateIssueBySlugArgs,
|
|
UpdateIssueCommentBySlugArgs,
|
|
UpdateIssueTypeBySlugArgs,
|
|
UpdateProjectItemFieldArgs,
|
|
UpdatePullRequestBySlugArgs
|
|
} from '../../shared/github/project-request-types'
|
|
import type { TaskSourceContext } from '../../shared/task-source-context'
|
|
import type { GitHubCommentResult } from '../../shared/github/comment-types'
|
|
import type {
|
|
GitHubAssignableUser,
|
|
GitHubOwnerRepo,
|
|
IssueInfo
|
|
} from '../../shared/github/pull-request-types'
|
|
import type {
|
|
GitHubWorkItem,
|
|
GitHubWorkItemDetails,
|
|
ListWorkItemsResult
|
|
} from '../../shared/github/work-item-types'
|
|
import type { GitHubCreateIssueResult, GitHubIssueUpdate } from '../../shared/issue-mutation-types'
|
|
|
|
export type GitHubRepoSelectorArgs = {
|
|
repoPath: string
|
|
repoId?: string | null
|
|
sourceContext?: TaskSourceContext | null
|
|
}
|
|
|
|
export type GithubWorkItemApi = {
|
|
issue: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
number: number
|
|
}) => Promise<IssueInfo | null>
|
|
workItem: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
number: number
|
|
type?: 'issue' | 'pr'
|
|
}) => Promise<Omit<GitHubWorkItem, 'repoId'> | null>
|
|
workItemByOwnerRepo: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
owner: string
|
|
repo: string
|
|
host?: string
|
|
number: number
|
|
type: 'issue' | 'pr'
|
|
}) => Promise<Omit<GitHubWorkItem, 'repoId'> | null>
|
|
workItemDetails: (
|
|
args: GitHubRepoSelectorArgs & {
|
|
number: number
|
|
type?: 'issue' | 'pr'
|
|
ownerRepo?: GitHubOwnerRepo
|
|
}
|
|
) => Promise<GitHubWorkItemDetails | null>
|
|
notifyWorkItemMutated: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
type: 'issue' | 'pr'
|
|
number: number
|
|
}) => Promise<boolean>
|
|
listIssues: (args: { repoPath: string; repoId?: string; limit?: number }) => Promise<IssueInfo[]>
|
|
createIssue: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
title: string
|
|
body: string
|
|
labels?: string[]
|
|
assignees?: string[]
|
|
}) => Promise<GitHubCreateIssueResult>
|
|
countWorkItems: (args: { repoPath: string; repoId?: string; query?: string }) => Promise<number>
|
|
listWorkItems: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
limit?: number
|
|
query?: string
|
|
page?: number
|
|
noCache?: boolean
|
|
}) => Promise<ListWorkItemsResult<Omit<GitHubWorkItem, 'repoId'>>>
|
|
updateIssue: (
|
|
args: GitHubRepoSelectorArgs & {
|
|
number: number
|
|
updates: GitHubIssueUpdate
|
|
ownerRepo?: GitHubOwnerRepo
|
|
}
|
|
) => Promise<{ ok: true } | { ok: false; error: string }>
|
|
addIssueComment: (
|
|
args: GitHubRepoSelectorArgs & {
|
|
number: number
|
|
body: string
|
|
/** Keep PR and issue cache invalidation separate when their numbers match. */
|
|
type?: 'issue' | 'pr'
|
|
prRepo?: GitHubOwnerRepo | null
|
|
}
|
|
) => Promise<GitHubCommentResult>
|
|
listLabels: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
ownerRepo?: GitHubOwnerRepo
|
|
}) => Promise<string[]>
|
|
listAssignableUsers: (args: {
|
|
repoPath: string
|
|
repoId?: string
|
|
sourceContext?: TaskSourceContext | null
|
|
ownerRepo?: GitHubOwnerRepo
|
|
}) => Promise<GitHubAssignableUser[]>
|
|
/** Invalidate work-item caches across windows after local mutations. */
|
|
onWorkItemMutated: (
|
|
callback: (payload: {
|
|
repoPath: string
|
|
repoId?: string
|
|
type: 'issue' | 'pr'
|
|
number: number
|
|
}) => void
|
|
) => () => void
|
|
listAccessibleProjects: (
|
|
args?: ListAccessibleProjectsArgs
|
|
) => Promise<ListAccessibleProjectsResult>
|
|
resolveProjectRef: (args: ResolveProjectRefArgs) => Promise<ResolveProjectRefResult>
|
|
listProjectViews: (args: ListProjectViewsArgs) => Promise<ListProjectViewsResult>
|
|
getProjectViewTable: (args: GetProjectViewTableArgs) => Promise<GetProjectViewTableResult>
|
|
projectWorkItemDetailsBySlug: (
|
|
args: ProjectWorkItemDetailsBySlugArgs
|
|
) => Promise<ProjectWorkItemDetailsBySlugResult>
|
|
updateProjectItemField: (args: UpdateProjectItemFieldArgs) => Promise<GitHubProjectMutationResult>
|
|
clearProjectItemField: (args: ClearProjectItemFieldArgs) => Promise<GitHubProjectMutationResult>
|
|
updateIssueBySlug: (args: UpdateIssueBySlugArgs) => Promise<GitHubProjectMutationResult>
|
|
updatePullRequestBySlug: (
|
|
args: UpdatePullRequestBySlugArgs
|
|
) => Promise<GitHubProjectMutationResult>
|
|
addIssueCommentBySlug: (
|
|
args: AddIssueCommentBySlugArgs
|
|
) => Promise<GitHubProjectCommentMutationResult>
|
|
updateIssueCommentBySlug: (
|
|
args: UpdateIssueCommentBySlugArgs
|
|
) => Promise<GitHubProjectMutationResult>
|
|
deleteIssueCommentBySlug: (
|
|
args: DeleteIssueCommentBySlugArgs
|
|
) => Promise<GitHubProjectMutationResult>
|
|
listLabelsBySlug: (args: ListLabelsBySlugArgs) => Promise<ListLabelsBySlugResult>
|
|
listAssignableUsersBySlug: (
|
|
args: ListAssignableUsersBySlugArgs
|
|
) => Promise<ListAssignableUsersBySlugResult>
|
|
listIssueTypesBySlug: (args: ListIssueTypesBySlugArgs) => Promise<ListIssueTypesBySlugResult>
|
|
updateIssueTypeBySlug: (args: UpdateIssueTypeBySlugArgs) => Promise<GitHubProjectMutationResult>
|
|
}
|