nexus-ai-pro 1.15.0 → 1.17.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 (707) hide show
  1. package/API_STABILITY.md +61 -7
  2. package/CHANGELOG.md +146 -1
  3. package/README.md +50 -2153
  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 +4 -4
  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 +23 -0
  187. package/dist/postgres/index.js +27 -0
  188. package/dist/postgres/operations.d.ts +59 -0
  189. package/dist/postgres/operations.js +113 -0
  190. package/dist/postgres/prompts.d.ts +50 -0
  191. package/dist/postgres/prompts.js +102 -0
  192. package/dist/postgres/sql.d.ts +23 -0
  193. package/dist/postgres/sql.js +29 -0
  194. package/dist/postgres/store.d.ts +55 -0
  195. package/dist/postgres/store.js +144 -0
  196. package/dist/postgres/traces.d.ts +37 -0
  197. package/dist/postgres/traces.js +117 -0
  198. package/dist/prompts/client.d.ts +79 -0
  199. package/dist/prompts/client.js +133 -0
  200. package/dist/prompts/diff.d.ts +53 -0
  201. package/dist/prompts/diff.js +108 -0
  202. package/dist/prompts/errors.d.ts +73 -0
  203. package/dist/prompts/errors.js +59 -0
  204. package/dist/prompts/evaluate.d.ts +26 -0
  205. package/dist/prompts/evaluate.js +22 -0
  206. package/dist/prompts/file.d.ts +45 -0
  207. package/dist/prompts/file.js +117 -0
  208. package/dist/prompts/gates.d.ts +38 -0
  209. package/dist/prompts/gates.js +65 -0
  210. package/dist/prompts/index.d.ts +12 -0
  211. package/dist/prompts/index.js +4 -0
  212. package/dist/prompts/memory.d.ts +44 -0
  213. package/dist/prompts/memory.js +62 -0
  214. package/dist/prompts/redis.d.ts +78 -0
  215. package/dist/prompts/redis.js +96 -0
  216. package/dist/prompts/registry-entry.d.ts +13 -0
  217. package/dist/prompts/registry-entry.js +6 -0
  218. package/dist/prompts/registry.d.ts +168 -0
  219. package/dist/prompts/registry.js +231 -0
  220. package/dist/prompts/template.d.ts +112 -0
  221. package/dist/prompts/template.js +149 -0
  222. package/dist/prompts/variant.d.ts +7 -0
  223. package/dist/prompts/variant.js +22 -0
  224. package/dist/prompts/version.d.ts +15 -0
  225. package/dist/prompts/version.js +24 -0
  226. package/dist/prompts/webhooks.d.ts +11 -0
  227. package/dist/prompts/webhooks.js +24 -0
  228. package/dist/providers/anthropic.d.ts +4 -0
  229. package/dist/providers/anthropic.js +0 -31
  230. package/dist/providers/azure-openai.js +0 -3
  231. package/dist/providers/base.d.ts +10 -0
  232. package/dist/providers/base.js +0 -1
  233. package/dist/providers/cohere.d.ts +5 -0
  234. package/dist/providers/deepseek.js +0 -3
  235. package/dist/providers/errors.d.ts +33 -0
  236. package/dist/providers/google.d.ts +4 -0
  237. package/dist/providers/google.js +0 -14
  238. package/dist/providers/groq.d.ts +4 -0
  239. package/dist/providers/llamacpp.js +0 -3
  240. package/dist/providers/lmstudio.js +0 -3
  241. package/dist/providers/mistral.d.ts +4 -0
  242. package/dist/providers/ollama.d.ts +4 -0
  243. package/dist/providers/ollama.js +0 -1
  244. package/dist/providers/openai.d.ts +4 -0
  245. package/dist/providers/openai.js +0 -23
  246. package/dist/providers/openrouter.d.ts +4 -0
  247. package/dist/providers/type-guards.d.ts +8 -0
  248. package/dist/rag/file-ingestion.d.ts +15 -0
  249. package/dist/rag/ingestion.d.ts +15 -0
  250. package/dist/realtime/conversation.d.ts +21 -0
  251. package/dist/realtime/errors.d.ts +25 -0
  252. package/dist/realtime/events.d.ts +7 -0
  253. package/dist/realtime/id.d.ts +5 -0
  254. package/dist/realtime/mock.transport.d.ts +27 -0
  255. package/dist/realtime/mock.transport.js +0 -4
  256. package/dist/realtime/openai-events.d.ts +3 -0
  257. package/dist/realtime/openai-server.d.ts +30 -0
  258. package/dist/realtime/openai-webrtc.transport.d.ts +108 -0
  259. package/dist/realtime/openai-webrtc.transport.js +0 -7
  260. package/dist/realtime/openai-websocket.transport.d.ts +46 -0
  261. package/dist/realtime/openai-websocket.transport.js +0 -2
  262. package/dist/realtime/provider.d.ts +30 -0
  263. package/dist/realtime/session.d.ts +44 -0
  264. package/dist/realtime/session.js +0 -3
  265. package/dist/realtime/tools.d.ts +25 -0
  266. package/dist/realtime/transport-utils.js +0 -1
  267. package/dist/realtime/types.d.ts +394 -0
  268. package/dist/router/auto-router.d.ts +5 -0
  269. package/dist/router/auto-router.js +3 -10
  270. package/dist/router/failover.d.ts +15 -0
  271. package/dist/router/failover.js +34 -13
  272. package/dist/router/index.d.ts +7 -1
  273. package/dist/router/index.js +40 -0
  274. package/dist/router/types.d.ts +27 -4
  275. package/dist/security/index.d.ts +17 -0
  276. package/dist/security/index.js +0 -1
  277. package/dist/security/injection-calibration.d.ts +17 -0
  278. package/dist/security/injection-detector.d.ts +3 -0
  279. package/dist/security/input-guard.d.ts +2 -0
  280. package/dist/security/output-guard.d.ts +2 -0
  281. package/dist/security/output-guard.js +0 -10
  282. package/dist/security/pii-detector.d.ts +3 -0
  283. package/dist/security/policies.d.ts +3 -0
  284. package/dist/security/prompt-hardening.d.ts +4 -0
  285. package/dist/security/schema-validator.d.ts +2 -0
  286. package/dist/security/semantic-injection-classifier.d.ts +6 -0
  287. package/dist/security/upload-scanner.d.ts +28 -0
  288. package/dist/store/helpers.d.ts +8 -0
  289. package/dist/store/helpers.js +53 -0
  290. package/dist/store/memory.d.ts +11 -6
  291. package/dist/store/memory.js +2 -64
  292. package/dist/store/redis.d.ts +17 -0
  293. package/dist/store/redis.js +1 -10
  294. package/dist/telephony/errors.d.ts +9 -1
  295. package/dist/telephony/manager.d.ts +17 -0
  296. package/dist/telephony/providers/twilio.d.ts +25 -0
  297. package/dist/telephony/providers/twilio.js +0 -3
  298. package/dist/telephony/realtime-bridge.d.ts +11 -0
  299. package/dist/telephony/realtime-bridge.js +0 -19
  300. package/dist/telephony/twiml.d.ts +3 -0
  301. package/dist/testing/embedding-provider-conformance.d.ts +17 -0
  302. package/dist/testing/embedding-provider-conformance.js +0 -7
  303. package/dist/testing/image-provider-conformance.d.ts +29 -0
  304. package/dist/testing/image-provider-conformance.js +0 -1
  305. package/dist/testing/provider-conformance.d.ts +24 -0
  306. package/dist/testing/record.d.ts +141 -0
  307. package/dist/testing/record.js +211 -0
  308. package/dist/tracing/alerts.d.ts +19 -0
  309. package/dist/tracing/alerts.js +0 -9
  310. package/dist/tracing/compare.d.ts +10 -0
  311. package/dist/tracing/compare.js +0 -10
  312. package/dist/tracing/instrument.d.ts +9 -0
  313. package/dist/tracing/instrument.js +1 -16
  314. package/dist/tracing/query.d.ts +6 -0
  315. package/dist/tracing/query.js +60 -0
  316. package/dist/tracing/stores.d.ts +22 -3
  317. package/dist/tracing/stores.js +2 -77
  318. package/dist/tracing/tracer.d.ts +29 -0
  319. package/dist/tracing/tracer.js +0 -13
  320. package/dist/types/agent.d.ts +31 -0
  321. package/dist/types/batch.d.ts +55 -0
  322. package/dist/types/capabilities.d.ts +9 -0
  323. package/dist/types/config.d.ts +197 -0
  324. package/dist/types/context-window.d.ts +62 -0
  325. package/dist/types/embeddings.d.ts +97 -0
  326. package/dist/types/evaluate.d.ts +55 -0
  327. package/dist/types/evaluate.js +0 -9
  328. package/dist/types/graph.d.ts +137 -3
  329. package/dist/types/graph.js +0 -30
  330. package/dist/types/images.d.ts +178 -0
  331. package/dist/types/messages.d.ts +92 -2
  332. package/dist/types/operations.d.ts +84 -0
  333. package/dist/types/operations.js +0 -8
  334. package/dist/types/optimizer.d.ts +31 -0
  335. package/dist/types/planning.d.ts +29 -0
  336. package/dist/types/prompts.d.ts +182 -0
  337. package/dist/types/prompts.js +1 -0
  338. package/dist/types/providers.d.ts +49 -0
  339. package/dist/types/providers.js +0 -40
  340. package/dist/types/response.d.ts +55 -0
  341. package/dist/types/security.d.ts +35 -0
  342. package/dist/types/store.d.ts +17 -0
  343. package/dist/types/store.js +0 -8
  344. package/dist/types/telephony.d.ts +216 -0
  345. package/dist/types/tracing.d.ts +53 -0
  346. package/dist/types/tracing.js +0 -9
  347. package/dist/types/voice.d.ts +172 -2
  348. package/dist/utils/safe-fetch.js +8 -38
  349. package/dist/utils/tokenizer.d.ts +7 -0
  350. package/dist/voice/errors.d.ts +9 -1
  351. package/dist/voice/manager.d.ts +16 -0
  352. package/dist/voice/providers/openai.d.ts +13 -0
  353. package/dist/voice/session.d.ts +16 -0
  354. package/dist/workflow/chains.d.ts +53 -0
  355. package/dist/workflow/domain.d.ts +28 -0
  356. package/dist-cjs/agent/create-agent.d.ts +35 -0
  357. package/dist-cjs/agent/create-agent.js +0 -19
  358. package/dist-cjs/agent/loop.d.ts +7 -0
  359. package/dist-cjs/agent/loop.js +0 -3
  360. package/dist-cjs/agent/middleware.d.ts +2 -0
  361. package/dist-cjs/agent/middleware.js +0 -19
  362. package/dist-cjs/agent/tool.d.ts +6 -0
  363. package/dist-cjs/batch/anthropic.d.ts +14 -0
  364. package/dist-cjs/batch/anthropic.js +0 -14
  365. package/dist-cjs/batch/errors.d.ts +23 -3
  366. package/dist-cjs/batch/manager.d.ts +8 -0
  367. package/dist-cjs/batch/manager.js +0 -37
  368. package/dist-cjs/batch/mock.d.ts +9 -0
  369. package/dist-cjs/batch/mock.js +0 -8
  370. package/dist-cjs/batch/openai.d.ts +11 -0
  371. package/dist-cjs/batch/openai.js +0 -8
  372. package/dist-cjs/cache/adapters.d.ts +31 -0
  373. package/dist-cjs/cache/memory-cache.d.ts +14 -0
  374. package/dist-cjs/cache/semantic-cache.d.ts +15 -0
  375. package/dist-cjs/capabilities/negotiate.d.ts +9 -0
  376. package/dist-cjs/capabilities/negotiate.js +0 -14
  377. package/dist-cjs/cli/args.d.ts +26 -0
  378. package/dist-cjs/cli/args.js +145 -0
  379. package/dist-cjs/cli/db.d.ts +8 -0
  380. package/dist-cjs/cli/db.js +20 -0
  381. package/dist-cjs/cli/evaluation.d.ts +8 -0
  382. package/dist-cjs/cli/evaluation.js +148 -0
  383. package/dist-cjs/cli/traces.d.ts +8 -0
  384. package/dist-cjs/cli/traces.js +95 -0
  385. package/dist-cjs/connectors/web.d.ts +9 -0
  386. package/dist-cjs/context/window.d.ts +8 -0
  387. package/dist-cjs/core/config-builder.js +0 -47
  388. package/dist-cjs/core/create-nexus.d.ts +13 -0
  389. package/dist-cjs/core/create-nexus.js +0 -18
  390. package/dist-cjs/core/nexus.d.ts +26 -0
  391. package/dist-cjs/core/nexus.js +17 -170
  392. package/dist-cjs/core/response-format.d.ts +1 -0
  393. package/dist-cjs/core/secure-stream.js +0 -6
  394. package/dist-cjs/core/streaming.d.ts +3 -0
  395. package/dist-cjs/core/usage.d.ts +14 -0
  396. package/dist-cjs/core/usage.js +0 -20
  397. package/dist-cjs/embeddings/adapters.d.ts +12 -0
  398. package/dist-cjs/embeddings/adapters.js +0 -17
  399. package/dist-cjs/embeddings/errors.d.ts +33 -4
  400. package/dist-cjs/embeddings/errors.js +0 -7
  401. package/dist-cjs/embeddings/manager.d.ts +3 -0
  402. package/dist-cjs/embeddings/manager.js +0 -51
  403. package/dist-cjs/embeddings/mock.d.ts +7 -0
  404. package/dist-cjs/embeddings/mock.js +0 -10
  405. package/dist-cjs/embeddings/models.d.ts +15 -0
  406. package/dist-cjs/embeddings/models.js +0 -44
  407. package/dist-cjs/embeddings/providers.d.ts +26 -0
  408. package/dist-cjs/embeddings/providers.js +0 -7
  409. package/dist-cjs/embeddings/register.js +0 -7
  410. package/dist-cjs/evals/index.d.ts +1 -1
  411. package/dist-cjs/evals/judge.d.ts +47 -0
  412. package/dist-cjs/evals/metrics.d.ts +89 -0
  413. package/dist-cjs/evals/runner.d.ts +72 -1
  414. package/dist-cjs/evals/runner.js +117 -32
  415. package/dist-cjs/evaluate/compare.d.ts +22 -0
  416. package/dist-cjs/evaluate/compare.js +0 -13
  417. package/dist-cjs/evaluate/datasets.d.ts +45 -1
  418. package/dist-cjs/evaluate/datasets.js +49 -35
  419. package/dist-cjs/evaluate/evaluators.d.ts +11 -0
  420. package/dist-cjs/evaluate/evaluators.js +8 -29
  421. package/dist-cjs/evaluate/index.d.ts +2 -2
  422. package/dist-cjs/evaluate/index.js +4 -1
  423. package/dist-cjs/evaluate/review.d.ts +35 -0
  424. package/dist-cjs/evaluate/review.js +0 -24
  425. package/dist-cjs/evaluate/run.d.ts +23 -2
  426. package/dist-cjs/evaluate/run.js +40 -19
  427. package/dist-cjs/evaluate/version.d.ts +8 -0
  428. package/dist-cjs/evaluate/version.js +11 -0
  429. package/dist-cjs/graph/channels.js +0 -12
  430. package/dist-cjs/graph/checkpointer.d.ts +13 -0
  431. package/dist-cjs/graph/checkpointer.js +0 -29
  432. package/dist-cjs/graph/errors.d.ts +60 -7
  433. package/dist-cjs/graph/errors.js +1 -29
  434. package/dist-cjs/graph/graph.d.ts +53 -12
  435. package/dist-cjs/graph/graph.js +116 -158
  436. package/dist-cjs/graph/index.d.ts +1 -1
  437. package/dist-cjs/graph/node-cache.d.ts +16 -0
  438. package/dist-cjs/graph/node-cache.js +111 -0
  439. package/dist-cjs/graph/visualize.d.ts +1 -0
  440. package/dist-cjs/graph/visualize.js +0 -14
  441. package/dist-cjs/hallucination/consistency.d.ts +14 -0
  442. package/dist-cjs/hallucination/factual.d.ts +11 -0
  443. package/dist-cjs/hallucination/knowledge-graph.d.ts +35 -0
  444. package/dist-cjs/hallucination/rag.d.ts +21 -0
  445. package/dist-cjs/hallucination/retrieval.d.ts +21 -0
  446. package/dist-cjs/hallucination/verification.d.ts +32 -0
  447. package/dist-cjs/images/asset-stores.d.ts +45 -0
  448. package/dist-cjs/images/asset-stores.js +0 -32
  449. package/dist-cjs/images/asset-support.d.ts +80 -2
  450. package/dist-cjs/images/assets.d.ts +13 -0
  451. package/dist-cjs/images/assets.js +0 -8
  452. package/dist-cjs/images/codec.d.ts +4 -0
  453. package/dist-cjs/images/codec.js +0 -9
  454. package/dist-cjs/images/comfyui.d.ts +27 -0
  455. package/dist-cjs/images/comfyui.js +0 -20
  456. package/dist-cjs/images/errors.d.ts +39 -5
  457. package/dist-cjs/images/evals.d.ts +89 -1
  458. package/dist-cjs/images/evals.js +80 -20
  459. package/dist-cjs/images/google.d.ts +12 -0
  460. package/dist-cjs/images/google.js +0 -15
  461. package/dist-cjs/images/image-header.d.ts +6 -0
  462. package/dist-cjs/images/image-header.js +0 -17
  463. package/dist-cjs/images/inputs.d.ts +15 -1
  464. package/dist-cjs/images/inputs.js +0 -18
  465. package/dist-cjs/images/manager.d.ts +13 -0
  466. package/dist-cjs/images/manager.js +0 -12
  467. package/dist-cjs/images/mock.d.ts +10 -0
  468. package/dist-cjs/images/mock.js +0 -1
  469. package/dist-cjs/images/moderation.d.ts +6 -0
  470. package/dist-cjs/images/moderation.js +0 -15
  471. package/dist-cjs/images/openai.d.ts +33 -1
  472. package/dist-cjs/images/openai.js +0 -10
  473. package/dist-cjs/images/transform.d.ts +17 -0
  474. package/dist-cjs/images/transform.js +0 -20
  475. package/dist-cjs/index.d.ts +4 -4
  476. package/dist-cjs/index.js +5 -4
  477. package/dist-cjs/jobs/batch.d.ts +12 -0
  478. package/dist-cjs/jobs/durable-adapters.d.ts +24 -0
  479. package/dist-cjs/jobs/queue.d.ts +17 -0
  480. package/dist-cjs/mcp/client.d.ts +37 -0
  481. package/dist-cjs/mcp/client.js +0 -32
  482. package/dist-cjs/mcp/protocol.d.ts +30 -1
  483. package/dist-cjs/mcp/protocol.js +0 -16
  484. package/dist-cjs/mcp/server.d.ts +7 -0
  485. package/dist-cjs/mcp/server.js +0 -17
  486. package/dist-cjs/models/registry.d.ts +25 -0
  487. package/dist-cjs/models/registry.js +0 -26
  488. package/dist-cjs/next/route-handler.d.ts +4 -0
  489. package/dist-cjs/operations/adapters.d.ts +26 -0
  490. package/dist-cjs/operations/adapters.js +3 -18
  491. package/dist-cjs/operations/errors.d.ts +72 -8
  492. package/dist-cjs/operations/errors.js +10 -20
  493. package/dist-cjs/operations/handle.d.ts +15 -1
  494. package/dist-cjs/operations/handle.js +0 -29
  495. package/dist-cjs/operations/index.d.ts +1 -1
  496. package/dist-cjs/operations/index.js +2 -1
  497. package/dist-cjs/operations/runner.js +11 -54
  498. package/dist-cjs/operations/serialization.d.ts +10 -0
  499. package/dist-cjs/operations/serialization.js +53 -0
  500. package/dist-cjs/operations/state-machine.d.ts +2 -0
  501. package/dist-cjs/operations/state-machine.js +0 -18
  502. package/dist-cjs/operations/store.d.ts +17 -9
  503. package/dist-cjs/operations/store.js +5 -69
  504. package/dist-cjs/operations/webhooks.d.ts +2 -0
  505. package/dist-cjs/operations/webhooks.js +0 -23
  506. package/dist-cjs/ops/audit-logger.d.ts +2 -0
  507. package/dist-cjs/ops/circuit-breaker.d.ts +120 -5
  508. package/dist-cjs/ops/circuit-breaker.js +85 -25
  509. package/dist-cjs/ops/circuit-store.d.ts +83 -0
  510. package/dist-cjs/ops/circuit-store.js +94 -0
  511. package/dist-cjs/ops/circuit-sync.d.ts +57 -0
  512. package/dist-cjs/ops/circuit-sync.js +126 -0
  513. package/dist-cjs/ops/family-telemetry.d.ts +10 -0
  514. package/dist-cjs/ops/family-telemetry.js +0 -12
  515. package/dist-cjs/ops/health.d.ts +28 -0
  516. package/dist-cjs/ops/metrics.d.ts +39 -0
  517. package/dist-cjs/ops/otel-tracing.d.ts +9 -0
  518. package/dist-cjs/ops/rate-limit-adapters.d.ts +13 -0
  519. package/dist-cjs/ops/rate-limit-adapters.js +0 -11
  520. package/dist-cjs/ops/rate-limiter.d.ts +12 -1
  521. package/dist-cjs/ops/rate-limiter.js +1 -11
  522. package/dist-cjs/optimizer/budget.d.ts +17 -1
  523. package/dist-cjs/optimizer/cost-budget.d.ts +2 -0
  524. package/dist-cjs/optimizer/cost-budget.js +0 -13
  525. package/dist-cjs/optimizer/cost.d.ts +9 -0
  526. package/dist-cjs/optimizer/cost.js +0 -15
  527. package/dist-cjs/optimizer/densifier.d.ts +6 -0
  528. package/dist-cjs/optimizer/index.d.ts +2 -0
  529. package/dist-cjs/pipeline/pipeline.d.ts +10 -0
  530. package/dist-cjs/pipeline/types.d.ts +46 -0
  531. package/dist-cjs/postgres/circuits.d.ts +38 -0
  532. package/dist-cjs/postgres/circuits.js +51 -0
  533. package/dist-cjs/postgres/client.d.ts +43 -0
  534. package/dist-cjs/postgres/client.js +39 -0
  535. package/dist-cjs/postgres/evaluate.d.ts +53 -0
  536. package/dist-cjs/postgres/evaluate.js +102 -0
  537. package/dist-cjs/postgres/index.d.ts +23 -0
  538. package/dist-cjs/postgres/index.js +45 -0
  539. package/dist-cjs/postgres/operations.d.ts +59 -0
  540. package/dist-cjs/postgres/operations.js +118 -0
  541. package/dist-cjs/postgres/prompts.d.ts +50 -0
  542. package/dist-cjs/postgres/prompts.js +107 -0
  543. package/dist-cjs/postgres/sql.d.ts +23 -0
  544. package/dist-cjs/postgres/sql.js +36 -0
  545. package/dist-cjs/postgres/store.d.ts +55 -0
  546. package/dist-cjs/postgres/store.js +149 -0
  547. package/dist-cjs/postgres/traces.d.ts +37 -0
  548. package/dist-cjs/postgres/traces.js +122 -0
  549. package/dist-cjs/prompts/client.d.ts +79 -0
  550. package/dist-cjs/prompts/client.js +137 -0
  551. package/dist-cjs/prompts/diff.d.ts +53 -0
  552. package/dist-cjs/prompts/diff.js +113 -0
  553. package/dist-cjs/prompts/errors.d.ts +73 -0
  554. package/dist-cjs/prompts/errors.js +68 -0
  555. package/dist-cjs/prompts/evaluate.d.ts +26 -0
  556. package/dist-cjs/prompts/evaluate.js +58 -0
  557. package/dist-cjs/prompts/file.d.ts +45 -0
  558. package/dist-cjs/prompts/file.js +124 -0
  559. package/dist-cjs/prompts/gates.d.ts +38 -0
  560. package/dist-cjs/prompts/gates.js +102 -0
  561. package/dist-cjs/prompts/index.d.ts +12 -0
  562. package/dist-cjs/prompts/index.js +19 -0
  563. package/dist-cjs/prompts/memory.d.ts +44 -0
  564. package/dist-cjs/prompts/memory.js +66 -0
  565. package/dist-cjs/prompts/redis.d.ts +78 -0
  566. package/dist-cjs/prompts/redis.js +100 -0
  567. package/dist-cjs/prompts/registry-entry.d.ts +13 -0
  568. package/dist-cjs/prompts/registry-entry.js +19 -0
  569. package/dist-cjs/prompts/registry.d.ts +168 -0
  570. package/dist-cjs/prompts/registry.js +268 -0
  571. package/dist-cjs/prompts/template.d.ts +112 -0
  572. package/dist-cjs/prompts/template.js +154 -0
  573. package/dist-cjs/prompts/variant.d.ts +7 -0
  574. package/dist-cjs/prompts/variant.js +25 -0
  575. package/dist-cjs/prompts/version.d.ts +15 -0
  576. package/dist-cjs/prompts/version.js +28 -0
  577. package/dist-cjs/prompts/webhooks.d.ts +11 -0
  578. package/dist-cjs/prompts/webhooks.js +28 -0
  579. package/dist-cjs/providers/anthropic.d.ts +4 -0
  580. package/dist-cjs/providers/anthropic.js +0 -31
  581. package/dist-cjs/providers/azure-openai.js +0 -3
  582. package/dist-cjs/providers/base.d.ts +10 -0
  583. package/dist-cjs/providers/base.js +0 -1
  584. package/dist-cjs/providers/cohere.d.ts +5 -0
  585. package/dist-cjs/providers/deepseek.js +0 -3
  586. package/dist-cjs/providers/errors.d.ts +33 -0
  587. package/dist-cjs/providers/google.d.ts +4 -0
  588. package/dist-cjs/providers/google.js +0 -14
  589. package/dist-cjs/providers/groq.d.ts +4 -0
  590. package/dist-cjs/providers/llamacpp.js +0 -3
  591. package/dist-cjs/providers/lmstudio.js +0 -3
  592. package/dist-cjs/providers/mistral.d.ts +4 -0
  593. package/dist-cjs/providers/ollama.d.ts +4 -0
  594. package/dist-cjs/providers/ollama.js +0 -1
  595. package/dist-cjs/providers/openai.d.ts +4 -0
  596. package/dist-cjs/providers/openai.js +0 -23
  597. package/dist-cjs/providers/openrouter.d.ts +4 -0
  598. package/dist-cjs/providers/type-guards.d.ts +8 -0
  599. package/dist-cjs/rag/file-ingestion.d.ts +15 -0
  600. package/dist-cjs/rag/ingestion.d.ts +15 -0
  601. package/dist-cjs/realtime/conversation.d.ts +21 -0
  602. package/dist-cjs/realtime/errors.d.ts +25 -0
  603. package/dist-cjs/realtime/events.d.ts +7 -0
  604. package/dist-cjs/realtime/id.d.ts +5 -0
  605. package/dist-cjs/realtime/mock.transport.d.ts +27 -0
  606. package/dist-cjs/realtime/mock.transport.js +0 -4
  607. package/dist-cjs/realtime/openai-events.d.ts +3 -0
  608. package/dist-cjs/realtime/openai-server.d.ts +30 -0
  609. package/dist-cjs/realtime/openai-webrtc.transport.d.ts +108 -0
  610. package/dist-cjs/realtime/openai-webrtc.transport.js +0 -7
  611. package/dist-cjs/realtime/openai-websocket.transport.d.ts +46 -0
  612. package/dist-cjs/realtime/openai-websocket.transport.js +0 -2
  613. package/dist-cjs/realtime/provider.d.ts +30 -0
  614. package/dist-cjs/realtime/session.d.ts +44 -0
  615. package/dist-cjs/realtime/session.js +0 -3
  616. package/dist-cjs/realtime/tools.d.ts +25 -0
  617. package/dist-cjs/realtime/transport-utils.js +0 -1
  618. package/dist-cjs/realtime/types.d.ts +394 -0
  619. package/dist-cjs/router/auto-router.d.ts +5 -0
  620. package/dist-cjs/router/auto-router.js +3 -10
  621. package/dist-cjs/router/failover.d.ts +15 -0
  622. package/dist-cjs/router/failover.js +34 -13
  623. package/dist-cjs/router/index.d.ts +7 -1
  624. package/dist-cjs/router/index.js +40 -0
  625. package/dist-cjs/router/types.d.ts +27 -4
  626. package/dist-cjs/security/index.d.ts +17 -0
  627. package/dist-cjs/security/index.js +0 -1
  628. package/dist-cjs/security/injection-calibration.d.ts +17 -0
  629. package/dist-cjs/security/injection-detector.d.ts +3 -0
  630. package/dist-cjs/security/input-guard.d.ts +2 -0
  631. package/dist-cjs/security/output-guard.d.ts +2 -0
  632. package/dist-cjs/security/output-guard.js +0 -10
  633. package/dist-cjs/security/pii-detector.d.ts +3 -0
  634. package/dist-cjs/security/policies.d.ts +3 -0
  635. package/dist-cjs/security/prompt-hardening.d.ts +4 -0
  636. package/dist-cjs/security/schema-validator.d.ts +2 -0
  637. package/dist-cjs/security/semantic-injection-classifier.d.ts +6 -0
  638. package/dist-cjs/security/upload-scanner.d.ts +28 -0
  639. package/dist-cjs/store/helpers.d.ts +8 -0
  640. package/dist-cjs/store/helpers.js +59 -0
  641. package/dist-cjs/store/memory.d.ts +11 -6
  642. package/dist-cjs/store/memory.js +10 -72
  643. package/dist-cjs/store/redis.d.ts +17 -0
  644. package/dist-cjs/store/redis.js +4 -13
  645. package/dist-cjs/telephony/errors.d.ts +9 -1
  646. package/dist-cjs/telephony/manager.d.ts +17 -0
  647. package/dist-cjs/telephony/providers/twilio.d.ts +25 -0
  648. package/dist-cjs/telephony/providers/twilio.js +0 -3
  649. package/dist-cjs/telephony/realtime-bridge.d.ts +11 -0
  650. package/dist-cjs/telephony/realtime-bridge.js +0 -19
  651. package/dist-cjs/telephony/twiml.d.ts +3 -0
  652. package/dist-cjs/testing/embedding-provider-conformance.d.ts +17 -0
  653. package/dist-cjs/testing/embedding-provider-conformance.js +0 -7
  654. package/dist-cjs/testing/image-provider-conformance.d.ts +29 -0
  655. package/dist-cjs/testing/image-provider-conformance.js +0 -1
  656. package/dist-cjs/testing/provider-conformance.d.ts +24 -0
  657. package/dist-cjs/testing/record.d.ts +141 -0
  658. package/dist-cjs/testing/record.js +223 -0
  659. package/dist-cjs/tracing/alerts.d.ts +19 -0
  660. package/dist-cjs/tracing/alerts.js +0 -9
  661. package/dist-cjs/tracing/compare.d.ts +10 -0
  662. package/dist-cjs/tracing/compare.js +0 -10
  663. package/dist-cjs/tracing/instrument.d.ts +9 -0
  664. package/dist-cjs/tracing/instrument.js +1 -16
  665. package/dist-cjs/tracing/query.d.ts +6 -0
  666. package/dist-cjs/tracing/query.js +65 -0
  667. package/dist-cjs/tracing/stores.d.ts +22 -3
  668. package/dist-cjs/tracing/stores.js +8 -84
  669. package/dist-cjs/tracing/tracer.d.ts +29 -0
  670. package/dist-cjs/tracing/tracer.js +0 -13
  671. package/dist-cjs/types/agent.d.ts +31 -0
  672. package/dist-cjs/types/batch.d.ts +55 -0
  673. package/dist-cjs/types/capabilities.d.ts +9 -0
  674. package/dist-cjs/types/config.d.ts +197 -0
  675. package/dist-cjs/types/context-window.d.ts +62 -0
  676. package/dist-cjs/types/embeddings.d.ts +97 -0
  677. package/dist-cjs/types/evaluate.d.ts +55 -0
  678. package/dist-cjs/types/evaluate.js +0 -9
  679. package/dist-cjs/types/graph.d.ts +137 -3
  680. package/dist-cjs/types/graph.js +0 -30
  681. package/dist-cjs/types/images.d.ts +178 -0
  682. package/dist-cjs/types/messages.d.ts +92 -2
  683. package/dist-cjs/types/operations.d.ts +84 -0
  684. package/dist-cjs/types/operations.js +0 -8
  685. package/dist-cjs/types/optimizer.d.ts +31 -0
  686. package/dist-cjs/types/planning.d.ts +29 -0
  687. package/dist-cjs/types/prompts.d.ts +182 -0
  688. package/dist-cjs/types/prompts.js +2 -0
  689. package/dist-cjs/types/providers.d.ts +49 -0
  690. package/dist-cjs/types/providers.js +0 -40
  691. package/dist-cjs/types/response.d.ts +55 -0
  692. package/dist-cjs/types/security.d.ts +35 -0
  693. package/dist-cjs/types/store.d.ts +17 -0
  694. package/dist-cjs/types/store.js +0 -8
  695. package/dist-cjs/types/telephony.d.ts +216 -0
  696. package/dist-cjs/types/tracing.d.ts +53 -0
  697. package/dist-cjs/types/tracing.js +0 -9
  698. package/dist-cjs/types/voice.d.ts +172 -2
  699. package/dist-cjs/utils/safe-fetch.js +8 -38
  700. package/dist-cjs/utils/tokenizer.d.ts +7 -0
  701. package/dist-cjs/voice/errors.d.ts +9 -1
  702. package/dist-cjs/voice/manager.d.ts +16 -0
  703. package/dist-cjs/voice/providers/openai.d.ts +13 -0
  704. package/dist-cjs/voice/session.d.ts +16 -0
  705. package/dist-cjs/workflow/chains.d.ts +53 -0
  706. package/dist-cjs/workflow/domain.d.ts +28 -0
  707. package/package.json +201 -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,46 @@ 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.
