@stellisoft/stellify-mcp 0.1.17 → 0.1.18
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 +185 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -91,6 +91,39 @@ const stellify = new StellifyClient({
|
|
|
91
91
|
// - includes: Array of file UUIDs to import
|
|
92
92
|
//
|
|
93
93
|
// -----------------------------------------------------------------------------
|
|
94
|
+
// VUE COMPONENT + ROUTE PATTERN (for visual editing)
|
|
95
|
+
// -----------------------------------------------------------------------------
|
|
96
|
+
// When building Vue components, use TWO routes to enable visual editing:
|
|
97
|
+
//
|
|
98
|
+
// 1. TEMPLATE ROUTE - Holds the component's UI elements for editing
|
|
99
|
+
// - create_route: name='NotesTemplate', path='/notes-template', type='web'
|
|
100
|
+
// - html_to_elements: page=templateRouteUuid, elements='<div>...</div>'
|
|
101
|
+
// - Users can visually edit these elements in the route editor
|
|
102
|
+
//
|
|
103
|
+
// 2. DISPLAY ROUTE - The actual page that renders the component
|
|
104
|
+
// - create_route: name='Notes', path='/notes', type='web'
|
|
105
|
+
// - html_to_elements: page=displayRouteUuid, elements='<NotesApp />'
|
|
106
|
+
// - This embeds the Vue component on the page
|
|
107
|
+
//
|
|
108
|
+
// 3. VUE COMPONENT FILE - Links to template route elements
|
|
109
|
+
// - create_file: type='js', extension='vue', name='NotesApp'
|
|
110
|
+
// - save_file: template=[elementUuidsFromTemplateRoute]
|
|
111
|
+
//
|
|
112
|
+
// WHY THIS PATTERN?
|
|
113
|
+
// - Template elements need a route to be viewable/editable in the UI
|
|
114
|
+
// - The display route keeps the clean component embedding pattern
|
|
115
|
+
// - Component logic (methods, state) stays in the .vue file
|
|
116
|
+
//
|
|
117
|
+
// EXAMPLE WORKFLOW:
|
|
118
|
+
// 1. Create template route: '/notes-template' (for editing)
|
|
119
|
+
// 2. Create display route: '/notes' (for viewing)
|
|
120
|
+
// 3. html_to_elements on template route (creates editable elements)
|
|
121
|
+
// 4. html_to_elements on display route with '<NotesApp />'
|
|
122
|
+
// 5. create_file for NotesApp.vue
|
|
123
|
+
// 6. Add methods, statements, wire events
|
|
124
|
+
// 7. save_file with template pointing to template route's root element
|
|
125
|
+
//
|
|
126
|
+
// -----------------------------------------------------------------------------
|
|
94
127
|
// ELEMENT EVENT HANDLERS (for frontend files)
|
|
95
128
|
// -----------------------------------------------------------------------------
|
|
96
129
|
// Elements can have these event properties (value is method UUID):
|
|
@@ -105,9 +138,137 @@ const stellify = new StellifyClient({
|
|
|
105
138
|
// - mouseenter: Fires on mouse enter (@mouseenter)
|
|
106
139
|
// - mouseleave: Fires on mouse leave (@mouseleave)
|
|
107
140
|
//
|
|
141
|
+
// -----------------------------------------------------------------------------
|
|
142
|
+
// STELLIFY FRAMEWORK (frontend library for Vue/JS files)
|
|
143
|
+
// -----------------------------------------------------------------------------
|
|
144
|
+
// Stellify Framework is an AI-friendly frontend library with constrained APIs.
|
|
145
|
+
// Use these modules in Vue components for common frontend tasks.
|
|
146
|
+
//
|
|
147
|
+
// IMPORT PATTERN:
|
|
148
|
+
// import { Form, Http, Table } from 'stellify-framework'
|
|
149
|
+
//
|
|
150
|
+
// DATA & FORMS:
|
|
151
|
+
// Form.create({name:'',email:''}).validate({...}).store('/api/users')
|
|
152
|
+
// Table.create(data).addColumn('name').sort('name').paginate(10)
|
|
153
|
+
// List.create(items).add(item).remove(id).filter(fn).map(fn)
|
|
154
|
+
// Tree.create().setRoot(data).addChild(parentId,child).traverse(fn)
|
|
155
|
+
//
|
|
156
|
+
// NETWORK:
|
|
157
|
+
// Http.create('/api').withToken(t).get('/users').post('/users',data)
|
|
158
|
+
// Socket.create('wss://...').on('message',fn).connect().send(data)
|
|
159
|
+
// Auth.create('/api').login(creds).logout().getUser().isAuthenticated()
|
|
160
|
+
// Stream.create('/api/chat').onChunk(fn).onComplete(fn).post(data)
|
|
161
|
+
//
|
|
162
|
+
// GRAPHICS:
|
|
163
|
+
// Svg.create(800,600).rect(0,0,100,50).circle(50,50,20).text('Hi',10,10)
|
|
164
|
+
// Canvas.create(800,600).rect(0,0,100,50).circle(50,50,20).toDataURL()
|
|
165
|
+
// Graph.create().addNode('a').addNode('b').addEdge('a','b').layout('force')
|
|
166
|
+
// Scale.linear().domain([0,100]).range([0,500]).value(50) // returns 250
|
|
167
|
+
// Motion.tween(0,100,{duration:500}).onUpdate(fn).start()
|
|
168
|
+
//
|
|
169
|
+
// PLATFORM:
|
|
170
|
+
// Router.create().register('/users',component).navigate('/users')
|
|
171
|
+
// Storage.local().set('key',val).get('key').remove('key')
|
|
172
|
+
// Events.create().on('event',fn).emit('event',data)
|
|
173
|
+
// Clipboard.copy('text').paste()
|
|
174
|
+
// Notify.request().send('Title',{body:'Message'})
|
|
175
|
+
// Geo.getPosition().then(pos=>...).watchPosition(fn)
|
|
176
|
+
// Media.selectFile({accept:'image/*'}).resize(800,600).toBase64()
|
|
177
|
+
// DB.create('mydb').store({name:'items'}).open().put('items',obj)
|
|
178
|
+
// Worker.fromFunction(fn).run(data).terminate()
|
|
179
|
+
//
|
|
180
|
+
// AI & LANGUAGE:
|
|
181
|
+
// Speech.create().onResult(fn).listen({continuous:true})
|
|
182
|
+
// Speech.create().speak('Hello',{voice:'...'})
|
|
183
|
+
// Chat.create().addUser('Hi').addAssistant('Hello').getMessages()
|
|
184
|
+
// Embed.create().store('id',vector,meta).nearest(queryVec,5)
|
|
185
|
+
// Diff.lines(old,new) // [{type:'equal'|'insert'|'delete',value:'...'}]
|
|
186
|
+
//
|
|
187
|
+
// UTILITIES:
|
|
188
|
+
// Time.now().format('YYYY-MM-DD').add(7,'days').relative()
|
|
189
|
+
//
|
|
190
|
+
// KEY METHODS PER MODULE (max 7 each - AI-friendly constraint):
|
|
191
|
+
// Form: create,set,get,validate,store,update,delete
|
|
192
|
+
// Table: create,setData,addColumn,sort,filter,paginate
|
|
193
|
+
// Http: create,get,post,put,delete,withToken
|
|
194
|
+
// Stream: create,post,onChunk,onComplete,abort,getBuffer
|
|
195
|
+
// Speech: create,listen,speak,stopListening,getVoices,onResult
|
|
196
|
+
// Chat: create,addMessage,getHistory,clear,fork,truncate
|
|
197
|
+
// Embed: create,store,compare,nearest,search,toJSON
|
|
198
|
+
// Diff: chars,words,lines,apply,createPatch,similarity
|
|
199
|
+
//
|
|
108
200
|
// =============================================================================
|
|
109
201
|
// Define MCP tools
|
|
202
|
+
// Stellify Framework API - full method reference for AI code generation
|
|
203
|
+
const STELLIFY_FRAMEWORK_API = {
|
|
204
|
+
// Data & Forms
|
|
205
|
+
Form: ['create', 'set', 'get', 'getData', 'validate', 'isValid', 'getErrors', 'getError', 'reset', 'store', 'update', 'delete'],
|
|
206
|
+
Table: ['create', 'setData', 'addColumn', 'removeColumn', 'sort', 'filter', 'clearFilter', 'paginate', 'page', 'getData', 'getAllData', 'getColumns', 'getColumn', 'getTotalRows', 'getTotalPages', 'getCurrentPage', 'getPageSize', 'getSortKey', 'getSortDirection'],
|
|
207
|
+
List: ['create', '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'],
|
|
208
|
+
Tree: ['create', 'setRoot', 'addChild', 'removeNode', 'getNode', 'getRoot', 'getChildren', 'getParent', 'getSiblings', 'getAncestors', 'getDescendants', 'getDepth', 'getPath', 'traverse', 'find', 'findAll', 'move', 'toArray', 'size'],
|
|
209
|
+
// Network
|
|
210
|
+
Http: ['create', 'get', 'post', 'put', 'patch', 'delete', 'withHeaders', 'withToken', 'withTimeout'],
|
|
211
|
+
Socket: ['create', 'connect', 'disconnect', 'send', 'sendEvent', 'on', 'off', 'once', 'isConnected', 'getState'],
|
|
212
|
+
Auth: ['create', 'login', 'logout', 'fetchUser', 'getUser', 'getToken', 'isAuthenticated', 'setToken', 'setUser', 'refresh', 'onAuthChange', 'offAuthChange', 'getAuthHeader'],
|
|
213
|
+
Stream: ['create', 'headers', 'withToken', 'onChunk', 'onComplete', 'onError', 'get', 'post', 'abort', 'getBuffer', 'getChunks', 'isStreaming', 'clear'],
|
|
214
|
+
// Graphics & Visualization
|
|
215
|
+
Svg: ['create', 'select', 'find', 'attr', 'attrs', 'getAttr', 'addClass', 'removeClass', 'text', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'path', 'textElement', 'group', 'clear', 'remove', 'toString', 'toElement', 'getWidth', 'getHeight'],
|
|
216
|
+
Canvas: ['create', 'fromElement', 'fromSelector', 'size', 'getWidth', 'getHeight', 'style', 'save', 'restore', 'clear', 'fill', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'arc', 'path', 'text', 'measureText', 'drawImage', 'translate', 'rotate', 'scale', 'resetTransform', 'getPixel', 'setPixel', 'getImageData', 'putImageData', 'toDataURL', 'toBlob', 'getElement', 'getContext', 'appendTo'],
|
|
217
|
+
Graph: ['create', 'size', 'addNode', 'removeNode', 'addEdge', 'removeEdge', 'getNode', 'getNodes', 'getEdges', 'getEdgesWithPositions', 'getNeighbors', 'layout'],
|
|
218
|
+
Scale: ['linear', 'log', 'time', 'band', 'domain', 'range', 'getDomain', 'getRange', 'value', 'invert', 'ticks', 'clamp', 'padding', 'bandwidth'],
|
|
219
|
+
Axis: ['create', 'orientation', 'ticks', 'tickFormat', 'tickSize', 'getTicks', 'getOrientation', 'getTickSize', 'getRange', 'isHorizontal', 'isVertical'],
|
|
220
|
+
Motion: ['tween', 'spring', 'easing', 'onUpdate', 'onComplete', 'start', 'stop', 'isRunning', 'valueAt'],
|
|
221
|
+
// Platform APIs
|
|
222
|
+
Router: ['create', 'register', 'navigate', 'back', 'forward', 'getParams', 'getQuery', 'getCurrent', 'getState', 'onNavigate', 'offNavigate', 'start'],
|
|
223
|
+
Storage: ['local', 'session', 'set', 'get', 'remove', 'clear', 'has', 'keys', 'getAll', 'size'],
|
|
224
|
+
Events: ['create', 'on', 'off', 'once', 'emit', 'clear', 'listenerCount', 'eventNames'],
|
|
225
|
+
Clipboard: ['copy', 'paste', 'copyImage', 'copyHtml', 'isSupported', 'isWriteSupported'],
|
|
226
|
+
Notify: ['request', 'send', 'getPermission', 'isSupported', 'isGranted', 'isDenied'],
|
|
227
|
+
Geo: ['getPosition', 'watchPosition', 'stopWatching', 'stopAllWatching', 'isSupported', 'distance'],
|
|
228
|
+
Media: ['selectFile', 'selectFiles', 'capture', 'getMetadata', 'resize', 'toBase64', 'toArrayBuffer', 'toText', 'formatSize', 'isImage', 'isVideo', 'isAudio'],
|
|
229
|
+
DB: ['create', 'store', 'open', 'close', 'put', 'add', 'get', 'getAll', 'find', 'delete', 'clear', 'count', 'keys', 'update', 'batch', 'deleteDatabase', 'databases'],
|
|
230
|
+
Worker: ['create', 'fromFunction', 'fromCode', 'run', 'post', 'onMessage', 'onError', 'terminate', 'isRunning', 'getPendingCount'],
|
|
231
|
+
WorkerPool: ['create', 'fromFunction', 'run', 'map', 'terminate', 'getSize', 'getActiveCount', 'getQueueLength'],
|
|
232
|
+
// AI & Language
|
|
233
|
+
Speech: ['create', 'isSupported', 'listen', 'stopListening', 'onResult', 'onInterim', 'onEnd', 'onError', 'speak', 'stopSpeaking', 'pause', 'resume', 'getVoices', 'getVoicesByLanguage', 'isSpeaking', 'isListening'],
|
|
234
|
+
Chat: ['create', 'fromHistory', 'addMessage', 'addUser', 'addAssistant', 'addSystem', 'getMessage', 'getHistory', 'getMessages', 'getLastMessage', 'getLastUserMessage', 'getLastAssistantMessage', 'updateMessage', 'removeMessage', 'clear', 'clearAll', 'fork', 'truncate', 'count', 'countTokensEstimate', 'toJSON'],
|
|
235
|
+
Embed: ['create', 'store', 'storeMany', 'get', 'remove', 'clear', 'count', 'compare', 'nearest', 'search', 'cosineSimilarity', 'euclideanDistance', 'dotProduct', 'normalize', 'average', 'toJSON', 'fromJSON'],
|
|
236
|
+
Diff: ['chars', 'words', 'lines', 'apply', 'createPatch', 'distance', 'similarity', 'commonPrefix', 'commonSuffix'],
|
|
237
|
+
// Utilities
|
|
238
|
+
Time: ['now', 'create', 'parse', 'format', 'toISO', 'toDate', 'toTimestamp', 'toUnix', 'add', 'subtract', 'diff', 'isBefore', 'isAfter', 'isSame', 'isBetween', 'startOf', 'endOf', 'year', 'month', 'day', 'weekday', 'hour', 'minute', 'second', 'relative', 'clone'],
|
|
239
|
+
// Adapters
|
|
240
|
+
useStellify: ['(generic adapter for any module)'],
|
|
241
|
+
useForm: ['bind'],
|
|
242
|
+
useTable: ['(reactive table adapter)'],
|
|
243
|
+
};
|
|
110
244
|
const tools = [
|
|
245
|
+
{
|
|
246
|
+
name: 'get_stellify_framework_api',
|
|
247
|
+
description: `Get the complete Stellify Framework API reference for Vue/JS development.
|
|
248
|
+
|
|
249
|
+
Returns all modules and their methods for AI-friendly frontend code generation.
|
|
250
|
+
|
|
251
|
+
Use this tool when you need to:
|
|
252
|
+
- Look up available methods for a Stellify module
|
|
253
|
+
- Verify method names before generating code
|
|
254
|
+
- Understand the full API surface
|
|
255
|
+
|
|
256
|
+
Example response:
|
|
257
|
+
{
|
|
258
|
+
"Form": ["create", "set", "get", "validate", "store", "update", "delete", ...],
|
|
259
|
+
"Http": ["create", "get", "post", "put", "delete", "withToken", ...],
|
|
260
|
+
...
|
|
261
|
+
}`,
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
module: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: 'Optional: specific module to get API for (e.g., "Form", "Http"). Omit to get all modules.',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
111
272
|
{
|
|
112
273
|
name: 'get_project',
|
|
113
274
|
description: `Get the active Stellify project for the authenticated user.
|
|
@@ -1340,6 +1501,30 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1340
1501
|
}
|
|
1341
1502
|
try {
|
|
1342
1503
|
switch (name) {
|
|
1504
|
+
case 'get_stellify_framework_api': {
|
|
1505
|
+
const moduleName = args.module;
|
|
1506
|
+
let result;
|
|
1507
|
+
if (moduleName) {
|
|
1508
|
+
const moduleApi = STELLIFY_FRAMEWORK_API[moduleName];
|
|
1509
|
+
if (moduleApi) {
|
|
1510
|
+
result = { [moduleName]: moduleApi };
|
|
1511
|
+
}
|
|
1512
|
+
else {
|
|
1513
|
+
result = { error: `Module "${moduleName}" not found. Available: ${Object.keys(STELLIFY_FRAMEWORK_API).join(', ')}` };
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
else {
|
|
1517
|
+
result = STELLIFY_FRAMEWORK_API;
|
|
1518
|
+
}
|
|
1519
|
+
return {
|
|
1520
|
+
content: [
|
|
1521
|
+
{
|
|
1522
|
+
type: 'text',
|
|
1523
|
+
text: JSON.stringify(result, null, 2),
|
|
1524
|
+
},
|
|
1525
|
+
],
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1343
1528
|
case 'get_project': {
|
|
1344
1529
|
const result = await stellify.getProject();
|
|
1345
1530
|
const projectData = result.data || result;
|
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.17",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.17",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|