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
@@ -0,0 +1,301 @@
1
+ import type {
2
+ IAutoMovieControlRecord,
3
+ IAutoMovieDeliveryContentAudit,
4
+ IAutoMovieDrawnVideoResult,
5
+ } from "@automovie/interface";
6
+ import { createHash } from "node:crypto";
7
+ import * as fs from "node:fs/promises";
8
+ import * as path from "node:path";
9
+
10
+ import type { IAutoMovieVerification } from "./IAutoMovieVerification";
11
+
12
+ type AutoMovieAuditedClock = Pick<
13
+ IAutoMovieDeliveryContentAudit.IResult["expected"],
14
+ "frameRate" | "frameCount"
15
+ >;
16
+
17
+ type AutoMovieReportedFrame = Pick<
18
+ IAutoMovieDrawnVideoResult["frames"][number],
19
+ "index" | "seconds"
20
+ >;
21
+
22
+ type AutoMovieDeliveryOutcome = Pick<
23
+ IAutoMovieVerification.IResult,
24
+ "state" | "message" | "evidence"
25
+ >;
26
+
27
+ /** Fields the existing render report publishes for its file and attempt. */
28
+ interface IRenderReport {
29
+ readonly subject: string;
30
+ readonly status: "published" | "blocked" | "failed";
31
+ readonly video: string | null;
32
+ readonly source: { readonly file: string; readonly sha256: string } | null;
33
+ readonly frames?: readonly AutoMovieReportedFrame[];
34
+ readonly delivery?: { readonly expected?: AutoMovieAuditedClock } | null;
35
+ readonly failure?: { readonly message?: string };
36
+ }
37
+
38
+ /**
39
+ * Verify the promoted movie beside its report using the digest of the staged
40
+ * bytes audited before publication. Required controls carry the same digest. A
41
+ * blocked or failed attempt reports any previous movie separately.
42
+ *
43
+ * @param check The production's delivery criterion.
44
+ * @param root The directory holding the production and its outputs.
45
+ * @returns The file-binding verdict and its owning report.
46
+ */
47
+ export async function inspectAutoMovieVerificationDelivery(
48
+ check: IAutoMovieVerification.IDelivery,
49
+ root: string,
50
+ hashFile: (file: string) => Promise<string>,
51
+ ): Promise<AutoMovieDeliveryOutcome> {
52
+ const evidence: string = check.report;
53
+ const reportPath: string = path.resolve(root, evidence);
54
+ let report: IRenderReport;
55
+ try {
56
+ report = JSON.parse(await fs.readFile(reportPath, "utf8")) as IRenderReport;
57
+ } catch (error) {
58
+ if (error instanceof SyntaxError)
59
+ return {
60
+ state: "unobserved",
61
+ message: `Rerender ${check.subject} to replace its malformed render report.`,
62
+ evidence,
63
+ };
64
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
65
+ return {
66
+ state: "not-run",
67
+ message: `Render ${check.subject} and inspect its latest report.`,
68
+ evidence,
69
+ };
70
+ }
71
+ if (report?.subject !== check.subject)
72
+ return {
73
+ state: "unobserved",
74
+ message: `The report does not describe ${check.subject}.`,
75
+ evidence,
76
+ };
77
+ if (report.status === "blocked" || report.status === "failed") {
78
+ const previous: string[] = [];
79
+ for (const file of ["film.mp4", "film.mov"]) {
80
+ const candidate: string = path.resolve(path.dirname(reportPath), file);
81
+ try {
82
+ if ((await fs.stat(candidate)).isFile())
83
+ previous.push(path.relative(root, candidate));
84
+ } catch (error) {
85
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
86
+ }
87
+ }
88
+ return {
89
+ state: "failed",
90
+ message:
91
+ `Latest render ${report.status}. ${report.failure?.message ?? "Inspect the render report."}` +
92
+ (previous.length === 0
93
+ ? ""
94
+ : ` Previous output: ${previous.join(", ")}.`),
95
+ evidence,
96
+ };
97
+ }
98
+ const auditedHash: string | undefined = report.source?.sha256;
99
+ if (
100
+ report.status !== "published" ||
101
+ typeof report.video !== "string" ||
102
+ report.video.length === 0 ||
103
+ report.video !== path.basename(report.video) ||
104
+ typeof report.source?.file !== "string" ||
105
+ !report.source.file.trim() ||
106
+ !validDigest(auditedHash)
107
+ )
108
+ return {
109
+ state: "unobserved",
110
+ message: "The report lacks a bound publication.",
111
+ evidence,
112
+ };
113
+ const directory: string = path.dirname(reportPath);
114
+ const file: string = path.join(directory, report.video);
115
+ let hash: string;
116
+ try {
117
+ hash = await hashFile(file);
118
+ } catch (error) {
119
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
120
+ return {
121
+ state: "unobserved",
122
+ message: `Restore the published movie at ${path.relative(root, file)}.`,
123
+ evidence,
124
+ };
125
+ }
126
+ if (hash !== auditedHash)
127
+ return {
128
+ state: "stale",
129
+ message: `The bytes of ${report.video} differ from its published report.`,
130
+ evidence,
131
+ };
132
+
133
+ const match: string = `Published bytes match ${path.relative(root, file)}.`;
134
+ if (check.controls === undefined || check.controls.length === 0)
135
+ return { state: "passed", message: match, evidence };
136
+ const frames: readonly AutoMovieReportedFrame[] | undefined = report.frames;
137
+ const expected: AutoMovieAuditedClock | undefined = report.delivery?.expected;
138
+ if (
139
+ !Array.isArray(frames) ||
140
+ frames.length === 0 ||
141
+ frames.length !== expected?.frameCount ||
142
+ frames.some(
143
+ (frame: AutoMovieReportedFrame, index: number): boolean =>
144
+ frame?.index !== index ||
145
+ !Number.isFinite(frame.seconds) ||
146
+ frame.seconds < 0,
147
+ )
148
+ )
149
+ return {
150
+ state: "unobserved",
151
+ message: `Rerender ${check.subject} to record the frame indices and times for its required controls.`,
152
+ evidence,
153
+ };
154
+ const recordPath: string = path.join(directory, "controls", "record.json");
155
+ const controlEvidence: string = path.relative(root, recordPath);
156
+ const controls: AutoMovieDeliveryOutcome = await inspectControlRecord({
157
+ recordPath,
158
+ evidence: controlEvidence,
159
+ subject: check.subject,
160
+ hash,
161
+ expected,
162
+ frames,
163
+ required: check.controls,
164
+ });
165
+ return controls.state === "passed"
166
+ ? { state: "passed", message: `${match} ${controls.message}`, evidence }
167
+ : controls;
168
+ }
169
+
170
+ async function inspectControlRecord(props: {
171
+ recordPath: string;
172
+ evidence: string;
173
+ subject: string;
174
+ hash: string;
175
+ expected: AutoMovieAuditedClock | undefined;
176
+ frames: readonly AutoMovieReportedFrame[];
177
+ required: readonly string[];
178
+ }): Promise<AutoMovieDeliveryOutcome> {
179
+ const { recordPath, evidence, subject, hash, expected, frames } = props;
180
+ const required: string[] = [...new Set(props.required)];
181
+ const passes: string = required.join(", ");
182
+ const unobserved = (message: string): AutoMovieDeliveryOutcome => ({
183
+ state: "unobserved",
184
+ message,
185
+ evidence,
186
+ });
187
+ let controls: IAutoMovieControlRecord | null;
188
+ try {
189
+ controls = JSON.parse(
190
+ await fs.readFile(recordPath, "utf8"),
191
+ ) as IAutoMovieControlRecord | null;
192
+ } catch (error) {
193
+ if (
194
+ (error as NodeJS.ErrnoException).code !== "ENOENT" &&
195
+ !(error instanceof SyntaxError)
196
+ )
197
+ throw error;
198
+ return unobserved(
199
+ `Restore the control record for ${passes} at ${evidence}.`,
200
+ );
201
+ }
202
+ if (
203
+ controls === null ||
204
+ typeof controls.film !== "string" ||
205
+ !validDigest(controls.filmSha256)
206
+ )
207
+ return unobserved(
208
+ `Render ${passes} to record the subject and film digest.`,
209
+ );
210
+ if (controls.film !== subject || controls.filmSha256 !== hash)
211
+ return {
212
+ state: "stale",
213
+ message: "The control record is bound to a different film.",
214
+ evidence,
215
+ };
216
+ if (!matchesClock(controls.clock, expected))
217
+ return unobserved(
218
+ `Render ${passes} with a control record matching the movie frame count and rate.`,
219
+ );
220
+ const channels: readonly IAutoMovieControlRecord.IChannel[] = Array.isArray(
221
+ controls.channels,
222
+ )
223
+ ? controls.channels
224
+ : [];
225
+ const incomplete: string[] = required.filter((pass: string): boolean => {
226
+ const matches: IAutoMovieControlRecord.IChannel[] = channels.filter(
227
+ (channel: IAutoMovieControlRecord.IChannel): boolean =>
228
+ channel?.pass === pass,
229
+ );
230
+ return matches.length !== 1 || !completeSequence(matches[0]!, frames);
231
+ });
232
+ if (incomplete.length !== 0)
233
+ return unobserved(
234
+ `Render a complete control record for ${incomplete.join(", ")}.`,
235
+ );
236
+ return {
237
+ state: "passed",
238
+ message: `The control record for ${passes} matches at ${evidence}. Use its frame digests to verify the image files for transfer.`,
239
+ evidence,
240
+ };
241
+ }
242
+
243
+ function matchesClock(
244
+ clock: IAutoMovieControlRecord.IClock | null | undefined,
245
+ expected: AutoMovieAuditedClock | null | undefined,
246
+ ): boolean {
247
+ const count: number | undefined = expected?.frameCount;
248
+ const rate: AutoMovieAuditedClock["frameRate"] | undefined =
249
+ expected?.frameRate;
250
+ const controlRate: IAutoMovieControlRecord.IClock["frameRate"] | undefined =
251
+ clock?.frameRate;
252
+ return (
253
+ typeof count === "number" &&
254
+ Number.isSafeInteger(count) &&
255
+ count > 0 &&
256
+ clock?.frameCount === count &&
257
+ Array.isArray(controlRate) &&
258
+ controlRate.length === 2 &&
259
+ Array.isArray(rate) &&
260
+ rate.length === 2 &&
261
+ rate.every(
262
+ (term: number, index: number): boolean =>
263
+ Number.isSafeInteger(term) && term > 0 && controlRate[index] === term,
264
+ )
265
+ );
266
+ }
267
+
268
+ function completeSequence(
269
+ channel: IAutoMovieControlRecord.IChannel,
270
+ reported: readonly AutoMovieReportedFrame[],
271
+ ): boolean {
272
+ if (
273
+ channel.frameCount !== reported.length ||
274
+ !Array.isArray(channel.frames) ||
275
+ channel.frames.length !== reported.length ||
276
+ channel.convention?.pass !== channel.pass ||
277
+ typeof channel.inputPattern !== "string" ||
278
+ channel.inputPattern.trim() === ""
279
+ )
280
+ return false;
281
+
282
+ const sequence: ReturnType<typeof createHash> = createHash("sha256");
283
+ for (const [index, frame] of channel.frames.entries()) {
284
+ if (
285
+ frame?.index !== index ||
286
+ frame.seconds !== reported[index]!.seconds ||
287
+ !validDigest(frame.sha256)
288
+ )
289
+ return false;
290
+ sequence.update(`${frame.sha256}\n`);
291
+ }
292
+ return sequence.digest("hex") === channel.sequenceSha256;
293
+ }
294
+
295
+ function validDigest(value: unknown): value is string {
296
+ return (
297
+ typeof value === "string" &&
298
+ value.length === 64 &&
299
+ /^[a-f0-9]+$/u.test(value)
300
+ );
301
+ }
@@ -0,0 +1,130 @@
1
+ import * as fs from "node:fs/promises";
2
+ import * as path from "node:path";
3
+
4
+ import type { IAutoMovieReviewObservation } from "./IAutoMovieReviewObservation";
5
+ import type { IAutoMovieVerification } from "./IAutoMovieVerification";
6
+ import { readAutoMovieReviewObservation } from "./readAutoMovieReviewObservation";
7
+ import { sameAutoMovieReviewFile } from "./sameAutoMovieReviewFile";
8
+
9
+ /**
10
+ * Check the existing review owner's explicit observation of the exact file. Its
11
+ * author, activity, actual frame scope and decision are all required. A machine
12
+ * locator or a still satisfies no playback or listening check.
13
+ *
14
+ * @param check The production's required file observation and frame interval.
15
+ * @param root The production directory that resolves both source files.
16
+ * @returns The current review outcome and its owning observation.
17
+ */
18
+ export async function inspectAutoMovieVerificationReview(
19
+ check: IAutoMovieVerification.IReview,
20
+ root: string,
21
+ hashFile: (file: string) => Promise<string>,
22
+ ): Promise<
23
+ Pick<IAutoMovieVerification.IResult, "state" | "message" | "evidence">
24
+ > {
25
+ const evidence: string = check.observation;
26
+ const [from, end]: IAutoMovieVerification.IReview["frames"] = check.frames;
27
+ if (
28
+ !Number.isSafeInteger(from) ||
29
+ !Number.isSafeInteger(end) ||
30
+ from < 0 ||
31
+ from >= end
32
+ )
33
+ throw new Error(
34
+ "A review check needs a nonempty zero-based frame interval.",
35
+ );
36
+ const pending = (message: string) => ({
37
+ state: "awaiting-review" as const,
38
+ message,
39
+ evidence,
40
+ });
41
+ let source: string;
42
+ try {
43
+ source = await fs.readFile(path.resolve(root, evidence), "utf8");
44
+ } catch (error) {
45
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
46
+ return pending(
47
+ `Record ${check.viewed} review of frames ${from}–${end - 1}.`,
48
+ );
49
+ }
50
+ let value: IAutoMovieReviewObservation;
51
+ try {
52
+ value = readAutoMovieReviewObservation(JSON.parse(source) as unknown);
53
+ } catch (error) {
54
+ const reason: string =
55
+ error instanceof SyntaxError
56
+ ? "Invalid file review JSON"
57
+ : error instanceof Error
58
+ ? error.message
59
+ : String(error);
60
+ return {
61
+ state: "unobserved",
62
+ message: `${reason}. Select a valid ${check.viewed} receipt for frames ${from}–${end - 1}.`,
63
+ evidence,
64
+ };
65
+ }
66
+ const file: string = path.resolve(root, check.file);
67
+ if (
68
+ value.subject !== check.subject ||
69
+ !(await sameAutoMovieReviewFile(path.resolve(root, value.file), file))
70
+ )
71
+ return pending("The observation addresses a different subject or video.");
72
+ try {
73
+ if ((await hashFile(file)) !== value.sha256)
74
+ return {
75
+ state: "stale",
76
+ message: "The reviewer observed earlier bytes at this path.",
77
+ evidence,
78
+ };
79
+ } catch (error) {
80
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
81
+ return {
82
+ state: "unobserved",
83
+ message: `Restore or render ${check.file} before requesting review.`,
84
+ evidence,
85
+ };
86
+ }
87
+ if (
88
+ value.viewed !== check.viewed ||
89
+ value.observed === null ||
90
+ value.observed.firstFrame > from ||
91
+ value.observed.endFrame < end ||
92
+ value.reviewer === null ||
93
+ value.decision === null ||
94
+ (check.occurrence !== undefined &&
95
+ (value.cut.state !== "resolved" ||
96
+ value.cut.entry !== check.occurrence.entry ||
97
+ value.cut.shot !== check.occurrence.shot))
98
+ )
99
+ return pending(
100
+ `Record ${check.viewed} and a named decision for the current video over frames ${from}–${end - 1}.`,
101
+ );
102
+ const observation: NonNullable<IAutoMovieReviewObservation["observed"]> =
103
+ value.observed;
104
+ if (check.viewed === "still" && end - from !== 1)
105
+ return pending("A still decision can cover only one frame.");
106
+ if (check.viewed !== "still") {
107
+ // Frame selection can intersect a piece of a frame outside a reviewer’s
108
+ // requested interval. Compare the actual reported span as well.
109
+ const stride: number =
110
+ (observation.end.ticks - observation.start.ticks) /
111
+ (observation.endFrame - observation.firstFrame);
112
+ const [numerator, denominator]: typeof observation.start.timeBase =
113
+ observation.start.timeBase;
114
+ const frameStart: (frame: number) => number = (frame: number): number =>
115
+ (frame * stride * numerator) / denominator;
116
+ if (
117
+ value.requested.to === null ||
118
+ value.requested.from > frameStart(from) ||
119
+ value.requested.to < frameStart(end)
120
+ )
121
+ return pending(
122
+ "The recorded continuous review covers only part of the required span.",
123
+ );
124
+ }
125
+ return {
126
+ state: value.decision === "accepted" ? "passed" : "failed",
127
+ message: `Recorded ${value.viewed} ${value.decision} by ${value.reviewer}. ${value.note}`,
128
+ evidence,
129
+ };
130
+ }
@@ -2,21 +2,20 @@ import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
2
2
  import type { IAutoMovieChromium } from "./IAutoMovieChromium";
