@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
|
@@ -34,12 +34,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.resolveImageAttachment = resolveImageAttachment;
|
|
37
|
+
exports.buildGenerateRequest = buildGenerateRequest;
|
|
37
38
|
exports.generate = generate;
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
39
|
+
exports.browseGenerationTasks = browseGenerationTasks;
|
|
40
|
+
exports.showGenerationTask = showGenerationTask;
|
|
41
|
+
exports.showGenerationTaskEvents = showGenerationTaskEvents;
|
|
42
|
+
exports.cancelGenerationTask = cancelGenerationTask;
|
|
43
|
+
exports.clearGenerationTask = clearGenerationTask;
|
|
40
44
|
exports.generations = generations;
|
|
41
45
|
const config_1 = require("@playdrop/config");
|
|
42
46
|
const types_1 = require("@playdrop/types");
|
|
47
|
+
const node_crypto_1 = require("node:crypto");
|
|
43
48
|
const node_fs_1 = require("node:fs");
|
|
44
49
|
const node_path_1 = require("node:path");
|
|
45
50
|
const commandContext_1 = require("../commandContext");
|
|
@@ -62,6 +67,7 @@ const DEFAULT_IMAGE_SIZE = "1K";
|
|
|
62
67
|
const DEFAULT_VIDEO_ASPECT_RATIO = "16:9";
|
|
63
68
|
const DEFAULT_VIDEO_DURATION_SECONDS = 4;
|
|
64
69
|
const VIDEO_FIRST_LAST_FRAME_DURATION_SECONDS = 8;
|
|
70
|
+
const AI_TASK_INPUT_UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
|
|
65
71
|
const DEFAULT_MODEL3D_TOPOLOGY = "triangle";
|
|
66
72
|
const DEFAULT_MODEL3D_TARGET_POLYCOUNT = 30000;
|
|
67
73
|
const DEFAULT_MODEL3D_SHOULD_REMESH = true;
|
|
@@ -83,7 +89,7 @@ function handleGenerateBuildRequestError(message) {
|
|
|
83
89
|
const errorByCode = {
|
|
84
90
|
missing_type: {
|
|
85
91
|
title: "A generation type is required.",
|
|
86
|
-
details: ["Use one of: image, music, sfx, speech, video, model_3d."],
|
|
92
|
+
details: ["Use one of: text, json, image, music, sfx, speech, video, model_3d."],
|
|
87
93
|
},
|
|
88
94
|
missing_prompt: {
|
|
89
95
|
title: "A prompt is required.",
|
|
@@ -91,7 +97,19 @@ function handleGenerateBuildRequestError(message) {
|
|
|
91
97
|
},
|
|
92
98
|
invalid_type: {
|
|
93
99
|
title: "The generation type is invalid.",
|
|
94
|
-
details: ["Use one of: image, music, sfx, speech, video, model_3d."],
|
|
100
|
+
details: ["Use one of: text, json, image, music, sfx, speech, video, model_3d."],
|
|
101
|
+
},
|
|
102
|
+
missing_json_schema: {
|
|
103
|
+
title: "JSON generation requires a response schema.",
|
|
104
|
+
details: ['Pass an inline JSON object or file path with --schema, for example --schema \'{"type":"object"}\'.'],
|
|
105
|
+
},
|
|
106
|
+
invalid_json_schema: {
|
|
107
|
+
title: "The JSON response schema is invalid.",
|
|
108
|
+
details: ["Use a JSON object or a path to a JSON file."],
|
|
109
|
+
},
|
|
110
|
+
invalid_text_size: {
|
|
111
|
+
title: "The text generation size is invalid.",
|
|
112
|
+
details: ["Use small, medium, or large with --text-size."],
|
|
95
113
|
},
|
|
96
114
|
invalid_duration: {
|
|
97
115
|
title: "The --duration value is invalid.",
|
|
@@ -127,7 +145,7 @@ function handleGenerateBuildRequestError(message) {
|
|
|
127
145
|
},
|
|
128
146
|
speech_disallows_subcategory: {
|
|
129
147
|
title: "Speech does not accept --subcategory.",
|
|
130
|
-
details: ["Speech
|
|
148
|
+
details: ["Speech tasks always create AUDIO assets with subcategory speech."],
|
|
131
149
|
},
|
|
132
150
|
invalid_speech_voice_selection: {
|
|
133
151
|
title: "Speech voice options are invalid.",
|
|
@@ -210,6 +228,10 @@ function normalizeModality(value) {
|
|
|
210
228
|
.trim()
|
|
211
229
|
.toUpperCase()
|
|
212
230
|
.replace(/[-\s]+/g, "_");
|
|
231
|
+
if (normalized === "TEXT")
|
|
232
|
+
return "TEXT";
|
|
233
|
+
if (normalized === "JSON")
|
|
234
|
+
return "JSON";
|
|
213
235
|
if (normalized === "IMAGE")
|
|
214
236
|
return "IMAGE";
|
|
215
237
|
if (normalized === "MUSIC")
|
|
@@ -224,14 +246,29 @@ function normalizeModality(value) {
|
|
|
224
246
|
return "MODEL_3D";
|
|
225
247
|
return null;
|
|
226
248
|
}
|
|
249
|
+
function parseResponseSchema(value) {
|
|
250
|
+
const normalized = typeof value === "string" ? value.trim() : "";
|
|
251
|
+
if (!normalized)
|
|
252
|
+
throw new Error("missing_json_schema");
|
|
253
|
+
const source = (0, node_fs_1.existsSync)(normalized) ? (0, node_fs_1.readFileSync)(normalized, "utf8") : normalized;
|
|
254
|
+
let parsed;
|
|
255
|
+
try {
|
|
256
|
+
parsed = JSON.parse(source);
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
throw new Error("invalid_json_schema");
|
|
260
|
+
}
|
|
261
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
262
|
+
throw new Error("invalid_json_schema");
|
|
263
|
+
return parsed;
|
|
264
|
+
}
|
|
227
265
|
function normalizeVisibility(value) {
|
|
228
266
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
229
267
|
return undefined;
|
|
230
268
|
}
|
|
231
269
|
const normalized = value.trim().toUpperCase();
|
|
232
|
-
if (normalized === "PRIVATE"
|
|
270
|
+
if (normalized === "PRIVATE")
|
|
233
271
|
return normalized;
|
|
234
|
-
}
|
|
235
272
|
return undefined;
|
|
236
273
|
}
|
|
237
274
|
function parseAssetSubcategory(value) {
|
|
@@ -465,15 +502,33 @@ function buildGenerateRequest(typeInput, promptInput, options) {
|
|
|
465
502
|
if (modality === "SPEECH" && (0, types_1.countSpeechWords)(prompt) > types_1.PLAYDROP_SPEECH_MAX_WORDS) {
|
|
466
503
|
throw new Error("speech_input_too_long");
|
|
467
504
|
}
|
|
468
|
-
const visibility = normalizeVisibility(options.visibility);
|
|
469
|
-
if (options.visibility && !visibility) {
|
|
470
|
-
throw new Error("invalid_visibility");
|
|
471
|
-
}
|
|
472
505
|
const timeoutSeconds = parseOptionalPositiveInt(options.timeoutSeconds, "timeout_seconds") ?? GENERATE_DEFAULT_TIMEOUT_SECONDS;
|
|
473
506
|
const pollIntervalMs = parseOptionalPositiveInt(options.pollIntervalMs, "poll_interval_ms") ?? GENERATE_DEFAULT_POLL_INTERVAL_MS;
|
|
474
507
|
if (pollIntervalMs < 250) {
|
|
475
508
|
throw new Error("invalid_poll_interval_ms");
|
|
476
509
|
}
|
|
510
|
+
if (modality === "TEXT" || modality === "JSON") {
|
|
511
|
+
const textSize = typeof options.textSize === "string" ? options.textSize.trim().toLowerCase() : "small";
|
|
512
|
+
if (textSize !== "small" && textSize !== "medium" && textSize !== "large") {
|
|
513
|
+
throw new Error("invalid_text_size");
|
|
514
|
+
}
|
|
515
|
+
return {
|
|
516
|
+
modality,
|
|
517
|
+
request: {
|
|
518
|
+
modality,
|
|
519
|
+
input: prompt,
|
|
520
|
+
size: textSize,
|
|
521
|
+
...(typeof options.system === "string" && options.system.trim() ? { system: options.system.trim() } : {}),
|
|
522
|
+
...(modality === "JSON" ? { responseSchema: parseResponseSchema(options.responseSchema) } : {}),
|
|
523
|
+
},
|
|
524
|
+
timeoutSeconds,
|
|
525
|
+
pollIntervalMs,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
const visibility = normalizeVisibility(options.visibility);
|
|
529
|
+
if (options.visibility && !visibility) {
|
|
530
|
+
throw new Error("invalid_visibility");
|
|
531
|
+
}
|
|
477
532
|
const duration = parseOptionalDuration(options.duration);
|
|
478
533
|
const request = {
|
|
479
534
|
modality,
|
|
@@ -487,7 +542,7 @@ function buildGenerateRequest(typeInput, promptInput, options) {
|
|
|
487
542
|
assetDescription: typeof options.assetDescription === "string" && options.assetDescription.trim().length > 0
|
|
488
543
|
? options.assetDescription.trim()
|
|
489
544
|
: undefined,
|
|
490
|
-
assetVisibility:
|
|
545
|
+
assetVisibility: "PRIVATE",
|
|
491
546
|
attachAppVersionId: parseOptionalPositiveInt(options.attachAppVersionId, "attach_app_version_id"),
|
|
492
547
|
};
|
|
493
548
|
if (modality !== "SPEECH") {
|
|
@@ -582,15 +637,28 @@ function buildGenerateRequest(typeInput, promptInput, options) {
|
|
|
582
637
|
}
|
|
583
638
|
if (modality === "MODEL_3D") {
|
|
584
639
|
const sourceModeInput = typeof options.sourceMode === "string" ? options.sourceMode.trim().toUpperCase() : "";
|
|
585
|
-
if (sourceModeInput.length > 0 &&
|
|
640
|
+
if (sourceModeInput.length > 0 &&
|
|
641
|
+
sourceModeInput !== "TEXT" &&
|
|
642
|
+
sourceModeInput !== "IMAGE" &&
|
|
643
|
+
sourceModeInput !== "MULTI_IMAGE") {
|
|
586
644
|
throw new Error("invalid_source_mode");
|
|
587
645
|
}
|
|
588
646
|
request.image1 = resolveImageAttachment(options.image1, "image1");
|
|
589
647
|
request.image2 = resolveImageAttachment(options.image2, "image2");
|
|
590
648
|
const hasInputImages = Boolean(request.image1 || request.image2);
|
|
649
|
+
const hasMultipleInputImages = Boolean(request.image1 && request.image2);
|
|
591
650
|
request.sourceMode =
|
|
592
|
-
sourceModeInput.length > 0
|
|
593
|
-
|
|
651
|
+
sourceModeInput.length > 0
|
|
652
|
+
? sourceModeInput
|
|
653
|
+
: hasMultipleInputImages
|
|
654
|
+
? "MULTI_IMAGE"
|
|
655
|
+
: hasInputImages
|
|
656
|
+
? "IMAGE"
|
|
657
|
+
: "TEXT";
|
|
658
|
+
if (request.sourceMode === "IMAGE" && (!hasInputImages || hasMultipleInputImages)) {
|
|
659
|
+
throw new Error("missing_model3d_images");
|
|
660
|
+
}
|
|
661
|
+
if (request.sourceMode === "MULTI_IMAGE" && !hasMultipleInputImages) {
|
|
594
662
|
throw new Error("missing_model3d_images");
|
|
595
663
|
}
|
|
596
664
|
if (request.sourceMode === "TEXT" && hasInputImages) {
|
|
@@ -609,33 +677,35 @@ function buildGenerateRequest(typeInput, promptInput, options) {
|
|
|
609
677
|
return { modality, request, timeoutSeconds, pollIntervalMs };
|
|
610
678
|
}
|
|
611
679
|
function generationPrompt(record) {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return "";
|
|
680
|
+
const input = record.inputData && typeof record.inputData === "object" && !Array.isArray(record.inputData)
|
|
681
|
+
? record.inputData
|
|
682
|
+
: null;
|
|
683
|
+
return typeof input?.input === "string" ? input.input : "";
|
|
616
684
|
}
|
|
617
685
|
function generationAssetRef(record) {
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
candidate.ref.trim().length > 0) {
|
|
623
|
-
return candidate.ref.trim();
|
|
624
|
-
}
|
|
625
|
-
return null;
|
|
686
|
+
const output = record.outputData && typeof record.outputData === "object" && !Array.isArray(record.outputData)
|
|
687
|
+
? record.outputData
|
|
688
|
+
: null;
|
|
689
|
+
return typeof output?.assetRef === "string" && output.assetRef.trim() ? output.assetRef.trim() : null;
|
|
626
690
|
}
|
|
627
691
|
function generationAssetSubcategory(record) {
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
return null;
|
|
692
|
+
const input = record.inputData && typeof record.inputData === "object" && !Array.isArray(record.inputData)
|
|
693
|
+
? record.inputData
|
|
694
|
+
: null;
|
|
695
|
+
return typeof input?.assetSubcategory === "string" && input.assetSubcategory.trim()
|
|
696
|
+
? input.assetSubcategory.trim()
|
|
697
|
+
: null;
|
|
636
698
|
}
|
|
637
699
|
function printGenerateResult(modality, payload) {
|
|
638
700
|
console.log(`Modality: ${modality}`);
|
|
701
|
+
if (modality === "TEXT") {
|
|
702
|
+
console.log(typeof payload?.text === "string" ? payload.text : "");
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (modality === "JSON") {
|
|
706
|
+
console.log(JSON.stringify(payload?.json ?? null, null, 2));
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
639
709
|
if (payload?.billing?.generationId) {
|
|
640
710
|
console.log(`Generation ID: ${payload.billing.generationId}`);
|
|
641
711
|
}
|
|
@@ -645,13 +715,9 @@ function printGenerateResult(modality, payload) {
|
|
|
645
715
|
if (typeof payload?.createdAt === "string") {
|
|
646
716
|
console.log(`Created At: ${payload.createdAt}`);
|
|
647
717
|
}
|
|
648
|
-
const ref = typeof payload?.
|
|
649
|
-
const subcategory = typeof payload?.generatedAsset?.subcategory === "string" ? payload.generatedAsset.subcategory : null;
|
|
718
|
+
const ref = typeof payload?.assetRef === "string" ? payload.assetRef : null;
|
|
650
719
|
if (ref) {
|
|
651
720
|
console.log(`Generated Asset: ${ref}`);
|
|
652
|
-
if (subcategory) {
|
|
653
|
-
console.log(`Generated Subcategory: ${subcategory}`);
|
|
654
|
-
}
|
|
655
721
|
console.log(`Next: run "playdrop detail ${ref}" to inspect the generated asset.`);
|
|
656
722
|
}
|
|
657
723
|
else {
|
|
@@ -861,12 +927,67 @@ async function optimizeGeneratedPngOutputBuffer(buffer, loadedSharp) {
|
|
|
861
927
|
}
|
|
862
928
|
throw new Error(`ai_generation_image_output_too_large:${smallest?.length ?? buffer.length}:${GENERATED_PNG_OUTPUT_MAX_BYTES}`);
|
|
863
929
|
}
|
|
864
|
-
function
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
930
|
+
function formatTaskStatus(task) {
|
|
931
|
+
return `${task.status}${task.queuePosition ? ` queue=${task.queuePosition}` : ""}`;
|
|
932
|
+
}
|
|
933
|
+
async function uploadImageAttachment(client, attachment) {
|
|
934
|
+
let buffer;
|
|
935
|
+
let mimeType;
|
|
936
|
+
if ("url" in attachment) {
|
|
937
|
+
const response = await fetch(attachment.url);
|
|
938
|
+
if (!response.ok)
|
|
939
|
+
throw new Error(`image_ref_download_failed:${response.status}`);
|
|
940
|
+
if (new URL(response.url).protocol !== "https:")
|
|
941
|
+
throw new Error("image_ref_download_insecure_redirect");
|
|
942
|
+
const contentLength = Number(response.headers.get("content-length"));
|
|
943
|
+
if (Number.isFinite(contentLength) && contentLength > AI_TASK_INPUT_UPLOAD_MAX_BYTES) {
|
|
944
|
+
throw new Error(`image_ref_too_large:${contentLength}:${AI_TASK_INPUT_UPLOAD_MAX_BYTES}`);
|
|
945
|
+
}
|
|
946
|
+
buffer = Buffer.from(await response.arrayBuffer());
|
|
947
|
+
if (buffer.length === 0 || buffer.length > AI_TASK_INPUT_UPLOAD_MAX_BYTES) {
|
|
948
|
+
throw new Error(`image_ref_too_large:${buffer.length}:${AI_TASK_INPUT_UPLOAD_MAX_BYTES}`);
|
|
949
|
+
}
|
|
950
|
+
const detected = detectLocalImageMimeType(buffer);
|
|
951
|
+
const declared = response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
|
|
952
|
+
if (!detected || declared !== detected)
|
|
953
|
+
throw new Error("image_ref_download_type_invalid");
|
|
954
|
+
mimeType = detected;
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
buffer = Buffer.from(attachment.data, "base64");
|
|
958
|
+
mimeType = attachment.mimeType;
|
|
959
|
+
}
|
|
960
|
+
const extension = mimeType === "image/png" ? "png" : mimeType === "image/webp" ? "webp" : "jpg";
|
|
961
|
+
const prepared = await client.prepareAiTaskInputUpload({
|
|
962
|
+
fileName: `reference.${extension}`,
|
|
963
|
+
contentType: mimeType,
|
|
964
|
+
sizeBytes: buffer.length,
|
|
965
|
+
sha256: (0, node_crypto_1.createHash)("sha256").update(buffer).digest("hex"),
|
|
966
|
+
md5Base64: (0, node_crypto_1.createHash)("md5").update(buffer).digest("base64"),
|
|
967
|
+
});
|
|
968
|
+
const response = await fetch(prepared.uploadUrl, {
|
|
969
|
+
method: "PUT",
|
|
970
|
+
headers: prepared.uploadHeaders,
|
|
971
|
+
body: new Uint8Array(buffer),
|
|
972
|
+
});
|
|
973
|
+
if (!response.ok)
|
|
974
|
+
throw new Error(`ai_task_input_upload_failed:${response.status}`);
|
|
975
|
+
await client.finalizeAiTaskInputUpload(prepared.uploadId);
|
|
976
|
+
return { type: "TASK_UPLOAD", uploadId: prepared.uploadId };
|
|
977
|
+
}
|
|
978
|
+
async function prepareTaskRequest(client, request) {
|
|
979
|
+
const { modality, image1, image2, ...fields } = request;
|
|
980
|
+
if (modality === "TEXT" || modality === "JSON") {
|
|
981
|
+
return { ...fields, kind: modality };
|
|
982
|
+
}
|
|
983
|
+
return {
|
|
984
|
+
...fields,
|
|
985
|
+
kind: modality,
|
|
986
|
+
assetVisibility: "PRIVATE",
|
|
987
|
+
...(image1 ? { image1: await uploadImageAttachment(client, image1) } : {}),
|
|
988
|
+
...(image2 ? { image2: await uploadImageAttachment(client, image2) } : {}),
|
|
989
|
+
...(modality === "MODEL_3D" ? { outputFormat: "GLB" } : {}),
|
|
990
|
+
};
|
|
870
991
|
}
|
|
871
992
|
async function generate(typeInput, promptInput, options = {}) {
|
|
872
993
|
let parsed;
|
|
@@ -895,41 +1016,43 @@ async function generate(typeInput, promptInput, options = {}) {
|
|
|
895
1016
|
process.exitCode = 1;
|
|
896
1017
|
return;
|
|
897
1018
|
}
|
|
898
|
-
await (0, commandContext_1.withEnvironment)("ai create", "Generating AI assets", async ({
|
|
1019
|
+
await (0, commandContext_1.withEnvironment)("ai create", "Generating AI assets", async ({ client }) => {
|
|
899
1020
|
try {
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
throw new Error("ai_generation_job_missing_id");
|
|
905
|
-
}
|
|
1021
|
+
const request = await prepareTaskRequest(client, parsed.request);
|
|
1022
|
+
const created = await client.createAiGenerationTask(request);
|
|
1023
|
+
let task = created.task;
|
|
1024
|
+
const taskId = task.id;
|
|
906
1025
|
if (!options.json) {
|
|
907
|
-
console.log(`
|
|
908
|
-
console.log(`Status: ${
|
|
1026
|
+
console.log(`Task ID: ${taskId}`);
|
|
1027
|
+
console.log(`Status: ${formatTaskStatus(task)}`);
|
|
909
1028
|
}
|
|
910
1029
|
const deadlineMs = Date.now() + parsed.timeoutSeconds * 1000;
|
|
911
|
-
while (
|
|
1030
|
+
while (task.status === "QUEUED" || task.status === "RUNNING") {
|
|
912
1031
|
if (Date.now() >= deadlineMs) {
|
|
913
|
-
throw new Error(`
|
|
1032
|
+
throw new Error(`ai_generation_task_timeout: Timed out waiting for task ${taskId}`);
|
|
914
1033
|
}
|
|
915
1034
|
await sleep(parsed.pollIntervalMs);
|
|
916
|
-
const latest = await
|
|
917
|
-
|
|
1035
|
+
const latest = await client.getAiGenerationTask(taskId);
|
|
1036
|
+
task = latest.task;
|
|
918
1037
|
if (!options.json) {
|
|
919
|
-
console.log(`Status: ${
|
|
1038
|
+
console.log(`Status: ${formatTaskStatus(task)}`);
|
|
920
1039
|
}
|
|
921
1040
|
}
|
|
922
|
-
if (
|
|
923
|
-
|
|
924
|
-
const errorMessage = typeof job.errorMessage === "string" && job.errorMessage.length > 0 ? job.errorMessage : "Generation failed.";
|
|
925
|
-
throw new Error(`${errorCode}: ${errorMessage}`);
|
|
1041
|
+
if (task.status !== "DONE") {
|
|
1042
|
+
throw new Error(`${task.error ?? "ai_generation_failed"}: Generation failed.`);
|
|
926
1043
|
}
|
|
927
|
-
const payload =
|
|
1044
|
+
const payload = task.result && typeof task.result === "object" ? task.result : {};
|
|
928
1045
|
if (outputPath) {
|
|
929
|
-
|
|
1046
|
+
const generationId = "generationId" in payload && typeof payload.generationId === "string"
|
|
1047
|
+
? payload.generationId
|
|
1048
|
+
: "";
|
|
1049
|
+
const history = await client.listAiGenerations({ type: "IMAGE", limit: 100, offset: 0 });
|
|
1050
|
+
const generation = history.generations.find((entry) => entry.id === generationId);
|
|
1051
|
+
const imageUrl = generation?.outputAssets[0];
|
|
1052
|
+
await writeGeneratedImageOutput({ ...payload, imageUrl }, outputPath, parsed.request.input);
|
|
930
1053
|
}
|
|
931
1054
|
if (options.json) {
|
|
932
|
-
(0, output_1.printJson)({
|
|
1055
|
+
(0, output_1.printJson)({ task, result: payload });
|
|
933
1056
|
return;
|
|
934
1057
|
}
|
|
935
1058
|
printGenerateResult(parsed.modality, payload);
|
|
@@ -941,7 +1064,7 @@ async function generate(typeInput, promptInput, options = {}) {
|
|
|
941
1064
|
}
|
|
942
1065
|
});
|
|
943
1066
|
}
|
|
944
|
-
function
|
|
1067
|
+
function parseTaskModality(raw) {
|
|
945
1068
|
if (!raw || raw.trim().length === 0 || raw.trim().toLowerCase() === "all") {
|
|
946
1069
|
return undefined;
|
|
947
1070
|
}
|
|
@@ -980,11 +1103,6 @@ function handleAiFailure(error, command, context) {
|
|
|
980
1103
|
return true;
|
|
981
1104
|
}
|
|
982
1105
|
const message = error instanceof Error ? error.message : String(error);
|
|
983
|
-
if (message === "ai_generation_job_missing_id") {
|
|
984
|
-
(0, messages_1.printErrorWithHelp)("AI create failed because the server did not return a job id.", ["Retry the command. If the problem persists, contact Playdrop support."], { command });
|
|
985
|
-
process.exitCode = 1;
|
|
986
|
-
return true;
|
|
987
|
-
}
|
|
988
1106
|
if (message === "ai_generation_image_output_unsupported_type") {
|
|
989
1107
|
(0, messages_1.printErrorWithHelp)("AI create returned an image format that Playdrop CLI could not identify.", ["Retry the command. If the problem persists, contact Playdrop support."], { command });
|
|
990
1108
|
process.exitCode = 1;
|
|
@@ -1005,9 +1123,9 @@ function handleAiFailure(error, command, context) {
|
|
|
1005
1123
|
process.exitCode = 1;
|
|
1006
1124
|
return true;
|
|
1007
1125
|
}
|
|
1008
|
-
if (message.startsWith("
|
|
1126
|
+
if (message.startsWith("ai_generation_task_timeout:")) {
|
|
1009
1127
|
const detail = message.split(":").slice(1).join(":").trim();
|
|
1010
|
-
(0, messages_1.printErrorWithHelp)(detail || "AI create timed out while waiting for the
|
|
1128
|
+
(0, messages_1.printErrorWithHelp)(detail || "AI create timed out while waiting for the task to finish.", ["Retry the command with a higher --timeout value if the task normally takes longer."], { command });
|
|
1011
1129
|
process.exitCode = 1;
|
|
1012
1130
|
return true;
|
|
1013
1131
|
}
|
|
@@ -1022,11 +1140,11 @@ function handleAiFailure(error, command, context) {
|
|
|
1022
1140
|
}
|
|
1023
1141
|
return false;
|
|
1024
1142
|
}
|
|
1025
|
-
async function
|
|
1026
|
-
const modality =
|
|
1143
|
+
async function browseGenerationTasks(options = {}) {
|
|
1144
|
+
const modality = parseTaskModality(options.type);
|
|
1027
1145
|
if (options.type !== undefined && modality === null) {
|
|
1028
1146
|
(0, messages_1.printErrorWithHelp)("The --type value is invalid.", ["Use one of: image, music, sfx, video, model_3d, all."], {
|
|
1029
|
-
command: "ai
|
|
1147
|
+
command: "ai tasks browse",
|
|
1030
1148
|
});
|
|
1031
1149
|
process.exitCode = 1;
|
|
1032
1150
|
return;
|
|
@@ -1039,78 +1157,149 @@ async function browseGenerationJobs(options = {}) {
|
|
|
1039
1157
|
}
|
|
1040
1158
|
catch (error) {
|
|
1041
1159
|
const message = typeof error?.message === "string" ? error.message : "invalid_pagination";
|
|
1042
|
-
(0, messages_1.printErrorWithHelp)(`Invalid ai
|
|
1043
|
-
command: "ai
|
|
1160
|
+
(0, messages_1.printErrorWithHelp)(`Invalid ai tasks input: ${message}.`, ["Use positive integers for --limit and --offset."], {
|
|
1161
|
+
command: "ai tasks browse",
|
|
1044
1162
|
});
|
|
1045
1163
|
process.exitCode = 1;
|
|
1046
1164
|
return;
|
|
1047
1165
|
}
|
|
1048
|
-
await (0, commandContext_1.withEnvironment)("ai
|
|
1166
|
+
await (0, commandContext_1.withEnvironment)("ai tasks browse", "Browsing AI tasks", async ({ client }) => {
|
|
1049
1167
|
try {
|
|
1050
|
-
const response = await
|
|
1051
|
-
|
|
1168
|
+
const response = await client.listAiGenerationTasks({
|
|
1169
|
+
kind: modality ?? undefined,
|
|
1052
1170
|
limit,
|
|
1053
1171
|
offset,
|
|
1054
1172
|
});
|
|
1055
1173
|
if (options.json) {
|
|
1056
|
-
(0, output_1.printJson)({ items: response.
|
|
1174
|
+
(0, output_1.printJson)({ items: response.tasks, count: response.count });
|
|
1057
1175
|
return;
|
|
1058
1176
|
}
|
|
1059
|
-
if (!Array.isArray(response.
|
|
1060
|
-
console.log("No AI
|
|
1061
|
-
console.log('Next: run "playdrop ai create <type> <prompt>" to start a new
|
|
1177
|
+
if (!Array.isArray(response.tasks) || response.tasks.length === 0) {
|
|
1178
|
+
console.log("No AI tasks found.");
|
|
1179
|
+
console.log('Next: run "playdrop ai create <type> <prompt>" to start a new task.');
|
|
1062
1180
|
return;
|
|
1063
1181
|
}
|
|
1064
|
-
console.log("AI
|
|
1065
|
-
for (const
|
|
1066
|
-
console.log(`${
|
|
1182
|
+
console.log("AI tasks:\n");
|
|
1183
|
+
for (const task of response.tasks) {
|
|
1184
|
+
console.log(`${task.id} | ${task.kind.toLowerCase()} | ${formatTaskStatus(task)} | ${task.createdAt}`);
|
|
1067
1185
|
}
|
|
1068
|
-
console.log('\nNext: run "playdrop ai
|
|
1186
|
+
console.log('\nNext: run "playdrop ai tasks detail <id>" to inspect one task.');
|
|
1069
1187
|
}
|
|
1070
1188
|
catch (error) {
|
|
1071
|
-
if (!handleAiFailure(error, "ai
|
|
1189
|
+
if (!handleAiFailure(error, "ai tasks browse", "AI task lookup")) {
|
|
1072
1190
|
throw error;
|
|
1073
1191
|
}
|
|
1074
1192
|
}
|
|
1075
1193
|
});
|
|
1076
1194
|
}
|
|
1077
|
-
async function
|
|
1078
|
-
const
|
|
1079
|
-
if (!
|
|
1080
|
-
(0, messages_1.printErrorWithHelp)("A
|
|
1081
|
-
command: "ai
|
|
1195
|
+
async function showGenerationTask(id, options = {}) {
|
|
1196
|
+
const taskId = Number(id);
|
|
1197
|
+
if (!Number.isInteger(taskId) || taskId <= 0) {
|
|
1198
|
+
(0, messages_1.printErrorWithHelp)("A task id is required.", ["Example: playdrop ai tasks detail 123"], {
|
|
1199
|
+
command: "ai tasks detail",
|
|
1082
1200
|
});
|
|
1083
1201
|
process.exitCode = 1;
|
|
1084
1202
|
return;
|
|
1085
1203
|
}
|
|
1086
|
-
await (0, commandContext_1.withEnvironment)("ai
|
|
1204
|
+
await (0, commandContext_1.withEnvironment)("ai tasks detail", "Inspecting an AI task", async ({ client }) => {
|
|
1087
1205
|
try {
|
|
1088
|
-
const response = await
|
|
1206
|
+
const response = await client.getAiGenerationTask(taskId);
|
|
1089
1207
|
if (options.json) {
|
|
1090
|
-
(0, output_1.printJson)({
|
|
1208
|
+
(0, output_1.printJson)({ task: response.task });
|
|
1091
1209
|
return;
|
|
1092
1210
|
}
|
|
1093
|
-
const
|
|
1094
|
-
console.log(`
|
|
1095
|
-
console.log(`Type: ${
|
|
1096
|
-
console.log(`Status: ${
|
|
1097
|
-
console.log(`Created: ${
|
|
1098
|
-
console.log(`Updated: ${
|
|
1099
|
-
if (
|
|
1100
|
-
console.log(`Error: ${
|
|
1211
|
+
const task = response.task;
|
|
1212
|
+
console.log(`Task: ${task.id}`);
|
|
1213
|
+
console.log(`Type: ${task.kind.toLowerCase()}`);
|
|
1214
|
+
console.log(`Status: ${formatTaskStatus(task)}`);
|
|
1215
|
+
console.log(`Created: ${task.createdAt}`);
|
|
1216
|
+
console.log(`Updated: ${task.updatedAt}`);
|
|
1217
|
+
if (task.error) {
|
|
1218
|
+
console.log(`Error: ${task.error}`);
|
|
1101
1219
|
}
|
|
1102
|
-
if (
|
|
1103
|
-
console.log(`Linked generation: ${
|
|
1220
|
+
if (typeof task.result?.generationId === "string") {
|
|
1221
|
+
console.log(`Linked generation: ${task.result.generationId}`);
|
|
1104
1222
|
}
|
|
1105
|
-
console.log('\nNext: run "playdrop ai
|
|
1223
|
+
console.log('\nNext: run "playdrop ai tasks browse" to review other tasks.');
|
|
1106
1224
|
}
|
|
1107
1225
|
catch (error) {
|
|
1108
|
-
if (!handleAiFailure(error, "ai
|
|
1226
|
+
if (!handleAiFailure(error, "ai tasks detail", "AI task detail lookup")) {
|
|
1109
1227
|
throw error;
|
|
1110
1228
|
}
|
|
1111
1229
|
}
|
|
1112
1230
|
});
|
|
1113
1231
|
}
|
|
1232
|
+
function parseGenerationTaskId(id, command) {
|
|
1233
|
+
const taskId = Number(id);
|
|
1234
|
+
if (Number.isInteger(taskId) && taskId > 0)
|
|
1235
|
+
return taskId;
|
|
1236
|
+
(0, messages_1.printErrorWithHelp)("A task id is required.", [`Example: playdrop ai tasks ${command} 123`], {
|
|
1237
|
+
command: `ai tasks ${command}`,
|
|
1238
|
+
});
|
|
1239
|
+
process.exitCode = 1;
|
|
1240
|
+
return null;
|
|
1241
|
+
}
|
|
1242
|
+
async function showGenerationTaskEvents(id, options = {}) {
|
|
1243
|
+
const taskId = parseGenerationTaskId(id, "events");
|
|
1244
|
+
if (!taskId)
|
|
1245
|
+
return;
|
|
1246
|
+
await (0, commandContext_1.withEnvironment)("ai tasks events", "Inspecting AI task events", async ({ client }) => {
|
|
1247
|
+
try {
|
|
1248
|
+
const response = await client.listAiGenerationTaskEvents(taskId);
|
|
1249
|
+
if (options.json) {
|
|
1250
|
+
(0, output_1.printJson)(response);
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
if (response.events.length === 0) {
|
|
1254
|
+
console.log(`Task ${taskId} has no events.`);
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
for (const event of response.events) {
|
|
1258
|
+
console.log(`${event.createdAt} | ${event.kind} | ${event.message}`);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
catch (error) {
|
|
1262
|
+
if (!handleAiFailure(error, "ai tasks events", "AI task events lookup"))
|
|
1263
|
+
throw error;
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
async function cancelGenerationTask(id, options = {}) {
|
|
1268
|
+
const taskId = parseGenerationTaskId(id, "cancel");
|
|
1269
|
+
if (!taskId)
|
|
1270
|
+
return;
|
|
1271
|
+
await (0, commandContext_1.withEnvironment)("ai tasks cancel", "Cancelling an AI task", async ({ client }) => {
|
|
1272
|
+
try {
|
|
1273
|
+
const response = await client.cancelAiGenerationTask(taskId);
|
|
1274
|
+
if (options.json)
|
|
1275
|
+
(0, output_1.printJson)({ task: response.task });
|
|
1276
|
+
else
|
|
1277
|
+
console.log(`Task ${taskId}: ${formatTaskStatus(response.task)}`);
|
|
1278
|
+
}
|
|
1279
|
+
catch (error) {
|
|
1280
|
+
if (!handleAiFailure(error, "ai tasks cancel", "AI task cancellation"))
|
|
1281
|
+
throw error;
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
async function clearGenerationTask(id, options = {}) {
|
|
1286
|
+
const taskId = parseGenerationTaskId(id, "clear");
|
|
1287
|
+
if (!taskId)
|
|
1288
|
+
return;
|
|
1289
|
+
await (0, commandContext_1.withEnvironment)("ai tasks clear", "Clearing an AI task", async ({ client }) => {
|
|
1290
|
+
try {
|
|
1291
|
+
await client.clearAiGenerationTask(taskId);
|
|
1292
|
+
if (options.json)
|
|
1293
|
+
(0, output_1.printJson)({ taskId, cleared: true });
|
|
1294
|
+
else
|
|
1295
|
+
console.log(`Task ${taskId} cleared.`);
|
|
1296
|
+
}
|
|
1297
|
+
catch (error) {
|
|
1298
|
+
if (!handleAiFailure(error, "ai tasks clear", "AI task clearing"))
|
|
1299
|
+
throw error;
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1114
1303
|
async function generations(options = {}) {
|
|
1115
1304
|
const format = parseListFormat(options.format);
|
|
1116
1305
|
if (!format) {
|
|
@@ -1140,8 +1329,8 @@ async function generations(options = {}) {
|
|
|
1140
1329
|
process.exitCode = 1;
|
|
1141
1330
|
return;
|
|
1142
1331
|
}
|
|
1143
|
-
await (0, commandContext_1.withEnvironment)("generations", "Listing AI generations", async ({
|
|
1144
|
-
const response = await
|
|
1332
|
+
await (0, commandContext_1.withEnvironment)("generations", "Listing AI generations", async ({ client }) => {
|
|
1333
|
+
const response = await client.listAiGenerations({ type: type ?? undefined, limit, offset });
|
|
1145
1334
|
if (format === "json") {
|
|
1146
1335
|
console.log(JSON.stringify(response, null, 2));
|
|
1147
1336
|
return;
|
|
@@ -1154,7 +1343,7 @@ async function generations(options = {}) {
|
|
|
1154
1343
|
const prompt = generationPrompt(generation);
|
|
1155
1344
|
const ref = generationAssetRef(generation);
|
|
1156
1345
|
const subcategory = generationAssetSubcategory(generation);
|
|
1157
|
-
const parts = [generation.id, generation.type, generation.createdAt, `cost=${generation.
|
|
1346
|
+
const parts = [generation.id, generation.type, generation.createdAt, `cost=${generation.amount}`];
|
|
1158
1347
|
if (prompt.length > 0) {
|
|
1159
1348
|
parts.push(`prompt=${prompt}`);
|
|
1160
1349
|
}
|