# @cogitator-ai/swarms

## 0.4.19

### Patch Changes

- Republish packages with resolved internal dependency versions so npm installs do not receive workspace protocol dependencies.
- Updated dependencies
  - @cogitator-ai/core@0.19.3
  - @cogitator-ai/workflows@0.5.16

## 0.4.18

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.19.2
  - @cogitator-ai/types@0.22.2
  - @cogitator-ai/workflows@0.5.15

## 0.4.17

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.19.1
  - @cogitator-ai/types@0.22.1
  - @cogitator-ai/workflows@0.5.14

## 0.4.16

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.18.7
  - @cogitator-ai/workflows@0.5.12

## 0.4.15

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.18.6
  - @cogitator-ai/workflows@0.5.11

## 0.4.14

### Patch Changes

- fix(types): audit — 13 bugs/type-safety issues fixed, dead code removed
  - Added missing `responseFormat` to `SerializedAgentConfig`
  - Fixed `DurationString` type (removed useless `| string` union)
  - Added `coherence` field to `TraceMetrics`
  - Removed duplicate config fields in `MetaReasoningConfig`
  - Renamed `turnDuration` to `maxTokensPerTurn` in `DebateConfig`
  - Narrowed `NegotiationTerm.value` to `string | number | boolean`
  - Typed `CapturedPrompt.tools` as `ToolSchema[]`
  - Made `GraphStats` Record fields Partial
  - Removed dead duplicate fields from `MetaAssessment` and `ModificationValidationResult`
  - Removed unused `ProposedActionType`

- Updated dependencies
  - @cogitator-ai/types@0.21.3
  - @cogitator-ai/core@0.18.5
  - @cogitator-ai/workflows@0.5.10

## 0.4.13

### Patch Changes

- fix(swarms): audit — 30+ bugs fixed, +121 tests, docs updated

  HIGH severity fixes:
  - swarm.ts: validateConfig missing 'negotiation' strategy + SwarmBuilder missing negotiation() method
  - coordinator.ts: inverted error handling in runAgentsParallel (abort/retry/failover silently skipped)
  - pipeline.ts: infinite retry loop (getRetryCount never incremented) + retry-previous wrong input
  - model-discovery.ts: first-match-wins → longest-match-wins for capability inference
  - voting.ts: duplicate votes allowed + weighted resolution ignored weights
  - negotiation.ts: rejectOffer missing authorization check
  - swarm-node.ts: unsafe cast without runtime check

  MEDIUM severity fixes:
  - coordinator.ts: pause loop ignores abort, unnecessary concrete type casts
  - model-discovery.ts: stale cloud model display names
  - round-robin.ts: currentIndex out of bounds
  - negotiation + voting + delegation: blackboard.read() throws vs null
  - assessor.ts: 15+ unnecessary as casts removed

## 0.4.12

### Patch Changes

- @cogitator-ai/core@0.18.4
- @cogitator-ai/workflows@0.5.9

## 0.4.11

### Patch Changes

- @cogitator-ai/core@0.18.3
- @cogitator-ai/workflows@0.5.8

## 0.4.10

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.21.1
  - @cogitator-ai/core@0.18.2
  - @cogitator-ai/workflows@0.5.7

## 0.4.9

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.18.1
  - @cogitator-ai/workflows@0.5.6

## 0.4.8

### Patch Changes

- Updated dependencies
- Updated dependencies
- Updated dependencies
  - @cogitator-ai/core@0.18.0
  - @cogitator-ai/types@0.20.0
  - @cogitator-ai/workflows@0.5.5

## 0.4.6

### Patch Changes

- fix: update repository URLs for GitHub Packages linking
- Updated dependencies
  - @cogitator-ai/core@0.17.4
  - @cogitator-ai/types@0.19.2
  - @cogitator-ai/workflows@0.5.3

## 0.4.5

### Patch Changes

- Configure GitHub Packages publishing
  - Add GitHub Packages registry configuration to all packages
  - Add integration tests for LLM backends (OpenAI, Anthropic, Google, Ollama)
  - Add comprehensive context-manager tests

