nexus-ai-pro 1.15.0 → 1.16.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 (639) hide show
  1. package/API_STABILITY.md +47 -7
  2. package/CHANGELOG.md +97 -1
  3. package/README.md +249 -74
  4. package/dist/agent/create-agent.d.ts +35 -0
  5. package/dist/agent/create-agent.js +0 -19
  6. package/dist/agent/loop.d.ts +7 -0
  7. package/dist/agent/loop.js +0 -3
  8. package/dist/agent/middleware.d.ts +2 -0
  9. package/dist/agent/middleware.js +0 -19
  10. package/dist/agent/tool.d.ts +6 -0
  11. package/dist/batch/anthropic.d.ts +14 -0
  12. package/dist/batch/anthropic.js +0 -14
  13. package/dist/batch/errors.d.ts +23 -3
  14. package/dist/batch/manager.d.ts +8 -0
  15. package/dist/batch/manager.js +0 -37
  16. package/dist/batch/mock.d.ts +9 -0
  17. package/dist/batch/mock.js +0 -8
  18. package/dist/batch/openai.d.ts +11 -0
  19. package/dist/batch/openai.js +0 -8
  20. package/dist/cache/adapters.d.ts +31 -0
  21. package/dist/cache/memory-cache.d.ts +14 -0
  22. package/dist/cache/semantic-cache.d.ts +15 -0
  23. package/dist/capabilities/negotiate.d.ts +9 -0
  24. package/dist/capabilities/negotiate.js +0 -14
  25. package/dist/cli/args.d.ts +26 -0
  26. package/dist/cli/args.js +96 -0
  27. package/dist/cli/db.d.ts +8 -0
  28. package/dist/cli/db.js +17 -0
  29. package/dist/cli/evaluation.d.ts +8 -0
  30. package/dist/cli/evaluation.js +142 -0
  31. package/dist/cli/traces.d.ts +8 -0
  32. package/dist/cli/traces.js +89 -0
  33. package/dist/cli.js +36 -66
  34. package/dist/connectors/web.d.ts +9 -0
  35. package/dist/context/window.d.ts +8 -0
  36. package/dist/core/config-builder.js +0 -47
  37. package/dist/core/create-nexus.d.ts +13 -0
  38. package/dist/core/create-nexus.js +0 -18
  39. package/dist/core/nexus.d.ts +26 -0
  40. package/dist/core/nexus.js +17 -170
  41. package/dist/core/response-format.d.ts +1 -0
  42. package/dist/core/secure-stream.js +0 -6
  43. package/dist/core/streaming.d.ts +3 -0
  44. package/dist/core/usage.d.ts +14 -0
  45. package/dist/core/usage.js +0 -20
  46. package/dist/embeddings/adapters.d.ts +12 -0
  47. package/dist/embeddings/adapters.js +0 -17
  48. package/dist/embeddings/errors.d.ts +33 -4
  49. package/dist/embeddings/errors.js +0 -7
  50. package/dist/embeddings/manager.d.ts +3 -0
  51. package/dist/embeddings/manager.js +0 -51
  52. package/dist/embeddings/mock.d.ts +7 -0
  53. package/dist/embeddings/mock.js +0 -10
  54. package/dist/embeddings/models.d.ts +15 -0
  55. package/dist/embeddings/models.js +0 -44
  56. package/dist/embeddings/providers.d.ts +26 -0
  57. package/dist/embeddings/providers.js +0 -7
  58. package/dist/embeddings/register.js +0 -7
  59. package/dist/evals/index.d.ts +1 -1
  60. package/dist/evals/judge.d.ts +47 -0
  61. package/dist/evals/metrics.d.ts +89 -0
  62. package/dist/evals/runner.d.ts +72 -1
  63. package/dist/evals/runner.js +84 -32
  64. package/dist/evaluate/compare.d.ts +22 -0
  65. package/dist/evaluate/compare.js +0 -13
  66. package/dist/evaluate/datasets.d.ts +45 -1
  67. package/dist/evaluate/datasets.js +44 -31
  68. package/dist/evaluate/evaluators.d.ts +11 -0
  69. package/dist/evaluate/evaluators.js +7 -29
  70. package/dist/evaluate/index.d.ts +2 -2
  71. package/dist/evaluate/index.js +2 -2
  72. package/dist/evaluate/review.d.ts +35 -0
  73. package/dist/evaluate/review.js +0 -24
  74. package/dist/evaluate/run.d.ts +23 -2
  75. package/dist/evaluate/run.js +40 -19
  76. package/dist/evaluate/version.d.ts +8 -0
  77. package/dist/evaluate/version.js +8 -0
  78. package/dist/graph/channels.js +0 -12
  79. package/dist/graph/checkpointer.d.ts +13 -0
  80. package/dist/graph/checkpointer.js +0 -29
  81. package/dist/graph/errors.d.ts +60 -7
  82. package/dist/graph/errors.js +1 -29
  83. package/dist/graph/graph.d.ts +53 -12
  84. package/dist/graph/graph.js +83 -158
  85. package/dist/graph/index.d.ts +1 -1
  86. package/dist/graph/node-cache.d.ts +16 -0
  87. package/dist/graph/node-cache.js +107 -0
  88. package/dist/graph/visualize.d.ts +1 -0
  89. package/dist/graph/visualize.js +0 -14
  90. package/dist/hallucination/consistency.d.ts +14 -0
  91. package/dist/hallucination/factual.d.ts +11 -0
  92. package/dist/hallucination/knowledge-graph.d.ts +35 -0
  93. package/dist/hallucination/rag.d.ts +21 -0
  94. package/dist/hallucination/retrieval.d.ts +21 -0
  95. package/dist/hallucination/verification.d.ts +32 -0
  96. package/dist/images/asset-stores.d.ts +45 -0
  97. package/dist/images/asset-stores.js +0 -32
  98. package/dist/images/asset-support.d.ts +80 -2
  99. package/dist/images/assets.d.ts +13 -0
  100. package/dist/images/assets.js +0 -8
  101. package/dist/images/codec.d.ts +4 -0
  102. package/dist/images/codec.js +0 -9
  103. package/dist/images/comfyui.d.ts +27 -0
  104. package/dist/images/comfyui.js +0 -20
  105. package/dist/images/errors.d.ts +39 -5
  106. package/dist/images/evals.d.ts +89 -1
  107. package/dist/images/evals.js +80 -20
  108. package/dist/images/google.d.ts +12 -0
  109. package/dist/images/google.js +0 -15
  110. package/dist/images/image-header.d.ts +6 -0
  111. package/dist/images/image-header.js +0 -17
  112. package/dist/images/inputs.d.ts +15 -1
  113. package/dist/images/inputs.js +0 -18
  114. package/dist/images/manager.d.ts +13 -0
  115. package/dist/images/manager.js +0 -12
  116. package/dist/images/mock.d.ts +10 -0
  117. package/dist/images/mock.js +0 -1
  118. package/dist/images/moderation.d.ts +6 -0
  119. package/dist/images/moderation.js +0 -15
  120. package/dist/images/openai.d.ts +33 -1
  121. package/dist/images/openai.js +0 -10
  122. package/dist/images/transform.d.ts +17 -0
  123. package/dist/images/transform.js +0 -20
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +1 -1
  126. package/dist/jobs/batch.d.ts +12 -0
  127. package/dist/jobs/durable-adapters.d.ts +24 -0
  128. package/dist/jobs/queue.d.ts +17 -0
  129. package/dist/mcp/client.d.ts +37 -0
  130. package/dist/mcp/client.js +0 -32
  131. package/dist/mcp/protocol.d.ts +30 -1
  132. package/dist/mcp/protocol.js +0 -16
  133. package/dist/mcp/server.d.ts +7 -0
  134. package/dist/mcp/server.js +0 -17
  135. package/dist/models/registry.d.ts +25 -0
  136. package/dist/models/registry.js +0 -26
  137. package/dist/next/route-handler.d.ts +4 -0
  138. package/dist/operations/adapters.d.ts +26 -0
  139. package/dist/operations/adapters.js +1 -16
  140. package/dist/operations/errors.d.ts +72 -8
  141. package/dist/operations/errors.js +8 -19
  142. package/dist/operations/handle.d.ts +15 -1
  143. package/dist/operations/handle.js +0 -29
  144. package/dist/operations/index.d.ts +1 -1
  145. package/dist/operations/index.js +1 -1
  146. package/dist/operations/runner.js +12 -55
  147. package/dist/operations/serialization.d.ts +10 -0
  148. package/dist/operations/serialization.js +50 -0
  149. package/dist/operations/state-machine.d.ts +2 -0
  150. package/dist/operations/state-machine.js +0 -18
  151. package/dist/operations/store.d.ts +17 -9
  152. package/dist/operations/store.js +2 -65
  153. package/dist/operations/webhooks.d.ts +2 -0
  154. package/dist/operations/webhooks.js +0 -23
  155. package/dist/ops/audit-logger.d.ts +2 -0
  156. package/dist/ops/circuit-breaker.d.ts +120 -5
  157. package/dist/ops/circuit-breaker.js +52 -25
  158. package/dist/ops/circuit-store.d.ts +83 -0
  159. package/dist/ops/circuit-store.js +89 -0
  160. package/dist/ops/circuit-sync.d.ts +57 -0
  161. package/dist/ops/circuit-sync.js +122 -0
  162. package/dist/ops/family-telemetry.d.ts +10 -0
  163. package/dist/ops/family-telemetry.js +0 -12
  164. package/dist/ops/health.d.ts +28 -0
  165. package/dist/ops/metrics.d.ts +39 -0
  166. package/dist/ops/otel-tracing.d.ts +9 -0
  167. package/dist/ops/rate-limit-adapters.d.ts +13 -0
  168. package/dist/ops/rate-limit-adapters.js +0 -11
  169. package/dist/ops/rate-limiter.d.ts +12 -1
  170. package/dist/ops/rate-limiter.js +1 -11
  171. package/dist/optimizer/budget.d.ts +17 -1
  172. package/dist/optimizer/cost-budget.d.ts +2 -0
  173. package/dist/optimizer/cost-budget.js +0 -13
  174. package/dist/optimizer/cost.d.ts +9 -0
  175. package/dist/optimizer/cost.js +0 -15
  176. package/dist/optimizer/densifier.d.ts +6 -0
  177. package/dist/optimizer/index.d.ts +2 -0
  178. package/dist/pipeline/pipeline.d.ts +10 -0
  179. package/dist/pipeline/types.d.ts +46 -0
  180. package/dist/postgres/circuits.d.ts +38 -0
  181. package/dist/postgres/circuits.js +46 -0
  182. package/dist/postgres/client.d.ts +43 -0
  183. package/dist/postgres/client.js +31 -0
  184. package/dist/postgres/evaluate.d.ts +53 -0
  185. package/dist/postgres/evaluate.js +96 -0
  186. package/dist/postgres/index.d.ts +22 -0
  187. package/dist/postgres/index.js +24 -0
  188. package/dist/postgres/operations.d.ts +59 -0
  189. package/dist/postgres/operations.js +113 -0
  190. package/dist/postgres/sql.d.ts +23 -0
  191. package/dist/postgres/sql.js +29 -0
  192. package/dist/postgres/store.d.ts +55 -0
  193. package/dist/postgres/store.js +144 -0
  194. package/dist/postgres/traces.d.ts +37 -0
  195. package/dist/postgres/traces.js +117 -0
  196. package/dist/providers/anthropic.d.ts +4 -0
  197. package/dist/providers/anthropic.js +0 -31
  198. package/dist/providers/azure-openai.js +0 -3
  199. package/dist/providers/base.d.ts +10 -0
  200. package/dist/providers/base.js +0 -1
  201. package/dist/providers/cohere.d.ts +5 -0
  202. package/dist/providers/deepseek.js +0 -3
  203. package/dist/providers/errors.d.ts +33 -0
  204. package/dist/providers/google.d.ts +4 -0
  205. package/dist/providers/google.js +0 -14
  206. package/dist/providers/groq.d.ts +4 -0
  207. package/dist/providers/llamacpp.js +0 -3
  208. package/dist/providers/lmstudio.js +0 -3
  209. package/dist/providers/mistral.d.ts +4 -0
  210. package/dist/providers/ollama.d.ts +4 -0
  211. package/dist/providers/ollama.js +0 -1
  212. package/dist/providers/openai.d.ts +4 -0
  213. package/dist/providers/openai.js +0 -23
  214. package/dist/providers/openrouter.d.ts +4 -0
  215. package/dist/providers/type-guards.d.ts +8 -0
  216. package/dist/rag/file-ingestion.d.ts +15 -0
  217. package/dist/rag/ingestion.d.ts +15 -0
  218. package/dist/realtime/conversation.d.ts +21 -0
  219. package/dist/realtime/errors.d.ts +25 -0
  220. package/dist/realtime/events.d.ts +7 -0
  221. package/dist/realtime/id.d.ts +5 -0
  222. package/dist/realtime/mock.transport.d.ts +27 -0
  223. package/dist/realtime/mock.transport.js +0 -4
  224. package/dist/realtime/openai-events.d.ts +3 -0
  225. package/dist/realtime/openai-server.d.ts +30 -0
  226. package/dist/realtime/openai-webrtc.transport.d.ts +108 -0
  227. package/dist/realtime/openai-webrtc.transport.js +0 -7
  228. package/dist/realtime/openai-websocket.transport.d.ts +46 -0
  229. package/dist/realtime/openai-websocket.transport.js +0 -2
  230. package/dist/realtime/provider.d.ts +30 -0
  231. package/dist/realtime/session.d.ts +44 -0
  232. package/dist/realtime/session.js +0 -3
  233. package/dist/realtime/tools.d.ts +25 -0
  234. package/dist/realtime/transport-utils.js +0 -1
  235. package/dist/realtime/types.d.ts +394 -0
  236. package/dist/router/auto-router.d.ts +5 -0
  237. package/dist/router/auto-router.js +3 -10
  238. package/dist/router/failover.d.ts +15 -0
  239. package/dist/router/failover.js +34 -13
  240. package/dist/router/index.d.ts +7 -1
  241. package/dist/router/index.js +40 -0
  242. package/dist/router/types.d.ts +27 -4
  243. package/dist/security/index.d.ts +17 -0
  244. package/dist/security/index.js +0 -1
  245. package/dist/security/injection-calibration.d.ts +17 -0
  246. package/dist/security/injection-detector.d.ts +3 -0
  247. package/dist/security/input-guard.d.ts +2 -0
  248. package/dist/security/output-guard.d.ts +2 -0
  249. package/dist/security/output-guard.js +0 -10
  250. package/dist/security/pii-detector.d.ts +3 -0
  251. package/dist/security/policies.d.ts +3 -0
  252. package/dist/security/prompt-hardening.d.ts +4 -0
  253. package/dist/security/schema-validator.d.ts +2 -0
  254. package/dist/security/semantic-injection-classifier.d.ts +6 -0
  255. package/dist/security/upload-scanner.d.ts +28 -0
  256. package/dist/store/helpers.d.ts +8 -0
  257. package/dist/store/helpers.js +53 -0
  258. package/dist/store/memory.d.ts +11 -6
  259. package/dist/store/memory.js +2 -64
  260. package/dist/store/redis.d.ts +17 -0
  261. package/dist/store/redis.js +1 -10
  262. package/dist/telephony/errors.d.ts +9 -1
  263. package/dist/telephony/manager.d.ts +17 -0
  264. package/dist/telephony/providers/twilio.d.ts +25 -0
  265. package/dist/telephony/providers/twilio.js +0 -3
  266. package/dist/telephony/realtime-bridge.d.ts +11 -0
  267. package/dist/telephony/realtime-bridge.js +0 -19
  268. package/dist/telephony/twiml.d.ts +3 -0
  269. package/dist/testing/embedding-provider-conformance.d.ts +17 -0
  270. package/dist/testing/embedding-provider-conformance.js +0 -7
  271. package/dist/testing/image-provider-conformance.d.ts +29 -0
  272. package/dist/testing/image-provider-conformance.js +0 -1
  273. package/dist/testing/provider-conformance.d.ts +24 -0
  274. package/dist/testing/record.d.ts +141 -0
  275. package/dist/testing/record.js +211 -0
  276. package/dist/tracing/alerts.d.ts +19 -0
  277. package/dist/tracing/alerts.js +0 -9
  278. package/dist/tracing/compare.d.ts +10 -0
  279. package/dist/tracing/compare.js +0 -10
  280. package/dist/tracing/instrument.d.ts +9 -0
  281. package/dist/tracing/instrument.js +0 -16
  282. package/dist/tracing/query.d.ts +6 -0
  283. package/dist/tracing/query.js +60 -0
  284. package/dist/tracing/stores.d.ts +22 -3
  285. package/dist/tracing/stores.js +2 -77
  286. package/dist/tracing/tracer.d.ts +29 -0
  287. package/dist/tracing/tracer.js +0 -13
  288. package/dist/types/agent.d.ts +31 -0
  289. package/dist/types/batch.d.ts +55 -0
  290. package/dist/types/capabilities.d.ts +9 -0
  291. package/dist/types/config.d.ts +197 -0
  292. package/dist/types/context-window.d.ts +62 -0
  293. package/dist/types/embeddings.d.ts +97 -0
  294. package/dist/types/evaluate.d.ts +55 -0
  295. package/dist/types/evaluate.js +0 -9
  296. package/dist/types/graph.d.ts +137 -3
  297. package/dist/types/graph.js +0 -30
  298. package/dist/types/images.d.ts +178 -0
  299. package/dist/types/messages.d.ts +70 -0
  300. package/dist/types/operations.d.ts +84 -0
  301. package/dist/types/operations.js +0 -8
  302. package/dist/types/optimizer.d.ts +31 -0
  303. package/dist/types/planning.d.ts +29 -0
  304. package/dist/types/providers.d.ts +49 -0
  305. package/dist/types/providers.js +0 -40
  306. package/dist/types/response.d.ts +55 -0
  307. package/dist/types/security.d.ts +35 -0
  308. package/dist/types/store.d.ts +17 -0
  309. package/dist/types/store.js +0 -8
  310. package/dist/types/telephony.d.ts +216 -0
  311. package/dist/types/tracing.d.ts +53 -0
  312. package/dist/types/tracing.js +0 -9
  313. package/dist/types/voice.d.ts +170 -0
  314. package/dist/utils/safe-fetch.js +8 -38
  315. package/dist/utils/tokenizer.d.ts +7 -0
  316. package/dist/voice/errors.d.ts +9 -1
  317. package/dist/voice/manager.d.ts +16 -0
  318. package/dist/voice/providers/openai.d.ts +13 -0
  319. package/dist/voice/session.d.ts +16 -0
  320. package/dist/workflow/chains.d.ts +53 -0
  321. package/dist/workflow/domain.d.ts +28 -0
  322. package/dist-cjs/agent/create-agent.d.ts +35 -0
  323. package/dist-cjs/agent/create-agent.js +0 -19
  324. package/dist-cjs/agent/loop.d.ts +7 -0
  325. package/dist-cjs/agent/loop.js +0 -3
  326. package/dist-cjs/agent/middleware.d.ts +2 -0
  327. package/dist-cjs/agent/middleware.js +0 -19
  328. package/dist-cjs/agent/tool.d.ts +6 -0
  329. package/dist-cjs/batch/anthropic.d.ts +14 -0
  330. package/dist-cjs/batch/anthropic.js +0 -14
  331. package/dist-cjs/batch/errors.d.ts +23 -3
  332. package/dist-cjs/batch/manager.d.ts +8 -0
  333. package/dist-cjs/batch/manager.js +0 -37
  334. package/dist-cjs/batch/mock.d.ts +9 -0
  335. package/dist-cjs/batch/mock.js +0 -8
  336. package/dist-cjs/batch/openai.d.ts +11 -0
  337. package/dist-cjs/batch/openai.js +0 -8
  338. package/dist-cjs/cache/adapters.d.ts +31 -0
  339. package/dist-cjs/cache/memory-cache.d.ts +14 -0
  340. package/dist-cjs/cache/semantic-cache.d.ts +15 -0
  341. package/dist-cjs/capabilities/negotiate.d.ts +9 -0
  342. package/dist-cjs/capabilities/negotiate.js +0 -14
  343. package/dist-cjs/cli/args.d.ts +26 -0
  344. package/dist-cjs/cli/args.js +145 -0
  345. package/dist-cjs/cli/db.d.ts +8 -0
  346. package/dist-cjs/cli/db.js +20 -0
  347. package/dist-cjs/cli/evaluation.d.ts +8 -0
  348. package/dist-cjs/cli/evaluation.js +148 -0
  349. package/dist-cjs/cli/traces.d.ts +8 -0
  350. package/dist-cjs/cli/traces.js +95 -0
  351. package/dist-cjs/connectors/web.d.ts +9 -0
  352. package/dist-cjs/context/window.d.ts +8 -0
  353. package/dist-cjs/core/config-builder.js +0 -47
  354. package/dist-cjs/core/create-nexus.d.ts +13 -0
  355. package/dist-cjs/core/create-nexus.js +0 -18
  356. package/dist-cjs/core/nexus.d.ts +26 -0
  357. package/dist-cjs/core/nexus.js +17 -170
  358. package/dist-cjs/core/response-format.d.ts +1 -0
  359. package/dist-cjs/core/secure-stream.js +0 -6
  360. package/dist-cjs/core/streaming.d.ts +3 -0
  361. package/dist-cjs/core/usage.d.ts +14 -0
  362. package/dist-cjs/core/usage.js +0 -20
  363. package/dist-cjs/embeddings/adapters.d.ts +12 -0
  364. package/dist-cjs/embeddings/adapters.js +0 -17
  365. package/dist-cjs/embeddings/errors.d.ts +33 -4
  366. package/dist-cjs/embeddings/errors.js +0 -7
  367. package/dist-cjs/embeddings/manager.d.ts +3 -0
  368. package/dist-cjs/embeddings/manager.js +0 -51
  369. package/dist-cjs/embeddings/mock.d.ts +7 -0
  370. package/dist-cjs/embeddings/mock.js +0 -10
  371. package/dist-cjs/embeddings/models.d.ts +15 -0
  372. package/dist-cjs/embeddings/models.js +0 -44
  373. package/dist-cjs/embeddings/providers.d.ts +26 -0
  374. package/dist-cjs/embeddings/providers.js +0 -7
  375. package/dist-cjs/embeddings/register.js +0 -7
  376. package/dist-cjs/evals/index.d.ts +1 -1
  377. package/dist-cjs/evals/judge.d.ts +47 -0
  378. package/dist-cjs/evals/metrics.d.ts +89 -0
  379. package/dist-cjs/evals/runner.d.ts +72 -1
  380. package/dist-cjs/evals/runner.js +117 -32
  381. package/dist-cjs/evaluate/compare.d.ts +22 -0
  382. package/dist-cjs/evaluate/compare.js +0 -13
  383. package/dist-cjs/evaluate/datasets.d.ts +45 -1
  384. package/dist-cjs/evaluate/datasets.js +49 -35
  385. package/dist-cjs/evaluate/evaluators.d.ts +11 -0
  386. package/dist-cjs/evaluate/evaluators.js +8 -29
  387. package/dist-cjs/evaluate/index.d.ts +2 -2
  388. package/dist-cjs/evaluate/index.js +4 -1
  389. package/dist-cjs/evaluate/review.d.ts +35 -0
  390. package/dist-cjs/evaluate/review.js +0 -24
  391. package/dist-cjs/evaluate/run.d.ts +23 -2
  392. package/dist-cjs/evaluate/run.js +40 -19
  393. package/dist-cjs/evaluate/version.d.ts +8 -0
  394. package/dist-cjs/evaluate/version.js +11 -0
  395. package/dist-cjs/graph/channels.js +0 -12
  396. package/dist-cjs/graph/checkpointer.d.ts +13 -0
  397. package/dist-cjs/graph/checkpointer.js +0 -29
  398. package/dist-cjs/graph/errors.d.ts +60 -7
  399. package/dist-cjs/graph/errors.js +1 -29
  400. package/dist-cjs/graph/graph.d.ts +53 -12
  401. package/dist-cjs/graph/graph.js +116 -158
  402. package/dist-cjs/graph/index.d.ts +1 -1
  403. package/dist-cjs/graph/node-cache.d.ts +16 -0
  404. package/dist-cjs/graph/node-cache.js +111 -0
  405. package/dist-cjs/graph/visualize.d.ts +1 -0
  406. package/dist-cjs/graph/visualize.js +0 -14
  407. package/dist-cjs/hallucination/consistency.d.ts +14 -0
  408. package/dist-cjs/hallucination/factual.d.ts +11 -0
  409. package/dist-cjs/hallucination/knowledge-graph.d.ts +35 -0
  410. package/dist-cjs/hallucination/rag.d.ts +21 -0
  411. package/dist-cjs/hallucination/retrieval.d.ts +21 -0
  412. package/dist-cjs/hallucination/verification.d.ts +32 -0
  413. package/dist-cjs/images/asset-stores.d.ts +45 -0
  414. package/dist-cjs/images/asset-stores.js +0 -32
  415. package/dist-cjs/images/asset-support.d.ts +80 -2
  416. package/dist-cjs/images/assets.d.ts +13 -0
  417. package/dist-cjs/images/assets.js +0 -8
  418. package/dist-cjs/images/codec.d.ts +4 -0
  419. package/dist-cjs/images/codec.js +0 -9
  420. package/dist-cjs/images/comfyui.d.ts +27 -0
  421. package/dist-cjs/images/comfyui.js +0 -20
  422. package/dist-cjs/images/errors.d.ts +39 -5
  423. package/dist-cjs/images/evals.d.ts +89 -1
  424. package/dist-cjs/images/evals.js +80 -20
  425. package/dist-cjs/images/google.d.ts +12 -0
  426. package/dist-cjs/images/google.js +0 -15
  427. package/dist-cjs/images/image-header.d.ts +6 -0
  428. package/dist-cjs/images/image-header.js +0 -17
  429. package/dist-cjs/images/inputs.d.ts +15 -1
  430. package/dist-cjs/images/inputs.js +0 -18
  431. package/dist-cjs/images/manager.d.ts +13 -0
  432. package/dist-cjs/images/manager.js +0 -12
  433. package/dist-cjs/images/mock.d.ts +10 -0
  434. package/dist-cjs/images/mock.js +0 -1
  435. package/dist-cjs/images/moderation.d.ts +6 -0
  436. package/dist-cjs/images/moderation.js +0 -15
  437. package/dist-cjs/images/openai.d.ts +33 -1
  438. package/dist-cjs/images/openai.js +0 -10
  439. package/dist-cjs/images/transform.d.ts +17 -0
  440. package/dist-cjs/images/transform.js +0 -20
  441. package/dist-cjs/index.d.ts +3 -3
  442. package/dist-cjs/index.js +5 -4
  443. package/dist-cjs/jobs/batch.d.ts +12 -0
  444. package/dist-cjs/jobs/durable-adapters.d.ts +24 -0
  445. package/dist-cjs/jobs/queue.d.ts +17 -0
  446. package/dist-cjs/mcp/client.d.ts +37 -0
  447. package/dist-cjs/mcp/client.js +0 -32
  448. package/dist-cjs/mcp/protocol.d.ts +30 -1
  449. package/dist-cjs/mcp/protocol.js +0 -16
  450. package/dist-cjs/mcp/server.d.ts +7 -0
  451. package/dist-cjs/mcp/server.js +0 -17
  452. package/dist-cjs/models/registry.d.ts +25 -0
  453. package/dist-cjs/models/registry.js +0 -26
  454. package/dist-cjs/next/route-handler.d.ts +4 -0
  455. package/dist-cjs/operations/adapters.d.ts +26 -0
  456. package/dist-cjs/operations/adapters.js +3 -18
  457. package/dist-cjs/operations/errors.d.ts +72 -8
  458. package/dist-cjs/operations/errors.js +10 -20
  459. package/dist-cjs/operations/handle.d.ts +15 -1
  460. package/dist-cjs/operations/handle.js +0 -29
  461. package/dist-cjs/operations/index.d.ts +1 -1
  462. package/dist-cjs/operations/index.js +2 -1
  463. package/dist-cjs/operations/runner.js +11 -54
  464. package/dist-cjs/operations/serialization.d.ts +10 -0
  465. package/dist-cjs/operations/serialization.js +53 -0
  466. package/dist-cjs/operations/state-machine.d.ts +2 -0
  467. package/dist-cjs/operations/state-machine.js +0 -18
  468. package/dist-cjs/operations/store.d.ts +17 -9
  469. package/dist-cjs/operations/store.js +5 -69
  470. package/dist-cjs/operations/webhooks.d.ts +2 -0
  471. package/dist-cjs/operations/webhooks.js +0 -23
  472. package/dist-cjs/ops/audit-logger.d.ts +2 -0
  473. package/dist-cjs/ops/circuit-breaker.d.ts +120 -5
  474. package/dist-cjs/ops/circuit-breaker.js +85 -25
  475. package/dist-cjs/ops/circuit-store.d.ts +83 -0
  476. package/dist-cjs/ops/circuit-store.js +94 -0
  477. package/dist-cjs/ops/circuit-sync.d.ts +57 -0
  478. package/dist-cjs/ops/circuit-sync.js +126 -0
  479. package/dist-cjs/ops/family-telemetry.d.ts +10 -0
  480. package/dist-cjs/ops/family-telemetry.js +0 -12
  481. package/dist-cjs/ops/health.d.ts +28 -0
  482. package/dist-cjs/ops/metrics.d.ts +39 -0
  483. package/dist-cjs/ops/otel-tracing.d.ts +9 -0
  484. package/dist-cjs/ops/rate-limit-adapters.d.ts +13 -0
  485. package/dist-cjs/ops/rate-limit-adapters.js +0 -11
  486. package/dist-cjs/ops/rate-limiter.d.ts +12 -1
  487. package/dist-cjs/ops/rate-limiter.js +1 -11
  488. package/dist-cjs/optimizer/budget.d.ts +17 -1
  489. package/dist-cjs/optimizer/cost-budget.d.ts +2 -0
  490. package/dist-cjs/optimizer/cost-budget.js +0 -13
  491. package/dist-cjs/optimizer/cost.d.ts +9 -0
  492. package/dist-cjs/optimizer/cost.js +0 -15
  493. package/dist-cjs/optimizer/densifier.d.ts +6 -0
  494. package/dist-cjs/optimizer/index.d.ts +2 -0
  495. package/dist-cjs/pipeline/pipeline.d.ts +10 -0
  496. package/dist-cjs/pipeline/types.d.ts +46 -0
  497. package/dist-cjs/postgres/circuits.d.ts +38 -0
  498. package/dist-cjs/postgres/circuits.js +51 -0
  499. package/dist-cjs/postgres/client.d.ts +43 -0
  500. package/dist-cjs/postgres/client.js +39 -0
  501. package/dist-cjs/postgres/evaluate.d.ts +53 -0
  502. package/dist-cjs/postgres/evaluate.js +102 -0
  503. package/dist-cjs/postgres/index.d.ts +22 -0
  504. package/dist-cjs/postgres/index.js +40 -0
  505. package/dist-cjs/postgres/operations.d.ts +59 -0
  506. package/dist-cjs/postgres/operations.js +118 -0
  507. package/dist-cjs/postgres/sql.d.ts +23 -0
  508. package/dist-cjs/postgres/sql.js +36 -0
  509. package/dist-cjs/postgres/store.d.ts +55 -0
  510. package/dist-cjs/postgres/store.js +149 -0
  511. package/dist-cjs/postgres/traces.d.ts +37 -0
  512. package/dist-cjs/postgres/traces.js +122 -0
  513. package/dist-cjs/providers/anthropic.d.ts +4 -0
  514. package/dist-cjs/providers/anthropic.js +0 -31
  515. package/dist-cjs/providers/azure-openai.js +0 -3
  516. package/dist-cjs/providers/base.d.ts +10 -0
  517. package/dist-cjs/providers/base.js +0 -1
  518. package/dist-cjs/providers/cohere.d.ts +5 -0
  519. package/dist-cjs/providers/deepseek.js +0 -3
  520. package/dist-cjs/providers/errors.d.ts +33 -0
  521. package/dist-cjs/providers/google.d.ts +4 -0
  522. package/dist-cjs/providers/google.js +0 -14
  523. package/dist-cjs/providers/groq.d.ts +4 -0
  524. package/dist-cjs/providers/llamacpp.js +0 -3
  525. package/dist-cjs/providers/lmstudio.js +0 -3
  526. package/dist-cjs/providers/mistral.d.ts +4 -0
  527. package/dist-cjs/providers/ollama.d.ts +4 -0
  528. package/dist-cjs/providers/ollama.js +0 -1
  529. package/dist-cjs/providers/openai.d.ts +4 -0
  530. package/dist-cjs/providers/openai.js +0 -23
  531. package/dist-cjs/providers/openrouter.d.ts +4 -0
  532. package/dist-cjs/providers/type-guards.d.ts +8 -0
  533. package/dist-cjs/rag/file-ingestion.d.ts +15 -0
  534. package/dist-cjs/rag/ingestion.d.ts +15 -0
  535. package/dist-cjs/realtime/conversation.d.ts +21 -0
  536. package/dist-cjs/realtime/errors.d.ts +25 -0
  537. package/dist-cjs/realtime/events.d.ts +7 -0
  538. package/dist-cjs/realtime/id.d.ts +5 -0
  539. package/dist-cjs/realtime/mock.transport.d.ts +27 -0
  540. package/dist-cjs/realtime/mock.transport.js +0 -4
  541. package/dist-cjs/realtime/openai-events.d.ts +3 -0
  542. package/dist-cjs/realtime/openai-server.d.ts +30 -0
  543. package/dist-cjs/realtime/openai-webrtc.transport.d.ts +108 -0
  544. package/dist-cjs/realtime/openai-webrtc.transport.js +0 -7
  545. package/dist-cjs/realtime/openai-websocket.transport.d.ts +46 -0
  546. package/dist-cjs/realtime/openai-websocket.transport.js +0 -2
  547. package/dist-cjs/realtime/provider.d.ts +30 -0
  548. package/dist-cjs/realtime/session.d.ts +44 -0
  549. package/dist-cjs/realtime/session.js +0 -3
  550. package/dist-cjs/realtime/tools.d.ts +25 -0
  551. package/dist-cjs/realtime/transport-utils.js +0 -1
  552. package/dist-cjs/realtime/types.d.ts +394 -0
  553. package/dist-cjs/router/auto-router.d.ts +5 -0
  554. package/dist-cjs/router/auto-router.js +3 -10
  555. package/dist-cjs/router/failover.d.ts +15 -0
  556. package/dist-cjs/router/failover.js +34 -13
  557. package/dist-cjs/router/index.d.ts +7 -1
  558. package/dist-cjs/router/index.js +40 -0
  559. package/dist-cjs/router/types.d.ts +27 -4
  560. package/dist-cjs/security/index.d.ts +17 -0
  561. package/dist-cjs/security/index.js +0 -1
  562. package/dist-cjs/security/injection-calibration.d.ts +17 -0
  563. package/dist-cjs/security/injection-detector.d.ts +3 -0
  564. package/dist-cjs/security/input-guard.d.ts +2 -0
  565. package/dist-cjs/security/output-guard.d.ts +2 -0
  566. package/dist-cjs/security/output-guard.js +0 -10
  567. package/dist-cjs/security/pii-detector.d.ts +3 -0
  568. package/dist-cjs/security/policies.d.ts +3 -0
  569. package/dist-cjs/security/prompt-hardening.d.ts +4 -0
  570. package/dist-cjs/security/schema-validator.d.ts +2 -0
  571. package/dist-cjs/security/semantic-injection-classifier.d.ts +6 -0
  572. package/dist-cjs/security/upload-scanner.d.ts +28 -0
  573. package/dist-cjs/store/helpers.d.ts +8 -0
  574. package/dist-cjs/store/helpers.js +59 -0
  575. package/dist-cjs/store/memory.d.ts +11 -6
  576. package/dist-cjs/store/memory.js +10 -72
  577. package/dist-cjs/store/redis.d.ts +17 -0
  578. package/dist-cjs/store/redis.js +4 -13
  579. package/dist-cjs/telephony/errors.d.ts +9 -1
  580. package/dist-cjs/telephony/manager.d.ts +17 -0
  581. package/dist-cjs/telephony/providers/twilio.d.ts +25 -0
  582. package/dist-cjs/telephony/providers/twilio.js +0 -3
  583. package/dist-cjs/telephony/realtime-bridge.d.ts +11 -0
  584. package/dist-cjs/telephony/realtime-bridge.js +0 -19
  585. package/dist-cjs/telephony/twiml.d.ts +3 -0
  586. package/dist-cjs/testing/embedding-provider-conformance.d.ts +17 -0
  587. package/dist-cjs/testing/embedding-provider-conformance.js +0 -7
  588. package/dist-cjs/testing/image-provider-conformance.d.ts +29 -0
  589. package/dist-cjs/testing/image-provider-conformance.js +0 -1
  590. package/dist-cjs/testing/provider-conformance.d.ts +24 -0
  591. package/dist-cjs/testing/record.d.ts +141 -0
  592. package/dist-cjs/testing/record.js +223 -0
  593. package/dist-cjs/tracing/alerts.d.ts +19 -0
  594. package/dist-cjs/tracing/alerts.js +0 -9
  595. package/dist-cjs/tracing/compare.d.ts +10 -0
  596. package/dist-cjs/tracing/compare.js +0 -10
  597. package/dist-cjs/tracing/instrument.d.ts +9 -0
  598. package/dist-cjs/tracing/instrument.js +0 -16
  599. package/dist-cjs/tracing/query.d.ts +6 -0
  600. package/dist-cjs/tracing/query.js +65 -0
  601. package/dist-cjs/tracing/stores.d.ts +22 -3
  602. package/dist-cjs/tracing/stores.js +8 -84
  603. package/dist-cjs/tracing/tracer.d.ts +29 -0
  604. package/dist-cjs/tracing/tracer.js +0 -13
  605. package/dist-cjs/types/agent.d.ts +31 -0
  606. package/dist-cjs/types/batch.d.ts +55 -0
  607. package/dist-cjs/types/capabilities.d.ts +9 -0
  608. package/dist-cjs/types/config.d.ts +197 -0
  609. package/dist-cjs/types/context-window.d.ts +62 -0
  610. package/dist-cjs/types/embeddings.d.ts +97 -0
  611. package/dist-cjs/types/evaluate.d.ts +55 -0
  612. package/dist-cjs/types/evaluate.js +0 -9
  613. package/dist-cjs/types/graph.d.ts +137 -3
  614. package/dist-cjs/types/graph.js +0 -30
  615. package/dist-cjs/types/images.d.ts +178 -0
  616. package/dist-cjs/types/messages.d.ts +70 -0
  617. package/dist-cjs/types/operations.d.ts +84 -0
  618. package/dist-cjs/types/operations.js +0 -8
  619. package/dist-cjs/types/optimizer.d.ts +31 -0
  620. package/dist-cjs/types/planning.d.ts +29 -0
  621. package/dist-cjs/types/providers.d.ts +49 -0
  622. package/dist-cjs/types/providers.js +0 -40
  623. package/dist-cjs/types/response.d.ts +55 -0
  624. package/dist-cjs/types/security.d.ts +35 -0
  625. package/dist-cjs/types/store.d.ts +17 -0
  626. package/dist-cjs/types/store.js +0 -8
  627. package/dist-cjs/types/telephony.d.ts +216 -0
  628. package/dist-cjs/types/tracing.d.ts +53 -0
  629. package/dist-cjs/types/tracing.js +0 -9
  630. package/dist-cjs/types/voice.d.ts +170 -0
  631. package/dist-cjs/utils/safe-fetch.js +8 -38
  632. package/dist-cjs/utils/tokenizer.d.ts +7 -0
  633. package/dist-cjs/voice/errors.d.ts +9 -1
  634. package/dist-cjs/voice/manager.d.ts +16 -0
  635. package/dist-cjs/voice/providers/openai.d.ts +13 -0
  636. package/dist-cjs/voice/session.d.ts +16 -0
  637. package/dist-cjs/workflow/chains.d.ts +53 -0
  638. package/dist-cjs/workflow/domain.d.ts +28 -0
  639. package/package.json +119 -5
