@craft_eco/craft-mcp 0.0.0-stage → 0.1.14

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 (1039) hide show
  1. package/README.md +32 -2
  2. package/bin/craft-mcp.mjs +7 -0
  3. package/dist-server/core/app-paths.mjs +15 -0
  4. package/dist-server/core/auth-store.mjs +70 -0
  5. package/dist-server/core/connector-auth.mjs +30 -0
  6. package/dist-server/core/http-utils.mjs +14 -0
  7. package/dist-server/game-workflow/asset-formats.mjs +76 -0
  8. package/dist-server/game-workflow/asset-import.mjs +113 -0
  9. package/dist-server/game-workflow/asset-inputs.mjs +10 -0
  10. package/dist-server/game-workflow/assets.mjs +161 -0
  11. package/dist-server/game-workflow/capture-worker.mjs +14 -0
  12. package/dist-server/game-workflow/check.mjs +74 -0
  13. package/dist-server/game-workflow/draft-archive.mjs +91 -0
  14. package/dist-server/game-workflow/draft-bindings.mjs +35 -0
  15. package/dist-server/game-workflow/draft-uploads.mjs +207 -0
  16. package/dist-server/game-workflow/engines.mjs +30 -0
  17. package/dist-server/game-workflow/library-assets.mjs +77 -0
  18. package/dist-server/game-workflow/library-candidates.mjs +37 -0
  19. package/dist-server/game-workflow/library-catalog.mjs +45 -0
  20. package/dist-server/game-workflow/project-leases.mjs +52 -0
  21. package/dist-server/game-workflow/projects.mjs +92 -0
  22. package/dist-server/game-workflow/publication-materials.mjs +67 -0
  23. package/dist-server/game-workflow/publications.mjs +146 -0
  24. package/dist-server/game-workflow/publish-capture-worker.mjs +57 -0
  25. package/dist-server/game-workflow/publish-capture.mjs +75 -0
  26. package/dist-server/game-workflow/request-store.mjs +52 -0
  27. package/dist-server/game-workflow/resource-catalog.mjs +97 -0
  28. package/dist-server/game-workflow/tasks.mjs +93 -0
  29. package/dist-server/mcp/asset-tools.mjs +42 -0
  30. package/dist-server/mcp/control-panel.html +17 -0
  31. package/dist-server/mcp/control-panel.mjs +40 -0
  32. package/dist-server/mcp/publication-tools.mjs +19 -0
  33. package/dist-server/mcp/server.mjs +297 -0
  34. package/dist-server/mcp/start.mjs +20 -0
  35. package/dist-server/preview/local-static-preview.mjs +71 -0
  36. package/dist-server/preview/preview-control.mjs +35 -0
  37. package/dist-server/preview/preview-launcher.mjs +26 -0
  38. package/dist-server/preview/preview-snapshot.mjs +35 -0
  39. package/dist-server/preview/preview-start.mjs +12 -0
  40. package/dist-server/preview/preview-worker.mjs +68 -0
  41. package/dist-server/upstream/craft-aigc.mjs +197 -0
  42. package/dist-server/upstream/library-url.mjs +14 -0
  43. package/dist-server/upstream/publication-transport.mjs +80 -0
  44. package/package.json +33 -4
  45. package/resources/craft-game-maker/SKILL.md +67 -0
  46. package/resources/craft-game-maker/js.md +9 -0
  47. package/resources/craft-game-maker/js3d.md +12 -0
  48. package/resources/game_visual_qa.mjs +1143 -0
  49. package/resources/js/context/CLAUDE.md +54 -0
  50. package/resources/js/context/agents/aigc-manager.md +91 -0
  51. package/resources/js/context/hooks/hooks.json +20 -0
  52. package/resources/js/context/knowledge/AigcEnabled.md +41 -0
  53. package/resources/js/context/knowledge/AigcWiring.md +200 -0
  54. package/resources/js/context/knowledge/AssetUrl.md +24 -0
  55. package/resources/js/context/knowledge/FrontendComponents.md +23 -0
  56. package/resources/js/context/knowledge/GameProbe.md +74 -0
  57. package/resources/js/context/knowledge/Lifecycle.md +27 -0
  58. package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
  59. package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +115 -0
  60. package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +392 -0
  61. package/resources/js/context/knowledge/PlatformServices.md +184 -0
  62. package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
  63. package/resources/js/context/knowledge/Ui.md +11 -0
  64. package/resources/js/context/knowledge/UiEditorCompat.md +21 -0
  65. package/resources/js/context/rules/MultiplayerCapability.md +23 -0
  66. package/resources/js/context/rules/MultiplayerRoomEntryUX.md +63 -0
  67. package/resources/js/context/rules/PlatformBoundaryModules.md +43 -0
  68. package/resources/js/context/skills/aigc-generate/SKILL.md +301 -0
  69. package/resources/js/context/skills/aigc-generate/knowledge/audio.md +39 -0
  70. package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +14 -0
  71. package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +129 -0
  72. package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +54 -0
  73. package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +50 -0
  74. package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +201 -0
  75. package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +53 -0
  76. package/resources/js/context/skills/aigc-generate/scripts/apply-results.mjs +83 -0
  77. package/resources/js/context/skills/aigc-generate/scripts/config.json +29 -0
  78. package/resources/js/context/skills/aigc-generate/scripts/generate.mjs +1016 -0
  79. package/resources/js/context/skills/aigc-generate/scripts/lib/client.mjs +228 -0
  80. package/resources/js/context/skills/aigc-generate/scripts/lib/ledger.mjs +119 -0
  81. package/resources/js/context/skills/aigc-generate/scripts/lib/nstep-handoff.mjs +100 -0
  82. package/resources/js/context/skills/aigc-generate/scripts/lib/pipelines.mjs +441 -0
  83. package/resources/js/context/skills/aigc-generate/scripts/lib/queue.mjs +283 -0
  84. package/resources/js/context/skills/aigc-generate/scripts/lib/submit.mjs +122 -0
  85. package/resources/js/context/skills/aigc-generate/scripts/worker.mjs +171 -0
  86. package/resources/js/context/skills/asset-search/SKILL.md +73 -0
  87. package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +62 -0
  88. package/resources/js/context/skills/asset-search/scripts/config.json +5 -0
  89. package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +125 -0
  90. package/resources/js/context/skills/asset-search/scripts/recalled_sprite_paths.mjs +47 -0
  91. package/resources/js/context/skills/asset-search/scripts/search.mjs +749 -0
  92. package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +723 -0
  93. package/resources/js/context/skills/asset-search/strategies/audio.md +34 -0
  94. package/resources/js/context/skills/asset-search/strategies/character2d.md +33 -0
  95. package/resources/js/context/skills/asset-search/strategies/effect2d.md +31 -0
  96. package/resources/js/context/skills/asset-search/strategies/texture-prop.md +22 -0
  97. package/resources/js/context/skills/asset-search/strategies/texture-ui.md +35 -0
  98. package/resources/js/context/skills/asset-search/strategies/ui-common.md +40 -0
  99. package/resources/js/context/skills/asset-search/strategies/ui-style.md +28 -0
  100. package/resources/js/context/skills/display-info-setup/SKILL.md +32 -0
  101. package/resources/js/context/skills/display-info-setup/scripts/init_project.mjs +38 -0
  102. package/resources/js/context/skills/export-config/SKILL.md +20 -0
  103. package/resources/js/context/skills/export-config/scripts/assert-asset-wiring.mjs +72 -0
  104. package/resources/js/context/skills/export-config/scripts/export-config.mjs +43 -0
  105. package/resources/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  106. package/resources/js/context/skills/export-config/scripts/sync-asset-controls.mjs +351 -0
  107. package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
  108. package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +92 -0
  109. package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +7 -0
  110. package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +22 -0
  111. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  112. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  113. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  114. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  115. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  116. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  117. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  118. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  119. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
  120. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  121. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  122. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/release.json +37 -0
  123. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  124. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  125. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  126. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  127. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
  128. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  129. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  130. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  131. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  132. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  133. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  134. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  135. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  136. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  137. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  138. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  139. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  140. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  141. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  142. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  143. package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  144. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +32 -0
  145. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +50 -0
  146. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +121 -0
  147. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +254 -0
  148. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +99 -0
  149. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +14 -0
  150. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +172 -0
  151. package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +165 -0
  152. package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +20 -0
  153. package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +4 -0
  154. package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +109 -0
  155. package/resources/js/context/skills/mobile-adaptation/SKILL.md +260 -0
  156. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +50 -0
  157. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +881 -0
  158. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
  159. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
  160. package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +134 -0
  161. package/resources/js/context/skills/mobile-adaptation/references/input-config.md +311 -0
  162. package/resources/js/context/skills/mobile-adaptation/references/verification.md +106 -0
  163. package/resources/js/context/skills/optimization-suggestions/SKILL.md +89 -0
  164. package/resources/js/context/skills/platform-services/SKILL.md +94 -0
  165. package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
  166. package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
  167. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
  168. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
  169. package/resources/js/context/skills/platform-services/assets/modules/log.ts +35 -0
  170. package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
  171. package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
  172. package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +49 -0
  173. package/resources/js/context/skills/platform-services/assets/modules/save.mjs +1 -0
  174. package/resources/js/context/skills/platform-services/assets/release.json +44 -0
  175. package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
  176. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
  177. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
  178. package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
  179. package/resources/js/context/skills/platform-services/references/api_reference.md +18 -0
  180. package/resources/js/context/skills/platform-services/scripts/install.mjs +134 -0
  181. package/resources/js/context/skills/resolution-adaptation/SKILL.md +202 -0
  182. package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
  183. package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +254 -0
  184. package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +98 -0
  185. package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +200 -0
  186. package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +134 -0
  187. package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +119 -0
  188. package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
  189. package/resources/js/context/skills/scene-editor-compat/SKILL.md +94 -0
  190. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +13 -0
  191. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +6 -0
  192. package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +25 -0
  193. package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +18 -0
  194. package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +7 -0
  195. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +42 -0
  196. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +144 -0
  197. package/resources/js/context/skills/scene-editor-compat/docs/contract.md +330 -0
  198. package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +64 -0
  199. package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +28 -0
  200. package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +47 -0
  201. package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +64 -0
  202. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +38 -0
  203. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +9 -0
  204. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +59 -0
  205. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +30 -0
  206. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +66 -0
  207. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +20 -0
  208. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +26 -0
  209. package/resources/js/context/skills/scene-editor-compat/references/contract.md +73 -0
  210. package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +162 -0
  211. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +853 -0
  212. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +173 -0
  213. package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +427 -0
  214. package/resources/js/context/skills/scene-editor-compat/version.json +1 -0
  215. package/resources/js/context/skills/ui-editor-compat/SKILL.md +48 -0
  216. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
  217. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +74 -0
  218. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
  219. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
  220. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
  221. package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
  222. package/resources/js/context/skills/ui-editor-compat/references/contract.md +132 -0
  223. package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
  224. package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
  225. package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
  226. package/resources/js/context/skills/version-update/SKILL.md +192 -0
  227. package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
  228. package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
  229. package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
  230. package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  231. package/resources/js/context/skills/visual-qa/SKILL.md +36 -0
  232. package/resources/js/context/version/version.json +1 -0
  233. package/resources/js/project/.gitattributes +2 -0
  234. package/resources/js/project/README.md +99 -0
  235. package/resources/js/project/SPEC/assist/.gitkeep +0 -0
  236. package/resources/js/project/SPEC/guide/.gitkeep +0 -0
  237. package/resources/js/project/SPEC/plan/.gitkeep +0 -0
  238. package/resources/js/project/SPEC/readme.md +6 -0
  239. package/resources/js/project/SPEC/res/.gitkeep +0 -0
  240. package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
  241. package/resources/js/project/configs/assets.json +1 -0
  242. package/resources/js/project/configs/game.controls.json +3 -0
  243. package/resources/js/project/configs/game.json +3 -0
  244. package/resources/js/project/game-runtime.json +7 -0
  245. package/resources/js/project/gameplay-probe.json +37 -0
  246. package/resources/js/project/index.html +20 -0
  247. package/resources/js/project/package-lock.json +1155 -0
  248. package/resources/js/project/package.json +23 -0
  249. package/resources/js/project/projectDisplayInfo.json +7 -0
  250. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  251. package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  252. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  253. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  254. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  255. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  256. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  257. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  258. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +29 -0
  259. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  260. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  261. package/resources/js/project/runtime/lightgame/1.0.0/release.json +37 -0
  262. package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  263. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  264. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  265. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  266. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +8 -0
  267. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  268. package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  269. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  270. package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  271. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  272. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  273. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  274. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  275. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  276. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  277. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  278. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  279. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  280. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  281. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  282. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  283. package/resources/js/project/scripts/config-export.mjs +32 -0
  284. package/resources/js/project/scripts/refresh-runtime.mjs +50 -0
  285. package/resources/js/project/src/display/ui-stage.ts +121 -0
  286. package/resources/js/project/src/display/viewport.ts +254 -0
  287. package/resources/js/project/src/main.ts +99 -0
  288. package/resources/js/project/src/platform.ts +14 -0
  289. package/resources/js/project/src/scenes/LoadScene.ts +89 -0
  290. package/resources/js/project/src/scenes/PlayScene.ts +17 -0
  291. package/resources/js/project/src/screenUi.ts +172 -0
  292. package/resources/js/project/src/style.css +165 -0
  293. package/resources/js/project/tsconfig.json +20 -0
  294. package/resources/js/project/unified_data_control_config.json +20 -0
  295. package/resources/js/project/vendor/core-manager-js/package.json +33 -0
  296. package/resources/js/project/vendor/core-manager-js/src/.versions.json +42 -0
  297. package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +41 -0
  298. package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +90 -0
  299. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +203 -0
  300. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +106 -0
  301. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +25 -0
  302. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +21 -0
  303. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +65 -0
  304. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +340 -0
  305. package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +87 -0
  306. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +92 -0
  307. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +271 -0
  308. package/resources/js/project/vendor/core-manager-js/src/index.ts +31 -0
  309. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +81 -0
  310. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +43 -0
  311. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +32 -0
  312. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +141 -0
  313. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +20 -0
  314. package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +183 -0
  315. package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +304 -0
  316. package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +351 -0
  317. package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +180 -0
  318. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +13 -0
  319. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +14 -0
  320. package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +68 -0
  321. package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +433 -0
  322. package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +118 -0
  323. package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +444 -0
  324. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +485 -0
  325. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +66 -0
  326. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +149 -0
  327. package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +9 -0
  328. package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +29 -0
  329. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +88 -0
  330. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +122 -0
  331. package/resources/js/project/vendor/core-manager-js/src/runtime.ts +24 -0
  332. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +318 -0
  333. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +151 -0
  334. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +235 -0
  335. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +98 -0
  336. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +94 -0
  337. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +209 -0
  338. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +106 -0
  339. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +341 -0
  340. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +68 -0
  341. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +236 -0
  342. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +22 -0
  343. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +29 -0
  344. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +197 -0
  345. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +9 -0
  346. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +555 -0
  347. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +112 -0
  348. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +178 -0
  349. package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +246 -0
  350. package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +139 -0
  351. package/resources/js/project/vendor/core-manager-js/tsconfig.json +15 -0
  352. package/resources/js/project/vendor/run.sh +107 -0
  353. package/resources/js/project/version/craft_feature_version.json +42 -0
  354. package/resources/js/project/version/project_feature_version.json +11 -0
  355. package/resources/js/project/vite.config.ts +4 -0
  356. package/resources/js3d/context/CLAUDE.md +50 -0
  357. package/resources/js3d/context/hooks/hooks.json +20 -0
  358. package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +87 -0
  359. package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +69 -0
  360. package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +42 -0
  361. package/resources/js3d/context/knowledge/FrontendComponents.md +23 -0
  362. package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +114 -0
  363. package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +117 -0
  364. package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +430 -0
  365. package/resources/js3d/context/knowledge/PlatformServices.md +162 -0
  366. package/resources/js3d/context/knowledge/Runtime.md +30 -0
  367. package/resources/js3d/context/knowledge/SceneEditorCompat.md +34 -0
  368. package/resources/js3d/context/knowledge/StepByStep.md +21 -0
  369. package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +242 -0
  370. package/resources/js3d/context/knowledge/UiEditorCompat.md +21 -0
  371. package/resources/js3d/context/rules/MultiplayerCapability.md +27 -0
  372. package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +63 -0
  373. package/resources/js3d/context/rules/PlatformBoundaryModules.md +43 -0
  374. package/resources/js3d/context/skills/aigc-integration/SKILL.md +176 -0
  375. package/resources/js3d/context/skills/aigc-integration/callback.md +56 -0
  376. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +22 -0
  377. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +38 -0
  378. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +33 -0
  379. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +36 -0
  380. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +37 -0
  381. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +35 -0
  382. package/resources/js3d/context/skills/aigc-integration/scripts/config.json +3 -0
  383. package/resources/js3d/context/skills/aigc-integration/scripts/lib/submit.mjs +344 -0
  384. package/resources/js3d/context/skills/aigc-integration/scripts/query-music.mjs +53 -0
  385. package/resources/js3d/context/skills/aigc-integration/scripts/query-results.mjs +53 -0
  386. package/resources/js3d/context/skills/aigc-integration/scripts/submit-cover.mjs +44 -0
  387. package/resources/js3d/context/skills/aigc-integration/scripts/submit-image.mjs +48 -0
  388. package/resources/js3d/context/skills/aigc-integration/scripts/submit-music.mjs +34 -0
  389. package/resources/js3d/context/skills/aigc-integration/scripts/submit-staticmesh.mjs +39 -0
  390. package/resources/js3d/context/skills/asset-search/SKILL.md +159 -0
  391. package/resources/js3d/context/skills/asset-search/references/resource-config.md +56 -0
  392. package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +62 -0
  393. package/resources/js3d/context/skills/asset-search/scripts/config.json +213 -0
  394. package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +885 -0
  395. package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +79 -0
  396. package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +74 -0
  397. package/resources/js3d/context/skills/asset-search/scripts/search.mjs +597 -0
  398. package/resources/js3d/context/skills/export-config/scripts/assert-asset-wiring.mjs +83 -0
  399. package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +53 -0
  400. package/resources/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  401. package/resources/js3d/context/skills/export-config/scripts/sync-asset-controls.mjs +325 -0
  402. package/resources/js3d/context/skills/export-config/scripts/sync-scene-assets.mjs +181 -0
  403. package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +163 -0
  404. package/resources/js3d/context/skills/game-art-style/SKILL.md +60 -0
  405. package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
  406. package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
  407. package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
  408. package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
  409. package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
  410. package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
  411. package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
  412. package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
  413. package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +38 -0
  414. package/resources/js3d/context/skills/game-art-style/references/construction.md +111 -0
  415. package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +105 -0
  416. package/resources/js3d/context/skills/game-art-style/references/sources.md +25 -0
  417. package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +175 -0
  418. package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +168 -0
  419. package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +191 -0
  420. package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +165 -0
  421. package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +173 -0
  422. package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +185 -0
  423. package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +181 -0
  424. package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +189 -0
  425. package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +88 -0
  426. package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +284 -0
  427. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +104 -0
  428. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +952 -0
  429. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +92 -0
  430. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +245 -0
  431. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +256 -0
  432. package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +311 -0
  433. package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +106 -0
  434. package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +74 -0
  435. package/resources/js3d/context/skills/platform-services/SKILL.md +94 -0
  436. package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +783 -0
  437. package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +57 -0
  438. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +39 -0
  439. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +1 -0
  440. package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +35 -0
  441. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +25 -0
  442. package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +1 -0
  443. package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +49 -0
  444. package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +1 -0
  445. package/resources/js3d/context/skills/platform-services/assets/release.json +44 -0
  446. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +7 -0
  447. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +264 -0
  448. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +39 -0
  449. package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +139 -0
  450. package/resources/js3d/context/skills/platform-services/references/api_reference.md +18 -0
  451. package/resources/js3d/context/skills/platform-services/scripts/install.mjs +134 -0
  452. package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +170 -0
  453. package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +121 -0
  454. package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +244 -0
  455. package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +127 -0
  456. package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +188 -0
  457. package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +124 -0
  458. package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +117 -0
  459. package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +338 -0
  460. package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +599 -0
  461. package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +141 -0
  462. package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +92 -0
  463. package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +125 -0
  464. package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +113 -0
  465. package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +1187 -0
  466. package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +52 -0
  467. package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +4 -0
  468. package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +94 -0
  469. package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +50 -0
  470. package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +105 -0
  471. package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +147 -0
  472. package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +79 -0
  473. package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +56 -0
  474. package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +51 -0
  475. package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +55 -0
  476. package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +78 -0
  477. package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +84 -0
  478. package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +120 -0
  479. package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +4 -0
  480. package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +238 -0
  481. package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +59 -0
  482. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +35 -0
  483. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +61 -0
  484. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +60 -0
  485. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +45 -0
  486. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +265 -0
  487. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +7 -0
  488. package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +110 -0
  489. package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +327 -0
  490. package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +80 -0
  491. package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +84 -0
  492. package/resources/js3d/context/skills/version-update/SKILL.md +191 -0
  493. package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +129 -0
  494. package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +159 -0
  495. package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +157 -0
  496. package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  497. package/resources/js3d/context/version/version.json +1 -0
  498. package/resources/js3d/project/.gitattributes +2 -0
  499. package/resources/js3d/project/README.md +100 -0
  500. package/resources/js3d/project/configs/game.controls.json +3 -0
  501. package/resources/js3d/project/configs/game.json +3 -0
  502. package/resources/js3d/project/game-runtime.json +7 -0
  503. package/resources/js3d/project/gameplay-probe.json +38 -0
  504. package/resources/js3d/project/index.html +12 -0
  505. package/resources/js3d/project/package-lock.json +1204 -0
  506. package/resources/js3d/project/package.json +24 -0
  507. package/resources/js3d/project/projectDisplayInfo.json +7 -0
  508. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +19 -0
  509. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +1 -0
  510. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +39 -0
  511. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +1 -0
  512. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +227 -0
  513. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +25 -0
  514. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +1 -0
  515. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +79 -0
  516. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +30 -0
  517. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +49 -0
  518. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +1 -0
  519. package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +39 -0
  520. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +2 -0
  521. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +8 -0
  522. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +2 -0
  523. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +3 -0
  524. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +7 -0
  525. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +24 -0
  526. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +2 -0
  527. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +10 -0
  528. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +1 -0
  529. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +20 -0
  530. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +1 -0
  531. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +21 -0
  532. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +1 -0
  533. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +36 -0
  534. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +359 -0
  535. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.test.mjs +25 -0
  536. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +17 -0
  537. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +1 -0
  538. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +40 -0
  539. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +1 -0
  540. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +10 -0
  541. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +1 -0
  542. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +8 -0
  543. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +1 -0
  544. package/resources/js3d/project/scripts/config-export.mjs +32 -0
  545. package/resources/js3d/project/scripts/refresh-runtime.mjs +50 -0
  546. package/resources/js3d/project/src/display/ui-stage.ts +121 -0
  547. package/resources/js3d/project/src/display/viewport.ts +244 -0
  548. package/resources/js3d/project/src/main.ts +83 -0
  549. package/resources/js3d/project/src/platform.ts +14 -0
  550. package/resources/js3d/project/src/style.css +17 -0
  551. package/resources/js3d/project/tsconfig.json +20 -0
  552. package/resources/js3d/project/unified_data_control_config.json +20 -0
  553. package/resources/js3d/project/vendor/core-manager-three/package.json +12 -0
  554. package/resources/js3d/project/vendor/core-manager-three/src/index.ts +2 -0
  555. package/resources/js3d/project/vendor/run.sh +4 -0
  556. package/resources/js3d/project/version/craft_feature_version.json +42 -0
  557. package/resources/js3d/project/version/project_feature_version.json +11 -0
  558. package/resources/js3d/project/vite.config.ts +4 -0
  559. package/vendor/agent-cli/dist/runtime-tools/registry.json +6 -0
  560. package/vendor/agent-cli/dist/runtime-tools/tool-bundle-types.d.cts +15 -0
  561. package/vendor/agent-cli/dist/runtime-tools/tool-bundle.cjs +129 -0
  562. package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +296 -0
  563. package/vendor/agent-cli/dist/runtime-tools/ue/context-adapter.cjs +48 -0
  564. package/vendor/agent-cli/dist/runtime-tools/ue/scene-process-lock.cjs +110 -0
  565. package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +22 -0
  566. package/vendor/agent-cli/dist/runtime-tools/ue/ue-asset-references.cjs +305 -0
  567. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +3 -0
  568. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +1 -0
  569. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +45 -0
  570. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +1 -0
  571. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +57 -0
  572. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -0
  573. package/vendor/agent-cli/dist/src/artifacts/prepare.js +198 -0
  574. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -0
  575. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +32 -0
  576. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -0
  577. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +146 -0
  578. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -0
  579. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +28 -0
  580. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +1 -0
  581. package/vendor/agent-cli/dist/src/artifacts/restore.js +384 -0
  582. package/vendor/agent-cli/dist/src/artifacts/restore.js.map +1 -0
  583. package/vendor/agent-cli/dist/src/artifacts/static.d.ts +15 -0
  584. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -0
  585. package/vendor/agent-cli/dist/src/artifacts/static.js +152 -0
  586. package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -0
  587. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts +4 -0
  588. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts.map +1 -0
  589. package/vendor/agent-cli/dist/src/cli/commands/process.js +24 -0
  590. package/vendor/agent-cli/dist/src/cli/commands/process.js.map +1 -0
  591. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts +23 -0
  592. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts.map +1 -0
  593. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js +62 -0
  594. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js.map +1 -0
  595. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts +9 -0
  596. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts.map +1 -0
  597. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js +15 -0
  598. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js.map +1 -0
  599. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts +3 -0
  600. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts.map +1 -0
  601. package/vendor/agent-cli/dist/src/cli/commands/run.js +284 -0
  602. package/vendor/agent-cli/dist/src/cli/commands/run.js.map +1 -0
  603. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts +11 -0
  604. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts.map +1 -0
  605. package/vendor/agent-cli/dist/src/cli/commands/setup.js +161 -0
  606. package/vendor/agent-cli/dist/src/cli/commands/setup.js.map +1 -0
  607. package/vendor/agent-cli/dist/src/cli/options.d.ts +83 -0
  608. package/vendor/agent-cli/dist/src/cli/options.d.ts.map +1 -0
  609. package/vendor/agent-cli/dist/src/cli/options.js +213 -0
  610. package/vendor/agent-cli/dist/src/cli/options.js.map +1 -0
  611. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts +5 -0
  612. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -0
  613. package/vendor/agent-cli/dist/src/cli/process-protocol.js +276 -0
  614. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -0
  615. package/vendor/agent-cli/dist/src/cli/registry.d.ts +55 -0
  616. package/vendor/agent-cli/dist/src/cli/registry.d.ts.map +1 -0
  617. package/vendor/agent-cli/dist/src/cli/registry.js +99 -0
  618. package/vendor/agent-cli/dist/src/cli/registry.js.map +1 -0
  619. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts +44 -0
  620. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts.map +1 -0
  621. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js +83 -0
  622. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js.map +1 -0
  623. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts +28 -0
  624. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts.map +1 -0
  625. package/vendor/agent-cli/dist/src/cli/render/text-sink.js +52 -0
  626. package/vendor/agent-cli/dist/src/cli/render/text-sink.js.map +1 -0
  627. package/vendor/agent-cli/dist/src/cli.d.ts +9 -0
  628. package/vendor/agent-cli/dist/src/cli.d.ts.map +1 -0
  629. package/vendor/agent-cli/dist/src/cli.js +54 -0
  630. package/vendor/agent-cli/dist/src/cli.js.map +1 -0
  631. package/vendor/agent-cli/dist/src/component/execution.d.ts +24 -0
  632. package/vendor/agent-cli/dist/src/component/execution.d.ts.map +1 -0
  633. package/vendor/agent-cli/dist/src/component/execution.js +131 -0
  634. package/vendor/agent-cli/dist/src/component/execution.js.map +1 -0
  635. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +24 -0
  636. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +1 -0
  637. package/vendor/agent-cli/dist/src/component/platform-access/server.js +200 -0
  638. package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +1 -0
  639. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts +31 -0
  640. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +1 -0
  641. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +57 -0
  642. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +1 -0
  643. package/vendor/agent-cli/dist/src/component/preparation.d.ts +10 -0
  644. package/vendor/agent-cli/dist/src/component/preparation.d.ts.map +1 -0
  645. package/vendor/agent-cli/dist/src/component/preparation.js +35 -0
  646. package/vendor/agent-cli/dist/src/component/preparation.js.map +1 -0
  647. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts +15 -0
  648. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts.map +1 -0
  649. package/vendor/agent-cli/dist/src/component/runtime-tools.js +37 -0
  650. package/vendor/agent-cli/dist/src/component/runtime-tools.js.map +1 -0
  651. package/vendor/agent-cli/dist/src/component/runtime.d.ts +8 -0
  652. package/vendor/agent-cli/dist/src/component/runtime.d.ts.map +1 -0
  653. package/vendor/agent-cli/dist/src/component/runtime.js +95 -0
  654. package/vendor/agent-cli/dist/src/component/runtime.js.map +1 -0
  655. package/vendor/agent-cli/dist/src/config/config-store.d.ts +50 -0
  656. package/vendor/agent-cli/dist/src/config/config-store.d.ts.map +1 -0
  657. package/vendor/agent-cli/dist/src/config/config-store.js +117 -0
  658. package/vendor/agent-cli/dist/src/config/config-store.js.map +1 -0
  659. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts +17 -0
  660. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts.map +1 -0
  661. package/vendor/agent-cli/dist/src/context/cache-lease.js +133 -0
  662. package/vendor/agent-cli/dist/src/context/cache-lease.js.map +1 -0
  663. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts +9 -0
  664. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts.map +1 -0
  665. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js +51 -0
  666. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js.map +1 -0
  667. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +4 -0
  668. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +1 -0
  669. package/vendor/agent-cli/dist/src/context/cache-publication.js +54 -0
  670. package/vendor/agent-cli/dist/src/context/cache-publication.js.map +1 -0
  671. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts +12 -0
  672. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts.map +1 -0
  673. package/vendor/agent-cli/dist/src/context/client-context-view.js +100 -0
  674. package/vendor/agent-cli/dist/src/context/client-context-view.js.map +1 -0
  675. package/vendor/agent-cli/dist/src/context/context-budget.d.ts +3 -0
  676. package/vendor/agent-cli/dist/src/context/context-budget.d.ts.map +1 -0
  677. package/vendor/agent-cli/dist/src/context/context-budget.js +10 -0
  678. package/vendor/agent-cli/dist/src/context/context-budget.js.map +1 -0
  679. package/vendor/agent-cli/dist/src/context/context-cache.d.ts +108 -0
  680. package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +1 -0
  681. package/vendor/agent-cli/dist/src/context/context-cache.js +357 -0
  682. package/vendor/agent-cli/dist/src/context/context-cache.js.map +1 -0
  683. package/vendor/agent-cli/dist/src/context/context-project.d.ts +26 -0
  684. package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +1 -0
  685. package/vendor/agent-cli/dist/src/context/context-project.js +113 -0
  686. package/vendor/agent-cli/dist/src/context/context-project.js.map +1 -0
  687. package/vendor/agent-cli/dist/src/context/context-resource.d.ts +4 -0
  688. package/vendor/agent-cli/dist/src/context/context-resource.d.ts.map +1 -0
  689. package/vendor/agent-cli/dist/src/context/context-resource.js +11 -0
  690. package/vendor/agent-cli/dist/src/context/context-resource.js.map +1 -0
  691. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +9 -0
  692. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +1 -0
  693. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +134 -0
  694. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +1 -0
  695. package/vendor/agent-cli/dist/src/context/local-skills.d.ts +4 -0
  696. package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +1 -0
  697. package/vendor/agent-cli/dist/src/context/local-skills.js +157 -0
  698. package/vendor/agent-cli/dist/src/context/local-skills.js.map +1 -0
  699. package/vendor/agent-cli/dist/src/context/member-context.d.ts +19 -0
  700. package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +1 -0
  701. package/vendor/agent-cli/dist/src/context/member-context.js +105 -0
  702. package/vendor/agent-cli/dist/src/context/member-context.js.map +1 -0
  703. package/vendor/agent-cli/dist/src/context/member-documents.d.ts +3 -0
  704. package/vendor/agent-cli/dist/src/context/member-documents.d.ts.map +1 -0
  705. package/vendor/agent-cli/dist/src/context/member-documents.js +38 -0
  706. package/vendor/agent-cli/dist/src/context/member-documents.js.map +1 -0
  707. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts +3 -0
  708. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts.map +1 -0
  709. package/vendor/agent-cli/dist/src/context/member-profile-header.js +62 -0
  710. package/vendor/agent-cli/dist/src/context/member-profile-header.js.map +1 -0
  711. package/vendor/agent-cli/dist/src/context/member-profile.d.ts +43 -0
  712. package/vendor/agent-cli/dist/src/context/member-profile.d.ts.map +1 -0
  713. package/vendor/agent-cli/dist/src/context/member-profile.js +91 -0
  714. package/vendor/agent-cli/dist/src/context/member-profile.js.map +1 -0
  715. package/vendor/agent-cli/dist/src/context/member-selection.d.ts +7 -0
  716. package/vendor/agent-cli/dist/src/context/member-selection.d.ts.map +1 -0
  717. package/vendor/agent-cli/dist/src/context/member-selection.js +58 -0
  718. package/vendor/agent-cli/dist/src/context/member-selection.js.map +1 -0
  719. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +6 -0
  720. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +1 -0
  721. package/vendor/agent-cli/dist/src/context/script-dependencies.js +24 -0
  722. package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +1 -0
  723. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +3 -0
  724. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +1 -0
  725. package/vendor/agent-cli/dist/src/context/shared-cache-build.js +55 -0
  726. package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +1 -0
  727. package/vendor/agent-cli/dist/src/context/team-definition.d.ts +39 -0
  728. package/vendor/agent-cli/dist/src/context/team-definition.d.ts.map +1 -0
  729. package/vendor/agent-cli/dist/src/context/team-definition.js +78 -0
  730. package/vendor/agent-cli/dist/src/context/team-definition.js.map +1 -0
  731. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts +7 -0
  732. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +1 -0
  733. package/vendor/agent-cli/dist/src/context/team-knowledge.js +37 -0
  734. package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +1 -0
  735. package/vendor/agent-cli/dist/src/context/template-cache.d.ts +27 -0
  736. package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +1 -0
  737. package/vendor/agent-cli/dist/src/context/template-cache.js +100 -0
  738. package/vendor/agent-cli/dist/src/context/template-cache.js.map +1 -0
  739. package/vendor/agent-cli/dist/src/context/template-seed.d.ts +32 -0
  740. package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +1 -0
  741. package/vendor/agent-cli/dist/src/context/template-seed.js +117 -0
  742. package/vendor/agent-cli/dist/src/context/template-seed.js.map +1 -0
  743. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts +19 -0
  744. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts.map +1 -0
  745. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +292 -0
  746. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -0
  747. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +13 -0
  748. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +1 -0
  749. package/vendor/agent-cli/dist/src/context/user-skill-context.js +178 -0
  750. package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +1 -0
  751. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts +54 -0
  752. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts.map +1 -0
  753. package/vendor/agent-cli/dist/src/context/user-skill-install.js +184 -0
  754. package/vendor/agent-cli/dist/src/context/user-skill-install.js.map +1 -0
  755. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts +14 -0
  756. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts.map +1 -0
  757. package/vendor/agent-cli/dist/src/context/zip-extract.js +130 -0
  758. package/vendor/agent-cli/dist/src/context/zip-extract.js.map +1 -0
  759. package/vendor/agent-cli/dist/src/index.d.ts +56 -0
  760. package/vendor/agent-cli/dist/src/index.d.ts.map +1 -0
  761. package/vendor/agent-cli/dist/src/index.js +82 -0
  762. package/vendor/agent-cli/dist/src/index.js.map +1 -0
  763. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +68 -0
  764. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts.map +1 -0
  765. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +242 -0
  766. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +1 -0
  767. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts +40 -0
  768. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts.map +1 -0
  769. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +87 -0
  770. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +1 -0
  771. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts +134 -0
  772. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts.map +1 -0
  773. package/vendor/agent-cli/dist/src/lifecycle/registry.js +152 -0
  774. package/vendor/agent-cli/dist/src/lifecycle/registry.js.map +1 -0
  775. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts +40 -0
  776. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts.map +1 -0
  777. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js +149 -0
  778. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js.map +1 -0
  779. package/vendor/agent-cli/dist/src/mcp/client.d.ts +12 -0
  780. package/vendor/agent-cli/dist/src/mcp/client.d.ts.map +1 -0
  781. package/vendor/agent-cli/dist/src/mcp/client.js +95 -0
  782. package/vendor/agent-cli/dist/src/mcp/client.js.map +1 -0
  783. package/vendor/agent-cli/dist/src/mcp/connection.d.ts +14 -0
  784. package/vendor/agent-cli/dist/src/mcp/connection.d.ts.map +1 -0
  785. package/vendor/agent-cli/dist/src/mcp/connection.js +115 -0
  786. package/vendor/agent-cli/dist/src/mcp/connection.js.map +1 -0
  787. package/vendor/agent-cli/dist/src/mcp/execute.d.ts +5 -0
  788. package/vendor/agent-cli/dist/src/mcp/execute.d.ts.map +1 -0
  789. package/vendor/agent-cli/dist/src/mcp/execute.js +26 -0
  790. package/vendor/agent-cli/dist/src/mcp/execute.js.map +1 -0
  791. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts +11 -0
  792. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts.map +1 -0
  793. package/vendor/agent-cli/dist/src/mcp/instance-lock.js +51 -0
  794. package/vendor/agent-cli/dist/src/mcp/instance-lock.js.map +1 -0
  795. package/vendor/agent-cli/dist/src/mcp/types.d.ts +27 -0
  796. package/vendor/agent-cli/dist/src/mcp/types.d.ts.map +1 -0
  797. package/vendor/agent-cli/dist/src/mcp/types.js +2 -0
  798. package/vendor/agent-cli/dist/src/mcp/types.js.map +1 -0
  799. package/vendor/agent-cli/dist/src/protocol/input.d.ts +21 -0
  800. package/vendor/agent-cli/dist/src/protocol/input.d.ts.map +1 -0
  801. package/vendor/agent-cli/dist/src/protocol/input.js +95 -0
  802. package/vendor/agent-cli/dist/src/protocol/input.js.map +1 -0
  803. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts +58 -0
  804. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts.map +1 -0
  805. package/vendor/agent-cli/dist/src/protocol/link/channel.js +337 -0
  806. package/vendor/agent-cli/dist/src/protocol/link/channel.js.map +1 -0
  807. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts +13 -0
  808. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts.map +1 -0
  809. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js +27 -0
  810. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js.map +1 -0
  811. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts +57 -0
  812. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts.map +1 -0
  813. package/vendor/agent-cli/dist/src/protocol/link/envelope.js +93 -0
  814. package/vendor/agent-cli/dist/src/protocol/link/envelope.js.map +1 -0
  815. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts +28 -0
  816. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts.map +1 -0
  817. package/vendor/agent-cli/dist/src/protocol/link/liveness.js +86 -0
  818. package/vendor/agent-cli/dist/src/protocol/link/liveness.js.map +1 -0
  819. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts +14 -0
  820. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts.map +1 -0
  821. package/vendor/agent-cli/dist/src/protocol/link/middleware.js +40 -0
  822. package/vendor/agent-cli/dist/src/protocol/link/middleware.js.map +1 -0
  823. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts +31 -0
  824. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts.map +1 -0
  825. package/vendor/agent-cli/dist/src/protocol/link/rpc.js +90 -0
  826. package/vendor/agent-cli/dist/src/protocol/link/rpc.js.map +1 -0
  827. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts +32 -0
  828. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts.map +1 -0
  829. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js +106 -0
  830. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js.map +1 -0
  831. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +509 -0
  832. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +1 -0
  833. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +131 -0
  834. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +1 -0
  835. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +351 -0
  836. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -0
  837. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +103 -0
  838. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -0
  839. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts +9 -0
  840. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts.map +1 -0
  841. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js +58 -0
  842. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js.map +1 -0
  843. package/vendor/agent-cli/dist/src/security/command-parse.d.ts +21 -0
  844. package/vendor/agent-cli/dist/src/security/command-parse.d.ts.map +1 -0
  845. package/vendor/agent-cli/dist/src/security/command-parse.js +395 -0
  846. package/vendor/agent-cli/dist/src/security/command-parse.js.map +1 -0
  847. package/vendor/agent-cli/dist/src/security/command-translate.d.ts +30 -0
  848. package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +1 -0
  849. package/vendor/agent-cli/dist/src/security/command-translate.js +161 -0
  850. package/vendor/agent-cli/dist/src/security/command-translate.js.map +1 -0
  851. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts +18 -0
  852. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts.map +1 -0
  853. package/vendor/agent-cli/dist/src/security/context-write-policy.js +121 -0
  854. package/vendor/agent-cli/dist/src/security/context-write-policy.js.map +1 -0
  855. package/vendor/agent-cli/dist/src/security/guard.d.ts +41 -0
  856. package/vendor/agent-cli/dist/src/security/guard.d.ts.map +1 -0
  857. package/vendor/agent-cli/dist/src/security/guard.js +154 -0
  858. package/vendor/agent-cli/dist/src/security/guard.js.map +1 -0
  859. package/vendor/agent-cli/dist/src/security/mount-table.d.ts +47 -0
  860. package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +1 -0
  861. package/vendor/agent-cli/dist/src/security/mount-table.js +164 -0
  862. package/vendor/agent-cli/dist/src/security/mount-table.js.map +1 -0
  863. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts +23 -0
  864. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts.map +1 -0
  865. package/vendor/agent-cli/dist/src/security/sandbox-path.js +110 -0
  866. package/vendor/agent-cli/dist/src/security/sandbox-path.js.map +1 -0
  867. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts +5 -0
  868. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts.map +1 -0
  869. package/vendor/agent-cli/dist/src/security/tool-run-owner.js +16 -0
  870. package/vendor/agent-cli/dist/src/security/tool-run-owner.js.map +1 -0
  871. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +16 -0
  872. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +1 -0
  873. package/vendor/agent-cli/dist/src/security/tool-scope.js +88 -0
  874. package/vendor/agent-cli/dist/src/security/tool-scope.js.map +1 -0
  875. package/vendor/agent-cli/dist/src/session/client.d.ts +116 -0
  876. package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -0
  877. package/vendor/agent-cli/dist/src/session/client.js +376 -0
  878. package/vendor/agent-cli/dist/src/session/client.js.map +1 -0
  879. package/vendor/agent-cli/dist/src/session/custom-context.d.ts +6 -0
  880. package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +1 -0
  881. package/vendor/agent-cli/dist/src/session/custom-context.js +100 -0
  882. package/vendor/agent-cli/dist/src/session/custom-context.js.map +1 -0
  883. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts +38 -0
  884. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts.map +1 -0
  885. package/vendor/agent-cli/dist/src/session/engine-decide.js +87 -0
  886. package/vendor/agent-cli/dist/src/session/engine-decide.js.map +1 -0
  887. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts +4 -0
  888. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts.map +1 -0
  889. package/vendor/agent-cli/dist/src/session/execution-settlement.js +15 -0
  890. package/vendor/agent-cli/dist/src/session/execution-settlement.js.map +1 -0
  891. package/vendor/agent-cli/dist/src/session/link-config.d.ts +13 -0
  892. package/vendor/agent-cli/dist/src/session/link-config.d.ts.map +1 -0
  893. package/vendor/agent-cli/dist/src/session/link-config.js +29 -0
  894. package/vendor/agent-cli/dist/src/session/link-config.js.map +1 -0
  895. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts +30 -0
  896. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts.map +1 -0
  897. package/vendor/agent-cli/dist/src/session/link-outcome.js +67 -0
  898. package/vendor/agent-cli/dist/src/session/link-outcome.js.map +1 -0
  899. package/vendor/agent-cli/dist/src/session/link-session.d.ts +76 -0
  900. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -0
  901. package/vendor/agent-cli/dist/src/session/link-session.js +412 -0
  902. package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -0
  903. package/vendor/agent-cli/dist/src/session/local-execution.d.ts +28 -0
  904. package/vendor/agent-cli/dist/src/session/local-execution.d.ts.map +1 -0
  905. package/vendor/agent-cli/dist/src/session/local-execution.js +119 -0
  906. package/vendor/agent-cli/dist/src/session/local-execution.js.map +1 -0
  907. package/vendor/agent-cli/dist/src/session/member-tools.d.ts +22 -0
  908. package/vendor/agent-cli/dist/src/session/member-tools.d.ts.map +1 -0
  909. package/vendor/agent-cli/dist/src/session/member-tools.js +72 -0
  910. package/vendor/agent-cli/dist/src/session/member-tools.js.map +1 -0
  911. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts +7 -0
  912. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts.map +1 -0
  913. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js +30 -0
  914. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js.map +1 -0
  915. package/vendor/agent-cli/dist/src/session/process-environment.d.ts +3 -0
  916. package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +1 -0
  917. package/vendor/agent-cli/dist/src/session/process-environment.js +22 -0
  918. package/vendor/agent-cli/dist/src/session/process-environment.js.map +1 -0
  919. package/vendor/agent-cli/dist/src/session/process-request.d.ts +36 -0
  920. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -0
  921. package/vendor/agent-cli/dist/src/session/process-request.js +494 -0
  922. package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -0
  923. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts +8 -0
  924. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +1 -0
  925. package/vendor/agent-cli/dist/src/session/reference-tools.js +34 -0
  926. package/vendor/agent-cli/dist/src/session/reference-tools.js.map +1 -0
  927. package/vendor/agent-cli/dist/src/session/run-events.d.ts +81 -0
  928. package/vendor/agent-cli/dist/src/session/run-events.d.ts.map +1 -0
  929. package/vendor/agent-cli/dist/src/session/run-events.js +160 -0
  930. package/vendor/agent-cli/dist/src/session/run-events.js.map +1 -0
  931. package/vendor/agent-cli/dist/src/session/run-setup.d.ts +76 -0
  932. package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +1 -0
  933. package/vendor/agent-cli/dist/src/session/run-setup.js +273 -0
  934. package/vendor/agent-cli/dist/src/session/run-setup.js.map +1 -0
  935. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +41 -0
  936. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -0
  937. package/vendor/agent-cli/dist/src/session/run-start-body.js +64 -0
  938. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -0
  939. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts +17 -0
  940. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts.map +1 -0
  941. package/vendor/agent-cli/dist/src/session/team-persistence.js +75 -0
  942. package/vendor/agent-cli/dist/src/session/team-persistence.js.map +1 -0
  943. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts +37 -0
  944. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +1 -0
  945. package/vendor/agent-cli/dist/src/session/tool-scheduler.js +232 -0
  946. package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +1 -0
  947. package/vendor/agent-cli/dist/src/session/user-choice.d.ts +5 -0
  948. package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +1 -0
  949. package/vendor/agent-cli/dist/src/session/user-choice.js +80 -0
  950. package/vendor/agent-cli/dist/src/session/user-choice.js.map +1 -0
  951. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts +31 -0
  952. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +1 -0
  953. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +104 -0
  954. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +1 -0
  955. package/vendor/agent-cli/dist/src/shared/app-id.d.ts +13 -0
  956. package/vendor/agent-cli/dist/src/shared/app-id.d.ts.map +1 -0
  957. package/vendor/agent-cli/dist/src/shared/app-id.js +25 -0
  958. package/vendor/agent-cli/dist/src/shared/app-id.js.map +1 -0
  959. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts +13 -0
  960. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts.map +1 -0
  961. package/vendor/agent-cli/dist/src/shared/auth-headers.js +16 -0
  962. package/vendor/agent-cli/dist/src/shared/auth-headers.js.map +1 -0
  963. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts +3 -0
  964. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts.map +1 -0
  965. package/vendor/agent-cli/dist/src/shared/cli-version.js +22 -0
  966. package/vendor/agent-cli/dist/src/shared/cli-version.js.map +1 -0
  967. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts +14 -0
  968. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts.map +1 -0
  969. package/vendor/agent-cli/dist/src/shared/error-detail.js +29 -0
  970. package/vendor/agent-cli/dist/src/shared/error-detail.js.map +1 -0
  971. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts +36 -0
  972. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts.map +1 -0
  973. package/vendor/agent-cli/dist/src/shared/output-guard.js +94 -0
  974. package/vendor/agent-cli/dist/src/shared/output-guard.js.map +1 -0
  975. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts +3 -0
  976. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts.map +1 -0
  977. package/vendor/agent-cli/dist/src/shared/process-cwd.js +11 -0
  978. package/vendor/agent-cli/dist/src/shared/process-cwd.js.map +1 -0
  979. package/vendor/agent-cli/dist/src/shared/process-types.d.ts +60 -0
  980. package/vendor/agent-cli/dist/src/shared/process-types.d.ts.map +1 -0
  981. package/vendor/agent-cli/dist/src/shared/process-types.js +10 -0
  982. package/vendor/agent-cli/dist/src/shared/process-types.js.map +1 -0
  983. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts +7 -0
  984. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts.map +1 -0
  985. package/vendor/agent-cli/dist/src/shared/server-headers.js +113 -0
  986. package/vendor/agent-cli/dist/src/shared/server-headers.js.map +1 -0
  987. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts +47 -0
  988. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts.map +1 -0
  989. package/vendor/agent-cli/dist/src/shared/shell-runtime.js +210 -0
  990. package/vendor/agent-cli/dist/src/shared/shell-runtime.js.map +1 -0
  991. package/vendor/agent-cli/dist/src/shared/types.d.ts +458 -0
  992. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -0
  993. package/vendor/agent-cli/dist/src/shared/types.js +2 -0
  994. package/vendor/agent-cli/dist/src/shared/types.js.map +1 -0
  995. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +22 -0
  996. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +1 -0
  997. package/vendor/agent-cli/dist/src/shared/user-choice.js +2 -0
  998. package/vendor/agent-cli/dist/src/shared/user-choice.js.map +1 -0
  999. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts +9 -0
  1000. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts.map +1 -0
  1001. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js +85 -0
  1002. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js.map +1 -0
  1003. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +30 -0
  1004. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +1 -0
  1005. package/vendor/agent-cli/dist/src/tools/command-executor.js +96 -0
  1006. package/vendor/agent-cli/dist/src/tools/command-executor.js.map +1 -0
  1007. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts +16 -0
  1008. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts.map +1 -0
  1009. package/vendor/agent-cli/dist/src/tools/context-program-publish.js +104 -0
  1010. package/vendor/agent-cli/dist/src/tools/context-program-publish.js.map +1 -0
  1011. package/vendor/agent-cli/dist/src/tools/context-program.d.ts +21 -0
  1012. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -0
  1013. package/vendor/agent-cli/dist/src/tools/context-program.js +207 -0
  1014. package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -0
  1015. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +61 -0
  1016. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +1 -0
  1017. package/vendor/agent-cli/dist/src/tools/file-ops.js +477 -0
  1018. package/vendor/agent-cli/dist/src/tools/file-ops.js.map +1 -0
  1019. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts +58 -0
  1020. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +1 -0
  1021. package/vendor/agent-cli/dist/src/tools/local-hands.js +322 -0
  1022. package/vendor/agent-cli/dist/src/tools/local-hands.js.map +1 -0
  1023. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts +24 -0
  1024. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts.map +1 -0
  1025. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js +160 -0
  1026. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js.map +1 -0
  1027. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +66 -0
  1028. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +1 -0
  1029. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +65 -0
  1030. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +1 -0
  1031. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts +29 -0
  1032. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts.map +1 -0
  1033. package/vendor/agent-cli/dist/src/tools/tool-timeout.js +88 -0
  1034. package/vendor/agent-cli/dist/src/tools/tool-timeout.js.map +1 -0
  1035. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts +42 -0
  1036. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts.map +1 -0
  1037. package/vendor/agent-cli/dist/src/tools/write-guard.js +34 -0
  1038. package/vendor/agent-cli/dist/src/tools/write-guard.js.map +1 -0
  1039. package/vendor/agent-cli/package.json +29 -0
