@compilr-dev/factory 0.1.1 → 0.1.2
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/model/tools.js +20 -5
- package/package.json +1 -1
package/dist/model/tools.js
CHANGED
|
@@ -112,7 +112,18 @@ function createAppModelGetTool(config) {
|
|
|
112
112
|
function createAppModelUpdateTool(config) {
|
|
113
113
|
return defineTool({
|
|
114
114
|
name: 'app_model_update',
|
|
115
|
-
description: `Apply a semantic operation to the Application Model.
|
|
115
|
+
description: `Apply a semantic operation to the Application Model. If no model exists, one is created automatically.
|
|
116
|
+
|
|
117
|
+
EXAMPLES:
|
|
118
|
+
- updateIdentity: { "op": "updateIdentity", "updates": { "name": "My App", "description": "A task manager" } }
|
|
119
|
+
- updateTechStack: { "op": "updateTechStack", "updates": { "toolkit": "react-node" } }
|
|
120
|
+
- addEntity: { "op": "addEntity", "entity": { "name": "Task", "pluralName": "Tasks", "icon": "📋", "fields": [{ "name": "title", "label": "Title", "type": "string", "required": true }], "views": ["list", "detail", "card"], "relationships": [] } }
|
|
121
|
+
- addField: { "op": "addField", "entity": "Task", "field": { "name": "dueDate", "label": "Due Date", "type": "date", "required": false } }
|
|
122
|
+
- addRelationship: { "op": "addRelationship", "entity": "Task", "relationship": { "type": "belongsTo", "target": "Project" } }
|
|
123
|
+
- updateFeatures: { "op": "updateFeatures", "updates": { "dashboard": true, "darkMode": true } }
|
|
124
|
+
- updateTheme: { "op": "updateTheme", "updates": { "primaryColor": "#1976D2" } }
|
|
125
|
+
- updateLayout: { "op": "updateLayout", "updates": { "shell": "sidebar-header" } }
|
|
126
|
+
- removeEntity: { "op": "removeEntity", "entity": "Task", "force": true }`,
|
|
116
127
|
inputSchema: {
|
|
117
128
|
type: 'object',
|
|
118
129
|
properties: {
|
|
@@ -143,14 +154,17 @@ function createAppModelUpdateTool(config) {
|
|
|
143
154
|
description: 'Expected current revision for optimistic locking. Optional.',
|
|
144
155
|
},
|
|
145
156
|
entity: {
|
|
146
|
-
|
|
157
|
+
oneOf: [{ type: 'string' }, { type: 'object', additionalProperties: true }],
|
|
158
|
+
description: 'Entity name (string) for most ops, or full entity object (for addEntity). Entity object requires: name (PascalCase), pluralName, icon, fields array, views array, relationships array.',
|
|
147
159
|
},
|
|
148
160
|
field: {
|
|
149
|
-
|
|
161
|
+
oneOf: [{ type: 'string' }, { type: 'object', additionalProperties: true }],
|
|
162
|
+
description: 'Field name (string) for updateField/removeField/renameField, or full field object (for addField). Field object requires: name (camelCase), label, type (string|number|boolean|date|enum), required.',
|
|
150
163
|
},
|
|
151
164
|
relationship: {
|
|
152
165
|
type: 'object',
|
|
153
|
-
|
|
166
|
+
additionalProperties: true,
|
|
167
|
+
description: 'Relationship object for addRelationship. Requires: type ("belongsTo" or "hasMany"), target (entity name). Optional: fieldName.',
|
|
154
168
|
properties: {
|
|
155
169
|
type: { type: 'string', enum: ['belongsTo', 'hasMany'] },
|
|
156
170
|
target: { type: 'string' },
|
|
@@ -159,7 +173,8 @@ function createAppModelUpdateTool(config) {
|
|
|
159
173
|
},
|
|
160
174
|
updates: {
|
|
161
175
|
type: 'object',
|
|
162
|
-
|
|
176
|
+
additionalProperties: true,
|
|
177
|
+
description: 'Partial updates object for updateIdentity, updateLayout, updateFeatures, updateTheme, updateTechStack, updateEntity.',
|
|
163
178
|
},
|
|
164
179
|
newName: {
|
|
165
180
|
type: 'string',
|