stillmade-sdk 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.stillmade/sdk-baseline.json +19 -21
- package/AGENTS.md +17 -12
- package/FRAME_VIEWS.md +113 -0
- package/INTERFACE_DESIGN.md +67 -22
- package/MOBILE_UI.md +4 -2
- package/MODULES.md +152 -6
- package/PASTE_TO_LLM.md +42 -32
- package/README.md +3 -2
- package/SDK.md +1028 -563
- package/UI_AESTHETIC.md +30 -3
- package/blocks/generate/package.js +1 -0
- package/blocks/generate/versions/1.0.0/package.js +463 -0
- package/docs/build/audio-to-editor.md +36 -0
- package/docs/build/block-builder-contract.md +150 -0
- package/docs/build/comfyui.md +227 -0
- package/docs/build/concepts.md +40 -0
- package/docs/build/context.md +159 -0
- package/docs/build/cookbook.md +57 -0
- package/docs/build/custom-interface.md +617 -0
- package/docs/build/data-types.md +83 -0
- package/docs/build/frame-views.md +259 -0
- package/docs/build/generate-media.md +59 -0
- package/docs/build/github-applications.md +314 -0
- package/docs/build/hosted-images.md +214 -0
- package/docs/build/hosted-music.md +39 -0
- package/docs/build/hosted-speech.md +157 -0
- package/docs/build/hosted-text.md +246 -0
- package/docs/build/image-description.md +49 -0
- package/docs/build/interface-design.md +343 -0
- package/docs/build/javascript.md +63 -0
- package/docs/build/local-preview.md +61 -0
- package/docs/build/media-analysis.md +27 -0
- package/docs/build/media.md +400 -0
- package/docs/build/mobile-ui.md +106 -0
- package/docs/build/modules.md +487 -0
- package/docs/build/original-blocks.md +70 -0
- package/docs/build/outside-apis.md +128 -0
- package/docs/build/production-context-templates.md +12 -0
- package/docs/build/project-storage.md +94 -0
- package/docs/build/quickstart.md +48 -0
- package/docs/build/recipes.md +103 -0
- package/docs/build/script-handoff.md +45 -0
- package/docs/build/script-writer.md +34 -0
- package/docs/build/state.md +223 -0
- package/docs/build/testing.md +112 -0
- package/docs/build/timeline-edits.md +116 -0
- package/docs/build/timeline-proposals.md +76 -0
- package/docs/build/transcription.md +59 -0
- package/docs/build/triggers.md +59 -0
- package/docs/build/tutorial.md +52 -0
- package/docs/build/typescript.md +34 -0
- package/docs/build/video-generation.md +61 -0
- package/docs/build/web-reading.md +37 -0
- package/docs/build/with-your-ai.md +27 -0
- package/docs/changelog.md +9 -0
- package/docs/creators.md +21 -0
- package/docs/distribute/discovery.md +43 -0
- package/docs/distribute/imports.md +58 -0
- package/docs/distribute/publishing.md +29 -0
- package/docs/distribute/sdk-versions.md +36 -0
- package/docs/distribute/selling.md +14 -0
- package/docs/distribute/teams.md +60 -0
- package/docs/distribute/versioning.md +28 -0
- package/docs/examples.md +23 -0
- package/docs/gallery.md +26 -0
- package/docs/index.md +50 -0
- package/docs/native-mcp.md +307 -0
- package/docs/project-types/automation.md +43 -0
- package/docs/project-types/batches.md +50 -0
- package/docs/project-types/build.md +42 -0
- package/docs/project-types/completion.md +15 -0
- package/docs/project-types/conditions.md +21 -0
- package/docs/project-types/hosted-review.md +115 -0
- package/docs/project-types/onboarding.md +75 -0
- package/docs/project-types/running.md +309 -0
- package/docs/project-types/testing.md +72 -0
- package/docs/reference/application-artifacts.md +87 -0
- package/docs/reference/authoring-guide.md +134 -0
- package/docs/reference/browser-applications.md +267 -0
- package/docs/reference/capabilities.md +45 -0
- package/docs/reference/cli.md +71 -0
- package/docs/reference/connection-api.md +59 -0
- package/docs/reference/cooperative-jobs.md +13 -0
- package/docs/reference/desktop-capabilities.md +172 -0
- package/docs/reference/desktop-execution.md +77 -0
- package/docs/reference/errors.md +233 -0
- package/docs/reference/execution.md +800 -0
- package/docs/reference/first-party-blocks.md +40 -0
- package/docs/reference/generation-models.md +59 -0
- package/docs/reference/limits.md +306 -0
- package/docs/reference/manifest-kinds-controls.md +36 -0
- package/docs/reference/manifest.md +181 -0
- package/docs/reference/operations.md +36 -0
- package/docs/reference/package-jobs.md +35 -0
- package/docs/reference/parity.md +55 -0
- package/docs/reference/permissions.md +86 -0
- package/docs/reference/ports.md +26 -0
- package/docs/reference/types.md +268 -0
- package/docs/reference/universal-resolver.md +303 -0
- package/docs/reference/view-bridge.md +60 -0
- package/docs/reference/view-rules.md +15 -0
- package/docs/reference/workspace-sync.md +25 -0
- package/docs/sdk.md +34 -0
- package/docs/tools/block-remix.md +211 -0
- package/docs/tools/llm.md +2213 -0
- package/docs/tools/repository-adaptation.md +613 -0
- package/examples/check-clip.stillmade.json +8 -1
- package/examples/clean-text.stillmade.json +4 -0
- package/examples/custom-interface.stillmade.json +4 -0
- package/examples/describe-image.stillmade.json +4 -0
- package/examples/foley-cue.stillmade.json +4 -0
- package/examples/generate-image.stillmade.json +4 -0
- package/examples/generate-video.stillmade.json +10 -2
- package/examples/module-word-stats/stillmade.block.json +4 -0
- package/examples/narrate-script.stillmade.json +4 -0
- package/examples/numbered-takes.stillmade.json +4 -0
- package/examples/research-topic.stillmade.json +9 -1
- package/examples/score-a-scene.stillmade.json +4 -0
- package/examples/script-draft.stillmade.json +4 -0
- package/examples/summarize-page.stillmade.json +4 -0
- package/examples/text-workflow.stillmade.json +7 -32
- package/examples/thicken-lines.stillmade.json +4 -0
- package/examples/timeline-polish.stillmade.json +15 -3
- package/examples/transcribe-audio.stillmade.json +15 -3
- package/examples/word-count.stillmade.json +4 -0
- package/package.json +1 -1
- package/packages/block-cli/cli.js +13 -6
- package/packages/block-cli/dev-host/assets/host.js +81 -38
- package/packages/block-cli/dev-host/assets/index.css +1 -1
- package/packages/block-cli/format.js +1 -1
- package/packages/block-cli/ready-gate.js +4 -0
- package/packages/block-cli/templates.js +37 -19
- package/packages/block-cli/type-packages.js +119 -0
- package/packages/block-platform/block-readiness.js +8 -1
- package/packages/block-platform/canvas.js +2 -1
- package/packages/block-platform/catalog.js +27 -48
- package/packages/block-platform/native-host-inventory.js +0 -226
- package/packages/block-platform/plain-descriptions.js +1 -25
- package/packages/block-platform/project-type-starters.js +13 -53
- package/packages/block-platform/script-handoff.js +2 -4
- package/packages/block-platform/type-workspace.js +2 -0
- package/packages/block-sdk/appearance.js +3 -1
- package/packages/block-sdk/audio-generation-example.js +2 -2
- package/packages/block-sdk/block-tier.js +1 -1
- package/packages/block-sdk/builder-contract.js +13 -11
- package/packages/block-sdk/capabilities.js +1 -1
- package/packages/block-sdk/capability-example.js +1 -1
- package/packages/block-sdk/contracts.js +6 -2
- package/packages/block-sdk/examples.js +3 -3
- package/packages/block-sdk/first-party-identities.js +1 -84
- package/packages/block-sdk/first-party-packages.js +3 -85
- package/packages/block-sdk/generation-catalog.js +15 -3
- package/packages/block-sdk/image-description-example.js +1 -1
- package/packages/block-sdk/image-generation-example.js +1 -1
- package/packages/block-sdk/index.d.ts +2 -1
- package/packages/block-sdk/media-analysis-example.js +2 -2
- package/packages/block-sdk/mock-host.js +7 -1
- package/packages/block-sdk/module-example.js +1 -1
- package/packages/block-sdk/module-host-calls.js +35 -10
- package/packages/block-sdk/module-hosted.js +15 -2
- package/packages/block-sdk/module-media-access.js +71 -0
- package/packages/block-sdk/module-node.js +1 -1
- package/packages/block-sdk/portable-media-actions.js +1 -1
- package/packages/block-sdk/runtime.js +1 -1
- package/packages/block-sdk/speech-example.js +1 -1
- package/packages/block-sdk/state-example.js +1 -1
- package/packages/block-sdk/timeline-proposal-example.js +1 -1
- package/packages/block-sdk/transcription-example.js +1 -1
- package/packages/block-sdk/trigger-examples.js +2 -2
- package/packages/block-sdk/video-generation-example.js +1 -1
- package/packages/block-sdk/view-bridge.js +4 -1
- package/packages/block-sdk/view-design.js +44 -15
- package/packages/block-sdk/web-example.js +2 -2
- package/packages/design-system/block-kit.css +53 -12
- package/packages/design-system/block-kit.html +3 -2
- package/blocks/mcp-motion-planner/versions/1.1.0/package.js +0 -97
- package/blocks/motion-designer/versions/1.0.1/package.js +0 -173318
- package/blocks/motion-designer/versions/1.0.2/package.js +0 -173318
- package/blocks/motion-frame-review/versions/1.1.1/package.js +0 -465
- package/blocks/motion-frame-review/versions/1.1.2/package.snapshot.js +0 -572
- package/blocks/narration/package.js +0 -1
- package/blocks/narration/versions/1.0.0/package.js +0 -221
- package/blocks/narration/versions/1.0.1/package.js +0 -221
- package/blocks/native/sm.animated-scene/versions/2.0.0/package.js +0 -475
- package/blocks/native/sm.animated-scene/versions/2.1.0/package.js +0 -498
- package/blocks/native/sm.animated-scene/versions/2.2.0/package.js +0 -524
- package/blocks/native/sm.animated-scene/versions/2.3.0/package.js +0 -618
- package/blocks/native/sm.animated-scene/versions/2.3.1/package.js +0 -618
- package/blocks/native/sm.animated-scene/versions/2.3.2/package.js +0 -723
- package/blocks/native/sm.animated-scene/versions/2.3.3/package.js +0 -723
- package/blocks/native/sm.animated-scene/versions/2.3.4/package.js +0 -676
- package/blocks/native/sm.animated-scene/versions/2.3.5/package.js +0 -693
- package/blocks/native/sm.animated-scene/versions/2.3.6/package.js +0 -700
- package/blocks/native/sm.animated-scene/versions/2.3.7/package.js +0 -747
- package/blocks/native/sm.animated-scene/versions/2.3.8/package.js +0 -769
- package/blocks/native/sm.animated-scene/versions/2.3.9/package.js +0 -769
- package/blocks/native/sm.animated-scene-assistant/versions/1.0.0/package.js +0 -183
- package/blocks/native/sm.blueprint/versions/2.0.0/package.js +0 -358
- package/blocks/native/sm.blueprint/versions/2.1.0/package.js +0 -358
- package/blocks/native/sm.blueprint/versions/2.1.1/package.js +0 -358
- package/blocks/native/sm.blueprint/versions/2.1.2/package.js +0 -358
- package/blocks/native/sm.blueprint/versions/2.1.3/package.js +0 -381
- package/blocks/native/sm.blueprint/versions/2.1.4/package.js +0 -381
- package/blocks/native/sm.blueprint/versions/2.1.5/package.js +0 -339
- package/blocks/native/sm.blueprint/versions/2.1.6/package.js +0 -356
- package/blocks/native/sm.blueprint/versions/2.1.7/package.js +0 -363
- package/blocks/native/sm.blueprint/versions/2.1.8/package.js +0 -410
- package/blocks/native/sm.blueprint/versions/2.1.9/package.js +0 -422
- package/blocks/native/sm.blueprint-assistant/versions/1.0.0/package.js +0 -172
- package/blocks/native/sm.chat/versions/2.0.0/package.js +0 -144
- package/blocks/native/sm.chat/versions/2.0.1/package.js +0 -97
- package/blocks/native/sm.chat/versions/2.0.2/package.js +0 -100
- package/blocks/native/sm.chat/versions/2.0.3/package.js +0 -100
- package/blocks/native/sm.continue-if/versions/1.0.0/package.js +0 -168
- package/blocks/native/sm.describe-media/versions/2.0.0/package.js +0 -153
- package/blocks/native/sm.describe-media/versions/2.0.1/package.js +0 -156
- package/blocks/native/sm.describe-media/versions/2.1.0/package.js +0 -140
- package/blocks/native/sm.image-editor/versions/2.0.0/package.js +0 -183
- package/blocks/native/sm.image-editor/versions/2.0.1/package.js +0 -190
- package/blocks/native/sm.new-items/versions/1.0.0/package.js +0 -191
- package/blocks/native/sm.pick-photos/versions/1.0.0/package.js +0 -334
- package/blocks/native/sm.quality-audit/versions/1.0.0/package.js +0 -192
- package/blocks/native/sm.quality-audit/versions/1.0.1/package.js +0 -192
- package/blocks/native/sm.quality-audit/versions/1.0.2/package.js +0 -195
- package/blocks/native/sm.research/versions/2.0.0/package.js +0 -175
- package/blocks/native/sm.research/versions/2.0.1/package.js +0 -184
- package/blocks/native/sm.research/versions/2.0.2/package.js +0 -187
- package/blocks/native/sm.script/versions/2.0.0/package.js +0 -144
- package/blocks/native/sm.script/versions/2.1.0/package.js +0 -144
- package/blocks/native/sm.script/versions/2.1.1/package.js +0 -144
- package/blocks/native/sm.script/versions/2.1.2/package.js +0 -105
- package/blocks/native/sm.script/versions/2.1.3/package.js +0 -152
- package/blocks/native/sm.script/versions/2.1.4/package.js +0 -156
- package/blocks/native/sm.script/versions/2.1.5/package.js +0 -156
- package/blocks/native/sm.shot-plan/versions/2.0.0/package.js +0 -301
- package/blocks/native/sm.shot-plan/versions/2.1.0/package.js +0 -528
- package/blocks/native/sm.shot-plan/versions/2.1.1/package.js +0 -528
- package/blocks/native/sm.shot-plan/versions/2.1.2/package.js +0 -528
- package/blocks/native/sm.shot-plan/versions/2.1.3/package.js +0 -536
- package/blocks/native/sm.shot-plan/versions/2.2.0/package.js +0 -800
- package/blocks/native/sm.shot-plan/versions/2.2.1/package.js +0 -920
- package/blocks/native/sm.shot-plan-assistant/versions/1.0.0/package.js +0 -173
- package/blocks/native/sm.stock-search/versions/2.0.0/package.js +0 -174
- package/blocks/native/sm.thumbnail/versions/2.0.0/package.js +0 -137
- package/blocks/native/sm.thumbnail/versions/2.0.1/package.js +0 -140
- package/blocks/native/sm.transcribe/versions/2.0.0/package.js +0 -163
- package/blocks/native/sm.transcribe/versions/2.0.1/package.js +0 -168
- package/blocks/native/sm.whiteboard-assistant/versions/1.0.0/package.js +0 -175
- package/blocks/native/sm.youtube/versions/2.0.0/package.js +0 -217
- package/blocks/occasion-story/package.js +0 -1
- package/blocks/occasion-story/versions/1.0.0/package.js +0 -1658
- package/blocks/occasion-story/versions/1.0.1/package.js +0 -1699
- package/blocks/occasion-story/versions/1.0.2/package.js +0 -1682
- package/blocks/photo-reel-composer/versions/1.0.0/package.js +0 -3043
- package/blocks/photo-reel-composer/versions/1.0.1/package.js +0 -3026
- package/blocks/photo-reel-composer/versions/1.0.2/package.js +0 -4149
- package/blocks/product-ad-variants/versions/1.0.0/package.js +0 -2911
- package/blocks/product-launch-director/versions/1.0.0/package.js +0 -103
- package/blocks/release-visuals/package.js +0 -1
- package/blocks/release-visuals/versions/1.0.0/package.js +0 -1492
- package/blocks/release-visuals/versions/1.0.1/package.js +0 -1517
- package/blocks/release-visuals/versions/1.0.2/package.js +0 -1500
- package/blocks/screen-recorder/package.js +0 -1
- package/blocks/screen-recorder/versions/1.0.0/package.js +0 -223
- package/blocks/screen-recorder/versions/1.0.1/package.js +0 -223
- package/blocks/short-form-finish/package.js +0 -1
- package/blocks/short-form-finish/versions/1.0.0/package.js +0 -1043
- package/blocks/short-form-finish/versions/1.0.1/package.js +0 -1043
- package/blocks/short-form-finish/versions/1.0.2/package.js +0 -1043
- package/blocks/short-form-finish/versions/1.0.3/package.js +0 -1026
- package/examples/saas-product-launch-reviewed-source.stillmade.json +0 -383
- package/examples/saas-product-launch.stillmade.json +0 -304
- package/packages/block-platform/dealer-inventory-video-project-type.js +0 -38
- package/packages/block-platform/first-revenue-project-types.js +0 -46
- package/packages/block-platform/fixture-starters.js +0 -13
- package/packages/block-platform/launch-project-source.js +0 -10
- package/packages/block-platform/launch-project.js +0 -30
- package/packages/block-platform/motion-project-types.js +0 -55
- package/packages/block-platform/motion-starters.js +0 -14
- package/packages/block-platform/product-ad-variants-project-type.js +0 -30
- package/packages/block-platform/product-launch-updated.js +0 -90
- package/packages/block-platform/revenue-review-project-types.js +0 -36
- package/packages/block-platform/revenue-review-starters.js +0 -13
- package/packages/block-platform/script-writer.js +0 -29
- package/packages/block-platform/website-source-block.js +0 -14
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# Universal requirement resolver
|
|
2
|
+
|
|
3
|
+
# Universal requirement resolver
|
|
4
|
+
|
|
5
|
+
The public SDK exports `createUniversalResolver()`, the same implementation used
|
|
6
|
+
by the Project Type composer, runtime input resolution and native explanations.
|
|
7
|
+
The older `block-platform/universal-resolver.js` import reexports this engine.
|
|
8
|
+
|
|
9
|
+
### Interactive JavaScript user requests
|
|
10
|
+
|
|
11
|
+
The Node SDK host may explicitly provide `runPackageAsync(..., {requestFromUser})`.
|
|
12
|
+
An isolated Block can return `StillMade.requestFromUser('name')` for a missing,
|
|
13
|
+
optional, non-context input whose contract allows user answers. Check
|
|
14
|
+
`StillMade.resolveRequirement('name').resolved` first. The SDK resumes the code
|
|
15
|
+
from its beginning with the validated answer in `input.name`; this is a
|
|
16
|
+
cooperative return, not a Promise or an in-sandbox host callback. Avoid emitting
|
|
17
|
+
outputs before returning the request. Other inputs remain unchanged.
|
|
18
|
+
|
|
19
|
+
Both worker boundaries validate the exact declared question and answer. Questions
|
|
20
|
+
cannot collect credentials, overwrite existing values, widen permissions, or call
|
|
21
|
+
providers. At most 20 questions are allowed. The Node worker pauses its cumulative
|
|
22
|
+
five-second execution allowance while waiting, with a five-minute answer deadline;
|
|
23
|
+
the guest's cumulative CPU and memory limits remain in force. Cancellation ends the
|
|
24
|
+
run. Successful results include `userAnswers` for the host to persist alongside
|
|
25
|
+
execution provenance. Hosts without the callback fail closed.
|
|
26
|
+
|
|
27
|
+
The application browser runner enables this bridge for individual non-batch
|
|
28
|
+
JavaScript Step runs. It rechecks project identity, edit access, source admission,
|
|
29
|
+
and the captured input snapshot around each question. Reviewed answers become
|
|
30
|
+
semantic user values and contribute to the accepted run's input digest and output
|
|
31
|
+
dependencies. Other browser callers must explicitly supply both a question handler
|
|
32
|
+
and a current-project guard; otherwise interactive requests remain unavailable.
|
|
33
|
+
Browser execution pauses its cumulative worker allowance during a bounded question
|
|
34
|
+
wait, without expanding the guest CPU allowance. Batch
|
|
35
|
+
questions, automatic in-run Chat, and shared credit accounting remain unfinished.
|
|
36
|
+
|
|
37
|
+
Interactive connected local runs now also forward user requests for JavaScript
|
|
38
|
+
Steps with stop-on-error, bounded retry, or approval-before-retry policies, including connected media batches. The workflow
|
|
39
|
+
runner independently validates each question, captures the reviewed answer, and
|
|
40
|
+
requires the executor to return exactly those answers. The accepted input digest
|
|
41
|
+
includes them, and retained results restore/revalidate optional answers without
|
|
42
|
+
opening dialogs or rerunning completed Steps. Connected job deadlines still apply;
|
|
43
|
+
fallback/recovery policies and unattended runs do not enable these questions.
|
|
44
|
+
Retries receive previously reviewed answers as existing inputs instead of asking
|
|
45
|
+
again. Each attempt may return only answers newly reviewed during that attempt;
|
|
46
|
+
the workflow retains the aggregate and binds it to the successful result. Late
|
|
47
|
+
replies from an ended attempt cannot change the retained answer set.
|
|
48
|
+
|
|
49
|
+
Connected batch questions name the current source asset and version. Answers are
|
|
50
|
+
scoped to that target's run and do not silently carry into the next target. Resume
|
|
51
|
+
validation binds them to the full source snapshot as well as the package, workflow,
|
|
52
|
+
and effective inputs. Standalone single-Step batch previews also enable questions.
|
|
53
|
+
Each preview keeps its own reviewed answers and input fingerprint. Using a result
|
|
54
|
+
rechecks source, settings and answers, then registers the selected answers and
|
|
55
|
+
outputs as the adopted single-Step result. Previews alone do not overwrite saved
|
|
56
|
+
answers or advance saved Block memory.
|
|
57
|
+
|
|
58
|
+
Structured collections use a one-element schema array, such as
|
|
59
|
+
`schema: [{word: 'string', start: 'number', end: 'number'}]` on an `object[]`
|
|
60
|
+
contract. That schema describes every item, not a tuple or a fixed-length value.
|
|
61
|
+
It also works inside object fields. Validation and connection compatibility check
|
|
62
|
+
each item's required fields; plain `object[]` cannot promise those fields.
|
|
63
|
+
The input dialog collects structured list items using their declared fields.
|
|
64
|
+
|
|
65
|
+
Built-in connection adapters also support ordered lists when both endpoints are
|
|
66
|
+
scalar types with list variants. Each list adapter pins the scalar adapter version,
|
|
67
|
+
converts at most 100 items, checks each item, and requires all context grants before
|
|
68
|
+
conversion. A failed item rejects the entire conversion; no partial list is emitted.
|
|
69
|
+
List-to-scalar flattening, implicit Block fan-out, and nested lists are not inferred.
|
|
70
|
+
For example, `text[]` with meaning `narration_script` can supply `script[]` with the
|
|
71
|
+
same meaning through `list-text-to-script-v1` version 1. These are local data
|
|
72
|
+
conversions, not separately billed provider calls or general workflow batches.
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import {createUniversalResolver,input} from './packages/block-sdk/index.js';
|
|
76
|
+
|
|
77
|
+
const requirement=input({
|
|
78
|
+
key:'company',type:'object',semantic:'company_profile',required:true,
|
|
79
|
+
description:'Company information',schema:{name:'string'},sources:['project']
|
|
80
|
+
});
|
|
81
|
+
const resolver=createUniversalResolver();
|
|
82
|
+
const options={values:[{
|
|
83
|
+
id:'company-profile',revision:1,type:'object',semantic:'company_profile',
|
|
84
|
+
value:{name:'Morning Bakery'},source:{kind:'project'},permissions:[]
|
|
85
|
+
}]};
|
|
86
|
+
const explanation=resolver.inspect(requirement,options);
|
|
87
|
+
const resolved=await resolver.resolve(requirement,options);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`inspect` and `explain` return the selected source, reason and candidates.
|
|
91
|
+
`listCandidates` returns priority-ordered alternatives. `resolve` checks actual
|
|
92
|
+
values and returns source/dependency metadata. A required unresolved input stays
|
|
93
|
+
unresolved; a pending callback can return one clarification question.
|
|
94
|
+
|
|
95
|
+
Pass an explicit semantic registry and versioned adapter registry when needed.
|
|
96
|
+
The host may supply `canDerive`, `requestFromChat` and `requestFromUser` callbacks.
|
|
97
|
+
No callback is provided automatically. Permission and freshness filtering applies
|
|
98
|
+
to context passed to those callbacks; source/schema validation still applies to
|
|
99
|
+
their results. Use stable record IDs and revisions for executable values. Plan
|
|
100
|
+
mode can inspect declarations that do not yet contain a value; `resolve` always
|
|
101
|
+
requires materialized values or an answer callback.
|
|
102
|
+
|
|
103
|
+
Callbacks receive isolated copies. Final resolution rechecks dependency freshness
|
|
104
|
+
after waiting for an answer and rejects expired sources or missing revisions.
|
|
105
|
+
The host must still detect edits to the underlying project while resolving; a
|
|
106
|
+
copied context snapshot does not subscribe to storage changes.
|
|
107
|
+
|
|
108
|
+
This is a trusted-host/authoring library, not a new guest API or permission grant.
|
|
109
|
+
It does not fetch project data, mutate projects, run Blocks, approve purchases,
|
|
110
|
+
authorize credentials, or enforce a provider spending budget. Hosts must retain
|
|
111
|
+
their existing scoped storage, sandbox, approval, cancellation and shared-budget
|
|
112
|
+
boundaries around integrations. Do not register arbitrary creator code as a host
|
|
113
|
+
callback. Download assembly includes this module, but generated download artifacts
|
|
114
|
+
must be rebuilt separately.
|
|
115
|
+
# Custom meanings and connection checks
|
|
116
|
+
|
|
117
|
+
Pass the same explicit `semantics` registry to the universal resolver and to
|
|
118
|
+
`compatible`, `connectionCompatibility`, `validateConnectionAdapter` and
|
|
119
|
+
`adaptConnectionValue`. The optional argument is `{semantics}`; adapter calls
|
|
120
|
+
retain their existing permission, context and exact-version pin options.
|
|
121
|
+
Inheritance widens only meaning compatibility, never physical types, schemas,
|
|
122
|
+
permissions or adapter versions. Without a registry, only the standard semantic
|
|
123
|
+
relationships apply. No process-global registry is mutated by these calls.
|
|
124
|
+
|
|
125
|
+
The application composition helpers accept the same scoped registry for audits,
|
|
126
|
+
automatic connection selection, explicit source selection and recommendation
|
|
127
|
+
checks. Store reusable definitions in `manifest.semantics`:
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
semantics: [{
|
|
131
|
+
name: 'creator.example.spoken_copy',
|
|
132
|
+
description: 'Words to read aloud.',
|
|
133
|
+
parents: ['narration_script']
|
|
134
|
+
}]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Each Block may declare up to 64 namespaced meanings, eight parents per meaning
|
|
138
|
+
and 500 description characters. Definitions cannot override unnamespaced standard
|
|
139
|
+
meanings. Duplicate names within a Block, cycles, and conflicting parent sets
|
|
140
|
+
across selected versions are rejected. Matching definitions may be shared.
|
|
141
|
+
The source and release digest includes these declarations; changing a published
|
|
142
|
+
definition requires a new release, not editing an immutable version.
|
|
143
|
+
|
|
144
|
+
`semanticRegistryForManifests(manifests)` reconstructs a scoped registry from
|
|
145
|
+
saved contracts. Composer audits and local workflow execution load these package
|
|
146
|
+
definitions automatically. Connected execution captures their exact snapshot in
|
|
147
|
+
the execution-plan digest. Explicit injected registries are still ephemeral;
|
|
148
|
+
only package declarations survive save/reopen. Guest access to arbitrary project
|
|
149
|
+
context, generated adapter execution and automatic metered Chat derivation are
|
|
150
|
+
separate integrations, not permissions granted by declaring a meaning.
|
|
151
|
+
|
|
152
|
+
## Direct structured answers
|
|
153
|
+
|
|
154
|
+
The application's reviewed-answer dialogs collect required schema fields with
|
|
155
|
+
typed controls, leaving optional fields unasked and preserving existing optional
|
|
156
|
+
answers during edits. Unstructured objects offer named details with text,
|
|
157
|
+
number, yes/no, nested-detail, list and empty-value choices. Object and JSON
|
|
158
|
+
lists support adding, editing and removing items without requiring JSON syntax.
|
|
159
|
+
Primitive schemas on JSON inputs choose the corresponding typed question.
|
|
160
|
+
|
|
161
|
+
These dialogs serve the existing lazy user resolver, shared-default editor and
|
|
162
|
+
connected preview samples. They capture the contract and previous answer before
|
|
163
|
+
waiting, validate the final value and return nothing on cancellation. Collection
|
|
164
|
+
is bounded to 20 recursive questions, 60 menu choices, 20 detailed list items or
|
|
165
|
+
object fields, and the existing 8,000-character scalar/simple-list limits. Larger
|
|
166
|
+
answers still need the appropriate settings editor. Source permissions and
|
|
167
|
+
credential restrictions remain enforced by the calling resolver; these controls
|
|
168
|
+
do not create new runtime authority or automatically invoke Chat.
|
|
169
|
+
|
|
170
|
+
Single-Step and connected-run missing-answer collection use the same universal
|
|
171
|
+
resolver for allowed defaults and user callbacks. A permitted default is selected
|
|
172
|
+
before asking; it is not recorded as a user answer. Retained reviewed answers
|
|
173
|
+
remain explicit replay inputs. Contract, supplied-input and retained-answer
|
|
174
|
+
snapshots are captured before waiting, and callbacks cannot claim dependencies on
|
|
175
|
+
unavailable context. Existing host scope checks still reject edits to the real
|
|
176
|
+
project during collection. This does not enable automatic paid Chat calls.
|
|
177
|
+
|
|
178
|
+
## Versioned document conversions
|
|
179
|
+
|
|
180
|
+
The shared connection registry includes `csv-file-to-table@1`,
|
|
181
|
+
`text-to-script@1` and `script-to-text@1`. Visual/native composition, explicit
|
|
182
|
+
connection pins and semantic context resolution use the same descriptors.
|
|
183
|
+
|
|
184
|
+
CSV files must be single inline `.csv` files declared with the `csv` meaning;
|
|
185
|
+
the result has the `table` meaning and `{columns, rows}` schema. Archives,
|
|
186
|
+
remote media and malformed CSV are rejected. The existing CSV limits and
|
|
187
|
+
string-preserving parser apply; cell contents are never executed.
|
|
188
|
+
|
|
189
|
+
Script conversions preserve semantic compatibility and exact words. Wrapping
|
|
190
|
+
adds only `{schemaVersion: 1, text}`; unwrapping requires readable `text` and
|
|
191
|
+
does not carry other script metadata into the text output. Neither conversion
|
|
192
|
+
turns research notes into narration or invents additional required fields.
|
|
193
|
+
Candidate checks validate actual values when present. Version pins, source
|
|
194
|
+
policy, inherited permissions and provenance remain enforced. These are
|
|
195
|
+
deterministic built-ins, not arbitrary multi-hop or creator-code adapters.
|
|
196
|
+
|
|
197
|
+
## Conditional SDK Steps
|
|
198
|
+
|
|
199
|
+
Existing Step conditions support `greater-than`, `at-least`, `less-than` and
|
|
200
|
+
`at-most` in addition to presence and equality comparisons. Numeric thresholds
|
|
201
|
+
must be finite numbers; missing values, strings and booleans do not satisfy a
|
|
202
|
+
numeric comparison. Safe field paths and existing default handling still apply.
|
|
203
|
+
The builder and native `set_condition` control share `setProjectTypeCondition`;
|
|
204
|
+
use `null` to remove a condition. Native Step inspection includes its condition.
|
|
205
|
+
|
|
206
|
+
These conditions retain the existing false-case behavior: pass the primary input
|
|
207
|
+
unchanged to a single compatible output. They do not create general branches,
|
|
208
|
+
invent outputs, enable hosted-workspace conditions or grant execution approval.
|
|
209
|
+
|
|
210
|
+
Reviewed Chat suggestions share `canSuggestRequirement` eligibility across the
|
|
211
|
+
application and server. Supported information includes scalar text/numbers/
|
|
212
|
+
booleans, script documents, objects, JSON and their supported lists. Host-bound
|
|
213
|
+
context, credential-sensitive inputs and inputs excluding Chat remain ineligible.
|
|
214
|
+
The server captures the notes and requirement before waiting and validates the
|
|
215
|
+
returned value before issuing matching provenance. This remains a reviewed
|
|
216
|
+
suggestion, not automatic workflow dispatch or a budget authorization.
|
|
217
|
+
|
|
218
|
+
## Saved-project source updates
|
|
219
|
+
|
|
220
|
+
Project Type connections use the Block's declared input and output contracts,
|
|
221
|
+
including Blocks a creator adds later. A reviewed source change updates that
|
|
222
|
+
project's binding and marks affected results stale; it does not run a Block.
|
|
223
|
+
An explicit affected-Step update can then reuse a current saved upstream value.
|
|
224
|
+
The runner pins that value before dispatch and records its producer placement,
|
|
225
|
+
output port and run ID in the receiving run's captured input identities. The
|
|
226
|
+
pin is checked again during execution, so a changed upstream result requires a
|
|
227
|
+
fresh review. Text and structured input contents are not copied into this
|
|
228
|
+
identity record; inspect the authorized value separately when needed.
|
|
229
|
+
|
|
230
|
+
## Recommendation execution evidence
|
|
231
|
+
|
|
232
|
+
The hosted completion signal uses server-owned, terminal production capability
|
|
233
|
+
runs for an exact public release digest over 30 days. It excludes creator
|
|
234
|
+
self-use, suspended accounts, revoked releases, previews, cancellation and
|
|
235
|
+
unresolved remote work. At least five terminal runs from three users are needed;
|
|
236
|
+
each user contributes at most 20 recent runs per release. A smoothed completion
|
|
237
|
+
adjustment between minus two and plus two points supplements, but cannot replace, capability coverage
|
|
238
|
+
and connection validation. Creator-supplied quality numbers are not used.
|
|
239
|
+
|
|
240
|
+
This signal measures terminal execution completion, not generated-content
|
|
241
|
+
quality, local execution reliability or resistance to coordinated account abuse.
|
|
242
|
+
Missing evidence contributes no adjustment and does not mean failure. A measured
|
|
243
|
+
completion rate below one half lowers ranking rather than earning a bonus; a
|
|
244
|
+
rate of one half is neutral. The response
|
|
245
|
+
reports signal availability and the number of measured releases. Cost, latency
|
|
246
|
+
and creator reputation remain unmeasured ranking signals.
|
|
247
|
+
|
|
248
|
+
Visual recommendation Details explains these limits and measured-Block coverage.
|
|
249
|
+
Native recommendation inspection includes the same signal availability and
|
|
250
|
+
warnings, alongside per-proposal score explanations.
|
|
251
|
+
|
|
252
|
+
## Guest workspace patch proposals
|
|
253
|
+
|
|
254
|
+
JavaScript Blocks can call
|
|
255
|
+
`StillMade.patchProject(outputKey, {field, title, after})` to emit a reviewed
|
|
256
|
+
workspace-edit proposal. Declare a `workspace-edit` output, a matching context
|
|
257
|
+
input, and both `context.<field>.read` and `workspace.<field>.propose` permissions.
|
|
258
|
+
The helper obtains `before` from the original host-supplied context snapshot,
|
|
259
|
+
not the guest's mutable input. It returns no value and uses the ordinary output
|
|
260
|
+
collector: emit each output once and do not also return an output object.
|
|
261
|
+
|
|
262
|
+
This method does **not** apply an edit, save a project, grant permissions or call
|
|
263
|
+
the host from the sandbox. Final outputs pass the existing workspace-edit and
|
|
264
|
+
permission validators; the host's review and stale-document checks still decide
|
|
265
|
+
whether a proposal can be applied. Only existing workspace-edit fields are
|
|
266
|
+
supported, not arbitrary project fields or credentials. Guest Chat/user request
|
|
267
|
+
bridges and broader project mutation remain separate unfinished integrations.
|
|
268
|
+
|
|
269
|
+
## Bounded adapter paths
|
|
270
|
+
|
|
271
|
+
### Creator-owned conversion Blocks
|
|
272
|
+
|
|
273
|
+
When two admitted Blocks declare incompatible inputs and outputs, the Project
|
|
274
|
+
Type builder can search saved Blocks for a real intermediate Step. **Find
|
|
275
|
+
converter Blocks** inspects each candidate's versioned ports and source policy;
|
|
276
|
+
it does not run the candidate or infer that its result is correct. Choosing one
|
|
277
|
+
embeds the exact package version and creates two ordinary typed connections.
|
|
278
|
+
The connected runner executes the intermediate Block through its declared
|
|
279
|
+
runtime and validates its output before the receiver runs. Saved-project Flow
|
|
280
|
+
can search converter packages already embedded in that Project Type and review
|
|
281
|
+
the migration before adding an instance. This route preserves each Block's own
|
|
282
|
+
implementation and does not install a creator's transform in the trusted host.
|
|
283
|
+
|
|
284
|
+
The on-demand search discovers paths of up to three intermediate Blocks with
|
|
285
|
+
bounded exploration. Longer routes can still be composed as ordinary Steps.
|
|
286
|
+
New Marketplace package search from an existing project and full native/hosted
|
|
287
|
+
acceptance are still required for general interoperability. A source preview in
|
|
288
|
+
the search is never presented as a converter's unrun output.
|
|
289
|
+
|
|
290
|
+
Trusted resolver callers can opt into `maxAdapterHops: 2` or `3`. The default
|
|
291
|
+
remains one for compatibility with existing saved connection pins. Registries
|
|
292
|
+
expose `findPaths(source, requirement, options)` and
|
|
293
|
+
`applyPath([{id, version}, ...], source, requirement, options)`. Search uses
|
|
294
|
+
contract compatibility without executing transforms, examines at most 512
|
|
295
|
+
edges and returns at most 16 paths. `inspect` reports `searchTruncated` when
|
|
296
|
+
those limits prevent an exhaustive search.
|
|
297
|
+
|
|
298
|
+
Execution preflights the complete chain's permissions and contracts, validates
|
|
299
|
+
each intermediate result, preserves the original source's freshness and returns
|
|
300
|
+
provenance containing every conversion pin plus the original source revision.
|
|
301
|
+
These are trusted registered adapters, not creator-code execution authority.
|
|
302
|
+
Saving and executing chain pins in the visual/native application is not yet
|
|
303
|
+
integrated; existing connection paths remain unchanged.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Interface bridge reference
|
|
2
|
+
|
|
3
|
+
Standard and frame views receive the same `StillMade` object; members marked Frame views exist only there. `In` and `Out` are the Block's input and output values (see [TypeScript](../build/typescript.md)). The view host checks every request itself: a read-only viewer cannot run the Block or save outputs from any view.
|
|
4
|
+
|
|
5
|
+
### Inputs and runs
|
|
6
|
+
|
|
7
|
+
| Member | Where | What it does |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `readonly input: Partial<In>` | Every view | A copy of the current input values. Read it after `onInput` first fires. |
|
|
10
|
+
| `onInput(callback: (input: Partial<In>) => void): () => void` | Every view | Receives the input when the view starts and each time the host changes it. Returns a function that stops listening. Initialize controls here. |
|
|
11
|
+
| `addFiles(port: string): Promise<{added: number}>` | A saved project Step and the SDK preview | Opens StillMade's own file picker for a declared `image`, `video`, `audio`, `asset` or `file` input (or a list of them) and saves what the person chooses through StillMade's upload, as the Step's own tiles do. Call it from a click or key press in the view; a list gets the files added, a single input the first. The saved values arrive through `onInput`; the view never receives a File. A `<button class="sm-add" data-stillmade-add="port">` does this with no code. Refused for an undeclared or non-file input, an input an earlier Step fills, a viewer, and without a gesture. |
|
|
12
|
+
| `removeFile(port: string, index: number): Promise<{files: number}>` | A saved project Step and the SDK preview | Removes the file at `index` (from 0) of a declared list input (`image[]`, `video[]`, `audio[]`, `asset[]` or `file[]`), as the remove button on the Step's own tile does, and resolves to how many files the list now holds. Call it from a click or key press in the view; the new list arrives through `onInput`. A `<button data-stillmade-remove="port" data-index="2">` does this with no code. Refused for an undeclared, non-file or single input, an input an earlier Step fills, a viewer, Chat, a file that changed since the view was given it, and without a gesture. |
|
|
13
|
+
| `moveFile(port: string, from: number, to: number): Promise<{files: number}>` | A saved project Step and the SDK preview | Moves the file at `from` to the place `to` (both from 0) in a declared list input, as the Step's own move earlier and move later buttons do, so the person sets the order (a tour, a slideshow) on the Block's own screen. Same gesture and refusals as `removeFile`. A `<button data-stillmade-move="port" data-index="2" data-to="1">` does this with no code; a `data-to` past either end does nothing. |
|
|
14
|
+
| `run(values: In): Promise<Out>` | Every view | Checks the named input values, runs the Block (its recipe, JavaScript, module or hosted operation, after any approval the host asks for) and resolves to the checked outputs. On a project Step and in the SDK preview, inputs it leaves out run with the Step's current values (its photos, an earlier Step's result), so a view passes only what it sets; what it passes is kept as the Step's input. One run at a time, 30 a minute. |
|
|
15
|
+
| `useOutput(outputs: Partial<Out>): Promise<Record<string, unknown>>` | A saved project Step | Chooses media the view already holds (input media or a desktop recording) as the Block outputs without running. Only complete references the host issued are accepted. |
|
|
16
|
+
| `readonly schemaFields: Readonly<Record<string, unknown>>` | Every view | Helpers that build form fields from the input ports and their schemas, honoring inputs the host locked. |
|
|
17
|
+
|
|
18
|
+
### Shared state
|
|
19
|
+
|
|
20
|
+
| Member | Where | What it does |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `getShared(): {state: Record<string, unknown>; outputs: Record<string, unknown>; memory: unknown; canEdit: boolean}` | Every view | A copy of the view state shared by everyone in the project, the last outputs, the Block memory and whether this person may edit. |
|
|
23
|
+
| `onShared(callback: (shared: ReturnType<StillMadeView["getShared"]>) => void): () => void` | Every view | Receives the shared state now and after every change by anyone. Returns a function that stops listening. |
|
|
24
|
+
| `updateShared(values: Record<string, unknown>, preconditions?: Record<string, unknown>, options?: Record<string, unknown>): Promise<unknown>` | Every view | Changes shared fields. Keep each independently edited value in its own field so two people never conflict; a field someone else changed first is refused. |
|
|
25
|
+
| `bindShared(key: string, id: string): () => void` | Every view | Binds a form element (by id) to one shared field: it shows other people's edits and saves this person's edits, keeping drafts while they type. |
|
|
26
|
+
| `setSharedDefaults(values: Record<string, unknown>): void` | Every view | Values bound controls show until someone saves the field. |
|
|
27
|
+
| `scheduleSharedEdit(key: string, callback: () => unknown \| Promise<unknown>): void` | Every view | Runs a named shared edit after a short pause (at most 500 ms after the first request), so rapid edits to one field (sliders, drags) become one save. |
|
|
28
|
+
| `connectDocument(options: Record<string, unknown>): Readonly<Record<string, unknown>>` | Every view | Connects a declared JSON content store to shared edits once; returns its status, flush and recovery methods. |
|
|
29
|
+
| `indexById(items: Array<{id: string; [key: string]: unknown}>): Map<string, {id: string; [key: string]: unknown}>` | Every view | Indexes list items by their stable id. |
|
|
30
|
+
| `diffDocument(before: Record<string, unknown>, after: Record<string, unknown>): Array<Record<string, unknown>>` | Every view | The minimal list of edits between two versions of a document. |
|
|
31
|
+
| `applyDocument(document: Record<string, unknown>, patches: Array<Record<string, unknown>>): Record<string, unknown>` | Every view | Applies edits from diffDocument to a document. |
|
|
32
|
+
|
|
33
|
+
### Media
|
|
34
|
+
|
|
35
|
+
| Member | Where | What it does |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `previewImage(value: StillMadeImage): Promise<{url: string; width: number; height: number}>` | Every view | A display-only PNG copy (at most 512 pixels a side) of an image the view may show. Keep passing the original value to run. |
|
|
38
|
+
| `previewMedia(value: StillMadeVideo \| StillMadeAudio): Promise<{kind: "video" \| "audio"; url: string}>` | Every view | A playable blob: URL for audio or video the view may play. Call releaseMedia when done. |
|
|
39
|
+
| `releaseMedia(url: string): void` | Every view | Frees a URL previewMedia returned. |
|
|
40
|
+
| `asset(path: string): string` | Frame views | A blob: URL for one of the view's own asset files, for <img>, new FontFace() or <video>. |
|
|
41
|
+
| `readonly live: {start(options: {camera?: boolean; microphone?: boolean; fps?: number; width?: number; sampleRate?: number}): Promise<{live: true; camera: boolean; microphone: boolean; fps: number; width: number; height: number; sampleRate: number}>; stop(): Promise<{live: false}>; status(): Promise<{live: boolean; [key: string]: unknown}>; onFrame(callback: (frame: ImageBitmap, info: {index: number; timestamp: number; width: number; height: number}) => void): () => void; onAudio(callback: (samples: Float32Array, info: {index: number; timestamp: number; sampleRate: number}) => void): () => void; onEnd(callback: (event: {reason: string}) => void): () => void}` | Every view | The camera, the microphone or both as they happen (declare camera.capture and microphone.capture). Nothing reaches the view until the person presses Start in StillMade, which then shows that the device is on and a Turn off button. Frames arrive as ImageBitmaps, closed when your callback returns, so draw or copy them there; a slow view gets fewer frames, never a backlog. Audio arrives as mono Float32Array chunks. Nothing is saved. In browsers and StillMade Desktop. |
|
|
42
|
+
| `assetBytes(path: string): ArrayBuffer` | Frame views | A copy of one of the view's own asset files. |
|
|
43
|
+
|
|
44
|
+
### Generated interface
|
|
45
|
+
|
|
46
|
+
| Member | Where | What it does |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `render(targetId: string, tree: Array<Record<string, unknown>>): void` | Every view | Renders a tree of StillMade controls into an element, for standard views that build their interface from data. |
|
|
49
|
+
| `onAction(callback: (event: {action: string; value: unknown; checked: boolean; event: string}) => void \| Promise<void>): () => void` | Every view | Receives actions from controls render drew. |
|
|
50
|
+
|
|
51
|
+
### Connected work
|
|
52
|
+
|
|
53
|
+
| Member | Where | What it does |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `connectedApp(operation: "tasks" \| "preview-task" \| "apply-task", args?: Record<string, unknown>): Promise<Record<string, unknown>>` | A saved project Step | Lists, previews and applies tasks of the Block's connected-app contract. |
|
|
56
|
+
| `sharedWork(operation: string, args?: Record<string, unknown>): Promise<Record<string, unknown>>` | A saved project Step | Reads and contributes to shared work items (reviews, contributions) in the project. |
|
|
57
|
+
| `onSharedWorkRefresh(callback: () => void): () => void` | A saved project Step | Called when shared work changes elsewhere; read it again. |
|
|
58
|
+
| `previewSharedWorkMedia(contributionId: string): Promise<{url: string; kind: "image" \| "video" \| "audio"}>` | A saved project Step | A display copy of media attached to a shared work contribution. |
|
|
59
|
+
| `releaseSharedWorkMedia(url: string): void` | A saved project Step | Frees a URL previewSharedWorkMedia returned. |
|
|
60
|
+
| `desktop(operation: string, args?: Record<string, unknown>): Promise<Record<string, unknown>>` | Every view for recording and folders; StillMade Desktop for the rest | Runs a declared desktop permission after the person grants it. Recording (record.start, record.stop, record.cancel, record.status), cutting a recording (record.cut) and folders the person picks (folder.*; Chrome and Edge in a browser) work in browsers and in StillMade Desktop; clipboard, media.pick, notifications, keep-awake and native tools need StillMade Desktop. Picking or pressing Start is the consent; StillMade asks once only about the clipboard, the cursor and desktop programs. |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Custom view rules
|
|
2
|
+
|
|
3
|
+
## Custom view rules
|
|
4
|
+
Standard custom view code (no `view.config.json` frame runtime) is checked before it runs. These rules come straight from the validator; frame views run in their own sandbox and may build the page with ordinary DOM calls such as `createElement`:
|
|
5
|
+
|
|
6
|
+
- **HTML elements:** only `div`, `section`, `article`, `header`, `footer`, `main`, `aside`, `nav`, `h1`, `h2`, `h3`, `h4`, `p`, `span`, `strong`, `em`, `i`, `small`, `br`, `hr`, `label`, `input`, `textarea`, `button`, `select`, `option`, `optgroup`, `fieldset`, `legend`, `output`, `progress`, `meter`, `ul`, `ol`, `li`, `dl`, `dt`, `dd`, `figure`, `figcaption`, `img`, `video`, `audio`, `source`, `canvas`, `table`, `thead`, `tbody`, `tfoot`, `tr`, `th`, `td`, `pre`, `code`, `details`, `summary`. No scripts, iframes, SVG, forms, comments or inline event attributes; media URLs must be `data:` or `blob:`.
|
|
7
|
+
- **No loops and no function declarations:** view JavaScript may not contain `import()`, `import`, `with`, `this`, `import.meta`/`new.target`, `while`, `do`/`while`, `for`, `for…in`, `for…of`, `function` declarations. Iterate with array `map`/`forEach`/`filter`/`reduce` and write helpers as `const name = (...) => ...`.
|
|
8
|
+
- **Never use these names in view JavaScript, not even for your own variables:** `eval`, `Function`, `AsyncFunction`, `GeneratorFunction`, `require`, `importScripts`, `process`, `globalThis`, `window`, `self`, `top`, `parent`, `opener`, `frames`, `location`, `navigation`, `history`, `navigator`, `localStorage`, `sessionStorage`, `indexedDB`, `caches`, `cookieStore`, `fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource`, `Worker`, `SharedWorker`, `ServiceWorker`, `WebAssembly`, `Deno`, `Bun`, `Reflect`, `Proxy`, `DOMParser`, `MutationObserver`, `postMessage`, `open`, `close`, `print`, `alert`, `confirm`, `prompt`, `setInterval`, `setTimeout`, `queueMicrotask`, `arguments`, `constructor`, `__proto__`, `prototype`, `__lookupGetter__`, `__lookupSetter__`, `__defineGetter__`, `__defineSetter__`, `getPrototypeOf`, `setPrototypeOf`, `getOwnPropertyDescriptor`, `getOwnPropertyDescriptors`, `getOwnPropertyNames`, `getOwnPropertySymbols`, `defineProperty`, `defineProperties`, `defaultView`, `ownerGlobal`, `contentWindow`, `contentDocument`, `cookie`, `domain`, `documentURI`, `URL`, `baseURI`, `referrer`, `write`, `writeln`, `innerHTML`, `outerHTML`, `insertAdjacentHTML`, `createElement`, `createElementNS`, `createContextualFragment`, `createRange`, `setAttribute`, `setAttributeNS`, `attributes`, `attributeStyleMap`, `adoptNode`, `importNode`, `execCommand`, `replaceChildren`, `setHTML`, `setHTMLUnsafe`, `parseHTML`, `parseHTMLUnsafe`, `showSaveFilePicker`, `showDirectoryPicker`, `saveAs`, `FileSystemWritableFileStream`, `createWritable`, `msSaveBlob`, `msSaveOrOpenBlob`, `download`.
|
|
9
|
+
- **Never use these property names:** `assign`, `values`, `entries`, `fromEntries` (so no `Object.assign`, `Object.values`, `Object.entries`, `Object.fromEntries`; use arrays and `map`/`forEach`).
|
|
10
|
+
- **These words may not appear anywhere in view JavaScript, even in strings or comments:** `style`, `cssText`, `setProperty`, `removeProperty`, `insertRule`, `deleteRule`, `styleSheets`, `adoptedStyleSheets`, `animate`. Change appearance with CSS classes and `hidden`; put colors in the stylesheet.
|
|
11
|
+
- **Property access with brackets needs a literal key:** `items[0]` and `record["title"]` are accepted; `items[index]` is rejected. Iterate with `map`/`forEach` or call `items.at(index)`.
|
|
12
|
+
- **No named recursive functions** and no listeners on the global frame; attach events to declared controls.
|
|
13
|
+
- **Dynamic elements:** `StillMade.render` can create `div`, `section`, `article`, `header`, `footer`, `p`, `span`, `strong`, `em`, `i`, `small`, `h1`, `h2`, `h3`, `h4`, `label`, `button`, `input`, `textarea`, `select`, `option`, `ul`, `ol`, `li`, `table`, `thead`, `tbody`, `tr`, `th`, `td`, `details`, `summary`, `output`, `progress`, `img`; give repeated items stable IDs derived from their identity. An `img` gets its picture when you set its `src` to the data URL `StillMade.previewImage` returns, after rendering; the renderer keeps Block-owned `src`. `previewImage` works on items of an `image[]` input.
|
|
14
|
+
- **Shared writes are queued in order:** if one `StillMade.updateShared` write is rejected (conflict, read-only or timeout), the writes queued behind it are rejected too. Send dependent edits one at a time or through `StillMade.scheduleSharedEdit`, keep the person's draft, and retry from the latest `onShared` value. `{merge: true}` merges independent fields of an object value; create an absent field with the precondition `{exists: false}`.
|
|
15
|
+
- **Limits:** HTML 64 KiB, CSS 32 KiB, JavaScript 64 KiB; 30 runs and 60 image previews per minute.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Workspace sync
|
|
2
|
+
|
|
3
|
+
# Workspace sync
|
|
4
|
+
|
|
5
|
+
The host owns project navigation and synchronization. A Block renders its task controls and output; it does not add a “Continue to the next Block” control. The project rail is the single navigation surface.
|
|
6
|
+
|
|
7
|
+
`@stillmade/block-sdk/workspace-sync` defines the versioned contract. Saved changes propagate automatically through the shared project document, and every dependent Block reads the newest connected values. Propagation never asks for confirmation. Blocks still require the normal runtime approval when a new paid or hosted execution is necessary.
|
|
8
|
+
|
|
9
|
+
The shared scopes cover editor media and timing, Canvas, boards, image panels, blueprint, script, shots, voiceover, animation, and chat messages. Presence may include the active selection, normalized cursor coordinates, current editing field, an in-progress chat draft, and the client source (`web`, `desktop`, or `mcp`). Cursor display remains a viewer preference.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import {
|
|
13
|
+
WORKSPACE_SYNC_CONTRACT,
|
|
14
|
+
WORKSPACE_SYNC_SCOPES,
|
|
15
|
+
workspaceChangeEvent,
|
|
16
|
+
} from '@stillmade/block-sdk/workspace-sync';
|
|
17
|
+
|
|
18
|
+
const change = workspaceChangeEvent({
|
|
19
|
+
scope: 'panels',
|
|
20
|
+
revision: 12,
|
|
21
|
+
paths: ['strip.panel-4.image'],
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The event records which source paths changed. The host owns delivery, revision ordering, conflict handling, and downstream invalidation; Block code must not maintain a parallel navigation or synchronization channel.
|
package/docs/sdk.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Download the StillMade SDK
|
|
2
|
+
|
|
3
|
+
## SDK 0.1.0
|
|
4
|
+
Install it from npm into any folder or project (Node.js 22 or later; its dependencies ship inside the package):
|
|
5
|
+
```sh
|
|
6
|
+
npm install --save-dev stillmade-sdk
|
|
7
|
+
npx stillmade-block create --list
|
|
8
|
+
```
|
|
9
|
+
Run every CLI command as `npx stillmade-block <command>`. Coding agents should read `node_modules/stillmade-sdk/AGENTS.md` before writing a Block. The npm version can be newer than SDK 0.1.0: patch releases repackage the same SDK, and Blocks still declare `sdkVersion` 0.1.0.
|
|
10
|
+
|
|
11
|
+
Without npm, [download the complete SDK](https://stillmade.shop/block-sdk/stillmade-sdk-0.1.0.zip) and run the CLI from the extracted folder as `node packages/block-cli/cli.js <command>`. The same package is also served at `https://stillmade.shop/block-sdk/stillmade-sdk-0.1.0.tgz` for installs that cannot reach the npm registry.
|
|
12
|
+
Includes the validators, recipe interpreter, isolated JavaScript runtime and WASM, pinned runtime dependencies and licenses, CLI, TypeScript declarations, examples, and documentation. Requires Node.js 22 or later for local use. No npm installation is required after extraction.
|
|
13
|
+
|
|
14
|
+
Every finished Block must pass **Remix readiness**. Include editable source, typed I/O, controls, tests and complete license evidence. Remix works automatically through the same package contract; no custom callback or app wiring is needed. CLI validation, builder completion and import enforce it. See [the required remix contract](tools/block-remix.md).
|
|
15
|
+
|
|
16
|
+
## Documentation only
|
|
17
|
+
[Download offline documentation](https://stillmade.shop/block-sdk/stillmade-documentation-0.1.0.zip).
|
|
18
|
+
Includes Markdown guides, API reference, the paste-ready LLM guide, and the generated API index. It does not contain an execution runtime.
|
|
19
|
+
|
|
20
|
+
## Individual resources
|
|
21
|
+
- [Complete SDK manual](https://stillmade.shop/block-sdk/SDK.md)
|
|
22
|
+
- [Machine-readable API index](https://stillmade.shop/block-sdk/api-index.json)
|
|
23
|
+
- [Paste-ready LLM guide](https://stillmade.shop/block-sdk/PASTE_TO_LLM.md)
|
|
24
|
+
- [Working examples](examples.md)
|
|
25
|
+
|
|
26
|
+
## Start using the SDK
|
|
27
|
+
```sh
|
|
28
|
+
node packages/block-cli/cli.js create ./my-block javascript
|
|
29
|
+
node packages/block-cli/cli.js test ./my-block
|
|
30
|
+
node packages/block-cli/cli.js pack ./my-block
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Version policy
|
|
34
|
+
This documentation describes the current SDK 0.1.0. The manifest may declare this exact version or a supported stable range that includes it. See the [compatibility contract](reference/manifest.md#sdk-compatibility). Package release versions and working checkpoints are separate from the SDK version. See [changelog](changelog.md) and [versioning](distribute/versioning.md).
|