@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
package/dist/commands/upgrade.js
CHANGED
|
@@ -8,7 +8,7 @@ const worker_1 = require("./worker");
|
|
|
8
8
|
const WORKER_UPDATE_POLL_DEFAULT_MS = 3000;
|
|
9
9
|
const WORKER_UPDATE_TIMEOUT_DEFAULT_MS = 15 * 60000;
|
|
10
10
|
function readPositiveIntegerEnv(name, fallback) {
|
|
11
|
-
const raw = process.env[name]?.trim() ||
|
|
11
|
+
const raw = process.env[name]?.trim() || "";
|
|
12
12
|
const value = Number(raw);
|
|
13
13
|
return Number.isInteger(value) && value > 0 ? value : fallback;
|
|
14
14
|
}
|
|
@@ -18,21 +18,21 @@ function sleep(ms) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function validateTargetVersion(value) {
|
|
21
|
-
const version = value?.trim() || process.env.PLAYDROP_CLI_TARGET_VERSION?.trim() ||
|
|
21
|
+
const version = value?.trim() || process.env.PLAYDROP_CLI_TARGET_VERSION?.trim() || "";
|
|
22
22
|
if (!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(version)) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error("playdrop_update_target_version_required: pass --target-version <version> or set PLAYDROP_CLI_TARGET_VERSION. Managed workers should use playdrop update --worker.");
|
|
24
24
|
}
|
|
25
25
|
return version;
|
|
26
26
|
}
|
|
27
27
|
function runCommand(command, args) {
|
|
28
|
-
const commandString = `${command} ${args.join(
|
|
29
|
-
console.log(
|
|
28
|
+
const commandString = `${command} ${args.join(" ")}`;
|
|
29
|
+
console.log("Running:", commandString);
|
|
30
30
|
return new Promise((resolve, reject) => {
|
|
31
31
|
const child = (0, node_child_process_1.spawn)(command, args, {
|
|
32
|
-
stdio:
|
|
33
|
-
shell: process.platform ===
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
shell: process.platform === "win32",
|
|
34
34
|
});
|
|
35
|
-
child.on(
|
|
35
|
+
child.on("close", (code) => {
|
|
36
36
|
if (code === 0) {
|
|
37
37
|
resolve();
|
|
38
38
|
}
|
|
@@ -40,22 +40,22 @@ function runCommand(command, args) {
|
|
|
40
40
|
reject(new Error(`${command} exited with code ${code}`));
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
child.on(
|
|
43
|
+
child.on("error", (error) => reject(error));
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
function formatWorkerUpdateState(worker) {
|
|
47
47
|
return [
|
|
48
|
-
`lifecycle=${worker.lifecycleState ??
|
|
49
|
-
`update=${worker.updateState ??
|
|
50
|
-
`ready=${worker.ready === true ?
|
|
51
|
-
`cli=${worker.cliVersion ??
|
|
52
|
-
].join(
|
|
48
|
+
`lifecycle=${worker.lifecycleState ?? "unknown"}`,
|
|
49
|
+
`update=${worker.updateState ?? "unknown"}`,
|
|
50
|
+
`ready=${worker.ready === true ? "true" : worker.ready === false ? "false" : "unknown"}`,
|
|
51
|
+
`cli=${worker.cliVersion ?? "unknown"}`,
|
|
52
|
+
].join(" ");
|
|
53
53
|
}
|
|
54
54
|
async function observeManagedWorkerUpdate(input) {
|
|
55
|
-
const pollMs = readPositiveIntegerEnv(
|
|
56
|
-
const timeoutMs = readPositiveIntegerEnv(
|
|
55
|
+
const pollMs = readPositiveIntegerEnv("PLAYDROP_WORKER_UPDATE_POLL_MS", WORKER_UPDATE_POLL_DEFAULT_MS);
|
|
56
|
+
const timeoutMs = readPositiveIntegerEnv("PLAYDROP_WORKER_UPDATE_TIMEOUT_MS", WORKER_UPDATE_TIMEOUT_DEFAULT_MS);
|
|
57
57
|
const deadline = Date.now() + timeoutMs;
|
|
58
|
-
let lastState =
|
|
58
|
+
let lastState = "";
|
|
59
59
|
while (Date.now() <= deadline) {
|
|
60
60
|
const workers = await input.client.listMyAgentWorkers();
|
|
61
61
|
const worker = workers.workers.find((candidate) => candidate.workerKey === input.workerKey);
|
|
@@ -67,18 +67,18 @@ async function observeManagedWorkerUpdate(input) {
|
|
|
67
67
|
console.log(`Worker update progress: ${state}`);
|
|
68
68
|
lastState = state;
|
|
69
69
|
}
|
|
70
|
-
if (worker.updateState ===
|
|
70
|
+
if (worker.updateState === "UPDATE_BLOCKED" || worker.lifecycleState === "DEGRADED" || worker.ready === false) {
|
|
71
71
|
throw new Error(`playdrop_update_worker_failed: ${state}. Next action: run "playdrop worker status --json" on the worker host and inspect the wrapper failure marker under the configured worker state directory.`);
|
|
72
72
|
}
|
|
73
|
-
if (worker.activeUpdateIntentId !== input.intentId
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (worker.updateState ===
|
|
78
|
-
console.log(
|
|
73
|
+
if (worker.activeUpdateIntentId !== input.intentId &&
|
|
74
|
+
worker.lifecycleState === "READY" &&
|
|
75
|
+
(worker.updateState === "CURRENT" || worker.updateState === "UPDATE_AVAILABLE") &&
|
|
76
|
+
worker.ready === true) {
|
|
77
|
+
if (worker.updateState === "UPDATE_AVAILABLE") {
|
|
78
|
+
console.log("Managed worker update settled above minimum with a target update still available.");
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
console.log(
|
|
81
|
+
console.log("Managed worker update completed.");
|
|
82
82
|
}
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
@@ -88,7 +88,9 @@ async function observeManagedWorkerUpdate(input) {
|
|
|
88
88
|
}
|
|
89
89
|
async function upgrade(options = {}) {
|
|
90
90
|
if (options.worker) {
|
|
91
|
-
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)(
|
|
91
|
+
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)("update", "Requesting a managed worker update", {
|
|
92
|
+
env: options.env,
|
|
93
|
+
});
|
|
92
94
|
if (!ctx) {
|
|
93
95
|
return;
|
|
94
96
|
}
|
|
@@ -96,10 +98,10 @@ async function upgrade(options = {}) {
|
|
|
96
98
|
const intent = await ctx.client.workerCreateUpdateIntent({
|
|
97
99
|
workerKey,
|
|
98
100
|
environment: ctx.env,
|
|
99
|
-
reason:
|
|
101
|
+
reason: "manual_update",
|
|
100
102
|
});
|
|
101
103
|
console.log(`Managed worker update intent ${intent.intent.id} created for worker ${workerKey}.`);
|
|
102
|
-
console.log(`Worker state: ${intent.worker.lifecycleState ??
|
|
104
|
+
console.log(`Worker state: ${intent.worker.lifecycleState ?? "unknown"} / ${intent.worker.updateState ?? "unknown"}`);
|
|
103
105
|
await observeManagedWorkerUpdate({
|
|
104
106
|
client: ctx.client,
|
|
105
107
|
workerKey,
|
|
@@ -112,11 +114,18 @@ async function upgrade(options = {}) {
|
|
|
112
114
|
throw new Error(`playdrop_update_active_personal_worker: stop the My Agent worker first, then rerun playdrop update. pid=${activePersonalWorker.pid} worker=${activePersonalWorker.workerName}`);
|
|
113
115
|
}
|
|
114
116
|
const targetVersion = validateTargetVersion(options.targetVersion);
|
|
115
|
-
const upgradeCommand = [
|
|
116
|
-
|
|
117
|
+
const upgradeCommand = [
|
|
118
|
+
"install",
|
|
119
|
+
"-g",
|
|
120
|
+
"--ignore-scripts",
|
|
121
|
+
"--no-audit",
|
|
122
|
+
"--no-fund",
|
|
123
|
+
`@playdrop/playdrop-cli@${targetVersion}`,
|
|
124
|
+
];
|
|
125
|
+
const commandString = `npm ${upgradeCommand.join(" ")}`;
|
|
117
126
|
if (options.dryRun) {
|
|
118
127
|
console.log(commandString);
|
|
119
128
|
return;
|
|
120
129
|
}
|
|
121
|
-
await runCommand(
|
|
130
|
+
await runCommand("npm", upgradeCommand);
|
|
122
131
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ApiClient } from
|
|
2
|
-
import { type AssetPackUploadedLocalAsset } from
|
|
3
|
-
import type { AssetPackTask, AssetSpecTask, AssetTask, OwnedAssetTask, PackOwnedAssetTask } from
|
|
4
|
-
import type { CliTask } from
|
|
5
|
-
export type CurrentUserRole =
|
|
1
|
+
import type { ApiClient } from "@playdrop/api-client";
|
|
2
|
+
import { type AssetPackUploadedLocalAsset } from "@playdrop/types";
|
|
3
|
+
import type { AssetPackTask, AssetSpecTask, AssetTask, OwnedAssetTask, PackOwnedAssetTask } from "../catalogue";
|
|
4
|
+
import type { CliTask } from "../taskUtils";
|
|
5
|
+
export type CurrentUserRole = "CREATOR" | "ADMIN" | null;
|
|
6
6
|
export type UploadedAssetInfo = {
|
|
7
7
|
creatorUsername: string;
|
|
8
8
|
name: string;
|
|
@@ -15,73 +15,69 @@ const node_path_1 = require("node:path");
|
|
|
15
15
|
const model_artifacts_1 = require("../assets/model-artifacts");
|
|
16
16
|
const assetSpecs_1 = require("../assetSpecs");
|
|
17
17
|
const EXTENSION_TO_FORMAT = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
".png": "PNG",
|
|
19
|
+
".jpg": "JPEG",
|
|
20
|
+
".jpeg": "JPEG",
|
|
21
|
+
".webp": "WEBP",
|
|
22
|
+
".gif": "GIF",
|
|
23
|
+
".aseprite": "ASEPRITE",
|
|
24
|
+
".mp4": "MP4",
|
|
25
|
+
".webm": "WEBM",
|
|
26
|
+
".mp3": "MP3",
|
|
27
|
+
".wav": "WAV",
|
|
28
|
+
".ogg": "OGG",
|
|
29
|
+
".vox": "VOX",
|
|
30
|
+
".gltf": "GLTF",
|
|
31
|
+
".glb": "GLB",
|
|
32
32
|
};
|
|
33
33
|
const EXTENSION_TO_MIME = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
".png": "image/png",
|
|
35
|
+
".jpg": "image/jpeg",
|
|
36
|
+
".jpeg": "image/jpeg",
|
|
37
|
+
".webp": "image/webp",
|
|
38
|
+
".gif": "image/gif",
|
|
39
|
+
".aseprite": "application/octet-stream",
|
|
40
|
+
".mp4": "video/mp4",
|
|
41
|
+
".webm": "video/webm",
|
|
42
|
+
".mp3": "audio/mpeg",
|
|
43
|
+
".wav": "audio/wav",
|
|
44
|
+
".ogg": "audio/ogg",
|
|
45
|
+
".vox": "application/octet-stream",
|
|
46
|
+
".gltf": "model/gltf+json",
|
|
47
|
+
".glb": "model/gltf-binary",
|
|
48
|
+
".json": "application/json",
|
|
49
49
|
};
|
|
50
50
|
function isPngSignature(buffer) {
|
|
51
51
|
if (buffer.length < 8) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
|
-
return buffer[0] === 0x89
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
return (buffer[0] === 0x89 &&
|
|
55
|
+
buffer[1] === 0x50 &&
|
|
56
|
+
buffer[2] === 0x4e &&
|
|
57
|
+
buffer[3] === 0x47 &&
|
|
58
|
+
buffer[4] === 0x0d &&
|
|
59
|
+
buffer[5] === 0x0a &&
|
|
60
|
+
buffer[6] === 0x1a &&
|
|
61
|
+
buffer[7] === 0x0a);
|
|
62
62
|
}
|
|
63
63
|
function isMp4Signature(buffer) {
|
|
64
|
-
return buffer.length >= 12
|
|
65
|
-
&& buffer[4] === 0x66
|
|
66
|
-
&& buffer[5] === 0x74
|
|
67
|
-
&& buffer[6] === 0x79
|
|
68
|
-
&& buffer[7] === 0x70;
|
|
64
|
+
return buffer.length >= 12 && buffer[4] === 0x66 && buffer[5] === 0x74 && buffer[6] === 0x79 && buffer[7] === 0x70;
|
|
69
65
|
}
|
|
70
66
|
function createListingFileFromPath(filePath, expectedMime) {
|
|
71
67
|
const data = (0, node_fs_1.readFileSync)(filePath);
|
|
72
|
-
if (expectedMime ===
|
|
68
|
+
if (expectedMime === "image/png" && !isPngSignature(data)) {
|
|
73
69
|
throw new Error(`Invalid listing file signature for ${filePath}. Expected image/png.`);
|
|
74
70
|
}
|
|
75
|
-
if (expectedMime ===
|
|
71
|
+
if (expectedMime === "video/mp4" && !isMp4Signature(data)) {
|
|
76
72
|
throw new Error(`Invalid listing file signature for ${filePath}. Expected video/mp4.`);
|
|
77
73
|
}
|
|
78
74
|
return new File([data], (0, node_path_1.basename)(filePath), { type: expectedMime });
|
|
79
75
|
}
|
|
80
76
|
function computeSha256Hex(buffer) {
|
|
81
|
-
return (0, node_crypto_1.createHash)(
|
|
77
|
+
return (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex");
|
|
82
78
|
}
|
|
83
79
|
function resolveMimeType(filePath) {
|
|
84
|
-
return EXTENSION_TO_MIME[(0, node_path_1.extname)(filePath).toLowerCase()] ??
|
|
80
|
+
return EXTENSION_TO_MIME[(0, node_path_1.extname)(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
85
81
|
}
|
|
86
82
|
function prepareUploadFile(filePath, fieldName, explicitMimeType) {
|
|
87
83
|
const data = (0, node_fs_1.readFileSync)(filePath);
|
|
@@ -98,12 +94,12 @@ function prepareUploadFile(filePath, fieldName, explicitMimeType) {
|
|
|
98
94
|
};
|
|
99
95
|
}
|
|
100
96
|
function buildListingMediaRelativePath(mediaKey) {
|
|
101
|
-
if (mediaKey ===
|
|
102
|
-
return
|
|
103
|
-
if (mediaKey ===
|
|
104
|
-
return
|
|
105
|
-
if (mediaKey ===
|
|
106
|
-
return
|
|
97
|
+
if (mediaKey === "icon")
|
|
98
|
+
return "listing/icon.png";
|
|
99
|
+
if (mediaKey === "heroPortrait")
|
|
100
|
+
return "listing/hero-portrait.png";
|
|
101
|
+
if (mediaKey === "heroLandscape")
|
|
102
|
+
return "listing/hero-landscape.png";
|
|
107
103
|
const portraitScreenshot = /^screenshotsPortrait:(\d+)$/.exec(mediaKey);
|
|
108
104
|
if (portraitScreenshot) {
|
|
109
105
|
return `listing/screenshots/portrait/${Number.parseInt(portraitScreenshot[1], 10) + 1}.png`;
|
|
@@ -145,10 +141,8 @@ function buildPackKey(creatorUsername, name, version) {
|
|
|
145
141
|
return `${creatorUsername}/${name}@${version}`;
|
|
146
142
|
}
|
|
147
143
|
function getTaskCreatorResult(task, defaultCreator, currentUserRole) {
|
|
148
|
-
const requestedTaskOwner =
|
|
149
|
-
|
|
150
|
-
: '';
|
|
151
|
-
const creatorTargetError = requestedTaskOwner && currentUserRole !== 'ADMIN'
|
|
144
|
+
const requestedTaskOwner = "username" in task && typeof task.username === "string" ? String(task.username).trim() : "";
|
|
145
|
+
const creatorTargetError = requestedTaskOwner && currentUserRole !== "ADMIN"
|
|
152
146
|
? `Task "${task.name}" sets username="${requestedTaskOwner}", but only admins can target another creator.`
|
|
153
147
|
: null;
|
|
154
148
|
return {
|
|
@@ -159,10 +153,10 @@ function getTaskCreatorResult(task, defaultCreator, currentUserRole) {
|
|
|
159
153
|
}
|
|
160
154
|
function parseUnversionedAssetTaskRef(rawRef, fallbackCreator) {
|
|
161
155
|
const trimmed = rawRef.trim();
|
|
162
|
-
if (!trimmed || trimmed.includes(
|
|
156
|
+
if (!trimmed || trimmed.includes("@")) {
|
|
163
157
|
return null;
|
|
164
158
|
}
|
|
165
|
-
const slashIndex = trimmed.indexOf(
|
|
159
|
+
const slashIndex = trimmed.indexOf("/");
|
|
166
160
|
if (slashIndex > 0) {
|
|
167
161
|
return {
|
|
168
162
|
creatorUsername: trimmed.slice(0, slashIndex),
|
|
@@ -178,7 +172,7 @@ function buildAssetPackUploadPlans(tasks, defaultCreator, currentUserRole) {
|
|
|
178
172
|
const packPlansByKey = new Map();
|
|
179
173
|
const ownedPackByAssetKey = new Map();
|
|
180
174
|
for (const task of tasks) {
|
|
181
|
-
if (task.kind !==
|
|
175
|
+
if (task.kind !== "asset-pack") {
|
|
182
176
|
continue;
|
|
183
177
|
}
|
|
184
178
|
const creator = getTaskCreatorResult(task, defaultCreator, currentUserRole);
|
|
@@ -222,7 +216,7 @@ function buildAssetPackUploadPlans(tasks, defaultCreator, currentUserRole) {
|
|
|
222
216
|
};
|
|
223
217
|
}
|
|
224
218
|
function resolveMutationCreatorUsername(task, creatorUsername, targetCreatorUsername) {
|
|
225
|
-
const mutationCreatorUsername = typeof targetCreatorUsername ===
|
|
219
|
+
const mutationCreatorUsername = typeof targetCreatorUsername === "string" && targetCreatorUsername.trim().length > 0
|
|
226
220
|
? targetCreatorUsername.trim()
|
|
227
221
|
: creatorUsername.trim();
|
|
228
222
|
if (!mutationCreatorUsername) {
|
|
@@ -231,39 +225,39 @@ function resolveMutationCreatorUsername(task, creatorUsername, targetCreatorUser
|
|
|
231
225
|
return mutationCreatorUsername;
|
|
232
226
|
}
|
|
233
227
|
function resolveAssetFormat(task) {
|
|
234
|
-
if (typeof task.format ===
|
|
228
|
+
if (typeof task.format === "string" && task.format.trim().length > 0) {
|
|
235
229
|
return task.format.trim().toUpperCase();
|
|
236
230
|
}
|
|
237
|
-
if (task.category ===
|
|
231
|
+
if (task.category === "MODEL_3D") {
|
|
238
232
|
const primaryFile = task.filePaths.primary;
|
|
239
|
-
if (typeof primaryFile ===
|
|
233
|
+
if (typeof primaryFile === "string") {
|
|
240
234
|
const normalizedPrimary = primaryFile.trim().toLowerCase();
|
|
241
|
-
if (normalizedPrimary.endsWith(
|
|
242
|
-
return
|
|
235
|
+
if (normalizedPrimary.endsWith(".boxel.json")) {
|
|
236
|
+
return "PLAYDROP_BOXEL_JSON";
|
|
243
237
|
}
|
|
244
|
-
if (normalizedPrimary.endsWith(
|
|
245
|
-
return
|
|
238
|
+
if (normalizedPrimary.endsWith(".vox")) {
|
|
239
|
+
return "VOX";
|
|
246
240
|
}
|
|
247
241
|
const primaryExtension = (0, node_path_1.extname)(normalizedPrimary);
|
|
248
|
-
if (primaryExtension ===
|
|
249
|
-
return
|
|
242
|
+
if (primaryExtension === ".glb") {
|
|
243
|
+
return "GLB";
|
|
250
244
|
}
|
|
251
|
-
if (primaryExtension ===
|
|
252
|
-
return
|
|
245
|
+
if (primaryExtension === ".gltf") {
|
|
246
|
+
return "GLTF";
|
|
253
247
|
}
|
|
254
248
|
}
|
|
255
249
|
const boxelFile = task.filePaths.boxel;
|
|
256
|
-
if (typeof boxelFile ===
|
|
257
|
-
return
|
|
250
|
+
if (typeof boxelFile === "string" && boxelFile.trim().toLowerCase().endsWith(".boxel.json")) {
|
|
251
|
+
return "PLAYDROP_BOXEL_JSON";
|
|
258
252
|
}
|
|
259
253
|
const meshFile = task.filePaths.mesh;
|
|
260
|
-
if (typeof meshFile ===
|
|
254
|
+
if (typeof meshFile === "string") {
|
|
261
255
|
const meshExtension = (0, node_path_1.extname)(meshFile).toLowerCase();
|
|
262
|
-
if (meshExtension ===
|
|
263
|
-
return
|
|
256
|
+
if (meshExtension === ".glb") {
|
|
257
|
+
return "GLB";
|
|
264
258
|
}
|
|
265
|
-
if (meshExtension ===
|
|
266
|
-
return
|
|
259
|
+
if (meshExtension === ".gltf") {
|
|
260
|
+
return "GLTF";
|
|
267
261
|
}
|
|
268
262
|
}
|
|
269
263
|
throw new Error(`Asset "${task.name}" is missing files.primary or uses an unsupported MODEL_3D primary extension.`);
|
|
@@ -283,8 +277,8 @@ function resolveAssetFormat(task) {
|
|
|
283
277
|
return inferred;
|
|
284
278
|
}
|
|
285
279
|
function validateAssetSubcategoryCompatibility(task, format) {
|
|
286
|
-
const category = typeof task.category ===
|
|
287
|
-
const subcategory = typeof task.subcategory ===
|
|
280
|
+
const category = typeof task.category === "string" ? task.category.trim().toUpperCase() : "";
|
|
281
|
+
const subcategory = typeof task.subcategory === "string" ? task.subcategory.trim().toLowerCase() : "";
|
|
288
282
|
const definition = types_1.ASSET_SUBCATEGORY_DEFINITIONS_BY_KEY[`${category}:${subcategory}`];
|
|
289
283
|
if (!definition) {
|
|
290
284
|
throw new Error(`Asset "${task.name}" uses unsupported subcategory "${task.subcategory}" for category "${task.category}".`);
|
|
@@ -296,7 +290,7 @@ function validateAssetSubcategoryCompatibility(task, format) {
|
|
|
296
290
|
return subcategory;
|
|
297
291
|
}
|
|
298
292
|
async function prepareAssetTaskUploadData(task) {
|
|
299
|
-
if (
|
|
293
|
+
if ("assetSpec" in task && typeof task.assetSpec === "string" && task.assetSpec.trim().length > 0) {
|
|
300
294
|
const uploadFiles = Object.entries(task.filePaths)
|
|
301
295
|
.sort(([leftRole], [rightRole]) => leftRole.localeCompare(rightRole))
|
|
302
296
|
.map(([role, filePath]) => {
|
|
@@ -342,39 +336,39 @@ async function uploadAssetTask(client, task, sourceAppVersionId, creatorUsername
|
|
|
342
336
|
fieldName: entry.fieldName,
|
|
343
337
|
filename: entry.filename,
|
|
344
338
|
}));
|
|
345
|
-
const targetCreatorUsername = typeof creatorUsername ===
|
|
339
|
+
const targetCreatorUsername = typeof creatorUsername === "string" ? creatorUsername.trim() : "";
|
|
346
340
|
if (!targetCreatorUsername) {
|
|
347
341
|
throw new Error(`Asset "${task.name}" upload is missing creator username.`);
|
|
348
342
|
}
|
|
349
343
|
const response = await client.createAssetVersion(targetCreatorUsername, task.name, prepared.assetSpec
|
|
350
344
|
? {
|
|
351
|
-
displayName: task.kind ===
|
|
345
|
+
displayName: task.kind === "asset" ? task.displayName : undefined,
|
|
352
346
|
assetSpec: prepared.assetSpec,
|
|
353
|
-
remixRef: task.kind ===
|
|
347
|
+
remixRef: task.kind === "asset" ? task.remix : undefined,
|
|
354
348
|
visibility: visibility,
|
|
355
349
|
license: task.license,
|
|
356
|
-
sourceKind: sourceAppVersionId ?
|
|
350
|
+
sourceKind: sourceAppVersionId ? "APP_EMBEDDED" : "UPLOAD",
|
|
357
351
|
sourceAppVersionId,
|
|
358
|
-
runtimeKey: task.kind ===
|
|
359
|
-
tags: task.kind ===
|
|
360
|
-
clearTags: task.kind ===
|
|
352
|
+
runtimeKey: task.kind === "owned-asset" ? task.runtimeKey : undefined,
|
|
353
|
+
tags: task.kind === "asset" ? task.tags : undefined,
|
|
354
|
+
clearTags: task.kind === "asset" || task.kind === "owned-asset" ? options?.clearTags : undefined,
|
|
361
355
|
shopListed: task.shopListed,
|
|
362
356
|
shopPriceCredits: task.shopPriceCredits,
|
|
363
357
|
files,
|
|
364
358
|
}
|
|
365
359
|
: {
|
|
366
|
-
displayName: task.kind ===
|
|
360
|
+
displayName: task.kind === "asset" ? task.displayName : undefined,
|
|
367
361
|
category: task.category,
|
|
368
362
|
subcategory: prepared.subcategory,
|
|
369
363
|
format: prepared.format,
|
|
370
|
-
remixRef: task.kind ===
|
|
364
|
+
remixRef: task.kind === "asset" ? task.remix : undefined,
|
|
371
365
|
visibility: visibility,
|
|
372
366
|
license: task.license,
|
|
373
|
-
sourceKind: sourceAppVersionId ?
|
|
367
|
+
sourceKind: sourceAppVersionId ? "APP_EMBEDDED" : "UPLOAD",
|
|
374
368
|
sourceAppVersionId,
|
|
375
|
-
runtimeKey: task.kind ===
|
|
376
|
-
tags: task.kind ===
|
|
377
|
-
clearTags: task.kind ===
|
|
369
|
+
runtimeKey: task.kind === "owned-asset" ? task.runtimeKey : undefined,
|
|
370
|
+
tags: task.kind === "asset" ? task.tags : undefined,
|
|
371
|
+
clearTags: task.kind === "asset" || task.kind === "owned-asset" ? options?.clearTags : undefined,
|
|
378
372
|
shopListed: task.shopListed,
|
|
379
373
|
shopPriceCredits: task.shopPriceCredits,
|
|
380
374
|
files,
|
|
@@ -382,8 +376,8 @@ async function uploadAssetTask(client, task, sourceAppVersionId, creatorUsername
|
|
|
382
376
|
const uploadedCreatorUsername = response.asset.creatorUsername;
|
|
383
377
|
const name = response.asset.name;
|
|
384
378
|
const revision = response.version.revision;
|
|
385
|
-
const versionNodeId = typeof response.versionNodeId ===
|
|
386
|
-
if (typeof uploadedCreatorUsername !==
|
|
379
|
+
const versionNodeId = typeof response.versionNodeId === "string" ? response.versionNodeId.trim() : "";
|
|
380
|
+
if (typeof uploadedCreatorUsername !== "string" || uploadedCreatorUsername.trim().length === 0) {
|
|
387
381
|
throw new Error(`Asset "${task.name}" upload did not return creatorUsername.`);
|
|
388
382
|
}
|
|
389
383
|
if (!versionNodeId) {
|
|
@@ -398,14 +392,14 @@ async function uploadAssetTask(client, task, sourceAppVersionId, creatorUsername
|
|
|
398
392
|
};
|
|
399
393
|
}
|
|
400
394
|
async function uploadAssetSpecTask(client, task, creatorUsername) {
|
|
401
|
-
const targetCreatorUsername = typeof creatorUsername ===
|
|
395
|
+
const targetCreatorUsername = typeof creatorUsername === "string" ? creatorUsername.trim() : "";
|
|
402
396
|
if (!targetCreatorUsername) {
|
|
403
397
|
throw new Error(`Asset spec "${task.name}@${task.version}" upload is missing creator username.`);
|
|
404
398
|
}
|
|
405
|
-
const symbol = prepareUploadFile(task.symbolPath,
|
|
406
|
-
const contract = prepareUploadFile(task.contractPath,
|
|
399
|
+
const symbol = prepareUploadFile(task.symbolPath, "symbol", "image/svg+xml");
|
|
400
|
+
const contract = prepareUploadFile(task.contractPath, "contract", "application/json");
|
|
407
401
|
const documentation = task.documentationPath
|
|
408
|
-
? prepareUploadFile(task.documentationPath,
|
|
402
|
+
? prepareUploadFile(task.documentationPath, "documentation", "text/markdown")
|
|
409
403
|
: null;
|
|
410
404
|
await client.createAssetSpecVersion(targetCreatorUsername, task.name, {
|
|
411
405
|
version: task.version,
|
|
@@ -449,16 +443,16 @@ function parseAssetRef(raw) {
|
|
|
449
443
|
async function resolveAssetReference(client, rawRef, fallbackCreator, uploadedAssets) {
|
|
450
444
|
const trimmed = rawRef.trim();
|
|
451
445
|
if (!trimmed) {
|
|
452
|
-
throw new Error(
|
|
446
|
+
throw new Error("Asset pack has an empty asset reference.");
|
|
453
447
|
}
|
|
454
448
|
const parsed = parseAssetRef(trimmed);
|
|
455
449
|
if (parsed) {
|
|
456
450
|
return `asset:${parsed.creatorUsername}/${parsed.name}@r${parsed.revision}`;
|
|
457
451
|
}
|
|
458
|
-
if (trimmed.includes(
|
|
452
|
+
if (trimmed.includes("@")) {
|
|
459
453
|
throw new Error(`Invalid asset ref "${trimmed}". Use "asset:creator/name@rN" format.`);
|
|
460
454
|
}
|
|
461
|
-
const slashIndex = trimmed.indexOf(
|
|
455
|
+
const slashIndex = trimmed.indexOf("/");
|
|
462
456
|
const creatorUsername = slashIndex > 0 ? trimmed.slice(0, slashIndex) : fallbackCreator;
|
|
463
457
|
const name = slashIndex > 0 ? trimmed.slice(slashIndex + 1) : trimmed;
|
|
464
458
|
if (!creatorUsername || !name) {
|
|
@@ -471,13 +465,17 @@ async function resolveAssetReference(client, rawRef, fallbackCreator, uploadedAs
|
|
|
471
465
|
}
|
|
472
466
|
const detail = await client.fetchAssetBySlug(creatorUsername, name);
|
|
473
467
|
const revision = detail?.asset?.currentVersion?.revision;
|
|
474
|
-
if (typeof revision !==
|
|
468
|
+
if (typeof revision !== "number" || !Number.isInteger(revision) || revision <= 0) {
|
|
475
469
|
throw new Error(`Asset "${creatorUsername}/${name}" has no current version to reference from asset pack.`);
|
|
476
470
|
}
|
|
477
471
|
return `asset:${creatorUsername}/${name}@r${revision}`;
|
|
478
472
|
}
|
|
479
473
|
function shouldAbortPackUploadOnError(error) {
|
|
480
|
-
return error instanceof types_1.ApiError &&
|
|
474
|
+
return (error instanceof types_1.ApiError &&
|
|
475
|
+
error.status >= 400 &&
|
|
476
|
+
error.status < 500 &&
|
|
477
|
+
error.status !== 408 &&
|
|
478
|
+
error.status !== 429);
|
|
481
479
|
}
|
|
482
480
|
function describeError(error) {
|
|
483
481
|
if (error instanceof Error && error.message.trim().length > 0) {
|
|
@@ -527,7 +525,9 @@ async function buildPackMembersAndExistingAssets(client, task, mutationCreatorUs
|
|
|
527
525
|
const ownedAssetNames = new Set(task.ownedAssets.map((asset) => asset.name));
|
|
528
526
|
for (const rawRef of task.assets) {
|
|
529
527
|
const localCandidate = parseUnversionedAssetTaskRef(rawRef, mutationCreatorUsername);
|
|
530
|
-
if (localCandidate &&
|
|
528
|
+
if (localCandidate &&
|
|
529
|
+
localCandidate.creatorUsername === mutationCreatorUsername &&
|
|
530
|
+
ownedAssetNames.has(localCandidate.name)) {
|
|
531
531
|
const localAssetKey = buildAssetKey(localCandidate.creatorUsername, localCandidate.name);
|
|
532
532
|
const localUploadKey = uploadKeyByAssetKey.get(localAssetKey);
|
|
533
533
|
if (localUploadKey) {
|
|
@@ -549,25 +549,25 @@ async function buildPackMembersAndExistingAssets(client, task, mutationCreatorUs
|
|
|
549
549
|
function buildPackListingUploads(task) {
|
|
550
550
|
const listingUploads = [];
|
|
551
551
|
if (task.listing?.iconPath) {
|
|
552
|
-
listingUploads.push(prepareListingMediaUpload(
|
|
552
|
+
listingUploads.push(prepareListingMediaUpload("icon", task.listing.iconPath, "image/png"));
|
|
553
553
|
}
|
|
554
554
|
if (task.listing?.heroPortraitPath) {
|
|
555
|
-
listingUploads.push(prepareListingMediaUpload(
|
|
555
|
+
listingUploads.push(prepareListingMediaUpload("heroPortrait", task.listing.heroPortraitPath, "image/png"));
|
|
556
556
|
}
|
|
557
557
|
if (task.listing?.heroLandscapePath) {
|
|
558
|
-
listingUploads.push(prepareListingMediaUpload(
|
|
558
|
+
listingUploads.push(prepareListingMediaUpload("heroLandscape", task.listing.heroLandscapePath, "image/png"));
|
|
559
559
|
}
|
|
560
560
|
task.listing?.screenshotPortraitPaths.forEach((filePath, index) => {
|
|
561
|
-
listingUploads.push(prepareListingMediaUpload(`screenshotsPortrait:${index}`, filePath,
|
|
561
|
+
listingUploads.push(prepareListingMediaUpload(`screenshotsPortrait:${index}`, filePath, "image/png"));
|
|
562
562
|
});
|
|
563
563
|
task.listing?.screenshotLandscapePaths.forEach((filePath, index) => {
|
|
564
|
-
listingUploads.push(prepareListingMediaUpload(`screenshotsLandscape:${index}`, filePath,
|
|
564
|
+
listingUploads.push(prepareListingMediaUpload(`screenshotsLandscape:${index}`, filePath, "image/png"));
|
|
565
565
|
});
|
|
566
566
|
task.listing?.videoPortraitPaths.forEach((filePath, index) => {
|
|
567
|
-
listingUploads.push(prepareListingMediaUpload(`videosPortrait:${index}`, filePath,
|
|
567
|
+
listingUploads.push(prepareListingMediaUpload(`videosPortrait:${index}`, filePath, "video/mp4"));
|
|
568
568
|
});
|
|
569
569
|
task.listing?.videoLandscapePaths.forEach((filePath, index) => {
|
|
570
|
-
listingUploads.push(prepareListingMediaUpload(`videosLandscape:${index}`, filePath,
|
|
570
|
+
listingUploads.push(prepareListingMediaUpload(`videosLandscape:${index}`, filePath, "video/mp4"));
|
|
571
571
|
});
|
|
572
572
|
return listingUploads;
|
|
573
573
|
}
|
|
@@ -576,13 +576,21 @@ function buildPackListingPayload(listingUploads) {
|
|
|
576
576
|
return undefined;
|
|
577
577
|
}
|
|
578
578
|
return {
|
|
579
|
-
icon: listingUploads.find((entry) => entry.mediaKey ===
|
|
580
|
-
heroPortrait: listingUploads.find((entry) => entry.mediaKey ===
|
|
581
|
-
heroLandscape: listingUploads.find((entry) => entry.mediaKey ===
|
|
582
|
-
screenshotsPortrait: listingUploads
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
579
|
+
icon: listingUploads.find((entry) => entry.mediaKey === "icon")?.entry,
|
|
580
|
+
heroPortrait: listingUploads.find((entry) => entry.mediaKey === "heroPortrait")?.entry,
|
|
581
|
+
heroLandscape: listingUploads.find((entry) => entry.mediaKey === "heroLandscape")?.entry,
|
|
582
|
+
screenshotsPortrait: listingUploads
|
|
583
|
+
.filter((entry) => entry.mediaKey.startsWith("screenshotsPortrait:"))
|
|
584
|
+
.map((entry) => entry.entry),
|
|
585
|
+
screenshotsLandscape: listingUploads
|
|
586
|
+
.filter((entry) => entry.mediaKey.startsWith("screenshotsLandscape:"))
|
|
587
|
+
.map((entry) => entry.entry),
|
|
588
|
+
videosPortrait: listingUploads
|
|
589
|
+
.filter((entry) => entry.mediaKey.startsWith("videosPortrait:"))
|
|
590
|
+
.map((entry) => entry.entry),
|
|
591
|
+
videosLandscape: listingUploads
|
|
592
|
+
.filter((entry) => entry.mediaKey.startsWith("videosLandscape:"))
|
|
593
|
+
.map((entry) => entry.entry),
|
|
586
594
|
};
|
|
587
595
|
}
|
|
588
596
|
function buildPackInitializeRequest(task, ownedAssets, existingAssets, members, listingUploads, options) {
|
|
@@ -648,7 +656,7 @@ async function uploadAssetPackTask(client, task, creatorUsername, uploadedAssets
|
|
|
648
656
|
const listingUploads = buildPackListingUploads(task);
|
|
649
657
|
const initializeBody = buildPackInitializeRequest(task, ownedAssets, existingAssets, members, listingUploads, options);
|
|
650
658
|
const initializeResponse = await client.initializeAssetPackUpload(mutationCreatorUsername, task.name, initializeBody);
|
|
651
|
-
if (initializeResponse.status ===
|
|
659
|
+
if (initializeResponse.status === "finalized") {
|
|
652
660
|
if (!initializeResponse.versionNodeId || !initializeResponse.version) {
|
|
653
661
|
throw new Error(`Asset pack "${task.name}" finalize response is missing version details.`);
|
|
654
662
|
}
|
|
@@ -658,7 +666,7 @@ async function uploadAssetPackTask(client, task, creatorUsername, uploadedAssets
|
|
|
658
666
|
try {
|
|
659
667
|
await uploadPendingPackSessionEntries(client, task, mutationCreatorUsername, sessionId, preparedLocalAssets, new Set(initializeResponse.session.uploadedAssetKeys), listingUploads, new Set(initializeResponse.session.uploadedMediaKeys));
|
|
660
668
|
const finalizedResponse = await client.finalizeAssetPackUpload(mutationCreatorUsername, task.name, sessionId);
|
|
661
|
-
const versionNodeId = typeof finalizedResponse.versionNodeId ===
|
|
669
|
+
const versionNodeId = typeof finalizedResponse.versionNodeId === "string" ? finalizedResponse.versionNodeId.trim() : "";
|
|
662
670
|
if (!versionNodeId) {
|
|
663
671
|
throw new Error(`Asset pack "${task.name}@${task.version}" upload did not return versionNodeId.`);
|
|
664
672
|
}
|