The best way to control Claude Code, Codex and more from any computer or phone

main
ts 51 lines 1.64 KB
Raw
1 import type * as Pulls from "@distilled.cloud/github/pulls";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Repository } from "./Repository.ts";
6
7 export interface CreatePullRequestReviewRequest extends Omit<
8 Pulls.CreateReviewRequest,
9 "owner" | "repo"
10 > {}
11
12 export type CreatePullRequestReviewResponse = Pulls.PullRequestReview;
13
14 /**
15 * Submit a pull request review (`pulls.createReview`): a `body`, an `event`
16 * verdict (`APPROVE`, `REQUEST_CHANGES` or `COMMENT`) and inline `comments` on
17 * diff lines, in one submission.
18 *
19 * Provide `GitHub.CreatePullRequestReviewHttp` on a Worker or Function, or
20 * `GitHub.CreatePullRequestReviewLocal` on an Action.
21 *
22 * ### Reviewing Pull Requests at Runtime
23 * **Example:** Request changes with an inline comment
24 * ```typescript
25 * const createReview = yield* GitHub.CreatePullRequestReview(yield* Repo);
26 * yield* createReview({
27 * pull_number: 9,
28 * event: "REQUEST_CHANGES",
29 * body: "One problem, inline.",
30 * comments: [{ path: "src/index.ts", line: 42, body: "Off by one." }],
31 * });
32 * ```
33 *
34 * @binding
35 * @product Pull Request
36 */
37 export interface CreatePullRequestReview extends Binding.Service<
38 CreatePullRequestReview,
39 "GitHub.CreatePullRequestReview",
40 (
41 repo: Repository,
42 ) => Effect.Effect<
43 (
44 request: CreatePullRequestReviewRequest,
45 ) => Effect.Effect<CreatePullRequestReviewResponse, Pulls.CreateReviewError, RuntimeContext>
46 >
47 > {}
48
49 export const CreatePullRequestReview = Binding.Service<CreatePullRequestReview>(
50 "GitHub.CreatePullRequestReview",
51 );