agent-nuvira 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +891 -0
  3. package/dist/agent-sdk/src/agent.d.ts +118 -0
  4. package/dist/agent-sdk/src/agent.d.ts.map +1 -0
  5. package/dist/agent-sdk/src/agent.js +88 -0
  6. package/dist/agent-sdk/src/agent.js.map +1 -0
  7. package/dist/agent-sdk/src/index.d.ts +33 -0
  8. package/dist/agent-sdk/src/index.d.ts.map +1 -0
  9. package/dist/agent-sdk/src/index.js +32 -0
  10. package/dist/agent-sdk/src/index.js.map +1 -0
  11. package/dist/agent-sdk/src/register.d.ts +70 -0
  12. package/dist/agent-sdk/src/register.d.ts.map +1 -0
  13. package/dist/agent-sdk/src/register.js +181 -0
  14. package/dist/agent-sdk/src/register.js.map +1 -0
  15. package/dist/agent-sdk/src/scaffold.d.ts +50 -0
  16. package/dist/agent-sdk/src/scaffold.d.ts.map +1 -0
  17. package/dist/agent-sdk/src/scaffold.js +291 -0
  18. package/dist/agent-sdk/src/scaffold.js.map +1 -0
  19. package/dist/agent-sdk/src/testing.d.ts +187 -0
  20. package/dist/agent-sdk/src/testing.d.ts.map +1 -0
  21. package/dist/agent-sdk/src/testing.js +243 -0
  22. package/dist/agent-sdk/src/testing.js.map +1 -0
  23. package/dist/agent-sdk/src/types.d.ts +202 -0
  24. package/dist/agent-sdk/src/types.d.ts.map +1 -0
  25. package/dist/agent-sdk/src/types.js +11 -0
  26. package/dist/agent-sdk/src/types.js.map +1 -0
  27. package/dist/agents/agent.d.ts +132 -0
  28. package/dist/agents/agent.d.ts.map +1 -0
  29. package/dist/agents/agent.js +19 -0
  30. package/dist/agents/agent.js.map +1 -0
  31. package/dist/agents/agents/context-gatherer.d.ts +42 -0
  32. package/dist/agents/agents/context-gatherer.d.ts.map +1 -0
  33. package/dist/agents/agents/context-gatherer.js +366 -0
  34. package/dist/agents/agents/context-gatherer.js.map +1 -0
  35. package/dist/agents/agents/debugger.d.ts +58 -0
  36. package/dist/agents/agents/debugger.d.ts.map +1 -0
  37. package/dist/agents/agents/debugger.js +257 -0
  38. package/dist/agents/agents/debugger.js.map +1 -0
  39. package/dist/agents/agents/git-agent.d.ts +34 -0
  40. package/dist/agents/agents/git-agent.d.ts.map +1 -0
  41. package/dist/agents/agents/git-agent.js +200 -0
  42. package/dist/agents/agents/git-agent.js.map +1 -0
  43. package/dist/agents/agents/github-release-agent.d.ts +65 -0
  44. package/dist/agents/agents/github-release-agent.d.ts.map +1 -0
  45. package/dist/agents/agents/github-release-agent.js +439 -0
  46. package/dist/agents/agents/github-release-agent.js.map +1 -0
  47. package/dist/agents/agents/package-agent.d.ts +33 -0
  48. package/dist/agents/agents/package-agent.d.ts.map +1 -0
  49. package/dist/agents/agents/package-agent.js +233 -0
  50. package/dist/agents/agents/package-agent.js.map +1 -0
  51. package/dist/agents/agents/planner.d.ts +26 -0
  52. package/dist/agents/agents/planner.d.ts.map +1 -0
  53. package/dist/agents/agents/planner.js +222 -0
  54. package/dist/agents/agents/planner.js.map +1 -0
  55. package/dist/agents/agents/reviewer.d.ts +34 -0
  56. package/dist/agents/agents/reviewer.d.ts.map +1 -0
  57. package/dist/agents/agents/reviewer.js +159 -0
  58. package/dist/agents/agents/reviewer.js.map +1 -0
  59. package/dist/agents/agents/runner.d.ts +73 -0
  60. package/dist/agents/agents/runner.d.ts.map +1 -0
  61. package/dist/agents/agents/runner.js +299 -0
  62. package/dist/agents/agents/runner.js.map +1 -0
  63. package/dist/agents/agents/security-agent.d.ts +33 -0
  64. package/dist/agents/agents/security-agent.d.ts.map +1 -0
  65. package/dist/agents/agents/security-agent.js +184 -0
  66. package/dist/agents/agents/security-agent.js.map +1 -0
  67. package/dist/agents/agents/tester.d.ts +96 -0
  68. package/dist/agents/agents/tester.d.ts.map +1 -0
  69. package/dist/agents/agents/tester.js +410 -0
  70. package/dist/agents/agents/tester.js.map +1 -0
  71. package/dist/agents/agents/writer.d.ts +51 -0
  72. package/dist/agents/agents/writer.d.ts.map +1 -0
  73. package/dist/agents/agents/writer.js +384 -0
  74. package/dist/agents/agents/writer.js.map +1 -0
  75. package/dist/agents/context-vault.d.ts +49 -0
  76. package/dist/agents/context-vault.d.ts.map +1 -0
  77. package/dist/agents/context-vault.js +134 -0
  78. package/dist/agents/context-vault.js.map +1 -0
  79. package/dist/agents/orchestrator.d.ts +97 -0
  80. package/dist/agents/orchestrator.d.ts.map +1 -0
  81. package/dist/agents/orchestrator.js +696 -0
  82. package/dist/agents/orchestrator.js.map +1 -0
  83. package/dist/agents/utils/file-tree.d.ts +28 -0
  84. package/dist/agents/utils/file-tree.d.ts.map +1 -0
  85. package/dist/agents/utils/file-tree.js +93 -0
  86. package/dist/agents/utils/file-tree.js.map +1 -0
  87. package/dist/cli/agent.d.ts +25 -0
  88. package/dist/cli/agent.d.ts.map +1 -0
  89. package/dist/cli/agent.js +374 -0
  90. package/dist/cli/agent.js.map +1 -0
  91. package/dist/cli/benchmark.d.ts +24 -0
  92. package/dist/cli/benchmark.d.ts.map +1 -0
  93. package/dist/cli/benchmark.js +235 -0
  94. package/dist/cli/benchmark.js.map +1 -0
  95. package/dist/cli/cache.d.ts +12 -0
  96. package/dist/cli/cache.d.ts.map +1 -0
  97. package/dist/cli/cache.js +58 -0
  98. package/dist/cli/cache.js.map +1 -0
  99. package/dist/cli/chat.d.ts +37 -0
  100. package/dist/cli/chat.d.ts.map +1 -0
  101. package/dist/cli/chat.js +393 -0
  102. package/dist/cli/chat.js.map +1 -0
  103. package/dist/cli/commands.d.ts +24 -0
  104. package/dist/cli/commands.d.ts.map +1 -0
  105. package/dist/cli/commands.js +18 -0
  106. package/dist/cli/commands.js.map +1 -0
  107. package/dist/cli/config.d.ts +19 -0
  108. package/dist/cli/config.d.ts.map +1 -0
  109. package/dist/cli/config.js +162 -0
  110. package/dist/cli/config.js.map +1 -0
  111. package/dist/cli/dashboard.d.ts +34 -0
  112. package/dist/cli/dashboard.d.ts.map +1 -0
  113. package/dist/cli/dashboard.js +126 -0
  114. package/dist/cli/dashboard.js.map +1 -0
  115. package/dist/cli/doctor.d.ts +68 -0
  116. package/dist/cli/doctor.d.ts.map +1 -0
  117. package/dist/cli/doctor.js +585 -0
  118. package/dist/cli/doctor.js.map +1 -0
  119. package/dist/cli/edit.d.ts +11 -0
  120. package/dist/cli/edit.d.ts.map +1 -0
  121. package/dist/cli/edit.js +86 -0
  122. package/dist/cli/edit.js.map +1 -0
  123. package/dist/cli/execute.d.ts +25 -0
  124. package/dist/cli/execute.d.ts.map +1 -0
  125. package/dist/cli/execute.js +186 -0
  126. package/dist/cli/execute.js.map +1 -0
  127. package/dist/cli/federation.d.ts +31 -0
  128. package/dist/cli/federation.d.ts.map +1 -0
  129. package/dist/cli/federation.js +387 -0
  130. package/dist/cli/federation.js.map +1 -0
  131. package/dist/cli/history.d.ts +22 -0
  132. package/dist/cli/history.d.ts.map +1 -0
  133. package/dist/cli/history.js +140 -0
  134. package/dist/cli/history.js.map +1 -0
  135. package/dist/cli/init.d.ts +49 -0
  136. package/dist/cli/init.d.ts.map +1 -0
  137. package/dist/cli/init.js +423 -0
  138. package/dist/cli/init.js.map +1 -0
  139. package/dist/cli/learn.d.ts +31 -0
  140. package/dist/cli/learn.d.ts.map +1 -0
  141. package/dist/cli/learn.js +320 -0
  142. package/dist/cli/learn.js.map +1 -0
  143. package/dist/cli/memory.d.ts +38 -0
  144. package/dist/cli/memory.d.ts.map +1 -0
  145. package/dist/cli/memory.js +295 -0
  146. package/dist/cli/memory.js.map +1 -0
  147. package/dist/cli/model-picker.d.ts +18 -0
  148. package/dist/cli/model-picker.d.ts.map +1 -0
  149. package/dist/cli/model-picker.js +225 -0
  150. package/dist/cli/model-picker.js.map +1 -0
  151. package/dist/cli/models.d.ts +11 -0
  152. package/dist/cli/models.d.ts.map +1 -0
  153. package/dist/cli/models.js +132 -0
  154. package/dist/cli/models.js.map +1 -0
  155. package/dist/cli/plan.d.ts +11 -0
  156. package/dist/cli/plan.d.ts.map +1 -0
  157. package/dist/cli/plan.js +94 -0
  158. package/dist/cli/plan.js.map +1 -0
  159. package/dist/cli/plugins.d.ts +15 -0
  160. package/dist/cli/plugins.d.ts.map +1 -0
  161. package/dist/cli/plugins.js +123 -0
  162. package/dist/cli/plugins.js.map +1 -0
  163. package/dist/cli/router.d.ts +20 -0
  164. package/dist/cli/router.d.ts.map +1 -0
  165. package/dist/cli/router.js +142 -0
  166. package/dist/cli/router.js.map +1 -0
  167. package/dist/cli/run.d.ts +22 -0
  168. package/dist/cli/run.d.ts.map +1 -0
  169. package/dist/cli/run.js +110 -0
  170. package/dist/cli/run.js.map +1 -0
  171. package/dist/cli/sandbox.d.ts +27 -0
  172. package/dist/cli/sandbox.d.ts.map +1 -0
  173. package/dist/cli/sandbox.js +264 -0
  174. package/dist/cli/sandbox.js.map +1 -0
  175. package/dist/cli/sdk.d.ts +27 -0
  176. package/dist/cli/sdk.d.ts.map +1 -0
  177. package/dist/cli/sdk.js +204 -0
  178. package/dist/cli/sdk.js.map +1 -0
  179. package/dist/cli/stats.d.ts +18 -0
  180. package/dist/cli/stats.d.ts.map +1 -0
  181. package/dist/cli/stats.js +78 -0
  182. package/dist/cli/stats.js.map +1 -0
  183. package/dist/cli/team.d.ts +42 -0
  184. package/dist/cli/team.d.ts.map +1 -0
  185. package/dist/cli/team.js +473 -0
  186. package/dist/cli/team.js.map +1 -0
  187. package/dist/cli/workflow.d.ts +27 -0
  188. package/dist/cli/workflow.d.ts.map +1 -0
  189. package/dist/cli/workflow.js +347 -0
  190. package/dist/cli/workflow.js.map +1 -0
  191. package/dist/config/manager.d.ts +37 -0
  192. package/dist/config/manager.d.ts.map +1 -0
  193. package/dist/config/manager.js +147 -0
  194. package/dist/config/manager.js.map +1 -0
  195. package/dist/config/types.d.ts +53 -0
  196. package/dist/config/types.d.ts.map +1 -0
  197. package/dist/config/types.js +2 -0
  198. package/dist/config/types.js.map +1 -0
  199. package/dist/context/cache.d.ts +27 -0
  200. package/dist/context/cache.d.ts.map +1 -0
  201. package/dist/context/cache.js +116 -0
  202. package/dist/context/cache.js.map +1 -0
  203. package/dist/context/history.d.ts +87 -0
  204. package/dist/context/history.d.ts.map +1 -0
  205. package/dist/context/history.js +249 -0
  206. package/dist/context/history.js.map +1 -0
  207. package/dist/context/parser.d.ts +61 -0
  208. package/dist/context/parser.d.ts.map +1 -0
  209. package/dist/context/parser.js +194 -0
  210. package/dist/context/parser.js.map +1 -0
  211. package/dist/federation/client.d.ts +49 -0
  212. package/dist/federation/client.d.ts.map +1 -0
  213. package/dist/federation/client.js +239 -0
  214. package/dist/federation/client.js.map +1 -0
  215. package/dist/federation/protocol.d.ts +155 -0
  216. package/dist/federation/protocol.d.ts.map +1 -0
  217. package/dist/federation/protocol.js +57 -0
  218. package/dist/federation/protocol.js.map +1 -0
  219. package/dist/federation/server.d.ts +25 -0
  220. package/dist/federation/server.d.ts.map +1 -0
  221. package/dist/federation/server.js +401 -0
  222. package/dist/federation/server.js.map +1 -0
  223. package/dist/index.d.ts +67 -0
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +93 -0
  226. package/dist/index.js.map +1 -0
  227. package/dist/inference/factory.d.ts +20 -0
  228. package/dist/inference/factory.d.ts.map +1 -0
  229. package/dist/inference/factory.js +46 -0
  230. package/dist/inference/factory.js.map +1 -0
  231. package/dist/inference/gemini-adapter.d.ts +17 -0
  232. package/dist/inference/gemini-adapter.d.ts.map +1 -0
  233. package/dist/inference/gemini-adapter.js +176 -0
  234. package/dist/inference/gemini-adapter.js.map +1 -0
  235. package/dist/inference/groq-adapter.d.ts +17 -0
  236. package/dist/inference/groq-adapter.d.ts.map +1 -0
  237. package/dist/inference/groq-adapter.js +103 -0
  238. package/dist/inference/groq-adapter.js.map +1 -0
  239. package/dist/inference/interface.d.ts +49 -0
  240. package/dist/inference/interface.d.ts.map +1 -0
  241. package/dist/inference/interface.js +2 -0
  242. package/dist/inference/interface.js.map +1 -0
  243. package/dist/inference/local-adapter.d.ts +35 -0
  244. package/dist/inference/local-adapter.d.ts.map +1 -0
  245. package/dist/inference/local-adapter.js +311 -0
  246. package/dist/inference/local-adapter.js.map +1 -0
  247. package/dist/inference/model-catalog.d.ts +53 -0
  248. package/dist/inference/model-catalog.d.ts.map +1 -0
  249. package/dist/inference/model-catalog.js +306 -0
  250. package/dist/inference/model-catalog.js.map +1 -0
  251. package/dist/inference/nim-adapter.d.ts +17 -0
  252. package/dist/inference/nim-adapter.d.ts.map +1 -0
  253. package/dist/inference/nim-adapter.js +103 -0
  254. package/dist/inference/nim-adapter.js.map +1 -0
  255. package/dist/inference/openrouter-adapter.d.ts +17 -0
  256. package/dist/inference/openrouter-adapter.d.ts.map +1 -0
  257. package/dist/inference/openrouter-adapter.js +105 -0
  258. package/dist/inference/openrouter-adapter.js.map +1 -0
  259. package/dist/inference/sse.d.ts +20 -0
  260. package/dist/inference/sse.d.ts.map +1 -0
  261. package/dist/inference/sse.js +91 -0
  262. package/dist/inference/sse.js.map +1 -0
  263. package/dist/learning/agent-stats.d.ts +109 -0
  264. package/dist/learning/agent-stats.d.ts.map +1 -0
  265. package/dist/learning/agent-stats.js +240 -0
  266. package/dist/learning/agent-stats.js.map +1 -0
  267. package/dist/learning/benchmark.d.ts +161 -0
  268. package/dist/learning/benchmark.d.ts.map +1 -0
  269. package/dist/learning/benchmark.js +589 -0
  270. package/dist/learning/benchmark.js.map +1 -0
  271. package/dist/learning/cost-tracker.d.ts +101 -0
  272. package/dist/learning/cost-tracker.d.ts.map +1 -0
  273. package/dist/learning/cost-tracker.js +224 -0
  274. package/dist/learning/cost-tracker.js.map +1 -0
  275. package/dist/learning/feedback.d.ts +88 -0
  276. package/dist/learning/feedback.d.ts.map +1 -0
  277. package/dist/learning/feedback.js +169 -0
  278. package/dist/learning/feedback.js.map +1 -0
  279. package/dist/learning/hybrid-router.d.ts +201 -0
  280. package/dist/learning/hybrid-router.d.ts.map +1 -0
  281. package/dist/learning/hybrid-router.js +450 -0
  282. package/dist/learning/hybrid-router.js.map +1 -0
  283. package/dist/learning/model-compare.d.ts +76 -0
  284. package/dist/learning/model-compare.d.ts.map +1 -0
  285. package/dist/learning/model-compare.js +252 -0
  286. package/dist/learning/model-compare.js.map +1 -0
  287. package/dist/learning/model-router.d.ts +68 -0
  288. package/dist/learning/model-router.d.ts.map +1 -0
  289. package/dist/learning/model-router.js +140 -0
  290. package/dist/learning/model-router.js.map +1 -0
  291. package/dist/learning/pattern-extractor.d.ts +99 -0
  292. package/dist/learning/pattern-extractor.d.ts.map +1 -0
  293. package/dist/learning/pattern-extractor.js +310 -0
  294. package/dist/learning/pattern-extractor.js.map +1 -0
  295. package/dist/learning/scorer.d.ts +51 -0
  296. package/dist/learning/scorer.d.ts.map +1 -0
  297. package/dist/learning/scorer.js +64 -0
  298. package/dist/learning/scorer.js.map +1 -0
  299. package/dist/learning/self-improver.d.ts +48 -0
  300. package/dist/learning/self-improver.d.ts.map +1 -0
  301. package/dist/learning/self-improver.js +161 -0
  302. package/dist/learning/self-improver.js.map +1 -0
  303. package/dist/memory/embedder.d.ts +65 -0
  304. package/dist/memory/embedder.d.ts.map +1 -0
  305. package/dist/memory/embedder.js +424 -0
  306. package/dist/memory/embedder.js.map +1 -0
  307. package/dist/memory/memory-integration.d.ts +56 -0
  308. package/dist/memory/memory-integration.d.ts.map +1 -0
  309. package/dist/memory/memory-integration.js +95 -0
  310. package/dist/memory/memory-integration.js.map +1 -0
  311. package/dist/memory/trajectory-store.d.ts +149 -0
  312. package/dist/memory/trajectory-store.d.ts.map +1 -0
  313. package/dist/memory/trajectory-store.js +476 -0
  314. package/dist/memory/trajectory-store.js.map +1 -0
  315. package/dist/memory/vector-store.d.ts +78 -0
  316. package/dist/memory/vector-store.d.ts.map +1 -0
  317. package/dist/memory/vector-store.js +186 -0
  318. package/dist/memory/vector-store.js.map +1 -0
  319. package/dist/plugins/agent-plugin.d.ts +73 -0
  320. package/dist/plugins/agent-plugin.d.ts.map +1 -0
  321. package/dist/plugins/agent-plugin.js +199 -0
  322. package/dist/plugins/agent-plugin.js.map +1 -0
  323. package/dist/plugins/registry.d.ts +61 -0
  324. package/dist/plugins/registry.d.ts.map +1 -0
  325. package/dist/plugins/registry.js +67 -0
  326. package/dist/plugins/registry.js.map +1 -0
  327. package/dist/sandbox/images.d.ts +31 -0
  328. package/dist/sandbox/images.d.ts.map +1 -0
  329. package/dist/sandbox/images.js +129 -0
  330. package/dist/sandbox/images.js.map +1 -0
  331. package/dist/sandbox/manager.d.ts +134 -0
  332. package/dist/sandbox/manager.d.ts.map +1 -0
  333. package/dist/sandbox/manager.js +470 -0
  334. package/dist/sandbox/manager.js.map +1 -0
  335. package/dist/sandbox/types.d.ts +113 -0
  336. package/dist/sandbox/types.d.ts.map +1 -0
  337. package/dist/sandbox/types.js +107 -0
  338. package/dist/sandbox/types.js.map +1 -0
  339. package/dist/security/scanner.d.ts +53 -0
  340. package/dist/security/scanner.d.ts.map +1 -0
  341. package/dist/security/scanner.js +271 -0
  342. package/dist/security/scanner.js.map +1 -0
  343. package/dist/team/config.d.ts +50 -0
  344. package/dist/team/config.d.ts.map +1 -0
  345. package/dist/team/config.js +108 -0
  346. package/dist/team/config.js.map +1 -0
  347. package/dist/team/memory.d.ts +63 -0
  348. package/dist/team/memory.d.ts.map +1 -0
  349. package/dist/team/memory.js +282 -0
  350. package/dist/team/memory.js.map +1 -0
  351. package/dist/team/review.d.ts +123 -0
  352. package/dist/team/review.d.ts.map +1 -0
  353. package/dist/team/review.js +293 -0
  354. package/dist/team/review.js.map +1 -0
  355. package/dist/utils/env.d.ts +19 -0
  356. package/dist/utils/env.d.ts.map +1 -0
  357. package/dist/utils/env.js +250 -0
  358. package/dist/utils/env.js.map +1 -0
  359. package/dist/utils/logger.d.ts +11 -0
  360. package/dist/utils/logger.d.ts.map +1 -0
  361. package/dist/utils/logger.js +45 -0
  362. package/dist/utils/logger.js.map +1 -0
  363. package/dist/web-dashboard/server.d.ts +59 -0
  364. package/dist/web-dashboard/server.d.ts.map +1 -0
  365. package/dist/web-dashboard/server.js +418 -0
  366. package/dist/web-dashboard/server.js.map +1 -0
  367. package/dist/workflow/registry.d.ts +127 -0
  368. package/dist/workflow/registry.d.ts.map +1 -0
  369. package/dist/workflow/registry.js +482 -0
  370. package/dist/workflow/registry.js.map +1 -0
  371. package/dist/workflow/templates.d.ts +93 -0
  372. package/dist/workflow/templates.d.ts.map +1 -0
  373. package/dist/workflow/templates.js +481 -0
  374. package/dist/workflow/templates.js.map +1 -0
  375. package/package.json +78 -0
  376. package/src/web-dashboard/public/assets/index-B08nDkSB.css +1 -0
  377. package/src/web-dashboard/public/assets/index-BKL8YOFD.js +135 -0
  378. package/src/web-dashboard/public/assets/index-BKL8YOFD.js.map +1 -0
  379. package/src/web-dashboard/public/index.html +13 -0
