@playdrop/playdrop-cli 0.16.12 → 0.17.0

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.
Files changed (364) hide show
  1. package/config/client-meta.json +4 -4
  2. package/dist/apiClient.d.ts +1 -2
  3. package/dist/apiClient.js +1 -16
  4. package/dist/appUrls.js +4 -0
  5. package/dist/apps/build.d.ts +12 -4
  6. package/dist/apps/build.js +55 -22
  7. package/dist/apps/index.d.ts +2 -1
  8. package/dist/apps/index.js +4 -1
  9. package/dist/apps/loadCheck.d.ts +5 -1
  10. package/dist/apps/loadCheck.js +52 -18
  11. package/dist/apps/serverBuild.d.ts +17 -0
  12. package/dist/apps/serverBuild.js +155 -0
  13. package/dist/apps/staticHtml.d.ts +1 -0
  14. package/dist/apps/staticHtml.js +19 -10
  15. package/dist/apps/upload.d.ts +12 -2
  16. package/dist/apps/upload.js +127 -46
  17. package/dist/catalogue.d.ts +23 -1
  18. package/dist/catalogue.js +126 -100
  19. package/dist/commandContext.d.ts +6 -3
  20. package/dist/commandContext.js +108 -18
  21. package/dist/commands/build.js +0 -7
  22. package/dist/commands/captureListing.d.ts +3 -0
  23. package/dist/commands/captureListing.js +48 -4
  24. package/dist/commands/chat.d.ts +4 -7
  25. package/dist/commands/chat.js +165 -77
  26. package/dist/commands/check.js +34 -1
  27. package/dist/commands/create.js +30 -263
  28. package/dist/commands/dev.js +37 -3
  29. package/dist/commands/devBrowser.js +2 -2
  30. package/dist/commands/devGameServer.d.ts +16 -0
  31. package/dist/commands/devGameServer.js +237 -0
  32. package/dist/commands/devRuntimeAssets.d.ts +1 -0
  33. package/dist/commands/devRuntimeAssets.js +2 -0
  34. package/dist/commands/devServer.d.ts +3 -0
  35. package/dist/commands/devServer.js +111 -5
  36. package/dist/commands/generation.d.ts +33 -4
  37. package/dist/commands/generation.js +304 -115
  38. package/dist/commands/login.js +23 -7
  39. package/dist/commands/review.d.ts +1 -1
  40. package/dist/commands/review.js +68 -95
  41. package/dist/commands/source.d.ts +19 -0
  42. package/dist/commands/source.js +142 -0
  43. package/dist/commands/tweaks.js +5 -11
  44. package/dist/commands/upload-content.d.ts +1 -1
  45. package/dist/commands/upload-content.js +16 -12
  46. package/dist/commands/upload.d.ts +17 -1
  47. package/dist/commands/upload.js +47 -10
  48. package/dist/commands/worker/archive-staging.d.ts +1 -0
  49. package/dist/commands/worker/archive-staging.js +13 -2
  50. package/dist/commands/worker/e2e-fixtures.d.ts +32 -0
  51. package/dist/commands/worker/e2e-fixtures.js +466 -0
  52. package/dist/commands/worker/game-server-infra.d.ts +80 -0
  53. package/dist/commands/worker/game-server-infra.js +595 -0
  54. package/dist/commands/worker/game-source-git.d.ts +126 -0
  55. package/dist/commands/worker/game-source-git.js +780 -0
  56. package/dist/commands/worker/generation.d.ts +94 -0
  57. package/dist/commands/worker/generation.js +1458 -0
  58. package/dist/commands/worker/provider-telemetry.js +1 -1
  59. package/dist/commands/worker/runtime.d.ts +8 -10
  60. package/dist/commands/worker/runtime.js +53 -48
  61. package/dist/commands/worker.d.ts +79 -19
  62. package/dist/commands/worker.js +1796 -419
  63. package/dist/config.d.ts +2 -0
  64. package/dist/config.js +16 -3
  65. package/dist/environment.d.ts +0 -1
  66. package/dist/environment.js +0 -8
  67. package/dist/index.js +92 -22
  68. package/dist/workerAppProject.d.ts +1 -1
  69. package/dist/workerAppProject.js +15 -2
  70. package/node_modules/@playdrop/api-client/dist/client.d.ts +143 -39
  71. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  72. package/node_modules/@playdrop/api-client/dist/client.js +33 -0
  73. package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
  74. package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
  75. package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
  76. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
  77. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
  78. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +338 -41
  79. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
  80. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
  81. package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
  82. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
  83. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  84. package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
  85. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
  86. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
  87. package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
  88. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +152 -21
  89. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
  90. package/node_modules/@playdrop/api-client/dist/domains/chat.js +477 -100
  91. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
  92. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
  93. package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
  94. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
  95. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
  96. package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
  97. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
  98. package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
  99. package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
  100. package/node_modules/@playdrop/api-client/dist/index.d.ts +81 -30
  101. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  102. package/node_modules/@playdrop/api-client/dist/index.js +217 -56
  103. package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
  104. package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
  105. package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
  106. package/node_modules/@playdrop/api-client/package.json +7 -0
  107. package/node_modules/@playdrop/config/client-meta.json +4 -4
  108. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
  109. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
  110. package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
  111. package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
  112. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  113. package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
  114. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
  115. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
  116. package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
  117. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
  118. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
  119. package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
  120. package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
  121. package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
  122. package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
  123. package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
  124. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  125. package/node_modules/@playdrop/config/package.json +6 -0
  126. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
  127. package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
  128. package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
  129. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
  130. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
  131. package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
  132. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
  133. package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
  134. package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
  135. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
  136. package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
  137. package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
  138. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
  139. package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
  140. package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
  141. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
  142. package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
  143. package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
  144. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
  145. package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
  146. package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
  147. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
  148. package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
  149. package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
  150. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
  151. package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
  152. package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
  153. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
  154. package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
  155. package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
  156. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
  157. package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
  158. package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
  159. package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
  160. package/node_modules/@playdrop/game-source-git/package.json +28 -0
  161. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
  162. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
  163. package/node_modules/@playdrop/types/dist/agent-task-terminal.js +15 -9
  164. package/node_modules/@playdrop/types/dist/api.d.ts +730 -166
  165. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  166. package/node_modules/@playdrop/types/dist/api.js +65 -18
  167. package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
  168. package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
  169. package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
  170. package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
  171. package/node_modules/@playdrop/types/dist/asset.js +26 -26
  172. package/node_modules/@playdrop/types/dist/chat.d.ts +273 -31
  173. package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
  174. package/node_modules/@playdrop/types/dist/chat.js +38 -4
  175. package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
  176. package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
  177. package/node_modules/@playdrop/types/dist/index.js +7 -1
  178. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
  179. package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
  180. package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
  181. package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
  182. package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
  183. package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
  184. package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
  185. package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
  186. package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
  187. package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
  188. package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
  189. package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
  190. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  191. package/node_modules/@playdrop/types/dist/version.js +111 -0
  192. package/node_modules/@playdrop/types/package.json +14 -0
  193. package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
  194. package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
  195. package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
  196. package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
  197. package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
  198. package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
  199. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
  200. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
  201. package/node_modules/@playdrop/vox-three/package.json +8 -4
  202. package/package.json +9 -11
  203. package/dist/assets/model-artifacts.d.ts +0 -8
  204. package/dist/assets/model-artifacts.js +0 -382
  205. package/dist/assets/model-worker.d.ts +0 -22
  206. package/dist/assets/model-worker.js +0 -123
  207. package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
  208. package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
  209. package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
  210. package/node_modules/@playdrop/ai-client/package.json +0 -22
  211. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
  212. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
  213. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
  214. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
  215. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
  216. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
  217. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
  218. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
  219. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
  220. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
  221. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
  222. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
  223. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
  224. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
  225. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
  226. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
  227. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
  228. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
  229. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
  230. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
  231. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
  232. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
  233. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
  234. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
  235. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
  236. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
  237. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
  238. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
  239. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
  240. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
  241. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
  242. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
  243. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
  244. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
  245. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
  246. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
  247. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
  248. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
  249. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
  250. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
  251. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
  252. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
  253. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
  254. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
  255. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
  256. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
  257. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
  258. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
  259. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
  260. package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
  261. package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
  262. package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
  263. package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
  264. package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
  265. package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
  266. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
  267. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
  268. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
  269. package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
  270. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
  271. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
  272. package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
  273. package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
  274. package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
  275. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
  276. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
  277. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
  278. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
  279. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
  280. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
  281. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
  282. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
  283. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
  284. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
  285. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
  286. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
  287. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
  288. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
  289. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
  290. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
  291. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
  292. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
  293. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
  294. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
  295. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
  296. package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
  297. package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
  298. package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
  299. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
  300. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
  301. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
  302. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
  303. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
  304. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
  305. package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
  306. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
  307. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
  308. package/node_modules/@playdrop/boxel-core/package.json +0 -19
  309. package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
  310. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
  311. package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
  312. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
  313. package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
  314. package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
  315. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
  316. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
  317. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
  318. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
  319. package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
  320. package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
  321. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
  322. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
  323. package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
  324. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
  325. package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
  326. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
  327. package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
  328. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
  329. package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
  330. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
  331. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
  332. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
  333. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
  334. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
  335. package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
  336. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
  337. package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
  338. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
  339. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
  340. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
  341. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
  342. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
  343. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
  344. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
  345. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
  346. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
  347. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
  348. package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
  349. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
  350. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
  351. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
  352. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
  353. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
  354. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
  355. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
  356. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
  357. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
  358. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
  359. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
  360. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
  361. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
  362. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
  363. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
  364. 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.browseGenerationJobs = browseGenerationJobs;
