@qawolf/api-contracts 0.18.0 → 0.22.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 (90) 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 +5 -3
  12. package/dist/v1/environment/index.d.ts.map +1 -1
  13. package/dist/v1/environment/index.js +3 -3
  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/index.d.ts +439 -130
  36. package/dist/v1/index.d.ts.map +1 -1
  37. package/dist/v1/index.js +31 -0
  38. package/dist/v1/index.js.map +1 -1
  39. package/dist/v1/issue/update.d.ts +3 -60
  40. package/dist/v1/issue/update.d.ts.map +1 -1
  41. package/dist/v1/issue/update.js +15 -9
  42. package/dist/v1/issue/update.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/summary.d.ts.map +1 -1
  48. package/dist/v1/run/summary.js +3 -0
  49. package/dist/v1/run/summary.js.map +1 -1
  50. package/dist/v1/runner/environment.d.ts +4 -0
  51. package/dist/v1/runner/environment.d.ts.map +1 -0
  52. package/dist/v1/runner/environment.js +46 -0
  53. package/dist/v1/runner/environment.js.map +1 -0
  54. package/dist/v1/runner/evaluateSnippet.d.ts +24 -0
  55. package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -0
  56. package/dist/v1/runner/evaluateSnippet.js +54 -0
  57. package/dist/v1/runner/evaluateSnippet.js.map +1 -0
  58. package/dist/v1/runner/files.d.ts +26 -0
  59. package/dist/v1/runner/files.d.ts.map +1 -0
  60. package/dist/v1/runner/files.js +65 -0
  61. package/dist/v1/runner/files.js.map +1 -0
  62. package/dist/v1/runner/identity.d.ts +21 -0
  63. package/dist/v1/runner/identity.d.ts.map +1 -0
  64. package/dist/v1/runner/identity.js +21 -0
  65. package/dist/v1/runner/identity.js.map +1 -0
  66. package/dist/v1/runner/index.d.ts +45 -0
  67. package/dist/v1/runner/index.d.ts.map +1 -0
  68. package/dist/v1/runner/index.js +41 -0
  69. package/dist/v1/runner/index.js.map +1 -0
  70. package/dist/v1/runner/journal.d.ts +104 -0
  71. package/dist/v1/runner/journal.d.ts.map +1 -0
  72. package/dist/v1/runner/journal.js +52 -0
  73. package/dist/v1/runner/journal.js.map +1 -0
  74. package/dist/v1/runner/payloadSize.d.ts +27 -0
  75. package/dist/v1/runner/payloadSize.d.ts.map +1 -0
  76. package/dist/v1/runner/payloadSize.js +49 -0
  77. package/dist/v1/runner/payloadSize.js.map +1 -0
  78. package/dist/v1/runner/readJournal.d.ts +31 -0
  79. package/dist/v1/runner/readJournal.d.ts.map +1 -0
  80. package/dist/v1/runner/readJournal.js +22 -0
  81. package/dist/v1/runner/readJournal.js.map +1 -0
  82. package/dist/v1/runner/runFlow.d.ts +33 -0
  83. package/dist/v1/runner/runFlow.d.ts.map +1 -0
  84. package/dist/v1/runner/runFlow.js +48 -0
  85. package/dist/v1/runner/runFlow.js.map +1 -0
  86. package/dist/v1/runner/unreachable.d.ts +16 -0
  87. package/dist/v1/runner/unreachable.d.ts.map +1 -0
  88. package/dist/v1/runner/unreachable.js +16 -0
  89. package/dist/v1/runner/unreachable.js.map +1 -0
  90. package/package.json +6 -6
