automovie 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/README.md +40 -139
  2. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.d.ts +5 -2
  3. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js +6 -2
  4. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js.map +1 -1
  5. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.d.ts +3 -1
  6. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js +3 -1
  7. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js.map +1 -1
  8. package/lib/AUTOMOVIE_INSPECT_OPTIONS.d.ts +5 -2
  9. package/lib/AUTOMOVIE_INSPECT_OPTIONS.js +5 -2
  10. package/lib/AUTOMOVIE_INSPECT_OPTIONS.js.map +1 -1
  11. package/lib/AUTOMOVIE_RENDER_OPTIONS.d.ts +6 -2
  12. package/lib/AUTOMOVIE_RENDER_OPTIONS.js +8 -2
  13. package/lib/AUTOMOVIE_RENDER_OPTIONS.js.map +1 -1
  14. package/lib/AUTOMOVIE_REVIEW_OPTIONS.d.ts +3 -1
  15. package/lib/AUTOMOVIE_REVIEW_OPTIONS.js +12 -1
  16. package/lib/AUTOMOVIE_REVIEW_OPTIONS.js.map +1 -1
  17. package/lib/AutoMovieCaptureBackend.d.ts +4 -6
  18. package/lib/AutoMovieCaptureHost.d.ts +73 -53
  19. package/lib/AutoMovieCaptureHost.js +89 -56
  20. package/lib/AutoMovieCaptureHost.js.map +1 -1
  21. package/lib/AutoMovieCommand.d.ts +69 -20
  22. package/lib/AutoMovieFfmpegStaticPath.d.ts +6 -0
  23. package/lib/AutoMovieFfmpegStaticPath.js +3 -0
  24. package/lib/AutoMovieFfmpegStaticPath.js.map +1 -0
  25. package/lib/AutoMovieMp4Boxes.d.ts +78 -0
  26. package/lib/AutoMovieMp4Boxes.js +227 -0
  27. package/lib/AutoMovieMp4Boxes.js.map +1 -0
  28. package/lib/AutoMovieRenderOutputReservation.d.ts +18 -0
  29. package/lib/AutoMovieRenderOutputReservation.js +118 -0
  30. package/lib/AutoMovieRenderOutputReservation.js.map +1 -0
  31. package/lib/IAutoMovieChromium.d.ts +13 -57
  32. package/lib/IAutoMovieDeliveryAudioTrack.d.ts +17 -0
  33. package/lib/IAutoMovieDeliveryAudioTrack.js +3 -0
  34. package/lib/IAutoMovieDeliveryAudioTrack.js.map +1 -0
  35. package/lib/IAutoMovieDeliveryProfileFinding.d.ts +21 -0
  36. package/lib/IAutoMovieDeliveryProfileFinding.js +3 -0
  37. package/lib/IAutoMovieDeliveryProfileFinding.js.map +1 -0
  38. package/lib/IAutoMovieFfmpegSources.d.ts +11 -0
  39. package/lib/IAutoMovieFfmpegSources.js +3 -0
  40. package/lib/IAutoMovieFfmpegSources.js.map +1 -0
  41. package/lib/IAutoMovieReviewObservation.d.ts +66 -0
  42. package/lib/IAutoMovieReviewObservation.js +3 -0
  43. package/lib/IAutoMovieReviewObservation.js.map +1 -0
  44. package/lib/IAutoMovieVerification.d.ts +163 -0
  45. package/lib/IAutoMovieVerification.js +3 -0
  46. package/lib/IAutoMovieVerification.js.map +1 -0
  47. package/lib/auditAutoMovieAlphaSamples.d.ts +23 -0
  48. package/lib/auditAutoMovieAlphaSamples.js +183 -0
  49. package/lib/auditAutoMovieAlphaSamples.js.map +1 -0
  50. package/lib/auditAutoMovieDeliveryProfile.d.ts +33 -0
  51. package/lib/auditAutoMovieDeliveryProfile.js +93 -0
  52. package/lib/auditAutoMovieDeliveryProfile.js.map +1 -0
  53. package/lib/captureAutoMovie.d.ts +23 -11
  54. package/lib/captureAutoMovie.js +102 -18
  55. package/lib/captureAutoMovie.js.map +1 -1
  56. package/lib/createAutoMovieDeliveryAudioLog.d.ts +31 -0
  57. package/lib/createAutoMovieDeliveryAudioLog.js +110 -0
  58. package/lib/createAutoMovieDeliveryAudioLog.js.map +1 -0
  59. package/lib/createAutoMovieDeliveryAudioScan.d.ts +39 -0
  60. package/lib/createAutoMovieDeliveryAudioScan.js +125 -0
  61. package/lib/createAutoMovieDeliveryAudioScan.js.map +1 -0
  62. package/lib/createAutoMovieVerificationInputScope.d.ts +19 -0
  63. package/lib/createAutoMovieVerificationInputScope.js +147 -0
  64. package/lib/createAutoMovieVerificationInputScope.js.map +1 -0
  65. package/lib/createAutoMovieVerificationMediaHash.d.ts +5 -0
  66. package/lib/createAutoMovieVerificationMediaHash.js +61 -0
  67. package/lib/createAutoMovieVerificationMediaHash.js.map +1 -0
  68. package/lib/decodeAutoMovieDeliveryAudio.d.ts +24 -0
  69. package/lib/decodeAutoMovieDeliveryAudio.js +77 -0
  70. package/lib/decodeAutoMovieDeliveryAudio.js.map +1 -0
  71. package/lib/deriveAutoMovieProjectName.d.ts +14 -11
  72. package/lib/deriveAutoMovieProjectName.js +14 -11
  73. package/lib/deriveAutoMovieProjectName.js.map +1 -1
  74. package/lib/findAutoMovieFreePort.d.ts +5 -10
  75. package/lib/findAutoMovieFreePort.js +5 -10
  76. package/lib/findAutoMovieFreePort.js.map +1 -1
  77. package/lib/formatAutoMovieInspectUrl.d.ts +6 -10
  78. package/lib/formatAutoMovieInspectUrl.js +6 -10
  79. package/lib/formatAutoMovieInspectUrl.js.map +1 -1
  80. package/lib/hashAutoMovieFile.d.ts +5 -0
  81. package/lib/hashAutoMovieFile.js +16 -0
  82. package/lib/hashAutoMovieFile.js.map +1 -0
  83. package/lib/importAutoMovieVerificationEntry.d.mts +2 -0
  84. package/lib/importAutoMovieVerificationEntry.mjs +6 -0
  85. package/lib/importAutoMovieVerificationEntry.mjs.map +1 -0
  86. package/lib/index.d.ts +9 -0
  87. package/lib/index.js +9 -0
  88. package/lib/index.js.map +1 -1
  89. package/lib/inspectAutoMovie.d.ts +15 -9
  90. package/lib/inspectAutoMovie.js +25 -9
  91. package/lib/inspectAutoMovie.js.map +1 -1
  92. package/lib/inspectAutoMovieVerificationCapture.d.ts +15 -0
  93. package/lib/inspectAutoMovieVerificationCapture.js +221 -0
  94. package/lib/inspectAutoMovieVerificationCapture.js.map +1 -0
  95. package/lib/inspectAutoMovieVerificationDelivery.d.ts +13 -0
  96. package/lib/inspectAutoMovieVerificationDelivery.js +247 -0
  97. package/lib/inspectAutoMovieVerificationDelivery.js.map +1 -0
  98. package/lib/inspectAutoMovieVerificationReview.d.ts +11 -0
  99. package/lib/inspectAutoMovieVerificationReview.js +141 -0
  100. package/lib/inspectAutoMovieVerificationReview.js.map +1 -0
  101. package/lib/launchAutoMovieChromium.d.ts +9 -11
  102. package/lib/launchAutoMovieChromium.js +10 -11
  103. package/lib/launchAutoMovieChromium.js.map +1 -1
  104. package/lib/listAutoMovieReleaseFindings.d.ts +9 -0
  105. package/lib/listAutoMovieReleaseFindings.js +58 -0
  106. package/lib/listAutoMovieReleaseFindings.js.map +1 -0
  107. package/lib/loadAutoMovieProductionModule.d.ts +11 -10
  108. package/lib/loadAutoMovieProductionModule.js +18 -10
  109. package/lib/loadAutoMovieProductionModule.js.map +1 -1
  110. package/lib/loadAutoMovieVerificationModule.d.ts +6 -0
  111. package/lib/loadAutoMovieVerificationModule.js +246 -0
  112. package/lib/loadAutoMovieVerificationModule.js.map +1 -0
  113. package/lib/planAutoMovieChromiumLaunch.d.ts +7 -13
  114. package/lib/planAutoMovieChromiumLaunch.js +7 -13
  115. package/lib/planAutoMovieChromiumLaunch.js.map +1 -1
  116. package/lib/planAutoMovieDeliveryAudioDecode.d.ts +10 -0
  117. package/lib/planAutoMovieDeliveryAudioDecode.js +29 -0
  118. package/lib/planAutoMovieDeliveryAudioDecode.js.map +1 -0
  119. package/lib/planAutoMovieDeliveryDecode.d.ts +19 -0
  120. package/lib/planAutoMovieDeliveryDecode.js +57 -0
  121. package/lib/planAutoMovieDeliveryDecode.js.map +1 -0
  122. package/lib/planAutoMovieDeliveryInput.d.ts +11 -0
  123. package/lib/planAutoMovieDeliveryInput.js +26 -0
  124. package/lib/planAutoMovieDeliveryInput.js.map +1 -0
  125. package/lib/planAutoMovieModulePageViteConfig.d.ts +13 -10
  126. package/lib/planAutoMovieModulePageViteConfig.js +13 -10
  127. package/lib/planAutoMovieModulePageViteConfig.js.map +1 -1
  128. package/lib/promptAutoMovieProjectName.d.ts +6 -10
  129. package/lib/promptAutoMovieProjectName.js +6 -10
  130. package/lib/promptAutoMovieProjectName.js.map +1 -1
  131. package/lib/publishAutoMovieRenderAttempt.d.ts +32 -0
  132. package/lib/publishAutoMovieRenderAttempt.js +91 -0
  133. package/lib/publishAutoMovieRenderAttempt.js.map +1 -0
  134. package/lib/readAutoMovieAddArguments.d.ts +10 -11
  135. package/lib/readAutoMovieAddArguments.js +10 -11
  136. package/lib/readAutoMovieAddArguments.js.map +1 -1
  137. package/lib/readAutoMovieCaptureHostOptions.d.ts +19 -17
  138. package/lib/readAutoMovieCaptureHostOptions.js +16 -17
  139. package/lib/readAutoMovieCaptureHostOptions.js.map +1 -1
  140. package/lib/readAutoMovieCommandArguments.d.ts +6 -9
  141. package/lib/readAutoMovieCommandArguments.js +9 -10
  142. package/lib/readAutoMovieCommandArguments.js.map +1 -1
  143. package/lib/readAutoMovieCreateArguments.d.ts +7 -11
  144. package/lib/readAutoMovieCreateArguments.js +7 -11
  145. package/lib/readAutoMovieCreateArguments.js.map +1 -1
  146. package/lib/readAutoMovieDeliveryAudioTrack.d.ts +21 -0
  147. package/lib/readAutoMovieDeliveryAudioTrack.js +104 -0
  148. package/lib/readAutoMovieDeliveryAudioTrack.js.map +1 -0
  149. package/lib/readAutoMovieDeliveryDecode.d.ts +19 -0
  150. package/lib/readAutoMovieDeliveryDecode.js +209 -0
  151. package/lib/readAutoMovieDeliveryDecode.js.map +1 -0
  152. package/lib/readAutoMovieDeliveryProbe.d.ts +35 -0
  153. package/lib/readAutoMovieDeliveryProbe.js +363 -0
  154. package/lib/readAutoMovieDeliveryProbe.js.map +1 -0
  155. package/lib/readAutoMovieErrorCode.d.ts +9 -0
  156. package/lib/readAutoMovieErrorCode.js +18 -0
  157. package/lib/readAutoMovieErrorCode.js.map +1 -0
  158. package/lib/readAutoMovieInspectHostOptions.d.ts +15 -16
  159. package/lib/readAutoMovieInspectHostOptions.js +11 -15
  160. package/lib/readAutoMovieInspectHostOptions.js.map +1 -1
  161. package/lib/readAutoMovieNameOption.d.ts +4 -10
  162. package/lib/readAutoMovieNameOption.js +4 -10
  163. package/lib/readAutoMovieNameOption.js.map +1 -1
  164. package/lib/readAutoMoviePageTimeout.d.ts +13 -0
  165. package/lib/readAutoMoviePageTimeout.js +21 -0
  166. package/lib/readAutoMoviePageTimeout.js.map +1 -0
  167. package/lib/readAutoMovieRenderOptions.d.ts +24 -16
  168. package/lib/readAutoMovieRenderOptions.js +23 -16
  169. package/lib/readAutoMovieRenderOptions.js.map +1 -1
  170. package/lib/readAutoMovieReviewObservation.d.ts +6 -0
  171. package/lib/readAutoMovieReviewObservation.js +108 -0
  172. package/lib/readAutoMovieReviewObservation.js.map +1 -0
  173. package/lib/readAutoMovieReviewOptions.d.ts +32 -24
  174. package/lib/readAutoMovieReviewOptions.js +82 -18
  175. package/lib/readAutoMovieReviewOptions.js.map +1 -1
  176. package/lib/readAutoMovieRevision.d.ts +3 -9
  177. package/lib/readAutoMovieRevision.js +3 -9
  178. package/lib/readAutoMovieRevision.js.map +1 -1
  179. package/lib/readAutoMovieVerifyOptions.d.ts +17 -0
  180. package/lib/readAutoMovieVerifyOptions.js +45 -0
  181. package/lib/readAutoMovieVerifyOptions.js.map +1 -0
  182. package/lib/readAutoMovieVideoProbe.d.ts +6 -10
  183. package/lib/readAutoMovieVideoProbe.js +20 -13
  184. package/lib/readAutoMovieVideoProbe.js.map +1 -1
  185. package/lib/recordAutoMoviePlayback.d.ts +18 -11
  186. package/lib/recordAutoMoviePlayback.js +26 -13
  187. package/lib/recordAutoMoviePlayback.js.map +1 -1
  188. package/lib/renderAutoMovie.d.ts +16 -10
  189. package/lib/renderAutoMovie.js +31 -14
  190. package/lib/renderAutoMovie.js.map +1 -1
  191. package/lib/renderAutoMovieScaffoldNextSteps.d.ts +10 -10
  192. package/lib/renderAutoMovieScaffoldNextSteps.js +10 -10
  193. package/lib/renderAutoMovieVideo.d.ts +53 -15
  194. package/lib/renderAutoMovieVideo.js +290 -45
  195. package/lib/renderAutoMovieVideo.js.map +1 -1
  196. package/lib/resolveAutoMovieFfmpeg.d.ts +12 -15
  197. package/lib/resolveAutoMovieFfmpeg.js +12 -17
  198. package/lib/resolveAutoMovieFfmpeg.js.map +1 -1
  199. package/lib/reviewAutoMovie.d.ts +10 -10
  200. package/lib/reviewAutoMovie.js +15 -10
  201. package/lib/reviewAutoMovie.js.map +1 -1
  202. package/lib/reviewAutoMovieFile.d.ts +21 -0
  203. package/lib/reviewAutoMovieFile.js +378 -0
  204. package/lib/reviewAutoMovieFile.js.map +1 -0
  205. package/lib/run.d.ts +32 -18
  206. package/lib/run.js +67 -23
  207. package/lib/run.js.map +1 -1
  208. package/lib/runAutoMovieDeliveryAudioDecode.d.ts +18 -0
  209. package/lib/runAutoMovieDeliveryAudioDecode.js +28 -0
  210. package/lib/runAutoMovieDeliveryAudioDecode.js.map +1 -0
  211. package/lib/runAutoMovieDeliveryDecode.d.ts +19 -0
  212. package/lib/runAutoMovieDeliveryDecode.js +42 -0
  213. package/lib/runAutoMovieDeliveryDecode.js.map +1 -0
  214. package/lib/runAutoMovieDeliveryReferenceDecode.d.ts +28 -0
  215. package/lib/runAutoMovieDeliveryReferenceDecode.js +77 -0
  216. package/lib/runAutoMovieDeliveryReferenceDecode.js.map +1 -0
  217. package/lib/runAutoMovieDeliverySourceAudioDecode.d.ts +20 -0
  218. package/lib/runAutoMovieDeliverySourceAudioDecode.js +56 -0
  219. package/lib/runAutoMovieDeliverySourceAudioDecode.js.map +1 -0
  220. package/lib/runAutoMovieFfmpeg.d.ts +15 -10
  221. package/lib/runAutoMovieFfmpeg.js +36 -13
  222. package/lib/runAutoMovieFfmpeg.js.map +1 -1
  223. package/lib/runAutoMovieVerification.d.ts +28 -0
  224. package/lib/runAutoMovieVerification.js +393 -0
  225. package/lib/runAutoMovieVerification.js.map +1 -0
  226. package/lib/sameAutoMovieReviewFile.d.ts +2 -0
  227. package/lib/sameAutoMovieReviewFile.js +57 -0
  228. package/lib/sameAutoMovieReviewFile.js.map +1 -0
  229. package/lib/selectAutoMovieProjectName.d.ts +8 -11
  230. package/lib/selectAutoMovieProjectName.js +8 -11
  231. package/lib/selectAutoMovieProjectName.js.map +1 -1
  232. package/lib/serveAutoMovieDrawPage.d.ts +14 -11
  233. package/lib/serveAutoMovieDrawPage.js +14 -11
  234. package/lib/serveAutoMovieDrawPage.js.map +1 -1
  235. package/lib/serveAutoMovieInspectorPage.d.ts +4 -8
  236. package/lib/serveAutoMovieInspectorPage.js +3 -9
  237. package/lib/serveAutoMovieInspectorPage.js.map +1 -1
  238. package/lib/verifyAutoMovie.d.ts +19 -0
  239. package/lib/verifyAutoMovie.js +44 -0
  240. package/lib/verifyAutoMovie.js.map +1 -0
  241. package/lib/writeAutoMovieModulePage.d.ts +17 -12
  242. package/lib/writeAutoMovieModulePage.js +13 -11
  243. package/lib/writeAutoMovieModulePage.js.map +1 -1
  244. package/lib/writeAutoMovieVerificationReceipt.d.ts +2 -0
  245. package/lib/writeAutoMovieVerificationReceipt.js +75 -0
  246. package/lib/writeAutoMovieVerificationReceipt.js.map +1 -0
  247. package/package.json +8 -8
  248. package/src/AUTOMOVIE_CAPTURE_OPTIONS.ts +6 -2
  249. package/src/AUTOMOVIE_DEFAULT_PROJECT_NAME.ts +3 -1
  250. package/src/AUTOMOVIE_INSPECT_OPTIONS.ts +5 -2
  251. package/src/AUTOMOVIE_RENDER_OPTIONS.ts +8 -2
  252. package/src/AUTOMOVIE_REVIEW_OPTIONS.ts +12 -1
  253. package/src/AutoMovieCaptureBackend.ts +4 -6
  254. package/src/AutoMovieCaptureHost.ts +122 -68
  255. package/src/AutoMovieCommand.ts +71 -20
  256. package/src/AutoMovieFfmpegStaticPath.ts +7 -0
  257. package/src/AutoMovieMp4Boxes.ts +263 -0
  258. package/src/AutoMovieRenderOutputReservation.ts +97 -0
  259. package/src/IAutoMovieChromium.ts +13 -57
  260. package/src/IAutoMovieDeliveryAudioTrack.ts +19 -0
  261. package/src/IAutoMovieDeliveryProfileFinding.ts +24 -0
  262. package/src/IAutoMovieFfmpegSources.ts +13 -0
  263. package/src/IAutoMovieReviewObservation.ts +59 -0
  264. package/src/IAutoMovieVerification.ts +207 -0
  265. package/src/auditAutoMovieAlphaSamples.ts +201 -0
  266. package/src/auditAutoMovieDeliveryProfile.ts +125 -0
  267. package/src/captureAutoMovie.ts +137 -28
  268. package/src/createAutoMovieDeliveryAudioLog.ts +141 -0
  269. package/src/createAutoMovieDeliveryAudioScan.ts +150 -0
  270. package/src/createAutoMovieVerificationInputScope.ts +156 -0
  271. package/src/createAutoMovieVerificationMediaHash.ts +32 -0
  272. package/src/decodeAutoMovieDeliveryAudio.ts +95 -0
  273. package/src/deriveAutoMovieProjectName.ts +14 -11
  274. package/src/findAutoMovieFreePort.ts +5 -10
  275. package/src/formatAutoMovieInspectUrl.ts +6 -10
  276. package/src/hashAutoMovieFile.ts +12 -0
  277. package/src/importAutoMovieVerificationEntry.mts +6 -0
  278. package/src/index.ts +9 -0
  279. package/src/inspectAutoMovie.ts +28 -11
  280. package/src/inspectAutoMovieVerificationCapture.ts +292 -0
  281. package/src/inspectAutoMovieVerificationDelivery.ts +301 -0
  282. package/src/inspectAutoMovieVerificationReview.ts +130 -0
  283. package/src/launchAutoMovieChromium.ts +14 -12
  284. package/src/listAutoMovieReleaseFindings.ts +87 -0
  285. package/src/loadAutoMovieProductionModule.ts +22 -15
  286. package/src/loadAutoMovieVerificationModule.ts +278 -0
  287. package/src/planAutoMovieChromiumLaunch.ts +7 -13
  288. package/src/planAutoMovieDeliveryAudioDecode.ts +26 -0
  289. package/src/planAutoMovieDeliveryDecode.ts +66 -0
  290. package/src/planAutoMovieDeliveryInput.ts +25 -0
  291. package/src/planAutoMovieModulePageViteConfig.ts +13 -10
  292. package/src/promptAutoMovieProjectName.ts +6 -10
  293. package/src/publishAutoMovieRenderAttempt.ts +89 -0
  294. package/src/readAutoMovieAddArguments.ts +10 -11
  295. package/src/readAutoMovieCaptureHostOptions.ts +22 -17
  296. package/src/readAutoMovieCommandArguments.ts +8 -10
  297. package/src/readAutoMovieCreateArguments.ts +7 -11
  298. package/src/readAutoMovieDeliveryAudioTrack.ts +137 -0
  299. package/src/readAutoMovieDeliveryDecode.ts +269 -0
  300. package/src/readAutoMovieDeliveryProbe.ts +499 -0
  301. package/src/readAutoMovieErrorCode.ts +13 -0
  302. package/src/readAutoMovieInspectHostOptions.ts +15 -16
  303. package/src/readAutoMovieNameOption.ts +4 -10
  304. package/src/readAutoMoviePageTimeout.ts +19 -0
  305. package/src/readAutoMovieRenderOptions.ts +34 -16
  306. package/src/readAutoMovieReviewObservation.ts +146 -0
  307. package/src/readAutoMovieReviewOptions.ts +133 -28
  308. package/src/readAutoMovieRevision.ts +3 -9
  309. package/src/readAutoMovieVerifyOptions.ts +50 -0
  310. package/src/readAutoMovieVideoProbe.ts +24 -13
  311. package/src/recordAutoMoviePlayback.ts +26 -13
  312. package/src/renderAutoMovie.ts +38 -17
  313. package/src/renderAutoMovieScaffoldNextSteps.ts +10 -10
  314. package/src/renderAutoMovieVideo.ts +474 -85
  315. package/src/resolveAutoMovieFfmpeg.ts +17 -24
  316. package/src/reviewAutoMovie.ts +21 -16
  317. package/src/reviewAutoMovieFile.ts +479 -0
  318. package/src/run.ts +75 -25
  319. package/src/runAutoMovieDeliveryAudioDecode.ts +45 -0
  320. package/src/runAutoMovieDeliveryDecode.ts +63 -0
  321. package/src/runAutoMovieDeliveryReferenceDecode.ts +107 -0
  322. package/src/runAutoMovieDeliverySourceAudioDecode.ts +71 -0
  323. package/src/runAutoMovieFfmpeg.ts +48 -14
  324. package/src/runAutoMovieVerification.ts +487 -0
  325. package/src/sameAutoMovieReviewFile.ts +23 -0
  326. package/src/selectAutoMovieProjectName.ts +8 -11
  327. package/src/serveAutoMovieDrawPage.ts +16 -12
  328. package/src/serveAutoMovieInspectorPage.ts +6 -9
  329. package/src/verifyAutoMovie.ts +67 -0
  330. package/src/writeAutoMovieModulePage.ts +17 -12
  331. package/src/writeAutoMovieVerificationReceipt.ts +51 -0
