@unotest/web 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unotest/web",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "description": "AI-native E2E testing for web applications. MCP server (run_test / step / resume / inspect_runtime / agent_fix) + CLI runner + JavaScript DSL scenarios on a sandboxed AST engine + semantic DOM snapshots.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -86,18 +86,26 @@
86
86
  "tsx": "^4.19.2",
87
87
  "yaml": "^2.6.0",
88
88
  "zod": "^3.23.8",
89
- "@unotest/core": "^0.51.0",
90
- "@unotest/protocol": "^0.51.0",
91
- "@unotest/grounder-client": "^0.51.0",
92
- "@unotest/dsl": "^0.51.0",
93
- "@unotest/viewer": "^0.51.0"
89
+ "@unotest/core": "^0.52.0",
90
+ "@unotest/dsl": "^0.52.0",
91
+ "@unotest/protocol": "^0.52.0",
92
+ "@unotest/viewer": "^0.52.0",
93
+ "@unotest/grounder-client": "^0.52.0"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@types/node": "^22.10.0",
97
97
  "javascript-obfuscator": "^4.1.1",
98
98
  "tsup": "^8.5.1",
99
99
  "typescript": "^5.7.2",
100
- "@unotest/judge": "^0.51.0",
101
- "@unotest/grounder": "^0.51.0"
100
+ "@unotest/judge": "^0.52.0",
101
+ "@unotest/grounder": "^0.52.0"
102
+ },
103
+ "peerDependencies": {
104
+ "typescript": ">=5.0.0"
105
+ },
106
+ "peerDependenciesMeta": {
107
+ "typescript": {
108
+ "optional": true
109
+ }
102
110
  }
103
111
  }
@@ -153,6 +153,12 @@ interface String {
153
153
  trimEnd(): string;
154
154
  /** Removes the leading white space and line terminator characters from a string. */
155
155
  trimStart(): string;
156
+ /**
157
+ * Matches a string with a regular expression, and returns an iterable of matches
158
+ * containing the results of that search.
159
+ * @param regexp A variable name or string literal containing the regular expression pattern and flags.
160
+ */
161
+ matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
156
162
  /**
157
163
  * Replace all instances of a substring in a string, using a regular expression or search string.
158
164
  * @param searchValue A string to search for.
@@ -664,6 +670,18 @@ interface Map<K, V> {
664
670
  readonly size: number;
665
671
  /** Returns an iterable of entries in the map. */
666
672
  [Symbol.iterator](): MapIterator<[K, V]>;
673
+ /**
674
+ * Returns an iterable of key, value pairs for every entry in the map.
675
+ */
676
+ entries(): MapIterator<[K, V]>;
677
+ /**
678
+ * Returns an iterable of keys in the map
679
+ */
680
+ keys(): MapIterator<K>;
681
+ /**
682
+ * Returns an iterable of values in the map
683
+ */
684
+ values(): MapIterator<V>;
667
685
  }
668
686
 
