@mablhq/mabl-cli 2.133.1 → 2.133.2

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.
Files changed (27) hide show
  1. package/_bundled/@mablhq/test-model/validator/errors.d.ts.map +1 -1
  2. package/_bundled/@mablhq/test-model/validator/errors.js +40 -0
  3. package/_bundled/@mablhq/test-model/validator/schemas/condition-descriptor.d.ts +2 -2
  4. package/_bundled/@mablhq/test-model/validator/schemas/condition-descriptor.d.ts.map +1 -1
  5. package/_bundled/@mablhq/test-model/validator/schemas/condition-descriptor.js +8 -8
  6. package/_bundled/@mablhq/test-model/validator/schemas/described-union.d.ts +5 -0
  7. package/_bundled/@mablhq/test-model/validator/schemas/described-union.d.ts.map +1 -0
  8. package/_bundled/@mablhq/test-model/validator/schemas/described-union.js +13 -0
  9. package/_bundled/@mablhq/test-model/validator/schemas/extract-descriptor.d.ts +1 -1
  10. package/_bundled/@mablhq/test-model/validator/schemas/extract-descriptor.d.ts.map +1 -1
  11. package/_bundled/@mablhq/test-model/validator/schemas/extract-descriptor.js +6 -4
  12. package/_bundled/@mablhq/test-model/validator/schemas/find-descriptors.d.ts.map +1 -1
  13. package/_bundled/@mablhq/test-model/validator/schemas/find-descriptors.js +17 -9
  14. package/_bundled/@mablhq/test-model/validator/schemas/steps/assertions.d.ts.map +1 -1
  15. package/_bundled/@mablhq/test-model/validator/schemas/steps/assertions.js +11 -6
  16. package/_bundled/@mablhq/test-model/validator/schemas/steps/files-downloads.d.ts.map +1 -1
  17. package/_bundled/@mablhq/test-model/validator/schemas/steps/files-downloads.js +3 -4
  18. package/_bundled/@mablhq/test-model/validator/schemas/steps/meta-steps.d.ts +1 -1
  19. package/_bundled/@mablhq/test-model/validator/schemas/steps/shared.d.ts.map +1 -1
  20. package/_bundled/@mablhq/test-model/validator/schemas/steps/shared.js +7 -11
  21. package/_bundled/@mablhq/test-model/validator/schemas/steps/variables-js.d.ts.map +1 -1
  22. package/_bundled/@mablhq/test-model/validator/schemas/steps/variables-js.js +10 -4
  23. package/_bundled/@mablhq-internal/mobile-runtime/package.json +1 -1
  24. package/_bundled/@mablhq-internal/runtime/execution/index.js +1 -1
  25. package/_bundled/@mablhq-internal/runtime/package.json +1 -1
  26. package/execution/index.js +1 -1
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/validator/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,KAAK,CAAC;AA0B7B,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,eAAe;IAE9B,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE1B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAEhC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE1B,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAE/B,KAAK,EAAE,OAAO,CAAC;IAEf,MAAM,EAAE,eAAe,EAAE,CAAC;IAE1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,wBAAgB,WAAW,IAAI,gBAAgB,CAE9C;AAED,wBAAgB,YAAY,CAAC,GAAG,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAQ7E;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,aAAa,C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,CAAC;IAEf,MAAM,EAAE,eAAe,EAAE,CAAC;IAE1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,wBAAgB,WAAW,IAAI,gBAAgB,CAE9C;AAED,wBAAgB,YAAY,CAAC,GAAG,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAQ7E;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,QAAQ,EAAE,EAClB,UAAU,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO,EACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,mBAAmB,GAAG,SAAS,GACjE,gBAAgB,CAiBlB;AAuKD,wBAAgB,WAAW,CACzB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,gBAAgB,CAgBlB;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,gBAAgB,CAgBlB"}
@@ -13,6 +13,8 @@ const VARIANT_MATCH_CODES = new Set([
13
13
  'invalid_union',
14
14
  'custom',
15
15
  ]);
16
+ const ZOD_DEFAULT_UNION_MESSAGE = 'Invalid input';
17
+ const MAX_SUMMARIZED_VARIANTS = 4;
16
18
  function pathToJsonPath(path) {
17
19
  return path.filter((p) => typeof p !== 'symbol');
18
20
  }
