oriverse-engine 0.1.8 → 0.1.10

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.
@@ -1,11 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const bootOriverseArtifact: (a: number, b: number) => any;
5
4
  export const sim_worker_init: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void;
6
5
  export const sim_worker_start_ticker: (a: number) => [number, number];
6
+ export const bootOriverseArtifact: (a: number, b: number) => any;
7
7
  export const start_wasm_oriverse: () => void;
8
+ export const worker_attach_read_dc: (a: any) => void;
8
9
  export const worker_attach_write_dc: (a: any, b: any) => void;
10
+ export const worker_init: (a: number, b: number) => void;
9
11
  export const worker_init_write: (a: number, b: number, c: number, d: number) => void;
10
12
  export const live_sim_log_objects_entry: (a: number, b: number, c: number, d: number) => [number, number];
11
13
  export const live_sim_log_simcalls_entry: (a: number, b: number, c: number, d: number) => [number, number];
@@ -14,8 +16,6 @@ export const text_playtest_entry: (a: number, b: number, c: number, d: number) =
14
16
  export const ui_inspect_entry: (a: number, b: number, c: number, d: number) => [number, number];
15
17
  export const validate_world_entry: (a: number, b: number, c: number) => [number, number];
16
18
  export const validate_world_shared_entry: (a: number, b: number, c: number) => [number, number];
17
- export const worker_attach_read_dc: (a: any) => void;
18
- export const worker_init: (a: number, b: number) => void;
19
19
  export const init_market_client_message_bridge: (a: any) => [number, number];
20
20
  export const __wbg_intounderlyingsink_free: (a: number, b: number) => void;
21
21
  export const intounderlyingsink_abort: (a: number, b: any) => any;
@@ -30,43 +30,45 @@ export const intounderlyingbytesource_start: (a: number, b: any) => void;
30
30
  export const intounderlyingbytesource_type: (a: number) => number;
31
31
  export const intounderlyingsource_cancel: (a: number) => void;
32
32
  export const intounderlyingsource_pull: (a: number, b: any) => any;
33
- export const wasm_bindgen__closure__destroy__h2c5042544683424e: (a: number, b: number) => void;
34
- export const wasm_bindgen__closure__destroy__hb00d3b28a41b11e1: (a: number, b: number) => void;
35
- export const wasm_bindgen__closure__destroy__h39262aa57cbbb419: (a: number, b: number) => void;
36
- export const wasm_bindgen__closure__destroy__h39c38f6ea1ed7ed7: (a: number, b: number) => void;
37
- export const wasm_bindgen__closure__destroy__h341b474f64a7b80d: (a: number, b: number) => void;
38
- export const wasm_bindgen__closure__destroy__h05f4762a24946da6: (a: number, b: number) => void;
33
+ export const wasm_bindgen__closure__destroy__h3d8ab50ba4ce30a4: (a: number, b: number) => void;
34
+ export const wasm_bindgen__closure__destroy__h0fd52f5d59b3cd4b: (a: number, b: number) => void;
35
+ export const wasm_bindgen__closure__destroy__h20f708e23b4883f9: (a: number, b: number) => void;
36
+ export const wasm_bindgen__closure__destroy__h2a10fd83d60eba6e: (a: number, b: number) => void;
37
+ export const wasm_bindgen__closure__destroy__h1088095546a21edd: (a: number, b: number) => void;
38
+ export const wasm_bindgen__closure__destroy__h1e27ba29c6fa169a: (a: number, b: number) => void;
39
+ export const wasm_bindgen__closure__destroy__h132edb609c4f4a75: (a: number, b: number) => void;
39
40
  export const wasm_bindgen__closure__destroy__h2504b00990fec809: (a: number, b: number) => void;
40
- export const wasm_bindgen__closure__destroy__h38a25b155c54050b: (a: number, b: number) => void;
41
+ export const wasm_bindgen__closure__destroy__h005774f579d6de55: (a: number, b: number) => void;
41
42
  export const wasm_bindgen__closure__destroy__h780a4b6abdc124b2: (a: number, b: number) => void;
