@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
|
@@ -21,20 +21,20 @@ const devAuth_1 = require("../devAuth");
|
|
|
21
21
|
const dev_1 = require("./dev");
|
|
22
22
|
const playwright_1 = require("../playwright");
|
|
23
23
|
function resolveDevBrowserAuthSelection(options) {
|
|
24
|
-
const normalizedMode = options.devAuth?.trim().toLowerCase() ||
|
|
25
|
-
if (options.player !== undefined && normalizedMode !==
|
|
26
|
-
throw new Error(
|
|
24
|
+
const normalizedMode = options.devAuth?.trim().toLowerCase() || "prompt";
|
|
25
|
+
if (options.player !== undefined && normalizedMode !== "player") {
|
|
26
|
+
throw new Error("dev_auth_player_requires_player_mode");
|
|
27
27
|
}
|
|
28
28
|
return (0, devAuth_1.parseHostedDevAuthSelection)({
|
|
29
29
|
devAuth: options.devAuth,
|
|
30
30
|
player: options.player,
|
|
31
|
-
defaultMode:
|
|
31
|
+
defaultMode: "prompt",
|
|
32
32
|
allowPrompt: true,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
function waitForContextClose(context) {
|
|
36
36
|
return new Promise((resolve) => {
|
|
37
|
-
context.once?.(
|
|
37
|
+
context.once?.("close", () => {
|
|
38
38
|
resolve();
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -47,50 +47,59 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
47
47
|
devAuthSelection = resolveDevBrowserAuthSelection(options);
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
|
-
const message = error?.message ||
|
|
51
|
-
if (message ===
|
|
52
|
-
(0, messages_1.printErrorWithHelp)(
|
|
50
|
+
const message = error?.message || "Unable to start the dev browser.";
|
|
51
|
+
if (message === "dev_auth_player_requires_player_mode") {
|
|
52
|
+
(0, messages_1.printErrorWithHelp)("Use --player only with --dev-auth player.", [], { command: "project dev-browser" });
|
|
53
53
|
process.exitCode = 1;
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
if (message ===
|
|
57
|
-
(0, messages_1.printErrorWithHelp)(
|
|
56
|
+
if (message === "dev_auth_player_slot_required") {
|
|
57
|
+
(0, messages_1.printErrorWithHelp)("Use --player 1, 2, 3, or 4 when --dev-auth player is selected.", [], {
|
|
58
|
+
command: "project dev-browser",
|
|
59
|
+
});
|
|
58
60
|
process.exitCode = 1;
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
const code = error?.code;
|
|
62
64
|
let suggestions = [];
|
|
63
65
|
switch (code) {
|
|
64
|
-
case
|
|
66
|
+
case "app_required":
|
|
65
67
|
suggestions = ['Use "--app <name>" to select which app to run.'];
|
|
66
68
|
break;
|
|
67
|
-
case
|
|
68
|
-
suggestions = [
|
|
69
|
+
case "app_not_found":
|
|
70
|
+
suggestions = [
|
|
71
|
+
'Check the app name in catalogue.json or run "playdrop project create app" to register a new app.',
|
|
72
|
+
];
|
|
69
73
|
break;
|
|
70
|
-
case
|
|
71
|
-
suggestions = [
|
|
74
|
+
case "catalogue_missing":
|
|
75
|
+
suggestions = [
|
|
76
|
+
'Run "playdrop project dev-browser" from a workspace with catalogue.json or provide the path to an HTML file.',
|
|
77
|
+
];
|
|
72
78
|
break;
|
|
73
|
-
case
|
|
74
|
-
suggestions = [
|
|
79
|
+
case "invalid_target":
|
|
80
|
+
suggestions = ["Provide a path to an HTML file or directory containing a catalogue.json."];
|
|
75
81
|
break;
|
|
76
|
-
case
|
|
82
|
+
case "empty_catalogue":
|
|
77
83
|
suggestions = ['Add apps to catalogue.json before running "playdrop project dev-browser".'];
|
|
78
84
|
break;
|
|
79
|
-
case
|
|
85
|
+
case "invalid_catalogue":
|
|
80
86
|
suggestions = ['Fix the catalogue.json file and rerun "playdrop project dev-browser".'];
|
|
81
87
|
break;
|
|
82
88
|
default:
|
|
83
|
-
suggestions = [
|
|
89
|
+
suggestions = [
|
|
90
|
+
"Use --dev-auth prompt, anonymous, viewer, or player.",
|
|
91
|
+
"If you choose --dev-auth player, also pass --player 1, 2, 3, or 4.",
|
|
92
|
+
];
|
|
84
93
|
break;
|
|
85
94
|
}
|
|
86
|
-
(0, messages_1.printErrorWithHelp)(message, suggestions, { command:
|
|
95
|
+
(0, messages_1.printErrorWithHelp)(message, suggestions, { command: "project dev-browser" });
|
|
87
96
|
process.exitCode = 1;
|
|
88
97
|
return;
|
|
89
98
|
}
|
|
90
99
|
let appName = resolvedTarget.appName;
|
|
91
100
|
const filePath = resolvedTarget.htmlPath;
|
|
92
101
|
if (!(0, node_fs_1.existsSync)(filePath) || !(0, node_fs_1.statSync)(filePath).isFile()) {
|
|
93
|
-
(0, messages_1.printErrorWithHelp)(`App HTML was not found at ${filePath}.`, [
|
|
102
|
+
(0, messages_1.printErrorWithHelp)(`App HTML was not found at ${filePath}.`, ["Ensure the catalogue entry points to a compiled HTML file or provide the correct file path."], { command: "project dev-browser" });
|
|
94
103
|
process.exitCode = 1;
|
|
95
104
|
return;
|
|
96
105
|
}
|
|
@@ -104,17 +113,17 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
104
113
|
}
|
|
105
114
|
catch (error) {
|
|
106
115
|
if (resolvedTarget.cataloguePath) {
|
|
107
|
-
(0, messages_1.printErrorWithHelp)(error?.message ||
|
|
108
|
-
|
|
116
|
+
(0, messages_1.printErrorWithHelp)(error?.message || "Catalogue lookup failed.", [
|
|
117
|
+
"Ensure the HTML file is listed exactly once in catalogue.json with a valid type.",
|
|
109
118
|
'Run "playdrop project create app <name>" to scaffold a new entry if needed.',
|
|
110
|
-
], { command:
|
|
119
|
+
], { command: "project dev-browser" });
|
|
111
120
|
process.exitCode = 1;
|
|
112
121
|
return;
|
|
113
122
|
}
|
|
114
123
|
}
|
|
115
124
|
const workspacePath = resolvedTarget.cataloguePath ?? (0, node_path_1.dirname)(filePath);
|
|
116
|
-
await (0, commandContext_1.withEnvironment)(
|
|
117
|
-
let currentUsername = account?.username?.trim() ??
|
|
125
|
+
await (0, commandContext_1.withEnvironment)("project dev-browser", "Launching the Playdrop dev browser", async ({ client, env, envConfig, account }) => {
|
|
126
|
+
let currentUsername = account?.username?.trim() ?? "";
|
|
118
127
|
if (!currentUsername) {
|
|
119
128
|
try {
|
|
120
129
|
currentUsername = await (0, devShared_1.fetchDevUsername)(client);
|
|
@@ -124,7 +133,7 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
124
133
|
return;
|
|
125
134
|
}
|
|
126
135
|
if (error instanceof types_1.UnsupportedClientError) {
|
|
127
|
-
(0, http_1.handleUnsupportedError)(error,
|
|
136
|
+
(0, http_1.handleUnsupportedError)(error, "Authentication");
|
|
128
137
|
process.exitCode = 1;
|
|
129
138
|
return;
|
|
130
139
|
}
|
|
@@ -132,12 +141,12 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
132
141
|
(0, messages_1.printErrorWithHelp)(`Could not fetch your account (status ${error.status}).`, [
|
|
133
142
|
'Run "playdrop auth login" to refresh your session and ensure the API is reachable.',
|
|
134
143
|
'Use "playdrop auth whoami" afterwards to confirm your status.',
|
|
135
|
-
], { command:
|
|
144
|
+
], { command: "project dev-browser" });
|
|
136
145
|
process.exitCode = 1;
|
|
137
146
|
return;
|
|
138
147
|
}
|
|
139
148
|
if ((0, devShared_1.isNetworkError)(error)) {
|
|
140
|
-
(0, messages_1.printNetworkIssue)(
|
|
149
|
+
(0, messages_1.printNetworkIssue)("Could not reach the Playdrop API to resolve your account.", "project dev-browser");
|
|
141
150
|
process.exitCode = 1;
|
|
142
151
|
return;
|
|
143
152
|
}
|
|
@@ -153,7 +162,7 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
153
162
|
return;
|
|
154
163
|
}
|
|
155
164
|
if (error instanceof types_1.UnsupportedClientError) {
|
|
156
|
-
(0, http_1.handleUnsupportedError)(error,
|
|
165
|
+
(0, http_1.handleUnsupportedError)(error, "Dev browser");
|
|
157
166
|
process.exitCode = 1;
|
|
158
167
|
return;
|
|
159
168
|
}
|
|
@@ -161,17 +170,17 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
161
170
|
if (error.status === 404) {
|
|
162
171
|
(0, messages_1.printErrorWithHelp)(`App ${currentUsername}/${appName} is not registered on ${env}.`, [
|
|
163
172
|
`Run "playdrop project create app ${appName}" to register the app before opening the dev browser.`,
|
|
164
|
-
|
|
165
|
-
], { command:
|
|
173
|
+
"If you expected it to exist, ensure you are logged into the correct environment.",
|
|
174
|
+
], { command: "project dev-browser" });
|
|
166
175
|
}
|
|
167
176
|
else {
|
|
168
|
-
(0, messages_1.printErrorWithHelp)(`Failed to verify app registration (status ${error.status}).`, [
|
|
177
|
+
(0, messages_1.printErrorWithHelp)(`Failed to verify app registration (status ${error.status}).`, ["Retry in a moment.", "If the issue persists, contact the Playdrop team."], { command: "project dev-browser" });
|
|
169
178
|
}
|
|
170
179
|
process.exitCode = 1;
|
|
171
180
|
return;
|
|
172
181
|
}
|
|
173
182
|
if ((0, devShared_1.isNetworkError)(error)) {
|
|
174
|
-
(0, messages_1.printNetworkIssue)(
|
|
183
|
+
(0, messages_1.printNetworkIssue)("Could not reach the Playdrop API to verify the app registration.", "project dev-browser");
|
|
175
184
|
process.exitCode = 1;
|
|
176
185
|
return;
|
|
177
186
|
}
|
|
@@ -179,12 +188,10 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
179
188
|
}
|
|
180
189
|
}
|
|
181
190
|
const projectInfo = (0, devShared_1.findProjectInfo)(filePath);
|
|
182
|
-
const devScriptAvailable = Boolean(projectInfo.projectDir
|
|
183
|
-
&& projectInfo.packageJson
|
|
184
|
-
&& typeof projectInfo.packageJson.scripts?.dev === 'string');
|
|
191
|
+
const devScriptAvailable = Boolean(projectInfo.projectDir && projectInfo.packageJson && typeof projectInfo.packageJson.scripts?.dev === "string");
|
|
185
192
|
const taskLookup = (0, catalogue_1.findAppTaskByFile)(filePath);
|
|
186
193
|
if (taskLookup.errors.length > 0) {
|
|
187
|
-
(0, messages_1.printErrorWithHelp)(taskLookup.errors[0] ||
|
|
194
|
+
(0, messages_1.printErrorWithHelp)(taskLookup.errors[0] || "Failed to resolve the app task from catalogue.json.", taskLookup.errors.slice(1), { command: "project dev-browser" });
|
|
188
195
|
process.exitCode = 1;
|
|
189
196
|
return;
|
|
190
197
|
}
|
|
@@ -202,12 +209,12 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
202
209
|
apiBase: envConfig.apiBase,
|
|
203
210
|
task: taskLookup.task,
|
|
204
211
|
creatorUsername: currentUsername,
|
|
205
|
-
appBaseUrl: new URL(
|
|
212
|
+
appBaseUrl: new URL(".", localDevAppUrl).toString(),
|
|
206
213
|
});
|
|
207
214
|
}
|
|
208
215
|
catch (error) {
|
|
209
216
|
const formatted = (0, dev_1.formatDevRuntimeAssetManifestFailure)(error);
|
|
210
|
-
(0, messages_1.printErrorWithHelp)(formatted.message, formatted.suggestions, { command:
|
|
217
|
+
(0, messages_1.printErrorWithHelp)(formatted.message, formatted.suggestions, { command: "project dev-browser" });
|
|
211
218
|
process.exitCode = 1;
|
|
212
219
|
return;
|
|
213
220
|
}
|
|
@@ -225,26 +232,26 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
225
232
|
});
|
|
226
233
|
}
|
|
227
234
|
catch (error) {
|
|
228
|
-
const message = typeof error?.message ===
|
|
235
|
+
const message = typeof error?.message === "string" ? error.message : "";
|
|
229
236
|
const mountConflict = (0, devServer_1.parseMountConflictError)(message);
|
|
230
237
|
if (mountConflict) {
|
|
231
238
|
(0, messages_1.printErrorWithHelp)(`A different dev session already owns ${mountConflict.ref}.`, [
|
|
232
239
|
`Active owner pid: ${mountConflict.ownerPid}.`,
|
|
233
240
|
`Mounted repo root: ${mountConflict.repoRoot}.`,
|
|
234
241
|
`Mounted HTML path: ${mountConflict.htmlPath}.`,
|
|
235
|
-
], { command:
|
|
242
|
+
], { command: "project dev-browser" });
|
|
236
243
|
}
|
|
237
|
-
else if (message.startsWith(
|
|
244
|
+
else if (message.startsWith("dev_router_incompatible:")) {
|
|
238
245
|
(0, messages_1.printErrorWithHelp)(`An incompatible shared dev router is already running on port ${devServer_1.DEV_ROUTER_PORT}.`, [
|
|
239
246
|
'Stop the existing dev router process, then retry "playdrop project dev-browser".',
|
|
240
247
|
'If needed, rebuild the local CLI first with "npm run build --workspace @playdrop/playdrop-cli".',
|
|
241
|
-
], { command:
|
|
248
|
+
], { command: "project dev-browser" });
|
|
242
249
|
}
|
|
243
250
|
else {
|
|
244
251
|
(0, messages_1.printErrorWithHelp)(error?.message || `Failed to start the shared dev router on port ${devServer_1.DEV_ROUTER_PORT}.`, [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
], { command:
|
|
252
|
+
"Close the conflicting process or wait for the stale mount to exit.",
|
|
253
|
+
"Ensure the app HTML file exists and is readable.",
|
|
254
|
+
], { command: "project dev-browser" });
|
|
248
255
|
}
|
|
249
256
|
process.exitCode = 1;
|
|
250
257
|
return;
|
|
@@ -255,10 +262,10 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
255
262
|
appType,
|
|
256
263
|
devAuth: devAuthSelection.devAuth,
|
|
257
264
|
player: devAuthSelection.player ? String(devAuthSelection.player) : null,
|
|
258
|
-
launchCheck: devAuthSelection.devAuth !==
|
|
265
|
+
launchCheck: devAuthSelection.devAuth !== "prompt",
|
|
259
266
|
});
|
|
260
267
|
let launchUrl = devUrl;
|
|
261
|
-
if (devAuthSelection.devAuth !==
|
|
268
|
+
if (devAuthSelection.devAuth !== "anonymous") {
|
|
262
269
|
try {
|
|
263
270
|
const target = new URL(devUrl);
|
|
264
271
|
const launch = await client.startCliWebLaunch({
|
|
@@ -272,17 +279,17 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
272
279
|
return;
|
|
273
280
|
}
|
|
274
281
|
if (error instanceof types_1.UnsupportedClientError) {
|
|
275
|
-
(0, http_1.handleUnsupportedError)(error,
|
|
282
|
+
(0, http_1.handleUnsupportedError)(error, "Dev browser launch");
|
|
276
283
|
process.exitCode = 1;
|
|
277
284
|
return;
|
|
278
285
|
}
|
|
279
286
|
if (error instanceof types_1.ApiError) {
|
|
280
|
-
(0, messages_1.printErrorWithHelp)(`Could not prepare the Playdrop browser session (status ${error.status}).`, ['Run "playdrop auth login" and retry the dev browser command.'], { command:
|
|
287
|
+
(0, messages_1.printErrorWithHelp)(`Could not prepare the Playdrop browser session (status ${error.status}).`, ['Run "playdrop auth login" and retry the dev browser command.'], { command: "project dev-browser" });
|
|
281
288
|
process.exitCode = 1;
|
|
282
289
|
return;
|
|
283
290
|
}
|
|
284
291
|
if ((0, devShared_1.isNetworkError)(error)) {
|
|
285
|
-
(0, messages_1.printNetworkIssue)(
|
|
292
|
+
(0, messages_1.printNetworkIssue)("Could not reach the Playdrop API to prepare the browser session.", "project dev-browser");
|
|
286
293
|
process.exitCode = 1;
|
|
287
294
|
return;
|
|
288
295
|
}
|
|
@@ -291,7 +298,7 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
291
298
|
}
|
|
292
299
|
const entryLabel = (0, node_path_1.relative)(process.cwd(), filePath) || filePath;
|
|
293
300
|
const runtimeRootLabel = (0, node_path_1.relative)(process.cwd(), (0, node_path_1.dirname)(filePath)) || (0, node_path_1.dirname)(filePath);
|
|
294
|
-
const profileDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)(node_os_1.default.tmpdir(),
|
|
301
|
+
const profileDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)(node_os_1.default.tmpdir(), "playdrop-dev-browser-"));
|
|
295
302
|
console.log(`App dev router mounted at ${handle.appUrl}`);
|
|
296
303
|
console.log(`Serving ${entryLabel}`);
|
|
297
304
|
console.log(`Static root ${runtimeRootLabel}`);
|
|
@@ -305,8 +312,8 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
305
312
|
if (launchUrl !== devUrl) {
|
|
306
313
|
console.log(`Launch URL: ${launchUrl}`);
|
|
307
314
|
}
|
|
308
|
-
console.log(
|
|
309
|
-
console.log(
|
|
315
|
+
console.log("Opening an isolated Chromium dev window.");
|
|
316
|
+
console.log("Close the browser window or press Ctrl+C to stop.");
|
|
310
317
|
let context = null;
|
|
311
318
|
let cleanedUp = false;
|
|
312
319
|
const cleanup = async () => {
|
|
@@ -314,8 +321,8 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
314
321
|
return;
|
|
315
322
|
}
|
|
316
323
|
cleanedUp = true;
|
|
317
|
-
process.off(
|
|
318
|
-
process.off(
|
|
324
|
+
process.off("SIGINT", handleSignal);
|
|
325
|
+
process.off("SIGTERM", handleSignal);
|
|
319
326
|
if (context) {
|
|
320
327
|
try {
|
|
321
328
|
await context.close();
|
|
@@ -334,28 +341,30 @@ async function devBrowser(targetArg, options = {}) {
|
|
|
334
341
|
const handleSignal = () => {
|
|
335
342
|
void cleanup();
|
|
336
343
|
};
|
|
337
|
-
process.on(
|
|
338
|
-
process.on(
|
|
344
|
+
process.on("SIGINT", handleSignal);
|
|
345
|
+
process.on("SIGTERM", handleSignal);
|
|
339
346
|
try {
|
|
340
347
|
context = await (0, playwright_1.launchPersistentChromiumContext)(profileDir, {
|
|
341
|
-
automationOrigin: devAuthSelection.devAuth ===
|
|
348
|
+
automationOrigin: devAuthSelection.devAuth === "prompt" ? null : new URL(devUrl).origin,
|
|
342
349
|
viewport: { width: 1440, height: 960 },
|
|
343
350
|
});
|
|
344
351
|
}
|
|
345
352
|
catch (error) {
|
|
346
353
|
await cleanup();
|
|
347
|
-
(0, messages_1.printErrorWithHelp)(error?.message ||
|
|
354
|
+
(0, messages_1.printErrorWithHelp)(error?.message || "Failed to launch the Playdrop dev browser.", ['Install Playwright Chromium with "npx playwright install chromium" and retry.'], { command: "project dev-browser" });
|
|
348
355
|
process.exitCode = 1;
|
|
349
356
|
return;
|
|
350
357
|
}
|
|
351
358
|
try {
|
|
352
|
-
const page = context.pages()[0] ?? await context.newPage();
|
|
353
|
-
await page.goto(launchUrl, { waitUntil:
|
|
359
|
+
const page = context.pages()[0] ?? (await context.newPage());
|
|
360
|
+
await page.goto(launchUrl, { waitUntil: "domcontentloaded" });
|
|
354
361
|
await waitForContextClose(context);
|
|
355
362
|
}
|
|
356
363
|
catch (error) {
|
|
357
364
|
await cleanup();
|
|
358
|
-
(0, messages_1.printErrorWithHelp)(error?.message ||
|
|
365
|
+
(0, messages_1.printErrorWithHelp)(error?.message || "Failed to open the Playdrop dev browser window.", [], {
|
|
366
|
+
command: "project dev-browser",
|
|
367
|
+
});
|
|
359
368
|
process.exitCode = 1;
|
|
360
369
|
return;
|
|
361
370
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ApiClient } from
|
|
2
|
-
import { type AppAuthMode, type AppControllerMode, type AppMetadataAssetSpecSupport, type AppRuntimeAssetsResponse, type AppSurface, type AppType, type TweakValues } from
|
|
3
|
-
import type { AppTask } from
|
|
1
|
+
import type { ApiClient } from "@playdrop/api-client";
|
|
2
|
+
import { type AppAuthMode, type AppControllerMode, type AppMetadataAssetSpecSupport, type AppRuntimeAssetsResponse, type AppSurface, type AppType, type TweakValues } from "@playdrop/types";
|
|
3
|
+
import type { AppTask } from "../catalogue";
|
|
4
4
|
export type LocalOwnedRuntimeAssetFileRecord = {
|
|
5
5
|
absolutePath: string;
|
|
6
6
|
contentType: string | null;
|
|
@@ -28,7 +28,7 @@ export declare function createEmptyDevRuntimeAssetManifest(): DevRuntimeAssetMan
|
|
|
28
28
|
export declare function buildLocalDevRuntimeAssetsUrl(appBaseUrl: string): string;
|
|
29
29
|
export declare function buildLocalDevRuntimeAssetFileUrl(appBaseUrl: string, ownedAssetName: string, role: string): string;
|
|
30
30
|
export declare function buildDevRuntimeAssetManifest(input: {
|
|
31
|
-
client?: Pick<ApiClient,
|
|
31
|
+
client?: Pick<ApiClient, "resolveRuntimeAssets">;
|
|
32
32
|
apiBase: string;
|
|
33
33
|
task: AppTask;
|
|
34
34
|
creatorUsername: string;
|
|
@@ -12,10 +12,10 @@ function createEmptyDevRuntimeAssetManifest() {
|
|
|
12
12
|
return {
|
|
13
13
|
response: {
|
|
14
14
|
appVersionId: 0,
|
|
15
|
-
appVersion:
|
|
15
|
+
appVersion: "dev",
|
|
16
16
|
assets: [],
|
|
17
17
|
localAppMetadata: {
|
|
18
|
-
type:
|
|
18
|
+
type: "GAME",
|
|
19
19
|
surfaceTargets: Array.from(types_1.DEFAULT_APP_SURFACE_TARGETS),
|
|
20
20
|
authMode: types_1.DEFAULT_APP_AUTH_MODE,
|
|
21
21
|
controllerMode: types_1.DEFAULT_APP_CONTROLLER_MODE,
|
|
@@ -29,26 +29,26 @@ function createEmptyDevRuntimeAssetManifest() {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
const CONTENT_TYPE_BY_EXTENSION = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
".html": "text/html; charset=utf-8",
|
|
33
|
+
".js": "application/javascript; charset=utf-8",
|
|
34
|
+
".mjs": "application/javascript; charset=utf-8",
|
|
35
|
+
".cjs": "application/javascript; charset=utf-8",
|
|
36
|
+
".css": "text/css; charset=utf-8",
|
|
37
|
+
".json": "application/json; charset=utf-8",
|
|
38
|
+
".png": "image/png",
|
|
39
|
+
".jpg": "image/jpeg",
|
|
40
|
+
".jpeg": "image/jpeg",
|
|
41
|
+
".gif": "image/gif",
|
|
42
|
+
".svg": "image/svg+xml",
|
|
43
|
+
".webp": "image/webp",
|
|
44
|
+
".glb": "model/gltf-binary",
|
|
45
|
+
".gltf": "model/gltf+json",
|
|
46
|
+
".wasm": "application/wasm",
|
|
47
|
+
".mp4": "video/mp4",
|
|
48
|
+
".webm": "video/webm",
|
|
49
|
+
".ogg": "audio/ogg",
|
|
50
|
+
".mp3": "audio/mpeg",
|
|
51
|
+
".wav": "audio/wav",
|
|
52
52
|
};
|
|
53
53
|
function inferContentType(filePath) {
|
|
54
54
|
const extension = (0, node_path_1.extname)(filePath).toLowerCase();
|
|
@@ -56,18 +56,18 @@ function inferContentType(filePath) {
|
|
|
56
56
|
}
|
|
57
57
|
function buildSyntheticLocalAssetRef(creatorUsername, appName, ownedAssetName) {
|
|
58
58
|
return (0, types_1.formatContentVersionRef)({
|
|
59
|
-
kind:
|
|
59
|
+
kind: "asset",
|
|
60
60
|
creatorUsername: `${creatorUsername}-dev`,
|
|
61
61
|
name: `${appName}-${ownedAssetName}`,
|
|
62
62
|
revision: 1,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function buildLocalDevRuntimeAssetsUrl(appBaseUrl) {
|
|
66
|
-
const base = appBaseUrl.endsWith(
|
|
66
|
+
const base = appBaseUrl.endsWith("/") ? appBaseUrl.slice(0, -1) : appBaseUrl;
|
|
67
67
|
return `${base}/_playdrop/runtime-assets`;
|
|
68
68
|
}
|
|
69
69
|
function buildLocalDevRuntimeAssetFileUrl(appBaseUrl, ownedAssetName, role) {
|
|
70
|
-
const base = appBaseUrl.endsWith(
|
|
70
|
+
const base = appBaseUrl.endsWith("/") ? appBaseUrl.slice(0, -1) : appBaseUrl;
|
|
71
71
|
return `${base}/_playdrop/runtime-assets/files/${encodeURIComponent(ownedAssetName)}?role=${encodeURIComponent(role)}`;
|
|
72
72
|
}
|
|
73
73
|
function createLocalOwnedAssetSummary(task, creatorUsername, appBaseUrl, ownedAsset) {
|
|
@@ -93,14 +93,14 @@ function createLocalOwnedAssetSummary(task, creatorUsername, appBaseUrl, ownedAs
|
|
|
93
93
|
asset: {
|
|
94
94
|
assetRef: buildSyntheticLocalAssetRef(creatorUsername, task.name, ownedAsset.name),
|
|
95
95
|
runtimeKey: ownedAsset.runtimeKey?.trim() || null,
|
|
96
|
-
sourceType:
|
|
96
|
+
sourceType: "OWNED",
|
|
97
97
|
files: runtimeFiles,
|
|
98
98
|
},
|
|
99
99
|
files,
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function assertRuntimeKeyAvailable(seenRuntimeKeys, runtimeKey, context) {
|
|
103
|
-
const normalized = typeof runtimeKey ===
|
|
103
|
+
const normalized = typeof runtimeKey === "string" ? runtimeKey.trim() : "";
|
|
104
104
|
if (!normalized) {
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
@@ -125,14 +125,12 @@ function buildLocalAppMetadata(task) {
|
|
|
125
125
|
versionRange: entry.versionRange,
|
|
126
126
|
capabilities: Array.from(entry.capabilities),
|
|
127
127
|
})),
|
|
128
|
-
version: typeof task.version ===
|
|
129
|
-
...(task.tweaks && task.tweaks.removed !== true
|
|
130
|
-
? { tweakValues: { ...task.tweaks.defaults } }
|
|
131
|
-
: {}),
|
|
128
|
+
version: typeof task.version === "string" && task.version.trim().length > 0 ? task.version.trim() : null,
|
|
129
|
+
...(task.tweaks && task.tweaks.removed !== true ? { tweakValues: { ...task.tweaks.defaults } } : {}),
|
|
132
130
|
};
|
|
133
131
|
}
|
|
134
132
|
function assertCustomAssetVersionSupported(task, assetRef, version) {
|
|
135
|
-
if (typeof version.assetSpecVersionRef !==
|
|
133
|
+
if (typeof version.assetSpecVersionRef !== "string" || version.assetSpecVersionRef.trim().length === 0) {
|
|
136
134
|
return;
|
|
137
135
|
}
|
|
138
136
|
const parsedAssetSpecVersion = (0, types_1.parseAssetSpecVersionRef)(version.assetSpecVersionRef);
|
|
@@ -140,13 +138,13 @@ function assertCustomAssetVersionSupported(task, assetRef, version) {
|
|
|
140
138
|
throw new Error(`dev_runtime_asset_spec_invalid:${assetRef}:${version.assetSpecVersionRef}`);
|
|
141
139
|
}
|
|
142
140
|
const assetSpecFamilyRef = (0, types_1.formatAssetSpecFamilyRef)({
|
|
143
|
-
kind:
|
|
141
|
+
kind: "asset-spec",
|
|
144
142
|
creatorUsername: parsedAssetSpecVersion.creatorUsername,
|
|
145
143
|
name: parsedAssetSpecVersion.name,
|
|
146
144
|
});
|
|
147
|
-
const supported = task.assetSpecSupport.some((entry) =>
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
const supported = task.assetSpecSupport.some((entry) => entry.assetSpec === assetSpecFamilyRef &&
|
|
146
|
+
entry.capabilities.includes("READ") &&
|
|
147
|
+
(0, semver_1.satisfies)(parsedAssetSpecVersion.version, entry.versionRange, { includePrerelease: false }));
|
|
150
148
|
if (!supported) {
|
|
151
149
|
throw new Error(`dev_runtime_asset_spec_unsupported:${assetRef}:${version.assetSpecVersionRef}`);
|
|
152
150
|
}
|
|
@@ -170,7 +168,7 @@ async function buildDevRuntimeAssetManifest(input) {
|
|
|
170
168
|
const directDependencies = input.task.uses.assets.map((dependency) => {
|
|
171
169
|
assertRuntimeKeyAvailable(seenRuntimeKeys, dependency.runtimeKey, dependency.ref);
|
|
172
170
|
const parsedDependencyRef = (0, types_1.parseContentVersionRef)(dependency.ref);
|
|
173
|
-
if (!parsedDependencyRef || parsedDependencyRef.kind !==
|
|
171
|
+
if (!parsedDependencyRef || parsedDependencyRef.kind !== "asset") {
|
|
174
172
|
throw new Error(`dev_runtime_asset_ref_invalid:${dependency.ref}`);
|
|
175
173
|
}
|
|
176
174
|
return {
|
|
@@ -180,21 +178,21 @@ async function buildDevRuntimeAssetManifest(input) {
|
|
|
180
178
|
});
|
|
181
179
|
const packDependencies = input.task.uses.packs.map((packRef) => {
|
|
182
180
|
const parsedPackRef = (0, types_1.parseContentVersionRef)(packRef);
|
|
183
|
-
if (!parsedPackRef || parsedPackRef.kind !==
|
|
181
|
+
if (!parsedPackRef || parsedPackRef.kind !== "pack") {
|
|
184
182
|
throw new Error(`dev_runtime_pack_ref_invalid:${packRef}`);
|
|
185
183
|
}
|
|
186
184
|
return (0, types_1.formatContentVersionRef)(parsedPackRef);
|
|
187
185
|
});
|
|
188
186
|
if (directDependencies.length > 0 || packDependencies.length > 0) {
|
|
189
187
|
if (!input.client) {
|
|
190
|
-
throw new Error(
|
|
188
|
+
throw new Error("dev_runtime_asset_resolver_missing");
|
|
191
189
|
}
|
|
192
190
|
const resolved = await input.client.resolveRuntimeAssets({
|
|
193
191
|
assets: directDependencies,
|
|
194
192
|
packs: packDependencies,
|
|
195
193
|
});
|
|
196
194
|
for (const entry of resolved.assets) {
|
|
197
|
-
if (entry.sourceType !==
|
|
195
|
+
if (entry.sourceType !== "DIRECT" && entry.sourceType !== "PACK") {
|
|
198
196
|
throw new Error(`dev_runtime_asset_source_type_invalid:${entry.assetRef}:${entry.sourceType}`);
|
|
199
197
|
}
|
|
200
198
|
assertCustomAssetVersionSupported(input.task, entry.assetRef, entry);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ChildProcess } from
|
|
2
|
-
import http from
|
|
3
|
-
import type { DevRuntimeAssetManifestRegistration } from
|
|
4
|
-
import type { ProjectInfo } from
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import type { DevRuntimeAssetManifestRegistration } from "./devRuntimeAssets";
|
|
4
|
+
import type { ProjectInfo } from "./devShared";
|
|
5
5
|
export interface StartDevServerOptions {
|
|
6
6
|
appName: string;
|
|
7
7
|
appType: string;
|