{"_id":"@caputchin/replay-wasm","_rev":"2-a72cb40d70ce35f4a2443169c11bba4e","name":"@caputchin/replay-wasm","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@caputchin/replay-wasm","version":"0.2.0","keywords":["caputchin","replay","wasm","deterministic","captcha"],"license":"Apache-2.0","_id":"@caputchin/replay-wasm@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":"24bbb8a8df201255cb63470d7571adf2d822d301","tarball":"https://registry.npmjs.org/@caputchin/replay-wasm/-/replay-wasm-0.2.0.tgz","fileCount":6,"integrity":"sha512-SGY4XGKwQEjua3+/k886KXC7Gu7m6DlUXQ8CxWAjw7uPGH19GbtGMoq9Gc2jhBn9PXF/Q08qej1oY4RCg3WAgQ==","signatures":[{"sig":"MEYCIQC6e1XJPUmwMXs99+7UBUESLGDnhfsrOaS6pAk0xUpzRwIhAMklaOZnDsqx6r4qc7QCYeDsbuupPFIQFnTIHnB7P4me","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21748},"type":"module","_from":"file:caputchin-replay-wasm-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/e82b1d4c07be075d3dd9a9de9e11e6ce/caputchin-replay-wasm-0.2.0.tgz","_integrity":"sha512-SGY4XGKwQEjua3+/k886KXC7Gu7m6DlUXQ8CxWAjw7uPGH19GbtGMoq9Gc2jhBn9PXF/Q08qej1oY4RCg3WAgQ==","repository":{"url":"git+https://github.com/Caputchin/caputchin-sdk.git","type":"git"},"_npmVersion":"10.9.8","description":"Generic host glue for a Caputchin headless WASM replay artifact: precompiled-module instantiation, linear-memory marshalling over the cap_alloc/cap_run C-ABI, and gzip+base64 inline decode.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"fflate":"^0.8.2","@caputchin/replay-contract":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^2.0.0","typedoc":"^0.28.19","typescript":"^5.4.0","@types/node":"^22.0.0","@vitest/coverage-v8":"^2.0.0","typedoc-plugin-markdown":"^4.11.0"},"_npmOperationalInternal":{"tmp":"tmp/replay-wasm_0.2.0_1780403481734_0.25521840037493226","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@caputchin/replay-wasm","version":"0.3.0","description":"Generic host glue for a Caputchin headless WASM replay artifact: precompiled-module instantiation, linear-memory marshalling over the cap_alloc/cap_run C-ABI, and gzip+base64 inline decode.","keywords":["caputchin","replay","wasm","deterministic","captcha"],"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,"dependencies":{"fflate":"^0.8.2","@caputchin/replay-contract":"0.3.0"},"devDependencies":{"@types/node":"^22.0.0","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","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","coverage":"vitest run --coverage","docs":"typedoc && node ../../scripts/normalize-docs.mjs docs"},"_id":"@caputchin/replay-wasm@0.3.0","_integrity":"sha512-7PLsS8r+cEyzJtAgOfZO0QSUOhNbIYnKDcNg7I8i9XRoVrrQidepl7Ki70trRBvKdvK1QEq9imML3HrNApNWmw==","_resolved":"/tmp/8e02481489a49b327c6ef1cbc848a76a/caputchin-replay-wasm-0.3.0.tgz","_from":"file:caputchin-replay-wasm-0.3.0.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-7PLsS8r+cEyzJtAgOfZO0QSUOhNbIYnKDcNg7I8i9XRoVrrQidepl7Ki70trRBvKdvK1QEq9imML3HrNApNWmw==","shasum":"71515817d557a81e14e433381584acd6b21b5c28","tarball":"https://registry.npmjs.org/@caputchin/replay-wasm/-/replay-wasm-0.3.0.tgz","fileCount":7,"unpackedSize":31705,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGXNs7EPifzonF7eaL7CY0Jx/TjduxN7sHN2PPAZzuJLAiEA55pNL4OxNrF5PFZ2Aqu9HbMzbNN2sDPaC6cKPvJO4oE="}]},"_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-wasm_0.3.0_1780593983859_0.4757239175549497"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T12:31:21.526Z","modified":"2026-06-04T17:26:24.153Z","0.2.0":"2026-06-02T12:31:21.869Z","0.3.0":"2026-06-04T17:26:23.999Z"},"bugs":{"url":"https://github.com/Caputchin/caputchin-sdk/issues"},"license":"Apache-2.0","homepage":"https://github.com/Caputchin/caputchin-sdk#readme","keywords":["caputchin","replay","wasm","deterministic","captcha"],"repository":{"type":"git","url":"git+https://github.com/Caputchin/caputchin-sdk.git"},"description":"Generic host glue for a Caputchin headless WASM replay artifact: precompiled-module instantiation, linear-memory marshalling over the cap_alloc/cap_run C-ABI, and gzip+base64 inline decode.","maintainers":[{"name":"caputchiner","email":"info@caputchin.com"}],"readme":"# @caputchin/replay-wasm\n\nGeneric **host glue** for a Caputchin headless WASM replay artifact. A game whose\nsim compiles to WASM (the strongest determinism path - the same `.wasm` runs in\nthe browser and on the server) uses this kit to turn the module into the one\nconforming `run(seed, config, trace)` the platform replays.\n\nIt pairs with the [`caputchin-replay-rs`](../replay-rs) authoring crate (which\nemits the `cap_alloc` / `cap_run` C-ABI this kit marshals into) and the\n[`@caputchin/replay-contract`](../../packages/replay-contract) types.\n\n## What it provides\n\n- **`runWithModule(module, seed, configInts, trace)`** - instantiate a\n  precompiled `WebAssembly.Module`, marshal the seed / config / trace across the\n  `cap_alloc` / `cap_run` linear-memory C-ABI, and read back the `Verdict`. A\n  game's `run` is typically one line over this.\n- **`inflateWasm(...)`** - decode a gzip + base64 INLINE wasm payload. A\n  replayable artifact often inlines its `.wasm` (the replay isolate forbids\n  runtime byte-compilation and network fetch), and this inflates it for\n  instantiation.\n- **`toBytes(...)`** - the byte-marshalling helper the above share.\n- Re-exports the contract types (`Seed`, `Verdict`, `RunFn`) for one import site.\n\n## Usage\n\n```ts\nimport { runWithModule } from '@caputchin/replay-wasm';\nimport type { RunFn } from '@caputchin/replay-contract';\nimport wasmModule from './sim.wasm'; // precompiled module (loader/build provides it)\n\nexport const run: RunFn = (seed, config, trace) =>\n  runWithModule(wasmModule, seed, configToInts(config), trace);\n```\n\nThe WASM module must export the `cap_alloc` / `cap_run` C-ABI (the\n`caputchin-replay-rs` crate generates it from a deterministic Rust sim).\n","readmeFilename":"README.md"}