@the-inclusionist/engine 9.0.0 → 11.0.0

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 (532) hide show
  1. package/README.md +120 -78
  2. package/app/css/style.css +761 -377
  3. package/app/public/vendor/fonts/playwrite-cu.woff2 +0 -0
  4. package/app/public/vendor/fonts/playwrite-es-deco.woff2 +0 -0
  5. package/app/public/vendor/fonts/playwrite-es.woff2 +0 -0
  6. package/app/public/vendor/fonts/playwrite-gb-j.woff2 +0 -0
  7. package/app/public/vendor/fonts/playwrite-gb-s.woff2 +0 -0
  8. package/app/public/vendor/fonts/playwrite-pe.woff2 +0 -0
  9. package/app/public/vendor/fonts/playwrite-pt.woff2 +0 -0
  10. package/app/public/vendor/fonts-licences/NOTICE.txt +166 -0
  11. package/app/public/vendor/fonts-licences/OFL-1.1.txt +86 -0
  12. package/app/public/vendor/fonts.css +36 -84
  13. package/dist-pkg/boot/create-game.d.ts +499 -219
  14. package/dist-pkg/boot/create-game.js +3944 -562
  15. package/dist-pkg/core/a11y-sr.d.ts +25 -3
  16. package/dist-pkg/core/a11y-sr.js +38 -19
  17. package/dist-pkg/core/accessible-label.d.ts +17 -0
  18. package/dist-pkg/core/accessible-label.js +37 -0
  19. package/dist-pkg/core/accommodation-subjects.d.ts +26 -0
  20. package/dist-pkg/core/accommodation-subjects.js +32 -0
  21. package/dist-pkg/core/accommodations.d.ts +125 -0
  22. package/dist-pkg/core/accommodations.js +195 -0
  23. package/dist-pkg/core/actions.d.ts +108 -55
  24. package/dist-pkg/core/actions.js +122 -71
  25. package/dist-pkg/core/calm-mode.d.ts +31 -0
  26. package/dist-pkg/core/calm-mode.js +47 -0
  27. package/dist-pkg/core/camera-cycle.d.ts +15 -0
  28. package/dist-pkg/core/camera-cycle.js +7 -0
  29. package/dist-pkg/core/caption-duration.d.ts +15 -0
  30. package/dist-pkg/core/caption-duration.js +19 -0
  31. package/dist-pkg/core/cartridge-problems.d.ts +34 -0
  32. package/dist-pkg/core/cartridge-problems.js +53 -0
  33. package/dist-pkg/core/constants.d.ts +0 -54
  34. package/dist-pkg/core/constants.js +9 -76
  35. package/dist-pkg/core/contract.d.ts +142 -164
  36. package/dist-pkg/core/contract.js +222 -208
  37. package/dist-pkg/core/dom-query.d.ts +4 -4
  38. package/dist-pkg/core/dom-query.js +12 -20
  39. package/dist-pkg/core/entity.d.ts +62 -77
  40. package/dist-pkg/core/entity.js +18 -32
  41. package/dist-pkg/core/escape-html.d.ts +9 -10
  42. package/dist-pkg/core/escape-html.js +16 -20
  43. package/dist-pkg/core/flash-threshold.d.ts +17 -0
  44. package/dist-pkg/core/flash-threshold.js +113 -0
  45. package/dist-pkg/core/game-speed.d.ts +11 -0
  46. package/dist-pkg/core/game-speed.js +16 -0
  47. package/dist-pkg/core/genres.d.ts +20 -0
  48. package/dist-pkg/core/genres.js +44 -0
  49. package/dist-pkg/core/i18n.d.ts +71 -60
  50. package/dist-pkg/core/i18n.js +186 -200
  51. package/dist-pkg/core/loop.d.ts +17 -6
  52. package/dist-pkg/core/loop.js +26 -26
  53. package/dist-pkg/core/pause-icon-catalogue.d.ts +15 -0
  54. package/dist-pkg/core/pause-icon-catalogue.js +54 -0
  55. package/dist-pkg/core/ring.d.ts +17 -0
  56. package/dist-pkg/core/ring.js +29 -0
  57. package/dist-pkg/core/rng.d.ts +7 -12
  58. package/dist-pkg/core/rng.js +23 -53
  59. package/dist-pkg/core/route.d.ts +26 -26
  60. package/dist-pkg/core/route.js +126 -121
  61. package/dist-pkg/core/scenes.d.ts +37 -40
  62. package/dist-pkg/core/scenes.js +41 -43
  63. package/dist-pkg/core/screens.d.ts +4 -4
  64. package/dist-pkg/core/screens.js +11 -16
  65. package/dist-pkg/core/session-clock.d.ts +23 -0
  66. package/dist-pkg/core/session-clock.js +37 -0
  67. package/dist-pkg/core/setting-defaults.d.ts +61 -0
  68. package/dist-pkg/core/setting-defaults.js +66 -0
  69. package/dist-pkg/core/speech-rate.d.ts +29 -0
  70. package/dist-pkg/core/speech-rate.js +47 -0
  71. package/dist-pkg/core/state.d.ts +118 -118
  72. package/dist-pkg/core/state.js +322 -297
  73. package/dist-pkg/core/visual-cycles.d.ts +30 -0
  74. package/dist-pkg/core/visual-cycles.js +52 -0
  75. package/dist-pkg/core/visual-state.d.ts +13 -0
  76. package/dist-pkg/core/visual-state.js +6 -0
  77. package/dist-pkg/educational/activities-registry.d.ts +1 -1
  78. package/dist-pkg/educational/activities-registry.js +9 -8
  79. package/dist-pkg/educational/adaptive-engine.d.ts +11 -11
  80. package/dist-pkg/educational/adaptive-engine.js +17 -17
  81. package/dist-pkg/educational/segment-bar.d.ts +12 -12
  82. package/dist-pkg/educational/segment-bar.js +9 -9
  83. package/dist-pkg/i18n/en.js +324 -223
  84. package/dist-pkg/i18n/es.js +323 -223
  85. package/dist-pkg/i18n/pt.js +348 -226
  86. package/dist-pkg/input/default-bindings.d.ts +37 -38
  87. package/dist-pkg/input/default-bindings.js +127 -144
  88. package/dist-pkg/input/devices.d.ts +7 -7
  89. package/dist-pkg/input/devices.js +17 -16
  90. package/dist-pkg/input/edges.d.ts +23 -32
  91. package/dist-pkg/input/edges.js +23 -28
  92. package/dist-pkg/input/empathy-filter.d.ts +22 -0
  93. package/dist-pkg/input/empathy-filter.js +34 -0
  94. package/dist-pkg/input/face-map.d.ts +96 -0
  95. package/dist-pkg/input/face-map.js +255 -0
  96. package/dist-pkg/input/face-signals.d.ts +40 -0
  97. package/dist-pkg/input/face-signals.js +48 -0
  98. package/dist-pkg/input/gamepad.d.ts +195 -145
  99. package/dist-pkg/input/gamepad.js +383 -556
  100. package/dist-pkg/input/gaze-cycle.d.ts +64 -0
  101. package/dist-pkg/input/gaze-cycle.js +133 -0
  102. package/dist-pkg/input/gaze-relative.d.ts +68 -0
  103. package/dist-pkg/input/gaze-relative.js +142 -0
  104. package/dist-pkg/input/hand-map.d.ts +28 -0
  105. package/dist-pkg/input/hand-map.js +142 -0
  106. package/dist-pkg/input/input-cooldown.d.ts +17 -0
  107. package/dist-pkg/input/input-cooldown.js +39 -0
  108. package/dist-pkg/input/key-default.d.ts +30 -0
  109. package/dist-pkg/input/key-default.js +60 -0
  110. package/dist-pkg/input/keyboard-runtime.d.ts +15 -21
  111. package/dist-pkg/input/keyboard-runtime.js +23 -27
  112. package/dist-pkg/input/keyboard.d.ts +68 -63
  113. package/dist-pkg/input/keyboard.js +83 -105
  114. package/dist-pkg/input/keydown.d.ts +123 -137
  115. package/dist-pkg/input/keydown.js +284 -289
  116. package/dist-pkg/input/latch-edge.d.ts +33 -21
  117. package/dist-pkg/input/latch-edge.js +34 -35
  118. package/dist-pkg/input/latch-scope.d.ts +51 -50
  119. package/dist-pkg/input/latch-scope.js +61 -82
  120. package/dist-pkg/input/latch-store.d.ts +26 -30
  121. package/dist-pkg/input/latch-store.js +42 -50
  122. package/dist-pkg/input/latch-sync.d.ts +29 -29
  123. package/dist-pkg/input/latch-sync.js +25 -25
  124. package/dist-pkg/input/latch.d.ts +14 -17
  125. package/dist-pkg/input/latch.js +29 -37
  126. package/dist-pkg/input/pad-defaults.d.ts +13 -16
  127. package/dist-pkg/input/pad-defaults.js +21 -28
  128. package/dist-pkg/input/pad-reading.d.ts +76 -0
  129. package/dist-pkg/input/pad-reading.js +169 -0
  130. package/dist-pkg/input/pad-wizard.d.ts +99 -0
  131. package/dist-pkg/input/pad-wizard.js +256 -0
  132. package/dist-pkg/input/pointer-space.d.ts +19 -20
  133. package/dist-pkg/input/pointer-space.js +27 -32
  134. package/dist-pkg/input/pointer.d.ts +39 -40
  135. package/dist-pkg/input/pointer.js +42 -45
  136. package/dist-pkg/input/state.d.ts +101 -89
  137. package/dist-pkg/input/state.js +54 -134
  138. package/dist-pkg/input/switch-scan.d.ts +59 -0
  139. package/dist-pkg/input/switch-scan.js +67 -0
  140. package/dist-pkg/input/synthetic-source.d.ts +42 -0
  141. package/dist-pkg/input/synthetic-source.js +57 -0
  142. package/dist-pkg/input/touch-bindings.d.ts +127 -116
  143. package/dist-pkg/input/touch-bindings.js +158 -173
  144. package/dist-pkg/input/touch.d.ts +147 -72
  145. package/dist-pkg/input/touch.js +362 -126
  146. package/dist-pkg/input/transport-in-use.d.ts +107 -0
  147. package/dist-pkg/input/transport-in-use.js +130 -0
  148. package/dist-pkg/input/transports.d.ts +90 -117
  149. package/dist-pkg/input/transports.js +104 -106
  150. package/dist-pkg/input/virtual-controller.d.ts +82 -0
  151. package/dist-pkg/input/virtual-controller.js +69 -0
  152. package/dist-pkg/input/vocabulary-migration.d.ts +50 -49
  153. package/dist-pkg/input/vocabulary-migration.js +80 -79
  154. package/dist-pkg/input/voice-map.d.ts +59 -0
  155. package/dist-pkg/input/voice-map.js +123 -0
  156. package/dist-pkg/platform/audio-ambient.d.ts +13 -2
  157. package/dist-pkg/platform/audio-ambient.js +14 -14
  158. package/dist-pkg/platform/audio-earcons.d.ts +20 -19
  159. package/dist-pkg/platform/audio-earcons.js +51 -42
  160. package/dist-pkg/platform/audio-jingles.js +9 -10
  161. package/dist-pkg/platform/audio-mixer.d.ts +14 -2
  162. package/dist-pkg/platform/audio-mixer.js +31 -39
  163. package/dist-pkg/platform/audio-sonar.d.ts +49 -152
  164. package/dist-pkg/platform/audio-sonar.js +124 -302
  165. package/dist-pkg/platform/audio.d.ts +62 -19
  166. package/dist-pkg/platform/audio.js +193 -168
  167. package/dist-pkg/platform/choose-by-voice.d.ts +70 -0
  168. package/dist-pkg/platform/choose-by-voice.js +157 -0
  169. package/dist-pkg/platform/flash-sampler.d.ts +19 -0
  170. package/dist-pkg/platform/flash-sampler.js +79 -0
  171. package/dist-pkg/platform/font-library.d.ts +77 -0
  172. package/dist-pkg/platform/font-library.js +98 -0
  173. package/dist-pkg/platform/font-library.json +721 -0
  174. package/dist-pkg/platform/heavy-catalogue.d.ts +77 -0
  175. package/dist-pkg/platform/heavy-catalogue.js +256 -0
  176. package/dist-pkg/platform/heavy-mirror.d.ts +20 -0
  177. package/dist-pkg/platform/heavy-mirror.js +73 -0
  178. package/dist-pkg/platform/heavy.d.ts +136 -0
  179. package/dist-pkg/platform/heavy.js +324 -0
  180. package/dist-pkg/platform/interruptible-speech.d.ts +23 -16
  181. package/dist-pkg/platform/interruptible-speech.js +77 -54
  182. package/dist-pkg/platform/kokoro-port.d.ts +27 -0
  183. package/dist-pkg/platform/kokoro-port.js +50 -0
  184. package/dist-pkg/platform/kokoro-runtime.d.ts +20 -0
  185. package/dist-pkg/platform/kokoro-runtime.js +52 -0
  186. package/dist-pkg/platform/kokoro.d.ts +70 -0
  187. package/dist-pkg/platform/kokoro.js +133 -0
  188. package/dist-pkg/platform/listener-scope.d.ts +12 -0
  189. package/dist-pkg/platform/listener-scope.js +90 -0
  190. package/dist-pkg/platform/locale-host.d.ts +14 -0
  191. package/dist-pkg/platform/locale-host.js +45 -0
  192. package/dist-pkg/platform/microphone.d.ts +51 -0
  193. package/dist-pkg/platform/microphone.js +118 -0
  194. package/dist-pkg/platform/onnx-runtime.d.ts +34 -0
  195. package/dist-pkg/platform/onnx-runtime.js +42 -0
  196. package/dist-pkg/platform/reading-in-worker.d.ts +64 -0
  197. package/dist-pkg/platform/reading-in-worker.js +125 -0
  198. package/dist-pkg/platform/reading-model.d.ts +94 -0
  199. package/dist-pkg/platform/reading-model.js +272 -0
  200. package/dist-pkg/platform/reading-runtime.d.ts +24 -0
  201. package/dist-pkg/platform/reading-runtime.js +164 -0
  202. package/dist-pkg/platform/reading-worker.d.ts +41 -0
  203. package/dist-pkg/platform/reading-worker.js +58 -0
  204. package/dist-pkg/platform/reading.d.ts +80 -0
  205. package/dist-pkg/platform/reading.js +136 -0
  206. package/dist-pkg/platform/speech-recognition.d.ts +60 -0
  207. package/dist-pkg/platform/speech-recognition.js +104 -0
  208. package/dist-pkg/platform/speech.d.ts +23 -1
  209. package/dist-pkg/platform/speech.js +29 -18
  210. package/dist-pkg/platform/storage-keys.d.ts +96 -0
  211. package/dist-pkg/platform/storage-keys.js +106 -0
  212. package/dist-pkg/platform/storage.d.ts +46 -111
  213. package/dist-pkg/platform/storage.js +104 -169
  214. package/dist-pkg/platform/tts.d.ts +85 -39
  215. package/dist-pkg/platform/tts.js +447 -127
  216. package/dist-pkg/platform/vision-loop.d.ts +23 -0
  217. package/dist-pkg/platform/vision-loop.js +56 -0
  218. package/dist-pkg/platform/vision.d.ts +132 -0
  219. package/dist-pkg/platform/vision.js +117 -0
  220. package/dist-pkg/platform/voice-listener.d.ts +40 -0
  221. package/dist-pkg/platform/voice-listener.js +88 -0
  222. package/dist-pkg/platform/voice-plan.d.ts +15 -98
  223. package/dist-pkg/platform/voice-plan.js +56 -143
  224. package/dist-pkg/platform/vosk-runtime.d.ts +96 -0
  225. package/dist-pkg/platform/vosk-runtime.js +151 -0
  226. package/dist-pkg/platform/vosk-vocabulary.d.ts +6 -0
  227. package/dist-pkg/platform/vosk-vocabulary.js +178 -0
  228. package/dist-pkg/render/canvas.d.ts +13 -7
  229. package/dist-pkg/render/canvas.js +13 -13
  230. package/dist-pkg/render/crt.d.ts +48 -12
  231. package/dist-pkg/render/crt.js +78 -80
  232. package/dist-pkg/render/cvd-matrices.d.ts +22 -18
  233. package/dist-pkg/render/cvd-matrices.js +37 -38
  234. package/dist-pkg/render/hc-role-data.d.ts +7 -7
  235. package/dist-pkg/render/hc-role-data.js +14 -14
  236. package/dist-pkg/render/high-contrast.d.ts +67 -56
  237. package/dist-pkg/render/high-contrast.js +226 -217
  238. package/dist-pkg/render/low-vision-drawing.d.ts +5 -0
  239. package/dist-pkg/render/low-vision-drawing.js +46 -0
  240. package/dist-pkg/render/lq-filter.d.ts +32 -20
  241. package/dist-pkg/render/lq-filter.js +59 -65
  242. package/dist-pkg/render/port.d.ts +86 -88
  243. package/dist-pkg/render/port.js +17 -23
  244. package/dist-pkg/render/screen-pipeline.d.ts +42 -42
  245. package/dist-pkg/render/screen-pipeline.js +80 -87
  246. package/dist-pkg/render/sprite-fx.d.ts +2 -1
  247. package/dist-pkg/render/sprite-fx.js +16 -14
  248. package/dist-pkg/render/viewports.d.ts +20 -15
  249. package/dist-pkg/render/viewports.js +83 -114
  250. package/dist-pkg/render/viz-axes-labels.d.ts +47 -0
  251. package/dist-pkg/render/viz-axes-labels.js +88 -0
  252. package/dist-pkg/render/viz-axes.d.ts +89 -86
  253. package/dist-pkg/render/viz-axes.js +128 -116
  254. package/dist-pkg/render/viz-modes.d.ts +28 -29
  255. package/dist-pkg/render/viz-modes.js +40 -45
  256. package/dist-pkg/render/viz-refusal.d.ts +32 -0
  257. package/dist-pkg/render/viz-refusal.js +57 -0
  258. package/dist-pkg/render/viz-setters.d.ts +104 -66
  259. package/dist-pkg/render/viz-setters.js +182 -191
  260. package/dist-pkg/ui/aac-sets.d.ts +45 -0
  261. package/dist-pkg/ui/aac-sets.js +41 -0
  262. package/dist-pkg/ui/audio-choices.d.ts +68 -0
  263. package/dist-pkg/ui/audio-choices.js +98 -0
  264. package/dist-pkg/ui/audio-rows-that-apply.d.ts +12 -0
  265. package/dist-pkg/ui/audio-rows-that-apply.js +43 -0
  266. package/dist-pkg/ui/camera-control.d.ts +53 -0
  267. package/dist-pkg/ui/camera-control.js +48 -0
  268. package/dist-pkg/ui/changed-mark.d.ts +9 -8
  269. package/dist-pkg/ui/changed-mark.js +22 -53
  270. package/dist-pkg/ui/control-choices.d.ts +37 -0
  271. package/dist-pkg/ui/control-choices.js +84 -0
  272. package/dist-pkg/ui/debug-panel.d.ts +59 -43
  273. package/dist-pkg/ui/debug-panel.js +68 -69
  274. package/dist-pkg/ui/declared-words.d.ts +21 -0
  275. package/dist-pkg/ui/declared-words.js +66 -0
  276. package/dist-pkg/ui/dom.d.ts +10 -14
  277. package/dist-pkg/ui/dom.js +10 -47
  278. package/dist-pkg/ui/drawing-problems.d.ts +25 -0
  279. package/dist-pkg/ui/drawing-problems.js +94 -0
  280. package/dist-pkg/ui/eye-control.d.ts +36 -0
  281. package/dist-pkg/ui/eye-control.js +178 -0
  282. package/dist-pkg/ui/face-control.d.ts +25 -0
  283. package/dist-pkg/ui/face-control.js +183 -0
  284. package/dist-pkg/ui/focus-trap.d.ts +39 -49
  285. package/dist-pkg/ui/focus-trap.js +56 -65
  286. package/dist-pkg/ui/fonts.d.ts +157 -68
  287. package/dist-pkg/ui/fonts.js +305 -115
  288. package/dist-pkg/ui/footer-scroll-driver.d.ts +14 -0
  289. package/dist-pkg/ui/footer-scroll-driver.js +201 -0
  290. package/dist-pkg/ui/footer-scroll.d.ts +38 -0
  291. package/dist-pkg/ui/footer-scroll.js +55 -0
  292. package/dist-pkg/ui/game-options.d.ts +47 -0
  293. package/dist-pkg/ui/game-options.js +158 -0
  294. package/dist-pkg/ui/gaze-overlay.d.ts +64 -0
  295. package/dist-pkg/ui/gaze-overlay.js +165 -0
  296. package/dist-pkg/ui/hand-control.d.ts +25 -0
  297. package/dist-pkg/ui/hand-control.js +143 -0
  298. package/dist-pkg/ui/help-panel.d.ts +87 -0
  299. package/dist-pkg/ui/help-panel.js +242 -0
  300. package/dist-pkg/ui/hud-bands.d.ts +62 -0
  301. package/dist-pkg/ui/hud-bands.js +146 -0
  302. package/dist-pkg/ui/hud-row.d.ts +34 -0
  303. package/dist-pkg/ui/hud-row.js +80 -0
  304. package/dist-pkg/ui/hud.d.ts +73 -73
  305. package/dist-pkg/ui/hud.js +94 -98
  306. package/dist-pkg/ui/item-announcement.d.ts +13 -12
  307. package/dist-pkg/ui/item-announcement.js +25 -26
  308. package/dist-pkg/ui/layout.d.ts +103 -28
  309. package/dist-pkg/ui/layout.js +117 -99
  310. package/dist-pkg/ui/libras-avatar-clip.d.ts +30 -0
  311. package/dist-pkg/ui/libras-avatar-clip.js +86 -0
  312. package/dist-pkg/ui/libras-avatar-load.d.ts +52 -0
  313. package/dist-pkg/ui/libras-avatar-load.js +134 -0
  314. package/dist-pkg/ui/libras-avatar-plan.d.ts +102 -0
  315. package/dist-pkg/ui/libras-avatar-plan.js +211 -0
  316. package/dist-pkg/ui/libras-avatar-player.d.ts +28 -0
  317. package/dist-pkg/ui/libras-avatar-player.js +226 -0
  318. package/dist-pkg/ui/libras-avatar-stage.d.ts +37 -0
  319. package/dist-pkg/ui/libras-avatar-stage.js +208 -0
  320. package/dist-pkg/ui/libras-glosses.d.ts +28 -0
  321. package/dist-pkg/ui/libras-glosses.js +161 -0
  322. package/dist-pkg/ui/locale-flags.d.ts +16 -0
  323. package/dist-pkg/ui/locale-flags.js +30 -0
  324. package/dist-pkg/ui/loop-crash.d.ts +17 -17
  325. package/dist-pkg/ui/loop-crash.js +33 -62
  326. package/dist-pkg/ui/menu-intent.d.ts +61 -0
  327. package/dist-pkg/ui/menu-intent.js +88 -0
  328. package/dist-pkg/ui/menu-items.d.ts +20 -0
  329. package/dist-pkg/ui/menu-items.js +51 -0
  330. package/dist-pkg/ui/menu-nav.d.ts +98 -92
  331. package/dist-pkg/ui/menu-nav.js +398 -286
  332. package/dist-pkg/ui/mobility-choices.d.ts +26 -0
  333. package/dist-pkg/ui/mobility-choices.js +41 -0
  334. package/dist-pkg/ui/motion-choices.d.ts +31 -0
  335. package/dist-pkg/ui/motion-choices.js +68 -0
  336. package/dist-pkg/ui/motion-scene.d.ts +24 -19
  337. package/dist-pkg/ui/motion-scene.js +29 -61
  338. package/dist-pkg/ui/mount-panel.d.ts +81 -0
  339. package/dist-pkg/ui/mount-panel.js +61 -0
  340. package/dist-pkg/ui/panel-shell.d.ts +65 -31
  341. package/dist-pkg/ui/panel-shell.js +92 -66
  342. package/dist-pkg/ui/panel-widgets.d.ts +150 -0
  343. package/dist-pkg/ui/panel-widgets.js +294 -0
  344. package/dist-pkg/ui/pause-buttons.d.ts +35 -0
  345. package/dist-pkg/ui/pause-buttons.js +66 -0
  346. package/dist-pkg/ui/pause-icons.d.ts +261 -347
  347. package/dist-pkg/ui/pause-icons.js +671 -601
  348. package/dist-pkg/ui/pause-markup.d.ts +86 -0
  349. package/dist-pkg/ui/pause-markup.js +125 -0
  350. package/dist-pkg/ui/reach-notice.d.ts +22 -23
  351. package/dist-pkg/ui/reach-notice.js +55 -58
  352. package/dist-pkg/ui/scan-overlay.d.ts +23 -0
  353. package/dist-pkg/ui/scan-overlay.js +50 -0
  354. package/dist-pkg/ui/screen-text.d.ts +25 -0
  355. package/dist-pkg/ui/screen-text.js +152 -0
  356. package/dist-pkg/ui/session-clock.d.ts +32 -0
  357. package/dist-pkg/ui/session-clock.js +67 -0
  358. package/dist-pkg/ui/settings-aac.d.ts +70 -0
  359. package/dist-pkg/ui/settings-aac.js +208 -0
  360. package/dist-pkg/ui/settings-audio.d.ts +97 -114
  361. package/dist-pkg/ui/settings-audio.js +493 -425
  362. package/dist-pkg/ui/settings-controls.d.ts +53 -96
  363. package/dist-pkg/ui/settings-controls.js +143 -215
  364. package/dist-pkg/ui/settings-empathy.d.ts +39 -30
  365. package/dist-pkg/ui/settings-empathy.js +53 -60
  366. package/dist-pkg/ui/settings-mobility.d.ts +192 -0
  367. package/dist-pkg/ui/settings-mobility.js +332 -0
  368. package/dist-pkg/ui/settings-motion.d.ts +91 -70
  369. package/dist-pkg/ui/settings-motion.js +287 -198
  370. package/dist-pkg/ui/settings-panel.d.ts +58 -45
  371. package/dist-pkg/ui/settings-panel.js +189 -94
  372. package/dist-pkg/ui/settings-typo.d.ts +29 -78
  373. package/dist-pkg/ui/settings-typo.js +158 -129
  374. package/dist-pkg/ui/settings-visual.d.ts +29 -87
  375. package/dist-pkg/ui/settings-visual.js +240 -193
  376. package/dist-pkg/ui/shell.d.ts +112 -135
  377. package/dist-pkg/ui/shell.js +148 -217
  378. package/dist-pkg/ui/simulation-list.d.ts +27 -0
  379. package/dist-pkg/ui/simulation-list.js +76 -0
  380. package/dist-pkg/ui/simulation-over-the-world.d.ts +23 -0
  381. package/dist-pkg/ui/simulation-over-the-world.js +131 -0
  382. package/dist-pkg/ui/simulation-refusal.d.ts +5 -31
  383. package/dist-pkg/ui/simulation-refusal.js +8 -56
  384. package/dist-pkg/ui/switchable-control.d.ts +11 -0
  385. package/dist-pkg/ui/switchable-control.js +19 -0
  386. package/dist-pkg/ui/title.d.ts +3 -12
  387. package/dist-pkg/ui/title.js +49 -18
  388. package/dist-pkg/ui/top-band.d.ts +26 -0
  389. package/dist-pkg/ui/top-band.js +96 -0
  390. package/dist-pkg/ui/typo-choices.d.ts +71 -0
  391. package/dist-pkg/ui/typo-choices.js +85 -0
  392. package/dist-pkg/ui/visual-axes-panel.d.ts +11 -47
  393. package/dist-pkg/ui/visual-axes-panel.js +12 -94
  394. package/dist-pkg/ui/visual-choices.d.ts +77 -0
  395. package/dist-pkg/ui/visual-choices.js +107 -0
  396. package/dist-pkg/ui/vlibras.d.ts +77 -10
  397. package/dist-pkg/ui/vlibras.js +130 -81
  398. package/dist-pkg/ui/voice-control.d.ts +68 -0
  399. package/dist-pkg/ui/voice-control.js +276 -0
  400. package/dist-pkg/ui/voice-settings.d.ts +95 -0
  401. package/dist-pkg/ui/voice-settings.js +352 -0
  402. package/dist-pkg/ui/where-the-child-is.d.ts +31 -0
  403. package/dist-pkg/ui/where-the-child-is.js +70 -0
  404. package/docs/CREDITS.md +300 -44
  405. package/docs/LICENSES.md +189 -145
  406. package/package.json +51 -27
  407. package/scripts/check-cartridge.mjs +78 -0
  408. package/scripts/game-build.d.mts +25 -0
  409. package/scripts/game-build.mjs +144 -0
  410. package/scripts/heavy-into-the-delivery.mjs +388 -0
  411. package/scripts/libras-avatar.json +680 -0
  412. package/scripts/libras-avatar.mjs +246 -0
  413. package/scripts/libras-glosses/gloss.py +95 -0
  414. package/scripts/libras-glosses/pyproject.toml +32 -0
  415. package/scripts/libras-glosses/uv.lock +781 -0
  416. package/scripts/libras-glosses.mjs +351 -0
  417. package/scripts/licences/Apache-2.0.txt +176 -0
  418. package/scripts/licences/GPL-3.0.txt +674 -0
  419. package/scripts/licences/MIT.txt +17 -0
  420. package/scripts/licences/OFL-1.1.txt +86 -0
  421. package/scripts/licences/UFL-1.0.txt +96 -0
  422. package/scripts/licences/fonts.mjs +389 -0
  423. package/scripts/licences/third-party.mjs +301 -0
  424. package/scripts/licences/vosk-browser.NOTICE.txt +268 -0
  425. package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
  426. package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
  427. package/app/public/vendor/fonts/fondamento-400-ext.woff2 +0 -0
  428. package/app/public/vendor/fonts/fondamento-400.woff2 +0 -0
  429. package/app/public/vendor/fonts/inter-400.woff2 +0 -0
  430. package/app/public/vendor/fonts/inter-700.woff2 +0 -0
  431. package/app/public/vendor/fonts/lato-400.woff2 +0 -0
  432. package/app/public/vendor/fonts/lato-700.woff2 +0 -0
  433. package/app/public/vendor/fonts/literata-400.woff2 +0 -0
  434. package/app/public/vendor/fonts/literata-700.woff2 +0 -0
  435. package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
  436. package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
  437. package/app/public/vendor/fonts/opendyslexic-400.woff2 +0 -0
  438. package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
  439. package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
  440. package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
  441. package/app/public/vendor/fonts/pressstart-400.woff2 +0 -0
  442. package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
  443. package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
  444. package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
  445. package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
  446. package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
  447. package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
  448. package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
  449. package/dist-pkg/core/anel.d.ts +0 -17
  450. package/dist-pkg/core/anel.js +0 -31
  451. package/dist-pkg/core/collision.d.ts +0 -21
  452. package/dist-pkg/core/collision.js +0 -62
  453. package/dist-pkg/core/layers.d.ts +0 -63
  454. package/dist-pkg/core/layers.js +0 -95
  455. package/dist-pkg/core/letter-grid.d.ts +0 -55
  456. package/dist-pkg/core/letter-grid.js +0 -116
  457. package/dist-pkg/core/password.d.ts +0 -34
  458. package/dist-pkg/core/password.js +0 -205
  459. package/dist-pkg/core/rotulo-acessivel.d.ts +0 -17
  460. package/dist-pkg/core/rotulo-acessivel.js +0 -41
  461. package/dist-pkg/core/run-state.d.ts +0 -115
  462. package/dist-pkg/core/run-state.js +0 -40
  463. package/dist-pkg/core/tiles.d.ts +0 -12
  464. package/dist-pkg/core/tiles.js +0 -61
  465. package/dist-pkg/core/world.d.ts +0 -4
  466. package/dist-pkg/core/world.js +0 -58
  467. package/dist-pkg/input/origem-sintetica.d.ts +0 -44
  468. package/dist-pkg/input/origem-sintetica.js +0 -60
  469. package/dist-pkg/input/transporte-em-uso.d.ts +0 -101
  470. package/dist-pkg/input/transporte-em-uso.js +0 -130
  471. package/dist-pkg/platform/audio-nav.d.ts +0 -51
  472. package/dist-pkg/platform/audio-nav.js +0 -99
  473. package/dist-pkg/platform/guide-intensity.d.ts +0 -40
  474. package/dist-pkg/platform/guide-intensity.js +0 -73
  475. package/dist-pkg/platform/pesados-catalogo.d.ts +0 -14
  476. package/dist-pkg/platform/pesados-catalogo.js +0 -177
  477. package/dist-pkg/platform/pesados.d.ts +0 -31
  478. package/dist-pkg/platform/pesados.js +0 -75
  479. package/dist-pkg/platform/vozes-prontas.d.ts +0 -28
  480. package/dist-pkg/platform/vozes-prontas.js +0 -61
  481. package/dist-pkg/render/camera.d.ts +0 -58
  482. package/dist-pkg/render/camera.js +0 -105
  483. package/dist-pkg/render/cenario-data.d.ts +0 -127
  484. package/dist-pkg/render/cenario-data.js +0 -145
  485. package/dist-pkg/render/city-tex.d.ts +0 -63
  486. package/dist-pkg/render/city-tex.js +0 -228
  487. package/dist-pkg/render/city-tiles.d.ts +0 -11
  488. package/dist-pkg/render/city-tiles.js +0 -140
  489. package/dist-pkg/render/draw.d.ts +0 -149
  490. package/dist-pkg/render/draw.js +0 -231
  491. package/dist-pkg/render/fx.d.ts +0 -63
  492. package/dist-pkg/render/fx.js +0 -123
  493. package/dist-pkg/render/minimap.d.ts +0 -11
  494. package/dist-pkg/render/minimap.js +0 -94
  495. package/dist-pkg/render/parallax.d.ts +0 -85
  496. package/dist-pkg/render/parallax.js +0 -158
  497. package/dist-pkg/render/player-anim.d.ts +0 -71
  498. package/dist-pkg/render/player-anim.js +0 -152
  499. package/dist-pkg/render/recycling-tex.d.ts +0 -48
  500. package/dist-pkg/render/recycling-tex.js +0 -164
  501. package/dist-pkg/render/scene-city.d.ts +0 -77
  502. package/dist-pkg/render/scene-city.js +0 -181
  503. package/dist-pkg/render/scene-parallax.d.ts +0 -72
  504. package/dist-pkg/render/scene-parallax.js +0 -426
  505. package/dist-pkg/render/scene-sky.d.ts +0 -126
  506. package/dist-pkg/render/scene-sky.js +0 -295
  507. package/dist-pkg/render/set-cenario.d.ts +0 -54
  508. package/dist-pkg/render/set-cenario.js +0 -103
  509. package/dist-pkg/render/textures.d.ts +0 -75
  510. package/dist-pkg/render/textures.js +0 -240
  511. package/dist-pkg/render/title-scene.d.ts +0 -46
  512. package/dist-pkg/render/title-scene.js +0 -75
  513. package/dist-pkg/render/weather.d.ts +0 -96
  514. package/dist-pkg/render/weather.js +0 -171
  515. package/dist-pkg/render/wheelchair-sprites.d.ts +0 -32
  516. package/dist-pkg/render/wheelchair-sprites.js +0 -69
  517. package/dist-pkg/render/world-tex.d.ts +0 -18
  518. package/dist-pkg/render/world-tex.js +0 -87
  519. package/dist-pkg/ui/activities-menu.d.ts +0 -258
  520. package/dist-pkg/ui/activities-menu.js +0 -648
  521. package/dist-pkg/ui/caa-sets.d.ts +0 -39
  522. package/dist-pkg/ui/caa-sets.js +0 -65
  523. package/dist-pkg/ui/latch-refusal.d.ts +0 -32
  524. package/dist-pkg/ui/latch-refusal.js +0 -60
  525. package/dist-pkg/ui/map-hub.d.ts +0 -56
  526. package/dist-pkg/ui/map-hub.js +0 -138
  527. package/dist-pkg/ui/settings-caa.d.ts +0 -45
  528. package/dist-pkg/ui/settings-caa.js +0 -137
  529. package/dist-pkg/ui/settings-motor.d.ts +0 -175
  530. package/dist-pkg/ui/settings-motor.js +0 -342
  531. package/dist-pkg/ui/webcam.d.ts +0 -7
  532. package/dist-pkg/ui/webcam.js +0 -93
