Commit Graph
9 Commits
Author SHA1 Message Date
abel533andCopilot 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>
2026-04-04 16:03:23 +08:00
abel533andCopilot 2f645b9d85 enhance: improve header colors, streaming markdown, scroll preservation
- Header: use colored values (API cyan, model green, dir yellow, etc.)
- Markdown: render progressively during streaming (not just after completion)
  - Streaming cursor appended to last rendered line
- Scroll: preserve user scroll offset during streaming token updates
  - Previously reset to 0 on every token, now keeps user position
- All process info (tool calls, thinking) persists after completion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-04 15:51:23 +08:00
abel533andCopilot 9a437889b7 enhance: ASCII logo header, thinking animation, markdown rendering
- Restore original ASCII coffee cup logo in header (dual-column layout)
- Fix shortcutBar to single line with height(1) constraint
- Add spinning animation for thinking indicator (◐◓◑◒ cycle at 120ms)
- Create MarkdownToText converter for assistant messages:
  - Headers (# ## ###) with distinct colors and prefixes
  - Bold (**text**) rendering
  - Inline code (\code\) in yellow
  - Code blocks with language label and │ prefix
  - Ordered/unordered lists with bullet points
- Streaming messages show raw text; completed messages use markdown

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-04 15:42:53 +08:00
abel533andCopilot b72fcfea79 fix: add thread safety for concurrent state modifications
- Add stateLock to synchronize all getState/setState read-modify-write
  operations across UI thread and AgentLoop background threads
- Synchronize onInput, onPaste, addMessage, appendToStreamingMessage,
  finishStreamingMessage, completeLastToolCall, setThinking, runAgent
- Extract addMessageInternal() to avoid double-locking
- Harden extractToolSummary with explicit indexOf checks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-04 15:08:04 +08:00
abel533andCopilot 75ecaeca58 enhance: improve tool call display with smart arg extraction
- Add extractToolSummary() to show human-readable tool arguments
  (command: $ ..., file_path: path, pattern: ..., query: ...)
- Tool running state shows 'running...' suffix
- Tool completed state shows 'done' suffix
- Match original Claude Code tool status rendering style

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-04 15:03:23 +08:00
abel533andCopilot 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>
2026-04-04 15:02:04 +08:00
abel533andCopilot 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>
2026-04-04 15:00:29 +08:00
abel533andCopilot 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>
2026-04-04 14:57:05 +08:00
abel533andCopilot 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>
2026-04-04 14:52:55 +08:00