e562099344
Fixes the core "viewer can't control the sharer even on desktop" gap. Three root
causes addressed:
- share.html DISCARDED every input-channel message (onmessage=()=>{}). It now
parses the viewer's mouse/keyboard events and forwards them to the desktop shell.
- The main desktop app had NO OS injector (it lived only in the separate agent).
Ported the nut-js injector (agent/input/inject.js) into desktop/input, wired an
inject IPC + injectInput bridge, HARD-gated behind a consent flag (rcArmed).
- /share runs in an iframe (no direct bridge access) → it postMessages input to
the top frame (home.html), which relays to the native bridge.
Consent + safety: the sharer sees an Allow/Deny prompt the first time the agent
interacts; while active a persistent "your screen is being controlled — Stop"
banner; instant revoke; auto-release on session end/teardown. Browser sharers stay
view-only (no OS injection possible). nut-js is an optionalDependency (N-API, ABI-
stable across Electron) — degrades to no-op if the native module is unavailable.
Windows-first; maps to the primary display.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Biz Connect — Desktop client
Electron shell that loads the live Connect web UI and adds native screen capture. See the overall plan in ../CLIENTS.md.
Run (dev = local testing)
npm install
npm start # dev auto-targets http://localhost:8090 (your local server)
SERVER_URL=https://remote.bizgaze.com npm start # …or point dev at production to compare
npm start IS the local desktop test — no separate "local" installer needed. In dev (unpackaged)
the shell defaults to the local server; a PACKAGED installer defaults to production. SERVER_URL
overrides either. (Bash/Git-Bash syntax above; in PowerShell: $env:SERVER_URL='…'; npm start.)
Build installers
npm run dist # electron-builder → Win NSIS / Mac dmg / Linux AppImage
Signed, trusted installers need certificates:
- Windows: an EV (or OV) code-signing certificate.
- macOS: Apple Developer ID cert + notarization (
CSC_LINK,APPLE_ID,APPLE_APP_SPECIFIC_PASSWORD).
Notes
- The window loads
${SERVER_URL}/home; relative/apiand/wsURLs work because the origin is the server itself — no web-code changes. setDisplayMediaRequestHandlerinmain.jsis what makes "Share Screen" work in Electron; it currently defaults to the primary display. Swap in a source-picker for production.- The session is persisted (
persist:bizconnect) so login survives restarts. window.__NATIVE__ === 'desktop'is exposed for the web UI to feature-detect.