MCPcopy Index your code
hub / github.com/Waishnav/devspace / consume

Method consume

src/process-sessions.ts:392–406  ·  view source on GitHub ↗
(session: ProcessSession, maxOutputTokens?: number)

Source from the content-addressed store, hash-verified

390 }
391
392 private consume(session: ProcessSession, maxOutputTokens?: number): ProcessSnapshot {
393 const limit = boundedInteger(maxOutputTokens, DEFAULT_MAX_OUTPUT_TOKENS, 100_000);
394 const maxCharacters = Math.max(256, limit * 4);
395 const buffered = session.buffer.drain(maxCharacters);
396
397 return {
398 sessionId: session.running ? session.id : undefined,
399 output: buffered.output,
400 outputTruncated: buffered.truncated,
401 running: session.running,
402 exitCode: session.exitCode,
403 signal: session.signal,
404 wallTimeMs: Date.now() - session.startedAt,
405 };
406 }
407
408 private getOwnedSession(workspaceId: string, sessionId: number): ProcessSession {
409 const session = this.sessions.get(sessionId);

Callers 2

startMethod · 0.95
writeMethod · 0.95

Calls 2

boundedIntegerFunction · 0.85
drainMethod · 0.80

Tested by

no test coverage detected