From 6fa8ee19fae0c8f0cfa9048202dc93c3b0de1157 Mon Sep 17 00:00:00 2001 From: a2a-platform Date: Sat, 27 Jun 2026 16:57:46 +0000 Subject: [PATCH] deploy --- .a2a/agent.dsl.json | 4 ++-- a2a.yaml | 2 +- agent.py | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.a2a/agent.dsl.json b/.a2a/agent.dsl.json index 3c4ca75..44d4e29 100644 --- a/.a2a/agent.dsl.json +++ b/.a2a/agent.dsl.json @@ -3,7 +3,7 @@ "language": "python", "name": "seleniumbase-website-scraper", "description": "SeleniumBase-style browser agent that turns observed website traffic into OpenAPI specs, coverage reports, samples, and a replay client.", - "version": "0.2.5", + "version": "0.2.6", "entrypoint": { "module": "agent", "class_name": "BrowserToApiAgent", @@ -381,7 +381,7 @@ "source": "python-a2a-pack", "project_manifest": { "name": "seleniumbase-website-scraper", - "version": "0.2.5", + "version": "0.2.6", "entrypoint": "agent:BrowserToApiAgent" } } diff --git a/a2a.yaml b/a2a.yaml index 1cd1156..6f9f968 100644 --- a/a2a.yaml +++ b/a2a.yaml @@ -1,5 +1,5 @@ name: seleniumbase-website-scraper -version: 0.2.5 +version: 0.2.6 entrypoint: agent:BrowserToApiAgent expose: public: true diff --git a/agent.py b/agent.py index f72dac9..ea60cd7 100644 --- a/agent.py +++ b/agent.py @@ -129,7 +129,7 @@ class BrowserToApiAgent(A2AAgent[BrowserToApiConfig, NoAuth]): "SeleniumBase-style browser agent that turns observed website traffic " "into OpenAPI specs, coverage reports, samples, and a replay client." ) - version = "0.2.5" + version = "0.2.6" config_model = BrowserToApiConfig auth_model = NoAuth @@ -1610,6 +1610,37 @@ def _parse_maybe_json(value: Any) -> Any: return text[:100_000] +def _parse_json_object(value: Any) -> dict[str, Any] | None: + if isinstance(value, dict): + return value + if not isinstance(value, str): + return None + text = value.strip() + if not text: + return None + parsed = _try_json_object(text) + if parsed is not None: + return parsed + fenced = re.search(r"```(?:json)?\s*(\{.*?\})\s*```", text, flags=re.DOTALL | re.IGNORECASE) + if fenced: + parsed = _try_json_object(fenced.group(1)) + if parsed is not None: + return parsed + start = text.find("{") + end = text.rfind("}") + if start >= 0 and end > start: + return _try_json_object(text[start : end + 1]) + return None + + +def _try_json_object(text: str) -> dict[str, Any] | None: + try: + parsed = json.loads(text) + except Exception: + return None + return parsed if isinstance(parsed, dict) else None + + def _json_loads(line: str) -> Any: try: return json.loads(line)