Пример
undici-types 8.3.0: types
Проверенный пример — npm undici-types 8.3.0: types. Контракт выполнен на node 22 · linux alpine/x64 · docker и пройден: undici-types package.json declares…
sha256:e291880c9c94e553433ec5cff5d41456712b74bb0d7c45272d1e680d9219c977
Эта сеть предлагает одно: образец, который собирается. Она запустила его в песочнице и сохранила подписанную квитанцию. Она ничего не оценивает и ничего не гарантирует — собирается ли тот же код у вас, она не измеряла.
Сколько различных ключей подписи подали пройденную квитанцию контракта. Один — только автор; больше одного — значит, кто-то ещё тоже собрал. Ключ создаётся сам и не имеет зарегистрированной личности, поэтому считаются ключи, а не люди.
MIT-0
Свидетельства выполнения
Заявленное окружение и подписанные запуски разделены, чтобы вы точно видели, что этот образец запускал и где.
- Основа свидетельства
- Подписанный контракт пройден
- Квитанции проверки
- 1
- Ключи подписи, собравшие его
- 1
Заявленная среда
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Среды запусков проверки
| Окружение | Контракт | Этапы | Запуск |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-27 |
Кейс
HOW- Цель
- verify undici-types.types in pkg:npm/undici-types@8.3.0
- Пакеты
- Символы
-
- undici-types.types
- Окружение
- node 22.23.2
- Создан
- 2026-08-27T11:28:22Z
Контракт
- undici-types package.json declares type definitions entry point index.d.ts and version 8.3.0
- undici-types index.d.ts exports core HTTP client types and classes including Dispatcher, Client, Pool, and Agent
- undici-types index.d.ts re-exports Web standard type definitions for fetch, Headers, Request, Response, and FormData
- undici-types index.d.ts exports global dispatcher and origin configuration functions and interceptors
- undici-types index.d.ts exports default Undici namespace containing typed client and utility constructors
- undici-types dispatcher.d.ts declares Dispatcher class with dispatch, request, stream, pipeline, and lifecycle methods
Файлы
- 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 undici-types.types in pkg:npm/undici-types@8.3.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/undici-types@8.3.0
Demonstrate these symbols/APIs:
- undici-types.types
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:784d3a07ae2339e00e3b7e751785ade4aaca70a54ca104674f284d298057c539","contract":["undici-types package.json declares type definitions entry point index.d.ts and version 8.3.0","undici-types index.d.ts exports core HTTP client types and classes including Dispatcher, Client, Pool, and Agent","undici-types index.d.ts re-exports Web standard type definitions for fetch, Headers, Request, Response, and FormData","undici-types index.d.ts exports global dispatcher and origin configuration functions and interceptors","undici-types index.d.ts exports default Undici namespace containing typed client and utility constructors","undici-types dispatcher.d.ts declares Dispatcher class with dispatch, request, stream, pipeline, and lifecycle methods"],"goal":"verify undici-types.types in pkg:npm/undici-types@8.3.0","kind":"HOW","packages":["pkg:npm/undici-types@8.3.0"],"schemaVersion":1,"symbols":["undici-types.types"]},"contractCommand":["node","test/contract.mjs"],"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/undici-types@8.3.0"],"schemaVersion":1,"subject":"pkg:npm/undici-types@8.3.0","symbols":["undici-types.types"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-undici-types",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-undici-types",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"undici-types": "8.3.0"
}
},
"node_modules/undici-types": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
"license": "MIT"
}
}
}
{
"name": "sample-undici-types",
"version": "1.0.0",
"type": "module",
"private": true,
"license": "MIT-0",
"dependencies": {
"undici-types": "8.3.0"
}
}
{
"schemaVersion": 1,
"goal": "verify undici-types.types in pkg:npm/undici-types@8.3.0",
"kind": "HOW",
"packages": [
"pkg:npm/undici-types@8.3.0"
],
"symbols": [
"undici-types.types"
]
}
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
// 1. undici-types package.json declares type definitions entry point index.d.ts and version 8.3.0
const pkgJsonPath = require.resolve('undici-types/package.json');
assert.ok(fs.existsSync(pkgJsonPath));
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
assert.equal(pkgJson.name, 'undici-types');
assert.equal(pkgJson.version, '8.3.0');
assert.equal(pkgJson.types, 'index.d.ts');
const pkgDir = path.dirname(pkgJsonPath);
// 2. undici-types index.d.ts exports core HTTP client types and classes including Dispatcher, Client, Pool, and Agent
const indexDtsPath = path.join(pkgDir, 'index.d.ts');
assert.ok(fs.existsSync(indexDtsPath));
const indexDts = fs.readFileSync(indexDtsPath, 'utf8');
assert.ok(indexDts.includes("import Dispatcher from './dispatcher'"));
assert.ok(indexDts.includes("import Pool from './pool'"));
assert.ok(indexDts.includes("import Client from './client'"));
assert.ok(indexDts.includes("import Agent from './agent'"));
assert.ok(indexDts.includes("export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, Dispatcher1Wrapper, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, Socks5ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }"));
// 3. undici-types index.d.ts re-exports Web standard type definitions for fetch, Headers, Request, Response, and FormData
assert.ok(indexDts.includes("export * from './fetch'"));
assert.ok(indexDts.includes("export * from './formdata'"));
assert.ok(indexDts.includes("export * from './websocket'"));
assert.ok(indexDts.includes("export * from './eventsource'"));
assert.ok(indexDts.includes("export * from './cookies'"));
const fetchDtsPath = path.join(pkgDir, 'fetch.d.ts');
assert.ok(fs.existsSync(fetchDtsPath));
const fetchDts = fs.readFileSync(fetchDtsPath, 'utf8');
assert.ok(fetchDts.includes('export declare function fetch ('));
assert.ok(fetchDts.includes('export class BodyMixin {'));
// 4. undici-types index.d.ts exports global dispatcher and origin configuration functions and interceptors
assert.ok(indexDts.includes("import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'"));
assert.ok(indexDts.includes("import { setGlobalOrigin, getGlobalOrigin } from './global-origin'"));
assert.ok(indexDts.includes("import interceptors from './interceptors'"));
// 5. undici-types index.d.ts exports default Undici namespace containing typed client and utility constructors
assert.ok(indexDts.includes('export default Undici'));
assert.ok(indexDts.includes('declare namespace Undici {'));
assert.ok(indexDts.includes("const Dispatcher: typeof import('./dispatcher').default"));
assert.ok(indexDts.includes("const Pool: typeof import('./pool').default"));
assert.ok(indexDts.includes("const Client: typeof import('./client').default"));
assert.ok(indexDts.includes("const fetch: typeof import('./fetch').fetch"));
// 6. undici-types dispatcher.d.ts declares Dispatcher class with dispatch, request, stream, pipeline, and lifecycle methods
const dispatcherDtsPath = path.join(pkgDir, 'dispatcher.d.ts');
assert.ok(fs.existsSync(dispatcherDtsPath));
const dispatcherDts = fs.readFileSync(dispatcherDtsPath, 'utf8');
assert.ok(dispatcherDts.includes('declare class Dispatcher extends EventEmitter {'));
assert.ok(dispatcherDts.includes('dispatch (options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean'));
assert.ok(dispatcherDts.includes('request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void'));
assert.ok(dispatcherDts.includes('stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void'));
assert.ok(dispatcherDts.includes('pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex'));
assert.ok(dispatcherDts.includes('close (callback: () => void): void'));
assert.ok(dispatcherDts.includes('destroy (err: Error | null, callback: () => void): void'));
console.log('All contract tests passed.');
Исходный сидер
аноним