@qawolf/api-contracts 0.20.0 → 0.24.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 (110) hide show
  1. package/dist/v1/automate/index.d.ts +1 -1
  2. package/dist/v1/automate/index.d.ts.map +1 -1
  3. package/dist/v1/automate/index.js +3 -3
  4. package/dist/v1/automate/index.js.map +1 -1
  5. package/dist/v1/environment/find.d.ts +1 -0
  6. package/dist/v1/environment/find.d.ts.map +1 -1
  7. package/dist/v1/environment/getVariable.d.ts +19 -0
  8. package/dist/v1/environment/getVariable.d.ts.map +1 -0
  9. package/dist/v1/environment/getVariable.js +34 -0
  10. package/dist/v1/environment/getVariable.js.map +1 -0
  11. package/dist/v1/environment/index.d.ts +3 -1
  12. package/dist/v1/environment/index.d.ts.map +1 -1
  13. package/dist/v1/environment/index.js +1 -1
  14. package/dist/v1/environment/index.js.map +1 -1
  15. package/dist/v1/environment/resource.d.ts +1 -0
  16. package/dist/v1/environment/resource.d.ts.map +1 -1
  17. package/dist/v1/environment/resource.js +3 -0
  18. package/dist/v1/environment/resource.js.map +1 -1
  19. package/dist/v1/environment/update.d.ts +39 -0
  20. package/dist/v1/environment/update.d.ts.map +1 -0
  21. package/dist/v1/environment/update.js +38 -0
  22. package/dist/v1/environment/update.js.map +1 -0
  23. package/dist/v1/flow/index.d.ts +4 -0
  24. package/dist/v1/flow/index.d.ts.map +1 -1
  25. package/dist/v1/flow/index.js +2 -0
  26. package/dist/v1/flow/index.js.map +1 -1
  27. package/dist/v1/flow/readiness.d.ts +12 -0
  28. package/dist/v1/flow/readiness.d.ts.map +1 -0
  29. package/dist/v1/flow/readiness.js +12 -0
  30. package/dist/v1/flow/readiness.js.map +1 -0
  31. package/dist/v1/flow/update.d.ts +28 -0
  32. package/dist/v1/flow/update.d.ts.map +1 -0
  33. package/dist/v1/flow/update.js +26 -0
  34. package/dist/v1/flow/update.js.map +1 -0
  35. package/dist/v1/ids.d.ts +3 -2
  36. package/dist/v1/ids.d.ts.map +1 -1
  37. package/dist/v1/ids.js +1 -0
  38. package/dist/v1/ids.js.map +1 -1
  39. package/dist/v1/index.d.ts +588 -7
  40. package/dist/v1/index.d.ts.map +1 -1
  41. package/dist/v1/index.js +37 -0
  42. package/dist/v1/index.js.map +1 -1
  43. package/dist/v1/run/get.d.ts +1 -1
  44. package/dist/v1/run/get.d.ts.map +1 -1
  45. package/dist/v1/run/get.js +3 -0
  46. package/dist/v1/run/get.js.map +1 -1
  47. package/dist/v1/run/index.d.ts +3 -1
  48. package/dist/v1/run/index.d.ts.map +1 -1
  49. package/dist/v1/run/index.js +3 -0
  50. package/dist/v1/run/index.js.map +1 -1
  51. package/dist/v1/run/summary.d.ts.map +1 -1
  52. package/dist/v1/run/summary.js +3 -0
  53. package/dist/v1/run/summary.js.map +1 -1
  54. package/dist/v1/runner/browserAction.d.ts +39 -0
  55. package/dist/v1/runner/browserAction.d.ts.map +1 -0
  56. package/dist/v1/runner/browserAction.js +82 -0
  57. package/dist/v1/runner/browserAction.js.map +1 -0
  58. package/dist/v1/runner/environment.d.ts +4 -0
  59. package/dist/v1/runner/environment.d.ts.map +1 -0
  60. package/dist/v1/runner/environment.js +46 -0
  61. package/dist/v1/runner/environment.js.map +1 -0
  62. package/dist/v1/runner/evaluateSnippet.d.ts +24 -0
  63. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -0
  64. package/dist/v1/runner/evaluateSnippet.js +54 -0
  65. package/dist/v1/runner/evaluateSnippet.js.map +1 -0
  66. package/dist/v1/runner/files.d.ts +26 -0
  67. package/dist/v1/runner/files.d.ts.map +1 -0
  68. package/dist/v1/runner/files.js +65 -0
  69. package/dist/v1/runner/files.js.map +1 -0
  70. package/dist/v1/runner/identity.d.ts +21 -0
  71. package/dist/v1/runner/identity.d.ts.map +1 -0
  72. package/dist/v1/runner/identity.js +21 -0
  73. package/dist/v1/runner/identity.js.map +1 -0
  74. package/dist/v1/runner/index.d.ts +45 -0
  75. package/dist/v1/runner/index.d.ts.map +1 -0
  76. package/dist/v1/runner/index.js +41 -0
  77. package/dist/v1/runner/index.js.map +1 -0
  78. package/dist/v1/runner/journal.d.ts +104 -0
  79. package/dist/v1/runner/journal.d.ts.map +1 -0
  80. package/dist/v1/runner/journal.js +52 -0
  81. package/dist/v1/runner/journal.js.map +1 -0
  82. package/dist/v1/runner/payloadSize.d.ts +27 -0
  83. package/dist/v1/runner/payloadSize.d.ts.map +1 -0
  84. package/dist/v1/runner/payloadSize.js +49 -0
  85. package/dist/v1/runner/payloadSize.js.map +1 -0
  86. package/dist/v1/runner/performAction.d.ts +61 -0
  87. package/dist/v1/runner/performAction.d.ts.map +1 -0
  88. package/dist/v1/runner/performAction.js +38 -0
  89. package/dist/v1/runner/performAction.js.map +1 -0
  90. package/dist/v1/runner/readJournal.d.ts +31 -0
  91. package/dist/v1/runner/readJournal.d.ts.map +1 -0
  92. package/dist/v1/runner/readJournal.js +22 -0
  93. package/dist/v1/runner/readJournal.js.map +1 -0
  94. package/dist/v1/runner/runFlow.d.ts +33 -0
  95. package/dist/v1/runner/runFlow.d.ts.map +1 -0
  96. package/dist/v1/runner/runFlow.js +48 -0
  97. package/dist/v1/runner/runFlow.js.map +1 -0
  98. package/dist/v1/runner/screen.d.ts +14 -0
  99. package/dist/v1/runner/screen.d.ts.map +1 -0
  100. package/dist/v1/runner/screen.js +16 -0
  101. package/dist/v1/runner/screen.js.map +1 -0
  102. package/dist/v1/runner/takeScreenshot.d.ts +22 -0
  103. package/dist/v1/runner/takeScreenshot.d.ts.map +1 -0
  104. package/dist/v1/runner/takeScreenshot.js +34 -0
  105. package/dist/v1/runner/takeScreenshot.js.map +1 -0
  106. package/dist/v1/runner/unreachable.d.ts +16 -0
  107. package/dist/v1/runner/unreachable.d.ts.map +1 -0
  108. package/dist/v1/runner/unreachable.js +16 -0
  109. package/dist/v1/runner/unreachable.js.map +1 -0
  110. package/package.json +6 -6
