Files
t3code/apps/server/src/vcs/VcsDriver.ts
T
91a03e0747 feat(source-control): add Bitbucket & Azure Devops providers (#2473)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-04 00:59:58 -07:00

32 lines
1.2 KiB
TypeScript

import { Context, type Effect } from "effect";
import type {
VcsDriverCapabilities,
VcsError,
VcsInitInput,
VcsListRemotesResult,
VcsListWorkspaceFilesResult,
VcsRepositoryIdentity,
} from "@t3tools/contracts";
import * as VcsProcess from "./VcsProcess.ts";
export interface VcsDriverShape {
readonly capabilities: VcsDriverCapabilities;
readonly execute: (
input: Omit<VcsProcess.VcsProcessInput, "command">,
) => Effect.Effect<VcsProcess.VcsProcessOutput, VcsError>;
readonly detectRepository: (cwd: string) => Effect.Effect<VcsRepositoryIdentity | null, VcsError>;
readonly isInsideWorkTree: (cwd: string) => Effect.Effect<boolean, VcsError>;
readonly listWorkspaceFiles: (
cwd: string,
) => Effect.Effect<VcsListWorkspaceFilesResult, VcsError>;
readonly listRemotes: (cwd: string) => Effect.Effect<VcsListRemotesResult, VcsError>;
readonly filterIgnoredPaths: (
cwd: string,
relativePaths: ReadonlyArray<string>,
) => Effect.Effect<ReadonlyArray<string>, VcsError>;
readonly initRepository: (input: VcsInitInput) => Effect.Effect<void, VcsError>;
}
export class VcsDriver extends Context.Service<VcsDriver, VcsDriverShape>()("t3/vcs/VcsDriver") {}