worsoft-frontend-codegen-local-mcp 0.1.49 → 0.1.51
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/mcp_server.js +8 -7
- package/package.json +1 -1
package/mcp_server.js
CHANGED
|
@@ -5,7 +5,7 @@ const fs = require('fs');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
7
|
const SERVER_NAME = 'worsoft-codegen-local';
|
|
8
|
-
const SERVER_VERSION = '0.1.
|
|
8
|
+
const SERVER_VERSION = '0.1.51';
|
|
9
9
|
const PROTOCOL_VERSION = '2024-11-05';
|
|
10
10
|
const TOOL_NAME = 'worsoft_codegen_local_generate_frontend';
|
|
11
11
|
const STYLE_CATALOG_PATH = path.join(__dirname, 'assets', 'style-catalog.json');
|
|
@@ -183,7 +183,7 @@ const TOOL_SCHEMA = {
|
|
|
183
183
|
dictType: { type: 'string', description: 'Dictionary type code from structured metadata.' },
|
|
184
184
|
defaultValue: { type: ['string', 'number', 'boolean'], description: 'Optional default value.' },
|
|
185
185
|
description: { type: 'string', description: 'Field description or notes.' },
|
|
186
|
-
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata, for example text, textarea, select, number or datetime.' },
|
|
186
|
+
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata, for example text, textarea, select, number, date or datetime.' },
|
|
187
187
|
formType: { type: 'string', description: 'Explicit form control type translated by the caller. MCP consumes this value first and only falls back to legacy heuristics when omitted.' },
|
|
188
188
|
sourceKind: { type: 'string', enum: ['entity', 'display', 'virtual', 'common'], description: 'Field source kind.' },
|
|
189
189
|
primary: { type: ['boolean', 'string'], description: 'Whether the field is the primary key.' },
|
|
@@ -225,7 +225,7 @@ const TOOL_SCHEMA = {
|
|
|
225
225
|
dictType: { type: 'string', description: 'Dictionary type code from structured metadata.' },
|
|
226
226
|
defaultValue: { type: ['string', 'number', 'boolean'], description: 'Optional default value.' },
|
|
227
227
|
description: { type: 'string', description: 'Field description or notes.' },
|
|
228
|
-
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata.' },
|
|
228
|
+
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata, for example text, textarea, select, number, date or datetime.' },
|
|
229
229
|
formType: { type: 'string', description: 'Explicit form control type translated by the caller.' },
|
|
230
230
|
sourceKind: { type: 'string', enum: ['entity', 'display', 'virtual', 'common'], description: 'Field source kind.' },
|
|
231
231
|
primary: { type: ['boolean', 'string'], description: 'Whether the field is the primary key.' },
|
|
@@ -283,7 +283,7 @@ const TOOL_SCHEMA = {
|
|
|
283
283
|
dictType: { type: 'string', description: 'Dictionary type code from structured metadata.' },
|
|
284
284
|
defaultValue: { type: ['string', 'number', 'boolean'], description: 'Optional default value.' },
|
|
285
285
|
description: { type: 'string', description: 'Field description or notes.' },
|
|
286
|
-
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata.' },
|
|
286
|
+
componentType: { type: 'string', description: 'Explicit component type from PRD structured metadata, for example text, textarea, select, number, date or datetime.' },
|
|
287
287
|
formType: { type: 'string', description: 'Explicit form control type translated by the caller.' },
|
|
288
288
|
sourceKind: { type: 'string', enum: ['entity', 'display', 'virtual', 'common'], description: 'Field source kind.' },
|
|
289
289
|
primary: { type: ['boolean', 'string'], description: 'Whether the field is the primary key.' }
|
|
@@ -1071,7 +1071,8 @@ function normalizeStructuredField(inputField, index, contextLabel) {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
1073
|
const { length, scale } = normalizeStructuredLengthAndScale(inputField.length, inputField.scale);
|
|
1074
|
-
const explicitFormType = normalizeStructuredFormType(inputField.formType || inputField.componentType);
|
|
1074
|
+
const explicitFormType = normalizeStructuredFormType(inputField.formType || inputField.componentType);
|
|
1075
|
+
const formType = type === 'DATE' && explicitFormType === 'datetime' ? 'date' : explicitFormType;
|
|
1075
1076
|
const explicitQueryType =
|
|
1076
1077
|
inputField.queryType === undefined || inputField.queryType === null || inputField.queryType === ''
|
|
1077
1078
|
? undefined
|
|
@@ -1089,11 +1090,11 @@ function normalizeStructuredField(inputField, index, contextLabel) {
|
|
|
1089
1090
|
comment: label,
|
|
1090
1091
|
label,
|
|
1091
1092
|
description: String(inputField.description || '').trim(),
|
|
1092
|
-
formType
|
|
1093
|
+
formType,
|
|
1093
1094
|
dictType: normalizeDictType(inputField.dictType),
|
|
1094
1095
|
notNull: parseBooleanLike(inputField.required, false),
|
|
1095
1096
|
defaultValue: normalizeDefaultValue(inputField.defaultValue),
|
|
1096
|
-
readonly: parseBooleanLike(inputField.readonly, false),
|
|
1097
|
+
readonly: parseBooleanLike(inputField.readonly ?? inputField.disabled, false),
|
|
1097
1098
|
show,
|
|
1098
1099
|
listShow,
|
|
1099
1100
|
formShow,
|
package/package.json
CHANGED