mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
Adds github.markPRDraft (gh pr ready --undo) on the host, allowlisted for paired phones and advertised with mobile.github.markPRDraft.v1 so older hosts simply hide the action.
82 lines
2.5 KiB
TypeScript
82 lines
2.5 KiB
TypeScript
import { z } from 'zod'
|
|
import { RepoSelector, SlugRepo } from './github-repo-target-params'
|
|
import { OptionalString, requiredString } from './rpc-param-primitives'
|
|
|
|
export const UpdatePrTitle = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
title: requiredString('Missing title'),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const UpdatePr = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
updates: z.object({
|
|
title: OptionalString,
|
|
body: z.string().optional()
|
|
}),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const MergePr = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
method: z.enum(['merge', 'squash', 'rebase']).optional(),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const SetPrAutoMerge = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
enabled: z.boolean(),
|
|
method: z.enum(['merge', 'squash', 'rebase']).optional(),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const UpdatePrState = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional(),
|
|
updates: z.object({
|
|
state: z.enum(['open', 'closed'])
|
|
})
|
|
})
|
|
|
|
export const MarkPrReadyForReview = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const MarkPrDraft = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|
|
|
|
export const RequestPrReviewers = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional(),
|
|
reviewers: z.array(z.string()).min(1)
|
|
})
|
|
|
|
export const RemovePrReviewers = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional(),
|
|
reviewers: z.array(z.string()).min(1)
|
|
})
|
|
|
|
export const PRReviewComment = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
prRepo: SlugRepo.nullable().optional(),
|
|
commitId: requiredString('Missing PR head SHA'),
|
|
path: requiredString('File path required'),
|
|
line: z.number().int().positive(),
|
|
startLine: z.number().int().positive().optional(),
|
|
body: requiredString('Comment body required')
|
|
})
|
|
|
|
export const PRReviewCommentReply = RepoSelector.extend({
|
|
prNumber: z.number().int().positive(),
|
|
commentId: z.number().int().positive(),
|
|
body: requiredString('Comment body required'),
|
|
threadId: OptionalString,
|
|
path: OptionalString,
|
|
line: z.number().int().positive().optional(),
|
|
prRepo: SlugRepo.nullable().optional()
|
|
})
|