Commit Graph

97 Commits

Author SHA1 Message Date
Dango233
a34215ef35 feat(cli): Add --split-output option
Adds a size-based output splitter via --split-output (kb/mb) and writes numbered parts without splitting within a top-level folder.

Also updates metrics aggregation for multi-part output and adds unit tests.
2025-12-18 02:15:24 -05:00
Kazuki Yamada
dc694e7372 test(skill): Add tests for copySkillOutputToCurrentDirectory
Add unit tests for the copySkillOutputToCurrentDirectory function:
- Copy .claude/skills directory when it exists
- Skip copy when directory does not exist
- Handle EPERM and EACCES permission errors
- Handle generic errors
2025-12-12 21:02:18 +09:00
Kazuki Yamada
54a1391e30 refactor(cli): Use cliOptions directly for skillName and skillDir
Instead of creating separate variables and passing them through the task,
directly update cliOptions.skillName and cliOptions.skillDir. This simplifies
the code flow and removes redundant fields from DefaultActionTask interface.
2025-12-10 00:35:09 +09:00
Kazuki Yamada
46094b8cd8 fix(cli): Show correct skill output path in summary
When Personal Skills location is selected, the summary was showing
a relative path (.claude/skills/) instead of the actual path
(~/.claude/skills/). Now passes the computed skillDir to reportResults.
2025-12-10 00:27:43 +09:00
Kazuki Yamada
e137b56081 feat(skill): Add interactive skill location selection
Add @clack/prompts-based selection for skill output location:
- Personal Skills (~/.claude/skills/) - default, available across all projects
- Project Skills (.claude/skills/) - shared with team via git

Features:
- Interactive prompt to choose skill location
- Overwrite confirmation when skill directory already exists
- Works with both local and remote repositories
2025-12-10 00:27:43 +09:00
Kazuki Yamada
f854dd4250 refactor(skill): Improve skill output generation and add tests
Refactor and improve the skill generation feature based on code review:

- Split generateSkillOutput into generateSkillReferences and
  generateSkillMdFromReferences to avoid double generation
- Add try-catch error handling to writeSkillOutput with proper
  permission error messages
- Add unit tests for skillSectionGenerators (12 tests)
- Add validation tests for --skill-generate flag combinations
- Update createMockConfig to support skillGenerate and remoteUrl
2025-12-10 00:27:43 +09:00
Kazuki Yamada
e003ec6344 test(cli): Add tests for ignore-related CLI flags to improve coverage
Added unit tests for buildCliConfig function to cover --no-gitignore,
--no-dot-ignore, and --no-default-patterns flags. These tests ensure
proper handling of ignore configuration options and improve test coverage
to meet the 80% threshold.

This addresses the Codecov coverage gap where src/cli/actions/defaultAction.ts
lines 131-132 were not covered by tests.
2025-11-08 20:50:52 +09:00
Kazuki Yamada
438b79f654 docs(website): Add .ignore file documentation for all languages
Updated documentation for all supported languages to include:
- ignore.useDotIgnore configuration option
- --no-dot-ignore CLI flag
- .ignore file explanation and priority order
- Benefits of using .ignore file with ripgrep and ag tools

Also updated test files to include useDotIgnore in mock configs
to satisfy TypeScript type checking after adding the new
configuration option.

Languages updated:
- zh-cn (Simplified Chinese)
- zh-tw (Traditional Chinese)
- ko (Korean)
- vi (Vietnamese)
- id (Indonesian)
- hi (Hindi)
- fr (French)
- de (German)
- es (Spanish)
- pt-br (Brazilian Portuguese)
2025-11-08 20:02:14 +09:00
Kazuki Yamada
3811fdb8eb test(coverage): Address PR review feedback for test quality improvements
Implemented mandatory and recommended fixes from code review:

1. Fix timer cleanup in cliSpinner.test.ts
   - Added vi.useRealTimers() to afterEach hook
   - Prevents fake timers from bleeding into other test files

2. Fix isCancel mock in initAction.test.ts (3 locations)
   - Changed from mockReturnValue(true) to mockImplementation
   - Now properly tests only the actual cancel symbol
   - More accurate test behavior for cancellation scenarios

3. Add DI pattern explanation comment in configLoad.ts
   - Clarifies why dependency injection is used for jitiImport
   - Documents the double instrumentation issue
   - Helps future maintainers understand the design decision
