@stellisoft/stellify-mcp 0.1.28 → 0.1.29
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.js +162 -18
- package/dist/stellify-client.d.ts +7 -0
- package/dist/stellify-client.js +13 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ const STELLIFY_FRAMEWORK_API = {
|
|
|
23
23
|
// Data & Forms
|
|
24
24
|
Form: ['create', 'set', 'get', 'getData', 'validate', 'isValid', 'getErrors', 'getError', 'reset', 'store', 'update', 'delete'],
|
|
25
25
|
Table: ['create', 'setData', 'addColumn', 'removeColumn', 'sort', 'filter', 'clearFilter', 'paginate', 'page', 'getData', 'getAllData', 'getColumns', 'getColumn', 'getTotalRows', 'getTotalPages', 'getCurrentPage', 'getPageSize', 'getSortKey', 'getSortDirection'],
|
|
26
|
-
|
|
26
|
+
Collection: ['create', 'collect', 'from', 'range', 'add', 'remove', 'removeWhere', 'set', 'get', 'first', 'last', 'sort', 'sortBy', 'reverse', 'filter', 'find', 'findIndex', 'map', 'reduce', 'forEach', 'includes', 'indexOf', 'every', 'some', 'slice', 'take', 'skip', 'chunk', 'unique', 'uniqueBy', 'groupBy', 'flatten', 'concat', 'isEmpty', 'isNotEmpty', 'count', 'clear', 'toArray', 'toJSON', 'clone', 'sum', 'avg', 'min', 'max'],
|
|
27
27
|
Tree: ['create', 'setRoot', 'addChild', 'removeNode', 'getNode', 'getRoot', 'getChildren', 'getParent', 'getSiblings', 'getAncestors', 'getDescendants', 'getDepth', 'getPath', 'traverse', 'find', 'findAll', 'move', 'toArray', 'size'],
|
|
28
28
|
// Network
|
|
29
29
|
Http: ['create', 'get', 'post', 'put', 'patch', 'delete', 'items', 'withHeaders', 'withToken', 'withTimeout'],
|
|
@@ -74,11 +74,11 @@ Use this tool when you need to:
|
|
|
74
74
|
|
|
75
75
|
IMPORTANT - Stellify Framework Import:
|
|
76
76
|
The npm package is "stellify-framework" (NOT @stellify/core).
|
|
77
|
-
Import like: import { Http,
|
|
77
|
+
Import like: import { Http, Collection, Form } from 'stellify-framework';
|
|
78
78
|
|
|
79
|
-
IMPORTANT -
|
|
80
|
-
|
|
81
|
-
Use
|
|
79
|
+
IMPORTANT - Collection class and Vue reactivity:
|
|
80
|
+
Collection is iterable and works directly with Vue's v-for directive.
|
|
81
|
+
Use Collection.collect() to wrap arrays for chainable operations (filter, map, sort, etc.).
|
|
82
82
|
|
|
83
83
|
Example response:
|
|
84
84
|
{
|
|
@@ -128,9 +128,11 @@ COMPLETE WORKFLOW:
|
|
|
128
128
|
4. html_to_elements → create template elements (returns element UUIDs)
|
|
129
129
|
5. save_file → FINALIZE by wiring template/data arrays with all collected UUIDs
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
TWO-STEP ALTERNATIVES (still supported but prefer combined tools above):
|
|
132
132
|
- create_statement + add_statement_code (2 calls instead of 1)
|
|
133
|
-
- create_method
|
|
133
|
+
- create_method (without body) + add_method_body (2 calls instead of 1)
|
|
134
|
+
|
|
135
|
+
NOTE: add_method_body is also useful for APPENDING code to an existing method.
|
|
134
136
|
|
|
135
137
|
For PHP: Use type='class', 'model', 'controller', or 'middleware'.
|
|
136
138
|
For Vue: Use type='js' and extension='vue'. Place in the 'js' directory.
|
|
@@ -287,16 +289,17 @@ Example response includes:
|
|
|
287
289
|
},
|
|
288
290
|
{
|
|
289
291
|
name: 'add_method_body',
|
|
290
|
-
description: `
|
|
292
|
+
description: `Append code to an existing method. Use this when you need to ADD MORE code to a method that already has statements.
|
|
293
|
+
|
|
294
|
+
**For new methods:** Use \`create_method\` with the \`body\` parameter instead - it creates the method with code in one call.
|
|
291
295
|
|
|
292
296
|
**Nested code is handled correctly.** The parser tracks brace/bracket/paren depth and only splits on semicolons at the top level. Arrow functions with block bodies, computed properties, and other nested constructs work as single statements.
|
|
293
297
|
|
|
294
|
-
IMPORTANT: This APPENDS to existing method statements. To REPLACE a method's code:
|
|
295
|
-
1. Create a NEW method with create_method
|
|
296
|
-
2.
|
|
297
|
-
3. Update
|
|
298
|
-
4.
|
|
299
|
-
5. Optionally delete the old method with delete_method`,
|
|
298
|
+
IMPORTANT: This APPENDS to existing method statements. To REPLACE a method's code entirely:
|
|
299
|
+
1. Create a NEW method with create_method (with body parameter)
|
|
300
|
+
2. Update the file's 'data' array to include new method UUID (remove old one)
|
|
301
|
+
3. Update any element click handlers to reference the new method UUID
|
|
302
|
+
4. Delete the old method with delete_method`,
|
|
300
303
|
inputSchema: {
|
|
301
304
|
type: 'object',
|
|
302
305
|
properties: {
|
|
@@ -696,6 +699,11 @@ Create methods for all handlers, including simple state changes like opening mod
|
|
|
696
699
|
|
|
697
700
|
Event types: click, submit, change, input, focus, blur, keydown, keyup, mouseenter, mouseleave.
|
|
698
701
|
|
|
702
|
+
DYNAMIC CLASS BINDINGS - For classes that toggle based on expressions:
|
|
703
|
+
{ "classBindings": { "rotate-180": "panel.open", "bg-red-500": "hasError" } }
|
|
704
|
+
Assembles to: :class="{ 'rotate-180': panel.open, 'bg-red-500': hasError }"
|
|
705
|
+
Use for state-dependent styling in v-for loops or reactive components.
|
|
706
|
+
|
|
699
707
|
EFFICIENCY - Prefer updates over delete/recreate:
|
|
700
708
|
- Move between routes: change \`routeParent\` attribute
|
|
701
709
|
- Reparent elements: change \`parent\` attribute
|
|
@@ -709,7 +717,7 @@ EFFICIENCY - Prefer updates over delete/recreate:
|
|
|
709
717
|
},
|
|
710
718
|
data: {
|
|
711
719
|
type: 'object',
|
|
712
|
-
description: 'Flat object with HTML attributes and Stellify fields (name, type, locked, tag, classes, text)',
|
|
720
|
+
description: 'Flat object with HTML attributes and Stellify fields (name, type, locked, tag, classes, text, classBindings)',
|
|
713
721
|
},
|
|
714
722
|
},
|
|
715
723
|
required: ['uuid', 'data'],
|
|
@@ -1587,6 +1595,99 @@ This removes the "vote" setting profile entirely.`,
|
|
|
1587
1595
|
required: ['name'],
|
|
1588
1596
|
},
|
|
1589
1597
|
},
|
|
1598
|
+
{
|
|
1599
|
+
name: 'get_pattern',
|
|
1600
|
+
description: `Get a UI pattern checklist for building common components correctly.
|
|
1601
|
+
|
|
1602
|
+
WHEN TO USE: Call this BEFORE building any of these UI patterns:
|
|
1603
|
+
- accordion: Collapsible content panels
|
|
1604
|
+
- modal: Overlay dialogs
|
|
1605
|
+
- tabs: Tabbed content navigation
|
|
1606
|
+
- dropdown: Toggleable menus
|
|
1607
|
+
- toast: Notification messages
|
|
1608
|
+
|
|
1609
|
+
The checklist contains best practices and common pitfalls to avoid.
|
|
1610
|
+
Following the checklist prevents bugs like hidden content still being visible,
|
|
1611
|
+
missing keyboard navigation, or incorrect ARIA attributes.
|
|
1612
|
+
|
|
1613
|
+
EXAMPLE:
|
|
1614
|
+
{ "name": "accordion" }
|
|
1615
|
+
|
|
1616
|
+
Returns:
|
|
1617
|
+
{
|
|
1618
|
+
"name": "accordion",
|
|
1619
|
+
"description": "Collapsible content panels",
|
|
1620
|
+
"checklist": [
|
|
1621
|
+
"Use v-show for visibility toggle (not CSS height tricks)",
|
|
1622
|
+
"Store open state as boolean in each panel object",
|
|
1623
|
+
...
|
|
1624
|
+
],
|
|
1625
|
+
"example": "const panels = ref([...]);"
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
If no pattern exists for the given name, returns null.`,
|
|
1629
|
+
inputSchema: {
|
|
1630
|
+
type: 'object',
|
|
1631
|
+
properties: {
|
|
1632
|
+
name: {
|
|
1633
|
+
type: 'string',
|
|
1634
|
+
description: 'Pattern name (e.g., "accordion", "modal", "tabs", "dropdown", "toast")',
|
|
1635
|
+
},
|
|
1636
|
+
},
|
|
1637
|
+
required: ['name'],
|
|
1638
|
+
},
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
name: 'save_pattern',
|
|
1642
|
+
description: `Save or update a UI pattern checklist.
|
|
1643
|
+
|
|
1644
|
+
Use this to add new patterns or update existing ones based on lessons learned.
|
|
1645
|
+
|
|
1646
|
+
EXAMPLE:
|
|
1647
|
+
{
|
|
1648
|
+
"name": "accordion",
|
|
1649
|
+
"description": "Collapsible content panels",
|
|
1650
|
+
"checklist": [
|
|
1651
|
+
"Use v-show for visibility toggle",
|
|
1652
|
+
"Store open state as boolean"
|
|
1653
|
+
],
|
|
1654
|
+
"example": "const panels = ref([...]);"
|
|
1655
|
+
}`,
|
|
1656
|
+
inputSchema: {
|
|
1657
|
+
type: 'object',
|
|
1658
|
+
properties: {
|
|
1659
|
+
name: {
|
|
1660
|
+
type: 'string',
|
|
1661
|
+
description: 'Pattern name (e.g., "accordion", "modal")',
|
|
1662
|
+
},
|
|
1663
|
+
description: {
|
|
1664
|
+
type: 'string',
|
|
1665
|
+
description: 'Brief description of the pattern',
|
|
1666
|
+
},
|
|
1667
|
+
checklist: {
|
|
1668
|
+
type: 'array',
|
|
1669
|
+
items: { type: 'string' },
|
|
1670
|
+
description: 'Array of checklist items - best practices and things to remember',
|
|
1671
|
+
},
|
|
1672
|
+
example: {
|
|
1673
|
+
type: 'string',
|
|
1674
|
+
description: 'Optional code example',
|
|
1675
|
+
},
|
|
1676
|
+
},
|
|
1677
|
+
required: ['name', 'description', 'checklist'],
|
|
1678
|
+
},
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
name: 'list_patterns',
|
|
1682
|
+
description: `List all available UI pattern checklists.
|
|
1683
|
+
|
|
1684
|
+
Returns an array of pattern names and descriptions.
|
|
1685
|
+
Use this to discover what patterns are available before building UI components.`,
|
|
1686
|
+
inputSchema: {
|
|
1687
|
+
type: 'object',
|
|
1688
|
+
properties: {},
|
|
1689
|
+
},
|
|
1690
|
+
},
|
|
1590
1691
|
];
|
|
1591
1692
|
// Server instructions for tool discovery (used by MCP Tool Search)
|
|
1592
1693
|
const SERVER_INSTRUCTIONS = `Stellify is a coding platform where you code alongside AI on a codebase maintained and curated by AI. Build Laravel, stellify-framework, and Vue.js applications.
|
|
@@ -1667,10 +1768,10 @@ notes.value = response.data || [];
|
|
|
1667
1768
|
|
|
1668
1769
|
- **@click auto-wiring:** Pass the file UUID to html_to_elements to auto-wire @click handlers. Methods must be created BEFORE calling html_to_elements.
|
|
1669
1770
|
- **Stellify imports:** Use "stellify-framework" package (NOT @stellify/core)
|
|
1670
|
-
CORRECT: import { Http,
|
|
1771
|
+
CORRECT: import { Http, Collection, Form } from 'stellify-framework';
|
|
1671
1772
|
WRONG: import { Http } from '@stellify/core';
|
|
1672
1773
|
- v-model requires ref(), NOT Form class: const formData = ref({title: ''})
|
|
1673
|
-
-
|
|
1774
|
+
- Collection is iterable and works directly with v-for (no .toArray() needed)
|
|
1674
1775
|
- add_method_body APPENDS, doesn't replace - create new method to replace
|
|
1675
1776
|
- 'data' array = method UUIDs, 'statements' array = import/variable UUIDs
|
|
1676
1777
|
- For buttons in forms, set inputType: "button" to prevent auto-submit
|
|
@@ -1703,7 +1804,7 @@ When you create a Vue component, **app.js is automatically created/updated** wit
|
|
|
1703
1804
|
// Create MCP server
|
|
1704
1805
|
const server = new Server({
|
|
1705
1806
|
name: 'stellify-mcp',
|
|
1706
|
-
version: '0.1.
|
|
1807
|
+
version: '0.1.29',
|
|
1707
1808
|
}, {
|
|
1708
1809
|
capabilities: {
|
|
1709
1810
|
tools: {},
|
|
@@ -2527,6 +2628,49 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2527
2628
|
],
|
|
2528
2629
|
};
|
|
2529
2630
|
}
|
|
2631
|
+
case 'get_pattern': {
|
|
2632
|
+
const result = await stellify.getPattern(args.name);
|
|
2633
|
+
return {
|
|
2634
|
+
content: [
|
|
2635
|
+
{
|
|
2636
|
+
type: 'text',
|
|
2637
|
+
text: JSON.stringify({
|
|
2638
|
+
success: true,
|
|
2639
|
+
pattern: result.data || result,
|
|
2640
|
+
}, null, 2),
|
|
2641
|
+
},
|
|
2642
|
+
],
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
case 'save_pattern': {
|
|
2646
|
+
const { name, description, checklist, example } = args;
|
|
2647
|
+
await stellify.savePattern(name, { description, checklist, example });
|
|
2648
|
+
return {
|
|
2649
|
+
content: [
|
|
2650
|
+
{
|
|
2651
|
+
type: 'text',
|
|
2652
|
+
text: JSON.stringify({
|
|
2653
|
+
success: true,
|
|
2654
|
+
message: `Saved pattern "${name}" with ${checklist.length} checklist items`,
|
|
2655
|
+
}, null, 2),
|
|
2656
|
+
},
|
|
2657
|
+
],
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
case 'list_patterns': {
|
|
2661
|
+
const result = await stellify.listPatterns();
|
|
2662
|
+
return {
|
|
2663
|
+
content: [
|
|
2664
|
+
{
|
|
2665
|
+
type: 'text',
|
|
2666
|
+
text: JSON.stringify({
|
|
2667
|
+
success: true,
|
|
2668
|
+
patterns: result.data || result,
|
|
2669
|
+
}, null, 2),
|
|
2670
|
+
},
|
|
2671
|
+
],
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2530
2674
|
default:
|
|
2531
2675
|
throw new Error(`Unknown tool: ${name}`);
|
|
2532
2676
|
}
|
|
@@ -188,4 +188,11 @@ export declare class StellifyClient {
|
|
|
188
188
|
saveSetting(name: string, data: Record<string, any>): Promise<any>;
|
|
189
189
|
createSetting(name: string): Promise<any>;
|
|
190
190
|
deleteSetting(name: string): Promise<any>;
|
|
191
|
+
getPattern(name: string): Promise<any>;
|
|
192
|
+
savePattern(name: string, data: {
|
|
193
|
+
description: string;
|
|
194
|
+
checklist: string[];
|
|
195
|
+
example?: string;
|
|
196
|
+
}): Promise<any>;
|
|
197
|
+
listPatterns(): Promise<any>;
|
|
191
198
|
}
|
package/dist/stellify-client.js
CHANGED
|
@@ -225,4 +225,17 @@ export class StellifyClient {
|
|
|
225
225
|
const response = await this.client.delete(`/config/${name}`);
|
|
226
226
|
return response.data;
|
|
227
227
|
}
|
|
228
|
+
// UI Pattern checklists - best practices for common UI patterns
|
|
229
|
+
async getPattern(name) {
|
|
230
|
+
const response = await this.client.get(`/pattern/${name}`);
|
|
231
|
+
return response.data;
|
|
232
|
+
}
|
|
233
|
+
async savePattern(name, data) {
|
|
234
|
+
const response = await this.client.put(`/pattern/${name}`, data);
|
|
235
|
+
return response.data;
|
|
236
|
+
}
|
|
237
|
+
async listPatterns() {
|
|
238
|
+
const response = await this.client.get('/pattern');
|
|
239
|
+
return response.data;
|
|
240
|
+
}
|
|
228
241
|
}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/Stellify-Software-Ltd/stellify-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.29",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.29",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|