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

Function createTerminal

packages/server/test/ws-terminal.e2e.test.ts:109–121  ·  view source on GitHub ↗
(r: RunningServer, sid: string)

Source from the content-addressed store, hash-verified

107}
108
109async function createTerminal(r: RunningServer, sid: string): Promise<Terminal> {
110 const env = envelopeOf<Terminal>(
111 (await appOf(r).inject({
112 method: 'POST',
113 url: `/api/v1/sessions/${sid}/terminals`,
114 payload: {},
115 })).json(),
116 );
117 if (env.code !== 0 || env.data === null) {
118 throw new Error(`create terminal failed: ${JSON.stringify(env)}`);
119 }
120 return env.data;
121}
122
123async function openSocket(r: RunningServer): Promise<{
124 ws: WebSocket;

Callers 1

Calls 4

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

Tested by

no test coverage detected