@primevue/mcp 0.0.1-alpha.6 → 0.0.1-alpha.7
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/dist/index.mjs +73528 -0
- package/package.json +9 -12
- package/data/components.json +0 -40160
- package/dist/index.js +0 -132
- /package/dist/{index.d.ts → index.d.mts} +0 -0
package/dist/index.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/index.ts
|
|
4
|
-
import { runPrimeMcpServer } from "@primeuix/mcp";
|
|
5
|
-
import ComponentJson from "@primevue/mcp/data/components.json";
|
|
6
|
-
import pkg from "@primevue/mcp/package.json";
|
|
7
|
-
var composables = [
|
|
8
|
-
{
|
|
9
|
-
name: "useToast",
|
|
10
|
-
description: "Programmatically display toast messages",
|
|
11
|
-
related_component: "Toast",
|
|
12
|
-
usage: `import { useToast } from 'primevue/usetoast';
|
|
13
|
-
const toast = useToast();`,
|
|
14
|
-
example: `toast.add({ severity: 'success', summary: 'Success', detail: 'Message', life: 3000 });`
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "useConfirm",
|
|
18
|
-
description: "Programmatically display confirmation dialogs",
|
|
19
|
-
related_component: "ConfirmDialog",
|
|
20
|
-
usage: `import { useConfirm } from 'primevue/useconfirm';
|
|
21
|
-
const confirm = useConfirm();`,
|
|
22
|
-
example: `confirm.require({ message: 'Are you sure?', header: 'Confirm', accept: () => {} });`
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "useDialog",
|
|
26
|
-
description: "Programmatically create dynamic dialogs",
|
|
27
|
-
related_component: "DynamicDialog",
|
|
28
|
-
usage: `import { useDialog } from 'primevue/usedialog';
|
|
29
|
-
const dialog = useDialog();`,
|
|
30
|
-
example: `dialog.open(MyComponent, { props: { header: 'Dialog' } });`
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "useStyle",
|
|
34
|
-
description: "Inject custom styles",
|
|
35
|
-
related_component: null,
|
|
36
|
-
usage: `import { useStyle } from 'primevue/usestyle';
|
|
37
|
-
useStyle(css, { name: 'my-styles' });`,
|
|
38
|
-
example: `useStyle('.my-class { color: red; }', { name: 'custom' });`
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "usePrimeVue",
|
|
42
|
-
description: "Access PrimeVue configuration",
|
|
43
|
-
related_component: null,
|
|
44
|
-
usage: `import { usePrimeVue } from 'primevue/config';
|
|
45
|
-
const primevue = usePrimeVue();`,
|
|
46
|
-
example: `primevue.config.ripple = true;`
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
runPrimeMcpServer({
|
|
50
|
-
name: "@primevue/mcp",
|
|
51
|
-
version: pkg.version,
|
|
52
|
-
baseUrl: "https://primevue.org",
|
|
53
|
-
frameworkName: "PrimeVue",
|
|
54
|
-
slotKey: "slots",
|
|
55
|
-
codeLanguage: "javascript",
|
|
56
|
-
compatibility: "Vue 3.x",
|
|
57
|
-
loadComponentsData: async () => ComponentJson,
|
|
58
|
-
customTools: [
|
|
59
|
-
// Vue-specific: list_composables
|
|
60
|
-
{
|
|
61
|
-
name: "list_composables",
|
|
62
|
-
description: "List all available PrimeVue composables with their descriptions",
|
|
63
|
-
parameters: {},
|
|
64
|
-
handler: async () => {
|
|
65
|
-
return {
|
|
66
|
-
content: [
|
|
67
|
-
{
|
|
68
|
-
type: "text",
|
|
69
|
-
text: JSON.stringify(
|
|
70
|
-
{
|
|
71
|
-
total: composables.length,
|
|
72
|
-
composables: composables.map((c) => ({
|
|
73
|
-
name: c.name,
|
|
74
|
-
description: c.description,
|
|
75
|
-
related_component: c.related_component
|
|
76
|
-
}))
|
|
77
|
-
},
|
|
78
|
-
null,
|
|
79
|
-
2
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// Vue-specific: get_composable
|
|
87
|
-
{
|
|
88
|
-
name: "get_composable",
|
|
89
|
-
description: "Get detailed information about a specific PrimeVue composable",
|
|
90
|
-
parameters: {
|
|
91
|
-
name: {
|
|
92
|
-
type: "string",
|
|
93
|
-
description: "Composable name (e.g., 'useToast', 'useConfirm')",
|
|
94
|
-
required: true
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
handler: async (_data, args) => {
|
|
98
|
-
const nameArg = args?.name;
|
|
99
|
-
if (!nameArg) {
|
|
100
|
-
return {
|
|
101
|
-
content: [
|
|
102
|
-
{
|
|
103
|
-
type: "text",
|
|
104
|
-
text: `Please provide a composable name. Available: ${composables.map((c) => c.name).join(", ")}`
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
const name = nameArg.toLowerCase();
|
|
110
|
-
const composable = composables.find((c) => c.name.toLowerCase() === name);
|
|
111
|
-
if (!composable) {
|
|
112
|
-
return {
|
|
113
|
-
content: [
|
|
114
|
-
{
|
|
115
|
-
type: "text",
|
|
116
|
-
text: `Composable "${nameArg}" not found. Available: ${composables.map((c) => c.name).join(", ")}`
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
content: [
|
|
123
|
-
{
|
|
124
|
-
type: "text",
|
|
125
|
-
text: JSON.stringify(composable, null, 2)
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
});
|
|
File without changes
|