@qawolf/api-contracts 0.29.0 → 0.32.0

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 (38) hide show
  1. package/dist/v1/environment/find.d.ts +1 -1
  2. package/dist/v1/environment/index.d.ts +2 -2
  3. package/dist/v1/environment/resource.d.ts +1 -1
  4. package/dist/v1/environment/update.d.ts +1 -1
  5. package/dist/v1/index.d.ts +39 -27
  6. package/dist/v1/index.d.ts.map +1 -1
  7. package/dist/v1/index.js +4 -18
  8. package/dist/v1/index.js.map +1 -1
  9. package/dist/v1/run/index.d.ts +8 -0
  10. package/dist/v1/run/index.d.ts.map +1 -1
  11. package/dist/v1/run/index.js +16 -2
  12. package/dist/v1/run/index.js.map +1 -1
  13. package/dist/v1/runner/environment.js +1 -1
  14. package/dist/v1/runner/files.js +1 -1
  15. package/dist/v1/runner/inspect.d.ts +1 -0
  16. package/dist/v1/runner/inspect.d.ts.map +1 -1
  17. package/dist/v1/runner/inspect.js +6 -2
  18. package/dist/v1/runner/inspect.js.map +1 -1
  19. package/dist/v1/runner/inspectMobile.d.ts +226 -0
  20. package/dist/v1/runner/inspectMobile.d.ts.map +1 -0
  21. package/dist/v1/runner/inspectMobile.js +118 -0
  22. package/dist/v1/runner/inspectMobile.js.map +1 -0
  23. package/dist/v1/runner/inspectMobileShapes.d.ts +73 -0
  24. package/dist/v1/runner/inspectMobileShapes.d.ts.map +1 -0
  25. package/dist/v1/runner/inspectMobileShapes.js +59 -0
  26. package/dist/v1/runner/inspectMobileShapes.js.map +1 -0
  27. package/dist/v1/runner/performAction.d.ts +3 -2
  28. package/dist/v1/runner/performAction.d.ts.map +1 -1
  29. package/dist/v1/runner/performAction.js +3 -1
  30. package/dist/v1/runner/performAction.js.map +1 -1
  31. package/dist/v1/runner/takeScreenshot.d.ts +2 -2
  32. package/dist/v1/runner/takeScreenshot.js +1 -1
  33. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  34. package/dist/v1/runnerReexports.d.ts +11 -0
  35. package/dist/v1/runnerReexports.d.ts.map +1 -0
  36. package/dist/v1/runnerReexports.js +23 -0
  37. package/dist/v1/runnerReexports.js.map +1 -0
  38. package/package.json +2 -2
