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

Function processToolResponse

src/server.ts:481–510  ·  view source on GitHub ↗
(
  tool: "exec_command" | "write_stdin",
  workspaceId: string,
  snapshot: ProcessSnapshot,
  summary: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

479}
480
481function processToolResponse(
482 tool: "exec_command" | "write_stdin",
483 workspaceId: string,
484 snapshot: ProcessSnapshot,
485 summary: Record<string, unknown>,
486) {
487 const result = processResult(snapshot);
488 const content = [textBlock(result)];
489 const outputSummary = textSummary(snapshot.output ? [textBlock(snapshot.output)] : []);
490 return {
491 content,
492 _meta: {
493 tool,
494 card: {
495 workspaceId,
496 summary: { ...summary, ...outputSummary },
497 payload: { content },
498 },
499 },
500 structuredContent: {
501 result,
502 sessionId: snapshot.sessionId,
503 running: snapshot.running,
504 exitCode: snapshot.exitCode,
505 signal: snapshot.signal,
506 wallTimeMs: snapshot.wallTimeMs,
507 outputTruncated: snapshot.outputTruncated,
508 },
509 };
510}
511
512function registerCodexProcessTools(
513 server: McpServer,

Callers 1

Calls 3

processResultFunction · 0.85
textBlockFunction · 0.85
textSummaryFunction · 0.85

Tested by

no test coverage detected