| """ |
| ACO Academy Benchmark Tool - HuggingFace Space |
| Agent Commerce Optimization Demo |
| |
| No secrets or API keys in this code - all external configuration. |
| """ |
|
|
| import gradio as gr |
| import os |
| from datetime import datetime |
|
|
| |
| ACO_API_BASE = os.getenv("ACO_API_BASE", "https://agenticcommerce.academy/api") |
| STRIPE_CHECKOUT_BASE = os.getenv("STRIPE_CHECKOUT_BASE", "https://agenticcommerce.academy/benchmark") |
|
|
| |
| SHOWCASE_EXAMPLES = { |
| "amazon.com": { |
| "grade": "F", |
| "score": "49/100", |
| "pdf": "reports/amazon_benchmark.pdf", |
| "summary": "Zero ACO implementation. AI agents cannot discover Amazon's APIs." |
| }, |
| "x.com": { |
| "grade": "D", |
| "score": "65/100", |
| "pdf": "reports/x_benchmark.pdf", |
| "summary": "Partial ACO support. Has agent.json and MCP, but missing structured data." |
| }, |
| "shopify.com": { |
| "grade": "F", |
| "score": "57/100", |
| "pdf": "reports/shopify_benchmark.pdf", |
| "summary": "Poor overall score despite perfect SEO. Weak ACO (40/100) and security (35/100)." |
| }, |
| "agenticcommerce.academy": { |
| "grade": "D", |
| "score": "61/100", |
| "pdf": "reports/agenticcommerce_benchmark.pdf", |
| "summary": "We practice what we preach - and we're still improving. Perfect SEO, moderate ACO." |
| } |
| } |
|
|
| def get_showcase_report(domain): |
| """Return pre-generated showcase report""" |
| if domain not in SHOWCASE_EXAMPLES: |
| return None, "Select a domain to view the report" |
| |
| example = SHOWCASE_EXAMPLES[domain] |
| summary = f""" |
| # {domain} - Grade {example['grade']} ({example['score']}) |
| |
| **{example['summary']}** |
| |
| π₯ **Download the full 4-page PDF report below** |
| |
| This is a complete ACO benchmark including: |
| - SEO Analysis |
| - ACO Implementation Check |
| - Security Scan |
| - Consent Audit |
| - CEH-RI Risk Assessment |
| - Prioritized Recommendations |
| """ |
| return example['pdf'], summary |
|
|
| def scan_domain_preview(domain): |
| """ |
| Preview scan - basic ACO check only |
| |
| NOTE: This is a MOCK for demo purposes. |
| Real implementation calls ACO_API_BASE + /preview endpoint |
| """ |
| if not domain or len(domain) < 4: |
| return "β οΈ Please enter a valid domain (e.g., example.com)" |
| |
| |
| domain = domain.strip().lower().replace("https://", "").replace("http://", "").split("/")[0] |
| |
| |
| |
| |
| preview = f""" |
| ## π ACO Preview Report: {domain} |
| |
| ### Estimated Grade: F (35/100) |
| |
| **Quick Findings:** |
| |
| β **No agent.json detected** - AI agents cannot discover your capabilities |
| β **No MCP manifest found** - No Model Context Protocol support |
| β **No llms.txt present** - AI crawlers have no guidance |
| β οΈ **Basic SEO present** but not optimized for agents |
| β οΈ **Security headers incomplete** - Missing modern protections |
| |
| --- |
| |
| ### β οΈ Your site is invisible to AI agents |
| |
| As AI-driven commerce becomes mainstream, sites without ACO will be excluded from agent transactions. |
| |
| --- |
| |
| ### π What's in the Full Report? |
| |
| β
**Complete 6-category analysis** (20+ checks across SEO, ACO, Security, Consent, CEH-RI) |
| β
**Cognitive Event Horizon Risk Index** - Detect manipulation patterns |
| β
**Detailed security & consent audit** - GDPR, CCPA, ACO compliance |
| β
**Prioritized action plan** - Step-by-step fixes with impact scores |
| β
**4-page downloadable PDF** - Professional report for your team |
| β
**Industry benchmarks** - See how you compare |
| |
| --- |
| |
| ### π₯ Ready to see the full picture? |
| |
| **One-time analysis: $99** |
| Complete ACO benchmark delivered instantly. |
| |
| """ |
| return preview |
|
|
| def get_upgrade_link(domain): |
| """Generate Stripe checkout link for full report""" |
| if not domain or len(domain) < 4: |
| return "β οΈ Please enter a domain first" |
| |
| domain = domain.strip().lower().replace("https://", "").replace("http://", "").split("/")[0] |
| |
| |
| checkout_url = f"{STRIPE_CHECKOUT_BASE}?domain={domain}&product=aco-benchmark&price=99" |
| |
| return f""" |
| ## π Upgrade to Full Report |
| |
| **Domain:** {domain} |
| **Price:** $99 (one-time) |
| |
| **[Click here to complete checkout]({checkout_url})** |
| |
| You'll receive: |
| - Full 4-page PDF benchmark report |
| - Detailed findings across all 6 categories |
| - Prioritized recommendations |
| - Access to your ACO Academy dashboard |
| |
| Secure payment processed via Stripe. |
| """ |
|
|
| |
| with gr.Blocks( |
| theme=gr.themes.Soft( |
| primary_hue="blue", |
| secondary_hue="purple" |
| ), |
| title="ACO Academy | The SEO of the AI Era", |
| css=""" |
| .gradio-container {max-width: 1200px !important} |
| .gr-button-primary {background: linear-gradient(90deg, #3B5EE9 0%, #9333EA 100%)} |
| """ |
| ) as demo: |
| |
| gr.Markdown(""" |
| # ACO Academy Benchmark Tool |
| ## The SEO of the AI Era |
| |
| **Is Your Site Ready for AI Agents?** |
| |
| Get a comprehensive benchmark of your site's Agent Commerce Optimization score. Find out what AI shopping agents see when they evaluate your site. |
| """) |
| |
| |
| with gr.Tab("π Showcase Examples"): |
| gr.Markdown(""" |
| ## See How Major Sites Score on ACO Readiness |
| |
| We've benchmarked popular platforms to show the **range** of ACO implementation. |
| Download full PDF reports to see what you'll receive. |
| """) |
| |
| showcase_dropdown = gr.Dropdown( |
| choices=list(SHOWCASE_EXAMPLES.keys()), |
| label="Select a site to view full report", |
| value="amazon.com" |
| ) |
| |
| showcase_btn = gr.Button("π₯ View Report", variant="primary") |
| |
| showcase_summary = gr.Markdown() |
| showcase_output = gr.File(label="Download PDF Report") |
| |
| showcase_btn.click( |
| fn=get_showcase_report, |
| inputs=[showcase_dropdown], |
| outputs=[showcase_output, showcase_summary] |
| ) |
| |
| |
| with gr.Tab("π Check Your Site"): |
| gr.Markdown(""" |
| ## Free Preview Scan |
| |
| Get a **basic ACO check** for any domain - see your estimated grade instantly. |
| |
| β οΈ **Preview includes:** ACO component detection only |
| π₯ **Full report includes:** SEO, Security, Consent, CEH-RI, and 20+ recommendations |
| """) |
| |
| with gr.Row(): |
| preview_input = gr.Textbox( |
| label="Enter your domain", |
| placeholder="example.com", |
| scale=3 |
| ) |
| preview_btn = gr.Button("π Scan Now (Free)", variant="secondary", scale=1) |
| |
| preview_output = gr.Markdown() |
| |
| gr.Markdown("---") |
| |
| upgrade_btn = gr.Button("π₯ Get Full Report ($99)", variant="primary", size="lg") |
| upgrade_output = gr.Markdown() |
| |
| preview_btn.click( |
| fn=scan_domain_preview, |
| inputs=[preview_input], |
| outputs=[preview_output] |
| ) |
| |
| upgrade_btn.click( |
| fn=get_upgrade_link, |
| inputs=[preview_input], |
| outputs=[upgrade_output] |
| ) |
| |
| |
| with gr.Tab("π About ACO"): |
| gr.Markdown(""" |
| ## What's Included in Your Benchmark |
| |
| **A comprehensive 6-point analysis covering every aspect of agent commerce optimization** |
| |
| ### π What We Analyze |
| |
| ### π SEO Analysis |
| SSL, robots.txt, sitemap, meta tags, and traditional search optimization factors. |
| |
| ### π€ ACO Analysis |
| Agent card, MCP manifest, llms.txt, structured data, and AI agent discoverability. |
| |
| ### π Security Scan |
| Security headers, rate limiting, sybil protection, and human escalation paths. |
| |
| ### β
Consent Audit |
| GDPR, CCPA, and ACO consent compliance. Informed, voluntary, and fiduciary analysis. |
| |
| ### π§ CEH-RI Analysis |
| Cognitive Event Horizon Risk Index across 6 dimensions of agent decision-making. |
| |
| ### π Pathology Report |
| Perception asymmetry, epistemic ambiguity, trust exhaustion risk assessment. |
| |
| --- |
| |
| ## What You Get |
| |
| β
Overall ACO Grade (A+ to F) |
| β
Detailed score breakdown |
| β
6-dimension CEH-RI analysis |
| β
Vulnerability detection |
| β
Compliance status (GDPR, CCPA, ACO) |
| β
Prioritized recommendations |
| β
Instant results (no waiting) |
| β
Downloadable PDF report |
| β
Compare against best practices |
| β
Actionable improvement steps |
| |
| --- |
| |
| ## ONE-TIME ANALYSIS: $99 |
| |
| Complete 6-point benchmark analysis with instant results: |
| |
| - SEO + ACO + Security + Consent + CEH-RI + Pathology |
| - Prioritized action items |
| - PDF report download |
| - Results saved for future reference |
| - Secure payment via Stripe |
| |
| --- |
| |
| ### π Powered by SmartLedger |
| |
| ACO Academy is built on the **SmartLedger ecosystem**: |
| |
| - **EΒ² Identity** - Verifiable credentials for agent authentication |
| - **BLS Explorer** - Transparent blockchain audit trails |
| - **SNTNL Network** - Decentralized trust infrastructure |
| |
| **[Learn more at agenticcommerce.academy β](https://agenticcommerce.academy)** |
| """) |
| |
| gr.Markdown(""" |
| --- |
| |
| **ACO Academy - The SEO of the AI Era** | [Run Full Benchmark ($99)](https://agenticcommerce.academy/benchmark) | Powered by [SmartLedger Solutions](https://smartledger.solutions) |
| """) |
|
|
| |
| if __name__ == "__main__": |
| demo.launch( |
| server_name="0.0.0.0", |
| server_port=7860 |
| ) |
|
|