#!/usr/bin/env python3
"""
MiniMax 500-Agent Swarm -- Domain Portfolio Content Generation
Fires 500 MiniMax M2.5 agents via OpenRouter to generate landing page content
for Kinan's 73-domain portfolio across 10 content categories.

USAGE:
    PYTHONUNBUFFERED=1 python /mnt/e/genesis-system/scripts/minimax500_domain_content_swarm.py

OUTPUTS:
    /mnt/e/genesis-system/swarm-output/session22/domain_content/
        category_01_city_landing_pages/
        category_02_trade_landing_pages/
        category_03_industry_landing_pages/
        category_04_voice_receptionist_landing_pages/
        category_05_city_seo_blog_posts/
        category_06_trade_seo_blog_posts/
        category_07_industry_seo_blog_posts/
        category_08_google_ads_copy/
        category_09_meta_descriptions_seo/
        category_10_email_sequences/
        SWARM_REPORT.md
        all_results.jsonl

Author: Genesis System
Date: 2026-02-16
"""

import os
import sys
import json
import asyncio
import time
from datetime import datetime
from dataclasses import dataclass, asdict
from typing import List, Optional
from pathlib import Path

try:
    import aiohttp
except ImportError:
    print("ERROR: aiohttp not installed. Install with: pip install aiohttp")
    sys.exit(1)

# Configuration
OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1/chat/completions"
MINIMAX_MODEL_ID = "minimax/minimax-m2.5"
API_KEY = "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"

# Execution settings
BATCH_SIZE = 25  # 25 parallel requests per batch
REQUEST_TIMEOUT = 300  # 5 min per request
BATCH_TIMEOUT = 600  # 10 min per batch
INTER_BATCH_DELAY = 2  # 2 seconds between batches

# Output
OUTPUT_DIR = "/mnt/e/genesis-system/swarm-output/session22/domain_content"

# System prompt for all agents
SYSTEM_PROMPT = """You are an expert content strategist, web developer, and marketing copywriter for Sunaiva,
an Australian AI company that builds AI Voice Agents and Talking Website Widgets for businesses.

You produce COMPLETE, READY-TO-DEPLOY content. Not outlines. Not templates. FINISHED work.

Key facts about our products and brand:
- Product: AI Voice Widget that answers calls, books jobs, handles enquiries 24/7
- Pricing: Essentials $197/mo, Business $397/mo, Growth $597/mo (AUD)
- Agency commission: 30% recurring for web agency partners
- Cost per widget: ~$20/mo (Telnyx voice infrastructure)
- Target: Australian businesses (trades, medical, legal, real estate, beauty, etc.)
- Brand: Sunaiva (parent brand). Dark theme: Cosmic Void #0B0C0E, Signal Blue #3B82F6
- Value props: Never miss a call, book jobs 24/7, costs less than a receptionist, AI-powered
- Human receptionist comparison: $30K+/yr human vs $197/mo AI ($2,364/yr)
- Key stat: 62% of calls to small businesses go unanswered (BIA/Kelsey research)
- Voice quality: Natural Australian accent, conversational, not robotic
- Setup: 10 minutes, no coding required
- All content must be Australian English (enquiry not inquiry, organisation not organization)
- Currency: AUD ($) always
- Tone: Professional but approachable. Practical. Results-focused. Never salesy or hypey.
- "Powered by Sunaiva" branding on all content

When generating HTML: use modern, responsive HTML5 with embedded CSS (no external dependencies).
Dark Sunaiva theme: background #0B0C0E, text #E5E7EB, accent #3B82F6, secondary accent #10B981.
All pages must be mobile-first responsive and production-ready."""


@dataclass
class AgentResult:
    agent_id: int
    category: str
    category_num: int
    task_title: str
    status: str  # success/fail
    prompt_tokens: int
    completion_tokens: int
    total_tokens: int
    cost_usd: float
    response_time_ms: int
    response: Optional[str] = None
    error: Optional[str] = None
    timestamp: str = None

    def __post_init__(self):
        if self.timestamp is None:
            self.timestamp = datetime.now().isoformat()


