Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/desktop/main/dashboard-compat.ts
Original file line number Diff line number Diff line change
@@ -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。也可以先在外部浏览器打开控制台。';

Expand Down
14 changes: 13 additions & 1 deletion test/desktop/desktop-dashboard-compat.test.ts
Original file line number Diff line number Diff line change
@@ -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, {
Expand Down Expand Up @@ -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: ['#/'],
Expand Down