Skip to content

Moar improvements - #1

Merged
devfire merged 5 commits into
mainfrom
moar-improvements
Jun 15, 2026
Merged

Moar improvements#1
devfire merged 5 commits into
mainfrom
moar-improvements

Conversation

@devfire

@devfire devfire commented Jun 15, 2026

Copy link
Copy Markdown
Owner

with cargo-dist this time

devfire added 5 commits June 15, 2026 10:17
- Add join_error() helper in error.rs to replace the identical 5-line
  .map_err(|e| rmcp::ErrorData::internal_error(...)) closure repeated
  in all four tool handlers.
- Add ToolResult<T> type alias for Result<T, rmcp::ErrorData>.
- Update all tool methods in server.rs to use join_error and ToolResult.
- Mark improvement plan item #4 as completed.
…vement #15)

- Add OutputMode enum (FilesWithMatches, Content, Count) to tools.rs
  with from_str_lossy() that rejects unknown values as invalid_params.
- Add output_mode field to GrepArgs (default: files_with_matches) and
  GrepOptions.
- Implement grep_files(): emits file path on first match, aborts per-file
  early (faster than reading the whole file). max_results caps files.
- Implement grep_count(): per-file match tallies as 'path: N' lines,
  sorted by path.
- grep_content(): unchanged original behaviour.
- Extract build_parallel_walker(), extension_matches(), error_metadata()
  helpers to reduce duplication across the three modes.
- Add FileMatchSink and CountSink types for the new modes.
- Update server instructions and tool description to document modes.
- Add 4 new tests; update existing tests to set output_mode explicitly.
- Mark improvement plan item #15 as completed.
@devfire devfire self-assigned this Jun 15, 2026
@devfire
devfire merged commit d85ea04 into main Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant