@specter-automation/test 1.0.149 → 1.0.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/failure-capture.d.ts +7 -0
- package/dist/core/failure-capture.js +128 -0
- package/dist/core/locators/actor-locator.d.ts +67 -4
- package/dist/core/locators/actor-locator.js +128 -9
- package/dist/core/locators/ai-controller-locator.d.ts +7 -1
- package/dist/core/locators/ai-controller-locator.js +10 -1
- package/dist/core/locators/specter-locator.js +18 -1
- package/dist/core/specter-client.d.ts +26 -49
- package/dist/core/specter-client.js +59 -44
- package/dist/core/specter-debug.d.ts +145 -0
- package/dist/core/specter-debug.js +35 -0
- package/dist/core/specter-matcher-report.d.ts +1 -1
- package/dist/core/specter-matcher-report.js +1 -1
- package/dist/core/specter-math.d.ts +417 -0
- package/dist/core/specter-math.js +522 -0
- package/dist/core/specter-preview.js +2 -1
- package/dist/core/specter-reporter.js +4 -2
- package/dist/core/test-wrapper.d.ts +2 -1
- package/dist/core/test-wrapper.js +27 -42
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -1
- package/dist/matchers/actor-matchers.d.ts +51 -30
- package/dist/matchers/actor-matchers.js +93 -10
- package/dist/matchers/gas-matchers.d.ts +2 -0
- package/dist/matchers/gas-matchers.js +3 -0
- package/dist/matchers/instrument.js +21 -1
- package/package.json +1 -1
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 3D vector representation matching Unreal Engine's FVector (in centimeters).
|
|
3
|
+
* Left-handed coordinate system (Z-Up, X-Forward, Y-Right).
|
|
4
|
+
* All components are optional and default to 0 when omitted.
|
|
5
|
+
*/
|
|
6
|
+
export interface Vector3 {
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
z?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 2D vector representation matching Unreal Engine's FVector2D.
|
|
13
|
+
*/
|
|
14
|
+
export interface Vector2D {
|
|
15
|
+
X?: number;
|
|
16
|
+
Y?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Euler angle rotation representation matching Unreal Engine's FRotator (in degrees).
|
|
20
|
+
* - Pitch: Rotation around Y-axis (nose up/down)
|
|
21
|
+
* - Yaw: Rotation around Z-axis (heading / compass, clockwise)
|
|
22
|
+
* - Roll: Rotation around X-axis (banking right/left)
|
|
23
|
+
* All components are optional and default to 0 when omitted.
|
|
24
|
+
*/
|
|
25
|
+
export interface Rotator {
|
|
26
|
+
pitch?: number;
|
|
27
|
+
yaw?: number;
|
|
28
|
+
roll?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Complete 3D transform matching Unreal Engine's FTransform.
|
|
32
|
+
*/
|
|
33
|
+
export interface Transform {
|
|
34
|
+
location: Vector3;
|
|
35
|
+
rotation?: Rotator;
|
|
36
|
+
scale?: Vector3;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a partial or complete Vector3, defaulting undefined components (x, y, z) to 0.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveVector3(v?: Vector3 | null): {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
z: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Resolves a partial or complete Rotator, defaulting undefined components (pitch, yaw, roll) to 0.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveRotator(r?: Rotator | null): {
|
|
50
|
+
pitch: number;
|
|
51
|
+
yaw: number;
|
|
52
|
+
roll: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Normalizes an angle in degrees to the [-180, 180) range, matching Unreal's FRotator::NormalizeAxis.
|
|
56
|
+
*/
|
|
57
|
+
export declare function normalizeAxis(angleDeg: number): number;
|
|
58
|
+
/**
|
|
59
|
+
* Utilities for 3D vectors matching Unreal Engine coordinate math.
|
|
60
|
+
*/
|
|
61
|
+
export declare const VectorUtils: {
|
|
62
|
+
/**
|
|
63
|
+
* Creates a Vector3 at (0, 0, 0).
|
|
64
|
+
*/
|
|
65
|
+
zero: () => {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
z: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Resolves a partial or complete Vector3, defaulting undefined components to 0.
|
|
72
|
+
*/
|
|
73
|
+
resolve: typeof resolveVector3;
|
|
74
|
+
/**
|
|
75
|
+
* Adds an offset in a given direction vector: location + (direction * offset).
|
|
76
|
+
* Undefined x, y, z components default to 0.
|
|
77
|
+
*/
|
|
78
|
+
addOffset: (location: Vector3, direction: Vector3, offset: number) => {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
z: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Adds two vectors (A + B). Undefined components default to 0.
|
|
85
|
+
*/
|
|
86
|
+
add: (a: Vector3, b: Vector3) => {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
z: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Subtracts vector B from vector A (A - B). Undefined components default to 0.
|
|
93
|
+
*/
|
|
94
|
+
subtract: (a: Vector3, b: Vector3) => {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
z: number;
|
|
98
|
+
};
|
|
99
|
+
/** `a - b`: alias for subtract */
|
|
100
|
+
sub: (a: Vector3, b: Vector3) => {
|
|
101
|
+
x: number;
|
|
102
|
+
y: number;
|
|
103
|
+
z: number;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Multiplies a vector by a scalar. Undefined components default to 0.
|
|
107
|
+
*/
|
|
108
|
+
multiply: (v: Vector3, scalar: number) => {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
z: number;
|
|
112
|
+
};
|
|
113
|
+
/** `v * scalar`: alias for multiply */
|
|
114
|
+
scale: (v: Vector3, scalar: number) => {
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
z: number;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Divides a vector by a scalar. Returns (0, 0, 0) if scalar is 0.
|
|
121
|
+
*/
|
|
122
|
+
divide: (v: Vector3, scalar: number) => {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
z: number;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Calculates the Euclidean distance between two 3D vectors. Undefined components default to 0.
|
|
129
|
+
*/
|
|
130
|
+
distance: (a: Vector3, b: Vector3) => number;
|
|
131
|
+
/**
|
|
132
|
+
* Calculates the 2D Euclidean distance on the ground plane (XY only). Undefined components default to 0.
|
|
133
|
+
*/
|
|
134
|
+
distance2D: (a: Vector3, b: Vector3) => number;
|
|
135
|
+
/**
|
|
136
|
+
* Returns the magnitude / length of a 3D vector. Undefined components default to 0.
|
|
137
|
+
*/
|
|
138
|
+
length: (v: Vector3) => number;
|
|
139
|
+
/**
|
|
140
|
+
* Returns the 2D magnitude on the XY plane. Undefined components default to 0.
|
|
141
|
+
*/
|
|
142
|
+
length2D: (v: Vector3) => number;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the squared length of a 3D vector. Undefined components default to 0.
|
|
145
|
+
*/
|
|
146
|
+
lengthSquared: (v: Vector3) => number;
|
|
147
|
+
/**
|
|
148
|
+
* Returns a normalized unit vector (length = 1). Returns (0, 0, 0) if length is 0.
|
|
149
|
+
*/
|
|
150
|
+
normalize: (v: Vector3) => {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
z: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Returns the normalized direction vector from point `from` to point `to`.
|
|
157
|
+
* Undefined components default to 0.
|
|
158
|
+
*/
|
|
159
|
+
direction: (from: Vector3, to: Vector3) => {
|
|
160
|
+
x: number;
|
|
161
|
+
y: number;
|
|
162
|
+
z: number;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Computes the dot product of two vectors (A · B). Undefined components default to 0.
|
|
166
|
+
*/
|
|
167
|
+
dot: (a: Vector3, b: Vector3) => number;
|
|
168
|
+
/**
|
|
169
|
+
* Computes the cross product of two vectors (A × B) in Unreal's left-handed coordinate system.
|
|
170
|
+
* Undefined components default to 0.
|
|
171
|
+
*/
|
|
172
|
+
cross: (a: Vector3, b: Vector3) => {
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
z: number;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Linearly interpolates between vector A and B by alpha. Undefined components default to 0.
|
|
179
|
+
*/
|
|
180
|
+
lerp: (a: Vector3, b: Vector3, alpha: number) => {
|
|
181
|
+
x: number;
|
|
182
|
+
y: number;
|
|
183
|
+
z: number;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Checks if two vectors are approximately equal within a tolerance distance.
|
|
187
|
+
* Undefined components default to 0.
|
|
188
|
+
*/
|
|
189
|
+
isNearlyEqual: (a: Vector3, b: Vector3, tolerance?: number) => boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Converts a direction vector into an Unreal Engine FRotator (Roll = 0).
|
|
192
|
+
* Matches Unreal's `FVector::Rotation()` / `FRotationMatrix::MakeFromX()`.
|
|
193
|
+
*/
|
|
194
|
+
toRotator: (direction: Vector3) => {
|
|
195
|
+
pitch: number;
|
|
196
|
+
yaw: number;
|
|
197
|
+
roll: number;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Calculates the FRotator required to face from point `from` towards point `to`.
|
|
201
|
+
* Identical to Unreal Engine's `UKismetMathLibrary::FindLookAtRotation`.
|
|
202
|
+
* Undefined components default to 0.
|
|
203
|
+
*/
|
|
204
|
+
findLookAtRotation: (from: Vector3, to: Vector3) => {
|
|
205
|
+
pitch: number;
|
|
206
|
+
yaw: number;
|
|
207
|
+
roll: number;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Rotates a 3D vector by an Unreal FRotator.
|
|
211
|
+
* Matches Unreal Engine's `FRotator::RotateVector`.
|
|
212
|
+
* Undefined components default to 0.
|
|
213
|
+
*/
|
|
214
|
+
rotate: (v: Vector3, rot: Rotator) => {
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
z: number;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Utilities for Euler rotations (Pitch, Yaw, Roll in degrees) matching Unreal Engine's FRotator.
|
|
222
|
+
*/
|
|
223
|
+
export declare const RotatorUtils: {
|
|
224
|
+
/**
|
|
225
|
+
* Creates a Rotator at (pitch: 0, yaw: 0, roll: 0).
|
|
226
|
+
*/
|
|
227
|
+
zero: () => {
|
|
228
|
+
pitch: number;
|
|
229
|
+
yaw: number;
|
|
230
|
+
roll: number;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Resolves a partial or complete Rotator, defaulting undefined components (pitch, yaw, roll) to 0.
|
|
234
|
+
*/
|
|
235
|
+
resolve: typeof resolveRotator;
|
|
236
|
+
/**
|
|
237
|
+
* Constructs a Rotator from pitch, yaw, and optional roll. Defaults omitted parameters to 0.
|
|
238
|
+
*/
|
|
239
|
+
make: (pitch?: number, yaw?: number, roll?: number) => {
|
|
240
|
+
pitch: number;
|
|
241
|
+
yaw: number;
|
|
242
|
+
roll: number;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Constructs a flat yaw-only Rotator (pitch: 0, roll: 0).
|
|
246
|
+
*/
|
|
247
|
+
fromYaw: (yaw?: number) => {
|
|
248
|
+
pitch: number;
|
|
249
|
+
yaw: number;
|
|
250
|
+
roll: number;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Calculates the look-at rotation from a direction vector.
|
|
254
|
+
* Matches Unreal's `FVector::Rotation()`. Undefined components default to 0.
|
|
255
|
+
*/
|
|
256
|
+
fromDirection: (dir: Vector3) => {
|
|
257
|
+
pitch: number;
|
|
258
|
+
yaw: number;
|
|
259
|
+
roll: number;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Calculates the rotation required to look from `from` towards `to`.
|
|
263
|
+
* Identical to Unreal Engine's `UKismetMathLibrary::FindLookAtRotation(Start, Target)`.
|
|
264
|
+
* Undefined components default to 0.
|
|
265
|
+
*/
|
|
266
|
+
fromVectors: (from: Vector3, to: Vector3) => {
|
|
267
|
+
pitch: number;
|
|
268
|
+
yaw: number;
|
|
269
|
+
roll: number;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Alias for `fromVectors`: finds the look-at rotation from `start` to `target`.
|
|
273
|
+
*/
|
|
274
|
+
findLookAtRotation: (start: Vector3, target: Vector3) => {
|
|
275
|
+
pitch: number;
|
|
276
|
+
yaw: number;
|
|
277
|
+
roll: number;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Computes the three unit axis vectors (Forward, Right, Up) for a given Rotator.
|
|
281
|
+
* Matches Unreal Engine's `FRotationMatrix(Rotator)`.
|
|
282
|
+
* Undefined components default to 0.
|
|
283
|
+
*/
|
|
284
|
+
getAxes: (rot: Rotator) => {
|
|
285
|
+
fwd: {
|
|
286
|
+
x: number;
|
|
287
|
+
y: number;
|
|
288
|
+
z: number;
|
|
289
|
+
};
|
|
290
|
+
right: {
|
|
291
|
+
x: number;
|
|
292
|
+
y: number;
|
|
293
|
+
z: number;
|
|
294
|
+
};
|
|
295
|
+
up: {
|
|
296
|
+
x: number;
|
|
297
|
+
y: number;
|
|
298
|
+
z: number;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* Returns the unit forward vector (+X) for this rotation.
|
|
303
|
+
* Matches Unreal Engine's `FRotator::Vector()`.
|
|
304
|
+
* Undefined components default to 0.
|
|
305
|
+
*/
|
|
306
|
+
getForwardVector: (rot: Rotator) => {
|
|
307
|
+
x: number;
|
|
308
|
+
y: number;
|
|
309
|
+
z: number;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Returns the unit right vector (+Y) for this rotation.
|
|
313
|
+
*/
|
|
314
|
+
getRightVector: (rot: Rotator) => {
|
|
315
|
+
x: number;
|
|
316
|
+
y: number;
|
|
317
|
+
z: number;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Returns the unit up vector (+Z) for this rotation.
|
|
321
|
+
*/
|
|
322
|
+
getUpVector: (rot: Rotator) => {
|
|
323
|
+
x: number;
|
|
324
|
+
y: number;
|
|
325
|
+
z: number;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* Normalizes all components (Pitch, Yaw, Roll) to [-180, 180) degrees.
|
|
329
|
+
* Matches Unreal's `FRotator::GetNormalized()`. Undefined components default to 0.
|
|
330
|
+
*/
|
|
331
|
+
normalize: (rot: Rotator) => {
|
|
332
|
+
pitch: number;
|
|
333
|
+
yaw: number;
|
|
334
|
+
roll: number;
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Calculates the angular difference (to - from) with all components normalized to [-180, 180).
|
|
338
|
+
* Undefined components default to 0.
|
|
339
|
+
*/
|
|
340
|
+
delta: (from: Rotator, to: Rotator) => {
|
|
341
|
+
pitch: number;
|
|
342
|
+
yaw: number;
|
|
343
|
+
roll: number;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Calculates the absolute angular distance in degrees between two 3D orientations (0° to 180°).
|
|
347
|
+
* Undefined components default to 0.
|
|
348
|
+
*/
|
|
349
|
+
angularDistance: (a: Rotator, b: Rotator) => number;
|
|
350
|
+
/**
|
|
351
|
+
* Calculates the absolute difference between two yaw angles in degrees (0° to 180°).
|
|
352
|
+
* Undefined components default to 0.
|
|
353
|
+
*/
|
|
354
|
+
yawDifference: (a: Rotator | number, b: Rotator | number) => number;
|
|
355
|
+
/**
|
|
356
|
+
* Checks if two Rotators are approximately equal within a tolerance in degrees.
|
|
357
|
+
* Handles 360-degree wrapping (e.g. 179° and -179° are within 2° of each other).
|
|
358
|
+
* Undefined components default to 0.
|
|
359
|
+
*/
|
|
360
|
+
isNearlyEqual: (a: Rotator, b: Rotator, toleranceDegrees?: number) => boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Interpolates smoothly from Rotator A to B taking the shortest angular path.
|
|
363
|
+
* Undefined components default to 0.
|
|
364
|
+
*/
|
|
365
|
+
lerp: (from: Rotator, to: Rotator, alpha: number) => {
|
|
366
|
+
pitch: number;
|
|
367
|
+
yaw: number;
|
|
368
|
+
roll: number;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Calculates the FRotator required to face from point `from` towards point `to`.
|
|
373
|
+
* Identical to Unreal Engine's `UKismetMathLibrary::FindLookAtRotation`.
|
|
374
|
+
* Undefined components default to 0.
|
|
375
|
+
*/
|
|
376
|
+
export declare function findLookAtRotation(from: Vector3, to: Vector3): {
|
|
377
|
+
pitch: number;
|
|
378
|
+
yaw: number;
|
|
379
|
+
roll: number;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Alias for `findLookAtRotation`: calculates the rotation between two 3D positions.
|
|
383
|
+
* Undefined components default to 0.
|
|
384
|
+
*/
|
|
385
|
+
export declare function getRotationBetween(from: Vector3, to: Vector3): {
|
|
386
|
+
pitch: number;
|
|
387
|
+
yaw: number;
|
|
388
|
+
roll: number;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Calculates the Euclidean distance between two 3D points.
|
|
392
|
+
* Undefined components default to 0.
|
|
393
|
+
*/
|
|
394
|
+
export declare function calculateDistance(a: Vector3, b: Vector3): number;
|
|
395
|
+
/**
|
|
396
|
+
* Calculates the 2D Euclidean distance on the ground plane (XY only).
|
|
397
|
+
* Undefined components default to 0.
|
|
398
|
+
*/
|
|
399
|
+
export declare function calculateDistance2D(a: Vector3, b: Vector3): number;
|
|
400
|
+
/**
|
|
401
|
+
* Normalizes all components of a Rotator to [-180, 180) degrees.
|
|
402
|
+
* Undefined components default to 0.
|
|
403
|
+
*/
|
|
404
|
+
export declare function normalizeRotator(rot: Rotator): {
|
|
405
|
+
pitch: number;
|
|
406
|
+
yaw: number;
|
|
407
|
+
roll: number;
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* Calculates the angular delta between two Rotators (to - from), wrapping shortest-path to [-180, 180).
|
|
411
|
+
* Undefined components default to 0.
|
|
412
|
+
*/
|
|
413
|
+
export declare function deltaRotator(from: Rotator, to: Rotator): {
|
|
414
|
+
pitch: number;
|
|
415
|
+
yaw: number;
|
|
416
|
+
roll: number;
|
|
417
|
+
};
|