The best way to control Claude Code, Codex and more from any computer or phone

main
ts 27 lines 807 Bytes
Raw
1 import * as Cloudflare from "@alchemy.run/cloudflare";
2 import * as Drizzle from "@alchemy.run/drizzle";
3 import * as Neon from "@alchemy.run/neon";
4 import * as Alchemy from "alchemy";
5 import * as Effect from "effect/Effect";
6 import * as Layer from "effect/Layer";
7 import Api from "./src/Api.ts";
8 import { Hyperdrive, NeonDb } from "./src/Db.ts";
9
10 export default Alchemy.Stack(
11 "CloudflareNeonDrizzleExample",
12 {
13 providers: Layer.mergeAll(Cloudflare.providers(), Drizzle.providers(), Neon.providers()),
14 state: Alchemy.localState(),
15 },
16 Effect.gen(function* () {
17 const { branch } = yield* NeonDb;
18 const hd = yield* Hyperdrive;
19 const api = yield* Api;
20
21 return {
22 url: api.url.as<string>(),
23 branchId: branch.branchId,
24 hyperdriveId: hd.hyperdriveId,
25 };
26 }),
27 );