@qawolf/api-contracts 0.26.0 → 0.29.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 (92) hide show
  1. package/dist/v1/environment/find.d.ts +3 -1
  2. package/dist/v1/environment/find.d.ts.map +1 -1
  3. package/dist/v1/environment/find.js +3 -0
  4. package/dist/v1/environment/find.js.map +1 -1
  5. package/dist/v1/environment/index.d.ts +1 -1
  6. package/dist/v1/environment/index.js +2 -2
  7. package/dist/v1/environment/index.js.map +1 -1
  8. package/dist/v1/environment/resource.js +1 -1
  9. package/dist/v1/environment/resource.js.map +1 -1
  10. package/dist/v1/index.d.ts +328 -126
  11. package/dist/v1/index.d.ts.map +1 -1
  12. package/dist/v1/index.js +13 -3
  13. package/dist/v1/index.js.map +1 -1
  14. package/dist/v1/issue/create.js +1 -1
  15. package/dist/v1/issue/create.js.map +1 -1
  16. package/dist/v1/issue/index.js +1 -1
  17. package/dist/v1/issue/index.js.map +1 -1
  18. package/dist/v1/run/reattempt.d.ts +21 -0
  19. package/dist/v1/run/reattempt.d.ts.map +1 -0
  20. package/dist/v1/run/reattempt.js +34 -0
  21. package/dist/v1/run/reattempt.js.map +1 -0
  22. package/dist/v1/runner/environment.d.ts.map +1 -1
  23. package/dist/v1/runner/environment.js +11 -8
  24. package/dist/v1/runner/environment.js.map +1 -1
  25. package/dist/v1/runner/evaluateSnippet.d.ts +5 -2
  26. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -1
  27. package/dist/v1/runner/evaluateSnippet.js +4 -3
  28. package/dist/v1/runner/evaluateSnippet.js.map +1 -1
  29. package/dist/v1/runner/identity.d.ts +8 -8
  30. package/dist/v1/runner/identity.js +5 -5
  31. package/dist/v1/runner/identity.js.map +1 -1
  32. package/dist/v1/runner/importPackage.d.ts +23 -0
  33. package/dist/v1/runner/importPackage.d.ts.map +1 -0
  34. package/dist/v1/runner/importPackage.js +33 -0
  35. package/dist/v1/runner/importPackage.js.map +1 -0
  36. package/dist/v1/runner/index.d.ts +16 -20
  37. package/dist/v1/runner/index.d.ts.map +1 -1
  38. package/dist/v1/runner/index.js +14 -12
  39. package/dist/v1/runner/index.js.map +1 -1
  40. package/dist/v1/runner/inspect.d.ts +42 -0
  41. package/dist/v1/runner/inspect.d.ts.map +1 -0
  42. package/dist/v1/runner/inspect.js +61 -0
  43. package/dist/v1/runner/inspect.js.map +1 -0
  44. package/dist/v1/runner/outcome.d.ts +6 -0
  45. package/dist/v1/runner/outcome.d.ts.map +1 -0
  46. package/dist/v1/runner/outcome.js +8 -0
  47. package/dist/v1/runner/outcome.js.map +1 -0
  48. package/dist/v1/runner/payloadSize.d.ts +6 -0
  49. package/dist/v1/runner/payloadSize.d.ts.map +1 -1
  50. package/dist/v1/runner/payloadSize.js +8 -2
  51. package/dist/v1/runner/payloadSize.js.map +1 -1
  52. package/dist/v1/runner/performAction.d.ts +13 -12
  53. package/dist/v1/runner/performAction.d.ts.map +1 -1
  54. package/dist/v1/runner/performAction.js +17 -10
  55. package/dist/v1/runner/performAction.js.map +1 -1
  56. package/dist/v1/runner/readJournal.d.ts +5 -2
  57. package/dist/v1/runner/readJournal.d.ts.map +1 -1
  58. package/dist/v1/runner/readJournal.js +4 -3
  59. package/dist/v1/runner/readJournal.js.map +1 -1
  60. package/dist/v1/runner/runFlow.d.ts +28 -15
  61. package/dist/v1/runner/runFlow.d.ts.map +1 -1
  62. package/dist/v1/runner/runFlow.js +56 -10
  63. package/dist/v1/runner/runFlow.js.map +1 -1
  64. package/dist/v1/runner/runSelection.d.ts +8 -0
  65. package/dist/v1/runner/runSelection.d.ts.map +1 -0
  66. package/dist/v1/runner/runSelection.js +19 -0
  67. package/dist/v1/runner/runSelection.js.map +1 -0
  68. package/dist/v1/runner/screen.d.ts +2 -11
  69. package/dist/v1/runner/screen.d.ts.map +1 -1
  70. package/dist/v1/runner/screen.js +7 -12
  71. package/dist/v1/runner/screen.js.map +1 -1
  72. package/dist/v1/runner/stopRun.d.ts +19 -0
  73. package/dist/v1/runner/stopRun.d.ts.map +1 -0
  74. package/dist/v1/runner/stopRun.js +26 -0
  75. package/dist/v1/runner/stopRun.js.map +1 -0
  76. package/dist/v1/runner/takeScreenshot.d.ts +9 -9
  77. package/dist/v1/runner/takeScreenshot.d.ts.map +1 -1
  78. package/dist/v1/runner/takeScreenshot.js +8 -7
  79. package/dist/v1/runner/takeScreenshot.js.map +1 -1
  80. package/dist/v1/runner/unreachable.d.ts +4 -7
  81. package/dist/v1/runner/unreachable.d.ts.map +1 -1
  82. package/dist/v1/runner/unreachable.js +4 -7
  83. package/dist/v1/runner/unreachable.js.map +1 -1
  84. package/dist/v1/tag/index.d.ts +5 -1
  85. package/dist/v1/tag/index.d.ts.map +1 -1
  86. package/dist/v1/tag/index.js +4 -1
  87. package/dist/v1/tag/index.js.map +1 -1
  88. package/dist/v1/tag/list.d.ts +3 -1
  89. package/dist/v1/tag/list.d.ts.map +1 -1
  90. package/dist/v1/tag/list.js +3 -0
  91. package/dist/v1/tag/list.js.map +1 -1
  92. 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"]>;
