@qawolf/api-contracts 0.25.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 (79) hide show
  1. package/dist/v1/index.d.ts +394 -124
  2. package/dist/v1/index.d.ts.map +1 -1
  3. package/dist/v1/index.js +12 -2
  4. package/dist/v1/index.js.map +1 -1
  5. package/dist/v1/issue/addFlows.d.ts +55 -0
  6. package/dist/v1/issue/addFlows.d.ts.map +1 -0
  7. package/dist/v1/issue/addFlows.js +27 -0
  8. package/dist/v1/issue/addFlows.js.map +1 -0
  9. package/dist/v1/issue/create.d.ts +1 -0
  10. package/dist/v1/issue/create.d.ts.map +1 -1
  11. package/dist/v1/issue/index.d.ts +3 -0
  12. package/dist/v1/issue/index.d.ts.map +1 -1
  13. package/dist/v1/issue/index.js +3 -0
  14. package/dist/v1/issue/index.js.map +1 -1
  15. package/dist/v1/issue/update.d.ts +1 -0
  16. package/dist/v1/issue/update.d.ts.map +1 -1
  17. package/dist/v1/runner/environment.d.ts.map +1 -1
  18. package/dist/v1/runner/environment.js +11 -8
  19. package/dist/v1/runner/environment.js.map +1 -1
  20. package/dist/v1/runner/evaluateSnippet.d.ts +5 -2
  21. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -1
  22. package/dist/v1/runner/evaluateSnippet.js +4 -3
  23. package/dist/v1/runner/evaluateSnippet.js.map +1 -1
  24. package/dist/v1/runner/identity.d.ts +8 -8
  25. package/dist/v1/runner/identity.js +5 -5
  26. package/dist/v1/runner/identity.js.map +1 -1
  27. package/dist/v1/runner/importPackage.d.ts +23 -0
  28. package/dist/v1/runner/importPackage.d.ts.map +1 -0
  29. package/dist/v1/runner/importPackage.js +33 -0
  30. package/dist/v1/runner/importPackage.js.map +1 -0
  31. package/dist/v1/runner/index.d.ts +16 -20
  32. package/dist/v1/runner/index.d.ts.map +1 -1
  33. package/dist/v1/runner/index.js +14 -12
  34. package/dist/v1/runner/index.js.map +1 -1
  35. package/dist/v1/runner/inspect.d.ts +42 -0
  36. package/dist/v1/runner/inspect.d.ts.map +1 -0
  37. package/dist/v1/runner/inspect.js +61 -0
  38. package/dist/v1/runner/inspect.js.map +1 -0
  39. package/dist/v1/runner/outcome.d.ts +6 -0
  40. package/dist/v1/runner/outcome.d.ts.map +1 -0
  41. package/dist/v1/runner/outcome.js +8 -0
  42. package/dist/v1/runner/outcome.js.map +1 -0
  43. package/dist/v1/runner/payloadSize.d.ts +6 -0
  44. package/dist/v1/runner/payloadSize.d.ts.map +1 -1
  45. package/dist/v1/runner/payloadSize.js +8 -2
  46. package/dist/v1/runner/payloadSize.js.map +1 -1
  47. package/dist/v1/runner/performAction.d.ts +13 -12
  48. package/dist/v1/runner/performAction.d.ts.map +1 -1
  49. package/dist/v1/runner/performAction.js +17 -10
  50. package/dist/v1/runner/performAction.js.map +1 -1
  51. package/dist/v1/runner/readJournal.d.ts +5 -2
  52. package/dist/v1/runner/readJournal.d.ts.map +1 -1
  53. package/dist/v1/runner/readJournal.js +4 -3
  54. package/dist/v1/runner/readJournal.js.map +1 -1
  55. package/dist/v1/runner/runFlow.d.ts +28 -15
  56. package/dist/v1/runner/runFlow.d.ts.map +1 -1
  57. package/dist/v1/runner/runFlow.js +56 -10
  58. package/dist/v1/runner/runFlow.js.map +1 -1
  59. package/dist/v1/runner/runSelection.d.ts +8 -0
  60. package/dist/v1/runner/runSelection.d.ts.map +1 -0
  61. package/dist/v1/runner/runSelection.js +19 -0
  62. package/dist/v1/runner/runSelection.js.map +1 -0
  63. package/dist/v1/runner/screen.d.ts +3 -12
  64. package/dist/v1/runner/screen.d.ts.map +1 -1
  65. package/dist/v1/runner/screen.js +8 -13
  66. package/dist/v1/runner/screen.js.map +1 -1
  67. package/dist/v1/runner/stopRun.d.ts +19 -0
  68. package/dist/v1/runner/stopRun.d.ts.map +1 -0
  69. package/dist/v1/runner/stopRun.js +26 -0
  70. package/dist/v1/runner/stopRun.js.map +1 -0
  71. package/dist/v1/runner/takeScreenshot.d.ts +9 -9
  72. package/dist/v1/runner/takeScreenshot.d.ts.map +1 -1
  73. package/dist/v1/runner/takeScreenshot.js +8 -7
  74. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  75. package/dist/v1/runner/unreachable.d.ts +4 -7
  76. package/dist/v1/runner/unreachable.d.ts.map +1 -1
  77. package/dist/v1/runner/unreachable.js +4 -7
  78. package/dist/v1/runner/unreachable.js.map +1 -1
  79. package/package.json +1 -1
