refactor(desktop): extract qwen auth rules into adapter module

Move the Qwen page-state probe, session detection, and silent probe
helpers out of account-binder into apps/desktop-client/src/main/adapters/qwen,
mirroring the Kimi adapter layout. Generic AI auth no longer special-cases
qwen since the platform now owns its own credential rules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-06 21:33:40 +08:00
parent 14991d7801
commit ddce8b3d8d
5 changed files with 589 additions and 178 deletions
@@ -46,7 +46,7 @@ describe('generic ai auth detection', () => {
expect(isLikelyGenericAICredentialName('passport_auth_token')).toBe(true)
})
it('requires visible account signals for platform cookies that can exist anonymously', () => {
it('keeps platform-specific Qwen cookies out of generic credential matching', () => {
expect(
isLikelyPlatformAICredentialCookie('qwen', 'tongyi_sso_ticket', 'anonymous-qwen-cookie', {
displayName: '通义千问账号',
@@ -59,7 +59,10 @@ describe('generic ai auth detection', () => {
loggedOutSignalCount: 0,
challengeSignalCount: 0,
}),
).toBe(true)
).toBe(false)
})
it('allows generic credential cookies for platforms without isolated auth rules', () => {
expect(
isLikelyPlatformAICredentialCookie('deepseek', 'userToken', 'real-token-value', {
displayName: null,