feat(framework): config 调试登录账号进 profile(DebugAccount)

- DebugProfile 加 account?: DebugAccount(openid 等登录字段,仅 debug 模式生效)
- resolveBootstrap 结果加 account:debug 取 profile.account,release 恒 undefined
- staging profile 留占位 account 待填真值;接入处 setIdentity 合并 identity+account
- 同步指南

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 19:57:41 +08:00
co-authored by Claude Opus 4.8
parent 51a4ee57ac
commit d461578d6e
4 changed files with 46 additions and 4 deletions
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
import { resolveBootstrap } from '../../YouleNexus/assets/framework/config/bootstrap.ts';
import { BUILD_IDENTITY } from '../../YouleNexus/assets/framework/config/sources/defaults.ts';
import type { ConfigFetcher, RemoteConfig } from '../../YouleNexus/assets/framework/config/remote-config.ts';
import { PROFILES } from '../../YouleNexus/assets/framework/config/profiles.ts';
function fetcherReturning(config: RemoteConfig): ConfigFetcher & { calls: string[] } {
const calls: string[] = [];
@@ -87,3 +88,15 @@ test('release:原生身份仍生效(URL 的 999 无效)', async () => {
assert.equal(r.identity.agentid, 'NA');
assert.equal(r.identity.channelid, 'NC');
});
test('debug:account 来自当前 profile', async () => {
const fetcher = fetcherReturning(REMOTE);
const r = await resolveBootstrap({ mode: 'debug', win: {}, search: '?profile=staging', fetcher, isNative: false });
assert.deepEqual(r.account, PROFILES.staging.account);
});
test('release:account 恒为 undefined(不从调试配置泄漏账号)', async () => {
const fetcher = fetcherReturning(REMOTE);
const r = await resolveBootstrap({ mode: 'release', win: {}, search: '?profile=staging', fetcher, isNative: true });
assert.equal(r.account, undefined);
});