@qawolf/api-contracts 0.26.0 → 0.27.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 (67) hide show
  1. package/dist/v1/index.d.ts +292 -124
  2. package/dist/v1/index.d.ts.map +1 -1
  3. package/dist/v1/index.js +10 -2
  4. package/dist/v1/index.js.map +1 -1
  5. package/dist/v1/runner/environment.d.ts.map +1 -1
  6. package/dist/v1/runner/environment.js +11 -8
  7. package/dist/v1/runner/environment.js.map +1 -1
  8. package/dist/v1/runner/evaluateSnippet.d.ts +5 -2
  9. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -1
  10. package/dist/v1/runner/evaluateSnippet.js +4 -3
  11. package/dist/v1/runner/evaluateSnippet.js.map +1 -1
  12. package/dist/v1/runner/identity.d.ts +8 -8
  13. package/dist/v1/runner/identity.js +5 -5
  14. package/dist/v1/runner/identity.js.map +1 -1
  15. package/dist/v1/runner/importPackage.d.ts +23 -0
  16. package/dist/v1/runner/importPackage.d.ts.map +1 -0
  17. package/dist/v1/runner/importPackage.js +33 -0
  18. package/dist/v1/runner/importPackage.js.map +1 -0
  19. package/dist/v1/runner/index.d.ts +16 -20
  20. package/dist/v1/runner/index.d.ts.map +1 -1
  21. package/dist/v1/runner/index.js +14 -12
  22. package/dist/v1/runner/index.js.map +1 -1
  23. package/dist/v1/runner/inspect.d.ts +42 -0
  24. package/dist/v1/runner/inspect.d.ts.map +1 -0
  25. package/dist/v1/runner/inspect.js +61 -0
  26. package/dist/v1/runner/inspect.js.map +1 -0
  27. package/dist/v1/runner/outcome.d.ts +6 -0
  28. package/dist/v1/runner/outcome.d.ts.map +1 -0
  29. package/dist/v1/runner/outcome.js +8 -0
  30. package/dist/v1/runner/outcome.js.map +1 -0
  31. package/dist/v1/runner/payloadSize.d.ts +6 -0
  32. package/dist/v1/runner/payloadSize.d.ts.map +1 -1
  33. package/dist/v1/runner/payloadSize.js +8 -2
  34. package/dist/v1/runner/payloadSize.js.map +1 -1
  35. package/dist/v1/runner/performAction.d.ts +13 -12
  36. package/dist/v1/runner/performAction.d.ts.map +1 -1
  37. package/dist/v1/runner/performAction.js +17 -10
  38. package/dist/v1/runner/performAction.js.map +1 -1
  39. package/dist/v1/runner/readJournal.d.ts +5 -2
  40. package/dist/v1/runner/readJournal.d.ts.map +1 -1
  41. package/dist/v1/runner/readJournal.js +4 -3
  42. package/dist/v1/runner/readJournal.js.map +1 -1
  43. package/dist/v1/runner/runFlow.d.ts +28 -15
  44. package/dist/v1/runner/runFlow.d.ts.map +1 -1
  45. package/dist/v1/runner/runFlow.js +56 -10
  46. package/dist/v1/runner/runFlow.js.map +1 -1
  47. package/dist/v1/runner/runSelection.d.ts +8 -0
  48. package/dist/v1/runner/runSelection.d.ts.map +1 -0
  49. package/dist/v1/runner/runSelection.js +19 -0
  50. package/dist/v1/runner/runSelection.js.map +1 -0
  51. package/dist/v1/runner/screen.d.ts +2 -11
  52. package/dist/v1/runner/screen.d.ts.map +1 -1
  53. package/dist/v1/runner/screen.js +7 -12
  54. package/dist/v1/runner/screen.js.map +1 -1
  55. package/dist/v1/runner/stopRun.d.ts +19 -0
  56. package/dist/v1/runner/stopRun.d.ts.map +1 -0
  57. package/dist/v1/runner/stopRun.js +26 -0
  58. package/dist/v1/runner/stopRun.js.map +1 -0
  59. package/dist/v1/runner/takeScreenshot.d.ts +9 -9
  60. package/dist/v1/runner/takeScreenshot.d.ts.map +1 -1
  61. package/dist/v1/runner/takeScreenshot.js +8 -7
  62. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  63. package/dist/v1/runner/unreachable.d.ts +4 -7
  64. package/dist/v1/runner/unreachable.d.ts.map +1 -1
  65. package/dist/v1/runner/unreachable.js +4 -7
  66. package/dist/v1/runner/unreachable.js.map +1 -1
  67. package/package.json +1 -1
@@ -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 `node20WithPlaywright` 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. 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.";
4
4
  readonly input: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  }, z.core.$strip>;
@@ -8,15 +8,15 @@ export declare const makeTakeScreenshotOnRunnerContract: () => {
8
8
  readonly name: "runner.takeScreenshot";
9
9
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
10
  imageJpegBase64: z.ZodString;
11
- outcome: z.ZodLiteral<"captured">;
11
+ outcome: z.ZodLiteral<"success">;
12
12
  }, z.core.$strip>, z.ZodObject<{
13
- outcome: z.ZodLiteral<"screen-needs-a-run">;
14
- }, z.core.$strip>, z.ZodObject<{
15
- outcome: z.ZodLiteral<"screen-not-ready">;
16
- }, z.core.$strip>, z.ZodObject<{
17
- outcome: z.ZodLiteral<"runner-has-no-screen">;
18
- }, z.core.$strip>, z.ZodObject<{
19
- outcome: z.ZodLiteral<"runner-unreachable">;
13
+ failureReason: z.ZodEnum<{
14
+ "runner-unreachable": "runner-unreachable";
15
+ "runner-has-no-screen": "runner-has-no-screen";
16
+ "screen-needs-a-run": "screen-needs-a-run";
17
+ "screen-not-ready": "screen-not-ready";
18
+ }>;
19
+ outcome: z.ZodLiteral<"failure">;
20
20
  }, z.core.$strip>], "outcome">;
21
21
  };
22
22
  //# sourceMappingURL=takeScreenshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"takeScreenshot.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;CAqC9C,CAAC"}
1
+ {"version":3,"file":"takeScreenshot.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;CAqC9C,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { runnerIdSchema } from "./identity.js";
3
- import { runnerHasNoScreenDescription, runnerHasNoScreenSchema, runnerScreenNeedsARunSchema, runnerScreenNotReadySchema, screenNeedsARunDescription, screenNotReadyDescription, } from "./screen.js";
4
- import { retryableRunnerUnreachableDescription, runnerUnreachableSchema, } from "./unreachable.js";
3
+ import { makeRunnerFailureSchema } from "./outcome.js";
4
+ import { runnerHasNoScreenDescription, screenFailureReasons, screenNeedsARunDescription, screenNotReadyDescription, } from "./screen.js";
5
+ import { retryableRunnerUnreachableDescription, runnerUnreachableFailureReason, } from "./unreachable.js";
5
6
  export const makeTakeScreenshotOnRunnerContract = () => {
6
7
  const input = z.object({
7
8
  id: runnerIdSchema.describe("Id of the runner to take a screenshot of."),
@@ -16,12 +17,12 @@ export const makeTakeScreenshotOnRunnerContract = () => {
16
17
  .string()
17
18
  .min(1)
18
19
  .describe("The screenshot, as a base64-encoded JPEG. Decode it and write the bytes to a `.jpg` file — writing this string to the file leaves you with base64 text rather than an image."),
19
- outcome: z.literal("captured"),
20
+ outcome: z.literal("success"),
20
21
  }),
21
- runnerScreenNeedsARunSchema,
22
- runnerScreenNotReadySchema,
23
- runnerHasNoScreenSchema,
24
- runnerUnreachableSchema,
22
+ makeRunnerFailureSchema([
23
+ ...screenFailureReasons,
24
+ runnerUnreachableFailureReason,
25
+ ]),
25
26
  ]);
26
27
  return {
27
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}`,
@@ -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,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,kCAAkC,GAAG,GAAG,EAAE;I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E,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,mIAAmI,0BAA0B,IAAI,yBAAyB,IAAI,4BAA4B,IAAI,qCAAqC,EAAE;QAClR,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,uBAAuB;QAC7B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,16 +1,13 @@
1
- import { z } from "zod";
2
1
  /**
3
2
  * The one answer every verb that talks to a live runner can give instead of
4
3
  * doing the work. One condition, because telling pod states apart would commit
5
- * a published contract to a taxonomy of transient ones. Carries no advice —
6
- * whether a retry is safe differs per verb, and each verb says so itself.
4
+ * a published contract to a taxonomy of transient ones. Carries no advice,
5
+ * because whether a retry is safe differs per verb and each verb says so itself.
7
6
  */
8
- export declare const runnerUnreachableSchema: z.ZodObject<{
9
- outcome: z.ZodLiteral<"runner-unreachable">;
10
- }, z.core.$strip>;
7
+ export declare const runnerUnreachableFailureReason = "runner-unreachable";
11
8
  /**
12
9
  * For verbs that change nothing when they fail. A verb that may already have
13
- * taken effect must not use this — see `runner.runFlow`.
10
+ * taken effect must not use this. See `runner.runFlow`.
14
11
  */
15
12
  export declare const retryableRunnerUnreachableDescription = "`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.";
16
13
  //# sourceMappingURL=unreachable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qCAAqC,oPACiM,CAAC"}
1
+ {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,oPACiM,CAAC"}
@@ -1,16 +1,13 @@
1
- import { z } from "zod";
2
1
  /**
3
2
  * The one answer every verb that talks to a live runner can give instead of
4
3
  * doing the work. One condition, because telling pod states apart would commit
5
- * a published contract to a taxonomy of transient ones. Carries no advice —
6
- * whether a retry is safe differs per verb, and each verb says so itself.
4
+ * a published contract to a taxonomy of transient ones. Carries no advice,
5
+ * because whether a retry is safe differs per verb and each verb says so itself.
7
6
  */
8
- export const runnerUnreachableSchema = z.object({
9
- outcome: z.literal("runner-unreachable"),
10
- });
7
+ export const runnerUnreachableFailureReason = "runner-unreachable";
11
8
  /**
12
9
  * For verbs that change nothing when they fail. A verb that may already have
13
- * taken effect must not use this — see `runner.runFlow`.
10
+ * taken effect must not use this. See `runner.runFlow`.
14
11
  */
15
12
  export const retryableRunnerUnreachableDescription = "`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.";
16
13
  //# sourceMappingURL=unreachable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iPAAiP,CAAC"}
1
+ {"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iPAAiP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/api-contracts",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "private": false,
5
5
  "description": "Versioned contracts for the QA Wolf public API",
6
6
  "repository": {