'use client'; /** * Step 4: Autonomy Level Selection * * Allows users to choose how much control they want over agent actions. * Includes a detailed approval matrix comparison. * Skipped for script complexity projects. */ import { Check, AlertCircle } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle, } from '@/components/ui/card'; import { cn } from '@/lib/utils'; import { SelectableCard } from '../SelectableCard'; import { autonomyOptions } from '../constants'; import type { WizardState, AutonomyLevel, ApprovalMatrix } from '../types'; import { approvalLabels } from '../types'; interface AutonomyStepProps { state: WizardState; updateState: (updates: Partial) => void; } export function AutonomyStep({ state, updateState }: AutonomyStepProps) { const handleSelect = (autonomyLevel: AutonomyLevel) => { updateState({ autonomyLevel }); }; return (

Autonomy Level

How much control do you want over the AI agents' actions?

{autonomyOptions.map((option) => { const Icon = option.icon; const isSelected = state.autonomyLevel === option.id; return ( handleSelect(option.id)} aria-label={`${option.label}: ${option.description}`} >

{option.label}

{isSelected && (
)}

{option.description}

Best for: {option.recommended}

{Object.entries(option.approvals).map(([key, requiresApproval]) => ( {requiresApproval ? 'Approve' : 'Auto'}:{' '} {approvalLabels[key as keyof ApprovalMatrix]} ))}
); })}
{Object.keys(autonomyOptions[0].approvals).map((key) => ( {autonomyOptions.map((option) => ( ))} ))}
Action Type Full Control Milestone Autonomous
{approvalLabels[key as keyof ApprovalMatrix]} {option.approvals[key as keyof ApprovalMatrix] ? ( Required ) : ( Automatic )}
); }