@qawolf/api-contracts 0.32.0 → 0.34.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.
@@ -797,6 +797,32 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
797
797
  outcome: z.ZodLiteral<"failure">;
798
798
  }, z.core.$strip>], "outcome">;
799
799
  };
800
+ highlightSelector: {
801
+ readonly description: "Highlight the elements a selector matches on an interactive runner's live page, and answer how many it matched. The highlight stays until it is replaced or cleared, so it is visible in the next `runner.takeScreenshot` — which is the point, since a caller cannot see the runner's screen otherwise. Send an empty selector to clear, which answers `cleared`. `status` tells a selector that matched nothing (`empty`) from one the page could not parse (`invalid`), so a caller can tell a bad locator from a locator pointing at nothing. `no-answer` if the page did not answer in time: the highlight runs inside the page, so a page that is gone or mid-navigation does not answer slowly, it does not answer at all. `runner-cannot-highlight-selectors` on a runner with no browser to draw on. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity.";
802
+ readonly input: z.ZodObject<{
803
+ id: z.ZodString;
804
+ selector: z.ZodString;
805
+ }, z.core.$strip>;
806
+ readonly kind: "write";
807
+ readonly name: "runner.highlightSelector";
808
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
809
+ matchCount: z.ZodNumber;
810
+ outcome: z.ZodLiteral<"success">;
811
+ selector: z.ZodString;
812
+ status: z.ZodLiteral<"valid" | "invalid" | "empty">;
813
+ targetPage: z.ZodOptional<z.ZodString>;
814
+ }, z.core.$strip>, z.ZodObject<{
815
+ outcome: z.ZodLiteral<"cleared">;
816
+ }, z.core.$strip>, z.ZodObject<{
817
+ errorMessage: z.ZodOptional<z.ZodString>;
818
+ failureReason: z.ZodEnum<{
819
+ "runner-unreachable": "runner-unreachable";
820
+ "no-answer": "no-answer";
821
+ "runner-cannot-highlight-selectors": "runner-cannot-highlight-selectors";
822
+ }>;
823
+ outcome: z.ZodLiteral<"failure">;
824
+ }, z.core.$strip>], "outcome">;
825
+ };
800
826
  importPackage: {
801
827
  readonly description: "Install a package into an interactive runner's live run and import it, so a snippet or a selection can use it without a full run to reinstall dependencies. An `install-failed` failure carries npm's reason in `errorMessage`. `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 install may still have landed, but installing the same version again does nothing, so retrying is safe.";
802
828
  readonly input: z.ZodObject<{
@@ -848,6 +874,209 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
848
874
  outcome: z.ZodLiteral<"failure">;
849
875
  }, z.core.$strip>], "outcome">;
850
876
  };
