@actioneer/ads-mcp 0.6.0 → 0.8.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 (3) hide show
  1. package/manifest.json +1719 -2831
  2. package/package.json +2 -2
  3. package/src/tools.mjs +17 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actioneer/ads-mcp",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "ADS MCP server: lets an agent in Claude Code / Cursor discover and import the Actioneer Design System",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@actioneer/ads-lint": "^0.2.0",
27
- "@actioneer/ads-manifest": "^0.2.0"
27
+ "@actioneer/ads-manifest": "^0.3.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@actioneer/ads": "*",
package/src/tools.mjs CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  searchComponents,
9
9
  getComponent,
10
10
  getToken,
11
+ getScale,
11
12
  getPrinciples,
12
13
  getUiGrammar,
13
14
  getDesignGraph,
@@ -50,7 +51,10 @@ export function createTools({ manifest }) {
50
51
  name: "get_token",
51
52
  description:
52
53
  "Get the ADS semantic token(s) for a role or purpose (e.g. 'brand', 'muted-foreground', " +
53
- "'bg-danger', 'primary text'). Reference the returned token/utilities instead of a raw " +
54
+ "'bg-danger', 'primary text'). Also resolves the non-colour scales: type roles " +
55
+ "('body', 'label'), radius steps ('md'), the numbered shadow ladder ('shadow-300'), " +
56
+ "and the named motion presets ('springDialog') with their spring values and purpose. " +
57
+ "Reference the returned token/utilities instead of a raw " +
54
58
  "color literal — ads-lint rejects literals.",
55
59
  inputSchema: {
56
60
  type: "object",
@@ -155,10 +159,18 @@ export function createTools({ manifest }) {
155
159
 
156
160
  get_token: (args) => {
157
161
  const tokens = getToken(manifest, args.role ?? "");
158
- if (tokens.length === 0) {
159
- return text(`No ADS token matches "${args.role}". Use a semantic role like 'brand' or 'muted-foreground'.`, true);
160
- }
161
- return json(tokens);
162
+ if (tokens.length > 0) return json(tokens);
163
+ // Colour roles miss try the non-colour scales before giving up, so
164
+ // "shadow-300", "springDialog", "radius" and "body" all resolve. Two
165
+ // principles cite those values; a dead end here makes the rule unusable.
166
+ const scales = getScale(manifest, args.role ?? "");
167
+ if (scales.length > 0) return json(scales);
168
+ return text(
169
+ `No ADS token or scale matches "${args.role}". Try a colour role ('brand', ` +
170
+ `'muted-foreground'), a type role ('body'), a radius step ('md'), a shadow ` +
171
+ `('shadow-300'), or a motion preset ('springDialog').`,
172
+ true
173
+ );
162
174
  },
163
175
 
164
176
  get_principles: (args) => {