@automovie/template 0.0.0-stage → 0.1.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 (742) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -2
  3. package/build/resolveTemplateVersions.ts +92 -0
  4. package/build/syncScaffoldInstructions.ts +28 -0
  5. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.d.ts +14 -0
  6. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js +52 -0
  7. package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js.map +1 -0
  8. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.d.ts +2 -0
  9. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js +42 -0
  10. package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js.map +1 -0
  11. package/lib/AutoMovieScaffoldLayer.d.ts +15 -0
  12. package/lib/AutoMovieScaffoldLayer.js +3 -0
  13. package/lib/AutoMovieScaffoldLayer.js.map +1 -0
  14. package/lib/FILE_ATTRIBUTE_DIRECTORY.d.ts +2 -0
  15. package/lib/FILE_ATTRIBUTE_DIRECTORY.js +6 -0
  16. package/lib/FILE_ATTRIBUTE_DIRECTORY.js.map +1 -0
  17. package/lib/IAutoMovieCatalogVersionProps.d.ts +16 -0
  18. package/lib/IAutoMovieCatalogVersionProps.js +3 -0
  19. package/lib/IAutoMovieCatalogVersionProps.js.map +1 -0
  20. package/lib/IAutoMovieScaffoldProps.d.ts +14 -0
  21. package/lib/IAutoMovieScaffoldProps.js +3 -0
  22. package/lib/IAutoMovieScaffoldProps.js.map +1 -0
  23. package/lib/IAutoMovieScaffoldSourceEntry.d.ts +18 -0
  24. package/lib/IAutoMovieScaffoldSourceEntry.js +3 -0
  25. package/lib/IAutoMovieScaffoldSourceEntry.js.map +1 -0
  26. package/lib/IAutoMovieTemplateDependencyVersionsProps.d.ts +17 -0
  27. package/lib/IAutoMovieTemplateDependencyVersionsProps.js +3 -0
  28. package/lib/IAutoMovieTemplateDependencyVersionsProps.js.map +1 -0
  29. package/lib/IAutoMovieWorkspacePackageVersions.d.ts +34 -0
  30. package/lib/IAutoMovieWorkspacePackageVersions.js +3 -0
  31. package/lib/IAutoMovieWorkspacePackageVersions.js.map +1 -0
  32. package/lib/IBoundChild.d.ts +71 -0
  33. package/lib/IBoundChild.js +3 -0
  34. package/lib/IBoundChild.js.map +1 -0
  35. package/lib/IBoundChildStatus.d.ts +20 -0
  36. package/lib/IBoundChildStatus.js +3 -0
  37. package/lib/IBoundChildStatus.js.map +1 -0
  38. package/lib/IBoundParent.d.ts +61 -0
  39. package/lib/IBoundParent.js +3 -0
  40. package/lib/IBoundParent.js.map +1 -0
  41. package/lib/IBoundParentStatus.d.ts +14 -0
  42. package/lib/IBoundParentStatus.js +3 -0
  43. package/lib/IBoundParentStatus.js.map +1 -0
  44. package/lib/ICreateResult.d.ts +27 -0
  45. package/lib/ICreateResult.js +3 -0
  46. package/lib/ICreateResult.js.map +1 -0
  47. package/lib/IScaffoldCompletedFilePublicationOutcome.d.ts +16 -0
  48. package/lib/IScaffoldCompletedFilePublicationOutcome.js +3 -0
  49. package/lib/IScaffoldCompletedFilePublicationOutcome.js.map +1 -0
  50. package/lib/IScaffoldCompletedPublication.d.ts +15 -0
  51. package/lib/IScaffoldCompletedPublication.js +3 -0
  52. package/lib/IScaffoldCompletedPublication.js.map +1 -0
  53. package/lib/IScaffoldFileSnapshot.d.ts +24 -0
  54. package/lib/IScaffoldFileSnapshot.js +3 -0
  55. package/lib/IScaffoldFileSnapshot.js.map +1 -0
  56. package/lib/IScaffoldParentPublicationRequest.d.ts +26 -0
  57. package/lib/IScaffoldParentPublicationRequest.js +3 -0
  58. package/lib/IScaffoldParentPublicationRequest.js.map +1 -0
  59. package/lib/IScaffoldPartialFilePublicationOutcome.d.ts +22 -0
  60. package/lib/IScaffoldPartialFilePublicationOutcome.js +3 -0
  61. package/lib/IScaffoldPartialFilePublicationOutcome.js.map +1 -0
  62. package/lib/IScaffoldPhysicalDirectory.d.ts +20 -0
  63. package/lib/IScaffoldPhysicalDirectory.js +3 -0
  64. package/lib/IScaffoldPhysicalDirectory.js.map +1 -0
  65. package/lib/IScaffoldPosixConstants.d.ts +24 -0
  66. package/lib/IScaffoldPosixConstants.js +3 -0
  67. package/lib/IScaffoldPosixConstants.js.map +1 -0
  68. package/lib/IScaffoldPublicationEntry.d.ts +20 -0
  69. package/lib/IScaffoldPublicationEntry.js +3 -0
  70. package/lib/IScaffoldPublicationEntry.js.map +1 -0
  71. package/lib/IScaffoldPublicationFailure.d.ts +18 -0
  72. package/lib/IScaffoldPublicationFailure.js +3 -0
  73. package/lib/IScaffoldPublicationFailure.js.map +1 -0
  74. package/lib/IScaffoldPublicationOptions.d.ts +17 -0
  75. package/lib/IScaffoldPublicationOptions.js +3 -0
  76. package/lib/IScaffoldPublicationOptions.js.map +1 -0
  77. package/lib/IScaffoldPublicationReceipt.d.ts +25 -0
  78. package/lib/IScaffoldPublicationReceipt.js +3 -0
  79. package/lib/IScaffoldPublicationReceipt.js.map +1 -0
  80. package/lib/IScaffoldRefusedFilePublicationOutcome.d.ts +18 -0
  81. package/lib/IScaffoldRefusedFilePublicationOutcome.js +3 -0
  82. package/lib/IScaffoldRefusedFilePublicationOutcome.js.map +1 -0
  83. package/lib/IScaffoldSyncPlan.d.ts +25 -0
  84. package/lib/IScaffoldSyncPlan.js +3 -0
  85. package/lib/IScaffoldSyncPlan.js.map +1 -0
  86. package/lib/IScaffoldSyncProps.d.ts +16 -0
  87. package/lib/IScaffoldSyncProps.js +3 -0
  88. package/lib/IScaffoldSyncProps.js.map +1 -0
  89. package/lib/IWindowsFileInformation.d.ts +20 -0
  90. package/lib/IWindowsFileInformation.js +3 -0
  91. package/lib/IWindowsFileInformation.js.map +1 -0
  92. package/lib/IWindowsLibrary.d.ts +127 -0
  93. package/lib/IWindowsLibrary.js +3 -0
  94. package/lib/IWindowsLibrary.js.map +1 -0
  95. package/lib/SCAFFOLD_SYNC_STATE_FILE.d.ts +4 -0
  96. package/lib/SCAFFOLD_SYNC_STATE_FILE.js +8 -0
  97. package/lib/SCAFFOLD_SYNC_STATE_FILE.js.map +1 -0
  98. package/lib/ScaffoldFilePublicationOutcome.d.ts +14 -0
  99. package/lib/ScaffoldFilePublicationOutcome.js +3 -0
  100. package/lib/ScaffoldFilePublicationOutcome.js.map +1 -0
  101. package/lib/ScaffoldParentChangedError.d.ts +11 -0
  102. package/lib/ScaffoldParentChangedError.js +19 -0
  103. package/lib/ScaffoldParentChangedError.js.map +1 -0
  104. package/lib/ScaffoldPublicationError.d.ts +17 -0
  105. package/lib/ScaffoldPublicationError.js +46 -0
  106. package/lib/ScaffoldPublicationError.js.map +1 -0
  107. package/lib/assertOrdinaryFile.d.ts +13 -0
  108. package/lib/assertOrdinaryFile.js +20 -0
  109. package/lib/assertOrdinaryFile.js.map +1 -0
  110. package/lib/assertOrdinarySingleLinkFile.d.ts +13 -0
  111. package/lib/assertOrdinarySingleLinkFile.js +22 -0
  112. package/lib/assertOrdinarySingleLinkFile.js.map +1 -0
  113. package/lib/assertScaffoldOwnership.d.ts +13 -0
  114. package/lib/assertScaffoldOwnership.js +24 -0
  115. package/lib/assertScaffoldOwnership.js.map +1 -0
  116. package/lib/assertScaffoldPhysicalDirectory.d.ts +16 -0
  117. package/lib/assertScaffoldPhysicalDirectory.js +26 -0
  118. package/lib/assertScaffoldPhysicalDirectory.js.map +1 -0
  119. package/lib/assertScaffoldProjectName.d.ts +18 -0
  120. package/lib/assertScaffoldProjectName.js +34 -0
  121. package/lib/assertScaffoldProjectName.js.map +1 -0
  122. package/lib/attachScaffoldSyncState.d.ts +18 -0
  123. package/lib/attachScaffoldSyncState.js +30 -0
  124. package/lib/attachScaffoldSyncState.js.map +1 -0
  125. package/lib/captureEmptyScaffoldPhysicalDirectory.d.ts +13 -0
  126. package/lib/captureEmptyScaffoldPhysicalDirectory.js +69 -0
  127. package/lib/captureEmptyScaffoldPhysicalDirectory.js.map +1 -0
  128. package/lib/captureScaffoldFile.d.ts +13 -0
  129. package/lib/captureScaffoldFile.js +67 -0
  130. package/lib/captureScaffoldFile.js.map +1 -0
  131. package/lib/captureScaffoldPhysicalDirectory.d.ts +13 -0
  132. package/lib/captureScaffoldPhysicalDirectory.js +63 -0
  133. package/lib/captureScaffoldPhysicalDirectory.js.map +1 -0
  134. package/lib/combineScaffoldFailures.d.ts +19 -0
  135. package/lib/combineScaffoldFailures.js +32 -0
  136. package/lib/combineScaffoldFailures.js.map +1 -0
  137. package/lib/createAutoMovieCatalogVersionResolver.d.ts +17 -0
  138. package/lib/createAutoMovieCatalogVersionResolver.js +64 -0
  139. package/lib/createAutoMovieCatalogVersionResolver.js.map +1 -0
  140. package/lib/createScaffoldSyncState.d.ts +12 -0
  141. package/lib/createScaffoldSyncState.js +26 -0
  142. package/lib/createScaffoldSyncState.js.map +1 -0
  143. package/lib/createScaffoldVariables.d.ts +25 -0
  144. package/lib/createScaffoldVariables.js +41 -0
  145. package/lib/createScaffoldVariables.js.map +1 -0
  146. package/lib/ensureScaffoldBaseDirectory.d.ts +19 -0
  147. package/lib/ensureScaffoldBaseDirectory.js +89 -0
  148. package/lib/ensureScaffoldBaseDirectory.js.map +1 -0
  149. package/lib/ensureScaffoldFileDirectory.d.ts +25 -0
  150. package/lib/ensureScaffoldFileDirectory.js +103 -0
  151. package/lib/ensureScaffoldFileDirectory.js.map +1 -0
  152. package/lib/index.d.ts +47 -0
  153. package/lib/index.js +64 -0
  154. package/lib/index.js.map +1 -0
  155. package/lib/inside.d.ts +12 -0
  156. package/lib/inside.js +57 -0
  157. package/lib/inside.js.map +1 -0
  158. package/lib/isScaffoldInstruction.d.ts +12 -0
  159. package/lib/isScaffoldInstruction.js +29 -0
  160. package/lib/isScaffoldInstruction.js.map +1 -0
  161. package/lib/listAutoMovieScaffoldFiles.d.ts +17 -0
  162. package/lib/listAutoMovieScaffoldFiles.js +87 -0
  163. package/lib/listAutoMovieScaffoldFiles.js.map +1 -0
  164. package/lib/loadWindowsLibrary.d.ts +13 -0
  165. package/lib/loadWindowsLibrary.js +180 -0
  166. package/lib/loadWindowsLibrary.js.map +1 -0
  167. package/lib/mergeScaffoldFiles.d.ts +18 -0
  168. package/lib/mergeScaffoldFiles.js +37 -0
  169. package/lib/mergeScaffoldFiles.js.map +1 -0
  170. package/lib/missingPath.d.ts +12 -0
  171. package/lib/missingPath.js +18 -0
  172. package/lib/missingPath.js.map +1 -0
  173. package/lib/nativeError.d.ts +12 -0
  174. package/lib/nativeError.js +17 -0
  175. package/lib/nativeError.js.map +1 -0
  176. package/lib/openPosixParent.d.ts +13 -0
  177. package/lib/openPosixParent.js +135 -0
  178. package/lib/openPosixParent.js.map +1 -0
  179. package/lib/openWindowsParent.d.ts +13 -0
  180. package/lib/openWindowsParent.js +224 -0
  181. package/lib/openWindowsParent.js.map +1 -0
  182. package/lib/overwriteScaffoldFile.d.ts +22 -0
  183. package/lib/overwriteScaffoldFile.js +214 -0
  184. package/lib/overwriteScaffoldFile.js.map +1 -0
  185. package/lib/physicalDirectoryIdentity.d.ts +15 -0
  186. package/lib/physicalDirectoryIdentity.js +65 -0
  187. package/lib/physicalDirectoryIdentity.js.map +1 -0
  188. package/lib/physicalVersion.d.ts +13 -0
  189. package/lib/physicalVersion.js +18 -0
  190. package/lib/physicalVersion.js.map +1 -0
  191. package/lib/planScaffoldPublication.d.ts +22 -0
  192. package/lib/planScaffoldPublication.js +100 -0
  193. package/lib/planScaffoldPublication.js.map +1 -0
  194. package/lib/planScaffoldSync.d.ts +14 -0
  195. package/lib/planScaffoldSync.js +102 -0
  196. package/lib/planScaffoldSync.js.map +1 -0
  197. package/lib/publishFiles.d.ts +23 -0
  198. package/lib/publishFiles.js +124 -0
  199. package/lib/publishFiles.js.map +1 -0
  200. package/lib/publishNativeScaffoldFile.d.ts +21 -0
  201. package/lib/publishNativeScaffoldFile.js +211 -0
  202. package/lib/publishNativeScaffoldFile.js.map +1 -0
  203. package/lib/publishScaffoldCandidate.d.ts +24 -0
  204. package/lib/publishScaffoldCandidate.js +70 -0
  205. package/lib/publishScaffoldCandidate.js.map +1 -0
  206. package/lib/readAutoMovieScaffoldSources.d.ts +20 -0
  207. package/lib/readAutoMovieScaffoldSources.js +103 -0
  208. package/lib/readAutoMovieScaffoldSources.js.map +1 -0
  209. package/lib/readScaffoldSyncFile.d.ts +16 -0
  210. package/lib/readScaffoldSyncFile.js +64 -0
  211. package/lib/readScaffoldSyncFile.js.map +1 -0
  212. package/lib/renderScaffold.d.ts +19 -0
  213. package/lib/renderScaffold.js +33 -0
  214. package/lib/renderScaffold.js.map +1 -0
  215. package/lib/renderScaffoldEntries.d.ts +20 -0
  216. package/lib/renderScaffoldEntries.js +106 -0
  217. package/lib/renderScaffoldEntries.js.map +1 -0
  218. package/lib/renderScaffoldInstructions.d.ts +17 -0
  219. package/lib/renderScaffoldInstructions.js +23 -0
  220. package/lib/renderScaffoldInstructions.js.map +1 -0
  221. package/lib/renderScaffoldLayer.d.ts +20 -0
  222. package/lib/renderScaffoldLayer.js +28 -0
  223. package/lib/renderScaffoldLayer.js.map +1 -0
  224. package/lib/renderTemplate.d.ts +19 -0
  225. package/lib/renderTemplate.js +56 -0
  226. package/lib/renderTemplate.js.map +1 -0
  227. package/lib/renderWorkspaceProductionScaffold.d.ts +19 -0
  228. package/lib/renderWorkspaceProductionScaffold.js +30 -0
  229. package/lib/renderWorkspaceProductionScaffold.js.map +1 -0
  230. package/lib/renderWorkspaceScaffold.d.ts +19 -0
  231. package/lib/renderWorkspaceScaffold.js +33 -0
  232. package/lib/renderWorkspaceScaffold.js.map +1 -0
  233. package/lib/replaceSharedScaffoldFile.d.ts +30 -0
  234. package/lib/replaceSharedScaffoldFile.js +106 -0
  235. package/lib/replaceSharedScaffoldFile.js.map +1 -0
  236. package/lib/resolveAutoMovieCatalogVersion.d.ts +19 -0
  237. package/lib/resolveAutoMovieCatalogVersion.js +24 -0
  238. package/lib/resolveAutoMovieCatalogVersion.js.map +1 -0
  239. package/lib/resolveAutoMovieTemplateDependencyVersions.d.ts +19 -0
  240. package/lib/resolveAutoMovieTemplateDependencyVersions.js +62 -0
  241. package/lib/resolveAutoMovieTemplateDependencyVersions.js.map +1 -0
  242. package/lib/resolveScaffoldPosixConstants.d.ts +13 -0
  243. package/lib/resolveScaffoldPosixConstants.js +44 -0
  244. package/lib/resolveScaffoldPosixConstants.js.map +1 -0
  245. package/lib/scaffoldAssetDirectory.d.ts +19 -0
  246. package/lib/scaffoldAssetDirectory.js +63 -0
  247. package/lib/scaffoldAssetDirectory.js.map +1 -0
  248. package/lib/scaffoldPhysicalIdentity.d.ts +18 -0
  249. package/lib/scaffoldPhysicalIdentity.js +22 -0
  250. package/lib/scaffoldPhysicalIdentity.js.map +1 -0
  251. package/lib/scaffoldSharedSkillDirectory.d.ts +17 -0
  252. package/lib/scaffoldSharedSkillDirectory.js +62 -0
  253. package/lib/scaffoldSharedSkillDirectory.js.map +1 -0
  254. package/lib/scaffoldSharedSkillPath.d.ts +17 -0
  255. package/lib/scaffoldSharedSkillPath.js +66 -0
  256. package/lib/scaffoldSharedSkillPath.js.map +1 -0
  257. package/lib/skills/3d-modeling/conditioning.md +82 -0
  258. package/lib/skills/3d-modeling/crafting.md +82 -0
  259. package/lib/skills/3d-modeling/diffusion.md +34 -0
  260. package/lib/skills/3d-modeling/inspection.md +54 -0
  261. package/lib/skills/3d-modeling/lofting.md +43 -0
  262. package/lib/skills/3d-modeling/modularization.md +31 -0
  263. package/lib/skills/3d-modeling/recovery.md +29 -0
  264. package/lib/skills/3d-modeling/rigging.md +97 -0
  265. package/lib/skills/3d-modeling/sources.md +29 -0
  266. package/lib/skills/contracts/development/common.md +13 -0
  267. package/lib/skills/contracts/development/design.md +28 -0
  268. package/lib/skills/contracts/development/implementation.md +49 -0
  269. package/lib/skills/contracts/development/testing.md +27 -0
  270. package/lib/skills/development/repair.md +13 -0
  271. package/lib/skills/documentation/SKILL.md +25 -0
  272. package/lib/skills/documentation/writing.md +51 -0
  273. package/lib/skills/motion/authoring.md +51 -0
  274. package/lib/skills/motion/contacts.md +39 -0
  275. package/lib/skills/motion/laws.md +23 -0
  276. package/lib/skills/motion/layers.md +7 -0
  277. package/lib/skills/motion/transitions.md +27 -0
  278. package/lib/skills/motion/variation.md +23 -0
  279. package/lib/skills/motion/verification.md +36 -0
  280. package/lib/skills/prompting/SKILL.md +80 -0
  281. package/lib/skills/visual-debugging/capture.md +60 -0
  282. package/lib/skills/visual-debugging/comparison.md +35 -0
  283. package/lib/skills/visual-debugging/correction-rounds.md +34 -0
  284. package/lib/skills/visual-debugging/passes.md +29 -0
  285. package/lib/skills/visual-debugging/rendering-cost.md +5 -0
  286. package/lib/syncScaffold.d.ts +19 -0
  287. package/lib/syncScaffold.js +28 -0
  288. package/lib/syncScaffold.js.map +1 -0
  289. package/lib/writeFiles.d.ts +20 -0
  290. package/lib/writeFiles.js +33 -0
  291. package/lib/writeFiles.js.map +1 -0
  292. package/lib/writeScaffoldFile.d.ts +35 -0
  293. package/lib/writeScaffoldFile.js +107 -0
  294. package/lib/writeScaffoldFile.js.map +1 -0
  295. package/lib/writtenVersion.d.ts +13 -0
  296. package/lib/writtenVersion.js +18 -0
  297. package/lib/writtenVersion.js.map +1 -0
  298. package/package.json +59 -3
  299. package/scaffold/instructions/.agents/skills/$documentation +0 -0
  300. package/scaffold/instructions/.agents/skills/$prompting +0 -0
  301. package/scaffold/instructions/.agents/skills/3d-modeling/$conditioning.md +0 -0
  302. package/scaffold/instructions/.agents/skills/3d-modeling/$crafting.md +0 -0
  303. package/scaffold/instructions/.agents/skills/3d-modeling/$diffusion.md +0 -0
  304. package/scaffold/instructions/.agents/skills/3d-modeling/$inspection.md +0 -0
  305. package/scaffold/instructions/.agents/skills/3d-modeling/$lofting.md +0 -0
  306. package/scaffold/instructions/.agents/skills/3d-modeling/$modularization.md +0 -0
  307. package/scaffold/instructions/.agents/skills/3d-modeling/$recovery.md +0 -0
  308. package/scaffold/instructions/.agents/skills/3d-modeling/$rigging.md +0 -0
  309. package/scaffold/instructions/.agents/skills/3d-modeling/$sources.md +0 -0
  310. package/scaffold/instructions/.agents/skills/3d-modeling/SKILL.md +32 -0
  311. package/scaffold/instructions/.agents/skills/3d-modeling/coarse-forms.md +25 -0
  312. package/scaffold/instructions/.agents/skills/audio/SKILL.md +28 -0
  313. package/scaffold/instructions/.agents/skills/audio/acquisition.md +25 -0
  314. package/scaffold/instructions/.agents/skills/audio/local-speech.md +11 -0
  315. package/scaffold/instructions/.agents/skills/audio/sound-effects.md +29 -0
  316. package/scaffold/instructions/.agents/skills/contracts/SKILL.md +41 -0
  317. package/scaffold/instructions/.agents/skills/contracts/development/$common.md +0 -0
  318. package/scaffold/instructions/.agents/skills/contracts/development/$design.md +0 -0
  319. package/scaffold/instructions/.agents/skills/contracts/development/$implementation.md +0 -0
  320. package/scaffold/instructions/.agents/skills/contracts/development/$testing.md +0 -0
  321. package/scaffold/instructions/.agents/skills/contracts/development/SKILL.md +22 -0
  322. package/scaffold/instructions/.agents/skills/contracts/development/behaviors.md +25 -0
  323. package/scaffold/instructions/.agents/skills/contracts/development/composition.md +29 -0
  324. package/scaffold/instructions/.agents/skills/contracts/development/entities.md +27 -0
  325. package/scaffold/instructions/.agents/skills/contracts/development/statements/behaviors.md +42 -0
  326. package/scaffold/instructions/.agents/skills/contracts/development/statements/composition.md +32 -0
  327. package/scaffold/instructions/.agents/skills/contracts/development/statements/entities.md +34 -0
  328. package/scaffold/instructions/.agents/skills/contracts/story/SKILL.md +44 -0
  329. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/brief.md +9 -0
  330. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/common.md +9 -0
  331. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/narratives.md +9 -0
  332. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/screenplay.md +9 -0
  333. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/scripts.md +9 -0
  334. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/settings.md +9 -0
  335. package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/treatments.md +9 -0
  336. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/common.md +17 -0
  337. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/common.md +9 -0
  338. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/realized.md +9 -0
  339. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/screenplay.md +9 -0
  340. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/scripts.md +9 -0
  341. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/realized.md +9 -0
  342. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/screenplay.md +13 -0
  343. package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/scripts.md +9 -0
  344. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/brief.md +9 -0
  345. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/common.md +13 -0
  346. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/index.md +13 -0
  347. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/narratives.md +13 -0
  348. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/review.md +13 -0
  349. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/screenplay.md +13 -0
  350. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/scripts.md +13 -0
  351. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/settings.md +13 -0
  352. package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/treatments.md +13 -0
  353. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/brief.md +13 -0
  354. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/common.md +13 -0
  355. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/index.md +13 -0
  356. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/narratives.md +13 -0
  357. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/realized.md +13 -0
  358. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/research.md +13 -0
  359. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/review.md +13 -0
  360. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/screenplay.md +17 -0
  361. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/scripts.md +13 -0
  362. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/settings.md +13 -0
  363. package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/treatments.md +13 -0
  364. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/brief.md +21 -0
  365. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/common.md +42 -0
  366. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/narratives.md +8 -0
  367. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/screenplay.md +15 -0
  368. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/scripts.md +11 -0
  369. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/settings.md +25 -0
  370. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/treatments.md +9 -0
  371. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/common.md +94 -0
  372. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/common.md +20 -0
  373. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/realized.md +15 -0
  374. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/screenplay.md +11 -0
  375. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/scripts.md +17 -0
  376. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/realized.md +19 -0
  377. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/screenplay.md +25 -0
  378. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/scripts.md +19 -0
  379. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/brief.md +17 -0
  380. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/common.md +31 -0
  381. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/index.md +15 -0
  382. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/narratives.md +43 -0
  383. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/review.md +37 -0
  384. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/screenplay.md +26 -0
  385. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/scripts.md +26 -0
  386. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/settings.md +38 -0
  387. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/treatments.md +31 -0
  388. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/brief.md +21 -0
  389. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/common.md +15 -0
  390. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/index.md +17 -0
  391. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/narratives.md +41 -0
  392. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/realized.md +17 -0
  393. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/research.md +34 -0
  394. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/review.md +37 -0
  395. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/screenplay.md +82 -0
  396. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/scripts.md +45 -0
  397. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/settings.md +34 -0
  398. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/treatments.md +27 -0
  399. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/screenplay.md +14 -0
  400. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/scripts.md +12 -0
  401. package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/treatments.md +10 -0
  402. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/screenplay.md +9 -0
  403. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/scripts.md +9 -0
  404. package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/treatments.md +9 -0
  405. package/scaffold/instructions/.agents/skills/development/$repair.md +0 -0
  406. package/scaffold/instructions/.agents/skills/development/SKILL.md +33 -0
  407. package/scaffold/instructions/.agents/skills/development/entities.md +43 -0
  408. package/scaffold/instructions/.agents/skills/development/reuse.md +47 -0
  409. package/scaffold/instructions/.agents/skills/development/source-layout.md +69 -0
  410. package/scaffold/instructions/.agents/skills/development/testing.md +27 -0
  411. package/scaffold/instructions/.agents/skills/evidence/SKILL.md +16 -0
  412. package/scaffold/instructions/.agents/skills/evidence/adoption.md +11 -0
  413. package/scaffold/instructions/.agents/skills/evidence/answering.md +11 -0
  414. package/scaffold/instructions/.agents/skills/evidence/configuration.md +23 -0
  415. package/scaffold/instructions/.agents/skills/image/SKILL.md +69 -0
  416. package/scaffold/instructions/.agents/skills/motion/$authoring.md +0 -0
  417. package/scaffold/instructions/.agents/skills/motion/$contacts.md +0 -0
  418. package/scaffold/instructions/.agents/skills/motion/$laws.md +0 -0
  419. package/scaffold/instructions/.agents/skills/motion/$layers.md +0 -0
  420. package/scaffold/instructions/.agents/skills/motion/$transitions.md +0 -0
  421. package/scaffold/instructions/.agents/skills/motion/$variation.md +0 -0
  422. package/scaffold/instructions/.agents/skills/motion/$verification.md +0 -0
  423. package/scaffold/instructions/.agents/skills/motion/SKILL.md +55 -0
  424. package/scaffold/instructions/.agents/skills/motion/catalog-cases.md +11 -0
  425. package/scaffold/instructions/.agents/skills/motion/control-channels.md +19 -0
  426. package/scaffold/instructions/.agents/skills/motion/frame-evaluation.md +25 -0
  427. package/scaffold/instructions/.agents/skills/motion/method-references.md +23 -0
  428. package/scaffold/instructions/.agents/skills/motion/physical-feedback.md +31 -0
  429. package/scaffold/instructions/.agents/skills/motion/retargeting.md +23 -0
  430. package/scaffold/instructions/.agents/skills/motion/segment-review.md +17 -0
  431. package/scaffold/instructions/.agents/skills/motion/staging.md +29 -0
  432. package/scaffold/instructions/.agents/skills/production/SKILL.md +45 -0
  433. package/scaffold/instructions/.agents/skills/production/assembly.md +30 -0
  434. package/scaffold/instructions/.agents/skills/production/media-records.md +29 -0
  435. package/scaffold/instructions/.agents/skills/production/project-context.md +25 -0
  436. package/scaffold/instructions/.agents/skills/production/stage-caches.md +30 -0
  437. package/scaffold/instructions/.agents/skills/production/sustained-runs.md +21 -0
  438. package/scaffold/instructions/.agents/skills/production/sync-and-reorganization.md +21 -0
  439. package/scaffold/instructions/.agents/skills/review/SKILL.md +24 -0
  440. package/scaffold/instructions/.agents/skills/review/delivery-review.md +65 -0
  441. package/scaffold/instructions/.agents/skills/review/estimation.md +48 -0
  442. package/scaffold/instructions/.agents/skills/review/independent-reading.md +39 -0
  443. package/scaffold/instructions/.agents/skills/review/narrative-rounds.md +53 -0
  444. package/scaffold/instructions/.agents/skills/review/source-review.md +31 -0
  445. package/scaffold/instructions/.agents/skills/story/SKILL.md +20 -0
  446. package/scaffold/instructions/.agents/skills/story/correction/SKILL.md +13 -0
  447. package/scaffold/instructions/.agents/skills/story/correction/inspection.md +29 -0
  448. package/scaffold/instructions/.agents/skills/story/correction/repair.md +35 -0
  449. package/scaffold/instructions/.agents/skills/story/document-layout.md +38 -0
  450. package/scaffold/instructions/.agents/skills/story/evidence/SKILL.md +13 -0
  451. package/scaffold/instructions/.agents/skills/story/evidence/answer-placement.md +13 -0
  452. package/scaffold/instructions/.agents/skills/story/evidence/answer-writing.md +23 -0
  453. package/scaffold/instructions/.agents/skills/story/layers/SKILL.md +17 -0
  454. package/scaffold/instructions/.agents/skills/story/layers/brief.md +29 -0
  455. package/scaffold/instructions/.agents/skills/story/layers/notation.md +34 -0
  456. package/scaffold/instructions/.agents/skills/story/layers/screenplay.md +15 -0
  457. package/scaffold/instructions/.agents/skills/story/layers/scripts.md +11 -0
  458. package/scaffold/instructions/.agents/skills/story/layers/settings.md +39 -0
  459. package/scaffold/instructions/.agents/skills/story/layers/treatments.md +9 -0
  460. package/scaffold/instructions/.agents/skills/story/naturalness/SKILL.md +13 -0
  461. package/scaffold/instructions/.agents/skills/story/naturalness/rewriting.md +17 -0
  462. package/scaffold/instructions/.agents/skills/story/naturalness/transfer.md +11 -0
  463. package/scaffold/instructions/.agents/skills/story/planning/SKILL.md +15 -0
  464. package/scaffold/instructions/.agents/skills/story/planning/direction.md +14 -0
  465. package/scaffold/instructions/.agents/skills/story/planning/discovery.md +20 -0
  466. package/scaffold/instructions/.agents/skills/story/planning/requirements.md +25 -0
  467. package/scaffold/instructions/.agents/skills/story/planning/research.md +25 -0
  468. package/scaffold/instructions/.agents/skills/story/workflow.md +61 -0
  469. package/scaffold/instructions/.agents/skills/video/SKILL.md +29 -0
  470. package/scaffold/instructions/.agents/skills/video/diffusion.md +33 -0
  471. package/scaffold/instructions/.agents/skills/video/generation.md +27 -0
  472. package/scaffold/instructions/.agents/skills/video/prompts.md +51 -0
  473. package/scaffold/instructions/.agents/skills/visual-debugging/$capture.md +0 -0
  474. package/scaffold/instructions/.agents/skills/visual-debugging/$comparison.md +0 -0
  475. package/scaffold/instructions/.agents/skills/visual-debugging/$correction-rounds.md +0 -0
  476. package/scaffold/instructions/.agents/skills/visual-debugging/$passes.md +0 -0
  477. package/scaffold/instructions/.agents/skills/visual-debugging/$rendering-cost.md +0 -0
  478. package/scaffold/instructions/.agents/skills/visual-debugging/SKILL.md +30 -0
  479. package/scaffold/instructions/AGENTS.md +96 -0
  480. package/scaffold/instructions/CLAUDE.md +1 -0
  481. package/scaffold/production/PROJECT.md +3 -0
  482. package/scaffold/production/README.md +146 -0
  483. package/scaffold/production/_gitignore +20 -0
  484. package/scaffold/production/evidence.config.ts +12 -0
  485. package/scaffold/production/index.html +20 -0
  486. package/scaffold/production/lint.config.ts +46 -0
  487. package/scaffold/production/package.json +54 -0
  488. package/scaffold/production/src/IFilm.ts +41 -0
  489. package/scaffold/production/src/IFilmProduction.ts +80 -0
  490. package/scaffold/production/src/clampProductionSeconds.ts +21 -0
  491. package/scaffold/production/src/composition/films/index.ts +10 -0
  492. package/scaffold/production/src/composition/films/starter.ts +45 -0
  493. package/scaffold/production/src/executable/capture.ts +489 -0
  494. package/scaffold/production/src/executable/physics.ts +48 -0
  495. package/scaffold/production/src/executable/planCaptureStills.ts +65 -0
  496. package/scaffold/production/src/executable/recovery/node/artifact/archiveAutoMovieRecoveryModel.ts +171 -0
  497. package/scaffold/production/src/executable/recovery/node/artifact/createAutoMovieRecoveryArtifact.ts +268 -0
  498. package/scaffold/production/src/executable/recovery/node/artifact/index.ts +3 -0
  499. package/scaffold/production/src/executable/recovery/node/artifact/writeAutoMovieRecoveryArtifact.ts +303 -0
  500. package/scaffold/production/src/executable/recovery/node/cli.ts +12 -0
  501. package/scaffold/production/src/executable/recovery/node/index.ts +9 -0
  502. package/scaffold/production/src/executable/recovery/node/internal/IAutoMovieRecoveryMemoryUsage.ts +25 -0
  503. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTable.ts +95 -0
  504. package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTableInput.ts +50 -0
  505. package/scaffold/production/src/executable/recovery/node/internal/createRecoveryFileVectorTable.ts +181 -0
  506. package/scaffold/production/src/executable/recovery/node/internal/observeRecoveryAtlas.ts +492 -0
  507. package/scaffold/production/src/executable/recovery/node/internal/readAutoMovieRecoveryBoundedFile.ts +57 -0
  508. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryCameraImages.ts +80 -0
  509. package/scaffold/production/src/executable/recovery/node/internal/readRecoveryFixedReference.ts +26 -0
  510. package/scaffold/production/src/executable/recovery/node/internal/recovery.ts +272 -0
  511. package/scaffold/production/src/executable/recovery/node/internal/recoveryAtlas.ts +152 -0
  512. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraMap.ts +113 -0
  513. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraScene.ts +117 -0
  514. package/scaffold/production/src/executable/recovery/node/internal/recoveryCameras.ts +158 -0
  515. package/scaffold/production/src/executable/recovery/node/internal/recoveryContourPath.ts +185 -0
  516. package/scaffold/production/src/executable/recovery/node/internal/recoveryImages.ts +176 -0
  517. package/scaffold/production/src/executable/recovery/node/internal/recoveryLocal.ts +151 -0
  518. package/scaffold/production/src/executable/recovery/node/internal/recoveryOpen.ts +237 -0
  519. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryContourFileMesh.ts +265 -0
  520. package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryMeshSpool.ts +252 -0
  521. package/scaffold/production/src/executable/recovery/node/mesh/index.ts +3 -0
  522. package/scaffold/production/src/executable/recovery/node/mesh/readAutoMovieRecoveryMeshFrontier.ts +239 -0
  523. package/scaffold/production/src/executable/recovery/node/publishAutoMovieRecoveryArtifact.ts +63 -0
  524. package/scaffold/production/src/executable/recovery/node/reconstruction/index.ts +1 -0
  525. package/scaffold/production/src/executable/recovery/node/reconstruction/reconstructAutoMovieRecoveryLocal.ts +473 -0
  526. package/scaffold/production/src/executable/recovery/node/runAutoMovieRecoveryCommand.ts +148 -0
  527. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureError.ts +1 -0
  528. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureErrorCode.ts +1 -0
  529. package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessWaitUntil.ts +1 -0
  530. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureOptions.ts +79 -0
  531. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureSession.ts +39 -0
  532. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessFrameWriter.ts +20 -0
  533. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessLocator.ts +1 -0
  534. package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessPage.ts +1 -0
  535. package/scaffold/production/src/executable/render/headlessCapture/createHeadlessCaptureAdapter.ts +92 -0
  536. package/scaffold/production/src/executable/render/headlessCapture/index.ts +9 -0
  537. package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoOptions.ts +128 -0
  538. package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoResult.ts +43 -0
  539. package/scaffold/production/src/executable/render/node/IProductionRenditionClip.ts +44 -0
  540. package/scaffold/production/src/executable/render/node/acquireViewerBrowser.ts +24 -0
  541. package/scaffold/production/src/executable/render/node/addProductionMp4Sample.ts +89 -0
  542. package/scaffold/production/src/executable/render/node/appendLosslessVideoClip.ts +62 -0
  543. package/scaffold/production/src/executable/render/node/assembleProductionChunkVideoMp4.ts +167 -0
  544. package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionClips.ts +184 -0
  545. package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionVideo.ts +127 -0
  546. package/scaffold/production/src/executable/render/node/assertProductionRenditionClipDelivery.ts +102 -0
  547. package/scaffold/production/src/executable/render/node/cache/IAutoMovieDirectoryArtifactStore.ts +59 -0
  548. package/scaffold/production/src/executable/render/node/cache/IAutoMovieViewerFrameCacheReport.ts +30 -0
  549. package/scaffold/production/src/executable/render/node/cache/cacheViewerCaptureSession.ts +187 -0
  550. package/scaffold/production/src/executable/render/node/cache/composeViewerFrameKeys.ts +55 -0
  551. package/scaffold/production/src/executable/render/node/cache/createAutoMovieArtifactMiddleware.ts +107 -0
  552. package/scaffold/production/src/executable/render/node/cache/createAutoMovieDirectoryArtifactStore.ts +203 -0
  553. package/scaffold/production/src/executable/render/node/cache/digestAutoMovieSourceTree.ts +66 -0
  554. package/scaffold/production/src/executable/render/node/cache/readViewerFrameStates.ts +95 -0
  555. package/scaffold/production/src/executable/render/node/capture/DEFAULT_CHROME_EXECUTABLE.ts +11 -0
  556. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageOperationFailure.ts +13 -0
  557. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeArtifact.ts +30 -0
  558. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeOptions.ts +51 -0
  559. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceMetadata.ts +27 -0
  560. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderArtifact.ts +44 -0
  561. package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderOptions.ts +43 -0
  562. package/scaffold/production/src/executable/render/node/capture/IAutoMovieSequenceDissolvePixelCheck.ts +39 -0
  563. package/scaffold/production/src/executable/render/node/capture/captureRenderAndSee.ts +233 -0
  564. package/scaffold/production/src/executable/render/node/capture/captureSequenceRenderAndSee.ts +377 -0
  565. package/scaffold/production/src/executable/render/node/capture/index.ts +14 -0
  566. package/scaffold/production/src/executable/render/node/capture/preserveCleanupFailure.ts +34 -0
  567. package/scaffold/production/src/executable/render/node/capture/renderAndSeeCommand.ts +169 -0
  568. package/scaffold/production/src/executable/render/node/capture/renderSequenceAndSeeCommand.ts +165 -0
  569. package/scaffold/production/src/executable/render/node/capture/verifySequenceDissolvePixels.ts +179 -0
  570. package/scaffold/production/src/executable/render/node/conformProductionRenditionVideoMp4.ts +86 -0
  571. package/scaffold/production/src/executable/render/node/conformProductionVisualDeliveryVideoMp4.ts +230 -0
  572. package/scaffold/production/src/executable/render/node/decodeAutoMovieDelivery.ts +253 -0
  573. package/scaffold/production/src/executable/render/node/equalRational.ts +36 -0
  574. package/scaffold/production/src/executable/render/node/exactProductionClockProduct.ts +26 -0
  575. package/scaffold/production/src/executable/render/node/exportModelToGLB.ts +267 -0
  576. package/scaffold/production/src/executable/render/node/index.ts +27 -0
  577. package/scaffold/production/src/executable/render/node/loadModelGltfCore.ts +18 -0
  578. package/scaffold/production/src/executable/render/node/mixAutoMovieAudioCues.ts +74 -0
  579. package/scaffold/production/src/executable/render/node/muxProductionFeatureMp4.ts +170 -0
  580. package/scaffold/production/src/executable/render/node/neutralTrackPresentation.ts +59 -0
  581. package/scaffold/production/src/executable/render/node/normalizeProductionH264Mp4.ts +110 -0
  582. package/scaffold/production/src/executable/render/node/openLosslessVideoTrack.ts +81 -0
  583. package/scaffold/production/src/executable/render/node/parseMp4.ts +46 -0
  584. package/scaffold/production/src/executable/render/node/parseProductionMp4Output.ts +70 -0
  585. package/scaffold/production/src/executable/render/node/parseProductionRenditionClip.ts +92 -0
  586. package/scaffold/production/src/executable/render/node/planViewerVideo.ts +140 -0
  587. package/scaffold/production/src/executable/render/node/probeParsedProductionVideoMp4.ts +48 -0
  588. package/scaffold/production/src/executable/render/node/probeProductionPngPicture.ts +223 -0
  589. package/scaffold/production/src/executable/render/node/probeProductionRenderedMedia.ts +355 -0
  590. package/scaffold/production/src/executable/render/node/probeProductionVideoMp4.ts +27 -0
  591. package/scaffold/production/src/executable/render/node/probeVideoTrack.ts +220 -0
  592. package/scaffold/production/src/executable/render/node/productionRenditionVideoPlan.ts +149 -0
  593. package/scaffold/production/src/executable/render/node/recordViewerPlayback.ts +137 -0
  594. package/scaffold/production/src/executable/render/node/renderViewerFrames.ts +139 -0
  595. package/scaffold/production/src/executable/render/node/renderViewerVideo.ts +301 -0
  596. package/scaffold/production/src/executable/render/node/renderViewerVideoSession.ts +75 -0
  597. package/scaffold/production/src/executable/render/node/residentMp4Box.ts +36 -0
  598. package/scaffold/production/src/executable/render/node/residentPngJs.ts +26 -0
  599. package/scaffold/production/src/executable/render/node/runViewerVideoEncoder.ts +58 -0
  600. package/scaffold/production/src/executable/render/node/sameSampleDescription.ts +43 -0
  601. package/scaffold/production/src/executable/render/node/sameSampleFlags.ts +28 -0
  602. package/scaffold/production/src/executable/render/node/sampleBytes.ts +46 -0
  603. package/scaffold/production/src/executable/render/node/sampleDescription.ts +40 -0
  604. package/scaffold/production/src/executable/render/node/sampleOptions.ts +37 -0
  605. package/scaffold/production/src/executable/render/node/serializeDescriptionBox.ts +29 -0
  606. package/scaffold/production/src/executable/render/node/trimProductionAudioPresentation.ts +115 -0
  607. package/scaffold/production/src/executable/render/node/verifySampleStorage.ts +86 -0
  608. package/scaffold/production/src/executable/render/node/writeViewerFrameSheet.ts +101 -0
  609. package/scaffold/production/src/executable/render.ts +92 -0
  610. package/scaffold/production/src/executable/review.ts +54 -0
  611. package/scaffold/production/src/executable/viewer/inspection/createViewerDiskSource.ts +119 -0
  612. package/scaffold/production/src/executable/viewer/inspection/readViewerMaintainedSourceFiles.ts +64 -0
  613. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureError.ts +41 -0
  614. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureErrorCode.ts +22 -0
  615. package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessWaitUntil.ts +18 -0
  616. package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessLocator.ts +32 -0
  617. package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessPage.ts +130 -0
  618. package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureOptions.ts +38 -0
  619. package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureSession.ts +41 -0
  620. package/scaffold/production/src/executable/viewer/node/capture/createViewerCaptureSession.ts +154 -0
  621. package/scaffold/production/src/executable/viewer/node/capture/index.ts +8 -0
  622. package/scaffold/production/src/executable/viewer/node/index.ts +2 -0
  623. package/scaffold/production/src/executable/viewer/process/ProcessOwnership.ts +102 -0
  624. package/scaffold/production/src/executable/viewer/process/internal/IProcessChildObservation.ts +18 -0
  625. package/scaffold/production/src/executable/viewer/process/internal/IProcessOwnershipHost.ts +70 -0
  626. package/scaffold/production/src/executable/viewer/process/internal/ProcessOwnershipController.ts +125 -0
  627. package/scaffold/production/src/executable/viewer/process/internal/WindowsProcessOwnershipPrograms.ts +52 -0
  628. package/scaffold/production/src/executable/viewer/process/internal/createNodeProcessOwnershipHost.ts +41 -0
  629. package/scaffold/production/src/executable/viewer/process/internal/decodeLinuxProcessIdentity.ts +22 -0
  630. package/scaffold/production/src/executable/viewer/process/internal/decodePosixProcessIdentity.ts +24 -0
  631. package/scaffold/production/src/executable/viewer/process/internal/decodeWindowsProcessResult.ts +24 -0
  632. package/scaffold/production/src/executable/viewer/process/internal/readNativeProcessIdentity.ts +45 -0
  633. package/scaffold/production/src/executable/viewer/process/internal/requireProcessId.ts +15 -0
  634. package/scaffold/production/src/executable/viewer/process/internal/resolveProcessIdentityReadError.ts +15 -0
  635. package/scaffold/production/src/executable/viewer/process/internal/runWindowsProcessOperation.ts +41 -0
  636. package/scaffold/production/src/executable/viewer/process/internal/selectProcessOwnershipTree.ts +68 -0
  637. package/scaffold/production/src/main.ts +197 -0
  638. package/scaffold/production/src/selectFilm.ts +34 -0
  639. package/scaffold/production/test/features/executable/test_plan_capture_stills.ts +75 -0
  640. package/scaffold/production/test/features/test_clamp_production_seconds.ts +39 -0
  641. package/scaffold/production/test/features/test_select_film.ts +59 -0
  642. package/scaffold/production/test/features/testing/test_test_execution.ts +57 -0
  643. package/scaffold/production/test/features/testing/test_test_selection.ts +78 -0
  644. package/scaffold/production/test/helpers/assessTestExecution.ts +22 -0
  645. package/scaffold/production/test/helpers/selectTestFiles.ts +79 -0
  646. package/scaffold/production/test/index.ts +64 -0
  647. package/scaffold/production/test/tsconfig.json +6 -0
  648. package/scaffold/production/tsconfig.json +34 -0
  649. package/scaffold/production/tsconfig.test.json +9 -0
  650. package/scaffold/production/vite.config.ts +35 -0
  651. package/scaffold/workspace/README.md +42 -0
  652. package/scaffold/workspace/_gitignore +9 -0
  653. package/scaffold/workspace/package.json +19 -0
  654. package/scaffold/workspace/pnpm-workspace.yaml +46 -0
  655. package/src/AUTOMOVIE_TEMPLATE_CATALOGS.ts +48 -0
  656. package/src/AUTOMOVIE_TEMPLATE_VERSIONS.ts +39 -0
  657. package/src/AutoMovieScaffoldLayer.ts +18 -0
  658. package/src/FILE_ATTRIBUTE_DIRECTORY.ts +2 -0
  659. package/src/IAutoMovieCatalogVersionProps.ts +18 -0
  660. package/src/IAutoMovieScaffoldProps.ts +14 -0
  661. package/src/IAutoMovieScaffoldSourceEntry.ts +19 -0
  662. package/src/IAutoMovieTemplateDependencyVersionsProps.ts +19 -0
  663. package/src/IAutoMovieWorkspacePackageVersions.ts +44 -0
  664. package/src/IBoundChild.ts +86 -0
  665. package/src/IBoundChildStatus.ts +24 -0
  666. package/src/IBoundParent.ts +65 -0
  667. package/src/IBoundParentStatus.ts +15 -0
  668. package/src/ICreateResult.ts +35 -0
  669. package/src/IScaffoldCompletedFilePublicationOutcome.ts +17 -0
  670. package/src/IScaffoldCompletedPublication.ts +17 -0
  671. package/src/IScaffoldFileSnapshot.ts +28 -0
  672. package/src/IScaffoldParentPublicationRequest.ts +29 -0
  673. package/src/IScaffoldPartialFilePublicationOutcome.ts +25 -0
  674. package/src/IScaffoldPhysicalDirectory.ts +22 -0
  675. package/src/IScaffoldPosixConstants.ts +30 -0
  676. package/src/IScaffoldPublicationEntry.ts +22 -0
  677. package/src/IScaffoldPublicationFailure.ts +18 -0
  678. package/src/IScaffoldPublicationOptions.ts +19 -0
  679. package/src/IScaffoldPublicationReceipt.ts +29 -0
  680. package/src/IScaffoldRefusedFilePublicationOutcome.ts +20 -0
  681. package/src/IScaffoldSyncPlan.ts +26 -0
  682. package/src/IScaffoldSyncProps.ts +16 -0
  683. package/src/IWindowsFileInformation.ts +24 -0
  684. package/src/IWindowsLibrary.ts +148 -0
  685. package/src/SCAFFOLD_SYNC_STATE_FILE.ts +5 -0
  686. package/src/ScaffoldFilePublicationOutcome.ts +18 -0
  687. package/src/ScaffoldParentChangedError.ts +14 -0
  688. package/src/ScaffoldPublicationError.ts +58 -0
  689. package/src/assertOrdinaryFile.ts +20 -0
  690. package/src/assertOrdinarySingleLinkFile.ts +26 -0
  691. package/src/assertScaffoldOwnership.ts +29 -0
  692. package/src/assertScaffoldPhysicalDirectory.ts +29 -0
  693. package/src/assertScaffoldProjectName.ts +34 -0
  694. package/src/attachScaffoldSyncState.ts +30 -0
  695. package/src/captureEmptyScaffoldPhysicalDirectory.ts +45 -0
  696. package/src/captureScaffoldFile.ts +34 -0
  697. package/src/captureScaffoldPhysicalDirectory.ts +34 -0
  698. package/src/combineScaffoldFailures.ts +35 -0
  699. package/src/createAutoMovieCatalogVersionResolver.ts +117 -0
  700. package/src/createScaffoldSyncState.ts +33 -0
  701. package/src/createScaffoldVariables.ts +50 -0
  702. package/src/ensureScaffoldBaseDirectory.ts +55 -0
  703. package/src/ensureScaffoldFileDirectory.ts +75 -0
  704. package/src/index.ts +48 -0
  705. package/src/inside.ts +25 -0
  706. package/src/isScaffoldInstruction.ts +29 -0
  707. package/src/listAutoMovieScaffoldFiles.ts +56 -0
  708. package/src/loadWindowsLibrary.ts +277 -0
  709. package/src/mergeScaffoldFiles.ts +39 -0
  710. package/src/missingPath.ts +16 -0
  711. package/src/nativeError.ts +15 -0
  712. package/src/openPosixParent.ts +155 -0
  713. package/src/openWindowsParent.ts +305 -0
  714. package/src/overwriteScaffoldFile.ts +262 -0
  715. package/src/physicalDirectoryIdentity.ts +33 -0
  716. package/src/physicalVersion.ts +18 -0
  717. package/src/planScaffoldPublication.ts +100 -0
  718. package/src/planScaffoldSync.ts +122 -0
  719. package/src/publishFiles.ts +120 -0
  720. package/src/publishNativeScaffoldFile.ts +287 -0
  721. package/src/publishScaffoldCandidate.ts +94 -0
  722. package/src/readAutoMovieScaffoldSources.ts +82 -0
  723. package/src/readScaffoldSyncFile.ts +66 -0
  724. package/src/renderScaffold.ts +43 -0
  725. package/src/renderScaffoldEntries.ts +110 -0
  726. package/src/renderScaffoldInstructions.ts +22 -0
  727. package/src/renderScaffoldLayer.ts +38 -0
  728. package/src/renderTemplate.ts +62 -0
  729. package/src/renderWorkspaceProductionScaffold.ts +35 -0
  730. package/src/renderWorkspaceScaffold.ts +43 -0
  731. package/src/replaceSharedScaffoldFile.ts +88 -0
  732. package/src/resolveAutoMovieCatalogVersion.ts +27 -0
  733. package/src/resolveAutoMovieTemplateDependencyVersions.ts +70 -0
  734. package/src/resolveScaffoldPosixConstants.ts +50 -0
  735. package/src/scaffoldAssetDirectory.ts +30 -0
  736. package/src/scaffoldPhysicalIdentity.ts +21 -0
  737. package/src/scaffoldSharedSkillDirectory.ts +25 -0
  738. package/src/scaffoldSharedSkillPath.ts +31 -0
  739. package/src/syncScaffold.ts +38 -0
  740. package/src/writeFiles.ts +48 -0
  741. package/src/writeScaffoldFile.ts +88 -0
  742. package/src/writtenVersion.ts +19 -0
