mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
fix(mobile-mcp): strip bounds attributes from UI hierarchy dump
Remove bounds coordinates from mobile_ui_dump XML output to reduce token consumption when LLMs process the hierarchy tree.
This commit is contained in:
parent
d8084c63bc
commit
3764699a61
1 changed files with 2 additions and 1 deletions
|
|
@ -1247,7 +1247,8 @@ export const createMcpServer = (): McpServer => {
|
|||
{ readOnlyHint: true },
|
||||
async ({ device, compressed, output_path }) => {
|
||||
const robot = getAndroidRobotFromDevice(device, 'mobile_ui_dump');
|
||||
const xml = await robot.dumpUiHierarchy(compressed ?? false);
|
||||
let xml = await robot.dumpUiHierarchy(compressed ?? false);
|
||||
xml = xml.replace(/ bounds="\[[0-9,]+\]\[[0-9,]+\]"/g, '');
|
||||
if (output_path) {
|
||||
validateOutputPath(output_path);
|
||||
fs.writeFileSync(output_path, xml, 'utf-8');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue