@playdrop/playdrop-cli 0.16.2 → 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
@@ -22,30 +22,27 @@ const node_http_1 = __importDefault(require("node:http"));
22
22
  const node_path_1 = require("node:path");
23
23
  const npmProcess_1 = require("./npmProcess");
24
24
  exports.DEV_ROUTER_PORT = 8888;
25
- const DEV_ROUTER_HOST = '127.0.0.1';
26
- const CONTROL_PREFIX = '/_playdrop';
25
+ const DEV_ROUTER_HOST = "127.0.0.1";
26
+ const CONTROL_PREFIX = "/_playdrop";
27
27
  const DEV_ROUTER_PROTOCOL_VERSION = 3;
28
- const APPROVED_PLAYDROP_WEB_ORIGINS = new Set([
29
- 'https://playdrop.ai',
30
- 'https://www.playdrop.ai',
31
- ]);
28
+ const APPROVED_PLAYDROP_WEB_ORIGINS = new Set(["https://playdrop.ai", "https://www.playdrop.ai"]);
32
29
  const CONTENT_TYPE_BY_EXTENSION = {
33
- '.html': 'text/html; charset=utf-8',
34
- '.js': 'application/javascript; charset=utf-8',
35
- '.mjs': 'application/javascript; charset=utf-8',
36
- '.cjs': 'application/javascript; charset=utf-8',
37
- '.css': 'text/css; charset=utf-8',
38
- '.json': 'application/json; charset=utf-8',
39
- '.png': 'image/png',
40
- '.jpg': 'image/jpeg',
41
- '.jpeg': 'image/jpeg',
42
- '.svg': 'image/svg+xml',
43
- '.webp': 'image/webp',
44
- '.glb': 'model/gltf-binary',
45
- '.gltf': 'model/gltf+json',
46
- '.wasm': 'application/wasm',
47
- '.mp4': 'video/mp4',
48
- '.webm': 'video/webm',
30
+ ".html": "text/html; charset=utf-8",
31
+ ".js": "application/javascript; charset=utf-8",
32
+ ".mjs": "application/javascript; charset=utf-8",
33
+ ".cjs": "application/javascript; charset=utf-8",
34
+ ".css": "text/css; charset=utf-8",
35
+ ".json": "application/json; charset=utf-8",
36
+ ".png": "image/png",
37
+ ".jpg": "image/jpeg",
38
+ ".jpeg": "image/jpeg",
39
+ ".svg": "image/svg+xml",
40
+ ".webp": "image/webp",
41
+ ".glb": "model/gltf-binary",
42
+ ".gltf": "model/gltf+json",
43
+ ".wasm": "application/wasm",
44
+ ".mp4": "video/mp4",
45
+ ".webm": "video/webm",
49
46
  };
50
47
  const routerMountsById = new Map();
51
48
  const routerMountIdsByKey = new Map();
@@ -64,37 +61,37 @@ function resolveApprovedDevRouterOrigin(originHeader) {
64
61
  if (APPROVED_PLAYDROP_WEB_ORIGINS.has(parsedOrigin.origin)) {
65
62
  return parsedOrigin.origin;
66
63
  }
67
- const isLocalWebOrigin = (parsedOrigin.protocol === 'http:' || parsedOrigin.protocol === 'https:')
68
- && (parsedOrigin.hostname === 'localhost' || parsedOrigin.hostname === '127.0.0.1');
64
+ const isLocalWebOrigin = (parsedOrigin.protocol === "http:" || parsedOrigin.protocol === "https:") &&
65
+ (parsedOrigin.hostname === "localhost" || parsedOrigin.hostname === "127.0.0.1");
69
66
  return isLocalWebOrigin ? parsedOrigin.origin : null;
70
67
  }
71
68
  function resolveContentType(filePath) {
72
69
  const extension = (0, node_path_1.extname)(filePath).toLowerCase();
73
- return CONTENT_TYPE_BY_EXTENSION[extension] || 'application/octet-stream';
70
+ return CONTENT_TYPE_BY_EXTENSION[extension] || "application/octet-stream";
74
71
  }
75
72
  function getCliEntrypointPath() {
76
- return (0, node_path_1.resolve)(__dirname, '..', 'index.js');
73
+ return (0, node_path_1.resolve)(__dirname, "..", "index.js");
77
74
  }
78
75
  function buildMountKey(creatorUsername, appType, appName) {
79
76
  return `${creatorUsername}:${appType}:${appName}`;
80
77
  }
81
78
  function encodeMountConflictError(details) {
82
- const encoded = Buffer.from(JSON.stringify(details), 'utf8').toString('base64url');
79
+ const encoded = Buffer.from(JSON.stringify(details), "utf8").toString("base64url");
83
80
  return `mount_conflict:${encoded}`;
84
81
  }
