- Introduce a dedicated `GitVcsDriver` service and `vcsLayer` - Update server, orchestration, and workspace wiring to use the new layer - Adjust tests and mocks for the new git-specific dependency
28 lines
999 B
TypeScript
28 lines
999 B
TypeScript
import { Context, type Effect } from "effect";
|
|
|
|
import type {
|
|
VcsDriverCapabilities,
|
|
VcsError,
|
|
VcsListWorkspaceFilesResult,
|
|
VcsRepositoryIdentity,
|
|
} from "@t3tools/contracts";
|
|
import type { VcsProcessInput, VcsProcessOutput } from "./VcsProcess.ts";
|
|
|
|
export interface VcsDriverShape {
|
|
readonly capabilities: VcsDriverCapabilities;
|
|
readonly execute: (
|
|
input: Omit<VcsProcessInput, "command">,
|
|
) => Effect.Effect<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 filterIgnoredPaths: (
|
|
cwd: string,
|
|
relativePaths: ReadonlyArray<string>,
|
|
) => Effect.Effect<ReadonlyArray<string>, VcsError>;
|
|
}
|
|
|
|
export class VcsDriver extends Context.Service<VcsDriver, VcsDriverShape>()("t3/vcs/VcsDriver") {}
|