@@ -0,0 +1,94 @@
1
+ import { type IScaffoldCompletedPublication } from "./IScaffoldCompletedPublication";
2
+ import { type IScaffoldPublicationEntry } from "./IScaffoldPublicationEntry";
3
+ import { type IScaffoldPublicationReceipt } from "./IScaffoldPublicationReceipt";
4
+ import { type ScaffoldFilePublicationOutcome } from "./ScaffoldFilePublicationOutcome";
5
+
6
+ /**
7
+ * Publish a candidate in order through a one-file publisher and report the exact effect.
8
+ *
9
+ * Stops at the first entry whose outcome is not `completed`. Throws instead of returning a receipt when the publisher reports an outcome that breaks its contract: a completed or partial result without a parent identity, an unknown refusal reason, a byte count outside the entry, or an unknown status. A frozen entry with a frozen byte array is used as is; any other entry is copied and frozen first, so the publisher and the receipt see the same immutable data.
10
+ *
11
+ * @param props.candidate Entries to publish, normally from {@link planScaffoldPublication}.
12
+ * @param props.publish Publishes one entry and reports its outcome; must not throw.
13
+ * @returns Frozen receipt describing the completed prefix and any failure.
14
+ *
15
+ * @evidence contracts/development/implementation.md#principled-implementation A sequential loop that stops at the first non-completed outcome makes the completed set a prefix of the candidate, so the receipt is exact without probing the file system afterwards; adapter outcomes are validated against the union's invariants before they enter the receipt.
16
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns ordering, outcome validation, and status derivation, and takes the file system work as the `publish` callback so `publishFiles` owns directories and descriptors.
17
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An outcome outside the contract, including an unknown status that was previously recorded as a partial failure, now throws instead of being coerced; no entry or adapter is special-cased.
18
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the stop rule, every contract violation that throws, the freezing and reuse rule for entries, the parameters' duties, and the returned receipt.
19
+ * @evidence contracts/development/implementation.md#efficient-algorithms One pass over the candidate calls the publisher once per entry; a frozen entry with frozen bytes is reused instead of copying its bytes, so the planner's output adds no per-byte work here.
20
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work A frozen entry is shared with the receipt because neither its fields nor its frozen byte array can change; equivalence is that immutability, not a matching path, and every publish call still runs since each write is an effect.
21
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The function holds no descriptor; it retains the planned entries and one completed record per finished file in the returned receipt, bounded by the candidate length, and releases nothing because the caller owns the receipt.
22
+ */
23
+ export const publishScaffoldCandidate: (props: {
24
+ candidate: readonly IScaffoldPublicationEntry[];
25
+ publish: (entry: IScaffoldPublicationEntry) => ScaffoldFilePublicationOutcome;
26
+ }) => IScaffoldPublicationReceipt = (props: {
27
+ candidate: readonly IScaffoldPublicationEntry[];
28
+ publish: (entry: IScaffoldPublicationEntry) => ScaffoldFilePublicationOutcome;
29
+ }): IScaffoldPublicationReceipt => {
30
+ const planned: readonly IScaffoldPublicationEntry[] = Object.freeze(
31
+ props.candidate.map(
32
+ (entry: IScaffoldPublicationEntry): IScaffoldPublicationEntry =>
33
+ Object.isFrozen(entry) && Object.isFrozen(entry.bytes)
34
+ ? entry
35
+ : Object.freeze({
36
+ bytes: Object.freeze([...entry.bytes]),
37
+ relative: entry.relative,
38
+ target: entry.target,
39
+ }),
40
+ ),
41
+ );
42
+ const completed: IScaffoldCompletedPublication[] = [];
43
+ for (const entry of planned) {
44
+ const outcome: ScaffoldFilePublicationOutcome = props.publish(entry);
45
+ if (outcome.status === "completed") {
46
+ if (outcome.parentIdentity.length === 0)
47
+ throw new Error(
48
+ `completed scaffold publication omitted parent identity: ${entry.relative}`,
49
+ );
50
+ completed.push(
51
+ Object.freeze({ entry, parentIdentity: outcome.parentIdentity }),
52
+ );
53
+ continue;
54
+ }
55
+ if (outcome.status === "refused") {
56
+ if (
57
+ outcome.reason !== "create-failed" &&
58
+ outcome.reason !== "parent-changed" &&
59
+ outcome.reason !== "target-competitor"
60
+ )
61
+ throw new Error(
62
+ `refused scaffold publication has invalid reason: ${entry.relative}`,
63
+ );
64
+ } else if (outcome.status === "partial") {
65
+ if (
66
+ outcome.parentIdentity.length === 0 ||
67
+ Number.isSafeInteger(outcome.bytesWritten) === false ||
68
+ outcome.bytesWritten < 0 ||
69
+ outcome.bytesWritten > entry.bytes.length
70
+ )
71
+ throw new Error(
72
+ `partial scaffold publication has invalid bound state: ${entry.relative}`,
73
+ );
74
+ } else
75
+ throw new Error(
76
+ `scaffold publication returned an unknown outcome: ${entry.relative}`,
77
+ );
78
+ return Object.freeze({
79
+ completed: Object.freeze(completed),
80
+ failure: Object.freeze({ entry, outcome: Object.freeze({ ...outcome }) }),
81
+ planned,
82
+ status:
83
+ outcome.status === "refused" && completed.length === 0
84
+ ? "refused"
85
+ : "partial",
86
+ });
87
+ }
88
+ return Object.freeze({
89
+ completed: Object.freeze(completed),
90
+ failure: null,
91
+ planned,
92
+ status: "completed",
93
+ });
94
+ };
@@ -0,0 +1,82 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+
4
+ import type { IAutoMovieScaffoldSourceEntry } from "./IAutoMovieScaffoldSourceEntry";
5
+ import { listAutoMovieScaffoldFiles } from "./listAutoMovieScaffoldFiles";
6
+ import { scaffoldSharedSkillPath } from "./scaffoldSharedSkillPath";
7
+
8
+ /** Scaffold-relative directory, with the host's separator, holding every skill. */
9
+ const SKILLS: string = path.join(".agents", "skills");
10
+
11
+ /**
12
+ * Read every shipped scaffold source, replacing each `$<name>` placeholder with the repository skill item it names.
13
+ *
14
+ * The scaffold's own files come from {@link listAutoMovieScaffoldFiles} with their text. A placeholder, as {@link scaffoldSharedSkillPath} defines it, must be empty; it is dropped, and the item it names under `skills` takes its place: a folder contributes every file {@link listAutoMovieScaffoldFiles} lists under it, and a file contributes itself, each at the item's path under the scaffold's `.agents/skills`. The scaffold may not author a file inside a folder a placeholder ships, so a shared skill has no second, partial owner; an authored file at a shipped file's path is left for {@link renderScaffoldEntries} to refuse as a collision.
15
+ *
16
+ * @param root Absolute scaffold directory.
17
+ * @param skills Absolute directory holding the repository skill items, laid out as the repository's `.agents/skills`.
18
+ * @returns The sources, the scaffold's own in listing order with each placeholder's items at its position.
19
+ * @throws When a placeholder has text, when the item it names is missing, or when the scaffold authors a file inside a shipped folder.
20
+ *
21
+ * @evidence contracts/development/implementation.md#principled-implementation Files are read as UTF-8 text like every other scaffold source; a folder item is listed by the same walker as the scaffold, so builder outputs and links inside it are excluded by the same policy; a shipped folder's files are found by a prefix match on the scaffold-relative path plus the separator, which cannot match a sibling whose name only starts with the folder's name.
22
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns reading sources and expanding placeholders, leaving the placeholder rule to `scaffoldSharedSkillPath`, the item location to the caller, and rendering and collision refusal to `renderScaffoldEntries`.
23
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No skill or file is named; every placeholder takes the same path, and a non-empty placeholder or an authored file inside a shipped folder is refused instead of being merged or discarded.
24
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states what is read, the placeholder's empty requirement, how folder and file items are placed, the refused overlap and the collision left to rendering, the output order, and what throws.
25
+ * @evidence contracts/development/implementation.md#efficient-algorithms The scaffold is listed once and each source file is read once; each placeholder adds one stat and one listing of its item, and the overlap check compares each authored path with each shipped folder prefix, costing authored files times shipped folders.
26
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the scaffold and the shared items as installed now, once per render.
27
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Reads use `readFileSync` and `statSync`, which release their handles before returning; the listing lives only for the call, and the returned sources, one string per file, are owned by the caller.
28
+ */
29
+ export const readAutoMovieScaffoldSources: (
30
+ root: string,
31
+ skills: string,
32
+ ) => IAutoMovieScaffoldSourceEntry[] = (
33
+ root: string,
34
+ skills: string,
35
+ ): IAutoMovieScaffoldSourceEntry[] => {
36
+ const relatives: string[] = listAutoMovieScaffoldFiles(root);
37
+
38
+ // Locate the shipped folders first, so an authored file inside one is refused wherever the walk meets it.
39
+ const folders: string[] = [];
40
+ for (const relative of relatives) {
41
+ const shared: string | null = scaffoldSharedSkillPath(relative);
42
+ if (shared === null) continue;
43
+ const item: string = path.join(skills, shared);
44
+ if (!fs.existsSync(item))
45
+ throw new Error(
46
+ `scaffold placeholder "${relative}" names a missing shared skill item: ${item}`,
47
+ );
48
+ if (fs.statSync(item).isDirectory())
49
+ folders.push(path.join(SKILLS, shared) + path.sep);
50
+ }
51
+
52
+ const out: IAutoMovieScaffoldSourceEntry[] = [];
53
+ for (const relative of relatives) {
54
+ const content: string = fs.readFileSync(path.join(root, relative), "utf8");
55
+ const shared: string | null = scaffoldSharedSkillPath(relative);
56
+ if (shared === null) {
57
+ const folder: string | undefined = folders.find(
58
+ (prefix: string): boolean => relative.startsWith(prefix),
59
+ );
60
+ if (folder !== undefined)
61
+ throw new Error(
62
+ `scaffold file "${relative}" lies inside the shared skill folder "${folder}" that a placeholder ships`,
63
+ );
64
+ out.push({ content, relative });
65
+ continue;
66
+ }
67
+ if (content.length !== 0)
68
+ throw new Error(`scaffold placeholder "${relative}" must be empty`);
69
+
70
+ // Ship the named item at its own path, never the placeholder.
71
+ const item: string = path.join(skills, shared);
72
+ const target: string = path.join(SKILLS, shared);
73
+ if (fs.statSync(item).isDirectory())
74
+ for (const file of listAutoMovieScaffoldFiles(item))
75
+ out.push({
76
+ content: fs.readFileSync(path.join(item, file), "utf8"),
77
+ relative: path.join(target, file),
78
+ });
79
+ else out.push({ content: fs.readFileSync(item, "utf8"), relative: target });
80
+ }
81
+ return out;
82
+ };
@@ -0,0 +1,66 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ import type { IScaffoldFileSnapshot } from "./IScaffoldFileSnapshot";
5
+ import type { IScaffoldPhysicalDirectory } from "./IScaffoldPhysicalDirectory";
6
+ import { assertScaffoldOwnership } from "./assertScaffoldOwnership";
7
+ import { captureScaffoldFile } from "./captureScaffoldFile";
8
+ import { captureScaffoldPhysicalDirectory } from "./captureScaffoldPhysicalDirectory";
9
+ import { missingPath } from "./missingPath";
10
+
11
+ /**
12
+ * Reads an ordinary single-link sync input and captures its unchanged generation.
13
+ *
14
+ * @evidence contracts/development/implementation.md#principled-implementation Captured ordinary root and inner directories are revalidated around strict UTF-8 reading, and file identity/written generation must survive the read.
15
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure This shared input boundary handles current instructions, state and a declared prior baseline.
16
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Linked directories/files and multi-link files refuse; only genuinely missing levels return undefined, and concurrent changes propagate.
17
+ * @evidence contracts/development/common.md#meaningful-documentation The return record separates text from its later write precondition; directory and file refusals remain explicit.
18
+ * @evidence contracts/development/implementation.md#efficient-algorithms Parent captures scale with path depth and reading with file bytes; no directory tree is recursively enumerated.
19
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The root and parent captures serve the before/after ownership checks within this read; other files receive fresh observations.
20
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Synchronous reads close their descriptor; temporary directory captures hold scalar identities only and returned text/snapshot belong to the caller.
21
+ */
22
+ export function readScaffoldSyncFile(
23
+ location: string,
24
+ relative: string,
25
+ ): { text: string; snapshot: IScaffoldFileSnapshot } | undefined {
26
+ const root: string = path.resolve(location);
27
+ const base: IScaffoldPhysicalDirectory =
28
+ captureScaffoldPhysicalDirectory(root);
29
+ const target: string = path.resolve(root, relative);
30
+ const local: string = path.relative(root, target);
31
+ if (
32
+ local === "" ||
33
+ local === ".." ||
34
+ local.startsWith(".." + path.sep) ||
35
+ path.isAbsolute(local)
36
+ )
37
+ throw new Error("Sync input escapes its root.");
38
+ const parents: IScaffoldPhysicalDirectory[] = [base];
39
+ let directory: string = root;
40
+ try {
41
+ for (const part of local.split(path.sep).slice(0, -1)) {
42
+ directory = path.join(directory, part);
43
+ const captured: IScaffoldPhysicalDirectory =
44
+ captureScaffoldPhysicalDirectory(directory);
45
+ assertScaffoldOwnership(base, captured);
46
+ parents.push(captured);
47
+ }
48
+ const snapshot: IScaffoldFileSnapshot = captureScaffoldFile(target);
49
+ const text: string = new TextDecoder("utf-8", {
50
+ fatal: true,
51
+ ignoreBOM: true,
52
+ }).decode(fs.readFileSync(target));
53
+ const after: IScaffoldFileSnapshot = captureScaffoldFile(target);
54
+ if (
55
+ snapshot.identity !== after.identity ||
56
+ snapshot.written !== after.written
57
+ )
58
+ throw new Error("Sync input changed while reading: " + relative);
59
+ for (const parent of parents) assertScaffoldOwnership(base, parent);
60
+ return { text, snapshot };
61
+ } catch (error) {
62
+ if (!missingPath(error)) throw error;
63
+ for (const parent of parents) assertScaffoldOwnership(base, parent);
64
+ return undefined;
65
+ }
66
+ }
@@ -0,0 +1,43 @@
1
+ import type { IAutoMovieScaffoldProps } from "./IAutoMovieScaffoldProps";
2
+ import { assertScaffoldProjectName } from "./assertScaffoldProjectName";
3
+ import { attachScaffoldSyncState } from "./attachScaffoldSyncState";
4
+ import { createScaffoldVariables } from "./createScaffoldVariables";
5
+ import { mergeScaffoldFiles } from "./mergeScaffoldFiles";
6
+ import { renderScaffoldInstructions } from "./renderScaffoldInstructions";
7
+ import { renderScaffoldLayer } from "./renderScaffoldLayer";
8
+
9
+ /**
10
+ * Render a single production, its own repository, into an in-memory `{ posixPath: content }` map.
11
+ *
12
+ * The map joins the shared instruction surface from {@link renderScaffoldInstructions} with the `production` layer, whose `{{name}}` is the admitted name, `{{skills}}` the production's own `.agents/skills`, and `{{version:<key>}}` the build-time `AUTOMOVIE_TEMPLATE_VERSIONS` ranges. Every file has LF line endings, the root `_gitignore` stand-in is returned as `.gitignore`, and the generated instruction digests are added for explicit later sync. Nothing is written; {@link publishFiles} and {@link writeFiles} write the map.
13
+ *
14
+ * @param props The project's name, admitted by {@link assertScaffoldProjectName}.
15
+ * @returns The rendered file map.
16
+ * @throws When the name is refused, when a layer or the shared-skill directory is missing, on a placeholder refusal, on a token error, or on a path collision within or between layers.
17
+ *
18
+ * @evidence contracts/development/implementation.md#principled-implementation The production's links and evidence configuration reach `.agents/skills` beside them, and its dependencies carry the ranges this package was built with.
19
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function chooses the layers and token values; name admission, layer rendering, joining and sync state each have one owner.
20
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The only variables are the name, the skills path and the generated version table, with no per-file exception; a failure in any step throws instead of returning a partial map.
21
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the layers, every token value, the normalization and rename, the added state, that nothing is written, and what throws.
22
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two layer renders, one join pass and one digest per instruction file.
23
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the scaffold as installed now and is made once per CLI run.
24
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Reads close before returning, and the returned map, which holds the whole rendered scaffold in memory, is owned by the caller.
25
+ */
26
+ export const renderScaffold: (
27
+ props: IAutoMovieScaffoldProps,
28
+ ) => Record<string, string> = (
29
+ props: IAutoMovieScaffoldProps,
30
+ ): Record<string, string> =>
31
+ attachScaffoldSyncState(
32
+ mergeScaffoldFiles(
33
+ renderScaffoldInstructions(),
34
+ renderScaffoldLayer(
35
+ "production",
36
+ createScaffoldVariables({
37
+ name: assertScaffoldProjectName(props.name),
38
+ skills: ".agents/skills",
39
+ dependencies: "release",
40
+ }),
41
+ ),
42
+ ),
43
+ );
@@ -0,0 +1,110 @@
1
+ import * as path from "node:path";
2
+
3
+ import type { IAutoMovieScaffoldSourceEntry } from "./IAutoMovieScaffoldSourceEntry";
4
+ import { renderTemplate } from "./renderTemplate";
5
+
6
+ /** One source entry after rendering, keeping its source path for diagnostics. */
7
+ interface IRenderedScaffoldEntry {
8
+ content: string;
9
+ relative: string;
10
+ source: string;
11
+ }
12
+
13
+ /**
14
+ * Normalize `\r\n` to `\n` so the scaffold emits identical bytes on every host: a Windows checkout with `core.autocrlf` would otherwise ship CRLF. The tree is text only, so the replacement cannot corrupt binary content.
15
+ */
16
+ const normalizeLineEndings: (content: string) => string = (
17
+ content: string,
18
+ ): string => content.replaceAll("\r\n", "\n");
19
+
20
+ /** Join path segments with `/` so map keys do not depend on the host. */
21
+ const toPosix: (value: string) => string = (value: string): string =>
22
+ value.split(path.sep).join("/");
23
+
24
+ /**
25
+ * The rendered key for one scaffold-relative path.
26
+ *
27
+ * Path segments get the same strict substitution and unknown-token failure as file contents, so a templated path cannot ship verbatim. The root `_gitignore` stand-in becomes `.gitignore` only here, because npm pack renames a packed `.gitignore` to `.npmignore`; nested files of that name stay ordinary paths.
28
+ */
29
+ const renderKey: (
30
+ relative: string,
31
+ variables: Readonly<Record<string, string>>,
32
+ ) => string = (
33
+ relative: string,
34
+ variables: Readonly<Record<string, string>>,
35
+ ): string => {
36
+ const dir: string = path.dirname(relative);
37
+ const base: string = path.basename(relative);
38
+ const outputBase: string =
39
+ dir === "." && base === "_gitignore" ? ".gitignore" : base;
40
+ return renderTemplate(
41
+ toPosix(dir === "." ? outputBase : path.join(dir, outputBase)),
42
+ variables,
43
+ );
44
+ };
45
+
46
+ /**
47
+ * Render a list of scaffold sources into a `{ posixPath: content }` map, refusing the whole list when two sources render to the same path.
48
+ *
49
+ * Each content has CRLF normalized to LF and its tokens rendered; each path is rendered the same way, with `/` separators, and a root `_gitignore` becomes `.gitignore`, so a scaffold that ships both is refused as a collision. The collision error names the first colliding path in code-unit order and both source paths, independent of the input order. The returned object has no prototype, so a key such as `__proto__` is an ordinary file path.
50
+ *
51
+ * @param entries Source paths relative to the scaffold root, with their text.
52
+ * @param variables Token values, as for {@link renderTemplate}.
53
+ * @returns The rendered file map.
54
+ * @throws On a collision or on any token error from {@link renderTemplate}.
55
+ *
56
+ * @evidence contracts/development/implementation.md#principled-implementation Collisions are found by sorting rendered entries by output path, then source path, and comparing neighbours, which detects a duplicate whenever one exists and reports the smallest colliding path regardless of input order; string relational operators compare UTF-16 code units, so the order does not depend on the host locale; `Object.defineProperty` on a null-prototype object stores `__proto__` as data instead of invoking the setter.
57
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function owns line endings, path rendering, the `.gitignore` rename, and collision refusal for an explicit source list, while `renderScaffold` owns reading the scaffold from disk, so this step works on any list without file-system access.
58
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The `_gitignore` rename is the one path special case, and its basis is npm's documented renaming of `.gitignore` in packed packages; a collision is refused rather than resolved by keeping either source.
59
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the normalization, the path rules and the rename, what a collision reports and that it is order independent, the null prototype, and what throws.
60
+ * @evidence contracts/development/implementation.md#efficient-algorithms Each content and path is rendered once with renderTemplate's token-search and string-construction costs. Collision reporting sorts a copy of n rendered entries, using n log n path comparisons whose cost depends on shared path prefixes, then scans neighbours once to choose the smallest collision deterministically.
61
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Every entry renders distinct text once; there is no repeated computation within a call, and a new call receives a new source list.
62
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The rendered list and its sorted copy live only for the call; the returned map holds one string per entry and is owned by the caller.
63
+ */
64
+ export const renderScaffoldEntries: (
65
+ entries: readonly IAutoMovieScaffoldSourceEntry[],
66
+ variables: Readonly<Record<string, string>>,
67
+ ) => Record<string, string> = (
68
+ entries: readonly IAutoMovieScaffoldSourceEntry[],
69
+ variables: Readonly<Record<string, string>>,
70
+ ): Record<string, string> => {
71
+ const rendered: IRenderedScaffoldEntry[] = entries.map(
72
+ (entry: IAutoMovieScaffoldSourceEntry): IRenderedScaffoldEntry => ({
73
+ content: renderTemplate(normalizeLineEndings(entry.content), variables),
74
+ relative: renderKey(entry.relative, variables),
75
+ source: toPosix(entry.relative),
76
+ }),
77
+ );
78
+ const ordered: IRenderedScaffoldEntry[] = [...rendered].sort(
79
+ (left: IRenderedScaffoldEntry, right: IRenderedScaffoldEntry): number =>
80
+ left.relative < right.relative
81
+ ? -1
82
+ : left.relative > right.relative
83
+ ? 1
84
+ : left.source < right.source
85
+ ? -1
86
+ : left.source > right.source
87
+ ? 1
88
+ : 0,
89
+ );
90
+ for (let index: number = 1; index < ordered.length; index++) {
91
+ const previous: IRenderedScaffoldEntry = ordered[index - 1]!;
92
+ const current: IRenderedScaffoldEntry = ordered[index]!;
93
+ if (previous.relative === current.relative)
94
+ throw new Error(
95
+ `scaffold sources collide at rendered path "${current.relative}": "${previous.source}", "${current.source}"`,
96
+ );
97
+ }
98
+ const files: Record<string, string> = Object.create(null) as Record<
99
+ string,
100
+ string
101
+ >;
102
+ for (const entry of rendered)
103
+ Object.defineProperty(files, entry.relative, {
104
+ configurable: true,
105
+ enumerable: true,
106
+ value: entry.content,
107
+ writable: true,
108
+ });
109
+ return files;
110
+ };
@@ -0,0 +1,22 @@
1
+ import { renderScaffoldLayer } from "./renderScaffoldLayer";
2
+
3
+ /**
4
+ * Render the shared instruction surface: `AGENTS.md`, `CLAUDE.md` and `.agents/skills`, with every `$<name>` placeholder expanded.
5
+ *
6
+ * The layer is rendered with no tokens, so its bytes are identical for a single production and a workspace root, and explicit sync can compare either against one bundle. A token in an instruction file fails the render.
7
+ *
8
+ * @returns The instruction files, relative to the directory holding `AGENTS.md`.
9
+ * @throws As {@link renderScaffoldLayer} does.
10
+ *
11
+ * @evidence contracts/development/implementation.md#principled-implementation An empty token table makes the instruction bytes independent of the project name and layout, which is what lets one sync plan serve both installations.
12
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Creation and sync obtain the instruction surface from this one function.
13
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No installation-specific value reaches the instructions; a layout difference belongs to the production or workspace layer.
14
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the content, why no tokens are supplied, and what fails.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms One layer render, with the costs of the reader and renderer.
16
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the installed bundle as it is now.
17
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned map is owned by the caller.
18
+ */
19
+ export const renderScaffoldInstructions: () => Record<
20
+ string,
21
+ string
22
+ > = (): Record<string, string> => renderScaffoldLayer("instructions", {});
@@ -0,0 +1,38 @@
1
+ import type { AutoMovieScaffoldLayer } from "./AutoMovieScaffoldLayer";
2
+ import { readAutoMovieScaffoldSources } from "./readAutoMovieScaffoldSources";
3
+ import { renderScaffoldEntries } from "./renderScaffoldEntries";
4
+ import { scaffoldAssetDirectory } from "./scaffoldAssetDirectory";
5
+ import { scaffoldSharedSkillDirectory } from "./scaffoldSharedSkillDirectory";
6
+
7
+ /**
8
+ * Render one bundled scaffold layer into a `{ posixPath: content }` map relative to the directory it installs into.
9
+ *
10
+ * The layer's files are read with each `$<name>` placeholder expanded by {@link readAutoMovieScaffoldSources}, then rendered by {@link renderScaffoldEntries}: LF line endings, tokens replaced from `variables`, the layer-root `_gitignore` returned as `.gitignore`, and colliding paths refused.
11
+ *
12
+ * @param layer The layer to render.
13
+ * @param variables Token values; a token absent from them fails the render.
14
+ * @returns The rendered layer.
15
+ * @throws When the layer or shared-skill directory is missing, on a placeholder refusal, or on a token error or path collision.
16
+ *
17
+ * @evidence contracts/development/implementation.md#principled-implementation Each layer is an ordinary scaffold root, so the existing reader and renderer apply unchanged, including the root `_gitignore` rename per installed directory.
18
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function only joins location, reading and rendering; composition and naming stay with the public renderers.
19
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No layer or file is special-cased here; any failure throws instead of returning part of a layer.
20
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states what is read, how it is rendered, and what throws.
21
+ * @evidence contracts/development/implementation.md#efficient-algorithms The layer is walked and each file read and rendered once, with the costs of the reader and renderer it calls.
22
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the layer as installed now; a render reads each layer at most once.
23
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Reads close before returning, and the returned map is owned by the caller.
24
+ */
25
+ export const renderScaffoldLayer: (
26
+ layer: AutoMovieScaffoldLayer,
27
+ variables: Readonly<Record<string, string>>,
28
+ ) => Record<string, string> = (
29
+ layer: AutoMovieScaffoldLayer,
30
+ variables: Readonly<Record<string, string>>,
31
+ ): Record<string, string> =>
32
+ renderScaffoldEntries(
33
+ readAutoMovieScaffoldSources(
34
+ scaffoldAssetDirectory(layer),
35
+ scaffoldSharedSkillDirectory(),
36
+ ),
37
+ variables,
38
+ );
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Replace every `{{key}}` token in `content` with `variables[key]`.
3
+ *
4
+ * A key is one or more of `A-Z`, `a-z`, `0-9`, `:`, `_`, `@`, `.`, `/`, and `-`, such as `name` or `version:engine`. Everything else is an error, so a mistyped placeholder fails the render instead of shipping a broken file: a `{{` without a later `}}`, a `}}` before any `{{`, an empty, blank, or malformed key, a key that is not an own property of `variables`, and a value that itself contains `{{` or `}}`. A replaced value is never scanned again.
5
+ *
6
+ * @param content Template text.
7
+ * @param variables Values by key; inherited properties are not keys.
8
+ * @returns The rendered text.
9
+ * @throws On any of the errors listed above, naming the token or offset.
10
+ *
11
+ * @evidence contracts/development/implementation.md#principled-implementation A left-to-right cursor finds delimiter pairs with indexOf and appends intervening text and selected values. The key pattern excludes braces and each value is checked for delimiters, so substituted values are never rescanned and malformed input throws before a result is returned.
12
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One function serves both file contents and path segments in `renderScaffoldEntries`, so paths and payloads follow the same token rules.
13
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An unknown key throws rather than being left in place or blanked, and the own-property check keeps `__proto__` or `constructor` from resolving through the prototype.
14
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the key alphabet, every refusal with its reason, that inherited properties are not keys, and that values are not rescanned.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms Delimiter searches advance with the cursor and examine input spans a bounded number of times; key and value checks add their visited lengths. Output uses repeated string concatenation, whose allocation and copying cost depends on the JavaScript engine's string representation, so this owner does not guarantee linear output construction.
16
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call renders one distinct text; `renderScaffoldEntries` calls it once per file content and once per path.
17
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The function builds one output string and retains nothing after returning.
18
+ */
19
+ export const renderTemplate: (
20
+ content: string,
21
+ variables: Readonly<Record<string, string>>,
22
+ ) => string = (
23
+ content: string,
24
+ variables: Readonly<Record<string, string>>,
25
+ ): string => {
26
+ let cursor: number = 0;
27
+ let rendered: string = "";
28
+ while (cursor < content.length) {
29
+ const opening: number = content.indexOf("{{", cursor);
30
+ const closing: number = content.indexOf("}}", cursor);
31
+ if (closing !== -1 && (opening === -1 || closing < opening))
32
+ throw new Error(
33
+ `unmatched scaffold placeholder closing delimiter at offset ${closing}`,
34
+ );
35
+ if (opening === -1) {
36
+ rendered += content.slice(cursor);
37
+ break;
38
+ }
39
+ rendered += content.slice(cursor, opening);
40
+ const end: number = content.indexOf("}}", opening + 2);
41
+ if (end === -1)
42
+ throw new Error(
43
+ `unmatched scaffold placeholder opening delimiter at offset ${opening}`,
44
+ );
45
+ const key: string = content.slice(opening + 2, end);
46
+ if (key.length === 0) throw new Error("empty scaffold placeholder: {{}}");
47
+ if (key.trim().length === 0)
48
+ throw new Error(`whitespace scaffold placeholder: {{${key}}}`);
49
+ if (/^[A-Za-z0-9:_@./-]+$/u.test(key) === false)
50
+ throw new Error(`malformed scaffold placeholder: {{${key}}}`);
51
+ if (Object.prototype.hasOwnProperty.call(variables, key) === false)
52
+ throw new Error(`unknown scaffold variable: {{${key}}}`);
53
+ const value: string = variables[key]!;
54
+ if (value.includes("{{") || value.includes("}}"))
55
+ throw new Error(
56
+ `scaffold variable {{${key}}} expands to placeholder syntax`,
57
+ );
58
+ rendered += value;
59
+ cursor = end + 2;
60
+ }
61
+ return rendered;
62
+ };
@@ -0,0 +1,35 @@
1
+ import type { IAutoMovieScaffoldProps } from "./IAutoMovieScaffoldProps";
2
+ import { assertScaffoldProjectName } from "./assertScaffoldProjectName";
3
+ import { createScaffoldVariables } from "./createScaffoldVariables";
4
+ import { renderScaffoldLayer } from "./renderScaffoldLayer";
5
+
6
+ /**
7
+ * Render one production for a workspace from {@link renderWorkspaceScaffold}, into an in-memory `{ posixPath: content }` map relative to its directory `movies/<shorts|series>/<directory>`.
8
+ *
9
+ * Only the `production` layer is rendered: the instructions and their sync state stay at the workspace root. `{{name}}` is the admitted package name, `{{skills}}` is `../../../.agents/skills`, the workspace root's shared tree three directories up, and every `{{version:<key>}}` is `catalog:<name>` of its `AUTOMOVIE_TEMPLATE_CATALOGS` group, resolved by the root's `pnpm-workspace.yaml`. Nothing is written.
10
+ *
11
+ * @param props The production's package name, admitted by {@link assertScaffoldProjectName}.
12
+ * @returns The rendered file map.
13
+ * @throws When the name is refused, when the layer or the shared-skill directory is missing, or on a token error or path collision.
14
+ *
15
+ * @evidence contracts/development/implementation.md#principled-implementation The fixed depth of `movies/<family>/<directory>` makes the shared skills exactly three directories up, and pnpm resolves `catalog:` through the workspace root's catalog.
16
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The same production layer serves a single production and a workspace production; only the skills path and dependency mode differ.
17
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The workspace root is never searched for or inspected; the caller chooses the target, and the layout is documented instead of detected.
18
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the target directory, what is excluded, every token value, and what throws.
19
+ * @evidence contracts/development/implementation.md#efficient-algorithms One layer render with the reader's and renderer's costs.
20
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the scaffold as installed now and is made once per CLI run.
21
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Reads close before returning, and the returned map is owned by the caller.
22
+ */
23
+ export const renderWorkspaceProductionScaffold: (
24
+ props: IAutoMovieScaffoldProps,
25
+ ) => Record<string, string> = (
26
+ props: IAutoMovieScaffoldProps,
27
+ ): Record<string, string> =>
28
+ renderScaffoldLayer(
29
+ "production",
30
+ createScaffoldVariables({
31
+ name: assertScaffoldProjectName(props.name),
32
+ skills: "../../../.agents/skills",
33
+ dependencies: "catalog",
34
+ }),
35
+ );
@@ -0,0 +1,43 @@
1
+ import type { IAutoMovieScaffoldProps } from "./IAutoMovieScaffoldProps";
2
+ import { assertScaffoldProjectName } from "./assertScaffoldProjectName";
3
+ import { attachScaffoldSyncState } from "./attachScaffoldSyncState";
4
+ import { createScaffoldVariables } from "./createScaffoldVariables";
5
+ import { mergeScaffoldFiles } from "./mergeScaffoldFiles";
6
+ import { renderScaffoldInstructions } from "./renderScaffoldInstructions";
7
+ import { renderScaffoldLayer } from "./renderScaffoldLayer";
8
+
9
+ /**
10
+ * Render a pnpm workspace root that holds several productions, into an in-memory `{ posixPath: content }` map.
11
+ *
12
+ * The map joins the shared instruction surface from {@link renderScaffoldInstructions} with the `workspace` layer: `pnpm-workspace.yaml` listing `movies/shorts/*`, `movies/series/*` and `packages/*` with named `catalogs` of the build-time `AUTOMOVIE_TEMPLATE_VERSIONS` ranges, grouped by `AUTOMOVIE_TEMPLATE_CATALOGS` with one anchor per release group, a root `package.json` named by the admitted name with the `automovie` CLI as a development dependency, its README and `.gitignore`. The generated instruction digests are added for explicit later sync. No production is included; {@link renderWorkspaceProductionScaffold} renders each one. Nothing is written.
13
+ *
14
+ * @param props The workspace's name, admitted by {@link assertScaffoldProjectName}.
15
+ * @returns The rendered file map.
16
+ * @throws When the name is refused, when a layer or the shared-skill directory is missing, on a placeholder refusal, on a token error, or on a path collision within or between layers.
17
+ *
18
+ * @evidence contracts/development/implementation.md#principled-implementation The root catalog is rendered from the same version table that a single production's dependencies use, so a workspace production's `catalog:` specifiers resolve to the ranges this package was built with.
19
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The function chooses the layers and token values; name admission, layer rendering, joining and sync state each have one owner.
20
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The workspace layer is ordinary scaffold content rendered with the shared tokens; nothing is generated by string assembly here.
21
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the joined layers, what the workspace layer contains, the added state, what is excluded, and what throws.
22
+ * @evidence contracts/development/implementation.md#efficient-algorithms Two layer renders, one join pass and one digest per instruction file.
23
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each call reads the scaffold as installed now and is made once per CLI run.
24
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Reads close before returning, and the returned map is owned by the caller.
25
+ */
26
+ export const renderWorkspaceScaffold: (
27
+ props: IAutoMovieScaffoldProps,
28
+ ) => Record<string, string> = (
29
+ props: IAutoMovieScaffoldProps,
30
+ ): Record<string, string> =>
31
+ attachScaffoldSyncState(
32
+ mergeScaffoldFiles(
33
+ renderScaffoldInstructions(),
34
+ renderScaffoldLayer(
35
+ "workspace",
36
+ createScaffoldVariables({
37
+ name: assertScaffoldProjectName(props.name),
38
+ skills: ".agents/skills",
39
+ dependencies: "release",
40
+ }),
41
+ ),
42
+ ),
43
+ );