feat: prepare Zhinian desktop client for pilot release

This commit is contained in:
inman
2026-04-29 10:23:20 +08:00
parent f9361e686a
commit 47b83b79fc
149 changed files with 15341 additions and 3590 deletions

View File

@@ -334,6 +334,27 @@ export async function saveWeChatAccountState(rawAccountId: string, payload: {
return accountId;
}
export async function listWeChatAccountAliases(): Promise<Array<{ accountId: string; userId: string }>> {
const accountIds = await readAccountIndex();
const aliases: Array<{ accountId: string; userId: string }> = [];
for (const accountId of accountIds) {
try {
const filePath = join(WECHAT_ACCOUNTS_DIR, `${normalizeOpenClawAccountId(accountId)}.json`);
const raw = await readFile(filePath, 'utf-8');
const parsed = JSON.parse(raw) as { userId?: unknown };
const userId = typeof parsed.userId === 'string' ? parsed.userId.trim() : '';
if (userId) {
aliases.push({ accountId: normalizeOpenClawAccountId(accountId), userId });
}
} catch {
// Ignore malformed or removed account state files.
}
}
return aliases;
}
export async function startWeChatLoginSession(options: {
sessionKey?: string;
accountId?: string;