dsh-desktop-min:爲 DeepSeek Harness 提供最小桌面擴展宿主

前言

DSH 的插件方式裏,Host 和 Client 插件通常用於 Web 端能力組合。第三方如果希望把擴展能力放到桌面環境裏,還需要一個桌面宿主來承載 profile、擴展入口和連接器邊界。

dsh-desktop-min 提供這樣一個最小運行時:它在安全的 Electron 窗口中啓動一個具備 Web 能力的 DSH profile,併爲第三方桌面擴展提供最小所需的基礎環境。

這是什麼

dsh-desktop-min 是一個最小、產品中立、擴展優先的 DeepSeek Harness 桌面殼。

它核心不做以下能力:Agents、workspaces、產品 UI、embedded pages、tray menus、updates、custom chrome、notifications、remote hosting。這些能力屬於獨立的 DSH packages,可以按需提供 Host、Client 或 fully trusted Native entrypoints。

倉庫地址是 https://github.com/wezoo-wb/dsh-desktop-minpackage.json 中聲明的版本爲 0.1.1,author 字段爲 dsh-desktop-min contributors,許可證爲 MIT。

核心能力

桌面殼與擴展發現

  • 在安全的 Electron 窗口中啓動一個具備 Web 能力的 DSH profile。
  • 爲第三方桌面擴展提供最小運行時。
  • 自動發現 profile 的 DSH bundles 中列出的 Native 擴展。
  • 支持通過 --extension 顯式指定 Native 擴展包或目錄。

Native 擴展能力

Native 入口可以:

  • 註冊 JSON capabilities,供 Host 和 Client 調用方使用;
  • 註冊可替換的 Host connector;
  • 讀取 Host contributions;
  • 執行 Host commands;
  • 觀察或配置主窗口;
  • 獲取 background lifetime,用於 tray-style 擴展;
  • 在包顯式聲明 full-trust 的前提下,使用完整 Electron API。

普通 Host 和 Client 插件不會獲得 Node.js、raw Electron、raw IPC 或 BrowserWindow

連接器與啓動選項

源碼啓動支持以下選項:

  • --profile
  • --devtools
  • --extension
  • --connector
  • --connector-option
  • --safe-mode

內置 local connector 支持 startupTimeoutMs,範圍是 1,000600,000 毫秒,默認值爲 60,000 毫秒。

安裝與啓用

終端用戶從 GitHub Releases 安裝對應平臺產物,然後正常啓動應用。已安裝應用不需要 Node.js 或包管理器。

該倉庫是應用源碼,不作爲 npm launcher 發佈。現有 DSH profile 組合仍由官方 dsh CLI 負責。

源碼運行與示例

源碼環境要求 Node ^22.19.0 || >=24.0.0。項目是 pnpm-only 項目,Corepack 會選用倉庫聲明的 pnpm@11.7.0

安裝依賴並執行檢查:

corepack pnpm install --frozen-lockfile
corepack pnpm run check

源碼啓動示例:

corepack pnpm start -- --profile web
corepack pnpm start -- --profile my-profile --devtools
corepack pnpm start -- --profile my-profile --extension @acme/desktop-native
corepack pnpm start -- --profile my-profile --connector @acme/remote --connector-option endpoint=wss://host.example
corepack pnpm start -- --profile my-profile --connector-option startupTimeoutMs=180000
corepack pnpm start -- --profile my-profile --safe-mode

開發運行和內置示例:

corepack pnpm run dev -- --profile web
corepack pnpm run example -- --profile web

適用場景與注意

適合需要在 DSH 桌面殼中承載第三方桌面擴展、並希望核心保持較小的場景。

如果目標是 Agents、workspaces、產品 UI、embedded pages、tray menus、updates、custom chrome、notifications 或 remote hosting,應使用對應的獨立 DSH packages。

使用 Native 擴展時需要特別注意:

  • Native 入口是本地代碼,信任影響與應用本身相同。
  • 啓用 full-trust Native 能力前,應檢查擴展源碼、full-trust 聲明和許可證。
  • remote connector 必須返回 trusted loopback Client URL,通常通過 local proxy 或 tunnel 實現。
  • core 不會把 preload 授予任意 remote page。

鏈接

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