877
+ inspectMobile: {
878
+ readonly description: "Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers `runner-is-not-mobile`; call `runner.inspect` for a browser's equivalent surface instead. `what: \"session\"` always answers with the session's own status rather than `screen-needs-a-run`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same `screen-needs-a-run` or `screen-not-ready` outcomes `runner.performAction` and `runner.takeScreenshot` use, instead of reading anything when there is none. `screen-needs-a-run` means no Appium session has started on this runner yet — call `runner.runFlow` with a flow that opens one, then inspect again. `screen-not-ready` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. `runner-is-not-mobile` means there is nothing here to inspect, and retrying will never help — launch an `android` or `ios` 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.";
879
+ readonly input: z.ZodObject<{
880
+ id: z.ZodString;
881
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
882
+ what: z.ZodLiteral<"session">;
883
+ }, z.core.$strip>, z.ZodObject<{
884
+ what: z.ZodLiteral<"contexts">;
885
+ }, z.core.$strip>, z.ZodObject<{
886
+ context: z.ZodOptional<z.ZodString>;
887
+ what: z.ZodLiteral<"page">;
888
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
889
+ by: z.ZodLiteral<"point">;
890
+ context: z.ZodOptional<z.ZodString>;
891
+ what: z.ZodLiteral<"elements">;
892
+ x: z.ZodInt;
893
+ y: z.ZodInt;
894
+ }, z.core.$strip>, z.ZodObject<{
895
+ by: z.ZodLiteral<"text">;
896
+ context: z.ZodOptional<z.ZodString>;
897
+ partial: z.ZodOptional<z.ZodBoolean>;
898
+ text: z.ZodString;
899
+ what: z.ZodLiteral<"elements">;
900
+ }, z.core.$strip>], "by">], "what">;
901
+ }, z.core.$strip>;
902
+ readonly kind: "read";
903
+ readonly name: "runner.inspectMobile";
904
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
905
+ outcome: z.ZodLiteral<"success">;
906
+ session: z.ZodDiscriminatedUnion<[z.ZodObject<{
907
+ deviceName: z.ZodOptional<z.ZodString>;
908
+ platformName: z.ZodString;
909
+ sessionId: z.ZodString;
910
+ type: z.ZodLiteral<"ready">;
911
+ }, z.core.$strip>, z.ZodObject<{
912
+ error: z.ZodString;
913
+ type: z.ZodLiteral<"unreachable">;
914
+ }, z.core.$strip>, z.ZodObject<{
915
+ sessionCount: z.ZodNumber;
916
+ type: z.ZodLiteral<"ambiguous">;
917
+ }, z.core.$strip>, z.ZodObject<{
918
+ type: z.ZodLiteral<"no-session">;
919
+ }, z.core.$strip>], "type">;
920
+ what: z.ZodLiteral<"session">;
921
+ }, z.core.$strip>, z.ZodObject<{
922
+ contexts: z.ZodArray<z.ZodString>;
923
+ current: z.ZodString;
924
+ outcome: z.ZodLiteral<"success">;
925
+ what: z.ZodLiteral<"contexts">;
926
+ }, z.core.$strip>, z.ZodObject<{
927
+ context: z.ZodString;
928
+ orientation: z.ZodEnum<{
929
+ PORTRAIT: "PORTRAIT";
930
+ LANDSCAPE: "LANDSCAPE";
931
+ }>;
932
+ outcome: z.ZodLiteral<"success">;
933
+ pageSource: z.ZodType<{
934
+ selectors: {
935
+ strategy: {
936
+ name: "xpath";
937
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
938
+ } | {
939
+ name: "ios-predicate";
940
+ } | {
941
+ hostSelector: string;
942
+ innerSelector: string;
943
+ name: "shadow";
944
+ };
945
+ value: string;
946
+ }[];
947
+ tag: string;
948
+ attributes?: {
949
+ bounds?: {
950
+ bottom: number;
951
+ left: number;
952
+ right: number;
953
+ top: number;
954
+ } | undefined;
955
+ rest?: Record<string, string> | undefined;
956
+ } | undefined;
957
+ } & {
958
+ children?: (({
959
+ selectors: {
960
+ strategy: {
961
+ name: "xpath";
962
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
963
+ } | {
964
+ name: "ios-predicate";
965
+ } | {
966
+ hostSelector: string;
967
+ innerSelector: string;
968
+ name: "shadow";
969
+ };
970
+ value: string;
971
+ }[];
972
+ tag: string;
973
+ attributes?: {
974
+ bounds?: {
975
+ bottom: number;
976
+ left: number;
977
+ right: number;
978
+ top: number;
979
+ } | undefined;
980
+ rest?: Record<string, string> | undefined;
981
+ } | undefined;
982
+ } & /*elided*/ any) | string)[];
983
+ }, unknown, z.core.$ZodTypeInternals<{
984
+ selectors: {
985
+ strategy: {
986
+ name: "xpath";
987
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
988
+ } | {
989
+ name: "ios-predicate";
990
+ } | {
991
+ hostSelector: string;
992
+ innerSelector: string;
993
+ name: "shadow";
994
+ };
995
+ value: string;
996
+ }[];
997
+ tag: string;
998
+ attributes?: {
999
+ bounds?: {
1000
+ bottom: number;
1001
+ left: number;
1002
+ right: number;
1003
+ top: number;
1004
+ } | undefined;
1005
+ rest?: Record<string, string> | undefined;
1006
+ } | undefined;
1007
+ } & {
1008
+ children?: (({
1009
+ selectors: {
1010
+ strategy: {
1011
+ name: "xpath";
1012
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
1013
+ } | {
1014
+ name: "ios-predicate";
1015
+ } | {
1016
+ hostSelector: string;
1017
+ innerSelector: string;
1018
+ name: "shadow";
1019
+ };
1020
+ value: string;
1021
+ }[];
1022
+ tag: string;
1023
+ attributes?: {
1024
+ bounds?: {
1025
+ bottom: number;
1026
+ left: number;
1027
+ right: number;
1028
+ top: number;
1029
+ } | undefined;
1030
+ rest?: Record<string, string> | undefined;
1031
+ } | undefined;
1032
+ } & /*elided*/ any) | string)[];
1033
+ }, unknown>>;
1034
+ what: z.ZodLiteral<"page">;
1035
+ }, z.core.$strip>, z.ZodObject<{
1036
+ matches: z.ZodArray<z.ZodObject<{
1037
+ attributes: z.ZodRecord<z.ZodString, z.ZodString>;
1038
+ bounds: z.ZodOptional<z.ZodObject<{
1039
+ bottom: z.ZodNumber;
1040
+ left: z.ZodNumber;
1041
+ right: z.ZodNumber;
1042
+ top: z.ZodNumber;
1043
+ }, z.core.$strip>>;
1044
+ center: z.ZodOptional<z.ZodObject<{
1045
+ x: z.ZodNumber;
1046
+ y: z.ZodNumber;
1047
+ }, z.core.$strip>>;
1048
+ selectors: z.ZodArray<z.ZodObject<{
1049
+ strategy: z.ZodUnion<readonly [z.ZodObject<{
1050
+ name: z.ZodLiteral<"xpath">;
1051
+ type: z.ZodEnum<{
1052
+ unique: "unique";
1053
+ "full-path": "full-path";
1054
+ "sibling-of": "sibling-of";
1055
+ "parent-of": "parent-of";
1056
+ }>;
1057
+ }, z.core.$strip>, z.ZodObject<{
1058
+ name: z.ZodLiteral<"ios-predicate">;
1059
+ }, z.core.$strip>, z.ZodObject<{
1060
+ hostSelector: z.ZodString;
1061
+ innerSelector: z.ZodString;
1062
+ name: z.ZodLiteral<"shadow">;
1063
+ }, z.core.$strip>]>;
1064
+ value: z.ZodString;
1065
+ }, z.core.$strip>>;
1066
+ tag: z.ZodString;
1067
+ }, z.core.$strip>>;
1068
+ outcome: z.ZodLiteral<"success">;
1069
+ what: z.ZodLiteral<"elements">;
1070
+ }, z.core.$strip>], "what">, z.ZodObject<{
1071
+ failureReason: z.ZodEnum<{
1072
+ "runner-unreachable": "runner-unreachable";
1073
+ "runner-is-not-mobile": "runner-is-not-mobile";
1074
+ "screen-needs-a-run": "screen-needs-a-run";
1075
+ "screen-not-ready": "screen-not-ready";
1076
+ }>;
1077
+ outcome: z.ZodLiteral<"failure">;
1078
+ }, z.core.$strip>], "outcome">;
1079
+ };
851
1080
  launch: {
852
1081
  readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `alreadyRunning` to tell which happened.";
853
1082
  readonly input: z.ZodObject<{
@@ -933,6 +1162,26 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
933
1162
  outcome: z.ZodLiteral<"failure">;
934
1163
  }, z.core.$strip>], "failureReason">], "outcome">;
935
1164
  };
