샘플
@types/stack-utils 2.0.3: clean stack trace and parse line with StackUtils
검증된 샘플 — npm @types/stack-utils 2.0.3: clean stack trace and parse line with StackUtils. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다.
sha256:296cb5a337d2e20ee0879f3a52d1996dcdaccdda2f7b1e2b9f5aadb1e9f1c917
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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- 목표
- clean stack trace and parse line with StackUtils
- 심벌
-
- StackUtils
- 생성일
- 2026-08-27T15:29:35Z
컨트랙트
- package manifest specifies index.d.ts type declarations and TypeScript version
- declares StackUtils class with constructor, static nodeInternals, and methods clean, capture, captureString, at, parseLine
- declares Options interface with internals, ignoredPackages, cwd, and wrapCallSite
- declares CallSite and CallSiteLike interfaces with location and inspection methods
- declares StackLineData and StackData interfaces with line, column, file, and eval details
파일
- 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: clean stack trace and parse line with StackUtils
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/stack-utils@2.0.3
Demonstrate these symbols/APIs:
- StackUtils
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:15dba7b3b974ba667f57b387ed75c37fa6cd86111421202ded076a046ae19037","contract":["package manifest specifies index.d.ts type declarations and TypeScript version","declares StackUtils class with constructor, static nodeInternals, and methods clean, capture, captureString, at, parseLine","declares Options interface with internals, ignoredPackages, cwd, and wrapCallSite","declares CallSite and CallSiteLike interfaces with location and inspection methods","declares StackLineData and StackData interfaces with line, column, file, and eval details"],"goal":"clean stack trace and parse line with StackUtils","kind":"HOW","packages":["pkg:npm/%40types/stack-utils@2.0.3"],"schemaVersion":1,"symbols":["StackUtils"]},"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/%40types/stack-utils@2.0.3"],"schemaVersion":1,"subject":"pkg:npm/%40types/stack-utils@2.0.3","symbols":["StackUtils"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-stack-utils",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-stack-utils",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/stack-utils": "2.0.3"
}
},
"node_modules/@types/stack-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz",
"integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==",
"license": "MIT"
}
}
}
{
"name": "sample-types-stack-utils",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/stack-utils": "2.0.3"
}
}
{
"schemaVersion": 1,
"goal": "clean stack trace and parse line with StackUtils",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/stack-utils@2.0.3"
],
"symbols": [
"StackUtils"
]
}
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import fs from 'node:fs';
import path from 'node:path';
const require = createRequire(import.meta.url);
// 1. Resolve @types/stack-utils package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/stack-utils/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/stack-utils', 'Package name must be @types/stack-utils');
assert.equal(pkg.version, '2.0.3', 'Package version must be 2.0.3');
assert.equal(pkg.types, 'index.d.ts', 'Package types entry must point to index.d.ts');
assert.equal(pkg.typeScriptVersion, '4.5', 'TypeScript version must be 4.5');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify StackUtils class declaration and methods
assert.ok(
dtsContent.includes('export = StackUtils;'),
'Must export StackUtils as CommonJS default export'
);
assert.ok(
dtsContent.includes('declare class StackUtils {'),
'Must declare StackUtils class'
);
assert.ok(
dtsContent.includes('static nodeInternals(): RegExp[];'),
'Must declare static nodeInternals method returning RegExp array'
);
assert.ok(
dtsContent.includes('constructor(options?: StackUtils.Options);'),
'Must declare constructor accepting optional StackUtils.Options'
);
assert.ok(
dtsContent.includes('clean(stack: string | string[]): string;'),
'Must declare clean method accepting string or string array'
);
assert.ok(
dtsContent.includes('capture(limit?: number, startStackFunction?: Function): StackUtils.CallSite[];') &&
dtsContent.includes('capture(startStackFunction: Function): StackUtils.CallSite[];'),
'Must declare capture overloads returning CallSite array'
);
assert.ok(
dtsContent.includes('captureString(limit?: number, startStackFunction?: Function): string;') &&
dtsContent.includes('captureString(startStackFunction: Function): string;'),
'Must declare captureString overloads returning string'
);
assert.ok(
dtsContent.includes('at(startStackFunction?: Function): StackUtils.CallSiteLike;'),
'Must declare at method returning CallSiteLike'
);
assert.ok(
dtsContent.includes('parseLine(line: string): StackUtils.StackLineData | null;'),
'Must declare parseLine method returning StackLineData or null'
);
// 3. Verify Options interface
assert.ok(
dtsContent.includes('interface Options {') &&
dtsContent.includes('internals?: RegExp[] | undefined;') &&
dtsContent.includes('ignoredPackages?: string[] | undefined;') &&
dtsContent.includes('cwd?: string | undefined;') &&
dtsContent.includes('wrapCallSite?(callSite: CallSite): CallSite;'),
'Options interface must define internals, ignoredPackages, cwd, and wrapCallSite'
);
// 4. Verify CallSite and CallSiteLike interfaces
assert.ok(
dtsContent.includes('interface CallSite {') &&
dtsContent.includes('getThis(): object | undefined;') &&
dtsContent.includes('getTypeName(): string;') &&
dtsContent.includes('getFunction(): Function | undefined;') &&
dtsContent.includes('getFunctionName(): string;') &&
dtsContent.includes('getMethodName(): string | null;') &&
dtsContent.includes('getFileName(): string | undefined;') &&
dtsContent.includes('getLineNumber(): number;') &&
dtsContent.includes('getColumnNumber(): number;') &&
dtsContent.includes('getEvalOrigin(): CallSite | string;') &&
dtsContent.includes('isToplevel(): boolean;') &&
dtsContent.includes('isEval(): boolean;') &&
dtsContent.includes('isNative(): boolean;') &&
dtsContent.includes('isConstructor(): boolean;'),
'CallSite interface must define V8 CallSite accessor methods'
);
assert.ok(
dtsContent.includes('interface CallSiteLike extends StackData {') &&
dtsContent.includes('type?: string | undefined;'),
'CallSiteLike interface must extend StackData and include optional type property'
);
// 5. Verify StackLineData and StackData interfaces
assert.ok(
dtsContent.includes('interface StackLineData extends StackData {') &&
dtsContent.includes('evalLine?: number | undefined;') &&
dtsContent.includes('evalColumn?: number | undefined;') &&
dtsContent.includes('evalFile?: string | undefined;'),
'StackLineData interface must extend StackData and include evalLine, evalColumn, evalFile'
);
assert.ok(
dtsContent.includes('interface StackData {') &&
dtsContent.includes('line?: number | undefined;') &&
dtsContent.includes('column?: number | undefined;') &&
dtsContent.includes('file?: string | undefined;') &&
dtsContent.includes('constructor?: boolean | undefined;') &&
dtsContent.includes('evalOrigin?: string | undefined;') &&
dtsContent.includes('native?: boolean | undefined;') &&
dtsContent.includes('function?: string | undefined;') &&
dtsContent.includes('method?: string | undefined;'),
'StackData interface must define line, column, file, constructor, evalOrigin, native, function, method'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명