@agentorg/cli 0.0.5 → 0.0.7
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 +23 -104
- package/dist/node_modules/@agentorg/computer/LICENSE +201 -0
- package/dist/node_modules/@agentorg/computer/NOTICE +2 -0
- package/dist/node_modules/@agentorg/computer/dist/THIRD_PARTY_LICENSES.txt +1321 -0
- package/dist/node_modules/@agentorg/computer/dist/sdk.js +24909 -0
- package/dist/node_modules/@agentorg/computer/dist/types/generated/schema.d.ts +860 -0
- package/dist/node_modules/@agentorg/computer/dist/types/sdk.d.ts +242 -0
- package/dist/node_modules/@agentorg/computer/package.json +12 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/provider.d.ts +24 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/provider.js +482 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/unit.d.ts +19 -0
- package/dist/node_modules/@agentorg/computer-connector/dist/src/unit.js +149 -0
- package/dist/node_modules/@agentorg/computer-connector/package.json +33 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/browser/SKILL.md +31 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/computer/SKILL.md +30 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/files/SKILL.md +28 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/terminal/SKILL.md +39 -0
- package/dist/node_modules/@agentorg/computer-connector/skills/web-research/SKILL.md +29 -0
- package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.d.ts +2 -7
- package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.js +4 -144
- package/dist/node_modules/@agentorg/hub/dist/src/index.d.ts +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/index.js +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/router.d.ts +9 -58
- package/dist/node_modules/@agentorg/hub/dist/src/router.js +41 -414
- package/dist/node_modules/@agentorg/hub/dist/src/state.d.ts +17 -317
- package/dist/node_modules/@agentorg/hub/dist/src/state.js +42 -536
- package/dist/node_modules/@agentorg/hub/dist/src/validate.d.ts +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/validate.js +19 -17
- package/dist/node_modules/@agentorg/hub/package.json +0 -3
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.d.ts +119 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.js +96 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.d.ts +42 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.js +53 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.d.ts +93 -38
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.js +71 -22
- package/dist/node_modules/@agentorg/interfaces/dist/src/connection.d.ts +36 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/connection.js +31 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/folders.d.ts +19 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/folders.js +25 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/hub.d.ts +16 -286
- package/dist/node_modules/@agentorg/interfaces/dist/src/hub.js +17 -159
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.d.ts +9 -9
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.js +9 -9
- package/dist/node_modules/@agentorg/interfaces/dist/src/kv.d.ts +2 -2
- package/dist/node_modules/@agentorg/interfaces/dist/src/kv.js +2 -2
- package/dist/node_modules/@agentorg/interfaces/dist/src/llm-session.d.ts +2 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/llm-session.js +2 -1
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.d.ts +626 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.js +349 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/tools.d.ts +39 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/tools.js +43 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/units.d.ts +460 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/units.js +204 -0
- package/dist/node_modules/@agentorg/looper/dist/src/index.d.ts +5 -0
- package/dist/node_modules/@agentorg/looper/dist/src/index.js +5 -0
- package/dist/node_modules/@agentorg/looper/dist/src/loop.d.ts +75 -0
- package/dist/node_modules/@agentorg/looper/dist/src/loop.js +332 -0
- package/dist/node_modules/@agentorg/looper/dist/src/looper.d.ts +71 -0
- package/dist/node_modules/@agentorg/looper/dist/src/looper.js +282 -0
- package/dist/node_modules/@agentorg/looper/dist/src/record.d.ts +99 -0
- package/dist/node_modules/@agentorg/looper/dist/src/record.js +278 -0
- package/dist/node_modules/@agentorg/looper/dist/src/tools.d.ts +11 -0
- package/dist/node_modules/@agentorg/looper/dist/src/tools.js +42 -0
- package/dist/node_modules/@agentorg/looper/dist/src/types.d.ts +147 -0
- package/dist/node_modules/@agentorg/looper/dist/src/types.js +32 -0
- package/dist/node_modules/@agentorg/looper/package.json +24 -0
- package/dist/node_modules/@agentorg/manager/dist/src/activity.d.ts +18 -0
- package/dist/node_modules/@agentorg/manager/dist/src/activity.js +65 -0
- package/dist/node_modules/@agentorg/manager/dist/src/control.d.ts +134 -0
- package/dist/node_modules/@agentorg/manager/dist/src/control.js +1115 -0
- package/dist/node_modules/@agentorg/manager/dist/src/form.d.ts +40 -0
- package/dist/node_modules/@agentorg/manager/dist/src/form.js +191 -0
- package/dist/node_modules/@agentorg/manager/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/manager/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.d.ts +25 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.js +680 -0
- package/dist/node_modules/@agentorg/manager/dist/src/skills.d.ts +27 -0
- package/dist/node_modules/@agentorg/manager/dist/src/skills.js +152 -0
- package/dist/node_modules/@agentorg/manager/dist/src/stack.d.ts +454 -0
- package/dist/node_modules/@agentorg/manager/dist/src/stack.js +917 -0
- package/dist/node_modules/@agentorg/manager/package.json +30 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.d.ts +34 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.js +296 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/index.d.ts +4 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/index.js +4 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.d.ts +158 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.js +164 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.d.ts +22 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.js +197 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/public.d.ts +6 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/public.js +72 -0
- package/dist/node_modules/@agentorg/mcp/package.json +31 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/cli.js +3 -23
- package/dist/node_modules/@agentorg/sdk/dist/src/client.d.ts +4 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/client.js +5 -55
- package/dist/node_modules/@agentorg/sdk/dist/src/errors.d.ts +1 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/errors.js +3 -3
- package/dist/node_modules/@agentorg/sdk/dist/src/filled.d.ts +21 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/filled.js +24 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/index.d.ts +3 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/index.js +2 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/interface.d.ts +6 -34
- package/dist/node_modules/@agentorg/sdk/dist/src/interface.js +3 -24
- package/dist/node_modules/@agentorg/sdk/dist/src/module-host.d.ts +8 -17
- package/dist/node_modules/@agentorg/sdk/dist/src/module-host.js +15 -87
- package/dist/node_modules/@agentorg/sdk/dist/src/module.d.ts +10 -76
- package/dist/node_modules/@agentorg/sdk/dist/src/module.js +3 -23
- package/dist/node_modules/@agentorg/sdk/dist/src/person-commands.js +0 -5
- package/dist/node_modules/@agentorg/sdk/dist/src/runtime.d.ts +3 -27
- package/dist/node_modules/@agentorg/sdk/dist/src/runtime.js +5 -100
- package/dist/node_modules/@agentorg/sdk/dist/src/testing.d.ts +7 -8
- package/dist/node_modules/@agentorg/sdk/dist/src/testing.js +12 -24
- package/dist/node_modules/@agentorg/sdk/package.json +4 -37
- package/dist/node_modules/@agentorg/shell/dist/app.css +4624 -739
- package/dist/node_modules/@agentorg/shell/dist/app.js +245 -202
- package/dist/node_modules/@agentorg/shell/package.json +23 -10
- package/dist/node_modules/@agentorg/wire/dist/src/frames.d.ts +2 -3
- package/dist/node_modules/@agentorg/wire/dist/src/frames.js +2 -3
- package/dist/node_modules/@agentorg/wire/dist/src/ops.d.ts +5 -34
- package/dist/node_modules/@agentorg/wire/dist/src/ops.js +2 -17
- package/dist/node_modules/assistant/dist/src/chats.d.ts +92 -0
- package/dist/node_modules/assistant/dist/src/chats.js +357 -0
- package/dist/node_modules/assistant/dist/src/engine.d.ts +42 -0
- package/dist/node_modules/assistant/dist/src/engine.js +160 -0
- package/dist/node_modules/assistant/dist/src/local-store.d.ts +3 -0
- package/dist/node_modules/assistant/dist/src/local-store.js +58 -0
- package/dist/node_modules/assistant/dist/src/provider.d.ts +21 -0
- package/dist/node_modules/assistant/dist/src/provider.js +259 -0
- package/dist/node_modules/assistant/dist/src/settings.d.ts +17 -0
- package/dist/node_modules/assistant/dist/src/settings.js +43 -0
- package/dist/node_modules/assistant/dist/src/tools.d.ts +57 -0
- package/dist/node_modules/assistant/dist/src/tools.js +102 -0
- package/dist/node_modules/assistant/package.json +30 -0
- package/dist/node_modules/chatgpt/dist/src/account.d.ts +52 -0
- package/dist/node_modules/chatgpt/dist/src/account.js +270 -0
- package/dist/node_modules/chatgpt/dist/src/encoding.d.ts +7 -0
- package/dist/node_modules/chatgpt/dist/src/encoding.js +20 -0
- package/dist/node_modules/chatgpt/dist/src/file-store.d.ts +9 -0
- package/dist/node_modules/chatgpt/dist/src/file-store.js +68 -0
- package/dist/node_modules/chatgpt/dist/src/index.d.ts +1 -0
- package/dist/node_modules/chatgpt/dist/src/index.js +1 -0
- package/dist/node_modules/chatgpt/dist/src/jwt.d.ts +15 -0
- package/dist/node_modules/chatgpt/dist/src/jwt.js +37 -0
- package/dist/node_modules/chatgpt/dist/src/oauth.d.ts +43 -0
- package/dist/node_modules/chatgpt/dist/src/oauth.js +104 -0
- package/dist/node_modules/chatgpt/dist/src/program.d.ts +23 -0
- package/dist/node_modules/chatgpt/dist/src/program.js +41 -0
- package/dist/node_modules/chatgpt/dist/src/responses.d.ts +54 -0
- package/dist/node_modules/chatgpt/dist/src/responses.js +300 -0
- package/dist/node_modules/chatgpt/dist/src/serve.d.ts +65 -0
- package/dist/node_modules/chatgpt/dist/src/serve.js +46 -0
- package/dist/node_modules/chatgpt/package.json +33 -0
- package/dist/src/api.d.ts +5 -34
- package/dist/src/api.js +10 -68
- package/dist/src/cli.js +3 -7
- package/dist/src/folders.d.ts +2 -0
- package/dist/src/folders.js +45 -0
- package/dist/src/gateway.d.ts +13 -8
- package/dist/src/gateway.js +119 -296
- package/dist/src/index.d.ts +4 -5
- package/dist/src/index.js +3 -4
- package/dist/src/live.d.ts +17 -0
- package/dist/src/live.js +109 -0
- package/dist/src/notes.d.ts +11 -0
- package/dist/src/notes.js +64 -0
- package/dist/src/oauth.d.ts +16 -0
- package/dist/src/oauth.js +46 -0
- package/dist/src/programs.d.ts +36 -0
- package/dist/src/programs.js +198 -0
- package/dist/src/signin.d.ts +12 -3
- package/dist/src/signin.js +30 -6
- package/package.json +4 -11
- package/dist/bundled/index.json +0 -6
- package/dist/bundled/sha256-0e91cc3d0e9762b81abc2427b5496b20f383abcd6fb97d928a8d50e956b54d1f.agentorg +0 -0
- package/dist/bundled/sha256-1f64ca62a0209d767d6aa6c4feb50b0653d60f10bebbc301f79bd3a37e0153c1.agentorg +0 -0
- package/dist/bundled/sha256-4055f8fddf6b90f3d356543f554b2a9e9a2c4a8827a8774f8f87952dc1692331.agentorg +0 -0
- package/dist/bundled/sha256-e356ea3c1899138a8494baf521556831006f38534fa9e92ae873e7e6956c3a46.agentorg +0 -0
- package/dist/node_modules/@agentorg/hub/dist/src/build.d.ts +0 -17
- package/dist/node_modules/@agentorg/hub/dist/src/build.js +0 -120
- package/dist/node_modules/@agentorg/hub/dist/src/logs.d.ts +0 -33
- package/dist/node_modules/@agentorg/hub/dist/src/logs.js +0 -162
- package/dist/node_modules/@agentorg/hub/dist/src/net.d.ts +0 -41
- package/dist/node_modules/@agentorg/hub/dist/src/net.js +0 -265
- package/dist/node_modules/@agentorg/hub/dist/src/processes.d.ts +0 -78
- package/dist/node_modules/@agentorg/hub/dist/src/processes.js +0 -485
- package/dist/node_modules/@agentorg/hub/dist/src/storage.d.ts +0 -38
- package/dist/node_modules/@agentorg/hub/dist/src/storage.js +0 -194
- package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.d.ts +0 -6
- package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.js +0 -7
- package/dist/node_modules/@agentorg/interfaces/dist/src/installer.d.ts +0 -191
- package/dist/node_modules/@agentorg/interfaces/dist/src/installer.js +0 -136
- package/dist/node_modules/@agentorg/interfaces/dist/src/layout.d.ts +0 -47
- package/dist/node_modules/@agentorg/interfaces/dist/src/layout.js +0 -52
- package/dist/node_modules/@agentorg/interfaces/dist/src/rules.d.ts +0 -35
- package/dist/node_modules/@agentorg/interfaces/dist/src/rules.js +0 -37
- package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.d.ts +0 -23
- package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.js +0 -31
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.d.ts +0 -14
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.js +0 -26
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.d.ts +0 -27
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.js +0 -26
- package/dist/node_modules/@agentorg/kit/dist/src/chat.d.ts +0 -37
- package/dist/node_modules/@agentorg/kit/dist/src/chat.js +0 -131
- package/dist/node_modules/@agentorg/kit/dist/src/components.d.ts +0 -94
- package/dist/node_modules/@agentorg/kit/dist/src/components.js +0 -66
- package/dist/node_modules/@agentorg/kit/dist/src/icons.d.ts +0 -17
- package/dist/node_modules/@agentorg/kit/dist/src/icons.js +0 -30
- package/dist/node_modules/@agentorg/kit/dist/src/index.d.ts +0 -6
- package/dist/node_modules/@agentorg/kit/dist/src/index.js +0 -10
- package/dist/node_modules/@agentorg/kit/dist/src/markdown.d.ts +0 -9
- package/dist/node_modules/@agentorg/kit/dist/src/markdown.js +0 -14
- package/dist/node_modules/@agentorg/kit/dist/src/resizable.d.ts +0 -5
- package/dist/node_modules/@agentorg/kit/dist/src/resizable.js +0 -8
- package/dist/node_modules/@agentorg/kit/dist/src/styles.d.ts +0 -11
- package/dist/node_modules/@agentorg/kit/dist/src/styles.js +0 -166
- package/dist/node_modules/@agentorg/kit/package.json +0 -44
- package/dist/node_modules/@agentorg/sdk/dist/frame/runtime.js +0 -753
- package/dist/node_modules/@agentorg/sdk/dist/host/runner.js +0 -21963
- package/dist/node_modules/@agentorg/sdk/dist/src/build.d.ts +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/build.js +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/client-http.d.ts +0 -24
- package/dist/node_modules/@agentorg/sdk/dist/src/client-http.js +0 -247
- package/dist/node_modules/@agentorg/sdk/dist/src/describe.d.ts +0 -13
- package/dist/node_modules/@agentorg/sdk/dist/src/describe.js +0 -16
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.d.ts +0 -8
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.js +0 -64
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.d.ts +0 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.js +0 -35
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.d.ts +0 -57
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.js +0 -293
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.d.ts +0 -124
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.js +0 -16
- package/dist/node_modules/@agentorg/sdk/dist/src/frame.d.ts +0 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/frame.js +0 -248
- package/dist/node_modules/@agentorg/sdk/dist/src/host-main.d.ts +0 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/host-main.js +0 -60
- package/dist/node_modules/@agentorg/sdk/dist/src/host.d.ts +0 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/host.js +0 -92
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.d.ts +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.js +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest.d.ts +0 -56
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest.js +0 -165
- package/dist/node_modules/@agentorg/sdk/dist/src/package.d.ts +0 -60
- package/dist/node_modules/@agentorg/sdk/dist/src/package.js +0 -538
- package/dist/node_modules/@agentorg/sdk/dist/src/tar.d.ts +0 -7
- package/dist/node_modules/@agentorg/sdk/dist/src/tar.js +0 -71
- package/dist/node_modules/@agentorg/shell/dist/agent-bindings.js +0 -59
- package/dist/node_modules/@agentorg/shell/src/agent-bindings.ts +0 -107
- package/dist/src/frames.d.ts +0 -23
- package/dist/src/frames.js +0 -78
- package/dist/src/layout.d.ts +0 -44
- package/dist/src/layout.js +0 -90
- package/dist/src/model.d.ts +0 -54
- package/dist/src/model.js +0 -299
- package/dist/src/rules.d.ts +0 -71
- package/dist/src/rules.js +0 -157
- package/dist/src/transfer.d.ts +0 -30
- package/dist/src/transfer.js +0 -110
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type { components } from "./generated/schema.js";
|
|
2
|
+
type Schemas = components["schemas"];
|
|
3
|
+
export type ComputerInfo = Schemas["Computer"];
|
|
4
|
+
export type ComputerDetail = Schemas["ComputerDetail"];
|
|
5
|
+
export type ServiceInfo = Schemas["ServiceInfo"];
|
|
6
|
+
export type ComputerLog = Schemas["ComputerLogs"]["logs"][number];
|
|
7
|
+
export type LiveSurface = Schemas["Surface"];
|
|
8
|
+
export type LiveMode = Schemas["LiveMode"];
|
|
9
|
+
export type LiveSession = Schemas["LiveSession"];
|
|
10
|
+
/**
|
|
11
|
+
* What happens to a terminal, as it happens: the agent's command or a person's shell. And
|
|
12
|
+
* `refused`, with why, when what this connection asked wasn't done.
|
|
13
|
+
*/
|
|
14
|
+
export type TerminalEvent = Schemas["TerminalEvent"];
|
|
15
|
+
export interface LiveHandle {
|
|
16
|
+
close(): void;
|
|
17
|
+
/** Resolves when the socket closes, with why. */
|
|
18
|
+
closed: Promise<{
|
|
19
|
+
code: number;
|
|
20
|
+
reason: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
/** What an operating connection can do. What can't be done comes back as a `refused` event. */
|
|
24
|
+
export interface TerminalsHandle extends LiveHandle {
|
|
25
|
+
/** Start a shell of your own. It arrives as a `start` event, which carries its id. */
|
|
26
|
+
openShell(columns: number, rows: number): void;
|
|
27
|
+
/** Type into a running terminal, the agent's included: a long text as several messages. */
|
|
28
|
+
sendInput(id: string, text: string): void;
|
|
29
|
+
resize(id: string, columns: number, rows: number): void;
|
|
30
|
+
stop(id: string): void;
|
|
31
|
+
}
|
|
32
|
+
export interface ConnectionOpts {
|
|
33
|
+
/** The control token; `AGENTCOMPUTER_API_KEY` by default. */
|
|
34
|
+
apiKey?: string;
|
|
35
|
+
/** The service's address; `AGENTCOMPUTER_API_URL`, else `http://127.0.0.1:7878`. */
|
|
36
|
+
apiUrl?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CreateOpts extends ConnectionOpts {
|
|
39
|
+
access: Schemas["Access"];
|
|
40
|
+
browser?: boolean;
|
|
41
|
+
workspace?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
/** How long until it stops, in milliseconds. By default it doesn't. */
|
|
44
|
+
timeoutMs?: number;
|
|
45
|
+
metadata?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
export interface CommandResult {
|
|
48
|
+
exitCode: number;
|
|
49
|
+
output: string;
|
|
50
|
+
seconds: number;
|
|
51
|
+
}
|
|
52
|
+
export interface RunningCommand {
|
|
53
|
+
sessionId: string;
|
|
54
|
+
output: string;
|
|
55
|
+
}
|
|
56
|
+
/** The service refused, or a computer's tool failed. */
|
|
57
|
+
export declare class ComputerError extends Error {
|
|
58
|
+
readonly code: number;
|
|
59
|
+
constructor(code: number, message: string);
|
|
60
|
+
}
|
|
61
|
+
/** What the command tools answer. */
|
|
62
|
+
interface CommandAnswer {
|
|
63
|
+
exit_code: number | null;
|
|
64
|
+
seconds: number;
|
|
65
|
+
session_id: string | null;
|
|
66
|
+
text: string;
|
|
67
|
+
}
|
|
68
|
+
/** An MCP client for one endpoint, connected when first used. */
|
|
69
|
+
declare class Endpoint {
|
|
70
|
+
#private;
|
|
71
|
+
constructor(url: string | null, token: string);
|
|
72
|
+
text(name: string, args: Record<string, unknown>): Promise<string>;
|
|
73
|
+
command(name: string, args: Record<string, unknown>): Promise<CommandAnswer>;
|
|
74
|
+
close(): Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
type Opener = (surface: LiveSurface, mode: LiveMode) => Promise<LiveSession>;
|
|
77
|
+
/** Every terminal on the computer: the agent's commands and a person's shells alike. */
|
|
78
|
+
declare class Terminals {
|
|
79
|
+
#private;
|
|
80
|
+
constructor(open: Opener);
|
|
81
|
+
/**
|
|
82
|
+
* Each terminal as it starts, writes and exits: those already there first, each with the end of
|
|
83
|
+
* what it wrote. Operating, the default, can also open a shell and act on any of them.
|
|
84
|
+
*/
|
|
85
|
+
connect(opts: {
|
|
86
|
+
onEvent: (event: TerminalEvent) => void;
|
|
87
|
+
mode?: LiveMode;
|
|
88
|
+
}): Promise<TerminalsHandle>;
|
|
89
|
+
}
|
|
90
|
+
/** Commands on a computer with the terminal level. */
|
|
91
|
+
declare class Commands {
|
|
92
|
+
#private;
|
|
93
|
+
constructor(endpoint: Endpoint);
|
|
94
|
+
/** Run a command to its end. */
|
|
95
|
+
run(cmd: string, opts?: {
|
|
96
|
+
cwd?: string;
|
|
97
|
+
}): Promise<CommandResult>;
|
|
98
|
+
/** Start a command and return while it runs, unless it ends at once. */
|
|
99
|
+
run(cmd: string, opts: {
|
|
100
|
+
cwd?: string;
|
|
101
|
+
background: true;
|
|
102
|
+
}): Promise<RunningCommand | CommandResult>;
|
|
103
|
+
/** Type into a running command, and return what it wrote since. */
|
|
104
|
+
sendStdin(sessionId: string, data: string): Promise<string>;
|
|
105
|
+
}
|
|
106
|
+
/** Files in a computer's workspace. */
|
|
107
|
+
declare class Files {
|
|
108
|
+
#private;
|
|
109
|
+
constructor(endpoint: Endpoint);
|
|
110
|
+
/** A text file's content, whole: a line too long for the tool to return is an error. */
|
|
111
|
+
read(path: string): Promise<string>;
|
|
112
|
+
/** Make a new file, or fill an empty one. */
|
|
113
|
+
write(path: string, content: string): Promise<void>;
|
|
114
|
+
/** Replace exact text, and return the unified diff. */
|
|
115
|
+
edit(path: string, oldText: string, newText: string, opts?: {
|
|
116
|
+
replaceAll?: boolean;
|
|
117
|
+
}): Promise<string>;
|
|
118
|
+
/** A folder's entries, the first thousand. */
|
|
119
|
+
list(path?: string): Promise<({
|
|
120
|
+
name: string;
|
|
121
|
+
type: "dir";
|
|
122
|
+
size?: undefined;
|
|
123
|
+
} | {
|
|
124
|
+
name: string;
|
|
125
|
+
type: "file";
|
|
126
|
+
size: number;
|
|
127
|
+
})[]>;
|
|
128
|
+
/** Lines matching text under a folder, as `path:line:text`. */
|
|
129
|
+
search(pattern: string, opts?: {
|
|
130
|
+
path?: string;
|
|
131
|
+
regex?: boolean;
|
|
132
|
+
}): Promise<string[]>;
|
|
133
|
+
}
|
|
134
|
+
/** One computer. Make one with `Computer.create`. */
|
|
135
|
+
export declare class Computer {
|
|
136
|
+
#private;
|
|
137
|
+
readonly computerID: string;
|
|
138
|
+
readonly commands: Commands;
|
|
139
|
+
readonly files: Files;
|
|
140
|
+
readonly terminals: Terminals;
|
|
141
|
+
private constructor();
|
|
142
|
+
static create(opts: CreateOpts): Promise<Computer>;
|
|
143
|
+
/** A computer made earlier. Its token was shown when it was made, and only then. */
|
|
144
|
+
static connect(computerID: string, opts: ConnectionOpts & {
|
|
145
|
+
accessToken: string;
|
|
146
|
+
}): Promise<Computer>;
|
|
147
|
+
static list(opts?: ConnectionOpts & {
|
|
148
|
+
state?: Schemas["ComputerState"];
|
|
149
|
+
}): Promise<ComputerInfo[]>;
|
|
150
|
+
static serviceInfo(opts?: ConnectionOpts): Promise<ServiceInfo>;
|
|
151
|
+
static getInfo(computerID: string, opts?: ConnectionOpts): Promise<ComputerDetail>;
|
|
152
|
+
/** It now stops this long from now, replacing any earlier timeout. */
|
|
153
|
+
static setTimeout(computerID: string, timeoutMs: number, opts?: ConnectionOpts): Promise<ComputerInfo>;
|
|
154
|
+
static stop(computerID: string, opts?: ConnectionOpts): Promise<ComputerInfo>;
|
|
155
|
+
static start(computerID: string, opts?: ConnectionOpts & {
|
|
156
|
+
timeoutMs?: number;
|
|
157
|
+
}): Promise<ComputerInfo>;
|
|
158
|
+
static getLogs(computerID: string, opts?: ConnectionOpts): Promise<ComputerLog[]>;
|
|
159
|
+
/** A one-time ticket to open one of its surfaces live, within a minute. */
|
|
160
|
+
static createLiveSession(computerID: string, session: {
|
|
161
|
+
surface: LiveSurface;
|
|
162
|
+
mode?: LiveMode;
|
|
163
|
+
}, opts?: ConnectionOpts): Promise<LiveSession>;
|
|
164
|
+
static kill(computerID: string, opts?: ConnectionOpts): Promise<void>;
|
|
165
|
+
/** The endpoint to give an MCP client. */
|
|
166
|
+
getMcpUrl(endpoint?: "computer" | "browser"): string;
|
|
167
|
+
/** The token for those endpoints. */
|
|
168
|
+
getMcpToken(): string;
|
|
169
|
+
getInfo(): Promise<{
|
|
170
|
+
computerID: string;
|
|
171
|
+
name: string;
|
|
172
|
+
state: components["schemas"]["ComputerState"];
|
|
173
|
+
access: components["schemas"]["Access"];
|
|
174
|
+
browser: boolean;
|
|
175
|
+
workspace: string | null;
|
|
176
|
+
startedAt: string;
|
|
177
|
+
endAt: string | null;
|
|
178
|
+
metadata: components["schemas"]["Metadata"];
|
|
179
|
+
endpoints: components["schemas"]["Endpoints"];
|
|
180
|
+
} & {
|
|
181
|
+
uptimeSeconds: number;
|
|
182
|
+
surfaces: components["schemas"]["SurfaceInfo"][];
|
|
183
|
+
tools: {
|
|
184
|
+
computer: string[];
|
|
185
|
+
browser: string[];
|
|
186
|
+
};
|
|
187
|
+
}>;
|
|
188
|
+
isRunning(): Promise<boolean>;
|
|
189
|
+
setTimeout(timeoutMs: number): Promise<{
|
|
190
|
+
computerID: string;
|
|
191
|
+
name: string;
|
|
192
|
+
state: components["schemas"]["ComputerState"];
|
|
193
|
+
access: components["schemas"]["Access"];
|
|
194
|
+
browser: boolean;
|
|
195
|
+
workspace: string | null;
|
|
196
|
+
startedAt: string;
|
|
197
|
+
endAt: string | null;
|
|
198
|
+
metadata: components["schemas"]["Metadata"];
|
|
199
|
+
endpoints: components["schemas"]["Endpoints"];
|
|
200
|
+
}>;
|
|
201
|
+
stop(): Promise<{
|
|
202
|
+
computerID: string;
|
|
203
|
+
name: string;
|
|
204
|
+
state: components["schemas"]["ComputerState"];
|
|
205
|
+
access: components["schemas"]["Access"];
|
|
206
|
+
browser: boolean;
|
|
207
|
+
workspace: string | null;
|
|
208
|
+
startedAt: string;
|
|
209
|
+
endAt: string | null;
|
|
210
|
+
metadata: components["schemas"]["Metadata"];
|
|
211
|
+
endpoints: components["schemas"]["Endpoints"];
|
|
212
|
+
}>;
|
|
213
|
+
start(opts?: {
|
|
214
|
+
timeoutMs?: number;
|
|
215
|
+
}): Promise<{
|
|
216
|
+
computerID: string;
|
|
217
|
+
name: string;
|
|
218
|
+
state: components["schemas"]["ComputerState"];
|
|
219
|
+
access: components["schemas"]["Access"];
|
|
220
|
+
browser: boolean;
|
|
221
|
+
workspace: string | null;
|
|
222
|
+
startedAt: string;
|
|
223
|
+
endAt: string | null;
|
|
224
|
+
metadata: components["schemas"]["Metadata"];
|
|
225
|
+
endpoints: components["schemas"]["Endpoints"];
|
|
226
|
+
}>;
|
|
227
|
+
liveSession(surface: LiveSurface, mode?: LiveMode): Promise<{
|
|
228
|
+
url: string;
|
|
229
|
+
protocol: string;
|
|
230
|
+
surface: components["schemas"]["Surface"];
|
|
231
|
+
mode: components["schemas"]["LiveMode"];
|
|
232
|
+
expiresAt: string;
|
|
233
|
+
}>;
|
|
234
|
+
getLogs(): Promise<{
|
|
235
|
+
timestamp: string;
|
|
236
|
+
line: string;
|
|
237
|
+
}[]>;
|
|
238
|
+
kill(): Promise<void>;
|
|
239
|
+
/** Close this object's connection. The computer keeps running. */
|
|
240
|
+
close(): Promise<void>;
|
|
241
|
+
}
|
|
242
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ComputerProvider, type ComputerProviderOptions, startComputerProvider, } from "./provider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { startComputerProvider, } from "./provider.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Timing } from "@agentorg/mcp";
|
|
2
|
+
import { type Log } from "@agentorg/sdk";
|
|
3
|
+
export interface ComputerProviderOptions {
|
|
4
|
+
hubUrl: string;
|
|
5
|
+
/** The provider's own Actor, bound to `hub.actors@1` at its slot `actors`. */
|
|
6
|
+
actorId: string;
|
|
7
|
+
credential: string;
|
|
8
|
+
/** A private folder of the provider's, which holds each connection's Hub credential. */
|
|
9
|
+
dir: string;
|
|
10
|
+
/** Where a service on this machine writes its address and token; the service's own default. */
|
|
11
|
+
dataFolder?: string;
|
|
12
|
+
/** Where an agent's own folder goes when none is named; `~/Agents` by default. */
|
|
13
|
+
agentsFolder?: string;
|
|
14
|
+
/** The hosted server the web unit connects to; Exa's by default. For tests. */
|
|
15
|
+
webUrl?: string;
|
|
16
|
+
log?: Log;
|
|
17
|
+
timing?: Timing;
|
|
18
|
+
}
|
|
19
|
+
export interface ComputerProvider {
|
|
20
|
+
/** Leave the Hub and let every connection go. The computers stay, and resume at the next start. */
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** Run the units' provider as an Actor exporting `unit.provider@1` as `provider`. */
|
|
24
|
+
export declare function startComputerProvider(options: ComputerProviderOptions): Promise<ComputerProvider>;
|