@@ -7,9 +7,11 @@ export { type BrowserAction, browserActionSchema, } from "./runner/browserAction
7
7
  export { runEnvironmentSchema } from "./runner/environment.js";
8
8
  export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
9
9
  export { type RunnerNameForPublicApi, makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
10
+ export { type InspectOnRunnerRequest, inspectRequestSchema, } from "./runner/inspect.js";
10
11
  export { type JournalEntry, type JournalStream, type KnownJournalStream, type ReadJournalRequest, type ReadJournalResponse, journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
11
12
  export { type RunFiles, maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
12
13
  export { maxActionErrorMessageLength } from "./runner/performAction.js";
14
+ export { type RunSelection, runSelectionSchema, } from "./runner/runSelection.js";
13
15
  import type { AnyPublicApiContract } from "./definition.js";
14
16
  import { type PublicIdSchema, type PublicIdSchemasOf } from "./ids.js";
15
17
  export type PublicApiInput<Api extends AnyPublicApiContract> = z.input<Api["input"]>;
@@ -306,6 +308,53 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
306
308
  };
307
309
  };
308
310
  issue: {
311
+ addFlows: {
312
+ readonly description: string;
313
+ readonly input: z.ZodObject<{
314
+ flowIds: z.ZodArray<FlowId>;
315
+ issueId: IssueId;
316
+ }, z.core.$strip>;
317
+ readonly kind: "write";
318
+ readonly name: "issue.addFlows";
319
+ readonly output: z.ZodObject<{
320
+ issue: z.ZodObject<{
321
+ coveredFlowIds: z.ZodArray<FlowId>;
322
+ createdAt: z.ZodCoercedDate<unknown>;
323
+ description: z.ZodString;
324
+ issueId: IssueId;
325
+ name: z.ZodString;
326
+ number: z.ZodNumber;
327
+ priority: z.ZodEnum<{
328
+ unprioritized: "unprioritized";
329
+ low: "low";
330
+ medium: "medium";
331
+ high: "high";
332
+ urgent: "urgent";
333
+ }>;
334
+ reproductions: z.ZodArray<z.ZodObject<{
335
+ environmentId: EnvironmentId;
336
+ firstReproducedInRunId: RunId;
337
+ flowId: FlowId;
338
+ isActive: z.ZodBoolean;
339
+ lastReproducedInRunId: RunId;
340
+ }, z.core.$strip>>;
341
+ status: z.ZodEnum<{
342
+ pending: "pending";
343
+ inProgress: "inProgress";
344
+ paused: "paused";
345
+ resolved: "resolved";
346
+ canceled: "canceled";
347
+ archived: "archived";
348
+ }>;
349
+ type: z.ZodEnum<{
350
+ bug: "bug";
351
+ coverageRequest: "coverageRequest";
352
+ maintenance: "maintenance";
353
+ }>;
354
+ url: z.ZodURL;
355
+ }, z.core.$strip>;
356
+ }, z.core.$strip>;
357
+ };
309
358
  create: {
310
359
  readonly description: string;
311
360
  readonly input: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -338,6 +387,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
338
387
  readonly name: "issue.create";
339
388
  readonly output: z.ZodObject<{
340
389
  issue: z.ZodObject<{
390
+ coveredFlowIds: z.ZodArray<FlowId>;
341
391
  createdAt: z.ZodCoercedDate<unknown>;
342
392
  description: z.ZodString;
343
393
  issueId: IssueId;
@@ -398,6 +448,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
398
448
  readonly name: "issue.find";
399
449
  readonly output: z.ZodObject<{
400
450
  issues: z.ZodArray<z.ZodObject<{
451
+ coveredFlowIds: z.ZodArray<FlowId>;
401
452
  createdAt: z.ZodCoercedDate<unknown>;
402
453
  description: z.ZodString;
403
454
  issueId: IssueId;
@@ -444,6 +495,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
444
495
  readonly name: "issue.get";
445
496
  readonly output: z.ZodObject<{
446
497
  issue: z.ZodObject<{
498
+ coveredFlowIds: z.ZodArray<FlowId>;
447
499
  createdAt: z.ZodCoercedDate<unknown>;
448
500
  description: z.ZodString;
449
501
  issueId: IssueId;
@@ -506,6 +558,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
506
558
  readonly name: "issue.update";
507
559
  readonly output: z.ZodObject<{
508
560
  issue: z.ZodObject<{
561
+ coveredFlowIds: z.ZodArray<FlowId>;
509
562
  createdAt: z.ZodCoercedDate<unknown>;
510
563
  description: z.ZodString;
511
564
  issueId: IssueId;
@@ -716,25 +769,78 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
716
769
  readonly name: "runner.evaluateSnippet";
717
770
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
718
771
  errorMessage: z.ZodOptional<z.ZodString>;
719
- outcome: z.ZodLiteral<"evaluated">;
772
+ outcome: z.ZodLiteral<"success">;
720
773
  result: z.ZodEnum<{
721
774
  success: "success";
722
775
  error: "error";
723
776
  stopped: "stopped";
724
777
  }>;
725
778
  }, z.core.$strip>, z.ZodObject<{
726
- outcome: z.ZodLiteral<"runner-unreachable">;
779
+ failureReason: z.ZodEnum<{
780
+ "runner-unreachable": "runner-unreachable";
781
+ }>;
782
+ outcome: z.ZodLiteral<"failure">;
783
+ }, z.core.$strip>], "outcome">;
784
+ };
785
+ importPackage: {
786
+ readonly description: "Install a package into an interactive runner's live run and import it, so a snippet or a selection can use it without a full run to reinstall dependencies. An `install-failed` failure carries npm's reason in `errorMessage`. `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 install may still have landed, but installing the same version again does nothing, so retrying is safe.";
787
+ readonly input: z.ZodObject<{
788
+ id: z.ZodString;
789
+ npmDependencies: z.ZodRecord<z.ZodString, z.ZodString>;
790
+ packageName: z.ZodString;
791
+ packageVersion: z.ZodString;
792
+ }, z.core.$strip>;
793
+ readonly kind: "write";
794
+ readonly name: "runner.importPackage";
795
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
796
+ outcome: z.ZodLiteral<"success">;
797
+ }, z.core.$strip>, z.ZodObject<{
798
+ errorMessage: z.ZodOptional<z.ZodString>;
799
+ failureReason: z.ZodEnum<{
800
+ "runner-unreachable": "runner-unreachable";
801
+ "install-failed": "install-failed";
802
+ }>;
803
+ outcome: z.ZodLiteral<"failure">;
804
+ }, z.core.$strip>], "outcome">;
805
+ };
806
+ inspect: {
807
+ readonly description: string;
808
+ readonly input: z.ZodObject<{
809
+ id: z.ZodString;
810
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
811
+ selector: z.ZodString;
812
+ what: z.ZodLiteral<"element-html">;
813
+ }, z.core.$strip>, z.ZodObject<{
814
+ selector: z.ZodOptional<z.ZodString>;
815
+ what: z.ZodLiteral<"page-html">;
816
+ }, z.core.$strip>, z.ZodObject<{
817
+ variableName: z.ZodString;
818
+ what: z.ZodLiteral<"variable">;
819
+ }, z.core.$strip>], "what">;
820
+ }, z.core.$strip>;
821
+ readonly kind: "read";
822
+ readonly name: "runner.inspect";
823
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
824
+ outcome: z.ZodLiteral<"success">;
825
+ value: z.ZodString;
826
+ }, z.core.$strip>, z.ZodObject<{
827
+ errorMessage: z.ZodOptional<z.ZodString>;
828
+ failureReason: z.ZodEnum<{
829
+ "runner-unreachable": "runner-unreachable";
830
+ "nothing-to-inspect": "nothing-to-inspect";
831
+ }>;
832
+ outcome: z.ZodLiteral<"failure">;
727
833
  }, z.core.$strip>], "outcome">;
728
834
  };
729
835
  launch: {
730
- readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `outcome` to tell which happened.";
836
+ readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `alreadyRunning` to tell which happened.";
731
837
  readonly input: z.ZodObject<{
732
838
  id: z.ZodString;
733
839
  runnerName: z.ZodOptional<z.ZodEnum<{
734
- node20Basic: "node20Basic";
735
- node20WithAndroid: "node20WithAndroid";
736
- node20WithIos: "node20WithIos";
737
- node20WithPlaywright: "node20WithPlaywright";
840
+ basic: "basic";
841
+ playwright: "playwright";
842
+ android: "android";
843
+ ios: "ios";
738
844
  }>>;
739
845
  }, z.core.$strip>;
740
846
  readonly kind: "write";
@@ -743,19 +849,17 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
743
849
  gpuAccelerated: z.ZodBoolean;
744
850
  id: z.ZodString;
745
851
  runnerName: z.ZodEnum<{
746
- node20Basic: "node20Basic";
747
- node20WithAndroid: "node20WithAndroid";
748
- node20WithIos: "node20WithIos";
749
- node20WithPlaywright: "node20WithPlaywright";
750
- }>;
751
- outcome: z.ZodEnum<{
752
- launched: "launched";
753
- "already-running": "already-running";
852
+ basic: "basic";
853
+ playwright: "playwright";
854
+ android: "android";
855
+ ios: "ios";
754
856
  }>;
857
+ alreadyRunning: z.ZodBoolean;
858
+ outcome: z.ZodLiteral<"success">;
755
859
  }, z.core.$strip>;
756
860
  };
757
861
  performAction: {
758
- 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. `screen-needs-a-run` if the runner has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. 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. A `navigate` does not go through the screen, so a screen that is not ready does not stop it — but it still needs the runner to have run something, and until then it answers `action-failed` rather than `screen-needs-a-run`. `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.";
862
+ 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.";
759
863
  readonly input: z.ZodObject<{
760
864
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
761
865
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -797,19 +901,20 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
797
901
  readonly kind: "write";
798
902
  readonly name: "runner.performAction";
799
903
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
800
- outcome: z.ZodLiteral<"performed">;
801
- }, z.core.$strip>, z.ZodObject<{
904
+ outcome: z.ZodLiteral<"success">;
905
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
802
906
  errorMessage: z.ZodString;
803
- outcome: z.ZodLiteral<"action-failed">;
804
- }, z.core.$strip>, z.ZodObject<{
805
- outcome: z.ZodLiteral<"screen-needs-a-run">;
907
+ failureReason: z.ZodLiteral<"action-failed">;
908
+ outcome: z.ZodLiteral<"failure">;
806
909
  }, z.core.$strip>, z.ZodObject<{
807
- outcome: z.ZodLiteral<"screen-not-ready">;
808
- }, z.core.$strip>, z.ZodObject<{
809
- outcome: z.ZodLiteral<"runner-has-no-screen">;
810
- }, z.core.$strip>, z.ZodObject<{
811
- outcome: z.ZodLiteral<"runner-unreachable">;
812
- }, z.core.$strip>], "outcome">;
910
+ failureReason: z.ZodEnum<{
911
+ "runner-unreachable": "runner-unreachable";
912
+ "runner-has-no-screen": "runner-has-no-screen";
913
+ "screen-needs-a-run": "screen-needs-a-run";
914
+ "screen-not-ready": "screen-not-ready";
915
+ }>;
916
+ outcome: z.ZodLiteral<"failure">;
917
+ }, z.core.$strip>], "failureReason">], "outcome">;
813
918
  };
814
919
  readJournal: {
815
920
  readonly 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. `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.";
@@ -835,59 +940,77 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
835
940
  hasUnsearchedHistory: z.ZodBoolean;
836
941
  nextSequence: z.ZodNumber;
837
942
  oldestAvailableSequence: z.ZodNumber;
838
- outcome: z.ZodLiteral<"read">;
943
+ outcome: z.ZodLiteral<"success">;
839
944
  }, z.core.$strip>, z.ZodObject<{
840
- outcome: z.ZodLiteral<"runner-unreachable">;
945
+ failureReason: z.ZodEnum<{
946
+ "runner-unreachable": "runner-unreachable";
947
+ }>;
948
+ outcome: z.ZodLiteral<"failure">;
841
949
  }, z.core.$strip>], "outcome">;