def generate_stories() -> List[dict]:
    """Generate 500 stories across 10 categories."""
    stories = []
    agent_id = 1

    # =========================================================================
    # CATEGORY 1: City Landing Pages (50 agents)
    # 10 city domains x 5 variants each = 50
    # =========================================================================
    city_domains = [
        ("sydneychatbots.com.au", "Sydney", "NSW", "Parramatta, Bondi, Chatswood, Liverpool, Penrith"),
        ("brisbanechatbots.com.au", "Brisbane", "QLD", "Southbank, Fortitude Valley, Chermside, Mt Gravatt, Carindale"),
        ("melbournechatbots.com.au", "Melbourne", "VIC", "Richmond, South Yarra, Brunswick, Dandenong, Frankston"),
        ("adelaidechatbots.com.au", "Adelaide", "SA", "Glenelg, Norwood, Prospect, Modbury, Elizabeth"),
        ("cairnschatbots.com.au", "Cairns", "QLD", "Edge Hill, Whitfield, Smithfield, Palm Cove, Trinity Beach"),
        ("sunshinecoastchatbots.com.au", "Sunshine Coast", "QLD", "Maroochydore, Caloundra, Noosa, Buderim, Mooloolaba"),
        ("townsvillechatbots.com.au", "Townsville", "QLD", "Aitkenvale, Kirwan, Thuringowa, Garbutt, Belgian Gardens"),
        ("darwinchatbots.com.au", "Darwin", "NT", "Stuart Park, Fannie Bay, Parap, Palmerston, Casuarina"),
        ("aichatbotsbrisbane.au", "Brisbane", "QLD", "Paddington, West End, Bulimba, Ascot, Newstead"),
        ("aichatbotsaustralia.au", "Australia", "National", "Sydney, Melbourne, Brisbane, Perth, Adelaide, Gold Coast"),
    ]

    variant_focuses = [
        ("hero_focused", "Create a landing page with an impactful hero section featuring a dramatic headline, animated gradient background, and prominent CTA. The hero takes 80% of viewport."),
        ("social_proof_focused", "Create a landing page emphasising social proof: featured testimonials from local businesses, Google review stars, 'trusted by X businesses in {city}', partner logos section."),
        ("roi_calculator_focused", "Create a landing page centered around an interactive ROI calculator showing how much money businesses lose from missed calls. Include the calculator HTML/JS inline."),
        ("comparison_focused", "Create a landing page built around a detailed comparison table: AI Voice Agent vs Human Receptionist vs Voicemail vs Answering Service. Clear visual winner."),
        ("video_demo_focused", "Create a landing page designed around a video demo section (placeholder), with a live widget demo area, step-by-step 'how it works', and quick-start CTA."),
    ]

    for domain, city, state, suburbs in city_domains:
        for variant_name, variant_instruction in variant_focuses:
            stories.append({
                "agent_id": agent_id,
                "category": "city_landing_pages",
                "category_num": 1,
                "task_title": f"{domain} - {variant_name}",
                "prompt": f"""Generate a COMPLETE, single-file HTML landing page for the domain: {domain}

**City:** {city}, {state}
**Local suburbs to reference:** {suburbs}
**Variant focus:** {variant_instruction}

The page MUST include ALL of the following sections:

1. **Hero Section**: "AI Chatbots for {city} Businesses" — compelling headline, subheadline about 24/7 availability, primary CTA button "Get Your AI Agent" linking to #pricing
2. **Problem Section**: Stats about missed calls costing {city} businesses money. Reference local economy.
3. **Solution Section**: How Sunaiva's AI Voice Widget solves this. 3 key benefits with icons (use Unicode/emoji icons).
4. **How It Works**: 3-step process (Sign Up -> Customise -> Go Live in 10 minutes)
5. **Local Testimonial**: A realistic testimonial from a {city} tradie. Include name, trade, suburb. E.g. "Dave M., Plumber, {suburbs.split(',')[0].strip()}"
6. **Pricing Section** (id="pricing"): 3 tiers:
   - Essentials $197/mo: 200 calls, 1 AI agent, business hours
   - Business $397/mo: 500 calls, 3 AI agents, 24/7, priority support
   - Growth $597/mo: Unlimited calls, unlimited agents, custom voice, dedicated account manager
   Each with a "Get Started" CTA button.
7. **FAQ Section**: 5 FAQs relevant to {city} businesses using AI
8. **Footer**: "Powered by Sunaiva" with links, phone placeholder (+61 X XXXX XXXX), ABN placeholder

**Technical requirements:**
- Complete <!DOCTYPE html> document with embedded <style> and no external dependencies
- Sunaiva dark theme: bg #0B0C0E, text #E5E7EB, accent #3B82F6, green accent #10B981
- Fully responsive (mobile-first, looks great on phones and desktops)
- Smooth scroll navigation
- Widget embed placeholder: `<div id="sunaiva-widget" data-widget-id="WIDGET_ID"></div>`
- SEO: proper <title>, <meta description>, Open Graph tags for {domain}
- Schema.org LocalBusiness JSON-LD markup for {city}
- Google Fonts: Inter for body, system-ui fallback
- Subtle animations (fade-in on scroll using IntersectionObserver)

Output the COMPLETE HTML file. Nothing else. No explanations before or after the HTML."""
            })
            agent_id += 1

    # =========================================================================
    # CATEGORY 2: Trade Landing Pages (50 agents)
    # 13 trade domains, ~4 agents per trade (some get 3, some get 4)
    # =========================================================================
    trade_domains = [
        ("plumberbots.com.au", "Plumber", "blocked drains, hot water systems, gas fitting, leak detection, bathroom renovations", "$350-$2,000", "burst pipe flooding a kitchen at 2am"),
        ("sparkybots.com.au", "Electrician", "safety switches, rewiring, LED upgrades, smoke alarms, EV charger installation", "$200-$1,500", "power outage during a heatwave"),
        ("hvacbots.com.au", "HVAC Technician", "split system installation, ducted AC, gas heating, AC servicing, refrigerant leaks", "$300-$5,000", "AC breaking down on a 42-degree day"),
        ("electricianbotai.au", "Electrician", "commercial electrical, switchboard upgrades, data cabling, emergency electrical, solar", "$500-$3,000", "tripped safety switch in a busy restaurant"),
        ("solarbotai.au", "Solar Installer", "solar panel installation, battery storage, solar hot water, system monitoring, grid connection", "$3,000-$15,000", "government rebate deadline driving 5x enquiries"),
        ("mechanicbot.au", "Mechanic", "car servicing, brake repair, battery replacement, diagnostics, pre-purchase inspection", "$150-$2,000", "car won't start on a Monday morning"),
        ("locksmithbot.au", "Locksmith", "emergency lockout, lock replacement, master key systems, safe opening, security audit", "$80-$500", "locked out of the house at midnight"),
        ("rooferbot.au", "Roofer", "roof restoration, tile replacement, metal roofing, gutter replacement, roof leak repair", "$500-$15,000", "storm damage with water pouring into the living room"),
        ("tradiechatbots.com.au", "General Tradie", "plumbing, electrical, building, painting, landscaping, fencing, concrete, roofing", "$200-$5,000", "homeowner needing multiple trades for a renovation"),
        ("tradiesvoice.com.au", "Tradie (Voice Focus)", "all trade services with voice-first customer interaction", "$200-$5,000", "tradie on the tools who literally cannot answer the phone"),
        ("tradieautomation.com.au", "Tradie (Automation Focus)", "job booking, quote follow-up, invoice reminders, review collection, scheduling", "$200-$5,000", "tradie spending 3 hours every night doing admin"),
        ("aitradie.au", "AI-Powered Tradie", "AI-enhanced quoting, smart scheduling, predictive maintenance, automated customer comms", "$200-$5,000", "tradie who wants to run a smarter, more efficient business"),
        ("tradiechatbot.com.au", "Tradie Chat", "text and voice chat for trade enquiries, instant quotes, booking confirmation", "$200-$5,000", "customer who just wants a quick answer at 9pm on a Sunday"),
    ]

    trade_variant_focuses = [
        ("pain_point", "Lead with the #1 pain point for this trade. Make it visceral. Every tradie reading should think 'that's me'."),
        ("roi_math", "Lead with hard ROI numbers. Show exactly how many missed calls = missed revenue. Use the job value range to calculate monthly/yearly loss."),
        ("comparison", "Build around a visual comparison: 'Your current setup' vs 'With AI Voice Agent'. Before/after columns showing the transformation."),
        ("emergency_focus", "Lead with emergency scenarios. This trade gets urgent calls. Show how AI handles emergencies instantly while the tradie is on another job."),
    ]

    trade_idx = 0
    for domain, trade, services, job_value, scenario in trade_domains:
        # Each trade gets 3-4 variants (50 total across 13 trades)
        # First 11 trades get 4, last 2 get 3
        num_variants = 4 if trade_idx < 11 else 3
        for v in range(num_variants):
            if v >= len(trade_variant_focuses):
                break
            variant_name, variant_instruction = trade_variant_focuses[v]
            stories.append({
                "agent_id": agent_id,
                "category": "trade_landing_pages",
                "category_num": 2,
                "task_title": f"{domain} - {variant_name}",
                "prompt": f"""Generate a COMPLETE, single-file HTML landing page for the domain: {domain}

**Trade:** {trade}
**Services:** {services}
**Average Job Value:** {job_value} AUD
**Emergency Scenario:** {scenario}
**Variant:** {variant_instruction}

The page MUST include ALL of the following:

1. **Hero Section**: "AI Voice Agent for {trade} Businesses" — trade-specific headline addressing their biggest pain point
2. **Pain Points Section**: 3 specific pain points for {trade} businesses:
   - Missing calls while on the tools
   - Losing emergency jobs to competitors who answer first
   - Spending evenings doing admin instead of being with family
3. **ROI Calculator Section**: Show the math:
   - Average {trade} gets 20 calls/week, misses 40% = 8 missed
   - Average job value {job_value}, 25% conversion = X jobs lost
   - Monthly revenue lost = $X,XXX. Sunaiva cost = $197/mo. ROI = X%
4. **Trade-Specific Features**: How the AI handles {trade}-specific enquiries:
   - Understands {services}
   - Collects job details (address, urgency, access info, photos)
   - Prioritises emergencies (like: {scenario})
   - Books jobs directly into your calendar
5. **Widget Demo Section**: Placeholder for live demo with sample conversation transcript showing a customer enquiry about {services.split(',')[0].strip()}
6. **Pricing**: 3 tiers (Essentials $197, Business $397, Growth $597) with trade-specific feature descriptions
7. **Testimonial**: Realistic quote from a {trade} using the AI widget
8. **FAQ**: 5 trade-specific questions
9. **CTA**: "Start Your Free Trial" prominent at top and bottom

**Technical requirements:**
- Complete single-file HTML with embedded CSS/JS
- Sunaiva dark theme (bg #0B0C0E, text #E5E7EB, accent #3B82F6, green #10B981)
- Mobile-responsive
- Trade-specific color accents where appropriate
- Schema.org Service + LocalBusiness JSON-LD
- Smooth scroll, subtle animations
- "Powered by Sunaiva" footer

Output ONLY the complete HTML. No explanations."""
            })
            agent_id += 1
        trade_idx += 1

    # Pad to exactly 50 if needed
    while agent_id <= 100:
        stories.append({
            "agent_id": agent_id,
            "category": "trade_landing_pages",
            "category_num": 2,
            "task_title": f"tradiechatbots.com.au - bonus variant {agent_id - 94}",
            "prompt": f"""Generate a COMPLETE, single-file HTML landing page for tradiechatbots.com.au.

Focus: A/B test variant #{agent_id - 94} — Try a completely different layout approach.
Ideas: single long-scroll story format, or card-based grid, or conversational/chat-style page.

Must include: hero, pain points, pricing (Essentials $197, Business $397, Growth $597), testimonial, FAQ, CTA.
Sunaiva dark theme (bg #0B0C0E, text #E5E7EB, accent #3B82F6).
Mobile responsive. Complete single-file HTML. No external dependencies.
Trade focus: Australian tradies (plumbers, electricians, builders, etc.)
"Powered by Sunaiva" footer. Output ONLY the HTML."""
        })
        agent_id += 1

    # =========================================================================
    # CATEGORY 3: Industry Landing Pages (50 agents)
    # 9 industry domains x ~5 agents each
    # =========================================================================
    industry_domains = [
        ("receptionistai.au", "AI Receptionist", "General business reception", "medical clinics, law firms, real estate, dental, accounting", "HIPAA-like privacy for AU (Privacy Act 1988), professional tone", 6),
        ("beautybot.com.au", "Beauty & Salon", "Beauty salon and spa reception", "hair salons, nail studios, day spas, skin clinics, barber shops", "Booking-focused, appointment reminders, product upsells", 6),
        ("propertybotai.au", "Real Estate", "Property management and sales", "real estate agents, property managers, buyer's agents, auctioneers", "Property listing info, open home bookings, tenant enquiries", 6),
        ("dentalbotai.au", "Dental", "Dental practice reception", "general dentistry, orthodontics, cosmetic dentistry, emergency dental", "Patient privacy (Privacy Act), appointment scheduling, insurance questions", 6),
        ("clinicaibot.au", "Medical Clinic", "Medical practice reception", "GP clinics, specialist clinics, allied health, physio, chiro", "Strict privacy compliance, triage questions, Medicare/bulk billing info", 6),
        ("lawyerbot.au", "Legal", "Law firm reception", "family law, criminal law, conveyancing, wills & estates, commercial law", "Client confidentiality, conflict checks, consultation booking", 5),
        ("legalbotai.au", "Legal (Premium)", "Premium legal reception", "barristers, top-tier firms, corporate law, litigation, IP law", "Professional prestige, client intake, matter classification", 5),
        ("rentbot.au", "Rental/Property Management", "Rental property management", "property managers, real estate rentals, tenant services, landlord services", "Maintenance requests, inspection booking, tenant screening", 5),
        ("bookingbot.au", "Booking Services", "General booking and scheduling", "restaurants, salons, medical, trades, events, consultations", "Calendar integration, availability checking, confirmation/reminders", 5),
    ]

    for domain, industry, description, examples, compliance_notes, num_agents in industry_domains:
        for v in range(num_agents):
            variant_angles = [
                "compliance-focused (emphasise privacy, security, data handling)",
                "booking-focused (emphasise appointment scheduling and calendar management)",
                "cost-savings-focused (compare to hiring a full-time receptionist at $55K/yr)",
                "after-hours-focused (emphasise 24/7 coverage, never miss a patient/client call)",
                "professional-image-focused (emphasise brand perception, premium voice quality)",
                "multi-location-focused (emphasise scaling across multiple offices/branches)",
            ]
            angle = variant_angles[v % len(variant_angles)]
            stories.append({
                "agent_id": agent_id,
                "category": "industry_landing_pages",
                "category_num": 3,
                "task_title": f"{domain} - variant {v+1}",
                "prompt": f"""Generate a COMPLETE, single-file HTML landing page for: {domain}

**Industry:** {industry}
**Description:** {description}
**Example businesses:** {examples}
**Compliance notes:** {compliance_notes}
**Angle for this variant:** {angle}

The page MUST include:

1. **Hero**: "{industry} AI Voice Agent" — industry-specific headline
2. **Industry Pain Points**: 3 pain points specific to {industry} businesses (missed calls during consultations, overwhelmed reception, after-hours enquiries)
3. **Compliance Section**: How the AI handles {compliance_notes}. Trust badges, security certifications placeholder, data sovereignty (Australian servers).
4. **Feature Grid**: 6 features tailored to {industry}:
   - Appointment scheduling
   - Emergency triage/prioritisation
   - Client/patient intake
   - After-hours coverage
   - Multi-language support
   - Integration with industry software
5. **Cost Savings Calculator**: $55K/yr receptionist vs $197/mo AI = $52,636 saved
6. **Testimonial**: From a realistic {industry} business owner
7. **Pricing**: 3 tiers ($197/$397/$597)
8. **FAQ**: 5 industry-specific questions (including compliance/privacy)
9. **Trust Section**: "Trusted by [X]+ {industry} businesses across Australia"

**Technical:**
- Single-file HTML, Sunaiva dark theme (#0B0C0E, #E5E7EB, #3B82F6, #10B981)
- Mobile responsive, smooth scroll
- Industry-appropriate accent color alongside Sunaiva blue
- Schema.org markup for {industry}
- "Powered by Sunaiva" footer

Output ONLY the complete HTML."""
            })
            agent_id += 1

    # =========================================================================
    # CATEGORY 4: Voice/Receptionist Landing Pages (50 agents)
    # 5 voice domains x 10 agents each
    # =========================================================================
    voice_domains = [
        ("voiceassistant.com.au", "Voice Assistant", "Generic voice AI assistant for Australian businesses"),
        ("voiceassistant.au", "Voice Assistant (Premium)", "Premium .au voice assistant brand"),
        ("aivoicereceptionist.au", "AI Voice Receptionist", "Dedicated AI receptionist replacing human reception"),
        ("phonebot.au", "Phone Bot", "AI-powered phone answering for any business"),
        ("talkbot.au", "Talk Bot", "Conversational AI for websites and phones"),
    ]

    voice_variant_angles = [
        ("human_vs_ai", "Deep-dive comparison: Human Receptionist vs AI. Side-by-side table with 15+ comparison points. Monthly cost, availability, consistency, scalability, training time, sick days, holidays, accuracy, languages, etc."),
        ("cost_savings_deep", "Full cost savings analysis over 1, 3, and 5 years. Include: salary, super, leave loading, training, recruitment, desk space, phone system, management overhead. Show total cost of human = $65-85K/yr fully loaded vs AI = $2,364-$7,164/yr."),
        ("technology_explainer", "How AI voice technology actually works. Explain in simple terms: speech recognition, natural language understanding, voice synthesis. Include audio quality comparison section. Demystify AI for sceptical business owners."),
        ("use_case_showcase", "10 real-world use cases: emergency plumber, dental appointment, legal intake, real estate enquiry, restaurant booking, salon appointment, medical triage, trade quote request, after-hours message, complaint handling. Show sample conversations for each."),
        ("speed_and_scale", "Focus on speed: AI answers in 0.5 seconds (vs 15+ seconds for human). Scale: handle 100 simultaneous calls (vs 1 for human). Zero hold time. Zero wait music. Instant professional response every time."),
        ("after_hours_hero", "Focus entirely on after-hours: 68% of calls to small businesses come outside business hours. Show hourly distribution chart. Every missed after-hours call = revenue lost to the competitor who answers. AI never sleeps."),
        ("integration_showcase", "Focus on integrations: Google Calendar, CRM, SMS notifications, email summaries, Zapier, Make.com, custom webhooks. Show how AI plugs into existing business workflow. No disruption, instant value."),
        ("voice_quality_demo", "Focus on voice quality and naturalness. Describe the Australian accent, conversational tone, ability to handle interruptions, understand slang, manage accents. Include sample transcript showing natural conversation flow."),
        ("business_growth", "Position AI voice as a growth lever, not just cost savings. More calls answered = more leads captured = more revenue. Growth math: 10 extra calls/week x 25% conversion x $400 avg job = $52K/yr extra revenue."),
        ("trust_and_security", "Focus on trust: Australian data sovereignty, encryption, Privacy Act compliance, no call recording without consent, SOC2-equivalent security, custom AI training, full audit trail. Address every trust objection head-on."),
    ]

    for domain, product_name, description in voice_domains:
        for v_idx, (variant_name, variant_detail) in enumerate(voice_variant_angles):
            stories.append({
                "agent_id": agent_id,
                "category": "voice_receptionist_landing_pages",
                "category_num": 4,
                "task_title": f"{domain} - {variant_name}",
                "prompt": f"""Generate a COMPLETE, single-file HTML landing page for: {domain}

**Product:** {product_name}
**Description:** {description}
**Variant focus:** {variant_detail}

This is a VOICE/RECEPTIONIST focused landing page. The core message is:
"Replace your $55K/year receptionist with a $197/month AI that never calls in sick,
never takes a lunch break, and answers every single call in under 1 second."

The page MUST include:

1. **Hero**: Dramatic headline about {product_name}. Cost comparison front and center: ~~$30K/yr~~ vs $197/mo.
2. **The Problem**: Australian small businesses miss 62% of calls. Each missed call = $XXX lost (varies by industry).
3. **Variant-Specific Section**: {variant_detail}
4. **Live Demo Area**: Widget embed placeholder + sample conversation transcript showing a realistic customer interaction.
5. **Cost Savings Calculator**: Interactive section showing:
   - Human receptionist: $55K salary + $5K super + $3K leave + $2K training + $1K recruitment = $66K/yr
   - AI Voice Agent: $197/mo x 12 = $2,364/yr
   - You save: $63,636/yr
6. **Pricing**: 3 tiers ($197/$397/$597) with clear feature differentiation
7. **Trust Badges**: Australian-owned, Australian servers, Privacy Act compliant, 99.9% uptime, 24/7 support
8. **Testimonials**: 3 realistic testimonials from different industries
9. **FAQ**: 7 questions including "What if the AI can't answer?" and "Can customers tell it's AI?"
10. **Final CTA**: "Start your free 14-day trial. No credit card required."

**Technical:**
- Single-file HTML, Sunaiva dark theme
- Mobile responsive, performance optimized
- Schema.org SoftwareApplication + FAQPage markup
- Open Graph tags for social sharing
- "Powered by Sunaiva" footer
- Smooth animations, professional design

Output ONLY the complete HTML."""
            })
            agent_id += 1

    # =========================================================================
    # CATEGORY 5: City SEO Blog Posts (50 agents)
    # 10 cities x 5 posts each
    # =========================================================================
    cities_for_blogs = [
        ("Sydney", "NSW", "Parramatta, Bondi Junction, Chatswood, Liverpool, Penrith, Blacktown, Manly, Surry Hills"),
        ("Brisbane", "QLD", "Southbank, Fortitude Valley, Chermside, Mt Gravatt, Carindale, Paddington, West End, Bulimba"),
        ("Melbourne", "VIC", "Richmond, South Yarra, Brunswick, Dandenong, Frankston, St Kilda, Collingwood, Fitzroy"),
        ("Adelaide", "SA", "Glenelg, Norwood, Prospect, Modbury, Elizabeth, Unley, Burnside, Semaphore"),
        ("Cairns", "QLD", "Edge Hill, Whitfield, Smithfield, Palm Cove, Trinity Beach, Gordonvale, Mareeba"),
        ("Sunshine Coast", "QLD", "Maroochydore, Caloundra, Noosa, Buderim, Mooloolaba, Coolum, Nambour"),
        ("Townsville", "QLD", "Aitkenvale, Kirwan, Thuringowa, Garbutt, Belgian Gardens, North Ward, Castle Hill"),
        ("Darwin", "NT", "Stuart Park, Fannie Bay, Parap, Palmerston, Casuarina, Nightcliff, Winnellie"),
        ("Perth", "WA", "Subiaco, Fremantle, Joondalup, Rockingham, Midland, Cannington, Morley, Scarborough"),
        ("Gold Coast", "QLD", "Surfers Paradise, Broadbeach, Burleigh Heads, Robina, Southport, Coomera, Nerang"),
    ]

    blog_templates_city = [
        "Best AI Chatbot Solutions in {city} 2026",
        "Why {city} Businesses Are Switching to AI Voice Agents",
        "{city} Small Business Guide: AI Customer Service in 2026",
        "How {city} Tradies Are Using AI to Never Miss a Call",
        "The Top 5 AI Tools Every {city} Business Owner Needs",
    ]

    for city, state, suburbs in cities_for_blogs:
        for template in blog_templates_city:
            title = template.format(city=city)
            stories.append({
                "agent_id": agent_id,
                "category": "city_seo_blog_posts",
                "category_num": 5,
                "task_title": f"Blog: {title[:50]}",
                "prompt": f"""Write a COMPLETE, publish-ready SEO blog post.

**Title:** {title}
**Target city:** {city}, {state}
**Local suburbs to mention:** {suburbs}

Requirements:
1. **Length**: 800-1,200 words
2. **SEO**: Target keyword naturally 3-5 times, H2/H3 headings, internal link suggestions
3. **Meta description**: 155 chars max
4. **URL slug**: kebab-case
5. **Tone**: Conversational Australian English, written for business owners not tech people
6. **Structure**:
   - Opening hook referencing {city} specifically (mention a suburb, landmark, or local quirk)
   - Problem: {city} businesses missing calls, losing revenue to competitors
   - Local stats: reference {city}'s economy, number of small businesses, growth
   - Solution: AI Voice Agents from Sunaiva
   - Local case study: realistic {city}-based business testimonial (name, suburb, trade)
   - Feature highlights relevant to {city} businesses
   - FAQ section: 3 questions with answers
   - CTA: "Join 100+ {city} businesses already using Sunaiva"
7. **Local SEO signals**: Mention {city} 5-8 times, mention 3+ suburbs, reference {state}, reference Australian context
8. **Schema suggestion**: FAQPage + Article + LocalBusiness
9. **Internal links**: Suggest links to pricing page, demo page, and related city pages

Write the COMPLETE blog post, not an outline. Make it publish-ready.
End with: "Powered by Sunaiva - AI Voice Agents for Australian Businesses"."""
            })
            agent_id += 1

    # =========================================================================
    # CATEGORY 6: Trade SEO Blog Posts (50 agents)
    # 13 trades x ~4 posts each
    # =========================================================================
    trades_for_blogs = [
        ("Plumber", "plumbing", "$350-$2,000", "burst pipes, blocked drains, hot water failure"),
        ("Electrician", "electrical", "$200-$1,500", "safety switch trips, power outages, smoke alarm beeping"),
        ("HVAC Technician", "HVAC", "$300-$5,000", "AC breakdown in summer, heater failure in winter"),
        ("Builder", "building/construction", "$5,000-$100,000", "renovation delays, approval issues"),
        ("Painter", "painting", "$500-$3,000", "weather delays, colour changes, prep work"),
        ("Roofer", "roofing", "$500-$15,000", "storm damage, leaks, tile cracking"),
        ("Landscaper", "landscaping", "$1,000-$10,000", "seasonal rush, irrigation failures"),
        ("Solar Installer", "solar", "$3,000-$15,000", "rebate deadlines, system monitoring alerts"),
        ("Locksmith", "locksmith", "$80-$500", "emergency lockouts, security breaches"),
        ("Concreter", "concreting", "$1,000-$8,000", "weather-dependent scheduling"),
        ("Pool Builder", "pool building", "$20,000-$80,000", "council approvals, seasonal demand"),
        ("Fencer", "fencing", "$500-$5,000", "storm damage, neighbour disputes"),
        ("Tree Service", "tree services", "$200-$3,000", "storm aftermath, council removal programs"),
    ]

    blog_templates_trade = [
        "How AI Voice Agents Save {trade} Businesses $50K/Year",
        "The {trade}'s Guide to Never Missing a Customer Call",
        "Why Smart {trade}s Are Investing in AI Reception",
        "Emergency {industry} Calls: How AI Handles Them Better Than Voicemail",
    ]

    for trade, industry, job_value, scenarios in trades_for_blogs:
        templates = blog_templates_trade[:4] if trades_for_blogs.index((trade, industry, job_value, scenarios)) < 11 else blog_templates_trade[:3]
        for template in templates:
            title = template.format(trade=trade, industry=industry)
            stories.append({
                "agent_id": agent_id,
                "category": "trade_seo_blog_posts",
                "category_num": 6,
                "task_title": f"Blog: {title[:50]}",
                "prompt": f"""Write a COMPLETE, publish-ready SEO blog post.

**Title:** {title}
**Trade:** {trade}
**Industry:** {industry}
**Average job value:** {job_value}
**Common emergency scenarios:** {scenarios}

Requirements:
1. **Length**: 800-1,200 words
2. **SEO optimised** with target keyword naturally placed 3-5 times
3. **Meta description**: 155 chars max
4. **URL slug**: kebab-case
5. **ROI Math** (MUST include specific calculations):
   - Average {trade} gets 25 calls/week
   - Misses 40% = 10 missed calls/week
   - Average job value {job_value} (use midpoint)
   - 25% of missed calls would have converted
   - Monthly lost revenue = [calculate]
   - Yearly lost revenue = [calculate]
   - Sunaiva cost = $197/mo = $2,364/yr
   - ROI = [calculate]%
6. **Trade-specific scenarios**: How AI handles {scenarios}
7. **Case study**: Realistic {trade} testimonial with name, city, specific results
8. **FAQ**: 3 trade-specific questions
9. **CTA**: "Start capturing every {industry} lead today"

Australian English. Practical tone. Written for tradies, not tech people.
Complete blog post, not an outline. Publish-ready."""
            })
            agent_id += 1

    # Pad to agent 300 if needed
    while agent_id <= 300:
        stories.append({
            "agent_id": agent_id,
            "category": "trade_seo_blog_posts",
            "category_num": 6,
            "task_title": f"Blog: AI for Tradies - bonus {agent_id - 295}",
            "prompt": f"""Write a COMPLETE, publish-ready SEO blog post about AI voice technology for Australian tradies.
Title: "AI Voice Agents: The Unfair Advantage Aussie Tradies Don't Talk About (Part {agent_id - 295})"
Focus on a unique angle: {['work-life balance', 'scaling from solo to team', 'handling seasonal rushes', 'competing with bigger companies', 'getting better Google reviews'][( agent_id - 296) % 5]}.
800-1200 words, Australian English, ROI math included, realistic case study, FAQ section, CTA.
Meta description (155 chars), URL slug, schema suggestions."""
        })
        agent_id += 1

    # =========================================================================
    # CATEGORY 7: Industry SEO Blog Posts (50 agents)
    # 9 industries x ~5-6 posts each
    # =========================================================================
    industries_for_blogs = [
        ("Medical Clinic", "medical practice", "patient privacy, Medicare, bulk billing, appointment scheduling", "clinicaibot.au"),
        ("Dental Practice", "dental", "patient privacy, emergency dental, cosmetic consultations, insurance", "dentalbotai.au"),
        ("Real Estate", "real estate", "property enquiries, open home bookings, tenant requests, vendor updates", "propertybotai.au"),
        ("Legal / Law Firm", "legal", "client confidentiality, conflict checks, consultation booking, court dates", "lawyerbot.au"),
        ("Beauty / Salon", "beauty salon", "appointment booking, product enquiries, cancellation handling, loyalty programs", "beautybot.com.au"),
        ("Rental / Property Management", "property management", "maintenance requests, inspection scheduling, tenant screening, landlord reporting", "rentbot.au"),
        ("General Reception", "business reception", "call routing, message taking, appointment scheduling, FAQ handling", "receptionistai.au"),
        ("Booking Services", "booking", "calendar management, availability checking, confirmation, rescheduling", "bookingbot.au"),
        ("Veterinary", "veterinary", "pet emergencies, vaccination scheduling, medication refills, boarding enquiries", "receptionistai.au"),
    ]

    blog_templates_industry = [
        "Why {industry} Businesses Need AI Reception in 2026",
        "The Complete Guide to AI Voice Agents for {industry}",
        "How AI Receptionists Handle {industry} Compliance",
        "{industry} After Hours: Why AI Captures the Calls Humans Can't",
        "5 Ways AI Voice Agents Transform {industry} Customer Service",
        "The ROI of AI Reception for {industry}: A Data-Driven Analysis",
    ]

    for industry_name, industry_key, compliance, domain in industries_for_blogs:
        num_posts = 6 if industries_for_blogs.index((industry_name, industry_key, compliance, domain)) < 5 else 5
        for t_idx in range(num_posts):
            template = blog_templates_industry[t_idx % len(blog_templates_industry)]
            title = template.format(industry=industry_name)
            stories.append({
                "agent_id": agent_id,
                "category": "industry_seo_blog_posts",
                "category_num": 7,
                "task_title": f"Blog: {title[:50]}",
                "prompt": f"""Write a COMPLETE, publish-ready SEO blog post.

**Title:** {title}
**Industry:** {industry_name}
**Target domain:** {domain}
**Compliance considerations:** {compliance}

Requirements:
1. **Length**: 800-1,200 words
2. **Industry-specific** content — not generic AI content repurposed
3. **Compliance section**: How AI handles {compliance}
4. **Australian context**: Reference Australian regulations, standards, and business practices
5. **Case study**: Realistic Australian {industry_key} business using AI reception
6. **Competitor comparison**: Why AI beats traditional reception for {industry_key}
7. **FAQ**: 3 questions including compliance/privacy
8. **Meta description** + **URL slug**
9. **Schema**: Article + FAQPage + relevant industry schema

Australian English. Professional tone appropriate for {industry_key} audience.
Complete post. Publish-ready. End with CTA to visit {domain}."""
            })
            agent_id += 1

    # Pad to 350
    while agent_id <= 350:
        stories.append({
            "agent_id": agent_id,
            "category": "industry_seo_blog_posts",
            "category_num": 7,
            "task_title": f"Blog: Industry AI bonus {agent_id - 345}",
            "prompt": f"""Write a COMPLETE SEO blog post: "How AI is Revolutionising {['Accounting Firms', 'Physiotherapy Clinics', 'Chiropractic Offices', 'Financial Planning Firms', 'Architecture Studios'][(agent_id - 346) % 5]} in Australia (2026)".
800-1200 words, Australian English, compliance-aware, case study, FAQ, CTA to receptionistai.au.
Meta description, URL slug, schema markup suggestions."""
        })
        agent_id += 1

    # =========================================================================
    # CATEGORY 8: Google Ads Copy (50 agents)
    # Ads for city, trade, industry, and voice domains
    # =========================================================================
    ad_targets = [
        # City ads (10)
        ("city", "Sydney", "sydneychatbots.com.au", "AI chatbot Sydney, Sydney business chatbot, AI customer service Sydney"),
        ("city", "Brisbane", "brisbanechatbots.com.au", "AI chatbot Brisbane, Brisbane business chatbot, AI customer service Brisbane"),
        ("city", "Melbourne", "melbournechatbots.com.au", "AI chatbot Melbourne, Melbourne business chatbot, AI customer service Melbourne"),
        ("city", "Adelaide", "adelaidechatbots.com.au", "AI chatbot Adelaide, Adelaide business AI, AI reception Adelaide"),
        ("city", "Cairns", "cairnschatbots.com.au", "AI chatbot Cairns, Cairns business AI, AI reception Cairns"),
        ("city", "Sunshine Coast", "sunshinecoastchatbots.com.au", "AI chatbot Sunshine Coast, Sunshine Coast AI, business chatbot Sunshine Coast"),
        ("city", "Perth", "voiceassistant.com.au", "AI voice assistant Perth, Perth business AI, AI reception Perth"),
        ("city", "Gold Coast", "aichatbotsaustralia.au", "AI chatbot Gold Coast, Gold Coast business AI, AI reception Gold Coast"),
        ("city", "Darwin", "darwinchatbots.com.au", "AI chatbot Darwin, Darwin business AI, AI reception Darwin"),
        ("city", "Townsville", "townsvillechatbots.com.au", "AI chatbot Townsville, Townsville business AI"),
        # Trade ads (15)
        ("trade", "Plumber", "plumberbots.com.au", "AI for plumbers, plumber answering service, plumber phone AI"),
        ("trade", "Electrician", "sparkybots.com.au", "AI for electricians, electrician answering service, sparky phone AI"),
        ("trade", "HVAC", "hvacbots.com.au", "AI for HVAC, HVAC answering service, air conditioning phone AI"),
        ("trade", "Builder", "tradiechatbots.com.au", "AI for builders, builder phone answering, construction AI"),
        ("trade", "Roofer", "rooferbot.au", "AI for roofers, roofing answering service, roofer phone AI"),
        ("trade", "Solar", "solarbotai.au", "AI for solar installers, solar phone answering, solar lead capture"),
        ("trade", "Locksmith", "locksmithbot.au", "AI for locksmiths, locksmith answering service, emergency locksmith AI"),
        ("trade", "Mechanic", "mechanicbot.au", "AI for mechanics, mechanic phone answering, auto repair AI"),
        ("trade", "Landscaper", "tradiechatbots.com.au", "AI for landscapers, landscaping phone AI, garden service AI"),
        ("trade", "Painter", "tradiechatbots.com.au", "AI for painters, painting business AI, painter phone answering"),
        ("trade", "Concreter", "tradiechatbots.com.au", "AI for concreters, concrete business AI, concreter phone"),
        ("trade", "Fencer", "tradiechatbots.com.au", "AI for fencers, fencing business AI, fence quote AI"),
        ("trade", "Pool Builder", "tradiechatbots.com.au", "AI for pool builders, pool business AI, pool quote AI"),
        ("trade", "Tree Service", "tradiechatbots.com.au", "AI for arborists, tree service AI, tree lopper phone"),
        ("trade", "General Tradie", "tradiechatbots.com.au", "AI for tradies, tradie phone answering, tradie AI assistant"),
        # Industry ads (15)
        ("industry", "Medical Clinic", "clinicaibot.au", "AI for medical clinics, clinic phone AI, doctor receptionist AI"),
        ("industry", "Dental", "dentalbotai.au", "AI for dental, dental receptionist AI, dentist phone AI"),
        ("industry", "Real Estate", "propertybotai.au", "AI for real estate, property phone AI, real estate receptionist"),
        ("industry", "Legal", "lawyerbot.au", "AI for lawyers, law firm phone AI, legal receptionist AI"),
        ("industry", "Beauty/Salon", "beautybot.com.au", "AI for salons, beauty salon phone AI, salon booking AI"),
        ("industry", "Property Management", "rentbot.au", "AI for property managers, rental phone AI, tenant AI"),
        ("industry", "Veterinary", "receptionistai.au", "AI for vets, vet phone AI, veterinary receptionist AI"),
        ("industry", "Accounting", "receptionistai.au", "AI for accountants, accounting phone AI, accountant receptionist"),
        ("industry", "Physiotherapy", "receptionistai.au", "AI for physio, physiotherapy phone AI, physio booking AI"),
        ("industry", "Restaurant", "bookingbot.au", "AI for restaurants, restaurant phone AI, restaurant booking AI"),
        ("industry", "Chiropractor", "receptionistai.au", "AI for chiropractors, chiro phone AI, chiro booking"),
        ("industry", "Financial Planning", "receptionistai.au", "AI for financial planners, finance phone AI"),
        ("industry", "Architecture", "receptionistai.au", "AI for architects, architecture firm AI"),
        ("industry", "Photography", "bookingbot.au", "AI for photographers, photography booking AI"),
        ("industry", "Fitness/Gym", "bookingbot.au", "AI for gyms, fitness booking AI, gym phone AI"),
        # Voice/receptionist ads (10)
        ("voice", "AI Voice Assistant", "voiceassistant.com.au", "AI voice assistant, business voice AI, phone AI assistant"),
        ("voice", "AI Receptionist", "aivoicereceptionist.au", "AI receptionist, virtual receptionist AI, AI phone answering"),
        ("voice", "Phone Bot", "phonebot.au", "phone bot, AI phone bot, automated phone answering"),
        ("voice", "Talk Bot", "talkbot.au", "talk bot, AI talk bot, conversational AI phone"),
        ("voice", "Booking Bot", "bookingbot.au", "booking bot, AI booking, automated booking system"),
        ("voice", "Voice Receptionist", "aivoicereceptionist.au", "voice receptionist, AI voice receptionist, virtual voice receptionist"),
        ("voice", "After Hours AI", "voiceassistant.au", "after hours answering, after hours AI, 24/7 phone answering"),
        ("voice", "Missed Call Solution", "phonebot.au", "missed call solution, never miss a call, missed call AI"),
        ("voice", "Virtual Receptionist", "receptionistai.au", "virtual receptionist Australia, AI virtual receptionist"),
        ("voice", "24/7 Answering", "voiceassistant.com.au", "24/7 answering service, 24/7 phone answering AI"),
    ]

    for ad_type, target_name, domain, keywords in ad_targets:
        stories.append({
            "agent_id": agent_id,
            "category": "google_ads_copy",
            "category_num": 8,
            "task_title": f"Google Ads: {target_name} ({ad_type})",
            "prompt": f"""Create a complete Google Ads campaign package for:

**Type:** {ad_type}
**Target:** {target_name}
**Landing page domain:** {domain}
**Primary keywords:** {keywords}

Generate ALL of the following:

1. **Responsive Search Ad (RSA)** — the main ad:
   - 15 headlines (max 30 chars each). Mix: keyword-focused, benefit-focused, CTA-focused, number-focused, urgency-focused
   - 4 descriptions (max 90 chars each). Mix: value prop, social proof, CTA, differentiator
   - Display URL paths (2 paths, 15 chars each)
   - Final URL: https://{domain}

2. **3 Headline Variants** for A/B testing:
   - Variant A: Benefit-focused
   - Variant B: Problem-focused
   - Variant C: Social proof-focused

3. **Ad Extensions:**
   - 4 sitelink extensions with descriptions
   - 4 callout extensions
   - 2 structured snippets
   - Call extension number placeholder
   - Price extension (3 tiers)

4. **Keyword Strategy:**
   - 10 exact match keywords [keyword]
   - 10 phrase match keywords "keyword"
   - 10 broad match keywords
   - 15 negative keywords to exclude

5. **Audience Targeting Suggestions:**
   - In-market audiences
   - Custom intent audiences (URLs + search terms)
   - Demographic targeting
   - Geographic targeting (specific to {target_name})

6. **Budget Recommendation:**
   - Suggested daily budget (AUD)
   - Expected CPC range
   - Expected conversion rate
   - Estimated monthly leads

All in Australian English, AUD pricing. Practical and ready to paste into Google Ads.
Format as structured text with clear section headers."""
        })
        agent_id += 1

    # =========================================================================
    # CATEGORY 9: Meta Descriptions & Title Tags (50 agents)
    # All 73 domains + bonus pages
    # =========================================================================
    all_domains_for_seo = [
        # Tier 1: Flagship (5)
        ("sunaiva.ai", "Enterprise AI platform", "Enterprise"),
        ("sunaiva.com", "AI Memory MCP platform", "Product"),
        ("sunaiva.com.au", "Australian AI solutions", "Local"),
        ("sunaivadigital.com", "Talking Widget platform", "Product"),
        ("sunaivaradar.com", "Free AI business audit", "Lead Magnet"),
        # Tier 2: Product (8)
        ("sunaivaagent.com", "AI Agent platform", "Product"),
        ("sunaivaagents.com", "AI Agents marketplace", "Product"),
        ("sunaivacore.com", "Core AI platform", "Product"),
        ("sunaivacore.com.au", "Core AI platform (AU)", "Product"),
        ("sunaivaflow.com", "Workflow automation", "Product"),
        ("sunaivaflow.com.au", "Workflow automation (AU)", "Product"),
        ("sunaivasites.com", "AI website builder", "Product"),
        ("sunaivasites.com.au", "AI website builder (AU)", "Product"),
        # Tier 3: Orchestration (6)
        ("orchestr8ai.com", "AI orchestration", "Brand"),
        ("orchestraflow.com", "Workflow orchestration", "Brand"),
        ("orchestramaestro.com", "AI orchestration", "Brand"),
        ("optimalorchestra.com", "AI orchestration", "Brand"),
        ("symphonyagents.com", "Multi-agent AI", "Brand"),
        ("synflowai.com", "AI workflow", "Brand"),
        # Tier 4: City EMDs (10)
        ("sydneychatbots.com.au", "AI Chatbots Sydney", "City SEO"),
        ("brisbanechatbots.com.au", "AI Chatbots Brisbane", "City SEO"),
        ("melbournechatbots.com.au", "AI Chatbots Melbourne", "City SEO"),
        ("adelaidechatbots.com.au", "AI Chatbots Adelaide", "City SEO"),
        ("cairnschatbots.com.au", "AI Chatbots Cairns", "City SEO"),
        ("sunshinecoastchatbots.com.au", "AI Chatbots Sunshine Coast", "City SEO"),
        ("townsvillechatbots.com.au", "AI Chatbots Townsville", "City SEO"),
        ("darwinchatbots.com.au", "AI Chatbots Darwin", "City SEO"),
        ("aichatbotsbrisbane.au", "AI Chatbots Brisbane", "City SEO"),
        ("aichatbotsaustralia.au", "AI Chatbots Australia", "National SEO"),
        # Tier 5: Trade EMDs (13)
        ("tradiechatbots.com.au", "AI for Tradies", "Trade SEO"),
        ("tradiechatbot.com.au", "Tradie Chatbot", "Trade SEO"),
        ("tradiesvoice.com.au", "Voice AI for Tradies", "Trade SEO"),
        ("tradieautomation.com.au", "Tradie Automation", "Trade SEO"),
        ("aitradie.au", "AI for Tradies", "Trade SEO"),
        ("sparkybots.com.au", "AI for Electricians", "Trade SEO"),
        ("plumberbots.com.au", "AI for Plumbers", "Trade SEO"),
        ("hvacbots.com.au", "AI for HVAC", "Trade SEO"),
        ("electricianbotai.au", "Electrician AI Bot", "Trade SEO"),
        ("solarbotai.au", "Solar AI Bot", "Trade SEO"),
        ("mechanicbot.au", "Mechanic AI Bot", "Trade SEO"),
        ("locksmithbot.au", "Locksmith AI Bot", "Trade SEO"),
        ("rooferbot.au", "Roofer AI Bot", "Trade SEO"),
        # Tier 6: Industry EMDs (9)
        ("receptionistai.au", "AI Receptionist", "Industry SEO"),
        ("beautybot.com.au", "Beauty Salon AI", "Industry SEO"),
        ("propertybotai.au", "Real Estate AI", "Industry SEO"),
        ("dentalbotai.au", "Dental AI", "Industry SEO"),
        ("clinicaibot.au", "Medical Clinic AI", "Industry SEO"),
        ("lawyerbot.au", "Lawyer AI", "Industry SEO"),
        ("legalbotai.au", "Legal AI", "Industry SEO"),
        ("rentbot.au", "Rental AI", "Industry SEO"),
        ("bookingbot.au", "Booking AI", "Industry SEO"),
        # Tier 7: Voice EMDs (6)
        ("voiceassistant.com.au", "Voice Assistant AU", "Voice SEO"),
        ("voiceassistant.au", "Voice Assistant", "Voice SEO"),
        ("aivoicereceptionist.au", "AI Voice Receptionist", "Voice SEO"),
        ("phonebot.au", "Phone Bot", "Voice SEO"),
        ("talkbot.au", "Talk Bot", "Voice SEO"),
    ]

    # Process all domains — 1 agent per domain = 53 agents. Pad rest with subpages.
    for domain, description, category in all_domains_for_seo[:50]:
        stories.append({
            "agent_id": agent_id,
            "category": "meta_descriptions_seo",
            "category_num": 9,
            "task_title": f"SEO metadata: {domain}",
            "prompt": f"""Generate COMPLETE SEO metadata package for the domain: {domain}

**Description:** {description}
**Category:** {category}

Generate ALL of the following for the HOMEPAGE:

1. **Title Tag** (max 60 chars): Include primary keyword + brand
2. **Meta Description** (max 155 chars): Compelling, include CTA, include keyword
3. **Open Graph Tags**:
   - og:title (max 60 chars)
   - og:description (max 200 chars)
   - og:type
   - og:url
   - og:image (describe what the image should show)
   - og:locale (en_AU)
4. **Twitter Card Tags**:
   - twitter:card (summary_large_image)
   - twitter:title
   - twitter:description
5. **H1 Tag**: Primary heading for homepage
6. **H2 Tags**: 5 suggested section headings
7. **Schema.org JSON-LD** (complete, valid JSON):
   - Organization schema for Sunaiva
   - WebSite schema with SearchAction
   - LocalBusiness schema (if applicable)
   - Service schema
   - FAQPage schema (3 FAQs)
   - BreadcrumbList schema
8. **Canonical URL**: https://{domain}/
9. **Robots meta**: index, follow
10. **Hreflang**: If .com.au/.au pair exists, include hreflang tags
11. **Sitemap suggestion**: List 8-10 key pages to include
12. **Internal linking strategy**: 5 suggested internal links with anchor text
13. **Image alt text**: 5 key images with optimised alt text

Also generate SEO metadata for these subpages:
- /pricing
- /how-it-works
- /contact
- /demo

Format as structured text ready to implement. Include the actual HTML meta tags that can be copy-pasted."""
        })
        agent_id += 1

    # =========================================================================
    # CATEGORY 10: Email Sequences Per Vertical (50 agents)
    # 3-email sequences for various verticals
    # =========================================================================
    email_verticals = [
        # Trade verticals (20)
        ("Plumber", "Sydney", "plumberbots.com.au", "blocked drain at midnight, burst pipe flooding"),
        ("Plumber", "Brisbane", "plumberbots.com.au", "hot water system failure in winter"),
        ("Electrician", "Melbourne", "sparkybots.com.au", "safety switch tripping, power outage"),
        ("Electrician", "Perth", "electricianbotai.au", "EV charger installation enquiries"),
        ("HVAC", "Brisbane", "hvacbots.com.au", "AC breakdown during summer heatwave"),
        ("HVAC", "Adelaide", "hvacbots.com.au", "gas heater servicing before winter"),
        ("Builder", "Sydney", "tradiechatbots.com.au", "renovation enquiries, granny flat quotes"),
        ("Builder", "Melbourne", "tradiechatbots.com.au", "extension and knockdown rebuild leads"),
        ("Roofer", "Gold Coast", "rooferbot.au", "storm damage, emergency roof repair"),
        ("Solar", "Brisbane", "solarbotai.au", "government rebate deadline enquiries"),
        ("Locksmith", "Sydney", "locksmithbot.au", "emergency lockout calls"),
        ("Landscaper", "Perth", "tradiechatbots.com.au", "spring garden makeover season"),
        ("Painter", "Adelaide", "tradiechatbots.com.au", "pre-sale painting quotes"),
        ("Pool Builder", "Gold Coast", "tradiechatbots.com.au", "pool season preparation"),
        ("Concreter", "Melbourne", "tradiechatbots.com.au", "driveway and slab quotes"),
        ("Fencer", "Brisbane", "tradiechatbots.com.au", "post-cyclone fencing repairs"),
        ("Tree Service", "Sydney", "tradiechatbots.com.au", "storm aftermath tree removal"),
        ("Mechanic", "Perth", "mechanicbot.au", "mobile mechanic fleet servicing"),
        ("General Tradie", "Cairns", "tradiechatbots.com.au", "tropical building maintenance"),
        ("General Tradie", "Darwin", "tradiechatbots.com.au", "wet season preparation"),
        # Industry verticals (15)
        ("Dental Practice", "Sydney", "dentalbotai.au", "emergency dental, cosmetic consultations"),
        ("Medical Clinic", "Melbourne", "clinicaibot.au", "after-hours patient calls, bulk billing enquiries"),
        ("Real Estate Agent", "Brisbane", "propertybotai.au", "property enquiries, open home bookings"),
        ("Law Firm", "Sydney", "lawyerbot.au", "consultation bookings, new client intake"),
        ("Beauty Salon", "Melbourne", "beautybot.com.au", "appointment booking, product enquiries"),
        ("Property Manager", "Brisbane", "rentbot.au", "tenant maintenance requests"),
        ("Veterinary Clinic", "Adelaide", "receptionistai.au", "pet emergency calls, vaccination scheduling"),
        ("Accounting Firm", "Perth", "receptionistai.au", "tax season enquiry overflow"),
        ("Physiotherapy", "Sydney", "receptionistai.au", "appointment scheduling, WorkCover claims"),
        ("Restaurant", "Melbourne", "bookingbot.au", "table reservations, dietary enquiries"),
        ("Chiropractor", "Brisbane", "receptionistai.au", "new patient intake, insurance questions"),
        ("Financial Planner", "Sydney", "receptionistai.au", "consultation booking, super enquiries"),
        ("Photography Studio", "Melbourne", "bookingbot.au", "wedding photography enquiries"),
        ("Gym/Fitness", "Brisbane", "bookingbot.au", "membership enquiries, class booking"),
        ("Architecture Firm", "Sydney", "receptionistai.au", "project enquiry intake"),
        # City verticals (10)
        ("Small Business Owner", "Sydney", "sydneychatbots.com.au", "generic small business missed calls"),
        ("Small Business Owner", "Brisbane", "brisbanechatbots.com.au", "Brisbane small business growth"),
        ("Small Business Owner", "Melbourne", "melbournechatbots.com.au", "Melbourne competitive market"),
        ("Small Business Owner", "Adelaide", "adelaidechatbots.com.au", "Adelaide small business community"),
        ("Small Business Owner", "Perth", "voiceassistant.com.au", "Perth isolation, phone is lifeline"),
        # Agency partner sequences (5)
        ("Web Agency Owner", "National", "sunaivadigital.com", "30% recurring commission on widget sales"),
        ("SEO Agency", "National", "sunaivadigital.com", "add AI voice to your client offerings"),
        ("Digital Marketing Agency", "National", "sunaivadigital.com", "white-label AI voice for your agency"),
        ("GHL/HighLevel Agency", "National", "sunaivadigital.com", "integrate AI voice into your GHL stack"),
        ("WordPress Developer", "National", "sunaivadigital.com", "add $197/mo recurring per client site"),
        # Bonus verticals to reach 50 (5)
        ("Cafe/Restaurant Owner", "Sydney", "bookingbot.au", "table booking enquiries during rush hours"),
        ("Real Estate Agent", "Perth", "propertybotai.au", "after-hours property enquiry capture"),
        ("Dental Practice", "Brisbane", "dentalbotai.au", "new patient intake and emergency scheduling"),
        ("Small Business Owner", "Gold Coast", "aichatbotsaustralia.au", "tourist season call overflow"),
        ("Trades Business Network", "National", "tradiechatbots.com.au", "refer AI voice to your network members"),
    ]

    for vertical, city, domain, scenario in email_verticals:
        stories.append({
            "agent_id": agent_id,
            "category": "email_sequences",
            "category_num": 10,
            "task_title": f"Email seq: {vertical} ({city})",
            "prompt": f"""Write a complete 3-email outreach sequence for:

**Target:** {vertical} in {city}
**Landing page:** {domain}
**Key scenario:** {scenario}

Generate 3 COMPLETE emails:

**EMAIL 1: Cold Outreach (Day 0)**
- Subject line (under 50 chars, personalised with {{{{first_name}}}} or {{{{business_name}}}})
- Preview text (under 90 chars)
- Body (under 150 words):
  - Opening: Reference {city} or {vertical} specifically ("I noticed {vertical} businesses in {city} are...")
  - Pain point: Connect to {scenario}
  - Value prop: One clear benefit of AI voice agents
  - Social proof: Reference other {vertical}s using it
  - CTA: Simple, low-friction ("Worth a quick look?")
- Signature: [Your name], Sunaiva Team

**EMAIL 2: Value-Add Follow-Up (Day 3)**
- Subject line (reference Email 1 or add new angle)
- Preview text
- Body (under 120 words):
  - Opening: Acknowledge they're busy
  - Value: Share a specific stat or mini case study relevant to {vertical}
  - ROI math: Quick calculation showing potential revenue from captured calls
  - CTA: Link to demo or case study
- Signature

**EMAIL 3: Final Touch (Day 7)**
- Subject line (create gentle urgency without being pushy)
- Preview text
- Body (under 100 words):
  - Opening: Brief and respectful
  - Core message: One powerful question or stat that makes them think
  - CTA: "If now's not the right time, no worries. The offer stands."
  - PS: Include a PS line with a different angle or offer
- Signature

**REQUIREMENTS:**
- Australian English (enquiry, organisation, etc.)
- Australian Spam Act 2003 compliant (include unsubscribe, sender identity, ABN)
- Conversational but professional tone
- No hype, no pressure, no fake urgency
- Personalisation tokens: {{{{first_name}}}}, {{{{business_name}}}}, {{{{suburb}}}}
- Each email must work standalone (reader may only see one)
- All CTAs link to https://{domain}

Format as structured text with clear EMAIL 1 / EMAIL 2 / EMAIL 3 headers."""
        })
        agent_id += 1

    return stories


