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 Context from "effect/Context"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import type { CloudflareResolvedCredentials } from "./Auth/AuthConfig.ts"; |
| 4 | |
| 5 | export class CloudflareEnvironment extends Context.Service< |
| 6 | CloudflareEnvironment, |
| 7 | Effect.Effect<CloudflareResolvedCredentials> |
| 8 | >()("Cloudflare::CloudflareEnvironment") { |
| 9 | /** |
| 10 | * The deploying account, for deploy-time code behind `__ALCHEMY_RUNTIME__`. |
| 11 | * Its requirement is left off the type: the service is always present at |
| 12 | * plan/deploy, and runtime hosts outside Cloudflare (e.g. an AWS Lambda |
| 13 | * using an `*Http` binding) don't have it. |
| 14 | */ |
| 15 | static current = CloudflareEnvironment.use( |
| 16 | (env) => env, |
| 17 | ) as unknown as Effect.Effect<CloudflareResolvedCredentials>; |
| 18 | readonly kind = "Environment" as const; |
| 19 | } |