@@ -0,0 +1,107 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ /**
3
+ * The devices a child plays through. Closed: a new transport has to decide its rule here.
4
+ *
5
+ * The values stay Portuguese because they are stored — `latch-scope.latchKey` puts the transport name in the
6
+ * key — and renaming a stored value loses what the child saved.
7
+ */
8
+ export type TransportName = 'teclado' | 'gamepad' | 'toque' | 'olhos' | 'rosto' | 'gestos' | 'fala';
9
+ /**
10
+ * THE UNION AS A VALUE, because there is one place where it has to be checked at runtime.
11
+ *
12
+ * ⚠️ IT EXISTS BECAUSE OF A BOUNDARY, and that is the only reason that justifies it: `input/synthetic-source`
13
+ * reads the transport from an EXPANDO hung on a `KeyboardEvent` — an object this code did not build and that
14
+ * any script on the page can build. A value crossing that boundary is not a `TransportName` because TypeScript
15
+ * says so; it is a `string` until someone checks it. Without the list, `'olho'` would enter the origin map as a
16
+ * phantom transport, and nothing would say so.
17
+ *
18
+ * 📌 This is not the list-beside-the-union defect this repository has already undone three times (`RM_KEYS`,
19
+ * the reduced-motion labels, the storage keys), because the guard below belongs to the COMPILER: the two cannot
20
+ * diverge. A copy that cannot diverge is a projection, not a second source.
21
+ */
22
+ export declare const TRANSPORT_NAMES: readonly ["teclado", "gamepad", "toque", "olhos", "rosto", "gestos", "fala"];
23
+ /**
24
+ * Is this thing that came from outside really a transport?
25
+ *
26
+ * ⚠️ The question is not about security — every script on this page is ours, and whoever wanted to lie would
27
+ * use a VALID value. It is about correctness: it keeps a wrong or missing stamp from becoming a silent entry in
28
+ * `keySource`, the structure the whole latch depends on.
29
+ */
30
+ export declare function isTransportName(v: unknown): v is TransportName;
31
+ /**
32
+ * THE FOUR THAT REQUIRE EXPLICIT ENABLING and, once enabled, rule over all the others (rule 4).
33
+ *
34
+ * ⚠️ It is the same list as `ONE_COMMAND_AT_A_TIME` in `input/latch-scope`, and the match is no accident: these
35
+ * are the transports that send one command at a time. What ADR-0109 added — that enabling them turns latching on
36
+ * for the rest — is the model of `latchNow`, which ADR-0113 superseded; since ADR-0249 their own latch starts as
37
+ * the game's `holdsKeys()` and the child may change it.
38
+ */
39
+ export declare const NEED_ENABLING: ReadonlySet<TransportName>;
40
+ /** The transport that turns latching on by itself, with no priority involved (rule 2). */
41
+ export declare const LATCH_OF_THEIR_OWN: ReadonlySet<TransportName>;
42
+ export interface InputState {
43
+ /** Which device this player is using NOW. */
44
+ readonly inUse: TransportName;
45
+ /**
46
+ * Was the camera/microphone enabled? ⚠️ Once `true`, it NEVER goes back to `false` through an edge — only an
47
+ * explicit decision turns it off, and ADR-0109 §4 says the child does not own that decision. See
48
+ * `disableAssisted`.
49
+ */
50
+ readonly assistedOn: boolean;
51
+ }
52
+ /**
53
+ * THE INITIAL STATE: keyboard, without latching.
54
+ *
55
+ * ⚠️ Rule 1 says "pad AND keyboard, both without latching", and that is why the default can name just one
56
+ * without lying: between the two, the answer to the only question this module asks — is latching on? — is the
57
+ * SAME. `inUse` only starts telling them apart when someone wants to SHOW the current device, which is another
58
+ * question, and ADR-0109 explicitly leaves it undecided.
59
+ */
60
+ export declare const DEFAULT_INPUT_STATE: InputState;
61
+ /**
62
+ * IS LATCHING ON NOW? — ⚠️ **DO NOT ASK THIS FUNCTION.** See the paragraph below.
63
+ *
64
+ * ⚠️ The assisted priority comes FIRST, and the order is the whole of rule 4: while it is on, no other device
65
+ * turns latching off — not even the keyboard, which otherwise would. Swapping these two lines is the defect that
66
+ * would lock a child out of their own game, and it is silent.
67
+ *
68
+ * @deprecated 🔴 **THIS FUNCTION IMPLEMENTS THE MODEL ADR-0113 SUPERSEDED**, and stays exported because it is
69
+ * published surface (`./input/*.js`) and because the record has historical value — not because it is the answer.
70
+ *
71
+ * ADR-0109 decided latching **by device alone**: assisted on → yes; touch → yes; everything else → no. ADR-0113
72
+ * withdrew that clause, with the Dev's reason: latching is a **caps lock stored with the controller's mapping**,
73
+ * and the value the child saved counts.
74
+ *
75
+ * 🔴 THE DIVERGENCE HAS A CONCRETE CHILD, and it is the one who prompted the record: someone with a motor
76
+ * difficulty who plays on the KEYBOARD and saved latching on. This function returns `false` for them —
77
+ * `teclado` is not in `LATCH_OF_THEIR_OWN` — and that is exactly the control they would lose.
78
+ * `latch-scope.latchOf` returns `true`, because it reads what they saved.
79
+ *
80
+ * ⚠️ AND THE TOUCH CLAUSE FELL TOO: under ADR-0113 touch is a transport like the others — its value is a choice
81
+ * and is stored. Eyes, face, gestures and speech differ only in where their DEFAULT comes from — the game's
82
+ * `holdsKeys()` (ADR-0249, `latch-scope.latchDefaultFromGame`) — and their value is a choice too.
83
+ *
84
+ * **The right answer is `latch-scope.latchOf(inputState.inUse, reading)`.** The role left to this module is
85
+ * what its name says: WHICH transport is in use — which is what feeds that first argument.
86
+ * `tests/latching-per-transport.node.test.js` asserts this function still has no consumer.
87
+ */
88
+ export declare function latchNow(inputState: InputState): boolean;
89
+ /**
90
+ * AN EDGE ARRIVED, with its origin. Returns the NEW state.
91
+ *
92
+ * ⚠️ An edge from an assisted transport does NOT enable it. Enabling is an explicit act (rule 4: they "have to
93
+ * be enabled"), and letting an edge do it would mean a webcam false positive — a shadow, a second face passing
94
+ * by — locked latching on for everyone without anyone asking.
95
+ */
96
+ export declare function afterEdge(inputState: InputState, origin: TransportName): InputState;
97
+ /** The child (or whoever is with them) enabled the camera/microphone. From here on, latching is law. */
98
+ export declare function enableAssisted(inputState: InputState): InputState;
99
+ /**
100
+ * DISABLE the assisted transports. It exists, and ADR-0109 says whose it is: NOT the child's during a match.
101
+ *
102
+ * ⚠️ It stays exported because turning the camera off has to be possible somewhere — switching users, closing
103
+ * the game, an adult reconfiguring. What §4 forbids is offering it as a button beside the game. A function that
104
+ * exists and is not offered differs from a function that does not exist: the first says where the decision
105
+ * lives.
106
+ */
107
+ export declare function disableAssisted(inputState: InputState): InputState;
@@ -0,0 +1,130 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ // input/transport-in-use — THE LATCH FOLLOWS THE DEVICE IN USE (ADR-0109), the pure half.
3
+ //
4
+ // ========================= WHAT THIS MODULE IS =========================
5
+ // The automaton of ADR-0109 §1's four rules, with no DOM, no storage and no events. It takes EDGES with their
6
+ // origin and returns state; whoever asks "is latching on now?" asks the state.
7
+ //
8
+ // 1. By default, pad and keyboard, both WITHOUT latching.
9
+ // 2. A mouse click or a touch on the screen → on-screen controls WITH latching.
10
+ // 3. Pressing a key returns the keyboard WITHOUT latching; using the pad does the same.
11
+ // 4. Camera and microphone have to be enabled; once enabled, they turn latching on for ALL the other
12
+ // controls, with NO way to turn it off. They take priority.
13
+ //
14
+ // ⚠️ WHY THIS IS AN AUTOMATON AND NOT A STORED VALUE — and it is what ADR-0109 supersedes of ADR-0104 §C.
15
+ // Latching was a CHOICE stored per transport, and issue #114 measured that its wiring could not be written: the
16
+ // edge's origin is erased at the door (`input/state.keys` is a `Set<string>` of CODES, and touch and the webcam
17
+ // write into it). The Dev decided the BEHAVIOUR, and the behaviour picks the mechanism.
18
+ //
19
+ // ⚠️ AND RULE 3 IS WHY IT TAKES TWO THINGS, not one. "Pressing a key returns the keyboard without latching" is
20
+ // TWO facts: an EVENT whose origin must be known, and a MODE that persists until the next switch. An edge keeps
21
+ // no state; a stored mode does not detect its own switch. Neither half expresses the rule; together they do.
22
+ // This file is the second half — the MODE.
23
+ //
24
+ // 📌 The Dev's image, kept because it says the thing: it is a CAPS LOCK ON A KEYBOARD WITH MEMORY. A mode and
25
+ // not a momentary state; remembered per device; switching devices does not erase what the other remembers.
26
+ /**
27
+ * THE UNION AS A VALUE, because there is one place where it has to be checked at runtime.
28
+ *
29
+ * ⚠️ IT EXISTS BECAUSE OF A BOUNDARY, and that is the only reason that justifies it: `input/synthetic-source`
30
+ * reads the transport from an EXPANDO hung on a `KeyboardEvent` — an object this code did not build and that
31
+ * any script on the page can build. A value crossing that boundary is not a `TransportName` because TypeScript
32
+ * says so; it is a `string` until someone checks it. Without the list, `'olho'` would enter the origin map as a
33
+ * phantom transport, and nothing would say so.
34
+ *
35
+ * 📌 This is not the list-beside-the-union defect this repository has already undone three times (`RM_KEYS`,
36
+ * the reduced-motion labels, the storage keys), because the guard below belongs to the COMPILER: the two cannot
37
+ * diverge. A copy that cannot diverge is a projection, not a second source.
38
+ */
39
+ export const TRANSPORT_NAMES = ['teclado', 'gamepad', 'toque', 'olhos', 'rosto', 'gestos', 'fala'];
40
+ const _COVERS_THE_TRANSPORTS = true;
41
+ void _COVERS_THE_TRANSPORTS;
42
+ /**
43
+ * Is this thing that came from outside really a transport?
44
+ *
45
+ * ⚠️ The question is not about security — every script on this page is ours, and whoever wanted to lie would
46
+ * use a VALID value. It is about correctness: it keeps a wrong or missing stamp from becoming a silent entry in
47
+ * `keySource`, the structure the whole latch depends on.
48
+ */
49
+ export function isTransportName(v) {
50
+ return typeof v === 'string' && TRANSPORT_NAMES.includes(v);
51
+ }
52
+ /**
53
+ * THE FOUR THAT REQUIRE EXPLICIT ENABLING and, once enabled, rule over all the others (rule 4).
54
+ *
55
+ * ⚠️ It is the same list as `ONE_COMMAND_AT_A_TIME` in `input/latch-scope`, and the match is no accident: these
56
+ * are the transports that send one command at a time. What ADR-0109 added — that enabling them turns latching on
57
+ * for the rest — is the model of `latchNow`, which ADR-0113 superseded; since ADR-0249 their own latch starts as
58
+ * the game's `holdsKeys()` and the child may change it.
59
+ */
60
+ export const NEED_ENABLING = new Set(['olhos', 'rosto', 'gestos', 'fala']);
61
+ /** The transport that turns latching on by itself, with no priority involved (rule 2). */
62
+ export const LATCH_OF_THEIR_OWN = new Set(['toque']);
63
+ /**
64
+ * THE INITIAL STATE: keyboard, without latching.
65
+ *
66
+ * ⚠️ Rule 1 says "pad AND keyboard, both without latching", and that is why the default can name just one
67
+ * without lying: between the two, the answer to the only question this module asks — is latching on? — is the
68
+ * SAME. `inUse` only starts telling them apart when someone wants to SHOW the current device, which is another
69
+ * question, and ADR-0109 explicitly leaves it undecided.
70
+ */
71
+ export const DEFAULT_INPUT_STATE = Object.freeze({ inUse: 'teclado', assistedOn: false });
72
+ /**
73
+ * IS LATCHING ON NOW? — ⚠️ **DO NOT ASK THIS FUNCTION.** See the paragraph below.
74
+ *
75
+ * ⚠️ The assisted priority comes FIRST, and the order is the whole of rule 4: while it is on, no other device
76
+ * turns latching off — not even the keyboard, which otherwise would. Swapping these two lines is the defect that
77
+ * would lock a child out of their own game, and it is silent.
78
+ *
79
+ * @deprecated 🔴 **THIS FUNCTION IMPLEMENTS THE MODEL ADR-0113 SUPERSEDED**, and stays exported because it is
80
+ * published surface (`./input/*.js`) and because the record has historical value — not because it is the answer.
81
+ *
82
+ * ADR-0109 decided latching **by device alone**: assisted on → yes; touch → yes; everything else → no. ADR-0113
83
+ * withdrew that clause, with the Dev's reason: latching is a **caps lock stored with the controller's mapping**,
84
+ * and the value the child saved counts.
85
+ *
86
+ * 🔴 THE DIVERGENCE HAS A CONCRETE CHILD, and it is the one who prompted the record: someone with a motor
87
+ * difficulty who plays on the KEYBOARD and saved latching on. This function returns `false` for them —
88
+ * `teclado` is not in `LATCH_OF_THEIR_OWN` — and that is exactly the control they would lose.
89
+ * `latch-scope.latchOf` returns `true`, because it reads what they saved.
90
+ *
91
+ * ⚠️ AND THE TOUCH CLAUSE FELL TOO: under ADR-0113 touch is a transport like the others — its value is a choice
92
+ * and is stored. Eyes, face, gestures and speech differ only in where their DEFAULT comes from — the game's
93
+ * `holdsKeys()` (ADR-0249, `latch-scope.latchDefaultFromGame`) — and their value is a choice too.
94
+ *
95
+ * **The right answer is `latch-scope.latchOf(inputState.inUse, reading)`.** The role left to this module is
96
+ * what its name says: WHICH transport is in use — which is what feeds that first argument.
97
+ * `tests/latching-per-transport.node.test.js` asserts this function still has no consumer.
98
+ */
99
+ export function latchNow(inputState) {
100
+ if (inputState.assistedOn)
101
+ return true;
102
+ return LATCH_OF_THEIR_OWN.has(inputState.inUse);
103
+ }
104
+ /**
105
+ * AN EDGE ARRIVED, with its origin. Returns the NEW state.
106
+ *
107
+ * ⚠️ An edge from an assisted transport does NOT enable it. Enabling is an explicit act (rule 4: they "have to
108
+ * be enabled"), and letting an edge do it would mean a webcam false positive — a shadow, a second face passing
109
+ * by — locked latching on for everyone without anyone asking.
110
+ */
111
+ export function afterEdge(inputState, origin) {
112
+ if (inputState.inUse === origin)
113
+ return inputState; // no change: returns the SAME object, not a copy
114
+ return { inUse: origin, assistedOn: inputState.assistedOn };
115
+ }
116
+ /** The child (or whoever is with them) enabled the camera/microphone. From here on, latching is law. */
117
+ export function enableAssisted(inputState) {
118
+ return inputState.assistedOn ? inputState : { inUse: inputState.inUse, assistedOn: true };
119
+ }
120
+ /**
121
+ * DISABLE the assisted transports. It exists, and ADR-0109 says whose it is: NOT the child's during a match.
122
+ *
123
+ * ⚠️ It stays exported because turning the camera off has to be possible somewhere — switching users, closing
124
+ * the game, an adult reconfiguring. What §4 forbids is offering it as a button beside the game. A function that
125
+ * exists and is not offered differs from a function that does not exist: the first says where the decision
126
+ * lives.
127
+ */
128
+ export function disableAssisted(inputState) {
129
+ return inputState.assistedOn ? { inUse: inputState.inUse, assistedOn: false } : inputState;
130
+ }
@@ -1,176 +1,149 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  import { type Action } from '../core/actions.js';
3
3
  /**
4
- * QUANTOS LUGARES CADA TRANSPORTE REAL TEM, e de onde cada número vem. Estavam medidos e viviam só no teste;
5
- * um número que só existe num teste não chega a criança nenhuma.
4
+ * HOW MANY PLACES EACH REAL TRANSPORT HAS, and where each number comes from. They were measured and lived only in
5
+ * the test; a number that exists only in a test reaches no child.
6
6
  *
7
- * · `gamepad: 17` — a Gamepad API «standard» declara dezassete botões. Não é escolha nossa.
8
- * · `toque: 9` — `TOUCH_DEFAULT` (input/devices) nomeia nove slots, e são nove desde sempre.
9
- * · `teclado: ACTIONS.length` — ⚠️ e este é o que precisou de decisão.
7
+ * · `gamepad: 17` — the Gamepad API's "standard" mapping declares seventeen buttons. Not our choice.
8
+ * · `toque: 13` — `TOUCH_DEFAULT` (input/devices) names thirteen slots: the nine plus ADR-0160's four shoulders.
9
+ * · `teclado: ACTIONS.length` — ⚠️ and this is the one that needed a decision.
10
10
  *
11
- * ⚠️ O NÚMERO DO TECLADO NÃO É O NÚMERO DE TECLAS, e também não é o número de ligações do esquema atual. Não
12
- * é o de teclas porque cem teclas não são cem lugares que uma criança encontra e lembra; não é o do esquema
13
- * porque o esquema cresce, e o limite passaria a ser a configuração e não o aparelho.
11
+ * ⚠️ THE KEYBOARD'S NUMBER IS NOT THE NUMBER OF KEYS, nor the number of bindings in the current scheme. Not the keys,
12
+ * because a hundred keys are not a hundred places a child finds and remembers; not the scheme, because the scheme
13
+ * grows, and the limit would become the configuration instead of the device.
14
14
  *
15
- * É `ACTIONS.length` porque o que limita um teclado, na prática deste produto, é O VOCABULÁRIO QUE A ENGINE
16
- * SABE NOMEAR: um transporte que cobre todas as posições que existem não tem como ser o curto. Derivado e não
17
- * escrito à mão de propósito — quando o vocabulário crescer (foi de nove para catorze em 2026-09-06), este
18
- * número cresce com ele e nunca passa a mentir.
15
+ * It is `ACTIONS.length` because what limits a keyboard, in this product's practice, is THE VOCABULARY THE ENGINE
16
+ * CAN NAME: a transport that covers every position that exists cannot be the short one. Derived and not written by
17
+ * hand on purpose — when the vocabulary grows (it went from nine to fourteen), this number grows with it and never
18
+ * starts lying.
19
19
  */