3
3
  import { planAutoMovieChromiumLaunch } from "./planAutoMovieChromiumLaunch";
4
4
 
5
- /** The command that installs the Chromium build the production's `playwright-core` pins for headless use; `playwright-core`'s own command, so the revision is the one the production launches. */
5
+ /**
6
+ * The command that installs the Chromium build the production's
7
+ * `playwright-core` pins for headless use; `playwright-core`'s own command, so
8
+ * the revision is the one the production launches.
9
+ */
6
10
  const INSTALL: string = "npx playwright-core install chromium-headless-shell";
7
11
 
8
12
  /**
9
- * Launch headless Chromium for a capture backend, and describe the launch the way a record names it: the backend, then the Chromium version.
10
- *
11
- * A launch that fails because the browser executable is missing is rethrown as an error naming `npx playwright-core install chromium-headless-shell` and `CHROME_PATH`; any other failure is rethrown with the backend named.
13
+ * Launch headless Chromium for a capture backend, and describe the launch the
14
+ * way a record names it: the backend, then the Chromium version.
12
15
  *
13
- * @evidence contracts/development/common.md#meaningful-documentation States what is launched, the description's form and both failures.
14
- * @evidence contracts/development/implementation.md#principled-implementation Switches come from `planAutoMovieChromiumLaunch`; Playwright reports a missing browser as an executable that does not exist, which is the message matched, so only that case is turned into the install instruction.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Plan, launch, describe.
16
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No other browser or backend is tried after a failure.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms One launch.
18
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each capture host launches its own browser.
19
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned browser is the caller's to close; a failed launch leaves none.
16
+ * A launch that fails because the browser executable is missing is rethrown as
17
+ * an error naming `npx playwright-core install chromium-headless-shell` and
18
+ * `CHROME_PATH`; any other failure is rethrown with the backend named.
20
19
  */