package/API_STABILITY.md CHANGED
@@ -210,10 +210,14 @@ What is guaranteed is the state machine — closed, open after a threshold is cr
210
210
  the cooldown, closed again only after the configured probe successes — and that routing still selects
211
211
  a provider when every circuit is open rather than failing the request untried.
212
212
 
213
- Breaker state is per process by design. Two workers can disagree about a provider, and neither the
214
- breaker nor its snapshot promises cluster-wide consensus. Rate-limit counters are the opposite: they
215
- are only shared when a store is configured, and the default in-memory counter gives each worker its
216
- own budget.
213
+ Breaker state is per process unless `circuitBreaker.store` is set (since 1.16.0). With a store,
214
+ workers converge on each other's decisions within about `syncIntervalMs`, and one worker at a time
215
+ holds the probe; this is eventual agreement, not consensus, and two workers may briefly disagree.
216
+ Failure counting stays per worker either way. The `CircuitStateStore` contract and the memory, Redis,
217
+ and Postgres adapters follow the 1.x rules. Since 1.16.0 a caller's cancellation does not count as a
218
+ failure unless `isFailure` says so, and probe limits apply to every attempt the failover executor
219
+ makes. Rate-limit counters are only shared when a store is configured, and the default in-memory
220
+ counter gives each worker its own budget.
217
221
 
