momo-ai 1.0.11 → 1.0.13
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/package.json +1 -1
- package/src/_agent/trae/momo-taskplan.json +5 -0
- package/src/_template/PROMPT/trae/momo-task.ejs +1 -1
- package/src/_template/PROMPT/trae/momo-taskplan.ejs +10 -0
- package/src/executor/executeAgent.js +28 -18
- package/src/executor/executeProject.js +17 -1
- /package/{.momo → src/_template/LAIN/.momo}/advanced/refer.json +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 页面规划提示词
|
|
2
|
+
|
|
3
|
+
<!-- BEGIN -->
|
|
4
|
+
解读 specification/changes/MXX-模块/tasks/ 下会一堆任务文件,更新每一份任务文件,针对任务文件进行页面开发级别的规划和计划,将详细的开发步骤更新到文件中和原始内容合并,形成最终的文件任务,您的阅读者是前端开发工程师和设计师。
|
|
5
|
+
|
|
6
|
+
1. 每个模块的任务细节文档位于 specification/changes/MXX-模块/tasks/ 目录下。
|
|
7
|
+
2. 每份文件都需要做一次分析和页面规划的操作,而且只更新 tasks/ 目录之下的任务文件,不更新其他文件。
|
|
8
|
+
3. 参考 specification/project.md 文件中的技术栈和风格说明。
|
|
9
|
+
4. 参考 specification/requirement.md 文件中的需求说明,如果属于某个模块也可以参考模块中的需求 project.md 文件。
|
|
10
|
+
<!-- END -->
|
|
@@ -135,25 +135,34 @@ module.exports = async (options) => {
|
|
|
135
135
|
|
|
136
136
|
// 如果没有提供 agent 参数,显示可用的 agents 并让用户选择
|
|
137
137
|
if (!agentName) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
138
|
+
while (true) {
|
|
139
|
+
Ec.waiting('可用的 Agents:');
|
|
140
|
+
agents.forEach((agent, index) => {
|
|
141
|
+
Ec.waiting(`${index + 1}. ${agent.argName.red.bold} (${agent.name}), id = ${agent.id}, uri = ${agent.uri}`);
|
|
142
|
+
});
|
|
143
|
+
Ec.waiting(`${agents.length + 1}. 退出`);
|
|
144
|
+
|
|
145
|
+
// 获取用户选择
|
|
146
|
+
const answer = await Ec.ask('请选择要使用的 Agent (输入编号): ');
|
|
147
|
+
const selectedIndex = parseInt(answer) - 1;
|
|
148
|
+
|
|
149
|
+
// 验证选择
|
|
150
|
+
if (isNaN(selectedIndex) || selectedIndex < 0 || selectedIndex > agents.length) {
|
|
151
|
+
Ec.error("❌ 无效的选择");
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 检查是否选择退出
|
|
156
|
+
if (selectedIndex === agents.length) {
|
|
157
|
+
Ec.info("已退出 Agent 选择");
|
|
158
|
+
Ec.askClose();
|
|
159
|
+
process.exit(0);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// 使用选择的 agent
|
|
163
|
+
const selectedAgent = agents[selectedIndex];
|
|
164
|
+
return await _processAgent(selectedAgent);
|
|
152
165
|
}
|
|
153
|
-
|
|
154
|
-
// 使用选择的 agent
|
|
155
|
-
const selectedAgent = agents[selectedIndex];
|
|
156
|
-
return await _processAgent(selectedAgent);
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
// 查找指定的 agent
|
|
@@ -164,6 +173,7 @@ module.exports = async (options) => {
|
|
|
164
173
|
agents.forEach((a, index) => {
|
|
165
174
|
Ec.waiting(`${index + 1}. ${a.argName.red.bold} (${a.name}), id = ${a.id}, uri = ${a.uri}`);
|
|
166
175
|
});
|
|
176
|
+
Ec.waiting(`${agents.length + 1}. 退出`);
|
|
167
177
|
Ec.askClose();
|
|
168
178
|
process.exit(1);
|
|
169
179
|
}
|
|
@@ -14,7 +14,7 @@ const fsAsync = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 获取 refer.json 配置文件路径
|
|
18
18
|
* @param {string} baseDir 项目根目录
|
|
19
19
|
* @returns {string} refer.json 文件路径
|
|
20
20
|
*/
|
|
@@ -22,11 +22,27 @@ const _getReferConfigPath = (baseDir) => {
|
|
|
22
22
|
return path.resolve(baseDir, '.momo', 'advanced', 'refer.json');
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* 获取模板中的 refer.json 配置文件路径
|
|
27
|
+
* @returns {string} 模板中 refer.json 文件路径
|
|
28
|
+
*/
|
|
29
|
+
const _getTemplateReferConfigPath = () => {
|
|
30
|
+
return path.resolve(__dirname, '../_template/LAIN/.momo/advanced/refer.json');
|
|
31
|
+
};
|
|
32
|
+
|
|
25
33
|
/**
|
|
26
34
|
* 获取默认的 refer 配置
|
|
27
35
|
* @returns {Object} 默认配置对象
|
|
28
36
|
*/
|
|
29
37
|
const _getDefaultReferConfig = () => {
|
|
38
|
+
// 从模板文件读取默认配置
|
|
39
|
+
const templateConfigPath = _getTemplateReferConfigPath();
|
|
40
|
+
if (fs.existsSync(templateConfigPath)) {
|
|
41
|
+
const content = fs.readFileSync(templateConfigPath, 'utf8');
|
|
42
|
+
return JSON.parse(content);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 如果模板文件不存在,返回硬编码的默认配置
|
|
30
46
|
return {
|
|
31
47
|
maven: {
|
|
32
48
|
file: 'pom.xml',
|
|
File without changes
|