2025-10-31 01:18:21 +09:00
Kazuki Yamada
72735cfdb1 test(coverage): Improve test coverage for CLI and core modules
Added comprehensive test coverage for critical CLI and core functionality:

- Created new test file for cliSpinner with 15 tests covering:
  * Spinner start/stop/update operations
  * Quiet/verbose/stdout mode handling
  * Success/fail message display
  * Interval management

- Enhanced initAction tests (11→17 tests):
  * Added isCancel handling for user cancellation
  * Added return value validation tests
  * Covered config and ignore file creation flows

- Enhanced cliReport tests (8→15 tests):
  * Added git diffs/logs reporting tests
  * Added security check reporting for git content
  * Added single vs multiple issue message handling

- Enhanced permissionCheck tests (13→16 tests):
  * Added macOS-specific error message tests
  * Added platform-specific error handling tests
  * Added unknown error code handling

- Enhanced outputGenerate tests (7→12 tests):
  * Added git diffs/logs inclusion tests
  * Added JSON format output tests
  * Added file/directory structure exclusion tests

Overall improvements:
- Test count: 804 → 840 (+36 tests)
- Code coverage: 70.63% → 71.00% (+0.37%)
- Branch coverage: 77.64% → 78.55% (+0.91%)
- Significant improvement in CLI modules (cliSpinner: 25% → 59.61%)
2025-10-31 01:18:21 +09:00
Kazuki Yamada
50a413d205 fix(cli): Improve error message for permission errors in remote repository output
When copying output files fails due to permission errors (EPERM/EACCES),
provide clear and actionable error messages that explain the issue and
offer specific solutions.

This commonly occurs when users run repomix from protected directories
like C:\Windows\System32 on Windows.

Fixes #868
2025-10-19 23:14:45 +09:00
Slava Kurilyak
bc5f1342f5 feat(cli,core,config): Add --include-full-directory-structure and full repository tree 2025-10-17 17:50:08 -07:00
Kazuki Yamada
3233fc4812 fix(cli): Skip file copy when source and target paths are identical
When using the remote repository feature with an absolute path specified
for the output file, the previous implementation attempted to copy the file
even though source and target resolved to the same path. This resulted in
an error when trying to copy a file to itself.

This commit fixes the issue by:
- Checking if source and target paths are identical before copying
- Skipping the copy operation when they are the same
- This handles absolute paths and any other edge cases where paths resolve to the same location

The fix is implemented in copyOutputToCurrentDirectory function itself,
making it more robust and self-contained.

Fixes #873
2025-10-11 00:13:32 +09:00
Kazuki Yamada
1bb752a431 fix(cli): Move stdin processing to main process to resolve hang in child_process worker
Issue #867で報告された--stdinオプションのハング問題を修正しました。

v1.6.0でdefaultActionがchild_processで実行されるようになりましたが、
child_processではデフォルトで親プロセスのstdinが継承されないため、
worker内でprocess.stdinを読み取ろうとするとハングしていました。

Changes:
- stdin処理をメインプロセスに移動し、読み取り結果をworkerに渡すように変更
- DefaultActionTask interfaceをisStdinからstdinFilePathsに変更
- child_processによるリソース分離と安定性を維持しながら、stdin機能を復元

Fixes #867
2025-10-02 23:59:53 +09:00
Kazuki Yamada
ea1cc485c2 chore(config): disable organizeImports for src/index.ts
Added override configuration to disable Biome's organizeImports feature
specifically for src/index.ts to allow manual import order management
while keeping automatic import organization enabled for other files.
2025-09-21 13:54:12 +09:00
Kazuki Yamada
1badf53c3c refactor(cli): optimize ping task and improve error handling
- Remove unnecessary config parameter from PingTask interface for better performance
- Improve error serialization using util.inspect with safety limits
- Update function signatures to match simplified ping interface
- Add comprehensive error details formatting with depth and length limits

These changes address PR review comments and improve worker efficiency.
2025-09-20 22:58:31 +09:00
autofix-ci[bot]
c106ca8acb [autofix.ci] apply automated fixes 2025-09-20 12:44:54 +00:00
Kazuki Yamada
7153526cc9 fix(test): correct stdin processing path expectations in defaultActionWorker tests
- Fix stdin processing tests to expect raw cwd path instead of resolved path
- Aligns test expectations with actual implementation where stdin uses [cwd] directly
- Resolves Windows CI failures where path.resolve() was incorrectly applied to stdin cases
- Maintains correct expectations for directory processing vs stdin processing paths

