mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
This aligns Weixin/WhatsApp with admin-managed model routing by adding channel/account-level specialist controls, improves OSS startup resilience by skipping missing sidecars gracefully, and refreshes runbook/readme guidance for the new default behavior and Weixin OpenAI-key silent handling. Made-with: Cursor
24 lines
798 B
TypeScript
24 lines
798 B
TypeScript
import { spawn } from "node:child_process";
|
|
import path from "node:path";
|
|
|
|
function resolveLocalOpenclawBin(): string {
|
|
// Prefer local openclaw installed in the sidecar runtime (no global CLI required).
|
|
// Windows: node_modules/.bin/openclaw.cmd
|
|
return path.join(process.cwd(), "node_modules", ".bin", process.platform === "win32" ? "openclaw.cmd" : "openclaw");
|
|
}
|
|
|
|
function run(): Promise<number> {
|
|
return new Promise((resolve, reject) => {
|
|
const openclawBin = resolveLocalOpenclawBin();
|
|
const child = spawn(openclawBin, ["channels", "login", "--channel", "openclaw-weixin"], {
|
|
stdio: "inherit",
|
|
shell: true,
|
|
});
|
|
child.on("error", reject);
|
|
child.on("exit", (code) => resolve(code ?? 1));
|
|
});
|
|
}
|
|
|
|
void run().then((code) => {
|
|
process.exitCode = code;
|
|
});
|