feat: Add DOM inspection and manipulation tools for canvas

- inspect_window: Inspect HTML content of a window with selector filter
- get_canvas: Read canvas elements using CSS selectors (like Read tool)
- edit_canvas: Edit canvas elements with old/new value replacement (like Edit tool)
- canvas_css: Inject/update/remove CSS blocks with ID tracking
- canvas_js: Execute JavaScript in canvas context with helper functions
- get_canvas_css: List or get specific injected CSS blocks
This commit is contained in:
2026-02-14 20:07:25 -06:00
parent d9eaba393b
commit 5fd57ba70f
3 changed files with 315 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ function getToolConfigs(): Map<string, ToolConfig> {
// Category to tool names mapping
const categoryTools: Record<ToolCategory, string[]> = {
global: ['get_current_page', 'navigate_to', 'list_available_tools', 'activate_tool', 'deactivate_tool', 'pin_tool', 'page_refresh'],
canvas: ['render_html', 'render_vue_component', 'move_window', 'resize_window', 'close_window', 'list_windows'],
canvas: ['render_html', 'render_vue_component', 'move_window', 'resize_window', 'close_window', 'list_windows', 'inspect_window', 'get_canvas', 'edit_canvas', 'canvas_css', 'canvas_js', 'get_canvas_css'],
component: ['save_vue_component', 'load_vue_component', 'list_vue_components', 'delete_vue_component'],
theme: ['get_design_tokens', 'get_active_theme', 'set_theme_variable', 'save_theme', 'list_themes', 'switch_theme', 'reset_theme'],
database: ['list_tables', 'get_table_schema', 'get_table_data', 'get_database_stats', 'execute_query'],