@elizaos/plugin-screenshare 2.0.3-beta.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # @elizaos/plugin-screenshare
2
+
3
+ Screen Share plugin for elizaOS. Streams the local desktop and accepts authenticated remote mouse and keyboard control from any connected viewer.
4
+
5
+ ## What it does
6
+
7
+ When loaded, the plugin:
8
+
9
+ - Creates and manages **screen-share sessions** backed by the local machine's desktop.
10
+ - Serves a **self-contained viewer** (`/api/apps/screenshare/viewer`) — a single HTML page that streams live screenshots and relays clicks, key presses, and scrolls back to the host.
11
+ - Provides an **operator surface** inside the elizaOS dashboard (a React panel) where you can start, stop, copy, and open host sessions, and connect to a remote session by entering its server URL, session ID, and token.
12
+ - Exposes a **TUI view** (`/screenshare/tui`) that renders session and capability state in a terminal-friendly layout.
13
+ - All desktop capture and input dispatch is handled by `@elizaos/plugin-computeruse`, which supports macOS, Linux, and Windows.
14
+
15
+ ## Capabilities
16
+
17
+ | Feature | Detail |
18
+ |---------|--------|
19
+ | Screen streaming | Polls live desktop screenshots at ~500 ms intervals; serves as PNG |
20
+ | Mouse control | Click, double-click, right-click, move, scroll |
21
+ | Keyboard control | Text input (up to 4096 chars), keypress combos (Enter, Escape, Tab, arrows, etc.) |
22
+ | Window listing | Lists open desktop windows |
23
+ | Session management | Create, list, and stop sessions; one active local session at a time |
24
+ | Capability detection | Reports which desktop control features are available on the host platform |
25
+
26
+ ## Enabling the plugin
27
+
28
+ Add `@elizaos/plugin-screenshare` to the agent's plugin list:
29
+
30
+ ```typescript
31
+ import screensharePlugin from "@elizaos/plugin-screenshare";
32
+
33
+ const agent = new AgentRuntime({
34
+ // ...
35
+ plugins: [screensharePlugin],
36
+ });
37
+ ```
38
+
39
+ The plugin is an elizaOS **app** (`kind: app`, `launchType: connect`). It is gated behind a valid app session — the viewer URL includes a session ID and a per-session bearer token that are generated at session creation time.
40
+
41
+ ## API overview
42
+
43
+ All routes live under `/api/apps/screenshare/`:
44
+
45
+ | Method | Path | Description |
46
+ |--------|------|-------------|
47
+ | GET | `/capabilities` | Platform + desktop control capability flags |
48
+ | GET | `/windows` | List open desktop windows |
49
+ | GET | `/sessions` | All sessions (public fields; no tokens) |
50
+ | POST | `/session` | Start a new session; returns `{ session, token, viewerUrl }` |
51
+ | GET | `/session/:id` | Session state (requires token) |
52
+ | GET | `/session/:id/frame` | Current desktop screenshot as PNG (requires token) |
53
+ | POST | `/session/:id/input` | Send mouse/keyboard input (requires token) |
54
+ | POST | `/session/:id/stop` | Stop the session (requires token) |
55
+ | GET | `/viewer` | Self-contained viewer HTML |
56
+
57
+ Token is passed via `?token=` query param, `X-Screenshare-Token` header, or `Authorization: Bearer <token>` header.
58
+
59
+ ## Security notes
60
+
61
+ - Tokens are 24-byte cryptographically random base64url strings generated per session.
62
+ - Session creation is rate-limited to 10 requests per IP per minute.
63
+ - Keypress input is validated against an allowlist (`[A-Za-z0-9+_.,: -]`, max 128 chars).
64
+ - Text input is capped at 4096 characters.
65
+ - Sessions are in-memory only; they are lost on process restart.
66
+
67
+ ## Requirements
68
+
69
+ Desktop capture and input control depend on the host platform. The `/capabilities` endpoint reports which features are available. For full functionality, the agent must run on a machine with a graphical display session (not headless).
70
+
71
+ ## Development
72
+
73
+ ```bash
74
+ bun run --cwd plugins/plugin-screenshare build # full build
75
+ bun run --cwd plugins/plugin-screenshare test # run tests
76
+ bun run --cwd plugins/plugin-screenshare clean # remove dist
77
+ ```
78
+
79
+ See `CLAUDE.md` / `AGENTS.md` for the agent-oriented layout and extension guide.
Binary file
@@ -0,0 +1,31 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" role="img" aria-labelledby="title desc">
2
+ <title id="title">Screen Share</title>
3
+ <desc id="desc">A desktop screen with a remote cursor and connection waves.</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="128" y1="96" x2="896" y2="928" gradientUnits="userSpaceOnUse">
6
+ <stop offset="0" stop-color="#15181d"/>
7
+ <stop offset=".52" stop-color="#263229"/>
8
+ <stop offset="1" stop-color="#101418"/>
9
+ </linearGradient>
10
+ <linearGradient id="screen" x1="214" y1="258" x2="810" y2="678" gradientUnits="userSpaceOnUse">
11
+ <stop offset="0" stop-color="#f0f7f8"/>
12
+ <stop offset="1" stop-color="#88b9bd"/>
13
+ </linearGradient>
14
+ <linearGradient id="cursor" x1="514" y1="462" x2="708" y2="766" gradientUnits="userSpaceOnUse">
15
+ <stop offset="0" stop-color="#f8f2d8"/>
16
+ <stop offset="1" stop-color="#d2a84a"/>
17
+ </linearGradient>
18
+ </defs>
19
+ <rect width="1024" height="1024" rx="216" fill="url(#bg)"/>
20
+ <path d="M212 276c0-39.8 32.2-72 72-72h456c39.8 0 72 32.2 72 72v296c0 39.8-32.2 72-72 72H284c-39.8 0-72-32.2-72-72V276Z" fill="#06080a" opacity=".82"/>
21
+ <path d="M252 292c0-24.3 19.7-44 44-44h432c24.3 0 44 19.7 44 44v264c0 24.3-19.7 44-44 44H296c-24.3 0-44-19.7-44-44V292Z" fill="url(#screen)"/>
22
+ <path d="M302 530c80-90 143-94 226-16 60 57 124 56 194-2v56H302v-38Z" fill="#1d373f" opacity=".34"/>
23
+ <path d="M352 331h220" stroke="#203238" stroke-width="28" stroke-linecap="round" opacity=".35"/>
24
+ <path d="M352 390h312" stroke="#203238" stroke-width="20" stroke-linecap="round" opacity=".28"/>
25
+ <path d="M430 644h164l24 92h74c17.7 0 32 14.3 32 32s-14.3 32-32 32H332c-17.7 0-32-14.3-32-32s14.3-32 32-32h74l24-92Z" fill="#090c0f" opacity=".9"/>
26
+ <path d="M516 440 736 690l-118 12 59 123-76 36-58-122-82 86 55-385Z" fill="url(#cursor)" stroke="#15120a" stroke-width="22" stroke-linejoin="round"/>
27
+ <path d="M736 296c92 24 158 107 158 206" fill="none" stroke="#d7c06a" stroke-width="28" stroke-linecap="round" opacity=".92"/>
28
+ <path d="M752 392c38 23 62 64 62 110" fill="none" stroke="#d7c06a" stroke-width="24" stroke-linecap="round" opacity=".78"/>
29
+ <circle cx="220" cy="764" r="54" fill="#63c4b4" opacity=".94"/>
30
+ <path d="M199 765h42M220 744v42" stroke="#0b1516" stroke-width="18" stroke-linecap="round"/>
31
+ </svg>
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@elizaos/plugin-screenshare",
3
+ "version": "2.0.3-beta.2",
4
+ "type": "module",
5
+ "description": "Screen Share app: authenticated desktop screen streaming and remote mouse/keyboard control for local, Linux, macOS, and Windows runtimes.",
6
+ "main": "./dist/index.js",
7
+ "exports": {
8
+ "./package.json": "./package.json",
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./*.css": "./dist/*.css",
15
+ "./*": {
16
+ "types": "./dist/*.d.ts",
17
+ "import": "./dist/*.js",
18
+ "default": "./dist/*.js"
19
+ }
20
+ },
21
+ "dependencies": {
22
+ "@elizaos/agent": "2.0.3-beta.2",
23
+ "@elizaos/app-core": "2.0.3-beta.2",
24
+ "@elizaos/core": "2.0.3-beta.2",
25
+ "@elizaos/plugin-computeruse": "2.0.3-beta.2",
26
+ "@elizaos/shared": "2.0.3-beta.2",
27
+ "@elizaos/ui": "2.0.3-beta.2",
28
+ "lucide-react": "^1.0.0"
29
+ },
30
+ "peerDependencies": {
31
+ "react": "*",
32
+ "react-dom": "*"
33
+ },
34
+ "agentConfig": {
35
+ "pluginType": "elizaos:plugin:1.0.0",
36
+ "pluginParameters": {}
37
+ },
38
+ "elizaos": {
39
+ "kind": "app",
40
+ "app": {
41
+ "displayName": "Screen Share",
42
+ "category": "utility",
43
+ "heroImage": "assets/hero.png",
44
+ "launchType": "connect",
45
+ "launchUrl": "/api/apps/screenshare/viewer",
46
+ "capabilities": [
47
+ "screen-stream",
48
+ "mouse-control",
49
+ "keyboard-control",
50
+ "remote-support"
51
+ ],
52
+ "runtimePlugin": "@elizaos/plugin-screenshare",
53
+ "bridgeExport": "./dist/index.js",
54
+ "viewer": {
55
+ "url": "/api/apps/screenshare/viewer",
56
+ "sandbox": "allow-scripts allow-same-origin allow-forms allow-pointer-lock"
57
+ },
58
+ "session": {
59
+ "mode": "spectate-and-steer",
60
+ "features": [
61
+ "commands",
62
+ "telemetry",
63
+ "suggestions"
64
+ ]
65
+ }
66
+ }
67
+ },
68
+ "publishConfig": {
69
+ "access": "public"
70
+ },
71
+ "types": "./dist/index.d.ts",
72
+ "scripts": {
73
+ "build": "bun run build:js && bun run build:views && bun run build:types",
74
+ "clean": "rm -rf dist",
75
+ "test": "vitest run --config vitest.config.ts",
76
+ "build:js": "tsup --config ../tsup.plugin-packages.shared.ts",
77
+ "build:views": "bunx --bun vite build --config vite.config.views.ts",
78
+ "build:types": "tsc --noCheck -p tsconfig.build.json"
79
+ },
80
+ "files": [
81
+ "assets",
82
+ "dist"
83
+ ],
84
+ "devDependencies": {
85
+ "@testing-library/react": "^16.3.2",
86
+ "@types/react": "^19.0.0",
87
+ "@types/react-dom": "^19.0.0",
88
+ "jsdom": "^29.0.0",
89
+ "react": "^19.0.0",
90
+ "react-dom": "^19.0.0",
91
+ "tsup": "^8.5.1",
92
+ "vite": "^8.0.0",
93
+ "vitest": "^4.1.5"
94
+ },
95
+ "gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
96
+ }