@@ -34,13 +34,7 @@ export function registerGitInventoryTool(server: FastMCP): void {
3434 . describe ( "Merge with preset instead of replacing." ) ,
3535 remote : z . string ( ) . optional ( ) . describe ( "Pair with `branch`." ) ,
3636 branch : z . string ( ) . optional ( ) . describe ( "Pair with `remote`." ) ,
37- maxRoots : z
38- . number ( )
39- . int ( )
40- . min ( 1 )
41- . max ( 256 )
42- . optional ( )
43- . default ( MAX_INVENTORY_ROOTS_DEFAULT ) ,
37+ maxRoots : z . number ( ) . int ( ) . min ( 1 ) . max ( 256 ) . optional ( ) . default ( MAX_INVENTORY_ROOTS_DEFAULT ) ,
4438 } ) ,
4539 execute : async ( args ) => {
4640 const pre = requireGitAndRoots ( server , args , args . preset ) ;
@@ -57,7 +51,10 @@ export function registerGitInventoryTool(server: FastMCP): void {
5751 }
5852 const useFixed = hasRemote && hasBranch ;
5953 if ( useFixed ) {
60- if ( ! isSafeGitUpstreamToken ( fixedRemote ! . trim ( ) ) || ! isSafeGitUpstreamToken ( fixedBranch ! . trim ( ) ) ) {
54+ if (
55+ ! isSafeGitUpstreamToken ( fixedRemote ! . trim ( ) ) ||
56+ ! isSafeGitUpstreamToken ( fixedBranch ! . trim ( ) )
57+ ) {
6158 return jsonRespond ( { error : "invalid_remote_or_branch" } ) ;
6259 }
6360 }
@@ -80,9 +77,17 @@ export function registerGitInventoryTool(server: FastMCP): void {
8077 allJson . push ( {
8178 workspace_root : workspaceRoot ,
8279 ...( useFixed
83- ? { upstream : { mode : "fixed" as const , remote : fixedRemote ! , branch : fixedBranch ! } }
80+ ? {
81+ upstream : {
82+ mode : "fixed" as const ,
83+ remote : fixedRemote ! ,
84+ branch : fixedBranch ! ,
85+ } ,
86+ }
8487 : { } ) ,
85- entries : [ makeSkipEntry ( workspaceRoot , workspaceRoot , upstreamMode , JSON . stringify ( err ) ) ] ,
88+ entries : [
89+ makeSkipEntry ( workspaceRoot , workspaceRoot , upstreamMode , JSON . stringify ( err ) ) ,
90+ ] ,
8691 } ) ;
8792 } else {
8893 mdChunks . push ( `### ${ workspaceRoot } \n${ jsonRespond ( err ) } ` ) ;
@@ -123,24 +128,12 @@ export function registerGitInventoryTool(server: FastMCP): void {
123128 const { abs, underTop } = validateRepoPath ( rel , top ) ;
124129 if ( ! underTop ) {
125130 entries . push (
126- makeSkipEntry (
127- rel ,
128- abs ,
129- upstreamMode ,
130- "(path escapes git toplevel — rejected)" ,
131- ) ,
131+ makeSkipEntry ( rel , abs , upstreamMode , "(path escapes git toplevel — rejected)" ) ,
132132 ) ;
133133 continue ;
134134 }
135135 if ( ! gitRevParseGitDir ( abs ) ) {
136- entries . push (
137- makeSkipEntry (
138- rel ,
139- abs ,
140- upstreamMode ,
141- "(not a git work tree — skip)" ,
142- ) ,
143- ) ;
136+ entries . push ( makeSkipEntry ( rel , abs , upstreamMode , "(not a git work tree — skip)" ) ) ;
144137 continue ;
145138 }
146139 jobs . push ( { label : rel , abs } ) ;
@@ -155,14 +148,7 @@ export function registerGitInventoryTool(server: FastMCP): void {
155148 ) ;
156149 entries . push ( ...computed ) ;
157150 } else if ( ! gitRevParseGitDir ( top ) ) {
158- entries . push (
159- makeSkipEntry (
160- "." ,
161- top ,
162- upstreamMode ,
163- "(not a git work tree — unexpected)" ,
164- ) ,
165- ) ;
151+ entries . push ( makeSkipEntry ( "." , top , upstreamMode , "(not a git work tree — unexpected)" ) ) ;
166152 } else {
167153 const one = await collectInventoryEntry (
168154 "." ,
0 commit comments