skip to content
$worker

computer

v0.1.3

Drive a full desktop on the iii bus. Start a session on the local machine, a sandboxed desktop, or a remote one, screenshot it, click and type by coordinate, and stream the live screen.

iiiverified
2 installs1 in 7d0 today
install
$iii worker add computer@next
  • macOS: arm64 · x64
  • Linux: arm64 · armv7 · x64
  • Windows: arm64 · x64 · x86

exact versions are immutable; binary and bundle artifacts are digest-pinned.

agent-ready brief for v0.1.3
install + config + dependencies + readme + api reference, all in one place. fetch as agent-context.md for an llm to consume.
the same content rendered as discrete blocks below is exposed as a single markdown document at /workers/computer.md?version=next. paste it into an llm prompt or pipe it through curl from a worker.

install

install
$iii worker add computer@0.1.3

dependencies

no dependencies for v0.1.3

readme

README.md

computer

Drive a full desktop on the iii bus. Where the browser worker gives an agent a Chromium tab, computer gives it a whole screen: it hands the model a screenshot, clicks and scrolls at the coordinates it reads off that image, and types wherever the desktop's focus is. The harness discovers computer::* as functions automatically, so a model sees the screen and acts on it with no glue, and the console gets a live viewport of whatever the desktop is doing.

The worker does the one thing no other worker can: capture the screen and move the cursor. Three drivers sit behind one surface, picked per session:

  • native (no endpoint, no image): drive the local machine this worker runs on, capture and input injection built in.
  • sandbox (an image): boot a fresh desktop inside an iii-sandbox microVM and drive it through iii primitives alone (sandbox::exec / sandbox::fs), with no socket into the guest. A fixed virtual display means 1:1 coordinates, no HiDPI or multi-monitor ambiguity, and nothing to grant on the host.
  • remote (an endpoint): drive an already-running desktop through the executor inside it, over a WebSocket. computer connects; that desktop boots out of band.

Everything else composes with workers that already exist: run commands and touch files with the shell worker, persist with state, schedule with cron.

Install

iii worker add computer

To drive a throwaway desktop instead of your own machine, add the sandbox worker too — it boots the microVM the image driver runs in:

iii worker add iii-sandbox

macOS, native driver only. Capture and input are permission-gated and macOS degrades both silently, so the worker checks and fails loud. Grant the app that runs the worker Screen Recording (without it every screenshot is the wallpaper with all windows stripped) and Accessibility (without it clicks and typing are dropped) in System Settings > Privacy & Security, then restart it. The sandbox driver needs neither.

Quickstart

Start a session, look at the screen, click what you see:

# drive this machine: a bare start picks the native driver when neither
# sandbox_image nor default_endpoint is configured
iii trigger computer::sessions::start --json '{}'
# -> { "session_id": "c1", "endpoint": "native", "os": "macos", "screen": { "width": 1512, "height": 945 } }

# see the screen: an image block the vision model renders inline
iii trigger computer::screenshot --json '{"session_id":"c1"}'

# click a pixel read off that screenshot (top-left origin)
iii trigger computer::act --json '{"session_id":"c1","action":"click","x":640,"y":360}'

iii trigger computer::sessions::stop --json '{"session_id":"c1"}'

Swap the first call for {"image":"desktop"} to boot a sandboxed Linux desktop instead (see Sandbox desktop image), or {"endpoint":"ws://host:8000"} to drive a remote one. Everything after that call is identical: the session id is the only handle.

The same from a sibling worker:

use iii_sdk::protocol::TriggerRequest;
use iii_sdk::{register_worker, InitOptions};
use serde_json::json;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let iii = register_worker("ws://localhost:49134", InitOptions::default());

    let started = iii
        .trigger(TriggerRequest {
            function_id: "computer::sessions::start".into(),
            payload: json!({}),
            action: None,
            timeout_ms: Some(30_000),
        })
        .await?;
    let session_id = started["session_id"].as_str().unwrap();

    iii.trigger(TriggerRequest {
        function_id: "computer::act".into(),
        payload: json!({ "session_id": session_id, "action": "click", "x": 640, "y": 360 }),
        action: None,
        timeout_ms: Some(10_000),
    })
    .await?;

    Ok(())
}

