( tool: "exec_command" | "write_stdin", workspaceId: string, snapshot: ProcessSnapshot, summary: Record<string, unknown>, )
| 479 | } |
| 480 | |
| 481 | function 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 | |
| 512 | function registerCodexProcessTools( |
| 513 | server: McpServer, |
no test coverage detected