42
- export const wasm_bindgen__closure__destroy__h173d95c778bdcbde: (a: number, b: number) => void;
43
- export const wasm_bindgen__convert__closures_____invoke__hff8af640998784fa: (a: number, b: number, c: number, d: number, e: number) => void;
44
- export const wasm_bindgen__convert__closures_____invoke__h126b863292be4410: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
45
- export const wasm_bindgen__convert__closures_____invoke__ha7db474e02047f8b: (a: number, b: number, c: any, d: any) => void;
46
- export const wasm_bindgen__convert__closures_____invoke__h0fd2d01a8ab19dc8: (a: number, b: number, c: number, d: number) => void;
47
- export const wasm_bindgen__convert__closures_____invoke__hc1a3ca24eab140ff: (a: number, b: number, c: any, d: any) => void;
43
+ export const wasm_bindgen__convert__closures_____invoke__h1095830d78c222bd: (a: number, b: number, c: number, d: number, e: number) => void;
44
+ export const wasm_bindgen__convert__closures_____invoke__hc08174464eeba129: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
45
+ export const wasm_bindgen__convert__closures_____invoke__h6bf5d86945a0b0a2: (a: number, b: number, c: number, d: number, e: any) => void;
46
+ export const wasm_bindgen__convert__closures_____invoke__h42fc6b0043bbcea1: (a: number, b: number, c: any, d: any) => void;
47
+ export const wasm_bindgen__convert__closures_____invoke__h2460173345a5f10a: (a: number, b: number, c: number, d: number) => void;
48
+ export const wasm_bindgen__convert__closures_____invoke__h7c3fdad917f44fc2: (a: number, b: number, c: any, d: any) => void;
48
49
  export const wasm_bindgen__convert__closures_____invoke__hc8bca67d3586a92f: (a: number, b: number, c: any) => [number, number];
49
50
  export const wasm_bindgen__convert__closures_____invoke__h4e1d18a25cb702b7: (a: number, b: number, c: any, d: any) => void;
50
- export const wasm_bindgen__convert__closures_____invoke__h0834f10b5a624feb: (a: number, b: number, c: any) => void;
51
- export const wasm_bindgen__convert__closures_____invoke__h0834f10b5a624feb_2: (a: number, b: number, c: any) => void;
52
- export const wasm_bindgen__convert__closures_____invoke__h0834f10b5a624feb_3: (a: number, b: number, c: any) => void;
53
- export const wasm_bindgen__convert__closures_____invoke__h0834f10b5a624feb_4: (a: number, b: number, c: any) => void;
54
- export const wasm_bindgen__convert__closures_____invoke__h4cf5bf9bd91c034f: (a: number, b: number, c: any) => void;
55
- export const wasm_bindgen__convert__closures_____invoke__h129050e44bb8ac36: (a: number, b: number, c: any) => void;
56
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411: (a: number, b: number, c: any) => void;
57
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_11: (a: number, b: number, c: any) => void;
58
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_12: (a: number, b: number, c: any) => void;
59
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_13: (a: number, b: number, c: any) => void;
60
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_14: (a: number, b: number, c: any) => void;
61
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_15: (a: number, b: number, c: any) => void;
62
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_16: (a: number, b: number, c: any) => void;
63
- export const wasm_bindgen__convert__closures_____invoke__h7aed85664b6dd411_17: (a: number, b: number, c: any) => void;
64
- export const wasm_bindgen__convert__closures_____invoke__h0c19bb61b3049c4c: (a: number, b: number, c: number) => void;
65
- export const wasm_bindgen__convert__closures_____invoke__hca3e9975997af2ec: (a: number, b: number, c: any) => void;
66
- export const wasm_bindgen__convert__closures_____invoke__h3534b2832bd21faf: (a: number, b: number, c: any) => void;
67
- export const wasm_bindgen__convert__closures_____invoke__h3534b2832bd21faf_24: (a: number, b: number, c: any) => void;
68
- export const wasm_bindgen__convert__closures_____invoke__hc884a3961f9308d2: (a: number, b: number) => void;
69
- export const wasm_bindgen__convert__closures_____invoke__h288ae4401ad8a4a7: (a: number, b: number) => void;
51
+ export const wasm_bindgen__convert__closures_____invoke__h7550ff0630f93231: (a: number, b: number, c: any) => void;
52
+ export const wasm_bindgen__convert__closures_____invoke__h7550ff0630f93231_1: (a: number, b: number, c: any) => void;
53
+ export const wasm_bindgen__convert__closures_____invoke__h7550ff0630f93231_2: (a: number, b: number, c: any) => void;
54
+ export const wasm_bindgen__convert__closures_____invoke__h2b5d470eeaaeab73: (a: number, b: number, c: any) => void;
55
+ export const wasm_bindgen__convert__closures_____invoke__h2b5d470eeaaeab73_8: (a: number, b: number, c: any) => void;
56
+ export const wasm_bindgen__convert__closures_____invoke__h2b5d470eeaaeab73_9: (a: number, b: number, c: any) => void;
57
+ export const wasm_bindgen__convert__closures_____invoke__h2b5d470eeaaeab73_10: (a: number, b: number, c: any) => void;
58
+ export const wasm_bindgen__convert__closures_____invoke__h65b57d359a71a310: (a: number, b: number, c: any) => void;
59
+ export const wasm_bindgen__convert__closures_____invoke__h1a89f04f0ec42b71: (a: number, b: number, c: any) => void;
60
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100: (a: number, b: number, c: any) => void;
61
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_17: (a: number, b: number, c: any) => void;
62
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_18: (a: number, b: number, c: any) => void;
63
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_19: (a: number, b: number, c: any) => void;
64
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_20: (a: number, b: number, c: any) => void;
65
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_21: (a: number, b: number, c: any) => void;
66
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_22: (a: number, b: number, c: any) => void;
67
+ export const wasm_bindgen__convert__closures_____invoke__h7f345262a86d3100_23: (a: number, b: number, c: any) => void;
68
+ export const wasm_bindgen__convert__closures_____invoke__hd39e5e1d64e1020c: (a: number, b: number, c: number) => void;
69
+ export const wasm_bindgen__convert__closures_____invoke__haa4160b0204595c1: (a: number, b: number, c: any) => void;
70
+ export const wasm_bindgen__convert__closures_____invoke__h6ebd727ad3f637e3: (a: number, b: number) => void;
71
+ export const wasm_bindgen__convert__closures_____invoke__h00bb8be0d779d52d: (a: number, b: number) => void;
70
72
  export const wasm_bindgen__convert__closures_____invoke__hcb86fb251f5bd754: (a: number, b: number) => void;
