@playdrop/playdrop-cli 0.16.2 → 0.16.11
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
package/dist/apps/upload.js
CHANGED
|
@@ -10,39 +10,39 @@ const node_path_1 = require("node:path");
|
|
|
10
10
|
const http_1 = require("../http");
|
|
11
11
|
const loadCheck_1 = require("./loadCheck");
|
|
12
12
|
const EXTENSION_TO_MIME = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
".png": "image/png",
|
|
14
|
+
".jpg": "image/jpeg",
|
|
15
|
+
".jpeg": "image/jpeg",
|
|
16
|
+
".webp": "image/webp",
|
|
17
|
+
".gif": "image/gif",
|
|
18
|
+
".mp4": "video/mp4",
|
|
19
|
+
".webm": "video/webm",
|
|
20
|
+
".mp3": "audio/mpeg",
|
|
21
|
+
".wav": "audio/wav",
|
|
22
|
+
".ogg": "audio/ogg",
|
|
23
|
+
".json": "application/json",
|
|
24
|
+
".gltf": "model/gltf+json",
|
|
25
|
+
".glb": "model/gltf-binary",
|
|
26
|
+
".vox": "application/octet-stream",
|
|
27
27
|
};
|
|
28
28
|
function isPngSignature(content) {
|
|
29
29
|
if (content.length < 8) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
|
-
return (content[0] === 0x89
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
return (content[0] === 0x89 &&
|
|
33
|
+
content[1] === 0x50 &&
|
|
34
|
+
content[2] === 0x4e &&
|
|
35
|
+
content[3] === 0x47 &&
|
|
36
|
+
content[4] === 0x0d &&
|
|
37
|
+
content[5] === 0x0a &&
|
|
38
|
+
content[6] === 0x1a &&
|
|
39
|
+
content[7] === 0x0a);
|
|
40
40
|
}
|
|
41
41
|
function isMp4Signature(content) {
|
|
42
42
|
if (content.length < 12) {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
|
-
return content.toString(
|
|
45
|
+
return content.toString("ascii", 4, 8) === "ftyp";
|
|
46
46
|
}
|
|
47
47
|
function createUploadValidationError(code, message) {
|
|
48
48
|
const error = new Error(`${code}: ${message}`);
|
|
@@ -73,9 +73,9 @@ async function bufferFromFile(file) {
|
|
|
73
73
|
return Buffer.from(await file.arrayBuffer());
|
|
74
74
|
}
|
|
75
75
|
function computeSha256Hex(buffer) {
|
|
76
|
-
return (0, node_crypto_1.createHash)(
|
|
76
|
+
return (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex");
|
|
77
77
|
}
|
|
78
|
-
function resolveMimeType(filename, fallback =
|
|
78
|
+
function resolveMimeType(filename, fallback = "application/octet-stream") {
|
|
79
79
|
const type = EXTENSION_TO_MIME[(0, node_path_1.extname)(filename).toLowerCase()];
|
|
80
80
|
return type ?? fallback;
|
|
81
81
|
}
|
|
@@ -116,7 +116,11 @@ async function prepareOwnedAssetUpload(task) {
|
|
|
116
116
|
description: task.description,
|
|
117
117
|
category: task.category,
|
|
118
118
|
subcategory: task.subcategory,
|
|
119
|
-
format: task.format ||
|
|
119
|
+
format: task.format ||
|
|
120
|
+
(0, node_path_1.extname)(files[0]?.filename || "")
|
|
121
|
+
.replace(/^\./, "")
|
|
122
|
+
.toUpperCase() ||
|
|
123
|
+
"GLB",
|
|
120
124
|
visibility: task.visibility,
|
|
121
125
|
license: task.license,
|
|
122
126
|
assetSpec: task.assetSpec,
|
|
@@ -138,7 +142,7 @@ function ensurePreparedArtifactSize(file, maxBytes, code, label) {
|
|
|
138
142
|
function accumulateUploadBytes(taskName, currentTotal, nextBytes) {
|
|
139
143
|
const nextTotal = currentTotal + nextBytes;
|
|
140
144
|
if (nextTotal > config_1.MAX_VERSION_TOTAL_BYTES) {
|
|
141
|
-
throw createUploadValidationError(
|
|
145
|
+
throw createUploadValidationError("upload_too_large", `Total upload for "${taskName}" exceeds ${formatLimitBytes(config_1.MAX_VERSION_TOTAL_BYTES)}. Received ${nextTotal} bytes.`);
|
|
142
146
|
}
|
|
143
147
|
return nextTotal;
|
|
144
148
|
}
|
|
@@ -160,55 +164,55 @@ async function prepareAppUploadFiles(task, artifacts) {
|
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
for (const definition of task.achievements ?? []) {
|
|
163
|
-
const prepared = createFileFromPath(definition.iconPath,
|
|
167
|
+
const prepared = createFileFromPath(definition.iconPath, "image/png", config_1.MAX_VERSION_ICON_BYTES, "achievement_icon_too_large", "invalid_achievement_icon_content_type", `Achievement icon "${definition.key}"`, isPngSignature);
|
|
164
168
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
165
169
|
sessionFiles.push(await buildPreparedSessionFile(`achievementIcon:${definition.key}`, prepared.file));
|
|
166
170
|
}
|
|
167
|
-
if (task.hostingMode ===
|
|
171
|
+
if (task.hostingMode === "EXTERNAL") {
|
|
168
172
|
// no hosted files
|
|
169
173
|
}
|
|
170
174
|
else if (artifacts) {
|
|
171
|
-
totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.bundleFile, config_1.MAX_VERSION_BUNDLE_BYTES,
|
|
172
|
-
totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.sourceFile, config_1.MAX_APP_SOURCE_BYTES,
|
|
173
|
-
sessionFiles.push(await buildPreparedSessionFile(
|
|
174
|
-
sessionFiles.push(await buildPreparedSessionFile(
|
|
175
|
+
totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.bundleFile, config_1.MAX_VERSION_BUNDLE_BYTES, "bundle_too_large", "Bundle");
|
|
176
|
+
totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.sourceFile, config_1.MAX_APP_SOURCE_BYTES, "source_too_large", "Source archive");
|
|
177
|
+
sessionFiles.push(await buildPreparedSessionFile("bundle", artifacts.bundleFile));
|
|
178
|
+
sessionFiles.push(await buildPreparedSessionFile("source", artifacts.sourceFile));
|
|
175
179
|
}
|
|
176
180
|
if (listing?.iconPath) {
|
|
177
|
-
const prepared = createFileFromPath(listing.iconPath,
|
|
181
|
+
const prepared = createFileFromPath(listing.iconPath, "image/png", config_1.MAX_VERSION_ICON_BYTES, "icon_too_large", "invalid_icon_content_type", "Icon", isPngSignature);
|
|
178
182
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
179
|
-
sessionFiles.push(await buildPreparedSessionFile(
|
|
183
|
+
sessionFiles.push(await buildPreparedSessionFile("icon", prepared.file));
|
|
180
184
|
}
|
|
181
185
|
if (listing?.heroPortraitPath) {
|
|
182
|
-
const prepared = createFileFromPath(listing.heroPortraitPath,
|
|
186
|
+
const prepared = createFileFromPath(listing.heroPortraitPath, "image/png", config_1.MAX_VERSION_HERO_BYTES, "hero_portrait_too_large", "invalid_hero_portrait_content_type", "Hero portrait", isPngSignature);
|
|
183
187
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
184
|
-
sessionFiles.push(await buildPreparedSessionFile(
|
|
188
|
+
sessionFiles.push(await buildPreparedSessionFile("heroPortrait", prepared.file));
|
|
185
189
|
}
|
|
186
190
|
if (listing?.heroLandscapePath) {
|
|
187
|
-
const prepared = createFileFromPath(listing.heroLandscapePath,
|
|
191
|
+
const prepared = createFileFromPath(listing.heroLandscapePath, "image/png", config_1.MAX_VERSION_HERO_BYTES, "hero_landscape_too_large", "invalid_hero_landscape_content_type", "Hero landscape", isPngSignature);
|
|
188
192
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
189
|
-
sessionFiles.push(await buildPreparedSessionFile(
|
|
193
|
+
sessionFiles.push(await buildPreparedSessionFile("heroLandscape", prepared.file));
|
|
190
194
|
}
|
|
191
195
|
for (let index = 0; index < (listing?.screenshotPortraitPaths ?? []).length; index += 1) {
|
|
192
196
|
const filePath = listing.screenshotPortraitPaths[index];
|
|
193
|
-
const prepared = createFileFromPath(filePath,
|
|
197
|
+
const prepared = createFileFromPath(filePath, "image/png", config_1.MAX_VERSION_SCREENSHOT_BYTES, "screenshot_portrait_too_large", "invalid_screenshot_portrait_content_type", `Portrait screenshot ${index + 1}`, isPngSignature);
|
|
194
198
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
195
199
|
sessionFiles.push(await buildPreparedSessionFile(`screenshotsPortrait:${index}`, prepared.file));
|
|
196
200
|
}
|
|
197
201
|
for (let index = 0; index < (listing?.screenshotLandscapePaths ?? []).length; index += 1) {
|
|
198
202
|
const filePath = listing.screenshotLandscapePaths[index];
|
|
199
|
-
const prepared = createFileFromPath(filePath,
|
|
203
|
+
const prepared = createFileFromPath(filePath, "image/png", config_1.MAX_VERSION_SCREENSHOT_BYTES, "screenshot_landscape_too_large", "invalid_screenshot_landscape_content_type", `Landscape screenshot ${index + 1}`, isPngSignature);
|
|
200
204
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
201
205
|
sessionFiles.push(await buildPreparedSessionFile(`screenshotsLandscape:${index}`, prepared.file));
|
|
202
206
|
}
|
|
203
207
|
for (let index = 0; index < (listing?.videoPortraitPaths ?? []).length; index += 1) {
|
|
204
208
|
const filePath = listing.videoPortraitPaths[index];
|
|
205
|
-
const prepared = createFileFromPath(filePath,
|
|
209
|
+
const prepared = createFileFromPath(filePath, "video/mp4", config_1.MAX_VERSION_VIDEO_BYTES, "video_portrait_too_large", "invalid_video_portrait_content_type", `Portrait video ${index + 1}`, isMp4Signature);
|
|
206
210
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
207
211
|
sessionFiles.push(await buildPreparedSessionFile(`videosPortrait:${index}`, prepared.file));
|
|
208
212
|
}
|
|
209
213
|
for (let index = 0; index < (listing?.videoLandscapePaths ?? []).length; index += 1) {
|
|
210
214
|
const filePath = listing.videoLandscapePaths[index];
|
|
211
|
-
const prepared = createFileFromPath(filePath,
|
|
215
|
+
const prepared = createFileFromPath(filePath, "video/mp4", config_1.MAX_VERSION_VIDEO_BYTES, "video_landscape_too_large", "invalid_video_landscape_content_type", `Landscape video ${index + 1}`, isMp4Signature);
|
|
212
216
|
totalUploadBytes = pushPreparedFile(task.name, totalUploadBytes, prepared);
|
|
213
217
|
sessionFiles.push(await buildPreparedSessionFile(`videosLandscape:${index}`, prepared.file));
|
|
214
218
|
}
|
|
@@ -226,21 +230,21 @@ async function uploadApp(client, task, artifacts, options) {
|
|
|
226
230
|
* Upload an app version using the versioned API.
|
|
227
231
|
*/
|
|
228
232
|
async function uploadAppVersion(client, task, artifacts, options) {
|
|
229
|
-
const creatorUsername = typeof options?.creatorUsername ===
|
|
233
|
+
const creatorUsername = typeof options?.creatorUsername === "string" ? options.creatorUsername.trim() : "";
|
|
230
234
|
if (!creatorUsername) {
|
|
231
235
|
throw new Error(`Missing creator username for app "${task.name}" upload.`);
|
|
232
236
|
}
|
|
233
237
|
const achievements = task.achievements ?? [];
|
|
234
238
|
const leaderboards = task.leaderboards ?? [];
|
|
235
239
|
const listing = task.listing;
|
|
236
|
-
const { sessionFiles: preparedSessionFiles, ownedAssets: preparedOwnedAssets
|
|
240
|
+
const { sessionFiles: preparedSessionFiles, ownedAssets: preparedOwnedAssets } = await prepareAppUploadFiles(task, artifacts);
|
|
237
241
|
const initializeRequest = {
|
|
238
242
|
version: task.version,
|
|
239
243
|
agentTaskId: options?.agentTaskId,
|
|
240
244
|
playtestProof: options?.playtestProof,
|
|
241
245
|
releaseNotes: task.releaseNotes,
|
|
242
246
|
visibility: task.versionVisibility,
|
|
243
|
-
setAsCurrent: task.versionVisibility ===
|
|
247
|
+
setAsCurrent: task.versionVisibility === "PRIVATE" ? false : undefined,
|
|
244
248
|
license: task.license,
|
|
245
249
|
remixRef: task.remix,
|
|
246
250
|
usesAssets: task.uses.assets.map((entry) => ({
|
|
@@ -291,7 +295,7 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
291
295
|
...(definition.unitLabel ? { unitLabel: definition.unitLabel } : {}),
|
|
292
296
|
status: definition.status,
|
|
293
297
|
})),
|
|
294
|
-
externalUrl: task.hostingMode ===
|
|
298
|
+
externalUrl: task.hostingMode === "EXTERNAL" ? task.externalUrl : undefined,
|
|
295
299
|
listingMedia: listing?.mediaMetadata,
|
|
296
300
|
files: preparedSessionFiles.map((file) => ({
|
|
297
301
|
fileKey: file.fileKey,
|
|
@@ -328,7 +332,7 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
328
332
|
try {
|
|
329
333
|
const initialized = await client.initializeAppUpload(creatorUsername, task.name, initializeRequest);
|
|
330
334
|
sessionId = initialized.session.id;
|
|
331
|
-
if (initialized.status !==
|
|
335
|
+
if (initialized.status !== "finalized") {
|
|
332
336
|
const uploadedFileKeys = new Set(initialized.session.uploadedFileKeys);
|
|
333
337
|
const uploadedOwnedAssetKeys = new Set(initialized.session.uploadedOwnedAssetKeys);
|
|
334
338
|
for (const file of preparedSessionFiles) {
|
|
@@ -352,9 +356,7 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
352
356
|
})),
|
|
353
357
|
});
|
|
354
358
|
}
|
|
355
|
-
if (task.hostingMode !==
|
|
356
|
-
&& !task.externalUrl
|
|
357
|
-
&& options?.playtestSmokeCheckRequired) {
|
|
359
|
+
if (task.hostingMode !== "EXTERNAL" && !task.externalUrl && options?.playtestSmokeCheckRequired) {
|
|
358
360
|
await (0, loadCheck_1.runUploadedHostedPlaytestSmokeCheck)({
|
|
359
361
|
client,
|
|
360
362
|
creatorUsername,
|
|
@@ -366,9 +368,7 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
366
368
|
captureSession: options?.captureSession,
|
|
367
369
|
});
|
|
368
370
|
}
|
|
369
|
-
else if (task.hostingMode !==
|
|
370
|
-
&& !task.externalUrl
|
|
371
|
-
&& options?.runStagedUploadLoadCheck) {
|
|
371
|
+
else if (task.hostingMode !== "EXTERNAL" && !task.externalUrl && options?.runStagedUploadLoadCheck) {
|
|
372
372
|
const loadCheck = await (0, loadCheck_1.runUploadedHostedLoadCheck)({
|
|
373
373
|
client,
|
|
374
374
|
creatorUsername,
|
|
@@ -379,11 +379,11 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
379
379
|
currentUser: options?.user ?? null,
|
|
380
380
|
captureSession: options?.captureSession,
|
|
381
381
|
});
|
|
382
|
-
if (loadCheck.status !==
|
|
383
|
-
throw new Error((0, loadCheck_1.formatHostedLoadCheckFailure)(task.name, loadCheck,
|
|
382
|
+
if (loadCheck.status !== "PASSED") {
|
|
383
|
+
throw new Error((0, loadCheck_1.formatHostedLoadCheckFailure)(task.name, loadCheck, "staged"));
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
if (task.editorSupported && task.hostingMode !==
|
|
386
|
+
if (task.editorSupported && task.hostingMode !== "EXTERNAL" && !task.externalUrl) {
|
|
387
387
|
const editorLoadCheck = await (0, loadCheck_1.runUploadedHostedLoadCheck)({
|
|
388
388
|
client,
|
|
389
389
|
creatorUsername,
|
|
@@ -393,31 +393,27 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
393
393
|
token: options?.token ?? null,
|
|
394
394
|
currentUser: options?.user ?? null,
|
|
395
395
|
captureSession: options?.captureSession,
|
|
396
|
-
phase:
|
|
396
|
+
phase: "editor",
|
|
397
397
|
verifyEditorPhaseRoundTrip: true,
|
|
398
398
|
});
|
|
399
|
-
if (editorLoadCheck.status !==
|
|
400
|
-
throw new Error((0, loadCheck_1.formatHostedLoadCheckFailure)(task.name, editorLoadCheck,
|
|
399
|
+
if (editorLoadCheck.status !== "PASSED") {
|
|
400
|
+
throw new Error((0, loadCheck_1.formatHostedLoadCheckFailure)(task.name, editorLoadCheck, "editor"));
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
const finalized = initialized.status ===
|
|
404
|
+
const finalized = initialized.status === "finalized"
|
|
405
405
|
? initialized.finalized
|
|
406
406
|
: await client.finalizeAppUpload(creatorUsername, task.name, sessionId);
|
|
407
407
|
if (!finalized) {
|
|
408
408
|
throw new Error(`Upload failed for ${task.name}: missing finalized app upload payload`);
|
|
409
409
|
}
|
|
410
|
-
const version = initialized.status ===
|
|
411
|
-
|
|
412
|
-
: finalized.version;
|
|
413
|
-
const versionNodeId = initialized.status === 'finalized'
|
|
414
|
-
? finalized?.versionNodeId
|
|
415
|
-
: finalized.versionNodeId;
|
|
410
|
+
const version = initialized.status === "finalized" ? finalized?.version : finalized.version;
|
|
411
|
+
const versionNodeId = initialized.status === "finalized" ? finalized?.versionNodeId : finalized.versionNodeId;
|
|
416
412
|
return {
|
|
417
413
|
versionCreated: true,
|
|
418
414
|
version: version?.version,
|
|
419
|
-
versionId: typeof version?.id ===
|
|
420
|
-
versionNodeId: typeof versionNodeId ===
|
|
415
|
+
versionId: typeof version?.id === "number" ? version.id : undefined,
|
|
416
|
+
versionNodeId: typeof versionNodeId === "string" ? versionNodeId : undefined,
|
|
421
417
|
};
|
|
422
418
|
}
|
|
423
419
|
catch (unknownError) {
|
|
@@ -430,34 +426,32 @@ async function uploadAppVersion(client, task, artifacts, options) {
|
|
|
430
426
|
}
|
|
431
427
|
}
|
|
432
428
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
433
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
429
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Upload app version");
|
|
434
430
|
}
|
|
435
431
|
if (unknownError instanceof http_1.CLIUnsupportedClientError) {
|
|
436
432
|
throw unknownError;
|
|
437
433
|
}
|
|
438
434
|
if (unknownError instanceof types_1.ApiError) {
|
|
439
435
|
const detail = unknownError.message?.trim();
|
|
440
|
-
if (unknownError.code ===
|
|
436
|
+
if (unknownError.code === "version_limit_reached") {
|
|
441
437
|
const appRef = `${creatorUsername}/app/${task.name}`;
|
|
442
|
-
throw new Error(`${detail || `App "${task.name}" has reached the maximum version count.`}\n`
|
|
443
|
-
|
|
444
|
-
|
|
438
|
+
throw new Error(`${detail || `App "${task.name}" has reached the maximum version count.`}\n` +
|
|
439
|
+
`Review versions: playdrop versions browse ${appRef}\n` +
|
|
440
|
+
`Delete one old version: playdrop creations apps versions delete ${task.name} <version>`);
|
|
445
441
|
}
|
|
446
|
-
if (unknownError.status === 409 && unknownError.code ===
|
|
442
|
+
if (unknownError.status === 409 && unknownError.code === "version_exists") {
|
|
447
443
|
if (options?.agentTaskId !== undefined) {
|
|
448
444
|
throw new Error(`Version ${task.version} already exists for app "${task.name}".\n` +
|
|
449
|
-
|
|
445
|
+
"This task has a fixed outputVersion; do not bump catalogue.json. The required task version has already been consumed by an upload attempt, so fail the task with the operational reason.");
|
|
450
446
|
}
|
|
451
447
|
throw new Error(`Version ${task.version} already exists for app "${task.name}".\n` +
|
|
452
448
|
`Hint: Update "version" in catalogue.json to a new version (e.g., bump to the next patch).`);
|
|
453
449
|
}
|
|
454
450
|
const statusText = `status ${unknownError.status}`;
|
|
455
|
-
const errorCode = typeof unknownError.code ===
|
|
456
|
-
? unknownError.code.trim()
|
|
457
|
-
: '';
|
|
451
|
+
const errorCode = typeof unknownError.code === "string" && unknownError.code.trim().length > 0 ? unknownError.code.trim() : "";
|
|
458
452
|
const annotatedMessage = detail
|
|
459
|
-
? `${errorCode ? `${errorCode}: ` :
|
|
460
|
-
: `${statusText}${errorCode ? ` (${errorCode})` :
|
|
453
|
+
? `${errorCode ? `${errorCode}: ` : ""}${detail}`
|
|
454
|
+
: `${statusText}${errorCode ? ` (${errorCode})` : ""}`;
|
|
461
455
|
throw new Error(`Upload failed for ${task.name}: ${annotatedMessage}`);
|
|
462
456
|
}
|
|
463
457
|
throw unknownError;
|
package/dist/apps/validate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppTask } from
|
|
2
|
-
export type AppValidationWarningMode =
|
|
1
|
+
import type { AppTask } from "../catalogue";
|
|
2
|
+
export type AppValidationWarningMode = "source" | "bundle";
|
|
3
3
|
export declare function collectAppValidationWarnings(task: AppTask, _mode?: AppValidationWarningMode): string[];
|
|
4
4
|
export declare function runFormatScript(task: AppTask): Promise<boolean>;
|
|
5
5
|
export declare function validateAppTask(task: AppTask): Promise<void>;
|
package/dist/apps/validate.js
CHANGED
|
@@ -13,7 +13,7 @@ const projectFormatCache = new Map();
|
|
|
13
13
|
function ensureWithinProject(task) {
|
|
14
14
|
const relativePath = (0, node_path_1.relative)(task.projectDir, task.filePath);
|
|
15
15
|
const segments = relativePath.split(/[/\\]+/);
|
|
16
|
-
if (!relativePath || relativePath.startsWith(
|
|
16
|
+
if (!relativePath || relativePath.startsWith("..") || segments.includes("..")) {
|
|
17
17
|
throw new Error(`[apps][validate] Bundle path for ${task.name} must remain inside ${task.projectDir}. Update catalogue entry ${task.cataloguePath}.`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -22,14 +22,14 @@ async function ensureValidateScript(task) {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (!projectValidateCache.has(task.projectDir)) {
|
|
25
|
-
const promise = (0, build_1.runNpmScript)(task.projectDir,
|
|
25
|
+
const promise = (0, build_1.runNpmScript)(task.projectDir, "validate");
|
|
26
26
|
projectValidateCache.set(task.projectDir, promise);
|
|
27
27
|
}
|
|
28
28
|
await projectValidateCache.get(task.projectDir);
|
|
29
29
|
}
|
|
30
30
|
function safeReadFile(filePath) {
|
|
31
31
|
try {
|
|
32
|
-
return (0, node_fs_1.readFileSync)(filePath,
|
|
32
|
+
return (0, node_fs_1.readFileSync)(filePath, "utf8");
|
|
33
33
|
}
|
|
34
34
|
catch {
|
|
35
35
|
return null;
|
|
@@ -54,27 +54,23 @@ function collectOutdatedSdkVersionWarnings(task) {
|
|
|
54
54
|
if (!(0, semver_1.valid)(cliVersion)) {
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
|
-
const sdkTypesDependency = typeof packageJson?.devDependencies?.[
|
|
58
|
-
? packageJson.devDependencies[
|
|
59
|
-
: typeof packageJson?.dependencies?.[
|
|
60
|
-
? packageJson.dependencies[
|
|
61
|
-
:
|
|
62
|
-
const sdkTypesVersion = typeof packageJson?.playdrop?.sdkTypesVersion ===
|
|
63
|
-
|
|
64
|
-
:
|
|
65
|
-
|
|
66
|
-
&& (sdkTypesDependency.startsWith('file:') || sdkTypesDependency.includes('.tgz'));
|
|
67
|
-
if (!usesVendoredSdkTypes
|
|
68
|
-
|| !(0, semver_1.valid)(sdkTypesVersion)
|
|
69
|
-
|| !(0, semver_1.lt)(sdkTypesVersion, cliVersion)) {
|
|
57
|
+
const sdkTypesDependency = typeof packageJson?.devDependencies?.["playdrop-sdk-types"] === "string"
|
|
58
|
+
? packageJson.devDependencies["playdrop-sdk-types"]
|
|
59
|
+
: typeof packageJson?.dependencies?.["playdrop-sdk-types"] === "string"
|
|
60
|
+
? packageJson.dependencies["playdrop-sdk-types"]
|
|
61
|
+
: "";
|
|
62
|
+
const sdkTypesVersion = typeof packageJson?.playdrop?.sdkTypesVersion === "string" ? packageJson.playdrop.sdkTypesVersion.trim() : "";
|
|
63
|
+
const usesVendoredSdkTypes = sdkTypesDependency.includes("playdrop-sdk-types") &&
|
|
64
|
+
(sdkTypesDependency.startsWith("file:") || sdkTypesDependency.includes(".tgz"));
|
|
65
|
+
if (!usesVendoredSdkTypes || !(0, semver_1.valid)(sdkTypesVersion) || !(0, semver_1.lt)(sdkTypesVersion, cliVersion)) {
|
|
70
66
|
return [];
|
|
71
67
|
}
|
|
72
68
|
return [
|
|
73
69
|
`[apps][validate] ${task.name} vendors playdrop-sdk-types.tgz at ${sdkTypesVersion}, which is older than this CLI version ${cliVersion}. Refresh vendor/playdrop-sdk-types.tgz and package.json playdrop.sdkTypesVersion before upload.`,
|
|
74
70
|
];
|
|
75
71
|
}
|
|
76
|
-
function collectAppValidationWarnings(task, _mode =
|
|
77
|
-
const isExternal = task.hostingMode ===
|
|
72
|
+
function collectAppValidationWarnings(task, _mode = "source") {
|
|
73
|
+
const isExternal = task.hostingMode === "EXTERNAL" || !!task.externalUrl;
|
|
78
74
|
if (isExternal) {
|
|
79
75
|
return [];
|
|
80
76
|
}
|
|
@@ -85,22 +81,22 @@ async function runFormatScript(task) {
|
|
|
85
81
|
return false;
|
|
86
82
|
}
|
|
87
83
|
if (!projectFormatCache.has(task.projectDir)) {
|
|
88
|
-
projectFormatCache.set(task.projectDir, (0, build_1.runNpmScript)(task.projectDir,
|
|
84
|
+
projectFormatCache.set(task.projectDir, (0, build_1.runNpmScript)(task.projectDir, "format"));
|
|
89
85
|
}
|
|
90
86
|
await projectFormatCache.get(task.projectDir);
|
|
91
87
|
return true;
|
|
92
88
|
}
|
|
93
89
|
async function validateAppTask(task) {
|
|
94
90
|
if (!task.name) {
|
|
95
|
-
throw new Error(
|
|
91
|
+
throw new Error("[apps][validate] App entry is missing a name.");
|
|
96
92
|
}
|
|
97
93
|
// External apps don't need file validation - they're hosted elsewhere
|
|
98
|
-
const isExternal = task.hostingMode ===
|
|
94
|
+
const isExternal = task.hostingMode === "EXTERNAL" || !!task.externalUrl;
|
|
99
95
|
if (isExternal) {
|
|
100
96
|
if (!task.externalUrl) {
|
|
101
97
|
throw new Error(`[apps][validate] ${task.name} is marked as EXTERNAL but missing externalUrl.`);
|
|
102
98
|
}
|
|
103
|
-
if (!task.externalUrl.startsWith(
|
|
99
|
+
if (!task.externalUrl.startsWith("https://")) {
|
|
104
100
|
throw new Error(`[apps][validate] ${task.name} externalUrl must be HTTPS.`);
|
|
105
101
|
}
|
|
106
102
|
// External apps pass validation - no local files needed
|
package/dist/assetSpecs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AssetSpecCapability, type AssetSpecContract, type AssetSpecValidationKind } from
|
|
2
|
-
export declare function resolveCustomAssetRoleContentType(filePath: string, roleContract?: Pick<AssetSpecContract[
|
|
1
|
+
import { type AssetSpecCapability, type AssetSpecContract, type AssetSpecValidationKind } from "@playdrop/types";
|
|
2
|
+
export declare function resolveCustomAssetRoleContentType(filePath: string, roleContract?: Pick<AssetSpecContract["roles"][number], "contentTypes"> | null): string;
|
|
3
3
|
export type AssetSpecSupportDeclaration = {
|
|
4
4
|
assetSpec: string;
|
|
5
5
|
versionRange: string;
|
package/dist/assetSpecs.js
CHANGED
|
@@ -15,23 +15,23 @@ const node_fs_1 = require("node:fs");
|
|
|
15
15
|
const node_path_1 = require("node:path");
|
|
16
16
|
const semver_1 = require("semver");
|
|
17
17
|
const LOCAL_EXTENSION_TO_MIME = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
".png": "image/png",
|
|
19
|
+
".jpg": "image/jpeg",
|
|
20
|
+
".jpeg": "image/jpeg",
|
|
21
|
+
".webp": "image/webp",
|
|
22
|
+
".gif": "image/gif",
|
|
23
|
+
".aseprite": "application/octet-stream",
|
|
24
|
+
".mp4": "video/mp4",
|
|
25
|
+
".webm": "video/webm",
|
|
26
|
+
".mp3": "audio/mpeg",
|
|
27
|
+
".wav": "audio/wav",
|
|
28
|
+
".ogg": "audio/ogg",
|
|
29
|
+
".vox": "application/octet-stream",
|
|
30
|
+
".gltf": "model/gltf+json",
|
|
31
|
+
".glb": "model/gltf-binary",
|
|
32
|
+
".json": "application/json",
|
|
33
|
+
".md": "text/markdown",
|
|
34
|
+
".txt": "text/plain",
|
|
35
35
|
};
|
|
36
36
|
const ajv = new ajv_1.default({
|
|
37
37
|
allErrors: true,
|
|
@@ -41,8 +41,8 @@ const ajv = new ajv_1.default({
|
|
|
41
41
|
const validateContractMetaSchema = ajv.compile(types_1.ASSET_SPEC_CONTRACT_META_SCHEMA);
|
|
42
42
|
function formatAjvErrors(prefix) {
|
|
43
43
|
return (validateContractMetaSchema.errors ?? []).map((issue) => {
|
|
44
|
-
const path = issue.instancePath || issue.schemaPath ||
|
|
45
|
-
return `${prefix} contract is invalid at ${path}: ${issue.message ??
|
|
44
|
+
const path = issue.instancePath || issue.schemaPath || "/";
|
|
45
|
+
return `${prefix} contract is invalid at ${path}: ${issue.message ?? "schema validation failed"}.`;
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function createContractValidator() {
|
|
@@ -53,7 +53,7 @@ function createContractValidator() {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function resolveMimeTypeFromPath(filePath) {
|
|
56
|
-
return LOCAL_EXTENSION_TO_MIME[(0, node_path_1.extname)(filePath).toLowerCase()] ??
|
|
56
|
+
return LOCAL_EXTENSION_TO_MIME[(0, node_path_1.extname)(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
57
57
|
}
|
|
58
58
|
function resolveCustomAssetRoleContentType(filePath, roleContract) {
|
|
59
59
|
const resolvedContentType = resolveMimeTypeFromPath(filePath);
|
|
@@ -67,7 +67,7 @@ function resolveCustomAssetRoleContentType(filePath, roleContract) {
|
|
|
67
67
|
return contentType.trim();
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
if ((0, node_path_1.extname)(filePath).toLowerCase() ===
|
|
70
|
+
if ((0, node_path_1.extname)(filePath).toLowerCase() === ".json") {
|
|
71
71
|
const jsonLikeContentType = roleContract.contentTypes.find((contentType) => (0, types_1.isJsonLikeAssetSpecContentType)(contentType));
|
|
72
72
|
if (jsonLikeContentType) {
|
|
73
73
|
return jsonLikeContentType.trim();
|
|
@@ -86,17 +86,17 @@ function normalizeAssetSpecSupportEntries(raw, errors, context) {
|
|
|
86
86
|
const rows = [];
|
|
87
87
|
for (let index = 0; index < raw.length; index += 1) {
|
|
88
88
|
const entry = raw[index];
|
|
89
|
-
if (!entry || typeof entry !==
|
|
89
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
90
90
|
errors.push(`${context} assetSpecSupport[${index}] must be an object.`);
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
|
-
const assetSpec = typeof entry.assetSpec ===
|
|
93
|
+
const assetSpec = typeof entry.assetSpec === "string" ? entry.assetSpec.trim() : "";
|
|
94
94
|
const parsedAssetSpec = (0, types_1.parseAssetSpecFamilyRef)(assetSpec);
|
|
95
95
|
if (!assetSpec || !parsedAssetSpec) {
|
|
96
96
|
errors.push(`${context} assetSpecSupport[${index}].assetSpec must be an asset spec family ref.`);
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
|
-
const versionRange = typeof entry.versionRange ===
|
|
99
|
+
const versionRange = typeof entry.versionRange === "string" ? entry.versionRange.trim() : "";
|
|
100
100
|
if (!versionRange || !(0, semver_1.validRange)(versionRange)) {
|
|
101
101
|
errors.push(`${context} assetSpecSupport[${index}].versionRange must be a valid semver range.`);
|
|
102
102
|
continue;
|
|
@@ -142,7 +142,7 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
|
|
|
142
142
|
errors.push(`${context} contract exceeds the ${types_1.ASSET_SPEC_CONTRACT_MAX_BYTES} byte limit.`);
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
|
-
rawText = (0, node_fs_1.readFileSync)(contractPath,
|
|
145
|
+
rawText = (0, node_fs_1.readFileSync)(contractPath, "utf8");
|
|
146
146
|
}
|
|
147
147
|
catch {
|
|
148
148
|
errors.push(`${context} contract file not found at ${contractPath}.`);
|
|
@@ -153,7 +153,7 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
|
|
|
153
153
|
parsed = JSON.parse(rawText);
|
|
154
154
|
}
|
|
155
155
|
catch (error) {
|
|
156
|
-
errors.push(`${context} contract must be valid JSON (${error?.message ??
|
|
156
|
+
errors.push(`${context} contract must be valid JSON (${error?.message ?? "parse failed"}).`);
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
159
|
if (!validateContractMetaSchema(parsed)) {
|
|
@@ -183,7 +183,7 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
|
|
|
183
183
|
schemaAjv.compile(role.jsonSchema);
|
|
184
184
|
}
|
|
185
185
|
catch (error) {
|
|
186
|
-
errors.push(`${context} contract role "${role.name}" jsonSchema is invalid (${error?.message ??
|
|
186
|
+
errors.push(`${context} contract role "${role.name}" jsonSchema is invalid (${error?.message ?? "compile failed"}).`);
|
|
187
187
|
hasContractError = true;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -207,7 +207,7 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
|
|
|
207
207
|
}
|
|
208
208
|
return {
|
|
209
209
|
contract,
|
|
210
|
-
validationKind: contract.roles.some((role) => role.jsonSchema) ?
|
|
210
|
+
validationKind: contract.roles.some((role) => role.jsonSchema) ? "JSON_SCHEMA" : "NONE",
|
|
211
211
|
contractPath,
|
|
212
212
|
};
|
|
213
213
|
}
|
|
@@ -226,28 +226,28 @@ function validateCustomAssetFilesAgainstContract(contract, filePaths, errors, co
|
|
|
226
226
|
if (roleContract.extensions?.length) {
|
|
227
227
|
const allowedExtensions = roleContract.extensions.map((value) => value.trim().toLowerCase());
|
|
228
228
|
if (!allowedExtensions.includes(extension)) {
|
|
229
|
-
errors.push(`${context} role "${rawRole}" must use one of ${allowedExtensions.join(
|
|
229
|
+
errors.push(`${context} role "${rawRole}" must use one of ${allowedExtensions.join(", ")}.`);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
const resolvedContentType = resolveCustomAssetRoleContentType(filePath, roleContract);
|
|
233
233
|
const normalizedContentTypes = roleContract.contentTypes.map((value) => value.trim().toLowerCase());
|
|
234
234
|
if (!normalizedContentTypes.includes(resolvedContentType.toLowerCase())) {
|
|
235
|
-
errors.push(`${context} role "${rawRole}" must use one of ${normalizedContentTypes.join(
|
|
235
|
+
errors.push(`${context} role "${rawRole}" must use one of ${normalizedContentTypes.join(", ")}.`);
|
|
236
236
|
}
|
|
237
237
|
if (roleContract.jsonSchema) {
|
|
238
238
|
try {
|
|
239
|
-
const rawText = (0, node_fs_1.readFileSync)(filePath,
|
|
239
|
+
const rawText = (0, node_fs_1.readFileSync)(filePath, "utf8");
|
|
240
240
|
const parsedJson = JSON.parse(rawText);
|
|
241
241
|
const schemaAjv = createContractValidator();
|
|
242
242
|
const validateJson = schemaAjv.compile(roleContract.jsonSchema);
|
|
243
243
|
if (!validateJson(parsedJson)) {
|
|
244
244
|
const firstIssue = validateJson.errors?.[0];
|
|
245
|
-
const issuePath = firstIssue?.instancePath || firstIssue?.schemaPath ||
|
|
246
|
-
errors.push(`${context} role "${rawRole}" JSON content failed schema validation at ${issuePath}: ${firstIssue?.message ??
|
|
245
|
+
const issuePath = firstIssue?.instancePath || firstIssue?.schemaPath || "/";
|
|
246
|
+
errors.push(`${context} role "${rawRole}" JSON content failed schema validation at ${issuePath}: ${firstIssue?.message ?? "schema validation failed"}.`);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
catch (error) {
|
|
250
|
-
errors.push(`${context} role "${rawRole}" JSON content is invalid (${error?.message ??
|
|
250
|
+
errors.push(`${context} role "${rawRole}" JSON content is invalid (${error?.message ?? "parse failed"}).`);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -261,7 +261,7 @@ function normalizeAssetSpecVersionRef(raw, errors, context) {
|
|
|
261
261
|
if (raw === undefined || raw === null) {
|
|
262
262
|
return undefined;
|
|
263
263
|
}
|
|
264
|
-
if (typeof raw !==
|
|
264
|
+
if (typeof raw !== "string" || raw.trim().length === 0) {
|
|
265
265
|
errors.push(`${context} assetSpec must be an exact asset spec version ref.`);
|
|
266
266
|
return undefined;
|
|
267
267
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssetTask, OwnedAssetTask, PackOwnedAssetTask } from
|
|
1
|
+
import type { AssetTask, OwnedAssetTask, PackOwnedAssetTask } from "../catalogue";
|
|
2
2
|
type ModelAssetTask = AssetTask | OwnedAssetTask | PackOwnedAssetTask;
|
|
3
3
|
export declare function isGeneratedModel3DAssetTask(task: ModelAssetTask, format?: string): boolean;
|
|
4
4
|
export declare function assertGeneratedModel3DAssetRoles(task: ModelAssetTask, format?: string): void;
|