@@ -3,6 +3,13 @@ export type { AnyPublicApiContract, PublicApiContract, PublicApiContractKind, }
3
3
  export { type IdentityResponse, identityResponse } from "./identity/index.js";
4
4
  export { type PublicIdSchema, type PublicIdSchemas, defaultIdSchemas, } from "./ids.js";
5
5
  export { makeFlowSelectionSchema } from "./run/index.js";
6
+ export { type BrowserAction, browserActionSchema, } from "./runner/browserAction.js";
7
+ export { runEnvironmentSchema } from "./runner/environment.js";
8
+ export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
9
+ export { type RunnerNameForPublicApi, makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
10
+ export { type JournalEntry, type JournalStream, type KnownJournalStream, type ReadJournalRequest, type ReadJournalResponse, journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
11
+ export { type RunFiles, maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
12
+ export { maxActionErrorMessageLength } from "./runner/performAction.js";
6
13
  import type { AnyPublicApiContract } from "./definition.js";
7
14
  import { type PublicIdSchema, type PublicIdSchemasOf } from "./ids.js";
8
15
  export type PublicApiInput<Api extends AnyPublicApiContract> = z.input<Api["input"]>;
@@ -14,9 +21,9 @@ export type PublicApiOutput<Api extends AnyPublicApiContract> = z.infer<Api["out
14
21
  * the same factory with its own strict id schemas, so the contract shape can
15
22
  * never drift between the two while validation strictness stays server-owned.
16
23
  */
17
- export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, AutomationId extends PublicIdSchema = PublicIdSchema, IssueId extends PublicIdSchema = PublicIdSchema, WorkspaceId extends PublicIdSchema = PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId, AutomationId, IssueId, WorkspaceId>) => {
24
+ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema, AutomationId extends PublicIdSchema = PublicIdSchema, IssueId extends PublicIdSchema = PublicIdSchema, WorkspaceId extends PublicIdSchema = PublicIdSchema, AiTaskId extends PublicIdSchema = PublicIdSchema>(ids: PublicIdSchemasOf<EnvironmentId, FlowId, RunId, AutomationId, IssueId, WorkspaceId, AiTaskId>) => {
18
25
  automate: {
19
- readonly description: "Request an automation that builds the selected draft flows in an environment.";
26
+ readonly description: "Request automation for draft flows. First create a named local .flow.ts draft for every requested journey that does not already have a matching draft; never reuse a generic starter or placeholder. Each new draft must start with a JSDoc Goal: description, import flow from @qawolf/flows/web, and use export default flow(...); a comment-only file or direct test(...) call is not a valid draft. Commit and push all changes with Git to publish them, then list remote drafts to resolve every selected ID. Do not use patch to create or rename a selected flow. Finally make one automation request containing all requested flow IDs.";
20
27
  readonly input: z.ZodObject<{
21
28
  environmentId: PublicIdSchema;
22
29
  flowIds: z.ZodArray<FlowId>;
@@ -54,6 +61,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
54
61
  preview: "preview";
55
62
  }>;
56
63
  name: z.ZodString;
64
+ runConcurrencyLimit: z.ZodString;
57
65
  status: z.ZodEnum<{
58
66
  blocked: "blocked";
59
67
  "needs-investigation": "needs-investigation";
@@ -106,6 +114,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
106
114
  preview: "preview";
107
115
  }>;
108
116
  name: z.ZodString;
117
+ runConcurrencyLimit: z.ZodString;
109
118
  status: z.ZodEnum<{
110
119
  blocked: "blocked";
111
120
  "needs-investigation": "needs-investigation";
@@ -119,7 +128,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
119
128
  }, z.core.$strip>;
120
129
  };
121
130
  get: {
122
- readonly description: "Read a single environment's name, kind, health status, and termination state.";
131
+ readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
123
132
  readonly input: z.ZodObject<{
124
133
  environmentId: PublicIdSchema;
125
134
  }, z.core.$strip>;
@@ -141,6 +150,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
141
150
  preview: "preview";
142
151
  }>;
143
152
  name: z.ZodString;
153
+ runConcurrencyLimit: z.ZodString;
144
154
  status: z.ZodEnum<{
145
155
  blocked: "blocked";
146
156
  "needs-investigation": "needs-investigation";
@@ -151,6 +161,22 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
151
161
  url: z.ZodURL;
152
162
  }, z.core.$strip>;
153
163
  };
164
+ getVariable: {
165
+ readonly description: "Read the values of named environment variables in one call. Values are secrets. Names that do not exist go to missingNames and do not fail the call.";
166
+ readonly input: z.ZodObject<{
167
+ environmentId: PublicIdSchema;
168
+ variableNames: z.ZodArray<z.ZodString>;
169
+ }, z.core.$strip>;
170
+ readonly kind: "read";
171
+ readonly name: "environment.getVariable";
172
+ readonly output: z.ZodObject<{
173
+ missingNames: z.ZodArray<z.ZodString>;
174
+ variables: z.ZodArray<z.ZodObject<{
175
+ name: z.ZodString;
176
+ value: z.ZodString;
177
+ }, z.core.$strip>>;
178
+ }, z.core.$strip>;
179
+ };
154
180
  listVariableNames: {
155
181
  readonly description: "Use this to answer which QA Wolf environment variables are available to test code. Returns names only; values never leave the server.";
156
182
  readonly input: z.ZodObject<{
@@ -175,6 +201,42 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
175
201
  name: z.ZodString;
176
202
  }, z.core.$strip>;
177
203
  };
204
+ update: {
205
+ readonly description: "Update an environment owned by the caller's team and return it in the environment.get shape. Omitted fields remain unchanged.";
206
+ readonly input: z.ZodObject<{
207
+ environmentId: PublicIdSchema;
208
+ name: z.ZodOptional<z.ZodString>;
209
+ runConcurrencyLimit: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>;
211
+ readonly kind: "write";
212
+ readonly name: "environment.update";
213
+ readonly output: z.ZodObject<{
214
+ alias: z.ZodOptional<z.ZodString>;
215
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
216
+ lastSyncedCommitHash: z.ZodString;
217
+ name: z.ZodString;
218
+ syncStatus: z.ZodLiteral<"reconciled">;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ name: z.ZodString;
221
+ syncStatus: z.ZodLiteral<"not-reconciled">;
222
+ }, z.core.$strip>], "syncStatus">>;
223
+ id: EnvironmentId;
224
+ kind: z.ZodEnum<{
225
+ static: "static";
226
+ preview: "preview";
227
+ }>;
228
+ name: z.ZodString;
229
+ runConcurrencyLimit: z.ZodString;
230
+ status: z.ZodEnum<{
231
+ blocked: "blocked";
232
+ "needs-investigation": "needs-investigation";
233
+ ready: "ready";
234
+ running: "running";
235
+ }>;
236
+ terminatedAt: z.ZodOptional<z.ZodISODateTime>;
237
+ url: z.ZodURL;
238
+ }, z.core.$strip>;
239
+ };
178
240
  };
179
241
  flow: {
180
242
  addTag: {
@@ -205,11 +267,38 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
205
267
  flowId: FlowId;
206
268
  name: z.ZodString;
207
269
  path: z.ZodString;
270
+ readiness: z.ZodEnum<{
271
+ draft: "draft";
272
+ active: "active";
273
+ }>;
208
274
  tags: z.ZodArray<z.ZodString>;
209
275
  url: z.ZodURL;
210
276
  }, z.core.$strip>>;
211
277
  }, z.core.$strip>;
212
278
  };
279
+ update: {
280
+ readonly description: "Move a flow between draft and active readiness. The other statuses shown in the app are derived and cannot be set.";
281
+ readonly input: z.ZodObject<{
282
+ flowId: FlowId;
283
+ readiness: z.ZodEnum<{
284
+ draft: "draft";
285
+ active: "active";
286
+ }>;
287
+ }, z.core.$strip>;
288
+ readonly kind: "write";
289
+ readonly name: "flow.update";
290
+ readonly output: z.ZodObject<{
291
+ flow: z.ZodObject<{
292
+ flowId: FlowId;
293
+ name: z.ZodString;
294
+ readiness: z.ZodEnum<{
295
+ draft: "draft";
296
+ active: "active";
297
+ }>;
298
+ url: z.ZodURL;
299
+ }, z.core.$strip>;
300
+ }, z.core.$strip>;
301
+ };
213
302
  };
