nexus-ai-pro 1.16.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 (87) hide show
  1. package/API_STABILITY.md +14 -0
  2. package/CHANGELOG.md +50 -1
  3. package/README.md +38 -2316
  4. package/dist/cli/db.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/postgres/index.d.ts +2 -1
  8. package/dist/postgres/index.js +4 -1
  9. package/dist/postgres/prompts.d.ts +50 -0
  10. package/dist/postgres/prompts.js +102 -0
  11. package/dist/prompts/client.d.ts +79 -0
  12. package/dist/prompts/client.js +133 -0
  13. package/dist/prompts/diff.d.ts +53 -0
  14. package/dist/prompts/diff.js +108 -0
  15. package/dist/prompts/errors.d.ts +73 -0
  16. package/dist/prompts/errors.js +59 -0
  17. package/dist/prompts/evaluate.d.ts +26 -0
  18. package/dist/prompts/evaluate.js +22 -0
  19. package/dist/prompts/file.d.ts +45 -0
  20. package/dist/prompts/file.js +117 -0
  21. package/dist/prompts/gates.d.ts +38 -0
  22. package/dist/prompts/gates.js +65 -0
  23. package/dist/prompts/index.d.ts +12 -0
  24. package/dist/prompts/index.js +4 -0
  25. package/dist/prompts/memory.d.ts +44 -0
  26. package/dist/prompts/memory.js +62 -0
  27. package/dist/prompts/redis.d.ts +78 -0
  28. package/dist/prompts/redis.js +96 -0
  29. package/dist/prompts/registry-entry.d.ts +13 -0
  30. package/dist/prompts/registry-entry.js +6 -0
  31. package/dist/prompts/registry.d.ts +168 -0
  32. package/dist/prompts/registry.js +231 -0
  33. package/dist/prompts/template.d.ts +112 -0
  34. package/dist/prompts/template.js +149 -0
  35. package/dist/prompts/variant.d.ts +7 -0
  36. package/dist/prompts/variant.js +22 -0
  37. package/dist/prompts/version.d.ts +15 -0
  38. package/dist/prompts/version.js +24 -0
  39. package/dist/prompts/webhooks.d.ts +11 -0
  40. package/dist/prompts/webhooks.js +24 -0
  41. package/dist/tracing/instrument.js +1 -0
  42. package/dist/types/messages.d.ts +22 -2
  43. package/dist/types/prompts.d.ts +182 -0
  44. package/dist/types/prompts.js +1 -0
  45. package/dist/types/voice.d.ts +2 -2
  46. package/dist-cjs/cli/db.js +1 -1
  47. package/dist-cjs/index.d.ts +1 -1
  48. package/dist-cjs/postgres/index.d.ts +2 -1
  49. package/dist-cjs/postgres/index.js +7 -2
  50. package/dist-cjs/postgres/prompts.d.ts +50 -0
  51. package/dist-cjs/postgres/prompts.js +107 -0
  52. package/dist-cjs/prompts/client.d.ts +79 -0
  53. package/dist-cjs/prompts/client.js +137 -0
  54. package/dist-cjs/prompts/diff.d.ts +53 -0
  55. package/dist-cjs/prompts/diff.js +113 -0
  56. package/dist-cjs/prompts/errors.d.ts +73 -0
  57. package/dist-cjs/prompts/errors.js +68 -0
  58. package/dist-cjs/prompts/evaluate.d.ts +26 -0
  59. package/dist-cjs/prompts/evaluate.js +58 -0
  60. package/dist-cjs/prompts/file.d.ts +45 -0
  61. package/dist-cjs/prompts/file.js +124 -0
  62. package/dist-cjs/prompts/gates.d.ts +38 -0
  63. package/dist-cjs/prompts/gates.js +102 -0
  64. package/dist-cjs/prompts/index.d.ts +12 -0
  65. package/dist-cjs/prompts/index.js +19 -0
  66. package/dist-cjs/prompts/memory.d.ts +44 -0
  67. package/dist-cjs/prompts/memory.js +66 -0
  68. package/dist-cjs/prompts/redis.d.ts +78 -0
  69. package/dist-cjs/prompts/redis.js +100 -0
  70. package/dist-cjs/prompts/registry-entry.d.ts +13 -0
  71. package/dist-cjs/prompts/registry-entry.js +19 -0
  72. package/dist-cjs/prompts/registry.d.ts +168 -0
  73. package/dist-cjs/prompts/registry.js +268 -0
  74. package/dist-cjs/prompts/template.d.ts +112 -0
  75. package/dist-cjs/prompts/template.js +154 -0
  76. package/dist-cjs/prompts/variant.d.ts +7 -0
  77. package/dist-cjs/prompts/variant.js +25 -0
  78. package/dist-cjs/prompts/version.d.ts +15 -0
  79. package/dist-cjs/prompts/version.js +28 -0
  80. package/dist-cjs/prompts/webhooks.d.ts +11 -0
  81. package/dist-cjs/prompts/webhooks.js +28 -0
  82. package/dist-cjs/tracing/instrument.js +1 -0
  83. package/dist-cjs/types/messages.d.ts +22 -2
  84. package/dist-cjs/types/prompts.d.ts +182 -0
  85. package/dist-cjs/types/prompts.js +2 -0
  86. package/dist-cjs/types/voice.d.ts +2 -2
  87. package/package.json +84 -2
package/API_STABILITY.md CHANGED
@@ -412,6 +412,20 @@ The `nexus-ai-pro/postgres` subpaths, `nexus-ai-pro/ops/circuit-store`, and
412
412
  so recordings made with one release keep replaying with the next. A change that would invalidate
413
413
  recordings waits for 2.0.
414
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.
428
+
415
429
  ## Deprecation process
416
430
 
417
431
  Deprecated APIs are marked with `@deprecated` in declarations and described in the changelog. Removals
package/CHANGELOG.md CHANGED
@@ -4,6 +4,54 @@ 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
+
7
55
  ## [1.16.0] - 2026-09-22
8
56
 
9
57
  Shared state and the command line. Everything that has to outlive a process or be shared between
@@ -846,7 +894,8 @@ shared policy vocabulary is in place for a future release that revisits this.
846
894
  - URL fetching rejects unsafe private-network targets and limits response reads.
847
895
  - CLI and audit findings no longer disclose detected secret values.
848
896
 
849
- [Unreleased]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.16.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
850
899
  [1.16.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.15.0...v1.16.0
851
900
  [1.15.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.14.0...v1.15.0
852
901
  [1.14.0]: https://github.com/mkhitar-abrahamyan/nexus-ai/compare/v1.12.0...v1.14.0