a2a-matrix-quad-oracle 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- a2a_matrix_quad/__init__.py +4 -0
- a2a_matrix_quad/stdio_mcp.py +362 -0
- a2a_matrix_quad_oracle-2.0.0.dist-info/METADATA +93 -0
- a2a_matrix_quad_oracle-2.0.0.dist-info/RECORD +7 -0
- a2a_matrix_quad_oracle-2.0.0.dist-info/WHEEL +4 -0
- a2a_matrix_quad_oracle-2.0.0.dist-info/entry_points.txt +3 -0
- a2a_matrix_quad_oracle-2.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"""
|
|
2
|
+
stdio_mcp.py — Local Zero-Config Stdio MCP + Cloud x402 Bridge (`a2a-matrix-quad-oracle`).
|
|
3
|
+
Exposes 2 free offline deterministic tools (#06 ListingShield copy scanner + #08 FMC 541 stop-clock solver)
|
|
4
|
+
and 3 cloud-backed deterministic oracle tools (#09 SaaSBench, #07 SiliconOrigin, Matrix discovery).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
import sys
|
|
11
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
12
|
+
|
|
13
|
+
import httpx
|
|
14
|
+
|
|
15
|
+
DEFAULT_CLOUD_URL = os.environ.get(
|
|
16
|
+
"A2A_MATRIX_URL",
|
|
17
|
+
"https://a2a-matrix-quad-edge.a2a-data-matrix.workers.dev",
|
|
18
|
+
).rstrip("/")
|
|
19
|
+
PREPAID_BEARER = os.environ.get("A2A_PREPAID_BEARER", "")
|
|
20
|
+
X402_PAYMENT = os.environ.get("A2A_X402_PAYMENT", "")
|
|
21
|
+
|
|
22
|
+
# 25 Schedule-A / high-litigation stealth wordmarks -> safe generic replacements
|
|
23
|
+
STEALTH_TRADEMARKS: List[Tuple[str, str, str, str]] = [
|
|
24
|
+
("onesie", "Gerber Childrenswear LLC", "HIGH_TRO_FREEZE", "infant bodysuit"),
|
|
25
|
+
("velcro", "Velcro IP Holdings LLC", "HIGH_TRO_FREEZE", "hook-and-loop strap"),
|
|
26
|
+
("frisbee", "Wham-O Holding Ltd.", "HIGH_TRO_FREEZE", "flying disc"),
|
|
27
|
+
("hula hoop", "Wham-O Holding Ltd.", "HIGH_TRO_FREEZE", "fitness waist hoop"),
|
|
28
|
+
("bubble wrap", "Sealed Air Corp.", "MEDIUM_IP_TAKEDOWN", "air-cushion packing film"),
|
|
29
|
+
("popsocket", "PopSockets LLC", "HIGH_TRO_FREEZE", "collapsible phone grip"),
|
|
30
|
+
("taser", "Axon Enterprise Inc.", "HIGH_TRO_FREEZE", "stun device"),
|
|
31
|
+
("thermos", "Thermos L.L.C.", "MEDIUM_IP_TAKEDOWN", "vacuum insulated flask"),
|
|
32
|
+
("rubik's", "Spin Master Toys UK Ltd.", "HIGH_TRO_FREEZE", "3x3 speed puzzle cube"),
|
|
33
|
+
("chapstick", "Haleon US IP LLC", "MEDIUM_IP_TAKEDOWN", "moisturizing lip balm"),
|
|
34
|
+
("band-aid", "Kenvue Inc.", "MEDIUM_IP_TAKEDOWN", "adhesive bandage strip"),
|
|
35
|
+
("squishmallow", "Kelly Toys Holdings LLC", "HIGH_TRO_FREEZE", "soft plush pillow toy"),
|
|
36
|
+
("trx", "Fitness Anywhere LLC", "HIGH_TRO_FREEZE", "suspension trainer strap"),
|
|
37
|
+
("zumba", "Zumba Fitness LLC", "HIGH_TRO_FREEZE", "latin dance fitness"),
|
|
38
|
+
("crossfit", "CrossFit LLC", "MEDIUM_IP_TAKEDOWN", "high-intensity interval training"),
|
|
39
|
+
("jacuzzi", "Jacuzzi Inc.", "MEDIUM_IP_TAKEDOWN", "hydrotherapy whirlpool tub"),
|
|
40
|
+
("jet ski", "Kawasaki Motors Corp.", "MEDIUM_IP_TAKEDOWN", "personal watercraft"),
|
|
41
|
+
("ping pong", "Parker Bros / Escalade", "MEDIUM_IP_TAKEDOWN", "table tennis"),
|
|
42
|
+
("post-it", "3M Company", "MEDIUM_IP_TAKEDOWN", "repositionable sticky notes"),
|
|
43
|
+
("rollerblade", "Tecnica Group S.p.A.", "MEDIUM_IP_TAKEDOWN", "inline skates"),
|
|
44
|
+
("sharpie", "Newell Brands Inc.", "HIGH_TRO_FREEZE", "permanent fine-tip marker"),
|
|
45
|
+
("tupperware", "Tupperware Products S.A.", "MEDIUM_IP_TAKEDOWN", "airtight food storage container"),
|
|
46
|
+
("styrofoam", "DuPont de Nemours Inc.", "MEDIUM_IP_TAKEDOWN", "extruded polystyrene foam"),
|
|
47
|
+
("hacky sack", "Wham-O Holding Ltd.", "MEDIUM_IP_TAKEDOWN", "woven footbag"),
|
|
48
|
+
("kewpie", "Q.P. Corporation", "HIGH_TRO_FREEZE", "japanese style mayonnaise"),
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
# 18 multilingual EN/DE/FR EU EmpCo Directive 2024/825 Annex I banned claims (requires_iso14024, guidance)
|
|
52
|
+
EMPCO_CLAIMS: List[Tuple[str, bool, str]] = [
|
|
53
|
+
("eco-friendly", True, "Replace with audited metric or attach ISO 14024 Type-I Ecolabel ID"),
|
|
54
|
+
("umweltfreundlich", True, "German generic green claim banned in EU without ISO 14024 ecolabel"),
|
|
55
|
+
("éco-responsable", True, "French generic green claim banned in EU without EU Ecolabel / ISO 14024"),
|
|
56
|
+
("biodegradable", True, "Remove unqualified claim unless EN 13432 certified timeframe stated"),
|
|
57
|
+
("biologisch abbaubar", True, "German unqualified biodegradability banned without certified standard"),
|
|
58
|
+
("climate neutral", False, "PROHIBITED_PER_SE: Carbon-offset neutrality claims banned in EU"),
|
|
59
|
+
("klimaneutral", False, "PROHIBITED_PER_SE: German offset-based climate neutrality banned"),
|
|
60
|
+
("carbon neutral", False, "PROHIBITED_PER_SE: Carbon-offset neutrality claims banned in EU"),
|
|
61
|
+
("neutre en carbone", False, "PROHIBITED_PER_SE: French offset-based carbon neutrality banned"),
|
|
62
|
+
("net zero", False, "Substantiate with third-party verified transition plan & Scope 1-3 milestones"),
|
|
63
|
+
("environmentally friendly", True, "Replace with measurable recycled content percentage"),
|
|
64
|
+
("100% green", True, "Remove generic green claim; specify audited material ratio"),
|
|
65
|
+
("ecological", True, "Ban on uncertified generic ecological statements in EU"),
|
|
66
|
+
("planet-friendly", True, "Replace with specific packaging reduction or ISO 14024 cert"),
|
|
67
|
+
("nature's friend", True, "Remove unsubstantiated marketing phrasing"),
|
|
68
|
+
("greenhouse gas neutral", False, "PROHIBITED_PER_SE: Cannot claim GHG neutrality via external offsets"),
|
|
69
|
+
("climate positive", False, "PROHIBITED_PER_SE: Offset-based climate positive claim prohibited"),
|
|
70
|
+
("eco-safe", True, "Replace with exact REACH/RoHS or test standard ID"),
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def scan_listing_copy_locally(
|
|
75
|
+
title: str,
|
|
76
|
+
bullet_points: str = "",
|
|
77
|
+
target_market: str = "EU",
|
|
78
|
+
has_iso14024_cert: bool = False,
|
|
79
|
+
) -> Dict[str, Any]:
|
|
80
|
+
"""Deterministic offline boundary scanner for US Schedule-A TRO wordmarks & EU EmpCo 2024/825 claims."""
|
|
81
|
+
combined = f"{title}\n{bullet_points}"
|
|
82
|
+
market = target_market.upper()
|
|
83
|
+
tro_hits: List[Dict[str, str]] = []
|
|
84
|
+
empco_hits: List[Dict[str, Any]] = []
|
|
85
|
+
sanitized_title = title
|
|
86
|
+
|
|
87
|
+
for term, owner, severity, replacement in STEALTH_TRADEMARKS:
|
|
88
|
+
pat = re.compile(rf"(?<!\w){re.escape(term)}(?!\w)", re.IGNORECASE)
|
|
89
|
+
if pat.search(combined):
|
|
90
|
+
tro_hits.append(
|
|
91
|
+
{
|
|
92
|
+
"matched_mark": term,
|
|
93
|
+
"owner": owner,
|
|
94
|
+
"severity": severity,
|
|
95
|
+
"safe_generic_replacement": replacement,
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
sanitized_title = pat.sub(replacement, sanitized_title)
|
|
99
|
+
|
|
100
|
+
for phrase, certifiable, guidance in EMPCO_CLAIMS:
|
|
101
|
+
pat = re.compile(rf"(?<!\w){re.escape(phrase)}(?!\w)", re.IGNORECASE)
|
|
102
|
+
if pat.search(combined) and market == "EU":
|
|
103
|
+
if has_iso14024_cert and certifiable:
|
|
104
|
+
continue
|
|
105
|
+
empco_hits.append(
|
|
106
|
+
{
|
|
107
|
+
"prohibited_phrase": phrase,
|
|
108
|
+
"directive_citation": "EU EmpCo 2024/825 Annex I",
|
|
109
|
+
"certifiable_with_iso14024": certifiable,
|
|
110
|
+
"safe_rewrite_guidance": guidance,
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
sanitized_title = pat.sub("", sanitized_title)
|
|
114
|
+
|
|
115
|
+
sanitized_title = re.sub(r"\s{2,}", " ", sanitized_title).strip(" -&,")
|
|
116
|
+
safe = len(tro_hits) == 0 and len(empco_hits) == 0
|
|
117
|
+
return {
|
|
118
|
+
"mode": "LOCAL_OFFLINE_DETERMINISTIC_TRIE",
|
|
119
|
+
"target_market": market,
|
|
120
|
+
"has_iso14024_cert": has_iso14024_cert,
|
|
121
|
+
"safe_to_publish": safe,
|
|
122
|
+
"risk_verdict": "SAFE_TO_PUBLISH" if safe else "BLOCK_HIGH_FREEZE_OR_FINE_RISK",
|
|
123
|
+
"tro_stealth_trademarks_hit": tro_hits,
|
|
124
|
+
"eu_empco_violations_hit": empco_hits,
|
|
125
|
+
"auto_sanitized_title": sanitized_title,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def solve_fmc541_demurrage_stopclock(
|
|
130
|
+
billed_days: int = 8,
|
|
131
|
+
daily_rate_usd: float = 325.0,
|
|
132
|
+
days_from_charge_to_invoice: int = 37,
|
|
133
|
+
missing_541_6_fields_count: int = 0,
|
|
134
|
+
verified_gate_or_empty_lockout_days: int = 4,
|
|
135
|
+
billed_party_role: str = "CONSIGNEE",
|
|
136
|
+
port_code: str = "USLAX",
|
|
137
|
+
) -> Dict[str, Any]:
|
|
138
|
+
"""Deterministic US FMC 46 CFR Part 541 stop-clock & statutory forfeiture calculator."""
|
|
139
|
+
billed_total = round(max(0, billed_days) * daily_rate_usd, 2)
|
|
140
|
+
improper_party = billed_party_role.upper() == "TRUCKER_OR_BROKER_NON_CONTRACTING"
|
|
141
|
+
bar_30day = days_from_charge_to_invoice > 30
|
|
142
|
+
incomplete_541_6 = missing_541_6_fields_count > 0
|
|
143
|
+
|
|
144
|
+
defenses: List[str] = []
|
|
145
|
+
if improper_party:
|
|
146
|
+
defenses.append("46 CFR §541.4: Billed party is non-contracting trucker/broker; 100% void.")
|
|
147
|
+
if bar_30day:
|
|
148
|
+
defenses.append(
|
|
149
|
+
f"46 CFR §541.7(a) & §541.8: Issued {days_from_charge_to_invoice}d after last charge (>30d); zero obligation to pay."
|
|
150
|
+
)
|
|
151
|
+
if incomplete_541_6:
|
|
152
|
+
defenses.append(
|
|
153
|
+
f"46 CFR §541.6: Missing {missing_541_6_fields_count} mandatory invoice elements; payment hold applies."
|
|
154
|
+
)
|
|
155
|
+
if verified_gate_or_empty_lockout_days > 0:
|
|
156
|
+
defenses.append(
|
|
157
|
+
f"46 CFR §545.5 / Incentive Principle: {verified_gate_or_empty_lockout_days} terminal lockout days excluded."
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
if improper_party or bar_30day or incomplete_541_6:
|
|
161
|
+
chargeable_days = 0
|
|
162
|
+
legally_payable = 0.0
|
|
163
|
+
else:
|
|
164
|
+
chargeable_days = max(0, billed_days - max(0, verified_gate_or_empty_lockout_days))
|
|
165
|
+
legally_payable = round(chargeable_days * daily_rate_usd, 2)
|
|
166
|
+
|
|
167
|
+
disputed_waiver = round(max(0.0, billed_total - legally_payable), 2)
|
|
168
|
+
return {
|
|
169
|
+
"mode": "LOCAL_OFFLINE_FMC_46CFR541",
|
|
170
|
+
"port_code": port_code.upper(),
|
|
171
|
+
"billed_total_usd": billed_total,
|
|
172
|
+
"legally_payable_usd": legally_payable,
|
|
173
|
+
"disputed_waiver_usd": disputed_waiver,
|
|
174
|
+
"chargeable_days_after_stopclock": chargeable_days,
|
|
175
|
+
"fmc_46cfr541_flags": {
|
|
176
|
+
"improper_billed_party_541_4": improper_party,
|
|
177
|
+
"fmc_541_7_30day_bar_triggered": bar_30day,
|
|
178
|
+
"fmc_541_6_incomplete_invoice_hold": incomplete_541_6,
|
|
179
|
+
"verified_lockout_days_deducted": verified_gate_or_empty_lockout_days,
|
|
180
|
+
},
|
|
181
|
+
"statutory_defenses": defenses,
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _call_cloud_get(path: str, params: Optional[Dict[str, Any]] = None) -> str:
|
|
186
|
+
headers: Dict[str, str] = {"User-Agent": "A2AMatrixStdioClient/2.0"}
|
|
187
|
+
if PREPAID_BEARER:
|
|
188
|
+
headers["X-Prepaid-Bearer"] = PREPAID_BEARER
|
|
189
|
+
elif X402_PAYMENT:
|
|
190
|
+
headers["X-Payment"] = X402_PAYMENT
|
|
191
|
+
try:
|
|
192
|
+
with httpx.Client(timeout=8.0) as client:
|
|
193
|
+
r = client.get(f"{DEFAULT_CLOUD_URL}{path}", params=params, headers=headers)
|
|
194
|
+
return r.text
|
|
195
|
+
except Exception as exc:
|
|
196
|
+
return json.dumps({"error": "CLOUD_ORACLE_UNREACHABLE", "detail": str(exc)})
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def handle_jsonrpc_message(msg: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
200
|
+
method = msg.get("method", "")
|
|
201
|
+
req_id = msg.get("id")
|
|
202
|
+
|
|
203
|
+
if req_id is None and method.startswith("notifications/"):
|
|
204
|
+
return None
|
|
205
|
+
|
|
206
|
+
if method == "initialize":
|
|
207
|
+
return {
|
|
208
|
+
"jsonrpc": "2.0",
|
|
209
|
+
"id": req_id,
|
|
210
|
+
"result": {
|
|
211
|
+
"protocolVersion": "2025-06-18",
|
|
212
|
+
"serverInfo": {"name": "a2a-matrix-quad-oracle", "version": "2.0.0"},
|
|
213
|
+
"capabilities": {"tools": {}},
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if method == "tools/list":
|
|
218
|
+
return {
|
|
219
|
+
"jsonrpc": "2.0",
|
|
220
|
+
"id": req_id,
|
|
221
|
+
"result": {
|
|
222
|
+
"tools": [
|
|
223
|
+
{
|
|
224
|
+
"name": "scan_listing_copy_locally",
|
|
225
|
+
"description": "Free offline pre-publish guard: scans e-commerce titles & ad copy against 25 US Schedule-A TRO stealth wordmarks and 18 multilingual EU EmpCo (2024/825) greenwashing phrases.",
|
|
226
|
+
"inputSchema": {
|
|
227
|
+
"type": "object",
|
|
228
|
+
"properties": {
|
|
229
|
+
"title": {"type": "string"},
|
|
230
|
+
"bullet_points": {"type": "string", "default": ""},
|
|
231
|
+
"target_market": {"type": "string", "default": "EU"},
|
|
232
|
+
"has_iso14024_cert": {"type": "boolean", "default": False},
|
|
233
|
+
},
|
|
234
|
+
"required": ["title"],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": "check_fmc541_demurrage_stopclock",
|
|
239
|
+
"description": "Free offline US FMC 46 CFR Part 541 ocean container demurrage & detention stop-clock and 30-day billing bar forfeiture calculator.",
|
|
240
|
+
"inputSchema": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"properties": {
|
|
243
|
+
"billed_days": {"type": "integer", "default": 8},
|
|
244
|
+
"daily_rate_usd": {"type": "number", "default": 325.0},
|
|
245
|
+
"days_from_charge_to_invoice": {"type": "integer", "default": 37},
|
|
246
|
+
"missing_541_6_fields_count": {"type": "integer", "default": 0},
|
|
247
|
+
"verified_gate_or_empty_lockout_days": {"type": "integer", "default": 4},
|
|
248
|
+
"billed_party_role": {"type": "string", "default": "CONSIGNEE"},
|
|
249
|
+
"port_code": {"type": "string", "default": "USLAX"},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "benchmark_saas_renewal_quote",
|
|
255
|
+
"description": "Queries SaaSBench Cloud Oracle for GSA/DIR/G-Cloud unit price floors, commercial P25/P50/P75 percentiles, and anti-AI/MCP surcharge redlines (returns free 402 teaser if unpaid).",
|
|
256
|
+
"inputSchema": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"properties": {
|
|
259
|
+
"sku_slug": {"type": "string", "default": "crm-enterprise-plus-ai-agent-addon"},
|
|
260
|
+
"seat_count": {"type": "integer", "default": 100},
|
|
261
|
+
"quoted_unit_price_usd": {"type": "number", "default": 145.0},
|
|
262
|
+
},
|
|
263
|
+
"required": ["sku_slug"],
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "verify_ic_section5949_provenance",
|
|
268
|
+
"description": "Queries SiliconOrigin Cloud Oracle for unstructured PCN/EOL wafer-fab provenance under US NDAA Section 5949 and clean-fab DigiKey drop-in links.",
|
|
269
|
+
"inputSchema": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"properties": {
|
|
272
|
+
"mpn_slug": {"type": "string", "default": "pmic-buck-regulator-dual-fab-pcn"},
|
|
273
|
+
"contract_regime": {"type": "string", "default": "US_NDAA_5949"},
|
|
274
|
+
},
|
|
275
|
+
"required": ["mpn_slug"],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "discover_a2a_matrix_oracles",
|
|
280
|
+
"description": "Fetches live health, indexed record counts, and x402 discovery metadata from the A2A Data Matrix Quad-Oracle cloud gateway.",
|
|
281
|
+
"inputSchema": {"type": "object", "properties": {}},
|
|
282
|
+
},
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if method == "tools/call":
|
|
288
|
+
params = msg.get("params") or {}
|
|
289
|
+
tool_name = params.get("name")
|
|
290
|
+
args = params.get("arguments") or {}
|
|
291
|
+
|
|
292
|
+
if tool_name == "scan_listing_copy_locally":
|
|
293
|
+
res = scan_listing_copy_locally(
|
|
294
|
+
title=str(args.get("title", "")),
|
|
295
|
+
bullet_points=str(args.get("bullet_points", "")),
|
|
296
|
+
target_market=str(args.get("target_market", "EU")),
|
|
297
|
+
has_iso14024_cert=bool(args.get("has_iso14024_cert", False)),
|
|
298
|
+
)
|
|
299
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"content": [{"type": "text", "text": json.dumps(res, indent=2)}]}}
|
|
300
|
+
|
|
301
|
+
if tool_name == "check_fmc541_demurrage_stopclock":
|
|
302
|
+
res = solve_fmc541_demurrage_stopclock(
|
|
303
|
+
billed_days=int(args.get("billed_days", 8)),
|
|
304
|
+
daily_rate_usd=float(args.get("daily_rate_usd", 325.0)),
|
|
305
|
+
days_from_charge_to_invoice=int(args.get("days_from_charge_to_invoice", 37)),
|
|
306
|
+
missing_541_6_fields_count=int(args.get("missing_541_6_fields_count", 0)),
|
|
307
|
+
verified_gate_or_empty_lockout_days=int(args.get("verified_gate_or_empty_lockout_days", 4)),
|
|
308
|
+
billed_party_role=str(args.get("billed_party_role", "CONSIGNEE")),
|
|
309
|
+
port_code=str(args.get("port_code", "USLAX")),
|
|
310
|
+
)
|
|
311
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"content": [{"type": "text", "text": json.dumps(res, indent=2)}]}}
|
|
312
|
+
|
|
313
|
+
if tool_name == "benchmark_saas_renewal_quote":
|
|
314
|
+
txt = _call_cloud_get(
|
|
315
|
+
"/saasbench/api/v1/saasbench/verify",
|
|
316
|
+
{
|
|
317
|
+
"sku_slug": str(args.get("sku_slug", "crm-enterprise-plus-ai-agent-addon")),
|
|
318
|
+
"seat_count": int(args.get("seat_count", 100)),
|
|
319
|
+
"quoted_unit_price_usd": float(args.get("quoted_unit_price_usd", 145.0)),
|
|
320
|
+
},
|
|
321
|
+
)
|
|
322
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"content": [{"type": "text", "text": txt}]}}
|
|
323
|
+
|
|
324
|
+
if tool_name == "verify_ic_section5949_provenance":
|
|
325
|
+
txt = _call_cloud_get(
|
|
326
|
+
"/siliconorigin/api/v1/silicon/verify",
|
|
327
|
+
{
|
|
328
|
+
"mpn_slug": str(args.get("mpn_slug", "pmic-buck-regulator-dual-fab-pcn")),
|
|
329
|
+
"contract_regime": str(args.get("contract_regime", "US_NDAA_5949")),
|
|
330
|
+
},
|
|
331
|
+
)
|
|
332
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"content": [{"type": "text", "text": txt}]}}
|
|
333
|
+
|
|
334
|
+
if tool_name == "discover_a2a_matrix_oracles":
|
|
335
|
+
txt = _call_cloud_get("/healthz")
|
|
336
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {"content": [{"type": "text", "text": txt}]}}
|
|
337
|
+
|
|
338
|
+
return {"jsonrpc": "2.0", "id": req_id, "error": {"code": -32602, "message": f"Unknown tool: {tool_name}"}}
|
|
339
|
+
|
|
340
|
+
return {"jsonrpc": "2.0", "id": req_id, "error": {"code": -32601, "message": f"Method not found: {method}"}}
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def main() -> None:
|
|
344
|
+
"""Line-delimited JSON-RPC 2.0 stdio MCP entrypoint."""
|
|
345
|
+
for raw_line in sys.stdin:
|
|
346
|
+
line = raw_line.strip()
|
|
347
|
+
if not line:
|
|
348
|
+
continue
|
|
349
|
+
try:
|
|
350
|
+
msg = json.loads(line)
|
|
351
|
+
resp = handle_jsonrpc_message(msg)
|
|
352
|
+
if resp is not None:
|
|
353
|
+
sys.stdout.write(json.dumps(resp) + "\n")
|
|
354
|
+
sys.stdout.flush()
|
|
355
|
+
except Exception as exc:
|
|
356
|
+
err = {"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": str(exc)}}
|
|
357
|
+
sys.stdout.write(json.dumps(err) + "\n")
|
|
358
|
+
sys.stdout.flush()
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
if __name__ == "__main__":
|
|
362
|
+
main()
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: a2a-matrix-quad-oracle
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A2A Data Matrix Quad-Oracle — Deterministic MCP & x402 Oracles for Schedule-A/EmpCo, GSA SaaS Floors, FMC 541 Demurrage & NDAA 5949 IC Provenance
|
|
5
|
+
Project-URL: Homepage, https://github.com/heroson86462-hsnu/a2a-matrix-quad-oracle
|
|
6
|
+
Project-URL: Repository, https://github.com/heroson86462-hsnu/a2a-matrix-quad-oracle
|
|
7
|
+
Project-URL: Issues, https://github.com/heroson86462-hsnu/a2a-matrix-quad-oracle/issues
|
|
8
|
+
Author-email: Edmund Hu <edmundhu@helloyunivia.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,compliance,empco,fmc-541,mcp,model-context-protocol,ndaa-5949,saas-pricing,x402
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.2.0; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
<!--
|
|
27
|
+
mcp-name: io.github.heroson86462-hsnu/a2a-matrix-quad-oracle
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
# A2A Data Matrix Quad-Oracle (`a2a-matrix-quad-oracle`)
|
|
31
|
+
|
|
32
|
+
**4-in-1 Deterministic Commercial Compliance, Regulatory & Procurement Oracles for AI Agents** (zero runtime LLM cost, `<5ms` deterministic evaluation, Streamable-HTTP MCP + `stdio` `uvx` + Base USDC `x402`).
|
|
33
|
+
|
|
34
|
+
[](https://registry.modelcontextprotocol.io)
|
|
35
|
+
[](https://a2a-matrix-quad-edge.a2a-data-matrix.workers.dev/.well-known/x402-manifest.json)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Included Deterministic Oracles
|
|
41
|
+
|
|
42
|
+
| Relay | Oracle | Deterministic Scope | Pricing (`x402` Base USDC) |
|
|
43
|
+
| :--- | :--- | :--- | :--- |
|
|
44
|
+
| **#06** | **ListingShield AI** | US Schedule-A TRO stealth wordmarks (`25+` active marks) + EU EmpCo Directive `2024/825` multilingual anti-greenwashing guard (`18` EN/DE/FR phrases) | Free offline `stdio` scan / `0.015 USDC` cloud |
|
|
45
|
+
| **#09** | **SaaSBench AI** | `15` Enterprise SaaS SKUs anchored by US GSA Advantage / USAspending / Texas DIR / UK G-Cloud floors + anti-AI/MCP overage redlines | `0.500 USDC` (free 402 teaser) |
|
|
46
|
+
| **#08** | **DemurrageAudit AI** | US eCFR Title 46 (`46 CFR Part 541`) 30-day billing bar forfeiture (`§541.7`), `§541.6` mandatory invoice fields, & terminal lockout stop-clock | Free offline `stdio` calc / `0.150 USDC` cloud |
|
|
47
|
+
| **#07** | **SiliconOrigin AI** | Unstructured OEM PCN/EOL tracking & US NDAA **Section 5949** wafer fab provenance (`15` high-frequency ICs) + clean-fab DigiKey drop-ins | `0.050 USDC` + authorized affiliate links |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Option 1: Zero-Install Remote Streamable-HTTP MCP
|
|
52
|
+
|
|
53
|
+
Add directly to Claude Desktop, Cursor, Windsurf, or Antigravity:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"a2a-matrix-quad-oracle": {
|
|
59
|
+
"type": "streamable-http",
|
|
60
|
+
"url": "https://a2a-matrix-quad-edge.a2a-data-matrix.workers.dev/mcp"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Option 2: Free Local `stdio` MCP (`uvx`)
|
|
67
|
+
|
|
68
|
+
Includes offline zero-cost `scan_listing_copy_locally` and `check_fmc541_demurrage_stopclock` plus cloud-oracle bridges:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"a2a-matrix-quad-oracle": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": [
|
|
76
|
+
"--from",
|
|
77
|
+
"git+https://github.com/heroson86462-hsnu/a2a-matrix-quad-oracle",
|
|
78
|
+
"a2a-matrix-quad-oracle"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Live Cloud Endpoints & Interactive Sandbox
|
|
88
|
+
|
|
89
|
+
* **Interactive Cloud Command Center**: https://a2a-matrix-quad-edge.a2a-data-matrix.workers.dev/
|
|
90
|
+
* **Discovery**: `/.well-known/mcp.json` · `/.well-known/x402-manifest.json` · `/llms.txt` · `/healthz`
|
|
91
|
+
* **Companion Runtime Security Firewall (Wave 1)**: [`agenttrust-kye`](https://github.com/heroson86462-hsnu/agenttrust-kye) (`uvx agenttrust-kye`)
|
|
92
|
+
|
|
93
|
+
Built by **A2A Data Matrix Holdings Inc.** · Maintainer: Edmund Hu (`edmundhu@helloyunivia.com`)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
a2a_matrix_quad/__init__.py,sha256=woCjA5c6XLS8hVArAOYh6Q0XkYcyGsekgpmH9VZl9KM,135
|
|
2
|
+
a2a_matrix_quad/stdio_mcp.py,sha256=1diZdYFDrU31GHl9A99i9wcy95q_pO93vAhWGnqDGBc,18387
|
|
3
|
+
a2a_matrix_quad_oracle-2.0.0.dist-info/METADATA,sha256=Hex3jetQhynHAHmiVaKht4Z9OvDg-EzFej7YwYOqpyQ,4259
|
|
4
|
+
a2a_matrix_quad_oracle-2.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
5
|
+
a2a_matrix_quad_oracle-2.0.0.dist-info/entry_points.txt,sha256=DXUP_NWKgatSa7SIoBFJY0EMJiGrngSo6sfjixn-0sQ,127
|
|
6
|
+
a2a_matrix_quad_oracle-2.0.0.dist-info/licenses/LICENSE,sha256=6Hcs0G-sl4yNOaNcoyJiAFacffvEh98AEgB3w9B5w50,1098
|
|
7
|
+
a2a_matrix_quad_oracle-2.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 A2A Data Matrix Holdings Inc. (Edmund Hu)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|