@playdrop/playdrop-cli 0.16.16 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/config/client-meta.json +4 -4
  2. package/dist/apiClient.d.ts +1 -2
  3. package/dist/apiClient.js +1 -16
  4. package/dist/appUrls.js +4 -0
  5. package/dist/apps/build.d.ts +12 -4
  6. package/dist/apps/build.js +55 -22
  7. package/dist/apps/index.d.ts +2 -1
  8. package/dist/apps/index.js +4 -1
  9. package/dist/apps/loadCheck.d.ts +5 -1
  10. package/dist/apps/loadCheck.js +52 -18
  11. package/dist/apps/serverBuild.d.ts +17 -0
  12. package/dist/apps/serverBuild.js +155 -0
  13. package/dist/apps/staticHtml.d.ts +1 -0
  14. package/dist/apps/staticHtml.js +19 -10
  15. package/dist/apps/upload.d.ts +12 -2
  16. package/dist/apps/upload.js +127 -46
  17. package/dist/catalogue.d.ts +23 -1
  18. package/dist/catalogue.js +126 -100
  19. package/dist/commandContext.d.ts +6 -3
  20. package/dist/commandContext.js +108 -18
  21. package/dist/commands/build.js +0 -7
  22. package/dist/commands/captureListing.d.ts +3 -0
  23. package/dist/commands/captureListing.js +48 -4
  24. package/dist/commands/chat.d.ts +4 -0
  25. package/dist/commands/chat.js +133 -8
  26. package/dist/commands/check.js +34 -1
  27. package/dist/commands/create.js +30 -263
  28. package/dist/commands/dev.js +37 -3
  29. package/dist/commands/devBrowser.js +2 -2
  30. package/dist/commands/devGameServer.d.ts +16 -0
  31. package/dist/commands/devGameServer.js +237 -0
  32. package/dist/commands/devRuntimeAssets.d.ts +1 -0
  33. package/dist/commands/devRuntimeAssets.js +2 -0
  34. package/dist/commands/devServer.d.ts +3 -0
  35. package/dist/commands/devServer.js +111 -5
  36. package/dist/commands/generation.d.ts +33 -4
  37. package/dist/commands/generation.js +304 -115
  38. package/dist/commands/login.js +23 -7
  39. package/dist/commands/review.d.ts +1 -1
  40. package/dist/commands/review.js +68 -95
  41. package/dist/commands/source.d.ts +19 -0
  42. package/dist/commands/source.js +142 -0
  43. package/dist/commands/tweaks.js +5 -11
  44. package/dist/commands/upload-content.d.ts +1 -1
  45. package/dist/commands/upload-content.js +16 -12
  46. package/dist/commands/upload.d.ts +17 -1
  47. package/dist/commands/upload.js +47 -10
  48. package/dist/commands/worker/archive-staging.d.ts +1 -0
  49. package/dist/commands/worker/archive-staging.js +13 -2
  50. package/dist/commands/worker/e2e-fixtures.d.ts +32 -0
  51. package/dist/commands/worker/e2e-fixtures.js +466 -0
  52. package/dist/commands/worker/game-server-infra.d.ts +80 -0
  53. package/dist/commands/worker/game-server-infra.js +595 -0
  54. package/dist/commands/worker/game-source-git.d.ts +126 -0
  55. package/dist/commands/worker/game-source-git.js +780 -0
  56. package/dist/commands/worker/generation.d.ts +94 -0
  57. package/dist/commands/worker/generation.js +1458 -0
  58. package/dist/commands/worker/runtime.d.ts +8 -10
  59. package/dist/commands/worker/runtime.js +51 -45
  60. package/dist/commands/worker.d.ts +79 -19
  61. package/dist/commands/worker.js +1796 -419
  62. package/dist/config.d.ts +2 -0
  63. package/dist/config.js +16 -3
  64. package/dist/environment.d.ts +0 -1
  65. package/dist/environment.js +0 -8
  66. package/dist/index.js +92 -13
  67. package/dist/workerAppProject.d.ts +1 -1
  68. package/dist/workerAppProject.js +15 -2
  69. package/node_modules/@playdrop/api-client/dist/client.d.ts +72 -25
  70. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  71. package/node_modules/@playdrop/api-client/dist/client.js +33 -0
  72. package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
  73. package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
  74. package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
  75. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
  76. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
  77. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +338 -41
  78. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
  79. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
  80. package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
  81. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
  82. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  83. package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
  84. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
  85. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
  86. package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
  87. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +35 -3
  88. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
  89. package/node_modules/@playdrop/api-client/dist/domains/chat.js +89 -7
  90. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
  91. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
  92. package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
  93. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
  94. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
  95. package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
  96. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
  97. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
  98. package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
  99. package/node_modules/@playdrop/api-client/dist/index.d.ts +80 -29
  100. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  101. package/node_modules/@playdrop/api-client/dist/index.js +217 -56
  102. package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
  103. package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
  104. package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
  105. package/node_modules/@playdrop/api-client/package.json +7 -0
  106. package/node_modules/@playdrop/config/client-meta.json +4 -4
  107. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
  108. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
  109. package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
  110. package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
  111. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  112. package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
  113. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
  114. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
  115. package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
  116. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
  117. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
  118. package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
  119. package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
  120. package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
  121. package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
  122. package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
  123. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  124. package/node_modules/@playdrop/config/package.json +6 -0
  125. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
  126. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
  127. package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
  128. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
  129. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
  130. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
  131. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
  132. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
  133. package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
  134. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
  135. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
  136. package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
  137. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
  138. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
  139. package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
  140. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
  141. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
  142. package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
  143. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
  144. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
  145. package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
  146. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
  147. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
  148. package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
  149. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
  150. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
  151. package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
  152. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
  153. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
  154. package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
  155. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
  156. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
  157. package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
  158. package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
  159. package/node_modules/@playdrop/game-source-git/package.json +28 -0
  160. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
  161. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
  162. package/node_modules/@playdrop/types/dist/agent-task-terminal.js +15 -9
  163. package/node_modules/@playdrop/types/dist/api.d.ts +728 -164
  164. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  165. package/node_modules/@playdrop/types/dist/api.js +60 -11
  166. package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
  167. package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
  168. package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
  169. package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
  170. package/node_modules/@playdrop/types/dist/asset.js +26 -26
  171. package/node_modules/@playdrop/types/dist/chat.d.ts +107 -3
  172. package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
  173. package/node_modules/@playdrop/types/dist/chat.js +33 -4
  174. package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
  175. package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
  176. package/node_modules/@playdrop/types/dist/index.js +7 -1
  177. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
  178. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
  179. package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
  180. package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
  181. package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
  182. package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
  183. package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
  184. package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
  185. package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
  186. package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
  187. package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
  188. package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
  189. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  190. package/node_modules/@playdrop/types/dist/version.js +111 -0
  191. package/node_modules/@playdrop/types/package.json +14 -0
  192. package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
  193. package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
  194. package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
  195. package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
  196. package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
  197. package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
  198. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
  199. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
  200. package/node_modules/@playdrop/vox-three/package.json +8 -4
  201. package/package.json +9 -11
  202. package/dist/assets/model-artifacts.d.ts +0 -8
  203. package/dist/assets/model-artifacts.js +0 -382
  204. package/dist/assets/model-worker.d.ts +0 -22
  205. package/dist/assets/model-worker.js +0 -123
  206. package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
  207. package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
  208. package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
  209. package/node_modules/@playdrop/ai-client/package.json +0 -22
  210. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
  211. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
  212. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
  213. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
  214. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
  215. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
  216. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
  217. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
  218. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
  219. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
  220. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
  221. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
  222. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
  223. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
  224. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
  225. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
  226. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
  227. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
  228. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
  229. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
  230. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
  231. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
  232. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
  233. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
  234. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
  235. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
  236. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
  237. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
  238. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
  239. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
  240. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
  241. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
  242. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
  243. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
  244. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
  245. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
  246. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
  247. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
  248. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
  249. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
  250. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
  251. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
  252. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
  253. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
  254. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
  255. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
  256. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
  257. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
  258. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
  259. package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
  260. package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
  261. package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
  262. package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
  263. package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
  264. package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
  265. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
  266. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
  267. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
  268. package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
  269. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
  270. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
  271. package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
  272. package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
  273. package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
  274. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
  275. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
  276. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
  277. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
  278. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
  279. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
  280. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
  281. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
  282. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
  283. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
  284. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
  285. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
  286. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
  287. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
  288. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
  289. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
  290. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
  291. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
  292. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
  293. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
  294. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
  295. package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
  296. package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
  297. package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
  298. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
  299. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
  300. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
  301. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
  302. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
  303. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
  304. package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
  305. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
  306. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
  307. package/node_modules/@playdrop/boxel-core/package.json +0 -19
  308. package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
  309. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
  310. package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
  311. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
  312. package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
  313. package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
  314. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
  315. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
  316. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
  317. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
  318. package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
  319. package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
  320. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
  321. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
  322. package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
  323. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
  324. package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
  325. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
  326. package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
  327. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
  328. package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
  329. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
  330. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
  331. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
  332. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
  333. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
  334. package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
  335. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
  336. package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
  337. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
  338. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
  339. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
  340. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
  341. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
  342. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
  343. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
  344. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
  345. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
  346. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
  347. package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
  348. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
  349. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
  350. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
  351. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
  352. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
  353. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
  354. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
  355. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
  356. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
  357. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
  358. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
  359. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
  360. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
  361. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
  362. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
  363. package/node_modules/@playdrop/boxel-three/package.json +0 -28
