@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
@@ -1,158 +1,163 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
- // core/route — POR ONDE SE VAI ATÉ LÁ, e não só onde é lá (#84, item 1).
2
+ // core/route — WHICH WAY TO GET THERE, not only where there is (#84, item 1).
3
3
  //
4
- // ========================= O DEFEITO QUE ISTO EXISTE PARA CONSERTAR =========================
5
- // A issue #84 escreve-o em duas linhas, e elas são o módulo inteiro:
4
+ // ========================= THE DEFECT THIS EXISTS TO FIX =========================
5
+ // Without it, every cue points in a STRAIGHT LINE at the target, and a straight line goes through walls: the guide
6
+ // tells the child to walk into a solid block, and they have no way to know why.
6
7
  //
7
- // «Sem isso, qualquer pista aponta em LINHA RETA para o alvo, e a linha reta atravessa parede: hoje
8
- // `alvoMaisProximo()` mede distância pela métrica declarada e `panFor()` só compara `x`, então o guia
9
- // manda a criança andar para dentro de um bloco sólido e ela não tem como saber por quê.»
8
+ // ⚠️ AND THEY REALLY HAVE NO WAY TO KNOW. A child who can see ignores an arrow pointing at a wall without noticing they
9
+ // ignored it. A child who depends on the cue does what it says — and then does it again, because the cue keeps saying
10
+ // the same. A wrong cue is worse than none: no cue at least lets them explore.
10
11
  //
11
- // ⚠️ E ELA NÃO TEM MESMO COMO SABER. Uma criança que vê ignora uma seta que aponta para uma parede sem sequer
12
- // reparar que a ignorou. Quem depende da pista faz o que ela diz — e depois faz outra vez, porque a pista
13
- // continua a dizer o mesmo. A pista errada é pior do que pista nenhuma: pista nenhuma deixa-a explorar.
12
+ // ========================= WHAT "CROSSABLE" IS, AND WHY IT IS NOT MY INVENTION =========================
13
+ // #84 asks for "the directions where there is AIR OR WATER". Those two words are already in the contract, and each
14
+ // `Role` says of itself whether it can be crossed — the set below is a READING of `core/contract`, not a new decision:
14
15
  //
15
- // ========================= O QUE É «ATRAVESSÁVEL», E POR QUE NÃO É INVENÇÃO MINHA =========================
16
- // A #84 pede «as direções por onde há AR OU ÁGUA». Essas duas palavras já estão no contrato, e cada `Role`
17
- // diz de si mesmo se se atravessa — o conjunto abaixo é uma LEITURA do `core/contract`, não uma decisão nova:
16
+ // free crossable, with no meaning of its own → the air
17
+ // water crossed by swimming → the water
18
+ // climb height changes by interacting with it → the ladder: it is BY it that one climbs
19
+ // key satisfies a gate → an object lying there, not a barrier
20
+ // structure scenery: floor, wall, what holds things up → NO
21
+ // gate bars until a condition → NO: barring is what it does
22
+ // hazard hurts on contact → NO, and it is the only one I chose
23
+ // goal what the round asks for → a case apart, see `targets` below
18
24
  //
19
- // free «atravessável e sem significado próprio» → o ar
20
- // water «atravessa-se nadando» → a água
21
- // climb «muda-se de altura interagindo com isto» → a escada: é POR ELA que se sobe
22
- // key «satisfaz um gate» → um objeto pousado, não uma barreira
23
- // structure «cenário: chão, parede, o que sustenta» → NÃO
24
- // gate «barra até uma condição» → NÃO: barrar é o que ele faz
25
- // hazard «machuca ao encostar» → NÃO, e é a única onde eu escolhi
26
- // goal «o que a rodada pede» → caso à parte, ver `alvo` abaixo
25
+ // ⚠️ `hazard` IS THE CHOICE, and I declare it: its metric does not say whether it can be crossed, it says what it
26
+ // costs. A route over a spike is a route that sends the child into damage. A game where the spike is a compulsory
27
+ // passage will have to say so another way; none does today.
27
28
  //
