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.
- package/LICENSE.md +30 -30
- package/README.md +7 -7
- package/dist/CODEX_PROMPT.md +9 -9
- package/dist/GAME_AUTHORING.md +24 -15
- package/dist/examples/coin_collector.weave +73 -70
- package/dist/examples/dodge_blocks.weave +73 -70
- package/dist/examples/target_range.weave +85 -82
- package/dist/ktx_bridge.js +130 -121
- package/dist/oriverse_wgpu.d.ts +38 -36
- package/dist/oriverse_wgpu.js +173 -118
- package/dist/oriverse_wgpu_bg.wasm +0 -0
- package/dist/oriverse_wgpu_bg.wasm.d.ts +38 -36
- package/dist/snippets/oriverse_market_client-0cd3013288f3c49c/inline0.js +2 -34
- package/dist/snippets/oriverse_market_client-0cd3013288f3c49c/inline2.js +36 -0
- package/dist/snippets/oriverse_networking_shared-e43478064e11e46c/inline1.js +2 -1
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline1.js +26 -58
- package/dist/snippets/oriverse_wgpu-255445ce6d9a0851/inline2.js +58 -26
- package/dist/starter/AGENTS.md +2 -2
- package/dist/starter/CLAUDE.md +2 -2
- package/dist/starter/game.html +6 -6
- package/dist/templates/game_cdn.html +6 -6
- package/dist/weave_documentation.txt +510 -190
- package/package.json +6 -1
- package/dist/shader_prewarm_manifest.json +0 -1
|
@@ -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
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
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
|
|
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
|
|
43
|
-
export const
|
|
44
|
-
export const
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
47
|
-
export const
|
|
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
|
|
51
|
-
export const
|
|
52
|
-
export const
|
|
53
|
-
export const
|
|
54
|
-
export const
|
|
55
|
-
export const
|
|
56
|
-
export const
|
|
57
|
-
export const
|
|
58
|
-
export const
|
|
59
|
-
export const
|
|
60
|
-
export const
|
|
61
|
-
export const
|
|
62
|
-
export const
|
|
63
|
-
export const
|
|
64
|
-
export const
|
|
65
|
-
export const
|
|
66
|
-
export const
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
69
|
-
export const
|
|
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
|
|
3
|
-
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
}
|
package/dist/starter/AGENTS.md
CHANGED
|
@@ -11,9 +11,9 @@ loader scripts or engine URLs.
|
|
|
11
11
|
|
|
12
12
|
## Before writing Weave, read the guide
|
|
13
13
|
|
|
14
|
-
- https://
|
|
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://
|
|
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
|
package/dist/starter/CLAUDE.md
CHANGED
|
@@ -11,9 +11,9 @@ loader scripts or engine URLs.
|
|
|
11
11
|
|
|
12
12
|
## Before writing Weave, read the guide
|
|
13
13
|
|
|
14
|
-
- https://
|
|
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://
|
|
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
|
package/dist/starter/game.html
CHANGED
|
@@ -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://
|
|
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://
|
|
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://
|
|
52
|
-
<script src="https://
|
|
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://
|
|
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://
|
|
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://
|
|
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://
|
|
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://
|
|
52
|
-
<script src="https://
|
|
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://
|
|
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://
|
|
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);
|