es-plus

v2.0.0
io.github.liujiaao/es-plus Checked 4 hours ago Published 19 days ago

Generate runnable Vue 3 / Vue 2 CRUD pages from one JSON config or a natural-language request.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

detect_project_target

Detect which es-plus target (vue3 / vue2 / antdv) matches the user's project, given the project's package.json content. The MCP client (e.g. Claude Code) reads the file from the workspace and passes it here. Use this BEFORE calling generate_scene / generate_composition / generate_crud / generate_crud_from_config / generate_form / generate_table / generate_dialog (or the legacy generate_crud_schema) / get_component_api so you pick the right target instead of defaulting to vue3.

ParameterTypeDescription
packageJson *stringRaw string content of the user project's package.json. Read it with your file-read tool (e.g. read_file) and pass the full JSON text here.

generate_scene

FRONT DOOR — SCENE ROUTER: the scene-first way to generate es-plus code. Call with `scene` = what the user is building ('crud' page / standalone 'table' / standalone 'form' / 'dialog') and `intent` = that scene's intent table. For scene='crud' the intent is exactly the generate_crud argument object (name, apiUrl, surfaces — your one reasoning step is still filling `surfaces`); for the fragment scenes it is exactly the generate_table / generate_form / generate_dialog argument object. Routing and emission are deterministic, and the output is byte-identical to the corresponding legacy tool. W…

ParameterTypeDescription
intent *objectThe scene's intent table. scene='crud': the page intent (name/apiUrl/surfaces/…). scene='table'|'form'|'dialog': that standalone artifact's intent (fields/…). Fill only the keys for the chosen sce…
scenestringWhich artifact the user wants: 'crud' (a full page with a table — the composite case), 'table' (one standalone es-table), 'form' (one standalone es-form), 'dialog' (one reusable add/edit dialog). Pi…

generate_composition

PAGE COMPOSER — assemble several standalone fragments into ONE working page (Page.vue + one file per node). Give it 1+ nodes, each `{ id, role?, scene, intent }` where scene is 'table' / 'form' / 'dialog' (at most one form; tables and dialogs may repeat) and intent is exactly that scene's standalone intent object. The wiring is derived deterministically from the artifact runtime contract: a row button whose key equals a dialog node id opens that dialog (title from the dialog intent's defaultTitle); the query form reloads the default table from page 1; reset reloads it with cleared filters; s…

