Open History to see the last commit
1import * as Effect from "effect/Effect";
2import * as Layer from "effect/Layer";
3
4import {
5 OrchestrationReactor,
6 type OrchestrationReactorShape,
7} from "../Services/OrchestrationReactor.ts";
8import { CheckpointReactor } from "../Services/CheckpointReactor.ts";
9import { ProviderCommandReactor } from "../Services/ProviderCommandReactor.ts";
10import { ProviderRuntimeIngestionService } from "../Services/ProviderRuntimeIngestion.ts";
11import { ThreadDeletionReactor } from "../Services/ThreadDeletionReactor.ts";
12import * as ThreadSettlementReactor from "../ThreadSettlementReactor.ts";
13import * as PullRequestSyncReactor from "../PullRequestSyncReactor.ts";
14import * as ThreadPullRequestReactor from "../ThreadPullRequestReactor.ts";
15import * as AgentAwarenessRelay from "../../relay/AgentAwarenessRelay.ts";
16import * as StorageCleanup from "../../storageCleanup.ts";
17
18export const makeOrchestrationReactor = Effect.gen(function* () {
19 const providerRuntimeIngestion = yield* ProviderRuntimeIngestionService;
20 const providerCommandReactor = yield* ProviderCommandReactor;
21 const checkpointReactor = yield* CheckpointReactor;
22 const threadDeletionReactor = yield* ThreadDeletionReactor;
23 const threadSettlementReactor = yield* ThreadSettlementReactor.ThreadSettlementReactor;
24 const pullRequestSyncReactor = yield* PullRequestSyncReactor.PullRequestSyncReactor;
25 const threadPullRequestReactor = yield* ThreadPullRequestReactor.ThreadPullRequestReactor;
26 const agentAwarenessRelay = yield* AgentAwarenessRelay.AgentAwarenessRelay;
27 const storageCleanup = yield* StorageCleanup.StorageCleanup;
28
29 const start: OrchestrationReactorShape["start"] = Effect.fn("start")(function* () {
30 yield* providerRuntimeIngestion.start();
31 yield* providerCommandReactor.start();
32 yield* checkpointReactor.start();
33 yield* threadDeletionReactor.start();
34 yield* threadPullRequestReactor.start();
35 yield* threadSettlementReactor.start();
36 yield* pullRequestSyncReactor.start();
37 yield* agentAwarenessRelay.start();
38 yield* storageCleanup.start();
39 });
40
41 return {
42 start,
43 } satisfies OrchestrationReactorShape;
44});
45
46export const OrchestrationReactorLive = Layer.effect(
47 OrchestrationReactor,
48 makeOrchestrationReactor,
49);