@playdrop/playdrop-cli 0.16.12 → 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 (364) 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 -7
  25. package/dist/commands/chat.js +165 -77
  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/provider-telemetry.js +1 -1
  59. package/dist/commands/worker/runtime.d.ts +8 -10
  60. package/dist/commands/worker/runtime.js +53 -48
  61. package/dist/commands/worker.d.ts +79 -19
  62. package/dist/commands/worker.js +1796 -419
  63. package/dist/config.d.ts +2 -0
  64. package/dist/config.js +16 -3
  65. package/dist/environment.d.ts +0 -1
  66. package/dist/environment.js +0 -8
  67. package/dist/index.js +92 -22
  68. package/dist/workerAppProject.d.ts +1 -1
  69. package/dist/workerAppProject.js +15 -2
  70. package/node_modules/@playdrop/api-client/dist/client.d.ts +143 -39
  71. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  72. package/node_modules/@playdrop/api-client/dist/client.js +33 -0
  73. package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
  74. package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
  75. package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
  76. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
  77. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
  78. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +338 -41
  79. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
  80. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
  81. package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
  82. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
  83. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  84. package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
  85. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
  86. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
  87. package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
  88. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +152 -21
  89. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
  90. package/node_modules/@playdrop/api-client/dist/domains/chat.js +477 -100
  91. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
  92. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
  93. package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
  94. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
  95. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
  96. package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
  97. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
  98. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
  99. package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
  100. package/node_modules/@playdrop/api-client/dist/index.d.ts +81 -30
  101. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  102. package/node_modules/@playdrop/api-client/dist/index.js +217 -56
  103. package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
  104. package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
  105. package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
  106. package/node_modules/@playdrop/api-client/package.json +7 -0
  107. package/node_modules/@playdrop/config/client-meta.json +4 -4
  108. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
  109. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
  110. package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
  111. package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
  112. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  113. package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
  114. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
  115. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
  116. package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
  117. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
  118. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
  119. package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
  120. package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
  121. package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
  122. package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
  123. package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
  124. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  125. package/node_modules/@playdrop/config/package.json +6 -0
  126. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
  127. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
  128. package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
  129. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
  130. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
  131. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
  132. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
  133. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
  134. package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
  135. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
  136. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
  137. package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
  138. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
  139. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
  140. package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
  141. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
  142. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
  143. package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
  144. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
  145. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
  146. package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
  147. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
  148. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
  149. package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
  150. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
  151. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
  152. package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
  153. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
  154. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
  155. package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
  156. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
  157. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
  158. package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
  159. package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
  160. package/node_modules/@playdrop/game-source-git/package.json +28 -0
  161. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
  162. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
  163. package/node_modules/@playdrop/types/dist/agent-task-terminal.js +15 -9
  164. package/node_modules/@playdrop/types/dist/api.d.ts +730 -166
  165. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  166. package/node_modules/@playdrop/types/dist/api.js +65 -18
  167. package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
  168. package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
  169. package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
  170. package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
  171. package/node_modules/@playdrop/types/dist/asset.js +26 -26
  172. package/node_modules/@playdrop/types/dist/chat.d.ts +273 -31
  173. package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
  174. package/node_modules/@playdrop/types/dist/chat.js +38 -4
  175. package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
  176. package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
  177. package/node_modules/@playdrop/types/dist/index.js +7 -1
  178. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
  179. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
  180. package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
  181. package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
  182. package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
  183. package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
  184. package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
  185. package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
  186. package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
  187. package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
  188. package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
  189. package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
  190. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  191. package/node_modules/@playdrop/types/dist/version.js +111 -0
  192. package/node_modules/@playdrop/types/package.json +14 -0
  193. package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
  194. package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
  195. package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
  196. package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
  197. package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
  198. package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
  199. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
  200. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
  201. package/node_modules/@playdrop/vox-three/package.json +8 -4
  202. package/package.json +9 -11
  203. package/dist/assets/model-artifacts.d.ts +0 -8
  204. package/dist/assets/model-artifacts.js +0 -382
  205. package/dist/assets/model-worker.d.ts +0 -22
  206. package/dist/assets/model-worker.js +0 -123
  207. package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
  208. package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
  209. package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
  210. package/node_modules/@playdrop/ai-client/package.json +0 -22
  211. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
  212. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
  213. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
  214. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
  215. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
  216. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
  217. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
  218. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
  219. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
  220. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
  221. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
  222. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
  223. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
  224. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
  225. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
  226. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
  227. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
  228. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
  229. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
  230. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
  231. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
  232. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
  233. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
  234. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
  235. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
  236. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
  237. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
  238. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
  239. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
  240. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
  241. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
  242. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
  243. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
  244. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
  245. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
  246. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
  247. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
  248. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
  249. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
  250. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
  251. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
  252. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
  253. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
  254. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
  255. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
  256. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
  257. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
  258. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
  259. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
  260. package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
  261. package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
  262. package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
  263. package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
  264. package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
  265. package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
  266. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
  267. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
  268. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
  269. package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
  270. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
  271. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
  272. package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
  273. package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
  274. package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
  275. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
  276. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
  277. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
  278. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
  279. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
  280. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
  281. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
  282. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
  283. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
  284. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
  285. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
  286. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
  287. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
  288. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
  289. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
  290. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
  291. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
  292. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
  293. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
  294. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
  295. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
  296. package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
  297. package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
  298. package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
  299. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
  300. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
  301. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
  302. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
  303. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
  304. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
  305. package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
  306. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
  307. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
  308. package/node_modules/@playdrop/boxel-core/package.json +0 -19
  309. package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
  310. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
  311. package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
  312. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
  313. package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
  314. package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
  315. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
  316. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
  317. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
  318. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
  319. package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
  320. package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
  321. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
  322. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
  323. package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
  324. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
  325. package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
  326. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
  327. package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
  328. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
  329. package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
  330. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
  331. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
  332. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
  333. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
  334. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
  335. package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
  336. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
  337. package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
  338. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
  339. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
  340. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
  341. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
  342. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
  343. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
  344. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
  345. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
  346. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
  347. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
  348. package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
  349. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
  350. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
  351. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
  352. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
  353. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
  354. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
  355. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
  356. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
  357. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
  358. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
  359. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
  360. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
  361. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
  362. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
  363. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
  364. package/node_modules/@playdrop/boxel-three/package.json +0 -28