218
222
  ## Batch API stage
219
223
 
@@ -328,6 +332,19 @@ Also since 1.12.0, all additive:
328
332
  - A subgraph node's thread id is `<parent thread>:<task id>`, which equals the previous
329
333
  `<parent thread>:<node>` for any node not reached through `Send`.
330
334
 
335
+ Also since 1.16.0, all additive:
336
+
337
+ - `createGraph({ channels, input, output })`. `StateGraph`, `CompiledGraph`, and `GraphResult` gained
338
+ defaulted type parameters for the input and output channels, so existing annotations such as
339
+ `CompiledGraph<S>` keep their meaning. A write to an undeclared input rejects with
340
+ `GraphValidationError`. Checkpoints and stream events still carry every channel.
341
+ - `NodeOptions.cache` and `CompileOptions.cache`. Guaranteed: a failure, an interrupt, a node that
342
+ consumed an interrupt's answer, and a `Command.PARENT` result are never served from the cache, and a
343
+ cache that throws is treated as a miss. Not guaranteed: the default key's exact text, so entries
344
+ written by one minor release may miss after an upgrade.
345
+ - `task_end` events may carry `cached: true`; `GraphDescription` may carry `input`, `output`, and a
346
+ node's `cache` flag.
347
+
331
348
  ## Agent, store, MCP, and tracing stages (1.14.0)
