@playdrop/playdrop-cli 0.16.5 → 0.16.12
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/bin/playdrop +1 -2
- package/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +2 -2
- package/dist/apiClient.js +16 -20
- package/dist/appUrls.d.ts +2 -2
- package/dist/appUrls.js +31 -33
- package/dist/apps/build.d.ts +2 -2
- package/dist/apps/build.js +83 -83
- package/dist/apps/index.d.ts +7 -7
- package/dist/apps/index.js +8 -8
- package/dist/apps/loadCheck.d.ts +28 -16
- package/dist/apps/loadCheck.js +411 -279
- package/dist/apps/registration.d.ts +3 -3
- package/dist/apps/registration.js +1 -1
- package/dist/apps/staticHtml.d.ts +3 -3
- package/dist/apps/staticHtml.js +90 -91
- package/dist/apps/surfaceProfiles.d.ts +2 -2
- package/dist/apps/surfaceProfiles.js +6 -6
- package/dist/apps/upload.d.ts +5 -5
- package/dist/apps/upload.js +75 -81
- package/dist/apps/validate.d.ts +2 -2
- package/dist/apps/validate.js +18 -22
- package/dist/assetSpecs.d.ts +2 -2
- package/dist/assetSpecs.js +35 -35
- package/dist/assets/model-artifacts.d.ts +1 -1
- package/dist/assets/model-artifacts.js +81 -77
- package/dist/assets/model-worker.d.ts +1 -1
- package/dist/assets/model-worker.js +6 -6
- package/dist/browser.js +9 -9
- package/dist/catalogue-utils.d.ts +1 -1
- package/dist/catalogue-utils.js +26 -26
- package/dist/catalogue.d.ts +21 -16
- package/dist/catalogue.js +509 -413
- package/dist/clientInfo.d.ts +1 -1
- package/dist/clientInfo.js +28 -28
- package/dist/commandContext.d.ts +5 -5
- package/dist/commandContext.js +19 -23
- package/dist/commands/accounts.js +6 -6
- package/dist/commands/ads.js +16 -16
- package/dist/commands/agents.d.ts +2 -2
- package/dist/commands/agents.js +131 -127
- package/dist/commands/boosts.js +41 -31
- package/dist/commands/browse.d.ts +2 -2
- package/dist/commands/browse.js +168 -128
- package/dist/commands/build.js +9 -9
- package/dist/commands/captureListing.d.ts +8 -8
- package/dist/commands/captureListing.js +292 -332
- package/dist/commands/changelog.js +1 -1
- package/dist/commands/chat.js +51 -53
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.js +44 -44
- package/dist/commands/clients.d.ts +3 -3
- package/dist/commands/clients.js +67 -64
- package/dist/commands/comments.js +36 -29
- package/dist/commands/create.js +305 -312
- package/dist/commands/createRemixContent.d.ts +1 -1
- package/dist/commands/createRemixContent.js +65 -60
- package/dist/commands/creations.js +205 -135
- package/dist/commands/credits.js +37 -27
- package/dist/commands/detail.js +40 -34
- package/dist/commands/dev.js +103 -126
- package/dist/commands/devBrowser.js +74 -65
- package/dist/commands/devRuntimeAssets.d.ts +4 -4
- package/dist/commands/devRuntimeAssets.js +38 -40
- package/dist/commands/devServer.d.ts +4 -4
- package/dist/commands/devServer.js +183 -174
- package/dist/commands/devShared.d.ts +3 -3
- package/dist/commands/devShared.js +31 -31
- package/dist/commands/doctor.d.ts +5 -5
- package/dist/commands/doctor.js +63 -57
- package/dist/commands/documentation.js +42 -32
- package/dist/commands/feedback.js +59 -42
- package/dist/commands/format.js +9 -9
- package/dist/commands/generation.d.ts +2 -2
- package/dist/commands/generation.js +344 -326
- package/dist/commands/init.d.ts +4 -4
- package/dist/commands/init.js +64 -61
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +42 -62
- package/dist/commands/logout.js +4 -4
- package/dist/commands/marketing.d.ts +8 -8
- package/dist/commands/marketing.js +246 -297
- package/dist/commands/notes.js +19 -19
- package/dist/commands/notifications.js +34 -22
- package/dist/commands/npmProcess.js +3 -3
- package/dist/commands/ownedRuntimeImageValidation.d.ts +1 -1
- package/dist/commands/ownedRuntimeImageValidation.js +19 -17
- package/dist/commands/play.js +12 -21
- package/dist/commands/publicPages.js +8 -4
- package/dist/commands/review.js +123 -110
- package/dist/commands/search.js +107 -88
- package/dist/commands/tags.js +10 -12
- package/dist/commands/taskCaptureSession.d.ts +3 -3
- package/dist/commands/taskCaptureSession.js +3 -3
- package/dist/commands/tweaks.js +25 -23
- package/dist/commands/upgrade.js +40 -31
- package/dist/commands/upload-content.d.ts +5 -5
- package/dist/commands/upload-content.js +130 -122
- package/dist/commands/upload-graph.d.ts +1 -1
- package/dist/commands/upload-graph.js +7 -11
- package/dist/commands/upload.d.ts +7 -7
- package/dist/commands/upload.js +196 -217
- package/dist/commands/validate.js +33 -32
- package/dist/commands/versionsBrowse.js +61 -51
- package/dist/commands/whoami.js +11 -14
- package/dist/commands/worker/archive-staging.d.ts +9 -0
- package/dist/commands/worker/archive-staging.js +257 -0
- package/dist/commands/worker/instrument-evidence.d.ts +1 -1
- package/dist/commands/worker/instrument-evidence.js +41 -43
- package/dist/commands/worker/provider-telemetry.d.ts +2 -1
- package/dist/commands/worker/provider-telemetry.js +181 -64
- package/dist/commands/worker/runtime.d.ts +18 -3
- package/dist/commands/worker/runtime.js +291 -239
- package/dist/commands/worker.d.ts +83 -22
- package/dist/commands/worker.js +1980 -1411
- package/dist/commands/workspaces.d.ts +2 -2
- package/dist/commands/workspaces.js +57 -57
- package/dist/config.js +23 -20
- package/dist/devAuth.d.ts +3 -3
- package/dist/devAuth.js +20 -17
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +34 -34
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +7 -7
- package/dist/externalAssetPackValidation.d.ts +1 -1
- package/dist/externalAssetPackValidation.js +9 -9
- package/dist/http.d.ts +1 -1
- package/dist/http.js +9 -9
- package/dist/index.js +657 -664
- package/dist/listingCaptureLease.js +23 -23
- package/dist/listingPreflight.d.ts +2 -2
- package/dist/listingPreflight.js +33 -33
- package/dist/messages.js +6 -14
- package/dist/output.js +9 -9
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +35 -40
- package/dist/proxyFetch.js +30 -27
- package/dist/recorderRelease.js +8 -8
- package/dist/refs.d.ts +5 -5
- package/dist/refs.js +40 -37
- package/dist/sessionCookie.js +15 -21
- package/dist/shellProbe.js +5 -5
- package/dist/taskSelection.d.ts +3 -3
- package/dist/taskSelection.js +67 -62
- package/dist/taskUtils.d.ts +1 -1
- package/dist/taskUtils.js +4 -4
- package/dist/tweakStaleness.d.ts +3 -3
- package/dist/tweakStaleness.js +8 -8
- package/dist/uploadLog.d.ts +3 -3
- package/dist/uploadLog.js +51 -51
- package/dist/versionCompare.js +3 -3
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +10 -17
- package/dist/workspaceAuth.d.ts +1 -1
- package/dist/workspaceAuth.js +28 -22
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +35 -35
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +34 -33
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +4 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +12 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +19 -18
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +7 -2
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +47 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +32 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +16 -18
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +3 -3
- package/node_modules/@playdrop/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 +44 -45
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +1 -1
- package/node_modules/@playdrop/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 +40 -44
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +30 -34
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +23 -20
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +21 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +19 -19
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +12 -16
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +38 -41
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +54 -56
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +39 -45
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/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 +39 -43
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +35 -35
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +18 -18
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +50 -48
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +22 -26
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +23 -28
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +93 -95
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +2 -7
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +6 -6
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +9 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -17
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +9 -9
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +1 -1
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.js +10 -10
- package/node_modules/@playdrop/config/dist/src/constants.js +10 -10
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +27 -28
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +42 -41
- package/node_modules/@playdrop/config/dist/src/game-arena.js +12 -12
- package/node_modules/@playdrop/config/dist/src/index.d.ts +9 -9
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +24 -25
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +41 -39
- package/node_modules/@playdrop/config/dist/src/runtime-client-meta.js +1 -3
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +23 -25
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +5 -5
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +44 -46
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +6 -8
- package/node_modules/@playdrop/config/dist/src/types.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +12 -12
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +59 -59
- package/node_modules/@playdrop/config/dist/test/fastify.test.js +4 -4
- package/node_modules/@playdrop/config/dist/test/game-arena.test.js +8 -8
- package/node_modules/@playdrop/config/dist/test/logging.test.js +6 -6
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +57 -57
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-playtest.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +314 -250
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +40 -59
- package/node_modules/@playdrop/types/dist/app-capability-filters.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts +6 -6
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-review.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.js +1 -6
- package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +5 -5
- package/node_modules/@playdrop/types/dist/asset-spec.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/attachment-policy.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/creator-public-image.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +25 -25
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/instrument-evidence.js +2 -11
- package/node_modules/@playdrop/types/dist/locale.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/locale.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/locale.js +2 -17
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/player-meta.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtrade.d.ts +8 -5
- package/node_modules/@playdrop/types/dist/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/tweaks.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.js +12 -2
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -14
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +4 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +2 -2
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +20 -18
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +11 -14
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,8 +8,8 @@ export type GeometryId = string;
|
|
|
8
8
|
export type AnimationId = string;
|
|
9
9
|
export type Vec2 = [number, number];
|
|
10
10
|
export type Vec3 = [number, number, number];
|
|
11
|
-
export type PrimitiveKind =
|
|
12
|
-
export type ConnectMode =
|
|
11
|
+
export type PrimitiveKind = "plain_box" | "textured_box" | "voxel_box" | "combo_box";
|
|
12
|
+
export type ConnectMode = "none" | "child" | "parent" | "both";
|
|
13
13
|
export interface Node {
|
|
14
14
|
id: NodeId;
|
|
15
15
|
position: Vec3;
|
|
@@ -71,11 +71,11 @@ interface BoxPrimitiveBase {
|
|
|
71
71
|
size: Vec3;
|
|
72
72
|
}
|
|
73
73
|
export interface PlainBox extends BoxPrimitiveBase {
|
|
74
|
-
kind:
|
|
74
|
+
kind: "plain_box";
|
|
75
75
|
material: MaterialId;
|
|
76
76
|
}
|
|
77
77
|
export interface TexturedBox extends BoxPrimitiveBase {
|
|
78
|
-
kind:
|
|
78
|
+
kind: "textured_box";
|
|
79
79
|
top?: TextureId | undefined;
|
|
80
80
|
bottom?: TextureId | undefined;
|
|
81
81
|
north?: TextureId | undefined;
|
|
@@ -97,7 +97,7 @@ export interface TexturedBox extends BoxPrimitiveBase {
|
|
|
97
97
|
* - `plain`: opaque surface; faces are single sided and rendered without alpha cutouts.
|
|
98
98
|
* - `cutout`: semi-transparent/cutout surface; faces render double sided with alpha testing.
|
|
99
99
|
*/
|
|
100
|
-
renderMode?:
|
|
100
|
+
renderMode?: "plain" | "cutout" | undefined;
|
|
101
101
|
/**
|
|
102
102
|
* Optional overlay textures rendered as a thin outer shell using cutout blending. Overlay fields
|
|
103
103
|
* follow the same fallback rules as their base counterparts (face > sides > all).
|
|
@@ -112,7 +112,7 @@ export interface TexturedBox extends BoxPrimitiveBase {
|
|
|
112
112
|
allOverlay?: TextureId | undefined;
|
|
113
113
|
}
|
|
114
114
|
export interface VoxelBox extends BoxPrimitiveBase {
|
|
115
|
-
kind:
|
|
115
|
+
kind: "voxel_box";
|
|
116
116
|
/**
|
|
117
117
|
* Flattened material indices for the voxel volume. Length must equal size[0] * size[1] * size[2].
|
|
118
118
|
* Index ordering is X-major, then Y, then Z (x + y * sizeX + z * sizeX * sizeY). A value of 0
|
|
@@ -126,7 +126,7 @@ export interface VoxelBox extends BoxPrimitiveBase {
|
|
|
126
126
|
palette: MaterialId[];
|
|
127
127
|
}
|
|
128
128
|
export interface ComboBox extends BoxPrimitiveBase {
|
|
129
|
-
kind:
|
|
129
|
+
kind: "combo_box";
|
|
130
130
|
slots: Array<{
|
|
131
131
|
id: string;
|
|
132
132
|
primitive: PrimitiveId;
|
|
@@ -134,7 +134,7 @@ export interface ComboBox extends BoxPrimitiveBase {
|
|
|
134
134
|
}>;
|
|
135
135
|
}
|
|
136
136
|
export type Primitive = PlainBox | TexturedBox | VoxelBox | ComboBox;
|
|
137
|
-
export type AnimationChannelProperty =
|
|
137
|
+
export type AnimationChannelProperty = "position" | "rotation" | "scale";
|
|
138
138
|
export interface AnimationKeyframe {
|
|
139
139
|
time: number;
|
|
140
140
|
value: Vec3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Animation, BoxelDefinition, Material, Pattern, Primitive, Texture, TexturedBox, Vec2, Vec3 } from
|
|
1
|
+
import type { Animation, BoxelDefinition, Material, Pattern, Primitive, Texture, TexturedBox, Vec2, Vec3 } from "./types";
|
|
2
2
|
export interface BoxelValidationIssue {
|
|
3
3
|
path: string;
|
|
4
4
|
message: string;
|
|
@@ -16,26 +16,26 @@ exports.collectBoxelValidationIssues = collectBoxelValidationIssues;
|
|
|
16
16
|
const textures_1 = require("./textures");
|
|
17
17
|
const VEC2_LENGTH = 2;
|
|
18
18
|
const VEC3_LENGTH = 3;
|
|
19
|
-
const CONNECT_MODES = [
|
|
20
|
-
const isConnectMode = (value) => typeof value ===
|
|
19
|
+
const CONNECT_MODES = ["none", "child", "parent", "both"];
|
|
20
|
+
const isConnectMode = (value) => typeof value === "string" && CONNECT_MODES.includes(value);
|
|
21
21
|
class BoxelValidationError extends Error {
|
|
22
22
|
constructor(message, issues) {
|
|
23
23
|
super(message);
|
|
24
24
|
this.issues = issues;
|
|
25
|
-
this.name =
|
|
25
|
+
this.name = "BoxelValidationError";
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.BoxelValidationError = BoxelValidationError;
|
|
29
29
|
const sanitizeMessage = (error) => {
|
|
30
30
|
if (!error)
|
|
31
|
-
return
|
|
32
|
-
if (typeof error ===
|
|
31
|
+
return "Unknown validation error";
|
|
32
|
+
if (typeof error === "string")
|
|
33
33
|
return error;
|
|
34
34
|
if (error instanceof Error)
|
|
35
35
|
return error.message;
|
|
36
|
-
if (typeof error ===
|
|
36
|
+
if (typeof error === "object" && "message" in error) {
|
|
37
37
|
const candidate = error.message;
|
|
38
|
-
return typeof candidate ===
|
|
38
|
+
return typeof candidate === "string" ? candidate : "Unknown validation error";
|
|
39
39
|
}
|
|
40
40
|
return String(error);
|
|
41
41
|
};
|
|
@@ -43,7 +43,9 @@ const pushIssue = (issues, path, error) => {
|
|
|
43
43
|
issues.push({ path, message: sanitizeMessage(error) });
|
|
44
44
|
};
|
|
45
45
|
function isTupleOfNumbers(value, expectedLength) {
|
|
46
|
-
return Array.isArray(value) &&
|
|
46
|
+
return (Array.isArray(value) &&
|
|
47
|
+
value.length === expectedLength &&
|
|
48
|
+
value.every((item) => typeof item === "number" && Number.isFinite(item)));
|
|
47
49
|
}
|
|
48
50
|
function assertVec3(value, context) {
|
|
49
51
|
if (!isTupleOfNumbers(value, VEC3_LENGTH)) {
|
|
@@ -56,16 +58,16 @@ function assertVec2(value, context) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
function assertPattern(value, index) {
|
|
59
|
-
if (!value || typeof value !==
|
|
61
|
+
if (!value || typeof value !== "object") {
|
|
60
62
|
throw new Error(`Pattern at index ${index} must be an object`);
|
|
61
63
|
}
|
|
62
64
|
const pattern = value;
|
|
63
|
-
if (typeof pattern.id !==
|
|
65
|
+
if (typeof pattern.id !== "string") {
|
|
64
66
|
throw new Error(`Pattern at index ${index} is missing id`);
|
|
65
67
|
}
|
|
66
68
|
assertVec2(pattern.size, `pattern ${pattern.id} size`);
|
|
67
69
|
const patternSize = pattern.size;
|
|
68
|
-
if (!Array.isArray(pattern.data) || !pattern.data.every(cell => Number.isInteger(cell) && cell >= 0)) {
|
|
70
|
+
if (!Array.isArray(pattern.data) || !pattern.data.every((cell) => Number.isInteger(cell) && cell >= 0)) {
|
|
69
71
|
throw new Error(`Pattern ${pattern.id} data must be an array of non-negative integers`);
|
|
70
72
|
}
|
|
71
73
|
const expectedLength = patternSize[0] * patternSize[1];
|
|
@@ -74,74 +76,74 @@ function assertPattern(value, index) {
|
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
function assertMaterial(value, index) {
|
|
77
|
-
if (!value || typeof value !==
|
|
79
|
+
if (!value || typeof value !== "object") {
|
|
78
80
|
throw new Error(`Material at index ${index} must be an object`);
|
|
79
81
|
}
|
|
80
82
|
const material = value;
|
|
81
|
-
if (typeof material.id !==
|
|
83
|
+
if (typeof material.id !== "string") {
|
|
82
84
|
throw new Error(`Material at index ${index} is missing id`);
|
|
83
85
|
}
|
|
84
86
|
assertVec3(material.baseColor, `material ${material.id} baseColor`);
|
|
85
87
|
if (material.emissiveColor !== undefined) {
|
|
86
88
|
assertVec3(material.emissiveColor, `material ${material.id} emissiveColor`);
|
|
87
89
|
}
|
|
88
|
-
if (material.opacity !== undefined && (typeof material.opacity !==
|
|
90
|
+
if (material.opacity !== undefined && (typeof material.opacity !== "number" || !Number.isFinite(material.opacity))) {
|
|
89
91
|
throw new Error(`Material ${material.id} opacity must be a finite number`);
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
function assertTexture(value, index) {
|
|
93
|
-
if (!value || typeof value !==
|
|
95
|
+
if (!value || typeof value !== "object") {
|
|
94
96
|
throw new Error(`Texture at index ${index} must be an object`);
|
|
95
97
|
}
|
|
96
98
|
const texture = value;
|
|
97
|
-
if (typeof texture.id !==
|
|
99
|
+
if (typeof texture.id !== "string") {
|
|
98
100
|
throw new Error(`Texture at index ${index} is missing id`);
|
|
99
101
|
}
|
|
100
|
-
if (typeof texture.pattern !==
|
|
102
|
+
if (typeof texture.pattern !== "string") {
|
|
101
103
|
throw new Error(`Texture ${texture.id} pattern must be a string`);
|
|
102
104
|
}
|
|
103
|
-
if (!Array.isArray(texture.materials) || !texture.materials.every(id => typeof id ===
|
|
105
|
+
if (!Array.isArray(texture.materials) || !texture.materials.every((id) => typeof id === "string")) {
|
|
104
106
|
throw new Error(`Texture ${texture.id} materials must be an array of strings`);
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
function assertPlainBox(primitive, context) {
|
|
108
|
-
if (primitive.kind !==
|
|
110
|
+
if (primitive.kind !== "plain_box") {
|
|
109
111
|
throw new Error(`${context} expected kind plain_box`);
|
|
110
112
|
}
|
|
111
|
-
if (typeof primitive.material !==
|
|
113
|
+
if (typeof primitive.material !== "string") {
|
|
112
114
|
throw new Error(`${context} material must be a string`);
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
function assertTexturedBox(primitive, context) {
|
|
116
|
-
if (primitive.kind !==
|
|
118
|
+
if (primitive.kind !== "textured_box") {
|
|
117
119
|
throw new Error(`${context} expected kind textured_box`);
|
|
118
120
|
}
|
|
119
121
|
const candidate = primitive;
|
|
120
|
-
const faces = [
|
|
121
|
-
faces.forEach(face => {
|
|
122
|
+
const faces = ["top", "bottom", "north", "south", "east", "west", "sides", "all"];
|
|
123
|
+
faces.forEach((face) => {
|
|
122
124
|
const value = candidate[face];
|
|
123
|
-
if (value !== undefined && typeof value !==
|
|
125
|
+
if (value !== undefined && typeof value !== "string") {
|
|
124
126
|
throw new Error(`${context} face ${face} must be a string id`);
|
|
125
127
|
}
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
130
|
function assertVoxelBox(primitive, context) {
|
|
129
|
-
if (primitive.kind !==
|
|
131
|
+
if (primitive.kind !== "voxel_box") {
|
|
130
132
|
throw new Error(`${context} expected kind voxel_box`);
|
|
131
133
|
}
|
|
132
134
|
const candidate = primitive;
|
|
133
|
-
if (!Array.isArray(candidate.voxels) || !candidate.voxels.every(cell => typeof cell ===
|
|
135
|
+
if (!Array.isArray(candidate.voxels) || !candidate.voxels.every((cell) => typeof cell === "number")) {
|
|
134
136
|
throw new Error(`${context} voxels must be an array of numbers`);
|
|
135
137
|
}
|
|
136
138
|
if (candidate.palette !== undefined) {
|
|
137
|
-
if (!Array.isArray(candidate.palette) || !candidate.palette.every(entry => typeof entry ===
|
|
139
|
+
if (!Array.isArray(candidate.palette) || !candidate.palette.every((entry) => typeof entry === "string")) {
|
|
138
140
|
throw new Error(`${context} palette must be an array of material ids`);
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
const size = primitive.size;
|
|
142
144
|
assertVec3(size, `${context} size`);
|
|
143
|
-
const dims = size.map(axis => Math.round(axis));
|
|
144
|
-
if (dims.some(value => value <= 0 || !Number.isFinite(value))) {
|
|
145
|
+
const dims = size.map((axis) => Math.round(axis));
|
|
146
|
+
if (dims.some((value) => value <= 0 || !Number.isFinite(value))) {
|
|
145
147
|
throw new Error(`${context} size must contain positive finite numbers`);
|
|
146
148
|
}
|
|
147
149
|
const expected = dims[0] * dims[1] * dims[2];
|
|
@@ -150,7 +152,7 @@ function assertVoxelBox(primitive, context) {
|
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
154
|
function assertComboBox(primitive, context) {
|
|
153
|
-
if (primitive.kind !==
|
|
155
|
+
if (primitive.kind !== "combo_box") {
|
|
154
156
|
throw new Error(`${context} expected kind combo_box`);
|
|
155
157
|
}
|
|
156
158
|
const candidate = primitive;
|
|
@@ -158,43 +160,43 @@ function assertComboBox(primitive, context) {
|
|
|
158
160
|
throw new Error(`${context} slots must be an array`);
|
|
159
161
|
}
|
|
160
162
|
candidate.slots.forEach((slot, idx) => {
|
|
161
|
-
if (!slot || typeof slot !==
|
|
163
|
+
if (!slot || typeof slot !== "object") {
|
|
162
164
|
throw new Error(`${context} slot ${idx} must be an object`);
|
|
163
165
|
}
|
|
164
166
|
const slotId = slot.id;
|
|
165
|
-
if (slotId !== undefined && typeof slotId !==
|
|
167
|
+
if (slotId !== undefined && typeof slotId !== "string") {
|
|
166
168
|
throw new Error(`${context} slot ${idx} id must be a string when provided`);
|
|
167
169
|
}
|
|
168
|
-
if (typeof slot.primitive !==
|
|
170
|
+
if (typeof slot.primitive !== "string") {
|
|
169
171
|
throw new Error(`${context} slot ${idx} primitive must be a string`);
|
|
170
172
|
}
|
|
171
173
|
assertVec3(slot.offset, `${context} slot ${idx} offset`);
|
|
172
174
|
});
|
|
173
175
|
}
|
|
174
176
|
function assertPrimitive(value, index) {
|
|
175
|
-
if (!value || typeof value !==
|
|
177
|
+
if (!value || typeof value !== "object") {
|
|
176
178
|
throw new Error(`Primitive at index ${index} must be an object`);
|
|
177
179
|
}
|
|
178
180
|
const primitive = value;
|
|
179
|
-
if (typeof primitive.id !==
|
|
181
|
+
if (typeof primitive.id !== "string") {
|
|
180
182
|
throw new Error(`Primitive at index ${index} is missing id`);
|
|
181
183
|
}
|
|
182
184
|
const primitiveId = primitive.id;
|
|
183
|
-
if (typeof primitive.kind !==
|
|
185
|
+
if (typeof primitive.kind !== "string") {
|
|
184
186
|
throw new Error(`Primitive ${primitiveId} kind must be a string discriminator`);
|
|
185
187
|
}
|
|
186
188
|
assertVec3(primitive.size, `primitive ${primitiveId} size`);
|
|
187
189
|
switch (primitive.kind) {
|
|
188
|
-
case
|
|
190
|
+
case "plain_box":
|
|
189
191
|
assertPlainBox(primitive, `primitive ${primitiveId}`);
|
|
190
192
|
break;
|
|
191
|
-
case
|
|
193
|
+
case "textured_box":
|
|
192
194
|
assertTexturedBox(primitive, `primitive ${primitiveId}`);
|
|
193
195
|
break;
|
|
194
|
-
case
|
|
196
|
+
case "voxel_box":
|
|
195
197
|
assertVoxelBox(primitive, `primitive ${primitiveId}`);
|
|
196
198
|
break;
|
|
197
|
-
case
|
|
199
|
+
case "combo_box":
|
|
198
200
|
assertComboBox(primitive, `primitive ${primitiveId}`);
|
|
199
201
|
break;
|
|
200
202
|
default: {
|
|
@@ -203,41 +205,41 @@ function assertPrimitive(value, index) {
|
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
|
-
const animationProperties = [
|
|
208
|
+
const animationProperties = ["position", "rotation", "scale"];
|
|
207
209
|
function assertAnimationChannel(value, context) {
|
|
208
|
-
if (!value || typeof value !==
|
|
210
|
+
if (!value || typeof value !== "object") {
|
|
209
211
|
throw new Error(`${context} channel must be an object`);
|
|
210
212
|
}
|
|
211
213
|
const channel = value;
|
|
212
|
-
if (typeof channel.node !==
|
|
214
|
+
if (typeof channel.node !== "string") {
|
|
213
215
|
throw new Error(`${context} channel node must be a string`);
|
|
214
216
|
}
|
|
215
217
|
if (!animationProperties.includes(channel.property)) {
|
|
216
|
-
throw new Error(`${context} channel property must be one of ${animationProperties.join(
|
|
218
|
+
throw new Error(`${context} channel property must be one of ${animationProperties.join(", ")}`);
|
|
217
219
|
}
|
|
218
220
|
if (!Array.isArray(channel.keyframes)) {
|
|
219
221
|
throw new Error(`${context} keyframes must be an array`);
|
|
220
222
|
}
|
|
221
223
|
channel.keyframes.forEach((keyframe, idx) => {
|
|
222
|
-
if (!keyframe || typeof keyframe !==
|
|
224
|
+
if (!keyframe || typeof keyframe !== "object") {
|
|
223
225
|
throw new Error(`${context} keyframe ${idx} must be an object`);
|
|
224
226
|
}
|
|
225
227
|
const reference = keyframe;
|
|
226
|
-
if (typeof reference.time !==
|
|
228
|
+
if (typeof reference.time !== "number" || !Number.isFinite(reference.time) || reference.time < 0) {
|
|
227
229
|
throw new Error(`${context} keyframe ${idx} time must be a non-negative number`);
|
|
228
230
|
}
|
|
229
231
|
assertVec3(reference.value, `${context} keyframe ${idx} value`);
|
|
230
232
|
});
|
|
231
233
|
}
|
|
232
234
|
function assertAnimation(value, index) {
|
|
233
|
-
if (!value || typeof value !==
|
|
235
|
+
if (!value || typeof value !== "object") {
|
|
234
236
|
throw new Error(`Animation at index ${index} must be an object`);
|
|
235
237
|
}
|
|
236
238
|
const animation = value;
|
|
237
|
-
if (typeof animation.id !==
|
|
239
|
+
if (typeof animation.id !== "string" || !animation.id) {
|
|
238
240
|
throw new Error(`Animation at index ${index} is missing id`);
|
|
239
241
|
}
|
|
240
|
-
if (typeof animation.duration !==
|
|
242
|
+
if (typeof animation.duration !== "number" || !Number.isFinite(animation.duration) || animation.duration < 0) {
|
|
241
243
|
throw new Error(`Animation ${animation.id} duration must be a non-negative finite number`);
|
|
242
244
|
}
|
|
243
245
|
if (!Array.isArray(animation.channels)) {
|
|
@@ -246,12 +248,12 @@ function assertAnimation(value, index) {
|
|
|
246
248
|
animation.channels.forEach((channel, channelIndex) => assertAnimationChannel(channel, `animation ${animation.id} channel ${channelIndex}`));
|
|
247
249
|
}
|
|
248
250
|
const FACE_DIMENSIONS = {
|
|
249
|
-
top: size => [size[0], size[2]],
|
|
250
|
-
bottom: size => [size[0], size[2]],
|
|
251
|
-
north: size => [size[0], size[1]],
|
|
252
|
-
south: size => [size[0], size[1]],
|
|
253
|
-
east: size => [size[2], size[1]],
|
|
254
|
-
west: size => [size[2], size[1]],
|
|
251
|
+
top: (size) => [size[0], size[2]],
|
|
252
|
+
bottom: (size) => [size[0], size[2]],
|
|
253
|
+
north: (size) => [size[0], size[1]],
|
|
254
|
+
south: (size) => [size[0], size[1]],
|
|
255
|
+
east: (size) => [size[2], size[1]],
|
|
256
|
+
west: (size) => [size[2], size[1]],
|
|
255
257
|
sides: () => [0, 0],
|
|
256
258
|
all: () => [0, 0],
|
|
257
259
|
};
|
|
@@ -269,15 +271,11 @@ function assertTexturedBoxFaceSizes(box, textureLookup, patternLookup, materialL
|
|
|
269
271
|
throw new Error(`primitive ${box.id} size component ${idx} must be finite to validate textures`);
|
|
270
272
|
}
|
|
271
273
|
});
|
|
272
|
-
const normalizedSize = [
|
|
273
|
-
|
|
274
|
-
normalizeDimension(sizeY),
|
|
275
|
-
normalizeDimension(sizeZ),
|
|
276
|
-
];
|
|
277
|
-
if (normalizedSize.some(dimension => dimension === 0)) {
|
|
274
|
+
const normalizedSize = [normalizeDimension(sizeX), normalizeDimension(sizeY), normalizeDimension(sizeZ)];
|
|
275
|
+
if (normalizedSize.some((dimension) => dimension === 0)) {
|
|
278
276
|
throw new Error(`primitive ${box.id} must not contain zero-sized dimensions for textured faces`);
|
|
279
277
|
}
|
|
280
|
-
[
|
|
278
|
+
["top", "bottom", "north", "south", "east", "west"].forEach((face) => {
|
|
281
279
|
const textureId = (0, textures_1.resolveFaceTextureId)(box, face);
|
|
282
280
|
if (!textureId) {
|
|
283
281
|
return;
|
|
@@ -306,7 +304,7 @@ function assertTexturedBoxFaceSizes(box, textureLookup, patternLookup, materialL
|
|
|
306
304
|
throw new Error(`primitive ${box.id} face ${face} expects texture size ${expectedWidth}x${expectedHeight} but texture ${textureId} pattern ${pattern.id} is ${patternWidth}x${patternHeight}`);
|
|
307
305
|
}
|
|
308
306
|
});
|
|
309
|
-
[
|
|
307
|
+
["top", "bottom", "north", "south", "east", "west"].forEach((face) => {
|
|
310
308
|
const textureId = (0, textures_1.resolveOverlayFaceTextureId)(box, face);
|
|
311
309
|
if (!textureId) {
|
|
312
310
|
return;
|
|
@@ -335,17 +333,17 @@ function assertTexturedBoxFaceSizes(box, textureLookup, patternLookup, materialL
|
|
|
335
333
|
throw new Error(`primitive ${box.id} overlay face ${face} expects texture size ${expectedWidth}x${expectedHeight} but texture ${textureId} pattern ${pattern.id} is ${patternWidth}x${patternHeight}`);
|
|
336
334
|
}
|
|
337
335
|
});
|
|
338
|
-
const mode = box.renderMode ??
|
|
339
|
-
if (mode !==
|
|
336
|
+
const mode = box.renderMode ?? "plain";
|
|
337
|
+
if (mode !== "plain" && mode !== "cutout") {
|
|
340
338
|
throw new Error(`primitive ${box.id} has invalid renderMode ${String(mode)}`);
|
|
341
339
|
}
|
|
342
340
|
const faceTextureIds = (0, textures_1.collectFaceTextureIds)(box);
|
|
343
|
-
const usesTransparency = faceTextureIds.some(textureId => {
|
|
341
|
+
const usesTransparency = faceTextureIds.some((textureId) => {
|
|
344
342
|
const texture = textureLookup.get(textureId);
|
|
345
343
|
if (!texture) {
|
|
346
344
|
return false;
|
|
347
345
|
}
|
|
348
|
-
return texture.materials.some(materialId => {
|
|
346
|
+
return texture.materials.some((materialId) => {
|
|
349
347
|
const material = materialLookup.get(materialId);
|
|
350
348
|
if (!material) {
|
|
351
349
|
return false;
|
|
@@ -356,16 +354,16 @@ function assertTexturedBoxFaceSizes(box, textureLookup, patternLookup, materialL
|
|
|
356
354
|
return Number(material.opacity) < 1;
|
|
357
355
|
});
|
|
358
356
|
});
|
|
359
|
-
if (mode ===
|
|
357
|
+
if (mode === "plain" && usesTransparency) {
|
|
360
358
|
throw new Error(`primitive ${box.id} renderMode plain but references textures with transparent materials`);
|
|
361
359
|
}
|
|
362
360
|
}
|
|
363
361
|
function assertNode(value, path, primitiveLookup) {
|
|
364
|
-
if (!value || typeof value !==
|
|
362
|
+
if (!value || typeof value !== "object") {
|
|
365
363
|
throw new Error(`Node ${path} must be an object`);
|
|
366
364
|
}
|
|
367
365
|
const node = value;
|
|
368
|
-
if (typeof node.id !==
|
|
366
|
+
if (typeof node.id !== "string") {
|
|
369
367
|
throw new Error(`Node ${path} is missing id`);
|
|
370
368
|
}
|
|
371
369
|
assertVec3(node.position, `node ${node.id} position`);
|
|
@@ -384,14 +382,14 @@ function assertNode(value, path, primitiveLookup) {
|
|
|
384
382
|
if (node.connect !== undefined) {
|
|
385
383
|
const connectValue = node.connect;
|
|
386
384
|
if (connectValue === true) {
|
|
387
|
-
node.connect =
|
|
385
|
+
node.connect = "child";
|
|
388
386
|
}
|
|
389
387
|
else if (connectValue === false) {
|
|
390
388
|
delete node.connect;
|
|
391
389
|
}
|
|
392
|
-
else if (typeof connectValue ===
|
|
390
|
+
else if (typeof connectValue === "string") {
|
|
393
391
|
if (!isConnectMode(connectValue)) {
|
|
394
|
-
throw new Error(`Node ${node.id} connect must be one of ${CONNECT_MODES.join(
|
|
392
|
+
throw new Error(`Node ${node.id} connect must be one of ${CONNECT_MODES.join(", ")}`);
|
|
395
393
|
}
|
|
396
394
|
node.connect = connectValue;
|
|
397
395
|
}
|
|
@@ -400,7 +398,7 @@ function assertNode(value, path, primitiveLookup) {
|
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
400
|
if (node.mesh !== undefined) {
|
|
403
|
-
if (typeof node.mesh !==
|
|
401
|
+
if (typeof node.mesh !== "string") {
|
|
404
402
|
throw new Error(`Node ${node.id} mesh must be a primitive id`);
|
|
405
403
|
}
|
|
406
404
|
if (!primitiveLookup.has(node.mesh)) {
|
|
@@ -414,7 +412,7 @@ function assertNode(value, path, primitiveLookup) {
|
|
|
414
412
|
}
|
|
415
413
|
function collectNodeIds(node, set) {
|
|
416
414
|
set.add(node.id);
|
|
417
|
-
node.children.forEach(child => collectNodeIds(child, set));
|
|
415
|
+
node.children.forEach((child) => collectNodeIds(child, set));
|
|
418
416
|
}
|
|
419
417
|
function assertAnimationChannels(animation, nodeIds) {
|
|
420
418
|
const seenChannels = new Set();
|
|
@@ -442,22 +440,22 @@ function assertAnimationChannels(animation, nodeIds) {
|
|
|
442
440
|
}
|
|
443
441
|
function validateBoxel(candidate) {
|
|
444
442
|
const issues = [];
|
|
445
|
-
if (!candidate || typeof candidate !==
|
|
446
|
-
pushIssue(issues,
|
|
443
|
+
if (!candidate || typeof candidate !== "object") {
|
|
444
|
+
pushIssue(issues, "boxel", "BoxelDefinition must be an object");
|
|
447
445
|
return { boxel: null, issues };
|
|
448
446
|
}
|
|
449
447
|
const raw = candidate;
|
|
450
448
|
let id = null;
|
|
451
|
-
if (typeof raw.id ===
|
|
449
|
+
if (typeof raw.id === "string" && raw.id.trim().length > 0) {
|
|
452
450
|
id = raw.id;
|
|
453
451
|
}
|
|
454
452
|
else {
|
|
455
|
-
pushIssue(issues,
|
|
453
|
+
pushIssue(issues, "boxel.id", "BoxelDefinition id must be a non-empty string");
|
|
456
454
|
}
|
|
457
455
|
const primitives = [];
|
|
458
456
|
const primitiveLookup = new Map();
|
|
459
457
|
if (!Array.isArray(raw.primitives)) {
|
|
460
|
-
pushIssue(issues,
|
|
458
|
+
pushIssue(issues, "boxel.primitives", "BoxelDefinition primitives must be an array");
|
|
461
459
|
}
|
|
462
460
|
else {
|
|
463
461
|
raw.primitives.forEach((primitive, index) => {
|
|
@@ -473,32 +471,32 @@ function validateBoxel(candidate) {
|
|
|
473
471
|
}
|
|
474
472
|
let geometry = null;
|
|
475
473
|
const geometryNodeIds = new Set();
|
|
476
|
-
if (!raw.geometry || typeof raw.geometry !==
|
|
477
|
-
pushIssue(issues,
|
|
474
|
+
if (!raw.geometry || typeof raw.geometry !== "object") {
|
|
475
|
+
pushIssue(issues, "boxel.geometry", "BoxelDefinition geometry is missing or invalid");
|
|
478
476
|
}
|
|
479
477
|
else {
|
|
480
478
|
const geo = raw.geometry;
|
|
481
|
-
if (typeof geo.id !==
|
|
482
|
-
pushIssue(issues,
|
|
479
|
+
if (typeof geo.id !== "string") {
|
|
480
|
+
pushIssue(issues, "boxel.geometry.id", "Geometry id must be a string");
|
|
483
481
|
}
|
|
484
482
|
else if (!geo.root) {
|
|
485
|
-
pushIssue(issues,
|
|
483
|
+
pushIssue(issues, "boxel.geometry.root", "Geometry root is missing");
|
|
486
484
|
}
|
|
487
485
|
else {
|
|
488
486
|
try {
|
|
489
|
-
assertNode(geo.root,
|
|
487
|
+
assertNode(geo.root, "root", primitiveLookup);
|
|
490
488
|
geometry = geo;
|
|
491
489
|
collectNodeIds(geo.root, geometryNodeIds);
|
|
492
490
|
}
|
|
493
491
|
catch (error) {
|
|
494
|
-
pushIssue(issues,
|
|
492
|
+
pushIssue(issues, "boxel.geometry.root", error);
|
|
495
493
|
}
|
|
496
494
|
}
|
|
497
495
|
}
|
|
498
496
|
const patterns = [];
|
|
499
497
|
const patternLookup = new Map();
|
|
500
498
|
if (!Array.isArray(raw.patterns)) {
|
|
501
|
-
pushIssue(issues,
|
|
499
|
+
pushIssue(issues, "boxel.patterns", "BoxelDefinition patterns must be an array");
|
|
502
500
|
}
|
|
503
501
|
else {
|
|
504
502
|
raw.patterns.forEach((pattern, index) => {
|
|
@@ -515,7 +513,7 @@ function validateBoxel(candidate) {
|
|
|
515
513
|
const materials = [];
|
|
516
514
|
const materialLookup = new Map();
|
|
517
515
|
if (!Array.isArray(raw.materials)) {
|
|
518
|
-
pushIssue(issues,
|
|
516
|
+
pushIssue(issues, "boxel.materials", "BoxelDefinition materials must be an array");
|
|
519
517
|
}
|
|
520
518
|
else {
|
|
521
519
|
raw.materials.forEach((material, index) => {
|
|
@@ -532,7 +530,7 @@ function validateBoxel(candidate) {
|
|
|
532
530
|
const textures = [];
|
|
533
531
|
const textureLookup = new Map();
|
|
534
532
|
if (!Array.isArray(raw.textures)) {
|
|
535
|
-
pushIssue(issues,
|
|
533
|
+
pushIssue(issues, "boxel.textures", "BoxelDefinition textures must be an array");
|
|
536
534
|
}
|
|
537
535
|
else {
|
|
538
536
|
raw.textures.forEach((texture, index) => {
|
|
@@ -543,7 +541,7 @@ function validateBoxel(candidate) {
|
|
|
543
541
|
if (!pattern) {
|
|
544
542
|
throw new Error(`Texture ${typed.id} references unknown pattern ${typed.pattern}`);
|
|
545
543
|
}
|
|
546
|
-
typed.materials.forEach(materialId => {
|
|
544
|
+
typed.materials.forEach((materialId) => {
|
|
547
545
|
if (!materialLookup.has(materialId)) {
|
|
548
546
|
throw new Error(`Texture ${typed.id} references unknown material ${materialId}`);
|
|
549
547
|
}
|
|
@@ -565,8 +563,8 @@ function validateBoxel(candidate) {
|
|
|
565
563
|
}
|
|
566
564
|
if (textures.length > 0) {
|
|
567
565
|
primitives
|
|
568
|
-
.filter(primitive => primitive.kind ===
|
|
569
|
-
.forEach(primitive => {
|
|
566
|
+
.filter((primitive) => primitive.kind === "textured_box")
|
|
567
|
+
.forEach((primitive) => {
|
|
570
568
|
try {
|
|
571
569
|
assertTexturedBoxFaceSizes(primitive, textureLookup, patternLookup, materialLookup);
|
|
572
570
|
}
|
|
@@ -578,7 +576,7 @@ function validateBoxel(candidate) {
|
|
|
578
576
|
const animations = [];
|
|
579
577
|
if (!Array.isArray(raw.animations)) {
|
|
580
578
|
if (raw.animations !== undefined) {
|
|
581
|
-
pushIssue(issues,
|
|
579
|
+
pushIssue(issues, "boxel.animations", "BoxelDefinition animations must be an array");
|
|
582
580
|
}
|
|
583
581
|
}
|
|
584
582
|
else {
|
|
@@ -614,7 +612,7 @@ function assertBoxel(candidate) {
|
|
|
614
612
|
if (boxel) {
|
|
615
613
|
return boxel;
|
|
616
614
|
}
|
|
617
|
-
throw new BoxelValidationError(
|
|
615
|
+
throw new BoxelValidationError("BoxelDefinition validation failed", issues);
|
|
618
616
|
}
|
|
619
617
|
function collectBoxelValidationIssues(candidate) {
|
|
620
618
|
return validateBoxel(candidate).issues;
|