@parcha/agentrun-computer 0.1.0-beta.37 → 0.1.0-beta.39

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.
Files changed (124) hide show
  1. package/README.md +341 -260
  2. package/box/Dockerfile +18 -1
  3. package/box/README.md +14 -0
  4. package/box/build-daytona.py +2 -2
  5. package/box/build-e2b.mjs +41 -18
  6. package/box/recipe.d.mts +5 -0
  7. package/box/recipe.mjs +43 -0
  8. package/dist/agent37.d.ts +18 -66
  9. package/dist/agent37.js +187 -464
  10. package/dist/box-image.d.ts +14 -0
  11. package/dist/box-image.js +24 -0
  12. package/dist/browserbase.d.ts +0 -6
  13. package/dist/browserbase.js +1 -5
  14. package/dist/client.d.ts +12 -3
  15. package/dist/client.js +39 -4
  16. package/dist/computerd-linux-amd64 +0 -0
  17. package/dist/computerd-linux-arm64 +0 -0
  18. package/dist/computerd.json +4 -0
  19. package/dist/conformance/agent37.d.ts +9 -4
  20. package/dist/conformance/agent37.js +23 -11
  21. package/dist/conformance/browserbase.js +3 -3
  22. package/dist/conformance/cases/apps.d.ts +6 -0
  23. package/dist/conformance/cases/apps.js +18 -5
  24. package/dist/conformance/cases/isolation.d.ts +22 -5
  25. package/dist/conformance/cases/isolation.js +97 -16
  26. package/dist/conformance/cases/mount.js +5 -3
  27. package/dist/conformance/cases/provider.js +41 -0
  28. package/dist/conformance/cli.js +72 -11
  29. package/dist/conformance/daytona.d.ts +9 -20
  30. package/dist/conformance/daytona.js +12 -21
  31. package/dist/conformance/e2b.js +9 -4
  32. package/dist/conformance/exec-stream.d.ts +52 -0
  33. package/dist/conformance/exec-stream.js +493 -0
  34. package/dist/conformance/kernel.js +2 -2
  35. package/dist/conformance/modal.js +1 -1
  36. package/dist/conformance/orgo.js +2 -2
  37. package/dist/conformance/sweep.js +8 -8
  38. package/dist/conformance/types.d.ts +2 -2
  39. package/dist/create-requests.d.ts +1 -1
  40. package/dist/daytona.d.ts +17 -133
  41. package/dist/daytona.js +396 -1452
  42. package/dist/descriptor.d.ts +11 -4
  43. package/dist/descriptor.js +7 -0
  44. package/dist/descriptors/agent37.d.ts +3 -11
  45. package/dist/descriptors/agent37.js +9 -10
  46. package/dist/descriptors/daytona.d.ts +7 -6
  47. package/dist/descriptors/daytona.js +14 -7
  48. package/dist/descriptors/docker.d.ts +13 -1
  49. package/dist/descriptors/docker.js +3 -1
  50. package/dist/descriptors/e2b.d.ts +2 -9
  51. package/dist/descriptors/e2b.js +8 -8
  52. package/dist/descriptors/index.d.ts +25 -24
  53. package/dist/descriptors/index.js +1 -3
  54. package/dist/descriptors/modal.d.ts +2 -6
  55. package/dist/descriptors/modal.js +8 -6
  56. package/dist/descriptors/orgo.js +2 -1
  57. package/dist/descriptors/shared.d.ts +1 -1
  58. package/dist/descriptors/shared.js +2 -2
  59. package/dist/desktop.d.ts +18 -4
  60. package/dist/desktop.js +89 -9
  61. package/dist/docker/egress-main.js +23 -15
  62. package/dist/docker/egress.d.ts +6 -4
  63. package/dist/docker/egress.js +24 -16
  64. package/dist/docker/inspect.d.ts +2 -2
  65. package/dist/docker/inspect.js +5 -5
  66. package/dist/docker.d.ts +6 -11
  67. package/dist/docker.js +13 -16
  68. package/dist/drift.js +4 -4
  69. package/dist/e2b.d.ts +22 -130
  70. package/dist/e2b.js +163 -243
  71. package/dist/host.d.ts +136 -104
  72. package/dist/host.js +8 -1
  73. package/dist/hosted/network.d.ts +23 -0
  74. package/dist/hosted/network.js +77 -0
  75. package/dist/hosted/process.d.ts +24 -8
  76. package/dist/hosted/process.js +80 -44
  77. package/dist/hosted/provider.d.ts +38 -22
  78. package/dist/hosted/provider.js +500 -341
  79. package/dist/hosted/rest.d.ts +74 -0
  80. package/dist/hosted/rest.js +126 -0
  81. package/dist/hosted/scripts.d.ts +21 -3
  82. package/dist/hosted/scripts.js +76 -14
  83. package/dist/hosted/ssh-exec.d.ts +99 -0
  84. package/dist/hosted/ssh-exec.js +464 -0
  85. package/dist/hosted/values.d.ts +26 -0
  86. package/dist/hosted/values.js +63 -0
  87. package/dist/index.d.ts +2 -2
  88. package/dist/index.js +2 -2
  89. package/dist/isolation.d.ts +0 -2
  90. package/dist/isolation.js +3 -4
  91. package/dist/kernel.d.ts +0 -6
  92. package/dist/kernel.js +1 -5
  93. package/dist/kinds.d.ts +3 -1
  94. package/dist/local-chrome.d.ts +0 -6
  95. package/dist/local-chrome.js +1 -5
  96. package/dist/modal.d.ts +15 -86
  97. package/dist/modal.js +67 -185
  98. package/dist/mount-archil.d.ts +13 -8
  99. package/dist/mount-archil.js +27 -17
  100. package/dist/mount.d.ts +10 -4
  101. package/dist/mount.js +8 -4
  102. package/dist/orgo.d.ts +0 -9
  103. package/dist/orgo.js +8 -13
  104. package/dist/phone-harness.d.ts +0 -6
  105. package/dist/phone-harness.js +0 -4
  106. package/dist/protocol.d.ts +4 -1
  107. package/dist/protocol.js +1 -0
  108. package/dist/provider.d.ts +2 -2
  109. package/dist/providers.d.ts +15 -13
  110. package/dist/screen-watch.js +34 -6
  111. package/dist/surface/api.d.ts +14 -11
  112. package/dist/surface/core.d.ts +23 -5
  113. package/dist/surface/core.js +105 -15
  114. package/dist/surface/index.d.ts +1 -1
  115. package/dist/surface/index.js +1 -1
  116. package/dist/surface/outline.d.ts +2 -0
  117. package/dist/surface/outline.js +2 -1
  118. package/dist/surface/script.d.ts +4 -0
  119. package/dist/surface/script.js +11 -3
  120. package/dist/ui-engine.js +19 -3
  121. package/package.json +2 -3
  122. package/box/build-agent37.mjs +0 -177
  123. package/dist/conformance/daytona-sweep.d.ts +0 -18
  124. package/dist/conformance/daytona-sweep.js +0 -126
