stillmade-sdk 0.1.50 → 0.1.51
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/AGENTS.md +2 -2
- package/FRAME_VIEWS.md +6 -0
- package/INTERFACE_DESIGN.md +44 -2
- package/PASTE_TO_LLM.md +4 -4
- package/SDK.md +61 -13
- package/docs/build/block-builder-contract.md +2 -2
- package/docs/build/frame-views.md +6 -0
- package/docs/build/interface-design.md +44 -2
- package/docs/reference/authoring-guide.md +1 -1
- package/docs/reference/errors.md +1 -1
- package/docs/reference/execution.md +3 -3
- package/docs/tools/llm.md +4 -4
- package/package.json +1 -1
- package/packages/block-cli/dev-host/assets/host.js +13 -13
- package/packages/block-platform/flow-inspection.js +14 -0
- package/packages/block-sdk/admission.js +1 -1
- package/packages/block-sdk/appearance.js +19 -4
- package/packages/block-sdk/builder-contract.js +3 -3
- package/packages/block-sdk/index.d.ts +3 -3
- package/packages/block-sdk/testing.js +3 -0
- package/packages/block-sdk/view-design.js +3 -3
- package/packages/block-sdk/view.js +3 -2
|
@@ -206,6 +206,20 @@ export function inspectProjectFlow(type,canvas={nodes:[],edges:[]},{projectId=nu
|
|
|
206
206
|
const pinOptions=selectedEdge&&!item.selected?.adapter?pinOptionsFor(canvas,producer,sourceStage,source.port,item.requirement,selectedEdge,labels,mediaVersions,restrictedResults):{canPinVersion:false,pinSource:null,pinChoices:[]};
|
|
207
207
|
return {key:item.key,label:item.label,...(item.requirement.context?{context:item.requirement.context}:{}),required:item.requirement.required!==false,state,reason:sourceSkipped?'The selected Block skipped this conditional path, so it produced no value.':native?.reason||(item.requirement.context&&!materialized?contextInputNote(item.requirement.context):item.reason),source:sourceName(item.selected,labels),sourceKind:source?.kind||null,sourcePlacementId:source?.stageId||null,sourceOutputKey:source?.port||null,selectedCandidateId:item.selected?.id||null,explicit:item.explicit===true,selectionReason:source?selectionReason(item,source):null,valuePolicy:source?.kind==='block'?(item.explicit?'follow-selected-output':'automatic-resolution'):source?.kind==='default'?'declared-default':source?'current-source-value':null,adapter:item.selected?.adapter?{id:item.selected.adapter.id,version:item.selected.adapter.version}:null,adapterDetail:adapterDetail(item.selected?.adapter,materialized),materialized,...(native?.observation?{sourceObservation:{...native.observation,revision:retainedRevision([native.observation,native.value])}}:{}),preview:materialized&&!sensitive(item.selected?.record)&&!(source?.kind==='block'&&(!(native?.port||producer?.data?.blockPackage?.manifest?.outputs?.[source.port])||sensitive(native?.port||producer.data.blockPackage.manifest.outputs[source.port])))&&!restrictedResults.has(`${source?.stageId}:${source?.port}`)?inputPreview(value,item.requirement):null,...pinOptions,...candidatePageSummary,...overrideMeta};
|
|
208
208
|
});
|
|
209
|
+
// The Block's main input (its manifest marks it primary) is what the map always shows it takes, wherever its value
|
|
210
|
+
// comes from (November 9, 2026, owner on the Voiceover card that showed no input: "is it not fucking text").
|
|
211
|
+
for(const input of inputs)if(manifest?.inputs?.[input.key]?.primary===true)input.primary=true;
|
|
212
|
+
// An optional input a person gives when they run the Block (the dates and the song of a tribute video) is part of what
|
|
213
|
+
// it takes, so the map lists it (November 9, 2026, owner: "theres way more"): left empty, no default, the person may
|
|
214
|
+
// give it (not only the Block's own screen, `sources:["view"]`), not project context, and no earlier Step could supply it.
|
|
215
|
+
for(const input of inputs){
|
|
216
|
+
const port=manifest?.inputs?.[input.key],item=row.requirements.find(requirement=>requirement.key===input.key);
|
|
217
|
+
if(!port||input.required||input.state!=='not-used'||port.default!==undefined||port.context||item?.requirement?.context||input.sourcePlacementId)continue;
|
|
218
|
+
const sources=port.sources||item?.requirement?.sources;
|
|
219
|
+
if(sources&&!sources.includes('user'))continue;
|
|
220
|
+
if((item?.candidates||[]).some(candidate=>candidate.record?.source?.kind==='block'||String(candidate.kind||'').startsWith('conversion-block')))continue;
|
|
221
|
+
input.personGives=true;
|
|
222
|
+
}
|
|
209
223
|
const last=node?.data?.blockLastRun;
|
|
210
224
|
const usedInputs=inputEvidence(last?.capturedInputs,inputs,[manifest?.inputs]);
|
|
211
225
|
const retainedRaw=[...(node?.data?.blockUnusedResults||[]).filter(record=>!record.previouslyApplied&&record.packageDigest===node?.data?.blockDigest).map(record=>({record,kind:'unused'})),...(node?.data?.blockSegmentResults||[]).filter(record=>supersededRuns.has(record.runId)&&record.packageDigest===node?.data?.blockDigest&&!(node?.data?.blockSegmentSelection?.runIds||[]).includes(record.runId)).map(record=>({record,kind:'connected'})),...(node?.data?.blockBatchResults||[]).filter(record=>record.unusedAfterSourceChange===true&&record.digest===node?.data?.blockDigest&&record.key!==last?.batchKey).map(record=>({record,kind:'batch'})),...(loopRetainedByPlacement.get(row.id)||[])];
|
|
@@ -102,7 +102,7 @@ export function scanPackageSource(pkg) {
|
|
|
102
102
|
const design=reviewViewDesign(pkg.view,{mode:interfaceMode(pkg.manifest),manifest:pkg.manifest}),notes=[...design.issues,...design.warnings];
|
|
103
103
|
results.push({name:'Task interface design',passed:design.passed,message:notes.length?notes.join(' '):'The task object leads, choices are bounded, and secondary detail stays progressively disclosed.'});
|
|
104
104
|
}
|
|
105
|
-
try {validateViewAppearance(pkg.view);results.push({name:'Appearance compatibility',passed:true,message:pkg.view?.appearance==='original'?'Interface preserves its declared original colors; StillMade theming is optional. Sandbox and shared-state checks still apply.':'Interface follows Light, Dark and White; original preview colors are preserved'});} catch(error) {results.push(pkg.view?.runtime==='frame'?{name:'Appearance compatibility',passed:true,advisory:true,message:`Advice: ${error.message} Frame views receive the theme variables; using them keeps the interface right in Light, Dark and White.`}:{name:'Appearance compatibility',passed:false,message:error.message});}
|
|
105
|
+
try {validateViewAppearance(pkg.view);results.push({name:'Appearance compatibility',passed:true,message:pkg.view?.appearance==='none'?'Interface keeps its own style: StillMade adds none of its theme, colors or Block kit. Sandbox, shared-state, input and output checks still apply.':pkg.view?.appearance==='original'?'Interface preserves its declared original colors; StillMade theming is optional. Sandbox and shared-state checks still apply.':'Interface follows Light, Dark and White; original preview colors are preserved'});} catch(error) {results.push(pkg.view?.runtime==='frame'?{name:'Appearance compatibility',passed:true,advisory:true,message:`Advice: ${error.message} Frame views receive the theme variables; using them keeps the interface right in Light, Dark and White.`}:{name:'Appearance compatibility',passed:false,message:error.message});}
|
|
106
106
|
return {...summary(results),...(['capability','module'].includes(pkg.manifest.runtime)?{execution:'not-run',liveVerified:false,reviewRequired:true}:{})};
|
|
107
107
|
}
|
|
108
108
|
// Execution safety is also used for immutable installed releases. New admission
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import {assert} from './contracts.js';
|
|
2
|
+
// host: StillMade's theme (the default); original: the view's own colors over StillMade's page and Block kit; none: an
|
|
3
|
+
// app's own style with nothing of StillMade's (owner, November 9, 2026: software mode "can also choose not to use our
|
|
4
|
+
// style"). Only an app (manifest.kind "workspace") may set none; validatePackage checks it against the manifest.
|
|
5
|
+
export const VIEW_APPEARANCES=Object.freeze(['host','original','none']);
|
|
2
6
|
// Words that may not appear anywhere in view JavaScript: interface state changes use CSS classes.
|
|
3
7
|
export const VIEW_STYLE_WORDS=Object.freeze(['style','cssText','setProperty','removeProperty','insertRule','deleteRule','styleSheets','adoptedStyleSheets','animate']);
|
|
4
8
|
|
|
@@ -33,16 +37,27 @@ function checkCss(css,{original=false}={}) {
|
|
|
33
37
|
assert(words.every(word=>allowed.has(word)) && !/#|\b(?:rgb|hsl|hwb|lab|lch|oklab|oklch|color|var)\s*\(/i.test(reduced),'APPEARANCE',`Use semantic theme tokens for ${property}; keep original colors in view.css and provide view.themedCss.`);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
40
|
+
// Theme colors live in reviewed stylesheets, not mutable UI code. Canvas pixel
|
|
41
|
+
// drawing remains available: media content does not inherit interface colors.
|
|
42
|
+
const assertNoCodeStyles=view=>assert(!new RegExp(`\\b(?:${VIEW_STYLE_WORDS.join('|')})\\b`).test(view.javascript || ''),'APPEARANCE','Use CSS classes for interface changes; put themed colors in the stylesheet instead of setting styles in JavaScript.');
|
|
36
43
|
export function validateViewAppearance(view,{appearance=view?.appearance ?? 'host'}={}) {
|
|
37
44
|
if(!view)return true; // Generated SDK controls inherit StillMade automatically.
|
|
38
|
-
assert(
|
|
45
|
+
assert(VIEW_APPEARANCES.includes(appearance),'APPEARANCE','View appearance must be host, original or none.');
|
|
46
|
+
// StillMade adds none of its theme to an app with its own style, so the theme rules below are not its: its own colors,
|
|
47
|
+
// tokens, filters, blending and animations are fine. A standard view still keeps what guards validateView's
|
|
48
|
+
// no-resources check: no CSS escapes (one could spell a url()) and no styles set from code. A frame view runs any code.
|
|
49
|
+
if(appearance==='none'){
|
|
50
|
+
if(view.runtime==='frame')return true;
|
|
51
|
+
const inline=[...view.html.matchAll(/\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi)].map(match=>match[1]??match[2]??match[3]);
|
|
52
|
+
for(const css of [view.css,view.themedCss,...inline])assert(!String(css??'').replace(/\/\*[\s\S]*?\*\//g,'').includes('\\'),'APPEARANCE','A standard view\'s CSS cannot use escapes; write the characters themselves.');
|
|
53
|
+
assertNoCodeStyles(view);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
39
56
|
const original=appearance==='original';
|
|
40
57
|
assert(!/\s(?:bgcolor|bordercolor|color|text|link|vlink|alink)\s*=/i.test(view.html),'APPEARANCE','Move presentational HTML colors into the original and themed stylesheets.');
|
|
41
58
|
checkCss(original ? view.css ?? '' : view.themedCss ?? view.css ?? '',{original});
|
|
42
59
|
if(original && view.themedCss!==undefined)checkCss(view.themedCss);
|
|
43
60
|
for(const attribute of view.html.matchAll(/\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi))checkCss(attribute[1]??attribute[2]??attribute[3],{original});
|
|
44
|
-
|
|
45
|
-
// drawing remains available: media content does not inherit interface colors.
|
|
46
|
-
assert(!new RegExp(`\\b(?:${VIEW_STYLE_WORDS.join('|')})\\b`).test(view.javascript || ''),'APPEARANCE','Use CSS classes for interface changes; put themed colors in the stylesheet instead of setting styles in JavaScript.');
|
|
61
|
+
assertNoCodeStyles(view);
|
|
47
62
|
return true;
|
|
48
63
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import {HOSTED_OPERATION_NAMES} from './contracts.js';
|
|
10
10
|
|
|
11
11
|
export const BUILDER_CONTRACT_ID='stillmade.block-builder';
|
|
12
|
-
export const BUILDER_CONTRACT_VERSION='1.
|
|
12
|
+
export const BUILDER_CONTRACT_VERSION='1.21.0';
|
|
13
13
|
export const BUILDER_CONTRACT_STAMP=`${BUILDER_CONTRACT_ID}@${BUILDER_CONTRACT_VERSION}`;
|
|
14
14
|
export const BUILDER_CONTRACT_DOCS_PATH='/docs/build/block-builder-contract';
|
|
15
15
|
// Block names appear in step bars, cards and pickers; new releases keep them short.
|
|
@@ -86,8 +86,8 @@ const SECTIONS=Object.freeze([
|
|
|
86
86
|
// pictures its full-screen button; a video without controls stays the Block's own. Also that day (owner: "there is no
|
|
87
87
|
// separation and I cannot tell what is going on"): a pick is the kit's ink fill, and media that cannot show is a quiet tile.
|
|
88
88
|
rule('ui','block',
|
|
89
|
-
'Prefer `manifest.ui`; custom views use the Block kit (`sm-*`) unless a look is named. Pictures over words: preview each option before choosing; few words, fold the rest; buttons carry `data-stillmade-action`; the start button names the action (never "Run" or "Make it") and shows no price (StillMade adds it) once the screen says what its next run makes (`StillMade.nextRun`). A job fits one screen unscrolled and a 320px phone; an app (editor, configurator, CAD tool) sets `manifest.kind: "workspace"` and works like that app: full canvas, panels, tools, undo, never a form; checks then use the app rules. An app puts `data-stillmade-layout="own"` on its root: StillMade never centers or zooms it. `<video controls>` gets StillMade\'s player; leave out `controls` when the Block drives playback. A pick keeps the kit\'s ink fill; media that cannot show is a wordless `sm-media-off` tile. Every part shows at once: the result\'s place is drawn before the first run in its own shape and size, so nothing pops in; on wide screens inputs sit left and the result right; on phones they stack, the result after the inputs. Actions and status sit on the stage (`sm-actions`, `sm-status` in `sm-stage`); the run button stays rightmost, so making again never moves; a `data-stillmade-action="download"` button beside it saves what the stage shows.',
|
|
90
|
-
'If the capability needs UI, use the Block UI SDK: generated `manifest.ui` controls first; a sandboxed custom view (`view.html`/`view.css`/`view.js`) only when the core interaction needs one. Build custom views from the Block kit the host injects (`block-kit.css`): the result in `sm-stage`, drawn before the first run in the shape and size of what is coming (`data-ratio="9:16"` for a vertical clip, lines for text, a player bar for sound) so every part of the screen is in place at once and the result fills a place the person already sees instead of popping in somewhere unexpected; StillMade draws it the same way on the Steps it draws; on a wide screen what goes in sits on the left and the result on the right, side by side, and they stack only on narrow screens and phones, the result\'s place after the inputs with the job\'s action row on it (`sm-actions` and `sm-status` inside `sm-stage`: the kit puts the status top-left and the actions top-right in the player\'s cream blocks, over a band above the media; the run button is always the rightmost, so a button that spends credits never moves and making again is pressed where it made the first time, with Download (`data-stillmade-action="download"`, which needs no code: StillMade saves the stage\'s picture or clip under the export policy) and other result actions to its left), picks as pictures in `sm-choices`, the picked one in the kit\'s ink fill (never restyled to an outline, a tint or the page\'s background) so it reads at a glance, one solid `sm-primary` naming the action in the job\'s words ("Plan the tour", "Generate voiceover"; never "Run" or "Make it") and no price (StillMade adds it) once the view says what its next run makes (`StillMade.nextRun`: its `media.generate` items or hosted operations), extras in a closed `sm-more`; a look the person names wins. Fit one laptop screen without scrolling: label beside control, status in a few words, files as tiles, rare tools as icons, (i) on unclear controls. These compact rules are for a job or an ingredient. Size the view to the Block\'s tier (block-tier.js): an app, a workspace a person works in for a while (video editor, 3D configurator, CAD or drawing tool, photo editor), declares `manifest.kind: "workspace"` and looks and works like that kind of app instead of a compact page, and StillMade\'s checks (admission, readiness, its own builder) then apply the app rules instead of the compact ones: no limit on controls in view, no Block kit page, its own layout, the craft\'s own words, and only its run button (`data-stillmade-action="run"`) held to naming what it makes: its canvas or stage fills the view, with the panels, toolbars, inspector or timeline such an app has, direct manipulation (select, drag, zoom), keyboard shortcuts and undo; it keeps the host appearance and Block kit controls, its panels may scroll, and on a phone its tools fold into sheets while the canvas stays usable. Never shrink an app into a form of fields and one button. StillMade centers a standard view narrower than its Step and zooms a view to fill its space; a stage shows what it holds in its middle as one group (a caption stays with its picture) and several results fill its width as one row, on a Block\'s screen and on the pages StillMade draws; an app that lays itself out (full-size canvas or WebGL, its own scroll, pan or zoom, its own Ctrl/Cmd +/- keys) puts `data-stillmade-layout="own"` on its outermost element, and StillMade then never centers, zooms or takes those keys. StillMade draws one player for every `<video controls>` (play, timeline, time, sound and full screen, shown for 3 s the first time it comes into view, then while the pointer is on the video, with keys and touch) and a full-screen button on result pictures in `sm-stage` or `sm-gallery` and on any element marked `data-stillmade-expand` (the same value makes one set of pictures, `off` removes it); `data-stillmade-player="native"` keeps the browser\'s controls, and a `<video>` without `controls` is the Block\'s own and is never touched. A picture or clip that cannot show here (kept on another device, or it did not open) keeps its place as a quiet `sm-media-off` tile in its own shape with the `image-off` glyph and the reason in its label, never words in its place. Drop words nobody needs; put helpful ones in a closed `sm-hint`. Mark each button `data-stillmade-action` (`run` on the one that runs the Block, which the device checks press once; a page that checks first keeps `run` on that button for both presses; what it does on the others, `"play sample"`) and label each field: Chat presses and fills them. Expose the capability, not the implementation: sensible defaults, previews, progress, clear errors, visible outputs. Show no raw JSON, internal IDs, filesystem details, provider terms or developer settings unless the Block is a developer tool. When a person chooses among options they need to hear or see (voices, music, fonts, looks, templates, images), let them preview each option before choosing: a sample or thumbnail from the Block\'s own files or the host\'s free samples, never a paid generation. Skip previews only when there is nothing to preview. Choices StillMade owns (voices, models in the run review) already show samples. Follow the host appearance (Light, Dark and White) and one elastic layout: stacked on a 320px phone with no sideways scroll (the inputs, the button in normal flow, never pinned, then the result\'s place under it), and from 860px the controls left (≤380px), the result filling the right. Short settings sit side by side, each label beside its control (`sm-field`, `sm-settings`; three or four short options as one `data-segmented` row); many items are one line each (`sm-list`) that open in place; input files are small tiles (`sm-gallery data-size="small"`); on a phone chip rows scroll sideways and long lists show three. Compacting moves controls, never deletes them.'),
|
|
89
|
+
'Prefer `manifest.ui`; custom views use the Block kit (`sm-*`) unless a look is named. Pictures over words: preview each option before choosing; few words, fold the rest; buttons carry `data-stillmade-action`; the start button names the action (never "Run" or "Make it") and shows no price (StillMade adds it) once the screen says what its next run makes (`StillMade.nextRun`). A job fits one screen unscrolled and a 320px phone; an app (editor, configurator, CAD tool) sets `manifest.kind: "workspace"` and works like that app: full canvas, panels, tools, undo, never a form; checks then use the app rules. An app puts `data-stillmade-layout="own"` on its root: StillMade never centers or zooms it, and may set view `appearance: "none"` to drop StillMade\'s style (theme, colors, Block kit); a job keeps it. `<video controls>` gets StillMade\'s player; leave out `controls` when the Block drives playback. A pick keeps the kit\'s ink fill; media that cannot show is a wordless `sm-media-off` tile. Every part shows at once: the result\'s place is drawn before the first run in its own shape and size, so nothing pops in; on wide screens inputs sit left and the result right; on phones they stack, the result after the inputs. Actions and status sit on the stage (`sm-actions`, `sm-status` in `sm-stage`); the run button stays rightmost, so making again never moves; a `data-stillmade-action="download"` button beside it saves what the stage shows.',
|
|
90
|
+
'If the capability needs UI, use the Block UI SDK: generated `manifest.ui` controls first; a sandboxed custom view (`view.html`/`view.css`/`view.js`) only when the core interaction needs one. Build custom views from the Block kit the host injects (`block-kit.css`): the result in `sm-stage`, drawn before the first run in the shape and size of what is coming (`data-ratio="9:16"` for a vertical clip, lines for text, a player bar for sound) so every part of the screen is in place at once and the result fills a place the person already sees instead of popping in somewhere unexpected; StillMade draws it the same way on the Steps it draws; on a wide screen what goes in sits on the left and the result on the right, side by side, and they stack only on narrow screens and phones, the result\'s place after the inputs with the job\'s action row on it (`sm-actions` and `sm-status` inside `sm-stage`: the kit puts the status top-left and the actions top-right in the player\'s cream blocks, over a band above the media; the run button is always the rightmost, so a button that spends credits never moves and making again is pressed where it made the first time, with Download (`data-stillmade-action="download"`, which needs no code: StillMade saves the stage\'s picture or clip under the export policy) and other result actions to its left), picks as pictures in `sm-choices`, the picked one in the kit\'s ink fill (never restyled to an outline, a tint or the page\'s background) so it reads at a glance, one solid `sm-primary` naming the action in the job\'s words ("Plan the tour", "Generate voiceover"; never "Run" or "Make it") and no price (StillMade adds it) once the view says what its next run makes (`StillMade.nextRun`: its `media.generate` items or hosted operations), extras in a closed `sm-more`; a look the person names wins. Fit one laptop screen without scrolling: label beside control, status in a few words, files as tiles, rare tools as icons, (i) on unclear controls. These compact rules are for a job or an ingredient. Size the view to the Block\'s tier (block-tier.js): an app, a workspace a person works in for a while (video editor, 3D configurator, CAD or drawing tool, photo editor), declares `manifest.kind: "workspace"` and looks and works like that kind of app instead of a compact page, and StillMade\'s checks (admission, readiness, its own builder) then apply the app rules instead of the compact ones: no limit on controls in view, no Block kit page, its own layout, the craft\'s own words, and only its run button (`data-stillmade-action="run"`) held to naming what it makes: its canvas or stage fills the view, with the panels, toolbars, inspector or timeline such an app has, direct manipulation (select, drag, zoom), keyboard shortcuts and undo; it keeps the host appearance and Block kit controls unless it sets view `appearance: "none"` (`src/view.config.json`), which only an app may: StillMade then adds none of its theme, colors, fonts, page or Block kit, the app\'s own CSS styles everything from the browser\'s defaults and the style checks are its own call, while shared state, inputs and outputs, hosted operations, the run button\'s price and StillMade\'s picker work as before; its panels may scroll, and on a phone its tools fold into sheets while the canvas stays usable. Never shrink an app into a form of fields and one button. StillMade centers a standard view narrower than its Step and zooms a view to fill its space; a stage shows what it holds in its middle as one group (a caption stays with its picture) and several results fill its width as one row, on a Block\'s screen and on the pages StillMade draws; an app that lays itself out (full-size canvas or WebGL, its own scroll, pan or zoom, its own Ctrl/Cmd +/- keys) puts `data-stillmade-layout="own"` on its outermost element, and StillMade then never centers, zooms or takes those keys. StillMade draws one player for every `<video controls>` (play, timeline, time, sound and full screen, shown for 3 s the first time it comes into view, then while the pointer is on the video, with keys and touch) and a full-screen button on result pictures in `sm-stage` or `sm-gallery` and on any element marked `data-stillmade-expand` (the same value makes one set of pictures, `off` removes it); `data-stillmade-player="native"` keeps the browser\'s controls, and a `<video>` without `controls` is the Block\'s own and is never touched. A picture or clip that cannot show here (kept on another device, or it did not open) keeps its place as a quiet `sm-media-off` tile in its own shape with the `image-off` glyph and the reason in its label, never words in its place. Drop words nobody needs; put helpful ones in a closed `sm-hint`. Mark each button `data-stillmade-action` (`run` on the one that runs the Block, which the device checks press once; a page that checks first keeps `run` on that button for both presses; what it does on the others, `"play sample"`) and label each field: Chat presses and fills them. Expose the capability, not the implementation: sensible defaults, previews, progress, clear errors, visible outputs. Show no raw JSON, internal IDs, filesystem details, provider terms or developer settings unless the Block is a developer tool. When a person chooses among options they need to hear or see (voices, music, fonts, looks, templates, images), let them preview each option before choosing: a sample or thumbnail from the Block\'s own files or the host\'s free samples, never a paid generation. Skip previews only when there is nothing to preview. Choices StillMade owns (voices, models in the run review) already show samples. Follow the host appearance (Light, Dark and White) and one elastic layout: stacked on a 320px phone with no sideways scroll (the inputs, the button in normal flow, never pinned, then the result\'s place under it), and from 860px the controls left (≤380px), the result filling the right. Short settings sit side by side, each label beside its control (`sm-field`, `sm-settings`; three or four short options as one `data-segmented` row); many items are one line each (`sm-list`) that open in place; input files are small tiles (`sm-gallery data-size="small"`); on a phone chip rows scroll sideways and long lists show three. Compacting moves controls, never deletes them.'),
|
|
91
91
|
rule('multiplayer','block',
|
|
92
92
|
'StillMade shares every screen control (`data-stillmade-local` keeps one local); a view sharing its own state (`updateShared`) adds `onShared`, `canEdit`, no re-run on remote edits.',
|
|
93
93
|
'Projects are multiplayer, and StillMade builds it: every ordinary control on a Block\'s screen (text, number, range, checkbox, color, select, textarea and a kit choice group) is shared by itself, under its `data-stillmade-share`, else its `name`, else its `id`, including controls the screen adds later; the Block writes no sharing code. `StillMade.bindShared(field, elementId)` shares a control under another field name. Mark a truly device-only control (playback, hover, device selection), or an element around several, with `data-stillmade-local`. A view that publishes its own structured state (`StillMade.updateShared(values, before, options)` or `StillMade.connectDocument`) shares its controls itself: StillMade then steps aside, and it subscribes through `StillMade.onShared(callback)`; private variables and canvas drawings are not shared unless the view publishes them. Observe shared outputs as well as state, honor `canEdit` in every mutating callback (read-only participants cannot write), never run, click or call a paid integration in response to a remote update, and preserve conflicting drafts. Shared background work uses `sharedWork` with the `work.shared` permission.'),
|
|
@@ -15,9 +15,9 @@ export interface SdkCompatibility { status:'supported'|'unsupported'|'invalid';
|
|
|
15
15
|
export function sdkCompatibility(declared:unknown,runtimeVersion?:string):SdkCompatibility;
|
|
16
16
|
export type Port = { type: string; imageMode?: 'pixels'|'reference'; role?: string; context?: keyof typeof CONTEXT_FIELDS; primary?: boolean; required?: boolean; default?: unknown; min?: number; max?: number; description?: string } & Partial<import('./semantic-contracts.js').SemanticContract>;
|
|
17
17
|
export interface Manifest { schemaVersion: 1; id: string; name: string; version: string; sdkVersion: SdkVersionRange; description: string; action?: { label: string; running?: string }; kind: 'task'|'workspace'|'editor-extension'|'composite'; inputs: Record<string, Port>; outputs: Record<string, Port>; runtime: 'recipe'|'javascript'|'module'|'comfyui'|'capability'; jobs?: {kind:'cooperative';version:1}; state?: {scope:'step';version:number;initial:Record<string,unknown>;migrations?:StateMigration[]}; entry?: string; permissions: { project: string[]; desktop?: DesktopPermission[]; capabilities?: ['comfyui.execute']|['text.generate']|['audio.speech']|['audio.transcribe']|['image.generate']|['video.generate']|['image.describe']|['timeline.propose']|['workspace.propose']|['connection.execute']; network?: never[]; filesystem?: never[]; secrets?: never[] }; desktopTools?:DesktopToolDeclaration[]; uiLayout?: {kind:'tabs'|'sections';groups:{id:string;label:string;inputs:string[];outputs:string[];collapsed?:boolean}[]}; ui?: ({ control: 'text'|'number'|'slider'|'checkbox'|'asset'; port: string; label?: string; when?: {port:string;equals:string|boolean} } | {control:'select'|'multiselect';port:string;options:string[];label?:string;when?:{port:string;equals:string|boolean}} | {control:'gallery';port:string;label?:string} | {control:'before-after';port:string;before:string;label?:string})[]; }
|
|
18
|
-
export interface BlockView { html: string; css?: string; themedCss?: string; javascript?: string; appearance?: 'host'|'original'; }
|
|
18
|
+
export interface BlockView { html: string; css?: string; themedCss?: string; javascript?: string; appearance?: 'host'|'original'|'none'; }
|
|
19
19
|
/** A frame view: any interface code (frameworks, SVG, canvas, drag) with assets named by SHA-256. */
|
|
20
|
-
export interface FrameView { runtime: 'frame'; html: string; css?: string; themedCss?: string; javascript?: string; appearance?: 'host'|'original'; files?: {schemaVersion: 1; files: Record<string, {sha256: string; bytes: number; mediaType: string}>}; }
|
|
20
|
+
export interface FrameView { runtime: 'frame'; html: string; css?: string; themedCss?: string; javascript?: string; appearance?: 'host'|'original'|'none'; files?: {schemaVersion: 1; files: Record<string, {sha256: string; bytes: number; mediaType: string}>}; }
|
|
21
21
|
export interface BlockPackage { portable?: PortableMetadata; manifest: Manifest; view?: BlockView|FrameView; code?: string; module?: ModuleDescriptor; comfyui?: ComfyWorkflow; capability?: ConnectedCapability|TextGenerationCapability|SpeechCapability|TranscriptionCapability|ImageGenerationCapability|VideoGenerationCapability|ImageDescriptionCapability|TimelineProposalCapability; recipe?: { schemaVersion: 1; steps: { id: string; op: string; args: Record<string, unknown> }[]; outputs: Record<string, unknown> }; tests: { name: string; input: Record<string, unknown>; expected?: Record<string, unknown>; state?: BlockState; expectedState?: BlockState; expectations?: Record<string, ConnectedResultExpectation|ComfyImageExpectation|CapabilityTextExpectation|CapabilityAudioExpectation|CapabilityTranscriptExpectation|CapabilityImageExpectation|CapabilityVideoExpectation|CapabilityTimelineExpectation> }[]; }
|
|
22
22
|
/** Named sandbox action with fixed declared input settings and produced ports. */
|
|
23
23
|
export interface BlockOperation {id:string;label:string;description:string;inputs:Record<string,string|number|boolean>;outputs:string[]}
|
|
@@ -178,7 +178,7 @@ export interface BlockMediaPreview { kind: 'video'|'audio'; url: string; mimeTyp
|
|
|
178
178
|
export interface BlockViewBridge { useOutput(outputs: Record<string, BlockMediaReference|BlockMediaReference[]>): Promise<Record<string, unknown>>; previewMedia(value: BlockMediaReference): Promise<BlockMediaPreview>; releaseMedia(url: string): void; render(targetId: string, tree: BlockViewNode[]): void; onAction(callback: (event: BlockViewAction) => void|Promise<void>): () => void; desktop(operation: DesktopPermission|DesktopToolOperation|import('./block-storage.js').BlockStorageOperation|"record.start"|"record.stop"|"record.cancel"|"session.close"|"live.start"|"live.stop"|"live.status"|"folder.pick"|"folder.shared"|"folder.forget"|"folder.list", args?: Record<string,unknown>): Promise<Record<string,unknown>>; readonly input: Record<string, unknown>; onInput(callback: (input: Record<string, unknown>) => void): () => void; run(input: Record<string, unknown>): Promise<Record<string, unknown>>; previewImage(value: BlockImageReference|BlockImagePixels, options?: BlockImagePreviewOptions): Promise<BlockImagePreview>; }
|
|
179
179
|
|
|
180
180
|
/** Validate hosted UI colors independently of the preserved original stylesheet. */
|
|
181
|
-
export function validateViewAppearance(view?: BlockView, options?: {appearance?:'host'|'original'}): true;
|
|
181
|
+
export function validateViewAppearance(view?: BlockView, options?: {appearance?:'host'|'original'|'none'}): true;
|
|
182
182
|
export const APPEARANCE_TOKENS: readonly string[];
|
|
183
183
|
|
|
184
184
|
/** Inert API prompt for reviewed core image nodes. Endpoints and credentials belong to the host. */
|
|
@@ -8,6 +8,7 @@ import { validateRecipe } from './recipe.js';
|
|
|
8
8
|
import { validateJavaScript } from './javascript.js';
|
|
9
9
|
import { runPackageAsync } from './runtime.js';
|
|
10
10
|
import {validateView} from './view.js';
|
|
11
|
+
import {interfaceMode} from './view-design.js';
|
|
11
12
|
import {validateComfyWorkflow,validateComfyExpectations,testComfyOutputs} from './comfyui.js';
|
|
12
13
|
import {CAPABILITY_LIMITS,validateCapability,prepareCapabilityInvocation,validateCapabilityExpectations,testCapabilityOutputs} from './capabilities.js';
|
|
13
14
|
import {validateNativeApplicationPackage,NATIVE_APPLICATION_RUNTIME_REQUIREMENT} from './native-application-package.js';
|
|
@@ -83,6 +84,8 @@ export function validatePackage(pkg) {
|
|
|
83
84
|
else if (pkg.manifest.runtime === 'javascript') { assert(!Object.hasOwn(pkg,'comfyui')&&!Object.hasOwn(pkg,'capability')&&!Object.hasOwn(pkg,'module')&&!Object.hasOwn(pkg,'moduleSource'),'PACKAGE','Only matching runtimes can contain ComfyUI workflows, host requests or module files'); validateJavaScript(pkg); }
|
|
84
85
|
else { assert(!Object.hasOwn(pkg, 'code')&&!Object.hasOwn(pkg,'comfyui')&&!Object.hasOwn(pkg,'capability')&&!Object.hasOwn(pkg,'module'), 'PACKAGE', 'Recipe packages cannot contain code, ComfyUI workflows or host requests'); validateRecipe(pkg.recipe); }
|
|
85
86
|
if(pkg.view !== undefined)validateView(pkg.view);
|
|
87
|
+
// November 9, 2026 (owner): an app may drop StillMade's style; a job keeps it, so a job's page stays StillMade's.
|
|
88
|
+
assert(pkg.view?.appearance!=='none'||interfaceMode(pkg.manifest)==='app','VIEW','Only an app (manifest.kind "workspace") can set view appearance "none"; a job keeps StillMade\'s style. Use "host", or "original" for colors of its own.');
|
|
86
89
|
assert(Array.isArray(pkg.tests) && pkg.tests.length > 0 && pkg.tests.length <= 50, 'TESTS_REQUIRED', 'Include 1–50 fixture tests');
|
|
87
90
|
if(requiresDesktopExecution(pkg))for(const fixture of pkg.tests){
|
|
88
91
|
assert(fixture&&typeof fixture.name==='string'&&fixture.name.trim().length>0,'TEST','Desktop fixtures need a name and typed input/output contracts.');
|
|
@@ -85,7 +85,7 @@ export const APP_INTERFACE_PRINCIPLES=Object.freeze([
|
|
|
85
85
|
'Work happens on the surface: select, drag, zoom and pan, keyboard shortcuts for the common tools, undo and redo.',
|
|
86
86
|
'Speak the craft: tools and panels use the words people of that craft use (Exposure, Keyframe, Extrude, Layers, Mask), never a plain-language rewrite. A button that spends credits still names what it makes ("Generate fill"), carries `data-stillmade-action="run"` and shows no price; StillMade adds it.',
|
|
87
87
|
'Order, not sparseness: tools grouped in panels that fold, the most used in view, rare ones in menus. No intros or paragraphs on the surface; a tool that needs explaining gets a tooltip or an (i).',
|
|
88
|
-
'StillMade\'s appearance (Light, Dark and White) and the Block kit\'s controls (buttons, fields, sliders, `sm-choices` with thumbnails for presets) wherever they fit; the layout is the app\'s own. A look the person names wins.',
|
|
88
|
+
'StillMade\'s appearance (Light, Dark and White) and the Block kit\'s controls (buttons, fields, sliders, `sm-choices` with thumbnails for presets) wherever they fit; the layout is the app\'s own. A look the person names wins. An app may drop StillMade\'s style instead: view `appearance: "none"`, and StillMade adds none of its theme, colors, fonts or Block kit, so the app\'s own CSS styles everything and the style rules (the kit\'s ink fill, its radii, Light, Dark and White) are its own call. Shared state, inputs and outputs, hosted operations, the run button and StillMade\'s picker work as before.',
|
|
89
89
|
'On a phone the work surface stays usable and the panels fold into sheets or one tool strip.',
|
|
90
90
|
'What the person makes leaves the app as the Block\'s outputs (and, while they work, its shared state), so the next Step and the other people in the project get it.',
|
|
91
91
|
]);
|
|
@@ -433,10 +433,10 @@ const roundPictures=css=>{const text=css.length>65536?css.slice(0,65536):css;for
|
|
|
433
433
|
// manifest: the Block's manifest, when known; a job whose result is media or a document is then held to the stage rule.
|
|
434
434
|
export function blockKitProblems(view,{mode='job',manifest=null}={}){
|
|
435
435
|
if(!view)return [];
|
|
436
|
-
const problems=[],html=String(view.html||''),strings=quotedText(String(view.javascript||'')),original=
|
|
436
|
+
const problems=[],html=String(view.html||''),strings=quotedText(String(view.javascript||'')),original=['original','none'].includes(view.appearance),app=mode==='app';
|
|
437
437
|
// November 7, 2026 (owner, of round shot tiles: "keep it a square rectangle ... make sure it never comes out like that
|
|
438
438
|
// unless explicitly said"): a picture, or something picked by its picture, is a rounded rectangle. An imported design
|
|
439
|
-
// (appearance "original")
|
|
439
|
+
// (appearance "original") and an app with its own style ("none") keep their own look.
|
|
440
440
|
if(!original&&roundPictures([view.css,view.themedCss].filter(text=>typeof text==='string').join('\n')))problems.push({rule:'kit',message:'A picture, or a pick shown by its picture, is rounded into a circle. Keep it a rounded rectangle (var(--r-2) or var(--r-3)); a circle only when the person asks for one.'});
|
|
441
441
|
const lower=html.toLowerCase();
|
|
442
442
|
// Each character is read a bounded number of times: the next search starts after this button.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {parse} from 'acorn';
|
|
2
2
|
import {assert,plain} from './contracts.js';
|
|
3
3
|
import {moduleFileDigest} from './module-runtime.js';
|
|
4
|
+
import {VIEW_APPEARANCES} from './appearance.js';
|
|
4
5
|
|
|
5
6
|
export const VIEW_LIMITS=Object.freeze({htmlBytes:65536,cssBytes:32768,javascriptBytes:65536,messageBytes:4194304,runsPerMinute:120,imagePreviewsPerMinute:240,voicePreviewsPerMinute:30,allowanceCredits:2000,imagePreviewMs:15000,imagePreviewEdge:512,imagePreviewMaxEdge:2048});
|
|
6
7
|
const bytes=value=>new TextEncoder().encode(value).length;
|
|
@@ -63,7 +64,7 @@ function promptDataAccess(ast){
|
|
|
63
64
|
export function validateView(view){
|
|
64
65
|
if(isFrameView(view))return validateFrameView(view);
|
|
65
66
|
assert(plain(view) && Object.keys(view).every(key=>['html','css','javascript','themedCss','appearance'].includes(key)),'VIEW','View must contain only html, css, javascript, optional themedCss, and appearance');
|
|
66
|
-
assert(view.appearance===undefined ||
|
|
67
|
+
assert(view.appearance===undefined || VIEW_APPEARANCES.includes(view.appearance),'VIEW','View appearance must be host, original or none');
|
|
67
68
|
for(const field of ['html','css','javascript','themedCss']){
|
|
68
69
|
if(field!=='html' && view[field]===undefined)continue;
|
|
69
70
|
assert(typeof view[field]==='string' && bytes(view[field])<=VIEW_LIMITS[`${field==='themedCss'?'css':field}Bytes`] && (field!=='html' || view[field].trim().length>0),'VIEW',`View ${field} exceeds its size limit or is empty`);
|
|
@@ -181,7 +182,7 @@ export function compileFrameViewCode(source,path,guard){
|
|
|
181
182
|
|
|
182
183
|
export function validateFrameView(view){
|
|
183
184
|
assert(Object.keys(view).every(key=>FRAME_KEYS.includes(key)),'VIEW','A frame view contains runtime "frame", html and optional css, themedCss, javascript, appearance and files');
|
|
184
|
-
assert(view.appearance===undefined ||
|
|
185
|
+
assert(view.appearance===undefined || VIEW_APPEARANCES.includes(view.appearance),'VIEW','View appearance must be host, original or none');
|
|
185
186
|
for(const field of ['html','css','javascript','themedCss']){
|
|
186
187
|
if(field!=='html' && view[field]===undefined)continue;
|
|
187
188
|
const limit=FRAME_VIEW_LIMITS[`${field==='themedCss'?'css':field}Bytes`];
|