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

Function getEnvelope

packages/server-e2e/test/refresh-replay.test.ts:59–76  ·  view source on GitHub ↗
(
  path: string,
  log?: (label: string, value?: unknown) => void,
)

Source from the content-addressed store, hash-verified

57}
58
59async function getEnvelope<T>(
60 path: string,
61 log?: (label: string, value?: unknown) => void,
62): Promise<T> {
63 const res = await fetchWithReport(`${BASE_URL}${API_PREFIX}${path}`, {
64 headers: { accept: 'application/json' },
65 });
66 const body = (await res.json()) as Envelope<T>;
67 log?.('http envelope', {
68 method: 'GET',
69 path: `${API_PREFIX}${path}`,
70 status: res.status,
71 body,
72 });
73 expect(typeof body.code, `${path} missing envelope.code`).toBe('number');
74 expect(body.code, `${path} returned code=${body.code} msg=${body.msg ?? ''}`).toBe(0);
75 return body.data;
76}
77
78interface HelloResult {
79 ws: WsClient;

Callers

nothing calls this directly

Calls 3

fetchWithReportFunction · 0.85
jsonMethod · 0.80
logFunction · 0.50

Tested by

no test coverage detected