Sample
@img/sharp-webcontainers-wasm32 0.35.5
Verified sample for npm @img/sharp-webcontainers-wasm32 0.35.5. The contract ran on node 22 · linux debian/x64 · docker and passed.
sha256:f78f5514a2f981a97df96b59fffe5f177fc58104c3507632bbbb63a9c903e438
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-11-29 |
Case
HOW- Goal
- verify pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5
- Environment
- node 22.23.2
- Created
- 2026-11-29T03:40:30Z
Contract
- Installing @img/sharp-webcontainers-wasm32@0.35.5 on linux/x64 requires force=true in .npmrc because package.json restricts cpu to wasm32
- Requiring @img/sharp-webcontainers-wasm32/sharp.node loads the WebAssembly libvips 8.18.7 addon with isWasm=true and isGlobal=false
- binding.format() reports png, jpeg, and webp codecs with buffer input and output enabled
- binding.cache(32, 12, 64) and binding.concurrency(1) update and return libvips runtime limits
- binding.metadata() decodes an offline 1x1 RGBA PNG returning format=png, mediaType=image/png, width=1, height=1, channels=4, hasAlpha=true, space=srgb
- binding.stats() returns isOpaque=false and exact 4-channel pixel statistics (255, 0, 128, 128) for the 1x1 RGBA PNG offline
- binding.metadata() passes an Error to its callback when given invalid image bytes
- Dynamic ESM import of @img/sharp-webcontainers-wasm32/sharp.node resolves to the same libvips 8.18.7 WASM addon
- Requiring @img/sharp-webcontainers-wasm32/package or @img/sharp-webcontainers-wasm32/versions throws ERR_PACKAGE_PATH_NOT_EXPORTED in 0.35.5 because @img/sharp-wasm32@0.35.5 omits *.json exports
Files
- .npmrc
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/binding.cjs
- test/contract.cjs
Source
force=true
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:0c398cac904079c573abf5d7f87acb79825ffb7ebbfded5be179f0534a93983d","constraints":{"executionContext":"node"},"contract":["Installing @img/sharp-webcontainers-wasm32@0.35.5 on linux/x64 requires force=true in .npmrc because package.json restricts cpu to wasm32","Requiring @img/sharp-webcontainers-wasm32/sharp.node loads the WebAssembly libvips 8.18.7 addon with isWasm=true and isGlobal=false","binding.format() reports png, jpeg, and webp codecs with buffer input and output enabled","binding.cache(32, 12, 64) and binding.concurrency(1) update and return libvips runtime limits","binding.metadata() decodes an offline 1x1 RGBA PNG returning format=png, mediaType=image/png, width=1, height=1, channels=4, hasAlpha=true, space=srgb","binding.stats() returns isOpaque=false and exact 4-channel pixel statistics (255, 0, 128, 128) for the 1x1 RGBA PNG offline","binding.metadata() passes an Error to its callback when given invalid image bytes","Dynamic ESM import of @img/sharp-webcontainers-wasm32/sharp.node resolves to the same libvips 8.18.7 WASM addon","Requiring @img/sharp-webcontainers-wasm32/package or @img/sharp-webcontainers-wasm32/versions throws ERR_PACKAGE_PATH_NOT_EXPORTED in 0.35.5 because @img/sharp-wasm32@0.35.5 omits *.json exports"],"goal":"verify pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5","kind":"HOW","packages":["pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5"],"schemaVersion":1},"contractCommand":["node","test/contract.cjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5"],"schemaVersion":1,"subject":"pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5","verifierAdapter":"node-typescript@1"}
{
"name": "sharp-webcontainers-wasm32-verify",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sharp-webcontainers-wasm32-verify",
"version": "1.0.0",
"dependencies": {
"@img/sharp-webcontainers-wasm32": "0.35.5"
}
},
"node_modules/@emnapi/runtime": {
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
"license": "MIT",
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@img/sharp-wasm32": {
"version": "0.35.5",
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz",
"integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==",
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
"dependencies": {
"@emnapi/runtime": "^1.11.3"
},
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-webcontainers-wasm32": {
"version": "0.35.5",
"resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz",
"integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==",
"cpu": [
"wasm32"
],
"license": "Apache-2.0",
"dependencies": {
"@img/sharp-wasm32": "0.35.5"
},
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/tslib": {
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
"integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==",
"license": "0BSD"
}
}
}
{
"name": "sharp-webcontainers-wasm32-verify",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of @img/sharp-webcontainers-wasm32@0.35.5 in Node.js",
"main": "src/binding.cjs",
"scripts": {
"test": "node test/contract.cjs"
},
"dependencies": {
"@img/sharp-webcontainers-wasm32": "0.35.5"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5",
"kind": "HOW",
"packages": [
"pkg:npm/%40img/sharp-webcontainers-wasm32@0.35.5"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
'use strict';
const binding = require('@img/sharp-webcontainers-wasm32/sharp.node');
function makeInputOptions(buffer) {
return {
input: {
buffer,
failOn: 'warning',
limitInputPixels: 268402689,
limitInputChannels: 0,
unlimited: false,
autoOrient: false,
sequentialRead: false
},
debuglog: () => {}
};
}
function queryRuntime() {
return {
version: binding.libvipsVersion(),
formats: binding.format(),
cache: binding.cache(),
concurrency: binding.concurrency(),
counters: binding.counters(),
simd: binding.simd()
};
}
function setLimits(memoryMb, maxFiles, maxItems, threads) {
const cache = binding.cache(memoryMb, maxFiles, maxItems);
const concurrency = binding.concurrency(threads);
return { cache, concurrency };
}
function readMetadata(buffer) {
return new Promise((resolve, reject) => {
binding.metadata(makeInputOptions(buffer), (err, info) => {
if (err) {
reject(err);
return;
}
resolve(info);
});
});
}
function readStats(buffer) {
return new Promise((resolve, reject) => {
binding.stats(makeInputOptions(buffer), (err, info) => {
if (err) {
reject(err);
return;
}
resolve(info);
});
});
}
module.exports = {
binding,
queryRuntime,
setLimits,
readMetadata,
readStats
};
'use strict';
const assert = require('node:assert/strict');
const zlib = require('node:zlib');
const {
binding,
queryRuntime,
setLimits,
readMetadata,
readStats
} = require('../src/binding.cjs');
function crc32(buf) {
let crc = 0xffffffff;
for (let i = 0; i < buf.length; i += 1) {
crc ^= buf[i];
for (let bit = 0; bit < 8; bit += 1) {
crc = (crc & 1) ? (0xedb88320 ^ (crc >>> 1)) : (crc >>> 1);
}
}
return (crc ^ 0xffffffff) >>> 0;
}
function pngChunk(type, data) {
const typeBuf = Buffer.from(type, 'ascii');
const lenBuf = Buffer.alloc(4);
lenBuf.writeUInt32BE(data.length, 0);
const crcBuf = Buffer.alloc(4);
crcBuf.writeUInt32BE(crc32(Buffer.concat([typeBuf, data])), 0);
return Buffer.concat([lenBuf, typeBuf, data, crcBuf]);
}
function buildRgba1x1Png(r, g, b, a) {
const sig = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
const ihdr = Buffer.alloc(13);
ihdr.writeUInt32BE(1, 0);
ihdr.writeUInt32BE(1, 4);
ihdr[8] = 8; // bit depth
ihdr[9] = 6; // color type RGBA
ihdr[10] = 0; // compression
ihdr[11] = 0; // filter
ihdr[12] = 0; // interlace
const rawScanline = Buffer.from([0, r, g, b, a]);
const idat = zlib.deflateSync(rawScanline);
return Buffer.concat([
sig,
pngChunk('IHDR', ihdr),
pngChunk('IDAT', idat),
pngChunk('IEND', Buffer.alloc(0))
]);
}
async function run() {
// 1. CJS ./sharp.node loads libvips 8.18.7 WebAssembly binding
const runtime = queryRuntime();
assert.equal(runtime.version.isWasm, true);
assert.equal(runtime.version.isGlobal, false);
assert.equal(runtime.version.semver, '8.18.7');
assert.equal(typeof runtime.simd, 'boolean');
assert.equal(runtime.counters.queue, 0);
assert.equal(runtime.counters.process, 0);
// 2. Buffer codecs are available for png, jpeg, and webp
for (const codec of ['png', 'jpeg', 'webp']) {
assert.ok(runtime.formats[codec], `expected format entry for ${codec}`);
assert.equal(runtime.formats[codec].input.buffer, true);
assert.equal(runtime.formats[codec].output.buffer, true);
}
// 3. Cache and concurrency limits can be updated and read back
const limits = setLimits(32, 12, 64, 1);
assert.equal(limits.cache.memory.max, 32);
assert.equal(limits.cache.files.max, 12);
assert.equal(limits.cache.items.max, 64);
assert.equal(limits.concurrency, 1);
assert.equal(binding.concurrency(), 1);
// 4. metadata() decodes a 1x1 RGBA PNG generated offline
const samplePng = buildRgba1x1Png(255, 0, 128, 128);
const meta = await readMetadata(samplePng);
assert.equal(meta.format, 'png');
assert.equal(meta.mediaType, 'image/png');
assert.equal(meta.width, 1);
assert.equal(meta.height, 1);
assert.equal(meta.channels, 4);
assert.equal(meta.hasAlpha, true);
assert.equal(meta.space, 'srgb');
// 5. stats() computes exact 4-channel statistics for the 1x1 RGBA PNG
const stats = await readStats(samplePng);
assert.equal(stats.isOpaque, false);
assert.equal(stats.channels.length, 4);
assert.equal(stats.channels[0].min, 255);
assert.equal(stats.channels[1].min, 0);
assert.equal(stats.channels[2].min, 128);
assert.equal(stats.channels[3].min, 128);
// 6. metadata() rejects invalid image bytes via its error callback
await assert.rejects(
() => readMetadata(Buffer.from('invalid-image-payload')),
(err) => err instanceof Error && err.message.length > 0
);
// 7. Dynamic ESM import of ./sharp.node resolves to the same libvips 8.18.7 WASM addon
const esmAddon = await import('@img/sharp-webcontainers-wasm32/sharp.node');
assert.equal(esmAddon.default.libvipsVersion().semver, '8.18.7');
assert.equal(esmAddon.default.libvipsVersion().isWasm, true);
// 8. ./package and ./versions subpaths fail in 0.35.5 because @img/sharp-wasm32@0.35.5 omits *.json exports
for (const subpath of ['package', 'versions']) {
assert.throws(
() => require(`@img/sharp-webcontainers-wasm32/${subpath}`),
(err) => err && err.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED'
);
}
console.log('contract ok');
}
run().catch((err) => {
console.error(err);
process.exit(1);
});
Origin Seeder
anonymous