@multitapio/multitap 0.0.1

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 (286) hide show
  1. package/dist/.stamp +0 -0
  2. package/dist/cache.d.ts +117 -0
  3. package/dist/cache.d.ts.map +1 -0
  4. package/dist/channel.d.ts +91 -0
  5. package/dist/channel.d.ts.map +1 -0
  6. package/dist/channel.worker.d.ts +3 -0
  7. package/dist/channel.worker.d.ts.map +1 -0
  8. package/dist/codegen/config.d.ts +107 -0
  9. package/dist/codegen/config.d.ts.map +1 -0
  10. package/dist/codegen/generator.d.ts +78 -0
  11. package/dist/codegen/generator.d.ts.map +1 -0
  12. package/dist/codegen/index.d.ts +13 -0
  13. package/dist/codegen/index.d.ts.map +1 -0
  14. package/dist/codegen/inject.d.ts +51 -0
  15. package/dist/codegen/inject.d.ts.map +1 -0
  16. package/dist/codegen/rust.d.ts +22 -0
  17. package/dist/codegen/rust.d.ts.map +1 -0
  18. package/dist/codegen/typescript.d.ts +22 -0
  19. package/dist/codegen/typescript.d.ts.map +1 -0
  20. package/dist/constants.d.ts +5 -0
  21. package/dist/constants.d.ts.map +1 -0
  22. package/dist/crypto.d.ts +141 -0
  23. package/dist/crypto.d.ts.map +1 -0
  24. package/dist/debug.d.ts +39 -0
  25. package/dist/debug.d.ts.map +1 -0
  26. package/dist/diagnostics/index.d.ts +12 -0
  27. package/dist/diagnostics/index.d.ts.map +1 -0
  28. package/dist/diagnostics.js +5502 -0
  29. package/dist/e2e/cli.d.ts +2 -0
  30. package/dist/e2e/cli.d.ts.map +1 -0
  31. package/dist/executor.d.ts +130 -0
  32. package/dist/executor.d.ts.map +1 -0
  33. package/dist/globals.d.ts +32 -0
  34. package/dist/helpers.d.ts +3 -0
  35. package/dist/helpers.d.ts.map +1 -0
  36. package/dist/input-codec.d.ts +136 -0
  37. package/dist/input-codec.d.ts.map +1 -0
  38. package/dist/input-graph.d.ts +106 -0
  39. package/dist/input-graph.d.ts.map +1 -0
  40. package/dist/lib.d.ts +10 -0
  41. package/dist/lib.d.ts.map +1 -0
  42. package/dist/lib.js +9409 -0
  43. package/dist/messages.d.ts +63 -0
  44. package/dist/messages.d.ts.map +1 -0
  45. package/dist/peer-mesh.d.ts +77 -0
  46. package/dist/peer-mesh.d.ts.map +1 -0
  47. package/dist/react/Crosshair.d.ts +17 -0
  48. package/dist/react/Crosshair.d.ts.map +1 -0
  49. package/dist/react/Player.d.ts +10 -0
  50. package/dist/react/Player.d.ts.map +1 -0
  51. package/dist/react/PlayerPoseContext.d.ts +31 -0
  52. package/dist/react/PlayerPoseContext.d.ts.map +1 -0
  53. package/dist/react/hooks/index.d.ts +7 -0
  54. package/dist/react/hooks/index.d.ts.map +1 -0
  55. package/dist/react/hooks/useEvent.d.ts +46 -0
  56. package/dist/react/hooks/useEvent.d.ts.map +1 -0
  57. package/dist/react/hooks/useFrame.d.ts +23 -0
  58. package/dist/react/hooks/useFrame.d.ts.map +1 -0
  59. package/dist/react/hooks/usePlayers.d.ts +24 -0
  60. package/dist/react/hooks/usePlayers.d.ts.map +1 -0
  61. package/dist/react/hooks/useQuery.d.ts +41 -0
  62. package/dist/react/hooks/useQuery.d.ts.map +1 -0
  63. package/dist/react/hooks/useSession.d.ts +10 -0
  64. package/dist/react/hooks/useSession.d.ts.map +1 -0
  65. package/dist/react/index.d.ts +18 -0
  66. package/dist/react/index.d.ts.map +1 -0
  67. package/dist/react/input/DesktopInputMapper.d.ts +38 -0
  68. package/dist/react/input/DesktopInputMapper.d.ts.map +1 -0
  69. package/dist/react/input/index.d.ts +4 -0
  70. package/dist/react/input/index.d.ts.map +1 -0
  71. package/dist/react/input/types.d.ts +46 -0
  72. package/dist/react/input/types.d.ts.map +1 -0
  73. package/dist/react/providers/SessionProvider.d.ts +17 -0
  74. package/dist/react/providers/SessionProvider.d.ts.map +1 -0
  75. package/dist/react/providers/index.d.ts +2 -0
  76. package/dist/react/providers/index.d.ts.map +1 -0
  77. package/dist/react/types/index.d.ts +2 -0
  78. package/dist/react/types/index.d.ts.map +1 -0
  79. package/dist/react/types/session.d.ts +88 -0
  80. package/dist/react/types/session.d.ts.map +1 -0
  81. package/dist/react/types.d.ts +134 -0
  82. package/dist/react/types.d.ts.map +1 -0
  83. package/dist/react/utils/math.d.ts +19 -0
  84. package/dist/react/utils/math.d.ts.map +1 -0
  85. package/dist/react/views/AsteroidsView.d.ts +24 -0
  86. package/dist/react/views/AsteroidsView.d.ts.map +1 -0
  87. package/dist/react/views/FirstPersonView.d.ts +10 -0
  88. package/dist/react/views/FirstPersonView.d.ts.map +1 -0
  89. package/dist/react/views/IsometricView.d.ts +21 -0
  90. package/dist/react/views/IsometricView.d.ts.map +1 -0
  91. package/dist/react/views/MapView.d.ts +16 -0
  92. package/dist/react/views/MapView.d.ts.map +1 -0
  93. package/dist/react/views/MobaView.d.ts +17 -0
  94. package/dist/react/views/MobaView.d.ts.map +1 -0
  95. package/dist/react/views/SideOnView.d.ts +23 -0
  96. package/dist/react/views/SideOnView.d.ts.map +1 -0
  97. package/dist/react/views/ThirdPersonFixedView.d.ts +21 -0
  98. package/dist/react/views/ThirdPersonFixedView.d.ts.map +1 -0
  99. package/dist/react/views/ThirdPersonView.d.ts +12 -0
  100. package/dist/react/views/ThirdPersonView.d.ts.map +1 -0
  101. package/dist/react/views/TopDownFixedView.d.ts +20 -0
  102. package/dist/react/views/TopDownFixedView.d.ts.map +1 -0
  103. package/dist/react/views/TopDownView.d.ts +12 -0
  104. package/dist/react/views/TopDownView.d.ts.map +1 -0
  105. package/dist/react/views/TwinStickView.d.ts +13 -0
  106. package/dist/react/views/TwinStickView.d.ts.map +1 -0
  107. package/dist/react/views/VehicleFixedView.d.ts +16 -0
  108. package/dist/react/views/VehicleFixedView.d.ts.map +1 -0
  109. package/dist/react/views/VehicleView.d.ts +13 -0
  110. package/dist/react/views/VehicleView.d.ts.map +1 -0
  111. package/dist/react/views/index.d.ts +21 -0
  112. package/dist/react/views/index.d.ts.map +1 -0
  113. package/dist/react/views/types.d.ts +136 -0
  114. package/dist/react/views/types.d.ts.map +1 -0
  115. package/dist/rollback.d.ts +193 -0
  116. package/dist/rollback.d.ts.map +1 -0
  117. package/dist/rollback.worker.d.ts +3 -0
  118. package/dist/rollback.worker.d.ts.map +1 -0
  119. package/dist/schema.d.ts +309 -0
  120. package/dist/schema.d.ts.map +1 -0
  121. package/dist/session-config.d.ts +119 -0
  122. package/dist/session-config.d.ts.map +1 -0
  123. package/dist/session.d.ts +120 -0
  124. package/dist/session.d.ts.map +1 -0
  125. package/dist/state.d.ts +400 -0
  126. package/dist/state.d.ts.map +1 -0
  127. package/dist/stats.d.ts +21 -0
  128. package/dist/stats.d.ts.map +1 -0
  129. package/dist/test-session.d.ts +170 -0
  130. package/dist/test-session.d.ts.map +1 -0
  131. package/dist/types/cache.d.ts +117 -0
  132. package/dist/types/cache.d.ts.map +1 -0
  133. package/dist/types/channel.d.ts +91 -0
  134. package/dist/types/channel.d.ts.map +1 -0
  135. package/dist/types/channel.worker.d.ts +3 -0
  136. package/dist/types/channel.worker.d.ts.map +1 -0
  137. package/dist/types/codegen/config.d.ts +107 -0
  138. package/dist/types/codegen/config.d.ts.map +1 -0
  139. package/dist/types/codegen/generator.d.ts +78 -0
  140. package/dist/types/codegen/generator.d.ts.map +1 -0
  141. package/dist/types/codegen/index.d.ts +13 -0
  142. package/dist/types/codegen/index.d.ts.map +1 -0
  143. package/dist/types/codegen/inject.d.ts +51 -0
  144. package/dist/types/codegen/inject.d.ts.map +1 -0
  145. package/dist/types/codegen/rust.d.ts +22 -0
  146. package/dist/types/codegen/rust.d.ts.map +1 -0
  147. package/dist/types/codegen/typescript.d.ts +22 -0
  148. package/dist/types/codegen/typescript.d.ts.map +1 -0
  149. package/dist/types/constants.d.ts +5 -0
  150. package/dist/types/constants.d.ts.map +1 -0
  151. package/dist/types/crypto.d.ts +141 -0
  152. package/dist/types/crypto.d.ts.map +1 -0
  153. package/dist/types/debug.d.ts +39 -0
  154. package/dist/types/debug.d.ts.map +1 -0
  155. package/dist/types/diagnostics/index.d.ts +12 -0
  156. package/dist/types/diagnostics/index.d.ts.map +1 -0
  157. package/dist/types/e2e/cli.d.ts +2 -0
  158. package/dist/types/e2e/cli.d.ts.map +1 -0
  159. package/dist/types/executor.d.ts +130 -0
  160. package/dist/types/executor.d.ts.map +1 -0
  161. package/dist/types/helpers.d.ts +3 -0
  162. package/dist/types/helpers.d.ts.map +1 -0
  163. package/dist/types/input-codec.d.ts +136 -0
  164. package/dist/types/input-codec.d.ts.map +1 -0
  165. package/dist/types/input-graph.d.ts +106 -0
  166. package/dist/types/input-graph.d.ts.map +1 -0
  167. package/dist/types/lib.d.ts +10 -0
  168. package/dist/types/lib.d.ts.map +1 -0
  169. package/dist/types/messages.d.ts +63 -0
  170. package/dist/types/messages.d.ts.map +1 -0
  171. package/dist/types/peer-mesh.d.ts +77 -0
  172. package/dist/types/peer-mesh.d.ts.map +1 -0
  173. package/dist/types/react/Crosshair.d.ts +17 -0
  174. package/dist/types/react/Crosshair.d.ts.map +1 -0
  175. package/dist/types/react/Player.d.ts +10 -0
  176. package/dist/types/react/Player.d.ts.map +1 -0
  177. package/dist/types/react/PlayerPoseContext.d.ts +31 -0
  178. package/dist/types/react/PlayerPoseContext.d.ts.map +1 -0
  179. package/dist/types/react/hooks/index.d.ts +7 -0
  180. package/dist/types/react/hooks/index.d.ts.map +1 -0
  181. package/dist/types/react/hooks/useEvent.d.ts +46 -0
  182. package/dist/types/react/hooks/useEvent.d.ts.map +1 -0
  183. package/dist/types/react/hooks/useFrame.d.ts +23 -0
  184. package/dist/types/react/hooks/useFrame.d.ts.map +1 -0
  185. package/dist/types/react/hooks/usePlayers.d.ts +24 -0
  186. package/dist/types/react/hooks/usePlayers.d.ts.map +1 -0
  187. package/dist/types/react/hooks/useQuery.d.ts +41 -0
  188. package/dist/types/react/hooks/useQuery.d.ts.map +1 -0
  189. package/dist/types/react/hooks/useSession.d.ts +10 -0
  190. package/dist/types/react/hooks/useSession.d.ts.map +1 -0
  191. package/dist/types/react/index.d.ts +18 -0
  192. package/dist/types/react/index.d.ts.map +1 -0
  193. package/dist/types/react/input/DesktopInputMapper.d.ts +38 -0
  194. package/dist/types/react/input/DesktopInputMapper.d.ts.map +1 -0
  195. package/dist/types/react/input/index.d.ts +4 -0
  196. package/dist/types/react/input/index.d.ts.map +1 -0
  197. package/dist/types/react/input/types.d.ts +46 -0
  198. package/dist/types/react/input/types.d.ts.map +1 -0
  199. package/dist/types/react/providers/SessionProvider.d.ts +17 -0
  200. package/dist/types/react/providers/SessionProvider.d.ts.map +1 -0
  201. package/dist/types/react/providers/index.d.ts +2 -0
  202. package/dist/types/react/providers/index.d.ts.map +1 -0
  203. package/dist/types/react/types/index.d.ts +2 -0
  204. package/dist/types/react/types/index.d.ts.map +1 -0
  205. package/dist/types/react/types/session.d.ts +88 -0
  206. package/dist/types/react/types/session.d.ts.map +1 -0
  207. package/dist/types/react/types.d.ts +134 -0
  208. package/dist/types/react/types.d.ts.map +1 -0
  209. package/dist/types/react/utils/math.d.ts +19 -0
  210. package/dist/types/react/utils/math.d.ts.map +1 -0
  211. package/dist/types/react/views/AsteroidsView.d.ts +24 -0
  212. package/dist/types/react/views/AsteroidsView.d.ts.map +1 -0
  213. package/dist/types/react/views/FirstPersonView.d.ts +10 -0
  214. package/dist/types/react/views/FirstPersonView.d.ts.map +1 -0
  215. package/dist/types/react/views/IsometricView.d.ts +21 -0
  216. package/dist/types/react/views/IsometricView.d.ts.map +1 -0
  217. package/dist/types/react/views/MapView.d.ts +16 -0
  218. package/dist/types/react/views/MapView.d.ts.map +1 -0
  219. package/dist/types/react/views/MobaView.d.ts +17 -0
  220. package/dist/types/react/views/MobaView.d.ts.map +1 -0
  221. package/dist/types/react/views/SideOnView.d.ts +23 -0
  222. package/dist/types/react/views/SideOnView.d.ts.map +1 -0
  223. package/dist/types/react/views/ThirdPersonFixedView.d.ts +21 -0
  224. package/dist/types/react/views/ThirdPersonFixedView.d.ts.map +1 -0
  225. package/dist/types/react/views/ThirdPersonView.d.ts +12 -0
  226. package/dist/types/react/views/ThirdPersonView.d.ts.map +1 -0
  227. package/dist/types/react/views/TopDownFixedView.d.ts +20 -0
  228. package/dist/types/react/views/TopDownFixedView.d.ts.map +1 -0
  229. package/dist/types/react/views/TopDownView.d.ts +12 -0
  230. package/dist/types/react/views/TopDownView.d.ts.map +1 -0
  231. package/dist/types/react/views/TwinStickView.d.ts +13 -0
  232. package/dist/types/react/views/TwinStickView.d.ts.map +1 -0
  233. package/dist/types/react/views/VehicleFixedView.d.ts +16 -0
  234. package/dist/types/react/views/VehicleFixedView.d.ts.map +1 -0
  235. package/dist/types/react/views/VehicleView.d.ts +13 -0
  236. package/dist/types/react/views/VehicleView.d.ts.map +1 -0
  237. package/dist/types/react/views/index.d.ts +21 -0
  238. package/dist/types/react/views/index.d.ts.map +1 -0
  239. package/dist/types/react/views/types.d.ts +136 -0
  240. package/dist/types/react/views/types.d.ts.map +1 -0
  241. package/dist/types/rollback.d.ts +193 -0
  242. package/dist/types/rollback.d.ts.map +1 -0
  243. package/dist/types/rollback.worker.d.ts +3 -0
  244. package/dist/types/rollback.worker.d.ts.map +1 -0
  245. package/dist/types/schema.d.ts +309 -0
  246. package/dist/types/schema.d.ts.map +1 -0
  247. package/dist/types/session-config.d.ts +119 -0
  248. package/dist/types/session-config.d.ts.map +1 -0
  249. package/dist/types/session.d.ts +120 -0
  250. package/dist/types/session.d.ts.map +1 -0
  251. package/dist/types/state.d.ts +400 -0
  252. package/dist/types/state.d.ts.map +1 -0
  253. package/dist/types/stats.d.ts +21 -0
  254. package/dist/types/stats.d.ts.map +1 -0
  255. package/dist/types/test-session.d.ts +170 -0
  256. package/dist/types/test-session.d.ts.map +1 -0
  257. package/dist/types/utils.d.ts +26 -0
  258. package/dist/types/utils.d.ts.map +1 -0
  259. package/dist/types/vite/codegen-runner.d.ts +27 -0
  260. package/dist/types/vite/codegen-runner.d.ts.map +1 -0
  261. package/dist/types/vite/index.d.ts +20 -0
  262. package/dist/types/vite/index.d.ts.map +1 -0
  263. package/dist/types/vite/module-builder.d.ts +28 -0
  264. package/dist/types/vite/module-builder.d.ts.map +1 -0
  265. package/dist/types/vite/plugin.d.ts +27 -0
  266. package/dist/types/vite/plugin.d.ts.map +1 -0
  267. package/dist/types/vite/types.d.ts +37 -0
  268. package/dist/types/vite/types.d.ts.map +1 -0
  269. package/dist/types/vite/wasm-compiler.d.ts +32 -0
  270. package/dist/types/vite/wasm-compiler.d.ts.map +1 -0
  271. package/dist/utils.d.ts +26 -0
  272. package/dist/utils.d.ts.map +1 -0
  273. package/dist/vite/codegen-runner.d.ts +27 -0
  274. package/dist/vite/codegen-runner.d.ts.map +1 -0
  275. package/dist/vite/index.d.ts +20 -0
  276. package/dist/vite/index.d.ts.map +1 -0
  277. package/dist/vite/index.js +4202 -0
  278. package/dist/vite/module-builder.d.ts +28 -0
  279. package/dist/vite/module-builder.d.ts.map +1 -0
  280. package/dist/vite/plugin.d.ts +27 -0
  281. package/dist/vite/plugin.d.ts.map +1 -0
  282. package/dist/vite/types.d.ts +37 -0
  283. package/dist/vite/types.d.ts.map +1 -0
  284. package/dist/vite/wasm-compiler.d.ts +32 -0
  285. package/dist/vite/wasm-compiler.d.ts.map +1 -0
  286. package/package.json +92 -0
