abel533
|
c5440a2b4c
|
feat: enhance system prompt and tool descriptions to match TS version
Phase 1A implementation:
SystemPromptBuilder.java (142 lines -> ~290 lines):
- Add CyberRisk security boundary instruction
- Add System section (permission modes, prompt injection defense)
- Add Doing Tasks section (coding style, security, collaboration)
- Add Actions section (operation risk management, dangerous ops protection)
- Add Tone & Style section (emoji control, concise output, code references)
- Add Output Efficiency section (direct communication)
- Add Language preference support
- Restructure into modular section builder methods matching TS architecture
Tool description enhancements (8 tools):
- BashTool: add security boundaries, git best practices, no-substitute rule
- FileWriteTool: add must-Read-first rule, prefer-Edit guidance
- GrepTool: add never-use-Bash-grep rule, search guidance
- AgentTool: add when-to-use/not-use guidance, sub-prompt enhanced
- FileEditTool: add indentation preservation, prefer-edit-existing rule
- TodoWriteTool: add proactive usage guidance, state machine rules
- TaskUpdateTool: add status workflow documentation
- ConfigTool: add available settings list
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
1 month ago |
abel533
|
54c3cb41a9
|
feat: 工具执行流式输出预览
- ToolEvent 新增 PROGRESS 阶段,工具可在执行中报告进度
- ToolContext 添加 progressCallback,工具可通过 reportProgress() 报告输出行
- BashTool 在读取每行输出时实时报告进度
- AgentLoop 在工具执行前设置进度回调,执行后清除
- ToolCallMsg 支持 outputLines 字段,保留最后 5 行流式预览
- 运行中的工具在消息区显示实时输出(灰色,截断至 120 字符)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
1 month ago |
abel533
|
a30dfa9ad0
|
fix: 修复滚动限制 + 自动检测Shell类型
滚动修复:
- scroll() 使用实际渲染行数而非消息数计算 maxOffset
- 解决 /help 等多行输出无法滚动到顶部的问题
Shell 检测:
- Windows 自动检测 PowerShell 7+ > Windows PowerShell > cmd.exe
- 动态调整 BashTool 描述,告知AI使用正确的命令语法
- 系统提示词包含详细的 Shell 使用指南(PowerShell cmdlets)
- header 显示检测到的 Shell 类型
- Unix 优先 bash,回退 sh
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
1 month ago |
liuzh
|
cc0d3f8b00
|
Revert "fix: 将所有emoji/Unicode特殊字符替换为ASCII安全字符"
This reverts commit 3cd67ffe451be2cc7a66b5c554966f1d5aa58c7c.
|
1 month ago |
liuzh
|
eeceaaaea9
|
fix: 将所有emoji/Unicode特殊字符替换为ASCII安全字符
Windows cmd/PowerShell默认codepage下emoji显示为?号。
全局替换: 👋->移除, 💭->[Thinking], ⚙->*, ✓->[OK], ✗->[FAIL],
◆->>, ⚠->[!], ✅->[OK], •->|/-, →->>>, ✏️->[Edit]等。
❯保留(windows-vtp终端下正常显示)。
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
1 month ago |
liuzh
|
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>
|
1 month ago |