@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,114 @@
1
+ import { type Feature, type Features, type Point, type Rect, type UiActParams, type UiActResult, type UiFlag, type UiImage, type UiObserveParams, type UiObserveResult, type UiRef, type UiRole, type UiRoute, type UiStep, type UiTarget, type UiWindow } from "./protocol.js";
2
+ import { type Result } from "./result.js";
3
+ /** One element as a source sees it. Bounds are in window points. */
4
+ export interface UiElement {
5
+ /**
6
+ * The source's own identity for the element in its window: the same in every look while the element exists, never
7
+ * reused for another. The engine scopes it to the window, so two windows' elements of one key are two refs.
8
+ */
9
+ key: string;
10
+ role: UiRole;
11
+ name?: string;
12
+ value?: string;
13
+ desc?: string;
14
+ id?: string;
15
+ bounds: Rect;
16
+ /** The key of the element above it. An element comes after its parent. */
17
+ parent?: string;
18
+ flags?: UiFlag[];
19
+ actions?: string[];
20
+ }
21
+ /** One look at a window. */
22
+ export interface UiView {
23
+ app: {
24
+ id: string;
25
+ name: string;
26
+ pid?: number;
27
+ };
28
+ window: UiWindow;
29
+ elements: UiElement[];
30
+ /**
31
+ * Whatever else a person would see change (a hash of the window's pixels), so a redraw with the same tree counts.
32
+ * A point with no element under it, and every point while ui.tree is off, stays good only while the frame is the
33
+ * same. A source that can run with ui.tree off gives one: without it the engine cannot see a redraw under a point.
34
+ */
35
+ frame?: string;
36
+ }
37
+ export interface UiRun {
38
+ route: UiRoute;
39
+ verified: boolean;
40
+ }
41
+ /** What a step is run with: the element its ref names (for type, its into), and the look it was checked against. */
42
+ export interface UiStepContext {
43
+ element?: UiElement;
44
+ view: UiView;
45
+ /** The call allows the foreground route. */
46
+ foreground: boolean;
47
+ }
48
+ /** What a driver can see and do. Each method answers a refusal (a protocol kind, in words) as a failed Result. */
49
+ export interface UiSource {
50
+ /** hello.features, as this source offers them now. */
51
+ features(): Features;
52
+ /** A look at the target's window; with no target, the app in front and its main window. */
53
+ look(target: UiTarget | undefined, signal: AbortSignal): Promise<Result<UiView>>;
54
+ /** The window's image, its longest edge at most maxEdge, whole in at most MAX_CHUNK_BYTES. Called only with ui.image on. */
55
+ image(view: UiView, maxEdge: number, signal: AbortSignal): Promise<Result<UiImage>>;
56
+ /** Runs one step, by the best route the call allows. A step it cannot run is refused as unsupported, in words. */
57
+ run(step: UiStep, context: UiStepContext, signal: AbortSignal): Promise<Result<UiRun>>;
58
+ /**
59
+ * Whether the app is running with no window left (a step closed its last one), which look() answers not_found for.
60
+ * Absent on a source whose apps always show a window while they run (a phone's).
61
+ */
62
+ closed?(app: string, signal: AbortSignal): Promise<boolean>;
63
+ }
64
+ export interface UiEngineOptions {
65
+ /** How long a window must stay the same to count as settled. Default 150 ms; 0 for a source whose every look is settled. */
66
+ quietMs?: number;
67
+ /** How often an expect looks again. Default 50 ms. */
68
+ pollMs?: number;
69
+ /** The longest an act waits to settle. Default and most MAX_SETTLE_MS. */
70
+ settleMs?: number;
71
+ }
72
+ /** How many states an engine keeps for since and for points; an older one is refused as stale. */
73
+ export declare const UI_STATES_KEPT = 32;
74
+ /** The ref a step acts on, if any: press, set, perform, a click or scroll at a ref, and type's into. */
75
+ export declare function stepRef(step: UiStep): UiRef | undefined;
76
+ /**
77
+ * Every point a step touches, in order: a click or scroll at a point, each point of a drag's path. Each one is held to
78
+ * the same checks (inside the window, nothing changed under it since the state), so a drag's end is no freer than its start.
79
+ */
80
+ export declare function stepPoints(step: UiStep): Point[];
81
+ /**
82
+ * A key chord's names, in order: joined by "+", the last of them may be "+" itself ("+", "shift++"). Every driver reads
83
+ * a chord with it.
84
+ */
85
+ export declare function chordKeys(chord: string): string[];
86
+ /** ui.observe's params checked whole: ok, or a refusal (invalid) in words. */
87
+ export declare function checkUiObserve(params: unknown): Result<UiObserveParams>;
88
+ /** ui.act's params checked whole, before any step runs: ok, or a refusal (invalid, limit) in words. */
89
+ export declare function checkUiAct(params: unknown): Result<UiActParams>;
90
+ /** Why a feature is not on, in words, or undefined when it is. */
91
+ export declare function featureOff(features: Features, name: Feature): string | undefined;
92
+ /**
93
+ * A rect of a ui observation, in window points, as screen.shot and input.actions take it: screenshot pixels, the
94
+ * window's origin added and the screen's scale (hello.screen.scale) applied. The one conversion every caller uses.
95
+ */
96
+ export declare function windowRectToPixels([wx, wy]: Rect, scale: number, [x, y, w, h]: Rect): Rect;
97
+ /**
98
+ * An element's bounds held inside its window of width by height points (wire.md, ui.observe): each edge past the
99
+ * window's moved in to it. A row half scrolled out of a list reports only the part a person sees and taps; one wholly
100
+ * out (offscreen, in a full observe) becomes a line on the edge it left by.
101
+ */
102
+ export declare function insideWindow([x, y, w, h]: Rect, width: number, height: number): Rect;
103
+ /**
104
+ * The ui group over one source, for one connection: its refs and states are this connection's own. Calls run one at a
105
+ * time in arrival order, so one act's steps never interleave with another's.
106
+ */
107
+ export declare class UiEngine {
108
+ #private;
109
+ constructor(source: UiSource, options?: UiEngineOptions);
110
+ /** hello.features, as the source offers them now. */
111
+ features(): Features;
112
+ observe(params: unknown, signal?: AbortSignal): Promise<Result<UiObserveResult>>;
113
+ act(params: unknown, signal?: AbortSignal): Promise<Result<UiActResult>>;
114
+ }