MCPcopy
hub / github.com/Waishnav/devspace / start

Method start

src/process-sessions.ts:219–237  ·  view source on GitHub ↗
(input: StartCommandInput)

Source from the content-addressed store, hash-verified

217 }
218
219 async start(input: StartCommandInput): Promise<ProcessSnapshot> {
220 const session = this.createSession(input);
221 this.sessions.set(session.id, session);
222
223 try {
224 if (input.tty && process.platform !== "win32") await this.startPty(session, input);
225 else this.startPipe(session, input);
226 } catch (error) {
227 this.sessions.delete(session.id);
228 throw error;
229 }
230
231 const yieldTimeMs = boundedInteger(input.yieldTimeMs, DEFAULT_EXEC_YIELD_MS, MAX_COMMAND_YIELD_MS);
232 await this.waitForExit(session, yieldTimeMs);
233
234 const snapshot = this.consume(session, input.maxOutputTokens);
235 if (!session.running) this.removeSession(session.id);
236 return snapshot;
237 }
238
239 async write(input: WriteStdinInput): Promise<ProcessSnapshot> {
240 const session = this.getOwnedSession(input.workspaceId, input.sessionId);

Callers 2

Calls 7

createSessionMethod · 0.95
startPtyMethod · 0.95
startPipeMethod · 0.95
waitForExitMethod · 0.95
consumeMethod · 0.95
removeSessionMethod · 0.95
boundedIntegerFunction · 0.85

Tested by

no test coverage detected