MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / handleSearch

Function handleSearch

packages/server/src/routes/fs.ts:432–448  ·  view source on GitHub ↗
(
  ix: IInstantiationService,
  sessionId: string,
  req: { id: string; body: unknown },
  reply: { send(payload: unknown): unknown },
)

Source from the content-addressed store, hash-verified

430}
431
432async function handleSearch(
433 ix: IInstantiationService,
434 sessionId: string,
435 req: { id: string; body: unknown },
436 reply: { send(payload: unknown): unknown },
437): Promise<void> {
438 const parsed = fsSearchRequestSchema.safeParse(req.body ?? {});
439 if (!parsed.success) {
440 reply.send(buildValidationEnvelope(parsed.error.issues, req.id));
441 return;
442 }
443 const body: FsSearchRequest = parsed.data;
444 const data = await ix.invokeFunction((a) =>
445 a.get(IFsSearchService).search(sessionId, body),
446 );
447 reply.send(okEnvelope(data, req.id));
448}
449
450async function handleGrep(
451 ix: IInstantiationService,

Callers 1

registerFsRoutesFunction · 0.85

Calls 6

okEnvelopeFunction · 0.90
buildValidationEnvelopeFunction · 0.70
sendMethod · 0.65
invokeFunctionMethod · 0.65
searchMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected