@bonvoy/plugin-ai 0.1.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 (2) hide show
  1. package/README.md +87 -0
  2. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # @bonvoy/plugin-ai
2
+
3
+ AI-generated release notes summary for bonvoy changelogs. Prepends a human-readable summary above the conventional changelog.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @bonvoy/plugin-ai
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ // bonvoy.config.js
15
+ export default {
16
+ plugins: [
17
+ ['@bonvoy/plugin-ai', { provider: 'openai' }]
18
+ ]
19
+ };
20
+ ```
21
+
22
+ Set the API key as an environment variable:
23
+
24
+ ```bash
25
+ OPENAI_API_KEY=sk-...
26
+ ```
27
+
28
+ ## Output
29
+
30
+ The plugin adds a blockquote summary after the version header:
31
+
32
+ ```markdown
33
+ ## [0.9.0] - 2026-02-10
34
+
35
+ > Adds automatic rollback for failed releases and improves error messages.
36
+ > If a publish fails mid-way, bonvoy now undoes all completed steps automatically.
37
+
38
+ ### ✨ Features
39
+ - add rollback & recovery for failed releases
40
+
41
+ ### 🐛 Bug Fixes
42
+ - improve error messages for rollback status
43
+ ```
44
+
45
+ The conventional changelog below remains unchanged.
46
+
47
+ ## Providers
48
+
49
+ Three providers are supported, each using native `fetch` with zero extra dependencies.
50
+
51
+ | Provider | Default Model | Env Var |
52
+ |----------|---------------|---------|
53
+ | `openai` | `gpt-4o-mini` | `OPENAI_API_KEY` |
54
+ | `anthropic` | `claude-sonnet-4-20250514` | `ANTHROPIC_API_KEY` |
55
+ | `gemini` | `gemini-2.0-flash` | `GEMINI_API_KEY` |
56
+
57
+ ```javascript
58
+ // Anthropic
59
+ ['@bonvoy/plugin-ai', { provider: 'anthropic' }]
60
+
61
+ // Gemini
62
+ ['@bonvoy/plugin-ai', { provider: 'gemini' }]
63
+
64
+ // Custom model
65
+ ['@bonvoy/plugin-ai', { provider: 'openai', model: 'gpt-4o' }]
66
+ ```
67
+
68
+ ## Configuration
69
+
70
+ | Option | Type | Required | Description |
71
+ |--------|------|----------|-------------|
72
+ | `provider` | `'openai' \| 'anthropic' \| 'gemini'` | Yes | LLM provider |
73
+ | `model` | `string` | No | Model name (uses provider default) |
74
+ | `apiKey` | `string` | No | API key (defaults to env var) |
75
+ | `promptTemplate` | `string` | No | Custom prompt with `{packageName}`, `{version}`, `{commitList}` placeholders |
76
+ | `maxTokens` | `number` | No | Max response tokens (default: `200`) |
77
+
78
+ ## Behavior
79
+
80
+ - Runs after the conventional changelog is generated (`afterChangelog` hook)
81
+ - One LLM call per changed package
82
+ - Skipped in `--dry-run` mode (no API cost)
83
+ - On API failure: logs a warning, keeps the conventional changelog as-is
84
+
85
+ ## License
86
+
87
+ MIT
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@bonvoy/plugin-ai",
3
+ "version": "0.1.0",
4
+ "description": "🚢 AI-generated release notes summary for bonvoy changelogs",
5
+ "keywords": [
6
+ "bonvoy",
7
+ "plugin",
8
+ "ai",
9
+ "release-notes",
10
+ "changelog",
11
+ "openai",
12
+ "anthropic",
13
+ "gemini"
14
+ ],
15
+ "homepage": "https://github.com/Zweer/bonvoy#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/Zweer/bonvoy/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Zweer/bonvoy.git",
22
+ "directory": "packages/plugin-ai"
23
+ },
24
+ "license": "MIT",
25
+ "author": {
26
+ "name": "Zweer",
27
+ "email": "n.olivieriachille@gmail.com"
28
+ },
29
+ "type": "module",
30
+ "exports": {
31
+ ".": "./dist/index.mjs",
32
+ "./package.json": "./package.json"
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsdown",
39
+ "test": "vitest"
40
+ },
41
+ "dependencies": {
42
+ "@bonvoy/core": "^0.8.0"
43
+ },
44
+ "engines": {
45
+ "node": ">= 20.5"
46
+ }
47
+ }