@@ -0,0 +1,141 @@
1
+ import type { InputData } from './messages';
2
+ export declare const SIGNATURE_SIZE = 65;
3
+ export declare const COMPRESSED_PUBKEY_SIZE = 33;
4
+ export declare const COMPRESSED_PUB_KEY_SIZE = 33;
5
+ export declare const PRIVATE_KEY_SIZE = 32;
6
+ export declare const HASH_SIZE = 32;
7
+ export declare const INPUT_HEADER_SIZE = 5;
8
+ export declare const GENESIS_HASH_SIZE = 16;
9
+ /**
10
+ * Generate a new secp256k1 private key.
11
+ * @returns 32-byte private key
12
+ */
13
+ export declare function generateKeyPair(): Uint8Array;
14
+ /**
15
+ * Derive the compressed public key from a private key.
16
+ * @param privateKey 32-byte private key
17
+ * @returns 33-byte compressed public key
18
+ */
19
+ export declare function pubKeyFromPrivate(privateKey: Uint8Array): Uint8Array;
20
+ /**
21
+ * Sign a 32-byte message hash with a private key.
22
+ * Returns a 65-byte recoverable signature in format [r:32][s:32][v:1].
23
+ * @param privateKey 32-byte private key
24
+ * @param messageHash 32-byte message hash
25
+ * @returns 65-byte signature
26
+ */
27
+ export declare function sign(privateKey: Uint8Array, messageHash: Uint8Array): Uint8Array;
28
+ /**
29
+ * Recover the compressed public key from a message hash and signature.
30
+ * @param messageHash 32-byte message hash
31
+ * @param signature 65-byte signature in format [r:32][s:32][v:1]
32
+ * @returns 33-byte compressed public key
33
+ */
34
+ export declare function recoverPubKey(messageHash: Uint8Array, signature: Uint8Array): Uint8Array;
35
+ /**
36
+ * Verify that a signature was created by the owner of the given public key.
37
+ * @param pubKey 33-byte compressed public key
38
+ * @param messageHash 32-byte message hash
39
+ * @param signature 65-byte signature
40
+ * @returns true if valid
41
+ */
42
+ export declare function verifySignature(pubKey: Uint8Array, messageHash: Uint8Array, signature: Uint8Array): boolean;
43
+ /**
44
+ * Compute SHA-256 hash of arbitrary data.
45
+ * @param data Data to hash
46
+ * @returns 32-byte hash
47
+ */
48
+ export declare function hashMessage(data: Uint8Array): Uint8Array;
49
+ /**
50
+ * Compute a short truncated SHA256 hash used to shard sessions based on simulation/schema/input compatibility.
51
+ * Returns the first 8 bytes of SHA256(data).
52
+ * @param data Data to hash
53
+ * @returns 8-byte truncated hash
54
+ */
55
+ export declare function sessionCompatibilityHash(data: Uint8Array): Uint8Array;
56
+ /**
57
+ * Compute a truncated SHA256 hash of a JavaScript object using deterministic CBOR encoding.
58
+ * This ensures cross-platform compatibility - the same object will produce the same hash
59
+ * in both Go and JavaScript implementations.
60
+ *
61
+ * CBOR encoding rules (RFC 8949 §4.2 Core Deterministic Encoding):
62
+ * - Map keys sorted by byte string length, then lexicographically
63
+ * - Smallest possible integer encodings
64
+ * - No indefinite-length encodings
65
+ *
66
+ * @param obj JavaScript object to hash (must be CBOR-serializable)
67
+ * @returns 8-byte truncated hash
68
+ */
69
+ export declare function hashContent(obj: unknown): Uint8Array;
70
+ /**
71
+ * Compute the hash for signing an input message.
72
+ * Format: SHA256(genesisHash || targetTick || payload)
73
+ * @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
74
+ * @param targetTick Target tick number (uint32)
75
+ * @param payload Variable-length input payload (0-255 bytes)
76
+ * @returns 32-byte hash
77
+ */
78
+ export declare function hashInputMessage(genesisHash: Uint8Array, targetTick: number, payload: Uint8Array): Uint8Array;
79
+ /**
80
+ * Compute the hash for signing a tick message.
81
+ * Format: SHA256(genesisHash || tickNum || inputsHash || prevTickSig)
82
+ * @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
83
+ * @param tickNum Tick number (uint32)
84
+ * @param inputsHash 32-byte hash of concatenated inputs
85
+ * @param prevTickSig 65-byte previous tick's signature
86
+ * @returns 32-byte hash
87
+ */
88
+ export declare function hashTickMessage(genesisHash: Uint8Array, tickNum: number, inputsHash: Uint8Array, prevTickSig: Uint8Array): Uint8Array;
89
+ /**
90
+ * Compute a hash over all inputs in a tick.
91
+ * Format: SHA256(input1 || input2 || ... || inputN)
92
+ * where each input is: [targetTick:4][payloadLen:1][payload:0-255][signature:65]
93
+ * Returns zero hash if there are no inputs.
94
+ * @param inputs Array of input messages
95
+ * @returns 32-byte hash
96
+ */
97
+ export declare function hashInputs(inputs: InputData[]): Uint8Array;
98
+ /**
99
+ * Compute a hash over ordered payloads for stateId computation.
100
+ * Format: SHA256(payload1 || payload2 || ... || payloadN)
101
+ * Returns zero hash if there are no payloads.
102
+ *
103
+ * NOTE: This is distinct from hashInputs() which hashes full input messages
104
+ * (including signatures) for the tick signature chain. hashPayloads() hashes
105
+ * only the raw payloads in participant order, for state identity caching.
106
+ *
107
+ * @param payloads Array of payload bytes, ordered by participant index
108
+ * @returns 32-byte hash
109
+ */
110
+ export declare function hashPayloads(payloads: Uint8Array[]): Uint8Array;
111
+ /**
112
+ * Compute the hash for connection authentication.
113
+ * Format: SHA256("multitap:session:" || genesisHash || ":" || timestamp)
114
+ * @param genesisHash 16-byte genesis hash (from SessionConfig.toGenesisHash())
115
+ * @param timestampMs Timestamp in milliseconds
116
+ * @returns 32-byte hash
117
+ */
118
+ export declare function hashAuthMessage(genesisHash: Uint8Array, timestampMs: number): Uint8Array;
119
+ /**
120
+ * Encode a 16-byte genesis hash to base64url (no padding).
121
+ * A genesis hash is the deterministic session identity from SessionConfig.toGenesisHash().
122
+ * @param bytes 16-byte genesis hash
123
+ * @returns base64url string (22 chars)
124
+ */
125
+ export declare function genesisHashToString(bytes: Uint8Array): string;
126
+ /**
127
+ * Decode a base64url (no padding) string to a 16-byte genesis hash.
128
+ * Throws if the string is invalid or decodes to all zeros.
129
+ * @param str base64url string (22 chars)
130
+ * @returns 16-byte genesis hash
131
+ */
132
+ export declare function genesisHashFromString(str: string): Uint8Array;
133
+ /**
134
+ * Convert signature to hex string for URL encoding.
135
+ */
136
+ export declare function signatureToHex(signature: Uint8Array): string;
137
+ /**
138
+ * Parse hex string to signature bytes.
139
+ */
140
+ export declare function hexToSignature(hex: string): Uint8Array;
141
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAO5C,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,UAAU,CAehF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAkBxF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAO3G;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAGrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAIpD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAc7G;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,UAAU,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,UAAU,GACtB,UAAU,CAiBZ;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAkC1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,CAkC/D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAkBxF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAU7D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAI5D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMtD"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Debug logging utility for the multitap SDK.
3
+ *
4
+ * Wraps console.* methods with an enable/disable toggle.
5
+ * Disabled by default so library consumers don't see logs unless they opt-in.
6
+ *
7
+ * Usage:
8
+ * import { debug } from './debug';
9
+ * debug.warn('something happened');
10
+ *
11
+ * To enable logging (e.g., for debugging):
12
+ * import { setDebugEnabled } from './debug';
13
+ * setDebugEnabled(true);
14
+ */
15
+ /** Enable or disable debug logging globally */
16
+ export declare function setDebugEnabled(value: boolean): void;
17
+ /** Check if debug logging is currently enabled */
18
+ export declare function isDebugEnabled(): boolean;
19
+ export declare const debug: {
20
+ log: (...args: unknown[]) => void;
21
+ warn: (...args: unknown[]) => void;
22
+ error: (...args: unknown[]) => void;
23
+ info: (...args: unknown[]) => void;
24
+ debug: (...args: unknown[]) => void;
25
+ /** Returns a group function; if disabled, returns noop */
26
+ group: (label?: string) => void;
27
+ groupEnd: () => void;
28
+ /** Table output for structured data */
29
+ table: (data: unknown) => void;
30
+ /** Get the underlying console method (for advanced use) */
31
+ readonly raw: Console | {
32
+ log: () => void;
33
+ warn: () => void;
34
+ error: () => void;
35
+ info: () => void;
36
+ debug: () => void;
37
+ };
38
+ };
39
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,+CAA+C;AAC/C,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEpD;AAED,kDAAkD;AAClD,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAID,eAAO,MAAM,KAAK;mBACD,OAAO,EAAE,KAAG,IAAI;oBAGf,OAAO,EAAE,KAAG,IAAI;qBAGf,OAAO,EAAE,KAAG,IAAI;oBAGjB,OAAO,EAAE,KAAG,IAAI;qBAGf,OAAO,EAAE,KAAG,IAAI;IAGjC,0DAA0D;oBAC1C,MAAM,KAAG,IAAI;oBAGf,IAAI;IAGlB,uCAAuC;kBACzB,OAAO,KAAG,IAAI;IAG5B,2DAA2D;;;;;;;;CAI5D,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Diagnostics client for e2e testing.
3
+ *
4
+ * Minimal browser client that:
5
+ * - Parses URL params (connectionURL, serverCertHash, relayPubKey)
6
+ * - Creates a Session with zero plugins (channel-only mode)
7
+ * - Generates random inputs on 50ms interval
8
+ * - Logs SYNC ticks to console for conformance testing
9
+ * - Exits when session duration elapses
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/diagnostics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}