@qawolf/api-contracts 0.20.0 → 0.22.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/index.d.ts +429 -6
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +31 -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/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/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/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/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,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The wire shapes of a runner's journal: what a read asks for and what it
|
|
4
|
+
* answers with. One definition serves the writer, the server and the client,
|
|
5
|
+
* so an entry cannot come to mean different things along the way.
|
|
6
|
+
*/
|
|
7
|
+
/** One appended line in one stream's NDJSON file. */
|
|
8
|
+
export type JournalEntry<Payload> = {
|
|
9
|
+
payload: Payload;
|
|
10
|
+
/** Wall clock at append, ISO 8601 in UTC. */
|
|
11
|
+
recordedAt: string;
|
|
12
|
+
/** Monotonic per stream, starting at 1; the read cursor. */
|
|
13
|
+
sequence: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* zod treats an `unknown` field as an optional key, so without the refinement a
|
|
17
|
+
* line missing `payload` would parse to an entry whose payload is undefined
|
|
18
|
+
* under a type promising one.
|
|
19
|
+
*/
|
|
20
|
+
export declare const journalEntrySchema: z.ZodPipe<z.ZodObject<{
|
|
21
|
+
payload: z.ZodUnknown;
|
|
22
|
+
recordedAt: z.ZodISODateTime;
|
|
23
|
+
sequence: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>, z.ZodTransform<JournalEntry<unknown>, {
|
|
25
|
+
payload: unknown;
|
|
26
|
+
recordedAt: string;
|
|
27
|
+
sequence: number;
|
|
28
|
+
}>>;
|
|
29
|
+
export declare const knownJournalStreams: readonly ["console", "recorder", "run-events", "run-logs", "run-status"];
|
|
30
|
+
export type KnownJournalStream = (typeof knownJournalStreams)[number];
|
|
31
|
+
/**
|
|
32
|
+
* An open set, so a later change can add a stream without breaking consumers;
|
|
33
|
+
* the `string & {}` arm keeps the known names as completions. An unwritten
|
|
34
|
+
* stream reads as empty, never as an error.
|
|
35
|
+
*/
|
|
36
|
+
export type JournalStream = KnownJournalStream | (string & {});
|
|
37
|
+
/**
|
|
38
|
+
* A stream name doubles as a directory name under the journal root, so it is
|
|
39
|
+
* bounded in shape and length: outside this, a name could address a path
|
|
40
|
+
* outside the journal or fail at the filesystem with ENAMETOOLONG.
|
|
41
|
+
*/
|
|
42
|
+
export declare const maxJournalStreamNameLength = 64;
|
|
43
|
+
export declare const journalStreamSchema: z.ZodString;
|
|
44
|
+
/**
|
|
45
|
+
* A wire type, so the filters are optional fields rather than our usual
|
|
46
|
+
* `| undefined`: JSON has no undefined, and omission is the only way a client
|
|
47
|
+
* can not-supply one.
|
|
48
|
+
*
|
|
49
|
+
* The filters compose in one order: `runId` restricts, `sinceSequence` cuts
|
|
50
|
+
* strictly-after, `tail` keeps the newest N of what remains. With neither
|
|
51
|
+
* `sinceSequence` nor `tail`, the read starts from the oldest available entry.
|
|
52
|
+
*/
|
|
53
|
+
export type ReadJournalRequest = {
|
|
54
|
+
/** Restrict run-scoped streams (run-events, run-logs, run-status) to one run. */
|
|
55
|
+
runId?: string;
|
|
56
|
+
/** Entries strictly after this sequence. Omitted: from the oldest available. */
|
|
57
|
+
sinceSequence?: number;
|
|
58
|
+
stream: JournalStream;
|
|
59
|
+
/** Keep only the newest N of whatever the other filters matched. */
|
|
60
|
+
tail?: number;
|
|
61
|
+
};
|
|
62
|
+
/** `runId` is compared against every scanned entry, so it is bounded. */
|
|
63
|
+
export declare const readJournalRequestSchema: z.ZodObject<{
|
|
64
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
sinceSequence: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
stream: z.ZodString;
|
|
67
|
+
tail: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type ReadJournalResponse = {
|
|
70
|
+
/** Exactly what {@link readJournalResponseSchema} parses to, so not readonly. */
|
|
71
|
+
entries: JournalEntry<unknown>[];
|
|
72
|
+
/**
|
|
73
|
+
* True when a `tail` read stopped at its scan budget with older history it
|
|
74
|
+
* never looked at: page forwards with `sinceSequence`, or narrow the filters.
|
|
75
|
+
* False means everything matching the request is in `entries`. Never set by
|
|
76
|
+
* the response's own entry cap, which `nextSequence` already reports.
|
|
77
|
+
*/
|
|
78
|
+
hasUnsearchedHistory: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The cursor to continue from: the highest sequence this read examined, so a
|
|
81
|
+
* filtered read that matched nothing still advances.
|
|
82
|
+
*/
|
|
83
|
+
nextSequence: number;
|
|
84
|
+
/**
|
|
85
|
+
* The oldest sequence still on disk, or 0 when the stream holds nothing. A
|
|
86
|
+
* `sinceSequence` below this means the size cap truncated history away.
|
|
87
|
+
*/
|
|
88
|
+
oldestAvailableSequence: number;
|
|
89
|
+
};
|
|
90
|
+
export declare const readJournalResponseSchema: z.ZodObject<{
|
|
91
|
+
entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
92
|
+
payload: z.ZodUnknown;
|
|
93
|
+
recordedAt: z.ZodISODateTime;
|
|
94
|
+
sequence: z.ZodNumber;
|
|
95
|
+
}, z.core.$strip>, z.ZodTransform<JournalEntry<unknown>, {
|
|
96
|
+
payload: unknown;
|
|
97
|
+
recordedAt: string;
|
|
98
|
+
sequence: number;
|
|
99
|
+
}>>>;
|
|
100
|
+
hasUnsearchedHistory: z.ZodBoolean;
|
|
101
|
+
nextSequence: z.ZodNumber;
|
|
102
|
+
oldestAvailableSequence: z.ZodNumber;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/journal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,qDAAqD;AACrD,MAAM,MAAM,YAAY,CAAC,OAAO,IAAI;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;GAgB5B,CAAC;AAEJ,eAAO,MAAM,mBAAmB,0EAMtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,mBAAmB,aAGE,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,wBAAwB;;;;;iBAKK,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG;IAChC,iFAAiF;IACjF,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;IACjC;;;;;OAKG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAKK,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* zod treats an `unknown` field as an optional key, so without the refinement a
|
|
4
|
+
* line missing `payload` would parse to an entry whose payload is undefined
|
|
5
|
+
* under a type promising one.
|
|
6
|
+
*/
|
|
7
|
+
export const journalEntrySchema = z
|
|
8
|
+
.object({
|
|
9
|
+
payload: z.unknown(),
|
|
10
|
+
recordedAt: z.iso.datetime(),
|
|
11
|
+
sequence: z.number().int().positive(),
|
|
12
|
+
})
|
|
13
|
+
.refine((entry) => "payload" in entry, {
|
|
14
|
+
error: "A journal entry must carry a payload key.",
|
|
15
|
+
path: ["payload"],
|
|
16
|
+
})
|
|
17
|
+
.transform((entry) => ({
|
|
18
|
+
payload: entry.payload,
|
|
19
|
+
recordedAt: entry.recordedAt,
|
|
20
|
+
sequence: entry.sequence,
|
|
21
|
+
}));
|
|
22
|
+
export const knownJournalStreams = [
|
|
23
|
+
"console",
|
|
24
|
+
"recorder",
|
|
25
|
+
"run-events",
|
|
26
|
+
"run-logs",
|
|
27
|
+
"run-status",
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* A stream name doubles as a directory name under the journal root, so it is
|
|
31
|
+
* bounded in shape and length: outside this, a name could address a path
|
|
32
|
+
* outside the journal or fail at the filesystem with ENAMETOOLONG.
|
|
33
|
+
*/
|
|
34
|
+
export const maxJournalStreamNameLength = 64;
|
|
35
|
+
export const journalStreamSchema = z
|
|
36
|
+
.string()
|
|
37
|
+
.max(maxJournalStreamNameLength)
|
|
38
|
+
.regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
39
|
+
/** `runId` is compared against every scanned entry, so it is bounded. */
|
|
40
|
+
export const readJournalRequestSchema = z.object({
|
|
41
|
+
runId: z.string().min(1).max(128).optional(),
|
|
42
|
+
sinceSequence: z.number().int().nonnegative().optional(),
|
|
43
|
+
stream: journalStreamSchema,
|
|
44
|
+
tail: z.number().int().positive().optional(),
|
|
45
|
+
});
|
|
46
|
+
export const readJournalResponseSchema = z.object({
|
|
47
|
+
entries: z.array(journalEntrySchema),
|
|
48
|
+
hasUnsearchedHistory: z.boolean(),
|
|
49
|
+
nextSequence: z.number().int().nonnegative(),
|
|
50
|
+
oldestAvailableSequence: z.number().int().nonnegative(),
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=journal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../src/v1/runner/journal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,IAAI,KAAK,EAAE;IACrC,KAAK,EAAE,2CAA2C;IAClD,IAAI,EAAE,CAAC,SAAS,CAAC;CAClB,CAAC;KACD,SAAS,CACR,CAAC,KAAK,EAAyB,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE,KAAK,CAAC,OAAO;IACtB,UAAU,EAAE,KAAK,CAAC,UAAU;IAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;CACzB,CAAC,CACH,CAAC;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS;IACT,UAAU;IACV,YAAY;IACZ,UAAU;IACV,YAAY;CACJ,CAAC;AAWX;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,EAAE;KACR,GAAG,CAAC,0BAA0B,CAAC;KAC/B,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAqBnC,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC5C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACxD,MAAM,EAAE,mBAAmB;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAyC,CAAC;AAwB3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;IACpC,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACxD,CAA0C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* How much file content one request may carry, counted as UTF-8 bytes of every
|
|
4
|
+
* path and content. A bound on content rather than on the encoded request,
|
|
5
|
+
* because it is the half a client can apply while collecting — escaping can
|
|
6
|
+
* inflate the encoding severalfold, which
|
|
7
|
+
* {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
|
|
8
|
+
*/
|
|
9
|
+
export declare const maxRunFilesByteLength: number;
|
|
10
|
+
/**
|
|
11
|
+
* The largest request, JSON-encoded, that may be sent to a runner. Checked
|
|
12
|
+
* against the fully assembled request, so an oversized one is refused with a
|
|
13
|
+
* reason rather than failing opaquely in transport.
|
|
14
|
+
*/
|
|
15
|
+
export declare const maxRunnerRequestEncodedByteLength: number;
|
|
16
|
+
/** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
|
|
17
|
+
export declare function runFilesByteLength(files: RunFiles): number;
|
|
18
|
+
/**
|
|
19
|
+
* The files of one request, keyed by path: each path shippable, and all of the
|
|
20
|
+
* contents together inside the content cap. A record rather than an array of
|
|
21
|
+
* `{ path, content }` pairs: duplicates become unrepresentable, and the CLI can
|
|
22
|
+
* derive a flag from a record of strings but not from an array of objects.
|
|
23
|
+
*/
|
|
24
|
+
export declare const runFilesSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
25
|
+
/** Every file of one request, keyed by its path. */
|
|
26
|
+
export type RunFiles = Record<string, string>;
|
|
27
|
+
//# sourceMappingURL=payloadSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payloadSize.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAkB,CAAC;AAEjE,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAM1D;AAOD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uCAgBvB,CAAC;AAEL,oDAAoD;AACpD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { isShippableRunFilePath, runFilePathRefusal } from "./files.js";
|
|
3
|
+
/**
|
|
4
|
+
* How much file content one request may carry, counted as UTF-8 bytes of every
|
|
5
|
+
* path and content. A bound on content rather than on the encoded request,
|
|
6
|
+
* because it is the half a client can apply while collecting — escaping can
|
|
7
|
+
* inflate the encoding severalfold, which
|
|
8
|
+
* {@link maxRunnerRequestEncodedByteLength} bounds on the way out.
|
|
9
|
+
*/
|
|
10
|
+
export const maxRunFilesByteLength = 4 * 1024 * 1024;
|
|
11
|
+
/**
|
|
12
|
+
* The largest request, JSON-encoded, that may be sent to a runner. Checked
|
|
13
|
+
* against the fully assembled request, so an oversized one is refused with a
|
|
14
|
+
* reason rather than failing opaquely in transport.
|
|
15
|
+
*/
|
|
16
|
+
export const maxRunnerRequestEncodedByteLength = 9 * 1024 * 1024;
|
|
17
|
+
/** UTF-8 bytes these files would carry. Compare against {@link maxRunFilesByteLength}. */
|
|
18
|
+
export function runFilesByteLength(files) {
|
|
19
|
+
return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength(content) + utf8ByteLength(path), 0);
|
|
20
|
+
}
|
|
21
|
+
/** UTF-8 byte counts, so a non-Latin project is not undercounted severalfold. */
|
|
22
|
+
function utf8ByteLength(text) {
|
|
23
|
+
return Buffer.byteLength(text, "utf8");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The files of one request, keyed by path: each path shippable, and all of the
|
|
27
|
+
* contents together inside the content cap. A record rather than an array of
|
|
28
|
+
* `{ path, content }` pairs: duplicates become unrepresentable, and the CLI can
|
|
29
|
+
* derive a flag from a record of strings but not from an array of objects.
|
|
30
|
+
*/
|
|
31
|
+
export const runFilesSchema = z
|
|
32
|
+
.record(z.string(), z.string())
|
|
33
|
+
// As a refinement, not a key schema: a key schema's message reaches the
|
|
34
|
+
// caller as a bare "invalid key in record".
|
|
35
|
+
.superRefine((files, refinementContext) => {
|
|
36
|
+
for (const path of Object.keys(files)) {
|
|
37
|
+
if (isShippableRunFilePath(path))
|
|
38
|
+
continue;
|
|
39
|
+
refinementContext.addIssue({
|
|
40
|
+
code: "custom",
|
|
41
|
+
message: runFilePathRefusal,
|
|
42
|
+
path: [path],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.refine((files) => runFilesByteLength(files) <= maxRunFilesByteLength, {
|
|
47
|
+
error: `The files in one request may carry at most ${maxRunFilesByteLength} bytes in total.`,
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=payloadSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payloadSize.js","sourceRoot":"","sources":["../../../src/v1/runner/payloadSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE,0FAA0F;AAC1F,MAAM,UAAU,kBAAkB,CAAC,KAAe;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CACjC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CACzB,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,EACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,wEAAwE;IACxE,4CAA4C;KAC3C,WAAW,CAAC,CAAC,KAAK,EAAE,iBAAiB,EAAE,EAAE;IACxC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,IAAI,sBAAsB,CAAC,IAAI,CAAC;YAAE,SAAS;QAC3C,iBAAiB,CAAC,QAAQ,CAAC;YACzB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kBAAkB;YAC3B,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,qBAAqB,EAAE;IACrE,KAAK,EAAE,8CAA8C,qBAAqB,kBAAkB;CAC7F,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const makeReadRunnerJournalContract: () => {
|
|
3
|
+
readonly description: "Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: `run-status` settles it, `run-logs` and `run-events` carry what it produced, and `recorder` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. `runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may be too busy to answer. Nothing was changed, so retrying is safe; if it persists, launch the runner again.";
|
|
4
|
+
readonly input: z.ZodObject<{
|
|
5
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
sinceSequence: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
tail: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
stream: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
readonly kind: "read";
|
|
12
|
+
readonly name: "runner.readJournal";
|
|
13
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
entries: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
15
|
+
payload: z.ZodUnknown;
|
|
16
|
+
recordedAt: z.ZodISODateTime;
|
|
17
|
+
sequence: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>, z.ZodTransform<import("./journal.js").JournalEntry<unknown>, {
|
|
19
|
+
payload: unknown;
|
|
20
|
+
recordedAt: string;
|
|
21
|
+
sequence: number;
|
|
22
|
+
}>>>;
|
|
23
|
+
hasUnsearchedHistory: z.ZodBoolean;
|
|
24
|
+
nextSequence: z.ZodNumber;
|
|
25
|
+
oldestAvailableSequence: z.ZodNumber;
|
|
26
|
+
outcome: z.ZodLiteral<"read">;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
29
|
+
}, z.core.$strip>], "outcome">;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=readJournal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJournal.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBzC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runnerIdSchema } from "./identity.js";
|
|
3
|
+
import { journalStreamSchema, knownJournalStreams, readJournalRequestSchema, readJournalResponseSchema, } from "./journal.js";
|
|
4
|
+
import { retryableRunnerUnreachableDescription, runnerUnreachableSchema, } from "./unreachable.js";
|
|
5
|
+
export const makeReadRunnerJournalContract = () => {
|
|
6
|
+
const input = readJournalRequestSchema.extend({
|
|
7
|
+
id: runnerIdSchema.describe("Id of the runner to read the journal of."),
|
|
8
|
+
stream: journalStreamSchema.describe(`The stream to read. QA Wolf writes ${knownJournalStreams.join(", ")}; an unwritten stream reads as empty rather than as an error.`),
|
|
9
|
+
});
|
|
10
|
+
const output = z.discriminatedUnion("outcome", [
|
|
11
|
+
readJournalResponseSchema.extend({ outcome: z.literal("read") }),
|
|
12
|
+
runnerUnreachableSchema,
|
|
13
|
+
]);
|
|
14
|
+
return {
|
|
15
|
+
description: `Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: \`run-status\` settles it, \`run-logs\` and \`run-events\` carry what it produced, and \`recorder\` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. ${retryableRunnerUnreachableDescription}`,
|
|
16
|
+
input,
|
|
17
|
+
kind: "read",
|
|
18
|
+
name: "runner.readJournal",
|
|
19
|
+
output,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=readJournal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readJournal.js","sourceRoot":"","sources":["../../../src/v1/runner/readJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qCAAqC,EACrC,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,MAAM,KAAK,GAAG,wBAAwB,CAAC,MAAM,CAAC;QAC5C,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACvE,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAClC,sCAAsC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,+DAA+D,CACpI;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,yBAAyB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,uBAAuB;KACxB,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,wcAAwc,qCAAqC,EAAE;QAC5f,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;QAC1B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const makeRunFlowOnRunnerContract: () => {
|
|
3
|
+
readonly description: "Run a flow on an interactive runner. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call answers `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
|
|
4
|
+
readonly input: z.ZodObject<{
|
|
5
|
+
entryPointPath: z.ZodString;
|
|
6
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
readonly kind: "write";
|
|
11
|
+
readonly name: "runner.runFlow";
|
|
12
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
outcome: z.ZodLiteral<"submitted">;
|
|
14
|
+
runId: z.ZodString;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
outcome: z.ZodLiteral<"runner-unreachable">;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
outcome: z.ZodLiteral<"runner-target-mismatch">;
|
|
19
|
+
requiredRunnerName: z.ZodEnum<{
|
|
20
|
+
node20Basic: "node20Basic";
|
|
21
|
+
node20WithAndroid: "node20WithAndroid";
|
|
22
|
+
node20WithIos: "node20WithIos";
|
|
23
|
+
node20WithPlaywright: "node20WithPlaywright";
|
|
24
|
+
}>;
|
|
25
|
+
runnerName: z.ZodEnum<{
|
|
26
|
+
node20Basic: "node20Basic";
|
|
27
|
+
node20WithAndroid: "node20WithAndroid";
|
|
28
|
+
node20WithIos: "node20WithIos";
|
|
29
|
+
node20WithPlaywright: "node20WithPlaywright";
|
|
30
|
+
}>;
|
|
31
|
+
}, z.core.$strip>], "outcome">;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=runFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DvC,CAAC"}
|
|
@@ -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,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.22.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
|
}
|