diff --git a/src/desktop/main/dashboard-compat.ts b/src/desktop/main/dashboard-compat.ts index 5dd537a12..92fde1698 100644 --- a/src/desktop/main/dashboard-compat.ts +++ b/src/desktop/main/dashboard-compat.ts @@ -1,6 +1,6 @@ import type { DashboardLocateResult } from '../shared/types.js'; -const supportedDashboardProtocolVersion = 1; +const supportedDashboardProtocolVersion = 2; const defaultCompatTimeoutMs = 3000; const cliUpgradeHint = '请升级或切换全局 botmux CLI 后重启运行时;源码开发可执行 pnpm switch:here && botmux restart。也可以先在外部浏览器打开控制台。'; diff --git a/test/desktop/desktop-dashboard-compat.test.ts b/test/desktop/desktop-dashboard-compat.test.ts index 84e78cd27..3caf9d3ff 100644 --- a/test/desktop/desktop-dashboard-compat.test.ts +++ b/test/desktop/desktop-dashboard-compat.test.ts @@ -1,6 +1,18 @@ import { describe, expect, it, vi } from 'vitest'; describe('desktop dashboard compat validation', () => { + it('accepts the current runtime compat manifest', async () => { + const { buildCompatManifest } = await import('../../src/dashboard/compat.js'); + const { validateDashboardCompat } = await import('../../src/desktop/main/dashboard-compat.js'); + const fetch = vi.fn().mockResolvedValue(response(200, buildCompatManifest({ + runtimeVersion: '3.6.0', + machineId: null, + }))); + + await expect(validateDashboardCompat('http://127.0.0.1:7891/', { fetch })) + .resolves.toEqual({ ok: true }); + }); + it('accepts the supported desktop compat manifest', async () => { const { validateDashboardCompat } = await import('../../src/desktop/main/dashboard-compat.js'); const fetch = vi.fn().mockResolvedValue(response(200, { @@ -92,7 +104,7 @@ describe('desktop dashboard compat validation', () => { schemaVersion: 1, product: 'botmux', runtimeVersion: '3.0.0', - dashboardProtocolVersion: 2, + dashboardProtocolVersion: 3, desktopShell: { supported: true }, features: ['desktop-shell'], routes: ['#/'],