39
- exports.showGenerationJob = showGenerationJob;
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 jobs always create AUDIO assets with subcategory 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" || normalized === "PUBLIC") {
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: visibility ?? "PUBLIC",
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 && sourceModeInput !== "TEXT" && sourceModeInput !== "IMAGE") {
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 ? sourceModeInput : hasInputImages ? "IMAGE" : "TEXT";
593
- if (request.sourceMode === "IMAGE" && !hasInputImages) {
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
- if ("inputPrompt" in record && typeof record.inputPrompt === "string") {
613
- return record.inputPrompt;
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 candidate = record.generatedAsset;
619
- if (candidate &&
620
- typeof candidate === "object" &&
621
- typeof candidate.ref === "string" &&
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 candidate = record.generatedAsset;
629
- if (candidate &&
630
- typeof candidate === "object" &&
631
- typeof candidate.subcategory === "string" &&
632
- candidate.subcategory.trim().length > 0) {
633
- return candidate.subcategory.trim();
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?.generatedAsset?.ref === "string" ? payload.generatedAsset.ref : null;
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 formatJobStatus(job) {
865
- const progress = typeof job.progressPercent === "number"
866
- ? ` progress=${Math.max(0, Math.min(100, Math.round(job.progressPercent)))}%`
867
- : "";
868
- const eta = typeof job.etaSecondsRemaining === "number" ? ` eta=${Math.max(0, Math.round(job.etaSecondsRemaining))}s` : "";
869
- return `${job.status}${progress}${eta}`;
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 ({ aiClient }) => {
1019
+ await (0, commandContext_1.withEnvironment)("ai create", "Generating AI assets", async ({ client }) => {
899
1020
  try {
900
- const created = await aiClient.createGenerationJob(parsed.request);
901
- let job = created.job;
902
- const jobId = String(job.id || "").trim();
903
- if (!jobId) {
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(`Job ID: ${jobId}`);
908
- console.log(`Status: ${formatJobStatus(job)}`);
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 (job.status === "PENDING" || job.status === "RUNNING") {
1030
+ while (task.status === "QUEUED" || task.status === "RUNNING") {
912
1031
  if (Date.now() >= deadlineMs) {
913
- throw new Error(`ai_generation_job_timeout: Timed out waiting for job ${jobId}`);
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 aiClient.getGenerationJob(jobId);
917
- job = latest.job;
1035
+ const latest = await client.getAiGenerationTask(taskId);
1036
+ task = latest.task;
918
1037
  if (!options.json) {
919
- console.log(`Status: ${formatJobStatus(job)}`);
1038
+ console.log(`Status: ${formatTaskStatus(task)}`);
920
1039
  }
921
1040
  }
922
- if (job.status !== "SUCCESS") {
923
- const errorCode = typeof job.errorCode === "string" && job.errorCode.length > 0 ? job.errorCode : "ai_generation_failed";
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 = job.resultData && typeof job.resultData === "object" ? job.resultData : {};
1044
+ const payload = task.result && typeof task.result === "object" ? task.result : {};
928
1045
  if (outputPath) {
929
- await writeGeneratedImageOutput(payload, outputPath, parsed.request.input);
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)({ job, result: payload });
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 parseJobModality(raw) {
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("ai_generation_job_timeout:")) {
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 job to finish.", ["Retry the command with a higher --timeout value if the job normally takes longer."], { command });
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 browseGenerationJobs(options = {}) {
1026
- const modality = parseJobModality(options.type);
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 jobs browse",
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 jobs input: ${message}.`, ["Use positive integers for --limit and --offset."], {
1043
- command: "ai jobs browse",
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 jobs browse", "Browsing AI jobs", async ({ aiClient }) => {
1166
+ await (0, commandContext_1.withEnvironment)("ai tasks browse", "Browsing AI tasks", async ({ client }) => {
1049
1167
  try {
1050
- const response = await aiClient.listGenerationJobs({
1051
- modality: modality ?? undefined,
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.jobs, pagination: response.pagination });
1174
+ (0, output_1.printJson)({ items: response.tasks, count: response.count });
1057
1175
  return;
1058
1176
  }
1059
- if (!Array.isArray(response.jobs) || response.jobs.length === 0) {
1060
- console.log("No AI jobs found.");
1061
- console.log('Next: run "playdrop ai create <type> <prompt>" to start a new job.');
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 jobs:\n");
1065
- for (const job of response.jobs) {
1066
- console.log(`${job.id} | ${job.modality.toLowerCase()} | ${formatJobStatus(job)} | ${job.createdAt}`);
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 jobs detail <id>" to inspect one job.');
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 jobs browse", "AI job lookup")) {
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 showGenerationJob(id, options = {}) {
1078
- const jobId = typeof id === "string" ? id.trim() : "";
1079
- if (!jobId) {
1080
- (0, messages_1.printErrorWithHelp)("A job id is required.", ["Example: playdrop ai jobs detail job_123"], {
1081
- command: "ai jobs detail",
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 jobs detail", "Inspecting an AI job", async ({ aiClient }) => {
1204
+ await (0, commandContext_1.withEnvironment)("ai tasks detail", "Inspecting an AI task", async ({ client }) => {
1087
1205
  try {
1088
- const response = await aiClient.getGenerationJob(jobId);
1206
+ const response = await client.getAiGenerationTask(taskId);
1089
1207
  if (options.json) {
1090
- (0, output_1.printJson)({ job: response.job });
1208
+ (0, output_1.printJson)({ task: response.task });
1091
1209
  return;
1092
1210
  }
1093
- const job = response.job;
1094
- console.log(`Job: ${job.id}`);
1095
- console.log(`Type: ${job.modality.toLowerCase()}`);
1096
- console.log(`Status: ${formatJobStatus(job)}`);
1097
- console.log(`Created: ${job.createdAt}`);
1098
- console.log(`Updated: ${job.updatedAt}`);
1099
- if (job.errorMessage) {
1100
- console.log(`Error: ${job.errorMessage}`);
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 (job.linkedGenerationId) {
1103
- console.log(`Linked generation: ${job.linkedGenerationId}`);
1220
+ if (typeof task.result?.generationId === "string") {
1221
+ console.log(`Linked generation: ${task.result.generationId}`);
1104
1222
  }
1105
- console.log('\nNext: run "playdrop ai jobs browse" to review other jobs.');
1223
+ console.log('\nNext: run "playdrop ai tasks browse" to review other tasks.');
1106
1224
  }
1107
1225
  catch (error) {
1108
- if (!handleAiFailure(error, "ai jobs detail", "AI job detail lookup")) {
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 ({ aiClient }) => {
1144
- const response = await aiClient.listGenerations({ type: type ?? undefined, limit, offset });
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.cost}`];
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
  }