Add WhatsApp session bind/unbind to Admin Runtime, and fix related Admin JS errors.

Expose sidecar status, start/stop, QR bind, and unbind so 405 session failures are visible instead of a stuck connecting state.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-17 22:23:35 +08:00
parent 1bdbfc3b85
commit 5c6833612f
16 changed files with 1123 additions and 72 deletions

View file

@ -21,7 +21,8 @@ $bridgeSrc = Join-Path $oclawRoot "runtime\\operations\\whatsapp_bridge"
# Pin known-good versions to avoid breakage from upstream latest releases.
$baileysVersion = "7.0.0-rc.9"
$qrcodeVersion = "0.12.0"
$qrcodeTerminalVersion = "0.12.0"
$qrcodeVersion = "1.5.4"
$httpsProxyAgentVersion = "7.0.6"
$tsxVersion = "4.20.3"
$typescriptVersion = "5.8.2"
@ -38,7 +39,7 @@ try {
# Remove problematic package when present (seen on some environments with latest dependency graph).
npm.cmd remove whatsapp-rust-bridge | Out-Null
npm.cmd install --save --save-exact @whiskeysockets/baileys@$baileysVersion qrcode-terminal@$qrcodeVersion
npm.cmd install --save --save-exact @whiskeysockets/baileys@$baileysVersion qrcode-terminal@$qrcodeTerminalVersion qrcode@$qrcodeVersion
if ($LASTEXITCODE -ne 0) { throw "npm install deps failed with exit code $LASTEXITCODE" }
npm.cmd install --save --save-exact https-proxy-agent@$httpsProxyAgentVersion
if ($LASTEXITCODE -ne 0) { throw "npm install proxy deps failed with exit code $LASTEXITCODE" }
@ -49,7 +50,7 @@ try {
}
if (Test-Path $bridgeSrc) {
foreach ($name in @("baileys_runner.ts", "auth.ts", "qr.ts")) {
foreach ($name in @("baileys_runner.ts", "auth.ts", "qr.ts", "status.ts")) {
$srcPath = Join-Path $bridgeSrc $name
if (Test-Path $srcPath) {
Copy-Item -Path $srcPath -Destination (Join-Path $sidecarRoot $name) -Force

View file

@ -37,7 +37,7 @@ if (-not (Test-Path (Join-Path $sidecarRoot "baileys_runner.ts"))) {
$bridgeSrc = Join-Path $oclawRoot "runtime\\operations\\whatsapp_bridge"
if (Test-Path $bridgeSrc) {
foreach ($name in @("baileys_runner.ts", "auth.ts", "qr.ts")) {
foreach ($name in @("baileys_runner.ts", "auth.ts", "qr.ts", "status.ts")) {
$srcPath = Join-Path $bridgeSrc $name
if (Test-Path $srcPath) {
Copy-Item -Path $srcPath -Destination (Join-Path $sidecarRoot $name) -Force