@auraindustry/aurajs 0.0.7 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.md +98 -2
  2. package/benchmarks/perf-thresholds.json +54 -0
  3. package/package.json +4 -7
  4. package/src/asset-pack.mjs +8 -1
  5. package/src/authored-project.mjs +1449 -0
  6. package/src/authored-runtime.mjs +2016 -0
  7. package/src/authoring/avatar-animation-graph.mjs +648 -0
  8. package/src/bin-integrity.mjs +272 -0
  9. package/src/build-contract/assets.mjs +130 -0
  10. package/src/build-contract/capabilities.mjs +116 -0
  11. package/src/build-contract/constants.mjs +6 -0
  12. package/src/build-contract/helpers.mjs +44 -0
  13. package/src/build-contract/web-templates.mjs +5993 -0
  14. package/src/build-contract.mjs +27 -2910
  15. package/src/bundler.mjs +188 -55
  16. package/src/cli.mjs +4840 -1512
  17. package/src/commands/project-authoring.mjs +454 -0
  18. package/src/config.mjs +44 -0
  19. package/src/conformance/cases/app-and-ui-runtime-cases.mjs +3309 -0
  20. package/src/conformance/cases/core-runtime-cases.mjs +1431 -0
  21. package/src/conformance/cases/index.mjs +11 -0
  22. package/src/conformance/cases/scene3d-and-media-cases.mjs +2094 -0
  23. package/src/conformance/cases/systems-and-gameplay-cases.mjs +1776 -0
  24. package/src/conformance/shared.mjs +27 -0
  25. package/src/conformance-runner.mjs +25 -13
  26. package/src/conformance.mjs +619 -4020
  27. package/src/cutscene.mjs +362 -5
  28. package/src/dev-cli-action.mjs +249 -0
  29. package/src/dev-cli-inspect.mjs +92 -0
  30. package/src/dev-cli-state.mjs +80 -0
  31. package/src/external-asset-cache.mjs +587 -0
  32. package/src/external-asset-policy.mjs +217 -0
  33. package/src/external-package-surface.mjs +206 -0
  34. package/src/game-action-runtime.mjs +869 -0
  35. package/src/game-state-runtime.mjs +206 -6
  36. package/src/headless-action.mjs +186 -0
  37. package/src/headless-test/runtime-animation.mjs +1173 -0
  38. package/src/headless-test/runtime-coordinator.mjs +1514 -0
  39. package/src/headless-test/runtime-primitives.mjs +320 -0
  40. package/src/headless-test/runtime-world.mjs +2253 -0
  41. package/src/headless-test.mjs +392 -4298
  42. package/src/host-binary.mjs +342 -14
  43. package/src/icon-discovery.mjs +64 -0
  44. package/src/make-catalog.mjs +109 -0
  45. package/src/make.mjs +197 -0
  46. package/src/package-integrity.mjs +586 -0
  47. package/src/perf-benchmark.mjs +353 -0
  48. package/src/postinstall.mjs +5 -5
  49. package/src/prefabs/index.mjs +34 -0
  50. package/src/prefabs/scene-serialization.mjs +184 -0
  51. package/src/project-importer.mjs +620 -0
  52. package/src/project-registry.mjs +24 -0
  53. package/src/publish-command.mjs +195 -0
  54. package/src/publish-env-example.mjs +83 -0
  55. package/src/publish-validation.mjs +708 -0
  56. package/src/retro/assets/compile.mjs +232 -0
  57. package/src/retro/backend-gba/authoring.mjs +1029 -0
  58. package/src/retro/backend-gba/rom.mjs +363 -0
  59. package/src/retro/backend-gbc/rom.mjs +85 -0
  60. package/src/retro/build.mjs +278 -0
  61. package/src/retro/cli/commands.mjs +292 -0
  62. package/src/retro/cli/templates.mjs +84 -0
  63. package/src/retro/diagnostics/catalog.mjs +110 -0
  64. package/src/retro/diagnostics/emit.mjs +72 -0
  65. package/src/retro/emulator/case-overlay.mjs +64 -0
  66. package/src/retro/emulator/discovery.mjs +158 -0
  67. package/src/retro/emulator/macos-case-overlay.swift +220 -0
  68. package/src/retro/emulator/profiles.mjs +146 -0
  69. package/src/retro/emulator/runner.mjs +289 -0
  70. package/src/retro/frontend/load-project.mjs +98 -0
  71. package/src/retro/index.mjs +30 -0
  72. package/src/retro/ir/build-ir.mjs +108 -0
  73. package/src/retro/runtime-gba/contract.mjs +151 -0
  74. package/src/retro/runtime-gbc/contract.mjs +117 -0
  75. package/src/retro/shared/span.mjs +26 -0
  76. package/src/retro/shared/targets.mjs +64 -0
  77. package/src/retro/validator/check-project.mjs +114 -0
  78. package/src/runtime-hotspot-audit.mjs +707 -0
  79. package/src/scaffold/config.mjs +1000 -0
  80. package/src/scaffold/fs.mjs +56 -0
  81. package/src/scaffold/layout.mjs +318 -0
  82. package/src/scaffold/project-docs.mjs +439 -0
  83. package/src/scaffold.mjs +93 -596
  84. package/src/scene-composition/index.mjs +326 -0
  85. package/src/scene-composition/runtime.mjs +751 -0
  86. package/src/self-hosted-assets.mjs +604 -0
  87. package/src/session-client.mjs +750 -0
  88. package/src/session-native-launcher.mjs +74 -0
  89. package/src/session-protocol.mjs +75 -0
  90. package/src/session-runtime.mjs +321 -0
  91. package/src/session-server.mjs +360 -0
  92. package/src/shader-kits/index.mjs +773 -0
  93. package/src/starter-content-registry.mjs +292 -0
  94. package/src/state-artifacts.mjs +662 -24
  95. package/src/state-dev-reload.mjs +99 -2
  96. package/src/terminal-ui.mjs +245 -0
  97. package/src/web-conformance.mjs +219 -0
  98. package/templates/create/2d/config/gameplay/shooter.config.js +26 -0
  99. package/templates/create/2d/content/gameplay/waves.json +26 -0
  100. package/templates/create/2d/content/registries/.gitkeep +1 -0
  101. package/templates/create/2d/docs/design/.gitkeep +1 -0
  102. package/templates/create/2d/docs/design/loop.md +5 -0
  103. package/templates/create/2d/prefabs/enemies.prefab.js +90 -0
  104. package/templates/create/2d/prefabs/enemy-basic.prefab.js +18 -0
  105. package/templates/create/2d/prefabs/player.prefab.js +36 -0
  106. package/templates/create/2d/prefabs/projectiles.prefab.js +35 -0
  107. package/templates/create/2d/scenes/boot.scene.js +12 -0
  108. package/templates/create/2d/scenes/gameplay.scene.js +230 -0
  109. package/templates/create/2d/scenes/menu.scene.js +9 -0
  110. package/templates/create/2d/src/main.js +6 -185
  111. package/templates/create/2d/src/runtime/app.js +49 -0
  112. package/templates/create/2d/src/runtime/capabilities.js +35 -0
  113. package/templates/create/2d/ui/hud.screen.js +40 -0
  114. package/templates/create/2d/ui/pause.screen.js +149 -0
  115. package/templates/create/2d/ui/settings.screen.js +347 -0
  116. package/templates/create/2d/ui/title.screen.js +13 -0
  117. package/templates/create/2d-adventure/aura.config.json +28 -0
  118. package/templates/create/2d-adventure/config/gameplay/adventure.config.js +14 -0
  119. package/templates/create/2d-adventure/content/gameplay/world.js +46 -0
  120. package/templates/create/2d-adventure/content/registries/.gitkeep +1 -0
  121. package/templates/create/2d-adventure/docs/design/loop.md +5 -0
  122. package/templates/create/2d-adventure/prefabs/player.prefab.js +54 -0
  123. package/templates/create/2d-adventure/prefabs/relic.prefab.js +38 -0
  124. package/templates/create/2d-adventure/prefabs/world.prefab.js +125 -0
  125. package/templates/create/2d-adventure/scenes/gameplay.scene.js +256 -0
  126. package/templates/create/2d-adventure/src/runtime/capabilities.js +34 -0
  127. package/templates/create/2d-adventure/ui/hud.screen.js +60 -0
  128. package/templates/create/2d-survivor/config/gameplay/survivor.config.js +33 -0
  129. package/templates/create/2d-survivor/content/gameplay/spawn-zones.json +29 -0
  130. package/templates/create/2d-survivor/content/registries/.gitkeep +1 -0
  131. package/templates/create/2d-survivor/docs/design/.gitkeep +1 -0
  132. package/templates/create/2d-survivor/docs/design/loop.md +5 -0
  133. package/templates/create/2d-survivor/prefabs/enemies.prefab.js +178 -0
  134. package/templates/create/2d-survivor/prefabs/enemy-swarm.prefab.js +18 -0
  135. package/templates/create/2d-survivor/prefabs/player.prefab.js +42 -0
  136. package/templates/create/2d-survivor/prefabs/projectiles.prefab.js +56 -0
  137. package/templates/create/2d-survivor/scenes/boot.scene.js +12 -0
  138. package/templates/create/2d-survivor/scenes/gameplay.scene.js +314 -0
  139. package/templates/create/2d-survivor/scenes/menu.scene.js +9 -0
  140. package/templates/create/2d-survivor/src/main.js +5 -332
  141. package/templates/create/2d-survivor/src/runtime/app.js +49 -0
  142. package/templates/create/2d-survivor/src/runtime/capabilities.js +35 -0
  143. package/templates/create/2d-survivor/ui/hud.screen.js +45 -0
  144. package/templates/create/2d-survivor/ui/title.screen.js +13 -0
  145. package/templates/create/3d/assets/models/starter-avatar.gltf +184 -0
  146. package/templates/create/3d/config/gameplay/.gitkeep +1 -0
  147. package/templates/create/3d/content/gameplay/checkpoints.json +33 -0
  148. package/templates/create/3d/content/gameplay/course.js +40 -0
  149. package/templates/create/3d/content/registries/.gitkeep +1 -0
  150. package/templates/create/3d/docs/design/.gitkeep +1 -0
  151. package/templates/create/3d/docs/design/loop.md +5 -0
  152. package/templates/create/3d/prefabs/checkpoint.prefab.js +15 -0
  153. package/templates/create/3d/prefabs/player.prefab.js +204 -0
  154. package/templates/create/3d/prefabs/world.prefab.js +112 -0
  155. package/templates/create/3d/scenes/boot.scene.js +12 -0
  156. package/templates/create/3d/scenes/checkpoint.scene.js +9 -0
  157. package/templates/create/3d/scenes/gameplay.scene.js +292 -0
  158. package/templates/create/3d/src/main.js +6 -295
  159. package/templates/create/3d/src/runtime/app.js +49 -0
  160. package/templates/create/3d/src/runtime/capabilities.js +53 -0
  161. package/templates/create/3d/src/runtime/materials.js +34 -0
  162. package/templates/create/3d/src/runtime/state.js +39 -0
  163. package/templates/create/3d/ui/hud.screen.js +75 -0
  164. package/templates/create/3d/ui/pause.screen.js +166 -0
  165. package/templates/create/3d/ui/settings.screen.js +387 -0
  166. package/templates/create/3d-adventure/assets/models/starter-avatar.gltf +184 -0
  167. package/templates/create/3d-adventure/aura.config.json +28 -0
  168. package/templates/create/3d-adventure/config/gameplay/adventure.config.js +9 -0
  169. package/templates/create/3d-adventure/content/gameplay/course.js +62 -0
  170. package/templates/create/3d-adventure/content/registries/.gitkeep +1 -0
  171. package/templates/create/3d-adventure/docs/design/loop.md +5 -0
  172. package/templates/create/3d-adventure/prefabs/player.prefab.js +168 -0
  173. package/templates/create/3d-adventure/prefabs/relic.prefab.js +35 -0
  174. package/templates/create/3d-adventure/prefabs/world.prefab.js +119 -0
  175. package/templates/create/3d-adventure/scenes/gameplay.scene.js +358 -0
  176. package/templates/create/3d-adventure/src/runtime/capabilities.js +56 -0
  177. package/templates/create/3d-adventure/src/runtime/materials.js +39 -0
  178. package/templates/create/3d-adventure/src/runtime/state.js +31 -0
  179. package/templates/create/3d-adventure/ui/hud.screen.js +70 -0
  180. package/templates/create/3d-adventure/ui/pause.screen.js +437 -0
  181. package/templates/create/3d-collectathon/assets/models/starter-avatar.gltf +184 -0
  182. package/templates/create/3d-collectathon/config/gameplay/.gitkeep +1 -0
  183. package/templates/create/3d-collectathon/content/gameplay/collectibles.json +26 -0
  184. package/templates/create/3d-collectathon/content/gameplay/course.js +46 -0
  185. package/templates/create/3d-collectathon/content/registries/.gitkeep +1 -0
  186. package/templates/create/3d-collectathon/docs/design/.gitkeep +1 -0
  187. package/templates/create/3d-collectathon/docs/design/loop.md +5 -0
  188. package/templates/create/3d-collectathon/prefabs/collectible.prefab.js +15 -0
  189. package/templates/create/3d-collectathon/prefabs/player.prefab.js +207 -0
  190. package/templates/create/3d-collectathon/prefabs/world.prefab.js +112 -0
  191. package/templates/create/3d-collectathon/scenes/boot.scene.js +12 -0
  192. package/templates/create/3d-collectathon/scenes/checkpoint.scene.js +9 -0
  193. package/templates/create/3d-collectathon/scenes/gameplay.scene.js +200 -0
  194. package/templates/create/3d-collectathon/src/main.js +5 -355
  195. package/templates/create/3d-collectathon/src/runtime/app.js +49 -0
  196. package/templates/create/3d-collectathon/src/runtime/capabilities.js +53 -0
  197. package/templates/create/3d-collectathon/src/runtime/materials.js +34 -0
  198. package/templates/create/3d-collectathon/src/runtime/state.js +27 -0
  199. package/templates/create/3d-collectathon/ui/hud.screen.js +66 -0
  200. package/templates/create/3d-collectathon/ui/pause.screen.js +13 -0
  201. package/templates/create/blank/config/gameplay/.gitkeep +1 -0
  202. package/templates/create/blank/content/gameplay/.gitkeep +1 -0
  203. package/templates/create/blank/content/registries/.gitkeep +1 -0
  204. package/templates/create/blank/docs/design/.gitkeep +1 -0
  205. package/templates/create/blank/docs/design/loop.md +5 -0
  206. package/templates/create/blank/prefabs/.gitkeep +1 -0
  207. package/templates/create/blank/scenes/.gitkeep +1 -0
  208. package/templates/create/blank/src/runtime/.gitkeep +1 -0
  209. package/templates/create/blank/ui/.gitkeep +1 -0
  210. package/templates/create/deckbuilder-2d/assets/audio/.gitkeep +1 -0
  211. package/templates/create/deckbuilder-2d/assets/fonts/.gitkeep +1 -0
  212. package/templates/create/deckbuilder-2d/assets/sprites/.gitkeep +1 -0
  213. package/templates/create/deckbuilder-2d/assets/starter/README.md +11 -0
  214. package/templates/create/deckbuilder-2d/assets/ui/.gitkeep +1 -0
  215. package/templates/create/deckbuilder-2d/aura.config.json +28 -0
  216. package/templates/create/deckbuilder-2d/config/gameplay/deckbuilder.config.js +26 -0
  217. package/templates/create/deckbuilder-2d/content/cards/guard.card.js +19 -0
  218. package/templates/create/deckbuilder-2d/content/cards/spark.card.js +20 -0
  219. package/templates/create/deckbuilder-2d/content/cards/starter.deck.js +69 -0
  220. package/templates/create/deckbuilder-2d/content/cards/strike.card.js +19 -0
  221. package/templates/create/deckbuilder-2d/content/cards/survey.card.js +20 -0
  222. package/templates/create/deckbuilder-2d/content/encounters/training-battle.encounter.js +14 -0
  223. package/templates/create/deckbuilder-2d/content/encounters/training-battle.js +65 -0
  224. package/templates/create/deckbuilder-2d/content/enemies/training-automaton.enemy.js +48 -0
  225. package/templates/create/deckbuilder-2d/content/gameplay/.gitkeep +1 -0
  226. package/templates/create/deckbuilder-2d/content/registries/cards.registry.js +26 -0
  227. package/templates/create/deckbuilder-2d/content/registries/encounters.registry.js +20 -0
  228. package/templates/create/deckbuilder-2d/content/registries/enemies.registry.js +20 -0
  229. package/templates/create/deckbuilder-2d/content/registries/relics.registry.js +20 -0
  230. package/templates/create/deckbuilder-2d/content/relics/ember-charm.relic.js +18 -0
  231. package/templates/create/deckbuilder-2d/docs/design/loop.md +12 -0
  232. package/templates/create/deckbuilder-2d/prefabs/.gitkeep +1 -0
  233. package/templates/create/deckbuilder-2d/scenes/boot.scene.js +84 -0
  234. package/templates/create/deckbuilder-2d/scenes/gameplay.scene.js +641 -0
  235. package/templates/create/deckbuilder-2d/src/components/.gitkeep +1 -0
  236. package/templates/create/deckbuilder-2d/src/main.js +17 -0
  237. package/templates/create/deckbuilder-2d/src/runtime/capabilities.js +22 -0
  238. package/templates/create/deckbuilder-2d/src/shared/.gitkeep +1 -0
  239. package/templates/create/deckbuilder-2d/src/systems/.gitkeep +1 -0
  240. package/templates/create/deckbuilder-2d/tests/smoke/.gitkeep +1 -0
  241. package/templates/create/deckbuilder-2d/ui/hud.screen.js +80 -0
  242. package/templates/create/deckbuilder-2d/ui/pause.screen.js +146 -0
  243. package/templates/create/deckbuilder-2d/ui/settings.screen.js +342 -0
  244. package/templates/create/local-multiplayer/aura.config.json +41 -0
  245. package/templates/create/local-multiplayer/config/gameplay/local-multiplayer.config.js +26 -0
  246. package/templates/create/local-multiplayer/content/gameplay/room-layout.js +13 -0
  247. package/templates/create/local-multiplayer/content/registries/.gitkeep +1 -0
  248. package/templates/create/local-multiplayer/docs/design/loop.md +16 -0
  249. package/templates/create/local-multiplayer/prefabs/player.prefab.js +99 -0
  250. package/templates/create/local-multiplayer/scenes/boot.scene.js +12 -0
  251. package/templates/create/local-multiplayer/scenes/gameplay.scene.js +472 -0
  252. package/templates/create/local-multiplayer/src/main.js +17 -0
  253. package/templates/create/local-multiplayer/src/runtime/capabilities.js +28 -0
  254. package/templates/create/local-multiplayer/ui/hud.screen.js +65 -0
  255. package/templates/create/shared/src/runtime/project-inspector.js +105 -0
  256. package/templates/create/shared/src/runtime/scene-flow.js +290 -0
  257. package/templates/create/shared/src/runtime/screen-shell.js +222 -0
  258. package/templates/create/shared/src/runtime/ui-forms.js +209 -0
  259. package/templates/create/shared/src/runtime/ui-settings.js +237 -0
  260. package/templates/create/shared/src/runtime/ui-theme.js +352 -0
  261. package/templates/create/shared/src/starter-utils/adventure-objectives.js +102 -0
  262. package/templates/create/shared/src/starter-utils/animation-2d.js +337 -0
  263. package/templates/create/shared/src/starter-utils/avatar-3d.js +404 -0
  264. package/templates/create/shared/src/starter-utils/combat-feedback-2d.js +320 -0
  265. package/templates/create/shared/src/starter-utils/core.js +39 -3
  266. package/templates/create/shared/src/starter-utils/index.js +8 -2
  267. package/templates/create/shared/src/starter-utils/platformer-3d.js +34 -3
  268. package/templates/create/shared/src/starter-utils/triggers.js +662 -0
  269. package/templates/create/shared/src/starter-utils/tween-2d.js +615 -0
  270. package/templates/create/video-cutscene/assets/video/.gitkeep +0 -0
  271. package/templates/create/video-cutscene/aura.config.json +28 -0
  272. package/templates/create/video-cutscene/config/gameplay/.gitkeep +0 -0
  273. package/templates/create/video-cutscene/content/gameplay/.gitkeep +0 -0
  274. package/templates/create/video-cutscene/content/registries/.gitkeep +0 -0
  275. package/templates/create/video-cutscene/docs/design/loop.md +22 -0
  276. package/templates/create/video-cutscene/prefabs/.gitkeep +0 -0
  277. package/templates/create/video-cutscene/scenes/boot.scene.js +11 -0
  278. package/templates/create/video-cutscene/scenes/cutscene.scene.js +113 -0
  279. package/templates/create/video-cutscene/scenes/gameplay.scene.js +50 -0
  280. package/templates/create/video-cutscene/src/main.js +17 -0
  281. package/templates/create/video-cutscene/src/runtime/app.js +52 -0
  282. package/templates/create/video-cutscene/src/runtime/capabilities.js +35 -0
  283. package/templates/create/video-cutscene/src/runtime/state.js +13 -0
  284. package/templates/create/video-cutscene/ui/.gitkeep +0 -0
  285. package/templates/create-bin/play.js +1192 -0
  286. package/templates/make/README.md +46 -0
  287. package/templates/make/catalog.json +51 -0
  288. package/templates/make/component/files/{{MAKE_NAME}}.component.js +20 -0
  289. package/templates/make/component/manifest.json +9 -0
  290. package/templates/make/data/files/{{MAKE_NAME}}.json +14 -0
  291. package/templates/make/data/manifest.json +9 -0
  292. package/templates/make/material/files/{{MAKE_NAME}}.material.json +17 -0
  293. package/templates/make/material/manifest.json +9 -0
  294. package/templates/make/prefab/files/{{MAKE_NAME}}.prefab.js +20 -0
  295. package/templates/make/prefab/manifest.json +9 -0
  296. package/templates/make/scene/files/{{MAKE_NAME}}.scene.js +31 -0
  297. package/templates/make/scene/manifest.json +9 -0
  298. package/templates/make/shader/files/{{MAKE_NAME}}.shader.js +23 -0
  299. package/templates/make/shader/manifest.json +9 -0
  300. package/templates/make/system/files/{{MAKE_NAME}}.system.js +15 -0
  301. package/templates/make/system/manifest.json +9 -0
  302. package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.js +16 -0
  303. package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.json +23 -0
  304. package/templates/make/ui-screen/manifest.json +10 -0
  305. package/templates/make-starters/deckbuilder-2d/card/files/{{MAKE_NAME}}.card.js +22 -0
  306. package/templates/make-starters/deckbuilder-2d/card/manifest.json +9 -0
  307. package/templates/make-starters/deckbuilder-2d/catalog.json +34 -0
  308. package/templates/make-starters/deckbuilder-2d/encounter/files/{{MAKE_NAME}}.encounter.js +18 -0
  309. package/templates/make-starters/deckbuilder-2d/encounter/manifest.json +9 -0
  310. package/templates/make-starters/deckbuilder-2d/enemy/files/{{MAKE_NAME}}.enemy.js +28 -0
  311. package/templates/make-starters/deckbuilder-2d/enemy/manifest.json +9 -0
  312. package/templates/make-starters/deckbuilder-2d/relic/files/{{MAKE_NAME}}.relic.js +23 -0
  313. package/templates/make-starters/deckbuilder-2d/relic/manifest.json +9 -0
  314. package/templates/retro/platformer/README.md +10 -0
  315. package/templates/retro/platformer/assets/retro/assets.json +91 -0
  316. package/templates/retro/platformer/aura.config.json +7 -0
  317. package/templates/retro/platformer/package.json +5 -0
  318. package/templates/retro/platformer/src/main.js +40 -0
  319. package/templates/retro/puzzle-grid/README.md +10 -0
  320. package/templates/retro/puzzle-grid/assets/retro/assets.json +90 -0
  321. package/templates/retro/puzzle-grid/aura.config.json +7 -0
  322. package/templates/retro/puzzle-grid/package.json +5 -0
  323. package/templates/retro/puzzle-grid/src/main.js +29 -0
  324. package/templates/retro/tactics-grid/README.md +10 -0
  325. package/templates/retro/tactics-grid/assets/retro/assets.json +90 -0
  326. package/templates/retro/tactics-grid/aura.config.json +7 -0
  327. package/templates/retro/tactics-grid/package.json +5 -0
  328. package/templates/retro/tactics-grid/src/main.js +35 -0
  329. package/templates/retro/topdown-adventure/README.md +10 -0
  330. package/templates/retro/topdown-adventure/assets/retro/assets.json +95 -0
  331. package/templates/retro/topdown-adventure/aura.config.json +7 -0
  332. package/templates/retro/topdown-adventure/package.json +5 -0
  333. package/templates/retro/topdown-adventure/src/main.js +29 -0
  334. package/templates/skills/aurajs/SKILL.md +61 -5
