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
@@ -0,0 +1,499 @@
1
+ import type {
2
+ IAutoMovieProductionAacDescription,
3
+ IAutoMovieProductionAudioProbe,
4
+ IAutoMovieProductionVideoProbe,
5
+ IAutoMovieProductionVideoProfile,
6
+ } from "@automovie/interface";
7
+
8
+ import { AutoMovieMp4Boxes } from "./AutoMovieMp4Boxes";
9
+
10
+ /** The box readers the probe walks the movie box with. */
11
+ const {
12
+ children,
13
+ clock,
14
+ edits,
15
+ field,
16
+ handler,
17
+ only,
18
+ }: typeof AutoMovieMp4Boxes = AutoMovieMp4Boxes;
19
+
20
+ /**
21
+ * MPEG-4 audio sampling-frequency table, by `samplingFrequencyIndex` (ISO/IEC
22
+ * 14496-3 Table 1.18).
23
+ */
24
+ const AAC_SAMPLE_RATES: readonly number[] = [
25
+ 96_000, 88_200, 64_000, 48_000, 44_100, 32_000, 24_000, 22_050, 16_000,
26
+ 12_000, 11_025, 8_000, 7_350,
27
+ ];
28
+
29
+ /**
30
+ * Read the picture and sound facts a delivery profile is checked against from
31
+ * an MP4 file's own boxes, as ISO/IEC 14496-12 and 14496-14 lay them out.
32
+ *
33
+ * The video probe comes from the one `vide` track: `ftyp` brands; the `avc1`
34
+ * sample entry's coded raster with its `pasp` and `colr` children; the track
35
+ * header's 16.16 display raster and matrix; the movie, track and media clocks
36
+ * and the edit list; and the sample timing from `stts` and `ctts`. A sample
37
+ * table with more than one sample duration is reported with duration 0, which
38
+ * the profile refuses as not constant. Composition times are decode times plus
39
+ * the `ctts` offsets, and the first and last are their minimum and maximum.
40
+ * `color.resolved` is `srgb` only when the `nclx` code points equal `srgb`, the
41
+ * sRGB identity the caller passes from `render`, so the probe and the profile
42
+ * read one definition.
43
+ *
44
+ * The audio probe comes from the one `soun` track, or is `null` when the file
45
+ * has none: the `mp4a` sample entry's channel count and rate, the `esds`
46
+ * AudioSpecificConfig's object type, rate and channel configuration, the clocks
47
+ * and the edit list, with the priming samples taken as a single edit's media
48
+ * time.
49
+ *
50
+ * It throws naming the box when the file has no movie box, no video track, a
51
+ * second track of one kind, a video track that is not `avc1` or a malformed or
52
+ * truncated box.
53
+ *
54
+ * @param path The encoded delivery file; only its headers are read.
55
+ * @param srgb The H.273 code points that spell sRGB
56
+ * (`AUTOMOVIE_MP4_SRGB_COLOUR`).
57
+ * @returns The video facts and the audio facts or `null`.
58
+ */
59
+ export async function readAutoMovieDeliveryProbe(
60
+ path: string,
61
+ srgb: Readonly<IAutoMovieProductionVideoProfile["color"]>,
62
+ ): Promise<{
63
+ video: IAutoMovieProductionVideoProbe;
64
+ audio: IAutoMovieProductionAudioProbe | null;
65
+ }> {
66
+ const { fileType, movie }: AutoMovieMp4Boxes.IFile =
67
+ await AutoMovieMp4Boxes.read(path);
68
+ if (movie === undefined) throw new Error("the file has no moov box");
69
+ const root: AutoMovieMp4Boxes.IBox = {
70
+ type: "moov",
71
+ start: 0,
72
+ end: movie.length,
73
+ };
74
+ const movieTimescale: number = clock(
75
+ movie,
76
+ only(movie, root, "mvhd"),
77
+ ).timescale;
78
+ const tracks: AutoMovieMp4Boxes.IBox[] = children(
79
+ movie,
80
+ 0,
81
+ movie.length,
82
+ ).filter((box: AutoMovieMp4Boxes.IBox): boolean => box.type === "trak");
83
+ const byHandler: (kind: string) => AutoMovieMp4Boxes.IBox[] = (
84
+ kind: string,
85
+ ): AutoMovieMp4Boxes.IBox[] =>
86
+ tracks.filter(
87
+ (track: AutoMovieMp4Boxes.IBox): boolean =>
88
+ handler(movie, track) === kind,
89
+ );
90
+ const video: AutoMovieMp4Boxes.IBox[] = byHandler("vide");
91
+ const audio: AutoMovieMp4Boxes.IBox[] = byHandler("soun");
92
+ if (video.length !== 1)
93
+ throw new Error(`the file has ${video.length} video tracks, not one`);
94
+ if (audio.length > 1)
95
+ throw new Error(`the file has ${audio.length} audio tracks, not one`);
96
+ return {
97
+ video: readVideo(movie, video[0]!, movieTimescale, fileType, srgb),
98
+ audio:
99
+ audio[0] === undefined
100
+ ? null
101
+ : readAudio(movie, audio[0], movieTimescale),
102
+ };
103
+ }
104
+
105
+ /** The clocks and edit list every track shares. */
106
+ interface ITrackClock {
107
+ /** Track presentation duration in movie ticks (`tkhd`). */
108
+ movieDuration: number;
109
+
110
+ /** Media ticks per second (`mdhd`). */
111
+ mediaTimescale: number;
112
+
113
+ /** Encoded duration in media ticks (`mdhd`). */
114
+ mediaDuration: number;
115
+
116
+ /** The track's edits. */
117
+ edits: IAutoMovieProductionVideoProbe["presentation"]["edits"];
118
+
119
+ /** The `stbl` box. */
120
+ table: AutoMovieMp4Boxes.IBox;
121
+
122
+ /** The first sample entry in `stsd`. */
123
+ entry: AutoMovieMp4Boxes.IBox;
124
+ }
125
+
126
+ /** Read a track's header, media header, edit list and sample description. */
127
+ function trackClock(movie: Buffer, track: AutoMovieMp4Boxes.IBox): ITrackClock {
128
+ const media: AutoMovieMp4Boxes.IBox = only(movie, track, "mdia");
129
+ const mediaHeader: { timescale: number; duration: bigint } = clock(
130
+ movie,
131
+ only(movie, media, "mdhd"),
132
+ );
133
+ const table: AutoMovieMp4Boxes.IBox = only(
134
+ movie,
135
+ only(movie, media, "minf"),
136
+ "stbl",
137
+ );
138
+ const description: AutoMovieMp4Boxes.IBox = only(movie, table, "stsd");
139
+
140
+ // `stsd` is a full box with an entry count before its sample entries.
141
+ const entry: AutoMovieMp4Boxes.IBox | undefined = children(
142
+ movie,
143
+ field(description, 8, 0),
144
+ description.end,
145
+ )[0];
146
+ if (entry === undefined) throw new Error("the stsd box has no sample entry");
147
+ return {
148
+ movieDuration: safe(clock(movie, only(movie, track, "tkhd")).duration),
149
+ mediaTimescale: mediaHeader.timescale,
150
+ mediaDuration: safe(mediaHeader.duration),
151
+ edits: edits(movie, track).map(
152
+ (
153
+ edit: AutoMovieMp4Boxes.IEdit,
154
+ ): IAutoMovieProductionVideoProbe["presentation"]["edits"][number] => ({
155
+ segmentDuration: safe(edit.segmentDuration),
156
+ mediaTime: safe(edit.mediaTime),
157
+ mediaRateInteger: edit.mediaRateInteger,
158
+ mediaRateFraction: edit.mediaRateFraction,
159
+ }),
160
+ ),
161
+ table,
162
+ entry,
163
+ };
164
+ }
165
+
166
+ /** Read the video probe from the one video track. */
167
+ function readVideo(
168
+ movie: Buffer,
169
+ track: AutoMovieMp4Boxes.IBox,
170
+ movieTimescale: number,
171
+ fileType: Buffer | undefined,
172
+ srgb: Readonly<IAutoMovieProductionVideoProfile["color"]>,
173
+ ): IAutoMovieProductionVideoProbe {
174
+ const timing: ITrackClock = trackClock(movie, track);
175
+ const entry: AutoMovieMp4Boxes.IBox = timing.entry;
176
+ if (entry.type !== "avc1")
177
+ throw new Error(`the video sample entry is ${entry.type}, not avc1`);
178
+
179
+ // VisualSampleEntry: 8 bytes of SampleEntry, 16 of reserved and
180
+ // pre-defined fields, then the 16-bit coded width and height; its child
181
+ // boxes start after the fixed 78 bytes.
182
+ const width: number = movie.readUInt16BE(field(entry, 24, 2));
183
+ const height: number = movie.readUInt16BE(field(entry, 26, 2));
184
+ const extensions: AutoMovieMp4Boxes.IBox = {
185
+ type: entry.type,
186
+ start: field(entry, 78, 0),
187
+ end: entry.end,
188
+ };
189
+ const aspect: AutoMovieMp4Boxes.IBox | undefined = only(
190
+ movie,
191
+ extensions,
192
+ "pasp",
193
+ true,
194
+ );
195
+ const colour: AutoMovieMp4Boxes.IBox | undefined = children(
196
+ movie,
197
+ extensions.start,
198
+ extensions.end,
199
+ ).find(
200
+ (box: AutoMovieMp4Boxes.IBox): boolean =>
201
+ box.type === "colr" &&
202
+ movie.toString("latin1", field(box, 0, 4), box.start + 4) === "nclx",
203
+ );
204
+
205
+ // tkhd: the matrix follows the duration, two reserved words, layer,
206
+ // alternate group, volume and a reserved half-word; width and height follow
207
+ // the matrix as 16.16 values.
208
+ const header: AutoMovieMp4Boxes.IBox = only(movie, track, "tkhd");
209
+ const matrixAt: number = movie[field(header, 0, 1)] === 1 ? 52 : 40;
210
+ const matrix: number[] = [];
211
+ for (let k: number = 0; k < 9; k++)
212
+ matrix.push(movie.readInt32BE(field(header, matrixAt + k * 4, 4)));
213
+
214
+ const samples: ISampleTiming = sampleTiming(movie, timing.table);
215
+ const container: IAutoMovieProductionVideoProbe["color"]["container"] =
216
+ colour === undefined
217
+ ? { kind: "absent" }
218
+ : {
219
+ kind: "nclx",
220
+ primaries: movie.readUInt16BE(field(colour, 4, 2)),
221
+ transfer: movie.readUInt16BE(field(colour, 6, 2)),
222
+ matrix: movie.readUInt16BE(field(colour, 8, 2)),
223
+ fullRange: (movie[field(colour, 10, 1)]! & 0x80) !== 0,
224
+ };
225
+ const brands: string[] = [];
226
+ if (fileType !== undefined)
227
+ for (let at: number = 8; at + 4 <= fileType.length; at += 4)
228
+ brands.push(fileType.toString("latin1", at, at + 4));
229
+ const divisor: number = gcd(timing.mediaTimescale, samples.duration);
230
+ return {
231
+ kind: "video",
232
+ container: "mp4",
233
+ codec: "h264",
234
+ width,
235
+ height,
236
+ runtimeSeconds: timing.mediaDuration / timing.mediaTimescale,
237
+ frameCount: samples.count,
238
+ fps: samples.duration === 0 ? 0 : timing.mediaTimescale / samples.duration,
239
+ frameRate: {
240
+ numerator: timing.mediaTimescale / divisor,
241
+ denominator: samples.duration / divisor,
242
+ },
243
+ brands: {
244
+ major: fileType === undefined ? "" : fileType.toString("latin1", 0, 4),
245
+ compatible: brands,
246
+ },
247
+ coded: { width, height },
248
+ trackDisplay: {
249
+ width16_16: movie.readUInt32BE(field(header, matrixAt + 36, 4)),
250
+ height16_16: movie.readUInt32BE(field(header, matrixAt + 40, 4)),
251
+ },
252
+ trackMatrix: matrix as IAutoMovieProductionVideoProbe["trackMatrix"],
253
+ pixelAspect:
254
+ aspect === undefined
255
+ ? { kind: "implicit-square" }
256
+ : {
257
+ kind: "explicit",
258
+ hSpacing: movie.readUInt32BE(field(aspect, 0, 4)),
259
+ vSpacing: movie.readUInt32BE(field(aspect, 4, 4)),
260
+ },
261
+ presentation: {
262
+ movieTimescale,
263
+ mediaTimescale: timing.mediaTimescale,
264
+ movieDuration: timing.movieDuration,
265
+ mediaDuration: timing.mediaDuration,
266
+ edits: timing.edits,
267
+ },
268
+ samples: { ...samples, timescale: timing.mediaTimescale },
269
+ color: {
270
+ container,
271
+ resolved:
272
+ container.kind === "nclx" &&
273
+ container.primaries === srgb.primaries &&
274
+ container.transfer === srgb.transfer &&
275
+ container.matrix === srgb.matrix &&
276
+ container.fullRange === srgb.fullRange
277
+ ? { kind: "srgb", source: "container" }
278
+ : { kind: "absent" },
279
+ },
280
+ };
281
+ }
282
+
283
+ /** A video track's sample count, constant duration and timestamp bounds. */
284
+ type ISampleTiming = Omit<
285
+ IAutoMovieProductionVideoProbe["samples"],
286
+ "timescale"
287
+ >;
288
+
289
+ /** Read the decode times from `stts` and the composition offsets from `ctts`. */
290
+ function sampleTiming(
291
+ movie: Buffer,
292
+ table: AutoMovieMp4Boxes.IBox,
293
+ ): ISampleTiming {
294
+ const decode: AutoMovieMp4Boxes.IBox = only(movie, table, "stts");
295
+ const runs: number = movie.readUInt32BE(field(decode, 4, 4));
296
+ const deltas: number[] = [];
297
+ let count: number = 0;
298
+ let lastDts: number = 0;
299
+ let time: number = 0;
300
+ for (let run: number = 0; run < runs; run++) {
301
+ const at: number = field(decode, 8 + run * 8, 8);
302
+ const samples: number = movie.readUInt32BE(at);
303
+ const delta: number = movie.readUInt32BE(at + 4);
304
+ if (samples === 0) continue;
305
+ deltas.push(delta);
306
+ count += samples;
307
+ lastDts = time + (samples - 1) * delta;
308
+ time += samples * delta;
309
+ }
310
+ const constant: boolean = deltas.every(
311
+ (delta: number): boolean => delta === deltas[0],
312
+ );
313
+
314
+ // Composition time is decode time plus the sample's offset; without `ctts`
315
+ // every offset is zero.
316
+ let firstCts: number = 0;
317
+ let lastCts: number = lastDts;
318
+ const composition: AutoMovieMp4Boxes.IBox | undefined = only(
319
+ movie,
320
+ table,
321
+ "ctts",
322
+ true,
323
+ );
324
+ if (composition !== undefined) {
325
+ const signed: boolean = movie[field(composition, 0, 1)] === 1;
326
+ const entries: number = movie.readUInt32BE(field(composition, 4, 4));
327
+ const dts: number[] = decodeTimes(movie, decode, runs);
328
+ firstCts = Infinity;
329
+ lastCts = -Infinity;
330
+ let sample: number = 0;
331
+ for (let entry: number = 0; entry < entries; entry++) {
332
+ const at: number = field(composition, 8 + entry * 8, 8);
333
+ const repeat: number = movie.readUInt32BE(at);
334
+ const offset: number = signed
335
+ ? movie.readInt32BE(at + 4)
336
+ : movie.readUInt32BE(at + 4);
337
+ for (
338
+ let k: number = 0;
339
+ k < repeat && sample < dts.length;
340
+ k++, sample++
341
+ ) {
342
+ firstCts = Math.min(firstCts, dts[sample]! + offset);
343
+ lastCts = Math.max(lastCts, dts[sample]! + offset);
344
+ }
345
+ }
346
+ }
347
+ return {
348
+ count,
349
+ duration: constant && deltas.length > 0 ? deltas[0]! : 0,
350
+ firstDts: 0,
351
+ lastDts,
352
+ firstCts,
353
+ lastCts,
354
+ };
355
+ }
356
+
357
+ /** Every sample's decode time, from the `stts` runs. */
358
+ function decodeTimes(
359
+ movie: Buffer,
360
+ decode: AutoMovieMp4Boxes.IBox,
361
+ runs: number,
362
+ ): number[] {
363
+ const times: number[] = [];
364
+ let time: number = 0;
365
+ for (let run: number = 0; run < runs; run++) {
366
+ const at: number = field(decode, 8 + run * 8, 8);
367
+ const samples: number = movie.readUInt32BE(at);
368
+ const delta: number = movie.readUInt32BE(at + 4);
369
+ for (let k: number = 0; k < samples; k++, time += delta) times.push(time);
370
+ }
371
+ return times;
372
+ }
373
+
374
+ /** Read the audio probe from the one audio track. */
375
+ function readAudio(
376
+ movie: Buffer,
377
+ track: AutoMovieMp4Boxes.IBox,
378
+ movieTimescale: number,
379
+ ): IAutoMovieProductionAudioProbe {
380
+ const timing: ITrackClock = trackClock(movie, track);
381
+ const entry: AutoMovieMp4Boxes.IBox = timing.entry;
382
+
383
+ // AudioSampleEntry: 8 bytes of SampleEntry, 8 reserved, then the channel
384
+ // count, sample size, two reserved half-words and the 16.16 sample rate;
385
+ // child boxes start after the fixed 28 bytes.
386
+ const channels: number = movie.readUInt16BE(field(entry, 16, 2));
387
+ const sampleRate: number = movie.readUInt32BE(field(entry, 24, 4)) >>> 16;
388
+ const description: IAutoMovieProductionAacDescription =
389
+ entry.type === "mp4a"
390
+ ? aacDescription(
391
+ movie,
392
+ only(movie, { ...entry, start: field(entry, 28, 0) }, "esds"),
393
+ )
394
+ : {
395
+ codec: entry.type,
396
+ audioObjectType: 0,
397
+ sampleRate: 0,
398
+ channelCount: 0,
399
+ };
400
+ const decode: AutoMovieMp4Boxes.IBox = only(movie, timing.table, "stts");
401
+ const runs: number = movie.readUInt32BE(field(decode, 4, 4));
402
+ let sampleCount: number = 0;
403
+ for (let run: number = 0; run < runs; run++)
404
+ sampleCount += movie.readUInt32BE(field(decode, 8 + run * 8, 4));
405
+ const edit:
406
+ | IAutoMovieProductionAudioProbe["timebase"]["edits"][number]
407
+ | undefined = timing.edits.length === 1 ? timing.edits[0] : undefined;
408
+ return {
409
+ kind: "audio",
410
+ container: "mp4",
411
+ codec:
412
+ entry.type === "mp4a"
413
+ ? `mp4a.40.${description.audioObjectType}`
414
+ : entry.type,
415
+ runtimeSeconds: timing.movieDuration / movieTimescale,
416
+ channels,
417
+ sampleRate,
418
+ sampleCount,
419
+ primingSamples: edit === undefined ? 0 : Math.max(0, edit.mediaTime),
420
+ timebase: {
421
+ movieTimescale,
422
+ mediaTimescale: timing.mediaTimescale,
423
+ movieDuration: timing.movieDuration,
424
+ mediaDuration: timing.mediaDuration,
425
+ edits: timing.edits,
426
+ },
427
+ sampleEntry: description,
428
+ };
429
+ }
430
+
431
+ /**
432
+ * Read the AudioSpecificConfig inside an `esds` box (ISO/IEC 14496-1 §7.2.6):
433
+ * the ES descriptor (tag 3), its decoder configuration (tag 4) and the
434
+ * decoder-specific information (tag 5), whose first bits are the audio object
435
+ * type, the sampling-frequency index and the channel configuration (ISO/IEC
436
+ * 14496-3 §1.6.2.1).
437
+ */
438
+ function aacDescription(
439
+ movie: Buffer,
440
+ esds: AutoMovieMp4Boxes.IBox,
441
+ ): IAutoMovieProductionAacDescription {
442
+ let at: number = field(esds, 4, 0);
443
+ const descriptor: (tag: number) => number = (tag: number): number => {
444
+ if (movie[at] !== tag)
445
+ throw new Error(`the esds box lacks descriptor tag ${tag}`);
446
+ at++;
447
+
448
+ // The size is written in up to four bytes of seven bits each.
449
+ let size: number = 0;
450
+ for (let k: number = 0; k < 4; k++) {
451
+ const byte: number = movie[at++]!;
452
+ size = (size << 7) | (byte & 0x7f);
453
+ if ((byte & 0x80) === 0) break;
454
+ }
455
+ if (at + size > esds.end) throw new Error("the esds box is short");
456
+ return size;
457
+ };
458
+ descriptor(3);
459
+ const flags: number = movie[at + 2]!;
460
+ at += 3;
461
+ if ((flags & 0x80) !== 0) at += 2;
462
+ if ((flags & 0x40) !== 0) at += 1 + movie[at]!;
463
+ if ((flags & 0x20) !== 0) at += 2;
464
+ descriptor(4);
465
+ at += 13;
466
+ const size: number = descriptor(5);
467
+
468
+ // Read the config's leading fields bit by bit, within the descriptor.
469
+ let bit: number = at * 8;
470
+ const end: number = (at + size) * 8;
471
+ const read: (count: number) => number = (count: number): number => {
472
+ if (bit + count > end) throw new Error("the AudioSpecificConfig is short");
473
+ let value: number = 0;
474
+ for (let k: number = 0; k < count; k++, bit++)
475
+ value = value * 2 + ((movie[bit >>> 3]! >>> (7 - (bit & 7))) & 1);
476
+ return value;
477
+ };
478
+ let audioObjectType: number = read(5);
479
+ if (audioObjectType === 31) audioObjectType = 32 + read(6);
480
+ const index: number = read(4);
481
+ const sampleRate: number =
482
+ index === 15 ? read(24) : (AAC_SAMPLE_RATES[index] ?? 0);
483
+ const channelCount: number = read(4);
484
+ return { codec: "mp4a", audioObjectType, sampleRate, channelCount };
485
+ }
486
+ /** Euclid's greatest common divisor of two non-negative integers. */
487
+ function gcd(a: number, b: number): number {
488
+ return b === 0 ? Math.max(a, 1) : gcd(b, a % b);
489
+ }
490
+
491
+ /** A 64-bit box value as a number, refusing one beyond the safe integers. */
492
+ function safe(value: bigint): number {
493
+ if (
494
+ value > BigInt(Number.MAX_SAFE_INTEGER) ||
495
+ value < BigInt(Number.MIN_SAFE_INTEGER)
496
+ )
497
+ throw new Error("a box value exceeds the safe integers");
498
+ return Number(value);
499
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reads a Node file system error's code: the `code` Node's declared error
3
+ * (`NodeJS.ErrnoException`) carries, or undefined for a value that is not an
4
+ * error or an error without one.
5
+ *
6
+ * @param error The caught value.
7
+ * @returns The error's code, or undefined.
8
+ */
9
+ export function readAutoMovieErrorCode(error: unknown): string | undefined {
10
+ if (!(error instanceof Error)) return undefined;
11
+ const errno: NodeJS.ErrnoException = error;
12
+ return errno.code;
13
+ }
@@ -4,23 +4,19 @@ import { AUTOMOVIE_INSPECT_OPTIONS } from "./AUTOMOVIE_INSPECT_OPTIONS";
4
4
  const PORTS: number = 65_535;
5
5
 
6
6
  /**
7
- * Split the options of `automovie inspect` into the command's own, `AUTOMOVIE_INSPECT_OPTIONS`, and the request the page opens on, which `parseAutoMovieCapturePlanRequest` reads.
7
+ * Split the options of `automovie inspect` into the command's own,
8
+ * `AUTOMOVIE_INSPECT_OPTIONS`, and the request the page opens on, which
9
+ * `parseAutoMovieCapturePlanRequest` reads.
8
10
  *
9
- * | Option | Meaning | Absent |
10
- * | --- | --- | --- |
11
- * | `--module <file>` | The subject module whose `subjects` the inspector page offers | Required |
12
- * | `--port <n>` | The port the page is served on, 1 to 65535 | A free port |
13
- * | `--props <file>` | A JSON file whose value the module's `subjects` is called with, for a module whose subjects are built from data a host computes, such as a motion case | `null` |
11
+ * | Option | Meaning | Absent |
12
+ * | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
13
+ * | `--module <file>` | The subject module whose `subjects` the inspector page offers | Required |
14
+ * | `--port <n>` | The port the page is served on, 1 to 65535 | A free port |
15
+ * | `--props <file>` | A JSON file whose value the module's `subjects` is called with, for a module whose subjects are built from data a host computes, such as a motion case | `null` |
14
16
  *
15
- * Every other option is left for the request reader, which refuses one it does not know. It throws for a missing `--module`, an empty value of any of its options, and a port that is not a whole number from 1 to 65535.
16
- *
17
- * @evidence contracts/development/common.md#meaningful-documentation Tabulates the command'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 command's keys are removed before the request is read, as the capture command does, so the address and the command line share one grammar and a command key cannot be mistaken for a request key.
19
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One pass that takes the command's keys out, then the checks.
20
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No module is guessed from the folder: the page shows what the command names.
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.
17
+ * Every other option is left for the request reader, which refuses one it does
18
+ * not know. It throws for a missing `--module`, an empty value of any of its
19
+ * options, and a port that is not a whole number from 1 to 65535.
24
20
  */
25
21
  export function readAutoMovieInspectHostOptions(
26
22
  values: ReadonlyMap<string, string>,
@@ -31,7 +27,10 @@ export function readAutoMovieInspectHostOptions(
31
27
  /** The port to serve on, or null for a free one. */
32
28
  port: number | null;
33
29
 
34
- /** Path of the props JSON file, relative to the production or absolute, or null for none. */
30
+ /**
31
+ * Path of the props JSON file, relative to the production or absolute, or
32
+ * null for none.
33
+ */
35
34
  props: string | null;
36
35
 
37
36
  /** The request's own options, for the request reader. */
@@ -1,19 +1,13 @@
1
1
  /**
2
- * Admit the value following `--name`: present, non-blank and not itself an option.
2
+ * Admit the value following `--name`: present, non-blank and not itself an
3
+ * option.
3
4
  *
4
- * The value is returned as typed; the template's name rule trims and admits it at render time.
5
+ * The value is returned as typed; the template's name rule trims and admits it
6
+ * at render time.
5
7
  *
6
8
  * @param value The token after `--name`, absent at the end of the arguments.
7
9
  * @returns The value.
8
10
  * @throws When the value is missing, blank or begins with `-`.
9
- *
10
- * @evidence contracts/development/implementation.md#principled-implementation Refusing a dash-leading value keeps a following option from being swallowed as the name.
11
- * @evidence contracts/development/implementation.md#clear-and-simple-structure `create` and `add` share this one value rule.
12
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The value is not normalized here; one name rule in the template decides admission.
13
- * @evidence contracts/development/common.md#meaningful-documentation The comment states the admitted shape, that the value is unchanged, and what throws.
14
- * @evidence contracts/development/implementation.md#efficient-algorithms One trim and prefix check, linear in the value's length.
15
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call checks one token once.
16
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a string and retains nothing.
17
11
  */
18
12
  export function readAutoMovieNameOption(value: string | undefined): string {
19
13
  if (value === undefined || value.startsWith("-") || value.trim() === "")
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Read the per-call budget for draw-function readiness, subject
3
+ * description/creation and drawing, in milliseconds: a number as given, or
4
+ * command text converted by `Number`. It is not a total build or render
5
+ * deadline. Absence keeps the existing two-minute default. The value is not
6
+ * admitted here; Node's setTimeout applies its own rules to it, and a delay
7
+ * over its limit becomes 1 ms instead of the requested wait
8
+ * (https://nodejs.org/download/release/v22.23.0/docs/api/timers.html).
9
+ *
10
+ * @param value The budget as a number or command text, or absent.
11
+ * @returns The budget, milliseconds.
12
+ */
13
+ export function readAutoMoviePageTimeout(
14
+ value: string | number | undefined,
15
+ ): number {
16
+ if (value === undefined) return 120_000;
17
+
18
+ return typeof value === "number" ? value : Number(value);
19
+ }