@@ -0,0 +1,226 @@
1
+ import { z } from "zod";
2
+ export declare const inspectMobileRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ what: z.ZodLiteral<"session">;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ what: z.ZodLiteral<"contexts">;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ context: z.ZodOptional<z.ZodString>;
8
+ what: z.ZodLiteral<"page">;
9
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ by: z.ZodLiteral<"point">;
11
+ context: z.ZodOptional<z.ZodString>;
12
+ what: z.ZodLiteral<"elements">;
13
+ x: z.ZodInt;
14
+ y: z.ZodInt;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ by: z.ZodLiteral<"text">;
17
+ context: z.ZodOptional<z.ZodString>;
18
+ partial: z.ZodOptional<z.ZodBoolean>;
19
+ text: z.ZodString;
20
+ what: z.ZodLiteral<"elements">;
21
+ }, z.core.$strip>], "by">], "what">;
22
+ export type InspectMobileRequest = z.infer<typeof inspectMobileRequestSchema>;
23
+ export declare const makeInspectMobileOnRunnerContract: () => {
24
+ readonly description: "Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers `runner-is-not-mobile`; call `runner.inspect` for a browser's equivalent surface instead. `what: \"session\"` always answers with the session's own status rather than `screen-needs-a-run`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same `screen-needs-a-run` or `screen-not-ready` outcomes `runner.performAction` and `runner.takeScreenshot` use, instead of reading anything when there is none. `screen-needs-a-run` means no Appium session has started on this runner yet — call `runner.runFlow` with a flow that opens one, then inspect again. `screen-not-ready` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. `runner-is-not-mobile` means there is nothing here to inspect, and retrying will never help — launch a `node20WithAndroid` or `node20WithIos` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
25
+ readonly input: z.ZodObject<{
26
+ id: z.ZodString;
27
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ what: z.ZodLiteral<"session">;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ what: z.ZodLiteral<"contexts">;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ context: z.ZodOptional<z.ZodString>;
33
+ what: z.ZodLiteral<"page">;
34
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ by: z.ZodLiteral<"point">;
36
+ context: z.ZodOptional<z.ZodString>;
37
+ what: z.ZodLiteral<"elements">;
38
+ x: z.ZodInt;
39
+ y: z.ZodInt;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ by: z.ZodLiteral<"text">;
42
+ context: z.ZodOptional<z.ZodString>;
43
+ partial: z.ZodOptional<z.ZodBoolean>;
44
+ text: z.ZodString;
45
+ what: z.ZodLiteral<"elements">;
46
+ }, z.core.$strip>], "by">], "what">;
47
+ }, z.core.$strip>;
48
+ readonly kind: "read";
49
+ readonly name: "runner.inspectMobile";
50
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
51
+ outcome: z.ZodLiteral<"success">;
52
+ session: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
+ deviceName: z.ZodOptional<z.ZodString>;
54
+ platformName: z.ZodString;
55
+ sessionId: z.ZodString;
56
+ type: z.ZodLiteral<"ready">;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ error: z.ZodString;
59
+ type: z.ZodLiteral<"unreachable">;
60
+ }, z.core.$strip>, z.ZodObject<{
61
+ sessionCount: z.ZodNumber;
62
+ type: z.ZodLiteral<"ambiguous">;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ type: z.ZodLiteral<"no-session">;
65
+ }, z.core.$strip>], "type">;
66
+ what: z.ZodLiteral<"session">;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ contexts: z.ZodArray<z.ZodString>;
69
+ current: z.ZodString;
70
+ outcome: z.ZodLiteral<"success">;
71
+ what: z.ZodLiteral<"contexts">;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ context: z.ZodString;
74
+ orientation: z.ZodEnum<{
75
+ PORTRAIT: "PORTRAIT";
76
+ LANDSCAPE: "LANDSCAPE";
77
+ }>;
78
+ outcome: z.ZodLiteral<"success">;
79
+ pageSource: z.ZodType<{
80
+ selectors: {
81
+ strategy: {
82
+ name: "xpath";
83
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
84
+ } | {
85
+ name: "ios-predicate";
86
+ } | {
87
+ hostSelector: string;
88
+ innerSelector: string;
89
+ name: "shadow";
90
+ };
91
+ value: string;
92
+ }[];
93
+ tag: string;
94
+ attributes?: {
95
+ bounds?: {
96
+ bottom: number;
97
+ left: number;
98
+ right: number;
99
+ top: number;
100
+ } | undefined;
101
+ rest?: Record<string, string> | undefined;
102
+ } | undefined;
103
+ } & {
104
+ children?: (({
105
+ selectors: {
106
+ strategy: {
107
+ name: "xpath";
108
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
109
+ } | {
110
+ name: "ios-predicate";
111
+ } | {
112
+ hostSelector: string;
113
+ innerSelector: string;
114
+ name: "shadow";
115
+ };
116
+ value: string;
117
+ }[];
118
+ tag: string;
119
+ attributes?: {
120
+ bounds?: {
121
+ bottom: number;
122
+ left: number;
123
+ right: number;
124
+ top: number;
125
+ } | undefined;
126
+ rest?: Record<string, string> | undefined;
127
+ } | undefined;
128
+ } & /*elided*/ any) | string)[];
129
+ }, unknown, z.core.$ZodTypeInternals<{
130
+ selectors: {
131
+ strategy: {
132
+ name: "xpath";
133
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
134
+ } | {
135
+ name: "ios-predicate";
136
+ } | {
137
+ hostSelector: string;
138
+ innerSelector: string;
139
+ name: "shadow";
140
+ };
141
+ value: string;
142
+ }[];
143
+ tag: string;
144
+ attributes?: {
145
+ bounds?: {
146
+ bottom: number;
147
+ left: number;
148
+ right: number;
149
+ top: number;
150
+ } | undefined;
151
+ rest?: Record<string, string> | undefined;
152
+ } | undefined;
153
+ } & {
154
+ children?: (({
155
+ selectors: {
156
+ strategy: {
157
+ name: "xpath";
158
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
159
+ } | {
160
+ name: "ios-predicate";
161
+ } | {
162
+ hostSelector: string;
163
+ innerSelector: string;
164
+ name: "shadow";
165
+ };
166
+ value: string;
167
+ }[];
168
+ tag: string;
169
+ attributes?: {
170
+ bounds?: {
171
+ bottom: number;
172
+ left: number;
173
+ right: number;
174
+ top: number;
175
+ } | undefined;
176
+ rest?: Record<string, string> | undefined;
177
+ } | undefined;
178
+ } & /*elided*/ any) | string)[];
179
+ }, unknown>>;
180
+ what: z.ZodLiteral<"page">;
181
+ }, z.core.$strip>, z.ZodObject<{
182
+ matches: z.ZodArray<z.ZodObject<{
183
+ attributes: z.ZodRecord<z.ZodString, z.ZodString>;
184
+ bounds: z.ZodOptional<z.ZodObject<{
185
+ bottom: z.ZodNumber;
186
+ left: z.ZodNumber;
187
+ right: z.ZodNumber;
188
+ top: z.ZodNumber;
189
+ }, z.core.$strip>>;
190
+ center: z.ZodOptional<z.ZodObject<{
191
+ x: z.ZodNumber;
192
+ y: z.ZodNumber;
193
+ }, z.core.$strip>>;
194
+ selectors: z.ZodArray<z.ZodObject<{
195
+ strategy: z.ZodUnion<readonly [z.ZodObject<{
196
+ name: z.ZodLiteral<"xpath">;
197
+ type: z.ZodEnum<{
198
+ unique: "unique";
199
+ "full-path": "full-path";
200
+ "sibling-of": "sibling-of";
201
+ "parent-of": "parent-of";
202
+ }>;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ name: z.ZodLiteral<"ios-predicate">;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ hostSelector: z.ZodString;
207
+ innerSelector: z.ZodString;
208
+ name: z.ZodLiteral<"shadow">;
209
+ }, z.core.$strip>]>;
210
+ value: z.ZodString;
211
+ }, z.core.$strip>>;
212
+ tag: z.ZodString;
213
+ }, z.core.$strip>>;
214
+ outcome: z.ZodLiteral<"success">;
215
+ what: z.ZodLiteral<"elements">;
216
+ }, z.core.$strip>], "what">, z.ZodObject<{
217
+ failureReason: z.ZodEnum<{
218
+ "runner-unreachable": "runner-unreachable";
219
+ "runner-is-not-mobile": "runner-is-not-mobile";
220
+ "screen-needs-a-run": "screen-needs-a-run";
221
+ "screen-not-ready": "screen-not-ready";
222
+ }>;
223
+ outcome: z.ZodLiteral<"failure">;
224
+ }, z.core.$strip>], "outcome">;
225
+ };
226
+ //# sourceMappingURL=inspectMobile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectMobile.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/inspectMobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;mCAgDrC,CAAC;AA4CH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B7C,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { z } from "zod";
2
+ import { runnerIdSchema } from "./identity.js";
3
+ import { elementSchema, orientationSchema, pageSourceNodeSchema, } from "./inspectMobileShapes.js";
4
+ import { makeRunnerFailureSchema } from "./outcome.js";
5
+ import { retryableRunnerUnreachableDescription, runnerUnreachableFailureReason, } from "./unreachable.js";
6
+ /**
7
+ * Mobile-only: `runner.inspect` covers the equivalent browser surface
8
+ * (element HTML, page HTML, a workflow variable). `what` discriminates so a
9
+ * request kind can be added later without a rename.
10
+ */
11
+ const maxElementTextLength = 500;
12
+ export const inspectMobileRequestSchema = z.discriminatedUnion("what", [
13
+ z.object({
14
+ what: z
15
+ .literal("session")
16
+ .describe("The status of the Appium session driving the device: ready and what it is, or why not."),
17
+ }),
18
+ z.object({
19
+ what: z
20
+ .literal("contexts")
21
+ .describe("The WebView contexts available on the device, and which one is current."),
22
+ }),
23
+ z.object({
24
+ context: z
25
+ .string()
26
+ .min(1)
27
+ .optional()
28
+ .describe("Read this context instead of whichever is current."),
29
+ what: z
30
+ .literal("page")
31
+ .describe("The page source of the device's current context, as a tree."),
32
+ }),
33
+ z
34
+ .discriminatedUnion("by", [
35
+ z.object({
36
+ by: z.literal("point"),
37
+ context: z.string().min(1).optional(),
38
+ what: z.literal("elements"),
39
+ x: z.int().min(0).describe("Whole pixels on the device's own screen."),
40
+ y: z.int().min(0).describe("Whole pixels on the device's own screen."),
41
+ }),
42
+ z.object({
43
+ by: z.literal("text"),
44
+ context: z.string().min(1).optional(),
45
+ partial: z
46
+ .boolean()
47
+ .optional()
48
+ .describe("Match text containing this, rather than exactly this."),
49
+ text: z.string().min(1).max(maxElementTextLength),
50
+ what: z.literal("elements"),
51
+ }),
52
+ ])
53
+ .describe("Elements at a screen point, or elements carrying some text — never both at once."),
54
+ ]);
55
+ const inspectMobileAnswerSchema = z.discriminatedUnion("what", [
56
+ z.object({
57
+ outcome: z.literal("success"),
58
+ session: z.discriminatedUnion("type", [
59
+ z.object({
60
+ deviceName: z.string().optional(),
61
+ platformName: z.string(),
62
+ sessionId: z.string(),
63
+ type: z.literal("ready"),
64
+ }),
65
+ z.object({
66
+ error: z.string(),
67
+ type: z.literal("unreachable"),
68
+ }),
69
+ z.object({
70
+ sessionCount: z.number(),
71
+ type: z.literal("ambiguous"),
72
+ }),
73
+ z.object({ type: z.literal("no-session") }),
74
+ ]),
75
+ what: z.literal("session"),
76
+ }),
77
+ z.object({
78
+ contexts: z.string().array(),
79
+ current: z.string(),
80
+ outcome: z.literal("success"),
81
+ what: z.literal("contexts"),
82
+ }),
83
+ z.object({
84
+ context: z.string(),
85
+ orientation: orientationSchema,
86
+ outcome: z.literal("success"),
87
+ pageSource: pageSourceNodeSchema,
88
+ what: z.literal("page"),
89
+ }),
90
+ z.object({
91
+ matches: elementSchema.array(),
92
+ outcome: z.literal("success"),
93
+ what: z.literal("elements"),
94
+ }),
95
+ ]);
96
+ export const makeInspectMobileOnRunnerContract = () => {
97
+ const input = z.object({
98
+ id: runnerIdSchema.describe("Id of the runner to inspect."),
99
+ request: inspectMobileRequestSchema,
100
+ });
101
+ const output = z.discriminatedUnion("outcome", [
102
+ inspectMobileAnswerSchema,
103
+ makeRunnerFailureSchema([
104
+ "runner-is-not-mobile",
105
+ "screen-needs-a-run",
106
+ "screen-not-ready",
107
+ runnerUnreachableFailureReason,
108
+ ]),
109
+ ]);
110
+ return {
111
+ description: `Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers \`runner-is-not-mobile\`; call \`runner.inspect\` for a browser's equivalent surface instead. \`what: "session"\` always answers with the session's own status rather than \`screen-needs-a-run\`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same \`screen-needs-a-run\` or \`screen-not-ready\` outcomes \`runner.performAction\` and \`runner.takeScreenshot\` use, instead of reading anything when there is none. \`screen-needs-a-run\` means no Appium session has started on this runner yet — call \`runner.runFlow\` with a flow that opens one, then inspect again. \`screen-not-ready\` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. \`runner-is-not-mobile\` means there is nothing here to inspect, and retrying will never help — launch a \`node20WithAndroid\` or \`node20WithIos\` runner instead. ${retryableRunnerUnreachableDescription}`,
112
+ input,
113
+ kind: "read",
114
+ name: "runner.inspectMobile",
115
+ output,
116
+ };
117
+ };
118
+ //# sourceMappingURL=inspectMobile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectMobile.js","sourceRoot":"","sources":["../../../src/v1/runner/inspectMobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AAEH,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACrE,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CACP,wFAAwF,CACzF;KACJ,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CACP,yEAAyE,CAC1E;KACJ,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,oDAAoD,CAAC;QACjE,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,MAAM,CAAC;aACf,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IACF,CAAC;SACE,kBAAkB,CAAC,IA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,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;KAC5B,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAG,EAAE;IACpD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC3D,OAAO,EAAE,0BAA0B;KACpC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,yBAAyB;QACzB,uBAAuB,CAAC;YACtB,sBAAsB;YACtB,oBAAoB;YACpB,kBAAkB;YAClB,8BAA8B;SAC/B,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,gsCAAgsC,qCAAqC,EAAE;QACpvC,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAsB;QAC5B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ export declare const elementSchema: z.ZodObject<{
3
+ attributes: z.ZodRecord<z.ZodString, z.ZodString>;
4
+ bounds: z.ZodOptional<z.ZodObject<{
5
+ bottom: z.ZodNumber;
6
+ left: z.ZodNumber;
7
+ right: z.ZodNumber;
8
+ top: z.ZodNumber;
9
+ }, z.core.$strip>>;
10
+ center: z.ZodOptional<z.ZodObject<{
11
+ x: z.ZodNumber;
12
+ y: z.ZodNumber;
13
+ }, z.core.$strip>>;
14
+ selectors: z.ZodArray<z.ZodObject<{
15
+ strategy: z.ZodUnion<readonly [z.ZodObject<{
16
+ name: z.ZodLiteral<"xpath">;
17
+ type: z.ZodEnum<{
18
+ unique: "unique";
19
+ "full-path": "full-path";
20
+ "sibling-of": "sibling-of";
21
+ "parent-of": "parent-of";
22
+ }>;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ name: z.ZodLiteral<"ios-predicate">;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ hostSelector: z.ZodString;
27
+ innerSelector: z.ZodString;
28
+ name: z.ZodLiteral<"shadow">;
29
+ }, z.core.$strip>]>;
30
+ value: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ tag: z.ZodString;
33
+ }, z.core.$strip>;
34
+ declare const basePageSourceNodeSchema: z.ZodObject<{
35
+ attributes: z.ZodOptional<z.ZodObject<{
36
+ bounds: z.ZodOptional<z.ZodObject<{
37
+ bottom: z.ZodNumber;
38
+ left: z.ZodNumber;
39
+ right: z.ZodNumber;
40
+ top: z.ZodNumber;
41
+ }, z.core.$strip>>;
42
+ rest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
43
+ }, z.core.$strip>>;
44
+ selectors: z.ZodArray<z.ZodObject<{
45
+ strategy: z.ZodUnion<readonly [z.ZodObject<{
46
+ name: z.ZodLiteral<"xpath">;
47
+ type: z.ZodEnum<{
48
+ unique: "unique";
49
+ "full-path": "full-path";
50
+ "sibling-of": "sibling-of";
51
+ "parent-of": "parent-of";
52
+ }>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ name: z.ZodLiteral<"ios-predicate">;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ hostSelector: z.ZodString;
57
+ innerSelector: z.ZodString;
58
+ name: z.ZodLiteral<"shadow">;
59
+ }, z.core.$strip>]>;
60
+ value: z.ZodString;
61
+ }, z.core.$strip>>;
62
+ tag: z.ZodString;
63
+ }, z.core.$strip>;
64
+ type PageSourceNode = z.infer<typeof basePageSourceNodeSchema> & {
65
+ children?: (PageSourceNode | string)[];
66
+ };
67
+ export declare const pageSourceNodeSchema: z.ZodType<PageSourceNode>;
68
+ export declare const orientationSchema: z.ZodEnum<{
69
+ PORTRAIT: "PORTRAIT";
70
+ LANDSCAPE: "LANDSCAPE";
71
+ }>;
72
+ export {};
73
+ //# sourceMappingURL=inspectMobileShapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectMobileShapes.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/inspectMobileShapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYxB,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS5B,CAAC;AAEH,KAAK,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GAAG;IAC/D,QAAQ,CAAC,EAAE,CAAC,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAQvD,CAAC;AAEL,eAAO,MAAM,iBAAiB;;;EAAoC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Duplicated from `packages/domain-runner-types/src/lib/appium.ts`: that
4
+ * package is private and this one is published, so it can't be imported here.
5
+ * A shape refused there must stay refused here.
6
+ */
7
+ const boundsSchema = z.object({
8
+ bottom: z.number(),
9
+ left: z.number(),
10
+ right: z.number(),
11
+ top: z.number(),
12
+ });
13
+ const pointSchema = z.object({ x: z.number(), y: z.number() });
14
+ const selectorSchema = z.object({
15
+ strategy: z.union([
16
+ z.object({
17
+ name: z.literal("xpath"),
18
+ type: z.enum(["unique", "full-path", "sibling-of", "parent-of"]),
19
+ }),
20
+ z.object({ name: z.literal("ios-predicate") }),
21
+ z.object({
22
+ hostSelector: z.string(),
23
+ innerSelector: z.string(),
24
+ name: z.literal("shadow"),
25
+ }),
26
+ ]),
27
+ value: z.string(),
28
+ });
29
+ export const elementSchema = z.object({
30
+ attributes: z.record(z.string(), z.string()),
31
+ bounds: boundsSchema
32
+ .optional()
33
+ .describe("The element's on-screen rectangle, absent off-screen."),
34
+ center: pointSchema
35
+ .optional()
36
+ .describe("Derived from `bounds`; absent wherever `bounds` is."),
37
+ selectors: selectorSchema
38
+ .array()
39
+ .describe("Ways to address this element again, most reliable first."),
40
+ tag: z.string(),
41
+ });
42
+ const basePageSourceNodeSchema = z.object({
43
+ attributes: z
44
+ .object({
45
+ bounds: boundsSchema.optional(),
46
+ rest: z.record(z.string(), z.string()).optional(),
47
+ })
48
+ .optional(),
49
+ selectors: selectorSchema.array(),
50
+ tag: z.string(),
51
+ });
52
+ export const pageSourceNodeSchema = basePageSourceNodeSchema.extend({
53
+ children: z
54
+ .lazy(() => z.union([pageSourceNodeSchema, z.string()]).array())
55
+ .optional()
56
+ .describe("A string child is a text node; there is no element to select."),
57
+ });
58
+ export const orientationSchema = z.enum(["PORTRAIT", "LANDSCAPE"]);
59
+ //# sourceMappingURL=inspectMobileShapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspectMobileShapes.js","sourceRoot":"","sources":["../../../src/v1/runner/inspectMobileShapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE/D,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;QAChB,CAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,CAAC,C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,SAAS,EAAE,cAAc,CAAC,KAAK,EAAE;IACjC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,wBAAwB,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;SAC/D,QAAQ,EAAE;SACV,QAAQ,CACP,+DAA+D,CAChE;CACJ,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC"}
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  /** How much of a failure reason this API passes on. */
3
3
  export declare const maxActionErrorMessageLength = 1000;
