(frame: any)
| 26 | type OutputFormat = 'text' | 'json'; |
| 27 | |
| 28 | function summarizeFrame(frame: any) { |
| 29 | const fileUrl = frame.url || scriptIdToUrl[frame.location.scriptId] || '<unknown>'; |
| 30 | return { |
| 31 | functionName: frame.functionName || null, |
| 32 | url: fileUrl, |
| 33 | line: frame.location.lineNumber + 1, |
| 34 | column: (frame.location.columnNumber ?? 0) + 1 |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | function mcpContent(payload: unknown, format?: OutputFormat) { |
| 39 | // MCP spec supports text/image/resource. We encode structured data as a single text block. |