1import * as Cloudflare from "@/Cloudflare";
2import * as Alchemy from "@/index";
3import * as Effect from "effect/Effect";
4import RpcCounterWorker from "./worker.ts";
5
6/**
7 * Stack with one Worker driving an
8 * {@link Cloudflare.RpcDurableObject} counter via the typed
9 * `getByName(id)` client.
10 */
11export default Alchemy.Stack(
12 "RpcDurableObjectStack",
13 {
14 providers: Cloudflare.providers(),
15 state: Alchemy.localState(),
16 },
17 Effect.gen(function* () {
18 const worker = yield* RpcCounterWorker;
19 return { url: worker.url.as<string>() };
20 }),
21);