@@ -3,6 +3,11 @@ 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 { runEnvironmentSchema } from "./runner/environment.js";
7
+ export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
8
+ export { type RunnerNameForPublicApi, makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
9
+ export { type JournalEntry, type JournalStream, type KnownJournalStream, type ReadJournalRequest, type ReadJournalResponse, journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
10
+ export { type RunFiles, maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
6
11
  import type { AnyPublicApiContract } from "./definition.js";
7
12
  import { type PublicIdSchema, type PublicIdSchemasOf } from "./ids.js";
8
13
  export type PublicApiInput<Api extends AnyPublicApiContract> = z.input<Api["input"]>;
@@ -16,7 +21,7 @@ export type PublicApiOutput<Api extends AnyPublicApiContract> = z.infer<Api["out
16
21
  */
17
22
  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>) => {
18
23
  automate: {
19
- readonly description: "Request an automation that builds the selected draft flows in an environment.";
24
+ 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
25
  readonly input: z.ZodObject<{
21
26
  environmentId: PublicIdSchema;
22
27
  flowIds: z.ZodArray<FlowId>;
@@ -54,6 +59,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
54
59
  preview: "preview";
55
60
  }>;
56
61
  name: z.ZodString;
62
+ runConcurrencyLimit: z.ZodString;
57
63
  status: z.ZodEnum<{
58
64
  blocked: "blocked";
59
65
  "needs-investigation": "needs-investigation";
@@ -106,6 +112,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
106
112
  preview: "preview";
107
113
  }>;
108
114
  name: z.ZodString;
115
+ runConcurrencyLimit: z.ZodString;
109
116
  status: z.ZodEnum<{
110
117
  blocked: "blocked";
111
118
  "needs-investigation": "needs-investigation";
@@ -119,7 +126,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
119
126
  }, z.core.$strip>;
120
127
  };
121
128
  get: {
122
- readonly description: "Read a single environment's name, kind, health status, and termination state.";
129
+ readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
123
130
  readonly input: z.ZodObject<{
124
131
  environmentId: PublicIdSchema;
125
132
  }, z.core.$strip>;
@@ -141,6 +148,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
141
148
  preview: "preview";
142
149
  }>;
143
150
  name: z.ZodString;
151
+ runConcurrencyLimit: z.ZodString;
144
152
  status: z.ZodEnum<{
145
153
  blocked: "blocked";
146
154
  "needs-investigation": "needs-investigation";
@@ -151,8 +159,24 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
151
159
  url: z.ZodURL;
152
160
  }, z.core.$strip>;
153
161
  };
162
+ getVariable: {
163
+ 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.";
164
+ readonly input: z.ZodObject<{
165
+ environmentId: PublicIdSchema;
166
+ variableNames: z.ZodArray<z.ZodString>;
167
+ }, z.core.$strip>;
168
+ readonly kind: "read";
169
+ readonly name: "environment.getVariable";
170
+ readonly output: z.ZodObject<{
171
+ missingNames: z.ZodArray<z.ZodString>;
172
+ variables: z.ZodArray<z.ZodObject<{
173
+ name: z.ZodString;
174
+ value: z.ZodString;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strip>;
177
+ };
154
178
  listVariableNames: {
155
- readonly description: "List the names of an environment's variables, sorted. Names only — values never leave the server.";
179
+ 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
180
  readonly input: z.ZodObject<{
157
181
  environmentId: PublicIdSchema;
158
182
  }, z.core.$strip>;
@@ -163,7 +187,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
163
187
  }, z.core.$strip>;
164
188
  };
165
189
  setVariable: {
166
- readonly description: "Create or replace one environment variable by name and return its stored name. The value is never returned.";
190
+ readonly description: "Create or replace an environment variable. If the user asks to create one for \"my email\" without naming it, use DEFAULT_ENVIRONMENT_EMAIL. The value is never returned.";
167
191
  readonly input: z.ZodObject<{
168
192
  environmentId: PublicIdSchema;
169
193
  name: z.ZodString;
@@ -175,6 +199,42 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
175
199
  name: z.ZodString;
176
200
  }, z.core.$strip>;
177
201
  };
202
+ update: {
203
+ readonly description: "Update an environment owned by the caller's team and return it in the environment.get shape. Omitted fields remain unchanged.";
204
+ readonly input: z.ZodObject<{
205
+ environmentId: PublicIdSchema;
206
+ name: z.ZodOptional<z.ZodString>;
207
+ runConcurrencyLimit: z.ZodOptional<z.ZodString>;
208
+ }, z.core.$strip>;
209
+ readonly kind: "write";
210
+ readonly name: "environment.update";
211
+ readonly output: z.ZodObject<{
212
+ alias: z.ZodOptional<z.ZodString>;
213
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
214
+ lastSyncedCommitHash: z.ZodString;
215
+ name: z.ZodString;
216
+ syncStatus: z.ZodLiteral<"reconciled">;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ name: z.ZodString;
219
+ syncStatus: z.ZodLiteral<"not-reconciled">;
220
+ }, z.core.$strip>], "syncStatus">>;
221
+ id: EnvironmentId;
222
+ kind: z.ZodEnum<{
223
+ static: "static";
224
+ preview: "preview";
225
+ }>;
226
+ name: z.ZodString;
227
+ runConcurrencyLimit: z.ZodString;
228
+ status: z.ZodEnum<{
229
+ blocked: "blocked";
230
+ "needs-investigation": "needs-investigation";
231
+ ready: "ready";
232
+ running: "running";
233
+ }>;
234
+ terminatedAt: z.ZodOptional<z.ZodISODateTime>;
235
+ url: z.ZodURL;
236
+ }, z.core.$strip>;
237
+ };
178
238
  };
179
239
  flow: {
180
240
  addTag: {
@@ -205,11 +265,38 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
205
265
  flowId: FlowId;
206
266
  name: z.ZodString;
207
267
  path: z.ZodString;
268
+ readiness: z.ZodEnum<{
269
+ draft: "draft";
270
+ active: "active";
271
+ }>;
208
272
  tags: z.ZodArray<z.ZodString>;
209
273
  url: z.ZodURL;
210
274
  }, z.core.$strip>>;
211
275
  }, z.core.$strip>;
212
276
  };