20
- export declare const LUGARES: Readonly<{
20
+ export declare const SLOTS: Readonly<{
21
21
  gamepad: 17;
22
- toque: 9;
22
+ toque: 13;
23
23
  teclado: 14;
24
24
  }>;
25
- /**
26
- * QUANTAS POSIÇÕES O CONTROLE DE TELA SEGURA AO MESMO TEMPO. Dois, e é uma DECLARAÇÃO (ADR-0104 §B).
27
- *
28
- * ⚠️ E A DECISÃO É NÃO PERGUNTAR AO APARELHO. O `navigator.maxTouchPoints` existe, responde depressa, e
29
- * MENTE — mente para cima: muitos aparelhos anunciam cinco e reconhecem dois. Um modelo assente nele falha
30
- * exactamente no telemóvel barato da escola pública, que é o pilar 1 deste projeto, e falha em silêncio: a
31
- * criança tenta correr e pular ao mesmo tempo, não acontece nada, e ela conclui que o jogo está partido.
32
- *
33
- * Um piso declarado não pode errar para cima. Ele erra para baixo — um aparelho que segurava três fica
34
- * servido por dois —, e esse erro tem conserto: a opção do terceiro botão, PROVADA POR TESTE, porque um
35
- * gesto real é a única evidência que um aparelho não consegue falsificar. Nada é recusado e nada é assumido.
36
- *
37
- * ⚠️ NÃO É UM REGISTO DE TETOS POR TRANSPORTE, e o ADR diz isso em `more-information`: só o toque tem número
38
- * declarado. O `holds` do `Transport` é opcional justamente por isso — ausente significa «não há tecto
39
- * conhecido», não «segura uma». Um registo de tetos para teclado e controle é uma mudança maior, e nada
40
- * precisa dela hoje.
41
- */
42
- export declare const SEGURA_TOQUE = 2;
43
- /** Como se descobre que cada transporte está aqui AGORA. Injetado: nenhuma destas perguntas é pura. */
44
- export interface Disponibilidade {
25
+ /** How each transport is found to be here NOW. Injected: none of these questions is pure. */
26
+ export interface Availability {
45
27
  gamepad: () => boolean;
46
- toque: () => boolean;
47
- teclado: () => boolean;
28
+ touch: () => boolean;
29
+ keyboard: () => boolean;
48
30
  /**
49
- * Há um RATO aqui? (ADR-0112)
31
+ * Is there a MOUSE here? (ADR-0112)
50
32
  *
51
- * ⚠️ ELE NÃO É UM TRANSPORTE À PARTE, e é por isso que entra como uma pergunta e não como uma quarta linha
52
- * do `transportesPadrao`: um rato sozinho não carrega as catorze posições. Ele é o SINAL CONTÍNUO ao lado
53
- * do teclado — a frase do Dev, «no caso do teclado, o sinal contínuo passa a ser o mouse» —, e é o que dá
54
- * fundação aos transportes 8 e 9 do ADR-0074, que aquele registo declarava como não tendo nenhuma.
33
+ * ⚠️ IT IS NOT A TRANSPORT OF ITS OWN, which is why it enters as a question and not as a fourth line of
34
+ * `defaultTransports`: a mouse alone does not carry the fourteen positions. It is the CONTINUOUS SIGNAL beside the
35
+ * keyboard — the Dev's sentence, «no caso do teclado, o sinal contínuo passa a ser o mouse» —, and it is what gives
36
+ * a foundation to ADR-0074's transports 8 and 9, which that record declared as having none.
55
37
  */
56
- rato: () => boolean;
38
+ mouse: () => boolean;
57
39
  }
58
40
  /**
59
- * Os três transportes que esta engine sabe oferecer hoje.
41
+ * The three transports this engine knows how to offer today.
60
42
  *
61
- * ⚠️ A DETECÇÃO DO TECLADO É IMPRECISA E ISSO É ACEITÁVEL — mas só porque a tela que consome isto INFORMA em
62
- * vez de RECUSAR. Não há API que diga «há um teclado físico ligado»; o que o projeto já usa para a mesma
63
- * pergunta é `pointer:coarse && hover:none` (o `isCoarsePointer` do `game/session`), e um tablet COM teclado
64
- * responde «toque» a isso. Se a tela barrasse, esse tablet levaria uma recusa falsa num jogo que ele joga.
65
- * Como ela apenas diz o que falta e deixa continuar, o erro custa uma frase a mais e nunca uma porta fechada.
43
+ * ⚠️ THE KEYBOARD DETECTION IS IMPRECISE AND THAT IS ACCEPTABLE — but only because the screen that consumes this
44
+ * INFORMS instead of REFUSING. No API says "a physical keyboard is plugged in"; what the root asks is
45
+ * `pointer:coarse && hover:none`, and a tablet WITH a keyboard answers "touch" to that. If the screen blocked, that
46
+ * tablet would get a false refusal in a game it plays. Since it only says what is missing and lets the child go on,
47
+ * the error costs one extra sentence and never a closed door.
66
48
  */
67
- export declare function transportesPadrao(d: Disponibilidade): Transport[];
68
- /** Um transporte, como ele se declara. Zero significado: quantos lugares, e se está aqui agora. */
49
+ export declare function defaultTransports(d: Availability): Transport[];
50
+ /** A transport, as it declares itself. Zero meaning: how many places, and whether it is here now. */
69
51
  export interface Transport {
70
- /** Identificador estável, para preferências salvas. Nunca chega a uma pessoa. */
52
+ /** A stable identifier, for saved preferences. Never reaches a person. */
71
53
  readonly id: string;
72
- /** Quantos lugares ATRIBUÍVEIS. É o número que a aritmética da garantia usa. */
54
+ /** How many ASSIGNABLE places. It is the number the guarantee's arithmetic uses. */
73
55
  readonly slots: number;
74
56
  /**
75
- * Quantas posições ele SEGURA AO MESMO TEMPO, quando isso é conhecido. Eixo diferente dos `slots`: o
76
- * controle de tela tem nove lugares e segura dois.
57
+ * How many positions it HOLDS AT ONCE, when that is known. A different axis from `slots`: the on-screen control
58
+ * has thirteen places and holds two.
77
59
  *
78
- * ⚠️ AUSENTE SIGNIFICA «NÃO HÁ TECTO CONHECIDO», e não «segura uma». Hoje só o toque declara um número
79
- * (`SEGURA_TOQUE`), porque só sobre ele há decisão — ver a nota lá. Ler a ausência como zero faria todo
80
- * transporte sem número reprovar de repente, que é o oposto do que um campo opcional deve fazer.
60
+ * ⚠️ ABSENT MEANS "NO KNOWN CEILING", not "holds one". Today only touch declares a number (`HOLDS_TOUCH`), because
61
+ * only about it is there a decision — see the note there. Reading the absence as zero would make every transport
62
+ * without a number suddenly fail, which is the opposite of what an optional field should do.
81
63
  */
82
64
  readonly holds?: number;
83
65
  /**
84
- * Está disponível NESTE aparelho, AGORA? Função e não valor: um controle é ligado no meio da partida, e
85
- * uma tela de toque aparece quando a criança gira o tablet.
66
+ * Is it available ON THIS device, NOW? A function and not a value: a pad gets plugged in mid-match, and a touch
67
+ * screen appears when the child turns the tablet.
86
68
  */
87
69
  readonly available: () => boolean;
88
70
  /**
89
- * Este transporte oferece um PONTEIRO — posição contínua (ADR-0112)?
71
+ * Does this transport offer a POINTER — a continuous position (ADR-0112)?
90
72
  *
91
- * ⚠️ FUNÇÃO E NÃO BOOLEANO, pela mesma razão escrita no `available` acima: um rato é ligado no meio da
92
- * partida, tal como um controle. Um valor fixo aqui responderia com o estado do arranque.
73
+ * ⚠️ A FUNCTION AND NOT A BOOLEAN, for the same reason written on `available` above: a mouse gets plugged in
74
+ * mid-match, just like a pad. A fixed value here would answer with the state at boot.
93
75
  *
94
- * ⚠️ AUSENTE SIGNIFICA «NÃO OFERECE», e aqui — ao contrário do `holds` — ler a ausência assim é o correcto:
95
- * o ponteiro é uma capacidade que se DECLARA, e um transporte que não a declara não a tem. O `holds` é o
96
- * oposto porque lá a ausência é «não há tecto conhecido», e lê-la como zero reprovaria todo o mundo.
76
+ * ⚠️ ABSENT MEANS "DOES NOT OFFER", and here — unlike `holds` — reading the absence that way is right: the pointer
77
+ * is a capability one DECLARES, and a transport that does not declare it does not have it. `holds` is the opposite
78
+ * because there the absence is "no known ceiling", and reading it as zero would fail everyone.
97
79
  */
98
- readonly aponta?: () => boolean;
80
+ readonly points?: () => boolean;
99
81
  }
100
- /** Este transporte carrega este conjunto de ações? Aritmética, como o ADR-0079 §3 a descreve. */
101
- export declare function carries(t: Transport, acoes: readonly Action[]): boolean;
102
- /**
103
- * Este transporte SEGURA quantas o jogo pede ao mesmo tempo? (ADR-0104 §A.)
104
- *
105
- * ⚠️ TRANSPORTE SEM TECTO DECLARADO RESPONDE SIM, e a escolha é deliberada: o `holds` ausente quer dizer «não
106
- * medimos isto», e recusar por falta de medida transformaria uma ignorância em acusação — o teclado e o
107
- * controle passariam a reprovar todos os jogos por não terem número nenhum. Onde não há decisão, o modelo
108
- * cala; é o toque que tem decisão, e é só ele que pode reprovar aqui.
109
- */
110
- export declare function holds(t: Transport, pedidas: number): boolean;
82
+ /** Does this transport carry this set of actions? Arithmetic, as ADR-0079 §3 describes it. */
83
+ export declare function carries(t: Transport, actions: readonly Action[]): boolean;
111
84
  /**
112
- * Os transportes DISPONÍVEIS que carregam este conjunto.
85
+ * The AVAILABLE transports that carry this set.
113
86
  *
114
- * ⚠️ Disponibilidade e capacidade são conferidas nesta ordem de propósito: um transporte que caberia mas não
115
- * está ligado não é resposta para uma criança que está à frente do aparelho agora.
87
+ * ⚠️ Availability and capacity are checked in this order on purpose: a transport that would fit but is not plugged
88
+ * in is no answer for a child sitting at the device now.
116
89
  */
117
- export declare function carriedBy(lista: readonly Transport[], acoes: readonly Action[]): Transport[];
90
+ export declare function carriedBy(list: readonly Transport[], actions: readonly Action[]): Transport[];
118
91
  /**
119
- * A garantia do ADR-0079 §3, como pergunta de sim ou não.
92
+ * ADR-0079 §3's guarantee, as a yes-or-no question.
120
93
  *
121
- * ⚠️ CONJUNTO VAZIO DE AÇÕES DEVOLVE `false`, e não `true` por vacuidade. Um jogo que não declara ação
122
- * nenhuma não é um jogo que qualquer transporte serve — é um jogo que ninguém consegue jogar, e
123
- * `actionSetProblems` já o reprova. Devolver `true` aqui esconderia esse defeito atrás desta função.
94
+ * ⚠️ AN EMPTY SET OF ACTIONS RETURNS `false`, not a vacuous `true`. A game that declares no action is not a game any
95
+ * transport serves — it is a game nobody can play, and `actionSetProblems` already fails it. Returning `true` here
96
+ * would hide that defect behind this function.
124
97
  */
125
- export declare function reachable(lista: readonly Transport[], acoes: readonly Action[]): boolean;
126
- /** O que a tela de seleção precisa dizer, e o que ela precisa saber para o dizer. */
127
- export interface Alcance {
98
+ export declare function reachable(list: readonly Transport[], actions: readonly Action[]): boolean;
99
+ /** What the selection screen has to say, and what it needs to know to say it. */
100
+ export interface Reach {
128
101
  /**
129
- * Verdadeiro = pelo menos um transporte disponível carrega o conjunto **e segura quantas o jogo pede ao
130
- * mesmo tempo**.
102
+ * True = at least one available transport carries the set **and holds as many as the game asks at once**.
131
103
  *
132
- * ⚠️ A SEGUNDA METADE DESTA FRASE É NOVA (ADR-0104), e é o conserto do ponto cego que ninguém tinha
133
- * nomeado: a plataforma declara nove ações, o toque tem nove lugares, o `ok` dizia sim — e correr, andar e
134
- * pular ao mesmo tempo são três dedos que um telemóvel de dois não tem. O `ok` afirmava «dá para jogar»
135
- * sobre um jogo que não dava, que é a pior coisa que este campo podia fazer.
104
+ * ⚠️ THE SECOND HALF OF THIS SENTENCE (ADR-0104) fixed a blind spot nobody had named: the platformer declared nine
105
+ * actions, touch had nine places, `ok` said yes — and running, walking and jumping at once are three fingers a
106
+ * two-touch phone does not have. `ok` claimed "playable" about a game that was not, which is the worst thing this
107
+ * field could do.
136
108
  */
137
109
  readonly ok: boolean;
138
- /** Quantas ações o jogo pede. */
139
- readonly pedidas: number;
140
- /** Quantas ele pede SEGURAR ao mesmo tempo — o segundo eixo, e o que o `holdsAtOnce` declara. */
141
- readonly seguraPedidas: number;
142
- /** Os que serviriam se estivessem ligados — a informação acionável: «ligue um controle». */
143
- readonly serviriamSeLigados: readonly string[];
144
- /** Os disponíveis que NÃO cabem, com quantos lugares têm. Para a frase dizer o número. */
145
- readonly curtos: readonly {
110
+ /** How many actions the game asks for. */
111
+ readonly asked: number;
112
+ /** How many it asks to HOLD at once — the second axis, and what `holdsAtOnce` declares. */
113
+ readonly holdsAsked: number;
114
+ /** Those that would serve if they were plugged in — the actionable information: "plug in a pad". */
115
+ readonly wouldServeIfOn: readonly string[];
116
+ /** The available ones that DO NOT fit, with how many places they have. So the sentence can say the number. */
117
+ readonly short: readonly {
146
118
  readonly id: string;
147
119
  readonly slots: number;
148
120
  }[];
149
121
  /**
150
- * Os disponíveis que CHEGAM às ações mas não seguram quantas o jogo pede de uma vez, com o tecto deles.
122
+ * The available ones that REACH the actions but do not hold as many as the game asks at once, with their ceiling.
151
123
  *
152
- * É a terceira frase do cartão da #112, e ela precisa dos dois números: «o controle de tela segura dois
153
- * botões de cada vez e este jogo pede três». Sem o tecto, a frase diria que algo falta sem dizer o quê.
124
+ * It is the third sentence of #112's card, and it needs both numbers — the on-screen control holds two buttons at
125
+ * a time and this game asks for three. Without the ceiling, the sentence would say something is missing without
126
+ * saying what.
154
127
  */
155
- readonly naoSeguram: readonly {
128
+ readonly cannotHold: readonly {
156
129
  readonly id: string;
157
130
  readonly holds: number;
158
131
  }[];
159
- /** Este jogo declarou que precisa de PONTEIRO? (ADR-0112) */
160
- readonly pedePonteiro: boolean;
132
+ /** Did this game declare that it needs a POINTER? (ADR-0112) */
133
+ readonly needsPointer: boolean;
161
134
  /**
162
- * Os disponíveis que chegam às acções E seguram quantas o jogo pede, e falham SÓ por não apontarem.
135
+ * The available ones that reach the actions AND hold as many as the game asks, and fail ONLY by not pointing.
163
136
  *
164
- * ⚠️ SÓ QUEM FALHA APENAS NISTO, pela mesma regra que o `naoSeguram` já segue: um transporte em duas listas
165
- * faria o cartão da #112 dizer dois problemas onde há um, e a criança leria dois motivos para a mesma
166
- * recusa. A lista é vazia quando o jogo não pede ponteiro — não «todos», porque nenhum falhou.
137
+ * ⚠️ ONLY THOSE THAT FAIL JUST ON THIS, by the same rule `cannotHold` follows: a transport on two lists would make
138
+ * #112's card state two problems where there is one, and the child would read two reasons for the same refusal.
139
+ * The list is empty when the game does not ask for a pointer — not "all of them", because none failed.
167
140
  */
168
- readonly naoApontam: readonly string[];
141
+ readonly cannotPoint: readonly string[];
169
142
  }
170
143
  /**
171
- * Mede o alcance ANTES de a criança começar.
144
+ * Measures the reach BEFORE the child starts.
172
145
  *
173
- * ⚠️ Devolve DADO e não texto. A frase é da interface e tem de passar por `t()`; devolver português daqui
174
- * repetiria o defeito que o `PADWIZ_STEPS` acabou de deixar de cometer.
146
+ * ⚠️ It returns DATA and not text. The sentence belongs to the interface and has to go through `t()`; returning
147
+ * prose from here would put a language in a module that has none.
175
148
  */
176
- export declare function alcance(lista: readonly Transport[], acoes: readonly Action[], seguraPedidas: number, pedePonteiro?: boolean): Alcance;
149
+ export declare function reach(list: readonly Transport[], actions: readonly Action[], askedHolds: number, wantsPointer?: boolean): Reach;