842
950
  };
843
951
  runFlow: {
844
- 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.";
952
+ 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.";
845
953
  readonly input: z.ZodObject<{
846
954
  entryPointPath: z.ZodString;
847
955
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
848
956
  files: z.ZodRecord<z.ZodString, z.ZodString>;
849
957
  id: z.ZodString;
958
+ selection: z.ZodOptional<z.ZodObject<{
959
+ endLine: z.ZodInt;
960
+ path: z.ZodString;
961
+ startLine: z.ZodInt;
962
+ }, z.core.$strip>>;
963
+ unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
850
964
  }, z.core.$strip>;
851
965
  readonly kind: "write";
852
966
  readonly name: "runner.runFlow";
853
967
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
854
- outcome: z.ZodLiteral<"submitted">;
968
+ bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
969
+ outcome: z.ZodLiteral<"success">;
855
970
  runId: z.ZodString;
856
- }, z.core.$strip>, z.ZodObject<{
857
- outcome: z.ZodLiteral<"runner-unreachable">;
858
- }, z.core.$strip>, z.ZodObject<{
859
- outcome: z.ZodLiteral<"runner-target-mismatch">;
971
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
972
+ failureReason: z.ZodLiteral<"runner-target-mismatch">;
973
+ outcome: z.ZodLiteral<"failure">;
860
974
  requiredRunnerName: z.ZodEnum<{
861
- node20Basic: "node20Basic";
862
- node20WithAndroid: "node20WithAndroid";
863
- node20WithIos: "node20WithIos";
864
- node20WithPlaywright: "node20WithPlaywright";
975
+ basic: "basic";
976
+ playwright: "playwright";
977
+ android: "android";
978
+ ios: "ios";
865
979
  }>;
866
980
  runnerName: z.ZodEnum<{
867
- node20Basic: "node20Basic";
868
- node20WithAndroid: "node20WithAndroid";
869
- node20WithIos: "node20WithIos";
870
- node20WithPlaywright: "node20WithPlaywright";
981
+ basic: "basic";
982
+ playwright: "playwright";
983
+ android: "android";
984
+ ios: "ios";
871
985
  }>;
872
- }, z.core.$strip>], "outcome">;
986
+ }, z.core.$strip>, z.ZodObject<{
987
+ failureReason: z.ZodLiteral<"needs-full-sync">;
988
+ missingPaths: z.ZodArray<z.ZodString>;
989
+ outcome: z.ZodLiteral<"failure">;
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ failureReason: z.ZodLiteral<"runner-unreachable">;
992
+ outcome: z.ZodLiteral<"failure">;
993
+ }, z.core.$strip>], "failureReason">], "outcome">;
873
994
  };
