@maz-ui/mcp 5.0.0-beta.2 → 5.0.0-beta.25
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 +1 -1
- package/dist/mcp.d.mts +22 -9
- package/dist/mcp.d.ts +22 -9
- package/dist/mcp.mjs +160 -83
- package/docs/generated-docs/maz-avatar.doc.md +25 -25
- package/docs/generated-docs/maz-btn.doc.md +1 -1
- package/docs/generated-docs/maz-checkbox.doc.md +16 -17
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +1 -1
- package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
- package/docs/generated-docs/maz-date-picker.doc.md +41 -41
- package/docs/generated-docs/maz-drawer.doc.md +7 -8
- package/docs/generated-docs/maz-expand-animation.doc.md +4 -4
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-input-code.doc.md +16 -16
- package/docs/generated-docs/maz-input-phone-number.doc.md +42 -38
- package/docs/generated-docs/maz-input-price.doc.md +14 -14
- package/docs/generated-docs/maz-input-tags.doc.md +16 -16
- package/docs/generated-docs/maz-input.doc.md +33 -33
- package/docs/generated-docs/maz-lazy-img.doc.md +14 -14
- package/docs/generated-docs/maz-loading-bar.doc.md +4 -4
- package/docs/generated-docs/maz-markdown-editor.doc.md +65 -0
- package/docs/generated-docs/maz-popover.doc.md +1 -1
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +10 -10
- package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
- package/docs/generated-docs/maz-radio.doc.md +16 -16
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +4 -4
- package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
- package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +27 -0
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
- package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar.doc.md +36 -0
- package/docs/generated-docs/maz-slider.doc.md +1 -1
- package/docs/generated-docs/maz-spinner.doc.md +4 -4
- package/docs/generated-docs/maz-switch.doc.md +14 -14
- package/docs/generated-docs/maz-table.doc.md +5 -5
- package/docs/generated-docs/maz-textarea.doc.md +25 -24
- package/docs/generated-docs/maz-ticker.doc.md +1 -1
- package/docs/generated-docs/maz-timeline.doc.md +4 -4
- package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
- package/docs/src/blog/v4.md +1 -1
- package/docs/src/blog/v5.md +5 -7
- package/docs/src/components/maz-btn.md +1 -1
- package/docs/src/components/maz-code-highlight.md +233 -0
- package/docs/src/components/maz-container.md +2 -2
- package/docs/src/components/maz-date-picker.md +1 -1
- package/docs/src/components/maz-dialog.md +46 -0
- package/docs/src/components/maz-icon.md +2 -2
- package/docs/src/components/maz-input-phone-number.md +106 -103
- package/docs/src/components/maz-markdown-editor.md +369 -0
- package/docs/src/components/maz-sidebar.md +719 -0
- package/docs/src/components/maz-textarea.md +27 -1
- package/docs/src/components/maz-timeline.md +60 -0
- package/docs/src/components/maz-window-mockup.md +249 -0
- package/docs/src/directives/click-outside.md +8 -15
- package/docs/src/directives/fullscreen-img.md +1 -1
- package/docs/src/directives/lazy-img.md +5 -5
- package/docs/src/directives/tooltip.md +24 -1
- package/docs/src/directives/zoom-img.md +1 -1
- package/docs/src/ecosystem/eslint-config.md +95 -1
- package/docs/src/{guide/icons.md → ecosystem/icons/index.md} +1 -1
- package/docs/src/ecosystem/node/exec-promise.md +87 -0
- package/docs/src/ecosystem/node/index.md +53 -0
- package/docs/src/ecosystem/node/logger.md +146 -0
- package/docs/src/ecosystem/node/print-banner.md +93 -0
- package/docs/src/{guide → ecosystem}/nuxt.md +81 -47
- package/docs/src/{guide → ecosystem}/themes.md +153 -72
- package/docs/src/{guide → ecosystem}/translations.md +1 -1
- package/docs/src/ecosystem/utils/camel-case.md +31 -0
- package/docs/src/{helpers → ecosystem/utils}/capitalize.md +2 -3
- package/docs/src/ecosystem/utils/check-availability.md +79 -0
- package/docs/src/ecosystem/utils/cookie.md +80 -0
- package/docs/src/{helpers → ecosystem/utils}/currency.md +2 -2
- package/docs/src/{helpers → ecosystem/utils}/date.md +2 -2
- package/docs/src/ecosystem/utils/debounce-callback.md +38 -0
- package/docs/src/ecosystem/utils/debounce-id.md +69 -0
- package/docs/src/ecosystem/utils/debounce.md +65 -0
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +33 -0
- package/docs/src/ecosystem/utils/format-json.md +33 -0
- package/docs/src/ecosystem/utils/format-phone-number.md +37 -0
- package/docs/src/ecosystem/utils/get-browser-locale.md +29 -0
- package/docs/src/ecosystem/utils/get-error-message.md +39 -0
- package/docs/src/ecosystem/utils/idle-timeout.md +90 -0
- package/docs/src/ecosystem/utils/index.md +60 -0
- package/docs/src/ecosystem/utils/is-client.md +32 -0
- package/docs/src/ecosystem/utils/is-equal.md +38 -0
- package/docs/src/ecosystem/utils/is-server.md +31 -0
- package/docs/src/ecosystem/utils/is-standalone-mode.md +43 -0
- package/docs/src/ecosystem/utils/kebab-case.md +36 -0
- package/docs/src/ecosystem/utils/normalize-string.md +77 -0
- package/docs/src/{helpers → ecosystem/utils}/number.md +2 -2
- package/docs/src/ecosystem/utils/pascal-case.md +35 -0
- package/docs/src/ecosystem/utils/script-loader.md +77 -0
- package/docs/src/ecosystem/utils/sleep.md +59 -0
- package/docs/src/ecosystem/utils/snake-case.md +36 -0
- package/docs/src/ecosystem/utils/swipe-handler.md +91 -0
- package/docs/src/ecosystem/utils/textarea-autogrow.md +41 -0
- package/docs/src/ecosystem/utils/throttle-id.md +48 -0
- package/docs/src/ecosystem/utils/throttle.md +57 -0
- package/docs/src/ecosystem/utils/truthy-filter.md +31 -0
- package/docs/src/ecosystem/utils/types/deep-key-of.md +48 -0
- package/docs/src/ecosystem/utils/types/deep-partial.md +42 -0
- package/docs/src/ecosystem/utils/types/deep-required.md +39 -0
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +44 -0
- package/docs/src/ecosystem/utils/types/generic-instance-type.md +42 -0
- package/docs/src/ecosystem/utils/types/infer-maybe-ref.md +35 -0
- package/docs/src/ecosystem/utils/upper-first.md +32 -0
- package/docs/src/ecosystem/utils/user-visibility.md +69 -0
- package/docs/src/guide/getting-started.md +15 -13
- package/docs/src/guide/global-defaults.md +101 -0
- package/docs/src/guide/maz-ui-provider.md +6 -3
- package/docs/src/guide/migration-v4.md +13 -9
- package/docs/src/guide/migration-v5.md +67 -12
- package/docs/src/guide/resolvers.md +7 -7
- package/docs/src/guide/tailwind.md +4 -0
- package/docs/src/guide/vue.md +4 -4
- package/docs/src/index.md +12 -12
- package/docs/src/plugins/aos.md +1 -1
- package/docs/src/plugins/wait.md +1 -1
- package/package.json +6 -5
- package/docs/src/helpers/camel-case.md +0 -14
- package/docs/src/helpers/check-availability.md +0 -14
- package/docs/src/helpers/debounce-callback.md +0 -14
- package/docs/src/helpers/debounce-id.md +0 -14
- package/docs/src/helpers/debounce.md +0 -14
- package/docs/src/helpers/is-client.md +0 -14
- package/docs/src/helpers/is-equal.md +0 -14
- package/docs/src/helpers/is-standalone-mode.md +0 -14
- package/docs/src/helpers/kebab-case.md +0 -14
- package/docs/src/helpers/normalize-string.md +0 -14
- package/docs/src/helpers/pascal-case.md +0 -14
- package/docs/src/helpers/script-loader.md +0 -14
- package/docs/src/helpers/sleep.md +0 -14
- package/docs/src/helpers/snake-case.md +0 -14
- package/docs/src/helpers/throttle-id.md +0 -14
- package/docs/src/helpers/throttle.md +0 -14
- /package/docs/src/{guide → ecosystem/icons}/icon-set.md +0 -0
- /package/docs/src/{guide → ecosystem}/mcp.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/country-code-to-unicode-flag.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/get-country-flag-url.md +0 -0
package/README.md
CHANGED
|
@@ -193,7 +193,7 @@ The server exposes documentation through MCP resources with the following URI pa
|
|
|
193
193
|
- **`maz-ui://component/{ComponentName}`** - Individual component documentation
|
|
194
194
|
- Examples: `maz-ui://component/MazBtn`, `maz-ui://component/MazInput`
|
|
195
195
|
- **`maz-ui://guide/{guideName}`** - Setup and usage guides
|
|
196
|
-
- Examples: `maz-ui://guide/getting-started`, `maz-ui://guide/vue`, `maz-ui://
|
|
196
|
+
- Examples: `maz-ui://guide/getting-started`, `maz-ui://guide/vue`, `maz-ui://ecosystem/nuxt`
|
|
197
197
|
- **`maz-ui://composable/{composableName}`** - Vue composable documentation
|
|
198
198
|
- Examples: `maz-ui://composable/use-toast`, `maz-ui://composable/use-dialog`
|
|
199
199
|
- **`maz-ui://directive/{directiveName}`** - Vue directive documentation
|
package/dist/mcp.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ interface DocumentMetadata {
|
|
|
16
16
|
sections: SectionMetadata[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
type DocumentType = 'component' | 'guide' | 'composable' | 'directive' | 'plugin' | '
|
|
19
|
+
type DocumentType = 'component' | 'guide' | 'composable' | 'directive' | 'plugin' | 'util' | 'node';
|
|
20
20
|
interface Document {
|
|
21
21
|
name: string;
|
|
22
22
|
type: DocumentType;
|
|
@@ -46,7 +46,11 @@ interface DocumentationDiagnostics {
|
|
|
46
46
|
total: number;
|
|
47
47
|
list: string[];
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
utils: {
|
|
50
|
+
total: number;
|
|
51
|
+
list: string[];
|
|
52
|
+
};
|
|
53
|
+
node: {
|
|
50
54
|
total: number;
|
|
51
55
|
list: string[];
|
|
52
56
|
};
|
|
@@ -58,7 +62,10 @@ interface DocumentationDiagnostics {
|
|
|
58
62
|
composablesDir: string;
|
|
59
63
|
directivesDir: string;
|
|
60
64
|
pluginsDir: string;
|
|
61
|
-
|
|
65
|
+
ecosystemDir: string;
|
|
66
|
+
utilsDir: string;
|
|
67
|
+
nodeDir: string;
|
|
68
|
+
iconsDir: string;
|
|
62
69
|
};
|
|
63
70
|
}
|
|
64
71
|
declare class DocumentationService {
|
|
@@ -69,7 +76,11 @@ declare class DocumentationService {
|
|
|
69
76
|
private readonly composablesDir;
|
|
70
77
|
private readonly directivesDir;
|
|
71
78
|
private readonly pluginsDir;
|
|
72
|
-
private readonly
|
|
79
|
+
private readonly ecosystemDir;
|
|
80
|
+
private readonly utilsDir;
|
|
81
|
+
private readonly utilsTypesDir;
|
|
82
|
+
private readonly nodeDir;
|
|
83
|
+
private readonly iconsDir;
|
|
73
84
|
private readonly metadataExtractor;
|
|
74
85
|
constructor();
|
|
75
86
|
private pascalToKebabCase;
|
|
@@ -85,8 +96,10 @@ declare class DocumentationService {
|
|
|
85
96
|
getAllDirectives(): string[];
|
|
86
97
|
getPluginDocumentation(pluginName: string): string;
|
|
87
98
|
getAllPlugins(): string[];
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
getUtilDocumentation(utilName: string): string;
|
|
100
|
+
getAllUtils(): string[];
|
|
101
|
+
getNodeDocumentation(nodeName: string): string;
|
|
102
|
+
getAllNode(): string[];
|
|
90
103
|
getAllDocuments(): Document[];
|
|
91
104
|
private buildDocument;
|
|
92
105
|
getOverview(): string;
|
|
@@ -96,7 +109,7 @@ declare class DocumentationService {
|
|
|
96
109
|
|
|
97
110
|
/**
|
|
98
111
|
* MCP server for Maz-UI documentation
|
|
99
|
-
* Provides robust access to Vue.js components, guides, composables, directives, plugins, and
|
|
112
|
+
* Provides robust access to Vue.js components, guides, composables, directives, plugins, utils and node utilities
|
|
100
113
|
* with fuzzy search, comprehensive indexing, and intelligent fallbacks
|
|
101
114
|
*/
|
|
102
115
|
declare class MazUiMcpServer {
|
|
@@ -120,9 +133,9 @@ declare class MazUiMcpServer {
|
|
|
120
133
|
*/
|
|
121
134
|
private getComponentType;
|
|
122
135
|
/**
|
|
123
|
-
* Determine
|
|
136
|
+
* Determine util type for better categorization
|
|
124
137
|
*/
|
|
125
|
-
private
|
|
138
|
+
private getUtilType;
|
|
126
139
|
/**
|
|
127
140
|
* Resolve a document name using intelligent matching:
|
|
128
141
|
* PascalCase (MazBtn), kebab-case (maz-btn), short name (btn), aliases
|
package/dist/mcp.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ interface DocumentMetadata {
|
|
|
16
16
|
sections: SectionMetadata[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
type DocumentType = 'component' | 'guide' | 'composable' | 'directive' | 'plugin' | '
|
|
19
|
+
type DocumentType = 'component' | 'guide' | 'composable' | 'directive' | 'plugin' | 'util' | 'node';
|
|
20
20
|
interface Document {
|
|
21
21
|
name: string;
|
|
22
22
|
type: DocumentType;
|
|
@@ -46,7 +46,11 @@ interface DocumentationDiagnostics {
|
|
|
46
46
|
total: number;
|
|
47
47
|
list: string[];
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
utils: {
|
|
50
|
+
total: number;
|
|
51
|
+
list: string[];
|
|
52
|
+
};
|
|
53
|
+
node: {
|
|
50
54
|
total: number;
|
|
51
55
|
list: string[];
|
|
52
56
|
};
|
|
@@ -58,7 +62,10 @@ interface DocumentationDiagnostics {
|
|
|
58
62
|
composablesDir: string;
|
|
59
63
|
directivesDir: string;
|
|
60
64
|
pluginsDir: string;
|
|
61
|
-
|
|
65
|
+
ecosystemDir: string;
|
|
66
|
+
utilsDir: string;
|
|
67
|
+
nodeDir: string;
|
|
68
|
+
iconsDir: string;
|
|
62
69
|
};
|
|
63
70
|
}
|
|
64
71
|
declare class DocumentationService {
|
|
@@ -69,7 +76,11 @@ declare class DocumentationService {
|
|
|
69
76
|
private readonly composablesDir;
|
|
70
77
|
private readonly directivesDir;
|
|
71
78
|
private readonly pluginsDir;
|
|
72
|
-
private readonly
|
|
79
|
+
private readonly ecosystemDir;
|
|
80
|
+
private readonly utilsDir;
|
|
81
|
+
private readonly utilsTypesDir;
|
|
82
|
+
private readonly nodeDir;
|
|
83
|
+
private readonly iconsDir;
|
|
73
84
|
private readonly metadataExtractor;
|
|
74
85
|
constructor();
|
|
75
86
|
private pascalToKebabCase;
|
|
@@ -85,8 +96,10 @@ declare class DocumentationService {
|
|
|
85
96
|
getAllDirectives(): string[];
|
|
86
97
|
getPluginDocumentation(pluginName: string): string;
|
|
87
98
|
getAllPlugins(): string[];
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
getUtilDocumentation(utilName: string): string;
|
|
100
|
+
getAllUtils(): string[];
|
|
101
|
+
getNodeDocumentation(nodeName: string): string;
|
|
102
|
+
getAllNode(): string[];
|
|
90
103
|
getAllDocuments(): Document[];
|
|
91
104
|
private buildDocument;
|
|
92
105
|
getOverview(): string;
|
|
@@ -96,7 +109,7 @@ declare class DocumentationService {
|
|
|
96
109
|
|
|
97
110
|
/**
|
|
98
111
|
* MCP server for Maz-UI documentation
|
|
99
|
-
* Provides robust access to Vue.js components, guides, composables, directives, plugins, and
|
|
112
|
+
* Provides robust access to Vue.js components, guides, composables, directives, plugins, utils and node utilities
|
|
100
113
|
* with fuzzy search, comprehensive indexing, and intelligent fallbacks
|
|
101
114
|
*/
|
|
102
115
|
declare class MazUiMcpServer {
|
|
@@ -120,9 +133,9 @@ declare class MazUiMcpServer {
|
|
|
120
133
|
*/
|
|
121
134
|
private getComponentType;
|
|
122
135
|
/**
|
|
123
|
-
* Determine
|
|
136
|
+
* Determine util type for better categorization
|
|
124
137
|
*/
|
|
125
|
-
private
|
|
138
|
+
private getUtilType;
|
|
126
139
|
/**
|
|
127
140
|
* Resolve a document name using intelligent matching:
|
|
128
141
|
* PascalCase (MazBtn), kebab-case (maz-btn), short name (btn), aliases
|
package/dist/mcp.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { getErrorMessage } from '@maz-ui/utils/helpers/getErrorMessage';
|
|
|
3
3
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
5
|
import { ListResourcesRequestSchema, ReadResourceRequestSchema, ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
-
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
6
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
7
7
|
import { resolve, join, dirname } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
|
|
10
|
-
const version = "5.0.0-beta.
|
|
10
|
+
const version = "5.0.0-beta.25";
|
|
11
11
|
|
|
12
12
|
class MetadataExtractor {
|
|
13
13
|
extract(name, type, content, manualTags = []) {
|
|
@@ -248,7 +248,11 @@ class DocumentationService {
|
|
|
248
248
|
composablesDir;
|
|
249
249
|
directivesDir;
|
|
250
250
|
pluginsDir;
|
|
251
|
-
|
|
251
|
+
ecosystemDir;
|
|
252
|
+
utilsDir;
|
|
253
|
+
utilsTypesDir;
|
|
254
|
+
nodeDir;
|
|
255
|
+
iconsDir;
|
|
252
256
|
metadataExtractor = new MetadataExtractor();
|
|
253
257
|
constructor() {
|
|
254
258
|
const localDocsRoot = resolve(_dirname, "../docs/src");
|
|
@@ -260,7 +264,11 @@ class DocumentationService {
|
|
|
260
264
|
this.composablesDir = join(this.docsRoot, "composables");
|
|
261
265
|
this.directivesDir = join(this.docsRoot, "directives");
|
|
262
266
|
this.pluginsDir = join(this.docsRoot, "plugins");
|
|
263
|
-
this.
|
|
267
|
+
this.ecosystemDir = join(this.docsRoot, "ecosystem");
|
|
268
|
+
this.utilsDir = join(this.ecosystemDir, "utils");
|
|
269
|
+
this.utilsTypesDir = join(this.utilsDir, "types");
|
|
270
|
+
this.nodeDir = join(this.ecosystemDir, "node");
|
|
271
|
+
this.iconsDir = join(this.ecosystemDir, "icons");
|
|
264
272
|
}
|
|
265
273
|
pascalToKebabCase(pascalName) {
|
|
266
274
|
return pascalName.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
@@ -275,13 +283,20 @@ class DocumentationService {
|
|
|
275
283
|
return "";
|
|
276
284
|
}
|
|
277
285
|
}
|
|
278
|
-
listMarkdownFiles(dirPath) {
|
|
286
|
+
listMarkdownFiles(dirPath, options = {}) {
|
|
279
287
|
try {
|
|
280
288
|
if (!existsSync(dirPath)) {
|
|
281
289
|
return [];
|
|
282
290
|
}
|
|
283
|
-
const
|
|
284
|
-
return
|
|
291
|
+
const entries = readdirSync(dirPath);
|
|
292
|
+
return entries.filter((entry) => {
|
|
293
|
+
if (!entry.endsWith(".md"))
|
|
294
|
+
return false;
|
|
295
|
+
if (!options.keepIndex && entry === "index.md")
|
|
296
|
+
return false;
|
|
297
|
+
const fullPath = join(dirPath, entry);
|
|
298
|
+
return statSync(fullPath).isFile();
|
|
299
|
+
}).map((file) => file.replace(".md", "")).sort();
|
|
285
300
|
} catch {
|
|
286
301
|
return [];
|
|
287
302
|
}
|
|
@@ -322,12 +337,38 @@ ${generatedDoc}`;
|
|
|
322
337
|
return Array.from(allComponents).sort();
|
|
323
338
|
}
|
|
324
339
|
// ========== GUIDES ==========
|
|
340
|
+
// Aggregates: guide/*.md + ecosystem/*.md (standalone) + ecosystem/icons/*.md (index.md → 'icons')
|
|
325
341
|
getGuideDocumentation(guideName) {
|
|
326
|
-
const
|
|
327
|
-
|
|
342
|
+
const candidates = [
|
|
343
|
+
join(this.guidesDir, `${guideName}.md`),
|
|
344
|
+
join(this.ecosystemDir, `${guideName}.md`),
|
|
345
|
+
join(this.iconsDir, `${guideName}.md`)
|
|
346
|
+
];
|
|
347
|
+
if (guideName === "icons") {
|
|
348
|
+
candidates.push(join(this.iconsDir, "index.md"));
|
|
349
|
+
}
|
|
350
|
+
for (const path of candidates) {
|
|
351
|
+
const content = this.readMarkdownFile(path);
|
|
352
|
+
if (content)
|
|
353
|
+
return content;
|
|
354
|
+
}
|
|
355
|
+
return "";
|
|
328
356
|
}
|
|
329
357
|
getAllGuides() {
|
|
330
|
-
|
|
358
|
+
const guides = /* @__PURE__ */ new Set();
|
|
359
|
+
for (const name of this.listMarkdownFiles(this.guidesDir)) {
|
|
360
|
+
guides.add(name);
|
|
361
|
+
}
|
|
362
|
+
for (const name of this.listMarkdownFiles(this.ecosystemDir)) {
|
|
363
|
+
guides.add(name);
|
|
364
|
+
}
|
|
365
|
+
for (const name of this.listMarkdownFiles(this.iconsDir)) {
|
|
366
|
+
guides.add(name);
|
|
367
|
+
}
|
|
368
|
+
if (existsSync(join(this.iconsDir, "index.md"))) {
|
|
369
|
+
guides.add("icons");
|
|
370
|
+
}
|
|
371
|
+
return Array.from(guides).sort();
|
|
331
372
|
}
|
|
332
373
|
// ========== COMPOSABLES ==========
|
|
333
374
|
getComposableDocumentation(composableName) {
|
|
@@ -353,13 +394,34 @@ ${generatedDoc}`;
|
|
|
353
394
|
getAllPlugins() {
|
|
354
395
|
return this.listMarkdownFiles(this.pluginsDir);
|
|
355
396
|
}
|
|
356
|
-
// ==========
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
397
|
+
// ========== UTILS ==========
|
|
398
|
+
// Aggregates: ecosystem/utils/*.md + ecosystem/utils/types/*.md
|
|
399
|
+
getUtilDocumentation(utilName) {
|
|
400
|
+
const candidates = [
|
|
401
|
+
join(this.utilsDir, `${utilName}.md`),
|
|
402
|
+
join(this.utilsTypesDir, `${utilName}.md`)
|
|
403
|
+
];
|
|
404
|
+
for (const path of candidates) {
|
|
405
|
+
const content = this.readMarkdownFile(path);
|
|
406
|
+
if (content)
|
|
407
|
+
return content;
|
|
408
|
+
}
|
|
409
|
+
return "";
|
|
410
|
+
}
|
|
411
|
+
getAllUtils() {
|
|
412
|
+
const utils = /* @__PURE__ */ new Set([
|
|
413
|
+
...this.listMarkdownFiles(this.utilsDir),
|
|
414
|
+
...this.listMarkdownFiles(this.utilsTypesDir)
|
|
415
|
+
]);
|
|
416
|
+
return Array.from(utils).sort();
|
|
417
|
+
}
|
|
418
|
+
// ========== NODE ==========
|
|
419
|
+
getNodeDocumentation(nodeName) {
|
|
420
|
+
const nodePath = join(this.nodeDir, `${nodeName}.md`);
|
|
421
|
+
return this.readMarkdownFile(nodePath);
|
|
360
422
|
}
|
|
361
|
-
|
|
362
|
-
return this.listMarkdownFiles(this.
|
|
423
|
+
getAllNode() {
|
|
424
|
+
return this.listMarkdownFiles(this.nodeDir);
|
|
363
425
|
}
|
|
364
426
|
// ========== UNIFIED LOADING ==========
|
|
365
427
|
getAllDocuments() {
|
|
@@ -375,7 +437,8 @@ ${generatedDoc}`;
|
|
|
375
437
|
{ type: "composable", names: this.getAllComposables(), getContent: (name) => this.getComposableDocumentation(name) },
|
|
376
438
|
{ type: "directive", names: this.getAllDirectives(), getContent: (name) => this.getDirectiveDocumentation(name) },
|
|
377
439
|
{ type: "plugin", names: this.getAllPlugins(), getContent: (name) => this.getPluginDocumentation(name) },
|
|
378
|
-
{ type: "
|
|
440
|
+
{ type: "util", names: this.getAllUtils(), getContent: (name) => this.getUtilDocumentation(name) },
|
|
441
|
+
{ type: "node", names: this.getAllNode(), getContent: (name) => this.getNodeDocumentation(name) }
|
|
379
442
|
];
|
|
380
443
|
for (const category of categories) {
|
|
381
444
|
for (const name of category.names) {
|
|
@@ -403,52 +466,33 @@ ${generatedDoc}`;
|
|
|
403
466
|
searchDocumentation(query) {
|
|
404
467
|
const searchTerm = query.toLowerCase();
|
|
405
468
|
const results = [];
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (composable.toLowerCase().includes(searchTerm)) {
|
|
421
|
-
results.push(`composable:${composable}`);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
const directives = this.getAllDirectives();
|
|
425
|
-
for (const directive of directives) {
|
|
426
|
-
if (directive.toLowerCase().includes(searchTerm)) {
|
|
427
|
-
results.push(`directive:${directive}`);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
const plugins = this.getAllPlugins();
|
|
431
|
-
for (const plugin of plugins) {
|
|
432
|
-
if (plugin.toLowerCase().includes(searchTerm)) {
|
|
433
|
-
results.push(`plugin:${plugin}`);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
const helpers = this.getAllHelpers();
|
|
437
|
-
for (const helper of helpers) {
|
|
438
|
-
if (helper.toLowerCase().includes(searchTerm)) {
|
|
439
|
-
results.push(`helper:${helper}`);
|
|
469
|
+
const buckets = [
|
|
470
|
+
{ type: "component", names: this.getAllComponents() },
|
|
471
|
+
{ type: "guide", names: this.getAllGuides() },
|
|
472
|
+
{ type: "composable", names: this.getAllComposables() },
|
|
473
|
+
{ type: "directive", names: this.getAllDirectives() },
|
|
474
|
+
{ type: "plugin", names: this.getAllPlugins() },
|
|
475
|
+
{ type: "util", names: this.getAllUtils() },
|
|
476
|
+
{ type: "node", names: this.getAllNode() }
|
|
477
|
+
];
|
|
478
|
+
for (const { type, names } of buckets) {
|
|
479
|
+
for (const name of names) {
|
|
480
|
+
if (name.toLowerCase().includes(searchTerm)) {
|
|
481
|
+
results.push(`${type}:${name}`);
|
|
482
|
+
}
|
|
440
483
|
}
|
|
441
484
|
}
|
|
442
485
|
return results;
|
|
443
486
|
}
|
|
444
487
|
getDiagnostics() {
|
|
445
|
-
const [components, guides, composables, directives, plugins,
|
|
488
|
+
const [components, guides, composables, directives, plugins, utils, nodeItems] = [
|
|
446
489
|
this.getAllComponents(),
|
|
447
490
|
this.getAllGuides(),
|
|
448
491
|
this.getAllComposables(),
|
|
449
492
|
this.getAllDirectives(),
|
|
450
493
|
this.getAllPlugins(),
|
|
451
|
-
this.
|
|
494
|
+
this.getAllUtils(),
|
|
495
|
+
this.getAllNode()
|
|
452
496
|
];
|
|
453
497
|
let withManualDoc = 0;
|
|
454
498
|
let withGeneratedDoc = 0;
|
|
@@ -486,9 +530,13 @@ ${generatedDoc}`;
|
|
|
486
530
|
total: plugins.length,
|
|
487
531
|
list: plugins
|
|
488
532
|
},
|
|
489
|
-
|
|
490
|
-
total:
|
|
491
|
-
list:
|
|
533
|
+
utils: {
|
|
534
|
+
total: utils.length,
|
|
535
|
+
list: utils
|
|
536
|
+
},
|
|
537
|
+
node: {
|
|
538
|
+
total: nodeItems.length,
|
|
539
|
+
list: nodeItems
|
|
492
540
|
},
|
|
493
541
|
paths: {
|
|
494
542
|
docsRoot: this.docsRoot,
|
|
@@ -498,7 +546,10 @@ ${generatedDoc}`;
|
|
|
498
546
|
composablesDir: this.composablesDir,
|
|
499
547
|
directivesDir: this.directivesDir,
|
|
500
548
|
pluginsDir: this.pluginsDir,
|
|
501
|
-
|
|
549
|
+
ecosystemDir: this.ecosystemDir,
|
|
550
|
+
utilsDir: this.utilsDir,
|
|
551
|
+
nodeDir: this.nodeDir,
|
|
552
|
+
iconsDir: this.iconsDir
|
|
502
553
|
}
|
|
503
554
|
};
|
|
504
555
|
}
|
|
@@ -926,24 +977,44 @@ class MazUiMcpServer {
|
|
|
926
977
|
uri: `plugin://${plugin}`
|
|
927
978
|
});
|
|
928
979
|
}
|
|
929
|
-
const
|
|
930
|
-
for (const
|
|
931
|
-
const
|
|
980
|
+
const utils = this.documentationService.getAllUtils();
|
|
981
|
+
for (const util of utils) {
|
|
982
|
+
const utilType = this.getUtilType(util);
|
|
932
983
|
const tags = [
|
|
933
|
-
"
|
|
984
|
+
"util",
|
|
934
985
|
"utility",
|
|
935
986
|
"function",
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
987
|
+
"maz-ui-utils",
|
|
988
|
+
util,
|
|
989
|
+
utilType,
|
|
990
|
+
...this.generateSearchTags(util)
|
|
939
991
|
];
|
|
940
992
|
index.push({
|
|
941
|
-
type: "
|
|
942
|
-
name:
|
|
943
|
-
displayName: `${
|
|
944
|
-
description: `Utility
|
|
993
|
+
type: "util",
|
|
994
|
+
name: util,
|
|
995
|
+
displayName: `${util} Util`,
|
|
996
|
+
description: `Utility from @maz-ui/utils: ${util} - ${utilType} utility for data processing and manipulation`,
|
|
945
997
|
tags,
|
|
946
|
-
uri: `
|
|
998
|
+
uri: `util://${util}`
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
const nodeItems = this.documentationService.getAllNode();
|
|
1002
|
+
for (const nodeItem of nodeItems) {
|
|
1003
|
+
const tags = [
|
|
1004
|
+
"node",
|
|
1005
|
+
"server",
|
|
1006
|
+
"cli",
|
|
1007
|
+
"maz-ui-node",
|
|
1008
|
+
nodeItem,
|
|
1009
|
+
...this.generateSearchTags(nodeItem)
|
|
1010
|
+
];
|
|
1011
|
+
index.push({
|
|
1012
|
+
type: "node",
|
|
1013
|
+
name: nodeItem,
|
|
1014
|
+
displayName: `${nodeItem} Node Utility`,
|
|
1015
|
+
description: `Node.js utility from @maz-ui/node: ${nodeItem} - server-side helper for scripts, CLI and SSR runtimes`,
|
|
1016
|
+
tags,
|
|
1017
|
+
uri: `node://${nodeItem}`
|
|
947
1018
|
});
|
|
948
1019
|
}
|
|
949
1020
|
this.documentationIndex = index;
|
|
@@ -1016,10 +1087,10 @@ class MazUiMcpServer {
|
|
|
1016
1087
|
return "general";
|
|
1017
1088
|
}
|
|
1018
1089
|
/**
|
|
1019
|
-
* Determine
|
|
1090
|
+
* Determine util type for better categorization
|
|
1020
1091
|
*/
|
|
1021
|
-
|
|
1022
|
-
const lowerName =
|
|
1092
|
+
getUtilType(utilName) {
|
|
1093
|
+
const lowerName = utilName.toLowerCase();
|
|
1023
1094
|
if (lowerName.includes("string") || lowerName.includes("text"))
|
|
1024
1095
|
return "string";
|
|
1025
1096
|
if (lowerName.includes("date") || lowerName.includes("time"))
|
|
@@ -1145,9 +1216,10 @@ class MazUiMcpServer {
|
|
|
1145
1216
|
composable: "Composables",
|
|
1146
1217
|
directive: "Directives",
|
|
1147
1218
|
plugin: "Plugins",
|
|
1148
|
-
|
|
1219
|
+
util: "Utils",
|
|
1220
|
+
node: "Node Utilities"
|
|
1149
1221
|
};
|
|
1150
|
-
const typeOrder = ["component", "guide", "composable", "directive", "plugin", "
|
|
1222
|
+
const typeOrder = ["component", "guide", "composable", "directive", "plugin", "util", "node"];
|
|
1151
1223
|
let result = `# Maz-UI Documentation (${filteredIndex.length} items)
|
|
1152
1224
|
|
|
1153
1225
|
`;
|
|
@@ -1230,7 +1302,8 @@ ${suggestions}
|
|
|
1230
1302
|
composable: (name) => this.documentationService.getComposableDocumentation(name),
|
|
1231
1303
|
directive: (name) => this.documentationService.getDirectiveDocumentation(name),
|
|
1232
1304
|
plugin: (name) => this.documentationService.getPluginDocumentation(name),
|
|
1233
|
-
|
|
1305
|
+
util: (name) => this.documentationService.getUtilDocumentation(name),
|
|
1306
|
+
node: (name) => this.documentationService.getNodeDocumentation(name)
|
|
1234
1307
|
};
|
|
1235
1308
|
const getContent = contentMethods[doc.type];
|
|
1236
1309
|
return getContent ? getContent(doc.name) : "";
|
|
@@ -1277,7 +1350,8 @@ ${suggestions}
|
|
|
1277
1350
|
- **${diagnostics.composables.total} Composables** - Vue 3 reactive utilities
|
|
1278
1351
|
- **${diagnostics.directives.total} Directives** - DOM helpers
|
|
1279
1352
|
- **${diagnostics.plugins.total} Plugins** - App-wide services
|
|
1280
|
-
- **${diagnostics.
|
|
1353
|
+
- **${diagnostics.utils.total} Utils** - Utility functions from @maz-ui/utils
|
|
1354
|
+
- **${diagnostics.node.total} Node Utilities** - Server-side helpers from @maz-ui/node
|
|
1281
1355
|
- **${diagnostics.guides.total} Guides** - Documentation
|
|
1282
1356
|
|
|
1283
1357
|
## Getting Started
|
|
@@ -1302,11 +1376,14 @@ Use the MCP tools to explore components and features:
|
|
|
1302
1376
|
case "plugin":
|
|
1303
1377
|
content = this.documentationService.getPluginDocumentation(name);
|
|
1304
1378
|
break;
|
|
1305
|
-
case "
|
|
1306
|
-
content = this.documentationService.
|
|
1379
|
+
case "util":
|
|
1380
|
+
content = this.documentationService.getUtilDocumentation(name);
|
|
1381
|
+
break;
|
|
1382
|
+
case "node":
|
|
1383
|
+
content = this.documentationService.getNodeDocumentation(name);
|
|
1307
1384
|
break;
|
|
1308
1385
|
default:
|
|
1309
|
-
throw new Error(`Unknown resource type: ${type}. Valid types: overview, component, guide, composable, directive, plugin,
|
|
1386
|
+
throw new Error(`Unknown resource type: ${type}. Valid types: overview, component, guide, composable, directive, plugin, util, node`);
|
|
1310
1387
|
}
|
|
1311
1388
|
if (!content) {
|
|
1312
1389
|
throw new Error(`Documentation not found for ${type}: ${name}`);
|
|
@@ -1337,7 +1414,7 @@ Use the MCP tools to explore components and features:
|
|
|
1337
1414
|
},
|
|
1338
1415
|
category: {
|
|
1339
1416
|
type: "string",
|
|
1340
|
-
enum: ["component", "guide", "composable", "directive", "plugin", "
|
|
1417
|
+
enum: ["component", "guide", "composable", "directive", "plugin", "util", "node"],
|
|
1341
1418
|
description: "Optional filter to restrict results to a specific documentation category"
|
|
1342
1419
|
},
|
|
1343
1420
|
maxResults: {
|
|
@@ -1363,7 +1440,7 @@ Use the MCP tools to explore components and features:
|
|
|
1363
1440
|
},
|
|
1364
1441
|
type: {
|
|
1365
1442
|
type: "string",
|
|
1366
|
-
enum: ["auto", "component", "guide", "composable", "directive", "plugin", "
|
|
1443
|
+
enum: ["auto", "component", "guide", "composable", "directive", "plugin", "util", "node"],
|
|
1367
1444
|
description: 'Type hint to improve search accuracy (optional). Use "auto" to search all types.',
|
|
1368
1445
|
default: "auto"
|
|
1369
1446
|
}
|
|
@@ -1373,13 +1450,13 @@ Use the MCP tools to explore components and features:
|
|
|
1373
1450
|
},
|
|
1374
1451
|
{
|
|
1375
1452
|
name: "list",
|
|
1376
|
-
description: "Browse all available Maz-UI documentation grouped by category. Returns a structured list with counters per category and for each item: name, displayName, description. Use this tool to discover what components, composables, directives, plugins,
|
|
1453
|
+
description: "Browse all available Maz-UI documentation grouped by category. Returns a structured list with counters per category and for each item: name, displayName, description. Use this tool to discover what components, composables, directives, plugins, utils, node utilities and guides are available. Examples: list all docs, list only components, list composables.",
|
|
1377
1454
|
inputSchema: {
|
|
1378
1455
|
type: "object",
|
|
1379
1456
|
properties: {
|
|
1380
1457
|
category: {
|
|
1381
1458
|
type: "string",
|
|
1382
|
-
enum: ["all", "component", "guide", "composable", "directive", "plugin", "
|
|
1459
|
+
enum: ["all", "component", "guide", "composable", "directive", "plugin", "util", "node"],
|
|
1383
1460
|
description: 'Filter by documentation category. Use "all" or omit to see everything.',
|
|
1384
1461
|
default: "all"
|
|
1385
1462
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
## Props
|
|
2
2
|
|
|
3
|
-
| Name | Description | Type
|
|
4
|
-
| ----------------------- | --------------------------------------------------------------- |
|
|
5
|
-
| **style** | The style of the component | `Native type`
|
|
6
|
-
| **class** | The class of the component | `Native type`
|
|
7
|
-
| **src** | The source of the image | `string \| null`
|
|
8
|
-
| **caption** | The caption of the avatar | `string \| null`
|
|
9
|
-
| **href** | The link of the avatar | `string`
|
|
10
|
-
| **to** | The link (router-link or nuxt-link) of the avatar | `string \| Record`
|
|
11
|
-
| **alt** | The alt of the image | `string`
|
|
12
|
-
| **target** | The target of the link | `string`
|
|
13
|
-
| **size** | The size of the avatar | `MazSizeUnit`
|
|
14
|
-
| **bordered** | Add a border to the avatar | `boolean`
|
|
15
|
-
| **clickable** | Make the avatar clickable | `boolean`
|
|
16
|
-
| **square** | Make the avatar square | `boolean`
|
|
17
|
-
| **no-elevation** | Remove the shadow | `boolean`
|
|
18
|
-
| **show-caption** | Show the caption | `boolean`
|
|
19
|
-
| **image-height-full** | Make the image height full | `boolean`
|
|
20
|
-
| **hide-loader** | Remove the loader | `boolean`
|
|
21
|
-
| **button-color** | The color of the clickable button | `MazColor`
|
|
22
|
-
| **hide-clickable-icon** | Remove the icon on hover when component is clickable | `boolean`
|
|
23
|
-
| **letter-count** | Number of letters to display in the round text | `number`
|
|
24
|
-
| **rounded-size** | Size of the rounded | `
|
|
25
|
-
| **fallback-src** | The fallback src to replace the src on loading error | `string`
|
|
26
|
-
| **loading** | The loading strategy of the image - lazy, eager or intersecting | `"lazy" \| "eager" \| "intersecting"`
|
|
27
|
-
| **color** | The color of the avatar | `MazColor`
|
|
3
|
+
| Name | Description | Type | Required | Default | Possible values |
|
|
4
|
+
| ----------------------- | --------------------------------------------------------------- | ------------------------------------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
5
|
+
| **style** | The style of the component | `Native type` | No | `undefined` | - |
|
|
6
|
+
| **class** | The class of the component | `Native type` | No | `undefined` | - |
|
|
7
|
+
| **src** | The source of the image | `string \| null` | No | `undefined` | - |
|
|
8
|
+
| **caption** | The caption of the avatar | `string \| null` | No | `undefined` | - |
|
|
9
|
+
| **href** | The link of the avatar | `string` | No | `undefined` | - |
|
|
10
|
+
| **to** | The link (router-link or nuxt-link) of the avatar | `string \| Record` | No | `undefined` | - |
|
|
11
|
+
| **alt** | The alt of the image | `string` | No | `undefined` | - |
|
|
12
|
+
| **target** | The target of the link | `string` | No | `undefined` | - |
|
|
13
|
+
| **size** | The size of the avatar | `MazSizeUnit` | No | `undefined` | - |
|
|
14
|
+
| **bordered** | Add a border to the avatar | `boolean` | No | `undefined` | - |
|
|
15
|
+
| **clickable** | Make the avatar clickable | `boolean` | No | `undefined` | - |
|
|
16
|
+
| **square** | Make the avatar square | `boolean` | No | `undefined` | - |
|
|
17
|
+
| **no-elevation** | Remove the shadow | `boolean` | No | `undefined` | - |
|
|
18
|
+
| **show-caption** | Show the caption | `boolean` | No | `undefined` | - |
|
|
19
|
+
| **image-height-full** | Make the image height full | `boolean` | No | `undefined` | - |
|
|
20
|
+
| **hide-loader** | Remove the loader | `boolean` | No | `undefined` | - |
|
|
21
|
+
| **button-color** | The color of the clickable button | `MazColor` | No | `undefined` | `"primary" \| "secondary" \| "accent" \| "info" \| "success" \| "warning" \| "destructive" \| "contrast" \| "transparent"` |
|
|
22
|
+
| **hide-clickable-icon** | Remove the icon on hover when component is clickable | `boolean` | No | `undefined` | - |
|
|
23
|
+
| **letter-count** | Number of letters to display in the round text | `number` | No | `undefined` | - |
|
|
24
|
+
| **rounded-size** | Size of the rounded | `MazRoundedSize` | No | `undefined` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` |
|
|
25
|
+
| **fallback-src** | The fallback src to replace the src on loading error | `string` | No | `undefined` | - |
|
|
26
|
+
| **loading** | The loading strategy of the image - lazy, eager or intersecting | `"lazy" \| "eager" \| "intersecting"` | No | `intersecting` | `'lazy' \| 'eager' \| 'intersecting'` |
|
|
27
|
+
| **color** | The color of the avatar | `MazColor` | No | `undefined` | `"primary" \| "secondary" \| "accent" \| "info" \| "success" \| "warning" \| "destructive" \| "contrast" \| "transparent"` |
|
|
28
28
|
|
|
29
29
|
## Events
|
|
30
30
|
|