Files
deepseek-harness/apps/desktop/src/preload.ts
T
Pine e87a3084ea feat(desktop): manual-download update check and OSS release manifest
Adds an unsigned, manual-download update flow. The main process fetches the OSS
updates/releases.json manifest (DSH_UPDATE_URL overrides), compares the latest
version, and on startup and hourly prompts to open the per-platform installer
URL; a preload bridge exposes the same check to the SPA's About "check for
updates" button, which renders the version, notes, and a download link.
scripts/generate-release-json.mjs builds the manifest from the packaged
.dmg/.exe. Windows nsis packaging is configured.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 20:45:21 +08:00

25 lines
1022 B
TypeScript

/**
* Renderer preload bridge for the desktop shell. Exposes a narrow, type-safe
* surface to the loopback SPA: a manual "check for updates" that runs in the
* main process (Node fetch, no CORS) and returns the latest release info plus a
* download URL. The renderer stays sandboxed and remote; only this bridge and
* the update check cross the process boundary.
* @module @deepseek-ai/dsh-desktop/preload
*/
import { contextBridge, ipcRenderer } from 'electron'
/** The update-check result the SPA's About section renders. */
export interface UpdateCheckResult {
readonly status: 'up-to-date' | 'update-available' | 'error'
readonly current: string
readonly latest?: string | undefined
readonly notes?: string | undefined
readonly url?: string | undefined
}
contextBridge.exposeInMainWorld('dshApp', {
/** Ask the main process for the latest release; resolves the check result. */
checkUpdate: (): Promise<UpdateCheckResult> => ipcRenderer.invoke('check-update') as Promise<UpdateCheckResult>,
})