File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ const Tools = Toolkit.make(
3737 glob : Schema . optionalKey ( Schema . String ) . annotate ( {
3838 description :
3939 "An optional glob pattern to filter which files to search (e.g. '**/*.ts')"
40+ } ) ,
41+ maxResults : Schema . Finite . annotate ( {
42+ description : "The maximum number of matches to return"
4043 } )
4144 } ) ,
4245 failure : EffectRepoError ,
@@ -62,8 +65,11 @@ const ToolsLayer = Tools.toLayer(Effect.gen(function*() {
6265 const content = yield * repo . readFileRange ( { path, startLine, endLine } )
6366 return content
6467 } ) ,
65- ripgrep : Effect . fn ( function * ( { glob, pattern } ) {
66- const matches = yield * Stream . runCollect ( repo . search ( { pattern, glob } ) )
68+ ripgrep : Effect . fn ( function * ( { glob, maxResults, pattern } ) {
69+ const matches = yield * repo . search ( { pattern, glob } ) . pipe (
70+ Stream . take ( maxResults ) ,
71+ Stream . runCollect
72+ )
6773 return matches
6874 } ) ,
6975 glob : Effect . fn ( function * ( { pattern } ) {
You can’t perform that action at this time.
0 commit comments