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 { reifyBoundConfigProvider } from "alchemy/Runtime"; |
| 2 | import * as ConfigProvider from "effect/ConfigProvider"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import cloudflare_workers from "./cloudflare_workers.ts"; |
| 5 | |
| 6 | /** |
| 7 | * A `ConfigProvider` backed by the running Worker's environment. |
| 8 | * |
| 9 | * Values that were auto-bound by the deploy-time `Config` interceptor |
| 10 | * arrive in the env as `{"_tag":"Redacted","value":...}` markers; they are |
| 11 | * reified back to their raw source value before `Config` schemas decode |
| 12 | * them, matching the provider the Worker bridge installs by default. |
| 13 | */ |
| 14 | export const WorkerConfigProvider = () => |
| 15 | cloudflare_workers.pipe( |
| 16 | Effect.map(({ env }) => |
| 17 | reifyBoundConfigProvider(ConfigProvider.fromUnknown(env), env as Record<string, unknown>), |
| 18 | ), |
| 19 | ); |