@@ -60,6 +62,16 @@ function refineIssue(issue) {
60
62
  if (closest) {
61
63
  return closest;
62
64
  }
65
+ if (issue.message === ZOD_DEFAULT_UNION_MESSAGE) {
66
+ const variants = summarizeUnionVariants(issue);
67
+ if (variants) {
68
+ return {
69
+ path: pathToJsonPath(issue.path),
70
+ message: variants,
71
+ code: `zod.${issue.code}`,
72
+ };
73
+ }
74
+ }
63
75
  }
64
76
  return {
65
77
  path: pathToJsonPath(issue.path),
@@ -94,6 +106,34 @@ function pickClosestVariantIssue(issue) {
94
106
  code: `zod.${deepest.code}`,
95
107
  };
96
108
  }
109
+ function summarizeUnionVariants(issue) {
110
+ const variants = [];
111
+ for (const branchIssues of issue.errors) {
112
+ const fields = new Set();
113
+ for (const branchIssue of branchIssues) {
114
+ if (!VARIANT_MATCH_CODES.has(branchIssue.code))
115
+ continue;
116
+ const path = pathToJsonPath(branchIssue.path);
117
+ if (path.length === 0)
118
+ continue;
119
+ fields.add(path.join('.'));
120
+ }
121
+ if (fields.size > 0)
122
+ variants.push([...fields]);
123
+ }
124
+ const rendered = [
125
+ ...new Set(variants
126
+ .sort((a, b) => a.length - b.length)
127
+ .map((fields) => `(${fields.join(', ')})`)),
128
+ ];
129
+ if (rendered.length === 0)
130
+ return undefined;
131
+ const shown = rendered.slice(0, MAX_SUMMARIZED_VARIANTS);
132
+ const omitted = rendered.length - shown.length;
133
+ return (`No accepted shape matched. Satisfy the fields of one of them: ` +
134
+ `${shown.join(' or ')}` +
135
+ `${omitted > 0 ? ` (and ${omitted} other shapes)` : ''}.`);
136
+ }
97
137
  function locateFindTargetUnionIssue(issue) {
98
138
  for (const branchIssues of issue.errors) {
99
139
  for (const branchIssue of branchIssues) {
@@ -71,7 +71,7 @@ export declare const aiPromptConditionSchema: z.ZodObject<{
71
71
  metaPrompt: z.ZodOptional<z.ZodString>;
72
72
  criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
73
  }, z.core.$strip>;
74
- export declare const conditionDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
74
+ export declare const conditionDescriptorSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
75
75
  conditionType: z.ZodLiteral<"comparison">;
76
76
  comparisonType: z.ZodEnum<{
77
77
  contains: "contains";
@@ -109,7 +109,7 @@ export declare const conditionDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodOb
109
109
  criteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
110
  }, z.core.$strip>]>;
111
111
  export type ConditionDescriptor = z.infer<typeof conditionDescriptorSchema>;
112
- export declare const conditionDescriptorAuthoringSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
+ export declare const conditionDescriptorAuthoringSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
113
113
  conditionType: z.ZodLiteral<"comparison">;
114
114
  comparisonType: z.ZodEnum<{
115
115
  contains: "contains";
@@ -1 +1 @@
1
- {"version":3,"file":"condition-descriptor.d.ts","sourceRoot":"","sources":["../../../src/validator/schemas/condition-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,iBAAiB;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;EAc7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;EAAqC,CAAC;AAI7E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;iBAcnC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;;;;;iBAWmC,CAAC;AAiBxE,eAAO,MAAM,gCAAgC;;;;;;iBAE0B,CAAC;AASxE,eAAO,MAAM,qBAAqB;;iBAM/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;;;iBASmB,CAAC;AAKxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBASnC,CAAC;AAEJ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAO5E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAS5C,CAAC"}
1
+ {"version":3,"file":"condition-descriptor.d.ts","sourceRoot":"","sources":["../../../src/validator/schemas/condition-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAWtB,eAAO,MAAM,iBAAiB;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;EAc7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;EAAqC,CAAC;AAI7E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;iBAcnC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;;;;;iBAWmC,CAAC;AAiBxE,eAAO,MAAM,gCAAgC;;;;;;iBAE0B,CAAC;AASxE,eAAO,MAAM,qBAAqB;;iBAM/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;;;iBASmB,CAAC;AAKxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBASrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAO5E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAS9C,CAAC"}
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.conditionDescriptorAuthoringSchema = exports.conditionDescriptorSchema = exports.aiPromptConditionSchema = exports.truthyConditionSchema = exports.presenceConditionAuthoringSchema = exports.presenceConditionSchema = exports.comparisonConditionSchema = exports.presenceEvaluationTypeEnum = exports.comparisonTypeEnum = exports.conditionTypeEnum = void 0;
4
4
  const zod_1 = require("zod");
5
+ const described_union_1 = require("./described-union");
5
6
  const common_1 = require("./common");
7
+ const CONDITION_DESCRIPTION = 'Condition to evaluate -- conditionType is one of comparison (with ' +
8
+ 'comparisonType and comparatorValue), presence, truthy, or ai_prompt ' +
9
+ '(with userPrompt)';
6
10
  exports.conditionTypeEnum = zod_1.z.enum([
7
11
  'ai_prompt',
8
12
  'comparison',
@@ -66,19 +70,15 @@ exports.aiPromptConditionSchema = zod_1.z
66
70
  criteria: zod_1.z.array(zod_1.z.string()).optional(),
67
71
  })
68
72
  .describe('Use an AI prompt to evaluate a condition');
69
- exports.conditionDescriptorSchema = zod_1.z
70
- .discriminatedUnion('conditionType', [
73
+ exports.conditionDescriptorSchema = (0, described_union_1.describedDiscriminatedUnion)('conditionType', [
71
74
  exports.comparisonConditionSchema,
72
75
  exports.presenceConditionSchema,
73
76
  exports.truthyConditionSchema,
74
77
  exports.aiPromptConditionSchema,
75
- ])
76
- .describe('Condition to evaluate -- comparison, presence check, truthy check, or AI prompt');
77
- exports.conditionDescriptorAuthoringSchema = zod_1.z
78
- .discriminatedUnion('conditionType', [
78
+ ], CONDITION_DESCRIPTION);
79
+ exports.conditionDescriptorAuthoringSchema = (0, described_union_1.describedDiscriminatedUnion)('conditionType', [
79
80
  exports.comparisonConditionSchema,
80
81
  exports.presenceConditionAuthoringSchema,
81
82
  exports.truthyConditionSchema,
82
83
  exports.aiPromptConditionSchema,
83
- ])
84
- .describe('Condition to evaluate -- comparison, presence check, truthy check, or AI prompt');
84
+ ], CONDITION_DESCRIPTION);
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ import type { $ZodTypeDiscriminable } from 'zod/v4/core';
3
+ export declare function describedUnion<const T extends readonly [z.ZodType, ...z.ZodType[]]>(options: T, description: string): z.ZodUnion<T>;
4
+ export declare function describedDiscriminatedUnion<const T extends readonly [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(discriminator: string, options: T, description: string): z.ZodDiscriminatedUnion<T>;
5
+ //# sourceMappingURL=described-union.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"described-union.d.ts","sourceRoot":"","sources":["../../../src/validator/schemas/described-union.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAC;AAgBvD,wBAAgB,cAAc,CAC5B,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EACpD,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAEhD;AAQD,wBAAgB,2BAA2B,CACzC,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,qBAAqB,EAAE,GAAG,qBAAqB,EAAE,CAAC,EAE5E,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,CAAC,EACV,WAAW,EAAE,MAAM,GAClB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAI5B"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.describedUnion = describedUnion;
4
+ exports.describedDiscriminatedUnion = describedDiscriminatedUnion;
5
+ const zod_1 = require("zod");
6
+ function describedUnion(options, description) {
7
+ return zod_1.z.union(options, { error: () => description }).describe(description);
8
+ }
9
+ function describedDiscriminatedUnion(discriminator, options, description) {
10
+ return zod_1.z
11
+ .discriminatedUnion(discriminator, options, { error: () => description })
12
+ .describe(description);
13
+ }
@@ -6,7 +6,7 @@ export declare const extractTypeEnum: z.ZodEnum<{
6
6
  extract_inner_text: "extract_inner_text";
7
7
  extract_prompt: "extract_prompt";
8
8
  }>;
9
- export declare const extractDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
+ export declare const extractDescriptorSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
10
10
  extractType: z.ZodLiteral<"extract_attribute">;
11
11
  attributeName: z.ZodString;
12
12
  }, z.core.$strip>, z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"extract-descriptor.d.ts","sourceRoot":"","sources":["../../../src/validator/schemas/extract-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AAkCH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;mBAQwB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"extract-descriptor.d.ts","sourceRoot":"","sources":["../../../src/validator/schemas/extract-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AAkCH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;mBAanC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractDescriptorSchema = exports.extractTypeEnum = void 0;
4
4
  const zod_1 = require("zod");
5
+ const described_union_1 = require("./described-union");
5
6
  exports.extractTypeEnum = zod_1.z.enum([
6
7
  'extract_attribute',
7
8
  'extract_css_properties',
@@ -33,12 +34,13 @@ const extractInnerTextSchema = zod_1.z.object({
33
34
  const extractPromptSchema = zod_1.z.object({
34
35
  extractType: zod_1.z.literal('extract_prompt'),
35
36
  });
36
- exports.extractDescriptorSchema = zod_1.z
37
- .discriminatedUnion('extractType', [
37
+ exports.extractDescriptorSchema = (0, described_union_1.describedDiscriminatedUnion)('extractType', [
38
38
  extractAttributeSchema,
39
39
  extractCssPropertiesSchema,
40
40
  extractEmailAttributeSchema,
41
41
  extractInnerTextSchema,
42
42
  extractPromptSchema,
43
- ])
44
- .describe('What value to extract from the target element');
43
+ ], 'What value to extract from the target element — extractType is one of ' +
44
+ 'extract_attribute or extract_css_properties (each with attributeName), ' +
45
+ 'extract_email_attribute (with attributeName), extract_inner_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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAUtC,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mobileFindDescriptorSchema = exports.webViewFindElementDescriptorSchema = exports.mobileFindCustomDescriptorSchema = exports.mobileFindElementDescriptorSchema = exports.findDescriptorSchema = exports.findTabDescriptorSchema = exports.findEmailDescriptorSchema = exports.findCookieDescriptorSchema = exports.browserFindAuthoringSchema = exports.findCustomDescriptorSchema = exports.findElementDescriptorSchema = exports.browserFindDescriptorSchema = exports.browserFindTargetSchema = exports.cookieSelectorSchema = exports.mobileFindSpecificationSchema = exports.mobileElementSelectorSchema = exports.normalizedFindDescriptorSchema = exports.mobileFindOptionsSchema = exports.findOptionsSchema = exports.customCssSelectorSchema = exports.customXpathSelectorSchema = exports.simpleElementSelectorSchema = exports.primaryFindMethodEnum = exports.propertyComparatorEnum = exports.elementExpectationEnum = exports.confidenceLevelEnum = exports.customFindTypeEnum = exports.findTypeEnum = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const mablscriptFind_1 = require("../../mablscriptFind");
6
+ const described_union_1 = require("./described-union");
6
7
  exports.findTypeEnum = zod_1.z.enum([
7
8
  'find_all',
8
9
  'find_any',
@@ -393,8 +394,7 @@ const authoringFindOptionsSchema = zod_1.z
393
394
  })
394
395
  .optional()
395
396
  .describe('Optional timeout for this find');
396
- exports.browserFindAuthoringSchema = zod_1.z
397
- .union([
397
+ exports.browserFindAuthoringSchema = (0, described_union_1.describedUnion)([
398
398
  zod_1.z
399
399
  .object({
400
400
  find_uuid: zod_1.z
@@ -415,8 +415,9 @@ exports.browserFindAuthoringSchema = zod_1.z
415
415
  findOptions: authoringFindOptionsSchema,
416
416
  })
417
417
  .describe('Author a new find with a visual description (required) and an optional Playwright locator'),
418
- ])
419
- .describe('Element find: either reuse a known find by uuid, or author a new one (a required visual description, plus an optional locator).');
418
+ ], 'Element find — either {find_uuid} to reuse a find the session already knows, ' +
419
+ 'or {visual_description, locator?} to author a new one (the visual ' +
420
+ 'description is required).');
420
421
  exports.findCookieDescriptorSchema = zod_1.z
421
422
  .object({
422
423
  findType: zod_1.z.literal('find_cookie'),
@@ -441,19 +442,23 @@ const tabSelectorSchema = zod_1.z
441
442
  .refine((tab) => tab.url !== undefined || tab.title !== undefined, {
442
443
  message: 'A tab selector must identify the tab by at least one of url or title.',
443
444
  });
444
- const findTabTargetSchema = zod_1.z.union([zod_1.z.literal('initial'), tabSelectorSchema]);
445
+ const findTabTargetSchema = (0, described_union_1.describedUnion)([zod_1.z.literal('initial'), tabSelectorSchema], 'Tab to find — either the string "initial" for the tab the test started in, ' +
446
+ 'or {selector_type: "tab"} with at least one of url or title.');
445
447
  exports.findTabDescriptorSchema = zod_1.z
446
448
  .object({
447
449
  findType: zod_1.z.literal('find_tab'),
448
450
  findTarget: findTabTargetSchema,
449
451
  })
450
452
  .passthrough();
451
- exports.findDescriptorSchema = zod_1.z.union([
453
+ exports.findDescriptorSchema = (0, described_union_1.describedUnion)([
452
454
  exports.findCookieDescriptorSchema,
453
455
  exports.findEmailDescriptorSchema,
454
456
  exports.findTabDescriptorSchema,
455
457
  exports.browserFindDescriptorSchema,
456
- ]);
458
+ ], 'Browser find — {findType, findTarget}, where findTarget follows findType: ' +
459
+ 'find_one / find_first / find_last / find_all take an element selector, ' +
460
+ 'find_cookie a cookie selector, find_tab a tab selector, find_email an ' +
461
+ 'email selector.');
457
462
  exports.mobileFindElementDescriptorSchema = zod_1.z
458
463
  .object({
459
464
  findType: zod_1.z.literal('find_one'),
@@ -486,8 +491,11 @@ exports.webViewFindElementDescriptorSchema = exports.mobileFindElementDescriptor
486
491
  url: zod_1.z.string(),
487
492
  }),
488
493
  });
489
- exports.mobileFindDescriptorSchema = zod_1.z.union([
494
+ exports.mobileFindDescriptorSchema = (0, described_union_1.describedUnion)([
490
495
  exports.webViewFindElementDescriptorSchema,
491
496
  exports.mobileFindElementDescriptorSchema,
492
497
  exports.mobileFindCustomDescriptorSchema,
493
- ]);
498
+ ], 'Mobile find — {findType: "find_one", findTarget} for a native element, the ' +
499
+ 'same plus {webView: {descriptor, title, url}} for an element inside a web ' +
500
+ 'view, or {findType: find_first|find_last|find_all, findTarget} with an ' +
501
+ 'xpath selector.');
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAgFtB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OA+BxC,CAAC;AAMJ,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAGpC,CAAC;AACJ,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAGxC,CAAC;AA8GJ,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,OAOjD,CAAC;AAEJ,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAG7C,CAAC;AACJ,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,OAGjD,CAAC;AAGJ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBAE2B,CAAC;AAGjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;iBAEqB,CAAC;AAY1D,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,OACe,CAAC;AAE9D,eAAO,MAAM,sCAAsC,EAAE,CAAC,CAAC,OACe,CAAC"}
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA2FtB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OA+BxC,CAAC;AAMJ,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAGpC,CAAC;AACJ,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAGxC,CAAC;AAqHJ,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,OAOjD,CAAC;AAEJ,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAG7C,CAAC;AACJ,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,OAGjD,CAAC;AAGJ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBAE2B,CAAC;AAGjE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;iBAEqB,CAAC;AAY1D,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,OACe,CAAC;AAE9D,eAAO,MAAM,sCAAsC,EAAE,CAAC,CAAC,OACe,CAAC"}
@@ -8,6 +8,7 @@ const extract_descriptor_1 = require("../extract-descriptor");
8
8
  const count_descriptor_1 = require("../count-descriptor");
9
9
  const find_descriptors_1 = require("../find-descriptors");
10
10
  const shared_1 = require("./shared");
11
+ const described_union_1 = require("../described-union");
11
12
  const GetCurrentLocationDescriptor_1 = require("../../../types/GetCurrentLocationDescriptor");
12
13
  const URL_PROPERTY_LIST = GetCurrentLocationDescriptor_1.LOCATION_URL_PROPERTIES.join(', ');
13
14
  const EXTRACT_DESCRIPTION = 'Extract a specific value from the target before asserting. For a ' +
@@ -37,14 +38,17 @@ const javaScriptTargetSchema = zod_1.z
37
38
  javaScript: shared_1.javaScriptDescriptorSchema,
38
39
  })
39
40
  .passthrough();
40
- const assertTargetSchema = zod_1.z.union([
41
+ const ASSERT_TARGET_SHAPES = '{kind: "Location"} for the current URL, {kind: "GetVariable", variable} ' +
42
+ 'for a variable, {kind: "Viewport"} for the whole page, {javaScript: ...} ' +
43
+ 'for a JS expression, or a find descriptor for an element';
44
+ const assertTargetSchema = (0, described_union_1.describedUnion)([
41
45
  getCurrentLocationTargetSchema,
42
46
  getVariableTargetSchema,
43
47
  getViewportTargetSchema,
44
48
  javaScriptTargetSchema,
45
49
  find_descriptors_1.findDescriptorSchema,
46
50
  find_descriptors_1.mobileFindDescriptorSchema,
47
- ]);
51
+ ], `Assert target — one of: ${ASSERT_TARGET_SHAPES}.`);
48
52
  exports.assertStepDescriptorSchema = common_1.baseStepDescriptorSchema
49
53
  .extend({
50
54
  target: assertTargetSchema
@@ -69,19 +73,20 @@ exports.assertStepDescriptorSchema = common_1.baseStepDescriptorSchema
69
73
  .describe('Assert a condition on a target (element, variable, URL, or JS expression)');
70
74
  exports.ifStepDescriptorSchema = exports.assertStepDescriptorSchema.describe('Conditional branch -- evaluates a condition to decide which steps to execute');
71
75
  exports.elseIfStepDescriptorSchema = exports.assertStepDescriptorSchema.describe('Additional conditional branch within an If block');
72
- const assertTargetAuthoringSchema = zod_1.z.union([
76
+ const assertTargetAuthoringSchema = (0, described_union_1.describedUnion)([
73
77
  getCurrentLocationTargetSchema,
74
78
  getVariableTargetSchema,
75
79
  getViewportTargetSchema,
76
80
  javaScriptTargetSchema,
77
81
  find_descriptors_1.browserFindAuthoringSchema,
78
- ]);
79
- const nonLocationAssertTargetAuthoringSchema = zod_1.z.union([
82
+ ], `Assert target — one of: ${ASSERT_TARGET_SHAPES}.`);
83
+ const nonLocationAssertTargetAuthoringSchema = (0, described_union_1.describedUnion)([
80
84
  getVariableTargetSchema,
81
85
  getViewportTargetSchema,
82
86
  javaScriptTargetSchema,
83
87
  find_descriptors_1.browserFindAuthoringSchema,
84
- ]);
88
+ ], `Assert target — one of: ${ASSERT_TARGET_SHAPES}. Comparing the current ` +
89
+ 'URL needs an extract naming the URL property.');
85
90
  const locationExtractAuthoringSchema = zod_1.z
86
91
  .object({
87
92
  extractType: zod_1.z.literal('extract_attribute'),
@@ -1 +1 @@
1
- {"version":3,"file":"files-downloads.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/files-downloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA2BtB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI4B,CAAC;AAkF5D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAamB,CAAC;AAG5D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;iBAEqB,CAAC;AA0BzD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4C6C,CAAC"}
1
+ {"version":3,"file":"files-downloads.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/files-downloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA4BtB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI4B,CAAC;AAmF5D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAamB,CAAC;AAG5D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;iBAEqB,CAAC;AA0BzD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4C6C,CAAC"}
@@ -6,6 +6,7 @@ const common_1 = require("../common");
6
6
  const find_descriptors_1 = require("../find-descriptors");
7
7
  const shared_1 = require("./shared");
8
8
  const mablscriptFind_1 = require("../../../mablscriptFind");
9
+ const described_union_1 = require("../described-union");
9
10
  const nonBlankSourceId = () => zod_1.z.string().trim().min(1).regex(/\S/);
10
11
  const fileUploadDescriptorSchema = zod_1.z.object({
11
12
  id: zod_1.z.string().optional(),
@@ -58,10 +59,8 @@ const runVariableFileDescriptor = zod_1.z
58
59
  'display/error metadata only).'),
59
60
  })
60
61
  .strict();
61
- const fileUploadDescriptorAuthoringSchema = zod_1.z.union([
62
- workspaceFileDescriptor,
63
- runVariableFileDescriptor,
64
- ]);
62
+ const fileUploadDescriptorAuthoringSchema = (0, described_union_1.describedUnion)([workspaceFileDescriptor, runVariableFileDescriptor], 'File to upload — exactly one source: {id} for a workspace file upload, or ' +
63
+ '{file_variable_ref} for a run file-variable.');
65
64
  exports.setFilesStepAuthoringSchema = shared_1.stepWithBrowserFindAuthoringSchema
66
65
  .extend({
67
66
  find: find_descriptors_1.browserFindAuthoringSchema.describe('Required. The file input element to set files on.'),
@@ -64,7 +64,7 @@ export declare const evaluateFlowStepSchema: z.ZodObject<{
64
64
  iteration_value: z.ZodOptional<z.ZodString>;
65
65
  iteration_condition: z.ZodOptional<z.ZodObject<{
66
66
  If: z.ZodIntersection<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodObject<{
67
- condition: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
67
+ condition: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
68
68
  conditionType: z.ZodLiteral<"comparison">;
69
69
  comparisonType: z.ZodEnum<{
70
70
  contains: "contains";
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAmBtB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMtB,CAAC;AAWjB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAC;AAOjB,w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mBAAgD,CAAC;AAKhF,eAAO,MAAM,cAAc;;;;iBAQ+B,CAAC"}
@@ -5,6 +5,7 @@ exports.hasBrowserFindLocator = hasBrowserFindLocator;
5
5
  const zod_1 = require("zod");
6
6
  const common_1 = require("../common");
7
7
  const find_descriptors_1 = require("../find-descriptors");
8
+ const described_union_1 = require("../described-union");
8
9
  exports.stepWithBrowserFindSchema = common_1.baseStepDescriptorSchema
9
10
  .extend({
10
11
  find: find_descriptors_1.browserFindDescriptorSchema.optional(),
@@ -39,6 +40,8 @@ exports.BROWSER_FIND_REQUIRED_STEP_TYPES = new Set([
39
40
  exports.onFailureEnum = zod_1.z
40
41
  .enum(['continue', 'terminate', 'failAtEnd'])
41
42
  .describe('Behavior when a step fails: continue = pass with warning, terminate = fail immediately, failAtEnd = continue executing but mark test failed at the end');
43
+ const INLINE_SNIPPET_SHAPE = 'inline code {inlineSnippet: {body, parameters: []}, parameterOverrides: []}';
44
+ const REUSABLE_SNIPPET_SHAPE = 'reusable snippet {snippetId, snippetInvariantId, parameterOverrides: []}';
42
45
  const parameterOverrideSchema = zod_1.z.object({
43
46
  id: zod_1.z.string(),
44
47
  value: zod_1.z.string(),
@@ -82,21 +85,14 @@ const legacyInlineJavaScriptSchema = zod_1.z.object({
82
85
  encodedJS: zod_1.z.string(),
83
86
  actionCode: zod_1.z.string().optional(),
84
87
  });
85
- exports.javaScriptDescriptorSchema = zod_1.z
86
- .union([
88
+ exports.javaScriptDescriptorSchema = (0, described_union_1.describedUnion)([
87
89
  reusableSnippetSchema,
88
90
  inlineSnippetSchema,
89
91
  legacyReusableSnippetSchema,
90
92
  legacyInlineJavaScriptSchema,
91
- ])
92
- .describe('JavaScript code reference — inline snippet, reusable snippet, or legacy encoded JS');
93
- exports.javaScriptDescriptorAuthoringSchema = zod_1.z
94
- .union([reusableSnippetSchema, inlineSnippetSchema])
95
- .describe('JavaScript code reference — inline snippet or reusable snippet');
96
- exports.snippetDescriptorSchema = zod_1.z.union([
97
- reusableSnippetSchema,
98
- inlineSnippetSchema,
99
- ]);
93
+ ], `JavaScript code reference — one of: ${INLINE_SNIPPET_SHAPE}; ${REUSABLE_SNIPPET_SHAPE}; or legacy {encodedJS}.`);
94
+ exports.javaScriptDescriptorAuthoringSchema = (0, described_union_1.describedUnion)([reusableSnippetSchema, inlineSnippetSchema], `JavaScript code reference — one of: ${INLINE_SNIPPET_SHAPE}; or ${REUSABLE_SNIPPET_SHAPE}.`);
95
+ exports.snippetDescriptorSchema = (0, described_union_1.describedUnion)([reusableSnippetSchema, inlineSnippetSchema], `Snippet — one of: ${INLINE_SNIPPET_SHAPE}; or ${REUSABLE_SNIPPET_SHAPE}.`);
100
96
  exports.textOrSymbolSchema = zod_1.z.union([zod_1.z.string(), common_1.mablSymbolObjectSchema]);
101
97
  exports.aiPromptSchema = zod_1.z
102
98
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"variables-js.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/variables-js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA8FtB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAatC,CAAC;AAGJ,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAG5C,CAAC;AAGJ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKyB,CAAC;AAQnE,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKgB,CAAC;AAGnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;iBAKkB,CAAC"}
1
+ {"version":3,"file":"variables-js.d.ts","sourceRoot":"","sources":["../../../../src/validator/schemas/steps/variables-js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AA4GtB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAatC,CAAC;AAGJ,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAG5C,CAAC;AAGJ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKyB,CAAC;AAQnE,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKgB,CAAC;AAGnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;iBAKkB,CAAC"}
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
5
5
  const common_1 = require("../common");
6
6
  const find_descriptors_1 = require("../find-descriptors");
7
7
  const shared_1 = require("./shared");
8
+ const described_union_1 = require("../described-union");
8
9
  const emailGeneratorSchema = zod_1.z.object({
9
10
  type: zod_1.z.literal('EMAIL'),
10
11
  });
@@ -34,7 +35,7 @@ const fileContentsGeneratorSchema = zod_1.z.object({
34
35
  type: zod_1.z.literal('FILE_CONTENTS'),
35
36
  file_variable_ref: zod_1.z.string().min(1),
36
37
  });
37
- const urlGeneratorSchema = zod_1.z.discriminatedUnion('urlPart', [
38
+ const urlGeneratorSchema = (0, described_union_1.describedDiscriminatedUnion)('urlPart', [
38
39
  zod_1.z.object({
39
40
  type: zod_1.z.literal('URL'),
40
41
  urlPart: zod_1.z.literal('full'),
@@ -62,8 +63,10 @@ const urlGeneratorSchema = zod_1.z.discriminatedUnion('urlPart', [
62
63
  urlPart: zod_1.z.literal('regex'),
63
64
  regexPattern: zod_1.z.string().min(1),
64
65
  }),
65
- ]);
66
- const generatorSchema = zod_1.z.discriminatedUnion('type', [
66
+ ], 'URL generator — urlPart is one of full, hostname, hash, pathSegment (with ' +
67
+ 'pathSegmentIndex), queryParameter (with queryParameterName), or regex ' +
68
+ '(with regexPattern).');
69
+ const generatorSchema = (0, described_union_1.describedDiscriminatedUnion)('type', [
67
70
  emailGeneratorSchema,
68
71
  patternGeneratorSchema,
69
72
  javaScriptGeneratorSchema,
@@ -72,7 +75,10 @@ const generatorSchema = zod_1.z.discriminatedUnion('type', [
72
75
  cookieValueGeneratorSchema,
73
76
  fileContentsGeneratorSchema,
74
77
  urlGeneratorSchema,
75
- ]);
78
+ ], 'How to generate the variable value — type is one of EMAIL, PATTERN (with ' +
79
+ 'pattern), JAVASCRIPT (with javaScript), ATTRIBUTE (with attribute), ' +
80
+ 'ELEMENT_COUNT, COOKIE_ATTRIBUTE (with cookieSelector and attribute), ' +
81
+ 'FILE_CONTENTS (with file_variable_ref), or URL (with urlPart).');
76
82
  exports.createVariableStepSchema = common_1.baseStepDescriptorSchema
77
83
  .extend({
78
84
  name: zod_1.z
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq-internal/mobile-runtime",
3
- "version": "2.133.1",
3
+ "version": "2.133.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }