@playdrop/playdrop-cli 0.16.16 → 0.17.1
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/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +1 -2
- package/dist/apiClient.js +1 -16
- package/dist/appUrls.js +4 -0
- package/dist/apps/build.d.ts +12 -4
- package/dist/apps/build.js +55 -22
- package/dist/apps/index.d.ts +2 -1
- package/dist/apps/index.js +4 -1
- package/dist/apps/loadCheck.d.ts +5 -1
- package/dist/apps/loadCheck.js +52 -18
- package/dist/apps/serverBuild.d.ts +17 -0
- package/dist/apps/serverBuild.js +155 -0
- package/dist/apps/staticHtml.d.ts +1 -0
- package/dist/apps/staticHtml.js +19 -10
- package/dist/apps/upload.d.ts +12 -2
- package/dist/apps/upload.js +127 -46
- package/dist/catalogue.d.ts +23 -1
- package/dist/catalogue.js +126 -100
- package/dist/commandContext.d.ts +6 -3
- package/dist/commandContext.js +108 -18
- package/dist/commands/build.js +0 -7
- package/dist/commands/captureListing.d.ts +3 -0
- package/dist/commands/captureListing.js +48 -4
- package/dist/commands/chat.d.ts +4 -0
- package/dist/commands/chat.js +133 -8
- package/dist/commands/check.js +34 -1
- package/dist/commands/create.js +30 -263
- package/dist/commands/dev.js +37 -3
- package/dist/commands/devBrowser.js +2 -2
- package/dist/commands/devGameServer.d.ts +16 -0
- package/dist/commands/devGameServer.js +237 -0
- package/dist/commands/devRuntimeAssets.d.ts +1 -0
- package/dist/commands/devRuntimeAssets.js +2 -0
- package/dist/commands/devServer.d.ts +3 -0
- package/dist/commands/devServer.js +111 -5
- package/dist/commands/generation.d.ts +33 -4
- package/dist/commands/generation.js +304 -115
- package/dist/commands/login.js +23 -7
- package/dist/commands/review.d.ts +1 -1
- package/dist/commands/review.js +68 -95
- package/dist/commands/source.d.ts +19 -0
- package/dist/commands/source.js +142 -0
- package/dist/commands/tweaks.js +5 -11
- package/dist/commands/upload-content.d.ts +1 -1
- package/dist/commands/upload-content.js +16 -12
- package/dist/commands/upload.d.ts +17 -1
- package/dist/commands/upload.js +47 -10
- package/dist/commands/worker/archive-staging.d.ts +1 -0
- package/dist/commands/worker/archive-staging.js +13 -2
- package/dist/commands/worker/e2e-fixtures.d.ts +32 -0
- package/dist/commands/worker/e2e-fixtures.js +466 -0
- package/dist/commands/worker/game-server-infra.d.ts +80 -0
- package/dist/commands/worker/game-server-infra.js +595 -0
- package/dist/commands/worker/game-source-git.d.ts +126 -0
- package/dist/commands/worker/game-source-git.js +782 -0
- package/dist/commands/worker/generation.d.ts +94 -0
- package/dist/commands/worker/generation.js +1458 -0
- package/dist/commands/worker/runtime.d.ts +8 -10
- package/dist/commands/worker/runtime.js +51 -45
- package/dist/commands/worker.d.ts +79 -19
- package/dist/commands/worker.js +1796 -419
- package/dist/config.d.ts +2 -0
- package/dist/config.js +16 -3
- package/dist/environment.d.ts +0 -1
- package/dist/environment.js +0 -8
- package/dist/index.js +92 -13
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +15 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts +72 -25
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +33 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
- 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 +338 -41
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +35 -3
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.js +89 -7
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +80 -29
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +217 -56
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
- package/node_modules/@playdrop/api-client/package.json +7 -0
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
- package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/config/package.json +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
- package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@playdrop/game-source-git/package.json +28 -0
- 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/agent-task-terminal.js +15 -9
- package/node_modules/@playdrop/types/dist/api.d.ts +728 -164
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +60 -11
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.js +26 -26
- package/node_modules/@playdrop/types/dist/chat.d.ts +107 -3
- package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.js +33 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
- package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/index.js +7 -1
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
- package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
- package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
- package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
- package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +111 -0
- package/node_modules/@playdrop/types/package.json +14 -0
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/node_modules/@playdrop/vox-three/package.json +8 -4
- package/node_modules/@playwright/mcp/node_modules/fsevents/LICENSE +22 -0
- package/node_modules/@playwright/mcp/node_modules/fsevents/README.md +83 -0
- package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.d.ts +46 -0
- package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.js +82 -0
- package/node_modules/@playwright/mcp/node_modules/fsevents/fsevents.node +0 -0
- package/node_modules/@playwright/mcp/node_modules/fsevents/package.json +62 -0
- package/package.json +9 -11
- package/dist/assets/model-artifacts.d.ts +0 -8
- package/dist/assets/model-artifacts.js +0 -382
- package/dist/assets/model-worker.d.ts +0 -22
- package/dist/assets/model-worker.js +0 -123
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
- package/node_modules/@playdrop/ai-client/package.json +0 -22
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
- package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
- package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/package.json +0 -19
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
- package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/package.json +0 -28
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidDevRedisNamespace = isValidDevRedisNamespace;
|
|
4
|
+
exports.startDevGameServer = startDevGameServer;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_module_1 = require("node:module");
|
|
7
|
+
const node_net_1 = require("node:net");
|
|
8
|
+
const mongodb_1 = require("mongodb");
|
|
9
|
+
const ioredis_1 = require("ioredis");
|
|
10
|
+
const serverBuild_1 = require("../apps/serverBuild");
|
|
11
|
+
const EXPECTED_REDIS_VERSION = "7.4.5";
|
|
12
|
+
const EXPECTED_MONGODB_VERSION = "8.0.26";
|
|
13
|
+
function isValidDevRedisNamespace(namespace) {
|
|
14
|
+
return /^colyseus:[a-z0-9_.-]+:[a-z0-9_.-]+:$/u.test(namespace);
|
|
15
|
+
}
|
|
16
|
+
function requireServiceUrl(name) {
|
|
17
|
+
const value = process.env[name]?.trim() ?? "";
|
|
18
|
+
if (!value)
|
|
19
|
+
throw new Error(`${name.toLowerCase()}_missing`);
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
async function verifyRedis(redisUrl, namespace) {
|
|
23
|
+
const redis = new ioredis_1.Redis(redisUrl, { connectTimeout: 2000, maxRetriesPerRequest: 1, lazyConnect: true });
|
|
24
|
+
redis.on("error", () => undefined);
|
|
25
|
+
try {
|
|
26
|
+
await redis.connect();
|
|
27
|
+
const info = await redis.info("server");
|
|
28
|
+
const version = /^redis_version:([^\r\n]+)/m.exec(info)?.[1]?.trim() ?? "unknown";
|
|
29
|
+
if (version !== EXPECTED_REDIS_VERSION) {
|
|
30
|
+
throw new Error(`playdrop_dev_redis_version_mismatch:expected=${EXPECTED_REDIS_VERSION}:actual=${version}`);
|
|
31
|
+
}
|
|
32
|
+
const probeKey = `${namespace}preflight:${process.pid}`;
|
|
33
|
+
await redis.set(probeKey, "1", "EX", 5);
|
|
34
|
+
if ((await redis.get(probeKey)) !== "1")
|
|
35
|
+
throw new Error("playdrop_dev_redis_probe_failed");
|
|
36
|
+
await redis.del(probeKey);
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
await redis.quit().catch(() => undefined);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function verifyScopedMongoUrl(mongoUrl) {
|
|
43
|
+
const mongo = new mongodb_1.MongoClient(mongoUrl, { serverSelectionTimeoutMS: 2000, maxPoolSize: 1 });
|
|
44
|
+
try {
|
|
45
|
+
await mongo.connect();
|
|
46
|
+
const database = mongo.db();
|
|
47
|
+
const buildInfo = (await database.admin().command({ buildInfo: 1 }));
|
|
48
|
+
const version = typeof buildInfo.version === "string" ? buildInfo.version : "unknown";
|
|
49
|
+
if (version !== EXPECTED_MONGODB_VERSION) {
|
|
50
|
+
throw new Error(`playdrop_dev_mongo_version_mismatch:expected=${EXPECTED_MONGODB_VERSION}:actual=${version}`);
|
|
51
|
+
}
|
|
52
|
+
const hello = (await database.admin().command({ hello: 1 }));
|
|
53
|
+
if (typeof hello.setName !== "string" || hello.isWritablePrimary !== true) {
|
|
54
|
+
throw new Error("playdrop_dev_mongo_replica_set_unavailable");
|
|
55
|
+
}
|
|
56
|
+
const probe = database.collection("_playdrop_dev_preflight");
|
|
57
|
+
await probe.updateOne({ _id: "scope" }, { $set: { checkedAt: new Date() } }, { upsert: true });
|
|
58
|
+
await probe.deleteOne({ _id: "scope" });
|
|
59
|
+
await mongo.db("admin").listCollections().toArray().then(() => { throw new Error("playdrop_dev_mongo_scope_failed"); }, (error) => {
|
|
60
|
+
if (!(error && typeof error === "object" && "code" in error && error.code === 13))
|
|
61
|
+
throw error;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
await mongo.close().catch(() => undefined);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async function provisionScopedMongoUrl(mongoUrl, appId) {
|
|
69
|
+
const mongo = new mongodb_1.MongoClient(mongoUrl, { serverSelectionTimeoutMS: 2000, maxPoolSize: 1 });
|
|
70
|
+
try {
|
|
71
|
+
await mongo.connect();
|
|
72
|
+
const admin = mongo.db("admin");
|
|
73
|
+
const buildInfo = (await admin.command({ buildInfo: 1 }));
|
|
74
|
+
const version = typeof buildInfo.version === "string" ? buildInfo.version : "unknown";
|
|
75
|
+
if (version !== EXPECTED_MONGODB_VERSION) {
|
|
76
|
+
throw new Error(`playdrop_dev_mongo_version_mismatch:expected=${EXPECTED_MONGODB_VERSION}:actual=${version}`);
|
|
77
|
+
}
|
|
78
|
+
const hello = (await admin.command({ hello: 1 }));
|
|
79
|
+
if (hello.setName !== "playdrop-rs0" || hello.isWritablePrimary !== true) {
|
|
80
|
+
throw new Error("playdrop_dev_mongo_replica_set_unavailable");
|
|
81
|
+
}
|
|
82
|
+
const databaseName = `app_${appId}`;
|
|
83
|
+
const username = `playdrop-app-${appId}`;
|
|
84
|
+
const password = `playdrop-local-app-${appId}`;
|
|
85
|
+
const database = mongo.db(databaseName);
|
|
86
|
+
const users = (await database.command({ usersInfo: username }));
|
|
87
|
+
if (Array.isArray(users.users) && users.users.length > 0) {
|
|
88
|
+
await database.command({
|
|
89
|
+
updateUser: username,
|
|
90
|
+
pwd: password,
|
|
91
|
+
roles: [{ role: "readWrite", db: databaseName }],
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
await database.command({
|
|
96
|
+
createUser: username,
|
|
97
|
+
pwd: password,
|
|
98
|
+
roles: [{ role: "readWrite", db: databaseName }],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const scoped = new URL(mongoUrl);
|
|
102
|
+
scoped.username = username;
|
|
103
|
+
scoped.password = password;
|
|
104
|
+
scoped.pathname = `/${databaseName}`;
|
|
105
|
+
scoped.searchParams.set("authSource", databaseName);
|
|
106
|
+
scoped.searchParams.set("maxPoolSize", "5");
|
|
107
|
+
const scopedUrl = scoped.toString();
|
|
108
|
+
const scopedClient = new mongodb_1.MongoClient(scopedUrl, { serverSelectionTimeoutMS: 2000, maxPoolSize: 1 });
|
|
109
|
+
try {
|
|
110
|
+
await scopedClient.connect();
|
|
111
|
+
await scopedClient.db().command({ ping: 1 });
|
|
112
|
+
const probe = scopedClient.db().collection("_playdrop_dev_preflight");
|
|
113
|
+
await probe.updateOne({ _id: "scope" }, { $set: { checkedAt: new Date() } }, { upsert: true });
|
|
114
|
+
await probe.deleteOne({ _id: "scope" });
|
|
115
|
+
await scopedClient.db("admin").listCollections().toArray().then(() => { throw new Error("playdrop_dev_mongo_scope_failed"); }, (error) => {
|
|
116
|
+
if (!(error && typeof error === "object" && "code" in error && error.code === 13))
|
|
117
|
+
throw error;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
await scopedClient.close().catch(() => undefined);
|
|
122
|
+
}
|
|
123
|
+
return scopedUrl;
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
await mongo.close().catch(() => undefined);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function reserveLocalPort() {
|
|
130
|
+
const server = (0, node_net_1.createServer)();
|
|
131
|
+
await new Promise((resolveListen, rejectListen) => {
|
|
132
|
+
server.once("error", rejectListen);
|
|
133
|
+
server.listen(0, "127.0.0.1", () => resolveListen());
|
|
134
|
+
});
|
|
135
|
+
const address = server.address();
|
|
136
|
+
if (!address || typeof address === "string")
|
|
137
|
+
throw new Error("dev_rooms_port_unavailable");
|
|
138
|
+
await new Promise((resolveClose, rejectClose) => server.close((error) => error ? rejectClose(error) : resolveClose()));
|
|
139
|
+
return address.port;
|
|
140
|
+
}
|
|
141
|
+
function resolveDevRuntimeEntry(task) {
|
|
142
|
+
if (!task.packageJsonPath)
|
|
143
|
+
throw new Error("server_package_json_required");
|
|
144
|
+
const requireFromProject = (0, node_module_1.createRequire)(task.packageJsonPath);
|
|
145
|
+
try {
|
|
146
|
+
return requireFromProject.resolve("@playdrop/server/dev-runtime");
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
throw new Error("server_dev_runtime_missing:@playdrop/server must be installed in the game project");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function waitForReady(child, timeoutMs = 10000) {
|
|
153
|
+
await new Promise((resolveReady, rejectReady) => {
|
|
154
|
+
let output = "";
|
|
155
|
+
const timer = setTimeout(() => rejectReady(new Error("dev_rooms_start_timeout")), timeoutMs);
|
|
156
|
+
const fail = (error) => {
|
|
157
|
+
clearTimeout(timer);
|
|
158
|
+
rejectReady(error);
|
|
159
|
+
};
|
|
160
|
+
child.once("error", fail);
|
|
161
|
+
child.once("exit", (code) => fail(new Error(`dev_rooms_exited:${code ?? "signal"}`)));
|
|
162
|
+
child.stdout?.on("data", (chunk) => {
|
|
163
|
+
const text = String(chunk);
|
|
164
|
+
process.stdout.write(text);
|
|
165
|
+
output += text;
|
|
166
|
+
for (const line of output.split("\n")) {
|
|
167
|
+
try {
|
|
168
|
+
const event = JSON.parse(line);
|
|
169
|
+
if (event.event === "rooms_runtime_ready") {
|
|
170
|
+
clearTimeout(timer);
|
|
171
|
+
resolveReady();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Wait for a complete ready event line.
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
output = output.slice(-8192);
|
|
180
|
+
});
|
|
181
|
+
child.stderr?.on("data", (chunk) => process.stderr.write(chunk));
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
async function startDevGameServer(input) {
|
|
185
|
+
if (!input.task.server)
|
|
186
|
+
return null;
|
|
187
|
+
const redisUrl = requireServiceUrl("PLAYDROP_DEV_REDIS_URL");
|
|
188
|
+
const baseMongoUrl = requireServiceUrl("PLAYDROP_DEV_MONGO_URL");
|
|
189
|
+
const workerScoped = process.env.PLAYDROP_WORKER_CONTEXT === "1";
|
|
190
|
+
const redisNamespace = process.env.PLAYDROP_DEV_REDIS_NAMESPACE?.trim() ||
|
|
191
|
+
`colyseus:${input.credential.environment}:${input.credential.deploymentId}:`;
|
|
192
|
+
if (!isValidDevRedisNamespace(redisNamespace)) {
|
|
193
|
+
throw new Error("playdrop_dev_redis_namespace_invalid");
|
|
194
|
+
}
|
|
195
|
+
const scopedMongoUrl = workerScoped
|
|
196
|
+
? baseMongoUrl
|
|
197
|
+
: await provisionScopedMongoUrl(baseMongoUrl, input.credential.appId);
|
|
198
|
+
await Promise.all([
|
|
199
|
+
verifyRedis(redisUrl, redisNamespace),
|
|
200
|
+
verifyScopedMongoUrl(scopedMongoUrl),
|
|
201
|
+
]);
|
|
202
|
+
const build = await (0, serverBuild_1.buildGameServer)(input.task);
|
|
203
|
+
if (!build)
|
|
204
|
+
throw new Error("server_build_missing");
|
|
205
|
+
const port = await reserveLocalPort();
|
|
206
|
+
const runtimeEntry = resolveDevRuntimeEntry(input.task);
|
|
207
|
+
const child = (0, node_child_process_1.spawn)(process.execPath, ["--max-old-space-size=192", runtimeEntry], {
|
|
208
|
+
cwd: input.task.projectDir,
|
|
209
|
+
detached: process.platform !== "win32",
|
|
210
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
211
|
+
env: {
|
|
212
|
+
NODE_ENV: "development",
|
|
213
|
+
...(process.env.TMPDIR ? { TMPDIR: process.env.TMPDIR } : {}),
|
|
214
|
+
...(process.env.LANG ? { LANG: process.env.LANG } : {}),
|
|
215
|
+
PLAYDROP_ROOMS_BUNDLE: build.bundlePath,
|
|
216
|
+
PLAYDROP_ROOMS_MANIFEST: build.manifestPath,
|
|
217
|
+
PLAYDROP_ROOMS_PORT: String(port),
|
|
218
|
+
PLAYDROP_ROOMS_ENVIRONMENT: input.credential.environment,
|
|
219
|
+
PLAYDROP_ROOMS_DEPLOYMENT_ID: input.credential.deploymentId,
|
|
220
|
+
PLAYDROP_ROOMS_PUBLIC_ADDRESS: input.publicAddress,
|
|
221
|
+
PLAYDROP_PLATFORM_API_URL: input.platformApiUrl,
|
|
222
|
+
PLAYDROP_SERVICE_TOKEN: input.credential.serviceToken,
|
|
223
|
+
PLAYDROP_DEV_REDIS_URL: redisUrl,
|
|
224
|
+
PLAYDROP_DEV_REDIS_NAMESPACE: redisNamespace,
|
|
225
|
+
PLAYDROP_DEV_MONGO_URL: scopedMongoUrl,
|
|
226
|
+
PLAYDROP_MONGO_URL: scopedMongoUrl,
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
try {
|
|
230
|
+
await waitForReady(child);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
child.kill("SIGTERM");
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
return { process: child, port, build };
|
|
237
|
+
}
|
|
@@ -21,6 +21,7 @@ function createEmptyDevRuntimeAssetManifest() {
|
|
|
21
21
|
controllerMode: types_1.DEFAULT_APP_CONTROLLER_MODE,
|
|
22
22
|
previewable: types_1.DEFAULT_APP_PREVIEWABLE,
|
|
23
23
|
editorSupported: false,
|
|
24
|
+
hasServer: false,
|
|
24
25
|
assetSpecSupport: [],
|
|
25
26
|
version: null,
|
|
26
27
|
},
|
|
@@ -120,6 +121,7 @@ function buildLocalAppMetadata(task) {
|
|
|
120
121
|
controllerMode: task.controllerMode ?? types_1.DEFAULT_APP_CONTROLLER_MODE,
|
|
121
122
|
previewable: task.previewable ?? types_1.DEFAULT_APP_PREVIEWABLE,
|
|
122
123
|
editorSupported: task.editorSupported ?? false,
|
|
124
|
+
hasServer: Boolean(task.server),
|
|
123
125
|
assetSpecSupport: task.assetSpecSupport.map((entry) => ({
|
|
124
126
|
assetSpecRef: entry.assetSpec,
|
|
125
127
|
versionRange: entry.versionRange,
|
|
@@ -10,11 +10,14 @@ export interface StartDevServerOptions {
|
|
|
10
10
|
port: number;
|
|
11
11
|
projectInfo: ProjectInfo;
|
|
12
12
|
runtimeAssetManifest?: DevRuntimeAssetManifestRegistration | null;
|
|
13
|
+
roomsPort?: number | null;
|
|
14
|
+
roomsProcess?: ChildProcess | null;
|
|
13
15
|
}
|
|
14
16
|
export interface DevServerHandle {
|
|
15
17
|
server: null;
|
|
16
18
|
devProcess: ChildProcess | null;
|
|
17
19
|
startedDevProcess: boolean;
|
|
20
|
+
roomsProcess: ChildProcess | null;
|
|
18
21
|
appUrl: string;
|
|
19
22
|
close(): Promise<void>;
|
|
20
23
|
}
|
|
@@ -24,7 +24,7 @@ const npmProcess_1 = require("./npmProcess");
|
|
|
24
24
|
exports.DEV_ROUTER_PORT = 8888;
|
|
25
25
|
const DEV_ROUTER_HOST = "127.0.0.1";
|
|
26
26
|
const CONTROL_PREFIX = "/_playdrop";
|
|
27
|
-
const DEV_ROUTER_PROTOCOL_VERSION =
|
|
27
|
+
const DEV_ROUTER_PROTOCOL_VERSION = 4;
|
|
28
28
|
const APPROVED_PLAYDROP_WEB_ORIGINS = new Set(["https://playdrop.ai", "https://www.playdrop.ai"]);
|
|
29
29
|
const CONTENT_TYPE_BY_EXTENSION = {
|
|
30
30
|
".html": "text/html; charset=utf-8",
|
|
@@ -231,6 +231,88 @@ function parseMountPath(pathname) {
|
|
|
231
231
|
assetPath: rest.map((entry) => decodeURIComponent(entry)).join("/"),
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
+
function resolveRoomsProxyTarget(rawUrl) {
|
|
235
|
+
let url;
|
|
236
|
+
try {
|
|
237
|
+
url = new URL(rawUrl || "/", `http://${DEV_ROUTER_HOST}`);
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
let decodedPathname;
|
|
243
|
+
try {
|
|
244
|
+
decodedPathname = decodeURIComponent(url.pathname);
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
const parsed = parseMountPath(decodedPathname);
|
|
250
|
+
if (!parsed || (parsed.assetPath !== "_playdrop/rooms" && !parsed.assetPath.startsWith("_playdrop/rooms/"))) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
const mountId = routerMountIdsByKey.get(parsed.key);
|
|
254
|
+
const mount = mountId ? routerMountsById.get(mountId) : null;
|
|
255
|
+
if (!mount?.roomsPort)
|
|
256
|
+
return null;
|
|
257
|
+
const suffix = parsed.assetPath.slice("_playdrop/rooms".length);
|
|
258
|
+
return { mount, upstreamPath: `${suffix || "/"}${url.search}` };
|
|
259
|
+
}
|
|
260
|
+
function proxyRoomsRequest(req, res, target) {
|
|
261
|
+
const proxy = node_http_1.default.request({
|
|
262
|
+
hostname: DEV_ROUTER_HOST,
|
|
263
|
+
port: target.mount.roomsPort,
|
|
264
|
+
method: req.method,
|
|
265
|
+
path: target.upstreamPath,
|
|
266
|
+
headers: { ...req.headers, host: `${DEV_ROUTER_HOST}:${target.mount.roomsPort}` },
|
|
267
|
+
}, (upstream) => {
|
|
268
|
+
res.statusCode = upstream.statusCode ?? 502;
|
|
269
|
+
for (const [name, value] of Object.entries(upstream.headers)) {
|
|
270
|
+
if (value !== undefined)
|
|
271
|
+
res.setHeader(name, value);
|
|
272
|
+
}
|
|
273
|
+
upstream.pipe(res);
|
|
274
|
+
});
|
|
275
|
+
proxy.on("error", () => {
|
|
276
|
+
if (!res.headersSent)
|
|
277
|
+
respondWithText(res, req.method || "GET", 502, "rooms_runtime_unavailable");
|
|
278
|
+
else
|
|
279
|
+
res.destroy();
|
|
280
|
+
});
|
|
281
|
+
req.pipe(proxy);
|
|
282
|
+
}
|
|
283
|
+
function proxyRoomsUpgrade(req, socket, head) {
|
|
284
|
+
cleanupStaleRouterMounts();
|
|
285
|
+
const target = resolveRoomsProxyTarget(req.url);
|
|
286
|
+
if (!target) {
|
|
287
|
+
socket.end("HTTP/1.1 404 Not Found\r\nConnection: close\r\n\r\n");
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const proxy = node_http_1.default.request({
|
|
291
|
+
hostname: DEV_ROUTER_HOST,
|
|
292
|
+
port: target.mount.roomsPort,
|
|
293
|
+
method: req.method,
|
|
294
|
+
path: target.upstreamPath,
|
|
295
|
+
headers: { ...req.headers, host: `${DEV_ROUTER_HOST}:${target.mount.roomsPort}` },
|
|
296
|
+
});
|
|
297
|
+
proxy.on("upgrade", (upstreamResponse, upstreamSocket, upstreamHead) => {
|
|
298
|
+
const headers = upstreamResponse.rawHeaders.reduce((lines, value, index, all) => {
|
|
299
|
+
if (index % 2 === 0)
|
|
300
|
+
lines.push(`${value}: ${all[index + 1] ?? ""}`);
|
|
301
|
+
return lines;
|
|
302
|
+
}, []);
|
|
303
|
+
socket.write(`HTTP/1.1 ${upstreamResponse.statusCode ?? 101} ${upstreamResponse.statusMessage ?? "Switching Protocols"}\r\n${headers.join("\r\n")}\r\n\r\n`);
|
|
304
|
+
if (upstreamHead.length > 0)
|
|
305
|
+
socket.write(upstreamHead);
|
|
306
|
+
if (head.length > 0)
|
|
307
|
+
upstreamSocket.write(head);
|
|
308
|
+
upstreamSocket.pipe(socket).pipe(upstreamSocket);
|
|
309
|
+
});
|
|
310
|
+
proxy.on("response", (response) => {
|
|
311
|
+
socket.end(`HTTP/1.1 ${response.statusCode ?? 502} ${response.statusMessage ?? "Bad Gateway"}\r\nConnection: close\r\n\r\n`);
|
|
312
|
+
});
|
|
313
|
+
proxy.on("error", () => socket.destroy());
|
|
314
|
+
proxy.end();
|
|
315
|
+
}
|
|
234
316
|
function getOwnedRuntimeAssetFile(mount, ownedAssetName, role) {
|
|
235
317
|
const files = mount.runtimeAssetManifest?.ownedAssetFiles?.[ownedAssetName];
|
|
236
318
|
if (!files) {
|
|
@@ -431,7 +513,8 @@ async function fetchRouterHealth(port = exports.DEV_ROUTER_PORT, timeoutMs = 400
|
|
|
431
513
|
function isCompatibleRouterHealth(health) {
|
|
432
514
|
return (health.protocolVersion === DEV_ROUTER_PROTOCOL_VERSION &&
|
|
433
515
|
health.capabilities?.runtimeAssetManifest === true &&
|
|
434
|
-
health.capabilities?.runtimeAssetManifestLookup === true
|
|
516
|
+
health.capabilities?.runtimeAssetManifestLookup === true &&
|
|
517
|
+
health.capabilities?.roomsProxy === true);
|
|
435
518
|
}
|
|
436
519
|
async function ensureDevRouterRunning(port = exports.DEV_ROUTER_PORT) {
|
|
437
520
|
const existingHealth = await fetchRouterHealth(port);
|
|
@@ -520,7 +603,7 @@ async function updateMountedDevRuntimeAssetManifest(input) {
|
|
|
520
603
|
}
|
|
521
604
|
}
|
|
522
605
|
async function startDevServer(options) {
|
|
523
|
-
const { appName, appType, creatorUsername, htmlPath, port, projectInfo, runtimeAssetManifest } = options;
|
|
606
|
+
const { appName, appType, creatorUsername, htmlPath, port, projectInfo, runtimeAssetManifest, roomsPort, roomsProcess } = options;
|
|
524
607
|
const ownerPid = process.pid;
|
|
525
608
|
let closing = false;
|
|
526
609
|
const devProcess = spawnDevScript(projectInfo);
|
|
@@ -550,6 +633,7 @@ async function startDevServer(options) {
|
|
|
550
633
|
repoRoot,
|
|
551
634
|
ownerPid,
|
|
552
635
|
runtimeAssetManifest: runtimeAssetManifest ?? null,
|
|
636
|
+
roomsPort: roomsPort ?? null,
|
|
553
637
|
}, port);
|
|
554
638
|
mountId = registeredMount.mountId;
|
|
555
639
|
appUrl = registeredMount.appUrl;
|
|
@@ -558,6 +642,7 @@ async function startDevServer(options) {
|
|
|
558
642
|
if (devProcess && !devProcess.killed) {
|
|
559
643
|
devProcess.kill();
|
|
560
644
|
}
|
|
645
|
+
await terminateChildProcessTree(roomsProcess ?? null);
|
|
561
646
|
throw error;
|
|
562
647
|
}
|
|
563
648
|
const heartbeat = setInterval(() => {
|
|
@@ -569,6 +654,7 @@ async function startDevServer(options) {
|
|
|
569
654
|
server: null,
|
|
570
655
|
devProcess,
|
|
571
656
|
startedDevProcess,
|
|
657
|
+
roomsProcess: roomsProcess ?? null,
|
|
572
658
|
appUrl,
|
|
573
659
|
close: async () => {
|
|
574
660
|
if (closing)
|
|
@@ -579,7 +665,7 @@ async function startDevServer(options) {
|
|
|
579
665
|
await unregisterDevMount(mountId, port);
|
|
580
666
|
}
|
|
581
667
|
finally {
|
|
582
|
-
await terminateChildProcessTree(devProcess);
|
|
668
|
+
await Promise.all([terminateChildProcessTree(devProcess), terminateChildProcessTree(roomsProcess ?? null)]);
|
|
583
669
|
}
|
|
584
670
|
},
|
|
585
671
|
};
|
|
@@ -645,6 +731,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
645
731
|
capabilities: {
|
|
646
732
|
runtimeAssetManifest: true,
|
|
647
733
|
runtimeAssetManifestLookup: true,
|
|
734
|
+
roomsProxy: true,
|
|
648
735
|
},
|
|
649
736
|
});
|
|
650
737
|
return;
|
|
@@ -724,6 +811,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
724
811
|
const staticRoot = body.staticRoot?.trim();
|
|
725
812
|
const repoRoot = body.repoRoot?.trim();
|
|
726
813
|
const ownerPid = Number(body.ownerPid);
|
|
814
|
+
const roomsPort = body.roomsPort == null ? null : Number(body.roomsPort);
|
|
727
815
|
if (!creatorUsername ||
|
|
728
816
|
!appType ||
|
|
729
817
|
!appName ||
|
|
@@ -731,7 +819,8 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
731
819
|
!staticRoot ||
|
|
732
820
|
!repoRoot ||
|
|
733
821
|
!Number.isInteger(ownerPid) ||
|
|
734
|
-
ownerPid <= 0
|
|
822
|
+
ownerPid <= 0 ||
|
|
823
|
+
(roomsPort !== null && (!Number.isInteger(roomsPort) || roomsPort < 1 || roomsPort > 65535))) {
|
|
735
824
|
sendJson(res, 400, { error: "invalid_mount_request" });
|
|
736
825
|
return;
|
|
737
826
|
}
|
|
@@ -755,6 +844,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
755
844
|
existingMount.ownerPid = ownerPid;
|
|
756
845
|
existingMount.updatedAt = Date.now();
|
|
757
846
|
existingMount.runtimeAssetManifest = body.runtimeAssetManifest ?? null;
|
|
847
|
+
existingMount.roomsPort = roomsPort;
|
|
758
848
|
sendJson(res, 200, {
|
|
759
849
|
mountId: existingMount.id,
|
|
760
850
|
appUrl: buildLocalDevAppUrl({ creatorUsername, appType, appName, port: activePort }),
|
|
@@ -778,6 +868,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
778
868
|
ownerPid,
|
|
779
869
|
updatedAt: Date.now(),
|
|
780
870
|
runtimeAssetManifest: body.runtimeAssetManifest ?? null,
|
|
871
|
+
roomsPort,
|
|
781
872
|
};
|
|
782
873
|
routerMountsById.set(mount.id, mount);
|
|
783
874
|
routerMountIdsByKey.set(key, mount.id);
|
|
@@ -820,6 +911,11 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
820
911
|
return;
|
|
821
912
|
}
|
|
822
913
|
if (method !== "GET" && method !== "HEAD") {
|
|
914
|
+
const roomsTarget = resolveRoomsProxyTarget(req.url);
|
|
915
|
+
if (roomsTarget) {
|
|
916
|
+
proxyRoomsRequest(req, res, roomsTarget);
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
823
919
|
res.setHeader("Allow", "GET, HEAD, POST, DELETE, OPTIONS");
|
|
824
920
|
respondWithText(res, method, 405, "Method not allowed");
|
|
825
921
|
return;
|
|
@@ -836,6 +932,15 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
836
932
|
respondWithText(res, method, 404, "Not found");
|
|
837
933
|
return;
|
|
838
934
|
}
|
|
935
|
+
if (parsedMountPath.assetPath === "_playdrop/rooms" || parsedMountPath.assetPath.startsWith("_playdrop/rooms/")) {
|
|
936
|
+
const roomsTarget = resolveRoomsProxyTarget(req.url);
|
|
937
|
+
if (!roomsTarget) {
|
|
938
|
+
respondWithText(res, method, 503, "rooms_runtime_unavailable");
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
proxyRoomsRequest(req, res, roomsTarget);
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
839
944
|
if (parsedMountPath.assetPath === "_playdrop/runtime-assets") {
|
|
840
945
|
if (!mount.runtimeAssetManifest) {
|
|
841
946
|
sendJson(res, 500, { error: "runtime_asset_manifest_not_registered" });
|
|
@@ -901,6 +1006,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
|
|
|
901
1006
|
const server = node_http_1.default.createServer((req, res) => {
|
|
902
1007
|
void handleRequest(req, res);
|
|
903
1008
|
});
|
|
1009
|
+
server.on("upgrade", proxyRoomsUpgrade);
|
|
904
1010
|
server.on("listening", () => {
|
|
905
1011
|
const address = server.address();
|
|
906
1012
|
if (address && typeof address === "object" && typeof address.port === "number") {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { ImageAttachment } from "@playdrop/ai-client";
|
|
2
1
|
type AiGenerateOptions = {
|
|
2
|
+
system?: string;
|
|
3
|
+
textSize?: string;
|
|
4
|
+
responseSchema?: string;
|
|
3
5
|
subcategory?: string;
|
|
4
6
|
assetName?: string;
|
|
5
7
|
assetDisplayName?: string;
|
|
@@ -33,16 +35,43 @@ type AiListOptions = {
|
|
|
33
35
|
offset?: string | number;
|
|
34
36
|
format?: string;
|
|
35
37
|
};
|
|
38
|
+
type GenerationModality = "TEXT" | "JSON" | "IMAGE" | "MUSIC" | "SFX" | "SPEECH" | "VIDEO" | "MODEL_3D";
|
|
39
|
+
type ImageAttachment = {
|
|
40
|
+
url: string;
|
|
41
|
+
} | {
|
|
42
|
+
data: string;
|
|
43
|
+
mimeType: "image/png" | "image/jpeg" | "image/webp";
|
|
44
|
+
};
|
|
45
|
+
type GenerateRequest = Record<string, any> & {
|
|
46
|
+
modality: GenerationModality;
|
|
47
|
+
input: string;
|
|
48
|
+
};
|
|
49
|
+
type ParsedGenerateInput = {
|
|
50
|
+
modality: GenerationModality;
|
|
51
|
+
request: GenerateRequest;
|
|
52
|
+
timeoutSeconds: number;
|
|
53
|
+
pollIntervalMs: number;
|
|
54
|
+
};
|
|
36
55
|
export declare function resolveImageAttachment(value: string | undefined, optionName: "image1" | "image2"): ImageAttachment | undefined;
|
|
56
|
+
export declare function buildGenerateRequest(typeInput: string, promptInput: string, options: AiGenerateOptions): ParsedGenerateInput;
|
|
37
57
|
export declare function generate(typeInput: string, promptInput: string, options?: AiGenerateOptions): Promise<void>;
|
|
38
|
-
type
|
|
58
|
+
type AiTaskBrowseOptions = {
|
|
39
59
|
type?: string;
|
|
40
60
|
limit?: string | number;
|
|
41
61
|
offset?: string | number;
|
|
42
62
|
json?: boolean;
|
|
43
63
|
};
|
|
44
|
-
export declare function
|
|
45
|
-
export declare function
|
|
64
|
+
export declare function browseGenerationTasks(options?: AiTaskBrowseOptions): Promise<void>;
|
|
65
|
+
export declare function showGenerationTask(id: string | undefined, options?: {
|
|
66
|
+
json?: boolean;
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
export declare function showGenerationTaskEvents(id: string | undefined, options?: {
|
|
69
|
+
json?: boolean;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
export declare function cancelGenerationTask(id: string | undefined, options?: {
|
|
72
|
+
json?: boolean;
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
export declare function clearGenerationTask(id: string | undefined, options?: {
|
|
46
75
|
json?: boolean;
|
|
47
76
|
}): Promise<void>;
|
|
48
77
|
export declare function generations(options?: AiListOptions): Promise<void>;
|