The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { |
| 2 | defineSourceControlDriver, |
| 3 | withOwnServices, |
| 4 | } from "@t3tools/source-control-core/server/driver"; |
| 5 | import * as Effect from "effect/Effect"; |
| 6 | import * as Layer from "effect/Layer"; |
| 7 | |
| 8 | import { definition } from "../shared/definition.ts"; |
| 9 | |
| 10 | import * as BitbucketApi from "./BitbucketApi.ts"; |
| 11 | import * as BitbucketPullRequestApi from "./BitbucketPullRequestApi.ts"; |
| 12 | import * as BitbucketPullRequestProvider from "./BitbucketPullRequestProvider.ts"; |
| 13 | import * as BitbucketSourceControlProvider from "./BitbucketSourceControlProvider.ts"; |
| 14 | |
| 15 | // Every setting the API reads from the environment is optional, so reading them cannot fail. |
| 16 | const services = BitbucketPullRequestApi.layer.pipe( |
| 17 | Layer.provideMerge(BitbucketApi.layer), |
| 18 | Layer.orDie, |
| 19 | ); |
| 20 | |
| 21 | const makeInstance = Effect.all({ |
| 22 | sourceControl: BitbucketSourceControlProvider.make, |
| 23 | discovery: BitbucketSourceControlProvider.makeDiscovery, |
| 24 | pullRequests: BitbucketPullRequestProvider.make, |
| 25 | }); |
| 26 | |
| 27 | export const driver = defineSourceControlDriver({ |
| 28 | kind: definition.kind, |
| 29 | definition, |
| 30 | make: withOwnServices(makeInstance, services), |
| 31 | }); |