4
4
  export declare const makePerformActionOnRunnerContract: () => {
5
- readonly description: "Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as `runner.takeScreenshot`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus `screenshot` (use `runner.takeScreenshot`) and `wait` (delay on the caller's side). A success means the action took effect. `action-failed`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no `runner.runFlow` is needed before acting; if the browser is still starting when the wait runs out, the answer is `screen-not-ready` and retrying converges. `screen-needs-a-run` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call `runner.runFlow` with a flow that opens a browser. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. A `navigate` does not go through the screen, so a screen that is not ready does not stop it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `playwright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
5
+ readonly description: "Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as `runner.takeScreenshot`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus `screenshot` (use `runner.takeScreenshot`) and `wait` (delay on the caller's side). A success means the action took effect. `action-failed`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no `runner.runFlow` is needed before acting; if the browser is still starting when the wait runs out, the answer is `screen-not-ready` and retrying converges. On a mobile runner, the same `screen-needs-a-run` and `screen-not-ready` outcomes mean no Appium session has started yet, or it did not answer this instant; `runner.runFlow` is what starts one, same as a browser. `screen-needs-a-run` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call `runner.runFlow` with a flow that opens a browser. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. A `navigate` does not go through the screen, so a screen that is not ready does not stop it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `playwright` runner instead. `action-not-supported-on-mobile` if the runner is a mobile device and this action has no touchscreen equivalent: `double_click`, `scroll`, `move`, `keypress` and `navigate`, and a `click` whose `button` is not `left`, are all pointer-device concepts a touchscreen has nothing to offer for. `click` taps, `drag` swipes between its path's first and last point, and `type` types into whatever the last tap focused. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
6
6
  readonly input: z.ZodObject<{
7
7
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
8
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -52,9 +52,10 @@ export declare const makePerformActionOnRunnerContract: () => {
52
52
  }, z.core.$strip>, z.ZodObject<{
53
53
  failureReason: z.ZodEnum<{
54
54
  "runner-unreachable": "runner-unreachable";
55
- "runner-has-no-screen": "runner-has-no-screen";
56
55
  "screen-needs-a-run": "screen-needs-a-run";
57
56
  "screen-not-ready": "screen-not-ready";
57
+ "runner-has-no-screen": "runner-has-no-screen";
58
+ "action-not-supported-on-mobile": "action-not-supported-on-mobile";
58
59
  }>;
59
60
  outcome: z.ZodLiteral<"failure">;
60
61
  }, z.core.$strip>], "failureReason">], "outcome">;
@@ -1 +1 @@
1
- {"version":3,"file":"performAction.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C7C,CAAC"}
1
+ {"version":3,"file":"performAction.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C7C,CAAC"}
@@ -7,6 +7,7 @@ import { runnerUnreachableFailureReason } from "./unreachable.js";
7
7
  // Not the shared retryable wording: the action may have taken effect before its
8
8
  // answer was lost.
9
9
  const unreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
10
+ const notSupportedOnMobileDescription = "`action-not-supported-on-mobile` if the runner is a mobile device and this action has no touchscreen equivalent: `double_click`, `scroll`, `move`, `keypress` and `navigate`, and a `click` whose `button` is not `left`, are all pointer-device concepts a touchscreen has nothing to offer for. `click` taps, `drag` swipes between its path's first and last point, and `type` types into whatever the last tap focused.";
10
11
  /** How much of a failure reason this API passes on. */
11
12
  export const maxActionErrorMessageLength = 1_000;
12
13
  export const makePerformActionOnRunnerContract = () => {
@@ -27,6 +28,7 @@ export const makePerformActionOnRunnerContract = () => {
27
28
  }),
28
29
  makeRunnerFailureSchema([
29
30
  ...screenFailureReasons,
31
+ "action-not-supported-on-mobile",
30
32
  runnerUnreachableFailureReason,
31
33
  ]),
