@qawolf/api-contracts 0.30.0 → 0.33.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 (37) 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 +429 -27
  6. package/dist/v1/index.d.ts.map +1 -1
  7. package/dist/v1/index.js +3 -18
  8. package/dist/v1/index.js.map +1 -1
  9. package/dist/v1/run/index.d.ts.map +1 -1
  10. package/dist/v1/run/index.js +4 -1
  11. package/dist/v1/run/index.js.map +1 -1
  12. package/dist/v1/runner/environment.js +1 -1
  13. package/dist/v1/runner/files.js +1 -1
  14. package/dist/v1/runner/inspect.d.ts +1 -0
  15. package/dist/v1/runner/inspect.d.ts.map +1 -1
  16. package/dist/v1/runner/inspect.js +6 -2
  17. package/dist/v1/runner/inspect.js.map +1 -1
  18. package/dist/v1/runner/inspectMobile.d.ts +226 -0
  19. package/dist/v1/runner/inspectMobile.d.ts.map +1 -0
  20. package/dist/v1/runner/inspectMobile.js +118 -0
  21. package/dist/v1/runner/inspectMobile.js.map +1 -0
  22. package/dist/v1/runner/inspectMobileShapes.d.ts +73 -0
  23. package/dist/v1/runner/inspectMobileShapes.d.ts.map +1 -0
  24. package/dist/v1/runner/inspectMobileShapes.js +59 -0
  25. package/dist/v1/runner/inspectMobileShapes.js.map +1 -0
  26. package/dist/v1/runner/performAction.d.ts +3 -2
  27. package/dist/v1/runner/performAction.d.ts.map +1 -1
  28. package/dist/v1/runner/performAction.js +3 -1
  29. package/dist/v1/runner/performAction.js.map +1 -1
  30. package/dist/v1/runner/takeScreenshot.d.ts +2 -2
  31. package/dist/v1/runner/takeScreenshot.js +1 -1
  32. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  33. package/dist/v1/runnerReexports.d.ts +11 -0
  34. package/dist/v1/runnerReexports.d.ts.map +1 -0
  35. package/dist/v1/runnerReexports.js +23 -0
  36. package/dist/v1/runnerReexports.js.map +1 -0
  37. package/package.json +1 -1
@@ -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,CAAC,OAAO,CAAC,OAAO,CAAC;YACxB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;SACjE,CAAC;QACF,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9C,CAAC,CAAC,MAAM,CAAC;YACP,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;YACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;YACzB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC1B,CAAC;KACH,CAAC;IACF,KAAK,EAAE,CAAC,CAAC,MAAM,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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,GAAG,GAAG,EAAE;IACpD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAClC,yFAAyF,CAC1F;QACD,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC3D,CAAC,CAAC;IAEH,+EAA+E;IAC/E,8CAA8C;IAC9C,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC,eAAe,EAAE;QACpD,CAAC,CAAC,MAAM,CAAC;YACP,YAAY,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,GAAG,CAAC,2BAA2B,CAAC;iBAChC,QAAQ,CAAC,6CAA6C,CAAC;YAC1D,aAAa,EAAE,CAAC,CAAC,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C,CAAC,MAAM,CAAC;QACrB,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAClC,yFAAyF,CAC1F;QACD,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC3D,CAAC,CAAC;IAEH,+EAA+E;IAC/E,8CAA8C;IAC9C,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC,eAAe,EAAE;QACpD,CAAC,CAAC,MAAM,CAAC;YACP,YAAY,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,GAAG,CAAC,2BAA2B,CAAC;iBAChC,QAAQ,CAAC,6CAA6C,CAAC;YAC1D,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;YACzC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9B,CAAC;QACF,uBAAuB,CAAC;YACtB,GAAG,oBAAoB;YACvB,gCAAgC;YAChC,8BAA8B;SAC/B,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,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,eAAe,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,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;QAC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AAiE;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"}
@@ -0,0 +1,23 @@
1
+ // The `runner` resource's shared types and schemas, re-exported here rather
2
+ // than restated by every server and client that needs them. Split out of
3
+ // `index.ts` to keep that file under the line limit.
4
+ export { browserActionSchema, } from "./runner/browserAction.js";
5
+ // Carries the reservation of QA Wolf's own variable names, which the server
6
+ // validates with rather than restating — a second copy of that rule is how the
7
+ // reservation comes to differ from what is actually stamped.
8
+ export { runEnvironmentSchema } from "./runner/environment.js";
9
+ // The travel rule for files bound for a runner: which files travel, how much may
10
+ // travel, and what environment a run may carry. A client needs the predicate and
11
+ // the size bounds to collect and pre-check with; the schemas are also what the
12
+ // server and the runner validate with, so they are shared rather than restated.
13
+ export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
14
+ export { makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
15
+ export { inspectRequestSchema, } from "./runner/inspect.js";
16
+ export { inspectMobileRequestSchema, } from "./runner/inspectMobile.js";
17
+ // A journal read is answered verbatim by the public API, so its wire shapes are
18
+ // published here and the private journal package imports them from here.
19
+ export { journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
20
+ export { maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
21
+ export { maxActionErrorMessageLength } from "./runner/performAction.js";
22
+ export { runSelectionSchema, } from "./runner/runSelection.js";
23
+ //# sourceMappingURL=runnerReexports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runnerReexports.js","sourceRoot":"","sources":["../../src/v1/runnerReexports.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,qDAAqD;AACrD,OAAO,EAEL,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,4EAA4E;AAC5E,+EAA+E;AAC/E,6DAA6D;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,gFAAgF;AAChF,yEAAyE;AACzE,OAAO,EAML,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,qBAAqB,EACrB,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAEL,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/api-contracts",
3
- "version": "0.30.0",
3
+ "version": "0.33.0",
4
4
  "private": false,
5
5
  "description": "Versioned contracts for the QA Wolf public API",
6
6
  "repository": {