momo-ai 1.0.7 → 1.0.8
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/README.md +1 -1
- package/package.json +1 -1
- package/src/lain.js +13 -14
- package/src/terminal/commandHelp.js +0 -1
- package/src/terminal/index.js +0 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Momo SDD - Spec Driven Development 工具
|
|
2
2
|
|
|
3
3
|
 | [](https://www.npmjs.com/package/momo-ai)
|
|
4
|
-
> For Rachel Momo
|
|
4
|
+
> For [Rachel Momo](https://www.weibo.com/maoxiaotong0216) / Serial Experiments Lain
|
|
5
5
|
|
|
6
6
|
## 1. 介绍
|
|
7
7
|
|
package/package.json
CHANGED
package/src/lain.js
CHANGED
|
@@ -28,34 +28,33 @@ colors.setTheme({
|
|
|
28
28
|
const showMenu = () => {
|
|
29
29
|
// 清屏
|
|
30
30
|
process.stdout.write('\x1Bc');
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
// 显示标准头部信息
|
|
33
33
|
showHeader();
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
// 使用96个字符宽度
|
|
36
36
|
const width = 96;
|
|
37
37
|
const headerBorder = '='.repeat(width).blue;
|
|
38
38
|
const footerBorder = '-'.repeat(width).blue;
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
console.log('');
|
|
41
41
|
console.log(headerBorder);
|
|
42
42
|
const title = 'Momo AI / Lain Console';
|
|
43
43
|
const padding = ' '.repeat(Math.floor((width - title.length) / 2) - 1);
|
|
44
44
|
console.log(`${padding}${title}`.bold.brightCyan);
|
|
45
45
|
console.log(headerBorder);
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
console.log('');
|
|
48
48
|
console.log('欢迎使用 Momo AI / Lain 控制台!'.green);
|
|
49
49
|
console.log('这是一个交互式命令行界面。'.yellow);
|
|
50
50
|
console.log('');
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
console.log('可用命令:'.bold);
|
|
53
53
|
console.log(' help - 显示帮助信息'.white);
|
|
54
|
-
console.log(' test - 执行测试命令'.white);
|
|
55
54
|
console.log(' llm - 查看大模型配置信息'.white);
|
|
56
55
|
console.log(' quit - 退出控制台'.white);
|
|
57
56
|
console.log('');
|
|
58
|
-
|
|
57
|
+
|
|
59
58
|
console.log('请在提示符后输入命令。'.gray);
|
|
60
59
|
console.log(footerBorder);
|
|
61
60
|
};
|
|
@@ -63,7 +62,7 @@ const showMenu = () => {
|
|
|
63
62
|
// 显示标准头部信息
|
|
64
63
|
const showHeader = () => {
|
|
65
64
|
const appInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8'));
|
|
66
|
-
|
|
65
|
+
|
|
67
66
|
console.log(`[Momo AI]`.green.bold + ` ----------------- Rachel Momo / AI工具项 ------------------`.rainbow);
|
|
68
67
|
console.log(`[Momo AI]`.green.bold + ' 应用名称: '.bold + 'Rachel Momo / SDD');
|
|
69
68
|
console.log(`[Momo AI]`.green.bold + ' 工具主页: '.bold + appInfo.homepage.blue);
|
|
@@ -75,12 +74,12 @@ const showHeader = () => {
|
|
|
75
74
|
// 处理用户输入
|
|
76
75
|
const handleInput = (input, commands) => {
|
|
77
76
|
const command = input.trim().toLowerCase();
|
|
78
|
-
|
|
77
|
+
|
|
79
78
|
// 创建命令上下文
|
|
80
79
|
const context = {
|
|
81
80
|
commands: commands
|
|
82
81
|
};
|
|
83
|
-
|
|
82
|
+
|
|
84
83
|
switch (command) {
|
|
85
84
|
case '':
|
|
86
85
|
// 空命令,不处理
|
|
@@ -108,16 +107,16 @@ const handleInput = (input, commands) => {
|
|
|
108
107
|
// 主函数
|
|
109
108
|
const main = async () => {
|
|
110
109
|
showMenu();
|
|
111
|
-
|
|
110
|
+
|
|
112
111
|
// 创建 readline 接口
|
|
113
112
|
const rl = readline.createInterface({
|
|
114
113
|
input: process.stdin,
|
|
115
114
|
output: process.stdout,
|
|
116
115
|
prompt: '[Lain AI] > '.cyan.bold
|
|
117
116
|
});
|
|
118
|
-
|
|
117
|
+
|
|
119
118
|
rl.prompt();
|
|
120
|
-
|
|
119
|
+
|
|
121
120
|
rl.on('line', (line) => {
|
|
122
121
|
const input = line.trim();
|
|
123
122
|
handleInput(input, terminalCommands);
|
|
@@ -126,7 +125,7 @@ const main = async () => {
|
|
|
126
125
|
console.log('\n' + '感谢使用 Momo AI / Lain 控制台,再见!'.brightGreen + '\n');
|
|
127
126
|
process.exit(0);
|
|
128
127
|
});
|
|
129
|
-
|
|
128
|
+
|
|
130
129
|
// 处理 Ctrl+C
|
|
131
130
|
process.on('SIGINT', () => {
|
|
132
131
|
console.log('\n\n' + '感谢使用 Momo AI / Lain 控制台,再见!'.brightGreen + '\n');
|
package/src/terminal/index.js
CHANGED
|
@@ -10,7 +10,6 @@ const helpCommand = require('./commandHelp');
|
|
|
10
10
|
const quitCommand = require('./commandQuit');
|
|
11
11
|
|
|
12
12
|
// 在此处添加新命令的导入
|
|
13
|
-
const testCommand = require('./commandTest');
|
|
14
13
|
const llmCommand = require('./commandLlm');
|
|
15
14
|
|
|
16
15
|
// 导出所有命令
|
|
@@ -20,6 +19,5 @@ module.exports = {
|
|
|
20
19
|
quit: quitCommand,
|
|
21
20
|
|
|
22
21
|
// 在此处添加新命令的导出
|
|
23
|
-
test: testCommand,
|
|
24
22
|
llm: llmCommand
|
|
25
23
|
};
|