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
@@ -0,0 +1,267 @@
1
+ # Experimental browser application contract
2
+
3
+ # Browser application bundles — experimental source contract
4
+
5
+ This is an additive source and execution-evidence contract under development.
6
+ The exact reviewed Method Draw package has a private desktop install, editing
7
+ and SVG export path. This does not admit arbitrary browser applications or
8
+ make this runtime available through portable archives. Other repositories
9
+ still require their own review and working acceptance evidence.
10
+
11
+ The intended profile preserves a real built application's HTML, JavaScript,
12
+ CSS, fonts, images and optional single-thread WebAssembly, plus a small
13
+ Block-owned adapter. Original styling is the default. It does not rebuild the
14
+ application UI using StillMade controls. The shared host supplies navigation,
15
+ identity, storage authority, permissions and execution; application-specific
16
+ behavior remains in the bundle and its independently versioned adapter.
17
+
18
+ ## Bundle identity and resources
19
+
20
+ `defineBrowserApplication` validates a detached `desktop-browser-application/1`
21
+ bundle. Every asset has a canonical relative path, MIME type, decoded byte count,
22
+ SHA-256 and canonical base64 payload. Entry HTML and adapter JavaScript must be
23
+ present. The contract rejects URL paths, path traversal, file/directory collisions,
24
+ case collisions, unsupported file metadata, invalid encoding and changed bytes.
25
+ `encodeBrowserApplicationFiles` accepts already-read regular-file bytes;
26
+ filesystem importers remain responsible for rejecting links and escaping paths.
27
+
28
+ Limits are explicit and independent of the older portable archive format. A
29
+ bundle can contain at most 2,048 assets, 64 MiB per asset and 128 MiB total decoded
30
+ bytes. Input, state and output messages remain bounded separately. Successful
31
+ validation proves byte integrity and schema conformance, not code safety, license
32
+ permission, dependency closure, build success or application behavior.
33
+
34
+ The first profile declares no ambient networking, workers, native services or
35
+ paid integration access. Single-thread WASM is an explicit requirement, not an
36
+ automatic permission. Arbitrary development servers, native Node modules,
37
+ service workers, threaded WASM and full-stack backends need distinct profiles
38
+ and verified host capabilities. Existing SDK restrictions are not removed.
39
+
40
+ The separately identified `desktop-browser-application/2` bundle may declare
41
+ `features: {wasm:false, srcdocFrames:true}`. A trusted stage and runtime use this
42
+ exact declaration to enable at most eight simultaneous direct `about:srcdoc`
43
+ frames (32 over the page lifetime), with inline script needed for a preview
44
+ document. Other frame URLs, nested frames, popups and local web workers remain
45
+ denied. The trusted controller bootstrap runs only in the top document. This
46
+ profile does not authorize ambient network requests or installation; exact
47
+ source review, isolated execution and output review still apply. An authoring
48
+ model can request it, but it cannot enable it by changing a prompt or manifest.
49
+
50
+ `desktop-browser-application/3` adds `localWorkers:true` (and an explicit
51
+ `srcdocFrames` boolean). It permits only dedicated workers whose script URL
52
+ exactly names a bundled JavaScript asset on the application asset server. The
53
+ target policy binds each worker to the exact parent page and browser context,
54
+ requires a paused attachment, installs recursive target monitoring before
55
+ resume, limits active and lifetime workers, and fails the session on an unknown
56
+ target or unconfirmed detach. The host-controlled CSP permits same-origin
57
+ workers and same-origin connections; the asset server serves only verified
58
+ bundled files. The isolated job's private network namespace remains required.
59
+ Chrome does not expose `Fetch.enable` on worker CDP sessions, so worker egress
60
+ is enforced by the host CSP, exact local asset server and private network
61
+ boundary, not by a worker-session Fetch interceptor. Blob, remote, shared and
62
+ service workers remain denied. A local Chromium probe exercises the target
63
+ policy and asset server, including a denied second loopback origin. A
64
+ provisioned StillMade worker run and application-level review remain required.
65
+
66
+ Inspect compiled dependencies as well as asset extensions. For example, a
67
+ checked-in editor bundle may contain base64 WebAssembly or dynamically create
68
+ workers without shipping any `.wasm` file. The current asset/declaration check
69
+ does not prove those paths are absent. Admission must record which paths are
70
+ needed, and the selected runtime must enforce its CSP, target and resource
71
+ policy when code executes. A dead or explicitly unavailable feature is different
72
+ from a verified fallback. The current development Linux worker rejects declared
73
+ WASM; the new worker profile has not been provisioned or admitted for an
74
+ installed Block.
75
+
76
+ ## Adapter lifecycle and completion
77
+
78
+ An adapter needs to receive meaningful typed inputs, restore host-scoped editable
79
+ state, checkpoint changes, export the actual result, cancel and dispose. Use
80
+ original application APIs and controls. Keep autosave separate from explicit
81
+ completion; mounting a UI or retaining the original input is not evidence of
82
+ the requested transformation.
83
+
84
+ For compiled applications, inspect where the original UI owns its live state.
85
+ If that state is private to a bundled module, a bounded source edit may expose
86
+ a data-only bridge for the Block-owned adapter. The edit must target an exact
87
+ inspected pinned file and be rebuilt under the sealed source identity. The
88
+ adapter should seed inputs and restore checkpoints through the original state
89
+ path, then export the state changed by real UI actions. A global store bridge
90
+ is not itself host storage or permission authority. Include binary project
91
+ files or fail explicitly; silently dropping them makes saved state and export
92
+ incomplete. Declare structured output meaning and schema so Revolver can
93
+ distinguish a website-source project from arbitrary JSON. Browser-downloaded
94
+ ZIP bytes are not a connected artifact until a trusted host materializer owns
95
+ and validates them; a JSON/base64 field must not be presented as a ZIP.
96
+
97
+ The candidate reviewer can perturb a primary `plain_text` input, or insert a
98
+ valid HTML comment into a primary `html_document` input, in a fresh isolated
99
+ session. It compares only declared text or schema-bearing structured output
100
+ ports for the same export operation. A fixed JSON project now fails this check
101
+ even when its original UI and save/reopen path appear to work. An arbitrary
102
+ custom text format does not receive a guessed mutation. This diagnostic checks
103
+ that output responds to changed input; it does not establish that the result
104
+ has the correct application-specific meaning.
105
+
106
+ When a Block receives an upstream value and also stores user edits, checkpoint
107
+ both the editable document and the upstream value that seeded it. Reopen edits
108
+ only when the mounted upstream value still matches; otherwise apply the new
109
+ upstream value and rerun the original application's render path. A model must
110
+ not treat the application's `localStorage` as the host's project or placement
111
+ state. If rendering is debounced or asynchronous, `mount` must wait for the
112
+ new result (or a real error) before acknowledging success, and `execute` must
113
+ read the completed original result rather than an old preview. Runtime review
114
+ should vary the input after a saved edit to catch stale-result replay.
115
+
116
+ Exercise original export buttons under the exact runtime CSP as well as the
117
+ declared adapter operations. Displaying SVG is weaker evidence than exporting
118
+ PNG: embedded XHTML `foreignObject` labels can taint the canvas when that SVG
119
+ is rasterized. An adapter may repair the original action with a bounded,
120
+ reviewed conversion, but must compare the visible result and downloaded bytes.
121
+ An operation that succeeds while the corresponding original control fails does
122
+ not establish a preserved application interface. Clipboard actions require a
123
+ separate approved capability and behavioral review.
124
+
125
+ `prepareBrowserApplicationMount` binds a mount request to the exact package,
126
+ bundle, input and state revision. A mount acknowledgement carries no outputs and
127
+ cannot pass execution validation.
128
+
129
+ `prepareBrowserApplicationExecution` additionally binds the named declared
130
+ operation. Interactive applications require an explicitly interactive host;
131
+ headless execution needs an implemented operation. The trusted host must issue
132
+ the completion receipt only after the actual operation, output checks and
133
+ current permission/state checks. `validateBrowserApplicationExecutionResult`
134
+ and the saved-record validator check those bindings; their result explicitly
135
+ keeps `independentlyVerified:false`. Arbitrary callers can fabricate JSON, so
136
+ these pure helpers do not authenticate evidence or authorize adoption.
137
+ An application package must declare at least one typed output, and each
138
+ completed operation must actually return at least one declared output even if
139
+ the port is optional. A nonempty value can still be semantically wrong; review
140
+ must compare representative saved and exported results with the original app.
141
+
142
+ `runBrowserApplication` requires an explicitly supplied trusted executor. It
143
+ never falls back to evaluating source in the host or treating a mounted page as
144
+ success. Cancellation and timeout signal the executor; actual process/resource
145
+ termination is the executor's responsibility and needs independent verification.
146
+
147
+ ### Media output candidates
148
+
149
+ An adapter exporting an `image` port returns actual PNG bytes as
150
+ `{encoding:"base64",mimeType:"image/png",data:"..."}`. It must never return an
151
+ `assetId`, `versionId`, URL or receipt of its own. The worker checks the shape
152
+ and keeps the result an **untrusted candidate**. The host-side
153
+ `materializeBrowserApplicationOutputs` boundary decodes and checks the image,
154
+ writes it through trusted storage, reads back the exact bytes, checks the current
155
+ execution revision again, and only then creates the typed image reference that
156
+ Revolver can carry. Other media types still require materializers. The local
157
+ worker, browser-control pipe and guest output envelope now each accept a
158
+ bounded 4 MiB PNG after base64 encoding inside an 8 MiB frame; the session
159
+ traffic cap is 32 MiB. Inputs and saved state retain their smaller limits.
160
+ Large candidate transport was checked offline across those layers, while
161
+ miniPaint's real PNG was separately decoded and materialized. A durable S3
162
+ output adapter exists but is not wired into installed production execution.
163
+ Installed image executions now reserve an 8 MiB aggregate maximum in the
164
+ server-owned ledger before dispatch, under the account-wide lock. The
165
+ reservation is compared with the account's storage-plan allotment and remains
166
+ charged if dispatch becomes uncertain. A reservation proven never dispatched
167
+ can be closed without consuming capacity. A completed run records verified
168
+ stored bytes. This ledger measures application outputs separately from other
169
+ project media; output deletion and plan-wide reconciliation still need the
170
+ production lifecycle before enabling installed image exports.
171
+ The desktop session now accepts a host-only `store.materializeOutputs` callback
172
+ between isolated execution and completion. It rejects guest-minted image asset
173
+ IDs before that callback, supplies the exact request and current authority
174
+ binding, rechecks access afterward, and accepts only a valid typed result.
175
+ The manager forwards this callback from trusted main-process composition; a
176
+ real PNG was tested through decode, write, readback and receipt validation,
177
+ including revocation after storage read. The installed HTTP host does not yet
178
+ supply a media store, so this is a supported host boundary, not a production
179
+ image export claim. Candidate review also lacks that store today.
180
+
181
+ ## Guest registration
182
+
183
+ `installBrowserApplicationGuest({target,operations,messageBytes,outputBytes})` is the
184
+ framework-neutral lifecycle dispatcher for a trusted bootstrap. It installs only
185
+ `target.stillmadeApplication.register(adapter)` and returns a separate controller
186
+ to that bootstrap. The host may select a larger output-only envelope up to
187
+ 8 MiB; the ordinary message limit still applies to inputs and saved state.
188
+ It does not install a runtime or grant host access.
189
+
190
+ The Block-owned adapter registers exactly these four methods once:
191
+
192
+ For a new application with several export choices, each bundle operation maps
193
+ to the output ports it actually produces, for example
194
+ `{id:"png.export",kind:"export",outputs:["png"]}`. Ports absent from some
195
+ operations must declare `required:false` in the shared manifest. The host
196
+ requires every mapped operation to return exactly its listed ports before
197
+ materializing media or committing a completion. Older bundles with only
198
+ `{id,kind}` retain their original contract; the new mapping is additive and
199
+ does not change published package bytes.
200
+
201
+ | Method | Adapter result |
202
+ | --- | --- |
203
+ | `mount({inputs,state,signal})` | Restore the original UI and return exactly `{mounted:true}`. |
204
+ | `serialize({signal})` | Return the versioned editable document as plain JSON. This is a snapshot, not output completion. |
205
+ | `execute({operation,inputs,stateRevision,signal})` | Run a declared operation and return its raw typed output map; the dispatcher adds the `{outputs}` envelope. |
206
+ | `dispose()` | Release adapter-owned resources. Return values are discarded. |
207
+
208
+ Use closures or explicitly bound functions when application methods depend on
209
+ their original receiver. The controller enforces mounting before serialization
210
+ or execution, one active call, exact mounted inputs, declared operation names,
211
+ bounded plain JSON, and rejection of guest receipt fields. Cancellation discards
212
+ late results and leaves the guest usable only for disposal. Disposal itself is
213
+ cooperative; a hung application must be terminated by the trusted host.
214
+
215
+ The dispatcher is self-contained for inclusion in a reviewed bootstrap. Its
216
+ JavaScript object checks are correctness checks inside an untrusted realm, not
217
+ security boundaries. The host must revalidate every message, own checkpoint
218
+ identity and UI-event sequencing, issue receipts, check current permissions,
219
+ persist revisions and enforce resource limits outside the guest. No account
220
+ token, filesystem access, native proxy or generic network function is exposed.
221
+
222
+ ## Runtime gates still required
223
+
224
+ - Serve only exact verified bundle assets. Keep application sessions isolated
225
+ from host origin, cookies, local files, native IPC, credentials and one another.
226
+ - Enforce navigation, external request and device denial. A sandboxed iframe,
227
+ request interceptor or CSP alone does not establish complete egress denial.
228
+ - Keep the host responsive under infinite JavaScript/WASM loops and memory
229
+ pressure. Resource and cancellation enforcement must live outside the guest.
230
+ - Scope persistence to account/project/placement and exact source. Shared state
231
+ needs permission checks, revision conflicts, recovery and flush-on-completion;
232
+ origin-global `localStorage` cannot establish that contract.
233
+ - Build in a disposable secret-free worker with pinned dependencies, bounded
234
+ resources and no unrestricted network during source execution. Preserve
235
+ licenses, binary assets and exact output identities.
236
+ - Run original UI operations and compare upstream/adapted exports. Then prove
237
+ a real producer → application → consumer chain, save/reopen, two placements,
238
+ cancellation, revocation, stale-result rejection and adversarial isolation.
239
+
240
+ Method Draw is being used to study the first complete static editor route.
241
+ Its remote fonts, global localStorage and SVG import behavior require explicit
242
+ adaptation; an original-page baseline is not a completed Block integration.
243
+
244
+ The worker now has a separate **candidate-review** stage identity for an
245
+ unlisted, digest-verified browser package. Its driver and unit entry are selected
246
+ by trusted code, while the installed supervisor and runner retain the exact
247
+ reviewed-source registry. This is the source boundary needed to test generated
248
+ adapters without editing a per-repository allowlist. A root-owned review
249
+ supervisor, complete behavior gate, and admission-to-install handoff are still
250
+ missing; staging a candidate does not run or install it.
251
+
252
+ ## Reproduce the reviewed package outside the repository
253
+
254
+ The downloadable SDK zip includes `packages/block-sdk/browser-application.js`
255
+ and `browser-application-execution.js`. The Method Draw source folder contains
256
+ its own pinned upstream bytes, adapter, source hashes and package builder. With
257
+ Node.js 22 or later, extract the SDK zip, place the complete Method Draw folder
258
+ at `blocks/repository/methoddraw` inside the extracted directory, and run:
259
+
260
+ ```sh
261
+ node --input-type=module -e 'import {buildMethodDrawPackage} from "./blocks/repository/methoddraw/build-package.mjs"; import {digest} from "./packages/block-sdk/contracts.js"; const source=await buildMethodDrawPackage(); console.log(await digest(source));'
262
+ ```
263
+
264
+ For the reviewed source and SDK 0.1.0 archive the digest is
265
+ `084ed75a82a66011344bcb609a12de018ccb4e20b828fabc2afef60399c5f6eb`.
266
+ This reproduces source packaging only. It does not execute the editor, grant
267
+ private installation, or show that a different GitHub repository is eligible.
@@ -0,0 +1,45 @@
1
+ # Runtime capabilities
2
+
3
+ ## Supported execution
4
+ | Capability | SDK 0.1.0 |
5
+ | --- | --- |
6
+ | Declarative recipes | Supported; bounded allowlisted operations |
7
+ | Standalone JavaScript | Supported in isolated QuickJS |
8
+ | Hosted text.generate | Exact model, account BYOK or credits, and explicit run review |
9
+ | Hosted audio.speech | One short text/script input to measured audio in any StillMade catalog voice (Deepgram, ElevenLabs, OpenAI, Kokoro) with credits, or OpenAI with your key; playback review; accepted project recordings can be explicitly added to Editor audio |
10
+ | Hosted audio.transcribe | One owner-scoped stored audio asset to reviewed text and ordered word timings with StillMade transcription on credits, or OpenAI Whisper with your key |
11
+ | Hosted audio.music | One prompt to generated music (5–240 seconds) with StillMade credits and playback review |
12
+ | Hosted audio.sfx | One prompt to a generated sound effect (0.5–22 seconds) with StillMade credits and playback review |
13
+ | Hosted image.generate | One prompt and optional reference images to a stored PNG with any catalog image model and its settings; StillMade credits or account key, and actual image review |
14
+ | Hosted video.generate | One prompt and optional first/last frames to a measured stored video clip with any catalog video model and its settings; StillMade credits and actual video review |
15
+ | Hosted image.describe | One to four owned images to bounded production notes; host-selected model/payment and actual description review |
16
+ | Hosted media.analyze | One owned video (optionally one time range), image or up to four images to structured visual evidence: summary, timeline, observations, on-screen text and issues, with StillMade credits; detail "check" gives one to four photos a short answer each at one price per call |
17
+ | Hosted web.fetch | One public web page read by the host and answered against the Block's instruction, with StillMade credits; no cookies, keys or private addresses |
18
+ | Hosted web.research | One topic searched on the web and summarized with cited sources, with StillMade credits |
19
+ | Hosted timeline.propose | Bounded typed context to strict timeline-edit JSON; host-selected model/payment, stale-before checks, preview and Apply |
20
+ | Hosted workspace.propose | Bounded typed context to a strict workspace-edit proposal for one permitted workspace; preview and explicit Apply |
21
+ | Hosted connection.execute | One reviewed action on a connected third-party app account through the host connection service; the Block never receives account credentials |
22
+ | Typed inputs, outputs, semantic roles | Supported |
23
+ | Schema-driven controls | Supported |
24
+ | Scoped project context snapshots | Supported in Step workspaces |
25
+ | Conditional SDK Steps | Supported with a compatible pass-through output |
26
+ | Current-media batches | Supported for saved Canvas, panel/board, voiceover and editor media |
27
+ | Future saved media | Supported with owner confirmation and the configured host worker |
28
+ | Host editor and generation tools | Existing built-in Blocks; normal host controls and permissions |
29
+ | Python, npm dependencies, shell, arbitrary native code | Not exposed to external packages |
30
+ | Package-supplied React workspace UI | Not exposed |
31
+ | Direct guest network, filesystem, or secrets | Not exposed |
32
+ | ComfyUI execution adapter | Reviewed core image nodes with explicit account connection and remote tests |
33
+ | Marketplace payments and seller onboarding | Not available; Blocks and Project Types are free |
34
+
35
+ ## Choose the boundary
36
+ Implement deterministic text or pixel transformations with recipes or JavaScript. Use [hosted text](../build/hosted-text.md), [hosted speech](../build/hosted-speech.md), [hosted music and sound effects](../build/hosted-music.md), [hosted images](../build/hosted-images.md), or [image description](../build/image-description.md) for those specific reviewed requests. Accepted project speech can be [added to Editor audio](../build/audio-to-editor.md) through the host controls. Native Voiceover master recordings, takes, transcripts, and its primary script input retain their existing behavior. A runtime label or permission declaration does not create an unavailable host API.
37
+
38
+ ## ComfyUI and external backends
39
+ The Block contract is independent of the execution backend. The reviewed adapter runs bounded core-image workflows using an explicit account connection. It supports reviewed core image generation using an already-installed safetensors checkpoint. It cannot install dependencies or run custom Python nodes. See [ComfyUI Blocks](../build/comfyui.md) for package structure, fixture expectations, import review and current limits. Imported source is never loaded as host code.
40
+
41
+ ## Environment differences
42
+ The same portable Block can run in web, macOS, and Windows hosts. Desktop media and export features belong to the host capability bridge; a guest still receives bounded input data and no unrestricted disk access.
43
+
44
+ ## Limits
45
+ JavaScript runs have a 500 ms guest deadline, 16 MiB heap, 512 KiB stack, 256 KiB source ceiling, and 4 MiB serialized input/output budgets. Recipes permit at most 64 operations. See [JavaScript](../build/javascript.md), [media](../build/media.md), and [automation](../project-types/automation.md) for the additional host limits.
@@ -0,0 +1,71 @@
1
+ # CLI reference
2
+
3
+ ## Run commands
4
+ ```sh
5
+ npx stillmade-block <command> <target> [argument] [options]
6
+ ```
7
+ That is the form after `npm install --save-dev stillmade-sdk`. From a downloaded SDK folder, run `node packages/block-cli/cli.js <command> …` instead. Output is a JSON object when it is piped, which is what coding agents read; `--text` prints readable text and `--json` forces JSON. Targets can be authoring folders or packed files, except where a command creates a new target. `--help` prints this list.
8
+
9
+ | Command | Argument | Behavior |
10
+ | --- | --- | --- |
11
+ | create ./folder | A template (create --list shows them); omit for the text recipe | Write a complete folder: manifest, source, fixtures, a README and, where needed, tests/mocks.json and package.json |
12
+ | create-type ./type.json | None | Write an editable connected Project Type example |
13
+ | validate target | Optional --mobile | Check the contract without executing behavior; --mobile adds the 320-pixel phone layout profile to the report |
14
+ | inspect target | None | Print manifest/runtime or workflow support |
15
+ | test target | Optional --mock | Execute fixtures and return the report; --mock (or a tests/mocks.json file) answers hosted calls with [stand-ins](../build/testing.md) |
16
+ | run target | Optional input.json, --mock; Blocks also accept --state file and --save-state new-file | Execute once and print the outputs (preview is the same command) |
17
+ | dev folder | Optional --port 4800, --build "npm run build", and --live (with --site) to review each saved version in your StillMade account | [Preview the interface with hot reload](../build/local-preview.md) |
18
+ | ready target | None | Run the [Block builder contract](../build/block-builder-contract.md) readiness check: fixtures, bad input, cancellation, reopen, composition with real catalog Blocks; exits non-zero when FAILED or BLOCKED |
19
+ | gate folder | None | Run ready on every new or edited Block under the folder; a Block is not ready until it passes. Name the Block's own folder: `gate .` in a folder that also holds the extracted SDK checks the SDK's examples too |
20
+ | pack target | Optional output path. A module Block (or a frame view with src/view-files/) writes `<id>-<version>.stillmade-module.json`, other runtimes `<id>-<version>.stillmade.json`; --original with an output.stillmade-block path writes an archive of your own recipe, JavaScript, capability or ComfyUI code and refuses a module Block | Require passing tests, then write the file to import |
21
+ | remix target | Optional output path | Write an editable draft copy with retained license and pinned lineage; nothing is executed |
22
+
23
+ ## Templates
24
+ | Template | Runtime | Starts |
25
+ | --- | --- | --- |
26
+ | recipe | recipe | Clean up text with built-in steps; no code. |
27
+ | image | recipe | Thicken the lines of an image with built-in image steps. |
28
+ | javascript | javascript | Count words with a few lines of sandboxed JavaScript. |
29
+ | stateful | recipe | Number takes with memory saved between runs. |
30
+ | module | module | Modern JavaScript (ES modules, async, typed arrays) in a Worker. |
31
+ | module-wasm | module | A module that runs WebAssembly shipped beside its code. |
32
+ | module-hosted | module | A module that calls hosted text and image generation as tools. |
33
+ | view-react | module | A React interface (frame view) on a module Block, bundled with esbuild. |
34
+ | view-html | javascript | An interface in plain HTML, CSS and JavaScript; no build step. |
35
+ | text | capability | Hosted text generation (text.generate) on the person's credits. |
36
+ | image-generate | capability | Hosted image generation with any catalog model. |
37
+ | video-generate | capability | Hosted video generation with any catalog model. |
38
+ | speech | capability | Hosted speech (audio.speech) with any catalog voice. |
39
+ | music | capability | Hosted music generation (audio.music). |
40
+ | sfx | capability | Hosted sound effects (audio.sfx). |
41
+ | transcribe | capability | Hosted transcription with word timings (audio.transcribe). |
42
+ | describe-image | capability | Describe or compare up to four images (image.describe) on the person's own OpenRouter key; analyze-media runs on StillMade credits. |
43
+ | analyze-media | capability | Visual evidence from images or a video (media.analyze). |
44
+ | web-fetch | capability | Answer a question from one web page (web.fetch). |
45
+ | web-research | capability | Research a topic with sources (web.research). |
46
+ | timeline-proposal | capability | Propose Editor timeline edits the person reviews (timeline.propose). |
47
+ | outside-api | module | Call an outside https API with the person's own key (net.fetch). |
48
+ | connection | module | Call a published OpenAPI adapter with the person's sign-in. |
49
+ | storage | module | Remember values across runs in the project's Block storage. |
50
+ | trigger-media | capability | Runs on its own when a video is saved (media.saved trigger). |
51
+ | trigger-webhook | javascript | Runs when another service sends a webhook. |
52
+ | trigger-schedule | javascript | Runs on a schedule with the project's saved inputs. |
53
+
54
+ ## Exit and output contract
55
+ In a terminal, success prints a readable summary and exits with code 0, and failure prints the error (with failed fixtures and a hint) to stderr and exits nonzero. When output is piped (scripts, coding agents) or with `--json`, success prints the JSON result object and failure prints a JSON object with error, optional code and report; `--text` forces readable text. create, create-type, pack and --save-state refuse to overwrite existing files.
56
+
57
+ ## Examples
58
+ ```sh
59
+ node packages/block-cli/cli.js create --list
60
+ node packages/block-cli/cli.js create ./outlines image
61
+ node packages/block-cli/cli.js test ./outlines
62
+ node packages/block-cli/cli.js dev ./outlines
63
+ node packages/block-cli/cli.js pack ./outlines outlines-1.0.0.stillmade.json
64
+ node packages/block-cli/cli.js create ./narration speech
65
+ node packages/block-cli/cli.js test ./narration --mock
66
+ node packages/block-cli/cli.js create-type ./workflow.json
67
+ node packages/block-cli/cli.js preview ./workflow.json
68
+ ```
69
+
70
+ ## Importable formats
71
+ The CLI emits JSON (and `.stillmade-module.json` bundles for module Blocks), while StillMade also accepts reviewed ZIP source directories. Files outside the supported manifest, source, and fixture layout are not installed as executable dependencies.
@@ -0,0 +1,59 @@
1
+ # Connection API
2
+
3
+ ## Connection client operations
4
+ `createConnectionClient({request})` exposes exactly these operations. The authenticated host supplies `request`; Block code receives neither credentials nor an arbitrary network proxy. Paths are relative to the connections API.
5
+
6
+ | Operation | Method | Path | Query |
7
+ | --- | --- | --- | --- |
8
+ | `search` | GET | `/catalog` | `q`, `refresh` |
9
+ | `capabilities` | GET | `/capabilities` | `appId` |
10
+ | `block` | GET | `/block` | `appId`, `capabilityId`, `projectId`, `configurationRunId`, `metadataOnly` |
11
+ | `accounts` | GET | `/accounts` | `appId`, `refresh` |
12
+ | `connect` | POST | `/sessions` | — |
13
+ | `finishConnection` | POST | `/sessions/:id/finish` | — |
14
+ | `revokeAccount` | POST | `/accounts/:id/revoke` | — |
15
+ | `accountImpact` | GET | `/accounts/:id/impact` | — |
16
+ | `inspect` | POST | `/execution-context` | — |
17
+ | `quote` | POST | `/reviews` | — |
18
+ | `approve` | POST | `/reviews/:id/approve` | — |
19
+ | `execute` | POST | `/runs` | — |
20
+ | `run` | GET | `/runs/:id` | — |
21
+ | `recover` | GET | `/requests/:id` | — |
22
+ | `cancel` | POST | `/runs/:id/cancel` | — |
23
+ | `referenceBudget` | POST | `/reference-budgets` | — |
24
+ | `closeReferenceBudget` | POST | `/reference-budgets/:id/close` | — |
25
+ | `previewReference` | POST | `/references/preview` | — |
26
+ | `attachReference` | POST | `/references` | — |
27
+ | `readReference` | GET | `/references/:id` | `projectId`, `version` |
28
+ | `refreshReferenceContext` | POST | `/references/:id/refresh-context` | — |
29
+ | `refreshReference` | POST | `/references/:id/refresh` | — |
30
+ | `detachReference` | POST | `/references/:id/detach` | — |
31
+ | `referenceDependencies` | GET | `/references/dependencies` | `projectId` |
32
+ | `sharedWork` | POST | `/shared-work` | — |
33
+ | `sharedWorkLinks` | GET | `/shared-work-links` | `projectId` |
34
+ | `inspectGenerated` | POST | `/generated/inspect` | — |
35
+ | `testGenerated` | POST | `/generated/test` | — |
36
+ | `installGenerated` | POST | `/generated/install` | — |
37
+ | `readGenerated` | GET | `/generated/:id` | — |
38
+ | `installLocal` | POST | `/generated/local/install` | — |
39
+ | `previewLocalReference` | POST | `/references/local/preview` | — |
40
+ | `attachLocalReference` | POST | `/references/local` | — |
41
+ | `localReferenceSource` | POST | `/references/local/source` | — |
42
+ | `refreshLocalReference` | POST | `/references/:id/local-refresh` | — |
43
+ | `recentRuns` | GET | `/runs` | `projectId`, `limit` |
44
+ | `placementTasks` | POST | `/placements/tasks` | — |
45
+ | `previewPlacementTask` | POST | `/placements/preview-task` | — |
46
+ | `applyPlacementTask` | POST | `/placements/apply-task` | — |
47
+ | `listTriggers` | GET | `/workflow-triggers/:projectId` | — |
48
+ | `previewTriggerPlan` | POST | `/workflow-triggers/:projectId/plan` | — |
49
+ | `reviewTrigger` | POST | `/workflow-triggers/:projectId/review` | — |
50
+ | `createTrigger` | POST | `/workflow-triggers/:projectId` | — |
51
+ | `changeTrigger` | POST | `/workflow-triggers/:projectId/triggers/:id/state` | — |
52
+ | `fireManualTrigger` | POST | `/workflow-triggers/:projectId/triggers/:id/fire` | — |
53
+ | `listUnattendedGrants` | GET | `/workflow-triggers/:projectId/grants` | — |
54
+ | `createUnattendedGrant` | POST | `/workflow-triggers/:projectId/grants` | — |
55
+ | `revokeUnattendedGrant` | POST | `/workflow-triggers/:projectId/grants/:id/revoke` | — |
56
+ | `executeUnattendedGrant` | POST | `/workflow-triggers/:projectId/grants/execute` | — |
57
+ | `listLiveReferenceGrants` | GET | `/workflow-triggers/:projectId/live-reference-grants` | — |
58
+ | `grantLiveReference` | POST | `/workflow-triggers/:projectId/live-reference-grants` | — |
59
+ | `revokeLiveReferenceGrant` | POST | `/workflow-triggers/:projectId/live-reference-grants/revoke` | — |
@@ -0,0 +1,13 @@
1
+ # Cooperative JavaScript jobs
2
+
3
+ # Bounded guest-returned pending jobs
4
+
5
+ Original §53 requires Blocks to return pending jobs with automatic queued/loading/running/progress/complete/failed/cancel handling. JavaScript Blocks can now opt into `manifest.jobs={kind:'cooperative',version:1}` and return `job.pending` from their sandboxed code. This is an actual guest-returned continuation protocol consumed by the host, not merely a promise around synchronous final outputs.
6
+
7
+ The opt-in reserves input/state/job arguments. Legacy packages retain their old invocation shape. Each pending return is a strict JSON envelope; continuation data has no authority. The same pinned code and original inputs resume in the same disposable VM for up to 32 turns. CPU time remains cumulative 500 ms across VM evaluations; heap/WASM limits remain 16/32 MiB; serialized continuation, state and final outputs together are bounded by 4 MiB. The host yields between turns but never extends existing browser/Node worker deadlines. Each pending state remains private until a final valid result; cancelled or failed runs publish no intermediate output/state.
8
+
9
+ Progress contains only validated turn/unit counters. Node and browser worker transports validate ordered continuation messages separately from final results; the host job handle validates them again. Omitted progress shows a pending turn, not guessed completion. The UI labels declared continuation units separately from recipe operations. Terminal cancellation remains one-shot and stops the original worker; it cannot restart an invocation or dispatch a provider. Export archives include the runtime helper, and portable SDK documentation describes the API and bounds.
10
+
11
+ The visual authoring checkbox enables the protocol; source code defines its actual continuation behavior. Existing preview, connected and import sample surfaces share the resulting status/cancellation UI. External asynchronous jobs, arbitrary polling URLs, timers inside the guest, network permissions, provider dispatch and durable reload recovery are not introduced. Reload durability is not inferred as a requirement from §53.
12
+
13
+ Source inspection only: no tests, browser QA, verification builds, migrations or provider calls were performed. Implementation was committed locally without push or deployment. Operational/runtime acceptance remains unverified.