Demonstrate how AI agents can safely interact with applications through WebMCP while Legit provides:
- Observable changes - Users see exactly what the AI is doing
- Approval workflows - Changes require human approval before committing
- Rollback safety - Any change can be undone
- Multi-agent isolation - Multiple AIs can work without conflicts
When an agent makes changes on their branch, show those changes as "phantom" events on the calendar - visually distinct, clearly labeled as pending approval.
Add new visual treatment for uncommitted agent changes:
// New color variant in event-block.tsx
const phantomStyles = {
base: "border-dashed border-2 opacity-70",
pending: "bg-gradient-to-r from-purple-50/50 to-blue-50/50 border-purple-300",
added: "border-green-400 bg-green-50/30",
modified: "border-amber-400 bg-amber-50/30",
removed: "border-red-400 bg-red-50/30 line-through opacity-50"
}New context to track which agent branch is being previewed:
interface AgentPreviewState {
isPreviewMode: boolean;
agentId: string | null;
agentBranch: string | null;
pendingChanges: {
added: IEvent[];
modified: { before: IEvent; after: IEvent }[];
removed: IEvent[];
};
}Merge main branch events with phantom events from agent branch:
function useCombinedEvents() {
const { events } = useCalendar(); // main branch
const { pendingChanges, isPreviewMode } = useAgentPreview();
if (!isPreviewMode) return events;
return [
...events.filter(e => !pendingChanges.removed.some(r => r.id === e.id)),
...pendingChanges.added.map(e => ({ ...e, _phantom: 'added' })),
...pendingChanges.modified.map(m => ({ ...m.after, _phantom: 'modified' })),
...pendingChanges.removed.map(e => ({ ...e, _phantom: 'removed' })),
];
}- Phantom Event Badge: Shows "AI Pending" label with agent icon
- Preview Banner: Top bar showing "Previewing changes from Claude" with Accept/Reject buttons
- Change Summary Panel: Sidebar showing diff summary
A clear workflow for reviewing and approving AI-proposed changes.
Slide-out panel showing:
- Agent identity (which AI made changes)
- Timestamp of changes
- Summary: "+3 events, ~2 modified, -1 removed"
- Detailed diff view
- Accept All / Reject All / Review Individual buttons
Click on a phantom event to see:
- Before/After comparison (for modifications)
- Full event details
- Accept / Reject this change buttons
// Tool for AI to check if its changes were approved
calendar_check_approval_status: {
input: { agentId: string },
output: {
status: 'pending' | 'approved' | 'rejected' | 'partial',
approvedChanges: string[],
rejectedChanges: string[],
feedback?: string
}
}
// Tool for AI to request approval
calendar_request_approval: {
input: {
agentId: string,
message: string, // "I've scheduled 3 meetings for next week"
priority: 'normal' | 'urgent'
},
output: { requestId: string, notificationSent: boolean }
}Show a live feed of what agents are doing, providing transparency into AI actions.
interface AgentActivity {
id: string;
agentId: string;
agentName: string;
action: 'tool_call' | 'state_change' | 'branch_created' | 'merge_requested';
toolName?: string;
description: string;
timestamp: Date;
details?: unknown;
}- Collapsible sidebar showing recent agent activity
- Filter by agent
- Click to see full details
- "Jump to change" button to navigate to affected events
Instrument all MCP tools to emit activity events:
function useInstrumentedWebMCP(options) {
const emitActivity = useActivityFeed();
return useWebMCP({
...options,
handler: async (args) => {
emitActivity({ action: 'tool_call', toolName: options.name, ... });
const result = await options.handler(args);
emitActivity({ action: 'state_change', ... });
return result;
}
});
}When multiple agents (or agent + human) make conflicting changes, provide clear conflict resolution.
interface Conflict {
type: 'time_overlap' | 'same_event_modified' | 'deleted_then_modified';
eventId: number;
agents: string[];
description: string;
resolutions: ConflictResolution[];
}
interface ConflictResolution {
label: string;
description: string;
apply: () => Promise<void>;
}- Banner: "2 conflicts detected between your changes and Claude's"
- Visual highlighting of conflicting events
- Side-by-side comparison
- Resolution options: Keep mine / Keep AI's / Merge / Custom
calendar_smart_merge: {
description: "Attempt to automatically merge non-conflicting changes from an agent branch",
input: { agentId: string, strategy: 'theirs' | 'ours' | 'smart' },
output: {
merged: number,
conflicts: Conflict[],
requiresManualResolution: boolean
}
}Interactive UI to explore calendar history, see what changed when, and restore past states.
- Horizontal timeline showing commits
- Drag to see calendar at any point in time
- Commit metadata on hover (author, message, timestamp)
- Toggle to show "what changed" overlay
- Green highlights for additions
- Red strikethrough for deletions
- Yellow background for modifications
- "Restore this version" button
- Selective restore: restore individual events from past
- Creates new commit (doesn't lose history)
Central view for managing multiple AI agents working on the calendar.
For each active agent show:
- Agent name/model
- Branch name
- Last activity timestamp
- Pending changes count
- Quick actions: Preview / Merge / Discard
- Select 2+ agents to compare their proposed changes
- Side-by-side calendar views
- Merge selector: pick changes from each
interface AgentPermissions {
canCreate: boolean;
canModify: boolean;
canDelete: boolean;
maxEventsPerSession: number;
requiresApproval: boolean;
allowedTimeRanges?: { start: string; end: string }[];
}- User asks Claude to "schedule a team standup every day at 9am"
- Claude creates a sandbox, adds 5 recurring events
- Events appear as phantoms on calendar with "Pending Approval" badges
- User reviews in approval panel, sees all 5 events
- User approves, events become solid/permanent
- Human manually adds meeting on Tuesday 2pm
- Claude (unaware) schedules a call for Tuesday 2pm
- UI shows conflict banner
- User chooses to keep Claude's suggestion, moves their meeting
- Claude-1 is scheduling meetings for Project A
- Claude-2 is scheduling meetings for Project B
- Dashboard shows both agents' pending changes
- User can compare and merge selectively
- Agent accidentally deletes important recurring meeting
- User notices next day
- Uses timeline to find the meeting in history
- Restores just that event from 2 days ago
- User watches activity feed as Claude schedules meetings
- Sees each tool call: "list_events", "find_free_time", "schedule_meeting"
- Can intervene mid-process if Claude makes wrong assumptions
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ WebMCP │────▶│ Legit │────▶│ React │
│ Tool Call │ │ Commit │ │ Context │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ Branch │
│ Isolation │
└─────────────┘
│
┌────────────┴────────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Main │ │ Agent │
│ Branch │ │ Branch │
└─────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Solid │ │ Phantom │
│ Events │ │ Events │
└─────────────┘ └─────────────┘
| File | Purpose |
|---|---|
src/calendar/context/agent-preview-context.tsx |
Agent preview state management |
src/calendar/components/phantom-event-badge.tsx |
Phantom event visual treatment |
src/calendar/components/approval-panel.tsx |
Change approval UI |
src/calendar/components/activity-feed.tsx |
Real-time agent activity |
src/calendar/components/conflict-resolver.tsx |
Conflict resolution UI |
src/calendar/components/time-travel.tsx |
History explorer |
src/calendar/hooks/use-combined-events.ts |
Merge main + phantom events |
src/calendar/hooks/use-agent-preview.ts |
Agent preview logic |
- Phantom events - Visual distinction for pending changes
- Preview banner - Clear indication of preview mode
- Simple approval - Accept/Reject all changes
- Activity feed - Real-time transparency
- Timeline scrubber - History exploration
- Conflict resolution - Handle concurrent edits
- Multi-agent dashboard - Manage multiple AIs
A successful demo should show:
- Transparency - User always knows what AI is doing
- Control - User can approve/reject any AI action
- Safety - Any change can be undone
- Collaboration - Multiple agents can work together
- Trust - Build confidence in AI-assisted workflows