Skip to content

chrome-devtools-cli v1.0.1

Latest

Choose a tag to compare

@aeroxy aeroxy released this 05 Jun 13:41

1. High-Level Summary (TL;DR)

  • Impact: Medium - Enhances the third-party developer tools integration by supporting multiple tool groups per page instead of limiting it to a single group.
  • Key Changes:
    • ✨ Updated list_3p_tools to parse and format an array of toolGroups while maintaining fallback support for the legacy single toolGroup.
    • ✨ Refactored execute_3p_tool to locate and execute a specific tool by iterating through available tool groups if the global executeTool method is missing.
    • 🐛 Improved terminal output formatting to clearly distinguish between multiple tool groups and their respective tools.

2. Detailed Change Analysis

Component: Third-Party Commands

What Changed:

  • Tool Listing Update: The injected JavaScript payload inside list_3p_tools() was updated to preferentially look for dtmcp.toolGroups (an array). If not found, it falls back to the legacy dtmcp.toolGroup. The Rust-side JSON parser was adapted to iterate over the new groups key and properly indent the available tools under each group header (Source: src/commands/third_party.rs).
  • Tool Execution Logic: execute_3p_tool() now checks if a global dtmcp.executeTool exists. If it doesn't, it loops through the registered toolGroups, finds the requested tool by name, and directly invokes its own tool.execute(params) method (Source: src/commands/third_party.rs).

Data Structure Changes

Object / Field Old Structure New Structure Description
JS Listing Payload { name, description, tools: [] } { groups: [{ name, description, tools: [] }] } Normalizes the returned payload to always provide an array of groups to Rust.
Execution Call dtmcp.executeTool(name, params) tool.execute(params) (fallback) Allows individual tools inside a group to define their own execute method.

3. Impact & Risk Assessment

  • ⚠️ Breaking Changes: None. The changes are fully backward-compatible. Pages utilizing the older window.__dtmcp.toolGroup and window.__dtmcp.executeTool structures will continue to function seamlessly through fallback logic.