( finalInput: unknown, workflowInput: unknown, mode: 'manual' | 'api' | 'chat' | null )
| 490 | } |
| 491 | |
| 492 | function buildLegacyStarterOutput( |
| 493 | finalInput: unknown, |
| 494 | workflowInput: unknown, |
| 495 | mode: 'manual' | 'api' | 'chat' | null |
| 496 | ): NormalizedBlockOutput { |
| 497 | if (mode === 'chat') { |
| 498 | return buildChatOutput(workflowInput) |
| 499 | } |
| 500 | |
| 501 | const output: NormalizedBlockOutput = {} |
| 502 | const finalObject = isRecordLike(finalInput) ? finalInput : undefined |
| 503 | |
| 504 | if (finalObject) { |
| 505 | safeAssign(output, finalObject) |
| 506 | output.input = { ...finalObject } |
| 507 | } else { |
| 508 | output.input = finalInput |
| 509 | } |
| 510 | |
| 511 | const conversationId = isRecordLike(workflowInput) ? workflowInput.conversationId : undefined |
| 512 | if (conversationId) { |
| 513 | output.conversationId = ensureString(conversationId) |
| 514 | } |
| 515 | |
| 516 | return mergeFilesIntoOutput(output, workflowInput) |
| 517 | } |
| 518 | |
| 519 | function buildManualTriggerOutput( |
| 520 | finalInput: unknown, |
no test coverage detected