@@ -95,6 +97,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
95
97
  static: "static";
96
98
  preview: "preview";
97
99
  }>>;
100
+ workspaceId: z.ZodOptional<WorkspaceId>;
98
101
  }, z.core.$strip>;
99
102
  readonly kind: "read";
100
103
  readonly name: "environment.find";
@@ -131,7 +134,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
131
134
  }, z.core.$strip>;
132
135
  };
133
136
  get: {
134
- readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
137
+ readonly description: "Read a single environment's name, kind, standing run health, flow-code branch and reconciliation state, run concurrency limit, and termination state. If flowCodeBranch exists, use its syncStatus for Git reconciliation and read lastSyncedCommitHash only when syncStatus is reconciled.";
135
138
  readonly input: z.ZodObject<{
136
139
  environmentId: PublicIdSchema;
137
140
  }, z.core.$strip>;
@@ -753,6 +756,20 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
753
756
  url: z.ZodURL;
754
757
  }, z.core.$strip>;
755
758
  };
759
+ reattempt: {
760
+ readonly description: string;
761
+ readonly input: z.ZodObject<{
762
+ flowIds: z.ZodOptional<z.ZodArray<FlowId>>;
763
+ runId: RunId;
764
+ }, z.core.$strip>;
765
+ readonly kind: "write";
766
+ readonly name: "run.reattempt";
767
+ readonly output: z.ZodObject<{
768
+ reattemptedFlowIds: z.ZodArray<FlowId>;
769
+ runId: RunId;
770
+ url: z.ZodURL;
771
+ }, z.core.$strip>;
772
+ };
756
773
  };
757
774
  runner: {
758
775
  evaluateSnippet: {
@@ -767,25 +784,78 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
767
784
  readonly name: "runner.evaluateSnippet";
768
785
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
769
786
  errorMessage: z.ZodOptional<z.ZodString>;
770
- outcome: z.ZodLiteral<"evaluated">;
787
+ outcome: z.ZodLiteral<"success">;
771
788
  result: z.ZodEnum<{
772
789
  success: "success";
773
790
  error: "error";
774
791
  stopped: "stopped";
775
792
  }>;
776
793
  }, z.core.$strip>, z.ZodObject<{
777
- outcome: z.ZodLiteral<"runner-unreachable">;
794
+ failureReason: z.ZodEnum<{
795
+ "runner-unreachable": "runner-unreachable";
796
+ }>;
797
+ outcome: z.ZodLiteral<"failure">;
798
+ }, z.core.$strip>], "outcome">;
799
+ };
800
+ importPackage: {
801
+ 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.";
802
+ readonly input: z.ZodObject<{
803
+ id: z.ZodString;
804
+ npmDependencies: z.ZodRecord<z.ZodString, z.ZodString>;
805
+ packageName: z.ZodString;
806
+ packageVersion: z.ZodString;
807
+ }, z.core.$strip>;
808
+ readonly kind: "write";
809
+ readonly name: "runner.importPackage";
810
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
811
+ outcome: z.ZodLiteral<"success">;
812
+ }, z.core.$strip>, z.ZodObject<{
813
+ errorMessage: z.ZodOptional<z.ZodString>;
814
+ failureReason: z.ZodEnum<{
815
+ "runner-unreachable": "runner-unreachable";
816
+ "install-failed": "install-failed";
817
+ }>;
818
+ outcome: z.ZodLiteral<"failure">;
819
+ }, z.core.$strip>], "outcome">;
820
+ };
821
+ inspect: {
822
+ readonly description: string;
823
+ readonly input: z.ZodObject<{
824
+ id: z.ZodString;
825
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
826
+ selector: z.ZodString;
827
+ what: z.ZodLiteral<"element-html">;
828
+ }, z.core.$strip>, z.ZodObject<{
829
+ selector: z.ZodOptional<z.ZodString>;
830
+ what: z.ZodLiteral<"page-html">;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ variableName: z.ZodString;
833
+ what: z.ZodLiteral<"variable">;
834
+ }, z.core.$strip>], "what">;
835
+ }, z.core.$strip>;
836
+ readonly kind: "read";
837
+ readonly name: "runner.inspect";
838
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
839
+ outcome: z.ZodLiteral<"success">;
840
+ value: z.ZodString;
841
+ }, z.core.$strip>, z.ZodObject<{
842
+ errorMessage: z.ZodOptional<z.ZodString>;
843
+ failureReason: z.ZodEnum<{
844
+ "runner-unreachable": "runner-unreachable";
845
+ "nothing-to-inspect": "nothing-to-inspect";
846
+ }>;
847
+ outcome: z.ZodLiteral<"failure">;
778
848
  }, z.core.$strip>], "outcome">;
