From 61c4d0a0d07352c0984ca3926e5b2a421fe6ace2 Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Tue, 10 Feb 2026 12:21:54 +0800 Subject: [PATCH] desktop: align platform typing for ssh helpers --- packages/desktop/src/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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()