214
303
  issue: {
215
304
  create: {
@@ -453,6 +542,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
453
542
  create: {
454
543
  readonly description: "Create a run for the selected flows and/or tags in an environment.";
455
544
  readonly input: z.ZodIntersection<z.ZodObject<{
545
+ aiTaskId: z.ZodOptional<AiTaskId>;
456
546
  environmentId: PublicIdSchema;
457
547
  environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
458
548
  ignoreRules: z.ZodDefault<z.ZodBoolean>;
@@ -527,6 +617,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
527
617
  passed: "passed";
528
618
  }>;
529
619
  }, z.core.$strip>], "status">>;
620
+ runId: RunId;
530
621
  completedAt: z.ZodOptional<z.ZodISODateTime>;
531
622
  createdAt: z.ZodISODateTime;
532
623
  git: z.ZodObject<{
@@ -535,7 +626,6 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
535
626
  commitSha: z.ZodOptional<z.ZodString>;
536
627
  commitUrl: z.ZodOptional<z.ZodString>;
537
628
  }, z.core.$strip>;
538
- runId: RunId;
539
629
  status: z.ZodEnum<{
540
630
  running: "running";
541
631
  canceled: "canceled";
@@ -547,6 +637,210 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
547
637
  }, z.core.$strip>;
548
638
  };
549
639
  };
