实现内容: - 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>
18 lines
333 B
Java
18 lines
333 B
Java
package com.claudecode.command;
|
|
|
|
import com.claudecode.core.AgentLoop;
|
|
import com.claudecode.tool.ToolRegistry;
|
|
|
|
import java.io.PrintStream;
|
|
|
|
/**
|
|
* 命令执行上下文。
|
|
*/
|
|
public record CommandContext(
|
|
AgentLoop agentLoop,
|
|
ToolRegistry toolRegistry,
|
|
PrintStream out,
|
|
Runnable exitCallback
|
|
) {
|
|
}
|