stillmade-sdk 0.1.42 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/.stillmade/sdk-baseline.json +6 -8
  2. package/AGENTS.md +15 -10
  3. package/FRAME_VIEWS.md +113 -0
  4. package/INTERFACE_DESIGN.md +62 -22
  5. package/MOBILE_UI.md +4 -2
  6. package/MODULES.md +152 -6
  7. package/PASTE_TO_LLM.md +35 -25
  8. package/README.md +3 -2
  9. package/SDK.md +994 -550
  10. package/UI_AESTHETIC.md +22 -2
  11. package/blocks/generate/package.js +1 -0
  12. package/blocks/generate/versions/1.0.0/package.js +463 -0
  13. package/docs/build/audio-to-editor.md +36 -0
  14. package/docs/build/block-builder-contract.md +150 -0
  15. package/docs/build/comfyui.md +227 -0
  16. package/docs/build/concepts.md +40 -0
  17. package/docs/build/context.md +159 -0
  18. package/docs/build/cookbook.md +57 -0
  19. package/docs/build/custom-interface.md +617 -0
  20. package/docs/build/data-types.md +83 -0
  21. package/docs/build/frame-views.md +259 -0
  22. package/docs/build/generate-media.md +59 -0
  23. package/docs/build/github-applications.md +314 -0
  24. package/docs/build/hosted-images.md +214 -0
  25. package/docs/build/hosted-music.md +39 -0
  26. package/docs/build/hosted-speech.md +157 -0
  27. package/docs/build/hosted-text.md +246 -0
  28. package/docs/build/image-description.md +49 -0
  29. package/docs/build/interface-design.md +343 -0
  30. package/docs/build/javascript.md +63 -0
  31. package/docs/build/local-preview.md +61 -0
  32. package/docs/build/media-analysis.md +27 -0
  33. package/docs/build/media.md +400 -0
  34. package/docs/build/mobile-ui.md +106 -0
  35. package/docs/build/modules.md +487 -0
  36. package/docs/build/original-blocks.md +70 -0
  37. package/docs/build/outside-apis.md +128 -0
  38. package/docs/build/production-context-templates.md +12 -0
  39. package/docs/build/project-storage.md +94 -0
  40. package/docs/build/quickstart.md +48 -0
  41. package/docs/build/recipes.md +103 -0
  42. package/docs/build/script-handoff.md +45 -0
  43. package/docs/build/script-writer.md +34 -0
  44. package/docs/build/state.md +223 -0
  45. package/docs/build/testing.md +112 -0
  46. package/docs/build/timeline-edits.md +116 -0
  47. package/docs/build/timeline-proposals.md +76 -0
  48. package/docs/build/transcription.md +59 -0
  49. package/docs/build/triggers.md +59 -0
  50. package/docs/build/tutorial.md +52 -0
  51. package/docs/build/typescript.md +34 -0
  52. package/docs/build/video-generation.md +61 -0
  53. package/docs/build/web-reading.md +37 -0
  54. package/docs/build/with-your-ai.md +27 -0
  55. package/docs/changelog.md +9 -0
  56. package/docs/creators.md +21 -0
  57. package/docs/distribute/discovery.md +43 -0
  58. package/docs/distribute/imports.md +58 -0
  59. package/docs/distribute/publishing.md +29 -0
  60. package/docs/distribute/sdk-versions.md +36 -0
  61. package/docs/distribute/selling.md +14 -0
  62. package/docs/distribute/teams.md +60 -0
  63. package/docs/distribute/versioning.md +28 -0
  64. package/docs/examples.md +23 -0
  65. package/docs/gallery.md +26 -0
  66. package/docs/index.md +50 -0
  67. package/docs/native-mcp.md +307 -0
  68. package/docs/project-types/automation.md +43 -0
  69. package/docs/project-types/batches.md +50 -0
  70. package/docs/project-types/build.md +42 -0
  71. package/docs/project-types/completion.md +15 -0
  72. package/docs/project-types/conditions.md +21 -0
  73. package/docs/project-types/hosted-review.md +115 -0
  74. package/docs/project-types/onboarding.md +75 -0
  75. package/docs/project-types/running.md +309 -0
  76. package/docs/project-types/testing.md +72 -0
  77. package/docs/reference/application-artifacts.md +87 -0
  78. package/docs/reference/authoring-guide.md +134 -0
  79. package/docs/reference/browser-applications.md +267 -0
  80. package/docs/reference/capabilities.md +45 -0
  81. package/docs/reference/cli.md +71 -0
  82. package/docs/reference/connection-api.md +59 -0
  83. package/docs/reference/cooperative-jobs.md +13 -0
  84. package/docs/reference/desktop-capabilities.md +172 -0
  85. package/docs/reference/desktop-execution.md +77 -0
  86. package/docs/reference/errors.md +233 -0
  87. package/docs/reference/execution.md +800 -0
  88. package/docs/reference/first-party-blocks.md +40 -0
  89. package/docs/reference/generation-models.md +59 -0
  90. package/docs/reference/limits.md +306 -0
  91. package/docs/reference/manifest-kinds-controls.md +36 -0
  92. package/docs/reference/manifest.md +181 -0
  93. package/docs/reference/operations.md +36 -0
  94. package/docs/reference/package-jobs.md +35 -0
  95. package/docs/reference/parity.md +55 -0
  96. package/docs/reference/permissions.md +86 -0
  97. package/docs/reference/ports.md +26 -0
  98. package/docs/reference/types.md +268 -0
  99. package/docs/reference/universal-resolver.md +303 -0
  100. package/docs/reference/view-bridge.md +60 -0
  101. package/docs/reference/view-rules.md +15 -0
  102. package/docs/reference/workspace-sync.md +25 -0
  103. package/docs/sdk.md +34 -0
  104. package/docs/tools/block-remix.md +211 -0
  105. package/docs/tools/llm.md +2213 -0
  106. package/docs/tools/repository-adaptation.md +613 -0
  107. package/examples/check-clip.stillmade.json +4 -1
  108. package/examples/generate-video.stillmade.json +6 -2
  109. package/examples/research-topic.stillmade.json +5 -1
  110. package/examples/text-workflow.stillmade.json +3 -32
  111. package/examples/timeline-polish.stillmade.json +11 -3
  112. package/examples/transcribe-audio.stillmade.json +11 -3
  113. package/package.json +1 -1
  114. package/packages/block-cli/cli.js +13 -6
  115. package/packages/block-cli/dev-host/assets/host.js +76 -38
  116. package/packages/block-cli/dev-host/assets/index.css +1 -1
  117. package/packages/block-cli/format.js +1 -1
  118. package/packages/block-cli/templates.js +31 -13
  119. package/packages/block-cli/type-packages.js +119 -0
  120. package/packages/block-platform/block-readiness.js +5 -0
  121. package/packages/block-platform/canvas.js +2 -1
  122. package/packages/block-platform/catalog.js +27 -48
  123. package/packages/block-platform/native-host-inventory.js +0 -226
  124. package/packages/block-platform/plain-descriptions.js +1 -25
  125. package/packages/block-platform/project-type-starters.js +13 -53
  126. package/packages/block-platform/script-handoff.js +2 -4
  127. package/packages/block-platform/type-workspace.js +2 -0
  128. package/packages/block-sdk/appearance.js +3 -1
  129. package/packages/block-sdk/block-tier.js +1 -1
  130. package/packages/block-sdk/builder-contract.js +10 -8
  131. package/packages/block-sdk/capabilities.js +1 -1
  132. package/packages/block-sdk/contracts.js +6 -2
  133. package/packages/block-sdk/first-party-identities.js +1 -84
  134. package/packages/block-sdk/first-party-packages.js +3 -85
  135. package/packages/block-sdk/generation-catalog.js +15 -3
  136. package/packages/block-sdk/index.d.ts +2 -1
  137. package/packages/block-sdk/media-analysis-example.js +1 -1
  138. package/packages/block-sdk/mock-host.js +7 -1
  139. package/packages/block-sdk/module-host-calls.js +35 -10
  140. package/packages/block-sdk/module-hosted.js +15 -2
  141. package/packages/block-sdk/module-media-access.js +71 -0
  142. package/packages/block-sdk/module-node.js +1 -1
  143. package/packages/block-sdk/portable-media-actions.js +1 -1
  144. package/packages/block-sdk/runtime.js +1 -1
  145. package/packages/block-sdk/timeline-proposal-example.js +1 -1
  146. package/packages/block-sdk/transcription-example.js +1 -1
  147. package/packages/block-sdk/video-generation-example.js +1 -1
  148. package/packages/block-sdk/view-bridge.js +4 -1
  149. package/packages/block-sdk/view-design.js +17 -14
  150. package/packages/block-sdk/web-example.js +1 -1
  151. package/packages/design-system/block-kit.css +48 -12
  152. package/packages/design-system/block-kit.html +3 -2
  153. package/blocks/mcp-motion-planner/versions/1.1.0/package.js +0 -97
  154. package/blocks/motion-designer/versions/1.0.1/package.js +0 -173318
  155. package/blocks/motion-designer/versions/1.0.2/package.js +0 -173318
  156. package/blocks/motion-frame-review/versions/1.1.1/package.js +0 -465
  157. package/blocks/motion-frame-review/versions/1.1.2/package.snapshot.js +0 -572
  158. package/blocks/narration/package.js +0 -1
  159. package/blocks/narration/versions/1.0.0/package.js +0 -221
  160. package/blocks/narration/versions/1.0.1/package.js +0 -221
  161. package/blocks/native/sm.animated-scene/versions/2.0.0/package.js +0 -475
  162. package/blocks/native/sm.animated-scene/versions/2.1.0/package.js +0 -498
  163. package/blocks/native/sm.animated-scene/versions/2.2.0/package.js +0 -524
  164. package/blocks/native/sm.animated-scene/versions/2.3.0/package.js +0 -618
  165. package/blocks/native/sm.animated-scene/versions/2.3.1/package.js +0 -618
  166. package/blocks/native/sm.animated-scene/versions/2.3.2/package.js +0 -723
  167. package/blocks/native/sm.animated-scene/versions/2.3.3/package.js +0 -723
  168. package/blocks/native/sm.animated-scene/versions/2.3.4/package.js +0 -676
  169. package/blocks/native/sm.animated-scene/versions/2.3.5/package.js +0 -693
  170. package/blocks/native/sm.animated-scene/versions/2.3.6/package.js +0 -700
  171. package/blocks/native/sm.animated-scene/versions/2.3.7/package.js +0 -747
  172. package/blocks/native/sm.animated-scene/versions/2.3.8/package.js +0 -769
  173. package/blocks/native/sm.animated-scene/versions/2.3.9/package.js +0 -769
  174. package/blocks/native/sm.animated-scene-assistant/versions/1.0.0/package.js +0 -183
  175. package/blocks/native/sm.blueprint/versions/2.0.0/package.js +0 -358
  176. package/blocks/native/sm.blueprint/versions/2.1.0/package.js +0 -358
  177. package/blocks/native/sm.blueprint/versions/2.1.1/package.js +0 -358
  178. package/blocks/native/sm.blueprint/versions/2.1.2/package.js +0 -358
  179. package/blocks/native/sm.blueprint/versions/2.1.3/package.js +0 -381
  180. package/blocks/native/sm.blueprint/versions/2.1.4/package.js +0 -381
  181. package/blocks/native/sm.blueprint/versions/2.1.5/package.js +0 -339
  182. package/blocks/native/sm.blueprint/versions/2.1.6/package.js +0 -356
  183. package/blocks/native/sm.blueprint/versions/2.1.7/package.js +0 -363
  184. package/blocks/native/sm.blueprint/versions/2.1.8/package.js +0 -410
  185. package/blocks/native/sm.blueprint/versions/2.1.9/package.js +0 -422
  186. package/blocks/native/sm.blueprint-assistant/versions/1.0.0/package.js +0 -172
  187. package/blocks/native/sm.chat/versions/2.0.0/package.js +0 -144
  188. package/blocks/native/sm.chat/versions/2.0.1/package.js +0 -97
  189. package/blocks/native/sm.chat/versions/2.0.2/package.js +0 -100
  190. package/blocks/native/sm.chat/versions/2.0.3/package.js +0 -100
  191. package/blocks/native/sm.continue-if/versions/1.0.0/package.js +0 -168
  192. package/blocks/native/sm.describe-media/versions/2.0.0/package.js +0 -153
  193. package/blocks/native/sm.describe-media/versions/2.0.1/package.js +0 -156
  194. package/blocks/native/sm.describe-media/versions/2.1.0/package.js +0 -140
  195. package/blocks/native/sm.image-editor/versions/2.0.0/package.js +0 -183
  196. package/blocks/native/sm.image-editor/versions/2.0.1/package.js +0 -190
  197. package/blocks/native/sm.new-items/versions/1.0.0/package.js +0 -191
  198. package/blocks/native/sm.pick-photos/versions/1.0.0/package.js +0 -334
  199. package/blocks/native/sm.quality-audit/versions/1.0.0/package.js +0 -192
  200. package/blocks/native/sm.quality-audit/versions/1.0.1/package.js +0 -192
  201. package/blocks/native/sm.quality-audit/versions/1.0.2/package.js +0 -195
  202. package/blocks/native/sm.research/versions/2.0.0/package.js +0 -175
  203. package/blocks/native/sm.research/versions/2.0.1/package.js +0 -184
  204. package/blocks/native/sm.research/versions/2.0.2/package.js +0 -187
  205. package/blocks/native/sm.script/versions/2.0.0/package.js +0 -144
  206. package/blocks/native/sm.script/versions/2.1.0/package.js +0 -144
  207. package/blocks/native/sm.script/versions/2.1.1/package.js +0 -144
  208. package/blocks/native/sm.script/versions/2.1.2/package.js +0 -105
  209. package/blocks/native/sm.script/versions/2.1.3/package.js +0 -152
  210. package/blocks/native/sm.script/versions/2.1.4/package.js +0 -156
  211. package/blocks/native/sm.script/versions/2.1.5/package.js +0 -156
  212. package/blocks/native/sm.shot-plan/versions/2.0.0/package.js +0 -301
  213. package/blocks/native/sm.shot-plan/versions/2.1.0/package.js +0 -528
  214. package/blocks/native/sm.shot-plan/versions/2.1.1/package.js +0 -528
  215. package/blocks/native/sm.shot-plan/versions/2.1.2/package.js +0 -528
  216. package/blocks/native/sm.shot-plan/versions/2.1.3/package.js +0 -536
  217. package/blocks/native/sm.shot-plan/versions/2.2.0/package.js +0 -800
  218. package/blocks/native/sm.shot-plan/versions/2.2.1/package.js +0 -920
  219. package/blocks/native/sm.shot-plan-assistant/versions/1.0.0/package.js +0 -173
  220. package/blocks/native/sm.stock-search/versions/2.0.0/package.js +0 -174
  221. package/blocks/native/sm.thumbnail/versions/2.0.0/package.js +0 -137
  222. package/blocks/native/sm.thumbnail/versions/2.0.1/package.js +0 -140
  223. package/blocks/native/sm.transcribe/versions/2.0.0/package.js +0 -163
  224. package/blocks/native/sm.transcribe/versions/2.0.1/package.js +0 -168
  225. package/blocks/native/sm.whiteboard-assistant/versions/1.0.0/package.js +0 -175
  226. package/blocks/native/sm.youtube/versions/2.0.0/package.js +0 -217
  227. package/blocks/occasion-story/package.js +0 -1
  228. package/blocks/occasion-story/versions/1.0.0/package.js +0 -1658
  229. package/blocks/occasion-story/versions/1.0.1/package.js +0 -1699
  230. package/blocks/occasion-story/versions/1.0.2/package.js +0 -1682
  231. package/blocks/photo-reel-composer/versions/1.0.0/package.js +0 -3043
  232. package/blocks/photo-reel-composer/versions/1.0.1/package.js +0 -3026
  233. package/blocks/photo-reel-composer/versions/1.0.2/package.js +0 -4149
  234. package/blocks/product-ad-variants/versions/1.0.0/package.js +0 -2911
  235. package/blocks/product-launch-director/versions/1.0.0/package.js +0 -103
  236. package/blocks/release-visuals/package.js +0 -1
  237. package/blocks/release-visuals/versions/1.0.0/package.js +0 -1492
  238. package/blocks/release-visuals/versions/1.0.1/package.js +0 -1517
  239. package/blocks/release-visuals/versions/1.0.2/package.js +0 -1500
  240. package/blocks/screen-recorder/package.js +0 -1
  241. package/blocks/screen-recorder/versions/1.0.0/package.js +0 -223
  242. package/blocks/screen-recorder/versions/1.0.1/package.js +0 -223
  243. package/blocks/short-form-finish/package.js +0 -1
  244. package/blocks/short-form-finish/versions/1.0.0/package.js +0 -1043
  245. package/blocks/short-form-finish/versions/1.0.1/package.js +0 -1043
  246. package/blocks/short-form-finish/versions/1.0.2/package.js +0 -1043
  247. package/blocks/short-form-finish/versions/1.0.3/package.js +0 -1026
  248. package/examples/saas-product-launch-reviewed-source.stillmade.json +0 -383
  249. package/examples/saas-product-launch.stillmade.json +0 -304
  250. package/packages/block-platform/dealer-inventory-video-project-type.js +0 -38
  251. package/packages/block-platform/first-revenue-project-types.js +0 -46
  252. package/packages/block-platform/fixture-starters.js +0 -13
  253. package/packages/block-platform/launch-project-source.js +0 -10
  254. package/packages/block-platform/launch-project.js +0 -30
  255. package/packages/block-platform/motion-project-types.js +0 -55
  256. package/packages/block-platform/motion-starters.js +0 -14
  257. package/packages/block-platform/product-ad-variants-project-type.js +0 -30
  258. package/packages/block-platform/product-launch-updated.js +0 -90
  259. package/packages/block-platform/revenue-review-project-types.js +0 -36
  260. package/packages/block-platform/revenue-review-starters.js +0 -13
  261. package/packages/block-platform/script-writer.js +0 -29
  262. package/packages/block-platform/website-source-block.js +0 -14
