momo-ai 1.0.4 → 1.0.6
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/.momo/advanced/refer.json +50 -0
- package/README.md +51 -35
- package/package.json +1 -1
- package/src/_agent/trae/momo-datamodel.json +5 -0
- package/src/_agent/trae/momo-module-req.json +5 -0
- package/src/_agent/trae/momo-system-req.json +5 -0
- package/src/_agent/trae/momo-task.json +5 -0
- package/src/_template/MCP/.gitkeep +0 -0
- package/src/_template/PROMPT/plan.md.ejs +1 -1
- package/src/_template/PROMPT/trae/momo-datamodel.ejs +8 -0
- package/src/_template/PROMPT/trae/momo-module-req.ejs +11 -0
- package/src/_template/PROMPT/trae/momo-system-req.ejs +9 -0
- package/src/_template/PROMPT/trae/momo-task.ejs +11 -0
- package/src/commander/agent.json +12 -0
- package/src/commander/agentcfg.json +5 -0
- package/src/commander/project.json +12 -0
- package/src/epic/momo.fn.out.js +10 -3
- package/src/executor/executeAdd.js +6 -16
- package/src/executor/executeAgent.js +214 -0
- package/src/executor/executeAgentCfg.js +195 -0
- package/src/executor/executeInit.js +5 -1
- package/src/executor/executeOpen.js +22 -21
- package/src/executor/executePlan.js +3 -16
- package/src/executor/executeProject.js +296 -0
- package/src/executor/executeRun.js +3 -29
- package/src/executor/executeTasks.js +3 -29
- package/src/executor/index.js +8 -1
|
@@ -2,7 +2,7 @@ const Ec = require('../epic');
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const util = require('util');
|
|
5
|
-
const {
|
|
5
|
+
const { outCopy } = require('../epic/momo.fn.out');
|
|
6
6
|
const fsAsync = require('fs').promises;
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -63,34 +63,8 @@ const _renderTemplate = (template, data) => {
|
|
|
63
63
|
*/
|
|
64
64
|
const _copyToClipboard = async (content, requirementName, taskName) => {
|
|
65
65
|
try {
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
if (process.platform === 'darwin') {
|
|
69
|
-
// macOS
|
|
70
|
-
proc = spawn('pbcopy', {stdio: 'pipe'});
|
|
71
|
-
} else if (process.platform === 'win32') {
|
|
72
|
-
// Windows
|
|
73
|
-
proc = spawn('clip', {stdio: 'pipe'});
|
|
74
|
-
} else {
|
|
75
|
-
// Linux/其他系统,尝试使用xclip
|
|
76
|
-
proc = spawn('xclip', ['-selection', 'clipboard'], {stdio: 'pipe'});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
proc.stdin.write(content);
|
|
80
|
-
proc.stdin.end();
|
|
81
|
-
|
|
82
|
-
// 等待复制操作完成
|
|
83
|
-
await new Promise((resolve, reject) => {
|
|
84
|
-
proc.on('close', (code) => {
|
|
85
|
-
if (code === 0) {
|
|
86
|
-
resolve();
|
|
87
|
-
} else {
|
|
88
|
-
reject(new Error(`剪贴板进程退出码: ${code}`));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
proc.on('error', reject);
|
|
92
|
-
});
|
|
93
|
-
|
|
66
|
+
// 使用统一的剪贴板函数
|
|
67
|
+
await outCopy(content);
|
|
94
68
|
Ec.waiting('📄 任务执行提示词已拷贝到剪切板');
|
|
95
69
|
|
|
96
70
|
// 保存内容到 .working 目录
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const util = require('util');
|
|
4
|
-
const { spawn } = require('child_process');
|
|
5
4
|
const Ec = require('../epic');
|
|
6
5
|
const fsAsync = require('fs').promises;
|
|
6
|
+
const { outCopy } = require('../epic/momo.fn.out');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 读取模板文件并提取 <!-- BEGIN --> 到 <!-- END --> 之间的内容
|
|
@@ -61,34 +61,8 @@ const _renderTemplate = (template, data) => {
|
|
|
61
61
|
*/
|
|
62
62
|
const _copyToClipboard = async (content) => {
|
|
63
63
|
try {
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
if (process.platform === 'darwin') {
|
|
67
|
-
// macOS
|
|
68
|
-
proc = spawn('pbcopy', { stdio: 'pipe' });
|
|
69
|
-
} else if (process.platform === 'win32') {
|
|
70
|
-
// Windows
|
|
71
|
-
proc = spawn('clip', { stdio: 'pipe' });
|
|
72
|
-
} else {
|
|
73
|
-
// Linux/其他系统,尝试使用xclip
|
|
74
|
-
proc = spawn('xclip', ['-selection', 'clipboard'], { stdio: 'pipe' });
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
proc.stdin.write(content);
|
|
78
|
-
proc.stdin.end();
|
|
79
|
-
|
|
80
|
-
// 等待复制操作完成
|
|
81
|
-
await new Promise((resolve, reject) => {
|
|
82
|
-
proc.on('close', (code) => {
|
|
83
|
-
if (code === 0) {
|
|
84
|
-
resolve();
|
|
85
|
-
} else {
|
|
86
|
-
reject(new Error(`剪贴板进程退出码: ${code}`));
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
proc.on('error', reject);
|
|
90
|
-
});
|
|
91
|
-
|
|
64
|
+
// 使用统一的剪贴板函数
|
|
65
|
+
await outCopy(content);
|
|
92
66
|
Ec.waiting('📄 任务检查提示词已拷贝到剪切板');
|
|
93
67
|
} catch (error) {
|
|
94
68
|
Ec.waiting(`⚠️ 无法拷贝到剪切板: ${error.message}`);
|
package/src/executor/index.js
CHANGED
|
@@ -14,6 +14,10 @@ const executeActors = require('./executeActors');
|
|
|
14
14
|
const executeRun = require('./executeRun');
|
|
15
15
|
const executeTasks = require('./executeTasks');
|
|
16
16
|
const executeUnlock = require('./executeUnlock');
|
|
17
|
+
const executeProject = require('./executeProject');
|
|
18
|
+
const executeAgentCfg = require('./executeAgentCfg');
|
|
19
|
+
const executeAgent = require('./executeAgent');
|
|
20
|
+
|
|
17
21
|
const exported = {
|
|
18
22
|
executeHelp,
|
|
19
23
|
executeInit,
|
|
@@ -30,6 +34,9 @@ const exported = {
|
|
|
30
34
|
executeActors,
|
|
31
35
|
executeRun,
|
|
32
36
|
executeTasks,
|
|
33
|
-
executeUnlock
|
|
37
|
+
executeUnlock,
|
|
38
|
+
executeProject,
|
|
39
|
+
executeAgentCfg,
|
|
40
|
+
executeAgent
|
|
34
41
|
};
|
|
35
42
|
module.exports = exported;
|