Computer Use
jsRun JavaScript in a persistent Windows Computer Use worker to inspect and control native apps, manage windows, take screenshots, click, type, scroll, and return text or images.
Instructions
Run JavaScript in a persistent Computer Use worker with a vm guardrail. The session exposes sky (OpenAI's Windows Computer Use API: list_apps, list_windows, get_window_state, click, press_key, type_text, scroll, set_value, drag, perform_secondary_action, activate_window, launch_app) and cua (a compatibility facade: await cua.getApp("Notepad")). Top-level await works, and top-level let/const/function/class bindings survive between calls. Use nodeRepl.write(...) to return text and nodeRepl.emitImage(...) to return an image. Timeouts reset the session. Node APIs, eval, Function, and import() are blocked. The worker shares the server process id and file descriptors, so this is a guardrail against accidental Node access, not a security boundary for untrusted code.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript to execute in the Computer Use session. | |
| title | No | Optional short title shown by some clients for this execution. | |
| timeout_ms | No | Optional execution timeout in milliseconds. Defaults to 30000 (30 seconds). | |
| completion_summary | No | Optional one-line summary of what the execution did. |