@agentorg/computer 0.0.19 → 0.0.21
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 +114 -36
- package/dist/THIRD_PARTY_LICENSES.txt +109 -1
- package/dist/agentcomputer.js +81113 -64014
- package/dist/sdk.js +9 -2
- package/dist/types/generated/schema.d.ts +382 -11
- package/dist/types/sdk.d.ts +22 -5
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -24649,7 +24649,7 @@ var Endpoint = class {
|
|
|
24649
24649
|
async #call(name, args) {
|
|
24650
24650
|
const client = await this.#connected();
|
|
24651
24651
|
const result = await client.callTool({ name, arguments: args });
|
|
24652
|
-
const text = result.content
|
|
24652
|
+
const text = result.content[0]?.text ?? "";
|
|
24653
24653
|
if (result.isError) throw new ComputerError(400, text);
|
|
24654
24654
|
return { text, structured: result.structuredContent };
|
|
24655
24655
|
}
|
|
@@ -24813,6 +24813,7 @@ var Computer = class _Computer {
|
|
|
24813
24813
|
await apiOf(connection).POST("/v1/computers", {
|
|
24814
24814
|
body: {
|
|
24815
24815
|
...body,
|
|
24816
|
+
browser: opts.browser ?? false,
|
|
24816
24817
|
...isolation === void 0 ? {} : { isolation },
|
|
24817
24818
|
...workspace === void 0 ? {} : { workspace },
|
|
24818
24819
|
...copyFrom === void 0 ? {} : { copyFrom }
|
|
@@ -24826,7 +24827,13 @@ var Computer = class _Computer {
|
|
|
24826
24827
|
const { connection, body } = requestOf(opts);
|
|
24827
24828
|
const attached = answered(
|
|
24828
24829
|
await apiOf(connection).POST("/v1/computers/attach", {
|
|
24829
|
-
|
|
24830
|
+
// Only when asked for: a service from before the screen refuses what it doesn't know, so
|
|
24831
|
+
// the body leaves out the default the generated type would have it carry.
|
|
24832
|
+
body: {
|
|
24833
|
+
...body,
|
|
24834
|
+
workspace: opts.workspace,
|
|
24835
|
+
...opts.screen ? { screen: true } : {}
|
|
24836
|
+
}
|
|
24830
24837
|
})
|
|
24831
24838
|
);
|
|
24832
24839
|
return new _Computer(connection, attached, attached.accessToken);
|
|
@@ -21,6 +21,95 @@ export interface paths {
|
|
|
21
21
|
patch?: never;
|
|
22
22
|
trace?: never;
|
|
23
23
|
};
|
|
24
|
+
"/v1/connection": {
|
|
25
|
+
parameters: {
|
|
26
|
+
query?: never;
|
|
27
|
+
header?: never;
|
|
28
|
+
path?: never;
|
|
29
|
+
cookie?: never;
|
|
30
|
+
};
|
|
31
|
+
/** Who is connected to the service: each client that holds a WebSocket open at this same path, with the control token in its Authorization header and its name as `?name=`. It carries nothing either way, and one that stops answering the service's pings is dropped. */
|
|
32
|
+
get: operations["getConnection"];
|
|
33
|
+
put?: never;
|
|
34
|
+
post?: never;
|
|
35
|
+
delete?: never;
|
|
36
|
+
options?: never;
|
|
37
|
+
head?: never;
|
|
38
|
+
patch?: never;
|
|
39
|
+
trace?: never;
|
|
40
|
+
};
|
|
41
|
+
"/v1/setup": {
|
|
42
|
+
parameters: {
|
|
43
|
+
query?: never;
|
|
44
|
+
header?: never;
|
|
45
|
+
path?: never;
|
|
46
|
+
cookie?: never;
|
|
47
|
+
};
|
|
48
|
+
/** For each part of the service's machine an agent can use, the person's switch, whether it has all it needs, and each thing it needs, read afresh each time. */
|
|
49
|
+
get: operations["getSetup"];
|
|
50
|
+
put?: never;
|
|
51
|
+
post?: never;
|
|
52
|
+
delete?: never;
|
|
53
|
+
options?: never;
|
|
54
|
+
head?: never;
|
|
55
|
+
patch?: never;
|
|
56
|
+
trace?: never;
|
|
57
|
+
};
|
|
58
|
+
"/v1/setup/{capability}": {
|
|
59
|
+
parameters: {
|
|
60
|
+
query?: never;
|
|
61
|
+
header?: never;
|
|
62
|
+
path: {
|
|
63
|
+
capability: components["schemas"]["Switch"];
|
|
64
|
+
};
|
|
65
|
+
cookie?: never;
|
|
66
|
+
};
|
|
67
|
+
get?: never;
|
|
68
|
+
/** Set a part's switch, which lasts across restarts. Turning it on, or on again, also asks for everything the part is missing, as asking for it with no need named does. Where that couldn't be started, it answers 409, saying why, and the switch stays on. */
|
|
69
|
+
put: operations["setSetup"];
|
|
70
|
+
post?: never;
|
|
71
|
+
delete?: never;
|
|
72
|
+
options?: never;
|
|
73
|
+
head?: never;
|
|
74
|
+
patch?: never;
|
|
75
|
+
trace?: never;
|
|
76
|
+
};
|
|
77
|
+
"/v1/setup/{capability}/ask": {
|
|
78
|
+
parameters: {
|
|
79
|
+
query?: never;
|
|
80
|
+
header?: never;
|
|
81
|
+
path: {
|
|
82
|
+
capability: components["schemas"]["Switch"];
|
|
83
|
+
};
|
|
84
|
+
cookie?: never;
|
|
85
|
+
};
|
|
86
|
+
get?: never;
|
|
87
|
+
put?: never;
|
|
88
|
+
/** Ask the person, on the service's machine, macOS only, for one thing a part needs, or, with none named, for everything it is missing. screen-recording or accessibility, while it is missing: Cua Driver's own grant, its app started first, which makes the system's requests in its own order, Accessibility first. For a driver an app hosts, the app asks, for that grant alone. Then that grant's own pane in System Settings opens. chrome or edge: that browser opens at its inspect page, where remote debugging is switched on. With none named, the screen's grant while either is missing, and the first browser installed, Chrome before Edge, while none is on. It answers once the steps have started, with each part then; what the person does next is read afresh later. A browser the service was given only the folder of, the person opens. Elsewhere it asks for nothing. */
|
|
89
|
+
post: operations["askSetup"];
|
|
90
|
+
delete?: never;
|
|
91
|
+
options?: never;
|
|
92
|
+
head?: never;
|
|
93
|
+
patch?: never;
|
|
94
|
+
trace?: never;
|
|
95
|
+
};
|
|
96
|
+
"/v1/acting": {
|
|
97
|
+
parameters: {
|
|
98
|
+
query?: never;
|
|
99
|
+
header?: never;
|
|
100
|
+
path?: never;
|
|
101
|
+
cookie?: never;
|
|
102
|
+
};
|
|
103
|
+
/** Who is acting now on the computers attached to this machine, all of them at once: each one, on what, and when they last acted there, the most recent first, as each computer's presence surface has it. A computer in a container isn't included: its own presence surface has it. */
|
|
104
|
+
get: operations["getActing"];
|
|
105
|
+
put?: never;
|
|
106
|
+
post?: never;
|
|
107
|
+
delete?: never;
|
|
108
|
+
options?: never;
|
|
109
|
+
head?: never;
|
|
110
|
+
patch?: never;
|
|
111
|
+
trace?: never;
|
|
112
|
+
};
|
|
24
113
|
"/v1/computers": {
|
|
25
114
|
parameters: {
|
|
26
115
|
query?: never;
|
|
@@ -31,7 +120,10 @@ export interface paths {
|
|
|
31
120
|
/** List the computers. */
|
|
32
121
|
get: operations["listComputers"];
|
|
33
122
|
put?: never;
|
|
34
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Create a computer. It answers once the computer is running.
|
|
125
|
+
* @description Meanwhile, once any `copyFrom` copy is done, it is listed by `listComputers` as `starting`, with the name and metadata given here, its `reason`, and its image's `progress` where that is counted: that is how a caller shows a computer being made before `create` has answered.
|
|
126
|
+
*/
|
|
35
127
|
post: operations["createComputer"];
|
|
36
128
|
delete?: never;
|
|
37
129
|
options?: never;
|
|
@@ -204,10 +296,24 @@ export interface components {
|
|
|
204
296
|
*/
|
|
205
297
|
Access: "none" | "read" | "files" | "terminal";
|
|
206
298
|
/**
|
|
207
|
-
* @description failed: it was to be running and isn't, because its browser or container ended by itself, or because it couldn't be brought back when the service started. Its logs say
|
|
299
|
+
* @description starting: it is being made, started, or brought back as the service starts. Its `reason` says what it waits on, and its `progress` how far that has come, where it counts. Its endpoints and live sessions are refused with 409 and that `reason` until it is running. `create` and `start` answer once it is running, and it is listed meanwhile; `start` on one already starting answers at once. failed: it was to be running and isn't, because its browser or container ended by itself, or because it couldn't be brought back when the service started. Its `reason` says why, and its logs say more. Stop it and start it again.
|
|
208
300
|
* @enum {string}
|
|
209
301
|
*/
|
|
210
|
-
ComputerState: "running" | "stopped" | "failed";
|
|
302
|
+
ComputerState: "starting" | "running" | "stopped" | "failed";
|
|
303
|
+
/** @description How far a step that counts its bytes has come: today only fetching a computer's image, where Docker is on a socket on the service's machine. */
|
|
304
|
+
Progress: {
|
|
305
|
+
/** @description The step, in words with no numbers: "Downloading its image". */
|
|
306
|
+
title: string;
|
|
307
|
+
/** @description Bytes come so far. */
|
|
308
|
+
done: number;
|
|
309
|
+
/** @description Bytes to come, as far as is known: Docker gives each layer's size as the layer begins, so it can grow. Null while nothing is known. */
|
|
310
|
+
total: number | null;
|
|
311
|
+
/**
|
|
312
|
+
* Format: date-time
|
|
313
|
+
* @description When it last moved: bytes came, or, for an image, a layer was unpacked. When the step began, until then.
|
|
314
|
+
*/
|
|
315
|
+
moved: string;
|
|
316
|
+
};
|
|
211
317
|
/** @description Seconds from now until the computer stops. */
|
|
212
318
|
Timeout: number;
|
|
213
319
|
/** @description Your own labels, kept and returned as given. */
|
|
@@ -235,10 +341,15 @@ export interface components {
|
|
|
235
341
|
name?: string;
|
|
236
342
|
access: components["schemas"]["Access"];
|
|
237
343
|
/**
|
|
238
|
-
* @description
|
|
344
|
+
* @description Its browser. true: a headless one of its own. own: the person's own, Chrome or else Edge, signed in, reached through the browser's own attach, which asks the person to allow the connection; attaching waits up to 2 minutes for that, and is refused with 409 if it isn't allowed, or where `info` says it isn't ready. Its agent works only in tabs it opens: the person's own tabs are left alone. It is never closed: when the computer stops, it is only let go. With access none, the computer must have a browser or the screen.
|
|
239
345
|
* @default false
|
|
240
346
|
*/
|
|
241
|
-
browser: boolean;
|
|
347
|
+
browser: boolean | "own";
|
|
348
|
+
/**
|
|
349
|
+
* @description Whether its agent has the machine's screen: to see it and act on it, through Cua Driver, which the person installs and grants Screen Recording and Accessibility once. It acts as the person, whatever `access` says. Refused with 409 where `info` says the screen isn't ready.
|
|
350
|
+
* @default false
|
|
351
|
+
*/
|
|
352
|
+
screen: boolean;
|
|
242
353
|
/** @description Its work folder: the full path of a folder that exists. Commands and relative paths start there and its agent is told to work there, but nothing keeps its files inside it. Detaching never removes it. */
|
|
243
354
|
workspace: string;
|
|
244
355
|
timeout?: components["schemas"]["Timeout"];
|
|
@@ -255,11 +366,17 @@ export interface components {
|
|
|
255
366
|
computer: string | null;
|
|
256
367
|
/** @description The browser. */
|
|
257
368
|
browser: string | null;
|
|
369
|
+
/** @description The screen endpoint, or null when this computer was attached without `screen`. */
|
|
370
|
+
screen: string | null;
|
|
258
371
|
};
|
|
259
372
|
Computer: {
|
|
260
373
|
computerID: string;
|
|
261
374
|
name: string;
|
|
262
375
|
state: components["schemas"]["ComputerState"];
|
|
376
|
+
/** @description In a line a person reads: while it is starting, the step it waits on, with no numbers, such as "Its image is being fetched.", "Its container is being started." or "It is being started."; while it is failed, why. Null while it is running or stopped. */
|
|
377
|
+
reason: string | null;
|
|
378
|
+
/** @description While it is starting, how far its step has come, where the step counts its bytes; null otherwise. */
|
|
379
|
+
progress: components["schemas"]["Progress"] | null;
|
|
263
380
|
access: components["schemas"]["Access"];
|
|
264
381
|
/** @description The isolation it was made in. It is never run in another. */
|
|
265
382
|
isolation: components["schemas"]["Isolation"];
|
|
@@ -267,7 +384,10 @@ export interface components {
|
|
|
267
384
|
attached: boolean;
|
|
268
385
|
/** @description The version of the program it ran at its last start. For this computer it is the service's `version` (see `getInfo`). In a container it is the version inside its image, and null for a container made before 0.0.17, which doesn't say, until it is made again. It is kept from its last start, so a stopped computer's can be older than the service's until it starts. Compare it with the service's to show that a computer runs an older program. */
|
|
269
386
|
version: string | null;
|
|
270
|
-
browser
|
|
387
|
+
/** @description Its browser, as it was given, or false where it has none. */
|
|
388
|
+
browser: boolean | "own";
|
|
389
|
+
/** @description Whether its agent has the screen: only this computer can have one. */
|
|
390
|
+
screen: boolean;
|
|
271
391
|
workspace: string | null;
|
|
272
392
|
/**
|
|
273
393
|
* Format: date-time
|
|
@@ -293,13 +413,14 @@ export interface components {
|
|
|
293
413
|
tools: {
|
|
294
414
|
computer: string[];
|
|
295
415
|
browser: string[];
|
|
416
|
+
screen: string[];
|
|
296
417
|
};
|
|
297
418
|
};
|
|
298
419
|
/**
|
|
299
|
-
* @description terminal: every terminal on it, the agent's commands and a person's shells alike, on one socket in terminal@1: text messages are TerminalEvent one way and TerminalInput the other. Watching reads them all; operating also opens a shell, types into any of them, the agent's included, sizes and stops them. files: its workspace's files, in files@1: text messages are FilesRequest one way and FilesAnswer the other, and a file's bytes travel as binary messages of at most 1,048,576 bytes. Watching lists and reads; operating also writes, which a computer with read access doesn't offer. browser: its browser, in screencast@1: binary messages are JPEG frames of the page shown, text messages are ScreencastEvent one way and ScreencastInput the other. Nobody waits for anybody: the agent's tools and a person's input act on the same browser at once. The page shown is each socket's own. A socket is shown each new tab as it opens, until it sends a tab input to show or open one; from then its page changes only when that page closes. load: how busy it is, in metrics@1, to watch only: a LoadReading every two seconds while a socket is open, the first two seconds after the first socket opens, and the last one at once to a socket that opens later. One that can't be taken is left out, and a socket that hasn't read the one before is not sent the next. Nothing is read while nobody watches or asks.
|
|
420
|
+
* @description terminal: every terminal on it, the agent's commands and a person's shells alike, on one socket in terminal@1: text messages are TerminalEvent one way and TerminalInput the other. Watching reads them all; operating also opens a shell, types into any of them, the agent's included, sizes and stops them. files: its workspace's files, in files@1: text messages are FilesRequest one way and FilesAnswer the other, and a file's bytes travel as binary messages of at most 1,048,576 bytes. Watching lists and reads; operating also writes, which a computer with read access doesn't offer. browser: its browser, in screencast@1: binary messages are JPEG frames of the page shown, text messages are ScreencastEvent one way and ScreencastInput the other. Nobody waits for anybody: the agent's tools and a person's input act on the same browser at once. The page shown is each socket's own. A socket is shown each new tab as it opens, until it sends a tab input to show or open one; from then its page changes only when that page closes. load: how busy it is, in metrics@1, to watch only: a LoadReading every two seconds while a socket is open, the first two seconds after the first socket opens, and the last one at once to a socket that opens later. One that can't be taken is left out, and a socket that hasn't read the one before is not sent the next. Nothing is read while nobody watches or asks. presence: who is acting on it now, in presence@1, to watch only: a PresenceEvent when the socket opens, and another each time someone starts or stops acting on something. screen: the machine's screen, for this computer attached with it, in screen@1: binary messages are PNG frames of the whole screen, at most 1,280 pixels on their longest side, text messages are ScreenEvent one way and ScreenInput the other. The screen is taken twice a second while a socket is open, and a frame is sent only when the picture changed, so a socket is sent the last one when it opens and nothing more while the screen is still. A socket with more than 4 MiB still to be sent to it is sent nothing until it catches up.
|
|
300
421
|
* @enum {string}
|
|
301
422
|
*/
|
|
302
|
-
Surface: "terminal" | "files" | "browser" | "load";
|
|
423
|
+
Surface: "terminal" | "files" | "browser" | "load" | "presence" | "screen";
|
|
303
424
|
/**
|
|
304
425
|
* @description In watch you see and don't act: what you send is dropped, except that a files socket may still ask to list, to read and for what changed.
|
|
305
426
|
* @enum {string}
|
|
@@ -419,6 +540,39 @@ export interface components {
|
|
|
419
540
|
/** @description A URL, or back, forward or reload. */
|
|
420
541
|
to: string;
|
|
421
542
|
};
|
|
543
|
+
/** @description What the service sends on a screen@1 socket, as JSON text. */
|
|
544
|
+
ScreenEvent: {
|
|
545
|
+
/** @constant */
|
|
546
|
+
type: "size";
|
|
547
|
+
width: number;
|
|
548
|
+
height: number;
|
|
549
|
+
} | {
|
|
550
|
+
/** @constant */
|
|
551
|
+
type: "refused";
|
|
552
|
+
message: string;
|
|
553
|
+
};
|
|
554
|
+
/** @description What an operate socket sends on screen@1, as JSON text, no message over 65,536 bytes: a larger one closes the socket. Each is done in order, through Cua Driver, as the person. A point is in pixels of the frames, as the last size says, scaled to the screen; keys and text go to the window in front. What isn't done is answered with refused, and why: what Cua Driver refuses, what is none of these, and what is sent while 32 are still waiting. Binary messages, and whatever a watch socket sends, are dropped. */
|
|
555
|
+
ScreenInput: {
|
|
556
|
+
/** @constant */
|
|
557
|
+
type: "mouse";
|
|
558
|
+
/** @enum {string} */
|
|
559
|
+
action: "click" | "double_click" | "right_click" | "drag" | "scroll";
|
|
560
|
+
x: number;
|
|
561
|
+
y: number;
|
|
562
|
+
to_x?: number;
|
|
563
|
+
to_y?: number;
|
|
564
|
+
/** @enum {string} */
|
|
565
|
+
direction?: "up" | "down" | "left" | "right";
|
|
566
|
+
amount?: number;
|
|
567
|
+
} | {
|
|
568
|
+
/** @constant */
|
|
569
|
+
type: "key";
|
|
570
|
+
keys: string[];
|
|
571
|
+
} | {
|
|
572
|
+
/** @constant */
|
|
573
|
+
type: "text";
|
|
574
|
+
text: string;
|
|
575
|
+
};
|
|
422
576
|
/** @description What the service sends on a terminal@1 socket, as JSON text, no message over 65,536 bytes. A terminal is a command the agent started or a shell a person opened; its id is the session id the agent's tools use. A new socket is first sent, for each terminal already there, the oldest first, its start, the end of what it wrote (its last 65,536 characters), and its exit if it has ended; then each event as it happens, with nothing to mark where the first ends. The last 64 that ended are among those already there, and one that leaves that list is not told. A character here is a UTF-16 unit. A socket with more than 4 MiB still to be sent to it is closed, with no close frame (1006): one that has stopped reading, or one that is reading while a terminal writes tens of megabytes at once. It isn't an error. Opened again, it is sent every terminal afresh, with the last 65,536 characters each wrote, in place of whatever it held. */
|
|
423
577
|
TerminalEvent: {
|
|
424
578
|
/** @constant */
|
|
@@ -501,6 +655,75 @@ export interface components {
|
|
|
501
655
|
/** @description Bytes on that volume. */
|
|
502
656
|
diskTotal: number;
|
|
503
657
|
};
|
|
658
|
+
/**
|
|
659
|
+
* @description A part of the service's machine an agent can use: its terminal, its files, its screen, and the person's own browser.
|
|
660
|
+
* @enum {string}
|
|
661
|
+
*/
|
|
662
|
+
Switch: "terminal" | "files" | "screen" | "browser";
|
|
663
|
+
/**
|
|
664
|
+
* @description install: Cua Driver, which the screen works through. screen-recording and accessibility: Cua Driver's two grants. chrome and edge: each browser, with remote debugging on or off; named: the one browser a service was given the folder of.
|
|
665
|
+
* @enum {string}
|
|
666
|
+
*/
|
|
667
|
+
NeedName: "install" | "screen-recording" | "accessibility" | "chrome" | "edge" | "named";
|
|
668
|
+
Need: {
|
|
669
|
+
need: components["schemas"]["NeedName"];
|
|
670
|
+
/** @description A browser's name: Chrome, Edge, or the browser. */
|
|
671
|
+
name?: string;
|
|
672
|
+
/** @description For a grant, whose it is, as System Settings lists it: the outermost app Cua Driver is inside, CuaDriver for its own app, or an app that carries the driver. None where Cua Driver is in no app. */
|
|
673
|
+
holder?: string;
|
|
674
|
+
/**
|
|
675
|
+
* @description missing: not installed. unknown: it can't be read now. A browser is on while it is open with its remote debugging switched on.
|
|
676
|
+
* @enum {string}
|
|
677
|
+
*/
|
|
678
|
+
state: "missing" | "granted" | "not-granted" | "unknown" | "on" | "off";
|
|
679
|
+
};
|
|
680
|
+
Setup: {
|
|
681
|
+
/** @description terminal, files, screen and browser, in that order. */
|
|
682
|
+
capabilities: {
|
|
683
|
+
capability: components["schemas"]["Switch"];
|
|
684
|
+
/** @description The person's switch. Off, agents' new calls to the part refuse, saying the person turned it off, and `info` says so; what an agent already started runs on. The terminal and the screen each reach the whole machine: commands read any file, and the screen acts in any app. The browser's switch is for the person's own; any browser's code-running tool answers to the terminal's switch, and a browser call that names files, by `paths` or `filename`, to the files'. A service started with `--lend` starts with every one off; any other, with every one on. */
|
|
685
|
+
on: boolean;
|
|
686
|
+
/** @description Whether the part has all it needs, apart from its switch: the screen, each item granted; the browser, one browser on. The terminal and files always do. */
|
|
687
|
+
ready: boolean;
|
|
688
|
+
/** @description Each thing the part needs, always, with its state. The terminal and files need nothing. The screen needs Cua Driver, which while it isn't installed is the one item, and on macOS its two grants. The browser lists Chrome then Edge, each on, off or missing, or the one browser named; with both on, the agent's is Chrome. */
|
|
689
|
+
needs: components["schemas"]["Need"][];
|
|
690
|
+
}[];
|
|
691
|
+
};
|
|
692
|
+
Connection: {
|
|
693
|
+
/** @description Whether any client holds a connection now. */
|
|
694
|
+
connected: boolean;
|
|
695
|
+
/** @description Each client holding one, the earliest first. */
|
|
696
|
+
clients: {
|
|
697
|
+
/** @description The name it gave, its first 100 characters, or empty: such as AgentOrg 0.0.15. */
|
|
698
|
+
name: string;
|
|
699
|
+
/** Format: date-time */
|
|
700
|
+
since: string;
|
|
701
|
+
/** @description Whether it connects from this machine, by the address it connects from. False behind --tls-proxy, where every client comes from the proxy. */
|
|
702
|
+
local: boolean;
|
|
703
|
+
}[];
|
|
704
|
+
};
|
|
705
|
+
/** @description Someone who acted on a computer in the last 10 seconds. The person acts in a live view at operate: opening a shell, typing into or stopping a terminal, writing a file, any input to the browser but moving the pointer, or any input to the screen that Cua Driver did. Watching is not acting, and the person's own use of the screen, outside a live view, can't be seen. The agent acts by calling its endpoints: starting a command or typing into one (waiting on its output is not acting), any file tool, reads among them, any browser tool that is answered, and any screen tool. Computers attached to the same machine share its files and its screen: each is shown the person and the other computers' agents acting on them, by name. */
|
|
706
|
+
Acting: {
|
|
707
|
+
/** @enum {string} */
|
|
708
|
+
who: "person" | "agent";
|
|
709
|
+
/** @description The agent's name */
|
|
710
|
+
name?: string;
|
|
711
|
+
/** @enum {string} */
|
|
712
|
+
capability: "terminal" | "files" | "browser" | "screen";
|
|
713
|
+
/** @description Which terminal, by its id; only for a terminal. */
|
|
714
|
+
terminal?: string;
|
|
715
|
+
/**
|
|
716
|
+
* Format: date-time
|
|
717
|
+
* @description When it last acted there, as of this message: one who goes on acting is sent again only when someone starts or stops.
|
|
718
|
+
*/
|
|
719
|
+
at: string;
|
|
720
|
+
};
|
|
721
|
+
/** @description What the service sends on a presence@1 socket, as JSON text: the whole list of everyone acting now, the most recent first, empty where nobody is. It is sent when the socket opens and each time someone starts acting on something, or stops: 10 seconds after they last acted there. Nothing is refused by it. What a socket sends is dropped. */
|
|
722
|
+
PresenceEvent: {
|
|
723
|
+
/** @constant */
|
|
724
|
+
type: "presence";
|
|
725
|
+
acting: components["schemas"]["Acting"][];
|
|
726
|
+
};
|
|
504
727
|
/** @description What a socket sends on files@1, as JSON text. Each has an id of its own choosing, which the answer repeats; answers come as they are ready, in any order, and ids aren't checked for repeats. A request still unanswered when the socket closes gets no answer. A path is from the workspace, with / between its parts, or absolute inside it, and nothing outside the workspace is reached. A binary message that follows no write closes the socket, and so does any message over 1,048,576 bytes. */
|
|
505
728
|
FilesRequest: {
|
|
506
729
|
/** @constant */
|
|
@@ -599,7 +822,7 @@ export interface components {
|
|
|
599
822
|
reason?: string;
|
|
600
823
|
};
|
|
601
824
|
/**
|
|
602
|
-
* @description What a computer offers its agent and the person: what it is, its terminals, its files and its screen.
|
|
825
|
+
* @description What a computer offers its agent and the person: what it is, its terminals, its files and its screen. This computer's screen is reached through Cua Driver: it is ready where Cua Driver is installed, at 0.49.7 or later, and granted Screen Recording and Accessibility, and otherwise the reason says what to do. A part the person switched off on that machine isn't ready either.
|
|
603
826
|
* @enum {string}
|
|
604
827
|
*/
|
|
605
828
|
Capability: "about" | "terminal" | "files" | "screen";
|
|
@@ -607,10 +830,10 @@ export interface components {
|
|
|
607
830
|
capability: components["schemas"]["Capability"];
|
|
608
831
|
};
|
|
609
832
|
/**
|
|
610
|
-
* @description headless: a headless browser with a profile of its own, beside the computer, which a person watches and controls through its live view.
|
|
833
|
+
* @description headless: a headless browser with a profile of its own, beside the computer, which a person watches and controls through its live view. own: the person's own browser on the service's machine, Chrome or Edge, signed in, offered for this computer: ready where one is open with its remote debugging switched on, Chrome first, which the person does once on its inspect page; the browser then asks them to allow each connection. Not ready, the reason names the browser and what to do on that machine. Switched off by the person on that machine, it isn't ready either.
|
|
611
834
|
* @enum {string}
|
|
612
835
|
*/
|
|
613
|
-
BrowserKind: "headless";
|
|
836
|
+
BrowserKind: "headless" | "own";
|
|
614
837
|
BrowserState: components["schemas"]["Readiness"] & {
|
|
615
838
|
kind: components["schemas"]["BrowserKind"];
|
|
616
839
|
};
|
|
@@ -679,6 +902,145 @@ export interface operations {
|
|
|
679
902
|
401: components["responses"]["Unauthorized"];
|
|
680
903
|
};
|
|
681
904
|
};
|
|
905
|
+
getConnection: {
|
|
906
|
+
parameters: {
|
|
907
|
+
query?: never;
|
|
908
|
+
header?: never;
|
|
909
|
+
path?: never;
|
|
910
|
+
cookie?: never;
|
|
911
|
+
};
|
|
912
|
+
requestBody?: never;
|
|
913
|
+
responses: {
|
|
914
|
+
/** @description Who is connected. */
|
|
915
|
+
200: {
|
|
916
|
+
headers: {
|
|
917
|
+
[name: string]: unknown;
|
|
918
|
+
};
|
|
919
|
+
content: {
|
|
920
|
+
"application/json": components["schemas"]["Connection"];
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
401: components["responses"]["Unauthorized"];
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
getSetup: {
|
|
927
|
+
parameters: {
|
|
928
|
+
query?: never;
|
|
929
|
+
header?: never;
|
|
930
|
+
path?: never;
|
|
931
|
+
cookie?: never;
|
|
932
|
+
};
|
|
933
|
+
requestBody?: never;
|
|
934
|
+
responses: {
|
|
935
|
+
/** @description Each part. */
|
|
936
|
+
200: {
|
|
937
|
+
headers: {
|
|
938
|
+
[name: string]: unknown;
|
|
939
|
+
};
|
|
940
|
+
content: {
|
|
941
|
+
"application/json": components["schemas"]["Setup"];
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
401: components["responses"]["Unauthorized"];
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
setSetup: {
|
|
948
|
+
parameters: {
|
|
949
|
+
query?: never;
|
|
950
|
+
header?: never;
|
|
951
|
+
path: {
|
|
952
|
+
capability: components["schemas"]["Switch"];
|
|
953
|
+
};
|
|
954
|
+
cookie?: never;
|
|
955
|
+
};
|
|
956
|
+
requestBody: {
|
|
957
|
+
content: {
|
|
958
|
+
"application/json": {
|
|
959
|
+
on: boolean;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
responses: {
|
|
964
|
+
/** @description Set, and its steps started. */
|
|
965
|
+
200: {
|
|
966
|
+
headers: {
|
|
967
|
+
[name: string]: unknown;
|
|
968
|
+
};
|
|
969
|
+
content: {
|
|
970
|
+
"application/json": components["schemas"]["Setup"];
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
401: components["responses"]["Unauthorized"];
|
|
974
|
+
/** @description On, but the steps that ask for what it needs couldn't be started. */
|
|
975
|
+
409: {
|
|
976
|
+
headers: {
|
|
977
|
+
[name: string]: unknown;
|
|
978
|
+
};
|
|
979
|
+
content: {
|
|
980
|
+
"application/json": components["schemas"]["Error"];
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
askSetup: {
|
|
986
|
+
parameters: {
|
|
987
|
+
query?: never;
|
|
988
|
+
header?: never;
|
|
989
|
+
path: {
|
|
990
|
+
capability: components["schemas"]["Switch"];
|
|
991
|
+
};
|
|
992
|
+
cookie?: never;
|
|
993
|
+
};
|
|
994
|
+
requestBody?: {
|
|
995
|
+
content: {
|
|
996
|
+
"application/json": {
|
|
997
|
+
need?: components["schemas"]["NeedName"];
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
};
|
|
1001
|
+
responses: {
|
|
1002
|
+
/** @description Asked, its steps started. */
|
|
1003
|
+
200: {
|
|
1004
|
+
headers: {
|
|
1005
|
+
[name: string]: unknown;
|
|
1006
|
+
};
|
|
1007
|
+
content: {
|
|
1008
|
+
"application/json": components["schemas"]["Setup"];
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
401: components["responses"]["Unauthorized"];
|
|
1012
|
+
/** @description The part doesn't need that here, or what it needs can't be asked for, such as a browser that isn't installed, or the steps couldn't be started. */
|
|
1013
|
+
409: {
|
|
1014
|
+
headers: {
|
|
1015
|
+
[name: string]: unknown;
|
|
1016
|
+
};
|
|
1017
|
+
content: {
|
|
1018
|
+
"application/json": components["schemas"]["Error"];
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
};
|
|
1023
|
+
getActing: {
|
|
1024
|
+
parameters: {
|
|
1025
|
+
query?: never;
|
|
1026
|
+
header?: never;
|
|
1027
|
+
path?: never;
|
|
1028
|
+
cookie?: never;
|
|
1029
|
+
};
|
|
1030
|
+
requestBody?: never;
|
|
1031
|
+
responses: {
|
|
1032
|
+
/** @description Who is acting now. */
|
|
1033
|
+
200: {
|
|
1034
|
+
headers: {
|
|
1035
|
+
[name: string]: unknown;
|
|
1036
|
+
};
|
|
1037
|
+
content: {
|
|
1038
|
+
"application/json": components["schemas"]["Acting"][];
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
401: components["responses"]["Unauthorized"];
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
682
1044
|
listComputers: {
|
|
683
1045
|
parameters: {
|
|
684
1046
|
query?: {
|
|
@@ -801,6 +1163,15 @@ export interface operations {
|
|
|
801
1163
|
};
|
|
802
1164
|
401: components["responses"]["Unauthorized"];
|
|
803
1165
|
404: components["responses"]["Error"];
|
|
1166
|
+
/** @description It can't be removed here: a container while Docker doesn't answer, or one made before under a service that now only lends this machine. */
|
|
1167
|
+
409: {
|
|
1168
|
+
headers: {
|
|
1169
|
+
[name: string]: unknown;
|
|
1170
|
+
};
|
|
1171
|
+
content: {
|
|
1172
|
+
"application/json": components["schemas"]["Error"];
|
|
1173
|
+
};
|
|
1174
|
+
};
|
|
804
1175
|
};
|
|
805
1176
|
};
|
|
806
1177
|
setComputerTimeout: {
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -49,9 +49,13 @@ export interface CreateOpts extends ConnectionOpts {
|
|
|
49
49
|
metadata?: Record<string, string>;
|
|
50
50
|
}
|
|
51
51
|
/** This computer, attached whole: its files and commands reach all of it, as the service's user. */
|
|
52
|
-
export interface AttachOpts extends Omit<CreateOpts, "isolation" | "workspace" | "copyFrom"> {
|
|
52
|
+
export interface AttachOpts extends Omit<CreateOpts, "isolation" | "workspace" | "copyFrom" | "browser"> {
|
|
53
53
|
/** Its work folder, where commands and relative paths start. Detaching never removes it. */
|
|
54
54
|
workspace: string;
|
|
55
|
+
/** A headless browser of its own, or the person's own browser, signed in. */
|
|
56
|
+
browser?: boolean | "own";
|
|
57
|
+
/** Whether its agent has the machine's screen, through Cua Driver. */
|
|
58
|
+
screen?: boolean;
|
|
55
59
|
}
|
|
56
60
|
export interface CommandResult {
|
|
57
61
|
exitCode: number;
|
|
@@ -181,11 +185,14 @@ export declare class Computer {
|
|
|
181
185
|
computerID: string;
|
|
182
186
|
name: string;
|
|
183
187
|
state: components["schemas"]["ComputerState"];
|
|
188
|
+
reason: string | null;
|
|
189
|
+
progress: components["schemas"]["Progress"] | null;
|
|
184
190
|
access: components["schemas"]["Access"];
|
|
185
191
|
isolation: components["schemas"]["Isolation"];
|
|
186
192
|
attached: boolean;
|
|
187
193
|
version: string | null;
|
|
188
|
-
browser: boolean;
|
|
194
|
+
browser: boolean | "own";
|
|
195
|
+
screen: boolean;
|
|
189
196
|
workspace: string | null;
|
|
190
197
|
startedAt: string;
|
|
191
198
|
endAt: string | null;
|
|
@@ -197,6 +204,7 @@ export declare class Computer {
|
|
|
197
204
|
tools: {
|
|
198
205
|
computer: string[];
|
|
199
206
|
browser: string[];
|
|
207
|
+
screen: string[];
|
|
200
208
|
};
|
|
201
209
|
}>;
|
|
202
210
|
isRunning(): Promise<boolean>;
|
|
@@ -204,11 +212,14 @@ export declare class Computer {
|
|
|
204
212
|
computerID: string;
|
|
205
213
|
name: string;
|
|
206
214
|
state: components["schemas"]["ComputerState"];
|
|
215
|
+
reason: string | null;
|
|
216
|
+
progress: components["schemas"]["Progress"] | null;
|
|
207
217
|
access: components["schemas"]["Access"];
|
|
208
218
|
isolation: components["schemas"]["Isolation"];
|
|
209
219
|
attached: boolean;
|
|
210
220
|
version: string | null;
|
|
211
|
-
browser: boolean;
|
|
221
|
+
browser: boolean | "own";
|
|
222
|
+
screen: boolean;
|
|
212
223
|
workspace: string | null;
|
|
213
224
|
startedAt: string;
|
|
214
225
|
endAt: string | null;
|
|
@@ -219,11 +230,14 @@ export declare class Computer {
|
|
|
219
230
|
computerID: string;
|
|
220
231
|
name: string;
|
|
221
232
|
state: components["schemas"]["ComputerState"];
|
|
233
|
+
reason: string | null;
|
|
234
|
+
progress: components["schemas"]["Progress"] | null;
|
|
222
235
|
access: components["schemas"]["Access"];
|
|
223
236
|
isolation: components["schemas"]["Isolation"];
|
|
224
237
|
attached: boolean;
|
|
225
238
|
version: string | null;
|
|
226
|
-
browser: boolean;
|
|
239
|
+
browser: boolean | "own";
|
|
240
|
+
screen: boolean;
|
|
227
241
|
workspace: string | null;
|
|
228
242
|
startedAt: string;
|
|
229
243
|
endAt: string | null;
|
|
@@ -236,11 +250,14 @@ export declare class Computer {
|
|
|
236
250
|
computerID: string;
|
|
237
251
|
name: string;
|
|
238
252
|
state: components["schemas"]["ComputerState"];
|
|
253
|
+
reason: string | null;
|
|
254
|
+
progress: components["schemas"]["Progress"] | null;
|
|
239
255
|
access: components["schemas"]["Access"];
|
|
240
256
|
isolation: components["schemas"]["Isolation"];
|
|
241
257
|
attached: boolean;
|
|
242
258
|
version: string | null;
|
|
243
|
-
browser: boolean;
|
|
259
|
+
browser: boolean | "own";
|
|
260
|
+
screen: boolean;
|
|
244
261
|
workspace: string | null;
|
|
245
262
|
startedAt: string;
|
|
246
263
|
endAt: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentorg/computer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Computers for agents, as a service: a terminal, files and a browser over MCP",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"playwright-core": "1.65.0-alpha-2026-10-30"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@agentorg/exec": "0.0.
|
|
37
|
+
"@agentorg/exec": "0.0.10",
|
|
38
38
|
"@biomejs/biome": "2.6.5",
|
|
39
39
|
"@modelcontextprotocol/client": "2.4.0",
|
|
40
40
|
"@modelcontextprotocol/node": "2.1.2",
|