diff --git a/.a2a/agent.dsl.json b/.a2a/agent.dsl.json index 44d4e29..ad720ed 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.6", + "version": "0.2.7", "entrypoint": { "module": "agent", "class_name": "BrowserToApiAgent", @@ -381,7 +381,7 @@ "source": "python-a2a-pack", "project_manifest": { "name": "seleniumbase-website-scraper", - "version": "0.2.6", + "version": "0.2.7", "entrypoint": "agent:BrowserToApiAgent" } } diff --git a/a2a.yaml b/a2a.yaml index 6f9f968..37dec1b 100644 --- a/a2a.yaml +++ b/a2a.yaml @@ -1,5 +1,5 @@ name: seleniumbase-website-scraper -version: 0.2.6 +version: 0.2.7 entrypoint: agent:BrowserToApiAgent expose: public: true diff --git a/agent.py b/agent.py index ea60cd7..e76eb91 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.6" + version = "0.2.7" config_model = BrowserToApiConfig auth_model = NoAuth @@ -1641,6 +1641,13 @@ def _try_json_object(text: str) -> dict[str, Any] | None: return parsed if isinstance(parsed, dict) else None +def _truncate_text(value: Any, limit: int = 240) -> str: + text = str(value or "").replace("\n", " ").strip() + if len(text) <= limit: + return text + return f"{text[: max(0, limit - 3)]}..." + + def _json_loads(line: str) -> Any: try: return json.loads(line)