332
349
 
333
350
  The `nexus-ai-pro/agent`, `nexus-ai-pro/store`, `nexus-ai-pro/store/redis`, and `nexus-ai-pro/mcp`
@@ -368,9 +385,32 @@ are normalized; new optional fields and new bundled evaluators may be added in a
368
385
  same inputs give the same verdict; the exact interval bounds may change if the method improves, and
369
386
  a verdict is a judgement about evidence rather than a compatibility guarantee.
370
387
  - `evaluate()` reports a target's failure as a failed example and an evaluator's failure as a failed
371
- measurement; neither throws.
372
- - The existing `EvalRunner` and `MediaEvalRunner` keep their APIs unchanged. Rebuilding them on this
373
- entry point is a later, internal change.
388
+ measurement; neither throws. Since 1.16.0 an aborted evaluation rejects with the abort reason and
389
+ stores nothing.
390
+ - `EvalRunner` and `MediaEvalRunner` keep their APIs. Since 1.16.0 both run on `evaluate()` and carry
391
+ the resulting experiment in an optional `experiment` field; their reports are otherwise unchanged.
392
+ - Since 1.16.0, additive: `underCost()`, `FileExperimentStore`, `readExperiment()`, the `cost`
393
+ option, per-example `repetitions`, and `signal` on the target's context.
394
+
395
+ ## Postgres, command-line, and record-and-replay stages (1.16.0)
396
+
397
+ The `nexus-ai-pro/postgres` subpaths, `nexus-ai-pro/ops/circuit-store`, and
398
+ `nexus-ai-pro/testing/record` are public and follow the 1.x rules. None is exported from the root.
399
+
400
+ - Each Postgres adapter implements the same contract as the corresponding in-memory store, and is
401
+ tested against it. Ordering among rows that tie on a timestamp is not a guarantee.
402
+ - `PostgresLikeClient` is the whole driver contract: `query(text, values)` resolving to `{ rows }`.
403
+ - The schema is guaranteed additive for the 1.x line: a minor release may add a column or an index,
404
+ never drop or rename one, and `migrate()` stays idempotent. A change that needs a data migration
405
+ waits for 2.0.
406
+ - Unique idempotency keys in `PostgresOperationStore` are a guarantee, and `OperationDuplicateError`
407
+ is the signal the runner relies on.
408
+ - The `nexus` commands and flags listed by `nexus help` are public. Human-readable output is not a
409
+ guarantee and may improve in any release; `--json` output follows the 1.x rules; exit codes are
410
+ guaranteed — 0 for success, 1 for a failed check, 2 for a usage error.
411
+ - The fixture file format and the default match key of `testing/record` are stable for the 1.x line,
412
+ so recordings made with one release keep replaying with the next. A change that would invalidate
413
+ recordings waits for 2.0.
374
414
 
