feat: 添加系统命令支持 (:clear)

- 新增系统命令模块 (core/system-commands)
  - 支持 :clear/:cls/:c 清空对话历史
  - 命令注册表支持别名
  - 可扩展的命令执行器

- Server 端支持
  - 新增 /api/system-commands API
  - WebSocket 处理系统命令消息
  - 会话清空 API 端点

- UI 端支持
  - 新增 SystemCommandMenu 组件
  - 输入 : 时显示命令建议菜单
  - 键盘导航和选择
  - 底部提示添加 : 快捷键
This commit is contained in:
2025-12-17 19:25:42 +08:00
parent 4fc6b61134
commit e0444a966f
21 changed files with 1109 additions and 9 deletions
+19
View File
@@ -150,6 +150,25 @@ export type {
CommandOperationResult,
} from './commands/index.js';
// System Commands (: 前缀)
export {
getSystemCommandRegistry,
resetSystemCommandRegistry,
SystemCommandExecutor,
isSystemCommand,
parseSystemCommand,
executeSystemCommand,
initializeSystemCommands,
builtinSystemCommands,
} from './system-commands/index.js';
export type {
SystemCommand,
SystemCommandContext,
SystemCommandResult,
SystemCommandAction,
SystemCommandInput,
} from './system-commands/index.js';
// Checkpoint
export {
CheckpointManager,