mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix(browser): unwrap CDP Runtime.evaluate results for consistency
The CDP bridge server now unwraps Runtime.evaluate results from the
nested CDP format {result: {type, value}} to just the value, matching
Playwright's evaluate return format.
Also bumps hanzo-tools-browser to 0.4.5 and hanzo-mcp to 0.12.9.
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-mcp"
|
||||
version = "0.12.8"
|
||||
version = "0.12.9"
|
||||
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"
|
||||
@@ -30,7 +30,7 @@ dependencies = [
|
||||
"hanzo-tools>=0.3.0",
|
||||
"hanzo-tools-fs>=0.1.0",
|
||||
"hanzo-tools-shell>=0.6.1",
|
||||
"hanzo-tools-browser[playwright]>=0.4.2", # Extension-first routing, Playwright fallback
|
||||
"hanzo-tools-browser[playwright]>=0.4.5", # Extension-first routing, Playwright fallback
|
||||
"hanzo-tools-memory>=0.2.0",
|
||||
"hanzo-tools-todo>=0.1.0",
|
||||
"hanzo-tools-reasoning>=0.1.0",
|
||||
|
||||
@@ -326,12 +326,22 @@ class CDPBridgeServer:
|
||||
# Wait for response with timeout
|
||||
response = await asyncio.wait_for(future, timeout=30.0)
|
||||
|
||||
# Unwrap CDP-specific result formats for consistency with Playwright
|
||||
raw_result = response.get("result", {})
|
||||
if method == "Runtime.evaluate" and isinstance(raw_result, dict):
|
||||
# CDP returns {result: {type, value}} — extract the value
|
||||
cdp_result = raw_result.get("result", {})
|
||||
if isinstance(cdp_result, dict) and "value" in cdp_result:
|
||||
raw_result = cdp_result["value"]
|
||||
elif isinstance(cdp_result, dict) and cdp_result.get("type") == "undefined":
|
||||
raw_result = None
|
||||
|
||||
# Return result
|
||||
return web.json_response(
|
||||
{
|
||||
"success": True,
|
||||
"client_id": target_client.client_id,
|
||||
"result": response.get("result", {}),
|
||||
"result": raw_result,
|
||||
},
|
||||
headers={"Access-Control-Allow-Origin": "*"},
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hanzo-tools-browser"
|
||||
version = "0.4.4"
|
||||
version = "0.4.5"
|
||||
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