@genex-ai/multiplayer 0.17.1 → 0.17.8

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.
Files changed (45) hide show
  1. package/PROTOCOL.md +761 -9
  2. package/README.md +285 -1
  3. package/WORLD-GLTF.md +109 -0
  4. package/WORLD-SCENE.md +135 -0
  5. package/dist/authority/fast-udp.d.ts +15 -0
  6. package/dist/authority/fast-udp.js +14 -0
  7. package/dist/authority/fast-webtransport.d.ts +67 -0
  8. package/dist/authority/fast-webtransport.js +21 -0
  9. package/dist/authority/index.d.ts +2671 -0
  10. package/dist/authority/index.js +958 -0
  11. package/dist/authority/module.d.ts +2 -0
  12. package/dist/authority/module.js +12 -0
  13. package/dist/bridge-authority.d.ts +101 -0
  14. package/dist/bridge-authority.global.js +15 -0
  15. package/dist/bridge-authority.js +291 -0
  16. package/dist/bridge-core-Dhc73GC8.d.ts +27 -0
  17. package/dist/bridge.d.ts +26 -20
  18. package/dist/bridge.global.js +7 -7
  19. package/dist/bridge.js +17 -48
  20. package/dist/chunk-2NGXXQDS.js +1916 -0
  21. package/dist/chunk-4R7C2TLH.js +68 -0
  22. package/dist/{chunk-C52XFIB6.js → chunk-CSQEEANB.js} +217 -4
  23. package/dist/chunk-FPWP22Y7.js +143 -0
  24. package/dist/chunk-NFMGIKFZ.js +2627 -0
  25. package/dist/chunk-OD6NRSX2.js +29 -0
  26. package/dist/{chunk-3ZUPU3GT.js → chunk-QY3QQNDJ.js} +13 -122
  27. package/dist/chunk-QZOCUQJT.js +6900 -0
  28. package/dist/chunk-TSYEWPVO.js +44 -0
  29. package/dist/chunk-TVTVIMIH.js +675 -0
  30. package/dist/chunk-YWQ3ALYY.js +69 -0
  31. package/dist/fast-client--A88q0kk.d.ts +546 -0
  32. package/dist/index.d.ts +3 -5
  33. package/dist/index.js +3 -2
  34. package/dist/join-CGoInvUM.d.ts +6 -0
  35. package/dist/level-build-CbRqrYJq.d.ts +140 -0
  36. package/dist/module-CSpXrzFc.d.ts +1187 -0
  37. package/dist/physics-predict-C7ZB1gDG.d.ts +1223 -0
  38. package/dist/protocol.d.ts +222 -2
  39. package/dist/protocol.js +47 -1
  40. package/dist/shot-world-D22tqOUT.d.ts +485 -0
  41. package/dist/world-fit/index.d.ts +549 -0
  42. package/dist/world-fit/index.js +4763 -0
  43. package/dist/world-fit/three.d.ts +77 -0
  44. package/dist/world-fit/three.js +140 -0
  45. package/package.json +46 -4