375
415
  ## Deprecation process
376
416
 
package/CHANGELOG.md CHANGED
@@ -4,6 +4,101 @@ Notable changes to this project are recorded here. The format follows [Keep a Ch
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.16.0] - 2026-09-22
8
+
9
+ Shared state and the command line. Everything that has to outlive a process or be shared between
10
+ workers now has a Postgres adapter, circuit decisions are shared across a fleet, the evaluation
11
+ platform has a CI gate, and suites that needed credentials can run from recorded provider traffic.
12
+
13
+ ### Added
14
+
15
+ - **A Postgres adapter family** (`nexus-ai-pro/postgres`, with one subpath per adapter):
16
+ `PostgresOperationStore`, `PostgresStore` (long-term memory, ranked by pgvector when
17
+ `vectorDimensions` is set), `PostgresTraceStore`, `PostgresDatasetStore`, `PostgresExperimentStore`,
18
+ and `PostgresCircuitStateStore`.
19
+ - Each takes any client with `query(text, values)` — `pg`, `@neondatabase/serverless`, PGlite — and
20
+ `fromPostgresJs()` adapts `postgres.js`. No driver becomes a dependency.
21
+ - Nothing creates a schema at import: `migrate()`, `postgresMigration()`, and `nexus db sql` apply
22
+ or print it.
23
+ - Idempotency keys are unique in the operations table, so two workers racing to submit one key run
24
+ the work once. Graph threads persist across workers through `OperationStoreCheckpointer`.
25
+ - **Shared circuit state.** `circuitBreaker.store` takes a `CircuitStateStore`: memory and Redis
26
+ adapters in `nexus-ai-pro/ops/circuit-store`, Postgres in `/postgres/circuits`. A provider that
27
+ fails in one worker is taken out of routing in all of them, and one worker at a time probes it when
28
+ the cooldown ends. Checks stay synchronous; the coordination code loads only when a store is
29
+ configured. `ai.syncCircuitBreaker()` loads shared state at startup.
30
+ - **Evaluation from the command line.** `nexus eval run`, `nexus eval compare`, and `nexus eval gate`
31
+ run an evaluation module to an experiment file and fail a build only on a regression beyond noise,
32
+ a new failure, or a dataset mismatch. `nexus traces list`, `show`, and `export` read a JSONL file or
33
+ any trace store a module exports. `nexus db sql` prints the Postgres schema. Every command takes
34
+ `--json`, and a usage error exits with 2.
35
+ - **Record and replay** (`nexus-ai-pro/testing/record`). `recordingFetch()` writes provider traffic
36
+ to reviewable fixture files with credentials removed; `replayFetch()` serves it back with no network
37
+ and throws `FixtureMissingError` for anything unrecorded; `fixtureFetch()` picks the mode from
38
+ `NEXUS_FIXTURES`; `installFetch()` covers code that calls the global `fetch`. Multipart boundaries
39
+ and key order do not break matching.
40
+ - **Image conformance from recordings.** `npm run conformance:images:record` records the image suite
41
+ against every backend with credentials present; `npm run test:conformance:images` replays it in CI
42
+ and reports any backend without recordings rather than counting it as a pass.
43
+ - **Graph input and output channels.** `createGraph({ channels, input, output })` restricts what a
44
+ caller may pass in and what comes back, in the types and at run time. As a subgraph, a graph
45
+ receives only its inputs and merges back only its outputs.
46
+ - **Per-node caching.** `addNode(name, fn, { cache: { key, ttlMs, store } })` reuses a node's result
47
+ for the same state and input, in a bounded in-process map or any cache adapter
48
+ (`compile({ cache })` sets a default). Failures, interrupts, human answers, and parent commands are
49
+ never cached; a failing cache is a miss.
50
+ - **Evaluation additions.** `underCost()` per-example cost gate; `FileExperimentStore` and
51
+ `readExperiment()`; `repetitions` may be a function per example; the target receives the abort
52
+ signal.
53
+ - `EvalRunner.run()` and `MediaEvalRunner.evaluate()` return the experiment underneath their report,
54
+ and accept options to name and store it.
55
+ - `OperationDuplicateError`, raised by stores that enforce unique idempotency keys.
56
+ - **Documentation coverage.** Every public export, and every public member of an exported class,
57
+ interface, or enum, now has a doc comment: 4,651 declarations across 88 entry points.
58
+ `npm run docs:check` enforces it and runs as part of `npm test`.
59
+
60
+ ### Changed
61
+
62
+ - `EvalRunner` and `MediaEvalRunner` now run on `evaluate()`. Their results and errors are unchanged;
63
+ `evaluate()` is loaded the first time they run, so neither entry point grew.
64
+ - A caller cancelling a request no longer counts against a provider's circuit.
65
+ - Circuit probe limits are enforced on every attempt through the failover executor, so concurrent
66
+ requests go to a fallback instead of all probing a half-open provider.
67
+ - Comments are stripped from the emitted JavaScript and kept in the type declarations, where editors
68
+ read them. Every entry point shrinks as a result: the root import is 572 KB, down from 612 KB, even
69
+ after the breaker fixes, the `EvalRunner` rebuild, and duplicate-key handling. The published size
70
+ table has the per-entry-point figures.
71
+ - The packed tarball is 666 KB and 4.1 MB unpacked, up from 3.5 MB, almost all of it the doc comments
72
+ in the type declarations, which are shipped for both ESM and CommonJS.
73
+
74
+ ### Fixed
75
+
76
+ - `evaluate()` ignored its `signal` option; aborting now stops new examples, reaches targets, and
77
+ never stores a partial experiment.
78
+ - `evaluate()` never recorded cost, so `totalCost()` always reported 0. Cost is now read from
79
+ completion and image results or from a `cost` option.
80
+ - A half-open probe slot was never released when an attempt's error did not count as a failure,
81
+ leaving the circuit refusing traffic until it was reset.
82
+ - The breaker's documented `halfOpenMaxCalls` was not enforced on real requests: the client routed
83
+ every request to a half-open provider.
84
+ - The context-window summary call could route to a provider whose circuit was open.
85
+ - `routing.fallback` was accepted but never applied. `onError` models are now tried after every
86
+ route the router chose, `onTimeout` gives the first attempt its own timeout before its fallback,
87
+ and `onRateLimit` retries a rate-limited first attempt before falling back.
88
+ - Privacy routing ignored a provider's own `isLocal` declaration, so an OpenAI-compatible server
89
+ configured as local was still scored as hosted.
90
+
91
+ ### Deprecated
92
+
93
+ These options were accepted but never read. They still type-check, do nothing, and will be removed
94
+ in 2.0.
95
+
96
+ - `GoogleProviderConfig.projectId`.
97
+ - `OllamaProviderConfig.timeout`.
98
+ - `MetricsConfig.prometheus`: Prometheus text is always available from `getPrometheusMetrics()`.
99
+ - `DensificationConfig.preserveMarkdown`: densification never rewrites Markdown structure.
100
+ - `HealthConfig.latencyHalfLife`: latency is averaged with a fixed weight.
101
+
7
102
  ## [1.15.0] - 2026-09-21
8
103
 
9
104
  Evaluation. One entry point for evaluating anything, datasets versioned by their content, experiments
@@ -751,7 +846,8 @@ shared policy vocabulary is in place for a future release that revisits this.
751
846
  - URL fetching rejects unsafe private-network targets and limits response reads.
752
847
  - CLI and audit findings no longer disclose detected secret values.
753
848
 