async def execute_agent(
    session: aiohttp.ClientSession,
    story: dict,
    api_key: str
) -> AgentResult:
    """Execute a single agent task via OpenRouter API."""
    start_time = time.time()

    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
        "HTTP-Referer": "https://github.com/genesis-system",
        "X-Title": "Genesis 500-Agent Domain Content Swarm"
    }

    payload = {
        "model": MINIMAX_MODEL_ID,
        "messages": [
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": story["prompt"]}
        ],
        "temperature": 0.7,
        "max_tokens": 4096
    }

    try:
        timeout = aiohttp.ClientTimeout(total=REQUEST_TIMEOUT)
        async with session.post(OPENROUTER_BASE_URL, json=payload, headers=headers, timeout=timeout) as response:
            response_time_ms = int((time.time() - start_time) * 1000)

            if response.status != 200:
                error_text = await response.text()
                return AgentResult(
                    agent_id=story["agent_id"],
                    category=story["category"],
                    category_num=story["category_num"],
                    task_title=story["task_title"],
                    status="fail",
                    prompt_tokens=0,
                    completion_tokens=0,
                    total_tokens=0,
                    cost_usd=0.0,
                    response_time_ms=response_time_ms,
                    error=f"HTTP {response.status}: {error_text[:300]}"
                )

            data = await response.json()

            if "error" in data:
                return AgentResult(
                    agent_id=story["agent_id"],
                    category=story["category"],
                    category_num=story["category_num"],
                    task_title=story["task_title"],
                    status="fail",
                    prompt_tokens=0,
                    completion_tokens=0,
                    total_tokens=0,
                    cost_usd=0.0,
                    response_time_ms=response_time_ms,
                    error=f"API Error: {json.dumps(data['error'])[:300]}"
                )

            usage = data.get("usage", {})
            prompt_tokens = usage.get("prompt_tokens", 0)
            completion_tokens = usage.get("completion_tokens", 0)
            total_tokens = usage.get("total_tokens", 0)

            # MiniMax M2.5 pricing via OpenRouter
            cost_usd = (prompt_tokens / 1_000_000) * 1.00 + (completion_tokens / 1_000_000) * 5.50

            response_text = data["choices"][0]["message"]["content"]

            return AgentResult(
                agent_id=story["agent_id"],
                category=story["category"],
                category_num=story["category_num"],
                task_title=story["task_title"],
                status="success",
                prompt_tokens=prompt_tokens,
                completion_tokens=completion_tokens,
                total_tokens=total_tokens,
                cost_usd=cost_usd,
                response_time_ms=response_time_ms,
                response=response_text
            )

    except asyncio.TimeoutError:
        response_time_ms = int((time.time() - start_time) * 1000)
        return AgentResult(
            agent_id=story["agent_id"],
            category=story["category"],
            category_num=story["category_num"],
            task_title=story["task_title"],
            status="fail",
            prompt_tokens=0,
            completion_tokens=0,
            total_tokens=0,
            cost_usd=0.0,
            response_time_ms=response_time_ms,
            error=f"Timeout after {REQUEST_TIMEOUT}s"
        )
    except Exception as e:
        response_time_ms = int((time.time() - start_time) * 1000)
        return AgentResult(
            agent_id=story["agent_id"],
            category=story["category"],
            category_num=story["category_num"],
            task_title=story["task_title"],
            status="fail",
            prompt_tokens=0,
            completion_tokens=0,
            total_tokens=0,
            cost_usd=0.0,
            response_time_ms=response_time_ms,
            error=str(e)[:300]
        )