28
- // ⚠️ O `hazard` É A ESCOLHA, e declaro-a: a métrica dele não diz se se atravessa, diz o que custa. Rota que
29
- // passa por espinho é rota que manda a criança levar dano — e no modo cego e no modo cadeirante o próprio
30
- // `core/collision.isSolidType` já o trata como sólido, por decisão de acessibilidade. Encaminhar por cima
31
- // dele contradiria a camada que existe para a proteger. Um jogo em que o espinho seja passagem obrigatória
32
- // terá de dizê-lo por outro meio; hoje nenhum diz.
29
+ // ========================= THE TARGET IS ALWAYS STEPPABLE, THE PATH IS NOT =========================
30
+ // A `goal` may be declared on a cell that cannot be crossed (a flag inside a gate). Refusing to enter it would make
31
+ // the route never arrive anywhere. The rule is asymmetric on purpose: **the last step is always allowed; the ones in
32
+ // between obey the set.** It is the difference between "entering the gate" and "crossing the gate to go on".
33
33
  //
34
- // ========================= O ALVO É SEMPRE PISÁVEL, E O CAMINHO NÃO =========================
35
- // Um `goal` pode estar declarado numa célula que não se atravessa (uma bandeira dentro de um portão). Recusar
36
- // entrar nela faria a rota nunca chegar a lado nenhum. A regra é assimétrica de propósito: **o último passo é
37
- // sempre permitido; os do meio obedecem ao conjunto.** É a diferença entre «entrar no portão» e «atravessar o
38
- // portão para continuar do outro lado».
34
+ // ========================= THE BUDGET, WHICH THE CONTRACT ITSELF ASKED FOR =========================
35
+ // ⚠️ `core/contract` warns, in its section 5, that in a CONTINUOUS space the spots cannot be enumerated, and on a large
36
+ // map enumerating would cost a frame. This module cannot ignore that because it is convenient. So it has a CEILING of
37
+ // visited cells and returns `null` when it is hit. `null` means **"I cannot say"**, not "there is no path" — a caller
38
+ // has to treat both alike, which is what an honest cue does: it goes quiet.
39
39
  //
40
- // ========================= O ORÇAMENTO, QUE O PRÓPRIO CONTRATO PEDIU =========================
41
- // ⚠️ `core/contract` avisa, na sua secção 5: «num espaço CONTÍNUO não há como enumerar os pontos, e num mapa
42
- // grande enumerar seria caro por quadro». Este módulo não pode ignorar esse aviso só porque é conveniente.
43
- // Por isso tem TETO de células visitadas e devolve `null` ao estourá-lo. `null` quer dizer **«não sei»**, e
44
- // não «não há caminho» — quem chamar tem de tratar os dois iguais, que é o que uma pista honesta faz: cala-se.
45
- //
46
- // E não importa nada além do contrato: é lógica pura, aferida no project `node`.
40
+ // And it imports nothing but the contract: pure logic, measured in the `node` project.
47
41
  import { distance } from './contract.js';
48
42
  /**
49
- * Os papéis que uma rota atravessa. Leitura do `core/contract`, com o `hazard` de fora por decisão declarada
50
- * no cabeçalho — e `goal` de fora porque ele entra pela regra do último passo, não pela do meio.
43
+ * The roles a route crosses. A reading of `core/contract`, with `hazard` left out by the decision declared in the
44
+ * header — and `goal` left out because it comes in by the last-step rule, not the in-between one.
51
45
  */
