stillmade-sdk 0.1.41 → 0.1.43

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 (285) hide show
  1. package/.stillmade/sdk-baseline.json +19 -21
  2. package/AGENTS.md +17 -12
  3. package/FRAME_VIEWS.md +113 -0
  4. package/INTERFACE_DESIGN.md +67 -22
  5. package/MOBILE_UI.md +4 -2
  6. package/MODULES.md +152 -6
  7. package/PASTE_TO_LLM.md +42 -32
  8. package/README.md +3 -2
  9. package/SDK.md +1028 -563
  10. package/UI_AESTHETIC.md +30 -3
  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 +8 -1
  108. package/examples/clean-text.stillmade.json +4 -0
  109. package/examples/custom-interface.stillmade.json +4 -0
  110. package/examples/describe-image.stillmade.json +4 -0
  111. package/examples/foley-cue.stillmade.json +4 -0
  112. package/examples/generate-image.stillmade.json +4 -0
  113. package/examples/generate-video.stillmade.json +10 -2
  114. package/examples/module-word-stats/stillmade.block.json +4 -0
  115. package/examples/narrate-script.stillmade.json +4 -0
  116. package/examples/numbered-takes.stillmade.json +4 -0
  117. package/examples/research-topic.stillmade.json +9 -1
  118. package/examples/score-a-scene.stillmade.json +4 -0
  119. package/examples/script-draft.stillmade.json +4 -0
  120. package/examples/summarize-page.stillmade.json +4 -0
  121. package/examples/text-workflow.stillmade.json +7 -32
  122. package/examples/thicken-lines.stillmade.json +4 -0
  123. package/examples/timeline-polish.stillmade.json +15 -3
  124. package/examples/transcribe-audio.stillmade.json +15 -3
  125. package/examples/word-count.stillmade.json +4 -0
  126. package/package.json +1 -1
  127. package/packages/block-cli/cli.js +13 -6
  128. package/packages/block-cli/dev-host/assets/host.js +81 -38
  129. package/packages/block-cli/dev-host/assets/index.css +1 -1
  130. package/packages/block-cli/format.js +1 -1
  131. package/packages/block-cli/ready-gate.js +4 -0
  132. package/packages/block-cli/templates.js +37 -19
  133. package/packages/block-cli/type-packages.js +119 -0
  134. package/packages/block-platform/block-readiness.js +8 -1
  135. package/packages/block-platform/canvas.js +2 -1
  136. package/packages/block-platform/catalog.js +27 -48
  137. package/packages/block-platform/native-host-inventory.js +0 -226
  138. package/packages/block-platform/plain-descriptions.js +1 -25
  139. package/packages/block-platform/project-type-starters.js +13 -53
  140. package/packages/block-platform/script-handoff.js +2 -4
  141. package/packages/block-platform/type-workspace.js +2 -0
  142. package/packages/block-sdk/appearance.js +3 -1
  143. package/packages/block-sdk/audio-generation-example.js +2 -2
  144. package/packages/block-sdk/block-tier.js +1 -1
  145. package/packages/block-sdk/builder-contract.js +13 -11
  146. package/packages/block-sdk/capabilities.js +1 -1
  147. package/packages/block-sdk/capability-example.js +1 -1
  148. package/packages/block-sdk/contracts.js +6 -2
  149. package/packages/block-sdk/examples.js +3 -3
  150. package/packages/block-sdk/first-party-identities.js +1 -84
  151. package/packages/block-sdk/first-party-packages.js +3 -85
  152. package/packages/block-sdk/generation-catalog.js +15 -3
  153. package/packages/block-sdk/image-description-example.js +1 -1
  154. package/packages/block-sdk/image-generation-example.js +1 -1
  155. package/packages/block-sdk/index.d.ts +2 -1
  156. package/packages/block-sdk/media-analysis-example.js +2 -2
  157. package/packages/block-sdk/mock-host.js +7 -1
  158. package/packages/block-sdk/module-example.js +1 -1
  159. package/packages/block-sdk/module-host-calls.js +35 -10
  160. package/packages/block-sdk/module-hosted.js +15 -2
  161. package/packages/block-sdk/module-media-access.js +71 -0
  162. package/packages/block-sdk/module-node.js +1 -1
  163. package/packages/block-sdk/portable-media-actions.js +1 -1
  164. package/packages/block-sdk/runtime.js +1 -1
  165. package/packages/block-sdk/speech-example.js +1 -1
  166. package/packages/block-sdk/state-example.js +1 -1
  167. package/packages/block-sdk/timeline-proposal-example.js +1 -1
  168. package/packages/block-sdk/transcription-example.js +1 -1
  169. package/packages/block-sdk/trigger-examples.js +2 -2
  170. package/packages/block-sdk/video-generation-example.js +1 -1
  171. package/packages/block-sdk/view-bridge.js +4 -1
  172. package/packages/block-sdk/view-design.js +44 -15
  173. package/packages/block-sdk/web-example.js +2 -2
  174. package/packages/design-system/block-kit.css +53 -12
  175. package/packages/design-system/block-kit.html +3 -2
  176. package/blocks/mcp-motion-planner/versions/1.1.0/package.js +0 -97
  177. package/blocks/motion-designer/versions/1.0.1/package.js +0 -173318
  178. package/blocks/motion-designer/versions/1.0.2/package.js +0 -173318
  179. package/blocks/motion-frame-review/versions/1.1.1/package.js +0 -465
  180. package/blocks/motion-frame-review/versions/1.1.2/package.snapshot.js +0 -572
  181. package/blocks/narration/package.js +0 -1
  182. package/blocks/narration/versions/1.0.0/package.js +0 -221
  183. package/blocks/narration/versions/1.0.1/package.js +0 -221
  184. package/blocks/native/sm.animated-scene/versions/2.0.0/package.js +0 -475
  185. package/blocks/native/sm.animated-scene/versions/2.1.0/package.js +0 -498
  186. package/blocks/native/sm.animated-scene/versions/2.2.0/package.js +0 -524
  187. package/blocks/native/sm.animated-scene/versions/2.3.0/package.js +0 -618
  188. package/blocks/native/sm.animated-scene/versions/2.3.1/package.js +0 -618
  189. package/blocks/native/sm.animated-scene/versions/2.3.2/package.js +0 -723
  190. package/blocks/native/sm.animated-scene/versions/2.3.3/package.js +0 -723
  191. package/blocks/native/sm.animated-scene/versions/2.3.4/package.js +0 -676
  192. package/blocks/native/sm.animated-scene/versions/2.3.5/package.js +0 -693
  193. package/blocks/native/sm.animated-scene/versions/2.3.6/package.js +0 -700
  194. package/blocks/native/sm.animated-scene/versions/2.3.7/package.js +0 -747
  195. package/blocks/native/sm.animated-scene/versions/2.3.8/package.js +0 -769
  196. package/blocks/native/sm.animated-scene/versions/2.3.9/package.js +0 -769
  197. package/blocks/native/sm.animated-scene-assistant/versions/1.0.0/package.js +0 -183
  198. package/blocks/native/sm.blueprint/versions/2.0.0/package.js +0 -358
  199. package/blocks/native/sm.blueprint/versions/2.1.0/package.js +0 -358
  200. package/blocks/native/sm.blueprint/versions/2.1.1/package.js +0 -358
  201. package/blocks/native/sm.blueprint/versions/2.1.2/package.js +0 -358
  202. package/blocks/native/sm.blueprint/versions/2.1.3/package.js +0 -381
  203. package/blocks/native/sm.blueprint/versions/2.1.4/package.js +0 -381
  204. package/blocks/native/sm.blueprint/versions/2.1.5/package.js +0 -339
  205. package/blocks/native/sm.blueprint/versions/2.1.6/package.js +0 -356
  206. package/blocks/native/sm.blueprint/versions/2.1.7/package.js +0 -363
  207. package/blocks/native/sm.blueprint/versions/2.1.8/package.js +0 -410
  208. package/blocks/native/sm.blueprint/versions/2.1.9/package.js +0 -422
  209. package/blocks/native/sm.blueprint-assistant/versions/1.0.0/package.js +0 -172
  210. package/blocks/native/sm.chat/versions/2.0.0/package.js +0 -144
  211. package/blocks/native/sm.chat/versions/2.0.1/package.js +0 -97
  212. package/blocks/native/sm.chat/versions/2.0.2/package.js +0 -100
  213. package/blocks/native/sm.chat/versions/2.0.3/package.js +0 -100
  214. package/blocks/native/sm.continue-if/versions/1.0.0/package.js +0 -168
  215. package/blocks/native/sm.describe-media/versions/2.0.0/package.js +0 -153
  216. package/blocks/native/sm.describe-media/versions/2.0.1/package.js +0 -156
  217. package/blocks/native/sm.describe-media/versions/2.1.0/package.js +0 -140
  218. package/blocks/native/sm.image-editor/versions/2.0.0/package.js +0 -183
  219. package/blocks/native/sm.image-editor/versions/2.0.1/package.js +0 -190
  220. package/blocks/native/sm.new-items/versions/1.0.0/package.js +0 -191
  221. package/blocks/native/sm.pick-photos/versions/1.0.0/package.js +0 -334
  222. package/blocks/native/sm.quality-audit/versions/1.0.0/package.js +0 -192
  223. package/blocks/native/sm.quality-audit/versions/1.0.1/package.js +0 -192
  224. package/blocks/native/sm.quality-audit/versions/1.0.2/package.js +0 -195
  225. package/blocks/native/sm.research/versions/2.0.0/package.js +0 -175
  226. package/blocks/native/sm.research/versions/2.0.1/package.js +0 -184
  227. package/blocks/native/sm.research/versions/2.0.2/package.js +0 -187
  228. package/blocks/native/sm.script/versions/2.0.0/package.js +0 -144
  229. package/blocks/native/sm.script/versions/2.1.0/package.js +0 -144
  230. package/blocks/native/sm.script/versions/2.1.1/package.js +0 -144
  231. package/blocks/native/sm.script/versions/2.1.2/package.js +0 -105
  232. package/blocks/native/sm.script/versions/2.1.3/package.js +0 -152
  233. package/blocks/native/sm.script/versions/2.1.4/package.js +0 -156
  234. package/blocks/native/sm.script/versions/2.1.5/package.js +0 -156
  235. package/blocks/native/sm.shot-plan/versions/2.0.0/package.js +0 -301
  236. package/blocks/native/sm.shot-plan/versions/2.1.0/package.js +0 -528
  237. package/blocks/native/sm.shot-plan/versions/2.1.1/package.js +0 -528
  238. package/blocks/native/sm.shot-plan/versions/2.1.2/package.js +0 -528
  239. package/blocks/native/sm.shot-plan/versions/2.1.3/package.js +0 -536
  240. package/blocks/native/sm.shot-plan/versions/2.2.0/package.js +0 -800
  241. package/blocks/native/sm.shot-plan/versions/2.2.1/package.js +0 -920
  242. package/blocks/native/sm.shot-plan-assistant/versions/1.0.0/package.js +0 -173
  243. package/blocks/native/sm.stock-search/versions/2.0.0/package.js +0 -174
  244. package/blocks/native/sm.thumbnail/versions/2.0.0/package.js +0 -137
  245. package/blocks/native/sm.thumbnail/versions/2.0.1/package.js +0 -140
  246. package/blocks/native/sm.transcribe/versions/2.0.0/package.js +0 -163
  247. package/blocks/native/sm.transcribe/versions/2.0.1/package.js +0 -168
  248. package/blocks/native/sm.whiteboard-assistant/versions/1.0.0/package.js +0 -175
  249. package/blocks/native/sm.youtube/versions/2.0.0/package.js +0 -217
  250. package/blocks/occasion-story/package.js +0 -1
  251. package/blocks/occasion-story/versions/1.0.0/package.js +0 -1658
  252. package/blocks/occasion-story/versions/1.0.1/package.js +0 -1699
  253. package/blocks/occasion-story/versions/1.0.2/package.js +0 -1682
  254. package/blocks/photo-reel-composer/versions/1.0.0/package.js +0 -3043
  255. package/blocks/photo-reel-composer/versions/1.0.1/package.js +0 -3026
  256. package/blocks/photo-reel-composer/versions/1.0.2/package.js +0 -4149
  257. package/blocks/product-ad-variants/versions/1.0.0/package.js +0 -2911
  258. package/blocks/product-launch-director/versions/1.0.0/package.js +0 -103
  259. package/blocks/release-visuals/package.js +0 -1
  260. package/blocks/release-visuals/versions/1.0.0/package.js +0 -1492
  261. package/blocks/release-visuals/versions/1.0.1/package.js +0 -1517
  262. package/blocks/release-visuals/versions/1.0.2/package.js +0 -1500
  263. package/blocks/screen-recorder/package.js +0 -1
  264. package/blocks/screen-recorder/versions/1.0.0/package.js +0 -223
  265. package/blocks/screen-recorder/versions/1.0.1/package.js +0 -223
  266. package/blocks/short-form-finish/package.js +0 -1
  267. package/blocks/short-form-finish/versions/1.0.0/package.js +0 -1043
  268. package/blocks/short-form-finish/versions/1.0.1/package.js +0 -1043
  269. package/blocks/short-form-finish/versions/1.0.2/package.js +0 -1043
  270. package/blocks/short-form-finish/versions/1.0.3/package.js +0 -1026
  271. package/examples/saas-product-launch-reviewed-source.stillmade.json +0 -383
  272. package/examples/saas-product-launch.stillmade.json +0 -304
  273. package/packages/block-platform/dealer-inventory-video-project-type.js +0 -38
  274. package/packages/block-platform/first-revenue-project-types.js +0 -46
  275. package/packages/block-platform/fixture-starters.js +0 -13
  276. package/packages/block-platform/launch-project-source.js +0 -10
  277. package/packages/block-platform/launch-project.js +0 -30
  278. package/packages/block-platform/motion-project-types.js +0 -55
  279. package/packages/block-platform/motion-starters.js +0 -14
  280. package/packages/block-platform/product-ad-variants-project-type.js +0 -30
  281. package/packages/block-platform/product-launch-updated.js +0 -90
  282. package/packages/block-platform/revenue-review-project-types.js +0 -36
  283. package/packages/block-platform/revenue-review-starters.js +0 -13
  284. package/packages/block-platform/script-writer.js +0 -29
  285. package/packages/block-platform/website-source-block.js +0 -14