874
- stop: {
875
- readonly description: "Stop an interactive runner on the caller's team. Stopping a runner that is not running succeeds and reports `not-running`, so a retry needs no special handling.";
995
+ stopRun: {
996
+ 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.";
876
997
  readonly input: z.ZodObject<{
877
998
  id: z.ZodString;
878
999
  }, z.core.$strip>;
879
1000
  readonly kind: "write";
880
- readonly name: "runner.stop";
881
- readonly output: z.ZodObject<{
882
- id: z.ZodString;
883
- outcome: z.ZodEnum<{
884
- stopped: "stopped";
885
- "not-running": "not-running";
1001
+ readonly name: "runner.stopRun";
1002
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1003
+ outcome: z.ZodLiteral<"success">;
1004
+ wasRunning: z.ZodBoolean;
1005
+ }, z.core.$strip>, z.ZodObject<{
1006
+ failureReason: z.ZodEnum<{
1007
+ "runner-unreachable": "runner-unreachable";
886
1008
  }>;
887
- }, z.core.$strip>;
1009
+ outcome: z.ZodLiteral<"failure">;
1010
+ }, z.core.$strip>], "outcome">;
888
1011
  };
889
1012
  takeScreenshot: {
890
- 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 has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. 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.";
1013
+ 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.";
891
1014
  readonly input: z.ZodObject<{
892
1015
  id: z.ZodString;
893
1016
  }, z.core.$strip>;
@@ -895,17 +1018,30 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
895
1018
  readonly name: "runner.takeScreenshot";
896
1019
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
897
1020
  imageJpegBase64: z.ZodString;
898
- outcome: z.ZodLiteral<"captured">;
1021
+ outcome: z.ZodLiteral<"success">;
899
1022
  }, z.core.$strip>, z.ZodObject<{
900
- outcome: z.ZodLiteral<"screen-needs-a-run">;
901
- }, z.core.$strip>, z.ZodObject<{
902
- outcome: z.ZodLiteral<"screen-not-ready">;
903
- }, z.core.$strip>, z.ZodObject<{
904
- outcome: z.ZodLiteral<"runner-has-no-screen">;
905
- }, z.core.$strip>, z.ZodObject<{
906
- outcome: z.ZodLiteral<"runner-unreachable">;
1023
+ failureReason: z.ZodEnum<{
1024
+ "runner-unreachable": "runner-unreachable";
1025
+ "runner-has-no-screen": "runner-has-no-screen";
1026
+ "screen-needs-a-run": "screen-needs-a-run";
1027
+ "screen-not-ready": "screen-not-ready";
1028
+ }>;
1029
+ outcome: z.ZodLiteral<"failure">;
907
1030
  }, z.core.$strip>], "outcome">;
