Commit 8c82979
committed
feat: add temporal query parameters to MCP tools
Add comprehensive temporal filtering capabilities with new search_commits
tool, enhanced list_repos activity filtering, and improved search_code
temporal support.
**New Features:**
- Add search_commits tool for Git commit history search with time range,
author, and query filtering
- Add dateUtils.ts with comprehensive date parsing supporting ISO 8601
and relative formats ("30 days ago", "last week", "yesterday")
- Add date range validation to prevent invalid ranges (since > until)
- Add activeAfter/activeBefore parameters to list_repos for commit
activity filtering
- Add gitRevision, since/until, and includeDeletedFiles parameters to
search_code
- Add 30-second timeout for git operations to handle large repositories
- Add detailed error messages for common git failures
- Move cache directory constants to @sourcebot/shared package
**Fixes:**
- Fix getRepos() pagination bug where take limit was applied before
activity filtering, returning fewer results than requested
**Testing & Documentation:**
- Add comprehensive test coverage: 106 tests (59 dateUtils, 24 gitApi,
23 searchApi)
- Clarify temporal filtering semantics: search_code filters by INDEX
time (when Sourcebot indexed), while list_repos and search_commits
filter by COMMIT time
- Clarify that repositories are cloned on Sourcebot server disk, not
user's local disk, and cloning process may not be finished when
search_commits is called
- Update MCP tool descriptions with temporal parameter examples and
date format documentation
- Add "Date Format Examples" section to README
- Update CHANGELOG with all improvements
All changes are backward compatible with optional parameters.
Resolves #511
Signed-off-by: Wayne Sun <gsun@redhat.com>1 parent 09507d3 commit 8c82979
File tree
18 files changed
+1932
-44
lines changed- packages
- backend/src
- mcp
- src
- web/src
- app/api/(server)
- commits
- repos
- features/search
18 files changed
+1932
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
10 | 31 | | |
11 | 32 | | |
12 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
| |||
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| 193 | + | |
| 194 | + | |
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
| |||
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
211 | 254 | | |
212 | 255 | | |
213 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| |||
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
0 commit comments