| from __future__ import annotations |
| from typing import Optional |
|
|
| from ..models import WorkerResults |
| from ..config import settings |
| from ..llm import complete |
|
|
|
|
| DEFAULT_DEMO_SCRIPT = """# CAPScore Demo Script β 5 Minutes |
| |
| ## 0:00β0:30 β Hook |
| "CROO turns agents into paid services. But once agents can hire other agents, trust becomes the bottleneck. CAPScore solves this by auditing agents and producing verifiable proof packs before buyers depend on them." |
| |
| ## 0:30β1:20 β Show Agent Store Listing |
| - Open CROO Agent Store |
| - Show CAPScore listed with 3 capabilities: audit_agent_listing, audit_repository, verify_claims |
| - Show prices ($0.50 / $2.00 / $1.00) and SLA (2 min / 5 min / 3 min) |
| - Show input schema for audit_repository |
| |
| ## 1:20β2:20 β Place a Real CAP Order |
| - Submit a GitHub repo URL (use another hackathon team's repo) |
| - Show CAP order accepted in logs: "NegotiationCreated β acceptNegotiation β job_start" |
| - Show job running in API logs |
| |
| ## 2:20β3:20 β Show A2A Composition |
| - Show CAP provider logs: "a2a_start source-verifier-mock" |
| - Show A2A trace in proof pack manifest: "a2a_calls": [{"provider_agent": "source-verifier-mock", "status": "cleared"}] |
| - Emphasize: CAPScore both SERVES other agents and HIRES other agents |
| |
| ## 3:20β4:20 β Show Proof Pack |
| - Download proof-pack-{job_id}.zip |
| - Show result.md: overall score, dimension breakdown, critical fixes, claims table |
| - Show result_hash.sha256: deterministic verification |
| - Show attestation.json |
| |
| ## 4:20β5:00 β Close |
| - Show CAP orders count (target: 10+) |
| - Show before/after improvement on one team's submission |
| - "CAPScore is not only a hackathon submission β it is a missing trust layer for the agent economy." |
| """ |
|
|
|
|
| async def generate_demo_script(github_url: str, worker_results: WorkerResults) -> str: |
| context_parts = [] |
| if worker_results.repo: |
| context_parts.append(f"Repository score: {worker_results.repo.score:.0f}/100") |
| if worker_results.repo.issues: |
| context_parts.append(f"Issues: {'; '.join(worker_results.repo.issues[:3])}") |
| if worker_results.cap: |
| context_parts.append(f"CAP integration score: {worker_results.cap.score:.0f}/100") |
| context = "\n".join(context_parts) if context_parts else "No analysis results available." |
|
|
| prompt = f"""Write a 5-minute demo script for CAPScore Agent (a CROO AI agent that audits other agents). The script should fit the CROO hackathon judging criteria: Technical Execution (30%), A2A Composability (25%), Innovation (20%), Adoption (15%), Presentation (10%). |
| |
| Analysis context for the target agent: |
| {context} |
| GitHub URL: {github_url} |
| |
| Write a concise, punchy demo script with timestamps (0:00, 0:30, 1:20, 2:20, 3:20, 4:20) showing: Agent Store listing -> CAP order -> A2A calls -> proof pack -> adoption metrics. |
| |
| Keep it under 400 words.""" |
|
|
| text = await complete(prompt, max_tokens=600, temperature=0) |
| return text if text else DEFAULT_DEMO_SCRIPT |
|
|