refactor(core): consolidate filesystem services (#30447)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Effect, Schema } from "effect"
|
||||
import * as path from "path"
|
||||
import { AppFileSystem } from "@opencode-ai/core/filesystem"
|
||||
import { FSUtil } from "@opencode-ai/core/fs-util"
|
||||
import * as Log from "@opencode-ai/core/util/log"
|
||||
import * as Bom from "../util/bom"
|
||||
|
||||
@@ -519,7 +519,7 @@ export const applyHunksToFiles = Effect.fn("Patch.applyHunksToFiles")(function*
|
||||
return yield* Effect.fail(new Error("No files were modified."))
|
||||
}
|
||||
|
||||
const fs = yield* AppFileSystem.Service
|
||||
const fs = yield* FSUtil.Service
|
||||
|
||||
const added: string[] = []
|
||||
const modified: string[] = []
|
||||
@@ -574,7 +574,7 @@ type MaybeApplyPatchVerifiedResult =
|
||||
| { type: MaybeApplyPatchVerified.CorrectnessError; error: Error }
|
||||
| { type: MaybeApplyPatchVerified.NotApplyPatch }
|
||||
|
||||
// Effectful verified-parse: needs AppFileSystem.Service to read existing files
|
||||
// Effectful verified-parse: needs FSUtil.Service to read existing files
|
||||
export const maybeParseApplyPatchVerified = Effect.fn("Patch.maybeParseApplyPatchVerified")(function* (
|
||||
argv: string[],
|
||||
cwd: string,
|
||||
@@ -596,7 +596,7 @@ export const maybeParseApplyPatchVerified = Effect.fn("Patch.maybeParseApplyPatc
|
||||
|
||||
switch (result.type) {
|
||||
case MaybeApplyPatch.Body: {
|
||||
const fs = yield* AppFileSystem.Service
|
||||
const fs = yield* FSUtil.Service
|
||||
const args = result.args
|
||||
const effectiveCwd = args.workdir ? path.resolve(cwd, args.workdir) : cwd
|
||||
const changes = new Map<string, ApplyPatchFileChange>()
|
||||
|
||||
Reference in New Issue
Block a user