- Updated dependencies
  - @cogitator-ai/core@0.17.3
  - @cogitator-ai/types@0.19.1
  - @cogitator-ai/workflows@0.5.2

## 0.4.4

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.17.2
  - @cogitator-ai/workflows@0.5.1

## 0.4.3

### Patch Changes

- Updated dependencies
  - @cogitator-ai/workflows@0.5.0
  - @cogitator-ai/types@0.19.0
  - @cogitator-ai/core@0.17.1

## 0.4.2

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.17.0
  - @cogitator-ai/types@0.18.0
  - @cogitator-ai/workflows@0.4.7

## 0.4.1

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.16.0
  - @cogitator-ai/types@0.17.0
  - @cogitator-ai/workflows@0.4.6

## 0.4.0

### Minor Changes

- feat: distributed swarm execution via Redis

## 0.3.20

### Patch Changes

- Updated dependencies [6b09d54]
  - @cogitator-ai/core@0.15.0
  - @cogitator-ai/types@0.16.0
  - @cogitator-ai/workflows@0.4.5

## 0.3.19

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.14.0
  - @cogitator-ai/types@0.15.0
  - @cogitator-ai/workflows@0.4.4

## 0.3.18

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.13.0
  - @cogitator-ai/types@0.14.0
  - @cogitator-ai/workflows@0.4.3

## 0.3.17

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.12.0
  - @cogitator-ai/types@0.13.0
  - @cogitator-ai/workflows@0.4.2

## 0.3.16

### Patch Changes

- Updated dependencies
  - @cogitator-ai/workflows@0.4.1
  - @cogitator-ai/core@0.11.5

## 0.3.15

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.12.0
  - @cogitator-ai/workflows@0.4.0
  - @cogitator-ai/core@0.11.4

## 0.3.14

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.11.0
  - @cogitator-ai/core@0.11.3
  - @cogitator-ai/workflows@0.3.1

## 0.3.13

### Patch Changes

- Updated dependencies
  - @cogitator-ai/workflows@0.3.0
  - @cogitator-ai/types@0.10.1
  - @cogitator-ai/core@0.11.2

## 0.3.12

### Patch Changes

- fec45e0: Add comprehensive execution tests for all 7 swarm strategies
  - Add mock infrastructure: MockCoordinator, mock-helpers
  - Add tests for RoundRobinStrategy: sequential/random rotation, sticky sessions
  - Add tests for HierarchicalStrategy: supervisor-worker delegation, worker info
  - Add tests for ConsensusStrategy: vote extraction, resolution methods, multiple rounds
  - Add tests for AuctionStrategy: bid parsing, winner selection, minBid filtering
  - Add tests for PipelineStrategy: sequential execution, gates, retry-previous, goto
  - Add tests for DebateStrategy: rounds, moderator synthesis, transcript
  - Add tests for NegotiationStrategy: phase progression, deadlock handling, convergence

## 0.3.11

### Patch Changes

- @cogitator-ai/core@0.11.1
- @cogitator-ai/workflows@0.2.11

## 0.3.10

### Patch Changes

- Updated dependencies
  - @cogitator-ai/core@0.11.0
  - @cogitator-ai/workflows@0.2.10

## 0.3.9

### Patch Changes

- Updated dependencies [58a7271]
  - @cogitator-ai/core@0.10.0
  - @cogitator-ai/types@0.10.0
  - @cogitator-ai/workflows@0.2.9

## 0.3.8

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.9.0
  - @cogitator-ai/core@0.9.0
  - @cogitator-ai/workflows@0.2.8

## 0.3.7

### Patch Changes

- Updated dependencies [faed1e7]
  - @cogitator-ai/core@0.8.0
  - @cogitator-ai/types@0.8.1
  - @cogitator-ai/workflows@0.2.7

## 0.3.6

### Patch Changes

