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

Function createSession

packages/server/test/ws-terminal.e2e.test.ts:94–107  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 4

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

Tested by

no test coverage detected