@elizaos/plugin-computeruse 2.0.3-beta.2 → 2.0.3-beta.3
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/actions/clipboard.d.ts +22 -0
- package/dist/actions/clipboard.d.ts.map +1 -0
- package/dist/actions/helpers.d.ts +33 -0
- package/dist/actions/helpers.d.ts.map +1 -0
- package/dist/actions/progress.d.ts +26 -0
- package/dist/actions/progress.d.ts.map +1 -0
- package/dist/actions/use-computer-agent.d.ts +113 -0
- package/dist/actions/use-computer-agent.d.ts.map +1 -0
- package/dist/actions/use-computer.d.ts +3 -0
- package/dist/actions/use-computer.d.ts.map +1 -0
- package/dist/actions/window-handlers.d.ts +11 -0
- package/dist/actions/window-handlers.d.ts.map +1 -0
- package/dist/actions/window.d.ts +11 -0
- package/dist/actions/window.d.ts.map +1 -0
- package/dist/actor/actor.d.ts +84 -0
- package/dist/actor/actor.d.ts.map +1 -0
- package/dist/actor/agent-callbacks.d.ts +128 -0
- package/dist/actor/agent-callbacks.d.ts.map +1 -0
- package/dist/actor/agent-loop.d.ts +134 -0
- package/dist/actor/agent-loop.d.ts.map +1 -0
- package/dist/actor/aosp-input-actor.d.ts +87 -0
- package/dist/actor/aosp-input-actor.d.ts.map +1 -0
- package/dist/actor/brain.d.ts +195 -0
- package/dist/actor/brain.d.ts.map +1 -0
- package/dist/actor/cascade.d.ts +92 -0
- package/dist/actor/cascade.d.ts.map +1 -0
- package/dist/actor/computer-interface.d.ts +276 -0
- package/dist/actor/computer-interface.d.ts.map +1 -0
- package/dist/actor/dispatch.d.ts +24 -0
- package/dist/actor/dispatch.d.ts.map +1 -0
- package/dist/actor/index.d.ts +12 -0
- package/dist/actor/index.d.ts.map +1 -0
- package/dist/actor/types.d.ts +94 -0
- package/dist/actor/types.d.ts.map +1 -0
- package/dist/approval-manager.d.ts +29 -0
- package/dist/approval-manager.d.ts.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13649 -0
- package/dist/index.js.map +68 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +42 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/tools.d.ts +53 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mobile/android-bridge.d.ts +263 -0
- package/dist/mobile/android-bridge.d.ts.map +1 -0
- package/dist/mobile/android-scene.d.ts +52 -0
- package/dist/mobile/android-scene.d.ts.map +1 -0
- package/dist/mobile/android-trajectory.d.ts +66 -0
- package/dist/mobile/android-trajectory.d.ts.map +1 -0
- package/dist/mobile/index.d.ts +19 -0
- package/dist/mobile/index.d.ts.map +1 -0
- package/dist/mobile/ios-app-intent-registry.d.ts +20 -0
- package/dist/mobile/ios-app-intent-registry.d.ts.map +1 -0
- package/dist/mobile/ios-bridge.d.ts +359 -0
- package/dist/mobile/ios-bridge.d.ts.map +1 -0
- package/dist/mobile/ios-computer-interface.d.ts +160 -0
- package/dist/mobile/ios-computer-interface.d.ts.map +1 -0
- package/dist/mobile/mobile-computer-interface.d.ts +142 -0
- package/dist/mobile/mobile-computer-interface.d.ts.map +1 -0
- package/dist/mobile/mobile-screen-capture.d.ts +64 -0
- package/dist/mobile/mobile-screen-capture.d.ts.map +1 -0
- package/dist/mobile/ocr-provider.d.ts +187 -0
- package/dist/mobile/ocr-provider.d.ts.map +1 -0
- package/dist/mobile/ocr-provider.js +111 -0
- package/dist/mobile/ocr-provider.js.map +10 -0
- package/dist/osworld/action-converter.d.ts +38 -0
- package/dist/osworld/action-converter.d.ts.map +1 -0
- package/dist/osworld/adapter.d.ts +79 -0
- package/dist/osworld/adapter.d.ts.map +1 -0
- package/dist/osworld/types.d.ts +69 -0
- package/dist/osworld/types.d.ts.map +1 -0
- package/dist/parity/index.d.ts +9 -0
- package/dist/parity/index.d.ts.map +1 -0
- package/dist/parity/parity-matrix.d.ts +82 -0
- package/dist/parity/parity-matrix.d.ts.map +1 -0
- package/dist/parity/screenspot.d.ts +56 -0
- package/dist/parity/screenspot.d.ts.map +1 -0
- package/dist/platform/a11y.d.ts +64 -0
- package/dist/platform/a11y.d.ts.map +1 -0
- package/dist/platform/browser.d.ts +61 -0
- package/dist/platform/browser.d.ts.map +1 -0
- package/dist/platform/capabilities.d.ts +33 -0
- package/dist/platform/capabilities.d.ts.map +1 -0
- package/dist/platform/capture.d.ts +65 -0
- package/dist/platform/capture.d.ts.map +1 -0
- package/dist/platform/clipboard.d.ts +24 -0
- package/dist/platform/clipboard.d.ts.map +1 -0
- package/dist/platform/coords.d.ts +73 -0
- package/dist/platform/coords.d.ts.map +1 -0
- package/dist/platform/desktop.d.ts +56 -0
- package/dist/platform/desktop.d.ts.map +1 -0
- package/dist/platform/displays.d.ts +97 -0
- package/dist/platform/displays.d.ts.map +1 -0
- package/dist/platform/driver.d.ts +49 -0
- package/dist/platform/driver.d.ts.map +1 -0
- package/dist/platform/file-ops.d.ts +27 -0
- package/dist/platform/file-ops.d.ts.map +1 -0
- package/dist/platform/helpers.d.ts +60 -0
- package/dist/platform/helpers.d.ts.map +1 -0
- package/dist/platform/launch.d.ts +54 -0
- package/dist/platform/launch.d.ts.map +1 -0
- package/dist/platform/normalized-coords.d.ts +46 -0
- package/dist/platform/normalized-coords.d.ts.map +1 -0
- package/dist/platform/nut-driver.d.ts +86 -0
- package/dist/platform/nut-driver.d.ts.map +1 -0
- package/dist/platform/permissions.d.ts +33 -0
- package/dist/platform/permissions.d.ts.map +1 -0
- package/dist/platform/process-list.d.ts +32 -0
- package/dist/platform/process-list.d.ts.map +1 -0
- package/dist/platform/ps-host.d.ts +77 -0
- package/dist/platform/ps-host.d.ts.map +1 -0
- package/dist/platform/screenshot-errors.d.ts +54 -0
- package/dist/platform/screenshot-errors.d.ts.map +1 -0
- package/dist/platform/screenshot-quality.d.ts +11 -0
- package/dist/platform/screenshot-quality.d.ts.map +1 -0
- package/dist/platform/screenshot.d.ts +16 -0
- package/dist/platform/screenshot.d.ts.map +1 -0
- package/dist/platform/security.d.ts +20 -0
- package/dist/platform/security.d.ts.map +1 -0
- package/dist/platform/terminal.d.ts +38 -0
- package/dist/platform/terminal.d.ts.map +1 -0
- package/dist/platform/wayland-portal.d.ts +25 -0
- package/dist/platform/wayland-portal.d.ts.map +1 -0
- package/dist/platform/windows-list.d.ts +78 -0
- package/dist/platform/windows-list.d.ts.map +1 -0
- package/dist/providers/computer-state.d.ts +9 -0
- package/dist/providers/computer-state.d.ts.map +1 -0
- package/dist/providers/scene.d.ts +21 -0
- package/dist/providers/scene.d.ts.map +1 -0
- package/dist/register-routes.d.ts +2 -0
- package/dist/register-routes.d.ts.map +1 -0
- package/dist/register-routes.js +13836 -0
- package/dist/register-routes.js.map +71 -0
- package/dist/routes/computer-use-compat-routes.d.ts +29 -0
- package/dist/routes/computer-use-compat-routes.d.ts.map +1 -0
- package/dist/routes/computer-use-routes.d.ts +3 -0
- package/dist/routes/computer-use-routes.d.ts.map +1 -0
- package/dist/routes/sandbox-routes.d.ts +53 -0
- package/dist/routes/sandbox-routes.d.ts.map +1 -0
- package/dist/sandbox/docker-backend.d.ts +69 -0
- package/dist/sandbox/docker-backend.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +62 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/qemu-backend.d.ts +48 -0
- package/dist/sandbox/qemu-backend.d.ts.map +1 -0
- package/dist/sandbox/remote-guest.d.ts +72 -0
- package/dist/sandbox/remote-guest.d.ts.map +1 -0
- package/dist/sandbox/sandbox-driver.d.ts +41 -0
- package/dist/sandbox/sandbox-driver.d.ts.map +1 -0
- package/dist/sandbox/surface-types.d.ts +17 -0
- package/dist/sandbox/surface-types.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +138 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/wsb-backend.d.ts +48 -0
- package/dist/sandbox/wsb-backend.d.ts.map +1 -0
- package/dist/scene/a11y-provider.d.ts +83 -0
- package/dist/scene/a11y-provider.d.ts.map +1 -0
- package/dist/scene/apps.d.ts +39 -0
- package/dist/scene/apps.d.ts.map +1 -0
- package/dist/scene/dhash.d.ts +105 -0
- package/dist/scene/dhash.d.ts.map +1 -0
- package/dist/scene/ocr-adapter.d.ts +64 -0
- package/dist/scene/ocr-adapter.d.ts.map +1 -0
- package/dist/scene/scene-builder.d.ts +107 -0
- package/dist/scene/scene-builder.d.ts.map +1 -0
- package/dist/scene/scene-types.d.ts +70 -0
- package/dist/scene/scene-types.d.ts.map +1 -0
- package/dist/scene/screen-state.d.ts +105 -0
- package/dist/scene/screen-state.d.ts.map +1 -0
- package/dist/scene/serialize.d.ts +28 -0
- package/dist/scene/serialize.d.ts.map +1 -0
- package/dist/security/browser-script-policy.d.ts +9 -0
- package/dist/security/browser-script-policy.d.ts.map +1 -0
- package/dist/services/computer-use-service.d.ts +142 -0
- package/dist/services/computer-use-service.d.ts.map +1 -0
- package/dist/services/desktop-control.d.ts +35 -0
- package/dist/services/desktop-control.d.ts.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/vision-context-provider.d.ts +32 -0
- package/dist/services/vision-context-provider.d.ts.map +1 -0
- package/dist/types.d.ts +385 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +16 -5
- package/registry-entry.json +74 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform process listing.
|
|
3
|
+
*
|
|
4
|
+
* The WS6 scene-builder joins running processes with windows to produce the
|
|
5
|
+
* `apps[]` field of a Scene. The contract is intentionally minimal — pid,
|
|
6
|
+
* executable/display name, and a best-effort foreground flag if cheap to
|
|
7
|
+
* obtain. Anything richer (memory, cpu, parent pid) is out of scope here
|
|
8
|
+
* because the scene-builder runs every active-poll frame and must stay
|
|
9
|
+
* cheap.
|
|
10
|
+
*
|
|
11
|
+
* Per-OS source:
|
|
12
|
+
* - Linux : `/proc/<pid>/comm` and `/proc/<pid>/status`. Pure FS read,
|
|
13
|
+
* no shell out. ~5ms for 300 processes.
|
|
14
|
+
* - macOS : `ps -axo pid=,comm=` — built-in BSD ps.
|
|
15
|
+
* - Windows: PowerShell `Get-Process | Select Id, ProcessName`.
|
|
16
|
+
* - Android: returns `[]` in this JS helper; the `UsageStatsManager`
|
|
17
|
+
* integration is owned by WS8's native side. We expose the
|
|
18
|
+
* function shape so the scene-builder doesn't have to branch.
|
|
19
|
+
*
|
|
20
|
+
* Failure semantics:
|
|
21
|
+
* - A single un-readable process is skipped, not propagated.
|
|
22
|
+
* - A complete enumeration failure returns `[]` and the scene-builder logs
|
|
23
|
+
* once per platform-mode at warn.
|
|
24
|
+
*/
|
|
25
|
+
export interface ProcessInfo {
|
|
26
|
+
pid: number;
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function listProcesses(): ProcessInfo[];
|
|
30
|
+
export declare function parsePsOutput(text: string): ProcessInfo[];
|
|
31
|
+
export declare function parseWindowsProcessJson(text: string): ProcessInfo[];
|
|
32
|
+
//# sourceMappingURL=process-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-list.d.ts","sourceRoot":"","sources":["../../src/platform/process-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,IAAI,WAAW,EAAE,CAM7C;AAmDD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAkBzD;AAmBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAmBnE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warm PowerShell host (Windows-only) — eliminates the cold-spawn tax.
|
|
3
|
+
*
|
|
4
|
+
* On Windows, every capability that shells out to `powershell.exe`
|
|
5
|
+
* (screen capture, clipboard, window/display enumeration) pays the cost of
|
|
6
|
+
* starting a fresh process. On Defender-heavy hosts real-time AV scans each new
|
|
7
|
+
* process image, which measured **~10-12s per cold `powershell.exe` spawn** on a
|
|
8
|
+
* build box (see #9581). The CUA scene pipeline grabs the screen — and several
|
|
9
|
+
* dirty regions — every turn, so that tax compounds.
|
|
10
|
+
*
|
|
11
|
+
* This module keeps ONE long-lived `powershell.exe` alive and feeds it commands
|
|
12
|
+
* over stdin, reading results back over stdout. The first call pays the cold
|
|
13
|
+
* spawn once; every call after that runs in the already-warm process
|
|
14
|
+
* (sub-second). It is a pure latency optimization: callers wrap their existing
|
|
15
|
+
* one-shot PowerShell invocation and fall back to it transparently whenever the
|
|
16
|
+
* host is unavailable, disabled, or errors — so behavior is unchanged, only
|
|
17
|
+
* faster.
|
|
18
|
+
*
|
|
19
|
+
* The loop runs from a temp `.ps1` via `powershell -File` (NOT `-Command -`,
|
|
20
|
+
* which would consume stdin to build the program and starve the loop's own
|
|
21
|
+
* `ReadLine`). `-File` reads the program from disk, leaving stdin free for the
|
|
22
|
+
* loop to read request lines.
|
|
23
|
+
*
|
|
24
|
+
* Protocol (host side is a tiny ReadLine server loop, see `SERVER_LOOP`):
|
|
25
|
+
* - JS writes ONE line per request: `<token> <base64-utf8-script>\n`.
|
|
26
|
+
* base64 guarantees the payload is single-line and escaping-free.
|
|
27
|
+
* - The host decodes the script, runs it in a child scope (`& {…}` via a
|
|
28
|
+
* fresh ScriptBlock, so request state never leaks), then writes the script's
|
|
29
|
+
* stdout followed by the bare `<token>` (no newline). On a terminating
|
|
30
|
+
* error it writes `PSHOSTERR:<message>` before the token.
|
|
31
|
+
* - JS accumulates stdout until it sees `<token>`; everything before it is the
|
|
32
|
+
* response. A `PSHOSTERR:` prefix is surfaced as a rejection so the caller
|
|
33
|
+
* falls back to its one-shot path.
|
|
34
|
+
*
|
|
35
|
+
* Requests are serialized through a single promise chain — one in flight at a
|
|
36
|
+
* time over the one pipe. That is fine: each request is now sub-second, so even
|
|
37
|
+
* a handful of dirty-region captures per turn complete far faster than a single
|
|
38
|
+
* cold spawn used to.
|
|
39
|
+
*
|
|
40
|
+
* Disable entirely with `COMPUTERUSE_PS_HOST=0`.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Whether the warm host is usable on this platform / configuration. Callers
|
|
44
|
+
* should check this before attempting {@link runPsHost} and skip straight to
|
|
45
|
+
* their one-shot path when false.
|
|
46
|
+
*/
|
|
47
|
+
export declare function psHostAvailable(): boolean;
|
|
48
|
+
/** Tear the host down (test cleanup / unrecoverable state). */
|
|
49
|
+
export declare function shutdownPsHost(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Run a PowerShell script in the warm host and resolve with its stdout (UTF-8).
|
|
52
|
+
* Serialized against other in-flight requests. Rejects (so the caller can fall
|
|
53
|
+
* back to a one-shot spawn) on host-start failure, script error, timeout, or
|
|
54
|
+
* unexpected host exit.
|
|
55
|
+
*
|
|
56
|
+
* @param script PowerShell source. Runs in a child scope; assemblies
|
|
57
|
+
* `System.Windows.Forms` + `System.Drawing` are preloaded.
|
|
58
|
+
* @param timeoutMs Per-request budget.
|
|
59
|
+
*/
|
|
60
|
+
export declare function runPsHost(script: string, timeoutMs: number): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Best-effort pre-warm: pay the one-time cold spawn during service init instead
|
|
63
|
+
* of on the first capture/clipboard call. Never rejects — if the host can't
|
|
64
|
+
* start, callers transparently fall back to one-shot spawns.
|
|
65
|
+
*/
|
|
66
|
+
export declare function warmPsHost(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Owner-initiated dispose (service stop). Unlike {@link shutdownPsHost} (which
|
|
69
|
+
* leaves the host respawnable for the next call — used by the timeout path),
|
|
70
|
+
* this latches spawning OFF so an in-flight fire-and-forget warm continuation
|
|
71
|
+
* cannot resurrect a powershell.exe after the service has stopped. A later
|
|
72
|
+
* {@link warmPsHost} re-enables it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function disposePsHost(): void;
|
|
75
|
+
/** Test-only: reset failure latch so a fresh attempt can be made. */
|
|
76
|
+
export declare function __resetPsHostFailures(): void;
|
|
77
|
+
//# sourceMappingURL=ps-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ps-host.d.ts","sourceRoot":"","sources":["../../src/platform/ps-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAkEH;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAiCD,+DAA+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAsBrC;AAsGD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAS1C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured screenshot error contract (issue #9105, M3.5).
|
|
3
|
+
*
|
|
4
|
+
* Capture can fail for several distinct reasons, and a caller (the CUA Brain,
|
|
5
|
+
* the GET_SCREEN op, the approval/telemetry layer) wants to react differently
|
|
6
|
+
* to each: a missing OS permission needs a "grant access" prompt; a missing CLI
|
|
7
|
+
* tool needs an "install scrot/ImageMagick" hint; an empty buffer or a timeout
|
|
8
|
+
* is a transient retry. Before this contract, those were indistinguishable —
|
|
9
|
+
* callers had to regex the human-readable message.
|
|
10
|
+
*
|
|
11
|
+
* This module adds a machine-readable {@link ScreenshotErrorCode} **additively**:
|
|
12
|
+
* `tagScreenshotError` annotates the *existing* thrown error object with a code
|
|
13
|
+
* rather than replacing it, so a `PermissionDeniedError` keeps its identity
|
|
14
|
+
* (`isPermissionDeniedError` stays true) while also gaining a
|
|
15
|
+
* `screenshotErrorCode` of `"permission_denied"`. No existing caller breaks; new
|
|
16
|
+
* callers can switch on the code.
|
|
17
|
+
*/
|
|
18
|
+
export type ScreenshotErrorCode =
|
|
19
|
+
/** An OS privacy permission (Screen Recording / Accessibility) is denied. */
|
|
20
|
+
"permission_denied"
|
|
21
|
+
/** No screenshot CLI tool is installed (e.g. Linux without scrot/import). */
|
|
22
|
+
| "tool_missing"
|
|
23
|
+
/** The capture tool ran but produced an empty/zero-byte image. */
|
|
24
|
+
| "empty_output"
|
|
25
|
+
/** The capture command exceeded its timeout. */
|
|
26
|
+
| "timeout"
|
|
27
|
+
/** Any other capture failure. */
|
|
28
|
+
| "capture_failed";
|
|
29
|
+
/** An `Error` carrying a machine-readable {@link ScreenshotErrorCode}. */
|
|
30
|
+
export interface ScreenshotError extends Error {
|
|
31
|
+
readonly screenshotErrorCode: ScreenshotErrorCode;
|
|
32
|
+
/** The capture operation that failed (e.g. `screenshot_capture`). */
|
|
33
|
+
readonly operation: string;
|
|
34
|
+
/** Underlying error message, when this wraps a lower-level failure. */
|
|
35
|
+
readonly details?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function isScreenshotError(value: unknown): value is ScreenshotError;
|
|
38
|
+
export declare function createScreenshotError(code: ScreenshotErrorCode, operation: string, message: string, details?: string): ScreenshotError;
|
|
39
|
+
/**
|
|
40
|
+
* Map any thrown value to a {@link ScreenshotErrorCode} by inspecting its type
|
|
41
|
+
* and message. Permission denials win first (they are typed); the rest are
|
|
42
|
+
* recognized from the well-known message shapes the capture functions throw.
|
|
43
|
+
* Pure — exported so the mapping has a single, testable source of truth.
|
|
44
|
+
*/
|
|
45
|
+
export declare function classifyScreenshotErrorCode(error: unknown): ScreenshotErrorCode;
|
|
46
|
+
/**
|
|
47
|
+
* Annotate `error` with a {@link ScreenshotErrorCode} and return it. Additive:
|
|
48
|
+
* an `Error` (including a `PermissionDeniedError`) is mutated in place so its
|
|
49
|
+
* identity and existing fields are preserved; a non-`Error` value is wrapped in
|
|
50
|
+
* a fresh {@link ScreenshotError}. Idempotent — an already-tagged error is
|
|
51
|
+
* returned unchanged.
|
|
52
|
+
*/
|
|
53
|
+
export declare function tagScreenshotError(error: unknown, operation: string): ScreenshotError;
|
|
54
|
+
//# sourceMappingURL=screenshot-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot-errors.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,MAAM,mBAAmB;AAC7B,6EAA6E;AAC3E,mBAAmB;AACrB,6EAA6E;GAC3E,cAAc;AAChB,kEAAkE;GAChE,cAAc;AAChB,gDAAgD;GAC9C,SAAS;AACX,iCAAiC;GAC/B,gBAAgB,CAAC;AAErB,0EAA0E;AAC1E,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAO1E;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,mBAAmB,EACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,eAAe,CAOjB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,mBAAmB,CAuBrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,GAChB,eAAe,CAWjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ScreenshotQuality {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
sampledPixels: number;
|
|
5
|
+
colorBuckets: number;
|
|
6
|
+
dominantRatio: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function analyzePngScreenshot(buffer: Buffer): ScreenshotQuality;
|
|
9
|
+
export declare function screenshotQualityIssues(label: string, quality: ScreenshotQuality): string[];
|
|
10
|
+
export declare function assertScreenshotBase64NotBlank(screenshot: string | undefined, label: string, minBytes?: number): void;
|
|
11
|
+
//# sourceMappingURL=screenshot-quality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot-quality.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot-quality.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAoDD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CA8EtE;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GACzB,MAAM,EAAE,CAeV;AAED,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,SAAM,GACb,IAAI,CAoBN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform screenshot capture.
|
|
3
|
+
*
|
|
4
|
+
* Ported from:
|
|
5
|
+
* - coasty-ai/open-computer-use screenshot.ts (Apache 2.0)
|
|
6
|
+
* - eliza sandbox-routes.ts captureScreenshot()
|
|
7
|
+
*
|
|
8
|
+
* Uses native CLI tools — no Electron dependency.
|
|
9
|
+
* Full logical resolution is preserved (critical for accurate coordinate mapping).
|
|
10
|
+
*/
|
|
11
|
+
import type { ScreenRegion } from "../types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Capture a screenshot of the entire screen (or a region) and return as a Buffer (PNG).
|
|
14
|
+
*/
|
|
15
|
+
export declare function captureScreenshot(region?: ScreenRegion): Buffer;
|
|
16
|
+
//# sourceMappingURL=screenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiBhD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAoD/D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PathValidationResult {
|
|
2
|
+
allowed: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CommandRiskResult {
|
|
6
|
+
blocked: boolean;
|
|
7
|
+
reason?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function validateFilePath(filePath: string, operation: "read" | "write" | "delete"): PathValidationResult;
|
|
10
|
+
export type SafeFileTargetResult = PathValidationResult & {
|
|
11
|
+
resolvedPath?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Resolve and re-validate file paths after lstat/realpath to reduce TOCTOU /
|
|
15
|
+
* symlink escapes (GHSA-qmf5-p9x5-9xr5).
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSafeFileTarget(filePath: string, operation: "read" | "write" | "delete"): Promise<SafeFileTargetResult>;
|
|
18
|
+
export declare function sanitizeChildEnv(): Record<string, string | undefined>;
|
|
19
|
+
export declare function checkDangerousCommand(command: string): CommandRiskResult;
|
|
20
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/platform/security.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+LD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACrC,oBAAoB,CA8FtB;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAQF;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAuE/B;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAerE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAkBxE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TerminalActionResult } from "../types.js";
|
|
2
|
+
export type TerminalSession = {
|
|
3
|
+
id: string;
|
|
4
|
+
cwd: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
lastOutput?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function connectTerminal(arg?: string | {
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}): TerminalActionResult;
|
|
11
|
+
export declare function executeTerminal(params: {
|
|
12
|
+
command: string;
|
|
13
|
+
timeoutSeconds?: number;
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
}): Promise<TerminalActionResult>;
|
|
17
|
+
export declare function readTerminal(arg?: string | {
|
|
18
|
+
session_id?: string;
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
}): TerminalActionResult;
|
|
21
|
+
export declare function typeTerminal(arg: string | {
|
|
22
|
+
text: string;
|
|
23
|
+
session_id?: string;
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
}): TerminalActionResult;
|
|
26
|
+
export declare function clearTerminal(arg?: string | {
|
|
27
|
+
session_id?: string;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
}): TerminalActionResult;
|
|
30
|
+
export declare function closeTerminal(arg?: string | {
|
|
31
|
+
session_id?: string;
|
|
32
|
+
sessionId?: string;
|
|
33
|
+
}): TerminalActionResult;
|
|
34
|
+
export declare function closeAllTerminalSessions(): void;
|
|
35
|
+
export declare function listTerminalSessions(): TerminalSession[];
|
|
36
|
+
/** Alias of executeTerminal — upstream calls it execute_command. */
|
|
37
|
+
export declare const executeCommand: typeof executeTerminal;
|
|
38
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/platform/terminal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AA2BF,wBAAgB,eAAe,CAC7B,GAAG,CAAC,EAAE,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,oBAAoB,CAgBtB;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAwFhC;AAED,wBAAgB,YAAY,CAC1B,GAAG,CAAC,EAAE,MAAM,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD,oBAAoB,CAatB;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACtE,oBAAoB,CAUtB;AAED,wBAAgB,aAAa,CAC3B,GAAG,CAAC,EAAE,MAAM,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD,oBAAoB,CAStB;AAED,wBAAgB,aAAa,CAC3B,GAAG,CAAC,EAAE,MAAM,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD,oBAAoB,CAetB;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED,wBAAgB,oBAAoB,IAAI,eAAe,EAAE,CAExD;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc,wBAAkB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface WaylandPortalCaptureOptions {
|
|
2
|
+
readonly interactive?: boolean;
|
|
3
|
+
readonly timeoutMs?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface PortalScreenshotResponse {
|
|
6
|
+
readonly responseCode: number;
|
|
7
|
+
readonly uri?: string;
|
|
8
|
+
}
|
|
9
|
+
interface WaylandSessionEnv {
|
|
10
|
+
readonly WAYLAND_DISPLAY?: string;
|
|
11
|
+
readonly XDG_SESSION_TYPE?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function isWaylandSession(env?: WaylandSessionEnv): boolean;
|
|
14
|
+
export declare function canUseWaylandScreenshotPortal(): boolean;
|
|
15
|
+
export declare function captureWaylandPortalScreenshot(tmpFile: string, options?: WaylandPortalCaptureOptions): void;
|
|
16
|
+
export declare function parsePortalRequestHandle(output: string): string | null;
|
|
17
|
+
export declare function parsePortalScreenshotResponse(output: string, handle?: string): PortalScreenshotResponse | null;
|
|
18
|
+
export declare function portalFileUriToPath(uri: string): string;
|
|
19
|
+
export declare const WAYLAND_PORTAL_DBUS_TARGET: {
|
|
20
|
+
readonly busName: "org.freedesktop.portal.Desktop";
|
|
21
|
+
readonly objectPath: "/org/freedesktop/portal/desktop";
|
|
22
|
+
readonly method: "org.freedesktop.portal.Screenshot.Screenshot";
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=wayland-portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wayland-portal.d.ts","sourceRoot":"","sources":["../../src/platform/wayland-portal.ts"],"names":[],"mappings":"AAyGA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAOjE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2BAAgC,GACxC,IAAI,CAyCN;AAoBD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEtE;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,wBAAwB,GAAG,IAAI,CAajC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform window listing and management.
|
|
3
|
+
*
|
|
4
|
+
* Ported from:
|
|
5
|
+
* - coasty-ai/open-computer-use local-executor.ts window handlers (Apache 2.0)
|
|
6
|
+
* - eliza sandbox-routes.ts listWindows()
|
|
7
|
+
*/
|
|
8
|
+
import type { ScreenRegion, ScreenSize, WindowInfo } from "../types.js";
|
|
9
|
+
export declare function findWindowsByQuery(query: string, windows?: WindowInfo[]): WindowInfo[];
|
|
10
|
+
export declare function resolveWindowMatch(queryOrId: string, windows?: WindowInfo[]): WindowInfo | null;
|
|
11
|
+
export declare function listWindows(): WindowInfo[];
|
|
12
|
+
/**
|
|
13
|
+
* The currently-focused / frontmost window (#9170 M12 — cua
|
|
14
|
+
* `get_current_window_id`). Best-effort per-OS query; returns `null` when no
|
|
15
|
+
* window is focused or the platform query is unavailable.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getActiveWindow(): WindowInfo | null;
|
|
18
|
+
/**
|
|
19
|
+
* Windows belonging to a given application name (#9170 M12 — cua
|
|
20
|
+
* `get_application_windows`). Pure filter over `listWindows()`; case-insensitive
|
|
21
|
+
* substring match on the window's `app` (with a `title` fallback).
|
|
22
|
+
*/
|
|
23
|
+
export declare function getApplicationWindows(appName: string): WindowInfo[];
|
|
24
|
+
/**
|
|
25
|
+
* Set a window's position AND size in one call (#9170 M12 — cua set window
|
|
26
|
+
* size+position). Position is required; width/height optional (position-only
|
|
27
|
+
* when omitted).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resizeWindow(windowId: string, x: number, y: number, width?: number, height?: number): {
|
|
30
|
+
success: true;
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Read a window's bounds — position AND size — in OS-global logical pixels
|
|
35
|
+
* (#9170 M12 — cua `get_window_size` / `get_window_position`). When `windowId`
|
|
36
|
+
* is omitted, reads the currently-focused/foreground window. Returns
|
|
37
|
+
* `{ x, y, width, height }`.
|
|
38
|
+
*
|
|
39
|
+
* Windows: `GetWindowRect` via the window's `MainWindowHandle`. macOS: AppleScript
|
|
40
|
+
* `position`/`size` of the matched process window. Linux: `xdotool
|
|
41
|
+
* getwindowgeometry --shell`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getWindowBounds(windowId?: string): ScreenRegion;
|
|
44
|
+
export declare function focusWindow(windowId: string): void;
|
|
45
|
+
export declare function switchWindow(windowQuery: string): void;
|
|
46
|
+
export declare function arrangeWindows(arrangement?: string): {
|
|
47
|
+
success: true;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
export declare function moveWindow(windowId: string, x?: number, y?: number): {
|
|
51
|
+
success: true;
|
|
52
|
+
message: string;
|
|
53
|
+
};
|
|
54
|
+
export declare function minimizeWindow(windowId: string): void;
|
|
55
|
+
export declare function maximizeWindow(windowId: string): void;
|
|
56
|
+
export declare function restoreWindow(windowId: string): void;
|
|
57
|
+
export declare function closeWindow(windowId: string): void;
|
|
58
|
+
export declare const list_windows: typeof listWindows;
|
|
59
|
+
export declare const focus_window: typeof focusWindow;
|
|
60
|
+
export declare const switch_to_window: typeof switchWindow;
|
|
61
|
+
export declare const arrange_windows: typeof arrangeWindows;
|
|
62
|
+
export declare const move_window: typeof moveWindow;
|
|
63
|
+
export declare const minimize_window: typeof minimizeWindow;
|
|
64
|
+
export declare const maximize_window: typeof maximizeWindow;
|
|
65
|
+
export declare const restore_window: typeof restoreWindow;
|
|
66
|
+
export declare const close_window: typeof closeWindow;
|
|
67
|
+
/**
|
|
68
|
+
* PowerShell command that reads the primary screen bounds on Windows.
|
|
69
|
+
*
|
|
70
|
+
* `Add-Type -AssemblyName System.Windows.Forms` MUST run before
|
|
71
|
+
* `[System.Windows.Forms.Screen]` is referenced — on a clean PowerShell session
|
|
72
|
+
* the type is otherwise unresolved (`TypeNotFound`) and the screen size silently
|
|
73
|
+
* falls back to a hard-coded default. Exported so a cross-platform unit test can
|
|
74
|
+
* guard against the assembly-load regression without spawning PowerShell.
|
|
75
|
+
*/
|
|
76
|
+
export declare const WINDOWS_PRIMARY_SCREEN_SIZE_COMMAND: string;
|
|
77
|
+
export declare function getScreenSize(): ScreenSize;
|
|
78
|
+
//# sourceMappingURL=windows-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-list.d.ts","sourceRoot":"","sources":["../../src/platform/windows-list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA0BxE,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,UAAU,EAAkB,GACpC,UAAU,EAAE,CAUd;AAoBD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,UAAU,EAAkB,GACpC,UAAU,GAAG,IAAI,CAEnB;AAmDD,wBAAgB,WAAW,IAAI,UAAU,EAAE,CAa1C;AA4FD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,UAAU,GAAG,IAAI,CAuDnD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAQnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAapC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAiF/D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAqClD;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAEtD;AAoFD,wBAAgB,cAAc,CAAC,WAAW,SAAS,GAAG;IACpD,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAuDA;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,CAAC,CAAC,EAAE,MAAM,EACV,CAAC,CAAC,EAAE,MAAM,GACT;IACD,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CASA;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CA0BrD;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CA8BrD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAqCpD;AAID,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAuBlD;AAED,eAAO,MAAM,YAAY,oBAAc,CAAC;AACxC,eAAO,MAAM,YAAY,oBAAc,CAAC;AACxC,eAAO,MAAM,gBAAgB,qBAAe,CAAC;AAC7C,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,WAAW,mBAAa,CAAC;AACtC,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,cAAc,sBAAgB,CAAC;AAC5C,eAAO,MAAM,YAAY,oBAAc,CAAC;AAIxC;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC,QAEmC,CAAC;AAEpF,wBAAgB,aAAa,IAAI,UAAU,CA+H1C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ComputerStateProvider — injects current computer state into the LLM context.
|
|
3
|
+
*
|
|
4
|
+
* Provides platform info, screen dimensions, available capabilities,
|
|
5
|
+
* and a summary of recent actions so the agent has continuity.
|
|
6
|
+
*/
|
|
7
|
+
import type { Provider } from "@elizaos/core";
|
|
8
|
+
export declare const computerStateProvider: Provider;
|
|
9
|
+
//# sourceMappingURL=computer-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computer-state.d.ts","sourceRoot":"","sources":["../../src/providers/computer-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAGV,QAAQ,EAGT,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,qBAAqB,EAAE,QA4GnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `scene` provider — surfaces the latest Scene from the computeruse service's
|
|
3
|
+
* SceneBuilder into the agent prompt and provider data.
|
|
4
|
+
*
|
|
5
|
+
* Contract:
|
|
6
|
+
* - On every turn, we run `onAgentTurn()` to refresh the scene before
|
|
7
|
+
* reading it. WS7 (Brain) re-reads via `service.getCurrentScene()` for
|
|
8
|
+
* deeper introspection.
|
|
9
|
+
* - The provider text is a token-efficient JSON fence built by
|
|
10
|
+
* `serializeSceneForPrompt`. We never emit raw pixels.
|
|
11
|
+
* - The provider data is the FULL Scene so downstream pieces can crop /
|
|
12
|
+
* correlate / filter without re-serializing.
|
|
13
|
+
*
|
|
14
|
+
* Cache:
|
|
15
|
+
* - `cacheStable: false` — the Scene is by definition turn-specific.
|
|
16
|
+
* - `cacheScope: "turn"` — re-use within a single turn so multiple
|
|
17
|
+
* consumers don't double-tick the builder.
|
|
18
|
+
*/
|
|
19
|
+
import type { Provider } from "@elizaos/core";
|
|
20
|
+
export declare const sceneProvider: Provider;
|
|
21
|
+
//# sourceMappingURL=scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../src/providers/scene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAGV,QAAQ,EAGT,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,aAAa,EAAE,QA0C3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-routes.d.ts","sourceRoot":"","sources":["../src/register-routes.ts"],"names":[],"mappings":""}
|