@playdrop/playdrop-cli 0.16.5 → 0.16.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/bin/playdrop +1 -2
  2. package/config/client-meta.json +4 -4
  3. package/dist/apiClient.d.ts +2 -2
  4. package/dist/apiClient.js +16 -20
  5. package/dist/appUrls.d.ts +2 -2
  6. package/dist/appUrls.js +31 -33
  7. package/dist/apps/build.d.ts +2 -2
  8. package/dist/apps/build.js +83 -83
  9. package/dist/apps/index.d.ts +7 -7
  10. package/dist/apps/index.js +8 -8
  11. package/dist/apps/loadCheck.d.ts +28 -16
  12. package/dist/apps/loadCheck.js +411 -279
  13. package/dist/apps/registration.d.ts +3 -3
  14. package/dist/apps/registration.js +1 -1
  15. package/dist/apps/staticHtml.d.ts +3 -3
  16. package/dist/apps/staticHtml.js +90 -91
  17. package/dist/apps/surfaceProfiles.d.ts +2 -2
  18. package/dist/apps/surfaceProfiles.js +6 -6
  19. package/dist/apps/upload.d.ts +5 -5
  20. package/dist/apps/upload.js +75 -81
  21. package/dist/apps/validate.d.ts +2 -2
  22. package/dist/apps/validate.js +18 -22
  23. package/dist/assetSpecs.d.ts +2 -2
  24. package/dist/assetSpecs.js +35 -35
  25. package/dist/assets/model-artifacts.d.ts +1 -1
  26. package/dist/assets/model-artifacts.js +81 -77
  27. package/dist/assets/model-worker.d.ts +1 -1
  28. package/dist/assets/model-worker.js +6 -6
  29. package/dist/browser.js +9 -9
  30. package/dist/catalogue-utils.d.ts +1 -1
  31. package/dist/catalogue-utils.js +26 -26
  32. package/dist/catalogue.d.ts +21 -16
  33. package/dist/catalogue.js +509 -413
  34. package/dist/clientInfo.d.ts +1 -1
  35. package/dist/clientInfo.js +28 -28
  36. package/dist/commandContext.d.ts +5 -5
  37. package/dist/commandContext.js +19 -23
  38. package/dist/commands/accounts.js +6 -6
  39. package/dist/commands/ads.js +16 -16
  40. package/dist/commands/agents.d.ts +2 -2
  41. package/dist/commands/agents.js +131 -127
  42. package/dist/commands/boosts.js +41 -31
  43. package/dist/commands/browse.d.ts +2 -2
  44. package/dist/commands/browse.js +168 -128
  45. package/dist/commands/build.js +9 -9
  46. package/dist/commands/captureListing.d.ts +8 -8
  47. package/dist/commands/captureListing.js +292 -332
  48. package/dist/commands/changelog.js +1 -1
  49. package/dist/commands/chat.js +51 -53
  50. package/dist/commands/check.d.ts +1 -1
  51. package/dist/commands/check.js +44 -44
  52. package/dist/commands/clients.d.ts +3 -3
  53. package/dist/commands/clients.js +67 -64
  54. package/dist/commands/comments.js +36 -29
  55. package/dist/commands/create.js +305 -312
  56. package/dist/commands/createRemixContent.d.ts +1 -1
  57. package/dist/commands/createRemixContent.js +65 -60
  58. package/dist/commands/creations.js +205 -135
  59. package/dist/commands/credits.js +37 -27
  60. package/dist/commands/detail.js +40 -34
  61. package/dist/commands/dev.js +103 -126
  62. package/dist/commands/devBrowser.js +74 -65
  63. package/dist/commands/devRuntimeAssets.d.ts +4 -4
  64. package/dist/commands/devRuntimeAssets.js +38 -40
  65. package/dist/commands/devServer.d.ts +4 -4
  66. package/dist/commands/devServer.js +183 -174
  67. package/dist/commands/devShared.d.ts +3 -3
  68. package/dist/commands/devShared.js +31 -31
  69. package/dist/commands/doctor.d.ts +5 -5
  70. package/dist/commands/doctor.js +63 -57
  71. package/dist/commands/documentation.js +42 -32
  72. package/dist/commands/feedback.js +59 -42
  73. package/dist/commands/format.js +9 -9
  74. package/dist/commands/generation.d.ts +2 -2
  75. package/dist/commands/generation.js +344 -326
  76. package/dist/commands/init.d.ts +4 -4
  77. package/dist/commands/init.js +64 -61
  78. package/dist/commands/login.d.ts +2 -2
  79. package/dist/commands/login.js +42 -62
  80. package/dist/commands/logout.js +4 -4
  81. package/dist/commands/marketing.d.ts +8 -8
  82. package/dist/commands/marketing.js +246 -297
  83. package/dist/commands/notes.js +19 -19
  84. package/dist/commands/notifications.js +34 -22
  85. package/dist/commands/npmProcess.js +3 -3
  86. package/dist/commands/ownedRuntimeImageValidation.d.ts +1 -1
  87. package/dist/commands/ownedRuntimeImageValidation.js +19 -17
  88. package/dist/commands/play.js +12 -21
  89. package/dist/commands/publicPages.js +8 -4
  90. package/dist/commands/review.js +123 -110
  91. package/dist/commands/search.js +107 -88
  92. package/dist/commands/tags.js +10 -12
  93. package/dist/commands/taskCaptureSession.d.ts +3 -3
  94. package/dist/commands/taskCaptureSession.js +3 -3
  95. package/dist/commands/tweaks.js +25 -23
  96. package/dist/commands/upgrade.js +40 -31
  97. package/dist/commands/upload-content.d.ts +5 -5
  98. package/dist/commands/upload-content.js +130 -122
  99. package/dist/commands/upload-graph.d.ts +1 -1
  100. package/dist/commands/upload-graph.js +7 -11
  101. package/dist/commands/upload.d.ts +7 -7
  102. package/dist/commands/upload.js +196 -217
  103. package/dist/commands/validate.js +33 -32
  104. package/dist/commands/versionsBrowse.js +61 -51
  105. package/dist/commands/whoami.js +11 -14
  106. package/dist/commands/worker/archive-staging.d.ts +9 -0
  107. package/dist/commands/worker/archive-staging.js +257 -0
  108. package/dist/commands/worker/instrument-evidence.d.ts +1 -1
  109. package/dist/commands/worker/instrument-evidence.js +41 -43
  110. package/dist/commands/worker/provider-telemetry.d.ts +2 -1
  111. package/dist/commands/worker/provider-telemetry.js +181 -64
  112. package/dist/commands/worker/runtime.d.ts +18 -3
  113. package/dist/commands/worker/runtime.js +291 -239
  114. package/dist/commands/worker.d.ts +83 -22
  115. package/dist/commands/worker.js +1980 -1411
  116. package/dist/commands/workspaces.d.ts +2 -2
  117. package/dist/commands/workspaces.js +57 -57
  118. package/dist/config.js +23 -20
  119. package/dist/devAuth.d.ts +3 -3
  120. package/dist/devAuth.js +20 -17
  121. package/dist/environment.d.ts +1 -1
  122. package/dist/environment.js +34 -34
  123. package/dist/errors.d.ts +1 -1
  124. package/dist/errors.js +7 -7
  125. package/dist/externalAssetPackValidation.d.ts +1 -1
  126. package/dist/externalAssetPackValidation.js +9 -9
  127. package/dist/http.d.ts +1 -1
  128. package/dist/http.js +9 -9
  129. package/dist/index.js +657 -664
  130. package/dist/listingCaptureLease.js +23 -23
  131. package/dist/listingPreflight.d.ts +2 -2
  132. package/dist/listingPreflight.js +33 -33
  133. package/dist/messages.js +6 -14
  134. package/dist/output.js +9 -9
  135. package/dist/playwright.d.ts +1 -1
  136. package/dist/playwright.js +35 -40
  137. package/dist/proxyFetch.js +30 -27
  138. package/dist/recorderRelease.js +8 -8
  139. package/dist/refs.d.ts +5 -5
  140. package/dist/refs.js +40 -37
  141. package/dist/sessionCookie.js +15 -21
  142. package/dist/shellProbe.js +5 -5
  143. package/dist/taskSelection.d.ts +3 -3
  144. package/dist/taskSelection.js +67 -62
  145. package/dist/taskUtils.d.ts +1 -1
  146. package/dist/taskUtils.js +4 -4
  147. package/dist/tweakStaleness.d.ts +3 -3
  148. package/dist/tweakStaleness.js +8 -8
  149. package/dist/uploadLog.d.ts +3 -3
  150. package/dist/uploadLog.js +51 -51
  151. package/dist/versionCompare.js +3 -3
  152. package/dist/workerAppProject.d.ts +1 -1
  153. package/dist/workerAppProject.js +10 -17
  154. package/dist/workspaceAuth.d.ts +1 -1
  155. package/dist/workspaceAuth.js +28 -22
  156. package/node_modules/@playdrop/ai-client/dist/index.d.ts +35 -35
  157. package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
  158. package/node_modules/@playdrop/api-client/dist/client.d.ts +34 -33
  159. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  160. package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +1 -1
  161. package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -1
  162. package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -2
  163. package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
  164. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +2 -2
  165. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
  166. package/node_modules/@playdrop/api-client/dist/domains/admin.js +4 -1
  167. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +4 -3
  168. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
  169. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +12 -0
  170. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +2 -2
  171. package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
  172. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +4 -4
  173. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  174. package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +4 -4
  175. package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
  176. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -4
  177. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
  178. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +2 -2
  179. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
  180. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +2 -2
  181. package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
  182. package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +3 -3
  183. package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -1
  184. package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts +2 -2
  185. package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts.map +1 -1
  186. package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -2
  187. package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
  188. package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +2 -2
  189. package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
  190. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -2
  191. package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
  192. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +3 -3
  193. package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
  194. package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +2 -2
  195. package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +2 -2
  196. package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -1
  197. package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts +2 -2
  198. package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts.map +1 -1
  199. package/node_modules/@playdrop/api-client/dist/index.d.ts +19 -18
  200. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  201. package/node_modules/@playdrop/api-client/dist/index.js +7 -2
  202. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +1 -1
  203. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +47 -47
  204. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
  205. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +3 -3
  206. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +32 -47
  207. package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -1
  208. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +16 -18
  209. package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +1 -1
  210. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +2 -2
  211. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +4 -4
  212. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +1 -1
  213. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +3 -3
  214. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
  215. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +44 -45
  216. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
  217. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +1 -1
  218. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
  219. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +40 -44
  220. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
  221. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +2 -2
  222. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +30 -34
  223. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
  224. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +4 -4
  225. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +1 -1
  226. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +3 -3
  227. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +23 -20
  228. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
  229. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +3 -3
  230. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +3 -3
  231. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +1 -1
  232. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +21 -21
  233. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
  234. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +1 -1
  235. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +2 -2
  236. package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +19 -19
  237. package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +1 -1
  238. package/node_modules/@playdrop/boxel-core/dist/src/materials.js +12 -16
  239. package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +1 -1
  240. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +1 -1
  241. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +38 -41
  242. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
  243. package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +1 -1
  244. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +54 -56
  245. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
  246. package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +3 -3
  247. package/node_modules/@playdrop/boxel-core/dist/src/textures.js +39 -45
  248. package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +1 -1
  249. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
  250. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +39 -43
  251. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
  252. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +3 -3
  253. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +35 -35
  254. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
  255. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +1 -1
  256. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +18 -18
  257. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -1
  258. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +3 -3
  259. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +50 -48
  260. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
  261. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +1 -1
  262. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +22 -26
  263. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
  264. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +2 -2
  265. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +8 -8
  266. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +1 -1
  267. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +2 -2
  268. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +23 -28
  269. package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +1 -1
  270. package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +8 -8
  271. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
  272. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +93 -95
  273. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
  274. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +1 -1
  275. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +2 -2
  276. package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +1 -1
  277. package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +1 -1
  278. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +2 -7
  279. package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +1 -1
  280. package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +3 -3
  281. package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +4 -4
  282. package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +3 -3
  283. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +6 -6
  284. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +9 -1
  285. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +3 -3
  286. package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -17
  287. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +9 -9
  288. package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +3 -3
  289. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +1 -1
  290. package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +2 -2
  291. package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +1 -1
  292. package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +1 -1
  293. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +2 -2
  294. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +1 -1
  295. package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +3 -3
  296. package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +4 -4
  297. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +2 -2
  298. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +1 -1
  299. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +1 -1
  300. package/node_modules/@playdrop/config/client-meta.json +4 -4
  301. package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +1 -1
  302. package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -1
  303. package/node_modules/@playdrop/config/dist/src/client-meta.js +10 -10
  304. package/node_modules/@playdrop/config/dist/src/constants.js +10 -10
  305. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +1 -1
  306. package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
  307. package/node_modules/@playdrop/config/dist/src/creator-plans.js +27 -28
  308. package/node_modules/@playdrop/config/dist/src/deployment.d.ts +4 -4
  309. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  310. package/node_modules/@playdrop/config/dist/src/deployment.js +42 -41
  311. package/node_modules/@playdrop/config/dist/src/game-arena.js +12 -12
  312. package/node_modules/@playdrop/config/dist/src/index.d.ts +9 -9
  313. package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
  314. package/node_modules/@playdrop/config/dist/src/index.js +24 -25
  315. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +4 -4
  316. package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
  317. package/node_modules/@playdrop/config/dist/src/public-deployment.js +41 -39
  318. package/node_modules/@playdrop/config/dist/src/runtime-client-meta.js +1 -3
  319. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
  320. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +23 -25
  321. package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +5 -5
  322. package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
  323. package/node_modules/@playdrop/config/dist/src/server/fastify.js +44 -46
  324. package/node_modules/@playdrop/config/dist/src/server/logging.d.ts +1 -1
  325. package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
  326. package/node_modules/@playdrop/config/dist/src/server/logging.js +6 -8
  327. package/node_modules/@playdrop/config/dist/src/types.d.ts +2 -2
  328. package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +12 -12
  329. package/node_modules/@playdrop/config/dist/test/deployment.test.js +59 -59
  330. package/node_modules/@playdrop/config/dist/test/fastify.test.js +4 -4
  331. package/node_modules/@playdrop/config/dist/test/game-arena.test.js +8 -8
  332. package/node_modules/@playdrop/config/dist/test/logging.test.js +6 -6
  333. package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +57 -57
  334. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  335. package/node_modules/@playdrop/types/dist/agent-task-playtest.d.ts.map +1 -1
  336. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
  337. package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
  338. package/node_modules/@playdrop/types/dist/api.d.ts +314 -250
  339. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  340. package/node_modules/@playdrop/types/dist/api.js +40 -59
  341. package/node_modules/@playdrop/types/dist/app-capability-filters.d.ts +2 -2
  342. package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts +6 -6
  343. package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts.map +1 -1
  344. package/node_modules/@playdrop/types/dist/app-review.d.ts +2 -2
  345. package/node_modules/@playdrop/types/dist/app-review.d.ts.map +1 -1
  346. package/node_modules/@playdrop/types/dist/app-review.js +1 -6
  347. package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
  348. package/node_modules/@playdrop/types/dist/asset-pack.d.ts +5 -5
  349. package/node_modules/@playdrop/types/dist/asset-spec.d.ts +4 -4
  350. package/node_modules/@playdrop/types/dist/asset.d.ts +11 -11
  351. package/node_modules/@playdrop/types/dist/attachment-policy.d.ts.map +1 -1
  352. package/node_modules/@playdrop/types/dist/chat.d.ts +3 -3
  353. package/node_modules/@playdrop/types/dist/creator-public-image.d.ts.map +1 -1
  354. package/node_modules/@playdrop/types/dist/graph.d.ts +4 -4
  355. package/node_modules/@playdrop/types/dist/index.d.ts +25 -25
  356. package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts +2 -2
  357. package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts.map +1 -1
  358. package/node_modules/@playdrop/types/dist/instrument-evidence.js +2 -11
  359. package/node_modules/@playdrop/types/dist/locale.d.ts +2 -2
  360. package/node_modules/@playdrop/types/dist/locale.d.ts.map +1 -1
  361. package/node_modules/@playdrop/types/dist/locale.js +2 -17
  362. package/node_modules/@playdrop/types/dist/owned-assets.d.ts +2 -2
  363. package/node_modules/@playdrop/types/dist/owned-assets.d.ts.map +1 -1
  364. package/node_modules/@playdrop/types/dist/player-meta.d.ts +3 -3
  365. package/node_modules/@playdrop/types/dist/player-meta.d.ts.map +1 -1
  366. package/node_modules/@playdrop/types/dist/playtest-notes.d.ts +11 -11
  367. package/node_modules/@playdrop/types/dist/playtest-notes.d.ts.map +1 -1
  368. package/node_modules/@playdrop/types/dist/playtrade.d.ts +8 -5
  369. package/node_modules/@playdrop/types/dist/playtrade.d.ts.map +1 -1
  370. package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -1
  371. package/node_modules/@playdrop/types/dist/tweaks.d.ts +4 -4
  372. package/node_modules/@playdrop/types/dist/tweaks.d.ts.map +1 -1
  373. package/node_modules/@playdrop/types/dist/tweaks.js +12 -2
  374. package/node_modules/@playdrop/types/dist/version.d.ts +14 -14
  375. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  376. package/node_modules/@playdrop/types/dist/version.js +4 -1
  377. package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
  378. package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +2 -2
  379. package/node_modules/@playdrop/vox-three/dist/src/vox.js +20 -18
  380. package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
  381. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +11 -14
  382. package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
  383. package/package.json +1 -1
@@ -11,11 +11,13 @@ exports.extractAgentTokenUsage = extractAgentTokenUsage;
11
11
  exports.extractCodexRolloutTokenUsage = extractCodexRolloutTokenUsage;
12
12
  exports.extractCodexThreadId = extractCodexThreadId;
13
13
  exports.extractClaudeSessionId = extractClaudeSessionId;
14
+ exports.extractGrokRunMetadata = extractGrokRunMetadata;
14
15
  exports.readCodexRolloutTokenUsageForThread = readCodexRolloutTokenUsageForThread;
15
16
  exports.extractCodexTokensUsed = extractCodexTokensUsed;
16
17
  exports.assertWorkerTokenUsageWithinCap = assertWorkerTokenUsageWithinCap;
17
18
  exports.runLoggedProcess = runLoggedProcess;
18
19
  exports.buildCodexExecArgs = buildCodexExecArgs;
20
+ exports.buildGrokExecArgs = buildGrokExecArgs;
19
21
  exports.readCodexSandboxMode = readCodexSandboxMode;
20
22
  exports.buildClaudeExecArgs = buildClaudeExecArgs;
21
23
  exports.resolvePlaywrightMcpCliPath = resolvePlaywrightMcpCliPath;
@@ -50,7 +52,7 @@ function throwLoggedProcessError(error) {
50
52
  }
