enable_webasyst_ui
Enable Webasyst UI 2.0 design system in projects by configuring components, icons, and color schemes for consistent interface development.
Instructions
Подключить дизайн-систему Webasyst UI 2.0
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_type | Yes | ||
| target_path | Yes | ||
| include_icons | No | ||
| include_components | No | ||
| include_color_scheme | No |
Implementation Reference
- webasyst-mcp.js:989-1006 (handler)The core handler function for the 'enable_webasyst_ui' tool. It creates the necessary CSS file (wa-ui-variables.css) for custom UI variables and the ui_wrapper.html template to include Webasyst UI 2.0 styles.async function enableWebasystUITool({ project_type, target_path, include_icons = true, include_components = true, include_color_scheme = true }) { await ensureDir(target_path, 'css'); let css = ''; if (include_color_scheme) { css += `:root { /* extend UI 2.0 variables here if нужно */ } `; } await fs.writeFile(path.join(target_path, 'css', 'wa-ui-variables.css'), css); await ensureDir(target_path, 'templates'); const wrapper = `{* Webasyst UI wrapper *} <link rel="stylesheet" href="{$wa_url}wa-content/css/wa/wa-2.0.css"> <link rel="stylesheet" href="{$wa_app_static_url}css/wa-ui-variables.css"> `; await fs.writeFile(path.join(target_path, 'templates', 'ui_wrapper.html'), wrapper); return { content: [{ type: 'text', text: `Webasyst UI 2.0 подключен к ${project_type}` }] }; }
- webasyst-mcp.js:1795-1795 (registration)Registration of the tool handler in the MCP server's CallToolRequestSchema dispatcher switch statement.case 'enable_webasyst_ui': return await enableWebasystUITool(args);
- webasyst-mcp.js:1733-1735 (schema)Tool schema definition including input parameters, registered in the ListToolsRequestSchema handler.{ name: 'enable_webasyst_ui', description: 'Подключить дизайн-систему Webasyst UI 2.0', inputSchema: { type: 'object', properties: { project_type: { type: 'string' }, target_path: { type: 'string' }, include_icons: { type: 'boolean' }, include_components: { type: 'boolean' }, include_color_scheme: { type: 'boolean' } }, required: ['project_type', 'target_path'] } }, { name: 'create_ui_component', description: 'Сгенерировать UI-компонент Webasyst 2.0', inputSchema: { type: 'object', properties: { component_type: { type: 'string', enum: ['table', 'form', 'modal', 'drawer', 'chips', 'bricks', 'upload', 'bottombar', 'userpic_list', 'slider', 'toggle', 'switch', 'skeleton', 'tabs', 'progressbar', 'tooltip', 'autocomplete', 'menu', 'alert', 'paging', 'breadcrumbs', 'spinner', 'dropdown', 'card'], description: 'Тип компонента: table, form, modal, drawer, chips, bricks, upload, bottombar, userpic_list, slider, toggle, switch, skeleton, tabs, progressbar, tooltip, autocomplete, menu, alert, paging, breadcrumbs, spinner, dropdown, card' }, component_name: { type: 'string', description: 'Уникальное имя компонента (латиница, без пробелов)' }, target_path: { type: 'string', description: 'Путь к приложению/плагину' }, with_js: { type: 'boolean', default: true, description: 'Создать JS-инициализацию (для modal, drawer, upload, slider, toggle, tabs, progressbar, tooltip, autocomplete, switch, dropdown)' } }, required: ['component_type', 'component_name', 'target_path'] } },