agent-nuvira 1.17.0 → 1.19.0
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 +24 -6
- package/dist/agents/module-registry.d.ts +128 -0
- package/dist/agents/module-registry.d.ts.map +1 -0
- package/dist/agents/module-registry.js +282 -0
- package/dist/agents/module-registry.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +7 -1
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +49 -65
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/inference/factory.d.ts.map +1 -1
- package/dist/inference/factory.js +2 -1
- package/dist/inference/factory.js.map +1 -1
- package/dist/learning/recover-module.d.ts +181 -0
- package/dist/learning/recover-module.d.ts.map +1 -0
- package/dist/learning/recover-module.js +170 -0
- package/dist/learning/recover-module.js.map +1 -0
- package/dist/observability/event-bus.d.ts +260 -0
- package/dist/observability/event-bus.d.ts.map +1 -0
- package/dist/observability/event-bus.js +621 -0
- package/dist/observability/event-bus.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ agent-nuvira config list
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **Unified interface** across
|
|
18
|
+
- **Unified interface** across 17+ providers: 5 built-in (local/Ollama, Groq, NVIDIA NIM, Google Gemini, OpenRouter) + 12 configurable via environment variables (OpenAI, Anthropic, Mistral, Cohere, Together, DeepInfra, Fireworks, Perplexity, Azure, LM Studio, Anyscale, vLLM)
|
|
19
19
|
- **Model discovery** — `agent-nuvira models` lists available models from any configured provider, with search/filter support
|
|
20
20
|
- **Interactive chat** with conversation history, file context, and session commands
|
|
21
21
|
- **AI-assisted file editing** with dry-run mode for safe previews
|
|
@@ -27,7 +27,7 @@ agent-nuvira config list
|
|
|
27
27
|
- **Context-preserving model switching** — `agent-nuvira model switch` changes providers mid-session without losing agent state
|
|
28
28
|
- **Skill compiler** — automatically extracts reusable patterns from successful agent runs into executable skills (`agent-nuvira skill run`)
|
|
29
29
|
- **Context-window memory pruner** — prevents long multi-agent chains from exceeding model token limits
|
|
30
|
-
- **Complete streaming support** — all
|
|
30
|
+
- **Complete streaming support** — all 17+ providers support real-time token-by-token output
|
|
31
31
|
- **Cost tracking** — per-provider/session/monthly costs with `agent-nuvira stats cost`
|
|
32
32
|
- **Prompt history search** — keyword and semantic search across past conversations (`/search`, `buff history`)
|
|
33
33
|
- **Native embedding support** — 3-tier embedder with `@huggingface/transformers` for 10x faster semantic search
|
|
@@ -53,6 +53,7 @@ agent-nuvira config list
|
|
|
53
53
|
- **A2A (Agent-to-Agent) Protocol** — inter-agent communication standard for multi-machine collaboration
|
|
54
54
|
- **CI/CD headless mode** — `buff ci` for automated pipelines with GitHub Actions integration
|
|
55
55
|
- **npm publishing & one-line install** — `npx agent-nuvira` and `npx buff` for zero-setup onboarding
|
|
56
|
+
- **Marketing website** — `website/` directory with a full landing page, SEO meta tags, and Netlify-ready deployment config
|
|
56
57
|
- **Interactive development mode** — `buff execute` without a goal launches a guided interactive loop with session save/resume, follow-up suggestions, and failure analysis
|
|
57
58
|
- **Session persistence** — save and resume development sessions across CLI restarts with full history
|
|
58
59
|
- **Failure analysis** — automatic diagnosis of agent failures with specific recovery options per agent type
|
|
@@ -1012,6 +1013,21 @@ Adapter Adapter Adapter Adapter Adapter
|
|
|
1012
1013
|
└──────────────────────────────┘
|
|
1013
1014
|
```
|
|
1014
1015
|
|
|
1016
|
+
### Website (Marketing Site)
|
|
1017
|
+
|
|
1018
|
+
The `website/` directory contains a complete static landing page for Agent-Nuvira (`agent-nuvira.com`):
|
|
1019
|
+
|
|
1020
|
+
| File | Purpose |
|
|
1021
|
+
|---|---|
|
|
1022
|
+
| `index.html` | Full marketing landing page with hero, features, pipeline visualization, provider cards, quickstart guide, extensions, and comparison table |
|
|
1023
|
+
| `styles.css` | Complete styling with gradient text, animated particles, responsive grid, and dark theme |
|
|
1024
|
+
| `script.js` | Interactive elements: scroll animations, copy-to-clipboard, mobile nav toggle, particle system |
|
|
1025
|
+
| `_redirects` | Netlify/Cloudflare Page redirect rules |
|
|
1026
|
+
| `_headers` | Custom HTTP security and cache headers |
|
|
1027
|
+
| `assets/` | Hero images, screenshots, and OG meta assets |
|
|
1028
|
+
|
|
1029
|
+
The site is pre-configured for Netlify deployment with zero-configuration.
|
|
1030
|
+
|
|
1015
1031
|
### Key Modules
|
|
1016
1032
|
|
|
1017
1033
|
| Module | Path | Purpose |
|
|
@@ -1323,11 +1339,13 @@ npx tsc --noEmit
|
|
|
1323
1339
|
|
|
1324
1340
|
**Phases 1–3 (25 phases) are complete.** Phase 4 (Industry Standards & Autonomous Polish) is in progress. See [UPGRADE_ROADMAP.md](./UPGRADE_ROADMAP.md) for the full implementation journey.
|
|
1325
1341
|
|
|
1342
|
+
> 📊 **Architecture, strategy & contribution materials:** [ARCHITECTURE.md](./ARCHITECTURE.md) — Modular execution engine design with 7 module specifications, extensibility/observability systems, and phased migration plan. [ARCHITECTURE_DIAGRAMS.md](./ARCHITECTURE_DIAGRAMS.md) — Mermaid-rendered versions of all architecture diagrams (Module Architecture, Extensibility, Safe Execution, Data Flow, Observability Bus). [PRODUCT_STRATEGY.md](./PRODUCT_STRATEGY.md) — Competitive landscape, positioning map, OKR framework, and risk register. [PITCH_DECK.md](./PITCH_DECK.md) — 10-slide investor presentation outline with talking points and data. [CONTRIBUTING.md](./CONTRIBUTING.md) — Quick-reference contributor guide with docs map, dev setup, and contribution workflow.
|
|
1343
|
+
|
|
1326
1344
|
| Phase | Feature | Status |
|
|
1327
1345
|
|---|---|---|
|
|
1328
1346
|
| **Phase 1: Quick Wins** | | |
|
|
1329
1347
|
| 1.1 | Auto-discovery plugin loader — drop `.js` into `~/.buff/plugins/` | ✅ Complete |
|
|
1330
|
-
| 1.2 | Complete streaming support — all
|
|
1348
|
+
| 1.2 | Complete streaming support — all 17+ providers | ✅ Complete |
|
|
1331
1349
|
| 1.3 | Cost tracking — per-provider/session/monthly | ✅ Complete |
|
|
1332
1350
|
| 1.4 | `buff init` — interactive project scaffolding | ✅ Complete |
|
|
1333
1351
|
| 1.5 | Prompt history search — keyword + semantic | ✅ Complete |
|
|
@@ -1373,7 +1391,7 @@ npx tsc --noEmit
|
|
|
1373
1391
|
|
|
1374
1392
|
| Version | Date | Key Changes |
|
|
1375
1393
|
|---------|------|-------------|
|
|
1376
|
-
| **v1.0.0** | Apr 2026 | Initial release — Core CLI with chat, 5 providers, config, models |
|
|
1394
|
+
| **v1.0.0** | Apr 2026 | Initial release — Core CLI with chat, 5 built-in providers (expandable to 17+ via plugins), config, models |
|
|
1377
1395
|
| **v1.1.0** | Apr 2026 | Model discovery with search/filter |
|
|
1378
1396
|
| **v1.2.0** | Apr 2026 | AI-assisted file editing (edit command) |
|
|
1379
1397
|
| **v1.3.0** | May 2026 | Implementation plans (plan command) |
|
|
@@ -1406,10 +1424,10 @@ npx tsc --noEmit
|
|
|
1406
1424
|
### Phase 0: Foundation — Core CLI & Provider Layer
|
|
1407
1425
|
| Feature | Description |
|
|
1408
1426
|
|---------|-------------|
|
|
1409
|
-
| **
|
|
1427
|
+
| **17+ Inference Providers** | 5 built-in (Groq, NVIDIA NIM, Google Gemini, OpenRouter, Local) + 12 configurable via env vars (OpenAI, Anthropic, Mistral, Cohere, Together, DeepInfra, Fireworks, Perplexity, Azure, LM Studio, Anyscale, vLLM) |
|
|
1410
1428
|
| **Unified CLI** | 25+ commands via Commander.js with shared options |
|
|
1411
1429
|
| **Config System** | JSON config file + env vars + CLI flags priority chain |
|
|
1412
|
-
| **Streaming** | Real-time token-by-token output for all
|
|
1430
|
+
| **Streaming** | Real-time token-by-token output for all 17+ providers |
|
|
1413
1431
|
| **Response Caching** | SQLite-backed cache with configurable TTL |
|
|
1414
1432
|
| **Chat Interface** | Interactive chat with conversation history and `/` commands |
|
|
1415
1433
|
| **File Editing** | AI-assisted file editing with dry-run mode |
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModuleRegistry — Plugin-based module loading system for the agent execution engine.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the hardcoded `createAgent()` switch statement with a registry that
|
|
5
|
+
* allows modules (agents) to be registered, discovered, and loaded at runtime.
|
|
6
|
+
* Built-in agents are pre-registered; custom agents can be added by plugins
|
|
7
|
+
* or via the SDK's `registerAgent()` function.
|
|
8
|
+
*
|
|
9
|
+
* @see ARCHITECTURE.md §4.1 — Extensibility System
|
|
10
|
+
*/
|
|
11
|
+
import { Agent } from './agent.js';
|
|
12
|
+
import type { EventBus } from '../observability/event-bus.js';
|
|
13
|
+
/** Factory function that creates a new Agent instance */
|
|
14
|
+
export type AgentFactory = () => Agent;
|
|
15
|
+
/** Metadata about a registered module */
|
|
16
|
+
export interface ModuleMetadata {
|
|
17
|
+
/** The agent type string used in task plans (e.g. 'planner', 'writer') */
|
|
18
|
+
agentType: string;
|
|
19
|
+
/** Human-readable name of the agent (e.g. 'Planner', 'Writer') */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Short description of what this agent does */
|
|
22
|
+
description: string;
|
|
23
|
+
/** Emoji icon for the spinner / UI display */
|
|
24
|
+
icon: string;
|
|
25
|
+
/** Whether this module is built-in (true) or added by a plugin (false) */
|
|
26
|
+
isBuiltin: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Error thrown when a module lookup fails */
|
|
29
|
+
export declare class ModuleNotFoundError extends Error {
|
|
30
|
+
constructor(agentType: string);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* ModuleRegistry — Central registry for agent modules.
|
|
34
|
+
*
|
|
35
|
+
* Manages a collection of agent factories with metadata. Supports lookup,
|
|
36
|
+
* listing, and dynamic registration at runtime.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const registry = ModuleRegistry.createWithBuiltins();
|
|
41
|
+
* const planner = registry.getModule('planner'); // → PlannerAgent instance
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class ModuleRegistry {
|
|
45
|
+
/** Agent factory functions, keyed by agentType */
|
|
46
|
+
private factories;
|
|
47
|
+
/** Module metadata, keyed by agentType */
|
|
48
|
+
private metadata;
|
|
49
|
+
/** The event bus for emitting observability events */
|
|
50
|
+
private eventBus;
|
|
51
|
+
constructor(eventBus?: EventBus);
|
|
52
|
+
/**
|
|
53
|
+
* Register an agent module with the registry.
|
|
54
|
+
*
|
|
55
|
+
* @param agentType - The agent type string used in task plans
|
|
56
|
+
* @param factory - Factory function that returns a new Agent instance
|
|
57
|
+
* @param meta - Metadata describing the module
|
|
58
|
+
*
|
|
59
|
+
* @throws {Error} If `agentType` is already registered (use `override` to replace)
|
|
60
|
+
*/
|
|
61
|
+
register(agentType: string, factory: AgentFactory, meta: Omit<ModuleMetadata, 'agentType' | 'isBuiltin'> & {
|
|
62
|
+
isBuiltin?: boolean;
|
|
63
|
+
}): void;
|
|
64
|
+
/**
|
|
65
|
+
* Register an agent module, silently replacing any existing registration.
|
|
66
|
+
* Useful for plugin overrides and hot-reload scenarios.
|
|
67
|
+
*/
|
|
68
|
+
registerOrOverride(agentType: string, factory: AgentFactory, meta: Omit<ModuleMetadata, 'agentType' | 'isBuiltin'> & {
|
|
69
|
+
isBuiltin?: boolean;
|
|
70
|
+
}): void;
|
|
71
|
+
/**
|
|
72
|
+
* Unregister an agent module.
|
|
73
|
+
* Safe to call for non-existent agent types (no-op).
|
|
74
|
+
*/
|
|
75
|
+
unregister(agentType: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Get an Agent instance for the given agent type.
|
|
78
|
+
*
|
|
79
|
+
* @param agentType - The agent type string (e.g. 'planner', 'writer')
|
|
80
|
+
* @returns A new Agent instance
|
|
81
|
+
* @throws {ModuleNotFoundError} If no module is registered for `agentType`
|
|
82
|
+
*/
|
|
83
|
+
getModule(agentType: string): Agent;
|
|
84
|
+
/**
|
|
85
|
+
* Check if an agent type is registered.
|
|
86
|
+
*/
|
|
87
|
+
hasModule(agentType: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Get metadata for a registered agent type.
|
|
90
|
+
* Returns undefined if the agent type is not registered.
|
|
91
|
+
*/
|
|
92
|
+
getMetadata(agentType: string): ModuleMetadata | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* List all registered modules, optionally filtered by a predicate.
|
|
95
|
+
*/
|
|
96
|
+
listModules(filter?: (meta: ModuleMetadata) => boolean): ModuleMetadata[];
|
|
97
|
+
/**
|
|
98
|
+
* Get the icon for an agent type, or a default icon if not found.
|
|
99
|
+
*/
|
|
100
|
+
getIcon(agentType: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* Get the number of registered modules.
|
|
103
|
+
*/
|
|
104
|
+
get size(): number;
|
|
105
|
+
/**
|
|
106
|
+
* Create a ModuleRegistry pre-populated with all built-in agents.
|
|
107
|
+
*/
|
|
108
|
+
static createWithBuiltins(eventBus?: EventBus): ModuleRegistry;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get or create the global ModuleRegistry singleton.
|
|
112
|
+
*
|
|
113
|
+
* First call creates a registry with all built-in agents pre-registered.
|
|
114
|
+
* Subsequent calls return the same instance.
|
|
115
|
+
* Use `resetModuleRegistry()` to clear and re-initialize (useful in tests).
|
|
116
|
+
*/
|
|
117
|
+
export declare function getModuleRegistry(): ModuleRegistry;
|
|
118
|
+
/**
|
|
119
|
+
* Reset the global module registry.
|
|
120
|
+
* Primarily useful in tests to get a clean slate.
|
|
121
|
+
*/
|
|
122
|
+
export declare function resetModuleRegistry(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Set the global module registry (for dependency injection in tests).
|
|
125
|
+
* Returns the previous registry instance (or null).
|
|
126
|
+
*/
|
|
127
|
+
export declare function setModuleRegistry(registry: ModuleRegistry): ModuleRegistry | null;
|
|
128
|
+
//# sourceMappingURL=module-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-registry.d.ts","sourceRoot":"","sources":["../../src/agents/module-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAenC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAI9D,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC;AAEvC,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,8CAA8C;AAC9C,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,SAAS,EAAE,MAAM;CAI9B;AAID;;;;;;;;;;;GAWG;AACH,qBAAa,cAAc;IACzB,kDAAkD;IAClD,OAAO,CAAC,SAAS,CAAmC;IACpD,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAqC;IACrD,sDAAsD;IACtD,OAAO,CAAC,QAAQ,CAAW;gBAEf,QAAQ,CAAC,EAAE,QAAQ;IAM/B;;;;;;;;OAQG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9E,IAAI;IAsBP;;;OAGG;IACH,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9E,IAAI;IAiBP;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAetC;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK;IAQnC;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIrC;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI1D;;OAEG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GAAG,cAAc,EAAE;IAKzE;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAID;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,cAAc;CAiG/D;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,GAAG,IAAI,CAIjF"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModuleRegistry — Plugin-based module loading system for the agent execution engine.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the hardcoded `createAgent()` switch statement with a registry that
|
|
5
|
+
* allows modules (agents) to be registered, discovered, and loaded at runtime.
|
|
6
|
+
* Built-in agents are pre-registered; custom agents can be added by plugins
|
|
7
|
+
* or via the SDK's `registerAgent()` function.
|
|
8
|
+
*
|
|
9
|
+
* @see ARCHITECTURE.md §4.1 — Extensibility System
|
|
10
|
+
*/
|
|
11
|
+
import { PlannerAgent } from './agents/planner.js';
|
|
12
|
+
import { ContextGathererAgent } from './agents/context-gatherer.js';
|
|
13
|
+
import { WriterAgent } from './agents/writer.js';
|
|
14
|
+
import { ReviewerAgent } from './agents/reviewer.js';
|
|
15
|
+
import { RunnerAgent } from './agents/runner.js';
|
|
16
|
+
import { TesterAgent } from './agents/tester.js';
|
|
17
|
+
import { DebuggerAgent } from './agents/debugger.js';
|
|
18
|
+
import { GitAgent } from './agents/git-agent.js';
|
|
19
|
+
import { PackageAgent } from './agents/package-agent.js';
|
|
20
|
+
import { GitHubReleaseAgent } from './agents/github-release-agent.js';
|
|
21
|
+
import { SecurityAgent } from './agents/security-agent.js';
|
|
22
|
+
import { SkillRunnerAgent } from './agents/skill-runner.js';
|
|
23
|
+
import { MCPAgent } from './agents/mcp-agent.js';
|
|
24
|
+
import { getEventBus, EventNames } from '../observability/event-bus.js';
|
|
25
|
+
/** Error thrown when a module lookup fails */
|
|
26
|
+
export class ModuleNotFoundError extends Error {
|
|
27
|
+
constructor(agentType) {
|
|
28
|
+
super(`No module registered for agent type: '${agentType}'`);
|
|
29
|
+
this.name = 'ModuleNotFoundError';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// ─── Registry Class ─────────────────────────────────────────────────────────
|
|
33
|
+
/**
|
|
34
|
+
* ModuleRegistry — Central registry for agent modules.
|
|
35
|
+
*
|
|
36
|
+
* Manages a collection of agent factories with metadata. Supports lookup,
|
|
37
|
+
* listing, and dynamic registration at runtime.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const registry = ModuleRegistry.createWithBuiltins();
|
|
42
|
+
* const planner = registry.getModule('planner'); // → PlannerAgent instance
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class ModuleRegistry {
|
|
46
|
+
/** Agent factory functions, keyed by agentType */
|
|
47
|
+
factories = new Map();
|
|
48
|
+
/** Module metadata, keyed by agentType */
|
|
49
|
+
metadata = new Map();
|
|
50
|
+
/** The event bus for emitting observability events */
|
|
51
|
+
eventBus;
|
|
52
|
+
constructor(eventBus) {
|
|
53
|
+
this.eventBus = eventBus ?? getEventBus();
|
|
54
|
+
}
|
|
55
|
+
// ── Registration ─────────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Register an agent module with the registry.
|
|
58
|
+
*
|
|
59
|
+
* @param agentType - The agent type string used in task plans
|
|
60
|
+
* @param factory - Factory function that returns a new Agent instance
|
|
61
|
+
* @param meta - Metadata describing the module
|
|
62
|
+
*
|
|
63
|
+
* @throws {Error} If `agentType` is already registered (use `override` to replace)
|
|
64
|
+
*/
|
|
65
|
+
register(agentType, factory, meta) {
|
|
66
|
+
if (this.factories.has(agentType)) {
|
|
67
|
+
throw new Error(`Agent type '${agentType}' is already registered. Use unregister() first to replace.`);
|
|
68
|
+
}
|
|
69
|
+
this.factories.set(agentType, factory);
|
|
70
|
+
this.metadata.set(agentType, {
|
|
71
|
+
agentType,
|
|
72
|
+
name: meta.name,
|
|
73
|
+
description: meta.description,
|
|
74
|
+
icon: meta.icon,
|
|
75
|
+
isBuiltin: meta.isBuiltin ?? false,
|
|
76
|
+
});
|
|
77
|
+
this.eventBus.emit(EventNames.REGISTRY_MODULE_REGISTERED, {
|
|
78
|
+
agentType,
|
|
79
|
+
name: meta.name,
|
|
80
|
+
isBuiltin: meta.isBuiltin ?? false,
|
|
81
|
+
}, 'module-registry');
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Register an agent module, silently replacing any existing registration.
|
|
85
|
+
* Useful for plugin overrides and hot-reload scenarios.
|
|
86
|
+
*/
|
|
87
|
+
registerOrOverride(agentType, factory, meta) {
|
|
88
|
+
this.factories.set(agentType, factory);
|
|
89
|
+
this.metadata.set(agentType, {
|
|
90
|
+
agentType,
|
|
91
|
+
name: meta.name,
|
|
92
|
+
description: meta.description,
|
|
93
|
+
icon: meta.icon,
|
|
94
|
+
isBuiltin: meta.isBuiltin ?? false,
|
|
95
|
+
});
|
|
96
|
+
this.eventBus.emit(EventNames.REGISTRY_MODULE_REGISTERED, {
|
|
97
|
+
agentType,
|
|
98
|
+
name: meta.name,
|
|
99
|
+
isBuiltin: meta.isBuiltin ?? false,
|
|
100
|
+
}, 'module-registry');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Unregister an agent module.
|
|
104
|
+
* Safe to call for non-existent agent types (no-op).
|
|
105
|
+
*/
|
|
106
|
+
unregister(agentType) {
|
|
107
|
+
const hadFactory = this.factories.delete(agentType);
|
|
108
|
+
this.metadata.delete(agentType);
|
|
109
|
+
if (hadFactory) {
|
|
110
|
+
this.eventBus.emit(EventNames.REGISTRY_MODULE_UNREGISTERED, {
|
|
111
|
+
agentType,
|
|
112
|
+
}, 'module-registry');
|
|
113
|
+
}
|
|
114
|
+
return hadFactory;
|
|
115
|
+
}
|
|
116
|
+
// ── Lookup ───────────────────────────────────────────────────────────
|
|
117
|
+
/**
|
|
118
|
+
* Get an Agent instance for the given agent type.
|
|
119
|
+
*
|
|
120
|
+
* @param agentType - The agent type string (e.g. 'planner', 'writer')
|
|
121
|
+
* @returns A new Agent instance
|
|
122
|
+
* @throws {ModuleNotFoundError} If no module is registered for `agentType`
|
|
123
|
+
*/
|
|
124
|
+
getModule(agentType) {
|
|
125
|
+
const factory = this.factories.get(agentType);
|
|
126
|
+
if (!factory) {
|
|
127
|
+
throw new ModuleNotFoundError(agentType);
|
|
128
|
+
}
|
|
129
|
+
return factory();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check if an agent type is registered.
|
|
133
|
+
*/
|
|
134
|
+
hasModule(agentType) {
|
|
135
|
+
return this.factories.has(agentType);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get metadata for a registered agent type.
|
|
139
|
+
* Returns undefined if the agent type is not registered.
|
|
140
|
+
*/
|
|
141
|
+
getMetadata(agentType) {
|
|
142
|
+
return this.metadata.get(agentType);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* List all registered modules, optionally filtered by a predicate.
|
|
146
|
+
*/
|
|
147
|
+
listModules(filter) {
|
|
148
|
+
const all = Array.from(this.metadata.values());
|
|
149
|
+
return filter ? all.filter(filter) : all;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the icon for an agent type, or a default icon if not found.
|
|
153
|
+
*/
|
|
154
|
+
getIcon(agentType) {
|
|
155
|
+
return this.metadata.get(agentType)?.icon ?? '⚙️';
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the number of registered modules.
|
|
159
|
+
*/
|
|
160
|
+
get size() {
|
|
161
|
+
return this.factories.size;
|
|
162
|
+
}
|
|
163
|
+
// ── Factory methods ──────────────────────────────────────────────────
|
|
164
|
+
/**
|
|
165
|
+
* Create a ModuleRegistry pre-populated with all built-in agents.
|
|
166
|
+
*/
|
|
167
|
+
static createWithBuiltins(eventBus) {
|
|
168
|
+
const registry = new ModuleRegistry(eventBus);
|
|
169
|
+
// Each registration includes: agentType, factory, and metadata
|
|
170
|
+
registry.register('planner', () => new PlannerAgent(), {
|
|
171
|
+
name: 'Planner',
|
|
172
|
+
description: 'Analyzes user goals and creates detailed execution plans',
|
|
173
|
+
icon: '📋',
|
|
174
|
+
isBuiltin: true,
|
|
175
|
+
});
|
|
176
|
+
registry.register('context-gatherer', () => new ContextGathererAgent(), {
|
|
177
|
+
name: 'Context Gatherer',
|
|
178
|
+
description: 'Scans the codebase and identifies relevant files',
|
|
179
|
+
icon: '📂',
|
|
180
|
+
isBuiltin: true,
|
|
181
|
+
});
|
|
182
|
+
registry.register('writer', () => new WriterAgent(), {
|
|
183
|
+
name: 'Writer',
|
|
184
|
+
description: 'Generates code changes based on the plan and context',
|
|
185
|
+
icon: '✏️',
|
|
186
|
+
isBuiltin: true,
|
|
187
|
+
});
|
|
188
|
+
registry.register('reviewer', () => new ReviewerAgent(), {
|
|
189
|
+
name: 'Reviewer',
|
|
190
|
+
description: 'Validates code changes for correctness, security, and quality',
|
|
191
|
+
icon: '👁️',
|
|
192
|
+
isBuiltin: true,
|
|
193
|
+
});
|
|
194
|
+
registry.register('runner', () => new RunnerAgent(), {
|
|
195
|
+
name: 'Runner',
|
|
196
|
+
description: 'Executes shell commands and captures output',
|
|
197
|
+
icon: '▶️',
|
|
198
|
+
isBuiltin: true,
|
|
199
|
+
});
|
|
200
|
+
registry.register('tester', () => new TesterAgent(), {
|
|
201
|
+
name: 'Tester',
|
|
202
|
+
description: 'Runs tests in a sandboxed environment',
|
|
203
|
+
icon: '🧪',
|
|
204
|
+
isBuiltin: true,
|
|
205
|
+
});
|
|
206
|
+
registry.register('debugger', () => new DebuggerAgent(), {
|
|
207
|
+
name: 'Debugger',
|
|
208
|
+
description: 'Diagnoses test failures and iteratively applies fixes',
|
|
209
|
+
icon: '🐛',
|
|
210
|
+
isBuiltin: true,
|
|
211
|
+
});
|
|
212
|
+
registry.register('git', () => new GitAgent(), {
|
|
213
|
+
name: 'Git',
|
|
214
|
+
description: 'Manages git operations (branch, commit, PR)',
|
|
215
|
+
icon: '🔀',
|
|
216
|
+
isBuiltin: true,
|
|
217
|
+
});
|
|
218
|
+
registry.register('package', () => new PackageAgent(), {
|
|
219
|
+
name: 'Package',
|
|
220
|
+
description: 'Manages package version, build, and npm publish',
|
|
221
|
+
icon: '📦',
|
|
222
|
+
isBuiltin: true,
|
|
223
|
+
});
|
|
224
|
+
registry.register('github-release', () => new GitHubReleaseAgent(), {
|
|
225
|
+
name: 'GitHub Release',
|
|
226
|
+
description: 'Creates GitHub releases with auto-generated changelogs',
|
|
227
|
+
icon: '🏷️',
|
|
228
|
+
isBuiltin: true,
|
|
229
|
+
});
|
|
230
|
+
registry.register('security', () => new SecurityAgent(), {
|
|
231
|
+
name: 'Security',
|
|
232
|
+
description: 'Scans for PII, prompt injection, and dangerous code patterns',
|
|
233
|
+
icon: '🔒',
|
|
234
|
+
isBuiltin: true,
|
|
235
|
+
});
|
|
236
|
+
registry.register('skill-runner', () => new SkillRunnerAgent(), {
|
|
237
|
+
name: 'SkillRunner',
|
|
238
|
+
description: 'Executes a compiled skill as a pre-filled task plan',
|
|
239
|
+
icon: '🧠',
|
|
240
|
+
isBuiltin: true,
|
|
241
|
+
});
|
|
242
|
+
registry.register('mcp', () => new MCPAgent(), {
|
|
243
|
+
name: 'MCP',
|
|
244
|
+
description: 'Invokes MCP (Model Context Protocol) tools from connected servers',
|
|
245
|
+
icon: '🔌',
|
|
246
|
+
isBuiltin: true,
|
|
247
|
+
});
|
|
248
|
+
return registry;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// ─── Global Singleton ───────────────────────────────────────────────────────
|
|
252
|
+
let _globalRegistry = null;
|
|
253
|
+
/**
|
|
254
|
+
* Get or create the global ModuleRegistry singleton.
|
|
255
|
+
*
|
|
256
|
+
* First call creates a registry with all built-in agents pre-registered.
|
|
257
|
+
* Subsequent calls return the same instance.
|
|
258
|
+
* Use `resetModuleRegistry()` to clear and re-initialize (useful in tests).
|
|
259
|
+
*/
|
|
260
|
+
export function getModuleRegistry() {
|
|
261
|
+
if (!_globalRegistry) {
|
|
262
|
+
_globalRegistry = ModuleRegistry.createWithBuiltins();
|
|
263
|
+
}
|
|
264
|
+
return _globalRegistry;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Reset the global module registry.
|
|
268
|
+
* Primarily useful in tests to get a clean slate.
|
|
269
|
+
*/
|
|
270
|
+
export function resetModuleRegistry() {
|
|
271
|
+
_globalRegistry = null;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Set the global module registry (for dependency injection in tests).
|
|
275
|
+
* Returns the previous registry instance (or null).
|
|
276
|
+
*/
|
|
277
|
+
export function setModuleRegistry(registry) {
|
|
278
|
+
const previous = _globalRegistry;
|
|
279
|
+
_globalRegistry = registry;
|
|
280
|
+
return previous;
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=module-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-regist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ager.js';
|
|
20
20
|
import type { TaskStep } from './agent.js';
|
|
21
|
+
import { type ModuleRegistry } from './module-registry.js';
|
|
22
|
+
import type { EventBus } from '../observability/event-bus.js';
|
|
21
23
|
/** Configuration for an orchestration session */
|
|
22
24
|
export interface OrchestratorOptions {
|
|
23
25
|
/** Inference provider type (default: from configManager) */
|
|
@@ -124,7 +126,11 @@ export interface OrchestrationResult {
|
|
|
124
126
|
}
|
|
125
127
|
export declare class Orchestrator {
|
|
126
128
|
private configManager;
|
|
127
|
-
|
|
129
|
+
/** The module registry used for agent lookups */
|
|
130
|
+
private moduleRegistry;
|
|
131
|
+
/** The event bus for emitting observability events */
|
|
132
|
+
private eventBus;
|
|
133
|
+
constructor(configManager?: ConfigManager, moduleRegistry?: ModuleRegistry, eventBus?: EventBus);
|
|
128
134
|
/**
|
|
129
135
|
* Execute a multi-agent pipeline for the given goal.
|
|
130
136
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,OAAO,KAAK,EAA0B,QAAQ,EAAe,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/agents/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,OAAO,KAAK,EAA0B,QAAQ,EAAe,MAAM,YAAY,CAAC;AAOhF,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAoD9D,iDAAiD;AACjD,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,C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