@playdrop/playdrop-cli 0.16.16 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) 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 +782 -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/node_modules/@playwright/mcp/node_modules/fsevents/LICENSE +22 -0
  202. package/node_modules/@playwright/mcp/node_modules/fsevents/README.md +83 -0
  203. package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.d.ts +46 -0
  204. package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.js +82 -0
  205. package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.node +0 -0
  206. package/node_modules/@playwright/mcp/node_modules/fsevents/package.json +62 -0
  207. package/package.json +9 -11
  208. package/dist/assets/model-artifacts.d.ts +0 -8
  209. package/dist/assets/model-artifacts.js +0 -382
  210. package/dist/assets/model-worker.d.ts +0 -22
  211. package/dist/assets/model-worker.js +0 -123
  212. package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
  213. package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
  214. package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
  215. package/node_modules/@playdrop/ai-client/package.json +0 -22
  216. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
  217. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
  218. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
  219. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
  220. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
  221. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
  222. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
  223. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
  224. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
  225. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
  226. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
  227. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
  228. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
  229. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
  230. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
  231. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
  232. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
  233. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
  234. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
  235. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
  236. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
  237. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
  238. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
  239. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
  240. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
  241. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
  242. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
  243. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
  244. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
  245. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
  246. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
  247. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
  248. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
  249. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
  250. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
  251. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
  252. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
  253. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
  254. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
  255. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
  256. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
  257. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
  258. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
  259. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
  260. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
  261. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
  262. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
  263. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
  264. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
  265. package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
  266. package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
  267. package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
  268. package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
  269. package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
  270. package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
  271. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
  272. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
  273. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
  274. package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
  275. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
  276. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
  277. package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
  278. package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
  279. package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
  280. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
  281. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
  282. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
  283. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
  284. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
  285. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
  286. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
  287. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
  288. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
  289. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
  290. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
  291. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
  292. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
  293. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
  294. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
  295. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
  296. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
  297. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
  298. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
  299. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
  300. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
  301. package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
  302. package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
  303. package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
  304. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
  305. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
  306. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
  307. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
  308. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
  309. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
  310. package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
  311. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
  312. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
  313. package/node_modules/@playdrop/boxel-core/package.json +0 -19
  314. package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
  315. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
  316. package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
  317. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
  318. package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
  319. package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
  320. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
  321. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
  322. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
  323. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
  324. package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
  325. package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
  326. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
  327. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
  328. package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
  329. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
  330. package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
  331. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
  332. package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
  333. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
  334. package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
  335. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
  336. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
  337. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
  338. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
  339. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
  340. package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
  341. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
  342. package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
  343. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
  344. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
  345. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
  346. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
  347. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
  348. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
  349. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
  350. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
  351. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
  352. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
  353. package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
  354. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
  355. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
  356. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
  357. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
  358. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
  359. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
  360. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
  361. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
  362. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
  363. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
  364. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
  365. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
  366. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
  367. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
  368. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
  369. package/node_modules/@playdrop/boxel-three/package.json +0 -28
