mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-30 03:54:59 +00:00
refactor: carry local runtime metadata through startup
This commit is contained in:
parent
710469cf09
commit
482dc3a15d
3 changed files with 13 additions and 2 deletions
|
|
@ -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}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue