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

Function createSession

packages/server/test/snapshot.e2e.test.ts:97–108  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

95}
96
97async function createSession(r: RunningServer): Promise<string> {
98 const res = await appOf(r).inject({
99 method: 'POST',
100 url: '/api/v1/sessions',
101 payload: { metadata: { cwd: join(tmpDir, 'workspace') } },
102 });
103 const env = envelopeOf<{ id: string }>(res.json());
104 if (env.code !== 0 || env.data === null) {
105 throw new Error(`failed to create session: ${JSON.stringify(env)}`);
106 }
107 return env.data.id;
108}
109
110async function getSnapshot(
111 r: RunningServer,

Callers 1

Calls 4

injectMethod · 0.80
jsonMethod · 0.80
appOfFunction · 0.70
envelopeOfFunction · 0.70

Tested by

no test coverage detected