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

Function createSession

packages/server/test/prompt.e2e.test.ts:191–202  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

189const TINY_MP4 = Buffer.from('fake mp4 video data');
190
191async function createSession(r: RunningServer): Promise<string> {
192 const res = await appOf(r).inject({
193 method: 'POST',
194 url: '/api/v1/sessions',
195 payload: { metadata: { cwd: join(tmpDir, 'workspace') } },
196 });
197 const env = envelopeOf<{ id: string }>(res.json());
198 if (env.code !== 0 || env.data === null) {
199 throw new Error(`create session failed: ${JSON.stringify(env)}`);
200 }
201 return env.data.id;
202}
203
204/**
205 * Open a WS subscriber and wait for server_hello + client_hello ack.

Callers 1

prompt.e2e.test.tsFile · 0.70

Calls 4

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

Tested by

no test coverage detected