File size: 2,575 Bytes
924a755
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""Export all five Agent Cards to protocols/a2a_cards/ (plan §7.2).

Run:  python -m scripts.export_cards
"""
from __future__ import annotations

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))

from core.a2a_layer import export_card, make_card  # noqa: E402
from core.config import PROJECT_ROOT, settings  # noqa: E402

CARDS_DIR = PROJECT_ROOT / "protocols" / "a2a_cards"
PORTS = settings()["ports"]

CARDS = [
    ("auditor", make_card(
        name="AuditorAgent",
        description="Monitors warehouse stock over MCP and emits procurement requests",
        port=PORTS["auditor"],
        skills=[{"id": "detect_shortage", "name": "Detect stock shortage",
                 "description": "scan inventory below reorder point and raise a ProcurementRequest",
                 "tags": ["inventory", "mcp"]}])),
    ("sourcing", make_card(
        name="SourcingAgent",
        description="Shortlists vendors for a procurement request",
        port=PORTS["sourcing"],
        skills=[{"id": "shortlist_vendors", "name": "Shortlist vendors",
                 "description": "rank top-3 vendors for a SKU",
                 "tags": ["procurement", "sourcing"]}])),
    ("buyer", make_card(
        name="BuyerAgent",
        description="Negotiates unit price against a hidden budget ceiling",
        port=PORTS["buyer"], streaming=True,
        skills=[{"id": "negotiate_price", "name": "Negotiate price",
                 "description": "multi-turn settle-or-walk negotiation with a vendor",
                 "tags": ["negotiation"]}])),
    ("vendor", make_card(
        name="VendorAgent",
        description="Adversarial sales counterparty with a hidden cost floor and persona",
        port=PORTS["vendor_a"], streaming=True,
        skills=[{"id": "counter_offer", "name": "Counter offer",
                 "description": "respond to buyer offers per persona above a hidden floor",
                 "tags": ["negotiation", "sales"]}])),
    ("settlement", make_card(
        name="SettlementAgent",
        description="Selects the winning deal, builds AP2 mandates, gates on human approval",
        port=PORTS["ui"],
        skills=[{"id": "settle_purchase", "name": "Settle purchase",
                 "description": "compare deals, assemble Intent/Cart/Payment mandates, write PO on approval",
                 "tags": ["ap2", "human-in-the-loop"]}])),
]

if __name__ == "__main__":
    for name, card in CARDS:
        export_card(card, CARDS_DIR / f"{name}.json")
        print(f"exported {name}.json")