@@ -1,25 +1,27 @@
1
1
  import { AUTOMOVIE_RENDER_OPTIONS } from "./AUTOMOVIE_RENDER_OPTIONS";
2
2
  import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
3
+ import { readAutoMoviePageTimeout } from "./readAutoMoviePageTimeout";
3
4
 
4
5
  /**
5
- * Split the options of `automovie render` into the command's own, `AUTOMOVIE_RENDER_OPTIONS`, and the request's, which `parseAutoMovieCapturePlanRequest` reads for the request's `subject`.
6
+ * Split the options of `automovie render` into the command's own,
7
+ * `AUTOMOVIE_RENDER_OPTIONS`, and the request's, which
8
+ * `parseAutoMovieCapturePlanRequest` reads for the request's `subject`.
6
9
  *
7
- * | Option | Meaning | Absent |
8
- * | --- | --- | --- |
9
- * | `--module <file>` | The subject module whose `subjects` the draw page offers | Required |
10
- * | `--props <file>` | A JSON file whose value the module's `subjects` is called with | `null` |
11
- * | `--out <folder>` | Where `film.mp4` and `render-report.json` go | `media/automovie/<subject>/videos` |
12
- * | `--backend <software\|gpu>` | How the browser draws | `software` |
10
+ * | Option | Meaning | Absent |
11
+ * | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
12
+ * | `--module <file>` | The subject module whose `subjects` the draw page offers | Required |
13
+ * | `--props <file>` | A JSON file whose value the module's `subjects` is called with | `null` |
14
+ * | `--out <folder>` | Where `film.mp4`, `render-report.json` and, with `--passes`, `controls/` go | `media/automovie/<subject>/videos` |
15
+ * | `--backend <software\|gpu>` | How the browser draws | `software` |
16
+ * | `--background <scene\|transparent>` | `transparent` renders a straight-alpha `film.mov` with no audio into `media/automovie/<subject>/transparent` | `scene` |
17
+ * | `--timeout-ms <milliseconds>` | Per-call budget for page navigation, draw-function readiness, subject creation and drawing. Integer 1 to 2147483647 | `120000` |
13
18
  *
14
- * Every other option is left for the request reader, which names the subject as `capture` and the inspector do; a render draws the subject's whole clock through its own camera, so `renderAutoMovie` refuses any request key but `subject`. It throws for an empty value of its own options, a missing `--module`, and a backend that is not `software` or `gpu`.
15
- *
16
- * @evidence contracts/development/common.md#meaningful-documentation Tabulates the command's options with their meaning and absent value, says where the rest go and which of them a render admits, and states every refusal.
17
- * @evidence contracts/development/implementation.md#principled-implementation The command's keys are removed before the request is read, as `capture` and `inspect` do, so the subject has one name and one reader in every host.
18
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pass over the listed options that takes them out, then the checks.
19
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No module is guessed from the folder.
20
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the options.
21
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Read once per command.
22
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh record and keeps nothing.
19
+ * Every other option is left for the request reader, which names the subject as
20
+ * `capture` and the inspector do; a render draws the subject's whole clock
21
+ * through its own camera, so `renderAutoMovie` refuses any request key but
22
+ * `subject` and `passes`. It throws for an empty value of its own options, a
23
+ * missing `--module`, a backend that is not `software` or `gpu`, and a
24
+ * background that is not `scene` or `transparent`.
23
25
  */