277
+ update: {
278
+ readonly description: "Move a flow between draft and active readiness. The other statuses shown in the app are derived and cannot be set.";
279
+ readonly input: z.ZodObject<{
280
+ flowId: FlowId;
281
+ readiness: z.ZodEnum<{
282
+ draft: "draft";
283
+ active: "active";
284
+ }>;
285
+ }, z.core.$strip>;
286
+ readonly kind: "write";
287
+ readonly name: "flow.update";
288
+ readonly output: z.ZodObject<{
289
+ flow: z.ZodObject<{
290
+ flowId: FlowId;
291
+ name: z.ZodString;
292
+ readiness: z.ZodEnum<{
293
+ draft: "draft";
294
+ active: "active";
295
+ }>;
296
+ url: z.ZodURL;
297
+ }, z.core.$strip>;
298
+ }, z.core.$strip>;
299
+ };
213
300
  };
214
301
  issue: {
215
302
  create: {
@@ -388,29 +475,10 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
388
475
  };
389
476
  update: {
390
477
  readonly description: "Update an issue owned by the caller's team. Omitted fields remain unchanged.";
391
- readonly input: z.ZodUnion<readonly [z.ZodObject<{
392
- description: z.ZodString;
393
- issueId: IssueId;
394
- name: z.ZodOptional<z.ZodString>;
395
- priority: z.ZodOptional<z.ZodEnum<{
396
- unprioritized: "unprioritized";
397
- low: "low";
398
- medium: "medium";
399
- high: "high";
400
- urgent: "urgent";
401
- }>>;
402
- status: z.ZodOptional<z.ZodEnum<{
403
- pending: "pending";
404
- inProgress: "inProgress";
405
- paused: "paused";
406
- resolved: "resolved";
407
- canceled: "canceled";
408
- archived: "archived";
409
- }>>;
410
- }, z.core.$strip>, z.ZodObject<{
411
- name: z.ZodString;
478
+ readonly input: z.ZodObject<{
412
479
  description: z.ZodOptional<z.ZodString>;
413
480
  issueId: IssueId;
481
+ name: z.ZodOptional<z.ZodString>;
414
482
  priority: z.ZodOptional<z.ZodEnum<{
415
483
  unprioritized: "unprioritized";
416
484
  low: "low";
@@ -426,45 +494,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
426
494
  canceled: "canceled";
427
495
  archived: "archived";
428
496
  }>>;
429
- }, z.core.$strip>, z.ZodObject<{
430
- priority: z.ZodEnum<{
431
- unprioritized: "unprioritized";
432
- low: "low";
433
- medium: "medium";
434
- high: "high";
435
- urgent: "urgent";
436
- }>;
437
- description: z.ZodOptional<z.ZodString>;
438
- issueId: IssueId;
439
- name: z.ZodOptional<z.ZodString>;
440
- status: z.ZodOptional<z.ZodEnum<{
441
- pending: "pending";
442
- inProgress: "inProgress";
443
- paused: "paused";
444
- resolved: "resolved";
445
- canceled: "canceled";
446
- archived: "archived";
447
- }>>;
448
- }, z.core.$strip>, z.ZodObject<{
449
- status: z.ZodEnum<{
450
- pending: "pending";
451
- inProgress: "inProgress";
452
- paused: "paused";
453
- resolved: "resolved";
454
- canceled: "canceled";
455
- archived: "archived";
456
- }>;
457
- description: z.ZodOptional<z.ZodString>;
458
- issueId: IssueId;
459
- name: z.ZodOptional<z.ZodString>;
460
- priority: z.ZodOptional<z.ZodEnum<{
461
- unprioritized: "unprioritized";
462
- low: "low";
463
- medium: "medium";
464
- high: "high";
465
- urgent: "urgent";
466
- }>>;
467
- }, z.core.$strip>]>;
497
+ }, z.core.$strip>;
468
498
  readonly kind: "write";
469
499
  readonly name: "issue.update";
470
500
  readonly output: z.ZodObject<{
@@ -584,6 +614,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
584
614
  passed: "passed";
585
615
  }>;
586
616
  }, z.core.$strip>], "status">>;
617
+ runId: RunId;
587
618
  completedAt: z.ZodOptional<z.ZodISODateTime>;
588
619
  createdAt: z.ZodISODateTime;
589
620
  git: z.ZodObject<{
@@ -592,7 +623,6 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
592
623
  commitSha: z.ZodOptional<z.ZodString>;
593
624
  commitUrl: z.ZodOptional<z.ZodString>;
594
625
  }, z.core.$strip>;
595
- runId: RunId;
596
626
  status: z.ZodEnum<{
597
627
  running: "running";
598
628
  canceled: "canceled";
@@ -604,6 +634,133 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
604
634
  }, z.core.$strip>;
605
635
  };
606
636
  };
637
+ runner: {
638
+ evaluateSnippet: {
639
+ 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.";
640
+ readonly input: z.ZodObject<{
641
+ code: z.ZodString;
642
+ filePath: z.ZodOptional<z.ZodString>;
643
+ files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
644
+ id: z.ZodString;
645
+ }, z.core.$strip>;
646
+ readonly kind: "write";
647
+ readonly name: "runner.evaluateSnippet";
648
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
649
+ errorMessage: z.ZodOptional<z.ZodString>;
650
+ outcome: z.ZodLiteral<"evaluated">;
651
+ result: z.ZodEnum<{
652
+ success: "success";
653
+ error: "error";
654
+ stopped: "stopped";
655
+ }>;
656
+ }, z.core.$strip>, z.ZodObject<{
657
+ outcome: z.ZodLiteral<"runner-unreachable">;
658
+ }, z.core.$strip>], "outcome">;
659
+ };
660
+ launch: {
661
+ 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.";
662
+ readonly input: z.ZodObject<{
663
+ id: z.ZodString;
664
+ runnerName: z.ZodOptional<z.ZodEnum<{
665
+ node20Basic: "node20Basic";
666
+ node20WithAndroid: "node20WithAndroid";
667
+ node20WithIos: "node20WithIos";
668
+ node20WithPlaywright: "node20WithPlaywright";
669
+ }>>;
670
+ }, z.core.$strip>;
671
+ readonly kind: "write";
672
+ readonly name: "runner.launch";
673
+ readonly output: z.ZodObject<{
674
+ gpuAccelerated: z.ZodBoolean;
675
+ id: z.ZodString;
676
+ runnerName: z.ZodEnum<{
677
+ node20Basic: "node20Basic";
678
+ node20WithAndroid: "node20WithAndroid";
679
+ node20WithIos: "node20WithIos";
680
+ node20WithPlaywright: "node20WithPlaywright";
681
+ }>;
682
+ outcome: z.ZodEnum<{
683
+ launched: "launched";
684
+ "already-running": "already-running";
685
+ }>;
686
+ }, z.core.$strip>;
687
+ };
688
+ readJournal: {
689
+ 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.";
690
+ readonly input: z.ZodObject<{
691
+ runId: z.ZodOptional<z.ZodString>;
692
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
693
+ tail: z.ZodOptional<z.ZodNumber>;
694
+ id: z.ZodString;
695
+ stream: z.ZodString;
696
+ }, z.core.$strip>;
697
+ readonly kind: "read";
698
+ readonly name: "runner.readJournal";
699
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
700
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
701
+ payload: z.ZodUnknown;
702
+ recordedAt: z.ZodISODateTime;
703
+ sequence: z.ZodNumber;
704
+ }, z.core.$strip>, z.ZodTransform<import("./runner/journal.js").JournalEntry<unknown>, {
705
+ payload: unknown;
706
+ recordedAt: string;
707
+ sequence: number;
708
+ }>>>;
709
+ hasUnsearchedHistory: z.ZodBoolean;
710
+ nextSequence: z.ZodNumber;
711
+ oldestAvailableSequence: z.ZodNumber;
712
+ outcome: z.ZodLiteral<"read">;
713
+ }, z.core.$strip>, z.ZodObject<{
714
+ outcome: z.ZodLiteral<"runner-unreachable">;
715
+ }, z.core.$strip>], "outcome">;
716
+ };
717
+ runFlow: {
718
+ 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.";
719
+ readonly input: z.ZodObject<{
720
+ entryPointPath: z.ZodString;
721
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
722
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
723
+ id: z.ZodString;
724
+ }, z.core.$strip>;
725
+ readonly kind: "write";
726
+ readonly name: "runner.runFlow";
727
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
728
+ outcome: z.ZodLiteral<"submitted">;
729
+ runId: z.ZodString;
730
+ }, z.core.$strip>, z.ZodObject<{
731
+ outcome: z.ZodLiteral<"runner-unreachable">;
732
+ }, z.core.$strip>, z.ZodObject<{
733
+ outcome: z.ZodLiteral<"runner-target-mismatch">;
734
+ requiredRunnerName: z.ZodEnum<{
735
+ node20Basic: "node20Basic";
736
+ node20WithAndroid: "node20WithAndroid";
737
+ node20WithIos: "node20WithIos";
738
+ node20WithPlaywright: "node20WithPlaywright";
739
+ }>;
740
+ runnerName: z.ZodEnum<{
741
+ node20Basic: "node20Basic";
742
+ node20WithAndroid: "node20WithAndroid";
743
+ node20WithIos: "node20WithIos";
744
+ node20WithPlaywright: "node20WithPlaywright";
745
+ }>;
746
+ }, z.core.$strip>], "outcome">;
747
+ };
748
+ stop: {
749
+ 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.";
750
+ readonly input: z.ZodObject<{
751
+ id: z.ZodString;
752
+ }, z.core.$strip>;
753
+ readonly kind: "write";
754
+ readonly name: "runner.stop";
755
+ readonly output: z.ZodObject<{
756
+ id: z.ZodString;
757
+ outcome: z.ZodEnum<{
758
+ stopped: "stopped";
759
+ "not-running": "not-running";
760
+ }>;
761
+ }, z.core.$strip>;
762
+ };
763
+ };
607
764
  tag: {
608
765
  create: {
609
766
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";
@@ -642,7 +799,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
642
799
  };
643
800
  export declare const publicContractsV1: {
644
801
  automate: {
645
- readonly description: "Request an automation that builds the selected draft flows in an environment.";
802
+ 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.";
646
803
  readonly input: z.ZodObject<{
647
804
  environmentId: PublicIdSchema;
648
805
  flowIds: z.ZodArray<PublicIdSchema>;
@@ -680,6 +837,7 @@ export declare const publicContractsV1: {
680
837
  preview: "preview";
681
838
  }>;
682
839
  name: z.ZodString;
840
+ runConcurrencyLimit: z.ZodString;
683
841
  status: z.ZodEnum<{
684
842
  blocked: "blocked";
685
843
  "needs-investigation": "needs-investigation";
@@ -732,6 +890,7 @@ export declare const publicContractsV1: {
732
890
  preview: "preview";
733
891
  }>;
734
892
  name: z.ZodString;
893
+ runConcurrencyLimit: z.ZodString;
735
894
  status: z.ZodEnum<{
736
895
  blocked: "blocked";
737
896
  "needs-investigation": "needs-investigation";
@@ -745,7 +904,7 @@ export declare const publicContractsV1: {
745
904
  }, z.core.$strip>;
746
905
  };
747
906
  get: {
748
- readonly description: "Read a single environment's name, kind, health status, and termination state.";
907
+ readonly description: "Read a single environment's name, kind, health status, run concurrency limit, and termination state.";
749
908
  readonly input: z.ZodObject<{
750
909
  environmentId: PublicIdSchema;
751
910
  }, z.core.$strip>;
@@ -767,6 +926,7 @@ export declare const publicContractsV1: {
767
926
  preview: "preview";
768
927
  }>;
769
928
  name: z.ZodString;
929
+ runConcurrencyLimit: z.ZodString;
770
930
  status: z.ZodEnum<{
771
931
  blocked: "blocked";
772
932
  "needs-investigation": "needs-investigation";
@@ -777,8 +937,24 @@ export declare const publicContractsV1: {
777
937
  url: z.ZodURL;
778
938
  }, z.core.$strip>;
779
939
  };
940
+ getVariable: {
941
+ 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.";
942
+ readonly input: z.ZodObject<{
943
+ environmentId: PublicIdSchema;
944
+ variableNames: z.ZodArray<z.ZodString>;
945
+ }, z.core.$strip>;
946
+ readonly kind: "read";
947
+ readonly name: "environment.getVariable";
948
+ readonly output: z.ZodObject<{
949
+ missingNames: z.ZodArray<z.ZodString>;
950
+ variables: z.ZodArray<z.ZodObject<{
951
+ name: z.ZodString;
952
+ value: z.ZodString;
953
+ }, z.core.$strip>>;
954
+ }, z.core.$strip>;
955
+ };
780
956
  listVariableNames: {
781
- readonly description: "List the names of an environment's variables, sorted. Names only — values never leave the server.";
957
+ readonly description: "Use this to answer which QA Wolf environment variables are available to test code. Returns names only; values never leave the server.";
782
958
  readonly input: z.ZodObject<{
783
959
  environmentId: PublicIdSchema;
784
960
  }, z.core.$strip>;
@@ -789,7 +965,7 @@ export declare const publicContractsV1: {
789
965
  }, z.core.$strip>;
790
966
  };
791
967
  setVariable: {
792
- readonly description: "Create or replace one environment variable by name and return its stored name. The value is never returned.";
968
+ readonly description: "Create or replace an environment variable. If the user asks to create one for \"my email\" without naming it, use DEFAULT_ENVIRONMENT_EMAIL. The value is never returned.";
793
969
  readonly input: z.ZodObject<{
794
970
  environmentId: PublicIdSchema;
795
971
  name: z.ZodString;
@@ -801,6 +977,42 @@ export declare const publicContractsV1: {
801
977
  name: z.ZodString;
802
978
  }, z.core.$strip>;
803
979
  };
980
+ update: {
981
+ readonly description: "Update an environment owned by the caller's team and return it in the environment.get shape. Omitted fields remain unchanged.";
982
+ readonly input: z.ZodObject<{
983
+ environmentId: PublicIdSchema;
984
+ name: z.ZodOptional<z.ZodString>;
985
+ runConcurrencyLimit: z.ZodOptional<z.ZodString>;
986
+ }, z.core.$strip>;
987
+ readonly kind: "write";
988
+ readonly name: "environment.update";
989
+ readonly output: z.ZodObject<{
990
+ alias: z.ZodOptional<z.ZodString>;
991
+ flowCodeBranch: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
992
+ lastSyncedCommitHash: z.ZodString;
993
+ name: z.ZodString;
994
+ syncStatus: z.ZodLiteral<"reconciled">;
995
+ }, z.core.$strip>, z.ZodObject<{
996
+ name: z.ZodString;
997
+ syncStatus: z.ZodLiteral<"not-reconciled">;
998
+ }, z.core.$strip>], "syncStatus">>;
999
+ id: PublicIdSchema;
1000
+ kind: z.ZodEnum<{
1001
+ static: "static";
1002
+ preview: "preview";
1003
+ }>;
1004
+ name: z.ZodString;
1005
+ runConcurrencyLimit: z.ZodString;
1006
+ status: z.ZodEnum<{
1007
+ blocked: "blocked";
1008
+ "needs-investigation": "needs-investigation";
1009
+ ready: "ready";
1010
+ running: "running";
1011
+ }>;
1012
+ terminatedAt: z.ZodOptional<z.ZodISODateTime>;
1013
+ url: z.ZodURL;
1014
+ }, z.core.$strip>;
1015
+ };
804
1016
  };
805
1017
  flow: {
806
1018
  addTag: {
@@ -831,11 +1043,38 @@ export declare const publicContractsV1: {
831
1043
  flowId: PublicIdSchema;
832
1044
  name: z.ZodString;
833
1045
  path: z.ZodString;
1046
+ readiness: z.ZodEnum<{
1047
+ draft: "draft";
1048
+ active: "active";
1049
+ }>;
834
1050
  tags: z.ZodArray<z.ZodString>;
835
1051
  url: z.ZodURL;
836
1052
  }, z.core.$strip>>;
837
1053
  }, z.core.$strip>;
838
1054
  };
1055
+ update: {
1056
+ readonly description: "Move a flow between draft and active readiness. The other statuses shown in the app are derived and cannot be set.";
1057
+ readonly input: z.ZodObject<{
1058
+ flowId: PublicIdSchema;
1059
+ readiness: z.ZodEnum<{
1060
+ draft: "draft";
1061
+ active: "active";
1062
+ }>;
1063
+ }, z.core.$strip>;
1064
+ readonly kind: "write";
1065
+ readonly name: "flow.update";
1066
+ readonly output: z.ZodObject<{
1067
+ flow: z.ZodObject<{
1068
+ flowId: PublicIdSchema;
1069
+ name: z.ZodString;
1070
+ readiness: z.ZodEnum<{
1071
+ draft: "draft";
1072
+ active: "active";
1073
+ }>;
1074
+ url: z.ZodURL;
1075
+ }, z.core.$strip>;
1076
+ }, z.core.$strip>;
1077
+ };
839
1078
  };
840
1079
  issue: {
841
1080
  create: {
@@ -1014,29 +1253,10 @@ export declare const publicContractsV1: {
1014
1253
  };
1015
1254
  update: {
1016
1255
  readonly description: "Update an issue owned by the caller's team. Omitted fields remain unchanged.";
1017
- readonly input: z.ZodUnion<readonly [z.ZodObject<{
1018
- description: z.ZodString;
1019
- issueId: PublicIdSchema;
1020
- name: z.ZodOptional<z.ZodString>;
1021
- priority: z.ZodOptional<z.ZodEnum<{
1022
- unprioritized: "unprioritized";
1023
- low: "low";
1024
- medium: "medium";
1025
- high: "high";
1026
- urgent: "urgent";
1027
- }>>;
1028
- status: z.ZodOptional<z.ZodEnum<{
1029
- pending: "pending";
1030
- inProgress: "inProgress";
1031
- paused: "paused";
1032
- resolved: "resolved";
1033
- canceled: "canceled";
1034
- archived: "archived";
1035
- }>>;
1036
- }, z.core.$strip>, z.ZodObject<{
1037
- name: z.ZodString;
1256
+ readonly input: z.ZodObject<{
1038
1257
  description: z.ZodOptional<z.ZodString>;
1039
1258
  issueId: PublicIdSchema;
1259
+ name: z.ZodOptional<z.ZodString>;
1040
1260
  priority: z.ZodOptional<z.ZodEnum<{
1041
1261
  unprioritized: "unprioritized";
1042
1262
  low: "low";
@@ -1052,45 +1272,7 @@ export declare const publicContractsV1: {
1052
1272
  canceled: "canceled";
1053
1273
  archived: "archived";
1054
1274
  }>>;
1055
- }, z.core.$strip>, z.ZodObject<{
1056
- priority: z.ZodEnum<{
1057
- unprioritized: "unprioritized";
1058
- low: "low";
1059
- medium: "medium";
1060
- high: "high";
1061
- urgent: "urgent";
1062
- }>;
1063
- description: z.ZodOptional<z.ZodString>;
1064
- issueId: PublicIdSchema;
1065
- name: z.ZodOptional<z.ZodString>;
1066
- status: z.ZodOptional<z.ZodEnum<{
1067
- pending: "pending";
1068
- inProgress: "inProgress";
1069
- paused: "paused";
1070
- resolved: "resolved";
1071
- canceled: "canceled";
1072
- archived: "archived";
1073
- }>>;
1074
- }, z.core.$strip>, z.ZodObject<{
1075
- status: z.ZodEnum<{
1076
- pending: "pending";
1077
- inProgress: "inProgress";
1078
- paused: "paused";
1079
- resolved: "resolved";
1080
- canceled: "canceled";
1081
- archived: "archived";
1082
- }>;
1083
- description: z.ZodOptional<z.ZodString>;
1084
- issueId: PublicIdSchema;
1085
- name: z.ZodOptional<z.ZodString>;
1086
- priority: z.ZodOptional<z.ZodEnum<{
1087
- unprioritized: "unprioritized";
1088
- low: "low";
1089
- medium: "medium";
1090
- high: "high";
1091
- urgent: "urgent";
1092
- }>>;
1093
- }, z.core.$strip>]>;
1275
+ }, z.core.$strip>;
1094
1276
  readonly kind: "write";
1095
1277
  readonly name: "issue.update";
1096
1278
  readonly output: z.ZodObject<{
@@ -1210,6 +1392,7 @@ export declare const publicContractsV1: {
1210
1392
  passed: "passed";
1211
1393
  }>;
1212
1394
  }, z.core.$strip>], "status">>;
1395
+ runId: PublicIdSchema;
1213
1396
  completedAt: z.ZodOptional<z.ZodISODateTime>;
1214
1397
  createdAt: z.ZodISODateTime;
1215
1398
  git: z.ZodObject<{
@@ -1218,7 +1401,6 @@ export declare const publicContractsV1: {
1218
1401
  commitSha: z.ZodOptional<z.ZodString>;
1219
1402
  commitUrl: z.ZodOptional<z.ZodString>;
1220
1403
  }, z.core.$strip>;
1221
- runId: PublicIdSchema;
1222
1404
  status: z.ZodEnum<{
1223
1405
  running: "running";
1224
1406
  canceled: "canceled";
@@ -1230,6 +1412,133 @@ export declare const publicContractsV1: {
1230
1412
  }, z.core.$strip>;
1231
1413
  };
1232
1414
  };
1415
+ runner: {
1416
+ evaluateSnippet: {
1417
+ 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.";
1418
+ readonly input: z.ZodObject<{
1419
+ code: z.ZodString;
1420
+ filePath: z.ZodOptional<z.ZodString>;
1421
+ files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1422
+ id: z.ZodString;
1423
+ }, z.core.$strip>;
1424
+ readonly kind: "write";
1425
+ readonly name: "runner.evaluateSnippet";
1426
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1427
+ errorMessage: z.ZodOptional<z.ZodString>;
1428
+ outcome: z.ZodLiteral<"evaluated">;
1429
+ result: z.ZodEnum<{
1430
+ success: "success";
1431
+ error: "error";
1432
+ stopped: "stopped";
1433
+ }>;
1434
+ }, z.core.$strip>, z.ZodObject<{
1435
+ outcome: z.ZodLiteral<"runner-unreachable">;
1436
+ }, z.core.$strip>], "outcome">;
1437
+ };
1438
+ launch: {
1439
+ 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.";
1440
+ readonly input: z.ZodObject<{
1441
+ id: z.ZodString;
1442
+ runnerName: z.ZodOptional<z.ZodEnum<{
1443
+ node20Basic: "node20Basic";
1444
+ node20WithAndroid: "node20WithAndroid";
1445
+ node20WithIos: "node20WithIos";
1446
+ node20WithPlaywright: "node20WithPlaywright";
1447
+ }>>;
1448
+ }, z.core.$strip>;
1449
+ readonly kind: "write";
1450
+ readonly name: "runner.launch";
1451
+ readonly output: z.ZodObject<{
1452
+ gpuAccelerated: z.ZodBoolean;
1453
+ id: z.ZodString;
1454
+ runnerName: z.ZodEnum<{
1455
+ node20Basic: "node20Basic";
1456
+ node20WithAndroid: "node20WithAndroid";
1457
+ node20WithIos: "node20WithIos";
1458
+ node20WithPlaywright: "node20WithPlaywright";
1459
+ }>;
1460
+ outcome: z.ZodEnum<{
1461
+ launched: "launched";
1462
+ "already-running": "already-running";
1463
+ }>;
1464
+ }, z.core.$strip>;
1465
+ };
1466
+ readJournal: {
1467
+ 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.";
1468
+ readonly input: z.ZodObject<{
1469
+ runId: z.ZodOptional<z.ZodString>;
1470
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
1471
+ tail: z.ZodOptional<z.ZodNumber>;
1472
+ id: z.ZodString;
1473
+ stream: z.ZodString;
1474
+ }, z.core.$strip>;
1475
+ readonly kind: "read";
1476
+ readonly name: "runner.readJournal";
1477
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1478
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
1479
+ payload: z.ZodUnknown;
1480
+ recordedAt: z.ZodISODateTime;
1481
+ sequence: z.ZodNumber;
1482
+ }, z.core.$strip>, z.ZodTransform<import("./runner/journal.js").JournalEntry<unknown>, {
1483
+ payload: unknown;
1484
+ recordedAt: string;
1485
+ sequence: number;
1486
+ }>>>;
1487
+ hasUnsearchedHistory: z.ZodBoolean;
1488
+ nextSequence: z.ZodNumber;
1489
+ oldestAvailableSequence: z.ZodNumber;
1490
+ outcome: z.ZodLiteral<"read">;
1491
+ }, z.core.$strip>, z.ZodObject<{
1492
+ outcome: z.ZodLiteral<"runner-unreachable">;
1493
+ }, z.core.$strip>], "outcome">;
1494
+ };
1495
+ runFlow: {
1496
+ 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.";
1497
+ readonly input: z.ZodObject<{
1498
+ entryPointPath: z.ZodString;
1499
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1500
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
1501
+ id: z.ZodString;
1502
+ }, z.core.$strip>;
1503
+ readonly kind: "write";
1504
+ readonly name: "runner.runFlow";
1505
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1506
+ outcome: z.ZodLiteral<"submitted">;
1507
+ runId: z.ZodString;
1508
+ }, z.core.$strip>, z.ZodObject<{
1509
+ outcome: z.ZodLiteral<"runner-unreachable">;
1510
+ }, z.core.$strip>, z.ZodObject<{
1511
+ outcome: z.ZodLiteral<"runner-target-mismatch">;
1512
+ requiredRunnerName: z.ZodEnum<{
1513
+ node20Basic: "node20Basic";
1514
+ node20WithAndroid: "node20WithAndroid";
1515
+ node20WithIos: "node20WithIos";
1516
+ node20WithPlaywright: "node20WithPlaywright";
1517
+ }>;
1518
+ runnerName: z.ZodEnum<{
1519
+ node20Basic: "node20Basic";
1520
+ node20WithAndroid: "node20WithAndroid";
1521
+ node20WithIos: "node20WithIos";
1522
+ node20WithPlaywright: "node20WithPlaywright";
1523
+ }>;
1524
+ }, z.core.$strip>], "outcome">;
1525
+ };
1526
+ stop: {
1527
+ 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.";
1528
+ readonly input: z.ZodObject<{
1529
+ id: z.ZodString;
1530
+ }, z.core.$strip>;
1531
+ readonly kind: "write";
1532
+ readonly name: "runner.stop";
1533
+ readonly output: z.ZodObject<{
1534
+ id: z.ZodString;
1535
+ outcome: z.ZodEnum<{
1536
+ stopped: "stopped";
1537
+ "not-running": "not-running";
1538
+ }>;
1539
+ }, z.core.$strip>;
1540
+ };
1541
+ };
1233
1542
  tag: {
1234
1543
  create: {
1235
1544
  readonly description: "Create a tag on the caller's team. Tags select flows in run.create.";