908
1031
  };
1032
+ terminate: {
1033
+ readonly description: "End an interactive runner on the caller's team, and the pod it runs on with it. Terminating a runner that is not running succeeds and reports `wasRunning: false`. This ends the runner: use `runner.stopRun` to stop what a runner is currently executing while leaving the runner up.";
1034
+ readonly input: z.ZodObject<{
1035
+ id: z.ZodString;
1036
+ }, z.core.$strip>;
1037
+ readonly kind: "write";
1038
+ readonly name: "runner.terminate";
1039
+ readonly output: z.ZodObject<{
1040
+ id: z.ZodString;
1041
+ outcome: z.ZodLiteral<"success">;
1042
+ wasRunning: z.ZodBoolean;
1043
+ }, z.core.$strip>;
1044
+ };
909
1045
  };
910
1046
  tag: {
911
1047
  create: {
@@ -1228,6 +1364,53 @@ export declare const publicContractsV1: {
1228
1364
  };
1229
1365
  };
1230
1366
  issue: {
1367
+ addFlows: {
1368
+ readonly description: string;
1369
+ readonly input: z.ZodObject<{
1370
+ flowIds: z.ZodArray<PublicIdSchema>;
1371
+ issueId: PublicIdSchema;
1372
+ }, z.core.$strip>;
1373
+ readonly kind: "write";
1374
+ readonly name: "issue.addFlows";
1375
+ readonly output: z.ZodObject<{
1376
+ issue: z.ZodObject<{
1377
+ coveredFlowIds: z.ZodArray<PublicIdSchema>;
1378
+ createdAt: z.ZodCoercedDate<unknown>;
1379
+ description: z.ZodString;
1380
+ issueId: PublicIdSchema;
1381
+ name: z.ZodString;
1382
+ number: z.ZodNumber;
1383
+ priority: z.ZodEnum<{
1384
+ unprioritized: "unprioritized";
1385
+ low: "low";
1386
+ medium: "medium";
1387
+ high: "high";
1388
+ urgent: "urgent";
1389
+ }>;
1390
+ reproductions: z.ZodArray<z.ZodObject<{
1391
+ environmentId: PublicIdSchema;
1392
+ firstReproducedInRunId: PublicIdSchema;
1393
+ flowId: PublicIdSchema;
1394
+ isActive: z.ZodBoolean;
1395
+ lastReproducedInRunId: PublicIdSchema;
1396
+ }, z.core.$strip>>;
1397
+ status: z.ZodEnum<{
1398
+ pending: "pending";
1399
+ inProgress: "inProgress";
1400
+ paused: "paused";
1401
+ resolved: "resolved";
1402
+ canceled: "canceled";
1403
+ archived: "archived";
1404
+ }>;
1405
+ type: z.ZodEnum<{
1406
+ bug: "bug";
1407
+ coverageRequest: "coverageRequest";
1408
+ maintenance: "maintenance";
1409
+ }>;
1410
+ url: z.ZodURL;
1411
+ }, z.core.$strip>;
1412
+ }, z.core.$strip>;
1413
+ };
1231
1414
  create: {
1232
1415
  readonly description: string;
1233
1416
  readonly input: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1260,6 +1443,7 @@ export declare const publicContractsV1: {
1260
1443
  readonly name: "issue.create";
1261
1444
  readonly output: z.ZodObject<{
1262
1445
  issue: z.ZodObject<{
1446
+ coveredFlowIds: z.ZodArray<PublicIdSchema>;
1263
1447
  createdAt: z.ZodCoercedDate<unknown>;
1264
1448
  description: z.ZodString;
1265
1449
  issueId: PublicIdSchema;
@@ -1320,6 +1504,7 @@ export declare const publicContractsV1: {
1320
1504
  readonly name: "issue.find";
1321
1505
  readonly output: z.ZodObject<{
1322
1506
  issues: z.ZodArray<z.ZodObject<{
1507
+ coveredFlowIds: z.ZodArray<PublicIdSchema>;
1323
1508
  createdAt: z.ZodCoercedDate<unknown>;
1324
1509
  description: z.ZodString;
1325
1510
  issueId: PublicIdSchema;
@@ -1366,6 +1551,7 @@ export declare const publicContractsV1: {
1366
1551
  readonly name: "issue.get";
1367
1552
  readonly output: z.ZodObject<{
1368
1553
  issue: z.ZodObject<{
1554
+ coveredFlowIds: z.ZodArray<PublicIdSchema>;
1369
1555
  createdAt: z.ZodCoercedDate<unknown>;
1370
1556
  description: z.ZodString;
1371
1557
  issueId: PublicIdSchema;
@@ -1428,6 +1614,7 @@ export declare const publicContractsV1: {
1428
1614
  readonly name: "issue.update";
1429
1615
  readonly output: z.ZodObject<{
1430
1616
  issue: z.ZodObject<{
1617
+ coveredFlowIds: z.ZodArray<PublicIdSchema>;
1431
1618
  createdAt: z.ZodCoercedDate<unknown>;
1432
1619
  description: z.ZodString;
1433
1620
  issueId: PublicIdSchema;
@@ -1638,25 +1825,78 @@ export declare const publicContractsV1: {
1638
1825
  readonly name: "runner.evaluateSnippet";
1639
1826
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1640
1827
  errorMessage: z.ZodOptional<z.ZodString>;
1641
- outcome: z.ZodLiteral<"evaluated">;
1828
+ outcome: z.ZodLiteral<"success">;
1642
1829
  result: z.ZodEnum<{
1643
1830
  success: "success";
1644
1831
  error: "error";
1645
1832
  stopped: "stopped";
1646
1833
  }>;
1647
1834
  }, z.core.$strip>, z.ZodObject<{
1648
- outcome: z.ZodLiteral<"runner-unreachable">;
1835
+ failureReason: z.ZodEnum<{
1836
+ "runner-unreachable": "runner-unreachable";
1837
+ }>;
1838
+ outcome: z.ZodLiteral<"failure">;
1839
+ }, z.core.$strip>], "outcome">;
1840
+ };
1841
+ importPackage: {
1842
+ readonly description: "Install a package into an interactive runner's live run and import it, so a snippet or a selection can use it without a full run to reinstall dependencies. An `install-failed` failure carries npm's reason in `errorMessage`. `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 install may still have landed, but installing the same version again does nothing, so retrying is safe.";
1843
+ readonly input: z.ZodObject<{
1844
+ id: z.ZodString;
1845
+ npmDependencies: z.ZodRecord<z.ZodString, z.ZodString>;
1846
+ packageName: z.ZodString;
1847
+ packageVersion: z.ZodString;
1848
+ }, z.core.$strip>;
1849
+ readonly kind: "write";
1850
+ readonly name: "runner.importPackage";
1851
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1852
+ outcome: z.ZodLiteral<"success">;
1853
+ }, z.core.$strip>, z.ZodObject<{
1854
+ errorMessage: z.ZodOptional<z.ZodString>;
1855
+ failureReason: z.ZodEnum<{
1856
+ "runner-unreachable": "runner-unreachable";
1857
+ "install-failed": "install-failed";
1858
+ }>;
1859
+ outcome: z.ZodLiteral<"failure">;
1860
+ }, z.core.$strip>], "outcome">;
1861
+ };
1862
+ inspect: {
1863
+ readonly description: string;
1864
+ readonly input: z.ZodObject<{
1865
+ id: z.ZodString;
1866
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
1867
+ selector: z.ZodString;
1868
+ what: z.ZodLiteral<"element-html">;
1869
+ }, z.core.$strip>, z.ZodObject<{
1870
+ selector: z.ZodOptional<z.ZodString>;
1871
+ what: z.ZodLiteral<"page-html">;
1872
+ }, z.core.$strip>, z.ZodObject<{
1873
+ variableName: z.ZodString;
1874
+ what: z.ZodLiteral<"variable">;
1875
+ }, z.core.$strip>], "what">;
1876
+ }, z.core.$strip>;
1877
+ readonly kind: "read";
1878
+ readonly name: "runner.inspect";
1879
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1880
+ outcome: z.ZodLiteral<"success">;
1881
+ value: z.ZodString;
1882
+ }, z.core.$strip>, z.ZodObject<{
1883
+ errorMessage: z.ZodOptional<z.ZodString>;
1884
+ failureReason: z.ZodEnum<{
1885
+ "runner-unreachable": "runner-unreachable";
1886
+ "nothing-to-inspect": "nothing-to-inspect";
1887
+ }>;
1888
+ outcome: z.ZodLiteral<"failure">;
1649
1889
  }, z.core.$strip>], "outcome">;
1650
1890
  };
1651
1891
  launch: {
1652
- readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `outcome` to tell which happened.";
1892
+ readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `alreadyRunning` to tell which happened.";
1653
1893
  readonly input: z.ZodObject<{
1654
1894
  id: z.ZodString;
1655
1895
  runnerName: z.ZodOptional<z.ZodEnum<{
1656
- node20Basic: "node20Basic";
1657
- node20WithAndroid: "node20WithAndroid";
1658
- node20WithIos: "node20WithIos";
1659
- node20WithPlaywright: "node20WithPlaywright";
1896
+ basic: "basic";
1897
+ playwright: "playwright";
1898
+ android: "android";
1899
+ ios: "ios";
1660
1900
  }>>;
1661
1901
  }, z.core.$strip>;
1662
1902
  readonly kind: "write";
@@ -1665,19 +1905,17 @@ export declare const publicContractsV1: {
1665
1905
  gpuAccelerated: z.ZodBoolean;
1666
1906
  id: z.ZodString;
1667
1907
  runnerName: z.ZodEnum<{
1668
- node20Basic: "node20Basic";
1669
- node20WithAndroid: "node20WithAndroid";
1670
- node20WithIos: "node20WithIos";
1671
- node20WithPlaywright: "node20WithPlaywright";
1672
- }>;
1673
- outcome: z.ZodEnum<{
1674
- launched: "launched";
1675
- "already-running": "already-running";
1908
+ basic: "basic";
1909
+ playwright: "playwright";
1910
+ android: "android";
1911
+ ios: "ios";
1676
1912
  }>;
1913
+ alreadyRunning: z.ZodBoolean;
1914
+ outcome: z.ZodLiteral<"success">;
1677
1915
  }, z.core.$strip>;
1678
1916
  };
1679
1917
  performAction: {
1680
- 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. `screen-needs-a-run` if the runner has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. 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. A `navigate` does not go through the screen, so a screen that is not ready does not stop it — but it still needs the runner to have run something, and until then it answers `action-failed` rather than `screen-needs-a-run`. `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.";
1918
+ 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.";
1681
1919
  readonly input: z.ZodObject<{
1682
1920
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1683
1921
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -1719,19 +1957,20 @@ export declare const publicContractsV1: {
1719
1957
  readonly kind: "write";
1720
1958
  readonly name: "runner.performAction";
1721
1959
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1722
- outcome: z.ZodLiteral<"performed">;
1723
- }, z.core.$strip>, z.ZodObject<{
1960
+ outcome: z.ZodLiteral<"success">;
1961
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1724
1962
  errorMessage: z.ZodString;
1725
- outcome: z.ZodLiteral<"action-failed">;
1726
- }, z.core.$strip>, z.ZodObject<{
1727
- outcome: z.ZodLiteral<"screen-needs-a-run">;
1963
+ failureReason: z.ZodLiteral<"action-failed">;
1964
+ outcome: z.ZodLiteral<"failure">;
1728
1965
  }, z.core.$strip>, z.ZodObject<{
1729
- outcome: z.ZodLiteral<"screen-not-ready">;
1730
- }, z.core.$strip>, z.ZodObject<{
1731
- outcome: z.ZodLiteral<"runner-has-no-screen">;
1732
- }, z.core.$strip>, z.ZodObject<{
1733
- outcome: z.ZodLiteral<"runner-unreachable">;
1734
- }, z.core.$strip>], "outcome">;
1966
+ failureReason: z.ZodEnum<{
1967
+ "runner-unreachable": "runner-unreachable";
1968
+ "runner-has-no-screen": "runner-has-no-screen";
1969
+ "screen-needs-a-run": "screen-needs-a-run";
1970
+ "screen-not-ready": "screen-not-ready";
1971
+ }>;
1972
+ outcome: z.ZodLiteral<"failure">;
1973
+ }, z.core.$strip>], "failureReason">], "outcome">;
1735
1974
  };
1736
1975
  readJournal: {
1737
1976
  readonly 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. `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.";
@@ -1757,59 +1996,77 @@ export declare const publicContractsV1: {
1757
1996
  hasUnsearchedHistory: z.ZodBoolean;
1758
1997
  nextSequence: z.ZodNumber;
1759
1998
  oldestAvailableSequence: z.ZodNumber;
1760
- outcome: z.ZodLiteral<"read">;
1999
+ outcome: z.ZodLiteral<"success">;
1761
2000
  }, z.core.$strip>, z.ZodObject<{
1762
- outcome: z.ZodLiteral<"runner-unreachable">;
2001
+ failureReason: z.ZodEnum<{
2002
+ "runner-unreachable": "runner-unreachable";
2003
+ }>;
2004
+ outcome: z.ZodLiteral<"failure">;
1763
2005
  }, z.core.$strip>], "outcome">;
1764
2006
  };
1765
2007
  runFlow: {
1766
- 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.";
2008
+ 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.";
1767
2009
  readonly input: z.ZodObject<{
1768
2010
  entryPointPath: z.ZodString;
1769
2011
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1770
2012
  files: z.ZodRecord<z.ZodString, z.ZodString>;
1771
2013
  id: z.ZodString;
2014
+ selection: z.ZodOptional<z.ZodObject<{
2015
+ endLine: z.ZodInt;
2016
+ path: z.ZodString;
2017
+ startLine: z.ZodInt;
2018
+ }, z.core.$strip>>;
2019
+ unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1772
2020
  }, z.core.$strip>;
1773
2021
  readonly kind: "write";
1774
2022
  readonly name: "runner.runFlow";
1775
2023
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1776
- outcome: z.ZodLiteral<"submitted">;
2024
+ bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
2025
+ outcome: z.ZodLiteral<"success">;
1777
2026
  runId: z.ZodString;
1778
- }, z.core.$strip>, z.ZodObject<{
1779
- outcome: z.ZodLiteral<"runner-unreachable">;
1780
- }, z.core.$strip>, z.ZodObject<{
1781
- outcome: z.ZodLiteral<"runner-target-mismatch">;
2027
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
2028
+ failureReason: z.ZodLiteral<"runner-target-mismatch">;
2029
+ outcome: z.ZodLiteral<"failure">;
1782
2030
  requiredRunnerName: z.ZodEnum<{
1783
- node20Basic: "node20Basic";
1784
- node20WithAndroid: "node20WithAndroid";
1785
- node20WithIos: "node20WithIos";
1786
- node20WithPlaywright: "node20WithPlaywright";
2031
+ basic: "basic";
2032
+ playwright: "playwright";
2033
+ android: "android";
2034
+ ios: "ios";
1787
2035
  }>;
1788
2036
  runnerName: z.ZodEnum<{
1789
- node20Basic: "node20Basic";
1790
- node20WithAndroid: "node20WithAndroid";
1791
- node20WithIos: "node20WithIos";
1792
- node20WithPlaywright: "node20WithPlaywright";
2037
+ basic: "basic";
2038
+ playwright: "playwright";
2039
+ android: "android";
2040
+ ios: "ios";
1793
2041
  }>;
1794
- }, z.core.$strip>], "outcome">;
2042
+ }, z.core.$strip>, z.ZodObject<{
2043
+ failureReason: z.ZodLiteral<"needs-full-sync">;
2044
+ missingPaths: z.ZodArray<z.ZodString>;
2045
+ outcome: z.ZodLiteral<"failure">;
2046
+ }, z.core.$strip>, z.ZodObject<{
2047
+ failureReason: z.ZodLiteral<"runner-unreachable">;
2048
+ outcome: z.ZodLiteral<"failure">;
2049
+ }, z.core.$strip>], "failureReason">], "outcome">;
1795
2050
  };
1796
- stop: {
1797
- readonly description: "Stop an interactive runner on the caller's team. Stopping a runner that is not running succeeds and reports `not-running`, so a retry needs no special handling.";
2051
+ stopRun: {
2052
+ 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.";
1798
2053
  readonly input: z.ZodObject<{
1799
2054
  id: z.ZodString;
1800
2055
  }, z.core.$strip>;
1801
2056
  readonly kind: "write";
1802
- readonly name: "runner.stop";
1803
- readonly output: z.ZodObject<{
1804
- id: z.ZodString;
1805
- outcome: z.ZodEnum<{
1806
- stopped: "stopped";
1807
- "not-running": "not-running";
2057
+ readonly name: "runner.stopRun";
2058
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
2059
+ outcome: z.ZodLiteral<"success">;
2060
+ wasRunning: z.ZodBoolean;
2061
+ }, z.core.$strip>, z.ZodObject<{
2062
+ failureReason: z.ZodEnum<{
2063
+ "runner-unreachable": "runner-unreachable";
1808
2064
  }>;
1809
- }, z.core.$strip>;
2065
+ outcome: z.ZodLiteral<"failure">;
2066
+ }, z.core.$strip>], "outcome">;
1810
2067
  };
1811
2068
  takeScreenshot: {
1812
- 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 has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. 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.";
2069
+ 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.";
1813
2070
  readonly input: z.ZodObject<{
1814
2071
  id: z.ZodString;
1815
2072
  }, z.core.$strip>;
@@ -1817,17 +2074,30 @@ export declare const publicContractsV1: {
1817
2074
  readonly name: "runner.takeScreenshot";
1818
2075
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1819
2076
  imageJpegBase64: z.ZodString;
1820
- outcome: z.ZodLiteral<"captured">;
2077
+ outcome: z.ZodLiteral<"success">;
1821
2078
  }, z.core.$strip>, z.ZodObject<{
1822
- outcome: z.ZodLiteral<"screen-needs-a-run">;
1823
- }, z.core.$strip>, z.ZodObject<{
1824
- outcome: z.ZodLiteral<"screen-not-ready">;
1825
- }, z.core.$strip>, z.ZodObject<{
1826
- outcome: z.ZodLiteral<"runner-has-no-screen">;
1827
- }, z.core.$strip>, z.ZodObject<{
1828
- outcome: z.ZodLiteral<"runner-unreachable">;
2079
+ failureReason: z.ZodEnum<{
2080
+ "runner-unreachable": "runner-unreachable";
2081
+ "runner-has-no-screen": "runner-has-no-screen";
2082
+ "screen-needs-a-run": "screen-needs-a-run";
2083
+ "screen-not-ready": "screen-not-ready";
2084
+ }>;
2085
+ outcome: z.ZodLiteral<"failure">;
1829
2086
  }, z.core.$strip>], "outcome">;
1830
2087
  };
2088
+ terminate: {
2089
+ readonly description: "End an interactive runner on the caller's team, and the pod it runs on with it. Terminating a runner that is not running succeeds and reports `wasRunning: false`. This ends the runner: use `runner.stopRun` to stop what a runner is currently executing while leaving the runner up.";
2090
+ readonly input: z.ZodObject<{
2091
+ id: z.ZodString;
2092
+ }, z.core.$strip>;
2093
+ readonly kind: "write";
2094
+ readonly name: "runner.terminate";
2095
+ readonly output: z.ZodObject<{
2096
+ id: z.ZodString;
2097
+ outcome: z.ZodLiteral<"success">;
2098
+ wasRunning: z.ZodBoolean;
2099
+ }, z.core.$strip>;
2100
+ };
1831
2101
  };
1832
2102
  tag: {
1833
2103
  create: {