71
73
  export const __wbindgen_malloc: (a: number, b: number) => number;
72
74
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -1,36 +1,4 @@
1
1
 
2
- export function marketClientInitMessageBridge(worker) {
3
- if (!worker || typeof window === 'undefined') throw new Error('Worker and window required');
4
- if (window.marketClientMessageBridgeInitialized) return;
5
- window.marketClientMessageBridgeInitialized = true;
6
-
7
- window.top.marketClientWorker = worker;
8
- worker.addEventListener('message', (e) => {
9
- const data = e.data;
10
- if (data?.type === 'market-client-open-url' && data.value) window.open(data.value, '_blank');
11
- else if (data?.type === 'market-client-open-url-popup' && data.value) {
12
- const w = Math.min(560, Math.floor(screen.availWidth * 0.4));
13
- const h = Math.min(860, Math.floor(screen.availHeight * 0.9));
14
- const left = (screen.availLeft ?? 0) + screen.availWidth - w - 8;
15
- window.open(data.value, 'oriverse_connect_ai', `popup,width=${w},height=${h},left=${left},top=40`);
16
- }
17
- else if (data?.type?.startsWith('market-client-')) {
18
- window.top.postMessage(data, '*');
19
- }
20
- });
21
- }
22
- export function marketClientInitMessageListener(callback) {
23
- const target = typeof window !== 'undefined' ? window.top : (typeof self !== 'undefined' ? self : globalThis);
24
- target.addEventListener('message', (e) => {
25
- if (e.data?.type) callback(e.data.type);
26
- });
27
- }
28
- export function marketClientPostMessage(messageType, value) {
29
- const message = { type: messageType, ...(value != null && { value }) };
30
- if (typeof window !== 'undefined') {
31
- window.top.postMessage(message, '*');
32
- } else {
33
- const g = typeof self !== 'undefined' ? self : globalThis;
34
- g.postMessage(message);
35
- }
2
+ export function marketClientPageHostname() {
3
+ try { return (location && location.hostname) || ''; } catch (e) { return ''; }
36
4
  }
@@ -0,0 +1,36 @@
1
+
2
+ export function marketClientInitMessageBridge(worker) {
3
+ if (!worker || typeof window === 'undefined') throw new Error('Worker and window required');
4
+ if (window.marketClientMessageBridgeInitialized) return;
5
+ window.marketClientMessageBridgeInitialized = true;
6
+
7
+ window.top.marketClientWorker = worker;
8
+ worker.addEventListener('message', (e) => {
9
+ const data = e.data;
10
+ if (data?.type === 'market-client-open-url' && data.value) window.open(data.value, '_blank');
11
+ else if (data?.type === 'market-client-open-url-popup' && data.value) {
12
+ const w = Math.min(560, Math.floor(screen.availWidth * 0.4));
13
+ const h = Math.min(860, Math.floor(screen.availHeight * 0.9));
14
+ const left = (screen.availLeft ?? 0) + screen.availWidth - w - 8;
15
+ window.open(data.value, 'oriverse_connect_ai', `popup,width=${w},height=${h},left=${left},top=40`);
16
+ }
17
+ else if (data?.type?.startsWith('market-client-')) {
18
+ window.top.postMessage(data, '*');
19
+ }
20
+ });
21
+ }
22
+ export function marketClientInitMessageListener(callback) {
23
+ const target = typeof window !== 'undefined' ? window.top : (typeof self !== 'undefined' ? self : globalThis);
24
+ target.addEventListener('message', (e) => {
25
+ if (e.data?.type) callback(e.data.type);
26
+ });
27
+ }
28
+ export function marketClientPostMessage(messageType, value) {
29
+ const message = { type: messageType, ...(value != null && { value }) };
30
+ if (typeof window !== 'undefined') {
31
+ window.top.postMessage(message, '*');
32
+ } else {
33
+ const g = typeof self !== 'undefined' ? self : globalThis;
34
+ g.postMessage(message);
35
+ }
36
+ }
@@ -16,6 +16,7 @@ export function get_selected_candidate_info(stats) {
16
16
  remoteProtocol: remote.protocol || '',
17
17
  rttMs: pair.currentRoundTripTime != null ? pair.currentRoundTripTime * 1000 : -1,
18
18
  txBytes: pair.bytesSent || 0,
19
- rxBytes: pair.bytesReceived || 0
19
+ rxBytes: pair.bytesReceived || 0,
20
+ availOutBps: pair.availableOutgoingBitrate != null ? pair.availableOutgoingBitrate : -1
20
21
  };
21
22
  }
