feat: Add terminal UI control tools for MCP
- Add 5 terminal tools: open, close, toggle, move, resize - Create terminalHandlers.ts with UI control functions - Add terminal category to toolDefinitions and toolRegistry - Expose FloatingTerminal controls via defineExpose - Connect controls in App.vue via setTerminalControls - Fix ToolsDropdown missing terminal category
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
createDatabaseHandlers,
|
||||
createProjectCanvasHandlers,
|
||||
createSourceCodeHandlers,
|
||||
createTerminalHandlers,
|
||||
type ToolConfig
|
||||
} from './tools/handlers'
|
||||
import { setRouter } from './tools/handlers/globalHandlers'
|
||||
@@ -111,7 +112,8 @@ function getToolConfigs(): Map<string, ToolConfig> {
|
||||
...createThemeHandlers(),
|
||||
...createDatabaseHandlers(),
|
||||
...createProjectCanvasHandlers(),
|
||||
...createSourceCodeHandlers()
|
||||
...createSourceCodeHandlers(),
|
||||
...createTerminalHandlers()
|
||||
]
|
||||
|
||||
for (const config of allHandlers) {
|
||||
@@ -129,21 +131,22 @@ const categoryTools: Record<ToolCategory, string[]> = {
|
||||
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'],
|
||||
source: ['get_repo_info', 'list_repo_files', 'read_repo_file', 'search_repo_code'],
|
||||
project: ['list_canvases', 'create_canvas', 'get_canvas', 'update_canvas', 'delete_canvas', 'clone_canvas', 'add_component_to_canvas', 'remove_component_from_canvas', 'get_canvas_components']
|
||||
project: ['list_canvases', 'create_canvas', 'get_canvas', 'update_canvas', 'delete_canvas', 'clone_canvas', 'add_component_to_canvas', 'remove_component_from_canvas', 'get_canvas_components'],
|
||||
terminal: ['terminal_open', 'terminal_close', 'terminal_toggle', 'terminal_move', 'terminal_resize']
|
||||
}
|
||||
|
||||
// Page to categories mapping
|
||||
const pageCategories: Record<PageName, ToolCategory[]> = {
|
||||
home: ['global', 'canvas', 'component', 'project'],
|
||||
canvas: ['global', 'canvas', 'component'],
|
||||
'project-canvas': ['global', 'canvas', 'component', 'project'],
|
||||
projects: ['global', 'project'],
|
||||
components: ['global', 'component'],
|
||||
themes: ['global', 'theme'],
|
||||
database: ['global', 'database'],
|
||||
source: ['global', 'source'],
|
||||
terminal: ['global'],
|
||||
tools: ['global']
|
||||
home: ['global', 'canvas', 'component', 'project', 'terminal'],
|
||||
canvas: ['global', 'canvas', 'component', 'terminal'],
|
||||
'project-canvas': ['global', 'canvas', 'component', 'project', 'terminal'],
|
||||
projects: ['global', 'project', 'terminal'],
|
||||
components: ['global', 'component', 'terminal'],
|
||||
themes: ['global', 'theme', 'terminal'],
|
||||
database: ['global', 'database', 'terminal'],
|
||||
source: ['global', 'source', 'terminal'],
|
||||
terminal: ['global', 'terminal'],
|
||||
tools: ['global', 'terminal']
|
||||
}
|
||||
|
||||
let currentPage: PageName | null = null
|
||||
|
||||
Reference in New Issue
Block a user