diff --git a/apps/server/integration/OrchestrationEngineHarness.integration.ts b/apps/server/integration/OrchestrationEngineHarness.integration.ts index 0792b5c19d..d4c61e8aa9 100644 --- a/apps/server/integration/OrchestrationEngineHarness.integration.ts +++ b/apps/server/integration/OrchestrationEngineHarness.integration.ts @@ -76,8 +76,8 @@ import { import { deriveServerPaths, ServerConfig } from "../src/config.ts"; import { WorkspaceEntriesLive } from "../src/workspace/Layers/WorkspaceEntries.ts"; import { WorkspacePathsLive } from "../src/workspace/Layers/WorkspacePaths.ts"; -import { layer as GitVcsDriverLayer } from "../src/vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../src/vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../src/vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../src/vcs/VcsProcess.ts"; function runGit(cwd: string, args: ReadonlyArray) { return execFileSync("git", args, { @@ -292,7 +292,7 @@ export const makeOrchestrationIntegrationHarness = ( Layer.provide(providerEventLoggersLayer), ); - const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer)); + const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer)); const projectionSnapshotQueryLayer = OrchestrationProjectionSnapshotQueryLive; const runtimeServicesLayer = Layer.mergeAll( projectionSnapshotQueryLayer, @@ -343,12 +343,12 @@ export const makeOrchestrationIntegrationHarness = ( Layer.provideMerge( WorkspaceEntriesLive.pipe( Layer.provide(WorkspacePathsLive), - Layer.provideMerge(GitVcsDriverLayer), + Layer.provideMerge(GitVcsDriver.layer), Layer.provide(NodeServices.layer), ), ), Layer.provideMerge(WorkspacePathsLive), - Layer.provideMerge(VcsProcessLayer), + Layer.provideMerge(VcsProcess.layer), ); const orchestrationReactorLayer = OrchestrationReactorLive.pipe( Layer.provideMerge(runtimeIngestionLayer), diff --git a/apps/server/src/checkpointing/Layers/CheckpointStore.test.ts b/apps/server/src/checkpointing/Layers/CheckpointStore.test.ts index 7a710c7aea..e32249977f 100644 --- a/apps/server/src/checkpointing/Layers/CheckpointStore.test.ts +++ b/apps/server/src/checkpointing/Layers/CheckpointStore.test.ts @@ -8,9 +8,9 @@ import { describe, expect } from "vitest"; import { checkpointRefForThreadTurn } from "../Utils.ts"; import { CheckpointStoreLive } from "./CheckpointStore.ts"; import { CheckpointStore } from "../Services/CheckpointStore.ts"; -import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts"; -import { VcsProcess } from "../../vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../../vcs/VcsProcess.ts"; +import { VcsProcess as VcsProcessService } from "../../vcs/VcsProcess.ts"; import type { VcsError } from "@t3tools/contracts"; import { ServerConfig } from "../../config.ts"; import { ThreadId } from "@t3tools/contracts"; @@ -18,8 +18,8 @@ import { ThreadId } from "@t3tools/contracts"; const ServerConfigLayer = ServerConfig.layerTest(process.cwd(), { prefix: "t3-checkpoint-store-test-", }); -const VcsProcessTestLayer = VcsProcessLayer.pipe(Layer.provide(NodeServices.layer)); -const VcsDriverTestLayer = GitVcsDriverLayer.pipe(Layer.provide(VcsProcessTestLayer)); +const VcsProcessTestLayer = VcsProcess.layer.pipe(Layer.provide(NodeServices.layer)); +const VcsDriverTestLayer = GitVcsDriver.layer.pipe(Layer.provide(VcsProcessTestLayer)); const CheckpointStoreTestLayer = CheckpointStoreLive.pipe( Layer.provideMerge(VcsDriverTestLayer), Layer.provideMerge(NodeServices.layer), @@ -53,9 +53,9 @@ function writeTextFile( function git( cwd: string, args: ReadonlyArray, -): Effect.Effect { +): Effect.Effect { return Effect.gen(function* () { - const process = yield* VcsProcess; + const process = yield* VcsProcessService; const result = yield* process.run({ operation: "CheckpointStore.test.git", command: "git", @@ -69,7 +69,11 @@ function git( function initRepoWithCommit( cwd: string, -): Effect.Effect { +): Effect.Effect< + void, + VcsError | PlatformError.PlatformError, + VcsProcessService | FileSystem.FileSystem +> { return Effect.gen(function* () { yield* git(cwd, ["init"]); yield* git(cwd, ["config", "user.email", "test@test.com"]); diff --git a/apps/server/src/git/Layers/GitManager.test.ts b/apps/server/src/git/Layers/GitManager.test.ts index 0638a9f22c..fb5c2ee2d8 100644 --- a/apps/server/src/git/Layers/GitManager.test.ts +++ b/apps/server/src/git/Layers/GitManager.test.ts @@ -21,8 +21,8 @@ import { GitHubCli, } from "../Services/GitHubCli.ts"; import { type TextGenerationShape, TextGeneration } from "../Services/TextGeneration.ts"; -import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../../vcs/VcsProcess.ts"; import { VcsDriver } from "../../vcs/VcsDriver.ts"; import { makeGitManager } from "./GitManager.ts"; import { ServerConfig } from "../../config.ts"; @@ -657,8 +657,8 @@ function makeManager(input?: { const serverSettingsLayer = ServerSettingsService.layerTest(); - const vcsDriverLayer = GitVcsDriverLayer.pipe( - Layer.provideMerge(VcsProcessLayer), + const vcsDriverLayer = GitVcsDriver.layer.pipe( + Layer.provideMerge(VcsProcess.layer), Layer.provideMerge(NodeServices.layer), Layer.provideMerge(ServerConfigLayer), ); @@ -684,9 +684,9 @@ function makeManager(input?: { const asThreadId = (threadId: string) => threadId as ThreadId; -const GitManagerTestLayer = GitVcsDriverLayer.pipe( +const GitManagerTestLayer = GitVcsDriver.layer.pipe( Layer.provide(ServerConfig.layerTest(process.cwd(), { prefix: "t3-git-manager-test-" })), - Layer.provideMerge(VcsProcessLayer), + Layer.provideMerge(VcsProcess.layer), Layer.provideMerge(NodeServices.layer), ); diff --git a/apps/server/src/orchestration/Layers/CheckpointReactor.test.ts b/apps/server/src/orchestration/Layers/CheckpointReactor.test.ts index 500f3debd3..ff267b11ab 100644 --- a/apps/server/src/orchestration/Layers/CheckpointReactor.test.ts +++ b/apps/server/src/orchestration/Layers/CheckpointReactor.test.ts @@ -25,8 +25,8 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import { CheckpointStoreLive } from "../../checkpointing/Layers/CheckpointStore.ts"; import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts"; import { GitStatusBroadcaster } from "../../git/Services/GitStatusBroadcaster.ts"; -import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../../vcs/VcsProcess.ts"; import { RepositoryIdentityResolverLive } from "../../project/Layers/RepositoryIdentityResolver.ts"; import { CheckpointReactorLive } from "./CheckpointReactor.ts"; import { OrchestrationEngineLive } from "./OrchestrationEngine.ts"; @@ -307,15 +307,15 @@ describe("CheckpointReactor", () => { Layer.provideMerge(RuntimeReceiptBusLive), Layer.provideMerge(Layer.succeed(ProviderService, provider.service)), Layer.provideMerge(gitStatusBroadcasterLayer), - Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer))), + Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer))), Layer.provideMerge( WorkspaceEntriesLive.pipe( Layer.provide(WorkspacePathsLive), - Layer.provideMerge(GitVcsDriverLayer), + Layer.provideMerge(GitVcsDriver.layer), ), ), Layer.provideMerge(WorkspacePathsLive), - Layer.provideMerge(VcsProcessLayer), + Layer.provideMerge(VcsProcess.layer), Layer.provideMerge(ServerConfigLayer), Layer.provideMerge(NodeServices.layer), ); diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts index 114354fccd..8632e46921 100644 --- a/apps/server/src/server.ts +++ b/apps/server/src/server.ts @@ -46,8 +46,8 @@ import { RepositoryIdentityResolverLive } from "./project/Layers/RepositoryIdent import { WorkspaceEntriesLive } from "./workspace/Layers/WorkspaceEntries.ts"; import { WorkspaceFileSystemLive } from "./workspace/Layers/WorkspaceFileSystem.ts"; import { WorkspacePathsLive } from "./workspace/Layers/WorkspacePaths.ts"; -import { layer as GitVcsDriverLayer } from "./vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "./vcs/VcsProcess.ts"; +import * as GitVcsDriver from "./vcs/GitVcsDriver.ts"; +import * as VcsProcess from "./vcs/VcsProcess.ts"; import { ProjectSetupScriptRunnerLive } from "./project/Layers/ProjectSetupScriptRunner.ts"; import { ObservabilityLive } from "./observability/Layers/Observability.ts"; import { ServerEnvironmentLive } from "./environment/Layers/ServerEnvironment.ts"; @@ -136,7 +136,7 @@ const ReactorLayerLive = Layer.empty.pipe( const CheckpointingLayerLive = Layer.empty.pipe( Layer.provideMerge(CheckpointDiffQueryLive), - Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer))), + Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer))), ); const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe( @@ -158,7 +158,7 @@ const PersistenceLayerLive = Layer.empty.pipe(Layer.provideMerge(SqlitePersisten const GitManagerLayerLive = GitManagerLive.pipe( Layer.provideMerge(ProjectSetupScriptRunnerLive), - Layer.provideMerge(GitVcsDriverLayer), + Layer.provideMerge(GitVcsDriver.layer), Layer.provideMerge(GitHubCliLive), Layer.provideMerge(TextGenerationLive), ); @@ -166,14 +166,14 @@ const GitManagerLayerLive = GitManagerLive.pipe( const GitLayerLive = Layer.empty.pipe( Layer.provideMerge(GitManagerLayerLive), Layer.provideMerge(GitStatusBroadcasterLive.pipe(Layer.provide(GitManagerLayerLive))), - Layer.provideMerge(GitVcsDriverLayer), + Layer.provideMerge(GitVcsDriver.layer), ); const TerminalLayerLive = TerminalManagerLive.pipe(Layer.provide(PtyAdapterLive)); const WorkspaceEntriesLayerLive = WorkspaceEntriesLive.pipe( Layer.provide(WorkspacePathsLive), - Layer.provideMerge(GitVcsDriverLayer), + Layer.provideMerge(GitVcsDriver.layer), ); const WorkspaceFileSystemLayerLive = WorkspaceFileSystemLive.pipe( @@ -311,7 +311,7 @@ export const makeServerLayer = Layer.unwrap( Layer.provideMerge(HttpServerLive), Layer.provide(ObservabilityLive), Layer.provideMerge(FetchHttpClient.layer), - Layer.provideMerge(VcsProcessLayer), + Layer.provideMerge(VcsProcess.layer), Layer.provideMerge(PlatformServicesLive), ); }), diff --git a/apps/server/src/vcs/GitVcsDriver.test.ts b/apps/server/src/vcs/GitVcsDriver.test.ts index 92910b21e8..63e04702f6 100644 --- a/apps/server/src/vcs/GitVcsDriver.test.ts +++ b/apps/server/src/vcs/GitVcsDriver.test.ts @@ -6,7 +6,7 @@ import { describe, expect } from "vitest"; import { ServerConfig } from "../config.ts"; import { VcsProcess } from "./VcsProcess.ts"; import { VcsDriver } from "./VcsDriver.ts"; -import { layer as GitVcsDriverLayer } from "./GitVcsDriver.ts"; +import * as GitVcsDriver from "./GitVcsDriver.ts"; const splitNullSeparatedPaths = (input: string): string[] => input @@ -18,7 +18,7 @@ const GitVcsDriverTestDependencies = ServerConfig.layerTest(process.cwd(), { prefix: "t3-git-vcs-driver-test-", }).pipe(Layer.provide(NodeServices.layer)); -it.layer(Layer.empty)("GitVcsDriverLayer", (it) => { +it.layer(Layer.empty)("GitVcsDriver.layer", (it) => { describe("workspace helpers", () => { it.effect("filterIgnoredPaths chunks large path lists and preserves kept paths", () => Effect.gen(function* () { @@ -32,7 +32,7 @@ it.layer(Layer.empty)("GitVcsDriverLayer", (it) => { ); const seenChunks: string[][] = []; - const layer = GitVcsDriverLayer.pipe( + const layer = GitVcsDriver.layer.pipe( Layer.provideMerge(GitVcsDriverTestDependencies), Layer.provideMerge(NodeServices.layer), Layer.provide( @@ -81,7 +81,7 @@ it.layer(Layer.empty)("GitVcsDriverLayer", (it) => { it.effect("listWorkspaceFiles disables fsmonitor and untracked cache helpers", () => Effect.gen(function* () { - const layer = GitVcsDriverLayer.pipe( + const layer = GitVcsDriver.layer.pipe( Layer.provideMerge(GitVcsDriverTestDependencies), Layer.provideMerge(NodeServices.layer), Layer.provide( diff --git a/apps/server/src/workspace/Layers/WorkspaceEntries.test.ts b/apps/server/src/workspace/Layers/WorkspaceEntries.test.ts index 87ca014a95..f7261ff3f9 100644 --- a/apps/server/src/workspace/Layers/WorkspaceEntries.test.ts +++ b/apps/server/src/workspace/Layers/WorkspaceEntries.test.ts @@ -5,9 +5,9 @@ import { it, afterEach, describe, expect, vi } from "@effect/vitest"; import { Effect, FileSystem, Layer, Path, PlatformError } from "effect"; import { ServerConfig } from "../../config.ts"; -import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts"; -import { VcsProcess } from "../../vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../../vcs/VcsProcess.ts"; +import { VcsProcess as VcsProcessService } from "../../vcs/VcsProcess.ts"; import { WorkspaceEntries } from "../Services/WorkspaceEntries.ts"; import { WorkspaceEntriesLive } from "./WorkspaceEntries.ts"; import { WorkspacePathsLive } from "./WorkspacePaths.ts"; @@ -15,8 +15,8 @@ import { WorkspacePathsLive } from "./WorkspacePaths.ts"; const TestLayer = Layer.empty.pipe( Layer.provideMerge(WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive))), Layer.provideMerge(WorkspacePathsLive), - Layer.provideMerge(VcsProcessLayer), - Layer.provideMerge(GitVcsDriverLayer.pipe(Layer.provide(VcsProcessLayer))), + Layer.provideMerge(VcsProcess.layer), + Layer.provideMerge(GitVcsDriver.layer.pipe(Layer.provide(VcsProcess.layer))), Layer.provide( ServerConfig.layerTest(process.cwd(), { prefix: "t3-workspace-entries-test-", @@ -52,7 +52,7 @@ function writeTextFile( const git = (cwd: string, args: ReadonlyArray, env?: NodeJS.ProcessEnv) => Effect.gen(function* () { - const process = yield* VcsProcess; + const process = yield* VcsProcessService; const result = yield* process.run({ operation: "WorkspaceEntries.test.git", command: "git", diff --git a/apps/server/src/workspace/Layers/WorkspaceFileSystem.test.ts b/apps/server/src/workspace/Layers/WorkspaceFileSystem.test.ts index fd8daf6a3e..fffc401a8c 100644 --- a/apps/server/src/workspace/Layers/WorkspaceFileSystem.test.ts +++ b/apps/server/src/workspace/Layers/WorkspaceFileSystem.test.ts @@ -3,8 +3,8 @@ import { it, describe, expect } from "@effect/vitest"; import { Effect, FileSystem, Layer, Path } from "effect"; import { ServerConfig } from "../../config.ts"; -import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts"; -import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts"; +import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts"; +import * as VcsProcess from "../../vcs/VcsProcess.ts"; import { WorkspaceEntries } from "../Services/WorkspaceEntries.ts"; import { WorkspaceFileSystem } from "../Services/WorkspaceFileSystem.ts"; import { WorkspaceEntriesLive } from "./WorkspaceEntries.ts"; @@ -20,7 +20,7 @@ const TestLayer = Layer.empty.pipe( Layer.provideMerge(ProjectLayer), Layer.provideMerge(WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive))), Layer.provideMerge(WorkspacePathsLive), - Layer.provideMerge(GitVcsDriverLayer.pipe(Layer.provide(VcsProcessLayer))), + Layer.provideMerge(GitVcsDriver.layer.pipe(Layer.provide(VcsProcess.layer))), Layer.provide( ServerConfig.layerTest(process.cwd(), { prefix: "t3-workspace-files-test-",