@parcha/agentrun-computer 0.1.0-beta.36 → 0.1.0-beta.38

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 (155) hide show
  1. package/NOTICE +2 -0
  2. package/README.md +547 -478
  3. package/box/Dockerfile +18 -1
  4. package/box/README.md +13 -0
  5. package/box/build-agent37.mjs +158 -0
  6. package/box/build-daytona.py +2 -2
  7. package/box/build-e2b.mjs +41 -18
  8. package/box/recipe.mjs +43 -0
  9. package/dist/agent37-ssh.d.ts +89 -0
  10. package/dist/agent37-ssh.js +445 -0
  11. package/dist/agent37.d.ts +104 -0
  12. package/dist/agent37.js +402 -0
  13. package/dist/attach.d.ts +146 -0
  14. package/dist/attach.js +469 -0
  15. package/dist/browserbase.d.ts +2 -10
  16. package/dist/browserbase.js +3 -6
  17. package/dist/client.d.ts +45 -4
  18. package/dist/client.js +92 -4
  19. package/dist/computerd-linux-amd64 +0 -0
  20. package/dist/computerd-linux-arm64 +0 -0
  21. package/dist/computerd.json +4 -0
  22. package/dist/conformance/agent37.d.ts +96 -0
  23. package/dist/conformance/agent37.js +154 -0
  24. package/dist/conformance/cases/apps.d.ts +11 -0
  25. package/dist/conformance/cases/apps.js +173 -73
  26. package/dist/conformance/cases/health.js +14 -0
  27. package/dist/conformance/cases/index.js +2 -0
  28. package/dist/conformance/cases/isolation.d.ts +7 -5
  29. package/dist/conformance/cases/isolation.js +44 -14
  30. package/dist/conformance/cases/mount.js +1 -1
  31. package/dist/conformance/cases/provider.js +27 -1
  32. package/dist/conformance/cases/screen.d.ts +3 -0
  33. package/dist/conformance/cases/screen.js +18 -0
  34. package/dist/conformance/cases/settings.d.ts +29 -23
  35. package/dist/conformance/cases/settings.js +76 -58
  36. package/dist/conformance/cases/touch.js +19 -17
  37. package/dist/conformance/cases/ui.d.ts +2 -0
  38. package/dist/conformance/cases/ui.js +475 -0
  39. package/dist/conformance/cli.d.ts +9 -0
  40. package/dist/conformance/cli.js +94 -9
  41. package/dist/conformance/daytona.d.ts +9 -20
  42. package/dist/conformance/daytona.js +12 -21
  43. package/dist/conformance/e2b.d.ts +6 -0
  44. package/dist/conformance/e2b.js +9 -2
  45. package/dist/conformance/exec-stream.d.ts +45 -0
  46. package/dist/conformance/exec-stream.js +486 -0
  47. package/dist/conformance/fixture.d.ts +1 -1
  48. package/dist/conformance/fixture.js +25 -1
  49. package/dist/conformance/modal.d.ts +17 -13
  50. package/dist/conformance/modal.js +18 -9
  51. package/dist/conformance/orgo.d.ts +3 -3
  52. package/dist/conformance/orgo.js +6 -8
  53. package/dist/conformance/phone-harness.d.ts +6 -2
  54. package/dist/conformance/phone-harness.js +21 -4
  55. package/dist/conformance/report.js +1 -1
  56. package/dist/conformance/runner.js +23 -4
  57. package/dist/conformance/sweep.d.ts +50 -0
  58. package/dist/conformance/sweep.js +187 -0
  59. package/dist/conformance/types.d.ts +13 -5
  60. package/dist/conformance/ui-fixture.d.ts +56 -0
  61. package/dist/conformance/ui-fixture.js +43 -0
  62. package/dist/create-requests.d.ts +51 -0
  63. package/dist/create-requests.js +121 -0
  64. package/dist/daytona.d.ts +20 -133
  65. package/dist/daytona.js +405 -1449
  66. package/dist/descriptor.d.ts +11 -1
  67. package/dist/descriptor.js +9 -0
  68. package/dist/descriptors/agent37.d.ts +41 -0
  69. package/dist/descriptors/agent37.js +28 -0
  70. package/dist/descriptors/daytona.d.ts +6 -5
  71. package/dist/descriptors/daytona.js +9 -5
  72. package/dist/descriptors/index.d.ts +42 -7
  73. package/dist/descriptors/index.js +4 -2
  74. package/dist/descriptors/orgo.d.ts +2 -1
  75. package/dist/descriptors/orgo.js +3 -2
  76. package/dist/descriptors/phone-harness.d.ts +1 -1
  77. package/dist/descriptors/phone-harness.js +2 -2
  78. package/dist/descriptors/shared.d.ts +1 -1
  79. package/dist/descriptors/shared.js +2 -2
  80. package/dist/desktop.d.ts +18 -4
  81. package/dist/desktop.js +89 -9
  82. package/dist/docker.d.ts +7 -10
  83. package/dist/docker.js +272 -34
  84. package/dist/drift.js +4 -4
  85. package/dist/e2b.d.ts +16 -290
  86. package/dist/e2b.js +230 -1393
  87. package/dist/fake-ui-driver.d.ts +97 -0
  88. package/dist/fake-ui-driver.js +717 -0
  89. package/dist/host.d.ts +201 -0
  90. package/dist/host.js +8 -0
  91. package/dist/hosted/process.d.ts +81 -0
  92. package/dist/hosted/process.js +259 -0
  93. package/dist/hosted/provider.d.ts +160 -0
  94. package/dist/hosted/provider.js +1415 -0
  95. package/dist/hosted/rest.d.ts +66 -0
  96. package/dist/hosted/rest.js +121 -0
  97. package/dist/hosted/scripts.d.ts +82 -0
  98. package/dist/{child.js → hosted/scripts.js} +118 -12
  99. package/dist/hosted/values.d.ts +5 -0
  100. package/dist/hosted/values.js +8 -0
  101. package/dist/index.d.ts +7 -3
  102. package/dist/index.js +7 -4
  103. package/dist/kernel.d.ts +2 -10
  104. package/dist/kernel.js +3 -6
  105. package/dist/kinds.d.ts +11 -2
  106. package/dist/kinds.js +20 -4
  107. package/dist/local-chrome.d.ts +2 -10
  108. package/dist/local-chrome.js +3 -6
  109. package/dist/modal.d.ts +22 -257
  110. package/dist/modal.js +183 -1280
  111. package/dist/mount-archil.d.ts +8 -4
  112. package/dist/mount-archil.js +22 -11
  113. package/dist/mount.d.ts +10 -4
  114. package/dist/mount.js +8 -4
  115. package/dist/orgo-channel.d.ts +3 -2
  116. package/dist/orgo-channel.js +5 -2
  117. package/dist/orgo-desktop.d.ts +9 -4
  118. package/dist/orgo-desktop.js +33 -13
  119. package/dist/orgo-workspaces.d.ts +47 -0
  120. package/dist/orgo-workspaces.js +94 -0
  121. package/dist/orgo.d.ts +10 -13
  122. package/dist/orgo.js +32 -21
  123. package/dist/phone-harness.d.ts +31 -28
  124. package/dist/phone-harness.js +510 -702
  125. package/dist/png.d.ts +4 -0
  126. package/dist/png.js +27 -0
  127. package/dist/protocol.d.ts +339 -33
  128. package/dist/protocol.js +97 -3
  129. package/dist/provider.d.ts +36 -8
  130. package/dist/provider.js +16 -0
  131. package/dist/providers.d.ts +11 -12
  132. package/dist/result.d.ts +1 -1
  133. package/dist/screen-watch.js +34 -6
  134. package/dist/surface/api.d.ts +260 -0
  135. package/dist/surface/api.js +1 -0
  136. package/dist/surface/core.d.ts +55 -0
  137. package/dist/surface/core.js +475 -0
  138. package/dist/surface/index.d.ts +5 -0
  139. package/dist/surface/index.js +3 -0
  140. package/dist/surface/outline.d.ts +10 -0
  141. package/dist/surface/outline.js +51 -0
  142. package/dist/surface/script.d.ts +10 -0
  143. package/dist/surface/script.js +94 -0
  144. package/dist/ui-engine.d.ts +114 -0
  145. package/dist/ui-engine.js +814 -0
  146. package/package.json +18 -3
  147. package/dist/child.d.ts +0 -42
  148. package/dist/conformance/daytona-sweep.d.ts +0 -18
  149. package/dist/conformance/daytona-sweep.js +0 -126
  150. package/dist/conformance/e2b-diagnose.d.ts +0 -16
  151. package/dist/conformance/e2b-diagnose.js +0 -61
  152. package/dist/conformance/e2b-sweep.d.ts +0 -18
  153. package/dist/conformance/e2b-sweep.js +0 -132
  154. package/dist/conformance/modal-sweep.d.ts +0 -22
  155. package/dist/conformance/modal-sweep.js +0 -213
