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 AWS from "@alchemy.run/aws"; |
| 2 | import * as Cloudflare from "@alchemy.run/cloudflare"; |
| 3 | import * as Alchemy from "alchemy"; |
| 4 | import * as Effect from "effect/Effect"; |
| 5 | import * as Layer from "effect/Layer"; |
| 6 | import { Connector } from "./src/Connector.ts"; |
| 7 | import { Hyperdrive } from "./src/Hyperdrive.ts"; |
| 8 | |
| 9 | export default Alchemy.Stack( |
| 10 | "CloudflareHyperdriveAwsVpc", |
| 11 | { |
| 12 | providers: Layer.mergeAll(AWS.providers(), Cloudflare.providers(), Alchemy.RandomProvider()), |
| 13 | state: Alchemy.localState(), |
| 14 | }, |
| 15 | Effect.gen(function* () { |
| 16 | yield* Connector; |
| 17 | const hd = yield* Hyperdrive; |
| 18 | const worker = yield* Cloudflare.Worker("Api", { |
| 19 | main: "./src/worker.ts", |
| 20 | compatibility: { flags: ["nodejs_compat"] }, |
| 21 | env: { DB: hd }, |
| 22 | }); |
| 23 | return { |
| 24 | url: worker.url, |
| 25 | hyperdriveId: hd.hyperdriveId, |
| 26 | }; |
| 27 | }), |
| 28 | ); |