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

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 (148) hide show
  1. package/NOTICE +2 -0
  2. package/README.md +423 -323
  3. package/box/Dockerfile +3 -1
  4. package/box/agentrun-archil +59 -7
  5. package/box/build-agent37.mjs +177 -0
  6. package/box/build-daytona.py +20 -4
  7. package/dist/agent37.d.ts +165 -0
  8. package/dist/agent37.js +759 -0
  9. package/dist/attach.d.ts +146 -0
  10. package/dist/attach.js +469 -0
  11. package/dist/browser.d.ts +61 -10
  12. package/dist/browser.js +125 -3
  13. package/dist/browserbase.d.ts +46 -23
  14. package/dist/browserbase.js +162 -17
  15. package/dist/chrome.d.ts +3 -4
  16. package/dist/chrome.js +6 -11
  17. package/dist/client.d.ts +33 -1
  18. package/dist/client.js +53 -0
  19. package/dist/computerd-linux-amd64 +0 -0
  20. package/dist/computerd-linux-arm64 +0 -0
  21. package/dist/conformance/agent37.d.ts +96 -0
  22. package/dist/conformance/agent37.js +154 -0
  23. package/dist/conformance/cases/apps.d.ts +5 -0
  24. package/dist/conformance/cases/apps.js +160 -73
  25. package/dist/conformance/cases/health.js +14 -0
  26. package/dist/conformance/cases/index.js +2 -0
  27. package/dist/conformance/cases/provider.js +27 -1
  28. package/dist/conformance/cases/screen.d.ts +3 -0
  29. package/dist/conformance/cases/screen.js +18 -0
  30. package/dist/conformance/cases/settings.d.ts +29 -23
  31. package/dist/conformance/cases/settings.js +76 -58
  32. package/dist/conformance/cases/touch.js +19 -17
  33. package/dist/conformance/cases/ui.d.ts +2 -0
  34. package/dist/conformance/cases/ui.js +475 -0
  35. package/dist/conformance/cli.d.ts +9 -0
  36. package/dist/conformance/cli.js +28 -3
  37. package/dist/conformance/daytona.d.ts +4 -0
  38. package/dist/conformance/daytona.js +5 -0
  39. package/dist/conformance/e2b.d.ts +6 -0
  40. package/dist/conformance/e2b.js +9 -2
  41. package/dist/conformance/fixture.d.ts +1 -1
  42. package/dist/conformance/fixture.js +25 -1
  43. package/dist/conformance/modal.d.ts +17 -13
  44. package/dist/conformance/modal.js +18 -9
  45. package/dist/conformance/orgo.d.ts +3 -3
  46. package/dist/conformance/orgo.js +6 -8
  47. package/dist/conformance/phone-harness.d.ts +6 -2
  48. package/dist/conformance/phone-harness.js +21 -4
  49. package/dist/conformance/report.js +1 -1
  50. package/dist/conformance/runner.js +23 -4
  51. package/dist/conformance/sweep.d.ts +50 -0
  52. package/dist/conformance/sweep.js +187 -0
  53. package/dist/conformance/types.d.ts +11 -3
  54. package/dist/conformance/ui-fixture.d.ts +56 -0
  55. package/dist/conformance/ui-fixture.js +43 -0
  56. package/dist/create-requests.d.ts +51 -0
  57. package/dist/create-requests.js +121 -0
  58. package/dist/daytona.d.ts +15 -5
  59. package/dist/daytona.js +58 -38
  60. package/dist/descriptor.d.ts +29 -2
  61. package/dist/descriptor.js +13 -0
  62. package/dist/descriptors/agent37.d.ts +41 -0
  63. package/dist/descriptors/agent37.js +28 -0
  64. package/dist/descriptors/browserbase.d.ts +1 -0
  65. package/dist/descriptors/browserbase.js +2 -0
  66. package/dist/descriptors/daytona.d.ts +23 -2
  67. package/dist/descriptors/daytona.js +34 -2
  68. package/dist/descriptors/index.d.ts +66 -3
  69. package/dist/descriptors/index.js +5 -3
  70. package/dist/descriptors/kernel.d.ts +1 -0
  71. package/dist/descriptors/kernel.js +2 -0
  72. package/dist/descriptors/modal.d.ts +4 -0
  73. package/dist/descriptors/modal.js +11 -1
  74. package/dist/descriptors/orgo.d.ts +13 -1
  75. package/dist/descriptors/orgo.js +9 -3
  76. package/dist/descriptors/phone-harness.d.ts +6 -1
  77. package/dist/descriptors/phone-harness.js +5 -2
  78. package/dist/docker/egress.d.ts +4 -3
  79. package/dist/docker/egress.js +7 -6
  80. package/dist/docker.d.ts +7 -4
  81. package/dist/docker.js +278 -34
  82. package/dist/e2b.d.ts +9 -165
  83. package/dist/e2b.js +282 -1342
  84. package/dist/fake-ui-driver.d.ts +97 -0
  85. package/dist/fake-ui-driver.js +717 -0
  86. package/dist/host.d.ts +182 -0
  87. package/dist/host.js +1 -0
  88. package/dist/hosted/process.d.ts +67 -0
  89. package/dist/hosted/process.js +228 -0
  90. package/dist/hosted/provider.d.ts +146 -0
  91. package/dist/hosted/provider.js +1364 -0
  92. package/dist/hosted/scripts.d.ts +76 -0
  93. package/dist/{child.js → hosted/scripts.js} +93 -12
  94. package/dist/index.d.ts +11 -7
  95. package/dist/index.js +10 -7
  96. package/dist/janitor.d.ts +5 -4
  97. package/dist/janitor.js +1 -1
  98. package/dist/kernel.d.ts +17 -27
  99. package/dist/kernel.js +94 -18
  100. package/dist/kinds.d.ts +17 -5
  101. package/dist/kinds.js +20 -4
  102. package/dist/labels.d.ts +10 -2
  103. package/dist/labels.js +30 -7
  104. package/dist/local-chrome.d.ts +5 -5
  105. package/dist/local-chrome.js +10 -5
  106. package/dist/modal.d.ts +23 -181
  107. package/dist/modal.js +273 -1232
  108. package/dist/mount-archil.d.ts +25 -3
  109. package/dist/mount-archil.js +39 -8
  110. package/dist/orgo-channel.d.ts +3 -2
  111. package/dist/orgo-channel.js +5 -2
  112. package/dist/orgo-desktop.d.ts +23 -9
  113. package/dist/orgo-desktop.js +328 -66
  114. package/dist/orgo-names.d.ts +129 -3
  115. package/dist/orgo-names.js +211 -8
  116. package/dist/orgo-workspaces.d.ts +47 -0
  117. package/dist/orgo-workspaces.js +94 -0
  118. package/dist/orgo.d.ts +27 -10
  119. package/dist/orgo.js +411 -81
  120. package/dist/phone-harness.d.ts +31 -21
  121. package/dist/phone-harness.js +510 -681
  122. package/dist/png.d.ts +4 -0
  123. package/dist/png.js +27 -0
  124. package/dist/protocol.d.ts +338 -30
  125. package/dist/protocol.js +96 -3
  126. package/dist/provider.d.ts +97 -7
  127. package/dist/provider.js +24 -3
  128. package/dist/result.d.ts +1 -1
  129. package/dist/surface/api.d.ts +248 -0
  130. package/dist/surface/api.js +1 -0
  131. package/dist/surface/core.d.ts +42 -0
  132. package/dist/surface/core.js +393 -0
  133. package/dist/surface/index.d.ts +5 -0
  134. package/dist/surface/index.js +3 -0
  135. package/dist/surface/outline.d.ts +8 -0
  136. package/dist/surface/outline.js +50 -0
  137. package/dist/surface/script.d.ts +10 -0
  138. package/dist/surface/script.js +92 -0
  139. package/dist/ui-engine.d.ts +114 -0
  140. package/dist/ui-engine.js +798 -0
  141. package/package.json +17 -1
  142. package/dist/child.d.ts +0 -42
  143. package/dist/conformance/e2b-diagnose.d.ts +0 -16
  144. package/dist/conformance/e2b-diagnose.js +0 -61
  145. package/dist/conformance/e2b-sweep.d.ts +0 -18
  146. package/dist/conformance/e2b-sweep.js +0 -132
  147. package/dist/conformance/modal-sweep.d.ts +0 -22
  148. package/dist/conformance/modal-sweep.js +0 -213
