-
Notifications
You must be signed in to change notification settings - Fork 26
feat: use webmcp-cli to intelligently transform the project #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
030a99f
feat: transform navigator.modelContext.registerTool
wuyiping0628 36f4742
feat: Solve the login issue across different pages
wuyiping0628 d1c5067
feat: add navigate_url and system-overview
wuyiping0628 b18037f
feat: optimize login logic to avoid duplicate logins
wuyiping0628 3053505
feat: simplify code and login logic
wuyiping0628 be08753
feat: simplify code and login logic
wuyiping0628 8dd8e33
feat: add asynchronous calls
wuyiping0628 7ff65b6
feat: delete try catch
wuyiping0628 9277a41
feat: delete try catch
wuyiping0628 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
213 changes: 180 additions & 33 deletions
213
template/tinyvue/src/skills/tiny-pro-operator/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,183 @@ | ||
| # TinyPro 操作指南 | ||
|
|
||
| ## 这是一个 [TinyPro](http://localhost:3031/vue-pro/) 后台管理系统,使用 `navigate_url` 进行路由菜单跳转 | ||
|
|
||
| ## 系统管理功能一览 | ||
|
|
||
| | 模块 | 路由 | 可用 WebMCP 工具 | 描述 | | ||
| | ---------- | ----------------------------------- | -------------------------------- | ------------------------ | | ||
| | 菜单管理 | `/vue-pro/menu/allMenu` | `add-menu` | 添加菜单 | | ||
| | 权限管理 | `/vue-pro/permission/allPermission` | `add-permission` | 添加权限 | | ||
| | 角色管理 | `/vue-pro/role/allRole` | `add-role`、`bind-menu-for-role` | 添加角色、为角色绑定菜单 | | ||
| | 用户管理 | `/vue-pro/userManager/allInfo` | `add-user` | 添加用户 | | ||
| | 国际化词条 | `/vue-pro/locale` | `add-i18n-entry` | 添加国际化词条 | | ||
|
|
||
| ## WebMCP 工具详细说明 | ||
|
|
||
| ### 1. `add-i18n-entry` — 添加国际化词条 | ||
|
|
||
| **路由**:`/vue-pro/locale` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | --------- | ------ | ---- | ----------------------------------------------- | | ||
| | `key` | string | ✅ | 词条关键字,Agent 自行创建,**不要询问用户** | | ||
| | `content` | string | ✅ | 词条内容 | | ||
| | `lang` | 1 \| 2 | ✅ | 语言 ID:`1` = enUS(英文),`2` = zhCN(中文) | | ||
|
|
||
| **命名规范**:词条 Key 建议使用 `模块::页面::元素` 格式,如 `test::page::title`。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:添加国际化词条:key 为 test::page::title,内容为「测试页面」,语言为中文 | ||
| 工具调用:add-i18n-entry({ key: "test::page::title", content: "测试页面", lang: 2 }) | ||
| ``` | ||
|
wuyiping0628 marked this conversation as resolved.
|
||
|
|
||
| --- | ||
|
|
||
| ### 2. `add-menu` — 添加菜单 | ||
|
|
||
| **路由**:`/vue-pro/menu/allMenu` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ------------ | ------ | ---- | ------------------------------------------------------------- | | ||
| | `name` | string | ✅ | 菜单名称(英文,对应路由 id) | | ||
| | `component` | string | ✅ | 组件路径,**不含** `src/views` 前缀,如 `test-page/index.vue` | | ||
| | `path` | string | ✅ | 路由路径 | | ||
| | `locale` | string | ✅ | 国际化词条 Key(须已存在于 i18n 中) | | ||
| | `order` | number | — | 优先级,默认 `0`,数值越大越靠上 | | ||
| | `parentMenu` | string | — | 父菜单名称(通过 label 匹配 ID) | | ||
| | `icon` | string | — | 菜单图标 | | ||
|
|
||
| **执行流程**:打开添加菜单弹窗 → 填充表单(`menuType` 固定为 `/`)→ 提交创建 → 刷新菜单树与路由。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:添加名称 test-page,组件 test-page/index.vue,路径 /test-page,国际化 test::page::title 的菜单 | ||
| → 调用 add-menu({ name: "test-page", component: "test-page/index.vue", path: "/test-page", locale: "test::page::title" }) | ||
| ``` | ||
|
|
||
| --- | ||
| name: tiny-pro-operator | ||
| description: TinyPro 项目的前端页面操作指南。当用户需要新建页面、配置菜单、设置权限(v-permission)、国际化(i18n)管理或进行 TinyPro 相关页面的操作时触发。该技能提供从菜单管理、词条管理、用户管理、权限管理的完整指引。 | ||
|
|
||
| ### 3. `add-permission` — 添加权限 | ||
|
|
||
| **路由**:`/vue-pro/permission/allPermission` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ------ | ------ | ---- | ------------------------ | | ||
| | `name` | string | ✅ | 权限名称,如 `good::add` | | ||
| | `desc` | string | ✅ | 权限描述 | | ||
|
|
||
| **命名规范**:权限名建议使用 `模块::操作` 格式,与 `v-permission` 指令值一致。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求: 帮我添加权限为good::add,描述是:创建商品 | ||
| → 调用 add-permission({ name: "good::add", desc: "创建商品" }) | ||
| ``` | ||
|
|
||
| **页面权限指令对照**: | ||
|
|
||
| | 页面 | v-permission 值 | | ||
| | --------------------------- | ------------------------------------------------------------------------------------ | | ||
| | 菜单添加 | `menu::add` | | ||
| | 权限添加/删除 | `permission::add` / `permission::remove` | | ||
| | 角色添加 | `role::add` | | ||
| | 用户添加/删除/改密/批量删除 | `user::add` / `user::remove` / `user::password::force-update` / `user::batch-remove` | | ||
| | 词条批量删除 | `i18n::batch-remove` | | ||
| | 语言添加/更新 | `lang::add` / `lang::update` | | ||
|
|
||
| --- | ||
|
|
||
| # TinyPro 操作指南 (tiny-pro-operator) | ||
|
|
||
| 本技能旨在帮助开发者在 TinyPro 框架下高效地完成页面操作,比如:菜单管理、权限管理和国际化配置。 | ||
|
|
||
| 以下是系统管理包含的功能,每个功能都有对应的路由和 MCP 工具。 | ||
|
|
||
| - 菜单管理(路由:`menu/allMenu`): | ||
| - ✅️创建菜单 `add-menu` | ||
| - ❌修改菜单 | ||
| - ❌删除菜单 | ||
| - 权限管理(路由:`permission/allPermission`): | ||
| - ✅️添加权限 `add-permission` | ||
| - ❌编辑权限 | ||
| - ❌删除权限 | ||
| - 角色管理(路由:`role/allRole`): | ||
| - ✅️添加角色 `add-role` | ||
| - ❌编辑角色(名称、权限) | ||
| - ❌删除角色 | ||
| - ✅️绑定目录 bind-menu-for-role | ||
| - 用户管理(路由:`userManager/allInfo`): | ||
| - ✅️添加用户 `add-user` | ||
| - ❌编辑用户 | ||
| - ❌修改密码 | ||
| - ❌删除用户(包含批量删除用户) | ||
| - 国际化词条管理(路由:`locale`): | ||
| - ✅️添加词条 `add-i18n-entry` | ||
| - ❌删除词条(包含批量删除词条) | ||
|
|
||
| 当用户询问相关操作时,需要跳转到对应的路由,调用对应的 MCP 工具。 | ||
|
|
||
| 例如:“帮我添加权限:good::add,描述是:创建商品”,则需要调用 MCP 工具 `add-permission`。 | ||
| ### 4. `add-role` — 添加角色 | ||
|
|
||
| **路由**:`/vue-pro/role/allRole` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ------------- | -------- | ---- | -------------------------- | | ||
| | `name` | string | ✅ | 角色名称 | | ||
| | `permissions` | number[] | ✅ | 权限 ID 数组(非权限名称) | | ||
|
|
||
| **注意**:直接调用工具添加,**不要**生成角色卡片 UI。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:添加角色 admin,权限 ID 为 [1, 2, 3] | ||
| → 调用 add-role({ name: "admin", permissions: [1, 2, 3] }) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### 5. `bind-menu-for-role` — 为角色绑定菜单 | ||
|
|
||
| **路由**:`/vue-pro/role/allRole` | ||
| **源文件**:`src/views/role/info/components/info-tab.vue` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ------ | ------ | ---- | ----------------------------------- | | ||
| | `role` | string | ✅ | 角色名称(精确匹配) | | ||
| | `menu` | string | ✅ | 菜单名称(通过 i18n label 匹配 ID) | | ||
|
|
||
| **执行流程**:查找角色 → 打开菜单绑定抽屉 → 勾选目标菜单 → 确认提交 → 刷新路由与 Tab。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:给 admin 角色绑定「测试页面」菜单 | ||
| → 调用 bind-menu-for-role({ role: "admin", menu: "测试页面" }) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### 6. `add-user` — 添加用户 | ||
|
|
||
| **路由**:`/vue-pro/userManager/allInfo` | ||
| **源文件**:`src/views/userManager/info/components/info-tab.vue` | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ------------------- | -------- | ---- | ---------------- | | ||
| | `email` | string | ✅ | 邮箱 | | ||
| | `password` | string | ✅ | 密码 | | ||
| | `name` | string | ✅ | 用户名 | | ||
| | `address` | string | — | 地址 | | ||
| | `department` | string | — | 所属部门 | | ||
| | `roleIds` | number[] | — | 角色 ID 数组 | | ||
| | `employeeType` | string | — | 招聘类型 | | ||
| | `probationDate` | string[] | — | 试用期起止时间 | | ||
| | `probationDuration` | string | — | 试用期时长 | | ||
| | `protocolStart` | string | — | 劳动合同开始日期 | | ||
| | `protocolEnd` | string | — | 劳动合同结束日期 | | ||
| | `status` | string | — | 状态 | | ||
|
|
||
| **注意**:可选参数无需用户提供;**不要**创建表单卡片,直接根据已有信息调用工具。 | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:添加用户,邮箱 test@example.com,密码 123456,用户名 test | ||
| → 调用 add-user({ email: "test@example.com", password: "123456", name: "test" }) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### 7. `navigate_url` — 导航到指定URL | ||
|
|
||
| | 参数 | 类型 | 必填 | 说明 | | ||
| | ----- | ------ | ---- | --------- | | ||
| | `url` | string | ✅ | 跳转的url | | ||
|
|
||
| **示例**: | ||
|
|
||
| ``` | ||
| 用户需求:跳转到添加用户页面 | ||
| → 调用 navigate_url({ url: "/vue-pro/userManager/allInfo" }) | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### 核心约束 | ||
|
|
||
| 1. **路由跳转规则:** 只使用 `navigate_url` 工具进行路由菜单跳转 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.