@elizaos/plugin-computeruse 2.0.3-beta.4 → 2.0.3-beta.6
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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/platform/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,aAAa,GACb,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,oBAAoB,EAAE,UAAU,CAAC,CAAC,CAAC,CA4C7E,CAAC;AAEF,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,oBAAoB,GACrC,UAAU,CAEZ;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,0BAA0B,GAClC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/platform/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,aAAa,GACb,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,oBAAoB,EAAE,UAAU,CAAC,CAAC,CAAC,CA4C7E,CAAC;AAEF,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,oBAAoB,GACrC,UAAU,CAEZ;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,0BAA0B,GAClC,oBAAoB,CAsFtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/platform/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK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ASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAmBzE;AAuDD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/register-routes.js
CHANGED
|
@@ -3441,8 +3441,26 @@ function captureLinux(tmpFile, region) {
|
|
|
3441
3441
|
runCommandBuffer("scrot", [tmpFile], 1e4);
|
|
3442
3442
|
} else if (commandExists("gnome-screenshot")) {
|
|
3443
3443
|
runCommandBuffer("gnome-screenshot", ["-f", tmpFile], 1e4);
|
|
3444
|
+
} else if (commandExists("ffmpeg")) {
|
|
3445
|
+
const display = process.env.DISPLAY || ":0";
|
|
3446
|
+
const size = region ? `${region.width}x${region.height}` : detectX11ScreenSize();
|
|
3447
|
+
const input = region ? `${display}+${region.x},${region.y}` : display;
|
|
3448
|
+
runCommandBuffer("ffmpeg", [
|
|
3449
|
+
"-y",
|
|
3450
|
+
"-loglevel",
|
|
3451
|
+
"error",
|
|
3452
|
+
"-f",
|
|
3453
|
+
"x11grab",
|
|
3454
|
+
"-video_size",
|
|
3455
|
+
size,
|
|
3456
|
+
"-i",
|
|
3457
|
+
input,
|
|
3458
|
+
"-frames:v",
|
|
3459
|
+
"1",
|
|
3460
|
+
tmpFile
|
|
3461
|
+
], 1e4);
|
|
3444
3462
|
} else {
|
|
3445
|
-
throw new Error(isWaylandSession() ? "No screenshot tool available. Install xdg-desktop-portal with gdbus/python3 for Wayland, or ImageMagick (import), scrot,
|
|
3463
|
+
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.");
|
|
3446
3464
|
}
|
|
3447
3465
|
}
|
|
3448
3466
|
function tryCaptureWaylandPortal(tmpFile) {
|
|
@@ -3457,6 +3475,15 @@ function tryCaptureWaylandPortal(tmpFile) {
|
|
|
3457
3475
|
return false;
|
|
3458
3476
|
}
|
|
3459
3477
|
}
|
|
3478
|
+
function detectX11ScreenSize() {
|
|
3479
|
+
try {
|
|
3480
|
+
const out = execSync3("xdpyinfo", { encoding: "utf8", timeout: 5000 });
|
|
3481
|
+
const m = out.match(/dimensions:\s+(\d+)x(\d+)/);
|
|
3482
|
+
if (m)
|
|
3483
|
+
return `${m[1]}x${m[2]}`;
|
|
3484
|
+
} catch {}
|
|
3485
|
+
return "1920x1080";
|
|
3486
|
+
}
|
|
3460
3487
|
function captureWindows(tmpFile, _region) {
|
|
3461
3488
|
const escapedPath = tmpFile.replace(/\//g, "\\");
|
|
3462
3489
|
const psCmd = [
|
|
@@ -3598,7 +3625,25 @@ function captureDisplayLinux(tmpFile, display) {
|
|
|
3598
3625
|
runCommandBuffer("gnome-screenshot", ["-f", tmpFile], 1e4);
|
|
3599
3626
|
return;
|
|
3600
3627
|
}
|
|
3601
|
-
|
|
3628
|
+
if (commandExists("ffmpeg")) {
|
|
3629
|
+
const displayEnv = process.env.DISPLAY || ":0";
|
|
3630
|
+
runCommandBuffer("ffmpeg", [
|
|
3631
|
+
"-y",
|
|
3632
|
+
"-loglevel",
|
|
3633
|
+
"error",
|
|
3634
|
+
"-f",
|
|
3635
|
+
"x11grab",
|
|
3636
|
+
"-video_size",
|
|
3637
|
+
`${w}x${h}`,
|
|
3638
|
+
"-i",
|
|
3639
|
+
`${displayEnv}+${x},${y}`,
|
|
3640
|
+
"-frames:v",
|
|
3641
|
+
"1",
|
|
3642
|
+
tmpFile
|
|
3643
|
+
], 1e4);
|
|
3644
|
+
return;
|
|
3645
|
+
}
|
|
3646
|
+
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.");
|
|
3602
3647
|
}
|
|
3603
3648
|
function captureRegionLinux(tmpFile, region) {
|
|
3604
3649
|
if (commandExists("import")) {
|
|
@@ -3619,6 +3664,24 @@ function captureRegionLinux(tmpFile, region) {
|
|
|
3619
3664
|
], 1e4);
|
|
3620
3665
|
return;
|
|
3621
3666
|
}
|
|
3667
|
+
if (commandExists("ffmpeg")) {
|
|
3668
|
+
const display = process.env.DISPLAY || ":0";
|
|
3669
|
+
runCommandBuffer("ffmpeg", [
|
|
3670
|
+
"-y",
|
|
3671
|
+
"-loglevel",
|
|
3672
|
+
"error",
|
|
3673
|
+
"-f",
|
|
3674
|
+
"x11grab",
|
|
3675
|
+
"-video_size",
|
|
3676
|
+
`${region.width}x${region.height}`,
|
|
3677
|
+
"-i",
|
|
3678
|
+
`${display}+${region.x},${region.y}`,
|
|
3679
|
+
"-frames:v",
|
|
3680
|
+
"1",
|
|
3681
|
+
tmpFile
|
|
3682
|
+
], 1e4);
|
|
3683
|
+
return;
|
|
3684
|
+
}
|
|
3622
3685
|
throw new Error("No screenshot tool available for region capture.");
|
|
3623
3686
|
}
|
|
3624
3687
|
function tryCaptureWaylandPortal2(tmpFile) {
|
|
@@ -6974,10 +7037,12 @@ function detectPlatformCapabilities(options) {
|
|
|
6974
7037
|
caps.screenshot = { available: true, tool: "scrot" };
|
|
6975
7038
|
} else if (options.commandExists("gnome-screenshot")) {
|
|
6976
7039
|
caps.screenshot = { available: true, tool: "gnome-screenshot" };
|
|
7040
|
+
} else if (options.commandExists("ffmpeg")) {
|
|
7041
|
+
caps.screenshot = { available: true, tool: "ffmpeg x11grab" };
|
|
6977
7042
|
} else {
|
|
6978
7043
|
caps.screenshot = {
|
|
6979
7044
|
available: false,
|
|
6980
|
-
tool: "none (install ImageMagick, scrot,
|
|
7045
|
+
tool: "none (install ImageMagick, scrot, gnome-screenshot, or ffmpeg)"
|
|
6981
7046
|
};
|
|
6982
7047
|
}
|
|
6983
7048
|
caps.computerUse = options.commandExists("xdotool") ? { available: true, tool: "xdotool" } : { available: false, tool: "none (install xdotool)" };
|
|
@@ -13832,5 +13897,5 @@ registerAppRoutePluginLoader("@elizaos/plugin-computeruse", async () => {
|
|
|
13832
13897
|
return computerUsePlugin2;
|
|
13833
13898
|
});
|
|
13834
13899
|
|
|
13835
|
-
//# debugId=
|
|
13900
|
+
//# debugId=35042180BEEE0C9064756E2164756E21
|
|
13836
13901
|
//# sourceMappingURL=register-routes.js.map
|