@@ -0,0 +1,67 @@
1
+ import { F as FastSocketOpener, a as FastFallbackReason, b as FastBindMessage } from '../fast-client--A88q0kk.js';
2
+ import '../module-CSpXrzFc.js';
3
+ import '../shot-world-D22tqOUT.js';
4
+
5
+ /** Hex digits of one certificate hash (SHA-256). */
6
+ declare const FAST_WT_HASH_HEX_DIGITS = 64;
7
+ /** Hashes one binding may carry (the relay sends its current and next certificate's). */
8
+ declare const FAST_WT_HASHES_MAX = 4;
9
+ /** A `wt` binding this client can open: its url and the certificate hashes as bytes. */
10
+ interface FastWebTransportTarget {
11
+ url: string;
12
+ hashes: Uint8Array[];
13
+ }
14
+ /** The WebTransport `wt` of a binding this client can use, else null: an `https://` url with a host and
15
+ * no credentials, query or fragment, and 1..{@link FAST_WT_HASHES_MAX} hashes of
16
+ * {@link FAST_WT_HASH_HEX_DIGITS} lowercase hex digits. The binding is server-supplied, so anything
17
+ * else is refused. */
18
+ declare function fastWebTransportOf(bind: Pick<FastBindMessage, 'wt'>): FastWebTransportTarget | null;
19
+ /** The part of the browser's `WebTransport` the opener uses. */
20
+ interface WebTransportLike {
21
+ readonly ready: Promise<unknown>;
22
+ readonly closed: Promise<unknown>;
23
+ /** `pending`, `reliable-only` or `supports-unreliable` where the browser exposes it. */
24
+ readonly reliability?: string;
25
+ readonly datagrams: {
26
+ readonly readable: ReadableStream<Uint8Array>;
27
+ /** Chromium's way to send; Safari 26 has only `createWritable()`. */
28
+ readonly writable?: WritableStream<Uint8Array>;
29
+ createWritable?(): WritableStream<Uint8Array>;
30
+ readonly maxDatagramSize?: number;
31
+ };
32
+ close(info?: {
33
+ closeCode?: number;
34
+ reason?: string;
35
+ }): void;
36
+ }
37
+ /** `new WebTransport(url, options)`. */
38
+ type WebTransportConstructor = new (url: string, options: Record<string, unknown>) => WebTransportLike;
39
+ /** The options a fast@1 session opens with. */
40
+ declare function webTransportOptions(target: FastWebTransportTarget): Record<string, unknown>;
41
+ /** A {@link FastSocketOpener} on `WebTransport` (the browser's, or a stand-in in tests): null when the
42
+ * binding has no usable `wt` or there is no WebTransport. */
43
+ declare function webTransportFastOpener(WebTransport: WebTransportConstructor | undefined): FastSocketOpener;
44
+ /** The part of a global scope {@link chooseFastSocket} reads. */
45
+ interface FastSocketScope {
46
+ WebTransport?: unknown;
47
+ /** A page has one; */
48
+ document?: unknown;
49
+ /** a worker has this. Neither: not a browser (Node). */
50
+ importScripts?: unknown;
51
+ }
52
+ /** The browser's opener: the global `WebTransport` (null where there is none, so the seat stays on the
53
+ * WebSocket). */
54
+ declare const openWebTransportFastSocket: FastSocketOpener;
55
+ /** How a seat opens its fast channel, and why it never asks when it does not. */
56
+ interface FastSocketChoice {
57
+ open: FastSocketOpener | undefined;
58
+ /** The reason `s.fast` reads from the start. */
59
+ fallback: FastFallbackReason | null;
60
+ }
61
+ /** The socket for `connectAuthority`'s `fast`: the game's own opener, none when the game said `false`;
62
+ * with no word from the game, WebTransport wherever `scope` has it. A browser without it never asks
63
+ * (a seat that asks and then cannot open the binding loses the WebSocket inputs it sent before the
64
+ * binding, PROTOCOL.md §17.12 *Fallback*), and says so. Node, with neither, is a plain WebSocket seat. */
65
+ declare function chooseFastSocket(given: FastSocketOpener | false | undefined, scope?: FastSocketScope): FastSocketChoice;
66
+
67
+ export { FAST_WT_HASHES_MAX, FAST_WT_HASH_HEX_DIGITS, type FastSocketChoice, type FastSocketScope, type FastWebTransportTarget, type WebTransportConstructor, type WebTransportLike, chooseFastSocket, fastWebTransportOf, openWebTransportFastSocket, webTransportFastOpener, webTransportOptions };
@@ -0,0 +1,21 @@
1
+ import {
2
+ FAST_WT_HASHES_MAX,
3
+ FAST_WT_HASH_HEX_DIGITS,
4
+ chooseFastSocket,
5
+ fastWebTransportOf,
6
+ openWebTransportFastSocket,
7
+ webTransportFastOpener,
8
+ webTransportOptions
9
+ } from "../chunk-NFMGIKFZ.js";
10
+ import "../chunk-OD6NRSX2.js";
11
+ import "../chunk-2NGXXQDS.js";
12
+ import "../chunk-CSQEEANB.js";
13
+ export {
14
+ FAST_WT_HASHES_MAX,
15
+ FAST_WT_HASH_HEX_DIGITS,
16
+ chooseFastSocket,
17
+ fastWebTransportOf,
18
+ openWebTransportFastSocket,
19
+ webTransportFastOpener,
20
+ webTransportOptions
21
+ };