@@ -0,0 +1,97 @@
1
+ import { type Readable, type Writable } from "node:stream";
2
+ import { type AttachSocket } from "./attach.js";
3
+ import { type FakeApp } from "./conformance/ui-fixture.js";
4
+ import { type ComputerKind, type ComputerOs, type Features, type Group, type HelloResult, type UiImage, type UiStep, type UiTarget } from "./protocol.js";
5
+ import { type ComputerConnection, type ComputerProvider } from "./provider.js";
6
+ import { type Result } from "./result.js";
7
+ import { UiEngine, type UiRun, type UiSource, type UiStepContext, type UiView } from "./ui-engine.js";
8
+ export { type FakeApp, type FakeEffect, type FakeElement, type FakeScreen, NEXT_ANIMATE_MS, NEXT_MS, SAVED_MS, UI_FIXTURE } from "./conformance/ui-fixture.js";
9
+ export interface FakeUiOptions {
10
+ /** The apps it has installed. Default the ui fixture alone. */
11
+ apps?: FakeApp[];
12
+ /** Default "macos" and "desktop". */
13
+ os?: ComputerOs;
14
+ kind?: ComputerKind;
15
+ /** Over the defaults: ui.image, ui.background and apps.background on; ui.foreground on; ui.nav off on a desktop. */
16
+ features?: Features;
17
+ /** The settle window the engine waits for; default 50 ms, so tests stay quick. */
18
+ quietMs?: number;
19
+ /**
20
+ * It cannot tell which elements background input reaches, as on a Mac, where a click posted to the app may never
21
+ * reach a view that takes real input only. A click on a foreground element without foreground: true then goes the
22
+ * background route, lands nowhere, and answers verified false. Default false: such a click is refused denied.
23
+ */
24
+ blindBackground?: boolean;
25
+ /**
26
+ * The groups its hello declares. Default apps and ui, the only methods it answers: a desktop or phone no agent is
27
+ * given (health.kind-served fails it by the groups it lacks, and serve refuses it at attach). A test of serve's side
28
+ * of attach declares a served kind's groups; the fake still answers only apps and ui.
29
+ */
30
+ groups?: Group[];
31
+ /**
32
+ * An app's window comes this long after apps.launch starts it, as a real app takes a moment to draw its first window.
33
+ * Launch waits for it (wire.md, apps.launch), so an observe right after it still finds the window. Default 0.
34
+ */
35
+ windowAfterMs?: number;
36
+ /**
37
+ * A focused text field's caret blinks: every look of its window draws a different frame, with the same tree, as a
38
+ * real caret does. A settle on the tree (wire.md, ui.act) is quiet anyway; one on the image would never be.
39
+ */
40
+ blink?: boolean;
41
+ }
42
+ /** The methods the fake answers; any other is method-not-found on the wire. */
43
+ export declare const FAKE_UI_METHODS: ReadonlySet<string>;
44
+ /** The scripted apps, and the protocol methods they answer. */
45
+ export declare class FakeUiDriver implements UiSource {
46
+ #private;
47
+ readonly apps: ReadonlyMap<string, FakeApp>;
48
+ readonly os: ComputerOs;
49
+ readonly kind: ComputerKind;
50
+ readonly groups: readonly Group[];
51
+ /** Every method called, in order, with its params: what a test asserts reached the computer. */
52
+ readonly calls: Array<[string, unknown]>;
53
+ constructor(options?: FakeUiOptions);
54
+ /** Whether the app runs with no window left: a press closed its last one (UiSource.closed). */
55
+ closed(app: string): Promise<boolean>;
56
+ /** A connection's own ui engine: its refs and states are that connection's alone (wire.md, The ui group). */
57
+ engine(): UiEngine;
58
+ hello(): HelloResult;
59
+ /** The screen an app's window in front shows now, by its name; undefined when it is not running or has no window. */
60
+ screenOf(app: string): string | undefined;
61
+ /** Moves an app's window in front, or changes its size (points): a point read before a size change is then stale. */
62
+ place(app: string, bounds: [number, number, number, number]): void;
63
+ /** Ends every app, and every effect its windows had pending. */
64
+ close(): void;
65
+ /** One method call on a connection, as a computer answers it; ui calls go through that connection's engine. */
66
+ handle(engine: UiEngine, method: string, params: unknown, signal?: AbortSignal): Promise<Result<unknown>>;
67
+ /**
68
+ * apps.launch's answer once the app it started has a window (wire.md, apps.launch): ok when it shows, timeout naming
69
+ * the app when none came within LAUNCH_WINDOW_MS. A test's driver that answers before its window overrides it.
70
+ */
71
+ windowOf(id: string, signal: AbortSignal): Promise<Result<unknown>>;
72
+ features(): Features;
73
+ look(target: UiTarget | undefined): Promise<Result<UiView>>;
74
+ image(view: UiView, maxEdge: number): Promise<Result<UiImage>>;
75
+ run(step: UiStep, { element, view, foreground }: UiStepContext): Promise<Result<UiRun>>;
76
+ }
77
+ /**
78
+ * Serves a driver's methods as JSON-RPC lines from input to output (the stdio binding's framing): requests run at once,
79
+ * replies in any order, $/cancelRequest aborts one, a line over the limit or not JSON gets its error reply.
80
+ */
81
+ export declare function serveUiLines(driver: FakeUiDriver, input: Readable, output: Writable): void;
82
+ /** Serves a driver over an attach socket (spec/computer/attach.md): the driver's end of the binding, as a driver that dialed out. */
83
+ export declare function serveUiSocket(driver: FakeUiDriver, socket: AttachSocket): void;
84
+ /** A connection over a real line stream to a driver: its client after hello. Closing it leaves the driver's apps running. */
85
+ export declare function connectUi(driver: FakeUiDriver): Promise<Result<ComputerConnection>>;
86
+ /** A fake ui computer of its own in this process: its connection (after hello), and its driver, ended on close. */
87
+ export declare function fakeUiConnection(options?: FakeUiOptions): Promise<ComputerConnection & {
88
+ driver: FakeUiDriver;
89
+ }>;
90
+ /**
91
+ * A provider whose computers are fake ui drivers in this process, for the conformance suite and for tools that need a
92
+ * provider: the options' groups (apps and ui by default), no daemon, deleted on release. Every computer has the options' apps and features; `make`
93
+ * builds each one's driver (a subclass, for a test of what a broken driver fails).
94
+ */
95
+ export declare function fakeUiProvider(options?: FakeUiOptions, make?: (options: FakeUiOptions) => FakeUiDriver): ComputerProvider & {
96
+ drivers: ReadonlyMap<string, FakeUiDriver>;
97
+ };