low-code-mcp-stdio
Advanced tools
@@ -29,7 +29,7 @@ "use strict"; | ||
| const taskDetailList = [ | ||
| `分析存量页面中的所有操作,比如表单中的操作按钮、表格中的操作列等,分析功能是按钮还是弹窗,示例:${constant_1.pageOperationsExample},一定要深入分析弹窗内容,注入key为 pageOperations 到上下文中`, | ||
| `分析存量页面中的所有操作,比如表单中的操作按钮、表格,表格可能具有条件分支显隐条件、表格中的操作列等,分析功能是按钮还是弹窗,示例:${constant_1.pageOperationsExample},一定要深入分析弹窗内容,注入key为 pageOperations 到上下文中`, | ||
| '分析存量页面中的所有用到的请求,找到真实定义的地方读取path,不能忽略公共前缀;表格分页参数固定是 pageSize跟pageNo,如果需要使用requestConditionFunc就开启showRequestCondition,需要使用requestDataFunc就开启showRequestData,需要使用responseDataFunc就开启showResponseData,需要使用responseGeneralDataFunc就开启showGeneralResponseData,注入上下文中,key为 pageRequests', | ||
| '分析存量页面中的所有表单项及表单配置,需要注意表单项的校验规则,注入上下文中,注入key为 pageFormItems', | ||
| `${constant_1.tableCellPrompt}`, | ||
| '分析存量页面中的所有枚举配置,注入上下文中,key为 enumsConfig', | ||
| '分析存量页面中的所有枚举配置,注入上下文中,key为 enumsConfig,枚举需要分析到枚举的配置文件中比如有customPost customGet,找到对应的urlPrefix和url', | ||
| '分析页面中的所有文案,如果存在如(pre)等处理,提取真正的国际化字段,并且本次生成必须要使用 PreConfig 组件,注入上下文中,key为 i18nPageTexts', | ||
@@ -36,0 +36,0 @@ `分析表单中的默认值使用情况,默认值设置统一使用props中的"reactionsSetter"中的initialValue: ${constant_1.formItemsDetailExample}`, |
@@ -18,2 +18,4 @@ "use strict"; | ||
| const zod_1 = __importDefault(require("zod")); | ||
| const path_1 = __importDefault(require("path")); | ||
| const fs_1 = __importDefault(require("fs")); | ||
| const registerLowcodeExampleTool = (server) => { | ||
@@ -62,3 +64,3 @@ server.registerTool("get-lowcode-example", { | ||
| }).then(res => res.json()); | ||
| const willUseSchemas = res.data.rows.reverse().slice(0, 2); | ||
| const willUseSchemas = res.data.rows.reverse().slice(0, 1); | ||
| const schemas = willUseSchemas.map((item) => { | ||
@@ -135,4 +137,16 @@ try { | ||
| // }); | ||
| (0, util_1.writeLogFile)('获取官方示例-fewshotSchema', JSON.stringify(schemas, null, 2)); | ||
| (0, util_1.setFewshotExample)(JSON.stringify(schemas)); | ||
| (0, util_1.writeLogFile)('获取官方示例-fewshot-Schema', JSON.stringify(schemas, null, 2)); | ||
| const assetsPath = path_1.default.join(__dirname, '../constant/assetsDescription.json'); | ||
| let assetsDesc = []; | ||
| if (fs_1.default.existsSync(assetsPath)) { | ||
| const assets = JSON.parse(fs_1.default.readFileSync(assetsPath, 'utf-8')); | ||
| componentsName.split(',').forEach((name) => { | ||
| const asset = assets.find((item) => item.componentName === name); | ||
| if (asset) { | ||
| assetsDesc.push(...asset.snippets); | ||
| } | ||
| }); | ||
| } | ||
| (0, util_1.writeLogFile)('获取官方示例-fewshot-AssetsDesc', JSON.stringify(assetsDesc, null, 2)); | ||
| (0, util_1.setFewshotExample)(JSON.stringify({ schemas, assetsDesc })); | ||
| return { | ||
@@ -139,0 +153,0 @@ content: [{ |
@@ -7,3 +7,3 @@ "use strict"; | ||
| 核心任务:将原代码中的 Enum.query() 接口调用转换为完整的 URL 路径 | ||
| 核心任务:将原代码中的 Enum.query() 接口调用转换为完整的 URL 路径。重要:需要找到对应customPost customGet的配置文件,然后找到对应的urlPrefix和url,然后拼接起来。 | ||
@@ -67,2 +67,36 @@ 1. URL 转换模式识别 | ||
| 原代码: | ||
| providerCode: { | ||
| field: 'providerCode', | ||
| label: '数据厂商', | ||
| enumType: ManufacturerEnum, | ||
| props: {dropdownMatchSelectWidth: false} | ||
| } | ||
| export const ManufacturerEnum = Enum.query(ManufacturerApi.getMatchList, { | ||
| valueField: 'providerCode', | ||
| textField: 'providerName', | ||
| textTpl: '{{providerName}} / {{providerCode}}', | ||
| queryOnce: true | ||
| }); | ||
| import ManufacturerApi from 'src/common/resource/manufacturer'; | ||
| 配置文件: | ||
| export default assign({ | ||
| urlPrefix: '/risk/admin/platform/', | ||
| getMatchList: customGet('provider/info/list'), | ||
| }); | ||
| 转换步骤: | ||
| - 识别 enumType: ManufacturerEnum | ||
| - 找到 ManufacturerEnum 的定义:Enum.query(ManufacturerApi.getMatchList, {...}) | ||
| - 定位 ManufacturerApi 资源配置文件 | ||
| - 查找 getMatchList 方法:customGet('provider/info/list') | ||
| - 拼接 urlPrefix + customGet 路径 | ||
| - 结果:'/risk/admin/platform/provider/info/list' | ||
| 转换为:url: '/risk/admin/platform/provider/info/list' | ||
| 示例4: | ||
| 原代码: | ||
| export const BooleanType = { | ||
@@ -69,0 +103,0 @@ TRUE: 'TRUE', |
+1
-1
| { | ||
| "name": "low-code-mcp-stdio", | ||
| "version": "2.1.4", | ||
| "version": "2.1.5", | ||
| "bin": { | ||
@@ -5,0 +5,0 @@ "low-code-mcp-stdio": "build/index-stdio.js" |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
510044
0.43%10543
0.4%20
5.26%