@playdrop/playdrop-cli 0.16.5 → 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/bin/playdrop
CHANGED
package/config/client-meta.json
CHANGED
package/dist/apiClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ApiClient } from
|
|
2
|
-
import { type AiClient } from
|
|
1
|
+
import { type ApiClient } from "@playdrop/api-client";
|
|
2
|
+
import { type AiClient } from "@playdrop/ai-client";
|
|
3
3
|
type ClientOptions = {
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
token?: string | null;
|
package/dist/apiClient.js
CHANGED
|
@@ -15,50 +15,46 @@ function readPositiveIntEnv(name) {
|
|
|
15
15
|
return Number.isInteger(parsed) && parsed > 0 ? parsed : null;
|
|
16
16
|
}
|
|
17
17
|
function readWorkerTaskTokenEnv() {
|
|
18
|
-
if (process.env.PLAYDROP_WORKER_CONTEXT !==
|
|
19
|
-
return
|
|
18
|
+
if (process.env.PLAYDROP_WORKER_CONTEXT !== "1") {
|
|
19
|
+
return "";
|
|
20
20
|
}
|
|
21
|
-
const token = process.env.PLAYDROP_WORKER_TASK_TOKEN?.trim() ??
|
|
21
|
+
const token = process.env.PLAYDROP_WORKER_TASK_TOKEN?.trim() ?? "";
|
|
22
22
|
if (!token) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error("worker_task_token_missing");
|
|
24
24
|
}
|
|
25
25
|
return token;
|
|
26
26
|
}
|
|
27
27
|
function createCliClientHeaders(input) {
|
|
28
28
|
const onBehalfCreatorUsername = input.onBehalfCreatorUsername;
|
|
29
|
-
const creatorUsername = typeof onBehalfCreatorUsername ===
|
|
30
|
-
|
|
31
|
-
: '';
|
|
32
|
-
const explicitAgentTaskToken = typeof input.agentTaskToken === 'string'
|
|
33
|
-
? input.agentTaskToken.trim()
|
|
34
|
-
: '';
|
|
29
|
+
const creatorUsername = typeof onBehalfCreatorUsername === "string" ? onBehalfCreatorUsername.trim() : "";
|
|
30
|
+
const explicitAgentTaskToken = typeof input.agentTaskToken === "string" ? input.agentTaskToken.trim() : "";
|
|
35
31
|
const workerTaskToken = readWorkerTaskTokenEnv();
|
|
36
32
|
if (explicitAgentTaskToken && workerTaskToken && explicitAgentTaskToken !== workerTaskToken) {
|
|
37
|
-
throw new Error(
|
|
33
|
+
throw new Error("worker_task_token_mismatch");
|
|
38
34
|
}
|
|
39
35
|
const agentTaskToken = explicitAgentTaskToken || workerTaskToken;
|
|
40
36
|
const agentTaskId = Number.isInteger(input.agentTaskId) && Number(input.agentTaskId) > 0
|
|
41
37
|
? Number(input.agentTaskId)
|
|
42
|
-
: readPositiveIntEnv(
|
|
38
|
+
: readPositiveIntEnv("PLAYDROP_WORKER_TASK_ID");
|
|
43
39
|
const agentTaskAttempt = Number.isInteger(input.agentTaskAttempt) && Number(input.agentTaskAttempt) > 0
|
|
44
40
|
? Number(input.agentTaskAttempt)
|
|
45
|
-
: readPositiveIntEnv(
|
|
46
|
-
if (agentTaskToken && process.env.PLAYDROP_WORKER_CONTEXT ===
|
|
47
|
-
throw new Error(
|
|
41
|
+
: readPositiveIntEnv("PLAYDROP_WORKER_TASK_ATTEMPT");
|
|
42
|
+
if (agentTaskToken && process.env.PLAYDROP_WORKER_CONTEXT === "1" && (!agentTaskId || !agentTaskAttempt)) {
|
|
43
|
+
throw new Error("worker_ai_generation_task_context_missing");
|
|
48
44
|
}
|
|
49
45
|
return {
|
|
50
46
|
...(0, clientInfo_1.createClientHeaders)(),
|
|
51
47
|
...(creatorUsername
|
|
52
48
|
? {
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
"x-playdrop-creator-username": creatorUsername,
|
|
50
|
+
"x-playdrop-ai-paid-by": "creator",
|
|
55
51
|
}
|
|
56
52
|
: {}),
|
|
57
53
|
...(agentTaskToken
|
|
58
54
|
? {
|
|
59
|
-
|
|
60
|
-
...(agentTaskId ? {
|
|
61
|
-
...(agentTaskAttempt ? {
|
|
55
|
+
"x-playdrop-agent-task-token": agentTaskToken,
|
|
56
|
+
...(agentTaskId ? { "x-playdrop-agent-task-id": String(agentTaskId) } : {}),
|
|
57
|
+
...(agentTaskAttempt ? { "x-playdrop-agent-task-attempt": String(agentTaskAttempt) } : {}),
|
|
62
58
|
}
|
|
63
59
|
: {}),
|
|
64
60
|
};
|
package/dist/appUrls.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppType } from
|
|
1
|
+
import type { AppType } from "@playdrop/types";
|
|
2
2
|
export type AppUrlInput = {
|
|
3
3
|
creatorUsername: string;
|
|
4
4
|
appName: string;
|
|
@@ -19,7 +19,7 @@ export declare function buildPlatformPrivateDraftPlayUrl(webBase: string | null
|
|
|
19
19
|
version: string;
|
|
20
20
|
}): string;
|
|
21
21
|
export declare function buildPlatformDevUrl(webBase: string | null | undefined, input: AppUrlInput & {
|
|
22
|
-
devAuth?:
|
|
22
|
+
devAuth?: "prompt" | "anonymous" | "viewer" | "player";
|
|
23
23
|
player?: string | null;
|
|
24
24
|
launchCheck?: boolean;
|
|
25
25
|
localDevPort?: number | string | null;
|
package/dist/appUrls.js
CHANGED
|
@@ -9,50 +9,50 @@ exports.buildPlatformPlayUrl = buildPlatformPlayUrl;
|
|
|
9
9
|
exports.buildPlatformPrivateDraftPlayUrl = buildPlatformPrivateDraftPlayUrl;
|
|
10
10
|
exports.buildPlatformDevUrl = buildPlatformDevUrl;
|
|
11
11
|
exports.buildUploadLaunchCheckUrl = buildUploadLaunchCheckUrl;
|
|
12
|
-
const DEFAULT_WEB_BASE =
|
|
12
|
+
const DEFAULT_WEB_BASE = "https://www.playdrop.ai";
|
|
13
13
|
function appendTaskCaptureSession(url, session) {
|
|
14
14
|
if (!session) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (!Number.isInteger(session.appId) || session.appId <= 0) {
|
|
18
|
-
throw new Error(
|
|
18
|
+
throw new Error("invalid_capture_app_id");
|
|
19
19
|
}
|
|
20
20
|
if (!Number.isInteger(session.taskId) || session.taskId <= 0 || !session.taskToken.trim()) {
|
|
21
|
-
throw new Error(
|
|
21
|
+
throw new Error("invalid_capture_task_session");
|
|
22
22
|
}
|
|
23
|
-
url.searchParams.set(
|
|
24
|
-
url.searchParams.set(
|
|
25
|
-
url.searchParams.set(
|
|
23
|
+
url.searchParams.set("captureAppId", String(session.appId));
|
|
24
|
+
url.searchParams.set("captureTaskId", String(session.taskId));
|
|
25
|
+
url.searchParams.set("captureTaskToken", session.taskToken.trim());
|
|
26
26
|
}
|
|
27
27
|
function redactTaskCaptureSession(url) {
|
|
28
28
|
const redacted = new URL(url);
|
|
29
|
-
if (redacted.searchParams.has(
|
|
30
|
-
redacted.searchParams.set(
|
|
29
|
+
if (redacted.searchParams.has("captureTaskToken")) {
|
|
30
|
+
redacted.searchParams.set("captureTaskToken", "<redacted>");
|
|
31
31
|
}
|
|
32
32
|
return redacted.toString();
|
|
33
33
|
}
|
|
34
34
|
function redactTaskCaptureToken(text, sourceUrl) {
|
|
35
|
-
const taskToken = new URL(sourceUrl).searchParams.get(
|
|
36
|
-
return taskToken ? text.split(taskToken).join(
|
|
35
|
+
const taskToken = new URL(sourceUrl).searchParams.get("captureTaskToken")?.trim() ?? "";
|
|
36
|
+
return taskToken ? text.split(taskToken).join("<redacted>") : text;
|
|
37
37
|
}
|
|
38
38
|
function normalizePlaydropWebBase(webBase) {
|
|
39
|
-
const base = typeof webBase ===
|
|
40
|
-
return base.replace(/\/$/,
|
|
39
|
+
const base = typeof webBase === "string" && webBase.trim().length > 0 ? webBase.trim() : DEFAULT_WEB_BASE;
|
|
40
|
+
return base.replace(/\/$/, "");
|
|
41
41
|
}
|
|
42
42
|
function getAppTypeSlug(type) {
|
|
43
|
-
if (typeof type !==
|
|
44
|
-
return
|
|
43
|
+
if (typeof type !== "string") {
|
|
44
|
+
return "game";
|
|
45
45
|
}
|
|
46
46
|
switch (type) {
|
|
47
|
-
case
|
|
48
|
-
return
|
|
49
|
-
case
|
|
50
|
-
return
|
|
51
|
-
case
|
|
52
|
-
return
|
|
53
|
-
case
|
|
47
|
+
case "DEMO":
|
|
48
|
+
return "demo";
|
|
49
|
+
case "TOOL":
|
|
50
|
+
return "tool";
|
|
51
|
+
case "TEMPLATE":
|
|
52
|
+
return "template";
|
|
53
|
+
case "GAME":
|
|
54
54
|
default:
|
|
55
|
-
return
|
|
55
|
+
return "game";
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
function buildPlatformPlayUrl(webBase, input) {
|
|
@@ -69,7 +69,7 @@ function buildPlatformPrivateDraftPlayUrl(webBase, input) {
|
|
|
69
69
|
const appName = encodeURIComponent(input.appName);
|
|
70
70
|
const version = encodeURIComponent(input.version.trim());
|
|
71
71
|
if (!version) {
|
|
72
|
-
throw new Error(
|
|
72
|
+
throw new Error("invalid_private_draft_play_version");
|
|
73
73
|
}
|
|
74
74
|
return `${base}/_auth/creators/${creator}/apps/${typeSlug}/${appName}/play?v=${version}`;
|
|
75
75
|
}
|
|
@@ -79,23 +79,21 @@ function buildPlatformDevUrl(webBase, input) {
|
|
|
79
79
|
const typeSlug = getAppTypeSlug(input.appType);
|
|
80
80
|
const appName = encodeURIComponent(input.appName);
|
|
81
81
|
const url = new URL(`${base}/creators/${creator}/apps/${typeSlug}/${appName}/dev`);
|
|
82
|
-
if (typeof input.devAuth ===
|
|
83
|
-
url.searchParams.set(
|
|
82
|
+
if (typeof input.devAuth === "string" && input.devAuth.trim().length > 0) {
|
|
83
|
+
url.searchParams.set("devAuth", input.devAuth.trim());
|
|
84
84
|
}
|
|
85
|
-
if (typeof input.player ===
|
|
86
|
-
url.searchParams.set(
|
|
85
|
+
if (typeof input.player === "string" && input.player.trim().length > 0) {
|
|
86
|
+
url.searchParams.set("player", input.player.trim());
|
|
87
87
|
}
|
|
88
88
|
if (input.launchCheck) {
|
|
89
|
-
url.searchParams.set(
|
|
89
|
+
url.searchParams.set("launchCheck", "1");
|
|
90
90
|
}
|
|
91
91
|
if (input.localDevPort !== null && input.localDevPort !== undefined) {
|
|
92
|
-
const port = typeof input.localDevPort ===
|
|
93
|
-
? input.localDevPort
|
|
94
|
-
: Number.parseInt(String(input.localDevPort), 10);
|
|
92
|
+
const port = typeof input.localDevPort === "number" ? input.localDevPort : Number.parseInt(String(input.localDevPort), 10);
|
|
95
93
|
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
96
|
-
throw new Error(
|
|
94
|
+
throw new Error("invalid_local_dev_port");
|
|
97
95
|
}
|
|
98
|
-
url.searchParams.set(
|
|
96
|
+
url.searchParams.set("localDevPort", String(port));
|
|
99
97
|
}
|
|
100
98
|
appendTaskCaptureSession(url, input.captureSession);
|
|
101
99
|
return url.toString();
|
package/dist/apps/build.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppPlaytestTapes, AppSurface, AppType } from
|
|
2
|
-
import type { AppTask } from
|
|
1
|
+
import type { AppPlaytestTapes, AppSurface, AppType } from "@playdrop/types";
|
|
2
|
+
import type { AppTask } from "../catalogue";
|
|
3
3
|
export type AppBuildMetadata = {
|
|
4
4
|
displayName?: string;
|
|
5
5
|
subtitle?: string;
|
package/dist/apps/build.js
CHANGED
|
@@ -9,36 +9,36 @@ const promises_1 = require("node:fs/promises");
|
|
|
9
9
|
const node_path_1 = require("node:path");
|
|
10
10
|
const node_zlib_1 = require("node:zlib");
|
|
11
11
|
const BASE_SOURCE_IGNORE_PATTERNS = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
"node_modules/",
|
|
13
|
+
"dist/",
|
|
14
|
+
"build/",
|
|
15
|
+
"out/",
|
|
16
|
+
".next/",
|
|
17
|
+
".turbo/",
|
|
18
|
+
".cache/",
|
|
19
|
+
".git/",
|
|
20
|
+
".idea/",
|
|
21
|
+
".svelte-kit/",
|
|
22
|
+
".DS_Store",
|
|
23
|
+
"*.log",
|
|
24
|
+
"*.tmp",
|
|
25
|
+
"*.zip",
|
|
26
|
+
"tmp/",
|
|
27
|
+
"logs/",
|
|
28
|
+
"coverage/",
|
|
29
|
+
".vercel/",
|
|
30
|
+
".netlify/",
|
|
31
31
|
];
|
|
32
32
|
const projectBuildCache = new Map();
|
|
33
33
|
const typescriptSourceCache = new Map();
|
|
34
34
|
async function runNpmScript(projectDir, script) {
|
|
35
35
|
await (0, promises_1.mkdir)(projectDir, { recursive: true });
|
|
36
|
-
const npmCommand = process.platform ===
|
|
37
|
-
const npmArgs = process.platform ===
|
|
36
|
+
const npmCommand = process.platform === "win32" ? process.env.ComSpec || "cmd.exe" : "npm";
|
|
37
|
+
const npmArgs = process.platform === "win32" ? ["/d", "/s", "/c", `npm run ${script}`] : ["run", script];
|
|
38
38
|
await new Promise((resolveRun, rejectRun) => {
|
|
39
39
|
const child = (0, node_child_process_1.spawn)(npmCommand, npmArgs, {
|
|
40
40
|
cwd: projectDir,
|
|
41
|
-
stdio:
|
|
41
|
+
stdio: "inherit",
|
|
42
42
|
env: { ...process.env },
|
|
43
43
|
});
|
|
44
44
|
const settleFromClose = (code) => {
|
|
@@ -46,14 +46,14 @@ async function runNpmScript(projectDir, script) {
|
|
|
46
46
|
resolveRun();
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
rejectRun(new Error(`npm run ${script} failed with exit code ${code ??
|
|
49
|
+
rejectRun(new Error(`npm run ${script} failed with exit code ${code ?? "unknown"}`));
|
|
50
50
|
};
|
|
51
|
-
child.once(
|
|
52
|
-
child.once(
|
|
51
|
+
child.once("error", rejectRun);
|
|
52
|
+
child.once("close", settleFromClose);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function readPackageJson(packageJsonPath) {
|
|
56
|
-
const raw = (0, node_fs_1.readFileSync)(packageJsonPath,
|
|
56
|
+
const raw = (0, node_fs_1.readFileSync)(packageJsonPath, "utf8");
|
|
57
57
|
return JSON.parse(raw);
|
|
58
58
|
}
|
|
59
59
|
async function ensureProjectBuild(task) {
|
|
@@ -64,41 +64,41 @@ async function ensureProjectBuild(task) {
|
|
|
64
64
|
const promise = (async () => {
|
|
65
65
|
const pkg = readPackageJson(task.packageJsonPath);
|
|
66
66
|
const scripts = pkg?.scripts ?? {};
|
|
67
|
-
if (typeof scripts.build !==
|
|
67
|
+
if (typeof scripts.build !== "string") {
|
|
68
68
|
throw new Error(`package.json in ${task.projectDir} is missing a "build" script.`);
|
|
69
69
|
}
|
|
70
|
-
await runNpmScript(task.projectDir,
|
|
70
|
+
await runNpmScript(task.projectDir, "build");
|
|
71
71
|
})();
|
|
72
72
|
projectBuildCache.set(task.projectDir, promise);
|
|
73
73
|
}
|
|
74
74
|
await projectBuildCache.get(task.projectDir);
|
|
75
75
|
}
|
|
76
76
|
function globToRegExp(glob) {
|
|
77
|
-
let pattern =
|
|
77
|
+
let pattern = "^";
|
|
78
78
|
for (let i = 0; i < glob.length; i += 1) {
|
|
79
79
|
const char = glob[i];
|
|
80
|
-
if (char ===
|
|
80
|
+
if (char === "*") {
|
|
81
81
|
const next = glob[i + 1];
|
|
82
|
-
if (next ===
|
|
83
|
-
pattern +=
|
|
82
|
+
if (next === "*") {
|
|
83
|
+
pattern += ".*";
|
|
84
84
|
i += 1;
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
pattern +=
|
|
87
|
+
pattern += "[^/]*";
|
|
88
88
|
}
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
|
-
if (char ===
|
|
92
|
-
pattern +=
|
|
91
|
+
if (char === "?") {
|
|
92
|
+
pattern += ".";
|
|
93
93
|
continue;
|
|
94
94
|
}
|
|
95
|
-
if (
|
|
95
|
+
if ("+.^$|()[]{}".includes(char) || char === "\\") {
|
|
96
96
|
pattern += `\\${char}`;
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
99
|
pattern += char;
|
|
100
100
|
}
|
|
101
|
-
pattern +=
|
|
101
|
+
pattern += "$";
|
|
102
102
|
return new RegExp(pattern);
|
|
103
103
|
}
|
|
104
104
|
function readIgnorePatterns(projectDir, filename) {
|
|
@@ -107,7 +107,7 @@ function readIgnorePatterns(projectDir, filename) {
|
|
|
107
107
|
return [];
|
|
108
108
|
}
|
|
109
109
|
try {
|
|
110
|
-
const content = (0, node_fs_1.readFileSync)(filePath,
|
|
110
|
+
const content = (0, node_fs_1.readFileSync)(filePath, "utf8");
|
|
111
111
|
return content.split(/\r?\n/);
|
|
112
112
|
}
|
|
113
113
|
catch {
|
|
@@ -116,16 +116,16 @@ function readIgnorePatterns(projectDir, filename) {
|
|
|
116
116
|
}
|
|
117
117
|
function buildIgnoreRules(projectDir) {
|
|
118
118
|
const patterns = [...BASE_SOURCE_IGNORE_PATTERNS];
|
|
119
|
-
patterns.push(...readIgnorePatterns(projectDir,
|
|
120
|
-
patterns.push(...readIgnorePatterns(projectDir,
|
|
119
|
+
patterns.push(...readIgnorePatterns(projectDir, ".playdropignore"));
|
|
120
|
+
patterns.push(...readIgnorePatterns(projectDir, ".gitignore"));
|
|
121
121
|
const rules = [];
|
|
122
122
|
for (const rawPattern of patterns) {
|
|
123
123
|
const trimmed = rawPattern.trim();
|
|
124
|
-
if (!trimmed || trimmed.startsWith(
|
|
124
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
const normalized = trimmed.replace(/\\/g,
|
|
128
|
-
if (normalized.endsWith(
|
|
127
|
+
const normalized = trimmed.replace(/\\/g, "/");
|
|
128
|
+
if (normalized.endsWith("/")) {
|
|
129
129
|
const segment = normalized.slice(0, -1);
|
|
130
130
|
const regex = globToRegExp(`**/${segment}/**`);
|
|
131
131
|
rules.push({
|
|
@@ -140,39 +140,39 @@ function buildIgnoreRules(projectDir) {
|
|
|
140
140
|
});
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
143
|
-
if (!normalized.includes(
|
|
143
|
+
if (!normalized.includes("/") && !normalized.includes("*") && !normalized.includes("?")) {
|
|
144
144
|
const name = normalized;
|
|
145
145
|
rules.push({
|
|
146
|
-
matches: path => {
|
|
146
|
+
matches: (path) => {
|
|
147
147
|
if (path === name)
|
|
148
148
|
return true;
|
|
149
149
|
if (path.endsWith(`/${name}`))
|
|
150
150
|
return true;
|
|
151
|
-
return path.split(
|
|
151
|
+
return path.split("/").includes(name);
|
|
152
152
|
},
|
|
153
153
|
});
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
|
-
if (!normalized.includes(
|
|
156
|
+
if (!normalized.includes("*") && !normalized.includes("?")) {
|
|
157
157
|
const target = normalized;
|
|
158
158
|
rules.push({
|
|
159
|
-
matches: path => path === target || path.startsWith(`${target}/`),
|
|
159
|
+
matches: (path) => path === target || path.startsWith(`${target}/`),
|
|
160
160
|
});
|
|
161
161
|
continue;
|
|
162
162
|
}
|
|
163
163
|
const regex = globToRegExp(normalized);
|
|
164
164
|
rules.push({
|
|
165
|
-
matches: path => regex.test(path),
|
|
165
|
+
matches: (path) => regex.test(path),
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
return rules;
|
|
169
169
|
}
|
|
170
170
|
function shouldIgnore(pathFragment, isDir, rules) {
|
|
171
|
-
return rules.some(rule => rule.matches(pathFragment, isDir));
|
|
171
|
+
return rules.some((rule) => rule.matches(pathFragment, isDir));
|
|
172
172
|
}
|
|
173
173
|
function normalizeRelativePath(root, target) {
|
|
174
|
-
const rel = (0, node_path_1.relative)(root, target).split(node_path_1.sep).join(
|
|
175
|
-
return rel.replace(/^\/+/,
|
|
174
|
+
const rel = (0, node_path_1.relative)(root, target).split(node_path_1.sep).join("/");
|
|
175
|
+
return rel.replace(/^\/+/, "");
|
|
176
176
|
}
|
|
177
177
|
function isPathWithinRoot(rootDir, targetPath) {
|
|
178
178
|
const normalizedRoot = (0, node_path_1.resolve)(rootDir);
|
|
@@ -192,11 +192,11 @@ function readProjectDirEntries(current) {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
function appendIncludedProjectFile(rootDir, includePath, excludedRelativeFiles, fileByRelativePath, results, enforceReservedBundleNames) {
|
|
195
|
-
const normalizedIncludePath = (0, node_path_1.normalize)(includePath).split(node_path_1.sep).join(
|
|
196
|
-
if (!normalizedIncludePath || normalizedIncludePath ===
|
|
195
|
+
const normalizedIncludePath = (0, node_path_1.normalize)(includePath).split(node_path_1.sep).join("/");
|
|
196
|
+
if (!normalizedIncludePath || normalizedIncludePath === ".") {
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
if (normalizedIncludePath.startsWith(
|
|
199
|
+
if (normalizedIncludePath.startsWith("..")) {
|
|
200
200
|
throw new Error(`[apps][build] Invalid include file path "${includePath}".`);
|
|
201
201
|
}
|
|
202
202
|
if (excludedRelativeFiles.has(normalizedIncludePath)) {
|
|
@@ -227,8 +227,8 @@ function appendIncludedProjectFile(rootDir, includePath, excludedRelativeFiles,
|
|
|
227
227
|
fileByRelativePath.set(record.relativePath, record);
|
|
228
228
|
}
|
|
229
229
|
function appendIncludedProjectDirectory(rootDir, includeDirectory, excludedRelativeFiles, fileByRelativePath, results, enforceReservedBundleNames) {
|
|
230
|
-
const normalizedDirectory = (0, node_path_1.normalize)(includeDirectory).split(node_path_1.sep).join(
|
|
231
|
-
if (!normalizedDirectory || normalizedDirectory ===
|
|
230
|
+
const normalizedDirectory = (0, node_path_1.normalize)(includeDirectory).split(node_path_1.sep).join("/").replace(/\/+$/, "");
|
|
231
|
+
if (!normalizedDirectory || normalizedDirectory === "." || normalizedDirectory.startsWith("..")) {
|
|
232
232
|
throw new Error(`[apps][build] Invalid include directory path "${includeDirectory}".`);
|
|
233
233
|
}
|
|
234
234
|
const absoluteDirectory = (0, node_path_1.resolve)(rootDir, normalizedDirectory);
|
|
@@ -262,8 +262,8 @@ function collectProjectFiles(rootDir, rules, options) {
|
|
|
262
262
|
const includeRelativeFiles = options?.includeRelativeFiles ?? [];
|
|
263
263
|
const includeRelativeDirectories = options?.includeRelativeDirectories ?? [];
|
|
264
264
|
const excludeRelativeFiles = new Set(Array.from(options?.excludeRelativeFiles ?? [])
|
|
265
|
-
.map((filePath) => (0, node_path_1.normalize)(filePath).split(node_path_1.sep).join(
|
|
266
|
-
.filter((filePath) => filePath.length > 0 && filePath !==
|
|
265
|
+
.map((filePath) => (0, node_path_1.normalize)(filePath).split(node_path_1.sep).join("/"))
|
|
266
|
+
.filter((filePath) => filePath.length > 0 && filePath !== "."));
|
|
267
267
|
const enforceReservedBundleNames = options?.enforceReservedBundleNames ?? false;
|
|
268
268
|
const results = [];
|
|
269
269
|
const fileByRelativePath = new Map();
|
|
@@ -309,7 +309,7 @@ function collectProjectFiles(rootDir, rules, options) {
|
|
|
309
309
|
continue;
|
|
310
310
|
const record = {
|
|
311
311
|
absolutePath,
|
|
312
|
-
relativePath: relativePath.split(
|
|
312
|
+
relativePath: relativePath.split("/").join("/"),
|
|
313
313
|
};
|
|
314
314
|
results.push(record);
|
|
315
315
|
fileByRelativePath.set(record.relativePath, record);
|
|
@@ -329,17 +329,17 @@ function isExcludedRelativePath(relativePath, excludedRelativeFiles) {
|
|
|
329
329
|
return true;
|
|
330
330
|
}
|
|
331
331
|
for (const excludedPath of excludedRelativeFiles) {
|
|
332
|
-
if (excludedPath.endsWith(
|
|
332
|
+
if (excludedPath.endsWith("/") && relativePath.startsWith(excludedPath)) {
|
|
333
333
|
return true;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
return false;
|
|
337
337
|
}
|
|
338
338
|
// Files that are uploaded separately and should not be included in the bundle zip.
|
|
339
|
-
const RESERVED_BUNDLE_FILES = new Set([
|
|
339
|
+
const RESERVED_BUNDLE_FILES = new Set(["source.zip"]);
|
|
340
340
|
function isReservedBundlePath(relativePath) {
|
|
341
|
-
const normalized = relativePath.replace(/\\/g,
|
|
342
|
-
const basenameValue = normalized.split(
|
|
341
|
+
const normalized = relativePath.replace(/\\/g, "/");
|
|
342
|
+
const basenameValue = normalized.split("/").pop()?.toLowerCase() || "";
|
|
343
343
|
return RESERVED_BUNDLE_FILES.has(basenameValue);
|
|
344
344
|
}
|
|
345
345
|
function resolveRuntimeRoot(task) {
|
|
@@ -347,7 +347,7 @@ function resolveRuntimeRoot(task) {
|
|
|
347
347
|
}
|
|
348
348
|
function resolveBundleEntryPoint(task, runtimeRoot) {
|
|
349
349
|
const entryPoint = normalizeRelativePath(runtimeRoot, task.filePath);
|
|
350
|
-
if (!entryPoint || entryPoint.startsWith(
|
|
350
|
+
if (!entryPoint || entryPoint.startsWith("..")) {
|
|
351
351
|
throw new Error(`[apps][build] App entry file for ${task.name} must remain inside runtime root ${runtimeRoot}.`);
|
|
352
352
|
}
|
|
353
353
|
return entryPoint;
|
|
@@ -361,13 +361,13 @@ function normalizeBundleArchiveExclusions(task, runtimeRoot) {
|
|
|
361
361
|
if (!trimmed) {
|
|
362
362
|
continue;
|
|
363
363
|
}
|
|
364
|
-
const isDirectory = trimmed.replace(/\\/g,
|
|
364
|
+
const isDirectory = trimmed.replace(/\\/g, "/").endsWith("/");
|
|
365
365
|
const absolutePath = (0, node_path_1.resolve)(task.projectDir, trimmed);
|
|
366
366
|
if (!isPathWithinRoot(runtimeRootAbsolute, absolutePath)) {
|
|
367
367
|
continue;
|
|
368
368
|
}
|
|
369
369
|
const runtimeRelativePath = normalizeRelativePath(runtimeRootAbsolute, absolutePath);
|
|
370
|
-
if (!runtimeRelativePath || runtimeRelativePath.startsWith(
|
|
370
|
+
if (!runtimeRelativePath || runtimeRelativePath.startsWith("..")) {
|
|
371
371
|
continue;
|
|
372
372
|
}
|
|
373
373
|
normalized.push(isDirectory ? `${runtimeRelativePath}/` : runtimeRelativePath);
|
|
@@ -392,7 +392,7 @@ function collectBundleFiles(task) {
|
|
|
392
392
|
function createBundleArchive(task) {
|
|
393
393
|
const { entries, entryPoint } = collectBundleFiles(task);
|
|
394
394
|
const buffer = createZipArchive(entries);
|
|
395
|
-
const hash = (0, node_crypto_1.createHash)(
|
|
395
|
+
const hash = (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex");
|
|
396
396
|
return { buffer, hash, entryPoint };
|
|
397
397
|
}
|
|
398
398
|
const CRC32_TABLE = (() => {
|
|
@@ -440,7 +440,7 @@ function createZipArchive(entries) {
|
|
|
440
440
|
const compressed = (0, node_zlib_1.deflateRawSync)(data);
|
|
441
441
|
const crc = crc32(data);
|
|
442
442
|
const { dosDate, dosTime } = toDosDateTime(ZIP_STABLE_TIMESTAMP);
|
|
443
|
-
const fileNameBuffer = Buffer.from(entry.relativePath,
|
|
443
|
+
const fileNameBuffer = Buffer.from(entry.relativePath, "utf8");
|
|
444
444
|
const localHeader = Buffer.alloc(30);
|
|
445
445
|
let cursor = 0;
|
|
446
446
|
localHeader.writeUInt32LE(0x04034b50, cursor);
|
|
@@ -531,7 +531,7 @@ function createZipArchive(entries) {
|
|
|
531
531
|
}
|
|
532
532
|
function createSourceArchive(task) {
|
|
533
533
|
const rules = buildIgnoreRules(task.projectDir);
|
|
534
|
-
const includeFiles = [
|
|
534
|
+
const includeFiles = ["README.md", "AGENTS.md"];
|
|
535
535
|
for (const heroPath of [task.listing?.heroPortraitPath, task.listing?.heroLandscapePath]) {
|
|
536
536
|
if (heroPath) {
|
|
537
537
|
includeFiles.push(normalizeRelativePath(task.projectDir, heroPath));
|
|
@@ -539,65 +539,65 @@ function createSourceArchive(task) {
|
|
|
539
539
|
}
|
|
540
540
|
const excludedFiles = task.sourceArchiveExcludeRelativeFiles ?? [];
|
|
541
541
|
if (task.catalogueAbsolutePath && (0, node_fs_1.existsSync)(task.catalogueAbsolutePath)) {
|
|
542
|
-
const relativeCataloguePath = normalizeRelativePath(task.projectDir, task.catalogueAbsolutePath) ||
|
|
542
|
+
const relativeCataloguePath = normalizeRelativePath(task.projectDir, task.catalogueAbsolutePath) || "catalogue.json";
|
|
543
543
|
includeFiles.push(relativeCataloguePath);
|
|
544
544
|
}
|
|
545
545
|
if (task.isTypescriptProject) {
|
|
546
|
-
const cacheKey = [task.projectDir, ...excludedFiles].join(
|
|
546
|
+
const cacheKey = [task.projectDir, ...excludedFiles].join("\u0000");
|
|
547
547
|
const cached = typescriptSourceCache.get(cacheKey);
|
|
548
548
|
if (cached) {
|
|
549
549
|
return cached;
|
|
550
550
|
}
|
|
551
551
|
const entries = collectProjectFiles(task.projectDir, rules, {
|
|
552
552
|
includeRelativeFiles: includeFiles,
|
|
553
|
-
includeRelativeDirectories: [
|
|
553
|
+
includeRelativeDirectories: ["assets/art-direction"],
|
|
554
554
|
excludeRelativeFiles: excludedFiles,
|
|
555
555
|
});
|
|
556
556
|
const buffer = createZipArchive(entries);
|
|
557
|
-
const hash = (0, node_crypto_1.createHash)(
|
|
557
|
+
const hash = (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex");
|
|
558
558
|
const record = { buffer, hash };
|
|
559
559
|
typescriptSourceCache.set(cacheKey, record);
|
|
560
560
|
return record;
|
|
561
561
|
}
|
|
562
562
|
const entries = collectProjectFiles(task.projectDir, rules, {
|
|
563
563
|
includeRelativeFiles: includeFiles,
|
|
564
|
-
includeRelativeDirectories: [
|
|
564
|
+
includeRelativeDirectories: ["assets/art-direction"],
|
|
565
565
|
excludeRelativeFiles: excludedFiles,
|
|
566
566
|
});
|
|
567
567
|
const buffer = createZipArchive(entries);
|
|
568
|
-
const hash = (0, node_crypto_1.createHash)(
|
|
568
|
+
const hash = (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex");
|
|
569
569
|
return { buffer, hash };
|
|
570
570
|
}
|
|
571
571
|
async function buildApp(task) {
|
|
572
572
|
await ensureProjectBuild(task);
|
|
573
573
|
if (!(0, node_fs_1.existsSync)(task.filePath) || !(0, node_fs_1.statSync)(task.filePath).isFile()) {
|
|
574
|
-
const locationHint = task.cataloguePath ||
|
|
574
|
+
const locationHint = task.cataloguePath || "catalogue.json";
|
|
575
575
|
const bundlePath = task.relativeFile || (0, node_path_1.basename)(task.filePath);
|
|
576
576
|
const buildAdvice = task.isTypescriptProject
|
|
577
|
-
?
|
|
578
|
-
:
|
|
577
|
+
? "Run `npm run build` in the project directory and confirm the bundle path."
|
|
578
|
+
: "Confirm the catalogue entry points to an existing HTML file.";
|
|
579
579
|
throw new Error([
|
|
580
580
|
`Bundle not found for ${task.name}: ${bundlePath}`,
|
|
581
581
|
`Check the "file" value in ${locationHint}.`,
|
|
582
582
|
buildAdvice,
|
|
583
|
-
].join(
|
|
583
|
+
].join(" "));
|
|
584
584
|
}
|
|
585
585
|
// Create bundle zip for versioned upload
|
|
586
586
|
const bundleArchive = createBundleArchive(task);
|
|
587
587
|
const bundleFileName = `${task.name}-bundle.zip`;
|
|
588
588
|
const bundleBlobPart = Uint8Array.from(bundleArchive.buffer);
|
|
589
|
-
const bundleFile = new File([bundleBlobPart], bundleFileName, { type:
|
|
589
|
+
const bundleFile = new File([bundleBlobPart], bundleFileName, { type: "application/zip" });
|
|
590
590
|
const bundleHash = bundleArchive.hash;
|
|
591
591
|
const sourceArchive = createSourceArchive(task);
|
|
592
592
|
const sourceFileName = `${task.name}-source.zip`;
|
|
593
593
|
const sourceBlobPart = Uint8Array.from(sourceArchive.buffer);
|
|
594
|
-
const sourceFile = new File([sourceBlobPart], sourceFileName, { type:
|
|
594
|
+
const sourceFile = new File([sourceBlobPart], sourceFileName, { type: "application/zip" });
|
|
595
595
|
const metadata = {};
|
|
596
596
|
if (task.displayName)
|
|
597
597
|
metadata.displayName = task.displayName;
|
|
598
598
|
if (task.subtitle)
|
|
599
599
|
metadata.subtitle = task.subtitle;
|
|
600
|
-
if (typeof task.description ===
|
|
600
|
+
if (typeof task.description === "string")
|
|
601
601
|
metadata.description = task.description;
|
|
602
602
|
if (task.type)
|
|
603
603
|
metadata.type = task.type;
|