nexus-agents 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,399 @@
1
+ # Nexus Agents
2
+
3
+ > Multi-agent orchestration MCP server with model diversity and workflow automation
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen)](https://nodejs.org)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.8+-blue)](https://www.typescriptlang.org)
8
+ [![MCP Protocol](https://img.shields.io/badge/MCP-2025--11--25-purple)](https://modelcontextprotocol.io)
9
+ [![npm version](https://img.shields.io/npm/v/nexus-agents)](https://www.npmjs.com/package/nexus-agents)
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ Nexus Agents is an MCP (Model Context Protocol) server that coordinates multiple AI experts to handle software development tasks. It provides a unified interface for different AI models and enables multi-agent collaboration through a Tech Lead and specialized experts.
16
+
17
+ ### Key Capabilities
18
+
19
+ - **Multi-Agent Orchestration** - Tech Lead coordinates specialized experts for complex tasks
20
+ - **Model Diversity** - Support for Claude, OpenAI, Gemini, and Ollama
21
+ - **Workflow Automation** - YAML-based templates for repeatable processes
22
+ - **Security-First Design** - Defense in depth with secrets vault and input validation
23
+
24
+ ---
25
+
26
+ ## Quick Start
27
+
28
+ ### Installation
29
+
30
+ ```bash
31
+ # Install the package
32
+ npm install nexus-agents
33
+
34
+ # Or install globally for CLI usage
35
+ npm install -g nexus-agents
36
+ ```
37
+
38
+ ### CLI Usage
39
+
40
+ Start the MCP server:
41
+
42
+ ```bash
43
+ # If installed globally
44
+ nexus-agents
45
+
46
+ # Or with npx
47
+ npx nexus-agents
48
+ ```
49
+
50
+ ### Programmatic Usage
51
+
52
+ ```typescript
53
+ import {
54
+ createServer,
55
+ startStdioServer,
56
+ TechLead,
57
+ createClaudeAdapter,
58
+ ExpertFactory,
59
+ } from 'nexus-agents';
60
+
61
+ // Start MCP server
62
+ const result = await startStdioServer({
63
+ name: 'my-server',
64
+ version: '1.0.0',
65
+ });
66
+
67
+ // Or use programmatically
68
+ const adapter = createClaudeAdapter({
69
+ model: 'claude-sonnet-4-20250514',
70
+ });
71
+ const techLead = new TechLead({ adapter });
72
+
73
+ // Create experts dynamically
74
+ const factory = new ExpertFactory(adapter);
75
+ const codeExpert = factory.create({ type: 'code' });
76
+ ```
77
+
78
+ ### Claude Desktop Integration
79
+
80
+ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "nexus-agents": {
86
+ "command": "npx",
87
+ "args": ["nexus-agents"],
88
+ "env": {
89
+ "ANTHROPIC_API_KEY": "sk-ant-..."
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Features
99
+
100
+ ### Multi-Agent Orchestration
101
+
102
+ The Tech Lead agent analyzes incoming tasks and delegates to specialized experts:
103
+
104
+ | Expert | Specialization |
105
+ | ------------------------ | ------------------------------------------------------ |
106
+ | **Code Expert** | Implementation, debugging, optimization, refactoring |
107
+ | **Architecture Expert** | System design, patterns, trade-offs, scalability |
108
+ | **Security Expert** | Vulnerability analysis, secure coding, threat modeling |
109
+ | **Documentation Expert** | Technical writing, API docs, code comments |
110
+ | **Testing Expert** | Test strategies, coverage analysis, test generation |
111
+
112
+ Experts can collaborate on complex tasks. The Tech Lead combines their outputs into a single response.
113
+
114
+ ### Model Adapters
115
+
116
+ Use different AI models through unified interfaces:
117
+
118
+ | Provider | Models | Best For |
119
+ | ---------- | ----------------------- | -------------------------- |
120
+ | **Claude** | Haiku, Sonnet, Opus | General coding, analysis |
121
+ | **OpenAI** | GPT-4o, GPT-4o-mini, o1 | Reasoning, code generation |
122
+ | **Gemini** | Pro, Ultra | Long context, multimodal |
123
+ | **Ollama** | Llama, CodeLlama, etc. | Local inference, privacy |
124
+
125
+ Model selection uses semantic classification with tier escalation:
126
+
127
+ ```
128
+ Fast (quick queries) -> Balanced (most tasks) -> Powerful (complex reasoning)
129
+ ```
130
+
131
+ ### Workflow Engine
132
+
133
+ Define reusable workflows in YAML:
134
+
135
+ ```yaml
136
+ name: code-review
137
+ description: Comprehensive code review workflow
138
+ steps:
139
+ - agent: security_expert
140
+ action: scan_vulnerabilities
141
+ output: security_report
142
+
143
+ - agent: code_expert
144
+ action: review_quality
145
+ input: ${security_report}
146
+ output: quality_report
147
+
148
+ - agent: testing_expert
149
+ action: analyze_coverage
150
+ parallel: true
151
+
152
+ - agent: documentation_expert
153
+ action: check_documentation
154
+ parallel: true
155
+ ```
156
+
157
+ ### MCP Tools
158
+
159
+ The server exposes these MCP tools for integration:
160
+
161
+ | Tool | Description |
162
+ | --------------- | -------------------------------------------- |
163
+ | `orchestrate` | Analyze task and coordinate expert execution |
164
+ | `create_expert` | Dynamically create a specialized expert |
165
+ | `run_workflow` | Execute a predefined workflow template |
166
+
167
+ ---
168
+
169
+ ## Architecture
170
+
171
+ ```
172
+ nexus-agents/
173
+ ├── packages/
174
+ │ └── nexus-agents/ # Main package (single consolidated package)
175
+ │ ├── src/
176
+ │ │ ├── core/ # Shared types, Result<T,E>, errors, logger
177
+ │ │ ├── config/ # Configuration loading and validation
178
+ │ │ ├── adapters/ # Model adapters (Claude, OpenAI, Gemini, Ollama)
179
+ │ │ ├── agents/ # Agent framework (TechLead, Experts)
180
+ │ │ ├── workflows/ # Workflow engine and templates
181
+ │ │ ├── mcp/ # MCP server and tool definitions
182
+ │ │ ├── index.ts # Main exports
183
+ │ │ └── cli.ts # CLI entry point
184
+ │ └── package.json
185
+ ├── .claude/
186
+ │ ├── rules/ # Claude Code rules
187
+ │ └── skills/ # Project-specific skills
188
+ └── pnpm-workspace.yaml
189
+ ```
190
+
191
+ ### Dependency Flow
192
+
193
+ ```
194
+ MCP Server (external boundary)
195
+
196
+ Workflow Engine (orchestrates execution)
197
+
198
+ Agents Layer (TechLead, Experts)
199
+
200
+ Adapters Layer (Claude, OpenAI, Gemini, Ollama)
201
+
202
+ Core Layer (Types, Result<T,E>, Errors, Logger)
203
+ ```
204
+
205
+ ### Core Interfaces
206
+
207
+ ```typescript
208
+ // Unified model interaction
209
+ interface IModelAdapter {
210
+ complete(request: CompletionRequest): Promise<Result<Response, ModelError>>;
211
+ stream(request: CompletionRequest): AsyncIterable<StreamChunk>;
212
+ countTokens(text: string): Promise<number>;
213
+ }
214
+
215
+ // Base agent contract
216
+ interface IAgent {
217
+ readonly id: string;
218
+ readonly role: AgentRole;
219
+ execute(task: Task): Promise<Result<TaskResult, AgentError>>;
220
+ handleMessage(msg: AgentMessage): Promise<Result<AgentResponse, AgentError>>;
221
+ }
222
+
223
+ // Workflow execution
224
+ interface IWorkflowEngine {
225
+ loadTemplate(path: string): Promise<Result<WorkflowDefinition, ParseError>>;
226
+ execute(
227
+ workflow: WorkflowDefinition,
228
+ inputs: unknown
229
+ ): Promise<Result<WorkflowResult, WorkflowError>>;
230
+ }
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Configuration
236
+
237
+ ### Environment Variables
238
+
239
+ | Variable | Description | Required |
240
+ | ------------------- | --------------------------------- | ------------------------------------- |
241
+ | `ANTHROPIC_API_KEY` | Claude API key | Yes (for Claude) |
242
+ | `OPENAI_API_KEY` | OpenAI API key | For OpenAI models |
243
+ | `GOOGLE_AI_API_KEY` | Google AI API key | For Gemini models |
244
+ | `OLLAMA_HOST` | Ollama server URL | For Ollama (default: localhost:11434) |
245
+ | `NEXUS_LOG_LEVEL` | Log level (debug/info/warn/error) | No |
246
+
247
+ ---
248
+
249
+ ## API Reference
250
+
251
+ ### Adapters
252
+
253
+ ```typescript
254
+ import {
255
+ createClaudeAdapter,
256
+ createOpenAIAdapter,
257
+ createGeminiAdapter,
258
+ createOllamaAdapter,
259
+ AdapterFactory,
260
+ } from 'nexus-agents';
261
+
262
+ // Create individual adapters
263
+ const claude = createClaudeAdapter({ model: 'claude-sonnet-4-20250514' });
264
+ const openai = createOpenAIAdapter({ model: 'gpt-4o' });
265
+ const gemini = createGeminiAdapter({ model: 'gemini-1.5-pro' });
266
+ const ollama = createOllamaAdapter({ model: 'llama3:8b' });
267
+
268
+ // Or use the factory
269
+ const factory = new AdapterFactory();
270
+ const adapter = factory.create({ provider: 'anthropic', model: 'claude-sonnet-4-20250514' });
271
+ ```
272
+
273
+ ### Agents
274
+
275
+ ```typescript
276
+ import { TechLead, ExpertFactory, Expert } from 'nexus-agents';
277
+
278
+ // Create TechLead for orchestration
279
+ const techLead = new TechLead({ adapter });
280
+
281
+ // Create experts
282
+ const factory = new ExpertFactory(adapter);
283
+ const codeExpert = factory.create({ type: 'code' });
284
+ const securityExpert = factory.create({ type: 'security' });
285
+ ```
286
+
287
+ ### MCP Server
288
+
289
+ ```typescript
290
+ import { createServer, startStdioServer, registerTools } from 'nexus-agents';
291
+
292
+ // Create and start server
293
+ const result = await startStdioServer({
294
+ name: 'my-server',
295
+ version: '1.0.0',
296
+ });
297
+
298
+ if (result.ok) {
299
+ const { server } = result.value;
300
+ // Server is running with stdio transport
301
+ }
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Development
307
+
308
+ ### Prerequisites
309
+
310
+ - Node.js 22.x LTS
311
+ - pnpm 9.x
312
+ - TypeScript 5.8+
313
+
314
+ ### Setup
315
+
316
+ ```bash
317
+ # Clone the repository
318
+ git clone https://github.com/williamzujkowski/nexus-agents.git
319
+ cd nexus-agents
320
+
321
+ # Install dependencies
322
+ pnpm install
323
+
324
+ # Build the package
325
+ pnpm build
326
+
327
+ # Run tests
328
+ pnpm test
329
+
330
+ # Start development mode
331
+ pnpm dev
332
+ ```
333
+
334
+ ### Commands
335
+
336
+ ```bash
337
+ # Development
338
+ pnpm dev # Start dev server with watch mode
339
+ pnpm build # Build the package
340
+ pnpm clean # Clean build artifacts
341
+
342
+ # Quality
343
+ pnpm lint # Run ESLint
344
+ pnpm lint:fix # Fix linting issues
345
+ pnpm typecheck # Run TypeScript type checking
346
+ pnpm test # Run all tests
347
+ pnpm test:coverage # Run tests with coverage
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Contributing
353
+
354
+ We welcome contributions! Please see our guidelines:
355
+
356
+ 1. **Fork** the repository
357
+ 2. **Create** a feature branch (`git checkout -b feat/amazing-feature`)
358
+ 3. **Commit** with conventional commits (`git commit -m 'feat(agents): add amazing feature'`)
359
+ 4. **Push** to your branch (`git push origin feat/amazing-feature`)
360
+ 5. **Open** a Pull Request
361
+
362
+ ### Code Standards
363
+
364
+ - Files must be under 400 lines
365
+ - Functions must be under 50 lines
366
+ - Test coverage must be at least 80%
367
+ - All code must pass linting and type checking
368
+
369
+ See [CODING_STANDARDS.md](./CODING_STANDARDS.md) for detailed guidelines.
370
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution workflow.
371
+
372
+ ### Commit Convention
373
+
374
+ We use [Conventional Commits](https://www.conventionalcommits.org/):
375
+
376
+ ```
377
+ feat(scope): add new feature
378
+ fix(scope): fix bug
379
+ refactor(scope): refactor code
380
+ docs(scope): update documentation
381
+ test(scope): add tests
382
+ chore(scope): maintenance tasks
383
+ ```
384
+
385
+ ---
386
+
387
+ ## License
388
+
389
+ MIT - See [LICENSE](./LICENSE) for details.
390
+
391
+ ---
392
+
393
+ ## Acknowledgments
394
+
395
+ This project is a clean-room rewrite inspired by [claude-team-mcp](https://github.com/original/claude-team-mcp), with attribution preserved per MIT license.
396
+
397
+ ---
398
+
399
+ Built with Claude Code
@@ -13139,4 +13139,4 @@ export {
13139
13139
  toolError,
13140
13140
  VERSION2 as VERSION
13141
13141
  };
13142
- //# sourceMappingURL=chunk-3VJOPTVX.js.map
13142
+ //# sourceMappingURL=chunk-OZ36NFYJ.js.map