This fixes the remaining Windows CI test failures while preserving test accuracy.
2025-09-20 21:44:04 +09:00
Kazuki Yamada
3266ad1a15 fix(test): make defaultActionWorker tests cross-platform compatible
- Import path module and use path.resolve() for all path assertions
- Fix failing tests on Windows CI by handling platform-specific path separators
- Ensure tests work correctly on both Unix and Windows systems
- Maintain test functionality while improving cross-platform compatibility

This resolves CI failures on Windows builds while preserving test coverage.
2025-09-20 20:37:50 +09:00
Kazuki Yamada
1a8bca2292 test(metrics): add comprehensive tests for worker functions
- Add tests for defaultActionWorker.ts covering ping, directory processing, stdin handling, error cases, and path resolution
- Add tests for calculateGitDiffMetrics.ts covering config validation, diff processing, error handling, and encoding
- Add tests for calculateGitLogMetrics.ts covering log processing, error scenarios, and edge cases
- All test files follow project conventions with proper mocking and type safety
- Total of 46 new tests ensuring robust coverage of worker functionality

These tests improve code coverage and provide safety net for future changes
to the metrics calculation and worker system components.
2025-09-20 20:33:54 +09:00
Kazuki Yamada
681e377361 refactor(shared): improve error handling and cleanup code
- Use class names for RepomixError type checking instead of hardcoded strings
- Remove unused RepomixError import from fileProcess.ts
- Simplify comments in errorHandle.ts and fileProcess.ts
- Clean up constructor-based error checking logic
2025-09-17 00:59:58 +09:00
Kazuki Yamada
8a88f45230 feat(cli): wrap entire defaultAction in child_process while optimizing other workers with worker_threads
Implemented a comprehensive worker process architecture that balances performance and isolation:

- Created defaultActionWorker.ts that runs entire CLI processing pipeline in child_process for better resource isolation
- Migrated all other worker implementations (fileProcess, security, metrics, etc.) from child_process to worker_threads for improved performance
- Enhanced logger.ts to support both worker_threads (via workerData) and child_process (via environment variables)
- Added color support for child_process workers by passing FORCE_COLOR and TERM environment variables
- Moved Spinner from main process to defaultActionWorker for direct stdout control

This hybrid approach provides the best of both worlds: the main CLI operation runs in isolated child_process for stability, while intensive parallel tasks use faster worker_threads for optimal performance.
2025-09-16 23:49:38 +09:00
Kazuki Yamada
b7fe6f25c5 fix(lint): resolve all oxlint warnings for code quality
- Remove unused imports across 67 files (RepomixConfigMerged, QueryCapture, etc.)
- Fix unused parameters by prefixing with underscore (_context, _index, etc.)
- Remove unused catch parameters using modern JavaScript syntax
- Fix require-yield warnings in generator functions
- Remove unused variables and interface declarations
- Add oxlint configuration to ignore integration test fixtures

Resolves 144 linting warnings while preserving all functionality.
All 743 tests continue to pass. Code quality significantly improved.
2025-08-24 18:25:08 +09:00
Kazuki Yamada
8bf797114b feat(cli): Report files detected as binary by content inspection
Add new "Binary Files Detected" section to CLI output that shows files which were
skipped due to binary content detection (not extension-based). This addresses issue #752
where users were not informed about files being silently excluded.

Changes:
- Update fileRead.ts to return detailed skip reasons (binary-extension, binary-content, size-limit, encoding-error)
- Modify file collection pipeline to track and propagate skipped files
- Add reportSkippedFiles function to display binary-content detected files
- Show files with relative paths and helpful exclusion messages
- Only display section when binary-content files are found
- Add comprehensive test coverage for new functionality

The implementation follows existing security check reporting patterns and provides
users clear visibility into why files were excluded from output.
2025-08-23 14:35:54 +09:00
Kazuki Yamada
5b5ee862a0 feat(cli): Add --include-logs option for git commit history
This feature allows users to include git log information in the output to help AI understand development patterns and file change relationships.

Key changes:
- Added --include-logs and --include-logs-count CLI options
- Default to 50 commits, configurable via CLI and config file
- Includes commit date, message, and changed file paths (excludes commit hashes)
- Added security checks and metrics calculation for git logs
- Updated output templates to include git logs section
- Comprehensive test coverage and TypeScript fixes