@@ -0,0 +1,17 @@
1
+ export function canvasPoint(canvas: HTMLCanvasElement, event: Pick<PointerEvent, 'clientX' | 'clientY'>): { x: number; y: number };
2
+ export interface Keyboard {
3
+ isDown(code: string): boolean; wasPressed(code: string): boolean; wasReleased(code: string): boolean;
4
+ axis(negative: readonly string[], positive: readonly string[]): number;
5
+ endFrame(): void; clear(): void; dispose(): void;
6
+ }
7
+ export function createKeyboard(target: EventTarget, options?: { blurTarget?: EventTarget; visibilityTarget?: Document; preventDefault?: readonly string[]; ignoreEditable?: boolean }): Keyboard;
8
+ export interface JoystickValue { x: number; y: number; active: boolean }
9
+ export function createJoystick(element: HTMLElement, options?: { radius?: number; deadZone?: number; floating?: boolean; scale?: () => number; onChange?: (value: JoystickValue) => void; blurTarget?: EventTarget }): { value(): JoystickValue; reset(): void; dispose(): void };
10
+ export interface ActionInputOptions {
11
+ keyboard?: Pick<Keyboard, 'isDown'>;
12
+ actions?: Record<string, readonly string[]>;
13
+ axes?: Record<string, { negative?: readonly string[]; positive?: readonly string[] }>;
14
+ buttons?: Record<string, () => boolean>;
15
+ analog?: Record<string, () => number>;
16
+ }
17
+ export function createActionInput(options?: ActionInputOptions): { sample(): void; isDown(name: string): boolean; wasPressed(name: string): boolean; wasReleased(name: string): boolean; axis(name: string): number; reset(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function canvasPoint(canvas,event){const rect=canvas.getBoundingClientRect();if(!(rect.width>0&&rect.height>0))throw new Error("Canvas must have a visible, nonzero CSS size");return{x:(event.clientX-rect.left)*canvas.width/rect.width,y:(event.clientY-rect.top)*canvas.height/rect.height}}__name(canvasPoint,"canvasPoint");function createKeyboard(target,{blurTarget=target,visibilityTarget,preventDefault=[],ignoreEditable=true}={}){const held=new Set,pressed=new Set,released=new Set;const blocked=new Set(preventDefault);const clear=__name(()=>{for(const code of held)released.add(code);held.clear();pressed.clear()},"clear");const onDown=__name(event=>{const node=event.target;if(ignoreEditable&&(node?.isContentEditable||/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(node?.tagName??"")))return;if(blocked.has(event.code))event.preventDefault();if(!held.has(event.code))pressed.add(event.code);held.add(event.code)},"onDown");const onUp=__name(event=>{if(held.delete(event.code))released.add(event.code)},"onUp");const onVisibility=__name(()=>{if(visibilityTarget?.hidden)clear()},"onVisibility");target.addEventListener("keydown",onDown);target.addEventListener("keyup",onUp);blurTarget.addEventListener("blur",clear);visibilityTarget?.addEventListener("visibilitychange",onVisibility);let disposed=false;return{isDown:__name(code=>held.has(code),"isDown"),wasPressed:__name(code=>pressed.has(code),"wasPressed"),wasReleased:__name(code=>released.has(code),"wasReleased"),axis:__name((negative,positive)=>Number(positive.some(code=>held.has(code)))-Number(negative.some(code=>held.has(code))),"axis"),endFrame(){pressed.clear();released.clear()},clear,dispose(){if(disposed)return;disposed=true;clear();target.removeEventListener("keydown",onDown);target.removeEventListener("keyup",onUp);blurTarget.removeEventListener("blur",clear);visibilityTarget?.removeEventListener("visibilitychange",onVisibility)}}}__name(createKeyboard,"createKeyboard");function createJoystick(element,{radius=60,deadZone=.12,floating=true,scale=__name(()=>1,"scale"),onChange,blurTarget}={}){if(!(radius>0)||!Number.isFinite(radius)||deadZone<0||deadZone>=1)throw new RangeError("Joystick requires radius > 0 and deadZone in [0, 1)");let pointerId=null,originX=0,originY=0,x=0,y=0,disposed=false;const oldTouchAction=element.style.touchAction;element.style.touchAction="none";const emit=__name(()=>onChange?.({x,y,active:pointerId!==null}),"emit");const move=__name(event=>{if(event.pointerId!==pointerId)return;event.preventDefault();const scaledRadius=radius*scale();if(!(scaledRadius>0)||!Number.isFinite(scaledRadius))throw new RangeError("Joystick scale must be finite and positive");const dx=(event.clientX-originX)/scaledRadius,dy=(event.clientY-originY)/scaledRadius;const length=Math.hypot(dx,dy);const magnitude=Math.min(1,Math.max(0,(length-deadZone)/(1-deadZone)));x=length?dx/length*magnitude:0;y=length?dy/length*magnitude:0;emit()},"move");const down=__name(event=>{if(pointerId!==null||event.pointerType==="mouse"&&event.button!==0)return;const rect=element.getBoundingClientRect();originX=floating?event.clientX:rect.left+rect.width/2;originY=floating?event.clientY:rect.top+rect.height/2;pointerId=event.pointerId;try{element.setPointerCapture(pointerId)}catch{}move(event)},"down");const reset=__name(()=>{const id=pointerId;pointerId=null;x=y=0;if(id!==null){try{element.releasePointerCapture(id)}catch{}}emit()},"reset");const end=__name(event=>{if(event.pointerId===pointerId)reset()},"end");element.addEventListener("pointerdown",down);element.addEventListener("pointermove",move);for(const name of["pointerup","pointercancel","lostpointercapture"])element.addEventListener(name,end);blurTarget?.addEventListener("blur",reset);return{value:__name(()=>({x,y,active:pointerId!==null}),"value"),reset,dispose(){if(disposed)return;disposed=true;try{reset()}finally{element.style.touchAction=oldTouchAction;element.removeEventListener("pointerdown",down);element.removeEventListener("pointermove",move);for(const name of["pointerup","pointercancel","lostpointercapture"])element.removeEventListener(name,end);blurTarget?.removeEventListener("blur",reset)}}}}__name(createJoystick,"createJoystick");function createActionInput({keyboard,actions={},axes={},buttons={},analog={}}={}){let previous={},current={},pressed={},released={};const anyKey=__name(keys=>(keys??[]).some(code=>keyboard?.isDown(code)),"anyKey");return{sample(){previous=current;current={};pressed={};released={};for(const name of new Set([...Object.keys(actions),...Object.keys(buttons)])){current[name]=anyKey(actions[name])||Boolean(buttons[name]?.());pressed[name]=current[name]&&!previous[name];released[name]=!current[name]&&Boolean(previous[name])}},isDown:__name(name=>Boolean(current[name]),"isDown"),wasPressed:__name(name=>Boolean(pressed[name]),"wasPressed"),wasReleased:__name(name=>Boolean(released[name]),"wasReleased"),axis(name){const keys=axes[name]??{};const digital=Number(anyKey(keys.positive))-Number(anyKey(keys.negative));const value=Number(analog[name]?.()??0);return Math.max(-1,Math.min(1,digital+(Number.isFinite(value)?value:0)))},reset(){previous={};current={};pressed={};released={}}}}__name(createActionInput,"createActionInput");export{canvasPoint,createActionInput,createJoystick,createKeyboard};
@@ -0,0 +1,40 @@
1
+ import type * as Three from 'three';
2
+ export interface AssetBox { size: Three.Vector3; min: Three.Vector3; max: Three.Vector3; center: Three.Vector3 }
3
+ export interface BoxCollider { cx: number; cy: number; cz: number; hw: number; hh: number; hd: number }
4
+ export function measureObject(THREE: typeof Three, object: Three.Object3D): AssetBox;
5
+ export function measureFromManifest(THREE: typeof Three, boxSize: string, boxOrigin?: string): AssetBox;
6
+ export function scaleForHeight(box: AssetBox, target: number): number;
7
+ export function scaleForWidth(box: AssetBox, target: number): number;
8
+ export function scaleForDepth(box: AssetBox, target: number): number;
9
+ export function scaleToFit(box: AssetBox, extent: number): number;
10
+ export function colliderTop(collider: BoxCollider): number;
11
+ export function colliderBottom(collider: BoxCollider): number;
12
+ export interface Placement { scale: Three.Vector3; size: Three.Vector3; bounds: Three.Box3; collider: BoxCollider; bottomY: number; topY: number }
13
+ export function placeOnSurface(THREE: typeof Three, object: Three.Object3D, options: { surfaceY: number; x: number; z: number; hover?: number; shrink?: number; rotationY?: number; scale?: number; targetHeight?: number; targetWidth?: number; targetDepth?: number }): Placement;
14
+ export function resolveGround(colliders: readonly BoxCollider[], x: number, z: number, radius: number, previousY: number, nextY: number, tolerance?: number): { grounded: boolean; groundY: number; index: number };
15
+ export function resolveSolid(colliders: readonly BoxCollider[], actor: { radius: number; height: number }, fromY: number, toX: number, toY: number, toZ: number): { x: number; y: number; z: number; grounded: boolean; ceiling: boolean; pushed: boolean };
16
+ export function hitByReach(origin: Three.Vector3Like, direction: Three.Vector3Like, reach: number, arcDot: number, target: BoxCollider, verticalTolerance: number): boolean;
17
+ export function hitByRadius(center: Three.Vector3Like, radius: number, target: BoxCollider, verticalTolerance: number): boolean;
18
+ export function makeTerrainMaterial(THREE: typeof Three, texture: Three.Texture, options: { planeSize: number | [number, number]; textureWorldSize?: number; tint?: Three.ColorRepresentation; roughness?: number; metalness?: number }): Three.MeshStandardMaterial;
19
+ export function makeFallbackTerrainTexture(THREE: typeof Three, canvas: HTMLCanvasElement, options?: { size?: number; color?: string; noise?: number; random?: () => number }): Three.CanvasTexture;
20
+ export function auditPlacement(entries: readonly { slot: string; placed: Placement; expectSurfaceY?: number; logicHalfWidth?: number }[], options?: { playerHeight?: number; maxHeightRatio?: number; minHeightRatio?: number; surfaceTolerance?: number; colliderTolerance?: number }): { slot: string; kind: 'oversize' | 'undersize' | 'not_on_surface' | 'collider_mismatch'; actual: number; expected: number }[];
21
+ export interface DisposeObjectOptions { disposeTextures?: boolean; exclude?: ReadonlySet<unknown>; remove?: boolean }
22
+ export function disposeObject(object: Three.Object3D, options?: DisposeObjectOptions): void;
23
+ export function loadModel<T>(loader: { loadAsync(url: string): Promise<T> }, url: string, options?: { signal?: AbortSignal; dispose?: (value: T) => void; onDisposeError?: (error: unknown) => void }): Promise<T>;
24
+ export function cloneModel<T extends Three.Object3D>(object: T, options?: { cloneSkeleton?: (object: T) => T; cloneMaterials?: boolean }): T;
25
+ export function createAnimationController(THREE: typeof Three, object: Three.Object3D, clips: readonly Three.AnimationClip[], options?: { onFinished?: (action: Three.AnimationAction) => void }): {
26
+ mixer: Three.AnimationMixer;
27
+ play(name: string, options?: { loop?: boolean; repetitions?: number; fadeSeconds?: number; timeScale?: number }): Three.AnimationAction;
28
+ update(dt: number): void; stop(): void; dispose(): void;
29
+ };
30
+ export function projectWorldLabel(THREE: typeof Three, position: Three.Vector3Like, camera: Three.Camera, width: number, height: number): { x: number; y: number; visible: boolean };
31
+ export function sunDirectionFrom(THREE: typeof Three, elevationDeg: number, azimuthDeg: number): Three.Vector3;
32
+ export function skyScaleFor(cameraFar: number): number;
33
+ export function createSky<T extends Three.Mesh<Three.BufferGeometry, Three.ShaderMaterial>>(THREE: typeof Three, options: {
34
+ Sky: new () => T; scene: Three.Scene; renderer?: Three.WebGLRenderer; cameraFar?: number; elevationDeg?: number; azimuthDeg?: number;
35
+ atmosphere?: Record<string, number>; bakeEnvironment?: boolean; nightBakeElevationDeg?: number;
36
+ }): { sky: T; sunDirection: Three.Vector3; environmentTarget: Three.WebGLRenderTarget | null; update(dt: number): void; dispose(): void };
37
+ export function makeSunLight(THREE: typeof Three, options: { scene: Three.Scene; renderer?: Three.WebGLRenderer; direction: Three.Vector3; color?: Three.ColorRepresentation; intensity?: number; distance?: number; castShadow?: boolean; shadowExtent?: number; shadowMapSize?: number }): { sun: Three.DirectionalLight; dispose(): void };
38
+ export function relativeLuminance(THREE: typeof Three, color: Three.ColorRepresentation): number;
39
+ export function effectiveAmbientLuminance(THREE: typeof Three, color: Three.ColorRepresentation, intensity: number): number;
40
+ export function skyVisibilityMargin(cameraHeight: number, cameraDistance: number, fovDeg: number): number;
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var positive=__name((value,label)=>{if(!(value>0)||!Number.isFinite(value))throw new RangeError(`${label} must be finite and positive`);return value},"positive");var number=__name((value,label)=>{if(!Number.isFinite(value))throw new TypeError(`${label} must be finite`);return value},"number");function measureObject(THREE,object){object.updateWorldMatrix(true,true);if(Math.abs(object.matrixWorld.determinant())<1e-12)throw new Error("Cannot measure an object with a singular world transform");const inverse=object.matrixWorld.clone().invert(),bounds=new THREE.Box3,point=new THREE.Vector3;object.traverse(node=>{const position=node.geometry?.attributes?.position;if(!position)return;const matrix=new THREE.Matrix4().multiplyMatrices(inverse,node.matrixWorld);for(let i=0;i<position.count;i++){if(node.isMesh&&typeof node.getVertexPosition==="function")node.getVertexPosition(i,point);else point.fromBufferAttribute(position,i);bounds.expandByPoint(point.applyMatrix4(matrix))}});if(bounds.isEmpty())throw new Error("Object has no measurable geometry");return{size:bounds.getSize(new THREE.Vector3),min:bounds.min.clone(),max:bounds.max.clone(),center:bounds.getCenter(new THREE.Vector3)}}__name(measureObject,"measureObject");function measureFromManifest(THREE,boxSize,boxOrigin){const triple=__name(text=>{const values2=String(text).split(",").map(Number);if(values2.length!==3||!values2.every(Number.isFinite))throw new TypeError("Expected three comma-separated finite numbers");return values2},"triple");const values=triple(boxSize);values.forEach(v=>positive(v,"box dimension"));const size=new THREE.Vector3(...values),center=boxOrigin===void 0?new THREE.Vector3(0,size.y/2,0):new THREE.Vector3(...triple(boxOrigin));const half=size.clone().multiplyScalar(.5);return{size,center,min:center.clone().sub(half),max:center.clone().add(half)}}__name(measureFromManifest,"measureFromManifest");var scaleForHeight=__name((box,target)=>positive(target,"targetHeight")/positive(box.size.y,"height"),"scaleForHeight");var scaleForWidth=__name((box,target)=>positive(target,"targetWidth")/positive(box.size.x,"width"),"scaleForWidth");var scaleForDepth=__name((box,target)=>positive(target,"targetDepth")/positive(box.size.z,"depth"),"scaleForDepth");var scaleToFit=__name((box,extent)=>Math.min(1,positive(extent,"extent")/positive(Math.max(box.size.x,box.size.y,box.size.z),"size")),"scaleToFit");var colliderTop=__name(collider=>collider.cy+collider.hh,"colliderTop");var colliderBottom=__name(collider=>collider.cy-collider.hh,"colliderBottom");function fromBounds(bounds,shrink=0){if(!Number.isFinite(shrink)||shrink<0||shrink>.4)throw new RangeError("shrink must be in [0, 0.4]");return{cx:(bounds.min.x+bounds.max.x)/2,cy:(bounds.min.y+bounds.max.y)/2,cz:(bounds.min.z+bounds.max.z)/2,hw:(bounds.max.x-bounds.min.x)*(1-shrink)/2,hh:(bounds.max.y-bounds.min.y)/2,hd:(bounds.max.z-bounds.min.z)*(1-shrink)/2}}__name(fromBounds,"fromBounds");function placeOnSurface(THREE,object,options){const{surfaceY,x,z,hover=0,shrink=0}=options;[surfaceY,x,z,hover].forEach(value=>number(value,"placement coordinate"));const dimensions=["targetHeight","targetWidth","targetDepth"].filter(key=>options[key]!==void 0);if(dimensions.length>1||dimensions.length&&options.scale!==void 0)throw new TypeError("Specify one target dimension or scale");if(options.rotationY!==void 0)object.rotation.y=number(options.rotationY,"rotationY");if(options.scale!==void 0)object.scale.setScalar(positive(options.scale,"scale"));object.updateWorldMatrix(true,true);const bounds=new THREE.Box3().setFromObject(object,true);if(bounds.isEmpty())throw new Error("Cannot place an object without geometry");if(dimensions.length){const axis={targetHeight:"y",targetWidth:"x",targetDepth:"z"}[dimensions[0]];const size=bounds.getSize(new THREE.Vector3);const ratio=positive(options[dimensions[0]],dimensions[0])/positive(size[axis],"object dimension");object.scale.multiplyScalar(ratio)}const world=object.getWorldPosition(new THREE.Vector3);world.x=x;world.z=z;object.position.copy(object.parent?object.parent.worldToLocal(world):world);object.updateWorldMatrix(true,true);bounds.setFromObject(object,true);const pivot=object.getWorldPosition(new THREE.Vector3);pivot.y+=surfaceY+hover-bounds.min.y;object.position.copy(object.parent?object.parent.worldToLocal(pivot):pivot);object.updateWorldMatrix(true,true);bounds.setFromObject(object,true);const collider=fromBounds(bounds,shrink);return{scale:object.scale.clone(),size:bounds.getSize(new THREE.Vector3),bounds,collider,bottomY:colliderBottom(collider),topY:colliderTop(collider)}}__name(placeOnSurface,"placeOnSurface");var horizontalOverlap=__name((c,x,z,radius)=>Math.abs(x-c.cx)<c.hw+radius&&Math.abs(z-c.cz)<c.hd+radius,"horizontalOverlap");function resolveGround(colliders,x,z,radius,previousY,nextY,tolerance=.05){let groundY=-Infinity,index=-1;if(nextY>previousY+tolerance)return{grounded:false,groundY:0,index:-1};colliders.forEach((c,i)=>{const top=colliderTop(c);if(horizontalOverlap(c,x,z,radius)&&previousY>=top-tolerance&&nextY<=top+tolerance&&top>groundY){groundY=top;index=i}});return{grounded:index!==-1,groundY:index===-1?0:groundY,index}}__name(resolveGround,"resolveGround");function resolveSolid(colliders,actor,fromY,toX,toY,toZ){let x=toX,y=toY,z=toZ,grounded=false,ceiling=false,pushed=false;const falling=toY<=fromY;for(const c of colliders){if(!horizontalOverlap(c,x,z,actor.radius))continue;const top=colliderTop(c),bottom=colliderBottom(c);if(falling&&fromY>=top-.05&&toY<=top&&(!grounded||top>y)){y=top;grounded=true}else if(!falling&&fromY+actor.height<=bottom+.05&&toY+actor.height>=bottom&&(!ceiling||bottom-actor.height<y)){y=bottom-actor.height;ceiling=true}}for(const c of colliders){if(!(y+actor.height>colliderBottom(c)+.02&&y<colliderTop(c)-.02)||!horizontalOverlap(c,x,z,actor.radius))continue;const dx=x-c.cx,dz=z-c.cz,overlapX=c.hw+actor.radius-Math.abs(dx),overlapZ=c.hd+actor.radius-Math.abs(dz);if(overlapX<overlapZ)x+=dx>=0?overlapX:-overlapX;else z+=dz>=0?overlapZ:-overlapZ;pushed=true}return{x,y,z,grounded,ceiling,pushed}}__name(resolveSolid,"resolveSolid");function hitByReach(origin,direction,reach,arcDot,target,verticalTolerance){if(Math.abs(target.cy-origin.y)>verticalTolerance+target.hh)return false;const dx=target.cx-origin.x,dz=target.cz-origin.z,distance=Math.hypot(dx,dz),norm=Math.hypot(direction.x,direction.z);if(distance>reach+Math.max(target.hw,target.hd))return false;return distance<1e-4||norm>0&&(dx*direction.x+dz*direction.z)/distance/norm>=arcDot}__name(hitByReach,"hitByReach");function hitByRadius(center,radius,target,verticalTolerance){return Math.abs(target.cy-center.y)<=verticalTolerance+target.hh&&Math.hypot(target.cx-center.x,target.cz-center.z)<=radius+Math.max(target.hw,target.hd)}__name(hitByRadius,"hitByRadius");function makeTerrainMaterial(THREE,texture,{planeSize,textureWorldSize=4,tint=16777215,roughness=.9,metalness=0}={}){const[width,depth]=Array.isArray(planeSize)?planeSize:[planeSize,planeSize];positive(width,"plane width");positive(depth,"plane depth");positive(textureWorldSize,"textureWorldSize");const map=texture.clone();map.wrapS=map.wrapT=THREE.RepeatWrapping;map.repeat.set(width/textureWorldSize,depth/textureWorldSize);map.colorSpace=THREE.SRGBColorSpace;map.needsUpdate=true;return new THREE.MeshStandardMaterial({map,color:tint,roughness,metalness})}__name(makeTerrainMaterial,"makeTerrainMaterial");function makeFallbackTerrainTexture(THREE,canvas,{size=64,color="#718061",noise=12,random=Math.random}={}){if(!Number.isInteger(size)||size<1)throw new RangeError("Texture size must be a positive integer");const context=canvas.getContext("2d");if(!context)throw new Error("Canvas 2D context required");canvas.width=canvas.height=size;context.fillStyle=color;context.fillRect(0,0,size,size);const data=context.getImageData(0,0,size,size);for(let i=0;i<data.data.length;i+=4){const offset=(random()*2-1)*noise;for(let j=0;j<3;j++)data.data[i+j]+=offset}context.putImageData(data,0,0);const texture=new THREE.CanvasTexture(canvas);texture.colorSpace=THREE.SRGBColorSpace;return texture}__name(makeFallbackTerrainTexture,"makeFallbackTerrainTexture");function auditPlacement(entries,{playerHeight,maxHeightRatio=8,minHeightRatio=.02,surfaceTolerance=.05,colliderTolerance=.2}={}){const issues=[];for(const entry of entries){const height=entry.placed.size.y;if(playerHeight>0&&height>playerHeight*maxHeightRatio)issues.push({slot:entry.slot,kind:"oversize",actual:height,expected:playerHeight*maxHeightRatio});if(playerHeight>0&&height<playerHeight*minHeightRatio)issues.push({slot:entry.slot,kind:"undersize",actual:height,expected:playerHeight*minHeightRatio});if(entry.expectSurfaceY!==void 0&&Math.abs(entry.placed.bottomY-entry.expectSurfaceY)>surfaceTolerance)issues.push({slot:entry.slot,kind:"not_on_surface",actual:entry.placed.bottomY,expected:entry.expectSurfaceY});if(entry.logicHalfWidth!==void 0&&(!(entry.logicHalfWidth>0)||Math.abs(entry.placed.collider.hw/entry.logicHalfWidth-1)>colliderTolerance))issues.push({slot:entry.slot,kind:"collider_mismatch",actual:entry.logicHalfWidth,expected:entry.placed.collider.hw})}return issues}__name(auditPlacement,"auditPlacement");function disposeObject(object,{disposeTextures=false,exclude=new Set,remove=true}={}){const resources=new Set;const include=__name(resource=>{if(resource&&!exclude.has(resource)&&typeof resource.dispose==="function")resources.add(resource)},"include");object.traverse(node=>{include(node.geometry);for(const material of Array.isArray(node.material)?node.material:[node.material]){if(!material||exclude.has(material))continue;include(material);if(disposeTextures){for(const value of Object.values(material))if(value?.isTexture)include(value);for(const uniform of Object.values(material.uniforms??{}))for(const value of Array.isArray(uniform.value)?uniform.value:[uniform.value])if(value?.isTexture)include(value)}}if(node.skeleton)include(node.skeleton)});if(remove)object.removeFromParent();for(const resource of resources)resource.dispose()}__name(disposeObject,"disposeObject");function loadModel(loader,url,{signal,dispose=__name(result=>disposeObject(result.scene??result,{disposeTextures:true}),"dispose"),onDisposeError}={}){if(signal?.aborted)return Promise.reject(signal.reason??new DOMException("Model load cancelled","AbortError"));return new Promise((resolve,reject)=>{let cancelled=false;const cancel=__name(()=>{cancelled=true;signal.removeEventListener("abort",cancel);reject(signal.reason??new DOMException("Model load cancelled","AbortError"))},"cancel");signal?.addEventListener("abort",cancel,{once:true});Promise.resolve().then(()=>loader.loadAsync(url)).then(result=>{signal?.removeEventListener("abort",cancel);if(cancelled){try{dispose(result)}catch(error){try{onDisposeError?.(error)}catch{}}return}resolve(result)},error=>{signal?.removeEventListener("abort",cancel);if(!cancelled)reject(error)})})}__name(loadModel,"loadModel");function cloneModel(object,{cloneSkeleton,cloneMaterials=false}={}){let skinned=false;object.traverse(node=>{if(node.isSkinnedMesh)skinned=true});if(skinned&&!cloneSkeleton)throw new Error("Skinned models require the caller to pass SkeletonUtils.clone");const cloned=skinned?cloneSkeleton(object):object.clone(true);if(cloneMaterials){const materials=new Map;const clone=__name(material=>{if(!materials.has(material))materials.set(material,material.clone());return materials.get(material)},"clone");cloned.traverse(node=>{if(node.material)node.material=Array.isArray(node.material)?node.material.map(clone):clone(node.material)})}return cloned}__name(cloneModel,"cloneModel");function createAnimationController(THREE,object,clips,{onFinished}={}){const names=new Map;for(const clip of clips){if(names.has(clip.name))throw new Error(`Duplicate animation '${clip.name}'`);names.set(clip.name,clip)}const mixer=new THREE.AnimationMixer(object);let current=null,disposed=false;const finished=__name(event=>onFinished?.(event.action),"finished");mixer.addEventListener("finished",finished);return{mixer,play(name,{loop=true,repetitions=Infinity,fadeSeconds=.2,timeScale=1}={}){if(disposed)throw new Error("Animation controller is disposed");const clip=names.get(name);if(!clip)throw new Error(`Unknown animation '${name}'`);if(!(fadeSeconds>=0)||!Number.isFinite(fadeSeconds)||!Number.isFinite(timeScale))throw new RangeError("Invalid animation fade or timeScale");const action=mixer.clipAction(clip);if(current&&current!==action){if(fadeSeconds)current.fadeOut(fadeSeconds);else current.stop()}action.reset().setLoop(loop?THREE.LoopRepeat:THREE.LoopOnce,repetitions);action.clampWhenFinished=!loop;action.timeScale=timeScale;if(fadeSeconds)action.fadeIn(fadeSeconds);action.play();current=action;return action},update(dt){if(disposed)return;if(!Number.isFinite(dt)||dt<0)throw new RangeError("Animation delta must be nonnegative");mixer.update(dt)},stop(){mixer.stopAllAction();current=null},dispose(){if(disposed)return;disposed=true;mixer.stopAllAction();mixer.removeEventListener("finished",finished);mixer.uncacheRoot(object)}}}__name(createAnimationController,"createAnimationController");function projectWorldLabel(THREE,position,camera,width,height){camera.updateWorldMatrix(true,false);const point=new THREE.Vector3(position.x,position.y,position.z).project(camera);return{x:(point.x+1)*width/2,y:(1-point.y)*height/2,visible:point.z>=-1&&point.z<=1&&Math.abs(point.x)<=1&&Math.abs(point.y)<=1}}__name(projectWorldLabel,"projectWorldLabel");function sunDirectionFrom(THREE,elevationDeg,azimuthDeg){return new THREE.Vector3().setFromSphericalCoords(1,(90-number(elevationDeg,"elevation"))*Math.PI/180,number(azimuthDeg,"azimuth")*Math.PI/180)}__name(sunDirectionFrom,"sunDirectionFrom");var skyScaleFor=__name(cameraFar=>positive(cameraFar,"cameraFar")*1.6,"skyScaleFor");function createSky(THREE,{Sky,scene,renderer,cameraFar=1e3,elevationDeg=32,azimuthDeg=200,atmosphere={},bakeEnvironment=false,nightBakeElevationDeg}={}){if(typeof Sky!=="function")throw new TypeError("Pass Sky from your Three.js addon installation");if(bakeEnvironment&&!renderer)throw new TypeError("Environment baking requires a WebGLRenderer");if(!scene?.add)throw new TypeError("Pass the application scene");const scale=skyScaleFor(cameraFar),direction=sunDirectionFrom(THREE,elevationDeg,azimuthDeg);for(const[name,value]of Object.entries(atmosphere))number(value,`Sky ${name}`);if(nightBakeElevationDeg!==void 0)number(nightBakeElevationDeg,"nightBakeElevationDeg");const sky=new Sky,uniforms=sky.material.uniforms;const previousEnvironment=scene.environment;let environmentTarget=null,disposed=false;if(!uniforms.sunPosition?.value?.copy){sky.geometry.dispose();sky.material.dispose();throw new Error("Sky addon must expose sunPosition")}sky.scale.setScalar(scale);const defaults={turbidity:2,rayleigh:1,mieCoefficient:.005,mieDirectionalG:.8};for(const[name,value]of Object.entries({...defaults,...atmosphere})){if(!uniforms[name]){sky.geometry.dispose();sky.material.dispose();throw new Error(`This Sky addon does not support '${name}'`)}uniforms[name].value=number(value,`Sky ${name}`)}uniforms.sunPosition.value.copy(direction);try{if(bakeEnvironment){const generator=new THREE.PMREMGenerator(renderer),bakeScene=new THREE.Scene;const disc=uniforms.showSunDisc?.value;try{if(elevationDeg<0&&nightBakeElevationDeg!==void 0)uniforms.sunPosition.value.copy(sunDirectionFrom(THREE,nightBakeElevationDeg,azimuthDeg));if(uniforms.showSunDisc)uniforms.showSunDisc.value=0;bakeScene.add(sky);environmentTarget=generator.fromScene(bakeScene)}finally{generator.dispose();uniforms.sunPosition.value.copy(direction);if(uniforms.showSunDisc)uniforms.showSunDisc.value=disc}scene.environment=environmentTarget.texture}scene.add(sky)}catch(error){sky.removeFromParent();sky.geometry.dispose();sky.material.dispose();environmentTarget?.dispose();throw error}return{sky,sunDirection:direction,environmentTarget,update(dt){if(disposed)return;if(!Number.isFinite(dt)||dt<0)throw new RangeError("Sky delta must be nonnegative");if(uniforms.time)uniforms.time.value+=dt},dispose(){if(disposed)return;disposed=true;sky.removeFromParent();sky.geometry.dispose();sky.material.dispose();if(environmentTarget){if(scene.environment===environmentTarget.texture)scene.environment=previousEnvironment;environmentTarget.dispose()}}}}__name(createSky,"createSky");function makeSunLight(THREE,{scene,renderer,direction,color=16773848,intensity=2,distance=100,castShadow=true,shadowExtent=60,shadowMapSize=2048}={}){positive(distance,"light distance");positive(shadowExtent,"shadowExtent");if(castShadow&&!renderer)throw new TypeError("Pass renderer to explicitly enable its shadows");const sun=new THREE.DirectionalLight(color,intensity);sun.position.copy(direction).normalize().multiplyScalar(distance);sun.castShadow=castShadow;if(castShadow){renderer.shadowMap.enabled=true;Object.assign(sun.shadow.camera,{left:-shadowExtent,right:shadowExtent,top:shadowExtent,bottom:-shadowExtent,near:.5,far:Math.max(200,distance*3)});sun.shadow.camera.updateProjectionMatrix();sun.shadow.mapSize.set(shadowMapSize,shadowMapSize);sun.shadow.normalBias=.02;sun.shadow.bias=-5e-4}scene.add(sun);scene.add(sun.target);let disposed=false;return{sun,dispose(){if(disposed)return;disposed=true;sun.removeFromParent();sun.target.removeFromParent();sun.dispose()}}}__name(makeSunLight,"makeSunLight");function relativeLuminance(THREE,color){const c=new THREE.Color(color);return .2126*c.r+.7152*c.g+.0722*c.b}__name(relativeLuminance,"relativeLuminance");var effectiveAmbientLuminance=__name((THREE,color,intensity)=>relativeLuminance(THREE,color)*Math.max(0,intensity),"effectiveAmbientLuminance");var skyVisibilityMargin=__name((cameraHeight,cameraDistance,fovDeg)=>fovDeg/2-Math.atan2(Math.max(0,cameraHeight),Math.max(1e-6,cameraDistance))*180/Math.PI,"skyVisibilityMargin");export{auditPlacement,cloneModel,colliderBottom,colliderTop,createAnimationController,createSky,disposeObject,effectiveAmbientLuminance,hitByRadius,hitByReach,loadModel,makeFallbackTerrainTexture,makeSunLight,makeTerrainMaterial,measureFromManifest,measureObject,placeOnSurface,projectWorldLabel,relativeLuminance,resolveGround,resolveSolid,scaleForDepth,scaleForHeight,scaleForWidth,scaleToFit,skyScaleFor,skyVisibilityMargin,sunDirectionFrom};
@@ -0,0 +1,10 @@
1
+ export interface UiRect { x: number; y: number; width: number; height: number }
2
+ export interface UiStage {
3
+ root: HTMLDivElement; stage: HTMLDivElement; readonly scale: number;
4
+ resize(cssWidth?: number, cssHeight?: number): void; layer(name: string): HTMLDivElement; dispose(): void;
5
+ }
6
+ export function createUiStage(container: HTMLElement, options: { width: number; height: number; layers?: Record<string, number>; zIndex?: number }): UiStage;
7
+ export function setRect(element: HTMLElement, rect: UiRect): void;
8
+ export function applyNineSlice<T extends HTMLElement>(element: T, url: string, borders: { top: number; right?: number; bottom?: number; left?: number }): T;
9
+ export function createButton(document: Document, options?: { label?: string; onClick?: (event: MouseEvent) => void; dragThreshold?: number; scale?: () => number; disabled?: boolean; className?: string }): { element: HTMLButtonElement; dispose(): void };
10
+ export function createWorldLabel(element: HTMLElement, project: () => { x: number; y: number; visible?: boolean } | null, options?: { offsetX?: number; offsetY?: number }): { update(): void; dispose(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function createUiStage(container,{width,height,layers={background:0,hud:100,panel:300,scrim:600,modal:650,toast:900},zIndex=10}={}){if(!(width>0&&height>0)||!Number.isFinite(width+height))throw new RangeError("UI design size must be positive");const document=container.ownerDocument;const root=document.createElement("div"),stage=document.createElement("div");Object.assign(root.style,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden",zIndex:String(zIndex)});Object.assign(stage.style,{position:"absolute",left:"50%",top:"50%",width:`${width}px`,height:`${height}px`,transformOrigin:"center center",pointerEvents:"none"});root.appendChild(stage);const layerElements=new Map;for(const[name,order]of Object.entries(layers)){const element=document.createElement("div");element.dataset.layer=name;Object.assign(element.style,{position:"absolute",inset:"0",pointerEvents:"none",zIndex:String(order)});stage.appendChild(element);layerElements.set(name,element)}container.appendChild(root);let scale=1;const resize=__name((cssWidth=container.clientWidth,cssHeight=container.clientHeight)=>{if(!(cssWidth>=0&&cssHeight>=0)||!Number.isFinite(cssWidth+cssHeight))throw new RangeError("UI container size must be finite and nonnegative");scale=Math.min(cssWidth/width,cssHeight/height);stage.style.transform=`translate(-50%, -50%) scale(${scale})`},"resize");resize();return{root,stage,resize,get scale(){return scale},layer(name){const element=layerElements.get(name);if(!element)throw new Error(`Unknown UI layer '${name}'`);return element},dispose(){root.remove();layerElements.clear()}}}__name(createUiStage,"createUiStage");function setRect(element,{x,y,width,height}){if(![x,y,width,height].every(Number.isFinite))throw new TypeError("UI rect values must be finite");Object.assign(element.style,{position:"absolute",left:`${x}px`,top:`${y}px`,width:`${width}px`,height:`${height}px`})}__name(setRect,"setRect");function applyNineSlice(element,url,{top,right=top,bottom=top,left=right}){if(![top,right,bottom,left].every(value=>Number.isFinite(value)&&value>=0))throw new RangeError("Nine-slice borders must be nonnegative");Object.assign(element.style,{borderImageSource:`url(${JSON.stringify(url)})`,borderImageSlice:`${top} ${right} ${bottom} ${left} fill`,borderImageRepeat:"stretch",borderStyle:"solid",borderColor:"transparent",borderWidth:`${top}px ${right}px ${bottom}px ${left}px`,boxSizing:"border-box"});return element}__name(applyNineSlice,"applyNineSlice");function createButton(document,{label="",onClick,dragThreshold=20,scale=__name(()=>1,"scale"),disabled=false,className=""}={}){const element=document.createElement("button");element.type="button";element.textContent=label;element.disabled=disabled;element.className=className;element.style.pointerEvents="auto";const pointers=new Map;let suppressClick=false;const down=__name(event=>{suppressClick=false;pointers.set(event.pointerId,{x:event.clientX,y:event.clientY,moved:false})},"down");const move=__name(event=>{const p=pointers.get(event.pointerId);if(p&&Math.hypot(event.clientX-p.x,event.clientY-p.y)>dragThreshold*scale())p.moved=true},"move");const up=__name(event=>{move(event);const p=pointers.get(event.pointerId);suppressClick=Boolean(p?.moved);pointers.delete(event.pointerId)},"up");const cancel=__name(event=>{pointers.delete(event.pointerId);suppressClick=true},"cancel");const click=__name(event=>{if(element.disabled||event.detail!==0&&suppressClick){suppressClick=false;event.preventDefault();return}onClick?.(event)},"click");const handlers={pointerdown:down,pointermove:move,pointerup:up,pointercancel:cancel,click};for(const[name,handler]of Object.entries(handlers))element.addEventListener(name,handler);return{element,dispose(){for(const[name,handler]of Object.entries(handlers))element.removeEventListener(name,handler);pointers.clear();element.remove()}}}__name(createButton,"createButton");function createWorldLabel(element,project,{offsetX=0,offsetY=0}={}){Object.assign(element.style,{position:"absolute",pointerEvents:"none",transform:"translate(-50%, -100%)"});let disposed=false;return{update(){if(disposed)return;const point=project();const visible=point&&point.visible!==false&&Number.isFinite(point.x)&&Number.isFinite(point.y);element.hidden=!visible;if(visible){element.style.left=`${point.x+offsetX}px`;element.style.top=`${point.y+offsetY}px`}},dispose(){if(!disposed){disposed=true;element.remove()}}}}__name(createWorldLabel,"createWorldLabel");export{applyNineSlice,createButton,createUiStage,createWorldLabel,setRect};
@@ -0,0 +1,8 @@
1
+ import type { AssetUrlOptions } from './assets.mjs';
2
+ export interface VideoRect { x: number; y: number; width: number; height: number }
3
+ export interface VideoOverlayOptions extends AssetUrlOptions {
4
+ crossOrigin?: string; muted?: boolean; mutedRetry?: boolean; loop?: boolean; controls?: boolean; interactive?: boolean;
5
+ fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; autoClose?: boolean; rect?: VideoRect;
6
+ onEnded?: () => void; onError?: (error: Error) => void;
7
+ }
8
+ export function createVideoOverlay(container: HTMLElement, url: string, options?: VideoOverlayOptions): { element: HTMLVideoElement; play(): Promise<void>; setRect(rect?: VideoRect): void; dispose(): void };
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function resolveAssetUrl(path,{cdnBaseUrl="",baseUrl}={}){const value=String(path??"").trim();if(!value)throw new TypeError("Asset path must not be empty");if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))return value;const encoded=encodeURI(value).replace(/%25([\da-f]{2})/gi,"%$1");const localPrefix=/^(?:assets|game|res|cfg|fonts)\//.test(value);if(cdnBaseUrl&&!localPrefix&&(value.startsWith("/Game/")||!/^(?:\/|\.\.?\/)/.test(value))){return`${cdnBaseUrl.replace(/\/+$/,"")}/${encoded.replace(/^\/+/,"")}`}return baseUrl?new URL(encoded,baseUrl).href:encoded}__name(resolveAssetUrl,"resolveAssetUrl");function createVideoOverlay(container,url,options={}){const element=container.ownerDocument.createElement("video");element.crossOrigin=options.crossOrigin??"anonymous";element.playsInline=true;element.preload="auto";element.muted=options.muted??false;element.loop=options.loop??false;element.controls=options.controls??false;Object.assign(element.style,{position:"absolute",pointerEvents:options.interactive?"auto":"none",objectFit:options.fit??"contain"});let disposed=false;function setRect(rect){if(!rect)Object.assign(element.style,{left:"0",top:"0",width:"100%",height:"100%"});else{if(![rect.x,rect.y,rect.width,rect.height].every(Number.isFinite)||rect.width<=0||rect.height<=0)throw new RangeError("Video rect requires finite coordinates and positive dimensions");Object.assign(element.style,{left:`${rect.x}px`,top:`${rect.y}px`,width:`${rect.width}px`,height:`${rect.height}px`})}}__name(setRect,"setRect");function dispose(){if(disposed)return;disposed=true;element.removeEventListener("ended",onEnded);element.removeEventListener("error",onError);element.pause();element.removeAttribute("src");element.load();element.remove()}__name(dispose,"dispose");const onEnded=__name(()=>{try{options.onEnded?.()}finally{if(options.autoClose!==false)dispose()}},"onEnded");const onError=__name(()=>{try{options.onError?.(new Error(`Video load failed: ${element.src}`))}finally{dispose()}},"onError");setRect(options.rect);element.addEventListener("ended",onEnded);element.addEventListener("error",onError);element.src=resolveAssetUrl(url,options);container.appendChild(element);return{element,setRect,dispose,async play(){if(disposed)throw new Error("Video overlay is disposed");try{await element.play()}catch(error){if(disposed)throw error;if(options.mutedRetry&&!element.muted){element.muted=true;await element.play()}else throw error}}}}__name(createVideoOverlay,"createVideoOverlay");export{createVideoOverlay};
@@ -0,0 +1,32 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { join, resolve, relative, isAbsolute } from 'node:path';
4
+ import { pathToFileURL } from 'node:url';
5
+
6
+ const project = resolve(process.cwd());
7
+ const candidates = [
8
+ process.env.CLAUDE_DIR
9
+ ? join(process.env.CLAUDE_DIR, 'skills/export-config/scripts/export-config.mjs')
10
+ : '',
11
+ resolve(project, '../.claude/skills/export-config/scripts/export-config.mjs'),
12
+ ].filter(Boolean);
13
+ const skill = candidates.find((path) => existsSync(path));
14
+ if (skill) {
15
+ await import(pathToFileURL(skill).href);
16
+ process.exit(0);
17
+ }
18
+
19
+ let manifest;
20
+ try { manifest = JSON.parse(await readFile(join(project, 'game-runtime.json'), 'utf8')); }
21
+ catch (error) { if (error.code !== 'ENOENT') throw error; }
22
+ if (!manifest) process.exit(0);
23
+ if (typeof manifest.root !== 'string' || !manifest.root.startsWith('runtime/')) {
24
+ throw new Error('Invalid game-runtime.json root');
25
+ }
26
+ const cli = manifest.cli ?? 'cli.mjs';
27
+ if (!['cli.mjs', 'tooling/cli.mjs'].includes(cli)) throw new Error('Invalid runtime CLI entry');
28
+ const entry = resolve(project, manifest.root, cli);
29
+ const rel = relative(project, entry);
30
+ if (rel.startsWith('..') || isAbsolute(rel)) throw new Error('Runtime exporter must remain inside the project');
31
+ const { runCli } = await import(pathToFileURL(entry).href);
32
+ await runCli(['export-config', '--project', project]);
@@ -0,0 +1,50 @@
1
+ import { lstat, readFile, writeFile, rename, rm } from 'node:fs/promises';
2
+ import { dirname, resolve, join, relative, isAbsolute } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { createHash, randomUUID } from 'node:crypto';
5
+
6
+ const project = resolve(dirname(fileURLToPath(import.meta.url)), '..');
7
+ const manifest = JSON.parse(await readFile(join(project, 'game-runtime.json'), 'utf8'));
8
+ const directory = process.argv[2] ? resolve(process.argv[2]) : resolve(project, manifest.root);
9
+ if (process.argv.length > 3) throw new Error('Usage: refresh-runtime.mjs [runtime-directory]');
10
+ const info = await lstat(directory);
11
+ if (!info.isDirectory() || info.isSymbolicLink()) throw new Error('Runtime must be a real directory');
12
+ const releasePath = join(directory, 'release.json');
13
+ if (!(await lstat(releasePath)).isFile()) throw new Error('Release must be a regular file');
14
+ const previous = await readFile(releasePath, 'utf8');
15
+ const release = JSON.parse(previous);
16
+ if (!release.files || typeof release.files !== 'object' || Array.isArray(release.files) || !Object.keys(release.files).length) {
17
+ throw new Error('Release must list its runtime files');
18
+ }
19
+ const files = {};
20
+ for (const name of Object.keys(release.files).sort()) {
21
+ const parts = name.split('/');
22
+ if (parts.some(part => !/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(part)) || name === 'release.json') {
23
+ throw new Error(`Invalid runtime filename: ${name}`);
24
+ }
25
+ let path = directory;
26
+ for (const [index, part] of parts.entries()) {
27
+ path = join(path, part);
28
+ const entry = await lstat(path);
29
+ if (entry.isSymbolicLink() || (index === parts.length - 1 ? !entry.isFile() : !entry.isDirectory())) {
30
+ throw new Error(`Runtime must contain regular files and directories without links: ${name}`);
31
+ }
32
+ }
33
+ files[name] = createHash('sha256').update(await readFile(path)).digest('hex');
34
+ }
35
+ const changed = Object.keys(files).some(name => files[name] !== release.files[name]);
36
+ if (changed) {
37
+ release.files = files;
38
+ delete release.sourceRevision;
39
+ delete release.sourceDigest;
40
+ const temporary = `${releasePath}.${randomUUID()}.tmp`;
41
+ try {
42
+ await writeFile(temporary, `${JSON.stringify(release, null, 2)}\n`, { flag: 'wx' });
43
+ if (await readFile(releasePath, 'utf8') !== previous) throw new Error('Release changed during refresh');
44
+ await rename(temporary, releasePath);
45
+ } finally {
46
+ await rm(temporary, { force: true });
47
+ }
48
+ }
49
+ const location = relative(project, directory);
50
+ console.log(`[runtime] ${changed ? 'refreshed' : 'unchanged'}: ${isAbsolute(location) ? directory : location}`);
@@ -0,0 +1,121 @@
1
+ /**
2
+ * `#ui-root` / `#ui-stage` 的唯一 owner:把 `viewport.ts` 的解算结果落到 DOM 上。
3
+ *
4
+ * 落盘位置:`${CLAUDE_PROJECT_DIR}/src/display/ui-stage.ts`
5
+ *
6
+ * 职责边界:
7
+ * - 层级骨架(root / stage)用 runtime 的 `createUiStage()` 建,**不重写 runtime**;
8
+ * - stage 的**盒(width / height)与 transform(translate + scale)由本文件接管**,
9
+ * 不再调用 `ui.resize()`。
10
+ *
11
+ * 为什么必须接管:`createUiStage({ width, height })` 的尺寸是**构造期常量**,
12
+ * `resize()` 只会按它算 `min(cssW / width, cssH / height)`(contain 模型)。
13
+ * 短边锁定模型下长边随设备比例变化(1440 ~ 2400),设计尺寸不是常量,
14
+ * 因此必须每次 resize 重设 stage 盒。接管方式只是给暴露出来的 `stage` 元素写 3 个样式,
15
+ * 层级、`dispose()`、`layer()` 等能力仍全部来自 runtime。
16
+ *
17
+ * 为什么要 `id`:`#ui-root` 是平台截图合成(`connectPreview({ uiRoot })`)与视觉自检的
18
+ * 锚点,`#ui-stage` 是业务 CSS 与方向钩子的锚点。同域重绘必须能按固定 id 定位这一层。
19
+ */
20
+ import { computeLogicalSize, getOmniSafeFrame, getSafeFrame } from './viewport';
21
+ import type { LogicalSize, SafeFrame, ViewportOptions } from './viewport';
22
+ import { createUiStage } from '../../runtime/lightgame/1.0.0/tools/ui.mjs';
23
+
24
+ /** 稳定的 DOM 钩子,业务 CSS 与自检脚本依赖它们,不要改名 */
25
+ export const UI_ROOT_ID = 'ui-root';
26
+ export const UI_STAGE_ID = 'ui-stage';
27
+
28
+ export interface UiStageHandle {
29
+ readonly root: HTMLDivElement;
30
+ readonly stage: HTMLDivElement;
31
+ /** 当前逻辑尺寸(设计像素)。**不是常量**:短边恒定、长边随 viewport 比例伸缩 */
32
+ readonly logical: LogicalSize;
33
+ /** 逻辑像素 → CSS 像素的缩放系数。控件半径 / 拖动阈值等设计像素尺寸都乘它 */
34
+ readonly scale: number;
35
+ /** 当前方向下必须完整可见的居中区域(逻辑坐标) */
36
+ readonly safeFrame: SafeFrame;
37
+ /** 横竖都可见的居中方形(逻辑坐标)。转屏后也必须还在的元素用它 */
38
+ readonly omniSafeFrame: SafeFrame;
39
+ /**
40
+ * 取层段容器(`background` / `hud` / `panel` / `scrim` / `modal` / `toast`)。
41
+ * 直接透传 runtime 的层级能力:虚拟控件与业务 HUD 都挂进层段里,
42
+ * **不要自己在 stage 下另建一层** —— 会绕过层序,且破坏触点仲裁所依赖的插入顺序。
43
+ */
44
+ layer(name: string): HTMLDivElement;
45
+ /** 按 viewport(容器)CSS 尺寸重算并同步。入参必须是容器尺寸,不是 canvas 尺寸 */
46
+ apply(viewportW: number, viewportH: number): void;
47
+ /** 直接读容器实测尺寸再 apply;容器未布局(宽高为 0)时保持上一次的有效值 */
48
+ applyFromContainer(): void;
49
+ dispose(): void;
50
+ }
51
+
52
+ let current: UiStageHandle | null = null;
53
+
54
+ /** 入口 `initUiStage` 之后,`screenUi` 与虚拟控件共用这一层,不要再 `createUiStage`。 */
55
+ export function getUiStage(): UiStageHandle {
56
+ if (!current) throw new Error('UI stage 尚未 initUiStage');
57
+ return current;
58
+ }
59
+
60
+ export function initUiStage(container: HTMLElement, options?: ViewportOptions): UiStageHandle {
61
+ // 容器未布局(iframe 首帧)时 clientWidth/Height 为 0。此时用兜底解算值建 stage,
62
+ // 建完必须再走一次 applyFromContainer,等观测回调送来真实尺寸。
63
+ let logical = computeLogicalSize(container.clientWidth, container.clientHeight, options);
64
+
65
+ const ui = createUiStage(container, { width: logical.logicW, height: logical.logicH });
66
+ const root: HTMLDivElement = ui.root;
67
+ const stage: HTMLDivElement = ui.stage;
68
+ root.id = UI_ROOT_ID;
69
+ stage.id = UI_STAGE_ID;
70
+
71
+ const handle: UiStageHandle = {
72
+ root,
73
+ stage,
74
+ get logical() {
75
+ return logical;
76
+ },
77
+ get scale() {
78
+ return logical.scale;
79
+ },
80
+ get safeFrame() {
81
+ return getSafeFrame(logical, options);
82
+ },
83
+ get omniSafeFrame() {
84
+ return getOmniSafeFrame(logical, options);
85
+ },
86
+ layer(name: string): HTMLDivElement {
87
+ return ui.layer(name);
88
+ },
89
+ apply(viewportW: number, viewportH: number): void {
90
+ logical = computeLogicalSize(viewportW, viewportH, options);
91
+
92
+ // ── 接管 stage 盒与缩放(取代 ui.resize())──
93
+ // translate(-50%, -50%) 是 createUiStage 设好的居中方式,必须原样保留。
94
+ stage.style.width = `${logical.logicW}px`;
95
+ stage.style.height = `${logical.logicH}px`;
96
+ stage.style.transform = `translate(-50%, -50%) scale(${logical.scale})`;
97
+
98
+ // 方向钩子(**实测值**,转屏实时翻转)。业务 CSS 用
99
+ // `#ui-stage[data-orientation="portrait"] .xxx { ... }` 分支排布,
100
+ // 禁止在 JS 里读它分支布局逻辑。
101
+ stage.dataset.orientation = logical.orientation;
102
+
103
+ // 给「不在 stage 内」的元素(全屏视频层、canvas 内控件等)留一个换算入口:
104
+ // 设计像素尺寸 × --ui-scale = 实际 CSS 像素。
105
+ container.style.setProperty('--ui-scale', String(logical.scale));
106
+ },
107
+ applyFromContainer(): void {
108
+ const w = container.clientWidth;
109
+ const h = container.clientHeight;
110
+ if (w > 0 && h > 0) handle.apply(w, h);
111
+ },
112
+ dispose(): void {
113
+ if (current === handle) current = null;
114
+ ui.dispose();
115
+ },
116
+ };
117
+
118
+ handle.applyFromContainer();
119
+ current = handle;
120
+ return handle;
121
+ }
@@ -0,0 +1,254 @@
1
+ /**
2
+ * 显示器适配:短边锁定 + 长边扩展,**方向无关**。
3
+ *
4
+ * 落盘位置:`${CLAUDE_PROJECT_DIR}/src/display/viewport.ts`
5
+ * 本文件是纯函数模块:不引用 Phaser、不引用 runtime、不碰 DOM。渲染层、UI 层、
6
+ * 玩法层都从同一份解算结果取值,因此三者的坐标系必然一致。
7
+ *
8
+ * 核心规则(不依赖任何配置声明):
9
+ * - 哪条轴是短边由**运行时实测**决定:`vw >= vh` 即横向,反之纵向;
10
+ * - 短边逻辑长度恒为 shortEdge(默认 1080);
11
+ * - 长边逻辑长度 = shortEdge × (viewport 长边 / viewport 短边),clamp 到
12
+ * [minLong, maxLong](默认 [1440, 2400])。
13
+ *
14
+ * 由此:
15
+ * - **任何设备方向都铺满画布**,横竖屏都不留边;
16
+ * - 只有比 4:3 更方、或比 20:9 更长的极端比例才触发 clamp 并留边;
17
+ * - **短边方向的 scale 恒为 viewportShort / shortEdge**,所以「文字 ≥ 24 设计像素」
18
+ * 这类以设计像素表达的约束,其实际显示尺寸是可预测的。
19
+ *
20
+ * 这里**没有 orientation 配置项**。设备转屏时逻辑坐标系随之翻转,画面始终填满,
21
+ * 不存在「声明方向与设备方向不符」这种状态,因此也不需要方向守卫。
22
+ * 业务若需按方向调整排布,用 `#ui-stage` 上的 `data-orientation` 属性做 CSS 分支,
23
+ * 不要在 JS 里分支布局逻辑。
24
+ */
25
+
26
+ /** 可选覆盖项。绝大多数项目不需要传 —— 默认值就是规范值 */
27
+ export interface ViewportOptions {
28
+ /** 短边逻辑长度,默认 1080。非必要不要改 —— UI 字号阶梯与 24px 下限都以它为基准 */
29
+ shortEdge?: number;
30
+ /**
31
+ * 长边 clamp 范围 [min, max],单位为设计像素。
32
+ * 缺省时**按 shortEdge 派生**:`[shortEdge × 4/3, shortEdge × 20/9]`
33
+ * (默认 shortEdge 1080 → [1440, 2400]),即支持 4:3 ~ 20:9。
34
+ * 这样改 shortEdge 不会意外触发 clamp。显式传值则完全按传入的绝对像素。
35
+ */
36
+ longEdgeClamp?: [number, number];
37
+ }
38
+
39
+ /** 运行时**实测**方向,不是配置声明 */
40
+ export type Orientation = 'landscape' | 'portrait';
41
+
42
+ /** 一次 resize 的解算结果,UI 层与相机层共用 */
43
+ export interface LogicalSize {
44
+ /** 逻辑宽(设计像素) */
45
+ logicW: number;
46
+ /** 逻辑高(设计像素) */
47
+ logicH: number;
48
+ /** 逻辑像素 → CSS 像素的缩放系数 */
49
+ scale: number;
50
+ /** 居中偏移(CSS 像素)。未触发 clamp 时恒为 0 */
51
+ offsetX: number;
52
+ offsetY: number;
53
+ /** 长边是否被 clamp。为 true 时才会出现留边 */
54
+ clamped: boolean;
55
+ /** 本次解算时 viewport 的实际方向 */
56
+ orientation: Orientation;
57
+ }
58
+
59
+ /** 必须完整可见的区域(逻辑坐标,居中)。gameplay 关键元素不得出此范围 */
60
+ export interface SafeFrame {
61
+ x: number;
62
+ y: number;
63
+ width: number;
64
+ height: number;
65
+ }
66
+
67
+ const DEFAULT_SHORT_EDGE = 1080;
68
+ /** 默认支持的长短边比例区间:4:3 ~ 20:9 */
69
+ const DEFAULT_MIN_RATIO = 4 / 3;
70
+ const DEFAULT_MAX_RATIO = 20 / 9;
71
+
72
+ function clamp(value: number, min: number, max: number): number {
73
+ return Math.min(max, Math.max(min, value));
74
+ }
75
+
76
+ function resolveParams(options?: ViewportOptions): {
77
+ shortEdge: number;
78
+ minLong: number;
79
+ maxLong: number;
80
+ } {
81
+ const rawShort = Number(options?.shortEdge);
82
+ const shortEdge = rawShort > 0 ? rawShort : DEFAULT_SHORT_EDGE;
83
+ // 缺省 clamp 按短边派生,保证换 shortEdge 时比例区间不变
84
+ const [rawMin, rawMax] = options?.longEdgeClamp ?? [
85
+ shortEdge * DEFAULT_MIN_RATIO,
86
+ shortEdge * DEFAULT_MAX_RATIO,
87
+ ];
88
+ // 容错:配置写反或非法时退回派生默认,不让一处笔误把画面算崩
89
+ const minLong = rawMin > 0 ? Math.min(rawMin, rawMax) : shortEdge * DEFAULT_MIN_RATIO;
90
+ const maxLong = rawMax > 0 ? Math.max(rawMin, rawMax) : shortEdge * DEFAULT_MAX_RATIO;
91
+ return { shortEdge, minLong, maxLong };
92
+ }
93
+
94
+ /**
95
+ * 由 viewport 尺寸解算逻辑坐标系。**方向由入参实测得出,不接受方向声明。**
96
+ *
97
+ * @param viewportW CSS 像素宽(用容器 clientWidth,不要用 window.innerWidth ——
98
+ * iOS Safari 地址栏收起会改变后者,且预览跑在 iframe 里时它是宿主尺寸)
99
+ * @param viewportH CSS 像素高
100
+ * @param options 可选覆盖;缺省即规范值
101
+ */
102
+ export function computeLogicalSize(
103
+ viewportW: number,
104
+ viewportH: number,
105
+ options?: ViewportOptions,
106
+ ): LogicalSize {
107
+ const { shortEdge, minLong, maxLong } = resolveParams(options);
108
+
109
+ // iframe 尚未布局时宽高为 0,退回横向基准比例,避免除零产生 NaN 污染整条链路
110
+ if (!(viewportW > 0) || !(viewportH > 0)) {
111
+ return {
112
+ logicW: minLong,
113
+ logicH: shortEdge,
114
+ scale: 1,
115
+ offsetX: 0,
116
+ offsetY: 0,
117
+ clamped: false,
118
+ orientation: 'landscape',
119
+ };
120
+ }
121
+
122
+ // 方向来自实测。正方形(vw === vh)归为 landscape,避免边界抖动。
123
+ const landscape = viewportW >= viewportH;
124
+ const viewportShort = landscape ? viewportH : viewportW;
125
+ const viewportLong = landscape ? viewportW : viewportH;
126
+
127
+ const rawLong = shortEdge * (viewportLong / viewportShort);
128
+ const logicLong = clamp(rawLong, minLong, maxLong);
129
+ // 浮点比较用绝对误差:rawLong 来自除法,与 clamp 边界直接 !== 会误判
130
+ const clamped = Math.abs(logicLong - rawLong) > 1e-6;
131
+
132
+ const logicW = landscape ? logicLong : shortEdge;
133
+ const logicH = landscape ? shortEdge : logicLong;
134
+
135
+ // 未 clamp 时两轴比值相同,min 取到的就是短边比值,offset 自然为 0;
136
+ // clamp 后逻辑比例与 viewport 不符,min 保证内容不被裁切,多出部分成为留边。
137
+ const scale = Math.min(viewportW / logicW, viewportH / logicH);
138
+ const offsetX = (viewportW - logicW * scale) / 2;
139
+ const offsetY = (viewportH - logicH * scale) / 2;
140
+
141
+ return {
142
+ logicW,
143
+ logicH,
144
+ scale,
145
+ offsetX,
146
+ offsetY,
147
+ clamped,
148
+ orientation: landscape ? 'landscape' : 'portrait',
149
+ };
150
+ }
151
+
152
+ /**
153
+ * 当前方向下必须完整可见的居中区域(逻辑坐标)。
154
+ *
155
+ * 短边方向恒等于 shortEdge(全高/全宽可见),长边方向取 clamp 下限 minLong ——
156
+ * 即最方的受支持比例。在当前方向下该区域完整落在画面内,因此:
157
+ * - gameplay 关键元素(出生点、交互点、判定锚点、HUD 热区)必须在此范围内;
158
+ * - 长边方向超出 safe frame 的空间只用于背景延伸,不放判定相关内容。
159
+ *
160
+ * **注意 safe frame 随设备方向翻转**(横向 1440×1080 ↔ 纵向 1080×1440)。
161
+ * 需要「转屏后也必须还在」的元素改用 `getOmniSafeFrame()`。
162
+ */
163
+ export function getSafeFrame(logical: LogicalSize, options?: ViewportOptions): SafeFrame {
164
+ const { shortEdge, minLong } = resolveParams(options);
165
+ const landscape = logical.orientation === 'landscape';
166
+ const width = landscape ? Math.min(minLong, logical.logicW) : shortEdge;
167
+ const height = landscape ? shortEdge : Math.min(minLong, logical.logicH);
168
+ return {
169
+ x: (logical.logicW - width) / 2,
170
+ y: (logical.logicH - height) / 2,
171
+ width,
172
+ height,
173
+ };
174
+ }
175
+
176
+ /**
177
+ * 横竖方向都保证可见的居中方形区域(逻辑坐标,边长 = shortEdge)。
178
+ *
179
+ * 这是 landscape 与 portrait 两个 safe frame 的交集,是方向无关的最强保证。
180
+ * 用于「转屏后也必须还在」的元素 —— 暂停按钮、致命提示、新手引导锚点,
181
+ * 以及**玩法判定锚点不能超出**的范围(见 SKILL.md「世界取景」)。
182
+ */
183
+ export function getOmniSafeFrame(logical: LogicalSize, options?: ViewportOptions): SafeFrame {
184
+ const { shortEdge } = resolveParams(options);
185
+ const side = Math.min(shortEdge, logical.logicW, logical.logicH);
186
+ return {
187
+ x: (logical.logicW - side) / 2,
188
+ y: (logical.logicH - side) / 2,
189
+ width: side,
190
+ height: side,
191
+ };
192
+ }
193
+
194
+ /**
195
+ * 有界世界的取景矩形(逻辑坐标)。世界**居中**放进逻辑区域,多出的空间向四周均匀延伸。
196
+ *
197
+ * 两条轴各自独立判断,一个表达式覆盖两种情形:
198
+ *
199
+ * | 情形 | 结果 | 表现 |
200
+ * |---|---|---|
201
+ * | 世界 **窄于** 该轴逻辑长度 | 起点取负、长度取逻辑长度 | 取景被钳在居中位,世界居中、两侧留白 |
202
+ * | 世界 **不窄于** 该轴逻辑长度 | 等价于 `(0, 0, worldW, worldH)` | 相机正常跟随滚动 |
203
+ *
204
+ * 因此单轴滚动的横版世界会自动得到「滚动轴滚动 + 另一轴居中留白」,不需要按品类分支。
205
+ *
206
+ * **两个硬约束:**
207
+ *
208
+ * 1. **不要把返回值当作物理 / 碰撞边界。** 物理边界必须保持世界原尺寸
209
+ * `(0, 0, worldW, worldH)`,否则角色能走进留白区。
210
+ * 取景矩形是「镜头能看到哪」,物理边界是「角色能走到哪」,改造后二者不再相等。
211
+ * 2. **必须在 resize 回调里重算并重设。** 逻辑区域是运行时值,转屏或改窗口后旧值立即失效
212
+ * (世界会重新贴边)。Phaser 侧写在 `this.scale.on(Phaser.Scale.Events.RESIZE)` 里,
213
+ * 和背景铺满用的是同一个回调:
214
+ *
215
+ * ```ts
216
+ * private applyCameraBounds(): void {
217
+ * // this.scale.width/height 就是逻辑区域尺寸(入口已 setGameSize),不要再算一遍
218
+ * const b = getCameraBounds(WORLD_W, WORLD_H, this.scale.width, this.scale.height);
219
+ * this.cameras.main.setBounds(b.x, b.y, b.width, b.height);
220
+ * }
221
+ * // create() 与 this.scale.on(Phaser.Scale.Events.RESIZE) 里各调一次
222
+ * ```
223
+ *
224
+ * 另外注意世界坐标会出现**负值区域**(屏幕左边缘可能对应世界 x < 0),
225
+ * 所以出界判定一律用世界坐标与世界尺寸比较,写 `x < 0` 会误判。
226
+ *
227
+ * @param worldW 玩法世界宽(设计像素常量);无界世界传世界包围盒或按需放大
228
+ * @param worldH 玩法世界高
229
+ * @param logicW 当前逻辑区域宽。Phaser 场景里**直接传 `this.scale.width`**
230
+ * @param logicH 当前逻辑区域高。同上,传 `this.scale.height`
231
+ */
232
+ export interface CameraBounds {
233
+ /** 可能为负:世界窄于逻辑区域时,屏幕左/上边缘落在世界之外 */
234
+ x: number;
235
+ y: number;
236
+ width: number;
237
+ height: number;
238
+ }
239
+
240
+ export function getCameraBounds(
241
+ worldW: number,
242
+ worldH: number,
243
+ logicW: number,
244
+ logicH: number,
245
+ ): CameraBounds {
246
+ // -(0) 会得到 -0:数值上等价,但 Object.is(-0, 0) 为 false、JSON 往返也会变号,
247
+ // 对外暴露不干净。用 `|| 0` 把 ±0 一律归一到 +0。
248
+ return {
249
+ x: Math.min(0, -(logicW - worldW) / 2) || 0,
250
+ y: Math.min(0, -(logicH - worldH) / 2) || 0,
251
+ width: Math.max(worldW, logicW),
252
+ height: Math.max(worldH, logicH),
253
+ };
254
+ }