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

Function envelopeSchema

packages/protocol/src/envelope.ts:3–10  ·  view source on GitHub ↗
(data: T)

Source from the content-addressed store, hash-verified

1import { z } from 'zod';
2
3export const envelopeSchema = <T extends z.ZodTypeAny>(data: T) =>
4 z.object({
5 code: z.number().int(),
6 msg: z.string(),
7 data: data.nullable(),
8 request_id: z.string(),
9 details: z.unknown().optional(),
10 });
11
12export interface Envelope<T> {
13 code: number;

Callers 3

envelope.test.tsFile · 0.90
envelopeJsonSchemaFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected