mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix(browser): fix extension result passthrough, add DOM actions
- Fix result normalization: non-dict values no longer crash with **spread - Add 20+ DOM actions to extension_actions set (get/set HTML/text, attributes, styles, classes, mutations, localStorage, cookies, etc.) - Bump hanzo-tools-browser 0.4.3, hanzo-mcp 0.12.6
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-mcp"
|
||||
version = "0.12.5"
|
||||
version = "0.12.6"
|
||||
description = "The Zen of Hanzo MCP: One server to rule them all. The ultimate MCP that orchestrates all others."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
@@ -836,6 +836,13 @@ CATEGORIES:
|
||||
"type", "fill", "clear", "press_key", "press",
|
||||
"select_option", "check", "uncheck",
|
||||
"evaluate", "wait", "wait_for_load",
|
||||
"get_html", "set_html", "get_text", "set_text",
|
||||
"get_attribute", "set_attribute", "remove_attribute",
|
||||
"set_style", "add_class", "remove_class",
|
||||
"insert_element", "remove_element",
|
||||
"observe_mutations", "computed_styles", "bounding_rects",
|
||||
"inject_script", "inject_css",
|
||||
"local_storage", "cookies",
|
||||
"tabs", "new_tab", "close_tab", "select_tab",
|
||||
"console", "network_requests", "status",
|
||||
# Takeover actions (Phase 3)
|
||||
@@ -868,10 +875,13 @@ CATEGORIES:
|
||||
level=level,
|
||||
)
|
||||
if ext_result is not None and "error" not in ext_result:
|
||||
# Normalize response
|
||||
if "result" in ext_result:
|
||||
ext_result = ext_result["result"]
|
||||
return {"success": True, "source": "extension", **ext_result}
|
||||
# Build normalized response from extension bridge result
|
||||
resp: dict[str, Any] = {"success": True, "source": "extension"}
|
||||
if isinstance(ext_result, dict):
|
||||
resp.update(ext_result)
|
||||
else:
|
||||
resp["result"] = ext_result
|
||||
return resp
|
||||
|
||||
# For explicit backends (firefox/chrome/extension), don't fall back to Playwright
|
||||
if backend in ("firefox", "chrome", "extension"):
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-tools-browser"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
description = "Browser automation tools with extension-first routing - uses Hanzo browser extension when available, Playwright as fallback"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
Reference in New Issue
Block a user