automovie 0.3.4 → 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,26 +1,24 @@
1
1
  import { AUTOMOVIE_CAPTURE_OPTIONS } from "./AUTOMOVIE_CAPTURE_OPTIONS";
2
2
  import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
3
+ import { readAutoMoviePageTimeout } from "./readAutoMoviePageTimeout";
3
4
 
4
5
  /**
5
- * Split the options of `automovie capture` into the host's own, `AUTOMOVIE_CAPTURE_OPTIONS`, and the capture request's, which `parseAutoMovieCapturePlanRequest` reads.
6
+ * Split the options of `automovie capture` into the host's own,
7
+ * `AUTOMOVIE_CAPTURE_OPTIONS`, and the capture request's, which
8
+ * `parseAutoMovieCapturePlanRequest` reads.
6
9
  *
7
- * | Option | Meaning | Absent |
8
- * | --- | --- | --- |
9
- * | `--module <file>` | The subject module whose `subjects` the draw page offers | Required unless `--file` |
10
- * | `--file <video>` | An encoded video file captured from its own frames instead of a drawn subject | A drawn subject |
11
- * | `--props <file>` | A JSON file whose value the module's `subjects` is called with, for subjects built from data a host computes | `null` |
12
- * | `--out <folder>` | The capture's root folder | `media/capture/<subject>` |
13
- * | `--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 unless `--file` |
13
+ * | `--file <video>` | An encoded video file captured from its own frames instead of a drawn subject | A drawn subject |
14
+ * | `--props <file>` | A JSON file whose value the module's `subjects` is called with, for subjects built from data a host computes | `null` |
15
+ * | `--out <folder>` | The capture's root folder | `media/capture/<subject>` |
16
+ * | `--backend <software\|gpu>` | How the browser draws | `software` |
17
+ * | `--timeout-ms <milliseconds>` | Per-call budget for page navigation, draw-function readiness, subject creation and drawing. Integer 1 to 2147483647 | `120000` |
14
18
  *
15
- * Every other option is left for the request reader, which refuses one it does not know. It throws for `--module` beside `--file`, neither of them, an empty value of any host option, and a backend that is not `software` or `gpu`.
16
- *
17
- * @evidence contracts/development/common.md#meaningful-documentation Tabulates the host's options with their meaning and absent value, says where the rest go, and states every refusal.
18
- * @evidence contracts/development/implementation.md#principled-implementation The host's keys are removed before the request is read, so the request grammar stays one grammar for the address, the command and props, and a host key cannot be mistaken for a request key.
19
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pass over the listed options that takes the host's keys out, then the checks; the list is the one the README test reads.
20
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No subject module is guessed from the folder: a capture names what it draws.
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 map and keeps nothing.
19
+ * Every other option is left for the request reader, which refuses one it does
20
+ * not know. It throws for `--module` beside `--file`, neither of them, an empty
21
+ * value of any host option, and a backend that is not `software` or `gpu`.
24
22
  */
