diff --git a/packages/desktop/src/index.tsx b/packages/desktop/src/index.tsx index 77ffd645f1..c0ed6f26e3 100644 --- a/packages/desktop/src/index.tsx +++ b/packages/desktop/src/index.tsx @@ -48,6 +48,14 @@ type SshPrompt = { id: string; prompt: string } const sshPromptEvent = "opencode:ssh-prompt" const sshPrompts: SshPrompt[] = [] +type DesktopPlatform = Platform & { + serverKey: (url: string) => string + isServerLocal: (url: string) => boolean + sshConnect: (command: string) => Promise<{ url: string; key: string; password: string | null }> + sshDisconnect: (key: string) => Promise + wsAuth: (url: string) => { username: string; password: string } | null +} + void listen("ssh_prompt", (event) => { sshPrompts.push(event.payload) window.dispatchEvent(new CustomEvent(sshPromptEvent)) @@ -92,7 +100,7 @@ const listenForDeepLinks = async () => { const createPlatform = ( password: Accessor, sshState: { get: Accessor; set: (value: boolean) => void }, -): Platform => ({ +): DesktopPlatform => ({ platform: "desktop", os: (() => { const type = ostype()