stillmade-sdk 0.1.42 → 0.1.44

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 (262) hide show
  1. package/.stillmade/sdk-baseline.json +6 -8
  2. package/AGENTS.md +15 -10
  3. package/FRAME_VIEWS.md +113 -0
  4. package/INTERFACE_DESIGN.md +62 -22
  5. package/MOBILE_UI.md +4 -2
  6. package/MODULES.md +152 -6
  7. package/PASTE_TO_LLM.md +35 -25
  8. package/README.md +3 -2
  9. package/SDK.md +994 -550
  10. package/UI_AESTHETIC.md +22 -2
  11. package/blocks/generate/package.js +1 -0
  12. package/blocks/generate/versions/1.0.0/package.js +463 -0
  13. package/docs/build/audio-to-editor.md +36 -0
  14. package/docs/build/block-builder-contract.md +150 -0
  15. package/docs/build/comfyui.md +227 -0
  16. package/docs/build/concepts.md +40 -0
  17. package/docs/build/context.md +159 -0
  18. package/docs/build/cookbook.md +57 -0
  19. package/docs/build/custom-interface.md +617 -0
  20. package/docs/build/data-types.md +83 -0
  21. package/docs/build/frame-views.md +259 -0
  22. package/docs/build/generate-media.md +59 -0
  23. package/docs/build/github-applications.md +314 -0
  24. package/docs/build/hosted-images.md +214 -0
  25. package/docs/build/hosted-music.md +39 -0
  26. package/docs/build/hosted-speech.md +157 -0
  27. package/docs/build/hosted-text.md +246 -0
  28. package/docs/build/image-description.md +49 -0
  29. package/docs/build/interface-design.md +343 -0
  30. package/docs/build/javascript.md +63 -0
  31. package/docs/build/local-preview.md +61 -0
  32. package/docs/build/media-analysis.md +27 -0
  33. package/docs/build/media.md +400 -0
  34. package/docs/build/mobile-ui.md +106 -0
  35. package/docs/build/modules.md +487 -0
  36. package/docs/build/original-blocks.md +70 -0
  37. package/docs/build/outside-apis.md +128 -0
  38. package/docs/build/production-context-templates.md +12 -0
  39. package/docs/build/project-storage.md +94 -0
  40. package/docs/build/quickstart.md +48 -0
  41. package/docs/build/recipes.md +103 -0
  42. package/docs/build/script-handoff.md +45 -0
  43. package/docs/build/script-writer.md +34 -0
  44. package/docs/build/state.md +223 -0
  45. package/docs/build/testing.md +112 -0
  46. package/docs/build/timeline-edits.md +116 -0
  47. package/docs/build/timeline-proposals.md +76 -0
  48. package/docs/build/transcription.md +59 -0
  49. package/docs/build/triggers.md +59 -0
  50. package/docs/build/tutorial.md +52 -0
  51. package/docs/build/typescript.md +34 -0
  52. package/docs/build/video-generation.md +61 -0
  53. package/docs/build/web-reading.md +37 -0
  54. package/docs/build/with-your-ai.md +27 -0
  55. package/docs/changelog.md +9 -0
  56. package/docs/creators.md +21 -0
  57. package/docs/distribute/discovery.md +43 -0
  58. package/docs/distribute/imports.md +58 -0
  59. package/docs/distribute/publishing.md +29 -0
  60. package/docs/distribute/sdk-versions.md +36 -0
  61. package/docs/distribute/selling.md +14 -0
  62. package/docs/distribute/teams.md +60 -0
  63. package/docs/distribute/versioning.md +28 -0
  64. package/docs/examples.md +23 -0
  65. package/docs/gallery.md +26 -0
  66. package/docs/index.md +50 -0
  67. package/docs/native-mcp.md +307 -0
  68. package/docs/project-types/automation.md +43 -0
  69. package/docs/project-types/batches.md +50 -0
  70. package/docs/project-types/build.md +42 -0
  71. package/docs/project-types/completion.md +15 -0
  72. package/docs/project-types/conditions.md +21 -0
  73. package/docs/project-types/hosted-review.md +115 -0
  74. package/docs/project-types/onboarding.md +75 -0
  75. package/docs/project-types/running.md +309 -0
  76. package/docs/project-types/testing.md +72 -0
  77. package/docs/reference/application-artifacts.md +87 -0
  78. package/docs/reference/authoring-guide.md +134 -0
  79. package/docs/reference/browser-applications.md +267 -0
  80. package/docs/reference/capabilities.md +45 -0
  81. package/docs/reference/cli.md +71 -0
  82. package/docs/reference/connection-api.md +59 -0
  83. package/docs/reference/cooperative-jobs.md +13 -0
  84. package/docs/reference/desktop-capabilities.md +172 -0
  85. package/docs/reference/desktop-execution.md +77 -0
  86. package/docs/reference/errors.md +233 -0
  87. package/docs/reference/execution.md +800 -0
  88. package/docs/reference/first-party-blocks.md +40 -0
  89. package/docs/reference/generation-models.md +59 -0
  90. package/docs/reference/limits.md +306 -0
  91. package/docs/reference/manifest-kinds-controls.md +36 -0
  92. package/docs/reference/manifest.md +181 -0
  93. package/docs/reference/operations.md +36 -0
  94. package/docs/reference/package-jobs.md +35 -0
  95. package/docs/reference/parity.md +55 -0
  96. package/docs/reference/permissions.md +86 -0
  97. package/docs/reference/ports.md +26 -0
  98. package/docs/reference/types.md +268 -0
  99. package/docs/reference/universal-resolver.md +303 -0
  100. package/docs/reference/view-bridge.md +60 -0
  101. package/docs/reference/view-rules.md +15 -0
  102. package/docs/reference/workspace-sync.md +25 -0
  103. package/docs/sdk.md +34 -0
  104. package/docs/tools/block-remix.md +211 -0
  105. package/docs/tools/llm.md +2213 -0
  106. package/docs/tools/repository-adaptation.md +613 -0
  107. package/examples/check-clip.stillmade.json +4 -1
  108. package/examples/generate-video.stillmade.json +6 -2
  109. package/examples/research-topic.stillmade.json +5 -1
  110. package/examples/text-workflow.stillmade.json +3 -32
  111. package/examples/timeline-polish.stillmade.json +11 -3
  112. package/examples/transcribe-audio.stillmade.json +11 -3
  113. package/package.json +1 -1
  114. package/packages/block-cli/cli.js +13 -6
  115. package/packages/block-cli/dev-host/assets/host.js +76 -38
  116. package/packages/block-cli/dev-host/assets/index.css +1 -1
  117. package/packages/block-cli/format.js +1 -1
  118. package/packages/block-cli/templates.js +31 -13
  119. package/packages/block-cli/type-packages.js +119 -0
  120. package/packages/block-platform/block-readiness.js +5 -0
  121. package/packages/block-platform/canvas.js +2 -1
  122. package/packages/block-platform/catalog.js +27 -48
  123. package/packages/block-platform/native-host-inventory.js +0 -226
  124. package/packages/block-platform/plain-descriptions.js +1 -25
  125. package/packages/block-platform/project-type-starters.js +13 -53
  126. package/packages/block-platform/script-handoff.js +2 -4
  127. package/packages/block-platform/type-workspace.js +2 -0
  128. package/packages/block-sdk/appearance.js +3 -1
  129. package/packages/block-sdk/block-tier.js +1 -1
  130. package/packages/block-sdk/builder-contract.js +10 -8
  131. package/packages/block-sdk/capabilities.js +1 -1
  132. package/packages/block-sdk/contracts.js +6 -2
  133. package/packages/block-sdk/first-party-identities.js +1 -84
  134. package/packages/block-sdk/first-party-packages.js +3 -85
  135. package/packages/block-sdk/generation-catalog.js +15 -3
  136. package/packages/block-sdk/index.d.ts +2 -1
  137. package/packages/block-sdk/media-analysis-example.js +1 -1
  138. package/packages/block-sdk/mock-host.js +7 -1
  139. package/packages/block-sdk/module-host-calls.js +35 -10
  140. package/packages/block-sdk/module-hosted.js +15 -2
  141. package/packages/block-sdk/module-media-access.js +71 -0
  142. package/packages/block-sdk/module-node.js +1 -1
  143. package/packages/block-sdk/portable-media-actions.js +1 -1
  144. package/packages/block-sdk/runtime.js +1 -1
  145. package/packages/block-sdk/timeline-proposal-example.js +1 -1
  146. package/packages/block-sdk/transcription-example.js +1 -1
  147. package/packages/block-sdk/video-generation-example.js +1 -1
  148. package/packages/block-sdk/view-bridge.js +4 -1
  149. package/packages/block-sdk/view-design.js +17 -14
  150. package/packages/block-sdk/web-example.js +1 -1
  151. package/packages/design-system/block-kit.css +48 -12
  152. package/packages/design-system/block-kit.html +3 -2
  153. package/blocks/mcp-motion-planner/versions/1.1.0/package.js +0 -97
  154. package/blocks/motion-designer/versions/1.0.1/package.js +0 -173318
  155. package/blocks/motion-designer/versions/1.0.2/package.js +0 -173318
  156. package/blocks/motion-frame-review/versions/1.1.1/package.js +0 -465
  157. package/blocks/motion-frame-review/versions/1.1.2/package.snapshot.js +0 -572
  158. package/blocks/narration/package.js +0 -1
  159. package/blocks/narration/versions/1.0.0/package.js +0 -221
  160. package/blocks/narration/versions/1.0.1/package.js +0 -221
  161. package/blocks/native/sm.animated-scene/versions/2.0.0/package.js +0 -475
  162. package/blocks/native/sm.animated-scene/versions/2.1.0/package.js +0 -498
  163. package/blocks/native/sm.animated-scene/versions/2.2.0/package.js +0 -524
  164. package/blocks/native/sm.animated-scene/versions/2.3.0/package.js +0 -618
  165. package/blocks/native/sm.animated-scene/versions/2.3.1/package.js +0 -618
  166. package/blocks/native/sm.animated-scene/versions/2.3.2/package.js +0 -723
  167. package/blocks/native/sm.animated-scene/versions/2.3.3/package.js +0 -723
  168. package/blocks/native/sm.animated-scene/versions/2.3.4/package.js +0 -676
  169. package/blocks/native/sm.animated-scene/versions/2.3.5/package.js +0 -693
  170. package/blocks/native/sm.animated-scene/versions/2.3.6/package.js +0 -700
  171. package/blocks/native/sm.animated-scene/versions/2.3.7/package.js +0 -747
  172. package/blocks/native/sm.animated-scene/versions/2.3.8/package.js +0 -769
  173. package/blocks/native/sm.animated-scene/versions/2.3.9/package.js +0 -769
  174. package/blocks/native/sm.animated-scene-assistant/versions/1.0.0/package.js +0 -183
  175. package/blocks/native/sm.blueprint/versions/2.0.0/package.js +0 -358
  176. package/blocks/native/sm.blueprint/versions/2.1.0/package.js +0 -358
  177. package/blocks/native/sm.blueprint/versions/2.1.1/package.js +0 -358
  178. package/blocks/native/sm.blueprint/versions/2.1.2/package.js +0 -358
  179. package/blocks/native/sm.blueprint/versions/2.1.3/package.js +0 -381
  180. package/blocks/native/sm.blueprint/versions/2.1.4/package.js +0 -381
  181. package/blocks/native/sm.blueprint/versions/2.1.5/package.js +0 -339
  182. package/blocks/native/sm.blueprint/versions/2.1.6/package.js +0 -356
  183. package/blocks/native/sm.blueprint/versions/2.1.7/package.js +0 -363
  184. package/blocks/native/sm.blueprint/versions/2.1.8/package.js +0 -410
  185. package/blocks/native/sm.blueprint/versions/2.1.9/package.js +0 -422
  186. package/blocks/native/sm.blueprint-assistant/versions/1.0.0/package.js +0 -172
  187. package/blocks/native/sm.chat/versions/2.0.0/package.js +0 -144
  188. package/blocks/native/sm.chat/versions/2.0.1/package.js +0 -97
  189. package/blocks/native/sm.chat/versions/2.0.2/package.js +0 -100
  190. package/blocks/native/sm.chat/versions/2.0.3/package.js +0 -100
  191. package/blocks/native/sm.continue-if/versions/1.0.0/package.js +0 -168
  192. package/blocks/native/sm.describe-media/versions/2.0.0/package.js +0 -153
  193. package/blocks/native/sm.describe-media/versions/2.0.1/package.js +0 -156
  194. package/blocks/native/sm.describe-media/versions/2.1.0/package.js +0 -140
  195. package/blocks/native/sm.image-editor/versions/2.0.0/package.js +0 -183
  196. package/blocks/native/sm.image-editor/versions/2.0.1/package.js +0 -190
  197. package/blocks/native/sm.new-items/versions/1.0.0/package.js +0 -191
  198. package/blocks/native/sm.pick-photos/versions/1.0.0/package.js +0 -334
  199. package/blocks/native/sm.quality-audit/versions/1.0.0/package.js +0 -192
  200. package/blocks/native/sm.quality-audit/versions/1.0.1/package.js +0 -192
  201. package/blocks/native/sm.quality-audit/versions/1.0.2/package.js +0 -195
  202. package/blocks/native/sm.research/versions/2.0.0/package.js +0 -175
  203. package/blocks/native/sm.research/versions/2.0.1/package.js +0 -184
  204. package/blocks/native/sm.research/versions/2.0.2/package.js +0 -187
  205. package/blocks/native/sm.script/versions/2.0.0/package.js +0 -144
  206. package/blocks/native/sm.script/versions/2.1.0/package.js +0 -144
  207. package/blocks/native/sm.script/versions/2.1.1/package.js +0 -144
  208. package/blocks/native/sm.script/versions/2.1.2/package.js +0 -105
  209. package/blocks/native/sm.script/versions/2.1.3/package.js +0 -152
  210. package/blocks/native/sm.script/versions/2.1.4/package.js +0 -156
  211. package/blocks/native/sm.script/versions/2.1.5/package.js +0 -156
  212. package/blocks/native/sm.shot-plan/versions/2.0.0/package.js +0 -301
  213. package/blocks/native/sm.shot-plan/versions/2.1.0/package.js +0 -528
  214. package/blocks/native/sm.shot-plan/versions/2.1.1/package.js +0 -528
  215. package/blocks/native/sm.shot-plan/versions/2.1.2/package.js +0 -528
  216. package/blocks/native/sm.shot-plan/versions/2.1.3/package.js +0 -536
  217. package/blocks/native/sm.shot-plan/versions/2.2.0/package.js +0 -800
  218. package/blocks/native/sm.shot-plan/versions/2.2.1/package.js +0 -920
  219. package/blocks/native/sm.shot-plan-assistant/versions/1.0.0/package.js +0 -173
  220. package/blocks/native/sm.stock-search/versions/2.0.0/package.js +0 -174
  221. package/blocks/native/sm.thumbnail/versions/2.0.0/package.js +0 -137
  222. package/blocks/native/sm.thumbnail/versions/2.0.1/package.js +0 -140
  223. package/blocks/native/sm.transcribe/versions/2.0.0/package.js +0 -163
  224. package/blocks/native/sm.transcribe/versions/2.0.1/package.js +0 -168
  225. package/blocks/native/sm.whiteboard-assistant/versions/1.0.0/package.js +0 -175
  226. package/blocks/native/sm.youtube/versions/2.0.0/package.js +0 -217
  227. package/blocks/occasion-story/package.js +0 -1
  228. package/blocks/occasion-story/versions/1.0.0/package.js +0 -1658
  229. package/blocks/occasion-story/versions/1.0.1/package.js +0 -1699
  230. package/blocks/occasion-story/versions/1.0.2/package.js +0 -1682
  231. package/blocks/photo-reel-composer/versions/1.0.0/package.js +0 -3043
  232. package/blocks/photo-reel-composer/versions/1.0.1/package.js +0 -3026
  233. package/blocks/photo-reel-composer/versions/1.0.2/package.js +0 -4149
  234. package/blocks/product-ad-variants/versions/1.0.0/package.js +0 -2911
  235. package/blocks/product-launch-director/versions/1.0.0/package.js +0 -103
  236. package/blocks/release-visuals/package.js +0 -1
  237. package/blocks/release-visuals/versions/1.0.0/package.js +0 -1492
  238. package/blocks/release-visuals/versions/1.0.1/package.js +0 -1517
  239. package/blocks/release-visuals/versions/1.0.2/package.js +0 -1500
  240. package/blocks/screen-recorder/package.js +0 -1
  241. package/blocks/screen-recorder/versions/1.0.0/package.js +0 -223
  242. package/blocks/screen-recorder/versions/1.0.1/package.js +0 -223
  243. package/blocks/short-form-finish/package.js +0 -1
  244. package/blocks/short-form-finish/versions/1.0.0/package.js +0 -1043
  245. package/blocks/short-form-finish/versions/1.0.1/package.js +0 -1043
  246. package/blocks/short-form-finish/versions/1.0.2/package.js +0 -1043
  247. package/blocks/short-form-finish/versions/1.0.3/package.js +0 -1026
  248. package/examples/saas-product-launch-reviewed-source.stillmade.json +0 -383
  249. package/examples/saas-product-launch.stillmade.json +0 -304
  250. package/packages/block-platform/dealer-inventory-video-project-type.js +0 -38
  251. package/packages/block-platform/first-revenue-project-types.js +0 -46
  252. package/packages/block-platform/fixture-starters.js +0 -13
  253. package/packages/block-platform/launch-project-source.js +0 -10
  254. package/packages/block-platform/launch-project.js +0 -30
  255. package/packages/block-platform/motion-project-types.js +0 -55
  256. package/packages/block-platform/motion-starters.js +0 -14
  257. package/packages/block-platform/product-ad-variants-project-type.js +0 -30
  258. package/packages/block-platform/product-launch-updated.js +0 -90
  259. package/packages/block-platform/revenue-review-project-types.js +0 -36
  260. package/packages/block-platform/revenue-review-starters.js +0 -13
  261. package/packages/block-platform/script-writer.js +0 -29
  262. package/packages/block-platform/website-source-block.js +0 -14