@@ -1,499 +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 dist_exports = {};
19
- __export(dist_exports, {
20
- GENERATION_JOB_ETA_BASELINE_SECONDS: () => GENERATION_JOB_ETA_BASELINE_SECONDS,
21
- createAiClient: () => createAiClient
22
- });
23
- module.exports = __toCommonJS(dist_exports);
24
- const GENERATION_JOB_ETA_BASELINE_SECONDS = {
25
- IMAGE: 20,
26
- MUSIC: 40,
27
- SFX: 15,
28
- SPEECH: 15,
29
- VIDEO: 90,
30
- MODEL_3D: 420
31
- };
32
- const DEFAULT_LOCAL_BASE = "http://localhost:8083";
33
- const CLIENT_HEADER_NAMES = {
34
- client: "x-playdrop-client",
35
- clientVersion: "x-playdrop-client-version",
36
- clientBuild: "x-playdrop-client-build",
37
- platform: "x-playdrop-platform",
38
- platformVersion: "x-playdrop-platform-version"
39
- };
40
- function stripTrailingSlash(value) {
41
- return value.endsWith("/") ? value.slice(0, -1) : value;
42
- }
43
- function normalizeProtocol(protocol) {
44
- if (!protocol) {
45
- return "http";
46
- }
47
- return protocol.replace(/:$/, "") || "http";
48
- }
49
- function isIpv4Hostname(hostname) {
50
- return /^\d{1,3}(?:\.\d{1,3}){3}$/.test(hostname);
51
- }
52
- function isLocalHostname(hostname) {
53
- if (!hostname) {
54
- return true;
55
- }
56
- const normalizedHostname = hostname.trim().toLowerCase();
57
- if (!normalizedHostname) {
58
- return true;
59
- }
60
- if (normalizedHostname === "localhost" || normalizedHostname === "0.0.0.0") {
61
- return true;
62
- }
63
- if (isIpv4Hostname(normalizedHostname)) {
64
- return true;
65
- }
66
- return normalizedHostname.includes(":");
67
- }
68
- function formatHostnameForUrl(hostname) {
69
- const normalizedHostname = hostname.trim();
70
- if (!normalizedHostname) {
71
- return "localhost";
72
- }
73
- if (normalizedHostname.includes(":") && !normalizedHostname.startsWith("[")) {
74
- return `[${normalizedHostname}]`;
75
- }
76
- return normalizedHostname;
77
- }
78
- function inferBaseFromHostname(hostname, protocol) {
79
- if (isLocalHostname(hostname)) {
80
- return `${protocol}://${formatHostnameForUrl(hostname)}:8083`;
81
- }
82
- if (hostname.includes(".")) {
83
- const domain = hostname.replace(/^www\./, "").replace(/^api\./, "").replace(/^play\./, "").replace(/^admin\./, "").replace(/^ai\./, "").replace(/^assets\./, "");
84
- return `${protocol}://ai.${domain}`;
85
- }
86
- const host = formatHostnameForUrl(hostname || "localhost");
87
- return `${protocol}://${host}:8083`;
88
- }
89
- function inferBaseUrl() {
90
- if (typeof process !== "undefined" && process.env.NEXT_PUBLIC_AI_BASE) {
91
- return process.env.NEXT_PUBLIC_AI_BASE;
92
- }
93
- if (typeof window !== "undefined" && window.location) {
94
- const { hostname, protocol } = window.location;
95
- return inferBaseFromHostname(hostname, normalizeProtocol(protocol));
96
- }
97
- return DEFAULT_LOCAL_BASE;
98
- }
99
- function resolveBrowserRequestCredentials() {
100
- if (typeof window === "undefined") {
101
- return void 0;
102
- }
103
- return "include";
104
- }
105
- function readBrowserRuntimeClientMeta() {
106
- if (typeof window === "undefined") {
107
- return null;
108
- }
109
- const raw = globalThis.__PLAYDROP_CLIENT_META;
110
- const version = typeof raw?.version === "string" ? raw.version.trim() : "";
111
- const build = typeof raw?.build === "string" ? raw.build.trim() : "";
112
- if (!version || !build) {
113
- return null;
114
- }
115
- return { version, build };
116
- }
117
- function normalizeBrowserPlatformName(raw) {
118
- const value = raw.trim().toLowerCase();
119
- if (value.includes("mac"))
120
- return "macos";
121
- if (value.includes("win"))
122
- return "windows";
123
- if (value.includes("linux"))
124
- return "linux";
125
- if (value.includes("ios") || value.includes("iphone") || value.includes("ipad"))
126
- return "ios";
127
- if (value.includes("android"))
128
- return "android";
129
- return value || "browser";
130
- }
131
- function resolveBrowserPlatform() {
132
- if (typeof window === "undefined") {
133
- return { name: "browser", version: "0.0.0" };
134
- }
135
- const envPlatform = (typeof process !== "undefined" ? process.env.NEXT_PUBLIC_PLAYDROP_PLATFORM : "")?.trim() ?? "";
136
- const envPlatformVersion = (typeof process !== "undefined" ? process.env.NEXT_PUBLIC_PLAYDROP_PLATFORM_VERSION : "")?.trim() ?? "";
137
- if (envPlatform && envPlatformVersion) {
138
- return { name: envPlatform.toLowerCase(), version: envPlatformVersion };
139
- }
140
- const nav = window.navigator;
141
- const userAgent = nav.userAgent || "";
142
- const data = nav.userAgentData;
143
- if (data?.platform) {
144
- const platformName = normalizeBrowserPlatformName(data.platform);
145
- const version = (data.platformVersion || "").replace(/_/g, ".").trim();
146
- if (version) {
147
- return { name: platformName, version };
148
- }
149
- }
150
- const macMatch = /Mac OS X ([0-9_]+(?:_[0-9_]+)*)/i.exec(userAgent);
151
- if (macMatch?.[1]) {
152
- return { name: "macos", version: macMatch[1].replace(/_/g, ".") };
153
- }
154
- const iosMatch = /(iPhone|iPad|iPod).*OS ([0-9_]+)/i.exec(userAgent);
155
- if (iosMatch?.[2]) {
156
- return { name: "ios", version: iosMatch[2].replace(/_/g, ".") };
157
- }
158
- const winMatch = /Windows NT ([0-9.]+)/i.exec(userAgent);
159
- if (winMatch?.[1]) {
160
- return { name: "windows", version: winMatch[1] };
161
- }
162
- const androidMatch = /Android ([0-9.]+)/i.exec(userAgent);
163
- if (androidMatch?.[1]) {
164
- return { name: "android", version: androidMatch[1] };
165
- }
166
- if (/Linux/i.test(userAgent)) {
167
- return { name: "linux", version: "0.0.0" };
168
- }
169
- return { name: "browser", version: "0.0.0" };
170
- }
171
- function resolveBrowserDefaultClientHeaders() {
172
- const clientMeta = readBrowserRuntimeClientMeta();
173
- if (!clientMeta) {
174
- return {};
175
- }
176
- const platform = resolveBrowserPlatform();
177
- return {
178
- [CLIENT_HEADER_NAMES.client]: "web",
179
- [CLIENT_HEADER_NAMES.clientVersion]: clientMeta.version,
180
- [CLIENT_HEADER_NAMES.clientBuild]: clientMeta.build,
181
- [CLIENT_HEADER_NAMES.platform]: platform.name,
182
- [CLIENT_HEADER_NAMES.platformVersion]: platform.version
183
- };
184
- }
185
- function fillMissingClientHeaders(headers) {
186
- if (typeof window === "undefined") {
187
- return headers;
188
- }
189
- const inferredHeaders = resolveBrowserDefaultClientHeaders();
190
- if (!Object.keys(inferredHeaders).length) {
191
- return headers;
192
- }
193
- return {
194
- ...inferredHeaders,
195
- ...headers
196
- };
197
- }
198
- async function resolveAiClientToken(config) {
199
- if (config.tokenProvider) {
200
- const token = await config.tokenProvider();
201
- return token ?? null;
202
- }
203
- return null;
204
- }
205
- async function resolveAiClientHeaders(config) {
206
- if (config.clientHeaders) {
207
- try {
208
- const headers = await config.clientHeaders();
209
- return headers && typeof headers === "object" ? { ...headers } : {};
210
- } catch {
211
- return {};
212
- }
213
- }
214
- return {};
215
- }
216
- function createAiClient(config = {}) {
217
- const fetchImpl = config.fetchImpl ?? globalThis.fetch?.bind(globalThis);
218
- if (!fetchImpl) {
219
- throw new Error("ai_client_missing_fetch");
220
- }
221
- const baseUrl = stripTrailingSlash(config.baseUrl ?? inferBaseUrl());
222
- async function buildHeaders() {
223
- const headers = fillMissingClientHeaders({
224
- ...await resolveAiClientHeaders(config)
225
- });
226
- const token = await resolveAiClientToken(config);
227
- if (token && !headers.Authorization) {
228
- headers.Authorization = `Bearer ${token}`;
229
- }
230
- return headers;
231
- }
232
- async function buildRequestInit(payload, signal) {
233
- const headers = await buildHeaders();
234
- headers["Content-Type"] = "application/json";
235
- return {
236
- method: "POST",
237
- headers,
238
- body: JSON.stringify(payload),
239
- credentials: resolveBrowserRequestCredentials(),
240
- signal
241
- };
242
- }
243
- async function throwHttpError(response) {
244
- let payload = null;
245
- try {
246
- const text = await response.text();
247
- if (text) {
248
- try {
249
- payload = JSON.parse(text);
250
- } catch {
251
- payload = { message: text };
252
- }
253
- }
254
- } catch {
255
- payload = null;
256
- }
257
- const code = payload?.error ?? `http_${response.status}`;
258
- const message = payload?.message ?? response.statusText ?? "Request failed";
259
- const error = new Error(`${code}: ${message}`);
260
- error.status = response.status;
261
- error.code = code;
262
- error.details = payload;
263
- throw error;
264
- }
265
- async function ensureOk(response) {
266
- if (!response.ok) {
267
- await throwHttpError(response);
268
- }
269
- }
270
- async function generateText(input, options) {
271
- const normalizedInput = input?.trim();
272
- if (!normalizedInput) {
273
- throw new Error("ai_client_missing_input");
274
- }
275
- const size = options?.size ?? "small";
276
- const mode = options?.mode ?? "text";
277
- const rawSystem = options?.system?.trim();
278
- const system = rawSystem && rawSystem.length ? rawSystem : void 0;
279
- const response = await fetchImpl(`${baseUrl}/text/generate`, await buildRequestInit({
280
- input: normalizedInput,
281
- size,
282
- mode,
283
- system
284
- }, options?.signal));
285
- await ensureOk(response);
286
- const data = await response.json();
287
- return data;
288
- }
289
- function applyMediaGenerationPayload(payload, request) {
290
- if (request.modality === "IMAGE") {
291
- payload.mode = "image";
292
- payload.image1 = request.image1 ?? void 0;
293
- payload.image2 = request.image2 ?? void 0;
294
- payload.aspectRatio = request.aspectRatio;
295
- payload.imageSize = request.imageSize;
296
- return true;
297
- }
298
- if (request.modality === "VIDEO") {
299
- payload.durationSeconds = typeof request.durationSeconds === "number" ? request.durationSeconds : void 0;
300
- payload.aspectRatio = request.aspectRatio;
301
- payload.resolution = "720p";
302
- payload.image1 = request.image1 ?? void 0;
303
- payload.image2 = request.image2 ?? void 0;
304
- return true;
305
- }
306
- return false;
307
- }
308
- function applyAudioGenerationPayload(payload, request) {
309
- if (request.modality === "MUSIC") {
310
- payload.durationMs = typeof request.durationMs === "number" ? request.durationMs : void 0;
311
- payload.forceInstrumental = typeof request.forceInstrumental === "boolean" ? request.forceInstrumental : void 0;
312
- payload.coverPrompt = typeof request.coverPrompt === "string" ? request.coverPrompt : void 0;
313
- return true;
314
- }
315
- if (request.modality === "SFX") {
316
- payload.durationSeconds = typeof request.durationSeconds === "number" ? request.durationSeconds : void 0;
317
- payload.loop = typeof request.loop === "boolean" ? request.loop : void 0;
318
- payload.coverPrompt = typeof request.coverPrompt === "string" ? request.coverPrompt : void 0;
319
- return true;
320
- }
321
- if (request.modality === "SPEECH") {
322
- payload.speechVoice = typeof request.speechVoice === "string" ? request.speechVoice : void 0;
323
- payload.speechProviderVoiceId = typeof request.speechProviderVoiceId === "string" ? request.speechProviderVoiceId : void 0;
324
- return true;
325
- }
326
- return false;
327
- }
328
- function applyGenerateAssetPayloadByModality(payload, request) {
329
- if (applyMediaGenerationPayload(payload, request) || applyAudioGenerationPayload(payload, request)) {
330
- return;
331
- }
332
- if (request.modality === "MODEL_3D") {
333
- payload.sourceMode = request.sourceMode;
334
- payload.image1 = request.image1 ?? void 0;
335
- payload.image2 = request.image2 ?? void 0;
336
- payload.topology = request.topology;
337
- payload.targetPolycount = typeof request.targetPolycount === "number" ? request.targetPolycount : void 0;
338
- payload.shouldRemesh = typeof request.shouldRemesh === "boolean" ? request.shouldRemesh : void 0;
339
- payload.shouldTexture = typeof request.shouldTexture === "boolean" ? request.shouldTexture : void 0;
340
- }
341
- }
342
- function buildGenerateAssetPayload(request) {
343
- const normalizedInput = request.input?.trim();
344
- if (!normalizedInput) {
345
- throw new Error("ai_client_missing_input");
346
- }
347
- const payload = {
348
- modality: request.modality,
349
- input: normalizedInput,
350
- assetName: request.assetName,
351
- assetDisplayName: request.assetDisplayName,
352
- assetDescription: request.assetDescription,
353
- assetVisibility: request.assetVisibility,
354
- attachAppVersionId: request.attachAppVersionId,
355
- remixAssetVersionRef: request.remixAssetVersionRef,
356
- suggestedTagRefs: request.suggestedTagRefs
357
- };
358
- if (request.modality !== "SPEECH") {
359
- payload.assetSubcategory = request.assetSubcategory;
360
- }
361
- applyGenerateAssetPayloadByModality(payload, request);
362
- return payload;
363
- }
364
- async function createGenerationJob(request) {
365
- const payload = buildGenerateAssetPayload(request);
366
- const response = await fetchImpl(`${baseUrl}/ai/assets/jobs`, await buildRequestInit(payload, request.signal));
367
- await ensureOk(response);
368
- return await response.json();
369
- }
370
- async function getGenerationJob(id, options = {}) {
371
- const normalizedId = id?.trim();
372
- if (!normalizedId) {
373
- throw new Error("ai_client_missing_job_id");
374
- }
375
- const response = await fetchImpl(`${baseUrl}/ai/assets/jobs/${encodeURIComponent(normalizedId)}`, {
376
- method: "GET",
377
- headers: await buildHeaders(),
378
- credentials: resolveBrowserRequestCredentials(),
379
- signal: options.signal
380
- });
381
- await ensureOk(response);
382
- return await response.json();
383
- }
384
- async function listGenerationJobs(options = {}) {
385
- const params = new URLSearchParams();
386
- if (options.modality) {
387
- params.set("modality", options.modality);
388
- }
389
- if (options.status) {
390
- params.set("status", options.status);
391
- }
392
- if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
393
- params.set("limit", String(options.limit));
394
- }
395
- if (typeof options.offset === "number" && Number.isFinite(options.offset)) {
396
- params.set("offset", String(options.offset));
397
- }
398
- const queryString = params.toString();
399
- const query = queryString ? `?${queryString}` : "";
400
- const response = await fetchImpl(`${baseUrl}/ai/assets/jobs${query}`, {
401
- method: "GET",
402
- headers: await buildHeaders(),
403
- credentials: resolveBrowserRequestCredentials(),
404
- signal: options.signal
405
- });
406
- await ensureOk(response);
407
- return await response.json();
408
- }
409
- async function deleteGenerationJob(id, options = {}) {
410
- const normalizedId = id?.trim();
411
- if (!normalizedId) {
412
- throw new Error("ai_client_missing_job_id");
413
- }
414
- const response = await fetchImpl(`${baseUrl}/ai/assets/jobs/${encodeURIComponent(normalizedId)}`, {
415
- method: "DELETE",
416
- headers: await buildHeaders(),
417
- credentials: resolveBrowserRequestCredentials(),
418
- signal: options.signal
419
- });
420
- await ensureOk(response);
421
- }
422
- async function generateJson(input, options) {
423
- const normalizedInput = input?.trim();
424
- if (!normalizedInput) {
425
- throw new Error("ai_client_missing_input");
426
- }
427
- const normalizedSystem = options?.system?.trim();
428
- const response = await fetchImpl(`${baseUrl}/json/generate`, await buildRequestInit({
429
- input: normalizedInput,
430
- size: options?.size ?? "small",
431
- system: normalizedSystem && normalizedSystem.length ? normalizedSystem : void 0,
432
- responseJsonSchema: options?.responseJsonSchema
433
- }, options?.signal));
434
- await ensureOk(response);
435
- const data = await response.json();
436
- return data;
437
- }
438
- async function listGenerations(options = {}) {
439
- const params = new URLSearchParams();
440
- if (options.type) {
441
- params.set("type", options.type);
442
- }
443
- if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
444
- params.set("limit", String(options.limit));
445
- }
446
- if (typeof options.offset === "number" && Number.isFinite(options.offset)) {
447
- params.set("offset", String(options.offset));
448
- }
449
- const queryString = params.toString();
450
- const query = queryString ? `?${queryString}` : "";
451
- const response = await fetchImpl(`${baseUrl}/generations${query}`, {
452
- method: "GET",
453
- headers: await buildHeaders(),
454
- credentials: resolveBrowserRequestCredentials(),
455
- signal: options.signal
456
- });
457
- await ensureOk(response);
458
- const data = await response.json();
459
- return data;
460
- }
461
- async function listDiscoverGenerations(options = {}) {
462
- const params = new URLSearchParams();
463
- if (options.type) {
464
- params.set("type", options.type);
465
- }
466
- if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
467
- params.set("limit", String(options.limit));
468
- }
469
- if (typeof options.offset === "number" && Number.isFinite(options.offset)) {
470
- params.set("offset", String(options.offset));
471
- }
472
- const queryString = params.toString();
473
- const query = queryString ? `?${queryString}` : "";
474
- const response = await fetchImpl(`${baseUrl}/generations/discover${query}`, {
475
- method: "GET",
476
- headers: await buildHeaders(),
477
- credentials: resolveBrowserRequestCredentials(),
478
- signal: options.signal
479
- });
480
- await ensureOk(response);
481
- const data = await response.json();
482
- return data;
483
- }
484
- return {
485
- generateText,
486
- createGenerationJob,
487
- getGenerationJob,
488
- listGenerationJobs,
489
- deleteGenerationJob,
490
- generateJson,
491
- listGenerations,
492
- listDiscoverGenerations
493
- };
494
- }
495
- // Annotate the CommonJS export names for ESM import in node:
496
- 0 && (module.exports = {
497
- GENERATION_JOB_ETA_BASELINE_SECONDS,
498
- createAiClient
499
- });
@@ -1,22 +0,0 @@
1
- {
2
- "name": "@playdrop/ai-client",
3
- "version": "0.7.2",
4
- "description": "Client SDK for the Playdrop AI server",
5
- "type": "commonjs",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "scripts": {
9
- "build": "tsc",
10
- "dev": "tsc --watch",
11
- "clean": "rm -rf dist",
12
- "test": "node --test --import tsx test/*.test.ts"
13
- },
14
- "dependencies": {
15
- "@playdrop/types": "file:../types"
16
- },
17
- "devDependencies": {
18
- "@types/node": "^20.10.0",
19
- "tsx": "^4.7.0",
20
- "typescript": "^5.3.0"
21
- }
22
- }
@@ -1,13 +0,0 @@
1
- import type { BoxelDefinition } from "./types";
2
- interface CleanEntityReport {
3
- primitives: string[];
4
- textures: string[];
5
- patterns: string[];
6
- materials: string[];
7
- }
8
- export interface CleanEntityResult {
9
- entity: BoxelDefinition;
10
- removed: CleanEntityReport;
11
- }
12
- export declare function cleanEntity(entity: BoxelDefinition): CleanEntityResult;
13
- export {};
@@ -1,141 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanEntity = cleanEntity;
4
- const entity_utils_1 = require("./entity-utils");
5
- const TEXTURE_FIELDS = [
6
- "top",
7
- "bottom",
8
- "north",
9
- "south",
10
- "east",
11
- "west",
12
- "sides",
13
- "all",
14
- "topOverlay",
15
- "bottomOverlay",
16
- "northOverlay",
17
- "southOverlay",
18
- "eastOverlay",
19
- "westOverlay",
20
- "sidesOverlay",
21
- "allOverlay",
22
- ];
23
- const collectGeometryPrimitives = (entity, target) => {
24
- const visitNode = (node) => {
25
- if (!node) {
26
- return;
27
- }
28
- if (typeof node.mesh === "string" && node.mesh.trim().length > 0) {
29
- target.add(node.mesh);
30
- }
31
- (node.children ?? []).forEach(visitNode);
32
- };
33
- if (entity.geometry?.root) {
34
- visitNode(entity.geometry.root);
35
- }
36
- };
37
- const collectPrimitiveResources = (primitive, textures, materials) => {
38
- switch (primitive.kind) {
39
- case "plain_box":
40
- if (primitive.material) {
41
- materials.add(primitive.material);
42
- }
43
- break;
44
- case "textured_box": {
45
- const box = primitive;
46
- TEXTURE_FIELDS.forEach((field) => {
47
- const textureId = box[field];
48
- if (typeof textureId === "string") {
49
- textures.add(textureId);
50
- }
51
- });
52
- break;
53
- }
54
- case "voxel_box":
55
- primitive.palette?.forEach((materialId) => {
56
- if (typeof materialId === "string") {
57
- materials.add(materialId);
58
- }
59
- });
60
- break;
61
- case "combo_box":
62
- break;
63
- default:
64
- break;
65
- }
66
- };
67
- const expandPrimitiveGraph = (entity, roots) => {
68
- const primitives = new Map(entity.primitives.map((primitive) => [primitive.id, primitive]));
69
- const queue = Array.from(roots);
70
- while (queue.length > 0) {
71
- const id = queue.pop();
72
- if (!id) {
73
- continue;
74
- }
75
- const primitive = primitives.get(id);
76
- if (!primitive) {
77
- continue;
78
- }
79
- if (primitive.kind === "combo_box") {
80
- (primitive.slots ?? []).forEach((slot) => {
81
- if (slot?.primitive && !roots.has(slot.primitive)) {
82
- roots.add(slot.primitive);
83
- queue.push(slot.primitive);
84
- }
85
- });
86
- }
87
- }
88
- return roots;
89
- };
90
- function cleanEntity(entity) {
91
- const clone = (0, entity_utils_1.cloneEntity)(entity);
92
- const usedPrimitiveIds = expandPrimitiveGraph(clone, (() => {
93
- const ids = new Set();
94
- collectGeometryPrimitives(clone, ids);
95
- return ids;
96
- })());
97
- const usedTextureIds = new Set();
98
- const usedPatternIds = new Set();
99
- const usedMaterialIds = new Set();
100
- const primitiveLookup = new Map(clone.primitives.map((primitive) => [primitive.id, primitive]));
101
- const textureLookup = new Map(clone.textures.map((texture) => [texture.id, texture]));
102
- usedPrimitiveIds.forEach((id) => {
103
- const primitive = primitiveLookup.get(id);
104
- if (!primitive) {
105
- return;
106
- }
107
- collectPrimitiveResources(primitive, usedTextureIds, usedMaterialIds);
108
- });
109
- usedTextureIds.forEach((textureId) => {
110
- const texture = textureLookup.get(textureId);
111
- if (!texture) {
112
- return;
113
- }
114
- if (typeof texture.pattern === "string") {
115
- usedPatternIds.add(texture.pattern);
116
- }
117
- texture.materials?.forEach((materialId) => {
118
- if (typeof materialId === "string") {
119
- usedMaterialIds.add(materialId);
120
- }
121
- });
122
- });
123
- const originalPrimitives = clone.primitives.map((primitive) => primitive.id);
124
- const originalTextures = clone.textures.map((texture) => texture.id);
125
- const originalPatterns = clone.patterns.map((pattern) => pattern.id);
126
- const originalMaterials = clone.materials.map((material) => material.id);
127
- clone.primitives = clone.primitives.filter((primitive) => usedPrimitiveIds.has(primitive.id));
128
- clone.textures = clone.textures.filter((texture) => usedTextureIds.has(texture.id));
129
- clone.patterns = clone.patterns.filter((pattern) => usedPatternIds.has(pattern.id));
130
- clone.materials = clone.materials.filter((material) => usedMaterialIds.has(material.id));
131
- return {
132
- entity: clone,
133
- removed: {
134
- primitives: originalPrimitives.filter((id) => !usedPrimitiveIds.has(id)),
135
- textures: originalTextures.filter((id) => !usedTextureIds.has(id)),
136
- patterns: originalPatterns.filter((id) => !usedPatternIds.has(id)),
137
- materials: originalMaterials.filter((id) => !usedMaterialIds.has(id)),
138
- },
139
- };
140
- }
141
- //# sourceMappingURL=entity-cleaner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-cleaner.js","sourceRoot":"","sources":["../../src/entity-cleaner.ts"],"names":[],"mappings":";;AAoHA,kCA6DC;AAjLD,iDAA6C;AAoB7C,MAAM,cAAc,GAA6B;IAC/C,KAAK;IACL,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,YAAY;IACZ,eAAe;IACf,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,YAAY;CACb,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,MAAuB,EAAE,MAAwB,EAAQ,EAAE;IAC5F,MAAM,SAAS,GAAG,CAAC,IAAyC,EAAQ,EAAE;QACpE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QACD,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC1B,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAChC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