@code4bug/jarvis-agent 1.3.3 → 1.3.4
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/dist/commands/index.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
const builtinCommands = [
|
|
9
9
|
{ name: 'init', description: '初始化项目信息,生成 JARVIS.md', category: 'builtin', submitMode: 'action' },
|
|
10
10
|
{ name: 'new', description: '开启新会话,重新初始化上下文', category: 'builtin', submitMode: 'action' },
|
|
11
|
+
{ name: 'exit', description: '退出应用程序', category: 'builtin', submitMode: 'action' },
|
|
12
|
+
{ name: 'quit', description: '退出应用程序', category: 'builtin', submitMode: 'action' },
|
|
13
|
+
{ name: 'bye', description: '退出应用程序', category: 'builtin', submitMode: 'action' },
|
|
11
14
|
{ name: 'resume', description: '恢复历史会话上下文', category: 'builtin', submitMode: 'list' },
|
|
12
15
|
{ name: 'help', description: '显示帮助信息', category: 'builtin', submitMode: 'action' },
|
|
13
16
|
{ name: 'agent', description: '切换智能体', category: 'builtin', submitMode: 'list' },
|
package/dist/screens/repl.js
CHANGED
|
@@ -208,6 +208,12 @@ export default function REPL() {
|
|
|
208
208
|
const parts = trimmed.slice(1).split(/\s+/);
|
|
209
209
|
const cmdName = parts[0].toLowerCase();
|
|
210
210
|
const hasArgs = parts.length > 1 && parts.slice(1).join('').length > 0;
|
|
211
|
+
if (['exit', 'quit', 'bye'].includes(cmdName)) {
|
|
212
|
+
setInput('');
|
|
213
|
+
slashMenu.setSlashMenuVisible(false);
|
|
214
|
+
handleExit();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
211
217
|
// 内置命令
|
|
212
218
|
if (['new', 'help', 'init', 'session_clear', 'permissions', 'skills', 'version'].includes(cmdName)) {
|
|
213
219
|
setInput('');
|
|
@@ -319,7 +325,7 @@ export default function REPL() {
|
|
|
319
325
|
clearStream();
|
|
320
326
|
abortRequestedRef.current = false;
|
|
321
327
|
await engineRef.current.handleQuery(trimmed, callbacks);
|
|
322
|
-
}, [isProcessing, pushHistory, clearStream, slashMenu, handleNewSession]);
|
|
328
|
+
}, [isProcessing, pushHistory, clearStream, slashMenu, handleNewSession, handleExit]);
|
|
323
329
|
// ===== 输入处理 =====
|
|
324
330
|
const handleUpArrow = useCallback(() => {
|
|
325
331
|
const result = navigateUp(input);
|
|
@@ -26,6 +26,9 @@ export async function executeSlashCommand(cmdName) {
|
|
|
26
26
|
'可用命令:',
|
|
27
27
|
' /init 初始化项目信息,生成 JARVIS.md',
|
|
28
28
|
' /new 开启新会话,重新初始化上下文',
|
|
29
|
+
' /exit 退出应用程序',
|
|
30
|
+
' /quit 退出应用程序',
|
|
31
|
+
' /bye 退出应用程序',
|
|
29
32
|
' /resume 恢复历史会话(支持二级菜单选择)',
|
|
30
33
|
' /resume <ID> 直接恢复指定会话',
|
|
31
34
|
' /help 显示此帮助信息',
|