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, 06:00 UTC
| 1 | import * as Neon from "@alchemy.run/neon"; |
| 2 | import * as Config from "effect/Config"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import { resources } from "../resources.ts"; |
| 5 | import EffectApi from "./EffectApi.ts"; |
| 6 | import { gateway } from "./resources.ts"; |
| 7 | |
| 8 | export const ai = Effect.gen(function* () { |
| 9 | const { branch } = yield* resources; |
| 10 | const backend = yield* gateway; |
| 11 | const native = yield* Neon.Function("NativeAI", { |
| 12 | branch, |
| 13 | main: "./src/ai/native.ts", |
| 14 | env: { |
| 15 | EXAMPLE_API_KEY: yield* Config.Redacted("NEON_EXAMPLE_API_KEY"), |
| 16 | AI_MODEL: yield* Config.String("NEON_AI_MODEL"), |
| 17 | AI_ALLOW_PAID: yield* Config.String("NEON_AI_ALLOW_PAID").pipe(Config.withDefault("false")), |
| 18 | }, |
| 19 | }); |
| 20 | const effect = yield* EffectApi; |
| 21 | return { |
| 22 | nativeUrl: native.url, |
| 23 | effectUrl: effect.url, |
| 24 | gatewayUrl: backend.baseUrl, |
| 25 | }; |
| 26 | }); |