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

Function handleGrep

packages/server/src/routes/fs.ts:450–466  ·  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

448}
449
450async function handleGrep(
451 ix: IInstantiationService,
452 sessionId: string,
453 req: { id: string; body: unknown },
454 reply: { send(payload: unknown): unknown },
455): Promise<void> {
456 const parsed = fsGrepRequestSchema.safeParse(req.body ?? {});
457 if (!parsed.success) {
458 reply.send(buildValidationEnvelope(parsed.error.issues, req.id));
459 return;
460 }
461 const body: FsGrepRequest = parsed.data;
462 const data = await ix.invokeFunction((a) =>
463 a.get(IFsSearchService).grep(sessionId, body),
464 );
465 reply.send(okEnvelope(data, req.id));
466}
467
468async function handleGitStatus(
469 ix: IInstantiationService,

Callers 1

registerFsRoutesFunction · 0.85

Calls 6

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

Tested by

no test coverage detected