( parsedContent: any, selectedOutputs: string[], blockId: string )
| 87 | * Used for both workspace and chat client field extraction |
| 88 | */ |
| 89 | export function extractFieldValues( |
| 90 | parsedContent: any, |
| 91 | selectedOutputs: string[], |
| 92 | blockId: string |
| 93 | ): Record<string, any> { |
| 94 | const extractedValues: Record<string, any> = {} |
| 95 | |
| 96 | for (const outputId of selectedOutputs) { |
| 97 | const blockIdForOutput = extractBlockIdFromOutputId(outputId) |
| 98 | |
| 99 | if (blockIdForOutput !== blockId) { |
| 100 | continue |
| 101 | } |
| 102 | |
| 103 | const path = extractPathFromOutputId(outputId, blockIdForOutput) |
| 104 | |
| 105 | if (path) { |
| 106 | const current = traverseObjectPathInternal(parsedContent, path) |
| 107 | if (current !== undefined) { |
| 108 | extractedValues[path] = current |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | return extractedValues |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Format extracted field values for display |
no test coverage detected