refactor(bash): use Effect ChildProcess for bash tool execution (#20496)

This commit is contained in:
Kit Langton
2026-04-01 19:48:47 -04:00
committed by GitHub
parent 26fb6b8788
commit e4ff1ea778
3 changed files with 201 additions and 71 deletions

View File

@@ -488,3 +488,14 @@ export const layer: Layer.Layer<ChildProcessSpawner, never, FileSystem.FileSyste
)
export const defaultLayer = layer.pipe(Layer.provide(NodeFileSystem.layer), Layer.provide(NodePath.layer))
import { lazy } from "@/util/lazy"
const rt = lazy(() => {
// Dynamic import to avoid circular dep: cross-spawn-spawner → run-service → Instance → project → cross-spawn-spawner
const { makeRuntime } = require("@/effect/run-service") as typeof import("@/effect/run-service")
return makeRuntime(ChildProcessSpawner, defaultLayer)
})
export const runPromiseExit: ReturnType<typeof rt>["runPromiseExit"] = (...args) => rt().runPromiseExit(...(args as [any]))
export const runPromise: ReturnType<typeof rt>["runPromise"] = (...args) => rt().runPromise(...(args as [any]))