@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.
- package/dist/v1/automate/index.d.ts +1 -1
- package/dist/v1/automate/index.d.ts.map +1 -1
- package/dist/v1/automate/index.js +3 -3
- package/dist/v1/automate/index.js.map +1 -1
- package/dist/v1/environment/find.d.ts +1 -0
- package/dist/v1/environment/find.d.ts.map +1 -1
- package/dist/v1/environment/getVariable.d.ts +19 -0
- package/dist/v1/environment/getVariable.d.ts.map +1 -0
- package/dist/v1/environment/getVariable.js +34 -0
- package/dist/v1/environment/getVariable.js.map +1 -0
- package/dist/v1/environment/index.d.ts +3 -1
- package/dist/v1/environment/index.d.ts.map +1 -1
- package/dist/v1/environment/index.js +1 -1
- package/dist/v1/environment/index.js.map +1 -1
- package/dist/v1/environment/resource.d.ts +1 -0
- package/dist/v1/environment/resource.d.ts.map +1 -1
- package/dist/v1/environment/resource.js +3 -0
- package/dist/v1/environment/resource.js.map +1 -1
- package/dist/v1/environment/update.d.ts +39 -0
- package/dist/v1/environment/update.d.ts.map +1 -0
- package/dist/v1/environment/update.js +38 -0
- package/dist/v1/environment/update.js.map +1 -0
- package/dist/v1/flow/index.d.ts +4 -0
- package/dist/v1/flow/index.d.ts.map +1 -1
- package/dist/v1/flow/index.js +2 -0
- package/dist/v1/flow/index.js.map +1 -1
- package/dist/v1/flow/readiness.d.ts +12 -0
- package/dist/v1/flow/readiness.d.ts.map +1 -0
- package/dist/v1/flow/readiness.js +12 -0
- package/dist/v1/flow/readiness.js.map +1 -0
- package/dist/v1/flow/update.d.ts +28 -0
- package/dist/v1/flow/update.d.ts.map +1 -0
- package/dist/v1/flow/update.js +26 -0
- package/dist/v1/flow/update.js.map +1 -0
- package/dist/v1/ids.d.ts +3 -2
- package/dist/v1/ids.d.ts.map +1 -1
- package/dist/v1/ids.js +1 -0
- package/dist/v1/ids.js.map +1 -1
- package/dist/v1/index.d.ts +588 -7
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +37 -0
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/run/get.d.ts +1 -1
- package/dist/v1/run/get.d.ts.map +1 -1
- package/dist/v1/run/get.js +3 -0
- package/dist/v1/run/get.js.map +1 -1
- package/dist/v1/run/index.d.ts +3 -1
- package/dist/v1/run/index.d.ts.map +1 -1
- package/dist/v1/run/index.js +3 -0
- package/dist/v1/run/index.js.map +1 -1
- package/dist/v1/run/summary.d.ts.map +1 -1
- package/dist/v1/run/summary.js +3 -0
- package/dist/v1/run/summary.js.map +1 -1
- package/dist/v1/runner/browserAction.d.ts +39 -0
- package/dist/v1/runner/browserAction.d.ts.map +1 -0
- package/dist/v1/runner/browserAction.js +82 -0
- package/dist/v1/runner/browserAction.js.map +1 -0
- package/dist/v1/runner/environment.d.ts +4 -0
- package/dist/v1/runner/environment.d.ts.map +1 -0
- package/dist/v1/runner/environment.js +46 -0
- package/dist/v1/runner/environment.js.map +1 -0
- package/dist/v1/runner/evaluateSnippet.d.ts +24 -0
- package/dist/v1/runner/evaluateSnippet.d.ts.map +1 -0
- package/dist/v1/runner/evaluateSnippet.js +54 -0
- package/dist/v1/runner/evaluateSnippet.js.map +1 -0
- package/dist/v1/runner/files.d.ts +26 -0
- package/dist/v1/runner/files.d.ts.map +1 -0
- package/dist/v1/runner/files.js +65 -0
- package/dist/v1/runner/files.js.map +1 -0
- package/dist/v1/runner/identity.d.ts +21 -0
- package/dist/v1/runner/identity.d.ts.map +1 -0
- package/dist/v1/runner/identity.js +21 -0
- package/dist/v1/runner/identity.js.map +1 -0
- package/dist/v1/runner/index.d.ts +45 -0
- package/dist/v1/runner/index.d.ts.map +1 -0
- package/dist/v1/runner/index.js +41 -0
- package/dist/v1/runner/index.js.map +1 -0
- package/dist/v1/runner/journal.d.ts +104 -0
- package/dist/v1/runner/journal.d.ts.map +1 -0
- package/dist/v1/runner/journal.js +52 -0
- package/dist/v1/runner/journal.js.map +1 -0
- package/dist/v1/runner/payloadSize.d.ts +27 -0
- package/dist/v1/runner/payloadSize.d.ts.map +1 -0
- package/dist/v1/runner/payloadSize.js +49 -0
- package/dist/v1/runner/payloadSize.js.map +1 -0
- package/dist/v1/runner/performAction.d.ts +61 -0
- package/dist/v1/runner/performAction.d.ts.map +1 -0
- package/dist/v1/runner/performAction.js +38 -0
- package/dist/v1/runner/performAction.js.map +1 -0
- package/dist/v1/runner/readJournal.d.ts +31 -0
- package/dist/v1/runner/readJournal.d.ts.map +1 -0
- package/dist/v1/runner/readJournal.js +22 -0
- package/dist/v1/runner/readJournal.js.map +1 -0
- package/dist/v1/runner/runFlow.d.ts +33 -0
- package/dist/v1/runner/runFlow.d.ts.map +1 -0
- package/dist/v1/runner/runFlow.js +48 -0
- package/dist/v1/runner/runFlow.js.map +1 -0
- package/dist/v1/runner/screen.d.ts +14 -0
- package/dist/v1/runner/screen.d.ts.map +1 -0
- package/dist/v1/runner/screen.js +16 -0
- package/dist/v1/runner/screen.js.map +1 -0
- package/dist/v1/runner/takeScreenshot.d.ts +22 -0
- package/dist/v1/runner/takeScreenshot.d.ts.map +1 -0
- package/dist/v1/runner/takeScreenshot.js +34 -0
- package/dist/v1/runner/takeScreenshot.js.map +1 -0
- package/dist/v1/runner/unreachable.d.ts +16 -0
- package/dist/v1/runner/unreachable.d.ts.map +1 -0
- package/dist/v1/runner/unreachable.js +16 -0
- package/dist/v1/runner/unreachable.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runEnvironmentSchema } from "./environment.js";
|
|
3
|
+
import { runFilePathSchema, runPackageJsonPath } from "./files.js";
|
|
4
|
+
import { runnerIdSchema, runnerNameSchema } from "./identity.js";
|
|
5
|
+
import { runFilesSchema } from "./payloadSize.js";
|
|
6
|
+
import { runnerUnreachableSchema } from "./unreachable.js";
|
|
7
|
+
export const makeRunFlowOnRunnerContract = () => {
|
|
8
|
+
const input = z
|
|
9
|
+
.object({
|
|
10
|
+
entryPointPath: runFilePathSchema.describe("Path of the flow file to run, as it appears in `files`."),
|
|
11
|
+
env: runEnvironmentSchema
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Environment variables to make available to the run."),
|
|
14
|
+
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
|
+
id: runnerIdSchema.describe("Id of the runner to run the flow on."),
|
|
16
|
+
})
|
|
17
|
+
// Stated here rather than discovered when the runner cannot find a module.
|
|
18
|
+
.refine((request) => Object.hasOwn(request.files, request.entryPointPath), {
|
|
19
|
+
error: "The entry point must be one of the files.",
|
|
20
|
+
path: ["files"],
|
|
21
|
+
})
|
|
22
|
+
.refine((request) => Object.hasOwn(request.files, runPackageJsonPath), {
|
|
23
|
+
error: `The files must include ${runPackageJsonPath}; the run's npm dependencies are read from it.`,
|
|
24
|
+
path: ["files"],
|
|
25
|
+
});
|
|
26
|
+
const output = z.discriminatedUnion("outcome", [
|
|
27
|
+
z.object({
|
|
28
|
+
outcome: z.literal("submitted"),
|
|
29
|
+
runId: z
|
|
30
|
+
.string()
|
|
31
|
+
.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
|
+
}),
|
|
33
|
+
runnerUnreachableSchema,
|
|
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
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
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 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.",
|
|
42
|
+
input,
|
|
43
|
+
kind: "write",
|
|
44
|
+
name: "runner.runFlow",
|
|
45
|
+
output,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=runFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runFlow.js","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CACxC,yDAAyD,CAC1D;QACD,GAAG,EAAE,oBAAoB;aACtB,QAAQ,EAAE;aACV,QAAQ,CAAC,qDAAqD,CAAC;QAClE,KAAK,EAAE,cAAc,CAAC,QAAQ,CAC5B,uMAAuM,CACxM;QACD,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACpE,CAAC;QACF,2EAA2E;SAC1E,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE;QACzE,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,CAAC,OAAO,CAAC;KAChB,CAAC;SACD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;QACrE,KAAK,EAAE,0BAA0B,kBAAkB,gDAAgD;QACnG,IAAI,EAAE,CAAC,OAAO,CAAC;KAChB,CAAC,CAAC;IAEL,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;YAC/B,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,CACP,uJAAuJ,CACxJ;SACJ,CAAC;QACF,uBAAuB;QACvB,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;YAC5C,kBAAkB,EAAE,gBAAgB,CAAC,QAAQ,CAC3C,+CAA+C,CAChD;YACD,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CACnC,2CAA2C,CAC5C;SACF,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,iwBAAiwB;QACnwB,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const runnerScreenNotReadySchema: z.ZodObject<{
|
|
3
|
+
outcome: z.ZodLiteral<"screen-not-ready">;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const screenNotReadyDescription = "`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 \u2014 a run may restart the display and discard what is on it.";
|
|
6
|
+
export declare const runnerScreenNeedsARunSchema: z.ZodObject<{
|
|
7
|
+
outcome: z.ZodLiteral<"screen-needs-a-run">;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const screenNeedsARunDescription = "`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 \u2014 call `runner.runFlow` on the runner, then ask for the screen again. Evaluating a snippet does not start the desktop.";
|
|
10
|
+
export declare const runnerHasNoScreenSchema: z.ZodObject<{
|
|
11
|
+
outcome: z.ZodLiteral<"runner-has-no-screen">;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const runnerHasNoScreenDescription = "`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 \u2014 launch a `node20WithPlaywright` runner instead.";
|
|
14
|
+
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,eAAO,MAAM,yBAAyB,yXAC6U,CAAC;AAIpX,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,0BAA0B,8RACiP,CAAC;AAEzR,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,4BAA4B,2NAC4K,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const runnerScreenNotReadySchema = z.object({
|
|
3
|
+
outcome: z.literal("screen-not-ready"),
|
|
4
|
+
});
|
|
5
|
+
export const screenNotReadyDescription = "`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.";
|
|
6
|
+
// Its own outcome, not a sentence inside `screen-not-ready`: the callers here are
|
|
7
|
+
// models, and an instruction that only exists in prose is one they may not follow.
|
|
8
|
+
export const runnerScreenNeedsARunSchema = z.object({
|
|
9
|
+
outcome: z.literal("screen-needs-a-run"),
|
|
10
|
+
});
|
|
11
|
+
export const screenNeedsARunDescription = "`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.";
|
|
12
|
+
export const runnerHasNoScreenSchema = z.object({
|
|
13
|
+
outcome: z.literal("runner-has-no-screen"),
|
|
14
|
+
});
|
|
15
|
+
export const runnerHasNoScreenDescription = "`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.";
|
|
16
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GACpC,iXAAiX,CAAC;AAEpX,kFAAkF;AAClF,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GACrC,sRAAsR,CAAC;AAEzR,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;CAC3C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GACvC,mNAAmN,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const makeTakeScreenshotOnRunnerContract: () => {
|
|
3
|
+
readonly description: "Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. `screen-needs-a-run` if the runner has not run anything yet, so its virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` on the runner, then ask for the screen again. Evaluating a snippet does not start the desktop. `screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it. `runner-has-no-screen` if this runner is not one that runs a browser on a virtual desktop. Nothing about it can be seen or driven, and retrying will never help — launch a `node20WithPlaywright` runner instead. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
|
|
4
|
+
readonly input: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
readonly kind: "read";
|
|
8
|
+
readonly name: "runner.takeScreenshot";
|
|
9
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
imageJpegBase64: z.ZodString;
|
|
11
|
+
outcome: z.ZodLiteral<"captured">;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
outcome: z.ZodLiteral<"screen-needs-a-run">;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
outcome: z.ZodLiteral<"screen-not-ready">;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
outcome: z.ZodLiteral<"runner-has-no-screen">;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
20
|
+
}, z.core.$strip>], "outcome">;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=takeScreenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeScreenshot.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;CAqC9C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runnerIdSchema } from "./identity.js";
|
|
3
|
+
import { runnerHasNoScreenDescription, runnerHasNoScreenSchema, runnerScreenNeedsARunSchema, runnerScreenNotReadySchema, screenNeedsARunDescription, screenNotReadyDescription, } from "./screen.js";
|
|
4
|
+
import { retryableRunnerUnreachableDescription, runnerUnreachableSchema, } from "./unreachable.js";
|
|
5
|
+
export const makeTakeScreenshotOnRunnerContract = () => {
|
|
6
|
+
const input = z.object({
|
|
7
|
+
id: runnerIdSchema.describe("Id of the runner to take a screenshot of."),
|
|
8
|
+
});
|
|
9
|
+
const output = z.discriminatedUnion("outcome", [
|
|
10
|
+
z.object({
|
|
11
|
+
// Not `z.base64()`: its regex runs against every multi-megabyte frame,
|
|
12
|
+
// on the server and in every client that parses with this schema
|
|
13
|
+
// (https://github.com/colinhacks/zod/issues/4283), and the value comes
|
|
14
|
+
// from our own encoder.
|
|
15
|
+
imageJpegBase64: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.describe("The screenshot, as a base64-encoded JPEG. Decode it and write the bytes to a `.jpg` file — writing this string to the file leaves you with base64 text rather than an image."),
|
|
19
|
+
outcome: z.literal("captured"),
|
|
20
|
+
}),
|
|
21
|
+
runnerScreenNeedsARunSchema,
|
|
22
|
+
runnerScreenNotReadySchema,
|
|
23
|
+
runnerHasNoScreenSchema,
|
|
24
|
+
runnerUnreachableSchema,
|
|
25
|
+
]);
|
|
26
|
+
return {
|
|
27
|
+
description: `Take one screenshot of an interactive runner's screen. The image is the runner's whole virtual desktop, browser window and all. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
|
|
28
|
+
input,
|
|
29
|
+
kind: "read",
|
|
30
|
+
name: "runner.takeScreenshot",
|
|
31
|
+
output,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=takeScreenshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeScreenshot.js","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,kCAAkC,GAAG,GAAG,EAAE;IACrD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACzE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,uEAAuE;YACvE,iEAAiE;YACjE,uEAAuE;YACvE,wBAAwB;YACxB,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CACP,8KAA8K,CAC/K;YACH,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;SAC/B,CAAC;QACF,2BAA2B;QAC3B,0BAA0B;QAC1B,uBAAuB;QACvB,uBAAuB;KACxB,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,mIAAmI,0BAA0B,IAAI,yBAAyB,IAAI,4BAA4B,IAAI,qCAAqC,EAAE;QAClR,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,uBAAuB;QAC7B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The one answer every verb that talks to a live runner can give instead of
|
|
4
|
+
* doing the work. One condition, because telling pod states apart would commit
|
|
5
|
+
* a published contract to a taxonomy of transient ones. Carries no advice —
|
|
6
|
+
* whether a retry is safe differs per verb, and each verb says so itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runnerUnreachableSchema: z.ZodObject<{
|
|
9
|
+
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* For verbs that change nothing when they fail. A verb that may already have
|
|
13
|
+
* taken effect must not use this — see `runner.runFlow`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const retryableRunnerUnreachableDescription = "`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.";
|
|
16
|
+
//# sourceMappingURL=unreachable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qCAAqC,oPACiM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The one answer every verb that talks to a live runner can give instead of
|
|
4
|
+
* doing the work. One condition, because telling pod states apart would commit
|
|
5
|
+
* a published contract to a taxonomy of transient ones. Carries no advice —
|
|
6
|
+
* whether a retry is safe differs per verb, and each verb says so itself.
|
|
7
|
+
*/
|
|
8
|
+
export const runnerUnreachableSchema = z.object({
|
|
9
|
+
outcome: z.literal("runner-unreachable"),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* For verbs that change nothing when they fail. A verb that may already have
|
|
13
|
+
* taken effect must not use this — see `runner.runFlow`.
|
|
14
|
+
*/
|
|
15
|
+
export const retryableRunnerUnreachableDescription = "`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.";
|
|
16
|
+
//# sourceMappingURL=unreachable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iPAAiP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qawolf/api-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Versioned contracts for the QA Wolf public API",
|
|
6
6
|
"repository": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "rm -rf ./dist && tsc -p tsconfig.build.json",
|
|
30
|
-
"lint:ci": "npm run lint:
|
|
31
|
-
"lint:dev": "npm run lint:
|
|
32
|
-
"lint:
|
|
33
|
-
"lint:
|
|
30
|
+
"lint:ci": "npm run lint:first-half; FIRST_HALF_EXIT=$?; npm run lint:second-half && exit $FIRST_HALF_EXIT",
|
|
31
|
+
"lint:dev": "npm run lint:first-half",
|
|
32
|
+
"lint:first-half": "eslint . --fix --quiet && oxfmt --write .",
|
|
33
|
+
"lint:second-half": "dpdm --exit-code circular:1 --no-tree --no-warning --transform --include='.*' --exclude='/(dist|node_modules)/' '**/*'",
|
|
34
34
|
"prepublishOnly": "npm run build",
|
|
35
35
|
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" NODE_NO_WARNINGS=1 jest",
|
|
36
36
|
"tsc:check": "tsgo --noEmit -p tsconfig.typecheck.json"
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
"zod": "^4.1.11"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": ">=
|
|
50
|
+
"node": ">=20.19.0 <25"
|
|
51
51
|
}
|
|
52
52
|
}
|