@playdrop/playdrop-cli 0.16.5 → 0.16.12
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/clients.js
CHANGED
|
@@ -15,11 +15,11 @@ const node_path_1 = require("node:path");
|
|
|
15
15
|
const node_child_process_1 = require("node:child_process");
|
|
16
16
|
const output_1 = require("../output");
|
|
17
17
|
const versionCompare_1 = require("../versionCompare");
|
|
18
|
-
const MAC_APP_PATH =
|
|
19
|
-
const MAC_CLIENT_LATEST_URL =
|
|
20
|
-
const WINDOWS_CLIENT_EXECUTABLE =
|
|
21
|
-
const WINDOWS_CLIENT_INSTALL_HINT =
|
|
22
|
-
const WINDOWS_CLIENT_PATH_ENV =
|
|
18
|
+
const MAC_APP_PATH = "/Applications/PlayDrop.app";
|
|
19
|
+
const MAC_CLIENT_LATEST_URL = "https://www.playdrop.ai/api/mac-client/latest";
|
|
20
|
+
const WINDOWS_CLIENT_EXECUTABLE = "PlayDrop.exe";
|
|
21
|
+
const WINDOWS_CLIENT_INSTALL_HINT = "Install or update PlayDrop for Windows with the Windows installer or the in-app updater.";
|
|
22
|
+
const WINDOWS_CLIENT_PATH_ENV = "PLAYDROP_WINDOWS_CLIENT_PATH";
|
|
23
23
|
async function showClientStatus(options = {}) {
|
|
24
24
|
const status = await getClientStatus(options);
|
|
25
25
|
if (options.json) {
|
|
@@ -32,14 +32,14 @@ async function showClientStatus(options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
async function getClientStatus(options = {}) {
|
|
34
34
|
const platform = options.platform ?? process.platform;
|
|
35
|
-
if (platform ===
|
|
35
|
+
if (platform === "win32") {
|
|
36
36
|
return getWindowsClientStatus(options);
|
|
37
37
|
}
|
|
38
|
-
if (platform !==
|
|
38
|
+
if (platform !== "darwin") {
|
|
39
39
|
return {
|
|
40
40
|
platform,
|
|
41
41
|
supported: false,
|
|
42
|
-
status:
|
|
42
|
+
status: "unavailable",
|
|
43
43
|
installed: false,
|
|
44
44
|
reason: `PlayDrop native clients are not available for ${platform}.`,
|
|
45
45
|
};
|
|
@@ -52,7 +52,7 @@ async function getClientStatus(options = {}) {
|
|
|
52
52
|
return {
|
|
53
53
|
platform,
|
|
54
54
|
supported: true,
|
|
55
|
-
status: !installed ?
|
|
55
|
+
status: !installed ? "missing" : updateAvailable ? "update-available" : "installed",
|
|
56
56
|
installed,
|
|
57
57
|
appPath,
|
|
58
58
|
version: bundle.version,
|
|
@@ -60,21 +60,21 @@ async function getClientStatus(options = {}) {
|
|
|
60
60
|
latestVersion: latest?.version,
|
|
61
61
|
latestBuild: latest?.build,
|
|
62
62
|
updateAvailable,
|
|
63
|
-
nextAction: !installed ?
|
|
63
|
+
nextAction: !installed ? "playdrop clients install" : updateAvailable ? "playdrop clients update" : undefined,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
async function installClient(options = {}) {
|
|
67
|
-
await installOrUpdateClient(
|
|
67
|
+
await installOrUpdateClient("install", options);
|
|
68
68
|
}
|
|
69
69
|
async function updateClient(options = {}) {
|
|
70
|
-
await installOrUpdateClient(
|
|
70
|
+
await installOrUpdateClient("update", options);
|
|
71
71
|
}
|
|
72
72
|
async function launchClient(options = {}) {
|
|
73
73
|
const platform = options.platform ?? process.platform;
|
|
74
|
-
if (platform ===
|
|
74
|
+
if (platform === "win32") {
|
|
75
75
|
const status = await getWindowsClientStatus(options);
|
|
76
76
|
if (!status.installed || !status.appPath) {
|
|
77
|
-
console.error(
|
|
77
|
+
console.error("PlayDrop for Windows is not installed.");
|
|
78
78
|
console.error(WINDOWS_CLIENT_INSTALL_HINT);
|
|
79
79
|
process.exitCode = 1;
|
|
80
80
|
return;
|
|
@@ -86,10 +86,10 @@ async function launchClient(options = {}) {
|
|
|
86
86
|
process.exitCode = 1;
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
console.log(
|
|
89
|
+
console.log("Launched PlayDrop.");
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (platform !==
|
|
92
|
+
if (platform !== "darwin") {
|
|
93
93
|
printUnsupportedPlatform(platform);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
@@ -101,51 +101,51 @@ async function launchClient(options = {}) {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
const runCommand = options.runCommand ?? runCommandSync;
|
|
104
|
-
const result = runCommand(
|
|
104
|
+
const result = runCommand("open", [appPath]);
|
|
105
105
|
if (result.status !== 0) {
|
|
106
106
|
console.error(`Failed to launch PlayDrop from ${appPath}.`);
|
|
107
107
|
process.exitCode = 1;
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
console.log(
|
|
110
|
+
console.log("Launched PlayDrop.");
|
|
111
111
|
}
|
|
112
112
|
async function installOrUpdateClient(action, options) {
|
|
113
113
|
const platform = options.platform ?? process.platform;
|
|
114
|
-
if (platform ===
|
|
114
|
+
if (platform === "win32") {
|
|
115
115
|
console.error(`PlayDrop for Windows ${action} is not available through the CLI yet.`);
|
|
116
116
|
console.error(WINDOWS_CLIENT_INSTALL_HINT);
|
|
117
117
|
process.exitCode = 1;
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (platform !==
|
|
120
|
+
if (platform !== "darwin") {
|
|
121
121
|
printUnsupportedPlatform(platform);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
const appPath = options.appPath ?? MAC_APP_PATH;
|
|
125
125
|
const runCommand = options.runCommand ?? runCommandSync;
|
|
126
126
|
if (isPlayDropRunning(runCommand)) {
|
|
127
|
-
console.error(
|
|
127
|
+
console.error("PlayDrop is running. Quit PlayDrop before installing or updating.");
|
|
128
128
|
process.exitCode = 1;
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
try {
|
|
132
|
-
(0, node_fs_1.accessSync)(
|
|
132
|
+
(0, node_fs_1.accessSync)("/Applications", node_fs_1.constants.W_OK);
|
|
133
133
|
}
|
|
134
134
|
catch {
|
|
135
|
-
console.error(
|
|
136
|
-
console.error(
|
|
135
|
+
console.error("Cannot write to /Applications.");
|
|
136
|
+
console.error("Run this command from a terminal with permission to install apps into /Applications.");
|
|
137
137
|
process.exitCode = 1;
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
const manifest = await (options.fetchLatestManifest ?? fetchLatestMacClientManifest)();
|
|
141
141
|
if (!manifest) {
|
|
142
|
-
console.error(
|
|
142
|
+
console.error("Could not resolve the latest PlayDrop Mac client manifest.");
|
|
143
143
|
process.exitCode = 1;
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
const installed = await installMacDmg(manifest, appPath, runCommand);
|
|
147
147
|
if (installed) {
|
|
148
|
-
console.log(`${action ===
|
|
148
|
+
console.log(`${action === "install" ? "Installed" : "Updated"} PlayDrop at ${appPath}.`);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
function printUnsupportedPlatform(platform) {
|
|
@@ -158,7 +158,7 @@ function printClientStatus(status) {
|
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
if (!status.installed) {
|
|
161
|
-
console.log(
|
|
161
|
+
console.log("PlayDrop client: missing");
|
|
162
162
|
if (status.nextAction) {
|
|
163
163
|
console.log(`Run: ${status.nextAction}`);
|
|
164
164
|
}
|
|
@@ -167,31 +167,31 @@ function printClientStatus(status) {
|
|
|
167
167
|
}
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const version = status.version ? ` ${status.version}` :
|
|
170
|
+
const version = status.version ? ` ${status.version}` : "";
|
|
171
171
|
console.log(`PlayDrop client: ${status.status}${version}`);
|
|
172
172
|
if (status.appPath) {
|
|
173
173
|
console.log(`Location: ${status.appPath}`);
|
|
174
174
|
}
|
|
175
175
|
if (status.updateAvailable) {
|
|
176
|
-
console.log(
|
|
176
|
+
console.log("Run: playdrop clients update");
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
async function getWindowsClientStatus(options) {
|
|
180
180
|
const appPath = resolveWindowsClientPath(options.appPath);
|
|
181
181
|
if (!appPath) {
|
|
182
182
|
return {
|
|
183
|
-
platform:
|
|
183
|
+
platform: "win32",
|
|
184
184
|
supported: true,
|
|
185
|
-
status:
|
|
185
|
+
status: "missing",
|
|
186
186
|
installed: false,
|
|
187
187
|
reason: WINDOWS_CLIENT_INSTALL_HINT,
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
const bundle = readWindowsClientInfo(appPath);
|
|
191
191
|
return {
|
|
192
|
-
platform:
|
|
192
|
+
platform: "win32",
|
|
193
193
|
supported: true,
|
|
194
|
-
status:
|
|
194
|
+
status: "installed",
|
|
195
195
|
installed: true,
|
|
196
196
|
appPath,
|
|
197
197
|
version: bundle.version,
|
|
@@ -214,20 +214,19 @@ function windowsClientPathCandidates(explicitPath) {
|
|
|
214
214
|
add(process.env[WINDOWS_CLIENT_PATH_ENV]);
|
|
215
215
|
const localAppData = process.env.LOCALAPPDATA;
|
|
216
216
|
if (localAppData) {
|
|
217
|
-
add((0, node_path_1.join)(localAppData,
|
|
218
|
-
add((0, node_path_1.join)(localAppData,
|
|
217
|
+
add((0, node_path_1.join)(localAppData, "PlayDrop.Windows", "current", WINDOWS_CLIENT_EXECUTABLE));
|
|
218
|
+
add((0, node_path_1.join)(localAppData, "PlayDrop", "current", WINDOWS_CLIENT_EXECUTABLE));
|
|
219
219
|
}
|
|
220
|
-
add(process.env.ProgramFiles ? (0, node_path_1.join)(process.env.ProgramFiles,
|
|
221
|
-
add(process.env[
|
|
220
|
+
add(process.env.ProgramFiles ? (0, node_path_1.join)(process.env.ProgramFiles, "PlayDrop", WINDOWS_CLIENT_EXECUTABLE) : undefined);
|
|
221
|
+
add(process.env["ProgramFiles(x86)"]
|
|
222
|
+
? (0, node_path_1.join)(process.env["ProgramFiles(x86)"], "PlayDrop", WINDOWS_CLIENT_EXECUTABLE)
|
|
223
|
+
: undefined);
|
|
222
224
|
return [...new Set(candidates)];
|
|
223
225
|
}
|
|
224
226
|
function readWindowsClientInfo(appPath) {
|
|
225
|
-
for (const versionPath of [
|
|
226
|
-
(0, node_path_1.join)((0, node_path_1.dirname)(appPath), 'sq.version'),
|
|
227
|
-
(0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.dirname)(appPath)), 'sq.version'),
|
|
228
|
-
]) {
|
|
227
|
+
for (const versionPath of [(0, node_path_1.join)((0, node_path_1.dirname)(appPath), "sq.version"), (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.dirname)(appPath)), "sq.version")]) {
|
|
229
228
|
try {
|
|
230
|
-
const version = (0, node_fs_1.readFileSync)(versionPath,
|
|
229
|
+
const version = (0, node_fs_1.readFileSync)(versionPath, "utf8").trim();
|
|
231
230
|
if (version.length > 0) {
|
|
232
231
|
return { version };
|
|
233
232
|
}
|
|
@@ -240,20 +239,24 @@ function readWindowsClientInfo(appPath) {
|
|
|
240
239
|
}
|
|
241
240
|
async function fetchLatestMacClientManifest() {
|
|
242
241
|
try {
|
|
243
|
-
const response = await fetch(MAC_CLIENT_LATEST_URL, { headers: { Accept:
|
|
242
|
+
const response = await fetch(MAC_CLIENT_LATEST_URL, { headers: { Accept: "application/json" } });
|
|
244
243
|
if (!response.ok) {
|
|
245
244
|
return null;
|
|
246
245
|
}
|
|
247
|
-
const payload = await response.json();
|
|
248
|
-
if (payload.platform !==
|
|
246
|
+
const payload = (await response.json());
|
|
247
|
+
if (payload.platform !== "mac" ||
|
|
248
|
+
!payload.version ||
|
|
249
|
+
!payload.build ||
|
|
250
|
+
!payload.downloadUrl ||
|
|
251
|
+
!payload.dmgFilename) {
|
|
249
252
|
return null;
|
|
250
253
|
}
|
|
251
254
|
return {
|
|
252
|
-
platform:
|
|
255
|
+
platform: "mac",
|
|
253
256
|
version: payload.version,
|
|
254
257
|
build: payload.build,
|
|
255
258
|
versionCode: payload.versionCode ?? payload.build,
|
|
256
|
-
filename: payload.filename ??
|
|
259
|
+
filename: payload.filename ?? "PlayDrop.app",
|
|
257
260
|
dmgFilename: payload.dmgFilename,
|
|
258
261
|
downloadUrl: payload.downloadUrl,
|
|
259
262
|
};
|
|
@@ -263,12 +266,12 @@ async function fetchLatestMacClientManifest() {
|
|
|
263
266
|
}
|
|
264
267
|
}
|
|
265
268
|
function readMacBundleInfo(appPath) {
|
|
266
|
-
const infoPath = (0, node_path_1.join)(appPath,
|
|
269
|
+
const infoPath = (0, node_path_1.join)(appPath, "Contents", "Info.plist");
|
|
267
270
|
try {
|
|
268
|
-
const xml = (0, node_fs_1.readFileSync)(infoPath,
|
|
271
|
+
const xml = (0, node_fs_1.readFileSync)(infoPath, "utf8");
|
|
269
272
|
return {
|
|
270
|
-
version: readPlistString(xml,
|
|
271
|
-
build: readPlistString(xml,
|
|
273
|
+
version: readPlistString(xml, "CFBundleShortVersionString"),
|
|
274
|
+
build: readPlistString(xml, "CFBundleVersion"),
|
|
272
275
|
};
|
|
273
276
|
}
|
|
274
277
|
catch {
|
|
@@ -276,18 +279,18 @@ function readMacBundleInfo(appPath) {
|
|
|
276
279
|
}
|
|
277
280
|
}
|
|
278
281
|
function readPlistString(xml, key) {
|
|
279
|
-
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g,
|
|
282
|
+
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
280
283
|
const match = xml.match(new RegExp(`<key>\\s*${escaped}\\s*</key>\\s*<string>([^<]+)</string>`));
|
|
281
284
|
return match?.[1]?.trim();
|
|
282
285
|
}
|
|
283
286
|
function isPlayDropRunning(runCommand) {
|
|
284
|
-
const result = (runCommand ?? runCommandSync)(
|
|
287
|
+
const result = (runCommand ?? runCommandSync)("pgrep", ["-x", "PlayDrop"]);
|
|
285
288
|
return result.status === 0;
|
|
286
289
|
}
|
|
287
290
|
async function installMacDmg(manifest, appPath, runCommand) {
|
|
288
|
-
const tempDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)(node_os_1.default.tmpdir(),
|
|
289
|
-
const dmgPath = (0, node_path_1.join)(tempDir, (0, node_path_1.basename)(manifest.dmgFilename ||
|
|
290
|
-
const mountPath = (0, node_path_1.join)(tempDir,
|
|
291
|
+
const tempDir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)(node_os_1.default.tmpdir(), "playdrop-client-"));
|
|
292
|
+
const dmgPath = (0, node_path_1.join)(tempDir, (0, node_path_1.basename)(manifest.dmgFilename || "PlayDrop.dmg"));
|
|
293
|
+
const mountPath = (0, node_path_1.join)(tempDir, "mount");
|
|
291
294
|
(0, node_fs_1.mkdirSync)(mountPath, { recursive: true });
|
|
292
295
|
try {
|
|
293
296
|
const response = await fetch(manifest.downloadUrl);
|
|
@@ -296,13 +299,13 @@ async function installMacDmg(manifest, appPath, runCommand) {
|
|
|
296
299
|
}
|
|
297
300
|
const arrayBuffer = await response.arrayBuffer();
|
|
298
301
|
(0, node_fs_1.writeFileSync)(dmgPath, Buffer.from(arrayBuffer));
|
|
299
|
-
const attach = runCommand(
|
|
302
|
+
const attach = runCommand("hdiutil", ["attach", dmgPath, "-nobrowse", "-quiet", "-mountpoint", mountPath]);
|
|
300
303
|
if (attach.status !== 0) {
|
|
301
|
-
throw new Error(
|
|
304
|
+
throw new Error("hdiutil_attach_failed");
|
|
302
305
|
}
|
|
303
|
-
const sourceApp = (0, node_path_1.join)(mountPath,
|
|
306
|
+
const sourceApp = (0, node_path_1.join)(mountPath, "PlayDrop.app");
|
|
304
307
|
if (!(0, node_fs_1.existsSync)(sourceApp)) {
|
|
305
|
-
throw new Error(
|
|
308
|
+
throw new Error("playdrop_app_missing_in_dmg");
|
|
306
309
|
}
|
|
307
310
|
replaceAppBundle(sourceApp, appPath);
|
|
308
311
|
return true;
|
|
@@ -314,7 +317,7 @@ async function installMacDmg(manifest, appPath, runCommand) {
|
|
|
314
317
|
return false;
|
|
315
318
|
}
|
|
316
319
|
finally {
|
|
317
|
-
runCommand(
|
|
320
|
+
runCommand("hdiutil", ["detach", mountPath, "-quiet"]);
|
|
318
321
|
(0, node_fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
319
322
|
}
|
|
320
323
|
}
|
|
@@ -345,10 +348,10 @@ function replaceAppBundle(sourceApp, appPath) {
|
|
|
345
348
|
}
|
|
346
349
|
}
|
|
347
350
|
function runCommandSync(command, args) {
|
|
348
|
-
const result = (0, node_child_process_1.spawnSync)(command, args, { encoding:
|
|
351
|
+
const result = (0, node_child_process_1.spawnSync)(command, args, { encoding: "utf8" });
|
|
349
352
|
return {
|
|
350
353
|
status: result.status,
|
|
351
|
-
stdout: result.stdout ??
|
|
352
|
-
stderr: result.stderr ??
|
|
354
|
+
stdout: result.stdout ?? "",
|
|
355
|
+
stderr: result.stderr ?? "",
|
|
353
356
|
};
|
|
354
357
|
}
|
|
@@ -12,7 +12,7 @@ function parsePositiveInteger(raw, label, command) {
|
|
|
12
12
|
if (raw === undefined) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
const parsed = typeof raw ===
|
|
15
|
+
const parsed = typeof raw === "number" ? raw : Number.parseInt(String(raw), 10);
|
|
16
16
|
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
17
17
|
(0, messages_1.printErrorWithHelp)(`${label} must be a positive integer.`, [], { command });
|
|
18
18
|
process.exitCode = 1;
|
|
@@ -21,11 +21,11 @@ function parsePositiveInteger(raw, label, command) {
|
|
|
21
21
|
return parsed;
|
|
22
22
|
}
|
|
23
23
|
function printComments(nodes, depth = 0) {
|
|
24
|
-
const indent =
|
|
24
|
+
const indent = " ".repeat(depth);
|
|
25
25
|
for (const node of nodes) {
|
|
26
|
-
const author = node.author?.displayName || node.author?.username ||
|
|
27
|
-
const creatorBadge = node.authorIsCreator ?
|
|
28
|
-
const body = node.isDeleted ?
|
|
26
|
+
const author = node.author?.displayName || node.author?.username || "unknown";
|
|
27
|
+
const creatorBadge = node.authorIsCreator ? " [creator]" : "";
|
|
28
|
+
const body = node.isDeleted ? "[deleted]" : node.body;
|
|
29
29
|
console.log(`${indent}- #${node.id} ${author}${creatorBadge} | ${(0, output_1.formatTimestamp)(node.createdAt)}`);
|
|
30
30
|
console.log(`${indent} ${body}`);
|
|
31
31
|
if (Array.isArray(node.replies) && node.replies.length > 0) {
|
|
@@ -36,14 +36,14 @@ function printComments(nodes, depth = 0) {
|
|
|
36
36
|
async function browseComments(rawRef, options = {}) {
|
|
37
37
|
let ref;
|
|
38
38
|
try {
|
|
39
|
-
ref = (0, refs_1.parseContentRef)(rawRef ??
|
|
39
|
+
ref = (0, refs_1.parseContentRef)(rawRef ?? "");
|
|
40
40
|
}
|
|
41
41
|
catch {
|
|
42
|
-
(0, messages_1.printErrorWithHelp)(
|
|
42
|
+
(0, messages_1.printErrorWithHelp)("A canonical ref is required.", ["Use the format <creator>/<kind>/<name>.", "Example: playdrop comments browse playdrop/app/hangingout"], { command: "comments browse" });
|
|
43
43
|
process.exitCode = 1;
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
await (0, commandContext_1.withPublicEnvironment)(
|
|
46
|
+
await (0, commandContext_1.withPublicEnvironment)("comments browse", async ({ client }) => {
|
|
47
47
|
try {
|
|
48
48
|
const response = await client.fetchContentComments((0, refs_1.contentKindToSavedItemKind)(ref.kind), ref.creator, ref.name);
|
|
49
49
|
const items = response.comments ?? [];
|
|
@@ -61,12 +61,12 @@ async function browseComments(rawRef, options = {}) {
|
|
|
61
61
|
console.log('\nNext: run "playdrop comments add <ref> --body <text>" to reply.');
|
|
62
62
|
}
|
|
63
63
|
catch (error) {
|
|
64
|
-
const handled = (0, errors_1.handleCommandFailure)(error,
|
|
64
|
+
const handled = (0, errors_1.handleCommandFailure)(error, "comments browse", "Comment lookup", {
|
|
65
65
|
apiMessage: (apiError) => {
|
|
66
66
|
if (apiError.status === 404) {
|
|
67
67
|
return {
|
|
68
68
|
problem: `No item was found for "${ref.ref}".`,
|
|
69
|
-
suggestions: [
|
|
69
|
+
suggestions: ["Check the ref and retry.", 'Run "playdrop browse" to explore available content.'],
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
if (apiError.status === 401 || apiError.status === 403) {
|
|
@@ -77,7 +77,7 @@ async function browseComments(rawRef, options = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
return {
|
|
79
79
|
problem: `Comment lookup failed with status ${apiError.status}.`,
|
|
80
|
-
suggestions: [
|
|
80
|
+
suggestions: ["Retry in a moment."],
|
|
81
81
|
};
|
|
82
82
|
},
|
|
83
83
|
});
|
|
@@ -90,24 +90,27 @@ async function browseComments(rawRef, options = {}) {
|
|
|
90
90
|
async function addComment(rawRef, options = {}) {
|
|
91
91
|
let ref;
|
|
92
92
|
try {
|
|
93
|
-
ref = (0, refs_1.parseContentRef)(rawRef ??
|
|
93
|
+
ref = (0, refs_1.parseContentRef)(rawRef ?? "");
|
|
94
94
|
}
|
|
95
95
|
catch {
|
|
96
|
-
(0, messages_1.printErrorWithHelp)(
|
|
96
|
+
(0, messages_1.printErrorWithHelp)("A canonical ref is required.", [
|
|
97
|
+
"Use the format <creator>/<kind>/<name>.",
|
|
98
|
+
'Example: playdrop comments add playdrop/app/hangingout --body "Nice work"',
|
|
99
|
+
], { command: "comments add" });
|
|
97
100
|
process.exitCode = 1;
|
|
98
101
|
return;
|
|
99
102
|
}
|
|
100
|
-
const body = typeof options.body ===
|
|
103
|
+
const body = typeof options.body === "string" ? options.body.trim() : "";
|
|
101
104
|
if (!body) {
|
|
102
|
-
(0, messages_1.printErrorWithHelp)(
|
|
105
|
+
(0, messages_1.printErrorWithHelp)("Comment body is required.", ["Use --body <text>."], { command: "comments add" });
|
|
103
106
|
process.exitCode = 1;
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
|
-
const replyTo = parsePositiveInteger(options.replyTo,
|
|
109
|
+
const replyTo = parsePositiveInteger(options.replyTo, "--reply-to", "comments add");
|
|
107
110
|
if (options.replyTo !== undefined && replyTo === null) {
|
|
108
111
|
return;
|
|
109
112
|
}
|
|
110
|
-
await (0, commandContext_1.withEnvironment)(
|
|
113
|
+
await (0, commandContext_1.withEnvironment)("comments add", "Adding a comment", async ({ client }) => {
|
|
111
114
|
try {
|
|
112
115
|
const response = await client.createContentComment((0, refs_1.contentKindToSavedItemKind)(ref.kind), ref.creator, ref.name, {
|
|
113
116
|
body,
|
|
@@ -117,26 +120,28 @@ async function addComment(rawRef, options = {}) {
|
|
|
117
120
|
(0, output_1.printJson)({ comment: response.comment });
|
|
118
121
|
return;
|
|
119
122
|
}
|
|
120
|
-
(0, output_1.printSuccess)(`Comment added to ${ref.ref}.`, [
|
|
123
|
+
(0, output_1.printSuccess)(`Comment added to ${ref.ref}.`, [
|
|
124
|
+
'Next: run "playdrop comments browse ' + ref.ref + '" to review the thread.',
|
|
125
|
+
]);
|
|
121
126
|
}
|
|
122
127
|
catch (error) {
|
|
123
|
-
const handled = (0, errors_1.handleCommandFailure)(error,
|
|
128
|
+
const handled = (0, errors_1.handleCommandFailure)(error, "comments add", "Add comment", {
|
|
124
129
|
apiMessage: (apiError) => {
|
|
125
130
|
if (apiError.status === 401 || apiError.status === 403) {
|
|
126
131
|
return {
|
|
127
|
-
problem:
|
|
132
|
+
problem: "Adding a comment requires you to be logged in.",
|
|
128
133
|
suggestions: ['Run "playdrop auth login" and retry.'],
|
|
129
134
|
};
|
|
130
135
|
}
|
|
131
136
|
if (apiError.status === 404) {
|
|
132
137
|
return {
|
|
133
138
|
problem: `No item was found for "${ref.ref}".`,
|
|
134
|
-
suggestions: [
|
|
139
|
+
suggestions: ["Check the ref and retry."],
|
|
135
140
|
};
|
|
136
141
|
}
|
|
137
142
|
return {
|
|
138
143
|
problem: `Adding a comment failed with status ${apiError.status}.`,
|
|
139
|
-
suggestions: [
|
|
144
|
+
suggestions: ["Retry in a moment."],
|
|
140
145
|
};
|
|
141
146
|
},
|
|
142
147
|
});
|
|
@@ -147,37 +152,39 @@ async function addComment(rawRef, options = {}) {
|
|
|
147
152
|
});
|
|
148
153
|
}
|
|
149
154
|
async function deleteComment(commentId, options = {}) {
|
|
150
|
-
const numericId = parsePositiveInteger(commentId,
|
|
155
|
+
const numericId = parsePositiveInteger(commentId, "Comment id", "comments delete");
|
|
151
156
|
if (numericId === null) {
|
|
152
157
|
return;
|
|
153
158
|
}
|
|
154
|
-
await (0, commandContext_1.withEnvironment)(
|
|
159
|
+
await (0, commandContext_1.withEnvironment)("comments delete", "Deleting a comment", async ({ client }) => {
|
|
155
160
|
try {
|
|
156
161
|
const response = await client.deleteContentComment(numericId);
|
|
157
162
|
if (options.json) {
|
|
158
163
|
(0, output_1.printJson)({ success: Boolean(response.success), commentId: numericId });
|
|
159
164
|
return;
|
|
160
165
|
}
|
|
161
|
-
(0, output_1.printSuccess)(`Comment #${numericId} deleted.`, [
|
|
166
|
+
(0, output_1.printSuccess)(`Comment #${numericId} deleted.`, [
|
|
167
|
+
'Next: run "playdrop comments browse <ref>" to confirm the thread state.',
|
|
168
|
+
]);
|
|
162
169
|
}
|
|
163
170
|
catch (error) {
|
|
164
|
-
const handled = (0, errors_1.handleCommandFailure)(error,
|
|
171
|
+
const handled = (0, errors_1.handleCommandFailure)(error, "comments delete", "Delete comment", {
|
|
165
172
|
apiMessage: (apiError) => {
|
|
166
173
|
if (apiError.status === 401 || apiError.status === 403) {
|
|
167
174
|
return {
|
|
168
|
-
problem:
|
|
175
|
+
problem: "Deleting a comment requires a valid login with permission to manage it.",
|
|
169
176
|
suggestions: ['Run "playdrop auth login" and retry.'],
|
|
170
177
|
};
|
|
171
178
|
}
|
|
172
179
|
if (apiError.status === 404) {
|
|
173
180
|
return {
|
|
174
181
|
problem: `Comment #${numericId} was not found.`,
|
|
175
|
-
suggestions: [
|
|
182
|
+
suggestions: ["Check the id and retry."],
|
|
176
183
|
};
|
|
177
184
|
}
|
|
178
185
|
return {
|
|
179
186
|
problem: `Deleting a comment failed with status ${apiError.status}.`,
|
|
180
|
-
suggestions: [
|
|
187
|
+
suggestions: ["Retry in a moment."],
|
|
181
188
|
};
|
|
182
189
|
},
|
|
183
190
|
});
|