intention-coding 0.2.0 → 0.2.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/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var __webpack_modules__ = {
|
|
|
44
44
|
};
|
|
45
45
|
const SERVICE_CONFIG = {
|
|
46
46
|
name: "\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382",
|
|
47
|
-
version: "0.0
|
|
47
|
+
version: "0.2.0",
|
|
48
48
|
description: "\u8F6F\u4EF6\u5DE5\u7A0B\u5316\u7684\u9700\u6C42\u5206\u6790\uFF0C\u529F\u80FD\u8BBE\u8BA1\uFF0C\u4EE3\u7801\u7F16\u5199\uFF0C\u6D4B\u8BD5\u8FD0\u884C\u548C\u53D1\u5E03\u90E8\u7F72"
|
|
49
49
|
};
|
|
50
50
|
},
|
|
@@ -1978,8 +1978,32 @@ flowchart TD
|
|
|
1978
1978
|
winston.addColors(colors);
|
|
1979
1979
|
const consoleFormat = winston.format.combine(winston.format.timestamp({
|
|
1980
1980
|
format: 'YYYY-MM-DD HH:mm:ss'
|
|
1981
|
-
}), winston.format.colorize(), winston.format.printf(({ timestamp, level, message })
|
|
1982
|
-
|
|
1981
|
+
}), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, ...meta })=>{
|
|
1982
|
+
const metaStr = Object.keys(meta).length ? JSON.stringify(meta, null, 2) : '';
|
|
1983
|
+
return `${timestamp} [${level}]: ${message} ${metaStr}`;
|
|
1984
|
+
}));
|
|
1985
|
+
const fileFormat = winston.format.combine(winston.format.timestamp(), winston.format.errors({
|
|
1986
|
+
stack: true
|
|
1987
|
+
}), winston.format.json());
|
|
1988
|
+
const exceptionFormat = winston.format.combine(winston.format.timestamp(), winston.format.errors({
|
|
1989
|
+
stack: true
|
|
1990
|
+
}), winston.format.printf((info)=>{
|
|
1991
|
+
const { timestamp, level, message, stack, ...meta } = info;
|
|
1992
|
+
const error = meta.error || meta;
|
|
1993
|
+
const errorInfo = {
|
|
1994
|
+
timestamp,
|
|
1995
|
+
level: level || 'error',
|
|
1996
|
+
message: message || 'Uncaught Exception',
|
|
1997
|
+
stack: stack || error && error.stack || 'No stack trace available',
|
|
1998
|
+
error: {
|
|
1999
|
+
name: error && error.name || 'Error',
|
|
2000
|
+
message: error && error.message || String(error || message),
|
|
2001
|
+
code: error && error.code || meta.code,
|
|
2002
|
+
...meta
|
|
2003
|
+
}
|
|
2004
|
+
};
|
|
2005
|
+
return JSON.stringify(errorInfo, null, 2);
|
|
2006
|
+
}));
|
|
1983
2007
|
const transports = [
|
|
1984
2008
|
new winston.transports.Console({
|
|
1985
2009
|
format: consoleFormat,
|
|
@@ -1990,7 +2014,7 @@ flowchart TD
|
|
|
1990
2014
|
datePattern: 'YYYY-MM-DD',
|
|
1991
2015
|
zippedArchive: true,
|
|
1992
2016
|
maxSize: '2m',
|
|
1993
|
-
maxFiles: '
|
|
2017
|
+
maxFiles: '7d',
|
|
1994
2018
|
format: fileFormat,
|
|
1995
2019
|
level: 'info'
|
|
1996
2020
|
})
|
|
@@ -2008,8 +2032,8 @@ flowchart TD
|
|
|
2008
2032
|
datePattern: 'YYYY-MM-DD',
|
|
2009
2033
|
zippedArchive: true,
|
|
2010
2034
|
maxSize: '1m',
|
|
2011
|
-
maxFiles: '
|
|
2012
|
-
format:
|
|
2035
|
+
maxFiles: '7d',
|
|
2036
|
+
format: exceptionFormat
|
|
2013
2037
|
})
|
|
2014
2038
|
],
|
|
2015
2039
|
rejectionHandlers: [
|
|
@@ -2018,8 +2042,8 @@ flowchart TD
|
|
|
2018
2042
|
datePattern: 'YYYY-MM-DD',
|
|
2019
2043
|
zippedArchive: true,
|
|
2020
2044
|
maxSize: '1m',
|
|
2021
|
-
maxFiles: '
|
|
2022
|
-
format:
|
|
2045
|
+
maxFiles: '7d',
|
|
2046
|
+
format: exceptionFormat
|
|
2023
2047
|
})
|
|
2024
2048
|
]
|
|
2025
2049
|
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
请分析本次代码变更,并与需求进行对比,确保实现的完整性。
|
|
2
|
+
|
|
3
|
+
请按以下步骤进行分析:
|
|
4
|
+
|
|
5
|
+
## 1. 代码变更总结
|
|
6
|
+
分析git diff内容,总结:
|
|
7
|
+
- 新增文件及其功能
|
|
8
|
+
- 修改文件及变更内容
|
|
9
|
+
- 删除文件及原因
|
|
10
|
+
- 主要功能模块变更
|
|
11
|
+
|
|
12
|
+
## 2. 接口与需求对应关系表
|
|
13
|
+
根据代码变更,生成接口与需求对应关系表:
|
|
14
|
+
|
|
15
|
+
| 需求功能 | 实现接口 | 请求方式 | URL | 变更状态 |
|
|
16
|
+
|---------|---------|---------|-----|----------|
|
|
17
|
+
| [需求功能描述] | [Controller.method] | [GET/POST/PUT/DELETE] | [/api/path] | [新增/修改/删除] |
|
|
18
|
+
|
|
19
|
+
## 3. 核心逻辑方法表
|
|
20
|
+
分析核心业务逻辑方法:
|
|
21
|
+
|
|
22
|
+
| 方法名称 | 所属类 | 功能说明 | 变更状态 |
|
|
23
|
+
|---------|-------|---------|----------|
|
|
24
|
+
| [methodName] | [ClassName] | [功能描述] | [新增/修改/删除] |
|
|
25
|
+
|
|
26
|
+
## 4. 前端页面与接口对应关系表
|
|
27
|
+
分析前端页面变更:
|
|
28
|
+
|
|
29
|
+
| 页面名称 | 调用接口 | 组件名称 | 路由路径 | 变更状态 |
|
|
30
|
+
|---------|---------|---------|---------|----------|
|
|
31
|
+
| [页面名称] | [Controller.method] | [ComponentName] | [/path] | [新增/修改/删除] |
|
|
32
|
+
|
|
33
|
+
## 5. 前端核心组件表
|
|
34
|
+
分析前端组件变更:
|
|
35
|
+
|
|
36
|
+
| 组件名称 | 所属页面 | 功能说明 | 变更状态 |
|
|
37
|
+
|---------|---------|---------|----------|
|
|
38
|
+
| [ComponentName] | [PageName] | [功能描述] | [新增/修改/删除] |
|
|
39
|
+
|
|
40
|
+
## 6. 需求完整性检查
|
|
41
|
+
对比原始需求,检查:
|
|
42
|
+
- ✅ 已完成的功能
|
|
43
|
+
- ⚠️ 部分完成的功能
|
|
44
|
+
- ❌ 未实现的功能
|
|
45
|
+
- 🔄 需要进一步完善的功能
|
|
46
|
+
|
|
47
|
+
## 7. 建议与总结
|
|
48
|
+
- 实现质量评估
|
|
49
|
+
- 潜在问题识别
|
|
50
|
+
- 后续开发建议
|
|
51
|
+
- 测试建议
|
|
52
|
+
|
|
53
|
+
请确保所有表格上下对齐,内容详实准确。
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<project-initialization>
|
|
2
|
+
<title>初始化项目标准</title>
|
|
3
|
+
<purpose>
|
|
4
|
+
设置和管理项目特定的编码标准和开发指南
|
|
5
|
+
</purpose>
|
|
6
|
+
<config>
|
|
7
|
+
<target-file>current-project-root/.aico/instructions.md</target-file>
|
|
8
|
+
<description>包含项目特定编码标准的ai指令文件</description>
|
|
9
|
+
<cursor-target-file>current-project-root/.cursorrules</cursor-target-file>
|
|
10
|
+
<cursor-description>包含项目特定编码标准和指南的Cursor AI助手规则文件</cursor-description>
|
|
11
|
+
</config>
|
|
12
|
+
<workflow>
|
|
13
|
+
<step id="1" condition="file-exists">
|
|
14
|
+
<description>如果copilot指令文件存在,读取并解析现有的项目标准</description>
|
|
15
|
+
<action>read-existing-standards</action>
|
|
16
|
+
<target>current-project-root/.aico/instructions.md</target>
|
|
17
|
+
<output>返回当前项目标准以供参考</output>
|
|
18
|
+
</step>
|
|
19
|
+
<step id="2" condition="file-not-exists">
|
|
20
|
+
<description>如果没有copilot指令文件,使用提供的模板生成新文件</description>
|
|
21
|
+
<action>create-standards-file</action>
|
|
22
|
+
<target>current-project-root/.aico/instructions.md</target>
|
|
23
|
+
<template>使用`template`标签中的内容创建全面的项目标准文件</template>
|
|
24
|
+
<requirements>
|
|
25
|
+
<item>包含代码风格指南</item>
|
|
26
|
+
<item>定义命名规范</item>
|
|
27
|
+
<item>指定文件组织模式</item>
|
|
28
|
+
<item>记录API文档标准</item>
|
|
29
|
+
<item>设置测试要求</item>
|
|
30
|
+
<item>定义提交信息格式</item>
|
|
31
|
+
</requirements>
|
|
32
|
+
</step>
|
|
33
|
+
<step id="3" condition="cursor-file-exists">
|
|
34
|
+
<description>如果cursor规则文件存在,读取并解析现有的Cursor AI标准</description>
|
|
35
|
+
<action>read-existing-cursor-standards</action>
|
|
36
|
+
<target>current-project-root/.cursorrules</target>
|
|
37
|
+
<output>返回当前Cursor AI标准以供参考</output>
|
|
38
|
+
</step>
|
|
39
|
+
<step id="4" condition="cursor-file-not-exists">
|
|
40
|
+
<description>如果没有cursor规则文件,使用提供的模板生成新文件</description>
|
|
41
|
+
<action>create-cursor-standards-file</action>
|
|
42
|
+
<target>current-project-root/.cursorrules</target>
|
|
43
|
+
<template>使用`cursor-template`标签中的内容创建全面的Cursor AI规则文件</template>
|
|
44
|
+
<requirements>
|
|
45
|
+
<item>包含项目特定的编码模式</item>
|
|
46
|
+
<item>定义首选库和框架</item>
|
|
47
|
+
<item>指定代码生成偏好</item>
|
|
48
|
+
<item>记录项目结构约定</item>
|
|
49
|
+
<item>设置响应格式指南</item>
|
|
50
|
+
<item>定义错误处理模式</item>
|
|
51
|
+
</requirements>
|
|
52
|
+
</step>
|
|
53
|
+
</workflow>
|
|
54
|
+
<guidelines>
|
|
55
|
+
<best-practices>
|
|
56
|
+
<item>确保生成的文件全面且针对项目特定</item>
|
|
57
|
+
<item>包含通用开发标准和技术特定指南</item>
|
|
58
|
+
<item>使指令对开发者清晰且可操作</item>
|
|
59
|
+
<item>在生成标准时考虑项目的技术栈</item>
|
|
60
|
+
<item>为ai和Cursor AI助手创建一致的规则</item>
|
|
61
|
+
<item>确保Cursor规则与ai指令互补</item>
|
|
62
|
+
<item>包含Cursor代码生成的特定模式和偏好</item>
|
|
63
|
+
<item>定义AI助手在项目上下文中的明确行为边界</item>
|
|
64
|
+
</best-practices>
|
|
65
|
+
</guidelines>
|
|
66
|
+
</project-initialization>
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Velocity模板使用说明
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
本工具将标准代码转换为Velocity模板,支持动态字段配置和权限控制。
|
|
5
|
+
|
|
6
|
+
## 使用方法
|
|
7
|
+
|
|
8
|
+
### 基本参数
|
|
9
|
+
```javascript
|
|
10
|
+
{
|
|
11
|
+
"businessName": "用户管理",
|
|
12
|
+
"moduleName": "user",
|
|
13
|
+
"packageName": "com.example.system",
|
|
14
|
+
"apiPrefix": "/api/system/user",
|
|
15
|
+
"columns": [
|
|
16
|
+
{
|
|
17
|
+
"name": "username",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"label": "用户名",
|
|
20
|
+
"query": true,
|
|
21
|
+
"list": true,
|
|
22
|
+
"insert": true,
|
|
23
|
+
"edit": true,
|
|
24
|
+
"required": true,
|
|
25
|
+
"maxLength": 50
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"permissions": {
|
|
29
|
+
"add": "system:user:add",
|
|
30
|
+
"edit": "system:user:edit",
|
|
31
|
+
"delete": "system:user:delete",
|
|
32
|
+
"view": "system:user:view",
|
|
33
|
+
"export": "system:user:export"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 字段类型支持
|
|
39
|
+
- **string**: 文本输入框
|
|
40
|
+
- **number**: 数字输入框
|
|
41
|
+
- **date**: 日期选择器
|
|
42
|
+
- **dict**: 下拉选择框(需要dictCode)
|
|
43
|
+
- **multiselect**: 多选下拉框
|
|
44
|
+
- **boolean**: 开关组件
|
|
45
|
+
- **textarea**: 多行文本框
|
|
46
|
+
- **email**: 邮箱输入框
|
|
47
|
+
- **phone**: 手机号输入框
|
|
48
|
+
|
|
49
|
+
### 字段属性说明
|
|
50
|
+
- **query**: 是否支持查询
|
|
51
|
+
- **list**: 是否在列表中显示
|
|
52
|
+
- **insert**: 是否支持新增
|
|
53
|
+
- **edit**: 是否支持编辑
|
|
54
|
+
- **required**: 是否必填
|
|
55
|
+
|
|
56
|
+
### 特殊配置
|
|
57
|
+
|
|
58
|
+
#### 字典类型字段
|
|
59
|
+
```javascript
|
|
60
|
+
{
|
|
61
|
+
"name": "status",
|
|
62
|
+
"type": "dict",
|
|
63
|
+
"label": "状态",
|
|
64
|
+
"dictCode": "sys_user_status"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### 多选类型字段
|
|
69
|
+
```javascript
|
|
70
|
+
{
|
|
71
|
+
"name": "roles",
|
|
72
|
+
"type": "multiselect",
|
|
73
|
+
"label": "角色",
|
|
74
|
+
"options": [
|
|
75
|
+
{"label": "管理员", "value": "admin"},
|
|
76
|
+
{"label": "普通用户", "value": "user"}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### 日期类型字段
|
|
82
|
+
```javascript
|
|
83
|
+
{
|
|
84
|
+
"name": "createTime",
|
|
85
|
+
"type": "date",
|
|
86
|
+
"label": "创建时间",
|
|
87
|
+
"format": "yyyy-MM-dd HH:mm:ss"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 模板输出说明
|
|
92
|
+
|
|
93
|
+
### 文件结构
|
|
94
|
+
生成的模板包含以下部分:
|
|
95
|
+
1. **查询表单**: 根据query=true的字段生成
|
|
96
|
+
2. **数据表格**: 根据list=true的字段生成列
|
|
97
|
+
3. **弹窗表单**: 根据insert=true或edit=true的字段生成
|
|
98
|
+
4. **JavaScript**: 包含CRUD操作的完整逻辑
|
|
99
|
+
|
|
100
|
+
### 占位符说明
|
|
101
|
+
- `${businessName}`: 业务名称
|
|
102
|
+
- `${moduleName}`: 模块名称
|
|
103
|
+
- `${packageName}`: 包名
|
|
104
|
+
- `${apiPrefix}`: API接口前缀
|
|
105
|
+
- `${columns}`: 字段配置数组
|
|
106
|
+
- `${permission.xxx}`: 权限控制
|
|
107
|
+
|
|
108
|
+
### 使用示例
|
|
109
|
+
|
|
110
|
+
#### 1. 用户管理模板
|
|
111
|
+
```javascript
|
|
112
|
+
const params = {
|
|
113
|
+
businessName: '用户管理',
|
|
114
|
+
moduleName: 'user',
|
|
115
|
+
packageName: 'com.example.system',
|
|
116
|
+
apiPrefix: '/api/system/user',
|
|
117
|
+
columns: [
|
|
118
|
+
{
|
|
119
|
+
name: 'username',
|
|
120
|
+
type: 'string',
|
|
121
|
+
label: '用户名',
|
|
122
|
+
query: true,
|
|
123
|
+
list: true,
|
|
124
|
+
insert: true,
|
|
125
|
+
edit: false,
|
|
126
|
+
required: true
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'email',
|
|
130
|
+
type: 'email',
|
|
131
|
+
label: '邮箱',
|
|
132
|
+
query: false,
|
|
133
|
+
list: true,
|
|
134
|
+
insert: true,
|
|
135
|
+
edit: true,
|
|
136
|
+
required: true
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'status',
|
|
140
|
+
type: 'dict',
|
|
141
|
+
label: '状态',
|
|
142
|
+
dictCode: 'sys_user_status',
|
|
143
|
+
query: true,
|
|
144
|
+
list: true,
|
|
145
|
+
insert: true,
|
|
146
|
+
edit: true
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
permissions: {
|
|
150
|
+
add: 'system:user:add',
|
|
151
|
+
edit: 'system:user:edit',
|
|
152
|
+
delete: 'system:user:delete',
|
|
153
|
+
view: 'system:user:view',
|
|
154
|
+
export: 'system:user:export'
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### 2. 订单管理模板
|
|
160
|
+
```javascript
|
|
161
|
+
const params = {
|
|
162
|
+
businessName: '订单管理',
|
|
163
|
+
moduleName: 'order',
|
|
164
|
+
packageName: 'com.example.sales',
|
|
165
|
+
apiPrefix: '/api/sales/order',
|
|
166
|
+
columns: [
|
|
167
|
+
{
|
|
168
|
+
name: 'orderNo',
|
|
169
|
+
type: 'string',
|
|
170
|
+
label: '订单编号',
|
|
171
|
+
query: true,
|
|
172
|
+
list: true,
|
|
173
|
+
insert: false,
|
|
174
|
+
edit: false,
|
|
175
|
+
required: false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'customerName',
|
|
179
|
+
type: 'string',
|
|
180
|
+
label: '客户名称',
|
|
181
|
+
query: true,
|
|
182
|
+
list: true,
|
|
183
|
+
insert: true,
|
|
184
|
+
edit: true,
|
|
185
|
+
required: true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'amount',
|
|
189
|
+
type: 'number',
|
|
190
|
+
label: '订单金额',
|
|
191
|
+
query: true,
|
|
192
|
+
list: true,
|
|
193
|
+
insert: true,
|
|
194
|
+
edit: true,
|
|
195
|
+
required: true
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'orderDate',
|
|
199
|
+
type: 'date',
|
|
200
|
+
label: '订单日期',
|
|
201
|
+
format: 'yyyy-MM-dd',
|
|
202
|
+
query: true,
|
|
203
|
+
list: true,
|
|
204
|
+
insert: true,
|
|
205
|
+
edit: true
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
permissions: {
|
|
209
|
+
add: 'sales:order:add',
|
|
210
|
+
edit: 'sales:order:edit',
|
|
211
|
+
delete: 'sales:order:delete',
|
|
212
|
+
view: 'sales:order:view',
|
|
213
|
+
export: 'sales:order:export'
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## 注意事项
|
|
219
|
+
|
|
220
|
+
1. **必填字段**: 设置required=true的字段会在表单中添加验证
|
|
221
|
+
2. **字典数据**: dict类型字段需要在后端提供对应的字典数据
|
|
222
|
+
3. **权限控制**: 权限字符串会控制按钮的显示和隐藏
|
|
223
|
+
4. **API接口**: 确保后端提供对应的CRUD接口
|
|
224
|
+
5. **日期格式**: 日期类型字段支持自定义格式字符串
|
|
225
|
+
|
|
226
|
+
## 扩展说明
|
|
227
|
+
|
|
228
|
+
模板支持以下扩展功能:
|
|
229
|
+
- 自定义验证规则
|
|
230
|
+
- 动态表单字段
|
|
231
|
+
- 复杂权限控制
|
|
232
|
+
- 数据格式化显示
|
|
233
|
+
- 批量操作支持
|
|
234
|
+
|
|
235
|
+
生成的模板可以直接用于Layui框架,包含完整的页面交互逻辑。
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<instructions>
|
|
3
|
+
<task>将用户提供的代码转换为Velocity模板</task>
|
|
4
|
+
<objective>根据业务需求和字段配置,生成符合Velocity语法规范的模板文件</objective>
|
|
5
|
+
|
|
6
|
+
<conversion_rules>
|
|
7
|
+
<rule>保留原始代码的功能和结构,仅将可变部分模板化</rule>
|
|
8
|
+
<rule>使用#foreach循环遍历字段集合($columns)</rule>
|
|
9
|
+
<rule>严格遵循字段属性(query/list/insert/edit)控制代码块生成</rule>
|
|
10
|
+
<rule>使用占位符替换业务相关部分,如${businessName}、${moduleName}等</rule>
|
|
11
|
+
<rule>权限控制使用${permission.xxx}格式,如${permission.add}、${permission.edit}</rule>
|
|
12
|
+
</conversion_rules>
|
|
13
|
+
|
|
14
|
+
<field_handling>
|
|
15
|
+
<query_fields>
|
|
16
|
+
<condition>字段配置中query=true</condition>
|
|
17
|
+
<generation>生成查询表单字段,包含输入框、下拉框、日期选择器等</generation>
|
|
18
|
+
<types>
|
|
19
|
+
<type name="string">文本输入框</type>
|
|
20
|
+
<type name="date">日期选择器,支持自定义格式</type>
|
|
21
|
+
<type name="dict">下拉选择框,关联字典数据</type>
|
|
22
|
+
<type name="multiselect">多选下拉框</type>
|
|
23
|
+
</types>
|
|
24
|
+
</query_fields>
|
|
25
|
+
|
|
26
|
+
<list_fields>
|
|
27
|
+
<condition>字段配置中list=true</condition>
|
|
28
|
+
<generation>生成表格列,支持数据格式化显示</generation>
|
|
29
|
+
<formatting>
|
|
30
|
+
<date>使用layui.util.toDateString格式化日期</date>
|
|
31
|
+
<dict>通过$dictMap.get()获取字典标签</dict>
|
|
32
|
+
</formatting>
|
|
33
|
+
</list_fields>
|
|
34
|
+
|
|
35
|
+
<form_fields>
|
|
36
|
+
<condition>字段配置中insert=true或edit=true</condition>
|
|
37
|
+
<generation>生成弹窗表单字段,支持新增和编辑模式</generation>
|
|
38
|
+
<validation>
|
|
39
|
+
<required>使用lay-verify="required"标记必填字段</required>
|
|
40
|
+
<pattern>使用正则表达式验证输入格式</pattern>
|
|
41
|
+
<length>支持maxlength和minlength属性</length>
|
|
42
|
+
</validation>
|
|
43
|
+
</form_fields>
|
|
44
|
+
</field_handling>
|
|
45
|
+
|
|
46
|
+
<special_field_types>
|
|
47
|
+
<dict_type>
|
|
48
|
+
<description>字典类型字段,需要dictCode配置</description>
|
|
49
|
+
<usage>通过$dictMap.get('$column.dictCode')获取字典列表</usage>
|
|
50
|
+
</dict_type>
|
|
51
|
+
|
|
52
|
+
<multiselect_type>
|
|
53
|
+
<description>多选类型字段,支持options配置</description>
|
|
54
|
+
<usage>使用multiple属性创建多选下拉框</usage>
|
|
55
|
+
</multiselect_type>
|
|
56
|
+
|
|
57
|
+
<date_type>
|
|
58
|
+
<description>日期类型字段,支持format配置</description>
|
|
59
|
+
<usage>集成layui.laydate实现日期选择</usage>
|
|
60
|
+
</date_type>
|
|
61
|
+
|
|
62
|
+
<boolean_type>
|
|
63
|
+
<description>布尔类型字段,使用开关组件</description>
|
|
64
|
+
<usage>使用lay-skin="switch"创建开关控件</usage>
|
|
65
|
+
</boolean_type>
|
|
66
|
+
</special_field_types>
|
|
67
|
+
|
|
68
|
+
<template_structure>
|
|
69
|
+
<html_structure>
|
|
70
|
+
<head>包含必要的CSS和JavaScript引用</head>
|
|
71
|
+
<body>包含查询表单、数据表格、弹窗表单</body>
|
|
72
|
+
</html_structure>
|
|
73
|
+
|
|
74
|
+
<sections>
|
|
75
|
+
<query_form>查询条件区域,支持动态字段渲染</query_form>
|
|
76
|
+
<data_table>数据展示表格,包含操作按钮</data_table>
|
|
77
|
+
<modal_form>弹窗表单,用于新增和编辑操作</modal_form>
|
|
78
|
+
<javascript>页面交互逻辑,包含CRUD操作</javascript>
|
|
79
|
+
</sections>
|
|
80
|
+
</template_structure>
|
|
81
|
+
|
|
82
|
+
<permission_handling>
|
|
83
|
+
<levels>
|
|
84
|
+
<add>新增权限控制${permission.add}</add>
|
|
85
|
+
<edit>编辑权限控制${permission.edit}</edit>
|
|
86
|
+
<delete>删除权限控制${permission.delete}</delete>
|
|
87
|
+
<view>查看权限控制${permission.view}</view>
|
|
88
|
+
<export>导出权限控制${permission.export}</export>
|
|
89
|
+
</levels>
|
|
90
|
+
<implementation>
|
|
91
|
+
<toolbar>工具栏按钮权限控制</toolbar>
|
|
92
|
+
<row_operations>行级操作按钮权限控制</row_operations>
|
|
93
|
+
</implementation>
|
|
94
|
+
</permission_handling>
|
|
95
|
+
|
|
96
|
+
<api_integration>
|
|
97
|
+
<endpoints>
|
|
98
|
+
<list>GET ${apiPrefix}/list - 数据列表查询</list>
|
|
99
|
+
<add>POST ${apiPrefix}/add - 新增数据</add>
|
|
100
|
+
<edit>POST ${apiPrefix}/edit - 编辑数据</edit>
|
|
101
|
+
<delete>POST ${apiPrefix}/delete - 删除数据</delete>
|
|
102
|
+
<export>GET ${apiPrefix}/export - 数据导出</export>
|
|
103
|
+
</endpoints>
|
|
104
|
+
</api_integration>
|
|
105
|
+
|
|
106
|
+
<validation_rules>
|
|
107
|
+
<template_check>验证Velocity语法正确性</template_check>
|
|
108
|
+
<html_check>验证HTML结构完整性</html_check>
|
|
109
|
+
<js_check>验证JavaScript代码正确性</js_check>
|
|
110
|
+
<placeholder_check>验证所有占位符正确替换</placeholder_check>
|
|
111
|
+
</validation_rules>
|
|
112
|
+
</instructions>
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intention-coding",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "软件工程化的需求分析,功能设计,代码编写,测试运行和发布部署",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/index.js"
|
|
10
|
-
"require": "./dist/index.cjs"
|
|
9
|
+
"import": "./dist/index.js"
|
|
11
10
|
}
|
|
12
11
|
},
|
|
13
12
|
"bin": "./dist/index.js",
|
|
14
|
-
"main": "./dist/index.
|
|
13
|
+
"main": "./dist/index.js",
|
|
15
14
|
"module": "./dist/index.js",
|
|
16
15
|
"types": "./dist/index.d.ts",
|
|
17
16
|
"files": [
|
|
@@ -26,11 +25,9 @@
|
|
|
26
25
|
"prepublish": "npm run build"
|
|
27
26
|
},
|
|
28
27
|
"engines": {
|
|
29
|
-
"node": ">=
|
|
28
|
+
"node": ">=20.19.0"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@modelcontextprotocol/inspector": "0.9.0",
|
|
33
|
-
"@modelcontextprotocol/sdk": "1.10.2",
|
|
34
31
|
"@rslib/core": "^0.10.0",
|
|
35
32
|
"@types/better-sqlite3": "^7.6.13",
|
|
36
33
|
"@types/node": "^18.0.0",
|
|
@@ -42,7 +39,6 @@
|
|
|
42
39
|
"zod": "3.25.64"
|
|
43
40
|
},
|
|
44
41
|
"dependencies": {
|
|
45
|
-
"@anthropic-ai/claude-code": "^1.0.51",
|
|
46
42
|
"@types/pdf-parse": "^1.1.5",
|
|
47
43
|
"aico-pack": "2.1.0",
|
|
48
44
|
"axios": "^1.10.0",
|
|
@@ -51,7 +47,6 @@
|
|
|
51
47
|
"lru-cache": "^11.1.0",
|
|
52
48
|
"mammoth": "^1.9.1",
|
|
53
49
|
"pdf-parse": "^1.1.1",
|
|
54
|
-
"repomix": "^0.3.9",
|
|
55
50
|
"uuid": "^11.1.0",
|
|
56
51
|
"winston": "^3.17.0",
|
|
57
52
|
"winston-daily-rotate-file": "^5.0.0",
|