@playdrop/playdrop-cli 0.16.2 → 0.16.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/playdrop +1 -2
- package/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +2 -2
- package/dist/apiClient.js +16 -20
- package/dist/appUrls.d.ts +2 -2
- package/dist/appUrls.js +31 -33
- package/dist/apps/build.d.ts +2 -2
- package/dist/apps/build.js +83 -83
- package/dist/apps/index.d.ts +7 -7
- package/dist/apps/index.js +8 -8
- package/dist/apps/loadCheck.d.ts +28 -16
- package/dist/apps/loadCheck.js +411 -279
- package/dist/apps/registration.d.ts +3 -3
- package/dist/apps/registration.js +1 -1
- package/dist/apps/staticHtml.d.ts +3 -3
- package/dist/apps/staticHtml.js +90 -91
- package/dist/apps/surfaceProfiles.d.ts +2 -2
- package/dist/apps/surfaceProfiles.js +6 -6
- package/dist/apps/upload.d.ts +5 -5
- package/dist/apps/upload.js +75 -81
- package/dist/apps/validate.d.ts +2 -2
- package/dist/apps/validate.js +18 -22
- package/dist/assetSpecs.d.ts +2 -2
- package/dist/assetSpecs.js +35 -35
- package/dist/assets/model-artifacts.d.ts +1 -1
- package/dist/assets/model-artifacts.js +81 -77
- package/dist/assets/model-worker.d.ts +1 -1
- package/dist/assets/model-worker.js +6 -6
- package/dist/browser.js +9 -9
- package/dist/catalogue-utils.d.ts +1 -1
- package/dist/catalogue-utils.js +26 -26
- package/dist/catalogue.d.ts +21 -16
- package/dist/catalogue.js +509 -413
- package/dist/clientInfo.d.ts +1 -1
- package/dist/clientInfo.js +28 -28
- package/dist/commandContext.d.ts +5 -5
- package/dist/commandContext.js +19 -23
- package/dist/commands/accounts.js +6 -6
- package/dist/commands/ads.js +16 -16
- package/dist/commands/agents.d.ts +2 -2
- package/dist/commands/agents.js +131 -127
- package/dist/commands/boosts.js +41 -31
- package/dist/commands/browse.d.ts +2 -2
- package/dist/commands/browse.js +168 -128
- package/dist/commands/build.js +9 -9
- package/dist/commands/captureListing.d.ts +8 -8
- package/dist/commands/captureListing.js +292 -332
- package/dist/commands/changelog.js +1 -1
- package/dist/commands/chat.js +51 -53
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.js +44 -44
- package/dist/commands/clients.d.ts +3 -3
- package/dist/commands/clients.js +67 -64
- package/dist/commands/comments.js +36 -29
- package/dist/commands/create.js +305 -312
- package/dist/commands/createRemixContent.d.ts +1 -1
- package/dist/commands/createRemixContent.js +65 -60
- package/dist/commands/creations.js +205 -135
- package/dist/commands/credits.js +37 -27
- package/dist/commands/detail.js +40 -34
- package/dist/commands/dev.js +103 -126
- package/dist/commands/devBrowser.js +74 -65
- package/dist/commands/devRuntimeAssets.d.ts +4 -4
- package/dist/commands/devRuntimeAssets.js +38 -40
- package/dist/commands/devServer.d.ts +4 -4
- package/dist/commands/devServer.js +183 -174
- package/dist/commands/devShared.d.ts +3 -3
- package/dist/commands/devShared.js +31 -31
- package/dist/commands/doctor.d.ts +5 -5
- package/dist/commands/doctor.js +63 -57
- package/dist/commands/documentation.js +42 -32
- package/dist/commands/feedback.js +59 -42
- package/dist/commands/format.js +9 -9
- package/dist/commands/generation.d.ts +2 -2
- package/dist/commands/generation.js +344 -326
- package/dist/commands/init.d.ts +4 -4
- package/dist/commands/init.js +64 -61
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +42 -62
- package/dist/commands/logout.js +4 -4
- package/dist/commands/marketing.d.ts +8 -8
- package/dist/commands/marketing.js +246 -297
- package/dist/commands/notes.js +19 -19
- package/dist/commands/notifications.js +34 -22
- package/dist/commands/npmProcess.js +3 -3
- package/dist/commands/ownedRuntimeImageValidation.d.ts +1 -1
- package/dist/commands/ownedRuntimeImageValidation.js +19 -17
- package/dist/commands/play.js +12 -21
- package/dist/commands/publicPages.js +8 -4
- package/dist/commands/review.js +123 -110
- package/dist/commands/search.js +107 -88
- package/dist/commands/tags.js +10 -12
- package/dist/commands/taskCaptureSession.d.ts +3 -3
- package/dist/commands/taskCaptureSession.js +3 -3
- package/dist/commands/tweaks.js +25 -23
- package/dist/commands/upgrade.js +40 -31
- package/dist/commands/upload-content.d.ts +5 -5
- package/dist/commands/upload-content.js +130 -122
- package/dist/commands/upload-graph.d.ts +1 -1
- package/dist/commands/upload-graph.js +7 -11
- package/dist/commands/upload.d.ts +7 -7
- package/dist/commands/upload.js +196 -217
- package/dist/commands/validate.js +33 -32
- package/dist/commands/versionsBrowse.js +61 -51
- package/dist/commands/whoami.js +11 -14
- package/dist/commands/worker/archive-staging.d.ts +9 -0
- package/dist/commands/worker/archive-staging.js +257 -0
- package/dist/commands/worker/instrument-evidence.d.ts +1 -1
- package/dist/commands/worker/instrument-evidence.js +41 -43
- package/dist/commands/worker/provider-telemetry.d.ts +2 -1
- package/dist/commands/worker/provider-telemetry.js +181 -64
- package/dist/commands/worker/runtime.d.ts +18 -3
- package/dist/commands/worker/runtime.js +291 -239
- package/dist/commands/worker.d.ts +83 -22
- package/dist/commands/worker.js +1980 -1411
- package/dist/commands/workspaces.d.ts +2 -2
- package/dist/commands/workspaces.js +57 -57
- package/dist/config.js +23 -20
- package/dist/devAuth.d.ts +3 -3
- package/dist/devAuth.js +20 -17
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +34 -34
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +7 -7
- package/dist/externalAssetPackValidation.d.ts +1 -1
- package/dist/externalAssetPackValidation.js +9 -9
- package/dist/http.d.ts +1 -1
- package/dist/http.js +9 -9
- package/dist/index.js +657 -664
- package/dist/listingCaptureLease.js +23 -23
- package/dist/listingPreflight.d.ts +2 -2
- package/dist/listingPreflight.js +33 -33
- package/dist/messages.js +6 -14
- package/dist/output.js +9 -9
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +35 -40
- package/dist/proxyFetch.js +30 -27
- package/dist/recorderRelease.js +8 -8
- package/dist/refs.d.ts +5 -5
- package/dist/refs.js +40 -37
- package/dist/sessionCookie.js +15 -21
- package/dist/shellProbe.js +5 -5
- package/dist/taskSelection.d.ts +3 -3
- package/dist/taskSelection.js +67 -62
- package/dist/taskUtils.d.ts +1 -1
- package/dist/taskUtils.js +4 -4
- package/dist/tweakStaleness.d.ts +3 -3
- package/dist/tweakStaleness.js +8 -8
- package/dist/uploadLog.d.ts +3 -3
- package/dist/uploadLog.js +51 -51
- package/dist/versionCompare.js +3 -3
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +10 -17
- package/dist/workspaceAuth.d.ts +1 -1
- package/dist/workspaceAuth.js +28 -22
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +35 -35
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +34 -33
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +4 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +12 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +19 -18
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +7 -2
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +47 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +32 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +16 -18
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +44 -45
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +40 -44
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +30 -34
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +23 -20
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +21 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +19 -19
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +12 -16
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +38 -41
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +54 -56
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +39 -45
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +39 -43
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +35 -35
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +18 -18
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +50 -48
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +22 -26
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +23 -28
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +93 -95
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +2 -7
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +6 -6
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +9 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -17
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +9 -9
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +1 -1
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.js +10 -10
- package/node_modules/@playdrop/config/dist/src/constants.js +10 -10
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +27 -28
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +42 -41
- package/node_modules/@playdrop/config/dist/src/game-arena.js +12 -12
- package/node_modules/@playdrop/config/dist/src/index.d.ts +9 -9
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +24 -25
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +41 -39
- package/node_modules/@playdrop/config/dist/src/runtime-client-meta.js +1 -3
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +23 -25
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +5 -5
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +44 -46
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +6 -8
- package/node_modules/@playdrop/config/dist/src/types.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +12 -12
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +59 -59
- package/node_modules/@playdrop/config/dist/test/fastify.test.js +4 -4
- package/node_modules/@playdrop/config/dist/test/game-arena.test.js +8 -8
- package/node_modules/@playdrop/config/dist/test/logging.test.js +6 -6
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +57 -57
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-playtest.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +314 -250
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +40 -59
- package/node_modules/@playdrop/types/dist/app-capability-filters.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts +6 -6
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-review.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.js +1 -6
- package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +5 -5
- package/node_modules/@playdrop/types/dist/asset-spec.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/attachment-policy.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/creator-public-image.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +25 -25
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/instrument-evidence.js +2 -11
- package/node_modules/@playdrop/types/dist/locale.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/locale.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/locale.js +2 -17
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/player-meta.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtrade.d.ts +8 -5
- package/node_modules/@playdrop/types/dist/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/tweaks.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.js +12 -2
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -14
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +4 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +2 -2
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +20 -18
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +11 -14
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/init.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ type InitOptions = {
|
|
|
4
4
|
export type InitSummary = {
|
|
5
5
|
directory: string;
|
|
6
6
|
cataloguePath: string;
|
|
7
|
-
readmeStatus:
|
|
8
|
-
agentsStatus:
|
|
9
|
-
catalogueStatus:
|
|
10
|
-
gitStatus:
|
|
7
|
+
readmeStatus: "created" | "updated";
|
|
8
|
+
agentsStatus: "created" | "skipped";
|
|
9
|
+
catalogueStatus: "created" | "skipped";
|
|
10
|
+
gitStatus: "initialized" | "skipped" | "declined";
|
|
11
11
|
};
|
|
12
12
|
export declare function init(targetPath: string, options?: InitOptions): Promise<InitSummary | null>;
|
|
13
13
|
export {};
|
package/dist/commands/init.js
CHANGED
|
@@ -15,11 +15,11 @@ const commandContext_1 = require("../commandContext");
|
|
|
15
15
|
const http_1 = require("../http");
|
|
16
16
|
const messages_1 = require("../messages");
|
|
17
17
|
const clientInfo_1 = require("../clientInfo");
|
|
18
|
-
const DEFAULT_CATALOGUE =
|
|
19
|
-
const LEGACY_CATALOGUE_VERSION_KEY = [
|
|
20
|
-
const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set([
|
|
18
|
+
const DEFAULT_CATALOGUE = "{}\n";
|
|
19
|
+
const LEGACY_CATALOGUE_VERSION_KEY = ["schema", "Version"].join("");
|
|
20
|
+
const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set(["apps", "assets", "assetPacks"]);
|
|
21
21
|
function ensureTrailingNewline(content) {
|
|
22
|
-
return content.endsWith(
|
|
22
|
+
return content.endsWith("\n") ? content : `${content}\n`;
|
|
23
23
|
}
|
|
24
24
|
function renderReadmeTemplate(template, replacements) {
|
|
25
25
|
let rendered = template;
|
|
@@ -35,10 +35,7 @@ async function resolveUsername(apiBase, token) {
|
|
|
35
35
|
const data = await client.me();
|
|
36
36
|
const username = data.user?.username?.trim();
|
|
37
37
|
if (!username) {
|
|
38
|
-
(0, messages_1.printErrorWithHelp)(
|
|
39
|
-
'Retry "playdrop project init" in a moment.',
|
|
40
|
-
'If the problem continues, contact the Playdrop team.'
|
|
41
|
-
], { command: 'project init' });
|
|
38
|
+
(0, messages_1.printErrorWithHelp)("The Playdrop API returned an unexpected response.", ['Retry "playdrop project init" in a moment.', "If the problem continues, contact the Playdrop team."], { command: "project init" });
|
|
42
39
|
process.exitCode = 1;
|
|
43
40
|
return null;
|
|
44
41
|
}
|
|
@@ -46,7 +43,7 @@ async function resolveUsername(apiBase, token) {
|
|
|
46
43
|
}
|
|
47
44
|
catch (unknownError) {
|
|
48
45
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
49
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
46
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Project bootstrap");
|
|
50
47
|
return null;
|
|
51
48
|
}
|
|
52
49
|
if (unknownError instanceof http_1.CLIUnsupportedClientError) {
|
|
@@ -55,13 +52,15 @@ async function resolveUsername(apiBase, token) {
|
|
|
55
52
|
if (unknownError instanceof types_1.ApiError) {
|
|
56
53
|
(0, messages_1.printErrorWithHelp)(`Request failed with status ${unknownError.status}.`, [
|
|
57
54
|
'Run "playdrop auth login" to refresh your credentials.',
|
|
58
|
-
'Use "playdrop project init" again after logging in.'
|
|
59
|
-
], { command:
|
|
55
|
+
'Use "playdrop project init" again after logging in.',
|
|
56
|
+
], { command: "project init" });
|
|
60
57
|
process.exitCode = 1;
|
|
61
58
|
return null;
|
|
62
59
|
}
|
|
63
60
|
const message = unknownError instanceof Error ? unknownError.message : String(unknownError);
|
|
64
|
-
(0, messages_1.printErrorWithHelp)(
|
|
61
|
+
(0, messages_1.printErrorWithHelp)("Could not reach the Playdrop API to resolve your account information.", [message], {
|
|
62
|
+
command: "project init",
|
|
63
|
+
});
|
|
65
64
|
process.exitCode = 1;
|
|
66
65
|
return null;
|
|
67
66
|
}
|
|
@@ -76,9 +75,9 @@ async function promptGitInitialization(label) {
|
|
|
76
75
|
return /^y(es)?$/i.test(answer.trim());
|
|
77
76
|
}
|
|
78
77
|
function runGitInit(directory) {
|
|
79
|
-
const result = (0, node_child_process_1.spawnSync)(
|
|
78
|
+
const result = (0, node_child_process_1.spawnSync)("git", ["init"], {
|
|
80
79
|
cwd: directory,
|
|
81
|
-
stdio:
|
|
80
|
+
stdio: "inherit",
|
|
82
81
|
});
|
|
83
82
|
return result.status === 0;
|
|
84
83
|
}
|
|
@@ -86,19 +85,19 @@ function normalizeBootstrapPayload(payload) {
|
|
|
86
85
|
if (!payload) {
|
|
87
86
|
return null;
|
|
88
87
|
}
|
|
89
|
-
const readmeUri = typeof payload.readmeUri ===
|
|
88
|
+
const readmeUri = typeof payload.readmeUri === "string" ? payload.readmeUri.trim() : "";
|
|
90
89
|
if (!readmeUri) {
|
|
91
|
-
(0, messages_1.printErrorWithHelp)(
|
|
90
|
+
(0, messages_1.printErrorWithHelp)("Bootstrap payload is missing a README URI.", ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
92
91
|
process.exitCode = 1;
|
|
93
92
|
return null;
|
|
94
93
|
}
|
|
95
|
-
const agentsUri = typeof payload.agentsUri ===
|
|
94
|
+
const agentsUri = typeof payload.agentsUri === "string" ? payload.agentsUri.trim() : "";
|
|
96
95
|
if (!agentsUri) {
|
|
97
|
-
(0, messages_1.printErrorWithHelp)(
|
|
96
|
+
(0, messages_1.printErrorWithHelp)("Bootstrap payload is missing an AGENTS URI.", ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
98
97
|
process.exitCode = 1;
|
|
99
98
|
return null;
|
|
100
99
|
}
|
|
101
|
-
const catalogueRaw = typeof payload.catalogue ===
|
|
100
|
+
const catalogueRaw = typeof payload.catalogue === "string" && payload.catalogue.trim().length > 0
|
|
102
101
|
? payload.catalogue
|
|
103
102
|
: DEFAULT_CATALOGUE;
|
|
104
103
|
const catalogueCandidate = ensureTrailingNewline(catalogueRaw.trim() ? catalogueRaw : DEFAULT_CATALOGUE);
|
|
@@ -107,23 +106,23 @@ function normalizeBootstrapPayload(payload) {
|
|
|
107
106
|
parsedCatalogue = JSON.parse(catalogueCandidate);
|
|
108
107
|
}
|
|
109
108
|
catch {
|
|
110
|
-
(0, messages_1.printErrorWithHelp)(
|
|
109
|
+
(0, messages_1.printErrorWithHelp)("Bootstrap payload returned an invalid catalogue.json.", ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
111
110
|
process.exitCode = 1;
|
|
112
111
|
return null;
|
|
113
112
|
}
|
|
114
|
-
if (!parsedCatalogue || typeof parsedCatalogue !==
|
|
115
|
-
(0, messages_1.printErrorWithHelp)(
|
|
113
|
+
if (!parsedCatalogue || typeof parsedCatalogue !== "object" || Array.isArray(parsedCatalogue)) {
|
|
114
|
+
(0, messages_1.printErrorWithHelp)("Bootstrap payload returned an invalid catalogue.json.", ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
116
115
|
process.exitCode = 1;
|
|
117
116
|
return null;
|
|
118
117
|
}
|
|
119
118
|
if (Object.prototype.hasOwnProperty.call(parsedCatalogue, LEGACY_CATALOGUE_VERSION_KEY)) {
|
|
120
|
-
(0, messages_1.printErrorWithHelp)(
|
|
119
|
+
(0, messages_1.printErrorWithHelp)("Bootstrap payload returned a legacy catalogue.json with a top-level version field.", ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
121
120
|
process.exitCode = 1;
|
|
122
121
|
return null;
|
|
123
122
|
}
|
|
124
123
|
const unsupportedKey = Object.keys(parsedCatalogue).find((key) => !ALLOWED_CATALOGUE_TOP_LEVEL_KEYS.has(key));
|
|
125
124
|
if (unsupportedKey) {
|
|
126
|
-
(0, messages_1.printErrorWithHelp)(`Bootstrap payload returned catalogue.json with unsupported top-level key "${unsupportedKey}".`, [
|
|
125
|
+
(0, messages_1.printErrorWithHelp)(`Bootstrap payload returned catalogue.json with unsupported top-level key "${unsupportedKey}".`, ["Contact the platform team or try again shortly."], { command: "project init" });
|
|
127
126
|
process.exitCode = 1;
|
|
128
127
|
return null;
|
|
129
128
|
}
|
|
@@ -133,8 +132,8 @@ function normalizeBootstrapPayload(payload) {
|
|
|
133
132
|
async function downloadBootstrapAsset(webBase, uri, label) {
|
|
134
133
|
if (!webBase) {
|
|
135
134
|
(0, messages_1.printErrorWithHelp)(`Cannot download ${label} because the current environment is missing a web base URL.`, [
|
|
136
|
-
'Set PLAYDROP_WEB_BASE, PLAYDROP_WEB_BASE_DEV, or the appropriate environment override before running "playdrop project init".'
|
|
137
|
-
], { command:
|
|
135
|
+
'Set PLAYDROP_WEB_BASE, PLAYDROP_WEB_BASE_DEV, or the appropriate environment override before running "playdrop project init".',
|
|
136
|
+
], { command: "project init" });
|
|
138
137
|
process.exitCode = 1;
|
|
139
138
|
return null;
|
|
140
139
|
}
|
|
@@ -145,12 +144,14 @@ async function downloadBootstrapAsset(webBase, uri, label) {
|
|
|
145
144
|
}
|
|
146
145
|
catch (error) {
|
|
147
146
|
const message = error instanceof Error ? error.message : String(error);
|
|
148
|
-
(0, messages_1.printErrorWithHelp)(`Failed to download ${label} from ${url}.`, [message], { command:
|
|
147
|
+
(0, messages_1.printErrorWithHelp)(`Failed to download ${label} from ${url}.`, [message], { command: "project init" });
|
|
149
148
|
process.exitCode = 1;
|
|
150
149
|
return null;
|
|
151
150
|
}
|
|
152
151
|
if (!response.ok) {
|
|
153
|
-
(0, messages_1.printErrorWithHelp)(`Failed to download ${label} from ${url}.`, [`HTTP ${response.status} ${response.statusText}`], {
|
|
152
|
+
(0, messages_1.printErrorWithHelp)(`Failed to download ${label} from ${url}.`, [`HTTP ${response.status} ${response.statusText}`], {
|
|
153
|
+
command: "project init",
|
|
154
|
+
});
|
|
154
155
|
process.exitCode = 1;
|
|
155
156
|
return null;
|
|
156
157
|
}
|
|
@@ -165,7 +166,7 @@ async function fetchBootstrap(base, token) {
|
|
|
165
166
|
}
|
|
166
167
|
catch (unknownError) {
|
|
167
168
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
168
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
169
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Project bootstrap");
|
|
169
170
|
return null;
|
|
170
171
|
}
|
|
171
172
|
if (unknownError instanceof http_1.CLIUnsupportedClientError) {
|
|
@@ -178,7 +179,7 @@ async function fetchBootstrap(base, token) {
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
async function init(targetPath, options = {}) {
|
|
181
|
-
const resolved = (0, node_path_1.resolve)(targetPath ||
|
|
182
|
+
const resolved = (0, node_path_1.resolve)(targetPath || ".");
|
|
182
183
|
let stats = null;
|
|
183
184
|
try {
|
|
184
185
|
stats = (0, node_fs_1.statSync)(resolved);
|
|
@@ -188,15 +189,17 @@ async function init(targetPath, options = {}) {
|
|
|
188
189
|
}
|
|
189
190
|
if (stats && !stats.isDirectory()) {
|
|
190
191
|
(0, messages_1.printErrorWithHelp)(`Cannot initialize a Playdrop project because ${resolved} is not a directory.`, [
|
|
191
|
-
'Choose a directory path (use "." for the current folder) or create the directory before running "playdrop project init".'
|
|
192
|
-
], { command:
|
|
192
|
+
'Choose a directory path (use "." for the current folder) or create the directory before running "playdrop project init".',
|
|
193
|
+
], { command: "project init" });
|
|
193
194
|
process.exitCode = 1;
|
|
194
195
|
return null;
|
|
195
196
|
}
|
|
196
197
|
(0, node_fs_1.mkdirSync)(resolved, { recursive: true });
|
|
197
|
-
const cataloguePath = (0, node_path_1.join)(resolved,
|
|
198
|
+
const cataloguePath = (0, node_path_1.join)(resolved, "catalogue.json");
|
|
198
199
|
const catalogueExisted = (0, node_fs_1.existsSync)(cataloguePath);
|
|
199
|
-
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)(
|
|
200
|
+
const ctx = await (0, commandContext_1.resolveAuthenticatedEnvironmentContext)("project init", "Bootstrapping a Playdrop project", {
|
|
201
|
+
workspacePath: resolved,
|
|
202
|
+
});
|
|
200
203
|
if (!ctx) {
|
|
201
204
|
return null;
|
|
202
205
|
}
|
|
@@ -215,8 +218,8 @@ async function init(targetPath, options = {}) {
|
|
|
215
218
|
if (!normalized) {
|
|
216
219
|
return null;
|
|
217
220
|
}
|
|
218
|
-
const readmePath = (0, node_path_1.join)(resolved,
|
|
219
|
-
const agentsPath = (0, node_path_1.join)(resolved,
|
|
221
|
+
const readmePath = (0, node_path_1.join)(resolved, "README.md");
|
|
222
|
+
const agentsPath = (0, node_path_1.join)(resolved, "AGENTS.md");
|
|
220
223
|
const actions = [];
|
|
221
224
|
const readmeExisted = (0, node_fs_1.existsSync)(readmePath);
|
|
222
225
|
const agentsExisted = (0, node_fs_1.existsSync)(agentsPath);
|
|
@@ -233,7 +236,7 @@ async function init(targetPath, options = {}) {
|
|
|
233
236
|
if (!username) {
|
|
234
237
|
return null;
|
|
235
238
|
}
|
|
236
|
-
const readmeDownload = await downloadBootstrapAsset(envConfig.webBase, normalized.readmeUri,
|
|
239
|
+
const readmeDownload = await downloadBootstrapAsset(envConfig.webBase, normalized.readmeUri, "README.md");
|
|
237
240
|
if (!readmeDownload) {
|
|
238
241
|
return null;
|
|
239
242
|
}
|
|
@@ -244,63 +247,63 @@ async function init(targetPath, options = {}) {
|
|
|
244
247
|
date: new Date().toISOString().slice(0, 10),
|
|
245
248
|
};
|
|
246
249
|
const renderedReadme = ensureTrailingNewline(renderReadmeTemplate(readmeDownload, replacements));
|
|
247
|
-
(0, node_fs_1.writeFileSync)(readmePath, renderedReadme,
|
|
248
|
-
actions.push(readmeExisted ?
|
|
250
|
+
(0, node_fs_1.writeFileSync)(readmePath, renderedReadme, "utf8");
|
|
251
|
+
actions.push(readmeExisted ? "Updated README.md" : "Created README.md");
|
|
249
252
|
if (agentsExisted) {
|
|
250
|
-
actions.push(
|
|
253
|
+
actions.push("Skipped existing AGENTS.md");
|
|
251
254
|
}
|
|
252
255
|
else {
|
|
253
|
-
const agentsDownload = await downloadBootstrapAsset(envConfig.webBase, normalized.agentsUri,
|
|
256
|
+
const agentsDownload = await downloadBootstrapAsset(envConfig.webBase, normalized.agentsUri, "AGENTS.md");
|
|
254
257
|
if (!agentsDownload) {
|
|
255
258
|
return null;
|
|
256
259
|
}
|
|
257
|
-
(0, node_fs_1.writeFileSync)(agentsPath, agentsDownload,
|
|
258
|
-
actions.push(
|
|
260
|
+
(0, node_fs_1.writeFileSync)(agentsPath, agentsDownload, "utf8");
|
|
261
|
+
actions.push("Created AGENTS.md");
|
|
259
262
|
}
|
|
260
263
|
if (!catalogueExisted) {
|
|
261
|
-
(0, node_fs_1.writeFileSync)(cataloguePath, normalized.catalogue,
|
|
262
|
-
actions.push(
|
|
264
|
+
(0, node_fs_1.writeFileSync)(cataloguePath, normalized.catalogue, "utf8");
|
|
265
|
+
actions.push("Created catalogue.json");
|
|
263
266
|
}
|
|
264
267
|
else {
|
|
265
|
-
actions.push(
|
|
268
|
+
actions.push("Skipped existing catalogue.json");
|
|
266
269
|
}
|
|
267
|
-
const label = (0, node_path_1.relative)(process.cwd(), resolved) ||
|
|
268
|
-
const gitDirPath = (0, node_path_1.join)(resolved,
|
|
270
|
+
const label = (0, node_path_1.relative)(process.cwd(), resolved) || ".";
|
|
271
|
+
const gitDirPath = (0, node_path_1.join)(resolved, ".git");
|
|
269
272
|
const hasGitRepo = (0, node_fs_1.existsSync)(gitDirPath);
|
|
270
|
-
let gitStatus =
|
|
273
|
+
let gitStatus = "skipped";
|
|
271
274
|
if (!hasGitRepo) {
|
|
272
275
|
if (!options.quiet && node_process_1.stdin.isTTY && node_process_1.stdout.isTTY) {
|
|
273
276
|
const consent = await promptGitInitialization(label);
|
|
274
277
|
if (consent) {
|
|
275
278
|
const success = runGitInit(resolved);
|
|
276
279
|
if (success) {
|
|
277
|
-
gitStatus =
|
|
278
|
-
actions.push(
|
|
280
|
+
gitStatus = "initialized";
|
|
281
|
+
actions.push("Initialized git repository");
|
|
279
282
|
}
|
|
280
283
|
else {
|
|
281
|
-
gitStatus =
|
|
282
|
-
actions.push(
|
|
284
|
+
gitStatus = "declined";
|
|
285
|
+
actions.push("git init failed (install Git and retry)");
|
|
283
286
|
process.exitCode = process.exitCode || 1;
|
|
284
287
|
}
|
|
285
288
|
}
|
|
286
289
|
else {
|
|
287
|
-
gitStatus =
|
|
288
|
-
actions.push(
|
|
290
|
+
gitStatus = "declined";
|
|
291
|
+
actions.push("Skipped git init (declined)");
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
294
|
else if (!options.quiet) {
|
|
292
|
-
actions.push(
|
|
295
|
+
actions.push("Skipped git init (non-interactive)");
|
|
293
296
|
}
|
|
294
297
|
}
|
|
295
298
|
else if (!options.quiet) {
|
|
296
|
-
actions.push(
|
|
299
|
+
actions.push("Detected existing git repository");
|
|
297
300
|
}
|
|
298
301
|
const summary = {
|
|
299
302
|
directory: resolved,
|
|
300
303
|
cataloguePath,
|
|
301
|
-
readmeStatus: readmeExisted ?
|
|
302
|
-
agentsStatus: agentsExisted ?
|
|
303
|
-
catalogueStatus: catalogueExisted ?
|
|
304
|
+
readmeStatus: readmeExisted ? "updated" : "created",
|
|
305
|
+
agentsStatus: agentsExisted ? "skipped" : "created",
|
|
306
|
+
catalogueStatus: catalogueExisted ? "skipped" : "created",
|
|
304
307
|
gitStatus,
|
|
305
308
|
};
|
|
306
309
|
if (!options.quiet) {
|
|
@@ -308,7 +311,7 @@ async function init(targetPath, options = {}) {
|
|
|
308
311
|
for (const action of actions) {
|
|
309
312
|
console.log(` - ${action}`);
|
|
310
313
|
}
|
|
311
|
-
console.log(
|
|
314
|
+
console.log("\nNext steps:");
|
|
312
315
|
console.log(' - Run "playdrop project create app <app-name>" to scaffold your first app.');
|
|
313
316
|
console.log(' - Use "playdrop project dev <app-name>" to preview locally.');
|
|
314
317
|
console.log(' - Publish with "playdrop project publish ." when ready to share.');
|
package/dist/commands/login.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resetOpenBrowserForTests, setOpenBrowserForTests } from
|
|
2
|
-
export { resetOpenBrowserForTests, setOpenBrowserForTests
|
|
1
|
+
import { resetOpenBrowserForTests, setOpenBrowserForTests } from "../browser";
|
|
2
|
+
export { resetOpenBrowserForTests, setOpenBrowserForTests };
|
|
3
3
|
type LoginOptions = {
|
|
4
4
|
username?: string;
|
|
5
5
|
password?: string;
|
package/dist/commands/login.js
CHANGED
|
@@ -18,42 +18,35 @@ function sleep(ms) {
|
|
|
18
18
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
19
19
|
}
|
|
20
20
|
function extractAccessToken(data) {
|
|
21
|
-
return data.accessToken
|
|
22
|
-
?? (typeof data === 'object' && data !== null && 'token' in data ? data.token : undefined);
|
|
21
|
+
return (data.accessToken ?? (typeof data === "object" && data !== null && "token" in data ? data.token : undefined));
|
|
23
22
|
}
|
|
24
23
|
function isLoginResponse(data) {
|
|
25
|
-
return typeof data ===
|
|
24
|
+
return typeof data === "object" && data !== null && "user" in data;
|
|
26
25
|
}
|
|
27
26
|
function buildCliLoginTokenName(machineHostname = (0, node_os_1.hostname)()) {
|
|
28
27
|
const normalizedHostname = machineHostname.trim();
|
|
29
28
|
if (!normalizedHostname) {
|
|
30
|
-
throw new Error(
|
|
29
|
+
throw new Error("cli_login_hostname_missing");
|
|
31
30
|
}
|
|
32
31
|
return `CLI on ${normalizedHostname}`;
|
|
33
32
|
}
|
|
34
33
|
function storeLogin(env, data, options = {}) {
|
|
35
34
|
const token = extractAccessToken(data);
|
|
36
35
|
if (!token) {
|
|
37
|
-
(0, messages_1.printErrorWithHelp)(
|
|
38
|
-
'Please try again in a moment.',
|
|
39
|
-
'If the issue persists, contact the Playdrop team.',
|
|
40
|
-
], { command: 'login' });
|
|
36
|
+
(0, messages_1.printErrorWithHelp)("Login succeeded but no access token was returned.", ["Please try again in a moment.", "If the issue persists, contact the Playdrop team."], { command: "login" });
|
|
41
37
|
process.exitCode = 1;
|
|
42
38
|
return;
|
|
43
39
|
}
|
|
44
|
-
const username = typeof data.user?.username ===
|
|
40
|
+
const username = typeof data.user?.username === "string" ? data.user.username.trim() : "";
|
|
45
41
|
if (!username) {
|
|
46
|
-
(0, messages_1.printErrorWithHelp)(
|
|
47
|
-
'Please try again in a moment.',
|
|
48
|
-
'If the issue persists, contact the Playdrop team.',
|
|
49
|
-
], { command: 'login' });
|
|
42
|
+
(0, messages_1.printErrorWithHelp)("Login succeeded but the account username was missing.", ["Please try again in a moment.", "If the issue persists, contact the Playdrop team."], { command: "login" });
|
|
50
43
|
process.exitCode = 1;
|
|
51
44
|
return;
|
|
52
45
|
}
|
|
53
46
|
(0, config_1.saveAccountSession)({ username, env, token });
|
|
54
47
|
if (options.json) {
|
|
55
48
|
(0, output_1.printJson)({
|
|
56
|
-
status:
|
|
49
|
+
status: "authenticated",
|
|
57
50
|
username,
|
|
58
51
|
env,
|
|
59
52
|
});
|
|
@@ -64,14 +57,12 @@ function storeLogin(env, data, options = {}) {
|
|
|
64
57
|
}
|
|
65
58
|
async function storeDeviceLogin(env, baseUrl, initialLogin, options = {}) {
|
|
66
59
|
const sessionToken = extractAccessToken(initialLogin);
|
|
67
|
-
const username = typeof initialLogin.user?.username ===
|
|
68
|
-
? initialLogin.user.username.trim()
|
|
69
|
-
: '';
|
|
60
|
+
const username = typeof initialLogin.user?.username === "string" ? initialLogin.user.username.trim() : "";
|
|
70
61
|
if (!sessionToken) {
|
|
71
|
-
throw new Error(
|
|
62
|
+
throw new Error("Login response is missing the session token required to create this computer token.");
|
|
72
63
|
}
|
|
73
64
|
if (!username) {
|
|
74
|
-
throw new Error(
|
|
65
|
+
throw new Error("Login response is missing the username required to save this computer token.");
|
|
75
66
|
}
|
|
76
67
|
try {
|
|
77
68
|
const sessionClient = (0, apiClient_1.createCliApiClient)({ baseUrl, token: sessionToken });
|
|
@@ -85,16 +76,16 @@ async function storeDeviceLogin(env, baseUrl, initialLogin, options = {}) {
|
|
|
85
76
|
}
|
|
86
77
|
catch (unknownError) {
|
|
87
78
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
88
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
79
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
89
80
|
return;
|
|
90
81
|
}
|
|
91
82
|
if (unknownError instanceof types_1.ApiError) {
|
|
92
|
-
const tokenLimitReached = unknownError.code ===
|
|
83
|
+
const tokenLimitReached = unknownError.code === "cli_api_token_limit_reached";
|
|
93
84
|
(0, messages_1.printErrorWithHelp)(tokenLimitReached
|
|
94
|
-
?
|
|
85
|
+
? "Login succeeded, but this account already has the maximum of 25 CLI tokens."
|
|
95
86
|
: `Login succeeded, but this computer's CLI token could not be created (status ${unknownError.status}).`, tokenLimitReached
|
|
96
87
|
? ['Delete an unused CLI token in account settings, then rerun "playdrop auth login".']
|
|
97
|
-
: ['Rerun "playdrop auth login" to try again.'], { command:
|
|
88
|
+
: ['Rerun "playdrop auth login" to try again.'], { command: "login" });
|
|
98
89
|
process.exitCode = 1;
|
|
99
90
|
return;
|
|
100
91
|
}
|
|
@@ -109,14 +100,14 @@ async function loginWithUsernamePassword(env, baseUrl, username, password, optio
|
|
|
109
100
|
}
|
|
110
101
|
catch (unknownError) {
|
|
111
102
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
112
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
103
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
113
104
|
return;
|
|
114
105
|
}
|
|
115
106
|
if (unknownError instanceof types_1.ApiError) {
|
|
116
107
|
(0, messages_1.printErrorWithHelp)(`Login failed with status ${unknownError.status}.`, [
|
|
117
108
|
'Verify your username and password, then rerun "playdrop auth login".',
|
|
118
109
|
'Use "playdrop auth whoami" after logging in to confirm your status.',
|
|
119
|
-
], { command:
|
|
110
|
+
], { command: "login" });
|
|
120
111
|
process.exitCode = 1;
|
|
121
112
|
return;
|
|
122
113
|
}
|
|
@@ -131,14 +122,14 @@ async function loginWithKey(env, baseUrl, apiKey, options = {}) {
|
|
|
131
122
|
}
|
|
132
123
|
catch (unknownError) {
|
|
133
124
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
134
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
125
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
135
126
|
return;
|
|
136
127
|
}
|
|
137
128
|
if (unknownError instanceof types_1.ApiError) {
|
|
138
129
|
(0, messages_1.printErrorWithHelp)(`Login failed with status ${unknownError.status}.`, [
|
|
139
130
|
'Verify your API key, then rerun "playdrop auth login --key <api-key>".',
|
|
140
131
|
'Use "playdrop auth whoami" after logging in to confirm your status.',
|
|
141
|
-
], { command:
|
|
132
|
+
], { command: "login" });
|
|
142
133
|
process.exitCode = 1;
|
|
143
134
|
return;
|
|
144
135
|
}
|
|
@@ -153,14 +144,14 @@ async function loginWithHandoff(env, baseUrl, handoffToken, options = {}) {
|
|
|
153
144
|
}
|
|
154
145
|
catch (unknownError) {
|
|
155
146
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
156
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
147
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
157
148
|
return;
|
|
158
149
|
}
|
|
159
150
|
if (unknownError instanceof types_1.ApiError) {
|
|
160
151
|
(0, messages_1.printErrorWithHelp)(`Login handoff failed with status ${unknownError.status}.`, [
|
|
161
|
-
|
|
152
|
+
"Request a fresh handoff token from the PlayDrop app and retry.",
|
|
162
153
|
'Use "playdrop auth whoami" after logging in to confirm your status.',
|
|
163
|
-
], { command:
|
|
154
|
+
], { command: "login" });
|
|
164
155
|
process.exitCode = 1;
|
|
165
156
|
return;
|
|
166
157
|
}
|
|
@@ -175,14 +166,11 @@ async function loginInBrowser(env, baseUrl, options = {}) {
|
|
|
175
166
|
}
|
|
176
167
|
catch (unknownError) {
|
|
177
168
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
178
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
169
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
179
170
|
return;
|
|
180
171
|
}
|
|
181
172
|
if (unknownError instanceof types_1.ApiError) {
|
|
182
|
-
(0, messages_1.printErrorWithHelp)(`Could not start browser login (status ${unknownError.status}).`, [
|
|
183
|
-
'Try again in a moment.',
|
|
184
|
-
'If the problem continues, contact the Playdrop team.',
|
|
185
|
-
], { command: 'login' });
|
|
173
|
+
(0, messages_1.printErrorWithHelp)(`Could not start browser login (status ${unknownError.status}).`, ["Try again in a moment.", "If the problem continues, contact the Playdrop team."], { command: "login" });
|
|
186
174
|
process.exitCode = 1;
|
|
187
175
|
return;
|
|
188
176
|
}
|
|
@@ -191,15 +179,13 @@ async function loginInBrowser(env, baseUrl, options = {}) {
|
|
|
191
179
|
console.log(`Open this URL to continue: ${flow.loginUrl}`);
|
|
192
180
|
const opened = await (0, browser_1.openBrowserUrl)(flow.loginUrl).catch(() => false);
|
|
193
181
|
if (opened) {
|
|
194
|
-
console.log(
|
|
182
|
+
console.log("Opened the login page in your browser.");
|
|
195
183
|
}
|
|
196
184
|
else {
|
|
197
|
-
console.log(
|
|
185
|
+
console.log("Open the URL above in your browser to continue.");
|
|
198
186
|
}
|
|
199
187
|
const expiresAtMs = Date.parse(flow.expiresAt);
|
|
200
|
-
const deadlineMs = Number.isFinite(expiresAtMs)
|
|
201
|
-
? expiresAtMs
|
|
202
|
-
: Date.now() + 10 * 60 * 1000;
|
|
188
|
+
const deadlineMs = Number.isFinite(expiresAtMs) ? expiresAtMs : Date.now() + 10 * 60 * 1000;
|
|
203
189
|
const intervalMs = Math.max(250, Number(flow.pollIntervalMs) || 1000);
|
|
204
190
|
while (Date.now() < deadlineMs) {
|
|
205
191
|
try {
|
|
@@ -216,41 +202,35 @@ async function loginInBrowser(env, baseUrl, options = {}) {
|
|
|
216
202
|
}
|
|
217
203
|
catch (unknownError) {
|
|
218
204
|
if (unknownError instanceof types_1.UnsupportedClientError) {
|
|
219
|
-
(0, http_1.handleUnsupportedError)(unknownError,
|
|
205
|
+
(0, http_1.handleUnsupportedError)(unknownError, "Login");
|
|
220
206
|
return;
|
|
221
207
|
}
|
|
222
208
|
if (unknownError instanceof types_1.ApiError) {
|
|
223
|
-
if (unknownError.status === 410 || unknownError.code ===
|
|
224
|
-
(0, messages_1.printErrorWithHelp)(
|
|
225
|
-
'Rerun "playdrop auth login" to start a new browser login request.',
|
|
226
|
-
], { command: 'login' });
|
|
209
|
+
if (unknownError.status === 410 || unknownError.code === "cli_login_expired") {
|
|
210
|
+
(0, messages_1.printErrorWithHelp)("Browser login expired before it was approved.", ['Rerun "playdrop auth login" to start a new browser login request.'], { command: "login" });
|
|
227
211
|
process.exitCode = 1;
|
|
228
212
|
return;
|
|
229
213
|
}
|
|
230
|
-
(0, messages_1.printErrorWithHelp)(`Browser login failed with status ${unknownError.status}.`, [
|
|
231
|
-
'Rerun "playdrop auth login" to try again.',
|
|
232
|
-
], { command: 'login' });
|
|
214
|
+
(0, messages_1.printErrorWithHelp)(`Browser login failed with status ${unknownError.status}.`, ['Rerun "playdrop auth login" to try again.'], { command: "login" });
|
|
233
215
|
process.exitCode = 1;
|
|
234
216
|
return;
|
|
235
217
|
}
|
|
236
218
|
throw unknownError;
|
|
237
219
|
}
|
|
238
220
|
}
|
|
239
|
-
(0, messages_1.printErrorWithHelp)(
|
|
240
|
-
'Rerun "playdrop auth login" to start a new browser login request.',
|
|
241
|
-
], { command: 'login' });
|
|
221
|
+
(0, messages_1.printErrorWithHelp)("Browser login timed out after 10 minutes.", ['Rerun "playdrop auth login" to start a new browser login request.'], { command: "login" });
|
|
242
222
|
process.exitCode = 1;
|
|
243
223
|
}
|
|
244
224
|
async function login(env, options = {}) {
|
|
245
225
|
const envConfig = (0, environment_1.resolveEnvironmentConfig)(env);
|
|
246
226
|
if (!envConfig) {
|
|
247
227
|
const choices = (0, environment_1.formatEnvironmentList)();
|
|
248
|
-
(0, messages_1.printUnknownEnvironment)(env, choices,
|
|
228
|
+
(0, messages_1.printUnknownEnvironment)(env, choices, "login");
|
|
249
229
|
process.exitCode = 1;
|
|
250
230
|
return;
|
|
251
231
|
}
|
|
252
232
|
if (envConfig.allowInsecureRequests) {
|
|
253
|
-
process.env.NODE_TLS_REJECT_UNAUTHORIZED =
|
|
233
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
254
234
|
}
|
|
255
235
|
const username = options.username?.trim();
|
|
256
236
|
const password = options.password;
|
|
@@ -260,17 +240,17 @@ async function login(env, options = {}) {
|
|
|
260
240
|
const hasHandoffTokenArgument = options.handoffToken !== undefined;
|
|
261
241
|
const hasDirectCredentials = Boolean(username || password);
|
|
262
242
|
const explicitLoginMethods = [
|
|
263
|
-
hasApiKeyArgument ?
|
|
264
|
-
hasDirectCredentials ?
|
|
265
|
-
hasHandoffTokenArgument ?
|
|
243
|
+
hasApiKeyArgument ? "key" : null,
|
|
244
|
+
hasDirectCredentials ? "credentials" : null,
|
|
245
|
+
hasHandoffTokenArgument ? "handoff" : null,
|
|
266
246
|
].filter(Boolean);
|
|
267
247
|
if (explicitLoginMethods.length > 1) {
|
|
268
|
-
(0, messages_1.printErrorWithHelp)(
|
|
248
|
+
(0, messages_1.printErrorWithHelp)("Choose exactly one login method.", [
|
|
269
249
|
'Use "playdrop auth login" for browser login.',
|
|
270
250
|
'Use "--username" with "--password" for direct login.',
|
|
271
251
|
'Use "--key" by itself for API key login.',
|
|
272
252
|
'Use "--handoff-token" by itself for native app handoff login.',
|
|
273
|
-
], { command:
|
|
253
|
+
], { command: "login" });
|
|
274
254
|
process.exitCode = 1;
|
|
275
255
|
return;
|
|
276
256
|
}
|
|
@@ -278,17 +258,17 @@ async function login(env, options = {}) {
|
|
|
278
258
|
(0, messages_1.printErrorWithHelp)('Provide both "--username" and "--password" together.', [
|
|
279
259
|
'Rerun "playdrop auth login --username <username> --password <password>".',
|
|
280
260
|
'Or run "playdrop auth login" to use browser login instead.',
|
|
281
|
-
], { command:
|
|
261
|
+
], { command: "login" });
|
|
282
262
|
process.exitCode = 1;
|
|
283
263
|
return;
|
|
284
264
|
}
|
|
285
265
|
if (hasApiKeyArgument && !apiKey) {
|
|
286
|
-
(0, messages_1.printErrorWithHelp)(
|
|
266
|
+
(0, messages_1.printErrorWithHelp)("The API key cannot be empty.", ['Provide a non-empty value to "--key".'], { command: "login" });
|
|
287
267
|
process.exitCode = 1;
|
|
288
268
|
return;
|
|
289
269
|
}
|
|
290
270
|
if (hasHandoffTokenArgument && !argvHandoffToken) {
|
|
291
|
-
(0, messages_1.printErrorWithHelp)(
|
|
271
|
+
(0, messages_1.printErrorWithHelp)("The native app handoff token cannot be empty.", ["Request a fresh handoff token from the PlayDrop app and retry."], { command: "login" });
|
|
292
272
|
process.exitCode = 1;
|
|
293
273
|
return;
|
|
294
274
|
}
|
|
@@ -311,7 +291,7 @@ async function login(env, options = {}) {
|
|
|
311
291
|
if (error instanceof http_1.CLIUnsupportedClientError) {
|
|
312
292
|
return;
|
|
313
293
|
}
|
|
314
|
-
(0, messages_1.printNetworkIssue)(
|
|
294
|
+
(0, messages_1.printNetworkIssue)("Could not reach the Playdrop API to log in.", "login");
|
|
315
295
|
process.exitCode = 1;
|
|
316
296
|
}
|
|
317
297
|
}
|
package/dist/commands/logout.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.logout = logout;
|
|
|
4
4
|
const config_1 = require("../config");
|
|
5
5
|
function logout(options = {}) {
|
|
6
6
|
const current = (0, config_1.getCurrentAccountSession)();
|
|
7
|
-
const username = options.username?.trim() || current?.username ||
|
|
8
|
-
const env = options.env?.trim() || current?.env ||
|
|
7
|
+
const username = options.username?.trim() || current?.username || "";
|
|
8
|
+
const env = options.env?.trim() || current?.env || "";
|
|
9
9
|
const existingSession = username ? (0, config_1.findAccountSession)(username, env || undefined) : null;
|
|
10
10
|
if (!existingSession) {
|
|
11
11
|
if (username && env) {
|
|
@@ -15,7 +15,7 @@ function logout(options = {}) {
|
|
|
15
15
|
console.log(`No stored session found for ${username}.`);
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
|
-
console.log(
|
|
18
|
+
console.log("No stored session found.");
|
|
19
19
|
}
|
|
20
20
|
console.log('Next: run "playdrop auth login" when you need a new session.');
|
|
21
21
|
return;
|
|
@@ -25,7 +25,7 @@ function logout(options = {}) {
|
|
|
25
25
|
console.log(`Logged out ${username} on ${env}.`);
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
console.log(
|
|
28
|
+
console.log("Logged out.");
|
|
29
29
|
}
|
|
30
30
|
console.log('Next: run "playdrop auth login" when you need a new session.');
|
|
31
31
|
}
|