@beeos-ai/cli 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +37 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2051,13 +2051,34 @@ var init_vnc_bridge = __esm({
|
|
|
2051
2051
|
* Build the environment map used when launching vnc-bridge for a
|
|
2052
2052
|
* device. Exposed separately so the service target-spec builder
|
|
2053
2053
|
* can reuse the same logic without duplicating it.
|
|
2054
|
+
*
|
|
2055
|
+
* Env-var names are aligned with the **vnc-bridge 0.3.6** clap
|
|
2056
|
+
* definitions (`devices/vnc-bridge/src/main.rs`):
|
|
2057
|
+
*
|
|
2058
|
+
* --vnc env: VNC_ADDR=host:port (combined, NOT VNC_HOST/VNC_PORT)
|
|
2059
|
+
* --gateway env: AGENT_GATEWAY_URL
|
|
2060
|
+
* --key-file env: AGENT_KEY_FILE (single combined key, NOT BRIDGE_PRIVATE/PUBLIC)
|
|
2061
|
+
* --mqtt env: MQTT_BROKER_URL (static mode only)
|
|
2062
|
+
* --topic env: DEVICE_TOPIC (static mode only)
|
|
2063
|
+
*
|
|
2064
|
+
* Pre-1.0.21 we shipped the older naming (VNC_HOST + VNC_PORT,
|
|
2065
|
+
* BRIDGE_PRIVATE_KEY_FILE etc.) which the binary silently ignored,
|
|
2066
|
+
* causing it to bail out with `Error: Either --gateway + --key-file
|
|
2067
|
+
* (bootstrap mode) or --mqtt + --topic (static mode) is required`
|
|
2068
|
+
* at every restart. The legacy fields are retained alongside the
|
|
2069
|
+
* new ones so any older Rust build that did read them still works.
|
|
2054
2070
|
*/
|
|
2055
2071
|
buildEnv(opts) {
|
|
2072
|
+
const vncPort = opts.vncPort ?? 5900;
|
|
2056
2073
|
return {
|
|
2074
|
+
// ── vnc-bridge 0.3.6 canonical env vars ────────────────
|
|
2075
|
+
VNC_ADDR: `${opts.vncHost}:${vncPort}`,
|
|
2076
|
+
AGENT_GATEWAY_URL: opts.agentGatewayUrl,
|
|
2077
|
+
AGENT_KEY_FILE: opts.bridgePrivateKeyFile,
|
|
2078
|
+
// ── Legacy names (pre-0.3.6 / future-compat / forensic) ─
|
|
2057
2079
|
DEVICE_ID: opts.deviceId,
|
|
2058
2080
|
VNC_HOST: opts.vncHost,
|
|
2059
|
-
VNC_PORT: String(
|
|
2060
|
-
AGENT_GATEWAY_URL: opts.agentGatewayUrl,
|
|
2081
|
+
VNC_PORT: String(vncPort),
|
|
2061
2082
|
BRIDGE_PRIVATE_KEY_FILE: opts.bridgePrivateKeyFile,
|
|
2062
2083
|
BRIDGE_PUBLIC_KEY_FILE: opts.bridgePublicKeyFile,
|
|
2063
2084
|
LOG_FORMAT: "json",
|
|
@@ -7021,10 +7042,12 @@ async function tryAttachOpenclawDesktopBridge(params) {
|
|
|
7021
7042
|
if (!binary) {
|
|
7022
7043
|
return `vnc-bridge binary unavailable (download or PATH lookup failed); OpenClaw is bound but desktop streaming is unavailable. Set BEEOS_VNC_BRIDGE_BIN to override.`;
|
|
7023
7044
|
}
|
|
7045
|
+
const vncPassword = await readVncPasswordOptional();
|
|
7024
7046
|
const spec = buildOpenclawDesktopVncBridgeSpec(binary, {
|
|
7025
7047
|
deviceId: params.instanceId,
|
|
7026
7048
|
vncHost: params.vncEndpoint.host,
|
|
7027
7049
|
vncPort: params.vncEndpoint.port,
|
|
7050
|
+
...vncPassword ? { vncPassword } : {},
|
|
7028
7051
|
agentGatewayUrl: params.agentGatewayUrl,
|
|
7029
7052
|
bridgePrivateKeyFile: params.keyFile,
|
|
7030
7053
|
bridgePublicKeyFile: params.keyFile
|
|
@@ -7037,6 +7060,18 @@ async function tryAttachOpenclawDesktopBridge(params) {
|
|
|
7037
7060
|
}
|
|
7038
7061
|
return null;
|
|
7039
7062
|
}
|
|
7063
|
+
async function readVncPasswordOptional() {
|
|
7064
|
+
const env = process.env.BEEOS_VNC_PASSWORD?.trim();
|
|
7065
|
+
if (env) return env;
|
|
7066
|
+
const p = getPlatformAdapter();
|
|
7067
|
+
const file = p.joinPath(beeoHome(), "vnc.password");
|
|
7068
|
+
try {
|
|
7069
|
+
const raw = (await p.readFile(file)).trim();
|
|
7070
|
+
return raw || void 0;
|
|
7071
|
+
} catch {
|
|
7072
|
+
return void 0;
|
|
7073
|
+
}
|
|
7074
|
+
}
|
|
7040
7075
|
function buildHostname() {
|
|
7041
7076
|
const machine = os6.hostname();
|
|
7042
7077
|
const user = process.env.USER || process.env.USERNAME || "";
|