The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as Issues from "@distilled.cloud/github/issues"; |
| 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 CreateIssueCommentRequest extends Omit< |
| 8 | Issues.CreateCommentRequest, |
| 9 | "owner" | "repo" |
| 10 | > {} |
| 11 | |
| 12 | export type CreateIssueCommentResponse = Issues.IssueComment; |
| 13 | |
| 14 | /** |
| 15 | * Comment on an issue or pull request (`issues.createComment`). Pass a pull |
| 16 | * request's number as `issue_number`. |
| 17 | * |
| 18 | * Provide `GitHub.CreateIssueCommentHttp` on a Worker or Function, or |
| 19 | * `GitHub.CreateIssueCommentLocal` on an Action. |
| 20 | * |
| 21 | * ### Commenting at Runtime |
| 22 | * **Example:** Reply on an issue |
| 23 | * ```typescript |
| 24 | * const createComment = yield* GitHub.CreateIssueComment(yield* Repo); |
| 25 | * yield* createComment({ issue_number: 7, body: "On it." }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | * @product Issue |
| 30 | */ |
| 31 | export interface CreateIssueComment extends Binding.Service< |
| 32 | CreateIssueComment, |
| 33 | "GitHub.CreateIssueComment", |
| 34 | ( |
| 35 | repo: Repository, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: CreateIssueCommentRequest, |
| 39 | ) => Effect.Effect<CreateIssueCommentResponse, Issues.CreateCommentError, RuntimeContext> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const CreateIssueComment = Binding.Service<CreateIssueComment>("GitHub.CreateIssueComment"); |