The open source coding agent.
TypeScript
temporarily remove bun strip ansi due to bug
Dax Raade316050bf573
diff --git a/packages/opencode/src/cli/cmd/import.ts b/packages/opencode/src/cli/cmd/import.tsindex eeb2e68855f..afebadc3d74 100644--- a/packages/opencode/src/cli/cmd/import.ts+++ b/packages/opencode/src/cli/cmd/import.ts@@ -2,7 +2,6 @@ import type { Argv } from "yargs"import { Session } from "../../session"import { cmd } from "./cmd"import { bootstrap } from "../bootstrap"-import { UI } from "../ui"import { Storage } from "../../storage/storage"import { Instance } from "../../project/instance"import { EOL } from "os"@@ -19,20 +18,19 @@ export const ImportCommand = cmd({},handler: async (args) => {await bootstrap(process.cwd(), async () => {- const file = Bun.file(args.file as string)- const exists = await file.exists()- if (!exists) {- UI.error(`File not found: ${args.file}`)- process.exit(1)- }-- const exportData = (await file.json()) as {+ const file = Bun.file(args.file)+ const exportData = (await file.json().catch(() => {})) as {info: Session.Infomessages: Array<{info: anyparts: any[]}>}+ if (!exportData) {+ process.stdout.write(`File not found: ${args.file}`)+ process.stdout.write(EOL)+ return+ }await Storage.write(["session", Instance.project.id, exportData.info.id], exportData.info)diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsxindex 0adde4c8942..1968987d0f9 100644--- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx+++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx@@ -1171,7 +1171,7 @@ ToolRegistry.register<typeof BashTool>({name: "bash",container: "block",render(props) {- const output = createMemo(() => Bun.stripANSI(props.metadata.output?.trim() ?? ""))+ const output = createMemo(() => props.metadata.output?.trim() ?? "")const { theme } = useTheme()return (<>