{"_id":"@acausal/markov","name":"@acausal/markov","dist-tags":{"alpha":"3.0.0-alpha.3","latest":"3.0.0-alpha.3"},"versions":{"3.0.0-alpha.3":{"name":"@acausal/markov","version":"3.0.0-alpha.3","description":"Markov chain text and sequence generation with blending, constraints, batch training, and multi-dimensional state spaces","author":{"name":"David Robinson"},"license":"Apache-2.0","homepage":"https://github.com/abrisene/acausal/tree/main/packages/markov","repository":{"type":"git","url":"git+https://github.com/abrisene/acausal.git","directory":"packages/markov"},"bugs":{"url":"https://github.com/abrisene/acausal/issues"},"keywords":["markov","markov-chain","text-generation","name-generator","procedural-generation","sequence","stochastic"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"dependencies":{"@acausal/random":"3.0.0-alpha.3","@acausal/distributions":"3.0.0-alpha.3","@acausal/scalr":"3.0.0-alpha.3"},"devDependencies":{"tsup":"^8.2.4","typescript":"^5.6.3"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run"},"_id":"@acausal/markov@3.0.0-alpha.3","_integrity":"sha512-clj8eXNW05PKcZ7ovU7cEyf1144rZgb2iHVpZL0x5xi4R2LKJeHS5cIHs+Ffkrq2Es0zZc8meU8G8VcKv0HD+g==","_resolved":"/tmp/acausal-alpha3-pnpm-test/acausal-markov-3.0.0-alpha.3.tgz","_from":"file:/tmp/acausal-alpha3-pnpm-test/acausal-markov-3.0.0-alpha.3.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-clj8eXNW05PKcZ7ovU7cEyf1144rZgb2iHVpZL0x5xi4R2LKJeHS5cIHs+Ffkrq2Es0zZc8meU8G8VcKv0HD+g==","shasum":"a5f0869b4fab01e33d3ccfd09fe425122624d70c","tarball":"https://registry.npmjs.org/@acausal/markov/-/markov-3.0.0-alpha.3.tgz","fileCount":9,"unpackedSize":320758,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLy/RrYOWPFSxsfEHbq2yus4mrx0qllO18NEGqX8xR8gIgDpq2wLZy1ZoyXHUwry0FT5tZHI1NQoIXBWIDgVGJqx8="}]},"_npmUser":{"name":"monetise","email":"dr@monetise.io"},"directories":{},"maintainers":[{"name":"monetise","email":"dr@monetise.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markov_3.0.0-alpha.3_1784578687477_0.4655009059492794"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T20:18:07.317Z","3.0.0-alpha.3":"2026-07-20T20:18:07.632Z","modified":"2026-07-20T20:18:07.862Z"},"maintainers":[{"name":"monetise","email":"dr@monetise.io"}],"description":"Markov chain text and sequence generation with blending, constraints, batch training, and multi-dimensional state spaces","homepage":"https://github.com/abrisene/acausal/tree/main/packages/markov","keywords":["markov","markov-chain","text-generation","name-generator","procedural-generation","sequence","stochastic"],"repository":{"type":"git","url":"git+https://github.com/abrisene/acausal.git","directory":"packages/markov"},"author":{"name":"David Robinson"},"bugs":{"url":"https://github.com/abrisene/acausal/issues"},"license":"Apache-2.0","readme":"# @acausal/markov\n\nMarkov chain text and sequence generation with blending, constraints, batch training, and multi-dimensional state spaces.\n\n## Install\n\n```bash\nnpm install @acausal/markov\n```\n\n## Usage\n\n```typescript\nimport { MarkovChain, ImmutableMarkovChain } from '@acausal/markov';\n\n// Train on sequences\nconst chain = new MarkovChain({ seed: 42, maxOrder: 3 });\nchain.addSequences([\n  ['the', 'cat', 'sat'],\n  ['the', 'dog', 'ran'],\n  ['the', 'cat', 'ran'],\n]);\n\n// Generate\nchain.generate();  // ['the', 'cat', 'sat'] or similar\n\n// Generate with constraints\nchain.generate({ max: 5, start: ['the'] });\n\n// Immutable variant\nconst frozen = ImmutableMarkovChain.from(chain);\nconst updated = frozen.addSequence(['the', 'bird', 'flew']); // returns new instance\n\n// Blend two chains\nconst blended = MarkovChain.blendDTOs([\n  { model: chain1.serialize(), weight: 0.7 },\n  { model: chain2.serialize(), weight: 0.3 },\n]);\n```\n\nSupports batch training, forward/backward generation, sequence analysis, multi-dimensional state spaces, and 5 blend strategies (arithmetic, geometric, harmonic, max, min).\n\nPart of the [acausal](https://github.com/abrisene/acausal) procedural generation toolkit.\n","readmeFilename":"README.md","_rev":"1-218642aabf460efbb2167cc81d060e62"}