feat(account): add multi-account switcher and passphrase vault

- Enable Windows multi-account sign-in via loopback PKCE OAuth and unified borderless quota cards with Ultra 5x/20x tier detection and instant cached-list preloading
- Keep active-account quota strictly on live host telemetry while supporting configurable background OAuth refresh intervals (10m-24h, default 1h) for saved backup accounts
- Add optional scrypt + AES-256-GCM secondary passphrase encryption with per-email AAD binding, unlock backoff, key zeroing, at-rest token minimization, and OAuth client_id allowlisting
- Harden account mutations with inline two-step switch/remove confirmations, HMAC action nonces, Webview context checks, standalone web 403 isolation, and user-only vault directory ACLs
This commit is contained in:
fish
2026-11-25 03:42:06 +09:00
parent b9dc2b960c
commit 1330b31ef7
32 changed files with 6737 additions and 364 deletions
@@ -546,6 +546,22 @@ export function normalizeModernUi(val) {
export const CONTEXT_AGENT_MODES = Object.freeze(['main', 'auto']);
export const DEFAULT_CONTEXT_AGENT_MODE = 'main';
export const ACCOUNT_QUOTA_REFRESH_MINUTES = Object.freeze([10, 30, 60, 180, 360, 720, 1440]);
export const DEFAULT_ACCOUNT_QUOTA_REFRESH_MINUTES = 60;
/**
* 归一化非当前账号的后台配额刷新间隔(分钟,默认 `60` 即 1 小时)。
*
* @param {unknown} raw
* @returns {10|30|60|180|360|720|1440}
*/
export function normalizeAccountQuotaRefreshMinutes(raw) {
const num = Number(raw);
return ACCOUNT_QUOTA_REFRESH_MINUTES.includes(num)
? /** @type {any} */ (num)
: DEFAULT_ACCOUNT_QUOTA_REFRESH_MINUTES;
}
/**
* 归一化顶栏胶囊及悬停速览浮窗的上下文代理来源(默认 `'main'` 锁定主代理,可选 `'auto'` 跟随活跃)。
*