@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 06:00 UTC

main
ts 29 lines 994 Bytes
Raw
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 SandboxLive from "./sandbox.ts";
7 import MicrovmWorker from "./worker.ts";
8
9 /**
10 * Cross-cloud MicroVM stack: deploys the bundled {@link SandboxLive} image
11 * plus {@link MicrovmWorker}, a Cloudflare Worker orchestrator (Alchemy mints
12 * an IAM User + AccessKey + assume-role Role and the worker assumes it).
13 *
14 * Needs BOTH provider sets and real Cloudflare credentials, so it is separate
15 * from the AWS-only `./stack.ts`.
16 */
17 export default Alchemy.Stack(
18 "MicrovmCloudflareStack",
19 {
20 providers: Layer.mergeAll(AWS.providers(), Cloudflare.providers()),
21 state: Alchemy.localState(),
22 },
23 Effect.gen(function* () {
24 const worker = yield* MicrovmWorker;
25 return {
26 workerUrl: worker.url.as<string>(),
27 };
28 }).pipe(Effect.provide(SandboxLive)),
29 );