Commit Graph
5 Commits
Author SHA1 Message Date
abel533andCopilot 9f4023bdf0 refactor: apply BaseSlashCommand to all 54 command implementations
- implements SlashCommand -> extends BaseSlashCommand (all 54 files)
- Replace CommandUtils.parseArgs/args null checks -> args(args)
- Replace agentLoop null checks -> requireAgentLoop(context)/noSession()
- Replace context.agentLoop().getToolContext() -> toolCtx(context)
- Replace CommandUtils.success/error/header/subtitle/warning/info -> instance methods
- Remove unused CommandUtils/AnsiStyle imports where applicable
- 87 tests passing, zero compilation errors

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 13:16:55 +08:00
abel533andCopilot 95b45940fd feat: command layer enhancements (Phase 1B.3)
- /help: keyword search + command detail view
- /compact: --stats for token statistics, --aggressive for deeper compaction
- /commit: --push to push after commit, --pr to create PR via gh CLI
- /files: directory tree with depth control, file pattern search
- /permissions: view current permission mode and rules
- /tasks: list background tasks with status, age, result preview

Total commands: 28 → 31

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 09:20:44 +08:00
liuzhandCopilot 831461aff0 fix: /help命令动态展示全部28个已注册命令
- CommandContext增加commandRegistry字段
- HelpCommand从registry动态获取命令列表(不再硬编码6个)
- 自动对齐命令名称,附显示别名

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-02 00:01:11 +08:00
liuzhandCopilot b29d61581a feat: Phase2 JLine终端交互增强 - 行编辑、历史、Tab补全、信号处理
JLine 3 集成:
- ReplSession重写: JLine Terminal + LineReader 替代Scanner
- 支持行编辑(光标移动、删除、Home/End等)
- 持久化历史记录(~/.claude-code-java/history)
- 上下箭头浏览输入历史
- Ctrl+C取消当前输入、Ctrl+D退出
- JLine失败时自动降级到Scanner模式

Tab补全:
- ClaudeCodeCompleter: 斜杠命令补全(/后按Tab)
- 支持命令别名补全(如 /q → exit)
- 分组显示(Commands / Aliases)

新增命令:
- /model: 显示当前AI模型信息
- /compact: 压缩对话上下文
- /cost: Token用量显示(占位)

改进:
- HelpCommand清理为统一格式
- Banner增加终端信息显示和快捷键提示
- 彩色提示符使用AttributedStringBuilder

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 20:18:59 +08:00
liuzhandCopilot d67f41358d feat: Phase1 项目骨架 - Maven项目结构、核心AgentLoop、6个工具、命令系统、控制台渲染、REPL会话
实现内容:
- pom.xml: JDK25 + Spring AI 2.0.0-M4 + JLine3 + Picocli
- core/AgentLoop: 基于ChatModel的显式工具循环(非ChatClient)
- tool/: Tool接口 + ToolRegistry + ToolCallbackAdapter(适配Spring AI)
- tool/impl/: BashTool, FileReadTool, FileWriteTool, FileEditTool, GlobTool, GrepTool
- command/: SlashCommand接口 + CommandRegistry + /help, /clear, /exit
- console/: AnsiStyle, BannerPrinter, ToolStatusRenderer, ThinkingRenderer, SpinnerAnimation, MarkdownRenderer
- context/: SystemPromptBuilder, ClaudeMdLoader(多级CLAUDE.md加载)
- repl/ReplSession: REPL主循环(Scanner降级方案)
- config/AppConfig: Spring Bean装配
- application.yml: Anthropic/OpenAI双模型配置

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 19:22:04 +08:00