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

Function handleOpen

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

502}
503
504async function handleOpen(
505 ix: IInstantiationService,
506 sessionId: string,
507 req: { id: string; body: unknown },
508 reply: { send(payload: unknown): unknown },
509): Promise<void> {
510 const parsed = fsOpenRequestSchema.safeParse(req.body ?? {});
511 if (!parsed.success) {
512 reply.send(buildValidationEnvelope(parsed.error.issues, req.id));
513 return;
514 }
515 const body: FsOpenRequest = parsed.data;
516 const resolved = await ix.invokeFunction((a) =>
517 a.get(IFsService).resolvePath(sessionId, body.path),
518 );
519 await launchDetached(openFileCommandFor(resolved.absolute, body.line));
520 reply.send(okEnvelope({ opened: true as const }, req.id));
521}
522
523async function handleReveal(
524 ix: IInstantiationService,

Callers 1

registerFsRoutesFunction · 0.85

Calls 8

launchDetachedFunction · 0.90
openFileCommandForFunction · 0.90
okEnvelopeFunction · 0.90
buildValidationEnvelopeFunction · 0.70
sendMethod · 0.65
invokeFunctionMethod · 0.65
resolvePathMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected