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.
@@ -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 {spawn} = require('child_process');
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
- let proc;
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
- let proc;
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}`);
@@ -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;