agent-nuvira 2.6.15 → 2.7.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.
Files changed (201) hide show
  1. package/README.md +5 -2453
  2. package/dist/agents/orchestrator.d.ts.map +1 -1
  3. package/dist/agents/orchestrator.js +17 -3
  4. package/dist/agents/orchestrator.js.map +1 -1
  5. package/dist/app.js +26 -0
  6. package/dist/cli/chat.d.ts +2 -0
  7. package/dist/cli/chat.d.ts.map +1 -1
  8. package/dist/cli/chat.js +198 -6
  9. package/dist/cli/chat.js.map +1 -1
  10. package/dist/cli/eval.d.ts.map +1 -1
  11. package/dist/cli/eval.js +14 -1
  12. package/dist/cli/eval.js.map +1 -1
  13. package/dist/cli/execute.d.ts +8 -0
  14. package/dist/cli/execute.d.ts.map +1 -1
  15. package/dist/cli/execute.js +105 -1
  16. package/dist/cli/execute.js.map +1 -1
  17. package/dist/cli/loop-executor.d.ts +81 -0
  18. package/dist/cli/loop-executor.d.ts.map +1 -0
  19. package/dist/cli/loop-executor.js +246 -0
  20. package/dist/cli/loop-executor.js.map +1 -0
  21. package/dist/config/auth.js +18 -0
  22. package/dist/config/jwt.js +24 -0
  23. package/dist/config/keys.js +14 -0
  24. package/dist/config/types.d.ts +18 -0
  25. package/dist/config/types.d.ts.map +1 -1
  26. package/dist/fresh.d.ts +2 -0
  27. package/dist/fresh.d.ts.map +1 -0
  28. package/dist/fresh.js +2 -0
  29. package/dist/fresh.js.map +1 -0
  30. package/dist/gateway/chat-store.d.ts +32 -5
  31. package/dist/gateway/chat-store.d.ts.map +1 -1
  32. package/dist/gateway/chat-store.js +52 -6
  33. package/dist/gateway/chat-store.js.map +1 -1
  34. package/dist/gateway/registry.d.ts.map +1 -1
  35. package/dist/gateway/registry.js +42 -5
  36. package/dist/gateway/registry.js.map +1 -1
  37. package/dist/inference/anthropic-adapter.d.ts +9 -0
  38. package/dist/inference/anthropic-adapter.d.ts.map +1 -1
  39. package/dist/inference/anthropic-adapter.js +143 -0
  40. package/dist/inference/anthropic-adapter.js.map +1 -1
  41. package/dist/inference/gemini-adapter.d.ts +8 -0
  42. package/dist/inference/gemini-adapter.d.ts.map +1 -1
  43. package/dist/inference/gemini-adapter.js +145 -0
  44. package/dist/inference/gemini-adapter.js.map +1 -1
  45. package/dist/inference/model-probe.d.ts.map +1 -1
  46. package/dist/inference/model-probe.js +14 -0
  47. package/dist/inference/model-probe.js.map +1 -1
  48. package/dist/inference/model-validator.d.ts.map +1 -1
  49. package/dist/inference/model-validator.js +11 -1
  50. package/dist/inference/model-validator.js.map +1 -1
  51. package/dist/inference/native-tools.d.ts +226 -0
  52. package/dist/inference/native-tools.d.ts.map +1 -0
  53. package/dist/inference/native-tools.js +389 -0
  54. package/dist/inference/native-tools.js.map +1 -0
  55. package/dist/inference/tool-call-utils.d.ts +31 -0
  56. package/dist/inference/tool-call-utils.d.ts.map +1 -1
  57. package/dist/inference/tool-call-utils.js +41 -0
  58. package/dist/inference/tool-call-utils.js.map +1 -1
  59. package/dist/learning/auto-router.d.ts +36 -4
  60. package/dist/learning/auto-router.d.ts.map +1 -1
  61. package/dist/learning/auto-router.js +103 -2
  62. package/dist/learning/auto-router.js.map +1 -1
  63. package/dist/learning/context-pruner.d.ts.map +1 -1
  64. package/dist/learning/context-pruner.js +4 -2
  65. package/dist/learning/context-pruner.js.map +1 -1
  66. package/dist/learning/engine-router.d.ts +90 -0
  67. package/dist/learning/engine-router.d.ts.map +1 -0
  68. package/dist/learning/engine-router.js +128 -0
  69. package/dist/learning/engine-router.js.map +1 -0
  70. package/dist/learning/eval-framework.d.ts +42 -1
  71. package/dist/learning/eval-framework.d.ts.map +1 -1
  72. package/dist/learning/eval-framework.js +163 -7
  73. package/dist/learning/eval-framework.js.map +1 -1
  74. package/dist/learning/reasoning-trace.d.ts +5 -3
  75. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  76. package/dist/learning/reasoning-trace.js +2 -2
  77. package/dist/learning/reasoning-trace.js.map +1 -1
  78. package/dist/learning/routing-cache.d.ts +64 -0
  79. package/dist/learning/routing-cache.d.ts.map +1 -0
  80. package/dist/learning/routing-cache.js +100 -0
  81. package/dist/learning/routing-cache.js.map +1 -0
  82. package/dist/middleware/auth.js +30 -0
  83. package/dist/nlu/intent.d.ts.map +1 -1
  84. package/dist/nlu/intent.js +20 -3
  85. package/dist/nlu/intent.js.map +1 -1
  86. package/dist/passport.js +34 -0
  87. package/dist/routes/auth.js +42 -0
  88. package/dist/routes/user.js +31 -0
  89. package/dist/server.js +17 -0
  90. package/dist/tools/loop-project-context.d.ts +47 -0
  91. package/dist/tools/loop-project-context.d.ts.map +1 -0
  92. package/dist/tools/loop-project-context.js +210 -0
  93. package/dist/tools/loop-project-context.js.map +1 -0
  94. package/dist/tools/loop-skill-hint.d.ts +110 -0
  95. package/dist/tools/loop-skill-hint.d.ts.map +1 -0
  96. package/dist/tools/loop-skill-hint.js +266 -0
  97. package/dist/tools/loop-skill-hint.js.map +1 -0
  98. package/dist/tools/pipeline-tool.d.ts.map +1 -1
  99. package/dist/tools/pipeline-tool.js +14 -0
  100. package/dist/tools/pipeline-tool.js.map +1 -1
  101. package/dist/tools/registry.d.ts +10 -0
  102. package/dist/tools/registry.d.ts.map +1 -1
  103. package/dist/tools/registry.js +66 -9
  104. package/dist/tools/registry.js.map +1 -1
  105. package/dist/tools/release-sync.d.ts +52 -16
  106. package/dist/tools/release-sync.d.ts.map +1 -1
  107. package/dist/tools/release-sync.js +143 -78
  108. package/dist/tools/release-sync.js.map +1 -1
  109. package/dist/tools/tool-loop.d.ts +28 -0
  110. package/dist/tools/tool-loop.d.ts.map +1 -1
  111. package/dist/tools/tool-loop.js +182 -6
  112. package/dist/tools/tool-loop.js.map +1 -1
  113. package/dist/tools/toolsets.d.ts +33 -0
  114. package/dist/tools/toolsets.d.ts.map +1 -1
  115. package/dist/tools/toolsets.js +84 -0
  116. package/dist/tools/toolsets.js.map +1 -1
  117. package/dist/web-dashboard/chat-console.d.ts +31 -0
  118. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  119. package/dist/web-dashboard/chat-console.js +73 -0
  120. package/dist/web-dashboard/chat-console.js.map +1 -1
  121. package/dist/web-dashboard/loop-turn-telemetry.d.ts +27 -0
  122. package/dist/web-dashboard/loop-turn-telemetry.d.ts.map +1 -0
  123. package/dist/web-dashboard/loop-turn-telemetry.js +43 -0
  124. package/dist/web-dashboard/loop-turn-telemetry.js.map +1 -0
  125. package/dist/web-dashboard/server.d.ts +62 -1
  126. package/dist/web-dashboard/server.d.ts.map +1 -1
  127. package/dist/web-dashboard/server.js +205 -4
  128. package/dist/web-dashboard/server.js.map +1 -1
  129. package/dist/web-dashboard/src/App.js +85 -0
  130. package/dist/web-dashboard/src/admin-auth.test.js +186 -0
  131. package/dist/web-dashboard/src/ansi.js +23 -0
  132. package/dist/web-dashboard/src/ansi.test.js +31 -0
  133. package/dist/web-dashboard/src/api-admin-auth.test.js +172 -0
  134. package/dist/web-dashboard/src/api-admin.test.js +65 -0
  135. package/dist/web-dashboard/src/api-hub.test.js +117 -0
  136. package/dist/web-dashboard/src/api.js +1421 -0
  137. package/dist/web-dashboard/src/api.test.js +51 -0
  138. package/dist/web-dashboard/src/artifacts.js +128 -0
  139. package/dist/web-dashboard/src/artifacts.test.js +139 -0
  140. package/dist/web-dashboard/src/components/AdminPanel.js +567 -0
  141. package/dist/web-dashboard/src/components/AdminPanel.test.js +288 -0
  142. package/dist/web-dashboard/src/components/AgentHub.js +1580 -0
  143. package/dist/web-dashboard/src/components/AgentHub.test.js +343 -0
  144. package/dist/web-dashboard/src/components/BedrockOnboarding.js +320 -0
  145. package/dist/web-dashboard/src/components/BenchmarkCharts.js +228 -0
  146. package/dist/web-dashboard/src/components/ChatPage.js +1586 -0
  147. package/dist/web-dashboard/src/components/ChatPage.test.js +899 -0
  148. package/dist/web-dashboard/src/components/ContactsPage.js +141 -0
  149. package/dist/web-dashboard/src/components/CostDashboard.js +105 -0
  150. package/dist/web-dashboard/src/components/DAGView.js +477 -0
  151. package/dist/web-dashboard/src/components/DAGView.test.js +147 -0
  152. package/dist/web-dashboard/src/components/EnvVarEditor.js +138 -0
  153. package/dist/web-dashboard/src/components/EvalsPage.js +73 -0
  154. package/dist/web-dashboard/src/components/EvalsPage.test.js +120 -0
  155. package/dist/web-dashboard/src/components/ExecutionHistory.js +201 -0
  156. package/dist/web-dashboard/src/components/GatewayPage.js +40 -0
  157. package/dist/web-dashboard/src/components/GatewayPage.test.js +74 -0
  158. package/dist/web-dashboard/src/components/HealthPanel.js +68 -0
  159. package/dist/web-dashboard/src/components/HistoryBrowser.js +34 -0
  160. package/dist/web-dashboard/src/components/Layout.js +50 -0
  161. package/dist/web-dashboard/src/components/Markdown.js +152 -0
  162. package/dist/web-dashboard/src/components/Markdown.test.js +126 -0
  163. package/dist/web-dashboard/src/components/MarkdownZeroDep.js +237 -0
  164. package/dist/web-dashboard/src/components/MemoryPanel.js +81 -0
  165. package/dist/web-dashboard/src/components/ModelTimeline.js +298 -0
  166. package/dist/web-dashboard/src/components/ModelsPanel.js +1484 -0
  167. package/dist/web-dashboard/src/components/ModelsPanel.test.js +460 -0
  168. package/dist/web-dashboard/src/components/Overview.js +123 -0
  169. package/dist/web-dashboard/src/components/PhaseTimeline.js +359 -0
  170. package/dist/web-dashboard/src/components/PhaseTimeline.test.js +234 -0
  171. package/dist/web-dashboard/src/components/PlatformConfigSection.js +384 -0
  172. package/dist/web-dashboard/src/components/PlatformConfigSection.test.js +106 -0
  173. package/dist/web-dashboard/src/components/PlatformsPage.js +250 -0
  174. package/dist/web-dashboard/src/components/QuotaPanel.js +159 -0
  175. package/dist/web-dashboard/src/components/QuotaPanel.test.js +85 -0
  176. package/dist/web-dashboard/src/components/RequestsPanel.js +229 -0
  177. package/dist/web-dashboard/src/components/RequestsPanel.test.js +103 -0
  178. package/dist/web-dashboard/src/components/RoutingInsightsPanel.js +938 -0
  179. package/dist/web-dashboard/src/components/RoutingInsightsPanel.test.js +339 -0
  180. package/dist/web-dashboard/src/components/RoutingWalkthrough.js +408 -0
  181. package/dist/web-dashboard/src/components/RoutingWalkthrough.test.js +209 -0
  182. package/dist/web-dashboard/src/components/TaskConsole.js +119 -0
  183. package/dist/web-dashboard/src/components/TaskConsole.test.js +123 -0
  184. package/dist/web-dashboard/src/components/TasksPage.js +256 -0
  185. package/dist/web-dashboard/src/components/TasksPage.test.js +103 -0
  186. package/dist/web-dashboard/src/components/TracePanel.js +306 -0
  187. package/dist/web-dashboard/src/components/WhatsAppPanel.js +195 -0
  188. package/dist/web-dashboard/src/components/WhatsAppPanel.test.js +122 -0
  189. package/dist/web-dashboard/src/jsonOrNull.js +37 -0
  190. package/dist/web-dashboard/src/main.js +15 -0
  191. package/dist/web-dashboard/src/mask.js +11 -0
  192. package/dist/web-dashboard/src/types.d.ts +44 -0
  193. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  194. package/dist/web-dashboard/vite.config.js +23 -0
  195. package/dist/web-dashboard/vitest.config.js +15 -0
  196. package/package.json +5 -3
  197. package/src/web-dashboard/public/assets/{index-Cg9LaToa.js → index-C4frng1Q.js} +79 -79
  198. package/src/web-dashboard/public/assets/{index-Cg9LaToa.js.map → index-C4frng1Q.js.map} +1 -1
  199. package/src/web-dashboard/public/assets/index-C507EUWf.css +1 -0
  200. package/src/web-dashboard/public/index.html +2 -2
  201. package/src/web-dashboard/public/assets/index-B47v8pr1.css +0 -1
package/README.md CHANGED
@@ -1,2455 +1,7 @@
1
- # ---
2
- name: agent-nuvira
3
- short_description: "Autonomous AI agent — codes, creates, writes, analyzes, and automates anything"
4
- architecture: "multi-agent pipeline"
5
- agents: "Swarm (100+ agents, consensus)"
6
- orchestration: "Sequential sub-agent pipeline"
7
- orchestration_details: "planner, gatherer, writer, reviewer, tester, security auditor; GOAP & swarm topologies"
8
- memory: "Persistent AgentDB (vector DB) + JSON cache; optional session-only modes"
9
- parallel_execution: "Yes (parallel agent execution & async pipelines)"
10
- security_guardrails:
11
- - "Privacy-focused"
12
- - "AI Defence (prompt injection, PII detection)"
13
- - "Security scan CLI"
14
- publishing: "Standalone eject available; npm publishing & npx installer"
15
- features:
16
- - "multi-provider routing"
17
- - "native FAISS backend"
18
- - "checkpoint and resume"
19
- - "plugin marketplace"
20
- ---
1
+ # Nuviraconfig API
21
2
 
22
- # Agent-Nuvira `agent-nuvira`
3
+ This repository demonstrates a minimal Express API with JWT authentication
4
+ configured via environment variables. The configuration is split into
5
+ separate modules for clarity and testability.
23
6
 