ParameterTypeDescription
nodes *arrayThe page's nodes: at most one 'form'; 'table' and 'dialog' may repeat (master-detail, multi-dialog). A row button whose key equals a dialog node id opens that dialog.
behaviorstringData-wiring mode (default 'data-wiring'). 'data-wiring' derives query/reset → default table reload and dialog onSuccess → default table refresh; it does NOT generate HTTP requests (fragment intent…
namestringDisplay name for the composed page (summary only). The component name is always ComposedPage.
targetstringPage target. Defaults to the first node's explicit target, then vue3. All nodes must share one target.
wiresarrayExplicit wiring, validated against the same runtime contract as derived wiring. An explicit wire overrides the derived wire for the same source (node + channel + rowAction key). Row-action targets rec…

generate_crud

COMPAT ENTRY (adapter) — same product as generate_scene with scene='crud' (byte-identical), kept for hosts that already call this name. Use it for ANY request that involves a list/table, CRUD, search + results, or multiple es-plus pieces working together. Your ONE job is to fill `surfaces`: set query/table/form field lists and the dialog list to match what the request implies (any subset is valid — table-only, query+table, table+add/edit, full CRUD, etc.). A `surfaces.dialog` entry is either a canned key ('add'/'edit'/'view') or a full object `{ key, title?, width?, fullscreen?, formItems?…

generate_form

Generate a STANDALONE <es-form> component — a self-contained .vue SFC (own reactive model + formItemList) that drops next to native/third-party components with zero scope collision. Use this ONLY when the user explicitly wants a single form on its own (a search filter, a settings form, a form embedded in a custom layout). For a full CRUD page (query + table + add/edit/delete) use generate_scene (scene='crud') instead — do NOT hand-assemble a CRUD page from separate fragment tools. The field vocabulary is identical to that scene's intent table; map meaning → formtype the same way. Field-l…

generate_table

Generate a STANDALONE <es-table> component — a self-contained .vue SFC (columns + options + data-source/pagination refs) that drops next to native/third-party components. Give apiUrl for auto-fetch via es-table's apiParams. Use this ONLY when the user explicitly wants a single table on its own. For a full CRUD page (query + table + add/edit/delete) use generate_scene (scene='crud') instead. Operation-column buttons emit a `row-action` event (`{ key, row }`) from an inlined clickEvent, so the fragment always compiles in isolation — this is not the CRUD page's `triggerEvent` (query/reset too…

generate_dialog

Generate a STANDALONE dialog with the integration contract open(title, row?, onSuccess?) — after a successful submit it calls onSuccess, where the host refreshes its OWN table (the same contract in both output shapes). mode='composable' (default) emits a reusable useXxxDialog() composable (a .tsx/.jsx module, dialog body is a JSX render — needs the JSX plugin). mode='component' emits a self-contained <es-dialog> SFC instead (no JSX plugin needed; the host must have registered es-plus globally). Use this ONLY when the user explicitly wants a reusable add/edit dialog on its own, or to pair w…

generate_crud_schema

LEGACY FALLBACK (deprecated): generate CrudPageSchema JSON + minimal wrapper SFC from a natural language description using a REGEX/keyword parser. For natural-language requests use generate_crud (the front-door tool); for a config you already hold use generate_crud_from_config (ADVANCED) — both compile through the same deterministic generator. Keep this only for a quick prototype or a no-LLM host. Produces <es-crud-page> schema output. Supports vue3 (default) / vue2 / antdv targets.

ParameterTypeDescription
description *stringNatural language description of the CRUD page. Example: '用户管理,查询姓名、手机号、状态,表格显示姓名、手机号、邮箱、状态,支持新增编辑删除'
targetstringTarget framework: 'vue3' (default, @es-plus/vue3 + Element Plus), 'vue2' (@es-plus/vue2 + Element UI), or 'antdv' (@es-plus/adapter-antdv + Ant Design Vue). Schema JSON is target-agnostic; only wrappe…

generate_crud_from_config

ADVANCED path — hand-authored StructuredCrudConfig (typed fields, not a JSON blob). For a natural-language request, use generate_scene (scene='crud', the front door) instead: it asks you for `surfaces` and routes deterministically, so you do not have to fill the whole config. Use this tool when you ALREADY hold a typed config (e.g. one you persist, diff, or edited via refine_config) or need direct access to config keys the front door does not expose. It runs the same deterministic generator and schema gate as the front door, and it REPAIRS before judging: key aliases, relocated/nested keys,…

validate_config

Validate an es-plus JSON configuration against its schema. Returns validation errors and fix suggestions. READ-ONLY: it judges and never repairs — format mistakes that the generators auto-fix (key aliases, relocated/nested keys, null placeholders, 'false'-style string booleans, dialog shorthands like dialogs:["add"]) are reported here as errors. Use this to inspect a config; the generator tools repair such mistakes before generating (they report each repair).

ParameterTypeDescription
config *stringJSON string of the es-plus configuration to validate
typestringSchema type to validate against. Available: api-params, btn-config, dialog-options, form-item, table-column, table-options, structured-crud-config (the input of generate_crud_from_config), es-table-co…

list_form_types

List all 16 available form field types (formtype) shared by es-plus on all three targets (vue3 / vue2 / antdv), with descriptions and usage examples.

ingest_schema

Pre-fill a structured CRUD config from an existing schema (OpenAPI JSON, JSON Schema, a sample JSON object, a TypeScript interface/type literal, or SQL CREATE TABLE DDL). Deterministic, no LLM: it maps each property's DATA TYPE to a formtype (integer→InputNumber, boolean→Switch, string+date→DatePicker, string+enum→Select, array+enum→Checkbox, else Input). For ts-interface, JSDoc becomes the label and non-optional members become required; for sql-ddl, COMMENT becomes the label and NOT NULL/PRIMARY KEY become required. Use this as a HEAD START, then review & edit the draft (narrow the…

ParameterTypeDescription
kind *stringWhich kind of schema `text` is.
text *stringThe schema source text (JSON for openapi/jsonSchema; a JSON object or array for sample-json; TypeScript interface/type source for ts-interface; CREATE TABLE DDL for sql-ddl).
apiUrlstringOverride the REST base URL, e.g. "/api/users". Defaults to a placeholder you must replace.
namestringOverride the page name (PascalCase). Defaults to the schema title, else a placeholder.

refine_config

Apply ONE round of refinement to a pinned CRUD config. The pin is just the StructuredCrudConfig JSON you (the host) already hold — there is no server-side session. YOU apply the user's natural-language correction to produce the `revised` config, then call this tool with the `previous` (last-pinned) and `revised` JSON. It deterministically (1) validates `revised` against the authoritative schema and (2) returns a structured DIFF of what this round changed — fields added/removed, formtype/membership changes, actions, AND changed top-level blocks (dialogs / formLayout / tableOptions / buttons…

ParameterTypeDescription
revised *stringJSON string of the config after you applied the user's correction.
previousstringJSON string of the previously pinned config (omit for the first round).

validate_intent

READ-ONLY pre-flight for a generate_scene intent table: returns the scene capability report (es-plus.capabilities@1 — which keys are accepted / degraded / unsupported / missing) plus deterministic per-field issues (unknown surfaces, duplicate props, missing formtype, membership flags such as inQuery, labels absent from the spec, system fields inside an editable form, malformed dialog entries). It judges and never repairs or generates. Call it after extracting surfaces from a PRD / wireframe and before generating; fix the errors and re-run.

ParameterTypeDescription
intent *objectThe scene intent table (scene='crud': name/apiUrl/surfaces…; fragments: fields…). The same object you would pass as generate_scene's `intent`.
scenestringThe scene the intent is for — same value you would pass to generate_scene.
specstringOptional spec text (PRD / wireframe transcription). When present, every field label must appear verbatim in it — the check catches labels the host paraphrased instead of copying.

coverage_report

READ-ONLY per-page coverage classification for a structured spec inventory: L1 = generate_scene emits the page faithfully with no post-edit (metadata-only keys such as name/apiUrl/mode may lack a carrier but need no host edit); L2 = it emits, but a behavior-bearing key is degraded, the page composes several fragments, or the host declares extension points; L3 = an intent key is unsupported / required keys are missing / the intent shape is invalid / the host declares code of its own. The verdict comes from the es-plus.capabilities@1 ledger (assessIntent) plus the same front-door Zod shapes, not…

ParameterTypeDescription
pages *arrayThe structured page inventory (one entry per page of the spec).

read_page

Recover the generator input from a page es-plus produced. Pages carry their own provenance (`__esPlusSource` inside pageSchema, or a `// __esPlusSource:` comment in sfc mode), so this unzips the recorded input instead of re-inferring a config from the rendered output. It is NOT a claim that artifact and input are identical: every place they differ (dropped unknown keys, keys the mode ignores, non-JSON values, deterministic repairs) is listed in `lossy[]`. Pass the full source of `schema.ts` / `Page.vue` / a bare pageSchema JSON. Returns `config` (exactly what the generator was given, after nor…

ParameterTypeDescription
code *stringFull source text of the generated page: schema.ts, Page.vue (sfc mode), or a bare pageSchema JSON.
labelstringName used in error messages (e.g. the file name). Defaults to "page".

get_component_api

Get the full API documentation for an es-plus component, including TypeScript interfaces, props, methods, and usage examples. Specify target='vue2' for @es-plus/vue2 + Element UI variants, target='antdv' for @es-plus/adapter-antdv + Ant Design Vue; default is target='vue3'.

ParameterTypeDescription
component *stringComponent name: EsForm, EsTable, EsDialog, EsCrudPage, SvgIcon, or useDialog (detailed docs for all six; the EsTable doc also covers the vxe engine)
targetstringTarget framework: 'vue3' (default, @es-plus/vue3 + Element Plus), 'vue2' (@es-plus/vue2 + Element UI), or 'antdv' (@es-plus/adapter-antdv + Ant Design Vue, Vue 3 syntax). Match the user's project.

scaffold_page

Generate a minimal es-plus page scaffold (.vue SFC) — plus the SAME `preflight` checklist that generated CRUD pages emit (httpRequest / permission / t / JSX plugin / UI library), with a copy-once app-entry boilerplate (vue3: `app.use(ESPlus, { permission, t, httpRequest })`, vue2: `Vue.use`). Supports vue3 (default) / vue2 / antdv targets. Use this when you need a blank starting template; use `doctor_page` to check an entry the host already has.

ParameterTypeDescription
name *stringPage name in kebab-case, e.g. 'user-management'
featuresarrayFeatures to include. Defaults to ['query', 'table']. Options: query, table, dialog
targetstringTarget framework: 'vue3' (default, <script setup> + @es-plus/vue3), 'vue2' (defineComponent + setup() + @es-plus/vue2), or 'antdv' (<script setup> + @es-plus/adapter-antdv + Ant Design Vue)

doctor_page

Static-check a host app entry against the es-plus preflight checklist (UI library, ESPlus plugin registration, httpRequest, permission, t, JSX transform). Pass the entry source and optionally the config the page was generated from (so only the capabilities that page actually needs are required) plus vite.config source (for UI auto-import / JSX plugin). Literal scan only: results are ok / missing / unverified — unverified means the item may be satisfied elsewhere and must be checked by hand.

ParameterTypeDescription
entry *stringSource of the app entry, e.g. src/main.ts (or src/main.js for vue2).
configobjectOptional: the StructuredCrudConfig the page was generated from. When given, permission / t / httpRequest / JSX are required only if that config actually uses them.
targetstringTarget framework the entry is for.
viteConfigstringOptional: vite.config.* source. Needed to verify UI-library auto-import and the JSX plugin.