@uni-design-system/uni-mcp 4.6.0 → 4.7.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,273 @@
1
+ # @uni-design-system/uni-mcp
2
+
3
+ ## 4.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b160b3c`](https://github.com/uni-design-system/uni/commit/b160b3c073ffb3191dd1cdf0a2f71e60679f1182) Thanks [@gaenglish](https://github.com/gaenglish)! - README: the hosted (Render) endpoint is marked dormant — no deployment is currently running; stdio via `npx -y @uni-design-system/uni-mcp` is the canonical path (pin the package to your installed Uni version for version-locked answers). The HTTP mode stays documented and deployable for when a browser-based consumer needs it. The `get-changelog` and `export-dtcg-tokens` tools are now listed in the tools table.
8
+
9
+ ## 4.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`e706e38`](https://github.com/uni-design-system/uni/commit/e706e3887f47d8821cc1652410ad37a43d52a428) Thanks [@gaenglish](https://github.com/gaenglish)! - `get-changelog`: release notes as a first-class MCP tool, plus a `uni://changelog/{package}` resource.
14
+
15
+ The index now ingests every published package's changesets `CHANGELOG.md` (a new build adapter parses them into structured releases — bump level, headline, full body, commit, dependency bumps). The tool answers "what changed in X?" and "what do I get by upgrading?": `version` returns one release's full notes (`"8.1"` matches every 8.1.x), `since` returns the full notes of every release after an installed version, and no scope returns a compact release digest. `package` accepts npm or short names (`uni-angular` is the default).
16
+
17
+ - [`57a8c4c`](https://github.com/uni-design-system/uni/commit/57a8c4c73c852a6b14c2e2916cad9bd0a1566787) Thanks [@gaenglish](https://github.com/gaenglish)! - `export-dtcg-tokens`: W3C DTCG JSON (Style Dictionary compatible) for a built-in theme's color, radius, and spacing scales, named with Uni token ids — exposing core's existing `emitDtcgTokens` as an MCP tool for external token pipelines. The `UniTheme` JSON from the theme tools remains the lossless primary format.
18
+
19
+ ### Patch Changes
20
+
21
+ - [`e706e38`](https://github.com/uni-design-system/uni/commit/e706e3887f47d8821cc1652410ad37a43d52a428) Thanks [@gaenglish](https://github.com/gaenglish)! - Ship `CHANGELOG.md` in the published packages. The release notes existed only in the repo; an installed package carried no record of what changed, so upgrade questions couldn't be answered from `node_modules`. uni-angular copies it into the ng-packagr `dist` via `assets`; the rest add it to `files`.
22
+
23
+ ## 4.6.0
24
+
25
+ ### Minor Changes
26
+
27
+ - [`5414517`](https://github.com/uni-design-system/uni/commit/5414517d52d17943a4730752ab5d90c304c37062) Thanks [@gaenglish](https://github.com/gaenglish)! - Runtime theme JSON: `generate-runtime-theme`, `get-runtime-theme`, and a theme registry endpoint
28
+
29
+ `generate-uni-theme` returns `uni-theme.ts` **source** — codegen by design, and
30
+ the right answer for branding an app permanently. It is the wrong answer when a
31
+ theme needs to apply _now_: an agent had to write a file and rebuild. These tools
32
+ close that gap (ROADMAP Track 1 item 4).
33
+ - **`generate-runtime-theme`** — brand hex color(s) in, a WCAG-AA light+dark pair
34
+ out as validated JSON, ready for `ThemeService.registerTheme(theme, { select:
35
+ true })`. No file, no rebuild.
36
+ - **`get-runtime-theme`** — a theme that ships with Uni as a registerable
37
+ `UniTheme`. Distinct from `get-theme-template`, which returns a flat read-only
38
+ projection of token values rather than the theme object itself.
39
+ - **Both validate before returning.** Every theme is run through uni-core's
40
+ `parseTheme`, so "validated" is checked rather than claimed; a failure comes
41
+ back as a tool error listing every reason.
42
+ - **First tools with an MCP `outputSchema`**, so agents get a machine-readable
43
+ contract instead of parsing prose (opens ROADMAP Track 1 item 6). The theme
44
+ itself is typed as an opaque validated object on purpose — uni-core's
45
+ `parseTheme` stays the single source of truth for theme shape, and a mirrored
46
+ schema here would drift from it.
47
+ - **Payloads elide the built-in icon set** (`dehydrateTheme`), taking a
48
+ light+dark result from ~100 KB to ~30 KB — roughly 7.6k tokens instead of 25k
49
+ per call. Consumers restore them on registration.
50
+ - **New registry endpoint on the HTTP server**: `GET /themes` lists the ids and
51
+ `GET /themes/{id}.json` returns one registerable theme, for apps that fetch a
52
+ theme without speaking MCP. These routes are public, read-only and
53
+ CORS-enabled so a browser can fetch them directly; `/mcp` stays token-guarded
54
+ and same-origin.
55
+ - The server's instructions now carry a routing rule for the four theme tools
56
+ (brand permanently / apply now / inspect values), and the README tool table
57
+ lists `create-icon-tokens`, which shipped undocumented.
58
+
59
+ ## 4.5.0
60
+
61
+ ### Minor Changes
62
+
63
+ - [`c2421c0`](https://github.com/uni-design-system/uni/commit/c2421c04d01f36d74b489613d22997553f256d4f) Thanks [@gaenglish](https://github.com/gaenglish)! - Expand `BaseIcons` to 59 icons and add `uni-icon` sizing
64
+
65
+ The 34-icon set shipped in 7.0.0 covered the library's own components but not a
66
+ real application — an app migrating off inline `<svg>` (or off `uni-symbol`, in
67
+ Angular) ran out of names almost immediately. Everything here is additive; all
68
+ 34 existing names are unchanged.
69
+ - **25 new icons**, same Material Symbols Outlined 300 source and the same
70
+ `0 -960 960 960` grid as the rest of the set: navigation (`link`, `expand`,
71
+ `gridView`, `listView`), actions (`moreHorizontal`, `copy`, `send`,
72
+ `refresh`, `dragHandle`, `qrCode`), feedback (`star`, `verified`) and
73
+ user/system (`group`, `shieldPerson`, `clock`, `mail`, `chat`, `image`,
74
+ `document`, `payment`, `bank`, `trendingUp`, `extension`, `webhook`,
75
+ `logout`).
76
+ - `moreHorizontal` ships alongside `more` because that one is `more_vert` and
77
+ row-aligned menus need the horizontal kebab.
78
+ - `star` is separate from `favorite`, which is the heart.
79
+ - **`uni-icon` gains an optional `size` input** (`CssLength` — bare numbers are
80
+ px, strings pass through, so `20` and `'1.25rem'` both work). Left unset,
81
+ behaviour is unchanged: the icon fills its container, which is what lets a
82
+ themed control size its own glyph through padding. Set, it applies
83
+ width/height as inline styles, so an explicit size wins over the
84
+ fill-the-container rule regardless of style injection order. This removes the
85
+ per-call-site `width`/`height` CSS rule that replacing an inline `<svg>` with
86
+ `<uni-icon>` would otherwise need.
87
+ - The MCP `create-icon-tokens` tool now lists the built-in icon names above the
88
+ token map it returns. Apps routinely hand-draw their own `close`, `check` or
89
+ `plus`; encoding those into theme tokens works but adds redundant artwork on a
90
+ foreign grid when the theme already ships the glyph. The tool cannot recognise
91
+ a shape, so it hands the caller the list to check against before adding
92
+ anything.
93
+
94
+ ## 4.4.0
95
+
96
+ ### Minor Changes
97
+
98
+ - [`f7727aa`](https://github.com/uni-design-system/uni/commit/f7727aa8895bd67f285ba4830858f994490bb7f7) Thanks [@gaenglish](https://github.com/gaenglish)! - Replace `BaseIcons` with a normalized 34-icon Material Symbols set
99
+
100
+ The built-in icon set was 11 glyphs drawn from four different grids
101
+ (`0 0 24 24`, `0 0 50 50`, `0 0 64 64`, `0 -960 960 960`), so `checkCircle` and
102
+ `xCircle` rendered as solid filled discs next to a hairline `alertCircle` and an
103
+ oversized `close` — three optical weights in one set.
104
+ - `BaseIcons` is now Material Symbols Outlined at weight 300, every glyph on a
105
+ single `0 -960 960 960` grid, grouped by intent: navigation (`menu`,
106
+ `chevronUp/Down/Left/Right`, `arrowLeft/Right`, `home`, `externalLink`),
107
+ actions (`search`, `close`, `plus`, `minus`, `more`, `delete`, `edit`,
108
+ `download`, `upload`, `share`, `filter`), feedback (`check`, `checkCircle`,
109
+ `xCircle`, `alertCircle`, `info`, `warning`, `lock`) and user/system
110
+ (`profile`, `settings`, `notification`, `favorite`, `help`, `calendar`).
111
+ - All 11 previously shipped names are preserved, so existing `<uni-icon>` call
112
+ sites and theme overrides keep working. Their **appearance changes**: the
113
+ filled `checkCircle`/`xCircle` are now outlined, and the set reads lighter
114
+ overall. `spinner` is carried over verbatim, keyframes intact.
115
+ - New `IconName` and `BaseIconName` types. `IconName` is
116
+ `BaseIconName | (string & {})`, so built-ins autocomplete and typos surface
117
+ while themes can still register arbitrary names via `createTheme({ icons })`.
118
+ `uni-icon`'s `name` input is typed with it instead of `keyof Icons`.
119
+ - **Breaking**: removes the unused `IconToken`, `IconStyle`, `ToggleableIcon`
120
+ and `IconConfig` exports. Nothing in the library referenced them and
121
+ `IconToken`'s 60-name union contradicted the actual `BaseIcons` keys. Use
122
+ `IconName` instead.
123
+ - New exported `svgToIconUri(svg, options?)` — the supported way to bring your
124
+ own icons (a brand set, a designer handoff) into a theme. It normalizes the
125
+ source (drops the xml declaration, comments and fixed `width`/`height` so the
126
+ mask scales), percent-encodes it, and **rejects artwork that cannot survive
127
+ masking**: no `viewBox`, an embedded raster `<image>`, an external reference,
128
+ a gradient/pattern fill, or more than one paint color. That last one is the
129
+ trap worth naming — masks use the alpha channel, so a multi-color logo
130
+ flattens to a silhouette in `currentColor`; pass `{ allowMultiColor: true }`
131
+ when that is intended. `createTheme({ icons })` merges the result over
132
+ `BaseIcons` per name, so a built-in name reskins and a new name is added.
133
+ - New MCP tool `create-icon-tokens`, the agent-facing front end to
134
+ `svgToIconUri`: hand it a project's inline `<svg>` (or a brand set) and it
135
+ returns a paste-ready `icons` map for `uni-theme.ts`. It encodes via the same
136
+ helper, so tokens are byte-identical to the built-in set, and adds the
137
+ set-level checks a per-icon helper cannot make — which names override
138
+ built-ins, and whether the artwork mixes viewBox grids. Bad artwork is
139
+ reported per icon rather than failing the batch, and re-running is safe
140
+ (already-encoded URIs pass through). The server instructions now point agents
141
+ at it whenever they encounter inline SVG.
142
+ - `BaseIcons` is generated by `scripts/generate-icons.mjs` (`pnpm icons:generate`),
143
+ which fetches from the canonical Material Symbols source and validates every
144
+ glyph before writing — a malformed path, an off-grid viewBox or geometry
145
+ outside the grid aborts the run. `pnpm icons:check` verifies the committed
146
+ file without writing. Add or change icons in that script's manifest and
147
+ regenerate; the file is not hand-edited. `icon.records.spec.ts` asserts the
148
+ same invariants against the committed output.
149
+
150
+ ## 4.3.0
151
+
152
+ ### Minor Changes
153
+
154
+ - [`076202d`](https://github.com/uni-design-system/uni/commit/076202d367d6393df685fde5906671d1a34e5a1b) Thanks [@gaenglish](https://github.com/gaenglish)! - MDX guidelines adapter — authored docs now reach AI agents
155
+ - New build adapter parses each component's co-located `.mdx` docs page into the
156
+ index's previously-empty `guidelines` field: the `## Overview` prose becomes
157
+ `whenToUse`, and optional `## Do` / `## Don't` / `## Accessibility` bullet sections
158
+ map to their fields — so guidelines are authored in the same file the Storybook
159
+ sidebar shows, with JSX/import scaffolding stripped.
160
+ - 48 components gain guidelines immediately; `get-guidelines` and `uni://guidelines/*`
161
+ now answer with real when-to-use guidance (including the canonical selector forms
162
+ from the 6.0 unification).
163
+ - MDX↔component matching: shared basename first (`tabs.mdx` → `tabs.component.ts`),
164
+ same-directory fallback for group docs.
165
+
166
+ ### Patch Changes
167
+
168
+ - [`4bfb057`](https://github.com/uni-design-system/uni/commit/4bfb057c55651c0375e7f35dd6f804e8d5c69e88) Thanks [@gaenglish](https://github.com/gaenglish)! - Canonical MDX docs structure across the entire library
169
+ - Component docs pages now follow one flow (spec in AGENTS.md): imports → Overview →
170
+ Usage (the compact playground: story + source + knobs) → named variation examples →
171
+ **Theme options** → Accessibility → Do/Don't. Property/API/Methods/Events tables are
172
+ retired — the playground's controls are the API reference.
173
+ - New `ThemeOptions` docs block renders a component's per-theme option tokens live from
174
+ the active Storybook theme (with color swatches), distinguishing per-theme options
175
+ from per-instance inputs; data-table's raw `ThemeDataBlock` dump is replaced.
176
+ - All ~55 component pages conform: the 7 form-control pages (200–390 lines of legacy
177
+ API tables) rewritten; empty Overviews authored (card, tag, icon-button, scroll-area,
178
+ expand-area, data-table); accessibility bullets added across navigation, feedback,
179
+ and form components.
180
+ - The MCP index now carries when-to-use guidance for 55 of 70 components (was 41) and
181
+ accessibility guidance for 36 (was 21) — the remainder are subcomponents documented
182
+ on their parent pages and internal directives.
183
+
184
+ ## 4.2.0
185
+
186
+ ### Minor Changes
187
+
188
+ - [`fea0b2e`](https://github.com/uni-design-system/uni/commit/fea0b2e78da327f3acea144958af2d0dbbefb699) Thanks [@gaenglish](https://github.com/gaenglish)! - Fix invisible icons; icons become first-class theme primitives
189
+ - **Bug**: `uni-icon` resolves icons from `theme.icons`, but every theme shipped
190
+ `icons: {}` — the icon record was never wired in, so all icons (dialog close, button
191
+ spinner, search/clear affordances) rendered nothing.
192
+ - **Fix + pattern**: the default icon set now lives in core (`BaseIcons`, in
193
+ `concepts/iconography`) and `createTheme` merges a theme's `icons` over it — themes
194
+ can override or add icons under any name (inline SVG data URIs, masked with
195
+ `currentColor` so they recolor with the theme). The angular `icons` record re-exports
196
+ `BaseIcons` (deprecated).
197
+ - `uni-icon` also sets the standard `mask-image` (was webkit-only, so icons were
198
+ invisible in Firefox regardless) and renders nothing for unknown names instead of a
199
+ broken `url("undefined")`.
200
+ - The emitted `uni-theme.ts` gains an editable `icons` section, and the MCP's
201
+ `generate-uni-theme` guidance instructs agents: never inline SVG in components —
202
+ define an icon once in the theme's `icons` map and render it via `<uni-icon>`.
203
+
204
+ ## 4.1.2
205
+
206
+ ### Patch Changes
207
+
208
+ - [`ffb9692`](https://github.com/uni-design-system/uni/commit/ffb9692b6b6000a04f0ec3fd06b196818b5cf1c8) Thanks [@gaenglish](https://github.com/gaenglish)! - Fix published index losing its Storybook examples, and keep the index in sync
209
+ - `uni-mcp@4.1.x` shipped with **0 examples**: the package build regenerated the index in
210
+ CI, where `storybook-static` (gitignored) doesn't exist, silently overwriting the
211
+ committed 107-example index before bundling. `build` is now `tsup` only — the committed
212
+ `uni-index.json` is the single source of truth and is bundled as-is.
213
+ - The index is regenerated once per release instead: the changesets `version` step
214
+ (`pnpm version-packages`) builds Storybook and reruns `build-index` after the version
215
+ bump, so the refreshed index lands reviewably in the Version Packages PR.
216
+ - `build-index` now fails loudly when it finds zero examples, so an example-less index
217
+ can never ship silently again.
218
+ - Index refreshed to v5.1.0: includes the new component option tokens
219
+ (`button.behavior.borderRadius`/`typeface`, `card.behavior.borderRadius`), the nine
220
+ Theme Builder presets' generation updates, and all 107 examples.
221
+
222
+ ## 4.1.1
223
+
224
+ ### Patch Changes
225
+
226
+ - [`f2951db`](https://github.com/uni-design-system/uni/commit/f2951db7f6267f29b56d127151ff843d445c40a4) Thanks [@gaenglish](https://github.com/gaenglish)! - Fix `ng add` against real published packages (found by fresh `ng new` e2e):
227
+ - The schematic bundle is CJS, but ng-packagr stamps `"type": "module"` into the
228
+ published package.json, so Node loaded it as ESM and the CLI reported "no ng add
229
+ actions". A nested `schematics/package.json` (`"type": "commonjs"`) scopes the
230
+ bundle back to CJS.
231
+ - The emitted `uni-theme.ts` used dot access on `Colors` (which has an index
232
+ signature), failing under `ng new`'s strict `noPropertyAccessFromIndexSignature`.
233
+ The emitter (and the MCP tool's guidance) now uses bracket access throughout.
234
+ - `uni-angular`'s peer range on `uni-core` is now `workspace:^` (publishes as `^5.x`)
235
+ instead of `workspace:*` (published as an exact pin). Alongside changesets'
236
+ `onlyUpdatePeerDependentsWhenOutOfRange`, this stops minor releases from being
237
+ inflated to majors by the peer-dependents rule — the cause of the 4.0.0 and 5.0.0
238
+ version jumps.
239
+
240
+ ## 4.1.0
241
+
242
+ ### Minor Changes
243
+
244
+ - [`f7f0bdd`](https://github.com/uni-design-system/uni/commit/f7f0bdddfac855955e022a852c2bfdccf8013a7b) Thanks [@gaenglish](https://github.com/gaenglish)! - OKLCH theme generation engine (`concepts/generation`)
245
+ - New `generateThemes(input)` / `generateUniThemes(input)`: brand seed(s) in, complete
246
+ WCAG-AA light+dark `Colors` pair out, with a machine-readable `ContrastReport`
247
+ (110 checked pairs per theme pair). Pure and deterministic.
248
+ - All palette math moved from HSL to perceptual OKLCH: uniform lightness slots across
249
+ hues, per-category chroma model (`CategoryChroma`), dark-mode accent chroma decoupling
250
+ (C ≤ 0.16), and a contrast guard-rail that adjusts lightness only — never hue.
251
+ - Brand colors ride as soft `targets` (kept verbatim when already AA, lightness-adjusted
252
+ when not) alongside the existing hard `brand` pins; accepted by `generatePalette`,
253
+ `createThemeFromPalette`, and Angular's `BrandPaletteConfig`.
254
+ - Semantic inks re-tuned per role: error 27°/C 0.20, warn 55°/C 0.18 (rotated off amber —
255
+ dark yellow reads brown), success 152°/C 0.16.
256
+ - `createTheme` accepts optional `radii`/`shadows` overrides; `ShapeRadii` presets
257
+ (`sharp` / `modern` / `playful`) emitted via the `shape` generation input.
258
+ - Theme Builder ships nine curated AA-clean presets built on soft targets.
259
+ - Deprecated (thin wrappers/tables retained): `uniColor`, `randomRangeValue`,
260
+ `CategorySaturation`, `CategoryLightness`. `schemeHues` moved to `color.utils`.
261
+ - `createTheme` deep-merges optional `borders` and `components` overrides over its
262
+ derived defaults — themes can define custom named primitives and rewire per-component
263
+ options without restating untouched sections.
264
+ - New `emitThemeFile()` renders a static `uni-theme.ts` — literal colors, visible border
265
+ primitives, sparse component overrides — the editable source of truth; the engine
266
+ never ships to the browser.
267
+ - New `ng add @uni-design-system/uni-angular` schematic: installs the peer set, writes
268
+ the generated theme file, registers `UNI_THEMES` in `app.config.ts`, adds typeface
269
+ links, scaffolds a themed smoke test, and prints the contrast summary.
270
+ - New MCP tool `generate-uni-theme`: returns the static theme file content, provider
271
+ snippet, and contrast report, with agent guidance to edit the file for restyling.
272
+ - `uni-core` gains its first Vitest suite, including a 1,080-seed contrast property
273
+ corpus with zero tolerance in both modes; the schematic gets its own spec suite.
package/README.md CHANGED
@@ -84,7 +84,9 @@ tokens, never by hardcoding hex values in components.
84
84
  | `generate-uni-theme` | complete WCAG-AA light+dark `uni-theme.ts` from brand hex color(s), with vibe/scheme/shape options, provider registration snippet, and contrast report |
85
85
  | `generate-runtime-theme` | the same generated theme as validated JSON for `registerTheme()` — applies immediately, no file, no rebuild |
86
86
  | `get-runtime-theme` | a theme that ships with Uni (`LightTheme`, `DarkTheme`) as a registerable `UniTheme` |
87
+ | `export-dtcg-tokens` | a built-in theme's color/radius/spacing scales as W3C DTCG JSON (Style Dictionary compatible) |
87
88
  | `create-icon-tokens` | convert raw SVG into `currentColor`-masked theme icon tokens |
89
+ | `get-changelog` | release notes per package/version — how a coding agent answers "what changed since the version I have installed" |
88
90
  | `search` | keyword search across components, tokens, themes, guidelines |
89
91
 
90
92
  ### Which theme tool?
@@ -104,7 +106,16 @@ them on registration; outside Angular, call `hydrateTheme()` from uni-core.
104
106
  Resources: `uni://meta`, `uni://components/{id}`, `uni://tokens/{id}`,
105
107
  `uni://themes/{id}`, `uni://guidelines/{id}`.
106
108
 
107
- ## Remote endpoint (Streamable HTTP, hosted on Render)
109
+ ## Hosted endpoint (currently dormant)
110
+
111
+ > **Status:** no hosted deployment is currently running — the stdio server via
112
+ > `npx` (Getting started above) is the canonical way to use this package. The
113
+ > HTTP mode below is kept, documented, and deployable (repo-root
114
+ > [`render.yaml`](../../render.yaml)) for when a consumer that can't spawn
115
+ > processes appears: browser-based MCP clients (e.g. claude.ai custom
116
+ > connectors) or apps fetching theme JSON by URL. stdio also has the property
117
+ > a shared endpoint can't offer: pin the package version and answers match the
118
+ > Uni release you actually have installed.
108
119
 
109
120
  The same server core runs behind HTTP for a shared, always-current team
110
121
  endpoint — useful when you'd rather not run node processes per client.
@@ -119,17 +130,18 @@ speaking MCP. They are public, read-only and CORS-enabled so a browser can
119
130
  fetch them directly; `/mcp` stays token-guarded and same-origin.
120
131
 
121
132
  ```ts
122
- const { themes } = await fetch('https://uni-mcp.onrender.com/themes/DarkTheme.json').then((r) => r.json());
133
+ // When a deployment is live, replace <host> with its origin:
134
+ const { themes } = await fetch('https://<host>/themes/DarkTheme.json').then((r) => r.json());
123
135
  themeService.registerTheme(themes[0].theme, { select: true });
124
136
  ```
125
137
 
126
- Client config:
138
+ Client config (when deployed):
127
139
 
128
140
  ```jsonc
129
141
  {
130
142
  "mcpServers": {
131
143
  "uni": {
132
- "url": "https://uni-mcp.onrender.com/mcp",
144
+ "url": "https://<host>/mcp",
133
145
  "headers": { "Authorization": "Bearer <UNI_MCP_TOKEN>" }
134
146
  }
135
147
  }