deploy
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
2
a2a.yaml
2
a2a.yaml
@@ -1,5 +1,5 @@
|
||||
name: seleniumbase-website-scraper
|
||||
version: 0.2.5
|
||||
version: 0.2.6
|
||||
entrypoint: agent:BrowserToApiAgent
|
||||
expose:
|
||||
public: true
|
||||
|
||||
33
agent.py
33
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)
|
||||
|
||||
Reference in New Issue
Block a user