@agentorg/computer 0.0.1 → 0.0.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/README.md CHANGED
@@ -15,7 +15,16 @@ agentcomputer create --access terminal --browser --workspace ~/some/folder
15
15
 
16
16
  That prints the computer's `computerID`, its endpoints and its `accessToken`, once. Give an MCP client the `computer` and `browser` URLs, with the token as `Authorization: Bearer <token>`.
17
17
 
18
- **This version has no isolation.** A computer is processes of whoever started the service. With `--access terminal` it can reach everything that user can. Run it only where that's safe.
18
+ **By default a computer has no isolation.** It's processes of whoever started the service, and with `--access terminal` it can reach everything that user can. Use `--isolation container` wherever that isn't safe.
19
+
20
+ ## Isolation
21
+
22
+ `agentcomputer serve --isolation container` makes each computer a container of its own, which needs Docker on the same machine. The service follows your `DOCKER_HOST` or current context and never changes them.
23
+
24
+ - The image holds AgentExec, Playwright MCP and a headless Chromium. It is `ghcr.io/uniac-ai/agentcomputer/computer` at the service's version; `--image` names another.
25
+ - `--workspace` is mounted at `/workspace`, read-only at `--access read`, and nothing else of the machine is visible. Docker has to be able to share that folder. Without `--workspace`, the service makes one.
26
+ - It runs as the user who started the service, with no capabilities.
27
+ - `stop` stops the container and keeps it, so what was installed in it is there at `start`. `kill` removes it. Starting a stopped computer uses the image it was made from.
19
28
 
20
29
  ## Access
21
30
 
@@ -44,7 +53,7 @@ The file tools stay inside the workspace. That's a check, not a boundary. Below
44
53
 
45
54
  With no `--workspace`, the service makes a folder, which goes when the computer is killed. A folder you name is never deleted. A computer with a `--timeout` stops when it runs out, and its folder stays.
46
55
 
47
- The service listens on loopback. It refuses any other address, because it has no TLS yet.
56
+ The service listens on loopback unless you give it TLS; see [Across a network](#across-a-network).
48
57
 
49
58
  The data folder is `--data`, else `$AGENTCOMPUTER_DATA`, else `$XDG_DATA_HOME/agentcomputer`, else `~/.local/share/agentcomputer`. It holds `control-token` and `server.json`, which the commands read.
50
59
 
@@ -89,14 +98,48 @@ It reads the control token from `AGENTCOMPUTER_API_KEY` and the address from `AG
89
98
 
90
99
  `files.write` makes a new file or fills an empty one; `files.edit` changes one that has content. `files.read` returns the whole text, or fails if a line is longer than the tool can return.
91
100
 
101
+ ## Across a network
102
+
103
+ The service listens on loopback unless you give it TLS:
104
+
105
+ ```sh
106
+ agentcomputer serve --listen 0.0.0.0:7878 \
107
+ --tls-cert cert.pem --tls-key key.pem --public-url https://computers.example.com:7878
108
+ ```
109
+
110
+ `--tls-proxy` is the other way, when a proxy in front of it terminates TLS. It then listens in the clear, so keep that hop private. `--public-url` is the address clients reach it at, which the endpoints it gives out are built from. It's required with `--tls-proxy` and when listening on a wildcard address. Certificates are read at start, so restart it to renew one.
111
+
112
+ A client using a private certificate authority trusts it through `NODE_EXTRA_CA_CERTS`.
113
+
114
+ ### The service as a container
115
+
116
+ `ghcr.io/uniac-ai/agentcomputer/service` holds the service and the Docker client, for container isolation on a server:
117
+
118
+ ```sh
119
+ docker run -d --name agentcomputer --network host \
120
+ --user "$(id -u):$(id -g)" --group-add "$(stat -c %g /var/run/docker.sock)" \
121
+ -v /var/run/docker.sock:/var/run/docker.sock \
122
+ -v /srv/agentcomputer:/srv/agentcomputer \
123
+ ghcr.io/uniac-ai/agentcomputer/service:VERSION \
124
+ serve --isolation container --data /srv/agentcomputer --listen 0.0.0.0:7878 \
125
+ --tls-cert /srv/agentcomputer/cert.pem --tls-key /srv/agentcomputer/key.pem \
126
+ --public-url https://computers.example.com:7878
127
+ ```
128
+
129
+ - Its data folder, and any `--workspace`, have to be mounted at the same path inside as outside, because Docker reads those paths on the machine.
130
+ - `--network host` is how it reaches each computer's port on the machine's loopback, so this needs Linux.
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
+
92
133
  ## Known limits
93
134
 
94
- - 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 this on a machine you share.
95
- - A browser that stops shows the computer as `failed`. Stop it and start it again.
135
+ - 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.
136
+ - A container has no CPU or memory limit, and its network is Docker's default, so it reaches the internet and anything else Docker's network does.
137
+ - In a container the browser runs without its own sandbox, which needs privileges a computer doesn't have. The container is the boundary.
138
+ - A browser that stops, or a container that ends by itself, shows the computer as `failed`. Stop it and start it again.
96
139
 
97
140
  ## Tests
98
141
 
99
- `npm test` runs the built service through the official MCP client, with a stand-in for Playwright, and one scenario through HTTP, MCP, the SDK and the CLI that fails if any operation in the schema isn't reached by each. After changing `openapi.yaml`, `npm run generate` writes what comes from it; CI fails if that changes anything. Set `AGENTCOMPUTER_BROWSER_PATH` to a browser program to run the real one too.
142
+ `npm test` runs the built service through the official MCP client, with a stand-in for Playwright, and one scenario through HTTP, MCP, the SDK and the CLI that fails if any operation in the schema isn't reached by each. Set `AGENTCOMPUTER_TEST_IMAGE` to a built image (`npm run build`, then `docker build .`) to run the same suite on containers, and `AGENTCOMPUTER_TEST_SERVICE_IMAGE` to one from `Dockerfile.service` to run the service itself as a container, with `AGENTCOMPUTER_TEST_ROOT` naming a folder Docker can mount if the temporary one isn't. After changing `openapi.yaml`, `npm run generate` writes what comes from it; CI fails if that changes anything. Set `AGENTCOMPUTER_BROWSER_PATH` to a browser program to run the real one too.
100
143
 
101
144
  ## Licence
102
145
 
@@ -1,4 +1,4 @@
1
- @agentorg/exec 0.0.1 (Apache-2.0)
1
+ @agentorg/exec 0.0.2 (Apache-2.0)
2
2
 
3
3
  Apache License
4
4
  Version 2.0, January 2004