414
+
415
+ ## Prompt stages (1.17.0)
416
+
417
+ The `nexus-ai-pro/prompts` subpaths and `nexus-ai-pro/postgres/prompts` are experimental in
418
+ production readiness, as the image family is: their exported types, functions, and classes follow the
419
+ 1.x semantic versioning rules, and the experimental label does not permit an incompatible minor or
420
+ patch release. None is exported from the root.
421
+
422
+ - The content version algorithm is a guarantee. `promptVersion()` gives the same version for the
423
+ same content in every 1.x release, so an upgrade never re-versions a committed prompt.
424
+ - Version, label, and history records only gain fields in the 1.x line, and the Postgres schema
425
+ follows the additive rule above.
426
+ - The wording of gate reasons, of the note a forced promotion records, and of `formatPromptDiff()`
427
+ output is for people and may improve in any release.
374
428
 
375
429
  ## Deprecation process
376
430
 
package/CHANGELOG.md CHANGED
@@ -4,6 +4,149 @@ Notable changes to this project are recorded here. The format follows [Keep a Ch
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.17.0] - 2026-09-23
8
+
9
+ Prompt versioning, and documentation you can navigate. Prompts are defined with typed variables,
10
+ versioned by their content, promoted between labels only after their gates agree, and served through
11
+ registry outages; every feature now has its own guide, and the README is an overview that links to them.
12
+
13
+ ### Added
14
+
15
+ - **Prompt templates** (`nexus-ai-pro/prompts`). `definePrompt()` types a prompt's variables from its
16
+ template text, so a missing or misspelled variable is a compile-time error. Templates support dot
17
+ paths, partials, placeholders for whole messages, defaults, and a request configuration versioned
18
+ with the prompt. `promptVersion()` derives a version from the content, identical in every runtime.
19
+ - **A prompt registry** (`nexus-ai-pro/prompts/registry`). `PromptRegistry` commits versions, points
20
+ labels such as `staging` and `production` at them, and records every change. `promote()` runs the
21
+ gates registered for the destination label: `experimentGate()` requires a passing experiment for
22
+ the exact version, with thresholds and an optional no-regression check, and `servedByGate()` requires
23
+ a version to be served by another label first. `rollback()`, `split()` for sticky A/B tests, and
24
+ `diff()` with `formatPromptDiff()` complete it. Label writes are compare-and-set, and changes can be
25
+ posted to signed webhooks, verified with `verifyPromptWebhook()`.
26
+ - **`evaluatePrompt()`**, the headless playground: runs a prompt version over a dataset and stores an
27
+ experiment tagged with that version, which is what `experimentGate()` looks for.
28
+ - **A serving client** (`nexus-ai-pro/prompts/client`). `PromptClient` caches labels with a TTL and a
29
+ stale-while-revalidate window, shares concurrent refreshes, keeps serving the last version seen when
30
+ the registry is unreachable, falls back to prompts bundled in code on a cold start, and picks a
31
+ sticky A/B arm per key.
32
+ - **Prompt stores**: `MemoryPromptStore`, `FilePromptStore` (`/prompts/file`), `RedisPromptStore`
33
+ (`/prompts/redis`), and `PostgresPromptStore` (`/postgres/prompts`), all tested against one
34
+ contract. `postgresMigration()` and `nexus db sql` include the prompt tables.
35
+ - A model call traced with `traceModelClient()` records the prompt name, version, label, and arm it
36
+ was rendered from.
37
+ - **A guide for every feature**, under `docs/`. Each guide covers every export of its entry points and
38
+ ends with a reference generated from the doc comments. `npm run docs:guides` fails when an export
39
+ is not named in a guide or a reference is stale, and runs in `npm test`; `npm run docs:update`
40
+ regenerates the references.
41
+ - `BinaryBuffer`: Node's `Buffer` when Node's types are loaded, otherwise `Uint8Array`.
42
+
43
+ ### Changed
44
+
45
+ - The README is an overview that links to the guides; the moved sections live in `docs/`, and the
46
+ size table is in `docs/packaging.md`.
47
+ - The combined Postgres migration creates three more tables, for prompts.
48
+
49
+ ### Fixed
50
+
51
+ - The message types referred to Node's `Buffer` and `NodeJS.ReadableStream`, so a project without
52
+ Node's type definitions, such as a browser app, failed to type-check anything that reached them.
53
+ They now compile either way, and are unchanged for Node projects.
54
+
55
+ ## [1.16.0] - 2026-09-22
56
+
57
+ Shared state and the command line. Everything that has to outlive a process or be shared between
58
+ workers now has a Postgres adapter, circuit decisions are shared across a fleet, the evaluation
59
+ platform has a CI gate, and suites that needed credentials can run from recorded provider traffic.
60
+
61
+ ### Added
62
+
63
+ - **A Postgres adapter family** (`nexus-ai-pro/postgres`, with one subpath per adapter):
64
+ `PostgresOperationStore`, `PostgresStore` (long-term memory, ranked by pgvector when
65
+ `vectorDimensions` is set), `PostgresTraceStore`, `PostgresDatasetStore`, `PostgresExperimentStore`,
66
+ and `PostgresCircuitStateStore`.
67
+ - Each takes any client with `query(text, values)` — `pg`, `@neondatabase/serverless`, PGlite — and
68
+ `fromPostgresJs()` adapts `postgres.js`. No driver becomes a dependency.
69
+ - Nothing creates a schema at import: `migrate()`, `postgresMigration()`, and `nexus db sql` apply
70
+ or print it.
71
+ - Idempotency keys are unique in the operations table, so two workers racing to submit one key run
72
+ the work once. Graph threads persist across workers through `OperationStoreCheckpointer`.
73
+ - **Shared circuit state.** `circuitBreaker.store` takes a `CircuitStateStore`: memory and Redis
74
+ adapters in `nexus-ai-pro/ops/circuit-store`, Postgres in `/postgres/circuits`. A provider that
75
+ fails in one worker is taken out of routing in all of them, and one worker at a time probes it when
76
+ the cooldown ends. Checks stay synchronous; the coordination code loads only when a store is
77
+ configured. `ai.syncCircuitBreaker()` loads shared state at startup.
78
+ - **Evaluation from the command line.** `nexus eval run`, `nexus eval compare`, and `nexus eval gate`
79
+ run an evaluation module to an experiment file and fail a build only on a regression beyond noise,
80
+ a new failure, or a dataset mismatch. `nexus traces list`, `show`, and `export` read a JSONL file or
81
+ any trace store a module exports. `nexus db sql` prints the Postgres schema. Every command takes
82
+ `--json`, and a usage error exits with 2.
83
+ - **Record and replay** (`nexus-ai-pro/testing/record`). `recordingFetch()` writes provider traffic
84
+ to reviewable fixture files with credentials removed; `replayFetch()` serves it back with no network
85
+ and throws `FixtureMissingError` for anything unrecorded; `fixtureFetch()` picks the mode from
86
+ `NEXUS_FIXTURES`; `installFetch()` covers code that calls the global `fetch`. Multipart boundaries
87
+ and key order do not break matching.
88
+ - **Image conformance from recordings.** `npm run conformance:images:record` records the image suite
89
+ against every backend with credentials present; `npm run test:conformance:images` replays it in CI
90
+ and reports any backend without recordings rather than counting it as a pass.
91
+ - **Graph input and output channels.** `createGraph({ channels, input, output })` restricts what a
92
+ caller may pass in and what comes back, in the types and at run time. As a subgraph, a graph
93
+ receives only its inputs and merges back only its outputs.
94
+ - **Per-node caching.** `addNode(name, fn, { cache: { key, ttlMs, store } })` reuses a node's result
95
+ for the same state and input, in a bounded in-process map or any cache adapter
96
+ (`compile({ cache })` sets a default). Failures, interrupts, human answers, and parent commands are
97
+ never cached; a failing cache is a miss.
98
+ - **Evaluation additions.** `underCost()` per-example cost gate; `FileExperimentStore` and
99
+ `readExperiment()`; `repetitions` may be a function per example; the target receives the abort
100
+ signal.
101
+ - `EvalRunner.run()` and `MediaEvalRunner.evaluate()` return the experiment underneath their report,
102
+ and accept options to name and store it.
103
+ - `OperationDuplicateError`, raised by stores that enforce unique idempotency keys.
104
+ - **Documentation coverage.** Every public export, and every public member of an exported class,
105
+ interface, or enum, now has a doc comment: 4,651 declarations across 88 entry points.
106
+ `npm run docs:check` enforces it and runs as part of `npm test`.
107
+
108
+ ### Changed
109
+
110
+ - `EvalRunner` and `MediaEvalRunner` now run on `evaluate()`. Their results and errors are unchanged;
111
+ `evaluate()` is loaded the first time they run, so neither entry point grew.
112
+ - A caller cancelling a request no longer counts against a provider's circuit.
113
+ - Circuit probe limits are enforced on every attempt through the failover executor, so concurrent
114
+ requests go to a fallback instead of all probing a half-open provider.
115
+ - Comments are stripped from the emitted JavaScript and kept in the type declarations, where editors
116
+ read them. Every entry point shrinks as a result: the root import is 572 KB, down from 612 KB, even
117
+ after the breaker fixes, the `EvalRunner` rebuild, and duplicate-key handling. The published size
118
+ table has the per-entry-point figures.
119
+ - The packed tarball is 666 KB and 4.1 MB unpacked, up from 3.5 MB, almost all of it the doc comments
120
+ in the type declarations, which are shipped for both ESM and CommonJS.
121
+
122
+ ### Fixed
123
+
124
+ - `evaluate()` ignored its `signal` option; aborting now stops new examples, reaches targets, and
125
+ never stores a partial experiment.
126
+ - `evaluate()` never recorded cost, so `totalCost()` always reported 0. Cost is now read from
127
+ completion and image results or from a `cost` option.
128
+ - A half-open probe slot was never released when an attempt's error did not count as a failure,
129
+ leaving the circuit refusing traffic until it was reset.
130
+ - The breaker's documented `halfOpenMaxCalls` was not enforced on real requests: the client routed
131
+ every request to a half-open provider.
132
+ - The context-window summary call could route to a provider whose circuit was open.
133
+ - `routing.fallback` was accepted but never applied. `onError` models are now tried after every
134
+ route the router chose, `onTimeout` gives the first attempt its own timeout before its fallback,
135
+ and `onRateLimit` retries a rate-limited first attempt before falling back.
136
+ - Privacy routing ignored a provider's own `isLocal` declaration, so an OpenAI-compatible server
137
+ configured as local was still scored as hosted.
138
+
139
+ ### Deprecated
140
+
141
+ These options were accepted but never read. They still type-check, do nothing, and will be removed
142
+ in 2.0.
143
+
144
+ - `GoogleProviderConfig.projectId`.
145
+ - `OllamaProviderConfig.timeout`.
146
+ - `MetricsConfig.prometheus`: Prometheus text is always available from `getPrometheusMetrics()`.
147
+ - `DensificationConfig.preserveMarkdown`: densification never rewrites Markdown structure.
148
+ - `HealthConfig.latencyHalfLife`: latency is averaged with a fixed weight.
149
+
7
150
  ## [1.15.0] - 2026-09-21
8
151
 
9
152
  Evaluation. One entry point for evaluating anything, datasets versioned by their content, experiments
@@ -751,7 +894,9 @@ shared policy vocabulary is in place for a future release that revisits this.
751
894
  - URL fetching rejects unsafe private-network targets and limits response reads.
752
895
  - CLI and audit findings no longer disclose detected secret values.
753
896
 
754
- [Unreleased]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.15.0...HEAD
897
+ [Unreleased]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.17.0...HEAD
898
+ [1.17.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.16.0...v1.17.0
899
+ [1.16.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.15.0...v1.16.0
755
900
  [1.15.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.14.0...v1.15.0
756
901
  [1.14.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.12.0...v1.14.0
757
902
  [1.12.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.11.0...v1.12.0