Revert: all refactor commits migrating from Bun.file() to Filesystem module

This commit is contained in:
Dax Raad
2026-02-18 19:41:14 -05:00
parent 3a07dd8d96
commit 568eccb4c6
25 changed files with 216 additions and 294 deletions

View File

@@ -3,12 +3,10 @@ import { tui } from "./app"
import { Rpc } from "@/util/rpc"
import { type rpc } from "./worker"
import path from "path"
import { fileURLToPath } from "url"
import { UI } from "@/cli/ui"
import { iife } from "@/util/iife"
import { Log } from "@/util/log"
import { withNetworkOptions, resolveNetworkOptions } from "@/cli/network"
import { Filesystem } from "@/util/filesystem"
import type { Event } from "@opencode-ai/sdk/v2"
import type { EventSource } from "./context/sdk"
import { win32DisableProcessedInput, win32InstallCtrlCGuard } from "./win32"
@@ -101,7 +99,7 @@ export const TuiThreadCommand = cmd({
const distWorker = new URL("./cli/cmd/tui/worker.js", import.meta.url)
const workerPath = await iife(async () => {
if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH
if (await Filesystem.exists(fileURLToPath(distWorker))) return distWorker
if (await Bun.file(distWorker).exists()) return distWorker
return localWorker
})
try {