@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/commands/upload.js
CHANGED
|
@@ -50,7 +50,7 @@ function resolveCatalogueWorkspaceRoot(startPath) {
|
|
|
50
50
|
if (parentDir === currentDir) {
|
|
51
51
|
return currentDir;
|
|
52
52
|
}
|
|
53
|
-
const parentCataloguePath = (0, node_path_1.join)(parentDir,
|
|
53
|
+
const parentCataloguePath = (0, node_path_1.join)(parentDir, "catalogue.json");
|
|
54
54
|
if (!(0, node_fs_1.existsSync)(parentCataloguePath)) {
|
|
55
55
|
return currentDir;
|
|
56
56
|
}
|
|
@@ -58,28 +58,28 @@ function resolveCatalogueWorkspaceRoot(startPath) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function resolveUploadWorkspaceRoot(pathOrName, resolution) {
|
|
61
|
-
if (resolution ===
|
|
61
|
+
if (resolution === "name") {
|
|
62
62
|
return resolveCatalogueWorkspaceRoot(process.cwd());
|
|
63
63
|
}
|
|
64
64
|
return resolveCatalogueWorkspaceRoot(pathOrName);
|
|
65
65
|
}
|
|
66
66
|
function buildTagGroupLogEntry(status, entityId, detail) {
|
|
67
67
|
return {
|
|
68
|
-
action:
|
|
68
|
+
action: "upload",
|
|
69
69
|
status,
|
|
70
|
-
entityType:
|
|
70
|
+
entityType: "tag-group",
|
|
71
71
|
entityId,
|
|
72
|
-
catalogue:
|
|
72
|
+
catalogue: "catalogue:tag-groups",
|
|
73
73
|
detail,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
function buildTagLogEntry(status, entityId, detail) {
|
|
77
77
|
return {
|
|
78
|
-
action:
|
|
78
|
+
action: "upload",
|
|
79
79
|
status,
|
|
80
|
-
entityType:
|
|
80
|
+
entityType: "tag",
|
|
81
81
|
entityId,
|
|
82
|
-
catalogue:
|
|
82
|
+
catalogue: "catalogue:tag-groups",
|
|
83
83
|
detail,
|
|
84
84
|
};
|
|
85
85
|
}
|
|
@@ -103,10 +103,10 @@ async function syncTagGroupsFromCatalogue(client, groups) {
|
|
|
103
103
|
tags: [],
|
|
104
104
|
};
|
|
105
105
|
liveGroupsBySlug.set(liveGroup.slug, liveGroup);
|
|
106
|
-
entries.push(buildTagGroupLogEntry(
|
|
106
|
+
entries.push(buildTagGroupLogEntry("success", liveGroup.slug, `created "${liveGroup.displayName}"`));
|
|
107
107
|
}
|
|
108
|
-
else if (liveGroup.displayName !== groupDefinition.displayName
|
|
109
|
-
|
|
108
|
+
else if (liveGroup.displayName !== groupDefinition.displayName ||
|
|
109
|
+
!sameSavedItemKinds(liveGroup.allowedTargetKinds, groupDefinition.allowedTargetKinds)) {
|
|
110
110
|
const updated = await client.updateAdminTagGroup(groupDefinition.slug, {
|
|
111
111
|
displayName: groupDefinition.displayName,
|
|
112
112
|
allowedTargetKinds: normalizeSavedItemKinds(groupDefinition.allowedTargetKinds),
|
|
@@ -116,7 +116,7 @@ async function syncTagGroupsFromCatalogue(client, groups) {
|
|
|
116
116
|
tags: liveGroup.tags,
|
|
117
117
|
};
|
|
118
118
|
liveGroupsBySlug.set(liveGroup.slug, liveGroup);
|
|
119
|
-
entries.push(buildTagGroupLogEntry(
|
|
119
|
+
entries.push(buildTagGroupLogEntry("success", liveGroup.slug, `updated "${liveGroup.displayName}"`));
|
|
120
120
|
}
|
|
121
121
|
if (!liveGroup) {
|
|
122
122
|
throw new Error(`tag_group_sync_failed:${groupDefinition.slug}`);
|
|
@@ -131,7 +131,7 @@ async function syncTagGroupsFromCatalogue(client, groups) {
|
|
|
131
131
|
displayName: tagDefinition.displayName,
|
|
132
132
|
});
|
|
133
133
|
liveTagsBySlug.set(created.tag.slug, created.tag);
|
|
134
|
-
entries.push(buildTagLogEntry(
|
|
134
|
+
entries.push(buildTagLogEntry("success", tagRef, `created "${created.tag.displayName}"`));
|
|
135
135
|
continue;
|
|
136
136
|
}
|
|
137
137
|
if (liveTag.displayName !== tagDefinition.displayName) {
|
|
@@ -139,25 +139,25 @@ async function syncTagGroupsFromCatalogue(client, groups) {
|
|
|
139
139
|
displayName: tagDefinition.displayName,
|
|
140
140
|
});
|
|
141
141
|
liveTagsBySlug.set(updated.tag.slug, updated.tag);
|
|
142
|
-
entries.push(buildTagLogEntry(
|
|
142
|
+
entries.push(buildTagLogEntry("success", tagRef, `updated "${updated.tag.displayName}"`));
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
return entries;
|
|
147
147
|
}
|
|
148
148
|
function buildApiUnavailableMessage(apiBase) {
|
|
149
|
-
if (apiBase && typeof apiBase ===
|
|
149
|
+
if (apiBase && typeof apiBase === "string") {
|
|
150
150
|
return `Could not reach the Playdrop API at ${apiBase}. Check your internet connection, then ensure the server is running before retrying.`;
|
|
151
151
|
}
|
|
152
|
-
return
|
|
152
|
+
return "Could not reach the Playdrop API. Check your internet connection, then ensure the server is running before retrying.";
|
|
153
153
|
}
|
|
154
154
|
function isConnectionRefusedError(error) {
|
|
155
155
|
const networkCode = error?.cause?.code;
|
|
156
|
-
if (error instanceof TypeError || networkCode ===
|
|
156
|
+
if (error instanceof TypeError || networkCode === "ECONNREFUSED") {
|
|
157
157
|
return true;
|
|
158
158
|
}
|
|
159
159
|
const aggregateErrors = error?.cause?.errors;
|
|
160
|
-
return Array.isArray(aggregateErrors) && aggregateErrors.some((entry) => entry?.code ===
|
|
160
|
+
return Array.isArray(aggregateErrors) && aggregateErrors.some((entry) => entry?.code === "ECONNREFUSED");
|
|
161
161
|
}
|
|
162
162
|
async function fetchCurrentUserInfo(client, apiBase) {
|
|
163
163
|
try {
|
|
@@ -170,7 +170,7 @@ async function fetchCurrentUserInfo(client, apiBase) {
|
|
|
170
170
|
}
|
|
171
171
|
catch (error) {
|
|
172
172
|
if (error instanceof types_1.UnsupportedClientError) {
|
|
173
|
-
(0, http_1.handleUnsupportedError)(error,
|
|
173
|
+
(0, http_1.handleUnsupportedError)(error, "Upload");
|
|
174
174
|
return { username: null, role: null, user: null };
|
|
175
175
|
}
|
|
176
176
|
if (error instanceof http_1.CLIUnsupportedClientError) {
|
|
@@ -192,23 +192,21 @@ function normalizeCreatorUsername(username) {
|
|
|
192
192
|
if (!username)
|
|
193
193
|
return null;
|
|
194
194
|
const trimmed = username.trim();
|
|
195
|
-
if (!trimmed || trimmed.toLowerCase() ===
|
|
195
|
+
if (!trimmed || trimmed.toLowerCase() === "unknown") {
|
|
196
196
|
return null;
|
|
197
197
|
}
|
|
198
198
|
return trimmed;
|
|
199
199
|
}
|
|
200
200
|
function resolveUploadOwner(actorUsername, workspaceOwnerUsername) {
|
|
201
|
-
const workspaceOwner = workspaceOwnerUsername?.trim() ??
|
|
201
|
+
const workspaceOwner = workspaceOwnerUsername?.trim() ?? "";
|
|
202
202
|
if (workspaceOwner) {
|
|
203
203
|
return workspaceOwner;
|
|
204
204
|
}
|
|
205
|
-
const actor = actorUsername?.trim() ??
|
|
206
|
-
return actor ||
|
|
205
|
+
const actor = actorUsername?.trim() ?? "";
|
|
206
|
+
return actor || "unknown";
|
|
207
207
|
}
|
|
208
208
|
function resolveDefaultUploadCreator(owner, actorUsername) {
|
|
209
|
-
return normalizeCreatorUsername(owner ?? null)
|
|
210
|
-
?? normalizeCreatorUsername(actorUsername ?? null)
|
|
211
|
-
?? 'unknown';
|
|
209
|
+
return normalizeCreatorUsername(owner ?? null) ?? normalizeCreatorUsername(actorUsername ?? null) ?? "unknown";
|
|
212
210
|
}
|
|
213
211
|
function isNotFoundApiError(error) {
|
|
214
212
|
return error instanceof types_1.ApiError && error.status === 404;
|
|
@@ -222,20 +220,20 @@ function createRemoteDependencyCache() {
|
|
|
222
220
|
};
|
|
223
221
|
}
|
|
224
222
|
function createTaskExecutionId(task, creator, index) {
|
|
225
|
-
if (task.kind ===
|
|
223
|
+
if (task.kind === "asset-spec") {
|
|
226
224
|
return `${index}:${task.kind}:${creator}/${task.name}@${task.version}`;
|
|
227
225
|
}
|
|
228
|
-
if (task.kind ===
|
|
226
|
+
if (task.kind === "asset-pack") {
|
|
229
227
|
return `${index}:${task.kind}:${creator}/${task.name}@${task.version}`;
|
|
230
228
|
}
|
|
231
|
-
if (task.kind ===
|
|
229
|
+
if (task.kind === "owned-asset") {
|
|
232
230
|
return `${index}:${task.kind}:${creator}/${task.appName}:${task.name}`;
|
|
233
231
|
}
|
|
234
232
|
return `${index}:${task.kind}:${creator}/${task.name}`;
|
|
235
233
|
}
|
|
236
234
|
function buildTaskDetailEntry(task, entityId, status, detail) {
|
|
237
235
|
return {
|
|
238
|
-
action:
|
|
236
|
+
action: "upload",
|
|
239
237
|
status,
|
|
240
238
|
entityType: task.kind,
|
|
241
239
|
entityId,
|
|
@@ -244,10 +242,10 @@ function buildTaskDetailEntry(task, entityId, status, detail) {
|
|
|
244
242
|
};
|
|
245
243
|
}
|
|
246
244
|
function buildTaskDirectErrorEntry(task, entityId, detail) {
|
|
247
|
-
return buildTaskDetailEntry(task, entityId,
|
|
245
|
+
return buildTaskDetailEntry(task, entityId, "error", detail.startsWith("upload failed:") ? detail : `upload failed: ${detail}`);
|
|
248
246
|
}
|
|
249
247
|
function buildTaskBlockedEntry(task, entityId, detail) {
|
|
250
|
-
return buildTaskDetailEntry(task, entityId,
|
|
248
|
+
return buildTaskDetailEntry(task, entityId, "blocked", detail);
|
|
251
249
|
}
|
|
252
250
|
function buildAssetSpecFamilyKey(creatorUsername, name) {
|
|
253
251
|
return `${creatorUsername}/${name}`;
|
|
@@ -279,7 +277,7 @@ function pickCompatibleLocalAssetSpecTask(candidates, versionRange) {
|
|
|
279
277
|
if (!candidates || candidates.length === 0) {
|
|
280
278
|
return null;
|
|
281
279
|
}
|
|
282
|
-
const matching = candidates.filter((candidate) =>
|
|
280
|
+
const matching = candidates.filter((candidate) => candidate.task.kind === "asset-spec" && (0, semver_1.satisfies)(candidate.task.version, versionRange));
|
|
283
281
|
if (matching.length === 0) {
|
|
284
282
|
return null;
|
|
285
283
|
}
|
|
@@ -337,7 +335,7 @@ async function validateRemoteAssetVersionExists(client, rawRef, cache) {
|
|
|
337
335
|
return cache.assetVersionExists.get(rawRef);
|
|
338
336
|
}
|
|
339
337
|
const parsed = (0, types_1.parseContentVersionRef)(rawRef);
|
|
340
|
-
if (!parsed || parsed.kind !==
|
|
338
|
+
if (!parsed || parsed.kind !== "asset") {
|
|
341
339
|
cache.assetVersionExists.set(rawRef, false);
|
|
342
340
|
return false;
|
|
343
341
|
}
|
|
@@ -365,7 +363,7 @@ async function validateRemotePackVersionExists(client, rawRef, cache) {
|
|
|
365
363
|
return cache.packVersionExists.get(rawRef);
|
|
366
364
|
}
|
|
367
365
|
const parsed = (0, types_1.parseContentVersionRef)(rawRef);
|
|
368
|
-
if (!parsed || parsed.kind !==
|
|
366
|
+
if (!parsed || parsed.kind !== "pack") {
|
|
369
367
|
cache.packVersionExists.set(rawRef, false);
|
|
370
368
|
return false;
|
|
371
369
|
}
|
|
@@ -396,7 +394,7 @@ function addLocalDependency(node, dependencyTaskId, ref) {
|
|
|
396
394
|
}
|
|
397
395
|
function normalizePackDependencyRef(rawRef) {
|
|
398
396
|
const parsed = (0, types_1.parseContentVersionRef)(rawRef);
|
|
399
|
-
if (!parsed || parsed.kind !==
|
|
397
|
+
if (!parsed || parsed.kind !== "pack") {
|
|
400
398
|
return null;
|
|
401
399
|
}
|
|
402
400
|
return (0, types_1.formatContentVersionRef)(parsed);
|
|
@@ -437,7 +435,7 @@ async function buildRemoteTagRegistry(client) {
|
|
|
437
435
|
let offset = 0;
|
|
438
436
|
while (offset < tagCount || (tagCount === 0 && offset === 0)) {
|
|
439
437
|
const response = await client.fetchTagGroup(groupSlug, {
|
|
440
|
-
sort:
|
|
438
|
+
sort: "alpha",
|
|
441
439
|
limit: 200,
|
|
442
440
|
...(offset > 0 ? { offset } : {}),
|
|
443
441
|
});
|
|
@@ -475,14 +473,14 @@ async function buildUploadTagRegistry(client, localGroups) {
|
|
|
475
473
|
}
|
|
476
474
|
function validateTagRefsForTarget(tagRegistry, target) {
|
|
477
475
|
for (const rawTagRef of target.tags) {
|
|
478
|
-
let normalizedRef =
|
|
476
|
+
let normalizedRef = "";
|
|
479
477
|
try {
|
|
480
478
|
normalizedRef = (0, types_1.normalizeTagRef)(rawTagRef);
|
|
481
479
|
}
|
|
482
480
|
catch {
|
|
483
|
-
return `invalid_tag_ref:${String(rawTagRef ??
|
|
481
|
+
return `invalid_tag_ref:${String(rawTagRef ?? "").trim() || String(rawTagRef ?? "")}`;
|
|
484
482
|
}
|
|
485
|
-
const [groupSlug, tagSlug] = normalizedRef.split(
|
|
483
|
+
const [groupSlug, tagSlug] = normalizedRef.split("/");
|
|
486
484
|
if (!groupSlug || !tagSlug) {
|
|
487
485
|
return `invalid_tag_ref:${normalizedRef}`;
|
|
488
486
|
}
|
|
@@ -490,38 +488,37 @@ function validateTagRefsForTarget(tagRegistry, target) {
|
|
|
490
488
|
if (!registryEntry || !registryEntry.tags.has(tagSlug)) {
|
|
491
489
|
return `unknown_tag_ref:${normalizedRef}`;
|
|
492
490
|
}
|
|
493
|
-
if (registryEntry.allowedTargetKinds.length > 0
|
|
494
|
-
&& !registryEntry.allowedTargetKinds.includes(target.targetKind)) {
|
|
491
|
+
if (registryEntry.allowedTargetKinds.length > 0 && !registryEntry.allowedTargetKinds.includes(target.targetKind)) {
|
|
495
492
|
return `tag_not_allowed_for_target_kind:${normalizedRef}:${target.targetKind}`;
|
|
496
493
|
}
|
|
497
494
|
}
|
|
498
495
|
return null;
|
|
499
496
|
}
|
|
500
497
|
function collectTaskTagValidationTargets(task) {
|
|
501
|
-
if (task.kind ===
|
|
498
|
+
if (task.kind === "app") {
|
|
502
499
|
return [
|
|
503
500
|
{
|
|
504
501
|
tags: Array.from(new Set([...task.tags, ...Object.values(task.design ?? {})])),
|
|
505
|
-
targetKind:
|
|
502
|
+
targetKind: "APP",
|
|
506
503
|
},
|
|
507
504
|
...task.ownedAssets.map((ownedAsset) => ({
|
|
508
505
|
tags: ownedAsset.tags,
|
|
509
|
-
targetKind:
|
|
506
|
+
targetKind: "ASSET",
|
|
510
507
|
})),
|
|
511
508
|
];
|
|
512
509
|
}
|
|
513
|
-
if (task.kind ===
|
|
514
|
-
return [{ tags: task.tags, targetKind:
|
|
510
|
+
if (task.kind === "asset") {
|
|
511
|
+
return [{ tags: task.tags, targetKind: "ASSET" }];
|
|
515
512
|
}
|
|
516
|
-
if (task.kind ===
|
|
517
|
-
return [{ tags: task.tags, targetKind:
|
|
513
|
+
if (task.kind === "owned-asset") {
|
|
514
|
+
return [{ tags: task.tags, targetKind: "ASSET" }];
|
|
518
515
|
}
|
|
519
|
-
if (task.kind ===
|
|
516
|
+
if (task.kind === "asset-pack") {
|
|
520
517
|
return [
|
|
521
|
-
{ tags: task.tags, targetKind:
|
|
518
|
+
{ tags: task.tags, targetKind: "PACK" },
|
|
522
519
|
...task.ownedAssets.map((ownedAsset) => ({
|
|
523
520
|
tags: ownedAsset.tags,
|
|
524
|
-
targetKind:
|
|
521
|
+
targetKind: "ASSET",
|
|
525
522
|
})),
|
|
526
523
|
];
|
|
527
524
|
}
|
|
@@ -559,23 +556,21 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
559
556
|
const assetTasksByKey = new Map();
|
|
560
557
|
const packTasksByKey = new Map();
|
|
561
558
|
for (const { node } of nodes) {
|
|
562
|
-
if (node.task.kind ===
|
|
559
|
+
if (node.task.kind === "asset-spec") {
|
|
563
560
|
pushIndexedNode(assetSpecVersionTasksByKey, buildAssetSpecVersionKey(node.creator, node.task.name, node.task.version), node);
|
|
564
561
|
pushIndexedNode(assetSpecFamilyTasksByKey, buildAssetSpecFamilyKey(node.creator, node.task.name), node);
|
|
565
562
|
continue;
|
|
566
563
|
}
|
|
567
|
-
if (node.task.kind ===
|
|
564
|
+
if (node.task.kind === "asset") {
|
|
568
565
|
pushIndexedNode(assetTasksByKey, (0, upload_content_1.buildAssetKey)(node.creator, node.task.name), node);
|
|
569
566
|
continue;
|
|
570
567
|
}
|
|
571
|
-
if (node.task.kind ===
|
|
568
|
+
if (node.task.kind === "asset-pack") {
|
|
572
569
|
pushIndexedNode(packTasksByKey, (0, upload_content_1.buildPackKey)(node.creator, node.task.name, node.task.version), node);
|
|
573
570
|
}
|
|
574
571
|
}
|
|
575
572
|
const remoteCache = createRemoteDependencyCache();
|
|
576
|
-
const tagRegistry = tasksRequireTagValidation(tasks)
|
|
577
|
-
? await buildUploadTagRegistry(client, localTagGroups)
|
|
578
|
-
: null;
|
|
573
|
+
const tagRegistry = tasksRequireTagValidation(tasks) ? await buildUploadTagRegistry(client, localTagGroups) : null;
|
|
579
574
|
const initialStatusByTaskId = new Map(initialEntries.map((entry) => [entry.taskId, entry.entry.status]));
|
|
580
575
|
for (const { node } of nodes) {
|
|
581
576
|
if (initialStatusByTaskId.has(node.id)) {
|
|
@@ -590,7 +585,7 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
590
585
|
}
|
|
591
586
|
}
|
|
592
587
|
}
|
|
593
|
-
if (!blockedDetail && node.task.kind ===
|
|
588
|
+
if (!blockedDetail && node.task.kind === "asset" && node.task.assetSpec) {
|
|
594
589
|
const parsedAssetSpec = (0, types_1.parseAssetSpecVersionRef)(node.task.assetSpec);
|
|
595
590
|
if (!parsedAssetSpec) {
|
|
596
591
|
blockedDetail = `dependency_invalid:${node.task.assetSpec}`;
|
|
@@ -609,7 +604,7 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
609
604
|
}
|
|
610
605
|
}
|
|
611
606
|
}
|
|
612
|
-
if (!blockedDetail && node.task.kind ===
|
|
607
|
+
if (!blockedDetail && node.task.kind === "app") {
|
|
613
608
|
for (const support of node.task.assetSpecSupport) {
|
|
614
609
|
const parsedFamily = (0, types_1.parseAssetSpecFamilyRef)(support.assetSpec);
|
|
615
610
|
if (!parsedFamily) {
|
|
@@ -629,10 +624,10 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
629
624
|
}
|
|
630
625
|
}
|
|
631
626
|
}
|
|
632
|
-
if (!blockedDetail && node.task.kind ===
|
|
627
|
+
if (!blockedDetail && node.task.kind === "app") {
|
|
633
628
|
for (const assetDependency of node.task.uses.assets) {
|
|
634
629
|
const parsedAsset = (0, types_1.parseContentVersionRef)(assetDependency.ref);
|
|
635
|
-
if (!parsedAsset || parsedAsset.kind !==
|
|
630
|
+
if (!parsedAsset || parsedAsset.kind !== "asset") {
|
|
636
631
|
blockedDetail = `dependency_invalid:${assetDependency.ref}`;
|
|
637
632
|
break;
|
|
638
633
|
}
|
|
@@ -654,7 +649,7 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
654
649
|
}
|
|
655
650
|
}
|
|
656
651
|
}
|
|
657
|
-
if (!blockedDetail && node.task.kind ===
|
|
652
|
+
if (!blockedDetail && node.task.kind === "app") {
|
|
658
653
|
for (const rawPackRef of node.task.uses.packs) {
|
|
659
654
|
const normalizedPackRef = normalizePackDependencyRef(rawPackRef);
|
|
660
655
|
if (!normalizedPackRef) {
|
|
@@ -662,7 +657,7 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
662
657
|
break;
|
|
663
658
|
}
|
|
664
659
|
const parsedPack = (0, types_1.parseContentVersionRef)(normalizedPackRef);
|
|
665
|
-
if (!parsedPack || parsedPack.kind !==
|
|
660
|
+
if (!parsedPack || parsedPack.kind !== "pack") {
|
|
666
661
|
blockedDetail = `dependency_invalid:${normalizedPackRef}`;
|
|
667
662
|
break;
|
|
668
663
|
}
|
|
@@ -673,7 +668,7 @@ async function buildUploadPreflight(client, tasks, defaultCreator, currentUserRo
|
|
|
673
668
|
}
|
|
674
669
|
if (localDependency.node) {
|
|
675
670
|
addLocalDependency(node, localDependency.node.id, normalizedPackRef);
|
|
676
|
-
if (localDependency.node.task.kind ===
|
|
671
|
+
if (localDependency.node.task.kind === "asset-pack") {
|
|
677
672
|
node.localAppPackRefsByRef.set(normalizedPackRef, `pack:${localDependency.node.creator}/${localDependency.node.task.name}@${localDependency.node.task.version}`);
|
|
678
673
|
}
|
|
679
674
|
continue;
|
|
@@ -730,7 +725,7 @@ function resolveAppTaskLocalDependencies(task, node, state) {
|
|
|
730
725
|
};
|
|
731
726
|
}
|
|
732
727
|
function buildAppOverviewUrl(base, creator, task) {
|
|
733
|
-
const typeSlug = (0, appUrls_1.getAppTypeSlug)(task.type ??
|
|
728
|
+
const typeSlug = (0, appUrls_1.getAppTypeSlug)(task.type ?? "GAME");
|
|
734
729
|
const encodedCreator = encodeURIComponent(creator);
|
|
735
730
|
const encodedName = encodeURIComponent(task.name);
|
|
736
731
|
return `${base}/creators/${encodedCreator}/apps/${typeSlug}/${encodedName}/overview`;
|
|
@@ -746,20 +741,20 @@ function buildAssetPackOverviewUrl(base, creator, name) {
|
|
|
746
741
|
return `${base}/creators/${encodedCreator}/asset-packs/${encodedName}/overview`;
|
|
747
742
|
}
|
|
748
743
|
function appendOverviewLink(entry, task, portalBase, creator) {
|
|
749
|
-
if (!portalBase || !creator || entry.status ===
|
|
744
|
+
if (!portalBase || !creator || entry.status === "error") {
|
|
750
745
|
return;
|
|
751
746
|
}
|
|
752
747
|
let url = null;
|
|
753
|
-
if (task.kind ===
|
|
748
|
+
if (task.kind === "app") {
|
|
754
749
|
url = buildAppOverviewUrl(portalBase, creator, task);
|
|
755
750
|
}
|
|
756
|
-
else if (task.kind ===
|
|
751
|
+
else if (task.kind === "asset-spec") {
|
|
757
752
|
url = null;
|
|
758
753
|
}
|
|
759
|
-
else if (task.kind ===
|
|
754
|
+
else if (task.kind === "asset" || task.kind === "owned-asset") {
|
|
760
755
|
url = buildAssetOverviewUrl(portalBase, creator, task.name);
|
|
761
756
|
}
|
|
762
|
-
else if (task.kind ===
|
|
757
|
+
else if (task.kind === "asset-pack") {
|
|
763
758
|
url = buildAssetPackOverviewUrl(portalBase, creator, task.name);
|
|
764
759
|
}
|
|
765
760
|
if (!url) {
|
|
@@ -768,7 +763,7 @@ function appendOverviewLink(entry, task, portalBase, creator) {
|
|
|
768
763
|
entry.detail = entry.detail ? `${entry.detail} | view: ${url}` : `view: ${url}`;
|
|
769
764
|
}
|
|
770
765
|
function buildTaskEntityId(task, creatorUsername) {
|
|
771
|
-
return task.kind ===
|
|
766
|
+
return task.kind === "owned-asset"
|
|
772
767
|
? `${creatorUsername}/${task.appName}:${task.name}`
|
|
773
768
|
: `${creatorUsername}/${task.name}`;
|
|
774
769
|
}
|
|
@@ -777,44 +772,44 @@ function pushLoggedEntry(results, entry) {
|
|
|
777
772
|
console.log((0, uploadLog_1.formatTaskLogLine)(entry));
|
|
778
773
|
}
|
|
779
774
|
function buildUploadErrorDetail(error) {
|
|
780
|
-
if (error instanceof types_1.ApiError && error.code ===
|
|
781
|
-
return
|
|
775
|
+
if (error instanceof types_1.ApiError && error.code === "tag_clear_confirmation_required") {
|
|
776
|
+
return "tag_clear_confirmation_required: This publish would remove existing live tags. Re-run with --clear-tags to confirm.";
|
|
782
777
|
}
|
|
783
778
|
if (error instanceof types_1.ApiError) {
|
|
784
|
-
const ref = typeof error.details?.ref ===
|
|
785
|
-
const targetKind = typeof error.details?.targetKind ===
|
|
786
|
-
if (error.code ===
|
|
779
|
+
const ref = typeof error.details?.ref === "string" ? error.details.ref.trim() : "";
|
|
780
|
+
const targetKind = typeof error.details?.targetKind === "string" ? error.details.targetKind.trim() : "";
|
|
781
|
+
if (error.code === "unknown_tag_ref" && ref) {
|
|
787
782
|
return `unknown_tag_ref:${ref}`;
|
|
788
783
|
}
|
|
789
|
-
if (error.code ===
|
|
784
|
+
if (error.code === "invalid_tag_ref" && ref) {
|
|
790
785
|
return `invalid_tag_ref:${ref}`;
|
|
791
786
|
}
|
|
792
|
-
if (error.code ===
|
|
787
|
+
if (error.code === "duplicate_tag_ref" && ref) {
|
|
793
788
|
return `duplicate_tag_ref:${ref}`;
|
|
794
789
|
}
|
|
795
|
-
if (error.code ===
|
|
790
|
+
if (error.code === "tag_not_allowed_for_target_kind" && ref && targetKind) {
|
|
796
791
|
return `tag_not_allowed_for_target_kind:${ref}:${targetKind}`;
|
|
797
792
|
}
|
|
798
793
|
}
|
|
799
|
-
const rawMessage = typeof error?.message ===
|
|
794
|
+
const rawMessage = typeof error?.message === "string" && error.message.trim()
|
|
800
795
|
? error.message.trim()
|
|
801
|
-
:
|
|
802
|
-
const message = rawMessage.replace(/^Upload failed for [^:]+:\s*/i,
|
|
796
|
+
: "upload failed";
|
|
797
|
+
const message = rawMessage.replace(/^Upload failed for [^:]+:\s*/i, "");
|
|
803
798
|
if (/^[a-z0-9_]+:\s+/i.test(message)) {
|
|
804
799
|
return message;
|
|
805
800
|
}
|
|
806
801
|
if (/status\s+413/i.test(message)) {
|
|
807
|
-
return
|
|
802
|
+
return "upload_too_large: Upload exceeded the Playdrop HTTP 413 limit. Reduce the size of your bundle, source archive, or listing media and try again.";
|
|
808
803
|
}
|
|
809
|
-
if (!message.startsWith(
|
|
804
|
+
if (!message.startsWith("upload failed")) {
|
|
810
805
|
return `upload failed: ${message}`;
|
|
811
806
|
}
|
|
812
807
|
return message;
|
|
813
808
|
}
|
|
814
809
|
function buildTaskErrorEntry(task, entityId, error) {
|
|
815
810
|
return {
|
|
816
|
-
action:
|
|
817
|
-
status:
|
|
811
|
+
action: "upload",
|
|
812
|
+
status: "error",
|
|
818
813
|
entityType: task.kind,
|
|
819
814
|
entityId,
|
|
820
815
|
catalogue: task.cataloguePath,
|
|
@@ -824,8 +819,8 @@ function buildTaskErrorEntry(task, entityId, error) {
|
|
|
824
819
|
function buildPackPlanningFailureEntry(task, defaultCreator, currentUserRole, message) {
|
|
825
820
|
const creator = (0, upload_content_1.getTaskCreatorResult)(task, defaultCreator, currentUserRole);
|
|
826
821
|
return {
|
|
827
|
-
action:
|
|
828
|
-
status:
|
|
822
|
+
action: "upload",
|
|
823
|
+
status: "error",
|
|
829
824
|
entityType: task.kind,
|
|
830
825
|
entityId: buildTaskEntityId(task, creator.taskCreator),
|
|
831
826
|
catalogue: task.cataloguePath,
|
|
@@ -834,7 +829,7 @@ function buildPackPlanningFailureEntry(task, defaultCreator, currentUserRole, me
|
|
|
834
829
|
}
|
|
835
830
|
function appendTaskRelations(graphState, fromNodeId, relations, contextLabel) {
|
|
836
831
|
(relations ?? []).forEach((relation, index) => {
|
|
837
|
-
if (relation.type ===
|
|
832
|
+
if (relation.type === "REMIXES") {
|
|
838
833
|
throw new Error(`${contextLabel} relations[${index}] must use remix instead of REMIXES.`);
|
|
839
834
|
}
|
|
840
835
|
(0, upload_graph_1.appendPendingRelation)(graphState, fromNodeId, relation.type, relation.to, `${contextLabel} relations[${index}]`);
|
|
@@ -854,10 +849,10 @@ async function uploadAppTask(state, task, taskCreator, options) {
|
|
|
854
849
|
if (!upload.versionCreated || !upload.version) {
|
|
855
850
|
throw new Error(`App "${task.name}" upload did not return a created version.`);
|
|
856
851
|
}
|
|
857
|
-
if (typeof upload.versionId !==
|
|
852
|
+
if (typeof upload.versionId !== "number") {
|
|
858
853
|
throw new Error(`App "${task.name}" upload did not return version ID.`);
|
|
859
854
|
}
|
|
860
|
-
if (typeof upload.versionNodeId !==
|
|
855
|
+
if (typeof upload.versionNodeId !== "string" || upload.versionNodeId.trim().length === 0) {
|
|
861
856
|
throw new Error(`App "${task.name}" upload did not return versionNodeId.`);
|
|
862
857
|
}
|
|
863
858
|
const appRef = `app:${taskCreator}/${task.name}@${upload.version}`;
|
|
@@ -874,16 +869,16 @@ async function uploadAppTask(state, task, taskCreator, options) {
|
|
|
874
869
|
(0, upload_graph_1.registerLocalRef)(state.graphState.localAppNodeByName, state.graphState.ambiguousAppNames, task.name, uploadedApp.versionNodeId);
|
|
875
870
|
appendTaskRelations(state.graphState, uploadedApp.versionNodeId, task.graph.relations, `[${task.cataloguePath}] app "${task.name}"`);
|
|
876
871
|
const entry = {
|
|
877
|
-
action:
|
|
878
|
-
status:
|
|
879
|
-
entityType:
|
|
872
|
+
action: "upload",
|
|
873
|
+
status: "success",
|
|
874
|
+
entityType: "app",
|
|
880
875
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
881
876
|
catalogue: task.cataloguePath,
|
|
882
877
|
detail: `version ${upload.version} created`,
|
|
883
878
|
playUrl: (0, appUrls_1.buildPlatformPlayUrl)(state.portalBase, {
|
|
884
879
|
creatorUsername: taskCreator,
|
|
885
880
|
appName: task.name,
|
|
886
|
-
appType: task.type ??
|
|
881
|
+
appType: task.type ?? "GAME",
|
|
887
882
|
}),
|
|
888
883
|
};
|
|
889
884
|
appendOverviewLink(entry, task, state.portalBase, taskCreator);
|
|
@@ -892,9 +887,9 @@ async function uploadAppTask(state, task, taskCreator, options) {
|
|
|
892
887
|
async function uploadAssetSpecDefinitionTask(state, task, taskCreator) {
|
|
893
888
|
const uploaded = await (0, upload_content_1.uploadAssetSpecTask)(state.client, task, taskCreator);
|
|
894
889
|
return {
|
|
895
|
-
action:
|
|
896
|
-
status:
|
|
897
|
-
entityType:
|
|
890
|
+
action: "upload",
|
|
891
|
+
status: "success",
|
|
892
|
+
entityType: "asset-spec",
|
|
898
893
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
899
894
|
catalogue: task.cataloguePath,
|
|
900
895
|
detail: `asset-spec:${uploaded.creatorUsername}/${uploaded.name}@${uploaded.version}`,
|
|
@@ -904,9 +899,9 @@ async function uploadStandaloneAssetTask(state, task, taskCreator, options) {
|
|
|
904
899
|
const ownedPack = state.packPlanning.ownedPackByAssetKey.get((0, upload_content_1.buildAssetKey)(taskCreator, task.name));
|
|
905
900
|
if (ownedPack) {
|
|
906
901
|
return {
|
|
907
|
-
action:
|
|
908
|
-
status:
|
|
909
|
-
entityType:
|
|
902
|
+
action: "upload",
|
|
903
|
+
status: "success",
|
|
904
|
+
entityType: "asset",
|
|
910
905
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
911
906
|
catalogue: task.cataloguePath,
|
|
912
907
|
detail: `staged with asset pack ${ownedPack.packTask.name}@${ownedPack.packTask.version}`,
|
|
@@ -920,9 +915,9 @@ async function uploadStandaloneAssetTask(state, task, taskCreator, options) {
|
|
|
920
915
|
(0, upload_graph_1.registerLocalRef)(state.graphState.localAssetNodeByName, state.graphState.ambiguousAssetNames, task.name, uploaded.versionNodeId);
|
|
921
916
|
appendTaskRelations(state.graphState, uploaded.versionNodeId, task.relations, `[${task.cataloguePath}] asset "${task.name}"`);
|
|
922
917
|
const entry = {
|
|
923
|
-
action:
|
|
924
|
-
status:
|
|
925
|
-
entityType:
|
|
918
|
+
action: "upload",
|
|
919
|
+
status: "success",
|
|
920
|
+
entityType: "asset",
|
|
926
921
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
927
922
|
catalogue: task.cataloguePath,
|
|
928
923
|
detail: uploaded.ref,
|
|
@@ -935,14 +930,16 @@ async function uploadOwnedAssetTask(state, task, taskCreator, options) {
|
|
|
935
930
|
if (!sourceApp) {
|
|
936
931
|
throw new Error(`Owned asset "${task.name}" references app "${task.appName}" that was not uploaded in this run.`);
|
|
937
932
|
}
|
|
938
|
-
const uploaded = await (0, upload_content_1.uploadAssetTask)(state.client, task, sourceApp.versionId, sourceApp.creatorUsername, {
|
|
933
|
+
const uploaded = await (0, upload_content_1.uploadAssetTask)(state.client, task, sourceApp.versionId, sourceApp.creatorUsername, {
|
|
934
|
+
clearTags: options?.clearTags,
|
|
935
|
+
});
|
|
939
936
|
state.uploadedAssetsByKey.set(`${uploaded.creatorUsername}/${uploaded.name}`, uploaded);
|
|
940
937
|
(0, upload_graph_1.registerCanonicalNode)(state.graphState, uploaded.ref, uploaded.versionNodeId);
|
|
941
938
|
(0, upload_graph_1.registerLocalRef)(state.graphState.localAssetNodeByName, state.graphState.ambiguousAssetNames, task.name, uploaded.versionNodeId);
|
|
942
939
|
const entry = {
|
|
943
|
-
action:
|
|
944
|
-
status:
|
|
945
|
-
entityType:
|
|
940
|
+
action: "upload",
|
|
941
|
+
status: "success",
|
|
942
|
+
entityType: "owned-asset",
|
|
946
943
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
947
944
|
catalogue: task.cataloguePath,
|
|
948
945
|
detail: `${uploaded.ref} (source app version ${sourceApp.versionId})`,
|
|
@@ -987,18 +984,16 @@ function registerUploadedLocalPackAssets(state, task, taskCreator, packPlan, loc
|
|
|
987
984
|
}
|
|
988
985
|
async function uploadPackTask(state, task, taskCreator, options) {
|
|
989
986
|
const { packPlan, localAssetTasks } = collectPackLocalAssetTasks(state, task, taskCreator);
|
|
990
|
-
const mutationTargetCreator = typeof task.username ===
|
|
991
|
-
? taskCreator
|
|
992
|
-
: undefined;
|
|
987
|
+
const mutationTargetCreator = typeof task.username === "string" && task.username.trim().length > 0 ? taskCreator : undefined;
|
|
993
988
|
const uploadedPack = await (0, upload_content_1.uploadAssetPackTask)(state.client, task, taskCreator, state.uploadedAssetsByKey, localAssetTasks, packPlan.uploadKeyByAssetKey, mutationTargetCreator, { clearTags: options?.clearTags });
|
|
994
989
|
(0, upload_graph_1.registerCanonicalNode)(state.graphState, uploadedPack.ref, uploadedPack.versionNodeId);
|
|
995
990
|
(0, upload_graph_1.registerLocalRef)(state.graphState.localPackNodeByNameVersion, state.graphState.ambiguousPackNameVersions, `${task.name}@${task.version}`, uploadedPack.versionNodeId);
|
|
996
991
|
registerUploadedLocalPackAssets(state, task, taskCreator, packPlan, localAssetTasks, uploadedPack);
|
|
997
992
|
appendTaskRelations(state.graphState, uploadedPack.versionNodeId, task.relations, `[${task.cataloguePath}] assetPack "${task.name}@${task.version}"`);
|
|
998
993
|
const entry = {
|
|
999
|
-
action:
|
|
1000
|
-
status:
|
|
1001
|
-
entityType:
|
|
994
|
+
action: "upload",
|
|
995
|
+
status: "success",
|
|
996
|
+
entityType: "asset-pack",
|
|
1002
997
|
entityId: buildTaskEntityId(task, taskCreator),
|
|
1003
998
|
catalogue: task.cataloguePath,
|
|
1004
999
|
detail: `version ${task.version} created (${uploadedPack.assetRefs.length} assets)`,
|
|
@@ -1007,22 +1002,20 @@ async function uploadPackTask(state, task, taskCreator, options) {
|
|
|
1007
1002
|
return entry;
|
|
1008
1003
|
}
|
|
1009
1004
|
async function processSingleUploadTask(state, node, taskCreator, options) {
|
|
1010
|
-
const task = node.task.kind ===
|
|
1011
|
-
|
|
1012
|
-
: node.task;
|
|
1013
|
-
if (task.kind === 'app') {
|
|
1005
|
+
const task = node.task.kind === "app" ? resolveAppTaskLocalDependencies(node.task, node, state) : node.task;
|
|
1006
|
+
if (task.kind === "app") {
|
|
1014
1007
|
return await uploadAppTask(state, task, taskCreator, options);
|
|
1015
1008
|
}
|
|
1016
|
-
if (task.kind ===
|
|
1009
|
+
if (task.kind === "asset-spec") {
|
|
1017
1010
|
return { entry: await uploadAssetSpecDefinitionTask(state, task, taskCreator), warnings: [] };
|
|
1018
1011
|
}
|
|
1019
|
-
if (task.kind ===
|
|
1012
|
+
if (task.kind === "asset") {
|
|
1020
1013
|
return { entry: await uploadStandaloneAssetTask(state, task, taskCreator, options), warnings: [] };
|
|
1021
1014
|
}
|
|
1022
|
-
if (task.kind ===
|
|
1015
|
+
if (task.kind === "owned-asset") {
|
|
1023
1016
|
return { entry: await uploadOwnedAssetTask(state, task, taskCreator, options), warnings: [] };
|
|
1024
1017
|
}
|
|
1025
|
-
if (task.kind ===
|
|
1018
|
+
if (task.kind === "asset-pack") {
|
|
1026
1019
|
return { entry: await uploadPackTask(state, task, taskCreator, options), warnings: [] };
|
|
1027
1020
|
}
|
|
1028
1021
|
throw new Error(`Unsupported task kind "${task.kind}".`);
|
|
@@ -1032,15 +1025,15 @@ async function flushGraphState(client, graphState, results) {
|
|
|
1032
1025
|
await (0, upload_graph_1.applyGraphOperations)(client, graphState);
|
|
1033
1026
|
}
|
|
1034
1027
|
catch (error) {
|
|
1035
|
-
const message = typeof error?.message ===
|
|
1028
|
+
const message = typeof error?.message === "string" && error.message.trim().length > 0
|
|
1036
1029
|
? error.message.trim()
|
|
1037
|
-
:
|
|
1030
|
+
: "graph batch upload failed";
|
|
1038
1031
|
const entry = {
|
|
1039
|
-
action:
|
|
1040
|
-
status:
|
|
1041
|
-
entityType:
|
|
1042
|
-
entityId:
|
|
1043
|
-
catalogue:
|
|
1032
|
+
action: "upload",
|
|
1033
|
+
status: "error",
|
|
1034
|
+
entityType: "app",
|
|
1035
|
+
entityId: "graph",
|
|
1036
|
+
catalogue: "graph:batch",
|
|
1044
1037
|
detail: `upload failed: ${message}`,
|
|
1045
1038
|
};
|
|
1046
1039
|
pushLoggedEntry(results, entry);
|
|
@@ -1054,7 +1047,7 @@ async function processUploadTasks(client, tasks, owner, ownerUsername, currentUs
|
|
|
1054
1047
|
const preflight = await buildUploadPreflight(client, tasks, defaultCreator, currentUserRole, localTagGroups);
|
|
1055
1048
|
const sortedTasks = preflight.nodes.map((node) => node.task);
|
|
1056
1049
|
const packPlanning = (0, upload_content_1.buildAssetPackUploadPlans)(sortedTasks, defaultCreator, currentUserRole);
|
|
1057
|
-
const taskStatusById = new Map(preflight.nodes.map((node) => [node.id,
|
|
1050
|
+
const taskStatusById = new Map(preflight.nodes.map((node) => [node.id, "pending"]));
|
|
1058
1051
|
preflight.initialEntries.forEach(({ taskId, entry }) => {
|
|
1059
1052
|
taskStatusById.set(taskId, entry.status);
|
|
1060
1053
|
pushLoggedEntry(results, entry);
|
|
@@ -1079,18 +1072,18 @@ async function processUploadTasks(client, tasks, owner, ownerUsername, currentUs
|
|
|
1079
1072
|
packPlanning,
|
|
1080
1073
|
};
|
|
1081
1074
|
while (true) {
|
|
1082
|
-
const pendingNodes = preflight.nodes.filter((node) => taskStatusById.get(node.id) ===
|
|
1075
|
+
const pendingNodes = preflight.nodes.filter((node) => taskStatusById.get(node.id) === "pending");
|
|
1083
1076
|
if (pendingNodes.length === 0) {
|
|
1084
1077
|
break;
|
|
1085
1078
|
}
|
|
1086
1079
|
let madeProgress = false;
|
|
1087
1080
|
for (const node of preflight.nodes) {
|
|
1088
|
-
if (taskStatusById.get(node.id) !==
|
|
1081
|
+
if (taskStatusById.get(node.id) !== "pending") {
|
|
1089
1082
|
continue;
|
|
1090
1083
|
}
|
|
1091
1084
|
const failedDependency = node.localDependencies.find((dependency) => {
|
|
1092
1085
|
const dependencyStatus = taskStatusById.get(dependency.taskId);
|
|
1093
|
-
return dependencyStatus ===
|
|
1086
|
+
return dependencyStatus === "error" || dependencyStatus === "blocked";
|
|
1094
1087
|
});
|
|
1095
1088
|
if (failedDependency) {
|
|
1096
1089
|
const entry = buildTaskBlockedEntry(node.task, node.entityId, `local_dependency_failed:${failedDependency.ref}`);
|
|
@@ -1099,7 +1092,7 @@ async function processUploadTasks(client, tasks, owner, ownerUsername, currentUs
|
|
|
1099
1092
|
madeProgress = true;
|
|
1100
1093
|
continue;
|
|
1101
1094
|
}
|
|
1102
|
-
const waitingOnLocalDependency = node.localDependencies.some((dependency) => taskStatusById.get(dependency.taskId) ===
|
|
1095
|
+
const waitingOnLocalDependency = node.localDependencies.some((dependency) => taskStatusById.get(dependency.taskId) === "pending");
|
|
1103
1096
|
if (waitingOnLocalDependency) {
|
|
1104
1097
|
continue;
|
|
1105
1098
|
}
|
|
@@ -1128,7 +1121,7 @@ async function processUploadTasks(client, tasks, owner, ownerUsername, currentUs
|
|
|
1128
1121
|
continue;
|
|
1129
1122
|
}
|
|
1130
1123
|
for (const node of pendingNodes) {
|
|
1131
|
-
const entry = buildTaskDirectErrorEntry(node.task, node.entityId,
|
|
1124
|
+
const entry = buildTaskDirectErrorEntry(node.task, node.entityId, "dependency_cycle_detected");
|
|
1132
1125
|
taskStatusById.set(node.id, entry.status);
|
|
1133
1126
|
pushLoggedEntry(results, entry);
|
|
1134
1127
|
}
|
|
@@ -1137,19 +1130,17 @@ async function processUploadTasks(client, tasks, owner, ownerUsername, currentUs
|
|
|
1137
1130
|
return results;
|
|
1138
1131
|
}
|
|
1139
1132
|
function printResolvedUploadAccount(input) {
|
|
1140
|
-
const username = typeof input.username ===
|
|
1141
|
-
? input.username.trim()
|
|
1142
|
-
: 'unknown';
|
|
1133
|
+
const username = typeof input.username === "string" && input.username.trim().length > 0 ? input.username.trim() : "unknown";
|
|
1143
1134
|
console.log(`Resolved account: ${username} (${input.env})`);
|
|
1144
1135
|
}
|
|
1145
1136
|
async function upload(pathOrName, options) {
|
|
1146
1137
|
const directEntryPath = (0, node_path_1.resolve)(pathOrName);
|
|
1147
|
-
const directStaticHtml = (0, node_fs_1.existsSync)(directEntryPath)
|
|
1148
|
-
|
|
1149
|
-
|
|
1138
|
+
const directStaticHtml = (0, node_fs_1.existsSync)(directEntryPath) &&
|
|
1139
|
+
(0, node_fs_1.statSync)(directEntryPath).isFile() &&
|
|
1140
|
+
(0, node_path_1.basename)(directEntryPath).toLowerCase() === "index.html";
|
|
1150
1141
|
const selection = (0, taskSelection_1.selectTasks)(pathOrName);
|
|
1151
1142
|
const workspaceRoot = resolveUploadWorkspaceRoot(pathOrName, selection.resolution);
|
|
1152
|
-
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)(
|
|
1143
|
+
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)("project publish", "Publishing content", {
|
|
1153
1144
|
env: options?.env,
|
|
1154
1145
|
workspacePath: workspaceRoot,
|
|
1155
1146
|
});
|
|
@@ -1176,16 +1167,16 @@ async function upload(pathOrName, options) {
|
|
|
1176
1167
|
const owner = resolveUploadOwner(userInfo.username, ctx.workspaceAuth?.config.ownerUsername);
|
|
1177
1168
|
if (directStaticHtml) {
|
|
1178
1169
|
if (!userInfo.username || !userInfo.user) {
|
|
1179
|
-
throw new Error(
|
|
1170
|
+
throw new Error("static_game_publish_authenticated_user_missing");
|
|
1180
1171
|
}
|
|
1181
1172
|
if (!envConfig.cdnBase) {
|
|
1182
|
-
throw new Error(
|
|
1173
|
+
throw new Error("static_game_publish_cdn_base_missing");
|
|
1183
1174
|
}
|
|
1184
1175
|
const result = await publishStaticHtmlProject({
|
|
1185
1176
|
client,
|
|
1186
1177
|
projectDir: (0, node_path_1.dirname)(directEntryPath),
|
|
1187
1178
|
creatorUsername: userInfo.username,
|
|
1188
|
-
primarySurface:
|
|
1179
|
+
primarySurface: "DESKTOP",
|
|
1189
1180
|
apiBase: envConfig.apiBase,
|
|
1190
1181
|
webBase: envConfig.webBase,
|
|
1191
1182
|
cdnBase: envConfig.cdnBase,
|
|
@@ -1205,31 +1196,31 @@ async function upload(pathOrName, options) {
|
|
|
1205
1196
|
const tagGroupLoad = (0, catalogue_1.resolveCatalogueTagGroups)(workspaceRoot);
|
|
1206
1197
|
if (tagGroupLoad.errors.length > 0) {
|
|
1207
1198
|
(0, taskSelection_1.reportTaskErrors)(tagGroupLoad.errors.map((message) => ({
|
|
1208
|
-
type:
|
|
1199
|
+
type: "invalid-catalogue",
|
|
1209
1200
|
message,
|
|
1210
|
-
help: [
|
|
1211
|
-
})),
|
|
1201
|
+
help: ["Update the tagGroups entries noted above, then retry the publish."],
|
|
1202
|
+
})), "project publish");
|
|
1212
1203
|
process.exitCode = 1;
|
|
1213
1204
|
return;
|
|
1214
1205
|
}
|
|
1215
1206
|
if (selection.errors.length > 0) {
|
|
1216
|
-
const canPublishTagGroupsOnly = selection.errors.every((error) => error.type ===
|
|
1207
|
+
const canPublishTagGroupsOnly = selection.errors.every((error) => error.type === "no-tasks") && tagGroupLoad.groups.length > 0;
|
|
1217
1208
|
if (canPublishTagGroupsOnly) {
|
|
1218
1209
|
selection.errors.length = 0;
|
|
1219
1210
|
}
|
|
1220
1211
|
}
|
|
1221
1212
|
if (selection.errors.length > 0) {
|
|
1222
|
-
(0, taskSelection_1.reportTaskErrors)(selection.errors,
|
|
1213
|
+
(0, taskSelection_1.reportTaskErrors)(selection.errors, "project publish");
|
|
1223
1214
|
process.exitCode = 1;
|
|
1224
1215
|
return;
|
|
1225
1216
|
}
|
|
1226
1217
|
const warnings = selection.warnings;
|
|
1227
1218
|
const tasks = selection.tasks;
|
|
1228
|
-
if (tagGroupLoad.groups.length > 0 && userInfo.role !==
|
|
1229
|
-
(0, messages_1.printErrorWithHelp)(
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
], { command:
|
|
1219
|
+
if (tagGroupLoad.groups.length > 0 && userInfo.role !== "ADMIN") {
|
|
1220
|
+
(0, messages_1.printErrorWithHelp)("Publishing tagGroups requires an admin account.", [
|
|
1221
|
+
"Log in as an admin before publishing taxonomy changes.",
|
|
1222
|
+
"Remove tagGroups from catalogue.json if this publish should only upload content.",
|
|
1223
|
+
], { command: "project publish" });
|
|
1233
1224
|
process.exitCode = 1;
|
|
1234
1225
|
return;
|
|
1235
1226
|
}
|
|
@@ -1242,7 +1233,7 @@ async function upload(pathOrName, options) {
|
|
|
1242
1233
|
const uploadEntries = await processUploadTasks(client, tasks, owner, userInfo.username, userInfo.role, tagGroupLoad.groups, userInfo.user, ctx.token, warnings, envConfig.apiBase, envConfig.webBase, options);
|
|
1243
1234
|
results.push(...uploadEntries);
|
|
1244
1235
|
}
|
|
1245
|
-
(0, uploadLog_1.printTaskSummary)(results, warnings, { action:
|
|
1236
|
+
(0, uploadLog_1.printTaskSummary)(results, warnings, { action: "upload", environment: env });
|
|
1246
1237
|
(0, uploadLog_1.printPublishedAppNextSteps)(results);
|
|
1247
1238
|
}
|
|
1248
1239
|
function assertAgentPrimarySurfaceContract(task, kind) {
|
|
@@ -1254,9 +1245,9 @@ function assertAgentPrimarySurfaceContract(task, kind) {
|
|
|
1254
1245
|
}
|
|
1255
1246
|
}
|
|
1256
1247
|
function assertAgentNewGamePlaytestContract(task) {
|
|
1257
|
-
assertAgentPrimarySurfaceContract(task,
|
|
1248
|
+
assertAgentPrimarySurfaceContract(task, "NEW_GAME");
|
|
1258
1249
|
if (!task.playtestTapes) {
|
|
1259
|
-
throw new Error(
|
|
1250
|
+
throw new Error("agent_task_playtest_tapes_required: NEW_GAME catalogue.json must declare one playtest tape per supported surface.");
|
|
1260
1251
|
}
|
|
1261
1252
|
for (const surface of task.surfaceTargets) {
|
|
1262
1253
|
const tape = task.playtestTapes[surface];
|
|
@@ -1268,13 +1259,13 @@ function assertAgentNewGamePlaytestContract(task) {
|
|
|
1268
1259
|
function assertAgentNewGameListingIdentity(task) {
|
|
1269
1260
|
const missing = [];
|
|
1270
1261
|
if (!task.listing?.iconPath)
|
|
1271
|
-
missing.push(
|
|
1262
|
+
missing.push("listing.icon");
|
|
1272
1263
|
if (!task.listing?.heroPortraitPath)
|
|
1273
|
-
missing.push(
|
|
1264
|
+
missing.push("listing.hero.portrait");
|
|
1274
1265
|
if (!task.listing?.heroLandscapePath)
|
|
1275
|
-
missing.push(
|
|
1266
|
+
missing.push("listing.hero.landscape");
|
|
1276
1267
|
if (missing.length > 0) {
|
|
1277
|
-
throw new Error(`agent_task_listing_identity_required: NEW_GAME catalogue.json must provide ${missing.join(
|
|
1268
|
+
throw new Error(`agent_task_listing_identity_required: NEW_GAME catalogue.json must provide ${missing.join(", ")}.`);
|
|
1278
1269
|
}
|
|
1279
1270
|
}
|
|
1280
1271
|
async function collectUploadPreflightErrors(checks) {
|
|
@@ -1290,25 +1281,13 @@ async function collectUploadPreflightErrors(checks) {
|
|
|
1290
1281
|
return errors;
|
|
1291
1282
|
}
|
|
1292
1283
|
function assertAgentTaskReleaseNotes(task) {
|
|
1293
|
-
|
|
1294
|
-
if (!releaseNotes) {
|
|
1295
|
-
throw new Error('agent_task_release_notes_missing: catalogue releaseNotes must contain one line with 1..240 characters.');
|
|
1296
|
-
}
|
|
1297
|
-
if (/[\r\n]/.test(releaseNotes)) {
|
|
1298
|
-
throw new Error(`agent_task_release_notes_multiline: releaseNotes has ${releaseNotes.split(/\r?\n/).length} lines; expected one line with 1..240 characters.`);
|
|
1299
|
-
}
|
|
1300
|
-
if (releaseNotes.length > 240) {
|
|
1301
|
-
throw new Error(`agent_task_release_notes_too_long: releaseNotes length=${releaseNotes.length}; expected 1..240 characters on one line.`);
|
|
1302
|
-
}
|
|
1284
|
+
(0, catalogue_1.normalizeAppReleaseNotes)(task.releaseNotes, { required: true });
|
|
1303
1285
|
}
|
|
1304
1286
|
async function assertWorkerAppLocalUploadPreflight(input) {
|
|
1305
1287
|
const errors = await collectUploadPreflightErrors([
|
|
1306
1288
|
() => assertAgentTaskReleaseNotes(input.task),
|
|
1307
|
-
...(input.kind ===
|
|
1308
|
-
? [
|
|
1309
|
-
() => assertAgentNewGamePlaytestContract(input.task),
|
|
1310
|
-
() => assertAgentNewGameListingIdentity(input.task),
|
|
1311
|
-
]
|
|
1289
|
+
...(input.kind === "NEW_GAME"
|
|
1290
|
+
? [() => assertAgentNewGamePlaytestContract(input.task), () => assertAgentNewGameListingIdentity(input.task)]
|
|
1312
1291
|
: [() => assertAgentPrimarySurfaceContract(input.task, input.kind)]),
|
|
1313
1292
|
() => (0, ownedRuntimeImageValidation_1.assertOwnedRuntimeImagesAreValid)(input.task),
|
|
1314
1293
|
]);
|
|
@@ -1316,51 +1295,51 @@ async function assertWorkerAppLocalUploadPreflight(input) {
|
|
|
1316
1295
|
throw new Error(errors[0]);
|
|
1317
1296
|
}
|
|
1318
1297
|
if (errors.length > 1) {
|
|
1319
|
-
throw new Error(`agent_task_upload_preflight_failed:\n${errors.map((error, index) => `${index + 1}. ${error}`).join(
|
|
1298
|
+
throw new Error(`agent_task_upload_preflight_failed:\n${errors.map((error, index) => `${index + 1}. ${error}`).join("\n")}`);
|
|
1320
1299
|
}
|
|
1321
1300
|
}
|
|
1322
1301
|
async function prepareWorkerAppProject(input) {
|
|
1323
1302
|
const creatorUsername = input.creatorUsername.trim();
|
|
1324
1303
|
if (!creatorUsername) {
|
|
1325
|
-
throw new Error(
|
|
1304
|
+
throw new Error("agent_task_creator_username_missing");
|
|
1326
1305
|
}
|
|
1327
|
-
if (input.user.username !== creatorUsername && input.user.role !==
|
|
1306
|
+
if (input.user.username !== creatorUsername && input.user.role !== "ADMIN") {
|
|
1328
1307
|
throw new Error(`worker_publish_on_behalf_requires_admin: the worker session user "${input.user.username}" cannot publish for "${creatorUsername}".`);
|
|
1329
1308
|
}
|
|
1330
1309
|
const selection = (0, taskSelection_1.selectTasks)(input.projectDir);
|
|
1331
1310
|
if (selection.errors.length > 0) {
|
|
1332
|
-
throw new Error(`agent_task_project_invalid: ${selection.errors.map((error) => error.message).join(
|
|
1311
|
+
throw new Error(`agent_task_project_invalid: ${selection.errors.map((error) => error.message).join("; ")}`);
|
|
1333
1312
|
}
|
|
1334
|
-
const appTask = selection.tasks.find((task) => task.kind ===
|
|
1313
|
+
const appTask = selection.tasks.find((task) => task.kind === "app");
|
|
1335
1314
|
if (!appTask || selection.tasks.length !== 1) {
|
|
1336
|
-
const found = selection.tasks.map((task) => `${task.kind}:${task.name}`).join(
|
|
1315
|
+
const found = selection.tasks.map((task) => `${task.kind}:${task.name}`).join(", ") || "none";
|
|
1337
1316
|
throw new Error(`agent_task_project_requires_single_app: expected exactly one app task in ${input.projectDir}, found ${found}.`);
|
|
1338
1317
|
}
|
|
1339
|
-
const expectedAppName = input.expectedAppName?.trim() ??
|
|
1318
|
+
const expectedAppName = input.expectedAppName?.trim() ?? "";
|
|
1340
1319
|
if (expectedAppName && appTask.name !== expectedAppName) {
|
|
1341
1320
|
throw new Error(`agent_task_output_app_name_mismatch: expected catalogue app "${expectedAppName}", found "${appTask.name}".`);
|
|
1342
1321
|
}
|
|
1343
|
-
const expectedDisplayName = input.expectedDisplayName?.trim() ??
|
|
1322
|
+
const expectedDisplayName = input.expectedDisplayName?.trim() ?? "";
|
|
1344
1323
|
if (expectedDisplayName && appTask.displayName !== expectedDisplayName) {
|
|
1345
|
-
throw new Error(`agent_task_output_display_name_mismatch: expected "${expectedDisplayName}", found "${appTask.displayName ??
|
|
1324
|
+
throw new Error(`agent_task_output_display_name_mismatch: expected "${expectedDisplayName}", found "${appTask.displayName ?? ""}".`);
|
|
1346
1325
|
}
|
|
1347
|
-
const expectedSubtitle = input.expectedSubtitle?.trim() ??
|
|
1326
|
+
const expectedSubtitle = input.expectedSubtitle?.trim() ?? "";
|
|
1348
1327
|
if (expectedSubtitle && appTask.subtitle !== expectedSubtitle) {
|
|
1349
|
-
throw new Error(`agent_task_output_subtitle_mismatch: expected "${expectedSubtitle}", found "${appTask.subtitle ??
|
|
1328
|
+
throw new Error(`agent_task_output_subtitle_mismatch: expected "${expectedSubtitle}", found "${appTask.subtitle ?? ""}".`);
|
|
1350
1329
|
}
|
|
1351
1330
|
if (input.expectedPrimarySurface && appTask.primarySurface !== input.expectedPrimarySurface) {
|
|
1352
|
-
throw new Error(`agent_task_output_primary_surface_mismatch: expected "${input.expectedPrimarySurface}", found "${appTask.primarySurface ??
|
|
1331
|
+
throw new Error(`agent_task_output_primary_surface_mismatch: expected "${input.expectedPrimarySurface}", found "${appTask.primarySurface ?? ""}".`);
|
|
1353
1332
|
}
|
|
1354
|
-
if ((input.kind ===
|
|
1355
|
-
throw new Error(`agent_task_game_type_invalid:${appTask.type ??
|
|
1333
|
+
if ((input.kind === "NEW_GAME" || input.kind === "REMIX_GAME") && (appTask.type ?? "GAME") !== "GAME") {
|
|
1334
|
+
throw new Error(`agent_task_game_type_invalid:${appTask.type ?? "missing"}`);
|
|
1356
1335
|
}
|
|
1357
1336
|
const task = (0, workerAppProject_1.prepareWorkerAppTask)(appTask);
|
|
1358
|
-
if (input.kind ===
|
|
1359
|
-
const expectedRemixRef = input.remixSourceRef?.trim() ??
|
|
1337
|
+
if (input.kind === "REMIX_GAME") {
|
|
1338
|
+
const expectedRemixRef = input.remixSourceRef?.trim() ?? "";
|
|
1360
1339
|
if (!expectedRemixRef) {
|
|
1361
|
-
throw new Error(
|
|
1340
|
+
throw new Error("agent_task_remix_source_ref_missing");
|
|
1362
1341
|
}
|
|
1363
|
-
const catalogueRemixRef = task.remix?.trim() ??
|
|
1342
|
+
const catalogueRemixRef = task.remix?.trim() ?? "";
|
|
1364
1343
|
if (!catalogueRemixRef) {
|
|
1365
1344
|
throw new Error(`agent_task_remix_ref_missing:${expectedRemixRef}`);
|
|
1366
1345
|
}
|
|
@@ -1369,7 +1348,7 @@ async function prepareWorkerAppProject(input) {
|
|
|
1369
1348
|
}
|
|
1370
1349
|
}
|
|
1371
1350
|
await (0, apps_1.validateAppTask)(task);
|
|
1372
|
-
const isExternal = task.hostingMode ===
|
|
1351
|
+
const isExternal = task.hostingMode === "EXTERNAL" || Boolean(task.externalUrl);
|
|
1373
1352
|
const artifacts = isExternal ? null : await (0, apps_1.buildApp)(task);
|
|
1374
1353
|
await assertWorkerAppLocalUploadPreflight({
|
|
1375
1354
|
task,
|
|
@@ -1406,12 +1385,12 @@ async function publishWorkerAppProject(input) {
|
|
|
1406
1385
|
task,
|
|
1407
1386
|
agentTaskId: input.taskId,
|
|
1408
1387
|
});
|
|
1409
|
-
if (typeof app.id !==
|
|
1388
|
+
if (typeof app.id !== "number" || !Number.isInteger(app.id) || app.id <= 0) {
|
|
1410
1389
|
throw new Error(`App "${task.name}" registration did not return an app id.`);
|
|
1411
1390
|
}
|
|
1412
1391
|
const taskToken = input.taskToken.trim();
|
|
1413
1392
|
if (!taskToken) {
|
|
1414
|
-
throw new Error(
|
|
1393
|
+
throw new Error("agent_task_token_missing");
|
|
1415
1394
|
}
|
|
1416
1395
|
const captureSession = {
|
|
1417
1396
|
appId: app.id,
|
|
@@ -1428,17 +1407,17 @@ async function publishWorkerAppProject(input) {
|
|
|
1428
1407
|
runStagedUploadLoadCheck: true,
|
|
1429
1408
|
ensureRegisteredAppShell: true,
|
|
1430
1409
|
agentTaskId: input.taskId,
|
|
1431
|
-
playtestSmokeCheckRequired: input.kind ===
|
|
1410
|
+
playtestSmokeCheckRequired: input.kind === "NEW_GAME",
|
|
1432
1411
|
captureSession,
|
|
1433
1412
|
...(artifacts ? { artifacts } : {}),
|
|
1434
1413
|
});
|
|
1435
1414
|
if (!uploadResult.versionCreated || !uploadResult.version) {
|
|
1436
1415
|
throw new Error(`App "${task.name}" upload did not return a created version.`);
|
|
1437
1416
|
}
|
|
1438
|
-
if (typeof uploadResult.versionId !==
|
|
1417
|
+
if (typeof uploadResult.versionId !== "number") {
|
|
1439
1418
|
throw new Error(`App "${task.name}" upload did not return version ID.`);
|
|
1440
1419
|
}
|
|
1441
|
-
if (typeof uploadResult.versionNodeId !==
|
|
1420
|
+
if (typeof uploadResult.versionNodeId !== "string" || uploadResult.versionNodeId.trim().length === 0) {
|
|
1442
1421
|
throw new Error(`App "${task.name}" upload did not return versionNodeId.`);
|
|
1443
1422
|
}
|
|
1444
1423
|
return {
|
|
@@ -1454,9 +1433,9 @@ async function publishWorkerAppProject(input) {
|
|
|
1454
1433
|
async function publishStaticHtmlProject(input) {
|
|
1455
1434
|
const creatorUsername = input.creatorUsername.trim();
|
|
1456
1435
|
if (!creatorUsername) {
|
|
1457
|
-
throw new Error(
|
|
1436
|
+
throw new Error("static_game_publish_creator_username_missing");
|
|
1458
1437
|
}
|
|
1459
|
-
if (input.user.username !== creatorUsername && input.user.role !==
|
|
1438
|
+
if (input.user.username !== creatorUsername && input.user.role !== "ADMIN") {
|
|
1460
1439
|
throw new Error(`static_game_publish_on_behalf_requires_admin:${input.user.username}:${creatorUsername}`);
|
|
1461
1440
|
}
|
|
1462
1441
|
const prepared = await (0, staticHtml_1.prepareStaticHtmlProject)({
|
|
@@ -1468,17 +1447,17 @@ async function publishStaticHtmlProject(input) {
|
|
|
1468
1447
|
});
|
|
1469
1448
|
try {
|
|
1470
1449
|
if (input.taskId !== undefined && !input.claimedAppName?.trim()) {
|
|
1471
|
-
const subtitle = prepared.metadata.description?.trim() ??
|
|
1450
|
+
const subtitle = prepared.metadata.description?.trim() ?? "";
|
|
1472
1451
|
if (!subtitle) {
|
|
1473
|
-
throw new Error(
|
|
1452
|
+
throw new Error("static_game_subtitle_required");
|
|
1474
1453
|
}
|
|
1475
1454
|
const primarySurface = prepared.runtimeTask.primarySurface;
|
|
1476
1455
|
if (!primarySurface) {
|
|
1477
|
-
throw new Error(
|
|
1456
|
+
throw new Error("static_game_primary_surface_required");
|
|
1478
1457
|
}
|
|
1479
|
-
const taskToken = input.taskToken?.trim() ??
|
|
1458
|
+
const taskToken = input.taskToken?.trim() ?? "";
|
|
1480
1459
|
if (!taskToken) {
|
|
1481
|
-
throw new Error(
|
|
1460
|
+
throw new Error("static_game_publish_task_token_missing");
|
|
1482
1461
|
}
|
|
1483
1462
|
const claimed = await input.client.workerClaimAgentTaskSlug(input.taskId, {
|
|
1484
1463
|
appName: prepared.runtimeTask.name,
|
|
@@ -1486,10 +1465,10 @@ async function publishStaticHtmlProject(input) {
|
|
|
1486
1465
|
subtitle,
|
|
1487
1466
|
primarySurface,
|
|
1488
1467
|
});
|
|
1489
|
-
if (claimed.appName !== prepared.runtimeTask.name
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1468
|
+
if (claimed.appName !== prepared.runtimeTask.name ||
|
|
1469
|
+
claimed.displayName !== prepared.metadata.title ||
|
|
1470
|
+
claimed.subtitle !== subtitle ||
|
|
1471
|
+
claimed.primarySurface !== primarySurface) {
|
|
1493
1472
|
throw new Error(`static_game_publish_identity_claim_mismatch:${claimed.appName}:${prepared.runtimeTask.name}`);
|
|
1494
1473
|
}
|
|
1495
1474
|
}
|
|
@@ -1499,8 +1478,8 @@ async function publishStaticHtmlProject(input) {
|
|
|
1499
1478
|
task: prepared.runtimeTask,
|
|
1500
1479
|
agentTaskId: input.taskId,
|
|
1501
1480
|
});
|
|
1502
|
-
if (typeof app.id !==
|
|
1503
|
-
throw new Error(
|
|
1481
|
+
if (typeof app.id !== "number" || !Number.isInteger(app.id) || app.id <= 0) {
|
|
1482
|
+
throw new Error("static_game_publish_app_registration_failed");
|
|
1504
1483
|
}
|
|
1505
1484
|
const appId = app.id;
|
|
1506
1485
|
const captureSession = input.taskId !== undefined && input.taskToken?.trim()
|
|
@@ -1523,7 +1502,7 @@ async function publishStaticHtmlProject(input) {
|
|
|
1523
1502
|
artifacts: prepared.artifacts,
|
|
1524
1503
|
});
|
|
1525
1504
|
if (!upload.version || !Number.isInteger(upload.versionId) || !upload.versionNodeId?.trim()) {
|
|
1526
|
-
throw new Error(
|
|
1505
|
+
throw new Error("static_game_publish_version_result_missing");
|
|
1527
1506
|
}
|
|
1528
1507
|
return {
|
|
1529
1508
|
appId,
|
|
@@ -1541,7 +1520,7 @@ async function publishStaticHtmlProject(input) {
|
|
|
1541
1520
|
playUrl: (0, appUrls_1.buildPlatformPrivateDraftPlayUrl)(input.webBase, {
|
|
1542
1521
|
creatorUsername,
|
|
1543
1522
|
appName: prepared.runtimeTask.name,
|
|
1544
|
-
appType:
|
|
1523
|
+
appType: "GAME",
|
|
1545
1524
|
version: upload.version,
|
|
1546
1525
|
}),
|
|
1547
1526
|
};
|