@qawolf/api-contracts 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1/index.d.ts +394 -124
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +12 -2
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/issue/addFlows.d.ts +55 -0
- package/dist/v1/issue/addFlows.d.ts.map +1 -0
- package/dist/v1/issue/addFlows.js +27 -0
- package/dist/v1/issue/addFlows.js.map +1 -0
- package/dist/v1/issue/create.d.ts +1 -0
- package/dist/v1/issue/create.d.ts.map +1 -1
- package/dist/v1/issue/index.d.ts +3 -0
- package/dist/v1/issue/index.d.ts.map +1 -1
- package/dist/v1/issue/index.js +3 -0
- package/dist/v1/issue/index.js.map +1 -1
- package/dist/v1/issue/update.d.ts +1 -0
- package/dist/v1/issue/update.d.ts.map +1 -1
- package/dist/v1/runner/environment.d.ts.map +1 -1
- package/dist/v1/runner/environment.js +11 -8
- package/dist/v1/runner/environment.js.map +1 -1
- package/dist/v1/runner/evaluateSnippet.d.ts +5 -2
- package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -1
- package/dist/v1/runner/evaluateSnippet.js +4 -3
- package/dist/v1/runner/evaluateSnippet.js.map +1 -1
- package/dist/v1/runner/identity.d.ts +8 -8
- package/dist/v1/runner/identity.js +5 -5
- package/dist/v1/runner/identity.js.map +1 -1
- package/dist/v1/runner/importPackage.d.ts +23 -0
- package/dist/v1/runner/importPackage.d.ts.map +1 -0
- package/dist/v1/runner/importPackage.js +33 -0
- package/dist/v1/runner/importPackage.js.map +1 -0
- package/dist/v1/runner/index.d.ts +16 -20
- package/dist/v1/runner/index.d.ts.map +1 -1
- package/dist/v1/runner/index.js +14 -12
- package/dist/v1/runner/index.js.map +1 -1
- package/dist/v1/runner/inspect.d.ts +42 -0
- package/dist/v1/runner/inspect.d.ts.map +1 -0
- package/dist/v1/runner/inspect.js +61 -0
- package/dist/v1/runner/inspect.js.map +1 -0
- package/dist/v1/runner/outcome.d.ts +6 -0
- package/dist/v1/runner/outcome.d.ts.map +1 -0
- package/dist/v1/runner/outcome.js +8 -0
- package/dist/v1/runner/outcome.js.map +1 -0
- package/dist/v1/runner/payloadSize.d.ts +6 -0
- package/dist/v1/runner/payloadSize.d.ts.map +1 -1
- package/dist/v1/runner/payloadSize.js +8 -2
- package/dist/v1/runner/payloadSize.js.map +1 -1
- package/dist/v1/runner/performAction.d.ts +13 -12
- package/dist/v1/runner/performAction.d.ts.map +1 -1
- package/dist/v1/runner/performAction.js +17 -10
- package/dist/v1/runner/performAction.js.map +1 -1
- package/dist/v1/runner/readJournal.d.ts +5 -2
- package/dist/v1/runner/readJournal.d.ts.map +1 -1
- package/dist/v1/runner/readJournal.js +4 -3
- package/dist/v1/runner/readJournal.js.map +1 -1
- package/dist/v1/runner/runFlow.d.ts +28 -15
- package/dist/v1/runner/runFlow.d.ts.map +1 -1
- package/dist/v1/runner/runFlow.js +56 -10
- package/dist/v1/runner/runFlow.js.map +1 -1
- package/dist/v1/runner/runSelection.d.ts +8 -0
- package/dist/v1/runner/runSelection.d.ts.map +1 -0
- package/dist/v1/runner/runSelection.js +19 -0
- package/dist/v1/runner/runSelection.js.map +1 -0
- package/dist/v1/runner/screen.d.ts +3 -12
- package/dist/v1/runner/screen.d.ts.map +1 -1
- package/dist/v1/runner/screen.js +8 -13
- package/dist/v1/runner/screen.js.map +1 -1
- package/dist/v1/runner/stopRun.d.ts +19 -0
- package/dist/v1/runner/stopRun.d.ts.map +1 -0
- package/dist/v1/runner/stopRun.js +26 -0
- package/dist/v1/runner/stopRun.js.map +1 -0
- package/dist/v1/runner/takeScreenshot.d.ts +9 -9
- package/dist/v1/runner/takeScreenshot.d.ts.map +1 -1
- package/dist/v1/runner/takeScreenshot.js +8 -7
- package/dist/v1/runner/takeScreenshot.js.map +1 -1
- package/dist/v1/runner/unreachable.d.ts +4 -7
- package/dist/v1/runner/unreachable.d.ts.map +1 -1
- package/dist/v1/runner/unreachable.js +4 -7
- package/dist/v1/runner/unreachable.js.map +1 -1
- package/package.json +1 -1
package/dist/v1/runner/index.js
CHANGED
|
@@ -5,36 +5,38 @@ export const makeLaunchRunnerContract = () => {
|
|
|
5
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
6
|
runnerName: runnerNameSchema
|
|
7
7
|
.optional()
|
|
8
|
-
.describe("
|
|
8
|
+
.describe("The runner family to launch. Defaults to the standard web family, playwright."),
|
|
9
9
|
});
|
|
10
10
|
const output = makeRunnerSchema().extend({
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
.describe("
|
|
11
|
+
alreadyRunning: z
|
|
12
|
+
.boolean()
|
|
13
|
+
.describe("True when a runner was already running under this id and was returned unchanged, so no second runner was started and nothing new is billed. Not an error either way."),
|
|
14
|
+
outcome: z.literal("success"),
|
|
14
15
|
});
|
|
15
16
|
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 `
|
|
17
|
+
description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `alreadyRunning` to tell which happened.",
|
|
17
18
|
input,
|
|
18
19
|
kind: "write",
|
|
19
20
|
name: "runner.launch",
|
|
20
21
|
output,
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
|
-
export const
|
|
24
|
+
export const makeTerminateRunnerContract = () => {
|
|
24
25
|
const input = z.object({
|
|
25
|
-
id: runnerIdSchema.describe("Id of the runner to
|
|
26
|
+
id: runnerIdSchema.describe("Id of the runner to terminate."),
|
|
26
27
|
});
|
|
27
28
|
const output = z.object({
|
|
28
29
|
id: runnerIdSchema.describe("Id of the runner the call addressed."),
|
|
29
|
-
outcome: z
|
|
30
|
-
|
|
31
|
-
.
|
|
30
|
+
outcome: z.literal("success"),
|
|
31
|
+
wasRunning: z
|
|
32
|
+
.boolean()
|
|
33
|
+
.describe("False when no running runner had this id: it was already terminated, 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. Not an error, and a retry needs no special handling."),
|
|
32
34
|
});
|
|
33
35
|
return {
|
|
34
|
-
description: "
|
|
36
|
+
description: "End an interactive runner on the caller's team, and the pod it runs on with it. Terminating a runner that is not running succeeds and reports `wasRunning: false`. This ends the runner: use `runner.stopRun` to stop what a runner is currently executing while leaving the runner up.",
|
|
35
37
|
input,
|
|
36
38
|
kind: "write",
|
|
37
|
-
name: "runner.
|
|
39
|
+
name: "runner.terminate",
|
|
38
40
|
output,
|
|
39
41
|
};
|
|
40
42
|
};
|
|
@@ -1 +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,
|
|
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,wB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.ZodObject<{
|
|
3
|
+
selector: z.ZodString;
|
|
4
|
+
what: z.ZodLiteral<"element-html">;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
7
|
+
what: z.ZodLiteral<"page-html">;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
variableName: z.ZodString;
|
|
10
|
+
what: z.ZodLiteral<"variable">;
|
|
11
|
+
}, z.core.$strip>], "what">;
|
|
12
|
+
export type InspectOnRunnerRequest = z.infer<typeof inspectRequestSchema>;
|
|
13
|
+
export declare const makeInspectOnRunnerContract: () => {
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly input: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
selector: z.ZodString;
|
|
19
|
+
what: z.ZodLiteral<"element-html">;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
22
|
+
what: z.ZodLiteral<"page-html">;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
variableName: z.ZodString;
|
|
25
|
+
what: z.ZodLiteral<"variable">;
|
|
26
|
+
}, z.core.$strip>], "what">;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
readonly kind: "read";
|
|
29
|
+
readonly name: "runner.inspect";
|
|
30
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
+
outcome: z.ZodLiteral<"success">;
|
|
32
|
+
value: z.ZodString;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
35
|
+
failureReason: z.ZodEnum<{
|
|
36
|
+
"runner-unreachable": "runner-unreachable";
|
|
37
|
+
"nothing-to-inspect": "nothing-to-inspect";
|
|
38
|
+
}>;
|
|
39
|
+
outcome: z.ZodLiteral<"failure">;
|
|
40
|
+
}, z.core.$strip>], "outcome">;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,oBAAoB;;;;;;;;;2BA0B/B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCvC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runnerIdSchema } from "./identity.js";
|
|
3
|
+
import { retryableRunnerUnreachableDescription } from "./unreachable.js";
|
|
4
|
+
const maxSelectorLength = 2_000;
|
|
5
|
+
const maxVariableNameLength = 256;
|
|
6
|
+
export const inspectRequestSchema = z.discriminatedUnion("what", [
|
|
7
|
+
z.object({
|
|
8
|
+
selector: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(maxSelectorLength)
|
|
12
|
+
.describe("Playwright selector for the element to inspect."),
|
|
13
|
+
what: z.literal("element-html"),
|
|
14
|
+
}),
|
|
15
|
+
z.object({
|
|
16
|
+
selector: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.max(maxSelectorLength)
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Inspect only this subtree. Omit to inspect the whole page."),
|
|
22
|
+
what: z.literal("page-html"),
|
|
23
|
+
}),
|
|
24
|
+
z.object({
|
|
25
|
+
variableName: z
|
|
26
|
+
.string()
|
|
27
|
+
.min(1)
|
|
28
|
+
.max(maxVariableNameLength)
|
|
29
|
+
.describe("Name of a top-level variable in the running workflow."),
|
|
30
|
+
what: z.literal("variable"),
|
|
31
|
+
}),
|
|
32
|
+
]);
|
|
33
|
+
export const makeInspectOnRunnerContract = () => {
|
|
34
|
+
const input = z.object({
|
|
35
|
+
id: runnerIdSchema.describe("Id of the runner to inspect."),
|
|
36
|
+
request: inspectRequestSchema,
|
|
37
|
+
});
|
|
38
|
+
const output = z.discriminatedUnion("outcome", [
|
|
39
|
+
z.object({
|
|
40
|
+
outcome: z.literal("success"),
|
|
41
|
+
value: z.string().describe("The HTML, or the variable's value as JSON."),
|
|
42
|
+
}),
|
|
43
|
+
z.object({
|
|
44
|
+
errorMessage: z
|
|
45
|
+
.string()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("What the runner said, when it said anything."),
|
|
48
|
+
failureReason: z.enum(["nothing-to-inspect", "runner-unreachable"]),
|
|
49
|
+
outcome: z.literal("failure"),
|
|
50
|
+
}),
|
|
51
|
+
]);
|
|
52
|
+
return {
|
|
53
|
+
description: "Inspect one thing on an interactive runner: an element's HTML, the page's HTML simplified for a model, or a top-level variable's value as JSON. `nothing-to-inspect` means the runner had nothing to answer with: no live page, no element matching the selector, or no variable under that name. A runner cannot tell those apart, so it reports the one reason and puts whatever it did say in `errorMessage`. " +
|
|
54
|
+
retryableRunnerUnreachableDescription,
|
|
55
|
+
input,
|
|
56
|
+
kind: "read",
|
|
57
|
+
name: "runner.inspect",
|
|
58
|
+
output,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=inspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/v1/runner/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,qCAAqC,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,iBAAiB,GAAG,KAAK,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AC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;SACzE,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,YAAY,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,8CAA8C,CAAC;YAC3D,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;YACnE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9B,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,mZAAmZ;YACnZ,qCAAqC;QACvC,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare function makeRunnerFailureSchema<const Reasons extends readonly [string, ...string[]]>(reasons: Reasons): z.ZodObject<{
|
|
3
|
+
failureReason: z.ZodEnum<{ [k_1 in Reasons[number]]: k_1; } extends infer T ? { [k in keyof T]: T[k]; } : never>;
|
|
4
|
+
outcome: z.ZodLiteral<"failure">;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
//# sourceMappingURL=outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAgB,uBAAuB,CACrC,KAAK,CAAC,OAAO,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EACpD,OAAO,EAAE,OAAO;;;kBAKjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../../src/v1/runner/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,uBAAuB,CAErC,OAAgB;IAChB,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -5,12 +5,18 @@ import { z } from "zod";
|
|
|
5
5
|
* because it is the half a client can apply while collecting — escaping can
|
|
6
6
|
* inflate the encoding severalfold, which
|
|
7
7
|
* {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
|
|
8
|
+
* The run payloads for Figma and other POM customers are currently still extremely large
|
|
9
|
+
* The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
|
|
10
|
+
* We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
|
|
8
11
|
*/
|
|
9
12
|
export declare const maxRunFilesByteLength: number;
|
|
10
13
|
/**
|
|
11
14
|
* The largest request, JSON-encoded, that may be sent to a runner. Checked
|
|
12
15
|
* against the fully assembled request, so an oversized one is refused with a
|
|
13
16
|
* reason rather than failing opaquely in transport.
|
|
17
|
+
* The run payloads for Figma and other POM customers are currently still extremely large
|
|
18
|
+
* The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
|
|
19
|
+
* We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
|
|
14
20
|
*/
|
|
15
21
|
export declare const maxRunnerRequestEncodedByteLength: number;
|
|
16
22
|
/** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
|
|
@@ -1 +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
|
|
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;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,QAAmB,CAAC;AAElE,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"}
|
|
@@ -6,14 +6,20 @@ import { isShippableRunFilePath, runFilePathRefusal } from "./files.js";
|
|
|
6
6
|
* because it is the half a client can apply while collecting — escaping can
|
|
7
7
|
* inflate the encoding severalfold, which
|
|
8
8
|
* {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
|
|
9
|
+
* The run payloads for Figma and other POM customers are currently still extremely large
|
|
10
|
+
* The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
|
|
11
|
+
* We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
|
|
9
12
|
*/
|
|
10
|
-
export const maxRunFilesByteLength =
|
|
13
|
+
export const maxRunFilesByteLength = 30 * 1024 * 1024;
|
|
11
14
|
/**
|
|
12
15
|
* The largest request, JSON-encoded, that may be sent to a runner. Checked
|
|
13
16
|
* against the fully assembled request, so an oversized one is refused with a
|
|
14
17
|
* reason rather than failing opaquely in transport.
|
|
18
|
+
* The run payloads for Figma and other POM customers are currently still extremely large
|
|
19
|
+
* The QA Wolf CLI Runner sends the run payload via an API and needs to send the files
|
|
20
|
+
* We can drop these back to 10MB once the POM teams have been optimized - NOVA-1626
|
|
15
21
|
*/
|
|
16
|
-
export const maxRunnerRequestEncodedByteLength =
|
|
22
|
+
export const maxRunnerRequestEncodedByteLength = 30 * 1024 * 1024;
|
|
17
23
|
/** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
|
|
18
24
|
export function runFilesByteLength(files) {
|
|
19
25
|
return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength(content) + utf8ByteLength(path), 0);
|
|
@@ -1 +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
|
|
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;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAElE,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"}
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
/** How much of a failure reason this API passes on. */
|
|
3
3
|
export declare const maxActionErrorMessageLength = 1000;
|
|
4
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).
|
|
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). A success means the action took effect. `action-failed`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no `runner.runFlow` is needed before acting; if the browser is still starting when the wait runs out, the answer is `screen-not-ready` and retrying converges. `screen-needs-a-run` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call `runner.runFlow` with a flow that opens a browser. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. A `navigate` does not go through the screen, so a screen that is not ready does not stop it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `playwright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
|
|
6
6
|
readonly input: z.ZodObject<{
|
|
7
7
|
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
8
|
button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
|
|
@@ -44,18 +44,19 @@ export declare const makePerformActionOnRunnerContract: () => {
|
|
|
44
44
|
readonly kind: "write";
|
|
45
45
|
readonly name: "runner.performAction";
|
|
46
46
|
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
-
outcome: z.ZodLiteral<"
|
|
48
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
outcome: z.ZodLiteral<"success">;
|
|
48
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
49
|
errorMessage: z.ZodString;
|
|
50
|
-
|
|
51
|
-
|
|
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">;
|
|
50
|
+
failureReason: z.ZodLiteral<"action-failed">;
|
|
51
|
+
outcome: z.ZodLiteral<"failure">;
|
|
57
52
|
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
failureReason: z.ZodEnum<{
|
|
54
|
+
"runner-unreachable": "runner-unreachable";
|
|
55
|
+
"runner-has-no-screen": "runner-has-no-screen";
|
|
56
|
+
"screen-needs-a-run": "screen-needs-a-run";
|
|
57
|
+
"screen-not-ready": "screen-not-ready";
|
|
58
|
+
}>;
|
|
59
|
+
outcome: z.ZodLiteral<"failure">;
|
|
60
|
+
}, z.core.$strip>], "failureReason">], "outcome">;
|
|
60
61
|
};
|
|
61
62
|
//# sourceMappingURL=performAction.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"performAction.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,OAAQ,CAAC;AAEjD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C7C,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { browserActionSchema } from "./browserAction.js";
|
|
3
3
|
import { runnerIdSchema } from "./identity.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { makeRunnerFailureSchema } from "./outcome.js";
|
|
5
|
+
import { runnerHasNoScreenDescription, screenFailureReasons, screenNotReadyDescription, } from "./screen.js";
|
|
6
|
+
import { runnerUnreachableFailureReason } from "./unreachable.js";
|
|
6
7
|
// Not the shared retryable wording: the action may have taken effect before its
|
|
7
8
|
// answer was lost.
|
|
8
9
|
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.";
|
|
@@ -13,22 +14,28 @@ export const makePerformActionOnRunnerContract = () => {
|
|
|
13
14
|
action: browserActionSchema.describe("The action to perform. Coordinates are pixels on the screenshot's own coordinate space."),
|
|
14
15
|
id: runnerIdSchema.describe("Id of the runner to act on."),
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
// `action-failed` is the one reason that carries a message, so it is an arm of
|
|
18
|
+
// its own and the other reasons share theirs.
|
|
19
|
+
const failure = z.discriminatedUnion("failureReason", [
|
|
18
20
|
z.object({
|
|
19
21
|
errorMessage: z
|
|
20
22
|
.string()
|
|
21
23
|
.max(maxActionErrorMessageLength)
|
|
22
24
|
.describe("What stopped the action from taking effect."),
|
|
23
|
-
|
|
25
|
+
failureReason: z.literal("action-failed"),
|
|
26
|
+
outcome: z.literal("failure"),
|
|
24
27
|
}),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
makeRunnerFailureSchema([
|
|
29
|
+
...screenFailureReasons,
|
|
30
|
+
runnerUnreachableFailureReason,
|
|
31
|
+
]),
|
|
32
|
+
]);
|
|
33
|
+
const output = z.discriminatedUnion("outcome", [
|
|
34
|
+
z.object({ outcome: z.literal("success") }),
|
|
35
|
+
failure,
|
|
29
36
|
]);
|
|
30
37
|
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).
|
|
38
|
+
description: `Perform one raw browser action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. One action per request, and the runner serves one at a time. The action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). A success means the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no \`runner.runFlow\` is needed before acting; if the browser is still starting when the wait runs out, the answer is \`screen-not-ready\` and retrying converges. \`screen-needs-a-run\` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call \`runner.runFlow\` with a flow that opens a browser. ${screenNotReadyDescription} A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it. ${runnerHasNoScreenDescription} ${unreachableDescription}`,
|
|
32
39
|
input,
|
|
33
40
|
kind: "write",
|
|
34
41
|
name: "runner.performAction",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performAction.js","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"performAction.js","sourceRoot":"","sources":["../../../src/v1/runner/performAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,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KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -23,9 +23,12 @@ export declare const makeReadRunnerJournalContract: () => {
|
|
|
23
23
|
hasUnsearchedHistory: z.ZodBoolean;
|
|
24
24
|
nextSequence: z.ZodNumber;
|
|
25
25
|
oldestAvailableSequence: z.ZodNumber;
|
|
26
|
-
outcome: z.ZodLiteral<"
|
|
26
|
+
outcome: z.ZodLiteral<"success">;
|
|
27
27
|
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
|
|
28
|
+
failureReason: z.ZodEnum<{
|
|
29
|
+
"runner-unreachable": "runner-unreachable";
|
|
30
|
+
}>;
|
|
31
|
+
outcome: z.ZodLiteral<"failure">;
|
|
29
32
|
}, z.core.$strip>], "outcome">;
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=readJournal.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"readJournal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { runnerIdSchema } from "./identity.js";
|
|
3
3
|
import { journalStreamSchema, knownJournalStreams, readJournalRequestSchema, readJournalResponseSchema, } from "./journal.js";
|
|
4
|
-
import {
|
|
4
|
+
import { makeRunnerFailureSchema } from "./outcome.js";
|
|
5
|
+
import { retryableRunnerUnreachableDescription, runnerUnreachableFailureReason, } from "./unreachable.js";
|
|
5
6
|
export const makeReadRunnerJournalContract = () => {
|
|
6
7
|
const input = readJournalRequestSchema.extend({
|
|
7
8
|
id: runnerIdSchema.describe("Id of the runner to read the journal of."),
|
|
8
9
|
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
|
});
|
|
10
11
|
const output = z.discriminatedUnion("outcome", [
|
|
11
|
-
readJournalResponseSchema.extend({ outcome: z.literal("
|
|
12
|
-
|
|
12
|
+
readJournalResponseSchema.extend({ outcome: z.literal("success") }),
|
|
13
|
+
makeRunnerFailureSchema([runnerUnreachableFailureReason]),
|
|
13
14
|
]);
|
|
14
15
|
return {
|
|
15
16
|
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}`,
|
|
@@ -1 +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,
|
|
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,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAC/B,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,SAAS,CAAC,EAAE,CAAC;QACnE,uBAAuB,CAAC,CAAC,8BAA8B,CAAC,CAAC;KAC1D,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"}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
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
|
|
3
|
+
readonly description: "Run a flow on an interactive runner. When `selection` is given the lines run against the browser as it stands, so nothing is re-navigated and nothing is signed in again; without it the whole entry point runs from a fresh browser. A runner with no live browser starts one before a selection and says so with `bootstrappedRunner`, which means those lines ran against a fresh page rather than the one an earlier run left. A selection produces no `runStarted` event, so follow it by its run id on `run-status` like any other run. Send `unchangedFiles` to ship only what changed since an earlier run on this runner; a `needs-full-sync` failure names the paths it does not hold, and the way to recover is the same run again with every file in `files`. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call fails with `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
|
|
4
4
|
readonly input: z.ZodObject<{
|
|
5
5
|
entryPointPath: z.ZodString;
|
|
6
6
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
7
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8
8
|
id: z.ZodString;
|
|
9
|
+
selection: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
endLine: z.ZodInt;
|
|
11
|
+
path: z.ZodString;
|
|
12
|
+
startLine: z.ZodInt;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
unchangedFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
9
15
|
}, z.core.$strip>;
|
|
10
16
|
readonly kind: "write";
|
|
11
17
|
readonly name: "runner.runFlow";
|
|
12
18
|
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
-
|
|
19
|
+
bootstrappedRunner: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
outcome: z.ZodLiteral<"success">;
|
|
14
21
|
runId: z.ZodString;
|
|
15
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
outcome: z.ZodLiteral<"runner-target-mismatch">;
|
|
22
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
23
|
+
failureReason: z.ZodLiteral<"runner-target-mismatch">;
|
|
24
|
+
outcome: z.ZodLiteral<"failure">;
|
|
19
25
|
requiredRunnerName: z.ZodEnum<{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
basic: "basic";
|
|
27
|
+
playwright: "playwright";
|
|
28
|
+
android: "android";
|
|
29
|
+
ios: "ios";
|
|
24
30
|
}>;
|
|
25
31
|
runnerName: z.ZodEnum<{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
basic: "basic";
|
|
33
|
+
playwright: "playwright";
|
|
34
|
+
android: "android";
|
|
35
|
+
ios: "ios";
|
|
30
36
|
}>;
|
|
31
|
-
}, z.core.$strip
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
failureReason: z.ZodLiteral<"needs-full-sync">;
|
|
39
|
+
missingPaths: z.ZodArray<z.ZodString>;
|
|
40
|
+
outcome: z.ZodLiteral<"failure">;
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
failureReason: z.ZodLiteral<"runner-unreachable">;
|
|
43
|
+
outcome: z.ZodLiteral<"failure">;
|
|
44
|
+
}, z.core.$strip>], "failureReason">], "outcome">;
|
|
32
45
|
};
|
|
33
46
|
//# sourceMappingURL=runFlow.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GvC,CAAC"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { runEnvironmentSchema } from "./environment.js";
|
|
3
|
-
import { runFilePathSchema, runPackageJsonPath } from "./files.js";
|
|
3
|
+
import { isShippableRunFilePath, runFilePathRefusal, runFilePathSchema, runPackageJsonPath, } from "./files.js";
|
|
4
4
|
import { runnerIdSchema, runnerNameSchema } from "./identity.js";
|
|
5
5
|
import { runFilesSchema } from "./payloadSize.js";
|
|
6
|
-
import {
|
|
6
|
+
import { runSelectionSchema } from "./runSelection.js";
|
|
7
|
+
const unchangedFilesSchema = z
|
|
8
|
+
.record(z.string(), z.string().min(1))
|
|
9
|
+
.superRefine((hashes, refinementContext) => {
|
|
10
|
+
for (const path of Object.keys(hashes)) {
|
|
11
|
+
if (isShippableRunFilePath(path))
|
|
12
|
+
continue;
|
|
13
|
+
refinementContext.addIssue({
|
|
14
|
+
code: "custom",
|
|
15
|
+
message: runFilePathRefusal,
|
|
16
|
+
path: [path],
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
7
20
|
export const makeRunFlowOnRunnerContract = () => {
|
|
8
21
|
const input = z
|
|
9
22
|
.object({
|
|
@@ -13,6 +26,12 @@ export const makeRunFlowOnRunnerContract = () => {
|
|
|
13
26
|
.describe("Environment variables to make available to the run."),
|
|
14
27
|
files: runFilesSchema.describe("Every file the run needs keyed by its path — the flow file, everything it imports, package.json and tsconfig.json. A runner holds no copy of your project, so what runs is exactly what is sent here."),
|
|
15
28
|
id: runnerIdSchema.describe("Id of the runner to run the flow on."),
|
|
29
|
+
selection: runSelectionSchema
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Run only these lines, inside the page the runner is already on, instead of running the whole flow from a fresh browser. Omit to run the whole entry point."),
|
|
32
|
+
unchangedFiles: unchangedFilesSchema
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Files this runner already holds from an earlier run, keyed by path with a hex SHA-256 of the content it should hold. Send this to make `files` only what changed. The runner refuses with `needs-full-sync` if it holds none of a referenced path, so it never runs something other than what was asked for. Omit it to send every file."),
|
|
16
35
|
})
|
|
17
36
|
// Stated here rather than discovered when the runner cannot find a module.
|
|
18
37
|
.refine((request) => Object.hasOwn(request.files, request.entryPointPath), {
|
|
@@ -22,23 +41,50 @@ export const makeRunFlowOnRunnerContract = () => {
|
|
|
22
41
|
.refine((request) => Object.hasOwn(request.files, runPackageJsonPath), {
|
|
23
42
|
error: `The files must include ${runPackageJsonPath}; the run's npm dependencies are read from it.`,
|
|
24
43
|
path: ["files"],
|
|
44
|
+
})
|
|
45
|
+
.refine((request) => request.selection === undefined ||
|
|
46
|
+
Object.hasOwn(request.files, request.selection.path), {
|
|
47
|
+
error: "A selection must name a file carried in files.",
|
|
48
|
+
path: ["selection", "path"],
|
|
49
|
+
})
|
|
50
|
+
.refine((request) => Object.keys(request.unchangedFiles ?? {}).every((path) => !Object.hasOwn(request.files, path)), {
|
|
51
|
+
error: "A path may be sent in files or referenced in unchangedFiles, not both.",
|
|
52
|
+
path: ["unchangedFiles"],
|
|
25
53
|
});
|
|
54
|
+
const failure = z.discriminatedUnion("failureReason", [
|
|
55
|
+
z.object({
|
|
56
|
+
failureReason: z.literal("runner-target-mismatch"),
|
|
57
|
+
outcome: z.literal("failure"),
|
|
58
|
+
requiredRunnerName: runnerNameSchema.describe("The runner family this flow's execution target needs."),
|
|
59
|
+
runnerName: runnerNameSchema.describe("The runner family the runner is actually running."),
|
|
60
|
+
}),
|
|
61
|
+
z.object({
|
|
62
|
+
failureReason: z.literal("needs-full-sync"),
|
|
63
|
+
missingPaths: z
|
|
64
|
+
.array(runFilePathSchema)
|
|
65
|
+
.describe("Paths referenced in `unchangedFiles` that this runner does not hold. Send the run again with every file it needs in `files`."),
|
|
66
|
+
outcome: z.literal("failure"),
|
|
67
|
+
}),
|
|
68
|
+
z.object({
|
|
69
|
+
failureReason: z.literal("runner-unreachable"),
|
|
70
|
+
outcome: z.literal("failure"),
|
|
71
|
+
}),
|
|
72
|
+
]);
|
|
26
73
|
const output = z.discriminatedUnion("outcome", [
|
|
27
74
|
z.object({
|
|
28
|
-
|
|
75
|
+
bootstrappedRunner: z
|
|
76
|
+
.boolean()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("True when the runner had no live browser and one was started before the run, so a `selection` ran against a fresh page rather than the one an earlier run left. Absent means the runner was already warm. Only a request carrying `selection` can bootstrap, because a whole run starts its own browser either way."),
|
|
79
|
+
outcome: z.literal("success"),
|
|
29
80
|
runId: z
|
|
30
81
|
.string()
|
|
31
82
|
.describe("Id of the run, to follow it by. Read the `run-status` stream of the runner's journal for its outcome, and `run-logs` and `run-events` for its output."),
|
|
32
83
|
}),
|
|
33
|
-
|
|
34
|
-
z.object({
|
|
35
|
-
outcome: z.literal("runner-target-mismatch"),
|
|
36
|
-
requiredRunnerName: runnerNameSchema.describe("The image this flow's execution target needs."),
|
|
37
|
-
runnerName: runnerNameSchema.describe("The image the runner is actually running."),
|
|
38
|
-
}),
|
|
84
|
+
failure,
|
|
39
85
|
]);
|
|
40
86
|
return {
|
|
41
|
-
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
|
|
87
|
+
description: "Run a flow on an interactive runner. When `selection` is given the lines run against the browser as it stands, so nothing is re-navigated and nothing is signed in again; without it the whole entry point runs from a fresh browser. A runner with no live browser starts one before a selection and says so with `bootstrappedRunner`, which means those lines ran against a fresh page rather than the one an earlier run left. A selection produces no `runStarted` event, so follow it by its run id on `run-status` like any other run. Send `unchangedFiles` to ship only what changed since an earlier run on this runner; a `needs-full-sync` failure names the paths it does not hold, and the way to recover is the same run again with every file in `files`. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call fails with `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.",
|
|
42
88
|
input,
|
|
43
89
|
kind: "write",
|
|
44
90
|
name: "runner.runFlow",
|