Eidetic

AI Action Plan

AI
Agents
Block

Agent-specific component for displaying planned AI actions before execution. Shows steps, progress, estimated times, and allows users to approve, pause, or modify the execution plan.

Preview

Action plan with steps in various states

Document Analysis Plan

Analyzing documents and generating a report

AI
Progress: 1/4 stepsRunning...
Search for relevant documents
Completed in 3s
Analyze document contents
Generate report
~10s
Send notification email
Optional
~2s
4 steps in plan

Pending Plan with Approvals

Plan requiring user approval for sensitive steps

Data Migration Plan

Migrate user records to new database schema

AI
Progress: 0/4 stepsEst. 28s
Connect to database
~3s
Fetch user records
Needs approval
~8s
Process data transformations
~12s
Update records
Needs approval
~5s
4 steps in plan

Failed Execution

Plan with a failed step and retry option

User Authentication

AI
Progress: 1/3 steps
Initialize connection
Completed in 2s
Authenticate user

Authentication token expired. Please refresh and try again.

Fetch data
Execution stopped due to error

Compact Variant

Minimal progress display for sidebars or headers

Processing...

1/4 steps

Inline Variant

Text-based progress indicator

Document Analysis1/4 stepsRunning

Interactive Demo

Try the execution controls

Interactive Demo

Click the buttons to simulate execution

AI
Progress: 0/4 stepsEst. 28s
Connect to database
~3s
Fetch user records
Needs approval
~8s
Process data transformations
~12s
Update records
Needs approval
~5s
4 steps in plan

Props

AIActionPlan component API reference

PropTypeDefaultDescription
titlestring'Action Plan'Plan title
descriptionstringPlan description
steps*ActionStep[]Array of action steps
status'idle' | 'running' | 'paused' | 'completed' | 'failed''idle'Current execution status
onExecute() => voidCallback when execution starts
onPause() => voidCallback when execution pauses
onResume() => voidCallback when execution resumes
onCancel() => voidCallback when execution cancels
onRetry(stepId: string) => voidCallback when retrying a failed step
onApprove(stepId: string) => voidCallback when approving a step
onSkip(stepId: string) => voidCallback when skipping an optional step
onEdit() => voidCallback when editing the plan
showEstimatesbooleantrueShow estimated times for pending steps
variant'card' | 'compact' | 'inline''card'Display variant

ActionStep Type

Structure for individual action steps

interface ActionStep {
id: string // Unique identifier
title: string // Step title
description?: string // Detailed description
status: ActionStatus // 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped'
type?: ActionType // 'search' | 'read' | 'write' | 'analyze' | 'api' | 'code' | 'email' | 'custom'
icon?: LucideIcon // Custom icon
estimatedDuration?: number // Estimated duration in seconds
actualDuration?: number // Actual duration in seconds
subSteps?: ActionStep[] // Nested sub-steps
error?: string // Error message if failed
output?: string // Output/result preview
requiresApproval?: boolean // Requires user approval
optional?: boolean // Step is optional
}

Usage

Import and implementation example

import { AIActionPlan, type ActionStep } from '@/blocks/ai-tools/ai-action-plan'
const steps: ActionStep[] = [
{
id: '1',
title: 'Search documents',
type: 'search',
status: 'completed',
actualDuration: 3,
},
{
id: '2',
title: 'Analyze results',
type: 'analyze',
status: 'in_progress',
estimatedDuration: 15,
},
{
id: '3',
title: 'Generate report',
type: 'write',
status: 'pending',
estimatedDuration: 10,
requiresApproval: true,
},
]
export default function Example() {
const [status, setStatus] = useState<'idle' | 'running'>('idle')
return (
<AIActionPlan
title="Document Analysis"
description="Analyze and summarize documents"
steps={steps}
status={status}
onExecute={() => setStatus('running')}
onPause={() => console.log('Paused')}
onApprove={(stepId) => console.log('Approved:', stepId)}
onRetry={(stepId) => console.log('Retry:', stepId)}
/>
)
}

Built With

2 components

This block uses the following UI components from the design system:

Features

Built-in functionality

  • Three variants: Card, compact, and inline display modes
  • Step status tracking: Pending, in-progress, completed, failed, and skipped states
  • Sub-steps support: Nested steps for complex actions
  • Time estimates: Show estimated and actual durations
  • Execution controls: Play, pause, resume, and cancel actions
  • Approval workflow: Require user approval for sensitive steps
  • Optional steps: Mark steps as skippable
  • Error handling: Display errors and retry failed steps
  • Progress tracking: Visual progress bar and step counts
  • Type-based icons: Automatic icons for common action types

Accessibility

Accessibility considerations

ARIA Attributes

Status changes announced to screen readersProgress conveyed through text and visual indicatorsError messages associated with failed steps

Keyboard Navigation

KeyAction
TabNavigate between interactive elements
Enter / SpaceActivate buttons and expand details

Notes

  • Loading states use aria-busy
  • Step status conveyed through icons and text labels
  • Consider adding live region for status updates