@hraness/slopcamera 3.2.4

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 (441) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +60 -0
  3. package/PRIVACY.md +46 -0
  4. package/README.md +311 -0
  5. package/SECURITY.md +21 -0
  6. package/apps/desktop/README.md +966 -0
  7. package/apps/desktop/analysis/protocol.ts +223 -0
  8. package/apps/desktop/application/capability-binding.ts +594 -0
  9. package/apps/desktop/application/context.ts +97 -0
  10. package/apps/desktop/application/creative-iteration.ts +1385 -0
  11. package/apps/desktop/application/default-registry.ts +146 -0
  12. package/apps/desktop/application/directing-contract.ts +218 -0
  13. package/apps/desktop/application/directing-plan.ts +178 -0
  14. package/apps/desktop/application/errors.ts +18 -0
  15. package/apps/desktop/application/gateway-port.ts +867 -0
  16. package/apps/desktop/application/html-overlay-browser-runtime.ts +687 -0
  17. package/apps/desktop/application/html-overlay-integrity.ts +337 -0
  18. package/apps/desktop/application/html-overlay-renderer.ts +45 -0
  19. package/apps/desktop/application/index.ts +13 -0
  20. package/apps/desktop/application/operation-completion-checkpoint.ts +333 -0
  21. package/apps/desktop/application/operation-effects.ts +94 -0
  22. package/apps/desktop/application/operation.ts +224 -0
  23. package/apps/desktop/application/operations/analysis/faces.ts +244 -0
  24. package/apps/desktop/application/operations/analysis/music.ts +248 -0
  25. package/apps/desktop/application/operations/analysis/project-auto-zooms.ts +302 -0
  26. package/apps/desktop/application/operations/analysis/project-inactivity.ts +381 -0
  27. package/apps/desktop/application/operations/analysis/scenes.ts +272 -0
  28. package/apps/desktop/application/operations/analysis/shared.ts +202 -0
  29. package/apps/desktop/application/operations/derive/edit-batch.ts +967 -0
  30. package/apps/desktop/application/operations/derive/follow-faces.ts +454 -0
  31. package/apps/desktop/application/operations/edit/bind-candidate-revision.ts +91 -0
  32. package/apps/desktop/application/operations/edit/create-candidate-revision.ts +377 -0
  33. package/apps/desktop/application/operations/edit/create-revision.ts +255 -0
  34. package/apps/desktop/application/operations/edit/freeze-revision.ts +182 -0
  35. package/apps/desktop/application/operations/gateway/image.ts +41 -0
  36. package/apps/desktop/application/operations/gateway/index.ts +17 -0
  37. package/apps/desktop/application/operations/gateway/shared.ts +122 -0
  38. package/apps/desktop/application/operations/gateway/speech.ts +41 -0
  39. package/apps/desktop/application/operations/gateway/transcription.ts +42 -0
  40. package/apps/desktop/application/operations/gateway/video.ts +41 -0
  41. package/apps/desktop/application/operations/index.ts +31 -0
  42. package/apps/desktop/application/operations/iteration/create-candidate.ts +240 -0
  43. package/apps/desktop/application/operations/iteration/create-matrix.ts +117 -0
  44. package/apps/desktop/application/operations/iteration/select.ts +155 -0
  45. package/apps/desktop/application/operations/iteration/shared.ts +250 -0
  46. package/apps/desktop/application/operations/media/audio-effects.ts +376 -0
  47. package/apps/desktop/application/operations/media/binding.ts +79 -0
  48. package/apps/desktop/application/operations/media/capabilities.ts +112 -0
  49. package/apps/desktop/application/operations/media/color-grade.ts +343 -0
  50. package/apps/desktop/application/operations/media/html-overlay.ts +802 -0
  51. package/apps/desktop/application/operations/media/index.ts +8 -0
  52. package/apps/desktop/application/operations/media/ingest.ts +303 -0
  53. package/apps/desktop/application/operations/media/overlay.ts +729 -0
  54. package/apps/desktop/application/operations/media/shared.ts +845 -0
  55. package/apps/desktop/application/operations/media/transform-platform.ts +120 -0
  56. package/apps/desktop/application/operations/project/commit-edits.ts +2054 -0
  57. package/apps/desktop/application/operations/project/promote-selection.ts +495 -0
  58. package/apps/desktop/application/operations/project/snapshot.ts +95 -0
  59. package/apps/desktop/application/operations/recording/index.ts +5 -0
  60. package/apps/desktop/application/operations/recording/pause.ts +34 -0
  61. package/apps/desktop/application/operations/recording/resume.ts +34 -0
  62. package/apps/desktop/application/operations/recording/shared.ts +199 -0
  63. package/apps/desktop/application/operations/recording/start.ts +169 -0
  64. package/apps/desktop/application/operations/recording/stop.ts +34 -0
  65. package/apps/desktop/application/operations/render/bind-candidate-output.ts +324 -0
  66. package/apps/desktop/application/operations/render/materialize-selection.ts +322 -0
  67. package/apps/desktop/application/operations/render/project-caption-plan.ts +287 -0
  68. package/apps/desktop/application/operations/render/project-plan.ts +939 -0
  69. package/apps/desktop/application/operations/render/project-spatial-receipt.ts +70 -0
  70. package/apps/desktop/application/operations/render/project.ts +1922 -0
  71. package/apps/desktop/application/operations/shared.ts +67 -0
  72. package/apps/desktop/application/operations/slopcamera-portable.ts +1188 -0
  73. package/apps/desktop/application/operations/slopcamera-visuals.ts +784 -0
  74. package/apps/desktop/application/operations/spatial-project.ts +209 -0
  75. package/apps/desktop/application/operations/spatial-render.ts +415 -0
  76. package/apps/desktop/application/operations/spatial-scene.ts +97 -0
  77. package/apps/desktop/application/operations/studio.ts +143 -0
  78. package/apps/desktop/application/output-publication-lease.ts +163 -0
  79. package/apps/desktop/application/project-publication-lease.ts +233 -0
  80. package/apps/desktop/application/project-store.ts +196 -0
  81. package/apps/desktop/application/receipts.ts +533 -0
  82. package/apps/desktop/application/registry.ts +182 -0
  83. package/apps/desktop/application/spatial-assets.ts +675 -0
  84. package/apps/desktop/application/spatial-compositor-cadence.ts +23 -0
  85. package/apps/desktop/application/spatial-project-authority.ts +35 -0
  86. package/apps/desktop/application/spatial-project-lease.ts +126 -0
  87. package/apps/desktop/application/spatial-project-render-preparation.ts +225 -0
  88. package/apps/desktop/application/spatial-project-store.ts +286 -0
  89. package/apps/desktop/application/spatial-render-projection.ts +201 -0
  90. package/apps/desktop/application/spatial-render.ts +677 -0
  91. package/apps/desktop/application/spatial-spz.ts +44 -0
  92. package/apps/desktop/application/spatial-world-import.ts +135 -0
  93. package/apps/desktop/application/spatial-world-provenance.ts +46 -0
  94. package/apps/desktop/application/studio-port.ts +58 -0
  95. package/apps/desktop/application/verified-receipt-reconciliation.ts +1574 -0
  96. package/apps/desktop/capture/protocol.ts +689 -0
  97. package/apps/desktop/cli/analyzer.ts +406 -0
  98. package/apps/desktop/cli/args.ts +3181 -0
  99. package/apps/desktop/cli/asset-ingest.ts +747 -0
  100. package/apps/desktop/cli/atomic-render-effects.ts +210 -0
  101. package/apps/desktop/cli/atomic-render-platform.ts +205 -0
  102. package/apps/desktop/cli/atomic-render.ts +50 -0
  103. package/apps/desktop/cli/audio-analysis.ts +252 -0
  104. package/apps/desktop/cli/bounded-map.ts +39 -0
  105. package/apps/desktop/cli/bundle-service.ts +256 -0
  106. package/apps/desktop/cli/capabilities.ts +212 -0
  107. package/apps/desktop/cli/capture-bundle.ts +1117 -0
  108. package/apps/desktop/cli/command-host-resources.ts +251 -0
  109. package/apps/desktop/cli/commands.ts +6836 -0
  110. package/apps/desktop/cli/directing-blob.ts +291 -0
  111. package/apps/desktop/cli/directing-media.ts +517 -0
  112. package/apps/desktop/cli/directing-quote.ts +89 -0
  113. package/apps/desktop/cli/directing-service.ts +288 -0
  114. package/apps/desktop/cli/emoji-assets.ts +538 -0
  115. package/apps/desktop/cli/errors.ts +29 -0
  116. package/apps/desktop/cli/face-analysis-service.ts +940 -0
  117. package/apps/desktop/cli/filter-script.ts +76 -0
  118. package/apps/desktop/cli/gateway-application-port.ts +1142 -0
  119. package/apps/desktop/cli/gateway-credential.ts +81 -0
  120. package/apps/desktop/cli/gateway-media-artifacts.ts +723 -0
  121. package/apps/desktop/cli/gateway-media-catalog.ts +922 -0
  122. package/apps/desktop/cli/gateway-media-service.ts +3106 -0
  123. package/apps/desktop/cli/gateway-media-signature.ts +122 -0
  124. package/apps/desktop/cli/gateway-provider-options.ts +562 -0
  125. package/apps/desktop/cli/gateway-scene-provider.ts +391 -0
  126. package/apps/desktop/cli/help.ts +501 -0
  127. package/apps/desktop/cli/html-overlay-gpu.ts +97 -0
  128. package/apps/desktop/cli/html-overlay-renderer.ts +2478 -0
  129. package/apps/desktop/cli/io.ts +290 -0
  130. package/apps/desktop/cli/main.ts +123 -0
  131. package/apps/desktop/cli/media-effects-service.ts +885 -0
  132. package/apps/desktop/cli/media-ingest-model.ts +364 -0
  133. package/apps/desktop/cli/media-ingest-platform.ts +227 -0
  134. package/apps/desktop/cli/media-ingest-program.ts +200 -0
  135. package/apps/desktop/cli/media-ingest.ts +30 -0
  136. package/apps/desktop/cli/music-analysis-service.ts +434 -0
  137. package/apps/desktop/cli/mutation-lock.ts +530 -0
  138. package/apps/desktop/cli/native-assets.d.ts +12 -0
  139. package/apps/desktop/cli/native-media-runtime.macos.ts +7 -0
  140. package/apps/desktop/cli/overlay-playback.ts +177 -0
  141. package/apps/desktop/cli/paths.ts +265 -0
  142. package/apps/desktop/cli/portable-surface.ts +242 -0
  143. package/apps/desktop/cli/project-camera-receipt.ts +112 -0
  144. package/apps/desktop/cli/project-face-camera.ts +394 -0
  145. package/apps/desktop/cli/project-inactivity-service.ts +552 -0
  146. package/apps/desktop/cli/project-media-integrity.ts +121 -0
  147. package/apps/desktop/cli/project-renderer.ts +1526 -0
  148. package/apps/desktop/cli/project-service.ts +519 -0
  149. package/apps/desktop/cli/project-state-transaction.ts +520 -0
  150. package/apps/desktop/cli/query-limits.ts +1 -0
  151. package/apps/desktop/cli/recording-controller.ts +1567 -0
  152. package/apps/desktop/cli/recording-daemon.ts +931 -0
  153. package/apps/desktop/cli/recording-ref.ts +56 -0
  154. package/apps/desktop/cli/renamed-environment.ts +6 -0
  155. package/apps/desktop/cli/renderer.ts +1439 -0
  156. package/apps/desktop/cli/run-cli-test-helper.ts +60 -0
  157. package/apps/desktop/cli/scene-analysis-service.ts +879 -0
  158. package/apps/desktop/cli/spatial-compositor-verifier.ts +213 -0
  159. package/apps/desktop/cli/spatial-project-service.ts +90 -0
  160. package/apps/desktop/cli/spatial-scene-service.ts +105 -0
  161. package/apps/desktop/cli/spatial-world-service.ts +39 -0
  162. package/apps/desktop/cli/speech-analysis-service.ts +682 -0
  163. package/apps/desktop/cli/studio-assemble.ts +58 -0
  164. package/apps/desktop/cli/studio-command.ts +60 -0
  165. package/apps/desktop/cli/studio-custody.ts +60 -0
  166. package/apps/desktop/cli/studio-encode.ts +216 -0
  167. package/apps/desktop/cli/studio-exr.ts +52 -0
  168. package/apps/desktop/cli/studio-files.ts +179 -0
  169. package/apps/desktop/cli/studio-output-validation.ts +162 -0
  170. package/apps/desktop/cli/studio-process.ts +145 -0
  171. package/apps/desktop/cli/studio-runtime.ts +77 -0
  172. package/apps/desktop/cli/studio-scaffold.ts +70 -0
  173. package/apps/desktop/cli/studio-service.ts +301 -0
  174. package/apps/desktop/cli/studio-spatial-asset.ts +248 -0
  175. package/apps/desktop/cli/studio-template-names.ts +3 -0
  176. package/apps/desktop/cli/studio-workflow.ts +19 -0
  177. package/apps/desktop/cli/time.ts +25 -0
  178. package/apps/desktop/cli/workflow-code.ts +584 -0
  179. package/apps/desktop/cli/workflow-runs.ts +576 -0
  180. package/apps/desktop/code/advanced.ts +139 -0
  181. package/apps/desktop/code/application-node-planner.ts +1288 -0
  182. package/apps/desktop/code/compiler.ts +329 -0
  183. package/apps/desktop/code/contracts.ts +13 -0
  184. package/apps/desktop/code/creative-recipes.ts +94 -0
  185. package/apps/desktop/code/define-workflow.ts +115 -0
  186. package/apps/desktop/code/editing.ts +284 -0
  187. package/apps/desktop/code/file-candidate-provenance.ts +420 -0
  188. package/apps/desktop/code/file-candidate.ts +69 -0
  189. package/apps/desktop/code/graph-builder.ts +10 -0
  190. package/apps/desktop/code/host-resource-policy.ts +55 -0
  191. package/apps/desktop/code/plan-contracts.ts +159 -0
  192. package/apps/desktop/code/planning.ts +361 -0
  193. package/apps/desktop/code/public.ts +134 -0
  194. package/apps/desktop/code/reference-projection.ts +62 -0
  195. package/apps/desktop/code/run-contracts.ts +466 -0
  196. package/apps/desktop/code/run-store.ts +2478 -0
  197. package/apps/desktop/code/runtime-identity.ts +328 -0
  198. package/apps/desktop/code/scheduler.ts +3067 -0
  199. package/apps/desktop/code/semantic-builder.ts +1436 -0
  200. package/apps/desktop/code/source-bundle.ts +1641 -0
  201. package/apps/desktop/code/source-typecheck.ts +211 -0
  202. package/apps/desktop/code/testing.ts +79 -0
  203. package/apps/desktop/code/worker-client.ts +1675 -0
  204. package/apps/desktop/code/worker-effects.ts +141 -0
  205. package/apps/desktop/code/worker-entry.ts +435 -0
  206. package/apps/desktop/code/worker-lease-guardian.ts +179 -0
  207. package/apps/desktop/code/worker-process-identity.ts +484 -0
  208. package/apps/desktop/code/worker-protocol.ts +211 -0
  209. package/apps/desktop/code/workflow-effects.ts +132 -0
  210. package/apps/desktop/contracts/analysis.ts +949 -0
  211. package/apps/desktop/contracts/edit.ts +576 -0
  212. package/apps/desktop/contracts/index.ts +9 -0
  213. package/apps/desktop/contracts/media-effects.ts +139 -0
  214. package/apps/desktop/contracts/project-render.ts +644 -0
  215. package/apps/desktop/contracts/project.ts +740 -0
  216. package/apps/desktop/contracts/recording.ts +1434 -0
  217. package/apps/desktop/contracts/render.ts +334 -0
  218. package/apps/desktop/contracts/runtime.ts +155 -0
  219. package/apps/desktop/contracts/spatial-compositor.ts +58 -0
  220. package/apps/desktop/contracts/spatial-project.ts +159 -0
  221. package/apps/desktop/contracts/spatial-world.ts +48 -0
  222. package/apps/desktop/contracts/video-effects.ts +120 -0
  223. package/apps/desktop/core/alignment-apply.ts +400 -0
  224. package/apps/desktop/core/audio-alignment.ts +466 -0
  225. package/apps/desktop/core/auto-zoom.ts +209 -0
  226. package/apps/desktop/core/canonical-json.ts +14 -0
  227. package/apps/desktop/core/emoji.ts +210 -0
  228. package/apps/desktop/core/events.ts +409 -0
  229. package/apps/desktop/core/face-framing.ts +533 -0
  230. package/apps/desktop/core/face-tracks.ts +326 -0
  231. package/apps/desktop/core/inactivity.ts +137 -0
  232. package/apps/desktop/core/index.ts +30 -0
  233. package/apps/desktop/core/intervals.ts +123 -0
  234. package/apps/desktop/core/montage.ts +236 -0
  235. package/apps/desktop/core/music-analysis.ts +518 -0
  236. package/apps/desktop/core/plan.ts +244 -0
  237. package/apps/desktop/core/project-auto-zoom.ts +75 -0
  238. package/apps/desktop/core/project-camera-spatial.ts +676 -0
  239. package/apps/desktop/core/project-camera.ts +403 -0
  240. package/apps/desktop/core/project-captions.ts +888 -0
  241. package/apps/desktop/core/project-inactivity.ts +125 -0
  242. package/apps/desktop/core/project-metadata.ts +927 -0
  243. package/apps/desktop/core/project-plan.ts +375 -0
  244. package/apps/desktop/core/project-render-plan.ts +303 -0
  245. package/apps/desktop/core/project-time.ts +469 -0
  246. package/apps/desktop/core/render-plan.ts +442 -0
  247. package/apps/desktop/core/scene-cache.ts +174 -0
  248. package/apps/desktop/core/scene-sampling.ts +448 -0
  249. package/apps/desktop/core/spatial-compositor.ts +22 -0
  250. package/apps/desktop/core/spatial-durability.ts +99 -0
  251. package/apps/desktop/core/spatial-project.ts +169 -0
  252. package/apps/desktop/core/spatial-shot-clock.ts +32 -0
  253. package/apps/desktop/core/speech-analysis.ts +333 -0
  254. package/apps/desktop/core/storage.ts +970 -0
  255. package/apps/desktop/core/time-map.ts +91 -0
  256. package/apps/desktop/core/time.ts +61 -0
  257. package/apps/desktop/core/video-effects.ts +660 -0
  258. package/apps/desktop/dist/cli/NebulaSans-Bold-26se8aek.otf +0 -0
  259. package/apps/desktop/dist/cli/NebulaSans-Bold-bcz7y08t.woff2 +0 -0
  260. package/apps/desktop/dist/cli/NebulaSans-Book-5ax05zvn.woff2 +0 -0
  261. package/apps/desktop/dist/cli/NebulaSans-Book-8cenzchw.otf +0 -0
  262. package/apps/desktop/dist/cli/main.js +5086 -0
  263. package/apps/desktop/html-overlay/catalog.ts +171 -0
  264. package/apps/desktop/html-overlay/contracts.ts +372 -0
  265. package/apps/desktop/html-overlay/execution-profile.ts +77 -0
  266. package/apps/desktop/html-overlay/index.ts +98 -0
  267. package/apps/desktop/html-overlay/libraries.ts +263 -0
  268. package/apps/desktop/html-overlay/random.ts +49 -0
  269. package/apps/desktop/html-overlay/runtime.ts +813 -0
  270. package/apps/desktop/html-overlay/scaffolds.ts +792 -0
  271. package/apps/desktop/html-overlay/spark-runtime.ts +88 -0
  272. package/apps/desktop/html-overlay/spatial-splat-runtime.ts +60 -0
  273. package/apps/desktop/html-overlay/spatial.ts +720 -0
  274. package/apps/desktop/studio/assets/README.md +39 -0
  275. package/apps/desktop/studio/assets/contracts.ts +129 -0
  276. package/apps/desktop/studio/assets/network.ts +64 -0
  277. package/apps/desktop/studio/assets/poly-haven.ts +148 -0
  278. package/apps/desktop/studio/drivers/blender_driver.py +466 -0
  279. package/apps/desktop/studio/drivers/cadquery_driver.py +176 -0
  280. package/apps/desktop/studio/education/driver.py +308 -0
  281. package/apps/desktop/studio/education/lesson.py +180 -0
  282. package/apps/desktop/studio/education/toolkit.py +249 -0
  283. package/apps/desktop/workflows/chaptered-demo.ts +48 -0
  284. package/apps/desktop/workflows/creative-iteration.ts +107 -0
  285. package/apps/desktop/workflows/creative-selection.ts +92 -0
  286. package/apps/desktop/workflows/fragments.ts +486 -0
  287. package/apps/desktop/workflows/index.ts +93 -0
  288. package/apps/desktop/workflows/polished-screen-demo.ts +128 -0
  289. package/apps/desktop/workflows/scene-direction.ts +12 -0
  290. package/apps/desktop/workflows/social-variants.ts +75 -0
  291. package/apps/desktop/workflows/talking-head-cleanup.ts +53 -0
  292. package/dist/NebulaSans-Bold-26se8aek.otf +0 -0
  293. package/dist/NebulaSans-Bold-bcz7y08t.woff2 +0 -0
  294. package/dist/NebulaSans-Book-5ax05zvn.woff2 +0 -0
  295. package/dist/NebulaSans-Book-8cenzchw.otf +0 -0
  296. package/dist/cli.js +479 -0
  297. package/dist/code/advanced.js +270 -0
  298. package/dist/code/index.js +2240 -0
  299. package/dist/generate.js +24 -0
  300. package/dist/host-resources.js +26 -0
  301. package/dist/index-42zsesc1.js +2257 -0
  302. package/dist/index-7308egqr.js +48 -0
  303. package/dist/index-8txs6fkn.js +712 -0
  304. package/dist/index-mcy8z0br.js +192 -0
  305. package/dist/index-p63wavx0.js +2029 -0
  306. package/dist/index-r7gdhmsp.js +424 -0
  307. package/dist/index-sh6xbav6.js +1219 -0
  308. package/dist/index-z1w83f81.js +4 -0
  309. package/dist/index-z7239b4h.js +2363 -0
  310. package/dist/index-zfeg9hmw.js +2013 -0
  311. package/dist/index.js +241 -0
  312. package/dist/operations.js +29 -0
  313. package/dist/skill-install-dh0ntqba.js +10 -0
  314. package/dist/vectorize/worker.js +142 -0
  315. package/dist/workflow.js +16 -0
  316. package/docs/README.md +38 -0
  317. package/docs/studio.md +215 -0
  318. package/examples/studio/blender/README.md +26 -0
  319. package/examples/studio/blender/character.py +152 -0
  320. package/examples/studio/blender/cloth.py +101 -0
  321. package/examples/studio/blender/color_chart.py +29 -0
  322. package/examples/studio/blender/fluid.py +78 -0
  323. package/examples/studio/blender/import_model.py +74 -0
  324. package/examples/studio/blender/product.py +53 -0
  325. package/examples/studio/blender/shaded_street.py +481 -0
  326. package/examples/studio/blender/studio_scene.py +147 -0
  327. package/examples/studio/cadquery/README.md +13 -0
  328. package/examples/studio/cadquery/bracket.py +36 -0
  329. package/examples/studio/cadquery/import_step.py +12 -0
  330. package/examples/studio/education/README.md +46 -0
  331. package/examples/studio/education/lesson.json +99 -0
  332. package/examples/studio/education/scene.py +7 -0
  333. package/examples/studio/hybrid-scene.ts +96 -0
  334. package/examples/studio/native-workflow.ts +14 -0
  335. package/examples/studio/vgpu/README.md +64 -0
  336. package/examples/studio/vgpu/heat-field.mjs +290 -0
  337. package/package.json +304 -0
  338. package/packages/scene/src/index.ts +1 -0
  339. package/packages/scene/src/scene.ts +215 -0
  340. package/schema/diagram.schema.json +334 -0
  341. package/skills/slopcamera/SKILL.md +45 -0
  342. package/skills/slopcamera/agents/openai.yaml +4 -0
  343. package/skills/slopcamera/references/customization.md +77 -0
  344. package/skills/slopcamera/references/diagrams.md +153 -0
  345. package/skills/slopcamera/references/directed-scenes.md +42 -0
  346. package/skills/slopcamera/references/directing-video.md +18 -0
  347. package/skills/slopcamera/references/educational-video.md +26 -0
  348. package/skills/slopcamera/references/gateway-media.md +134 -0
  349. package/skills/slopcamera/references/install.md +62 -0
  350. package/skills/slopcamera/references/native-studio.md +31 -0
  351. package/skills/slopcamera/references/reference-led-3d.md +140 -0
  352. package/skills/slopcamera/references/rubber-stamp-examples/poster-example-1.jpg +0 -0
  353. package/skills/slopcamera/references/rubber-stamp-examples/poster-example-2.jpg +0 -0
  354. package/skills/slopcamera/references/rubber-stamp-examples/stamp-style-1.png +0 -0
  355. package/skills/slopcamera/references/rubber-stamp-examples/stamp-style-2.png +0 -0
  356. package/skills/slopcamera/references/rubber-stamp-field-notes.md +144 -0
  357. package/skills/slopcamera/references/vectorization.md +29 -0
  358. package/skills/slopcamera/references/video-projects.md +187 -0
  359. package/skills/slopcamera/references/visual-communication.md +120 -0
  360. package/skills/slopcamera/references/workflows-sdk.md +45 -0
  361. package/skills/slopcamera/scripts/compose-rubber-stamp-field-note.ts +229 -0
  362. package/src/artifacts.ts +106 -0
  363. package/src/assets/fonts/nebula-sans/LICENSE.txt +96 -0
  364. package/src/assets/fonts/nebula-sans/NebulaSans-Bold.otf +0 -0
  365. package/src/assets/fonts/nebula-sans/NebulaSans-Bold.woff2 +0 -0
  366. package/src/assets/fonts/nebula-sans/NebulaSans-Book.otf +0 -0
  367. package/src/assets/fonts/nebula-sans/NebulaSans-Book.woff2 +0 -0
  368. package/src/assets/fonts/nebula-sans/PROVENANCE.md +21 -0
  369. package/src/assets.d.ts +9 -0
  370. package/src/cli.ts +601 -0
  371. package/src/cloud-errors.ts +26 -0
  372. package/src/code/advanced.ts +10 -0
  373. package/src/code/boundary.ts +21 -0
  374. package/src/code/canonical-json.ts +129 -0
  375. package/src/code/compiler.ts +953 -0
  376. package/src/code/contracts.ts +576 -0
  377. package/src/code/define-workflow.ts +334 -0
  378. package/src/code/errors.ts +41 -0
  379. package/src/code/graph-builder.ts +945 -0
  380. package/src/code/index.ts +121 -0
  381. package/src/code/json-snapshot.ts +899 -0
  382. package/src/code/json-utf8.ts +88 -0
  383. package/src/code/portable-builder.ts +136 -0
  384. package/src/code/projection.ts +378 -0
  385. package/src/code/public-operations.ts +450 -0
  386. package/src/code/runtime.ts +580 -0
  387. package/src/code/sha256.ts +36 -0
  388. package/src/config.ts +180 -0
  389. package/src/desktop.ts +253 -0
  390. package/src/fs.ts +10 -0
  391. package/src/generate.ts +704 -0
  392. package/src/host-resource-posix.ts +161 -0
  393. package/src/host-resources.ts +1749 -0
  394. package/src/icons.ts +58 -0
  395. package/src/index.ts +200 -0
  396. package/src/label-layout.ts +130 -0
  397. package/src/layout.ts +413 -0
  398. package/src/lint.ts +127 -0
  399. package/src/mcp/boundary.ts +354 -0
  400. package/src/mcp/index.ts +33 -0
  401. package/src/mcp/server.ts +272 -0
  402. package/src/mcp/tools.ts +963 -0
  403. package/src/mcp/types.ts +71 -0
  404. package/src/operations.ts +775 -0
  405. package/src/parse.ts +861 -0
  406. package/src/process-environment.ts +17 -0
  407. package/src/render.ts +437 -0
  408. package/src/skill-install.ts +49 -0
  409. package/src/spatial-scene/authoring.ts +27 -0
  410. package/src/spatial-scene/camera-track.ts +83 -0
  411. package/src/spatial-scene/contracts.ts +277 -0
  412. package/src/spatial-scene/evaluate.ts +145 -0
  413. package/src/spatial-scene/gltf.ts +558 -0
  414. package/src/spatial-scene/identity.ts +260 -0
  415. package/src/spatial-scene/index.ts +10 -0
  416. package/src/spatial-scene/inspect.ts +68 -0
  417. package/src/spatial-scene/math.ts +280 -0
  418. package/src/spatial-scene/patch.ts +131 -0
  419. package/src/spatial-scene/time.ts +53 -0
  420. package/src/studio/contracts.ts +129 -0
  421. package/src/studio/index.ts +2 -0
  422. package/src/studio/plan.ts +156 -0
  423. package/src/studio/shared.ts +41 -0
  424. package/src/theme.ts +68 -0
  425. package/src/tldr.ts +474 -0
  426. package/src/types.ts +212 -0
  427. package/src/vectorize/archive.ts +101 -0
  428. package/src/vectorize/command.ts +797 -0
  429. package/src/vectorize/index.ts +27 -0
  430. package/src/vectorize/limits.ts +61 -0
  431. package/src/vectorize/metrics.ts +351 -0
  432. package/src/vectorize/pixels.ts +323 -0
  433. package/src/vectorize/supervisor.ts +339 -0
  434. package/src/vectorize/svg.ts +188 -0
  435. package/src/vectorize/tool.ts +542 -0
  436. package/src/vectorize/types.ts +113 -0
  437. package/src/vectorize/vectorize.ts +634 -0
  438. package/src/vectorize/worker-protocol.ts +40 -0
  439. package/src/vectorize/worker.ts +209 -0
  440. package/src/version.ts +1 -0
  441. package/src/workflow.ts +409 -0
@@ -0,0 +1,1436 @@
1
+ import type { StudioRunInput, StudioRunOutput } from "../application/studio-port";
2
+ import type {
3
+ SpatialRenderInput,
4
+ CandidateProjectRenderInput,
5
+ SpatialInspectInput, SpatialInspectOutput, SpatialPatchInput, SpatialPatchOutput,
6
+ SpatialEvaluateInput, SpatialEvaluateOutput,
7
+ BindCandidateRevisionOutput,
8
+ CommitProjectEditsOutput,
9
+ CreateCandidateRevisionOutput,
10
+ CreateCreativeCandidateOutput,
11
+ CreateVariantMatrixOutput,
12
+ CreateProjectEditRevisionOutput,
13
+ FacesOperationInput,
14
+ FacesOperationOutput,
15
+ FaceFollowRevisionDraft,
16
+ FollowFacesInput,
17
+ FreezeProjectEditRevisionOutput,
18
+ HtmlOverlayInputRequest,
19
+ HtmlOverlayOutput,
20
+ MediaAudioEffectsInput,
21
+ MediaAudioEffectsOutput,
22
+ MediaColorGradeInput,
23
+ MediaColorGradeOutput,
24
+ MediaIngestInput,
25
+ MediaIngestOutput,
26
+ MediaOverlayInputRequest,
27
+ MediaOverlayOutput,
28
+ MaterializeVariantSelectionOutput,
29
+ MusicOperationInput,
30
+ MusicOperationOutput,
31
+ ManualProjectCameraMoveInputV2,
32
+ ManualProjectZoomInputV3,
33
+ OrderedProjectEdit,
34
+ OrderedProjectEditV2,
35
+ OrderedProjectEditV3,
36
+ ProjectEditBatch,
37
+ ProjectEditBatchV2,
38
+ ProjectEditBatchV3,
39
+ ProjectInactivityOperationInput,
40
+ ProjectInactivityOperationOutput,
41
+ ProjectAutoZoomInput,
42
+ ProjectAutoZoomOutput,
43
+ ProjectRenderInput,
44
+ ProjectRenderInputV2,
45
+ ProjectRenderInputV4,
46
+ ProjectRenderOutputV4,
47
+ ProjectRenderOutput,
48
+ ProjectRenderPlanInput,
49
+ ProjectRenderPlanInputV2,
50
+ ProjectRenderPlanOutput,
51
+ ProjectSnapshotOutput,
52
+ PromoteVariantSelectionOutput,
53
+ RecordingPauseOutput,
54
+ RecordingResumeOutput,
55
+ RecordingStartInput,
56
+ RecordingStartOutput,
57
+ RecordingStopOutput,
58
+ SceneAnalysisOperationInput,
59
+ SceneAnalysisOperationOutput,
60
+ SelectVariantInput,
61
+ SelectVariantOutput,
62
+ } from "../application/operations";
63
+ import type { SpatialRenderResult } from "../application/spatial-render";
64
+ import type {
65
+ SpatialProjectSnapshotInput, SpatialProjectSnapshotOutput, SpatialProjectMigrateInput,
66
+ SpatialProjectPatchInput, SpatialProjectRestoreInput, SpatialProjectAddShotInput, SpatialProjectAddCandidateInput,
67
+ SpatialProjectSelectCandidateInput, SpatialProjectReconcileInput, SpatialProjectMutationOutput,
68
+ } from "../application/operations/spatial-project";
69
+ /** Only completed publications are made available to graph dependents. */
70
+ export type CompletedSpatialProjectMutation = Extract<SpatialProjectMutationOutput, { kind: "completed" }>;
71
+ import type {
72
+ CandidateProjectEditBatchV3,
73
+ } from "../application/creative-iteration";
74
+ import type { ProjectEditRevisionRenderInput } from "../application";
75
+ import type {
76
+ GatewayImageOperationInput,
77
+ GatewayImageOperationResult,
78
+ GatewaySpeechOperationInput,
79
+ GatewaySpeechOperationResult,
80
+ GatewayTranscriptionOperationInput,
81
+ GatewayTranscriptionOperationResult,
82
+ GatewayVideoOperationInput,
83
+ GatewayVideoOperationResult,
84
+ } from "../application/gateway-port";
85
+ import type {
86
+ OverlayOperation,
87
+ ProjectRenderSyncPolicy,
88
+ ProjectRenderTarget,
89
+ ProjectZoomOperation,
90
+ SourceInterval,
91
+ } from "../contracts";
92
+ import { canonicalJsonSha256 } from "../core/canonical-json";
93
+ import type {
94
+ AnyTrustedComputeDefinition,
95
+ OperationContract,
96
+ OperationInputValue,
97
+ Ref,
98
+ TrustedComputeDefinition,
99
+ WorkflowIdentity,
100
+ WorkflowOutputValue,
101
+ } from "./contracts";
102
+ import {
103
+ WorkflowGraphBuilder,
104
+ type OperationDiscoverySource,
105
+ type OperationNodeOptions,
106
+ type UntypedOperationRequest,
107
+ } from "./graph-builder";
108
+ import {
109
+ addManualCameraMoves as addManualCameraMovesEdit,
110
+ addManualZooms as addManualZoomsEdit,
111
+ removeCameraMoves as removeCameraMovesEdit,
112
+ removeZooms as removeZoomsEdit,
113
+ setMetadataEffects as setMetadataEffectsEdit,
114
+ type ManualZoomInput,
115
+ type MetadataEffectsOptions,
116
+ } from "./editing";
117
+
118
+ export interface WorkflowFragment<Input, Output> {
119
+ readonly build: (builder: WorkflowBuilder, input: Input) => Output;
120
+ }
121
+
122
+ export function defineWorkflowFragment<Input, Output>(
123
+ build: (builder: WorkflowBuilder, input: Input) => Output,
124
+ ): WorkflowFragment<Input, Output> {
125
+ return Object.freeze({ build });
126
+ }
127
+
128
+ export interface ProjectSnapshotHandle {
129
+ readonly editBasis:
130
+ | ProjectSnapshotOutput["editBasis"]
131
+ | Ref<ProjectSnapshotOutput["editBasis"]>;
132
+ readonly generationSha256: string | Ref<string>;
133
+ readonly projectId: string | Ref<string>;
134
+ readonly snapshot: ProjectSnapshotOutput | Ref<ProjectSnapshotOutput>;
135
+ }
136
+
137
+ export interface ProducedProjectSnapshotHandle extends ProjectSnapshotHandle {
138
+ readonly editBasis: Ref<ProjectSnapshotOutput["editBasis"]>;
139
+ readonly generationSha256: Ref<string>;
140
+ readonly projectId: Ref<string>;
141
+ readonly snapshot: Ref<ProjectSnapshotOutput>;
142
+ }
143
+
144
+ export interface CommittedProjectHandle {
145
+ readonly editBasis: Ref<CommitProjectEditsOutput["editBasis"]>;
146
+ readonly generationSha256: Ref<string>;
147
+ readonly projectId: Ref<string>;
148
+ readonly receipt: Ref<CommitProjectEditsOutput>;
149
+ }
150
+
151
+ export type ProjectHandle = CommittedProjectHandle | ProjectSnapshotHandle;
152
+
153
+ export interface ProjectEditRevisionHandle {
154
+ readonly projectId: Ref<string>;
155
+ readonly revision: Ref<ProjectEditRevisionRenderInput>;
156
+ }
157
+
158
+ export type CreativeCandidateBatch =
159
+ | CandidateProjectEditBatchV3
160
+ | Ref<CandidateProjectEditBatchV3>;
161
+
162
+ export interface CreativeCandidateRevisionHandle {
163
+ readonly batch: CreativeCandidateBatch;
164
+ readonly project: ProjectSnapshotHandle;
165
+ readonly projectId: Ref<string>;
166
+ readonly reference: Ref<CreateCandidateRevisionOutput>;
167
+ readonly variantKey: string;
168
+ }
169
+
170
+ export interface BoundCreativeCandidateRevisionHandle
171
+ extends ProjectEditRevisionHandle {
172
+ readonly candidateRevision: CreativeCandidateRevisionHandle;
173
+ }
174
+
175
+ export interface CandidateRenderBindingHandle {
176
+ readonly input: Ref<CandidateProjectRenderInput>;
177
+ }
178
+
179
+ export interface CreativeCandidateHandle {
180
+ readonly projectId: string | Ref<string>;
181
+ readonly reference:
182
+ | CreateCreativeCandidateOutput
183
+ | Ref<CreateCreativeCandidateOutput>;
184
+ }
185
+
186
+ export interface ProducedCreativeCandidateHandle extends CreativeCandidateHandle {
187
+ readonly projectId: Ref<string>;
188
+ readonly reference: Ref<CreateCreativeCandidateOutput>;
189
+ }
190
+
191
+ export interface VariantMatrixHandle {
192
+ readonly projectId: string | Ref<string>;
193
+ readonly reference: CreateVariantMatrixOutput | Ref<CreateVariantMatrixOutput>;
194
+ }
195
+
196
+ export interface ProducedVariantMatrixHandle extends VariantMatrixHandle {
197
+ readonly projectId: Ref<string>;
198
+ readonly reference: Ref<CreateVariantMatrixOutput>;
199
+ }
200
+
201
+ export interface VariantSelectionHandle {
202
+ readonly projectId: string | Ref<string>;
203
+ readonly reference: SelectVariantOutput | Ref<SelectVariantOutput>;
204
+ }
205
+
206
+ export interface ProducedVariantSelectionHandle extends VariantSelectionHandle {
207
+ readonly projectId: Ref<string>;
208
+ readonly reference: Ref<SelectVariantOutput>;
209
+ }
210
+
211
+ export interface MaterializedVariantSelectionHandle {
212
+ readonly output: Ref<MaterializeVariantSelectionOutput["output"]>;
213
+ readonly receipt: Ref<MaterializeVariantSelectionOutput["receipt"]>;
214
+ readonly result: Ref<MaterializeVariantSelectionOutput>;
215
+ }
216
+
217
+ export interface PreparedOverlayHandle {
218
+ readonly artifact: Ref<MediaOverlayOutput["artifact"]>;
219
+ readonly operation: Ref<MediaOverlayOutput["operation"]>;
220
+ readonly output: Ref<MediaOverlayOutput>;
221
+ readonly receipt: Ref<MediaOverlayOutput["receipt"]>;
222
+ }
223
+
224
+ export interface FaceFollowRevisionDraftVariants {
225
+ readonly landscape: Ref<FaceFollowRevisionDraft>;
226
+ readonly portrait: Ref<FaceFollowRevisionDraft>;
227
+ readonly square: Ref<FaceFollowRevisionDraft>;
228
+ }
229
+
230
+ export interface ProjectEditRevisionVariants {
231
+ readonly landscape: ProjectEditRevisionHandle;
232
+ readonly portrait: ProjectEditRevisionHandle;
233
+ readonly square: ProjectEditRevisionHandle;
234
+ }
235
+
236
+ export interface EditBatchOptions {
237
+ readonly cutRanges?: Ref<readonly SourceInterval[]> | readonly SourceInterval[];
238
+ readonly ordered?: readonly OperationInputValue<OrderedProjectEdit>[];
239
+ }
240
+
241
+ export interface CompleteEditBatchOptions {
242
+ readonly cutRanges?: Ref<readonly SourceInterval[]> | readonly SourceInterval[];
243
+ readonly ordered?: readonly OperationInputValue<OrderedProjectEditV3>[];
244
+ }
245
+
246
+ interface CompleteEditBatchV2Options {
247
+ readonly cutRanges?: Ref<readonly SourceInterval[]> | readonly SourceInterval[];
248
+ readonly ordered?: readonly OperationInputValue<OrderedProjectEditV2>[];
249
+ }
250
+
251
+ type OverlayId = OverlayOperation["overlayId"];
252
+
253
+ type DistributedOperationInputValue<Value> =
254
+ Value extends unknown ? OperationInputValue<Value> : never;
255
+
256
+ type RefFriendlyFields<Value extends object> = {
257
+ readonly [Key in keyof Value]: DistributedOperationInputValue<Value[Key]>;
258
+ };
259
+
260
+ type RefFriendlyObjectUnion<Value> =
261
+ Value extends object
262
+ ? Value | Ref<Value> | RefFriendlyFields<Value>
263
+ : never;
264
+
265
+ export type MediaIngestOptions =
266
+ & Omit<RefFriendlyFields<MediaIngestInput>, "project">
267
+ & {
268
+ readonly project:
269
+ | OperationInputValue<MediaIngestInput["project"]>
270
+ | ProjectHandle;
271
+ };
272
+
273
+ export type MediaHtmlOverlayOptions =
274
+ & Omit<RefFriendlyFields<HtmlOverlayInputRequest>, "project">
275
+ & {
276
+ readonly project:
277
+ | OperationInputValue<HtmlOverlayInputRequest["project"]>
278
+ | ProjectHandle;
279
+ };
280
+
281
+ export type MediaOverlayOptions =
282
+ & Omit<RefFriendlyFields<MediaOverlayInputRequest>, "project" | "source">
283
+ & {
284
+ readonly project:
285
+ | OperationInputValue<MediaOverlayInputRequest["project"]>
286
+ | ProjectHandle;
287
+ readonly source: RefFriendlyObjectUnion<
288
+ MediaOverlayInputRequest["source"]
289
+ >;
290
+ };
291
+
292
+ export type GatewayImageOptions =
293
+ OperationInputValue<GatewayImageOperationInput>;
294
+ export type GatewaySpeechOptions =
295
+ OperationInputValue<GatewaySpeechOperationInput>;
296
+ export type GatewayTranscriptionOptions =
297
+ OperationInputValue<GatewayTranscriptionOperationInput>;
298
+ export type GatewayVideoOptions =
299
+ OperationInputValue<GatewayVideoOperationInput>;
300
+ export type MediaAudioEffectsOptions =
301
+ OperationInputValue<MediaAudioEffectsInput>;
302
+ export type MediaColorGradeOptions =
303
+ OperationInputValue<MediaColorGradeInput>;
304
+ export type RecordingStartOptions =
305
+ OperationInputValue<RecordingStartInput>;
306
+
307
+ export type FaceFollowOptions = {
308
+ readonly [Key in keyof Omit<FollowFacesInput, "project">]:
309
+ OperationInputValue<Omit<FollowFacesInput, "project">[Key]>;
310
+ };
311
+
312
+ export type FaceFollowVariantOptions = {
313
+ readonly [Key in keyof Omit<FollowFacesInput, "aspect" | "project">]:
314
+ OperationInputValue<Omit<FollowFacesInput, "aspect" | "project">[Key]>;
315
+ };
316
+
317
+ export interface CreateCreativeCandidateRevisionOptions {
318
+ readonly batch: CreativeCandidateBatch;
319
+ readonly project: ProjectSnapshotHandle;
320
+ readonly variantKey: string;
321
+ }
322
+
323
+ export interface BindCreativeCandidateRevisionOptions {
324
+ readonly pixelHeight: number;
325
+ readonly pixelWidth: number;
326
+ readonly revision: CreativeCandidateRevisionHandle;
327
+ }
328
+
329
+ export interface BindCreativeCandidateRenderOptions {
330
+ readonly maximumBytes: number;
331
+ readonly plan: Ref<ProjectRenderPlanOutput>;
332
+ readonly revision: BoundCreativeCandidateRevisionHandle;
333
+ readonly syncPolicy: ProjectRenderSyncPolicy;
334
+ readonly target: ProjectRenderTarget;
335
+ }
336
+
337
+ export interface CreativeCandidateRenderHandle {
338
+ readonly name: string;
339
+ readonly render: Ref<ProjectRenderOutput>;
340
+ }
341
+
342
+ export interface CreateCreativeCandidateOptions {
343
+ readonly renders?: readonly CreativeCandidateRenderHandle[];
344
+ readonly revision: CreativeCandidateRevisionHandle;
345
+ }
346
+
347
+ export interface SelectCreativeVariantOptions {
348
+ readonly evidence?: NonNullable<SelectVariantInput["evidence"]>;
349
+ readonly matrix: VariantMatrixHandle;
350
+ readonly variantKey: string;
351
+ }
352
+
353
+ export interface MaterializeCreativeSelectionOptions {
354
+ readonly deliveryKey?: string;
355
+ readonly destinationPath?: string;
356
+ readonly renderName: string;
357
+ readonly selection: VariantSelectionHandle;
358
+ }
359
+
360
+ function snapshotHandle(
361
+ snapshot: Ref<ProjectSnapshotOutput>,
362
+ ): ProducedProjectSnapshotHandle {
363
+ return Object.freeze({
364
+ editBasis: snapshot.select("editBasis"),
365
+ generationSha256: snapshot.select("generation").select("generationSha256"),
366
+ projectId: snapshot.select("project").select("projectId"),
367
+ snapshot,
368
+ });
369
+ }
370
+
371
+ /**
372
+ * Workflow inputs are parsed before their build callback runs. Persisted
373
+ * handle adapters therefore remain typed projections instead of importing
374
+ * host-owned operation schemas into the portable graph-authoring runtime.
375
+ */
376
+ function persistedSnapshotHandle(
377
+ snapshot: ProjectSnapshotOutput,
378
+ ): ProjectSnapshotHandle {
379
+ return Object.freeze({
380
+ editBasis: snapshot.editBasis,
381
+ generationSha256: snapshot.generation.generationSha256,
382
+ projectId: snapshot.project.projectId,
383
+ snapshot,
384
+ });
385
+ }
386
+
387
+ function committedHandle(receipt: Ref<CommitProjectEditsOutput>): CommittedProjectHandle {
388
+ return Object.freeze({
389
+ editBasis: receipt.select("editBasis"),
390
+ generationSha256: receipt.select("generation").select("generationSha256"),
391
+ projectId: receipt.select("projectId"),
392
+ receipt,
393
+ });
394
+ }
395
+
396
+ function preparedOverlayHandle(
397
+ output: Ref<MediaOverlayOutput>,
398
+ ): PreparedOverlayHandle {
399
+ return Object.freeze({
400
+ artifact: output.select("artifact"),
401
+ operation: output.select("operation"),
402
+ output,
403
+ receipt: output.select("receipt"),
404
+ });
405
+ }
406
+
407
+ function revisionHandle(
408
+ revision: Ref<
409
+ CreateProjectEditRevisionOutput | FreezeProjectEditRevisionOutput
410
+ >,
411
+ ): ProjectEditRevisionHandle {
412
+ return Object.freeze({
413
+ projectId: revision.select("projectId"),
414
+ revision,
415
+ });
416
+ }
417
+
418
+ function creativeCandidateRevisionHandle(
419
+ reference: Ref<CreateCandidateRevisionOutput>,
420
+ input: {
421
+ readonly batch: CreativeCandidateBatch;
422
+ readonly project: ProjectSnapshotHandle;
423
+ readonly variantKey: string;
424
+ },
425
+ ): CreativeCandidateRevisionHandle {
426
+ return Object.freeze({
427
+ batch: input.batch,
428
+ project: input.project,
429
+ projectId: reference.select("projectId"),
430
+ reference,
431
+ variantKey: input.variantKey,
432
+ });
433
+ }
434
+
435
+ function boundCreativeCandidateRevisionHandle(
436
+ output: Ref<BindCandidateRevisionOutput>,
437
+ candidateRevision: CreativeCandidateRevisionHandle,
438
+ ): BoundCreativeCandidateRevisionHandle {
439
+ return Object.freeze({
440
+ candidateRevision,
441
+ projectId: output.select("revision").select("projectId"),
442
+ revision: output.select("revision"),
443
+ });
444
+ }
445
+
446
+ function candidateRenderBindingHandle(
447
+ input: Ref<CandidateProjectRenderInput>,
448
+ ): CandidateRenderBindingHandle {
449
+ return Object.freeze({ input });
450
+ }
451
+
452
+ function creativeCandidateHandle(
453
+ reference: Ref<CreateCreativeCandidateOutput>,
454
+ ): ProducedCreativeCandidateHandle {
455
+ return Object.freeze({
456
+ projectId: reference.select("base").select("projectId"),
457
+ reference,
458
+ });
459
+ }
460
+
461
+ function persistedCreativeCandidateHandle(
462
+ reference: CreateCreativeCandidateOutput,
463
+ ): CreativeCandidateHandle {
464
+ return Object.freeze({
465
+ projectId: reference.base.projectId,
466
+ reference,
467
+ });
468
+ }
469
+
470
+ function variantMatrixHandle(
471
+ reference: Ref<CreateVariantMatrixOutput>,
472
+ ): ProducedVariantMatrixHandle {
473
+ return Object.freeze({
474
+ projectId: reference.select("base").select("projectId"),
475
+ reference,
476
+ });
477
+ }
478
+
479
+ function persistedVariantMatrixHandle(
480
+ reference: CreateVariantMatrixOutput,
481
+ ): VariantMatrixHandle {
482
+ return Object.freeze({
483
+ projectId: reference.base.projectId,
484
+ reference,
485
+ });
486
+ }
487
+
488
+ function variantSelectionHandle(
489
+ reference: Ref<SelectVariantOutput>,
490
+ ): ProducedVariantSelectionHandle {
491
+ return Object.freeze({
492
+ projectId: reference.select("base").select("projectId"),
493
+ reference,
494
+ });
495
+ }
496
+
497
+ function persistedVariantSelectionHandle(
498
+ reference: SelectVariantOutput,
499
+ ): VariantSelectionHandle {
500
+ return Object.freeze({
501
+ projectId: reference.base.projectId,
502
+ reference,
503
+ });
504
+ }
505
+
506
+ function materializedVariantSelectionHandle(
507
+ result: Ref<MaterializeVariantSelectionOutput>,
508
+ ): MaterializedVariantSelectionHandle {
509
+ return Object.freeze({
510
+ output: result.select("output"),
511
+ receipt: result.select("receipt"),
512
+ result,
513
+ });
514
+ }
515
+
516
+ function mediaIngestProject(
517
+ project: MediaIngestOptions["project"],
518
+ ): OperationInputValue<MediaIngestInput["project"]> {
519
+ if (
520
+ typeof project === "object"
521
+ && project !== null
522
+ && "projectId" in project
523
+ ) {
524
+ return project.projectId;
525
+ }
526
+ return project;
527
+ }
528
+
529
+ function mediaOverlayProject(
530
+ project: MediaOverlayOptions["project"],
531
+ ): OperationInputValue<MediaOverlayInputRequest["project"]> {
532
+ if (
533
+ typeof project === "object"
534
+ && project !== null
535
+ && "projectId" in project
536
+ ) {
537
+ return project.projectId;
538
+ }
539
+ return project;
540
+ }
541
+
542
+ function mediaHtmlOverlayProject(
543
+ project: MediaHtmlOverlayOptions["project"],
544
+ ): OperationInputValue<HtmlOverlayInputRequest["project"]> {
545
+ if (
546
+ typeof project === "object"
547
+ && project !== null
548
+ && "projectId" in project
549
+ ) {
550
+ return project.projectId;
551
+ }
552
+ return project;
553
+ }
554
+
555
+ function overlayOperationInput(
556
+ overlay: OperationInputValue<OverlayOperation> | PreparedOverlayHandle,
557
+ ): OperationInputValue<OverlayOperation> {
558
+ return (
559
+ typeof overlay === "object"
560
+ && overlay !== null
561
+ && "operation" in overlay
562
+ && "output" in overlay
563
+ )
564
+ ? overlay.operation
565
+ : overlay;
566
+ }
567
+
568
+ export class WorkflowBuilder {
569
+ readonly #graph: WorkflowGraphBuilder;
570
+
571
+ /**
572
+ * Exact historical authoring contracts for immutable built-ins and graph
573
+ * migrations. Ordinary workflow code should use the stable semantic
574
+ * namespaces below, which advance to the newest resource-bounded vocabulary.
575
+ */
576
+ readonly advanced = Object.freeze({
577
+ edits: Object.freeze({
578
+ completeBatchV2: (
579
+ key: string,
580
+ input: CompleteEditBatchV2Options,
581
+ options?: OperationNodeOptions,
582
+ ): Ref<ProjectEditBatchV2> => this.#graph.operationByKind(key, {
583
+ input,
584
+ kind: "derive.edit-batch",
585
+ version: 2,
586
+ }, options),
587
+ }),
588
+ project: Object.freeze({
589
+ commitCompleteEditsV2: (
590
+ key: string,
591
+ input: {
592
+ readonly batch: Ref<ProjectEditBatchV2>;
593
+ readonly project: ProjectHandle;
594
+ },
595
+ options?: OperationNodeOptions,
596
+ ): CommittedProjectHandle => committedHandle(
597
+ this.#graph.operationByKind(key, {
598
+ input: {
599
+ batch: input.batch,
600
+ basis: input.project.editBasis,
601
+ project: input.project.projectId,
602
+ },
603
+ kind: "project.commit-edits",
604
+ version: 2,
605
+ }, options),
606
+ ),
607
+ }),
608
+ });
609
+
610
+ readonly analysis = Object.freeze({
611
+ projectAutoZooms: (
612
+ key: string,
613
+ input: Omit<ProjectAutoZoomInput, "binding" | "project"> & {
614
+ readonly project: ProjectHandle;
615
+ },
616
+ options?: OperationNodeOptions,
617
+ ): Ref<ProjectAutoZoomOutput> => this.#graph.operationByKind(key, {
618
+ input: { ...input, project: input.project.projectId },
619
+ kind: "analysis.project-auto-zooms",
620
+ version: 1,
621
+ }, options),
622
+ faces: (
623
+ key: string,
624
+ input: Omit<FacesOperationInput, "project"> & { readonly project: ProjectHandle },
625
+ options?: OperationNodeOptions,
626
+ ): Ref<FacesOperationOutput> => this.#graph.operationByKind(key, {
627
+ input: { ...input, project: input.project.projectId },
628
+ kind: "analysis.faces",
629
+ version: 1,
630
+ }, options),
631
+ inactivity: (
632
+ key: string,
633
+ input: Omit<ProjectInactivityOperationInput, "project"> & {
634
+ readonly project: ProjectHandle;
635
+ },
636
+ options?: OperationNodeOptions,
637
+ ): Ref<ProjectInactivityOperationOutput> => this.#graph.operationByKind(key, {
638
+ input: { ...input, project: input.project.projectId },
639
+ kind: "analysis.project-inactivity",
640
+ version: 1,
641
+ }, options),
642
+ music: (
643
+ key: string,
644
+ input: Omit<MusicOperationInput, "project"> & { readonly project: ProjectHandle },
645
+ options?: OperationNodeOptions,
646
+ ): Ref<MusicOperationOutput> => this.#graph.operationByKind(key, {
647
+ input: { ...input, project: input.project.projectId },
648
+ kind: "analysis.music",
649
+ version: 1,
650
+ }, options),
651
+ scenes: (
652
+ key: string,
653
+ input: Omit<SceneAnalysisOperationInput, "project"> & {
654
+ readonly project: ProjectHandle;
655
+ },
656
+ options?: OperationNodeOptions,
657
+ ): Ref<SceneAnalysisOperationOutput> => this.#graph.operationByKind(key, {
658
+ input: { ...input, project: input.project.projectId },
659
+ kind: "analysis.scenes",
660
+ version: 1,
661
+ }, options),
662
+ });
663
+
664
+ readonly edits = Object.freeze({
665
+ /**
666
+ * Join independently prepared overlays into one immutable batch. Overlay
667
+ * preparation nodes stay parallel; this node is their explicit join.
668
+ */
669
+ addOverlays: (
670
+ key: string,
671
+ overlays: readonly (
672
+ | OperationInputValue<OverlayOperation>
673
+ | PreparedOverlayHandle
674
+ )[],
675
+ options?: OperationNodeOptions,
676
+ ): Ref<ProjectEditBatch> => this.#graph.operationByKind(key, {
677
+ input: {
678
+ ordered: [{
679
+ kind: "add-overlays",
680
+ overlays: overlays.map(overlayOperationInput),
681
+ }],
682
+ },
683
+ kind: "derive.edit-batch",
684
+ version: 1,
685
+ }, options),
686
+ batch: (
687
+ key: string,
688
+ input: EditBatchOptions,
689
+ options?: OperationNodeOptions,
690
+ ): Ref<ProjectEditBatch> => this.#graph.operationByKind(key, {
691
+ input,
692
+ kind: "derive.edit-batch",
693
+ version: 1,
694
+ }, options),
695
+ /**
696
+ * Join the complete edit vocabulary into one checked transaction input.
697
+ * Select this explicitly when metadata effects or manual camera moves are
698
+ * needed; ordinary cuts and overlays stay on the narrower v1 path.
699
+ */
700
+ completeBatch: (
701
+ key: string,
702
+ input: CompleteEditBatchOptions,
703
+ options?: OperationNodeOptions,
704
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
705
+ input,
706
+ kind: "derive.edit-batch",
707
+ version: 3,
708
+ }, options),
709
+ followFaces: (
710
+ key: string,
711
+ input: FaceFollowOptions & {
712
+ readonly project: ProjectHandle;
713
+ },
714
+ options?: OperationNodeOptions,
715
+ ): Ref<FaceFollowRevisionDraft> => this.#graph.operationByKind(key, {
716
+ input: { ...input, project: input.project.projectId },
717
+ kind: "derive.follow-faces",
718
+ version: 1,
719
+ }, options),
720
+ /**
721
+ * Expand one reviewed face-follow request into three independent,
722
+ * aspect-bound derivations that the scheduler may execute in parallel.
723
+ */
724
+ followFacesVariants: (
725
+ key: string,
726
+ input: FaceFollowVariantOptions & {
727
+ readonly project: ProjectHandle;
728
+ },
729
+ options?: OperationNodeOptions,
730
+ ): FaceFollowRevisionDraftVariants => {
731
+ const variants = this.namespace(key);
732
+ return Object.freeze({
733
+ landscape: variants.edits.followFaces(
734
+ "landscape",
735
+ { ...input, aspect: "16:9" },
736
+ options,
737
+ ),
738
+ portrait: variants.edits.followFaces(
739
+ "portrait",
740
+ { ...input, aspect: "9:16" },
741
+ options,
742
+ ),
743
+ square: variants.edits.followFaces(
744
+ "square",
745
+ { ...input, aspect: "1:1" },
746
+ options,
747
+ ),
748
+ });
749
+ },
750
+ removeOverlays: (
751
+ key: string,
752
+ overlayIds: readonly OperationInputValue<OverlayId>[],
753
+ options?: OperationNodeOptions,
754
+ ): Ref<ProjectEditBatch> => this.#graph.operationByKind(key, {
755
+ input: {
756
+ ordered: [{ kind: "remove-overlays", overlayIds }],
757
+ },
758
+ kind: "derive.edit-batch",
759
+ version: 1,
760
+ }, options),
761
+ setMetadataEffects: (
762
+ key: string,
763
+ input: MetadataEffectsOptions,
764
+ options?: OperationNodeOptions,
765
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
766
+ input: {
767
+ ordered: [setMetadataEffectsEdit(input)],
768
+ },
769
+ kind: "derive.edit-batch",
770
+ version: 3,
771
+ }, options),
772
+ addManualCameraMoves: (
773
+ key: string,
774
+ cameraMoves: readonly OperationInputValue<
775
+ ManualProjectCameraMoveInputV2
776
+ >[],
777
+ options?: OperationNodeOptions,
778
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
779
+ input: {
780
+ ordered: [addManualCameraMovesEdit(cameraMoves)],
781
+ },
782
+ kind: "derive.edit-batch",
783
+ version: 3,
784
+ }, options),
785
+ addManualZooms: (
786
+ key: string,
787
+ zooms: readonly (
788
+ | ManualZoomInput
789
+ | OperationInputValue<ManualProjectZoomInputV3>
790
+ )[],
791
+ options?: OperationNodeOptions,
792
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
793
+ input: {
794
+ ordered: [addManualZoomsEdit(zooms)],
795
+ },
796
+ kind: "derive.edit-batch",
797
+ version: 3,
798
+ }, options),
799
+ removeCameraMoves: (
800
+ key: string,
801
+ cameraMoveIds: readonly OperationInputValue<
802
+ ManualProjectCameraMoveInputV2["cameraMoveId"]
803
+ >[],
804
+ options?: OperationNodeOptions,
805
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
806
+ input: {
807
+ ordered: [removeCameraMovesEdit(cameraMoveIds)],
808
+ },
809
+ kind: "derive.edit-batch",
810
+ version: 3,
811
+ }, options),
812
+ removeZooms: (
813
+ key: string,
814
+ zoomIds: readonly OperationInputValue<
815
+ ProjectZoomOperation["operation"]["zoomId"]
816
+ >[],
817
+ options?: OperationNodeOptions,
818
+ ): Ref<ProjectEditBatchV3> => this.#graph.operationByKind(key, {
819
+ input: {
820
+ ordered: [removeZoomsEdit(zoomIds)],
821
+ },
822
+ kind: "derive.edit-batch",
823
+ version: 3,
824
+ }, options),
825
+ });
826
+
827
+ readonly gateway = Object.freeze({
828
+ image: (
829
+ key: string,
830
+ input: GatewayImageOptions,
831
+ options?: OperationNodeOptions,
832
+ ): Ref<GatewayImageOperationResult> => this.#graph.operationByKind(key, {
833
+ input,
834
+ kind: "gateway.image",
835
+ version: 1,
836
+ }, options),
837
+ speech: (
838
+ key: string,
839
+ input: GatewaySpeechOptions,
840
+ options?: OperationNodeOptions,
841
+ ): Ref<GatewaySpeechOperationResult> => this.#graph.operationByKind(key, {
842
+ input,
843
+ kind: "gateway.speech",
844
+ version: 1,
845
+ }, options),
846
+ transcription: (
847
+ key: string,
848
+ input: GatewayTranscriptionOptions,
849
+ options?: OperationNodeOptions,
850
+ ): Ref<GatewayTranscriptionOperationResult> =>
851
+ this.#graph.operationByKind(key, {
852
+ input,
853
+ kind: "gateway.transcription",
854
+ version: 1,
855
+ }, options),
856
+ video: (
857
+ key: string,
858
+ input: GatewayVideoOptions,
859
+ options?: OperationNodeOptions,
860
+ ): Ref<GatewayVideoOperationResult> => this.#graph.operationByKind(key, {
861
+ input,
862
+ kind: "gateway.video",
863
+ version: 1,
864
+ }, options),
865
+ });
866
+
867
+ /**
868
+ * Build immutable creative candidates from one frozen project state, close
869
+ * them into a matrix, and keep selection, editorial promotion, and delivery
870
+ * materialization as explicit effects.
871
+ */
872
+ readonly iteration = Object.freeze({
873
+ base: (
874
+ key: string,
875
+ project: string,
876
+ options?: OperationNodeOptions,
877
+ ): ProducedProjectSnapshotHandle => snapshotHandle(this.#graph.operationByKind(key, {
878
+ input: { project },
879
+ kind: "project.snapshot",
880
+ version: 1,
881
+ }, options)),
882
+ baseFromSnapshot: (
883
+ snapshot: ProjectSnapshotOutput,
884
+ ): ProjectSnapshotHandle => persistedSnapshotHandle(snapshot),
885
+ baseline: (): CandidateProjectEditBatchV3 => {
886
+ const body = {
887
+ kind: "slopcamera.project-edit-batch" as const,
888
+ ordered: [],
889
+ schemaVersion: 3 as const,
890
+ };
891
+ return {
892
+ ...body,
893
+ sha256: canonicalJsonSha256(body),
894
+ };
895
+ },
896
+ candidateFromReference: (
897
+ reference: CreateCreativeCandidateOutput,
898
+ ): CreativeCandidateHandle => persistedCreativeCandidateHandle(reference),
899
+ createRevision: (
900
+ key: string,
901
+ input: CreateCreativeCandidateRevisionOptions,
902
+ options?: OperationNodeOptions,
903
+ ): CreativeCandidateRevisionHandle => creativeCandidateRevisionHandle(
904
+ this.#graph.operationByKind<CreateCandidateRevisionOutput>(key, {
905
+ input: {
906
+ batch: input.batch,
907
+ project: input.project.projectId,
908
+ snapshot: input.project.snapshot,
909
+ variantKey: input.variantKey,
910
+ },
911
+ kind: "edit.create-candidate-revision",
912
+ version: 1,
913
+ }, options),
914
+ input,
915
+ ),
916
+ bindRevision: (
917
+ key: string,
918
+ input: BindCreativeCandidateRevisionOptions,
919
+ options?: OperationNodeOptions,
920
+ ): BoundCreativeCandidateRevisionHandle => (
921
+ boundCreativeCandidateRevisionHandle(
922
+ this.#graph.operationByKind<BindCandidateRevisionOutput>(key, {
923
+ input: {
924
+ pixelHeight: input.pixelHeight,
925
+ pixelWidth: input.pixelWidth,
926
+ revision: input.revision.reference,
927
+ },
928
+ kind: "edit.bind-candidate-revision",
929
+ version: 1,
930
+ }, options),
931
+ input.revision,
932
+ )
933
+ ),
934
+ candidate: (
935
+ key: string,
936
+ input: CreateCreativeCandidateOptions,
937
+ options?: OperationNodeOptions,
938
+ ): ProducedCreativeCandidateHandle => creativeCandidateHandle(
939
+ this.#graph.operationByKind<CreateCreativeCandidateOutput>(key, {
940
+ input: {
941
+ batch: input.revision.batch,
942
+ project: input.revision.projectId,
943
+ renders: (input.renders ?? []).map(render => ({
944
+ name: render.name,
945
+ output: render.render.select("output"),
946
+ receipt: render.render.select("receipt"),
947
+ })),
948
+ revision: input.revision.reference,
949
+ snapshot: input.revision.project.snapshot,
950
+ variantKey: input.revision.variantKey,
951
+ },
952
+ kind: "iteration.create-candidate",
953
+ version: 1,
954
+ }, options),
955
+ ),
956
+ matrix: (
957
+ key: string,
958
+ input: {
959
+ readonly candidates: readonly CreativeCandidateHandle[];
960
+ readonly project: ProjectSnapshotHandle | string;
961
+ },
962
+ options?: OperationNodeOptions,
963
+ ): ProducedVariantMatrixHandle => variantMatrixHandle(
964
+ this.#graph.operationByKind<CreateVariantMatrixOutput>(key, {
965
+ input: {
966
+ candidates: input.candidates.map(candidate => candidate.reference),
967
+ project: typeof input.project === "string"
968
+ ? input.project
969
+ : input.project.projectId,
970
+ },
971
+ kind: "iteration.create-matrix",
972
+ version: 1,
973
+ }, options),
974
+ ),
975
+ matrixFromReference: (
976
+ reference: CreateVariantMatrixOutput,
977
+ ): VariantMatrixHandle => persistedVariantMatrixHandle(reference),
978
+ select: (
979
+ key: string,
980
+ input: SelectCreativeVariantOptions,
981
+ options?: OperationNodeOptions,
982
+ ): ProducedVariantSelectionHandle => variantSelectionHandle(
983
+ this.#graph.operationByKind<SelectVariantOutput>(key, {
984
+ input: {
985
+ ...(input.evidence === undefined ? {} : { evidence: input.evidence }),
986
+ matrix: input.matrix.reference,
987
+ project: input.matrix.projectId,
988
+ variantKey: input.variantKey,
989
+ },
990
+ kind: "iteration.select",
991
+ version: 1,
992
+ }, options),
993
+ ),
994
+ selectionFromReference: (
995
+ reference: SelectVariantOutput,
996
+ ): VariantSelectionHandle => persistedVariantSelectionHandle(reference),
997
+ promote: (
998
+ key: string,
999
+ selection: VariantSelectionHandle,
1000
+ options?: OperationNodeOptions,
1001
+ ): Ref<PromoteVariantSelectionOutput> => this.#graph.operationByKind(key, {
1002
+ input: {
1003
+ project: selection.projectId,
1004
+ selection: selection.reference,
1005
+ },
1006
+ kind: "project.promote-selection",
1007
+ version: 1,
1008
+ }, options),
1009
+ materialize: (
1010
+ key: string,
1011
+ input: MaterializeCreativeSelectionOptions,
1012
+ options?: OperationNodeOptions,
1013
+ ): MaterializedVariantSelectionHandle => materializedVariantSelectionHandle(
1014
+ this.#graph.operationByKind<MaterializeVariantSelectionOutput>(key, {
1015
+ input: {
1016
+ ...(input.deliveryKey === undefined
1017
+ ? {}
1018
+ : { deliveryKey: input.deliveryKey }),
1019
+ ...(input.destinationPath === undefined
1020
+ ? {}
1021
+ : { destinationPath: input.destinationPath }),
1022
+ project: input.selection.projectId,
1023
+ renderName: input.renderName,
1024
+ selection: input.selection.reference,
1025
+ },
1026
+ kind: "render.materialize-selection",
1027
+ version: 1,
1028
+ }, options),
1029
+ ),
1030
+ });
1031
+
1032
+ readonly studio = Object.freeze({
1033
+ run: (key: string, input: StudioRunInput | OperationInputValue<StudioRunInput>, options?: OperationNodeOptions): Ref<StudioRunOutput> =>
1034
+ this.#graph.operationByKind(key, { input, kind: "slopcamera.studio.run", version: 1 }, options),
1035
+ });
1036
+
1037
+ readonly scene = Object.freeze({
1038
+ render: (key: string, input: OperationInputValue<SpatialRenderInput>, options?: OperationNodeOptions): Ref<SpatialRenderResult> =>
1039
+ this.#graph.operationByKind(key, { input, kind: "scene.render", version: 1 }, options),
1040
+ inspect: (key: string, input: OperationInputValue<SpatialInspectInput>, options?: OperationNodeOptions): Ref<SpatialInspectOutput> =>
1041
+ this.#graph.operationByKind(key, { input, kind: "scene.inspect", version: 1 }, options),
1042
+ patch: (key: string, input: OperationInputValue<SpatialPatchInput>, options?: OperationNodeOptions): Ref<SpatialPatchOutput> =>
1043
+ this.#graph.operationByKind(key, { input, kind: "scene.patch", version: 1 }, options),
1044
+ evaluate: (key: string, input: OperationInputValue<SpatialEvaluateInput>, options?: OperationNodeOptions): Ref<SpatialEvaluateOutput> =>
1045
+ this.#graph.operationByKind(key, { input, kind: "scene.evaluate", version: 1 }, options),
1046
+ });
1047
+
1048
+ readonly spatialProject = Object.freeze({
1049
+ snapshot: (key: string, input: OperationInputValue<SpatialProjectSnapshotInput>, options?: OperationNodeOptions): Ref<SpatialProjectSnapshotOutput> =>
1050
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.snapshot", version: 1 }, options),
1051
+ migrate: (key: string, input: OperationInputValue<SpatialProjectMigrateInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1052
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.migrate", version: 1 }, options),
1053
+ patch: (key: string, input: OperationInputValue<SpatialProjectPatchInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1054
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.patch", version: 1 }, options),
1055
+ restore: (key: string, input: OperationInputValue<SpatialProjectRestoreInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1056
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.restore", version: 1 }, options),
1057
+ addShot: (key: string, input: OperationInputValue<SpatialProjectAddShotInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1058
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.add-shot", version: 1 }, options),
1059
+ addCandidate: (key: string, input: OperationInputValue<SpatialProjectAddCandidateInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1060
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.add-candidate", version: 1 }, options),
1061
+ selectCandidate: (key: string, input: OperationInputValue<SpatialProjectSelectCandidateInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1062
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.select-candidate", version: 1 }, options),
1063
+ reconcile: (key: string, input: OperationInputValue<SpatialProjectReconcileInput>, options?: OperationNodeOptions): Ref<CompletedSpatialProjectMutation> =>
1064
+ this.#graph.operationByKind(key, { input, kind: "spatial.project.reconcile", version: 1 }, options),
1065
+ });
1066
+
1067
+ readonly media = Object.freeze({
1068
+ audioEffects: (
1069
+ key: string,
1070
+ input: MediaAudioEffectsOptions,
1071
+ options?: OperationNodeOptions,
1072
+ ): Ref<MediaAudioEffectsOutput> => this.#graph.operationByKind(key, {
1073
+ input,
1074
+ kind: "media.audio-effects",
1075
+ version: 1,
1076
+ }, options),
1077
+ colorGrade: (
1078
+ key: string,
1079
+ input: MediaColorGradeOptions,
1080
+ options?: OperationNodeOptions,
1081
+ ): Ref<MediaColorGradeOutput> => this.#graph.operationByKind(key, {
1082
+ input,
1083
+ kind: "media.color-grade",
1084
+ version: 1,
1085
+ }, options),
1086
+ ingest: (
1087
+ key: string,
1088
+ input: MediaIngestOptions,
1089
+ options?: OperationNodeOptions,
1090
+ ): Ref<MediaIngestOutput> => this.#graph.operationByKind(key, {
1091
+ input: {
1092
+ ...input,
1093
+ project: mediaIngestProject(input.project),
1094
+ },
1095
+ kind: "media.ingest",
1096
+ version: 1,
1097
+ }, options),
1098
+ htmlOverlay: (
1099
+ key: string,
1100
+ input: MediaHtmlOverlayOptions,
1101
+ options?: OperationNodeOptions,
1102
+ ): PreparedOverlayHandle => preparedOverlayHandle(
1103
+ this.#graph.operationByKind<HtmlOverlayOutput>(key, {
1104
+ input: {
1105
+ ...input,
1106
+ project: mediaHtmlOverlayProject(input.project),
1107
+ },
1108
+ kind: "media.html-overlay",
1109
+ version: 1,
1110
+ }, options),
1111
+ ),
1112
+ overlay: (
1113
+ key: string,
1114
+ input: MediaOverlayOptions,
1115
+ options?: OperationNodeOptions,
1116
+ ): PreparedOverlayHandle => preparedOverlayHandle(
1117
+ this.#graph.operationByKind(key, {
1118
+ input: {
1119
+ ...input,
1120
+ project: mediaOverlayProject(input.project),
1121
+ },
1122
+ kind: "media.overlay",
1123
+ version: 1,
1124
+ }, options),
1125
+ ),
1126
+ });
1127
+
1128
+ readonly project = Object.freeze({
1129
+ commitCompleteEdits: (
1130
+ key: string,
1131
+ input: {
1132
+ readonly batch: Ref<ProjectEditBatchV3>;
1133
+ readonly project: ProjectHandle;
1134
+ },
1135
+ options?: OperationNodeOptions,
1136
+ ): CommittedProjectHandle => committedHandle(this.#graph.operationByKind(key, {
1137
+ input: {
1138
+ batch: input.batch,
1139
+ basis: input.project.editBasis,
1140
+ project: input.project.projectId,
1141
+ },
1142
+ kind: "project.commit-edits",
1143
+ version: 3,
1144
+ }, options)),
1145
+ commitEdits: (
1146
+ key: string,
1147
+ input: {
1148
+ readonly batch: Ref<ProjectEditBatch>;
1149
+ readonly project: ProjectHandle;
1150
+ },
1151
+ options?: OperationNodeOptions,
1152
+ ): CommittedProjectHandle => committedHandle(this.#graph.operationByKind(key, {
1153
+ input: {
1154
+ batch: input.batch,
1155
+ basis: input.project.editBasis,
1156
+ project: input.project.projectId,
1157
+ },
1158
+ kind: "project.commit-edits",
1159
+ version: 1,
1160
+ }, options)),
1161
+ createRevision: (
1162
+ key: string,
1163
+ input: {
1164
+ readonly draft: Ref<FaceFollowRevisionDraft>;
1165
+ readonly project: ProjectHandle;
1166
+ },
1167
+ options?: OperationNodeOptions,
1168
+ ): ProjectEditRevisionHandle => revisionHandle(
1169
+ this.#graph.operationByKind(key, {
1170
+ input: {
1171
+ draft: input.draft,
1172
+ project: input.project.projectId,
1173
+ },
1174
+ kind: "edit.create-revision",
1175
+ version: 1,
1176
+ }, options),
1177
+ ),
1178
+ /**
1179
+ * Publish common aspect drafts as separate immutable references. This does
1180
+ * not advance the project's mutable current-plan pointer.
1181
+ */
1182
+ createRevisionVariants: (
1183
+ key: string,
1184
+ input: {
1185
+ readonly drafts: FaceFollowRevisionDraftVariants;
1186
+ readonly project: ProjectHandle;
1187
+ },
1188
+ options?: OperationNodeOptions,
1189
+ ): ProjectEditRevisionVariants => {
1190
+ const variants = this.namespace(key);
1191
+ return Object.freeze({
1192
+ landscape: variants.project.createRevision("landscape", {
1193
+ draft: input.drafts.landscape,
1194
+ project: input.project,
1195
+ }, options),
1196
+ portrait: variants.project.createRevision("portrait", {
1197
+ draft: input.drafts.portrait,
1198
+ project: input.project,
1199
+ }, options),
1200
+ square: variants.project.createRevision("square", {
1201
+ draft: input.drafts.square,
1202
+ project: input.project,
1203
+ }, options),
1204
+ });
1205
+ },
1206
+ /**
1207
+ * Freeze the current complete project/edit documents into an immutable,
1208
+ * geometry-bound revision without moving the mutable current pointer.
1209
+ */
1210
+ freezeRevision: (
1211
+ key: string,
1212
+ input: {
1213
+ readonly pixelHeight: number;
1214
+ readonly pixelWidth: number;
1215
+ readonly project: ProjectHandle;
1216
+ },
1217
+ options?: OperationNodeOptions,
1218
+ ): ProjectEditRevisionHandle => revisionHandle(
1219
+ this.#graph.operationByKind(key, {
1220
+ input: {
1221
+ basis: input.project.editBasis,
1222
+ pixelHeight: input.pixelHeight,
1223
+ pixelWidth: input.pixelWidth,
1224
+ project: input.project.projectId,
1225
+ },
1226
+ kind: "edit.freeze-revision",
1227
+ version: 1,
1228
+ }, options),
1229
+ ),
1230
+ /**
1231
+ * Create common landscape, square, and portrait geometry bindings as
1232
+ * independent nodes so their downstream plans/renders may overlap.
1233
+ */
1234
+ freezeRevisionVariants: (
1235
+ key: string,
1236
+ input: {
1237
+ readonly project: ProjectHandle;
1238
+ },
1239
+ options?: OperationNodeOptions,
1240
+ ): ProjectEditRevisionVariants => {
1241
+ const variants = this.namespace(key);
1242
+ return Object.freeze({
1243
+ landscape: variants.project.freezeRevision("landscape", {
1244
+ pixelHeight: 1_080,
1245
+ pixelWidth: 1_920,
1246
+ project: input.project,
1247
+ }, options),
1248
+ portrait: variants.project.freezeRevision("portrait", {
1249
+ pixelHeight: 1_920,
1250
+ pixelWidth: 1_080,
1251
+ project: input.project,
1252
+ }, options),
1253
+ square: variants.project.freezeRevision("square", {
1254
+ pixelHeight: 1_080,
1255
+ pixelWidth: 1_080,
1256
+ project: input.project,
1257
+ }, options),
1258
+ });
1259
+ },
1260
+ snapshot: (
1261
+ key: string,
1262
+ project: string,
1263
+ options?: OperationNodeOptions,
1264
+ ): ProducedProjectSnapshotHandle => snapshotHandle(this.#graph.operationByKind(key, {
1265
+ input: { project },
1266
+ kind: "project.snapshot",
1267
+ version: 1,
1268
+ }, options)),
1269
+ });
1270
+
1271
+ readonly render = Object.freeze({
1272
+ spatialProject: (key: string, input: OperationInputValue<ProjectRenderInputV4> | ProjectRenderInputV4, options?: OperationNodeOptions): Ref<ProjectRenderOutputV4> =>
1273
+ this.#graph.operationByKind(key, { input, kind: "render.project", version: 4 }, options),
1274
+ bindCandidateOutput: (
1275
+ key: string,
1276
+ input: BindCreativeCandidateRenderOptions,
1277
+ options?: OperationNodeOptions,
1278
+ ): CandidateRenderBindingHandle => candidateRenderBindingHandle(
1279
+ this.#graph.operationByKind<CandidateProjectRenderInput>(key, {
1280
+ input: {
1281
+ candidateRevision: input.revision.candidateRevision.reference,
1282
+ maximumBytes: input.maximumBytes,
1283
+ plan: input.plan,
1284
+ revision: input.revision.revision,
1285
+ syncPolicy: input.syncPolicy,
1286
+ target: input.target,
1287
+ },
1288
+ kind: "render.bind-candidate-output",
1289
+ version: 1,
1290
+ }, options),
1291
+ ),
1292
+ plan: (
1293
+ key: string,
1294
+ input: Omit<ProjectRenderPlanInput, "revision"> & {
1295
+ readonly revision: ProjectEditRevisionHandle;
1296
+ },
1297
+ options?: OperationNodeOptions,
1298
+ ): Ref<ProjectRenderPlanOutput> => this.#graph.operationByKind(key, {
1299
+ input: { ...input, revision: input.revision.revision },
1300
+ kind: "render.project-plan",
1301
+ version: 1,
1302
+ }, options),
1303
+ captionedPlan: (
1304
+ key: string,
1305
+ input: Omit<
1306
+ ProjectRenderPlanInputV2,
1307
+ "captionBinding" | "metadataBindings" | "revision"
1308
+ > & {
1309
+ readonly revision: ProjectEditRevisionHandle;
1310
+ },
1311
+ options?: OperationNodeOptions,
1312
+ ): Ref<ProjectRenderPlanOutput> => this.#graph.operationByKind(key, {
1313
+ input: { ...input, revision: input.revision.revision },
1314
+ kind: "render.project-plan",
1315
+ version: 2,
1316
+ }, options),
1317
+ project: (
1318
+ key: string,
1319
+ input: (
1320
+ | Omit<RefFriendlyFields<ProjectRenderInput>, "binding" | "plan">
1321
+ | Omit<RefFriendlyFields<ProjectRenderInputV2>, "binding" | "plan">
1322
+ ) & { readonly plan: Ref<ProjectRenderPlanOutput> },
1323
+ options?: OperationNodeOptions,
1324
+ ): Ref<ProjectRenderOutput> => this.#graph.operationByKind(key, {
1325
+ input,
1326
+ kind: "render.project",
1327
+ version: "target" in input ? 2 : 1,
1328
+ }, options),
1329
+ candidateProject: (
1330
+ key: string,
1331
+ binding: CandidateRenderBindingHandle,
1332
+ options?: OperationNodeOptions,
1333
+ ): Ref<ProjectRenderOutput> => this.#graph.operationByKind(key, {
1334
+ input: {
1335
+ binding: binding.input.select("binding"),
1336
+ derivation: binding.input.select("derivation"),
1337
+ output: binding.input.select("output"),
1338
+ plan: binding.input.select("plan"),
1339
+ syncPolicy: binding.input.select("syncPolicy"),
1340
+ target: binding.input.select("target"),
1341
+ },
1342
+ kind: "render.project",
1343
+ version: 3,
1344
+ }, options),
1345
+ });
1346
+
1347
+ readonly recording = Object.freeze({
1348
+ pause: (
1349
+ key: string,
1350
+ options?: OperationNodeOptions,
1351
+ ): Ref<RecordingPauseOutput> => this.#graph.operationByKind(key, {
1352
+ input: {},
1353
+ kind: "recording.pause",
1354
+ version: 1,
1355
+ }, options),
1356
+ resume: (
1357
+ key: string,
1358
+ options?: OperationNodeOptions,
1359
+ ): Ref<RecordingResumeOutput> => this.#graph.operationByKind(key, {
1360
+ input: {},
1361
+ kind: "recording.resume",
1362
+ version: 1,
1363
+ }, options),
1364
+ start: (
1365
+ key: string,
1366
+ input: RecordingStartOptions,
1367
+ options?: OperationNodeOptions,
1368
+ ): Ref<RecordingStartOutput> => this.#graph.operationByKind(key, {
1369
+ input,
1370
+ kind: "recording.start",
1371
+ version: 2,
1372
+ }, options),
1373
+ stop: (
1374
+ key: string,
1375
+ options?: OperationNodeOptions,
1376
+ ): Ref<RecordingStopOutput> => this.#graph.operationByKind(key, {
1377
+ input: {},
1378
+ kind: "recording.stop",
1379
+ version: 1,
1380
+ }, options),
1381
+ });
1382
+
1383
+ private constructor(graph: WorkflowGraphBuilder) {
1384
+ this.#graph = graph;
1385
+ }
1386
+
1387
+ static create(registry: OperationDiscoverySource): WorkflowBuilder {
1388
+ return new WorkflowBuilder(WorkflowGraphBuilder.create(registry));
1389
+ }
1390
+
1391
+ namespace(segment: string): WorkflowBuilder {
1392
+ return new WorkflowBuilder(this.#graph.namespace(segment));
1393
+ }
1394
+
1395
+ fragment<Input, Output>(
1396
+ namespace: string,
1397
+ fragment: WorkflowFragment<Input, Output>,
1398
+ input: Input,
1399
+ ): Output {
1400
+ return fragment.build(this.namespace(namespace), input);
1401
+ }
1402
+
1403
+ operation<Input, Output>(
1404
+ key: string,
1405
+ contract: OperationContract<Input, Output>,
1406
+ input: OperationInputValue<Input>,
1407
+ options?: OperationNodeOptions,
1408
+ ): Ref<Output> {
1409
+ return this.#graph.operation(key, contract, input, options);
1410
+ }
1411
+
1412
+ operationByKind(
1413
+ key: string,
1414
+ request: UntypedOperationRequest,
1415
+ options?: OperationNodeOptions,
1416
+ ): Ref<unknown> {
1417
+ return this.#graph.operationByKind<unknown>(key, request, options);
1418
+ }
1419
+
1420
+ compute<Input, Output>(
1421
+ key: string,
1422
+ definition: TrustedComputeDefinition<Input, Output>,
1423
+ input: OperationInputValue<Input>,
1424
+ options?: OperationNodeOptions,
1425
+ ): Ref<Output> {
1426
+ return this.#graph.compute(key, definition, input, options);
1427
+ }
1428
+
1429
+ computeDefinitions(): readonly AnyTrustedComputeDefinition[] {
1430
+ return this.#graph.computeDefinitions();
1431
+ }
1432
+
1433
+ build(identity: WorkflowIdentity, outputs: WorkflowOutputValue) {
1434
+ return this.#graph.build(identity, outputs);
1435
+ }
1436
+ }