779
849
  };
780
850
  launch: {
781
- 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.";
851
+ 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.";
782
852
  readonly input: z.ZodObject<{
783
853
  id: z.ZodString;
784
854
  runnerName: z.ZodOptional<z.ZodEnum<{
785
- node20Basic: "node20Basic";
786
- node20WithAndroid: "node20WithAndroid";
787
- node20WithIos: "node20WithIos";
788
- node20WithPlaywright: "node20WithPlaywright";
855
+ basic: "basic";
856
+ playwright: "playwright";
857
+ android: "android";
858
+ ios: "ios";
789
859
  }>>;
790
860
  }, z.core.$strip>;
791
861
  readonly kind: "write";
@@ -794,19 +864,17 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
794
864
  gpuAccelerated: z.ZodBoolean;
795
865
  id: z.ZodString;
796
866
  runnerName: z.ZodEnum<{
797
- node20Basic: "node20Basic";
798
- node20WithAndroid: "node20WithAndroid";
799
- node20WithIos: "node20WithIos";
800
- node20WithPlaywright: "node20WithPlaywright";
801
- }>;
802
- outcome: z.ZodEnum<{
803
- launched: "launched";
804
- "already-running": "already-running";
867
+ basic: "basic";
868
+ playwright: "playwright";
869
+ android: "android";
870
+ ios: "ios";
805
871
  }>;
872
+ alreadyRunning: z.ZodBoolean;
873
+ outcome: z.ZodLiteral<"success">;
806
874
  }, z.core.$strip>;
807
875
  };
808
876
  performAction: {
809
- 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.";
877
+ 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.";
810
878
  readonly input: z.ZodObject<{
811
879
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
812
880
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -848,19 +916,20 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
848
916
  readonly kind: "write";
849
917
  readonly name: "runner.performAction";
850
918
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
851
- outcome: z.ZodLiteral<"performed">;
852
- }, z.core.$strip>, z.ZodObject<{
919
+ outcome: z.ZodLiteral<"success">;
920
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
853
921
  errorMessage: z.ZodString;
854
- outcome: z.ZodLiteral<"action-failed">;
855
- }, z.core.$strip>, z.ZodObject<{
856
- outcome: z.ZodLiteral<"screen-needs-a-run">;
857
- }, z.core.$strip>, z.ZodObject<{
858
- outcome: z.ZodLiteral<"screen-not-ready">;
859
- }, z.core.$strip>, z.ZodObject<{
860
- outcome: z.ZodLiteral<"runner-has-no-screen">;
922
+ failureReason: z.ZodLiteral<"action-failed">;
923
+ outcome: z.ZodLiteral<"failure">;
861
924
  }, z.core.$strip>, z.ZodObject<{
862
- outcome: z.ZodLiteral<"runner-unreachable">;
863
- }, z.core.$strip>], "outcome">;
925
+ failureReason: z.ZodEnum<{
926
+ "runner-unreachable": "runner-unreachable";
927
+ "runner-has-no-screen": "runner-has-no-screen";
928
+ "screen-needs-a-run": "screen-needs-a-run";
929
+ "screen-not-ready": "screen-not-ready";
930
+ }>;
931
+ outcome: z.ZodLiteral<"failure">;
932
+ }, z.core.$strip>], "failureReason">], "outcome">;
864
933
  };
