feat(baoyu-post-to-wechat): add multi-account support

Support multiple WeChat Official Accounts via EXTEND.md accounts block.
Each account gets isolated Chrome profile, credential resolution chain
(inline → prefixed env → unprefixed env), and --account CLI arg.
This commit is contained in:
Jim Liu 宝玉
2026-03-11 23:24:02 -05:00
parent c0941f8089
commit 5276fae6bd
9 changed files with 531 additions and 55 deletions
@@ -1,4 +1,5 @@
import { execSync, type ChildProcess } from 'node:child_process';
import path from 'node:path';
import process from 'node:process';
import {
@@ -80,6 +81,11 @@ export function getDefaultProfileDir(): string {
});
}
export function getAccountProfileDir(alias: string): string {
const base = getDefaultProfileDir();
return path.join(path.dirname(base), `wechat-${alias}`);
}
export interface ChromeSession {
cdp: CdpConnection;
sessionId: string;