The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as Search from "@distilled.cloud/github/search"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import * as BindingHttp from "./BindingHttp.ts"; |
| 4 | import { SearchIssues, type SearchIssuesRequest } from "./SearchIssues.ts"; |
| 5 | |
| 6 | export const searchIssuesOperation = BindingHttp.operation( |
| 7 | "search.issuesAndPullRequests", |
| 8 | (repo) => (request: SearchIssuesRequest) => |
| 9 | Search.issuesAndPullRequests({ |
| 10 | ...request, |
| 11 | q: `repo:${repo.owner}/${repo.repository} ${request.q}`, |
| 12 | }), |
| 13 | ); |
| 14 | |
| 15 | /** |
| 16 | * Token-backed implementation of {@link SearchIssues}. Provide it on a Worker or |
| 17 | * Function: it captures a `GitHub.PersonalAccessToken` for the host and binds |
| 18 | * the token and the repository into it. |
| 19 | * |
| 20 | * @layer |
| 21 | * @product Issue |
| 22 | * @provides GitHub.SearchIssues |
| 23 | */ |
| 24 | export const SearchIssuesHttp = Layer.effect(SearchIssues, BindingHttp.make(searchIssuesOperation)); |