{"_id":"@cognitive-swarm/composer","name":"@cognitive-swarm/composer","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cognitive-swarm/composer","version":"0.2.0","description":"Dynamic swarm composition — select, reinforce, and prune agents","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/composer"},"publishConfig":{"access":"public"},"homepage":"https://medonomator.github.io/cognitive-swarm/","bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"gitHead":"8613f7b139c03719ef14fe9f2c01bdc1c5532a26","_id":"@cognitive-swarm/composer@0.2.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-D+YLZbc/jAPEqcElYVm+Hvi8bRe7YrHQcWBeBuIBZAW4YMR8T4afA46yRSS/7hqS+NnAsNH0oSK3atZPb1ABPg==","shasum":"5a88e142a63172db98dd81984431c02b6491a563","tarball":"https://registry.npmjs.org/@cognitive-swarm/composer/-/composer-0.2.0.tgz","fileCount":14,"unpackedSize":24341,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBrENgiMHI5t+tXIJp2C84DSfHlVbJF5ZkF30uEmMCctAiEA76OFDPj3dbp0XrEKqqUY8ObNDTBuMm0Bt7VtBVgsX8Y="}]},"_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/composer_0.2.0_1776497147304_0.620255141916773"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T07:25:47.166Z","0.2.0":"2026-04-18T07:25:47.441Z","modified":"2026-04-18T07:25:47.702Z"},"maintainers":[{"name":"medonomator","email":"budteschastlivi1@gmail.com"}],"description":"Dynamic swarm composition — select, reinforce, and prune agents","homepage":"https://medonomator.github.io/cognitive-swarm/","repository":{"type":"git","url":"git+https://github.com/medonomator/cognitive-swarm.git","directory":"packages/composer"},"author":{"name":"Dmitry Zorin"},"bugs":{"url":"https://github.com/medonomator/cognitive-swarm/issues"},"license":"Apache-2.0","readme":"# @cognitive-swarm/composer\n\nDynamic swarm composition -- select, reinforce, and prune agents at runtime.\n\n## Installation\n\n```bash\nnpm install @cognitive-swarm/composer\n```\n\n## Overview\n\nThe `DynamicComposer` selects which agents to include in a swarm based on the current task, reinforces high-performing agents, and prunes underperformers. It produces a `CompositionResult` with the selected agents and the reasoning behind each selection.\n\n## Usage\n\n```ts\nimport { DynamicComposer } from '@cognitive-swarm/composer';\nimport type { AgentCandidate, CompositionResult } from '@cognitive-swarm/composer';\n\nconst composer = new DynamicComposer({\n  // optional config overrides\n});\n\nconst candidates: AgentCandidate[] = [\n  { agentId: 'analyst', taskTypes: ['summarization', 'research'] },\n  { agentId: 'coder', taskTypes: ['implementation', 'debugging'] },\n];\n\n// Compose a swarm for a given task\nconst result: CompositionResult = composer.compose({\n  taskType: 'research',\n  candidates,\n});\n\n// result.selected — agents chosen for the swarm\n// result.reasons  — why each agent was selected or excluded\n```\n\n## Exports\n\n| Export               | Kind  | Description                            |\n| -------------------- | ----- | -------------------------------------- |\n| `DynamicComposer`    | Class | Runtime swarm composer                 |\n| `AgentCandidate`     | Type  | Agent available for selection          |\n| `CompositionResult`  | Type  | Output of a composition run            |\n| `SelectionReason`    | Type  | Explanation for a selection decision   |\n| `ComposerConfig`     | Type  | Configuration options                  |\n| `AgentActivity`      | Type  | Tracked activity for an agent          |\n\n## Links\n\n- [Root repository](https://github.com/medonomator/cognitive-swarm)\n","readmeFilename":"README.md","_rev":"1-37c592b0ef2eaf0b888ad0fa54055b00"}