package/README.md ADDED
@@ -0,0 +1,891 @@
1
+ # Buff CLI — `agent-nuvira`
2
+
3
+ **Flexible AI inference tool** — run large language models locally (Ollama) or route to cloud APIs (Groq, NVIDIA NIM, Google Gemini, OpenRouter) through a unified CLI. Discover available models, chat interactively, edit files with AI, and plan codebase changes — all from the terminal.
4
+
5
+ ```bash
6
+ # Quick examples
7
+ agent-nuvira chat "explain recursion in Rust"
8
+ agent-nuvira models --provider groq
9
+ agent-nuvira edit main.go --instruction "add input validation"
10
+ agent-nuvira plan . --task "implement user authentication"
11
+ agent-nuvira config list
12
+ ```
13
+
14
+ ---
15
+
16
+ ## Features
17
+
18
+ - **Unified interface** across 5 providers: local (Ollama, HuggingFace, GGML), Groq, NVIDIA NIM, Google Gemini, and OpenRouter
19
+ - **Model discovery** — `agent-nuvira models` lists available models from any configured provider, with search/filter support
20
+ - **Interactive chat** with conversation history, file context, and session commands
21
+ - **AI-assisted file editing** with dry-run mode for safe previews
22
+ - **Codebase planning** that analyzes directory structure and generates implementation plans
23
+ - **Multi-agent orchestration** — `agent-nuvira execute "goal"` runs a pipeline of planner, gatherer, writer, reviewer, tester, and more
24
+ - **Response caching** via SQLite to reduce costs and latency
25
+ - **Plugin system** for adding custom inference providers
26
+ - **Configuration** via JSON config file + environment variables
27
+ - **No server dependency** — no telemetry, no subscriptions, no outbound calls to a hosted backend
28
+
29
+ ---
30
+
31
+ ## Quick Start
32
+
33
+ ### Prerequisites
34
+
35
+ - **Node.js** 20+ and **npm**
36
+ - **TypeScript** knowledge for development; none required to use the CLI
37
+
38
+ ### Install
39
+
40
+ ```bash
41
+ # Install globally
42
+ npm install -g agent-nuvira
43
+
44
+ # Or clone and build from source
45
+ git clone https://github.com/imdheerajKube/agent-nuvira.git buff
46
+ cd buff
47
+ npm install
48
+ npm run build
49
+ npm link
50
+ ```
51
+
52
+ ### Verify
53
+
54
+ ```bash
55
+ agent-nuvira --help
56
+ ```
57
+
58
+ You should see:
59
+
60
+ ```
61
+ Usage: agent-nuvira [options] [command]
62
+
63
+ Flexible AI inference CLI tool — local models & cloud APIs
64
+
65
+ Options:
66
+ -V, --version output the version number
67
+ -d, --debug enable debug logging
68
+ -h, --help display help for command
69
+
70
+ Commands:
71
+ chat [options] [prompt] Start an interactive chat session with AI
72
+ edit [options] <file> Edit a file using AI assistance
73
+ models [options] List available models from inference providers
74
+ plan [options] [target] Generate an implementation plan for a codebase task
75
+ execute [options] <goal> Execute a multi-agent pipeline for a goal
76
+ config Manage Buff configuration
77
+ cache Manage inference cache
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Getting API Keys
83
+
84
+ Each cloud provider requires an API key. Sign up and get your key from the links below.
85
+
86
+ ### 🔷 Groq (Fast — LPU Cloud Inference)
87
+
88
+ Groq runs open-source models at blazing speeds on their custom LPU hardware.
89
+
90
+ 1. Sign up at **[console.groq.com](https://console.groq.com)** (free tier available)
91
+ 2. Go to **API Keys** → **Create API Key**
92
+ 3. Copy your key (starts with `gsk_`)
93
+
94
+ ```bash
95
+ export GROQ_API_KEY="gsk_xxxxxxxxxxxxxxxx"
96
+ ```
97
+
98
+ ### 🔶 NVIDIA NIM
99
+
100
+ NVIDIA NIM provides hosted API access to a wide catalog of models (121+ models).
101
+
102
+ 1. Sign up at **[build.nvidia.com](https://build.nvidia.com)** (free tier with rate limits)
103
+ 2. Generate an API key from the **Get API Key** button
104
+ 3. Copy your key (starts with `nvapi-`)
105
+
106
+ ```bash
107
+ export NVIDIA_NIM_API_KEY="nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
108
+ ```
109
+
110
+ ### 🔷 Google Gemini
111
+
112
+ Google's Gemini API has a generous free tier with competitive models.
113
+
114
+ 1. Visit **[aistudio.google.com/apikey](https://aistudio.google.com/apikey)** and click **Create API Key**
115
+ 2. Select your Google Cloud project or create one
116
+ 3. Copy your key (starts with `AIzaSy`)
117
+
118
+ ```bash
119
+ export GEMINI_API_KEY="AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
120
+ ```
121
+
122
+ ### 🟣 OpenRouter
123
+
124
+ OpenRouter gives you access to 200+ models from OpenAI, Anthropic, Google, Meta, and more — all through one API.
125
+
126
+ 1. Sign up at **[openrouter.ai/keys](https://openrouter.ai/keys)** (free credits on sign-up)
127
+ 2. Click **Create Key**
128
+ 3. Copy your key (starts with `sk-or-v1-`)
129
+
130
+ ```bash
131
+ export OPENROUTER_API_KEY="sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Configuration
137
+
138
+ ### Config File
139
+
140
+ Configuration lives at `~/.buff/buffconfig.json`. It is created with sensible defaults on first use.
141
+
142
+ You can inspect and modify it through the CLI:
143
+
144
+ ```bash
145
+ # Show full configuration
146
+ agent-nuvira config
147
+
148
+ # Set the default provider
149
+ agent-nuvira config set defaultProvider gemini
150
+
151
+ # Set a provider's model
152
+ agent-nuvira config set providers.nim.model "meta/llama-3.1-8b-instruct"
153
+
154
+ # List all providers with their status
155
+ agent-nuvira config list
156
+ ```
157
+
158
+ ### Default Configuration
159
+
160
+ ```json
161
+ {
162
+ "defaultProvider": "local",
163
+ "providers": {
164
+ "nim": {
165
+ "model": "meta/llama-3.1-8b-instruct",
166
+ "temperature": 0.7,
167
+ "maxTokens": 4096
168
+ },
169
+ "gemini": {
170
+ "model": "gemini-2.0-flash-exp",
171
+ "temperature": 0.7,
172
+ "maxTokens": 8192
173
+ },
174
+ "openrouter": {
175
+ "model": "mistralai/mistral-7b-instruct",
176
+ "temperature": 0.7,
177
+ "maxTokens": 4096
178
+ },
179
+ "groq": {
180
+ "model": "llama-3.3-70b-versatile",
181
+ "temperature": 0.7,
182
+ "maxTokens": 4096
183
+ },
184
+ "local": {
185
+ "runner": "ollama",
186
+ "model": "llama2",
187
+ "temperature": 0.7,
188
+ "maxTokens": 4096
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ ### Environment Variables
195
+
196
+ API keys can be set via environment variables instead of the config file. They take **priority** over the config file.
197
+
198
+ | Variable | Provider | Required? | Get Your Key |
199
+ |---|---|---|---|
200
+ | `GROQ_API_KEY` | Groq | Yes, unless using local | [console.groq.com](https://console.groq.com) |
201
+ | `NVIDIA_NIM_API_KEY` | NVIDIA NIM | Yes, unless using local | [build.nvidia.com](https://build.nvidia.com) |
202
+ | `GEMINI_API_KEY` | Google Gemini | Yes, unless using local | [aistudio.google.com/apikey](https://aistudio.google.com/apikey) |
203
+ | `OPENROUTER_API_KEY` | OpenRouter | Yes, unless using local | [openrouter.ai/keys](https://openrouter.ai/keys) |
204
+
205
+ You can place a `.env` file in the project root or at `~/.buff/.env`:
206
+
207
+ ```env
208
+ # ~/.buff/.env
209
+ GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
210
+ NVIDIA_NIM_API_KEY=nvapi-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
211
+ GEMINI_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
212
+ OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
213
+ ```
214
+
215
+ ---
216
+
217
+ ## CLI Commands
218
+
219
+ ### `agent-nuvira models` — Model Discovery (New in v1.1.0)
220
+
221
+ List available models from any configured provider. Query each provider's model catalog without leaving the terminal.
222
+
223
+ ```bash
224
+ # List models from the default provider
225
+ agent-nuvira models
226
+
227
+ # List models from a specific provider
228
+ agent-nuvira models --provider nim
229
+ agent-nuvira models --provider groq
230
+ agent-nuvira models --provider openrouter
231
+
232
+ # Search for models by keyword
233
+ agent-nuvira models --search deepseek
234
+ agent-nuvira models --search llama
235
+
236
+ # Show all providers (even unconfigured ones)
237
+ agent-nuvira models --all
238
+ ```
239
+
240
+ **Examples:**
241
+
242
+ ```bash
243
+ # See all models on Groq
244
+ agent-nuvira models --provider groq
245
+
246
+ # Find DeepSeek models across all configured providers
247
+ agent-nuvira models --search deepseek
248
+
249
+ # Output:
250
+ # ════════════════════════════════════════════
251
+ # 📋 Available Models (3)
252
+ # ════════════════════════════════════════════
253
+ #
254
+ # Groq:
255
+ # ----------------------------------------
256
+ # deepseek-ai/deepseek-v4-pro [deepseek]
257
+ # deepseek-ai/deepseek-v4-flash [deepseek]
258
+ # deepseek-ai/deepseek-coder-6.7b-instruct [deepseek]
259
+ #
260
+ # ════════════════════════════════════════════
261
+ ```
262
+
263
+ Use a discovered model immediately:
264
+
265
+ ```bash
266
+ agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
267
+ agent-nuvira edit src/server.ts --provider openrouter --model openai/gpt-4o
268
+ ```
269
+
270
+ ---
271
+
272
+ ### `agent-nuvira chat` — Interactive Chat
273
+
274
+ Start a terminal-based chat session with any provider.
275
+
276
+ ```bash
277
+ # Interactive mode (default provider)
278
+ agent-nuvira chat
279
+
280
+ # One-shot prompt
281
+ agent-nuvira chat "what is the difference between TCP and UDP?"
282
+
283
+ # Specify provider and model
284
+ agent-nuvira chat --provider gemini --model gemini-2.0-flash-exp
285
+
286
+ # Include a file as context
287
+ agent-nuvira chat --file ./src/main.ts "explain this code"
288
+
289
+ # Disable caching
290
+ agent-nuvira chat --no-cache
291
+ ```
292
+
293
+ **Interactive commands** within a chat session:
294
+
295
+ | Command | Action |
296
+ |---|---|
297
+ | `/exit` or `/quit` | End the session |
298
+ | `/clear` | Clear conversation history |
299
+ | `/info` | Show current provider details |
300
+ | `/help` | Show available commands |
301
+
302
+ ---
303
+
304
+ ### `agent-nuvira edit` — AI-Assisted File Editing
305
+
306
+ Edit a file using natural language instructions. The AI reads the file, applies your instruction, and writes the result back.
307
+
308
+ ```bash
309
+ # Edit with default instruction ("Review and improve this code")
310
+ agent-nuvira edit src/server.ts
311
+
312
+ # Provide a specific instruction
313
+ agent-nuvira edit src/server.ts --instruction "add rate limiting middleware"
314
+
315
+ # Use a specific provider
316
+ agent-nuvira edit src/server.ts --provider openrouter --model openai/gpt-4o
317
+
318
+ # Preview changes without modifying the file
319
+ agent-nuvira edit src/server.ts --instruction "add error handling" --dry-run
320
+ ```
321
+
322
+ ---
323
+
324
+ ### `agent-nuvira plan` — Implementation Plans
325
+
326
+ Analyze a directory or file and generate a structured implementation plan.
327
+
328
+ ```bash
329
+ # Plan for the current directory
330
+ agent-nuvira plan
331
+
332
+ # Plan for a specific target with a task description
333
+ agent-nuvira plan ./src --task "add user authentication with JWT"
334
+
335
+ # Use a cloud provider for complex planning
336
+ agent-nuvira plan . --task "refactor to microservices" --provider gemini
337
+
338
+ # Verbose mode shows the full context sent to the model
339
+ agent-nuvira plan -v
340
+ ```
341
+
342
+ The plan includes:
343
+ 1. **Summary** — high-level overview
344
+ 2. **Files to Modify** — specific files and changes
345
+ 3. **Architecture Changes** — structural modifications
346
+ 4. **Implementation Steps** — ordered guide
347
+ 5. **Potential Risks** — edge cases and breaking changes
348
+ 6. **Testing Strategy** — verification approach
349
+
350
+ ---
351
+
352
+ ### `agent-nuvira config` — Configuration Management
353
+
354
+ ```bash
355
+ # Show full config
356
+ agent-nuvira config
357
+
358
+ # Set a value
359
+ agent-nuvira config set defaultProvider openrouter
360
+
361
+ # Get a specific value
362
+ agent-nuvira config get providers.nim.model
363
+
364
+ # List all providers with their status
365
+ agent-nuvira config list
366
+
367
+ # Initialize (show defaults)
368
+ agent-nuvira config init
369
+ ```
370
+
371
+ ---
372
+
373
+ ### `agent-nuvira cache` — Cache Management
374
+
375
+ Inference responses are cached in a local SQLite database (`~/.buff/cache.db`) with a default TTL of 1 hour.
376
+
377
+ ```bash
378
+ # Show cache statistics
379
+ agent-nuvira cache stats
380
+
381
+ # Clear all cached responses
382
+ agent-nuvira cache clear
383
+ ```
384
+
385
+ ---
386
+
387
+ ## Provider Details
388
+
389
+ ### Local (Ollama)
390
+
391
+ Uses the **Ollama HTTP API** running at `http://localhost:11434`.
392
+
393
+ ```bash
394
+ # Ensure Ollama is running
395
+ ollama serve
396
+
397
+ # Pull a model
398
+ ollama pull llama2
399
+
400
+ # Use with the CLI
401
+ agent-nuvira chat --provider local --model llama2
402
+ ```
403
+
404
+ **Runners:**
405
+
406
+ | Runner | Description | Requirements |
407
+ |---|---|---|
408
+ | `ollama` (default) | Ollama HTTP API | [Ollama](https://ollama.ai) installed and running |
409
+ | `huggingface` | HuggingFace Transformers via Python | Python 3, `pip install transformers torch` |
410
+ | `ggml` | GGML/GGUF models via llama.cpp | `llama-cli` binary, model file |
411
+
412
+ Configure the runner:
413
+
414
+ ```bash
415
+ agent-nuvira config set providers.local.runner huggingface
416
+ agent-nuvira config set providers.local.model "microsoft/phi-2"
417
+ ```
418
+
419
+ ### Groq
420
+
421
+ Connects to **Groq** — the fastest inference API for open-source models, running on custom LPU hardware.
422
+
423
+ ```bash
424
+ # Set your API key
425
+ export GROQ_API_KEY="gsk_..."
426
+
427
+ # List available models (Llama, Mixtral, Gemma, DeepSeek, and more)
428
+ agent-nuvira models --provider groq
429
+
430
+ # Chat with any model
431
+ agent-nuvira chat --provider groq --model llama-3.3-70b-versatile
432
+ agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
433
+
434
+ # Edit with Groq's fast inference
435
+ agent-nuvira edit src/server.ts --provider groq --model llama-3.3-70b-versatile
436
+ ```
437
+
438
+ The Groq adapter uses `https://api.groq.com/openai/v1` by default.
439
+
440
+ **Get a free API key:** [console.groq.com](https://console.groq.com)
441
+
442
+ ### NVIDIA NIM
443
+
444
+ Connects to the **NVIDIA NIM** OpenAI-compatible API at `https://integrate.api.nvidia.com/v1`.
445
+
446
+ ```bash
447
+ # Set your API key
448
+ export NVIDIA_NIM_API_KEY="nvapi-..."
449
+
450
+ # List available models (121 models)
451
+ agent-nuvira models --provider nim
452
+
453
+ # Chat with any model
454
+ agent-nuvira chat --provider nim --model meta/llama-3.1-8b-instruct
455
+ agent-nuvira chat --provider nim --model deepseek-ai/deepseek-v4-flash
456
+ ```
457
+
458
+ The NIM adapter uses `https://integrate.api.nvidia.com/v1` by default. You can override the base URL for self-hosted NIM deployments:
459
+
460
+ ```bash
461
+ agent-nuvira config set providers.nim.baseUrl "http://your-nim-host:8000/v1"
462
+ ```
463
+
464
+ ### Google Gemini
465
+
466
+ Connects to the **Google Gemini API** free tier.
467
+
468
+ ```bash
469
+ # Set your API key
470
+ export GEMINI_API_KEY="AIzaSy..."
471
+
472
+ # Use it (supports 8K+ token context)
473
+ agent-nuvira chat --provider gemini --model gemini-2.0-flash-exp
474
+ ```
475
+
476
+ ### OpenRouter
477
+
478
+ Routes through **OpenRouter** for access to 200+ models from multiple providers.
479
+
480
+ ```bash
481
+ # Set your API key
482
+ export OPENROUTER_API_KEY="sk-or-v1-..."
483
+
484
+ # List available models
485
+ agent-nuvira models --provider openrouter
486
+
487
+ # Use a specific model
488
+ agent-nuvira chat --provider openrouter --model openai/gpt-4o
489
+ agent-nuvira chat --provider openrouter --model anthropic/claude-3-haiku
490
+ ```
491
+
492
+ ---
493
+
494
+ ## Multi-Agent Orchestration (`agent-nuvira execute`)
495
+
496
+ 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.
497
+
498
+ ```bash
499
+ # Execute a multi-agent pipeline
500
+ agent-nuvira execute "add JWT authentication to the Express app"
501
+
502
+ # With verbose logging to see each agent's work
503
+ agent-nuvira execute "add a health check endpoint" --verbose
504
+
505
+ # Use a specific provider for all agents
506
+ agent-nuvira execute "refactor the database layer" --provider groq
507
+
508
+ # Dry-run mode (shows what would change without writing)
509
+ agent-nuvira execute "add rate limiting" --dry-run
510
+
511
+ # Configure models per agent type
512
+ agent-nuvira execute "add tests" --agent-model planner=gemini --agent-model writer=groq
513
+
514
+ # Use persistent memory across sessions
515
+ agent-nuvira execute "fix the login bug" --memory
516
+ ```
517
+
518
+ The pipeline runs these agents in sequence (with parallelization where possible):
519
+ 1. **Planner** — Analyzes the goal, creates a task plan
520
+ 2. **Context Gatherer** — Scans the codebase for relevant files
521
+ 3. **Writer** — Implements the code changes
522
+ 4. **Reviewer** — Validates the changes for bugs and style (optional)
523
+ 5. **Tester** — Runs tests in a sandbox (optional)
524
+ 6. **Runner** — Executes the program to verify it works (optional)
525
+ 7. **Debugger** — Iterates on test failures (optional)
526
+ 8. **Git Agent** — Commits changes to a branch (optional)
527
+ 9. **Package Agent** — Bumps versions and generates changelogs (optional)
528
+ 10. **GitHub Release Agent** — Creates tags and releases (optional)
529
+
530
+ ---
531
+
532
+ ## Architecture
533
+
534
+ ```
535
+ CLI Commands (chat, edit, plan, models, config, cache, execute)
536
+
537
+
538
+ Inference Layer (InferenceProvider interface)
539
+
540
+ ┌──────┼──────┬──────────┬─────────────┐
541
+ │ │ │ │ │
542
+ ▼ ▼ ▼ ▼ ▼
543
+ Groq NIM Gemini OpenRouter Local
544
+ Adapter Adapter Adapter Adapter Adapter
545
+ │ │ │ │ │
546
+ ▼ ▼ ▼ ▼ ▼
547
+ Groq NVIDIA Google OpenRouter Ollama / HF /
548
+ LPU NIM Gemini (free) APIs GGML Models
549
+
550
+ ┌──────────────────────────┐
551
+ │ Multi-Agent System │
552
+ │ ┌────────────────────┐ │
553
+ │ │ Orchestrator │ │
554
+ │ │ ├─ Planner │ │
555
+ │ │ ├─ ContextGather │ │
556
+ │ │ ├─ Writer │ │
557
+ │ │ ├─ Reviewer │ │
558
+ │ │ ├─ Tester │ │
559
+ │ │ ├─ Runner │ │
560
+ │ │ ├─ Debugger │ │
561
+ │ │ └─ GitAgent │ │
562
+ │ └────────────────────┘ │
563
+ │ │
564
+ │ ┌────────────────────┐ │
565
+ │ │ Memory System │ │
566
+ │ │ ├─ Vector Store │ │
567
+ │ │ ├─ Trajectory │ │
568
+ │ │ └─ Embedder │ │
569
+ │ └────────────────────┘ │
570
+ │ │
571
+ │ ┌────────────────────┐ │
572
+ │ │ Self-Learning │ │
573
+ │ │ ├─ Model Router │ │
574
+ │ │ ├─ Pattern Extr. │ │
575
+ │ │ └─ Scorer │ │
576
+ │ └────────────────────┘ │
577
+ │ │
578
+ │ ┌────────────────────┐ │
579
+ │ │ SQLite Cache │ │
580
+ │ │ Multi-file Parser │ │
581
+ │ │ Token Chunking │ │
582
+ │ └────────────────────┘ │
583
+ └──────────────────────────┘
584
+ ```
585
+
586
+ ### Key Modules
587
+
588
+ | Module | Path | Purpose |
589
+ |---|---|---|
590
+ | **CLI Router** | `src/cli/router.ts` | Registers commands and resolves providers |
591
+ | **Config Manager** | `src/config/manager.ts` | Loads/saves config, merges env vars |
592
+ | **Inference Interface** | `src/inference/interface.ts` | `InferenceProvider` contract (`generate`, `isAvailable`, `getInfo`, `listModels`) |
593
+ | **Provider Factory** | `src/inference/factory.ts` | Instantiates the right adapter |
594
+ | **Adapters** | `src/inference/*-adapter.ts` | One per provider (Groq, NIM, Gemini, OpenRouter, Local) |
595
+ | **Model Discovery** | `src/cli/models.ts` | Lists and searches models from all providers |
596
+ | **Orchestrator** | `src/agents/orchestrator.ts` | Multi-agent pipeline coordinator |
597
+ | **Context Cache** | `src/context/cache.ts` | SQLite-backed response caching |
598
+ | **Context Parser** | `src/context/parser.ts` | Multi-file reading, chunking, prioritization |
599
+ | **Plugin Registry** | `src/plugins/registry.ts` | Pluggable third-party provider system |
600
+ | **Logger** | `src/utils/logger.ts` | Colored, level-based logging |
601
+
602
+ ---
603
+
604
+ ## Workflow Examples
605
+
606
+ ### Discover and Chat with a Model
607
+
608
+ ```bash
609
+ # Step 1: See what's available on Groq
610
+ agent-nuvira models --provider groq
611
+
612
+ # Step 2: Narrow down by keyword
613
+ agent-nuvira models --search deepseek
614
+
615
+ # Step 3: Chat with a found model
616
+ agent-nuvira chat --provider groq --model deepseek-ai/deepseek-v4-flash
617
+ ```
618
+
619
+ ### Hybrid Provider Usage
620
+
621
+ Use different providers for different tasks:
622
+
623
+ ```bash
624
+ # Use local models for quick, small edits
625
+ agent-nuvira edit README.md --instruction "fix typos" --provider local
626
+
627
+ # Use Groq for fast code generation
628
+ agent-nuvira edit src/routes.ts --instruction "add validation" --provider groq
629
+
630
+ # Use cloud models for complex planning
631
+ agent-nuvira plan . --task "design the database schema" --provider gemini
632
+
633
+ # Use OpenRouter for diverse model selection
634
+ agent-nuvira chat --provider openrouter --model openai/gpt-4o
635
+ ```
636
+
637
+ ### Multi-Agent Pipeline
638
+
639
+ ```bash
640
+ # Let the multi-agent system handle everything
641
+ agent-nuvira execute "add input validation for all API routes"
642
+
643
+ # With verbose logging to see each step
644
+ agent-nuvira execute "create a health check endpoint" --verbose
645
+
646
+ # Use Groq for fast agent execution
647
+ agent-nuvira execute "refactor login logic" --provider groq
648
+ ```
649
+
650
+ ---
651
+
652
+ ## Plugin System: Adding a New Provider
653
+
654
+ The plugin system allows you to add custom inference providers without modifying the CLI's core code.
655
+
656
+ ### Step 1: Implement `InferenceProvider`
657
+
658
+ Create a class that implements the `InferenceProvider` interface:
659
+
660
+ ```typescript
661
+ import { InferenceProvider } from 'agent-nuvira';
662
+ import { InferenceOptions, ProviderConfig } from 'agent-nuvira';
663
+
664
+ export class AnthropicAdapter implements InferenceProvider {
665
+ readonly name = 'Anthropic';
666
+ private config: ProviderConfig;
667
+
668
+ constructor(config: ProviderConfig) {
669
+ this.config = config;
670
+ }
671
+
672
+ async generate(prompt: string, options?: InferenceOptions): Promise<string> {
673
+ const apiKey = this.config.apiKey;
674
+ if (!apiKey) {
675
+ throw new Error('Anthropic API key not configured');
676
+ }
677
+
678
+ const response = await fetch('https://api.anthropic.com/v1/messages', {
679
+ method: 'POST',
680
+ headers: {
681
+ 'x-api-key': apiKey,
682
+ 'anthropic-version': '2023-06-01',
683
+ 'Content-Type': 'application/json',
684
+ },
685
+ body: JSON.stringify({
686
+ model: options?.model || 'claude-3-haiku-20240307',
687
+ max_tokens: options?.maxTokens || 1024,
688
+ messages: [{ role: 'user', content: prompt }],
689
+ }),
690
+ });
691
+
692
+ const data = await response.json();
693
+ return data.content[0].text;
694
+ }
695
+
696
+ async isAvailable(): Promise<boolean> {
697
+ return !!this.config.apiKey;
698
+ }
699
+
700
+ getInfo(): string {
701
+ return `Provider: Anthropic Claude\nModel: ${this.config.model || 'default'}\nStatus: ${this.config.apiKey ? '✅' : '❌'}`;
702
+ }
703
+
704
+ async listModels(): Promise<Array<{ id: string; name: string; provider: string; owner?: string; description?: string }>> {
705
+ if (!this.config.apiKey) return [];
706
+ // Fetch models from Anthropic API
707
+ return [{ id: 'claude-3-haiku-20240307', name: 'claude-3-haiku-20240307', provider: 'Anthropic' }];
708
+ }
709
+ }
710
+ ```
711
+
712
+ ### Step 2: Create a Plugin Wrapper
713
+
714
+ ```typescript
715
+ import { ProviderPlugin, ProviderConfig, PluginMetadata } from 'agent-nuvira';
716
+ import { AnthropicAdapter } from './anthropic-adapter';
717
+
718
+ export const AnthropicPlugin: ProviderPlugin = {
719
+ metadata: {
720
+ name: 'Anthropic Claude',
721
+ version: '1.0.0',
722
+ description: 'Anthropic Claude API integration',
723
+ author: 'You',
724
+ },
725
+
726
+ getProviderType(): string {
727
+ return 'anthropic';
728
+ },
729
+
730
+ createProvider(config: ProviderConfig): AnthropicAdapter {
731
+ return new AnthropicAdapter(config);
732
+ },
733
+ };
734
+ ```
735
+
736
+ ### Step 3: Register the Plugin
737
+
738
+ At your application's entry point:
739
+
740
+ ```typescript
741
+ import { getPluginRegistry } from 'agent-nuvira';
742
+ import { AnthropicPlugin } from './anthropic-plugin';
743
+
744
+ const registry = getPluginRegistry();
745
+ registry.register(AnthropicPlugin);
746
+ ```
747
+
748
+ ### Step 4: Configure and Use
749
+
750
+ Add the provider to your `buffconfig.json`:
751
+
752
+ ```json
753
+ {
754
+ "defaultProvider": "anthropic",
755
+ "providers": {
756
+ "anthropic": {
757
+ "apiKey": "sk-ant-...",
758
+ "model": "claude-3-haiku-20240307",
759
+ "temperature": 0.7,
760
+ "maxTokens": 4096
761
+ }
762
+ }
763
+ }
764
+ ```
765
+
766
+ Then use it:
767
+
768
+ ```bash
769
+ agent-nuvira chat --provider anthropic
770
+ ```
771
+
772
+ > **Note:** The plugin system is a *programmatic* API. To make plugins load automatically from a directory (discovery), you would add a plugin loader script that scans a `~/.buff/plugins/` directory and registers any plugins found.
773
+
774
+ ---
775
+
776
+ ## Development
777
+
778
+ ### Setup
779
+
780
+ ```bash
781
+ git clone https://github.com/imdheerajKube/agent-nuvira.git
782
+ cd buff
783
+ npm install
784
+ ```
785
+
786
+ ### Build
787
+
788
+ ```bash
789
+ npm run build # Compile TypeScript to dist/
790
+ npm run dev # Build and run with tsx (fast)
791
+ ```
792
+
793
+ ### Project Structure
794
+
795
+ ```
796
+ src/
797
+ ├── index.ts # Entry point
798
+ ├── cli/
799
+ │ ├── router.ts # Command registration & provider resolution
800
+ │ ├── commands.ts # Base command class
801
+ │ ├── chat.ts # Interactive chat
802
+ │ ├── edit.ts # File editing
803
+ │ ├── models.ts # Model discovery (list/search models)
804
+ │ ├── plan.ts # Implementation plans
805
+ │ ├── config.ts # Configuration management
806
+ │ ├── execute.ts # Multi-agent orchestration
807
+ │ └── cache.ts # Cache management
808
+ ├── agents/
809
+ │ ├── agent.ts # Abstract Agent + types
810
+ │ ├── orchestrator.ts # Multi-agent pipeline coordinator
811
+ │ ├── context-vault.ts # Shared context bus
812
+ │ └── agents/
813
+ │ ├── planner.ts # PlannerAgent
814
+ │ ├── context-gatherer.ts
815
+ │ ├── writer.ts # WriterAgent
816
+ │ ├── reviewer.ts # ReviewerAgent
817
+ │ ├── runner.ts # RunnerAgent
818
+ │ ├── tester.ts # TesterAgent
819
+ │ ├── debugger.ts # DebuggerAgent
820
+ │ ├── git-agent.ts
821
+ │ ├── package-agent.ts
822
+ │ ├── github-release-agent.ts
823
+ │ └── security-agent.ts
824
+ ├── config/
825
+ │ ├── types.ts # TypeScript types
826
+ │ └── manager.ts # Config load/save/env merging
827
+ ├── inference/
828
+ │ ├── interface.ts # InferenceProvider contract
829
+ │ ├── factory.ts # Provider instantiation
830
+ │ ├── groq-adapter.ts # Groq LPU
831
+ │ ├── nim-adapter.ts # NVIDIA NIM
832
+ │ ├── gemini-adapter.ts # Google Gemini
833
+ │ ├── openrouter-adapter.ts # OpenRouter
834
+ │ └── local-adapter.ts # Ollama / HuggingFace / GGML
835
+ ├── context/
836
+ │ ├── cache.ts # SQLite response cache
837
+ │ └── parser.ts # Multi-file context parsing
838
+ ├── plugins/
839
+ │ └── registry.ts # Plugin registration system
840
+ ├── learning/
841
+ │ ├── model-router.ts # Adaptive model routing
842
+ │ ├── scorer.ts # Trajectory scoring
843
+ │ ├── pattern-extractor.ts
844
+ │ ├── agent-stats.ts
845
+ │ └── self-improver.ts
846
+ ├── memory/
847
+ │ ├── embedder.ts # LLM-based embeddings
848
+ │ ├── vector-store.ts # Cosine similarity search
849
+ │ ├── trajectory-store.ts
850
+ │ └── memory-integration.ts
851
+ ├── security/
852
+ │ └── scanner.ts # Prompt injection / secret scanner
853
+ └── utils/
854
+ ├── env.ts # Environment variable loader
855
+ └── logger.ts # Colored logging
856
+ ```
857
+
858
+ ### Testing
859
+
860
+ ```bash
861
+ # Run all tests (115+ tests)
862
+ npm test
863
+
864
+ # Watch mode
865
+ npm run test:watch
866
+
867
+ # With coverage
868
+ npm run test:coverage
869
+
870
+ # Type-check without emitting files
871
+ npx tsc --noEmit
872
+ ```
873
+
874
+ ---
875
+
876
+ ## Roadmap
877
+
878
+ - [x] **Groq integration** — fast LPU inference for open-source models
879
+ - [x] **Multi-agent orchestration** — plan, write, review, test, and publish
880
+ - [x] **Model discovery** — search and filter across all providers
881
+ - [ ] **Streaming support** — real-time token-by-token output in chat mode
882
+ - [ ] **Auto-discovery plugin loader** — scan `~/.buff/plugins/` for `.js` plugin files
883
+ - [ ] **Hybrid routing** — automatically route small prompts to local models and complex ones to cloud
884
+ - [ ] **Local telemetry** — usage logs stored locally (no server upload)
885
+ - [ ] **Provider health checks** — `agent-nuvira doctor` to verify all configured providers
886
+
887
+ ---
888
+
889
+ ## License
890
+
891
+ MIT