- Updated dependencies [70679b8]
- Updated dependencies [2f599f0]
- Updated dependencies [10956ae]
- Updated dependencies [218d91f]
  - @cogitator-ai/core@0.7.0
  - @cogitator-ai/types@0.8.0
  - @cogitator-ai/workflows@0.2.6

## 0.3.5

### Patch Changes

- Updated dependencies [29ce518]
  - @cogitator-ai/core@0.6.1
  - @cogitator-ai/workflows@0.2.5

## 0.3.4

### Patch Changes

- Updated dependencies [a7c2b43]
  - @cogitator-ai/core@0.6.0
  - @cogitator-ai/types@0.7.0
  - @cogitator-ai/workflows@0.2.4

## 0.3.3

### Patch Changes

- f874e69: ### Memory improvements
  - Add optional `threadId` parameter to `createThread()` in MemoryAdapter interface for proper thread linking
  - Add Google embedding service using `text-embedding-004` model (768 dimensions)
  - Implement hybrid context strategy (30% semantic + 70% recent messages)
  - Fix foreign key constraint violation when saving entries before thread creation

  ### Swarms improvements
  - Add `saveHistory` option to `SwarmRunOptions` to control memory saving per run
  - Fix negotiation strategy import conflict (renamed file to avoid directory resolution issue)
  - Fix coordinator to properly register pipeline stages and handle missing negotiation section

- Updated dependencies [f874e69]
  - @cogitator-ai/core@0.5.0
  - @cogitator-ai/types@0.6.0
  - @cogitator-ai/workflows@0.2.3

## 0.3.2

### Patch Changes

- Updated dependencies
- Updated dependencies [05de0f1]
- Updated dependencies [fb21b64]
- Updated dependencies [05de0f1]
  - @cogitator-ai/core@0.4.0
  - @cogitator-ai/types@0.5.0
  - @cogitator-ai/workflows@0.2.2

## 0.3.1

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.4.0
  - @cogitator-ai/core@0.3.0
  - @cogitator-ai/workflows@0.2.1

## 0.3.0

### Minor Changes

- Fix type safety: remove unsafe `as unknown as number` cast in AssessorConfig defaults
- Fix cost calculation: correctly compute savings when downgrading to local models
- Improve token estimation: use task complexity (simple/moderate/complex) for cost estimates
- Add proper error logging in event handlers (EventEmitter, MessageBus, Blackboard, CircuitBreaker)

### Bug Fixes

- Cost optimization now properly calculates the difference between old and new model costs
- Token estimates now vary by task complexity (500/1500/4000 tokens)

## 0.2.0

### Minor Changes

- feat(swarms): add AI Assessor for dynamic model casting

  Introduces the Assessor system that analyzes tasks and automatically assigns optimal models to each agent role before swarm execution.

  **New features:**
  - `SwarmBuilder.withAssessor()` - enable automatic model selection
  - `swarm.dryRun()` - preview model assignments without executing
  - `metadata.locked` - lock specific agents to prevent model changes
  - Local-first model preference (Ollama over cloud when capable)
  - Budget-aware cost optimization with `maxCostPerRun`

  **New exports from @cogitator-ai/swarms:**
  - `SwarmAssessor`, `createAssessor` - main assessor API
  - `TaskAnalyzer` - rule-based task analysis
  - `ModelDiscovery` - discover Ollama + cloud models
  - `ModelScorer` - score models against requirements
  - `RoleMatcher` - adjust requirements per agent role

  **Example usage:**

  ```typescript
  const swarm = new SwarmBuilder('research-team')
    .strategy('hierarchical')
    .supervisor(supervisorAgent)
    .workers([researcher, writer])
    .withAssessor({
      preferLocal: true,
      maxCostPerRun: 0.1,
    })
    .build(cogitator);

  // Preview assignments
  const preview = await swarm.dryRun({ input: 'Research task...' });

  // Models auto-assigned on first run
  const result = await swarm.run({ input: 'Research task...' });
  ```

### Patch Changes

- Updated dependencies
  - @cogitator-ai/types@0.2.0
  - @cogitator-ai/core@0.1.1
  - @cogitator-ai/workflows@0.1.1