865
934
  readJournal: {
866
935
  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.";
@@ -886,59 +955,77 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
886
955
  hasUnsearchedHistory: z.ZodBoolean;
887
956
  nextSequence: z.ZodNumber;
888
957
  oldestAvailableSequence: z.ZodNumber;
889
- outcome: z.ZodLiteral<"read">;
958
+ outcome: z.ZodLiteral<"success">;
890
959
  }, z.core.$strip>, z.ZodObject<{
891
- outcome: z.ZodLiteral<"runner-unreachable">;
960
+ failureReason: z.ZodEnum<{
961
+ "runner-unreachable": "runner-unreachable";
962
+ }>;
963
+ outcome: z.ZodLiteral<"failure">;
892
964
  }, z.core.$strip>], "outcome">;
893
965
  };
894
966
  runFlow: {
895
- 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.";
967
+ 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.";
896
968
  readonly input: z.ZodObject<{
897
969
  entryPointPath: z.ZodString;
898
970
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
899
971
  files: z.ZodRecord<z.ZodString, z.ZodString>;
900
972
  id: z.ZodString;
973
+ selection: z.ZodOptional<z.ZodObject<{
974
+ endLine: z.ZodInt;
975
+ path: z.ZodString;
976
+ startLine: z.ZodInt;
977
+ }, z.core.$strip>>;
978
+ unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
901
979
  }, z.core.$strip>;
902
980
  readonly kind: "write";
903
981
  readonly name: "runner.runFlow";
904
982
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
905
- outcome: z.ZodLiteral<"submitted">;
983
+ bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
984
+ outcome: z.ZodLiteral<"success">;
906
985
  runId: z.ZodString;
907
- }, z.core.$strip>, z.ZodObject<{
908
- outcome: z.ZodLiteral<"runner-unreachable">;
909
- }, z.core.$strip>, z.ZodObject<{
910
- outcome: z.ZodLiteral<"runner-target-mismatch">;
986
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
987
+ failureReason: z.ZodLiteral<"runner-target-mismatch">;
988
+ outcome: z.ZodLiteral<"failure">;
911
989
  requiredRunnerName: z.ZodEnum<{
912
- node20Basic: "node20Basic";
913
- node20WithAndroid: "node20WithAndroid";
914
- node20WithIos: "node20WithIos";
915
- node20WithPlaywright: "node20WithPlaywright";
990
+ basic: "basic";
991
+ playwright: "playwright";
992
+ android: "android";
993
+ ios: "ios";
916
994
  }>;
917
995
  runnerName: z.ZodEnum<{
918
- node20Basic: "node20Basic";
919
- node20WithAndroid: "node20WithAndroid";
920
- node20WithIos: "node20WithIos";
921
- node20WithPlaywright: "node20WithPlaywright";
996
+ basic: "basic";
997
+ playwright: "playwright";
998
+ android: "android";
999
+ ios: "ios";
922
1000
  }>;
923
- }, z.core.$strip>], "outcome">;
1001
+ }, z.core.$strip>, z.ZodObject<{
1002
+ failureReason: z.ZodLiteral<"needs-full-sync">;
1003
+ missingPaths: z.ZodArray<z.ZodString>;
1004
+ outcome: z.ZodLiteral<"failure">;
1005
+ }, z.core.$strip>, z.ZodObject<{
1006
+ failureReason: z.ZodLiteral<"runner-unreachable">;
1007
+ outcome: z.ZodLiteral<"failure">;
1008
+ }, z.core.$strip>], "failureReason">], "outcome">;
924
1009
  };
925
- stop: {
926
- 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.";
1010
+ stopRun: {
1011
+ 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.";
927
1012
  readonly input: z.ZodObject<{
928
1013
  id: z.ZodString;
929
1014
  }, z.core.$strip>;
930
1015
  readonly kind: "write";
931
- readonly name: "runner.stop";
932
- readonly output: z.ZodObject<{
933
- id: z.ZodString;
934
- outcome: z.ZodEnum<{
935
- stopped: "stopped";
936
- "not-running": "not-running";
1016
+ readonly name: "runner.stopRun";
1017
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1018
+ outcome: z.ZodLiteral<"success">;
1019
+ wasRunning: z.ZodBoolean;
1020
+ }, z.core.$strip>, z.ZodObject<{
1021
+ failureReason: z.ZodEnum<{
1022
+ "runner-unreachable": "runner-unreachable";
937
1023
  }>;
938
- }, z.core.$strip>;
1024
+ outcome: z.ZodLiteral<"failure">;
1025
+ }, z.core.$strip>], "outcome">;
939
1026
  };
