@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, 07:15 UTC

main
ts 18 lines 639 Bytes
Raw
1 import { Sfn, StateMachine } from "@alchemy.run/aws/StepFunctions";
2 import * as Effect from "effect/Effect";
3 import { SaveDigest, Summarize } from "./Summarize.ts";
4
5 // #region show
6 export const Digest = Effect.gen(function* () {
7 const summarize = yield* Summarize;
8 const save = yield* SaveDigest;
9
10 return yield* StateMachine.fromProgram("Digest", {
11 program: Sfn.gen(function* (input: Sfn.Expr<{ room: string }>) {
12 const summary = yield* Sfn.invoke<string>(summarize, { room: input.room });
13 yield* Sfn.sleep("1 day");
14 yield* Sfn.invoke(save, { room: input.room, summary });
15 }),
16 });
17 });
18 // #endregion show