momo-ai 1.0.11 → 1.0.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "momo-ai",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Rachel Momo ( OpenSpec )",
5
5
  "main": "src/momo.js",
6
6
  "bin": {
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "页面规划师",
3
+ "id": "momo-taskplan",
4
+ "uri": "https://s.trae.ai/a/0447bd"
5
+ }
@@ -1,4 +1,4 @@
1
- # 领域建模提示词
1
+ # 任务规划提示词
2
2
 
3
3
  <!-- BEGIN -->
4
4
  解读 specification/changes/ 下的所有模块(必须是 MXX- 开头的目录)对应的变更内容,并生成领域模型,根据每个目录中的 tasks.md 生成对应的任务并且更新 tasks.md 文件:
@@ -0,0 +1,8 @@
1
+ # 页面规划提示词
2
+
3
+ <!-- BEGIN -->
4
+ 解读 specification/changes/ 下的所有模块子目录 tasks/ 目录下的任务信息,规划每个任务的页面开发并且更新对应的任务 md 文档。
5
+
6
+ 1. 每个模块的任务细节位于 specification/changes/MXX-模块/tasks/ 目录下。
7
+ 2. 参考 project.md 文件中的技术栈和风格说明。
8
+ <!-- END -->
@@ -135,25 +135,34 @@ module.exports = async (options) => {
135
135
 
136
136
  // 如果没有提供 agent 参数,显示可用的 agents 并让用户选择
137
137
  if (!agentName) {
138
- Ec.waiting('可用的 Agents:');
139
- agents.forEach((agent, index) => {
140
- Ec.waiting(`${index + 1}. ${agent.argName.red.bold} (${agent.name}), id = ${agent.id}, uri = ${agent.uri}`);
141
- });
142
-
143
- // 获取用户选择
144
- const answer = await Ec.ask('请选择要使用的 Agent (输入编号): ');
145
- const selectedIndex = parseInt(answer) - 1;
146
-
147
- // 验证选择
148
- if (isNaN(selectedIndex) || selectedIndex < 0 || selectedIndex >= agents.length) {
149
- Ec.error("❌ 无效的选择");
150
- Ec.askClose();
151
- process.exit(1);
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
- * 获取或创建 refer.json 配置文件路径
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',