Reapply "feat(desktop): terminal pane (#5081)"

This reverts commit f9dcd97936.
This commit is contained in:
Adam
2025-12-04 20:32:08 -06:00
parent d82bd430f6
commit 09f522f0aa
26 changed files with 2299 additions and 402 deletions

View File

@@ -5,6 +5,7 @@ import { Instance } from "@/project/instance"
import { InstanceBootstrap } from "@/project/bootstrap"
import { Rpc } from "@/util/rpc"
import { upgrade } from "@/cli/upgrade"
import type { BunWebSocketData } from "hono/bun"
await Log.init({
print: process.argv.includes("--print-logs"),
@@ -27,7 +28,7 @@ process.on("uncaughtException", (e) => {
})
})
let server: Bun.Server<undefined>
let server: Bun.Server<BunWebSocketData>
export const rpc = {
async server(input: { port: number; hostname: string }) {
if (server) await server.stop(true)
@@ -53,7 +54,9 @@ export const rpc = {
async shutdown() {
Log.Default.info("worker shutting down")
await Instance.disposeAll()
await server.stop(true)
// TODO: this should be awaited, but ws connections are
// causing this to hang, need to revisit this
server.stop(true)
},
}