stillmade-sdk 0.1.7 → 0.1.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Building StillMade Blocks in this folder
2
2
 
3
- This folder is the StillMade Block SDK. Read this file before writing code; it is the same contract StillMade's own AI and importers follow. Scaffold with `node packages/block-cli/cli.js create my-block javascript`, then iterate with `validate my-block` and `test my-block`, check admission with `pack my-block /tmp/my-block.stillmade-block --original`, and finish with `ready my-block`, the same readiness check StillMade runs before an install or a release. `SDK.md` is the complete reference and `PASTE_TO_LLM.md` the detailed authoring guide.
3
+ This folder is the StillMade Block SDK. Read this file before writing code; it is the same contract StillMade's own AI and importers follow. Commands below use the downloaded SDK folder form `node packages/block-cli/cli.js`; when the SDK came from `npm install --save-dev stillmade-sdk`, type `npx stillmade-block` in its place. Scaffold with `node packages/block-cli/cli.js create my-block javascript`, then iterate with `validate my-block` and `test my-block`, check admission with `pack my-block /tmp/my-block.stillmade-block --original`, and finish with `ready my-block`, the same readiness check StillMade runs before an install or a release. `SDK.md` is the complete reference and `PASTE_TO_LLM.md` the detailed authoring guide.
4
4
 
5
5
  ## Readiness gate