Resolves user request for including git commit history to provide development context for AI analysis.
2025-08-22 14:09:58 +09:00
Kazuki Yamada
a9698bb74a refactor(cli): move tokenCountTree parsing to Commander.js level
- Move string-to-number parsing from defaultAction to Commander.js option parser
- Update CLI types to reflect Commander.js parsed values (boolean | number)
- Simplify buildCliConfig by removing redundant parsing logic
- Update tests to match new type expectations

This approach follows the same pattern as --top-files-len and centralizes
input validation at the CLI parsing level where it belongs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 21:05:50 +09:00
Kazuki Yamada
a377b5cedf fix(test): correct tokenCountTree type in test to match CLI interface
CLI options use string type for numeric values as they come from commander.js parsing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 20:43:55 +09:00
Kazuki Yamada
2132f3a11d fix(cli): improve token count threshold validation and code quality
- Add explicit radix 10 to Number.parseInt() for consistent parsing
- Add validation to throw error for non-numeric string inputs
- Export TreeNode interface to eliminate code duplication
- Remove unused rootDirs parameter from test helper
- Remove unused isLast parameter from displayNode function
- Simplify token count threshold handling in reporter

These changes address review feedback to improve robustness and maintainability.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 20:38:02 +09:00
Kazuki Yamada
2e584c1436 refactor(cli): rename cliPrint to cliReport and reorganize reporting functions
- Rename cliPrint.ts to cliReport.ts with all functions changed from print* to report*
- Move printResults from defaultAction to cliReport as reportResults for better organization
- Move reportTokenCountTree to cli/reporters/tokenCountTreeReporter.ts for cleaner separation
- Move test-only functions (buildTokenCountStructure, convertToOutput) from core module to test files
- Update all imports and test files to reflect new naming conventions
- Maintain all functionality while improving code organization and module cohesion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 16:26:30 +09:00
Kazuki Yamada
eabbfa098b refactor(cli): reorganize CLI options and move tokenCountTree to cliPrint
Major restructuring of CLI options and tokenCountTree functionality:

CLI Options:
- Reorganized options into logical groups: "CLI Input/Output Options", "Repomix Output Options", and "File Selection Options"
- Moved --verbose, --quiet, --stdout, --stdin, --copy, --token-count-tree, --top-files-len to CLI I/O group
- Renamed --summarize-token-counts to --token-count-tree for clarity
- Updated README.md documentation to reflect new option organization

TokenCountTree Refactoring:
- Moved tokenCountTree functionality from saveTokenCounts.ts to cliPrint.ts as printTokenCountTree
- Deleted saveTokenCounts.ts (no longer needed)
- Removed handleTokenCountTree function from defaultAction.ts
- Integrated printTokenCountTree into printResults workflow for consistency
- Updated threshold calculation to be handled within printTokenCountTree

Configuration:
- Added tokenCountTree option to config schema with default value false
- Changed schema from z.union([z.boolean(), z.string()]) to z.union([z.boolean(), z.number()])
- CLI now converts string thresholds to numbers during buildCliConfig

Optimizations:
- Modified calculateMetrics to calculate all file tokens when tokenCountTree is enabled
- Prevents double token calculation for better performance

Display:
- Changed emoji from 📊 to 🔢 for Token Count Tree
- Updated title from "Token Count Summary" to "Token Count Tree"

Tests:
- Renamed and updated test files to match new structure
- Updated tests to work with new printTokenCountTree function signature
- All tests pass with new implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 15:53:28 +09:00
Kazuki Yamada
e175291927 refactor(cli): extract spinner initialization and token count summary
- Move spinner initialization to runDefaultAction for shared usage across all operations
- Extract handleTokenCountSummary method from inline code for better modularity
- Remove unused cliOptions parameters from handleStdinProcessing and handleDirectoryProcessing
- Update test signatures to match new function parameters
- Enable spinner reuse in summarizeTokenCounts functionality

This refactoring improves code organization by centralizing spinner management
and separating token count summary logic into a dedicated method.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 14:41:59 +09:00
Gudbergur Erlendsson
602086e661 Add parameter --summarize-token-counts 2025-08-03 14:41:59 +09:00
Kazuki Yamada
0efe7ba3cd test: use createMockConfig helper for all test mock configurations
- Replace manual config objects with createMockConfig() in test files
- Ensures consistency and automatic handling of new config properties
- Fixes truncateBase64 property linter errors
- Improves maintainability for future config schema changes
2025-07-15 22:44:47 +09:00
Kazuki Yamada
ce5340288b refactor(stdin): Replace DI approach with direct predefinedFiles parameter
- Add optional predefinedFiles parameter to pack function for cleaner API
- Remove complex dependency injection override in defaultAction.ts
- Pass stdin file paths directly to pack function instead of using searchFiles override
- Update tests to match new function signatures and parameter expectations
- Simplify stdin processing workflow by eliminating intermediate filtering step

