@stellisoft/stellify-mcp 0.1.22 → 0.1.24
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 +79 -9
- package/dist/stellify-client.d.ts +1 -1
- package/dist/stellify-client.js +2 -2
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -72,6 +72,10 @@ Use this tool when you need to:
|
|
|
72
72
|
- Verify method names before generating code
|
|
73
73
|
- Understand the full API surface
|
|
74
74
|
|
|
75
|
+
IMPORTANT - Stellify Framework Import:
|
|
76
|
+
The npm package is "stellify-framework" (NOT @stellify/core).
|
|
77
|
+
Import like: import { Http, List, Form } from 'stellify-framework';
|
|
78
|
+
|
|
75
79
|
IMPORTANT - List class and Vue reactivity:
|
|
76
80
|
The List class methods return List instances, NOT plain arrays.
|
|
77
81
|
Vue's v-for directive cannot iterate over List instances directly.
|
|
@@ -837,12 +841,20 @@ Examples:
|
|
|
837
841
|
inputSchema: {
|
|
838
842
|
type: 'object',
|
|
839
843
|
properties: {
|
|
844
|
+
file: {
|
|
845
|
+
type: 'string',
|
|
846
|
+
description: 'UUID of the file containing the statement',
|
|
847
|
+
},
|
|
848
|
+
method: {
|
|
849
|
+
type: 'string',
|
|
850
|
+
description: 'UUID of the method containing the statement (use "file" for file-level statements)',
|
|
851
|
+
},
|
|
840
852
|
uuid: {
|
|
841
853
|
type: 'string',
|
|
842
854
|
description: 'UUID of the statement to delete',
|
|
843
855
|
},
|
|
844
856
|
},
|
|
845
|
-
required: ['uuid'],
|
|
857
|
+
required: ['file', 'method', 'uuid'],
|
|
846
858
|
},
|
|
847
859
|
},
|
|
848
860
|
{
|
|
@@ -1390,14 +1402,22 @@ Key concepts:
|
|
|
1390
1402
|
|
|
1391
1403
|
## Vue Component Workflow
|
|
1392
1404
|
|
|
1393
|
-
1. get_project → find 'js' directory UUID
|
|
1394
|
-
2. create_file → type='js', extension='vue'
|
|
1395
|
-
3. Create statements for imports:
|
|
1405
|
+
1. get_project → find 'js' directory UUID (or create it)
|
|
1406
|
+
2. create_file → type='js', extension='vue' for the component
|
|
1407
|
+
3. Create statements for imports:
|
|
1408
|
+
- "import { ref } from 'vue';" (REQUIRED for ref())
|
|
1409
|
+
- "import { Http, List } from 'stellify-framework';" (for Stellify classes)
|
|
1410
|
+
NOTE: The npm package is "stellify-framework" (NOT @stellify/core)
|
|
1396
1411
|
4. Create statements for data: "const count = ref(0);"
|
|
1397
1412
|
5. create_method + add_method_body → functions
|
|
1398
1413
|
6. html_to_elements → template (no 'page' param for components)
|
|
1399
1414
|
7. update_element → wire click handlers to method UUIDs
|
|
1400
1415
|
8. save_file with: extension='vue', template=[elementUuid], data=[methodUuids], statements=[importUuids, refUuids]
|
|
1416
|
+
9. **MANDATORY: Create app.js entry file** (see "CRITICAL: JavaScript Entry File" section below)
|
|
1417
|
+
10. Create web route for the page
|
|
1418
|
+
11. **MANDATORY: Add a div with id="app"** to the page using html_to_elements:
|
|
1419
|
+
- html_to_elements with page=routeUuid and elements='<div id="app"></div>'
|
|
1420
|
+
- This is where Vue mounts the component. Without it, nothing renders!
|
|
1401
1421
|
|
|
1402
1422
|
## Real-Time UI (broadcast_element_command)
|
|
1403
1423
|
|
|
@@ -1406,6 +1426,9 @@ Use html_to_elements/update_element for permanent/saved changes.
|
|
|
1406
1426
|
|
|
1407
1427
|
## Common Pitfalls
|
|
1408
1428
|
|
|
1429
|
+
- **Stellify imports:** Use "stellify-framework" package (NOT @stellify/core)
|
|
1430
|
+
CORRECT: import { Http, List, Form } from 'stellify-framework';
|
|
1431
|
+
WRONG: import { Http } from '@stellify/core';
|
|
1409
1432
|
- v-model requires ref(), NOT Form class: const formData = ref({title: ''})
|
|
1410
1433
|
- List.from() returns List, not array - use .toArray() for v-for
|
|
1411
1434
|
- add_method_body APPENDS, doesn't replace - create new method to replace
|
|
@@ -1446,11 +1469,58 @@ When building features, group related files by passing a "module" parameter.
|
|
|
1446
1469
|
- create_file(..., module: "blog-posts") - auto-groups file
|
|
1447
1470
|
- create_route(..., module: "blog-posts") - auto-groups route
|
|
1448
1471
|
|
|
1449
|
-
Modules are auto-created if they don't exist. This helps users see all code related to a feature grouped together
|
|
1472
|
+
Modules are auto-created if they don't exist. This helps users see all code related to a feature grouped together.
|
|
1473
|
+
|
|
1474
|
+
## CRITICAL: JavaScript Entry File (app.js)
|
|
1475
|
+
|
|
1476
|
+
**You MUST have a JS entry file to register Vue components for use on pages.**
|
|
1477
|
+
|
|
1478
|
+
### First component in a project:
|
|
1479
|
+
1. Create app.js in the 'js' directory with the component in includes array:
|
|
1480
|
+
- create_file with type='js', extension='js', name='app', includes=[component-file-uuid]
|
|
1481
|
+
2. Add statements for NAMED imports only:
|
|
1482
|
+
- "import { createApp } from 'vue';"
|
|
1483
|
+
- "createApp(NotesApp).mount('#app');"
|
|
1484
|
+
NOTE: The component import (NotesApp) is handled by the includes array, NOT a statement!
|
|
1485
|
+
3. save_file with statement UUIDs
|
|
1486
|
+
|
|
1487
|
+
### Adding more components (app.js already exists):
|
|
1488
|
+
1. **search_files** for "app" to find existing app.js
|
|
1489
|
+
2. **get_file** to retrieve current includes and statements
|
|
1490
|
+
3. Add the new component UUID to the includes array via save_file
|
|
1491
|
+
4. Update the mount code to register the new component:
|
|
1492
|
+
- Create new statement: "app.component('Counter', Counter);"
|
|
1493
|
+
5. save_file with updated includes and statements arrays
|
|
1494
|
+
|
|
1495
|
+
**DO NOT create duplicate app.js files or duplicate createApp imports!**
|
|
1496
|
+
**DO NOT use statements for file imports - use the includes array!**
|
|
1497
|
+
|
|
1498
|
+
### Page mount point (div#app):
|
|
1499
|
+
Each page that uses Vue components needs a \`<div id="app"></div>\`.
|
|
1500
|
+
|
|
1501
|
+
- **First time on a page:** html_to_elements(page=routeUuid, elements='<div id="app"></div>')
|
|
1502
|
+
- **Page already has it:** Do NOT add another one. Check with get_route first if unsure.
|
|
1503
|
+
|
|
1504
|
+
**Without app.js AND div#app, Vue components will NOT render!**
|
|
1505
|
+
|
|
1506
|
+
### Import types summary:
|
|
1507
|
+
- **File imports (components, classes):** Use \`includes\` array with file UUIDs
|
|
1508
|
+
- **Named imports (vue, stellify-framework):** Use statements with add_statement_code
|
|
1509
|
+
|
|
1510
|
+
Example app.js structure:
|
|
1511
|
+
- includes: [notesAppFileUuid, counterFileUuid]
|
|
1512
|
+
- statements: ["import { createApp } from 'vue';", "const app = createApp({});", "app.component('NotesApp', NotesApp);", "app.component('Counter', Counter);", "app.mount('#app');"]
|
|
1513
|
+
|
|
1514
|
+
## Efficiency Tips
|
|
1515
|
+
|
|
1516
|
+
- **Move elements between routes:** Use \`update_element\` to change \`routeParent\` - don't delete/recreate
|
|
1517
|
+
- **Reparent elements:** Update \`parent\` attribute instead of recreating
|
|
1518
|
+
- **Reorder children:** Update parent's \`data\` array with new UUID order
|
|
1519
|
+
- Always prefer updating over deleting and recreating`;
|
|
1450
1520
|
// Create MCP server
|
|
1451
1521
|
const server = new Server({
|
|
1452
1522
|
name: 'stellify-mcp',
|
|
1453
|
-
version: '0.1.
|
|
1523
|
+
version: '0.1.24',
|
|
1454
1524
|
}, {
|
|
1455
1525
|
capabilities: {
|
|
1456
1526
|
tools: {},
|
|
@@ -1875,8 +1945,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1875
1945
|
};
|
|
1876
1946
|
}
|
|
1877
1947
|
case 'delete_statement': {
|
|
1878
|
-
const { uuid } = args;
|
|
1879
|
-
const result = await stellify.deleteStatement(uuid);
|
|
1948
|
+
const { file, method, uuid } = args;
|
|
1949
|
+
const result = await stellify.deleteStatement(file, method, uuid);
|
|
1880
1950
|
return {
|
|
1881
1951
|
content: [
|
|
1882
1952
|
{
|
|
@@ -1892,7 +1962,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1892
1962
|
}
|
|
1893
1963
|
case 'save_statement': {
|
|
1894
1964
|
const { uuid, ...data } = args;
|
|
1895
|
-
const result = await stellify.saveStatement(uuid, data);
|
|
1965
|
+
const result = await stellify.saveStatement(uuid, { uuid, ...data });
|
|
1896
1966
|
return {
|
|
1897
1967
|
content: [
|
|
1898
1968
|
{
|
|
@@ -85,7 +85,7 @@ export declare class StellifyClient {
|
|
|
85
85
|
method?: string;
|
|
86
86
|
}): Promise<any>;
|
|
87
87
|
getStatement(statement: string): Promise<any>;
|
|
88
|
-
deleteStatement(statement: string): Promise<any>;
|
|
88
|
+
deleteStatement(file: string, method: string, statement: string): Promise<any>;
|
|
89
89
|
saveStatement(statement: string, data: any): Promise<any>;
|
|
90
90
|
createRoute(params: CreateRouteParams): Promise<any>;
|
|
91
91
|
getRoute(route: string): Promise<any>;
|
package/dist/stellify-client.js
CHANGED
|
@@ -67,8 +67,8 @@ export class StellifyClient {
|
|
|
67
67
|
const response = await this.client.get(`/statement/${statement}`);
|
|
68
68
|
return response.data;
|
|
69
69
|
}
|
|
70
|
-
async deleteStatement(statement) {
|
|
71
|
-
const response = await this.client.delete(`/statement/${statement}`);
|
|
70
|
+
async deleteStatement(file, method, statement) {
|
|
71
|
+
const response = await this.client.delete(`/statement/${file}/${method}/${statement}`);
|
|
72
72
|
return response.data;
|
|
73
73
|
}
|
|
74
74
|
async saveStatement(statement, data) {
|
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.24",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.24",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|