@unovis/mcp 1.7.0-mcp.2 → 1.7.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 (40) hide show
  1. package/dist/codegen/index.js +23 -8
  2. package/dist/codegen/index.js.map +1 -1
  3. package/dist/recipes/bar.d.ts +1 -1
  4. package/dist/recipes/bar.js +4 -1
  5. package/dist/recipes/bar.js.map +1 -1
  6. package/dist/recipes/shared.js +1 -1
  7. package/dist/recipes/shared.js.map +1 -1
  8. package/dist/render/materialize.js +25 -8
  9. package/dist/render/materialize.js.map +1 -1
  10. package/dist/render/spec-schema.d.ts +3 -3
  11. package/dist/render/spec-schema.js +2 -2
  12. package/dist/render/spec-schema.js.map +1 -1
  13. package/dist/render/spec.d.ts +9 -4
  14. package/dist/render/spec.js +8 -3
  15. package/dist/render/spec.js.map +1 -1
  16. package/dist/server.js +12 -3
  17. package/dist/server.js.map +1 -1
  18. package/dist/tools/register.d.ts +11 -1
  19. package/dist/tools/register.js +70 -12
  20. package/dist/tools/register.js.map +1 -1
  21. package/dist/widget/bundle.js +423 -426
  22. package/dist/widget/bundle.meta.json +2 -2
  23. package/dist/widget/bundle.standard.js +215 -218
  24. package/dist/widget/entry.js +79 -2
  25. package/dist/widget/entry.js.map +1 -1
  26. package/dist/widget/events.js +3 -1
  27. package/dist/widget/events.js.map +1 -1
  28. package/dist/widget/unpack.js +1 -1
  29. package/dist/widget/unpack.js.map +1 -1
  30. package/docs/README.md +1 -1
  31. package/docs/architecture.md +12 -89
  32. package/docs/chart-spec.md +15 -12
  33. package/docs/interactive.md +24 -12
  34. package/docs/output-types.md +8 -9
  35. package/docs/tools.md +1 -1
  36. package/docs/troubleshooting.md +13 -44
  37. package/docs/webview.md +4 -6
  38. package/package.json +5 -4
  39. package/schema/{chart-spec.v1.baseline.json → chart-spec.v0.1.baseline.json} +5 -5
  40. package/schema/{chart-spec.v1.json → chart-spec.v0.1.json} +5 -5
@@ -29,21 +29,10 @@ used for measuring must match the font used for drawing.
29
29
  ## The client rejects the whole tool list
30
30
 
31
31
  If a client refuses to start with something like `input_schema: JSON schema is
32
- invalid. It must match JSON Schema draft 2020-12`, a tool schema is using a
33
- construct that only exists in draft-07. One bad schema takes down every tool,
34
- not just its own, because the tool list is validated as a unit.
35
-
36
- The SDK converts Zod v3 through `zod-to-json-schema`, which targets draft-07.
37
- Most of that output is valid 2020-12 as well; two things are not, and both are
38
- enforced by `test/tool-schemas.test.ts`:
39
-
40
- - **`z.tuple([a, b])`** lowers to the draft-07 array form of `items`, where
41
- 2020-12 requires `items` to be a schema. Use `z.array(a).length(2)`.
42
- - **Reusing one schema instance** inside a tool makes the converter emit
43
- `$ref: #/properties/…`. That's valid, but clients that flatten refs drop the
44
- subschema, leaving a property with no type — an array argument then arrives as
45
- a string. Shared leaves (`fieldName()`, `hexColor()`) are factories so every
46
- use site gets a fresh instance.
32
+ invalid. It must match JSON Schema draft 2020-12`, one tool schema is invalid —
33
+ and it takes down every tool, not just its own, because clients validate the
34
+ tool list as a unit. Released versions guard against this, so if you see it,
35
+ please report it with the client name and the full error message.
47
36
 
48
37
  ## A chart is blank
49
38
 
@@ -86,16 +75,12 @@ it would mean `outputType: "html"` silently producing a broken chart.
86
75
  > `@unovis/dagre-layout` ≥ 0.8.8-3. Earlier releases shipped extensionless ESM
87
76
  > imports that no standards-compliant Node loader could resolve.
88
77
 
89
- ## The `tsx` loader can't load graph layouts
78
+ ## Graph charts time out under the `tsx` loader
90
79
 
91
- Running this package's **source** through `tsx` fails on the dynamic imports
92
- inside Unovis's graph layouts: the layout promise never settles, so the render
93
- times out after 20 seconds with "component layout never completed". Plain Node
94
- and vitest both work.
95
-
96
- That's why `pnpm dev` and `pnpm samples` build first and run the compiled
97
- output. `pnpm dev:tsx` is available for fast iteration, with the caveat that
98
- graph charts will not render under it.
80
+ Running your script with `tsx` breaks the dynamic imports inside Unovis's
81
+ graph layouts: the layout promise never settles, so a graph render times out
82
+ after 20 seconds with "component layout never completed". Every other chart
83
+ type is unaffected. Compile first and run plain Node (vitest also works).
99
84
 
100
85
  ## PNG has a transparent background
101
86
 
@@ -110,8 +95,9 @@ The `png` output type does this for you.
110
95
 
111
96
  ## Interactive output doesn't render in my client
112
97
 
113
- `outputType: "interactive"` depends on MCP UI resource support, which is
114
- experimental and unevenly implemented. Use `outputType: "html"` — it works
98
+ `outputType: "interactive"` depends on the MCP Apps extension
99
+ (`io.modelcontextprotocol/ui`) — official since protocol revision 2026-07-28,
100
+ but host adoption is still uneven. Use `outputType: "html"` — it works
115
101
  everywhere because it's just a file.
116
102
 
117
103
  ## Large datasets
@@ -139,22 +125,5 @@ that safe. If you need byte-stable output (snapshot tests), pass a constant
139
125
  ## Something renders differently than in the browser
140
126
 
141
127
  Report it. The headless environment reimplements browser geometry, so a mismatch
142
- is a real bug in this package (or occasionally in Unovis, where several have
143
- already been found and fixed upstream). Useful details: the chart spec, the
128
+ is a real bug in this package. Useful details: the chart spec, the
144
129
  output, and what you expected.
145
-
146
- ## What the tests don't cover
147
-
148
- Worth knowing before you trust a green suite:
149
-
150
- - **Touch devices.** The Chromium smoke lane (`pnpm test:browser`) covers real
151
- layout, paint, mouse hover and clicks — added after a crosshair bug passed
152
- every jsdom test — but taps, drags and tooltip-linger semantics on actual
153
- touch hardware remain untested.
154
- - **MCP UI widget rendering** in an actual client.
155
- - **Pixel baselines are light-theme.** Visual regression rasterizes every
156
- fixture against committed baselines; dark theme is exercised structurally and
157
- in `pnpm samples`, not pixel-compared.
158
- - **Non-`ts` code targets aren't compiled.** The vanilla-TypeScript output is
159
- type-checked against `@unovis/ts`; the JSX and template targets are checked
160
- structurally only.
package/docs/webview.md CHANGED
@@ -72,14 +72,12 @@ app builds.
72
72
  ## Security posture
73
73
 
74
74
  The bundle contains no `fetch`, `XMLHttpRequest`, `WebSocket` or dynamic
75
- imports — asserted by a test on the built artifact — so the WebView needs no
76
- network access at all. Combined with local-asset loading, the chart surface
77
- adds zero egress.
75
+ imports, so the WebView needs no network access at all. Combined with
76
+ local-asset loading, the chart surface adds zero egress.
78
77
 
79
78
  ## Touch behavior
80
79
 
81
80
  Interaction events (`events: true`) report taps the same way clicks are
82
81
  reported in a browser. Two knowns: lines and areas have no per-datum element
83
- (the crosshair is their readout — it tracks touch-drag), and Unovis binds
84
- user event handlers through a throttled pass, active within ~500ms of the
85
- render settling.
82
+ (the crosshair is their readout — it tracks touch-drag), and tap handlers
83
+ become active within ~500ms of the render settling.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unovis/mcp",
3
3
  "description": "MCP server that renders Unovis charts to SVG locally in Node — no browser, no remote services",
4
- "version": "1.7.0-mcp.2",
4
+ "version": "1.7.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",
@@ -42,7 +42,7 @@
42
42
  "default": "./dist/render/spec.js"
43
43
  },
44
44
  "./package.json": "./package.json",
45
- "./chart-spec.schema.json": "./schema/chart-spec.v1.json"
45
+ "./chart-spec.schema.json": "./schema/chart-spec.v0.1.json"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=20"
@@ -57,10 +57,11 @@
57
57
  "dependencies": {
58
58
  "@modelcontextprotocol/sdk": "^1.17.0",
59
59
  "zod": "^3.25.0",
60
- "@unovis/ssr": "1.7.0-mcp.2",
61
- "@unovis/ts": "1.7.0-mcp.2"
60
+ "@unovis/ssr": "1.7.0",
61
+ "@unovis/ts": "1.7.0"
62
62
  },
63
63
  "devDependencies": {
64
+ "@modelcontextprotocol/ext-apps": "^1.7.5",
64
65
  "@types/jsdom": "^21.1.7",
65
66
  "@types/node": "^20.17.0",
66
67
  "@types/pngjs": "^6.0.5",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://unovis.dev/schema/chart-spec.v1.json",
3
+ "$id": "https://unovis.dev/schema/chart-spec.v0.1.json",
4
4
  "title": "Unovis ChartSpec",
5
- "description": "The @unovis/mcp chart spec contract, version 1. Additions are non-breaking; the version moves only on breaking changes.",
5
+ "description": "The @unovis/mcp chart spec contract, version 0.1. While the major is 0, breaking changes bump the minor; from 1.0 on, additions are non-breaking and only the major breaks.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "specVersion": {
9
- "type": "integer",
10
- "minimum": 1,
11
- "description": "ChartSpec contract version (see SPEC_VERSION); additions are non-breaking, the integer moves only on breaking changes"
9
+ "type": "string",
10
+ "pattern": "^\\d+\\.\\d+$",
11
+ "description": "ChartSpec contract version as major.minor (see SPEC_VERSION). While the major is 0, breaking changes bump the minor; from 1.0 on, minors are additive and only the major breaks"
12
12
  },
13
13
  "container": {
14
14
  "type": "string",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://unovis.dev/schema/chart-spec.v1.json",
3
+ "$id": "https://unovis.dev/schema/chart-spec.v0.1.json",
4
4
  "title": "Unovis ChartSpec",
5
- "description": "The @unovis/mcp chart spec contract, version 1. Additions are non-breaking; the version moves only on breaking changes.",
5
+ "description": "The @unovis/mcp chart spec contract, version 0.1. While the major is 0, breaking changes bump the minor; from 1.0 on, additions are non-breaking and only the major breaks.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "specVersion": {
9
- "type": "integer",
10
- "minimum": 1,
11
- "description": "ChartSpec contract version (see SPEC_VERSION); additions are non-breaking, the integer moves only on breaking changes"
9
+ "type": "string",
10
+ "pattern": "^\\d+\\.\\d+$",
11
+ "description": "ChartSpec contract version as major.minor (see SPEC_VERSION). While the major is 0, breaking changes bump the minor; from 1.0 on, minors are additive and only the major breaks"
12
12
  },
13
13
  "container": {
14
14
  "type": "string",