32
34
  ]);
@@ -35,7 +37,7 @@ export const makePerformActionOnRunnerContract = () => {
35
37
  failure,
36
38
  ]);
37
39
  return {
38
- description: `Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). A success means the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no \`runner.runFlow\` is needed before acting; if the browser is still starting when the wait runs out, the answer is \`screen-not-ready\` and retrying converges. \`screen-needs-a-run\` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call \`runner.runFlow\` with a flow that opens a browser. ${screenNotReadyDescription} A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it. ${runnerHasNoScreenDescription} ${unreachableDescription}`,
40
+ description: `Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). A success means the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no \`runner.runFlow\` is needed before acting; if the browser is still starting when the wait runs out, the answer is \`screen-not-ready\` and retrying converges. On a mobile runner, the same \`screen-needs-a-run\` and \`screen-not-ready\` outcomes mean no Appium session has started yet, or it did not answer this instant; \`runner.runFlow\` is what starts one, same as a browser. \`screen-needs-a-run\` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call \`runner.runFlow\` with a flow that opens a browser. ${screenNotReadyDescription} A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it. ${runnerHasNoScreenDescription} ${notSupportedOnMobileDescription} ${unreachableDescription}`,
39
41
  input,
40
42
  kind: "write",
41
43
  name: "runner.performAction",
@@ -1 +1 @@
1
- {"version":3,"file":"performAction.js","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAElE,gFAAgF;AAChF,mBAAmB;AACnB,MAAM,sBAAsB,GAC1B,mQAAmQ,CAAC;AAEtQ,uDAAuD;AACvD,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAEjD,MAAM,CAAC,MAAM,iCAAiC,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E,CAAC;QAC3C,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,8yCAA8yC,yBAAyB,mGAAmG,4BAA4B,IAAI,+BAA+B,IAAI,sBAAsB,EAAE;QAClhD,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const makeTakeScreenshotOnRunnerContract: () => {
3
- readonly description: "Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. `screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `playwright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
3
+ readonly description: "Take one screenshot of an interactive runner's screen. On a runner with a browser the image is the whole virtual desktop, browser window and all. On a mobile runner it is the device's own screen, re-encoded to JPEG on the pod so this contract reads one image format regardless of runner family. `screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `playwright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
4
4
  readonly input: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  }, z.core.$strip>;
@@ -12,9 +12,9 @@ export declare const makeTakeScreenshotOnRunnerContract: () => {
12
12
  }, z.core.$strip>, z.ZodObject<{
13
13
  failureReason: z.ZodEnum<{
14
14
  "runner-unreachable": "runner-unreachable";
15
- "runner-has-no-screen": "runner-has-no-screen";
16
15
  "screen-needs-a-run": "screen-needs-a-run";
17
16
  "screen-not-ready": "screen-not-ready";
17
+ "runner-has-no-screen": "runner-has-no-screen";
18
18
  }>;
19
19
  outcome: z.ZodLiteral<"failure">;
20
20
  }, z.core.$strip>], "outcome">;