The rest of the surface: computer::act — pointer actions addressed by coordinate (click, right_click, double_click, move, drag, scroll) and keyboard actions that land wherever the desktop's focus is (type with text, press / hotkey with keys, e.g. ["cmd","c"]) — computer::observe (screenshot plus the accessibility tree on macOS guests), computer::displays, computer::sessions::list and computer::sessions::stop. For commands and files, mind which machine you mean: on a native session the desktop IS this host, so the shell worker is the right tool. A sandboxed desktop is reached with sandbox::exec / sandbox::fs, and a remote one through its own guest executor — shell would run on the host instead, which is a different machine entirely.

Console

The worker ships its own console page (#/ext/computer): a session rail, a live viewport fed by the screencast stream, and click / type / scroll forwarding straight into the desktop. It is injected into any running console at registration time — nothing to install, nothing to rebuild. Every computer::* call in chat and traces renders through the same asset.

Configuration

Stored in the configuration worker under the computer key; every field is editable live from the console. The screencast rate applies to running sessions; everything a driver is built with — endpoint, OS label, timeouts, capture limits, and the sandbox display and network settings — is read at sessions::start, so a change reaches sessions started after it.

computer:
  default_endpoint: ''      # guest-executor endpoint for a remote desktop; empty = drive the local machine
  os: linux                 # guest OS label recorded on sessions
  max_sessions: 2           # concurrent desktop connections
  idle_stop_ms: 300000      # stop sessions idle this long; 0 disables
  screencast_fps: 15        # live-view frame rate cap
  max_screenshot_dimension: 1280 # downscale screenshots/frames to this longest edge (native)
  screenshot_quality: 70    # JPEG quality 1-100 (native)
  command_timeout_ms: 120000 # timeout for each driver action (fixed at connect)
  connect_timeout_ms: 15000  # driver connect timeout at session start
  sandbox_image: ''          # iii-sandbox image for a sandbox session; empty = name it per call
  sandbox_width: 1280        # sandbox virtual display width
  sandbox_height: 800        # sandbox virtual display height
  sandbox_network: true      # give the sandboxed desktop network access; false keeps it offline
  sandbox_idle_timeout_secs: 86400 # idle_timeout_secs for sandbox::create; kept high, the worker owns teardown
  screen_capture_preflight: true # macOS: ask for Screen Recording at native start, fail loud if denied

Sandbox desktop image

The sandbox driver needs a desktop inside the guest (Xvfb, xdotool, imagemagick, openbox). A prebaked image lives in images/desktop: build it, push it, register it as a custom_images entry on the iii-sandbox worker, then start a session with { "image": "desktop" }. iii-sandbox boots on macOS Apple Silicon (libkrun) and Linux (/dev/kvm).

Custom trigger types

Sibling workers (and the console page) subscribe to session activity instead of polling. Both bindings accept an optional { "session_id": "..." } filter.

Trigger type Fires when Payload to subscribers
computer::session-started A session connected and is ready { session_id, endpoint, os, screen, timestamp }
computer::session-stopped A session ended { session_id, reason: "stopped" | "idle", timestamp }

Live screen

computer::screencast::start / stop and computer::frame drive the live viewport: the worker captures at screencast_fps and pushes the newest frame onto the computer:frames stream (one item per session), so the console and any number of watchers follow the desktop without polling. These three are internal console plumbing rather than agent surface, and stay out of agent function lists.

api reference (json)

agent-api-reference.json
{
  "functions": [
    {
      "description": "Drive the desktop: click, right_click, double_click, move, drag, scroll, type, press, or hotkey. Address by pixel coordinates read off the screenshot (top-left origin).",
      "metadata": {},
      "name": "computer::act",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "action": {
            "description": "What to do: `click`, `right_click`, `double_click`, `move`, `drag`, `scroll`, `type`, `press`, or `hotkey`.",
            "type": "string"
          },
          "button": {
            "default": null,
            "description": "Mouse button for `drag` (`left`, `right`, `middle`). Default `left`.",
            "type": [
              "string",
              "null"
            ]
          },
          "keys": {
            "default": null,
            "description": "Keys for `press`/`hotkey`: a single key (`[\"enter\"]`) or a chord (`[\"ctrl\", \"c\"]`).",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "scroll_x": {
            "default": null,
            "description": "Horizontal scroll amount for `action=scroll`. Default 0.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "scroll_y": {
            "default": null,
            "description": "Vertical scroll amount for `action=scroll`; positive scrolls down. Default 3.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "session_id": {
            "type": "string"
          },
          "text": {
            "default": null,
            "description": "Text to type, for `action=type`.",
            "type": [
              "string",
              "null"
            ]
          },
          "to_x": {
            "default": null,
            "description": "Drag end x (with `to_y`), for `action=drag`.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "to_y": {
            "default": null,
            "description": "Drag end y.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "x": {
            "default": null,
            "description": "Target x (pixels). Required for click/right_click/double_click/move and the drag start; the scroll anchor defaults to screen center.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "y": {
            "default": null,
            "description": "Target y (pixels).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "action",
          "session_id"
        ],
        "title": "ActInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "detail": {
            "description": "What was done, for the transcript.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "detail",
          "ok"
        ],
        "title": "ActOutput",
        "type": "object"
      }
    },
    {
      "description": "List the local displays (index, name, primary, size). Pass the chosen index as `monitor` to computer::sessions::start to drive that display; omit it to use the display under the cursor. Native host only.",
      "metadata": {},
      "name": "computer::displays",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "DisplaysInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
          "DisplayInfo": {
            "description": "One display available to the native host (from `computer::displays`).",
            "properties": {
              "builtin": {
                "type": "boolean"
              },
              "height": {
                "description": "Logical height in points.",
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "index": {
                "description": "Index to pass as `monitor` to `computer::sessions::start`.",
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "primary": {
                "type": "boolean"
              },
              "width": {
                "description": "Logical width in points.",
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "builtin",
              "height",
              "index",
              "name",
              "primary",
              "width"
            ],
            "type": "object"
          }
        },
        "properties": {
          "displays": {
            "items": {
              "$ref": "#/definitions/DisplayInfo"
            },
            "type": "array"
          }
        },
        "required": [
          "displays"
        ],
        "title": "DisplaysOutput",
        "type": "object"
      }
    },
    {
      "description": "Internal: newest screencast frame, or nothing when since_frame is still current. No capture round-trip; poll fast. Not an agent function.",
      "metadata": {
        "internal": true
      },
      "name": "computer::frame",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "session_id": {
            "type": "string"
          },
          "since_frame": {
            "default": null,
            "description": "Frame cursor from the previous read; when the newest frame still has this seq the response omits `frame` (nothing changed).",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "session_id"
        ],
        "title": "FrameInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "active": {
            "description": "False when no screencast is running (call screencast::start first).",
            "type": "boolean"
          },
          "frame": {
            "description": "Base64 image of the newest frame; absent when `since_frame` is still current or no frame has arrived yet.",
            "type": [
              "string",
              "null"
            ]
          },
          "frame_seq": {
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "height": {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "mime": {
            "description": "Image mime of the frame bytes.",
            "type": "string"
          },
          "timestamp": {
            "format": "int64",
            "type": "integer"
          },
          "width": {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "active",
          "frame_seq",
          "height",
          "mime",
          "timestamp",
          "width"
        ],
        "title": "FrameOutput",
        "type": "object"
      }
    },
    {
      "description": "Capture the desktop plus, optionally, the accessibility tree. Use include_a11y on macOS guests for a machine-readable element tree; elsewhere prefer computer::screenshot.",
      "metadata": {},
      "name": "computer::observe",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "include_a11y": {
            "default": null,
            "description": "Also fetch the accessibility tree. macOS returns a real tree; other guests may return a stub or nothing (the field is then omitted).",
            "type": [
              "boolean",
              "null"
            ]
          },
          "session_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "ObserveInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
          "ContentBlock": {
            "description": "One block of a viewable response: an image block or a text line.",
            "properties": {
              "data": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "ObserveDetails": {
            "properties": {
              "mime": {
                "type": "string"
              },
              "screen": {
                "$ref": "#/definitions/Screen"
              },
              "session_id": {
                "type": "string"
              }
            },
            "required": [
              "mime",
              "screen",
              "session_id"
            ],
            "type": "object"
          },
          "Screen": {
            "description": "Desktop pixel dimensions. Coordinates handed to pointer actions are in this space: integer pixels, top-left origin, 1:1 with the screenshot.",
            "properties": {
              "height": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "width": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "height",
              "width"
            ],
            "type": "object"
          }
        },
        "properties": {
          "accessibility": {
            "description": "Accessibility tree, present only when requested and the guest exposes one."
          },
          "content": {
            "items": {
              "$ref": "#/definitions/ContentBlock"
            },
            "type": "array"
          },
          "details": {
            "$ref": "#/definitions/ObserveDetails"
          }
        },
        "required": [
          "content",
          "details"
        ],
        "title": "ObserveOutput",
        "type": "object"
      }
    },
    {
      "description": "Internal: reload computer settings from the authoritative configuration on change.",
      "metadata": {
        "internal": true
      },
      "name": "computer::on-config-change",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "OnConfigChangeRequest",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "OnConfigChangeResponse",
        "type": "object"
      }
    },
    {
      "description": "Internal: start pushing live desktop frames onto the computer:frames stream for the console viewport. Console-UI plumbing; agents use computer::screenshot. Not an agent function.",
      "metadata": {
        "internal": true
      },
      "name": "computer::screencast::start",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "session_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "ScreencastStartInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "AckOutput",
        "type": "object"
      }
    },
    {
      "description": "Internal: stop the live frame push. Idempotent. Not an agent function.",
      "metadata": {
        "internal": true
      },
      "name": "computer::screencast::stop",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "Stopping the screencast on an unknown session succeeds.",
        "properties": {
          "session_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "ScreencastStopInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "title": "AckOutput",
        "type": "object"
      }
    },
    {
      "description": "Capture the desktop as a viewable image. This is how you see the screen before acting; the coordinate space of computer::act is this image's pixels (top-left origin).",
      "metadata": {},
      "name": "computer::screenshot",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "session_id": {
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "ScreenshotInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
          "ContentBlock": {
            "description": "One block of a viewable response: an image block or a text line.",
            "properties": {
              "data": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "ScreenshotDetails": {
            "properties": {
              "height": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "mime": {
                "description": "Detected image mime (`image/png` or `image/jpeg`).",
                "type": "string"
              },
              "session_id": {
                "type": "string"
              },
              "width": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "height",
              "mime",
              "session_id",
              "width"
            ],
            "type": "object"
          }
        },
        "properties": {
          "content": {
            "items": {
              "$ref": "#/definitions/ContentBlock"
            },
            "type": "array"
          },
          "details": {
            "$ref": "#/definitions/ScreenshotDetails"
          }
        },
        "required": [
          "content",
          "details"
        ],
        "title": "ScreenshotOutput",
        "type": "object"
      }
    },
    {
      "description": "List live computer sessions with their endpoint, guest OS, and screen size.",
      "metadata": {},
      "name": "computer::sessions::list",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "ListInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
          "Screen": {
            "description": "Desktop pixel dimensions. Coordinates handed to pointer actions are in this space: integer pixels, top-left origin, 1:1 with the screenshot.",
            "properties": {
              "height": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "width": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "height",
              "width"
            ],
            "type": "object"
          },
          "SessionInfo": {
            "properties": {
              "created_ms": {
                "format": "int64",
                "type": "integer"
              },
              "endpoint": {
                "type": "string"
              },
              "last_used_ms": {
                "format": "int64",
                "type": "integer"
              },
              "os": {
                "type": "string"
              },
              "screen": {
                "$ref": "#/definitions/Screen"
              },
              "screencast_active": {
                "description": "True while a live screen stream is running for this session.",
                "type": "boolean"
              },
              "session_id": {
                "type": "string"
              }
            },
            "required": [
              "created_ms",
              "endpoint",
              "last_used_ms",
              "os",
              "screen",
              "screencast_active",
              "session_id"
            ],
            "type": "object"
          }
        },
        "properties": {
          "sessions": {
            "items": {
              "$ref": "#/definitions/SessionInfo"
            },
            "type": "array"
          }
        },
        "required": [
          "sessions"
        ],
        "title": "ListOutput",
        "type": "object"
      }
    },
    {
      "description": "Start a computer-use session and return its session_id. Pass `image` to boot a fresh desktop in an iii-sandbox microVM (fixed virtual display, no host setup), an `endpoint` to drive a desktop through its guest executor, or omit both to drive the local machine. Sessions are durable; stop them with computer::sessions::stop when done.",
      "metadata": {},
      "name": "computer::sessions::start",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "endpoint": {
            "default": null,
            "description": "Desktop to drive when not using a sandbox `image`. Omit (and leave `image` unset) to drive the local machine this worker runs on (native driver, nothing else to run). Pass the endpoint of a desktop guest's executor (a `ws`/`wss`/`http`/`https` url or a bare `host:port`) to drive a remote desktop; falls back to the configured `default_endpoint` when omitted.",
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "default": null,
            "description": "Boot a fresh desktop inside an iii-sandbox microVM from this OCI image (a sandbox preset name or `custom_images` key) and drive it through iii primitives alone. A fixed virtual display means 1:1 coordinates, no HiDPI or multi-monitor ambiguity. Falls back to the configured `sandbox_image` when omitted. Takes precedence over `endpoint`.",
            "type": [
              "string",
              "null"
            ]
          },
          "monitor": {
            "default": null,
            "description": "Display index (from `computer::displays`) for a native session. Omit to drive the display under the cursor. Ignored for a remote `endpoint` or a sandbox `image`.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "os": {
            "default": null,
            "description": "Guest OS label recorded on the session and surfaced in `session-started` (`linux`, `macos`, `windows`, `android`). Omit and each driver labels itself: a sandbox session is `linux`, a remote one takes the configured `os`, and a native one takes this host's OS.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "title": "StartInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
          "Screen": {
            "description": "Desktop pixel dimensions. Coordinates handed to pointer actions are in this space: integer pixels, top-left origin, 1:1 with the screenshot.",
            "properties": {
              "height": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              },
              "width": {
                "format": "uint32",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "height",
              "width"
            ],
            "type": "object"
          }
        },
        "properties": {
          "endpoint": {
            "description": "What the session drives: `native` for the local machine, or the normalized remote endpoint.",
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "screen": {
            "allOf": [
              {
                "$ref": "#/definitions/Screen"
              }
            ],
            "description": "Desktop pixel dimensions; the coordinate space for `computer::act`."
          },
          "session_id": {
            "description": "Pass this to every other computer function.",
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "os",
          "screen",
          "session_id"
        ],
        "title": "StartOutput",
        "type": "object"
      }
    },
    {
      "description": "Stop a computer session and close its driver connection. Idempotent: stopping an unknown or already-stopped session succeeds with was_running=false.",
      "metadata": {},
      "name": "computer::sessions::stop",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "session_id": {
            "description": "Session to stop. Stopping an unknown or already-stopped id succeeds.",
            "type": "string"
          }
        },
        "required": [
          "session_id"
        ],
        "title": "StopInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "was_running": {
            "description": "False when the session was already gone.",
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "was_running"
        ],
        "title": "StopOutput",
        "type": "object"
      }
    },
    {
      "description": "Serve the computer worker's injected console UI assets (content function for its console:script / console:style triggers).",
      "metadata": {
        "internal": true
      },
      "name": "computer::ui-content",
      "request_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "Input of the content function: the console asks for one asset by path.",
        "properties": {
          "path": {
            "description": "The asset path from the trigger config (e.g. `state/page.js`).",
            "type": "string"
          }
        },
        "required": [
          "path"
        ],
        "title": "UiContentInput",
        "type": "object"
      },
      "response_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "Output of the content function.",
        "properties": {
          "content": {
            "description": "The asset source, verbatim.",
            "type": "string"
          },
          "content_type": {
            "description": "MIME type the console should serve the asset with.",
            "type": "string"
          }
        },
        "required": [
          "content",
          "content_type"
        ],
        "title": "UiContentResult",
        "type": "object"
      }
    }
  ],
  "triggers": [
    {
      "description": "A desktop session connected and is ready to drive.",
      "invocation_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "description": "Config accepted by every `computer::*` trigger binding. The only filter is an optional session-id equality match; unknown fields fail at registration so a misspelled filter key fails loudly instead of silently receiving nothing.",
        "properties": {
          "session_id": {
            "description": "Only deliver events for this computer session.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "title": "BindingConfig",
        "type": "object"
      },
      "metadata": {},
      "name": "computer::session-started",
      "return_schema": {}
    },
    {
      "description": "A desktop session ended (stopped or idle).",
      "invocation_schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "additionalProperties": false,
        "description": "Config accepted by every `computer::*` trigger binding. The only filter is an optional session-id equality match; unknown fields fail at registration so a misspelled filter key fails loudly instead of silently receiving nothing.",
        "properties": {
          "session_id": {
            "description": "Only deliver events for this computer session.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "title": "BindingConfig",
        "type": "object"
      },
      "metadata": {},
      "name": "computer::session-stopped",
      "return_schema": {}
    }
  ]
}