(value: any)
| 240 | let extractedFiles: ChatFile[] = [] |
| 241 | |
| 242 | const formatValue = (value: any): string | null => { |
| 243 | if (value === null || value === undefined) { |
| 244 | return null |
| 245 | } |
| 246 | |
| 247 | if (isUserFileWithMetadata(value)) { |
| 248 | return null |
| 249 | } |
| 250 | |
| 251 | if (Array.isArray(value) && value.length === 0) { |
| 252 | return null |
| 253 | } |
| 254 | |
| 255 | if (typeof value === 'string') { |
| 256 | return value |
| 257 | } |
| 258 | |
| 259 | if (typeof value === 'object') { |
| 260 | try { |
| 261 | return `\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\`` |
| 262 | } catch { |
| 263 | return String(value) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | return String(value) |
| 268 | } |
| 269 | |
| 270 | const getOutputValue = (blockOutputs: Record<string, any>, path?: string) => { |
| 271 | if (!path || path === 'content') { |
no test coverage detected