@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type InitSummary } from
|
|
2
|
-
export type WorkspaceSource =
|
|
1
|
+
import { type InitSummary } from "./init";
|
|
2
|
+
export type WorkspaceSource = "created" | "found" | "inspected" | "cached";
|
|
3
3
|
export interface WorkspaceEntry {
|
|
4
4
|
path: string;
|
|
5
5
|
name: string;
|
|
@@ -22,25 +22,25 @@ const node_path_1 = require("node:path");
|
|
|
22
22
|
const init_1 = require("./init");
|
|
23
23
|
const output_1 = require("../output");
|
|
24
24
|
const CACHE_VERSION = 1;
|
|
25
|
-
const CATALOGUE_FILE =
|
|
26
|
-
const SKIP_DIRECTORY_NAMES = new Set([
|
|
25
|
+
const CATALOGUE_FILE = "catalogue.json";
|
|
26
|
+
const SKIP_DIRECTORY_NAMES = new Set(["node_modules", "build", "dist", ".next", ".git", "output", "tmp", "Pods"]);
|
|
27
27
|
const WORKSPACE_SEARCH_DEPTH = 6;
|
|
28
28
|
const WORKSPACE_CONTENT_DEPTH = 6;
|
|
29
29
|
class WorkspaceScanError extends Error {
|
|
30
30
|
constructor(message) {
|
|
31
31
|
super(message);
|
|
32
|
-
this.name =
|
|
32
|
+
this.name = "WorkspaceScanError";
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function getDefaultWorkspacePath(homeDir = node_os_1.default.homedir()) {
|
|
36
|
-
return (0, node_path_1.join)(homeDir,
|
|
36
|
+
return (0, node_path_1.join)(homeDir, "PlayDrop");
|
|
37
37
|
}
|
|
38
38
|
function getWorkspaceCachePath() {
|
|
39
39
|
const configPath = process.env.PLAYDROP_CONFIG_PATH;
|
|
40
|
-
if (typeof configPath ===
|
|
41
|
-
return (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.resolve)(configPath.trim())),
|
|
40
|
+
if (typeof configPath === "string" && configPath.trim().length > 0) {
|
|
41
|
+
return (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.resolve)(configPath.trim())), "workspaces.json");
|
|
42
42
|
}
|
|
43
|
-
return (0, node_path_1.join)(node_os_1.default.homedir(),
|
|
43
|
+
return (0, node_path_1.join)(node_os_1.default.homedir(), ".playdrop", "workspaces.json");
|
|
44
44
|
}
|
|
45
45
|
function nowIso() {
|
|
46
46
|
return new Date().toISOString();
|
|
@@ -55,8 +55,8 @@ function emptyCache() {
|
|
|
55
55
|
function loadWorkspaceCache() {
|
|
56
56
|
const cachePath = getWorkspaceCachePath();
|
|
57
57
|
try {
|
|
58
|
-
const parsed = JSON.parse((0, node_fs_1.readFileSync)(cachePath,
|
|
59
|
-
const defaultWorkspacePath = typeof parsed.defaultWorkspacePath ===
|
|
58
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(cachePath, "utf8"));
|
|
59
|
+
const defaultWorkspacePath = typeof parsed.defaultWorkspacePath === "string" && parsed.defaultWorkspacePath.trim().length > 0
|
|
60
60
|
? (0, node_path_1.resolve)(parsed.defaultWorkspacePath)
|
|
61
61
|
: getDefaultWorkspacePath();
|
|
62
62
|
const entries = Array.isArray(parsed.workspaces)
|
|
@@ -80,38 +80,39 @@ function saveWorkspaceCache(cache) {
|
|
|
80
80
|
};
|
|
81
81
|
const cachePath = getWorkspaceCachePath();
|
|
82
82
|
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(cachePath), { recursive: true });
|
|
83
|
-
(0, node_fs_1.writeFileSync)(cachePath, `${JSON.stringify(next, null, 2)}\n`,
|
|
83
|
+
(0, node_fs_1.writeFileSync)(cachePath, `${JSON.stringify(next, null, 2)}\n`, "utf8");
|
|
84
84
|
return next;
|
|
85
85
|
}
|
|
86
86
|
function normalizeWorkspaceEntry(raw) {
|
|
87
|
-
if (!raw || typeof raw !==
|
|
87
|
+
if (!raw || typeof raw !== "object") {
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
const record = raw;
|
|
91
|
-
const rawPath = typeof record.path ===
|
|
91
|
+
const rawPath = typeof record.path === "string" ? record.path.trim() : "";
|
|
92
92
|
if (!rawPath) {
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
const absolutePath = (0, node_path_1.resolve)(rawPath);
|
|
96
|
-
const source = record.source ===
|
|
96
|
+
const source = record.source === "created" ||
|
|
97
|
+
record.source === "found" ||
|
|
98
|
+
record.source === "inspected" ||
|
|
99
|
+
record.source === "cached"
|
|
97
100
|
? record.source
|
|
98
|
-
:
|
|
101
|
+
: "cached";
|
|
99
102
|
return {
|
|
100
103
|
path: absolutePath,
|
|
101
|
-
name: typeof record.name ===
|
|
102
|
-
? record.name.trim()
|
|
103
|
-
: basename(absolutePath),
|
|
104
|
+
name: typeof record.name === "string" && record.name.trim().length > 0 ? record.name.trim() : basename(absolutePath),
|
|
104
105
|
source,
|
|
105
|
-
exists: typeof record.exists ===
|
|
106
|
-
lastSeenAt: typeof record.lastSeenAt ===
|
|
107
|
-
lastScannedAt: typeof record.lastScannedAt ===
|
|
106
|
+
exists: typeof record.exists === "boolean" ? record.exists : undefined,
|
|
107
|
+
lastSeenAt: typeof record.lastSeenAt === "string" ? record.lastSeenAt : undefined,
|
|
108
|
+
lastScannedAt: typeof record.lastScannedAt === "string" ? record.lastScannedAt : undefined,
|
|
108
109
|
appsCount: numberOrZero(record.appsCount),
|
|
109
110
|
assetsCount: numberOrZero(record.assetsCount),
|
|
110
111
|
packsCount: numberOrZero(record.packsCount),
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
function numberOrZero(value) {
|
|
114
|
-
return typeof value ===
|
|
115
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : 0;
|
|
115
116
|
}
|
|
116
117
|
function basename(absolutePath) {
|
|
117
118
|
const parts = absolutePath.split(/[\\/]/).filter(Boolean);
|
|
@@ -155,7 +156,7 @@ function loadWorkspaceCacheWithCurrentContext(options = {}) {
|
|
|
155
156
|
if (!currentWorkspacePath) {
|
|
156
157
|
return cache;
|
|
157
158
|
}
|
|
158
|
-
const entry = inspectWorkspacePath(currentWorkspacePath,
|
|
159
|
+
const entry = inspectWorkspacePath(currentWorkspacePath, "inspected");
|
|
159
160
|
const saved = saveWorkspaceCache({
|
|
160
161
|
...cache,
|
|
161
162
|
workspaces: upsertWorkspace(cache.workspaces, entry),
|
|
@@ -204,11 +205,13 @@ async function initWorkspace(targetPath, options = {}) {
|
|
|
204
205
|
if (!summary) {
|
|
205
206
|
return null;
|
|
206
207
|
}
|
|
207
|
-
const entry = inspectWorkspacePath(workspacePath,
|
|
208
|
+
const entry = inspectWorkspacePath(workspacePath, "created");
|
|
208
209
|
const cache = loadWorkspaceCache();
|
|
209
210
|
saveWorkspaceCache({
|
|
210
211
|
...cache,
|
|
211
|
-
defaultWorkspacePath: hasExplicitTarget
|
|
212
|
+
defaultWorkspacePath: hasExplicitTarget
|
|
213
|
+
? cache.defaultWorkspacePath || getDefaultWorkspacePath(homeDir)
|
|
214
|
+
: workspacePath,
|
|
212
215
|
workspaces: upsertWorkspace(cache.workspaces, entry),
|
|
213
216
|
});
|
|
214
217
|
if (options.json) {
|
|
@@ -226,7 +229,7 @@ async function inspectWorkspace(targetPath, options = {}) {
|
|
|
226
229
|
}
|
|
227
230
|
let entry;
|
|
228
231
|
try {
|
|
229
|
-
entry = inspectWorkspacePath(workspacePath,
|
|
232
|
+
entry = inspectWorkspacePath(workspacePath, "inspected");
|
|
230
233
|
}
|
|
231
234
|
catch (error) {
|
|
232
235
|
printWorkspaceScanError(error);
|
|
@@ -276,10 +279,7 @@ async function refreshWorkspaces(rootArgs = [], options = {}) {
|
|
|
276
279
|
printWorkspaceScanError(error);
|
|
277
280
|
return null;
|
|
278
281
|
}
|
|
279
|
-
const nextWorkspaces = dedupeWorkspaces([
|
|
280
|
-
...cache.workspaces,
|
|
281
|
-
...found,
|
|
282
|
-
]);
|
|
282
|
+
const nextWorkspaces = dedupeWorkspaces([...cache.workspaces, ...found]);
|
|
283
283
|
saveWorkspaceCache({
|
|
284
284
|
...cache,
|
|
285
285
|
workspaces: nextWorkspaces,
|
|
@@ -290,25 +290,25 @@ async function refreshWorkspaces(rootArgs = [], options = {}) {
|
|
|
290
290
|
(0, output_1.printJson)(payload);
|
|
291
291
|
}
|
|
292
292
|
else {
|
|
293
|
-
console.log(`Scanned ${scannedRoots.length} root${scannedRoots.length === 1 ?
|
|
293
|
+
console.log(`Scanned ${scannedRoots.length} root${scannedRoots.length === 1 ? "" : "s"}.`);
|
|
294
294
|
if (skippedRoots.length > 0) {
|
|
295
|
-
console.log(`Skipped ${skippedRoots.length} macOS protected root${skippedRoots.length === 1 ?
|
|
295
|
+
console.log(`Skipped ${skippedRoots.length} macOS protected root${skippedRoots.length === 1 ? "" : "s"}; pass the path explicitly to scan it.`);
|
|
296
296
|
}
|
|
297
297
|
printWorkspaceEntries(payload.workspaces);
|
|
298
298
|
}
|
|
299
299
|
return payload;
|
|
300
300
|
}
|
|
301
301
|
function isMacProtectedWorkspaceRoot(rootPath, homeDir = node_os_1.default.homedir(), platform = process.platform) {
|
|
302
|
-
if (platform !==
|
|
302
|
+
if (platform !== "darwin") {
|
|
303
303
|
return false;
|
|
304
304
|
}
|
|
305
305
|
const absoluteRoot = (0, node_path_1.resolve)(rootPath);
|
|
306
|
-
const protectedRoots = [
|
|
306
|
+
const protectedRoots = ["Desktop", "Documents", "Downloads"].map((name) => (0, node_path_1.resolve)((0, node_path_1.join)(homeDir, name)));
|
|
307
307
|
return protectedRoots.some((protectedRoot) => absoluteRoot === protectedRoot || isPathInside(absoluteRoot, protectedRoot));
|
|
308
308
|
}
|
|
309
309
|
function isPathInside(candidate, parent) {
|
|
310
310
|
const relativePath = (0, node_path_1.relative)(parent, candidate);
|
|
311
|
-
return Boolean(relativePath) && !relativePath.startsWith(
|
|
311
|
+
return Boolean(relativePath) && !relativePath.startsWith("..") && !(0, node_path_1.isAbsolute)(relativePath);
|
|
312
312
|
}
|
|
313
313
|
function isAllowedProtectedPath(candidate, allowedProtectedRoots) {
|
|
314
314
|
return allowedProtectedRoots.some((allowedRoot) => candidate === allowedRoot || isPathInside(candidate, allowedRoot));
|
|
@@ -324,8 +324,8 @@ function findWorkspacesAt(rootPath, depth, seen, found, context) {
|
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
const absolutePath = (0, node_path_1.resolve)(rootPath);
|
|
327
|
-
if (isMacProtectedWorkspaceRoot(absolutePath, context.homeDir, context.platform)
|
|
328
|
-
|
|
327
|
+
if (isMacProtectedWorkspaceRoot(absolutePath, context.homeDir, context.platform) &&
|
|
328
|
+
!isAllowedProtectedPath(absolutePath, context.allowedProtectedRoots)) {
|
|
329
329
|
context.skippedRoots.add(absolutePath);
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
@@ -347,7 +347,7 @@ function findWorkspacesAt(rootPath, depth, seen, found, context) {
|
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(absolutePath, CATALOGUE_FILE))) {
|
|
350
|
-
found.push(inspectWorkspacePath(absolutePath,
|
|
350
|
+
found.push(inspectWorkspacePath(absolutePath, "found"));
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
353
|
let children;
|
|
@@ -358,7 +358,7 @@ function findWorkspacesAt(rootPath, depth, seen, found, context) {
|
|
|
358
358
|
throw new WorkspaceScanError(`Cannot read ${absolutePath}: ${formatErrorMessage(error)}`);
|
|
359
359
|
}
|
|
360
360
|
for (const child of children) {
|
|
361
|
-
if (child.startsWith(
|
|
361
|
+
if (child.startsWith(".") || SKIP_DIRECTORY_NAMES.has(child)) {
|
|
362
362
|
continue;
|
|
363
363
|
}
|
|
364
364
|
findWorkspacesAt((0, node_path_1.join)(absolutePath, child), depth + 1, seen, found, context);
|
|
@@ -400,7 +400,7 @@ function countWorkspaceCatalogues(rootPath, depth) {
|
|
|
400
400
|
return counts;
|
|
401
401
|
}
|
|
402
402
|
for (const child of children) {
|
|
403
|
-
if (child.startsWith(
|
|
403
|
+
if (child.startsWith(".") || SKIP_DIRECTORY_NAMES.has(child)) {
|
|
404
404
|
continue;
|
|
405
405
|
}
|
|
406
406
|
const childPath = (0, node_path_1.join)(rootPath, child);
|
|
@@ -421,7 +421,7 @@ function countWorkspaceCatalogues(rootPath, depth) {
|
|
|
421
421
|
}
|
|
422
422
|
function readCatalogueCounts(cataloguePath) {
|
|
423
423
|
try {
|
|
424
|
-
const parsed = JSON.parse((0, node_fs_1.readFileSync)(cataloguePath,
|
|
424
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(cataloguePath, "utf8"));
|
|
425
425
|
return {
|
|
426
426
|
apps: collectionCount(parsed.apps),
|
|
427
427
|
assets: collectionCount(parsed.assets),
|
|
@@ -444,7 +444,7 @@ function collectionCount(value) {
|
|
|
444
444
|
if (Array.isArray(value)) {
|
|
445
445
|
return value.length;
|
|
446
446
|
}
|
|
447
|
-
if (value && typeof value ===
|
|
447
|
+
if (value && typeof value === "object") {
|
|
448
448
|
return Object.keys(value).length;
|
|
449
449
|
}
|
|
450
450
|
return 0;
|
|
@@ -461,31 +461,31 @@ function printWorkspaceList(cache, platform = process.platform) {
|
|
|
461
461
|
printWorkspaceEntries(cache.workspaces);
|
|
462
462
|
}
|
|
463
463
|
function printNoCachedWorkspacesGuidance(defaultWorkspacePath, platform = process.platform) {
|
|
464
|
-
console.log(
|
|
465
|
-
console.log(
|
|
466
|
-
console.log(
|
|
467
|
-
console.log(
|
|
468
|
-
console.log(
|
|
464
|
+
console.log("Cached workspaces: 0");
|
|
465
|
+
console.log("");
|
|
466
|
+
console.log("No cached PlayDrop workspaces yet.");
|
|
467
|
+
console.log("To find existing workspaces:");
|
|
468
|
+
console.log(" Run: playdrop workspaces refresh <folder>");
|
|
469
469
|
console.log(` Example: ${getWorkspaceRefreshExample(platform)}`);
|
|
470
|
-
if (platform ===
|
|
471
|
-
console.log(
|
|
470
|
+
if (platform === "darwin") {
|
|
471
|
+
console.log(" This scans the folder you choose and macOS may ask for permission.");
|
|
472
472
|
}
|
|
473
473
|
else {
|
|
474
|
-
console.log(
|
|
474
|
+
console.log(" This scans only the folder you choose.");
|
|
475
475
|
}
|
|
476
|
-
console.log(
|
|
477
|
-
console.log(
|
|
478
|
-
console.log(
|
|
476
|
+
console.log("");
|
|
477
|
+
console.log("To create the recommended first workspace:");
|
|
478
|
+
console.log(" Run: playdrop workspaces init");
|
|
479
479
|
console.log(` Creates: ${defaultWorkspacePath}`);
|
|
480
480
|
}
|
|
481
481
|
function getWorkspaceRefreshExample(platform = process.platform) {
|
|
482
|
-
return platform ===
|
|
483
|
-
?
|
|
484
|
-
:
|
|
482
|
+
return platform === "win32"
|
|
483
|
+
? "playdrop workspaces refresh %USERPROFILE%\\Documents"
|
|
484
|
+
: "playdrop workspaces refresh ~/Documents";
|
|
485
485
|
}
|
|
486
486
|
function printWorkspaceEntries(entries) {
|
|
487
487
|
if (entries.length === 0) {
|
|
488
|
-
console.log(
|
|
488
|
+
console.log("No PlayDrop workspaces found.");
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
for (const entry of entries) {
|
|
@@ -493,7 +493,7 @@ function printWorkspaceEntries(entries) {
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
function printWorkspaceEntry(entry) {
|
|
496
|
-
const existsLabel = entry.exists === false ?
|
|
496
|
+
const existsLabel = entry.exists === false ? "missing" : "available";
|
|
497
497
|
console.log(`${entry.path} (${existsLabel})`);
|
|
498
498
|
console.log(` ${entry.appsCount} apps, ${entry.assetsCount} assets, ${entry.packsCount} packs`);
|
|
499
499
|
}
|
package/dist/config.js
CHANGED
|
@@ -25,7 +25,7 @@ function getConfigPath() {
|
|
|
25
25
|
const custom = process.env.PLAYDROP_CONFIG_PATH;
|
|
26
26
|
if (custom)
|
|
27
27
|
return custom;
|
|
28
|
-
return (0, path_1.join)(os_1.default.homedir(),
|
|
28
|
+
return (0, path_1.join)(os_1.default.homedir(), ".playdrop", "config.json");
|
|
29
29
|
}
|
|
30
30
|
function normalizeKey(value) {
|
|
31
31
|
return value.trim();
|
|
@@ -46,9 +46,9 @@ function buildDerivedConfig(cfg) {
|
|
|
46
46
|
function readRawConfig() {
|
|
47
47
|
const file = getConfigPath();
|
|
48
48
|
try {
|
|
49
|
-
const data = (0, fs_1.readFileSync)(file,
|
|
49
|
+
const data = (0, fs_1.readFileSync)(file, "utf8");
|
|
50
50
|
const parsed = JSON.parse(data);
|
|
51
|
-
return parsed && typeof parsed ===
|
|
51
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
52
52
|
}
|
|
53
53
|
catch {
|
|
54
54
|
return {};
|
|
@@ -57,16 +57,16 @@ function readRawConfig() {
|
|
|
57
57
|
const WORKER_KEY_PATTERN = /^wk_[0-9a-f]{16}$/;
|
|
58
58
|
function stripDerivedFields(cfg) {
|
|
59
59
|
const next = {
|
|
60
|
-
version: typeof cfg.version ===
|
|
60
|
+
version: typeof cfg.version === "number" ? cfg.version : undefined,
|
|
61
61
|
currentAccount: cfg.currentAccount ?? undefined,
|
|
62
62
|
accounts: cfg.accounts ? clonePersistedConfig({ accounts: cfg.accounts }).accounts : undefined,
|
|
63
|
-
workerKey: typeof cfg.workerKey ===
|
|
63
|
+
workerKey: typeof cfg.workerKey === "string" && cfg.workerKey.trim().length > 0 ? cfg.workerKey.trim() : undefined,
|
|
64
64
|
};
|
|
65
65
|
if (!next.accounts || Object.keys(next.accounts).length === 0) {
|
|
66
|
-
if (typeof cfg.token ===
|
|
66
|
+
if (typeof cfg.token === "string" && cfg.token.trim().length > 0) {
|
|
67
67
|
next.token = cfg.token.trim();
|
|
68
68
|
}
|
|
69
|
-
if (typeof cfg.env ===
|
|
69
|
+
if (typeof cfg.env === "string" && cfg.env.trim().length > 0) {
|
|
70
70
|
next.env = cfg.env.trim();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -93,14 +93,14 @@ function listAccountSessions(cfg = loadConfig()) {
|
|
|
93
93
|
const sessions = [];
|
|
94
94
|
for (const [username, envMap] of Object.entries(accounts)) {
|
|
95
95
|
for (const [env, session] of Object.entries(envMap ?? {})) {
|
|
96
|
-
if (!session || typeof session.token !==
|
|
96
|
+
if (!session || typeof session.token !== "string" || session.token.trim().length === 0) {
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
99
|
sessions.push({
|
|
100
100
|
username,
|
|
101
101
|
env,
|
|
102
102
|
token: session.token,
|
|
103
|
-
updatedAt: typeof session.updatedAt ===
|
|
103
|
+
updatedAt: typeof session.updatedAt === "string" ? session.updatedAt : "",
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -128,7 +128,7 @@ function findAccountSession(username, env, cfg = loadConfig()) {
|
|
|
128
128
|
if (!envMap) {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
|
-
if (typeof env ===
|
|
131
|
+
if (typeof env === "string" && env.trim().length > 0) {
|
|
132
132
|
const session = envMap[env.trim()];
|
|
133
133
|
if (!session?.token) {
|
|
134
134
|
return null;
|
|
@@ -137,7 +137,7 @@ function findAccountSession(username, env, cfg = loadConfig()) {
|
|
|
137
137
|
username: normalizedUsername,
|
|
138
138
|
env: env.trim(),
|
|
139
139
|
token: session.token,
|
|
140
|
-
updatedAt: typeof session.updatedAt ===
|
|
140
|
+
updatedAt: typeof session.updatedAt === "string" ? session.updatedAt : "",
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
const envs = Object.keys(envMap);
|
|
@@ -151,7 +151,7 @@ function findAccountSession(username, env, cfg = loadConfig()) {
|
|
|
151
151
|
username: normalizedUsername,
|
|
152
152
|
env: selectedEnv,
|
|
153
153
|
token: session.token,
|
|
154
|
-
updatedAt: typeof session.updatedAt ===
|
|
154
|
+
updatedAt: typeof session.updatedAt === "string" ? session.updatedAt : "",
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
return null;
|
|
@@ -169,7 +169,7 @@ function saveAccountSession(input) {
|
|
|
169
169
|
const env = normalizeKey(input.env);
|
|
170
170
|
const token = input.token.trim();
|
|
171
171
|
if (!username || !env || !token) {
|
|
172
|
-
throw new Error(
|
|
172
|
+
throw new Error("invalid_account_session");
|
|
173
173
|
}
|
|
174
174
|
const next = {
|
|
175
175
|
version: CONFIG_VERSION,
|
|
@@ -197,11 +197,11 @@ function assertValidWorkerKey(workerKey) {
|
|
|
197
197
|
}
|
|
198
198
|
function getOrCreateWorkerKey() {
|
|
199
199
|
const cfg = loadConfig();
|
|
200
|
-
const legacyWorkerKey = typeof cfg.workerKey ===
|
|
200
|
+
const legacyWorkerKey = typeof cfg.workerKey === "string" ? cfg.workerKey.trim() : "";
|
|
201
201
|
if (legacyWorkerKey) {
|
|
202
202
|
return assertValidWorkerKey(legacyWorkerKey);
|
|
203
203
|
}
|
|
204
|
-
const workerKey = `wk_${(0, crypto_1.randomBytes)(8).toString(
|
|
204
|
+
const workerKey = `wk_${(0, crypto_1.randomBytes)(8).toString("hex")}`;
|
|
205
205
|
saveConfig({ ...cfg, workerKey });
|
|
206
206
|
return workerKey;
|
|
207
207
|
}
|
|
@@ -211,10 +211,10 @@ function migrateLegacySession(input) {
|
|
|
211
211
|
function setCurrentAccount(input) {
|
|
212
212
|
const cfg = loadConfig();
|
|
213
213
|
const username = normalizeKey(input.username);
|
|
214
|
-
const env = typeof input.env ===
|
|
214
|
+
const env = typeof input.env === "string" ? normalizeKey(input.env) : "";
|
|
215
215
|
const session = findAccountSession(username, env || undefined, cfg);
|
|
216
216
|
if (!session) {
|
|
217
|
-
throw new Error(env ?
|
|
217
|
+
throw new Error(env ? "account_session_not_found" : "account_not_found");
|
|
218
218
|
}
|
|
219
219
|
const next = {
|
|
220
220
|
version: CONFIG_VERSION,
|
|
@@ -228,8 +228,8 @@ function setCurrentAccount(input) {
|
|
|
228
228
|
function removeAccountSession(input = {}) {
|
|
229
229
|
const cfg = loadConfig();
|
|
230
230
|
const current = getCurrentAccountSession(cfg);
|
|
231
|
-
const username = normalizeKey(input.username ?? current?.username ??
|
|
232
|
-
const env = normalizeKey(input.env ?? current?.env ??
|
|
231
|
+
const username = normalizeKey(input.username ?? current?.username ?? "");
|
|
232
|
+
const env = normalizeKey(input.env ?? current?.env ?? "");
|
|
233
233
|
if (!username) {
|
|
234
234
|
return cfg;
|
|
235
235
|
}
|
|
@@ -256,7 +256,10 @@ function removeAccountSession(input = {}) {
|
|
|
256
256
|
accounts,
|
|
257
257
|
workerKey: cfg.workerKey,
|
|
258
258
|
};
|
|
259
|
-
if (!nextCurrent &&
|
|
259
|
+
if (!nextCurrent &&
|
|
260
|
+
typeof cfg.token === "string" &&
|
|
261
|
+
typeof cfg.env === "string" &&
|
|
262
|
+
(!cfg.accounts || Object.keys(cfg.accounts).length === 0)) {
|
|
260
263
|
clearConfig();
|
|
261
264
|
return {};
|
|
262
265
|
}
|
package/dist/devAuth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type HostedDevAuthMode =
|
|
2
|
-
export type HostedCaptureDevAuthMode = Exclude<HostedDevAuthMode,
|
|
3
|
-
export type ResetDevPlayerMode =
|
|
1
|
+
export type HostedDevAuthMode = "prompt" | "anonymous" | "viewer" | "player";
|
|
2
|
+
export type HostedCaptureDevAuthMode = Exclude<HostedDevAuthMode, "prompt">;
|
|
3
|
+
export type ResetDevPlayerMode = "before" | "after" | "before-and-after" | "never";
|
|
4
4
|
export type HostedDevAuthSelection = {
|
|
5
5
|
devAuth: HostedDevAuthMode;
|
|
6
6
|
player: 1 | 2 | 3 | 4 | null;
|
package/dist/devAuth.js
CHANGED
|
@@ -9,23 +9,23 @@ function parseHostedDevPlayerSlot(value) {
|
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
const normalized = String(value).trim();
|
|
12
|
-
if (normalized ===
|
|
12
|
+
if (normalized === "1" || normalized === "2" || normalized === "3" || normalized === "4") {
|
|
13
13
|
return Number.parseInt(normalized, 10);
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
function parseHostedDevAuthSelection(input) {
|
|
18
18
|
const normalizedMode = (input.devAuth?.trim().toLowerCase() || input.defaultMode);
|
|
19
|
-
if (!input.allowPrompt && normalizedMode ===
|
|
20
|
-
throw new Error(
|
|
19
|
+
if (!input.allowPrompt && normalizedMode === "prompt") {
|
|
20
|
+
throw new Error("dev_auth_prompt_not_supported");
|
|
21
21
|
}
|
|
22
|
-
if (normalizedMode !==
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error(
|
|
22
|
+
if (normalizedMode !== "prompt" &&
|
|
23
|
+
normalizedMode !== "anonymous" &&
|
|
24
|
+
normalizedMode !== "viewer" &&
|
|
25
|
+
normalizedMode !== "player") {
|
|
26
|
+
throw new Error("dev_auth_invalid");
|
|
27
27
|
}
|
|
28
|
-
if (normalizedMode !==
|
|
28
|
+
if (normalizedMode !== "player") {
|
|
29
29
|
return {
|
|
30
30
|
devAuth: normalizedMode,
|
|
31
31
|
player: null,
|
|
@@ -33,7 +33,7 @@ function parseHostedDevAuthSelection(input) {
|
|
|
33
33
|
}
|
|
34
34
|
const player = parseHostedDevPlayerSlot(input.player);
|
|
35
35
|
if (player === null) {
|
|
36
|
-
throw new Error(
|
|
36
|
+
throw new Error("dev_auth_player_slot_required");
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
39
|
devAuth: normalizedMode,
|
|
@@ -41,20 +41,23 @@ function parseHostedDevAuthSelection(input) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
function parseResetDevPlayerMode(value) {
|
|
44
|
-
const normalized = value?.trim().toLowerCase() ||
|
|
45
|
-
if (normalized ===
|
|
44
|
+
const normalized = value?.trim().toLowerCase() || "never";
|
|
45
|
+
if (normalized === "before" ||
|
|
46
|
+
normalized === "after" ||
|
|
47
|
+
normalized === "before-and-after" ||
|
|
48
|
+
normalized === "never") {
|
|
46
49
|
return normalized;
|
|
47
50
|
}
|
|
48
|
-
throw new Error(
|
|
51
|
+
throw new Error("reset_dev_player_invalid");
|
|
49
52
|
}
|
|
50
53
|
function applyHostedDevAuthSelectionToUrl(url, selection) {
|
|
51
54
|
const nextUrl = new URL(url);
|
|
52
|
-
nextUrl.searchParams.set(
|
|
53
|
-
if (selection.devAuth ===
|
|
54
|
-
nextUrl.searchParams.set(
|
|
55
|
+
nextUrl.searchParams.set("devAuth", selection.devAuth);
|
|
56
|
+
if (selection.devAuth === "player" && selection.player) {
|
|
57
|
+
nextUrl.searchParams.set("player", String(selection.player));
|
|
55
58
|
}
|
|
56
59
|
else {
|
|
57
|
-
nextUrl.searchParams.delete(
|
|
60
|
+
nextUrl.searchParams.delete("player");
|
|
58
61
|
}
|
|
59
62
|
return nextUrl.toString();
|
|
60
63
|
}
|
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -4,52 +4,52 @@ exports.resolveEnvironmentConfig = resolveEnvironmentConfig;
|
|
|
4
4
|
exports.formatEnvironmentList = formatEnvironmentList;
|
|
5
5
|
const DEFAULT_ENVIRONMENTS = {
|
|
6
6
|
dev: {
|
|
7
|
-
apiBase:
|
|
8
|
-
webBase:
|
|
9
|
-
cdnBase:
|
|
10
|
-
aiBase:
|
|
7
|
+
apiBase: "http://localhost:4000",
|
|
8
|
+
webBase: "http://localhost:8080",
|
|
9
|
+
cdnBase: "http://localhost:8082",
|
|
10
|
+
aiBase: "http://localhost:8083",
|
|
11
11
|
},
|
|
12
12
|
local: {
|
|
13
|
-
apiBase:
|
|
14
|
-
webBase:
|
|
15
|
-
cdnBase:
|
|
16
|
-
aiBase:
|
|
13
|
+
apiBase: "http://localhost:4000",
|
|
14
|
+
webBase: "https://www.localhost",
|
|
15
|
+
cdnBase: "https://assets-local.playdrop.ai",
|
|
16
|
+
aiBase: "https://ai.localhost",
|
|
17
17
|
},
|
|
18
18
|
prod: {
|
|
19
|
-
apiBase:
|
|
20
|
-
webBase:
|
|
21
|
-
cdnBase:
|
|
22
|
-
aiBase:
|
|
19
|
+
apiBase: "https://api.playdrop.ai",
|
|
20
|
+
webBase: "https://www.playdrop.ai",
|
|
21
|
+
cdnBase: "https://assets.playdrop.ai",
|
|
22
|
+
aiBase: "https://ai.playdrop.ai",
|
|
23
23
|
},
|
|
24
24
|
preview: {
|
|
25
|
-
apiBase:
|
|
26
|
-
webBase:
|
|
27
|
-
cdnBase:
|
|
28
|
-
aiBase:
|
|
25
|
+
apiBase: "https://api.preview.playdrop.ai",
|
|
26
|
+
webBase: "https://preview.playdrop.ai",
|
|
27
|
+
cdnBase: "https://assets.playdrop.ai",
|
|
28
|
+
aiBase: "https://ai.preview.playdrop.ai",
|
|
29
29
|
},
|
|
30
30
|
blue: {
|
|
31
|
-
apiBase:
|
|
32
|
-
webBase:
|
|
33
|
-
cdnBase:
|
|
34
|
-
aiBase:
|
|
31
|
+
apiBase: "https://api.blue.playdrop.ai",
|
|
32
|
+
webBase: "https://blue.playdrop.ai",
|
|
33
|
+
cdnBase: "https://assets.playdrop.ai",
|
|
34
|
+
aiBase: "https://ai.blue.playdrop.ai",
|
|
35
35
|
},
|
|
36
36
|
green: {
|
|
37
|
-
apiBase:
|
|
38
|
-
webBase:
|
|
39
|
-
cdnBase:
|
|
40
|
-
aiBase:
|
|
41
|
-
}
|
|
37
|
+
apiBase: "https://api.green.playdrop.ai",
|
|
38
|
+
webBase: "https://green.playdrop.ai",
|
|
39
|
+
cdnBase: "https://assets.playdrop.ai",
|
|
40
|
+
aiBase: "https://ai.green.playdrop.ai",
|
|
41
|
+
},
|
|
42
42
|
};
|
|
43
43
|
function normalizeEnvironment(env) {
|
|
44
44
|
if (!env)
|
|
45
45
|
return undefined;
|
|
46
46
|
const lowered = env.toLowerCase();
|
|
47
|
-
if (lowered ===
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
if (lowered === "dev" ||
|
|
48
|
+
lowered === "local" ||
|
|
49
|
+
lowered === "prod" ||
|
|
50
|
+
lowered === "preview" ||
|
|
51
|
+
lowered === "blue" ||
|
|
52
|
+
lowered === "green") {
|
|
53
53
|
return lowered;
|
|
54
54
|
}
|
|
55
55
|
return undefined;
|
|
@@ -57,7 +57,7 @@ function normalizeEnvironment(env) {
|
|
|
57
57
|
function trimTrailingSlash(value) {
|
|
58
58
|
if (!value)
|
|
59
59
|
return value;
|
|
60
|
-
return value.replace(/\/$/,
|
|
60
|
+
return value.replace(/\/$/, "");
|
|
61
61
|
}
|
|
62
62
|
function resolveEnvironmentConfig(env) {
|
|
63
63
|
const normalized = normalizeEnvironment(env);
|
|
@@ -74,7 +74,7 @@ function resolveEnvironmentConfig(env) {
|
|
|
74
74
|
const aiOverride = process.env[`PLAYDROP_AI_BASE_${upper}`] || process.env.PLAYDROP_AI_BASE;
|
|
75
75
|
const insecureOverride = process.env[`PLAYDROP_INSECURE_${upper}`];
|
|
76
76
|
const cdnOverride = process.env[`PLAYDROP_CDN_BASE_${upper}`] || process.env.PLAYDROP_CDN_BASE;
|
|
77
|
-
const allowInsecure = insecureOverride ===
|
|
77
|
+
const allowInsecure = insecureOverride === "1" || process.env.PLAYDROP_INSECURE === "1";
|
|
78
78
|
return {
|
|
79
79
|
name: normalized,
|
|
80
80
|
apiBase: trimTrailingSlash(apiOverride || defaults.apiBase),
|
|
@@ -85,5 +85,5 @@ function resolveEnvironmentConfig(env) {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
function formatEnvironmentList() {
|
|
88
|
-
return Object.keys(DEFAULT_ENVIRONMENTS).join(
|
|
88
|
+
return Object.keys(DEFAULT_ENVIRONMENTS).join(", ");
|
|
89
89
|
}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiError } from
|
|
1
|
+
import { ApiError } from "@playdrop/types";
|
|
2
2
|
export declare function isNetworkError(error: unknown): boolean;
|
|
3
3
|
export declare function handleCommandFailure(error: unknown, command: string, context: string, options?: {
|
|
4
4
|
networkMessage?: string;
|