@@ -0,0 +1,439 @@
1
+ export function renderProjectReadme({ name, projectTitle, template, templateMetadata }) {
2
+ if (templateMetadata?.runtimeFamily === 'retro') {
3
+ return renderRetroProjectReadme({ name, projectTitle, template, templateMetadata });
4
+ }
5
+ const controls = templateMetadata.controls.map((line) => `- ${line}`).join('\n');
6
+ const firstEdits = templateMetadata.firstEdits.map((line) => `1. ${line}`).join('\n');
7
+ const workflowSection = renderTemplateWorkflowSection(templateMetadata);
8
+ const projectMap = renderProjectMapSection(template);
9
+ const generateFilesSection = renderGenerateFilesSection(template);
10
+ const stateOwnershipSection = renderStateOwnershipSection();
11
+ const continuityOwnershipSection = renderContinuityOwnershipSection();
12
+ const largeAssetSection = renderLargeAssetSection();
13
+
14
+ const optionalCommands = [
15
+ 'npm run build',
16
+ '# packaged local launch sanity check',
17
+ 'npm run play',
18
+ templateMetadata?.optionalModules?.multiplayer === true ? 'npm run join -- AURA2P' : null,
19
+ 'npm run publish',
20
+ 'npm run session -- start',
21
+ ].filter(Boolean).join('\n');
22
+
23
+ return `# ${projectTitle}
24
+
25
+ Scaffolded with \`aura create ${name} --template ${template}\`.
26
+
27
+ ## Quick Start
28
+
29
+ \`\`\`bash
30
+ npm install
31
+ npm run dev
32
+ \`\`\`
33
+
34
+ Optional commands:
35
+
36
+ \`\`\`bash
37
+ ${optionalCommands}
38
+ npx aura explain
39
+ npx aura check
40
+ \`\`\`
41
+
42
+ ${template === 'blank' ? '' : 'Press `F1` while the starter is running to toggle the development-only playtest HUD. Use the top scene strip to jump between scenes and the toolbar to record, capture screenshots, restart, pause, or minimize the HUD.\n\n'}
43
+
44
+ If you are publishing outside the \`@aurajs\` scope, update \`package.json -> name\`
45
+ before the first \`npm run publish\`.
46
+
47
+ ${largeAssetSection}
48
+ ${workflowSection}
49
+ ${generateFilesSection}
50
+ ${stateOwnershipSection}
51
+ ${continuityOwnershipSection}
52
+
53
+ ## Template Summary
54
+
55
+ ${templateMetadata.summary}
56
+
57
+ ## Controls
58
+
59
+ ${controls}
60
+
61
+ ## Project Map
62
+
63
+ ${projectMap}
64
+
65
+ ## First Edits
66
+
67
+ ${firstEdits}
68
+ `;
69
+ }
70
+
71
+ export function renderProjectRunbook({ projectTitle, template, templateMetadata }) {
72
+ if (templateMetadata?.runtimeFamily === 'retro') {
73
+ return renderRetroProjectRunbook({ projectTitle, template, templateMetadata });
74
+ }
75
+ const firstEdits = templateMetadata.firstEdits.map((line) => `1. ${line}`).join('\n');
76
+ const requiredApis = templateMetadata.requiredApis.map((entry) => `- \`${entry}\``).join('\n');
77
+ const workflowSection = renderTemplateWorkflowSection(templateMetadata);
78
+ const firstThirtyMinutes = renderFirstThirtyMinutesSteps(template);
79
+ const generateFilesSection = renderGenerateFilesSection(template);
80
+ const stateOwnershipSection = renderStateOwnershipSection();
81
+ const continuityOwnershipSection = renderContinuityOwnershipSection();
82
+ const largeAssetSection = renderLargeAssetSection();
83
+
84
+ return `# ${projectTitle} Runbook
85
+
86
+ Template: \`${template}\`
87
+
88
+ ## First 30 Minutes
89
+
90
+ ${firstThirtyMinutes}
91
+
92
+ ${stateOwnershipSection}
93
+ ${continuityOwnershipSection}
94
+
95
+ ${workflowSection}
96
+ ${generateFilesSection}
97
+
98
+ ## First-Hour Implementation Pass
99
+
100
+ ${firstEdits}
101
+
102
+ ## Capability Contract
103
+
104
+ The scaffold assumes the runtime APIs below:
105
+
106
+ ${requiredApis}
107
+
108
+ If any are unavailable at runtime, fail fast and capture the reason code before adding fallback behavior.
109
+
110
+ ## Build + Share
111
+
112
+ 1. \`npm run build\` to emit native/web artifacts.
113
+ 1. \`npm run play\` to sanity-check the packaged local wrapper path.
114
+ ${templateMetadata?.optionalModules?.multiplayer === true ? '1. `npm run join -- AURA2P` to join a room-code multiplayer session through the generated wrapper.\n' : ''}1. \`npm run session -- start\` to open a persistent local developer session.
115
+ 1. \`npm run publish\` once metadata and binaries are ready.
116
+ 1. If you are not publishing under \`@aurajs\`, update \`package.json -> name\` first.
117
+
118
+ ${largeAssetSection}
119
+ `;
120
+ }
121
+
122
+ export function renderTemplateWorkflowSection(templateMetadata) {
123
+ const title = String(templateMetadata?.workflowTitle || '').trim();
124
+ const steps = Array.isArray(templateMetadata?.workflowSteps)
125
+ ? templateMetadata.workflowSteps.filter((entry) => typeof entry === 'string' && entry.trim().length > 0)
126
+ : [];
127
+ if (!title || steps.length === 0) return '';
128
+ return `## ${title}
129
+
130
+ ${steps.map((line) => `1. ${line}`).join('\n')}
131
+ `;
132
+ }
133
+
134
+ function renderRetroProjectReadme({ name, projectTitle, template, templateMetadata }) {
135
+ const controls = templateMetadata.controls.map((line) => `- ${line}`).join('\n');
136
+ const firstEdits = templateMetadata.firstEdits.map((line) => `1. ${line}`).join('\n');
137
+ const workflowSection = renderTemplateWorkflowSection(templateMetadata);
138
+ return `# ${projectTitle}
139
+
140
+ Scaffolded with \`aura create ${name} --template ${template}\`.
141
+
142
+ ## Quick Start
143
+
144
+ \`\`\`bash
145
+ npm install
146
+ npm run retro:check
147
+ npm run build:gbc
148
+ \`\`\`
149
+
150
+ Optional build targets:
151
+
152
+ \`\`\`bash
153
+ npm run build:gb
154
+ npm run build:gba
155
+ npm run retro:explain
156
+ \`\`\`
157
+
158
+ Aura Retro projects build through the main AuraScript CLI, but they do not use
159
+ the default desktop play/dev wrapper flow. Treat \`aura retro check\` and
160
+ \`aura build --target <retro-target>\` as the primary development loop.
161
+
162
+ ${workflowSection}
163
+ ## Template Summary
164
+
165
+ ${templateMetadata.summary}
166
+
167
+ ## Controls
168
+
169
+ ${controls}
170
+
171
+ ## First Edits
172
+
173
+ ${firstEdits}
174
+ `;
175
+ }
176
+
177
+ function renderRetroProjectRunbook({ projectTitle, template, templateMetadata }) {
178
+ const firstEdits = templateMetadata.firstEdits.map((line) => `1. ${line}`).join('\n');
179
+ const requiredApis = templateMetadata.requiredApis.map((entry) => `- \`${entry}\``).join('\n');
180
+ const workflowSection = renderTemplateWorkflowSection(templateMetadata);
181
+ return `# ${projectTitle} Runbook
182
+
183
+ Template: \`${template}\`
184
+
185
+ ## First 30 Minutes
186
+
187
+ 1. Run \`npm run retro:check\` from the project root and make sure the initial template is clean.
188
+ 1. Build the default color target with \`npm run build:gbc\`.
189
+ 1. If you want the stricter mono profile, rerun with \`npm run build:gb\`.
190
+ 1. Keep edits inside \`src/main.js\` and \`assets/retro/assets.json\` until the core loop feels right.
191
+
192
+ ${workflowSection}
193
+ ## First-Hour Implementation Pass
194
+
195
+ ${firstEdits}
196
+
197
+ ## Capability Contract
198
+
199
+ The current template assumes the retro-safe API surface below:
200
+
201
+ ${requiredApis}
202
+
203
+ ## Build Targets
204
+
205
+ 1. \`npm run retro:check\` validates the current project against the shipped retro checks.
206
+ 1. \`npm run build:gbc\` emits the default Game Boy Color ROM artifact bundle.
207
+ 1. \`npm run build:gb\` reruns the stricter original Game Boy profile.
208
+ 1. \`npm run build:gba\` emits a \`.gba\` ROM plus the Retro IR, asset manifest, and generated preview source bundle.
209
+ `;
210
+ }
211
+
212
+ export function renderStateOwnershipSection() {
213
+ return `## State Ownership TL;DR
214
+
215
+ - \`aura\` is the runtime API.
216
+ - \`src/runtime/app-state.js\` owns shared mutable \`appState\` and normalizes the \`session\`, \`ui\`, and \`runtime\` buckets.
217
+ - \`context.ensureSessionState(...)\` / \`context.getSessionState(...)\` own shared gameplay/session state in \`appState.session\`.
218
+ - \`context.ensureUiState(...)\` / \`context.getUiState(...)\` own shared UI/presentation state in \`appState.ui\`.
219
+ - \`src/runtime/ui-theme.js\` owns the canonical \`appState.ui.preferences\` seed plus theme apply/reset helpers.
220
+ - \`src/runtime/ui-settings.js\` packages the retained settings and action-strip helpers used by starter pause/options flows.
221
+ - \`src/runtime/ui-forms.js\` packages retained text-field and menu-list helpers used by starter profile, save-slot, and modal flows.
222
+ - \`appState.runtime\` is engine-owned scene/screen-shell metadata and should stay runtime-driven.
223
+ - \`sceneState\` is local mutable state owned by one scene while it is active.
224
+ - \`context.getCurrentScenePayload()\` reads the route-style payload used to enter the current scene.
225
+ - \`screenShell\` payloads are only the data passed into HUD, overlay, and modal screens.
226
+ - \`config/\` is for defaults and tuning.
227
+ - \`content/\` is for authored definitions and registries.
228
+ `;
229
+ }
230
+
231
+ export function renderContinuityOwnershipSection() {
232
+ return `## Continuity Ownership TL;DR
233
+
234
+ - \`src/runtime/app-state.js\` owns shared save/reload continuity for \`appState.session\`, \`appState.ui\`, and \`appState.runtime\`.
235
+ - \`src/runtime/scene-flow.js\` owns active-scene stack continuity and route payload restart handoff.
236
+ - \`src/runtime/screen-shell.js\` owns HUD, overlay, and modal payload continuity.
237
+ - \`src/runtime/ui-theme.js\` owns the scaffolded theme/preferences seam under \`appState.ui.preferences\`.
238
+ - \`src/runtime/ui-settings.js\` owns the shared retained settings helpers reused by starter pause/options flows.
239
+ - \`src/runtime/ui-forms.js\` owns the shared retained form and menu helpers reused by starter modal flows.
240
+ - \`scenes/*.scene.js\` should keep \`sceneState\` JSON-safe when it must survive restore.
241
+ - \`context.getCurrentScenePayload()\` is the read seam for payloads restored through \`sceneFlow\`.
242
+ - saved slots live under \`.aura/state/slots/\` and checkpoints live under \`.aura/state/checkpoints/\`.
243
+ - native dev restore hooks use \`aura dev --restore-slot <name>\` or \`aura dev --restore-checkpoint <name>\`.
244
+ `;
245
+ }
246
+
247
+ export function renderLargeAssetSection() {
248
+ return `## Publish and Large Assets
249
+
250
+ - \`npm run publish\` delegates to the engine-owned \`aura publish\` lane.
251
+ - AuraJS measures built asset payload size before publish. The default npm-first threshold is 50 MiB; operators can override it with \`AURA_PUBLISH_ASSET_THRESHOLD_BYTES\`.
252
+ - If the payload is too large, use your own HTTPS host for the heavy assets and run \`aura external-assets generate --public-base-url <url>\`.
253
+ - That command writes \`aura.external-assets.json\` in the project root and stages manifests plus upload records under \`.aura/external-assets/\`.
254
+ - Packaged \`npx <game> play\` and \`join\` hydrate self-hosted assets into a local cache before launch.
255
+ - Cloudflare R2 and S3 are examples only. AuraPM and \`publishv2\` remain preview-only.
256
+ `;
257
+ }
258
+
259
+ export function renderGenerateFilesSection(template) {
260
+ if (template === 'blank') {
261
+ return `## Generate Files
262
+
263
+ \`\`\`bash
264
+ npx aura make scene MainMenu
265
+ npx aura make ui-screen PauseMenu
266
+ npx aura make config EnemyTable
267
+ npx aura make content SpawnTable
268
+ npx aura explain
269
+ npx aura check
270
+ \`\`\`
271
+
272
+ Blank now ships the same authored roots as the other starters. Use the seeded
273
+ files as the reference structure, then grow the project with \`npx aura make\`.
274
+ `;
275
+ }
276
+
277
+ if (template === 'deckbuilder-2d') {
278
+ return `## Generate Files
279
+
280
+ \`\`\`bash
281
+ npx aura make card StrikePlus
282
+ npx aura make enemy JawWorm
283
+ npx aura make relic BurningBlood
284
+ npx aura make encounter Act1Hallway
285
+ npx aura explain
286
+ npx aura check
287
+ \`\`\`
288
+ `;
289
+ }
290
+
291
+ return `## Generate Files
292
+
293
+ \`\`\`bash
294
+ npx aura make scene MainMenu
295
+ npx aura make ui-screen PauseMenu
296
+ npx aura make config EnemyTable
297
+ npx aura make content SpawnTable
298
+ npx aura explain
299
+ npx aura check
300
+ \`\`\`
301
+ `;
302
+ }
303
+
304
+ export function renderProjectMapSection(template) {
305
+ if (template === 'blank') {
306
+ return `- \`src/main.js\` - the authored-project bootstrap into the runtime app.
307
+ - \`assets/\` - imported art, audio, and starter notes.
308
+ - \`bin/\` - generated wrapper entrypoint.
309
+ - \`aura.config.json\` - identity/window/build/modules.
310
+ - \`aura.capabilities.json\` - canonical runtime API declaration for this scaffold.
311
+ - \`RUNBOOK.md\` - first-hour implementation and triage checklist.
312
+ - \`npx aura explain\` - inspect how the current project is wired.
313
+ - \`npx aura check\` - validate authored wiring before runtime.
314
+ - \`src/runtime/\` - runtime/bootstrap helpers plus the project and scene registries.
315
+ - \`src/runtime/project-registry.js\` - authored source of truth for scenes, screens, prefabs, \`configFiles\`, and \`contentFiles\`.
316
+ - \`src/runtime/scene-flow.js\` - active-scene continuity, stack state, and route payload handoff.
317
+ - \`src/runtime/screen-shell.js\` - HUD, overlay, and modal payload continuity.
318
+ - \`src/runtime/ui-theme.js\` - shared theme presets plus \`appState.ui.preferences\` apply/reset helpers.
319
+ - \`src/runtime/ui-settings.js\` - retained settings and action-strip helpers reused by starter pause/settings screens.
320
+ - \`src/runtime/ui-forms.js\` - retained text-field and menu-list helpers reused by starter form/menu screens.
321
+ - \`scenes/\` - top-level authored scenes.
322
+ - \`prefabs/\` - reusable gameplay blueprints and spawn descriptors.
323
+ - \`ui/\` - authored HUD and screen layout modules.
324
+ - \`config/\` - defaults and tunables.
325
+ - \`content/\` - authored game definitions, progression payloads, and starter-owned registries.
326
+ - \`content/registries/\` - starter-owned registries and future generator-owned indexes.
327
+ - \`src/runtime/app-state.js\` - shared mutable \`appState\` split into \`session\`, \`ui\`, and \`runtime\` buckets plus helper-backed access from scenes.`;
328
+ }
329
+
330
+ return `- \`src/main.js\` - stable bootstrap seam into the authored project layout.
331
+ - \`src/runtime/\` - runtime/bootstrap helpers plus the project and scene registries.
332
+ - \`src/runtime/project-registry.js\` - authored source of truth for scenes, screens, prefabs, \`configFiles\`, and \`contentFiles\`.
333
+ - \`src/runtime/app-state.js\` - shared mutable \`appState\` split into \`session\`, \`ui\`, and \`runtime\` buckets plus helper-backed access from scenes.
334
+ - \`src/runtime/scene-flow.js\` - active-scene continuity, scene-stack restore ownership, and route payload handoff.
335
+ - \`src/runtime/screen-shell.js\` - HUD, overlay, and modal payload continuity ownership.
336
+ - \`src/runtime/ui-theme.js\` - shared theme presets plus \`appState.ui.preferences\` apply/reset helpers.
337
+ - \`src/runtime/ui-settings.js\` - retained settings and action-strip helpers for pause/options screens.
338
+ - \`src/runtime/ui-forms.js\` - retained text-field and menu-list helpers for profile, save-slot, and modal workflows.
339
+ - \`src/runtime/project-inspector.js\` - F1 playtest HUD for scene jumps, capture controls, and authored-runtime visibility.
340
+ - \`scenes/\` - top-level authored scenes.
341
+ - \`prefabs/\` - reusable gameplay blueprints and spawn descriptors.
342
+ - \`ui/\` - authored HUD and screen layout modules.
343
+ - \`config/\` - editable defaults and tuning payloads.
344
+ - \`content/\` - authored definitions, levels, registries, and progression content.
345
+ - \`content/registries/\` - starter-owned registry files for cards, enemies, relics, and encounters.
346
+ - \`src/starter-utils/\` - reusable helpers copied for non-blank templates.
347
+ - \`assets/starter/\` - starter asset pack and editable design payloads.
348
+ - \`aura.config.json\` - identity/window/build/modules.
349
+ - \`aura.capabilities.json\` - canonical runtime API declaration for this scaffold.
350
+ - \`RUNBOOK.md\` - first-hour implementation and triage checklist.`;
351
+ }
352
+
353
+ export function renderFirstThirtyMinutesSteps(template) {
354
+ if (template === 'blank') {
355
+ return `1. Run \`npm install\` then \`npm run dev\` and confirm the starter loop is playable.
356
+ 1. Read \`src/main.js\`, \`src/runtime/app.js\`, \`src/runtime/app-state.js\`, \`scenes/\`, \`config/\`, \`content/\`, and \`docs/design/\` once before adding new structure.
357
+ 1. Decide whether your next change belongs in \`appState.session\`, \`appState.ui\`, \`appState.runtime\`, \`sceneState\`, \`config/\`, or \`content/\`, and whether it must survive save or restart continuity.
358
+ 1. Run \`npx aura explain\` once so the bootstrap stays obvious before the project grows.
359
+ 1. Use \`npx aura make\` when you want more authored files without inventing paths.`;
360
+ }
361
+
362
+ if (template === 'deckbuilder-2d') {
363
+ return `1. Run \`npm install\` then \`npm run dev\` and finish one starter battle end to end.
364
+ 1. Read \`content/registries/\`, \`content/cards/\`, \`content/enemies/\`, and \`content/encounters/\` before changing scene flow.
365
+ 1. Open \`src/runtime/ui-theme.js\`, \`src/runtime/ui-settings.js\`, and \`src/runtime/ui-forms.js\` before adding pause/settings or form glue of your own.
366
+ 1. Generate one extra card or encounter with \`npx aura make\` instead of hand-creating files.
367
+ 1. Run \`npx aura explain\` or \`npx aura check\` once so the starter-owned registries stay obvious as the project grows.
368
+ 1. Only then move into battle polish, rewards, or meta-progression.`;
369
+ }
370
+
371
+ return `1. Run \`npm install\` then \`npm run dev\` and confirm the starter loop is playable.
372
+ 1. Read \`src/main.js\`, \`src/runtime/\`, and \`scenes/\` once end-to-end before moving code around.
373
+ 1. Open \`src/runtime/ui-theme.js\`, \`src/runtime/ui-settings.js\`, and \`src/runtime/ui-forms.js\` before inventing starter-local theme, settings, or form plumbing.
374
+ 1. Review \`assets/starter/\`, \`config/gameplay/\`, \`content/gameplay/\`, and \`docs/design/\` and rewrite the seed content so it matches your game's nouns, tuning, and milestone goals.
375
+ 1. Keep shared state in \`appState.session\` / \`appState.ui\`, keep route payloads in \`sceneFlow\`, and keep scene-only state inside \`sceneState\`.
376
+ 1. Run \`npx aura explain\` or \`npx aura check\` when you want a fast map of the authored project wiring.
377
+ 1. Press \`F1\` in the running starter to open the playtest HUD, jump between authored scenes, and use the compact capture/restart toolbar.
378
+ 1. Use \`npx aura make scene MainMenu\` or \`npx aura make ui-screen PauseMenu\` instead of hand-making new authored file paths.`;
379
+ }
380
+
381
+ export function renderContentMapDoc({ template }) {
382
+ return `# Content Map
383
+
384
+ Template: \`${template}\`
385
+
386
+ ## Authored Roots
387
+
388
+ - \`scenes/\` owns top-level app and gameplay flow.
389
+ - \`prefabs/\` owns reusable game object blueprints.
390
+ - \`ui/\` owns HUD and full-screen UI modules.
391
+ - \`config/gameplay/\` owns tunable gameplay payloads.
392
+ - \`content/gameplay/\` owns authored progression and encounter payloads.
393
+ - \`content/registries/\` owns starter and generator registries.
394
+ - \`src/runtime/\` owns bootstrap and registry adapter code.
395
+ - \`src/runtime/project-registry.js\` is the authored source of truth for scenes, screens, prefabs, \`configFiles\`, and \`contentFiles\`.
396
+ - \`src/runtime/app-state.js\` owns shared \`appState.session\`, \`appState.ui\`, and \`appState.runtime\`.
397
+ - \`src/runtime/scene-flow.js\` owns active-scene continuity and route payload handoff.
398
+ - \`src/runtime/screen-shell.js\` owns HUD, overlay, and modal payload continuity.
399
+ - \`src/runtime/ui-theme.js\` owns shared theme presets and \`appState.ui.preferences\`.
400
+ - \`src/runtime/ui-settings.js\` owns retained settings and action-strip helpers for pause/options flows.
401
+ - \`src/runtime/ui-forms.js\` owns retained text-field and menu-list helpers for starter form/menu flows.
402
+ - \`src/runtime/scene-registry.js\` adapts authored scene registration for runtime use.
403
+ - \`src/runtime/project-inspector.js\` exposes the live F1 playtest HUD.
404
+ - authored scenes read shared state with \`ensureSessionState\`, \`ensureUiState\`, and \`getCurrentScenePayload()\`.
405
+
406
+ ## Current Starter Inventory
407
+
408
+ - \`scenes/boot.scene.js\`
409
+ - \`scenes/gameplay.scene.js\`
410
+ - \`prefabs/player.prefab.js\`
411
+ - \`ui/hud.screen.js\`
412
+ - \`ui/settings.screen.js\` when the starter ships retained settings flow
413
+ - \`config/gameplay/game.config.json\`
414
+ - \`src/runtime/project-registry.js\`
415
+ - \`src/runtime/project-inspector.js\`
416
+ `;
417
+ }
418
+
419
+ export function renderGamePillarsDoc({ projectTitle, templateMetadata }) {
420
+ return `# Game Pillars
421
+
422
+ ## Project
423
+
424
+ - Title: ${projectTitle}
425
+ - Starter summary: ${templateMetadata.summary}
426
+
427
+ ## Pillars
428
+
429
+ 1. Tight core loop with fast iteration on tuning values.
430
+ 1. Clear ownership between \`appState.session/ui/runtime\`, \`sceneState\`, route/UI payloads, config, and content.
431
+ 1. Plain-JS files that stay easy to edit with agents and code review.
432
+
433
+ ## First Questions
434
+
435
+ - What should the player accomplish in the first 60 seconds?
436
+ - Which starter constant should become config first?
437
+ - Which authored file should become the team's daily home base?
438
+ `;
439
+ }