@@ -25,7 +25,7 @@ export const makeTakeScreenshotOnRunnerContract = () => {
25
25
  ]),
26
26
  ]);
27
27
  return {
28
- description: `Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
28
+ description: `Take one screenshot of an interactive runner's screen. On a runner with a browser the image is the whole virtual desktop, browser window and all. On a mobile runner it is the device's own screen, re-encoded to JPEG on the pod so this contract reads one image format regardless of runner family. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
29
29
  input,
30
30
  kind: "read",
31
31
  name: "runner.takeScreenshot",
@@ -1 +1 @@
1
- {"version":3,"file":"takeScreenshot.js","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,e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,cAAc,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,kCAAkC,GAAG,GAAG,EAAE;IACrD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACzE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,uEAAuE;YACvE,iEAAiE;YACjE,uEAAuE;YACvE,wBAAwB;YACxB,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CACP,8KAA8K,CAC/K;YACH,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9B,CAAC;QACF,uBAAuB,CAAC;YACtB,GAAG,oBAAoB;YACvB,8BAA8B;SAC/B,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,0SAA0S,0BAA0B,IAAI,yBAAyB,IAAI,4BAA4B,IAAI,qCAAqC,EAAE;QACzb,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,uBAAuB;QAC7B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { type BrowserAction, browserActionSchema, } from "./runner/browserAction.js";
2
+ export { runEnvironmentSchema } from "./runner/environment.js";
3
+ export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
4
+ export { type RunnerNameForPublicApi, makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
5
+ export { type InspectOnRunnerRequest, inspectRequestSchema, } from "./runner/inspect.js";
6
+ export { type InspectMobileRequest, inspectMobileRequestSchema, } from "./runner/inspectMobile.js";
7
+ export { type JournalEntry, type JournalStream, type KnownJournalStream, type ReadJournalRequest, type ReadJournalResponse, journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
8
+ export { type RunFiles, maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
9
+ export { maxActionErrorMessageLength } from "./runner/performAction.js";
10
+ export { type RunSelection, runSelectionSchema, } from "./runner/runSelection.js";
11
+ //# sourceMappingURL=runnerReexports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerReexports.d.ts","sourceRoot":"","sources":["../../src/v1/runnerReexports.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAClB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAK/D,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,sBAAsB,EAC3B,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,QAAQ,EACb,qBAAqB,EACrB,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}