@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
package/dist/v1/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoC,CAAC"}
|
package/dist/v1/index.js
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
export { identityResponse } from "./identity/index.js";
|
|
2
2
|
export { defaultIdSchemas, } from "./ids.js";
|
|
3
3
|
export { makeFlowSelectionSchema } from "./run/index.js";
|
|
4
|
+
export { browserActionSchema, } from "./runner/browserAction.js";
|
|
5
|
+
// Carries the reservation of QA Wolf's own variable names, which the server
|
|
6
|
+
// validates with rather than restating — a second copy of that rule is how the
|
|
7
|
+
// reservation comes to differ from what is actually stamped.
|
|
8
|
+
export { runEnvironmentSchema } from "./runner/environment.js";
|
|
9
|
+
// The travel rule for files bound for a runner: which files travel, how much may
|
|
10
|
+
// travel, and what environment a run may carry. A client needs the predicate and
|
|
11
|
+
// the size bounds to collect and pre-check with; the schemas are also what the
|
|
12
|
+
// server and the runner validate with, so they are shared rather than restated.
|
|
13
|
+
export { isShippableRunFilePath, runFilePathSchema, runPackageJsonPath, shippableRunFileExtensions, } from "./runner/files.js";
|
|
14
|
+
export { makeRunnerSchema, runnerIdSchema, runnerNameSchema, } from "./runner/identity.js";
|
|
15
|
+
// A journal read is answered verbatim by the public API, so its wire shapes are
|
|
16
|
+
// published here and the private journal package imports them from here.
|
|
17
|
+
export { journalEntrySchema, journalStreamSchema, knownJournalStreams, maxJournalStreamNameLength, readJournalRequestSchema, readJournalResponseSchema, } from "./runner/journal.js";
|
|
18
|
+
export { maxRunFilesByteLength, maxRunnerRequestEncodedByteLength, runFilesByteLength, runFilesSchema, } from "./runner/payloadSize.js";
|
|
19
|
+
export { maxActionErrorMessageLength } from "./runner/performAction.js";
|
|
4
20
|
import { makeAutomateContract } from "./automate/index.js";
|
|
5
21
|
import { makeDeleteEnvironmentVariableContract } from "./environment/deleteVariable.js";
|
|
6
22
|
import { makeFindEnvironmentsContract } from "./environment/find.js";
|
|
23
|
+
import { makeGetEnvironmentVariableContract } from "./environment/getVariable.js";
|
|
7
24
|
import { makeCreateEnvironmentContract, makeGetEnvironmentContract, makeListEnvironmentVariableNamesContract, makeSetEnvironmentVariableContract, } from "./environment/index.js";
|
|
25
|
+
import { makeUpdateEnvironmentContract } from "./environment/update.js";
|
|
8
26
|
import { makeAddTagToFlowsContract } from "./flow/addTag.js";
|
|
9
27
|
import { makeListFlowsContract } from "./flow/index.js";
|
|
28
|
+
import { makeUpdateFlowContract } from "./flow/update.js";
|
|
10
29
|
import { defaultIdSchemas, } from "./ids.js";
|
|
11
30
|
import { makeCreateIssueContract } from "./issue/create.js";
|
|
12
31
|
import { makeFindIssuesContract, makeGetIssueContract } from "./issue/index.js";
|
|
@@ -14,6 +33,12 @@ import { makeUpdateIssueContract } from "./issue/update.js";
|
|
|
14
33
|
import { makeFindRunsContract } from "./run/find.js";
|
|
15
34
|
import { makeGetRunContract } from "./run/get.js";
|
|
16
35
|
import { makeCreateRunContract } from "./run/index.js";
|
|
36
|
+
import { makeEvaluateSnippetOnRunnerContract } from "./runner/evaluateSnippet.js";
|
|
37
|
+
import { makeLaunchRunnerContract, makeStopRunnerContract, } from "./runner/index.js";
|
|
38
|
+
import { makePerformActionOnRunnerContract } from "./runner/performAction.js";
|
|
39
|
+
import { makeReadRunnerJournalContract } from "./runner/readJournal.js";
|
|
40
|
+
import { makeRunFlowOnRunnerContract } from "./runner/runFlow.js";
|
|
41
|
+
import { makeTakeScreenshotOnRunnerContract } from "./runner/takeScreenshot.js";
|
|
17
42
|
import { makeCreateTagContract } from "./tag/index.js";
|
|
18
43
|
import { makeListTagsContract } from "./tag/list.js";
|
|
19
44
|
/**
|
|
@@ -34,12 +59,15 @@ export const makeContractsV1 = (ids) => {
|
|
|
34
59
|
deleteVariable: makeDeleteEnvironmentVariableContract(resolvedIds),
|
|
35
60
|
find: makeFindEnvironmentsContract(resolvedIds),
|
|
36
61
|
get: makeGetEnvironmentContract(resolvedIds),
|
|
62
|
+
getVariable: makeGetEnvironmentVariableContract(resolvedIds),
|
|
37
63
|
listVariableNames: makeListEnvironmentVariableNamesContract(resolvedIds),
|
|
38
64
|
setVariable: makeSetEnvironmentVariableContract(resolvedIds),
|
|
65
|
+
update: makeUpdateEnvironmentContract(resolvedIds),
|
|
39
66
|
},
|
|
40
67
|
flow: {
|
|
41
68
|
addTag: makeAddTagToFlowsContract(resolvedIds),
|
|
42
69
|
list: makeListFlowsContract(resolvedIds),
|
|
70
|
+
update: makeUpdateFlowContract(resolvedIds),
|
|
43
71
|
},
|
|
44
72
|
issue: {
|
|
45
73
|
create: makeCreateIssueContract(resolvedIds),
|
|
@@ -52,6 +80,15 @@ export const makeContractsV1 = (ids) => {
|
|
|
52
80
|
find: makeFindRunsContract(resolvedIds),
|
|
53
81
|
get: makeGetRunContract(resolvedIds),
|
|
54
82
|
},
|
|
83
|
+
runner: {
|
|
84
|
+
evaluateSnippet: makeEvaluateSnippetOnRunnerContract(),
|
|
85
|
+
launch: makeLaunchRunnerContract(),
|
|
86
|
+
performAction: makePerformActionOnRunnerContract(),
|
|
87
|
+
readJournal: makeReadRunnerJournalContract(),
|
|
88
|
+
runFlow: makeRunFlowOnRunnerContract(),
|
|
89
|
+
stop: makeStopRunnerContract(),
|
|
90
|
+
takeScreenshot: makeTakeScreenshotOnRunnerContract(),
|
|
91
|
+
},
|
|
55
92
|
tag: {
|
|
56
93
|
create: makeCreateTagContract(),
|
|
57
94
|
list: makeListTagsContract(resolvedIds),
|
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAGL,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAEL,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,4EAA4E;AAC5E,+EAA+E;AAC/E,6DAA6D;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,gFAAgF;AAChF,yEAAyE;AACzE,OAAO,EAML,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,qBAAqB,EACrB,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;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C,WAAW,CAAC;SACrC;QACD,MAAM,EAAE;YACN,eAAe,EAAE,mCAAmC,EAAE;YACtD,MAAM,EAAE,wBAAwB,EAAE;YAClC,aAAa,EAAE,iCAAiC,EAAE;YAClD,WAAW,EAAE,6BAA6B,EAAE;YAC5C,OAAO,EAAE,2BAA2B,EAAE;YACtC,IAAI,EAAE,sBAAsB,EAAE;YAC9B,cAAc,EAAE,kCAAkC,EAAE;SACrD;QACD,GAAG,EAAE;YACH,MAAM,EAAE,qBAAqB,EAAE;YAC/B,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC;SACxC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
|
package/dist/v1/run/get.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const makeGetRunContract: <FlowId extends PublicIdSchema, RunId e
|
|
|
29
29
|
passed: "passed";
|
|
30
30
|
}>;
|
|
31
31
|
}, z.core.$strip>], "status">>;
|
|
32
|
+
runId: RunId;
|
|
32
33
|
completedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
33
34
|
createdAt: z.ZodISODateTime;
|
|
34
35
|
git: z.ZodObject<{
|
|
@@ -37,7 +38,6 @@ export declare const makeGetRunContract: <FlowId extends PublicIdSchema, RunId e
|
|
|
37
38
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
38
39
|
commitUrl: z.ZodOptional<z.ZodString>;
|
|
39
40
|
}, z.core.$strip>;
|
|
40
|
-
runId: RunId;
|
|
41
41
|
status: z.ZodEnum<{
|
|
42
42
|
running: "running";
|
|
43
43
|
canceled: "canceled";
|
package/dist/v1/run/get.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/run/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,kBAAkB,GAC7B,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/run/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,kBAAkB,GAC7B,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEA,CAAC"}
|
package/dist/v1/run/get.js
CHANGED
|
@@ -43,6 +43,9 @@ export const makeGetRunContract = (ids) => {
|
|
|
43
43
|
const output = resource({
|
|
44
44
|
...makeRunSummaryFields(ids),
|
|
45
45
|
flows,
|
|
46
|
+
// Overrides the shared field: only this endpoint takes a run id, so only
|
|
47
|
+
// here can the answer describe a different run than the one requested.
|
|
48
|
+
runId: ids.run.describe("The run this response describes. Treat it as canonical: it can differ from the id you asked for. A deploy notification returns a run id before the run exists, and if a second notification for the same commit is folded into an earlier run, that id resolves to the earlier run instead."),
|
|
46
49
|
}, { urlFieldDescription: "Absolute URL of the run page." });
|
|
47
50
|
return {
|
|
48
51
|
description: "Get a run's status, per-flow results, and links.",
|
package/dist/v1/run/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
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AC;IACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,GAAG,CAAC,IAAI;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;KAC5D,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;SAClE,QAAQ,CAAC,kDAAkD,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,QAAQ,CACrB;QACE,GAAG,oBAAoB,CAAC,GAAG,CAAC;QAC5B,KAAK;QACL,yEAAyE;QACzE,uEAAuE;QACvE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CACrB,6RAA6R,CAC9R;KACF,EACD,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,CACzD,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,kDAAkD;QAC/D,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,SAAS;QACf,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/v1/run/index.d.ts
CHANGED
|
@@ -2,13 +2,15 @@ import { z } from "zod";
|
|
|
2
2
|
import type { PublicIdSchema } from "../ids.js";
|
|
3
3
|
import { makeFlowSelectionSchema } from "./flowSelection.js";
|
|
4
4
|
export { makeFlowSelectionSchema };
|
|
5
|
-
export declare const makeCreateRunContract: <FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
5
|
+
export declare const makeCreateRunContract: <AiTaskId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
6
|
+
aiTask: AiTaskId;
|
|
6
7
|
environmentRef: PublicIdSchema;
|
|
7
8
|
flow: FlowId;
|
|
8
9
|
run: RunId;
|
|
9
10
|
}) => {
|
|
10
11
|
readonly description: "Create a run for the selected flows and/or tags in an environment.";
|
|
11
12
|
readonly input: z.ZodIntersection<z.ZodObject<{
|
|
13
|
+
aiTaskId: z.ZodOptional<AiTaskId>;
|
|
12
14
|
environmentId: PublicIdSchema;
|
|
13
15
|
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
16
|
ignoreRules: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,eAAO,MAAM,qBAAqB,GAChC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,cAAc,EAC/B,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,MAAM,EAAE,QAAQ,CAAC;IACjB,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;CA8CA,CAAC"}
|
package/dist/v1/run/index.js
CHANGED
|
@@ -5,6 +5,9 @@ export { makeFlowSelectionSchema };
|
|
|
5
5
|
export const makeCreateRunContract = (ids) => {
|
|
6
6
|
const input = z
|
|
7
7
|
.object({
|
|
8
|
+
aiTaskId: ids.aiTask
|
|
9
|
+
.describe("The AI task whose conversation should receive run status updates.")
|
|
10
|
+
.optional(),
|
|
8
11
|
environmentId: ids.environmentRef,
|
|
9
12
|
environmentVariables: z.record(z.string(), z.string()).optional(),
|
|
10
13
|
ignoreRules: z.boolean().default(false),
|
package/dist/v1/run/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/run/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAInC,GAKD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,QAAQ,EAAE,GAAG,CAAC,MAA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C;CACZ;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/v1/run/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,cAAc,EAAE,KAAK;IACtE,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;CAkCC,CAAC"}
|
package/dist/v1/run/summary.js
CHANGED
|
@@ -23,6 +23,9 @@ export const makeRunSummaryFields = (ids) => ({
|
|
|
23
23
|
.describe("Link to the commit on the code host."),
|
|
24
24
|
})
|
|
25
25
|
.describe("The branch and commit under test. The fields are present when a deploy notification started the run, and absent for runs started another way, for example manually or with run.create."),
|
|
26
|
+
// Deliberately not described here: run.find builds its rows from this factory
|
|
27
|
+
// too, and its rows answer no requested id, so wording about the id you asked
|
|
28
|
+
// for belongs on run.get alone.
|
|
26
29
|
runId: ids.run,
|
|
27
30
|
status: z
|
|
28
31
|
.enum(["queued", "running", "passed", "failed", "canceled"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../src/v1/run/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,6EAA6E;AAC7E,2EAA2E;AAC3E,sCAAsC;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAA+B,GAElE,EAAE,EAAE,CAAC,CAAC;IACL,WAAW,EAAE,CAAC,CAAC,GAAG;SACf,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,+KAA+K,CAChL;IACH,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC;SACH,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,C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;QACtE,mDAAmD;QACnD,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;KACpD,CAAC;SACD,QAAQ,CACP,wLAAwL,CACzL;IACH,8EAA8E;IAC9E,8EAA8E;IAC9E,gCAAgC;IAChC,KAAK,EAAE,GAAG,CAAC,GAAG;IACd,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;SAC3D,QAAQ,CACP,kGAAkG,CACnG;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The action shapes, bounded. Strict: a bound rejects rather than truncates. */
|
|
3
|
+
export declare const browserActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
button: z.ZodLiteral<"left" | "right" | "wheel" | "back" | "forward">;
|
|
5
|
+
type: z.ZodLiteral<"click">;
|
|
6
|
+
x: z.ZodInt;
|
|
7
|
+
y: z.ZodInt;
|
|
8
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"double_click">;
|
|
10
|
+
x: z.ZodInt;
|
|
11
|
+
y: z.ZodInt;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
scroll_x: z.ZodInt;
|
|
14
|
+
scroll_y: z.ZodInt;
|
|
15
|
+
type: z.ZodLiteral<"scroll">;
|
|
16
|
+
x: z.ZodInt;
|
|
17
|
+
y: z.ZodInt;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"move">;
|
|
20
|
+
x: z.ZodInt;
|
|
21
|
+
y: z.ZodInt;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
path: z.ZodArray<z.ZodObject<{
|
|
24
|
+
x: z.ZodInt;
|
|
25
|
+
y: z.ZodInt;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
type: z.ZodLiteral<"drag">;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
keys: z.ZodArray<z.ZodString>;
|
|
30
|
+
type: z.ZodLiteral<"keypress">;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"navigate">;
|
|
33
|
+
url: z.ZodURL;
|
|
34
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
35
|
+
text: z.ZodString;
|
|
36
|
+
type: z.ZodLiteral<"type">;
|
|
37
|
+
}, z.core.$strict>], "type">;
|
|
38
|
+
export type BrowserAction = z.infer<typeof browserActionSchema>;
|
|
39
|
+
//# sourceMappingURL=browserAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserAction.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/browserAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4CxB,iFAAiF;AACjF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA+C9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The input of `runner.performAction`, validated with the same schema by apex and
|
|
4
|
+
* the runner. Only ever tighten a bound: pods deploy separately, so a widened
|
|
5
|
+
* bound forwards actions an older pod rejects.
|
|
6
|
+
*
|
|
7
|
+
* `snake_case` on purpose: these are the computer-use tool names.
|
|
8
|
+
*/
|
|
9
|
+
/** A whole pixel on the runner's virtual desktop. */
|
|
10
|
+
const maxScreenCoordinate = 20_000;
|
|
11
|
+
const screenCoordinateSchema = z.int().min(0).max(maxScreenCoordinate);
|
|
12
|
+
const screenPointSchema = z.strictObject({
|
|
13
|
+
x: screenCoordinateSchema,
|
|
14
|
+
y: screenCoordinateSchema,
|
|
15
|
+
});
|
|
16
|
+
/** A signed wheel delta in whole pixels. A full page is a few hundred. */
|
|
17
|
+
const maxScrollDelta = 5_000;
|
|
18
|
+
const scrollDeltaSchema = z.int().min(-maxScrollDelta).max(maxScrollDelta);
|
|
19
|
+
/** The keyboard is held for 50 ms per character, so 200 of them is ten seconds. */
|
|
20
|
+
const maxTypedTextLength = 200;
|
|
21
|
+
/** A chord is modifiers plus a key, and names are like `ArrowDown` or `a`. */
|
|
22
|
+
const maxKeypressKeys = 10;
|
|
23
|
+
const maxKeyNameLength = 32;
|
|
24
|
+
/** A sampled path, each point a pointer event. Fewer than two is not a drag. */
|
|
25
|
+
const minDragPathPoints = 2;
|
|
26
|
+
const maxDragPathPoints = 100;
|
|
27
|
+
/** The de-facto ceiling browsers honour. */
|
|
28
|
+
const maxNavigateUrlLength = 2048;
|
|
29
|
+
/** Only the two schemes a browser navigation means, matched on the parsed scheme. */
|
|
30
|
+
const navigableUrlSchema = z
|
|
31
|
+
.url({ protocol: /^https?$/ })
|
|
32
|
+
.max(maxNavigateUrlLength);
|
|
33
|
+
/** The action shapes, bounded. Strict: a bound rejects rather than truncates. */
|
|
34
|
+
export const browserActionSchema = z.discriminatedUnion("type", [
|
|
35
|
+
z.strictObject({
|
|
36
|
+
button: z.literal(["left", "right", "wheel", "back", "forward"]),
|
|
37
|
+
type: z.literal("click"),
|
|
38
|
+
x: screenCoordinateSchema,
|
|
39
|
+
y: screenCoordinateSchema,
|
|
40
|
+
}),
|
|
41
|
+
z.strictObject({
|
|
42
|
+
type: z.literal("double_click"),
|
|
43
|
+
x: screenCoordinateSchema,
|
|
44
|
+
y: screenCoordinateSchema,
|
|
45
|
+
}),
|
|
46
|
+
z.strictObject({
|
|
47
|
+
scroll_x: scrollDeltaSchema,
|
|
48
|
+
scroll_y: scrollDeltaSchema,
|
|
49
|
+
type: z.literal("scroll"),
|
|
50
|
+
x: screenCoordinateSchema,
|
|
51
|
+
y: screenCoordinateSchema,
|
|
52
|
+
}),
|
|
53
|
+
z.strictObject({
|
|
54
|
+
type: z.literal("move"),
|
|
55
|
+
x: screenCoordinateSchema,
|
|
56
|
+
y: screenCoordinateSchema,
|
|
57
|
+
}),
|
|
58
|
+
z.strictObject({
|
|
59
|
+
path: z
|
|
60
|
+
.array(screenPointSchema)
|
|
61
|
+
.min(minDragPathPoints)
|
|
62
|
+
.max(maxDragPathPoints),
|
|
63
|
+
type: z.literal("drag"),
|
|
64
|
+
}),
|
|
65
|
+
z.strictObject({
|
|
66
|
+
keys: z
|
|
67
|
+
.array(z.string().min(1).max(maxKeyNameLength))
|
|
68
|
+
.min(1)
|
|
69
|
+
.max(maxKeypressKeys),
|
|
70
|
+
type: z.literal("keypress"),
|
|
71
|
+
}),
|
|
72
|
+
/** The one action not performed on the screen: it goes to the last active page. */
|
|
73
|
+
z.strictObject({
|
|
74
|
+
type: z.literal("navigate"),
|
|
75
|
+
url: navigableUrlSchema,
|
|
76
|
+
}),
|
|
77
|
+
z.strictObject({
|
|
78
|
+
text: z.string().min(1).max(maxTypedTextLength),
|
|
79
|
+
type: z.literal("type"),
|
|
80
|
+
}),
|
|
81
|
+
]);
|
|
82
|
+
//# sourceMappingURL=browserAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserAction.js","sourceRoot":"","sources":["../../../src/v1/runner/browserAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AAEH,qDAAqD;AACrD,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,MAAM,sBAAsB,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAEvE,MAAM,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAC;IACvC,CAA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"","sources":["../../../src/v1/runner/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,uCAmB9B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The environment variables a caller may give a run, and the names they may not.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The prefix QA Wolf reserves for the variables it sets on a run itself. A
|
|
7
|
+
* caller-supplied value under it is refused, and would be overridden anyway.
|
|
8
|
+
*/
|
|
9
|
+
const reservedRunEnvironmentVariablePrefix = "QAWOLF_";
|
|
10
|
+
/**
|
|
11
|
+
* A name becomes a name in the run's process environment, so it is held to what
|
|
12
|
+
* a shell accepts — and may not be one of QA Wolf's own. A refusal rather than
|
|
13
|
+
* a key schema, whose message would reach the caller as a bare "invalid key in
|
|
14
|
+
* record".
|
|
15
|
+
*/
|
|
16
|
+
function refusalForRunEnvironmentVariableName(name) {
|
|
17
|
+
if (name.length < 1 || name.length > 256)
|
|
18
|
+
return "An environment variable name must be between 1 and 256 characters.";
|
|
19
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
|
|
20
|
+
return "An environment variable name may contain only letters, digits and underscores, and must not start with a digit.";
|
|
21
|
+
// Case-insensitively, so the reservation cannot be worked around by case.
|
|
22
|
+
if (name.toUpperCase().startsWith(reservedRunEnvironmentVariablePrefix))
|
|
23
|
+
return `Environment variable names beginning with ${reservedRunEnvironmentVariablePrefix} are reserved by QA Wolf and set for you.`;
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const maxRunEnvironmentVariables = 100;
|
|
27
|
+
const maxRunEnvironmentValueLength = 8 * 1024;
|
|
28
|
+
/** Bounded on its own, so a large project is never refused for its environment. */
|
|
29
|
+
export const runEnvironmentSchema = z
|
|
30
|
+
.record(z.string(), z.string().max(maxRunEnvironmentValueLength))
|
|
31
|
+
.superRefine((environment, refinementContext) => {
|
|
32
|
+
for (const name of Object.keys(environment)) {
|
|
33
|
+
const refusal = refusalForRunEnvironmentVariableName(name);
|
|
34
|
+
if (refusal === undefined)
|
|
35
|
+
continue;
|
|
36
|
+
refinementContext.addIssue({
|
|
37
|
+
code: "custom",
|
|
38
|
+
message: refusal,
|
|
39
|
+
path: [name],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
.refine((environment) => Object.keys(environment).length <= maxRunEnvironmentVariables, {
|
|
44
|
+
error: `At most ${maxRunEnvironmentVariables} environment variables may be supplied.`,
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/v1/runner/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH;;;GAGG;AACH,MAAM,oCAAoC,GAAG,SAAS,CAAC;AAEvD;;;;;GAKG;AACH,SAAS,oCAAoC,CAC3C,IAAY;IAEZ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG;QACtC,OAAO,oEAAoE,CAAC;IAC9E,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;QACxC,OAAO,iHAAiH,CAAC;IAC3H,0EAA0E;IAC1E,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,oCAAoC,CAAC;QACrE,OAAO,6CAA6C,oCAAoC,2CAA2C,CAAC;IACtI,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC,MAAM,4BAA4B,GAAG,CAAC,GAAG,IAAI,CAAC;AAE9C,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;KAChE,WAAW,CAAC,CAAC,WAAW,EAAE,iBAAiB,EAAE,EAAE;IAC9C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,oCAAoC,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,OAAO,KAAK,SAAS;YAAE,SAAS;QACpC,iBAAiB,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,MAAM,CACL,CAAC,WAAW,EAAE,EAAE,CACd,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,IAAI,0BAA0B,EAC/D;IACE,KAAK,EAAE,WAAW,0BAA0B,yCAAyC;CACtF,CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const makeEvaluateSnippetOnRunnerContract: () => {
|
|
3
|
+
readonly description: "Evaluate a snippet against whatever the runner's browser is showing right now. Answers whether the snippet ran, and its error if it threw — not the value it evaluated to, so read anything you want back out of the runner's journal (a snippet's `console.log` lands in the `console` stream). A snippet starts no run and leaves no run-scoped journal entries of its own. `runner-unreachable` if the runner could not be reached or could not evaluate: as well as a runner that is still starting, has terminated after inactivity, or is busy, this covers a runner with no live page to evaluate against — which will never clear, so check that the runner you launched is one that runs a browser before retrying. It is NOT proof the snippet did not run: a snippet that outlives the answer window is still executing when you read this, so do not blindly resubmit one that mutates what the page is looking at.";
|
|
4
|
+
readonly input: z.ZodObject<{
|
|
5
|
+
code: z.ZodString;
|
|
6
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
7
|
+
files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
readonly kind: "write";
|
|
11
|
+
readonly name: "runner.evaluateSnippet";
|
|
12
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
14
|
+
outcome: z.ZodLiteral<"evaluated">;
|
|
15
|
+
result: z.ZodEnum<{
|
|
16
|
+
success: "success";
|
|
17
|
+
error: "error";
|
|
18
|
+
stopped: "stopped";
|
|
19
|
+
}>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
22
|
+
}, z.core.$strip>], "outcome">;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=evaluateSnippet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateSnippet.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/evaluateSnippet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;CA+D/C,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runFilePathSchema } from "./files.js";
|
|
3
|
+
import { runnerIdSchema } from "./identity.js";
|
|
4
|
+
import { runFilesSchema } from "./payloadSize.js";
|
|
5
|
+
import { runnerUnreachableSchema } from "./unreachable.js";
|
|
6
|
+
/**
|
|
7
|
+
* A snippet is one expression or a handful of statements, not a program: it is
|
|
8
|
+
* bounded so a caller cannot smuggle a whole project through as code instead of
|
|
9
|
+
* as files, where the travel rule applies.
|
|
10
|
+
*/
|
|
11
|
+
const maxSnippetCodeLength = 64 * 1024;
|
|
12
|
+
export const makeEvaluateSnippetOnRunnerContract = () => {
|
|
13
|
+
const input = z
|
|
14
|
+
.object({
|
|
15
|
+
code: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(maxSnippetCodeLength)
|
|
19
|
+
.describe("The code to evaluate against the runner's live page, in the scope of `filePath` when one is given."),
|
|
20
|
+
filePath: runFilePathSchema
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Path of the file the snippet is evaluated in the scope of. Omit to evaluate a snippet that imports nothing of yours."),
|
|
23
|
+
files: runFilesSchema
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("The file named by `filePath` and everything it imports. A runner holds no copy of your project, so a snippet's scope has to travel with it."),
|
|
26
|
+
id: runnerIdSchema.describe("Id of the runner to evaluate the snippet on."),
|
|
27
|
+
})
|
|
28
|
+
.refine((request) => request.filePath === undefined ||
|
|
29
|
+
Object.hasOwn(request.files ?? {}, request.filePath), {
|
|
30
|
+
error: "A snippet naming a file must carry that file in files.",
|
|
31
|
+
path: ["files"],
|
|
32
|
+
});
|
|
33
|
+
const output = z.discriminatedUnion("outcome", [
|
|
34
|
+
z.object({
|
|
35
|
+
errorMessage: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Present when `result` is `error`."),
|
|
39
|
+
outcome: z.literal("evaluated"),
|
|
40
|
+
result: z
|
|
41
|
+
.enum(["success", "stopped", "error"])
|
|
42
|
+
.describe("`success` if the snippet ran to completion, `stopped` if it was interrupted, `error` if it threw. Whether it ran, not what it evaluated to."),
|
|
43
|
+
}),
|
|
44
|
+
runnerUnreachableSchema,
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
description: "Evaluate a snippet against whatever the runner's browser is showing right now. Answers whether the snippet ran, and its error if it threw — not the value it evaluated to, so read anything you want back out of the runner's journal (a snippet's `console.log` lands in the `console` stream). A snippet starts no run and leaves no run-scoped journal entries of its own. `runner-unreachable` if the runner could not be reached or could not evaluate: as well as a runner that is still starting, has terminated after inactivity, or is busy, this covers a runner with no live page to evaluate against — which will never clear, so check that the runner you launched is one that runs a browser before retrying. It is NOT proof the snippet did not run: a snippet that outlives the answer window is still executing when you read this, so do not blindly resubmit one that mutates what the page is looking at.",
|
|
48
|
+
input,
|
|
49
|
+
kind: "write",
|
|
50
|
+
name: "runner.evaluateSnippet",
|
|
51
|
+
output,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=evaluateSnippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateSnippet.js","sourceRoot":"","sources":["../../../src/v1/runner/evaluateSnippet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,EAAE;IACtD,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,oBAAoB,CAAC;aACzB,QAAQ,CACP,oGAAoG,CACrG;QACH,QAAQ,EAAE,iBAAiB;aACxB,QAAQ,EAAE;aACV,QAAQ,CACP,sHAAsH,CACvH;QACH,KAAK,EAAE,cAAc;aAClB,QAAQ,EAAE;aACV,QAAQ,CACP,6IAA6I,CAC9I;QACH,EAAE,EAAE,cAAc,CAAC,QAAQ,CACzB,8CAA8C,CAC/C;KACF,CAAC;SACD,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,CAAC,QAAQ,KAAK,SAAS;QAC9B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,EACtD;QACE,KAAK,EAAE,wDAAwD;QAC/D,IAAI,EAAE,CAAC,OAAO,CAAC;KAChB,CACF,CAAC;IAEJ,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,YAAY,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,mCAAmC,CAAC;YAChD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;YAC/B,MAAM,EAAE,CAAC;iBACN,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;iBACrC,QAAQ,CACP,6IAA6I,CAC9I;SACJ,CAAC;QACF,uBAAuB;KACxB,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,i4BAAi4B;QACn4B,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,wBAAwB;QAC9B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Which of a project's files travel to a runner. Published so a client collects
|
|
4
|
+
* with exactly what the server validates with; the predicate is the schema
|
|
5
|
+
* asked as a question. How much may travel is in `payloadSize.ts`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* An allowlist, because everything here is written into the run program and
|
|
9
|
+
* some of it is transformed — and one that can be widened later, which a
|
|
10
|
+
* stricter rule could not be.
|
|
11
|
+
*/
|
|
12
|
+
export declare const shippableRunFileExtensions: readonly [".cjs", ".js", ".json", ".mjs", ".ts", ".tsx"];
|
|
13
|
+
/** Whether this file travels to a runner. Filter a working tree with it. */
|
|
14
|
+
export declare function isShippableRunFilePath(path: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Exported because `runFilesSchema` checks record keys as a refinement — a key
|
|
17
|
+
* schema's message would reach the caller as a bare "invalid key in record".
|
|
18
|
+
*/
|
|
19
|
+
export declare const runFilePathRefusal: string;
|
|
20
|
+
export declare const runFilePathSchema: z.ZodString;
|
|
21
|
+
/**
|
|
22
|
+
* The file a runner reads npm dependencies from. It travels like any other file
|
|
23
|
+
* and is not written to the run program: the runner writes its own.
|
|
24
|
+
*/
|
|
25
|
+
export declare const runPackageJsonPath = "package.json";
|
|
26
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,0DAO7B,CAAC;AAuBX,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAW5D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAuR,CAAC;AAEvT,eAAO,MAAM,iBAAiB,aAE5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Which of a project's files travel to a runner. Published so a client collects
|
|
4
|
+
* with exactly what the server validates with; the predicate is the schema
|
|
5
|
+
* asked as a question. How much may travel is in `payloadSize.ts`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* An allowlist, because everything here is written into the run program and
|
|
9
|
+
* some of it is transformed — and one that can be widened later, which a
|
|
10
|
+
* stricter rule could not be.
|
|
11
|
+
*/
|
|
12
|
+
export const shippableRunFileExtensions = [
|
|
13
|
+
".cjs",
|
|
14
|
+
".js",
|
|
15
|
+
".json",
|
|
16
|
+
".mjs",
|
|
17
|
+
".ts",
|
|
18
|
+
".tsx",
|
|
19
|
+
];
|
|
20
|
+
/** A path becomes a filesystem path on the runner, so it is bounded. */
|
|
21
|
+
const maxRunFilePathLength = 1024;
|
|
22
|
+
/**
|
|
23
|
+
* A denylist of what would make the path address somewhere outside the run
|
|
24
|
+
* program: `.`/`..` navigate, a leading dot ships `.env` and `.git`, an empty
|
|
25
|
+
* segment is an absolute or doubled separator, a backslash can smuggle a
|
|
26
|
+
* separator past the check, and control characters confuse the tooling.
|
|
27
|
+
* Everything else — including non-ASCII names — travels.
|
|
28
|
+
*/
|
|
29
|
+
function isShippableRunFilePathSegment(segment) {
|
|
30
|
+
if (segment === "" || segment === "." || segment === "..")
|
|
31
|
+
return false;
|
|
32
|
+
if (segment.startsWith("."))
|
|
33
|
+
return false;
|
|
34
|
+
if (segment.includes("\\"))
|
|
35
|
+
return false;
|
|
36
|
+
// eslint-disable-next-line no-control-regex -- refusing control characters is the point
|
|
37
|
+
return !/[\u0000-\u001f\u007f]/.test(segment);
|
|
38
|
+
}
|
|
39
|
+
/** The runner installs dependencies itself, so `node_modules` never ships. */
|
|
40
|
+
const neverShippedPathSegments = new Set(["node_modules"]);
|
|
41
|
+
/** Whether this file travels to a runner. Filter a working tree with it. */
|
|
42
|
+
export function isShippableRunFilePath(path) {
|
|
43
|
+
if (path.length < 1 || path.length > maxRunFilePathLength)
|
|
44
|
+
return false;
|
|
45
|
+
if (!shippableRunFileExtensions.some((extension) => path.endsWith(extension)))
|
|
46
|
+
return false;
|
|
47
|
+
return path
|
|
48
|
+
.split("/")
|
|
49
|
+
.every((segment) => isShippableRunFilePathSegment(segment) &&
|
|
50
|
+
!neverShippedPathSegments.has(segment));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Exported because `runFilesSchema` checks record keys as a refinement — a key
|
|
54
|
+
* schema's message would reach the caller as a bare "invalid key in record".
|
|
55
|
+
*/
|
|
56
|
+
export const runFilePathRefusal = `A run file path must end in one of ${shippableRunFileExtensions.join(", ")}, be at most ${maxRunFilePathLength} characters, and be a relative path whose segments are none of: empty, "." or "..", dot-prefixed, "node_modules", or containing a backslash or a control character.`;
|
|
57
|
+
export const runFilePathSchema = z.string().refine(isShippableRunFilePath, {
|
|
58
|
+
error: runFilePathRefusal,
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* The file a runner reads npm dependencies from. It travels like any other file
|
|
62
|
+
* and is not written to the run program: the runner writes its own.
|
|
63
|
+
*/
|
|
64
|
+
export const runPackageJsonPath = "package.json";
|
|
65
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/v1/runner/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;CACE,CAAC;AAEX,wEAAwE;AACxE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC;;;;;;GAMG;AACH,SAAS,6BAA6B,CAAC,OAAe;IACpD,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxE,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,wFAAwF;IACxF,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,8EAA8E;AAC9E,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;AAE3D,4EAA4E;AAC5E,M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