Add mobile Tasks parity (#2452)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-21 20:26:07 -07:00
committed by GitHub
co-authored by Orca
parent 3efc669bd4
commit b1973657ea
123 changed files with 26492 additions and 1461 deletions
@@ -0,0 +1,62 @@
export type GitHubSourceOwnerRepo = {
owner: string
repo: string
}
export type GitHubSourceErrorEnvelope = {
sources?: {
issues: GitHubSourceOwnerRepo | null
prs?: GitHubSourceOwnerRepo | null
} | null
errors?: {
issues?: {
message: string
} | null
} | null
issueSourceFellBack?: true
}
export type GitHubIssueSourceError = {
repoId: string
repoPath: string
source: GitHubSourceOwnerRepo
message: string
}
export type GitHubIssueSourceFallback = {
repoId: string
repoPath: string
repoLabel: string
}
export function extractGitHubIssueSourceError(
repo: { id: string; path: string },
envelope: GitHubSourceErrorEnvelope
): GitHubIssueSourceError | null {
const issueError = envelope.errors?.issues
const issueSource = envelope.sources?.issues
if (!issueError || !issueSource) {
return null
}
return {
repoId: repo.id,
repoPath: repo.path,
source: issueSource,
message: issueError.message
}
}
export function extractGitHubIssueSourceFallback(
repo: { id: string; path: string; displayName: string },
envelope: GitHubSourceErrorEnvelope
): GitHubIssueSourceFallback | null {
if (envelope.issueSourceFellBack !== true) {
return null
}
const prSource = envelope.sources?.prs
return {
repoId: repo.id,
repoPath: repo.path,
repoLabel: prSource ? `${prSource.owner}/${prSource.repo}` : repo.displayName
}
}