示例与任务索引
示例展示完整应用,任务方案处理可复用的界面边界。两者现在都以可运行页面为准:每篇方案都有自己的页面、源码、启动路径和验证步骤,不再把多个问题引向同一个演示。
五个经典案例
- 案例01:待办事项覆盖新增、完成、编辑、筛选与清理。
- 案例02:订单工作台覆盖业务队列、记录、行级动作与确认。
- 案例03:单页多路由工作台在客户端路由切换后继续任务。
- 案例04:多页工作台跨完整 document 导航继续任务。
- 案例05:暴露能力给外部把具名能力暴露给页面之外的 Agent。
每个案例页都提供可操作预览、带标记的源码与接入说明。模型请求通过服务端网关发出,浏览器不持有供应商密钥。
运行方案
在仓库根目录执行:
bash
pnpm dev:examples命令同时启动示例页面、模型网关和本地 access service。页面地址为 http://localhost:5191/demos/<方案>/?lang=zh;每篇正文顶部也会嵌入当前效果,并可在“效果预览”“源码”“接入说明”之间切换。涉及文件上传、登录、委托或审批的方案会使用 examples/recipe-backends/access-service/,其路由、演示账号和限制写在目录内的 README.md。MCP 方案还需单独启动 stdio server,命令见对应正文。
身份与受保护数据
- 登录、会话与受保护页面 — 效果 · 源码
examples/demos/recipe-login-session/· 后端examples/recipe-backends/access-service/ - 经用户同意的委托访问 — 效果 · 源码
examples/demos/recipe-delegation/· 后端examples/recipe-backends/access-service/
表单与重要动作
- 表单填写、校验与提交 — 效果 · 源码
examples/demos/recipe-form-validation/· 无需后端 - 多步弹窗与向导 — 效果 · 源码
examples/demos/recipe-wizard/· 无需后端 - 危险操作与确认 — 效果 · 源码
examples/demos/recipe-danger-confirm/· 无需后端
表格、搜索与异步任务
- 表格行与批量操作 — 效果 · 源码
examples/demos/recipe-table-batch/· 无需后端 - 搜索、筛选与长列表 — 效果 · 源码
examples/demos/recipe-search-long-list/· 无需后端 - 文件上传与异步任务 — 效果 · 源码
examples/demos/recipe-upload-async/· 后端examples/recipe-backends/access-service/ - 多页任务连续性 — 效果 · 源码
examples/demos/recipe-continuity/· 无需后端
外部 Agent 与运维
- 向外部 Agent 开放三个安全能力 — 效果 · 源码
examples/demos/recipe-external-surface/· 无需后端 - 通过 MCP 接入外部 Agent — 效果 · 源码
examples/demos/recipe-mcp/· stdio serverexamples/demos/external-agent-surface/mcp-server.mjs - Agent 操作的审批、审计与撤销 — 效果 · 源码
examples/demos/recipe-approval-audit/· 后端examples/recipe-backends/access-service/ - 让另一实现通过 Surface 一致性验证 — 效果 · 源码
examples/demos/recipe-conformance/· 无需后端
模型访问
按框架学习
要改造自己的应用,继续以对应框架的教程为主:
源码组织
方案页面位于 examples/demos/,共享外壳与本地 API 客户端位于 examples/recipe-shared/,需要服务端的方案共用 examples/recipe-backends/access-service/。框架代码仍只在 packages/;示例不复制执行逻辑。
如果方案依赖你的应用尚未提供的能力,应调整业务处理器,而不是增加通用 DOM 逃逸口。Pling 暴露页面本来就有权执行的操作,不绕开页面另建自动化通道。

