yuangs 1.2.2 → 1.3.0
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/cli.js +16 -16
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -92,22 +92,22 @@ async function handleAICommand() {
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
const askLoop = () => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
95
|
+
rl.question(chalk.green('你:'), async (q) => {
|
|
96
|
+
const trimmed = q.trim();
|
|
97
|
+
|
|
98
|
+
// ✨ 新增:优雅退出
|
|
99
|
+
if (['exit', 'quit', 'bye'].includes(trimmed.toLowerCase())) {
|
|
100
|
+
console.log(chalk.cyan('👋 再见!'));
|
|
101
|
+
rl.close();
|
|
102
|
+
process.exit(0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!trimmed) {
|
|
106
|
+
return askLoop();
|
|
107
|
+
}
|
|
108
|
+
await askOnce(trimmed , model);
|
|
109
|
+
askLoop();
|
|
110
|
+
});
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
|