51
53
  function resolveDescendantProcessIds(processTable, rootPid) {
52
54
  if (!Number.isInteger(rootPid) || rootPid <= 0) {
53
- throw new Error('invalid_process_tree_root');
55
+ throw new Error("invalid_process_tree_root");
54
56
  }
55
57
  const childrenByParent = new Map();
56
58
  for (const line of processTable.split(/\r?\n/)) {
@@ -75,18 +77,18 @@ function resolveDescendantProcessIds(processTable, rootPid) {
75
77
  return descendants;
76
78
  }
77
79
  function collectProcessTreeIds(rootPid) {
78
- if (process.platform === 'win32') {
80
+ if (process.platform === "win32") {
79
81
  return [rootPid];
80
82
  }
81
- const result = (0, node_child_process_1.spawnSync)('ps', ['-axo', 'pid=,ppid='], {
82
- encoding: 'utf8',
83
+ const result = (0, node_child_process_1.spawnSync)("ps", ["-axo", "pid=,ppid="], {
84
+ encoding: "utf8",
83
85
  timeout: 5000,
84
86
  });
85
87
  if (result.status !== 0) {
86
- console.error(`worker_process_tree_probe_failed:${result.stderr?.trim() || result.stdout?.trim() || result.error?.message || 'unknown'}`);
88
+ console.error(`worker_process_tree_probe_failed:${result.stderr?.trim() || result.stdout?.trim() || result.error?.message || "unknown"}`);
87
89
  return [rootPid];
88
90
  }
89
- return [...resolveDescendantProcessIds(result.stdout || '', rootPid), rootPid];
91
+ return [...resolveDescendantProcessIds(result.stdout || "", rootPid), rootPid];
90
92
  }
91
93
  function signalProcessIds(processIds, signal) {
92
94
  for (const pid of processIds) {
@@ -94,7 +96,7 @@ function signalProcessIds(processIds, signal) {
94
96
  process.kill(pid, signal);
95
97
  }
96
98
  catch (error) {
97
- if (error.code !== 'ESRCH') {
99
+ if (error.code !== "ESRCH") {
98
100
  console.error(`worker_process_tree_signal_failed:${pid}:${signal}:${error instanceof Error ? error.message : String(error)}`);
99
101
  }
100
102
  }
@@ -105,7 +107,7 @@ function signalProcessGroup(rootPid, signal) {
105
107
  process.kill(-rootPid, signal);
106
108
  }
107
109
  catch (error) {
108
- if (error.code !== 'ESRCH') {
110
+ if (error.code !== "ESRCH") {
109
111
  console.error(`worker_process_group_signal_failed:${rootPid}:${signal}:${error instanceof Error ? error.message : String(error)}`);
110
112
  }
111
113
  }
@@ -126,16 +128,16 @@ function readEnvBoolean(name, fallback) {
126
128
  if (!raw) {
127
129
  return fallback;
128
130
  }
129
- if (raw === '1' || raw === 'true' || raw === 'yes' || raw === 'on') {
131
+ if (raw === "1" || raw === "true" || raw === "yes" || raw === "on") {
130
132
  return true;
131
133
  }
132
- if (raw === '0' || raw === 'false' || raw === 'no' || raw === 'off') {
134
+ if (raw === "0" || raw === "false" || raw === "no" || raw === "off") {
133
135
  return false;
134
136
  }
135
137
  throw new Error(`invalid_${name.toLowerCase()}`);
136
138
  }
137
139
  function normalizeTokenCount(value) {
138
- if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
140
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
139
141
  return null;
140
142
  }
141
143
  return Math.ceil(value);
@@ -150,7 +152,7 @@ function normalizeFirstTokenCount(...values) {
150
152
  return null;
151
153
  }
152
154
  function coerceRecord(value) {
153
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
155
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
154
156
  return null;
155
157
  }
156
158
  return value;
@@ -183,7 +185,7 @@ function readStructuredUsage(parsed) {
183
185
  }
184
186
  function readCodexRolloutStructuredUsage(parsed) {
185
187
  const root = coerceRecord(parsed);
186
- if (!root || root.type !== 'token_count') {
188
+ if (!root || root.type !== "token_count") {
187
189
  return null;
188
190
  }
189
191
  const info = coerceRecord(root.info);
@@ -194,17 +196,10 @@ function normalizeAgentTokenUsageFromRecord(usage) {
194
196
  const cacheCreationInputTokens = normalizeFirstTokenCount(usage.cache_creation_input_tokens, usage.cacheCreationInputTokens);
195
197
  const cacheReadInputTokens = normalizeFirstTokenCount(usage.cache_read_input_tokens, usage.cached_input_tokens, usage.cacheReadInputTokens);
196
198
  const rawInputTokens = normalizeFirstTokenCount(usage.input_tokens, usage.inputTokens);
197
- const inputTokens = rawInputTokens !== null
198
- && cacheReadInputTokens !== null
199
- && usage.cached_input_tokens !== undefined
199
+ const inputTokens = rawInputTokens !== null && cacheReadInputTokens !== null && usage.cached_input_tokens !== undefined
200
200
  ? Math.max(0, rawInputTokens - cacheReadInputTokens)
201
201
  : rawInputTokens;
202
- const tokenParts = [
203
- inputTokens,
204
- outputTokens,
205
- cacheCreationInputTokens,
206
- cacheReadInputTokens,
207
- ];
202
+ const tokenParts = [inputTokens, outputTokens, cacheCreationInputTokens, cacheReadInputTokens];
208
203
  const sawTokenValue = tokenParts.some((value) => value !== null);
209
204
  if (!sawTokenValue) {
210
205
  return null;
@@ -219,7 +214,7 @@ function normalizeAgentTokenUsageFromRecord(usage) {
219
214
  usageParseError: null,
220
215
  };
221
216
  }
222
- function missingAgentTokenUsage(reason = 'agent_usage_not_reported') {
217
+ function missingAgentTokenUsage(reason = "agent_usage_not_reported") {
223
218
  return {
224
219
  inputTokens: null,
225
220
  outputTokens: null,
@@ -233,7 +228,7 @@ function missingAgentTokenUsage(reason = 'agent_usage_not_reported') {
233
228
  function extractAgentTokenUsage(output) {
234
229
  for (const line of output.split(/\r?\n/).reverse()) {
235
230
  const trimmed = line.trim();
236
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
231
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
237
232
  continue;
238
233
  }
239
234
  try {
@@ -256,7 +251,7 @@ function extractAgentTokenUsage(output) {
256
251
  function extractCodexRolloutTokenUsage(output) {
257
252
  for (const line of output.split(/\r?\n/).reverse()) {
258
253
  const trimmed = line.trim();
259
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
254
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
260
255
  continue;
261
256
  }
262
257
  try {
@@ -279,7 +274,7 @@ function extractCodexRolloutTokenUsage(output) {
279
274
  function extractCodexThreadId(output) {
280
275
  for (const line of output.split(/\r?\n/)) {
281
276
  const trimmed = line.trim();
282
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
277
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
283
278
  continue;
284
279
  }
285
280
  try {
@@ -287,13 +282,13 @@ function extractCodexThreadId(output) {
287
282
  if (!root) {
288
283
  continue;
289
284
  }
290
- const type = typeof root.type === 'string' ? root.type : '';
291
- const rawThreadId = type === 'thread.started'
292
- ? root.thread_id ?? root.threadId
293
- : type === 'session_meta'
294
- ? root.session_id ?? root.sessionId
285
+ const type = typeof root.type === "string" ? root.type : "";
286
+ const rawThreadId = type === "thread.started"
287
+ ? (root.thread_id ?? root.threadId)
288
+ : type === "session_meta"
289
+ ? (root.session_id ?? root.sessionId)
295
290
  : null;
296
- if (typeof rawThreadId === 'string' && rawThreadId.trim()) {
291
+ if (typeof rawThreadId === "string" && rawThreadId.trim()) {
297
292
  return rawThreadId.trim();
298
293
  }
299
294
  }
@@ -306,13 +301,13 @@ function extractCodexThreadId(output) {
306
301
  function extractClaudeSessionId(output) {
307
302
  for (const line of output.split(/\r?\n/)) {
308
303
  const trimmed = line.trim();
309
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
304
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
310
305
  continue;
311
306
  }
312
307
  try {
313
308
  const root = coerceRecord(JSON.parse(trimmed));
314
309
  const rawSessionId = root?.session_id ?? root?.sessionId;
315
- if (typeof rawSessionId === 'string' && rawSessionId.trim()) {
310
+ if (typeof rawSessionId === "string" && rawSessionId.trim()) {
316
311
  return rawSessionId.trim();
317
312
  }
318
313
  }
@@ -322,6 +317,45 @@ function extractClaudeSessionId(output) {
322
317
  }
323
318
  return null;
324
319
  }
320
+ function extractGrokRunMetadata(output) {
321
+ const fallbackTokenUsage = extractAgentTokenUsage(output);
322
+ for (const line of output.split(/\r?\n/).reverse()) {
323
+ const trimmed = line.trim();
324
+ if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
325
+ continue;
326
+ }
327
+ try {
328
+ const root = coerceRecord(JSON.parse(trimmed));
329
+ if (!root || (root.type !== "result" && root.type !== "end" && root.type !== "error")) {
330
+ continue;
331
+ }
332
+ const rawSessionId = root.sessionId ?? root.session_id;
333
+ const sessionId = typeof rawSessionId === "string" && rawSessionId.trim() ? rawSessionId.trim() : null;
334
+ const modelUsage = coerceRecord(root.modelUsage);
335
+ const resolvedRuntimeModel = modelUsage && Object.keys(modelUsage).length === 1
336
+ ? Object.keys(modelUsage)[0]
337
+ : typeof root.model === "string" && root.model.trim()
338
+ ? root.model.trim()
339
+ : null;
340
+ return {
341
+ sessionId,
342
+ resolvedRuntimeModel,
343
+ tokenUsage: {
344
+ ...fallbackTokenUsage,
345
+ rawProviderUsage: root,
346
+ },
347
+ };
348
+ }
349
+ catch {
350
+ continue;
351
+ }
352
+ }
353
+ return {
354
+ sessionId: null,
355
+ resolvedRuntimeModel: null,
356
+ tokenUsage: fallbackTokenUsage,
357
+ };
358
+ }
325
359
  async function findCodexRolloutFileForThread(threadId, sessionsRoot) {
326
360
  const stack = [{ dir: sessionsRoot, depth: 0 }];
327
361
  const matches = [];
@@ -332,7 +366,7 @@ async function findCodexRolloutFileForThread(threadId, sessionsRoot) {
332
366
  entries = await (0, promises_1.readdir)(current.dir, { withFileTypes: true });
333
367
  }
334
368
  catch (error) {
335
- if (error.code === 'ENOENT') {
369
+ if (error.code === "ENOENT") {
336
370
  continue;
337
371
  }
338
372
  throw error;
@@ -345,10 +379,10 @@ async function findCodexRolloutFileForThread(threadId, sessionsRoot) {
345
379
  }
346
380
  continue;
347
381
  }
348
- if (entry.isFile()
349
- && entry.name.startsWith('rollout-')
350
- && entry.name.endsWith('.jsonl')
351
- && entry.name.includes(threadId)) {
382
+ if (entry.isFile() &&
383
+ entry.name.startsWith("rollout-") &&
384
+ entry.name.endsWith(".jsonl") &&
385
+ entry.name.includes(threadId)) {
352
386
  matches.push(entryPath);
353
387
  }
354
388
  }
@@ -362,14 +396,14 @@ async function findCodexRolloutFileForThread(threadId, sessionsRoot) {
362
396
  async function readCodexRolloutTokenUsageForThread(threadId, options = {}) {
363
397
  const normalizedThreadId = threadId.trim();
364
398
  if (!normalizedThreadId) {
365
- return missingAgentTokenUsage('codex_thread_id_missing');
399
+ return missingAgentTokenUsage("codex_thread_id_missing");
366
400
  }
367
- const sessionsRoot = options.sessionsRoot ?? node_path_1.default.join(node_os_1.default.homedir(), '.codex', 'sessions');
401
+ const sessionsRoot = options.sessionsRoot ?? node_path_1.default.join(node_os_1.default.homedir(), ".codex", "sessions");
368
402
  const rolloutPath = await findCodexRolloutFileForThread(normalizedThreadId, sessionsRoot);
369
403
  if (!rolloutPath) {
370
- return missingAgentTokenUsage('codex_rollout_file_not_found');
404
+ return missingAgentTokenUsage("codex_rollout_file_not_found");
371
405
  }
372
- const output = await (0, promises_1.readFile)(rolloutPath, 'utf8');
406
+ const output = await (0, promises_1.readFile)(rolloutPath, "utf8");
373
407
  if (options.deleteAfterRead !== false) {
374
408
  await (0, promises_1.rm)(rolloutPath, { force: true });
375
409
  }
@@ -389,22 +423,22 @@ function assertWorkerTokenUsageWithinCap(input) {
389
423
  }
390
424
  async function runLoggedProcess(input) {
391
425
  if (!input.command.trim()) {
392
- throw new Error('invalid_process_command');
426
+ throw new Error("invalid_process_command");
393
427
  }
394
428
  if (!Number.isInteger(input.timeoutMs) || input.timeoutMs <= 0) {
395
- throw new Error('invalid_process_timeout');
429
+ throw new Error("invalid_process_timeout");
396
430
  }
397
431
  if (!Number.isInteger(input.maxOutputChars) || input.maxOutputChars <= 0) {
398
- throw new Error('invalid_process_log_tail');
432
+ throw new Error("invalid_process_log_tail");
399
433
  }
400
434
  const transcriptFlushIntervalMs = input.transcriptFlushIntervalMs ?? exports.DEFAULT_TRANSCRIPT_FLUSH_INTERVAL_MS;
401
435
  if (input.onTranscriptChunks && (!Number.isInteger(transcriptFlushIntervalMs) || transcriptFlushIntervalMs <= 0)) {
402
- throw new Error('invalid_process_transcript_flush_interval');
436
+ throw new Error("invalid_process_transcript_flush_interval");
403
437
  }
404
438
  return await new Promise((resolve, reject) => {
405
- let stdout = '';
406
- let stderr = '';
407
- let combined = '';
439
+ let stdout = "";
440
+ let stderr = "";
441
+ let combined = "";
408
442
  let timedOut = false;
409
443
  let closed = false;
410
444
  let killTimer = null;
@@ -416,16 +450,16 @@ async function runLoggedProcess(input) {
416
450
  const pendingTranscriptChunks = [];
417
451
  const child = (0, node_child_process_1.spawn)(input.command, input.args, {
418
452
  cwd: input.cwd,
419
- stdio: ['pipe', 'pipe', 'pipe'],
453
+ stdio: ["pipe", "pipe", "pipe"],
420
454
  env: input.env,
421
- detached: process.platform !== 'win32',
455
+ detached: process.platform !== "win32",
422
456
  });
423
- child.stdin?.end(input.stdin ?? '');
457
+ child.stdin?.end(input.stdin ?? "");
424
458
  const terminateProcessTree = (signal) => {
425
459
  if (!child.pid) {
426
460
  return;
427
461
  }
428
- if (process.platform !== 'win32') {
462
+ if (process.platform !== "win32") {
429
463
  signalProcessGroup(child.pid, signal);
430
464
  return;
431
465
  }
@@ -440,9 +474,9 @@ async function runLoggedProcess(input) {
440
474
  if (closed) {
441
475
  return;
442
476
  }
443
- terminateProcessTree('SIGTERM');
477
+ terminateProcessTree("SIGTERM");
444
478
  terminateKillTimer = setTimeout(() => {
445
- terminateProcessTree('SIGKILL');
479
+ terminateProcessTree("SIGKILL");
446
480
  }, CHILD_KILL_GRACE_MS);
447
481
  },
448
482
  });
@@ -468,7 +502,7 @@ async function runLoggedProcess(input) {
468
502
  const handleTranscriptFlushError = (error) => {
469
503
  transcriptFlushError = transcriptFlushError ?? (error instanceof Error ? error : new Error(String(error)));
470
504
  if (!closed) {
471
- terminateProcessTree('SIGTERM');
505
+ terminateProcessTree("SIGTERM");
472
506
  }
473
507
  };
474
508
  if (input.onTranscriptChunks) {
@@ -477,8 +511,8 @@ async function runLoggedProcess(input) {
477
511
  }, transcriptFlushIntervalMs);
478
512
  }
479
513
  const append = (stream, chunk) => {
480
- const text = chunk.toString('utf8');
481
- if (stream === 'stdout') {
514
+ const text = chunk.toString("utf8");
515
+ if (stream === "stdout") {
482
516
  process.stdout.write(text);
483
517
  stdout = tailText(stdout + text, input.maxOutputChars);
484
518
  }
@@ -489,7 +523,7 @@ async function runLoggedProcess(input) {
489
523
  if (input.onTranscriptChunks) {
490
524
  pendingTranscriptChunks.push({ stream, content: text });
491
525
  }
492
- if (stream === 'stdout' && input.onStdoutText) {
526
+ if (stream === "stdout" && input.onStdoutText) {
493
527
  try {
494
528
  const flushNow = input.onStdoutText(text) === true;
495
529
  if (flushNow && input.onTranscriptChunks) {
@@ -504,19 +538,19 @@ async function runLoggedProcess(input) {
504
538
  };
505
539
  const timeout = setTimeout(() => {
506
540
  timedOut = true;
507
- terminateProcessTree('SIGTERM');
541
+ terminateProcessTree("SIGTERM");
508
542
  killTimer = setTimeout(() => {
509
- terminateProcessTree('SIGKILL');
543
+ terminateProcessTree("SIGKILL");
510
544
  }, 5000);
511
545
  }, input.timeoutMs);
512
- child.stdout?.on('data', (chunk) => append('stdout', chunk));
513
- child.stderr?.on('data', (chunk) => append('stderr', chunk));
514
- child.on('error', reject);
515
- child.on('close', (code, signal) => {
546
+ child.stdout?.on("data", (chunk) => append("stdout", chunk));
547
+ child.stderr?.on("data", (chunk) => append("stderr", chunk));
548
+ child.on("error", reject);
549
+ child.on("close", (code, signal) => {
516
550
  closed = true;
517
551
  // The provider process may leave MCP servers, browsers, dev servers, or recorders behind.
518
552
  // A task owns its whole process group, so no descendant survives terminal completion.
519
- terminateProcessTree('SIGKILL');
553
+ terminateProcessTree("SIGKILL");
520
554
  clearTimeout(timeout);
521
555
  if (killTimer) {
522
556
  clearTimeout(killTimer);
@@ -556,50 +590,89 @@ async function runLoggedProcess(input) {
556
590
  });
557
591
  }
558
592
  function buildCodexExecArgs(input) {
559
- const sandboxMode = input.sandboxMode ?? 'danger-full-access';
560
- const resumeSessionId = input.resumeSessionId?.trim() ?? '';
593
+ const sandboxMode = input.sandboxMode ?? "danger-full-access";
594
+ const resumeSessionId = input.resumeSessionId?.trim() ?? "";
561
595
  if (resumeSessionId) {
562
596
  return [
563
- 'exec',
564
- 'resume',
565
- '--json',
566
- '--skip-git-repo-check',
567
- '--model',
597
+ "exec",
598
+ "resume",
599
+ "--json",
600
+ "--skip-git-repo-check",
601
+ "--model",
568
602
  input.model,
569
- '-c',
603
+ "-c",
570
604
  `model_reasoning_effort="${input.reasoningEffort}"`,
571
605
  resumeSessionId,
572
- '-',
606
+ "-",
573
607
  ];
574
608
  }
575
609
  const args = [
576
- 'exec',
577
- '--json',
578
- '--sandbox',
610
+ "exec",
611
+ "--json",
612
+ "--sandbox",
579
613
  sandboxMode,
580
- '--cd',
614
+ "--cd",
581
615
  input.workspaceDir,
582
- '--skip-git-repo-check',
583
- '--model',
616
+ "--skip-git-repo-check",
617
+ "--model",
584
618
  input.model,
585
- '-c',
619
+ "-c",
586
620
  `model_reasoning_effort="${input.reasoningEffort}"`,
587
621
  ];
588
- if (sandboxMode === 'workspace-write') {
589
- args.push('-c', `sandbox_workspace_write.network_access=${input.networkAccess ? 'true' : 'false'}`);
622
+ if (sandboxMode === "workspace-write") {
623
+ args.push("-c", `sandbox_workspace_write.network_access=${input.networkAccess ? "true" : "false"}`);
590
624
  }
591
625
  for (const imagePath of input.imagePaths ?? []) {
592
- args.push('--image', imagePath);
626
+ args.push("--image", imagePath);
627
+ }
628
+ args.push("-");
629
+ return args;
630
+ }
631
+ function buildGrokExecArgs(input) {
632
+ const model = input.model.trim();
633
+ const reasoningEffort = input.reasoningEffort.trim();
634
+ if (!model) {
635
+ throw new Error("agent_task_assignment_model_missing");
636
+ }
637
+ if (!reasoningEffort) {
638
+ throw new Error("agent_task_assignment_reasoning_effort_missing");
639
+ }
640
+ const promptFile = input.promptFile?.trim() ?? "";
641
+ const promptJson = input.promptJson?.trim() ?? "";
642
+ if ((!promptFile && !promptJson) || (promptFile && promptJson)) {
643
+ throw new Error("worker_grok_prompt_source_invalid");
644
+ }
645
+ const args = [
646
+ promptJson ? "--prompt-json" : "--prompt-file",
647
+ promptJson || promptFile,
648
+ "--cwd",
649
+ input.workspaceDir,
650
+ "--model",
651
+ model,
652
+ "--reasoning-effort",
653
+ reasoningEffort,
654
+ "--output-format",
655
+ "streaming-messages-json",
656
+ "--always-approve",
657
+ "--sandbox",
658
+ "devbox",
659
+ "--no-subagents",
660
+ "--no-memory",
661
+ "--no-auto-update",
662
+ "--verbatim",
663
+ ];
664
+ const resumeSessionId = input.resumeSessionId?.trim() ?? "";
665
+ if (resumeSessionId) {
666
+ args.push("--resume", resumeSessionId);
593
667
  }
594
- args.push('-');
595
668
  return args;
596
669
  }
597
670
  function readCodexSandboxMode(env = process.env) {
598
671
  const raw = env.PLAYDROP_WORKER_CODEX_SANDBOX?.trim();
599
672
  if (!raw) {
600
- return 'danger-full-access';
673
+ return "danger-full-access";
601
674
  }
602
- if (raw === 'danger-full-access' || raw === 'workspace-write' || raw === 'read-only') {
675
+ if (raw === "danger-full-access" || raw === "workspace-write" || raw === "read-only") {
603
676
  return raw;
604
677
  }
605
678
  throw new Error(`invalid_playdrop_worker_codex_sandbox:${raw}`);
@@ -607,30 +680,28 @@ function readCodexSandboxMode(env = process.env) {
607
680
  function buildClaudeExecArgs(input) {
608
681
  const model = input.model.trim();
609
682
  if (!model) {
610
- throw new Error('agent_task_assignment_model_missing');
683
+ throw new Error("agent_task_assignment_model_missing");
611
684
  }
612
685
  if (input.chrome && input.playwrightMcp) {
613
- throw new Error('claude_exec_browser_mode_conflict');
686
+ throw new Error("claude_exec_browser_mode_conflict");
614
687
  }
615
- const playwrightMcpConfigPath = typeof input.playwrightMcpConfigPath === 'string'
616
- ? input.playwrightMcpConfigPath.trim()
617
- : '';
688
+ const playwrightMcpConfigPath = typeof input.playwrightMcpConfigPath === "string" ? input.playwrightMcpConfigPath.trim() : "";
618
689
  if (input.playwrightMcp && !playwrightMcpConfigPath) {
619
- throw new Error('playwright_mcp_config_path_missing');
690
+ throw new Error("playwright_mcp_config_path_missing");
620
691
  }
621
692
  const permissionSettings = buildClaudePermissionSettings({
622
693
  workspaceDir: input.workspaceDir,
623
694
  denyReadRoots: input.denyReadRoots ?? [],
624
695
  playdropCliEnabled: input.playdropCliEnabled,
625
696
  });
626
- const permissionMode = input.chrome || input.playwrightMcp ? 'bypassPermissions' : 'acceptEdits';
697
+ const permissionMode = input.chrome || input.playwrightMcp ? "bypassPermissions" : "acceptEdits";
627
698
  // MCP tools are deferred behind ToolSearch in the Claude CLI; without it in the toolset a
628
699
  // session cannot reach any MCP server's tools no matter what --mcp-config provides.
629
700
  const tools = input.chrome
630
- ? [...CLAUDE_BASE_TOOL_NAMES, ...CLAUDE_CHROME_TOOL_NAMES].join(',')
701
+ ? [...CLAUDE_BASE_TOOL_NAMES, ...CLAUDE_CHROME_TOOL_NAMES].join(",")
631
702
  : input.playwrightMcp
632
- ? [...CLAUDE_BASE_TOOL_NAMES, 'ToolSearch'].join(',')
633
- : CLAUDE_BASE_TOOL_NAMES.join(',');
703
+ ? [...CLAUDE_BASE_TOOL_NAMES, "ToolSearch"].join(",")
704
+ : CLAUDE_BASE_TOOL_NAMES.join(",");
634
705
  const allowedPermissionRules = buildClaudeAllowedPermissionRules(input.workspaceDir, input.playdropCliEnabled);
635
706
  const allowedTools = input.chrome
636
707
  ? [...allowedPermissionRules, ...CLAUDE_CHROME_TOOL_NAMES]
@@ -638,76 +709,69 @@ function buildClaudeExecArgs(input) {
638
709
  ? [...allowedPermissionRules, PLAYWRIGHT_MCP_ALLOWED_TOOL_RULE]
639
710
  : allowedPermissionRules;
640
711
  const args = [
641
- '-p',
642
- '--strict-mcp-config',
643
- '--setting-sources',
644
- 'project',
645
- '--input-format',
646
- 'stream-json',
647
- '--model',
712
+ "-p",
713
+ "--strict-mcp-config",
714
+ "--setting-sources",
715
+ "project",
716
+ "--input-format",
717
+ "stream-json",
718
+ "--model",
648
719
  model,
649
- '--output-format',
650
- 'stream-json',
651
- '--verbose',
652
- '--include-partial-messages',
653
- '--permission-mode',
720
+ "--output-format",
721
+ "stream-json",
722
+ "--verbose",
723
+ "--include-partial-messages",
724
+ "--permission-mode",
654
725
  permissionMode,
655
- '--tools',
726
+ "--tools",
656
727
  tools,
657
- '--allowedTools',
728
+ "--allowedTools",
658
729
  ...allowedTools,
659
- '--disallowedTools',
730
+ "--disallowedTools",
660
731
  ...buildClaudeDeniedPermissionRules(input.denyReadRoots ?? []),
661
- '--settings',
732
+ "--settings",
662
733
  JSON.stringify(permissionSettings),
663
734
  ];
664
735
  if (input.chrome) {
665
- args.unshift('--chrome');
736
+ args.unshift("--chrome");
666
737
  }
667
738
  if (input.playwrightMcp) {
668
- args.push('--mcp-config', playwrightMcpConfigPath);
739
+ args.push("--mcp-config", playwrightMcpConfigPath);
669
740
  }
670
- const pluginDir = typeof input.pluginDir === 'string' ? input.pluginDir.trim() : '';
741
+ const pluginDir = typeof input.pluginDir === "string" ? input.pluginDir.trim() : "";
671
742
  if (pluginDir) {
672
- args.push('--plugin-dir', pluginDir);
743
+ args.push("--plugin-dir", pluginDir);
673
744
  }
674
- const effort = typeof input.effort === 'string' ? input.effort.trim() : '';
745
+ const effort = typeof input.effort === "string" ? input.effort.trim() : "";
675
746
  if (effort) {
676
- args.push('--effort', effort);
747
+ args.push("--effort", effort);
677
748
  }
678
- const resumeSessionId = input.resumeSessionId?.trim() ?? '';
749
+ const resumeSessionId = input.resumeSessionId?.trim() ?? "";
679
750
  if (resumeSessionId) {
680
- args.push('--resume', resumeSessionId);
751
+ args.push("--resume", resumeSessionId);
681
752
  }
682
753
  return args;
683
754
  }
684
- const CLAUDE_BASE_TOOL_NAMES = [
685
- 'Bash',
686
- 'Edit',
687
- 'Write',
688
- 'Read',
689
- 'Glob',
690
- 'Grep',
691
- ];
755
+ const CLAUDE_BASE_TOOL_NAMES = ["Bash", "Edit", "Write", "Read", "Glob", "Grep"];
692
756
  // Pinned deliberately: agent-CLI and MCP versions on workers only change through releases,
693
757
  // never through @latest drift (see the 2026-07-13 auto-update incident).
694
- exports.PLAYWRIGHT_MCP_VERSION = '0.0.78';
695
- const PLAYWRIGHT_MCP_ALLOWED_TOOL_RULE = 'mcp__playwright';
758
+ exports.PLAYWRIGHT_MCP_VERSION = "0.0.78";
759
+ const PLAYWRIGHT_MCP_ALLOWED_TOOL_RULE = "mcp__playwright";
696
760
  const requireFromWorkerRuntime = (0, node_module_1.createRequire)(__filename);
697
761
  function resolvePlaywrightMcpCliPath() {
698
762
  let packageJsonPath;
699
763
  let packageJson;
700
764
  try {
701
- packageJsonPath = requireFromWorkerRuntime.resolve('@playwright/mcp/package.json');
702
- packageJson = requireFromWorkerRuntime('@playwright/mcp/package.json');
765
+ packageJsonPath = requireFromWorkerRuntime.resolve("@playwright/mcp/package.json");
766
+ packageJson = requireFromWorkerRuntime("@playwright/mcp/package.json");
703
767
  }
704
768
  catch {
705
769
  throw new Error(`worker_preflight_playwright_mcp_missing:@playwright/mcp@${exports.PLAYWRIGHT_MCP_VERSION}`);
706
770
  }
707
771
  if (packageJson.version !== exports.PLAYWRIGHT_MCP_VERSION) {
708
- throw new Error(`worker_preflight_playwright_mcp_version:expected=${exports.PLAYWRIGHT_MCP_VERSION}:actual=${packageJson.version ?? 'missing'}`);
772
+ throw new Error(`worker_preflight_playwright_mcp_version:expected=${exports.PLAYWRIGHT_MCP_VERSION}:actual=${packageJson.version ?? "missing"}`);
709
773
  }
710
- const cliPath = node_path_1.default.join(node_path_1.default.dirname(packageJsonPath), 'cli.js');
774
+ const cliPath = node_path_1.default.join(node_path_1.default.dirname(packageJsonPath), "cli.js");
711
775
  if (!(0, node_fs_1.existsSync)(cliPath)) {
712
776
  throw new Error(`worker_preflight_playwright_mcp_missing:${cliPath}`);
713
777
  }
@@ -717,13 +781,7 @@ function buildPlaywrightMcpCommand(surface) {
717
781
  const surfaceArgs = surface ? (0, surfaceProfiles_1.buildPlaywrightMcpSurfaceArgs)(surface) : [];
718
782
  return {
719
783
  command: process.execPath,
720
- args: [
721
- resolvePlaywrightMcpCliPath(),
722
- '--browser',
723
- 'chrome',
724
- '--isolated',
725
- ...surfaceArgs,
726
- ],
784
+ args: [resolvePlaywrightMcpCliPath(), "--browser", "chrome", "--isolated", ...surfaceArgs],
727
785
  };
728
786
  }
729
787
  function buildPlaywrightMcpServerConfig(surface) {
@@ -738,51 +796,51 @@ function buildPlaywrightMcpServerConfig(surface) {
738
796
  };
739
797
  }
740
798
  const CLAUDE_CHROME_TOOL_NAMES = [
741
- 'mcp__claude-in-chrome__browser_batch',
742
- 'mcp__claude-in-chrome__computer',
743
- 'mcp__claude-in-chrome__file_upload',
744
- 'mcp__claude-in-chrome__find',
745
- 'mcp__claude-in-chrome__form_input',
746
- 'mcp__claude-in-chrome__get_page_text',
747
- 'mcp__claude-in-chrome__javascript_tool',
748
- 'mcp__claude-in-chrome__list_connected_browsers',
749
- 'mcp__claude-in-chrome__navigate',
750
- 'mcp__claude-in-chrome__read_console_messages',
751
- 'mcp__claude-in-chrome__read_network_requests',
752
- 'mcp__claude-in-chrome__read_page',
753
- 'mcp__claude-in-chrome__resize_window',
754
- 'mcp__claude-in-chrome__select_browser',
755
- 'mcp__claude-in-chrome__shortcuts_execute',
756
- 'mcp__claude-in-chrome__shortcuts_list',
757
- 'mcp__claude-in-chrome__switch_browser',
758
- 'mcp__claude-in-chrome__tabs_close_mcp',
759
- 'mcp__claude-in-chrome__tabs_context_mcp',
760
- 'mcp__claude-in-chrome__tabs_create_mcp',
761
- 'mcp__claude-in-chrome__upload_image',
799
+ "mcp__claude-in-chrome__browser_batch",
800
+ "mcp__claude-in-chrome__computer",
801
+ "mcp__claude-in-chrome__file_upload",
802
+ "mcp__claude-in-chrome__find",
803
+ "mcp__claude-in-chrome__form_input",
804
+ "mcp__claude-in-chrome__get_page_text",
805
+ "mcp__claude-in-chrome__javascript_tool",
806
+ "mcp__claude-in-chrome__list_connected_browsers",
807
+ "mcp__claude-in-chrome__navigate",
808
+ "mcp__claude-in-chrome__read_console_messages",
809
+ "mcp__claude-in-chrome__read_network_requests",
810
+ "mcp__claude-in-chrome__read_page",
811
+ "mcp__claude-in-chrome__resize_window",
812
+ "mcp__claude-in-chrome__select_browser",
813
+ "mcp__claude-in-chrome__shortcuts_execute",
814
+ "mcp__claude-in-chrome__shortcuts_list",
815
+ "mcp__claude-in-chrome__switch_browser",
816
+ "mcp__claude-in-chrome__tabs_close_mcp",
817
+ "mcp__claude-in-chrome__tabs_context_mcp",
818
+ "mcp__claude-in-chrome__tabs_create_mcp",
819
+ "mcp__claude-in-chrome__upload_image",
762
820
  ];
763
821
  const CLAUDE_BUILD_PERMISSION_RULES = [
764
- 'Glob',
765
- 'Grep',
766
- 'Bash(playdrop *)',
767
- 'Bash(codex *)',
768
- 'Bash(./bin/playdrop *)',
769
- 'Bash(../bin/playdrop *)',
770
- 'Bash(bin/playdrop *)',
771
- 'Bash(node *)',
772
- 'Bash(npm *)',
773
- 'Bash(mkdir *)',
774
- 'Bash(cp *)',
775
- 'Bash(mv *)',
776
- 'Bash(file *)',
777
- 'Bash(curl *)',
778
- 'Bash(sips *)',
779
- 'Bash(ls *)',
780
- 'Bash(pwd)',
781
- 'Bash(rg *)',
782
- 'Bash(which *)',
783
- 'Bash(wc *)',
784
- 'Bash(stat *)',
785
- 'Bash(du *)',
822
+ "Glob",
823
+ "Grep",
824
+ "Bash(playdrop *)",
825
+ "Bash(codex *)",
826
+ "Bash(./bin/playdrop *)",
827
+ "Bash(../bin/playdrop *)",
828
+ "Bash(bin/playdrop *)",
829
+ "Bash(node *)",
830
+ "Bash(npm *)",
831
+ "Bash(mkdir *)",
832
+ "Bash(cp *)",
833
+ "Bash(mv *)",
834
+ "Bash(file *)",
835
+ "Bash(curl *)",
836
+ "Bash(sips *)",
837
+ "Bash(ls *)",
838
+ "Bash(pwd)",
839
+ "Bash(rg *)",
840
+ "Bash(which *)",
841
+ "Bash(wc *)",
842
+ "Bash(stat *)",
843
+ "Bash(du *)",
786
844
  ];
787
845
  function normalizeClaudePermissionPath(value) {
788
846
  const trimmed = value.trim();
@@ -790,29 +848,27 @@ function normalizeClaudePermissionPath(value) {
790
848
  return null;
791
849
  }
792
850
  if (/^\/[^/]/.test(trimmed)) {
793
- return node_path_1.default.posix.resolve(trimmed).replace(/\/+$/, '');
851
+ return node_path_1.default.posix.resolve(trimmed).replace(/\/+$/, "");
794
852
  }
795
853
  if (/^[A-Za-z]:[\\/]/.test(trimmed) || /^\\\\/.test(trimmed)) {
796
- return node_path_1.default.win32.resolve(trimmed).replace(/\\/g, '/').replace(/\/+$/, '');
854
+ return node_path_1.default.win32.resolve(trimmed).replace(/\\/g, "/").replace(/\/+$/, "");
797
855
  }
798
- return node_path_1.default.resolve(trimmed).replace(/\\/g, '/').replace(/\/+$/, '');
856
+ return node_path_1.default.resolve(trimmed).replace(/\\/g, "/").replace(/\/+$/, "");
799
857
  }
800
858
  function buildClaudeAllowedPermissionRules(workspaceDir, playdropCliEnabled = true) {
801
- const workspaceRoot = typeof workspaceDir === 'string' && workspaceDir.trim()
802
- ? normalizeClaudePermissionPath(workspaceDir)
803
- : null;
859
+ const workspaceRoot = typeof workspaceDir === "string" && workspaceDir.trim() ? normalizeClaudePermissionPath(workspaceDir) : null;
804
860
  if (!workspaceRoot) {
805
- throw new Error('worker_claude_workspace_missing');
861
+ throw new Error("worker_claude_workspace_missing");
806
862
  }
807
- const absoluteWorkspacePattern = `//${workspaceRoot.replace(/^\/+/, '')}/**`;
808
- const managedImagePython = node_path_1.default.join(node_os_1.default.homedir(), '.cache', 'playdrop', 'make-2d-asset-pack', 'venv-v1', 'bin', 'python');
863
+ const absoluteWorkspacePattern = `//${workspaceRoot.replace(/^\/+/, "")}/**`;
864
+ const managedImagePython = node_path_1.default.join(node_os_1.default.homedir(), ".cache", "playdrop", "make-2d-asset-pack", "venv-v1", "bin", "python");
809
865
  return [
810
866
  `Read(${absoluteWorkspacePattern})`,
811
867
  `Edit(${absoluteWorkspacePattern})`,
812
868
  `Write(${absoluteWorkspacePattern})`,
813
869
  `Bash(${managedImagePython} *)`,
814
870
  ...(playdropCliEnabled ? [`Bash(${workspaceRoot}/bin/playdrop *)`] : []),
815
- ...CLAUDE_BUILD_PERMISSION_RULES.filter((rule) => (playdropCliEnabled || !rule.toLowerCase().includes('playdrop'))),
871
+ ...CLAUDE_BUILD_PERMISSION_RULES.filter((rule) => playdropCliEnabled || !rule.toLowerCase().includes("playdrop")),
816
872
  ];
817
873
  }
818
874
  function buildClaudePermissionSettings(input = {}) {
@@ -824,16 +880,13 @@ function buildClaudePermissionSettings(input = {}) {
824
880
  };
825
881
  }
826
882
  function buildClaudeDeniedPermissionRules(denyReadRoots = []) {
827
- const deny = new Set([
828
- 'Bash(rm *)',
829
- 'Bash(git *)',
830
- ]);
883
+ const deny = new Set(["Bash(rm *)", "Bash(git *)"]);
831
884
  for (const rawRoot of denyReadRoots) {
832
885
  const root = normalizeClaudePermissionPath(rawRoot);
833
886
  if (!root) {
834
887
  continue;
835
888
  }
836
- deny.add(`Read(//${root.replace(/^\/+/, '')}/**)`);
889
+ deny.add(`Read(//${root.replace(/^\/+/, "")}/**)`);
837
890
  deny.add(`Bash(* ${root}*)`);
838
891
  }
839
892
  return [...deny];
@@ -841,40 +894,40 @@ function buildClaudeDeniedPermissionRules(denyReadRoots = []) {
841
894
  function buildWorkerChildEnv(input) {
842
895
  const base = input.baseEnv ?? process.env;
843
896
  const child = {};
844
- for (const key of ['HOME', 'USER', 'SHELL', 'TMPDIR', 'LANG', 'TERM']) {
897
+ for (const key of ["HOME", "USER", "SHELL", "TMPDIR", "LANG", "TERM"]) {
845
898
  const value = base[key];
846
- if (typeof value === 'string') {
899
+ if (typeof value === "string") {
847
900
  child[key] = value;
848
901
  }
849
902
  }
850
903
  for (const [key, value] of Object.entries(base)) {
851
- if (key.startsWith('LC_') && typeof value === 'string') {
904
+ if (key.startsWith("LC_") && typeof value === "string") {
852
905
  child[key] = value;
853
906
  }
854
907
  }
855
908
  if (input.homeDir !== undefined) {
856
909
  const homeDir = input.homeDir.trim();
857
910
  if (!homeDir || !node_path_1.default.isAbsolute(homeDir)) {
858
- throw new Error('invalid_worker_child_home_dir');
911
+ throw new Error("invalid_worker_child_home_dir");
859
912
  }
860
913
  child.HOME = homeDir;
861
914
  }
862
915
  const workerHomeDir = input.workerHomeDir.trim();
863
916
  if (!workerHomeDir || !node_path_1.default.isAbsolute(workerHomeDir)) {
864
- throw new Error('invalid_worker_child_worker_home_dir');
917
+ throw new Error("invalid_worker_child_worker_home_dir");
865
918
  }
866
919
  child.PLAYDROP_WORKER_HOME = workerHomeDir;
867
920
  if (input.codexHomeDir !== undefined) {
868
921
  const codexHomeDir = input.codexHomeDir.trim();
869
922
  if (!codexHomeDir || !node_path_1.default.isAbsolute(codexHomeDir)) {
870
- throw new Error('invalid_worker_child_codex_home_dir');
923
+ throw new Error("invalid_worker_child_codex_home_dir");
871
924
  }
872
925
  child.CODEX_HOME = codexHomeDir;
873
926
  }
874
927
  if (input.claudeConfigDir !== undefined) {
875
928
  const claudeConfigDir = input.claudeConfigDir.trim();
876
929
  if (!claudeConfigDir || !node_path_1.default.isAbsolute(claudeConfigDir)) {
877
- throw new Error('invalid_worker_child_claude_config_dir');
930
+ throw new Error("invalid_worker_child_claude_config_dir");
878
931
  }
879
932
  child.CLAUDE_CONFIG_DIR = claudeConfigDir;
880
933
  }
@@ -885,45 +938,44 @@ function buildWorkerChildEnv(input) {
885
938
  if (input.playdropConfigPath !== undefined) {
886
939
  const playdropConfigPath = input.playdropConfigPath.trim();
887
940
  if (!playdropConfigPath || !node_path_1.default.isAbsolute(playdropConfigPath)) {
888
- throw new Error('invalid_worker_child_playdrop_config_path');
941
+ throw new Error("invalid_worker_child_playdrop_config_path");
889
942
  }
890
943
  child.PLAYDROP_CONFIG_PATH = playdropConfigPath;
891
944
  }
892
945
  if (input.playwrightBrowsersPath !== undefined) {
893
946
  const playwrightBrowsersPath = input.playwrightBrowsersPath.trim();
894
947
  if (!playwrightBrowsersPath || !node_path_1.default.isAbsolute(playwrightBrowsersPath)) {
895
- throw new Error('invalid_worker_playwright_browsers_path');
948
+ throw new Error("invalid_worker_playwright_browsers_path");
896
949
  }
897
950
  child.PLAYWRIGHT_BROWSERS_PATH = playwrightBrowsersPath;
898
951
  }
899
- child.PATH = typeof base.PATH === 'string' && base.PATH
900
- ? `${input.binDir}${node_path_1.default.delimiter}${base.PATH}`
901
- : input.binDir;
952
+ child.PATH =
953
+ typeof base.PATH === "string" && base.PATH ? `${input.binDir}${node_path_1.default.delimiter}${base.PATH}` : input.binDir;
902
954
  for (const key of [
903
- 'PLAYDROP_API_BASE',
955
+ "PLAYDROP_API_BASE",
904
956
  `PLAYDROP_API_BASE_${input.envName.toUpperCase()}`,
905
- 'PLAYDROP_AI_BASE',
957
+ "PLAYDROP_AI_BASE",
906
958
  `PLAYDROP_AI_BASE_${input.envName.toUpperCase()}`,
907
959
  ]) {
908
960
  const value = base[key];
909
- if (typeof value === 'string') {
961
+ if (typeof value === "string") {
910
962
  child[key] = value;
911
963
  }
912
964
  }
913
- child.PLAYDROP_WORKER_CONTEXT = '1';
965
+ child.PLAYDROP_WORKER_CONTEXT = "1";
914
966
  const taskToken = input.taskToken.trim();
915
967
  if (!taskToken) {
916
- throw new Error('invalid_worker_task_token');
968
+ throw new Error("invalid_worker_task_token");
917
969
  }
918
970
  if (!Number.isInteger(input.attempt) || input.attempt <= 0) {
919
- throw new Error('invalid_worker_task_attempt');
971
+ throw new Error("invalid_worker_task_attempt");
920
972
  }
921
973
  child.PLAYDROP_WORKER_TASK_ID = String(input.taskId);
922
974
  child.PLAYDROP_WORKER_TASK_TOKEN = taskToken;
923
975
  child.PLAYDROP_WORKER_TASK_ATTEMPT = String(input.attempt);
924
976
  if (input.devPort !== undefined) {
925
977
  if (!Number.isInteger(input.devPort) || input.devPort <= 0 || input.devPort > 65535) {
926
- throw new Error('invalid_worker_task_dev_port');
978
+ throw new Error("invalid_worker_task_dev_port");
927
979
  }
928
980
  child.PLAYDROP_WORKER_TASK_DEV_PORT = String(input.devPort);
929
981
  child.PLAYDROP_DEV_ROUTER_PORT = String(input.devPort);
@@ -937,43 +989,43 @@ function buildCleanRoomChildEnv(input) {
937
989
  const base = input.baseEnv ?? process.env;
938
990
  const child = {};
939
991
  for (const key of [
940
- 'HOME',
941
- 'USER',
942
- 'SHELL',
943
- 'TMPDIR',
944
- 'LANG',
945
- 'TERM',
946
- 'ANTHROPIC_API_KEY',
947
- 'OPENAI_API_KEY',
948
- 'HTTP_PROXY',
949
- 'HTTPS_PROXY',
950
- 'ALL_PROXY',
951
- 'NO_PROXY',
992
+ "HOME",
993
+ "USER",
994
+ "SHELL",
995
+ "TMPDIR",
996
+ "LANG",
997
+ "TERM",
998
+ "ANTHROPIC_API_KEY",
999
+ "OPENAI_API_KEY",
1000
+ "HTTP_PROXY",
1001
+ "HTTPS_PROXY",
1002
+ "ALL_PROXY",
1003
+ "NO_PROXY",
952
1004
  ]) {
953
1005
  const value = base[key];
954
- if (typeof value === 'string')
1006
+ if (typeof value === "string")
955
1007
  child[key] = value;
956
1008
  }
957
1009
  for (const [key, value] of Object.entries(base)) {
958
- if (key.startsWith('LC_') && typeof value === 'string')
1010
+ if (key.startsWith("LC_") && typeof value === "string")
959
1011
  child[key] = value;
960
1012
  }
961
1013
  if (input.homeDir !== undefined) {
962
1014
  const homeDir = input.homeDir.trim();
963
1015
  if (!homeDir || !node_path_1.default.isAbsolute(homeDir))
964
- throw new Error('invalid_worker_child_home_dir');
1016
+ throw new Error("invalid_worker_child_home_dir");
965
1017
  child.HOME = homeDir;
966
1018
  }
967
1019
  if (input.codexHomeDir !== undefined) {
968
1020
  const codexHomeDir = input.codexHomeDir.trim();
969
1021
  if (!codexHomeDir || !node_path_1.default.isAbsolute(codexHomeDir))
970
- throw new Error('invalid_worker_child_codex_home_dir');
1022
+ throw new Error("invalid_worker_child_codex_home_dir");
971
1023
  child.CODEX_HOME = codexHomeDir;
972
1024
  }
973
- const safeHostPath = (base.PATH ?? '').split(node_path_1.default.delimiter).filter((directory) => {
1025
+ const safeHostPath = (base.PATH ?? "").split(node_path_1.default.delimiter).filter((directory) => {
974
1026
  if (!directory || !node_path_1.default.isAbsolute(directory))
975
1027
  return false;
976
- return !(0, node_fs_1.existsSync)(node_path_1.default.join(directory, process.platform === 'win32' ? 'playdrop.exe' : 'playdrop'));
1028
+ return !(0, node_fs_1.existsSync)(node_path_1.default.join(directory, process.platform === "win32" ? "playdrop.exe" : "playdrop"));
977
1029
  });
978
1030
  child.PATH = [input.binDir, ...safeHostPath].join(node_path_1.default.delimiter);
979
1031
  return child;