940
1027
  takeScreenshot: {
941
- readonly description: "Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. `screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `node20WithPlaywright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
1028
+ 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.";
942
1029
  readonly input: z.ZodObject<{
943
1030
  id: z.ZodString;
944
1031
  }, z.core.$strip>;
@@ -946,23 +1033,37 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
946
1033
  readonly name: "runner.takeScreenshot";
947
1034
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
948
1035
  imageJpegBase64: z.ZodString;
949
- outcome: z.ZodLiteral<"captured">;
950
- }, z.core.$strip>, z.ZodObject<{
951
- outcome: z.ZodLiteral<"screen-needs-a-run">;
1036
+ outcome: z.ZodLiteral<"success">;
952
1037
  }, z.core.$strip>, z.ZodObject<{
953
- outcome: z.ZodLiteral<"screen-not-ready">;
954
- }, z.core.$strip>, z.ZodObject<{
955
- outcome: z.ZodLiteral<"runner-has-no-screen">;
956
- }, z.core.$strip>, z.ZodObject<{
957
- outcome: z.ZodLiteral<"runner-unreachable">;
1038
+ failureReason: z.ZodEnum<{
1039
+ "runner-unreachable": "runner-unreachable";
1040
+ "runner-has-no-screen": "runner-has-no-screen";
1041
+ "screen-needs-a-run": "screen-needs-a-run";
1042
+ "screen-not-ready": "screen-not-ready";
1043
+ }>;
1044
+ outcome: z.ZodLiteral<"failure">;
958
1045
  }, z.core.$strip>], "outcome">;
959
1046
  };
1047
+ terminate: {
1048
+ 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.";
1049
+ readonly input: z.ZodObject<{
1050
+ id: z.ZodString;
1051
+ }, z.core.$strip>;
1052
+ readonly kind: "write";
1053
+ readonly name: "runner.terminate";
1054
+ readonly output: z.ZodObject<{
1055
+ id: z.ZodString;
1056
+ outcome: z.ZodLiteral<"success">;
1057
+ wasRunning: z.ZodBoolean;
1058
+ }, z.core.$strip>;
1059
+ };
960
1060
  };
961
1061
  tag: {
962
1062
  create: {
963
1063
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";
964
1064
  readonly input: z.ZodObject<{
965
1065
  name: z.ZodString;
1066
+ workspaceId: z.ZodOptional<WorkspaceId>;
966
1067
  }, z.core.$strip>;
967
1068
  readonly kind: "write";
968
1069
  readonly name: "tag.create";
@@ -979,6 +1080,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
979
1080
  limit: z.ZodDefault<z.ZodNumber>;
980
1081
  includeFlowIds: z.ZodDefault<z.ZodBoolean>;
981
1082
  names: z.ZodOptional<z.ZodArray<z.ZodString>>;
1083
+ workspaceId: z.ZodOptional<WorkspaceId>;
982
1084
  }, z.core.$strip>;
983
1085
  readonly kind: "read";
984
1086
  readonly name: "tag.list";
@@ -1068,6 +1170,7 @@ export declare const publicContractsV1: {
1068
1170
  static: "static";
1069
1171
  preview: "preview";
1070
1172
  }>>;
1173
+ workspaceId: z.ZodOptional<PublicIdSchema>;
1071
1174
  }, z.core.$strip>;
1072
1175
  readonly kind: "read";
1073
1176
  readonly name: "environment.find";
@@ -1104,7 +1207,7 @@ export declare const publicContractsV1: {
1104
1207
  }, z.core.$strip>;
1105
1208
  };
1106
1209
  get: {
1107
- readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
1210
+ readonly description: "Read a single environment's name, kind, standing run health, flow-code branch and reconciliation state, run concurrency limit, and termination state. If flowCodeBranch exists, use its syncStatus for Git reconciliation and read lastSyncedCommitHash only when syncStatus is reconciled.";
1108
1211
  readonly input: z.ZodObject<{
1109
1212
  environmentId: PublicIdSchema;
1110
1213
  }, z.core.$strip>;
@@ -1726,6 +1829,20 @@ export declare const publicContractsV1: {
1726
1829
  url: z.ZodURL;
1727
1830
  }, z.core.$strip>;
1728
1831
  };
1832
+ reattempt: {
1833
+ readonly description: string;
1834
+ readonly input: z.ZodObject<{
1835
+ flowIds: z.ZodOptional<z.ZodArray<PublicIdSchema>>;
1836
+ runId: PublicIdSchema;
1837
+ }, z.core.$strip>;
1838
+ readonly kind: "write";
1839
+ readonly name: "run.reattempt";
1840
+ readonly output: z.ZodObject<{
1841
+ reattemptedFlowIds: z.ZodArray<PublicIdSchema>;
1842
+ runId: PublicIdSchema;
1843
+ url: z.ZodURL;
1844
+ }, z.core.$strip>;
1845
+ };
1729
1846
  };