21
20
  export async function launchAutoMovieChromium(props: {
22
21
  /** Playwright's `chromium`, loaded from the production. */
@@ -31,7 +30,10 @@ export async function launchAutoMovieChromium(props: {
31
30
  /** The launched browser. */
32
31
  browser: IAutoMovieChromium.IBrowser;
33
32
 
34
- /** The backend and Chromium version, such as `swiftshader; Chromium 131.0.6778.33`. */
33
+ /**
34
+ * The backend and Chromium version, such as `swiftshader; Chromium
35
+ * 131.0.6778.33`.
36
+ */
35
37
  backend: string;
36
38
  }> {
37
39
  const plan: ReturnType<typeof planAutoMovieChromiumLaunch> =
@@ -0,0 +1,87 @@
1
+ import type {
2
+ IAutoMovieDeliveryContentAudit,
3
+ IAutoMovieDrawnVideoResult,
4
+ IAutoMovieInspectionDiagnostics,
5
+ } from "@automovie/interface";
6
+
7
+ /**
8
+ * Selects the first usable cursor in each audit while retaining complete
9
+ * details in the report.
10
+ *
11
+ * A content finding whose detector `skip` names does not block; a transparent
12
+ * render skips `black`, which reads a transparent frame as black.
13
+ */
14
+ export function listAutoMovieReleaseFindings(
15
+ diagnostics: IAutoMovieDrawnVideoResult["diagnostics"] | null,
16
+ delivery: IAutoMovieDeliveryContentAudit.IResult,
17
+ skip: readonly string[] = [],
18
+ ): string[] {
19
+ const details: string[] = [];
20
+ if (diagnostics?.hasBlockingFinding) {
21
+ const blocking: IAutoMovieInspectionDiagnostics.IEpisode | undefined =
22
+ diagnostics.episodes.find(
23
+ ({
24
+ worst: { finding },
25
+ }: IAutoMovieInspectionDiagnostics.IEpisode): boolean =>
26
+ finding.category === "error" && finding.confidence === "confirmed",
27
+ );
28
+ const first: IAutoMovieInspectionDiagnostics.IObservation | undefined =
29
+ blocking?.first.finding.category === "error" &&
30
+ blocking.first.finding.confidence === "confirmed"
31
+ ? blocking.first
32
+ : blocking?.worst;
33
+ details.push(
34
+ first === undefined
35
+ ? "Scene inspection failed"
36
+ : first.finding.code +
37
+ cursor(first.time.filmSeconds, first.time.outputFrame),
38
+ );
39
+ }
40
+ if (diagnostics?.unresolvedRequiredCoverage) {
41
+ const unresolved:
42
+ | IAutoMovieInspectionDiagnostics.ICoverageRange
43
+ | undefined = diagnostics.coverage.find(
44
+ ({ coverage }: IAutoMovieInspectionDiagnostics.ICoverageRange): boolean =>
45
+ coverage.required &&
46
+ (coverage.status === "deferred" || coverage.status === "unsupported"),
47
+ );
48
+ details.push(
49
+ unresolved === undefined
50
+ ? "Required scene inspection coverage is unresolved"
51
+ : "Required scene " +
52
+ unresolved.coverage.check +
53
+ " coverage is unresolved" +
54
+ cursor(unresolved.first.filmSeconds, unresolved.first.outputFrame),
55
+ );
56
+ }
57
+
58
+ for (const finding of delivery.findings) {
59
+ if (!finding.blocking) continue;
60
+ if (finding.kind !== "content") {
61
+ details.push(finding.media + ": " + finding.reason);
62
+ continue;
63
+ }
64
+ if (skip.includes(finding.detector)) continue;
65
+ const {
66
+ ticks,
67
+ timeBase: [numerator, denominator],
68
+ }: IAutoMovieDeliveryContentAudit.ITimestamp = finding.start;
69
+ details.push(
70
+ finding.outcome +
71
+ " " +
72
+ finding.detector +
73
+ cursor((ticks * numerator) / denominator, finding.firstOutputFrame),
74
+ );
75
+ }
76
+ return details;
77
+ }
78
+
79
+ /**
80
+ * Formats the available output frame and film seconds without inventing an
81
+ * audio frame.
82
+ */
83
+ function cursor(seconds: number, frame?: number): string {
84
+ return (
85
+ (frame === undefined ? "" : " at frame " + frame) + " (" + seconds + " s)"
86
+ );
87
+ }
@@ -2,29 +2,36 @@ import { createRequire } from "node:module";
2
2
  import * as path from "node:path";
3
3
 
4
4
  /**
5
- * Load a package as the production at `root` resolves it, for the capture host's optional peers: `@automovie/render`, `vite`, `playwright-core` and `ffmpeg-static`.
5
+ * Load a package as the production at `root` resolves it, for the capture
6
+ * host's optional peers: `@automovie/render`, `vite`, `playwright-core` and
7
+ * `ffmpeg-static`.
6
8
  *
7
- * The command itself depends on none of them, so `npx automovie create` installs nothing a capture needs; a production that captures installs them, and this resolves the copies it installed. It throws naming the package and the production when it is not installed there.
9
+ * The command itself depends on none of them, so `npx automovie create`
10
+ * installs nothing a capture needs. Resolve dependencies from the production in
11
+ * order to diagnose a missing package or an installed module that fails to
12
+ * initialize. Preserve the original failure as the cause.
8
13
  *
9
- * @evidence contracts/development/common.md#meaningful-documentation States which packages it serves, why they come from the production, and the refusal.
10
- * @evidence contracts/development/implementation.md#principled-implementation `createRequire` anchored at the production's `package.json` applies Node's resolution from that folder, the same copy the production's own scripts import.
11
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One anchored require.
12
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No copy beside the command is tried, so a capture never draws with a renderer the production did not install.
13
- * @evidence contracts/development/implementation.md#efficient-algorithms One resolution; Node caches the module.
14
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Node's module cache serves a second load of the same package.
15
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module stays in Node's cache for the process, as any import does.
14
+ * @param root The production's folder.
15
+ * @param id The package to load.
16
+ * @returns The package's exports, typed by the module's declared type T.
16
17
  */
17
- export function loadAutoMovieProductionModule(
18
+ export function loadAutoMovieProductionModule<T = unknown>(
18
19
  root: string,
19
20
  id: string,
20
- ): unknown {
21
+ ): T {
21
22
  const load: NodeJS.Require = createRequire(path.join(root, "package.json"));
22
23
  try {
23
24
  return load(id);
24
25
  } catch (error) {
25
- throw new Error(
26
- `${id} is not installed in ${root}; capture loads it from the production, so add it to the production's dependencies`,
27
- { cause: error },
28
- );
26
+ let resolved: string;
27
+ try {
28
+ resolved = load.resolve(id);
29
+ } catch {
30
+ throw new Error(
31
+ `${id} is not installed in ${root}. Add it to the production's dependencies.`,
32
+ { cause: error },
33
+ );
34
+ }
35
+ throw new Error(`Could not load ${id} at ${resolved}`, { cause: error });
29
36
  }
30
37
  }