User identified percentage calculation issue:
- User noticed percentage was calculated against partial token sum (only top candidates)
- User requested using actual total tokens from entire output instead
- Assistant updated printTopFiles to accept totalTokens parameter
- Now uses packResult.totalTokens for accurate percentage calculation
- Fixed all function calls and tests to include the new parameter
- Percentages now reflect actual proportion of each file to total output
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add character-based pre-filtering to reduce token calculation overhead
- Implement calculateSelectiveFileMetrics for targeted token counting
- Only calculate tokens for top candidates (5x display count) instead of all files
- Maintain accurate token-based ranking while improving performance for large codebases
- Update tests to cover new selective calculation functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Preserve original error stack traces when rethrowing errors
- Add specific error messages for unknown error codes
- Remove redundant mock configurations in tests that duplicate beforeEach setup
- Keep only necessary mocks that differ from default behavior
- Improve code maintainability and test clarity
- Add fs.stat check to validate path exists and is a directory before permission check
- Throw clear error message when file path is provided instead of directory path
- Prevents ENOTDIR errors when fs.readdir is called on file paths
- Add comprehensive test cases for path validation scenarios
- Fixes issues where shell glob expansion passes file paths to directory processing
- Add support for .jsonc config files alongside existing .json5 and .json
- Implement priority order: repomix.config.json5 → repomix.config.jsonc → repomix.config.json
- Update config file discovery for both local and global configurations
- Add comprehensive tests for JSONC support and priority ordering
- JSON5 parser already supports JSONC format (JSON with comments)
Fixes#618
Co-authored-by: yamadashy <yamadashy@users.noreply.github.com>
- Add line number specification (startLine, endLine) to read_repomix_output
- Add new grep_repomix_output tool for searching output content
- Include total line count in pack_codebase and pack_remote_repository results
- Add comprehensive tests for new functionality
Co-Authored-By: Kazuki Yamada <koukun0120@gmail.com>
- 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.
- Updated CLI options to use `--include-diffs` instead of `--diffs`.
- Refactored `printSummary` to accept a `PackResult` object for better data handling.
- Introduced `getStagedDiff` function to retrieve staged changes from git.
- Created `getGitDiffs` function to encapsulate logic for fetching both worktree and staged diffs.
- Modified output generation functions to include git diffs in various formats (markdown, XML, plain text).
- Updated tests to reflect changes in CLI options and output generation logic, ensuring proper handling of git diffs.
- Removed deprecated `diffContent` from config schema and adjusted related logic.