1165
+ promoteSnapshot: {
1166
+ readonly description: "Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it. The two paths are the ones the diff reported, which reach a caller as an `image-diff-artifact` entry on the runner's `run-events` journal stream. `snapshot-not-found` if the run wrote no screenshot at that path, which usually means the paths were not taken from a diff this run produced; nothing is changed, so correcting the path and repeating is safe. `runner-cannot-promote-snapshots` on a runner that stores no screenshots. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity. A promotion that lands is not undone by promoting again, so a retry after an unreachable answer is safe.";
1167
+ readonly input: z.ZodObject<{
1168
+ baselinePath: z.ZodString;
1169
+ id: z.ZodString;
1170
+ screenshotPath: z.ZodString;
1171
+ }, z.core.$strip>;
1172
+ readonly kind: "write";
1173
+ readonly name: "runner.promoteSnapshot";
1174
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1175
+ outcome: z.ZodLiteral<"success">;
1176
+ }, z.core.$strip>, z.ZodObject<{
1177
+ failureReason: z.ZodEnum<{
1178
+ "runner-unreachable": "runner-unreachable";
1179
+ "runner-cannot-promote-snapshots": "runner-cannot-promote-snapshots";
1180
+ "snapshot-not-found": "snapshot-not-found";
1181
+ }>;
1182
+ outcome: z.ZodLiteral<"failure">;
1183
+ }, z.core.$strip>], "outcome">;
1184
+ };
936
1185
  readJournal: {
937
1186
  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.";
938
1187
  readonly input: z.ZodObject<{
@@ -970,6 +1219,7 @@ export declare const makeContractsV1: <EnvironmentId extends PublicIdSchema, Flo
970
1219
  readonly input: z.ZodObject<{
971
1220
  entryPointPath: z.ZodString;
972
1221
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1222
+ environmentId: z.ZodOptional<PublicIdSchema>;
973
1223
  files: z.ZodRecord<z.ZodString, z.ZodString>;
974
1224
  id: z.ZodString;
975
1225
  selection: z.ZodOptional<z.ZodObject<{
@@ -1880,6 +2130,32 @@ export declare const publicContractsV1: {
1880
2130
  outcome: z.ZodLiteral<"failure">;
1881
2131
  }, z.core.$strip>], "outcome">;
1882
2132
  };
2133
+ highlightSelector: {
2134
+ readonly description: "Highlight the elements a selector matches on an interactive runner's live page, and answer how many it matched. The highlight stays until it is replaced or cleared, so it is visible in the next `runner.takeScreenshot` — which is the point, since a caller cannot see the runner's screen otherwise. Send an empty selector to clear, which answers `cleared`. `status` tells a selector that matched nothing (`empty`) from one the page could not parse (`invalid`), so a caller can tell a bad locator from a locator pointing at nothing. `no-answer` if the page did not answer in time: the highlight runs inside the page, so a page that is gone or mid-navigation does not answer slowly, it does not answer at all. `runner-cannot-highlight-selectors` on a runner with no browser to draw on. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity.";
2135
+ readonly input: z.ZodObject<{
2136
+ id: z.ZodString;
2137
+ selector: z.ZodString;
2138
+ }, z.core.$strip>;
2139
+ readonly kind: "write";
2140
+ readonly name: "runner.highlightSelector";
2141
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
2142
+ matchCount: z.ZodNumber;
2143
+ outcome: z.ZodLiteral<"success">;
2144
+ selector: z.ZodString;
2145
+ status: z.ZodLiteral<"valid" | "invalid" | "empty">;
2146
+ targetPage: z.ZodOptional<z.ZodString>;
2147
+ }, z.core.$strip>, z.ZodObject<{
2148
+ outcome: z.ZodLiteral<"cleared">;
2149
+ }, z.core.$strip>, z.ZodObject<{
2150
+ errorMessage: z.ZodOptional<z.ZodString>;
2151
+ failureReason: z.ZodEnum<{
2152
+ "runner-unreachable": "runner-unreachable";
2153
+ "no-answer": "no-answer";
2154
+ "runner-cannot-highlight-selectors": "runner-cannot-highlight-selectors";
2155
+ }>;
2156
+ outcome: z.ZodLiteral<"failure">;
2157
+ }, z.core.$strip>], "outcome">;
2158
+ };
1883
2159
  importPackage: {
1884
2160
  readonly description: "Install a package into an interactive runner's live run and import it, so a snippet or a selection can use it without a full run to reinstall dependencies. An `install-failed` failure carries npm's reason in `errorMessage`. `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 install may still have landed, but installing the same version again does nothing, so retrying is safe.";
1885
2161
  readonly input: z.ZodObject<{
@@ -1931,6 +2207,209 @@ export declare const publicContractsV1: {
1931
2207
  outcome: z.ZodLiteral<"failure">;
1932
2208
  }, z.core.$strip>], "outcome">;
1933
2209
  };
