diff --git a/components/AIAssist.tsx b/components/AIAssist.tsx index acf1bc3..8a51a1e 100644 --- a/components/AIAssist.tsx +++ b/components/AIAssist.tsx @@ -579,7 +579,7 @@ export default function AIAssist({ vibeMode = false }: { vibeMode?: boolean } = /module\.exports/i.test(preview.data); // Client-side detection - const isUI = ["web", "app", "design", "html", "ui"].includes(preview.type); + const isUI = ["web", "app", "design", "html", "ui", "leads"].includes(preview.type); const hasTags = /<[a-z][\s\S]*>/i.test(preview.data); return (isUI || hasTags || preview.language === "html") && !isBackend; @@ -647,7 +647,7 @@ export default function AIAssist({ vibeMode = false }: { vibeMode?: boolean } = const isCodeAgent = currentAgent === "code"; const wasIdle = !isApproval && isCodeAgent && (assistStep === "idle" || assistStep === "plan"); // Detect if user is modifying an existing visual artifact (not text-only agents like SEO/content) - const isVisualAgent = currentAgent === "code" || currentAgent === "web" || currentAgent === "app" || currentAgent === "design" || currentAgent === "general"; + const isVisualAgent = currentAgent === "code" || currentAgent === "web" || currentAgent === "app" || currentAgent === "design" || currentAgent === "general" || currentAgent === "leads"; if (assistStep === "preview" && isVisualAgent) setIsModifying(true); setIsProcessing(true); if (assistStep === "idle" && isCodeAgent) setAssistStep("plan"); diff --git a/lib/services/openrouter.ts b/lib/services/openrouter.ts index 0e3b82d..d8e58f3 100644 --- a/lib/services/openrouter.ts +++ b/lib/services/openrouter.ts @@ -535,18 +535,63 @@ AGENTS & CAPABILITIES: - web: Frontend Developer. Build responsive sites. Use [PREVIEW:web:html]. Tailwind CSS CDN by default. - app: Mobile App Developer. Create mobile-first interfaces and dashboards. Use [PREVIEW:app:javascript]. - leads: Leads Finder. Expert at finding relevant influencers, prospects, and leads across social media platforms. When given a niche, industry, topic, or target audience, use [WEB_SEARCH:query] to find relevant leads from Instagram, Twitter/X, LinkedIn, YouTube, and TikTok. - **ALWAYS format each lead EXACTLY like this:** - Name | Followers | Region | Location - One-line description of who they are and what they do. - https://social-media-url/ + **MUST wrap results in [PREVIEW:leads:html] so they render as a table in the Canvas.** + + **OUTPUT FORMAT:** + Before [PREVIEW], give a brief chat summary (e.g. "Found 25 leads in forex across Singapore and UAE"). + Then output the full table inside [PREVIEW:leads:html]...[/PREVIEW] using this HTML template: + + +

Leads Report

Generated by PromptArch Leads Finder

+
+
TOTAL_LEADS_COUNT
Total Leads
+
COMBINED_FOLLOWERS
Combined Reach
+
TOP_PLATFORM
Top Platform
+
TOP_REGION
Top Region
+
+ + + + +
#NamePlatformFollowersRegionBioLink
**RULES:** - Find 20+ leads per request unless user specifies a different number. - Sort by relevance and follower count (most relevant first). - Include the most prominent social media URL for each lead. - Use exact follower counts when available (e.g. "44.1K", "275.6K", "1.2M"). - - Group by region when multiple regions are relevant. + - Use correct badge classes per platform: badge-instagram, badge-twitter, badge-linkedin, badge-youtube, badge-tiktok. + - Fill in the STATS div with actual counts from your results. - Provide real, verifiable leads — never fabricate profiles or URLs. + - The ENTIRE HTML table MUST be between [PREVIEW:leads:html] and [/PREVIEW] tags. CANVAS MODE: - When building, designing, or auditing, you MUST use the [PREVIEW] tag.