@@ -1,618 +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.3.1",
8
- "name": "Animated Scene",
9
- "description": "Build editable animated-scene compositions from the current shot plan, then review layers, assets, camera and motion settings, transitions, versions, and retained custom fields without changing the 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
- "shotPlan": {
47
- "type": "shot-plan",
48
- "context": "shotPlan",
49
- "required": false,
50
- "default": {
51
- "schemaVersion": 1,
52
- "shots": []
53
- },
54
- "description": "Current reviewed Shots document used to build empty scene compositions when no animation document exists."
55
- },
56
- "updatedAnimation": {
57
- "type": "scene-document",
58
- "required": false,
59
- "default": {
60
- "schemaVersion": 1,
61
- "scenes": []
62
- },
63
- "description": "The complete edited animation prepared in this workspace."
64
- },
65
- "commit": {
66
- "type": "boolean",
67
- "default": false,
68
- "description": "Prepare the edited animation for StillMade review and Apply."
69
- },
70
- "generatedImage": {
71
- "type": "image",
72
- "imageMode": "reference",
73
- "required": false,
74
- "description": "An exact stored image version produced by an approved generation Block or selected from project media."
75
- },
76
- "targetShotId": {
77
- "type": "text",
78
- "required": false,
79
- "default": "",
80
- "description": "Shot containing the layer that receives the connected image."
81
- },
82
- "targetLayerId": {
83
- "type": "text",
84
- "required": false,
85
- "default": "",
86
- "description": "Layer that receives the connected image."
87
- },
88
- "attachGeneratedImage": {
89
- "type": "boolean",
90
- "default": false,
91
- "description": "Attach the connected image to the selected layer while preserving prior scene versions."
92
- },
93
- "action": {
94
- "type": "text",
95
- "required": false,
96
- "default": "none",
97
- "description": "The Block-owned interface selects a declared host action."
98
- }
99
- },
100
- "outputs": {
101
- "animation": {
102
- "type": "scene-document",
103
- "primary": true,
104
- "role": "animated_scene_document",
105
- "description": "The complete edited Animated Scene document for the next Step."
106
- },
107
- "edit": {
108
- "type": "workspace-edit",
109
- "description": "An exact before/after Animated Scene change reviewed before it updates the project."
110
- },
111
- "qualityAction": {
112
- "type": "approval",
113
- "required": false,
114
- "role": "portable_media_action",
115
- "description": "Analyze exact saved layer images."
116
- },
117
- "renderAction": {
118
- "type": "approval",
119
- "required": false,
120
- "role": "portable_media_action",
121
- "description": "Render composed scenes."
122
- },
123
- "qualityReport": {
124
- "type": "metadata",
125
- "required": false
126
- }
127
- },
128
- "permissions": {
129
- "project": [
130
- "context.animation.read",
131
- "context.shotPlan.read",
132
- "workspace.animation.propose"
133
- ],
134
- "network": [],
135
- "filesystem": [],
136
- "secrets": [],
137
- "actions": [
138
- "quality.analyze",
139
- "final.render"
140
- ]
141
- },
142
- "ui": [],
143
- "platforms": {
144
- "phone": {
145
- "supported": true
146
- },
147
- "browser": {
148
- "supported": true
149
- },
150
- "desktop": {
151
- "supported": true
152
- }
153
- }
154
- },
155
- "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 shots=Array.isArray(input.shotPlan?.shots)?input.shotPlan.shots:[];\nconst generated={schemaVersion:1,scenes:shots.map((shot,index)=>{const start=Number.isFinite(Number(shot.startTime))?Number(shot.startTime):Number(shot.startMs)/1000||0,end=Number.isFinite(Number(shot.endTime))?Number(shot.endTime):start+Math.max(1,Number(shot.estimatedScreenTime)||Number(shot.durationMs)/1000||4);return {shotId:String(shot.id||shot.shotId||'shot-'+String(index+1)),start,end,voiceoverText:String(shot.voiceoverText||shot.narration||shot.text||''),scene:{schemaVersion:1,title:String(shot.shotDescription||shot.description||'Scene '+String(index+1)),aspect:'16:9',durationMs:Math.max(1,Math.round((end-start)*1000)),layers:[],camera:{motion:String(shot.motionEffect||shot.cameraMotion||'Locked Frame')},transition:String(shot.transition||'cut')}}})};\nconst spine=source.scenes.length?source:generated;\nconst candidate = input.commit ? copy(input.updatedAnimation) : copy(spine);\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 !== spine.scenes.length || !candidate.scenes.every((record, index) => {\n const previous = spine.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.3.1'}},resultPort:null};}\nreturn outputs;\n",
156
- "view": {
157
- "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=\"build\" type=\"button\" class=\"secondary\">Build from Shots</button><button id=\"reset\" type=\"button\" class=\"secondary\">Reset changes</button><button id=\"save\" type=\"button\" data-stillmade-action=\"run\">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><label for=\"raw\">Complete Animated Scene JSON</label><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",
158
- "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",
159
- "javascript": "const status=document.getElementById('status'),summary=document.getElementById('summary'),raw=document.getElementById('raw'),save=document.getElementById('save'),build=document.getElementById('build');\nlet source={schemaVersion:1,scenes:[]},draft={schemaVersion:1,scenes:[]},connectedImage=null,shotPlan={schemaVersion:1,shots:[]},busy=false,revision=0;\nconst clone=value=>JSON.parse(JSON.stringify(value));\nconst text=value=>value===undefined||value===null?'':String(value);\nconst plan=()=>({schemaVersion:1,scenes:(Array.isArray(shotPlan.shots)?shotPlan.shots:[]).map((shot,index)=>{const start=Number.isFinite(Number(shot.startTime))?Number(shot.startTime):Number(shot.startMs)/1000||0,end=Number.isFinite(Number(shot.endTime))?Number(shot.endTime):start+Math.max(1,Number(shot.estimatedScreenTime)||Number(shot.durationMs)/1000||4);return {shotId:text(shot.id||shot.shotId||'shot-'+String(index+1)),start,end,voiceoverText:text(shot.voiceoverText||shot.narration||shot.text),scene:{schemaVersion:1,title:text(shot.shotDescription||shot.description||'Scene '+String(index+1)),aspect:'16:9',durationMs:Math.max(1,Math.round((end-start)*1000)),layers:[],camera:{motion:text(shot.motionEffect||shot.cameraMotion||'Locked Frame')},transition:text(shot.transition||'cut')}}})});\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;build.disabled=busy||!shotPlan.shots?.length;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()});\nbuild.addEventListener('click',()=>{if(!busy){draft=plan();changed();draw();status.textContent='Built editable scene compositions from the current Shots spine.'}});\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:[]});shotPlan=clone(values.shotPlan||{schemaVersion:1,shots:[]});draft=source.scenes?.length?clone(source):plan();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"
160
- },
161
- "tests": [
162
- {
163
- "name": "Retain the complete Animated Scene document",
164
- "input": {
165
- "animation": {
166
- "schemaVersion": 1,
167
- "scenes": [
168
- {
169
- "shotId": "shot-1",
170
- "start": 0,
171
- "end": 4,
172
- "voiceoverText": "Keep narration",
173
- "scene": {
174
- "title": "Opening",
175
- "durationMs": 4000,
176
- "aspect": "16:9",
177
- "layers": [
178
- {
179
- "id": "hero",
180
- "label": "Hero",
181
- "asset": {
182
- "assetId": "asset-1",
183
- "versionId": "v2"
184
- },
185
- "transform": {
186
- "x": 0.5,
187
- "y": 0.6,
188
- "scale": 1,
189
- "rot": 0
190
- },
191
- "custom": {
192
- "keep": true
193
- }
194
- }
195
- ]
196
- },
197
- "versions": [
198
- {
199
- "label": "Original",
200
- "scene": {
201
- "durationMs": 4000
202
- }
203
- }
204
- ]
205
- }
206
- ]
207
- },
208
- "updatedAnimation": {
209
- "schemaVersion": 1,
210
- "scenes": []
211
- },
212
- "commit": false
213
- },
214
- "expected": {
215
- "animation": {
216
- "schemaVersion": 1,
217
- "scenes": [
218
- {
219
- "shotId": "shot-1",
220
- "start": 0,
221
- "end": 4,
222
- "voiceoverText": "Keep narration",
223
- "scene": {
224
- "title": "Opening",
225
- "durationMs": 4000,
226
- "aspect": "16:9",
227
- "layers": [
228
- {
229
- "id": "hero",
230
- "label": "Hero",
231
- "asset": {
232
- "assetId": "asset-1",
233
- "versionId": "v2"
234
- },
235
- "transform": {
236
- "x": 0.5,
237
- "y": 0.6,
238
- "scale": 1,
239
- "rot": 0
240
- },
241
- "custom": {
242
- "keep": true
243
- }
244
- }
245
- ]
246
- },
247
- "versions": [
248
- {
249
- "label": "Original",
250
- "scene": {
251
- "durationMs": 4000
252
- }
253
- }
254
- ]
255
- }
256
- ]
257
- },
258
- "edit": {
259
- "schemaVersion": 1,
260
- "title": "Update Animated Scene (1 scenes)",
261
- "field": "animation",
262
- "before": {
263
- "schemaVersion": 1,
264
- "scenes": [
265
- {
266
- "shotId": "shot-1",
267
- "start": 0,
268
- "end": 4,
269
- "voiceoverText": "Keep narration",
270
- "scene": {
271
- "title": "Opening",
272
- "durationMs": 4000,
273
- "aspect": "16:9",
274
- "layers": [
275
- {
276
- "id": "hero",
277
- "label": "Hero",
278
- "asset": {
279
- "assetId": "asset-1",
280
- "versionId": "v2"
281
- },
282
- "transform": {
283
- "x": 0.5,
284
- "y": 0.6,
285
- "scale": 1,
286
- "rot": 0
287
- },
288
- "custom": {
289
- "keep": true
290
- }
291
- }
292
- ]
293
- },
294
- "versions": [
295
- {
296
- "label": "Original",
297
- "scene": {
298
- "durationMs": 4000
299
- }
300
- }
301
- ]
302
- }
303
- ]
304
- },
305
- "after": {
306
- "schemaVersion": 1,
307
- "scenes": [
308
- {
309
- "shotId": "shot-1",
310
- "start": 0,
311
- "end": 4,
312
- "voiceoverText": "Keep narration",
313
- "scene": {
314
- "title": "Opening",
315
- "durationMs": 4000,
316
- "aspect": "16:9",
317
- "layers": [
318
- {
319
- "id": "hero",
320
- "label": "Hero",
321
- "asset": {
322
- "assetId": "asset-1",
323
- "versionId": "v2"
324
- },
325
- "transform": {
326
- "x": 0.5,
327
- "y": 0.6,
328
- "scale": 1,
329
- "rot": 0
330
- },
331
- "custom": {
332
- "keep": true
333
- }
334
- }
335
- ]
336
- },
337
- "versions": [
338
- {
339
- "label": "Original",
340
- "scene": {
341
- "durationMs": 4000
342
- }
343
- }
344
- ]
345
- }
346
- ]
347
- }
348
- }
349
- }
350
- },
351
- {
352
- "name": "Prepare one exact Animated Scene update",
353
- "input": {
354
- "animation": {
355
- "schemaVersion": 1,
356
- "scenes": [
357
- {
358
- "shotId": "shot-1",
359
- "start": 0,
360
- "end": 4,
361
- "voiceoverText": "Keep narration",
362
- "scene": {
363
- "title": "Opening",
364
- "durationMs": 4000,
365
- "layers": [
366
- {
367
- "id": "hero",
368
- "label": "Hero",
369
- "depth": 0.6,
370
- "transform": {
371
- "x": 0.5,
372
- "y": 0.5,
373
- "scale": 1,
374
- "rot": 0
375
- }
376
- }
377
- ]
378
- }
379
- }
380
- ]
381
- },
382
- "updatedAnimation": {
383
- "schemaVersion": 1,
384
- "scenes": [
385
- {
386
- "shotId": "shot-1",
387
- "start": 0,
388
- "end": 4,
389
- "voiceoverText": "Keep narration",
390
- "scene": {
391
- "title": "Closer opening",
392
- "durationMs": 4000,
393
- "layers": [
394
- {
395
- "id": "hero",
396
- "label": "Hero close",
397
- "depth": 0.7,
398
- "transform": {
399
- "x": 0.55,
400
- "y": 0.5,
401
- "scale": 1.2,
402
- "rot": 0
403
- }
404
- }
405
- ]
406
- }
407
- }
408
- ]
409
- },
410
- "commit": true
411
- },
412
- "expected": {
413
- "animation": {
414
- "schemaVersion": 1,
415
- "scenes": [
416
- {
417
- "shotId": "shot-1",
418
- "start": 0,
419
- "end": 4,
420
- "voiceoverText": "Keep narration",
421
- "scene": {
422
- "title": "Closer opening",
423
- "durationMs": 4000,
424
- "layers": [
425
- {
426
- "id": "hero",
427
- "label": "Hero close",
428
- "depth": 0.7,
429
- "transform": {
430
- "x": 0.55,
431
- "y": 0.5,
432
- "scale": 1.2,
433
- "rot": 0
434
- }
435
- }
436
- ]
437
- }
438
- }
439
- ]
440
- },
441
- "edit": {
442
- "schemaVersion": 1,
443
- "title": "Update Animated Scene (1 scenes)",
444
- "field": "animation",
445
- "before": {
446
- "schemaVersion": 1,
447
- "scenes": [
448
- {
449
- "shotId": "shot-1",
450
- "start": 0,
451
- "end": 4,
452
- "voiceoverText": "Keep narration",
453
- "scene": {
454
- "title": "Opening",
455
- "durationMs": 4000,
456
- "layers": [
457
- {
458
- "id": "hero",
459
- "label": "Hero",
460
- "depth": 0.6,
461
- "transform": {
462
- "x": 0.5,
463
- "y": 0.5,
464
- "scale": 1,
465
- "rot": 0
466
- }
467
- }
468
- ]
469
- }
470
- }
471
- ]
472
- },
473
- "after": {
474
- "schemaVersion": 1,
475
- "scenes": [
476
- {
477
- "shotId": "shot-1",
478
- "start": 0,
479
- "end": 4,
480
- "voiceoverText": "Keep narration",
481
- "scene": {
482
- "title": "Closer opening",
483
- "durationMs": 4000,
484
- "layers": [
485
- {
486
- "id": "hero",
487
- "label": "Hero close",
488
- "depth": 0.7,
489
- "transform": {
490
- "x": 0.55,
491
- "y": 0.5,
492
- "scale": 1.2,
493
- "rot": 0
494
- }
495
- }
496
- ]
497
- }
498
- }
499
- ]
500
- }
501
- }
502
- }
503
- },
504
- {
505
- "name": "Build scene compositions from the reviewed shot plan",
506
- "input": {
507
- "animation": {
508
- "schemaVersion": 1,
509
- "scenes": []
510
- },
511
- "shotPlan": {
512
- "schemaVersion": 1,
513
- "shots": [
514
- {
515
- "id": "opening",
516
- "voiceoverText": "Welcome to the city.",
517
- "shotDescription": "A wide city view",
518
- "startTime": 0,
519
- "endTime": 4,
520
- "motionEffect": "Push In"
521
- }
522
- ]
523
- },
524
- "updatedAnimation": {
525
- "schemaVersion": 1,
526
- "scenes": []
527
- },
528
- "commit": false,
529
- "action": "none"
530
- },
531
- "expected": {
532
- "animation": {
533
- "schemaVersion": 1,
534
- "scenes": [
535
- {
536
- "shotId": "opening",
537
- "start": 0,
538
- "end": 4,
539
- "voiceoverText": "Welcome to the city.",
540
- "scene": {
541
- "schemaVersion": 1,
542
- "title": "A wide city view",
543
- "aspect": "16:9",
544
- "durationMs": 4000,
545
- "layers": [],
546
- "camera": {
547
- "motion": "Push In"
548
- },
549
- "transition": "cut"
550
- }
551
- }
552
- ]
553
- },
554
- "edit": {
555
- "schemaVersion": 1,
556
- "title": "Update Animated Scene (1 scenes)",
557
- "field": "animation",
558
- "before": {
559
- "schemaVersion": 1,
560
- "scenes": []
561
- },
562
- "after": {
563
- "schemaVersion": 1,
564
- "scenes": [
565
- {
566
- "shotId": "opening",
567
- "start": 0,
568
- "end": 4,
569
- "voiceoverText": "Welcome to the city.",
570
- "scene": {
571
- "schemaVersion": 1,
572
- "title": "A wide city view",
573
- "aspect": "16:9",
574
- "durationMs": 4000,
575
- "layers": [],
576
- "camera": {
577
- "motion": "Push In"
578
- },
579
- "transition": "cut"
580
- }
581
- }
582
- ]
583
- }
584
- }
585
- }
586
- }
587
- ],
588
- "portable": {
589
- "format": "stillmade-block/1",
590
- "dependencies": [],
591
- "sources": [
592
- {
593
- "kind": "original",
594
- "license": "MIT",
595
- "paths": [
596
- "LICENSE",
597
- "src/run.js",
598
- "src/view.json"
599
- ],
600
- "evidence": [
601
- "upstream/0/LICENSE",
602
- "upstream/0/src/run.js",
603
- "upstream/0/src/view.json"
604
- ],
605
- "changes": "Original implementation declared by the packager; no reused repository or dependency code."
606
- }
607
- ],
608
- "files": {
609
- "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",
610
- "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 shots=Array.isArray(input.shotPlan?.shots)?input.shotPlan.shots:[];\nconst generated={schemaVersion:1,scenes:shots.map((shot,index)=>{const start=Number.isFinite(Number(shot.startTime))?Number(shot.startTime):Number(shot.startMs)/1000||0,end=Number.isFinite(Number(shot.endTime))?Number(shot.endTime):start+Math.max(1,Number(shot.estimatedScreenTime)||Number(shot.durationMs)/1000||4);return {shotId:String(shot.id||shot.shotId||'shot-'+String(index+1)),start,end,voiceoverText:String(shot.voiceoverText||shot.narration||shot.text||''),scene:{schemaVersion:1,title:String(shot.shotDescription||shot.description||'Scene '+String(index+1)),aspect:'16:9',durationMs:Math.max(1,Math.round((end-start)*1000)),layers:[],camera:{motion:String(shot.motionEffect||shot.cameraMotion||'Locked Frame')},transition:String(shot.transition||'cut')}}})};\nconst spine=source.scenes.length?source:generated;\nconst candidate = input.commit ? copy(input.updatedAnimation) : copy(spine);\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 !== spine.scenes.length || !candidate.scenes.every((record, index) => {\n const previous = spine.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.3.1'}},resultPort:null};}\nreturn outputs;\n",
611
- "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=\\\"build\\\" type=\\\"button\\\" class=\\\"secondary\\\">Build from Shots</button><button id=\\\"reset\\\" type=\\\"button\\\" class=\\\"secondary\\\">Reset changes</button><button id=\\\"save\\\" type=\\\"button\\\" data-stillmade-action=\\\"run\\\">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><label for=\\\"raw\\\">Complete Animated Scene JSON</label><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'),build=document.getElementById('build');\\nlet source={schemaVersion:1,scenes:[]},draft={schemaVersion:1,scenes:[]},connectedImage=null,shotPlan={schemaVersion:1,shots:[]},busy=false,revision=0;\\nconst clone=value=>JSON.parse(JSON.stringify(value));\\nconst text=value=>value===undefined||value===null?'':String(value);\\nconst plan=()=>({schemaVersion:1,scenes:(Array.isArray(shotPlan.shots)?shotPlan.shots:[]).map((shot,index)=>{const start=Number.isFinite(Number(shot.startTime))?Number(shot.startTime):Number(shot.startMs)/1000||0,end=Number.isFinite(Number(shot.endTime))?Number(shot.endTime):start+Math.max(1,Number(shot.estimatedScreenTime)||Number(shot.durationMs)/1000||4);return {shotId:text(shot.id||shot.shotId||'shot-'+String(index+1)),start,end,voiceoverText:text(shot.voiceoverText||shot.narration||shot.text),scene:{schemaVersion:1,title:text(shot.shotDescription||shot.description||'Scene '+String(index+1)),aspect:'16:9',durationMs:Math.max(1,Math.round((end-start)*1000)),layers:[],camera:{motion:text(shot.motionEffect||shot.cameraMotion||'Locked Frame')},transition:text(shot.transition||'cut')}}})});\\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;build.disabled=busy||!shotPlan.shots?.length;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()});\\nbuild.addEventListener('click',()=>{if(!busy){draft=plan();changed();draw();status.textContent='Built editable scene compositions from the current Shots spine.'}});\\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:[]});shotPlan=clone(values.shotPlan||{schemaVersion:1,shots:[]});draft=source.scenes?.length?clone(source):plan();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}"
612
- },
613
- "lineage": {
614
- "parents": [],
615
- "changes": "Packaged original Block source for StillMade."
616
- }
617
- }
618
- };