2210
+ inspectMobile: {
2211
+ readonly description: "Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers `runner-is-not-mobile`; call `runner.inspect` for a browser's equivalent surface instead. `what: \"session\"` always answers with the session's own status rather than `screen-needs-a-run`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same `screen-needs-a-run` or `screen-not-ready` outcomes `runner.performAction` and `runner.takeScreenshot` use, instead of reading anything when there is none. `screen-needs-a-run` means no Appium session has started on this runner yet — call `runner.runFlow` with a flow that opens one, then inspect again. `screen-not-ready` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. `runner-is-not-mobile` means there is nothing here to inspect, and retrying will never help — launch an `android` or `ios` 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.";
2212
+ readonly input: z.ZodObject<{
2213
+ id: z.ZodString;
2214
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
2215
+ what: z.ZodLiteral<"session">;
2216
+ }, z.core.$strip>, z.ZodObject<{
2217
+ what: z.ZodLiteral<"contexts">;
2218
+ }, z.core.$strip>, z.ZodObject<{
2219
+ context: z.ZodOptional<z.ZodString>;
2220
+ what: z.ZodLiteral<"page">;
2221
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
2222
+ by: z.ZodLiteral<"point">;
2223
+ context: z.ZodOptional<z.ZodString>;
2224
+ what: z.ZodLiteral<"elements">;
2225
+ x: z.ZodInt;
2226
+ y: z.ZodInt;
2227
+ }, z.core.$strip>, z.ZodObject<{
2228
+ by: z.ZodLiteral<"text">;
2229
+ context: z.ZodOptional<z.ZodString>;
2230
+ partial: z.ZodOptional<z.ZodBoolean>;
2231
+ text: z.ZodString;
2232
+ what: z.ZodLiteral<"elements">;
2233
+ }, z.core.$strip>], "by">], "what">;
2234
+ }, z.core.$strip>;
2235
+ readonly kind: "read";
2236
+ readonly name: "runner.inspectMobile";
2237
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
2238
+ outcome: z.ZodLiteral<"success">;
2239
+ session: z.ZodDiscriminatedUnion<[z.ZodObject<{
2240
+ deviceName: z.ZodOptional<z.ZodString>;
2241
+ platformName: z.ZodString;
2242
+ sessionId: z.ZodString;
2243
+ type: z.ZodLiteral<"ready">;
2244
+ }, z.core.$strip>, z.ZodObject<{
2245
+ error: z.ZodString;
2246
+ type: z.ZodLiteral<"unreachable">;
2247
+ }, z.core.$strip>, z.ZodObject<{
2248
+ sessionCount: z.ZodNumber;
2249
+ type: z.ZodLiteral<"ambiguous">;
2250
+ }, z.core.$strip>, z.ZodObject<{
2251
+ type: z.ZodLiteral<"no-session">;
2252
+ }, z.core.$strip>], "type">;
2253
+ what: z.ZodLiteral<"session">;
2254
+ }, z.core.$strip>, z.ZodObject<{
2255
+ contexts: z.ZodArray<z.ZodString>;
2256
+ current: z.ZodString;
2257
+ outcome: z.ZodLiteral<"success">;
2258
+ what: z.ZodLiteral<"contexts">;
2259
+ }, z.core.$strip>, z.ZodObject<{
2260
+ context: z.ZodString;
2261
+ orientation: z.ZodEnum<{
2262
+ PORTRAIT: "PORTRAIT";
2263
+ LANDSCAPE: "LANDSCAPE";
2264
+ }>;
2265
+ outcome: z.ZodLiteral<"success">;
2266
+ pageSource: z.ZodType<{
2267
+ selectors: {
2268
+ strategy: {
2269
+ name: "xpath";
2270
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
2271
+ } | {
2272
+ name: "ios-predicate";
2273
+ } | {
2274
+ hostSelector: string;
2275
+ innerSelector: string;
2276
+ name: "shadow";
2277
+ };
2278
+ value: string;
2279
+ }[];
2280
+ tag: string;
2281
+ attributes?: {
2282
+ bounds?: {
2283
+ bottom: number;
2284
+ left: number;
2285
+ right: number;
2286
+ top: number;
2287
+ } | undefined;
2288
+ rest?: Record<string, string> | undefined;
2289
+ } | undefined;
2290
+ } & {
2291
+ children?: (({
2292
+ selectors: {
2293
+ strategy: {
2294
+ name: "xpath";
2295
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
2296
+ } | {
2297
+ name: "ios-predicate";
2298
+ } | {
2299
+ hostSelector: string;
2300
+ innerSelector: string;
2301
+ name: "shadow";
2302
+ };
2303
+ value: string;
2304
+ }[];
2305
+ tag: string;
2306
+ attributes?: {
2307
+ bounds?: {
2308
+ bottom: number;
2309
+ left: number;
2310
+ right: number;
2311
+ top: number;
2312
+ } | undefined;
2313
+ rest?: Record<string, string> | undefined;
2314
+ } | undefined;
2315
+ } & /*elided*/ any) | string)[];
2316
+ }, unknown, z.core.$ZodTypeInternals<{
2317
+ selectors: {
2318
+ strategy: {
2319
+ name: "xpath";
2320
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
2321
+ } | {
2322
+ name: "ios-predicate";
2323
+ } | {
2324
+ hostSelector: string;
2325
+ innerSelector: string;
2326
+ name: "shadow";
2327
+ };
2328
+ value: string;
2329
+ }[];
2330
+ tag: string;
2331
+ attributes?: {
2332
+ bounds?: {
2333
+ bottom: number;
2334
+ left: number;
2335
+ right: number;
2336
+ top: number;
2337
+ } | undefined;
2338
+ rest?: Record<string, string> | undefined;
2339
+ } | undefined;
2340
+ } & {
2341
+ children?: (({
2342
+ selectors: {
2343
+ strategy: {
2344
+ name: "xpath";
2345
+ type: "unique" | "full-path" | "sibling-of" | "parent-of";
2346
+ } | {
2347
+ name: "ios-predicate";
2348
+ } | {
2349
+ hostSelector: string;
2350
+ innerSelector: string;
2351
+ name: "shadow";
2352
+ };
2353
+ value: string;
2354
+ }[];
2355
+ tag: string;
2356
+ attributes?: {
2357
+ bounds?: {
2358
+ bottom: number;
2359
+ left: number;
2360
+ right: number;
2361
+ top: number;
2362
+ } | undefined;
2363
+ rest?: Record<string, string> | undefined;
2364
+ } | undefined;
2365
+ } & /*elided*/ any) | string)[];
2366
+ }, unknown>>;
2367
+ what: z.ZodLiteral<"page">;
2368
+ }, z.core.$strip>, z.ZodObject<{
2369
+ matches: z.ZodArray<z.ZodObject<{
2370
+ attributes: z.ZodRecord<z.ZodString, z.ZodString>;
2371
+ bounds: z.ZodOptional<z.ZodObject<{
2372
+ bottom: z.ZodNumber;
2373
+ left: z.ZodNumber;
2374
+ right: z.ZodNumber;
2375
+ top: z.ZodNumber;
2376
+ }, z.core.$strip>>;
2377
+ center: z.ZodOptional<z.ZodObject<{
2378
+ x: z.ZodNumber;
2379
+ y: z.ZodNumber;
2380
+ }, z.core.$strip>>;
2381
+ selectors: z.ZodArray<z.ZodObject<{
2382
+ strategy: z.ZodUnion<readonly [z.ZodObject<{
2383
+ name: z.ZodLiteral<"xpath">;
2384
+ type: z.ZodEnum<{
2385
+ unique: "unique";
2386
+ "full-path": "full-path";
2387
+ "sibling-of": "sibling-of";
2388
+ "parent-of": "parent-of";
2389
+ }>;
2390
+ }, z.core.$strip>, z.ZodObject<{
2391
+ name: z.ZodLiteral<"ios-predicate">;
2392
+ }, z.core.$strip>, z.ZodObject<{
2393
+ hostSelector: z.ZodString;
2394
+ innerSelector: z.ZodString;
2395
+ name: z.ZodLiteral<"shadow">;
2396
+ }, z.core.$strip>]>;
2397
+ value: z.ZodString;
2398
+ }, z.core.$strip>>;
2399
+ tag: z.ZodString;
2400
+ }, z.core.$strip>>;
2401
+ outcome: z.ZodLiteral<"success">;
2402
+ what: z.ZodLiteral<"elements">;
2403
+ }, z.core.$strip>], "what">, z.ZodObject<{
2404
+ failureReason: z.ZodEnum<{
2405
+ "runner-unreachable": "runner-unreachable";
2406
+ "runner-is-not-mobile": "runner-is-not-mobile";
2407
+ "screen-needs-a-run": "screen-needs-a-run";
2408
+ "screen-not-ready": "screen-not-ready";
2409
+ }>;
2410
+ outcome: z.ZodLiteral<"failure">;
2411
+ }, z.core.$strip>], "outcome">;
2412
+ };
1934
2413
  launch: {
1935
2414
  readonly description: "Launch an interactive runner on the caller's team under an id the caller chooses. Launching the same id again returns the runner already running rather than starting a second one, and the same id with a different runnerName is refused. A runner is not permanent: it terminates on its own after a period of inactivity, and launching the same id after that starts and bills a new runner — so read `alreadyRunning` to tell which happened.";
1936
2415
  readonly input: z.ZodObject<{
@@ -2016,6 +2495,26 @@ export declare const publicContractsV1: {
2016
2495
  outcome: z.ZodLiteral<"failure">;
2017
2496
  }, z.core.$strip>], "failureReason">], "outcome">;
