weby-agent
v1.0.9
Published
GUI agent for web applications - add intelligent automation to any webpage with a single script
Maintainers
Readme
WebyAgent
住在你网页里的 GUI Agent —— 用自然语言驱动 AI 直接操作当前页面的 DOM(点击、输入、滚动、选择等),无需浏览器插件、无需无头浏览器、无需多模态大模型,一切发生在页面内的 JavaScript 里。
✨ Features
- ** 轻松集成**
- 纯页面内 JavaScript,无需
浏览器插件/Python/无头浏览器
- 纯页面内 JavaScript,无需
- ** 文本化 DOM 操作**
- 把实时 DOM 抽取为简化文本交给 LLM,无需截图、无需多模态模型、无需特殊权限
- ** Bring Your Own LLM**
- 兼容 OpenAI 协议的任意模型,可通过
customFetch接入自定义网关
- 兼容 OpenAI 协议的任意模型,可通过
- ** 可选的 Chrome 扩展**
- 支持跨 Tab 多页面任务(
MultiPageAgent+TabsController)
- 支持跨 Tab 多页面任务(
- ** 可选的 MCP Server(Beta)**
- 允许 Claude Desktop、Cursor 等外部 Agent 客户端反向控制浏览器
💡 应用场景
- SaaS AI Copilot — 几行代码为你的产品加上 AI 副驾驶,无需重写后端。
- 智能表单填写 — 把 20 次点击变成一句话,ERP、CRM、管理后台的最佳拍档。
- 无障碍增强 — 用自然语言让任何网页可被语音指令、屏幕阅读器零门槛操作。
- 跨页面 Agent — 通过可选的 Chrome 扩展,让你自己的 Web Agent 跨标签页工作。
- 为现有 Agent 增加浏览器控制能力 — 通过 MCP Server 桥接到任意 MCP 客户端。
🚀 快速开始
一行代码集成
通过我们提供的 Demo 构建,快速体验 WebyAgent:
<script src="https://storage.jd.com/nvdesigner/weby-agent/weby-agent.demo.js" crossorigin="true"></script>⚠️ 仅用于技术评估。 该 Demo 构建内置了用于演示的 LLM 配置,请勿用于生产环境。
| Mirrors | URL | | ------- | ------------------------------------------------------------------ | | CDNJS | https://storage.jd.com/nvdesigner/weby-agent/weby-agent.demo.js |
const agent = new WebyAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN',
})
// Panel 默认会自动挂载,可手动控制显示
if (agent.panel) {
agent.panel.show()
}
// 也可以直接编程式触发任务
await agent.execute('点击登录按钮')NPM 安装
npm install weby-agentimport { WebyAgent } from 'weby-agent'
const agent = new WebyAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN',
})
await agent.execute('点击登录按钮')WebyAgent 在内部组合了三个核心模块:
@page-agent/core— 无 UI 的 Agent 内核,负责 Re-Act 循环、工具调度、历史与事件系统@page-agent/page-controller— DOM 抽取与元素交互(含可选的 SimulatorMask 视觉蒙层)web-agent-ui— 可嵌入式 Panel 面板与多语言
更多模块划分、通讯机制与扩展指引,请参阅 📖 架构说明文档 、架构图image, 架构图drawio。
⚖️ 许可证
⭐ 如果觉得 WebyAgent 有用或有趣,请给项目点个星!