24
- > **Developed by Dheeraj Sharma <imdheeraj@gmail.com>**
25
-
26
- **Autonomous AI agent** with a **visual dashboard** and **powerful CLI** — codes, creates, writes, analyzes, and automates anything. Run models locally (Ollama) or route across 22+ cloud providers (Groq, Gemini, OpenRouter, Bedrock, Azure, Anthropic, OpenAI, and more). Specialized agents plan, write, review, test, create images, generate videos, write documents, and ship code — learning from every run.
27
-
28
- ```bash
29
- # Quick examples
30
- agent-nuvira chat "explain recursion in Rust"
31
- agent-nuvira chat "write a birthday poem for my daughter"
32
- agent-nuvira chat "generate an image of a sunset over mountains"
33
- agent-nuvira models --provider groq
34
- agent-nuvira edit main.go --instruction "add input validation"
35
- agent-nuvira plan . --task "implement user authentication"
36
- agent-nuvira config list
37
- ```
38
-
39
- ---
40
-
41
- ## Feature Matrix (concise)
42
-
43
- This table highlights core capabilities for quick machine parsing and comparison.
44
-
45
- | Feature | Agent-Nuvira |
46
- |---|---|
47
- | Architecture | Multi-agent pipeline; Swarm (100+ agents, consensus) |
48
- | Orchestration | Sequential sub-agent pipeline; GOAP & swarm topologies |
49
- | Memory | Persistent AgentDB (vector DB) + JSON cache; optional session-only modes |
50
- | Parallel execution | Yes — parallel agent execution and async pipelines |
51
- | Security guardrails | Privacy-focused; PII detection; prompt-injection defenses; security scan CLI |
52
- | Publishing | Standalone eject & npm publishing (`npx agent-nuvira`) |
53
- | **Routing strategy** | **Model-first scoring (6 dimensions) + tiered failover + 1-token warmup + Thompson-sampling bandit + quota pre-check + 22 providers + 300+ models** |
54
- | **Test suite** | **5,000+ tests across 220+ files — 100% passing** |
55
- | **Vector backend** | **Native FAISS (automatic), pure-JS IVF fallback, exact JSON fallback** |
56
-
57
-
58
- ## Why Agent-Nuvira? (The Core Edge)
59
-
60
- - **🎯 Understands what you asked — then shows you the contract before it runs** — every
61
- request in `chat`, `execute`, `plan`, and `edit` resolves through one shared understanding
62
- layer: a deterministic rule fast-path (<5ms, works offline) with LLM verification behind it,
63
- collapsing to a single action every command consumes identically. Before any work begins,
64
- Agent-Nuvira prints a 🧠 Understanding card — the resolved goal, target, scope, acceptance
65
- criteria, and risk flags — so the request is **seen before it is run**. The live activity
66
- board then renders each agent step as it happens — no black box, no silently
67
- half-understood goals
68
- - **🛠️ Execution that repairs itself** — a failed task is not just reported: failures are
69
- classified, automatically repaired with escalating retries, independently verified after the
70
- fix, and the lesson is stored in persistent failure memory so the same mistake is less likely
71
- next time. Runs finish — or they tell you exactly why and what to do next
72
- - **🪙 Model-First Smart Routing** — stop paying flat premium fees. Nuvira dynamically routes every task across **22 providers** and **300+ discovered models** using **model-first scoring** (not provider-first). Each model is scored on 6 dimensions: cost per million tokens, capability fit, health, quota availability, provider speed, and verification status. The router picks the BEST MODEL for the task, then finds which provider serves it cheapest. **Tiered failover** with quota pre-check: same model → same tier → escalate → de-escalate → local → neural response. **1-token warmup daemon** keeps frequently-used models hot. A **central quota ledger** tracks tokens per provider × model with calendar-aware reset windows, parks exhausted providers until free quota resets, and **auto-fails-over mid-session** when a token expires or a rate limit hits — never a stuck session, never a quota error thrown at you
73
- - **🧠 Learning Router that gets better with use** — a Thompson-sampling bandit learns per provider × complexity bucket from *real* task outcomes (cost-adjusted rewards), with hard constraints (`maxCostUsd`, `minSpeed`, `minReasoning`), regex routing rules, uncertainty-driven escalation when the bandit has no data, and **promotion gates** that only keep router changes that measurably improve quality without regressing cost
74
- - **🐝 17 Specialized Agent Swarm** — no generic single-prompt boxes. Your goal is decomposed into a DAG of tasks handled by dedicated agents working in parallel: Planner, Context-Gatherer, Writer, Reviewer, Runner, Tester, Debugger, Security Auditor, Git/GitLab specialist, Package installer, PR Reviewer, Issue Triage, Branch Automation, and more
75
- - **⚡ Deterministic Tier-0 routing** — mechanical edits (remove `console.log`, rename symbols, dedupe imports) complete in **<1ms for $0**, AST-validated before apply, and never touch an LLM unless the goal genuinely needs one
76
- - **🧠 Local FAISS Context Indexing** — blazing-fast, private, semantic code search and retrieval with an optional **native FAISS backend** (pure-JS fallback) that strictly respects your `.gitignore`. Retrieval shrinks a 20k-token gathered context to the top-k relevant chunks — saving tokens so free quotas stretch further
77
- - **📌 Persistent project memory** — facts, preferences, and trajectories are stored per project and recalled automatically in later sessions; memory is pluggable (local by default, external backends optional)
78
- - **🔌 First-Class MCP Integration** — seamlessly connect to Jira, Slack, PostgreSQL, GitHub Issues, and file systems using standard Model Context Protocol servers with SSE transport
79
- - **👥 Real-Time Team Collaboration** — share context, synchronized vector indices, custom agents, and review pipelines across your engineering team via Git-synced config and memory
80
- - **🎨 Adaptive Modality Routing** — intelligent routing for image/audio/video with failover across backends. **Data-driven providers** — add new providers via config, no code changes required. Image: ComfyUI (free) → Pollinations (free) → DALL-E (paid) → Stability (paid). TTS: OpenAI TTS (paid) → ElevenLabs (paid). Video: FAL (paid) → Runway (paid). Transcription: OpenAI Whisper (paid). Users can add custom providers:
81
- ```bash
82
- # Add Replicate for image generation
83
- nuvira config set modality.image.replicate.apiKey=r8_xxxxx
84
- nuvira config set modality.image.replicate.baseUrl=https://api.replicate.com/v1
85
- nuvira config set modality.image.replicate.models="stability-ai/sdxl"
86
-
87
- # Add Azure TTS
88
- nuvira config set modality.tts.azure.apiKey=xxxxx
89
- nuvira config set modality.tts.azure.region=eastus
90
- ```
91
- - **🖥️ Runs anywhere** — zero native dependencies, tested on macOS / Windows / Linux (3,806 tests), no server, no telemetry, no subscriptions, and bring-your-own-keys for every provider. For the reasoning behind the architecture, see [DESIGN_DECISIONS.md](DESIGN_DECISIONS.md). For benchmark results, see [docs/benchmarks/INDEX.md](docs/benchmarks/INDEX.md)
92
-
93
- ---
94
-
95
- ## Features
96
-
97
- - **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)
98
- - **Model discovery** — `agent-nuvira models` lists available models from any configured provider, with search/filter support
99
- - **Interactive chat** with conversation history, file context, and session commands
100
- - **AI-assisted file editing** with dry-run mode for safe previews
101
- - **Codebase planning** that analyzes directory structure and generates implementation plans
102
- - **Multi-agent orchestration** — `agent-nuvira execute "goal"` runs a pipeline of planner, gatherer, writer, reviewer, tester, and more
103
- - **Response caching** via SQLite to reduce costs and latency
104
- - **Plugin system** with auto-discovery — drop `.js` files into `~/.nuvira/plugins/` for automatic loading
105
- - **Project scaffolding** — `agent-nuvira init` generates starter projects with interactive template + provider selection
106
- - **Context-preserving model switching** — `agent-nuvira model switch` changes providers mid-session without losing agent state
107
- - **Auto model routing** — `agent-nuvira model switch auto` lets the agent pick the best provider/model for every task based on complexity, cost, latency, privacy, and reliability (with fallback chains + circuit-breaker awareness). Cost scoring uses **real per-1K-token provider pricing** (overridable via `agent-nuvira config set pricing.<provider>.inputPer1K`), adjusted at runtime by **benchmark quality + per-agent best-model stats**. See why a decision was made with `agent-nuvira model explain` (or `--json` for CI) — walk through a full decision with the 🎯 fit / 📏 measured / ⏳ ctx chips in [`MODELS_EXPLAIN_DEMO.md`](MODELS_EXPLAIN_DEMO.md). Benchmark the router's exact picks with `agent-nuvira benchmark --routing`, validate them end-to-end with `agent-nuvira eval --routing`, and track actual picks + a full audit trail in the dashboard's **Routing** panel
108
- - **Learned-from-real-usage telemetry** — every LLM call (chat, execute, plan, edit, skill, learn, ci, doctor) writes through to the Model Availability Registry **with its action tag**, so the registry learns which provider × model each action **killed** (predictive skip) or **verified** (routable) from real usage — not just probes. `agent-nuvira models status --verbose` prints registry-blocked providers + per-action verified/killed chips, and the dashboard's **Models** panel shows the same per-action feed with a daily timeline chart. A provider killed by ANY action is skipped predictively by all others; a later real success re-verifies it and un-parks it (the recovery loop), and `agent-nuvira models unblock <provider>` is the manual escape hatch (demotes the block, clears quota parks + ledger cooldown, then re-probes the live API with an honest `stillBlocked` verdict — `--json` for CI). Proven end-to-end by a hermetic `tests/e2e/` test (mock 429 provider → registry learns → next pick skips). The **VS Code extension** attributes its usage too — every IDE-driven call (chat panel → `ide-chat`, inline suggestions → `ide-inline`, execute/edit/workflow → `ide-<command>`) is tagged via `BUFF_TELEMETRY_ACTION` at spawn, so the same per-action panel shows IDE usage as its own rows
109
- - **Skill compiler** — automatically extracts reusable patterns from successful agent runs into executable skills (`agent-nuvira skill run`)
110
- - **Context-window memory pruner** — prevents long multi-agent chains from exceeding model token limits
111
- - **Complete streaming support** — all 17+ providers support real-time token-by-token output
112
- - **Cost tracking** — per-provider/session/monthly costs with `agent-nuvira stats cost`
113
- - **Prompt history search** — keyword and semantic search across past conversations (`/search`, `agent-nuvira history`)
114
- - **Native embedding support** — 3-tier embedder with `@huggingface/transformers` for 10x faster semantic search
115
- - **Workflow template marketplace** — 10 built-in templates + GitHub registry with install/publish lifecycle
116
- - **Model benchmarking** — 21 standardized coding tasks with scoring and A/B comparison
117
- - **Docker sandbox isolation** — resource-limited, network-isolated container execution with 8 base images
118
- - **Provider health dashboard** — `agent-nuvira doctor` with color-coded status, watch mode, and auto-fix
119
- - **Memory compression & pruning** — automatic trajectory summarization with configurable retention policies
120
- - **VS Code extension** — Chat Panel with streaming responses, slash commands, and session history;
121
- Diagnostic → AI Fix from lightbulb menu; Code Lens actions (Test/Review/Explain/Fix) above functions
122
- and classes; 9 commands, inline code suggestions, diff viewer, agent progress panel
123
- - **22-platform multi-channel gateway** — `agent-nuvira gateway start / send / status / alias` runs the agent from Telegram, Discord, Slack, WhatsApp (Cloud API + Baileys personal bridge), Email, Signal, DingTalk, Feishu, WeCom, Mattermost, Matrix, generic Webhook, BlueBubbles (iMessage), ntfy, Teams, Google Chat, Weixin, SMS (Twilio), IRC (two-way), SimpleX (two-way), and Home Assistant — all opt-in via standard env vars per platform, with a guaranteed delivery ledger (auto-retry on `agent-nuvira gateway start`), the dashboard Channels send-test, and a `X/22 platforms configured` status line
124
- - **Remote agent federation** — multi-machine collaboration with protocol, server, and client
125
- - **Web UI dashboard** — React dashboard with DAG visualization, model health, cost charts, and history browser
126
- - **Hybrid model routing** — intelligent model selection based on task complexity, cost, and availability
127
- - **Team collaboration** — Git-synced shared config, memory, and review pipelines
128
- - **Agent SDK** — `@agent-nuvira/sdk` npm package for building custom agents with scaffolding CLI
129
- - **Provider CLI** — `agent-nuvira provider list` with color-coded status table, `agent-nuvira provider health` with per-provider diagnostics
130
- - **Provider fallback routing** — automatic failover between providers with circuit breaker and configurable chain
131
- - **Startup progress feedback** — first launch never looks like a silent hang: a live spinner reports each startup phase (plugins → history & search → semantic index) as it runs
132
- - **Auto-mode session failover** — in Auto routing, a provider whose API key/token expires or rate-limits mid-session is automatically swapped for the next-best provider (auth failures excluded for the session, rate-limit failures for a 120s cooldown, 5xx/network through the circuit breaker) — no more stuck sessions on a dead key
133
- - **Central quota ledger** — tokens/requests per provider × model with calendar-aware reset windows; exhausted providers are **parked** until the window rolls (auto re-enable, no timers), and Auto routing sinks parked providers below healthy candidates **before** a call — plus an optional free/local-first `allowPaid` gate and a `agent-nuvira model quota` CLI with a cost summary (free vs paid tokens + estimated $ saved)
134
- - **Learning Router CLI** — `agent-nuvira model bandit` inspects the Thompson-sampling state (α/β priors per provider × complexity bucket, expected win %, learning history, `--json` for CI) and `agent-nuvira model bandit reset` clears it; routing decisions record a `routedBy` source (`heuristic | rule | bandit`) for full auditability
135
- - **Routing rules & hard constraints** — regex/string task-pattern rules force a provider/model before scoring (first match wins); per-call filters (`routing.maxCostUsd`, `routing.minSpeed`, `routing.minReasoning`) *eliminate* violating providers with a safe fallback when constraints would remove everything
136
- - **Deterministic Tier-0 routing** — mechanical edits short-circuit the LLM entirely (strip `console.*` lines, word-boundary symbol renames, import dedupes) with AST validation and graceful fallthrough to the LLM when a goal isn't mechanical — `$0` and `<1ms` per edit
137
- - **Native FAISS vector backend** — `agent-nuvira memory backend` shows the active backend (`faiss-native` / `faiss-ivf` / `json`) and why it was chosen; `--check` runs a native-FAISS availability probe with install guidance, and `@faiss-node/native` is used automatically whenever it builds
138
- - **Vector retrieval (token-efficient context)** — large gathered contexts are chunked, embedded locally (`bge-small-en-v1.5` via @huggingface/transformers, zero new deps) and reduced to the top-k semantically-relevant chunks before the LLM call — saving tokens so free quotas stretch further. Complements the quota ledger: **retrieval saves tokens, the ledger manages quotas**. Small contexts pass through untouched (zero overhead); any retrieval failure fails over to full context. `agent-nuvira retrieval index/query/stats/clear` + a dashboard Retrieval card show the savings
139
- - **Checkpoint / resume** — `agent-nuvira execute "<goal>" --checkpoint` saves a resume-able snapshot after every task batch; `--resume [id]` rehydrates the plan and continues from the first pending step (a crash / quota kill / token expiry mid-pipeline no longer restarts the whole plan); `--checkpoint-list` shows saved pipelines
140
- - **Security scan CLI** — `agent-nuvira security scan` detects PII, prompt injections, and dangerous code patterns
141
- - **Feedback & rating system** — `agent-nuvira feedback record/list/stats/clear` drives self-improvement scoring
142
- - **Marketplace unified CLI** — `agent-nuvira marketplace browse/search/install/info` for workflow templates + plugins
143
- - **MCP (Model Context Protocol) integration** — connect to databases, APIs, and file systems via MCP servers with SSE transport support
144
- - **AST-aware code editing** — structural analysis engine understands functions, classes, methods across JS/TS/Python/Go/Rust
145
- - **Auto error-repair engine** — automatic diagnosis and repair of test failures with configurable retry budgets
146
- - **Cross-platform dependency installer (Runner)** — auto-detects 11 manifest types (npm/pnpm/yarn with
147
- lockfile-first priority, pip, bundler, cargo, go, composer, dart pub), installs missing project dependencies
148
- on failed commands, and bootstrap-installs missing package managers (npm, pip, bundler, cargo, go, composer,
149
- dart, Homebrew) via brew/apt/dnf/yum/winget/choco/rustup — no manual setup required
150
- - **A2A (Agent-to-Agent) Protocol** — inter-agent communication standard for multi-machine collaboration
151
- - **CI/CD headless mode** — `agent-nuvira ci` for automated pipelines with GitHub Actions integration
152
- - **npm publishing & one-line install** — `npx agent-nuvira` and `npx buff` for zero-setup onboarding
153
- - **Marketing website** — `website/` directory with a full landing page, SEO meta tags, and Netlify-ready deployment config
154
- - **Branch Automation Hooks (Pillar A4)** — `agent-nuvira execute "install branch hooks" --auto-branch` installs
155
- git post-checkout and pre-commit hooks for automated branch workflows; issue-driven branch creation
156
- (`feat/PROJ-123-description`), PR label-triggered updates, file-watch auto-commit with conventional
157
- commit messages, and CI failure detection with LLM diagnosis
158
- - **Issue Triage Engine (Pillar A3)** — Automated issue classification, prioritization, and labeling
159
- across GitHub and GitLab via `agent-nuvira execute "triage issues"` with LLM-powered analysis
160
- - **GitHub PR Review Agent (Pillar A2)** — Automatic inline code review on open PRs; reads diffs,
161
- runs security/quality verification, and posts inline review comments via GitHub API
162
- - **GitLab API Integration (Pillar A1)** — Full GitLab agent for merge request management, issue
163
- discovery, pipeline monitoring, and code review comments
164
- - **Chat Panel DAG Pipeline Visualization (Pillar B6)** — Live multi-agent pipeline visualization
165
- inline in chat messages for slash commands, showing agent nodes with real-time status updates
166
- - **Real-Time Token Streaming in AgentPanel (Pillar B2)** — Live typewriter-effect token streaming
167
- with blinking cursor and animated progress indicator in the agent progress panel
168
- - **Interactive development mode** — `agent-nuvira execute` without a goal launches a guided interactive loop with session save/resume, follow-up suggestions, and failure analysis
169
- - **Session persistence** — save and resume development sessions across CLI restarts with full history
170
- - **Failure analysis** — automatic diagnosis of agent failures with specific recovery options per agent type
171
- - **Follow-up suggestions** — LLM-powered contextual next-step recommendations after goal completion
172
- - **Configuration** via JSON config file + environment variables
173
- - **No server dependency** — no telemetry, no subscriptions, no outbound calls to a hosted backend
174
-
175
- ---
176
-
177
- ## Quick Start
178
-
179
- ### Prerequisites
180
-
181
- - **Node.js** 20+ and **npm**
182
- - **TypeScript** knowledge for development; none required to use the CLI
183
-
184
- ### Install
185
-
186
- ```bash
187
- # Install globally
188
- npm install -g agent-nuvira
189
-
190
- # Or clone and build from source
191
- git clone https://github.com/imdheerajKube/agent-nuvira.git buff
192
- cd agent-nuvira
193
- npm install
194
- npm run build
195
- npm link
196
- ```
197
-
198
- ### One-command setup for new users (recommended)
199
-
200
- If you're setting up on a **fresh machine** (or just don't want to deal with
201
- installing Node.js, Git, build tools, etc. by hand), use the platform setup
202
- script. Each one **checks for the required tools, installs anything missing
203
- for you, installs Agent-Nuvira, and then asks whether you want the optional
204
- performance upgrades** (native FAISS + local embeddings) — with plain-English
205
- prompts the whole way.
206
-
207
- | OS | Run this |
208
- |---|---|
209
- | **macOS** | `bash <(curl -fsSL https://raw.githubusercontent.com/imdheerajKube/agent-nuvira/main/scripts/setup/install-macos.sh)` |
210
- | **Linux** (Ubuntu/Debian/Fedora/RHEL/Arch/Alpine) | `bash <(curl -fsSL https://raw.githubusercontent.com/imdheerajKube/agent-nuvira/main/scripts/setup/install-linux.sh)` |
211
- | **Windows** (PowerShell) | `Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force; irm https://raw.githubusercontent.com/imdheerajKube/agent-nuvira/main/scripts/setup/install-windows.ps1 | iex` |
212
-
213
- What each script does:
214
-
215
- 1. **Detects what's missing** — Node.js, npm, Git, build tools (and Homebrew on
216
- macOS / `winget` on Windows), and installs them automatically (with your
217
- confirmation) using the right installer for your OS.
218
- 2. **Installs Agent-Nuvira** — `npm install -g agent-nuvira` (with npm 11's
219
- install-script security gate handled automatically so native components build).
220
- 3. **Asks about optional upgrades** (recommended, each a yes/no):
221
- - **Native FAISS** → faster semantic search / memory recall
222
- - **Local embeddings** → free, offline, private embeddings (no cloud call)
223
- 4. **Verifies** the install and prints next steps.
224
-
225
- > The scripts are safe to re-run — they skip tools that are already present.
226
- > Manual install instructions for every step are below for those who prefer
227
- > full control.
228
-
229
- ### Native FAISS acceleration (optional, recommended)
230
-
231
- Agent-Nuvira includes an optional native FAISS backend for faster semantic retrieval. The runtime prefers this backend automatically when the native addon can build successfully; if that path is unavailable, it falls back to the pure-JS IVF implementation and then the exact JSON backend so your workflow stays reliable.
232
-
233
- > **How the auto-selection works:** At load time, `createFaissBackend()`
234
- > attempts to import `@faiss-node/native` and run a 1-vector smoke test.
235
- > If the native addon exists and passes the smoke test, the backend is
236
- > `faiss-native`. If the import fails (not installed, build error, or wrong
237
- > API), it falls back to the pure-JS IVF-flat ANN (`faiss-ivf`). If that
238
- > also fails to initialize, the exact JSON backend (`json`) is used as the
239
- > final safety net — semantic search NEVER breaks.
240
-
241
- For npm-installed users, the setup is:
242
-
243
- ```bash
244
- # 1) Install the CLI
245
- npm install -g agent-nuvira
246
-
247
- # 2) Install the native build prerequisites (macOS example)
248
- brew install faiss libomp openblas
249
-
250
- # 3) Rebuild the optional native addon
251
- npm rebuild @faiss-node/native
252
-
253
- # 4) Enable the FAISS-style backend (or leave it on 'auto' to prefer it automatically)
254
- # 'auto' (default) — tries native FAISS first, then pure-JS IVF, then JSON
255
- # 'faiss' — prefer FAISS-style (native or pure-JS IVF); JSON fallback
256
- # 'json' — exact flat cosine (the original behavior, no FAISS at all)
257
- agent-nuvira config set memory.vectorBackend auto
258
- # or force it explicitly:
259
- # agent-nuvira config set memory.vectorBackend faiss
260
- ```
261
-
262
- If you want to confirm the backend in use:
263
-
264
- ```bash
265
- agent-nuvira memory stats # Shows active backend
266
- agent-nuvira memory backend # Active backend name + why it was chosen
267
- agent-nuvira memory backend --check # Same + native availability probe + install guidance
268
- ```
269
-
270
- ### Understanding the FAISS tiers
271
-
272
- | Tier | Backend name | When it's used | Performance |
273
- |---|---|---|---|
274
- | **1 — Native FAISS** | `faiss-native` | `@faiss-node/native` installed AND built successfully | Fastest — real FAISS C++ bindings |
275
- | **2 — Pure-JS IVF** | `faiss-ivf` | Native not available; runs TypeScript port of FAISS IndexIVFFlat | Approximate ANN; sub-linear search for large indexes |
276
- | **3 — Exact JSON** | `json` | Both FAISS paths unavailable; flat cosine scan | Exact results; O(n) linear scan |
277
-
278
- The pure-JS IVF tier uses deterministic k-means++ clustering (nlist=sqrt(n)),
279
- inner product of L2-normalized vectors (= cosine similarity), and nprobe probe
280
- lists. For small indexes (≤ 512 entries) it runs an exact scan so results are
281
- identical to the JSON backend. Filter-aware probe expansion ensures that
282
- metadata filters don't miss results.
283
-
284
- If the native addon cannot be built on your machine, Agent-Nuvira will continue to work using the pure-JS fallback path.
285
-
286
- ### Local embeddings (optional, recommended)
287
-
288
- Semantic search and memory recall use embeddings. Agent-Nuvira's embedder has a
289
- 3-tier strategy and **always prefers the local tier when it works**:
290
-
291
- | Tier | Engine | Notes |
292
- |---|---|---|
293
- | **1 — Local** | `@huggingface/transformers` (`onnxruntime-node`) | Free, offline, private — `Xenova/all-MiniLM-L6-v2` (384-dim). **Default when available** |
294
- | **2 — Python** | `sentence-transformers` via subprocess | Used when Tier 1 is unavailable and Python is present |
295
- | **3 — LLM** | Any configured inference provider | Last-resort fallback; costs tokens |
296
-
297
- With `@huggingface/transformers` installed and its native binary present, no
298
- configuration is needed — local embeddings are used automatically, offline,
299
- with zero API cost. The one-command setup scripts above enable this for you.
300
- To verify which tier is active, run:
301
-
302
- ```bash
303
- agent-nuvira memory backend --check
304
- ```
305
-
306
- ### Verify
307
-
308
- ```bash
309
- agent-nuvira --help
310
- ```
311
-
312
- You should see:
313
-
314
- ```
315
- Usage: agent-nuvira [options] [command]
316
-
317
- Flexible AI inference CLI tool — local models & cloud APIs
318
-
319
- Options:
320
- -V, --version output the version number
321
- -d, --debug enable debug logging
322
- -h, --help display help for command
323
-
324
- Commands:
325
- chat [options] [prompt] Start an interactive chat session with AI
326
- edit [options] <file> Edit a file using AI assistance
327
- models [options] List available models from inference providers
328
- plan [options] [target] Generate an implementation plan for a codebase task
329
- execute [options] <goal> Execute a multi-agent pipeline for a goal
330
- model Switch providers and manage active models
331
- skill List, compile, and run reusable skill scripts
332
- init [name] Scaffold a new project from a template
333
- history Search and manage chat history
334
- doctor Provider health dashboard
335
- benchmark Run model benchmarks
336
- workflow Workflow template marketplace
337
- federation Remote agent federation
338
- team Team collaboration
339
- dashboard Launch web UI dashboard
340
- dashboard stop Gracefully stop a running dashboard server
341
- memory Memory compression and stats
342
- provider Provider list and health diagnostics
343
- security Security scan for PII, injections, and dangerous code
344
- feedback Feedback and rating system
345
- marketplace Browse, search, and install plugins and workflows
346
- mcp Model Context Protocol — connect to MCP servers
347
- plugins Manage auto-discovered plugins
348
- sandbox Docker sandbox management
349
- sdk Agent SDK scaffolding
350
- config Manage Buff configuration
351
- cache Manage inference cache
352
- ```
353
-
354
- ---
355
-
356
- ## Getting API Keys
357
-
358
- Each cloud provider requires an API key. Sign up and get your key from the links below.
359
-
360
- ### 🔷 Groq (Fast — LPU Cloud Inference)
361
-
362
- Groq runs open-source models at blazing speeds on their custom LPU hardware.
363
-
364
- 1. Sign up at **[console.groq.com](https://console.groq.com)** (free tier available)
365
- 2. Go to **API Keys** → **Create API Key**
366
- 3. Copy your key (starts with `gsk_`)
367
-
368
- ```bash
369
- export GROQ_API_KEY="gsk_xxxxxxxxxxxxxxxx"
370
- ```
371
-
372
- ### 🔶 NVIDIA NIM
373
-
374
- NVIDIA NIM provides hosted API access to a wide catalog of models (121+ models).
375
-
376
- 1. Sign up at **[build.nvidia.com](https://build.nvidia.com)** (free tier with rate limits)
377
- 2. Generate an API key from the **Get API Key** button
378
- 3. Copy your key (starts with `nvapi-`)
379
-
380
- ```bash
381
- export NVIDIA_NIM_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
382
- ```
383
-
384
- ### 🔷 Google Gemini
385
-
386
- Google's Gemini API has a generous free tier with competitive models.
387
-
388
- 1. Visit **[aistudio.google.com/apikey](https://aistudio.google.com/apikey)** and click **Create API Key**
389
- 2. Select your Google Cloud project or create one
390
- 3. Copy your key (starts with `AIzaSy`)
391
-
392
- ```bash
393
- export GEMINI_API_KEY="AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
394
- ```
395
-
396
- ### 🟣 OpenRouter
397
-
398
- OpenRouter gives you access to 200+ models from OpenAI, Anthropic, Google, Meta, and more — all through one API.
399
-
400
- 1. Sign up at **[openrouter.ai/keys](https://openrouter.ai/keys)** (free credits on sign-up)
401
- 2. Click **Create Key**
402
- 3. Copy your key (starts with `sk-or-v1-`)
403
-
404
- ```bash
405
- export OPENROUTER_API_KEY="sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
406
- ```
407
-
408
- ## MCP (Model Context Protocol) Configuration
409
-
410
- MCP servers extend your agent's capabilities by connecting to external tools and data sources — databases, APIs, file systems, search engines, code repositories, and more. Agent-Nuvira supports the MCP standard for discovering and invoking tools from connected servers.
411
-
412
- ### Configuration Files
413
-
414
- MCP server configs are JSON files placed in '~/.nuvira/mcp/'. Each file defines one server connection. Files are auto-discovered at startup.
415
-
416
- ```bash
417
- mkdir -p ~/.nuvira/mcp
418
- ```
419
-
420
- ### Configuration Fields
421
-
422
- | Field | Type | Required | Description |
423
- |-------|------|----------|-------------|
424
- | `name` | string | Yes | Unique name for this server connection |
425
- | `transport` | `"stdio"` or `"sse"` | Yes | Transport protocol (stdio for local subprocess, sse for remote HTTP) |
426
- | `command` | string | For stdio | The command to run (e.g., `npx`, `node`, a binary path) |
427
- | `args` | string[] | For stdio | Command arguments |
428
- | `url` | string | For sse | The SSE endpoint URL (e.g., `https://example.com/mcp`) |
429
- | `headers` | object | Optional | Custom HTTP headers for SSE transport (e.g., `Authorization`) |
430
- | `env` | object | Optional | Environment variables for the stdio subprocess |
431
- | `enabled` | boolean | Yes | Set to `false` to temporarily disable the server |
432
-
433
- ### Transport Types
434
-
435
- #### stdio (Local Subprocess)
436
-
437
- Spawns a local process (Node.js, Python, Go binary, etc.) and communicates via stdin/stdout using JSON-RPC 2.0.
438
-
439
- ```json
440
- {
441
- "name": "filesystem",
442
- "transport": "stdio",
443
- "command": "npx",
444
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
445
- "enabled": true
446
- }
447
- ```
448
-
449
- #### sse (Remote HTTP)
450
-
451
- Connects to a remote HTTP endpoint using Server-Sent Events (SSE). Supports custom headers for authentication.
452
-
453
- ```json
454
- {
455
- "name": "exa",
456
- "transport": "sse",
457
- "url": "https://websetsmcp.exa.ai/mcp",
458
- "headers": {
459
- "Authorization": "Bearer YOUR_EXA_API_KEY"
460
- },
461
- "enabled": true
462
- }
463
- ```
464
-
465
- ### Examples
466
-
467
- #### 1. Filesystem Server
468
-
469
- Read/write files and directories on your local machine.
470
-
471
- ```json
472
- {
473
- "name": "filesystem",
474
- "transport": "stdio",
475
- "command": "npx",
476
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/your/project"],
477
- "enabled": true
478
- }
479
- ```
480
-
481
- ```bash
482
- agent-nuvira mcp connect filesystem
483
- agent-nuvira mcp call read_file --server filesystem --args '{"path":"/path/to/file.txt"}'
484
- ```
485
-
486
- #### 2. GitHub Server
487
-
488
- Search repositories, issues, PRs, and code on GitHub. Requires a GitHub Personal Access Token.
489
-
490
- **Setup:**
491
- 1. Build the binary: `git clone https://github.com/github/github-mcp-server.git && cd github-mcp-server && go build -o github-mcp-server ./cmd/github-mcp-server/`
492
- 2. Move it to your PATH: `mv github-mcp-server /usr/local/bin/`
493
- 3. Create a GitHub PAT at https://github.com/settings/tokens
494
- 4. Add the config below to '~/.nuvira/mcp/github.json'
495
-
496
- ```json
497
- {
498
- "name": "github",
499
- "transport": "stdio",
500
- "command": "/usr/local/bin/github-mcp-server",
501
- "args": ["stdio"],
502
- "env": {
503
- "GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_xxxxxxxxxxxx"
504
- },
505
- "enabled": true
506
- }
507
- ```
508
-
509
- ```bash
510
- agent-nuvira mcp connect github
511
- agent-nuvira mcp list
512
- # Tools include: search_repositories, search_issues, search_code, search_pull_requests, etc.
513
- agent-nuvira mcp call search_repositories --server github --args '{"query":"react","limit":5}'
514
- ```
515
-
516
- #### 3. Exa WebSets Server (SSE with Bearer Auth)
517
-
518
- Search and enrich web entities (companies, people, research papers) using Exa's AI-powered search API. Uses SSE transport with Bearer token authentication.
519
-
520
- **Setup:**
521
- 1. Get your Exa API key at https://dashboard.exa.ai
522
- 2. Add the config below to '~/.nuvira/mcp/exa.json'
523
-
524
- ```json
525
- {
526
- "name": "exa",
527
- "transport": "sse",
528
- "url": "https://websetsmcp.exa.ai/mcp",
529
- "headers": {
530
- "Authorization": "Bearer YOUR_EXA_API_KEY"
531
- },
532
- "enabled": true
533
- }
534
- ```
535
-
536
- ```bash
537
- agent-nuvira mcp connect exa
538
- agent-nuvira mcp list
539
- # Tools include: create_webset, create_search, create_enrichment, list_websets, etc.
540
- ```
541
-
542
- ### CLI Commands
543
-
544
- | Command | Description |
545
- |---------|-------------|
546
- | `agent-nuvira mcp list` | List all discovered MCP servers and their tools |
547
- | `agent-nuvira mcp connect <name>` | Connect to a specific MCP server |
548
- | `agent-nuvira mcp connect --all` | Connect to all discovered MCP servers |
549
- | `agent-nuvira mcp call <tool> --server <name> --args '{"key":"val"}'` | Call a tool on a connected server |
550
- | `agent-nuvira mcp info <name>` | Show detailed information for an MCP server |
551
- | `agent-nuvira mcp refresh` | Re-discover and reconnect to all MCP servers |
552
-
553
- ### Auto-Discovery with the Orchestrator
554
-
555
- When you run `agent-nuvira execute`, the orchestrator automatically:
556
-
557
- 1. Scans '~/.nuvira/mcp/' for JSON config files
558
- 2. Connects to all enabled MCP servers
559
- 3. Injects tool descriptions into the agent's context
560
- 4. The planner can schedule MCP tool calls as pipeline steps
561
-
562
- ### Finding More MCP Servers
563
-
564
- Browse the official MCP server directory at **[modelcontextprotocol.io/servers](https://modelcontextprotocol.io/servers)**. Popular servers include:
565
-
566
- - **Filesystem** — Read/write local files
567
- - **GitHub** — Repository, issue, PR, and code search
568
- - **PostgreSQL** — Query databases
569
- - **SQLite** — Query SQLite databases
570
- - **Brave Search** — Web search
571
- - **Docker** — Container management
572
- - **Puppeteer** — Browser automation
573
- - **Slack** — Channel and message access
574
-
575
-
576
-
577
- ---
578
-
579
- ## Configuration
580
-
581
- ### Config File
582
-
583
- Configuration lives at `~/.nuvira/nuvirarc.json`. It is created with sensible defaults on first use.
584
-
585
- You can inspect and modify it through the CLI:
586
-
587
- ```bash
588
- # Show full configuration
589
- agent-nuvira config
590
-
591
- # Set the default provider
592
- agent-nuvira config set defaultProvider gemini
593
-
594
- # Set a provider's model
595
- agent-nuvira config set providers.nim.model "meta/llama-3.1-8b-instruct"
596
-
597
- # List all providers with their status
598
- agent-nuvira config list
599
- ```
600
-
601
- ### Default Configuration
602
-
603
- ```json
604
- {
605
- "defaultProvider": "local",
606
- "providers": {
607
- "nim": {
608
- "model": "meta/llama-3.1-8b-instruct",
609
- "temperature": 0.7,
610
- "maxTokens": 4096
611
- },
612
- "gemini": {
613
- "model": "gemini-2.0-flash-exp",
614
- "temperature": 0.7,
615
- "maxTokens": 8192
616
- },
617
- "openrouter": {
618
- "model": "mistralai/mistral-7b-instruct",
619
- "temperature": 0.7,
620
- "maxTokens": 4096
621
- },
622
- "groq": {
623
- "model": "llama-3.3-70b-versatile",
624
- "temperature": 0.7,
625
- "maxTokens": 4096
626
- },
627
- "local": {
628
- "runner": "ollama",
629
- "model": "llama2",
630
- "temperature": 0.7,
631
- "maxTokens": 4096
632
- }
633
- }
634
- }
635
- ```
636
-
637
- ### Environment Variables
638
-
639
- API keys can be set via environment variables instead of the config file. They take **priority** over the config file.
640
-
641
- | Variable | Provider | Required? | Get Your Key |
642
- |---|---|---|---|
643
- | `GROQ_API_KEY` | Groq | Yes, unless using local | [console.groq.com](https://console.groq.com) |
644
- | `NVIDIA_NIM_API_KEY` | NVIDIA NIM | Yes, unless using local | [build.nvidia.com](https://build.nvidia.com) |
645
- | `GEMINI_API_KEY` | Google Gemini | Yes, unless using local | [aistudio.google.com/apikey](https://aistudio.google.com/apikey) |
646
- | `OPENROUTER_API_KEY` | OpenRouter | Yes, unless using local | [openrouter.ai/keys](https://openrouter.ai/keys) |
647
-
648
- You can place a `.env` file in the project root or at `~/.nuvira/.env`:
649
-
650
- ```env
651
- # ~/.nuvira/.env
652
- GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
653
- NVIDIA_NIM_API_KEY=nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
654
- GEMINI_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
655
- OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
656
- ```
657
-
658
- ### Modality Providers (Image/Audio/Video)
659
-
660
- Agent-Nuvira routes image generation, TTS, video, and transcription to the best available backend. Built-in providers are automatically detected from environment variables. You can add custom providers via config:
661
-
662
- ```bash
663
- # Add Replicate for image generation
664
- agent-nuvira config set modality.image.replicate.apiKey=r8_xxxxx
665
- agent-nuvira config set modality.image.replicate.baseUrl=https://api.replicate.com/v1
666
- agent-nuvira config set modality.image.replicate.models='["stability-ai/sdxl", "black-forest-labs/flux-schnell"]'
667
- agent-nuvira config set modality.image.replicate.costPerUnit=0.003
668
- agent-nuvira config set modality.image.replicate.quality=0.9
669
-
670
- # Add Azure TTS
671
- agent-nuvira config set modality.tts.azure.apiKey=xxxxx
672
- agent-nuvira config set modality.tts.azure.baseUrl=https://eastus.tts.speech.microsoft.com
673
- agent-nuvira config set modality.tts.azure.endpoint='/cognitiveservices/v1'
674
- agent-nuvira config set modality.tts.azure.models='["en-US-AriaNeural", "en-US-JennyNeural"]'
675
-
676
- # Add custom video provider
677
- agent-nuvira config set modality.video.myprovider.apiKey=xxxxx
678
- agent-nuvira config set modality.video.myprovider.baseUrl=https://api.myprovider.com/v1
679
- agent-nuvira config set modality.video.myprovider.models='["model-1"]'
680
- ```
681
-
682
- **Built-in providers (auto-detected from env vars):**
683
-
684
- | Modality | Provider | Env Var | Cost | Quality |
685
- |----------|----------|---------|------|----------|
686
- | Image | Pollinations.ai | None (free) | Free | 0.7 |
687
- | Image | DALL-E 3 | `OPENAI_API_KEY` | $0.04/image | 0.95 |
688
- | Image | Stability AI | `STABILITY_API_KEY` | $0.002/gen | 0.85 |
689
- | Image | ComfyUI (local) | `BUFF_IMAGE_API_URL` | Free | 0.9 |
690
- | TTS | OpenAI TTS | `OPENAI_API_KEY` | $15/1M chars | 0.9 |
691
- | TTS | ElevenLabs | `ELEVENLABS_API_KEY` | $30/1M chars | 0.95 |
692
- | Video | FAL AI | `FAL_KEY` | $0.05/video | 0.85 |
693
- | Video | Runway ML | `RUNWAY_API_KEY` | $0.10/video | 0.95 |
694
- | Transcription | OpenAI Whisper | `OPENAI_API_KEY` | $0.006/min | 0.95 |
695
-
696
- **How routing works:**
697
-
698
- 1. Score all available providers by: cost (35%), quality (30%), speed (20%), availability (15%)
699
- 2. Try best provider first
700
- 3. On failure, automatically failover to next best provider
701
- 4. Continue until success or all providers exhausted
702
-
703
- ---
704
-
705
- ## CLI Commands
706
-
707
- ### `agent-nuvira models` — Model Discovery (New in v1.1.0)
708
-
709
- List available models from any configured provider. Query each provider's model catalog without leaving the terminal.
710
-
711
- ```bash
712
- # List models from the default provider
713
- agent-nuvira models
714
-
715
- # List models from a specific provider
716
- agent-nuvira models --provider nim
717
- agent-nuvira models --provider groq
718
- agent-nuvira models --provider openrouter
719
-
720
- # Search for models by keyword
721
- agent-nuvira models --search deepseek
722
- agent-nuvira models --search llama
723
-
724
- # Show all providers (even unconfigured ones)
725
- agent-nuvira models --all
726
- ```
727
-
728
- **Examples:**
729
-
730
- ```bash
731
- # See all models on Groq
732
- agent-nuvira models --provider groq
733
-
734
- # Find DeepSeek models across all configured providers
735
- agent-nuvira models --search deepseek
736
-
737
- # Output:
738
- # ════════════════════════════════════════════
739
- # 📋 Available Models (3)
740
- # ════════════════════════════════════════════
741
- #
742
- # Groq:
743
- # ----------------------------------------
744
- # deepseek-ai/deepseek-v4-pro [deepseek]
745
- # deepseek-ai/deepseek-v4-flash [deepseek]
746
- # deepseek-ai/deepseek-coder-6.7b-instruct [deepseek]
747
- #
748
- # ════════════════════════════════════════════
749
- ```
750
-
751
- Use a discovered model immediately:
752
-
753
- ```bash
754
- agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
755
- agent-nuvira edit src/server.ts --provider openrouter --model openai/gpt-4o
756
- ```
757
-
758
- **Model Availability Registry** — the registry is the sub-ms FAISS/JSON store
759
- routing reads on every pick. `models status` shows verified / unavailable /
760
- quota-parked models; `--verbose` adds the two things routing learned from real
761
- usage: which providers are **registry-blocked** (skipped predictively — with the
762
- learned reason for each blocked model) and the **per-action telemetry** (which
763
- action verified/killed which provider × model):
764
-
765
- ```bash
766
- # Show the registry (verified / unavailable / quota-parked)
767
- agent-nuvira models status
768
-
769
- # Same + registry-blocked providers (why routing skips them) + per-action
770
- # "learned from real usage" telemetry (chat/execute/plan/edit verified/killed)
771
- agent-nuvira models status --verbose
772
-
773
- # The dashboard's Models panel charts the same feed per action — scrub across
774
- # days (drag / click / range slider / ▶ play) to see each day's exact
775
- # verified vs killed provider × model chips
776
- agent-nuvira dashboard
777
-
778
- # Probe + spot-check now (proactive health, not reactive)
779
- agent-nuvira models refresh
780
- # Background maintenance daemon
781
- agent-nuvira models watch
782
-
783
- # Escape hatch: manually release a registry-blocked provider (demotes
784
- # unavailable → unverified, clears quota parks + ledger cooldown, then
785
- # re-probes the live API to re-learn the truth — honest stillBlocked output)
786
- agent-nuvira models unblock gemini
787
- # Same, but skip the live re-probe (demote + un-park only)
788
- agent-nuvira models unblock nim --no-spot-check
789
- # Machine-readable for CI
790
- agent-nuvira models unblock groq --json
791
- ```
792
-
793
- ---
794
-
795
- ### `agent-nuvira chat` — Interactive Chat
796
-
797
- Start a terminal-based chat session with any provider.
798
-
799
- ```bash
800
- # Interactive mode (default provider)
801
- agent-nuvira chat
802
-
803
- # One-shot prompt
804
- agent-nuvira chat "what is the difference between TCP and UDP?"
805
-
806
- # Specify provider and model
807
- agent-nuvira chat --provider gemini --model gemini-2.0-flash-exp
808
-
809
- # Include a file as context
810
- agent-nuvira chat --file ./src/main.ts "explain this code"
811
-
812
- # Disable caching
813
- agent-nuvira chat --no-cache
814
- ```
815
-
816
- **Interactive commands** within a chat session:
817
-
818
- | Command | Action |
819
- |---|---|
820
- | `/exit` or `/quit` | End the session |
821
- | `/clear` | Clear conversation history |
822
- | `/info` | Show current provider details |
823
- | `/help` | Show available commands |
824
-
825
- ---
826
-
827
- ### `agent-nuvira edit` — AI-Assisted File Editing
828
-
829
- Edit a file using natural language instructions. The AI reads the file, applies your instruction, and writes the result back.
830
-
831
- ```bash
832
- # Edit with default instruction ("Review and improve this code")
833
- agent-nuvira edit src/server.ts
834
-
835
- # Provide a specific instruction
836
- agent-nuvira edit src/server.ts --instruction "add rate limiting middleware"
837
-
838
- # Use a specific provider
839
- agent-nuvira edit src/server.ts --provider openrouter --model openai/gpt-4o
840
-
841
- # Preview changes without modifying the file
842
- agent-nuvira edit src/server.ts --instruction "add error handling" --dry-run
843
- ```
844
-
845
- ---
846
-
847
- ### `agent-nuvira plan` — Implementation Plans
848
-
849
- Analyze a directory or file and generate a structured implementation plan.
850
-
851
- ```bash
852
- # Plan for the current directory
853
- agent-nuvira plan
854
-
855
- # Plan for a specific target with a task description
856
- agent-nuvira plan ./src --task "add user authentication with JWT"
857
-
858
- # Use a cloud provider for complex planning
859
- agent-nuvira plan . --task "refactor to microservices" --provider gemini
860
-
861
- # Verbose mode shows the full context sent to the model
862
- agent-nuvira plan -v
863
- ```
864
-
865
- The plan includes:
866
- 1. **Summary** — high-level overview
867
- 2. **Files to Modify** — specific files and changes
868
- 3. **Architecture Changes** — structural modifications
869
- 4. **Implementation Steps** — ordered guide
870
- 5. **Potential Risks** — edge cases and breaking changes
871
- 6. **Testing Strategy** — verification approach
872
-
873
- ---
874
-
875
- ### `agent-nuvira config` — Configuration Management
876
-
877
- ```bash
878
- # Show full config
879
- agent-nuvira config
880
-
881
- # Set a value
882
- agent-nuvira config set defaultProvider openrouter
883
-
884
- # Get a specific value
885
- agent-nuvira config get providers.nim.model
886
-
887
- # List all providers with their status
888
- agent-nuvira config list
889
-
890
- # Initialize (show defaults)
891
- agent-nuvira config init
892
- ```
893
-
894
- ---
895
-
896
- ### `agent-nuvira cache` — Cache Management
897
-
898
- Inference responses are cached in a local SQLite database (`~/.nuvira/cache.db`) with a default TTL of 1 hour.
899
-
900
- ```bash
901
- # Show cache statistics
902
- agent-nuvira cache stats
903
-
904
- # Clear all cached responses
905
- agent-nuvira cache clear
906
- ```
907
-
908
- ---
909
-
910
- ### `agent-nuvira model` — Context-Preserving Model Switching
911
-
912
- Switch inference providers and models on the fly without losing conversation history, agent state, or session continuity. The active model persists across CLI restarts.
913
-
914
- ```bash
915
- # Show current active model + prompt to switch
916
- agent-nuvira model
917
-
918
- # List all providers with their status
919
- agent-nuvira model list
920
-
921
- # Interactive categorized model picker
922
- # (choose "Browse by provider" to drill into ONE provider's full model list,
923
- # e.g. OpenRouter's 100+ models, and pick a specific one)
924
- agent-nuvira model switch
925
-
926
- # Switch to a provider with its default model
927
- agent-nuvira model switch groq
928
-
929
- # Switch to a specific provider/model pair
930
- agent-nuvira model switch groq/llama-3.3-70b-versatile
931
-
932
- # Auto routing — agent decides the best provider/model per task
933
- # (fast cheap models for simple work, stronger models for complex tasks,
934
- # local models for private tasks)
935
- agent-nuvira model switch auto
936
-
937
- # Show detailed active configuration
938
- agent-nuvira model info
939
-
940
- # Get model routing recommendations
941
- agent-nuvira model recommend
942
-
943
- # Explain why Auto routing picks a model for a task (transparency/debugging)
944
- agent-nuvira model explain "implement JWT auth with refresh tokens"
945
- agent-nuvira model explain # walks 5 sample complexities
946
- agent-nuvira model explain --agent writer "your task"
947
- agent-nuvira model explain "your task" --json # machine-readable (scripting/CI)
948
-
949
- # Walk through a narrated decision (the 🎯 fit / 📏 measured / ⏳ ctx chips)
950
- # → see MODELS_EXPLAIN_DEMO.md for a full annotated example
951
-
952
- # Benchmark the exact provider/model pairs the Auto router picks
953
- agent-nuvira benchmark --routing
954
-
955
- # Evaluate the Auto router's picks end-to-end (full multi-agent pipeline + hidden tests)
956
- agent-nuvira eval --routing
957
-
958
- # Every explain snapshot + routing-mode pick is recorded to the dashboard's audit trail
959
- # (Routing panel → 'Audit Trail — routing decision timeline')
960
-
961
- # Quick health check for the active provider
962
- agent-nuvira model health
963
- ```
964
-
965
- **Priority chain:** CLI `--provider`/`--model` flags → `agent-nuvira model switch` active state → default config file — the most specific wins.
966
-
967
- #### Learning Router — Thompson-sampling bandit + hard constraints (v1.51.0 Enhanced)
968
-
969
- Auto routing can **learn from real outcomes** (ruflo-inspired `model-router` math, generalized to all providers). The routing engine scores providers across 5 weighted dimensions (reasoning, speed, cost, privacy, reliability) with per-complexity weight matrices for all 5 levels.
970
-
971
- ```bash
972
- # Enable bandit learning — each provider's score is multiplied by a Beta draw
973
- # learned per complexity bucket from actual task successes/failures
974
- agent-nuvira config set routing.bandit true
975
-
976
- # Hard per-call budget (USD) — providers whose typical call exceeds this are
977
- # eliminated, not just scored lower
978
- agent-nuvira config set routing.maxCostUsd 0.005
979
-
980
- # Minimum capability floors for auto-routed tasks (0–1)
981
- agent-nuvira config set routing.minSpeed 0.5
982
- agent-nuvira config set routing.minReasoning 0.6
983
- ```
984
-
985
- #### How the routing engine works (v1.51.0)
986
-
987
- **5 scoring dimensions:** Every provider has a static capability profile (0–1) for reasoning, speed, cost, privacy, reliability. The cost dimension is computed from **real per-1K-token pricing** (free tiers = $0) — configurable via `agent-nuvira config set pricing.<provider>.inputPer1K`.
988
-
989
- **5 complexity levels:** The task description is analyzed for keywords to determine complexity (trivial → critical). Each level has a distinct weight matrix that shifts dominance:
990
- - **Trivial/simple:** cost + speed dominate (fast small model)
991
- - **Moderate:** balanced
992
- - **Complex/critical:** reasoning + reliability dominate (deep reasoning with larger model)
993
-
994
- **4 preference modes:** `balanced`, `performance-first`, `cost-first`, `privacy-first` — each applies additive weight adjustments that shift the routing decision predictably.
995
-
996
- **1. Thompson-sampling bandit** — Each provider keeps a **Beta(α, β) prior per complexity bucket** so learning is task-type-local. Final score = `deterministicScore × θ` where `θ ~ Beta(α, β)`. Cold start `Beta(1,1)` behaves like the plain heuristic router until outcomes accumulate. The orchestrator **records every auto-routed task's outcome** (success/failure) into the bandit. Success rewards are **cost-adjusted** — a cheap provider's success is worth the most. State persists to `~/.nuvira/memory/router-bandit.json`.
997
-
998
- **2. Uncertainty-driven escalation** — When the bandit's winner has no learned data (α+β < default 8 samples), routing escalates to the next-ranked provider that HAS learned data with a ≥55% win-rate floor. This prevents a cold-start winner from committing to a coin flip.
999
-
1000
- **3. Per-modelId learning** — Both provider-level and model-level Beta priors track which concrete model won (e.g., `llama-3.3-70b-versatile` ≠ `openai/gpt-oss-20b` on the same provider). Cold start keeps the configured pin; learned models prefer the best Thompson-sampled one.
1001
-
1002
- **4. Promotion gate A/B** — Every auto-routed task records both the deterministic heuristic pick and the bandit pick for the same task. The `agent-nuvira model bandit` command evaluates 3 criteria (quality improvement >2%, cost regression ≤1%, p95 latency regression ≤5%) before promoting the bandit over the heuristic.
1003
-
1004
- **5. Routing rules** — Regex/string task-pattern rules force a specific provider/model before scoring (first match wins). Rules also note the forced provider for correct bandit outcome attribution.
1005
-
1006
- **6. Hard constraints** — `routing.maxCostUsd`, `routing.minSpeed`, `routing.minReasoning` eliminate violating providers with graceful fallback when constraints would remove everything.
1007
-
1008
- **7. Credential-aware filtering** — Auto routing never picks a provider without configured credentials. The ModelRegistry fast path verifies usable models; explicit `allowedProviders` always win.
1009
-
1010
- **8. Quota-ledger integration** — Exhausted providers sink below healthy ones like circuit-breaker cooldown, only picked when every candidate is parked.
1011
-
1012
- **9. Runtime stats blending** — Benchmark quality scores (30%) + per-agent best-model stats adjust provider capability scores in real time.
1013
-
1014
- **10. Verification-aware escalation** — Verification-heavy tasks (deploy, security audit) boost reasoning+reliability weights and reorder candidates so the strongest provider for verification is tried first.
1015
-
1016
- **11. Free/local-first gate** — `routing.allowPaid: false` keeps paid providers out of trivial/simple/moderate tasks; complex/critical tasks may still use high-capacity models.
1017
-
1018
- Inspect and manage the bandit from the CLI:
1019
-
1020
- ```bash
1021
- # Show the bandit state (α/β priors + expected win % per provider × complexity bucket)
1022
- agent-nuvira model bandit
1023
-
1024
- # Machine-readable snapshot (priors, expected win rates, learning history)
1025
- agent-nuvira model bandit --json
1026
-
1027
- # Reset all Beta priors back to Beta(1,1)
1028
- agent-nuvira model bandit reset
1029
- ```
1030
-
1031
- The dashboard's 🤖 **Routing** panel shows the same bandit live — an α/β heatmap plus a learning-history timeline (enable `routing.bandit` and run auto-routed tasks to populate it). It also renders a live **🎖️ Promotion Gate** card: an A/B verdict on whether the bandit is actually **better than the deterministic heuristic**, judged on real trajectories (`router-promotion.jsonl`) — quality must improve >2% while cost and latency don't regress.
1032
-
1033
- **Routing rules** — force a specific provider/model for task patterns (regex/string, evaluated before scoring, first match wins):
1034
-
1035
- ```jsonc
1036
- // ~/.nuvira/nuvirarc.json
1037
- {
1038
- "routing": {
1039
- "bandit": true,
1040
- "maxCostUsd": 0.005,
1041
- "rules": [
1042
- { "name": "marketing → groq", "pattern": "email|sales|copy", "provider": "groq" },
1043
- { "name": "refactor → local", "pattern": "refactor", "provider": "local" }
1044
- ]
1045
- }
1046
- }
1047
- ```
1048
-
1049
- Every decision records a `routedBy` source (`heuristic` | `rule` | `bandit`) in the dashboard's routing audit trail so you can see exactly how each pick was produced. The `routedBy` field is also exposed in the `AutoRouteResult` for programmatic access.
1050
-
1051
- #### Auto-mode session failover — providers that die mid-session get swapped automatically
1052
-
1053
- A provider can look healthy at pick time and still fail mid-session: Gemini's
1054
- `token limit exceeded`, OpenRouter 401s, quota exhaustion, or a rate limit on a
1055
- free tier. In Auto mode, `chat` now **remembers failed providers for the session**
1056
- and routes around them instead of getting stuck:
1057
-
1058
- | Failure kind | Handling |
1059
- |---|---|
1060
- | **Auth** (expired/invalid key, 401) | Provider excluded from Auto routing for the **whole session** — re-picked routes skip it entirely |
1061
- | **Rate limit** (429, quota exceeded, `token limit`, `insufficient_quota`, `resource has been exhausted`) | Provider parked for a **120s cooldown** (aligned with the circuit breaker), then automatically re-admitted |
1062
- | **5xx / network** | Flows through the shared **circuit breaker** (3 failures in 60s → 120s cooldown); never session-excluded |
1063
-
1064
- On failure the chat loop prints `⚠️ <provider> failed — automatically switching to
1065
- <provider> (<model>)` and transparently re-routes to the next-best candidate.
1066
- In-cooldown providers are deprioritized by router scoring (via circuit-breaker
1067
- state), the final fallback always prefers a provider that hasn't failed this
1068
- session, and the failover path is crash-proof — a throwing re-route can't kill
1069
- the interactive loop. Works for both streaming and non-streaming responses.
1070
-
1071
- #### Deterministic Tier-0 routing — mechanical edits without an LLM
1072
-
1073
- Simple mechanical edits never touch an LLM (ruflo's `enhanced-model-router` Tier-1 codemod idea, built on agent-nuvira's editing engine):
1074
-
1075
- | Goal pattern | Deterministic transform | Cost |
1076
- |---|---|---|
1077
- | `remove all console.log statements` / `clean up debug logging` | Strips standalone `console.*` lines | **$0 · <1ms** |
1078
- | `rename foo to bar` (symbol present in context) | Word-boundary rename across all references | **$0 · <1ms** |
1079
- | `remove duplicate imports` | Deduplicates same-module import lines | **$0 · <1ms** |
1080
-
1081
- - Runs **before** the LLM in the edit pipeline; every transformed file is **AST-validated** first, so tier-0 never emits broken code.
1082
- - If the goal isn't mechanical (or validation fails), the pipeline **falls through to the LLM** unchanged.
1083
- - Tier-0 results flow through the same safe-apply pipeline (dry-run, sandbox, review bundles) and emit `edit:written` events tagged `via: tier0`.
1084
- - Disable per call with `useTier0: false` in the EditModule API.
1085
-
1086
- #### Central quota ledger — free/local-first routing with reset windows
1087
-
1088
- Every Auto-routed call is write-through recorded into a **central quota ledger** (tokens/requests per provider × model). The ledger powers four things:
1089
-
1090
- 1. **Calendar-aware reset windows** — daily/hourly free-tier limits with automatic re-enable exactly when the window rolls (no arbitrary timers).
1091
- 2. **Predictive parking** — a provider that exhausts its window is **parked** and sinks below healthy candidates **before** the next call, not after a reactive failure.
1092
- 3. **Free/local-first gate** — `routing.allowPaid: false` keeps paid providers out of trivial/simple/moderate tasks; complex/critical tasks may still use paid high-capacity models.
1093
- 4. **Cost transparency** — `agent-nuvira model quota` shows free vs paid tokens and an **estimated $ saved** figure (what the free-tier usage would have cost at a typical paid rate).
1094
-
1095
- ```bash
1096
- # Set per-provider quota limits (requests per reset window)
1097
- agent-nuvira config set routing.quota.gemini.requestsPerWindow 1500
1098
- agent-nuvira config set routing.quota.groq.requestsPerWindow 14400
1099
- agent-nuvira config set routing.quota.groq.tokensPerWindow 1000000
1100
- agent-nuvira config set routing.quota.groq.windowMs 86400000 # 24h reset window
1101
-
1102
- # Free/local-only unless complexity demands paid (assessment-gap gate)
1103
- agent-nuvira config set routing.allowPaid false
1104
-
1105
- # Inspect the ledger (tokens/requests per provider × model, resets in, parked state)
1106
- # and the cost summary (free vs paid tokens + estimated $ saved)
1107
- agent-nuvira model quota
1108
-
1109
- # Same data machine-readable (costSummary field) for scripting/CI
1110
- agent-nuvira model quota --json
1111
-
1112
- # Clear all ledger entries
1113
- agent-nuvira model quota reset
1114
- ```
1115
-
1116
- The dashboard's 📒 **Quota Ledger** card shows the same data live — per-entry status plus a free/local-first cost split (free tokens = savings, paid tokens = actual spend) with an estimated $ saved badge.
1117
-
1118
- **Failover timeline (transparency: when failover occurred).** Every park, window-reset re-enable, manual release, and mid-session failover is appended to `~/.nuvira/memory/quota-events.jsonl` (capped at 200). The dashboard's Quota card renders it as a **Failover Timeline**, and `agent-nuvira model quota` prints the last 20 events:
1119
-
1120
- ```bash
1121
- agent-nuvira model quota
1122
- # ── Failover Timeline (last 20) ──
1123
- # ⚡ failover gemini (rate-limit) 8/2/2026, 5:10:02 PM
1124
- # ⏸ parked gemini (rate-limit) 8/2/2026, 5:10:02 PM
1125
- # 🔁 re-enabled groq (window reset) 8/2/2026, 5:09:00 PM
1126
- ```
1127
-
1128
- The timeline is also **live**: the dashboard watches `quota-events.jsonl` /
1129
- `quota-ledger.json` on disk and pushes a `quota` SSE event the moment a failover
1130
- or park lands — so the card updates in real time, no page refresh or 10s wait.
1131
- (The watcher arms while a dashboard is connected and disarms when the last one
1132
- disconnects.) To keep it armed from server start — so the timeline is already
1133
- current the moment a dashboard connects, even after the server sat idle between
1134
- viewing sessions — enable always-on mode:
1135
-
1136
- ```bash
1137
- # Keep the quota watcher armed from server start (never disarms on client count)
1138
- agent-nuvira config set routing.alwaysWatchQuota true
1139
- ```
1140
-
1141
- Always-on trades a tiny idle fs watch for instant-up-to-date quota state.
1142
-
1143
- #### Vector retrieval — token-efficient context (saves tokens, complements the quota ledger)
1144
-
1145
- Agent-Nuvira can **vectorize large context** with a local embedding model + the
1146
- pure-JS vector store — no FAISS/native deps, no server. The retrieval layer
1147
- saves tokens (stretching free quotas), while the quota ledger manages limits:
1148
-
1149
- | Piece | What it does |
1150
- |---|---|
1151
- | **Chunking** | Large files split into ~512-token chunks (64-token overlap, paragraph-aware) |
1152
- | **Embedding** | `bge-small-en-v1.5` (384-dim) via @huggingface/transformers — local, free, offline, cached |
1153
- | **Vector store** | Pure-JS cosine-similarity index in `~/.nuvira/memory/vectors-repo.json` (honors `BUFF_MEMORY_DIR`), isolated from memory/history vectors |
1154
- | **Retrieval** | Goal/subtask embedded → top-k chunks (default 5) → reduced context |
1155
- | **Router policy** | Context ≤ threshold (12k tokens) → **direct call, zero overhead**; larger → embed + retrieve; any failure → **failover to full context** (never breaks the LLM call) |
1156
- | **Transparency** | `🧠 Retrieved 5 chunks — reduced context 20k → 3k tokens` + `agent-nuvira retrieval stats` + dashboard Retrieval card |
1157
-
1158
- ```bash
1159
- # Pre-index a repo so Auto runs are instant (first run downloads the ~130MB
1160
- # model once, then cached locally)
1161
- agent-nuvira retrieval index .
1162
-
1163
- # Semantic search over the indexed repo
1164
- agent-nuvira retrieval query "how does login with JWT work?"
1165
-
1166
- # Token-savings transparency
1167
- agent-nuvira retrieval stats
1168
-
1169
- # Wipe index + stats
1170
- agent-nuvira retrieval clear
1171
- ```
1172
-
1173
- Where retrieval applies (honest split):
1174
- - **`agent-nuvira chat --file <large-file>`** — the file is chunked, embedded, and
1175
- reduced to the top-k relevant chunks before the LLM call (big token savings).
1176
- - **`agent-nuvira execute` pipelines** — after the context-gatherer collects files, the
1177
- orchestrator indexes them and produces a **semantic file ranking** for the
1178
- writer (relevance over size when selecting which files fit the token budget),
1179
- and records the retrieval into the token-savings stats.
1180
-
1181
- **Config** (`routing.retrieval`):
1182
-
1183
- ```bash
1184
- # Master switch (default true)
1185
- agent-nuvira config set routing.retrieval.enabled false
1186
-
1187
- # Top-k chunks (default 5), chunk size (default 512 tokens), vectorize threshold (default 12000 tokens)
1188
- agent-nuvira config set routing.retrieval.topK 8
1189
- agent-nuvira config set routing.retrieval.chunkTokens 640
1190
- agent-nuvira config set routing.retrieval.thresholdTokens 20000
1191
- ```
1192
-
1193
- **Vector search backend** (`memory.vectorBackend`):
1194
-
1195
- ```bash
1196
- # Show which backend is active
1197
- agent-nuvira memory stats # ... Backend: faiss-ivf (FAISS-style IVF-flat ANN)
1198
-
1199
- # Choose the backend explicitly
1200
- agent-nuvira config set memory.vectorBackend auto # default: native FAISS when built, else pure-JS IVF
1201
- agent-nuvira config set memory.vectorBackend faiss # prefer FAISS-style; JSON fallback on native failure
1202
- agent-nuvira config set memory.vectorBackend json # exact flat cosine (the original behavior)
1203
- ```
1204
-
1205
- - **`auto` (default)** — uses the **FAISS-style backend**: real `@faiss-node/native`
1206
- bindings when the user has installed AND built them (smoke-tested at load),
1207
- otherwise a **pure-JS IVF-flat ANN** — a faithful TypeScript port of FAISS's
1208
- `IndexIVFFlat` (nlist inverted lists via deterministic k-means++, nprobe
1209
- probe lists, cosine = inner product of L2-normalized vectors). Small indexes
1210
- (≤ 512 entries) use an EXACT scan so results are identical to the JSON
1211
- backend; large indexes get sub-linear approximate search with filter-aware
1212
- probe expansion. Any native failure falls back gracefully — semantic search
1213
- never breaks.
1214
- - **Why native FAISS is not the hard default (decision):** `@faiss-node/native`
1215
- ships no prebuilt binaries and requires compiling FAISS from source
1216
- (cmake + OpenBLAS + libomp) at install time — verified to fail on a stock
1217
- macOS dev box. Making it a required dependency would break zero-setup
1218
- `npx agent-nuvira`. The pure-JS IVF-flat backend provides the same
1219
- FAISS-style approximate-NN behavior with zero native deps; users who build
1220
- the native package automatically get the real thing.
1221
-
1222
- **Roadmap (Step 6 — future enhancements):**
1223
- 1. **Hybrid retrieval** — combine embeddings with keyword/BM25 scoring for
1224
- exact-match-sensitive queries.
1225
- 2. **Embedding caching** — the embedder already caches in-memory; a persistent
1226
- on-disk embedding cache would skip re-embedding unchanged chunks across
1227
- sessions.
1228
- 3. **Multi-vector routing** — different embedding models for code vs natural
1229
- language (the store already supports namespaced indexes, so this is a
1230
- config-level addition).
1231
-
1232
- **Opt-in failover confirmation.** By default Auto mode fails over silently
1233
- (never get stuck). If you'd rather approve each mid-session swap, enable:
1234
-
1235
- ```bash
1236
- # Ask before Auto mode switches providers mid-session
1237
- agent-nuvira config set routing.promptOnFailover true
1238
- ```
1239
-
1240
- With this on, a failed provider shows the next-ranked candidate and lets you
1241
- choose "switch (recommended)" or "pick a provider myself" — so every swap is
1242
- an informed decision, not a silent surprise.
1243
-
1244
- This also applies to **single-shot Auto prompts** (`agent-nuvira chat "ask something"`
1245
- with `-m auto`): before Auto mode silently hops to the next candidate, the CLI
1246
- asks; picking "manual" surfaces the original provider error instead of
1247
- switching behind your back.
1248
-
1249
- #### Checkpoint / resume — crash-proof multi-agent pipelines
1250
-
1251
- Long `agent-nuvira execute` pipelines can be killed by a crash, quota exhaustion, or a token expiry mid-run. Checkpoints serialize the pipeline state so work is never lost:
1252
-
1253
- ```bash
1254
- # Save a resume-able checkpoint after every task batch (in ~/.nuvira/memory/checkpoints/)
1255
- agent-nuvira execute "build the API" --checkpoint
1256
-
1257
- # Resume the latest checkpoint for this goal + cwd (skips completed steps + the planner)
1258
- agent-nuvira execute "build the API" --resume
1259
-
1260
- # Resume a specific checkpoint
1261
- agent-nuvira execute "build the API" --resume cp-3f9a2c1d0b7e
1262
-
1263
- # List saved checkpoints (goal, progress %, saved-at)
1264
- agent-nuvira execute --checkpoint-list
1265
- ```
1266
-
1267
- How it works:
1268
- - After **every task batch** the orchestrator saves a snapshot of the task plan (per-step statuses), artifacts, file changes, and metadata.
1269
- - `--resume` rehydrates the vault, **skips completed steps and the planner**, and continues from the first pending step — on whatever provider/model is now available.
1270
- - `--checkpoint` alone always starts **fresh** (it never silently resumes a stale checkpoint); only an explicit `--resume` loads.
1271
- - State persists across sessions, so a provider that died mid-pipeline can resume on the next-best provider with zero rework (assessment item #6: continuity across models).
1272
-
1273
- ---
1274
-
1275
- ### `agent-nuvira execute --auto-branch` — Branch Automation
1276
-
1277
- Automate your entire git workflow with trigger-based hooks. Install once, then let the agent handle branch creation, commits, and PR updates automatically.
1278
-
1279
- ```bash
1280
- # Step 1: Install branch automation hooks
1281
- agent-nuvira execute "install branch hooks" --auto-branch
1282
-
1283
- # Step 2: Check automation status
1284
- agent-nuvira execute "check branch status" --auto-branch
1285
-
1286
- # Step 3: Auto-create a branch from an issue
1287
- agent-nuvira execute "auto-create branch from issue PROJ-123" --auto-branch
1288
-
1289
- # Step 4: Auto-commit changes with a conventional message
1290
- agent-nuvira execute "auto-commit changes" --auto-branch
1291
-
1292
- # Step 5: Start file-watch mode (auto-commits on file changes)
1293
- agent-nuvira execute "start file watch" --auto-branch
1294
-
1295
- # Step 6: Diagnose CI failures
1296
- agent-nuvira execute "check CI for PR #42" --auto-branch
1297
- ```
1298
-
1299
- **Trigger Sources:**
1300
-
1301
- | Trigger | Action | Description |
1302
- |---------|--------|-------------|
1303
- | **Issue → Branch** | `feat/PROJ-123-description` | Auto-creates branches with conventional naming when issues are assigned |
1304
- | **PR Label → Update** | `git push origin <branch>` | Commits and pushes changes when labels like `wip` or `needs-work` are detected |
1305
- | **File Watch → Commit** | `git commit -m "feat(scope): ..."` | Background polling detects file changes and auto-commits with conventional messages |
1306
- | **CI Status → Fix** | LLM diagnosis + fix plan | Analyzes CI failures from recent commits and suggests targeted fixes |
1307
-
1308
- **Conventional Commit Format:**
1309
-
1310
- ```
1311
- <type>(<scope>): <description>
1312
-
1313
- Types: feat, fix, refactor, docs, style, test, chore, perf
1314
- Scope: module/area affected (auto-detected from changed files)
1315
- ```
1316
-
1317
- **Installed Hooks:**
1318
-
1319
- | Hook | Purpose |
1320
- |------|---------|
1321
- | `post-checkout` | Detects issue-based branches on checkout and loads context |
1322
- | `pre-commit` | Enforces conventional commit format with auto-detection |
1323
- | `file-watch.sh` | Background script that polls for changes and triggers auto-commits |
1324
-
1325
- ---
1326
-
1327
- ### `agent-nuvira skill` — Skill Compiler System
1328
-
1329
- Automatically convert successful agent execution trajectories into reusable, parameterized skill scripts. Skills are extracted by an LLM from high-scoring runs, saved to `~/.nuvira/skills/`, and invoked directly via the orchestrator.
1330
-
1331
- ```bash
1332
- # List all compiled skills
1333
- agent-nuvira skill list
1334
-
1335
- # Show a skill's definition and steps
1336
- agent-nuvira skill show "Add CLI Command"
1337
-
1338
- # Run a skill with parameters (invokes the orchestrator)
1339
- agent-nuvira skill run "Add CLI Command" --params commandName=deploy --params description="Deploy to production"
1340
-
1341
- # Manually trigger skill compilation from recent trajectories
1342
- agent-nuvira skill compile
1343
-
1344
- # Search skills by keyword
1345
- agent-nuvira skill search "cli"
1346
-
1347
- # Show skill quality scores
1348
- agent-nuvira skill quality
1349
-
1350
- # Garbage-collect old/low-quality skills
1351
- agent-nuvira skill gc
1352
- ```
1353
-
1354
- **How it works:** Every 8 successful orchestration runs, the Self-Improver automatically feeds the top-5 trajectories to the Skill Compiler. The LLM identifies reusable patterns and parameterizes them with `{{paramName}}` placeholders. Skills act as pre-built task plans that the orchestrator can execute on demand.
1355
-
1356
- ---
1357
-
1358
- ### `agent-nuvira skills` — Community Skills Marketplace
1359
-
1360
- Search, install, update, and manage community skills from the multi-source registry. Distinct from `agent-nuvira skill` (singular), which manages internal trajectory-compiled skills.
1361
-
1362
- ```bash
1363
- # Search the registry for skills matching a query
1364
- agent-nuvira skills search "deploy"
1365
- agent-nuvira skills search "security audit"
1366
-
1367
- # Install a skill from the registry (into <project>/.agents/skills/)
1368
- agent-nuvira skills install code-assessment
1369
- agent-nuvira skills install website-deploy
1370
-
1371
- # Install from a specific source kind
1372
- agent-nuvira skills install my-skill --source git-repo
1373
- agent-nuvira skills install my-skill --source local-dir
1374
-
1375
- # List installed skills with provenance
1376
- agent-nuvira skills list
1377
- agent-nuvira skills list --origin registry
1378
- agent-nuvira skills list --origin local
1379
-
1380
- # Update installed skills to newer versions
1381
- agent-nuvira skills update
1382
-
1383
- # Uninstall a skill
1384
- agent-nuvira skills uninstall code-assessment
1385
-
1386
- # Create a cross-skill bundle (Hermes parity)
1387
- agent-nuvira skills bundle backend-dev --create --name "Backend Dev" --description "Full workflow" --skills code-assessment,test-strategy
1388
-
1389
- # List bundles
1390
- agent-nuvira skills bundle --list
1391
-
1392
- # Show bundle contents
1393
- agent-nuvira skills bundle backend-dev --show
1394
- ```
1395
-
1396
- ### Skill Execution — Language-Agnostic Marketplace Skills
1397
-
1398
- Execute skills from the marketplace in any language (Python, Node.js, Shell, TypeScript) without the agent needing to understand the language.
1399
-
1400
- ```bash
1401
- # Execute a Python skill (e.g., image generation)
1402
- agent-nuvira skill execute image-gen --prompt "A sunset over mountains"
1403
-
1404
- # Execute a Node.js skill (e.g., API call)
1405
- agent-nuvira skill execute api-call --endpoint /users --method GET
1406
-
1407
- # Execute a Shell skill (e.g., system check)
1408
- agent-nuvira skill execute system-check --check disk
1409
-
1410
- # The skill tool also supports execution via the agent
1411
- # Agent calls: skill tool → execute: { skill: "image-gen", args: { prompt: "..." } }
1412
- ```
1413
-
1414
- **How it works:**
1415
- 1. Skill declares `runtime: python` (or node/shell/auto) in frontmatter
1416
- 2. Executor auto-detects language from frontmatter, file extension, or shebang
1417
- 3. API keys are injected via environment variables (provider credentials blocked for security)
1418
- 4. Script is executed in a subprocess with timeout and output capture
1419
- 5. Returns structured result (stdout, stderr, exit code, duration)
1420
-
1421
- **Security:** Provider credentials (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) are automatically blocked from skill execution. Only skill-declared `required_environment_variables` are injected.
1422
-
1423
- **50 bundled first-party skills** ship with the product:
1424
-
1425
- | Skill | Description |
1426
- |---|---|
1427
- | `website-deploy` | Deploy to Cloudflare Pages, Netlify, Vercel, GitHub Pages, AWS S3, Azure, Firebase |
1428
- | `code-assessment` | Structured codebase evaluation across 5 dimensions |
1429
- | `technical-roadmap` | Current state → target state → phased roadmap |
1430
- | `plan-create-track` | Multi-step job planning with visible progress |
1431
- | `test-strategy` | Deep test pass with matrix selection |
1432
- | `docx` | Create, read, edit Word documents |
1433
- | `security-audit` | Scan for vulnerabilities, classify, fix plan |
1434
- | `api-design` | REST API design → OpenAPI → implement → test |
1435
- | `db-migration` | Schema analysis → backward-compatible migration |
1436
- | `perf-profile` | Profile hotspots → optimize → verify |
1437
- | `doc-gen` | Generate documentation from code |
1438
- | `ci-cd-setup` | CI/CD pipeline setup for GitHub/GitLab |
1439
- | `docker-config` | Multi-stage Dockerfile + docker-compose |
1440
- | `dep-update` | Safe dependency updates with test verification |
1441
- | `code-refactor` | Safe refactoring with test verification |
1442
- | `env-setup` | Development environment bootstrap |
1443
- | `data-analysis` | Analyze datasets, generate insights and visualizations |
1444
- | `api-testing` | Automated API testing (REST/GraphQL) |
1445
- | `perf-test` | Load testing and performance benchmarking |
1446
- | `a11y-audit` | WCAG 2.1 accessibility auditing and fixes |
1447
- | `search-setup` | Full-text search (Algolia, Meilisearch, Elasticsearch) |
1448
- | `email-setup` | Transactional email templates and delivery |
1449
- | `payment-setup` | Stripe checkout, subscriptions, webhooks |
1450
- | `auth-setup` | OAuth2, JWT, RBAC authentication |
1451
- | `monitoring-setup` | Logging, metrics, alerting, health checks |
1452
- | `backup-recovery` | Backup strategy, disaster recovery runbooks |
1453
- | `schema-design` | Database schema design, ER diagrams, normalization |
1454
- | `i18n-setup` | Internationalization and localization |
1455
- | `graphql-api` | GraphQL API design, resolvers, subscriptions |
1456
- | `git-release` | Changelog, semver, tagging, publishing |
1457
- | `design-system` | Component library, tokens, Storybook |
1458
- | `legal-compliance` | GDPR/CCPA, privacy policy, cookie consent |
1459
- | `cron-setup` | Scheduled tasks and cron jobs |
1460
- | `image-optimize` | Image compression, format conversion, responsive images |
1461
- | `pdf-generate` | PDF generation from HTML/markdown with templates |
1462
- | `cache-setup` | Redis/Memcached caching layers |
1463
- | `queue-setup` | Message queue (RabbitMQ, SQS, Bull) setup |
1464
- | `rate-limit` | API rate limiting and throttling |
1465
- | `cors-setup` | CORS policy configuration |
1466
- | `error-tracking` | Error monitoring (Sentry, Bugsnag) |
1467
- | `feature-flags` | Feature flag system (LaunchDarkly, Unleash) |
1468
- | `webhook-setup` | Webhook endpoints and verification |
1469
- | `form-builder` | Form validation and submission handling |
1470
- | `data-sync` | Data synchronization across systems |
1471
- | `state-machine` | Finite state machine implementation |
1472
- | `websocket-setup` | WebSocket real-time communication |
1473
- | `api-versioning` | API versioning strategies (URL, header, query) |
1474
- | `multi-tenancy` | Multi-tenant architecture patterns |
1475
- | `blob-storage` | Blob storage (S3, GCS, Azure Blob) |
1476
- | `notification-setup` | Push notification infrastructure |
1477
-
1478
- **Trust & safety:** sandboxed install names (`^[a-z0-9-]+$`), SHA-256 provenance, quarantine on mismatch, frontmatter cross-check.
1479
-
1480
- ---
1481
-
1482
- ### `agent-nuvira marketplace` — Unified Marketplace
1483
-
1484
- Browse, search, and install workflow templates and plugins from the unified marketplace.
1485
-
1486
- ```bash
1487
- # Browse all available items
1488
- agent-nuvira marketplace browse
1489
-
1490
- # Browse only workflows or plugins
1491
- agent-nuvira marketplace browse --type workflows
1492
- agent-nuvira marketplace browse --type plugins
1493
-
1494
- # Search across all sources
1495
- agent-nuvira marketplace search "deploy"
1496
-
1497
- # Install a workflow template
1498
- agent-nuvira marketplace install security-audit
1499
-
1500
- # Show details for a marketplace item
1501
- agent-nuvira marketplace info quick-fix
1502
- ```
1503
-
1504
- ---
1505
-
1506
- ### `agent-nuvira init` — Project Scaffolding
1507
-
1508
- Scaffold new projects from built-in templates with interactive prompts and provider selection. Supports custom template directories.
1509
-
1510
- ```bash
1511
- # Interactive: name, template, and provider prompts
1512
- agent-nuvira init
1513
-
1514
- # Name from CLI, interactive for template and provider
1515
- agent-nuvira init my-app
1516
-
1517
- # Fully non-interactive
1518
- agent-nuvira init my-app --template node-api
1519
-
1520
- # List all available templates
1521
- agent-nuvira init --list
1522
-
1523
- # Use a custom template from a local directory
1524
- agent-nuvira init my-app --template custom --template-dir ~/my-templates
1525
- ```
1526
-
1527
- **Built-in templates:**
1528
-
1529
- | Template | Description |
1530
- |---|---|
1531
- | `node-cli` | Node.js CLI app with Commander + TypeScript |
1532
- | `ts-library` | TypeScript library with Vitest |
1533
- | `node-api` | Express REST API with TypeScript |
1534
- | `python-cli` | Python CLI app with Click + Poetry |
1535
- | `minimal` | Minimal TypeScript project (1 file) |
1536
-
1537
- The command also generates a `.nuvirarc.json` with your chosen provider and model, ready to use immediately.
1538
-
1539
- ---
1540
-
1541
- ## Docker Compose (5-Minute Onboarding)
1542
-
1543
- Get the full Agent-Nuvira dashboard and CLI running with a single command — no Node.js or TypeScript setup required.
1544
-
1545
- ```bash
1546
- # Clone and go
1547
- cp .env.example .env # Fill in your API keys
1548
- docker compose up # Build & launch at http://localhost:3030
1549
- ```
1550
-
1551
- ### What you get
1552
-
1553
- - **Dashboard UI** at `http://localhost:3030` — provider health, cost tracking, model benchmarks, memory browser
1554
- - **CLI** accessible via `docker compose run --rm agent-nuvira <command>`
1555
- - **Persistent data** — config, memory, cache, and history stored in a named volume
1556
- - **Health checks** — automatic dashboard status verification
1557
-
1558
- ### Examples
1559
-
1560
- ```bash
1561
- # Quick one-shot commands via Docker
1562
- docker compose run --rm agent-nuvira chat "explain recursion in Rust"
1563
- docker compose run --rm agent-nuvira models --provider groq
1564
- docker compose run --rm agent-nuvira execute "add a health check endpoint"
1565
-
1566
- # With local inference (requires Ollama on host)
1567
- docker compose --profile ollama up
1568
- ```
1569
-
1570
- ### Docker Compose Structure
1571
-
1572
- | Feature | Details |
1573
- |---|---|
1574
- | **Base image** | `node:22-alpine` — slim, secure |
1575
- | **Stages** | 3-stage build: TypeScript compile → Vite dashboard → runtime |
1576
- | **Layer caching** | Dependency manifests copied before source for cache reuse |
1577
- | **Ollama profile** | `--profile ollama` adds an Ollama container; defaults to `host.docker.internal` |
1578
- | **Volume** | `agent-nuvira-data` at `/root/.buff` preserves all data |
1579
- | **Port** | `3030` mapped to dashboard server |
1580
- | **Health** | Node `fetch()` verifies dashboard API every 30s |
1581
-
1582
- ### Configuration via Docker
1583
-
1584
- Set API keys in `.env` (see `.env.example`) or pass them as environment variables:
1585
-
1586
- ```bash
1587
- docker compose run --rm -e GROQ_API_KEY=gsk_xxx agent-nuvira chat "hello"
1588
- ```
1589
-
1590
- ---
1591
-
1592
- ## Provider Details
1593
-
1594
- ### Local (Ollama)
1595
-
1596
- Uses the **Ollama HTTP API** running at `http://localhost:11434`.
1597
-
1598
- ```bash
1599
- # Ensure Ollama is running
1600
- ollama serve
1601
-
1602
- # Pull a model
1603
- ollama pull llama2
1604
-
1605
- # Use with the CLI
1606
- agent-nuvira chat --provider local --model llama2
1607
- ```
1608
-
1609
- **Runners:**
1610
-
1611
- | Runner | Description | Requirements |
1612
- |---|---|---|
1613
- | `ollama` (default) | Ollama HTTP API | [Ollama](https://ollama.ai) installed and running |
1614
- | `huggingface` | HuggingFace Transformers via Python | Python 3, `pip install transformers torch` |
1615
- | `ggml` | GGML/GGUF models via llama.cpp | `llama-cli` binary, model file |
1616
-
1617
- Configure the runner:
1618
-
1619
- ```bash
1620
- agent-nuvira config set providers.local.runner huggingface
1621
- agent-nuvira config set providers.local.model "microsoft/phi-2"
1622
- ```
1623
-
1624
- ### Groq
1625
-
1626
- Connects to **Groq** — the fastest inference API for open-source models, running on custom LPU hardware.
1627
-
1628
- ```bash
1629
- # Set your API key
1630
- export GROQ_API_KEY="gsk_..."
1631
-
1632
- # List available models (Llama, Mixtral, Gemma, DeepSeek, and more)
1633
- agent-nuvira models --provider groq
1634
-
1635
- # Chat with any model
1636
- agent-nuvira chat --provider groq --model llama-3.3-70b-versatile
1637
- agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
1638
-
1639
- # Edit with Groq's fast inference
1640
- agent-nuvira edit src/server.ts --provider groq --model llama-3.3-70b-versatile
1641
- ```
1642
-
1643
- The Groq adapter uses `https://api.groq.com/openai/v1` by default.
1644
-
1645
- **Get a free API key:** [console.groq.com](https://console.groq.com)
1646
-
1647
- ### NVIDIA NIM
1648
-
1649
- Connects to the **NVIDIA NIM** OpenAI-compatible API at `https://integrate.api.nvidia.com/v1`.
1650
-
1651
- ```bash
1652
- # Set your API key
1653
- export NVIDIA_NIM_API_KEY="nvapi-..."
1654
-
1655
- # List available models (121 models)
1656
- agent-nuvira models --provider nim
1657
-
1658
- # Chat with any model
1659
- agent-nuvira chat --provider nim --model meta/llama-3.1-8b-instruct
1660
- agent-nuvira chat --provider nim --model deepseek-ai/deepseek-v4-flash
1661
- ```
1662
-
1663
- The NIM adapter uses `https://integrate.api.nvidia.com/v1` by default. You can override the base URL for self-hosted NIM deployments:
1664
-
1665
- ```bash
1666
- agent-nuvira config set providers.nim.baseUrl "http://your-nim-host:8000/v1"
1667
- ```
1668
-
1669
- ### Google Gemini
1670
-
1671
- Connects to the **Google Gemini API** free tier.
1672
-
1673
- ```bash
1674
- # Set your API key
1675
- export GEMINI_API_KEY="AIzaSy..."
1676
-
1677
- # Use it (supports 8K+ token context)
1678
- agent-nuvira chat --provider gemini --model gemini-2.0-flash-exp
1679
- ```
1680
-
1681
- ### OpenRouter
1682
-
1683
- Routes through **OpenRouter** for access to 200+ models from multiple providers.
1684
-
1685
- ```bash
1686
- # Set your API key
1687
- export OPENROUTER_API_KEY="sk-or-v1-..."
1688
-
1689
- # List available models
1690
- agent-nuvira models --provider openrouter
1691
-
1692
- # Use a specific model
1693
- agent-nuvira chat --provider openrouter --model openai/gpt-4o
1694
- agent-nuvira chat --provider openrouter --model anthropic/claude-3-haiku
1695
- ```
1696
-
1697
- ---
1698
-
1699
- ## Multi-Agent Orchestration (`agent-nuvira execute`)
1700
-
1701
- The `execute` command runs an autonomous multi-agent pipeline that can plan, gather context, write code, review changes, run tests, and publish — all from a single goal.
1702
-
1703
- ```bash
1704
- # Execute a multi-agent pipeline
1705
- agent-nuvira execute "add JWT authentication to the Express app"
1706
-
1707
- # With verbose logging to see each agent's work
1708
- agent-nuvira execute "add a health check endpoint" --verbose
1709
-
1710
- # Use a specific provider for all agents
1711
- agent-nuvira execute "refactor the database layer" --provider groq
1712
-
1713
- # Dry-run mode (shows what would change without writing)
1714
- agent-nuvira execute "add rate limiting" --dry-run
1715
-
1716
- # Configure models per agent type
1717
- agent-nuvira execute "add tests" --agent-model planner=gemini --agent-model writer=groq
1718
-
1719
- # Use persistent memory across sessions
1720
- agent-nuvira execute "fix the login bug" --memory
1721
-
1722
- # Set a custom context window limit (default: 128,000 tokens)
1723
- agent-nuvira execute "refactor large codebase" --context-limit 256000
1724
-
1725
- # Adjust pruning aggressiveness for long chains
1726
- agent-nuvira execute "build entire microservice" --context-prune medium
1727
- agent-nuvira execute "migrate database schema" --context-prune aggressive
1728
- ```
1729
-
1730
- **Context pruning flags:**
1731
-
1732
- | Flag | Purpose | Default |
1733
- |---|---|---|
1734
- | `--context-limit <tokens>` | Max tokens before automatic pruning activates | 128000 |
1735
- | `--context-prune <mode>` | Prune aggressiveness: `soft` \| `medium` \| `aggressive` | `soft` |
1736
-
1737
- The pruner automatically compresses the shared agent context between pipeline steps using 5 strategies: metadata stripping, file change collapsing, conversation truncation, artifact summarization, and aggressive fallback.
1738
-
1739
-
1740
- The pipeline runs these agents in dependency-aware order with parallelization:
1741
-
1742
- | # | Agent | Type | Description |
1743
- |---|-------|------|-------------|
1744
- | 1 | **Planner** | Core | Analyzes the goal, creates a dependency-aware task plan |
1745
- | 2 | **Context Gatherer** | Core | Scans the codebase for relevant files and artifacts |
1746
- | 3 | **Security Scanner** | Safety | Scans for PII, prompt injection, and dangerous patterns |
1747
- | 4 | **Writer** | Core | Implements the code changes based on plan and context |
1748
- | 5 | **Reviewer** | Quality | Validates changes for bugs, security, and code style |
1749
- | 6 | **Tester** | Testing | Runs tests in a sandboxed temp directory or Docker container |
1750
- | 7 | **Debugger** | Testing | Iteratively diagnoses and fixes test failures via LLM |
1751
- | 8 | **Runner** | Execution | Executes shell commands to verify the program works |
1752
- | 9 | **MCP Agent** | Integration | Invokes external tools from connected MCP servers |
1753
- | 10 | **Skill Runner** | Learning | Executes compiled skill scripts as pre-built task plans |
1754
- | 11 | **Git Agent** | Publishing | Creates branches, commits with LLM-generated messages |
1755
- | 12 | **PR Description** | Publishing | Generates PR descriptions from git diff via LLM |
1756
- | 13 | **Package Agent** | Publishing | Bumps versions, builds, publishes to npm |
1757
- | 14 | **GitHub Release** | Publishing | Creates tags, release notes, and GitHub releases |
1758
-
1759
- **Parallel execution:** Independent agents (e.g., Reviewer + Tester) run concurrently via `Promise.all()`. Exclusive agents (Runner, Debugger) get dedicated access. Results are merged with conflict resolution.
1760
-
1761
- **Interactive development mode:** `agent-nuvira execute` without a goal launches an interactive loop with:
1762
- - **Model picker** — Choose your provider/model interactively
1763
- - **Session tracking** — Full history of goals executed in the session
1764
- - **Failure analysis** — Per-agent-type diagnosis with recovery actions
1765
- - **Follow-up suggestions** — LLM-powered contextual next steps
1766
- - **/fix** — Retry the last failed goal with failure context
1767
- - **/save / /resume** — Save and restore sessions across restarts
1768
- - **/suggest** — Search past trajectories for similar goals
1769
-
1770
- ---
1771
-
1772
- ## Architecture
1773
-
1774
- ```
1775
- CLI Commands (chat, edit, plan, models, config, cache, execute)
1776
-
1777
-
1778
- Inference Layer (InferenceProvider interface)
1779
-
1780
- ┌──────┼──────┬──────────┬─────────────┐
1781
- │ │ │ │ │
1782
- ▼ ▼ ▼ ▼ ▼
1783
- Groq NIM Gemini OpenRouter Local
1784
- Adapter Adapter Adapter Adapter Adapter
1785
- │ │ │ │ │
1786
- ▼ ▼ ▼ ▼ ▼
1787
- Groq NVIDIA Google OpenRouter Ollama / HF /
1788
- LPU NIM Gemini (free) APIs GGML Models
1789
-
1790
- ┌──────────────────────────────┐
1791
- │ Core Pipeline │
1792
- │ ┌────────────────────────┐ │
1793
- │ │ Orchestrator │ │
1794
- │ │ │ ├─ Planner │ │
1795
- │ │ ├─ ContextGatherer │ │
1796
- │ │ ├─ Writer │ │
1797
- │ │ ├─ Reviewer │ │
1798
- │ │ ├─ Tester │ │
1799
- │ │ ├─ Runner │ │
1800
- │ │ ├─ Debugger │ │
1801
- │ │ ├─ GitAgent │ │
1802
- │ │ ├─ PackageAgent │ │
1803
- │ │ ├─ GitHubReleaseAgent │ │
1804
- │ │ ├─ SecurityAgent │ │
1805
- │ │ ├─ SkillRunner │ │
1806
- │ │ ├─ MCPAgent │ │
1807
- │ │ └─ PRDescriptionAgent │ │
1808
- │ └────────────────────────┘ │
1809
- │ │
1810
- │ ┌────────────────────────┐ │
1811
- │ │ Memory System │ │
1812
- │ │ ├─ Vector Store │ │
1813
- │ │ ├─ Trajectory/Store │ │
1814
- │ │ └─ Embedder │ │
1815
- │ └────────────────────────┘ │
1816
- │ │
1817
- │ ┌────────────────────────┐ │
1818
- │ │ Self-Learning │ │
1819
- │ │ ├─ Model Router │ │
1820
- │ │ ├─ Pattern Extractor │ │
1821
- │ │ ├─ Scorer │ │
1822
- │ │ └─ Skill Compiler │ │
1823
- │ └────────────────────────┘ │
1824
- │ │
1825
- │ ┌────────────────────────┐ │
1826
- │ │ Context Mgmt │ │
1827
- │ │ ├─ ContextPruner │ │
1828
- │ │ ├─ SQLite Cache │ │
1829
- │ │ ├─ Multi-file Parser │ │
1830
- │ │ └─ Token Chunking │ │
1831
- │ └────────────────────────┘ │
1832
- │ │
1833
- │ ┌────────────────────────┐ │
1834
- │ │ CLI Layer │ │
1835
- │ │ ├─ agent-nuvira init │ │
1836
- │ │ ├─ agent-nuvira model │ │
1837
- │ │ └─ agent-nuvira skill │ │
1838
- │ └────────────────────────┘ │
1839
- │ │
1840
- │ ┌────────────────────────┐ │
1841
- │ │ Docker Deployment │ │
1842
- │ │ └─ docker-compose.yml │ │
1843
- │ └────────────────────────┘ │
1844
- └──────────────────────────────┘
1845
- ```
1846
-
1847
- ### Website (Marketing Site)
1848
-
1849
- The `website/` directory contains a complete static landing page for Agent-Nuvira (`agent-nuvira.com`):
1850
-
1851
- | File | Purpose |
1852
- |---|---|
1853
- | `index.html` | Full marketing landing page with hero, features, pipeline visualization, provider cards, quickstart guide, extensions, and comparison table |
1854
- | `styles.css` | Complete styling with gradient text, animated particles, responsive grid, and dark theme |
1855
- | `script.js` | Interactive elements: scroll animations, copy-to-clipboard, mobile nav toggle, particle system |
1856
- | `_redirects` | Netlify/Cloudflare Page redirect rules |
1857
- | `_headers` | Custom HTTP security and cache headers |
1858
- | `assets/` | Hero images, screenshots, and OG meta assets |
1859
-
1860
- The site is pre-configured for Netlify deployment with zero-configuration.
1861
-
1862
- ### Key Modules
1863
-
1864
- | Module | Path | Purpose |
1865
- |---|---|---|
1866
- | **CLI Router** | `src/cli/router.ts` | Registers commands and resolves providers |
1867
- | **Config Manager** | `src/config/manager.ts` | Loads/saves config, merges env vars |
1868
- | **Inference Interface** | `src/inference/interface.ts` | `InferenceProvider` contract (`generate`, `isAvailable`, `getInfo`, `listModels`) |
1869
- | **Provider Factory** | `src/inference/factory.ts` | Instantiates the right adapter |
1870
- | **Adapters** | `src/inference/*-adapter.ts` | One per provider (Groq, NIM, Gemini, OpenRouter, Local) |
1871
- | **Model Discovery** | `src/cli/models.ts` | Lists and searches models from all providers |
1872
- | **Model Switch** | `src/cli/model.ts` | Context-preserving provider/model switching |
1873
- | **Project Scaffold** | `src/cli/init.ts` | Interactive project scaffolding with templates |
1874
- | **Skill Commands** | `src/cli/skill.ts` | List, compile, search, and run skill scripts |
1875
- | **Orchestrator** | `src/agents/orchestrator.ts` | Multi-agent pipeline coordinator (with context pruning) |
1876
- | **Context Cache** | `src/context/cache.ts` | SQLite-backed response caching |
1877
- | **Context Parser** | `src/context/parser.ts` | Multi-file reading, chunking, prioritization |
1878
- | **Context Pruner** | `src/learning/context-pruner.ts` | Token-aware context compression for long agent chains |
1879
- | **Skill Compiler** | `src/learning/skill-compiler.ts` | LLM-powered extraction of reusable patterns from trajectories |
1880
- | **Skill Store** | `src/learning/skill-store.ts` | Persistent skill storage with decay scoring |
1881
- | **Skill Runner Agent** | `src/agents/agents/skill-runner.ts` | Injects skill steps into the execution plan |
1882
- | **Plugin Registry** | `src/plugins/registry.ts` | Pluggable third-party provider system |
1883
- | **Logger** | `src/utils/logger.ts` | Colored, level-based logging |
1884
-
1885
- ---
1886
-
1887
- ## Workflow Examples
1888
-
1889
- ### Discover and Chat with a Model
1890
-
1891
- ```bash
1892
- # Step 1: See what's available on Groq
1893
- agent-nuvira models --provider groq
1894
-
1895
- # Step 2: Narrow down by keyword
1896
- agent-nuvira models --search deepseek
1897
-
1898
- # Step 3: Chat with a found model
1899
- agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
1900
- ```
1901
-
1902
- ### Hybrid Provider Usage
1903
-
1904
- Use different providers for different tasks:
1905
-
1906
- ```bash
1907
- # Use local models for quick, small edits
1908
- agent-nuvira edit README.md --instruction "fix typos" --provider local
1909
-
1910
- # Use Groq for fast code generation
1911
- agent-nuvira edit src/routes.ts --instruction "add validation" --provider groq
1912
-
1913
- # Use cloud models for complex planning
1914
- agent-nuvira plan . --task "design the database schema" --provider gemini
1915
-
1916
- # Use OpenRouter for diverse model selection
1917
- agent-nuvira chat --provider openrouter --model openai/gpt-4o
1918
- ```
1919
-
1920
- ### Multi-Agent Pipeline
1921
-
1922
- ```bash
1923
- # Let the multi-agent system handle everything
1924
- agent-nuvira execute "add input validation for all API routes"
1925
-
1926
- # With verbose logging to see each step
1927
- agent-nuvira execute "create a health check endpoint" --verbose
1928
-
1929
- # Use Groq for fast agent execution
1930
- agent-nuvira execute "refactor login logic" --provider groq
1931
- ```
1932
-
1933
- ---
1934
-
1935
- ## Plugin System: Adding a New Provider
1936
-
1937
- The plugin system allows you to add custom inference providers without modifying the CLI's core code.
1938
-
1939
- ### Step 1: Implement `InferenceProvider`
1940
-
1941
- Create a class that implements the `InferenceProvider` interface:
1942
-
1943
- ```typescript
1944
- import { InferenceProvider } from 'agent-nuvira';
1945
- import { InferenceOptions, ProviderConfig } from 'agent-nuvira';
1946
-
1947
- export class AnthropicAdapter implements InferenceProvider {
1948
- readonly name = 'Anthropic';
1949
- private config: ProviderConfig;
1950
-
1951
- constructor(config: ProviderConfig) {
1952
- this.config = config;
1953
- }
1954
-
1955
- async generate(prompt: string, options?: InferenceOptions): Promise<string> {
1956
- const apiKey = this.config.apiKey;
1957
- if (!apiKey) {
1958
- throw new Error('Anthropic API key not configured');
1959
- }
1960
-
1961
- const response = await fetch('https://api.anthropic.com/v1/messages', {
1962
- method: 'POST',
1963
- headers: {
1964
- 'x-api-key': apiKey,
1965
- 'anthropic-version': '2023-06-01',
1966
- 'Content-Type': 'application/json',
1967
- },
1968
- body: JSON.stringify({
1969
- model: options?.model || 'claude-3-haiku-20240307',
1970
- max_tokens: options?.maxTokens || 1024,
1971
- messages: [{ role: 'user', content: prompt }],
1972
- }),
1973
- });
1974
-
1975
- const data = await response.json();
1976
- return data.content[0].text;
1977
- }
1978
-
1979
- async isAvailable(): Promise<boolean> {
1980
- return !!this.config.apiKey;
1981
- }
1982
-
1983
- getInfo(): string {
1984
- return `Provider: Anthropic Claude\nModel: ${this.config.model || 'default'}\nStatus: ${this.config.apiKey ? '✅' : '❌'}`;
1985
- }
1986
-
1987
- async listModels(): Promise<Array<{ id: string; name: string; provider: string; owner?: string; description?: string }>> {
1988
- if (!this.config.apiKey) return [];
1989
- // Fetch models from Anthropic API
1990
- return [{ id: 'claude-3-haiku-20240307', name: 'claude-3-haiku-20240307', provider: 'Anthropic' }];
1991
- }
1992
- }
1993
- ```
1994
-
1995
- ### Step 2: Create a Plugin Wrapper
1996
-
1997
- ```typescript
1998
- import { ProviderPlugin, ProviderConfig, PluginMetadata } from 'agent-nuvira';
1999
- import { AnthropicAdapter } from './anthropic-adapter';
2000
-
2001
- export const AnthropicPlugin: ProviderPlugin = {
2002
- metadata: {
2003
- name: 'Anthropic Claude',
2004
- version: '1.0.0',
2005
- description: 'Anthropic Claude API integration',
2006
- author: 'You',
2007
- },
2008
-
2009
- getProviderType(): string {
2010
- return 'anthropic';
2011
- },
2012
-
2013
- createProvider(config: ProviderConfig): AnthropicAdapter {
2014
- return new AnthropicAdapter(config);
2015
- },
2016
- };
2017
- ```
2018
-
2019
- ### Step 3: Register the Plugin
2020
-
2021
- At your application's entry point:
2022
-
2023
- ```typescript
2024
- import { getPluginRegistry } from 'agent-nuvira';
2025
- import { AnthropicPlugin } from './anthropic-plugin';
2026
-
2027
- const registry = getPluginRegistry();
2028
- registry.register(AnthropicPlugin);
2029
- ```
2030
-
2031
- ### Step 4: Configure and Use
2032
-
2033
- Add the provider to your `nuvirarc.json`:
2034
-
2035
- ```json
2036
- {
2037
- "defaultProvider": "anthropic",
2038
- "providers": {
2039
- "anthropic": {
2040
- "apiKey": "sk-ant-...",
2041
- "model": "claude-3-haiku-20240307",
2042
- "temperature": 0.7,
2043
- "maxTokens": 4096
2044
- }
2045
- }
2046
- }
2047
- ```
2048
-
2049
- Then use it:
2050
-
2051
- ```bash
2052
- agent-nuvira chat --provider anthropic
2053
- ```
2054
-
2055
- > **Note:** Plugins placed in `~/.nuvira/plugins/` are **auto-discovered** at CLI startup — no manual registration required. Programmatic registration via the Plugin Registry API is also supported for advanced use cases.
2056
-
2057
- ---
2058
-
2059
- ## Development
2060
-
2061
- ### Setup
2062
-
2063
- ```bash
2064
- git clone https://github.com/imdheerajKube/agent-nuvira.git
2065
- cd agent-nuvira
2066
- npm install
2067
- ```
2068
-
2069
- ### Build
2070
-
2071
- ```bash
2072
- npm run build # Compile TypeScript to dist/
2073
- npm run dev # Build and run with tsx (fast)
2074
- ```
2075
-
2076
- ### Project Structure
2077
-
2078
- ```
2079
- src/
2080
- ├── index.ts # Entry point & public exports
2081
- ├── cli/
2082
- │ ├── router.ts # Command registration & provider resolution
2083
- │ ├── commands.ts # Base command class
2084
- │ ├── chat.ts # Interactive chat
2085
- │ ├── edit.ts # File editing
2086
- │ ├── models.ts # Model discovery (list/search models)
2087
- │ ├── model.ts # Context-preserving model switching
2088
- │ ├── skill.ts # Skill compilation & execution
2089
- │ ├── init.ts # Project scaffolding
2090
- │ ├── plan.ts # Implementation plans
2091
- │ ├── config.ts # Configuration management
2092
- │ ├── execute.ts # Multi-agent orchestration (with context pruning)
2093
- │ └── cache.ts # Cache management
2094
- ├── agents/
2095
- │ ├── agent.ts # Abstract Agent + types
2096
- │ ├── orchestrator.ts # Multi-agent pipeline coordinator
2097
- │ ├── context-vault.ts # Shared context bus
2098
- │ └── agents/
2099
- │ ├── planner.ts # PlannerAgent
2100
- │ ├── context-gatherer.ts
2101
- │ ├── writer.ts # WriterAgent
2102
- │ ├── reviewer.ts # ReviewerAgent
2103
- │ ├── runner.ts # RunnerAgent
2104
- │ ├── tester.ts # TesterAgent
2105
- │ ├── debugger.ts # DebuggerAgent
2106
- │ ├── skill-runner.ts # SkillRunnerAgent (injects skill steps)
2107
- │ ├── git-agent.ts
2108
- │ ├── package-agent.ts
2109
- │ ├── github-release-agent.ts
2110
- │ └── security-agent.ts
2111
- ├── config/
2112
- │ ├── types.ts # TypeScript types
2113
- │ └── manager.ts # Config load/save/env merging
2114
- ├── inference/
2115
- │ ├── interface.ts # InferenceProvider contract
2116
- │ ├── factory.ts # Provider instantiation
2117
- │ ├── sse.ts # Server-sent events streaming
2118
- │ ├── groq-adapter.ts # Groq LPU
2119
- │ ├── nim-adapter.ts # NVIDIA NIM
2120
- │ ├── gemini-adapter.ts # Google Gemini
2121
- │ ├── openrouter-adapter.ts # OpenRouter
2122
- │ └── local-adapter.ts # Ollama / HuggingFace / GGML
2123
- ├── context/
2124
- │ ├── cache.ts # SQLite response cache
2125
- │ ├── parser.ts # Multi-file context parsing
2126
- │ └── history.ts # Chat history persistence
2127
- ├── plugins/
2128
- │ └── registry.ts # Plugin registration system
2129
- ├── learning/
2130
- │ ├── skill-compiler.ts # LLM-powered skill extraction from trajectories
2131
- │ ├── skill-store.ts # Persistent skill storage with decay scoring
2132
- │ ├── skill-types.ts # Skill type definitions
2133
- │ ├── context-pruner.ts # Token-aware context compression
2134
- │ ├── model-router.ts # Adaptive model routing
2135
- │ ├── scorer.ts # Trajectory scoring
2136
- │ ├── pattern-extractor.ts
2137
- │ ├── agent-stats.ts
2138
- │ └── self-improver.ts
2139
- ├── memory/
2140
- │ ├── embedder.ts # LLM-based embeddings
2141
- │ ├── vector-store.ts # Cosine similarity search
2142
- │ ├── trajectory-store.ts
2143
- │ └── memory-integration.ts
2144
- ├── security/
2145
- │ └── scanner.ts # Prompt injection / secret scanner
2146
- └── utils/
2147
- ├── env.ts # Environment variable loader
2148
- └── logger.ts # Colored logging
2149
- ```
2150
-
2151
- ### Testing
2152
-
2153
- ```bash
2154
- # Run all tests (3,002 tests across 98 test files)
2155
- # Plus 6 dashboard component tests (src/web-dashboard)
2156
- npm test
2157
-
2158
- # Watch mode
2159
- npm run test:watch
2160
-
2161
- # With coverage
2162
- npm run test:coverage
2163
-
2164
- # Type-check without emitting files
2165
- npx tsc --noEmit
2166
- ```
2167
-
2168
- ---
2169
-
2170
- ## Roadmap
2171
-
2172
- **Phases 1–11 are complete** — from Foundation (Phase 0) through TS Compiler API-Aware Structural Editing (Phase 11). See [UPGRADE_ROADMAP.md](./UPGRADE_ROADMAP.md) for the full implementation journey.
2173
-
2174
- > 📊 **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. [GATEWAY.md](./docs/GATEWAY.md) — Complete user guide for the 22-platform multi-channel gateway: what it offers, CLI + dashboard setup for every platform, channel aliases, guaranteed delivery, natural-language task dispatch, security, and troubleshooting.
2175
-
2176
- | Phase | Feature | Status |
2177
- |---|---|---|
2178
- | **Phase 1: Quick Wins** | | |
2179
- | 1.1 | Auto-discovery plugin loader — drop `.js` into `~/.nuvira/plugins/` | ✅ Complete |
2180
- | 1.2 | Complete streaming support — all 17+ providers | ✅ Complete |
2181
- | 1.3 | Cost tracking — per-provider/session/monthly | ✅ Complete |
2182
- | 1.4 | `agent-nuvira init` — interactive project scaffolding | ✅ Complete |
2183
- | 1.5 | Prompt history search — keyword + semantic | ✅ Complete |
2184
- | 1.6 | Skill compiler — auto-extract reusable patterns from trajectories | ✅ Complete |
2185
- | 1.7 | Context-window memory pruner — prevent OOM in long chains | ✅ Complete |
2186
- | 1.8 | Context-preserving model switching — mid-session provider changes | ✅ Complete |
2187
- | **Phase 2: Structural Changes** | | |
2188
- | 2.1 | Native embedding support — 3-tier embedder (Xenova/Python/LLM) | ✅ Complete |
2189
- | 2.2 | Workflow template marketplace — 10 templates + registry | ✅ Complete |
2190
- | 2.3 | Model benchmarking — 21 tasks, scoring, A/B comparison | ✅ Complete |
2191
- | 2.4 | Docker sandbox isolation — resource limits, network isolation, 8 images | ✅ Complete |
2192
- | 2.5 | Provider health dashboard — `agent-nuvira doctor` | ✅ Complete |
2193
- | 2.6 | Memory compression & pruning — trajectory summarization | ✅ Complete |
2194
- | **Phase 3: Major Upgrades** | | |
2195
- | 3.1 | VS Code extension — 9 commands, inline suggestions, diff viewer, agent progress panel | ✅ Complete |
2196
- | 3.2 | **B1: Chat Panel** — Multi-turn chat with streaming, 6 slash commands, session history, file context | ✅ Complete (v1.33.0) |
2197
- | 3.3 | **B3: Diagnostic → AI Fix** — "Fix with Agent-Nuvira" in lightbulb menu on red squiggles | ✅ Complete (v1.33.0) |
2198
- | 3.4 | **B5: Code Lens Actions** — Test/Review/Explain/Fix actions above functions and classes | ✅ Complete (v1.34.0) |
2199
- | 3.5 | Remote agent federation — multi-machine collaboration | ✅ Complete |
2200
- | 3.3 | Web UI dashboard — React + Recharts + DAG visualization | ✅ Complete |
2201
- | 3.4 | Hybrid model routing — complexity-based model selection | ✅ Complete |
2202
- | 3.5 | Team collaboration — shared config, memory, and review pipelines | ✅ Complete |
2203
- | 3.6 | Agent SDK — `@agent-nuvira/sdk` npm package + scaffolding | ✅ Complete |
2204
- | 3.7 | Provider CLI (`agent-nuvira provider list/health`) | ✅ Complete |
2205
- | 3.8 | Provider fallback routing — auto-failover with circuit breaker | ✅ Complete |
2206
- | 3.9 | Security scan CLI (`agent-nuvira security scan`) | ✅ Complete |
2207
- | 3.10 | Feedback & rating system (`agent-nuvira feedback`) | ✅ Complete |
2208
- | 3.11 | Marketplace unified CLI (`agent-nuvira marketplace browse/search/install`) | ✅ Complete |
2209
- | **Phase 4: Industry Standards** | | |
2210
- | 4.1 | MCP (Model Context Protocol) — client/manager/CLI with SSE transport + Firecrawl | ✅ Complete |
2211
- | 4.2 | AST-aware code editing — structural analysis engine (JS/TS/Python/Go/Rust) | ✅ Complete |
2212
- | 4.3 | Auto error-repair engine — diagnosis & retry budgets for test failures | ✅ Complete |
2213
- | 4.4 | A2A (Agent-to-Agent) Protocol — inter-agent communication standard | ✅ Complete |
2214
- | 4.5 | CI/CD headless mode — `agent-nuvira ci` with GitHub Actions integration | ✅ Complete |
2215
- | 4.6 | npm publishing & one-line install — `npx agent-nuvira` / `npx buff` | ✅ Complete |
2216
- | **Phase 5: Interactive UX** | | |
2217
- | 5.1 | Interactive dev mode — guided loop with model picker, session save/resume | ✅ Complete |
2218
- | 5.2 | Failure analysis — per-agent-type diagnosis with recovery actions | ✅ Complete |
2219
- | 5.3 | Follow-up suggestions — LLM-powered contextual next-step recommendations | ✅ Complete |
2220
- | 5.4 | /fix command — retry last failed goal with failure context | ✅ Complete |
2221
- | 5.5 | Test coverage — 3,002 tests across 98 test files (+6 dashboard component tests) | ✅ Complete |
2222
- | **Phase 6: Architecture Migration** | | |
2223
- | 6.1 | RecoverModule — extracted from ErrorRepairEngine with RepairBudget | ✅ Complete (v1.18.0) |
2224
- | 6.2 | ModuleRegistry — plugin-based agent loading replacing createAgent() | ✅ Complete (v1.18.0) |
2225
- | 6.3 | EventBus — structured observability with 37+ typed events | ✅ Complete (v1.19.0) |
2226
- | 6.4 | ReportModule — 4 output formats (text/JSON/MD/GHA) | ✅ Complete (v1.20.0) |
2227
- | 6.5 | InspectModule — keyword + LLM codebase scanning | ✅ Complete (v1.20.0) |
2228
- | 6.6 | VerifyModule — security scan + explicit verification pipeline | ✅ Complete (v1.21.0) |
2229
- | 6.7 | PlanModule + EditModule — goal decomposition + file change generation | ✅ Complete (v1.22.0) |
2230
- | 6.8 | ExecuteModule + TestModule — command execution + sandboxed testing | ✅ Complete (v1.23.0) |
2231
- | **Phase 9: Safe Execution Layer** | | |
2232
- | 9.1 | SafeExecutionLayer — file validation, Docker sandbox, safe LLM calls, EventBus integration | ✅ Complete (v1.26.0) |
2233
- | 9.2 | VerifyModule EventBus tests — 9 emission tests for SAFE_EXEC_* events | ✅ Complete (v1.26.0) |
2234
- | **Phase 10: Autonomous Publish** | | |
2235
- | 10.1 | CredentialStore — interactive Git/npm credential collection, GIT_ASKPASS, SSH agent, .npmrc injection | ✅ Complete (v1.29.0) |
2236
- | 10.2 | PhaseExecutionEngine — multi-goal project scopes with save/resume across restarts | ✅ Complete (v1.29.0) |
2237
- | 10.3 | `agent-nuvira publish` — 5-phase pipeline: tests → version → git → npm → GitHub release | ✅ Complete (v1.29.0) |
2238
- | 10.4 | `agent-nuvira phase` — create/execute/resume/status/list scopes with credential management | ✅ Complete (v1.29.0) |
2239
- | **Phase 11: TS Compiler API-Aware Structural Editing** | | |
2240
- | 11.1 | TS Compiler API Wrapper (`ts-adapter.ts`) — parse, find nodes, validate syntax via real TS parser | ✅ Complete (v1.31.0) |
2241
- | 11.2 | Structural Transformations (`transform.ts`) — rename, extract, inline, add param, change signature | ✅ Complete (v1.31.0) |
2242
- | 11.3 | Two-Tier Editing Engine (`edit.ts` rewrite) — TS API-first, regex fallback for all 7 operations | ✅ Complete (v1.31.0) |
2243
- | 11.4 | Phase 11 Tests — 66 tests (40 ts-adapter + 26 transform), all passing | ✅ Complete (v1.31.0) |
2244
-
2245
- ---
2246
-
2247
- ## Version History
2248
-
2249
- | Version | Date | Key Changes |
2250
- |---------|------|-------------|
2251
- | **v1.76.1** | Aug 2026 | **Model Discovery Timeline** — new `/models/timeline` panel shows every model's freshness status, last-seen times, error rate, staleness classification; `/api/model-timeline` endpoint; auto-refreshes every 30s |
2252
- | **v1.76.0** | Aug 2026 | **Improved folder browser + Telegram auto-learning + Getting Started wizards** — Browse button redesigned with drive roots, breadcrumbs, search/filter, auto-refresh; Telegram contacts auto-learn real chat IDs; Platforms page with 22-platform grid; `agent-nuvira gateway setup [platform]` interactive wizard |
2253
- | **v1.75.3** | Aug 2026 | **Project picker fix + Telegram setup docs + CLI interactive mode** — removed broken "current dir" button, renamed label to "Select Project Folder", dashboard Channels tab shows 📖 Docs links and setup hints for every platform, `agent-nuvira gateway start` shows platform-specific setup instructions, CLI chat no longer exits after the initial task |
2254
- | **v1.75.2** | Aug 2026 | **Chat resolve loop fix + tool-loop step limit** — dashboard "No — ask the agent" button no longer loops back to the same command card, auto-routing shows a clear hint when falling back to local models, tool-loop step limit increased from 8 to 16 for complex tasks |
2255
- | **v1.75.0** | Aug 2026 | **Session resume + project-aware chat** — `--cwd` option for `agent-nuvira dashboard`, attached project scopes the agent's working directory (`toolContext.cwd`), 🗂️ folder browser for project attach, session resume auto-restores project context, project mismatch banner, sidebar shows project name per conversation; 4,864 root + 263 dashboard tests |
2256
- | **v1.74.2** | Aug 2026 | **Dashboard-first — chat is the front door (Phases 1–8 delivered)** — token-streaming typewriter, spec-complete markdown + syntax highlight, artifact cards (diff per-file accept/reject + commit-accepted, result, deploy — copy buttons + keyboard nav), inline command-run execution cards, project attach with code-map context, persisted sessions with smart-rail resume/search/rename/delete, composer attachments (file/paste/drag), /learn skill authoring + marketplace install, streaming cancel + retry; 4,864 root + 263 dashboard tests; CLI engine unchanged |
2257
- | **v1.63.0** | Aug 2026 | **Messaging campaign — 22-platform multi-channel gateway** — the full gateway surface with env-var-compatible credentials: DingTalk, Feishu, WeCom, Mattermost, Matrix, generic Webhook, BlueBubbles, ntfy, Teams, Google Chat, Weixin (iLink bot API), SMS (Twilio), IRC (RFC 1459 net/tls, two-way), SimpleX (daemon WS, two-way), Home Assistant (REST) on top of Telegram/Discord/Slack/WhatsApp — service-native `TWILIO_*`/`IRC_*`/`SIMPLEX_*`/`HASS_*` creds, zero new SDK deps; WhatsApp Baileys personal bridge (`agent-nuvira whatsapp pair`); guaranteed delivery ledger with auto-retry; dashboard Channels send-test; `agent-nuvira gateway status` platform-count line; SimpleX inbound (auto-accept + allowlists + reconnect); IRC inbound (addressing + allowlist + PING/PONG + reconnect); 4,280 tests |
2258
- | **v1.0.0** | Apr 2026 | Initial release — Core CLI with chat, 5 built-in providers (expandable to 17+ via plugins), config, models |
2259
- | **v1.1.0** | Apr 2026 | Model discovery with search/filter |
2260
- | **v1.2.0** | Apr 2026 | AI-assisted file editing (edit command) |
2261
- | **v1.3.0** | May 2026 | Implementation plans (plan command) |
2262
- | **v1.4.0** | May 2026 | Multi-agent pipeline (execute command) with Planner, Writer, ContextGatherer |
2263
- | **v1.5.0** | May 2026 | Additional agents — Tester, Runner, Debugger |
2264
- | **v1.6.0** | Jun 2026 | Agent retry logic, format validation, git integration |
2265
- | **v1.7.0** | Jun 2026 | Phase 1 features — plugin system, cost tracking, logging |
2266
- | **v1.8.0** | Jun 2026 | Native embeddings, vector store, trajectory memory |
2267
- | **v1.9.0** | Jul 2026 | Workflow templates, model benchmarking |
2268
- | **v1.10.0** | Jul 2026 | Docker sandbox, provider health dashboard |
2269
- | **v1.11.0** | Jul 2026 | Skill compiler, context pruner, model switching |
2270
- | **v1.12.0** | Jul 2026 | VS Code extension, web dashboard, agent federation |
2271
- | **v1.13.0** | Jul 2026 | Hybrid model routing, team collaboration, Agent SDK |
2272
- | **v1.14.0** | Jul 2026 | Provider fallback, security scan, feedback system, marketplace CLI |
2273
- | **v1.14.6** | Jul 2026 | Skill compiler system, context-window pruner, Docker Compose onboarding |
2274
- | **v1.15.0** | Aug 2026 | npm publishing — `npx buff` / `npx agent-nuvira` live on npm (1.3 MB) |
2275
- | **v1.15.1** | Aug 2026 | Interactive dev mode — model picker, session tracking, /save / /resume, /suggest |
2276
- | **v1.15.2** | Aug 2026 | Windows compatibility fixes |
2277
- | **v1.15.3** | Aug 2026 | Accessibility fix — `window.open` → native `<a>` tags |
2278
- | **v1.15.4** | Aug 2026 | Search/filter bar, column count toggle, speech provider section |
2279
- | **v1.15.5** | Aug 2026 | SSE header support for MCP |
2280
- | **v1.15.6** | Aug 2026 | Firecrawl integration for web search |
2281
- | **v1.16.0** | Aug 2026 | Comprehensive MCP README docs, SSE header support |
2282
- | **v1.16.1** | Aug 2026 | Interactive dev mode enhancements — failure analysis, follow-up suggestions, /fix command, 35 new unit tests |
2283
- | **v1.26.0** | Aug 2026 | Phase 9 — SafeExecutionLayer module (file validation, Docker sandbox, safe LLM calls) + 32 new tests (23 SafeExec + 9 Verify Bus) |
2284
- | **v1.27.0** | Aug 2026 | Website + SVG — Phase 9 SafeExecutionLayer, phase progress 9/9, 2,207 tests |
2285
- | **v1.29.0** | Sep 2026 | Phase 10 — Autonomous publish + phase-wise execution (CredentialStore, PhaseEngine, `agent-nuvira publish`, `agent-nuvira phase`, git push, npm auth) + 86 new tests |
2286
- | **v1.30.0** | Sep 2026 | Phase 10 tests + docs — 80 unit tests (CredentialStore + PhaseExecutionEngine), README/Product_Guide/website updated with Phase 10 progress |
2287
- | **v1.31.0** | Sep 2026 | Phase 11 — TS Compiler API-Aware Structural Editing (ts-adapter.ts, transform.ts, edit.ts rewrite, 66 new tests), proper parser-level accuracy for TS/JS edits |
2288
- | **v1.32.0** | Oct 2026 | Pillar A — GitLab Agent (MRs, issues, pipelines) + PR Review Agent (inline review, security scans) + website Git & PR section |
2289
- | **v1.33.0** | Oct 2026 | Pillar B1+B3 — VS Code Chat Panel with streaming, slash commands, session history + Diagnostic → AI Fix from lightbulb menu |
2290
- | **v1.34.0** | Oct 2026 | Pillar B5 — VS Code Code Lens actions (Test/Review/Explain/Fix) via quick pick menu above functions and classes |
2291
- | **v1.42.0** | Aug 2026 | Learning-router escalation + per-model bandit priors + Promotion Gate (ruflo ADR-149/150 mirrors) |
2292
- | **v1.43.0** | Aug 2026 | Startup progress feedback + Auto-mode session failover on token expiry |
2293
- | **v1.44.0** | Aug 2026 | Central quota ledger, per-subtask complexity labels, free/local-first gate |
2294
- | **v1.45.0** | Aug 2026 | Checkpoint/resume pipelines + quota cost-transparency card |
2295
- | **v1.45.5** | Aug 2026 | Opt-in Auto failover confirmation (interactive + one-shot) |
2296
- | **v1.46.0** | Aug 2026 | Always-on dashboard quota watcher |
2297
- | **v1.47.0** | Aug 2026 | Vector retrieval — token-efficient context via local embeddings + pure-JS vector store |
2298
- | **v1.48.0** | Aug 2026 | FAISS-style vector search backend — pluggable `VectorStore` (pure-JS IVF-flat ANN + optional native tier) |
2299
- | **v1.49.0** | Aug 2026 | Hermetic memory tests, IVF-vs-exact recall/latency benchmark, cross-session backend transparency |
2300
- | **v1.49.1** | Aug 2026 | Native FAISS tier actually activates — rewritten for the real `@faiss-node/native` v0.1.11 API; `agent-nuvira memory backend --check` |
2301
- | **v1.50.0** | Aug 2026 | `agent-nuvira memory backend --check` diagnostics — active backend, why it was chosen, native-FAISS availability probe + install guidance |
2302
- | **v1.51.0** | Aug 2026 | Routing strategy super-enhancement — Thompson-sampling bandit, uncertainty escalation, per-model learning, promotion gate A/B, routing rules, hard constraints, credential-aware filtering, quota-ledger integration, runtime stats blending, verification escalation, free/local-first gate; 2,934 tests |
2303
- | **v1.51.1** | Aug 2026 | Docs patch — completed the published README version-history table (added v1.50.0 + v1.51.0 rows) |
2304
- | **v1.52.0** | Aug 2026 | Predictive model-availability routing (registry drives every pick — dead/unkeyed providers skipped before scoring, no more wasted first calls); web dashboard: scrubbable pipeline phase timeline + narrated "why did the router pick this?" walkthrough; 2,990 tests |
2305
- | **v1.53.0** | Aug 2026 | Per-action "learned from real usage" telemetry everywhere (chat/execute/plan/edit/skill/learn/ci/doctor all write the registry; dashboard panel + `models status --verbose` show who killed/verified what); daily timeline chart in the dashboard; recovery loop (a later real success un-parks + re-verifies a recovered provider); hermetic E2E failover test (`tests/e2e/`) proving "registry learns the block, next pick skips it"; 2,996 tests |
2306
- | **v1.54.0** | Aug 2026 | VS Code extension telemetry attribution — the extension tags every IDE-driven LLM call with `BUFF_TELEMETRY_ACTION` (`ide-chat` / `ide-inline` / `ide-<command>`) so IDE usage gets its own rows in the per-action "learned from real usage" registry log + dashboard panel; 3,002 tests |
2307
- | **v1.55.0** | Aug 2026 | `agent-nuvira models unblock <provider>` escape hatch — manually release a registry-blocked provider (demote unavailable→unverified, clear quota parks + ledger cooldown, live re-probe with honest `stillBlocked`); also fixed the pre-existing `models status --json` / `refresh --json` flag-shadowing bug; 3,011 tests |
2308
- | **v1.60.0** | Aug 2026 | **No hardcoded model defaults — fully dynamic selection** — `defaultProvider` is now `'auto'`, resolved at runtime to the best *available* provider for your keys + learned registry (verified → configured-with-key → zero-config local); every provider's model pin is the `'default'` sentinel, resolved at call time to a registry-verified working model (explicit pins still win, health-checked). New `src/learning/model-selection.ts` is the single selection authority (`rankAvailableProviders` / `resolveDefaultProvider` / `requireAdapterModel`); fallback chains are built from what you actually configured — never a fixed list; `'auto'` can never reach an adapter factory (onboarding guidance instead); 3,395 tests |
2309
- | **v1.60.1** | Aug 2026 | **Live per-model context windows feed the router's context preflight** — the model probe records each provider-advertised context window into the Model Availability Registry (Ollama `/api/tags` `general.context_length`, OpenRouter `/models` `context_length`); `resolveContextWindow` precedence: user override → **live registry descriptor** → provider-level estimate → generous default; `ModelDescriptor`/`ModelRegistryEntry` gain `contextWindowTokens`; 3,398 tests |
2310
- | **v1.60.2** | Aug 2026 | **Live context windows for every provider that exposes one** — Ollama multi-source parsing (`details.context_length` on 0.32.x, `general`/`llama`/family-keyed `model_info`) + bounded `/api/show` fallback (max 8 lookups — live-verified `gemma4:e4b` → 131,072); Gemini `inputTokenLimit` (gated on `generateContent`); NIM `max_model_len` (vLLM-backed); Groq documented as not exposing one; 3,404 tests |
2311
- | **v1.60.3** | Aug 2026 | **Reasoning traces + failure-lesson memory + goal-fidelity planning** — P0 per-step reasoning-trace capture (`agent-nuvira trace list/show/replay/clear` + dashboard 🔍 Reasoning Traces panel: agent × model × prompt digest × tokens × latency × routing snapshot); P1 self-improver distills negative trajectories into episodic failure-lesson memory injected into future planning prompts; **planner goal-fidelity guard** rejects off-topic / few-shot-regurgitated plans (the NVDA-addon failure mode) with an actionable error; **planner-repair model escalation** re-routes a failed planner through the Auto router at the next complexity level; 3,447 tests |
2312
- | **v1.60.4** | Aug 2026 | **Per-task repair model escalation for ALL agents** — the stronger-model escalation that fixed planner failures now applies to writer/debugger/security/tester/reviewer: a failing task's repair is handed a re-routed LLM at the next complexity level, climbing from the ROUTED complexity (latched per task id) so repair is always strictly above the tier that failed; `createEscalatedLLM` is the single shared escalation primitive; 3,452 tests |
2313
- | **v1.61.0** | Aug 2026 | **Routing + config-hygiene program (Issues 001–004)** — (1) **ALL 17+ configured providers join routing** via a dynamic `provider-catalog.ts` single source of truth (21 providers: env var, base URL, OpenAI-compat, keyless, capabilities, pricing, context window) + a generic `OpenAICompatAdapter`; nothing is hardcoded — whatever the user keys up is what the router scores; (2) **the router now leverages the data it already gathers** — registry pre-filters degrade dead providers (0 verified + ≥3 unavailable), the Thompson-sampling bandit is ON by default, context-window sources are transparent, and decision explanations cite the registry counts that excluded a provider; (3) **router tech fires at ALL action points** — `agent-nuvira plan` / `eval --routing` / `benchmark` / `model explain` / `edit --auto-route` now resolve through the shared `buildAutoResolveOptions()` full feature set (bandit, quota-ledger, runtime stats, cost/speed/reasoning floors, escalation, paid gate, context preflight) instead of degraded paths; (4) **invalid API keys are auto-cleared + stale local models purged** — a provider with 3 consecutive 401/403s has its dead key removed from config (or told which env var to fix) with a clear error, and `agent-nuvira models refresh` prunes local models that were deleted (`ollama rm`) — verified entries are demoted (telemetry preserved) rather than hard-deleted; 3,510 tests |
2314
- | **v1.59.4** | Aug 2026 | P6 M6.6 Software Bill of Materials: `agent-nuvira sbom` (CycloneDX 1.5 from lockfile, `--reproducible` pins), `sbom verify` (drift/tamper), `sbom licenses` (copyleft/unknown audit), `doctor --enterprise` Supply Chain check; 3,313 tests |
2315
- | **v1.59.5** | Aug 2026 | Dashboard surfaces mid-stream flakiness end-to-end: violet `⏸ flaky N%` chips on registry rows (mirroring the CLI's `model explain` chip), `⏸ N flaky` provider badges, and a **Flaky mid-stream** stats card — the exact signal `routing.partialFlakiness` uses to deprioritize providers; 3,313 root tests |
2316
- | **v1.59.9** | Aug 2026 | **Config-path consistency** — `BUFF_CONFIG_DIR` is now honored by the config manager, dashboard server readers, and vector-store backend picker via one shared resolver (explicit dir > `$BUFF_CONFIG_DIR` > `~/.buff`); hermetic/alternate-config runs can never leak into the real `~/.nuvira/nuvirarc.json`; 3,367 root tests |
2317
- | **v1.59.8** | Aug 2026 | P6 M6.4 **Nuvira Gateway (minimal slice)** — federation handshake becomes token-verified (`--auth oidc` + `JwtOidcAdapter`, dependency-free RS256 JWT check; PEM path persists for daemon restart) + dashboard **RBAC identity card** (whoami mirror) + **secrets hardening** (`doctor --enterprise` flags plaintext `apiKeys` arrays) + admin guard-coverage parity test; 3,363 root tests |
2318
- | **v1.59.7** | Aug 2026 | P6 M6.1 **RBAC** — `agent-nuvira admin role add/remove/list` + `whoami` (admin/operator/viewer permission matrix over the admin surface; OIDC adapter interface; legacy single-user stays permissive until roles assigned) + dashboard **governance policy card** (live `routing.governance.*`) + CLI **flakiness trend tags** (`healing`/`worsening` in `models status`); 3,348 root tests |
2319
- | **v1.59.6** | Aug 2026 | P6 M6.5 **Admin governance API** (`agent-nuvira admin policy/allow/deny/allow-model/deny-model/max-cost/pii-min/unblock/clear` over the M2.4 policy) + dashboard **flakiness healing sparklines** (per-entry `partialHistory` trajectory, never hard-wiped) + Requests panel `⏸ N` partial chips (partials excluded from error rate); 3,328 root tests |
2320
- | **v1.59.3** | Aug 2026 | `config set routing.<gate>` now accepts the boolean soft-signal keys (`capabilityFit`, `contextFit`, `partialFlakiness`); 3,286 tests |
2321
- | **v1.59.2** | Aug 2026 | P4 M4.4 partial flakiness now feeds the ROUTER: registry `partialRate` EMA (bumped by mid-stream interruptions, healed by clean successes, never flips status) → reliability penalty (capped 40%) gated by `routing.partialFlakiness` (default ON) + transparent `⏸ flaky` chip in `models explain`; 3,284 tests |
2322
- | **v1.59.1** | Aug 2026 | Dashboard: P4 M4.4 partial mid-stream interruption chips surface end-to-end (violet `⏸` timeline segment, day chips with streamed-chunk tooltip, per-action Partial section + stat); 3,276 tests |
2323
- | **v1.59.0** | Aug 2026 | P6 Enterprise Hardening begins: M6.2 secret-redaction scrubber (every log + audit line scrubbed; `BUFF_NO_REDACT` debug escape) + M6.3 tamper-evident SHA-256 hash-chained audit (`agent-nuvira audit verify/export`, sidecar head state, legacy-compat) — `doctor --enterprise` audit checks now detect tampering with the exact line; 3,275 tests |
2324
- | **v1.58.9** | Aug 2026 | P7 M7.4 opt-in gateway telemetry/usage-health flags (`routing.gatewayTelemetry.enabled` + `healthFlags`, OFF by default, privacy-safe — aggregates only, never prompt content) surfaced via `doctor --enterprise`; 3,232 tests |
2325
- | **v1.58.8** | Aug 2026 | **Permanent fix for the persistent dashboard "server unreachable / Failed to fetch" issue** — server now binds BOTH IPv4 + IPv6 loopback (macOS resolves `localhost` → ::1 first), CLI opens deterministic 127.0.0.1 |
2326
- | **v1.58.7** | Aug 2026 | M4.4 conservative compression (lossless-for-code, off by default) + `partial` mid-stream telemetry + `agent-nuvira doctor --enterprise` self-check (gateway, secrets, audit, RBAC) + upgrade guide (P7 M7.2) |
2327
- | **v1.58.6** | Aug 2026 | Fixed `routing.*` config never surviving a reload — `loadConfig` now merges the routing section (bandit/quota/governance/contextWindows/nuviraSidecar), so `agent-nuvira config set routing.*` persists across restarts (regression test) |
2328
- | **v1.58.5** | Aug 2026 | P5 config-key support — `agent-nuvira config set routing.nuviraSidecar.enabled\|image` (additive M5.4 keys; 2 new config tests) |
2329
- | **v1.58.4** | Aug 2026 | Nuvira-Router **P5 sidecar** (docker-compose.nuvira.yml profile + `agent-nuvira doctor --nuvira` probe; nuvira joins the auto-router provider universe with a neutral profile; keyless gateways supported) + **P4 resilience core** (mid-stream continuation retry — buffered tokens + bounded continue-note on chat auto-failover, reasoning-replay cache with SSE `reasoning_content` capture, context-relay summaries); 3,300+ tests |
2330
- | **v1.58.3** | Aug 2026 | Nuvira-Router P3: dashboard **Requests panel** (per provider×model×action request stats — failures, avg/p50/p95/p99 latency, measured spend from the cost ledger) + **`models explain --since <ref>` decision diff** (before→after candidate score changes, winner changes); 3,161+ tests + 54 dashboard component tests |
2331
- | **v1.58.2** | Aug 2026 | Models dashboard "Failed to fetch" repeat fix — the panel fetch is now resilient: per-fetch timeouts, independent health/registry fetches (one failing never hides the other), auto-retry with backoff on transient network failures, and fast self-healing re-poll after a failure (no more stuck error banner); 3,161 tests + 48 dashboard component tests |
2332
- | **v1.58.1** | Aug 2026 | Dashboard mirrors the CLI `model explain` guarantees — the Auto Router panel renders the M2.x chips (🎯 fit / 📏 measured·📐 estimated / ⏳ ctx) on every provider row, served by `/api/routing` + `/api/all`; docs sync (`MODELS_EXPLAIN_DEMO.md` dashboard section); 3,161 tests + 45 dashboard component tests |
2333
- | **v1.58.0** | Aug 2026 | Nuvira-Router P2: capability-aware scoring (`routing.capabilityFit` gate), wire-token measured-cost inputs (real `usage` tokens beat the 2,000/500 estimate; `models explain` shows 📏 measured vs 📐 estimated), multi-account key rotation (multiple `apiKeys` per provider, dead accounts parked + skipped, `tests/e2e/key-rotation`), governance constraints (`routing.governance` — provider/model allow-allow & deny lists, admin per-call max-cost cap, PII-domain block; hard policy violations refuse to serve with `PIIPolicyError`/`GovernancePolicyError`), context-length preflight (`routing.contextFit` — nominal window vs estimated payload, `⏳ ctx N%` chip in `models explain`); also ships the dashboard `--force` + `--port` fixes previously staged as v1.57.0 (never published); 3,159 tests + 42 dashboard component tests |
2334
- | **v1.57.0** | Aug 2026 | `agent-nuvira dashboard --force` — detect a STALE dashboard on the port (API/SSE mismatch: /api/model-registry answers SPA HTML instead of JSON) and offer to restart it: probe classifies port state (current dashboards and non-dashboard processes are never touched), confirms, finds the PID, kills it, waits for the port to free, and re-binds a fresh server; also fixed the pre-existing `--port` bug — the server bound the import-time 3030 default, now it resolves the bind at call time from explicit overrides; 3,032 tests + 42 dashboard component tests |
2335
- | **v1.56.1** | Aug 2026 | Dashboard Models-panel crash fix — "Failed to execute 'json' on 'Response': Unexpected token '<'" when a stale dashboard server returns SPA HTML for an unknown /api/* route: unknown /api/* now returns a JSON 404, all /api/* responses parse through a shared defensive helper (Content-Type check + try/catch, optional sections degrade to hidden), and `agent-nuvira dashboard` logs a clear EADDRINUSE message instead of crashing; 3,011 tests + 42 dashboard component tests |
2336
- | **v1.56.0** | Aug 2026 | Dashboard per-action telemetry timeline is now scrubbable — drag across days, click a day, or use the range slider to see that day's exact verified/killed chips (which provider × model each action killed or verified), with ▶ play/pause day-by-day sweep; timeline day buckets carry deduped raw events end-to-end; 3,011 tests + 39 dashboard component tests |
2337
-
2338
- ---
2339
-
2340
- ## Phase-Wise Feature Summary
2341
-
2342
- ### Phase 0: Foundation — Core CLI & Provider Layer
2343
- | Feature | Description |
2344
- |---------|-------------|
2345
- | **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) |
2346
- | **Unified CLI** | 25+ commands via Commander.js with shared options |
2347
- | **Config System** | JSON config file + env vars + CLI flags priority chain |
2348
- | **Streaming** | Real-time token-by-token output for all 17+ providers |
2349
- | **Response Caching** | SQLite-backed cache with configurable TTL |
2350
- | **Chat Interface** | Interactive chat with conversation history and `/` commands |
2351
- | **File Editing** | AI-assisted file editing with dry-run mode |
2352
- | **Implementation Plans** | Codebase-aware plan generation with architecture impact analysis |
2353
-
2354
- ### Phase 1: Quick Wins — Developer Experience
2355
- | Feature | Description |
2356
- |---------|-------------|
2357
- | **Plugin System** | Programmatic API + auto-discovery from `~/.nuvira/plugins/` |
2358
- | **Project Scaffolding** | `agent-nuvira init` with 5 built-in templates + interactive provider wizard |
2359
- | **Model Discovery** | `agent-nuvira models` with search/filter across all providers |
2360
- | **Model Switching** | Context-preserving provider/model switch mid-session |
2361
- | **Cost Tracking** | Per-provider, per-session, and monthly cost dashboards |
2362
- | **History Search** | Keyword + semantic search across past conversations |
2363
- | **Skill Compiler** | Auto-extracts reusable patterns from trajectories into runnable skills |
2364
- | **Context Pruner** | 5-strategy token compression for long agent chains |
2365
-
2366
- ### Phase 2: Structural Changes — Memory & Infrastructure
2367
- | Feature | Description |
2368
- |---------|-------------|
2369
- | **Vector Store** | Cosine similarity search over embedded trajectories |
2370
- | **Trajectory Store** | Few-shot example storage with quality scoring |
2371
- | **3-Tier Embedder** | Xenova (fast) → Python (medium) → LLM (fallback) |
2372
- | **Workflow Marketplace** | 10 built-in templates + GitHub registry with install/publish |
2373
- | **Model Benchmarking** | 21 standardized coding tasks with scoring and A/B comparison |
2374
- | **Docker Sandbox** | 8 base images, resource limits, network-isolated execution |
2375
- | **Provider Health** | `agent-nuvira doctor` with color-coded status, watch mode, auto-fix |
2376
- | **Memory Compression** | Automatic trajectory summarization with configurable retention |
2377
-
2378
- ### Phase 3: Major Upgrades — Advanced Agent Systems
2379
- | Feature | Description |
2380
- |---------|-------------|
2381
- | **VS Code Extension** | Chat Panel (streaming, slash commands), Diagnostic→AI Fix, Code Lens actions, 9 commands, inline suggestions, diff viewer, agent progress panel |
2382
- | **Agent Federation** | Multi-machine collaboration via A2A protocol, server, and client |
2383
- | **Web Dashboard** | React + Recharts + DAG visualization, model health, cost charts |
2384
- | **Hybrid Model Routing** | Complexity-based model selection with cost optimization |
2385
- | **Team Collaboration** | Git-synced shared config, memory, and review pipelines |
2386
- | **Agent SDK** | `@agent-nuvira/sdk` npm package with scaffolding CLI |
2387
- | **Provider CLI** | `agent-nuvira provider list/health` with per-provider diagnostics |
2388
- | **Provider Fallback** | Auto-failover with circuit breaker and configurable chain |
2389
- | **Security Scanner** | Detects PII, prompt injections, and dangerous code patterns |
2390
- | **Feedback System** | `agent-nuvira feedback record/list/stats/clear` drives self-improvement |
2391
- | **Marketplace CLI** | Unified `agent-nuvira marketplace browse/search/install/info` |
2392
-
2393
- ### Phase 4: Industry Standards — Protocol & Integration
2394
- | Feature | Description |
2395
- |---------|-------------|
2396
- | **MCP Protocol** | Model Context Protocol client/manager with stdio + SSE transport |
2397
- | **AST Editing Engine** | Structural code analysis for JS/TS/Python/Go/Rust |
2398
- | **Auto Error-Repair** | Automatic diagnosis and repair with configurable retry budgets |
2399
- | **A2A Protocol** | Agent-to-Agent communication standard for federation |
2400
- | **CI/CD Headless** | `agent-nuvira ci` for automated pipelines with GitHub Actions |
2401
- | **npm Publishing** | `npx agent-nuvira` / `npx buff` for zero-setup onboarding |
2402
-
2403
- ### Phase 5: Interactive UX — Developer Experience
2404
- | Feature | Description |
2405
- |---------|-------------|
2406
- | **Interactive Dev Mode** | Guided loop with model picker, session management, and goal tracking |
2407
- | **Session Save/Resume** | Save and restore development sessions with full history |
2408
- | **Failure Analysis** | Per-agent-type diagnosis with specific recovery actions |
2409
- | **Follow-up Suggestions** | LLM-powered contextual next-step recommendations |
2410
- | **/fix Command** | Retry last failed goal with failure context |
2411
- | **Graceful Error Recovery** | Rate-limit handling, auth failures, and network error recovery |
2412
-
2413
- ### Phase 6: Architecture Migration — Modular Plugin Architecture
2414
- | Feature | Description |
2415
- |---------|-------------|
2416
- | **RecoverModule (Phase 1)** | Extracted from ErrorRepairEngine — discriminated union strategies + RepairBudget (3 attempts with exponential backoff) |
2417
- | **ModuleRegistry (Phase 2)** | Plugin-based agent loading — 14 built-in agent modules, `register()` / `load()` / `unload()` lifecycle, EventBus integration |
2418
- | **EventBus (Phase 3)** | Structured observability — 37+ typed events, 4 built-in consumers (Logger, Metrics, Audit, MetricsBuffer), typed event schema |
2419
- | **ReportModule (Phase 4)** | 4 output formats (markdown, JSON, summary, verbose) — extractable from buildResult() |
2420
- | **InspectModule (Phase 5)** | Keyword scanning + LLM-based file classification — ContextGatherer wrapper with depth-limited walk, .nuviraignore support |
2421
- | **VerifyModule (Phase 6)** | 4 check types (security, goal-alignment, tests, code-quality) — configurable strictness (low/medium/high), pass/fail scoring |
2422
- | **PlanModule (Phase 7)** | Goal decomposition — 3 JSON parsing strategies, step normalization, fallback plan, EventBus events |
2423
- | **EditModule (Phase 7)** | File change generation — AST syntax validation, token-budget-aware file selection, 2-attempt retry loop, model-switch support |
2424
- | **ExecuteModule (Phase 8)** | Command execution — 5-strategy command inference (backtick, Run prefix, npm patterns, file extension), npm test validation |
2425
- | **TestModule (Phase 8)** | Sandboxed test execution — temp directory, multi-framework output parsing (vitest, jest, generic), EventBus events |
2426
- | **SafeExecutionLayer (Phase 9)** | 3-domain safety system — file validation (size, gitignore, syntax, security scan), Docker sandbox (resource limits, container lifecycle), safe LLM calls (injection guardrail, prompt/response truncation, exponential backoff with circuit breaker) |
2427
- | **CredentialStore (Phase 10)** | Interactive Git/npm credential collection — auto-detection from env vars (GITHUB_TOKEN, GH_TOKEN, NPM_TOKEN), GIT_ASKPASS setup for HTTPS auth, SSH agent integration with passphrase support, .npmrc token injection |
2428
- | **PhaseExecutionEngine (Phase 10)** | Multi-goal project scope execution — sequential phase execution with save/resume across restarts, credential management, progress tracking |
2429
- | **`agent-nuvira publish` (Phase 10)** | Autonomous 5-phase publish pipeline — test verification → version bump → git commit/tag/push → npm build/publish → GitHub release |
2430
- | **`agent-nuvira phase` (Phase 10)** | Phase-wise project execution CLI — create/execute/resume/status/list/delete scopes with interactive pauses and credential collection |
2431
- | **TS Compiler API Wrapper (Phase 11)** | Proper TypeScript Compiler API integration — parser-level accuracy with parseSourceFile, findStructuralNodes, validateTSSyntax, replaceNodeText, and insertAt |
2432
- | **Structural Transformations (Phase 11)** | Real code transformations — renameSymbol, extractFunction, inlineFunction, addParameter, changeSignature with NLP-based detection |
2433
- | **Two-Tier Editing Engine (Phase 11)** | All 7 edit operations try TS Compiler API first (for TS/JS), fall back to regex (for Python/Go/Rust) — AST-aware `tryFindNodeTS()` helper |
2434
-
2435
- ### Agent Catalog — 15 Agent Roles & Management
2436
- | Agent/Component | Type | Description |
2437
- |-----------------|------|-------------|
2438
- | **PlannerAgent** | Core | Analyzes goals, creates dependency-aware task plans |
2439
- | **ContextGathererAgent** | Core | Scans codebase, identifies relevant files and artifacts |
2440
- | **WriterAgent** | Core | Implements code changes based on plan and gathered context |
2441
- | **ReviewerAgent** | Core | Validates changes for bugs, security, and style |
2442
- | **RunnerAgent** | Execution | Executes shell commands and captures output |
2443
- | **TesterAgent** | Testing | Runs tests in sandboxed temp directory or Docker container |
2444
- | **DebuggerAgent** | Testing | Iteratively diagnoses and fixes test failures via LLM |
2445
- | **GitAgent** | Publishing | Creates branches, commits with LLM messages, generates PR descriptions |
2446
- | **PackageAgent** | Publishing | Bumps version, builds, publishes to npm, generates changelogs |
2447
- | **GitHubReleaseAgent** | Publishing | Creates tags, release notes, and GitHub releases via `gh` CLI or API |
2448
- | **SecurityAgent** | Safety | Scans for PII, prompt injection, and dangerous code patterns |
2449
- | **SkillRunnerAgent** | Learning | Executes compiled skill scripts as pre-built task plans |
2450
- | **MCPAgent** | Integration | Invokes MCP tools from connected servers via stdio or SSE transport |
2451
- | **Orchestrator** | Management | Coordinates all agents with dependency-aware scheduling, parallel execution, context pruning, and interactive recovery |
2452
-
2453
- ## License
2454
-
2455
- MIT
7
+ ## Setup