disable server unless explicitly opted in (#7529)

This commit is contained in:
Dax
2026-01-09 16:33:46 -05:00
committed by GitHub
parent 75df5040ea
commit 982b71e861
6 changed files with 194 additions and 49 deletions

View File

@@ -97,7 +97,16 @@ async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
})
}
export function tui(input: { url: string; args: Args; directory?: string; onExit?: () => Promise<void> }) {
import type { EventSource } from "./context/sdk"
export function tui(input: {
url: string
args: Args
directory?: string
fetch?: typeof fetch
events?: EventSource
onExit?: () => Promise<void>
}) {
// promise to prevent immediate exit
return new Promise<void>(async (resolve) => {
const mode = await getTerminalBackgroundColor()
@@ -117,7 +126,12 @@ export function tui(input: { url: string; args: Args; directory?: string; onExit
<KVProvider>
<ToastProvider>
<RouteProvider>
<SDKProvider url={input.url} directory={input.directory}>
<SDKProvider
url={input.url}
directory={input.directory}
fetch={input.fetch}
events={input.events}
>
<SyncProvider>
<ThemeProvider mode={mode}>
<LocalProvider>