js
Execute async JavaScript in a persistent REPL to automate macOS apps, manage multi-window layouts, and control browser tabs.
Instructions
Codex-identical persistent JavaScript REPL (cua_repl). Top-level bindings persist across calls. Exposes cua (getState, getApp, launchApp, getWindowState, manageWindows, createBrowserTab, getBrowserTab, getBrowser, cursor), sky (Sky macOS Window & Desktop APIs), agent.browsers, and nodeRepl (emitImage, emitMarkdown, write). Ideal for complex multi-window & multi-tab workflows with Promise.all.
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 | Top-level async JavaScript statements to run in the persistent cua_repl context. | |
| timeout_ms | No | Execution timeout in milliseconds (default 45000). |