754
- [Unreleased]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.15.0...HEAD
849
+ [Unreleased]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.16.0...HEAD
850
+ [1.16.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.15.0...v1.16.0
755
851
  [1.15.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.14.0...v1.15.0
756
852
  [1.14.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.12.0...v1.14.0
757
853
  [1.12.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.11.0...v1.12.0
package/README.md CHANGED
@@ -105,15 +105,25 @@ nexus scan src --json
105
105
  nexus models --provider deepseek
106
106
  nexus optimize prompt.txt --model gpt-5.4-mini --max-input-tokens 4000
107
107
  nexus eval examples/cli-eval.json
108
+ nexus eval run eval.mjs --out candidate.json --baseline baseline.json --fail-on-regression
109
+ nexus traces list --store runs.jsonl --status error --since 2026-09-20T00:00:00Z
110
+ nexus db sql --adapters operations,traces | psql "$DATABASE_URL"
108
111
  ```
109
112
 
110
113
  CLI commands are intentionally thin wrappers around library modules:
111
114
 
112
115
  - `nexus scan` checks files for secrets, PII, and prompt-injection patterns.
113
116
  - `nexus models` lists the bundled model registry.
114
- - `nexus eval` runs JSON or JS eval cases.
117
+ - `nexus eval` runs JSON or JS eval cases. `nexus eval run`, `compare`, and `gate` run an evaluation
118
+ module to an experiment file and fail a build only on a regression beyond noise.
119
+ - `nexus traces list`, `show`, and `export` read a JSONL trace file, or any trace store a module
120
+ exports — a Postgres store over your own pool, for instance.
121
+ - `nexus db sql` prints the Postgres schema for the adapters you use, for your own migration tooling.
115
122
  - `nexus optimize` previews token optimization for a request or prompt file.
116
123
 
124
+ Every command takes `--json`. A usage mistake exits with 2 and a failed check with 1, so a CI script
125
+ can tell them apart. The newer commands load their code on demand, so `nexus scan` starts no slower.
126
+
117
127
  ## Core Concepts
118
128
 
119
129
  ### Providers and Routing
@@ -642,7 +652,7 @@ const checkpointer = new OperationStoreCheckpointer(new RedisOperationStore(redi
642
652
  ```
643
653
 
644
654
  Writes are compare-and-set on the record's sequence, so two workers advancing the same thread cannot
645
- both win.
655
+ both win. `PostgresOperationStore` works the same way; see [Postgres](#postgres).
646
656
 
647
657
  **Subgraphs.** A compiled graph is a node:
648
658
 
@@ -653,6 +663,37 @@ parent.addNode('research', researchGraph.asNode());
653
663
  Channels shared by name are passed in and merged back; anything the parent does not declare stays
654
664
  private to the subgraph.
655
665
 
666
+ **Input and output channels.** Working channels can stay internal:
667
+
668
+ ```ts
669
+ const research = createGraph({
670
+ channels: { question: lastValue(''), notes: appendList<string>(), answer: lastValue('') },
671
+ input: ['question'],
672
+ output: ['answer'],
673
+ });
674
+ ```
675
+
676
+ `invoke()` accepts only `question` and returns only `answer`, in the types as well as at run time. As
677
+ a subgraph it receives only its inputs from the parent and merges back only its outputs, so a parent
678
+ with its own `notes` channel never sees these. Checkpoints, `state()`, and stream events still carry
679
+ the whole state, because they describe the thread rather than answer the caller.
680
+
681
+ **Caching node results.** An expensive node whose result depends only on what it reads can skip work
682
+ it has already done:
683
+
684
+ ```ts
685
+ graph.addNode('classify', classifyTicket, {
686
+ cache: { ttlMs: 10 * 60_000, key: ({ state }) => `classify:${(state as Ticket).body}` },
687
+ });
688
+ ```
689
+
690
+ The default key hashes the graph name, the node, the state it sees, and its `Send` input — always
691
+ correct, sometimes too specific, which is what `key` is for. Results live in a bounded in-process map
692
+ by default, or in any cache adapter: `compile({ cache: new RedisCacheAdapter(redis) })` shares them
693
+ across workers. A failure, an interrupt, a node that consumed a human's answer, and a command for a
694
+ parent graph are never cached, and a cache that is down is a miss rather than a failed node. The
695
+ caching code loads the first time a caching node runs.
696
+
656
697
  The graph is not in the root import. It costs nothing to a user who does not build graphs.
657
698
 
658
699
  ## Agents
@@ -715,7 +756,8 @@ prefix to search. Items can expire with `ttlMs`, be filtered by field, and be ra
715
756
  any embedding function you inject — the store never imports the embeddings runtime, and without an
716
757
  index a query falls back to matching text. `RedisStore` from `nexus-ai-pro/store/redis` carries the
717
758
  same contract across processes through a client-like interface, so no Redis package is a dependency
718
- here.
759
+ here. `PostgresStore` from `nexus-ai-pro/postgres/store` does the same in Postgres, and ranks in the
760
+ database with pgvector when `vectorDimensions` is set.
719
761
 
720
762
  ## MCP
721
763
 
@@ -723,8 +765,6 @@ The Model Context Protocol, both directions, implemented directly rather than th
723
765
 
724
766
  ```ts
725
767
  import { McpClient, createStdioTransport } from 'nexus-ai-pro/mcp';
726
- import { Tracer, MemoryTraceStore } from 'nexus-ai-pro/tracing';
727
- import { evaluate, createDataset, compareExperiments } from 'nexus-ai-pro/evaluate';
728
768
 
729
769
  const client = new McpClient(createStdioTransport({ command: 'npx', args: ['-y', 'some-mcp-server'] }));
730
770
  const agent = createAgent({ client: ai, tools: await client.toNexusTools({ prefix: 'files' }) });
@@ -753,7 +793,7 @@ inputs, outputs, tokens, cost, and errors, stored where you can search it.
753
793
  import { Tracer, MemoryTraceStore, traceGraph, traceModelClient } from 'nexus-ai-pro/tracing';
754
794
 
755
795
  const tracer = new Tracer({
756
- store: new MemoryTraceStore(), // or JsonlTraceStore({ file })
796
+ store: new MemoryTraceStore(), // or JsonlTraceStore, or PostgresTraceStore
757
797
  sampling: { rate: 0.05, keepErrors: true }, // 5% of traces, plus every failure
758
798
  redaction: { hideFields: ['apiKey', 'user.email'] },
759
799
  });
@@ -786,6 +826,9 @@ console.log(formatTree(tree));
786
826
  await tracer.recordFeedback(runId, { key: 'thumbs', score: 0, source: 'user' });
787
827
  ```
788
828
 
829
+ The same questions from a terminal: `nexus traces list --store runs.jsonl --status error`, then
830
+ `nexus traces show <traceId>` to print the tree.
831
+
789
832
  `compareTraces(a, b)` lays two runs of the same shape side by side and reports what changed — the
790
833
  step that got slower, the tool that stopped being called, the output that differs — which is how
791
834
  "it worked yesterday" becomes an answerable question.
@@ -849,6 +892,12 @@ and `trajectory`, which scores *how* an answer was reached — an agent that get
849
892
  calling the refund tool three times is not working. The LLM judge from `nexus-ai-pro/evals/judge`
850
893
  plugs in as one more evaluator.
851
894
 
895
+ **Cost is read from the output**: `meta.cost` on a completion or an image result, or a `cost` field on
896
+ anything else, and a `cost` option reads whatever a custom target returns. `underCost(0.05)` fails an
897
+ example that overspends, and `totalCost()` sums the experiment, so a quality gain that tripled the
898
+ bill is visible. `signal` cancels an evaluation without ever storing a partial experiment, and
899
+ `repetitions` can be a function when some examples are noisier than others.
900
+
852
901
  ### Was the change real?
853
902
 
854
903
  ```ts
@@ -870,6 +919,21 @@ The report names the examples that moved most, the failures that are new, and th
870
919
  fixed. A comparison across different dataset versions says so rather than pretending it is like for
871
920
  like.
872
921
 
922
+ ### In CI
923
+
924
+ ```bash
925
+ nexus eval run eval.mjs --out candidate.json --baseline baseline.json --fail-on-regression
926
+ ```
927
+
928
+ The module exports `{ target, dataset, evaluators, summary? }`. `nexus eval gate baseline.json
929
+ candidate.json` compares two stored experiments on its own. Either fails only when a metric got worse
930
+ beyond noise, a new failure appeared, or the datasets differ; `--allow-dataset-mismatch` accepts the
931
+ last. `FileExperimentStore` keeps experiments as files a pipeline can cache or commit, and
932
+ `PostgresExperimentStore` keeps them in a table.
933
+
934
+ `EvalRunner` and `MediaEvalRunner` run on `evaluate()` too, and their results carry the experiment
935
+ underneath, so an existing suite can be gated the same way without being rewritten.
936
+
873
937
  ### The runs you did not think of
874
938
 
875
939
  ```ts
@@ -1046,15 +1110,39 @@ probe closes it; a failed probe reopens it and restarts the cooldown. If *every*
1046
1110
  router routes anyway — that usually means a shared dependency is down, and one attempt beats a
1047
1111
  certain failure with no attempt at all.
1048
1112
 
1049
- `isFailure` keeps errors that are not the provider's fault out of the calculation:
1113
+ A request the caller cancelled never counts against the provider. `isFailure` keeps anything else
1114
+ that is not the provider's fault out of the calculation:
1050
1115
 
1051
1116
  ```ts
1052
1117
  circuitBreaker: {
1053
1118
  enabled: true,
1054
- isFailure: (error) => !(error instanceof Error && error.name === 'AbortError'),
1119
+ isFailure: (error) => !(error instanceof NexusProviderError && error.category === 'bad-response'),
1055
1120
  }
1056
1121
  ```
1057
1122
 
1123
+ Probe limits hold on every attempt, retries included: while a probe is in flight, other requests go
1124
+ to the next provider instead of piling onto one that has only just come back.
1125
+
1126
+ **Sharing circuit state across workers.** By default each worker learns on its own. Give the breaker
1127
+ a store and a provider that fails in one worker is taken out of routing in all of them, and when the
1128
+ cooldown ends only one worker probes it:
1129
+
1130
+ ```ts
1131
+ import { RedisCircuitStateStore } from 'nexus-ai-pro/ops/circuit-store';
1132
+
1133
+ const ai = new NexusAI({
1134
+ providers,
1135
+ circuitBreaker: { enabled: true, store: new RedisCircuitStateStore(redis), workerId: process.env.HOSTNAME },
1136
+ });
1137
+ await ai.syncCircuitBreaker(); // optional: learn what is open elsewhere before the first request
1138
+ ```
1139
+
1140
+ Only decisions are shared — open, closed, and who may probe. Each worker still counts its own
1141
+ failures, and every check stays synchronous: shared state is refreshed in the background at most once
1142
+ a second, so the breaker never puts a network call in front of a request. If the store is
1143
+ unreachable, each worker decides for itself rather than holding circuits open. `PostgresCircuitStateStore`
1144
+ does the same in Postgres, and the coordination code loads only when a store is configured.
1145
+
1058
1146
  **Distributed rate limiting.** The built-in limiter is process-local, which multiplies the real
1059
1147
  limit by the number of workers. Pointing it at a shared store fixes that, and the same budget then
1060
1148
  covers completions and embeddings alike:
@@ -1187,6 +1275,53 @@ queues the operation id and nothing else.
1187
1275
 
1188
1276
  The image family already runs on this lifecycle, so `ai.images.submit()` reports the same events.
1189
1277
 
1278
+ ## Postgres
1279
+
1280
+ One adapter family for everything that has to outlive a process or be shared between workers, over
1281
+ the Postgres client you already have:
1282
+
1283
+ ```ts
1284
+ import pg from 'pg';
1285
+ import { PostgresOperationStore, PostgresStore, PostgresTraceStore } from 'nexus-ai-pro/postgres';
1286
+
1287
+ const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
1288
+ const operations = new PostgresOperationStore(pool);
1289
+ await operations.migrate(); // or: nexus db sql | psql "$DATABASE_URL"
1290
+ ```
1291
+
1292
+ | Adapter | Subpath | Serves |
1293
+ | --- | --- | --- |
1294
+ | `PostgresOperationStore` | `/postgres/operations` | durable operations, and graph checkpoints through `OperationStoreCheckpointer` |
1295
+ | `PostgresStore` | `/postgres/store` | long-term memory, ranked by pgvector when `vectorDimensions` is set |
1296
+ | `PostgresTraceStore` | `/postgres/traces` | traces, with every query filter in SQL |
1297
+ | `PostgresDatasetStore`, `PostgresExperimentStore` | `/postgres/evaluate` | datasets and experiments |
1298
+ | `PostgresCircuitStateStore` | `/postgres/circuits` | circuit state shared between workers |
1299
+
1300
+ **No driver is a dependency.** Each adapter takes anything with a `query(text, values)` method that
1301
+ resolves to `{ rows }`: `pg`'s `Pool` and `Client`, `@neondatabase/serverless`, PGlite.
1302
+ `fromPostgresJs(sql)` adapts `postgres.js`. Parameters are only ever strings, numbers, and `null`,
1303
+ cast in SQL, so a driver's own conversion of arrays or dates never changes what is stored.
1304
+
1305
+ **Nothing creates a schema at import.** `migrate()` applies an adapter's schema when you call it;
1306
+ `postgresMigration()` and `nexus db sql` produce the same SQL for the migration tooling you already
1307
+ use. Table names are options, schema-qualified if you like.
1308
+
1309
+ **What Postgres adds over the other stores.** An operation update is one `UPDATE … WHERE sequence =
1310
+ expected`, atomic without a transaction. Idempotency keys are unique in the table, so when two
1311
+ workers race to submit the same key the loser attaches to the winner's operation instead of running
1312
+ the work twice. Trace feedback is appended in one statement, so two evaluators scoring one run at once
1313
+ both land.
1314
+
1315
+ A graph thread started on one worker and finished on another is the same code as before, pointed at a
1316
+ different store:
1317
+
1318
+ ```ts
1319
+ const graph = builder.compile({ checkpointer: new OperationStoreCheckpointer(new PostgresOperationStore(pool)) });
1320
+ ```
1321
+
1322
+ The adapters are tested on every run against a real Postgres engine — PGlite, PostgreSQL compiled to
1323
+ WebAssembly — with the same contract tests the in-memory stores pass.
1324
+
1190
1325
  ## Embeddings
1191
1326
 
1192
1327
  `ai.embed()` is a first-class operation, not a helper: it gets the same routing, caching, batching,
@@ -2153,80 +2288,88 @@ only, so it never appears in an import graph.
2153
2288
  <!-- size-table:start -->
2154
2289
  | Import | Size | Share of root | Third-party install |
2155
2290
  | --- | --- | --- | --- |
2156
- | `nexus-ai-pro` | 612 KB | 100% | +4.7 MB |
2157
- | `nexus-ai-pro/config` | 468 KB | 76% | +4.7 MB |
2158
- | `nexus-ai-pro/core` | 462 KB | 75% | +4.7 MB |
2159
- | `nexus-ai-pro/realtime` | 157 KB | 26% | none |
2160
- | `nexus-ai-pro/batch` | 118 KB | 19% | none |
2161
- | `nexus-ai-pro/realtime/session` | 94 KB | 15% | none |
2162
- | `nexus-ai-pro/embeddings` | 91 KB | 15% | none |
2163
- | `nexus-ai-pro/providers/groq` | 79 KB | 13% | none |
2164
- | `nexus-ai-pro/providers/mistral` | 79 KB | 13% | none |
2165
- | `nexus-ai-pro/providers/azure-openai` | 78 KB | 13% | none |
2166
- | `nexus-ai-pro/providers/openrouter` | 78 KB | 13% | none |
2167
- | `nexus-ai-pro/providers/deepseek` | 77 KB | 13% | none |
2168
- | `nexus-ai-pro/providers/llamacpp` | 77 KB | 13% | none |
2169
- | `nexus-ai-pro/providers/lmstudio` | 77 KB | 13% | none |
2170
- | `nexus-ai-pro/providers/openai` | 77 KB | 13% | none |
2171
- | `nexus-ai-pro/agent` | 76 KB | 12% | none |
2172
- | `nexus-ai-pro/providers/anthropic` | 70 KB | 11% | none |
2173
- | `nexus-ai-pro/providers/google` | 66 KB | 11% | none |
2174
- | `nexus-ai-pro/images` | 65 KB | 11% | none |
2175
- | `nexus-ai-pro/graph` | 60 KB | 10% | none |
2176
- | `nexus-ai-pro/providers/ollama` | 58 KB | 9% | none |
2177
- | `nexus-ai-pro/batch/openai` | 52 KB | 8% | none |
2178
- | `nexus-ai-pro/batch/anthropic` | 52 KB | 8% | none |
2179
- | `nexus-ai-pro/operations` | 49 KB | 8% | none |
2180
- | `nexus-ai-pro/batch/mock` | 47 KB | 8% | none |
2181
- | `nexus-ai-pro/providers/cohere` | 46 KB | 8% | none |
2291
+ | `nexus-ai-pro` | 572 KB | 100% | +4.7 MB |
2292
+ | `nexus-ai-pro/config` | 441 KB | 77% | +4.7 MB |
2293
+ | `nexus-ai-pro/core` | 437 KB | 76% | +4.7 MB |
2294
+ | `nexus-ai-pro/realtime` | 156 KB | 27% | none |
2295
+ | `nexus-ai-pro/batch` | 101 KB | 18% | none |
2296
+ | `nexus-ai-pro/realtime/session` | 94 KB | 16% | none |
2297
+ | `nexus-ai-pro/embeddings` | 81 KB | 14% | none |
2298
+ | `nexus-ai-pro/providers/groq` | 72 KB | 13% | none |
2299
+ | `nexus-ai-pro/providers/mistral` | 72 KB | 13% | none |
2300
+ | `nexus-ai-pro/providers/azure-openai` | 71 KB | 12% | none |
2301
+ | `nexus-ai-pro/providers/openrouter` | 71 KB | 12% | none |
2302
+ | `nexus-ai-pro/providers/deepseek` | 70 KB | 12% | none |
2303
+ | `nexus-ai-pro/providers/llamacpp` | 70 KB | 12% | none |
2304
+ | `nexus-ai-pro/providers/lmstudio` | 70 KB | 12% | none |
2305
+ | `nexus-ai-pro/providers/openai` | 70 KB | 12% | none |
2306
+ | `nexus-ai-pro/agent` | 63 KB | 11% | none |
2307
+ | `nexus-ai-pro/providers/anthropic` | 62 KB | 11% | none |
2308
+ | `nexus-ai-pro/providers/google` | 59 KB | 10% | none |
2309
+ | `nexus-ai-pro/images` | 59 KB | 10% | none |
2310
+ | `nexus-ai-pro/providers/ollama` | 53 KB | 9% | none |
2311
+ | `nexus-ai-pro/graph` | 49 KB | 9% | none |
2312
+ | `nexus-ai-pro/batch/openai` | 46 KB | 8% | none |
2313
+ | `nexus-ai-pro/batch/anthropic` | 46 KB | 8% | none |
2182
2314
  | `nexus-ai-pro/realtime/openai-webrtc` | 46 KB | 8% | none |
2183
- | `nexus-ai-pro/security` | 40 KB | 7% | +3.4 MB |
2184
- | `nexus-ai-pro/models` | 35 KB | 6% | none |
2185
- | `nexus-ai-pro/evaluate` | 33 KB | 5% | none |
2186
- | `nexus-ai-pro/images/inputs` | 31 KB | 5% | none |
2187
- | `nexus-ai-pro/realtime/openai-websocket` | 29 KB | 5% | none |
2188
- | `nexus-ai-pro/tracing` | 26 KB | 4% | none |
2189
- | `nexus-ai-pro/evals` | 23 KB | 4% | none |
2190
- | `nexus-ai-pro/images/transform` | 22 KB | 4% | none |
2191
- | `nexus-ai-pro/images/stores` | 22 KB | 4% | none |
2192
- | `nexus-ai-pro/telephony/twilio` | 21 KB | 3% | none |
2193
- | `nexus-ai-pro/telephony` | 20 KB | 3% | none |
2315
+ | `nexus-ai-pro/providers/cohere` | 44 KB | 8% | none |
2316
+ | `nexus-ai-pro/batch/mock` | 41 KB | 7% | none |
2317
+ | `nexus-ai-pro/operations` | 40 KB | 7% | none |
2318
+ | `nexus-ai-pro/security` | 39 KB | 7% | +3.4 MB |
2319
+ | `nexus-ai-pro/postgres` | 36 KB | 6% | none |
2320
+ | `nexus-ai-pro/models` | 32 KB | 6% | none |
2321
+ | `nexus-ai-pro/evaluate` | 31 KB | 5% | none |
2322
+ | `nexus-ai-pro/realtime/openai-websocket` | 28 KB | 5% | none |
2323
+ | `nexus-ai-pro/images/inputs` | 27 KB | 5% | none |
2324
+ | `nexus-ai-pro/evals` | 25 KB | 4% | none |
2325
+ | `nexus-ai-pro/tracing` | 23 KB | 4% | none |
2326
+ | `nexus-ai-pro/images/stores` | 21 KB | 4% | none |
2327
+ | `nexus-ai-pro/telephony/twilio` | 21 KB | 4% | none |
2328
+ | `nexus-ai-pro/images/transform` | 20 KB | 3% | none |
2194
2329
  | `nexus-ai-pro/images/openai` | 19 KB | 3% | none |
2195
- | `nexus-ai-pro/realtime/mock` | 19 KB | 3% | none |
2196
2330
  | `nexus-ai-pro/voice` | 18 KB | 3% | none |
2197
- | `nexus-ai-pro/mcp` | 18 KB | 3% | none |
2198
- | `nexus-ai-pro/images/comfyui` | 17 KB | 3% | none |
2199
- | `nexus-ai-pro/embeddings/adapters` | 17 KB | 3% | none |
2331
+ | `nexus-ai-pro/realtime/mock` | 18 KB | 3% | none |
2332
+ | `nexus-ai-pro/telephony` | 18 KB | 3% | none |
2333
+ | `nexus-ai-pro/images/evals` | 17 KB | 3% | none |
2334
+ | `nexus-ai-pro/images/comfyui` | 16 KB | 3% | none |
2335
+ | `nexus-ai-pro/embeddings/adapters` | 16 KB | 3% | none |
2200
2336
  | `nexus-ai-pro/realtime/conversation` | 16 KB | 3% | none |
2201
- | `nexus-ai-pro/images/google` | 15 KB | 2% | none |
2202
- | `nexus-ai-pro/images/evals` | 15 KB | 2% | none |
2203
2337
  | `nexus-ai-pro/images/assets` | 14 KB | 2% | none |
2338
+ | `nexus-ai-pro/images/google` | 14 KB | 2% | none |
2339
+ | `nexus-ai-pro/mcp` | 14 KB | 2% | none |
2204
2340
  | `nexus-ai-pro/context` | 13 KB | 2% | none |
2205
- | `nexus-ai-pro/operations/adapters` | 13 KB | 2% | none |
2206
2341
  | `nexus-ai-pro/realtime/tools` | 13 KB | 2% | none |
2207
2342
  | `nexus-ai-pro/workflows` | 13 KB | 2% | none |
2208
- | `nexus-ai-pro/images/mock` | 12 KB | 2% | none |
2209
2343
  | `nexus-ai-pro/optimizer` | 11 KB | 2% | none |
2210
2344
  | `nexus-ai-pro/voice/session` | 11 KB | 2% | none |
2211
- | `nexus-ai-pro/store/redis` | 11 KB | 2% | none |
2345
+ | `nexus-ai-pro/images/mock` | 11 KB | 2% | none |
2346
+ | `nexus-ai-pro/postgres/operations` | 11 KB | 2% | none |
2347
+ | `nexus-ai-pro/postgres/store` | 11 KB | 2% | none |
2212
2348
  | `nexus-ai-pro/providers` | 10 KB | 2% | none |
2213
2349
  | `nexus-ai-pro/providers/base` | 10 KB | 2% | none |
2214
- | `nexus-ai-pro/embeddings/models` | 10 KB | 2% | none |
2215
- | `nexus-ai-pro/voice/openai` | 9 KB | 1% | none |
2216
- | `nexus-ai-pro/images/moderation` | 9 KB | 1% | none |
2217
- | `nexus-ai-pro/ops/circuit-breaker` | 8 KB | 1% | none |
2350
+ | `nexus-ai-pro/postgres/traces` | 10 KB | 2% | none |
2351
+ | `nexus-ai-pro/voice/openai` | 9 KB | 2% | none |
2352
+ | `nexus-ai-pro/images/moderation` | 9 KB | 2% | none |
2353
+ | `nexus-ai-pro/operations/adapters` | 9 KB | 2% | none |
2354
+ | `nexus-ai-pro/testing/record` | 9 KB | 2% | none |
2355
+ | `nexus-ai-pro/ops/circuit-breaker` | 9 KB | 2% | none |
2356
+ | `nexus-ai-pro/embeddings/models` | 8 KB | 1% | none |
2218
2357
  | `nexus-ai-pro/realtime/openai-server` | 8 KB | 1% | none |
2219
2358
  | `nexus-ai-pro/capabilities` | 8 KB | 1% | none |
2220
- | `nexus-ai-pro/telephony/realtime-bridge` | 7 KB | 1% | none |
2221
- | `nexus-ai-pro/graph/visualize` | 6 KB | 1.0% | none |
2222
- | `nexus-ai-pro/store` | 6 KB | 1.0% | none |
2223
- | `nexus-ai-pro/providers/errors` | 5 KB | 0.8% | none |
2224
- | `nexus-ai-pro/embeddings/mock` | 5 KB | 0.8% | none |
2225
- | `nexus-ai-pro/cache/semantic-cache` | 5 KB | 0.8% | none |
2226
- | `nexus-ai-pro/evals/judge` | 5 KB | 0.8% | none |
2227
- | `nexus-ai-pro/operations/webhooks` | 4 KB | 0.7% | none |
2228
- | `nexus-ai-pro/ops/rate-limit-adapters` | 3 KB | 0.5% | none |
2359
+ | `nexus-ai-pro/store` | 6 KB | 1% | none |
2360
+ | `nexus-ai-pro/store/redis` | 6 KB | 1% | none |
2361
+ | `nexus-ai-pro/telephony/realtime-bridge` | 6 KB | 1% | none |
2362
+ | `nexus-ai-pro/providers/errors` | 5 KB | 0.9% | none |
2363
+ | `nexus-ai-pro/postgres/evaluate` | 5 KB | 0.9% | none |
2364
+ | `nexus-ai-pro/cache/semantic-cache` | 5 KB | 0.9% | none |
2365
+ | `nexus-ai-pro/evals/judge` | 5 KB | 0.9% | none |
2366
+ | `nexus-ai-pro/embeddings/mock` | 4 KB | 0.7% | none |
2367
+ | `nexus-ai-pro/operations/webhooks` | 3 KB | 0.5% | none |
2368
+ | `nexus-ai-pro/graph/visualize` | 3 KB | 0.5% | none |
2369
+ | `nexus-ai-pro/postgres/circuits` | 3 KB | 0.5% | none |
2370
+ | `nexus-ai-pro/ops/circuit-store` | 3 KB | 0.5% | none |
2229
2371
  | `nexus-ai-pro/cache/memory-cache` | 3 KB | 0.5% | none |
2372
+ | `nexus-ai-pro/ops/rate-limit-adapters` | 2 KB | 0.3% | none |
2230
2373
  | `nexus-ai-pro/cache` | 2 KB | 0.3% | none |
2231
2374
  | `nexus-ai-pro/cache/adapters` | 2 KB | 0.3% | none |
2232
2375
  | `nexus-ai-pro/rag` | 2 KB | 0.3% | none |
@@ -2281,12 +2424,40 @@ npm run check:release
2281
2424
  conformance tests, coverage thresholds, package import checks, and an external type-consumer test.
2282
2425
  `check:release` additionally verifies the dry-run tarball and a clean packed-package install.
2283
2426
 
2427
+ `npm run docs:check` fails when any public export, or any public member of an exported class,
2428
+ interface, or enum, has no doc comment. Every entry point is kept at 100%; `--list` names what is
2429
+ missing.
2430
+
2284
2431
  Real provider conformance is opt-in:
2285
2432
 
2286
2433
  ```bash
2287
2434
  npm run test:conformance:real
2288
2435
  ```
2289
2436
 
2437
+ ### Recorded provider traffic
2438
+
2439
+ A suite that needs credentials can run everywhere else from recordings:
2440
+
2441
+ ```ts
2442
+ import { fixtureFetch } from 'nexus-ai-pro/testing/record';
2443
+
2444
+ // Replays by default; NEXUS_FIXTURES=record captures, NEXUS_FIXTURES=live bypasses.
2445
+ const fetch = fixtureFetch({ directory: 'tests/fixtures/openai' });
2446
+ const provider = new OpenAIImageProvider({ apiKey: process.env.OPENAI_API_KEY ?? 'replay', fetch });
2447
+ ```
2448
+
2449
+ Recording writes one reviewable JSON file per exchange. Credential headers and query parameters are
2450
+ removed before anything is written, and a `redact` hook handles the rest — personal data in a prompt,
2451
+ through a PII detector from `nexus-ai-pro/security`, for instance. Replay serves the files back with
2452
+ no network, matches requests by method, URL, and body with object keys sorted and multipart
2453
+ boundaries ignored, and throws `FixtureMissingError` for anything unrecorded instead of reaching the
2454
+ live API. `installFetch()` covers code that calls the global `fetch`.
2455
+
2456
+ ```bash
2457
+ npm run test:conformance:images # replays image recordings; needs no credentials
2458
+ npm run conformance:images:record # records them; needs OPENAI_API_KEY, GOOGLE_API_KEY, or COMFYUI_URL
2459
+ ```
2460
+
2290
2461
  ## Roadmap
2291
2462
 
2292
2463
  See [ROADMAP.md](https://github.com/mkhitar-abrahamyan/nexus-ai/blob/main/ROADMAP.md) for what has
@@ -2296,13 +2467,15 @@ live in [API_STABILITY.md](./API_STABILITY.md).
2296
2467
  Shipped so far:
2297
2468
 
2298
2469
  - completion controls and capability negotiation;
2299
- - durable operations, provider batch tiers, and distributed resilience;
2300
- - first-class embeddings and graphs;
2470
+ - durable operations, provider batch tiers, and distributed resilience, now including shared circuit
2471
+ state and a Postgres adapter family;
2472
+ - embeddings, graphs, long-term memory, agents on graphs, and MCP;
2473
+ - queryable traces, an evaluation platform, and a CI gate on top of it;
2474
+ - record and replay of provider traffic;
2301
2475
  - per-entry-point size budgets.
2302
2476
 
2303
- The current work is image portability: three backends behind one contract, masked edits, validated
2304
- inputs, visual moderation, and media evaluation. Promotion out of experimental waits on live
2305
- conformance.
2477
+ Next is prompt and configuration versioning. The image family leaves experimental once recorded live
2478
+ conformance passes on all three backends.
2306
2479
 
2307
2480
  ## Known Limitations
2308
2481
 
@@ -2317,8 +2490,10 @@ conformance.
2317
2490
  - NLI verification is an interface; bring a specialized verifier for high-confidence entailment.
2318
2491
  - Guardrails reduce risk but do not replace application authorization, provider-side moderation, or
2319
2492
  human review of high-impact actions.
2320
- - Circuit-breaker state is per process, and realtime sessions are not yet routed through the metrics,
2321
- audit, and rate-limit path that every other family uses.
2493
+ - Realtime sessions are not yet routed through the metrics, audit, and rate-limit path that every
2494
+ other family uses.
2495
+ - The image adapters are verified against documented wire shapes; recorded live conformance for all
2496
+ three backends is still to come, which is why the family is experimental.
2322
2497
 
2323
2498
  ## Production Notes
2324
2499