diff --git a/frontend/src/components/flowpilot/FlowPilotStepCard.tsx b/frontend/src/components/flowpilot/FlowPilotStepCard.tsx index 86405c5d..dd6b4c94 100644 --- a/frontend/src/components/flowpilot/FlowPilotStepCard.tsx +++ b/frontend/src/components/flowpilot/FlowPilotStepCard.tsx @@ -2,6 +2,7 @@ import { useState } from 'react' import { MessageSquare, Zap, CheckCircle2, SkipForward, ChevronDown, ChevronUp } from 'lucide-react' import { cn } from '@/lib/utils' import type { AISessionStepResponse, StepResponseRequest } from '@/types/ai-session' +import { isScriptGenerationAction, isScriptBuilderAction, getActionType } from '@/types/ai-session' import { MarkdownContent } from '@/components/ui/MarkdownContent' import { FlowPilotOptions } from './FlowPilotOptions' import { InSessionScriptGenerator } from './InSessionScriptGenerator' @@ -157,24 +158,24 @@ export function FlowPilotStepCard({ step, isCurrentStep, isProcessing, sessionId )} {/* In-session script generator */} - {!isResolutionSuggestion && (content.action_type as string) === 'script_generation' && sessionId && ( + {!isResolutionSuggestion && isScriptGenerationAction(content) && sessionId && ( ) || {}} - instructions={(content.instructions as string) || stepText} + templateId={content.template_id || ''} + preFilledParams={content.pre_filled_params || {}} + instructions={content.instructions || stepText} sessionId={sessionId} onRespond={onRespond} /> )} {/* Script Builder handoff */} - {!isResolutionSuggestion && step.step_type === 'action' && (content.action_type as string) === 'open_script_builder' && ( + {!isResolutionSuggestion && step.step_type === 'action' && isScriptBuilderAction(content) && (