@@ -1,7 +1,7 @@
1
+ import type { Duplex } from "node:stream";
1
2
  import type { KindCapabilities } from "./kinds.js";
2
3
  import type { MountKind } from "./mount.js";
3
- import { type Rect, type UiNode } from "./protocol.js";
4
- import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type CreatedComputer, type NetworkPolicy, type NetworkSpec, type Refusal, type ReleaseHow } from "./provider.js";
4
+ import { type AttachedComputer, type CallContext, type ComputerCapabilities, type ComputerConnection, type ComputerInfo, type ComputerProvider, type ComputerRef, type ComputerSpec, type CreateContext, type CreatedComputer, type NetworkPolicy, type NetworkSpec, type Refusal, type ReleaseHow } from "./provider.js";
5
5
  import { type Result } from "./result.js";
6
6
  import { type ScreenWatch, type ScreenWatchHandlers, type WatchOptions } from "./screen-watch.js";
7
7
  /** The phone harness's API. */
@@ -16,8 +16,10 @@ export declare const DEFAULT_MAX_LIFETIME_MS: number;
16
16
  export declare const DEFAULT_READY_MS = 240000;
17
17
  /** One phone this provider made, as its ledger keeps it. */
18
18
  export interface PhoneLedgerEntry {
19
- /** The session's id, the computer's id and name. */
19
+ /** The session's id, the computer's id. */
20
20
  id: string;
21
+ /** The computer's name, its request's (computerNameFor): a create of the same request finds the phone by it. */
22
+ name: string;
21
23
  labels: Record<string, string>;
22
24
  /** The image create was asked for, read back as asked. */
23
25
  image: string;
@@ -39,6 +41,8 @@ export interface PhoneLedgerEntry {
39
41
  /** Where the provider keeps its phones' labels: the vendor keeps none. Each call may be sync or async. */
40
42
  export interface PhoneLedger {
41
43
  put(entry: PhoneLedgerEntry): void | Promise<void>;
44
+ /** entry put only while the ledger holds none under its id, in one step (two writers never both put it): whether it was. */
45
+ claim(entry: PhoneLedgerEntry): boolean | Promise<boolean>;
42
46
  get(id: string): PhoneLedgerEntry | undefined | Promise<PhoneLedgerEntry | undefined>;
43
47
  list(): PhoneLedgerEntry[] | Promise<PhoneLedgerEntry[]>;
44
48
  remove(id: string): void | Promise<void>;
@@ -76,6 +80,16 @@ export interface AdbTransport {
76
80
  timeoutMs: number;
77
81
  transport?: string;
78
82
  }): Promise<Result<string>>;
83
+ /**
84
+ * A service of the phone on transport (exec:<command>) as a stream both ways: the adb server's socket, bound to the
85
+ * phone and then to the service, which carries the command's stdin and stdout raw once both answered OKAY. How phoned
86
+ * is started and spoken to. The stream comes paused, so nothing is lost before the caller listens: it resumes it. The
87
+ * words never hold the service.
88
+ */
89
+ open(service: string, options: {
90
+ timeoutMs: number;
91
+ transport: string;
92
+ }): Promise<Result<Duplex>>;
79
93
  }
80
94
  /** The adb server's port when none is given: adb's own default. */
81
95
  export declare const ADB_SERVER_PORT = 5037;
@@ -125,8 +139,15 @@ export interface PhoneProviderOptions {
125
139
  sleep?: (ms: number) => Promise<void>;
126
140
  /** A signal that fires after ms, which bounds a request; default AbortSignal.timeout. Tests give one they fire. */
127
141
  timeout?: (ms: number) => AbortSignal;
128
- /** The version the phone's hello reports; default the provider's. Only the conformance drift case sets another. */
142
+ /** The version phoned's hello must report; default the provider's own. Only the conformance drift case sets another. */
129
143
  daemonVersion?: string;
144
+ /** phoned, the phone's driver, as its jar (npm run build:phoned); default this package's dist/phoned.jar. */
145
+ phoned?: string;
146
+ /**
147
+ * APK files installed on each phone before phoned starts there (`pm install -r`), as the conformance run installs the
148
+ * ui fixture (npm run build:ui-fixture). Default none. A connect that cannot install one fails in words.
149
+ */
150
+ apks?: string[];
130
151
  }
131
152
  /** The phone-harness provider from its options alone; throws in words when one is missing or wrong. */
132
153
  export declare function create(options: PhoneProviderOptions): Promise<PhoneHarnessProvider>;
@@ -139,9 +160,12 @@ export declare class PhoneHarnessProvider implements ComputerProvider {
139
160
  constructor(options: PhoneProviderOptions);
140
161
  capabilities(): ComputerCapabilities;
141
162
  check(spec: ComputerSpec): Refusal[];
142
- create(spec: ComputerSpec, context?: {
143
- signal?: AbortSignal;
144
- }): Promise<Result<CreatedComputer>>;
163
+ /**
164
+ * Makes a phone, once per request (provider.md, Idempotent create): context.requestId names it (computerNameFor) and
165
+ * gives the POST's Idempotency-Key. A request whose phone the ledger holds answers that phone once it is ready; one
166
+ * released is refused exists; a create of a request in flight here waits for the first (CreateRequests).
167
+ */
168
+ create(spec: ComputerSpec, context: CreateContext): Promise<Result<CreatedComputer>>;
145
169
  attach(ref: {
146
170
  id: string;
147
171
  } | {
@@ -165,17 +189,3 @@ export declare class PhoneHarnessProvider implements ComputerProvider {
165
189
  detail: string;
166
190
  }>>;
167
191
  }
168
- /** The frame `adb exec-out screencap` gives: a header (width, height, format, and a color space on newer Androids), then the pixels. */
169
- export declare function decodeScreencap(raw: Buffer): Result<{
170
- width: number;
171
- height: number;
172
- rgba: Buffer;
173
- }>;
174
- /** An 8-bit RGBA PNG, non-interlaced, of rect of a width-wide RGBA frame. */
175
- export declare function encodePng(rgba: Buffer, width: number, [x, y, w, h]: Rect): Buffer;
176
- /** uiautomator's dump as the protocol's tree: one root (the window's, or one over several), at most MAX_UI_NODES nodes. */
177
- export declare function parseUiTree(xml: string, [width, height]: [number, number]): Result<{
178
- root: UiNode;
179
- nodes: number;
180
- truncated: boolean;
181
- }>;