mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-17 12:56:41 +02:00
refactor: carry local runtime metadata through startup
This commit is contained in:
@@ -153,10 +153,12 @@ async function initialize() {
|
||||
throw error
|
||||
})
|
||||
server = listener
|
||||
const runtime = localServer.getState().runtime
|
||||
serverReady.resolve({
|
||||
url,
|
||||
username: "opencode",
|
||||
password,
|
||||
local: runtime,
|
||||
})
|
||||
|
||||
const loadingTask = (async () => {
|
||||
|
||||
@@ -4,6 +4,11 @@ export type ServerReadyData = {
|
||||
url: string
|
||||
username: string | null
|
||||
password: string | null
|
||||
local: {
|
||||
key: string
|
||||
mode: LocalServerMode
|
||||
distro: string | null
|
||||
}
|
||||
}
|
||||
|
||||
export type SqliteMigrationProgress = { type: "InProgress"; value: number } | { type: "Done" }
|
||||
|
||||
@@ -291,7 +291,9 @@ render(() => {
|
||||
const server: ServerConnection.Sidecar = {
|
||||
displayName: "Local Server",
|
||||
type: "sidecar",
|
||||
variant: "base",
|
||||
...(data.local.mode === "wsl" && data.local.distro
|
||||
? { variant: "wsl", distro: data.local.distro }
|
||||
: { variant: "base" }),
|
||||
http: {
|
||||
url: data.url,
|
||||
username: data.username ?? undefined,
|
||||
@@ -341,7 +343,9 @@ render(() => {
|
||||
{(_) => {
|
||||
return (
|
||||
<AppInterface
|
||||
defaultServer={defaultServer.latest ?? ServerConnection.Key.make("local:windows")}
|
||||
defaultServer={
|
||||
defaultServer.latest ?? ServerConnection.Key.make(sidecar.latest?.local.key ?? "local:windows")
|
||||
}
|
||||
servers={servers()}
|
||||
router={MemoryRouter}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user