1730
1847
  runner: {
1731
1848
  evaluateSnippet: {
@@ -1740,25 +1857,78 @@ export declare const publicContractsV1: {
1740
1857
  readonly name: "runner.evaluateSnippet";
1741
1858
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1742
1859
  errorMessage: z.ZodOptional<z.ZodString>;
1743
- outcome: z.ZodLiteral<"evaluated">;
1860
+ outcome: z.ZodLiteral<"success">;
1744
1861
  result: z.ZodEnum<{
1745
1862
  success: "success";
1746
1863
  error: "error";
1747
1864
  stopped: "stopped";
1748
1865
  }>;
1749
1866
  }, z.core.$strip>, z.ZodObject<{
1750
- outcome: z.ZodLiteral<"runner-unreachable">;
1867
+ failureReason: z.ZodEnum<{
1868
+ "runner-unreachable": "runner-unreachable";
1869
+ }>;
1870
+ outcome: z.ZodLiteral<"failure">;
1871
+ }, z.core.$strip>], "outcome">;
1872
+ };
1873
+ importPackage: {
1874
+ 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.";
1875
+ readonly input: z.ZodObject<{
1876
+ id: z.ZodString;
1877
+ npmDependencies: z.ZodRecord<z.ZodString, z.ZodString>;
1878
+ packageName: z.ZodString;
1879
+ packageVersion: z.ZodString;
1880
+ }, z.core.$strip>;
1881
+ readonly kind: "write";
1882
+ readonly name: "runner.importPackage";
1883
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1884
+ outcome: z.ZodLiteral<"success">;
1885
+ }, z.core.$strip>, z.ZodObject<{
1886
+ errorMessage: z.ZodOptional<z.ZodString>;
1887
+ failureReason: z.ZodEnum<{
1888
+ "runner-unreachable": "runner-unreachable";
1889
+ "install-failed": "install-failed";
1890
+ }>;
1891
+ outcome: z.ZodLiteral<"failure">;
1892
+ }, z.core.$strip>], "outcome">;
1893
+ };
1894
+ inspect: {
1895
+ readonly description: string;
1896
+ readonly input: z.ZodObject<{
1897
+ id: z.ZodString;
1898
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
1899
+ selector: z.ZodString;
1900
+ what: z.ZodLiteral<"element-html">;
1901
+ }, z.core.$strip>, z.ZodObject<{
1902
+ selector: z.ZodOptional<z.ZodString>;
1903
+ what: z.ZodLiteral<"page-html">;
1904
+ }, z.core.$strip>, z.ZodObject<{
1905
+ variableName: z.ZodString;
1906
+ what: z.ZodLiteral<"variable">;
1907
+ }, z.core.$strip>], "what">;
1908
+ }, z.core.$strip>;
1909
+ readonly kind: "read";
1910
+ readonly name: "runner.inspect";
1911
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1912
+ outcome: z.ZodLiteral<"success">;
1913
+ value: z.ZodString;
1914
+ }, z.core.$strip>, z.ZodObject<{
1915
+ errorMessage: z.ZodOptional<z.ZodString>;
1916
+ failureReason: z.ZodEnum<{
1917
+ "runner-unreachable": "runner-unreachable";
1918
+ "nothing-to-inspect": "nothing-to-inspect";
1919
+ }>;
1920
+ outcome: z.ZodLiteral<"failure">;
1751
1921
  }, z.core.$strip>], "outcome">;
1752
1922
  };
1753
1923
  launch: {
1754
- 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.";
1924
+ 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.";
1755
1925
  readonly input: z.ZodObject<{
1756
1926
  id: z.ZodString;
1757
1927
  runnerName: z.ZodOptional<z.ZodEnum<{
1758
- node20Basic: "node20Basic";
1759
- node20WithAndroid: "node20WithAndroid";
1760
- node20WithIos: "node20WithIos";
1761
- node20WithPlaywright: "node20WithPlaywright";
1928
+ basic: "basic";
1929
+ playwright: "playwright";
1930
+ android: "android";
1931
+ ios: "ios";
1762
1932
  }>>;
1763
1933
  }, z.core.$strip>;
1764
1934
  readonly kind: "write";
@@ -1767,19 +1937,17 @@ export declare const publicContractsV1: {
1767
1937
  gpuAccelerated: z.ZodBoolean;
1768
1938
  id: z.ZodString;
1769
1939
  runnerName: z.ZodEnum<{
1770
- node20Basic: "node20Basic";
1771
- node20WithAndroid: "node20WithAndroid";
1772
- node20WithIos: "node20WithIos";
1773
- node20WithPlaywright: "node20WithPlaywright";
1774
- }>;
1775
- outcome: z.ZodEnum<{
1776
- launched: "launched";
1777
- "already-running": "already-running";
1940
+ basic: "basic";
1941
+ playwright: "playwright";
1942
+ android: "android";
1943
+ ios: "ios";
1778
1944
  }>;
1945
+ alreadyRunning: z.ZodBoolean;
1946
+ outcome: z.ZodLiteral<"success">;
1779
1947
  }, z.core.$strip>;
1780
1948
  };
