wip(vscode-ide-companion): OnboardingPage

This commit is contained in:
yiliang114
2025-12-13 15:51:34 +08:00
parent 8b29dd130e
commit 5841370b1a
17 changed files with 603 additions and 114 deletions

View File

@@ -0,0 +1,26 @@
/**
* @license
* Copyright 2025 Qwen Team
* SPDX-License-Identifier: Apache-2.0
*/
const AUTH_ERROR_PATTERNS = [
'Authentication required',
'(code: -32000)',
'Unauthorized',
'Invalid token',
'Session expired',
];
export const isAuthenticationRequiredError = (error: unknown): boolean => {
if (!error) {
return false;
}
const message =
error instanceof Error
? error.message
: typeof error === 'string'
? error
: String(error);
return AUTH_ERROR_PATTERNS.some((pattern) => message.includes(pattern));
};