25
23
  export function readAutoMovieCaptureHostOptions(
26
24
  values: ReadonlyMap<string, string>,
@@ -40,6 +38,12 @@ export function readAutoMovieCaptureHostOptions(
40
38
  /** How the browser draws. */
41
39
  backend: AutoMovieCaptureBackend;
42
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
+
43
47
  /** The request's own options, for the request reader. */
44
48
  request: Map<string, string>;
45
49
  } {
@@ -71,6 +75,7 @@ export function readAutoMovieCaptureHostOptions(
71
75
  props: taken.get("props") ?? null,
72
76
  out,
73
77
  backend,
78
+ timeout: readAutoMoviePageTimeout(taken.get("timeout-ms")),
74
79
  request,
75
80
  };
76
81
  }
@@ -5,19 +5,16 @@ import { readAutoMovieCreateArguments } from "./readAutoMovieCreateArguments";
5
5
  /**
6
6
  * Resolve one complete CLI request before any scaffold publication begins.
7
7
  *
8
- * `args` excludes the node executable and script positions. No arguments, or a lone `-h`/`--help`, means help; a lone `-v`/`--version` means version. `create` and `add` delegate their grammars to {@link readAutoMovieCreateArguments} and {@link readAutoMovieAddArguments}; `capture`, `inspect`, `render` and `review` keep their tokens for the production's option reader, which `run` loads. Every refusal throws an `Error` whose message names the correction.
8
+ * `args` excludes the node executable and script positions. No arguments, or a
9
+ * lone `-h`/`--help`, means help; a lone `-v`/`--version` means version.
10
+ * `create` and `add` delegate their grammars to
11
+ * {@link readAutoMovieCreateArguments} and {@link readAutoMovieAddArguments}.
12
+ * Production operations keep their tokens for their own option reader. Every
13
+ * refusal throws an `Error` whose message names the correction.
9
14
  *
10
15
  * @param args The command-line tokens after the executable and script.
11
16
  * @returns The admitted request.
12
17
  * @throws On an unknown command or any refusal of the delegated grammar.
13
- *
14
- * @evidence contracts/development/implementation.md#principled-implementation Standalone flags are decided before any command because they admit no other token, and each command's grammar validates the whole request before returning, so `run` never begins publication on a partially understood command line.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure This function only dispatches on the first token; each command owns its own grammar file, avoiding an argument-parsing dependency.
16
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The command spellings are the documented CLI contract; every other first token is refused with a message rather than ignored, and no fallback admits a removed command such as `start`.
17
- * @evidence contracts/development/common.md#meaningful-documentation The comment states which argv positions `args` excludes, what the standalone flags mean, which owner parses each command, and that every refusal names the correction.
18
- * @evidence contracts/development/implementation.md#efficient-algorithms One destructuring copy and one comparison chain before the delegated linear scan.
19
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure parser handles one supplied vector per call and coordinates no requests or effectful work.
20
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The parser opens no handle or task and retains no array after return; returned requests keep only their admitted strings and flags.
21
18
  */
22
19
  export function readAutoMovieCommandArguments(
23
20
  args: readonly string[],
@@ -34,8 +31,9 @@ export function readAutoMovieCommandArguments(
34
31
  if (command === "inspect") return { command: "inspect", args: [...rest] };
35
32
  if (command === "render") return { command: "render", args: [...rest] };
36
33
  if (command === "review") return { command: "review", args: [...rest] };
34
+ if (command === "verify") return { command: "verify", args: [...rest] };
37
35
  throw new Error(
38
- `Unknown command ${JSON.stringify(command)}; the commands are create, add, capture, inspect, render and review (see --help).`,
36
+ `Unknown command ${JSON.stringify(command)}; the commands are create, add, capture, inspect, render, review and verify (see --help).`,
39
37
  );
40
38
  }
41
39
 
@@ -2,21 +2,17 @@ import type { AutoMovieCommand } from "./AutoMovieCommand";
2
2
  import { readAutoMovieNameOption } from "./readAutoMovieNameOption";
3
3
 
4
4
  /**
5
- * Admit one `create` request: exactly one non-blank target directory with optional single `--workspace`, `--force` and `--name <name>`, in any order.
5
+ * Admit one `create` request: exactly one non-blank target directory with
6
+ * optional single `--workspace`, `--force` and `--name <name>`, in any order.
6
7
  *
7
- * There is no `--` terminator, so a directory beginning with `-` must be spelled `./-name`. Every refusal throws an `Error` whose message names the correction.
8
+ * There is no `--` terminator, so a directory beginning with `-` must be
9
+ * spelled `./-name`. Every refusal throws an `Error` whose message names the
10
+ * correction.
8
11
  *
9
12
  * @param args The tokens after `create`.
10
13
  * @returns The admitted request.
11
- * @throws On an unknown or repeated option, a missing name value, or anything other than one non-blank directory.
12
- *
13
- * @evidence contracts/development/implementation.md#principled-implementation A complete left-to-right scan admits each flag once and consumes `--name`'s value, so every token is classified before any filesystem work.
14
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The create grammar is separate from add; `readAutoMovieNameOption` owns the shared value rule and `run` owns resolution.
15
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No default directory, inferred workspace mode or derived name is introduced here.
16
- * @evidence contracts/development/common.md#meaningful-documentation The comment states the grammar, the dash-leading spelling and that refusals name their correction.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms One scan over the tokens.
18
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure parser owns no cross-request effect to reuse.
19
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Local strings and arrays expire after return and no handle is acquired.
14
+ * @throws On an unknown or repeated option, a missing name value, or anything
15
+ * other than one non-blank directory.
20
16
  */
21
17
  export function readAutoMovieCreateArguments(
22
18
  args: readonly string[],
@@ -0,0 +1,137 @@
1
+ import { AutoMovieMp4Boxes } from "./AutoMovieMp4Boxes";
2
+ import type { IAutoMovieDeliveryAudioTrack } from "./IAutoMovieDeliveryAudioTrack";
3
+
4
+ /** The box readers the reader walks the movie box with. */
5
+ const {
6
+ children,
7
+ clock,
8
+ edits,
9
+ field,
10
+ handler,
11
+ only,
12
+ }: typeof AutoMovieMp4Boxes = AutoMovieMp4Boxes;
13
+
14
+ /**
15
+ * Reads how much of an audio track an MP4 file presents, from the container's
16
+ * own sample table and edit list.
17
+ *
18
+ * An AAC decoder returns whole 1024-sample frames, so the final decoded frame
19
+ * can run past the soundtrack. The container records where presentation ends:
20
+ * the sample table gives the exact media end, with a shortened last sample, and
21
+ * the edit list gives the encoder priming skipped at the start. The edit's
22
+ * duration is stored in the coarser movie clock, so an edit ending within one
23
+ * movie tick of the media end is that end rounded (2133.33 ms is written as
24
+ * 2133 ms). Only an edit ending a whole movie tick or more earlier trims the
25
+ * track. The presented duration is that end less the skipped priming.
26
+ *
27
+ * @param path The delivery file whose bytes are audited.
28
+ * @param streamIndex FFmpeg's input stream index, which counts the file's
29
+ * tracks in order.
30
+ * @returns The presented duration in the track's media clock, or why it is
31
+ * unknown.
32
+ */
33
+ export async function readAutoMovieDeliveryAudioTrack(
34
+ path: string,
35
+ streamIndex: number,
36
+ ): Promise<IAutoMovieDeliveryAudioTrack> {
37
+ try {
38
+ const { movie } = await AutoMovieMp4Boxes.read(path);
39
+ return movie === undefined
40
+ ? { status: "uncovered", reason: "The delivery has no MP4 movie box" }
41
+ : presentation(movie, streamIndex);
42
+ } catch (error) {
43
+ return {
44
+ status: "uncovered",
45
+ reason:
46
+ "The delivery's MP4 audio timing could not be read: " +
47
+ (error instanceof Error ? error.message : String(error)),
48
+ };
49
+ }
50
+ }
51
+
52
+ /** Combines the selected track's edit list and sample table. */
53
+ function presentation(
54
+ movie: Buffer,
55
+ streamIndex: number,
56
+ ): IAutoMovieDeliveryAudioTrack {
57
+ const root: AutoMovieMp4Boxes.IBox = {
58
+ type: "moov",
59
+ start: 0,
60
+ end: movie.length,
61
+ };
62
+ const movieClock: bigint = BigInt(
63
+ clock(movie, only(movie, root, "mvhd")).timescale,
64
+ );
65
+ const track: AutoMovieMp4Boxes.IBox | undefined = children(
66
+ movie,
67
+ root.start,
68
+ root.end,
69
+ ).filter((box: AutoMovieMp4Boxes.IBox): boolean => box.type === "trak")[
70
+ streamIndex
71
+ ];
72
+ if (track === undefined)
73
+ return { status: "uncovered", reason: "The audio track is not listed" };
74
+ if (handler(movie, track) !== "soun")
75
+ return { status: "uncovered", reason: "The selected track is not audio" };
76
+ const media: AutoMovieMp4Boxes.IBox = only(movie, track, "mdia");
77
+ const mediaClock: bigint = BigInt(
78
+ clock(movie, only(movie, media, "mdhd")).timescale,
79
+ );
80
+
81
+ const table: AutoMovieMp4Boxes.IBox = only(
82
+ movie,
83
+ only(movie, only(movie, media, "minf"), "stbl"),
84
+ "stts",
85
+ );
86
+ const entries: number = movie.readUInt32BE(field(table, 4, 4));
87
+ let mediaEnd: bigint = 0n;
88
+ for (let entry: number = 0; entry < entries; ++entry) {
89
+ const at: number = field(table, 8 + entry * 8, 8);
90
+ mediaEnd +=
91
+ BigInt(movie.readUInt32BE(at)) * BigInt(movie.readUInt32BE(at + 4));
92
+ }
93
+
94
+ let skipped: bigint = 0n;
95
+ let end: bigint = mediaEnd;
96
+ const list: AutoMovieMp4Boxes.IEdit[] = edits(movie, track);
97
+ if (list.length !== 0) {
98
+ if (list.length !== 1)
99
+ return {
100
+ status: "uncovered",
101
+ reason: "The audio track has other than one edit",
102
+ };
103
+ const edit: AutoMovieMp4Boxes.IEdit = list[0]!;
104
+ const segment: bigint = edit.segmentDuration;
105
+ skipped = edit.mediaTime;
106
+ if (
107
+ skipped < 0n ||
108
+ segment === 0n ||
109
+ edit.mediaRateInteger !== 1 ||
110
+ edit.mediaRateFraction !== 0
111
+ )
112
+ return {
113
+ status: "uncovered",
114
+ reason: "The audio edit is empty, unbounded or not at unit rate",
115
+ };
116
+ // The segment is quantized to the movie clock. Within one movie tick of
117
+ // the media end it is that end rounded; only a shorter edit trims.
118
+ if ((mediaEnd - skipped) * movieClock - segment * mediaClock >= mediaClock)
119
+ end =
120
+ skipped + (segment * mediaClock * 2n + movieClock) / (movieClock * 2n);
121
+ }
122
+ const duration: bigint = end - skipped;
123
+ if (
124
+ duration <= 0n ||
125
+ duration > BigInt(Number.MAX_SAFE_INTEGER) ||
126
+ mediaClock > BigInt(Number.MAX_SAFE_INTEGER)
127
+ )
128
+ return {
129
+ status: "uncovered",
130
+ reason: "The audio track presents no safe positive duration",
131
+ };
132
+ return {
133
+ status: "read",
134
+ timescale: Number(mediaClock),
135
+ duration: Number(duration),
136
+ };
137
+ }
@@ -0,0 +1,269 @@
1
+ import type { IAutoMovieDeliveryContentAudit } from "@automovie/interface";
2
+
3
+ type Audit = IAutoMovieDeliveryContentAudit.IProps;
4
+ type Detector = Extract<
5
+ IAutoMovieDeliveryContentAudit.Detector,
6
+ "black" | "frozen"
7
+ >;
8
+ type Ratio = IAutoMovieDeliveryContentAudit.Ratio;
9
+ type Stream = IAutoMovieDeliveryContentAudit.Stream;
10
+ type Observation = IAutoMovieDeliveryContentAudit.IObservation;
11
+
12
+ interface IFrame {
13
+ index: number;
14
+ pts: number;
15
+ ptsTime: string;
16
+ duration: number;
17
+ }
18
+
19
+ interface IMarker {
20
+ detector: Detector;
21
+ edge: "start" | "end";
22
+ carrier: number;
23
+ ptsTime: string;
24
+ }
25
+
26
+ /**
27
+ * Reads native video timing and detector markers from a successful FFmpeg
28
+ * delivery decode. It also identifies the input's first audio stream when one
29
+ * is listed, allowing the host to decide whether the audio pass is required.
30
+ *
31
+ * @param log Complete stderr from a successful video decode.
32
+ * @param expected Commissioned rational frame rate and frame count.
33
+ * @returns Decoded video evidence and the independently observed audio stream
34
+ * status.
35
+ */
36
+ export function readAutoMovieDeliveryDecode(
37
+ log: string,
38
+ expected: Pick<Audit["expected"], "frameRate" | "frameCount">,
39
+ ): { video: Stream; audio: Stream; audioIndex?: number } {
40
+ let videoIndex: number | undefined;
41
+ let audioIndex: number | undefined;
42
+ let listingInput = false;
43
+ let inputListed = false;
44
+ let timeBase: Ratio | undefined;
45
+ let carrier: number | undefined;
46
+ let malformed = false;
47
+ const frames: IFrame[] = [];
48
+ const markers: IMarker[] = [];
49
+
50
+ for (const line of log.split(/\r?\n/u)) {
51
+ if (/^Input #0,/u.test(line)) listingInput = true;
52
+ if (listingInput) {
53
+ if (line === "Stream mapping:") {
54
+ listingInput = false;
55
+ inputListed = true;
56
+ }
57
+ const match =
58
+ /^\s+Stream #0:(\d+)(?:\[[^\]]*\])?(?:\([^)]*\))?: (Video|Audio):/u.exec(
59
+ line,
60
+ );
61
+ if (match !== null) {
62
+ const index = Number(match[1]);
63
+ if (match[2] === "Video") videoIndex ??= index;
64
+ if (match[2] === "Audio") audioIndex ??= index;
65
+ }
66
+ }
67
+
68
+ const video = /^\[Parsed_showinfo_\d+ @ [^\]]+\]\s+(.*)$/u.exec(line)?.[1];
69
+ if (video !== undefined) {
70
+ const clock = /^config in time_base:\s*(\d+)\/(\d+),/u.exec(video);
71
+ if (clock !== null) {
72
+ if (timeBase !== undefined) malformed = true;
73
+ timeBase = [Number(clock[1]), Number(clock[2])];
74
+ }
75
+ if (video.startsWith("n:")) {
76
+ const row =
77
+ /^n:\s*(\d+)\s+pts:\s*(-?\d+)\s+pts_time:(\S+)\s+duration:\s*(\d+)\s/u.exec(
78
+ video,
79
+ );
80
+ const index = Number(row?.[1]);
81
+ const pts = Number(row?.[2]);
82
+ const ptsTime = row?.[3];
83
+ const duration = Number(row?.[4]);
84
+ if (
85
+ ptsTime === undefined ||
86
+ ![index, pts, duration, pts + duration].every(Number.isSafeInteger) ||
87
+ duration < 1
88
+ )
89
+ malformed = true;
90
+ else frames.push({ index, pts, ptsTime, duration });
91
+ }
92
+ }
93
+
94
+ const metadata = /^\[Parsed_metadata_\d+ @ [^\]]+\]\s+(.*)$/u.exec(
95
+ line,
96
+ )?.[1];
97
+ if (metadata === undefined) continue;
98
+ if (metadata.startsWith("frame:")) {
99
+ const row = /^frame:\s*\d+\s+pts:\s*(-?\d+)\s+pts_time:/u.exec(metadata);
100
+ carrier = row === null ? undefined : Number(row[1]);
101
+ if (carrier === undefined || !Number.isSafeInteger(carrier))
102
+ malformed = true;
103
+ continue;
104
+ }
105
+ const marker =
106
+ /^lavfi\.(black_|freezedetect\.freeze_)(start|end)=(\S+)$/u.exec(
107
+ metadata,
108
+ );
109
+ if (marker === null) continue;
110
+ if (carrier === undefined || marker[3] === undefined) malformed = true;
111
+ else
112
+ markers.push({
113
+ detector: marker[1] === "black_" ? "black" : "frozen",
114
+ edge: marker[2] === "start" ? "start" : "end",
115
+ carrier,
116
+ ptsTime: marker[3],
117
+ });
118
+ }
119
+
120
+ const audio: Stream =
121
+ !inputListed || audioIndex !== undefined
122
+ ? {
123
+ status: "uncovered",
124
+ reason: inputListed
125
+ ? "The listed audio stream has not been decoded"
126
+ : "The delivery input stream listing was incomplete",
127
+ }
128
+ : { status: "missing" };
129
+ const inventory = {
130
+ audio,
131
+ ...(audioIndex === undefined ? {} : { audioIndex }),
132
+ };
133
+ if (inputListed && videoIndex === undefined)
134
+ return { video: { status: "missing" }, ...inventory };
135
+
136
+ const first = frames[0];
137
+ const last = frames.at(-1);
138
+ if (
139
+ malformed ||
140
+ videoIndex === undefined ||
141
+ !Number.isSafeInteger(videoIndex) ||
142
+ timeBase === undefined ||
143
+ !timeBase.every((value) => Number.isSafeInteger(value) && value > 0) ||
144
+ first === undefined ||
145
+ last === undefined
146
+ )
147
+ return {
148
+ video: {
149
+ status: "uncovered",
150
+ reason: "Incomplete or invalid decoder frame evidence",
151
+ },
152
+ ...inventory,
153
+ };
154
+
155
+ const continuous =
156
+ frames.length === expected.frameCount &&
157
+ isCommissionedGrid(frames, timeBase, expected.frameRate);
158
+ const observations = continuous ? readMarkers(markers, frames, timeBase) : [];
159
+ if (observations === undefined)
160
+ return {
161
+ video: {
162
+ status: "uncovered",
163
+ reason: "Ambiguous or incomplete video detector markers",
164
+ },
165
+ ...inventory,
166
+ };
167
+
168
+ return {
169
+ video: {
170
+ status: "decoded",
171
+ index: videoIndex,
172
+ start: { ticks: first.pts, timeBase },
173
+ end: { ticks: last.pts + last.duration, timeBase },
174
+ continuous,
175
+ observations,
176
+ },
177
+ ...inventory,
178
+ };
179
+ }
180
+
181
+ /**
182
+ * Checks every frame index, native presentation tick and native duration on the
183
+ * rational grid.
184
+ */
185
+ function isCommissionedGrid(
186
+ frames: IFrame[],
187
+ timeBase: Ratio,
188
+ rate: Ratio,
189
+ ): boolean {
190
+ if (!rate.every((value) => Number.isSafeInteger(value) && value > 0))
191
+ return false;
192
+ const scale = BigInt(timeBase[0]) * BigInt(rate[0]);
193
+ const step = BigInt(timeBase[1]) * BigInt(rate[1]);
194
+ return frames.every(
195
+ (frame, index) =>
196
+ frame.index === index &&
197
+ BigInt(frame.pts) * scale === BigInt(index) * step &&
198
+ BigInt(frame.duration) * scale === step,
199
+ );
200
+ }
201
+
202
+ /**
203
+ * Resolves paired transitions to exact decoded frame starts, allowing an open
204
+ * range at verified EOF.
205
+ */
206
+ function readMarkers(
207
+ markers: IMarker[],
208
+ frames: IFrame[],
209
+ timeBase: Ratio,
210
+ ): Observation[] | undefined {
211
+ if (markers.length === 0) return [];
212
+ const byTick = new Map<number, IFrame>();
213
+ const byPrintedTime = new Map<string, IFrame | null>();
214
+ for (const frame of frames) {
215
+ byTick.set(frame.pts, frame);
216
+ byPrintedTime.set(
217
+ frame.ptsTime,
218
+ byPrintedTime.has(frame.ptsTime) ? null : frame,
219
+ );
220
+ }
221
+ const open: Partial<Record<Detector, IFrame>> = {};
222
+ const observations: Observation[] = [];
223
+ for (const marker of markers) {
224
+ const carrier = byTick.get(marker.carrier);
225
+ const start = open[marker.detector];
226
+ if (carrier === undefined) return undefined;
227
+ if (marker.edge === "start") {
228
+ const origin =
229
+ marker.detector === "frozen"
230
+ ? byPrintedTime.get(marker.ptsTime)
231
+ : carrier;
232
+ if (
233
+ start !== undefined ||
234
+ origin === undefined ||
235
+ origin === null ||
236
+ origin.index > carrier.index ||
237
+ origin.ptsTime !== marker.ptsTime
238
+ )
239
+ return undefined;
240
+ open[marker.detector] = origin;
241
+ continue;
242
+ }
243
+ if (
244
+ start === undefined ||
245
+ carrier.ptsTime !== marker.ptsTime ||
246
+ start.index >= carrier.index
247
+ )
248
+ return undefined;
249
+ delete open[marker.detector];
250
+ if (marker.detector === "frozen" && carrier.index - start.index < 2)
251
+ continue;
252
+ observations.push({
253
+ detector: marker.detector,
254
+ start: { ticks: start.pts, timeBase },
255
+ end: { ticks: carrier.pts, timeBase },
256
+ });
257
+ }
258
+
259
+ for (const detector of ["black", "frozen"] as const) {
260
+ const start = open[detector];
261
+ if (start !== undefined)
262
+ observations.push({
263
+ detector,
264
+ start: { ticks: start.pts, timeBase },
265
+ end: null,
266
+ });
267
+ }
268
+ return observations;
269
+ }