640
+ runner: {
641
+ evaluateSnippet: {
642
+ readonly description: "Evaluate a snippet against whatever the runner's browser is showing right now. Answers whether the snippet ran, and its error if it threw — not the value it evaluated to, so read anything you want back out of the runner's journal (a snippet's `console.log` lands in the `console` stream). A snippet starts no run and leaves no run-scoped journal entries of its own. `runner-unreachable` if the runner could not be reached or could not evaluate: as well as a runner that is still starting, has terminated after inactivity, or is busy, this covers a runner with no live page to evaluate against — which will never clear, so check that the runner you launched is one that runs a browser before retrying. It is NOT proof the snippet did not run: a snippet that outlives the answer window is still executing when you read this, so do not blindly resubmit one that mutates what the page is looking at.";
643
+ readonly input: z.ZodObject<{
644
+ code: z.ZodString;
645
+ filePath: z.ZodOptional<z.ZodString>;
646
+ files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
647
+ id: z.ZodString;
648
+ }, z.core.$strip>;
649
+ readonly kind: "write";
650
+ readonly name: "runner.evaluateSnippet";
651
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
652
+ errorMessage: z.ZodOptional<z.ZodString>;
653
+ outcome: z.ZodLiteral<"evaluated">;
654
+ result: z.ZodEnum<{
655
+ success: "success";
656
+ error: "error";
657
+ stopped: "stopped";
658
+ }>;
659
+ }, z.core.$strip>, z.ZodObject<{
660
+ outcome: z.ZodLiteral<"runner-unreachable">;
661
+ }, z.core.$strip>], "outcome">;
662
+ };
663
+ launch: {
664
+ 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.";
665
+ readonly input: z.ZodObject<{
666
+ id: z.ZodString;
667
+ runnerName: z.ZodOptional<z.ZodEnum<{
668
+ node20Basic: "node20Basic";
669
+ node20WithAndroid: "node20WithAndroid";
670
+ node20WithIos: "node20WithIos";
671
+ node20WithPlaywright: "node20WithPlaywright";
672
+ }>>;
673
+ }, z.core.$strip>;
674
+ readonly kind: "write";
675
+ readonly name: "runner.launch";
676
+ readonly output: z.ZodObject<{
677
+ gpuAccelerated: z.ZodBoolean;
678
+ id: z.ZodString;
679
+ runnerName: z.ZodEnum<{
680
+ node20Basic: "node20Basic";
681
+ node20WithAndroid: "node20WithAndroid";
682
+ node20WithIos: "node20WithIos";
683
+ node20WithPlaywright: "node20WithPlaywright";
684
+ }>;
685
+ outcome: z.ZodEnum<{
686
+ launched: "launched";
687
+ "already-running": "already-running";
688
+ }>;
689
+ }, z.core.$strip>;
690
+ };
691
+ performAction: {
692
+ 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.";
693
+ readonly input: z.ZodObject<{
694
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
695
+ button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
696
+ type: z.ZodLiteral<"click">;
697
+ x: z.ZodInt;
698
+ y: z.ZodInt;
699
+ }, z.core.$strict>, z.ZodObject<{
700
+ type: z.ZodLiteral<"double_click">;
701
+ x: z.ZodInt;
702
+ y: z.ZodInt;
703
+ }, z.core.$strict>, z.ZodObject<{
704
+ scroll_x: z.ZodInt;
705
+ scroll_y: z.ZodInt;
706
+ type: z.ZodLiteral<"scroll">;
707
+ x: z.ZodInt;
708
+ y: z.ZodInt;
709
+ }, z.core.$strict>, z.ZodObject<{
710
+ type: z.ZodLiteral<"move">;
711
+ x: z.ZodInt;
712
+ y: z.ZodInt;
713
+ }, z.core.$strict>, z.ZodObject<{
714
+ path: z.ZodArray<z.ZodObject<{
715
+ x: z.ZodInt;
716
+ y: z.ZodInt;
717
+ }, z.core.$strict>>;
718
+ type: z.ZodLiteral<"drag">;
719
+ }, z.core.$strict>, z.ZodObject<{
720
+ keys: z.ZodArray<z.ZodString>;
721
+ type: z.ZodLiteral<"keypress">;
722
+ }, z.core.$strict>, z.ZodObject<{
723
+ type: z.ZodLiteral<"navigate">;
724
+ url: z.ZodURL;
725
+ }, z.core.$strict>, z.ZodObject<{
726
+ text: z.ZodString;
727
+ type: z.ZodLiteral<"type">;
728
+ }, z.core.$strict>], "type">;
729
+ id: z.ZodString;
730
+ }, z.core.$strip>;
731
+ readonly kind: "write";
732
+ readonly name: "runner.performAction";
733
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
734
+ outcome: z.ZodLiteral<"performed">;
735
+ }, z.core.$strip>, z.ZodObject<{
736
+ errorMessage: z.ZodString;
737
+ outcome: z.ZodLiteral<"action-failed">;
738
+ }, z.core.$strip>, z.ZodObject<{
739
+ outcome: z.ZodLiteral<"screen-needs-a-run">;
740
+ }, z.core.$strip>, z.ZodObject<{
741
+ outcome: z.ZodLiteral<"screen-not-ready">;
742
+ }, z.core.$strip>, z.ZodObject<{
743
+ outcome: z.ZodLiteral<"runner-has-no-screen">;
744
+ }, z.core.$strip>, z.ZodObject<{
745
+ outcome: z.ZodLiteral<"runner-unreachable">;
746
+ }, z.core.$strip>], "outcome">;
747
+ };
748
+ readJournal: {
749
+ 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.";
750
+ readonly input: z.ZodObject<{
751
+ runId: z.ZodOptional<z.ZodString>;
752
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
753
+ tail: z.ZodOptional<z.ZodNumber>;
754
+ id: z.ZodString;
755
+ stream: z.ZodString;
756
+ }, z.core.$strip>;
757
+ readonly kind: "read";
758
+ readonly name: "runner.readJournal";
759
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
760
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
761
+ payload: z.ZodUnknown;
762
+ recordedAt: z.ZodISODateTime;
763
+ sequence: z.ZodNumber;
764
+ }, z.core.$strip>, z.ZodTransform<import("./runner/journal.js").JournalEntry<unknown>, {
765
+ payload: unknown;
766
+ recordedAt: string;
767
+ sequence: number;
768
+ }>>>;
769
+ hasUnsearchedHistory: z.ZodBoolean;
770
+ nextSequence: z.ZodNumber;
771
+ oldestAvailableSequence: z.ZodNumber;
772
+ outcome: z.ZodLiteral<"read">;
773
+ }, z.core.$strip>, z.ZodObject<{
774
+ outcome: z.ZodLiteral<"runner-unreachable">;
775
+ }, z.core.$strip>], "outcome">;
776
+ };
777
+ runFlow: {
778
+ 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.";
779
+ readonly input: z.ZodObject<{
780
+ entryPointPath: z.ZodString;
781
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
782
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
783
+ id: z.ZodString;
784
+ }, z.core.$strip>;
785
+ readonly kind: "write";
786
+ readonly name: "runner.runFlow";
787
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
788
+ outcome: z.ZodLiteral<"submitted">;
789
+ runId: z.ZodString;
790
+ }, z.core.$strip>, z.ZodObject<{
791
+ outcome: z.ZodLiteral<"runner-unreachable">;
792
+ }, z.core.$strip>, z.ZodObject<{
793
+ outcome: z.ZodLiteral<"runner-target-mismatch">;
794
+ requiredRunnerName: z.ZodEnum<{
795
+ node20Basic: "node20Basic";
796
+ node20WithAndroid: "node20WithAndroid";
797
+ node20WithIos: "node20WithIos";
798
+ node20WithPlaywright: "node20WithPlaywright";
799
+ }>;
800
+ runnerName: z.ZodEnum<{
801
+ node20Basic: "node20Basic";
802
+ node20WithAndroid: "node20WithAndroid";
803
+ node20WithIos: "node20WithIos";
804
+ node20WithPlaywright: "node20WithPlaywright";
805
+ }>;
806
+ }, z.core.$strip>], "outcome">;
807
+ };
808
+ stop: {
809
+ 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.";
810
+ readonly input: z.ZodObject<{
811
+ id: z.ZodString;
812
+ }, z.core.$strip>;
813
+ readonly kind: "write";
814
+ readonly name: "runner.stop";
815
+ readonly output: z.ZodObject<{
816
+ id: z.ZodString;
817
+ outcome: z.ZodEnum<{
818
+ stopped: "stopped";
819
+ "not-running": "not-running";
820
+ }>;
821
+ }, z.core.$strip>;
822
+ };
823
+ takeScreenshot: {
824
+ 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.";
825
+ readonly input: z.ZodObject<{
826
+ id: z.ZodString;
827
+ }, z.core.$strip>;
828
+ readonly kind: "read";
829
+ readonly name: "runner.takeScreenshot";
830
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
831
+ imageJpegBase64: z.ZodString;
832
+ outcome: z.ZodLiteral<"captured">;
833
+ }, z.core.$strip>, z.ZodObject<{
834
+ outcome: z.ZodLiteral<"screen-needs-a-run">;
835
+ }, z.core.$strip>, z.ZodObject<{
836
+ outcome: z.ZodLiteral<"screen-not-ready">;
837
+ }, z.core.$strip>, z.ZodObject<{
838
+ outcome: z.ZodLiteral<"runner-has-no-screen">;
839
+ }, z.core.$strip>, z.ZodObject<{
840
+ outcome: z.ZodLiteral<"runner-unreachable">;
841
+ }, z.core.$strip>], "outcome">;
842
+ };
843
+ };
550
844
  tag: {
551
845
  create: {
552
846
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";
@@ -585,7 +879,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
585
879
  };
586
880
  export declare const publicContractsV1: {
587
881
  automate: {
588
- readonly description: "Request an automation that builds the selected draft flows in an environment.";
882
+ readonly description: "Request automation for draft flows. First create a named local .flow.ts draft for every requested journey that does not already have a matching draft; never reuse a generic starter or placeholder. Each new draft must start with a JSDoc Goal: description, import flow from @qawolf/flows/web, and use export default flow(...); a comment-only file or direct test(...) call is not a valid draft. Commit and push all changes with Git to publish them, then list remote drafts to resolve every selected ID. Do not use patch to create or rename a selected flow. Finally make one automation request containing all requested flow IDs.";
589
883
  readonly input: z.ZodObject<{
590
884
  environmentId: PublicIdSchema;
591
885
  flowIds: z.ZodArray<PublicIdSchema>;
@@ -623,6 +917,7 @@ export declare const publicContractsV1: {
623
917
  preview: "preview";
624
918
  }>;
625
919
  name: z.ZodString;
920
+ runConcurrencyLimit: z.ZodString;
626
921
  status: z.ZodEnum<{
627
922
  blocked: "blocked";
628
923
  "needs-investigation": "needs-investigation";
@@ -675,6 +970,7 @@ export declare const publicContractsV1: {
675
970
  preview: "preview";
676
971
  }>;
677
972
  name: z.ZodString;
973
+ runConcurrencyLimit: z.ZodString;
678
974
  status: z.ZodEnum<{
679
975
  blocked: "blocked";
680
976
  "needs-investigation": "needs-investigation";
@@ -688,7 +984,7 @@ export declare const publicContractsV1: {
688
984
  }, z.core.$strip>;
689
985
  };
690
986
  get: {
691
- readonly description: "Read a single environment's name, kind, health status, and termination state.";
987
+ readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
692
988
  readonly input: z.ZodObject<{
693
989
  environmentId: PublicIdSchema;
694
990
  }, z.core.$strip>;
@@ -710,6 +1006,7 @@ export declare const publicContractsV1: {
710
1006
  preview: "preview";
711
1007
  }>;
712
1008
  name: z.ZodString;
1009
+ runConcurrencyLimit: z.ZodString;
713
1010
  status: z.ZodEnum<{
714
1011
  blocked: "blocked";
715
1012
  "needs-investigation": "needs-investigation";
@@ -720,6 +1017,22 @@ export declare const publicContractsV1: {
720
1017
  url: z.ZodURL;
721
1018
  }, z.core.$strip>;
722
1019
  };
1020
+ getVariable: {
1021
+ readonly description: "Read the values of named environment variables in one call. Values are secrets. Names that do not exist go to missingNames and do not fail the call.";
1022
+ readonly input: z.ZodObject<{
1023
+ environmentId: PublicIdSchema;
1024
+ variableNames: z.ZodArray<z.ZodString>;
1025
+ }, z.core.$strip>;
1026
+ readonly kind: "read";
1027
+ readonly name: "environment.getVariable";
1028
+ readonly output: z.ZodObject<{
1029
+ missingNames: z.ZodArray<z.ZodString>;
1030
+ variables: z.ZodArray<z.ZodObject<{
1031
+ name: z.ZodString;
1032
+ value: z.ZodString;
1033
+ }, z.core.$strip>>;
1034
+ }, z.core.$strip>;
1035
+ };
723
1036
  listVariableNames: {
724
1037
  readonly description: "Use this to answer which QA Wolf environment variables are available to test code. Returns names only; values never leave the server.";
725
1038
  readonly input: z.ZodObject<{
@@ -744,6 +1057,42 @@ export declare const publicContractsV1: {
744
1057
  name: z.ZodString;
745
1058
  }, z.core.$strip>;
746
1059
  };
1060
+ update: {
1061
+ readonly description: "Update an environment owned by the caller's team and return it in the environment.get shape. Omitted fields remain unchanged.";
1062
+ readonly input: z.ZodObject<{
1063
+ environmentId: PublicIdSchema;
1064
+ name: z.ZodOptional<z.ZodString>;
1065
+ runConcurrencyLimit: z.ZodOptional<z.ZodString>;
1066
+ }, z.core.$strip>;
1067
+ readonly kind: "write";
1068
+ readonly name: "environment.update";
1069
+ readonly output: z.ZodObject<{
1070
+ alias: z.ZodOptional<z.ZodString>;
1071
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1072
+ lastSyncedCommitHash: z.ZodString;
1073
+ name: z.ZodString;
1074
+ syncStatus: z.ZodLiteral<"reconciled">;
1075
+ }, z.core.$strip>, z.ZodObject<{
1076
+ name: z.ZodString;
1077
+ syncStatus: z.ZodLiteral<"not-reconciled">;
1078
+ }, z.core.$strip>], "syncStatus">>;
1079
+ id: PublicIdSchema;
1080
+ kind: z.ZodEnum<{
1081
+ static: "static";
1082
+ preview: "preview";
1083
+ }>;
1084
+ name: z.ZodString;
1085
+ runConcurrencyLimit: z.ZodString;
1086
+ status: z.ZodEnum<{
1087
+ blocked: "blocked";
1088
+ "needs-investigation": "needs-investigation";
1089
+ ready: "ready";
1090
+ running: "running";
1091
+ }>;
1092
+ terminatedAt: z.ZodOptional<z.ZodISODateTime>;
1093
+ url: z.ZodURL;
1094
+ }, z.core.$strip>;
1095
+ };
747
1096
  };
748
1097
  flow: {
749
1098
  addTag: {
@@ -774,11 +1123,38 @@ export declare const publicContractsV1: {
774
1123
  flowId: PublicIdSchema;
775
1124
  name: z.ZodString;
776
1125
  path: z.ZodString;
1126
+ readiness: z.ZodEnum<{
1127
+ draft: "draft";
1128
+ active: "active";
1129
+ }>;
777
1130
  tags: z.ZodArray<z.ZodString>;
778
1131
  url: z.ZodURL;
779
1132
  }, z.core.$strip>>;
780
1133
  }, z.core.$strip>;
781
1134
  };
1135
+ update: {
1136
+ readonly description: "Move a flow between draft and active readiness. The other statuses shown in the app are derived and cannot be set.";
1137
+ readonly input: z.ZodObject<{
1138
+ flowId: PublicIdSchema;
1139
+ readiness: z.ZodEnum<{
1140
+ draft: "draft";
1141
+ active: "active";
1142
+ }>;
1143
+ }, z.core.$strip>;
1144
+ readonly kind: "write";
1145
+ readonly name: "flow.update";
1146
+ readonly output: z.ZodObject<{
1147
+ flow: z.ZodObject<{
1148
+ flowId: PublicIdSchema;
1149
+ name: z.ZodString;
1150
+ readiness: z.ZodEnum<{
1151
+ draft: "draft";
1152
+ active: "active";
1153
+ }>;
1154
+ url: z.ZodURL;
1155
+ }, z.core.$strip>;
1156
+ }, z.core.$strip>;
1157
+ };
782
1158
  };
783
1159
  issue: {
784
1160
  create: {
@@ -1022,6 +1398,7 @@ export declare const publicContractsV1: {
1022
1398
  create: {
1023
1399
  readonly description: "Create a run for the selected flows and/or tags in an environment.";
1024
1400
  readonly input: z.ZodIntersection<z.ZodObject<{
1401
+ aiTaskId: z.ZodOptional<PublicIdSchema>;
1025
1402
  environmentId: PublicIdSchema;
1026
1403
  environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1027
1404
  ignoreRules: z.ZodDefault<z.ZodBoolean>;
@@ -1096,6 +1473,7 @@ export declare const publicContractsV1: {
1096
1473
  passed: "passed";
1097
1474
  }>;
1098
1475
  }, z.core.$strip>], "status">>;
1476
+ runId: PublicIdSchema;
1099
1477
  completedAt: z.ZodOptional<z.ZodISODateTime>;
1100
1478
  createdAt: z.ZodISODateTime;
1101
1479
  git: z.ZodObject<{
@@ -1104,7 +1482,6 @@ export declare const publicContractsV1: {
1104
1482
  commitSha: z.ZodOptional<z.ZodString>;
1105
1483
  commitUrl: z.ZodOptional<z.ZodString>;
1106
1484
  }, z.core.$strip>;
1107
- runId: PublicIdSchema;
1108
1485
  status: z.ZodEnum<{
1109
1486
  running: "running";
1110
1487
  canceled: "canceled";
@@ -1116,6 +1493,210 @@ export declare const publicContractsV1: {
1116
1493
  }, z.core.$strip>;
1117
1494
  };
1118
1495
  };
1496
+ runner: {
1497
+ evaluateSnippet: {
1498
+ readonly description: "Evaluate a snippet against whatever the runner's browser is showing right now. Answers whether the snippet ran, and its error if it threw — not the value it evaluated to, so read anything you want back out of the runner's journal (a snippet's `console.log` lands in the `console` stream). A snippet starts no run and leaves no run-scoped journal entries of its own. `runner-unreachable` if the runner could not be reached or could not evaluate: as well as a runner that is still starting, has terminated after inactivity, or is busy, this covers a runner with no live page to evaluate against — which will never clear, so check that the runner you launched is one that runs a browser before retrying. It is NOT proof the snippet did not run: a snippet that outlives the answer window is still executing when you read this, so do not blindly resubmit one that mutates what the page is looking at.";
1499
+ readonly input: z.ZodObject<{
1500
+ code: z.ZodString;
1501
+ filePath: z.ZodOptional<z.ZodString>;
1502
+ files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1503
+ id: z.ZodString;
1504
+ }, z.core.$strip>;
1505
+ readonly kind: "write";
1506
+ readonly name: "runner.evaluateSnippet";
1507
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1508
+ errorMessage: z.ZodOptional<z.ZodString>;
1509
+ outcome: z.ZodLiteral<"evaluated">;
1510
+ result: z.ZodEnum<{
1511
+ success: "success";
1512
+ error: "error";
1513
+ stopped: "stopped";
1514
+ }>;
1515
+ }, z.core.$strip>, z.ZodObject<{
1516
+ outcome: z.ZodLiteral<"runner-unreachable">;
1517
+ }, z.core.$strip>], "outcome">;
1518
+ };
1519
+ launch: {
1520
+ 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.";
1521
+ readonly input: z.ZodObject<{
1522
+ id: z.ZodString;
1523
+ runnerName: z.ZodOptional<z.ZodEnum<{
1524
+ node20Basic: "node20Basic";
1525
+ node20WithAndroid: "node20WithAndroid";
1526
+ node20WithIos: "node20WithIos";
1527
+ node20WithPlaywright: "node20WithPlaywright";
1528
+ }>>;
1529
+ }, z.core.$strip>;
1530
+ readonly kind: "write";
1531
+ readonly name: "runner.launch";
1532
+ readonly output: z.ZodObject<{
1533
+ gpuAccelerated: z.ZodBoolean;
1534
+ id: z.ZodString;
1535
+ runnerName: z.ZodEnum<{
1536
+ node20Basic: "node20Basic";
1537
+ node20WithAndroid: "node20WithAndroid";
1538
+ node20WithIos: "node20WithIos";
1539
+ node20WithPlaywright: "node20WithPlaywright";
1540
+ }>;
1541
+ outcome: z.ZodEnum<{
1542
+ launched: "launched";
1543
+ "already-running": "already-running";
1544
+ }>;
1545
+ }, z.core.$strip>;
1546
+ };
1547
+ performAction: {
1548
+ 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.";
1549
+ readonly input: z.ZodObject<{
1550
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1551
+ button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
1552
+ type: z.ZodLiteral<"click">;
1553
+ x: z.ZodInt;
1554
+ y: z.ZodInt;
1555
+ }, z.core.$strict>, z.ZodObject<{
1556
+ type: z.ZodLiteral<"double_click">;
1557
+ x: z.ZodInt;
1558
+ y: z.ZodInt;
1559
+ }, z.core.$strict>, z.ZodObject<{
1560
+ scroll_x: z.ZodInt;
1561
+ scroll_y: z.ZodInt;
1562
+ type: z.ZodLiteral<"scroll">;
1563
+ x: z.ZodInt;
1564
+ y: z.ZodInt;
1565
+ }, z.core.$strict>, z.ZodObject<{
1566
+ type: z.ZodLiteral<"move">;
1567
+ x: z.ZodInt;
1568
+ y: z.ZodInt;
1569
+ }, z.core.$strict>, z.ZodObject<{
1570
+ path: z.ZodArray<z.ZodObject<{
1571
+ x: z.ZodInt;
1572
+ y: z.ZodInt;
1573
+ }, z.core.$strict>>;
1574
+ type: z.ZodLiteral<"drag">;
1575
+ }, z.core.$strict>, z.ZodObject<{
1576
+ keys: z.ZodArray<z.ZodString>;
1577
+ type: z.ZodLiteral<"keypress">;
1578
+ }, z.core.$strict>, z.ZodObject<{
1579
+ type: z.ZodLiteral<"navigate">;
1580
+ url: z.ZodURL;
1581
+ }, z.core.$strict>, z.ZodObject<{
1582
+ text: z.ZodString;
1583
+ type: z.ZodLiteral<"type">;
1584
+ }, z.core.$strict>], "type">;
1585
+ id: z.ZodString;
1586
+ }, z.core.$strip>;
1587
+ readonly kind: "write";
1588
+ readonly name: "runner.performAction";
1589
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1590
+ outcome: z.ZodLiteral<"performed">;
1591
+ }, z.core.$strip>, z.ZodObject<{
1592
+ errorMessage: z.ZodString;
1593
+ outcome: z.ZodLiteral<"action-failed">;
1594
+ }, z.core.$strip>, z.ZodObject<{
1595
+ outcome: z.ZodLiteral<"screen-needs-a-run">;
1596
+ }, z.core.$strip>, z.ZodObject<{
1597
+ outcome: z.ZodLiteral<"screen-not-ready">;
1598
+ }, z.core.$strip>, z.ZodObject<{
1599
+ outcome: z.ZodLiteral<"runner-has-no-screen">;
1600
+ }, z.core.$strip>, z.ZodObject<{
1601
+ outcome: z.ZodLiteral<"runner-unreachable">;
1602
+ }, z.core.$strip>], "outcome">;
1603
+ };
1604
+ readJournal: {
1605
+ 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.";
1606
+ readonly input: z.ZodObject<{
1607
+ runId: z.ZodOptional<z.ZodString>;
1608
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
1609
+ tail: z.ZodOptional<z.ZodNumber>;
1610
+ id: z.ZodString;
1611
+ stream: z.ZodString;
1612
+ }, z.core.$strip>;
1613
+ readonly kind: "read";
1614
+ readonly name: "runner.readJournal";
1615
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1616
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
1617
+ payload: z.ZodUnknown;
1618
+ recordedAt: z.ZodISODateTime;
1619
+ sequence: z.ZodNumber;
1620
+ }, z.core.$strip>, z.ZodTransform<import("./runner/journal.js").JournalEntry<unknown>, {
1621
+ payload: unknown;
1622
+ recordedAt: string;
1623
+ sequence: number;
1624
+ }>>>;
1625
+ hasUnsearchedHistory: z.ZodBoolean;
1626
+ nextSequence: z.ZodNumber;
1627
+ oldestAvailableSequence: z.ZodNumber;
1628
+ outcome: z.ZodLiteral<"read">;
1629
+ }, z.core.$strip>, z.ZodObject<{
1630
+ outcome: z.ZodLiteral<"runner-unreachable">;
1631
+ }, z.core.$strip>], "outcome">;
1632
+ };
1633
+ runFlow: {
1634
+ 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.";
1635
+ readonly input: z.ZodObject<{
1636
+ entryPointPath: z.ZodString;
1637
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1638
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
1639
+ id: z.ZodString;
1640
+ }, z.core.$strip>;
1641
+ readonly kind: "write";
1642
+ readonly name: "runner.runFlow";
1643
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1644
+ outcome: z.ZodLiteral<"submitted">;
1645
+ runId: z.ZodString;
1646
+ }, z.core.$strip>, z.ZodObject<{
1647
+ outcome: z.ZodLiteral<"runner-unreachable">;
1648
+ }, z.core.$strip>, z.ZodObject<{
1649
+ outcome: z.ZodLiteral<"runner-target-mismatch">;
1650
+ requiredRunnerName: z.ZodEnum<{
1651
+ node20Basic: "node20Basic";
1652
+ node20WithAndroid: "node20WithAndroid";
1653
+ node20WithIos: "node20WithIos";
1654
+ node20WithPlaywright: "node20WithPlaywright";
1655
+ }>;
1656
+ runnerName: z.ZodEnum<{
1657
+ node20Basic: "node20Basic";
1658
+ node20WithAndroid: "node20WithAndroid";
1659
+ node20WithIos: "node20WithIos";
1660
+ node20WithPlaywright: "node20WithPlaywright";
1661
+ }>;
1662
+ }, z.core.$strip>], "outcome">;
1663
+ };
1664
+ stop: {
1665
+ 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.";
1666
+ readonly input: z.ZodObject<{
1667
+ id: z.ZodString;
1668
+ }, z.core.$strip>;
1669
+ readonly kind: "write";
1670
+ readonly name: "runner.stop";
1671
+ readonly output: z.ZodObject<{
1672
+ id: z.ZodString;
1673
+ outcome: z.ZodEnum<{
1674
+ stopped: "stopped";
1675
+ "not-running": "not-running";
1676
+ }>;
1677
+ }, z.core.$strip>;
1678
+ };
1679
+ takeScreenshot: {
1680
+ 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.";
1681
+ readonly input: z.ZodObject<{
1682
+ id: z.ZodString;
1683
+ }, z.core.$strip>;
1684
+ readonly kind: "read";
1685
+ readonly name: "runner.takeScreenshot";
1686
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1687
+ imageJpegBase64: z.ZodString;
1688
+ outcome: z.ZodLiteral<"captured">;
1689
+ }, z.core.$strip>, z.ZodObject<{
1690
+ outcome: z.ZodLiteral<"screen-needs-a-run">;
1691
+ }, z.core.$strip>, z.ZodObject<{
1692
+ outcome: z.ZodLiteral<"screen-not-ready">;
1693
+ }, z.core.$strip>, z.ZodObject<{
1694
+ outcome: z.ZodLiteral<"runner-has-no-screen">;
1695
+ }, z.core.$strip>, z.ZodObject<{
1696
+ outcome: z.ZodLiteral<"runner-unreachable">;
1697
+ }, z.core.$strip>], "outcome">;
1698
+ };
1699
+ };
1119
1700
  tag: {
1120
1701
  create: {
1121
1702
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";