This approach is more explicit, maintainable, and easier to understand than
the previous dependency injection pattern for handling predefined file lists.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 23:41:58 +09:00
Kazuki Yamada
98ee0998ec refactor(stdin): Unify file filtering logic by extending searchFiles function
- Add predefinedFiles parameter to searchFiles function for stdin file processing
- Remove duplicate filterFileList function and consolidate logic
- Update defaultAction to use unified searchFiles instead of filterFileList
- Skip directory validation when using predefined files from stdin
- Update tests to reflect consolidated file filtering architecture
- Improve code maintainability by eliminating duplicate filtering logic

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 23:41:58 +09:00
Kazuki Yamada
e954df2c96 style: Fix linting issues
Apply automatic linting fixes for code style consistency.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 23:41:58 +09:00
Kazuki Yamada
64969234b2 fix(stdin): Add .gitignore/.repomixignore support and enable all tests
Address PR feedback by implementing complete filtering support:

- Add .gitignore and .repomixignore processing using globby
- Enable previously skipped test cases with proper mocks
- Add globby mocks to defaultAction tests
- Fix test expectations to match sorted output

This resolves the TODO in filterFileList and ensures stdin filtering
matches the behavior of normal file discovery.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 23:41:58 +09:00
Kazuki Yamada
70e6822795 fix(github): Address additional code review feedback on async handling
Additional review feedback addressed:
- Fix pump() function Promise handling with proper error propagation using Promise.all
- Refactor unzip callback to avoid async callback pattern by extracting processFiles function
- Fix TypeScript unused variable warnings by prefixing with underscore
- Remove debug return false statement that was causing unreachable code

These changes improve error handling robustness and eliminate async callback anti-patterns
that could lead to unhandled promise rejections.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 21:49:04 +09:00
Kazuki Yamada
0ca4f30bf2 feat(remote): Optimize git dependency check timing for archive downloads
User pointed out that git check was happening too early:
- Previously checked isGitInstalled() at start of runRemoteAction, making git mandatory even for GitHub archive downloads
- Now only check git when performGitClone() is actually called
- GitHub archive downloads can now work without git installed
- Added comprehensive test coverage for git-free archive download scenarios
- Added test for proper error handling when archive fails and git is not available

This allows more deployment environments (containers, CI/CD, etc.) to use GitHub archive downloads
without requiring git installation, improving accessibility and reducing dependencies.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 21:39:43 +09:00
Kazuki Yamada
8696b32db4 fix(github): Address PR review feedback for archive download feature
User requested fixes for GitHub archive download implementation based on PR review comments:
- Fix ref assignment to use nullish coalescing (??) instead of logical OR for proper empty string handling
- Add comprehensive test coverage for archive download path and git clone fallback scenarios
- Implement main/master branch fallback strategy to handle repositories with different default branches
- Enhance test assertions to verify fallback execution in remoteAction tests
- Add buildGitHubMasterArchiveUrl function with corresponding test coverage

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 21:28:35 +09:00
Kazuki Yamada
2914ce5e0e feat(remote): Implement GitHub archive download with git clone fallback
User requested performance optimization for remote repository processing:
- User asked: "archive zipをダウンロードしてくれば良い気もしています"
- User wanted: Archive download as primary method with git clone fallback
- User specified: Keep "cloning" display message for consistency

Implementation provides ~70% performance improvement for GitHub repositories
by downloading archive zip instead of full git clone when possible.

Key features:
- GitHub repository auto-detection from various URL formats
- Archive download priority with real-time progress tracking
- Seamless git clone fallback on archive download failure
- Comprehensive error handling with retry logic
- Support for branches, tags, and commit-specific downloads

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 20:13:23 +09:00
Kazuki Yamada
8262546134 fix(tests): Resolve remaining Windows path compatibility issues
Fixed additional Windows-specific path issues that were causing CI failures:

**fileStdin.test.ts fixes:**
- Updated `readFilePathsFromStdin` tests to use `path.resolve()` for absolute path generation
- Fixed mock generators to use resolved absolute paths instead of raw string paths like '/absolute/file3.txt'
- Updated expected results to use `path.resolve(cwd, 'dir', 'file2.txt')` for proper cross-platform path handling

**defaultAction.test.ts fixes:**
- Fixed `handleStdinProcessing` test to use `path.join('subdir', 'file2.txt')` for proper Windows path separators
- Ensures relative paths in test expectations use correct platform-specific separators (\ on Windows, / on Unix)

**Key improvements:**
- All path expectations now properly handle Windows backslash separators vs Unix forward slashes
- Absolute path generation is consistent across platforms using `path.resolve()`
- Mock data uses platform-appropriate paths to match actual function behavior
- Tests now pass on Windows, macOS, Linux, and other platforms

All 629 tests now pass on all operating systems, resolving Windows CI failures completely.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 17:40:27 +09:00
Kazuki Yamada
fc80ba12af fix(tests): Fix Windows path compatibility issues in stdin tests
Fixed hardcoded Unix-style paths that were causing test failures on Windows CI:

**fileStdin.test.ts changes:**
- Added `path` import for cross-platform path handling
- Updated `resolveAndDeduplicatePaths` tests to use `path.resolve()` instead of hardcoded `/test/cwd` paths
- Updated `readFilePathsFromStdin` tests to use platform-agnostic path expectations
- All test assertions now use `path.resolve()` for expected results

**defaultAction.test.ts changes:**
- Added `path` import for cross-platform path handling
- Updated `handleStdinProcessing` tests to use `path.resolve()` for `testCwd` and file paths
- Updated `handleDirectoryProcessing` tests to use `path.resolve()` for directory path expectations
- All hardcoded `/test/cwd` paths replaced with `path.resolve('/test/cwd')`

**Key improvements:**
- Tests now work correctly on both Unix and Windows systems
- Path comparisons are platform-agnostic using Node.js `path` module
- No functional changes to test logic, only path handling compatibility
- All 629 tests now pass on all platforms

Resolves Windows CI test failures while maintaining cross-platform compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 17:32:18 +09:00
Kazuki Yamada
d107817afe feat(test): Add comprehensive tests for new defaultAction handler functions
- Add complete test coverage for handleStdinProcessing:
  * Validates directory argument restrictions
  * Tests stdin file path processing workflow
  * Verifies pack integration with custom searchFiles
  * Tests error propagation from stdin reading and packing
  * Covers edge cases like empty directories array

- Add complete test coverage for handleDirectoryProcessing:
  * Tests directory path resolution (relative, absolute, single, multiple)
  * Verifies pack integration with resolved paths
  * Tests progress callback functionality
  * Tests error propagation from pack operation

- Export handler functions to enable direct testing
- Update test imports and mocks to support new functions
- Maintain compatibility with existing test suite (41 tests total)

All tests pass with proper type safety and comprehensive coverage
of the refactored defaultAction workflow handlers.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-15 16:42:03 +09:00
Kazuki Yamada
712b982e00 feat(mcp): Add processedFiles and safeFilePaths to PackResult and update related interfaces 2025-05-25 12:18:58 +09:00
Kazuki Yamada
8f9b307ffa refactor(core/git): Improve parseRemoteValue function formatting and add test for getRemoteRefs 2025-05-24 11:34:56 +09:00
Kazuki Yamada
9538395cdf refactor(core): Move Git-related modules to dedicated core/git directory 2025-05-19 14:53:28 +00:00
Devin AI
48ec00c63a - Replace hardcoded config objects with createMockConfig utility
- Add proper typing to mock objects and functions
- Remove unnecessary type casting
- Add GitDiffResult type to git diff objects

Co-Authored-By: Kazuki Yamada <koukun0120@gmail.com>
2025-05-13 22:55:50 +09:00
Kazuki Yamada
95f7092b94 feat(cli): add --stdout option for output to stdout instead of file, enhancing CLI flexibility
- Introduced `--stdout` flag to allow output to standard output, which cannot be used with the `--output` option.
- Updated CLI configuration to handle `stdout` mode.
- Enhanced documentation with examples for using `--stdout`.
- Added tests to ensure correct behavior when using `--stdout` in various scenarios.
2025-05-10 16:33:09 +09:00
Kazuki Yamada
265845a9c0 fix(gitDiff): Fix syntax and tests 2025-05-10 11:26:05 +09:00