zywlagent
v0.1.12
Published
可独立接入 GIS 或业务页面的 Platform Agent 聊天组件
Readme
GIS Agent
独立维护的前端 npm 包:zywlagent。
本地维护
npm install
npm test
npm run build
npm run pack也可使用 pnpm install / pnpm test / pnpm build / pnpm pack,但团队应统一锁文件管理器;本项目提供 npm package-lock.json。需要 Node 22.13+。npm run dev 启动独立预览。
接入方
import { mountCallerAgentChat } from "zywlagent";
const cleanup = mountCallerAgentChat({
buttonId: "my-agent-button",
GIS_AGENT_PLATFORM_URL: "http://服务器IP:8135",
accountId: "user-10001",
style: { left: "24px", top: "80px", width: "520px", height: "700px" },
onEvent(event) { console.log(event); },
});
// 页面卸载时调用 cleanup()传入稳定的 accountId 后,同一账号在不同机器上可读取同一份历史;未传时沿用匿名会话。新包需与更新后的 Platform 后端一起部署。打包和更新 GIS 依赖由接入方执行,详见 docs/接入说明.md。
目录
- src/AgentChat:Platform 聊天 UI、请求客户端、按钮桥接。
- src/assets:随包构建的头像。
- examples:独立预览。
- scripts:请求与入口回归测试。
- dist:构建输出,必须完整交付。
此项目不引用原 GIS 源码,不包含 Platform/MCP 后端;Agent 改动以本目录为准。
