| 1 | import { WS_METHODS } from "@t3tools/contracts"; |
| 2 | import { Atom } from "effect/reactivity"; |
| 3 | |
| 4 | import { createEnvironmentRpcCommand, createEnvironmentRpcQueryAtomFamily } from "./runtime.ts"; |
| 5 | import type { EnvironmentRegistry } from "../connection/registry.ts"; |
| 6 | import { vcsCommandConcurrency, vcsCommandScheduler } from "./vcsCommandScheduler.ts"; |
| 7 | |
| 8 | export function createGitEnvironmentAtoms<R, E>( |
| 9 | runtime: Atom.AtomRuntime<EnvironmentRegistry | R, E>, |
| 10 | ) { |
| 11 | return { |
| 12 | pullRequestResolution: createEnvironmentRpcQueryAtomFamily(runtime, { |
| 13 | label: "environment-data:git:resolve-pull-request", |
| 14 | tag: WS_METHODS.gitResolvePullRequest, |
| 15 | }), |
| 16 | preparePullRequestThread: createEnvironmentRpcCommand(runtime, { |
| 17 | label: "environment-data:git:prepare-pull-request-thread", |
| 18 | tag: WS_METHODS.gitPreparePullRequestThread, |
| 19 | scheduler: vcsCommandScheduler, |
| 20 | concurrency: vcsCommandConcurrency, |
| 21 | }), |
| 22 | }; |
| 23 | } |