@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 20 lines 788 Bytes
Raw
1 /**
2 * Shared scaffolding for the GitHub `*Local` binding layers: the same
3 * operations as `*Http`, authenticated with the provider's current
4 * credentials instead of a token bound into a host. Provide them on an
5 * `Action` or any deploy-time Effect.
6 *
7 * NOT exported from `index.ts`.
8 */
9 import * as Effect from "effect/Effect";
10 import { type Operation, makeOperationClient } from "./BindingHttp.ts";
11 import { Credentials } from "./Credentials.ts";
12
13 export const make = <Request extends ReadonlyArray<any>, Out, E>(op: Operation<Request, Out, E>) =>
14 Effect.gen(function* () {
15 const credentials = yield* yield* Credentials;
16 return makeOperationClient(op, {
17 token: Effect.succeed(credentials.token),
18 apiUrl: Effect.succeed(credentials.apiBaseUrl),
19 });
20 });