cvc-catalog-sync-plugin 1.0.0 → 2.0.1

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,203 @@
1
+ # Changelog
2
+
3
+ All notable changes to this plugin are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ The package name, the composition row id (`cvc-catalog-sync`) and the locale
9
+ namespace stay the same across the major versions, because a profile refers to
10
+ them by name. Everything else about the configuration surface is versioned: the
11
+ row config moved from a flat list of keys to groups, and the HTTP routes moved
12
+ under one prefix.
13
+
14
+ ## [Unreleased]
15
+
16
+ Nothing yet.
17
+
18
+ ## [2.0.0] - 2026-11-21
19
+
20
+ The plugin stops being "catalog sync with a settings page" and becomes three
21
+ functions in one package: catalog sync, price coefficients, and balance. Each
22
+ function has its own switch in the settings page, and none of them is mounted
23
+ while its switch is off — no HTTP route, no timer, no tool, no UI element.
24
+
25
+ The release also replaces two separately installed plugins. Users who had
26
+ `cvc-model-coeff-plugin` and `cvc-balance-plugin` in their profile no longer need
27
+ them; the functions they provided are part of this package, and the two
28
+ repositories are archived. The originals stay in their own git history and are
29
+ still reachable for anyone reading old profiles.
30
+
31
+ See [docs/UPGRADING.md](docs/UPGRADING.md) for the steps.
32
+
33
+ ### Fixed in 2.0.1
34
+
35
+ Version 2.0.0 is the first combined release; 2.0.1 carries the fixes found while
36
+ running it on a live DSH host. Nothing in the configuration surface changed, so
37
+ updating from 2.0.0 is a version bump only.
38
+
39
+ - **The `cvc_balance` tool declared nullable fields as type unions**
40
+ (`type: ["number", "null"]`). DSH refuses type arrays when a tool is registered,
41
+ and the refusal turned the whole plugin row inactive on a live host ("1 entry
42
+ did not activate"). Missing readings are absent keys, so single types are used
43
+ now, and a test keeps type arrays out of the schema.
44
+ - **The plugin with every switch off left its tool behind.** With only the
45
+ balance function enabled, disabling it kept `cvc_balance` registered, because
46
+ the tool list was built once at activation. Deactivation now removes the tool
47
+ through the same coordinator that mounts it.
48
+ - **A change to a normal setting remounted all three functions** instead of only
49
+ the one whose section changed; timers and tools were recreated needlessly.
50
+ - **`publish.yml`** ran on Node 22, whose npm 10 cannot exchange the Trusted
51
+ Publishing OIDC token (the run failed with `ENEEDAUTH`), and its verification
52
+ step treated the registry's asynchronous processing as a failure. Release
53
+ publishing now runs on Node 24 and polls the registry before judging.
54
+ ### Added
55
+
56
+ - Three function switches — `features.catalogSync`, `features.coefficients`,
57
+ `features.balance` — all on by default, all applied without a restart. The
58
+ plugin declares every configuration field as volatile, so DSH reloads the row
59
+ through `loader/volatile-update` and the browser half mounts or unmounts the
60
+ function in the running page.
61
+ - A price-multiplier badge (`×0.1` … `×10`) beside every model of the
62
+ CheapVibeCode route in the composer's model menu and on the current-model
63
+ button. The colour follows the host theme and the tooltip names the fast-mode
64
+ multiplier when it differs. A model without a multiplier in the catalog gets
65
+ no badge, and models with the same id under other providers stay undecorated.
66
+ - A **CVC balance** button in the sidebar footer with a status dot (all
67
+ providers answered / only some / none), and a draggable panel with one card per
68
+ route: display name, route key, `baseURL`, the credential name and whether the
69
+ key was found, the balance in provider units, and the spend since the previous
70
+ reading. The panel position is remembered in `localStorage` under
71
+ `cvc:panel-pos`; the panel offers **Refresh** and **Reset position**.
72
+ - The `cvc_balance` tool for the agent: `status` returns the last snapshot in
73
+ this process without spending a request.
74
+ - One shared catalog cache for the three functions. A catalog fetch serves both
75
+ the model list written into the patch and the badges, so a badge refresh does
76
+ not add a second request while the cache is fresh.
77
+ - HTTP routes under a single prefix, `/cvc`: `GET /cvc/state`, `PUT
78
+ /cvc/config`, `POST /cvc/run`, `GET /cvc/coefficients`, `GET /cvc/balance`,
79
+ `GET /cvc/health`. The routes reject cross-site requests (`403`), a `PUT`
80
+ without `application/json` (`415`) and a body over 64 KB (`413`).
81
+ - A `Config` schema on `@deepseek-ai/schemastery` with the groups `features`,
82
+ `providers`, `catalog`, `coefficients` and `balance`, plus validation for
83
+ values written from the settings page (a `400` answer carries the offending
84
+ field names).
85
+ - `GET /cvc/state` reports `configShape`, so a configuration left in the 1.x
86
+ shape is visibly marked as `legacy` and the settings page offers to save once
87
+ to convert it.
88
+ - The settings page gains the switch block and the parameter groups **Catalog**,
89
+ **Coefficients**, **Balance** and **Advanced**, with the unsaved-changes marker
90
+ and the last-run summary kept from 1.0.0 (counts, level source, added /
91
+ removed / changed models, allowlist changes, warnings, patch path).
92
+ - `README.ru.md` as a full Russian counterpart of `README.md`, `CHANGELOG.md`,
93
+ and the documents `docs/ARCHITECTURE.md`, `docs/UPGRADING.md`,
94
+ `docs/COMPATIBILITY.md`, and a one-picture detail page `docs/DETAIL.md` with
95
+ `docs/preview.svg`.
96
+
97
+ ### Changed
98
+
99
+ - The row config is grouped: `features.*`, `providers.*` (`match`, `entryId`,
100
+ `apiKeyEnv`, `baseURL`, `timeoutMs`), `catalog.*` (`provider`, `autoSync`,
101
+ `intervalHours`, `startupDelayMs`, `minModelRatio`, `keepModels`,
102
+ `installerUrls`, `syncAllowlist`, `allowlistEntryId`, `levelsCacheMinutes`),
103
+ `coefficients.*` (`refreshMinutes`, `showFast`) and `balance.*`
104
+ (`refreshSeconds`, `showDelta`).
105
+ - Providers are found by the host names in `providers.match` (default
106
+ `cheapvibecode.ru`) instead of a single hard-coded host, so a route pointing at
107
+ another CVC host is picked up as well.
108
+ - The browser half is compiled from `src/client/**` into `client.js` by
109
+ `tools/build-client.mjs`, and the compiled file is committed. The package
110
+ installs from npm and from git without running a build on the user's machine,
111
+ and no `allowBuilds` permission is needed. CI rebuilds the file and fails when
112
+ the committed copy differs from the sources.
113
+ - The host half uses the global `fetch` of the DSH process for every provider
114
+ request; the plugin spawns no process and needs no `ctx.shell`.
115
+ - `SECURITY.md` describes the threat model of all three functions, not just the
116
+ catalog.
117
+ - The test suite is grouped by module and runs through `node --test test/*.mjs`;
118
+ every one of the 32 test scenarios of 1.0.0 is carried over rather than dropped.
119
+
120
+ ### Fixed
121
+
122
+ - Invalid values coming from the settings form are now rejected with a `400` and
123
+ the offending field names instead of being folded into defaults by
124
+ normalisation alone.
125
+ - The provider lookup is one module for all three functions. Before, a route added
126
+ under a renamed key worked in one surface and not in the others, because each
127
+ plugin had its own copy of the discovery code.
128
+ - The installer parser no longer scans the downloaded text with a backtracking
129
+ regular expression; it finds the `const reasoningLevels = {…}` literal
130
+ linearly. The change was first shipped in 1.0.0 after a review of the input
131
+ parsing; it is repeated here because the code was moved.
132
+
133
+ ### Removed
134
+
135
+ - The old HTTP prefixes `/cvc-catalog-sync`, `/cvc-model-coeff` and
136
+ `/cvc-balance` are no longer served. A browser tab or a script that still calls
137
+ them gets `404`.
138
+ - The client occupies only the slots it owns: `conversation.input.model.label`
139
+ stays with its owner, never used by this plugin. The balance function uses
140
+ `sidebar.footer.action`, and the settings page uses `settings.section`,
141
+ `settings.section.icon` and `plugins.bundle.config`.
142
+ - The `prepare`-based local build is gone with the two private plugins: this
143
+ package ships its compiled client half and does not run a build script on
144
+ install.
145
+ - `cvc-model-coeff-plugin` and `cvc-balance-plugin` are archived; their
146
+ repositories stay online, read-only.
147
+
148
+ ### Upgrading from 1.0.0 / from 1.1.0 of the private plugins
149
+
150
+ The short version: keep the package name and the row id, let the old flat
151
+ configuration load as it is, remove the two old rows from the profile, and save
152
+ the settings page once to convert the configuration to the grouped shape.
153
+
154
+ 1. Install or update the package to `2.0.0`. The profile does not need a new row:
155
+ the package name `cvc-catalog-sync-plugin` and the row id `cvc-catalog-sync`
156
+ are unchanged, and the bundle patch of the package inserts the row with the
157
+ three switches turned on.
158
+ 2. A flat 1.x configuration in the row keeps working. It is normalised into the
159
+ groups on load, and `GET /cvc/state` reports `configShape: 'legacy'`. The
160
+ settings page shows a hint; pressing **Save** once rewrites the row in the
161
+ grouped shape.
162
+ 3. If `cvc-balance-plugin` is installed, remove its row from the profile patch
163
+ (id `cvc-balance`) and remove the package from `dsh.profile.bundles`. The
164
+ balance function of 2.0.0 reads the same routes and shows the same numbers
165
+ under `GET /cvc/balance`; the old browser half would keep its own button next
166
+ to the new one.
167
+ 4. If `cvc-model-coeff-plugin` is installed, remove its row (id `cvc-model-coeff`)
168
+ and the package from `dsh.profile.bundles` the same way. The old badge and the
169
+ new badge would both be drawn on the same model rows.
170
+ 5. Remove the `allowBuilds` entries those two packages needed. This package has
171
+ no install-time build script, so it does not ask for such a permission.
172
+ 6. Restart DSH once after editing the profile by hand, then hard-reload the tab.
173
+ Later changes of the switches do not need a restart.
174
+ 7. Check the result: `GET /cvc/health` answers
175
+ `{"ok":true,"version":"2.0.0"}`; the settings page shows three switches on;
176
+ `docs/UPGRADING.md` has the same steps with the commands.
177
+
178
+ ## [1.0.0] - 2026-11-20
179
+
180
+ First public release.
181
+
182
+ ### Added
183
+
184
+ - Catalog sync: `GET {baseURL}/models` plus the `reasoningLevels` map of the
185
+ official installer, built into `llm-pi-ai.providers.<provider>.models` by the
186
+ installer's own rules, written through `ctx.configEditor.edit()` and applied
187
+ by `dsh-hmr`.
188
+ - The `subagent-model-selection-settings.allowedModels` sync.
189
+ - The shrink guard `minModelRatio` and the `keepModels` list.
190
+ - The `cvc_catalog` tool with `status`, `plan` and `apply` (and `force`).
191
+ - The settings page in two seats, **Settings → CVC** and the bundle page in
192
+ **Plugins**, with Save / Check / Apply / Reset.
193
+ - A timer for the automatic run: startup delay and interval.
194
+
195
+ ### Changed
196
+
197
+ - Input parsing was hardened in the same release: the installer text is scanned
198
+ linearly, slash trimming no longer uses a regular expression, and the settings
199
+ routes were narrowed to the ones the page needs.
200
+
201
+ [Unreleased]: https://github.com/mikel38487/cvc-catalog-sync-plugin/compare/v2.0.0...HEAD
202
+ [2.0.0]: https://github.com/mikel38487/cvc-catalog-sync-plugin/compare/v1.0.0...v2.0.0
203
+ [1.0.0]: https://github.com/mikel38487/cvc-catalog-sync-plugin/releases/tag/v1.0.0