roamwright 0.61.21 → 0.61.23

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.
@@ -0,0 +1,361 @@
1
+ // In-browser geometry and terrain-bake hashing runners built on a Roamwright page driver:
2
+ // ground height lattice readback (`runGroundHash`), crowd batch & standard hashing (`runCrowdHash`),
3
+ // skinned humanoid figure hashing (`runFigureHash`), and full cast & mount hashing (`runBeastHash`).
4
+ 'use strict';
5
+ const crypto = require('crypto');
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+ const { startSceneInPage } = require('./scene-run.cjs');
9
+
10
+ /**
11
+ * Parses CLI arguments for `runGroundHash`: `[address ...]`.
12
+ *
13
+ * @param {string[]} [argv=[]]
14
+ * @param {object} [defaults]
15
+ * @param {number} [defaults.points=385]
16
+ * @returns {{ addresses: string[], points: number }}
17
+ */
18
+ function parseGroundHashArgs(argv = [], { points = 385 } = {}) {
19
+ const addresses = argv.length ? [...argv] : [''];
20
+ return { addresses, points: +points || 385 };
21
+ }
22
+
23
+ /**
24
+ * Parses CLI arguments for scene-based geometry hash runners: `<address> [sceneId] [second=4]`.
25
+ *
26
+ * @param {string[]} [argv=[]]
27
+ * @returns {{ address: string, sceneId: string, at: number }}
28
+ */
29
+ function parseHashSceneArgs(argv = []) {
30
+ const [address = '', sceneId = '', at = '4'] = argv;
31
+ return { address, sceneId, at: +at };
32
+ }
33
+
34
+ /**
35
+ * Samples a `points x points` Float32 height lattice across the active space in `window[debug]`
36
+ * and returns it base64-encoded along with space metadata.
37
+ * Passed to `page.evaluate`; must remain self-contained.
38
+ *
39
+ * @param {{ debug: string, points: number, primarySpaceId?: string }} arg
40
+ * @returns {{ id: string, half: number, pooled: number, data: string }}
41
+ */
42
+ function sampleGroundLatticeInPage({ debug, points, primarySpaceId = 'world' }) {
43
+ const app = window[debug];
44
+ const space = app.space;
45
+ const half = space.rim ?? space.bound;
46
+ const ground = space.id === primarySpaceId && typeof app.terrainHeight === 'function' ? app.terrainHeight : space.ground;
47
+ const heights = new Float32Array(points * points);
48
+ for (let j = 0; j < points; j++)
49
+ for (let i = 0; i < points; i++)
50
+ heights[j * points + i] = ground(space.cx - half + (2 * half * i) / (points - 1), space.cz - half + (2 * half * j) / (points - 1));
51
+ let text = '';
52
+ const bytes = new Uint8Array(heights.buffer);
53
+ for (let k = 0; k < bytes.length; k += 32768) text += String.fromCharCode(...bytes.subarray(k, k + 32768));
54
+ return { id: space.id, half, pooled: navigator.hardwareConcurrency, data: btoa(text) };
55
+ }
56
+
57
+ /**
58
+ * Reads back a land's baked height lattice from a browser with workers, writes `<OUT>/ground-<space>.f32`,
59
+ * and prints its 24-hex SHA-256 digest.
60
+ *
61
+ * @param {object} driver Page driver from `createPageDriver`.
62
+ * @param {object} [options]
63
+ * @param {string[]} [options.argv=[]] Route addresses (`[address ...]`).
64
+ * @param {number} [options.points=385] Lattice points per side.
65
+ * @param {string} [options.primarySpaceId='world'] Space id that reads `terrainHeight` directly instead of `space.ground`.
66
+ * @param {number} [options.settleMs=8000] Wait after entry before sampling.
67
+ * @returns {Promise<Array<{ id: string, hash: string, half: number, file: string }>>}
68
+ */
69
+ async function runGroundHash(driver, { argv = [], points = 385, primarySpaceId = 'world', settleMs = 8000 } = {}) {
70
+ const { addresses, points: gridPoints } = parseGroundHashArgs(argv, { points });
71
+ const debug = driver.debug;
72
+ const browser = await driver.chromium.launch({ executablePath: driver.shell, ...driver.GPU });
73
+ const results = [];
74
+ for (const address of addresses) {
75
+ const ctx = await browser.newContext({ viewport: { width: 1280, height: 720 } });
76
+ await driver.applyStorage(ctx, { quality: 'low', muted: '1' });
77
+ const page = await ctx.newPage();
78
+ page.on('pageerror', e => console.log('PAGE ERROR', e.message.slice(0, 200)));
79
+ await driver.enter(page, driver.routeUrl(address));
80
+ await page.waitForTimeout(settleMs);
81
+ const read = await page.evaluate(sampleGroundLatticeInPage, { debug, points: gridPoints, primarySpaceId });
82
+ const bytes = Buffer.from(read.data, 'base64');
83
+ const file = path.join(driver.OUT, `ground-${read.id}.f32`);
84
+ fs.writeFileSync(file, bytes);
85
+ const hash = crypto.createHash('sha256').update(bytes).digest('hex').slice(0, 24);
86
+ console.log(hash, read.id, `${gridPoints} x ${gridPoints} over ${2 * read.half} m`, file);
87
+ results.push({ id: read.id, hash, half: read.half, file });
88
+ await ctx.close();
89
+ }
90
+ await browser.close();
91
+ return results;
92
+ }
93
+
94
+ /**
95
+ * Waits until the scene director reaches at least `at` seconds.
96
+ * Passed to `page.waitForFunction`; must remain self-contained.
97
+ *
98
+ * @param {{ debug: string, at: number }} arg
99
+ * @returns {boolean}
100
+ */
101
+ function waitSceneReachInPage({ debug, at }) {
102
+ const app = window[debug];
103
+ return !!(app && app.director && app.director.ev && app.director.t >= at);
104
+ }
105
+
106
+ /**
107
+ * Pauses the director, freezes moving troop members in place, and returns one active front member
108
+ * per troop so the runner can visit each troop to trigger near crowd builds.
109
+ * Passed to `page.evaluate`; must remain self-contained.
110
+ *
111
+ * @param {{ debug: string }} arg
112
+ * @returns {Array<{ ax: number, az: number }>}
113
+ */
114
+ function prepareCrowdHashInPage({ debug }) {
115
+ const app = window[debug];
116
+ app.director.paused = true;
117
+ app.state.mode = 'inspect';
118
+ const members = app.crowds.flatMap(c => c.list).filter(m => m.slotX !== undefined && m.move !== undefined);
119
+ for (const m of members) {
120
+ m.move = null;
121
+ m.speed = 0;
122
+ }
123
+ return app.crowds
124
+ .filter(c => c.list.length && c.list[0].slotX !== undefined)
125
+ .map(c => c.list[0])
126
+ .filter(g => g.home !== -1)
127
+ .map(g => ({ ax: g.ax, az: g.az }));
128
+ }
129
+
130
+ /**
131
+ * Places the inspect camera near a troop member so its near crowd batch is built.
132
+ * Passed to `page.evaluate`; must remain self-contained.
133
+ *
134
+ * @param {{ debug: string, ax: number, az: number }} arg
135
+ */
136
+ function focusCrowdTargetInPage({ debug, ax, az }) {
137
+ const app = window[debug];
138
+ const c = app.camera;
139
+ const y = app.space.ground(ax, az);
140
+ c.position.set(ax + 6, y + 3, az + 6);
141
+ c.lookAt(ax, y + 1, az);
142
+ c.updateMatrixWorld();
143
+ }
144
+
145
+ /**
146
+ * FNV-1a hashes every crowd batch mesh and standard mesh in `window[debug].scene`.
147
+ * Passed to `page.evaluate`; must remain self-contained.
148
+ *
149
+ * @param {{ debug: string, meshPrefix?: string, standardMeshName?: string, skipAttributes?: string[] }} arg
150
+ * @returns {Record<string, string>}
151
+ */
152
+ function hashCrowdMeshesInPage({ debug, meshPrefix = 'Crowd ', standardMeshName = 'host-standards', skipAttributes = ['aCrowdRows'] }) {
153
+ const app = window[debug];
154
+ const out = {};
155
+ const skip = new Set(skipAttributes);
156
+ const hash = (h, a) => {
157
+ if (!a) return h;
158
+ const b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
159
+ for (let i = 0; i < b.length; i++) h = Math.imul(h ^ b[i], 16777619) >>> 0;
160
+ return h;
161
+ };
162
+ app.scene.traverse(o => {
163
+ if (!o.isMesh || !(o.name.startsWith(meshPrefix) || o.name === standardMeshName)) return;
164
+ const g = o.geometry;
165
+ let h = 2166136261,
166
+ n = 0;
167
+ for (const k of Object.keys(g.attributes).sort()) {
168
+ if (skip.has(k)) continue;
169
+ const a = g.attributes[k].array;
170
+ if (!a) {
171
+ n = -1;
172
+ break;
173
+ }
174
+ h = hash(h, a);
175
+ n += a.length;
176
+ }
177
+ if (n < 0) {
178
+ out[o.name + ' ' + Object.keys(out).length] = 'released, ' + (g.index ? g.index.count / 3 : 0) + ' tris';
179
+ return;
180
+ }
181
+ h = hash(h, g.index?.array);
182
+ const key = o.name + (o.name === standardMeshName ? ' ' + Object.keys(out).filter(k => k.startsWith(standardMeshName)).length : '');
183
+ out[key] = h.toString(16) + ' (' + n + (g.index ? ', ' + g.index.count / 3 + ' tris' : '') + ')';
184
+ });
185
+ return out;
186
+ }
187
+
188
+ /**
189
+ * FNV-1a hashes every built humanoid actor's near and far skinned geometry (`position`, `skinIndex`, `skinWeight`).
190
+ * Passed to `page.evaluate`; must remain self-contained.
191
+ *
192
+ * @param {{ debug: string, kind?: string }} arg
193
+ * @returns {string[]}
194
+ */
195
+ function hashFiguresInPage({ debug, kind = 'human' }) {
196
+ const app = window[debug];
197
+ app.director.paused = true;
198
+ const hash = geo => {
199
+ let h = 2166136261,
200
+ n = 0;
201
+ const eat = array => {
202
+ const bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
203
+ n += bytes.length;
204
+ for (let i = 0; i < bytes.length; i++) h = Math.imul(h ^ bytes[i], 16777619);
205
+ };
206
+ for (const name of ['position', 'skinIndex', 'skinWeight']) if (geo.attributes[name]?.array?.length) eat(geo.attributes[name].array);
207
+ return (h >>> 0).toString(16).padStart(8, '0') + ':' + n;
208
+ };
209
+ return Object.values(app.actors)
210
+ .filter(a => a.built && a.kind === kind && a.hi?.skeleton && !a.primary)
211
+ .map(a =>
212
+ [
213
+ a.id.padEnd(24),
214
+ a.def.look.item || '-',
215
+ 'near',
216
+ a.nearBuilt ? hash(a.hi.geometry) : 'not built',
217
+ 'far',
218
+ hash(a.lo.geometry),
219
+ 'bones',
220
+ a.hi.skeleton.bones.length,
221
+ a.gripR ? 'bends' : 'stays',
222
+ a.gripL ? 'both' : '',
223
+ ].join(' '),
224
+ )
225
+ .sort();
226
+ }
227
+
228
+ /**
229
+ * FNV-1a hashes every built actor's meshes (including mounts, loose, and beside horses).
230
+ * Passed to `page.evaluate`; must remain self-contained.
231
+ *
232
+ * @param {{ debug: string }} arg
233
+ * @returns {string[]}
234
+ */
235
+ function hashBeastsInPage({ debug }) {
236
+ const app = window[debug];
237
+ app.director.paused = true;
238
+ const hash = geo => {
239
+ let h = 2166136261,
240
+ n = 0;
241
+ const eat = array => {
242
+ const bytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength);
243
+ n += bytes.length;
244
+ for (let i = 0; i < bytes.length; i++) h = Math.imul(h ^ bytes[i], 16777619);
245
+ };
246
+ for (const name of ['position', 'skinIndex', 'skinWeight', 'color'])
247
+ if (geo.attributes[name]?.array?.length) eat(geo.attributes[name].array);
248
+ if (geo.index?.array) eat(geo.index.array);
249
+ return (h >>> 0).toString(16).padStart(8, '0') + ':' + n;
250
+ };
251
+ const meshesOf = a => {
252
+ const seen = new Set(),
253
+ out = [];
254
+ const walk = root => root?.traverse?.(o => o.isMesh && o.geometry && !seen.has(o) && (seen.add(o), out.push(o)));
255
+ walk(a.group);
256
+ for (const horse of [a.mount, a.loose, a.beside]) walk(horse?.H?.mesh ?? horse?.mesh);
257
+ return out;
258
+ };
259
+ return Object.values(app.actors)
260
+ .filter(a => a.built && !a.primary)
261
+ .map(a => [a.id.padEnd(24), String(a.kind).padEnd(9), a.mount ? 'mounted' : '-', ...meshesOf(a).map(m => hash(m.geometry))].join(' '))
262
+ .sort();
263
+ }
264
+
265
+ async function openHashPage(driver, address) {
266
+ const browser = await driver.chromium.launch({ executablePath: driver.shell, ...driver.GPU });
267
+ const page = await browser.newPage({ viewport: { width: 960, height: 600 } });
268
+ await driver.applyStorage(page, { quality: 'high', muted: '1' });
269
+ page.on('pageerror', e => console.log('PAGE ERROR', e.message.slice(0, 200)));
270
+ await driver.enter(page, driver.routeUrl(address), { titledMs: 180000 });
271
+ await page.waitForTimeout(2500);
272
+ return { browser, page };
273
+ }
274
+
275
+ /**
276
+ * Hashes every crowd batch and standard geometry on a route (and optional scene beat).
277
+ *
278
+ * @param {object} driver Page driver from `createPageDriver`.
279
+ * @param {object} [options]
280
+ * @param {string[]} [options.argv=[]] Raw CLI arguments (`<address> [sceneId] [second=4]`).
281
+ * @param {string} [options.meshPrefix='Crowd ']
282
+ * @param {string} [options.standardMeshName='host-standards']
283
+ * @returns {Promise<Record<string, string>>}
284
+ */
285
+ async function runCrowdHash(driver, { argv = [], meshPrefix = 'Crowd ', standardMeshName = 'host-standards' } = {}) {
286
+ const { address, sceneId, at } = parseHashSceneArgs(argv);
287
+ const debug = driver.debug;
288
+ const { browser, page } = await openHashPage(driver, address);
289
+ if (sceneId) {
290
+ await page.evaluate(startSceneInPage, { debug, id: sceneId });
291
+ await page.waitForFunction(waitSceneReachInPage, { debug, at }, { timeout: 120000 });
292
+ const fronts = await page.evaluate(prepareCrowdHashInPage, { debug });
293
+ for (const target of fronts) {
294
+ await page.evaluate(focusCrowdTargetInPage, { debug, ax: target.ax, az: target.az });
295
+ await page.waitForTimeout(1200);
296
+ }
297
+ console.log('troops seen', fronts.length);
298
+ }
299
+ await page.waitForTimeout(6000);
300
+ const hashes = await page.evaluate(hashCrowdMeshesInPage, { debug, meshPrefix, standardMeshName });
301
+ console.log(JSON.stringify(hashes, null, 1));
302
+ await driver.closeBrowser(browser);
303
+ return hashes;
304
+ }
305
+
306
+ /**
307
+ * Plays a scene to `at` seconds and prints near/far skinned geometry hashes for every built humanoid actor.
308
+ *
309
+ * @param {object} driver Page driver from `createPageDriver`.
310
+ * @param {object} [options]
311
+ * @param {string[]} [options.argv=[]] Raw CLI arguments (`<address> <sceneId> [second=4]`).
312
+ * @param {string} [options.kind='human'] Actor kind filter.
313
+ * @returns {Promise<string[]>}
314
+ */
315
+ async function runFigureHash(driver, { argv = [], kind = 'human' } = {}) {
316
+ const { address, sceneId, at } = parseHashSceneArgs(argv);
317
+ const debug = driver.debug;
318
+ const { browser, page } = await openHashPage(driver, address);
319
+ await page.evaluate(startSceneInPage, { debug, id: sceneId });
320
+ await page.waitForFunction(waitSceneReachInPage, { debug, at }, { timeout: 120000 });
321
+ const lines = await page.evaluate(hashFiguresInPage, { debug, kind });
322
+ for (const line of lines) console.log(line);
323
+ await driver.closeBrowser(browser);
324
+ return lines;
325
+ }
326
+
327
+ /**
328
+ * Plays a scene to `at` seconds and prints geometry hashes for every built actor and mount mesh.
329
+ *
330
+ * @param {object} driver Page driver from `createPageDriver`.
331
+ * @param {object} [options]
332
+ * @param {string[]} [options.argv=[]] Raw CLI arguments (`<address> <sceneId> [second=4]`).
333
+ * @returns {Promise<string[]>}
334
+ */
335
+ async function runBeastHash(driver, { argv = [] } = {}) {
336
+ const { address, sceneId, at } = parseHashSceneArgs(argv);
337
+ const debug = driver.debug;
338
+ const { browser, page } = await openHashPage(driver, address);
339
+ await page.evaluate(startSceneInPage, { debug, id: sceneId });
340
+ await page.waitForFunction(waitSceneReachInPage, { debug, at }, { timeout: 120000 });
341
+ const lines = await page.evaluate(hashBeastsInPage, { debug });
342
+ for (const line of lines) console.log(line);
343
+ await driver.closeBrowser(browser);
344
+ return lines;
345
+ }
346
+
347
+ module.exports = {
348
+ focusCrowdTargetInPage,
349
+ hashBeastsInPage,
350
+ hashCrowdMeshesInPage,
351
+ hashFiguresInPage,
352
+ parseGroundHashArgs,
353
+ parseHashSceneArgs,
354
+ prepareCrowdHashInPage,
355
+ runBeastHash,
356
+ runCrowdHash,
357
+ runFigureHash,
358
+ runGroundHash,
359
+ sampleGroundLatticeInPage,
360
+ waitSceneReachInPage,
361
+ };
@@ -0,0 +1,146 @@
1
+ 'use strict';
2
+ const assert = require('node:assert/strict');
3
+ const test = require('node:test');
4
+ const {
5
+ focusCrowdTargetInPage,
6
+ hashBeastsInPage,
7
+ hashCrowdMeshesInPage,
8
+ hashFiguresInPage,
9
+ parseGroundHashArgs,
10
+ parseHashSceneArgs,
11
+ prepareCrowdHashInPage,
12
+ sampleGroundLatticeInPage,
13
+ waitSceneReachInPage,
14
+ } = require('./geometry-hash.cjs');
15
+
16
+ test('parseGroundHashArgs and parseHashSceneArgs apply defaults cleanly', () => {
17
+ assert.deepEqual(parseGroundHashArgs([]), { addresses: [''], points: 385 });
18
+ assert.deepEqual(parseGroundHashArgs(['location/coast', 'location/valley'], { points: 65 }), {
19
+ addresses: ['location/coast', 'location/valley'],
20
+ points: 65,
21
+ });
22
+ assert.deepEqual(parseHashSceneArgs(['location/harbour', 'clash']), {
23
+ address: 'location/harbour',
24
+ sceneId: 'clash',
25
+ at: 4,
26
+ });
27
+ assert.deepEqual(parseHashSceneArgs(['location/harbour', 'clash', '12.5']), {
28
+ address: 'location/harbour',
29
+ sceneId: 'clash',
30
+ at: 12.5,
31
+ });
32
+ });
33
+
34
+ test('sampleGroundLatticeInPage samples heights strictly through window[debug]', () => {
35
+ globalThis.window = {
36
+ APP: {
37
+ space: { id: 'valley', cx: 0, cz: 0, rim: 10, ground: (x, z) => x + z * 2 },
38
+ terrainHeight: () => 999,
39
+ },
40
+ };
41
+ try {
42
+ const out = sampleGroundLatticeInPage({ debug: 'APP', points: 3, primarySpaceId: 'world' });
43
+ assert.equal(out.id, 'valley');
44
+ assert.equal(out.half, 10);
45
+ const buf = Buffer.from(out.data, 'base64');
46
+ const floats = new Float32Array(buf.buffer, buf.byteOffset, buf.byteLength / 4);
47
+ assert.deepEqual([...floats], [-30, -20, -10, -10, 0, 10, 10, 20, 30]);
48
+
49
+ globalThis.window.APP.space.id = 'world';
50
+ const primary = sampleGroundLatticeInPage({ debug: 'APP', points: 2, primarySpaceId: 'world' });
51
+ const pBuf = Buffer.from(primary.data, 'base64');
52
+ assert.deepEqual([...new Float32Array(pBuf.buffer, pBuf.byteOffset, pBuf.byteLength / 4)], [999, 999, 999, 999]);
53
+ } finally {
54
+ delete globalThis.window;
55
+ }
56
+ });
57
+
58
+ test('crowd, figure, and beast hash in-page helpers hash geometry deterministically via window[debug]', () => {
59
+ const pos = new Float32Array([0, 0, 0, 1, 2, 3]);
60
+ const skinIndex = new Uint16Array([0, 1, 0, 0, 1, 0, 0, 0]);
61
+ const skinWeight = new Float32Array([1, 0, 0, 0, 0.5, 0.5, 0, 0]);
62
+ const index = new Uint16Array([0, 1, 0]);
63
+ const geo = {
64
+ attributes: {
65
+ position: { array: pos },
66
+ skinIndex: { array: skinIndex },
67
+ skinWeight: { array: skinWeight },
68
+ aCrowdRows: { array: new Float32Array([7, 8]) },
69
+ },
70
+ index: { array: index, count: 3 },
71
+ };
72
+ const releasedGeo = { attributes: { position: { array: null } }, index: { count: 6 } };
73
+ const mesh = { isMesh: true, name: 'Crowd guard near', geometry: geo };
74
+ const stdMesh = { isMesh: true, name: 'host-standards', geometry: releasedGeo };
75
+ const horseMesh = { isMesh: true, geometry: geo, traverse: fn => fn(horseMesh) };
76
+ const camPos = {
77
+ x: 0,
78
+ y: 0,
79
+ z: 0,
80
+ set(x, y, z) {
81
+ this.x = x;
82
+ this.y = y;
83
+ this.z = z;
84
+ },
85
+ };
86
+ const moving = { slotX: 0, move: { x: 1 }, speed: 2, home: 0, ax: 10, az: 20 };
87
+ const hidden = { slotX: 0, move: null, speed: 0, home: -1, ax: 0, az: 0 };
88
+
89
+ globalThis.window = {
90
+ APP: {
91
+ director: { ev: { id: 'battle' }, t: 5, paused: false },
92
+ state: { mode: 'scene' },
93
+ space: { ground: () => 4 },
94
+ camera: { position: camPos, lookAt() {}, updateMatrixWorld() {} },
95
+ crowds: [{ list: [moving] }, { list: [hidden] }],
96
+ scene: {
97
+ traverse(fn) {
98
+ fn(mesh);
99
+ fn(stdMesh);
100
+ },
101
+ },
102
+ actors: {
103
+ scout: {
104
+ id: 'scout',
105
+ kind: 'human',
106
+ built: true,
107
+ nearBuilt: true,
108
+ primary: false,
109
+ def: { look: { item: 'bow' } },
110
+ hi: { geometry: geo, skeleton: { bones: new Array(54) } },
111
+ lo: { geometry: geo },
112
+ gripR: {},
113
+ gripL: {},
114
+ group: { traverse: fn => fn({ isMesh: true, geometry: geo }) },
115
+ mount: { H: { mesh: horseMesh } },
116
+ },
117
+ },
118
+ },
119
+ };
120
+ try {
121
+ assert.equal(waitSceneReachInPage({ debug: 'APP', at: 4 }), true);
122
+ assert.equal(waitSceneReachInPage({ debug: 'APP', at: 6 }), false);
123
+
124
+ const fronts = prepareCrowdHashInPage({ debug: 'APP' });
125
+ assert.deepEqual(fronts, [{ ax: 10, az: 20 }]);
126
+ assert.equal(moving.move, null);
127
+ assert.equal(moving.speed, 0);
128
+
129
+ focusCrowdTargetInPage({ debug: 'APP', ax: 10, az: 20 });
130
+ assert.deepEqual([camPos.x, camPos.y, camPos.z], [16, 7, 26]);
131
+
132
+ const crowdOut = hashCrowdMeshesInPage({ debug: 'APP' });
133
+ assert.match(crowdOut['Crowd guard near'], /^[0-9a-f]+ \(22, 1 tris\)$/);
134
+ assert.equal(crowdOut['host-standards 1'], 'released, 2 tris');
135
+
136
+ const figLines = hashFiguresInPage({ debug: 'APP' });
137
+ assert.equal(figLines.length, 1);
138
+ assert.match(figLines[0], /^scout\s+bow near [0-9a-f]{8}:72 far [0-9a-f]{8}:72 bones 54 bends both$/);
139
+
140
+ const beastLines = hashBeastsInPage({ debug: 'APP' });
141
+ assert.equal(beastLines.length, 1);
142
+ assert.match(beastLines[0], /^scout\s+human\s+mounted [0-9a-f]{8}:78 [0-9a-f]{8}:78$/);
143
+ } finally {
144
+ delete globalThis.window;
145
+ }
146
+ });