1781
1949
  performAction: {
1782
- 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.";
1950
+ 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.";
1783
1951
  readonly input: z.ZodObject<{
1784
1952
  action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1785
1953
  button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
@@ -1821,19 +1989,20 @@ export declare const publicContractsV1: {
1821
1989
  readonly kind: "write";
1822
1990
  readonly name: "runner.performAction";
1823
1991
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1824
- outcome: z.ZodLiteral<"performed">;
1825
- }, z.core.$strip>, z.ZodObject<{
1992
+ outcome: z.ZodLiteral<"success">;
1993
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1826
1994
  errorMessage: z.ZodString;
1827
- outcome: z.ZodLiteral<"action-failed">;
1828
- }, z.core.$strip>, z.ZodObject<{
1829
- outcome: z.ZodLiteral<"screen-needs-a-run">;
1830
- }, z.core.$strip>, z.ZodObject<{
1831
- outcome: z.ZodLiteral<"screen-not-ready">;
1832
- }, z.core.$strip>, z.ZodObject<{
1833
- outcome: z.ZodLiteral<"runner-has-no-screen">;
1995
+ failureReason: z.ZodLiteral<"action-failed">;
1996
+ outcome: z.ZodLiteral<"failure">;
1834
1997
  }, z.core.$strip>, z.ZodObject<{
1835
- outcome: z.ZodLiteral<"runner-unreachable">;
1836
- }, z.core.$strip>], "outcome">;
1998
+ failureReason: z.ZodEnum<{
1999
+ "runner-unreachable": "runner-unreachable";
2000
+ "runner-has-no-screen": "runner-has-no-screen";
2001
+ "screen-needs-a-run": "screen-needs-a-run";
2002
+ "screen-not-ready": "screen-not-ready";
2003
+ }>;
2004
+ outcome: z.ZodLiteral<"failure">;
2005
+ }, z.core.$strip>], "failureReason">], "outcome">;
1837
2006
  };
1838
2007
  readJournal: {
1839
2008
  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.";
@@ -1859,59 +2028,77 @@ export declare const publicContractsV1: {
1859
2028
  hasUnsearchedHistory: z.ZodBoolean;
1860
2029
  nextSequence: z.ZodNumber;
1861
2030
  oldestAvailableSequence: z.ZodNumber;
1862
- outcome: z.ZodLiteral<"read">;
2031
+ outcome: z.ZodLiteral<"success">;
1863
2032
  }, z.core.$strip>, z.ZodObject<{
1864
- outcome: z.ZodLiteral<"runner-unreachable">;
2033
+ failureReason: z.ZodEnum<{
2034
+ "runner-unreachable": "runner-unreachable";
2035
+ }>;
2036
+ outcome: z.ZodLiteral<"failure">;
1865
2037
  }, z.core.$strip>], "outcome">;
1866
2038
  };
1867
2039
  runFlow: {
1868
- 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.";
2040
+ 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.";
1869
2041
  readonly input: z.ZodObject<{
1870
2042
  entryPointPath: z.ZodString;
1871
2043
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1872
2044
  files: z.ZodRecord<z.ZodString, z.ZodString>;
1873
2045
  id: z.ZodString;
2046
+ selection: z.ZodOptional<z.ZodObject<{
2047
+ endLine: z.ZodInt;
2048
+ path: z.ZodString;
2049
+ startLine: z.ZodInt;
2050
+ }, z.core.$strip>>;
2051
+ unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1874
2052
  }, z.core.$strip>;
1875
2053
  readonly kind: "write";
1876
2054
  readonly name: "runner.runFlow";
1877
2055
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1878
- outcome: z.ZodLiteral<"submitted">;
2056
+ bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
2057
+ outcome: z.ZodLiteral<"success">;
1879
2058
  runId: z.ZodString;
1880
- }, z.core.$strip>, z.ZodObject<{
1881
- outcome: z.ZodLiteral<"runner-unreachable">;
1882
- }, z.core.$strip>, z.ZodObject<{
1883
- outcome: z.ZodLiteral<"runner-target-mismatch">;
2059
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
2060
+ failureReason: z.ZodLiteral<"runner-target-mismatch">;
2061
+ outcome: z.ZodLiteral<"failure">;
1884
2062
  requiredRunnerName: z.ZodEnum<{
1885
- node20Basic: "node20Basic";
1886
- node20WithAndroid: "node20WithAndroid";
1887
- node20WithIos: "node20WithIos";
1888
- node20WithPlaywright: "node20WithPlaywright";
2063
+ basic: "basic";
2064
+ playwright: "playwright";
2065
+ android: "android";
2066
+ ios: "ios";
1889
2067
  }>;
1890
2068
  runnerName: z.ZodEnum<{
1891
- node20Basic: "node20Basic";
1892
- node20WithAndroid: "node20WithAndroid";
1893
- node20WithIos: "node20WithIos";
1894
- node20WithPlaywright: "node20WithPlaywright";
2069
+ basic: "basic";
2070
+ playwright: "playwright";
2071
+ android: "android";
2072
+ ios: "ios";
1895
2073
  }>;
1896
- }, z.core.$strip>], "outcome">;
2074
+ }, z.core.$strip>, z.ZodObject<{
2075
+ failureReason: z.ZodLiteral<"needs-full-sync">;
2076
+ missingPaths: z.ZodArray<z.ZodString>;
2077
+ outcome: z.ZodLiteral<"failure">;
2078
+ }, z.core.$strip>, z.ZodObject<{
2079
+ failureReason: z.ZodLiteral<"runner-unreachable">;
2080
+ outcome: z.ZodLiteral<"failure">;
2081
+ }, z.core.$strip>], "failureReason">], "outcome">;
1897
2082
  };
