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

Function buildValidationEnvelope

packages/server/src/routes/fs.ts:625–652  ·  view source on GitHub ↗
(
  issues: readonly { path: readonly PropertyKey[]; message: string }[],
  requestId: string,
)

Source from the content-addressed store, hash-verified

623}
624
625function buildValidationEnvelope(
626 issues: readonly { path: readonly PropertyKey[]; message: string }[],
627 requestId: string,
628): {
629 code: number;
630 msg: string;
631 data: null;
632 request_id: string;
633 details: { path: string; message: string }[];
634} {
635 const details = issues.map((i) => ({
636 path: i.path.map((p) => String(p)).join('.'),
637 message: i.message,
638 }));
639 const first = details[0];
640 const msg = first === undefined
641 ? 'validation failed'
642 : first.path === ''
643 ? first.message
644 : `${first.path}: ${first.message}`;
645 return {
646 code: ErrorCode.VALIDATION_FAILED,
647 msg,
648 data: null,
649 request_id: requestId,
650 details,
651 };
652}
653
654function pickHeader(
655 headers: Record<string, string | string[] | undefined>,

Callers 13

handleListFunction · 0.70
handleReadFunction · 0.70
handleListManyFunction · 0.70
handleStatFunction · 0.70
handleStatManyFunction · 0.70
handleMkdirFunction · 0.70
handleSearchFunction · 0.70
handleGrepFunction · 0.70
handleGitStatusFunction · 0.70
handleDiffFunction · 0.70
handleOpenFunction · 0.70
handleRevealFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected