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

Function postSession

packages/server/test/snapshot.smoke.test.ts:59–71  ·  view source on GitHub ↗
(baseUrl: string)

Source from the content-addressed store, hash-verified

57}
58
59async function postSession(baseUrl: string): Promise<string> {
60 const res = await fetch(
61 `${baseUrl}/api/v1/sessions`,
62 withAuth({
63 method: 'POST',
64 headers: { 'content-type': 'application/json' },
65 body: JSON.stringify({ metadata: { cwd: join(tmpDir, 'workspace') } }),
66 }),
67 );
68 const env = (await res.json()) as { code: number; data: { id: string } | null };
69 if (env.code !== 0 || env.data === null) throw new Error(`createSession failed: ${JSON.stringify(env)}`);
70 return env.data.id;
71}
72
73async function fetchSnapshot(baseUrl: string, sid: string): Promise<{
74 status: number;

Callers 1

Calls 2

withAuthFunction · 0.90
jsonMethod · 0.80

Tested by

no test coverage detected