@treeui/mcp 0.4.0 → 0.5.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.
- package/README.md +27 -3
- package/dist/{chunk-K6NB25EB.js → chunk-TRJAXZUC.js} +1547 -52
- package/dist/cli.cjs +1545 -52
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1888 -103
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +295 -4
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -90,6 +90,15 @@ interface TreeuiSetupEntry {
|
|
|
90
90
|
commonCompositions: string[];
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
+
interface TreeuiTokenEntry {
|
|
94
|
+
cssVar: string;
|
|
95
|
+
path: string;
|
|
96
|
+
value: string;
|
|
97
|
+
category: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
/** Per-theme values for tokens that change with `[data-tree-theme]`. */
|
|
100
|
+
themeValues?: Record<string, string>;
|
|
101
|
+
}
|
|
93
102
|
interface TreeuiCatalog {
|
|
94
103
|
generatedAt: string;
|
|
95
104
|
packageName: string;
|
|
@@ -98,6 +107,7 @@ interface TreeuiCatalog {
|
|
|
98
107
|
recipes: TreeuiRecipe[];
|
|
99
108
|
setup: TreeuiSetupEntry;
|
|
100
109
|
components: TreeuiComponentEntry[];
|
|
110
|
+
tokens: TreeuiTokenEntry[];
|
|
101
111
|
}
|
|
102
112
|
interface TreeuiSearchResult {
|
|
103
113
|
component: TreeuiComponentEntry;
|
|
@@ -108,20 +118,33 @@ interface TreeuiRecipeSearchResult {
|
|
|
108
118
|
recipe: TreeuiRecipe;
|
|
109
119
|
score: number;
|
|
110
120
|
}
|
|
121
|
+
interface TreeuiTokenSearchResult {
|
|
122
|
+
token: TreeuiTokenEntry;
|
|
123
|
+
score: number;
|
|
124
|
+
}
|
|
111
125
|
|
|
112
126
|
declare const catalog: TreeuiCatalog;
|
|
113
127
|
declare const findComponent: (name: string) => TreeuiComponentEntry | undefined;
|
|
114
128
|
declare const searchComponents: (query: string, limit?: number) => TreeuiSearchResult[];
|
|
115
129
|
declare const recommendComponents: (task: string, limit?: number) => TreeuiSearchResult[];
|
|
116
130
|
declare const searchRecipes: (query: string, limit?: number) => TreeuiRecipeSearchResult[];
|
|
131
|
+
declare const searchTokens: (query: string, limit?: number) => TreeuiTokenSearchResult[];
|
|
117
132
|
declare const formatComponentSummary: (component: TreeuiComponentEntry) => string;
|
|
118
133
|
declare const formatSearchResults: (results: TreeuiSearchResult[]) => string;
|
|
119
134
|
declare const formatRecipeResults: (results: TreeuiRecipeSearchResult[]) => string;
|
|
135
|
+
declare const formatTokenResults: (results: TreeuiTokenSearchResult[]) => string;
|
|
120
136
|
declare const formatSetupGuide: (componentName?: string) => string;
|
|
121
137
|
|
|
122
138
|
declare const buildCatalogFromRepo: (repoRoot: string) => TreeuiCatalog;
|
|
123
139
|
declare const getRepoRootFromPackageRoot: (packageRoot: string) => string;
|
|
124
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Flatten the design tokens into catalog entries. Foundation tokens carry a
|
|
143
|
+
* single value; themed tokens carry one value per theme plus the default-theme
|
|
144
|
+
* value on `value`.
|
|
145
|
+
*/
|
|
146
|
+
declare const buildTokenEntries: () => TreeuiTokenEntry[];
|
|
147
|
+
|
|
125
148
|
declare const createTreeuiMcpServer: () => Server<{
|
|
126
149
|
method: string;
|
|
127
150
|
params?: {
|
|
@@ -157,4 +180,4 @@ declare const createTreeuiMcpServer: () => Server<{
|
|
|
157
180
|
} | undefined;
|
|
158
181
|
}>;
|
|
159
182
|
|
|
160
|
-
export { type TreeuiCatalog, type TreeuiCatalogField, type TreeuiComponentEntry, type TreeuiDecisionGuide, type TreeuiRecipe, type TreeuiSearchResult, type TreeuiSetupEntry, buildCatalogFromRepo, catalog, createTreeuiMcpServer, findComponent, formatComponentSummary, formatRecipeResults, formatSearchResults, formatSetupGuide, getRepoRootFromPackageRoot, recommendComponents, searchComponents, searchRecipes };
|
|
183
|
+
export { type TreeuiCatalog, type TreeuiCatalogField, type TreeuiComponentEntry, type TreeuiDecisionGuide, type TreeuiRecipe, type TreeuiSearchResult, type TreeuiSetupEntry, type TreeuiTokenEntry, type TreeuiTokenSearchResult, buildCatalogFromRepo, buildTokenEntries, catalog, createTreeuiMcpServer, findComponent, formatComponentSummary, formatRecipeResults, formatSearchResults, formatSetupGuide, formatTokenResults, getRepoRootFromPackageRoot, recommendComponents, searchComponents, searchRecipes, searchTokens };
|
package/dist/index.d.ts
CHANGED
|
@@ -90,6 +90,15 @@ interface TreeuiSetupEntry {
|
|
|
90
90
|
commonCompositions: string[];
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
+
interface TreeuiTokenEntry {
|
|
94
|
+
cssVar: string;
|
|
95
|
+
path: string;
|
|
96
|
+
value: string;
|
|
97
|
+
category: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
/** Per-theme values for tokens that change with `[data-tree-theme]`. */
|
|
100
|
+
themeValues?: Record<string, string>;
|
|
101
|
+
}
|
|
93
102
|
interface TreeuiCatalog {
|
|
94
103
|
generatedAt: string;
|
|
95
104
|
packageName: string;
|
|
@@ -98,6 +107,7 @@ interface TreeuiCatalog {
|
|
|
98
107
|
recipes: TreeuiRecipe[];
|
|
99
108
|
setup: TreeuiSetupEntry;
|
|
100
109
|
components: TreeuiComponentEntry[];
|
|
110
|
+
tokens: TreeuiTokenEntry[];
|
|
101
111
|
}
|
|
102
112
|
interface TreeuiSearchResult {
|
|
103
113
|
component: TreeuiComponentEntry;
|
|
@@ -108,20 +118,33 @@ interface TreeuiRecipeSearchResult {
|
|
|
108
118
|
recipe: TreeuiRecipe;
|
|
109
119
|
score: number;
|
|
110
120
|
}
|
|
121
|
+
interface TreeuiTokenSearchResult {
|
|
122
|
+
token: TreeuiTokenEntry;
|
|
123
|
+
score: number;
|
|
124
|
+
}
|
|
111
125
|
|
|
112
126
|
declare const catalog: TreeuiCatalog;
|
|
113
127
|
declare const findComponent: (name: string) => TreeuiComponentEntry | undefined;
|
|
114
128
|
declare const searchComponents: (query: string, limit?: number) => TreeuiSearchResult[];
|
|
115
129
|
declare const recommendComponents: (task: string, limit?: number) => TreeuiSearchResult[];
|
|
116
130
|
declare const searchRecipes: (query: string, limit?: number) => TreeuiRecipeSearchResult[];
|
|
131
|
+
declare const searchTokens: (query: string, limit?: number) => TreeuiTokenSearchResult[];
|
|
117
132
|
declare const formatComponentSummary: (component: TreeuiComponentEntry) => string;
|
|
118
133
|
declare const formatSearchResults: (results: TreeuiSearchResult[]) => string;
|
|
119
134
|
declare const formatRecipeResults: (results: TreeuiRecipeSearchResult[]) => string;
|
|
135
|
+
declare const formatTokenResults: (results: TreeuiTokenSearchResult[]) => string;
|
|
120
136
|
declare const formatSetupGuide: (componentName?: string) => string;
|
|
121
137
|
|
|
122
138
|
declare const buildCatalogFromRepo: (repoRoot: string) => TreeuiCatalog;
|
|
123
139
|
declare const getRepoRootFromPackageRoot: (packageRoot: string) => string;
|
|
124
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Flatten the design tokens into catalog entries. Foundation tokens carry a
|
|
143
|
+
* single value; themed tokens carry one value per theme plus the default-theme
|
|
144
|
+
* value on `value`.
|
|
145
|
+
*/
|
|
146
|
+
declare const buildTokenEntries: () => TreeuiTokenEntry[];
|
|
147
|
+
|
|
125
148
|
declare const createTreeuiMcpServer: () => Server<{
|
|
126
149
|
method: string;
|
|
127
150
|
params?: {
|
|
@@ -157,4 +180,4 @@ declare const createTreeuiMcpServer: () => Server<{
|
|
|
157
180
|
} | undefined;
|
|
158
181
|
}>;
|
|
159
182
|
|
|
160
|
-
export { type TreeuiCatalog, type TreeuiCatalogField, type TreeuiComponentEntry, type TreeuiDecisionGuide, type TreeuiRecipe, type TreeuiSearchResult, type TreeuiSetupEntry, buildCatalogFromRepo, catalog, createTreeuiMcpServer, findComponent, formatComponentSummary, formatRecipeResults, formatSearchResults, formatSetupGuide, getRepoRootFromPackageRoot, recommendComponents, searchComponents, searchRecipes };
|
|
183
|
+
export { type TreeuiCatalog, type TreeuiCatalogField, type TreeuiComponentEntry, type TreeuiDecisionGuide, type TreeuiRecipe, type TreeuiSearchResult, type TreeuiSetupEntry, type TreeuiTokenEntry, type TreeuiTokenSearchResult, buildCatalogFromRepo, buildTokenEntries, catalog, createTreeuiMcpServer, findComponent, formatComponentSummary, formatRecipeResults, formatSearchResults, formatSetupGuide, formatTokenResults, getRepoRootFromPackageRoot, recommendComponents, searchComponents, searchRecipes, searchTokens };
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,302 @@ import {
|
|
|
6
6
|
formatRecipeResults,
|
|
7
7
|
formatSearchResults,
|
|
8
8
|
formatSetupGuide,
|
|
9
|
+
formatTokenResults,
|
|
9
10
|
recommendComponents,
|
|
10
11
|
searchComponents,
|
|
11
|
-
searchRecipes
|
|
12
|
-
|
|
12
|
+
searchRecipes,
|
|
13
|
+
searchTokens
|
|
14
|
+
} from "./chunk-TRJAXZUC.js";
|
|
13
15
|
|
|
14
16
|
// src/catalog-source.ts
|
|
15
17
|
import fs from "fs";
|
|
16
18
|
import path from "path";
|
|
17
19
|
import { parseAllDocuments } from "yaml";
|
|
20
|
+
|
|
21
|
+
// ../tokens/src/tokens.ts
|
|
22
|
+
var treeTokens = {
|
|
23
|
+
font: {
|
|
24
|
+
family: {
|
|
25
|
+
sans: "'Google Sans Flex', 'Segoe UI', sans-serif",
|
|
26
|
+
mono: "'Google Sans Code', 'SFMono-Regular', monospace"
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
xs: "0.6875rem",
|
|
30
|
+
sm: "0.8125rem",
|
|
31
|
+
md: "0.9375rem",
|
|
32
|
+
base: "0.9375rem",
|
|
33
|
+
lg: "1.125rem",
|
|
34
|
+
xl: "1.375rem",
|
|
35
|
+
"2xl": "1.375rem",
|
|
36
|
+
"3xl": "1.75rem",
|
|
37
|
+
"4xl": "2.25rem",
|
|
38
|
+
"5xl": "3rem"
|
|
39
|
+
},
|
|
40
|
+
weight: {
|
|
41
|
+
regular: "400",
|
|
42
|
+
medium: "500",
|
|
43
|
+
semibold: "600",
|
|
44
|
+
bold: "700",
|
|
45
|
+
extrabold: "800"
|
|
46
|
+
},
|
|
47
|
+
lineHeight: {
|
|
48
|
+
compact: "1.1",
|
|
49
|
+
ui: "1.15",
|
|
50
|
+
tight: "1.25",
|
|
51
|
+
heading: "1.3",
|
|
52
|
+
base: "1.5",
|
|
53
|
+
body: "1.6",
|
|
54
|
+
relaxed: "1.65"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
space: {
|
|
58
|
+
0: "0",
|
|
59
|
+
1: "0.25rem",
|
|
60
|
+
2: "0.5rem",
|
|
61
|
+
3: "0.75rem",
|
|
62
|
+
4: "1rem",
|
|
63
|
+
5: "1.25rem",
|
|
64
|
+
6: "1.5rem",
|
|
65
|
+
8: "2rem",
|
|
66
|
+
12: "3rem",
|
|
67
|
+
16: "4rem"
|
|
68
|
+
},
|
|
69
|
+
radius: {
|
|
70
|
+
sm: "0.375rem",
|
|
71
|
+
md: "0.625rem",
|
|
72
|
+
lg: "0.875rem",
|
|
73
|
+
pill: "999px"
|
|
74
|
+
},
|
|
75
|
+
shadow: {
|
|
76
|
+
xs: "0 1px 2px rgba(15, 23, 42, 0.06)",
|
|
77
|
+
sm: "0 6px 18px rgba(15, 23, 42, 0.08)",
|
|
78
|
+
md: "0 14px 34px rgba(15, 23, 42, 0.12)"
|
|
79
|
+
},
|
|
80
|
+
// Brand gradient for high-emphasis surfaces (e.g. the primary CTA).
|
|
81
|
+
// References the theme brand vars so it follows light/dark automatically;
|
|
82
|
+
// override `--tree-gradient-brand` to match a product's marketing gradient.
|
|
83
|
+
gradient: {
|
|
84
|
+
brand: "linear-gradient(135deg, var(--tree-color-brand-primary), var(--tree-color-brand-hover))"
|
|
85
|
+
},
|
|
86
|
+
border: {
|
|
87
|
+
width: {
|
|
88
|
+
subtle: "1px",
|
|
89
|
+
strong: "1.5px"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
motion: {
|
|
93
|
+
duration: {
|
|
94
|
+
fast: "100ms",
|
|
95
|
+
moderate: "200ms",
|
|
96
|
+
normal: "300ms",
|
|
97
|
+
slow: "400ms",
|
|
98
|
+
slower: "500ms"
|
|
99
|
+
},
|
|
100
|
+
easing: {
|
|
101
|
+
standard: "cubic-bezier(0.2, 0, 0, 1)",
|
|
102
|
+
easeOut: "cubic-bezier(0, 0, 0.2, 1)",
|
|
103
|
+
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
104
|
+
easeIn: "cubic-bezier(0.4, 0, 1, 1)"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
size: {
|
|
108
|
+
control: {
|
|
109
|
+
sm: "2rem",
|
|
110
|
+
md: "2.5rem",
|
|
111
|
+
lg: "3rem"
|
|
112
|
+
},
|
|
113
|
+
icon: {
|
|
114
|
+
sm: "1rem",
|
|
115
|
+
md: "1.25rem",
|
|
116
|
+
lg: "1.5rem",
|
|
117
|
+
xl: "2rem",
|
|
118
|
+
"2xl": "3rem"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
layout: {
|
|
122
|
+
grid: {
|
|
123
|
+
columns: "12",
|
|
124
|
+
base: "8px"
|
|
125
|
+
},
|
|
126
|
+
gutter: {
|
|
127
|
+
sm: "1rem",
|
|
128
|
+
md: "1.5rem"
|
|
129
|
+
},
|
|
130
|
+
margin: {
|
|
131
|
+
sm: "1.5rem",
|
|
132
|
+
md: "2rem",
|
|
133
|
+
lg: "3rem"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
z: {
|
|
137
|
+
base: "1",
|
|
138
|
+
dropdown: "1000",
|
|
139
|
+
popover: "1050",
|
|
140
|
+
sticky: "1100",
|
|
141
|
+
overlay: "1200",
|
|
142
|
+
modal: "1300",
|
|
143
|
+
toast: "1400"
|
|
144
|
+
},
|
|
145
|
+
breakpoint: {
|
|
146
|
+
sm: "640px",
|
|
147
|
+
md: "768px",
|
|
148
|
+
lg: "1024px",
|
|
149
|
+
xl: "1280px"
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var treeThemes = {
|
|
153
|
+
light: {
|
|
154
|
+
color: {
|
|
155
|
+
bg: {
|
|
156
|
+
primary: "#f6f8fa",
|
|
157
|
+
surface: "#ffffff",
|
|
158
|
+
subtle: "#eff2f5"
|
|
159
|
+
},
|
|
160
|
+
border: {
|
|
161
|
+
default: "#d0d7de",
|
|
162
|
+
strong: "#afb8c1"
|
|
163
|
+
},
|
|
164
|
+
text: {
|
|
165
|
+
primary: "#1f2328",
|
|
166
|
+
muted: "#59636e",
|
|
167
|
+
inverse: "#ffffff"
|
|
168
|
+
},
|
|
169
|
+
brand: {
|
|
170
|
+
primary: "#0969da",
|
|
171
|
+
hover: "#0550ae",
|
|
172
|
+
soft: "#ddf4ff",
|
|
173
|
+
contrast: "#ffffff"
|
|
174
|
+
},
|
|
175
|
+
status: {
|
|
176
|
+
success: "#1a7f37",
|
|
177
|
+
warning: "#9a6700",
|
|
178
|
+
error: "#d1242f",
|
|
179
|
+
info: "#0969da"
|
|
180
|
+
},
|
|
181
|
+
// Categorical data-viz palette. Fixed hue order (blue → orange), validated
|
|
182
|
+
// for CVD separation and contrast against the light surface. Assign in order;
|
|
183
|
+
// the components cycle after 8 as a fallback, but prefer folding a 9th+
|
|
184
|
+
// category into "Other".
|
|
185
|
+
chart: {
|
|
186
|
+
1: "#2a78d6",
|
|
187
|
+
2: "#1baf7a",
|
|
188
|
+
3: "#eda100",
|
|
189
|
+
4: "#008300",
|
|
190
|
+
5: "#4a3aa7",
|
|
191
|
+
6: "#e34948",
|
|
192
|
+
7: "#e87ba4",
|
|
193
|
+
8: "#eb6834"
|
|
194
|
+
},
|
|
195
|
+
overlay: "rgba(31, 35, 40, 0.5)",
|
|
196
|
+
"focus-ring": "rgba(9, 105, 218, 0.32)"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
dark: {
|
|
200
|
+
color: {
|
|
201
|
+
bg: {
|
|
202
|
+
primary: "#1c2128",
|
|
203
|
+
surface: "#22272e",
|
|
204
|
+
subtle: "#2d333b"
|
|
205
|
+
},
|
|
206
|
+
border: {
|
|
207
|
+
default: "#444c56",
|
|
208
|
+
strong: "#576270"
|
|
209
|
+
},
|
|
210
|
+
text: {
|
|
211
|
+
primary: "#adbac7",
|
|
212
|
+
muted: "#95a3b2",
|
|
213
|
+
inverse: "#1c2128"
|
|
214
|
+
},
|
|
215
|
+
brand: {
|
|
216
|
+
primary: "#539bf5",
|
|
217
|
+
hover: "#6cabf7",
|
|
218
|
+
soft: "#1a3453",
|
|
219
|
+
contrast: "#0a1a2f"
|
|
220
|
+
},
|
|
221
|
+
status: {
|
|
222
|
+
success: "#57ab5a",
|
|
223
|
+
warning: "#c69026",
|
|
224
|
+
error: "#f47067",
|
|
225
|
+
info: "#6cb6ff"
|
|
226
|
+
},
|
|
227
|
+
// Same hue order stepped for the dark surface (not a separate palette) —
|
|
228
|
+
// each step re-validated for the dark band and >= 3:1 on the dark surface.
|
|
229
|
+
chart: {
|
|
230
|
+
1: "#3987e5",
|
|
231
|
+
2: "#199e70",
|
|
232
|
+
3: "#c98500",
|
|
233
|
+
4: "#008300",
|
|
234
|
+
5: "#9085e9",
|
|
235
|
+
6: "#e66767",
|
|
236
|
+
7: "#d55181",
|
|
237
|
+
8: "#d95926"
|
|
238
|
+
},
|
|
239
|
+
overlay: "rgba(13, 17, 23, 0.6)",
|
|
240
|
+
"focus-ring": "rgba(83, 155, 245, 0.32)"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// src/token-source.ts
|
|
246
|
+
var toCssVariable = (path2) => `--tree-${path2.join("-")}`;
|
|
247
|
+
var flattenTokens = (record, path2 = []) => Object.entries(record).flatMap(([key, value]) => {
|
|
248
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
249
|
+
return [[[...path2, key], value]];
|
|
250
|
+
}
|
|
251
|
+
return flattenTokens(value, [...path2, key]);
|
|
252
|
+
});
|
|
253
|
+
var DEFAULT_THEME_NAME = "light";
|
|
254
|
+
var categoryDescriptions = {
|
|
255
|
+
font: "Typography token: font family, size, weight, or line height.",
|
|
256
|
+
space: "Spacing scale step for padding, margin, and gap.",
|
|
257
|
+
radius: "Corner radius scale step.",
|
|
258
|
+
shadow: "Elevation shadow.",
|
|
259
|
+
gradient: "Gradient composed from the themed brand variables.",
|
|
260
|
+
border: "Border width step.",
|
|
261
|
+
motion: "Motion duration or easing curve.",
|
|
262
|
+
size: "Control and icon sizing scale step.",
|
|
263
|
+
layout: "Layout grid, gutter, or margin measurement.",
|
|
264
|
+
z: "Stacking layer (z-index).",
|
|
265
|
+
breakpoint: "Responsive breakpoint width.",
|
|
266
|
+
color: "Themed semantic color, resolved per [data-tree-theme]."
|
|
267
|
+
};
|
|
268
|
+
var describeToken = (category) => categoryDescriptions[category] ?? "TreeUI design token.";
|
|
269
|
+
var buildTokenEntries = () => {
|
|
270
|
+
const foundation = flattenTokens(treeTokens).map(
|
|
271
|
+
([path2, value]) => ({
|
|
272
|
+
cssVar: toCssVariable(path2),
|
|
273
|
+
path: path2.join("."),
|
|
274
|
+
value: String(value),
|
|
275
|
+
category: path2[0],
|
|
276
|
+
description: describeToken(path2[0])
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
const themed = /* @__PURE__ */ new Map();
|
|
280
|
+
for (const [themeName, theme] of Object.entries(treeThemes)) {
|
|
281
|
+
for (const [path2, value] of flattenTokens(theme)) {
|
|
282
|
+
const cssVar = toCssVariable(path2);
|
|
283
|
+
const existing = themed.get(cssVar);
|
|
284
|
+
if (existing) {
|
|
285
|
+
existing.themeValues = { ...existing.themeValues, [themeName]: String(value) };
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
themed.set(cssVar, {
|
|
289
|
+
cssVar,
|
|
290
|
+
path: path2.join("."),
|
|
291
|
+
value: String(value),
|
|
292
|
+
category: path2[0],
|
|
293
|
+
description: describeToken(path2[0]),
|
|
294
|
+
themeValues: { [themeName]: String(value) }
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
for (const entry of themed.values()) {
|
|
299
|
+
entry.value = entry.themeValues?.[DEFAULT_THEME_NAME] ?? entry.value;
|
|
300
|
+
}
|
|
301
|
+
return [...foundation, ...themed.values()];
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/catalog-source.ts
|
|
18
305
|
var readText = (filePath) => fs.readFileSync(filePath, "utf8");
|
|
19
306
|
var normalizeWhitespace = (value) => value.replace(/\s+/g, " ").trim();
|
|
20
307
|
var stringifyValue = (value) => {
|
|
@@ -350,12 +637,14 @@ var buildCatalogFromRepo = (repoRoot) => {
|
|
|
350
637
|
decisionGuides: normalizeDecisionGuides(selectionDoc.decision_guides),
|
|
351
638
|
recipes,
|
|
352
639
|
setup,
|
|
353
|
-
components
|
|
640
|
+
components,
|
|
641
|
+
tokens: buildTokenEntries()
|
|
354
642
|
};
|
|
355
643
|
};
|
|
356
644
|
var getRepoRootFromPackageRoot = (packageRoot) => path.resolve(packageRoot, "../..");
|
|
357
645
|
export {
|
|
358
646
|
buildCatalogFromRepo,
|
|
647
|
+
buildTokenEntries,
|
|
359
648
|
catalog,
|
|
360
649
|
createTreeuiMcpServer,
|
|
361
650
|
findComponent,
|
|
@@ -363,8 +652,10 @@ export {
|
|
|
363
652
|
formatRecipeResults,
|
|
364
653
|
formatSearchResults,
|
|
365
654
|
formatSetupGuide,
|
|
655
|
+
formatTokenResults,
|
|
366
656
|
getRepoRootFromPackageRoot,
|
|
367
657
|
recommendComponents,
|
|
368
658
|
searchComponents,
|
|
369
|
-
searchRecipes
|
|
659
|
+
searchRecipes,
|
|
660
|
+
searchTokens
|
|
370
661
|
};
|