@beeos-ai/cli 1.0.5 → 1.0.7
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 +14 -10
- package/package.json +11 -10
- package/scripts/install.ps1 +19 -1
- package/scripts/install.sh +20 -2
package/dist/index.js
CHANGED
|
@@ -88,6 +88,10 @@ function isLocalhostUrl(url) {
|
|
|
88
88
|
}
|
|
89
89
|
function beeoHome() {
|
|
90
90
|
const p = getPlatformAdapter();
|
|
91
|
+
const envOverride = globalThis.process?.env?.BEEOS_HOME;
|
|
92
|
+
if (envOverride && envOverride.trim() !== "") {
|
|
93
|
+
return envOverride.trim();
|
|
94
|
+
}
|
|
91
95
|
return p.joinPath(p.homeDir(), ".beeos");
|
|
92
96
|
}
|
|
93
97
|
async function ensureDirs() {
|
|
@@ -1877,7 +1881,7 @@ var init_scrcpy_bridge = __esm({
|
|
|
1877
1881
|
},
|
|
1878
1882
|
/**
|
|
1879
1883
|
* Build the environment map used when launching scrcpy-bridge for a
|
|
1880
|
-
* device. Exposed separately so the
|
|
1884
|
+
* device. Exposed separately so the service target-spec builder
|
|
1881
1885
|
* can reuse the same logic without duplicating it.
|
|
1882
1886
|
*
|
|
1883
1887
|
* scrcpy-bridge authenticates to EMQX exclusively via Agent Gateway
|
|
@@ -1907,8 +1911,8 @@ var init_scrcpy_bridge = __esm({
|
|
|
1907
1911
|
},
|
|
1908
1912
|
/**
|
|
1909
1913
|
* Spawn scrcpy-bridge detached for a single device. Kept for callers
|
|
1910
|
-
* that haven't migrated to the
|
|
1911
|
-
* `buildScrcpyBridgeTargetSpec` +
|
|
1914
|
+
* that haven't migrated to the service manager yet — new code should
|
|
1915
|
+
* use `buildScrcpyBridgeTargetSpec` + `ServiceManager.install`.
|
|
1912
1916
|
*/
|
|
1913
1917
|
async spawnForDevice(opts, progress) {
|
|
1914
1918
|
const binary = await this.ensureInstalled(progress);
|
|
@@ -1959,7 +1963,7 @@ var init_vnc_bridge = __esm({
|
|
|
1959
1963
|
},
|
|
1960
1964
|
/**
|
|
1961
1965
|
* Build the environment map used when launching vnc-bridge for a
|
|
1962
|
-
* device. Exposed separately so the
|
|
1966
|
+
* device. Exposed separately so the service target-spec builder
|
|
1963
1967
|
* can reuse the same logic without duplicating it.
|
|
1964
1968
|
*/
|
|
1965
1969
|
buildEnv(opts) {
|
|
@@ -1985,8 +1989,8 @@ var init_vnc_bridge = __esm({
|
|
|
1985
1989
|
},
|
|
1986
1990
|
/**
|
|
1987
1991
|
* Spawn vnc-bridge detached for a single device. Kept for callers
|
|
1988
|
-
* that haven't migrated to the
|
|
1989
|
-
* `buildVncBridgeTargetSpec` +
|
|
1992
|
+
* that haven't migrated to the service manager yet — new code should
|
|
1993
|
+
* use `buildVncBridgeTargetSpec` + `ServiceManager.install`.
|
|
1990
1994
|
*/
|
|
1991
1995
|
async spawnForDevice(opts, progress) {
|
|
1992
1996
|
const binary = await this.ensureInstalled(progress);
|
|
@@ -2251,7 +2255,7 @@ var init_detect = __esm({
|
|
|
2251
2255
|
}
|
|
2252
2256
|
});
|
|
2253
2257
|
|
|
2254
|
-
// ../core/dist/
|
|
2258
|
+
// ../core/dist/service-target-spec.js
|
|
2255
2259
|
function buildOpenclawTargetSpec(ctx) {
|
|
2256
2260
|
const isMjs = ctx.agentBinary.endsWith(".mjs") || ctx.agentBinary.endsWith(".js");
|
|
2257
2261
|
const command = isMjs ? "node" : ctx.agentBinary;
|
|
@@ -2322,8 +2326,8 @@ function buildVncBridgeTargetSpec(binary, opts) {
|
|
|
2322
2326
|
label: `vnc-bridge (${opts.deviceId})`
|
|
2323
2327
|
};
|
|
2324
2328
|
}
|
|
2325
|
-
var
|
|
2326
|
-
"../core/dist/
|
|
2329
|
+
var init_service_target_spec = __esm({
|
|
2330
|
+
"../core/dist/service-target-spec.js"() {
|
|
2327
2331
|
"use strict";
|
|
2328
2332
|
init_scrcpy_bridge();
|
|
2329
2333
|
init_vnc_bridge();
|
|
@@ -3490,7 +3494,7 @@ var init_dist = __esm({
|
|
|
3490
3494
|
init_registry();
|
|
3491
3495
|
init_local_agent();
|
|
3492
3496
|
init_detect();
|
|
3493
|
-
|
|
3497
|
+
init_service_target_spec();
|
|
3494
3498
|
init_services();
|
|
3495
3499
|
}
|
|
3496
3500
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beeos-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "BeeOS CLI — run AI agents from your desktop",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
"scripts/",
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"type-check": "tsc --noEmit",
|
|
20
|
+
"lint": "eslint src/",
|
|
21
|
+
"test": "vitest run --passWithNoTests",
|
|
22
|
+
"prepublishOnly": "pnpm build"
|
|
23
|
+
},
|
|
17
24
|
"dependencies": {
|
|
18
25
|
"@noble/ed25519": "^2.2.0",
|
|
19
26
|
"@noble/hashes": "^1.7.0",
|
|
@@ -27,25 +34,19 @@
|
|
|
27
34
|
"which": "^5.0.0"
|
|
28
35
|
},
|
|
29
36
|
"devDependencies": {
|
|
37
|
+
"@beeos/core": "workspace:*",
|
|
30
38
|
"@types/node": "^22.0.0",
|
|
31
39
|
"@types/proper-lockfile": "^4.1.4",
|
|
32
40
|
"@types/qrcode": "^1.5.5",
|
|
33
41
|
"@types/which": "^3.0.4",
|
|
34
42
|
"tsup": "^8.3.0",
|
|
35
43
|
"typescript": "^5.7.0",
|
|
36
|
-
"vitest": "^3.0.0"
|
|
37
|
-
"@beeos/core": "0.1.0"
|
|
44
|
+
"vitest": "^3.0.0"
|
|
38
45
|
},
|
|
39
46
|
"engines": {
|
|
40
47
|
"node": ">=18"
|
|
41
48
|
},
|
|
42
49
|
"publishConfig": {
|
|
43
50
|
"access": "public"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"build": "tsup",
|
|
47
|
-
"type-check": "tsc --noEmit",
|
|
48
|
-
"lint": "eslint src/",
|
|
49
|
-
"test": "vitest run --passWithNoTests"
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
}
|
package/scripts/install.ps1
CHANGED
|
@@ -191,6 +191,15 @@ function Invoke-BeeosCli {
|
|
|
191
191
|
} else {
|
|
192
192
|
Write-BeeWarn "npx not found, installing globally..."
|
|
193
193
|
& npm install -g $CliPackage
|
|
194
|
+
if ($LASTEXITCODE -ne 0) {
|
|
195
|
+
Write-BeeError "npm install -g $CliPackage failed."
|
|
196
|
+
Write-BeeError ""
|
|
197
|
+
Write-BeeError "Common fixes:"
|
|
198
|
+
Write-BeeError " - EEXIST on beeos from another package:"
|
|
199
|
+
Write-BeeError " npm uninstall -g beeos # then re-run installer"
|
|
200
|
+
Write-BeeError " - EACCES / permission error: run PowerShell as Administrator"
|
|
201
|
+
exit 1
|
|
202
|
+
}
|
|
194
203
|
& beeos @args
|
|
195
204
|
}
|
|
196
205
|
}
|
|
@@ -228,7 +237,16 @@ if ($beeosCmd) {
|
|
|
228
237
|
}
|
|
229
238
|
"upgrade" {
|
|
230
239
|
Write-BeeInfo "Upgrading $CliPackage..."
|
|
231
|
-
|
|
240
|
+
& npm install -g $CliPackage
|
|
241
|
+
if ($LASTEXITCODE -ne 0) {
|
|
242
|
+
Write-BeeError "npm install -g $CliPackage failed."
|
|
243
|
+
Write-BeeError ""
|
|
244
|
+
Write-BeeError "Common fixes:"
|
|
245
|
+
Write-BeeError " - EEXIST on beeos from another package:"
|
|
246
|
+
Write-BeeError " npm uninstall -g beeos # then re-run installer"
|
|
247
|
+
Write-BeeError " - EACCES / permission error: run PowerShell as Administrator"
|
|
248
|
+
exit 1
|
|
249
|
+
}
|
|
232
250
|
}
|
|
233
251
|
"rerun" {
|
|
234
252
|
Write-BeeInfo "Reusing existing install."
|
package/scripts/install.sh
CHANGED
|
@@ -304,7 +304,16 @@ run_cli() {
|
|
|
304
304
|
exec npx --yes "$CLI_PACKAGE" "$subcmd" "$@"
|
|
305
305
|
else
|
|
306
306
|
warn "npx not found, installing globally..."
|
|
307
|
-
npm install -g "$CLI_PACKAGE"
|
|
307
|
+
if ! npm install -g "$CLI_PACKAGE"; then
|
|
308
|
+
error "npm install -g ${CLI_PACKAGE} failed."
|
|
309
|
+
error ""
|
|
310
|
+
error "Common fixes:"
|
|
311
|
+
error " - EEXIST on /bin/beeos from another package:"
|
|
312
|
+
error " npm uninstall -g beeos # then re-run installer"
|
|
313
|
+
error " - EACCES permission error:"
|
|
314
|
+
error " use a node version manager (nvm / fnm) or sudo"
|
|
315
|
+
exit 1
|
|
316
|
+
fi
|
|
308
317
|
exec beeos "$subcmd" "$@"
|
|
309
318
|
fi
|
|
310
319
|
}
|
|
@@ -342,7 +351,16 @@ main() {
|
|
|
342
351
|
upgrade)
|
|
343
352
|
info "Upgrading ${CLI_PACKAGE}..."
|
|
344
353
|
if command -v npm &>/dev/null; then
|
|
345
|
-
npm install -g "$CLI_PACKAGE"
|
|
354
|
+
if ! npm install -g "$CLI_PACKAGE"; then
|
|
355
|
+
error "npm install -g ${CLI_PACKAGE} failed."
|
|
356
|
+
error ""
|
|
357
|
+
error "Common fixes:"
|
|
358
|
+
error " - EEXIST on /bin/beeos from another package:"
|
|
359
|
+
error " npm uninstall -g beeos # then re-run installer"
|
|
360
|
+
error " - EACCES permission error:"
|
|
361
|
+
error " use a node version manager (nvm / fnm) or sudo"
|
|
362
|
+
exit 1
|
|
363
|
+
fi
|
|
346
364
|
fi
|
|
347
365
|
;;
|
|
348
366
|
rerun)
|