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

Function createSession

packages/server/test/fs-watch.e2e.test.ts:118–129  ·  view source on GitHub ↗
(r: RunningServer)

Source from the content-addressed store, hash-verified

116}
117
118async function createSession(r: RunningServer): Promise<string> {
119 const res = await appOf(r).inject({
120 method: 'POST',
121 url: '/api/v1/sessions',
122 payload: { metadata: { cwd: workspace } },
123 });
124 const env = res.json() as { code: number; data: { id: string } | null };
125 if (env.code !== 0 || env.data === null) {
126 throw new Error(`create session failed: ${JSON.stringify(env)}`);
127 }
128 return env.data.id;
129}
130
131function wsUrl(http: string): string {
132 return http.replace(/^http:\/\//, 'ws://') + '/api/v1/ws';

Callers 1

Calls 3

injectMethod · 0.80
jsonMethod · 0.80
appOfFunction · 0.70

Tested by

no test coverage detected