@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
@@ -5,12 +5,18 @@ import { z } from "zod";
5
5
  * because it is the half a client can apply while collecting — escaping can
6
6
  * inflate the encoding severalfold, which
7
7
  * {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
8
+ * The run payloads for Figma and other POM customers are currently still extremely large
9
+ * The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
10
+ * We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
8
11
  */
9
12
  export declare const maxRunFilesByteLength: number;
10
13
  /**
11
14
  * The largest request, JSON-encoded, that may be sent to a runner. Checked
12
15
  * against the fully assembled request, so an oversized one is refused with a
13
16
  * reason rather than failing opaquely in transport.
17
+ * The run payloads for Figma and other POM customers are currently still extremely large
18
+ * The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
19
+ * We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
14
20
  */
15
21
  export declare const maxRunnerRequestEncodedByteLength: number;
16
22
  /** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
@@ -1 +1 @@
1
- {"version":3,"file":"payloadSize.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAkB,CAAC;AAEjE,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAM1D;AAOD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uCAgBvB,CAAC;AAEL,oDAAoD;AACpD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"payloadSize.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,QAAmB,CAAC;AAElE,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAM1D;AAOD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uCAgBvB,CAAC;AAEL,oDAAoD;AACpD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -6,14 +6,20 @@ import { isShippableRunFilePath, runFilePathRefusal } from "./files.js";
6
6
  * because it is the half a client can apply while collecting — escaping can
7
7
  * inflate the encoding severalfold, which
8
8
  * {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
9
+ * The run payloads for Figma and other POM customers are currently still extremely large
10
+ * The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
11
+ * We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
9
12
  */
10
- export const maxRunFilesByteLength = 4 * 1024 * 1024;
13
+ export const maxRunFilesByteLength = 30 * 1024 * 1024;
11
14
  /**
12
15
  * The largest request, JSON-encoded, that may be sent to a runner. Checked
13
16
  * against the fully assembled request, so an oversized one is refused with a
14
17
  * reason rather than failing opaquely in transport.
18
+ * The run payloads for Figma and other POM customers are currently still extremely large
19
+ * The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
20
+ * We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
15
21
  */
16
- export const maxRunnerRequestEncodedByteLength = 9 * 1024 * 1024;
22
+ export const maxRunnerRequestEncodedByteLength = 30 * 1024 * 1024;
17
23
  /** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
18
24
  export function runFilesByteLength(files) {
19
25
  return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength(content) + utf8ByteLength(path), 0);
@@ -1 +1 @@
1
- {"version":3,"file":"payloadSize.js","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,E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QAC3C,iBAAiB,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kBAAkB;YAC3B,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,qBAAqB,EAAE;IACrE,KAAK,EAAE,8CAA8C,qBAAqB,kBAAkB;CAC7F,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). `performed` if 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 `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 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. `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.";
6
6
  readonly input: z.ZodObject<{
7
7
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
8
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -44,18 +44,19 @@ export declare const makePerformActionOnRunnerContract: () => {
44
44
  readonly kind: "write";
45
45
  readonly name: "runner.performAction";
46
46
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
- outcome: z.ZodLiteral<"performed">;
48
- }, z.core.$strip>, z.ZodObject<{
47
+ outcome: z.ZodLiteral<"success">;
48
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
49
49
  errorMessage: z.ZodString;
50
- outcome: z.ZodLiteral<"action-failed">;
51
- }, z.core.$strip>, z.ZodObject<{
52
- outcome: z.ZodLiteral<"screen-needs-a-run">;
53
- }, z.core.$strip>, z.ZodObject<{
54
- outcome: z.ZodLiteral<"screen-not-ready">;
55
- }, z.core.$strip>, z.ZodObject<{
56
- outcome: z.ZodLiteral<"runner-has-no-screen">;
50
+ failureReason: z.ZodLiteral<"action-failed">;
51
+ outcome: z.ZodLiteral<"failure">;
57
52
  }, z.core.$strip>, z.ZodObject<{
58
- outcome: z.ZodLiteral<"runner-unreachable">;
59
- }, z.core.$strip>], "outcome">;
53
+ failureReason: z.ZodEnum<{
54
+ "runner-unreachable": "runner-unreachable";
55
+ "runner-has-no-screen": "runner-has-no-screen";
56
+ "screen-needs-a-run": "screen-needs-a-run";
57
+ "screen-not-ready": "screen-not-ready";
58
+ }>;
59
+ outcome: z.ZodLiteral<"failure">;
60
+ }, z.core.$strip>], "failureReason">], "outcome">;
60
61
  };
61
62
  //# sourceMappingURL=performAction.d.ts.map
@@ -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;AAoBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC7C,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;AAmBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C7C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { browserActionSchema } from "./browserAction.js";
3
3
  import { runnerIdSchema } from "./identity.js";
4
- import { runnerHasNoScreenDescription, runnerHasNoScreenSchema, runnerScreenNeedsARunSchema, runnerScreenNotReadySchema, screenNotReadyDescription, } from "./screen.js";
5
- import { runnerUnreachableSchema } from "./unreachable.js";
4
+ import { makeRunnerFailureSchema } from "./outcome.js";
5
+ import { runnerHasNoScreenDescription, screenFailureReasons, screenNotReadyDescription, } from "./screen.js";
6
+ import { runnerUnreachableFailureReason } from "./unreachable.js";
6
7
  // Not the shared retryable wording: the action may have taken effect before its
7
8
  // answer was lost.
8
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.";
@@ -13,22 +14,28 @@ export const makePerformActionOnRunnerContract = () => {
13
14
  action: browserActionSchema.describe("The action to perform. Coordinates are pixels on the screenshot's own coordinate space."),
14
15
  id: runnerIdSchema.describe("Id of the runner to act on."),
15
16
  });
16
- const output = z.discriminatedUnion("outcome", [
17
- z.object({ outcome: z.literal("performed") }),
17
+ // `action-failed` is the one reason that carries a message, so it is an arm of
18
+ // its own and the other reasons share theirs.
19
+ const failure = z.discriminatedUnion("failureReason", [
18
20
  z.object({
19
21
  errorMessage: z
20
22
  .string()
21
23
  .max(maxActionErrorMessageLength)
22
24
  .describe("What stopped the action from taking effect."),
23
- outcome: z.literal("action-failed"),
25
+ failureReason: z.literal("action-failed"),
26
+ outcome: z.literal("failure"),
24
27
  }),
25
- runnerScreenNeedsARunSchema,
26
- runnerScreenNotReadySchema,
27
- runnerHasNoScreenSchema,
28
- runnerUnreachableSchema,
28
+ makeRunnerFailureSchema([
29
+ ...screenFailureReasons,
30
+ runnerUnreachableFailureReason,
31
+ ]),
32
+ ]);
33
+ const output = z.discriminatedUnion("outcome", [
34
+ z.object({ outcome: z.literal("success") }),
35
+ failure,
29
36
  ]);
30
37
  return {
31
- 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). \`performed\` if 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}`,
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}`,
32
39
  input,
33
40
  kind: "write",
34
41
  name: "runner.performAction",
@@ -1 +1 @@
1
- {"version":3,"file":"performAction.js","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AAuB,CAAC;YACtB,GAAG,oBAAoB;YACvB,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,mlCAAmlC,yBAAyB,mGAAmG,4BAA4B,IAAI,sBAAsB,EAAE;QACpxC,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -23,9 +23,12 @@ export declare const makeReadRunnerJournalContract: () => {
23
23
  hasUnsearchedHistory: z.ZodBoolean;
24
24
  nextSequence: z.ZodNumber;
25
25
  oldestAvailableSequence: z.ZodNumber;
26
- outcome: z.ZodLiteral<"read">;
26
+ outcome: z.ZodLiteral<"success">;
27
27
  }, z.core.$strip>, z.ZodObject<{
28
- outcome: z.ZodLiteral<"runner-unreachable">;
28
+ failureReason: z.ZodEnum<{
29
+ "runner-unreachable": "runner-unreachable";
30
+ }>;
31
+ outcome: z.ZodLiteral<"failure">;
29
32
  }, z.core.$strip>], "outcome">;
30
33
  };
31
34
  //# sourceMappingURL=readJournal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"readJournal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC"}
1
+ {"version":3,"file":"readJournal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC"}
@@ -1,15 +1,16 @@
1
1
  import { z } from "zod";
2
2
  import { runnerIdSchema } from "./identity.js";
3
3
  import { journalStreamSchema, knownJournalStreams, readJournalRequestSchema, readJournalResponseSchema, } from "./journal.js";
4
- import { retryableRunnerUnreachableDescription, runnerUnreachableSchema, } from "./unreachable.js";
4
+ import { makeRunnerFailureSchema } from "./outcome.js";
5
+ import { retryableRunnerUnreachableDescription, runnerUnreachableFailureReason, } from "./unreachable.js";
5
6
  export const makeReadRunnerJournalContract = () => {
6
7
  const input = readJournalRequestSchema.extend({
7
8
  id: runnerIdSchema.describe("Id of the runner to read the journal of."),
8
9
  stream: journalStreamSchema.describe(`The stream to read. QA Wolf writes ${knownJournalStreams.join(", ")}; an unwritten stream reads as empty rather than as an error.`),
9
10
  });
10
11
  const output = z.discriminatedUnion("outcome", [
11
- readJournalResponseSchema.extend({ outcome: z.literal("read") }),
12
- runnerUnreachableSchema,
12
+ readJournalResponseSchema.extend({ outcome: z.literal("success") }),
13
+ makeRunnerFailureSchema([runnerUnreachableFailureReason]),
13
14
  ]);
14
15
  return {
15
16
  description: `Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: \`run-status\` settles it, \`run-logs\` and \`run-events\` carry what it produced, and \`recorder\` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. ${retryableRunnerUnreachableDescription}`,
@@ -1 +1 @@
1
- {"version":3,"file":"readJournal.js","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;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Q,CAAC,0CAA0C,CAAC;QACvE,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAClC,sCAAsC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,+DAA+D,CACpI;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,yBAAyB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACnE,uBAAuB,CAAC,CAAC,8BAA8B,CAAC,CAAC;KAC1D,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,wcAAwc,qCAAqC,EAAE;QAC5f,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,33 +1,46 @@
1
1
  import { z } from "zod";
2
2
  export declare const makeRunFlowOnRunnerContract: () => {
3
- readonly description: "Run a flow on an interactive runner. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call answers `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
3
+ readonly description: "Run a flow on an interactive runner. When `selection` is given the lines run against the browser as it stands, so nothing is re-navigated and nothing is signed in again; without it the whole entry point runs from a fresh browser. A runner with no live browser starts one before a selection and says so with `bootstrappedRunner`, which means those lines ran against a fresh page rather than the one an earlier run left. A selection produces no `runStarted` event, so follow it by its run id on `run-status` like any other run. Send `unchangedFiles` to ship only what changed since an earlier run on this runner; a `needs-full-sync` failure names the paths it does not hold, and the way to recover is the same run again with every file in `files`. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call fails with `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
4
4
  readonly input: z.ZodObject<{
5
5
  entryPointPath: z.ZodString;
6
6
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
7
7
  files: z.ZodRecord<z.ZodString, z.ZodString>;
8
8
  id: z.ZodString;
9
+ selection: z.ZodOptional<z.ZodObject<{
10
+ endLine: z.ZodInt;
11
+ path: z.ZodString;
12
+ startLine: z.ZodInt;
13
+ }, z.core.$strip>>;
14
+ unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
9
15
  }, z.core.$strip>;
10
16
  readonly kind: "write";
11
17
  readonly name: "runner.runFlow";
12
18
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
- outcome: z.ZodLiteral<"submitted">;
19
+ bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
20
+ outcome: z.ZodLiteral<"success">;
14
21
  runId: z.ZodString;
15
- }, z.core.$strip>, z.ZodObject<{
16
- outcome: z.ZodLiteral<"runner-unreachable">;
17
- }, z.core.$strip>, z.ZodObject<{
18
- outcome: z.ZodLiteral<"runner-target-mismatch">;
22
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
23
+ failureReason: z.ZodLiteral<"runner-target-mismatch">;
24
+ outcome: z.ZodLiteral<"failure">;
19
25
  requiredRunnerName: z.ZodEnum<{
20
- node20Basic: "node20Basic";
21
- node20WithAndroid: "node20WithAndroid";
22
- node20WithIos: "node20WithIos";
23
- node20WithPlaywright: "node20WithPlaywright";
26
+ basic: "basic";
27
+ playwright: "playwright";
28
+ android: "android";
29
+ ios: "ios";
24
30
  }>;
25
31
  runnerName: z.ZodEnum<{
26
- node20Basic: "node20Basic";
27
- node20WithAndroid: "node20WithAndroid";
28
- node20WithIos: "node20WithIos";
29
- node20WithPlaywright: "node20WithPlaywright";
32
+ basic: "basic";
33
+ playwright: "playwright";
34
+ android: "android";
35
+ ios: "ios";
30
36
  }>;
31
- }, z.core.$strip>], "outcome">;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ failureReason: z.ZodLiteral<"needs-full-sync">;
39
+ missingPaths: z.ZodArray<z.ZodString>;
40
+ outcome: z.ZodLiteral<"failure">;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ failureReason: z.ZodLiteral<"runner-unreachable">;
43
+ outcome: z.ZodLiteral<"failure">;
44
+ }, z.core.$strip>], "failureReason">], "outcome">;
32
45
  };
33
46
  //# sourceMappingURL=runFlow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvC,CAAC"}
1
+ {"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GvC,CAAC"}
@@ -1,9 +1,22 @@
1
1
  import { z } from "zod";
2
2
  import { runEnvironmentSchema } from "./environment.js";
3
- import { runFilePathSchema, runPackageJsonPath } from "./files.js";
3
+ import { isShippableRunFilePath, runFilePathRefusal, runFilePathSchema, runPackageJsonPath, } from "./files.js";
4
4
  import { runnerIdSchema, runnerNameSchema } from "./identity.js";
5
5
  import { runFilesSchema } from "./payloadSize.js";
6
- import { runnerUnreachableSchema } from "./unreachable.js";
6
+ import { runSelectionSchema } from "./runSelection.js";
7
+ const unchangedFilesSchema = z
8
+ .record(z.string(), z.string().min(1))
9
+ .superRefine((hashes, refinementContext) => {
10
+ for (const path of Object.keys(hashes)) {
11
+ if (isShippableRunFilePath(path))
12
+ continue;
13
+ refinementContext.addIssue({
14
+ code: "custom",
15
+ message: runFilePathRefusal,
16
+ path: [path],
17
+ });
18
+ }
19
+ });
7
20
  export const makeRunFlowOnRunnerContract = () => {
8
21
  const input = z
9
22
  .object({
@@ -13,6 +26,12 @@ export const makeRunFlowOnRunnerContract = () => {
13
26
  .describe("Environment variables to make available to the run."),
14
27
  files: runFilesSchema.describe("Every file the run needs keyed by its path — the flow file, everything it imports, package.json and tsconfig.json. A runner holds no copy of your project, so what runs is exactly what is sent here."),
15
28
  id: runnerIdSchema.describe("Id of the runner to run the flow on."),
29
+ selection: runSelectionSchema
30
+ .optional()
31
+ .describe("Run only these lines, inside the page the runner is already on, instead of running the whole flow from a fresh browser. Omit to run the whole entry point."),
32
+ unchangedFiles: unchangedFilesSchema
33
+ .optional()
34
+ .describe("Files this runner already holds from an earlier run, keyed by path with a hex SHA-256 of the content it should hold. Send this to make `files` only what changed. The runner refuses with `needs-full-sync` if it holds none of a referenced path, so it never runs something other than what was asked for. Omit it to send every file."),
16
35
  })
17
36
  // Stated here rather than discovered when the runner cannot find a module.
18
37
  .refine((request) => Object.hasOwn(request.files, request.entryPointPath), {
@@ -22,23 +41,50 @@ export const makeRunFlowOnRunnerContract = () => {
22
41
  .refine((request) => Object.hasOwn(request.files, runPackageJsonPath), {
23
42
  error: `The files must include ${runPackageJsonPath}; the run's npm dependencies are read from it.`,
24
43
  path: ["files"],
44
+ })
45
+ .refine((request) => request.selection === undefined ||
46
+ Object.hasOwn(request.files, request.selection.path), {
47
+ error: "A selection must name a file carried in files.",
48
+ path: ["selection", "path"],
49
+ })
50
+ .refine((request) => Object.keys(request.unchangedFiles ?? {}).every((path) => !Object.hasOwn(request.files, path)), {
51
+ error: "A path may be sent in files or referenced in unchangedFiles, not both.",
52
+ path: ["unchangedFiles"],
25
53
  });
54
+ const failure = z.discriminatedUnion("failureReason", [
55
+ z.object({
56
+ failureReason: z.literal("runner-target-mismatch"),
57
+ outcome: z.literal("failure"),
58
+ requiredRunnerName: runnerNameSchema.describe("The runner family this flow's execution target needs."),
59
+ runnerName: runnerNameSchema.describe("The runner family the runner is actually running."),
60
+ }),
61
+ z.object({
62
+ failureReason: z.literal("needs-full-sync"),
63
+ missingPaths: z
64
+ .array(runFilePathSchema)
65
+ .describe("Paths referenced in `unchangedFiles` that this runner does not hold. Send the run again with every file it needs in `files`."),
66
+ outcome: z.literal("failure"),
67
+ }),
68
+ z.object({
69
+ failureReason: z.literal("runner-unreachable"),
70
+ outcome: z.literal("failure"),
71
+ }),
72
+ ]);
26
73
  const output = z.discriminatedUnion("outcome", [
27
74
  z.object({
28
- outcome: z.literal("submitted"),
75
+ bootstrappedRunner: z
76
+ .boolean()
77
+ .optional()
78
+ .describe("True when the runner had no live browser and one was started before the run, so a `selection` ran against a fresh page rather than the one an earlier run left. Absent means the runner was already warm. Only a request carrying `selection` can bootstrap, because a whole run starts its own browser either way."),
79
+ outcome: z.literal("success"),
29
80
  runId: z
30
81
  .string()
31
82
  .describe("Id of the run, to follow it by. Read the `run-status` stream of the runner's journal for its outcome, and `run-logs` and `run-events` for its output."),
32
83
  }),
33
- runnerUnreachableSchema,
34
- z.object({
35
- outcome: z.literal("runner-target-mismatch"),
36
- requiredRunnerName: runnerNameSchema.describe("The image this flow's execution target needs."),
37
- runnerName: runnerNameSchema.describe("The image the runner is actually running."),
38
- }),
84
+ failure,
39
85
  ]);
40
86
  return {
41
- description: "Run a flow on an interactive runner. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call answers `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.",
87
+ description: "Run a flow on an interactive runner. When `selection` is given the lines run against the browser as it stands, so nothing is re-navigated and nothing is signed in again; without it the whole entry point runs from a fresh browser. A runner with no live browser starts one before a selection and says so with `bootstrappedRunner`, which means those lines ran against a fresh page rather than the one an earlier run left. A selection produces no `runStarted` event, so follow it by its run id on `run-status` like any other run. Send `unchangedFiles` to ship only what changed since an earlier run on this runner; a `needs-full-sync` failure names the paths it does not hold, and the way to recover is the same run again with every file in `files`. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call fails with `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.",
42
88
  input,
43
89
  kind: "write",
44
90
  name: "runner.runFlow",
@@ -1 +1 @@
1
- {"version":3,"file":"runFlow.js","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,cAAc,EAAE,iBAAiB,CAAC,QAA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AAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const runSelectionSchema: z.ZodObject<{
3
+ endLine: z.ZodInt;
4
+ path: z.ZodString;
5
+ startLine: z.ZodInt;
6
+ }, z.core.$strip>;
7
+ export type RunSelection = z.infer<typeof runSelectionSchema>;
8
+ //# sourceMappingURL=runSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runSelection.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;iBAiB3B,CAAC;AAEL,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { runFilePathSchema } from "./files.js";
3
+ export const runSelectionSchema = z
4
+ .object({
5
+ endLine: z
6
+ .int()
7
+ .positive()
8
+ .describe("Last line to run, 1-indexed and inclusive."),
9
+ path: runFilePathSchema.describe("Path of the file the lines are in, as it appears in `files`. It does not have to be the entry point."),
10
+ startLine: z
11
+ .int()
12
+ .positive()
13
+ .describe("First line to run, 1-indexed and inclusive."),
14
+ })
15
+ .refine((selection) => selection.startLine <= selection.endLine, {
16
+ error: "A selection's startLine must not be after its endLine.",
17
+ path: ["startLine"],
18
+ });
19
+ //# sourceMappingURL=runSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runSelection.js","sourceRoot":"","sources":["../../../src/v1/runner/runSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,4CAA4C,CAAC;IACzD,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAC9B,sGAAsG,CACvG;IACD,SAAS,EAAE,CAAC;SACT,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;CAC3D,CAAC;KACD,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE;IAC/D,KAAK,EAAE,wDAAwD;IAC/D,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC,CAAC"}
@@ -1,14 +1,5 @@
1
- import { z } from "zod";
2
- export declare const runnerScreenNotReadySchema: z.ZodObject<{
3
- outcome: z.ZodLiteral<"screen-not-ready">;
4
- }, z.core.$strip>;
1
+ export declare const screenFailureReasons: readonly ["runner-has-no-screen", "screen-needs-a-run", "screen-not-ready"];
5
2
  export declare const screenNotReadyDescription = "`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 \u2014 a run may restart the display and discard what is on it.";
6
- export declare const runnerScreenNeedsARunSchema: z.ZodObject<{
7
- outcome: z.ZodLiteral<"screen-needs-a-run">;
8
- }, z.core.$strip>;
9
3
  export declare const screenNeedsARunDescription = "`screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless \u2014 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.";
10
- export declare const runnerHasNoScreenSchema: z.ZodObject<{
11
- outcome: z.ZodLiteral<"runner-has-no-screen">;
12
- }, z.core.$strip>;
13
- export declare const runnerHasNoScreenDescription = "`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 \u2014 launch a `node20WithPlaywright` runner instead.";
4
+ export declare const runnerHasNoScreenDescription = "`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 \u2014 launch a `playwright` runner instead.";
14
5
  //# sourceMappingURL=screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yXAC6U,CAAC;AAIpX,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,0BAA0B,2YAC8V,CAAC;AAEtY,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,4BAA4B,2NAC4K,CAAC"}
1
+ {"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,6EAIvB,CAAC;AAEX,eAAO,MAAM,yBAAyB,yXAC6U,CAAC;AAIpX,eAAO,MAAM,0BAA0B,2YAC8V,CAAC;AAEtY,eAAO,MAAM,4BAA4B,iNACkK,CAAC"}
@@ -1,16 +1,11 @@
1
- import { z } from "zod";
2
- export const runnerScreenNotReadySchema = z.object({
3
- outcome: z.literal("screen-not-ready"),
4
- });
1
+ export const screenFailureReasons = [
2
+ "runner-has-no-screen",
3
+ "screen-needs-a-run",
4
+ "screen-not-ready",
5
+ ];
5
6
  export const screenNotReadyDescription = "`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.";
6
- // Its own outcome, not a sentence inside `screen-not-ready`: the callers here are
7
+ // Its own reason, not a sentence inside `screen-not-ready`: the callers here are
7
8
  // models, and an instruction that only exists in prose is one they may not follow.
8
- export const runnerScreenNeedsARunSchema = z.object({
9
- outcome: z.literal("screen-needs-a-run"),
10
- });
11
9
  export const screenNeedsARunDescription = "`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.";
12
- export const runnerHasNoScreenSchema = z.object({
13
- outcome: z.literal("runner-has-no-screen"),
14
- });
15
- export const runnerHasNoScreenDescription = "`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.";
10
+ export const runnerHasNoScreenDescription = "`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.";
16
11
  //# sourceMappingURL=screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GACpC,iXAAiX,CAAC;AAEpX,kFAAkF;AAClF,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GACrC,mYAAmY,CAAC;AAEtY,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GACvC,mNAAmN,CAAC"}
1
+ {"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GACpC,iXAAiX,CAAC;AAEpX,iFAAiF;AACjF,mFAAmF;AACnF,MAAM,CAAC,MAAM,0BAA0B,GACrC,mYAAmY,CAAC;AAEtY,MAAM,CAAC,MAAM,4BAA4B,GACvC,yMAAyM,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ export declare const makeStopRunOnRunnerContract: () => {
3
+ readonly description: "Stop what a runner is currently executing, leaving the runner up and its browser on whatever page the run reached. Succeeds whether or not anything was running, and `wasRunning` says which. This is the counterpart of `runner.terminate`, which ends the runner itself. The run stops where it is, so the journal's `run-status` settles it as stopped rather than passed or failed. `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. The stop may still have landed, but stopping a runner that is already idle does nothing, so retrying is safe.";
4
+ readonly input: z.ZodObject<{
5
+ id: z.ZodString;
6
+ }, z.core.$strip>;
7
+ readonly kind: "write";
8
+ readonly name: "runner.stopRun";
9
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ outcome: z.ZodLiteral<"success">;
11
+ wasRunning: z.ZodBoolean;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ failureReason: z.ZodEnum<{
14
+ "runner-unreachable": "runner-unreachable";
15
+ }>;
16
+ outcome: z.ZodLiteral<"failure">;
17
+ }, z.core.$strip>], "outcome">;
18
+ };
19
+ //# sourceMappingURL=stopRun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stopRun.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/stopRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;CA8BvC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import { runnerIdSchema } from "./identity.js";
3
+ import { makeRunnerFailureSchema } from "./outcome.js";
4
+ import { runnerUnreachableFailureReason } from "./unreachable.js";
5
+ export const makeStopRunOnRunnerContract = () => {
6
+ const input = z.object({
7
+ id: runnerIdSchema.describe("Id of the runner to stop the run on."),
8
+ });
9
+ const output = z.discriminatedUnion("outcome", [
10
+ z.object({
11
+ outcome: z.literal("success"),
12
+ wasRunning: z
13
+ .boolean()
14
+ .describe("False when the runner had nothing to stop: the run had already finished, or none had been submitted. Not an error."),
15
+ }),
16
+ makeRunnerFailureSchema([runnerUnreachableFailureReason]),
17
+ ]);
18
+ return {
19
+ description: "Stop what a runner is currently executing, leaving the runner up and its browser on whatever page the run reached. Succeeds whether or not anything was running, and `wasRunning` says which. This is the counterpart of `runner.terminate`, which ends the runner itself. The run stops where it is, so the journal's `run-status` settles it as stopped rather than passed or failed. `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. The stop may still have landed, but stopping a runner that is already idle does nothing, so retrying is safe.",
20
+ input,
21
+ kind: "write",
22
+ name: "runner.stopRun",
23
+ output,
24
+ };
25
+ };
26
+ //# sourceMappingURL=stopRun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stopRun.js","sourceRoot":"","sources":["../../../src/v1/runner/stopRun.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,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACpE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7B,UAAU,EAAE,CAAC;iBACV,OAAO,EAAE;iBACT,QAAQ,CACP,oHAAoH,CACrH;SACJ,CAAC;QACF,uBAAuB,CAAC,CAAC,8BAA8B,CAAC,CAAC;KAC1D,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,ooBAAooB;QACtoB,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}