@@ -1,60 +1,28 @@
1
1
 
2
- export function observeDevicePixels(canvas, onSize) {
3
- const hasDPCB = (() => {
4
- try { return 'devicePixelContentBoxSize' in ResizeObserverEntry.prototype; } catch { return false; }
5
- })();
6
-
7
- // Compute current CSS and device-pixel sizes and call onSize(dpW, dpH, effectiveDpr)
8
- function fireNow() {
9
- let cssW, cssH, dpW, dpH;
10
- if (hasDPCB && canvas.__lastROEntry) {
11
- const e = canvas.__lastROEntry;
12
- dpW = e.devicePixelContentBoxSize[0].inlineSize;
13
- dpH = e.devicePixelContentBoxSize[0].blockSize;
14
- cssW = e.contentBoxSize[0].inlineSize;
15
- cssH = e.contentBoxSize[0].blockSize;
16
- } else {
17
- const rect = canvas.getBoundingClientRect();
18
- const dpr = window.devicePixelRatio || 1;
19
- cssW = rect.width; cssH = rect.height;
20
- dpW = Math.max(1, Math.round(cssW * dpr));
21
- dpH = Math.max(1, Math.round(cssH * dpr));
22
- }
23
- const dprEff = cssW > 0 ? (dpW / cssW) : (window.devicePixelRatio || 1);
24
- onSize(dpW >>> 0, dpH >>> 0, dprEff);
25
- }
26
-
27
- const ro = new ResizeObserver(entries => {
28
- // Save the last entry for precise device-pixel info.
29
- canvas.__lastROEntry = entries[0];
30
- fireNow();
31
- });
32
-
33
- try { ro.observe(canvas, { box: 'device-pixel-content-box' }); }
34
- catch { ro.observe(canvas); }
35
-
36
- // DPR changes (zoom / moving across monitors) don't always reflow. Listen explicitly.
37
- let mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
38
- const onMQ = () => {
39
- // Force a non-layout-janking "poke" to trigger RO in some browsers.
40
- const t = canvas.style.transform;
41
- canvas.style.transform = 'translateZ(0)'; canvas.style.transform = t;
42
- fireNow();
43
- // Re-arm listener for the new DPR.
44
- mq.removeEventListener?.('change', onMQ);
45
- mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
46
- mq.addEventListener?.('change', onMQ);
47
- };
48
- mq.addEventListener?.('change', onMQ);
49
- window.addEventListener('pageshow', onMQ);
50
-
51
- // Fire once now so we start sized correctly.
52
- Promise.resolve().then(fireNow);
53
-
54
- // Return disposer
55
- return () => {
56
- try { ro.disconnect(); } catch {}
57
- try { mq.removeEventListener?.('change', onMQ); } catch {}
58
- try { window.removeEventListener('pageshow', onMQ); } catch {}
59
- };
2
+ export function __ori_install_webgpu_error_tap(sink) {
3
+ try {
4
+ if (typeof GPUAdapter === 'undefined' || GPUAdapter.prototype.__ori_err_tap) return;
5
+ GPUAdapter.prototype.__ori_err_tap = true;
6
+ const orig = GPUAdapter.prototype.requestDevice;
7
+ GPUAdapter.prototype.requestDevice = async function(desc) {
8
+ const device = await orig.call(this, desc);
9
+ // Only the engine's own device (wgpu_base::APP_DEVICE_LABEL) may escalate to the
10
+ // fatal path. Foreign devices — the index.html [pre_shader] throwaway runs at
11
+ // DEFAULT limits and its replay errors are fail-open by contract — still log
12
+ // through the sink for ring/field visibility (07Aug26 first-contact crash: a
13
+ // throwaway-device validation error killed a healthy boot).
14
+ const isApp = !!(desc && desc.label === 'oriverse-app-device');
15
+ if (isApp) { try { window.__ori_gpu_device = device; } catch (_) {} }
16
+ try {
17
+ device.addEventListener('uncapturederror', function(event) {
18
+ const e = event.error;
19
+ const name = (e && e.constructor && e.constructor.name) || 'GPUError';
20
+ const msg = (e && e.message) || '';
21
+ try { sink(name, msg, isApp); } catch (_) {}
22
+ try { console.error(isApp ? '[raw_webgpu_uncaptured]' : '[raw_webgpu_uncaptured_foreign]', name, msg); } catch (_) {}
23
+ });
24
+ } catch (_) {}
25
+ return device;
26
+ };
27
+ } catch (_) {}
60
28
  }
@@ -1,28 +1,60 @@
1
1
 
2
- export function __ori_install_webgpu_error_tap(sink) {
3
- try {
4
- if (typeof GPUAdapter === 'undefined' || GPUAdapter.prototype.__ori_err_tap) return;
5
- GPUAdapter.prototype.__ori_err_tap = true;
6
- const orig = GPUAdapter.prototype.requestDevice;
7
- GPUAdapter.prototype.requestDevice = async function(desc) {
8
- const device = await orig.call(this, desc);
9
- // Only the engine's own device (wgpu_base::APP_DEVICE_LABEL) may escalate to the
10
- // fatal path. Foreign devices — the index.html [pre_shader] throwaway runs at
11
- // DEFAULT limits and its replay errors are fail-open by contract — still log
12
- // through the sink for ring/field visibility (07Aug26 first-contact crash: a
13
- // throwaway-device validation error killed a healthy boot).
14
- const isApp = !!(desc && desc.label === 'oriverse-app-device');
15
- if (isApp) { try { window.__ori_gpu_device = device; } catch (_) {} }
16
- try {
17
- device.addEventListener('uncapturederror', function(event) {
18
- const e = event.error;
19
- const name = (e && e.constructor && e.constructor.name) || 'GPUError';
20
- const msg = (e && e.message) || '';
21
- try { sink(name, msg, isApp); } catch (_) {}
22
- try { console.error(isApp ? '[raw_webgpu_uncaptured]' : '[raw_webgpu_uncaptured_foreign]', name, msg); } catch (_) {}
23
- });
24
- } catch (_) {}
25
- return device;
26
- };
27
- } catch (_) {}
2
+ export function observeDevicePixels(canvas, onSize) {
3
+ const hasDPCB = (() => {
4
+ try { return 'devicePixelContentBoxSize' in ResizeObserverEntry.prototype; } catch { return false; }
5
+ })();
6
+
7
+ // Compute current CSS and device-pixel sizes and call onSize(dpW, dpH, effectiveDpr)
8
+ function fireNow() {
9
+ let cssW, cssH, dpW, dpH;
10
+ if (hasDPCB && canvas.__lastROEntry) {
11
+ const e = canvas.__lastROEntry;
12
+ dpW = e.devicePixelContentBoxSize[0].inlineSize;
13
+ dpH = e.devicePixelContentBoxSize[0].blockSize;
14
+ cssW = e.contentBoxSize[0].inlineSize;
15
+ cssH = e.contentBoxSize[0].blockSize;
16
+ } else {
17
+ const rect = canvas.getBoundingClientRect();
18
+ const dpr = window.devicePixelRatio || 1;
19
+ cssW = rect.width; cssH = rect.height;
20
+ dpW = Math.max(1, Math.round(cssW * dpr));
21
+ dpH = Math.max(1, Math.round(cssH * dpr));
22
+ }
23
+ const dprEff = cssW > 0 ? (dpW / cssW) : (window.devicePixelRatio || 1);
24
+ onSize(dpW >>> 0, dpH >>> 0, dprEff);
25
+ }
26
+
27
+ const ro = new ResizeObserver(entries => {
28
+ // Save the last entry for precise device-pixel info.
29
+ canvas.__lastROEntry = entries[0];
30
+ fireNow();
31
+ });
32
+
33
+ try { ro.observe(canvas, { box: 'device-pixel-content-box' }); }
34
+ catch { ro.observe(canvas); }
35
+
36
+ // DPR changes (zoom / moving across monitors) don't always reflow. Listen explicitly.
37
+ let mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
38
+ const onMQ = () => {
39
+ // Force a non-layout-janking "poke" to trigger RO in some browsers.
40
+ const t = canvas.style.transform;
41
+ canvas.style.transform = 'translateZ(0)'; canvas.style.transform = t;
42
+ fireNow();
43
+ // Re-arm listener for the new DPR.
44
+ mq.removeEventListener?.('change', onMQ);
45
+ mq = matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
46
+ mq.addEventListener?.('change', onMQ);
47
+ };
48
+ mq.addEventListener?.('change', onMQ);
49
+ window.addEventListener('pageshow', onMQ);
50
+
51
+ // Fire once now so we start sized correctly.
52
+ Promise.resolve().then(fireNow);
53
+
54
+ // Return disposer
55
+ return () => {
56
+ try { ro.disconnect(); } catch {}
57
+ try { mq.removeEventListener?.('change', onMQ); } catch {}
58
+ try { window.removeEventListener('pageshow', onMQ); } catch {}
59
+ };
28
60
  }
@@ -11,9 +11,9 @@ loader scripts or engine URLs.
11
11
 
12
12
  ## Before writing Weave, read the guide
13
13
 
14
- - https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
14
+ - https://unpkg.com/oriverse-engine@0.1.10/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
15
15
  example games (coin collector, dodge blocks, target range) to pattern-match from.
16
- - https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/weave_documentation.txt — full language + API reference.
16
+ - https://unpkg.com/oriverse-engine@0.1.10/dist/weave_documentation.txt — full language + API reference.
17
17
 
18
18
  Key constraints: content must be fully procedural (primitive models `"cube"`,
19
19
  `"sphere"`, ..., `#mesh`, `#texture` — no market/network assets); units are cm with Z
@@ -11,9 +11,9 @@ loader scripts or engine URLs.
11
11
 
12
12
  ## Before writing Weave, read the guide
13
13
 
14
- - https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
14
+ - https://unpkg.com/oriverse-engine@0.1.10/dist/GAME_AUTHORING.md — authoring patterns + 3 complete tested
15
15
  example games (coin collector, dodge blocks, target range) to pattern-match from.
16
- - https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/weave_documentation.txt — full language + API reference.
16
+ - https://unpkg.com/oriverse-engine@0.1.10/dist/weave_documentation.txt — full language + API reference.
17
17
 
18
18
  Key constraints: content must be fully procedural (primitive models `"cube"`,
19
19
  `"sphere"`, ..., `#mesh`, `#texture` — no market/network assets); units are cm with Z
@@ -2,7 +2,7 @@
2
2
  This single small file IS the whole game: engine js/wasm come from the npm CDN, your game is
3
3
  the inline Weave source below. Serve from any static host (no COOP/COEP headers) or a
4
4
  plain `python -m http.server`; open in a WebGPU browser (Chrome/Edge).
5
- The engine version is pinned in the https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist urls below (injected from
5
+ The engine version is pinned in the https://unpkg.com/oriverse-engine@0.1.10/dist urls below (injected from
6
6
  npm_package/package.json at packaging time) — bump the @version with engine releases.
7
7
  Content must be fully procedural: primitives ("cube", "sphere", ...), #mesh, #texture,
8
8
  #particles. Market/network assets are unavailable and will hard-error. Google Fonts
@@ -46,18 +46,18 @@ object BlueCube {
46
46
 
47
47
  <!-- Shader prewarm: replays the build's pipeline manifest on a throwaway device during
48
48
  engine download dead-time (kills the first-view compile freeze). Fail-open. -->
49
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/prewarm.js"></script>
49
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/prewarm.js"></script>
50
50
  <!-- KTX2 texture transcoder sidecar (classic scripts; ktx_lib.wasm resolves relative to the script url). -->
51
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/ktx_lib.js"></script>
52
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/ktx_bridge.js"></script>
51
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/ktx_lib.js"></script>
52
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/ktx_bridge.js"></script>
53
53
  <script type="module">
54
- import initOriverse from "https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/oriverse_wgpu.js";
54
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.10/dist/oriverse_wgpu.js";
55
55
  const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
56
56
  (async () => {
57
57
  try {
58
58
  setBoot('starting engine…');
59
59
  // Artifact build: wasm-bindgen owns a private (non-shared) memory; no COOP/COEP needed.
60
- await initOriverse({ module_or_path: "https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/oriverse_wgpu_bg.wasm" });
60
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.10/dist/oriverse_wgpu_bg.wasm" });
61
61
  } catch (e) {
62
62
  const msg = (e && e.stack) ? e.stack : String(e);
63
63
  setBoot('WASM init failed:\n' + msg);
@@ -2,7 +2,7 @@
2
2
  This single small file IS the whole game: engine js/wasm come from the npm CDN, your game is
3
3
  the inline Weave source below. Serve from any static host (no COOP/COEP headers) or a
4
4
  plain `python -m http.server`; open in a WebGPU browser (Chrome/Edge).
5
- The engine version is pinned in the https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist urls below (injected from
5
+ The engine version is pinned in the https://unpkg.com/oriverse-engine@0.1.10/dist urls below (injected from
6
6
  npm_package/package.json at packaging time) — bump the @version with engine releases.
7
7
  Content must be fully procedural: primitives ("cube", "sphere", ...), #mesh, #texture,
8
8
  #particles. Market/network assets are unavailable and will hard-error. Google Fonts
@@ -46,18 +46,18 @@ object BlueCube {
46
46
 
47
47
  <!-- Shader prewarm: replays the build's pipeline manifest on a throwaway device during
48
48
  engine download dead-time (kills the first-view compile freeze). Fail-open. -->
49
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/prewarm.js"></script>
49
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/prewarm.js"></script>
50
50
  <!-- KTX2 texture transcoder sidecar (classic scripts; ktx_lib.wasm resolves relative to the script url). -->
51
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/ktx_lib.js"></script>
52
- <script src="https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/ktx_bridge.js"></script>
51
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/ktx_lib.js"></script>
52
+ <script src="https://unpkg.com/oriverse-engine@0.1.10/dist/ktx_bridge.js"></script>
53
53
  <script type="module">
54
- import initOriverse from "https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/oriverse_wgpu.js";
54
+ import initOriverse from "https://unpkg.com/oriverse-engine@0.1.10/dist/oriverse_wgpu.js";
55
55
  const setBoot = (t) => { const b = document.getElementById('oriverse-status-banner'); if (b) b.textContent = t; };
56
56
  (async () => {
57
57
  try {
58
58
  setBoot('starting engine…');
59
59
  // Artifact build: wasm-bindgen owns a private (non-shared) memory; no COOP/COEP needed.
60
- await initOriverse({ module_or_path: "https://cdn.jsdelivr.net/npm/oriverse-engine@0.1.7/dist/oriverse_wgpu_bg.wasm" });
60
+ await initOriverse({ module_or_path: "https://unpkg.com/oriverse-engine@0.1.10/dist/oriverse_wgpu_bg.wasm" });
61
61
  } catch (e) {
62
62
  const msg = (e && e.stack) ? e.stack : String(e);
63
63
  setBoot('WASM init failed:\n' + msg);