@dryui/mcp 0.1.4 → 0.2.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.
@@ -83,7 +83,6 @@ export interface DolphinSummary {
83
83
  }
84
84
  export interface DolphinGraph {
85
85
  schema: 'DolphinGraph';
86
- generatedAt: string;
87
86
  packageVersion: string;
88
87
  summary: DolphinSummary;
89
88
  nodes: DolphinNode[];
@@ -5871,8 +5871,6 @@ function buildArchitectureReport(graph) {
5871
5871
  return [
5872
5872
  "# DryUI Architecture Audit",
5873
5873
  "",
5874
- `Generated from \`DolphinGraph\` on ${graph.generatedAt}.`,
5875
- "",
5876
5874
  "## Metrics",
5877
5875
  "",
5878
5876
  "| Metric | Count |",
@@ -6228,7 +6226,6 @@ async function buildDolphinGraph() {
6228
6226
  };
6229
6227
  return {
6230
6228
  schema: "DolphinGraph",
6231
- generatedAt: new Date().toISOString(),
6232
6229
  packageVersion: spec.version,
6233
6230
  summary,
6234
6231
  nodes: sortedNodes,
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "schema": "DolphinGraph",
3
- "generatedAt": "2026-04-07T22:06:54.170Z",
4
- "packageVersion": "0.1.5",
3
+ "packageVersion": "0.1.8",
5
4
  "summary": {
6
5
  "componentNodes": 292,
7
6
  "partNodes": 662,
@@ -15,12 +14,12 @@
15
14
  "subpathOnlyComponents": 1,
16
15
  "compoundComponents": 135,
17
16
  "wrapEdges": 130,
18
- "composeEdges": 10,
17
+ "composeEdges": 11,
19
18
  "docsEdges": 0,
20
19
  "relatedEdges": 303,
21
20
  "mismatches": 23,
22
21
  "primitivePartComponents": 0,
23
- "thinWrappers": 65
22
+ "thinWrappers": 64
24
23
  },
25
24
  "nodes": [
26
25
  {
@@ -15677,7 +15676,7 @@
15677
15676
  "parts": [],
15678
15677
  "sourceFileCount": 2,
15679
15678
  "primitivePartUsageCount": 0,
15680
- "componentImportCount": 0
15679
+ "componentImportCount": 1
15681
15680
  },
15682
15681
  {
15683
15682
  "id": "ui:Timeline",
@@ -16551,10 +16550,10 @@
16551
16550
  "to": "primitives:TimeInput"
16552
16551
  },
16553
16552
  {
16554
- "id": "composes:ui:DateTimeInput:ui:DateField:",
16553
+ "id": "composes:ui:DateTimeInput:ui:DatePicker:",
16555
16554
  "type": "composes",
16556
16555
  "from": "ui:DateTimeInput",
16557
- "to": "ui:DateField"
16556
+ "to": "ui:DatePicker"
16558
16557
  },
16559
16558
  {
16560
16559
  "id": "composes:ui:DateTimeInput:ui:TimeInput:",
@@ -16592,6 +16591,12 @@
16592
16591
  "from": "ui:Tag",
16593
16592
  "to": "ui:Badge"
16594
16593
  },
16594
+ {
16595
+ "id": "composes:ui:TimeInput:ui:Select:",
16596
+ "type": "composes",
16597
+ "from": "ui:TimeInput",
16598
+ "to": "ui:Select"
16599
+ },
16595
16600
  {
16596
16601
  "id": "composes:ui:Transfer:ui:Checkbox:",
16597
16602
  "type": "composes",
@@ -24360,7 +24365,6 @@
24360
24365
  "Spotlight",
24361
24366
  "Svg",
24362
24367
  "Textarea",
24363
- "TimeInput",
24364
24368
  "Toggle",
24365
24369
  "Tour",
24366
24370
  "VideoEmbed",
@@ -0,0 +1,15 @@
1
+ import type { CompositionComponentDef, CompositionRecipeDef, Spec } from './spec-types.js';
2
+ export interface CompositionSearchResult {
3
+ readonly componentMatches: readonly CompositionComponentDef[];
4
+ readonly recipeMatches: readonly CompositionRecipeDef[];
5
+ }
6
+ /**
7
+ * Search composition data for components and recipes matching a query.
8
+ * Uses exact substring matching first, then falls back to token-based scoring.
9
+ */
10
+ export declare function searchComposition(composition: NonNullable<Spec['composition']>, query: string): CompositionSearchResult;
11
+ /**
12
+ * Format composition search results as human-readable text.
13
+ * Used by MCP prompts and CLI text mode.
14
+ */
15
+ export declare function formatCompositionResult(results: CompositionSearchResult): string;
@@ -0,0 +1,202 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ function __accessProp(key) {
7
+ return this[key];
8
+ }
9
+ var __toESMCache_node;
10
+ var __toESMCache_esm;
11
+ var __toESM = (mod, isNodeMode, target) => {
12
+ var canCache = mod != null && typeof mod === "object";
13
+ if (canCache) {
14
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
15
+ var cached = cache.get(mod);
16
+ if (cached)
17
+ return cached;
18
+ }
19
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
20
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
21
+ for (let key of __getOwnPropNames(mod))
22
+ if (!__hasOwnProp.call(to, key))
23
+ __defProp(to, key, {
24
+ get: __accessProp.bind(mod, key),
25
+ enumerable: true
26
+ });
27
+ if (canCache)
28
+ cache.set(mod, to);
29
+ return to;
30
+ };
31
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
32
+ var __returnValue = (v) => v;
33
+ function __exportSetter(name, newValue) {
34
+ this[name] = __returnValue.bind(null, newValue);
35
+ }
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, {
39
+ get: all[name],
40
+ enumerable: true,
41
+ configurable: true,
42
+ set: __exportSetter.bind(all, name)
43
+ });
44
+ };
45
+
46
+ // src/composition-search.ts
47
+ var STOP_WORDS = new Set([
48
+ "a",
49
+ "an",
50
+ "the",
51
+ "and",
52
+ "or",
53
+ "but",
54
+ "in",
55
+ "on",
56
+ "at",
57
+ "to",
58
+ "for",
59
+ "of",
60
+ "with",
61
+ "by",
62
+ "from",
63
+ "is",
64
+ "it",
65
+ "that",
66
+ "this",
67
+ "as",
68
+ "be",
69
+ "are",
70
+ "was",
71
+ "were",
72
+ "been",
73
+ "has",
74
+ "have",
75
+ "had",
76
+ "do",
77
+ "does",
78
+ "did",
79
+ "will",
80
+ "would",
81
+ "could",
82
+ "should",
83
+ "may",
84
+ "might",
85
+ "can",
86
+ "i",
87
+ "me",
88
+ "my",
89
+ "we",
90
+ "our",
91
+ "you",
92
+ "your",
93
+ "need",
94
+ "want",
95
+ "like",
96
+ "create",
97
+ "make",
98
+ "build",
99
+ "add",
100
+ "using",
101
+ "use",
102
+ "show",
103
+ "display"
104
+ ]);
105
+ function tokenize(text) {
106
+ return text.toLowerCase().replace(/[^a-z0-9]+/g, " ").split(/\s+/).filter((w) => w.length > 1 && !STOP_WORDS.has(w));
107
+ }
108
+ function scoreText(tokens, text) {
109
+ const lower = text.toLowerCase();
110
+ return tokens.reduce((score, t) => score + (lower.includes(t) ? 1 : 0), 0);
111
+ }
112
+ function searchComposition(composition, query) {
113
+ const q = query.toLowerCase();
114
+ const tokens = tokenize(query);
115
+ const exactComponentMatches = [];
116
+ const exactRecipeMatches = [];
117
+ for (const comp of Object.values(composition.components)) {
118
+ if (comp.component.toLowerCase().includes(q) || comp.useWhen.toLowerCase().includes(q) || comp.alternatives.some((a) => a.component.toLowerCase().includes(q) || a.useWhen.toLowerCase().includes(q)) || comp.antiPatterns.some((ap) => ap.pattern.toLowerCase().includes(q))) {
119
+ exactComponentMatches.push(comp);
120
+ }
121
+ }
122
+ for (const recipe of Object.values(composition.recipes)) {
123
+ if (recipe.name.toLowerCase().includes(q) || recipe.description.toLowerCase().includes(q) || recipe.tags.some((t) => t.toLowerCase().includes(q)) || recipe.components.some((c) => c.toLowerCase().includes(q))) {
124
+ exactRecipeMatches.push(recipe);
125
+ }
126
+ }
127
+ if (exactComponentMatches.length || exactRecipeMatches.length) {
128
+ return { componentMatches: exactComponentMatches, recipeMatches: exactRecipeMatches };
129
+ }
130
+ if (!tokens.length) {
131
+ return { componentMatches: [], recipeMatches: [] };
132
+ }
133
+ const scoredComponents = [];
134
+ for (const comp of Object.values(composition.components)) {
135
+ const corpus = [
136
+ comp.component,
137
+ comp.useWhen,
138
+ ...comp.alternatives.flatMap((a) => [a.component, a.useWhen]),
139
+ ...comp.antiPatterns.map((ap) => ap.pattern),
140
+ ...comp.combinesWith
141
+ ].join(" ");
142
+ const score = scoreText(tokens, corpus);
143
+ if (score > 0)
144
+ scoredComponents.push({ comp, score });
145
+ }
146
+ const scoredRecipes = [];
147
+ for (const recipe of Object.values(composition.recipes)) {
148
+ const corpus = [recipe.name, recipe.description, ...recipe.tags, ...recipe.components].join(" ");
149
+ const score = scoreText(tokens, corpus);
150
+ if (score > 0)
151
+ scoredRecipes.push({ recipe, score });
152
+ }
153
+ scoredComponents.sort((a, b) => b.score - a.score);
154
+ scoredRecipes.sort((a, b) => b.score - a.score);
155
+ const minScore = Math.max(1, Math.floor(tokens.length * 0.3));
156
+ return {
157
+ componentMatches: scoredComponents.filter((s) => s.score >= minScore).slice(0, 10).map((s) => s.comp),
158
+ recipeMatches: scoredRecipes.filter((s) => s.score >= minScore).slice(0, 5).map((s) => s.recipe)
159
+ };
160
+ }
161
+ function formatCompositionResult(results) {
162
+ const lines = [];
163
+ for (const comp of results.componentMatches) {
164
+ lines.push(`── ${comp.component} ──────────────────────────────`);
165
+ lines.push(`[DEV GUIDANCE — do not render as page content]`);
166
+ lines.push(`Use: ${comp.component} — ${comp.useWhen}`);
167
+ lines.push("");
168
+ for (const alt of comp.alternatives) {
169
+ lines.push(` ${alt.rank}. ${alt.component} (${alt.useWhen})`);
170
+ lines.push(alt.snippet.split(`
171
+ `).map((l) => ` ${l}`).join(`
172
+ `));
173
+ lines.push("");
174
+ }
175
+ for (const ap of comp.antiPatterns) {
176
+ lines.push(`⚠ Anti-pattern: ${ap.pattern}`);
177
+ lines.push(` Why: ${ap.reason}`);
178
+ lines.push(` Use ${ap.fix} instead`);
179
+ lines.push("");
180
+ }
181
+ if (comp.combinesWith.length) {
182
+ lines.push(`Combines with: ${comp.combinesWith.join(", ")}`);
183
+ }
184
+ lines.push("");
185
+ }
186
+ for (const recipe of results.recipeMatches) {
187
+ lines.push(`── Recipe: ${recipe.name} ──────────────────────────────`);
188
+ lines.push(`[DEV GUIDANCE — do not render as page content]`);
189
+ lines.push(recipe.description);
190
+ lines.push(`Components: ${recipe.components.join(", ")}`);
191
+ lines.push("");
192
+ lines.push(`[CODE — use this in your Svelte file]`);
193
+ lines.push(recipe.snippet);
194
+ lines.push("");
195
+ }
196
+ return lines.join(`
197
+ `);
198
+ }
199
+ export {
200
+ searchComposition,
201
+ formatCompositionResult
202
+ };
@@ -3,7 +3,7 @@
3
3
  "version": 1,
4
4
  "package": {
5
5
  "name": "@dryui/ui",
6
- "version": "0.1.5"
6
+ "version": "0.1.8"
7
7
  },
8
8
  "counts": {
9
9
  "components": 144,
@@ -10962,6 +10962,26 @@
10962
10962
  "type": "number",
10963
10963
  "required": false,
10964
10964
  "description": "Step interval used when incrementing numeric values."
10965
+ },
10966
+ "size": {
10967
+ "type": "'sm' | 'md' | 'lg'",
10968
+ "required": false,
10969
+ "acceptedValues": [
10970
+ "sm",
10971
+ "md",
10972
+ "lg"
10973
+ ],
10974
+ "description": "Size preset affecting density, spacing, or typography.",
10975
+ "default": "'md'"
10976
+ },
10977
+ "name": {
10978
+ "type": "string",
10979
+ "required": false,
10980
+ "description": "Field name used during native form submission."
10981
+ },
10982
+ "class": {
10983
+ "type": "string",
10984
+ "required": false
10965
10985
  }
10966
10986
  },
10967
10987
  "forwardedProps": {
@@ -10975,25 +10995,23 @@
10975
10995
  ],
10976
10996
  "note": "Forwards <input> attributes via rest props."
10977
10997
  },
10978
- "cssVars": {
10979
- "--dry-time-input-bg": "Input Bg",
10980
- "--dry-time-input-border": "Input Border",
10981
- "--dry-time-input-color": "Input Color",
10982
- "--dry-time-input-font-size": "Input Font Size",
10983
- "--dry-time-input-padding-x": "Input Padding X",
10984
- "--dry-time-input-padding-y": "Input Padding Y",
10985
- "--dry-time-input-radius": "Input Radius"
10986
- },
10998
+ "cssVars": {},
10987
10999
  "dataAttributes": [
10988
11000
  {
10989
11001
  "name": "data-disabled",
10990
11002
  "description": "Present when the component or part is disabled."
10991
11003
  },
10992
11004
  {
10993
- "name": "data-time-input"
11005
+ "name": "data-placeholder"
11006
+ },
11007
+ {
11008
+ "name": "data-time-display"
10994
11009
  },
10995
11010
  {
10996
11011
  "name": "data-time-input-wrapper"
11012
+ },
11013
+ {
11014
+ "name": "data-time-separator"
10997
11015
  }
10998
11016
  ],
10999
11017
  "example": "<TimeInput>Content</TimeInput>"