2018
2497
  };
2498
+ promoteSnapshot: {
2499
+ readonly description: "Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it. The two paths are the ones the diff reported, which reach a caller as an `image-diff-artifact` entry on the runner's `run-events` journal stream. `snapshot-not-found` if the run wrote no screenshot at that path, which usually means the paths were not taken from a diff this run produced; nothing is changed, so correcting the path and repeating is safe. `runner-cannot-promote-snapshots` on a runner that stores no screenshots. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity. A promotion that lands is not undone by promoting again, so a retry after an unreachable answer is safe.";
2500
+ readonly input: z.ZodObject<{
2501
+ baselinePath: z.ZodString;
2502
+ id: z.ZodString;
2503
+ screenshotPath: z.ZodString;
2504
+ }, z.core.$strip>;
2505
+ readonly kind: "write";
2506
+ readonly name: "runner.promoteSnapshot";
2507
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
2508
+ outcome: z.ZodLiteral<"success">;
2509
+ }, z.core.$strip>, z.ZodObject<{
2510
+ failureReason: z.ZodEnum<{
2511
+ "runner-unreachable": "runner-unreachable";
2512
+ "runner-cannot-promote-snapshots": "runner-cannot-promote-snapshots";
2513
+ "snapshot-not-found": "snapshot-not-found";
2514
+ }>;
2515
+ outcome: z.ZodLiteral<"failure">;
2516
+ }, z.core.$strip>], "outcome">;
2517
+ };
2019
2518
  readJournal: {
2020
2519
  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.";
2021
2520
  readonly input: z.ZodObject<{
@@ -2053,6 +2552,7 @@ export declare const publicContractsV1: {
2053
2552
  readonly input: z.ZodObject<{
2054
2553
  entryPointPath: z.ZodString;
2055
2554
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2555
+ environmentId: z.ZodOptional<PublicIdSchema>;
2056
2556
  files: z.ZodRecord<z.ZodString, z.ZodString>;
2057
2557
  id: z.ZodString;
2058
2558
  selection: z.ZodOptional<z.ZodObject<{
@@ -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,qBAAqB,CAAC;AAC9E,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,sBAAsB,CAAC;AAGrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAc5D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEvB,MAAM,UAAU,CAAC;AAwBlB,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,oBAAoB,IAAI,CAAC,CAAC,KAAK,CACpE,GAAG,CAAC,OAAO,CAAC,CACb,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,GAAG,SAAS,oBAAoB,IAAI,CAAC,CAAC,KAAK,CACrE,GAAG,CAAC,QAAQ,CAAC,CACd,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,YAAY,SAAS,cAAc,GAAG,cAAc,EACpD,OAAO,SAAS,cAAc,GAAG,cAAc,EAC/C,WAAW,SAAS,cAAc,GAAG,cAAc,EACnD,QAAQ,SAAS,cAAc,GAAG,cAAc,EAEhD,KAAK,iB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoC,CAAC"}
package/dist/v1/index.js CHANGED
@@ -21,10 +21,13 @@ import { makeGetRunContract } from "./run/get.js";
21
21
  import { makeCreateRunContract } from "./run/index.js";
22
22
  import { makeReattemptRunContract } from "./run/reattempt.js";
23
23
  import { makeEvaluateSnippetOnRunnerContract } from "./runner/evaluateSnippet.js";
24
+ import { makeHighlightSelectorOnRunnerContract } from "./runner/highlightSelector.js";
24
25
  import { makeImportPackageOnRunnerContract } from "./runner/importPackage.js";
25
26
  import { makeLaunchRunnerContract, makeTerminateRunnerContract, } from "./runner/index.js";
26
27
  import { makeInspectOnRunnerContract } from "./runner/inspect.js";
28
+ import { makeInspectMobileOnRunnerContract } from "./runner/inspectMobile.js";
27
29
  import { makePerformActionOnRunnerContract } from "./runner/performAction.js";
30
+ import { makePromoteSnapshotOnRunnerContract } from "./runner/promoteSnapshot.js";
28
31
  import { makeReadRunnerJournalContract } from "./runner/readJournal.js";
29
32
  import { makeRunFlowOnRunnerContract } from "./runner/runFlow.js";
30
33
  import { makeStopRunOnRunnerContract } from "./runner/stopRun.js";
@@ -74,15 +77,15 @@ export const makeContractsV1 = (ids) => {
74
77
  },
75
78
  runner: {
76
79
  evaluateSnippet: makeEvaluateSnippetOnRunnerContract(),
80
+ highlightSelector: makeHighlightSelectorOnRunnerContract(),
77
81
  importPackage: makeImportPackageOnRunnerContract(),
78
82
  inspect: makeInspectOnRunnerContract(),
79
- // `runner.inspectMobile` (./runner/inspectMobile.js) stays out of this
80
- // catalog until ARC-556 adds its router endpoint, to avoid tripping
81
- // apex-backend's contract/router drift check.
83
+ inspectMobile: makeInspectMobileOnRunnerContract(),
82
84
  launch: makeLaunchRunnerContract(),
83
85
  performAction: makePerformActionOnRunnerContract(),
86
+ promoteSnapshot: makePromoteSnapshotOnRunnerContract(),
84
87
  readJournal: makeReadRunnerJournalContract(),
85
- runFlow: makeRunFlowOnRunnerContract(),
88
+ runFlow: makeRunFlowOnRunnerContract(resolvedIds),
86
89
  stopRun: makeStopRunOnRunnerContract(),
87
90
  takeScreenshot: makeTakeScreenshotOnRunnerContract(),
88
91
  terminate: makeTerminateRunnerContract(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA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,CAAC;SACxC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC"}
@@ -27,7 +27,7 @@ function refusalForRunEnvironmentVariableName(name) {
27
27
  return undefined;
28
28
  }
29
29
  const maxRunEnvironmentVariables = 200;
30
- const maxRunEnvironmentValueLength = 8 * 1024;
30
+ const maxRunEnvironmentValueLength = 16 * 1024;
31
31
  /** Bounded on its own, so a large project is never refused for its environment. */
32
32
  export const runEnvironmentSchema = z
33
33
  .record(z.string(), z.string().max(maxRunEnvironmentValueLength))
@@ -1 +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;;;;;;;GAOG;AACH,MAAM,kCAAkC,GAAG,gBAAgB,CAAC;AAE5D;;;;GAIG;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,KAAK,kCAAkC;QAC3D,OAAO,GAAG,kCAAkC,0CAA0C,CAAC;IACzF,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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I,CAAC;AAE/C,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,30 @@
1
+ import { z } from "zod";
2
+ /** Long enough for a generated Playwright locator, short enough to bound the page work. */
3
+ export declare const maxHighlightSelectorLength = 2000;
4
+ export declare const makeHighlightSelectorOnRunnerContract: () => {
5
+ readonly description: "Highlight the elements a selector matches on an interactive runner's live page, and answer how many it matched. The highlight stays until it is replaced or cleared, so it is visible in the next `runner.takeScreenshot` — which is the point, since a caller cannot see the runner's screen otherwise. Send an empty selector to clear, which answers `cleared`. `status` tells a selector that matched nothing (`empty`) from one the page could not parse (`invalid`), so a caller can tell a bad locator from a locator pointing at nothing. `no-answer` if the page did not answer in time: the highlight runs inside the page, so a page that is gone or mid-navigation does not answer slowly, it does not answer at all. `runner-cannot-highlight-selectors` on a runner with no browser to draw on. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity.";
6
+ readonly input: z.ZodObject<{
7
+ id: z.ZodString;
8
+ selector: z.ZodString;
9
+ }, z.core.$strip>;
10
+ readonly kind: "write";
11
+ readonly name: "runner.highlightSelector";
12
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ matchCount: z.ZodNumber;
14
+ outcome: z.ZodLiteral<"success">;
15
+ selector: z.ZodString;
16
+ status: z.ZodLiteral<"valid" | "invalid" | "empty">;
17
+ targetPage: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ outcome: z.ZodLiteral<"cleared">;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ errorMessage: z.ZodOptional<z.ZodString>;
22
+ failureReason: z.ZodEnum<{
23
+ "runner-unreachable": "runner-unreachable";
24
+ "no-answer": "no-answer";
25
+ "runner-cannot-highlight-selectors": "runner-cannot-highlight-selectors";
26
+ }>;
27
+ outcome: z.ZodLiteral<"failure">;
28
+ }, z.core.$strip>], "outcome">;
29
+ };
30
+ //# sourceMappingURL=highlightSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlightSelector.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/highlightSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,OAAQ,CAAC;AAEhD,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;CA2DjD,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ import { runnerIdSchema } from "./identity.js";
3
+ /** Long enough for a generated Playwright locator, short enough to bound the page work. */
4
+ export const maxHighlightSelectorLength = 2_000;
5
+ export const makeHighlightSelectorOnRunnerContract = () => {
6
+ const input = z.object({
7
+ id: runnerIdSchema.describe("Id of the runner to highlight on."),
8
+ selector: z
9
+ .string()
10
+ .max(maxHighlightSelectorLength)
11
+ .describe("The selector to highlight. An empty string clears whatever is highlighted."),
12
+ });
13
+ const output = z.discriminatedUnion("outcome", [
14
+ z.object({
15
+ matchCount: z
16
+ .number()
17
+ .int()
18
+ .gte(0)
19
+ .describe("How many elements the selector matched."),
20
+ outcome: z.literal("success"),
21
+ selector: z.string().describe("The selector the page matched on."),
22
+ status: z
23
+ .literal(["valid", "invalid", "empty"])
24
+ .describe("`valid` when the selector parsed and matched, `empty` when it parsed and matched nothing, `invalid` when the page could not read it as a selector."),
25
+ targetPage: z
26
+ .string()
27
+ .optional()
28
+ .describe("Present when the match was on a page other than the default one."),
29
+ }),
30
+ z.object({
31
+ outcome: z.literal("cleared"),
32
+ }),
33
+ z.object({
34
+ errorMessage: z.string().optional(),
35
+ failureReason: z.enum([
36
+ "no-answer",
37
+ "runner-cannot-highlight-selectors",
38
+ "runner-unreachable",
39
+ ]),
40
+ outcome: z.literal("failure"),
41
+ }),
42
+ ]);
43
+ return {
44
+ description: "Highlight the elements a selector matches on an interactive runner's live page, and answer how many it matched. The highlight stays until it is replaced or cleared, so it is visible in the next `runner.takeScreenshot` — which is the point, since a caller cannot see the runner's screen otherwise. Send an empty selector to clear, which answers `cleared`. `status` tells a selector that matched nothing (`empty`) from one the page could not parse (`invalid`), so a caller can tell a bad locator from a locator pointing at nothing. `no-answer` if the page did not answer in time: the highlight runs inside the page, so a page that is gone or mid-navigation does not answer slowly, it does not answer at all. `runner-cannot-highlight-selectors` on a runner with no browser to draw on. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity.",
45
+ input,
46
+ kind: "write",
47
+ name: "runner.highlightSelector",
48
+ output,
49
+ };
50
+ };
51
+ //# sourceMappingURL=highlightSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlightSelector.js","sourceRoot":"","sources":["../../../src/v1/runner/highlightSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE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aACrB,CAAC;YACF,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9B,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,84BAA84B;QACh5B,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,0BAA0B;QAChC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -21,7 +21,7 @@ export declare const inspectMobileRequestSchema: z.ZodDiscriminatedUnion<[z.ZodO
21
21
  }, z.core.$strip>], "by">], "what">;
22
22
  export type InspectMobileRequest = z.infer<typeof inspectMobileRequestSchema>;
23
23
  export declare const makeInspectMobileOnRunnerContract: () => {
24
- readonly description: "Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers `runner-is-not-mobile`; call `runner.inspect` for a browser's equivalent surface instead. `what: \"session\"` always answers with the session's own status rather than `screen-needs-a-run`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same `screen-needs-a-run` or `screen-not-ready` outcomes `runner.performAction` and `runner.takeScreenshot` use, instead of reading anything when there is none. `screen-needs-a-run` means no Appium session has started on this runner yet — call `runner.runFlow` with a flow that opens one, then inspect again. `screen-not-ready` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. `runner-is-not-mobile` means there is nothing here to inspect, and retrying will never help — launch a `node20WithAndroid` or `node20WithIos` 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.";
24
+ readonly description: "Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers `runner-is-not-mobile`; call `runner.inspect` for a browser's equivalent surface instead. `what: \"session\"` always answers with the session's own status rather than `screen-needs-a-run`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same `screen-needs-a-run` or `screen-not-ready` outcomes `runner.performAction` and `runner.takeScreenshot` use, instead of reading anything when there is none. `screen-needs-a-run` means no Appium session has started on this runner yet — call `runner.runFlow` with a flow that opens one, then inspect again. `screen-not-ready` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. `runner-is-not-mobile` means there is nothing here to inspect, and retrying will never help — launch an `android` or `ios` 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.";
25
25
  readonly input: z.ZodObject<{
26
26
  id: z.ZodString;
27
27
  request: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -108,7 +108,7 @@ export const makeInspectMobileOnRunnerContract = () => {
108
108
  ]),
109
109
  ]);
110
110
  return {
111
- description: `Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers \`runner-is-not-mobile\`; call \`runner.inspect\` for a browser's equivalent surface instead. \`what: "session"\` always answers with the session's own status rather than \`screen-needs-a-run\`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same \`screen-needs-a-run\` or \`screen-not-ready\` outcomes \`runner.performAction\` and \`runner.takeScreenshot\` use, instead of reading anything when there is none. \`screen-needs-a-run\` means no Appium session has started on this runner yet — call \`runner.runFlow\` with a flow that opens one, then inspect again. \`screen-not-ready\` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. \`runner-is-not-mobile\` means there is nothing here to inspect, and retrying will never help — launch a \`node20WithAndroid\` or \`node20WithIos\` runner instead. ${retryableRunnerUnreachableDescription}`,
111
+ description: `Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point or carrying some text. Mobile only — a browser runner answers \`runner-is-not-mobile\`; call \`runner.inspect\` for a browser's equivalent surface instead. \`what: "session"\` always answers with the session's own status rather than \`screen-needs-a-run\`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same \`screen-needs-a-run\` or \`screen-not-ready\` outcomes \`runner.performAction\` and \`runner.takeScreenshot\` use, instead of reading anything when there is none. \`screen-needs-a-run\` means no Appium session has started on this runner yet — call \`runner.runFlow\` with a flow that opens one, then inspect again. \`screen-not-ready\` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. \`runner-is-not-mobile\` means there is nothing here to inspect, and retrying will never help — launch an \`android\` or \`ios\` runner instead. ${retryableRunnerUnreachableDescription}`,
112
112
  input,
113
113
  kind: "read",
114
114
  name: "runner.inspectMobile",
@@ -1 +1 @@
1
- {"version":3,"file":"inspectMobile.js","sourceRoot":"","sources":["../../../src/v1/runner/inspectMobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,qCAAqC,EACrC,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AAEH,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACrE,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,SAAS,CAAC;aAClB,QAAQ,CACP,wFAAwF,CACzF;KACJ,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC;aACJ,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CACP,yEAAyE,CAC1E;KACJ,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,CAA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C;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,24 @@
1
+ import { z } from "zod";
2
+ /** A path within the run's own screenshot storage, not a filesystem path. */
3
+ export declare const maxSnapshotPathLength = 1024;
4
+ export declare const makePromoteSnapshotOnRunnerContract: () => {
5
+ readonly description: "Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it. The two paths are the ones the diff reported, which reach a caller as an `image-diff-artifact` entry on the runner's `run-events` journal stream. `snapshot-not-found` if the run wrote no screenshot at that path, which usually means the paths were not taken from a diff this run produced; nothing is changed, so correcting the path and repeating is safe. `runner-cannot-promote-snapshots` on a runner that stores no screenshots. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity. A promotion that lands is not undone by promoting again, so a retry after an unreachable answer is safe.";
6
+ readonly input: z.ZodObject<{
7
+ baselinePath: z.ZodString;
8
+ id: z.ZodString;
9
+ screenshotPath: z.ZodString;
10
+ }, z.core.$strip>;
11
+ readonly kind: "write";
12
+ readonly name: "runner.promoteSnapshot";
13
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ outcome: z.ZodLiteral<"success">;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ failureReason: z.ZodEnum<{
17
+ "runner-unreachable": "runner-unreachable";
18
+ "runner-cannot-promote-snapshots": "runner-cannot-promote-snapshots";
19
+ "snapshot-not-found": "snapshot-not-found";
20
+ }>;
21
+ outcome: z.ZodLiteral<"failure">;
22
+ }, z.core.$strip>], "outcome">;
23
+ };
24
+ //# sourceMappingURL=promoteSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promoteSnapshot.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/promoteSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAE3C,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;CAwC/C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { runnerIdSchema } from "./identity.js";
3
+ /** A path within the run's own screenshot storage, not a filesystem path. */
4
+ export const maxSnapshotPathLength = 1_024;
5
+ export const makePromoteSnapshotOnRunnerContract = () => {
6
+ const input = z.object({
7
+ baselinePath: z
8
+ .string()
9
+ .min(1)
10
+ .max(maxSnapshotPathLength)
11
+ .describe("The baseline to replace, as named in the image diff."),
12
+ id: runnerIdSchema.describe("Id of the runner holding the screenshot."),
13
+ screenshotPath: z
14
+ .string()
15
+ .min(1)
16
+ .max(maxSnapshotPathLength)
17
+ .describe("The screenshot to promote, as named in the image diff."),
18
+ });
19
+ const output = z.discriminatedUnion("outcome", [
20
+ z.object({ outcome: z.literal("success") }),
21
+ z.object({
22
+ failureReason: z.enum([
23
+ "runner-cannot-promote-snapshots",
24
+ "runner-unreachable",
25
+ "snapshot-not-found",
26
+ ]),
27
+ outcome: z.literal("failure"),
28
+ }),
29
+ ]);
30
+ return {
31
+ description: "Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it. The two paths are the ones the diff reported, which reach a caller as an `image-diff-artifact` entry on the runner's `run-events` journal stream. `snapshot-not-found` if the run wrote no screenshot at that path, which usually means the paths were not taken from a diff this run produced; nothing is changed, so correcting the path and repeating is safe. `runner-cannot-promote-snapshots` on a runner that stores no screenshots. `runner-unreachable` if the runner could not be reached: it may still be starting, or it may have terminated after inactivity. A promotion that lands is not undone by promoting again, so a retry after an unreachable answer is safe.",
32
+ input,
33
+ kind: "write",
34
+ name: "runner.promoteSnapshot",
35
+ output,
36
+ };
37
+ };
38
+ //# sourceMappingURL=promoteSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promoteSnapshot.js","sourceRoot":"","sources":["../../../src/v1/runner/promoteSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,EAAE;IACtD,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,qBAAqB,CAAC;aAC1B,QAAQ,CAAC,sDAAsD,CAAC;QACnE,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACvE,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,qBAAqB,CAAC;aAC1B,QAAQ,CAAC,wDAAwD,CAAC;KACtE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3C,CAAC,CAAC,MAAM,CAAC;YACP,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC;gBACpB,iCAAiC;gBACjC,oBAAoB;gBACpB,oBAAoB;aACrB,CAAC;YACF,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;SAC9B,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,svBAAsvB;QACxvB,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,wBAAwB;QAC9B,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +1,13 @@
1
1
  import { z } from "zod";
2
- export declare const makeRunFlowOnRunnerContract: () => {
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeRunFlowOnRunnerContract: (ids: {
4
+ environmentRef: PublicIdSchema;
5
+ }) => {
3
6
  readonly description: "Run a flow on an interactive runner. When `selection` is given the lines run against the browser as it stands, so nothing is re-navigated and nothing is signed in again; without it the whole entry point runs from a fresh browser. A runner with no live browser starts one before a selection and says so with `bootstrappedRunner`, which means those lines ran against a fresh page rather than the one an earlier run left. A selection produces no `runStarted` event, so follow it by its run id on `run-status` like any other run. Send `unchangedFiles` to ship only what changed since an earlier run on this runner; a `needs-full-sync` failure names the paths it does not hold, and the way to recover is the same run again with every file in `files`. Answers as soon as the run is accepted, with the id to follow it by — nothing waits for the run to finish. Which browser or device the run needs is read from the flow file's own execution target, so it is not supplied here; when it does not match what the runner is, the call fails with `runner-target-mismatch` rather than failing partway through the run. `runner-unreachable` means the answer did not arrive, which is NOT the same as the run not having started: the runner may have accepted it and been too slow to say so, and resubmitting would start a second run that is billed and journalled alongside the first. Read the runner's `run-status` journal stream before resubmitting, and use the newest run id there if one appeared.";
4
7
  readonly input: z.ZodObject<{
5
8
  entryPointPath: z.ZodString;
6
9
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10
+ environmentId: z.ZodOptional<PublicIdSchema>;
7
11
  files: z.ZodRecord<z.ZodString, z.ZodString>;
8
12
  id: z.ZodString;
9
13
  selection: z.ZodOptional<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GvC,CAAC"}
1
+ {"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/v1/runner/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AA0BhD,eAAO,MAAM,2BAA2B,GAAI,KAAK;IAC/C,cAAc,EAAE,cAAc,CAAC;CAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HA,CAAC"}
@@ -17,13 +17,16 @@ const unchangedFilesSchema = z
17
17
  });
18
18
  }
19
19
  });