async def main():
    """Main orchestrator for 500-agent domain content swarm."""
    print(f"\n{'='*80}")
    print("GENESIS 500-AGENT DOMAIN CONTENT SWARM")
    print("73-Domain Portfolio Content Generation")
    print(f"{'='*80}")
    print(f"Timestamp: {datetime.now().isoformat()}")
    print(f"Model: {MINIMAX_MODEL_ID}")
    print(f"Batch Size: {BATCH_SIZE}")
    print(f"Request Timeout: {REQUEST_TIMEOUT}s")
    print(f"Output: {OUTPUT_DIR}")
    print(f"{'='*80}\n")

    # Generate all stories
    print("Generating 500 stories across 10 categories...")
    stories = generate_stories()
    print(f"Generated {len(stories)} stories\n")

    # Verify count
    if len(stories) != 500:
        print(f"WARNING: Expected 500 stories, got {len(stories)}. Adjusting...")
        # Trim or pad as needed
        if len(stories) > 500:
            stories = stories[:500]
        while len(stories) < 500:
            pad_id = len(stories) + 1
            stories.append({
                "agent_id": pad_id,
                "category": "email_sequences",
                "category_num": 10,
                "task_title": f"Email seq: bonus {pad_id}",
                "prompt": f"""Write a 3-email outreach sequence for a general small business owner in Australia about AI voice agents.
                Landing page: receptionistai.au. Australian English, Spam Act compliant.
                Email 1: Cold outreach. Email 2: Value-add follow-up. Email 3: Final touch.
                Under 150 words each. Personalisation tokens included."""
            })

    # Create output directories
    category_dirs = {
        1: "category_01_city_landing_pages",
        2: "category_02_trade_landing_pages",
        3: "category_03_industry_landing_pages",
        4: "category_04_voice_receptionist_landing_pages",
        5: "category_05_city_seo_blog_posts",
        6: "category_06_trade_seo_blog_posts",
        7: "category_07_industry_seo_blog_posts",
        8: "category_08_google_ads_copy",
        9: "category_09_meta_descriptions_seo",
        10: "category_10_email_sequences",
    }
    for cat_dir in category_dirs.values():
        os.makedirs(f"{OUTPUT_DIR}/{cat_dir}", exist_ok=True)

    # Category count verification
    print("Category distribution:")
    cat_counts = {}
    for s in stories:
        cat = s["category_num"]
        cat_counts[cat] = cat_counts.get(cat, 0) + 1
    for cat_num in sorted(cat_counts.keys()):
        cat_name = category_dirs.get(cat_num, "unknown").replace("category_", "").replace("_", " ").strip()
        print(f"  Cat {cat_num:2d}: {cat_counts[cat_num]:3d} agents — {cat_name}")
    print()

    # Execute in batches
    all_results = []
    total_stories = len(stories)
    total_batches = (total_stories + BATCH_SIZE - 1) // BATCH_SIZE

    start_time = time.time()

    async with aiohttp.ClientSession() as session:
        for i in range(0, total_stories, BATCH_SIZE):
            batch = stories[i:i + BATCH_SIZE]
            batch_num = (i // BATCH_SIZE) + 1

            print(f"Batch {batch_num}/{total_batches}: Firing {len(batch)} agents (#{batch[0]['agent_id']}-#{batch[-1]['agent_id']})...")

            try:
                batch_results = await asyncio.wait_for(
                    asyncio.gather(
                        *[execute_agent(session, story, API_KEY) for story in batch]
                    ),
                    timeout=BATCH_TIMEOUT
                )

                all_results.extend(batch_results)

                successes = len([r for r in batch_results if r.status == "success"])
                failures = len([r for r in batch_results if r.status == "fail"])
                batch_cost = sum(r.cost_usd for r in batch_results)

                print(f"  OK: {successes} success, {failures} failed, ${batch_cost:.4f}")

                # Save individual results immediately
                for result in batch_results:
                    cat_dir = category_dirs.get(result.category_num, "uncategorized")
                    filepath = f"{OUTPUT_DIR}/{cat_dir}/agent_{result.agent_id:03d}.json"
                    with open(filepath, "w") as f:
                        json.dump(asdict(result), f, indent=2)

            except asyncio.TimeoutError:
                print(f"  TIMEOUT: Batch {batch_num} timed out after {BATCH_TIMEOUT}s")
                for story in batch:
                    result = AgentResult(
                        agent_id=story["agent_id"],
                        category=story["category"],
                        category_num=story["category_num"],
                        task_title=story["task_title"],
                        status="fail",
                        prompt_tokens=0,
                        completion_tokens=0,
                        total_tokens=0,
                        cost_usd=0.0,
                        response_time_ms=BATCH_TIMEOUT * 1000,
                        error=f"Batch timeout after {BATCH_TIMEOUT}s"
                    )
                    all_results.append(result)

            # Brief pause between batches
            if i + BATCH_SIZE < total_stories:
                await asyncio.sleep(INTER_BATCH_DELAY)

    elapsed_seconds = time.time() - start_time

    # Save all results to JSONL
    jsonl_path = f"{OUTPUT_DIR}/all_results.jsonl"
    with open(jsonl_path, "w") as f:
        for result in all_results:
            f.write(json.dumps(asdict(result)) + "\n")

    # Calculate metrics
    total_agents = len(all_results)
    total_successes = len([r for r in all_results if r.status == "success"])
    total_failures = len([r for r in all_results if r.status == "fail"])
    success_rate = (total_successes / total_agents * 100) if total_agents > 0 else 0
    total_tokens = sum(r.total_tokens for r in all_results)
    total_cost = sum(r.cost_usd for r in all_results)
    avg_response = sum(r.response_time_ms for r in all_results) / total_agents if total_agents > 0 else 0

    # Category breakdown
    category_stats = {}
    for r in all_results:
        cat = r.category
        if cat not in category_stats:
            category_stats[cat] = {"total": 0, "success": 0, "fail": 0, "cost": 0.0, "tokens": 0}
        category_stats[cat]["total"] += 1
        if r.status == "success":
            category_stats[cat]["success"] += 1
        else:
            category_stats[cat]["fail"] += 1
        category_stats[cat]["cost"] += r.cost_usd
        category_stats[cat]["tokens"] += r.total_tokens

    # Generate report
    report = f"""# Domain Portfolio 500-Agent Content Swarm Report
## 73-Domain Portfolio Content Generation

**Generated:** {datetime.now().isoformat()}
**Model:** {MINIMAX_MODEL_ID}
**Elapsed Time:** {elapsed_seconds:.1f}s ({elapsed_seconds/60:.1f} minutes)

## Overview

| Metric | Value |
|--------|-------|
| **Total Agents Fired** | {total_agents} |
| **Successful** | {total_successes} ({success_rate:.1f}%) |
| **Failed** | {total_failures} |
| **Total Tokens** | {total_tokens:,} |
| **Total Cost** | ${total_cost:.4f} |
| **Avg Response Time** | {avg_response:.0f}ms |
| **Cost Per Agent** | ${total_cost/total_agents:.4f} |

## Category Breakdown

| # | Category | Total | Success | Failed | Tokens | Cost |
|---|----------|-------|---------|--------|--------|------|
"""

    category_names = {
        "city_landing_pages": "City Landing Pages",
        "trade_landing_pages": "Trade Landing Pages",
        "industry_landing_pages": "Industry Landing Pages",
        "voice_receptionist_landing_pages": "Voice/Receptionist Landing Pages",
        "city_seo_blog_posts": "City SEO Blog Posts",
        "trade_seo_blog_posts": "Trade SEO Blog Posts",
        "industry_seo_blog_posts": "Industry SEO Blog Posts",
        "google_ads_copy": "Google Ads Copy",
        "meta_descriptions_seo": "Meta Descriptions & SEO",
        "email_sequences": "Email Sequences",
    }

    cat_keys_ordered = [
        "city_landing_pages", "trade_landing_pages", "industry_landing_pages",
        "voice_receptionist_landing_pages", "city_seo_blog_posts", "trade_seo_blog_posts",
        "industry_seo_blog_posts", "google_ads_copy", "meta_descriptions_seo", "email_sequences"
    ]

    cat_num = 1
    for cat_key in cat_keys_ordered:
        stats = category_stats.get(cat_key, {"total": 0, "success": 0, "fail": 0, "cost": 0.0, "tokens": 0})
        name = category_names.get(cat_key, cat_key)
        report += f"| {cat_num} | {name} | {stats['total']} | {stats['success']} | {stats['fail']} | {stats['tokens']:,} | ${stats['cost']:.4f} |\n"
        cat_num += 1

    # Errors section
    errors = [r for r in all_results if r.status == "fail"]
    if errors:
        report += f"\n## Errors ({len(errors)} failures)\n\n"
        error_groups = {}
        for r in errors:
            err = r.error or "Unknown"
            if err not in error_groups:
                error_groups[err] = []
            error_groups[err].append(r.agent_id)
        for err, agent_ids in error_groups.items():
            report += f"- **{err}**: Agents {', '.join(str(a) for a in agent_ids[:10])}"
            if len(agent_ids) > 10:
                report += f" (+{len(agent_ids)-10} more)"
            report += "\n"
    else:
        report += "\n## Errors\n\nNo errors! All 500 agents completed successfully.\n"

    report += f"""
## Output Files

- **Individual results:** `{OUTPUT_DIR}/category_XX_*/agent_NNN.json`
- **All results JSONL:** `{OUTPUT_DIR}/all_results.jsonl`
- **This report:** `{OUTPUT_DIR}/SWARM_REPORT.md`

## Domain Coverage

| Tier | Domains | Content Types Generated |
|------|---------|------------------------|
| City EMDs (10) | sydneychatbots.com.au, etc. | Landing pages (5 variants), blog posts, ads, SEO, emails |
| Trade EMDs (13) | plumberbots.com.au, etc. | Landing pages (4 variants), blog posts, ads, SEO, emails |
| Industry EMDs (9) | receptionistai.au, etc. | Landing pages (5-6 variants), blog posts, ads, SEO, emails |
| Voice EMDs (6) | voiceassistant.com.au, etc. | Landing pages (10 variants), ads, SEO |
| Flagship (5) | sunaiva.ai, etc. | SEO metadata, ads |
| Product (8) | sunaivaagent.com, etc. | SEO metadata |
| Orchestration (6) | orchestr8ai.com, etc. | SEO metadata |

## Cost Analysis

- **Total cost:** ${total_cost:.4f}
- **Cost per agent:** ${total_cost/total_agents:.4f}
- **Cost per domain (73):** ${total_cost/73:.4f}
- **Model:** MiniMax M2.5 via OpenRouter
- **Pricing:** Input $1.00/MTok, Output $5.50/MTok

---

*Generated by Genesis 500-Agent Domain Content Swarm*
*Timestamp: {datetime.now().isoformat()}*
"""

    report_path = f"{OUTPUT_DIR}/SWARM_REPORT.md"
    with open(report_path, "w") as f:
        f.write(report)

    # Print summary
    print(f"\n{'='*80}")
    print("DOMAIN CONTENT SWARM EXECUTION COMPLETE")
    print(f"{'='*80}")
    print(f"Total Agents: {total_agents}")
    print(f"Successes: {total_successes} ({success_rate:.1f}%)")
    print(f"Failures: {total_failures}")
    print(f"Total Tokens: {total_tokens:,}")
    print(f"Total Cost: ${total_cost:.4f}")
    print(f"Avg Response Time: {avg_response:.0f}ms")
    print(f"Elapsed Time: {elapsed_seconds:.1f}s ({elapsed_seconds/60:.1f} min)")
    print(f"\nReport: {report_path}")
    print(f"Results: {jsonl_path}")
    print(f"{'='*80}\n")


if __name__ == "__main__":
    asyncio.run(main())