52
- export const PAPEIS_ATRAVESSAVEIS = new Set(['free', 'water', 'climb', 'key']);
53
- /** Este papel deixa passar? */
54
- export function atravessavel(papel) {
55
- return PAPEIS_ATRAVESSAVEIS.has(papel);
46
+ export const WALKABLE_ROLES = new Set(['free', 'water', 'climb', 'key']);
47
+ /** Does this role let one through? */
48
+ export function isWalkable(role) {
49
+ return WALKABLE_ROLES.has(role);
56
50
  }
57
- const ORCAMENTO_PADRAO = 4096;
58
- /** Chave de um ponto na fila. Arredondada, porque no contínuo os pontos nascem de somas de `passo`. */
59
- const chave = (s, casas) => s.x.toFixed(casas) + '|' + s.y.toFixed(casas) + '|' + (s.z ?? 0).toFixed(casas);
51
+ const DEFAULT_BUDGET = 4096;
52
+ /** A spot's key in the queue. Rounded, because in continuous space spots are born from sums of `stride`. */
53
+ const key = (s, cells) => s.x.toFixed(cells) + '|' + s.y.toFixed(cells) + '|' + (s.z ?? 0).toFixed(cells);
60
54
  /**
61
- * Os deslocamentos de UM passo, na métrica declarada.
55
+ * The offsets of ONE step, in the declared metric.
62
56
  *
63
- * ⚠️ `free` (L², espaço contínuo sem passo discreto) NÃO TEM VIZINHOS — e fingir que tem é a aproximação que
64
- * este módulo faz e declara: ele anda numa GRELHA de lado `unit`, nas oito direções. A alternativa seria não
65
- * responder nada num jogo de plataforma, que é justamente o gênero da issue. Quem ler uma rota `free` está a
66
- * ler uma amostragem, não uma trajetória — e é por isso que `passos` é uma contagem de células e não uma
67
- * medida física.
57
+ * ⚠️ `free` (L², continuous space with no discrete step) HAS NO NEIGHBOURS — and pretending it does is the
58
+ * approximation this module makes and declares: it walks a GRID of side `unit`, in eight directions. The alternative
59
+ * would be answering nothing in a platform game, which is exactly the issue's genre. Whoever reads a `free` route is
60
+ * reading a sampling, not a trajectory — which is why `steps` is a count of cells and not a physical measure.
68
61
  */
69
- function vizinhos(topo, passo) {
70
- if (topo.kind === 'hotspots')
62
+ function neighbours(shape, stride) {
63
+ if (shape.kind === 'hotspots')
71
64
  return [];
72
- const dims = topo.size.length;
73
- const ortogonal = topo.move === 'orthogonal';
74
- const fora = [];
75
- const eixos = [-1, 0, 1];
76
- for (const dx of eixos)
77
- for (const dy of eixos) {
78
- for (const dz of dims > 2 ? eixos : [0]) {
65
+ const dims = shape.size.length;
66
+ const orthogonal = shape.move === 'orthogonal';
67
+ const out = [];
68
+ const axes = [-1, 0, 1];
69
+ for (const dx of axes)
70
+ for (const dy of axes) {
71
+ for (const dz of dims > 2 ? axes : [0]) {
79
72
  const n = Math.abs(dx) + Math.abs(dy) + Math.abs(dz);
80
73
  if (n === 0)
81
74
  continue;
82
- if (ortogonal && n > 1)
83
- continue; // L¹: a diagonal não existe
84
- fora.push({ x: dx * passo, y: dy * passo, z: dz * passo });
75
+ if (orthogonal && n > 1)
76
+ continue; // L¹: there is no diagonal
77
+ out.push({ x: dx * stride, y: dy * stride, z: dz * stride });
85
78
  }
86
79
  }
87
- return fora;
80
+ return out;
88
81
  }
89
- /** O ponto cabe na extensão declarada? Grade conta células 0..n−1; contínuo conta unidades 0..n. */
90
- function dentro(topo, s) {
91
- if (topo.kind === 'hotspots')
82
+ /** Does the spot fit the declared extent? A grid counts cells 0..n−1; continuous space counts units 0..n. */
83
+ function isInside(shape, s) {
84
+ if (shape.kind === 'hotspots')
92
85
  return false;
93
- const eixo = [s.x, s.y, s.z ?? 0];
94
- for (let i = 0; i < topo.size.length; i++) {
95
- const lim = topo.size[i];
96
- if (eixo[i] < 0)
86
+ const axis = [s.x, s.y, s.z ?? 0];
87
+ for (let i = 0; i < shape.size.length; i++) {
88
+ const lim = shape.size[i];
89
+ if (axis[i] < 0)
97
90
  return false;
98
- if (topo.kind === 'grid' ? eixo[i] > lim - 1 : eixo[i] > lim)
91
+ if (shape.kind === 'grid' ? axis[i] > lim - 1 : axis[i] > lim)
99
92
  return false;
100
93
  }
101
94
  return true;
102
95
  }
103
96
  /**
104
- * A rota de `de` até o mais próximo ALCANÇÁVEL dos `alvos` — largura primeiro, sobre o que se atravessa.
97
+ * The route from `de` to the nearest REACHABLE of the `targets` — breadth first, over what can be crossed.
105
98
  *
106
- * `null` quando não há alvo, quando nenhum é alcançável, quando a topologia não tem espaço (`hotspots`), ou
107
- * quando o orçamento estourou. Os quatro casos são o mesmo para quem chama: **não sei dizer por onde**.
99
+ * `null` when there is no target, when none is reachable, when the topology has no space (`hotspots`), or when the
100
+ * budget ran out. The four cases are one for the caller: **I cannot say which way**.
108
101
  *
109
- * ⚠️ «MAIS PRÓXIMO» AQUI É AO LONGO DO CAMINHO, e é a diferença inteira. Um alvo a três células em linha reta
110
- * do outro lado de uma parede está mais LONGE do que um a oito células por um corredor aberto — e é o segundo
111
- * que a criança consegue alcançar.
102
+ * ⚠️ "NEAREST" HERE IS ALONG THE PATH, and that is the whole difference. A target three cells away in a straight line
103
+ * on the other side of a wall is FARTHER than one eight cells down an open corridor — and it is the second one the
104
+ * child can reach.
112
105
  */
113
- export function rotaAte(ctx, de, alvos) {
114
- const topo = ctx.topology;
115
- if (topo.kind === 'hotspots' || alvos.length === 0)
106
+ export function routeTo(ctx, de, targets) {
107
+ const shape = ctx.topology;
108
+ if (shape.kind === 'hotspots' || targets.length === 0)
116
109
  return null;
117
- const passo = topo.kind === 'continuous' ? topo.unit : 1;
118
- if (!(passo > 0))
119
- return null; // uma unidade de zero faria a fila andar sem sair do sítio
120
- const casas = topo.kind === 'continuous' ? 4 : 0;
121
- // Chegou? Na grade é a mesma célula; no contínuo é meio passo, porque a grelha não cai em cima do alvo.
122
- const tolerancia = topo.kind === 'continuous' ? 0.5 : 0;
123
- const chegou = (s) => alvos.find((a) => distance(topo, s, a) <= tolerancia) ?? null;
124
- const alvoAqui = chegou(de);
125
- if (alvoAqui)
126
- return { proximo: de, ate: alvoAqui, passos: 0 };
127
- const saltos = vizinhos(topo, passo);
128
- const teto = ctx.orcamento ?? ORCAMENTO_PADRAO;
129
- const vistos = new Set([chave(de, casas)]);
130
- // Cada item leva o PRIMEIRO passo que o originou — é só isso que a pista precisa de saber no fim.
131
- let fila = [{ at: de, primeiro: de, passos: 0 }];
132
- while (fila.length) {
133
- const proxima = [];
134
- for (const item of fila) {
135
- for (const d of saltos) {
136
- const vizinho = { x: item.at.x + d.x, y: item.at.y + d.y, z: (item.at.z ?? 0) + (d.z ?? 0) };
137
- if (!dentro(topo, vizinho))
138
- continue;
139
- const k = chave(vizinho, casas);
140
- if (vistos.has(k))
141
- continue;
142
- vistos.add(k);
143
- if (vistos.size > teto)
144
- return null; // «não sei», e é uma resposta
145
- const primeiro = item.passos === 0 ? vizinho : item.primeiro;
146
- // O ÚLTIMO PASSO É SEMPRE PERMITIDO: um alvo pode estar declarado numa célula que não se atravessa.
147
- const alvo = chegou(vizinho);
148
- if (alvo)
149
- return { proximo: primeiro, ate: alvo, passos: item.passos + 1 };
150
- if (!atravessavel(ctx.roleAt(vizinho)))
151
- continue;
152
- proxima.push({ at: vizinho, primeiro, passos: item.passos + 1 });
153
- }
154
- }
155
- fila = proxima;
110
+ const walk = walkOf(shape);
111
+ // a unit of zero would make the queue go nowhere, and a negative one would walk exactly like a positive one
112
+ if (!(walk.step > 0))
113
+ return null;
114
+ const arrived = (s) => targets.find((a) => distance(shape, s, a) <= walk.tolerance) ?? null;
115
+ const targetHere = arrived(de);
116
+ if (targetHere)
117
+ return { next: de, reached: targetHere, steps: 0 };
118
+ const search = {
119
+ ctx, space: shape, arrived, keyDecimals: walk.keyDecimals, jumps: neighbours(shape, walk.step),
120
+ budget: ctx.budget ?? DEFAULT_BUDGET, seen: new Set([key(de, walk.keyDecimals)]),
121
+ };
122
+ let level = [{ at: de, first: de, steps: 0 }];
123
+ while (level.length) {
124
+ const next = nextLevel(search, level);
125
+ if (!Array.isArray(next))
126
+ return next;
127
+ level = next;
156
128
  }
157
129
  return null;
158
130
  }
131
+ /** How a space is walked: the step, the decimals a point's key keeps, and how close counts as arrived. On a grid it is the
132
+ * same cell; in a continuous space half a step, because the sampling grid does not fall on the target. */
133
+ function walkOf(space) {
134
+ return space.kind === 'continuous' ? { step: space.unit, keyDecimals: 4, tolerance: 0.5 } : { step: 1, keyDecimals: 0, tolerance: 0 };
135
+ }
136
+ /** Where one jump from a point lands, on every axis the space has. */
137
+ const stepFrom = (at, d) => ({ x: at.x + d.x, y: at.y + d.y, z: (at.z ?? 0) + (d.z ?? 0) });
138
+ /** One ring further out. A route when a target is reached, `null` when the budget ran out («I cannot say», which is an
139
+ * answer), or the next ring. */
140
+ function nextLevel(s, level) {
141
+ const next = [];
142
+ for (const item of level) {
143
+ for (const d of s.jumps) {
144
+ const neighbour = stepFrom(item.at, d);
145
+ if (!isInside(s.space, neighbour))
146
+ continue;
147
+ const k = key(neighbour, s.keyDecimals);
148
+ if (s.seen.has(k))
149
+ continue;
150
+ s.seen.add(k);
151
+ if (s.seen.size > s.budget)
152
+ return null;
153
+ const first = item.steps === 0 ? neighbour : item.first;
154
+ // THE LAST STEP IS ALWAYS ALLOWED: a target may be declared on a cell that cannot be crossed.
155
+ const target = s.arrived(neighbour);
156
+ if (target)
157
+ return { next: first, reached: target, steps: item.steps + 1 };
158
+ if (isWalkable(s.ctx.roleAt(neighbour)))
159
+ next.push({ at: neighbour, first, steps: item.steps + 1 });
160
+ }
161
+ }
162
+ return next;
163
+ }
@@ -1,68 +1,65 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  /**
3
- * Uma cena. Todos os ganchos são OPCIONAIS de propósito: uma tela de título que só desenha não deveria
4
- * precisar declarar um `update` vazio, e um diálogo que só ouve não deveria precisar declarar um `draw`.
3
+ * A scene. Every hook is OPTIONAL on purpose: a title screen that only draws should not have to declare an empty
4
+ * `update`, and a dialog that only listens should not have to declare a `draw`.
5
5
  */
6
6
  export interface Scene {
7
- /** Nome legível — para depuração e para os testes afirmarem a pilha por nome, não por identidade. */
8
- readonly nome: string;
9
- /** Chamado ao ENTRAR (push, ou ao reaparecer no topo por um pop). */
7
+ /** A readable name — for debugging, and so tests assert the stack by name, not identity. */
8
+ readonly name: string;
9
+ /** Called on ENTERING (push, or reappearing on top after a pop). */
10
10
  enter?(): void;
11
- /** Chamado ao SAIR (pop, ou ao ser coberto por um push). */
11
+ /** Called on LEAVING (pop, or being covered by a push). */
12
12
  exit?(): void;
13
- /** Tempo. Só o topo recebe. */
13
+ /** Time. Only the top gets it. */
14
14
  update?(dt: number): void;
15
- /** Desenho. Todas recebem, de baixo para cima. */
15
+ /** Drawing. All get it, bottom up. */
16
16
  draw?(): void;
17
- /** Entrada. Só o topo recebe. Devolva `true` se consumiu — `false`/nada deixa a tecla seguir. */
17
+ /** Input. Only the top gets it. Return `true` if consumed — `false`/nothing lets the key go on. */
18
18
  input?(intent: string): boolean | void;
19
19
  }
20
20
  export interface SceneStack {
21
- /** Empilha `s` no topo. A anterior recebe `exit()` mas CONTINUA na pilha (e continua sendo desenhada). */
21
+ /** Pushes `s` on top. The previous one gets `exit()` but STAYS on the stack (and is still drawn). */
22
22
  push(s: Scene): void;
23
- /** Desempilha o topo e devolve-o (ou `null` se vazia). Quem reaparecer recebe `enter()`. */
23
+ /** Pops the top and returns it (or `null` if empty). Whoever reappears gets `enter()`. */
24
24
  pop(): Scene | null;
25
- /** Troca o topo — `pop` seguido de `push`, numa chamada, porque é o que "ir para outra tela" quer dizer. */
25
+ /** Swaps the top — `pop` then `push` in one call, because that is what "go to another screen" means. */
26
26
  replace(s: Scene): void;
27
- /** A cena do topo, ou `null`. */
27
+ /** The top scene, or `null`. */
28
28
  top(): Scene | null;
29
- /** Os nomes, da base para o topo. Cópia: quem lê não muta a pilha por acidente. */
30
- nomes(): string[];
29
+ /** The names, bottom to top. A copy: whoever reads cannot mutate the stack by accident. */
30
+ names(): string[];
31
31
  update(dt: number): void;
32
32
  draw(): void;
33
- /** Devolve `true` se a cena do topo consumiu a intenção. */
33
+ /** Returns `true` if the top scene consumed the intent. */
34
34
  input(intent: string): boolean;
35
35
  }
36
36
  /**
37
- * Cria uma pilha vazia.
37
+ * Creates an empty stack.
38
38
  *
39
- * ⚠️ `enter`/`exit` são chamados em TRY/CATCH? NÃO — e é decisão, não esquecimento. Um erro dentro de
40
- * `enter()` significa que a cena não montou; engolir isso deixaria a pilha num estado que ninguém declarou, e
41
- * o sintoma apareceria três quadros depois, longe da causa. As chamadas de `update`/`draw`/`input` também
42
- * propagam: a engine não é o lugar de decidir que o erro de um jogo não importa.
39
+ * ⚠️ Are `enter`/`exit` called inside TRY/CATCH? NO — and it is a decision, not an oversight. An error inside `enter()`
40
+ * means the scene did not mount; swallowing it would leave the stack in a state nobody declared, and the symptom would
41
+ * show three frames later, far from the cause. `update`/`draw`/`input` propagate too: the engine is not the place to
42
+ * decide that a game's error does not matter.
43
43
  */
44
- export declare function criarPilha(): SceneStack;
44
+ export declare function createSceneStack(): SceneStack;
45
45
  /**
46
- * O QUE A CASCA PRECISA SABER DA CENA — três booleanos, e nenhum nome de fase.
46
+ * WHAT THE SHELL NEEDS TO KNOW ABOUT THE SCENE — three booleans, and no phase name.
47
47
  *
48
- * Era `Phase = 'title' | 'playing' | 'paused'`, importado de `core/state`. O ADR-0030 registra ALARGAR essa
49
- * união como NÃO-OPÇÃO, e a razão é curta: um segundo jogo continuaria amarrado ao NOSSO vocabulário — um
50
- * jogo com mapa de fases ou tela de resultados teria de pedir uma constante nova à engine para existir.
48
+ * It was a `Phase` union. Widening it is a NON-OPTION (ADR-0030): a second game would stay tied to OUR vocabulary.
51
49
  *
52
- * E o repositório já aprendeu isto uma vez, por evidência e não por gosto: o `consumer-quiz` precisou se
53
- * declarar "pausado" para navegar os próprios menus, porque o `menu-nav` importava a fase. A correção de lá
54
- * foi trocar `getPhase()` por `isNavigable()`, um BOOLEANO — e está registrada em `core/constants` como o
55
- * erro a não repetir. Isto aqui é a mesma correção, aplicada à casca inteira.
50
+ * And the repository already learned this once, by evidence and not taste: the demo quiz had to declare itself
51
+ * "paused" to walk its own menus, because the menu navigation imported the phase. The fix there was a BOOLEAN,
52
+ * `isNavigable()`. This is the same fix, applied to the whole shell.
56
53
  *
57
- * Quem NOMEIA as cenas é a raiz de composição, que é este jogo. Ela monta a pilha (`core/scenes`) e traduz o
58
- * topo nestes três fatos. Uma quarta cena que a casca não conheça responde `false` nos três, e a projeção
59
- * abaixo continua fazendo sentido: sem splash, sem menu de pausa, som mudo, foco no título.
54
+ * Whoever NAMES the scenes is the composition root. It builds the stack and translates the top into these three facts.
55
+ * A fourth scene the shell does not know answers `false` to all three, and the projection still makes sense: no splash,
56
+ * no pause menu, sound muted, focus on the title.
60
57
  */
61
- export interface FatosDaCena {
62
- /** O topo é a tela de título (o splash cobre o mundo). */
63
- telaDeTitulo: boolean;
64
- /** O topo é o JOGO — o mundo recebe tempo, o som toca, o controle de toque pode aparecer. */
65
- mundoRodando: boolean;
66
- /** O topo é o menu de pausa. O jogo continua na pilha por baixo, e continua desenhado. */
67
- menuDePausa: boolean;
58
+ export interface SceneFacts {
59
+ /** The top is the title screen (the splash covers the world). */
60
+ titleScreen: boolean;
61
+ /** The top is the GAME — the world gets time, sound plays, the touch pad may appear. */
62
+ worldRunning: boolean;
63
+ /** The top is the pause menu. The game stays on the stack below, still drawn. */
64
+ pauseMenu: boolean;
68
65
  }
@@ -1,64 +1,62 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
- // core/scenes — A PILHA DE CENAS (item 22, opção C3 do ADR-0030). Módulo-FOLHA: zero dependências, zero I/O.
2
+ // core/scenes — THE SCENE STACK (item 22, option C3 of ADR-0030). A LEAF module: no dependencies, no I/O.
3
3
  //
4
- // ========================= O QUE ELA SUBSTITUI, E POR QUE NÃO É UM ENUM MAIOR =========================
5
- // Hoje o jogo tem `phase: 'title' | 'playing' | 'paused'` em `core/state`, lido por doze módulos. O ADR-0030
6
- // registra C1 — alargar essa união — como NÃO-OPÇÃO, e a razão é curta: um segundo jogo continuaria amarrado
7
- // ao NOSSO enum. Um jogo com tela de mapa, um com tela de resultados, um com senha entre sessões (item 23)
8
- // precisariam pedir uma constante nova na engine para existir.
4
+ // ========================= WHAT IT REPLACES, AND WHY IT IS NOT A BIGGER ENUM =========================
5
+ // A `phase: 'title' | 'playing' | 'paused'` union is a vocabulary, and ADR-0030 records widening it (C1) as a
6
+ // NON-OPTION for a short reason: a second game would stay tied to OUR enum. A game with a map screen, one with a
7
+ // results screen, one with a password between sessions would each have to ask the engine for a new constant to exist.
9
8
  //
10
- // Uma PILHA não tem esse problema porque não tem vocabulário: ela sabe que há cenas empilhadas e nada sobre o
11
- // que cada uma significa. `title/playing/paused` vira `[titulo]`, `[jogo]`, `[jogo, pausa]` — e um mapa de
12
- // fases vira `[mapa]` sem que este arquivo mude uma linha.
9
+ // A STACK does not have that problem because it has no vocabulary: it knows scenes are stacked and nothing about what
10
+ // each means. `title/playing/paused` becomes `[title]`, `[game]`, `[game, pause]` — and a level map becomes `[map]`
11
+ // without this file changing a line.
13
12
  //
14
- // ========================= AS TRÊS REGRAS, E O QUE CADA UMA PRESERVA =========================
15
- // Elas não são convenção de biblioteca: cada uma reproduz um comportamento que o jogo já tem.
13
+ // ========================= THE THREE RULES, AND WHAT EACH PRESERVES =========================
14
+ // They are not library convention: each reproduces a behaviour the game already has.
16
15
  //
17
- // · `update` SÓ NO TOPO. É o congelamento da pausa. Hoje ele é `if (phase !== 'playing') return` espalhado;
18
- // aqui é estrutural — uma cena que não está no topo não recebe tempo, ponto.
19
- // · `draw` DE BAIXO PARA CIMA. É o menu de pausa desenhado SOBRE o mundo, com o mundo ainda visível. Se
20
- // desenhasse só o topo, pausar apagaria o jogo da tela.
21
- // · `input` SÓ NO TOPO, e ele DIZ se consumiu. É a mesma forma que o ADR-0033 deu à entrada modal: quem
22
- // está por cima decide, e o que ele não quer volta a descer. Sem o retorno, a pilha teria de adivinhar.
16
+ // · `update` ONLY AT THE TOP. It is the pause freeze — structural here: a scene that is not on top gets no time.
17
+ // · `draw` FROM THE BOTTOM UP. It is the pause menu drawn OVER the world, with the world still visible. Drawing only
18
+ // the top would make pausing erase the game from the screen.
19
+ // · `input` ONLY AT THE TOP, and it SAYS whether it consumed. The shape ADR-0033 gave modal input: whoever is on
20
+ // top decides, and what they do not want goes back down. Without the return value the stack would have to guess.
23
21
  //
24
- // ========================= O QUE ELA NÃO FAZ =========================
25
- // Não desenha, não escuta evento, não conhece PIXI nem DOM. Recebe `dt` e devolve nada; recebe uma intenção e
26
- // devolve um booleano. É o que a torna testável sem navegador e importável dos dois lados da fronteira.
22
+ // ========================= WHAT IT DOES NOT DO =========================
23
+ // It does not draw, listen for events, or know PIXI or the DOM. It takes `dt` and returns nothing; it takes an intent
24
+ // and returns a boolean. That is what makes it testable without a browser and importable from both sides of the boundary.
27
25
  /**
28
- * Cria uma pilha vazia.
26
+ * Creates an empty stack.
29
27
  *
30
- * ⚠️ `enter`/`exit` são chamados em TRY/CATCH? NÃO — e é decisão, não esquecimento. Um erro dentro de
31
- * `enter()` significa que a cena não montou; engolir isso deixaria a pilha num estado que ninguém declarou, e
32
- * o sintoma apareceria três quadros depois, longe da causa. As chamadas de `update`/`draw`/`input` também
33
- * propagam: a engine não é o lugar de decidir que o erro de um jogo não importa.
28
+ * ⚠️ Are `enter`/`exit` called inside TRY/CATCH? NO — and it is a decision, not an oversight. An error inside `enter()`
29
+ * means the scene did not mount; swallowing it would leave the stack in a state nobody declared, and the symptom would
30
+ * show three frames later, far from the cause. `update`/`draw`/`input` propagate too: the engine is not the place to
31
+ * decide that a game's error does not matter.
34
32
  */
35
- export function criarPilha() {
36
- const pilha = [];
33
+ export function createSceneStack() {
34
+ const stack = [];
37
35
  return {
38
36
  push(s) {
39
- pilha[pilha.length - 1]?.exit?.();
40
- pilha.push(s);
37
+ stack[stack.length - 1]?.exit?.();
38
+ stack.push(s);
41
39
  s.enter?.();
42
40
  },
43
41
  pop() {
44
- const fora = pilha.pop() ?? null;
45
- fora?.exit?.();
46
- pilha[pilha.length - 1]?.enter?.();
47
- return fora;
42
+ const out = stack.pop() ?? null;
43
+ out?.exit?.();
44
+ stack[stack.length - 1]?.enter?.();
45
+ return out;
48
46
  },
49
47
  replace(s) {
50
- // NÃO é `this.pop()` seguido de `this.push(s)`: isso daria `enter()` à cena de baixo por um instante,
51
- // e ela reapareceria no topo entre as duas chamadas. Trocar é UMA transição, não duas.
52
- const fora = pilha.pop() ?? null;
53
- fora?.exit?.();
54
- pilha.push(s);
48
+ // NOT `this.pop()` then `this.push(s)`: that would give the scene below an `enter()` for an instant, and it
49
+ // would reappear on top between the two calls. Swapping is ONE transition, not two.
50
+ const out = stack.pop() ?? null;
51
+ out?.exit?.();
52
+ stack.push(s);
55
53
  s.enter?.();
56
54
  },
57
- top() { return pilha[pilha.length - 1] ?? null; },
58
- nomes() { return pilha.map((s) => s.nome); },
59
- update(dt) { pilha[pilha.length - 1]?.update?.(dt); },
60
- draw() { for (const s of pilha)
55
+ top() { return stack[stack.length - 1] ?? null; },
56
+ names() { return stack.map((s) => s.name); },
57
+ update(dt) { stack[stack.length - 1]?.update?.(dt); },
58
+ draw() { for (const s of stack)
61
59
  s.draw?.(); },
62
- input(intent) { return pilha[pilha.length - 1]?.input?.(intent) === true; },
60
+ input(intent) { return stack[stack.length - 1]?.input?.(intent) === true; },
63
61
  };
64
62
  }
@@ -1,15 +1,15 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
- /** Colunas e linhas da grade para `n` telas. */
2
+ /** Columns and rows of the grid for `n` screens. */
3
3
  export interface ScreenGrid {
4
4
  cols: number;
5
5
  rows: number;
6
6
  }
7
7
  /**
8
- * A grade para `n` jogadores: 1 -> 1x1 · 2 -> 2x1 · 3 e 4 -> 2x2.
9
- * `n` menor que 1 devolve a grade de uma tela, e não zero colunas.
8
+ * The grid for `n` players: 1 -> 1x1 · 2 -> 2x1 · 3 and 4 -> 2x2.
9
+ * `n` below 1 gives the grid of one screen, not zero columns.
10
10
  */
11
11
  export declare function screenGrid(n: number): ScreenGrid;
12
- /** Dimensões em pixels de arte da grade de `n` telas (320x180 por tela — o pixel canônico do ADR-0010). */
12
+ /** Size in art pixels of the grid of `n` screens (320x180 per screen — the canonical pixel of ADR-0010). */
13
13
  export declare function screenBaseSize(n: number): {
14
14
  w: number;
15
15
  h: number;