24
26
  export function readAutoMovieRenderOptions(
25
27
  values: ReadonlyMap<string, string>,
@@ -36,6 +38,15 @@ export function readAutoMovieRenderOptions(
36
38
  /** How the browser draws. */
37
39
  backend: AutoMovieCaptureBackend;
38
40
 
41
+ /**
42
+ * Per-call milliseconds for draw-function readiness, subject
43
+ * description/creation and drawing, not a total build or render deadline.
44
+ */
45
+ timeout: number;
46
+
47
+ /** `scene` for the film, `transparent` for a straight-alpha layer. */
48
+ background: "scene" | "transparent";
49
+
39
50
  /** The request's own options, for the request reader. */
40
51
  request: Map<string, string>;
41
52
  } {
@@ -57,11 +68,18 @@ export function readAutoMovieRenderOptions(
57
68
  const backend: string = taken.get("backend") ?? "software";
58
69
  if (backend !== "software" && backend !== "gpu")
59
70
  throw new Error(`Render --backend "${backend}" is not software or gpu`);
71
+ const background: string = taken.get("background") ?? "scene";
72
+ if (background !== "scene" && background !== "transparent")
73
+ throw new Error(
74
+ `Render --background "${background}" is not scene or transparent`,
75
+ );
60
76
  return {
61
77
  module,
62
78
  props: taken.get("props") ?? null,
63
79
  out: taken.get("out") ?? null,
64
80
  backend,
81
+ timeout: readAutoMoviePageTimeout(taken.get("timeout-ms")),
65
82
  request,
83
+ background,
66
84
  };
67
85
  }
@@ -0,0 +1,146 @@
1
+ import type { IAutoMovieDeliveryContentAudit } from "@automovie/interface";
2
+
3
+ import type { IAutoMovieReviewObservation } from "./IAutoMovieReviewObservation";
4
+
5
+ /**
6
+ * Admits one stored review receipt with matching requested and observed scope.
7
+ * A still decision covers a single decoded frame when timing is established.
8
+ */
9
+ export function readAutoMovieReviewObservation(
10
+ value: unknown,
11
+ ): IAutoMovieReviewObservation {
12
+ if (!record(value) || !admitted(value))
13
+ throw new Error("Invalid file review receipt");
14
+ if (
15
+ value.viewed === "still" &&
16
+ (value.observed === null
17
+ ? value.requested.to !== null
18
+ : value.observed.endFrame - value.observed.firstFrame !== 1)
19
+ )
20
+ throw new Error("Invalid file review receipt: a still selects one frame");
21
+ return value;
22
+ }
23
+
24
+ /** A decoded JSON object. */
25
+ function record(value: unknown): value is Record<string, unknown> {
26
+ return typeof value === "object" && value !== null && !Array.isArray(value);
27
+ }
28
+
29
+ /** Nonempty text remains distinguishable from an absent value. */
30
+ function text(value: unknown): value is string {
31
+ return typeof value === "string" && value.trim() !== "";
32
+ }
33
+
34
+ /** An index in a nonnegative output frame grid. */
35
+ function index(value: unknown): value is number {
36
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
37
+ }
38
+
39
+ /** An explicitly requested film second. */
40
+ function second(value: unknown): value is number {
41
+ return typeof value === "number" && Number.isFinite(value) && value >= 0;
42
+ }
43
+
44
+ /** An exact timestamp with two positive rational clock terms. */
45
+ function timestamp(
46
+ value: unknown,
47
+ ): value is IAutoMovieDeliveryContentAudit.ITimestamp {
48
+ return (
49
+ record(value) &&
50
+ Number.isSafeInteger(value.ticks) &&
51
+ Array.isArray(value.timeBase) &&
52
+ value.timeBase.length === 2 &&
53
+ value.timeBase.every((term: unknown): boolean => index(term) && term > 0)
54
+ );
55
+ }
56
+
57
+ /** Validates the receipt's selected frame bounds and consistent native clock. */
58
+ function observed(
59
+ value: unknown,
60
+ from: number,
61
+ to: number | null,
62
+ ): value is NonNullable<IAutoMovieReviewObservation["observed"]> {
63
+ if (
64
+ !record(value) ||
65
+ !index(value.firstFrame) ||
66
+ !index(value.endFrame) ||
67
+ !index(value.frameCount) ||
68
+ value.firstFrame >= value.endFrame ||
69
+ value.endFrame > value.frameCount ||
70
+ !timestamp(value.start) ||
71
+ !timestamp(value.end) ||
72
+ value.start.timeBase[0] !== value.end.timeBase[0] ||
73
+ value.start.timeBase[1] !== value.end.timeBase[1] ||
74
+ value.start.ticks < 0 ||
75
+ value.end.ticks <= value.start.ticks
76
+ )
77
+ return false;
78
+ const ticks: number = value.end.ticks - value.start.ticks;
79
+ const frames: number = value.endFrame - value.firstFrame;
80
+ const stride: number = ticks / frames;
81
+ const [numerator, denominator] = value.start.timeBase;
82
+ const start: number = (value.start.ticks * numerator) / denominator;
83
+ const afterFirst: number =
84
+ ((value.start.ticks + stride) * numerator) / denominator;
85
+ const beforeEnd: number =
86
+ ((value.end.ticks - stride) * numerator) / denominator;
87
+ const end: number = (value.end.ticks * numerator) / denominator;
88
+ return (
89
+ Number.isSafeInteger(stride) &&
90
+ BigInt(value.start.ticks) === BigInt(value.firstFrame) * BigInt(stride) &&
91
+ start <= from &&
92
+ from < afterFirst &&
93
+ (to === null ? frames === 1 : beforeEnd < to && to <= end)
94
+ );
95
+ }
96
+
97
+ /** An assigned occurrence or an explicit limit on assignment. */
98
+ function cut(value: unknown): value is IAutoMovieReviewObservation["cut"] {
99
+ return (
100
+ record(value) &&
101
+ (value.state === "resolved"
102
+ ? index(value.entry) && text(value.shot)
103
+ : (value.state === "ambiguous" || value.state === "unavailable") &&
104
+ text(value.reason))
105
+ );
106
+ }
107
+
108
+ /** The input shape and cross-field admission of a stored mark. */
109
+ function admitted(
110
+ value: Record<string, unknown>,
111
+ ): value is Record<string, unknown> & IAutoMovieReviewObservation {
112
+ if (
113
+ value.version !== 1 ||
114
+ !text(value.subject) ||
115
+ !text(value.file) ||
116
+ typeof value.sha256 !== "string" ||
117
+ !/^[0-9a-f]{64}$/u.test(value.sha256) ||
118
+ !text(value.note) ||
119
+ !(value.previous === null || text(value.previous)) ||
120
+ !record(value.requested) ||
121
+ !second(value.requested.from) ||
122
+ !(
123
+ value.requested.to === null ||
124
+ (second(value.requested.to) && value.requested.to > value.requested.from)
125
+ ) ||
126
+ !cut(value.cut)
127
+ )
128
+ return false;
129
+ if (
130
+ !(
131
+ (value.reviewer === null &&
132
+ value.decision === null &&
133
+ value.viewed === null) ||
134
+ (text(value.reviewer) &&
135
+ (value.decision === "accepted" || value.decision === "needs-repair") &&
136
+ (value.viewed === "still" ||
137
+ (value.requested.to !== null &&
138
+ (value.viewed === "playback" || value.viewed === "listening"))))
139
+ )
140
+ )
141
+ return false;
142
+ return value.observed === null
143
+ ? text(value.unavailable) && value.cut.state === "unavailable"
144
+ : value.unavailable === null &&
145
+ observed(value.observed, value.requested.from, value.requested.to);
146
+ }
@@ -1,39 +1,46 @@
1
1
  import { AUTOMOVIE_REVIEW_OPTIONS } from "./AUTOMOVIE_REVIEW_OPTIONS";
2
+ import type { IAutoMovieReviewObservation } from "./IAutoMovieReviewObservation";
2
3
 
3
- /** Longest observation in seconds: one day, beyond any film's playback a person reviews. */
4
+ /** The longest Inspector recording in wall-clock seconds, one day. */
4
5
  const LONGEST: number = 86_400;
5
6
 
7
+ /** An Inspector recording with its existing address, duration and output. */
8
+ interface IAutoMovieInspectorReviewOptions {
9
+ url: string;
10
+ seconds: number;
11
+ out: string | null;
12
+ }
13
+
6
14
  /**
7
- * Read the options of `automovie review`, `AUTOMOVIE_REVIEW_OPTIONS`.
8
- *
9
- * | Option | Meaning | Absent |
10
- * | --- | --- | --- |
11
- * | `--url <address>` | The running inspector page, with the request it opens on | Required |
12
- * | `--seconds <s>` | Wall-clock seconds of playback recorded, positive, at most a day | Required |
13
- * | `--out <folder>` | Where the recording and `playback.json` go | `media/automovie/review` |
14
- *
15
- * It throws naming the option for an option outside the list, an empty value, a missing `--url` or `--seconds`, an address that is not HTTP on this machine, and seconds out of range.
15
+ * One file mark or replay, with the selected range and any explicit reviewer
16
+ * decision.
17
+ */
18
+ interface IAutoMovieFileReviewOptions {
19
+ file: string | null;
20
+ mark: string | null;
21
+ requested: IAutoMovieReviewObservation["requested"] | null;
22
+ note: string | null;
23
+ reviewer: IAutoMovieReviewObservation["reviewer"];
24
+ decision: IAutoMovieReviewObservation["decision"];
25
+ viewed: IAutoMovieReviewObservation["viewed"];
26
+ out: string | null;
27
+ }
28
+
29
+ /**
30
+ * Admit one `automovie review` operation.
16
31
  *
17
- * @evidence contracts/development/common.md#meaningful-documentation Tabulates every option with its meaning and absent value, and states every refusal.
18
- * @evidence contracts/development/implementation.md#principled-implementation A review records the page a person would watch, so the command names that page and how long to watch it; only a loopback address is admitted, so the command never drives a page elsewhere.
19
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pass admitting the listed options, then the checks.
20
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No address or duration is guessed.
21
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the options.
22
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Read once per command.
23
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh record and keeps nothing.
32
+ * Inspector mode takes the loopback HTTP `--url`, wall-clock `--seconds` and
33
+ * optional `--out`. File mode takes a published `--file` with `--at`, or with
34
+ * `--from` and exclusive `--to`, in film seconds. New marks need `--note`.
35
+ * `--mark` opens an existing receipt or, beside a file and selected time,
36
+ * explicitly rebinds it. A rebind can reuse the note text. `--reviewer`,
37
+ * `--decision` and `--viewed` belong together on a mark or rebind. Still review
38
+ * needs `--at`. Playback and listening need `--from` and `--to`. `--out`
39
+ * selects the output folder.
24
40
  */
25
41
  export function readAutoMovieReviewOptions(
26
42
  values: ReadonlyMap<string, string>,
27
- ): {
28
- /** The page's address. */
29
- url: string;
30
-
31
- /** Seconds of playback recorded. */
32
- seconds: number;
33
-
34
- /** The output folder, or null for the default. */
35
- out: string | null;
36
- } {
43
+ ): IAutoMovieInspectorReviewOptions | IAutoMovieFileReviewOptions {
37
44
  for (const [key, value] of values) {
38
45
  if (!AUTOMOVIE_REVIEW_OPTIONS.includes(key))
39
46
  throw new Error(
@@ -42,10 +49,24 @@ export function readAutoMovieReviewOptions(
42
49
  if (value.trim() === "")
43
50
  throw new Error(`Review option --${key} needs a value`);
44
51
  }
52
+ return values.has("file") || values.has("mark")
53
+ ? fileOptions(values)
54
+ : inspectorOptions(values);
55
+ }
56
+
57
+ /** Record only a loopback HTTP Inspector for a finite wall-clock duration. */
58
+ function inspectorOptions(
59
+ values: ReadonlyMap<string, string>,
60
+ ): IAutoMovieInspectorReviewOptions {
45
61
  const url: string | undefined = values.get("url");
46
62
  const text: string | undefined = values.get("seconds");
47
63
  if (url === undefined || text === undefined)
48
- throw new Error("Review needs --url <inspector address> and --seconds <s>");
64
+ throw new Error(
65
+ "Review needs --url <inspector address> and --seconds <s>, or --file / --mark",
66
+ );
67
+ for (const key of values.keys())
68
+ if (key !== "url" && key !== "seconds" && key !== "out")
69
+ throw new Error(`Review option --${key} needs --file or --mark`);
49
70
  let address: URL;
50
71
  try {
51
72
  address = new URL(url);
@@ -68,3 +89,87 @@ export function readAutoMovieReviewOptions(
68
89
  );
69
90
  return { url: address.href, seconds, out: values.get("out") ?? null };
70
91
  }
92
+
93
+ /** Admits a new mark, an explicit rebind, or replay of an existing mark. */
94
+ function fileOptions(
95
+ values: ReadonlyMap<string, string>,
96
+ ): IAutoMovieFileReviewOptions {
97
+ if (values.has("url") || values.has("seconds"))
98
+ throw new Error(
99
+ "Review --url and --seconds apply only to Inspector recording",
100
+ );
101
+ const file: string | null = values.get("file") ?? null;
102
+ const mark: string | null = values.get("mark") ?? null;
103
+ const note: string | null = values.get("note") ?? null;
104
+ const at: number | null = second(values, "at");
105
+ const from: number | null = second(values, "from");
106
+ const to: number | null = second(values, "to");
107
+ if (at !== null && (from !== null || to !== null))
108
+ throw new Error("Review --at excludes --from and --to");
109
+ if ((from === null) !== (to === null) || (from !== null && to! <= from))
110
+ throw new Error("Review needs both --from and --to with --from below --to");
111
+ const requested: IAutoMovieFileReviewOptions["requested"] =
112
+ at !== null ? { from: at, to: null } : from !== null ? { from, to } : null;
113
+ if (requested !== null && file === null)
114
+ throw new Error("Review a new position with --file");
115
+ if (mark === null && (requested === null || note === null))
116
+ throw new Error(
117
+ "A new review mark needs --at or --from and --to, and --note",
118
+ );
119
+
120
+ const reviewer: string | null = values.get("reviewer") ?? null;
121
+ const decision: string | null = values.get("decision") ?? null;
122
+ const viewed: string | null = values.get("viewed") ?? null;
123
+ if (
124
+ decision !== null &&
125
+ decision !== "accepted" &&
126
+ decision !== "needs-repair"
127
+ )
128
+ throw new Error("Review --decision takes accepted or needs-repair");
129
+ if (
130
+ viewed !== null &&
131
+ viewed !== "still" &&
132
+ viewed !== "playback" &&
133
+ viewed !== "listening"
134
+ )
135
+ throw new Error("Review --viewed takes still, playback or listening");
136
+ if (
137
+ (reviewer === null) !== (decision === null) ||
138
+ (decision === null) !== (viewed === null)
139
+ )
140
+ throw new Error("Give --reviewer, --decision and --viewed together");
141
+ if (requested === null && (note !== null || reviewer !== null))
142
+ throw new Error(
143
+ "Add a note or decision at an explicit position with --file",
144
+ );
145
+ if (viewed === "still" && at === null)
146
+ throw new Error("Still review needs --at to select one frame");
147
+ if (
148
+ (requested === null || requested.to === null) &&
149
+ (viewed === "playback" || viewed === "listening")
150
+ )
151
+ throw new Error("Playback and listening review need --from and --to");
152
+ return {
153
+ file,
154
+ mark,
155
+ requested,
156
+ note,
157
+ reviewer,
158
+ decision,
159
+ viewed,
160
+ out: values.get("out") ?? null,
161
+ };
162
+ }
163
+
164
+ /** Reads a finite nonnegative film second, or null when absent. */
165
+ function second(
166
+ values: ReadonlyMap<string, string>,
167
+ key: string,
168
+ ): number | null {
169
+ const text: string | undefined = values.get(key);
170
+ if (text === undefined) return null;
171
+ const value: number = Number(text);
172
+ if (!Number.isFinite(value) || value < 0)
173
+ throw new Error(`Review --${key} needs a finite nonnegative second`);
174
+ return value;
175
+ }
@@ -1,15 +1,9 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
 
3
3
  /**
4
- * The source revision a capture records: the production's git commit, with `+changes` when its working tree differs from that commit, or `unrecorded` when the folder is not in a git checkout or git is not installed.
5
- *
6
- * @evidence contracts/development/common.md#meaningful-documentation States the three forms and when each is written.
7
- * @evidence contracts/development/implementation.md#principled-implementation `git rev-parse HEAD` names the commit and `git status --porcelain` is empty exactly when nothing differs from it, so the revision says whether the commit alone repeats the capture.
8
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Two git calls, one fallback.
9
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A missing revision is written as `unrecorded`, never as a guessed commit.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms Two short processes per capture.
11
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Read once per capture, since the tree may change between captures.
12
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Both processes end before it returns.
4
+ * The source revision a capture records: the production's git commit, with
5
+ * `+changes` when its working tree differs from that commit, or `unrecorded`
6
+ * when the folder is not in a git checkout or git is not installed.
13
7
  */
14
8
  export function readAutoMovieRevision(root: string): string {
15
9
  const git: (args: string[]) => string = (args: string[]): string =>
@@ -0,0 +1,50 @@
1
+ import { parseArgs } from "node:util";
2
+
3
+ /**
4
+ * Admit the CLI's verification module, subjects, selected checks and one
5
+ * optional gate. Status is read-only without `--run`. A gate evaluates its
6
+ * whole stage even when `--only` limits execution to named check IDs.
7
+ *
8
+ * @param args The tokens after the command, excluding the executable name.
9
+ * @returns Production-relative module path, selection and output mode.
10
+ * @throws On malformed options, blank values or a repeated single-value option.
11
+ */
12
+ export function readAutoMovieVerifyOptions(args: readonly string[]): {
13
+ module: string;
14
+ subjects: string[];
15
+ only: string[];
16
+ require: string | null;
17
+ run: boolean;
18
+ json: boolean;
19
+ } {
20
+ const parsed = parseArgs({
21
+ args: [...args],
22
+ options: {
23
+ module: { type: "string", multiple: true },
24
+ subject: { type: "string", multiple: true },
25
+ only: { type: "string", multiple: true },
26
+ require: { type: "string", multiple: true },
27
+ run: { type: "boolean" },
28
+ json: { type: "boolean" },
29
+ },
30
+ }).values;
31
+ if ((parsed.module?.length ?? 0) > 1 || (parsed.require?.length ?? 0) > 1)
32
+ throw new Error("verify takes at most one --module and one --require.");
33
+ const texts: string[] = [
34
+ ...(parsed.module ?? []),
35
+ ...(parsed.subject ?? []),
36
+ ...(parsed.only ?? []),
37
+ ...(parsed.require ?? []),
38
+ ];
39
+ if (texts.some((text: string): boolean => text.trim().length === 0))
40
+ throw new Error("verify option values must not be blank.");
41
+
42
+ return {
43
+ module: parsed.module?.[0] ?? "src/executable/verify.ts",
44
+ subjects: [...new Set(parsed.subject ?? [])],
45
+ only: [...new Set(parsed.only ?? [])],
46
+ require: parsed.require?.[0] ?? null,
47
+ run: parsed.run ?? false,
48
+ json: parsed.json ?? false,
49
+ };
50
+ }
@@ -1,15 +1,11 @@
1
1
  /**
2
- * Read a video file's clock and raster from the log FFmpeg writes when it opens the file: the `Duration:` of the input and the size and rate of its first video stream.
2
+ * Read a video file's clock and raster from the log FFmpeg writes when it opens
3
+ * the file: the `Duration:` of the input and the size and rate of its first
4
+ * video stream.
3
5
  *
4
- * The rate is the stream's `fps` value, or its `tbr` when FFmpeg prints no `fps`. It throws naming what is missing when the log holds no duration, no video stream, or a stream without a size or a rate.
5
- *
6
- * @evidence contracts/development/common.md#meaningful-documentation States what is read from where, the rate's fallback and the refusal.
7
- * @evidence contracts/development/implementation.md#principled-implementation FFmpeg prints `Duration: HH:MM:SS.ss` for every input and, for a video stream, `WxH` followed by `fps` and `tbr`, its frame and base rates; reading the log FFmpeg already writes needs no `ffprobe`, which `ffmpeg-static` does not ship.
8
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One expression per value.
9
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A missing value throws instead of taking a default raster or rate.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the log.
11
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure reading of one log.
12
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns four numbers.
6
+ * The rate is the stream's `fps` value, or its `tbr` when FFmpeg prints no
7
+ * `fps`. It throws naming what is missing when the log holds no duration, no
8
+ * video stream, or a stream without a size or a rate.
13
9
  */
14
10
  export function readAutoMovieVideoProbe(log: string): {
15
11
  /** Running time in seconds. */
@@ -37,9 +33,24 @@ export function readAutoMovieVideoProbe(log: string): {
37
33
  const size: RegExpMatchArray | null = stream.match(
38
34
  /[ ,](\d{2,5})x(\d{2,5})[ ,[]/u,
39
35
  );
40
- const rate: RegExpMatchArray | null =
36
+ const exact: RegExpMatchArray | null =
37
+ /^\[Parsed_showinfo_\d+ @ [^\r\n]+?\] config in time_base:\s*\d+\/\d+,\s*frame_rate:\s*(\d+)\/(\d+)(?=\s|$)/mu.exec(
38
+ log,
39
+ );
40
+ const numerator: number = Number(exact?.[1]);
41
+ const denominator: number = Number(exact?.[2]);
42
+ const printed: RegExpMatchArray | null =
41
43
  stream.match(/([\d.]+) fps/u) ?? stream.match(/([\d.]+) tbr/u);
42
- if (size === null || rate === null)
44
+ const fps: number | null =
45
+ Number.isSafeInteger(numerator) &&
46
+ numerator > 0 &&
47
+ Number.isSafeInteger(denominator) &&
48
+ denominator > 0
49
+ ? numerator / denominator
50
+ : printed === null
51
+ ? null
52
+ : Number(printed[1]);
53
+ if (size === null || fps === null)
43
54
  throw new Error(
44
55
  `FFmpeg reported no size or rate for the video stream: ${stream.trim()}`,
45
56
  );
@@ -48,7 +59,7 @@ export function readAutoMovieVideoProbe(log: string): {
48
59
  Number(duration[1]) * 3600 +
49
60
  Number(duration[2]) * 60 +
50
61
  Number(duration[3]),
51
- fps: Number(rate[1]),
62
+ fps,
52
63
  width: Number(size[1]),
53
64
  height: Number(size[2]),
54
65
  };
@@ -2,13 +2,19 @@ import * as fs from "node:fs/promises";
2
2
 
3
3
  import { planAutoMovieChromiumLaunch } from "./planAutoMovieChromiumLaunch";
4
4
 
5
- /** Milliseconds the page may take to load and show its controls: ten minutes, room for a film that prepares its performance before its first frame. */
5
+ /**
6
+ * Milliseconds the page may take to load and show its controls: ten minutes,
7
+ * room for a film that prepares its performance before its first frame.
8
+ */
6
9
  const PREPARE: number = 600_000;
7
10
 
8
11
  /** Longest pause between two readings of the time readout, milliseconds. */
9
12
  const READING: number = 500;
10
13
 
11
- /** The time readout the inspector shows: the second and the duration, such as `1.25 / 12.00 s`. */
14
+ /**
15
+ * The time readout the inspector shows: the second and the duration, such as
16
+ * `1.25 / 12.00 s`.
17
+ */
12
18
  const READOUT: RegExp = /\d+\.\d+ \/ \d+\.\d+ s/u;
13
19
 
14
20
  /** The part of `playwright-core`'s `chromium` a playback recording calls. */
@@ -60,19 +66,26 @@ interface IRecordingLocator {
60
66
  }
61
67
 
62
68
  /**
63
- * Record real-time playback of the running inspector page: load it, press its Play button, and record the page as a video while reading its time readout, for a person to watch.
64
- *
65
- * The browser draws on the GPU backend, since playback is judged in real time; the recording is Playwright's own video of the page at a 1280 by 900 viewport, which `npx playwright-core install ffmpeg` provides. The page's Play button is found by its role and name, and the readout as the `output` showing `<second> / <duration> s`, both as the inspector renders them. The readout is read at most every half second for `seconds` of wall time after the click, and the page's script errors are collected. The video begins at navigation, so it includes the page's preparation; a reading's elapsed seconds count from the click.
69
+ * Record real-time playback of the running inspector page: load it, press its
70
+ * Play button, and record the page as a video while reading its time readout,
71
+ * for a person to watch.
66
72
  *
67
- * An uncaught page error before the controls are ready rejects immediately with that error as its cause; every page error also prints its stack, so a failed preparation leaves a usable diagnostic. It rejects when the page shows no Play button or readout within ten minutes and when the browser produced no video. Errors during playback remain in the returned report. The browser is closed on every outcome.
73
+ * The browser draws on the GPU backend, since playback is judged in real time;
74
+ * the recording is Playwright's own video of the page at a 1280 by 900
75
+ * viewport, which `npx playwright-core install ffmpeg` provides. The page's
76
+ * Play button is found by its role and name, and the readout as the `output`
77
+ * showing `<second> / <duration> s`, both as the inspector renders them. The
78
+ * readout is read at most every half second for `seconds` of wall time after
79
+ * the click, and the page's script errors are collected. The video begins at
80
+ * navigation, so it includes the page's preparation; a reading's elapsed
81
+ * seconds count from the click.
68
82
  *
69
- * @evidence contracts/development/common.md#meaningful-documentation States what is recorded and how, which backend and why, how the controls are found, the reading cadence, the clocks of the video and the readings, the refusals and the release.
70
- * @evidence contracts/development/implementation.md#principled-implementation Playback is observed on the page a person uses, through its own controls, so the recording shows the real loop's pacing instead of seeks turned into a supposed playback; Playwright closes the context to finish writing the video.
71
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Launch, open a recording context, load, press Play, read for the duration, close.
72
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A missing control or video is an error, never a recording of nothing.
73
- * @evidence contracts/development/implementation.md#efficient-algorithms One reading per half second.
74
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each review records afresh.
75
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The browser and its context are closed on every outcome; the readings grow by two per second of observation.
83
+ * An uncaught page error before the controls are ready rejects immediately with
84
+ * that error as its cause; every page error also prints its stack, so a failed
85
+ * preparation leaves a usable diagnostic. It rejects when the page shows no
86
+ * Play button or readout within ten minutes and when the browser produced no
87
+ * video. Errors during playback remain in the returned report. The browser is
88
+ * closed on every outcome.
76
89
  */
77
90
  export async function recordAutoMoviePlayback(props: {
78
91
  /** Playwright's `chromium`, loaded from the production. */