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

Function createSession

packages/server/test/terminals.e2e.test.ts:92–104  ·  view source on GitHub ↗
(r: RunningServer, cwd: string)

Source from the content-addressed store, hash-verified

90}
91
92async function createSession(r: RunningServer, cwd: string): Promise<string> {
93 mkdirSync(cwd, { recursive: true });
94 const res = await appOf(r).inject({
95 method: 'POST',
96 url: '/api/v1/sessions',
97 payload: { metadata: { cwd } },
98 });
99 const env = envelopeOf<{ id: string }>(res.json());
100 if (env.code !== 0 || env.data === null) {
101 throw new Error(`create session failed: ${JSON.stringify(env)}`);
102 }
103 return env.data.id;
104}
105
106describe('terminal REST routes', () => {
107 it('creates terminals for multiple sessions using each session workspace cwd', async () => {

Callers 1

Calls 4

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

Tested by

no test coverage detected