@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
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export declare const runnerNameSchema: z.ZodEnum<{
3
+ node20Basic: "node20Basic";
4
+ node20WithAndroid: "node20WithAndroid";
5
+ node20WithIos: "node20WithIos";
6
+ node20WithPlaywright: "node20WithPlaywright";
7
+ }>;
8
+ export type RunnerNameForPublicApi = z.infer<typeof runnerNameSchema>;
9
+ export declare const runnerIdSchema: z.ZodString;
10
+ /** The shared interactive runner shape. */
11
+ export declare const makeRunnerSchema: () => z.ZodObject<{
12
+ gpuAccelerated: z.ZodBoolean;
13
+ id: z.ZodString;
14
+ runnerName: z.ZodEnum<{
15
+ node20Basic: "node20Basic";
16
+ node20WithAndroid: "node20WithAndroid";
17
+ node20WithIos: "node20WithIos";
18
+ node20WithPlaywright: "node20WithPlaywright";
19
+ }>;
20
+ }, z.core.$strip>;
21
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;EAK3B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE,eAAO,MAAM,cAAc,aAOxB,CAAC;AAEJ,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB;;;;;;;;;iBAazB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export const runnerNameSchema = z.enum([
3
+ "node20Basic",
4
+ "node20WithAndroid",
5
+ "node20WithIos",
6
+ "node20WithPlaywright",
7
+ ]);
8
+ export const runnerIdSchema = z
9
+ .string()
10
+ .min(1)
11
+ .max(63)
12
+ .regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, "A runner id may contain only lowercase letters, digits and dashes, and must start and end with a letter or digit.");
13
+ /** The shared interactive runner shape. */
14
+ export const makeRunnerSchema = () => z.object({
15
+ gpuAccelerated: z
16
+ .boolean()
17
+ .describe("Whether the runner was placed on GPU hardware. Chosen by QA Wolf from the team's configuration and what the fleet can provide, not requested."),
18
+ id: runnerIdSchema.describe("The runner's id, as supplied when launching it."),
19
+ runnerName: runnerNameSchema.describe("The image requested when the runner was launched. QA Wolf may place it on faster hardware, reported in gpuAccelerated."),
20
+ });
21
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/v1/runner/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,aAAa;IACb,mBAAmB;IACnB,eAAe;IACf,sBAAsB;CACvB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,iCAAiC,EACjC,mHAAmH,CACpH,CAAC;AAEJ,2CAA2C;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,CAAC,CAAC,MAAM,CAAC;IACP,cAAc,EAAE,CAAC;SACd,OAAO,EAAE;SACT,QAAQ,CACP,+IAA+I,CAChJ;IACH,EAAE,EAAE,cAAc,CAAC,QAAQ,CACzB,iDAAiD,CAClD;IACD,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CACnC,wHAAwH,CACzH;CACF,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ export declare const makeLaunchRunnerContract: () => {
3
+ 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.";
4
+ readonly input: z.ZodObject<{
5
+ id: z.ZodString;
6
+ runnerName: z.ZodOptional<z.ZodEnum<{
7
+ node20Basic: "node20Basic";
8
+ node20WithAndroid: "node20WithAndroid";
9
+ node20WithIos: "node20WithIos";
10
+ node20WithPlaywright: "node20WithPlaywright";
11
+ }>>;
12
+ }, z.core.$strip>;
13
+ readonly kind: "write";
14
+ readonly name: "runner.launch";
15
+ readonly output: z.ZodObject<{
16
+ gpuAccelerated: z.ZodBoolean;
17
+ id: z.ZodString;
18
+ runnerName: z.ZodEnum<{
19
+ node20Basic: "node20Basic";
20
+ node20WithAndroid: "node20WithAndroid";
21
+ node20WithIos: "node20WithIos";
22
+ node20WithPlaywright: "node20WithPlaywright";
23
+ }>;
24
+ outcome: z.ZodEnum<{
25
+ launched: "launched";
26
+ "already-running": "already-running";
27
+ }>;
28
+ }, z.core.$strip>;
29
+ };
30
+ export declare const makeStopRunnerContract: () => {
31
+ 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.";
32
+ readonly input: z.ZodObject<{
33
+ id: z.ZodString;
34
+ }, z.core.$strip>;
35
+ readonly kind: "write";
36
+ readonly name: "runner.stop";
37
+ readonly output: z.ZodObject<{
38
+ id: z.ZodString;
39
+ outcome: z.ZodEnum<{
40
+ stopped: "stopped";
41
+ "not-running": "not-running";
42
+ }>;
43
+ }, z.core.$strip>;
44
+ };
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCpC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;CA0BlC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ import { makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./identity.js";
3
+ export const makeLaunchRunnerContract = () => {
4
+ const input = z.object({
5
+ id: runnerIdSchema.describe("Id to launch the runner under, chosen by the caller. Launching the same id again returns the runner already running under it."),
6
+ runnerName: runnerNameSchema
7
+ .optional()
8
+ .describe("Image to run. Defaults to the standard web image, node20WithPlaywright."),
9
+ });
10
+ const output = makeRunnerSchema().extend({
11
+ outcome: z
12
+ .enum(["launched", "already-running"])
13
+ .describe("`launched` if this call started the runner. `already-running` if a runner was already running under this id and was returned unchanged — no second runner was started."),
14
+ });
15
+ return {
16
+ 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.",
17
+ input,
18
+ kind: "write",
19
+ name: "runner.launch",
20
+ output,
21
+ };
22
+ };
23
+ export const makeStopRunnerContract = () => {
24
+ const input = z.object({
25
+ id: runnerIdSchema.describe("Id of the runner to stop."),
26
+ });
27
+ const output = z.object({
28
+ id: runnerIdSchema.describe("Id of the runner the call addressed."),
29
+ outcome: z
30
+ .enum(["stopped", "not-running"])
31
+ .describe("`stopped` if the runner was running and has been stopped. `not-running` if no running runner has this id — it was already stopped, was never launched, or terminated on its own after inactivity; these are not distinguished, because the run system keeps no record of a runner once it is gone."),
32
+ });
33
+ return {
34
+ 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.",
35
+ input,
36
+ kind: "write",
37
+ name: "runner.stop",
38
+ output,
39
+ };
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/runner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CACzB,+HAA+H,CAChI;QACD,UAAU,EAAE,gBAAgB;aACzB,QAAQ,EAAE;aACV,QAAQ,CACP,yEAAyE,CAC1E;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,CAAC;aACP,IAAI,CAAC,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;aACrC,QAAQ,CACP,wKAAwK,CACzK;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,8aAA8a;QAChb,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,eAAe;QACrB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,2BAA2B,CAAC;KACzD,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACnE,OAAO,EAAE,CAAC;aACP,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;aAChC,QAAQ,CACP,oSAAoS,CACrS;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,kKAAkK;QACpK,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The wire shapes of a runner's journal: what a read asks for and what it
4
+ * answers with. One definition serves the writer, the server and the client,
5
+ * so an entry cannot come to mean different things along the way.
6
+ */
7
+ /** One appended line in one stream's NDJSON file. */
8
+ export type JournalEntry<Payload> = {
9
+ payload: Payload;
10
+ /** Wall clock at append, ISO 8601 in UTC. */
11
+ recordedAt: string;
12
+ /** Monotonic per stream, starting at 1; the read cursor. */
13
+ sequence: number;
14
+ };
15
+ /**
16
+ * zod treats an `unknown` field as an optional key, so without the refinement a
17
+ * line missing `payload` would parse to an entry whose payload is undefined
18
+ * under a type promising one.
19
+ */
20
+ export declare const journalEntrySchema: z.ZodPipe<z.ZodObject<{
21
+ payload: z.ZodUnknown;
22
+ recordedAt: z.ZodISODateTime;
23
+ sequence: z.ZodNumber;
24
+ }, z.core.$strip>, z.ZodTransform<JournalEntry<unknown>, {
25
+ payload: unknown;
26
+ recordedAt: string;
27
+ sequence: number;
28
+ }>>;
29
+ export declare const knownJournalStreams: readonly ["console", "recorder", "run-events", "run-logs", "run-status"];
30
+ export type KnownJournalStream = (typeof knownJournalStreams)[number];
31
+ /**
32
+ * An open set, so a later change can add a stream without breaking consumers;
33
+ * the `string & {}` arm keeps the known names as completions. An unwritten
34
+ * stream reads as empty, never as an error.
35
+ */
36
+ export type JournalStream = KnownJournalStream | (string & {});
37
+ /**
38
+ * A stream name doubles as a directory name under the journal root, so it is
39
+ * bounded in shape and length: outside this, a name could address a path
40
+ * outside the journal or fail at the filesystem with ENAMETOOLONG.
41
+ */
42
+ export declare const maxJournalStreamNameLength = 64;
43
+ export declare const journalStreamSchema: z.ZodString;
44
+ /**
45
+ * A wire type, so the filters are optional fields rather than our usual
46
+ * `| undefined`: JSON has no undefined, and omission is the only way a client
47
+ * can not-supply one.
48
+ *
49
+ * The filters compose in one order: `runId` restricts, `sinceSequence` cuts
50
+ * strictly-after, `tail` keeps the newest N of what remains. With neither
51
+ * `sinceSequence` nor `tail`, the read starts from the oldest available entry.
52
+ */
53
+ export type ReadJournalRequest = {
54
+ /** Restrict run-scoped streams (run-events, run-logs, run-status) to one run. */
55
+ runId?: string;
56
+ /** Entries strictly after this sequence. Omitted: from the oldest available. */
57
+ sinceSequence?: number;
58
+ stream: JournalStream;
59
+ /** Keep only the newest N of whatever the other filters matched. */
60
+ tail?: number;
61
+ };
62
+ /** `runId` is compared against every scanned entry, so it is bounded. */
63
+ export declare const readJournalRequestSchema: z.ZodObject<{
64
+ runId: z.ZodOptional<z.ZodString>;
65
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
66
+ stream: z.ZodString;
67
+ tail: z.ZodOptional<z.ZodNumber>;
68
+ }, z.core.$strip>;
69
+ export type ReadJournalResponse = {
70
+ /** Exactly what {@link readJournalResponseSchema} parses to, so not readonly. */
71
+ entries: JournalEntry<unknown>[];
72
+ /**
73
+ * True when a `tail` read stopped at its scan budget with older history it
74
+ * never looked at: page forwards with `sinceSequence`, or narrow the filters.
75
+ * False means everything matching the request is in `entries`. Never set by
76
+ * the response's own entry cap, which `nextSequence` already reports.
77
+ */
78
+ hasUnsearchedHistory: boolean;
79
+ /**
80
+ * The cursor to continue from: the highest sequence this read examined, so a
81
+ * filtered read that matched nothing still advances.
82
+ */
83
+ nextSequence: number;
84
+ /**
85
+ * The oldest sequence still on disk, or 0 when the stream holds nothing. A
86
+ * `sinceSequence` below this means the size cap truncated history away.
87
+ */
88
+ oldestAvailableSequence: number;
89
+ };
90
+ export declare const readJournalResponseSchema: z.ZodObject<{
91
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
92
+ payload: z.ZodUnknown;
93
+ recordedAt: z.ZodISODateTime;
94
+ sequence: z.ZodNumber;
95
+ }, z.core.$strip>, z.ZodTransform<JournalEntry<unknown>, {
96
+ payload: unknown;
97
+ recordedAt: string;
98
+ sequence: number;
99
+ }>>>;
100
+ hasUnsearchedHistory: z.ZodBoolean;
101
+ nextSequence: z.ZodNumber;
102
+ oldestAvailableSequence: z.ZodNumber;
103
+ }, z.core.$strip>;
104
+ //# sourceMappingURL=journal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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,MAAM,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAKK,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * zod treats an `unknown` field as an optional key, so without the refinement a
4
+ * line missing `payload` would parse to an entry whose payload is undefined
5
+ * under a type promising one.
6
+ */
7
+ export const journalEntrySchema = z
8
+ .object({
9
+ payload: z.unknown(),
10
+ recordedAt: z.iso.datetime(),
11
+ sequence: z.number().int().positive(),
12
+ })
13
+ .refine((entry) => "payload" in entry, {
14
+ error: "A journal entry must carry a payload key.",
15
+ path: ["payload"],
16
+ })
17
+ .transform((entry) => ({
18
+ payload: entry.payload,
19
+ recordedAt: entry.recordedAt,
20
+ sequence: entry.sequence,
21
+ }));
22
+ export const knownJournalStreams = [
23
+ "console",
24
+ "recorder",
25
+ "run-events",
26
+ "run-logs",
27
+ "run-status",
28
+ ];
29
+ /**
30
+ * A stream name doubles as a directory name under the journal root, so it is
31
+ * bounded in shape and length: outside this, a name could address a path
32
+ * outside the journal or fail at the filesystem with ENAMETOOLONG.
33
+ */
34
+ export const maxJournalStreamNameLength = 64;
35
+ export const journalStreamSchema = z
36
+ .string()
37
+ .max(maxJournalStreamNameLength)
38
+ .regex(/^[a-z][a-z0-9-]{0,63}$/);
39
+ /** `runId` is compared against every scanned entry, so it is bounded. */
40
+ export const readJournalRequestSchema = z.object({
41
+ runId: z.string().min(1).max(128).optional(),
42
+ sinceSequence: z.number().int().nonnegative().optional(),
43
+ stream: journalStreamSchema,
44
+ tail: z.number().int().positive().optional(),
45
+ });
46
+ export const readJournalResponseSchema = z.object({
47
+ entries: z.array(journalEntrySchema),
48
+ hasUnsearchedHistory: z.boolean(),
49
+ nextSequence: z.number().int().nonnegative(),
50
+ oldestAvailableSequence: z.number().int().nonnegative(),
51
+ });
52
+ //# sourceMappingURL=journal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../src/v1/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AC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACxD,MAAM,EAAE,mBAAmB;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAyC,CAAC;AAwB3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACpC,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACxD,CAA0C,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * How much file content one request may carry, counted as UTF-8 bytes of every
4
+ * path and content. A bound on content rather than on the encoded request,
5
+ * because it is the half a client can apply while collecting — escaping can
6
+ * inflate the encoding severalfold, which
7
+ * {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
8
+ */
9
+ export declare const maxRunFilesByteLength: number;
10
+ /**
11
+ * The largest request, JSON-encoded, that may be sent to a runner. Checked
12
+ * against the fully assembled request, so an oversized one is refused with a
13
+ * reason rather than failing opaquely in transport.
14
+ */
15
+ export declare const maxRunnerRequestEncodedByteLength: number;
16
+ /** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
17
+ export declare function runFilesByteLength(files: RunFiles): number;
18
+ /**
19
+ * The files of one request, keyed by path: each path shippable, and all of the
20
+ * contents together inside the content cap. A record rather than an array of
21
+ * `{ path, content }` pairs: duplicates become unrepresentable, and the CLI can
22
+ * derive a flag from a record of strings but not from an array of objects.
23
+ */
24
+ export declare const runFilesSchema: z.ZodRecord<z.ZodString, z.ZodString>;
25
+ /** Every file of one request, keyed by its path. */
26
+ export type RunFiles = Record<string, string>;
27
+ //# sourceMappingURL=payloadSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payloadSize.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAkB,CAAC;AAEjE,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAM1D;AAOD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uCAgBvB,CAAC;AAEL,oDAAoD;AACpD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ import { isShippableRunFilePath, runFilePathRefusal } from "./files.js";
3
+ /**
4
+ * How much file content one request may carry, counted as UTF-8 bytes of every
5
+ * path and content. A bound on content rather than on the encoded request,
6
+ * because it is the half a client can apply while collecting — escaping can
7
+ * inflate the encoding severalfold, which
8
+ * {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
9
+ */
10
+ export const maxRunFilesByteLength = 4 * 1024 * 1024;
11
+ /**
12
+ * The largest request, JSON-encoded, that may be sent to a runner. Checked
13
+ * against the fully assembled request, so an oversized one is refused with a
14
+ * reason rather than failing opaquely in transport.
15
+ */
16
+ export const maxRunnerRequestEncodedByteLength = 9 * 1024 * 1024;
17
+ /** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
18
+ export function runFilesByteLength(files) {
19
+ return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength(content) + utf8ByteLength(path), 0);
20
+ }
21
+ /** UTF-8 byte counts, so a non-Latin project is not undercounted severalfold. */
22
+ function utf8ByteLength(text) {
23
+ return Buffer.byteLength(text, "utf8");
24
+ }
25
+ /**
26
+ * The files of one request, keyed by path: each path shippable, and all of the
27
+ * contents together inside the content cap. A record rather than an array of
28
+ * `{ path, content }` pairs: duplicates become unrepresentable, and the CLI can
29
+ * derive a flag from a record of strings but not from an array of objects.
30
+ */
31
+ export const runFilesSchema = z
32
+ .record(z.string(), z.string())
33
+ // As a refinement, not a key schema: a key schema's message reaches the
34
+ // caller as a bare "invalid key in record".
35
+ .superRefine((files, refinementContext) => {
36
+ for (const path of Object.keys(files)) {
37
+ if (isShippableRunFilePath(path))
38
+ continue;
39
+ refinementContext.addIssue({
40
+ code: "custom",
41
+ message: runFilePathRefusal,
42
+ path: [path],
43
+ });
44
+ }
45
+ })
46
+ .refine((files) => runFilesByteLength(files) <= maxRunFilesByteLength, {
47
+ error: `The files in one request may carry at most ${maxRunFilesByteLength} bytes in total.`,
48
+ });
49
+ //# sourceMappingURL=payloadSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payloadSize.js","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE,0FAA0F;AAC1F,MAAM,UAAU,kBAAkB,CAAC,KAAe;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CACjC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CACzB,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,EACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,wEAAwE;IACxE,4CAA4C;KAC3C,WAAW,CAAC,CAAC,KAAK,EAAE,iBAAiB,EAAE,EAAE;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,IAAI,sBAAsB,CAAC,IAAI,CAAC;YAAE,SAAS;QAC3C,iBAAiB,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kBAAkB;YAC3B,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,qBAAqB,EAAE;IACrE,KAAK,EAAE,8CAA8C,qBAAqB,kBAAkB;CAC7F,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ /** How much of a failure reason this API passes on. */
3
+ export declare const maxActionErrorMessageLength = 1000;
4
+ export declare const makePerformActionOnRunnerContract: () => {
5
+ readonly description: "Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as `runner.takeScreenshot`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus `screenshot` (use `runner.takeScreenshot`) and `wait` (delay on the caller's side). `performed` if the action took effect. `action-failed`, with a reason, if it reached the runner and did not take effect. `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.";
6
+ readonly input: z.ZodObject<{
7
+ action: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
9
+ type: z.ZodLiteral<"click">;
10
+ x: z.ZodInt;
11
+ y: z.ZodInt;
12
+ }, z.core.$strict>, z.ZodObject<{
13
+ type: z.ZodLiteral<"double_click">;
14
+ x: z.ZodInt;
15
+ y: z.ZodInt;
16
+ }, z.core.$strict>, z.ZodObject<{
17
+ scroll_x: z.ZodInt;
18
+ scroll_y: z.ZodInt;
19
+ type: z.ZodLiteral<"scroll">;
20
+ x: z.ZodInt;
21
+ y: z.ZodInt;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ type: z.ZodLiteral<"move">;
24
+ x: z.ZodInt;
25
+ y: z.ZodInt;
26
+ }, z.core.$strict>, z.ZodObject<{
27
+ path: z.ZodArray<z.ZodObject<{
28
+ x: z.ZodInt;
29
+ y: z.ZodInt;
30
+ }, z.core.$strict>>;
31
+ type: z.ZodLiteral<"drag">;
32
+ }, z.core.$strict>, z.ZodObject<{
33
+ keys: z.ZodArray<z.ZodString>;
34
+ type: z.ZodLiteral<"keypress">;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ type: z.ZodLiteral<"navigate">;
37
+ url: z.ZodURL;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ text: z.ZodString;
40
+ type: z.ZodLiteral<"type">;
41
+ }, z.core.$strict>], "type">;
42
+ id: z.ZodString;
43
+ }, z.core.$strip>;
44
+ readonly kind: "write";
45
+ readonly name: "runner.performAction";
46
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
+ outcome: z.ZodLiteral<"performed">;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ errorMessage: z.ZodString;
50
+ outcome: z.ZodLiteral<"action-failed">;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ outcome: z.ZodLiteral<"screen-needs-a-run">;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ outcome: z.ZodLiteral<"screen-not-ready">;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ outcome: z.ZodLiteral<"runner-has-no-screen">;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ outcome: z.ZodLiteral<"runner-unreachable">;
59
+ }, z.core.$strip>], "outcome">;
60
+ };
61
+ //# sourceMappingURL=performAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performAction.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC7C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { browserActionSchema } from "./browserAction.js";
3
+ import { runnerIdSchema } from "./identity.js";
4
+ import { runnerHasNoScreenDescription, runnerHasNoScreenSchema, runnerScreenNeedsARunSchema, runnerScreenNotReadySchema, screenNeedsARunDescription, screenNotReadyDescription, } from "./screen.js";
5
+ import { runnerUnreachableSchema } from "./unreachable.js";
6
+ // Not the shared retryable wording: the action may have taken effect before its
7
+ // answer was lost.
8
+ const unreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
9
+ /** How much of a failure reason this API passes on. */
10
+ export const maxActionErrorMessageLength = 1_000;
11
+ export const makePerformActionOnRunnerContract = () => {
12
+ const input = z.object({
13
+ action: browserActionSchema.describe("The action to perform. Coordinates are pixels on the screenshot's own coordinate space."),
14
+ id: runnerIdSchema.describe("Id of the runner to act on."),
15
+ });
16
+ const output = z.discriminatedUnion("outcome", [
17
+ z.object({ outcome: z.literal("performed") }),
18
+ z.object({
19
+ errorMessage: z
20
+ .string()
21
+ .max(maxActionErrorMessageLength)
22
+ .describe("What stopped the action from taking effect."),
23
+ outcome: z.literal("action-failed"),
24
+ }),
25
+ runnerScreenNeedsARunSchema,
26
+ runnerScreenNotReadySchema,
27
+ runnerHasNoScreenSchema,
28
+ runnerUnreachableSchema,
29
+ ]);
30
+ return {
31
+ description: `Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). \`performed\` if the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. ${screenNeedsARunDescription} ${screenNotReadyDescription} 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\`. ${runnerHasNoScreenDescription} ${unreachableDescription}`,
32
+ input,
33
+ kind: "write",
34
+ name: "runner.performAction",
35
+ output,
36
+ };
37
+ };
38
+ //# sourceMappingURL=performAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performAction.js","sourceRo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BAAgkB,0BAA0B,IAAI,yBAAyB,yOAAyO,4BAA4B,IAAI,sBAAsB,EAAE;QACr6B,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ export declare const makeReadRunnerJournalContract: () => {
3
+ 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.";
4
+ readonly input: z.ZodObject<{
5
+ runId: z.ZodOptional<z.ZodString>;
6
+ sinceSequence: z.ZodOptional<z.ZodNumber>;
7
+ tail: z.ZodOptional<z.ZodNumber>;
8
+ id: z.ZodString;
9
+ stream: z.ZodString;
10
+ }, z.core.$strip>;
11
+ readonly kind: "read";
12
+ readonly name: "runner.readJournal";
13
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
15
+ payload: z.ZodUnknown;
16
+ recordedAt: z.ZodISODateTime;
17
+ sequence: z.ZodNumber;
18
+ }, z.core.$strip>, z.ZodTransform<import("./journal.js").JournalEntry<unknown>, {
19
+ payload: unknown;
20
+ recordedAt: string;
21
+ sequence: number;
22
+ }>>>;
23
+ hasUnsearchedHistory: z.ZodBoolean;
24
+ nextSequence: z.ZodNumber;
25
+ oldestAvailableSequence: z.ZodNumber;
26
+ outcome: z.ZodLiteral<"read">;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ outcome: z.ZodLiteral<"runner-unreachable">;
29
+ }, z.core.$strip>], "outcome">;
30
+ };
31
+ //# sourceMappingURL=readJournal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readJournal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { runnerIdSchema } from "./identity.js";
3
+ import { journalStreamSchema, knownJournalStreams, readJournalRequestSchema, readJournalResponseSchema, } from "./journal.js";
4
+ import { retryableRunnerUnreachableDescription, runnerUnreachableSchema, } from "./unreachable.js";
5
+ export const makeReadRunnerJournalContract = () => {
6
+ const input = readJournalRequestSchema.extend({
7
+ id: runnerIdSchema.describe("Id of the runner to read the journal of."),
8
+ stream: journalStreamSchema.describe(`The stream to read. QA Wolf writes ${knownJournalStreams.join(", ")}; an unwritten stream reads as empty rather than as an error.`),
9
+ });
10
+ const output = z.discriminatedUnion("outcome", [
11
+ readJournalResponseSchema.extend({ outcome: z.literal("read") }),
12
+ runnerUnreachableSchema,
13
+ ]);
14
+ return {
15
+ description: `Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: \`run-status\` settles it, \`run-logs\` and \`run-events\` carry what it produced, and \`recorder\` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. ${retryableRunnerUnreachableDescription}`,
16
+ input,
17
+ kind: "read",
18
+ name: "runner.readJournal",
19
+ output,
20
+ };
21
+ };
22
+ //# sourceMappingURL=readJournal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readJournal.js","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,MAAM,KAAK,GAAG,wBAAwB,CAAC,MAAM,CAAC;QAC5C,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACvE,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAClC,sCAAsC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,+DAA+D,CACpI;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,yBAAyB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,uBAAuB;KACxB,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,wcAAwc,qCAAqC,EAAE;QAC5f,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const makeRunFlowOnRunnerContract: () => {
3
+ readonly description: "Run a flow on an interactive runner. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call answers `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
4
+ readonly input: z.ZodObject<{
5
+ entryPointPath: z.ZodString;
6
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
7
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
8
+ id: z.ZodString;
9
+ }, z.core.$strip>;
10
+ readonly kind: "write";
11
+ readonly name: "runner.runFlow";
12
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ outcome: z.ZodLiteral<"submitted">;
14
+ runId: z.ZodString;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ outcome: z.ZodLiteral<"runner-unreachable">;
17
+ }, z.core.$strip>, z.ZodObject<{
18
+ outcome: z.ZodLiteral<"runner-target-mismatch">;
19
+ requiredRunnerName: z.ZodEnum<{
20
+ node20Basic: "node20Basic";
21
+ node20WithAndroid: "node20WithAndroid";
22
+ node20WithIos: "node20WithIos";
23
+ node20WithPlaywright: "node20WithPlaywright";
24
+ }>;
25
+ runnerName: z.ZodEnum<{
26
+ node20Basic: "node20Basic";
27
+ node20WithAndroid: "node20WithAndroid";
28
+ node20WithIos: "node20WithIos";
29
+ node20WithPlaywright: "node20WithPlaywright";
30
+ }>;
31
+ }, z.core.$strip>], "outcome">;
32
+ };
33
+ //# sourceMappingURL=runFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvC,CAAC"}