stillmade-sdk 0.1.33 → 0.1.35
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/PASTE_TO_LLM.md +3 -3
- package/SDK.md +5 -5
- package/package.json +1 -1
- package/packages/block-sdk/builder-contract.js +3 -3
- package/packages/block-sdk/schema-fields.js +10 -2
package/AGENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ This folder is the StillMade Block SDK. Read this file before writing code; it i
|
|
|
6
6
|
|
|
7
7
|
Do not tell the user a Block is ready, done or working until `node packages/block-cli/cli.js gate .` passes after your last edit, and report the exact status it prints. In this folder Claude Code (`.claude/settings.json`) and Cursor (`.cursor/hooks.json`) run the gate when you finish a turn and send any failures back to you, but only in a session started in this folder: if you downloaded the SDK during the current session, run the gate yourself. Other agents must also run it themselves. A module Block runs code, so the gate a hook starts does not run it and says so: run `gate` or `ready` on it yourself. If you cannot fix a failure, say plainly that the Block is not ready and list the failing checks.
|
|
8
8
|
|
|
9
|
-
Contract `stillmade.block-builder@1.7.
|
|
9
|
+
Contract `stillmade.block-builder@1.7.1`. Humans, coding agents, imported source, GitHub repositories and generated code all adapt to the Block platform; anything that becomes a StillMade Block obeys this contract.
|
|
10
10
|
|
|
11
11
|
## Source of truth
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ Prefer, in order: an SDK capability; a documented host capability (the hosted op
|
|
|
54
54
|
|
|
55
55
|
## No hidden workarounds
|
|
56
56
|
|
|
57
|
-
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.
|
|
57
|
+
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.filesystem` and `permissions.secrets` must be empty arrays, and so must `permissions.network`, except in a module Block, which lists the https origins it calls through `stillmade.net.fetch`.
|
|
58
58
|
|
|
59
59
|
## Name it briefly
|
|
60
60
|
|
package/PASTE_TO_LLM.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- builder-contract:start (generated by npm run build:sdk; do not edit) -->
|
|
4
4
|
|
|
5
|
-
## Block builder contract (stillmade.block-builder@1.7.
|
|
5
|
+
## Block builder contract (stillmade.block-builder@1.7.1)
|
|
6
6
|
|
|
7
|
-
Contract `stillmade.block-builder@1.7.
|
|
7
|
+
Contract `stillmade.block-builder@1.7.1`. Humans, coding agents, imported source, GitHub repositories and generated code all adapt to the Block platform; anything that becomes a StillMade Block obeys this contract.
|
|
8
8
|
|
|
9
9
|
### Source of truth
|
|
10
10
|
|
|
@@ -52,7 +52,7 @@ Prefer, in order: an SDK capability; a documented host capability (the hosted op
|
|
|
52
52
|
|
|
53
53
|
### No hidden workarounds
|
|
54
54
|
|
|
55
|
-
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.
|
|
55
|
+
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.filesystem` and `permissions.secrets` must be empty arrays, and so must `permissions.network`, except in a module Block, which lists the https origins it calls through `stillmade.net.fetch`.
|
|
56
56
|
|
|
57
57
|
### Name it briefly
|
|
58
58
|
|
package/SDK.md
CHANGED
|
@@ -182,7 +182,7 @@ The archive needs Node.js 22 or later and nothing else; its runtime is bundled,
|
|
|
182
182
|
|
|
183
183
|
## Block builder contract
|
|
184
184
|
|
|
185
|
-
Contract `stillmade.block-builder@1.7.
|
|
185
|
+
Contract `stillmade.block-builder@1.7.1`. Humans, coding agents, imported source, GitHub repositories and generated code all adapt to the Block platform; anything that becomes a StillMade Block obeys this contract.
|
|
186
186
|
|
|
187
187
|
### Source of truth
|
|
188
188
|
|
|
@@ -230,7 +230,7 @@ Prefer, in order: an SDK capability; a documented host capability (the hosted op
|
|
|
230
230
|
|
|
231
231
|
### No hidden workarounds
|
|
232
232
|
|
|
233
|
-
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.
|
|
233
|
+
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.filesystem` and `permissions.secrets` must be empty arrays, and so must `permissions.network`, except in a module Block, which lists the https origins it calls through `stillmade.net.fetch`.
|
|
234
234
|
|
|
235
235
|
### Name it briefly
|
|
236
236
|
|
|
@@ -7241,9 +7241,9 @@ Ask the assistant to return source files or one `.stillmade.json` package. Run t
|
|
|
7241
7241
|
|
|
7242
7242
|
<!-- builder-contract:start (generated by npm run build:sdk; do not edit) -->
|
|
7243
7243
|
|
|
7244
|
-
### Block builder contract (stillmade.block-builder@1.7.
|
|
7244
|
+
### Block builder contract (stillmade.block-builder@1.7.1)
|
|
7245
7245
|
|
|
7246
|
-
Contract `stillmade.block-builder@1.7.
|
|
7246
|
+
Contract `stillmade.block-builder@1.7.1`. Humans, coding agents, imported source, GitHub repositories and generated code all adapt to the Block platform; anything that becomes a StillMade Block obeys this contract.
|
|
7247
7247
|
|
|
7248
7248
|
### Source of truth
|
|
7249
7249
|
|
|
@@ -7291,7 +7291,7 @@ Prefer, in order: an SDK capability; a documented host capability (the hosted op
|
|
|
7291
7291
|
|
|
7292
7292
|
### No hidden workarounds
|
|
7293
7293
|
|
|
7294
|
-
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.
|
|
7294
|
+
Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user's machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.filesystem` and `permissions.secrets` must be empty arrays, and so must `permissions.network`, except in a module Block, which lists the https origins it calls through `stillmade.net.fetch`.
|
|
7295
7295
|
|
|
7296
7296
|
### Name it briefly
|
|
7297
7297
|
|
package/package.json
CHANGED
|
@@ -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.7.
|
|
12
|
+
export const BUILDER_CONTRACT_VERSION='1.7.1';
|
|
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.
|
|
@@ -56,8 +56,8 @@ const SECTIONS=Object.freeze([
|
|
|
56
56
|
`Use SDK and host capabilities (hosted operations: ${hostedOperations}) before Block-local code; never rebuild assets, pickers, auth, credits, secrets, permissions, progress, sharing, persistence or providers inside a Block.`,
|
|
57
57
|
`Prefer, in order: an SDK capability; a documented host capability (the hosted operations are ${hostedOperations}; connected third-party apps go through \`connection.execute\`); an approved dependency the SDK already bundles; small Block-local code. Do not duplicate what StillMade provides. A Block never contains its own asset system, file picker, authentication, project-context system, input resolver, Block connection system, credit system, secrets store, permission system, progress system, multiplayer system, persistence system, model-provider abstraction or execution protocol.`),
|
|
58
58
|
rule('no-workarounds','both',
|
|
59
|
-
'No hard-coded paths, undocumented env vars, database access, core edits, mocked results or credentials; `network
|
|
60
|
-
'Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user\'s machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.
|
|
59
|
+
'No hard-coded paths, undocumented env vars, database access, core edits, mocked results or credentials; `network` (except module Blocks), `filesystem` and `secrets` stay empty.',
|
|
60
|
+
'Never make a Block look functional through hard-coded local paths, developer-machine dependencies, undocumented environment variables, admin or database access, hidden core modifications, direct database writes, fake or mocked production results, hand-prepared test assets that hide incompatibilities, credentials in code, or assumptions about one user\'s machine. The finished Block must work through the same interfaces available to any installed Block; `permissions.filesystem` and `permissions.secrets` must be empty arrays, and so must `permissions.network`, except in a module Block, which lists the https origins it calls through `stillmade.net.fetch`.'),
|
|
61
61
|
rule('naming','block',
|
|
62
62
|
`Name the Block in ${BLOCK_NAME_MAX_LENGTH} characters or fewer, in plain words.`,
|
|
63
63
|
`Give the Block a short, plain name of ${BLOCK_NAME_MAX_LENGTH} characters or fewer that says what it does ("Captioned Clip", not "Captioned Business Clip Generator With Review"). The name appears in step bars, Project Type cards and pickers, so put the detail in the description instead. New releases with a longer name do not pass readiness.`),
|
|
@@ -15,13 +15,21 @@ export function createSchemaFields(lockedInputKeys=[]) {
|
|
|
15
15
|
function read(root,path){pathCheck(path);inert(root);let item=root;for(const key of path){if(!item||typeof item!=='object'||!Object.hasOwn(item,key))return undefined;item=item[key];}return item===undefined?undefined:copy(item);}
|
|
16
16
|
function set(root,path,value){pathCheck(path);const result=copy(root);inert(value);let item=result;for(let i=0;i<path.length-1;i++){const key=path[i];if(!Object.hasOwn(item,key)||item[key]===null||typeof item[key]!=='object')item[key]=typeof path[i+1]==='number'?[]:{};item=item[key];}item[path.at(-1)]=copy(value);return result;}
|
|
17
17
|
function empty(s){if(Object.hasOwn(s,'default'))return copy(s.default);if(Array.isArray(s.enum)&&s.enum.length)return copy(s.enum[0]);return s.type==='object'?{}:s.type==='array'?[]:s.type==='boolean'?false:['integer','number'].includes(s.type)?Math.max(s.minimum||0,0):'';}
|
|
18
|
+
function hint(description){
|
|
19
|
+
const text=typeof description==='string'?description.replace(/\s+/g,' ').trim():'';if(!text)return '';
|
|
20
|
+
const [first,second]=text.split(/(?<=[.!?])\s+(?=[A-Z])/);
|
|
21
|
+
const kept=second&&first.length+second.length<280?first+' '+second:first;
|
|
22
|
+
return kept.length>280?kept.slice(0,279).trimEnd()+'…':kept;
|
|
23
|
+
}
|
|
18
24
|
function controls(schema,bindings,values,{canEdit=true,busy=false}={}) {
|
|
19
25
|
inert(schema);inert(bindings);inert(values);let count=0;const tree=[],actions=[];
|
|
20
26
|
const action=(kind,path,s)=>{const id=`field-${actions.length}`;actions.push({id,kind,path,s});return id;};
|
|
21
27
|
function fields(s,path,value,label,required,depth) {
|
|
22
28
|
if(++count>150||depth>5)return [{tag:'p',text:'This task needs a custom interface for its remaining fields.'}];
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
// A description sits behind an (i) beside its label, one or two sentences:
|
|
30
|
+
// connected apps describe fields at length for AI models, not people.
|
|
31
|
+
const name=String(label).slice(0,240)+(required?' *':' (optional)'),about=hint(s.description);
|
|
32
|
+
const result=[about?{tag:'div',className:'sm-label',children:[{tag:'label',text:name},{tag:'details',className:'sm-hint',children:[{tag:'summary',label:'About '+String(label).slice(0,200)},{tag:'p',text:about}]}]}:{tag:'label',text:name}],disabled=busy||!canEdit||locked.has(path[0]);
|
|
25
33
|
if(s.type==='object'&&s.properties){for(const key of Object.keys(s.properties))result.push({tag:'section',children:fields(s.properties[key],path.concat(key),value?.[key],s.properties[key].title||key,(s.required||[]).includes(key),depth+1)});}
|
|
26
34
|
else if(s.type==='array'){
|
|
27
35
|
const rows=Array.isArray(value)?value:[];
|