{"_id":"@cognitive-swarm/introspection","name":"@cognitive-swarm/introspection","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/introspection","version":"0.2.0","description":"Swarm introspection — debug, visualize, detect issues","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":"*"},"license":"Apache-2.0","author":{"name":"Dmitry Zorin"},"repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/introspection"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/introspection@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-/AbrY+Zd/igksI0GCrOC6/dnl1Y5TTSi2fLj2Tnyk2OFewBPygnR58yOLCLuGriA2Jm/0EUK+tVmACM0g5WH7Q==","shasum":"7e86920ac6aa4d8746765a612da4b248be08928a","tarball":"https://registry.npmjs.org/@cognitive-swarm/introspection/-/introspection-0.2.0.tgz","fileCount":14,"unpackedSize":23793,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCEPt1bcsVNfPtSxo7VdoUbF60v8jXCHG/dvV/w0qvUgQIgSJfK8bbKApmxpCC1QbIGqUex2SgXpzNaFfS0OCIMdG4="}]},"_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/introspection_0.2.0_1776497138655_0.5755827329788727"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:25:38.519Z","0.2.0":"2026-04-18T07:25:38.799Z","modified":"2026-04-18T07:25:39.084Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"Swarm introspection — debug, visualize, detect issues","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/introspection"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/introspection\n\nSwarm introspection -- debug, visualize, and detect issues in agent communication.\n\n## Installation\n\n```bash\nnpm install @cognitive-swarm/introspection\n```\n\n## Overview\n\nProvides a `SwarmIntrospector` that captures signal flow between agents and analyzes it for problems: groupthink, deadlocks, cyclic dependencies, and runaway costs. Useful for debugging and monitoring swarm behavior in development and production.\n\n## Usage\n\n```ts\nimport { SwarmIntrospector } from '@cognitive-swarm/introspection';\n\nconst introspector = new SwarmIntrospector();\n\n// Feed signal events as they occur\nintrospector.observe(signalEvent);\n\n// Build a signal graph from observed events\nconst graph = introspector.getSignalGraph();\n\n// Detect groupthink (agents echoing each other)\nconst groupthink: GroupThinkReport = introspector.detectGroupThink();\n\n// Detect deadlocks (agents waiting on each other)\nconst deadlocks: DeadlockReport = introspector.detectDeadlocks();\n\n// Get cost breakdown per agent\nconst costs: CostReport = introspector.getCostReport();\n```\n\n## Exports\n\n| Export              | Kind  | Description                              |\n| ------------------- | ----- | ---------------------------------------- |\n| `SwarmIntrospector` | Class | Core introspection engine                |\n| `SignalEvent`       | Type  | A single observed signal between agents  |\n| `SignalGraph`       | Type  | Directed graph of signal flow            |\n| `SignalEdge`        | Type  | Edge in the signal graph                 |\n| `GroupThinkReport`  | Type  | Groupthink detection results             |\n| `DeadlockReport`   | Type  | Deadlock detection results               |\n| `SignalCycle`       | Type  | Detected cycle in signal flow            |\n| `CostReport`       | Type  | Aggregated cost breakdown                |\n| `AgentCostEntry`   | Type  | Cost entry for a single agent            |\n\n## Links\n\n- [Root repository](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-2ab31a9e8511e6b3d0c925f76f6ef9b1"}