@playdrop/playdrop-cli 0.3.1-build.1 → 0.3.5-build.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.
- package/README.md +60 -22
- package/config/client-meta.json +5 -5
- package/dist/apps/build.js +90 -114
- package/dist/apps/upload.js +35 -11
- package/dist/apps/validate.js +61 -0
- package/dist/assets/model-artifacts.d.ts +8 -0
- package/dist/assets/model-artifacts.js +375 -0
- package/dist/assets/model-worker.d.ts +22 -0
- package/dist/assets/model-worker.js +123 -0
- package/dist/catalogue.d.ts +10 -4
- package/dist/catalogue.js +272 -45
- package/dist/commandContext.d.ts +1 -0
- package/dist/commandContext.js +45 -15
- package/dist/commands/browse.d.ts +16 -0
- package/dist/commands/browse.js +370 -0
- package/dist/commands/build.js +12 -4
- package/dist/commands/capture.js +24 -24
- package/dist/commands/captureRemote.d.ts +11 -0
- package/dist/commands/captureRemote.js +90 -0
- package/dist/commands/comments.d.ts +14 -0
- package/dist/commands/comments.js +189 -0
- package/dist/commands/create.js +112 -72
- package/dist/commands/creations.d.ts +49 -0
- package/dist/commands/creations.js +657 -0
- package/dist/commands/credits.d.ts +10 -0
- package/dist/commands/credits.js +91 -0
- package/dist/commands/detail.d.ts +2 -2
- package/dist/commands/detail.js +148 -290
- package/dist/commands/dev.js +26 -24
- package/dist/commands/devServer.js +88 -9
- package/dist/commands/devShared.js +2 -2
- package/dist/commands/documentation.d.ts +4 -1
- package/dist/commands/documentation.js +79 -104
- package/dist/commands/feedback.d.ts +12 -9
- package/dist/commands/feedback.js +125 -257
- package/dist/commands/format.js +6 -13
- package/dist/commands/generation.d.ts +11 -0
- package/dist/commands/generation.js +329 -43
- package/dist/commands/gettingStarted.d.ts +1 -0
- package/dist/commands/gettingStarted.js +26 -0
- package/dist/commands/init.js +26 -24
- package/dist/commands/login.js +9 -8
- package/dist/commands/logout.js +2 -1
- package/dist/commands/notifications.d.ts +14 -0
- package/dist/commands/notifications.js +179 -0
- package/dist/commands/search.d.ts +13 -0
- package/dist/commands/search.js +198 -0
- package/dist/commands/upload.js +83 -35
- package/dist/commands/validate.js +15 -1
- package/dist/commands/versionsBrowse.d.ts +7 -0
- package/dist/commands/versionsBrowse.js +209 -0
- package/dist/commands/whoami.js +9 -8
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +52 -0
- package/dist/externalAssetPackValidation.d.ts +2 -0
- package/dist/externalAssetPackValidation.js +115 -0
- package/dist/http.js +1 -1
- package/dist/index.js +570 -629
- package/dist/messages.js +11 -11
- package/dist/output.d.ts +5 -0
- package/dist/output.js +45 -0
- package/dist/playwright.js +10 -2
- package/dist/refs.d.ts +18 -0
- package/dist/refs.js +105 -0
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +43 -16
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/ai-client/package.json +1 -0
- package/node_modules/@playdrop/api-client/dist/client.d.ts +77 -43
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +379 -1574
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +9 -0
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/core/errors.js +46 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +27 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/core/request.js +122 -0
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +75 -0
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +282 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +22 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +15 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +60 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +301 -0
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +59 -0
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +297 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +62 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +297 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +28 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +78 -0
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +29 -0
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/comments.js +65 -0
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +24 -0
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/me.js +35 -0
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +37 -0
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/payments.js +148 -0
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +27 -0
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/search.js +65 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +59 -60
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +142 -53
- package/node_modules/@playdrop/api-client/package.json +3 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-cleaner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-utils.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +6 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/builder.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/palette_tools.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +4 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/serialization.js +10 -10
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.d.ts +5 -5
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/layer-mode.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/layer-mode.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +2 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/slice.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/slice.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +3 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/upscale.js +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.d.ts +3 -3
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.d.ts +10 -10
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.js +36 -36
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/entity-utils.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.js +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/layer-mode.test.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/test/palette-tools.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.js +6 -6
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/textures.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/types.test.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/types.test.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/test/upscale.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.js +11 -11
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/package.json +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +4 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/animations.js +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/builders.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/builders.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/glb.d.ts +9 -9
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/glb.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/image.d.ts +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/image.js +5 -5
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -0
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +15 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/instantiate.d.ts +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/instantiate.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/nodes.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +7 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/overlays.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +3 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/scene.js +6 -6
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/textures.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/textures.js +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/types.d.ts +15 -15
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/faces.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/mesher.js +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/export-image.playwright.test.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.d.ts +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.js +10 -10
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/glb-skinned.test.js +6 -6
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +8 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/instantiate.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/overlays.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-filter.test.js +5 -5
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-smoke.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/skinned-mesh.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/textured-overlay.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/package.json +5 -4
- package/node_modules/@playdrop/config/client-meta.json +5 -5
- package/node_modules/@playdrop/config/dist/src/constants.d.ts +5 -0
- package/node_modules/@playdrop/config/dist/src/constants.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/constants.js +5 -1
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/config/package.json +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +326 -62
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +56 -0
- package/node_modules/@playdrop/types/dist/app.d.ts +0 -14
- package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app.js +0 -10
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +12 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +85 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.js +43 -37
- package/node_modules/@playdrop/types/dist/entity.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/entity.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/entity.js +2 -2
- package/node_modules/@playdrop/types/dist/realtime.d.ts +27 -26
- package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.d.ts +5 -0
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/package.json +11 -9
- package/bin/playdrop-cli +0 -2
- package/dist/commands/asset-packs.d.ts +0 -27
- package/dist/commands/asset-packs.js +0 -508
- package/dist/commands/assets.d.ts +0 -35
- package/dist/commands/assets.js +0 -668
- package/dist/commands/list.d.ts +0 -7
- package/dist/commands/list.js +0 -347
- package/dist/commands/migrateCatalogueV2.d.ts +0 -1
- package/dist/commands/migrateCatalogueV2.js +0 -142
- package/dist/commands/versions.d.ts +0 -17
- package/dist/commands/versions.js +0 -384
- package/node_modules/@playdrop/entity-core/dist/src/entity-cleaner.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/entity-utils.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/types.d.ts +0 -6
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r6/builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/templates/index.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/palette_tools.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/serialization.d.ts +0 -4
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/upscale.d.ts +0 -3
- package/node_modules/@playdrop/entity-core/dist/test/entity-utils.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/layer-mode.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/palette-tools.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/textures.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/types.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/upscale.test.js.map +0 -1
- package/node_modules/@playdrop/entity-three/dist/src/animations.d.ts +0 -4
- package/node_modules/@playdrop/entity-three/dist/src/index.d.ts +0 -17
- package/node_modules/@playdrop/entity-three/dist/src/index.js +0 -15
- package/node_modules/@playdrop/entity-three/dist/src/overlays.d.ts +0 -7
- package/node_modules/@playdrop/entity-three/dist/src/scene.d.ts +0 -3
- package/node_modules/@playdrop/entity-three/dist/test/index.test.js +0 -8
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.d.ts +0 -22
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.d.ts.map +0 -1
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.js +0 -105
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-cleaner.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-utils.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/textured-builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/types.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/types.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/voxel-builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/humanoid_r15.json +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/humanoid_r6.json +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/palette_tools.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/infer-face.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/merge-overlay.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/entity-utils.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/entity-utils.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/layer-mode.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/layer-mode.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/palette-tools.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/palette-tools.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/textures.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/textures.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/types.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/upscale.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/upscale.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/context.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/nodes.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/primitives.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/primitives.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/skinned-mesh.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/texture-atlas.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/texture-atlas.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/types.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/faces.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/export-image.playwright.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/glb-skinned.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/index.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/instantiate.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/overlays.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-filter.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-smoke.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/skinned-mesh.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/textured-overlay.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/voxels.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/voxels.test.js +0 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.isGeneratedModel3DAssetTask = isGeneratedModel3DAssetTask;
|
|
40
|
+
exports.assertGeneratedModel3DAssetRoles = assertGeneratedModel3DAssetRoles;
|
|
41
|
+
exports.prepareModel3DAssetArtifacts = prepareModel3DAssetArtifacts;
|
|
42
|
+
const node_fs_1 = require("node:fs");
|
|
43
|
+
const promises_1 = require("node:fs/promises");
|
|
44
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
45
|
+
const boxel_core_1 = require("@playdrop/boxel-core");
|
|
46
|
+
const vox_three_1 = require("@playdrop/vox-three");
|
|
47
|
+
const types_1 = require("@playdrop/types");
|
|
48
|
+
const playwright_1 = require("../playwright");
|
|
49
|
+
const GENERATED_MODEL_3D_FORMATS = new Set(['PLAYDROP_BOXEL_JSON', 'VOX']);
|
|
50
|
+
const BOXEL_REQUIRED_FILE_ROLES = ['primary', 'mesh', 'preview'];
|
|
51
|
+
const VOX_REQUIRED_FILE_ROLES = ['primary', 'boxel', 'mesh', 'preview'];
|
|
52
|
+
const DEFAULT_PRESET = {
|
|
53
|
+
meshMode: 'merged',
|
|
54
|
+
previewMode: 'merged',
|
|
55
|
+
previewDirection: 'preview',
|
|
56
|
+
width: 1024,
|
|
57
|
+
height: 1024,
|
|
58
|
+
};
|
|
59
|
+
const MODEL_PRESET_BY_SUBCATEGORY = {
|
|
60
|
+
avatar: {
|
|
61
|
+
meshMode: 'skinned',
|
|
62
|
+
previewMode: 'skinned',
|
|
63
|
+
previewDirection: 'headshot',
|
|
64
|
+
width: 1024,
|
|
65
|
+
height: 1024,
|
|
66
|
+
},
|
|
67
|
+
humanoid: {
|
|
68
|
+
meshMode: 'skinned',
|
|
69
|
+
previewMode: 'skinned',
|
|
70
|
+
previewDirection: 'headshot',
|
|
71
|
+
width: 1024,
|
|
72
|
+
height: 1024,
|
|
73
|
+
},
|
|
74
|
+
creature: {
|
|
75
|
+
meshMode: 'skinned',
|
|
76
|
+
previewMode: 'skinned',
|
|
77
|
+
previewDirection: 'headshot',
|
|
78
|
+
width: 1024,
|
|
79
|
+
height: 1024,
|
|
80
|
+
},
|
|
81
|
+
block: {
|
|
82
|
+
meshMode: 'merged',
|
|
83
|
+
previewMode: 'merged',
|
|
84
|
+
previewDirection: 'preview',
|
|
85
|
+
width: 1024,
|
|
86
|
+
height: 1024,
|
|
87
|
+
},
|
|
88
|
+
generic: {
|
|
89
|
+
meshMode: 'merged',
|
|
90
|
+
previewMode: 'merged',
|
|
91
|
+
previewDirection: 'preview',
|
|
92
|
+
width: 1024,
|
|
93
|
+
height: 1024,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const TOOL_NAME = 'playdrop';
|
|
97
|
+
const WORKER_ENTRY_BASENAMES = ['model-worker.ts', 'model-worker.js'];
|
|
98
|
+
let workerBundlePromise = null;
|
|
99
|
+
function normalizeRole(role) {
|
|
100
|
+
return role.trim().toLowerCase();
|
|
101
|
+
}
|
|
102
|
+
function resolveTaskLabel(task) {
|
|
103
|
+
if (task.kind === 'embedded-asset') {
|
|
104
|
+
return `${task.appName}:${task.name}`;
|
|
105
|
+
}
|
|
106
|
+
return task.name;
|
|
107
|
+
}
|
|
108
|
+
function getRolePath(task, role) {
|
|
109
|
+
for (const [entryRole, filePath] of Object.entries(task.filePaths)) {
|
|
110
|
+
if (normalizeRole(entryRole) === role && typeof filePath === 'string' && filePath.trim().length > 0) {
|
|
111
|
+
return filePath;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
function inferGeneratedModel3DFormat(task, explicitFormat) {
|
|
117
|
+
const normalizedFormat = typeof explicitFormat === 'string' ? explicitFormat.trim().toUpperCase() : '';
|
|
118
|
+
if (GENERATED_MODEL_3D_FORMATS.has(normalizedFormat)) {
|
|
119
|
+
return normalizedFormat;
|
|
120
|
+
}
|
|
121
|
+
const primaryPath = getRolePath(task, 'primary');
|
|
122
|
+
if (!primaryPath) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const normalizedPath = primaryPath.trim().toLowerCase();
|
|
126
|
+
if (normalizedPath.endsWith('.boxel.json')) {
|
|
127
|
+
return 'PLAYDROP_BOXEL_JSON';
|
|
128
|
+
}
|
|
129
|
+
if (normalizedPath.endsWith('.vox')) {
|
|
130
|
+
return 'VOX';
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
function getRequiredFileRoles(format) {
|
|
135
|
+
return format === 'VOX' ? VOX_REQUIRED_FILE_ROLES : BOXEL_REQUIRED_FILE_ROLES;
|
|
136
|
+
}
|
|
137
|
+
function getMissingRequiredRoles(task, format) {
|
|
138
|
+
const normalizedRoles = new Set(Object.keys(task.filePaths).map((role) => normalizeRole(role)));
|
|
139
|
+
return getRequiredFileRoles(format).filter((role) => !normalizedRoles.has(role));
|
|
140
|
+
}
|
|
141
|
+
function resolveWorkerEntryPath() {
|
|
142
|
+
for (const basename of WORKER_ENTRY_BASENAMES) {
|
|
143
|
+
const candidate = node_path_1.default.join(__dirname, basename);
|
|
144
|
+
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
145
|
+
return candidate;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
throw new Error(`[${TOOL_NAME}] Boxel worker entry file not found from ${__dirname}.`);
|
|
149
|
+
}
|
|
150
|
+
async function loadEsbuild() {
|
|
151
|
+
const module = await Promise.resolve().then(() => __importStar(require('esbuild')));
|
|
152
|
+
return module.build;
|
|
153
|
+
}
|
|
154
|
+
async function getWorkerBundle() {
|
|
155
|
+
if (!workerBundlePromise) {
|
|
156
|
+
workerBundlePromise = (async () => {
|
|
157
|
+
const build = await loadEsbuild();
|
|
158
|
+
const result = await build({
|
|
159
|
+
entryPoints: [resolveWorkerEntryPath()],
|
|
160
|
+
bundle: true,
|
|
161
|
+
platform: 'browser',
|
|
162
|
+
format: 'esm',
|
|
163
|
+
target: 'es2022',
|
|
164
|
+
write: false,
|
|
165
|
+
sourcemap: false,
|
|
166
|
+
logLevel: 'silent',
|
|
167
|
+
});
|
|
168
|
+
const output = result.outputFiles?.[0]?.text;
|
|
169
|
+
if (!output) {
|
|
170
|
+
throw new Error(`[${TOOL_NAME}] Failed to bundle boxel worker.`);
|
|
171
|
+
}
|
|
172
|
+
return output;
|
|
173
|
+
})();
|
|
174
|
+
}
|
|
175
|
+
return workerBundlePromise;
|
|
176
|
+
}
|
|
177
|
+
async function withModelWorkerPage(callback, viewport) {
|
|
178
|
+
return (0, playwright_1.withChromiumPage)(async ({ page }) => {
|
|
179
|
+
const consoleErrors = [];
|
|
180
|
+
page.on('console', (message) => {
|
|
181
|
+
if (message.type() === 'error') {
|
|
182
|
+
consoleErrors.push(message.text());
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
page.on('pageerror', (error) => {
|
|
186
|
+
consoleErrors.push(error?.message ?? String(error));
|
|
187
|
+
});
|
|
188
|
+
await page.setContent('<canvas id="viewport"></canvas>', { waitUntil: 'domcontentloaded' });
|
|
189
|
+
const bundle = await getWorkerBundle();
|
|
190
|
+
await page.addScriptTag({ type: 'module', content: bundle });
|
|
191
|
+
await page.waitForFunction(() => typeof window.playdropBoxelWorker !== 'undefined');
|
|
192
|
+
const result = await callback(page);
|
|
193
|
+
if (consoleErrors.length > 0) {
|
|
194
|
+
throw new Error(consoleErrors.join('\n'));
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
}, { viewport });
|
|
198
|
+
}
|
|
199
|
+
async function exportBoxelWithWorker(boxel, mode) {
|
|
200
|
+
try {
|
|
201
|
+
const base64 = await withModelWorkerPage((page) => page.evaluate(({ model, exportMode }) => window.playdropBoxelWorker.exportBoxel(model, { mode: exportMode }), { model: boxel, exportMode: mode }), { width: 1024, height: 1024 });
|
|
202
|
+
if (typeof base64 !== 'string' || base64.length === 0) {
|
|
203
|
+
throw new Error('Model exporter did not return GLB data.');
|
|
204
|
+
}
|
|
205
|
+
return Buffer.from(base64, 'base64');
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw (0, playwright_1.createPlaywrightLaunchError)(TOOL_NAME, error);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function renderPreviewWithWorker(boxel, options) {
|
|
212
|
+
try {
|
|
213
|
+
const dataUrl = await withModelWorkerPage((page) => page.evaluate(({ model, renderOptions }) => window.playdropBoxelWorker.renderBoxel(model, renderOptions), {
|
|
214
|
+
model: boxel,
|
|
215
|
+
renderOptions: {
|
|
216
|
+
mode: options.mode,
|
|
217
|
+
direction: options.direction,
|
|
218
|
+
width: options.width,
|
|
219
|
+
height: options.height,
|
|
220
|
+
},
|
|
221
|
+
}), { width: options.width, height: options.height });
|
|
222
|
+
if (typeof dataUrl !== 'string' || !dataUrl.startsWith('data:image/png;base64,')) {
|
|
223
|
+
throw new Error('Model renderer did not return PNG data.');
|
|
224
|
+
}
|
|
225
|
+
return Buffer.from(dataUrl.slice('data:image/png;base64,'.length), 'base64');
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
throw (0, playwright_1.createPlaywrightLaunchError)(TOOL_NAME, error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
async function renderVoxPreviewWithWorker(voxBuffer, options) {
|
|
232
|
+
try {
|
|
233
|
+
const dataUrl = await withModelWorkerPage((page) => page.evaluate(({ voxBase64, renderOptions }) => window.playdropBoxelWorker.renderVox(voxBase64, renderOptions), {
|
|
234
|
+
voxBase64: voxBuffer.toString('base64'),
|
|
235
|
+
renderOptions: {
|
|
236
|
+
width: options.width,
|
|
237
|
+
height: options.height,
|
|
238
|
+
},
|
|
239
|
+
}), { width: options.width, height: options.height });
|
|
240
|
+
if (typeof dataUrl !== 'string' || !dataUrl.startsWith('data:image/png;base64,')) {
|
|
241
|
+
throw new Error('VOX preview renderer did not return PNG data.');
|
|
242
|
+
}
|
|
243
|
+
return Buffer.from(dataUrl.slice('data:image/png;base64,'.length), 'base64');
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
throw (0, playwright_1.createPlaywrightLaunchError)(TOOL_NAME, error);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function parseAndValidateBoxel(raw, label) {
|
|
250
|
+
let parsed;
|
|
251
|
+
try {
|
|
252
|
+
parsed = (0, boxel_core_1.parseBoxel)(JSON.parse(raw));
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
256
|
+
throw new Error(`Asset "${label}" has invalid files.primary Boxel JSON: ${reason}`);
|
|
257
|
+
}
|
|
258
|
+
const validation = (0, boxel_core_1.validateBoxel)(parsed);
|
|
259
|
+
if (!validation.boxel || validation.issues.length > 0) {
|
|
260
|
+
const summary = validation.issues.slice(0, 3).map((issue) => `${issue.path}: ${issue.message}`).join('; ');
|
|
261
|
+
throw new Error(`Asset "${label}" files.primary failed boxel validation${summary ? `: ${summary}` : ''}`);
|
|
262
|
+
}
|
|
263
|
+
return validation.boxel;
|
|
264
|
+
}
|
|
265
|
+
function resolvePreset(subcategory) {
|
|
266
|
+
const normalized = subcategory.trim().toLowerCase();
|
|
267
|
+
return MODEL_PRESET_BY_SUBCATEGORY[normalized] ?? DEFAULT_PRESET;
|
|
268
|
+
}
|
|
269
|
+
function isGeneratedModel3DAssetTask(task, format) {
|
|
270
|
+
const category = typeof task.category === 'string' ? task.category.trim().toUpperCase() : '';
|
|
271
|
+
const subcategory = typeof task.subcategory === 'string' ? task.subcategory.trim() : '';
|
|
272
|
+
if (category !== 'MODEL_3D' || !(0, types_1.isModel3DAssetSubcategory)('MODEL_3D', subcategory)) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
return inferGeneratedModel3DFormat(task, format) !== null;
|
|
276
|
+
}
|
|
277
|
+
function assertGeneratedModel3DAssetRoles(task, format) {
|
|
278
|
+
const generatedFormat = inferGeneratedModel3DFormat(task, format);
|
|
279
|
+
if (!generatedFormat) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const missing = getMissingRequiredRoles(task, generatedFormat);
|
|
283
|
+
if (missing.length > 0) {
|
|
284
|
+
const label = resolveTaskLabel(task);
|
|
285
|
+
throw new Error(`Asset "${label}" requires files.${missing.join(', files.')} for format "${generatedFormat}".`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async function ensureExistingFile(filePath, label, role) {
|
|
289
|
+
let fileStats;
|
|
290
|
+
try {
|
|
291
|
+
fileStats = await (0, promises_1.stat)(filePath);
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
295
|
+
throw new Error(`Asset "${label}" files.${role} was not found at ${filePath}: ${reason}`);
|
|
296
|
+
}
|
|
297
|
+
if (!fileStats.isFile()) {
|
|
298
|
+
throw new Error(`Asset "${label}" files.${role} path must be a file: ${filePath}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async function loadBoxelFromPrimary(task, label) {
|
|
302
|
+
const primaryPath = getRolePath(task, 'primary');
|
|
303
|
+
if (!primaryPath) {
|
|
304
|
+
throw new Error(`Asset "${label}" is missing files.primary.`);
|
|
305
|
+
}
|
|
306
|
+
await ensureExistingFile(primaryPath, label, 'primary');
|
|
307
|
+
const raw = await (0, promises_1.readFile)(primaryPath, 'utf8');
|
|
308
|
+
return parseAndValidateBoxel(raw, label);
|
|
309
|
+
}
|
|
310
|
+
async function loadValidatedVoxBuffer(task, label) {
|
|
311
|
+
const primaryPath = getRolePath(task, 'primary');
|
|
312
|
+
if (!primaryPath) {
|
|
313
|
+
throw new Error(`Asset "${label}" is missing files.primary.`);
|
|
314
|
+
}
|
|
315
|
+
await ensureExistingFile(primaryPath, label, 'primary');
|
|
316
|
+
const buffer = await (0, promises_1.readFile)(primaryPath);
|
|
317
|
+
try {
|
|
318
|
+
(0, vox_three_1.assertValidVoxBuffer)(buffer);
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
322
|
+
throw new Error(`Asset "${label}" files.primary is not a valid .vox file: ${reason}`);
|
|
323
|
+
}
|
|
324
|
+
return buffer;
|
|
325
|
+
}
|
|
326
|
+
async function prepareModel3DAssetArtifacts(task, options = {}) {
|
|
327
|
+
const generatedFormat = inferGeneratedModel3DFormat(task, task.format);
|
|
328
|
+
if (!generatedFormat) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
assertGeneratedModel3DAssetRoles(task, task.format);
|
|
332
|
+
const label = resolveTaskLabel(task);
|
|
333
|
+
const meshPath = getRolePath(task, 'mesh');
|
|
334
|
+
const previewPath = getRolePath(task, 'preview');
|
|
335
|
+
if (!meshPath || !previewPath) {
|
|
336
|
+
throw new Error(`Asset "${label}" is missing required generated 3D file paths.`);
|
|
337
|
+
}
|
|
338
|
+
const voxBuffer = generatedFormat === 'VOX'
|
|
339
|
+
? await loadValidatedVoxBuffer(task, label)
|
|
340
|
+
: null;
|
|
341
|
+
const boxel = generatedFormat === 'VOX'
|
|
342
|
+
? await (0, vox_three_1.convertVoxToBoxel)(voxBuffer, task.name)
|
|
343
|
+
: await loadBoxelFromPrimary(task, label);
|
|
344
|
+
if (options.dryRun) {
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
const preset = resolvePreset(task.subcategory);
|
|
348
|
+
const [meshBuffer, previewBuffer] = await Promise.all([
|
|
349
|
+
exportBoxelWithWorker(boxel, preset.meshMode),
|
|
350
|
+
generatedFormat === 'VOX'
|
|
351
|
+
? renderVoxPreviewWithWorker(voxBuffer, {
|
|
352
|
+
width: preset.width,
|
|
353
|
+
height: preset.height,
|
|
354
|
+
})
|
|
355
|
+
: renderPreviewWithWorker(boxel, {
|
|
356
|
+
mode: preset.previewMode,
|
|
357
|
+
direction: preset.previewDirection,
|
|
358
|
+
width: preset.width,
|
|
359
|
+
height: preset.height,
|
|
360
|
+
}),
|
|
361
|
+
]);
|
|
362
|
+
await (0, promises_1.mkdir)(node_path_1.default.dirname(meshPath), { recursive: true });
|
|
363
|
+
await (0, promises_1.mkdir)(node_path_1.default.dirname(previewPath), { recursive: true });
|
|
364
|
+
await (0, promises_1.writeFile)(meshPath, meshBuffer);
|
|
365
|
+
await (0, promises_1.writeFile)(previewPath, previewBuffer);
|
|
366
|
+
if (generatedFormat === 'VOX') {
|
|
367
|
+
const boxelPath = getRolePath(task, 'boxel');
|
|
368
|
+
if (!boxelPath) {
|
|
369
|
+
throw new Error(`Asset "${label}" is missing files.boxel.`);
|
|
370
|
+
}
|
|
371
|
+
await (0, promises_1.mkdir)(node_path_1.default.dirname(boxelPath), { recursive: true });
|
|
372
|
+
await (0, promises_1.writeFile)(boxelPath, `${(0, boxel_core_1.formatBoxel)(boxel)}\n`, 'utf8');
|
|
373
|
+
}
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ExportMode } from '@playdrop/boxel-three';
|
|
2
|
+
type ExportEntityOptions = {
|
|
3
|
+
mode?: ExportMode;
|
|
4
|
+
animationIds?: string[] | null;
|
|
5
|
+
};
|
|
6
|
+
type RenderEntityOptions = ExportEntityOptions & {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
direction?: string;
|
|
10
|
+
background?: number | string | null;
|
|
11
|
+
animationId?: string | null;
|
|
12
|
+
};
|
|
13
|
+
declare global {
|
|
14
|
+
interface Window {
|
|
15
|
+
playdropBoxelWorker?: {
|
|
16
|
+
exportBoxel(modelJson: unknown, options?: ExportEntityOptions): Promise<string>;
|
|
17
|
+
renderBoxel(modelJson: unknown, options?: RenderEntityOptions): Promise<string>;
|
|
18
|
+
renderVox(voxBase64: string, options?: RenderEntityOptions): Promise<string>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const THREE = __importStar(require("three"));
|
|
37
|
+
const GLTFExporter_js_1 = require("three/examples/jsm/exporters/GLTFExporter.js");
|
|
38
|
+
const boxel_three_1 = require("@playdrop/boxel-three");
|
|
39
|
+
const boxel_core_1 = require("@playdrop/boxel-core");
|
|
40
|
+
const vox_three_1 = require("@playdrop/vox-three");
|
|
41
|
+
function arrayBufferToBase64(buffer) {
|
|
42
|
+
const bytes = new Uint8Array(buffer);
|
|
43
|
+
const chunkSize = 0x8000;
|
|
44
|
+
let binary = '';
|
|
45
|
+
for (let index = 0; index < bytes.length; index += chunkSize) {
|
|
46
|
+
const chunk = bytes.subarray(index, index + chunkSize);
|
|
47
|
+
binary += String.fromCharCode(...chunk);
|
|
48
|
+
}
|
|
49
|
+
return btoa(binary);
|
|
50
|
+
}
|
|
51
|
+
let cachedRenderer = null;
|
|
52
|
+
function getOrCreateRenderer() {
|
|
53
|
+
if (cachedRenderer) {
|
|
54
|
+
return cachedRenderer;
|
|
55
|
+
}
|
|
56
|
+
const canvas = document.getElementById('viewport');
|
|
57
|
+
if (!canvas) {
|
|
58
|
+
throw new Error('render_canvas_unavailable');
|
|
59
|
+
}
|
|
60
|
+
cachedRenderer = new THREE.WebGLRenderer({
|
|
61
|
+
canvas,
|
|
62
|
+
antialias: true,
|
|
63
|
+
preserveDrawingBuffer: true,
|
|
64
|
+
alpha: true,
|
|
65
|
+
});
|
|
66
|
+
return cachedRenderer;
|
|
67
|
+
}
|
|
68
|
+
function base64ToArrayBuffer(value) {
|
|
69
|
+
const binary = atob(value);
|
|
70
|
+
const bytes = new Uint8Array(binary.length);
|
|
71
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
72
|
+
bytes[index] = binary.charCodeAt(index);
|
|
73
|
+
}
|
|
74
|
+
return bytes.buffer;
|
|
75
|
+
}
|
|
76
|
+
async function exportBoxel(modelJson, options) {
|
|
77
|
+
const model = (0, boxel_core_1.parseBoxel)(modelJson);
|
|
78
|
+
const blob = await (0, boxel_three_1.exportModelToGLB)({
|
|
79
|
+
THREE,
|
|
80
|
+
GLTFExporterCtor: GLTFExporter_js_1.GLTFExporter,
|
|
81
|
+
model,
|
|
82
|
+
mode: options?.mode,
|
|
83
|
+
animationIds: options?.animationIds,
|
|
84
|
+
});
|
|
85
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
86
|
+
return arrayBufferToBase64(arrayBuffer);
|
|
87
|
+
}
|
|
88
|
+
async function renderBoxel(modelJson, options) {
|
|
89
|
+
const model = (0, boxel_core_1.parseBoxel)(modelJson);
|
|
90
|
+
const renderer = getOrCreateRenderer();
|
|
91
|
+
renderer.setPixelRatio(1);
|
|
92
|
+
return (0, boxel_three_1.renderBoxelToDataURL)({
|
|
93
|
+
THREE,
|
|
94
|
+
renderer,
|
|
95
|
+
entity: model,
|
|
96
|
+
mode: options?.mode ?? 'hierarchical',
|
|
97
|
+
animationIds: options?.animationIds,
|
|
98
|
+
animationId: options?.animationId ?? undefined,
|
|
99
|
+
width: options?.width,
|
|
100
|
+
height: options?.height,
|
|
101
|
+
direction: options?.direction,
|
|
102
|
+
background: options?.background ?? null,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function renderVox(voxBase64, options) {
|
|
106
|
+
if (typeof voxBase64 !== 'string' || voxBase64.length === 0) {
|
|
107
|
+
throw new Error('vox_preview_input_missing');
|
|
108
|
+
}
|
|
109
|
+
const renderer = getOrCreateRenderer();
|
|
110
|
+
renderer.setPixelRatio(1);
|
|
111
|
+
return (0, vox_three_1.renderVoxToDataURL)({
|
|
112
|
+
THREE,
|
|
113
|
+
renderer,
|
|
114
|
+
input: base64ToArrayBuffer(voxBase64),
|
|
115
|
+
width: options?.width,
|
|
116
|
+
height: options?.height,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
window.playdropBoxelWorker = {
|
|
120
|
+
exportBoxel,
|
|
121
|
+
renderBoxel,
|
|
122
|
+
renderVox,
|
|
123
|
+
};
|
package/dist/catalogue.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export type AssetCatalogueEntry = {
|
|
|
58
58
|
files?: Record<string, string>;
|
|
59
59
|
visibility?: string;
|
|
60
60
|
shopListed?: boolean;
|
|
61
|
-
|
|
61
|
+
shopPriceCredits?: number;
|
|
62
62
|
relations?: Array<{
|
|
63
63
|
type: string;
|
|
64
64
|
to: string;
|
|
@@ -72,13 +72,16 @@ export type EmbeddedAssetCatalogueEntry = {
|
|
|
72
72
|
files?: Record<string, string>;
|
|
73
73
|
visibility?: string;
|
|
74
74
|
shopListed?: boolean;
|
|
75
|
-
|
|
75
|
+
shopPriceCredits?: number;
|
|
76
76
|
};
|
|
77
77
|
export type AssetPackCatalogueEntry = {
|
|
78
78
|
name: string;
|
|
79
79
|
version?: string;
|
|
80
80
|
username?: string;
|
|
81
81
|
assets?: string[];
|
|
82
|
+
hostingMode?: string;
|
|
83
|
+
externalUrl?: string;
|
|
84
|
+
downloadUrl?: string;
|
|
82
85
|
previewApp?: string;
|
|
83
86
|
visibility?: string;
|
|
84
87
|
releaseNotes?: string;
|
|
@@ -158,7 +161,7 @@ export type AssetTask = {
|
|
|
158
161
|
format?: string;
|
|
159
162
|
visibility?: string;
|
|
160
163
|
shopListed?: boolean;
|
|
161
|
-
|
|
164
|
+
shopPriceCredits?: number;
|
|
162
165
|
files: Record<string, string>;
|
|
163
166
|
filePaths: Record<string, string>;
|
|
164
167
|
relations?: Array<{
|
|
@@ -176,7 +179,7 @@ export type EmbeddedAssetTask = {
|
|
|
176
179
|
format?: string;
|
|
177
180
|
visibility?: string;
|
|
178
181
|
shopListed?: boolean;
|
|
179
|
-
|
|
182
|
+
shopPriceCredits?: number;
|
|
180
183
|
files: Record<string, string>;
|
|
181
184
|
filePaths: Record<string, string>;
|
|
182
185
|
};
|
|
@@ -187,6 +190,9 @@ export type AssetPackTask = {
|
|
|
187
190
|
cataloguePath: string;
|
|
188
191
|
username?: string;
|
|
189
192
|
assets: string[];
|
|
193
|
+
hostingMode?: AppHostingMode;
|
|
194
|
+
externalUrl?: string;
|
|
195
|
+
downloadUrl?: string;
|
|
190
196
|
previewApp?: string;
|
|
191
197
|
visibility?: string;
|
|
192
198
|
releaseNotes?: string;
|