WorkBuddy、CodeBuddy 桌面端增强助手:签到猫猫旅行成长计划查询、多账号独立备份、点切即用;免打扰模式让 AI 无人值守跑长任务;跨账号会话迁移、异常中断自动续接;暂存/快捷提示词;毛玻璃主题与更多实用功能。
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const { profileUiPortCandidates, selectPersistedUiPort } = require('../scripts/ui-port.js');
test('UI fallback ports stay disjoint across profiles and avoid the Windows dynamic range', () => {
const profiles = ['workbuddy-cn', 'workbuddy-ai', 'codebuddy-cn', 'codebuddy-intl'];
const lists = profiles.map((profile) => profileUiPortCandidates(profile));
for (let i = 0; i < lists.length; i++) {
assert.equal(new Set(lists[i]).size, lists[i].length);
assert.equal(lists[i].slice(1).every((port) => port < 46000), true);
for (let j = i + 1; j < lists.length; j++) {
assert.deepEqual(lists[i].filter((port) => lists[j].includes(port)), []);
}
}
});
test('only a current-profile UI port can be restored from persistent state', () => {
assert.equal(selectPersistedUiPort('workbuddy-cn', { profileId: 'workbuddy-cn', port: 17832 }), 17832);
assert.equal(selectPersistedUiPort('workbuddy-cn', { profileId: 'workbuddy-ai', port: 17833 }), null);
assert.equal(selectPersistedUiPort('workbuddy-cn', { profileId: 'workbuddy-cn', port: 17833 }), null);
});