package/dist/e2b.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { HostedProvider, type HostedOptions, type HostedTimeouts } from "./hosted/provider.js";
2
- import type { KindCapabilities } from "./kinds.js";
3
- import type { MountKind } from "./mount.js";
4
- /** What every SDK call is given: the key, the domain and the API URL explicitly, and debug false (index.mjs:1126-1152). */
2
+ import { type Result } from "./result.js";
3
+ /**
4
+ * What every SDK call is given: the key, the domain and the API URL explicitly, and debug false (index.mjs:1126-1152).
5
+ * The SDK's types below are `import type`: erased at build, so nothing loads the SDK from here and the published types
6
+ * name none of it (the package declares no dependency on e2b).
7
+ */
5
8
  export interface E2BConnectionOptions {
6
9
  apiKey: string;
7
10
  domain: string;
@@ -10,129 +13,13 @@ export interface E2BConnectionOptions {
10
13
  requestTimeoutMs?: number;
11
14
  signal?: AbortSignal;
12
15
  }
13
- /** Sandbox.create's options as the provider gives them (SandboxOpts, index.d.mts:10140-10245). */
14
- export interface E2BCreateOptions extends E2BConnectionOptions {
15
- timeoutMs: number;
16
- metadata: Record<string, string>;
17
- envs: Record<string, string>;
18
- allowInternetAccess: boolean;
19
- network: {
20
- allowPublicTraffic: boolean;
21
- };
22
- lifecycle: {
23
- onTimeout: "kill";
24
- };
25
- }
26
- /** What getInfo reports of a sandbox, as far as this provider reads it (index.mjs:5432-5465). */
27
- export interface E2BSandboxInfo {
28
- sandboxId: string;
29
- templateId: string;
30
- name?: string;
31
- metadata: Record<string, string>;
32
- allowInternetAccess?: boolean;
33
- startedAt: Date;
34
- endAt: Date;
35
- state: string;
36
- network?: {
37
- allowOut?: string[];
38
- denyOut?: string[];
39
- allowPublicTraffic?: boolean;
40
- egressProxy?: unknown;
41
- rules?: unknown;
42
- dnsServers?: unknown;
43
- };
44
- lifecycle?: {
45
- onTimeout?: string;
46
- autoResume?: boolean;
47
- };
48
- }
49
- /** One sandbox in a page of Sandbox.list (index.mjs:5820-5838). */
50
- export interface E2BListedSandbox {
51
- sandboxId: string;
52
- metadata: Record<string, string>;
53
- state: string;
54
- startedAt: Date;
55
- endAt: Date;
56
- }
57
- /** The result of a command that has ended (index.mjs:2751-2757); CommandExitError carries the same fields. */
58
- export interface E2BCommandResult {
59
- exitCode: number;
60
- stdout: string;
61
- stderr: string;
62
- }
63
- /** A background command (CommandHandle, index.mjs:2683-2810). */
64
- export interface E2BCommandHandle {
65
- readonly pid: number;
66
- readonly stderr: string;
67
- wait(): Promise<E2BCommandResult>;
68
- kill(): Promise<boolean>;
69
- disconnect(): Promise<void>;
70
- }
71
- export interface E2BRunOptions {
72
- user: "root";
73
- timeoutMs: number;
74
- requestTimeoutMs: number;
75
- signal?: AbortSignal;
76
- }
77
- /** The part of a connected Sandbox called here: commands and files (index.mjs:5917-5989). */
78
- export interface E2BSandbox {
79
- readonly sandboxId: string;
80
- readonly files: {
81
- write(path: string, data: ArrayBuffer, options: {
82
- user: "root";
83
- requestTimeoutMs: number;
84
- signal?: AbortSignal;
85
- }): Promise<unknown>;
86
- };
87
- readonly commands: {
88
- run(command: string, options: E2BRunOptions & {
89
- background?: false;
90
- }): Promise<E2BCommandResult>;
91
- run(command: string, options: E2BRunOptions & {
92
- background: true;
93
- stdin?: boolean;
94
- retainOutput?: boolean;
95
- onStdout?: (data: string) => void;
96
- onStderr?: (data: string) => void;
97
- }): Promise<E2BCommandHandle>;
98
- sendStdin(pid: number, data: Uint8Array, options: {
99
- requestTimeoutMs: number;
100
- }): Promise<void>;
101
- /** Ends a command's stdin, so it reads end of file (index.mjs:5071-5082). */
102
- closeStdin(pid: number, options: {
103
- requestTimeoutMs: number;
104
- }): Promise<void>;
105
- };
106
- }
107
- /** The paginator Sandbox.list returns (SandboxPaginator, index.mjs:5785-5849). */
108
- export interface E2BPaginator {
109
- readonly hasNext: boolean;
110
- nextItems(options: {
111
- requestTimeoutMs: number;
112
- signal?: AbortSignal;
113
- }): Promise<E2BListedSandbox[]>;
114
- }
115
- /** The statics of the SDK's Sandbox class this provider calls. The host's own, or anything with the same slice. */
116
- export interface E2BSandboxClass {
117
- create(template: string, options: E2BCreateOptions): Promise<E2BSandbox>;
118
- connect(sandboxId: string, options: E2BConnectionOptions & {
119
- timeoutMs: number;
120
- }): Promise<E2BSandbox>;
121
- getInfo(sandboxId: string, options: E2BConnectionOptions): Promise<E2BSandboxInfo>;
122
- setTimeout(sandboxId: string, timeoutMs: number, options: E2BConnectionOptions): Promise<void>;
123
- kill(sandboxId: string, options: E2BConnectionOptions): Promise<boolean>;
124
- list(options: Omit<E2BConnectionOptions, "signal"> & {
125
- query: {
126
- metadata: Record<string, string>;
127
- };
128
- limit: number;
129
- }): E2BPaginator;
130
- }
16
+ /** The SDK's Sandbox class, the host's own `e2b` package's. Held as the SDK's type inside; the published type is `object`. */
17
+ export type E2BSandboxClass = object;
131
18
  /** The E2B provider's options: the key and the SDK, then the shared adapter's (HostedOptions). */
132
- export interface E2BProviderOptions extends Omit<HostedOptions, "label" | "maxLifetimeMs"> {
19
+ export interface E2BProviderOptions extends Omit<HostedOptions, "maxLifetimeMs"> {
133
20
  /** The E2B API key. The caller passes it; this provider never reads it from the environment or puts it in a computer. */
134
21
  apiKey: string;
135
- /** The SDK's Sandbox class: the host's `e2b` package's, or anything with the same slice. */
22
+ /** The SDK's Sandbox class: the host's `e2b` package's. */
136
23
  Sandbox: E2BSandboxClass;
137
24
  /** E2B's domain: the API is https://api.<domain>. Default e2b.app. */
138
25
  domain?: string;
@@ -144,7 +31,7 @@ export interface E2BProviderOptions extends Omit<HostedOptions, "label" | "maxLi
144
31
  }
145
32
  /**
146
33
  * What create() takes: the provider's options, the SDK's Sandbox class optional (default the host's e2b package's).
147
- * Not E2BCreateOptions, which is the SDK's own Sandbox.create options.
34
+ * Not SandboxOpts, which is the SDK's own Sandbox.create options.
148
35
  */
149
36
  export interface E2BOptions extends Omit<E2BProviderOptions, "Sandbox"> {
150
37
  /** The SDK's Sandbox class; imported from the host's e2b package by default. */
@@ -164,14 +51,19 @@ export declare function connectionOptions({ apiKey, domain }: {
164
51
  export declare function create(options: E2BOptions): Promise<E2BProvider>;
165
52
  /** The conformance CLI's module for E2B: its live switch, the run's 30-minute cap, its template and the drifted twin. */
166
53
  export declare const conformance: () => Promise<typeof import("./conformance/e2b.js")>;
167
- /** The mount kinds an E2B computer takes, as capabilities().mount declares them: the run's folder on an Archil disk. */
168
- export declare const MOUNT: readonly MountKind[];
169
- /** The machine kind and groups of each configuration: kind linux (the plain template), and kind desktop (the default). */
170
- export declare const CAPABILITIES: readonly KindCapabilities[];
171
54
  /**
172
- * Computers that are E2B sandboxes, on the shared adapter. A spec's image is an E2B template (its name or id):
173
- * "desktop" is E2B Desktop's, with Xvfb, x11vnc and noVNC (e2b-dev/desktop template.py:21-65).
55
+ * Computers that are E2B sandboxes, on the shared adapter. A spec's image is an E2B template (its name or id). A server
56
+ * starts every one, sandbox or desktop, from the box template prepareImage() answers: the box image (box/Dockerfile)
57
+ * with Archil's client and its root helper, Xvfb, xfwm4 and the desktop's apps, which the provider starts through
58
+ * computerd (desktop.ts). Any other template a spec names must carry what the computer's kind needs.
174
59
  */
175
60
  export declare class E2BProvider extends HostedProvider {
61
+ /**
62
+ * The provider contract's prepareImage (its descriptor declares it): the box template the release publishes,
63
+ * public under its E2B team (box-image.ts boxE2bTemplate), which any E2B account starts by that name. No call: E2B
64
+ * starts a public template at create with nothing to pull ahead of it, so onWait is never told. A desktop starts
65
+ * from the same template as a sandbox: the kind is the provider's, not the image's.
66
+ */
67
+ prepareImage(): Promise<Result<string>>;
176
68
  constructor(options: E2BProviderOptions);
177
69
  }