{"_id":"@cognitive-swarm/signals","name":"@cognitive-swarm/signals","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/signals","version":"0.2.0","description":"Signal bus — the nervous system of the cognitive swarm","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","lint":"eslint src/","clean":"rm -rf dist"},"dependencies":{"@cognitive-swarm/core":"*","@cognitive-engine/core":"^0.2.0"},"license":"Apache-2.0","author":{"name":"Dmitry Zorin"},"repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/signals"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/signals@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-94jV91FXytjx/eSgnoEbcvcMUqLkWVju+LFtsJ8Do0D0r34Dav0imOguY2Xr+Ed6q8nlWB1gtP0kYo2gqtBucQ==","shasum":"b8da42a4f5b0ab8c299f8c216d47d43329d3e80f","tarball":"https://registry.npmjs.org/@cognitive-swarm/signals/-/signals-0.2.0.tgz","fileCount":14,"unpackedSize":22359,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGb3s5MtDQfbQr7hYsbCBZEC9Sf1Ogi6/ULN/+kWAn2NAiEAxbeXfLjyqDBGsxD6fPsOpdR1fuR5bgDQPhnbxsbY6u4="}]},"_npmUser":{"name":"medonomator","email":"budteschastlivi1@gmail.com"},"directories":{},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signals_0.2.0_1776497123297_0.22085197225371633"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:25:23.212Z","0.2.0":"2026-04-18T07:25:23.419Z","modified":"2026-04-18T07:25:23.633Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"Signal bus — the nervous system of the cognitive swarm","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/signals"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/signals\n\nSignal bus -- the nervous system of the cognitive swarm.\n\n## Install\n\n```bash\nnpm install @cognitive-swarm/signals\n```\n\n## Overview\n\nThis package provides the communication backbone for the swarm. Agents exchange typed signals (task, discovery, proposal, doubt, challenge, vote, conflict, consensus, escalate) through the `SignalBus`. The `ConflictDetector` monitors the bus and flags contradictory signals automatically.\n\n## Usage\n\n```typescript\nimport { SignalBus, ConflictDetector } from '@cognitive-swarm/signals'\nimport type { ResolvedSignalBusConfig } from '@cognitive-swarm/core'\n\n// Create the bus\nconst bus = new SignalBus(config)\n\n// Emit a signal\nbus.emit({\n  type: 'discovery',\n  source: 'agent-analyst',\n  payload: { content: 'Found correlation in dataset' },\n})\n\n// Subscribe to signals\nbus.on('proposal', (signal) => {\n  console.log(signal.source, signal.payload)\n})\n\n// Detect contradictions\nconst detector = new ConflictDetector(bus)\n// Conflict signals are emitted back onto the bus automatically\n```\n\n## API\n\n### SignalBus\n\n- `emit(signal)` -- broadcast a typed signal to the swarm\n- `on(type, handler)` -- subscribe to a specific signal type\n- `getHistory()` -- retrieve the full signal log\n\n### ConflictDetector\n\n- Attaches to a `SignalBus` and watches for contradictory discovery/proposal signals\n- Emits `conflict` signals when contradictions are detected\n\n## License\n\nApache-2.0\n\n## Links\n\n- [cognitive-swarm root](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-2be0876a6b2fddaf2171681e67af8627"}