SuperAPI AI 工具集

tool-ui-integrator

前端与建站

查看项目

更新于 10-15 17:20

技能介绍

用途:帮助开发者从需求快速完成 Tool UI 组件集成。若项目尚无聊天 UI 或运行时,优先使用 assistant-ui;若已有可用运行时,assistant-ui 视为可选。

主要能力与工作流:先做兼容性与 doctor 检查,再发现候选组件或 bundle,随后安装组件、生成脚手架并接入运行时接线,最后验证行为并排查故障。

必要用法: 兼容性检查:python scripts/tool_ui_compat.py --project <repo-root> python scripts/tool_ui_compat.py --project <repo-root> --doctor 自动修复缺少的 @tool-ui registry 条目:python scripts/tool_ui_compat.py --project <repo-root> --fix 发现组件:python scripts/tool_ui_components.py list / find "<关键词>" / bundle [名称] 安装:python scripts/tool_ui_components.py install <component-id>,默认命令为 npx shadcn@latest add https://tool-ui.com/r/<component-id>.json 生成接线:python scripts/tool_ui_scaffold.py --mode assistant-backend --component plan 等

最低要求:存在 components.json;其 aliases.utils 存在(通常为 @/lib/utils);registries["@tool-ui"] 等于 https://tool-ui.com/r/{name}.json。

操作规则:安装解决需求的最小组件集;先验证单个组件再扩展;保持 payload schema 可序列化且显式;交互流程需在用户操作回调中调用 addResult(...)。集成后运行 typecheck/lint,触发真实 tool call,确认 UI 渲染与交互流程。失败时参考 troubleshooting.md。维护者可用 python scripts/sync_components.py 同步元数据,用 python -m unittest discover -s tests -p "test_*.py" 运行测试。