85
82
  function parseMountConflictError(message) {
86
- if (!message.startsWith('mount_conflict:')) {
83
+ if (!message.startsWith("mount_conflict:")) {
87
84
  return null;
88
85
  }
89
86
  try {
90
- const decoded = Buffer.from(message.slice('mount_conflict:'.length), 'base64url').toString('utf8');
87
+ const decoded = Buffer.from(message.slice("mount_conflict:".length), "base64url").toString("utf8");
91
88
  const payload = JSON.parse(decoded);
92
- if (typeof payload.ref !== 'string'
93
- || typeof payload.ownerPid !== 'number'
94
- || !Number.isInteger(payload.ownerPid)
95
- || payload.ownerPid <= 0
96
- || typeof payload.repoRoot !== 'string'
97
- || typeof payload.htmlPath !== 'string') {
89
+ if (typeof payload.ref !== "string" ||
90
+ typeof payload.ownerPid !== "number" ||
91
+ !Number.isInteger(payload.ownerPid) ||
92
+ payload.ownerPid <= 0 ||
93
+ typeof payload.repoRoot !== "string" ||
94
+ typeof payload.htmlPath !== "string") {
98
95
  return null;
99
96
  }
100
97
  return {
@@ -114,30 +111,30 @@ function buildLocalDevAppUrl(input) {
114
111
  }
115
112
  function respondWithBuffer(res, method, statusCode, contentType, payload) {
116
113
  res.statusCode = statusCode;
117
- res.setHeader('Content-Type', contentType);
118
- res.setHeader('Content-Length', String(payload.length));
119
- res.setHeader('Cache-Control', 'no-store');
120
- if (method === 'HEAD') {
114
+ res.setHeader("Content-Type", contentType);
115
+ res.setHeader("Content-Length", String(payload.length));
116
+ res.setHeader("Cache-Control", "no-store");
117
+ if (method === "HEAD") {
121
118
  res.end();
122
119
  return;
123
120
  }
124
121
  res.end(payload);
125
122
  }
126
123
  function respondWithText(res, method, statusCode, message) {
127
- const payload = Buffer.from(message, 'utf8');
128
- respondWithBuffer(res, method, statusCode, 'text/plain; charset=utf-8', payload);
124
+ const payload = Buffer.from(message, "utf8");
125
+ respondWithBuffer(res, method, statusCode, "text/plain; charset=utf-8", payload);
129
126
  }
130
127
  function sendJson(res, statusCode, payload) {
131
- const body = Buffer.from(JSON.stringify(payload), 'utf8');
132
- respondWithBuffer(res, 'GET', statusCode, 'application/json; charset=utf-8', body);
128
+ const body = Buffer.from(JSON.stringify(payload), "utf8");
129
+ respondWithBuffer(res, "GET", statusCode, "application/json; charset=utf-8", body);
133
130
  }
134
131
  function isPidAlive(pid) {
135
132
  if (!Number.isInteger(pid) || pid <= 0) {
136
133
  return false;
137
134
  }
138
- if (process.platform === 'linux') {
135
+ if (process.platform === "linux") {
139
136
  const info = readLinuxProcessInfo(pid);
140
- return info !== null && info.state !== 'Z';
137
+ return info !== null && info.state !== "Z";
141
138
  }
142
139
  try {
143
140
  process.kill(pid, 0);
@@ -148,25 +145,28 @@ function isPidAlive(pid) {
148
145
  }
149
146
  }
150
147
  function readLinuxProcessInfo(pid) {
151
- if (!Number.isInteger(pid) || pid <= 0 || process.platform !== 'linux') {
148
+ if (!Number.isInteger(pid) || pid <= 0 || process.platform !== "linux") {
152
149
  return null;
153
150
  }
154
151
  try {
155
- const raw = (0, node_fs_1.readFileSync)(`/proc/${pid}/stat`, 'utf8');
156
- const commandEnd = raw.lastIndexOf(')');
152
+ const raw = (0, node_fs_1.readFileSync)(`/proc/${pid}/stat`, "utf8");
153
+ const commandEnd = raw.lastIndexOf(")");
157
154
  if (commandEnd < 0) {
158
155
  return null;
159
156
  }
160
- const fields = raw.slice(commandEnd + 2).trim().split(/\s+/u);
157
+ const fields = raw
158
+ .slice(commandEnd + 2)
159
+ .trim()
160
+ .split(/\s+/u);
161
161
  const state = fields[0];
162
162
  const groupId = Number(fields[2]);
163
- if (typeof state !== 'string' || !Number.isInteger(groupId) || groupId <= 0) {
163
+ if (typeof state !== "string" || !Number.isInteger(groupId) || groupId <= 0) {
164
164
  return null;
165
165
  }
166
166
  return { state, groupId };
167
167
  }
168
168
  catch (error) {
169
- if (error?.code === 'ENOENT') {
169
+ if (error?.code === "ENOENT") {
170
170
  return null;
171
171
  }
172
172
  throw error;
@@ -201,8 +201,8 @@ function findRouterMountByCreatorAndApp(creatorUsername, appName) {
201
201
  return match;
202
202
  }
203
203
  function resolveStaticPath(staticRoot, rawRelativePath) {
204
- const normalizedRelativePath = (0, node_path_1.normalize)(rawRelativePath.replace(/^\/+/, ''));
205
- if (!normalizedRelativePath || normalizedRelativePath === '.' || normalizedRelativePath.startsWith('..')) {
204
+ const normalizedRelativePath = (0, node_path_1.normalize)(rawRelativePath.replace(/^\/+/, ""));
205
+ if (!normalizedRelativePath || normalizedRelativePath === "." || normalizedRelativePath.startsWith("..")) {
206
206
  return null;
207
207
  }
208
208
  const absolutePath = (0, node_path_1.resolve)(staticRoot, normalizedRelativePath);
@@ -213,10 +213,10 @@ function resolveStaticPath(staticRoot, rawRelativePath) {
213
213
  return absolutePath;
214
214
  }
215
215
  function parseMountPath(pathname) {
216
- if (!pathname.startsWith('/apps/dev/')) {
216
+ if (!pathname.startsWith("/apps/dev/")) {
217
217
  return null;
218
218
  }
219
- const segments = pathname.split('/').filter(Boolean);
219
+ const segments = pathname.split("/").filter(Boolean);
220
220
  if (segments.length < 6) {
221
221
  return null;
222
222
  }
@@ -228,7 +228,7 @@ function parseMountPath(pathname) {
228
228
  }
229
229
  return {
230
230
  key: buildMountKey(decodeURIComponent(creatorUsername), decodeURIComponent(appType), decodeURIComponent(appName)),
231
- assetPath: rest.map((entry) => decodeURIComponent(entry)).join('/'),
231
+ assetPath: rest.map((entry) => decodeURIComponent(entry)).join("/"),
232
232
  };
233
233
  }
234
234
  function getOwnedRuntimeAssetFile(mount, ownedAssetName, role) {
@@ -243,19 +243,19 @@ async function readJsonBody(req) {
243
243
  for await (const chunk of req) {
244
244
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
245
245
  }
246
- const raw = Buffer.concat(chunks).toString('utf8').trim();
246
+ const raw = Buffer.concat(chunks).toString("utf8").trim();
247
247
  return raw ? JSON.parse(raw) : {};
248
248
  }
249
249
  function spawnDevScript(projectInfo) {
250
- if (!projectInfo.projectDir || !projectInfo.packageJson || typeof projectInfo.packageJson.scripts?.dev !== 'string') {
250
+ if (!projectInfo.projectDir || !projectInfo.packageJson || typeof projectInfo.packageJson.scripts?.dev !== "string") {
251
251
  return null;
252
252
  }
253
- const npm = (0, npmProcess_1.resolveNpmInvocation)(['run', 'dev']);
253
+ const npm = (0, npmProcess_1.resolveNpmInvocation)(["run", "dev"]);
254
254
  const child = (0, node_child_process_1.spawn)(npm.command, npm.args, {
255
255
  cwd: projectInfo.projectDir,
256
- stdio: 'inherit',
256
+ stdio: "inherit",
257
257
  env: { ...process.env },
258
- detached: process.platform !== 'win32',
258
+ detached: process.platform !== "win32",
259
259
  });
260
260
  return child;
261
261
  }
@@ -266,7 +266,7 @@ function signalProcess(pid, signal, useGroup) {
266
266
  return true;
267
267
  }
268
268
  catch (error) {
269
- if (error?.code === 'ESRCH') {
269
+ if (error?.code === "ESRCH") {
270
270
  return false;
271
271
  }
272
272
  throw error;
@@ -276,13 +276,13 @@ function isProcessGroupAlive(pid) {
276
276
  if (!Number.isInteger(pid) || pid <= 0) {
277
277
  return false;
278
278
  }
279
- if (process.platform === 'linux') {
280
- for (const entry of (0, node_fs_1.readdirSync)('/proc', { withFileTypes: true })) {
279
+ if (process.platform === "linux") {
280
+ for (const entry of (0, node_fs_1.readdirSync)("/proc", { withFileTypes: true })) {
281
281
  if (!entry.isDirectory() || !/^\d+$/u.test(entry.name)) {
282
282
  continue;
283
283
  }
284
284
  const info = readLinuxProcessInfo(Number(entry.name));
285
- if (info && info.groupId === pid && info.state !== 'Z') {
285
+ if (info && info.groupId === pid && info.state !== "Z") {
286
286
  return true;
287
287
  }
288
288
  }
@@ -293,10 +293,10 @@ function isProcessGroupAlive(pid) {
293
293
  return true;
294
294
  }
295
295
  catch (error) {
296
- if (error?.code === 'ESRCH') {
296
+ if (error?.code === "ESRCH") {
297
297
  return false;
298
298
  }
299
- if (error?.code === 'EPERM') {
299
+ if (error?.code === "EPERM") {
300
300
  return true;
301
301
  }
302
302
  throw error;
@@ -315,7 +315,7 @@ async function waitForChildExit(child, timeoutMs) {
315
315
  }
316
316
  settled = true;
317
317
  clearTimeout(timeout);
318
- child.off('exit', onExit);
318
+ child.off("exit", onExit);
319
319
  resolvePromise(true);
320
320
  };
321
321
  const timeout = setTimeout(() => {
@@ -323,11 +323,11 @@ async function waitForChildExit(child, timeoutMs) {
323
323
  return;
324
324
  }
325
325
  settled = true;
326
- child.off('exit', onExit);
326
+ child.off("exit", onExit);
327
327
  resolvePromise(!pid || !isPidAlive(pid));
328
328
  }, timeoutMs);
329
329
  timeout.unref?.();
330
- child.once('exit', onExit);
330
+ child.once("exit", onExit);
331
331
  });
332
332
  }
333
333
  async function waitForProcessGroupExit(pid, timeoutMs) {
@@ -344,12 +344,12 @@ async function waitForProcessGroupExit(pid, timeoutMs) {
344
344
  return !isProcessGroupAlive(pid);
345
345
  }
346
346
  async function terminateWindowsProcessTree(pid, timeoutMs) {
347
- const windowsRoot = process.env.SystemRoot?.trim() || process.env.WINDIR?.trim() || 'C:\\Windows';
348
- const taskkillPath = (0, node_path_1.join)(windowsRoot, 'System32', 'taskkill.exe');
347
+ const windowsRoot = process.env.SystemRoot?.trim() || process.env.WINDIR?.trim() || "C:\\Windows";
348
+ const taskkillPath = (0, node_path_1.join)(windowsRoot, "System32", "taskkill.exe");
349
349
  await new Promise((resolvePromise) => {
350
350
  let settled = false;
351
- const taskkill = (0, node_child_process_1.spawn)(taskkillPath, ['/PID', String(pid), '/T', '/F'], {
352
- stdio: 'ignore',
351
+ const taskkill = (0, node_child_process_1.spawn)(taskkillPath, ["/PID", String(pid), "/T", "/F"], {
352
+ stdio: "ignore",
353
353
  windowsHide: true,
354
354
  });
355
355
  const settle = () => {
@@ -365,8 +365,8 @@ async function terminateWindowsProcessTree(pid, timeoutMs) {
365
365
  settle();
366
366
  }, timeoutMs);
367
367
  timeout.unref?.();
368
- taskkill.once('error', settle);
369
- taskkill.once('close', settle);
368
+ taskkill.once("error", settle);
369
+ taskkill.once("close", settle);
370
370
  });
371
371
  }
372
372
  async function terminateChildProcessTree(child, timeoutMs = 2000) {
@@ -374,20 +374,20 @@ async function terminateChildProcessTree(child, timeoutMs = 2000) {
374
374
  if (!child || !pid || !isPidAlive(pid)) {
375
375
  return;
376
376
  }
377
- if (process.platform === 'win32') {
377
+ if (process.platform === "win32") {
378
378
  await terminateWindowsProcessTree(pid, timeoutMs);
379
379
  if (isPidAlive(pid)) {
380
- signalProcess(pid, 'SIGKILL', false);
380
+ signalProcess(pid, "SIGKILL", false);
381
381
  await waitForChildExit(child, timeoutMs);
382
382
  }
383
383
  return;
384
384
  }
385
- signalProcess(pid, 'SIGTERM', true);
385
+ signalProcess(pid, "SIGTERM", true);
386
386
  const exited = await waitForProcessGroupExit(pid, timeoutMs);
387
387
  if (exited) {
388
388
  return;
389
389
  }
390
- signalProcess(pid, 'SIGKILL', true);
390
+ signalProcess(pid, "SIGKILL", true);
391
391
  await waitForProcessGroupExit(pid, timeoutMs);
392
392
  }
393
393
  async function fetchRouterJson(path, init = {}, port = exports.DEV_ROUTER_PORT) {
@@ -397,11 +397,11 @@ async function fetchRouterJson(path, init = {}, port = exports.DEV_ROUTER_PORT)
397
397
  return null;
398
398
  }
399
399
  const payload = await response.json().catch(() => null);
400
- throw new Error(typeof payload?.error === 'string'
400
+ throw new Error(typeof payload?.error === "string"
401
401
  ? payload.error
402
402
  : `router_request_failed:${response.status}`);
403
403
  }
404
- return await response.json();
404
+ return (await response.json());
405
405
  }
406
406
  async function fetchRouterHealth(port = exports.DEV_ROUTER_PORT, timeoutMs = 400) {
407
407
  const controller = new AbortController();
@@ -409,14 +409,14 @@ async function fetchRouterHealth(port = exports.DEV_ROUTER_PORT, timeoutMs = 400
409
409
  timeout.unref?.();
410
410
  try {
411
411
  const response = await fetch(`http://${DEV_ROUTER_HOST}:${port}${CONTROL_PREFIX}/health`, {
412
- method: 'GET',
412
+ method: "GET",
413
413
  signal: controller.signal,
414
414
  });
415
415
  if (!response.ok) {
416
416
  return null;
417
417
  }
418
418
  const payload = await response.json().catch(() => null);
419
- if (!payload || typeof payload !== 'object' || payload.status !== 'ok') {
419
+ if (!payload || typeof payload !== "object" || payload.status !== "ok") {
420
420
  return null;
421
421
  }
422
422
  return payload;
@@ -429,9 +429,9 @@ async function fetchRouterHealth(port = exports.DEV_ROUTER_PORT, timeoutMs = 400
429
429
  }
430
430
  }
431
431
  function isCompatibleRouterHealth(health) {
432
- return health.protocolVersion === DEV_ROUTER_PROTOCOL_VERSION
433
- && health.capabilities?.runtimeAssetManifest === true
434
- && health.capabilities?.runtimeAssetManifestLookup === true;
432
+ return (health.protocolVersion === DEV_ROUTER_PROTOCOL_VERSION &&
433
+ health.capabilities?.runtimeAssetManifest === true &&
434
+ health.capabilities?.runtimeAssetManifestLookup === true);
435
435
  }
436
436
  async function ensureDevRouterRunning(port = exports.DEV_ROUTER_PORT) {
437
437
  const existingHealth = await fetchRouterHealth(port);
@@ -444,10 +444,10 @@ async function ensureDevRouterRunning(port = exports.DEV_ROUTER_PORT) {
444
444
  const cliEntrypoint = getCliEntrypointPath();
445
445
  const childEnv = { ...process.env };
446
446
  delete childEnv.PLAYDROP_WORKER_CONTEXT;
447
- const child = (0, node_child_process_1.spawn)(process.execPath, [cliEntrypoint, 'project', '_dev-router', 'serve'], {
447
+ const child = (0, node_child_process_1.spawn)(process.execPath, [cliEntrypoint, "project", "_dev-router", "serve"], {
448
448
  cwd: resolveDevRouterWorkingDirectory(cliEntrypoint),
449
449
  detached: true,
450
- stdio: 'ignore',
450
+ stdio: "ignore",
451
451
  env: {
452
452
  ...childEnv,
453
453
  PLAYDROP_DEV_ROUTER_PORT: String(port),
@@ -462,22 +462,22 @@ async function ensureDevRouterRunning(port = exports.DEV_ROUTER_PORT) {
462
462
  }
463
463
  await new Promise((resolveTimeout) => setTimeout(resolveTimeout, 150));
464
464
  }
465
- throw new Error('dev_router_start_failed');
465
+ throw new Error("dev_router_start_failed");
466
466
  }
467
467
  function resolveDevRouterWorkingDirectory(cliEntrypoint) {
468
468
  return (0, node_path_1.dirname)((0, node_path_1.resolve)(cliEntrypoint));
469
469
  }
470
470
  async function registerDevMount(input, port = exports.DEV_ROUTER_PORT) {
471
471
  const response = await fetch(`http://${DEV_ROUTER_HOST}:${port}${CONTROL_PREFIX}/mounts`, {
472
- method: 'POST',
473
- headers: { 'Content-Type': 'application/json' },
472
+ method: "POST",
473
+ headers: { "Content-Type": "application/json" },
474
474
  body: JSON.stringify(input),
475
475
  });
476
- const payload = await response.json().catch(() => null);
476
+ const payload = (await response.json().catch(() => null));
477
477
  if (!response.ok || !payload) {
478
478
  throw new Error(`mount_register_failed:${response.status}`);
479
479
  }
480
- if ('error' in payload) {
480
+ if ("error" in payload) {
481
481
  throw new Error(encodeMountConflictError({
482
482
  ref: `${payload.creatorUsername}/${payload.appType}/${payload.appName}`,
483
483
  ownerPid: payload.ownerPid,
@@ -492,14 +492,14 @@ async function registerDevMount(input, port = exports.DEV_ROUTER_PORT) {
492
492
  }
493
493
  async function heartbeatDevMount(mountId, ownerPid, port = exports.DEV_ROUTER_PORT) {
494
494
  await fetchRouterJson(`${CONTROL_PREFIX}/mounts/${encodeURIComponent(mountId)}/heartbeat`, {
495
- method: 'POST',
496
- headers: { 'Content-Type': 'application/json' },
495
+ method: "POST",
496
+ headers: { "Content-Type": "application/json" },
497
497
  body: JSON.stringify({ ownerPid }),
498
498
  }, port);
499
499
  }
500
500
  async function unregisterDevMount(mountId, port = exports.DEV_ROUTER_PORT) {
501
501
  const response = await fetch(`http://${DEV_ROUTER_HOST}:${port}${CONTROL_PREFIX}/mounts/${encodeURIComponent(mountId)}`, {
502
- method: 'DELETE',
502
+ method: "DELETE",
503
503
  });
504
504
  if (!response.ok && response.status !== 404) {
505
505
  throw new Error(`mount_unregister_failed:${response.status}`);
@@ -508,17 +508,15 @@ async function unregisterDevMount(mountId, port = exports.DEV_ROUTER_PORT) {
508
508
  async function updateMountedDevRuntimeAssetManifest(input) {
509
509
  const port = input.port ?? exports.DEV_ROUTER_PORT;
510
510
  const response = await fetch(`http://${DEV_ROUTER_HOST}:${port}${CONTROL_PREFIX}/apps/dev/${encodeURIComponent(input.creatorUsername)}/${encodeURIComponent(input.appName)}/runtime-assets`, {
511
- method: 'POST',
512
- headers: { 'Content-Type': 'application/json' },
511
+ method: "POST",
512
+ headers: { "Content-Type": "application/json" },
513
513
  body: JSON.stringify({
514
514
  runtimeAssetManifest: input.runtimeAssetManifest ?? null,
515
515
  }),
516
516
  });
517
517
  if (!response.ok) {
518
- const payload = await response.json().catch(() => null);
519
- throw new Error(typeof payload?.error === 'string'
520
- ? payload.error
521
- : `runtime_asset_manifest_update_failed:${response.status}`);
518
+ const payload = (await response.json().catch(() => null));
519
+ throw new Error(typeof payload?.error === "string" ? payload.error : `runtime_asset_manifest_update_failed:${response.status}`);
522
520
  }
523
521
  }
524
522
  async function startDevServer(options) {
@@ -527,7 +525,7 @@ async function startDevServer(options) {
527
525
  let closing = false;
528
526
  const devProcess = spawnDevScript(projectInfo);
529
527
  if (devProcess) {
530
- devProcess.on('exit', code => {
528
+ devProcess.on("exit", (code) => {
531
529
  if (closing) {
532
530
  return;
533
531
  }
@@ -539,8 +537,8 @@ async function startDevServer(options) {
539
537
  const startedDevProcess = Boolean(devProcess);
540
538
  const staticRoot = (0, node_path_1.resolve)((0, node_path_1.dirname)(htmlPath));
541
539
  const repoRoot = (0, node_path_1.resolve)(projectInfo.projectDir ?? (0, node_path_1.dirname)(htmlPath));
542
- let mountId = '';
543
- let appUrl = '';
540
+ let mountId = "";
541
+ let appUrl = "";
544
542
  try {
545
543
  await ensureDevRouterRunning(port);
546
544
  const registeredMount = await registerDevMount({
@@ -600,7 +598,7 @@ async function isDevServerAvailable(input, timeoutMs = 1000) {
600
598
  ...input,
601
599
  port,
602
600
  }), {
603
- method: 'GET',
601
+ method: "GET",
604
602
  signal: controller.signal,
605
603
  });
606
604
  return response.ok;
@@ -615,34 +613,34 @@ async function isDevServerAvailable(input, timeoutMs = 1000) {
615
613
  function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
616
614
  let activePort = initialPort;
617
615
  const handleRequest = async (req, res) => {
618
- const method = req.method || 'GET';
619
- const allowedOrigin = resolveApprovedDevRouterOrigin(typeof req.headers.origin === 'string' ? req.headers.origin : undefined);
616
+ const method = req.method || "GET";
617
+ const allowedOrigin = resolveApprovedDevRouterOrigin(typeof req.headers.origin === "string" ? req.headers.origin : undefined);
620
618
  if (allowedOrigin) {
621
- res.setHeader('Access-Control-Allow-Origin', allowedOrigin);
619
+ res.setHeader("Access-Control-Allow-Origin", allowedOrigin);
622
620
  }
623
- res.setHeader('Vary', 'Origin');
624
- res.setHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS');
625
- res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Playdrop-Client, X-Playdrop-Client-Version, X-Playdrop-Client-Build, X-Playdrop-Platform, X-Playdrop-Platform-Version');
626
- res.setHeader('Access-Control-Allow-Private-Network', 'true');
627
- if (method === 'OPTIONS') {
621
+ res.setHeader("Vary", "Origin");
622
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
623
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Playdrop-Client, X-Playdrop-Client-Version, X-Playdrop-Client-Build, X-Playdrop-Platform, X-Playdrop-Platform-Version");
624
+ res.setHeader("Access-Control-Allow-Private-Network", "true");
625
+ if (method === "OPTIONS") {
628
626
  res.statusCode = 200;
629
- res.setHeader('Access-Control-Max-Age', '600');
627
+ res.setHeader("Access-Control-Max-Age", "600");
630
628
  res.end();
631
629
  return;
632
630
  }
633
631
  let requestUrl;
634
632
  try {
635
- requestUrl = new URL(req.url || '/', `http://${DEV_ROUTER_HOST}:${activePort}`);
633
+ requestUrl = new URL(req.url || "/", `http://${DEV_ROUTER_HOST}:${activePort}`);
636
634
  }
637
635
  catch {
638
- respondWithText(res, method, 400, 'Invalid URL path');
636
+ respondWithText(res, method, 400, "Invalid URL path");
639
637
  return;
640
638
  }
641
639
  const pathname = decodeURIComponent(requestUrl.pathname);
642
640
  const searchParams = requestUrl.searchParams;
643
- if (pathname === `${CONTROL_PREFIX}/health` && method === 'GET') {
641
+ if (pathname === `${CONTROL_PREFIX}/health` && method === "GET") {
644
642
  sendJson(res, 200, {
645
- status: 'ok',
643
+ status: "ok",
646
644
  protocolVersion: DEV_ROUTER_PROTOCOL_VERSION,
647
645
  capabilities: {
648
646
  runtimeAssetManifest: true,
@@ -651,17 +649,19 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
651
649
  });
652
650
  return;
653
651
  }
654
- if (pathname.startsWith(`${CONTROL_PREFIX}/apps/dev/`) && pathname.endsWith('/runtime-assets') && method === 'GET') {
652
+ if (pathname.startsWith(`${CONTROL_PREFIX}/apps/dev/`) &&
653
+ pathname.endsWith("/runtime-assets") &&
654
+ method === "GET") {
655
655
  cleanupStaleRouterMounts();
656
- const segments = pathname.split('/').filter(Boolean);
656
+ const segments = pathname.split("/").filter(Boolean);
657
657
  if (segments.length !== 6) {
658
- sendJson(res, 404, { error: 'runtime_asset_manifest_not_found' });
658
+ sendJson(res, 404, { error: "runtime_asset_manifest_not_found" });
659
659
  return;
660
660
  }
661
- const creatorUsername = decodeURIComponent(segments[3] ?? '');
662
- const appName = decodeURIComponent(segments[4] ?? '');
661
+ const creatorUsername = decodeURIComponent(segments[3] ?? "");
662
+ const appName = decodeURIComponent(segments[4] ?? "");
663
663
  if (!creatorUsername || !appName) {
664
- sendJson(res, 400, { error: 'invalid_runtime_asset_manifest_lookup' });
664
+ sendJson(res, 400, { error: "invalid_runtime_asset_manifest_lookup" });
665
665
  return;
666
666
  }
667
667
  let mount;
@@ -669,28 +669,30 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
669
669
  mount = findRouterMountByCreatorAndApp(creatorUsername, appName);
670
670
  }
671
671
  catch (error) {
672
- const message = error instanceof Error ? error.message : 'ambiguous_mount_lookup';
672
+ const message = error instanceof Error ? error.message : "ambiguous_mount_lookup";
673
673
  sendJson(res, 409, { error: message });
674
674
  return;
675
675
  }
676
676
  if (!mount?.runtimeAssetManifest) {
677
- sendJson(res, 404, { error: 'runtime_asset_manifest_not_found' });
677
+ sendJson(res, 404, { error: "runtime_asset_manifest_not_found" });
678
678
  return;
679
679
  }
680
680
  sendJson(res, 200, mount.runtimeAssetManifest.response);
681
681
  return;
682
682
  }
683
- if (pathname.startsWith(`${CONTROL_PREFIX}/apps/dev/`) && pathname.endsWith('/runtime-assets') && method === 'POST') {
683
+ if (pathname.startsWith(`${CONTROL_PREFIX}/apps/dev/`) &&
684
+ pathname.endsWith("/runtime-assets") &&
685
+ method === "POST") {
684
686
  cleanupStaleRouterMounts();
685
- const segments = pathname.split('/').filter(Boolean);
687
+ const segments = pathname.split("/").filter(Boolean);
686
688
  if (segments.length !== 6) {
687
- sendJson(res, 404, { error: 'runtime_asset_manifest_not_found' });
689
+ sendJson(res, 404, { error: "runtime_asset_manifest_not_found" });
688
690
  return;
689
691
  }
690
- const creatorUsername = decodeURIComponent(segments[3] ?? '');
691
- const appName = decodeURIComponent(segments[4] ?? '');
692
+ const creatorUsername = decodeURIComponent(segments[3] ?? "");
693
+ const appName = decodeURIComponent(segments[4] ?? "");
692
694
  if (!creatorUsername || !appName) {
693
- sendJson(res, 400, { error: 'invalid_runtime_asset_manifest_lookup' });
695
+ sendJson(res, 400, { error: "invalid_runtime_asset_manifest_lookup" });
694
696
  return;
695
697
  }
696
698
  let mount;
@@ -698,12 +700,12 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
698
700
  mount = findRouterMountByCreatorAndApp(creatorUsername, appName);
699
701
  }
700
702
  catch (error) {
701
- const message = error instanceof Error ? error.message : 'ambiguous_mount_lookup';
703
+ const message = error instanceof Error ? error.message : "ambiguous_mount_lookup";
702
704
  sendJson(res, 409, { error: message });
703
705
  return;
704
706
  }
705
707
  if (!mount) {
706
- sendJson(res, 404, { error: 'runtime_asset_manifest_not_found' });
708
+ sendJson(res, 404, { error: "runtime_asset_manifest_not_found" });
707
709
  return;
708
710
  }
709
711
  const body = await readJsonBody(req);
@@ -712,7 +714,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
712
714
  sendJson(res, 200, { ok: true });
713
715
  return;
714
716
  }
715
- if (pathname === `${CONTROL_PREFIX}/mounts` && method === 'POST') {
717
+ if (pathname === `${CONTROL_PREFIX}/mounts` && method === "POST") {
716
718
  cleanupStaleRouterMounts();
717
719
  const body = await readJsonBody(req);
718
720
  const creatorUsername = body.creatorUsername?.trim();
@@ -722,8 +724,15 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
722
724
  const staticRoot = body.staticRoot?.trim();
723
725
  const repoRoot = body.repoRoot?.trim();
724
726
  const ownerPid = Number(body.ownerPid);
725
- if (!creatorUsername || !appType || !appName || !htmlPath || !staticRoot || !repoRoot || !Number.isInteger(ownerPid) || ownerPid <= 0) {
726
- sendJson(res, 400, { error: 'invalid_mount_request' });
727
+ if (!creatorUsername ||
728
+ !appType ||
729
+ !appName ||
730
+ !htmlPath ||
731
+ !staticRoot ||
732
+ !repoRoot ||
733
+ !Number.isInteger(ownerPid) ||
734
+ ownerPid <= 0) {
735
+ sendJson(res, 400, { error: "invalid_mount_request" });
727
736
  return;
728
737
  }
729
738
  const key = buildMountKey(creatorUsername, appType, appName);
@@ -733,7 +742,7 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
733
742
  if (existingMount && isPidAlive(existingMount.ownerPid)) {
734
743
  if (existingMount.htmlPath !== htmlPath || existingMount.staticRoot !== staticRoot) {
735
744
  sendJson(res, 409, {
736
- error: 'mount_conflict',
745
+ error: "mount_conflict",
737
746
  creatorUsername,
738
747
  appType,
739
748
  appName,
@@ -781,22 +790,22 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
781
790
  });
782
791
  return;
783
792
  }
784
- if (pathname.startsWith(`${CONTROL_PREFIX}/mounts/`) && pathname.endsWith('/heartbeat') && method === 'POST') {
793
+ if (pathname.startsWith(`${CONTROL_PREFIX}/mounts/`) && pathname.endsWith("/heartbeat") && method === "POST") {
785
794
  cleanupStaleRouterMounts();
786
- const mountId = pathname.slice(`${CONTROL_PREFIX}/mounts/`.length, -'/heartbeat'.length).replace(/\/$/, '');
795
+ const mountId = pathname.slice(`${CONTROL_PREFIX}/mounts/`.length, -"/heartbeat".length).replace(/\/$/, "");
787
796
  const mount = routerMountsById.get(mountId);
788
797
  if (!mount) {
789
- sendJson(res, 404, { error: 'mount_not_found' });
798
+ sendJson(res, 404, { error: "mount_not_found" });
790
799
  return;
791
800
  }
792
801
  const body = await readJsonBody(req);
793
802
  const ownerPid = Number(body.ownerPid);
794
803
  if (!Number.isInteger(ownerPid) || ownerPid <= 0) {
795
- sendJson(res, 400, { error: 'invalid_mount_owner_pid' });
804
+ sendJson(res, 400, { error: "invalid_mount_owner_pid" });
796
805
  return;
797
806
  }
798
807
  if (ownerPid !== mount.ownerPid) {
799
- sendJson(res, 409, { error: 'mount_owner_pid_mismatch' });
808
+ sendJson(res, 409, { error: "mount_owner_pid_mismatch" });
800
809
  return;
801
810
  }
802
811
  mount.ownerPid = ownerPid;
@@ -804,97 +813,97 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
804
813
  sendJson(res, 200, { ok: true });
805
814
  return;
806
815
  }
807
- if (pathname.startsWith(`${CONTROL_PREFIX}/mounts/`) && method === 'DELETE') {
816
+ if (pathname.startsWith(`${CONTROL_PREFIX}/mounts/`) && method === "DELETE") {
808
817
  const mountId = pathname.slice(`${CONTROL_PREFIX}/mounts/`.length);
809
818
  removeRouterMount(mountId);
810
819
  sendJson(res, 200, { ok: true });
811
820
  return;
812
821
  }
813
- if (method !== 'GET' && method !== 'HEAD') {
814
- res.setHeader('Allow', 'GET, HEAD, POST, DELETE, OPTIONS');
815
- respondWithText(res, method, 405, 'Method not allowed');
822
+ if (method !== "GET" && method !== "HEAD") {
823
+ res.setHeader("Allow", "GET, HEAD, POST, DELETE, OPTIONS");
824
+ respondWithText(res, method, 405, "Method not allowed");
816
825
  return;
817
826
  }
818
827
  cleanupStaleRouterMounts();
819
828
  const parsedMountPath = parseMountPath(pathname);
820
829
  if (!parsedMountPath) {
821
- respondWithText(res, method, 404, 'Not found');
830
+ respondWithText(res, method, 404, "Not found");
822
831
  return;
823
832
  }
824
833
  const mountId = routerMountIdsByKey.get(parsedMountPath.key);
825
834
  const mount = mountId ? routerMountsById.get(mountId) : null;
826
835
  if (!mount) {
827
- respondWithText(res, method, 404, 'Not found');
836
+ respondWithText(res, method, 404, "Not found");
828
837
  return;
829
838
  }
830
- if (parsedMountPath.assetPath === '_playdrop/runtime-assets') {
839
+ if (parsedMountPath.assetPath === "_playdrop/runtime-assets") {
831
840
  if (!mount.runtimeAssetManifest) {
832
- sendJson(res, 500, { error: 'runtime_asset_manifest_not_registered' });
841
+ sendJson(res, 500, { error: "runtime_asset_manifest_not_registered" });
833
842
  return;
834
843
  }
835
844
  sendJson(res, 200, mount.runtimeAssetManifest.response);
836
845
  return;
837
846
  }
838
- if (parsedMountPath.assetPath.startsWith('_playdrop/runtime-assets/files/')) {
839
- const ownedAssetName = parsedMountPath.assetPath.slice('_playdrop/runtime-assets/files/'.length).trim();
840
- const role = (searchParams.get('role') || 'primary').trim().toLowerCase();
847
+ if (parsedMountPath.assetPath.startsWith("_playdrop/runtime-assets/files/")) {
848
+ const ownedAssetName = parsedMountPath.assetPath.slice("_playdrop/runtime-assets/files/".length).trim();
849
+ const role = (searchParams.get("role") || "primary").trim().toLowerCase();
841
850
  if (!ownedAssetName || !role) {
842
- respondWithText(res, method, 400, 'Invalid runtime asset file request');
851
+ respondWithText(res, method, 400, "Invalid runtime asset file request");
843
852
  return;
844
853
  }
845
854
  const ownedFile = getOwnedRuntimeAssetFile(mount, ownedAssetName, role);
846
855
  if (!ownedFile) {
847
- respondWithText(res, method, 404, 'Not found');
856
+ respondWithText(res, method, 404, "Not found");
848
857
  return;
849
858
  }
850
859
  try {
851
860
  const stats = (0, node_fs_1.statSync)(ownedFile.absolutePath);
852
861
  if (!stats.isFile()) {
853
- respondWithText(res, method, 404, 'Not found');
862
+ respondWithText(res, method, 404, "Not found");
854
863
  return;
855
864
  }
856
865
  const content = (0, node_fs_1.readFileSync)(ownedFile.absolutePath);
857
866
  respondWithBuffer(res, method, 200, ownedFile.contentType || resolveContentType(ownedFile.absolutePath), content);
858
867
  }
859
868
  catch {
860
- respondWithText(res, method, 404, 'Not found');
869
+ respondWithText(res, method, 404, "Not found");
861
870
  }
862
871
  return;
863
872
  }
864
- if (parsedMountPath.assetPath === 'index.html') {
873
+ if (parsedMountPath.assetPath === "index.html") {
865
874
  try {
866
875
  const freshHtml = (0, node_fs_1.readFileSync)(mount.htmlPath);
867
- respondWithBuffer(res, method, 200, 'text/html; charset=utf-8', freshHtml);
876
+ respondWithBuffer(res, method, 200, "text/html; charset=utf-8", freshHtml);
868
877
  }
869
878
  catch (error) {
870
- respondWithText(res, method, 500, `Failed to read app file: ${error?.message || 'unknown error'}`);
879
+ respondWithText(res, method, 500, `Failed to read app file: ${error?.message || "unknown error"}`);
871
880
  }
872
881
  return;
873
882
  }
874
883
  const absolutePath = resolveStaticPath(mount.staticRoot, parsedMountPath.assetPath);
875
884
  if (!absolutePath) {
876
- respondWithText(res, method, 400, 'Invalid static asset path');
885
+ respondWithText(res, method, 400, "Invalid static asset path");
877
886
  return;
878
887
  }
879
888
  try {
880
889
  const stats = (0, node_fs_1.statSync)(absolutePath);
881
890
  if (!stats.isFile()) {
882
- respondWithText(res, method, 404, 'Not found');
891
+ respondWithText(res, method, 404, "Not found");
883
892
  return;
884
893
  }
885
894
  const content = (0, node_fs_1.readFileSync)(absolutePath);
886
895
  respondWithBuffer(res, method, 200, resolveContentType(absolutePath), content);
887
896
  }
888
897
  catch {
889
- respondWithText(res, method, 404, 'Not found');
898
+ respondWithText(res, method, 404, "Not found");
890
899
  }
891
900
  };
892
901
  const server = node_http_1.default.createServer((req, res) => {
893
902
  void handleRequest(req, res);
894
903
  });
895
- server.on('listening', () => {
904
+ server.on("listening", () => {
896
905
  const address = server.address();
897
- if (address && typeof address === 'object' && typeof address.port === 'number') {
906
+ if (address && typeof address === "object" && typeof address.port === "number") {
898
907
  activePort = address.port;
899
908
  }
900
909
  });
@@ -903,20 +912,20 @@ function createDevRouterServer(initialPort = exports.DEV_ROUTER_PORT) {
903
912
  async function listenDevRouterServer(server, port = exports.DEV_ROUTER_PORT) {
904
913
  await new Promise((resolveListen, rejectListen) => {
905
914
  const onError = (error) => {
906
- server.off('listening', onListening);
915
+ server.off("listening", onListening);
907
916
  rejectListen(error);
908
917
  };
909
918
  const onListening = () => {
910
- server.off('error', onError);
919
+ server.off("error", onError);
911
920
  resolveListen();
912
921
  };
913
- server.once('error', onError);
914
- server.once('listening', onListening);
922
+ server.once("error", onError);
923
+ server.once("listening", onListening);
915
924
  server.listen(port, DEV_ROUTER_HOST);
916
925
  });
917
926
  const address = server.address();
918
- if (!address || typeof address !== 'object' || typeof address.port !== 'number') {
919
- throw new Error('dev_router_port_unavailable');
927
+ if (!address || typeof address !== "object" || typeof address.port !== "number") {
928
+ throw new Error("dev_router_port_unavailable");
920
929
  }
921
930
  return address.port;
922
931
  }