{"_id":"@caputchin/replay-contract","_rev":"3-8e121392f7195703705e543e999af863","name":"@caputchin/replay-contract","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@caputchin/replay-contract","version":"0.1.0","keywords":["caputchin","replay","deterministic","captcha","contract"],"license":"Apache-2.0","_id":"@caputchin/replay-contract@0.1.0","maintainers":[{"name":"caputchiner","email":"info@caputchin.com"}],"homepage":"https://github.com/Caputchin/caputchin-sdk#readme","bugs":{"url":"https://github.com/Caputchin/caputchin-sdk/issues"},"dist":{"shasum":"09fa147eddbb40dad2f18207f2930fdc9f207e1e","tarball":"https://registry.npmjs.org/@caputchin/replay-contract/-/replay-contract-0.1.0.tgz","fileCount":6,"integrity":"sha512-6f5dW3DgenZ0AZq+wlRzU5KZ/c2/HGO1N9zazEnGUnX8tDq9CRsV0Am6B7dm9GU6TLI16r9uz+1PTGH3gziXQQ==","signatures":[{"sig":"MEUCID3unmj/spQnadLy61LODkexZpc5fY5b1WertRupeY7bAiEA1PSfx+PRloc1B4Fo31+4/S9wZZk5L3AFWOS1UfAQAJ4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25907},"type":"module","_from":"file:caputchin-replay-contract-0.1.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"test":"vitest run","build":"tsup","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"caputchiner","email":"info@caputchin.com"},"_resolved":"/tmp/27a428d304a3658adcc8769fc4356e3c/caputchin-replay-contract-0.1.0.tgz","_integrity":"sha512-6f5dW3DgenZ0AZq+wlRzU5KZ/c2/HGO1N9zazEnGUnX8tDq9CRsV0Am6B7dm9GU6TLI16r9uz+1PTGH3gziXQQ==","repository":{"url":"git+https://github.com/Caputchin/caputchin-sdk.git","type":"git"},"_npmVersion":"10.9.7","description":"The mandatory run/seed/verdict contract for Caputchin server-validated game replay","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^2.0.0","typescript":"^5.4.0","@vitest/coverage-v8":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/replay-contract_0.1.0_1779794385930_0.11399842544138994","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@caputchin/replay-contract","version":"0.2.0","keywords":["caputchin","replay","deterministic","captcha","contract"],"license":"Apache-2.0","_id":"@caputchin/replay-contract@0.2.0","maintainers":[{"name":"caputchiner","email":"info@caputchin.com"}],"homepage":"https://github.com/Caputchin/caputchin-sdk#readme","bugs":{"url":"https://github.com/Caputchin/caputchin-sdk/issues"},"dist":{"shasum":"0da46a5d8dd0ae26701a9b8d5a38c9add5635571","tarball":"https://registry.npmjs.org/@caputchin/replay-contract/-/replay-contract-0.2.0.tgz","fileCount":6,"integrity":"sha512-/bQhRmEwxeb6nyqC0ZGBVjEhLjRJWOUIvR2yC0rCRJj+aY+kfLQmSe8pI3f4Unmb4pv2Y8HK+mwuDOoCbN5//Q==","signatures":[{"sig":"MEUCIQCb9oGwMJZb/IpIbhsu7Cbo97nLIjnxXMjdCxa9zLno3gIgIQmhldEzaIwbFqeXMGB6j8NHsKO4BcL4LmQ+DqNXwVE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31143},"type":"module","_from":"file:caputchin-replay-contract-0.2.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"docs":"typedoc && node ../../scripts/normalize-docs.mjs docs","test":"vitest run","build":"tsup","coverage":"vitest run --coverage","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"caputchiner","email":"info@caputchin.com"},"_resolved":"/tmp/9b56d0a7ced871b8874884ccb900c20c/caputchin-replay-contract-0.2.0.tgz","_integrity":"sha512-/bQhRmEwxeb6nyqC0ZGBVjEhLjRJWOUIvR2yC0rCRJj+aY+kfLQmSe8pI3f4Unmb4pv2Y8HK+mwuDOoCbN5//Q==","repository":{"url":"git+https://github.com/Caputchin/caputchin-sdk.git","type":"git"},"_npmVersion":"10.9.8","description":"The mandatory run/seed/verdict contract for Caputchin server-validated game replay","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^2.0.0","typedoc":"^0.28.19","typescript":"^5.4.0","@vitest/coverage-v8":"^2.0.0","typedoc-plugin-markdown":"^4.11.0"},"_npmOperationalInternal":{"tmp":"tmp/replay-contract_0.2.0_1780317815986_0.6265198401909686","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@caputchin/replay-contract","version":"0.3.0","description":"The mandatory run/seed/verdict contract for Caputchin server-validated game replay","keywords":["caputchin","replay","deterministic","captcha","contract"],"homepage":"https://github.com/Caputchin/caputchin-sdk#readme","repository":{"type":"git","url":"git+https://github.com/Caputchin/caputchin-sdk.git"},"bugs":{"url":"https://github.com/Caputchin/caputchin-sdk/issues"},"license":"Apache-2.0","type":"module","publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"devDependencies":{"typescript":"^5.4.0","tsup":"^8.0.0","typedoc":"^0.28.19","typedoc-plugin-markdown":"^4.11.0","vitest":"^2.0.0","@vitest/coverage-v8":"^2.0.0"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","coverage":"vitest run --coverage","docs":"typedoc && node ../../scripts/normalize-docs.mjs docs"},"_id":"@caputchin/replay-contract@0.3.0","_integrity":"sha512-Oy1fMGW0ktIm5+HkUebONlI+rOIXfe7KtWfHp8BgQ5FmmvLFjKBJenms/Y2qVNMaYMg2WZYRBkxPxVqBX4W3Pg==","_resolved":"/tmp/bfdfe2e19518039e48360440877e94d7/caputchin-replay-contract-0.3.0.tgz","_from":"file:caputchin-replay-contract-0.3.0.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-Oy1fMGW0ktIm5+HkUebONlI+rOIXfe7KtWfHp8BgQ5FmmvLFjKBJenms/Y2qVNMaYMg2WZYRBkxPxVqBX4W3Pg==","shasum":"07a1422df0a9d37cd7a1cd794074bbc736073817","tarball":"https://registry.npmjs.org/@caputchin/replay-contract/-/replay-contract-0.3.0.tgz","fileCount":7,"unpackedSize":34764,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAu9bR7nzu/OgYE/A4uSpdPP7rQPFViBNRdVLdsETGaEAiEAir+HOcpehEo40YgpovBliaTjbM1x2Hx9dnuo8TXM9SE="}]},"_npmUser":{"name":"caputchiner","email":"info@caputchin.com"},"directories":{},"maintainers":[{"name":"caputchiner","email":"info@caputchin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/replay-contract_0.3.0_1780536350111_0.8939930300480818"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-26T11:19:45.754Z","modified":"2026-06-04T01:25:50.385Z","0.1.0":"2026-05-26T11:19:46.081Z","0.2.0":"2026-06-01T12:43:36.135Z","0.3.0":"2026-06-04T01:25:50.242Z"},"bugs":{"url":"https://github.com/Caputchin/caputchin-sdk/issues"},"license":"Apache-2.0","homepage":"https://github.com/Caputchin/caputchin-sdk#readme","keywords":["caputchin","replay","deterministic","captcha","contract"],"repository":{"type":"git","url":"git+https://github.com/Caputchin/caputchin-sdk.git"},"description":"The mandatory run/seed/verdict contract for Caputchin server-validated game replay","maintainers":[{"name":"caputchiner","email":"info@caputchin.com"}],"readme":"# @caputchin/replay-contract\n\nThe **one mandatory surface** for Caputchin server-validated game replay: the\n`run` function shape, the `Verdict` it returns, and the per-round `Seed` plus its\nderivation. The platform, the widget, the engine kits, and the replay Worker all\nagree on exactly this. Deliberately **tiny and dependency-free** - it is loaded\ninto a sealed replay isolate, so it pulls in nothing.\n\nA replayable game ships a JS or WASM module exporting one function under the name\n`RUN_EXPORT_NAME`:\n\n```ts\nimport type { RunFn } from '@caputchin/replay-contract';\n\nexport const run: RunFn = (seed, config, trace) => {\n  // re-run the recorded play deterministically...\n  return { passed: true, score: 1234, durationMs: 8000 };\n};\n```\n\n- `seed` - the server-derived per-round `Seed` (a 4-tuple of u32). Never\n  client-supplied.\n- `config` - the server-resolved gameplay config, or `null` for the run's own\n  defaults. Opaque; gate-affecting fields belong here, never in the trace.\n- `trace` - the opaque blob the client emitted and this function alone\n  interprets (raw bytes or a string).\n- returns a `Verdict` (`{ passed, score, durationMs }`), sync or async.\n\nThe function MUST be pure and deterministic ACROSS the player runtime and the\nserver isolate: identical `(seed, config, trace)` yields an identical verdict in\nboth. How (fixed-point, WASM-spec floats, or IEEE-754 plus a deterministic Math\nshim) is the author's choice.\n\n## Exports\n\n- **Types**: `RunFn`, `Verdict`, `Seed`, `ReplayConfig`.\n- **Seed**: `deriveSeed`, `SEED_WORDS`, `SEED_BYTES`.\n- **Verdict**: `parseVerdict` (validate an untrusted return value).\n- **Invocation constants**: `RUN_EXPORT_NAME` (the export the artifact provides),\n  `RUN_RPC_METHOD` (the host entrypoint method for a replay), `RUN_SELFCHECK_RPC`\n  (the host entrypoint method for a determinism self-check).\n\n## Building on it\n\nYou can write a conforming `run` by hand against this package alone. For\non-ramps, see [`@caputchin/engine-kit`](../../kits/engine-kit) (the reducer\nlane), [`@caputchin/replay-wasm`](../../kits/replay-wasm) (the WASM lane), and the\nper-engine presets.\n","readmeFilename":"README.md"}