@@ -1,133 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var texture_atlas_exports = {};
19
- __export(texture_atlas_exports, {
20
- buildEmissiveAtlas: () => buildEmissiveAtlas,
21
- buildTextureAtlas: () => buildTextureAtlas
22
- });
23
- module.exports = __toCommonJS(texture_atlas_exports);
24
- const toPowerOfTwo = (value) => {
25
- return 2 ** Math.ceil(Math.log2(Math.max(1, value)));
26
- };
27
- function buildTextureAtlas(THREE, textures) {
28
- const uniqueTextures = Array.from(new Set(textures));
29
- if (uniqueTextures.length === 0) {
30
- return null;
31
- }
32
- const maxWidth = uniqueTextures.reduce((acc, tex) => Math.max(acc, tex.image?.width ?? 0), 0);
33
- const totalHeight = uniqueTextures.reduce((acc, tex) => acc + (tex.image?.height ?? 0), 0);
34
- if (maxWidth === 0 || totalHeight === 0) {
35
- return null;
36
- }
37
- const atlasWidth = toPowerOfTwo(maxWidth);
38
- const atlasHeight = toPowerOfTwo(totalHeight);
39
- const atlasData = new Uint8Array(atlasWidth * atlasHeight * 4);
40
- const transforms = /* @__PURE__ */ new Map();
41
- let offsetY = 0;
42
- uniqueTextures.forEach((texture) => {
43
- const image = texture.image;
44
- if (!image) {
45
- return;
46
- }
47
- const width = image.width;
48
- const height = image.height;
49
- const data = image.data;
50
- const startY = offsetY;
51
- for (let row = 0; row < height; row += 1) {
52
- const srcStart = row * width * 4;
53
- const dstStart = (startY + row) * atlasWidth * 4;
54
- atlasData.set(data.subarray(srcStart, srcStart + width * 4), dstStart);
55
- }
56
- transforms.set(texture, {
57
- offset: [0, startY / atlasHeight],
58
- scale: [width / atlasWidth, height / atlasHeight]
59
- });
60
- offsetY += height;
61
- });
62
- const template = uniqueTextures[0];
63
- const templateTexture = template;
64
- const atlasTexture = new THREE.DataTexture(atlasData, atlasWidth, atlasHeight);
65
- atlasTexture.needsUpdate = true;
66
- atlasTexture.magFilter = templateTexture.magFilter;
67
- atlasTexture.minFilter = templateTexture.minFilter;
68
- atlasTexture.wrapS = templateTexture.wrapS;
69
- atlasTexture.wrapT = templateTexture.wrapT;
70
- atlasTexture.flipY = false;
71
- if ("colorSpace" in atlasTexture && "colorSpace" in templateTexture) {
72
- atlasTexture.colorSpace = templateTexture.colorSpace;
73
- } else if ("encoding" in atlasTexture && "encoding" in templateTexture) {
74
- atlasTexture.encoding = templateTexture.encoding;
75
- }
76
- return {
77
- texture: atlasTexture,
78
- transforms,
79
- width: atlasWidth,
80
- height: atlasHeight
81
- };
82
- }
83
- function buildEmissiveAtlas(THREE, width, height, transforms, pairs) {
84
- if (pairs.size === 0) {
85
- return null;
86
- }
87
- const atlasData = new Uint8Array(width * height * 4);
88
- let template = null;
89
- pairs.forEach((emissive, reference) => {
90
- const transform = transforms.get(reference);
91
- if (!transform) {
92
- return;
93
- }
94
- const image = emissive.image;
95
- const refImage = reference.image;
96
- if (!image || !refImage) {
97
- return;
98
- }
99
- const texWidth = refImage.width;
100
- const texHeight = refImage.height;
101
- const data = image.data;
102
- const offsetX = Math.round(transform.offset[0] * width);
103
- const offsetY = Math.round(transform.offset[1] * height);
104
- for (let row = 0; row < texHeight; row += 1) {
105
- const srcStart = row * texWidth * 4;
106
- const dstStart = ((offsetY + row) * width + offsetX) * 4;
107
- atlasData.set(data.subarray(srcStart, srcStart + texWidth * 4), dstStart);
108
- }
109
- template = emissive;
110
- });
111
- if (!template) {
112
- return null;
113
- }
114
- const templateTexture = template;
115
- const atlasTexture = new THREE.DataTexture(atlasData, width, height);
116
- atlasTexture.needsUpdate = true;
117
- atlasTexture.magFilter = templateTexture.magFilter;
118
- atlasTexture.minFilter = templateTexture.minFilter;
119
- atlasTexture.wrapS = templateTexture.wrapS;
120
- atlasTexture.wrapT = templateTexture.wrapT;
121
- atlasTexture.flipY = false;
122
- if ("colorSpace" in atlasTexture && "colorSpace" in templateTexture) {
123
- atlasTexture.colorSpace = templateTexture.colorSpace;
124
- } else if ("encoding" in atlasTexture && "encoding" in templateTexture) {
125
- atlasTexture.encoding = templateTexture.encoding;
126
- }
127
- return atlasTexture;
128
- }
129
- // Annotate the CommonJS export names for ESM import in node:
130
- 0 && (module.exports = {
131
- buildEmissiveAtlas,
132
- buildTextureAtlas
133
- });
@@ -1,17 +0,0 @@
1
- import type * as THREEType from "three";
2
- import type { Material, Pattern, Texture } from "@playdrop/boxel-core";
3
- import type { PrimitiveBuilderContext } from "./context.js";
4
- type TextureArray = Uint8Array<ArrayBuffer>;
5
- export interface TextureBundle {
6
- color: THREEType.DataTexture;
7
- emissive?: THREEType.DataTexture;
8
- }
9
- export declare function buildTexturePixels(context: PrimitiveBuilderContext, textureDef: Texture, pattern: Pattern, materialsById: Map<string, Material>): {
10
- color: TextureArray;
11
- emissive: TextureArray | null;
12
- };
13
- export declare function ensureTextureInstance(context: PrimitiveBuilderContext, textureDef: Texture): TextureBundle | null;
14
- export declare function createPatternPlaceholderTexture(context: PrimitiveBuilderContext, pattern: Pattern): THREEType.DataTexture;
15
- export declare function createTextureMaterial(context: PrimitiveBuilderContext, textureId: string | undefined): THREEType.MeshStandardMaterial;
16
- export declare function toThreeColorRGB(context: PrimitiveBuilderContext, rgb: number[]): THREEType.Color;
17
- export {};
@@ -1,216 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var textures_exports = {};
19
- __export(textures_exports, {
20
- buildTexturePixels: () => buildTexturePixels,
21
- createPatternPlaceholderTexture: () => createPatternPlaceholderTexture,
22
- createTextureMaterial: () => createTextureMaterial,
23
- ensureTextureInstance: () => ensureTextureInstance,
24
- toThreeColorRGB: () => toThreeColorRGB
25
- });
26
- module.exports = __toCommonJS(textures_exports);
27
- function toThreeColor(THREE, rgb) {
28
- const color = new THREE.Color(rgb[0] / 255, rgb[1] / 255, rgb[2] / 255);
29
- if (typeof color.convertSRGBToLinear === "function") {
30
- color.convertSRGBToLinear();
31
- } else if (typeof color.convertGammaToLinear === "function") {
32
- color.convertGammaToLinear(2.2);
33
- }
34
- return color;
35
- }
36
- function buildTexturePixels(context, textureDef, pattern, materialsById) {
37
- const [width, height] = pattern.size;
38
- const colorBuffer = new Uint8Array(width * height * 4);
39
- const emissiveBuffer = new Uint8Array(width * height * 4);
40
- let hasEmissive = false;
41
- for (let y = 0; y < height; y += 1) {
42
- for (let x = 0; x < width; x += 1) {
43
- const sourceIndex = y * width + x;
44
- const paletteIndex = pattern.data[sourceIndex];
45
- const materialId = textureDef.materials[paletteIndex];
46
- const material = materialId ? materialsById.get(materialId) : void 0;
47
- const color = material?.baseColor ?? [59, 130, 246];
48
- const opacityValue = material?.opacity !== void 0 ? Number(material.opacity) : 1;
49
- const clampedOpacity = Number.isFinite(opacityValue) ? Math.max(0, Math.min(1, opacityValue)) : 1;
50
- const targetY = height - 1 - y;
51
- const targetIndex = (targetY * width + x) * 4;
52
- colorBuffer[targetIndex] = color[0];
53
- colorBuffer[targetIndex + 1] = color[1];
54
- colorBuffer[targetIndex + 2] = color[2];
55
- colorBuffer[targetIndex + 3] = Math.round(clampedOpacity * 255);
56
- const emissive = material?.emissiveColor ?? null;
57
- if (emissive) {
58
- emissiveBuffer[targetIndex] = emissive[0];
59
- emissiveBuffer[targetIndex + 1] = emissive[1];
60
- emissiveBuffer[targetIndex + 2] = emissive[2];
61
- emissiveBuffer[targetIndex + 3] = 255;
62
- if (!hasEmissive) {
63
- hasEmissive = emissive.some((component) => component !== 0);
64
- }
65
- } else {
66
- emissiveBuffer[targetIndex] = 0;
67
- emissiveBuffer[targetIndex + 1] = 0;
68
- emissiveBuffer[targetIndex + 2] = 0;
69
- emissiveBuffer[targetIndex + 3] = 0;
70
- }
71
- }
72
- }
73
- return {
74
- color: colorBuffer,
75
- emissive: hasEmissive ? emissiveBuffer : null
76
- };
77
- }
78
- function ensureTextureInstance(context, textureDef) {
79
- const cached = context.textureCache.get(textureDef.id);
80
- if (cached) {
81
- return cached;
82
- }
83
- if (!context.entity) {
84
- return null;
85
- }
86
- const pattern = context.entity.patterns.find((entry) => entry.id === textureDef.pattern);
87
- if (!pattern) {
88
- console.warn("[boxel-three] pattern not found for texture", textureDef.id);
89
- return null;
90
- }
91
- const { color, emissive } = buildTexturePixels(context, textureDef, pattern, context.materialsById);
92
- const colorTexture = new context.THREE.DataTexture(color, pattern.size[0], pattern.size[1]);
93
- colorTexture.needsUpdate = true;
94
- colorTexture.magFilter = context.THREE.NearestFilter;
95
- colorTexture.minFilter = context.THREE.NearestFilter;
96
- colorTexture.wrapS = context.THREE.ClampToEdgeWrapping;
97
- colorTexture.wrapT = context.THREE.ClampToEdgeWrapping;
98
- colorTexture.flipY = false;
99
- if ("colorSpace" in colorTexture) {
100
- colorTexture.colorSpace = context.THREE.SRGBColorSpace ?? colorTexture.colorSpace;
101
- } else if ("encoding" in colorTexture) {
102
- colorTexture.encoding = context.THREE.sRGBEncoding ?? colorTexture.encoding;
103
- }
104
- let emissiveTexture;
105
- if (emissive) {
106
- emissiveTexture = new context.THREE.DataTexture(emissive, pattern.size[0], pattern.size[1]);
107
- emissiveTexture.needsUpdate = true;
108
- emissiveTexture.magFilter = context.THREE.NearestFilter;
109
- emissiveTexture.minFilter = context.THREE.NearestFilter;
110
- emissiveTexture.wrapS = context.THREE.ClampToEdgeWrapping;
111
- emissiveTexture.wrapT = context.THREE.ClampToEdgeWrapping;
112
- emissiveTexture.flipY = false;
113
- if ("colorSpace" in emissiveTexture) {
114
- emissiveTexture.colorSpace = context.THREE.SRGBColorSpace ?? emissiveTexture.colorSpace;
115
- } else if ("encoding" in emissiveTexture) {
116
- emissiveTexture.encoding = context.THREE.sRGBEncoding ?? emissiveTexture.encoding;
117
- }
118
- }
119
- const bundle = {
120
- color: colorTexture,
121
- emissive: emissiveTexture
122
- };
123
- context.textureCache.set(textureDef.id, bundle);
124
- return bundle;
125
- }
126
- function createPatternPlaceholderTexture(context, pattern) {
127
- const [width, height] = pattern.size;
128
- const buffer = new Uint8Array(width * height * 4);
129
- const maxValue = pattern.data.reduce((acc, value) => Math.max(acc, value), 0);
130
- const normalizer = maxValue > 0 ? maxValue : 1;
131
- for (let y = 0; y < height; y += 1) {
132
- for (let x = 0; x < width; x += 1) {
133
- const sourceIndex = y * width + x;
134
- const value = pattern.data[sourceIndex];
135
- const shade = Math.round(value / normalizer * 255);
136
- const targetY = height - 1 - y;
137
- const targetIndex = (targetY * width + x) * 4;
138
- buffer[targetIndex] = shade;
139
- buffer[targetIndex + 1] = shade;
140
- buffer[targetIndex + 2] = shade;
141
- buffer[targetIndex + 3] = 255;
142
- }
143
- }
144
- const texture = new context.THREE.DataTexture(buffer, width, height);
145
- texture.needsUpdate = true;
146
- texture.magFilter = context.THREE.NearestFilter;
147
- texture.minFilter = context.THREE.NearestFilter;
148
- texture.wrapS = context.THREE.ClampToEdgeWrapping;
149
- texture.wrapT = context.THREE.ClampToEdgeWrapping;
150
- texture.flipY = false;
151
- if ("colorSpace" in texture) {
152
- texture.colorSpace = context.THREE.SRGBColorSpace ?? texture.colorSpace;
153
- } else if ("encoding" in texture) {
154
- texture.encoding = context.THREE.sRGBEncoding ?? texture.encoding;
155
- }
156
- return texture;
157
- }
158
- function createTextureMaterial(context, textureId) {
159
- if (!textureId || !context.entity) {
160
- return new context.THREE.MeshStandardMaterial({
161
- color: 3900150,
162
- opacity: 0.45,
163
- transparent: true,
164
- metalness: 0,
165
- roughness: 1
166
- });
167
- }
168
- const textureDef = context.entity.textures.find((entry) => entry.id === textureId);
169
- if (!textureDef) {
170
- console.warn("[boxel-three] texture not found", textureId);
171
- return new context.THREE.MeshStandardMaterial({
172
- color: 3900150,
173
- opacity: 0.45,
174
- transparent: true,
175
- metalness: 0,
176
- roughness: 1
177
- });
178
- }
179
- const bundle = ensureTextureInstance(context, textureDef);
180
- if (!bundle) {
181
- return new context.THREE.MeshStandardMaterial({
182
- color: 3900150,
183
- opacity: 0.45,
184
- transparent: true,
185
- metalness: 0,
186
- roughness: 1
187
- });
188
- }
189
- const material = new context.THREE.MeshStandardMaterial({
190
- map: bundle.color,
191
- transparent: true,
192
- metalness: 0,
193
- roughness: 1
194
- });
195
- if (bundle.emissive) {
196
- material.emissiveMap = bundle.emissive;
197
- material.emissive = new context.THREE.Color(1, 1, 1);
198
- material.emissiveIntensity = 1;
199
- } else {
200
- material.emissive.setRGB(0, 0, 0);
201
- material.emissiveIntensity = 1;
202
- }
203
- material.needsUpdate = true;
204
- return material;
205
- }
206
- function toThreeColorRGB(context, rgb) {
207
- return toThreeColor(context.THREE, rgb);
208
- }
209
- // Annotate the CommonJS export names for ESM import in node:
210
- 0 && (module.exports = {
211
- buildTexturePixels,
212
- createPatternPlaceholderTexture,
213
- createTextureMaterial,
214
- ensureTextureInstance,
215
- toThreeColorRGB
216
- });
@@ -1,112 +0,0 @@
1
- import type * as THREEType from "three";
2
- import type { ConnectMode, BoxelDefinition } from "@playdrop/boxel-core";
3
- export type { ConnectMode } from "@playdrop/boxel-core";
4
- export interface BoxelThreeContext {
5
- THREE: typeof THREEType;
6
- entity: BoxelDefinition;
7
- }
8
- export interface BoxelSceneOptions {
9
- /**
10
- * Optional node identifier (or list of identifiers) to render instead of the full entity.
11
- * When omitted, the entire entity geometry tree is emitted.
12
- */
13
- nodes?: string | string[];
14
- /**
15
- * Configure optional overlay helpers (origin, bounds, sockets) to render alongside the scene.
16
- */
17
- overlays?: BoxelOverlayOptions;
18
- }
19
- export interface BoxelSceneNodeMeta {
20
- /**
21
- * Original entity node identifier.
22
- */
23
- id: string;
24
- /**
25
- * Three.js object representing the node transform.
26
- */
27
- object: THREEType.Object3D;
28
- /**
29
- * Optional primitive identifier bound to the node.
30
- */
31
- primitiveId?: string;
32
- /**
33
- * Requested parent-connect behaviour for this node.
34
- */
35
- connectMode: ConnectMode;
36
- }
37
- export interface BoxelSceneAnimationChannel {
38
- nodeId: string;
39
- property: "position" | "rotation" | "scale";
40
- track: THREEType.KeyframeTrack;
41
- }
42
- export interface BoxelSceneAnimation {
43
- id: string;
44
- duration: number;
45
- channels: BoxelSceneAnimationChannel[];
46
- clip: THREEType.AnimationClip;
47
- }
48
- export interface BoxelSceneResult {
49
- /**
50
- * Root object containing the full entity mesh hierarchy.
51
- */
52
- root: THREEType.Group;
53
- /**
54
- * Lookup for every node emitted into the scene.
55
- */
56
- nodes: Map<string, BoxelSceneNodeMeta>;
57
- /**
58
- * Animation payload pre-bound to Three.js tracks.
59
- */
60
- animations: BoxelSceneAnimation[];
61
- /**
62
- * Ready-to-use AnimationClip objects derived from the animation payload.
63
- */
64
- clips: THREEType.AnimationClip[];
65
- /**
66
- * Three.js resources that should be disposed when the scene is torn down.
67
- */
68
- resources: {
69
- materials: THREEType.Material[];
70
- textures: THREEType.Texture[];
71
- geometries: THREEType.BufferGeometry[];
72
- };
73
- /**
74
- * Destroy helper to free underlying GPU buffers.
75
- */
76
- dispose: () => void;
77
- }
78
- /**
79
- * Controls which overlay helpers should be rendered for a target along with basic styling hints.
80
- */
81
- export interface BoxelOverlayOptions {
82
- /**
83
- * Render the entity/world origin helper.
84
- */
85
- origin?: boolean;
86
- /**
87
- * Render bounding boxes for nodes or primitives that declare a size.
88
- */
89
- bounds?: boolean;
90
- /**
91
- * Render sphere markers for socket locations (combo slots, node centers).
92
- */
93
- sockets?: boolean;
94
- /**
95
- * Optional tint for line/mesh helpers.
96
- */
97
- color?: number;
98
- /**
99
- * Optional opacity override for helpers; defaults to fully opaque.
100
- */
101
- opacity?: number;
102
- /**
103
- * When true, draw dashed bounding boxes instead of solid lines.
104
- */
105
- dashed?: boolean;
106
- }
107
- export interface BoxelOverlayHandles {
108
- origin?: THREEType.Object3D;
109
- bounds?: THREEType.Object3D[];
110
- sockets?: THREEType.Object3D[];
111
- dispose: () => void;
112
- }
@@ -1,28 +0,0 @@
1
- import type { Material, VoxelBox } from "@playdrop/boxel-core";
2
- export type FaceName = "east" | "west" | "top" | "bottom" | "north" | "south";
3
- export declare const FACE_ORDER: ReadonlyArray<FaceName>;
4
- export interface VoxelFaceGeometry {
5
- positions: Float32Array;
6
- normals: Float32Array;
7
- uvs: Float32Array;
8
- indices: Uint16Array;
9
- }
10
- export interface VoxelFacePatch {
11
- face: FaceName;
12
- width: number;
13
- height: number;
14
- textureWidth: number;
15
- textureHeight: number;
16
- color: Uint8Array;
17
- emissive?: Uint8Array;
18
- hasEmissive: boolean;
19
- hasTransparency: boolean;
20
- geometry: VoxelFaceGeometry;
21
- }
22
- interface GenerateVoxelFaceSurfacesOptions {
23
- primitive: VoxelBox;
24
- materialsById: Map<string, Material>;
25
- defaultColor: [number, number, number];
26
- }
27
- export declare function generateVoxelFaceSurfaces(options: GenerateVoxelFaceSurfacesOptions): VoxelFacePatch[];
28
- export {};