abel533
f05732a60c
fix: terminal title uses jink writeRaw instead of raw PrintStream
...
Terminal title now writes OSC 0 through Ink.Instance.writeRaw()
which goes directly to the JLine terminal. This eliminates garbled
characters caused by writing through intercepted System.out/err or
to streams that bypass the terminal's ANSI processing.
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
99a4ccf059
feat: 块光标 + 动画移至消息区 + 权限交互选择
...
块光标:
- 输入区使用 █ 块光标(匹配原版 Claude Code 风格)
- Agent 运行中输入区只显示 ❯ █
动画效果:
- 思考/处理动画从输入区移至消息区底部
- 使用旋转帧 ◐◓◑◒ + Thinking.../Processing... 文字
- Agent 运行中快捷键栏显示 'esc to interrupt'
权限确认:
- 从 Y/A/N/D 文本输入改为交互选择模式
- 3个选项:Yes / Yes, and don't ask again / No
- 支持 ↑↓ 选择、Enter 确认、Esc 取消、1-3 快捷选择
- Tool use 消息显示蓝色分隔线 + 工具详情
- 新增 requestTextInput() 用于无选项的简单文本输入
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
5ad2628b1a
feat: Ctrl+C 双击退出(匹配原版 Claude Code 行为)
...
- 第一次 Ctrl+C: Agent 运行中则取消任务,空闲时清空输入
- 第二次 Ctrl+C (2秒内): 退出应用
- 快捷键栏显示 'Press Ctrl-C again to exit' 黄色提示
- 2秒超时后自动清除提示(虚拟线程定时)
- 移除未使用的 cmdCount 字段
- 保留 Esc 中断和 Ctrl+D 退出作为备选
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
1b53357ded
feat: Ctrl+C 中断 Agent 运行(而非退出应用)
...
- 使用 Ink.render(component, false) 禁用默认 Ctrl+C 退出
- Ctrl+C 在 Agent 运行中触发 cancel(),停止当前循环
- Ctrl+C 在空闲时清空输入
- 保留 Ctrl+D 作为退出快捷键
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
65bd5b5d9a
feat: interactive AskUser with arrow-key selection
...
- Add interactive option selection for AskUserQuestion tool
(arrow keys ↑↓, Enter confirm, 1-9 quick select, Esc cancel)
- Last option with '其他/Other' enters free text input mode
- New ASK_USER_STRUCTURED_CALLBACK in AskUserQuestionTool
accepts (question, options) BiFunction for structured interaction
- ClaudeCodeComponent renders option list with ❯ indicator
- Cursor position adjusts for variable-height ask area
- Falls back to simple text prompt when no options provided
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
02ab8c2777
enhance: improve assistant message rendering and console patching
...
- Split multi-line assistant messages into separate rendered lines
- Add streaming cursor (▌) indicator for in-progress responses
- Add patchConsole() to intercept System.out/err during TUI mode
- Handle empty assistant message edge case
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
45283c87e4
fix: improve command handling and add paste support
...
- Add ToolRegistry to ClaudeCodeComponent for proper command context
- Use ByteArrayOutputStream to capture command output in TUI mode
- Add onPaste() override for efficient multi-line paste handling
- Fix constructor to accept toolRegistry parameter
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
199ad6259b
refactor: cleanup unused imports, add conversation summary tracking
...
- Remove unused MarkdownRenderer import and field from ClaudeCodeComponent
- Add onFirstUserInput callback for conversation summary tracking
- Wire conversation summary in JinkReplSession
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago
abel533
601a1c9ea9
feat: add jink TUI framework integration
...
- Add jink dependency (io.mybatis.jink:jink:0.3.0-SNAPSHOT)
- Create UIMessage sealed interface for TUI message model
- Create ClaudeCodeComponent (main jink Component with full layout)
- Header box with rounded magenta border
- Message list with virtual scrolling
- Separator lines above/below input area
- Input area with prompt and placeholder
- Status bar and shortcut key bar
- Create JinkReplSession (jink-based REPL replacing JLine readLine loop)
- AgentLoop integration via callbacks -> setState
- Permission confirmation inline in TUI
- Streaming token display
- Update ClaudeCodeRunner to prefer jink TUI with legacy fallback
- Update AppConfig with JinkReplSession bean
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 month ago