@@ -21,15 +21,17 @@ export const symbolSchema = z.object({
2121 kind : z . string ( ) ,
2222} ) ;
2323
24+ export const searchOptionsSchema = z . object ( {
25+ matches : z . number ( ) , // The number of matches to return.
26+ contextLines : z . number ( ) . optional ( ) , // The number of context lines to return.
27+ whole : z . boolean ( ) . optional ( ) , // Whether to return the whole file as part of the response.
28+ isRegexEnabled : z . boolean ( ) . optional ( ) , // Whether to enable regular expression search.
29+ isCaseSensitivityEnabled : z . boolean ( ) . optional ( ) , // Whether to enable case sensitivity.
30+ } ) ;
31+
2432export const searchRequestSchema = z . object ( {
25- // The zoekt query to execute.
26- query : z . string ( ) ,
27- // The number of matches to return.
28- matches : z . number ( ) ,
29- // The number of context lines to return.
30- contextLines : z . number ( ) . optional ( ) ,
31- // Whether to return the whole file as part of the response.
32- whole : z . boolean ( ) . optional ( ) ,
33+ query : z . string ( ) , // The zoekt query to execute.
34+ ...searchOptionsSchema . shape ,
3335} ) ;
3436
3537export const repositoryInfoSchema = z . object ( {
@@ -109,7 +111,7 @@ export const searchStatsSchema = z.object({
109111 regexpsConsidered : z . number ( ) ,
110112
111113 // FlushReason explains why results were flushed.
112- flushReason : z . number ( ) ,
114+ flushReason : z . string ( ) ,
113115} ) ;
114116
115117export const searchResponseSchema = z . object ( {
@@ -139,7 +141,6 @@ export const searchResponseSchema = z.object({
139141 content : z . string ( ) . optional ( ) ,
140142 } ) ) ,
141143 repositoryInfo : z . array ( repositoryInfoSchema ) ,
142- isBranchFilteringEnabled : z . boolean ( ) ,
143144 isSearchExhaustive : z . boolean ( ) ,
144145} ) ;
145146
0 commit comments