@agentorg/computer 0.0.3 → 0.0.5

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/README.md CHANGED
@@ -37,7 +37,7 @@ That prints the computer's `computerID`, its endpoints and its `accessToken`, on
37
37
 
38
38
  The file tools stay inside the workspace. That's a check, not a boundary. Below `terminal`, the browser's `browser_run_code_unsafe` tool is hidden and refused, because it would otherwise be a terminal. The service enforces all of this, whatever the client does.
39
39
 
40
- `--browser` drives the Google Chrome installed on the machine, in a profile of the computer's own. `serve --browser-name` and `--browser-path` choose another.
40
+ `--browser` drives the Google Chrome installed on the machine, in a profile of the computer's own. `serve --browser-name` and `--browser-path` choose another. The browser has no debug port: a small host process starts it and shares it on a Unix socket in a folder only its user can enter, which the agent's tools and the live view both use.
41
41
 
42
42
  ## Commands
43
43
 
@@ -130,6 +130,21 @@ docker run -d --name agentcomputer --network host \
130
130
  - `--network host` is how it reaches each computer's port on the machine's loopback, so this needs Linux.
131
131
  - The socket gives it full control of that machine's Docker. Whoever holds the control token can make computers, but not reach the socket.
132
132
 
133
+ ## Live sessions
134
+
135
+ A computer at `--access terminal` has two surfaces you can open live, as a WebSocket:
136
+
137
+ - **`commands`** (protocol `commands@1`): each of the agent's commands as it runs, read-only. Each message is one JSON event: `start` (with `cmd` and `workdir`), `output` (with `stream` and `text`) or `exit` (with `exitCode`). Each carries the command's `id`, which is the `session_id` the agent sees. Those already heard come first.
138
+ - **`terminal`** (protocol `pty@1`): a shell of your own in its workspace, as its user, beside the agent's commands rather than in them. Every socket on it shares one shell, and a new one is sent what it wrote before. Each binary message is one byte of type, then its payload: `0` is output from the shell, or input to it; `1` is a resize, `{"columns":100,"rows":30}`. In `watch` mode what you send is dropped.
139
+
140
+ A computer with `--browser` has a third:
141
+
142
+ - **`browser`** (protocol `screencast@1`): its browser, on the same page the agent works on. Binary messages are JPEG frames of the page shown. Text messages are JSON: the service sends `tabs`, `viewport`, `dialog`, `file-chooser`, `choice` and `driver`, and an `operate` socket sends `mouse`, `key`, `text`, `dialog`, `files`, `choice`, `tab`, `navigate` and `release`. `openapi.yaml` has each one's fields. A page's own dialogs, file choosers and select lists aren't in the frames, so they arrive as events for you to show and answer. Operating it makes you the driver: the agent's browser calls wait up to 25 seconds while you are, then answer that a person has or had the browser. You stop being the driver when you send `release`, close the socket, or send nothing for 60 seconds.
143
+
144
+ `POST /v1/computers/{computerID}/live` with `{ "surface": "terminal", "mode": "operate" }` gives a ticket: a `url` to open once within a minute, which needs no token. A request with an `Origin` header is refused unless `serve --allow-origin` names that origin, so a page can't open one. The SDK does the same with `computer.pty.connect({ onData })` and `computer.commands.watch(onEvent)`, and the CLI with `agentcomputer live <id> --surface terminal --mode operate`.
145
+
146
+ The terminal needs [node-pty](https://github.com/microsoft/node-pty), an optional dependency installed beside the program. It comes prebuilt for macOS. On Linux it's compiled at install, which npm only does when told: `npm install -g @agentorg/computer --allow-scripts=node-pty`, with a C++ toolchain. Without it, the computer's `surfaces` say why the terminal isn't there. The computer image has it.
147
+
133
148
  ## Known limits
134
149
 
135
150
  - With no isolation, each browser's Playwright MCP listens on a loopback port with no token of its own, so another user on the same machine could reach it directly. Don't run that on a machine you share.
@@ -1,4 +1,4 @@
1
- @agentorg/exec 0.0.2 (Apache-2.0)
1
+ @agentorg/exec 0.0.3 (Apache-2.0)
2
2
 
3
3
  Apache License
4
4
  Version 2.0, January 2004
@@ -1271,6 +1271,31 @@ SOFTWARE.
1271
1271
 
1272
1272
  ========================================================================
1273
1273
 
1274
+ ws 8.22.2 (MIT)
1275
+
1276
+ Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
1277
+ Copyright (c) 2013 Arnout Kazemier and contributors
1278
+ Copyright (c) 2016 Luigi Pinca and contributors
1279
+
1280
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1281
+ this software and associated documentation files (the "Software"), to deal in
1282
+ the Software without restriction, including without limitation the rights to
1283
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1284
+ the Software, and to permit persons to whom the Software is furnished to do so,
1285
+ subject to the following conditions:
1286
+
1287
+ The above copyright notice and this permission notice shall be included in all
1288
+ copies or substantial portions of the Software.
1289
+
1290
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1291
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1292
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1293
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1294
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1295
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1296
+
1297
+ ========================================================================
1298
+
1274
1299
  zod 4.6.7 (MIT)
1275
1300
 
1276
1301
  MIT License