6
6
 
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # StillMade SDK 0.1.0
2
+
3
+ Build, test and package Blocks for [StillMade](https://stillmade.shop).
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install --save-dev stillmade-sdk
9
+ ```
10
+
11
+ Needs Node.js 22 or later. Everything it runs ships inside the package. From a downloaded SDK folder, run `node packages/block-cli/cli.js` wherever this page says `npx stillmade-block`.
12
+
13
+ ## Build a Block
14
+
15
+ ```sh
16
+ npx stillmade-block create my-block javascript # create --list shows every template
17
+ npx stillmade-block validate my-block
18
+ npx stillmade-block test my-block # add --mock for hosted operations: no credits
19
+ npx stillmade-block gate . # the readiness check StillMade runs
20
+ npx stillmade-block pack my-block # the file to import in StillMade
21
+ ```
22
+
23
+ A Block is not ready until `gate` passes. In StillMade, choose Create, then Import (or Import folder).
24
+
25
+ ## For coding agents
26
+
27
+ Read `AGENTS.md` in this package before writing code: it is the contract every Block is checked against. Step-by-step guide: https://stillmade.shop/docs/build/with-your-ai.md
28
+
29
+ ## Documentation
30
+
31
+ https://stillmade.shop/docs/sdk · CLI reference: https://stillmade.shop/docs/reference/cli
32
+
33
+ The npm version can be newer than SDK 0.1.0: patch releases repackage the same SDK. License: PolyForm Shield 1.0.0 (see LICENSE).
package/SDK.md CHANGED
@@ -106,7 +106,7 @@ recipe and JavaScript examples continue to run offline.
106
106
  ## Build your first Block
107
107
 
108
108
  ### Prerequisites
109
- Download and extract the [SDK 0.1.0](/block-sdk/stillmade-sdk-0.1.0.zip). Install Node.js 22 or later. Run commands from the extracted SDK folder. The runtime and its dependencies are bundled; the following example needs no account, API key, npm install, or network request.
109
+ Install Node.js 22 or later. Then either run `npm install --save-dev stillmade-sdk` and type `npx stillmade-block` wherever this page says `node packages/block-cli/cli.js`, or download and extract the [SDK 0.1.0](/block-sdk/stillmade-sdk-0.1.0.zip) and run the commands from the extracted folder. The runtime and its dependencies are bundled; the following example needs no account, API key or network request.
110
110
 
111
111
  ### Create a Block
112
112
  ```sh
@@ -160,7 +160,11 @@ Give your coding agent (Claude Code, Cursor, Codex, Gemini CLI or similar) a lin
160
160
  ### For the coding agent
161
161
  Do every step yourself. Do not ask the person to download, unzip, open a folder or run a command; only ask about what the Block should do.
162
162
 
163
- 1. **Get the SDK.** It is `/block-sdk/stillmade-sdk-0.1.0.zip` on the same site as this page: replace this page's path with that one (for example `https://stillmade.shop/block-sdk/stillmade-sdk-0.1.0.zip`, or `http://localhost:3000/block-sdk/stillmade-sdk-0.1.0.zip` when this page came from localhost). If `stillmade-blocks/AGENTS.md` already exists in your working folder, reuse that folder. Otherwise download and extract it into `stillmade-blocks`:
163
+ 1. **Get the SDK.** With Node.js 22 or later and npm, install it in your working folder:
164
+ ```sh
165
+ npm install --save-dev stillmade-sdk
166
+ ```
167
+ Then read `node_modules/stillmade-sdk/AGENTS.md` in full and run every command below as `npx stillmade-block`. Without npm, download the SDK archive instead. It is `/block-sdk/stillmade-sdk-0.1.0.zip` on the same site as this page: replace this page's path with that one (for example `https://stillmade.shop/block-sdk/stillmade-sdk-0.1.0.zip`, or `http://localhost:3000/block-sdk/stillmade-sdk-0.1.0.zip` when this page came from localhost). If `stillmade-blocks/AGENTS.md` already exists in your working folder, reuse that folder. Otherwise download and extract it into `stillmade-blocks`:
164
168
  ```sh
165
169
  curl -fsSL "<SDK URL>" -o stillmade-sdk.zip && unzip -q stillmade-sdk.zip -d stillmade-blocks && rm stillmade-sdk.zip
166
170
  ```
@@ -168,10 +172,10 @@ On Windows PowerShell:
168
172
  ```powershell
169
173
  Invoke-WebRequest "<SDK URL>" -OutFile stillmade-sdk.zip; Expand-Archive stillmade-sdk.zip stillmade-blocks; Remove-Item stillmade-sdk.zip
170
174
  ```
171
- The SDK needs Node.js 22 or later and nothing else; its runtime is bundled, so never run `npm install` in it.
172
- 2. **Read `stillmade-blocks/AGENTS.md` in full** before writing code. It is the contract StillMade checks every Block against.
173
- 3. **Build inside `stillmade-blocks`.** Scaffold with `node packages/block-cli/cli.js create <name> javascript` (or `image`, `stateful`, `capability`), then iterate with `node packages/block-cli/cli.js validate <name>` and `test <name>`.
174
- 4. **Run the readiness gate before you call anything ready:** `node packages/block-cli/cli.js gate .` from `stillmade-blocks`. Report the exact status it prints. If it fails, fix the listed checks and run it again. If you cannot fix them, tell the person plainly that the Block is not ready and list the failing checks. A browser application reports NEEDS STILLMADE REVIEW: tell the person to import it so StillMade can run its isolated review.
175
+ The archive needs Node.js 22 or later and nothing else; its runtime is bundled, so never run `npm install` in it. From the archive, run commands from `stillmade-blocks` as `node packages/block-cli/cli.js` where the steps below say `npx stillmade-block`.
176
+ 2. **Read `AGENTS.md` in full** before writing code (`node_modules/stillmade-sdk/AGENTS.md` from npm, `stillmade-blocks/AGENTS.md` from the archive). It is the contract StillMade checks every Block against.
177
+ 3. **Build the Block.** Scaffold with `npx stillmade-block create <name> javascript` (`npx stillmade-block create --list` shows every template, including `text`, `image-generate` and `speech` for hosted generation), then iterate with `npx stillmade-block validate <name>` and `npx stillmade-block test <name>`. Hosted operations need `test <name> --mock`, which uses recorded stand-ins and spends no credits.
178
+ 4. **Run the readiness gate before you call anything ready:** `npx stillmade-block gate .` from the folder that holds the Block. Report the exact status it prints. If it fails, fix the listed checks and run it again. If you cannot fix them, tell the person plainly that the Block is not ready and list the failing checks. A browser application reports NEEDS STILLMADE REVIEW: tell the person to import it so StillMade can run its isolated review.
175
179
  5. **Hand it over.** Give the person the full path of the `<name>` folder. In StillMade they choose **Import folder** and select that folder.
176
180
 
177
181
  `stillmade-blocks` contains hooks that run the gate automatically when a Claude Code or Cursor session started in that folder finishes a turn. In the session that downloaded the SDK those hooks are not active yet, so run the gate yourself as in step 4.
@@ -6587,9 +6591,9 @@ Accepts decoded RGBA. Thickness is an integer from 1 to 8; threshold is from 0 t
6587
6591
 
6588
6592
  ### Run commands
6589
6593
  ```sh
6590
- node packages/block-cli/cli.js <command> <target> [argument] [options]
6594
+ npx stillmade-block <command> <target> [argument] [options]
6591
6595
  ```
6592
- Run from the SDK folder, or add the extracted SDK to a project with `npm install --save-dev <SDK folder>` and call `stillmade-block` from npm scripts. Targets can be authoring folders or packed files, except where a command creates a new target. `--help` prints this list.
6596
+ That is the form after `npm install --save-dev stillmade-sdk`. From a downloaded SDK folder, run `node packages/block-cli/cli.js <command> …` instead. Output is a JSON object when it is piped, which is what coding agents read; `--text` prints readable text and `--json` forces JSON. Targets can be authoring folders or packed files, except where a command creates a new target. `--help` prints this list.
6593
6597
 
6594
6598
  | Command | Argument | Behavior |
6595
6599
  | --- | --- | --- |
@@ -7132,10 +7136,12 @@ The same publishing panel controls public cover media, full description, categor
7132
7136
 
7133
7137
  My builds includes original and forked drafts, imports, installed versions, every own release and private releases. A version can be marked deprecated or delisted, with a public notice and an optional replacement version. It stops appearing in discovery and becomes ineligible for indexing; direct version URLs, source downloads and existing pinned projects remain available unless a separate security revocation applies.
7134
7138
 
7135
- Community publication does not automatically create a curated listing. Set the
7136
- source license in `manifest.license` (or top-level `license` for a project type),
7137
- save/test/sync, and publish an immutable Community version. Submit that released
7138
- version from Block Developer and track the decision in My builds. Supported SPDX
7139
+ A Block published publicly from StillMade is listed in the Marketplace as soon as
7140
+ its automatic checks pass: tests for its exact source, a supported license, its
7141
+ runtime, and no exact duplicate. No one reviews it by hand. A Project Type waits
7142
+ for an admin review. Set the source license in `manifest.license` (or top-level
7143
+ `license` for a project type), save/test/sync, and publish an immutable Community
7144
+ version; track the result in My builds. Supported SPDX
7139
7145
  identifiers for the initial review flow are exported as `MARKETPLACE_LICENSES` and
7140
7146
  listed in `api-index.json`; custom/unknown licensing needs a later review workflow.
7141
7147
  Changing a published version's license requires a new immutable version.
@@ -7154,7 +7160,7 @@ Blocks, Project Types, and creators have their own page URLs. Public pages link
7154
7160
 
7155
7161
  ## Build with an AI coding tool
7156
7162
 
7157
- The fastest route is to send your coding agent [Build a Block with your AI](/docs/build/with-your-ai) with your idea: it downloads the SDK, builds the Block and runs the readiness gate without you running anything.
7163
+ The fastest route is to send your coding agent [Build a Block with your AI](/docs/build/with-your-ai) with your idea: it installs the SDK (`npm install --save-dev stillmade-sdk`), builds the Block and runs the readiness gate without you running anything.
7158
7164
 
7159
7165
  ### Start with the SDK contract
7160
7166
  Use the button below to copy the complete authoring guide, then add a short description such as “Make a Block that converts an image to grayscale while preserving alpha.” The guide includes the package format, supported runtime, typed ports, permissions, fixtures, and a complete example.
@@ -9139,11 +9145,14 @@ Hosted text and speech require their separate [text review](/docs/build/hosted-t
9139
9145
  ## Download the StillMade SDK
9140
9146
 
9141
9147
  ### SDK 0.1.0
9142
- [Download the complete SDK](/block-sdk/stillmade-sdk-0.1.0.zip), or install the same files as an npm package (its dependencies ship inside it, so no registry is needed):
9148
+ Install it from npm into any folder or project (Node.js 22 or later; its dependencies ship inside the package):
9143
9149
  ```sh
9144
- npm install --save-dev https://stillmade.shop/block-sdk/stillmade-sdk-0.1.0.tgz
9150
+ npm install --save-dev stillmade-sdk
9145
9151
  npx stillmade-block create --list
9146
9152
  ```
9153
+ 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.
9154
+
9155
+ Without npm, [download the complete SDK](/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.
9147
9156
  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.
9148
9157
 
9149
9158
  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](/docs/tools/block-remix).
package/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "stillmade-sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "StillMade Block SDK, CLI and examples",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "type": "module",
7
+ "homepage": "https://stillmade.shop/docs/sdk",
8
+ "keywords": [
9
+ "stillmade",
10
+ "stillmade-block",
11
+ "sdk",
12
+ "cli"
13
+ ],
7
14
  "bin": {
8
15
  "stillmade-block": "packages/block-cli/cli.js"
9
16
  },
@@ -1,5 +1,6 @@
1
1
  // Readable terminal output for stillmade-block. `--json` prints the result
2
2
  // object instead, for scripts and coding agents.
3
+ import {relative,resolve} from 'node:path';
3
4
 
4
5
  export const HELP=`stillmade-block: build, test and package StillMade Blocks
5
6
 
@@ -50,6 +51,15 @@ function notes(result){
50
51
  return out;
51
52
  }
52
53
 
54
+ // The command that runs this CLI again from the new Block folder, so the printed
55
+ // next steps work when they are copied: npx when npm ran it, the CLI file from a
56
+ // downloaded SDK folder, and the bare name only for a global install.
57
+ export function cliCommand(folder,{env=process.env,argv=process.argv}={}){
58
+ const script=String(argv[1]||'');
59
+ if(env.npm_command==='exec'||env.npm_command==='run-script'||/node_modules[\\/]stillmade-sdk[\\/]/.test(script))return 'npx stillmade-block';
60
+ if(/packages[\\/]block-cli[\\/]cli\.js$/.test(script)&&folder)return `node ${relative(resolve(folder),script).replaceAll('\\','/')}`;
61
+ return 'stillmade-block';
62
+ }
53
63
  export function formatResult(args,result){
54
64
  const command=args[0];
55
65
  if(result?.help)return result.help;
@@ -59,7 +69,8 @@ export function formatResult(args,result){
59
69
  }
60
70
  if(command==='create'&&result?.created){
61
71
  if(result.kind==='type')return lines(`Created a Project Type at ${result.created}.`);
62
- return lines(`Created a ${result.runtime} Block from the ${result.template} template in ${result.created}.`,'','Next:',` cd ${result.created}`,result.files?.includes('package.json')?' npm install':null,result.files?.includes('package.json')?' npm run build':null,' stillmade-block dev .',` stillmade-block test .${result.runtime==='capability'?' --mock':''}`,' stillmade-block pack .');
72
+ const cli=cliCommand(result.created);
73
+ return lines(`Created a ${result.runtime} Block from the ${result.template} template in ${result.created}.`,'','Next:',` cd ${result.created}`,result.files?.includes('package.json')?' npm install':null,result.files?.includes('package.json')?' npm run build':null,` ${cli} dev .`,` ${cli} test .${result.runtime==='capability'?' --mock':''}`,` ${cli} pack .`);
63
74
  }
64
75
  if(command==='validate'&&result?.valid)return lines(`Valid: ${result.id}`,result.appearanceAdvice?`Advice: ${result.appearanceAdvice}`:null,result.tests===0?'Fixtures for hosted runs are checked in StillMade; try them offline with: stillmade-block test . --mock':null,result.mobileProfile?`Phone profile: ${result.mobileProfile.message}`:null);
65
76
  if(command==='test'&&Array.isArray(result?.results)){
@@ -16,7 +16,7 @@ function packageFiles(pkg){
16
16
  else if(pkg.recipe)files['src/recipe.json']=json(pkg.recipe);
17
17
  return files;
18
18
  }
19
- const readme=(title,body,commands)=>`# ${title}\n\n${body}\n\n\`\`\`sh\n${commands.join('\n')}\n\`\`\`\n\nThe full guide: https://stillmade.shop/docs/build\n`;
19
+ const readme=(title,body,commands)=>`# ${title}\n\n${body}\n\n\`\`\`sh\n${commands.join('\n')}\n\`\`\`\n\nInstalled the SDK from npm? Put \`npx \` in front of each command. From a downloaded SDK folder, run \`node ../packages/block-cli/cli.js\` in place of \`stillmade-block\`.\n\nThe full guide: https://stillmade.shop/docs/build\n`;
20
20
  const OFFLINE=['stillmade-block validate .','stillmade-block test .','stillmade-block dev .','stillmade-block pack .'];
21
21
  const HOSTED=['stillmade-block validate .','stillmade-block test . --mock # recorded stand-ins, no credits','stillmade-block dev .','stillmade-block pack .'];
22
22
  const fromExample=(load,body,commands=OFFLINE)=>async()=>{const pkg=await load();return {...packageFiles(pkg),'README.md':readme(pkg.manifest.name,body,commands)};};
@@ -140,5 +140,5 @@ export function renderBuilderContract(form='compact',{scope='all'}={}){
140
140
  `## Platform gap classes\n\n${Object.entries(GAP_CLASSES).map(([key,label])=>`- ${key}: ${label}`).join('\n')}`,
141
141
  ].join('\n\n');
142
142
  if(form==='full')return `# StillMade Block builder contract\n\n${body}`;
143
- return `# Building StillMade Blocks in this folder\n\nThis folder is the StillMade Block SDK. Read this file before writing code; it is the same contract StillMade's own AI and importers follow. Scaffold with \`node packages/block-cli/cli.js create my-block javascript\`, then iterate with \`validate my-block\` and \`test my-block\`, check admission with \`pack my-block /tmp/my-block.stillmade-block --original\`, and finish with \`ready my-block\`, the same readiness check StillMade runs before an install or a release. \`SDK.md\` is the complete reference and \`PASTE_TO_LLM.md\` the detailed authoring guide.\n\n## Readiness gate\n\nDo 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. If you cannot fix a failure, say plainly that the Block is not ready and list the failing checks.\n\n${body}`;
143
+ return `# Building StillMade Blocks in this folder\n\nThis folder is the StillMade Block SDK. Read this file before writing code; it is the same contract StillMade's own AI and importers follow. Commands below use the downloaded SDK folder form \`node packages/block-cli/cli.js\`; when the SDK came from \`npm install --save-dev stillmade-sdk\`, type \`npx stillmade-block\` in its place. Scaffold with \`node packages/block-cli/cli.js create my-block javascript\`, then iterate with \`validate my-block\` and \`test my-block\`, check admission with \`pack my-block /tmp/my-block.stillmade-block --original\`, and finish with \`ready my-block\`, the same readiness check StillMade runs before an install or a release. \`SDK.md\` is the complete reference and \`PASTE_TO_LLM.md\` the detailed authoring guide.\n\n## Readiness gate\n\nDo 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. If you cannot fix a failure, say plainly that the Block is not ready and list the failing checks.\n\n${body}`;
144
144
  }