File tree Expand file tree Collapse file tree
web/src/app/api/(server)/repos Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,28 +106,4 @@ export const listCommits = async (queryParams: ListCommitsQueryParamsSchema) =>
106106 const commits = await parseResponse ( response , listCommitsResponseSchema ) ;
107107 const totalCount = parseInt ( response . headers . get ( 'X-Total-Count' ) ?? '0' , 10 ) ;
108108 return { commits, totalCount } ;
109- }
110- << < < < << Updated upstream
111- === === =
112-
113- /**
114- * Asks a natural language question about the codebase using the Sourcebot AI agent.
115- * This is a blocking call that runs the full agent loop and returns when complete.
116- *
117- * @param request - The question and optional repo filters
118- * @returns The agent's answer, chat URL, sources, and metadata
119- */
120- export const askCodebase = async ( request : AskCodebaseRequest ) : Promise < AskCodebaseResponse > => {
121- const response = await fetch ( `${ env . SOURCEBOT_HOST } /api/chat/blocking` , {
122- method : 'POST' ,
123- headers : {
124- 'Content-Type' : 'application/json' ,
125- 'X-Sourcebot-Client-Source' : 'mcp' ,
126- ...( env . SOURCEBOT_API_KEY ? { 'X-Sourcebot-Api-Key' : env . SOURCEBOT_API_KEY } : { } )
127- } ,
128- body : JSON . stringify ( request ) ,
129- } ) ;
130-
131- return parseResponse ( response , askCodebaseResponseSchema ) ;
132- }
133- > > >>> >> Stashed changes
109+ }
Original file line number Diff line number Diff line change 1- < < < << << Updated upstream
2- import { NextRequest } from "next / server ";
31import { sew } from "@/actions" ;
4- import { withOptionalAuthV2 } from "@/ withAuthV2 ";
5- === === =
2+ import { getBrowsePath } from "@/app/[domain]/browse/hooks/utils" ;
63import { apiHandler } from "@/lib/apiHandler" ;
74import { buildLinkHeader } from "@/lib/pagination" ;
8- import { listReposQueryParamsSchema } from "@/lib/schemas" ;
9- >>> >>> > Stashed changes
5+ import { listReposQueryParamsSchema , repositoryQuerySchema } from "@/lib/schemas" ;
106import { queryParamsSchemaValidationError , serviceErrorResponse } from "@/lib/serviceError" ;
117import { isServiceError } from "@/lib/utils" ;
12- import { listReposQueryParamsSchema , repositoryQuerySchema } from "@/lib/schemas" ;
13- import { buildLinkHeader } from "@/lib/pagination" ;
14- import { getBrowsePath } from "@/app/[domain]/browse/hooks/utils" ;
8+ import { withOptionalAuthV2 } from "@/withAuthV2" ;
9+ import { NextRequest } from "next/server" ;
1510
1611export const GET = apiHandler ( async ( request : NextRequest ) => {
1712 const rawParams = Object . fromEntries (
You can’t perform that action at this time.
0 commit comments