Commit Graph

23 Commits

Author SHA1 Message Date
Daniel Riccio
54fb38f76c fix: correct the type of arguments for the getToolDescription 2025-01-18 17:10:26 -05:00
Daniel
cea4d163b2 Merge branch 'main' into improve_diff_prompt 2025-01-18 17:01:21 -05:00
Daniel Riccio
5f348d531e refactor: improve the apply_diff tool to be concise and include step by step guide on how to generate a good diff 2025-01-18 16:56:20 -05:00
Matt Rubens
60a0a824b9 Prettier backfill 2025-01-17 14:11:28 -05:00
Matt Rubens
72fe12d096 Refactor modes 2025-01-17 10:03:23 -05:00
Daniel Riccio
fa49bd804b refactor: standardize code formatting 2025-01-17 01:39:31 -05:00
Daniel Riccio
9857e31e9c fix: use actual confidence threshold 2025-01-17 00:57:56 -05:00
Daniel Riccio
ab1a7a511f fix: remove unnecessary console log in new unified diff strategy 2025-01-16 17:15:44 -05:00
Daniel Riccio
04f6e4f03f feat: implement hunk splitting strategy in diff application to better handle large diffs that might fail if the search fails 2025-01-16 12:49:02 -05:00
Daniel Riccio
36b7da07d2 fix: enhance error messaging in diff strategy to address potential issues with context lines and version targeting 2025-01-15 12:55:44 -05:00
Daniel Riccio
6c8d7f4951 fix: update tests to handle new experimental diff option and increase the default confidence to 1 2025-01-15 12:23:51 -05:00
Daniel Riccio
f696f8e0f1 refactor: remove debug functionality 2025-01-14 18:03:03 -05:00
Daniel Riccio
e6d3db6075 refactor: use confidenceThreshold from the settings in new diff strategy 2025-01-14 17:59:46 -05:00
Daniel Riccio
a211927097 refactor: enhance error handling and debugging in NewUnifiedDiffStrategy
- Improved error messages for cases where no hunks are found in the diff, providing clearer guidance on format requirements.
- Added detailed debug information for search and edit failures, including context line ratios and potential issues to assist users in troubleshooting.
- Streamlined the logic for determining the cause of edit failures, distinguishing between search and content mismatch errors.
- Enhanced overall readability and maintainability of the code with consistent formatting and structured comments.
2025-01-14 17:09:20 -05:00
Daniel Riccio
5c420bb7e1 refactor: cleanup 2025-01-14 17:02:39 -05:00
Daniel Riccio
534888af97 refactor: improve NewUnifiedDiffStrategy with enhanced formatting and error handling
- Cleaned up formatting in the parseUnifiedDiff method to ensure consistent indentation and spacing.
- Updated documentation to clarify format requirements for generating unified diffs.
- Added error handling for cases where no hunks are found in the provided diff, improving robustness.
- Enhanced overall readability of the code by standardizing comments and structure.
2025-01-14 12:20:52 -05:00
Daniel Riccio
d25f370013 refactor: enhance NewUnifiedDiffStrategy for improved diff parsing and context handling
- Refactored the parseUnifiedDiff method to streamline the processing of diff lines and improve context line management.
- Added handling for empty context lines to ensure accurate representation in hunks.
- Updated the tool description to clarify requirements for generating unified diffs, emphasizing the importance of preserving indentation and grouping related changes.
- Improved overall readability and consistency of the code by standardizing formatting and indentation practices.
2025-01-14 12:01:09 -05:00
Daniel Riccio
0d004b5c77 refactor: increase context lines in NewUnifiedDiffStrategy
- Updated the maximum context lines from 3 to 6 in the parseUnifiedDiff method to provide more context around changes.
2025-01-10 17:35:22 -05:00
Daniel Riccio
5351b3d981 refactor: improve the prompt to prevent absurd amounts of context being generated 2025-01-09 12:05:36 -05:00
Daniel Riccio
44dc489e49 revert: lower the confidence levels 2025-01-08 17:18:09 -05:00
Daniel Riccio
9591ae062a Refactor edit strategies and confidence validation in unified diff processing
- Enhanced the applyContextMatching and applyDMP functions to improve handling of context and edit changes.
- Updated confidence validation logic to ensure stricter checks, now requiring a minimum confidence of 1 for successful edits.
- Refined the way changes are processed, including better tracking of removal and addition changes.
- Improved the validation of edit results by incorporating strategy-specific checks and logging for better debugging.
- Adjusted the applyEdit function to ensure strategies are applied in a more robust manner, with clearer handling of debug mode.
2025-01-08 17:13:46 -05:00
Daniel Riccio
995692c48e Improve strategies and confidence system 2025-01-08 12:28:31 -05:00
Daniel Riccio
594481643b Add New Unified Diff Strategy Implementation
- Introduced a new unified diff strategy with support for context matching, DMP, and Git-based edits.
- Implemented helper functions for parsing unified diffs and evaluating similarity.
- Added types for changes, hunks, and diffs to enhance type safety.
- Created a main edit function that applies strategies sequentially based on confidence levels.
- Included detailed descriptions and usage examples for the new strategy.
2025-01-07 19:01:12 -05:00