@@ -1,380 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseBoxelJson = exports.parseBoxel = exports.formatBoxel = void 0;
4
- const format_utils_1 = require("./format-utils");
5
- const validation_1 = require("./validation");
6
- const INDENT = " ";
7
- const indent = (level) => INDENT.repeat(level);
8
- const q = (value) => JSON.stringify(value);
9
- const formatVector = (vec) => `[${vec.map(format_utils_1.formatNumber).join(", ")}]`;
10
- const isZeroVector = (vec) => Array.isArray(vec) && vec.length > 0 && vec.every((value) => Math.abs(value) < 1e-6);
11
- const isUnitVector = (vec) => Array.isArray(vec) && vec.length === 3 && vec.every((value) => Math.abs(value - 1) < 1e-6);
12
- const formatStringArray = (values, level) => {
13
- if (values.length === 0)
14
- return "[]";
15
- return `[\n${values.map((value) => `${indent(level + 1)}${q(value)}`).join(",\n")}\n${indent(level)}]`;
16
- };
17
- const formatPatternData = (pattern, level) => {
18
- const width = Math.max(1, Math.round(pattern.size[0] ?? 1));
19
- const height = Math.max(1, Math.round(pattern.size[1] ?? 1));
20
- if (!Array.isArray(pattern.data) || pattern.data.length === 0 || width <= 0) {
21
- return [`${indent(level)}[]`];
22
- }
23
- const lines = [`${indent(level)}[`];
24
- for (let y = 0; y < height; y += 1) {
25
- const start = y * width;
26
- const slice = pattern.data.slice(start, start + width);
27
- const suffix = y === height - 1 ? "" : ",";
28
- lines.push(`${indent(level + 1)}${slice.map(format_utils_1.formatNumber).join(", ")}${suffix}`);
29
- }
30
- lines.push(`${indent(level)}]`);
31
- return lines;
32
- };
33
- const formatVoxelData = (voxel, level) => {
34
- const [sx, sy, sz] = voxel.size ?? [1, 1, 1];
35
- if (!Array.isArray(voxel.voxels) || voxel.voxels.length === 0 || sx <= 0 || sy <= 0 || sz <= 0) {
36
- return [`${indent(level)}[]`];
37
- }
38
- const lines = [`${indent(level)}[`];
39
- for (let z = 0; z < sz; z += 1) {
40
- for (let y = 0; y < sy; y += 1) {
41
- const row = [];
42
- for (let x = 0; x < sx; x += 1) {
43
- const index = x + y * sx + z * sx * sy;
44
- row.push(voxel.voxels[index] ?? 0);
45
- }
46
- const isLastRow = z === sz - 1 && y === sy - 1;
47
- const suffix = isLastRow ? "" : ",";
48
- lines.push(`${indent(level + 1)}${row.map(format_utils_1.formatNumber).join(", ")}${suffix}`);
49
- }
50
- }
51
- lines.push(`${indent(level)}]`);
52
- return lines;
53
- };
54
- const pushEntries = (lines, entries, level) => {
55
- entries.forEach((entry, entryIndex) => {
56
- const suffix = entryIndex === entries.length - 1 ? "" : ",";
57
- if (Array.isArray(entry)) {
58
- entry.forEach((line, lineIndex) => {
59
- const trailing = lineIndex === entry.length - 1 ? suffix : "";
60
- lines.push(line + trailing);
61
- });
62
- }
63
- else {
64
- lines.push(`${indent(level)}${entry}${suffix}`);
65
- }
66
- });
67
- };
68
- const formatNode = (node, level) => {
69
- const lines = [`${indent(level)}{`];
70
- const entries = [];
71
- entries.push(`"id": ${q(node.id)}`);
72
- entries.push(`"position": ${formatVector(node.position)}`);
73
- if (node.rotation && !isZeroVector(node.rotation)) {
74
- entries.push(`"rotation": ${formatVector(node.rotation)}`);
75
- }
76
- if (node.scale && !isUnitVector(node.scale)) {
77
- entries.push(`"scale": ${formatVector(node.scale)}`);
78
- }
79
- if (node.center && !isZeroVector(node.center)) {
80
- entries.push(`"center": ${formatVector(node.center)}`);
81
- }
82
- if (node.size)
83
- entries.push(`"size": ${formatVector(node.size)}`);
84
- if (node.connect !== undefined)
85
- entries.push(`"connect": ${q(node.connect)}`);
86
- if (node.mesh)
87
- entries.push(`"mesh": ${q(node.mesh)}`);
88
- if (node.children && node.children.length > 0) {
89
- const childrenLines = [`${indent(level + 1)}"children": [`];
90
- node.children.forEach((child, index) => {
91
- const childLines = formatNode(child, level + 2);
92
- childLines[childLines.length - 1] += index === node.children.length - 1 ? "" : ",";
93
- childrenLines.push(...childLines);
94
- });
95
- childrenLines.push(`${indent(level + 1)}]`);
96
- entries.push(childrenLines);
97
- }
98
- else {
99
- entries.push(`"children": []`);
100
- }
101
- pushEntries(lines, entries, level + 1);
102
- lines.push(`${indent(level)}}`);
103
- return lines;
104
- };
105
- const appendGeometry = (lines, geometry, level) => {
106
- lines.push(`${indent(level)}"geometry": {`);
107
- lines.push(`${indent(level + 1)}"id": ${q(geometry.id)},`);
108
- const nodeLines = formatNode(geometry.root, level + 1);
109
- lines.push(`${indent(level + 1)}"root": ${nodeLines[0].trimStart()}`);
110
- for (let i = 1; i < nodeLines.length; i += 1) {
111
- lines.push(nodeLines[i]);
112
- }
113
- lines.push(`${indent(level)}}`);
114
- };
115
- const appendPatterns = (lines, patterns, level) => {
116
- if (!patterns.length) {
117
- lines.push(`${indent(level)}"patterns": []`);
118
- return;
119
- }
120
- lines.push(`${indent(level)}"patterns": [`);
121
- patterns.forEach((pattern, index) => {
122
- lines.push(`${indent(level + 1)}{`);
123
- const entries = [];
124
- entries.push(`"id": ${q(pattern.id)}`);
125
- entries.push(`"size": ${formatVector(pattern.size)}`);
126
- const dataLines = formatPatternData(pattern, level + 2);
127
- dataLines[0] = `${indent(level + 2)}"data": ${dataLines[0].trimStart()}`;
128
- entries.push(dataLines);
129
- pushEntries(lines, entries, level + 2);
130
- lines.push(`${indent(level + 1)}}${index === patterns.length - 1 ? "" : ","}`);
131
- });
132
- lines.push(`${indent(level)}]`);
133
- };
134
- const appendMaterials = (lines, materials, level) => {
135
- if (!materials.length) {
136
- lines.push(`${indent(level)}"materials": []`);
137
- return;
138
- }
139
- lines.push(`${indent(level)}"materials": [`);
140
- materials.forEach((material, index) => {
141
- lines.push(`${indent(level + 1)}{`);
142
- const entries = [];
143
- entries.push(`"id": ${q(material.id)}`);
144
- entries.push(`"baseColor": ${formatVector(material.baseColor)}`);
145
- if (material.emissiveColor)
146
- entries.push(`"emissiveColor": ${formatVector(material.emissiveColor)}`);
147
- if (typeof material.opacity === "number")
148
- entries.push(`"opacity": ${(0, format_utils_1.formatNumber)(material.opacity)}`);
149
- pushEntries(lines, entries, level + 2);
150
- lines.push(`${indent(level + 1)}}${index === materials.length - 1 ? "" : ","}`);
151
- });
152
- lines.push(`${indent(level)}]`);
153
- };
154
- const appendTextures = (lines, textures, level) => {
155
- if (!textures.length) {
156
- lines.push(`${indent(level)}"textures": []`);
157
- return;
158
- }
159
- lines.push(`${indent(level)}"textures": [`);
160
- textures.forEach((texture, index) => {
161
- lines.push(`${indent(level + 1)}{`);
162
- const entries = [];
163
- entries.push(`"id": ${q(texture.id)}`);
164
- entries.push(`"pattern": ${q(texture.pattern)}`);
165
- entries.push(texture.materials.length === 0
166
- ? `${indent(level + 2)}"materials": []`
167
- : `${indent(level + 2)}"materials": ${formatStringArray(texture.materials, level + 2)}`);
168
- pushEntries(lines, entries, level + 2);
169
- lines.push(`${indent(level + 1)}}${index === textures.length - 1 ? "" : ","}`);
170
- });
171
- lines.push(`${indent(level)}]`);
172
- };
173
- const formatTexturedFaces = (textured, _level) => {
174
- const entries = [];
175
- if (textured.renderMode && textured.renderMode !== "plain") {
176
- entries.push(`"renderMode": ${q(textured.renderMode)}`);
177
- }
178
- const fields = [
179
- "top",
180
- "bottom",
181
- "north",
182
- "south",
183
- "east",
184
- "west",
185
- "sides",
186
- "all",
187
- "topOverlay",
188
- "bottomOverlay",
189
- "northOverlay",
190
- "southOverlay",
191
- "eastOverlay",
192
- "westOverlay",
193
- "sidesOverlay",
194
- "allOverlay",
195
- ];
196
- fields
197
- .filter((face) => typeof textured[face] === "string")
198
- .forEach((face) => {
199
- entries.push(`"${face}": ${q(textured[face])}`);
200
- });
201
- return entries;
202
- };
203
- const formatComboSlots = (combo, level) => {
204
- const lines = [];
205
- lines.push(`${indent(level)}"slots": [`);
206
- combo.slots.forEach((slot, index) => {
207
- lines.push(`${indent(level + 1)}{`);
208
- const entries = [];
209
- entries.push(`"id": ${q(slot.id)}`);
210
- entries.push(`"primitive": ${q(slot.primitive)}`);
211
- entries.push(`"offset": ${formatVector(slot.offset)}`);
212
- pushEntries(lines, entries, level + 2);
213
- lines.push(`${indent(level + 1)}}${index === combo.slots.length - 1 ? "" : ","}`);
214
- });
215
- lines.push(`${indent(level)}]`);
216
- return lines;
217
- };
218
- const appendPrimitives = (lines, primitives, level) => {
219
- if (!primitives.length) {
220
- lines.push(`${indent(level)}"primitives": []`);
221
- return;
222
- }
223
- lines.push(`${indent(level)}"primitives": [`);
224
- primitives.forEach((primitive, index) => {
225
- lines.push(`${indent(level + 1)}{`);
226
- const entries = [];
227
- entries.push(`"id": ${q(primitive.id)}`);
228
- entries.push(`"kind": ${q(primitive.kind)}`);
229
- entries.push(`"size": ${formatVector(primitive.size)}`);
230
- switch (primitive.kind) {
231
- case "plain_box":
232
- entries.push(`"material": ${q(primitive.material)}`);
233
- break;
234
- case "textured_box": {
235
- const texturedEntries = formatTexturedFaces(primitive, level + 2);
236
- entries.push(...texturedEntries);
237
- break;
238
- }
239
- case "voxel_box": {
240
- const voxelLines = formatVoxelData(primitive, level + 2);
241
- entries.push(primitive.palette && primitive.palette.length > 0
242
- ? `${indent(level + 2)}"palette": ${formatStringArray(primitive.palette, level + 2)}`
243
- : `${indent(level + 2)}"palette": []`);
244
- const dataLines = [...voxelLines];
245
- dataLines[0] = `${indent(level + 2)}"voxels": ${dataLines[0].trimStart()}`;
246
- entries.push(dataLines);
247
- break;
248
- }
249
- case "combo_box": {
250
- const slotLines = formatComboSlots(primitive, level + 2);
251
- entries.push(slotLines);
252
- break;
253
- }
254
- default:
255
- break;
256
- }
257
- pushEntries(lines, entries, level + 2);
258
- lines.push(`${indent(level + 1)}}${index === primitives.length - 1 ? "" : ","}`);
259
- });
260
- lines.push(`${indent(level)}]`);
261
- };
262
- const appendAnimations = (lines, animations, level) => {
263
- if (!animations.length) {
264
- lines.push(`${indent(level)}"animations": []`);
265
- return;
266
- }
267
- lines.push(`${indent(level)}"animations": [`);
268
- animations.forEach((animation, animationIndex) => {
269
- lines.push(`${indent(level + 1)}{`);
270
- const entries = [];
271
- entries.push(`"id": ${q(animation.id)}`);
272
- entries.push(`"duration": ${(0, format_utils_1.formatNumber)(animation.duration)}`);
273
- if (animation.channels.length === 0) {
274
- entries.push(`"channels": []`);
275
- }
276
- else {
277
- const channelLines = formatAnimationChannels(animation.channels, level + 2);
278
- entries.push(channelLines);
279
- }
280
- pushEntries(lines, entries, level + 2);
281
- lines.push(`${indent(level + 1)}}${animationIndex === animations.length - 1 ? "" : ","}`);
282
- });
283
- lines.push(`${indent(level)}]`);
284
- };
285
- const formatAnimationChannels = (channels, level) => {
286
- const lines = [];
287
- lines.push(`${indent(level)}"channels": [`);
288
- const orderedChannels = [...channels].sort((a, b) => {
289
- if (a.node === b.node) {
290
- return a.property.localeCompare(b.property);
291
- }
292
- return a.node.localeCompare(b.node);
293
- });
294
- orderedChannels.forEach((channel, channelIndex) => {
295
- lines.push(`${indent(level + 1)}{`);
296
- const entries = [];
297
- entries.push(`"node": ${q(channel.node)}`);
298
- entries.push(`"property": ${q(channel.property)}`);
299
- const keyframeLines = formatAnimationKeyframes(channel.keyframes, level + 2);
300
- entries.push(keyframeLines);
301
- pushEntries(lines, entries, level + 2);
302
- lines.push(`${indent(level + 1)}}${channelIndex === channels.length - 1 ? "" : ","}`);
303
- });
304
- lines.push(`${indent(level)}]`);
305
- return lines;
306
- };
307
- const formatAnimationKeyframes = (keyframes, level) => {
308
- if (!keyframes.length) {
309
- return [`${indent(level)}"keyframes": []`];
310
- }
311
- const lines = [];
312
- lines.push(`${indent(level)}"keyframes": [`);
313
- const orderedKeyframes = [...keyframes].sort((a, b) => a.time - b.time);
314
- orderedKeyframes.forEach((keyframe, keyframeIndex) => {
315
- lines.push(`${indent(level + 1)}{`);
316
- const entries = [];
317
- entries.push(`"time": ${(0, format_utils_1.formatNumber)(keyframe.time)}`);
318
- entries.push(`"value": ${formatVector(keyframe.value)}`);
319
- pushEntries(lines, entries, level + 2);
320
- lines.push(`${indent(level + 1)}}${keyframeIndex === keyframes.length - 1 ? "" : ","}`);
321
- });
322
- lines.push(`${indent(level)}]`);
323
- return lines;
324
- };
325
- const formatBoxel = (model) => {
326
- const lines = [];
327
- lines.push("{");
328
- lines.push(`${indent(1)}"id": ${q(model.id)},`);
329
- appendGeometry(lines, model.geometry, 1);
330
- const markComma = () => {
331
- const lastIndex = lines.length - 1;
332
- lines[lastIndex] = `${lines[lastIndex]},`;
333
- };
334
- markComma();
335
- appendPatterns(lines, model.patterns, 1);
336
- markComma();
337
- appendMaterials(lines, model.materials, 1);
338
- markComma();
339
- appendTextures(lines, model.textures, 1);
340
- markComma();
341
- appendPrimitives(lines, model.primitives, 1);
342
- markComma();
343
- appendAnimations(lines, model.animations, 1);
344
- lines.push("}");
345
- return lines.join("\n");
346
- };
347
- exports.formatBoxel = formatBoxel;
348
- const sanitizeErrorMessage = (error) => {
349
- if (!error)
350
- return "Unknown error";
351
- if (typeof error === "string")
352
- return error;
353
- if (error instanceof Error)
354
- return error.message;
355
- if (typeof error === "object" && "message" in error) {
356
- const candidate = error.message;
357
- return typeof candidate === "string" ? candidate : "Unknown error";
358
- }
359
- return String(error);
360
- };
361
- const parseBoxel = (candidate) => {
362
- return (0, validation_1.assertBoxel)(candidate);
363
- };
364
- exports.parseBoxel = parseBoxel;
365
- const parseBoxelJson = (raw) => {
366
- let parsed;
367
- try {
368
- parsed = JSON.parse(raw);
369
- }
370
- catch (error) {
371
- const issue = {
372
- path: "json",
373
- message: sanitizeErrorMessage(error),
374
- };
375
- throw new validation_1.BoxelValidationError("Failed to parse boxel JSON", [issue]);
376
- }
377
- return (0, exports.parseBoxel)(parsed);
378
- };
379
- exports.parseBoxelJson = parseBoxelJson;
380
- //# sourceMappingURL=serialization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../src/serialization.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAa9C,6CAA4F;AAE5F,MAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,MAAM,CAAC,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAI3D,MAAM,YAAY,GAAG,CAAC,GAAsB,EAAU,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,2BAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAEjG,MAAM,YAAY,GAAG,CAAC,GAAyC,EAAW,EAAE,CAC1E,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AAEvF,MAAM,YAAY,GAAG,CAAC,GAAyC,EAAW,EAAE,CAC1E,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,C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AE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QACpD,MAAM,SAAS,GAAI,KAA+B,CAAC,OAAO,CAAC;QAC3D,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC;AAEK,MAAM,UAAU,GAAG,CAAC,SAAkB,EAAmB,EAAE;IAChE,OAAO,IAAA,wBAAW,EAAC,SAAS,CAAC,CAAC;AAChC,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEK,MAAM,cAAc,GAAG,CAAC,GAAW,EAAmB,EAAE;IAC7D,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,GAAyB;YAClC,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC;SACrC,CAAC;QACF,MAAM,IAAI,iCAAoB,CAAC,4BAA4B,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,IAAA,kBAAU,EAAC,MAAM,CAAC,CAAC;AAC5B,CAAC,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
@@ -1,29 +0,0 @@
1
- import type { BoxelDefinition, Material, Pattern, TexturedBox, Texture } from "./types";
2
- export type FaceKey = "top" | "bottom" | "north" | "south" | "east" | "west";
3
- export declare function uvToCanvasPixel(u: number, v: number, width: number, height: number): {
4
- x: number;
5
- y: number;
6
- };
7
- export declare const buildPatternAscii: (pattern: {
8
- size: [number, number];
9
- data: number[];
10
- }) => string[];
11
- export declare function resolveFaceTextureId(box: TexturedBox, face: FaceKey): string | undefined;
12
- export declare function resolveOverlayFaceTextureId(box: TexturedBox, face: FaceKey): string | undefined;
13
- export declare function collectFaceTextureIds(box: TexturedBox): string[];
14
- export declare function collectOverlayFaceTextureIds(box: TexturedBox): string[];
15
- export declare function getFaceKeys(): FaceKey[];
16
- export declare function getTextureMaterialIds(texture: Texture): string[];
17
- export declare function collectTexturedBoxTextures(box: TexturedBox): Set<string>;
18
- export declare function collectTexturedBoxMaterials(box: TexturedBox, textureLookup: Map<string, Texture>): Set<string>;
19
- export declare function collectTexturedBoxPatterns(box: TexturedBox, textureLookup: Map<string, Texture>): Set<string>;
20
- export declare function determineTexturedBoxRenderMode(entity: BoxelDefinition, box: TexturedBox): "plain" | "cutout";
21
- export interface TexturedBoxDependencySummary {
22
- textures: Set<string>;
23
- materials: Set<string>;
24
- patterns: Set<string>;
25
- }
26
- export declare function collectTexturedBoxDependencies(box: TexturedBox, textureLookup: Map<string, Texture>): TexturedBoxDependencySummary;
27
- export declare function collectEntityTextureLookup(entity: BoxelDefinition): Map<string, Texture>;
28
- export declare function collectEntityMaterialLookup(entity: BoxelDefinition): Map<string, Material>;
29
- export declare function collectEntityPatternLookup(entity: BoxelDefinition): Map<string, Pattern>;
@@ -1,208 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildPatternAscii = void 0;
4
- exports.uvToCanvasPixel = uvToCanvasPixel;
5
- exports.resolveFaceTextureId = resolveFaceTextureId;
6
- exports.resolveOverlayFaceTextureId = resolveOverlayFaceTextureId;
7
- exports.collectFaceTextureIds = collectFaceTextureIds;
8
- exports.collectOverlayFaceTextureIds = collectOverlayFaceTextureIds;
9
- exports.getFaceKeys = getFaceKeys;
10
- exports.getTextureMaterialIds = getTextureMaterialIds;
11
- exports.collectTexturedBoxTextures = collectTexturedBoxTextures;
12
- exports.collectTexturedBoxMaterials = collectTexturedBoxMaterials;
13
- exports.collectTexturedBoxPatterns = collectTexturedBoxPatterns;
14
- exports.determineTexturedBoxRenderMode = determineTexturedBoxRenderMode;
15
- exports.collectTexturedBoxDependencies = collectTexturedBoxDependencies;
16
- exports.collectEntityTextureLookup = collectEntityTextureLookup;
17
- exports.collectEntityMaterialLookup = collectEntityMaterialLookup;
18
- exports.collectEntityPatternLookup = collectEntityPatternLookup;
19
- const FACE_FALLBACKS = {
20
- top: ["top", "all", "sides"],
21
- bottom: ["bottom", "all", "sides"],
22
- north: ["north", "sides", "all"],
23
- south: ["south", "sides", "all"],
24
- east: ["east", "sides", "all"],
25
- west: ["west", "sides", "all"],
26
- };
27
- const FACE_KEYS = ["top", "bottom", "north", "south", "east", "west"];
28
- const OVERLAY_FACE_FALLBACKS = {
29
- top: ["topOverlay", "allOverlay", "sidesOverlay"],
30
- bottom: ["bottomOverlay", "allOverlay", "sidesOverlay"],
31
- north: ["northOverlay", "sidesOverlay", "allOverlay"],
32
- south: ["southOverlay", "sidesOverlay", "allOverlay"],
33
- east: ["eastOverlay", "sidesOverlay", "allOverlay"],
34
- west: ["westOverlay", "sidesOverlay", "allOverlay"],
35
- };
36
- const EPSILON = 1e-6;
37
- const clamp = (value, min, max) => {
38
- if (!Number.isFinite(value))
39
- return min;
40
- if (value < min)
41
- return min;
42
- if (value > max)
43
- return max;
44
- return value;
45
- };
46
- const toDimension = (value) => {
47
- if (!Number.isFinite(value) || value < 1) {
48
- throw new Error("texture_dimension_invalid");
49
- }
50
- return Math.floor(value);
51
- };
52
- function uvToCanvasPixel(u, v, width, height) {
53
- const w = toDimension(width);
54
- const h = toDimension(height);
55
- const clampedU = clamp(u, 0, 1);
56
- const clampedV = clamp(v, 0, 1);
57
- const x = Math.min(w - 1, Math.max(0, Math.round(clampedU * (w - 1 + EPSILON))));
58
- const y = Math.min(h - 1, Math.max(0, Math.round(clampedV * (h - 1 + EPSILON))));
59
- return { x, y };
60
- }
61
- const toAsciiSymbol = (value) => {
62
- if (value >= 0 && value <= 9)
63
- return value.toString();
64
- const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
65
- const index = value - 10;
66
- if (index >= 0 && index < alphabet.length)
67
- return alphabet[index];
68
- return "?";
69
- };
70
- const buildPatternAscii = (pattern) => {
71
- const [width, height] = pattern.size;
72
- const lines = [];
73
- for (let y = 0; y < height; y += 1) {
74
- const start = y * width;
75
- const line = pattern.data
76
- .slice(start, start + width)
77
- .map(toAsciiSymbol)
78
- .join("");
79
- lines.push(line);
80
- }
81
- return lines;
82
- };
83
- exports.buildPatternAscii = buildPatternAscii;
84
- function resolveFaceTextureId(box, face) {
85
- const order = FACE_FALLBACKS[face];
86
- for (const key of order) {
87
- const candidate = box[key];
88
- if (typeof candidate === "string" && candidate.trim().length > 0) {
89
- return candidate;
90
- }
91
- }
92
- return undefined;
93
- }
94
- function resolveOverlayFaceTextureId(box, face) {
95
- const order = OVERLAY_FACE_FALLBACKS[face];
96
- for (const key of order) {
97
- const candidate = box[key];
98
- if (typeof candidate === "string" && candidate.trim().length > 0) {
99
- return candidate;
100
- }
101
- }
102
- return undefined;
103
- }
104
- function collectFaceTextureIds(box) {
105
- const ids = new Set();
106
- FACE_KEYS.forEach((face) => {
107
- const textureId = resolveFaceTextureId(box, face);
108
- if (textureId) {
109
- ids.add(textureId);
110
- }
111
- });
112
- return Array.from(ids);
113
- }
114
- function collectOverlayFaceTextureIds(box) {
115
- const ids = new Set();
116
- FACE_KEYS.forEach((face) => {
117
- const textureId = resolveOverlayFaceTextureId(box, face);
118
- if (textureId) {
119
- ids.add(textureId);
120
- }
121
- });
122
- return Array.from(ids);
123
- }
124
- function getFaceKeys() {
125
- return [...FACE_KEYS];
126
- }
127
- function getTextureMaterialIds(texture) {
128
- return Array.isArray(texture.materials) ? [...texture.materials] : [];
129
- }
130
- function collectTexturedBoxTextures(box) {
131
- const textures = new Set();
132
- collectFaceTextureIds(box).forEach((id) => textures.add(id));
133
- collectOverlayFaceTextureIds(box).forEach((id) => textures.add(id));
134
- return textures;
135
- }
136
- function collectTexturedBoxMaterials(box, textureLookup) {
137
- const materialIds = new Set();
138
- const textureIds = [...collectFaceTextureIds(box), ...collectOverlayFaceTextureIds(box)];
139
- textureIds.forEach((textureId) => {
140
- const texture = textureLookup.get(textureId);
141
- if (!texture)
142
- return;
143
- texture.materials.forEach((materialId) => materialIds.add(materialId));
144
- });
145
- return materialIds;
146
- }
147
- function collectTexturedBoxPatterns(box, textureLookup) {
148
- const patternIds = new Set();
149
- const textureIds = [...collectFaceTextureIds(box), ...collectOverlayFaceTextureIds(box)];
150
- textureIds.forEach((textureId) => {
151
- const texture = textureLookup.get(textureId);
152
- if (!texture)
153
- return;
154
- patternIds.add(texture.pattern);
155
- });
156
- return patternIds;
157
- }
158
- function buildTextureLookup(entity) {
159
- return new Map(entity.textures.map((texture) => [texture.id, texture]));
160
- }
161
- function buildMaterialLookup(entity) {
162
- return new Map(entity.materials.map((material) => [material.id, material]));
163
- }
164
- function determineTexturedBoxRenderMode(entity, box) {
165
- const textureLookup = buildTextureLookup(entity);
166
- const materialLookup = buildMaterialLookup(entity);
167
- const textureIds = new Set([...collectFaceTextureIds(box), ...collectOverlayFaceTextureIds(box)]);
168
- for (const textureId of textureIds) {
169
- const texture = textureLookup.get(textureId);
170
- if (!texture) {
171
- continue;
172
- }
173
- for (const materialId of texture.materials) {
174
- const material = materialLookup.get(materialId);
175
- if (!material) {
176
- continue;
177
- }
178
- const opacity = material.opacity;
179
- if (opacity !== undefined && Number(opacity) < 1) {
180
- return "cutout";
181
- }
182
- }
183
- }
184
- return "plain";
185
- }
186
- function collectTexturedBoxDependencies(box, textureLookup) {
187
- const textures = collectTexturedBoxTextures(box);
188
- const materials = new Set();
189
- const patterns = new Set();
190
- textures.forEach((textureId) => {
191
- const texture = textureLookup.get(textureId);
192
- if (!texture)
193
- return;
194
- patterns.add(texture.pattern);
195
- texture.materials.forEach((materialId) => materials.add(materialId));
196
- });
197
- return { textures, materials, patterns };
198
- }
199
- function collectEntityTextureLookup(entity) {
200
- return buildTextureLookup(entity);
201
- }
202
- function collectEntityMaterialLookup(entity) {
203
- return buildMaterialLookup(entity);
204
- }
205
- function collectEntityPatternLookup(entity) {
206
- return new Map(entity.patterns.map((pattern) => [pattern.id, pattern]));
207
- }
208
- //# sourceMappingURL=textures.js.map