Spaces:
Running

Destiny369963 commited on
Commit
b99833e
·
verified ·
1 Parent(s): 8243f27

You are an expert front-end architect and product designer.

Browse files

Build a single-page web application called “TaskPilot” – a personal AI task agent UI. It should conceptually fuse two archetypes:
– MetaEvolver – adapts strategies and templates over time based on outcomes and feedback.
– AutoLoop – runs step-by-step workflows with progress tracking and loops until completion.

Tech stack

Use React + TypeScript + Vite + Tailwind CSS.

Everything runs client-side with mocked “AI” logic (no real backend calls required).

Core agent logic
Implement a TypeScript class TaskPilotAgent that represents the fusion of MetaEvolver + AutoLoop:

Public methods:

handleUserMessage(message: string, files: UploadedFile[]): Promise<AgentTurn>

startWorkflow(templateId: string, userInputs: Record<string,string>): AgentWorkflow

updateStepStatus(stepId: string, status: "pending" | "in_progress" | "done" | "skipped")

Internals:

Maintain workflows as arrays of WorkflowStep with titles, descriptions, status, and optional related files.

Maintain a policyState object with fields like detailLevel, tone, preferredWorkflowTemplates, recentSuccessRate.

Update policyState in response to thumbs-up/thumbs-down feedback and workflow completions.

AgentTurn should include: response message text, updated steps, a short reasoningTrace string, and the current policyState.

Workflow templates
Hard-code at least three example workflow templates to demonstrate the system:

Template A: “Take a Shopify store live.”

Template B: “Create a simple marketing website.”

Template C: “Review and improve a page’s UI/UX.”
Each template should define a list of WorkflowStep objects and accept simple parameters (like store name or URL) to slightly customize the steps.

Data models (TypeScript interfaces)

ChatMessage: { id: string; role: "user" | "agent"; text: string; timestamp: string; workflowStepId?: string; }

UploadedFile: { id: string; name: string; size: number; type: string; textPreview?: string; }

WorkflowStep: { id: string; title: string; description: string; status: "pending" | "in_progress" | "done" | "skipped"; relatedFiles?: string[]; }

AgentWorkflow: { id: string; name: string; steps: WorkflowStep[]; }

PolicyState: { detailLevel: "low" | "medium" | "high"; tone: "concise" | "neutral" | "detailed"; preferredWorkflowTemplates: string[]; recentSuccessRate: number; }

AgentTurn: { responseMessage: string; steps: WorkflowStep[]; reasoningTrace: string; policyState: PolicyState; }

Layout & components
Build a responsive, 3-panel SPA with Tailwind styling:

Left panel – Chat

Component: ChatPanel.

Shows ChatMessage history as user/agent bubbles.

Bottom area:

Multiline text input.

“Send” button.

Each agent message includes thumbs-up/thumbs-down controls that call back into TaskPilotAgent to update policyState.

Middle panel – Workflows

Component: WorkflowPanel.

Dropdown to select a workflow template (Shopify live, website creation, UI/UX review, and a “Custom” option).

Button to start a workflow via startWorkflow.

Vertical list of WorkflowStep cards showing title, description, and status pill.

Each step card has buttons to set status (Start, Done, Skip) via updateStepStatus.

Right panel – Files & Inspector

Component: FilesInspectorPanel.

File upload area with drag-and-drop and “Browse” button.

List of uploaded files (UploadedFile objects) with remove button.

For text-like files (txt, md, json), use FileReader to populate textPreview with first lines.

Below file list, show:

Current policyState rendered as formatted JSON.

The latest reasoningTrace string from TaskPilotAgent.

File handling

Accept multiple files.

Store them in React state as UploadedFile[].

Provide hooks or callbacks so TaskPilotAgent.handleUserMessage can inspect filenames, types, and textPreview.

Styling & UX

Use Tailwind to create a clean, minimal SaaS UI with a slightly dark theme (e.g., slate backgrounds, subtle cards, clear typography).

Ensure layout is responsive for desktop and tablet.

Project structure

src/main.tsx – Vite/React entry.

src/App.tsx – top-level layout, creates a single TaskPilotAgent instance and passes it to panels via props or context.

src/agent/TaskPilotAgent.ts – contains the agent logic, workflow templates, and policyState management.

src/components/ChatPanel.tsx

src/components/WorkflowPanel.tsx

src/components/FilesInspectorPanel.tsx

Tailwind setup files as required by Vite.

Extensibility notes

In TaskPilotAgent.ts, add clear comments indicating where real LLM calls, external APIs, or persistent storage could be integrated later.

Ensure the app runs from a standard Vite + React + TypeScript + Tailwind setup with npm install and npm run dev.

2 files changed +797 -24
Files changed (2)
README.md+8-5
index.html+789-19