@qikdev/mcp 6.6.43 → 6.6.46
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/build/src/tools/component-marketplace.d.ts +96 -0
- package/build/src/tools/component-marketplace.d.ts.map +1 -0
- package/build/src/tools/component-marketplace.js +259 -0
- package/build/src/tools/component-marketplace.js.map +1 -0
- package/build/src/tools/components.d.ts +23 -0
- package/build/src/tools/components.d.ts.map +1 -0
- package/build/src/tools/components.js +388 -0
- package/build/src/tools/components.js.map +1 -0
- package/build/src/tools/create.d.ts.map +1 -1
- package/build/src/tools/create.js +38 -0
- package/build/src/tools/create.js.map +1 -1
- package/build/src/tools/enhanced-interfaces.d.ts +21 -0
- package/build/src/tools/enhanced-interfaces.d.ts.map +1 -0
- package/build/src/tools/enhanced-interfaces.js +64 -0
- package/build/src/tools/enhanced-interfaces.js.map +1 -0
- package/build/src/tools/index.d.ts.map +1 -1
- package/build/src/tools/index.js +20 -0
- package/build/src/tools/index.js.map +1 -1
- package/build/src/tools/interface-builder.d.ts +19 -0
- package/build/src/tools/interface-builder.d.ts.map +1 -0
- package/build/src/tools/interface-builder.js +477 -0
- package/build/src/tools/interface-builder.js.map +1 -0
- package/build/src/tools/interfaces.d.ts +23 -0
- package/build/src/tools/interfaces.d.ts.map +1 -0
- package/build/src/tools/interfaces.js +821 -0
- package/build/src/tools/interfaces.js.map +1 -0
- package/build/src/tools/nlp-parser.d.ts +33 -0
- package/build/src/tools/nlp-parser.d.ts.map +1 -0
- package/build/src/tools/nlp-parser.js +258 -0
- package/build/src/tools/nlp-parser.js.map +1 -0
- package/build/src/tools/profile.d.ts +55 -0
- package/build/src/tools/profile.d.ts.map +1 -0
- package/build/src/tools/profile.js +173 -0
- package/build/src/tools/profile.js.map +1 -0
- package/build/src/tools/route-generator.d.ts +61 -0
- package/build/src/tools/route-generator.d.ts.map +1 -0
- package/build/src/tools/route-generator.js +388 -0
- package/build/src/tools/route-generator.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Marketplace Service
|
|
3
|
+
* Fetches and categorizes components from the Qik marketplace
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketplaceComponent {
|
|
6
|
+
_id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
category?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
fields?: ComponentField[];
|
|
12
|
+
slots?: ComponentSlot[];
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentField {
|
|
16
|
+
title: string;
|
|
17
|
+
key: string;
|
|
18
|
+
type: string;
|
|
19
|
+
widget?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
minimum?: number;
|
|
22
|
+
maximum?: number;
|
|
23
|
+
defaultValues?: any[];
|
|
24
|
+
options?: any[];
|
|
25
|
+
}
|
|
26
|
+
export interface ComponentSlot {
|
|
27
|
+
title: string;
|
|
28
|
+
key: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ComponentCategory {
|
|
31
|
+
name: string;
|
|
32
|
+
components: MarketplaceComponent[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Known component IDs from the Qik marketplace
|
|
36
|
+
*/
|
|
37
|
+
export declare const KNOWN_COMPONENTS: {
|
|
38
|
+
WEBSITE_SECTION: string;
|
|
39
|
+
BASIC_TEXT: string;
|
|
40
|
+
CUSTOM_CODE: string;
|
|
41
|
+
DYNAMIC_LIST: string;
|
|
42
|
+
BASIC_FORM: string;
|
|
43
|
+
COMBINED_AUTH: string;
|
|
44
|
+
USER_LOGIN: string;
|
|
45
|
+
USER_SIGNUP: string;
|
|
46
|
+
BASIC_IMAGE: string;
|
|
47
|
+
IMAGE_STRIP: string;
|
|
48
|
+
HORIZONTAL_MENU: string;
|
|
49
|
+
VERTICAL_MENU: string;
|
|
50
|
+
HAMBURGER_MENU: string;
|
|
51
|
+
BASIC_HEADER: string;
|
|
52
|
+
BASIC_DIV: string;
|
|
53
|
+
TABSET: string;
|
|
54
|
+
ACCORDION: string;
|
|
55
|
+
FLEX_ROW: string;
|
|
56
|
+
BUTTON: string;
|
|
57
|
+
VIDEO: string;
|
|
58
|
+
NOTIFICATIONS: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Fetch available components from the marketplace
|
|
62
|
+
*/
|
|
63
|
+
export declare function getMarketplaceComponents(config: any): Promise<MarketplaceComponent[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Get detailed component information including fields and slots
|
|
66
|
+
*/
|
|
67
|
+
export declare function getComponentDetails(componentId: string, config: any): Promise<MarketplaceComponent>;
|
|
68
|
+
/**
|
|
69
|
+
* Categorize components by their purpose
|
|
70
|
+
*/
|
|
71
|
+
export declare function categorizeComponents(components: MarketplaceComponent[]): Map<string, MarketplaceComponent[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Find best component for a specific purpose
|
|
74
|
+
*/
|
|
75
|
+
export declare function findComponent(purpose: string, components: MarketplaceComponent[]): MarketplaceComponent | null;
|
|
76
|
+
/**
|
|
77
|
+
* Find component by known ID
|
|
78
|
+
*/
|
|
79
|
+
export declare function getKnownComponent(id: string, components: MarketplaceComponent[]): MarketplaceComponent | null;
|
|
80
|
+
/**
|
|
81
|
+
* Select components for a page based on its type
|
|
82
|
+
*/
|
|
83
|
+
export declare function selectComponentsForPage(pageType: string, components: MarketplaceComponent[]): {
|
|
84
|
+
wrapper?: MarketplaceComponent;
|
|
85
|
+
primary?: MarketplaceComponent;
|
|
86
|
+
additional?: MarketplaceComponent[];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Get default model for a component based on its purpose
|
|
90
|
+
*/
|
|
91
|
+
export declare function getDefaultComponentModel(component: MarketplaceComponent, context?: any): Record<string, any>;
|
|
92
|
+
/**
|
|
93
|
+
* Generate UUID for section instances
|
|
94
|
+
*/
|
|
95
|
+
export declare function generateUUID(): string;
|
|
96
|
+
//# sourceMappingURL=component-marketplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-marketplace.d.ts","sourceRoot":"","sources":["../../../src/tools/component-marketplace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,oBAAoB,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;CAsB5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAc3F;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAazG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,oBAAoB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CA0C5G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,oBAAoB,EAAE,GACjC,oBAAoB,GAAG,IAAI,CAW7B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,oBAAoB,EAAE,GACjC,oBAAoB,GAAG,IAAI,CAE7B;AA8BD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,oBAAoB,EAAE,GACjC;IACD,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACrC,CA0CA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,CAAC,EAAE,GAAG,GACZ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgErB;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAOrC"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Marketplace Service
|
|
3
|
+
* Fetches and categorizes components from the Qik marketplace
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Known component IDs from the Qik marketplace
|
|
7
|
+
*/
|
|
8
|
+
export const KNOWN_COMPONENTS = {
|
|
9
|
+
WEBSITE_SECTION: '647d02f56348660726cc552d',
|
|
10
|
+
BASIC_TEXT: '62ba62fb63bd8436aae25c0c',
|
|
11
|
+
CUSTOM_CODE: '62b5a2bc6343c2335f85946b',
|
|
12
|
+
DYNAMIC_LIST: '62b5a2106343c2335f859364',
|
|
13
|
+
BASIC_FORM: '62de32c963e191f9fcf1bb4f',
|
|
14
|
+
COMBINED_AUTH: '67993dbe6312360244e84825',
|
|
15
|
+
USER_LOGIN: '63c70d5a63344d2c5796f460',
|
|
16
|
+
USER_SIGNUP: '63c70db063344d2c5796f5cf',
|
|
17
|
+
BASIC_IMAGE: '62b5a1c66343c2335f8592f2',
|
|
18
|
+
IMAGE_STRIP: '648b9f9963eaf5d82152aea3',
|
|
19
|
+
HORIZONTAL_MENU: '62cb6b33632006878e62c725',
|
|
20
|
+
VERTICAL_MENU: '64d84de663ed2a77be35dcc7',
|
|
21
|
+
HAMBURGER_MENU: '64efa78963194ff600fb3c2a',
|
|
22
|
+
BASIC_HEADER: '648998db63cac7bb7aed3e53',
|
|
23
|
+
BASIC_DIV: '64d86d3563ed2a77be372c9a',
|
|
24
|
+
TABSET: '650106c963a4ec4b1027b323',
|
|
25
|
+
ACCORDION: '65016e906320d925f4468a12',
|
|
26
|
+
FLEX_ROW: '64d8891a639c2df0adfa7409',
|
|
27
|
+
BUTTON: '64e9df77633c33405f9c318b',
|
|
28
|
+
VIDEO: '62b5a1c66343c2335f8592f2', // Placeholder
|
|
29
|
+
NOTIFICATIONS: '62eda21863c9dbdb26cf60ad'
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Fetch available components from the marketplace
|
|
33
|
+
*/
|
|
34
|
+
export async function getMarketplaceComponents(config) {
|
|
35
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/component/available`, {
|
|
36
|
+
headers: {
|
|
37
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`Failed to fetch marketplace components: HTTP ${response.status}`);
|
|
43
|
+
}
|
|
44
|
+
const apiResponse = await response.json();
|
|
45
|
+
return Array.isArray(apiResponse) ? apiResponse : (apiResponse.items || apiResponse.components || []);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get detailed component information including fields and slots
|
|
49
|
+
*/
|
|
50
|
+
export async function getComponentDetails(componentId, config) {
|
|
51
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/component/${componentId}/fields`, {
|
|
52
|
+
headers: {
|
|
53
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
54
|
+
'Content-Type': 'application/json',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
throw new Error(`Failed to fetch component details for ${componentId}: HTTP ${response.status}`);
|
|
59
|
+
}
|
|
60
|
+
return await response.json();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Categorize components by their purpose
|
|
64
|
+
*/
|
|
65
|
+
export function categorizeComponents(components) {
|
|
66
|
+
const categories = new Map();
|
|
67
|
+
const categoryPatterns = {
|
|
68
|
+
'layout': ['section', 'div', 'container', 'wrapper', 'flex', 'grid', 'row', 'column'],
|
|
69
|
+
'text': ['text', 'heading', 'paragraph', 'rich text'],
|
|
70
|
+
'media': ['image', 'video', 'audio', 'gallery', 'slider', 'carousel'],
|
|
71
|
+
'navigation': ['menu', 'nav', 'header', 'hamburger', 'breadcrumb'],
|
|
72
|
+
'forms': ['form', 'input', 'field', 'submit', 'contact'],
|
|
73
|
+
'authentication': ['login', 'signup', 'auth', 'signin', 'register'],
|
|
74
|
+
'content': ['list', 'dynamic', 'article', 'post', 'feed'],
|
|
75
|
+
'interactive': ['accordion', 'tab', 'modal', 'dropdown', 'toggle'],
|
|
76
|
+
'custom': ['custom', 'code', 'script'],
|
|
77
|
+
'ui': ['button', 'link', 'icon', 'badge', 'card'],
|
|
78
|
+
'notifications': ['notification', 'alert', 'toast', 'message']
|
|
79
|
+
};
|
|
80
|
+
components.forEach(component => {
|
|
81
|
+
const title = component.title.toLowerCase();
|
|
82
|
+
let categorized = false;
|
|
83
|
+
for (const [category, keywords] of Object.entries(categoryPatterns)) {
|
|
84
|
+
if (keywords.some(keyword => title.includes(keyword))) {
|
|
85
|
+
if (!categories.has(category)) {
|
|
86
|
+
categories.set(category, []);
|
|
87
|
+
}
|
|
88
|
+
categories.get(category).push(component);
|
|
89
|
+
categorized = true;
|
|
90
|
+
break; // Only add to first matching category
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// If not categorized, add to 'other'
|
|
94
|
+
if (!categorized) {
|
|
95
|
+
if (!categories.has('other')) {
|
|
96
|
+
categories.set('other', []);
|
|
97
|
+
}
|
|
98
|
+
categories.get('other').push(component);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return categories;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Find best component for a specific purpose
|
|
105
|
+
*/
|
|
106
|
+
export function findComponent(purpose, components) {
|
|
107
|
+
const searchTerms = getSearchTermsForPurpose(purpose);
|
|
108
|
+
for (const term of searchTerms) {
|
|
109
|
+
const found = components.find(comp => comp.title.toLowerCase().includes(term.toLowerCase()));
|
|
110
|
+
if (found)
|
|
111
|
+
return found;
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Find component by known ID
|
|
117
|
+
*/
|
|
118
|
+
export function getKnownComponent(id, components) {
|
|
119
|
+
return components.find(comp => comp._id === id) || null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get search terms for different purposes
|
|
123
|
+
*/
|
|
124
|
+
function getSearchTermsForPurpose(purpose) {
|
|
125
|
+
const purposeMap = {
|
|
126
|
+
'wrapper': ['website section', 'section', 'container'],
|
|
127
|
+
'text': ['basic text', 'text', 'rich text'],
|
|
128
|
+
'custom': ['custom code', 'custom', 'code'],
|
|
129
|
+
'list': ['dynamic list', 'list'],
|
|
130
|
+
'form': ['basic form', 'form', 'contact form'],
|
|
131
|
+
'auth': ['combined signup', 'login', 'auth'],
|
|
132
|
+
'login': ['user login', 'login'],
|
|
133
|
+
'signup': ['user signup', 'signup'],
|
|
134
|
+
'image': ['basic image', 'image'],
|
|
135
|
+
'gallery': ['image strip', 'gallery', 'slider'],
|
|
136
|
+
'menu-h': ['horizontal menu', 'menu'],
|
|
137
|
+
'menu-v': ['vertical menu', 'menu'],
|
|
138
|
+
'hamburger': ['hamburger', 'mobile menu'],
|
|
139
|
+
'button': ['button', 'link button'],
|
|
140
|
+
'div': ['basic div', 'div'],
|
|
141
|
+
'header': ['basic header', 'header'],
|
|
142
|
+
'tabs': ['tabset', 'tabs'],
|
|
143
|
+
'accordion': ['accordion']
|
|
144
|
+
};
|
|
145
|
+
return purposeMap[purpose] || [purpose];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Select components for a page based on its type
|
|
149
|
+
*/
|
|
150
|
+
export function selectComponentsForPage(pageType, components) {
|
|
151
|
+
const selection = {
|
|
152
|
+
additional: []
|
|
153
|
+
};
|
|
154
|
+
// Always use Website Section as wrapper
|
|
155
|
+
const wrapperComp = findComponent('wrapper', components);
|
|
156
|
+
if (wrapperComp)
|
|
157
|
+
selection.wrapper = wrapperComp;
|
|
158
|
+
switch (pageType) {
|
|
159
|
+
case 'static':
|
|
160
|
+
const textComp = findComponent('text', components);
|
|
161
|
+
if (textComp)
|
|
162
|
+
selection.primary = textComp;
|
|
163
|
+
break;
|
|
164
|
+
case 'form':
|
|
165
|
+
const formComp = findComponent('form', components);
|
|
166
|
+
if (formComp)
|
|
167
|
+
selection.primary = formComp;
|
|
168
|
+
break;
|
|
169
|
+
case 'list':
|
|
170
|
+
const listComp = findComponent('list', components);
|
|
171
|
+
if (listComp)
|
|
172
|
+
selection.primary = listComp;
|
|
173
|
+
break;
|
|
174
|
+
case 'detail':
|
|
175
|
+
case 'custom':
|
|
176
|
+
const customComp = findComponent('custom', components);
|
|
177
|
+
if (customComp)
|
|
178
|
+
selection.primary = customComp;
|
|
179
|
+
break;
|
|
180
|
+
case 'auth':
|
|
181
|
+
const authComp = findComponent('auth', components);
|
|
182
|
+
if (authComp)
|
|
183
|
+
selection.primary = authComp;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
return selection;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Get default model for a component based on its purpose
|
|
190
|
+
*/
|
|
191
|
+
export function getDefaultComponentModel(component, context) {
|
|
192
|
+
const title = component.title.toLowerCase();
|
|
193
|
+
const model = {};
|
|
194
|
+
// Website Section defaults
|
|
195
|
+
if (title.includes('website section')) {
|
|
196
|
+
model.outerClass = 'v-wrap';
|
|
197
|
+
model.innerClass = 'h-wrap';
|
|
198
|
+
model.center = false;
|
|
199
|
+
model.reverse = false;
|
|
200
|
+
model.hgap = 1;
|
|
201
|
+
model.vgap = 1;
|
|
202
|
+
}
|
|
203
|
+
// Basic Text defaults
|
|
204
|
+
if (title.includes('basic text')) {
|
|
205
|
+
model.text = context?.text || '<p>Content goes here</p>';
|
|
206
|
+
}
|
|
207
|
+
// Dynamic List defaults
|
|
208
|
+
if (title.includes('dynamic list')) {
|
|
209
|
+
model.contentType = context?.contentType || 'article';
|
|
210
|
+
model.limit = context?.limit || 50;
|
|
211
|
+
model.sort = context?.sort || {
|
|
212
|
+
key: 'meta.created',
|
|
213
|
+
direction: 'desc',
|
|
214
|
+
type: 'date'
|
|
215
|
+
};
|
|
216
|
+
model.select = context?.select || ['title', 'meta.created', 'meta.description', 'body'];
|
|
217
|
+
model.filter = {
|
|
218
|
+
operator: 'and',
|
|
219
|
+
filters: []
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// Basic Form defaults
|
|
223
|
+
if (title.includes('basic form') || title.includes('form')) {
|
|
224
|
+
model.displayTitle = context?.formTitle || 'Contact Us';
|
|
225
|
+
model.submitButtonText = 'Submit';
|
|
226
|
+
model.successBehaviour = 'message';
|
|
227
|
+
model.thanks = '<p>Thank you for your submission!</p>';
|
|
228
|
+
}
|
|
229
|
+
// Auth component defaults
|
|
230
|
+
if (title.includes('login') || title.includes('signup') || title.includes('auth')) {
|
|
231
|
+
model.hideTitle = context?.hideTitle || false;
|
|
232
|
+
model.redirectTo = context?.redirectTo || 'home';
|
|
233
|
+
model.redirectFromIntent = context?.redirectFromIntent !== false;
|
|
234
|
+
}
|
|
235
|
+
// Menu defaults
|
|
236
|
+
if (title.includes('menu')) {
|
|
237
|
+
model.menu = context?.menuName || 'primaryMenu';
|
|
238
|
+
model.subMenuItemBehavior = 'click';
|
|
239
|
+
}
|
|
240
|
+
// Custom Code defaults
|
|
241
|
+
if (title.includes('custom code') || title.includes('custom component')) {
|
|
242
|
+
model.javascript = context?.javascript || '{}';
|
|
243
|
+
model.html = context?.html || '<div></div>';
|
|
244
|
+
model.scss = context?.scss || '';
|
|
245
|
+
}
|
|
246
|
+
return model;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Generate UUID for section instances
|
|
250
|
+
*/
|
|
251
|
+
export function generateUUID() {
|
|
252
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
253
|
+
let result = '';
|
|
254
|
+
for (let i = 0; i < 10; i++) {
|
|
255
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=component-marketplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-marketplace.js","sourceRoot":"","sources":["../../../src/tools/component-marketplace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmCH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe,EAAE,0BAA0B;IAC3C,UAAU,EAAE,0BAA0B;IACtC,WAAW,EAAE,0BAA0B;IACvC,YAAY,EAAE,0BAA0B;IACxC,UAAU,EAAE,0BAA0B;IACtC,aAAa,EAAE,0BAA0B;IACzC,UAAU,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,IAAI,GAAG,OAAO,EAAE,QAAQ,IAAI,aAAa,CAAC;QAChD,KAAK,CAAC,mBAAmB,GAAG,OAAO,CAAC;IACtC,CAAC;IAED,uBAAuB;IACvB,IAAI,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACxE,KAAK,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC;QAC/C,KAAK,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,aAAa,CAAC;QAC5C,KAAK,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG,gEAAgE,CAAC;IAC/E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
export declare const getAvailableComponentsTool: Tool;
|
|
3
|
+
export declare const getComponentDetailsTool: Tool;
|
|
4
|
+
export declare const suggestComponentsTool: Tool;
|
|
5
|
+
export declare function handleGetAvailableComponents(args: any): Promise<{
|
|
6
|
+
content: Array<{
|
|
7
|
+
type: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function handleGetComponentDetails(args: any): Promise<{
|
|
12
|
+
content: Array<{
|
|
13
|
+
type: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function handleSuggestComponents(args: any): Promise<{
|
|
18
|
+
content: Array<{
|
|
19
|
+
type: string;
|
|
20
|
+
text: string;
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/tools/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAsC1D,eAAO,MAAM,0BAA0B,EAAE,IAiBxC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,IAcrC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,IAkBnC,CAAC;AAGF,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAwGzH;AAGD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA+FtH;AAGD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAwEpH"}
|