Commit graph

42 commits

Author SHA1 Message Date
Shunsuke Hayashi
671b04e4f8 test(hooks): Add comprehensive hooks module tests
- Add 24 new tests for HookEvent, HookAction, Hook, HookContext
- Test HookManager registration, enable/disable, get_hooks
- Test HooksConfig save/load
- Test hook execution with Log, Notify actions
- Test conditional hook execution
- Test variable expansion in hook messages

Core tests: 359 passed (+24 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:56:37 +09:00
Shunsuke Hayashi
2b27a4a667 test(rules): Add comprehensive rules module tests
- Add 23 new tests for Rule, AgentPreferences, MiyabiRules
- Test validation logic (version, name, suggestion, severity)
- Test file matching and pattern matching
- Test RulesLoader file discovery and loading
- Test serialization and error handling

Core tests: 335 passed (+23 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:54:50 +09:00
Shunsuke Hayashi
f740f07c23 test: Add comprehensive cache and error_policy tests
Cache tests (18 new):
- Test CacheEntry creation and expiration
- Test TTLCache insert, remove, clear, stats
- Test custom TTL, concurrent access
- Test LLMCacheKey and ApiCacheKey creation
- Test cache factories and serialization

Error policy tests (18 new):
- Test FallbackStrategy variants and defaults
- Test CircuitState equality
- Test CircuitBreaker default, reset, counters
- Test circuit transitions and thresholds

Core tests: 312 passed (52 new this phase)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:45:42 +09:00
Shunsuke Hayashi
c84c9d6c25 test(mcp): Add comprehensive MCP integration tests
- Add 16 new tests for MCP server configuration, request/response handling
- Test McpServerConfig defaults and serialization
- Test McpConfig save/load and multiple servers
- Test McpRequest with params, McpResponse success/error
- Test McpError with data, McpTool deserialization
- Test McpManager creation and state checking

Core tests: 276 passed (16 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:43:16 +09:00
Shunsuke Hayashi
7738f10965 feat(streaming): Add real-time streaming support for Agent
- Add StreamingAgent with run_stream() and run_with_callback() methods
- Add AgentStreamEvent enum with 11 event types (Started, TextChunk, ToolDetected, etc.)
- Add StreamProcessor for handling API streaming events
- Add StreamingConfig for buffer_size and emit_chunks settings
- Add 10 comprehensive unit tests

Core tests: 260 passed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:40:03 +09:00
Shunsuke Hayashi
2ccf8267ac feat(orchestration): Add multi-agent orchestration module
- ParallelConfig for concurrency, timeout, fail-fast settings
- Orchestrator for parallel and sequential agent execution
- OrchestratorTask for task definition with optional system prompts
- ParallelResult with success tracking and metrics
- TaskResult for individual execution results

Features:
- Semaphore-based concurrency control
- Timeout per task execution
- Success rate and total token tracking
- Helper function for quick orchestrator creation

Total: 752 tests passing (9 new orchestration tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:34:44 +09:00
Shunsuke Hayashi
f6215765b3 test(session): Add comprehensive session tests
- Test session creation with custom ID
- Test system prompt builder pattern
- Test tags management
- Test preview truncation and empty preview
- Test storage default directory
- Test storage exists/load/delete operations
- Test metadata conversion and preview
- Test timestamp updates

Total: 23 session tests (13 new)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:31:37 +09:00
Shunsuke Hayashi
364dfd9da3 test: Add comprehensive Workflow and DAG tests
Workflow tests (14 new tests):
- Test StepCondition, RetryConfig, FailurePolicy defaults
- Test StepStatus and WorkflowStatus equality
- Test WorkflowContext with variables and results
- Test StepResult and WorkflowResult creation
- Test Workflow with output variables
- Test step and failure policy variants

DAG tests (23 new tests):
- Test TaskId creation and display
- Test Task with priority and estimated time
- Test TaskNode operations (add/remove dependencies)
- Test TaskLevel creation and management
- Test TaskGraph operations (count, parallelism, levels)
- Test TaskGraphBuilder with priority
- Test DAGError variants
- Test complex parallel graphs

Total: 730 tests passing (228 core, 498 TUI, 4 CLI)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:28:39 +09:00
Shunsuke Hayashi
5cfd656dbc test(agent): Add comprehensive agent integration tests
- Add approval_integration_tests module with 10 tests
- Add executor_registry_tests module with 5 tests
- Add agent_event_tests module with 2 tests
- Test ApprovalCallback implementations (AutoApproveAll, RejectHighRisk)
- Test ChannelApprover async communication
- Test RiskLevel ordering and approval requirements
- Test ExecutorRegistry tool registration and risk levels

Total: 17 new tests, all passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:24:40 +09:00
Shunsuke Hayashi
6ac4d539d4 feat(dag): Add DAG-based task graph for parallel execution
- Add TaskGraph with topological sort using Kahn's algorithm
- Add TaskLevel for grouping independent tasks for parallel execution
- Add TaskGraphBuilder for fluent API construction
- Support dependency tracking and cycle detection
- Include 7 comprehensive tests

Ported and simplified from miyabi-private/miyabi-dag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:20:16 +09:00
Shunsuke Hayashi
5935dae7dd feat(agent): Add approval callback system for tool execution
- Add ApprovalCallback trait with ApprovalDecision (Approved, Rejected, ModifyInput)
- Implement AutoApproveAll, RejectHighRisk, and ChannelApprover callbacks
- Integrate approval callback into Agent execution loop
- Support interactive approval via channel-based communication
- Include comprehensive tests for all approval scenarios

All 167 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:16:55 +09:00
Shunsuke Hayashi
57820166f9 feat: Add MCP and GitHub Tools integration to ExecutorRegistry
MCP Integration:
- Add McpToolExecutor for executing MCP server tools
- Add register_mcp_tools method to ExecutorRegistry
- Dynamic tool registration from MCP servers
- Async mutex for thread-safe MCP manager access

GitHub Tools Integration:
- Add register_github_tools method to ExecutorRegistry
- Register 7 GitHub tools with appropriate risk levels:
  - Low: ListIssues, GetIssue, ListPullRequests
  - Medium: CreateIssue, AddComment, AddLabels, CreatePullRequest

All 662 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 00:04:05 +09:00
Shunsuke Hayashi
f64faa6f09 feat: Integrate Hooks and Workflow with Agent execution
Hooks Integration:
- Add HookManager field to Agent struct
- Load hooks from HooksConfig on Agent creation
- Execute SessionStart hook at agent start
- Execute PreTool/PostTool hooks around tool execution
- Execute OnError hook on tool failures
- Execute SessionEnd hook on completion

Workflow Integration:
- Add execute_with_agent method to WorkflowManager
- Create Agent instance for each workflow step
- Execute actual tasks instead of placeholders
- Proper error handling and result tracking

All 662 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:59:59 +09:00
Shunsuke Hayashi
48dfa915c7 feat: Add hooks, workflow, MCP support and core modules
Phase 2: Hooks System
- Event-driven execution with HookEvent/HookAction types
- HookManager for registration and execution

Phase 3: Multi-Agent Workflow
- Workflow orchestration with dependency graphs
- WorkflowStep with conditions and retry support

Phase 4: MCP (Model Context Protocol) Support
- McpServer for external tool servers
- McpManager for multiple server management

Also includes core modules: cache, error_policy, feature_flags,
git, logger, plugin, retry, rules

662 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:37:14 +09:00
Shunsuke Hayashi
3f6fbeb498 feat: Add GitHub API integration and tools
Phase 1 of feature extensions.

- Add GitHubClient for GitHub API interactions
- Add GitHub tools for agent execution:
  - github_list_issues: List repository issues
  - github_get_issue: Get issue details
  - github_create_issue: Create new issues
  - github_add_comment: Comment on issues/PRs
  - github_list_prs: List pull requests
  - github_create_pr: Create pull requests
  - github_add_labels: Add labels to issues
- Support for GITHUB_TOKEN and GITHUB_REPOSITORY env vars
- Create tool registry for GitHub operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:26:40 +09:00
Shunsuke Hayashi
25d358f96e feat: Add config system, agent mode, and session management
- Add comprehensive Config system with TOML support (~/.miyabi/config.toml)
- Add Agent module for autonomous task execution with tool approval
- Add Session management for conversation persistence
- Extend CLI with new commands: init, sessions, agent, version
- Add CLI flags: --model, --max-tokens, --thinking, --config, --session
- Fix all clippy warnings (16 → 0)
- Improve code quality with collapsible pattern matching

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 22:22:11 +09:00
Shunsuke Hayashi
af281f1ed0 feat: Integrate MainView into App for complete TUI support
- Update App to use MainView for rendering and key handling
- Enable all integrated components: ChatComposer, CommandPopup, HelpViewer, etc.
- Add keyboard shortcuts: Ctrl+P (commands), F1 (help), Ctrl+B (sidebar)
- Support streaming mode with proper UI updates
- Add execute_command for command handling

Closes #30

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 19:28:37 +09:00
Shunsuke Hayashi
e0207e8649 feat: Add comprehensive test coverage and fix tests
Sprint 9-10 changes:
- Add 42 tests for help.rs (HelpViewer, CheatSheet, QuickRef)
- Add 55 tests for resume_picker.rs (SessionEntry, ResumePicker, SessionManager)
- Add 73 tests for ui.rs (colors, styles, layout, Modal, Toast, Breadcrumb, etc.)
- Fix markdown_stream tests (proper markdown paragraph separation)
- Add help.rs and ui.rs modules to miyabi-tui

Total: 585 tests passing across all crates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 19:24:05 +09:00
Shunsuke Hayashi
2f6b8ed089 test: Add comprehensive tests for overlay components
Sprint 8 - Test coverage for UI overlays:

Issue #33 - approval_overlay.rs (38 tests):
- RiskLevel (color, label, icon)
- ApprovalRequest (builder pattern)
- ApprovalOverlay (show/hide, key handling, queue)
- ApprovalBuilder (shell_command, file_write, file_edit)
- BatchApproval (approve/reject, mixed approvals)

Issue #34 - command_popup.rs (34 tests):
- Command (creation, builder methods)
- CommandPopup (show/hide, navigation, filtering)
- fuzzy_match algorithm
- CommandCategory and CommandBuilder

Issue #35 - pager_overlay.rs (39 tests):
- PagerContent (Plain, Markdown, Code, Styled)
- PagerOverlay (scrolling, search, key handling)
- PagerBuilder (help, log, code)

Total tests: 331 (111 new tests added)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 19:06:48 +09:00
Shunsuke Hayashi
81027daa4a fix(views): Fix compilation errors and add notification tests
Sprint 7 changes:
- Fixed 25 compilation errors in views.rs:
  - Fixed API mismatches for Spinner, Breadcrumb, StatusBar, StatusItem
  - Fixed PagerOverlay content method usage
  - Fixed render method signatures for overlays
  - Fixed ApprovalAction and ResumePickerAction enum variants
  - Fixed ChatComposer method names (get_input vs get_content)
  - Fixed Layout split return type compatibility
- Added 60 tests for notification.rs covering:
  - NotificationPriority (3 tests)
  - Notification (8 tests)
  - NotificationAction (3 tests)
  - NotificationPanel (15 tests)
  - Banner (5 tests)
  - AlertType, AlertButton (4 tests)
  - Alert (12 tests)
  - NotificationCenter (11 tests)

Total tests: 220

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:58:31 +09:00
Shunsuke Hayashi
2f91bfa8ce test(shimmer): Add comprehensive test suite
Add 34 tests covering shimmer animation components:
- ShimmerState: creation, duration, looping, progress, reset
- SkeletonLoader: creation, widths, effect, colors
- Spinner: creation, style, label, color, frames
- ProgressBar: creation, clamp, label, show_percent, chars
- TypingIndicator: creation, label
- Countdown: creation, label, remaining
- LoadingState: is_loading, is_complete, is_error
- LoadingOverlay: creation, show, show_progress, hide, complete, error
- blend_colors: RGB blending, non-RGB fallback

Note: Tests cannot be run due to pre-existing compilation errors
in views.rs which has API mismatches with other modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:49:46 +09:00
Shunsuke Hayashi
f1dd7d4164 test(textarea): Add comprehensive test suite and fix bug
Add 29 tests covering TextArea functionality:
- Basic operations: creation, text manipulation, char insertion
- Cursor movement (left/right/up/down, home/end, word navigation)
- Selection and clipboard (copy/cut/paste)
- Undo/redo operations
- Line deletion (word backward, to line start/end)
- Configuration (placeholder, tab width, viewport)
- Unicode support and multiline editing

Fix overflow bug in delete_to_line_start where undo position
was calculated after text modification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:47:52 +09:00
Shunsuke Hayashi
2da467f877 test(chat_composer): Add comprehensive test suite
Add 23 tests covering ChatComposer functionality:
- Basic operations: creation, char insertion, backspace, delete
- Submit and cancel actions
- Multiline input with Shift+Enter
- Cursor movement (left/right, home/end)
- Command history navigation (up/down arrows)
- Command mode (/ prefix)
- Ctrl key shortcuts (u=clear, k=kill, w=delete word)
- Unicode character support
- Placeholder and max_history configuration
- Focus state management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:44:15 +09:00
Shunsuke Hayashi
b3898dc45e feat(diff_viewer): Add scrollable diff view with navigation
Integrate ScrollState for viewport-based diff navigation.
- Add scroll_up, scroll_down, page_up, page_down methods
- Add scroll_to_top, scroll_to_bottom, scroll_to_line methods
- Add visible_lines() for viewport-based rendering
- Add scroll_offset, scroll_percentage, is_at_top, is_at_bottom getters
- Set viewport_height to control scroll behavior
- Update scroll state total_lines on parse
- Add 9 tests for scroll functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:42:44 +09:00
Shunsuke Hayashi
384867632c feat(diff_viewer): Add syntax highlighting for diff content
Integrate SyntaxHighlighter to provide code-aware coloring in diff views.
- Add enable_syntax_highlighting option to DiffViewerOptions
- Extract file extension from diff file paths for language detection
- Apply syntax highlighting to addition/deletion/context lines
- Preserve diff background colors while using syntax colors for text
- Add 7 new tests for syntax highlighting functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:39:27 +09:00
Shunsuke Hayashi
62d312796a feat(core): add tool result formatting methods
- Add ToolOutput formatting methods:
  - format_display(): Format output for display
  - summary(max_len): Truncated summary with ...
  - as_text(): Extract text from common fields
  - format_duration(): Human-readable duration (ms/s)
  - status_indicator(): ✓/✗ indicator
  - has_error_code(): Check for non-zero exit code

- Handle different content types (string, object, array)
- Pretty print JSON objects and arrays
- Add 10 comprehensive tests for formatting

Closes #28

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:31:42 +09:00
Shunsuke Hayashi
84f57e1431 feat(core): add configurable RetryConfig for API requests
- Add RetryConfig struct with configurable:
  - max_retries, base_delay_ms, max_delay_ms
  - retry_on_network_error, retry_on_rate_limit
  - Builder pattern methods

- Add delay_for_attempt() for exponential backoff
- Export RetryConfig from lib.rs
- Add 7 tests for retry configuration
  - Default values, builder, no retries
  - Delay calculation with exponential backoff
  - Delay capping at max
  - Error types validation
  - Tool definition serialization

Closes #23

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:29:54 +09:00
Shunsuke Hayashi
4755023c43 feat(tui): add cursor and scroll position tracking
- Add CursorPosition struct for tracking line/column
- Add ScrollState struct with viewport management:
  - scroll_up/down, page_up/down
  - scroll_to_top/bottom
  - Auto-scroll on new content
  - Scroll percentage calculation
  - Viewport height configuration

- Update MarkdownStream to use new scroll system
- Track cursor position on content push
- Update render() to update total_lines
- Export ScrollState and CursorPosition from lib.rs
- Add 6 tests for scroll and cursor functionality

Closes #13

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:27:48 +09:00
Shunsuke Hayashi
c82ad45b36 feat(core): implement Glob and Grep search tools
- Add GlobTool for finding files matching glob patterns
  - Supports ** recursive patterns
  - Configurable max results (default 1000)
  - Base directory support

- Add GrepTool for searching file contents with regex
  - Regex pattern matching
  - Case insensitive option
  - File glob filtering
  - Directory recursive search
  - Max matches limit (default 100)

- Add glob and regex dependencies to workspace
- Export GlobTool and GrepTool from lib.rs
- Update create_file_tool_registry (5 tools)
- Update create_standard_tool_registry (6 tools)
- Add 7 tests for Glob and Grep tools

Closes #27

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:25:00 +09:00
Shunsuke Hayashi
d6ac8c8273 feat(core): add comprehensive tool definition tests
- Export anthropic::Tool as ApiTool for API tool definitions
- Add 6 comprehensive tests for tool schema validation:
  - test_tool_schema_format: JSON Schema format validation
  - test_tool_schema_required_params: required/optional param handling
  - test_to_anthropic_tools: Anthropic API format conversion
  - test_registry_schemas: ToolRegistry::schemas() method
  - test_standard_registry_has_all_tools: all 4 tools registered
  - test_tool_default_values_in_schema: default value handling

Closes #22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:20:39 +09:00
Shunsuke Hayashi
554b2f7f99 feat(core): implement Bash tool with sandboxing
- Add BashTool struct with timeout, working directory, and output truncation
- Implement dangerous command checking (rm -rf /, format, mkfs, etc.)
- Add tokio::select! for timeout handling
- Add create_standard_tool_registry() including BashTool
- Export BashTool and create_standard_tool_registry from lib.rs
- Add 5 tests for bash functionality

Closes #26

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:17:45 +09:00
Shunsuke Hayashi
277d0e4858 feat(core): implement token counting and context window management
Add token.rs with:
- TokenCounter for estimating token usage
- ModelLimits for Claude model configurations
- ContextManager for automatic context pruning
- TokenUsage and ContextUsage statistics
- Support for 200k context window
- Automatic oldest message pruning
- 10 unit tests

Closes #21

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:13:44 +09:00
Shunsuke Hayashi
04f7bc897e feat(tui): implement syntax highlighting for code blocks
Add syntax.rs with syntect integration:
- SyntaxHighlighter with configurable themes
- Support for Rust, Python, JavaScript, TypeScript, etc.
- Language alias normalization (js→JavaScript, py→Python)
- highlight_code() and render_code_block() helpers
- Global syntax/theme sets with lazy loading
- Fallback for unknown languages
- 10 unit tests

Dependencies added: syntect, once_cell

Closes #12

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:10:39 +09:00
Shunsuke Hayashi
29d1335c7e feat(core): implement file operation tools (Read, Write, Edit)
Add tools.rs with:
- ReadTool - Read files with offset/limit, line numbers
- WriteTool - Write files with auto directory creation
- EditTool - Replace text with replace_all option
- Security checks for path traversal
- Base directory configuration
- create_file_tool_registry() helper
- 10 unit tests with tempfile

Closes #25

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:07:51 +09:00
Shunsuke Hayashi
5aae11a0cb feat(core): implement conversation state and message history
Add conversation.rs with:
- Conversation struct with full state management
- ConversationMessage with timestamps and metadata
- ConversationMetadata (title, tags, model, tokens)
- ConversationManager for handling multiple conversations
- System prompt support
- Serialization/deserialization for persistence
- Truncate and clear functionality
- File save/load operations
- 14 unit tests

Closes #20

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:05:28 +09:00
Shunsuke Hayashi
9f869f93fa feat(tui): implement diff visualization with colors and indicators
Add diff_viewer.rs with enhanced diff display:
- DiffColors with GitHub-inspired color scheme (#2ea043, #f85149)
- DiffViewer widget with configurable options
- Line number columns (old/new)
- Gutter indicators (+/-)
- File headers with path display
- Multiple color schemes (default, minimal, high-contrast)
- Helper functions render_diff() and render_diff_minimal()
- 11 unit tests

Closes #16

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:03:27 +09:00
Shunsuke Hayashi
e24069ca79 feat(tui): implement incremental markdown parser with pulldown-cmark
Add markdown_parser.rs with:
- MarkdownParser with caching for efficient re-rendering
- pulldown-cmark integration with full options
- EventRenderer for converting markdown to styled Ratatui lines
- Support for headings, code blocks, lists, emphasis, links
- Blockquotes, horizontal rules, task lists
- Graceful handling of incomplete/malformed markdown
- 14 unit tests covering all features

Dependencies added: pulldown-cmark

Closes #11

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:01:43 +09:00
Shunsuke Hayashi
4440302e3b feat(core): implement Tool trait and registry system
Add tool.rs with complete tool abstraction:
- Tool trait with async_trait for tool definitions
- ToolRegistry for managing and executing tools
- ParameterDef for declarative parameter schemas
- Automatic JSON schema generation
- Input validation before execution
- Integration with Anthropic tool format
- ToolOutput for structured results
- Comprehensive error types (NotFound, ValidationError, etc.)
- 12 unit tests covering registration, lookup, execution

Dependencies added: async-trait

Closes #24

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:58:31 +09:00
Shunsuke Hayashi
8d7a7a6099 feat(core): implement Anthropic API client with streaming
Add anthropic.rs with complete Claude API integration:
- AnthropicClient with builder pattern configuration
- Message types (Role, ContentBlock, Tool, etc.)
- Non-streaming message() method with retry logic
- Streaming message_stream() with SSE parsing
- Comprehensive error types (AuthError, RateLimited, ApiError)
- Exponential backoff for transient errors
- 8 unit tests for client and parsing

Dependencies added: reqwest (with stream), futures

Closes #19

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:56:33 +09:00
Shunsuke Hayashi
bed65b23b2 feat(tui): implement DiffRender for git diff parsing
Add diff_render.rs with complete unified diff parsing support:
- DiffLineType enum (Context, Addition, Deletion, HunkHeader, FileHeader)
- DiffLine, DiffHunk, FileDiff structs for structured representation
- DiffRender with parse() and render() methods
- Line number tracking for both old/new files
- Styled Ratatui Line output with syntax highlighting
- 5 comprehensive unit tests

Closes #15

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:53:44 +09:00
Shunsuke Hayashi
e096f5eea8 feat: Implement MarkdownStream core structure (#10)
- Add StreamState enum (Idle, Streaming, Complete)
- Add StreamBuffer for content accumulation
- Add MarkdownStream with state management
- Implement push_str() for streaming chunks
- Implement render() returning Ratatui Lines
- Add basic markdown styling (headers, code, lists)
- Add cursor indicator during streaming
- Add comprehensive unit tests (5 tests)

Closes #10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:50:30 +09:00
Shunsuke Hayashi
00d5d4d4e9 chore: Initialize Miyabi project with full planning
- Add .claude/ configuration (agents, commands, prompts, templates)
- Add comprehensive documentation:
  - WBS.md - Work Breakdown Structure
  - SPRINT_PLANNING.md - 4-sprint detailed plan
  - OPERATION_PLAN.md - Execution procedures
  - PRODUCT_SPEC.md - Product requirements
  - PREPARATION_OPS.md - Pre-sprint checklist
- Add PlantUML diagrams (wbs-diagram, gantt-chart)
- Configure Miyabi (.miyabi.yml)
- Set up Rust workspace structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:45:08 +09:00