Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(ssh): 适配 0.1.7 内核 boot 首页相对路径并对齐推荐核心版本

hairyfb5f64b1e1840
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
index 589c55a2..c4c28403 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
@@ -11,10 +11,11 @@ import { MachinesSection } from './machines-section'
// dsh-tauri-ui/client 的 dist bundle 以 ModuleLoader 工厂包裹,脱离宿主加载器
// 无法在 node 求值;mock 到同一 cssr 实例的源文件(与 dsh-tauri-panel 同款做法),
-// 组件渲染只消费 cls 字符串,不需要真实样式。
+// 组件渲染只消费 cls 字符串,不需要真实样式;通用控件转发官方 primitives 真实实现。
vi.mock('dsh-tauri-ui/client', async () => {
const mod = await import('../../../../dsh-tauri-ui/src/client/utils/cssr.ts')
- return { cssr: mod.cssr }
+ const primitives = await import('@deepseek-ai/dsh-client-ui-primitives')
+ return { cssr: mod.cssr, ...primitives }
})
afterEach(() => {
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
index 4db30a49..83cec33d 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
@@ -2,7 +2,7 @@ import type { CSSProperties, ReactNode } from 'react'
import type { SshKey } from '../locales/index'
import type { InstallResult, MachineRow, MachinesNotice, MachinesStore, MachineStatus, ProgressPhase, SecretValues } from '../store/index'
import type { MachineLifecycleState, RemoteBridge } from '../types/index'
-import { Button, Input, Modal, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'
+import { Button, Input, Modal, StateDot } from 'dsh-tauri-ui/client'
import { useEffect, useState, useSyncExternalStore } from 'react'
import { cls } from '../styles/index'
import { retrySecondsOf } from '../utils/retry'
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.test.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.test.tsx
index a7127b3a..388039b6 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.test.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.test.tsx
@@ -10,10 +10,11 @@ import { SyncPanel } from './sync-panel'
// dsh-tauri-ui/client 的 dist bundle 以 ModuleLoader 工厂包裹,脱离宿主加载器
// 无法在 node 求值;mock 到同一 cssr 实例的源文件(与 dsh-tauri-panel 同款做法),
-// 组件渲染只消费 cls 字符串,不需要真实样式。
+// 组件渲染只消费 cls 字符串,不需要真实样式;通用控件转发官方 primitives 真实实现。
vi.mock('dsh-tauri-ui/client', async () => {
const mod = await import('../../../../dsh-tauri-ui/src/client/utils/cssr.ts')
- return { cssr: mod.cssr }
+ const primitives = await import('@deepseek-ai/dsh-client-ui-primitives')
+ return { cssr: mod.cssr, ...primitives }
})
afterEach(() => {
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.tsx
index 6e95e054..74e28580 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/sync-panel.tsx
@@ -16,7 +16,7 @@ import type { ReactNode } from 'react'
import type { SshKey } from '../locales/index'
import type { MachineRow, MachinesStore } from '../store/index'
import type { SyncItemResult, SyncPluginItem, SyncSkillItem } from '../types/index'
-import { Button, Pill, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'
+import { Button, Pill, StateDot } from 'dsh-tauri-ui/client'
import { useEffect, useState, useSyncExternalStore } from 'react'
import { pluginKeyOf, skillKeyOf, syncKeyOf, toggleSelection } from '../store/index'
import { cls } from '../styles'
diff --git a/packages/dsh-tauri-ssh/src/host/service/boot-html.test.ts b/packages/dsh-tauri-ssh/src/host/service/boot-html.test.ts
index d2148e52..8799a397 100644
--- a/packages/dsh-tauri-ssh/src/host/service/boot-html.test.ts
+++ b/packages/dsh-tauri-ssh/src/host/service/boot-html.test.ts
@@ -51,6 +51,22 @@ describe('clientUrlsFromBootHtml', () => {
const html = '<script>globalThis[\'__DSH_BOOT__\'] = {"entries":[{"url":"/plugins/x/client.js"}]} ;</script>'
expect(clientUrlsFromBootHtml(3080, html)).toEqual(['http://127.0.0.1:3080/plugins/x/client.js'])
})
+
+ it('parses the relative bundle paths a 0.1.7+ boot page serves under <base href="./">', () => {
+ const html = [
+ '<script src="plugins/??@deepseek-ai/dsh-client-modules/client.js&amp;rev=1"></script>',
+ '<script>globalThis["__DSH_BOOT__"] = {"entries":[{"url":"./plugins/@deepseek-ai/dsh-client-ui-layout/client.js"}]}</script>',
+ ].join('')
+ expect(clientUrlsFromBootHtml(3082, html)).toEqual([
+ 'http://127.0.0.1:3082/plugins/??@deepseek-ai/dsh-client-modules/client.js&rev=1',
+ 'http://127.0.0.1:3082/plugins/@deepseek-ai/dsh-client-ui-layout/client.js',
+ ])
+ })
+
+ it('dedupes the absolute and relative spellings of one bundle', () => {
+ const html = '<script>globalThis["__DSH_BOOT__"] = {"entries":[{"url":"/plugins/x/client.js"},{"url":"./plugins/x/client.js"},{"url":"plugins/x/client.js"}]}</script>'
+ expect(clientUrlsFromBootHtml(3080, html)).toEqual(['http://127.0.0.1:3080/plugins/x/client.js'])
+ })
})
describe('isClientBundlePath', () => {
@@ -59,10 +75,17 @@ describe('isClientBundlePath', () => {
expect(isClientBundlePath('/plugins/??@scope/pkg/client.js&rev=1')).toBe(true)
})
+ it('accepts the relative form a 0.1.7+ boot page serves', () => {
+ expect(isClientBundlePath('plugins/@scope/pkg/client.js')).toBe(true)
+ expect(isClientBundlePath('./plugins/??@scope/pkg/client.js&rev=1')).toBe(true)
+ })
+
it('rejects foreign, protocol-relative, and non-bundle paths', () => {
expect(isClientBundlePath('https://evil.test/client.js')).toBe(false)
expect(isClientBundlePath('//evil.test/plugins/x/client.js')).toBe(false)
expect(isClientBundlePath('/assets/index.js')).toBe(false)
+ expect(isClientBundlePath('./assets/index.js')).toBe(false)
+ expect(isClientBundlePath('plugins/@scope/pkg/index.js')).toBe(false)
})
})
diff --git a/packages/dsh-tauri-ssh/src/host/service/boot-html.ts b/packages/dsh-tauri-ssh/src/host/service/boot-html.ts
index dc5eefb6..33b9fbbb 100644
--- a/packages/dsh-tauri-ssh/src/host/service/boot-html.ts
+++ b/packages/dsh-tauri-ssh/src/host/service/boot-html.ts
@@ -52,7 +52,7 @@ export function clientUrlsFromBootHtml(port: number, html: string): string[] | u
continue
const src = decodeHtmlAttribute(rest.slice(0, srcEnd))
if (isClientBundlePath(src))
- paths.push(src)
+ paths.push(normalizeClientBundlePath(src))
}
for (const entry of entries) {
const url = (entry as { url?: unknown }).url
@@ -60,7 +60,7 @@ export function clientUrlsFromBootHtml(port: number, html: string): string[] | u
continue
const decoded = decodeHtmlAttribute(url)
if (isClientBundlePath(decoded))
- paths.push(decoded)
+ paths.push(normalizeClientBundlePath(decoded))
}
const unique = [...new Set(paths)].sort()
if (unique.length === 0)
@@ -99,12 +99,40 @@ export function decodeHtmlAttribute(value: string): string {
.replaceAll('&gt;', '>')
}
+/**
+ * Drop the leading `./` segments a relative bundle path carries.
+ * @param path - the raw path.
+ */
+function trimRelativePrefix(path: string): string {
+ let rest = path
+ while (rest.startsWith('./'))
+ rest = rest.slice(2)
+ return rest
+}
+
+/**
+ * The canonical same-origin `/plugins/...` form. From 0.1.7 the kernel boot
+ * page injects `<base href="./">`, so the same bundle addresses appear in the
+ * HTML as **relative** paths (`plugins/...`, `./plugins/...`); accepting only
+ * the absolute form makes the parse fall through to the hardcoded probe. Both
+ * forms converge here, so dedupe and sort run on one set of addresses.
+ * @param path - an accepted client-bundle path.
+ */
+function normalizeClientBundlePath(path: string): string {
+ return `/${trimRelativePrefix(path).replace(/^\/+/u, '')}`
+}
+
/**
* Whether a path is a same-origin client-bundle path: under `/plugins/`,
* naming `client.js` (the combo route's `/plugins/??<pkg>/client.js&rev=…`
- * included), and never protocol-relative.
+ * included), never protocol-relative or foreign. Both the absolute form and
+ * the relative form a 0.1.7+ boot page serves are accepted.
* @param path - the candidate path.
*/
export function isClientBundlePath(path: string): boolean {
- return path.startsWith('/plugins/') && path.includes('client.js') && !path.startsWith('//')
+ const normalized = trimRelativePrefix(path)
+ if (normalized.startsWith('//'))
+ return false
+ return (normalized.startsWith('/plugins/') || normalized.startsWith('plugins/'))
+ && normalized.includes('client.js')
}
diff --git a/packages/dsh-tauri-ssh/src/host/service/bootstrap.test.ts b/packages/dsh-tauri-ssh/src/host/service/bootstrap.test.ts
index 7591865a..6a27ad73 100644
--- a/packages/dsh-tauri-ssh/src/host/service/bootstrap.test.ts
+++ b/packages/dsh-tauri-ssh/src/host/service/bootstrap.test.ts
@@ -46,7 +46,7 @@ const profile: MachineProfile = {
/** A realistic newest-first release list matching the live pkg repository. */
const RELEASES = [
{ tag: 'dsh-0.2.0-preview.1-32490000001', prerelease: true },
- { tag: 'dsh-0.1.5-rc.2-34495473237', prerelease: false },
+ { tag: 'dsh-0.1.5-rc.3-35833820356', prerelease: false },
{ tag: 'dsh-0.1.2-rc.1-33729514615', prerelease: false },
{ tag: 'dsh-0.1.1-rc.1-32342588166', prerelease: false },
]
@@ -57,7 +57,7 @@ const PKG_REPO = 'dsh-tauri-desk/deepseek-harness-pkg'
const LINUX_ASSETS = [
{
name: 'deepseek-harness-pkg-linux.zip',
- url: `https://github.com/${PKG_REPO}/releases/download/dsh-0.1.5-rc.2-34495473237/deepseek-harness-pkg-linux.zip`,
+ url: `https://github.com/${PKG_REPO}/releases/download/dsh-0.1.5-rc.3-35833820356/deepseek-harness-pkg-linux.zip`,
digest: 'sha256:6b7ecfebe3b7d779b459262943b17777427860f1b96dbf3b6f16a5074b1119a7',
},
]
@@ -72,8 +72,8 @@ function healthyFetchers(overrides: Partial<{
listReleases: () => Promise.resolve(RELEASES),
listAssets: () => Promise.resolve(LINUX_ASSETS),
npmDist: () => Promise.resolve({
- url: 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
- mirrorUrl: 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
+ url: 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
+ mirrorUrl: 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
integrity: 'sha512-ZXhhZQ==',
}),
...overrides,
@@ -195,12 +195,12 @@ describe('planRemoteInstall', () => {
expect(plan.dsh.kind).toBe('pkg-zip')
if (plan.dsh.kind !== 'pkg-zip')
throw new Error('expected pkg-zip')
- expect(plan.dsh.tag).toBe('dsh-0.1.5-rc.2-34495473237')
+ expect(plan.dsh.tag).toBe('dsh-0.1.5-rc.3-35833820356')
expect(plan.dsh.digest).toBe(LINUX_ASSETS[0]?.digest)
expect(plan.dsh.urls[0]).toBe(LINUX_ASSETS[0]?.url)
expect(plan.dsh.urls[1]).toContain('ghfast.top/')
expect(plan.dshEntry).toBe('node_modules/@deepseek-ai/dsh/lib/bin.js')
- expect(plan.dshVersion).toBe('0.1.5-rc.2')
+ expect(plan.dshVersion).toBe('0.1.5-rc.3')
expect(plan.notes).toEqual([])
})
@@ -209,8 +209,8 @@ describe('planRemoteInstall', () => {
expect(plan.dsh.kind).toBe('npm-tgz')
if (plan.dsh.kind === 'npm-tgz') {
expect(plan.dsh.urls).toEqual([
- 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
- 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
+ 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
+ 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
])
// The SRI digest arrives normalized into the script-verifiable hex form.
expect(plan.dsh.integrity).toBe(`sha512:${Buffer.from('ZXhhZQ==', 'base64').toString('hex')}`)
@@ -236,7 +236,7 @@ describe('planRemoteInstall', () => {
}))
expect(plan.dsh.kind).toBe('npm-tgz')
if (plan.dsh.kind === 'npm-tgz')
- expect(plan.dsh.urls[0]).toBe('https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz')
+ expect(plan.dsh.urls[0]).toBe('https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz')
expect(plan.notes.join('\n')).toContain('未取得')
})
@@ -246,7 +246,7 @@ describe('planRemoteInstall', () => {
}))
if (plan.dsh.kind !== 'pkg-zip')
throw new Error('expected pkg-zip')
- expect(plan.dsh.tag).toBe('dsh-0.1.5-rc.2-34495473237')
+ expect(plan.dsh.tag).toBe('dsh-0.1.5-rc.3-35833820356')
expect(plan.notes.join('\n')).toContain('release 列表获取失败')
})
@@ -303,7 +303,7 @@ describe('buildInstallScript', () => {
it('arm64: assembles node_modules on the remote with registry fallback', async () => {
const plan = await planRemoteInstall('Linux 5.15 aarch64', {}, healthyFetchers())
const script = buildInstallScript(plan)
- expect(script).toContain('https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz')
+ expect(script).toContain('https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz')
expect(script).toContain(`sha512:${Buffer.from('ZXhhZQ==', 'base64').toString('hex')}`)
expect(script).toContain('install --prod --silent --registry')
expect(script).toContain('"$ROOT/dependencies/pnpm/bin/pnpm.cjs"')
@@ -323,7 +323,7 @@ describe('buildInstallScript', () => {
})
it('dedupes the npm tarball URL pair when the packument already carries the mirror', async () => {
- const mirrorOnly = 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz'
+ const mirrorOnly = 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz'
const plan = await planRemoteInstall('Linux 5.15 aarch64', {}, healthyFetchers({
npmDist: () => Promise.resolve({ url: mirrorOnly, mirrorUrl: mirrorOnly, integrity: 'sha512-ZXhhZQ==' }),
}))
@@ -496,7 +496,7 @@ describe('install script execution (real POSIX sh)', () => {
mkdirSync(join(dshStage, 'package', 'lib'), { recursive: true })
writeFileSync(join(dshStage, 'package', 'package.json'), '{"name":"@deepseek-ai/dsh","version":"0.1.2-rc.1"}\n')
writeFileSync(join(dshStage, 'package', 'lib', 'bin.js'), '#!/usr/bin/env node\nvoid 0\n')
- const dshTgz = join(served, 'dsh-0.1.5-rc.2.tgz')
+ const dshTgz = join(served, 'dsh-0.1.5-rc.3.tgz')
await promisify(execFile)('tar', ['-czf', dshTgz, '-C', dshStage, 'package'])
const digest = (file: string, algorithm: 'sha256' | 'sha512', encoding: 'hex' | 'base64') =>
@@ -505,8 +505,8 @@ describe('install script execution (real POSIX sh)', () => {
const basePlan = await planRemoteInstall('Linux 5.15 aarch64', {}, healthyFetchers({
npmDist: () => Promise.resolve({
- url: 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
- mirrorUrl: 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.2.tgz',
+ url: 'https://registry.npmjs.org/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
+ mirrorUrl: 'https://registry.npmmirror.com/@deepseek-ai/dsh/-/dsh-0.1.5-rc.3.tgz',
// The real SRI form npm serves; the planner normalizes it to hex.
integrity: `sha512-${digest(dshTgz, 'sha512', 'base64')}`,
}),
diff --git a/packages/dsh-tauri-ssh/src/host/service/version.test.ts b/packages/dsh-tauri-ssh/src/host/service/version.test.ts
index 3a208c0c..ba60aa9f 100644
--- a/packages/dsh-tauri-ssh/src/host/service/version.test.ts
+++ b/packages/dsh-tauri-ssh/src/host/service/version.test.ts
@@ -1,3 +1,4 @@
+import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
import {
FALLBACK_DSH_TAG,
@@ -14,7 +15,7 @@ import {
/** A realistic newest-first release list (test tags republishing included). */
const RELEASES = [
{ tag: 'dsh-0.2.0-preview.1-32490000001', prerelease: true },
- { tag: 'dsh-0.1.5-rc.2-34495473237', prerelease: false },
+ { tag: 'dsh-0.1.5-rc.3-35833820356', prerelease: false },
{ tag: 'dsh-0.1.2-rc.1-33729514615', prerelease: false },
{ tag: 'dsh-0.1.1-rc.1-32342588166', prerelease: false },
{ tag: 'dsh-0.1.0-rc.8-32342588167', prerelease: false },
@@ -52,7 +53,7 @@ describe('isPreviewTag', () => {
describe('pickReleaseTag', () => {
it('resolves the recommended version onto its release tag (recommended path)', () => {
const resolved = pickReleaseTag(RELEASES)
- expect(resolved).toMatchObject({ tag: 'dsh-0.1.5-rc.2-34495473237', version: RECOMMENDED_DSH_VERSION, source: 'recommended' })
+ expect(resolved).toMatchObject({ tag: 'dsh-0.1.5-rc.3-35833820356', version: RECOMMENDED_DSH_VERSION, source: 'recommended' })
expect(resolved.notes).toEqual([])
})
@@ -93,7 +94,7 @@ describe('pickReleaseTag', () => {
it('falls back to the newest stable release when the recommended version is absent', () => {
const resolved = pickReleaseTag(RELEASES, { recommended: '0.3.0' })
expect(resolved.source).toBe('latest-stable')
- expect(resolved.tag).toBe('dsh-0.1.5-rc.2-34495473237')
+ expect(resolved.tag).toBe('dsh-0.1.5-rc.3-35833820356')
expect(resolved.notes[0]).toContain('回退最新稳定')
})
@@ -123,6 +124,15 @@ describe('pickReleaseTag', () => {
})
})
+describe('recommended version lockstep', () => {
+ it('follows the desktop mainline version-recommend.json', () => {
+ const manifest = JSON.parse(
+ readFileSync(new URL('../../../../../src-tauri/resources/version-recommend.json', import.meta.url), 'utf8'),
+ ) as { dsh: string }
+ expect(RECOMMENDED_DSH_VERSION).toBe(manifest.dsh)
+ })
+})
+
describe('install source repository mapping', () => {
it('anchors the official repository at the verified org', () => {
expect(OFFICIAL_INSTALL_REPO).toBe('https://github.com/deepseek-ai/deepseek-harness.git')
diff --git a/packages/dsh-tauri-ssh/src/host/service/version.ts b/packages/dsh-tauri-ssh/src/host/service/version.ts
index c87115ae..10019807 100644
--- a/packages/dsh-tauri-ssh/src/host/service/version.ts
+++ b/packages/dsh-tauri-ssh/src/host/service/version.ts
@@ -37,14 +37,14 @@ export interface ResolvedDshTag {
* installs pin this version instead of following whatever "latest" happens
* to be.
*/
-export const RECOMMENDED_DSH_VERSION = '0.1.5-rc.2'
+export const RECOMMENDED_DSH_VERSION = '0.1.5-rc.3'
/**
* The last known-good packaged release tag, used when version resolution
* fails (offline, rate-limited, or the recommended version vanished). A
* concrete tag — never an unknown version.
*/
-export const FALLBACK_DSH_TAG = 'dsh-0.1.5-rc.2-34495473237'
+export const FALLBACK_DSH_TAG = 'dsh-0.1.5-rc.3-35833820356'
/** The official DSH project repository (org verified on GitHub). */
export const OFFICIAL_INSTALL_REPO = 'https://github.com/deepseek-ai/deepseek-harness.git'
diff --git a/packages/dsh-tauri-ssh/src/host/storage/index.ts b/packages/dsh-tauri-ssh/src/host/storage/index.ts
index dfaa9fd1..d242d6a0 100644
--- a/packages/dsh-tauri-ssh/src/host/storage/index.ts
+++ b/packages/dsh-tauri-ssh/src/host/storage/index.ts
@@ -98,8 +98,8 @@ export interface Config {
*/
installRepo?: string
/**
- * DSH version pin for the binary install: a semver (`0.1.5-rc.2`) or a full
- * release tag (`dsh-0.1.5-rc.2-34495473237`). Defaults to the recommended
+ * DSH version pin for the binary install: a semver (`0.1.5-rc.3`) or a full
+ * release tag (`dsh-0.1.5-rc.3-35833820356`). Defaults to the recommended
* version; unresolvable pins fall back to the latest stable release.
*/
installRef?: string