Demo UI Specification
1. Introduction
This document provides a comprehensive specification for building a demo frontend for the Meta Agent Platform using Svelte 5, shadcn-svelte, and Svelte Flow. The demo will showcase the core functionality of the platform using mock data, allowing stakeholders to visualize and interact with the platform's key features before full implementation.
1.1 Purpose
The purpose of this demo is to: - Visualize the core user interfaces and workflows of the Meta Agent Platform - Provide a tangible representation of the platform's capabilities - Gather feedback on the UI/UX design before full implementation - Serve as a reference for the development team
1.2 Technology Stack
The demo will be built using: - Framework: Svelte 5 with SvelteKit - UI Components: shadcn-svelte - Visual Builder: Svelte Flow - Styling: Tailwind CSS - State Management: Svelte Runes ($state, $derived, $effect) - Mock Data: JSON files stored locally
2. Overall UI Structure
2.1 Layout
The demo will follow a standard application layout with:
- Sidebar Navigation: Primary navigation menu on the left side
- Top Bar: Contains user profile, notifications, and global actions
- Main Content Area: Displays the active screen/component
- Context Panel: Optional right panel for additional information and actions
2.2 Navigation Structure
The sidebar navigation will include the following sections:
- Dashboard: Overview and summary information
- Workflows: List and management of workflows
- Workflow List
- Workflow Builder
- Workflow Monitoring
- Agents: Agent management and configuration
- Agent List
- Agent Details
- Agent Marketplace
- HITL Tasks: Human-in-the-loop task management
- Task Queue
- Task Details
- Settings: System configuration and user preferences
- User Profile
- System Settings
- API Keys
2.3 Theme and Styling
The demo will implement a modern, clean design with: - Light and dark mode support - Primary color palette based on the Meta Agent Platform brand - Consistent spacing and typography - Responsive design for different screen sizes
3. Key Screens and Components
3.1 Dashboard
Purpose: Provide an overview of the system status and quick access to common actions.
Components: - Workflow Status Summary: Visual representation of workflow statuses (Running, Failed, Completed) - Recent Workflow Runs: List of recently executed workflows with status and duration - HITL Task Queue: Quick view of pending tasks requiring human intervention - Agent Health Overview: Status of active agents in the system - Quick Action Cards: Create Workflow, View Logs, etc.
Mock Data Required: - Workflow status counts - Recent workflow execution records - Pending HITL tasks - Agent status records
3.2 Workflow List
Purpose: Display and manage all workflows in the system.
Components: - Search and Filter: Find workflows by name, status, or tags - Workflow List Table: Display workflows with columns for Name, Status, Last Run, Created By - Action Buttons: Run, Edit, Delete, Clone - Create Workflow Button: Prominent button to create a new workflow
Mock Data Required: - List of workflows with metadata - Workflow status information - User information for "Created By"
3.3 Workflow Builder
Purpose: Visual interface for creating and editing workflows.
Components: - Node Palette: Draggable list of available nodes categorized by type - Triggers (Schedule, Event, API, etc.) - Agents (Text, Vision, Audio, etc.) - Logic Gates (If/Else, Switch, Loop, etc.) - HITL Steps (Approval, Input, Review, etc.) - API Calls (REST, GraphQL, etc.) - Sub-Workflows - Canvas: Visual graph area using Svelte Flow - Nodes with visual distinction between types - Connection lines showing workflow progression - Group containers for organizing related nodes - Properties Panel: Context-aware panel for configuring the selected node - Input/output mapping - Agent selection - Parameter configuration - Condition settings - Toolbar: Actions for the workflow - Save - Validate - Run (Test) - Zoom controls - Layout options
Mock Data Required: - Node type definitions - Agent definitions - Sample workflow configurations - Validation rules
3.4 Workflow Monitoring
Purpose: Track and debug workflow execution.
Components: - Workflow Graph: Visual representation of the workflow with real-time status overlay - Run Information: Metadata about the current run (Trigger time, Duration, Status) - Logs Panel: Filterable logs for the entire run and individual nodes - Node Inspector: Detailed view of a selected node - Input data - Output data - Execution time - Error information - Timeline: Chronological view of node execution
Mock Data Required: - Workflow execution data - Node execution status and timing - Log entries - Input/output data samples
3.5 Agent List
Purpose: Manage and configure agents available in the system.
Components: - Search and Filter: Find agents by name, type, or status - Agent List Table: Display agents with columns for Name, Type, Status, Last Used - Action Buttons: Configure, Disable, Delete - Create Agent Button: Add a new agent to the system
Mock Data Required: - List of agents with metadata - Agent type information - Usage statistics
3.6 Agent Details
Purpose: Configure and test individual agents.
Components: - Agent Information: Name, description, type, version - Configuration Form: Agent-specific configuration options - Test Interface: Input form and output display for testing the agent - Usage Statistics: Graphs showing usage over time - Integration Examples: Code snippets for integrating the agent
Mock Data Required: - Agent configuration schema - Sample test inputs and outputs - Usage metrics - Integration code examples
3.7 Agent Marketplace
Purpose: Discover and install new agents.
Components: - Search and Browse: Find agents by category, popularity, or keyword - Agent Cards: Visual representation of available agents - Name and icon - Short description - Rating and review count - Publisher information - Agent Detail Modal: Comprehensive information about a selected agent - Full description - Screenshots - Pricing information - Reviews and ratings - Installation Button: Add the agent to the system
Mock Data Required: - Marketplace agent listings - Category definitions - Rating and review data - Publisher information
3.8 HITL Task Queue
Purpose: Manage tasks requiring human intervention.
Components: - Task List: Display pending tasks with priority, type, and age - Filter Options: Filter by workflow, priority, or status - Sort Options: Sort by age, priority, or workflow - Claim Button: Assign a task to yourself
Mock Data Required: - List of HITL tasks with metadata - Task priority definitions - Task type information
3.9 HITL Task Details
Purpose: Review and respond to a human-in-the-loop task.
Components: - Task Information: Title, description, workflow context - Data Display: Relevant data for making a decision - Text content - Images or visualizations - Previous steps in the workflow - Decision Interface: UI for submitting a response - Approval buttons - Form inputs - Comments field - History: Previous interactions with this task
Mock Data Required: - Detailed task information - Context data for decision-making - Response options - Task history
3.10 Settings
Purpose: Configure user preferences and system settings.
Components: - User Profile: Personal information and preferences - Theme Settings: UI theme configuration - Notification Preferences: Configure email and in-app notifications - API Keys: Generate and manage API keys - System Settings (Admin only): Global configuration options
Mock Data Required: - User profile information - Theme options - Notification settings - API key records
4. User Flows
4.1 Creating a New Workflow
- Navigate to Workflow List
- Click "Create New Workflow"
- Enter Workflow Name and Description
- Use Workflow Builder:
- Drag nodes from palette to canvas
- Configure node properties
- Connect nodes to define execution flow
- Validate the workflow
- Save the workflow
4.2 Running and Monitoring a Workflow
- Navigate to Workflow List
- Find the desired workflow
- Click "Run" button
- Navigate to Workflow Monitoring
- Observe real-time node status
- Inspect logs and outputs for specific nodes
- View overall run metrics
4.3 Handling a HITL Task
- Receive notification of pending task
- Navigate to HITL Task Queue
- Select the task from the list
- Review task details and context
- Make a decision or provide input
- Submit response
- Task is removed from queue and workflow continues
4.4 Discovering and Installing an Agent
- Navigate to Agent Marketplace
- Browse or search for desired agent
- Select agent to view details
- Review capabilities, pricing, and reviews
- Click "Install" button
- Configure agent settings
- Agent becomes available in the Workflow Builder
4.5 Testing an Agent
- Navigate to Agent List
- Select an agent to view details
- Go to Test Interface
- Enter test input
- Click "Test" button
- View agent output and performance metrics
5. Mock Data Structure
5.1 Workflows
{
"workflows": [
{
"id": "wf-001",
"name": "Customer Onboarding",
"description": "Process new customer applications",
"status": "active",
"created_by": "user-001",
"created_at": "2023-04-15T10:30:00Z",
"last_run": "2023-04-18T14:22:00Z",
"tags": ["customer", "onboarding", "automation"],
"nodes": [
{
"id": "node-001",
"type": "trigger",
"subtype": "api",
"position": { "x": 100, "y": 100 },
"data": {
"name": "API Trigger",
"endpoint": "/api/customers/new"
}
},
{
"id": "node-002",
"type": "agent",
"subtype": "text",
"position": { "x": 300, "y": 100 },
"data": {
"name": "Validate Customer Data",
"agent_id": "agent-001",
"parameters": {
"validation_level": "strict"
}
}
},
{
"id": "node-003",
"type": "logic",
"subtype": "if_else",
"position": { "x": 500, "y": 100 },
"data": {
"name": "Check Validation Result",
"condition": "result.valid === true"
}
},
{
"id": "node-004",
"type": "hitl",
"subtype": "approval",
"position": { "x": 700, "y": 50 },
"data": {
"name": "Manager Approval",
"instructions": "Please review and approve this customer application."
}
},
{
"id": "node-005",
"type": "agent",
"subtype": "text",
"position": { "x": 700, "y": 150 },
"data": {
"name": "Send Rejection Email",
"agent_id": "agent-002",
"parameters": {
"template": "rejection_email"
}
}
}
],
"edges": [
{
"id": "edge-001",
"source": "node-001",
"target": "node-002"
},
{
"id": "edge-002",
"source": "node-002",
"target": "node-003"
},
{
"id": "edge-003",
"source": "node-003",
"target": "node-004",
"label": "Valid"
},
{
"id": "edge-004",
"source": "node-003",
"target": "node-005",
"label": "Invalid"
}
]
}
]
}
5.2 Workflow Runs
{
"workflow_runs": [
{
"id": "run-001",
"workflow_id": "wf-001",
"status": "completed",
"started_at": "2023-04-18T14:22:00Z",
"completed_at": "2023-04-18T14:23:30Z",
"triggered_by": "user-001",
"trigger_type": "manual",
"node_runs": [
{
"node_id": "node-001",
"status": "completed",
"started_at": "2023-04-18T14:22:00Z",
"completed_at": "2023-04-18T14:22:01Z",
"input": {},
"output": {
"customer_data": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Inc."
}
}
},
{
"node_id": "node-002",
"status": "completed",
"started_at": "2023-04-18T14:22:01Z",
"completed_at": "2023-04-18T14:22:05Z",
"input": {
"customer_data": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Inc."
}
},
"output": {
"valid": true,
"validation_results": {
"name": "valid",
"email": "valid",
"company": "valid"
}
}
},
{
"node_id": "node-003",
"status": "completed",
"started_at": "2023-04-18T14:22:05Z",
"completed_at": "2023-04-18T14:22:06Z",
"input": {
"valid": true,
"validation_results": {
"name": "valid",
"email": "valid",
"company": "valid"
}
},
"output": {
"path": "valid"
}
},
{
"node_id": "node-004",
"status": "completed",
"started_at": "2023-04-18T14:22:06Z",
"completed_at": "2023-04-18T14:23:30Z",
"input": {
"customer_data": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Inc."
},
"validation_results": {
"name": "valid",
"email": "valid",
"company": "valid"
}
},
"output": {
"approved": true,
"comments": "Customer information looks good."
}
}
],
"logs": [
{
"timestamp": "2023-04-18T14:22:00Z",
"level": "info",
"node_id": "node-001",
"message": "Workflow triggered manually by user-001"
},
{
"timestamp": "2023-04-18T14:22:01Z",
"level": "info",
"node_id": "node-001",
"message": "Received customer data for John Doe"
},
{
"timestamp": "2023-04-18T14:22:01Z",
"level": "info",
"node_id": "node-002",
"message": "Starting validation of customer data"
},
{
"timestamp": "2023-04-18T14:22:05Z",
"level": "info",
"node_id": "node-002",
"message": "Customer data validation completed successfully"
},
{
"timestamp": "2023-04-18T14:22:06Z",
"level": "info",
"node_id": "node-003",
"message": "Condition evaluated to true, taking 'Valid' path"
},
{
"timestamp": "2023-04-18T14:22:06Z",
"level": "info",
"node_id": "node-004",
"message": "Created HITL task for manager approval"
},
{
"timestamp": "2023-04-18T14:23:25Z",
"level": "info",
"node_id": "node-004",
"message": "HITL task completed by user-002"
},
{
"timestamp": "2023-04-18T14:23:30Z",
"level": "info",
"node_id": null,
"message": "Workflow completed successfully"
}
]
}
]
}
5.3 Agents
{
"agents": [
{
"id": "agent-001",
"name": "Data Validator",
"description": "Validates customer data against business rules",
"type": "text",
"status": "active",
"version": "1.2.0",
"created_at": "2023-03-10T09:15:00Z",
"last_used": "2023-04-18T14:22:01Z",
"configuration": {
"validation_rules": {
"name": "required|string|min:2",
"email": "required|email",
"company": "required|string"
},
"api_key": "sk_validator_123456"
},
"capabilities": [
"data_validation",
"schema_enforcement",
"format_correction"
],
"input_schema": {
"type": "object",
"properties": {
"customer_data": {
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"company": { "type": "string" }
},
"required": ["name", "email"]
},
"validation_level": {
"type": "string",
"enum": ["strict", "moderate", "lenient"],
"default": "moderate"
}
},
"required": ["customer_data"]
},
"output_schema": {
"type": "object",
"properties": {
"valid": { "type": "boolean" },
"validation_results": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"corrected_data": {
"type": "object",
"additionalProperties": true
}
},
"required": ["valid", "validation_results"]
}
}
]
}
5.4 HITL Tasks
{
"hitl_tasks": [
{
"id": "task-001",
"workflow_id": "wf-001",
"workflow_run_id": "run-001",
"node_id": "node-004",
"title": "Manager Approval: Customer Onboarding",
"description": "Please review and approve this customer application.",
"status": "pending",
"priority": "medium",
"created_at": "2023-04-18T14:22:06Z",
"assigned_to": null,
"data": {
"customer_data": {
"name": "John Doe",
"email": "john@example.com",
"company": "Acme Inc."
},
"validation_results": {
"name": "valid",
"email": "valid",
"company": "valid"
}
},
"response_options": [
{
"id": "approve",
"label": "Approve",
"value": true
},
{
"id": "reject",
"label": "Reject",
"value": false
}
],
"additional_fields": [
{
"id": "comments",
"label": "Comments",
"type": "textarea",
"required": false
}
]
}
]
}
5.5 Marketplace Agents
{
"marketplace_agents": [
{
"id": "marketplace-001",
"name": "Email Composer",
"description": "Generates personalized email content based on templates and customer data",
"type": "text",
"category": "communication",
"publisher": {
"id": "pub-001",
"name": "AI Communication Tools",
"verified": true
},
"version": "2.1.0",
"pricing": {
"model": "freemium",
"free_tier": {
"requests_per_day": 50
},
"paid_tier": {
"price_per_month": 19.99,
"requests_per_day": "unlimited"
}
},
"rating": {
"average": 4.7,
"count": 128
},
"tags": ["email", "templates", "personalization"],
"screenshots": [
"https://example.com/screenshots/email-composer-1.png",
"https://example.com/screenshots/email-composer-2.png"
],
"capabilities": [
"template_based_generation",
"personalization",
"multilingual",
"tone_adjustment"
]
}
]
}
5.6 Users
{
"users": [
{
"id": "user-001",
"name": "Admin User",
"email": "admin@example.com",
"role": "admin",
"created_at": "2023-01-01T00:00:00Z",
"last_login": "2023-04-18T09:30:00Z",
"preferences": {
"theme": "dark",
"notifications": {
"email": true,
"in_app": true
}
}
},
{
"id": "user-002",
"name": "Manager User",
"email": "manager@example.com",
"role": "manager",
"created_at": "2023-01-15T00:00:00Z",
"last_login": "2023-04-18T14:23:00Z",
"preferences": {
"theme": "light",
"notifications": {
"email": true,
"in_app": true
}
}
}
]
}
6. Implementation Recommendations
6.1 Project Structure
demo/
├── src/
│ ├── lib/
│ │ ├── components/
│ │ │ ├── ui/
│ │ │ │ ├── button.svelte
│ │ │ │ ├── input.svelte
│ │ │ │ ├── sidebar.svelte
│ │ │ │ └── ...
│ │ │ ├── dashboard/
│ │ │ │ ├── status-summary.svelte
│ │ │ │ ├── recent-runs.svelte
│ │ │ │ └── ...
│ │ │ ├── workflow/
│ │ │ │ ├── workflow-list.svelte
│ │ │ │ ├── workflow-builder.svelte
│ │ │ │ ├── workflow-monitor.svelte
│ │ │ │ └── ...
│ │ │ ├── agent/
│ │ │ │ ├── agent-list.svelte
│ │ │ │ ├── agent-details.svelte
│ │ │ │ ├── marketplace.svelte
│ │ │ │ └── ...
│ │ │ ├── hitl/
│ │ │ │ ├── task-queue.svelte
│ │ │ │ ├── task-details.svelte
│ │ │ │ └── ...
│ │ │ └── settings/
│ │ │ ├── profile.svelte
│ │ │ ├── api-keys.svelte
│ │ │ └── ...
│ │ ├── stores/
│ │ │ ├── workflow-store.js
│ │ │ ├── agent-store.js
│ │ │ ├── hitl-store.js
│ │ │ └── ...
│ │ ├── data/
│ │ │ ├── workflows.json
│ │ │ ├── workflow-runs.json
│ │ │ ├── agents.json
│ │ │ ├── hitl-tasks.json
│ │ │ ├── marketplace.json
│ │ │ └── users.json
│ │ └── utils/
│ │ ├── api.js
│ │ ├── date-formatter.js
│ │ └── ...
│ ├── routes/
│ │ ├── +layout.svelte
│ │ ├── +page.svelte
│ │ ├── workflows/
│ │ │ ├── +page.svelte
│ │ │ ├── [id]/
│ │ │ │ ├── +page.svelte
│ │ │ │ └── monitor/+page.svelte
│ │ │ └── builder/+page.svelte
│ │ ├── agents/
│ │ │ ├── +page.svelte
│ │ │ ├── [id]/+page.svelte
│ │ │ └── marketplace/+page.svelte
│ │ ├── hitl/
│ │ │ ├── +page.svelte
│ │ │ └── [id]/+page.svelte
│ │ └── settings/
│ │ ├── +page.svelte
│ │ ├── profile/+page.svelte
│ │ └── api-keys/+page.svelte
│ └── app.html
├── static/
│ ├── favicon.png
│ ├── images/
│ │ ├── logo.svg
│ │ └── ...
│ └── ...
├── svelte.config.js
├── tailwind.config.js
├── tsconfig.json
└── vite.config.ts
6.2 Component Implementation Strategy
- Start with UI Components: Implement the basic UI components from shadcn-svelte first
- Build Layout Components: Create the layout structure with sidebar and top bar
- Implement Data Stores: Set up stores for managing mock data
- Develop Screen Components: Build the main screen components
- Implement Workflow Builder: Focus on the Svelte Flow integration for the workflow builder
- Add Interactivity: Implement user interactions and state management
- Polish and Refine: Add animations, transitions, and polish the UI
6.3 Recommended shadcn-svelte Components
For this demo, the following shadcn-svelte components are recommended:
- Layout and Structure:
- Card
- Sheet
- Tabs
- Accordion
-
Separator
-
Navigation:
- Sidebar (custom component)
- Breadcrumb
- Navigation Menu
-
Command (for search)
-
Data Display:
- Table
- Data Table
- Calendar
-
Avatar
-
Inputs and Forms:
- Button
- Input
- Textarea
- Select
- Checkbox
- Radio Group
- Switch
- Slider
-
Form
-
Feedback and Alerts:
- Alert
- Toast
- Progress
-
Skeleton
-
Overlays:
- Dialog
- Drawer
- Popover
- Tooltip
6.4 Svelte Flow Implementation
For the Workflow Builder, implement Svelte Flow with:
- Custom Node Types:
- Trigger nodes
- Agent nodes
- Logic nodes
- HITL nodes
-
API nodes
-
Node Styling:
- Distinct visual appearance for each node type
- Status indicators for execution state
-
Input/output ports with clear visual distinction
-
Interaction Handlers:
- Node selection
- Connection creation
- Node configuration
-
Canvas panning and zooming
-
Validation:
- Connection validation
- Node configuration validation
- Workflow validation
6.5 Responsive Design Considerations
- Mobile View:
- Collapsible sidebar
- Simplified workflow view
- Touch-friendly controls
-
Prioritized content for smaller screens
-
Tablet View:
- Hybrid layout with some desktop features
- Adapted workflow builder with touch controls
-
Optimized property panels
-
Desktop View:
- Full-featured interface
- Multi-panel layout
- Advanced workflow builder capabilities
6.6 Accessibility Considerations
- Keyboard Navigation:
- Ensure all interactive elements are keyboard accessible
- Implement logical tab order
-
Provide keyboard shortcuts for common actions
-
Screen Reader Support:
- Add appropriate ARIA attributes
- Ensure all UI elements have descriptive labels
-
Test with screen readers
-
Color and Contrast:
- Ensure sufficient color contrast
- Don't rely solely on color for conveying information
- Support high contrast mode
7. Next Steps
- Set up the basic SvelteKit project structure
- Install and configure shadcn-svelte components
- Create the mock data files
- Implement the layout and navigation structure
- Build the dashboard components
- Develop the workflow list and details screens
- Implement the workflow builder with Svelte Flow
- Add the agent management screens
- Build the HITL task interface
- Implement settings and user preferences
- Polish the UI and add final touches
- Test across different devices and screen sizes