1898
- stop: {
1899
- 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.";
2083
+ stopRun: {
2084
+ 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.";
1900
2085
  readonly input: z.ZodObject<{
1901
2086
  id: z.ZodString;
1902
2087
  }, z.core.$strip>;
1903
2088
  readonly kind: "write";
1904
- readonly name: "runner.stop";
1905
- readonly output: z.ZodObject<{
1906
- id: z.ZodString;
1907
- outcome: z.ZodEnum<{
1908
- stopped: "stopped";
1909
- "not-running": "not-running";
2089
+ readonly name: "runner.stopRun";
2090
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
2091
+ outcome: z.ZodLiteral<"success">;
2092
+ wasRunning: z.ZodBoolean;
2093
+ }, z.core.$strip>, z.ZodObject<{
2094
+ failureReason: z.ZodEnum<{
2095
+ "runner-unreachable": "runner-unreachable";
1910
2096
  }>;
1911
- }, z.core.$strip>;
2097
+ outcome: z.ZodLiteral<"failure">;
2098
+ }, z.core.$strip>], "outcome">;
1912
2099
  };
1913
2100
  takeScreenshot: {
1914
- readonly description: "Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. `screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `node20WithPlaywright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
2101
+ 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.";
1915
2102
  readonly input: z.ZodObject<{
1916
2103
  id: z.ZodString;
1917
2104
  }, z.core.$strip>;
@@ -1919,23 +2106,37 @@ export declare const publicContractsV1: {
1919
2106
  readonly name: "runner.takeScreenshot";
1920
2107
  readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1921
2108
  imageJpegBase64: z.ZodString;
1922
- outcome: z.ZodLiteral<"captured">;
1923
- }, z.core.$strip>, z.ZodObject<{
1924
- outcome: z.ZodLiteral<"screen-needs-a-run">;
2109
+ outcome: z.ZodLiteral<"success">;
1925
2110
  }, z.core.$strip>, z.ZodObject<{
1926
- outcome: z.ZodLiteral<"screen-not-ready">;
1927
- }, z.core.$strip>, z.ZodObject<{
1928
- outcome: z.ZodLiteral<"runner-has-no-screen">;
1929
- }, z.core.$strip>, z.ZodObject<{
1930
- outcome: z.ZodLiteral<"runner-unreachable">;
2111
+ failureReason: z.ZodEnum<{
2112
+ "runner-unreachable": "runner-unreachable";
2113
+ "runner-has-no-screen": "runner-has-no-screen";
2114
+ "screen-needs-a-run": "screen-needs-a-run";
2115
+ "screen-not-ready": "screen-not-ready";
2116
+ }>;
2117
+ outcome: z.ZodLiteral<"failure">;
1931
2118
  }, z.core.$strip>], "outcome">;
1932
2119
  };
2120
+ terminate: {
2121
+ 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.";
2122
+ readonly input: z.ZodObject<{
2123
+ id: z.ZodString;
2124
+ }, z.core.$strip>;
2125
+ readonly kind: "write";
2126
+ readonly name: "runner.terminate";
2127
+ readonly output: z.ZodObject<{
2128
+ id: z.ZodString;
2129
+ outcome: z.ZodLiteral<"success">;
2130
+ wasRunning: z.ZodBoolean;
2131
+ }, z.core.$strip>;
2132
+ };
1933
2133
  };
1934
2134
  tag: {
1935
2135
  create: {
1936
2136
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";
1937
2137
  readonly input: z.ZodObject<{
1938
2138
  name: z.ZodString;
2139
+ workspaceId: z.ZodOptional<PublicIdSchema>;
1939
2140
  }, z.core.$strip>;
1940
2141
  readonly kind: "write";
1941
2142
  readonly name: "tag.create";
@@ -1952,6 +2153,7 @@ export declare const publicContractsV1: {
1952
2153
  limit: z.ZodDefault<z.ZodNumber>;
1953
2154
  includeFlowIds: z.ZodDefault<z.ZodBoolean>;
1954
2155
  names: z.ZodOptional<z.ZodArray<z.ZodString>>;
2156
+ workspaceId: z.ZodOptional<PublicIdSchema>;
1955
2157
  }, z.core.$strip>;
1956
2158
  readonly kind: "read";
1957
2159
  readonly name: "tag.list";