669
687
  interface Set<T> {
@@ -691,6 +709,18 @@ interface Set<T> {
691
709
  readonly size: number;
692
710
  /** Iterates over values in the set. */
693
711
  [Symbol.iterator](): SetIterator<T>;
712
+ /**
713
+ * Returns an iterable of [v,v] pairs for every value `v` in the set.
714
+ */
715
+ entries(): SetIterator<[T, T]>;
716
+ /**
717
+ * Despite its name, returns an iterable of the values in the set.
718
+ */
719
+ keys(): SetIterator<T>;
720
+ /**
721
+ * Returns an iterable of values in the set.
722
+ */
723
+ values(): SetIterator<T>;
694
724
  }
695
725
 
696
726
  interface Math {
@@ -1034,6 +1064,18 @@ interface ArrayConstructor {
1034
1064
  * @param items A set of elements to include in the new array object.
1035
1065
  */
1036
1066
  of<T>(...items: T[]): T[];
1067
+ /**
1068
+ * Creates an array from an iterable object.
1069
+ * @param iterable An iterable object to convert to an array.
1070
+ */
1071
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
1072
+ /**
1073
+ * Creates an array from an iterable object.
1074
+ * @param iterable An iterable object to convert to an array.
1075
+ * @param mapfn A mapping function to call on every element of the array.
1076
+ * @param thisArg Value of 'this' used to invoke the mapfn.
1077
+ */
1078
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
1037
1079
  }
1038
1080
 
1039
1081
  interface ObjectConstructor {
@@ -1098,6 +1140,16 @@ interface ObjectConstructor {
1098
1140
  * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1099
1141
  */
1100
1142
  entries(o: {}): [string, any][];
1143
+ /**
1144
+ * Returns an object created by key-value entries for properties and methods
1145
+ * @param entries An iterable object that contains key-value entries for properties and methods.
1146
+ */
1147
+ fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T; };
1148
+ /**
1149
+ * Returns an object created by key-value entries for properties and methods
1150
+ * @param entries An iterable object that contains key-value entries for properties and methods.
1151
+ */
1152
+ fromEntries(entries: Iterable<readonly any[]>): any;
1101
1153
  /**
1102
1154
  * Determines whether an object has a property with the specified name.
1103
1155
  * @param o An object.
@@ -1110,10 +1162,12 @@ interface MapConstructor {
1110
1162
  new (): Map<any, any>;
1111
1163
  new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
1112
1164
  new (): Map<any, any>;
1165
+ new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
1113
1166
  }
1114
1167
 
1115
1168
  interface SetConstructor {
1116
1169
  new <T = any>(values?: readonly T[] | null): Set<T>;
1170
+ new <T>(iterable?: Iterable<T> | null): Set<T>;
1117
1171
  }
1118
1172
 
1119
1173
  /*! *****************************************************************************
@@ -1164,18 +1218,50 @@ interface ConcatArray<T> {
1164
1218
  slice(start?: number, end?: number): T[];
1165
1219
  }
1166
1220
 
1167
- interface Iterator<T, TReturn = any, TNext = any> {
1221
+ interface Iterable<T, TReturn = any, TNext = any> {
1222
+ [Symbol.iterator](): Iterator<T, TReturn, TNext>;
1223
+ }
1168
1224
 
1225
+ interface Iterator<T, TReturn = any, TNext = any> {
1226
+ // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
1227
+ next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
1228
+ return?(value?: TReturn): IteratorResult<T, TReturn>;
1229
+ throw?(e?: any): IteratorResult<T, TReturn>;
1169
1230
  }
1170
1231
 
1171
1232
  interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
1172
1233
  [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
1173
1234
  }
1174
1235
 
1236
+ interface IteratorReturnResult<TReturn> {
1237
+ done: true;
1238
+ value: TReturn;
1239
+ }
1240
+
1241
+ interface IteratorYieldResult<TYield> {
1242
+ done?: false;
1243
+ value: TYield;
1244
+ }
1245
+
1175
1246
  interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1176
1247
  [Symbol.iterator](): MapIterator<T>;
1177
1248
  }
1178
1249
 
1250
+ interface RegExpExecArray extends Array<string> {
1251
+ /**
1252
+ * The index of the search at which the result was found.
1253
+ */
1254
+ index: number;
1255
+ /**
1256
+ * A copy of the search string.
1257
+ */
1258
+ input: string;
1259
+ groups?: {
1260
+ [key: string]: string;
1261
+ };
1262
+ indices?: RegExpIndicesArray;
1263
+ }
1264
+
1179
1265
  interface RegExpIndicesArray extends Array<[number, number]> {
1180
1266
  groups?: {
1181
1267
  [key: string]: [number, number];
@@ -1197,6 +1283,10 @@ interface RegExpMatchArray extends Array<string> {
1197
1283
  indices?: RegExpIndicesArray;
1198
1284
  }
1199
1285
 
1286
+ interface RegExpStringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1287
+ [Symbol.iterator](): RegExpStringIterator<T>;
1288
+ }
1289
+
1200
1290
  interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1201
1291
  [Symbol.iterator](): SetIterator<T>;
1202
1292
  }
@@ -1214,6 +1304,8 @@ interface SymbolConstructor {
1214
1304
  }
1215
1305
  declare var Symbol: SymbolConstructor;
1216
1306
 
1307
+ type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
1308
+
1217
1309
  declare var Math: Math;
1218
1310
  declare var JSON: JSON;
1219
1311
  declare var Number: NumberConstructor;
@@ -1261,29 +1353,3 @@ interface Array<T> {
1261
1353
  toSpliced(start: number, deleteCount?: number, ...items: T[]): T[];
1262
1354
  with(index: number, value: T): T[];
1263
1355
  }
1264
- interface String {
1265
- /** All the matches of a global regular expression, as an array. */
1266
- matchAll(regexp: RegExp): RegExpMatchArray[];
1267
- }
1268
- // keys(), values() and entries() answer arrays: the language has no
1269
- // iterator objects.
1270
- interface Map<K, V> {
1271
- keys(): K[];
1272
- values(): V[];
1273
- entries(): [K, V][];
1274
- }
1275
- interface Set<T> {
1276
- keys(): T[];
1277
- values(): T[];
1278
- entries(): [T, T][];
1279
- }
1280
- interface ArrayConstructor {
1281
- /** The entries of a Map, the items of a Set, the characters of a string. */
1282
- from<K, V>(source: Map<K, V>): [K, V][];
1283
- from<T>(source: Set<T>): T[];
1284
- from(source: string): string[];
1285
- }
1286
- interface ObjectConstructor {
1287
- /** An object from [key, value] pairs: the inverse of Object.entries. */
1288
- fromEntries<T = any>(entries: readonly (readonly [PropertyKey, T])[]): { [k: string]: T };
1289
- }