@stellisoft/stellify-mcp 0.1.27 → 0.1.28
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 +166 -3
- package/dist/stellify-client.d.ts +4 -0
- package/dist/stellify-client.js +18 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -187,6 +187,8 @@ NOTE: For controllers that use PROJECT models (Feedback, Vote, etc.), add those
|
|
|
187
187
|
|
|
188
188
|
**NEW: Combined creation** - Pass 'body' to create the complete method in ONE call. Async is auto-detected when body contains \`await\`.
|
|
189
189
|
|
|
190
|
+
**Nested code is handled correctly.** The parser tracks brace/bracket/paren depth and only splits statements on semicolons at the top level. This means computed properties, arrow functions with block bodies, and other nested constructs work correctly as single statements.
|
|
191
|
+
|
|
190
192
|
Parameters are automatically created as clauses. The response includes the clause UUIDs for each parameter.
|
|
191
193
|
|
|
192
194
|
Example request (simple - signature only):
|
|
@@ -287,6 +289,8 @@ Example response includes:
|
|
|
287
289
|
name: 'add_method_body',
|
|
288
290
|
description: `Parse and add PHP code to a method body. Provide the method implementation code (without the function declaration). Stellify will parse it into structured statements.
|
|
289
291
|
|
|
292
|
+
**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
|
+
|
|
290
294
|
IMPORTANT: This APPENDS to existing method statements. To REPLACE a method's code:
|
|
291
295
|
1. Create a NEW method with create_method
|
|
292
296
|
2. Add body with add_method_body
|
|
@@ -870,11 +874,13 @@ For Vue components, include the returned statement UUID in save_file's 'statemen
|
|
|
870
874
|
|
|
871
875
|
**PREFERRED:** Use this instead of the two-step create_statement → add_statement_code process.
|
|
872
876
|
|
|
877
|
+
**Nested code is handled correctly.** The parser tracks brace/bracket/paren depth and only splits on top-level semicolons. Computed properties, arrow functions with block bodies, and other nested constructs are kept as single statements.
|
|
878
|
+
|
|
873
879
|
Examples:
|
|
874
880
|
- PHP: "use Illuminate\\Http\\Request;" or "private $items = [];"
|
|
875
881
|
- JS/Vue: "const count = ref(0);" or "import { ref } from 'vue';"
|
|
876
882
|
|
|
877
|
-
For Vue components, include the returned statement
|
|
883
|
+
For Vue components, include the returned statement UUIDs in save_file's 'statements' array (NOT 'data' - that's for methods).`,
|
|
878
884
|
inputSchema: {
|
|
879
885
|
type: 'object',
|
|
880
886
|
properties: {
|
|
@@ -898,7 +904,7 @@ For Vue components, include the returned statement UUID in save_file's 'statemen
|
|
|
898
904
|
name: 'add_statement_code',
|
|
899
905
|
description: `Add code to an existing statement. This is step 2 of 2 - call this AFTER create_statement.
|
|
900
906
|
|
|
901
|
-
**ALTERNATIVE:** Use create_statement_with_code for a single-call approach.
|
|
907
|
+
**ALTERNATIVE:** Use create_statement_with_code for a single-call approach that combines both steps.
|
|
902
908
|
|
|
903
909
|
The statement must already exist (created via create_statement). This parses and stores the code.
|
|
904
910
|
|
|
@@ -1476,6 +1482,111 @@ The response includes actionable suggestions like:
|
|
|
1476
1482
|
},
|
|
1477
1483
|
},
|
|
1478
1484
|
},
|
|
1485
|
+
{
|
|
1486
|
+
name: 'get_setting',
|
|
1487
|
+
description: `Get a setting/config value from the tenant's settings table.
|
|
1488
|
+
|
|
1489
|
+
These settings are read by the config() function in sandbox code execution.
|
|
1490
|
+
Use this to check existing configuration values before modifying them.
|
|
1491
|
+
|
|
1492
|
+
EXAMPLE:
|
|
1493
|
+
{ "name": "app" }
|
|
1494
|
+
|
|
1495
|
+
Returns the setting data as key-value pairs, e.g.:
|
|
1496
|
+
{
|
|
1497
|
+
"name": "My App",
|
|
1498
|
+
"timezone": "UTC",
|
|
1499
|
+
"locale": "en"
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
Common setting profiles:
|
|
1503
|
+
- "app": Application settings (name, timezone, locale)
|
|
1504
|
+
- "database": Database connection settings
|
|
1505
|
+
- "mail": Mail configuration
|
|
1506
|
+
- "cache": Cache settings
|
|
1507
|
+
- Custom profiles for app-specific config`,
|
|
1508
|
+
inputSchema: {
|
|
1509
|
+
type: 'object',
|
|
1510
|
+
properties: {
|
|
1511
|
+
name: {
|
|
1512
|
+
type: 'string',
|
|
1513
|
+
description: 'Setting profile name (e.g., "app", "database", "mail", or custom names like "vote")',
|
|
1514
|
+
},
|
|
1515
|
+
},
|
|
1516
|
+
required: ['name'],
|
|
1517
|
+
},
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
name: 'save_setting',
|
|
1521
|
+
description: `Create or update a setting in the tenant's settings table.
|
|
1522
|
+
|
|
1523
|
+
These settings are accessible via config() in sandbox code execution.
|
|
1524
|
+
Use this to configure application behavior, API keys, feature flags, etc.
|
|
1525
|
+
|
|
1526
|
+
IMPORTANT: This creates or updates the setting profile with the provided key-value data.
|
|
1527
|
+
The data is merged with any existing values for that profile.
|
|
1528
|
+
|
|
1529
|
+
EXAMPLE - Create app settings:
|
|
1530
|
+
{
|
|
1531
|
+
"name": "app",
|
|
1532
|
+
"data": {
|
|
1533
|
+
"name": "My Feedback App",
|
|
1534
|
+
"timezone": "America/New_York",
|
|
1535
|
+
"locale": "en"
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
EXAMPLE - Create custom settings for voting:
|
|
1540
|
+
{
|
|
1541
|
+
"name": "vote",
|
|
1542
|
+
"data": {
|
|
1543
|
+
"salt": "my-secret-salt-for-ip-hashing",
|
|
1544
|
+
"allow_anonymous": true,
|
|
1545
|
+
"max_votes_per_day": 10
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
In your controller code, access these with:
|
|
1550
|
+
- config('app.name') returns "My Feedback App"
|
|
1551
|
+
- config('vote.salt') returns "my-secret-salt-for-ip-hashing"
|
|
1552
|
+
- config('vote.allow_anonymous') returns true`,
|
|
1553
|
+
inputSchema: {
|
|
1554
|
+
type: 'object',
|
|
1555
|
+
properties: {
|
|
1556
|
+
name: {
|
|
1557
|
+
type: 'string',
|
|
1558
|
+
description: 'Setting profile name (e.g., "app", "vote", "features")',
|
|
1559
|
+
},
|
|
1560
|
+
data: {
|
|
1561
|
+
type: 'object',
|
|
1562
|
+
description: 'Key-value pairs for the setting (e.g., { "salt": "secret", "enabled": true })',
|
|
1563
|
+
},
|
|
1564
|
+
},
|
|
1565
|
+
required: ['name', 'data'],
|
|
1566
|
+
},
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
name: 'delete_setting',
|
|
1570
|
+
description: `Delete a setting profile from the tenant's settings table.
|
|
1571
|
+
|
|
1572
|
+
WARNING: This permanently removes the entire setting profile and all its values.
|
|
1573
|
+
This cannot be undone.
|
|
1574
|
+
|
|
1575
|
+
EXAMPLE:
|
|
1576
|
+
{ "name": "vote" }
|
|
1577
|
+
|
|
1578
|
+
This removes the "vote" setting profile entirely.`,
|
|
1579
|
+
inputSchema: {
|
|
1580
|
+
type: 'object',
|
|
1581
|
+
properties: {
|
|
1582
|
+
name: {
|
|
1583
|
+
type: 'string',
|
|
1584
|
+
description: 'Setting profile name to delete',
|
|
1585
|
+
},
|
|
1586
|
+
},
|
|
1587
|
+
required: ['name'],
|
|
1588
|
+
},
|
|
1589
|
+
},
|
|
1479
1590
|
];
|
|
1480
1591
|
// Server instructions for tool discovery (used by MCP Tool Search)
|
|
1481
1592
|
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.
|
|
@@ -1548,6 +1659,10 @@ const response = await Http.get('/api/notes');
|
|
|
1548
1659
|
notes.value = response.data || [];
|
|
1549
1660
|
\`\`\`
|
|
1550
1661
|
|
|
1662
|
+
## Editing Existing Code
|
|
1663
|
+
|
|
1664
|
+
- **Edit at the right level:** To change code, edit the statement or clause - never delete an entire method just to change a line.
|
|
1665
|
+
|
|
1551
1666
|
## Common Pitfalls
|
|
1552
1667
|
|
|
1553
1668
|
- **@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.
|
|
@@ -1577,6 +1692,8 @@ Vue evaluates v-model bindings before v-else is applied, causing "Cannot read pr
|
|
|
1577
1692
|
|
|
1578
1693
|
**All business logic** (controllers, models, middleware, etc.) goes in the tenant DB via MCP tools. If a required capability is not available, use \`request_capability\` to log it.
|
|
1579
1694
|
|
|
1695
|
+
**Prefer Laravel methods:** When Laravel provides a helper (Str, Arr, Hash, Number, Collection), use it instead of native PHP functions.
|
|
1696
|
+
|
|
1580
1697
|
## JavaScript Entry File (app.js) - Auto-Generated
|
|
1581
1698
|
|
|
1582
1699
|
When you create a Vue component, **app.js is automatically created/updated** with component registration. The create_file response will confirm this with an \`appJs\` field.
|
|
@@ -1586,7 +1703,7 @@ When you create a Vue component, **app.js is automatically created/updated** wit
|
|
|
1586
1703
|
// Create MCP server
|
|
1587
1704
|
const server = new Server({
|
|
1588
1705
|
name: 'stellify-mcp',
|
|
1589
|
-
version: '0.1.
|
|
1706
|
+
version: '0.1.28',
|
|
1590
1707
|
}, {
|
|
1591
1708
|
capabilities: {
|
|
1592
1709
|
tools: {},
|
|
@@ -2364,6 +2481,52 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2364
2481
|
],
|
|
2365
2482
|
};
|
|
2366
2483
|
}
|
|
2484
|
+
case 'get_setting': {
|
|
2485
|
+
const result = await stellify.getSetting(args.name);
|
|
2486
|
+
const data = result.data || result;
|
|
2487
|
+
return {
|
|
2488
|
+
content: [
|
|
2489
|
+
{
|
|
2490
|
+
type: 'text',
|
|
2491
|
+
text: JSON.stringify({
|
|
2492
|
+
success: true,
|
|
2493
|
+
message: `Retrieved setting "${args.name}"`,
|
|
2494
|
+
setting: data,
|
|
2495
|
+
}, null, 2),
|
|
2496
|
+
},
|
|
2497
|
+
],
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
case 'save_setting': {
|
|
2501
|
+
const { name, data } = args;
|
|
2502
|
+
await stellify.saveSetting(name, data);
|
|
2503
|
+
return {
|
|
2504
|
+
content: [
|
|
2505
|
+
{
|
|
2506
|
+
type: 'text',
|
|
2507
|
+
text: JSON.stringify({
|
|
2508
|
+
success: true,
|
|
2509
|
+
message: `Saved setting "${name}" with ${Object.keys(data).length} key(s)`,
|
|
2510
|
+
keys: Object.keys(data),
|
|
2511
|
+
}, null, 2),
|
|
2512
|
+
},
|
|
2513
|
+
],
|
|
2514
|
+
};
|
|
2515
|
+
}
|
|
2516
|
+
case 'delete_setting': {
|
|
2517
|
+
await stellify.deleteSetting(args.name);
|
|
2518
|
+
return {
|
|
2519
|
+
content: [
|
|
2520
|
+
{
|
|
2521
|
+
type: 'text',
|
|
2522
|
+
text: JSON.stringify({
|
|
2523
|
+
success: true,
|
|
2524
|
+
message: `Deleted setting "${args.name}"`,
|
|
2525
|
+
}, null, 2),
|
|
2526
|
+
},
|
|
2527
|
+
],
|
|
2528
|
+
};
|
|
2529
|
+
}
|
|
2367
2530
|
default:
|
|
2368
2531
|
throw new Error(`Unknown tool: ${name}`);
|
|
2369
2532
|
}
|
|
@@ -184,4 +184,8 @@ export declare class StellifyClient {
|
|
|
184
184
|
analyzeQuality(params: {
|
|
185
185
|
type?: 'full' | 'relationships' | 'fillables' | 'casts' | 'routes';
|
|
186
186
|
}): Promise<any>;
|
|
187
|
+
getSetting(name: string): Promise<any>;
|
|
188
|
+
saveSetting(name: string, data: Record<string, any>): Promise<any>;
|
|
189
|
+
createSetting(name: string): Promise<any>;
|
|
190
|
+
deleteSetting(name: string): Promise<any>;
|
|
187
191
|
}
|
package/dist/stellify-client.js
CHANGED
|
@@ -207,4 +207,22 @@ export class StellifyClient {
|
|
|
207
207
|
const response = await this.client.get(endpoint);
|
|
208
208
|
return response.data;
|
|
209
209
|
}
|
|
210
|
+
// Settings/Config management - for tenant-specific configuration
|
|
211
|
+
// These settings are read by the config() override in sandbox code execution
|
|
212
|
+
async getSetting(name) {
|
|
213
|
+
const response = await this.client.get(`/config/${name}`);
|
|
214
|
+
return response.data;
|
|
215
|
+
}
|
|
216
|
+
async saveSetting(name, data) {
|
|
217
|
+
const response = await this.client.put(`/config/${name}`, { data });
|
|
218
|
+
return response.data;
|
|
219
|
+
}
|
|
220
|
+
async createSetting(name) {
|
|
221
|
+
const response = await this.client.post('/config', { name });
|
|
222
|
+
return response.data;
|
|
223
|
+
}
|
|
224
|
+
async deleteSetting(name) {
|
|
225
|
+
const response = await this.client.delete(`/config/${name}`);
|
|
226
|
+
return response.data;
|
|
227
|
+
}
|
|
210
228
|
}
|
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.28",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@stellisoft/stellify-mcp",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.28",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|