@elizaos/plugin-computeruse 2.0.3-beta.4 → 2.0.3-beta.5
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/actor/brain.d.ts +6 -6
- package/dist/actor/brain.d.ts.map +1 -1
- package/dist/index.js +69 -4
- package/dist/index.js.map +6 -6
- package/dist/platform/capabilities.d.ts.map +1 -1
- package/dist/platform/capture.d.ts.map +1 -1
- package/dist/register-routes.js +69 -4
- package/dist/register-routes.js.map +6 -6
- package/package.json +4 -4
package/dist/actor/brain.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WS7 — Brain (full-screen reasoning).
|
|
3
3
|
*
|
|
4
|
-
* Sends one image per display (each downscaled to ~1.3 MP, the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Sends one image per display (each downscaled to ~1.3 MP, the local Gemma
|
|
5
|
+
* vision / OS-Atlas image budget) to `runtime.useModel(IMAGE_DESCRIPTION, ...)`.
|
|
6
|
+
* The model is prompted to emit a JSON `BrainOutput` describing:
|
|
7
7
|
* - the scene in one paragraph,
|
|
8
8
|
* - which display to act on,
|
|
9
9
|
* - up to N ROIs the Actor should zoom into,
|
|
@@ -55,9 +55,9 @@ export declare const BRAIN_DHASH_CACHE_MAX = 16;
|
|
|
55
55
|
*/
|
|
56
56
|
export declare const BRAIN_DHASH_HAMMING_THRESHOLD = 5;
|
|
57
57
|
/**
|
|
58
|
-
* Image-token estimate per source pixel for
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* Image-token estimate per source pixel for the local Gemma vision / OS-Atlas
|
|
59
|
+
* budget: one visual token ≈ a 28×28 (≈750 px) patch. Used only to quantify
|
|
60
|
+
* the saving when a frame is *not* attached (#9105).
|
|
61
61
|
*/
|
|
62
62
|
export declare const BRAIN_PIXELS_PER_IMAGE_TOKEN = 750;
|
|
63
63
|
/**
|
|
@@ -1 +1 @@
|
|
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BAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvD"}
|
package/dist/index.js
CHANGED
|
@@ -3428,8 +3428,26 @@ function captureLinux(tmpFile, region) {
|
|
|
3428
3428
|
runCommandBuffer("scrot", [tmpFile], 1e4);
|
|
3429
3429
|
} else if (commandExists("gnome-screenshot")) {
|
|
3430
3430
|
runCommandBuffer("gnome-screenshot", ["-f", tmpFile], 1e4);
|
|
3431
|
+
} else if (commandExists("ffmpeg")) {
|
|
3432
|
+
const display = process.env.DISPLAY || ":0";
|
|
3433
|
+
const size = region ? `${region.width}x${region.height}` : detectX11ScreenSize();
|
|
3434
|
+
const input = region ? `${display}+${region.x},${region.y}` : display;
|
|
3435
|
+
runCommandBuffer("ffmpeg", [
|
|
3436
|
+
"-y",
|
|
3437
|
+
"-loglevel",
|
|
3438
|
+
"error",
|
|
3439
|
+
"-f",
|
|
3440
|
+
"x11grab",
|
|
3441
|
+
"-video_size",
|
|
3442
|
+
size,
|
|
3443
|
+
"-i",
|
|
3444
|
+
input,
|
|
3445
|
+
"-frames:v",
|
|
3446
|
+
"1",
|
|
3447
|
+
tmpFile
|
|
3448
|
+
], 1e4);
|
|
3431
3449
|
} else {
|
|
3432
|
-
throw new Error(isWaylandSession() ? "No screenshot tool available. Install xdg-desktop-portal with gdbus/python3 for Wayland, or ImageMagick (import), scrot,
|
|
3450
|
+
throw new Error(isWaylandSession() ? "No screenshot tool available. Install xdg-desktop-portal with gdbus/python3 for Wayland, or ImageMagick (import), scrot, gnome-screenshot, or ffmpeg for X11 fallback." : "No screenshot tool available. Install ImageMagick (import), scrot, gnome-screenshot, or ffmpeg.");
|
|
3433
3451
|
}
|
|
3434
3452
|
}
|
|
3435
3453
|
function tryCaptureWaylandPortal(tmpFile) {
|
|
@@ -3444,6 +3462,15 @@ function tryCaptureWaylandPortal(tmpFile) {
|
|
|
3444
3462
|
return false;
|
|
3445
3463
|
}
|
|
3446
3464
|
}
|
|
3465
|
+
function detectX11ScreenSize() {
|
|
3466
|
+
try {
|
|
3467
|
+
const out = execSync3("xdpyinfo", { encoding: "utf8", timeout: 5000 });
|
|
3468
|
+
const m = out.match(/dimensions:\s+(\d+)x(\d+)/);
|
|
3469
|
+
if (m)
|
|
3470
|
+
return `${m[1]}x${m[2]}`;
|
|
3471
|
+
} catch {}
|
|
3472
|
+
return "1920x1080";
|
|
3473
|
+
}
|
|
3447
3474
|
function captureWindows(tmpFile, _region) {
|
|
3448
3475
|
const escapedPath = tmpFile.replace(/\//g, "\\");
|
|
3449
3476
|
const psCmd = [
|
|
@@ -3576,7 +3603,25 @@ function captureDisplayLinux(tmpFile, display) {
|
|
|
3576
3603
|
runCommandBuffer("gnome-screenshot", ["-f", tmpFile], 1e4);
|
|
3577
3604
|
return;
|
|
3578
3605
|
}
|
|
3579
|
-
|
|
3606
|
+
if (commandExists("ffmpeg")) {
|
|
3607
|
+
const displayEnv = process.env.DISPLAY || ":0";
|
|
3608
|
+
runCommandBuffer("ffmpeg", [
|
|
3609
|
+
"-y",
|
|
3610
|
+
"-loglevel",
|
|
3611
|
+
"error",
|
|
3612
|
+
"-f",
|
|
3613
|
+
"x11grab",
|
|
3614
|
+
"-video_size",
|
|
3615
|
+
`${w}x${h}`,
|
|
3616
|
+
"-i",
|
|
3617
|
+
`${displayEnv}+${x},${y}`,
|
|
3618
|
+
"-frames:v",
|
|
3619
|
+
"1",
|
|
3620
|
+
tmpFile
|
|
3621
|
+
], 1e4);
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3624
|
+
throw new Error(isWaylandSession() ? "No screenshot tool available. Install xdg-desktop-portal with gdbus/python3 for Wayland, or ImageMagick (import), scrot, gnome-screenshot, or ffmpeg for X11 fallback." : "No screenshot tool available. Install ImageMagick (import), scrot, gnome-screenshot, or ffmpeg.");
|
|
3580
3625
|
}
|
|
3581
3626
|
function captureRegionLinux(tmpFile, region) {
|
|
3582
3627
|
if (commandExists("import")) {
|
|
@@ -3597,6 +3642,24 @@ function captureRegionLinux(tmpFile, region) {
|
|
|
3597
3642
|
], 1e4);
|
|
3598
3643
|
return;
|
|
3599
3644
|
}
|
|
3645
|
+
if (commandExists("ffmpeg")) {
|
|
3646
|
+
const display = process.env.DISPLAY || ":0";
|
|
3647
|
+
runCommandBuffer("ffmpeg", [
|
|
3648
|
+
"-y",
|
|
3649
|
+
"-loglevel",
|
|
3650
|
+
"error",
|
|
3651
|
+
"-f",
|
|
3652
|
+
"x11grab",
|
|
3653
|
+
"-video_size",
|
|
3654
|
+
`${region.width}x${region.height}`,
|
|
3655
|
+
"-i",
|
|
3656
|
+
`${display}+${region.x},${region.y}`,
|
|
3657
|
+
"-frames:v",
|
|
3658
|
+
"1",
|
|
3659
|
+
tmpFile
|
|
3660
|
+
], 1e4);
|
|
3661
|
+
return;
|
|
3662
|
+
}
|
|
3600
3663
|
throw new Error("No screenshot tool available for region capture.");
|
|
3601
3664
|
}
|
|
3602
3665
|
function tryCaptureWaylandPortal2(tmpFile) {
|
|
@@ -6904,10 +6967,12 @@ function detectPlatformCapabilities(options) {
|
|
|
6904
6967
|
caps.screenshot = { available: true, tool: "scrot" };
|
|
6905
6968
|
} else if (options.commandExists("gnome-screenshot")) {
|
|
6906
6969
|
caps.screenshot = { available: true, tool: "gnome-screenshot" };
|
|
6970
|
+
} else if (options.commandExists("ffmpeg")) {
|
|
6971
|
+
caps.screenshot = { available: true, tool: "ffmpeg x11grab" };
|
|
6907
6972
|
} else {
|
|
6908
6973
|
caps.screenshot = {
|
|
6909
6974
|
available: false,
|
|
6910
|
-
tool: "none (install ImageMagick, scrot,
|
|
6975
|
+
tool: "none (install ImageMagick, scrot, gnome-screenshot, or ffmpeg)"
|
|
6911
6976
|
};
|
|
6912
6977
|
}
|
|
6913
6978
|
caps.computerUse = options.commandExists("xdotool") ? { available: true, tool: "xdotool" } : { available: false, tool: "none (install xdotool)" };
|
|
@@ -13645,5 +13710,5 @@ export {
|
|
|
13645
13710
|
AGENT_LOOP_SETTING
|
|
13646
13711
|
};
|
|
13647
13712
|
|
|
13648
|
-
//# debugId=
|
|
13713
|
+
//# debugId=771F2F7D00E9BD4564756E2164756E21
|
|
13649
13714
|
//# sourceMappingURL=index.js.map
|