@@ -1,524 +0,0 @@
1
- // Generated by scripts/build-owned-blocks.mjs. Edit the owned source files.
2
- export default {
3
- "manifest": {
4
- "schemaVersion": 1,
5
- "sdkVersion": "0.1.0",
6
- "id": "sm.animated-scene",
7
- "version": "2.2.0",
8
- "name": "Animated Scene",
9
- "description": "Review and edit the complete Animated Scene Step—scene composition, layers, assets, camera and motion settings, transitions, versions, and retained custom fields—while preserving the shot and narration spine.",
10
- "kind": "workspace",
11
- "runtime": "javascript",
12
- "entry": "src/run.js",
13
- "license": "MIT",
14
- "provenance": {
15
- "notice": "Original source (authorship declared by the packager)\nLicense: MIT\nChanges: Original implementation declared by the packager; no reused repository or dependency code.\nFiles: LICENSE, src/run.js, src/view.json\n\nMIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
16
- "portableSources": [
17
- {
18
- "kind": "original",
19
- "license": "MIT",
20
- "paths": [
21
- "LICENSE",
22
- "src/run.js",
23
- "src/view.json"
24
- ],
25
- "evidence": [
26
- "upstream/0/LICENSE",
27
- "upstream/0/src/run.js",
28
- "upstream/0/src/view.json"
29
- ],
30
- "changes": "Original implementation declared by the packager; no reused repository or dependency code."
31
- }
32
- ]
33
- },
34
- "inputs": {
35
- "animation": {
36
- "type": "scene-document",
37
- "context": "animation",
38
- "primary": true,
39
- "required": false,
40
- "default": {
41
- "schemaVersion": 1,
42
- "scenes": []
43
- },
44
- "description": "The complete current Animated Scene document. Shot identity, narration timing, scene layers, assets, versions, and custom fields are retained."
45
- },
46
- "updatedAnimation": {
47
- "type": "scene-document",
48
- "required": false,
49
- "default": {
50
- "schemaVersion": 1,
51
- "scenes": []
52
- },
53
- "description": "The complete edited animation prepared in this workspace."
54
- },
55
- "commit": {
56
- "type": "boolean",
57
- "default": false,
58
- "description": "Prepare the edited animation for StillMade review and Apply."
59
- },
60
- "generatedImage": {
61
- "type": "image",
62
- "imageMode": "reference",
63
- "required": false,
64
- "description": "An exact stored image version produced by an approved generation Block or selected from project media."
65
- },
66
- "targetShotId": {
67
- "type": "text",
68
- "required": false,
69
- "default": "",
70
- "description": "Shot containing the layer that receives the connected image."
71
- },
72
- "targetLayerId": {
73
- "type": "text",
74
- "required": false,
75
- "default": "",
76
- "description": "Layer that receives the connected image."
77
- },
78
- "attachGeneratedImage": {
79
- "type": "boolean",
80
- "default": false,
81
- "description": "Attach the connected image to the selected layer while preserving prior scene versions."
82
- },
83
- "action": {
84
- "type": "text",
85
- "required": false,
86
- "default": "none",
87
- "description": "The Block-owned interface selects a declared host action."
88
- }
89
- },
90
- "outputs": {
91
- "animation": {
92
- "type": "scene-document",
93
- "primary": true,
94
- "role": "animated_scene_document",
95
- "description": "The complete edited Animated Scene document for the next Step."
96
- },
97
- "edit": {
98
- "type": "workspace-edit",
99
- "description": "An exact before/after Animated Scene change reviewed before it updates the project."
100
- },
101
- "qualityAction": {
102
- "type": "approval",
103
- "required": false,
104
- "role": "portable_media_action",
105
- "description": "Analyze exact saved layer images."
106
- },
107
- "renderAction": {
108
- "type": "approval",
109
- "required": false,
110
- "role": "portable_media_action",
111
- "description": "Render composed scenes."
112
- },
113
- "qualityReport": {
114
- "type": "metadata",
115
- "required": false
116
- }
117
- },
118
- "permissions": {
119
- "project": [
120
- "context.animation.read",
121
- "workspace.animation.propose"
122
- ],
123
- "network": [],
124
- "filesystem": [],
125
- "secrets": [],
126
- "actions": [
127
- "quality.analyze",
128
- "final.render"
129
- ]
130
- },
131
- "ui": [],
132
- "platforms": {
133
- "phone": {
134
- "supported": true
135
- },
136
- "browser": {
137
- "supported": true
138
- },
139
- "desktop": {
140
- "supported": true
141
- }
142
- }
143
- },
144
- "code": "const copy = value => JSON.parse(JSON.stringify(value));\nconst same = (left, right) => JSON.stringify(left === undefined ? null : left) === JSON.stringify(right === undefined ? null : right);\nconst source = copy(input.animation || {schemaVersion: 1, scenes: []});\nconst candidate = input.commit ? copy(input.updatedAnimation) : copy(source);\nif (input.attachGeneratedImage) {\n if (!input.generatedImage || input.generatedImage.kind !== 'image') throw new Error('Connect an approved generated image before attaching it.');\n const record = candidate.scenes.find(item => item.shotId === input.targetShotId);\n const layer = record && Array.isArray(record.scene && record.scene.layers) ? record.scene.layers.find(item => item.id === input.targetLayerId) : null;\n if (!layer) throw new Error('Choose an existing scene layer for the connected image.');\n layer.asset = copy(input.generatedImage);\n layer.src = input.generatedImage.url;\n}\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1 || !Array.isArray(candidate.scenes) || candidate.scenes.length > 2000) {\n throw new Error('Keep the complete version 1 Animated Scene document with up to 2,000 scenes.');\n}\nif (candidate.scenes.length !== source.scenes.length || !candidate.scenes.every((record, index) => {\n const previous = source.scenes[index];\n return record && previous && typeof record === 'object' && !Array.isArray(record) && record.shotId === previous.shotId && same(record.start, previous.start) && same(record.end, previous.end) && same(record.voiceoverText, previous.voiceoverText);\n})) throw new Error('Keep every shot ID, narration line, and narration timing unchanged. Edit the shot plan in Shots.');\nif (!candidate.scenes.every(record => record.scene && typeof record.scene === 'object' && !Array.isArray(record.scene) && (!record.scene.layers || Array.isArray(record.scene.layers) && record.scene.layers.length <= 1000 && record.scene.layers.every(layer => layer && typeof layer === 'object' && !Array.isArray(layer))) && (record.scene.durationMs === undefined || Number.isFinite(record.scene.durationMs) && record.scene.durationMs > 0 && record.scene.durationMs <= 86400000))) {\n throw new Error('Each animated scene needs valid scene data, duration, and up to 1,000 layers.');\n}\nconst itemEnd=item=>Math.max(0,Number(item.start)||0)+Math.max(.001,Number(item.duration)||Number(item.durationMs)/1000||.001);\nconst outputs={animation:candidate,edit:{schemaVersion:1,title:`Update Animated Scene (${candidate.scenes.length} scenes)`,field:'animation',before:source,after:candidate}};const images=candidate.scenes.flatMap(record=>(record.scene?.layers||[]).map(layer=>layer.asset)).filter(image=>image&&image.kind==='image'&&image.assetId&&image.versionId&&image.url).slice(0,16);\nif(input.action==='quality'&&images.length)outputs.qualityAction={schemaVersion:1,kind:'stillmade.media-action',operation:'quality.analyze',request:{assets:images.map(({assetId,versionId,url})=>({kind:'image',assetId,versionId,url}))},resultPort:'qualityReport'};\nif(input.action==='render'){const clips=candidate.scenes.map((record,index)=>({id:record.shotId||'scene-'+index,start:Number(record.start)||0,duration:Math.max(.001,Number(record.end)-Number(record.start)||Number(record.scene?.durationMs)/1000||1),scene:record.scene})),targetDuration=Math.max(.001,...clips.map(itemEnd));outputs.renderAction={schemaVersion:1,kind:'stillmade.media-action',operation:'final.render',request:{schemaVersion:1,kind:'video',timeline:{schemaVersion:1,activeTimelineId:'animation',clips,audio:[],overlays:[],targetDuration},settings:{fps:30,resolution:1080,quality:'high'},source:{id:'sm.animated-scene',version:'2.2.0'}},resultPort:null};}\nreturn outputs;\n",
145
- "view": {
146
- "html": "<main class=\"animation-workspace\">\n <header><div><small>Production workspace</small><h1>Animated Scene</h1><p id=\"summary\">Loading scenes…</p></div><div class=\"actions\"><button id=\"reset\" type=\"button\" class=\"secondary\">Reset changes</button><button id=\"save\" type=\"button\">Review changes</button></div></header>\n <output id=\"status\" role=\"status\" aria-live=\"polite\"></output>\n <section><div class=\"section-title\"><h2>Connected generated image</h2></div><div id=\"handoff\"></div></section>\n <section id=\"scenes\" class=\"scenes\" aria-label=\"Animated scenes\"></section>\n <details><summary>Complete Animated Scene data</summary><p>Every engine field, asset reference, camera value, transition, version, and custom field is retained. Shot IDs, narration, and narration timing must stay unchanged.</p><textarea id=\"raw\" class=\"raw\" spellcheck=\"false\"></textarea><button id=\"applyRaw\" type=\"button\" class=\"secondary\">Apply JSON to workspace</button></details>\n<section><h2>Quality and delivery</h2><div class=\"actions\"><button id=\"qualityReview\" type=\"button\" class=\"secondary\">Review asset quality</button><button id=\"renderFinal\" type=\"button\">Render final video</button></div></section></main>\n",
147
- "css": ".animation-workspace{max-width:1120px;margin:0 auto;padding:8px;color:var(--fg)}header,.actions,.card-head,.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}header{justify-content:space-between;margin-bottom:14px}header h1{margin:2px 0}header p,header small,details p,output,.spine{color:var(--fg-muted)}.scenes{display:grid;gap:12px}.card,details{padding:16px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg-elev-1)}.card-head{justify-content:space-between}.card h2{margin:0;font-size:18px}.layers{display:grid;gap:8px;margin-top:12px}.layer{padding:10px;border:1px solid var(--border-tok);border-radius:var(--r-2);background:var(--bg)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}label{display:grid;gap:5px;margin:8px 0;font-size:13px;font-weight:600}input,textarea{width:100%;background:var(--bg)}textarea{min-height:76px;resize:vertical}.wide{grid-column:1/-1}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}.raw{min-height:400px;font-family:var(--font-mono);font-size:12px}output{display:block;min-height:24px;margin:8px 2px}\n@media(max-width:820px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.animation-workspace{padding:0}.grid{grid-template-columns:1fr}.actions{width:100%}.actions button{flex:1}.card,details{padding:12px}}\n",
148
- "javascript": "const status=document.getElementById('status'),summary=document.getElementById('summary'),raw=document.getElementById('raw'),save=document.getElementById('save');\nlet source={schemaVersion:1,scenes:[]},draft={schemaVersion:1,scenes:[]},connectedImage=null,busy=false,revision=0;\nconst clone=value=>JSON.parse(JSON.stringify(value));\nconst text=value=>value===undefined||value===null?'':String(value);\nconst field=(label,action,value,type='text',wide=false)=>({tag:'label',className:wide?'wide':'',children:[{tag:'span',text:label},{tag:'input',type,action,value:Number.isFinite(value)?value:text(value),disabled:busy,label}]});\nconst layerCard=(layer,sceneIndex,layerIndex)=>({tag:'article',className:'layer',children:[{tag:'div',className:'card-head',children:[{tag:'strong',text:text(layer.label)||text(layer.id)||'Layer '+String(layerIndex+1)},{tag:'div',className:'row',children:[connectedImage?{tag:'button',action:'attach-image:'+String(sceneIndex)+':'+String(layerIndex),text:'Use connected image',className:'secondary',disabled:busy}:null,{tag:'button',action:'remove-layer:'+String(sceneIndex)+':'+String(layerIndex),text:'Remove',className:'danger',disabled:busy}].filter(Boolean)}]},{tag:'div',className:'grid',children:[field('Layer ID','layer-id:'+String(sceneIndex)+':'+String(layerIndex),layer.id),field('Label','layer-label:'+String(sceneIndex)+':'+String(layerIndex),layer.label),field('Depth','layer-depth:'+String(sceneIndex)+':'+String(layerIndex),layer.depth,'number'),field('X','layer-x:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.x,'number'),field('Y','layer-y:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.y,'number'),field('Scale','layer-scale:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.scale,'number'),field('Rotation','layer-rotation:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.rot,'number'),field('Appears (ms)','layer-appear:'+String(sceneIndex)+':'+String(layerIndex),layer.appearMs,'number'),field('Leaves (ms)','layer-leave:'+String(sceneIndex)+':'+String(layerIndex),layer.leaveMs,'number')]}]});\nconst sceneCard=(record,index)=>{const scene=record.scene||{},layers=Array.isArray(scene.layers)?scene.layers:[];return {tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h2',text:'Scene '+String(index+1)+' · '+text(record.shotId)},{tag:'button',action:'add-layer:'+String(index),text:'Add layer',className:'secondary',disabled:busy}]},{tag:'p',className:'spine',text:text(record.start)+' → '+text(record.end)+' · '+text(record.voiceoverText)},{tag:'div',className:'grid',children:[field('Title','scene-title:'+String(index),scene.title),field('Aspect','scene-aspect:'+String(index),scene.aspect),field('Duration (ms)','scene-duration:'+String(index),scene.durationMs,'number')]},{tag:'div',className:'layers',children:layers.length?layers.map((layer,layerIndex)=>layerCard(layer,index,layerIndex)):[{tag:'p',text:'No layers in this scene.'}]},{tag:'p',className:'spine',text:Array.isArray(record.versions)?String(record.versions.length)+' retained version'+(record.versions.length===1?'':'s'):''}]}};\nconst ensure=()=>{if(!draft||Array.isArray(draft)||draft.schemaVersion!==1)draft={schemaVersion:1,scenes:[]};if(!Array.isArray(draft.scenes))draft.scenes=[]};\nconst draw=()=>{ensure();StillMade.render('handoff',connectedImage?[{tag:'p',className:'hint',text:'Ready: '+text(connectedImage.assetId)+' · version '+text(connectedImage.versionId)},{tag:'p',className:'hint',text:'Choose Use connected image on a scene layer.'}]:[{tag:'p',className:'hint',text:'Connect the output of Generate image to attach an approved stored result. Provider credentials and charging stay outside this Block.'}]);StillMade.render('scenes',draft.scenes.length?draft.scenes.map(sceneCard):[{tag:'p',text:'No composed scenes yet. Build scenes from the Shots Step first.'}]);raw.value=JSON.stringify(draft,null,2);summary.textContent=String(draft.scenes.length)+' composed scene'+(draft.scenes.length===1?'':'s');save.disabled=busy;document.getElementById('reset').disabled=busy};\nconst changed=()=>{revision+=1;raw.value=JSON.stringify(draft,null,2);status.textContent='Changes are local until you choose Review changes.'};\nStillMade.onAction(event=>{if(busy)return;ensure();const parts=event.action.split(':'),kind=parts[0],sceneIndex=Number(parts[1]),layerIndex=Number(parts[2]),record=draft.scenes.find((item,position)=>position===sceneIndex),scene=record&&record.scene,layer=scene&&Array.isArray(scene.layers)?scene.layers.find((item,position)=>position===layerIndex):null;if(!scene)return;\n if(kind==='add-layer'){if(!Array.isArray(scene.layers))scene.layers=[];scene.layers=[...scene.layers,{id:'portable-layer-'+String(scene.layers.length+1)+'-'+String(revision+1),label:'New layer',params:{},transform:{x:0.5,y:0.5,scale:1,rot:0},depth:0.5,z:scene.layers.length+1}];changed();draw();return}if(kind==='remove-layer'&&layer){scene.layers=scene.layers.filter((item,position)=>position!==layerIndex);changed();draw();return}\n if(kind==='attach-image'&&layer&&connectedImage){layer.asset=clone(connectedImage);layer.src=connectedImage.url;changed();draw();status.textContent='Connected image attached with its exact asset and version identity.';return}\n if(kind==='scene-title')scene.title=event.value;if(kind==='scene-aspect')scene.aspect=event.value;if(kind==='scene-duration')scene.durationMs=Math.max(1,Number(event.value)||1);\n if(layer){if(kind==='layer-id')layer.id=event.value;if(kind==='layer-label')layer.label=event.value;if(kind==='layer-depth')layer.depth=Number(event.value);if(kind==='layer-appear')layer.appearMs=Math.max(0,Number(event.value)||0);if(kind==='layer-leave')layer.leaveMs=event.value===''?null:Math.max(0,Number(event.value)||0);if(!layer.transform||Array.isArray(layer.transform))layer.transform={x:0.5,y:0.5,scale:1,rot:0};if(kind==='layer-x')layer.transform.x=Number(event.value);if(kind==='layer-y')layer.transform.y=Number(event.value);if(kind==='layer-scale')layer.transform.scale=Number(event.value);if(kind==='layer-rotation')layer.transform.rot=Number(event.value)}changed()});\ndocument.getElementById('applyRaw').addEventListener('click',()=>{if(busy)return;try{const value=JSON.parse(raw.value);if(!value||Array.isArray(value)||value.schemaVersion!==1||!Array.isArray(value.scenes))throw Error('Animated Scene JSON must be a version 1 object with scenes.');draft=clone(value);changed();draw();status.textContent='Complete Animated Scene data applied locally. Shot and narration fields will be checked before review.'}catch(error){status.textContent=error.message}});\ndocument.getElementById('reset').addEventListener('click',()=>{if(!busy){draft=clone(source);revision+=1;draw();status.textContent='Changes reset to the current Animated Scene document.'}});\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking scenes and the narration spine…';try{const result=await StillMade.run({animation:source,updatedAnimation:draft,commit:true});draft=clone(result.animation);if(started===revision)status.textContent='Animated Scene changes are ready below. Review the before and after, then choose Apply.'}catch(error){status.textContent=error.message||'Animated Scene changes could not be prepared.'}finally{busy=false;draw()}});\nStillMade.onInput(values=>{source=clone(values.animation||{schemaVersion:1,scenes:[]});draft=clone(source);connectedImage=values.generatedImage?clone(values.generatedImage):null;revision+=1;draw();status.textContent='Edit scene composition and layers. Shot IDs, narration, timing, assets, versions, and custom fields are retained.'});\n\nconst mediaAction=async action=>{if(busy)return;busy=true;draw();try{await StillMade.run({animation:source,updatedAnimation:draft,commit:false,action});status.textContent='The approved action is ready below.'}catch(error){status.textContent=error.message||'The media action could not be prepared.'}finally{busy=false;draw()}};document.getElementById('qualityReview').addEventListener('click',()=>mediaAction('quality'));document.getElementById('renderFinal').addEventListener('click',()=>mediaAction('render'));\n"
149
- },
150
- "tests": [
151
- {
152
- "name": "Retain the complete Animated Scene document",
153
- "input": {
154
- "animation": {
155
- "schemaVersion": 1,
156
- "scenes": [
157
- {
158
- "shotId": "shot-1",
159
- "start": 0,
160
- "end": 4,
161
- "voiceoverText": "Keep narration",
162
- "scene": {
163
- "title": "Opening",
164
- "durationMs": 4000,
165
- "aspect": "16:9",
166
- "layers": [
167
- {
168
- "id": "hero",
169
- "label": "Hero",
170
- "asset": {
171
- "assetId": "asset-1",
172
- "versionId": "v2"
173
- },
174
- "transform": {
175
- "x": 0.5,
176
- "y": 0.6,
177
- "scale": 1,
178
- "rot": 0
179
- },
180
- "custom": {
181
- "keep": true
182
- }
183
- }
184
- ]
185
- },
186
- "versions": [
187
- {
188
- "label": "Original",
189
- "scene": {
190
- "durationMs": 4000
191
- }
192
- }
193
- ]
194
- }
195
- ]
196
- },
197
- "updatedAnimation": {
198
- "schemaVersion": 1,
199
- "scenes": []
200
- },
201
- "commit": false
202
- },
203
- "expected": {
204
- "animation": {
205
- "schemaVersion": 1,
206
- "scenes": [
207
- {
208
- "shotId": "shot-1",
209
- "start": 0,
210
- "end": 4,
211
- "voiceoverText": "Keep narration",
212
- "scene": {
213
- "title": "Opening",
214
- "durationMs": 4000,
215
- "aspect": "16:9",
216
- "layers": [
217
- {
218
- "id": "hero",
219
- "label": "Hero",
220
- "asset": {
221
- "assetId": "asset-1",
222
- "versionId": "v2"
223
- },
224
- "transform": {
225
- "x": 0.5,
226
- "y": 0.6,
227
- "scale": 1,
228
- "rot": 0
229
- },
230
- "custom": {
231
- "keep": true
232
- }
233
- }
234
- ]
235
- },
236
- "versions": [
237
- {
238
- "label": "Original",
239
- "scene": {
240
- "durationMs": 4000
241
- }
242
- }
243
- ]
244
- }
245
- ]
246
- },
247
- "edit": {
248
- "schemaVersion": 1,
249
- "title": "Update 1 animated scene",
250
- "field": "animation",
251
- "before": {
252
- "schemaVersion": 1,
253
- "scenes": [
254
- {
255
- "shotId": "shot-1",
256
- "start": 0,
257
- "end": 4,
258
- "voiceoverText": "Keep narration",
259
- "scene": {
260
- "title": "Opening",
261
- "durationMs": 4000,
262
- "aspect": "16:9",
263
- "layers": [
264
- {
265
- "id": "hero",
266
- "label": "Hero",
267
- "asset": {
268
- "assetId": "asset-1",
269
- "versionId": "v2"
270
- },
271
- "transform": {
272
- "x": 0.5,
273
- "y": 0.6,
274
- "scale": 1,
275
- "rot": 0
276
- },
277
- "custom": {
278
- "keep": true
279
- }
280
- }
281
- ]
282
- },
283
- "versions": [
284
- {
285
- "label": "Original",
286
- "scene": {
287
- "durationMs": 4000
288
- }
289
- }
290
- ]
291
- }
292
- ]
293
- },
294
- "after": {
295
- "schemaVersion": 1,
296
- "scenes": [
297
- {
298
- "shotId": "shot-1",
299
- "start": 0,
300
- "end": 4,
301
- "voiceoverText": "Keep narration",
302
- "scene": {
303
- "title": "Opening",
304
- "durationMs": 4000,
305
- "aspect": "16:9",
306
- "layers": [
307
- {
308
- "id": "hero",
309
- "label": "Hero",
310
- "asset": {
311
- "assetId": "asset-1",
312
- "versionId": "v2"
313
- },
314
- "transform": {
315
- "x": 0.5,
316
- "y": 0.6,
317
- "scale": 1,
318
- "rot": 0
319
- },
320
- "custom": {
321
- "keep": true
322
- }
323
- }
324
- ]
325
- },
326
- "versions": [
327
- {
328
- "label": "Original",
329
- "scene": {
330
- "durationMs": 4000
331
- }
332
- }
333
- ]
334
- }
335
- ]
336
- }
337
- }
338
- }
339
- },
340
- {
341
- "name": "Prepare one exact Animated Scene update",
342
- "input": {
343
- "animation": {
344
- "schemaVersion": 1,
345
- "scenes": [
346
- {
347
- "shotId": "shot-1",
348
- "start": 0,
349
- "end": 4,
350
- "voiceoverText": "Keep narration",
351
- "scene": {
352
- "title": "Opening",
353
- "durationMs": 4000,
354
- "layers": [
355
- {
356
- "id": "hero",
357
- "label": "Hero",
358
- "depth": 0.6,
359
- "transform": {
360
- "x": 0.5,
361
- "y": 0.5,
362
- "scale": 1,
363
- "rot": 0
364
- }
365
- }
366
- ]
367
- }
368
- }
369
- ]
370
- },
371
- "updatedAnimation": {
372
- "schemaVersion": 1,
373
- "scenes": [
374
- {
375
- "shotId": "shot-1",
376
- "start": 0,
377
- "end": 4,
378
- "voiceoverText": "Keep narration",
379
- "scene": {
380
- "title": "Closer opening",
381
- "durationMs": 4000,
382
- "layers": [
383
- {
384
- "id": "hero",
385
- "label": "Hero close",
386
- "depth": 0.7,
387
- "transform": {
388
- "x": 0.55,
389
- "y": 0.5,
390
- "scale": 1.2,
391
- "rot": 0
392
- }
393
- }
394
- ]
395
- }
396
- }
397
- ]
398
- },
399
- "commit": true
400
- },
401
- "expected": {
402
- "animation": {
403
- "schemaVersion": 1,
404
- "scenes": [
405
- {
406
- "shotId": "shot-1",
407
- "start": 0,
408
- "end": 4,
409
- "voiceoverText": "Keep narration",
410
- "scene": {
411
- "title": "Closer opening",
412
- "durationMs": 4000,
413
- "layers": [
414
- {
415
- "id": "hero",
416
- "label": "Hero close",
417
- "depth": 0.7,
418
- "transform": {
419
- "x": 0.55,
420
- "y": 0.5,
421
- "scale": 1.2,
422
- "rot": 0
423
- }
424
- }
425
- ]
426
- }
427
- }
428
- ]
429
- },
430
- "edit": {
431
- "schemaVersion": 1,
432
- "title": "Update 1 animated scene",
433
- "field": "animation",
434
- "before": {
435
- "schemaVersion": 1,
436
- "scenes": [
437
- {
438
- "shotId": "shot-1",
439
- "start": 0,
440
- "end": 4,
441
- "voiceoverText": "Keep narration",
442
- "scene": {
443
- "title": "Opening",
444
- "durationMs": 4000,
445
- "layers": [
446
- {
447
- "id": "hero",
448
- "label": "Hero",
449
- "depth": 0.6,
450
- "transform": {
451
- "x": 0.5,
452
- "y": 0.5,
453
- "scale": 1,
454
- "rot": 0
455
- }
456
- }
457
- ]
458
- }
459
- }
460
- ]
461
- },
462
- "after": {
463
- "schemaVersion": 1,
464
- "scenes": [
465
- {
466
- "shotId": "shot-1",
467
- "start": 0,
468
- "end": 4,
469
- "voiceoverText": "Keep narration",
470
- "scene": {
471
- "title": "Closer opening",
472
- "durationMs": 4000,
473
- "layers": [
474
- {
475
- "id": "hero",
476
- "label": "Hero close",
477
- "depth": 0.7,
478
- "transform": {
479
- "x": 0.55,
480
- "y": 0.5,
481
- "scale": 1.2,
482
- "rot": 0
483
- }
484
- }
485
- ]
486
- }
487
- }
488
- ]
489
- }
490
- }
491
- }
492
- }
493
- ],
494
- "portable": {
495
- "format": "stillmade-block/1",
496
- "dependencies": [],
497
- "sources": [
498
- {
499
- "kind": "original",
500
- "license": "MIT",
501
- "paths": [
502
- "LICENSE",
503
- "src/run.js",
504
- "src/view.json"
505
- ],
506
- "evidence": [
507
- "upstream/0/LICENSE",
508
- "upstream/0/src/run.js",
509
- "upstream/0/src/view.json"
510
- ],
511
- "changes": "Original implementation declared by the packager; no reused repository or dependency code."
512
- }
513
- ],
514
- "files": {
515
- "upstream/0/LICENSE": "MIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
516
- "upstream/0/src/run.js": "const copy = value => JSON.parse(JSON.stringify(value));\nconst same = (left, right) => JSON.stringify(left === undefined ? null : left) === JSON.stringify(right === undefined ? null : right);\nconst source = copy(input.animation || {schemaVersion: 1, scenes: []});\nconst candidate = input.commit ? copy(input.updatedAnimation) : copy(source);\nif (input.attachGeneratedImage) {\n if (!input.generatedImage || input.generatedImage.kind !== 'image') throw new Error('Connect an approved generated image before attaching it.');\n const record = candidate.scenes.find(item => item.shotId === input.targetShotId);\n const layer = record && Array.isArray(record.scene && record.scene.layers) ? record.scene.layers.find(item => item.id === input.targetLayerId) : null;\n if (!layer) throw new Error('Choose an existing scene layer for the connected image.');\n layer.asset = copy(input.generatedImage);\n layer.src = input.generatedImage.url;\n}\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1 || !Array.isArray(candidate.scenes) || candidate.scenes.length > 2000) {\n throw new Error('Keep the complete version 1 Animated Scene document with up to 2,000 scenes.');\n}\nif (candidate.scenes.length !== source.scenes.length || !candidate.scenes.every((record, index) => {\n const previous = source.scenes[index];\n return record && previous && typeof record === 'object' && !Array.isArray(record) && record.shotId === previous.shotId && same(record.start, previous.start) && same(record.end, previous.end) && same(record.voiceoverText, previous.voiceoverText);\n})) throw new Error('Keep every shot ID, narration line, and narration timing unchanged. Edit the shot plan in Shots.');\nif (!candidate.scenes.every(record => record.scene && typeof record.scene === 'object' && !Array.isArray(record.scene) && (!record.scene.layers || Array.isArray(record.scene.layers) && record.scene.layers.length <= 1000 && record.scene.layers.every(layer => layer && typeof layer === 'object' && !Array.isArray(layer))) && (record.scene.durationMs === undefined || Number.isFinite(record.scene.durationMs) && record.scene.durationMs > 0 && record.scene.durationMs <= 86400000))) {\n throw new Error('Each animated scene needs valid scene data, duration, and up to 1,000 layers.');\n}\nconst itemEnd=item=>Math.max(0,Number(item.start)||0)+Math.max(.001,Number(item.duration)||Number(item.durationMs)/1000||.001);\nconst outputs={animation:candidate,edit:{schemaVersion:1,title:`Update Animated Scene (${candidate.scenes.length} scenes)`,field:'animation',before:source,after:candidate}};const images=candidate.scenes.flatMap(record=>(record.scene?.layers||[]).map(layer=>layer.asset)).filter(image=>image&&image.kind==='image'&&image.assetId&&image.versionId&&image.url).slice(0,16);\nif(input.action==='quality'&&images.length)outputs.qualityAction={schemaVersion:1,kind:'stillmade.media-action',operation:'quality.analyze',request:{assets:images.map(({assetId,versionId,url})=>({kind:'image',assetId,versionId,url}))},resultPort:'qualityReport'};\nif(input.action==='render'){const clips=candidate.scenes.map((record,index)=>({id:record.shotId||'scene-'+index,start:Number(record.start)||0,duration:Math.max(.001,Number(record.end)-Number(record.start)||Number(record.scene?.durationMs)/1000||1),scene:record.scene})),targetDuration=Math.max(.001,...clips.map(itemEnd));outputs.renderAction={schemaVersion:1,kind:'stillmade.media-action',operation:'final.render',request:{schemaVersion:1,kind:'video',timeline:{schemaVersion:1,activeTimelineId:'animation',clips,audio:[],overlays:[],targetDuration},settings:{fps:30,resolution:1080,quality:'high'},source:{id:'sm.animated-scene',version:'2.2.0'}},resultPort:null};}\nreturn outputs;\n",
517
- "upstream/0/src/view.json": "{\n \"html\": \"<main class=\\\"animation-workspace\\\">\\n <header><div><small>Production workspace</small><h1>Animated Scene</h1><p id=\\\"summary\\\">Loading scenes…</p></div><div class=\\\"actions\\\"><button id=\\\"reset\\\" type=\\\"button\\\" class=\\\"secondary\\\">Reset changes</button><button id=\\\"save\\\" type=\\\"button\\\">Review changes</button></div></header>\\n <output id=\\\"status\\\" role=\\\"status\\\" aria-live=\\\"polite\\\"></output>\\n <section><div class=\\\"section-title\\\"><h2>Connected generated image</h2></div><div id=\\\"handoff\\\"></div></section>\\n <section id=\\\"scenes\\\" class=\\\"scenes\\\" aria-label=\\\"Animated scenes\\\"></section>\\n <details><summary>Complete Animated Scene data</summary><p>Every engine field, asset reference, camera value, transition, version, and custom field is retained. Shot IDs, narration, and narration timing must stay unchanged.</p><textarea id=\\\"raw\\\" class=\\\"raw\\\" spellcheck=\\\"false\\\"></textarea><button id=\\\"applyRaw\\\" type=\\\"button\\\" class=\\\"secondary\\\">Apply JSON to workspace</button></details>\\n<section><h2>Quality and delivery</h2><div class=\\\"actions\\\"><button id=\\\"qualityReview\\\" type=\\\"button\\\" class=\\\"secondary\\\">Review asset quality</button><button id=\\\"renderFinal\\\" type=\\\"button\\\">Render final video</button></div></section></main>\\n\",\n \"css\": \".animation-workspace{max-width:1120px;margin:0 auto;padding:8px;color:var(--fg)}header,.actions,.card-head,.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}header{justify-content:space-between;margin-bottom:14px}header h1{margin:2px 0}header p,header small,details p,output,.spine{color:var(--fg-muted)}.scenes{display:grid;gap:12px}.card,details{padding:16px;border:1px solid var(--border-tok);border-radius:var(--r-3);background:var(--bg-elev-1)}.card-head{justify-content:space-between}.card h2{margin:0;font-size:18px}.layers{display:grid;gap:8px;margin-top:12px}.layer{padding:10px;border:1px solid var(--border-tok);border-radius:var(--r-2);background:var(--bg)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}label{display:grid;gap:5px;margin:8px 0;font-size:13px;font-weight:600}input,textarea{width:100%;background:var(--bg)}textarea{min-height:76px;resize:vertical}.wide{grid-column:1/-1}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}.raw{min-height:400px;font-family:var(--font-mono);font-size:12px}output{display:block;min-height:24px;margin:8px 2px}\\n@media(max-width:820px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.animation-workspace{padding:0}.grid{grid-template-columns:1fr}.actions{width:100%}.actions button{flex:1}.card,details{padding:12px}}\\n\",\n \"javascript\": \"const status=document.getElementById('status'),summary=document.getElementById('summary'),raw=document.getElementById('raw'),save=document.getElementById('save');\\nlet source={schemaVersion:1,scenes:[]},draft={schemaVersion:1,scenes:[]},connectedImage=null,busy=false,revision=0;\\nconst clone=value=>JSON.parse(JSON.stringify(value));\\nconst text=value=>value===undefined||value===null?'':String(value);\\nconst field=(label,action,value,type='text',wide=false)=>({tag:'label',className:wide?'wide':'',children:[{tag:'span',text:label},{tag:'input',type,action,value:Number.isFinite(value)?value:text(value),disabled:busy,label}]});\\nconst layerCard=(layer,sceneIndex,layerIndex)=>({tag:'article',className:'layer',children:[{tag:'div',className:'card-head',children:[{tag:'strong',text:text(layer.label)||text(layer.id)||'Layer '+String(layerIndex+1)},{tag:'div',className:'row',children:[connectedImage?{tag:'button',action:'attach-image:'+String(sceneIndex)+':'+String(layerIndex),text:'Use connected image',className:'secondary',disabled:busy}:null,{tag:'button',action:'remove-layer:'+String(sceneIndex)+':'+String(layerIndex),text:'Remove',className:'danger',disabled:busy}].filter(Boolean)}]},{tag:'div',className:'grid',children:[field('Layer ID','layer-id:'+String(sceneIndex)+':'+String(layerIndex),layer.id),field('Label','layer-label:'+String(sceneIndex)+':'+String(layerIndex),layer.label),field('Depth','layer-depth:'+String(sceneIndex)+':'+String(layerIndex),layer.depth,'number'),field('X','layer-x:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.x,'number'),field('Y','layer-y:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.y,'number'),field('Scale','layer-scale:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.scale,'number'),field('Rotation','layer-rotation:'+String(sceneIndex)+':'+String(layerIndex),layer.transform&&layer.transform.rot,'number'),field('Appears (ms)','layer-appear:'+String(sceneIndex)+':'+String(layerIndex),layer.appearMs,'number'),field('Leaves (ms)','layer-leave:'+String(sceneIndex)+':'+String(layerIndex),layer.leaveMs,'number')]}]});\\nconst sceneCard=(record,index)=>{const scene=record.scene||{},layers=Array.isArray(scene.layers)?scene.layers:[];return {tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h2',text:'Scene '+String(index+1)+' · '+text(record.shotId)},{tag:'button',action:'add-layer:'+String(index),text:'Add layer',className:'secondary',disabled:busy}]},{tag:'p',className:'spine',text:text(record.start)+' → '+text(record.end)+' · '+text(record.voiceoverText)},{tag:'div',className:'grid',children:[field('Title','scene-title:'+String(index),scene.title),field('Aspect','scene-aspect:'+String(index),scene.aspect),field('Duration (ms)','scene-duration:'+String(index),scene.durationMs,'number')]},{tag:'div',className:'layers',children:layers.length?layers.map((layer,layerIndex)=>layerCard(layer,index,layerIndex)):[{tag:'p',text:'No layers in this scene.'}]},{tag:'p',className:'spine',text:Array.isArray(record.versions)?String(record.versions.length)+' retained version'+(record.versions.length===1?'':'s'):''}]}};\\nconst ensure=()=>{if(!draft||Array.isArray(draft)||draft.schemaVersion!==1)draft={schemaVersion:1,scenes:[]};if(!Array.isArray(draft.scenes))draft.scenes=[]};\\nconst draw=()=>{ensure();StillMade.render('handoff',connectedImage?[{tag:'p',className:'hint',text:'Ready: '+text(connectedImage.assetId)+' · version '+text(connectedImage.versionId)},{tag:'p',className:'hint',text:'Choose Use connected image on a scene layer.'}]:[{tag:'p',className:'hint',text:'Connect the output of Generate image to attach an approved stored result. Provider credentials and charging stay outside this Block.'}]);StillMade.render('scenes',draft.scenes.length?draft.scenes.map(sceneCard):[{tag:'p',text:'No composed scenes yet. Build scenes from the Shots Step first.'}]);raw.value=JSON.stringify(draft,null,2);summary.textContent=String(draft.scenes.length)+' composed scene'+(draft.scenes.length===1?'':'s');save.disabled=busy;document.getElementById('reset').disabled=busy};\\nconst changed=()=>{revision+=1;raw.value=JSON.stringify(draft,null,2);status.textContent='Changes are local until you choose Review changes.'};\\nStillMade.onAction(event=>{if(busy)return;ensure();const parts=event.action.split(':'),kind=parts[0],sceneIndex=Number(parts[1]),layerIndex=Number(parts[2]),record=draft.scenes.find((item,position)=>position===sceneIndex),scene=record&&record.scene,layer=scene&&Array.isArray(scene.layers)?scene.layers.find((item,position)=>position===layerIndex):null;if(!scene)return;\\n if(kind==='add-layer'){if(!Array.isArray(scene.layers))scene.layers=[];scene.layers=[...scene.layers,{id:'portable-layer-'+String(scene.layers.length+1)+'-'+String(revision+1),label:'New layer',params:{},transform:{x:0.5,y:0.5,scale:1,rot:0},depth:0.5,z:scene.layers.length+1}];changed();draw();return}if(kind==='remove-layer'&&layer){scene.layers=scene.layers.filter((item,position)=>position!==layerIndex);changed();draw();return}\\n if(kind==='attach-image'&&layer&&connectedImage){layer.asset=clone(connectedImage);layer.src=connectedImage.url;changed();draw();status.textContent='Connected image attached with its exact asset and version identity.';return}\\n if(kind==='scene-title')scene.title=event.value;if(kind==='scene-aspect')scene.aspect=event.value;if(kind==='scene-duration')scene.durationMs=Math.max(1,Number(event.value)||1);\\n if(layer){if(kind==='layer-id')layer.id=event.value;if(kind==='layer-label')layer.label=event.value;if(kind==='layer-depth')layer.depth=Number(event.value);if(kind==='layer-appear')layer.appearMs=Math.max(0,Number(event.value)||0);if(kind==='layer-leave')layer.leaveMs=event.value===''?null:Math.max(0,Number(event.value)||0);if(!layer.transform||Array.isArray(layer.transform))layer.transform={x:0.5,y:0.5,scale:1,rot:0};if(kind==='layer-x')layer.transform.x=Number(event.value);if(kind==='layer-y')layer.transform.y=Number(event.value);if(kind==='layer-scale')layer.transform.scale=Number(event.value);if(kind==='layer-rotation')layer.transform.rot=Number(event.value)}changed()});\\ndocument.getElementById('applyRaw').addEventListener('click',()=>{if(busy)return;try{const value=JSON.parse(raw.value);if(!value||Array.isArray(value)||value.schemaVersion!==1||!Array.isArray(value.scenes))throw Error('Animated Scene JSON must be a version 1 object with scenes.');draft=clone(value);changed();draw();status.textContent='Complete Animated Scene data applied locally. Shot and narration fields will be checked before review.'}catch(error){status.textContent=error.message}});\\ndocument.getElementById('reset').addEventListener('click',()=>{if(!busy){draft=clone(source);revision+=1;draw();status.textContent='Changes reset to the current Animated Scene document.'}});\\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking scenes and the narration spine…';try{const result=await StillMade.run({animation:source,updatedAnimation:draft,commit:true});draft=clone(result.animation);if(started===revision)status.textContent='Animated Scene changes are ready below. Review the before and after, then choose Apply.'}catch(error){status.textContent=error.message||'Animated Scene changes could not be prepared.'}finally{busy=false;draw()}});\\nStillMade.onInput(values=>{source=clone(values.animation||{schemaVersion:1,scenes:[]});draft=clone(source);connectedImage=values.generatedImage?clone(values.generatedImage):null;revision+=1;draw();status.textContent='Edit scene composition and layers. Shot IDs, narration, timing, assets, versions, and custom fields are retained.'});\\n\\nconst mediaAction=async action=>{if(busy)return;busy=true;draw();try{await StillMade.run({animation:source,updatedAnimation:draft,commit:false,action});status.textContent='The approved action is ready below.'}catch(error){status.textContent=error.message||'The media action could not be prepared.'}finally{busy=false;draw()}};document.getElementById('qualityReview').addEventListener('click',()=>mediaAction('quality'));document.getElementById('renderFinal').addEventListener('click',()=>mediaAction('render'));\\n\"\n}"
518
- },
519
- "lineage": {
520
- "parents": [],
521
- "changes": "Packaged original Block source for StillMade."
522
- }
523
- }
524
- };