package/docs/index.md ADDED
@@ -0,0 +1,50 @@
1
+ # StillMade developer documentation
2
+
3
+ ## Build for StillMade
4
+ A Block is a reusable production capability. Place it in a Project Type and it becomes a Step, with its own configuration and pinned version. StillMade handles the production workspace, typed connections, and persistent project context.
5
+
6
+ ## Build an original Block
7
+ Give your coding agent [the SDK authoring contract](tools/llm.md) and your idea. Build on the SDK contracts from the first iteration, then select the finished source folder in StillMade. The implementation and interface import unchanged; no adaptation phase is needed. See [original SDK folders](build/original-blocks.md).
8
+
9
+ ## Adapt an existing repository
10
+ This public SDK contains the contracts, examples and tooling needed to adapt a GitHub repository outside StillMade. Coding agents can inspect the repository, retain licensing and return one installable .stillmade-block file. [Portable packages and repository adaptation](tools/repository-adaptation.md).
11
+
12
+ ## Choose what to build
13
+ - [Build your first Block](build/quickstart.md): create, test, preview, and package a working capability.
14
+ - [Block builder contract](build/block-builder-contract.md): the rules every Block follows, however it is made, and how readiness is judged.
15
+ - [Tutorial: a React Block in 30 minutes](build/tutorial.md): build, preview with hot reload, test offline, import and publish.
16
+ - [What you can build](gallery.md): templates and complete examples across video, images, music, data, documents, integrations, education and e-commerce.
17
+ - [Preview with hot reload](build/local-preview.md): start from a template for any runtime, preview the interface in StillMade's own view host, and test offline with stand-ins for every hosted operation.
18
+ - [Generate images](build/hosted-images.md): create a reviewed prompt-to-image Block with quality and payment chosen in StillMade.
19
+ - [Generate speech from a script](build/hosted-speech.md): declare typed audio, suggest a catalog voice, review cost, and listen before accepting.
20
+ - [Frame views](build/frame-views.md): interfaces written with React or another framework, SVG, canvas and drag, with theming and shared editing.
21
+ - [Outside APIs](build/outside-apis.md): call any API with the person's own key or OAuth sign-in, through declared origins and published OpenAPI adapters; keys never reach Block code.
22
+ - [Project storage, reads and assets](build/project-storage.md): keep values and files of up to 64 MiB per project in the Block's cloud storage, read the project, add media assets and propose edits people review and undo.
23
+ - [Triggers and unattended runs](build/triggers.md): run on new media, a schedule, a webhook, another project's completion or a provider event, once the owner turns it on; hosted Blocks stay inside an approved budget.
24
+ - [Data types](build/data-types.md): files (PDF, text, CSV, JSON, ZIP), documents, tables, links, dates and colors, with their controls, result layouts and conversions.
25
+ - [Module Blocks](build/modules.md): modern JavaScript with npm libraries and WebAssembly (OpenCV and other C/C++ builds), sandboxed in the browser, with on-device media processing (decode, cut, join, extract and normalise audio and video).
26
+ - [Analyze media](build/media-analysis.md): ask about a saved video (optionally one time range) or up to four images and get timestamped evidence.
27
+ - [Read the web](build/web-reading.md): read a public page or research a topic with cited sources, paid with StillMade credits.
28
+ - [Generate music and sound effects](build/hosted-music.md): create music or a sound effect with the app's generators, paid with StillMade credits.
29
+ - [Transcribe stored audio](build/transcription.md): return reviewed text and word timings through the host-owned BYOK boundary.
30
+ - [Add speech to the Editor](build/audio-to-editor.md): place an accepted project recording on the audio lane at the playhead.
31
+ - [Build a Project Type](project-types/build.md): assemble an ordered workflow from compatible Blocks.
32
+ - [Build with your own AI coding tool](tools/llm.md): take the complete authoring guide to Claude, Codex, Gemini, or another coding assistant.
33
+
34
+ ## SDK and documentation
35
+ The **SDK** is the code, validators, isolated runtime, TypeScript declarations, examples, and command-line tools you download and run. This **documentation** explains their contracts, workflows, and integration boundaries. Both are versioned for SDK 0.1.0.
36
+
37
+ [Download the SDK](sdk.md) or explore the [API reference](reference/execution.md).
38
+
39
+ ## Development lifecycle
40
+ 1. Describe the capability and declare its typed inputs and outputs.
41
+ 2. Implement a recipe, standalone JavaScript function body, or supported declarative host request.
42
+ 3. Test realistic synthetic examples, including edge cases.
43
+ 4. Preview the interface with `stillmade-block dev` (hot reload, stand-ins for hosted calls), package the tested source, and import it into StillMade.
44
+ 5. Place the Block into a Project Type and rehearse its connections.
45
+ 6. Release an immutable version when you are ready to share.
46
+
47
+ ## Production model
48
+ Normal users work through ordered Steps. They add a capability at a position in the workflow; compatible primary ports connect automatically. Secondary values can come from scoped project context. A technical graph is not required to build a Project Type.
49
+
50
+ Read [Blocks, Steps, and Project Types](build/concepts.md) before designing a package.
@@ -0,0 +1,307 @@
1
+ # StillMade assistant connections
2
+
3
+ StillMade's optional MCP adapter exposes the same creation-draft service used by Create, plus saved project context and run inspection. It does not run inside the editor or control an open StillMade tab. The in-app assistant is separate and project-scoped.
4
+
5
+ ## Recover a submitted result in the app
6
+
7
+ An open Block workspace exposes `submittedRecovery` when this account/device has
8
+ a pending hosted request. Its inspection contains the request/run identity,
9
+ recovery kind and availability, without quotes, settings, credentials or media.
10
+ When the user asks to recover that output, native chat can offer
11
+ `recover_submitted_result` with the exact inspected `requestId`.
12
+
13
+ This is a project edit through the existing review and task authorization path.
14
+ It reads the submitted request, verifies its result and saves it through the
15
+ shared host. It does not dispatch generation or approve spending. The returned
16
+ saved receipt distinguishes `applied`, `retained-for-review` and `already-saved`.
17
+ Batch and connected outputs remain for review; changed single-run inputs also
18
+ prevent automatic application. A failed lookup or save is not a completion.
19
+ Saved-project MCP can retrieve a completed capability request with
20
+ `recover_project_capability_request`; retaining or selecting it remains this
21
+ separate native action.
22
+
23
+ The local **stdio MCP adapter** is the currently verified connection path for clients that can run a local process. The separately gated remote OAuth code path has not been exercised with a real ChatGPT or Codex host. The adapter can connect to a deployed StillMade backend over HTTPS once the backend has been explicitly configured and deployed.
24
+
25
+ ### Development HTTP MCP transport
26
+
27
+ The server also provides `/api/agent/mcp` as a Streamable HTTP transport for
28
+ development clients that can privately supply a StillMade connection bearer
29
+ token. It is disabled unless `STILLMADE_AGENT_ENABLED=true` and
30
+ `STILLMADE_REMOTE_MCP_ENABLED=true`. Set `STILLMADE_REMOTE_MCP_ORIGIN` to the
31
+ exact HTTPS application origin or a loopback HTTP origin. The route rejects a
32
+ different Host or browser Origin and resolves the connection on every request.
33
+ Tools still use the same capability registry, account/project scopes, revisions
34
+ and receipts as stdio. Manually issued `sm_agent_` tokens remain the development
35
+ transport; they are separate from OAuth grants.
36
+
37
+ ### Gated remote OAuth path
38
+
39
+ The server has protected-resource and authorization-server discovery at
40
+ `/.well-known/oauth-protected-resource` and
41
+ `/.well-known/oauth-authorization-server`. The authorization code flow uses
42
+ StillMade sign-in and approval, S256 PKCE, one-use five-minute codes, and
43
+ hashed seven-day `sm_oauth_` bearer tokens. Each token is bound to the exact
44
+ `/api/agent/mcp` resource and a pre-registered client ID. Supported scopes are
45
+ `catalog:read`, `creations:read`, `creations:write`, `projects:read`, and
46
+ `runs:read`. Draft writes save private Create drafts only. Project edits,
47
+ publication, Block execution, and spending remain unavailable on this OAuth
48
+ grant. The user chooses up to 25 currently accessible projects for read access;
49
+ none is selected by default. Access to a shared project is checked again on
50
+ each read, so losing the underlying share also ends the connection's access.
51
+ The HTTP transport now offers the same `stillmade://agent/guide` and
52
+ `stillmade://sdk/block-authoring` resources and Block-authoring/debug prompts
53
+ as the local stdio adapter. These are guidance only; tool permissions still
54
+ come from the authenticated, scoped capability registry.
55
+
56
+ To stage a real client test, configure `STILLMADE_AGENT_ENABLED=true`,
57
+ `STILLMADE_REMOTE_MCP_ENABLED=true`, `STILLMADE_AGENT_OAUTH_ENABLED=true`,
58
+ the exact HTTPS `STILLMADE_REMOTE_MCP_ORIGIN` ending in `/`, and
59
+ `STILLMADE_AGENT_OAUTH_CLIENTS` as a JSON array of registered `clientId` and
60
+ `redirectUris` values. Use the exact callback supplied by the host. The
61
+ `0300_agent_oauth_grants.sql` migration was applied and checked in the connected
62
+ Supabase project on 30 September UTC. The feature flags and client registration
63
+ have **not** been enabled; no live host acceptance has been performed. Do not
64
+ add the remote endpoint to the portable plugin package until that test passes.
65
+ The consent page returns to the same request after a StillMade Google sign-in;
66
+ email sign-in stays on that page.
67
+ For a credential-free local integration check, run
68
+ `node scripts/local-auth-acceptance/verify-agent-oauth.mjs` from the checkout.
69
+ It starts disposable Auth/PostgreSQL, applies the numbered migrations, and
70
+ checks the OAuth/MCP tool, resource, prompt and revocation paths without contacting a paid
71
+ provider. It does not establish ChatGPT host compatibility.
72
+
73
+ ## Enable the backend
74
+
75
+ An operator must have the `agent_connections` schema and set `STILLMADE_AGENT_ENABLED=true`. That table was observed in the connected Supabase project on 30 September UTC. Existing project, Block and account storage must already be configured.
76
+
77
+ Optionally set `STILLMADE_AGENT_DIAGNOSTICS=true` for a bounded request-failure feed. It holds up to 200 metadata records in each server process and disappears on restart. No request bodies, headers, raw paths, query strings, provider messages or stacks are collected. On serverless deployments, results cover only the responding instance.
78
+
79
+ Ordinary creation does not depend on agent tables or the MCP adapter. Disabling agent access rejects agent requests; it does not change Create. The connection settings load only when opened, and there is no editor polling. MCP uses separate IP/account rate counters and a process-local limit of two active tool calls per account/four overall, without consuming creation concurrency slots. It still shares database/storage resources; performance and cross-instance capacity have not been measured.
80
+
81
+ ## Connect a local MCP client
82
+
83
+ 1. Open Settings → Assistant connections.
84
+ 2. Name a connection, choose permissions and expiry (1–30 days), and create it. Only catalog browsing is checked initially. Project/run access defaults to no projects; select projects explicitly or enter project IDs. Draft permissions apply to your accessible creation library, separately from project restrictions.
85
+ 3. Copy the token immediately. It is shown once, never saved to browser storage, and the server stores only its hash. Revoke it from Settings at any time.
86
+ 4. In a local checkout, install the isolated adapter dependencies with `npm ci --prefix packages/stillmade-mcp --ignore-scripts`. Node 20 or newer is required.
87
+ 5. Configure your MCP client using its supported environment/secret settings:
88
+
89
+ ```json
90
+ {
91
+ "mcpServers": {
92
+ "stillmade": {
93
+ "command": "node",
94
+ "args": ["/absolute/path/to/AAA/packages/stillmade-mcp/server.mjs"],
95
+ "env": {
96
+ "STILLMADE_URL": "https://your-stillmade-host.example",
97
+ "STILLMADE_AGENT_TOKEN": "YOUR_CONNECTION_TOKEN"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ Use the backend origin, without a path. HTTP is accepted only for localhost. Redirects are rejected. Never put your connection token in a committed config file, prompt, URL, or Block source. The adapter does not need your password, Supabase session, provider keys or database credentials.
105
+
106
+ ## Available user actions
107
+
108
+ - `list_catalog`, `search_marketplace`, `find_existing_blocks`
109
+ - `search_github_candidates`, `inspect_github_repository`, `read_github_source`, `inspect_github_sdk_package`
110
+ - `get_block_authoring_guide`, `search_documentation`, `validate_block_source`, `test_block_source`
111
+ - `list_creations`, `get_creation`, `save_creation`, `begin_block_remix`
112
+ - `list_projects`, `get_project_context`
113
+ - `get_run`, `list_recent_runs`
114
+ - With `analytics:read`: `get_creator_analytics`, `get_creator_retention`, `get_creator_dotplot`, `get_my_listing_reviews`
115
+
116
+ `analytics:read` returns only the connection owner's own creator reports. No tool accepts another creator or account ID, and project-limited connections are rejected. Dot-plot rows are creator-scoped pseudonyms, not account IDs. See `docs/ANALYTICS.md`.
117
+
118
+ Live-tab inspection and control are no longer exposed in the app connection UI.
119
+ External MCP clients continue to use the saved catalog, creation, project-context,
120
+ and run-inspection tools listed above.
121
+
122
+ ## Reuse first
123
+
124
+ Before authoring, the client calls `find_existing_blocks` with the goal and, when
125
+ known, the inputs it starts from and the results it must produce. It searches
126
+ reviewed Marketplace listings, tested Community Blocks, built-ins and, for a
127
+ connection that may read creations (`creations:read`), the person's own drafts
128
+ and private Blocks, by function and name, with no model, provider or credit
129
+ cost, and returns one outcome with a confidence. Only confidence `likely` (the
130
+ Block's name and description cover the goal) or `verified-contract` (its declared
131
+ inputs and results match by meaning) means existing Blocks already do the job.
132
+ `partial` means a close Block, not one that does the job: the client shows it as a
133
+ close Block the person can open and keeps building unless they choose it.
134
+
135
+ - `use` or `use-own` (likely or verified-contract): an existing Block already does
136
+ it; offer it instead of building. `use-own` with confidence `partial` is the
137
+ person's own close Block: show it, and keep building.
138
+ - `remix` (partial): a close Block allows an attributed remix. `begin_block_remix`
139
+ creates a private draft from that exact version, with its license, notices and
140
+ creator credit; retrying the same `requestId` returns the same draft. Offer it
141
+ beside the build.
142
+ - `compose` (verified-contract): two existing Blocks chained by declared meanings
143
+ do it; offer them in order. Blocks that only share a kind of value (text into
144
+ text) are never composed.
145
+ - `build-gap` (partial): a Block makes the results but needs an input the person
146
+ does not have; they can build only that missing step in front of it.
147
+ - `build`: nothing close exists, or the person wants their own version.
148
+
149
+ `validate_block_source` and `save_creation` also list up to three similar existing
150
+ Blocks (`similarExisting`). Publishing an exact copy of another creator's public
151
+ Block without remix lineage is refused.
152
+
153
+ ## Block authoring uses the connected model
154
+
155
+ When a user asks Claude, GPT, or another MCP client to create or refine a Block,
156
+ the connected client model writes the complete SDK package itself. The default
157
+ sequence is `find_existing_blocks`, `get_block_authoring_guide`, targeted `search_documentation` calls,
158
+ local source composition by that model, `validate_block_source`, repair of every
159
+ reported failure, optional offline `test_block_source` for an eligible package,
160
+ and `save_creation` with `kind: "block"` and the observed
161
+ revision. The adapter also exposes `stillmade://sdk/block-authoring` and the
162
+ `create_stillmade_block` prompt so clients receive this policy before authoring.
163
+
164
+ `validate_block_source` performs the current schema, static source, interface,
165
+ collaboration, appearance, export, permission, and remix-readiness admission
166
+ checks. It does not execute fixtures or previews. A Block save is rejected unless
167
+ that static admission passes. The response records `execution: "not-run"`, zero
168
+ StillMade credits, and zero StillMade provider calls instead of implying runtime
169
+ verification.
170
+
171
+ `test_block_source` needs a connection with `creations:write`. It runs up to
172
+ five declared JavaScript or recipe fixtures after static admission. JavaScript
173
+ uses the existing isolated SDK worker; recipe execution is deterministic. The
174
+ tool provides no provider, network, or desktop executor. Capability, ComfyUI,
175
+ and native desktop packages require their separate reviewed host path. A
176
+ fixture pass does not approve visual quality, a customer result, or publication.
177
+
178
+ This path never calls the in-app AI Block Builder, a hosted provider, or a paid
179
+ research action. Asking to create a Block is not permission to spend. External
180
+ MCP connections do not receive app-control or paid-dispatch capabilities.
181
+ Declaring a capability or ComfyUI runtime only
182
+ describes later review-required execution and does not dispatch it while authoring.
183
+
184
+ For a public repository that already contains a StillMade SDK package,
185
+ `inspect_github_sdk_package` reuses the existing GitHub importer at one exact
186
+ commit. It returns verified source pins, package identity, and static admission.
187
+ Only a complete, unredacted package of at most 40 KB is returned to the host;
188
+ larger or redacted packages are classified for a smaller source selection.
189
+ This inspection does not save, run, install, or publish anything. It does not
190
+ declare the repository's redistribution rights on the user's behalf.
191
+
192
+ Draft saves use the existing Create service, protected namespaces, team permissions, checkpoints, immutable object storage and optimistic revision checks. Supply revision `0` for a new draft, or the actual current revision for an edit. Returned source may be redacted or truncated: never blindly save a partial document. If a save times out or conflicts, inspect the draft first. The adapter does not automatically retry writes.
193
+
194
+ Saved context uses the existing project context contract and storage reader. Inspection does not open an editor, reset a project's inactivity clock, dispatch a provider, poll/verify retained media, settle a charge or retry a run. Project reads cover owned and currently shared projects within the connection's selected project scope.
195
+
196
+ The server validates scopes, project restrictions, expiration, revocation and account suspension on every call. Tool invocation records contain tool name, actor, timestamps and outcome, with no inputs/results. A crash may leave `started`, meaning the result is unknown. Tokens cannot be used as ordinary application session tokens.
197
+
198
+ ## Internal debugging
199
+
200
+ Internal tokens are separate from user tokens. Issue one using `POST /api/agent/internal/connections` with a normal administrator session from an allowed admin IP after the existing MFA step. Example body:
201
+
202
+ ```json
203
+ {"name":"Developer diagnostics","projectIds":null,"expiresInDays":1}
204
+ ```
205
+
206
+ The internal endpoint replaces requested scopes with `debug:read` and `analytics:admin`; the public endpoint never grants either, and a user token that somehow holds them has them removed when it is resolved. Configure a separate MCP instance with `STILLMADE_MCP_AUDIENCE=internal`. Existing admin IP restrictions, fresh administrator/suspension checks and recent MFA apply again on **every** tool discovery and invocation. MFA expiry can require re-verifying in the admin UI even before token expiry. Revoke internal tokens through the same Settings connection list.
207
+
208
+ Internal tools: `get_project_debug_state`, `get_failed_requests`, `get_recent_errors`, `get_credit_job`, `get_agent_activity`, `get_runtime_info`. Cross-account tools require an explicit account ID; project restrictions still apply. Global/account-wide tools are unavailable on project-limited connections. Credit inspection returns recorded job accounting, not proof of complete provider settlement.
209
+
210
+ Whole-app analytics tools (`analytics:admin`): `get_analytics_definitions`, `get_analytics_overview`, `get_analytics_retention`, `get_analytics_dotplot`, `get_analytics_funnel`, `get_analytics_signals`, `get_analytics_production`, `get_analytics_marketplace`, `get_analytics_acquisition`, `get_analytics_experiments`, `get_analytics_economics`, `get_analytics_health`, `get_analytics_timeline`. They return the same report envelope as the admin Analytics tab (definition, period, coverage, population, `measurement_status`) and use the same strict parameters; raw SQL, HogQL or unknown fields are rejected. Create the internal connection with `"projectIds":null`, because whole-app analytics are unavailable on project-limited connections. Analytics tool calls never count as customer activity.
211
+
212
+ The `debug_stillmade` MCP prompt starts an inspection workflow. Begin with a reported symptom and project/run/request IDs; correlate saved structure, error codes and uncertain dispatch states. Record hypotheses separately from observations. Tests and reproduction actions still require the authorization specified in the project's instructions.
213
+
214
+ ## Assistant boundaries and remaining work
215
+
216
+ The in-app Gemini conversation uses the trusted project assistant path and is
217
+ limited to the current project. It does not use the external MCP connection or
218
+ expose the former live-tab control bridge. The remote MCP adapter remains available
219
+ for the catalog, creation, saved-project, and run-inspection tools listed above,
220
+ but it cannot control an open StillMade tab.
221
+
222
+ Supported saved-project workflow edits: `begin_project_block_remix` starts a private Create draft from the exact pinned Block source. After `get_creation` / `save_creation` edits, `preview_project_workflow_edit` and `apply_project_workflow_edit` add, replace, move or remove a Block in the Project Type. Add/replace require a complete saved Block creation draft and `creations:read`; the Block passes static SDK admission and a remix must identify the exact current parent. Apply requires `projects:read`, `projects:write`, the three preview digests and a unique request ID. It commits the Type and Canvas together, pins the exact package, and archives affected results. The call does not run a Block. `prepare_project_type_draft` copies the current exact project workflow and embedded Block code to Create for listing review; only the project owner can do this, with `projects:read` and `creations:write`. It returns whether the project stayed current during the handoff. When the account already has a Project Type with the same name and no `entityId` is given, it saves nothing and names that Project Type (`AGENT_CONFLICT`): ask the person, then pass its `entityId` and revision to update it, or `separateCopy: true` for a new copy. It does not publish.
223
+
224
+ Local verification on September 27, 2026: focused PGlite workflow mutation and MCP capability tests covered exact Block draft replacement, move replay, remix ancestry, and listing draft source/version handoff; project workflow and Create-draft tests passed; the client production build completed. These checks do not establish a live account or production deployment acceptance.
225
+
226
+ Not implemented: hosted Streamable HTTP/OAuth onboarding, arbitrary headless project edits outside the reviewed workflow/input paths, paid run approvals/dispatch, exporting/publishing, persistent cross-instance logs, PostHog/Sentry/deployment integrations, browser session diagnostics, and automatic reproduction/testing. Future paid actions must use the existing trusted integration, exact approval, whole-workflow budget and settlement boundaries; read access grants no spending authority.
227
+
228
+ At the initial adapter installation, no automated tests, browser QA, protocol smoke tests, builds or migrations had been run. The isolated adapter dependency installation was performed with lifecycle scripts disabled. The later focused local verification above covers the new workflow tools; connection, revocation and live deployment compatibility still need acceptance with a real account.
229
+
230
+ Protocol implementation follows the [official MCP TypeScript SDK](https://ts.sdk.modelcontextprotocol.io/server). The SDK is isolated in the adapter package; it adds no dependency to web/desktop creation bundles.
231
+
232
+ ## Saved project task controls
233
+
234
+ With `projects:read`, `inspect_project_tasks` reads shared task status without an open tab or navigation. Pass `projectId` and optionally an exact `taskId`; list results accept `offset`/`limit` (maximum 50) and return `nextOffset`. Each page observes current state, so re-inspect a selected task before controlling it. Reads do not promote tasks or pause work when rollout is disabled.
235
+
236
+ Separately select `projects:control` **and** `projects:read` when creating a connection to allow `control_project_task`. Existing grants never gain this permission automatically. It controls only an existing authorized shared task through the coordinator; it is not a project-edit, generation, spending or approval grant. The current requester/editor/owner rules apply. Viewers cannot intervene in another person's task; only its authorized requester or the owner can resume. Takeover changes the lead, preserving the original requester and payer.
237
+
238
+ Supply `projectId`, `taskId`, `action` (`pause`, `takeover`, `cancel`, `resume`), a new UUID `requestId`, and the exact observed `requesterId`, `taskRevision`, `instructionRevision`, `controlEpoch`. Optional `reason` is at most 300 characters. A changed task requires fresh inspection. Reuse the identical request ID and payload only to retrieve the original acknowledgment; replay never applies the effect again. `receipt` describes that original action while `task` reflects current state. Current connection grants, project access and task authority are rechecked even on replay.
239
+
240
+ Pause/cancel fence later effects but cannot guarantee already accepted provider work stops or avoids its existing cost. Resume queues revalidation of current state; normal source, plan, review and budget requirements still apply. Native and external task controls use the same coordinator and require the complete observed fence. Older clients that omit it receive `PROJECT_AI_REFRESH_REQUIRED` and must refresh; their request makes no task change. Saved task records and receipts are retained. Arbitrary review-mode changes and hosted dispatch are not exposed.
241
+
242
+ The backend additionally requires `0193_project_ai_control_receipts.sql` after existing coordination and permission migrations. Local verification and configured database application are recorded separately from deployment and ordinary-account acceptance.
243
+
244
+ ## Retrieve a submitted capability result
245
+
246
+ `recover_project_capability_request` is a delivery-only read, separate from the app's reviewed `recover_submitted_result` edit. The existing actor-owned `get_run`/`list_recent_runs` metadata includes `request_id` for discovery. Supply an exact saved `projectId` and that original UUID `requestId` under both `projects:read` and `runs:read`. The request must belong to the connection actor and that project; the existing capability lookup also requires current project edit access. It verifies the retained source and stored media through the same service used by native delivery recovery, then rechecks the unchanged ledger and current access. Optional `expectedRevision` rejects a changed repeat read.
247
+
248
+ A completed request returns its redacted retained outputs with `recoveryState:retrieved`, `validatedFor:delivery-only`, `applied:false` and `selectionChanged:false`. This retrieves data only: it does not attach output to a placement, retain a project candidate, select a result, poll a provider, execute, settle credits or grant approval. The normal output envelope remains bounded; `truncated:true` means only an excerpt was returned. Media addresses, storage keys and credentials remain redacted. Pending, failed or uncertain work is not reported as retrieved and returns no partial output. A missing or invalid original is unavailable, never a reason to rerun automatically.
249
+
250
+ No live tab is needed for this read. Project retention/selection still uses the existing reviewed recovery UI; canceled or stale task intent cannot be overridden by retrieving earlier data. Async provider reconciliation and full external execution/recovery parity remain separate work.
251
+
252
+ ### Retained result inspection
253
+
254
+ Retained unselected results have a separate read-only inventory. The Result tab
255
+ shows eight candidates at a time. Use native `list_retained_results` or external
256
+ `list_project_flow_retained_results` with `{placementId, revision:
257
+ unusedResultsRevision, offset, limit}` (plus `projectId` externally); list pages
258
+ contain at most eight candidates. Only records still retained for the current
259
+ Block package are included: unused single results, unselected connected results,
260
+ and batch records explicitly marked unused after a source change. The ordinary
261
+ batch picker is separate. `historyComplete:false` means evicted history is not
262
+ recoverable through this inventory, even at its final page.
263
+
264
+ Each candidate has an exact `candidateId`, `outputDigest`, run/item/attempt
265
+ metadata, and captured-input/output counts and cursors. Native
266
+ `inspect_retained_result` and external `inspect_project_flow_retained_result`
267
+ accept `{placementId, revision: unusedResultsRevision, candidateId, section,
268
+ offset, limit}`. Sections `inputs` and `outputs` page at most 16 identities or
269
+ previews. Sections `text` and `collection` also require `outputKey` and the exact
270
+ preview `path`; text requires its returned `identity` and permits at most 4,000
271
+ characters, collections at most 16 members. Reuse the exact candidate and list
272
+ revision on every page. Changes anywhere in retained records, package or preview
273
+ restrictions invalidate that revision. Inspect fresh state after a conflict.
274
+ Current project read access is rechecked after saved reads; native/UI caches
275
+ reset when the authorized reader changes. External/native results redact media
276
+ addresses. Sensitivity and prior preview restrictions still apply; a restricted
277
+ candidate cannot become inspectable through a later page. Captured inputs remain
278
+ bounded metadata and may be incomplete; nested structured previews disclose
279
+ omitted fields rather than claiming a complete document. These reads never
280
+ select a candidate, restore media, dispatch work, or substitute current output
281
+ for a retained value.
282
+
283
+ ### Native output observations and original context
284
+
285
+ Mapped native Canvas outputs use the installed exact-version host port adapter. Flow can show a saved image, video or text value as `ready` with `observation.kind: "native-canvas-output"` and `runReceiptAvailable:false`. The Inspector labels that value **Available**; it does not invent a completed run, receipt or result pin. The exact selected asset/version is preserved in Result and Using. Missing values, mismatched host identities and navigation-only workspace ports remain unavailable. `ProjectFlowNativeObservation` describes this read-only origin; normal output/source paging retains its identity. Native production-workspace connections also use the exact installed host manifest and declared port handles; a newer catalog release cannot redefine an older pin. Original standalone nodes without placement/version metadata retain their historical 1.0.0 contract. Unknown, mismatched and non-host pins cannot impersonate a production workspace.
286
+
287
+ Whole-project Script retains its original narration source. Transcript uses the selected Voiceover take’s recorded transcript and word timings, independently of the editable narration draft. Older takes without stored transcript text derive it from their own timed words. A new Transcript-only run protects the original Voiceover document; changing an unrelated narration draft does not invalidate it. Original legacy receipts that also include Script remain valid with their stricter source checks. An older proposal cannot replace original reads with current documents, and a legacy result lacking derived proof must be rerun before guarded adoption. Other derived fields and arbitrary dynamic reads require separate attribution. Scoped narration and supported shot/scene collections capture their original Blueprint, Shot Plan, Animation, Panels and Board contributors, including empty originals whose later additions could change the result. They do not substitute the whole-project Script. Native asset inventories, generation records, scoped version histories and character/location/style collections can now retain their original contributor and membership proof when canonical reconstruction exactly matches the consumed value. A bounded v2 Canvas projection excludes only the exact host-dispatched producing placements while retaining their IDs/types, so saving their own output does not invalidate native collection membership. Current saved executable asset/generation members can retain their original selected-output, state and native-source evidence when exact canonical reconstruction matches the consumed collection. A producing placement’s own consumed previous output is captured separately when provable. Ambiguous, legacy, archived, private or unsupported collection members, local-only media, whole-project version metadata and noncanonical source documents remain unproven. v1 source reads stay compatible; new v2 captures require explicit server support. Media-dependent narration and arbitrary dynamic reads still require separate attribution.
288
+
289
+ Stateful host runs retain the exact starting-memory identity and resulting-state digest alongside original input/output evidence. Original native reads carry through subsequent memory transitions, connected batches, loops and checkpoint recovery. Declared initial/reset memory is distinct from legacy saved memory even when its bytes match; old receipts cannot gain proof from current documents or by removing a warning. Missing or changed state proof blocks protected workspace adoption. This is host-maintained provenance, not cryptographic attestation against rewriting an entire saved receipt. Older retained plans/checkpoints may require their existing recovery/reset path when the new memory evidence changes the plan identity.
290
+
291
+ Task-authored final Canvas adoption can bind the original native read union to the same transaction as the current task and Canvas execution checks. The host's `taskSourceReadSet` is retained in the exact save/recovery receipt, with explicit `assistantSourceReadSetVersions` capability negotiation. A lost response is recovered by reading the original commit; it does not resubmit an old proposal over newer work. Stale completed results may still be retained for review. Manual selection in saved Canvas projects now uses an acknowledged source save with the original native read union and `sourceCanvasPrecondition`, negotiated with `sourceCanvasPreconditionVersion:1`. Source roots and current execution content are checked under the same ordered transaction locks; layout-only changes are preserved. Exact request recovery distinguishes applied, not-applied and unresolved saves, including no-op selection, without replaying old work over newer selections. Servers without the capability refuse selection. Local drafts and unused-result retention remain separate. Legacy results do not gain missing original-source proof. Remaining native/background producers require separate coverage.
292
+
293
+ The saved-project inspector and compact handoff can open the exact source Block workspace through existing draft-save navigation guards. Account, project, read access, placement and matching package source are checked after drafts finish saving. The existing Editor opening suppresses automatic narration import/export for this navigation request. Previews without workspace navigation say **Inspect source Block**. Compact handoffs show required inputs needing attention even when the primary value is ready; **Using** targets the first such input.
294
+
295
+ Large Flow connection lists page 40 placements and offer **Find a Block** with direct keyboard access. Exact input links remain available after search. The map keeps its own bounded pages and selected neighborhood. Unchanged bounded scalar activity reports reuse the shared projection; new captured evidence, source changes and revoked access invalidate the relevant view.
296
+
297
+ External controllers can review one complete retained local connected run with `preview_project_flow_completed_results`, then select it using `use_project_flow_completed_results`. Apply requires the exact returned Flow, Canvas and candidate digests, a new request ID and the current task fence. Every selected row must have its original sealed v2 source receipt. The server validates the existing plan and original source roots, rechecks project/connection/task authority, and saves through shared Canvas operations. An acknowledged retry returns its original receipt without selecting the result again, even if the current selection has changed.
298
+
299
+ This external path supports complete recipe/JavaScript connected runs with current inputs, asset-descriptor batches with non-media outputs, and shared complete local loop receipts. All-assets, scene and selected-shots batches require the original complete inventory receipt captured and acknowledged before dispatch; it binds the original scope, ordered targets, exact plan and eight contributing workspace roots. Preview and apply check those original roots again, including workspaces that were empty when the batch started. JavaScript memory transitions require exact initial, reset or retained starting identity and resulting state with original sealed proof. Preview exposes digest-only `stateChanges`; apply saves the original outputs and memory without executing them again. Legacy/unproven or changed memory is unavailable. Hosted execution, decoded/generated media, incomplete runs and failure-recovery results still use their existing workspace review. Broad batches without original inventory proof remain unavailable; current inventory cannot be substituted for missing historical evidence. Inventory membership and each consumed item’s output or memory lineage are separate requirements. A local preview does not establish shared source proof. Preview and apply never dispatch a Block, load media, request model analysis or spend credits. A source/authority conflict keeps the retained result available for review; it does not silently rerun the workflow.
300
+
301
+ Completed local loops can retain their exact whole receipt in shared Canvas history without selecting outputs or advancing memory. A failed shared save preserves the original device checkpoint. Shared `retainedLoopRuns` summaries expose bounded run identities, pass counts and current selection for review; they do not claim revalidation. Retention is limited to four envelopes, 512 KiB per envelope and 1 MiB total per starting placement; exceeding a bound keeps device recovery and reports the limit rather than evicting old history. External selection validates the original whole loop and every consecutive pass against current sources, memory, task and authority, then uses the existing adoption path without dispatch. In the native workspace, another editor can explicitly choose a shared run without its original device checkpoint. Review validates the original complete receipt; Use rechecks its shared identity and the reviewed Canvas execution state before acknowledged selection. A newer selection or changed source requires fresh review.
302
+
303
+ Shared loop pass inspection uses the existing `list_project_flow_retained_results` and `inspect_project_flow_retained_result` operations. Initial discovery exposes bounded historical identities; explicit inspection verifies the original whole envelope before returning captured input identities and paged output/text/collection previews. It validates original evidence without requiring today's inputs to match, and does not select or execute the pass. Changed original history or revoked read access invalidates the response. Native Result review uses the same verified reader through **Inspect saved pass**.
304
+
305
+ Existing-media and host-action selections carry explicit selection metadata. Flow separates them from worker execution receipts and attempt history; a media selection identity is not a run ID. Saved selection still checks current authority and the reviewed Canvas/source state.
306
+
307
+ External connections must explicitly opt into `projects:write` alongside `projects:read` for reviewed Flow input, pin, result/memory changes and saved-media restoration. Defaults and existing connections do not gain permissions. Shared Flow reads recheck current connection authority after asynchronous work; all four Flow mutations recheck it in their write transaction, including replay. Media restoration rechecks through its existing before-write guard. Revocation, expiry, project/scope changes and suspension invalidate stale authority.
@@ -0,0 +1,43 @@
1
+ # Process future media
2
+
3
+ The Step workspace can save an owner-confirmed rule for **This step**, or for
4
+ **Connected steps** when at least two supported recipe/isolated JavaScript Steps
5
+ are connected. Its first primary input must accept media. The same manifest,
6
+ semantic roles, context permissions and execution API apply; Block authors do not
7
+ add a scheduler or write server code.
8
+
9
+ Save the project and review automation before activation. A connected review
10
+ runs every included package's admission and fixture tests, then a connected
11
+ sample. Fixtures are review data: only actual upstream sample outputs fill the
12
+ following connected inputs. The preview shows each completed Step. Confirming
13
+ pins the full plan, scope, settings and conditions. Changing a downstream Step or
14
+ connection invalidates the review, just as changing the starting Block does.
15
+ Existing media is skipped at activation; new retained versions in the project,
16
+ scene or selected shots become independent durable jobs.
17
+
18
+ The host supplies each queued primary source and resolves declared secondary
19
+ inputs from the saved project. Host image decoding and S3 output storage remain
20
+ outside the guest. Each completed Step is retained before the next executes.
21
+ `step_results` records the ordered per-placement outputs; `outputs` is the final
22
+ Step's output only after the connected job completes. If a later Step fails,
23
+ completed results remain previewable and can be explicitly adopted into their
24
+ matching placements. They never overwrite every Step with the final output.
25
+ Originals and current workflow outputs are preserved until that choice. Teams
26
+ editors can use results; only the project owner manages rules. Job history
27
+ paginates, and result media loads when expanded.
28
+
29
+ The rule pins the complete plan digest and pauses for review when the saved
30
+ workflow or settings change. Retries verify retained prefix inputs and source
31
+ identities before resuming. Ordinary processing does not invoke ComfyUI, local
32
+ models, hosted generation or arbitrary dependencies. The existing guest CPU,
33
+ heap and JSON limits apply alongside bounded host decoding, storage and job
34
+ execution. A one-megapixel decode ceiling is not a guarantee that every decoded
35
+ RGBA image fits the guest budget.
36
+
37
+ Automation requires its database migrations and a configured background worker;
38
+ see `docs/BLOCK_AUTOMATIONS.md` for deployment and bounds. Unretained/unsaved
39
+ versions and media outside saved project source documents are not discoverable.
40
+ SDK Block outputs are excluded from future-input discovery to prevent recursive
41
+ processing. A connected job's intermediate outputs are forwarded only inside
42
+ that job; they do not create new jobs. Unsaved browser-only changes are not
43
+ visible to the worker, and local/blob media must be shared before execution.
@@ -0,0 +1,50 @@
1
+ # Run on a selection or project
2
+
3
+ The Step workspace's **Apply to** control can run a Block with a primary
4
+ image/video/audio/asset input on selected assets, one scene, selected shots, or all
5
+ compatible current project media (up to 100 per batch). Selections are saved with
6
+ the Step's existing project document. Scene/shot membership uses explicit source-document
7
+ production metadata; it is never inferred from image content. Reference roles
8
+ are preserved, and a Block requiring a semantic role only receives matching
9
+ assets. Uploaded audio is correctly typed as audio.
10
+
11
+ Sources are pinned by asset/version, processed sequentially in sandbox workers,
12
+ and never overwritten. A changed source or revoked edit access stops the batch;
13
+ completed results remain available. Choose one result explicitly to continue a
14
+ single-asset sequence. The project retains the latest 200 batch previews.
15
+
16
+ New batch previews also retain the host-assigned item number and total, the input
17
+ digest, and bounded captured input identities. The explicitly selected primary
18
+ asset is recorded as project input; it does not inherit the connection replaced
19
+ by that selection. Private text, answers, media addresses and pixels are not
20
+ included in the inspection evidence. Sensitive ports remain redacted.
21
+
22
+ Flow history includes retained batch items. Selecting a result preserves its
23
+ original execution identity and captured inputs alongside the new semantic
24
+ selection reference. Older previews without recorded inputs show history as
25
+ unavailable. The Flow snapshot reads at most the last 100 batch previews and
26
+ returns the newest 30 combined history entries, with incomplete history labeled.
27
+
28
+ For trusted hosted capability Blocks, each completed item is acknowledged in the
29
+ saved project before its request recovery slot is released and the next item
30
+ can start. If the response or save is interrupted, **Check submitted run** reads
31
+ the original request. A recovered batch item is retained for explicit selection;
32
+ it is never automatically applied as the Block's current output. Repeating a
33
+ recovery check recognizes an already-retained provider result. Older recoveries
34
+ without the bound batch selection receipt are kept as unused results for review.
35
+
36
+ The platform helpers `batchCandidates`, `batchTargets`, and `runBatch` are included
37
+ in the downloadable SDK. `batchTargets(manifest, assets, scope)` accepts:
38
+
39
+ ```js
40
+ {kind: 'all-assets'}
41
+ {kind: 'selected-assets', assetIds: ['asset-1']}
42
+ {kind: 'scene', sceneId: 'scene_1'}
43
+ {kind: 'selected-shots', shotIds: ['shot-1', 'shot-2']}
44
+ ```
45
+
46
+ Asset references may carry explicit `sceneId`, `shotId`, `label`, and `role`.
47
+ Missing or incompatible selections fail before execution. These are interactive
48
+ batches over the shared project media index. A separate durable background runner
49
+ supports future saved versions from Canvas, Panels, White Board Motion, voiceover
50
+ and the editor, using the same identities and scoped context described above.
@@ -0,0 +1,42 @@
1
+ # Build a Project Type
2
+
3
+ ## Start from a workflow
4
+ Open [Project types](/marketplace/project-types) to inspect an existing type, or choose **Project type template** in the builder. Describe the workflow in chat or arrange the ordered list directly.
5
+
6
+ ## Add and configure Steps
7
+ Use **Add Step** at an insertion position to browse Blocks, import a package, or create the missing capability with AI. Each instance keeps its own ID, label, configuration, enabled state, and exact Block version.
8
+
9
+ ## Automatic insertion
10
+ `insertStep(type, package, index, catalog)` verifies both neighboring primary connections. It preserves secondary connections and returns a new type definition. It never mutates the original. `insertionLocations(type, package, catalog)` reports compatible positions when insertion fails.
11
+
12
+ ## Persisted structure
13
+ The JSON `stages` array stores ordered Steps. Each includes `id`, `blockId`, `version`, and `label`; optional fields include `config`, `enabled`, and `condition`. Embedded SDK Blocks live in `packages`. Explicit `connections` are the technical representation of typed relationships.
14
+
15
+ A custom Block's declared `script` output can explicitly connect to Voiceover's `input`. Run the Block, then review and apply its script in Voiceover; this does not generate audio or require a Canvas node. See [script handoff](../build/script-handoff.md) for the connection and acceptance rules.
16
+
17
+ ## Scaffold and test outside the app
18
+ ```sh
19
+ node packages/block-cli/cli.js create-type my-type.json
20
+ node packages/block-cli/cli.js validate my-type.json
21
+ node packages/block-cli/cli.js test my-type.json
22
+ node packages/block-cli/cli.js preview my-type.json
23
+ node packages/block-cli/cli.js pack my-type.json my-type.stillmade.json
24
+ ```
25
+ The SDK includes `examples/text-workflow.stillmade.json`, the Type `create-type` writes. Host workspaces use existing project context and controls; switching to a Step does not automatically call a paid generation provider.
26
+
27
+ ## A video and the Editor
28
+ A Type whose own Block renders the finished video (`timeline.render`) needs no Editor Step: that Block's page holds the inputs, a cheap check and the video. The Editor is a Step only when the person cuts by hand; then the Type ends there, and since the Editor (1.0) has captions and export built in, Export video is never a Step beside it (builder contract, "One job per Step"). The `create-type` scaffold ends in the Editor that way. `validate` and `test` do not check where a Type ends.
29
+
30
+ ## Module Blocks in a Project Type
31
+ A Type carries a module Block in `packages` with its files as text: `{manifest, module, moduleSource, tests}`, where `moduleSource` maps each file in `module.files` to its JavaScript text, exactly the bytes `module.files` names by size and sha256. A packed `.stillmade-module.json` stores the same files as base64; never paste that base64 into `moduleSource`. `validate` refuses a `moduleSource` that does not match its digest.
32
+
33
+ Let the CLI embed the Block instead. An entry of `packages` may be the path of the Block's packed file or of its folder, relative to the Type file, or the packed bundle itself:
34
+ ```json
35
+ {"packages": ["dist/creator.listing-voiceover-1.0.0.stillmade-module.json", "listing-video"]}
36
+ ```
37
+ `validate`, `test`, `preview` and `pack` read those entries and check every file against its digest, and `pack` writes the Type with each Block embedded, the file to import in StillMade. Only JavaScript travels this way: a module Block with `.wasm` or data files, or a frame view with its own files, cannot be embedded in a Type.
38
+
39
+ `test`, `preview` and `pack` run module Blocks as `test` runs one Block: in the SDK's local module runner, each fixture answered by its own `mocks`. In the connected run a module Step is answered by its first fixture's mocks, or with `--mock` by recorded stand-ins. Nothing calls a provider, and the report lists every stand-in with `liveVerified: false`. A file a mock names by path is read from the Type file's folder.
40
+
41
+ ## Protect existing projects
42
+ Saved projects retain their pinned type definition. Installing a newer type never silently replaces a workflow in progress. See [conditions](conditions.md), [testing](testing.md), and [versioning](../distribute/versioning.md).
@@ -0,0 +1,15 @@
1
+ # Production completion
2
+
3
+ An optional `outcome` field declares the finished result required by this exact Project Type version:
4
+
5
+ ```json
6
+ {"outcome":{"type":"export","dedupe":"material_project_state","minimumDurationSec":3}}
7
+ ```
8
+
9
+ `type` is `export`, `delivery`, or `project_outcome`. `dedupe`, when present, must be `material_project_state`; that is also its default. `minimumDurationSec` is optional, finite, between 0 and 86,400 seconds. A positive minimum requires host-measured media duration. Omit it for text or editable project artifacts.
10
+
11
+ Which result reaches each type: `export` is StillMade's server render of the project's saved Editor timeline (the export in a full-project share), `delivery` is a run's result the person publishes with a share link, and `project_outcome` is an editable project handed over through a share. A Block's own `timeline.render` is that Block's run output, not an Editor export, so it never reaches `export`: a Type whose Block renders the finished video itself, with no Editor Step, declares `delivery`, which the published video reaches.
12
+
13
+ Configure this in **Project defaults & starting questions → Production completion**. Omitting `outcome` preserves the existing host completion behavior. These settings never launch exports, create revenue or mark a client action as successful. Version the Project Type when changing its production rule.
14
+
15
+ Only a trusted completion adapter can supply `materialStateHash`, measured duration, success, retained-source lineage and the actual outcome kind. The accounting qualifier reads the rule from the exact released Project Type; browser-provided contributors and success flags are not accepted. Matching material states deduplicate under the payer-period policy. Verified editable-project deliveries can satisfy `project_outcome`; a local MP4 upload alone does not prove an executed media export.
@@ -0,0 +1,21 @@
1
+ # Conditional Steps
2
+
3
+ A persisted Step may include:
4
+
5
+ ```json
6
+ {"condition":{"input":"shot","path":["dialogue"],"operator":"present"}}
7
+ ```
8
+
9
+ Conditions are bounded data predicates: `present`, `equals`, `not-equals`; equality
10
+ operators compare a scalar `value`. Paths contain up to eight safe field names.
11
+ Predicate controls use their declared defaults, just as a normal SDK run does.
12
+ An explicitly invalid primary value is rejected even when the condition skips.
13
+ No JavaScript expressions are executed. The conditional block must have a primary
14
+ input compatible with its single output, so a false condition passes through that
15
+ input without inventing data. Conditional host workspaces are not supported yet.
16
+
17
+ Settings are stored in the Step's `config`. `enabled:false` disables a Step and
18
+ reconnects a compatible primary chain. Block packages and versions remain pinned;
19
+ removing or reordering a Step never edits the reusable package. When upstream data
20
+ changes, dependent SDK results are marked stale, retained as previews and excluded
21
+ from connected inputs until rerun.