@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
|
@@ -1 +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,
|
|
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,EACL,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACrC,WAAW,CAAC,CAAC,MAAM,EAAE,iBAAiB,EAAE,EAAE;IACzC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,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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AqT,CACtT;YACH,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7B,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,CACP,uJAAuJ,CACxJ;SACJ,CAAC;QACF,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,y8CAAy8C;QAC38C,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const runSelectionSchema: z.ZodObject<{
|
|
3
|
+
endLine: z.ZodInt;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
startLine: z.ZodInt;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type RunSelection = z.infer<typeof runSelectionSchema>;
|
|
8
|
+
//# sourceMappingURL=runSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSelection.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;iBAiB3B,CAAC;AAEL,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runFilePathSchema } from "./files.js";
|
|
3
|
+
export const runSelectionSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
endLine: z
|
|
6
|
+
.int()
|
|
7
|
+
.positive()
|
|
8
|
+
.describe("Last line to run, 1-indexed and inclusive."),
|
|
9
|
+
path: runFilePathSchema.describe("Path of the file the lines are in, as it appears in `files`. It does not have to be the entry point."),
|
|
10
|
+
startLine: z
|
|
11
|
+
.int()
|
|
12
|
+
.positive()
|
|
13
|
+
.describe("First line to run, 1-indexed and inclusive."),
|
|
14
|
+
})
|
|
15
|
+
.refine((selection) => selection.startLine <= selection.endLine, {
|
|
16
|
+
error: "A selection's startLine must not be after its endLine.",
|
|
17
|
+
path: ["startLine"],
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=runSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSelection.js","sourceRoot":"","sources":["../../../src/v1/runner/runSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,4CAA4C,CAAC;IACzD,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAC9B,sGAAsG,CACvG;IACD,SAAS,EAAE,CAAC;SACT,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;CAC3D,CAAC;KACD,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE;IAC/D,KAAK,EAAE,wDAAwD;IAC/D,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC,CAAC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const runnerScreenNotReadySchema: z.ZodObject<{
|
|
3
|
-
outcome: z.ZodLiteral<"screen-not-ready">;
|
|
4
|
-
}, z.core.$strip>;
|
|
1
|
+
export declare const screenFailureReasons: readonly ["runner-has-no-screen", "screen-needs-a-run", "screen-not-ready"];
|
|
5
2
|
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
|
|
7
|
-
|
|
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.";
|
|
3
|
+
export declare const screenNeedsARunDescription = "`screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless \u2014 call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop.";
|
|
4
|
+
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 `playwright` runner instead.";
|
|
14
5
|
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,6EAIvB,CAAC;AAEX,eAAO,MAAM,yBAAyB,yXAC6U,CAAC;AAIpX,eAAO,MAAM,0BAA0B,2YAC8V,CAAC;AAEtY,eAAO,MAAM,4BAA4B,iNACkK,CAAC"}
|
package/dist/v1/runner/screen.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export const screenFailureReasons = [
|
|
2
|
+
"runner-has-no-screen",
|
|
3
|
+
"screen-needs-a-run",
|
|
4
|
+
"screen-not-ready",
|
|
5
|
+
];
|
|
5
6
|
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
|
|
7
|
+
// Its own reason, not a sentence inside `screen-not-ready`: the callers here are
|
|
7
8
|
// models, and an instruction that only exists in prose is one they may not follow.
|
|
8
|
-
export const
|
|
9
|
-
|
|
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.";
|
|
9
|
+
export const screenNeedsARunDescription = "`screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop.";
|
|
10
|
+
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 `playwright` runner instead.";
|
|
16
11
|
//# sourceMappingURL=screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../../src/v1/runner/screen.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GACpC,iXAAiX,CAAC;AAEpX,iFAAiF;AACjF,mFAAmF;AACnF,MAAM,CAAC,MAAM,0BAA0B,GACrC,mYAAmY,CAAC;AAEtY,MAAM,CAAC,MAAM,4BAA4B,GACvC,yMAAyM,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const makeStopRunOnRunnerContract: () => {
|
|
3
|
+
readonly description: "Stop what a runner is currently executing, leaving the runner up and its browser on whatever page the run reached. Succeeds whether or not anything was running, and `wasRunning` says which. This is the counterpart of `runner.terminate`, which ends the runner itself. The run stops where it is, so the journal's `run-status` settles it as stopped rather than passed or failed. `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. The stop may still have landed, but stopping a runner that is already idle does nothing, so retrying is safe.";
|
|
4
|
+
readonly input: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
readonly kind: "write";
|
|
8
|
+
readonly name: "runner.stopRun";
|
|
9
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
outcome: z.ZodLiteral<"success">;
|
|
11
|
+
wasRunning: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
failureReason: z.ZodEnum<{
|
|
14
|
+
"runner-unreachable": "runner-unreachable";
|
|
15
|
+
}>;
|
|
16
|
+
outcome: z.ZodLiteral<"failure">;
|
|
17
|
+
}, z.core.$strip>], "outcome">;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=stopRun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopRun.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/stopRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;CA8BvC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runnerIdSchema } from "./identity.js";
|
|
3
|
+
import { makeRunnerFailureSchema } from "./outcome.js";
|
|
4
|
+
import { runnerUnreachableFailureReason } from "./unreachable.js";
|
|
5
|
+
export const makeStopRunOnRunnerContract = () => {
|
|
6
|
+
const input = z.object({
|
|
7
|
+
id: runnerIdSchema.describe("Id of the runner to stop the run on."),
|
|
8
|
+
});
|
|
9
|
+
const output = z.discriminatedUnion("outcome", [
|
|
10
|
+
z.object({
|
|
11
|
+
outcome: z.literal("success"),
|
|
12
|
+
wasRunning: z
|
|
13
|
+
.boolean()
|
|
14
|
+
.describe("False when the runner had nothing to stop: the run had already finished, or none had been submitted. Not an error."),
|
|
15
|
+
}),
|
|
16
|
+
makeRunnerFailureSchema([runnerUnreachableFailureReason]),
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
description: "Stop what a runner is currently executing, leaving the runner up and its browser on whatever page the run reached. Succeeds whether or not anything was running, and `wasRunning` says which. This is the counterpart of `runner.terminate`, which ends the runner itself. The run stops where it is, so the journal's `run-status` settles it as stopped rather than passed or failed. `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. The stop may still have landed, but stopping a runner that is already idle does nothing, so retrying is safe.",
|
|
20
|
+
input,
|
|
21
|
+
kind: "write",
|
|
22
|
+
name: "runner.stopRun",
|
|
23
|
+
output,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=stopRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopRun.js","sourceRoot":"","sources":["../../../src/v1/runner/stopRun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACpE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7B,UAAU,EAAE,CAAC;iBACV,OAAO,EAAE;iBACT,QAAQ,CACP,oHAAoH,CACrH;SACJ,CAAC;QACF,uBAAuB,CAAC,CAAC,8BAA8B,CAAC,CAAC;KAC1D,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,ooBAAooB;QACtoB,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
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
|
|
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's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. 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 `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 be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
|
|
4
4
|
readonly input: z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
}, z.core.$strip>;
|
|
@@ -8,15 +8,15 @@ export declare const makeTakeScreenshotOnRunnerContract: () => {
|
|
|
8
8
|
readonly name: "runner.takeScreenshot";
|
|
9
9
|
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
10
|
imageJpegBase64: z.ZodString;
|
|
11
|
-
outcome: z.ZodLiteral<"
|
|
11
|
+
outcome: z.ZodLiteral<"success">;
|
|
12
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
outcome: z.ZodLiteral<"
|
|
13
|
+
failureReason: z.ZodEnum<{
|
|
14
|
+
"runner-unreachable": "runner-unreachable";
|
|
15
|
+
"runner-has-no-screen": "runner-has-no-screen";
|
|
16
|
+
"screen-needs-a-run": "screen-needs-a-run";
|
|
17
|
+
"screen-not-ready": "screen-not-ready";
|
|
18
|
+
}>;
|
|
19
|
+
outcome: z.ZodLiteral<"failure">;
|
|
20
20
|
}, z.core.$strip>], "outcome">;
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=takeScreenshot.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"takeScreenshot.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/takeScreenshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;CAqC9C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { runnerIdSchema } from "./identity.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { makeRunnerFailureSchema } from "./outcome.js";
|
|
4
|
+
import { runnerHasNoScreenDescription, screenFailureReasons, screenNeedsARunDescription, screenNotReadyDescription, } from "./screen.js";
|
|
5
|
+
import { retryableRunnerUnreachableDescription, runnerUnreachableFailureReason, } from "./unreachable.js";
|
|
5
6
|
export const makeTakeScreenshotOnRunnerContract = () => {
|
|
6
7
|
const input = z.object({
|
|
7
8
|
id: runnerIdSchema.describe("Id of the runner to take a screenshot of."),
|
|
@@ -16,12 +17,12 @@ export const makeTakeScreenshotOnRunnerContract = () => {
|
|
|
16
17
|
.string()
|
|
17
18
|
.min(1)
|
|
18
19
|
.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("
|
|
20
|
+
outcome: z.literal("success"),
|
|
20
21
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
makeRunnerFailureSchema([
|
|
23
|
+
...screenFailureReasons,
|
|
24
|
+
runnerUnreachableFailureReason,
|
|
25
|
+
]),
|
|
25
26
|
]);
|
|
26
27
|
return {
|
|
27
28
|
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}`,
|
|
@@ -1 +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,
|
|
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,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAC/B,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,SAAS,CAAC;SAC9B,CAAC;QACF,uBAAuB,CAAC;YACtB,GAAG,oBAAoB;YACvB,8BAA8B;SAC/B,CAAC;KACH,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"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
/**
|
|
3
2
|
* The one answer every verb that talks to a live runner can give instead of
|
|
4
3
|
* 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
|
|
4
|
+
* a published contract to a taxonomy of transient ones. Carries no advice,
|
|
5
|
+
* because whether a retry is safe differs per verb and each verb says so itself.
|
|
7
6
|
*/
|
|
8
|
-
export declare const
|
|
9
|
-
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
10
|
-
}, z.core.$strip>;
|
|
7
|
+
export declare const runnerUnreachableFailureReason = "runner-unreachable";
|
|
11
8
|
/**
|
|
12
9
|
* For verbs that change nothing when they fail. A verb that may already have
|
|
13
|
-
* taken effect must not use this
|
|
10
|
+
* taken effect must not use this. See `runner.runFlow`.
|
|
14
11
|
*/
|
|
15
12
|
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
13
|
//# sourceMappingURL=unreachable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,oPACiM,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
/**
|
|
3
2
|
* The one answer every verb that talks to a live runner can give instead of
|
|
4
3
|
* 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
|
|
4
|
+
* a published contract to a taxonomy of transient ones. Carries no advice,
|
|
5
|
+
* because whether a retry is safe differs per verb and each verb says so itself.
|
|
7
6
|
*/
|
|
8
|
-
export const
|
|
9
|
-
outcome: z.literal("runner-unreachable"),
|
|
10
|
-
});
|
|
7
|
+
export const runnerUnreachableFailureReason = "runner-unreachable";
|
|
11
8
|
/**
|
|
12
9
|
* For verbs that change nothing when they fail. A verb that may already have
|
|
13
|
-
* taken effect must not use this
|
|
10
|
+
* taken effect must not use this. See `runner.runFlow`.
|
|
14
11
|
*/
|
|
15
12
|
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
13
|
//# sourceMappingURL=unreachable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unreachable.js","sourceRoot":"","sources":["../../../src/v1/runner/unreachable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAChD,iPAAiP,CAAC"}
|