サンプル
@cloudflare/workers-types 5.20260917.1
検証済みサンプル — npm @cloudflare/workers-types 5.20260917.1. node 22 · linux debian/x64 · docker で contract を実行し、成功しました: @cloudflare/workers-types package.json…
sha256:8623e6d68b3496cc8c9397277c3fb1cdec73cd9a6b35912cb8e8893da395e88f
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux 24 · ubuntu · glibc 2.39 x64 npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| 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-09-17 |
ケース
HOW- ゴール
- verify pkg:npm/%40cloudflare/workers-types@5.20260917.1
- 作成日
- 2026-09-17T14:39:34Z
コントラクト
- @cloudflare/workers-types package.json declares name @cloudflare/workers-types and version 5.20260917.1
- @cloudflare/workers-types index.d.ts declares ExecutionContext interface with waitUntil and passThroughOnException methods
- @cloudflare/workers-types index.d.ts declares KVNamespace interface with get, put, delete, and list methods
- @cloudflare/workers-types index.d.ts declares R2Bucket interface with head, get, put, and delete methods
- @cloudflare/workers-types index.d.ts declares D1Database class with prepare, batch, and exec methods
- @cloudflare/workers-types experimental/index.d.ts provides typing environment for experimental Cloudflare Workers features
ファイル
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
ソース
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/%40cloudflare/workers-types@5.20260917.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40cloudflare/workers-types@5.20260917.1
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:07c4775cc6a65df2fd58987bff9f9dff202c5f9f873e47fb6bfaf72f4cb18069","contract":["@cloudflare/workers-types package.json declares name @cloudflare/workers-types and version 5.20260917.1","@cloudflare/workers-types index.d.ts declares ExecutionContext interface with waitUntil and passThroughOnException methods","@cloudflare/workers-types index.d.ts declares KVNamespace interface with get, put, delete, and list methods","@cloudflare/workers-types index.d.ts declares R2Bucket interface with head, get, put, and delete methods","@cloudflare/workers-types index.d.ts declares D1Database class with prepare, batch, and exec methods","@cloudflare/workers-types experimental/index.d.ts provides typing environment for experimental Cloudflare Workers features"],"goal":"verify pkg:npm/%40cloudflare/workers-types@5.20260917.1","kind":"HOW","packages":["pkg:npm/%40cloudflare/workers-types@5.20260917.1"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40cloudflare/workers-types@5.20260917.1"],"schemaVersion":1,"subject":"pkg:npm/%40cloudflare/workers-types@5.20260917.1","verifierAdapter":"node-typescript@1"}
{
"name": "sample-cloudflare-workers-types",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-cloudflare-workers-types",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@cloudflare/workers-types": "5.20260917.1"
}
},
"node_modules/@cloudflare/workers-types": {
"version": "5.20260917.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-5.20260917.1.tgz",
"integrity": "sha512-fXMYFJw6HmcDiVZ8umPsUB7fR6HjFDms2Xr9iSovYgs1J7ytIfW3s7Rc9RptBH1JZfvdoJMx3Uo729pm/DJuoA==",
"license": "MIT OR Apache-2.0"
}
}
}
{
"name": "sample-cloudflare-workers-types",
"version": "1.0.0",
"type": "module",
"private": true,
"license": "MIT-0",
"dependencies": {
"@cloudflare/workers-types": "5.20260917.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40cloudflare/workers-types@5.20260917.1",
"kind": "HOW",
"packages": [
"pkg:npm/%40cloudflare/workers-types@5.20260917.1"
]
}
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
// 1. @cloudflare/workers-types package.json declares name @cloudflare/workers-types and version 5.20260917.1
const pkgJson = require('@cloudflare/workers-types/package.json');
assert.equal(pkgJson.name, '@cloudflare/workers-types');
assert.equal(pkgJson.version, '5.20260917.1');
// 2. @cloudflare/workers-types index.d.ts declares ExecutionContext interface with waitUntil and passThroughOnException methods
const indexDtsPath = require.resolve('@cloudflare/workers-types/index.d.ts');
assert.ok(fs.existsSync(indexDtsPath));
const indexDtsContent = fs.readFileSync(indexDtsPath, 'utf8');
assert.ok(indexDtsContent.includes('interface ExecutionContext<Props = unknown> {'));
assert.ok(indexDtsContent.includes('waitUntil(promise: Promise<any>): void;'));
assert.ok(indexDtsContent.includes('passThroughOnException(): void;'));
// 3. @cloudflare/workers-types index.d.ts declares KVNamespace interface with get, put, delete, and list methods
assert.ok(indexDtsContent.includes('interface KVNamespace<Key extends string = string> {'));
assert.ok(indexDtsContent.includes('get(key: Key, type: "text"): Promise<string | null>;'));
assert.ok(indexDtsContent.includes('delete(key: Key): Promise<void>;'));
assert.ok(indexDtsContent.includes('list<Metadata = unknown>('));
// 4. @cloudflare/workers-types index.d.ts declares R2Bucket interface with head, get, put, and delete methods
assert.ok(indexDtsContent.includes('interface R2Bucket {'));
assert.ok(indexDtsContent.includes('head(key: string): Promise<R2Object | null>;'));
assert.ok(indexDtsContent.includes('delete(keys: string | string[]): Promise<void>;'));
// 5. @cloudflare/workers-types index.d.ts declares D1Database class with prepare, batch, and exec methods
assert.ok(indexDtsContent.includes('declare abstract class D1Database {'));
assert.ok(indexDtsContent.includes('prepare(query: string): D1PreparedStatement;'));
assert.ok(indexDtsContent.includes('batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;'));
assert.ok(indexDtsContent.includes('exec(query: string): Promise<D1ExecResult>;'));
// 6. @cloudflare/workers-types experimental/index.d.ts provides typing environment for experimental Cloudflare Workers features
const expDtsPath = require.resolve('@cloudflare/workers-types/experimental/index.d.ts');
assert.ok(fs.existsSync(expDtsPath));
const expDtsContent = fs.readFileSync(expDtsPath, 'utf8');
assert.ok(expDtsContent.includes('declare class DOMException extends Error {'));
assert.ok(expDtsContent.includes('interface ExecutionContext<Props = unknown> {'));
console.log('All contract tests passed.');
オリジンシーダー
匿名