20
- export const makeRunFlowOnRunnerContract = () => {
20
+ export const makeRunFlowOnRunnerContract = (ids) => {
21
21
  const input = z
22
22
  .object({
23
23
  entryPointPath: runFilePathSchema.describe("Path of the flow file to run, as it appears in `files`."),
24
24
  env: runEnvironmentSchema
25
25
  .optional()
26
26
  .describe("Environment variables to make available to the run."),
27
+ environmentId: ids.environmentRef
28
+ .optional()
29
+ .describe("A QA Wolf environment whose variables the run is given, by id or alias. QA Wolf reads and decrypts them itself, so they never travel in the request and the count and length limits on `env` do not apply to them. Send this or `env`, not both."),
27
30
  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."),
28
31
  id: runnerIdSchema.describe("Id of the runner to run the flow on."),
29
32
  selection: runSelectionSchema
@@ -32,6 +35,12 @@ export const makeRunFlowOnRunnerContract = () => {
32
35
  unchangedFiles: unchangedFilesSchema
33
36
  .optional()
34
37
  .describe("Files this runner already holds from an earlier run, keyed by path with a hex SHA-256 of the content it should hold. Send this to make `files` only what changed. The runner refuses with `needs-full-sync` if it holds none of a referenced path, so it never runs something other than what was asked for. Omit it to send every file."),
38
+ })
39
+ // Both would need a merge order, and the two surfaces that carry an
40
+ // environment and caller variables today do not agree on one.
41
+ .refine((request) => request.env === undefined || request.environmentId === undefined, {
42
+ error: "Send env or environmentId, not both. An environment's variables are taken as they are stored, so there is no order in which the two would combine.",
43
+ path: ["environmentId"],
35
44
  })
36
45
  // Stated here rather than discovered when the runner cannot find a module.
37
46
  .refine((request) => Object.hasOwn(request.files, request.entryPointPath), {
@@ -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,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,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,CAAC;SACZ,MAAM,CAAC;QACN,c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AC9B,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,kBAAkB,EAAE,CAAC;iBAClB,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CACP,qTAAqT,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/api-contracts",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "private": false,
5
5
  "description": "Versioned contracts for the QA Wolf public API",
6
6
  "repository": {