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,528 +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.shot-plan",
7
- "version": "2.1.0",
8
- "name": "Shots",
9
- "description": "Build a timed shot plan from the current narration, then review and edit narration, visual direction, framing, duration, fulfillment, motion, statements, order, and retained custom fields.",
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
- "shotPlan": {
36
- "type": "shot-plan",
37
- "context": "shotPlan",
38
- "primary": true,
39
- "required": false,
40
- "default": {
41
- "schemaVersion": 1,
42
- "shots": []
43
- },
44
- "description": "The complete current shot plan. Unknown fields and saved media identities are retained."
45
- },
46
- "transcript": {
47
- "type": "transcript",
48
- "context": "transcript",
49
- "required": false,
50
- "default": {
51
- "schemaVersion": 1,
52
- "text": "",
53
- "words": []
54
- },
55
- "description": "Current narration words and timings used to build an initial plan when the project has no shots."
56
- },
57
- "script": {
58
- "type": "script",
59
- "context": "script",
60
- "required": false,
61
- "default": {
62
- "schemaVersion": 1,
63
- "text": ""
64
- },
65
- "description": "Current narration text used when word timings are unavailable."
66
- },
67
- "updatedShotPlan": {
68
- "type": "shot-plan",
69
- "required": false,
70
- "default": {
71
- "schemaVersion": 1,
72
- "shots": []
73
- },
74
- "description": "The complete edited plan prepared in this workspace."
75
- },
76
- "commit": {
77
- "type": "boolean",
78
- "default": false,
79
- "description": "Prepare the edited plan for StillMade review and Apply."
80
- }
81
- },
82
- "outputs": {
83
- "shotPlan": {
84
- "type": "shot-plan",
85
- "primary": true,
86
- "role": "production_shot_plan",
87
- "description": "The complete edited shot plan for the next Step."
88
- },
89
- "edit": {
90
- "type": "workspace-edit",
91
- "description": "An exact before/after Shots change reviewed before it updates the project."
92
- }
93
- },
94
- "permissions": {
95
- "project": [
96
- "context.shotPlan.read",
97
- "context.transcript.read",
98
- "context.script.read",
99
- "workspace.shotPlan.propose"
100
- ],
101
- "network": [],
102
- "filesystem": [],
103
- "secrets": []
104
- },
105
- "ui": [],
106
- "platforms": {
107
- "phone": {
108
- "supported": true
109
- },
110
- "browser": {
111
- "supported": true
112
- },
113
- "desktop": {
114
- "supported": true
115
- }
116
- }
117
- },
118
- "code": "const copy = value => JSON.parse(JSON.stringify(value));\nconst words = Array.isArray(input.transcript?.words) ? input.transcript.words : [];\nconst scriptText = String(input.transcript?.text || input.script?.text || (typeof input.script==='string'?input.script:'')).trim();\nconst timed = word => ({text:String(word?.text || word?.word || '').trim(),start:Number.isFinite(Number(word?.start))?Number(word.start):Number(word?.startMs)/1000,end:Number.isFinite(Number(word?.end))?Number(word.end):Number(word?.endMs)/1000});\nconst make = (text,start,end,index) => ({id:`shot-${index+1}-${Math.max(0,Math.round(start*1000))}`,voiceoverText:text,shotDescription:text?`Show a clear visual for: ${text}`:'',startTime:start,endTime:end,estimatedScreenTime:Math.max(1,Math.round((end-start)*10)/10),generationLength:Math.min(15,Math.max(3,Math.ceil(end-start)+2)),shotSize:index%3===0?'Wide':index%3===1?'Medium':'Close',shotType:'Story',fulfillment:'video'});\nconst fromWords = () => {const clean=words.map(timed).filter(word=>word.text&&Number.isFinite(word.start)&&Number.isFinite(word.end)&&word.end>=word.start);const groups=[];let group=[];clean.forEach(word=>{group.push(word);const duration=word.end-group[0].start,punctuation=/[.!?]$/.test(word.text);if((punctuation&&duration>=2.5)||duration>=6||group.length>=18){groups.push(group);group=[];}});if(group.length)groups.push(group);return groups.map((group,index)=>make(group.map(word=>word.text).join(' '),group[0].start,group[group.length-1].end,index));};\nconst fromScript = () => {const parts=(scriptText.match(/[^.!?]+[.!?]?/g)||[]).map(value=>value.trim()).filter(Boolean);let cursor=0;return parts.map((text,index)=>{const duration=Math.max(2,Math.round(text.split(/\\s+/).length/2.5*10)/10),shot=make(text,cursor,cursor+duration,index);cursor+=duration;return shot;});};\nconst generated = () => ({schemaVersion:1,shots:words.length?fromWords():fromScript()});\nconst source = copy(input.shotPlan || {schemaVersion:1,shots:[]});\nconst fallback = !source.shots?.length ? generated() : source;\nconst candidate = input.commit ? copy(input.updatedShotPlan) : copy(fallback);\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1 || !Array.isArray(candidate.shots)) throw new Error('Keep the complete version 1 shot plan.');\nif (candidate.shots.length > 2000 || !candidate.shots.every(shot => shot && !Array.isArray(shot) && typeof shot.id === 'string' && shot.id.length > 0 && shot.id.length <= 200) || new Set(candidate.shots.map(shot => shot.id)).size !== candidate.shots.length) throw new Error('Shots need up to 2,000 distinct retained IDs.');\nreturn {shotPlan:candidate,edit:{schemaVersion:1,title:`Update ${candidate.shots.length} planned shot${candidate.shots.length===1?'':'s'}`,field:'shotPlan',before:source,after:candidate}};\n",
119
- "view": {
120
- "html": "<main class=\"shots-workspace\">\n <header><div><small>Production workspace</small><h1>Shots</h1><p id=\"summary\">Loading the shot plan…</p></div><div class=\"actions\"><button id=\"build\" type=\"button\" class=\"secondary\">Build from narration</button><button id=\"reset\" type=\"button\" class=\"secondary\">Reset changes</button><button id=\"add\" type=\"button\" class=\"secondary\">Add shot</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 id=\"shots\" class=\"shots\" aria-label=\"Planned shots\"></section>\n <details><summary>Complete shot-plan data</summary><p>Every field is retained. Use this editor for custom fields not shown on the cards.</p><textarea id=\"raw\" class=\"raw\" spellcheck=\"false\"></textarea><button id=\"applyRaw\" type=\"button\" class=\"secondary\">Apply JSON to workspace</button></details>\n</main>\n",
121
- "css": ".shots-workspace{max-width:1100px;margin:0 auto;padding:8px;color:var(--fg)}header,.actions,.card-head,.row,.order{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{color:var(--fg-muted)}\n.shots{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}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}label{display:grid;gap:5px;margin:8px 0;font-size:13px;font-weight:600}input,textarea,select{width:100%;background:var(--bg)}textarea{min-height:82px;resize:vertical}.wide{grid-column:1/-1}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}.raw{min-height:340px;font-family:var(--font-mono);font-size:12px}output{display:block;min-height:24px;margin:8px 2px}.order button{min-width:44px}.empty{padding:28px;text-align:center;border:1px dashed var(--border-tok);border-radius:var(--r-3);color:var(--fg-muted)}\n@media(max-width:760px){.shots-workspace{padding:0}.grid{grid-template-columns:1fr}.actions{width:100%}.actions button{flex:1}.card,details{padding:12px}}\n",
122
- "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,shots:[]},draft={schemaVersion:1,shots:[]},transcript={schemaVersion:1,text:'',words:[]},script={schemaVersion:1,text:''},busy=false,revision=0;\nconst clone=value=>JSON.parse(JSON.stringify(value));\nconst text=value=>value===undefined||value===null?'':String(value);\nconst wordStart=word=>Number.isFinite(Number(word?.start))?Number(word.start):Number(word?.startMs)/1000;\nconst wordEnd=word=>Number.isFinite(Number(word?.end))?Number(word.end):Number(word?.endMs)/1000;\nconst make=(line,start,end,index)=>({id:'shot-'+String(index+1)+'-'+String(Math.max(0,Math.round(start*1000))),voiceoverText:line,shotDescription:line?'Show a clear visual for: '+line:'',startTime:start,endTime:end,estimatedScreenTime:Math.max(1,Math.round((end-start)*10)/10),generationLength:Math.min(15,Math.max(3,Math.ceil(end-start)+2)),shotSize:index%3===0?'Wide':index%3===1?'Medium':'Close',shotType:'Story',fulfillment:'video'});\nconst plan=()=>{const words=Array.isArray(transcript.words)?transcript.words.map(word=>({text:text(word?.text||word?.word).trim(),start:wordStart(word),end:wordEnd(word)})).filter(word=>word.text&&Number.isFinite(word.start)&&Number.isFinite(word.end)&&word.end>=word.start):[];if(words.length){const groups=[];let group=[];words.forEach(word=>{group.push(word);const duration=word.end-group[0].start;if((/[.!?]$/.test(word.text)&&duration>=2.5)||duration>=6||group.length>=18){groups.push(group);group=[]}});if(group.length)groups.push(group);return {schemaVersion:1,shots:groups.map((group,index)=>make(group.map(word=>word.text).join(' '),group[0].start,group.at(-1).end,index))}}const narration=text(transcript.text||script.text||(typeof script==='string'?script:'')).trim(),parts=(narration.match(/[^.!?]+[.!?]?/g)||[]).map(value=>value.trim()).filter(Boolean);let cursor=0;return {schemaVersion:1,shots:parts.map((line,index)=>{const duration=Math.max(2,Math.round(line.split(/\\s+/).length/2.5*10)/10),shot=make(line,cursor,cursor+duration,index);cursor+=duration;return shot})}};\nconst field=(label,action,value,type='text',wide=false)=>({tag:'label',className:wide?'wide':'',children:[{tag:'span',text:label},type==='textarea'?{tag:'textarea',action,value:text(value),disabled:busy,label}:{tag:'input',type,action,value:Number.isFinite(value)?value:text(value),disabled:busy,label}]});\nconst choice=(label,action,value,options)=>({tag:'label',children:[{tag:'span',text:label},{tag:'select',action,value:text(value),disabled:busy,label,children:options.map(option=>({tag:'option',text:option,value:option}))}]});\nconst shotCard=(shot,index)=>({tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h2',text:'Shot '+String(index+1)+' · '+(text(shot.shotDescription)||text(shot.title)||shot.id)},{tag:'div',className:'order',children:[{tag:'button',action:'up:'+String(index),text:'↑',className:'secondary',disabled:busy||index===0,label:'Move shot up'},{tag:'button',action:'down:'+String(index),text:'↓',className:'secondary',disabled:busy||index===draft.shots.length-1,label:'Move shot down'},{tag:'button',action:'remove:'+String(index),text:'Remove',className:'danger',disabled:busy}]}]},{tag:'div',className:'grid',children:[field('Narration','narration:'+String(index),shot.voiceoverText,'textarea',true),field('Visual direction','description:'+String(index),shot.shotDescription||shot.description,'textarea',true),choice('Framing','size:'+String(index),shot.shotSize||'Medium',['Wide','Medium','Close','Extreme Close']),choice('Purpose','type:'+String(index),shot.shotType||'Story',['Story','Coverage Wide','Coverage Medium','Cutaway','Insert','Movement','Transition']),field('Screen time (seconds)','duration:'+String(index),shot.estimatedScreenTime,'number'),choice('Fulfillment','fulfillment:'+String(index),shot.fulfillment||'video',['video','imageMotion']),choice('Motion','motion:'+String(index),shot.motionEffect||'Ken Burns',['Ken Burns','Pan Left','Pan Right','Push In','Pull Out','Tilt Up','Tilt Down','Drift','Locked Frame']),choice('Motion speed','speed:'+String(index),shot.motionSpeed||'Slow',['Slow','Medium','Fast']),{tag:'label',children:[{tag:'span',text:'Full-screen statement'},{tag:'input',type:'checkbox',action:'statement:'+String(index),checked:!!shot.statement,disabled:busy,label:'Full-screen statement'}]},field('Statement reveal','reveal:'+String(index),shot.statementReveal||'words')]}]});\nconst ensure=()=>{if(!draft||Array.isArray(draft)||draft.schemaVersion!==1)draft={schemaVersion:1,shots:[]};if(!Array.isArray(draft.shots))draft.shots=[]};\nconst draw=()=>{ensure();StillMade.render('shots',draft.shots.length?draft.shots.map(shotCard):[{tag:'p',className:'empty',text:'No shots yet. Build from narration or add the first shot.'}]);raw.value=JSON.stringify(draft,null,2);summary.textContent=String(draft.shots.length)+' planned shot'+(draft.shots.length===1?'':'s');save.disabled=busy;build.disabled=busy||!(transcript.words?.length||text(transcript.text||script.text||(typeof script==='string'?script:'')).trim());document.getElementById('reset').disabled=busy;document.getElementById('add').disabled=busy};\nconst changed=message=>{revision+=1;raw.value=JSON.stringify(draft,null,2);status.textContent=message||'Changes are local until you choose Review changes.'};\nStillMade.onAction(event=>{if(busy)return;ensure();const parts=event.action.split(':'),kind=parts[0],index=Number(parts[1]),shot=draft.shots.find((item,position)=>position===index);if(kind==='remove'){draft.shots=draft.shots.filter((item,position)=>position!==index);changed();draw();return}if(kind==='up'||kind==='down'){const target=index+(kind==='up'?-1:1);if(target>=0&&target<draft.shots.length){draft.shots=draft.shots.map((item,position)=>position===index?draft.shots.find((candidate,candidatePosition)=>candidatePosition===target):position===target?shot:item);changed('Shot order updated.');draw()}return}if(!shot)return;if(kind==='narration')shot.voiceoverText=event.value;if(kind==='description')shot.shotDescription=event.value;if(kind==='size')shot.shotSize=event.value;if(kind==='type')shot.shotType=event.value;if(kind==='duration'){shot.estimatedScreenTime=Number(event.value);shot.generationLength=Math.min(15,Number(event.value)+2)}if(kind==='fulfillment'){shot.fulfillment=event.value;shot.fulfillmentSetBy='user'}if(kind==='motion')shot.motionEffect=event.value;if(kind==='speed')shot.motionSpeed=event.value;if(kind==='statement'){shot.statement=event.checked;shot.statementSetBy='user'}if(kind==='reveal')shot.statementReveal=event.value;changed()});\nbuild.addEventListener('click',()=>{if(!busy){draft=plan();changed('Built a local draft from the current narration. Review every visual direction before applying.');draw()}});\ndocument.getElementById('add').addEventListener('click',()=>{if(busy)return;ensure();const id='portable-shot-'+String(revision+1)+'-'+String(draft.shots.length+1);draft.shots=[...draft.shots,{id,voiceoverText:'',shotDescription:'',shotSize:'Medium',shotType:'Story',estimatedScreenTime:3,generationLength:5,fulfillment:'video'}];changed();draw()});\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.shots))throw Error('Shot-plan JSON must be a version 1 object with shots.');draft=clone(value);changed();draw();status.textContent='Complete shot-plan data applied to this workspace.'}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 project shot plan.'}});\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking the complete shot plan…';try{const result=await StillMade.run({shotPlan:source,transcript,script,updatedShotPlan:draft,commit:true});draft=clone(result.shotPlan);if(started===revision)status.textContent='Shots are ready below. Review the before and after, then choose Apply.'}catch(error){status.textContent=error.message||'The shot plan could not be prepared.'}finally{busy=false;draw()}});\nStillMade.onInput(values=>{source=clone(values.shotPlan||{schemaVersion:1,shots:[]});transcript=clone(values.transcript||{schemaVersion:1,text:'',words:[]});script=clone(values.script||{schemaVersion:1,text:''});draft=source.shots?.length?clone(source):plan();revision+=1;draw();status.textContent=draft.shots.length&&!source.shots?.length?'Built a starting plan from the current narration. Review it before applying.':'Edit any shot. Every unshown project field is retained.'});\n"
123
- },
124
- "tests": [
125
- {
126
- "name": "builds timed shots from narration when the project has no plan",
127
- "input": {
128
- "shotPlan": {
129
- "schemaVersion": 1,
130
- "shots": []
131
- },
132
- "transcript": {
133
- "schemaVersion": 1,
134
- "text": "Open with the city. Then show the product.",
135
- "words": [
136
- {
137
- "text": "Open",
138
- "start": 0,
139
- "end": 0.5
140
- },
141
- {
142
- "text": "with",
143
- "start": 0.5,
144
- "end": 1
145
- },
146
- {
147
- "text": "the",
148
- "start": 1,
149
- "end": 1.3
150
- },
151
- {
152
- "text": "city.",
153
- "start": 1.3,
154
- "end": 3
155
- },
156
- {
157
- "text": "Then",
158
- "start": 3,
159
- "end": 3.5
160
- },
161
- {
162
- "text": "show",
163
- "start": 3.5,
164
- "end": 4
165
- },
166
- {
167
- "text": "the",
168
- "start": 4,
169
- "end": 4.3
170
- },
171
- {
172
- "text": "product.",
173
- "start": 4.3,
174
- "end": 7
175
- }
176
- ]
177
- },
178
- "script": {
179
- "schemaVersion": 1,
180
- "text": "Open with the city. Then show the product."
181
- },
182
- "updatedShotPlan": {
183
- "schemaVersion": 1,
184
- "shots": []
185
- },
186
- "commit": false
187
- },
188
- "expected": {
189
- "shotPlan": {
190
- "schemaVersion": 1,
191
- "shots": [
192
- {
193
- "id": "shot-1-0",
194
- "voiceoverText": "Open with the city.",
195
- "shotDescription": "Show a clear visual for: Open with the city.",
196
- "startTime": 0,
197
- "endTime": 3,
198
- "estimatedScreenTime": 3,
199
- "generationLength": 5,
200
- "shotSize": "Wide",
201
- "shotType": "Story",
202
- "fulfillment": "video"
203
- },
204
- {
205
- "id": "shot-2-3000",
206
- "voiceoverText": "Then show the product.",
207
- "shotDescription": "Show a clear visual for: Then show the product.",
208
- "startTime": 3,
209
- "endTime": 7,
210
- "estimatedScreenTime": 4,
211
- "generationLength": 6,
212
- "shotSize": "Medium",
213
- "shotType": "Story",
214
- "fulfillment": "video"
215
- }
216
- ]
217
- },
218
- "edit": {
219
- "schemaVersion": 1,
220
- "title": "Update 2 planned shots",
221
- "field": "shotPlan",
222
- "before": {
223
- "schemaVersion": 1,
224
- "shots": []
225
- },
226
- "after": {
227
- "schemaVersion": 1,
228
- "shots": [
229
- {
230
- "id": "shot-1-0",
231
- "voiceoverText": "Open with the city.",
232
- "shotDescription": "Show a clear visual for: Open with the city.",
233
- "startTime": 0,
234
- "endTime": 3,
235
- "estimatedScreenTime": 3,
236
- "generationLength": 5,
237
- "shotSize": "Wide",
238
- "shotType": "Story",
239
- "fulfillment": "video"
240
- },
241
- {
242
- "id": "shot-2-3000",
243
- "voiceoverText": "Then show the product.",
244
- "shotDescription": "Show a clear visual for: Then show the product.",
245
- "startTime": 3,
246
- "endTime": 7,
247
- "estimatedScreenTime": 4,
248
- "generationLength": 6,
249
- "shotSize": "Medium",
250
- "shotType": "Story",
251
- "fulfillment": "video"
252
- }
253
- ]
254
- }
255
- }
256
- }
257
- },
258
- {
259
- "name": "commits the complete edited plan without losing media or custom data",
260
- "input": {
261
- "shotPlan": {
262
- "schemaVersion": 1,
263
- "shots": [
264
- {
265
- "id": "opening",
266
- "voiceoverText": "Keep narration",
267
- "selectedImage": {
268
- "assetId": "image-1",
269
- "versionId": "v1"
270
- },
271
- "custom": {
272
- "approved": true
273
- }
274
- }
275
- ]
276
- },
277
- "transcript": {
278
- "schemaVersion": 1,
279
- "text": "Keep narration",
280
- "words": []
281
- },
282
- "script": {
283
- "schemaVersion": 1,
284
- "text": "Keep narration"
285
- },
286
- "updatedShotPlan": {
287
- "schemaVersion": 1,
288
- "shots": [
289
- {
290
- "id": "opening",
291
- "voiceoverText": "Keep narration",
292
- "shotDescription": "A better opening",
293
- "selectedImage": {
294
- "assetId": "image-1",
295
- "versionId": "v2"
296
- },
297
- "custom": {
298
- "approved": true
299
- }
300
- }
301
- ]
302
- },
303
- "commit": true
304
- },
305
- "expected": {
306
- "shotPlan": {
307
- "schemaVersion": 1,
308
- "shots": [
309
- {
310
- "id": "opening",
311
- "voiceoverText": "Keep narration",
312
- "shotDescription": "A better opening",
313
- "selectedImage": {
314
- "assetId": "image-1",
315
- "versionId": "v2"
316
- },
317
- "custom": {
318
- "approved": true
319
- }
320
- }
321
- ]
322
- },
323
- "edit": {
324
- "schemaVersion": 1,
325
- "title": "Update 1 planned shot",
326
- "field": "shotPlan",
327
- "before": {
328
- "schemaVersion": 1,
329
- "shots": [
330
- {
331
- "id": "opening",
332
- "voiceoverText": "Keep narration",
333
- "selectedImage": {
334
- "assetId": "image-1",
335
- "versionId": "v1"
336
- },
337
- "custom": {
338
- "approved": true
339
- }
340
- }
341
- ]
342
- },
343
- "after": {
344
- "schemaVersion": 1,
345
- "shots": [
346
- {
347
- "id": "opening",
348
- "voiceoverText": "Keep narration",
349
- "shotDescription": "A better opening",
350
- "selectedImage": {
351
- "assetId": "image-1",
352
- "versionId": "v2"
353
- },
354
- "custom": {
355
- "approved": true
356
- }
357
- }
358
- ]
359
- }
360
- }
361
- }
362
- },
363
- {
364
- "name": "estimates timing from script sentences when word timings are unavailable",
365
- "input": {
366
- "shotPlan": {
367
- "schemaVersion": 1,
368
- "shots": []
369
- },
370
- "transcript": {
371
- "schemaVersion": 1,
372
- "text": "First beat. Second beat here!",
373
- "words": []
374
- },
375
- "script": {
376
- "schemaVersion": 1,
377
- "text": ""
378
- },
379
- "updatedShotPlan": {
380
- "schemaVersion": 1,
381
- "shots": []
382
- },
383
- "commit": false
384
- },
385
- "expected": {
386
- "shotPlan": {
387
- "schemaVersion": 1,
388
- "shots": [
389
- {
390
- "id": "shot-1-0",
391
- "voiceoverText": "First beat.",
392
- "shotDescription": "Show a clear visual for: First beat.",
393
- "startTime": 0,
394
- "endTime": 2,
395
- "estimatedScreenTime": 2,
396
- "generationLength": 4,
397
- "shotSize": "Wide",
398
- "shotType": "Story",
399
- "fulfillment": "video"
400
- },
401
- {
402
- "id": "shot-2-2000",
403
- "voiceoverText": "Second beat here!",
404
- "shotDescription": "Show a clear visual for: Second beat here!",
405
- "startTime": 2,
406
- "endTime": 4,
407
- "estimatedScreenTime": 2,
408
- "generationLength": 4,
409
- "shotSize": "Medium",
410
- "shotType": "Story",
411
- "fulfillment": "video"
412
- }
413
- ]
414
- },
415
- "edit": {
416
- "schemaVersion": 1,
417
- "title": "Update 2 planned shots",
418
- "field": "shotPlan",
419
- "before": {
420
- "schemaVersion": 1,
421
- "shots": []
422
- },
423
- "after": {
424
- "schemaVersion": 1,
425
- "shots": [
426
- {
427
- "id": "shot-1-0",
428
- "voiceoverText": "First beat.",
429
- "shotDescription": "Show a clear visual for: First beat.",
430
- "startTime": 0,
431
- "endTime": 2,
432
- "estimatedScreenTime": 2,
433
- "generationLength": 4,
434
- "shotSize": "Wide",
435
- "shotType": "Story",
436
- "fulfillment": "video"
437
- },
438
- {
439
- "id": "shot-2-2000",
440
- "voiceoverText": "Second beat here!",
441
- "shotDescription": "Show a clear visual for: Second beat here!",
442
- "startTime": 2,
443
- "endTime": 4,
444
- "estimatedScreenTime": 2,
445
- "generationLength": 4,
446
- "shotSize": "Medium",
447
- "shotType": "Story",
448
- "fulfillment": "video"
449
- }
450
- ]
451
- }
452
- }
453
- }
454
- },
455
- {
456
- "name": "keeps an empty project empty without treating document objects as narration",
457
- "input": {
458
- "shotPlan": {
459
- "schemaVersion": 1,
460
- "shots": []
461
- },
462
- "transcript": {
463
- "schemaVersion": 1,
464
- "text": "",
465
- "words": []
466
- },
467
- "script": {
468
- "schemaVersion": 1,
469
- "text": ""
470
- },
471
- "updatedShotPlan": {
472
- "schemaVersion": 1,
473
- "shots": []
474
- },
475
- "commit": false
476
- },
477
- "expected": {
478
- "shotPlan": {
479
- "schemaVersion": 1,
480
- "shots": []
481
- },
482
- "edit": {
483
- "schemaVersion": 1,
484
- "title": "Update 0 planned shots",
485
- "field": "shotPlan",
486
- "before": {
487
- "schemaVersion": 1,
488
- "shots": []
489
- },
490
- "after": {
491
- "schemaVersion": 1,
492
- "shots": []
493
- }
494
- }
495
- }
496
- }
497
- ],
498
- "portable": {
499
- "format": "stillmade-block/1",
500
- "dependencies": [],
501
- "sources": [
502
- {
503
- "kind": "original",
504
- "license": "MIT",
505
- "paths": [
506
- "LICENSE",
507
- "src/run.js",
508
- "src/view.json"
509
- ],
510
- "evidence": [
511
- "upstream/0/LICENSE",
512
- "upstream/0/src/run.js",
513
- "upstream/0/src/view.json"
514
- ],
515
- "changes": "Original implementation declared by the packager; no reused repository or dependency code."
516
- }
517
- ],
518
- "files": {
519
- "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",
520
- "upstream/0/src/run.js": "const copy = value => JSON.parse(JSON.stringify(value));\nconst words = Array.isArray(input.transcript?.words) ? input.transcript.words : [];\nconst scriptText = String(input.transcript?.text || input.script?.text || (typeof input.script==='string'?input.script:'')).trim();\nconst timed = word => ({text:String(word?.text || word?.word || '').trim(),start:Number.isFinite(Number(word?.start))?Number(word.start):Number(word?.startMs)/1000,end:Number.isFinite(Number(word?.end))?Number(word.end):Number(word?.endMs)/1000});\nconst make = (text,start,end,index) => ({id:`shot-${index+1}-${Math.max(0,Math.round(start*1000))}`,voiceoverText:text,shotDescription:text?`Show a clear visual for: ${text}`:'',startTime:start,endTime:end,estimatedScreenTime:Math.max(1,Math.round((end-start)*10)/10),generationLength:Math.min(15,Math.max(3,Math.ceil(end-start)+2)),shotSize:index%3===0?'Wide':index%3===1?'Medium':'Close',shotType:'Story',fulfillment:'video'});\nconst fromWords = () => {const clean=words.map(timed).filter(word=>word.text&&Number.isFinite(word.start)&&Number.isFinite(word.end)&&word.end>=word.start);const groups=[];let group=[];clean.forEach(word=>{group.push(word);const duration=word.end-group[0].start,punctuation=/[.!?]$/.test(word.text);if((punctuation&&duration>=2.5)||duration>=6||group.length>=18){groups.push(group);group=[];}});if(group.length)groups.push(group);return groups.map((group,index)=>make(group.map(word=>word.text).join(' '),group[0].start,group[group.length-1].end,index));};\nconst fromScript = () => {const parts=(scriptText.match(/[^.!?]+[.!?]?/g)||[]).map(value=>value.trim()).filter(Boolean);let cursor=0;return parts.map((text,index)=>{const duration=Math.max(2,Math.round(text.split(/\\s+/).length/2.5*10)/10),shot=make(text,cursor,cursor+duration,index);cursor+=duration;return shot;});};\nconst generated = () => ({schemaVersion:1,shots:words.length?fromWords():fromScript()});\nconst source = copy(input.shotPlan || {schemaVersion:1,shots:[]});\nconst fallback = !source.shots?.length ? generated() : source;\nconst candidate = input.commit ? copy(input.updatedShotPlan) : copy(fallback);\nif (!candidate || Array.isArray(candidate) || candidate.schemaVersion !== 1 || !Array.isArray(candidate.shots)) throw new Error('Keep the complete version 1 shot plan.');\nif (candidate.shots.length > 2000 || !candidate.shots.every(shot => shot && !Array.isArray(shot) && typeof shot.id === 'string' && shot.id.length > 0 && shot.id.length <= 200) || new Set(candidate.shots.map(shot => shot.id)).size !== candidate.shots.length) throw new Error('Shots need up to 2,000 distinct retained IDs.');\nreturn {shotPlan:candidate,edit:{schemaVersion:1,title:`Update ${candidate.shots.length} planned shot${candidate.shots.length===1?'':'s'}`,field:'shotPlan',before:source,after:candidate}};\n",
521
- "upstream/0/src/view.json": "{\n \"html\": \"<main class=\\\"shots-workspace\\\">\\n <header><div><small>Production workspace</small><h1>Shots</h1><p id=\\\"summary\\\">Loading the shot plan…</p></div><div class=\\\"actions\\\"><button id=\\\"build\\\" type=\\\"button\\\" class=\\\"secondary\\\">Build from narration</button><button id=\\\"reset\\\" type=\\\"button\\\" class=\\\"secondary\\\">Reset changes</button><button id=\\\"add\\\" type=\\\"button\\\" class=\\\"secondary\\\">Add shot</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 id=\\\"shots\\\" class=\\\"shots\\\" aria-label=\\\"Planned shots\\\"></section>\\n <details><summary>Complete shot-plan data</summary><p>Every field is retained. Use this editor for custom fields not shown on the cards.</p><textarea id=\\\"raw\\\" class=\\\"raw\\\" spellcheck=\\\"false\\\"></textarea><button id=\\\"applyRaw\\\" type=\\\"button\\\" class=\\\"secondary\\\">Apply JSON to workspace</button></details>\\n</main>\\n\",\n \"css\": \".shots-workspace{max-width:1100px;margin:0 auto;padding:8px;color:var(--fg)}header,.actions,.card-head,.row,.order{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{color:var(--fg-muted)}\\n.shots{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}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}label{display:grid;gap:5px;margin:8px 0;font-size:13px;font-weight:600}input,textarea,select{width:100%;background:var(--bg)}textarea{min-height:82px;resize:vertical}.wide{grid-column:1/-1}.secondary{background:transparent;color:var(--fg)}.danger{background:transparent;color:var(--signal)}.raw{min-height:340px;font-family:var(--font-mono);font-size:12px}output{display:block;min-height:24px;margin:8px 2px}.order button{min-width:44px}.empty{padding:28px;text-align:center;border:1px dashed var(--border-tok);border-radius:var(--r-3);color:var(--fg-muted)}\\n@media(max-width:760px){.shots-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,shots:[]},draft={schemaVersion:1,shots:[]},transcript={schemaVersion:1,text:'',words:[]},script={schemaVersion:1,text:''},busy=false,revision=0;\\nconst clone=value=>JSON.parse(JSON.stringify(value));\\nconst text=value=>value===undefined||value===null?'':String(value);\\nconst wordStart=word=>Number.isFinite(Number(word?.start))?Number(word.start):Number(word?.startMs)/1000;\\nconst wordEnd=word=>Number.isFinite(Number(word?.end))?Number(word.end):Number(word?.endMs)/1000;\\nconst make=(line,start,end,index)=>({id:'shot-'+String(index+1)+'-'+String(Math.max(0,Math.round(start*1000))),voiceoverText:line,shotDescription:line?'Show a clear visual for: '+line:'',startTime:start,endTime:end,estimatedScreenTime:Math.max(1,Math.round((end-start)*10)/10),generationLength:Math.min(15,Math.max(3,Math.ceil(end-start)+2)),shotSize:index%3===0?'Wide':index%3===1?'Medium':'Close',shotType:'Story',fulfillment:'video'});\\nconst plan=()=>{const words=Array.isArray(transcript.words)?transcript.words.map(word=>({text:text(word?.text||word?.word).trim(),start:wordStart(word),end:wordEnd(word)})).filter(word=>word.text&&Number.isFinite(word.start)&&Number.isFinite(word.end)&&word.end>=word.start):[];if(words.length){const groups=[];let group=[];words.forEach(word=>{group.push(word);const duration=word.end-group[0].start;if((/[.!?]$/.test(word.text)&&duration>=2.5)||duration>=6||group.length>=18){groups.push(group);group=[]}});if(group.length)groups.push(group);return {schemaVersion:1,shots:groups.map((group,index)=>make(group.map(word=>word.text).join(' '),group[0].start,group.at(-1).end,index))}}const narration=text(transcript.text||script.text||(typeof script==='string'?script:'')).trim(),parts=(narration.match(/[^.!?]+[.!?]?/g)||[]).map(value=>value.trim()).filter(Boolean);let cursor=0;return {schemaVersion:1,shots:parts.map((line,index)=>{const duration=Math.max(2,Math.round(line.split(/\\\\s+/).length/2.5*10)/10),shot=make(line,cursor,cursor+duration,index);cursor+=duration;return shot})}};\\nconst field=(label,action,value,type='text',wide=false)=>({tag:'label',className:wide?'wide':'',children:[{tag:'span',text:label},type==='textarea'?{tag:'textarea',action,value:text(value),disabled:busy,label}:{tag:'input',type,action,value:Number.isFinite(value)?value:text(value),disabled:busy,label}]});\\nconst choice=(label,action,value,options)=>({tag:'label',children:[{tag:'span',text:label},{tag:'select',action,value:text(value),disabled:busy,label,children:options.map(option=>({tag:'option',text:option,value:option}))}]});\\nconst shotCard=(shot,index)=>({tag:'article',className:'card',children:[{tag:'div',className:'card-head',children:[{tag:'h2',text:'Shot '+String(index+1)+' · '+(text(shot.shotDescription)||text(shot.title)||shot.id)},{tag:'div',className:'order',children:[{tag:'button',action:'up:'+String(index),text:'↑',className:'secondary',disabled:busy||index===0,label:'Move shot up'},{tag:'button',action:'down:'+String(index),text:'↓',className:'secondary',disabled:busy||index===draft.shots.length-1,label:'Move shot down'},{tag:'button',action:'remove:'+String(index),text:'Remove',className:'danger',disabled:busy}]}]},{tag:'div',className:'grid',children:[field('Narration','narration:'+String(index),shot.voiceoverText,'textarea',true),field('Visual direction','description:'+String(index),shot.shotDescription||shot.description,'textarea',true),choice('Framing','size:'+String(index),shot.shotSize||'Medium',['Wide','Medium','Close','Extreme Close']),choice('Purpose','type:'+String(index),shot.shotType||'Story',['Story','Coverage Wide','Coverage Medium','Cutaway','Insert','Movement','Transition']),field('Screen time (seconds)','duration:'+String(index),shot.estimatedScreenTime,'number'),choice('Fulfillment','fulfillment:'+String(index),shot.fulfillment||'video',['video','imageMotion']),choice('Motion','motion:'+String(index),shot.motionEffect||'Ken Burns',['Ken Burns','Pan Left','Pan Right','Push In','Pull Out','Tilt Up','Tilt Down','Drift','Locked Frame']),choice('Motion speed','speed:'+String(index),shot.motionSpeed||'Slow',['Slow','Medium','Fast']),{tag:'label',children:[{tag:'span',text:'Full-screen statement'},{tag:'input',type:'checkbox',action:'statement:'+String(index),checked:!!shot.statement,disabled:busy,label:'Full-screen statement'}]},field('Statement reveal','reveal:'+String(index),shot.statementReveal||'words')]}]});\\nconst ensure=()=>{if(!draft||Array.isArray(draft)||draft.schemaVersion!==1)draft={schemaVersion:1,shots:[]};if(!Array.isArray(draft.shots))draft.shots=[]};\\nconst draw=()=>{ensure();StillMade.render('shots',draft.shots.length?draft.shots.map(shotCard):[{tag:'p',className:'empty',text:'No shots yet. Build from narration or add the first shot.'}]);raw.value=JSON.stringify(draft,null,2);summary.textContent=String(draft.shots.length)+' planned shot'+(draft.shots.length===1?'':'s');save.disabled=busy;build.disabled=busy||!(transcript.words?.length||text(transcript.text||script.text||(typeof script==='string'?script:'')).trim());document.getElementById('reset').disabled=busy;document.getElementById('add').disabled=busy};\\nconst changed=message=>{revision+=1;raw.value=JSON.stringify(draft,null,2);status.textContent=message||'Changes are local until you choose Review changes.'};\\nStillMade.onAction(event=>{if(busy)return;ensure();const parts=event.action.split(':'),kind=parts[0],index=Number(parts[1]),shot=draft.shots.find((item,position)=>position===index);if(kind==='remove'){draft.shots=draft.shots.filter((item,position)=>position!==index);changed();draw();return}if(kind==='up'||kind==='down'){const target=index+(kind==='up'?-1:1);if(target>=0&&target<draft.shots.length){draft.shots=draft.shots.map((item,position)=>position===index?draft.shots.find((candidate,candidatePosition)=>candidatePosition===target):position===target?shot:item);changed('Shot order updated.');draw()}return}if(!shot)return;if(kind==='narration')shot.voiceoverText=event.value;if(kind==='description')shot.shotDescription=event.value;if(kind==='size')shot.shotSize=event.value;if(kind==='type')shot.shotType=event.value;if(kind==='duration'){shot.estimatedScreenTime=Number(event.value);shot.generationLength=Math.min(15,Number(event.value)+2)}if(kind==='fulfillment'){shot.fulfillment=event.value;shot.fulfillmentSetBy='user'}if(kind==='motion')shot.motionEffect=event.value;if(kind==='speed')shot.motionSpeed=event.value;if(kind==='statement'){shot.statement=event.checked;shot.statementSetBy='user'}if(kind==='reveal')shot.statementReveal=event.value;changed()});\\nbuild.addEventListener('click',()=>{if(!busy){draft=plan();changed('Built a local draft from the current narration. Review every visual direction before applying.');draw()}});\\ndocument.getElementById('add').addEventListener('click',()=>{if(busy)return;ensure();const id='portable-shot-'+String(revision+1)+'-'+String(draft.shots.length+1);draft.shots=[...draft.shots,{id,voiceoverText:'',shotDescription:'',shotSize:'Medium',shotType:'Story',estimatedScreenTime:3,generationLength:5,fulfillment:'video'}];changed();draw()});\\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.shots))throw Error('Shot-plan JSON must be a version 1 object with shots.');draft=clone(value);changed();draw();status.textContent='Complete shot-plan data applied to this workspace.'}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 project shot plan.'}});\\nsave.addEventListener('click',async()=>{if(busy)return;const started=revision;busy=true;draw();status.textContent='Checking the complete shot plan…';try{const result=await StillMade.run({shotPlan:source,transcript,script,updatedShotPlan:draft,commit:true});draft=clone(result.shotPlan);if(started===revision)status.textContent='Shots are ready below. Review the before and after, then choose Apply.'}catch(error){status.textContent=error.message||'The shot plan could not be prepared.'}finally{busy=false;draw()}});\\nStillMade.onInput(values=>{source=clone(values.shotPlan||{schemaVersion:1,shots:[]});transcript=clone(values.transcript||{schemaVersion:1,text:'',words:[]});script=clone(values.script||{schemaVersion:1,text:''});draft=source.shots?.length?clone(source):plan();revision+=1;draw();status.textContent=draft.shots.length&&!source.shots?.length?'Built a starting plan from the current narration. Review it before applying.':'Edit any shot. Every unshown project field is retained.'});\\n\"\n}"
522
- },
523
- "lineage": {
524
- "parents": [],
525
- "changes": "Packaged original Block source for StillMade."
526
- }
527
- }
528
- };