From 2ad0a3ed9456a630742054547f0a82c14f86e98d Mon Sep 17 00:00:00 2001 From: chenfuqiang Date: Mon, 14 Sep 2026 15:30:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0SKILL.md=E5=92=8Cactio?= =?UTF-8?q?ns.json=EF=BC=8C=E6=B7=BB=E5=8A=A0RPA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E5=92=8Caction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SKILL.md | 16 +++- assets/actions.json | 177 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 2 deletions(-) diff --git a/SKILL.md b/SKILL.md index 7f67c4f..15f46fe 100644 --- a/SKILL.md +++ b/SKILL.md @@ -27,7 +27,7 @@ allowed-tools: - **Agent 是入口与编排者**:理解用户意图、收集发票字段与报销上下文、选择 Action,并用业务语言解读红黄绿灯结论。 - 发票照片 → 结构化字段的提取由 Agent 多模态能力(或用户粘贴/手工录入)完成;本技能接收**结构化 JSON** 并做确定性规则审核,不做 OCR、不连接外部系统。 - 遇到字段大面积缺失(照片模糊/折叠)时,提示用户重拍或补录,不要编造字段值。 -- 本技能无 RPA、无浏览器自动化;不修改任何外部系统数据。 +- **RPA功能**:本技能支持从指定网站(sandbox.jc2009.com)自动提取发票信息,需要用户提供登录凭证和浏览器配置目录。RPA功能用于自动化数据采集,不修改外部系统数据。 ## 能力类型与触发 @@ -39,11 +39,16 @@ allowed-tools: | 回填人工查验结果 | `run_skill_action` → `mark-verified`(`input.reportId/result/note`) | 否 | | 重建《初审意见单》HTML | `run_skill_action` → `render-html` | 否 | | 维护税号白名单 / 经费标准 | 数据管理表上操作,或短 CLI:`add-whitelist` / `remove-whitelist` / `set-standard` | 否 | +| 从网站提取发票信息 | `run_skill_action` → `extract-invoices`(`input.username/password/profileDir`) | 否 | +| 测试RPA连接 | `run_skill_action` → `test-rpa-connection` | 否 | +| 查询RPA提取记录 | `run_skill_action` → `list-rpa-invoices` | 否 | +| 查看RPA提取详情 | `run_skill_action` → `show-rpa-invoice` | 否 | +| RPA提取统计 | `run_skill_action` → `rpa-invoice-stats` | 否 | | 用户只问用法 / 能做什么 | 读根目录 `README.md`;逐步操作再读 `TUTORIAL.md` | — | 进不进任务中心**只**看该 Action 的 `executionProfile`(sync 当场返回 / async 进任务中心),与数据管理、对话等触发入口**无关**;每个 Action 都已显式声明 `executionProfile`。 -本技能为"即时审核"型能力:提交即审、当场出结论,不存在「先准备本地数据、再对外产生副作用」的两段式,因此无需拆分准备与执行;若后续接入需要外部副作用的扩展(如对接报销系统提交),须按「准备 vs 执行」拆分并可由 Agent 分别触发。本技能无网页 RPA,不涉及账号管理;宿主账号/Profile/租约规范见 `development/ACCOUNT_MANAGER.md`。 +本技能为"即时审核"型能力:提交即审、当场出结论,不存在「先准备本地数据、再对外产生副作用」的两段式,因此无需拆分准备与执行;若后续接入需要外部副作用的扩展(如对接报销系统提交),须按「准备 vs 执行」拆分并可由 Agent 分别触发。本技能支持网页RPA功能,用于从指定网站自动提取发票信息,需要账号管理;宿主账号/Profile/租约规范见 `development/ACCOUNT_MANAGER.md`。 ## 用户意图路由表 @@ -57,6 +62,11 @@ allowed-tools: | "住宿标准是多少 / 一线城市的上限" | 短 CLI:`view-standards [--category 住宿费]` | 否 | | "预审成功率怎么样" | 短 CLI:`stats` | 否 | | "把 XX 税号加进白名单 / 改一下住宿标准" | 数据管理表上操作;或短 CLI:`add-whitelist` / `set-standard` | 否 | +| "从网站提取发票信息" | `run_skill_action` → `extract-invoices`,需要提供用户名、密码和浏览器配置目录 | 否 | +| "测试RPA连接" | `run_skill_action` → `test-rpa-connection`,需要提供用户名、密码和浏览器配置目录 | 否 | +| "查看RPA提取记录" | `run_skill_action` → `list-rpa-invoices`,可按批次ID、用户名、状态筛选 | 否 | +| "查看RPA提取详情" | `run_skill_action` → `show-rpa-invoice`,需要提供记录ID | 否 | +| "RPA提取统计" | `run_skill_action` → `rpa-invoice-stats` | 否 | **硬规则:** @@ -65,6 +75,8 @@ allowed-tools: 3. 预审结论必须向用户说明"不构成最终报销结论";驳回项要读出规则引用。 4. 发票真伪只提示查验指引;除非用户明确说已在官方平台查验,不得代替用户勾选"已查验"。 5. 一个业务能力一个 Action,用多个 placements 挂入口;底层同一 `scripts/main.py` CLI。 +6. RPA功能需要用户提供登录凭证和浏览器配置目录;禁止存储用户密码到日志或代码中。 +7. RPA提取的发票数据存储在本地数据库,不自动同步到外部系统。 Agent 执行契约细节:`references/CLI.md`、`references/ACTIONS.md`、`references/SCHEMA.md`。 diff --git a/assets/actions.json b/assets/actions.json index 0e718bb..14172f5 100644 --- a/assets/actions.json +++ b/assets/actions.json @@ -411,6 +411,183 @@ "command": "config-path", "args": [] } + }, + { + "id": "extract-invoices", + "label": "提取发票信息", + "description": "从网站自动提取发票信息,需要提供登录凭证和浏览器配置目录。", + "placements": ["agent"], + "executionProfile": "sync", + "interaction": "form", + "entrypoint": { + "type": "cli", + "command": "extract-invoices", + "args": [ + "--username", "{{username}}", + "--password", "{{password}}", + "--profile-dir", "{{profileDir}}", + "--headless", "{{headless}}", + "--detail-mode", "{{detailMode}}" + ] + }, + "inputSchema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "title": "用户名", + "description": "网站登录用户名" + }, + "password": { + "type": "string", + "title": "密码", + "description": "网站登录密码" + }, + "profileDir": { + "type": "string", + "title": "浏览器配置目录", + "description": "通过account-manager获取的浏览器配置目录路径" + }, + "headless": { + "type": "boolean", + "title": "无头模式", + "description": "是否使用无头模式(生产不建议)", + "default": false + }, + "detailMode": { + "type": "boolean", + "title": "详细模式", + "description": "是否提取详细信息", + "default": false + } + }, + "required": ["username", "password", "profileDir"] + } + }, + { + "id": "test-rpa-connection", + "label": "测试RPA连接", + "description": "测试RPA连接和登录功能。", + "placements": ["agent", "skill-detail"], + "executionProfile": "sync", + "interaction": "form", + "entrypoint": { + "type": "cli", + "command": "test-rpa-connection", + "args": [ + "--username", "{{username}}", + "--password", "{{password}}", + "--profile-dir", "{{profileDir}}" + ] + }, + "inputSchema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "title": "用户名", + "description": "网站登录用户名" + }, + "password": { + "type": "string", + "title": "密码", + "description": "网站登录密码" + }, + "profileDir": { + "type": "string", + "title": "浏览器配置目录", + "description": "通过account-manager获取的浏览器配置目录路径" + } + }, + "required": ["username", "password", "profileDir"] + } + }, + { + "id": "list-rpa-invoices", + "label": "查询RPA提取记录", + "description": "查询RPA提取的发票数据记录。", + "placements": ["agent", "skill-detail"], + "executionProfile": "sync", + "entrypoint": { + "type": "cli", + "command": "list-rpa-invoices", + "args": [ + "--limit", "{{limit}}", + "--batch-id", "{{batchId}}", + "--username", "{{username}}", + "--status", "{{status}}" + ] + }, + "inputSchema": { + "type": "object", + "properties": { + "limit": { + "type": "number", + "title": "条数", + "description": "返回条数,默认20", + "default": 20 + }, + "batchId": { + "type": "string", + "title": "批次ID", + "description": "按批次ID筛选" + }, + "username": { + "type": "string", + "title": "用户名", + "description": "按用户名筛选" + }, + "status": { + "type": "string", + "title": "状态", + "description": "按状态筛选", + "enum": ["extracted", "processed", "error"] + } + } + } + }, + { + "id": "show-rpa-invoice", + "label": "查看RPA提取详情", + "description": "查看RPA提取的发票数据详情。", + "placements": ["row"], + "executionProfile": "sync", + "bind": { + "tables": ["rpa_invoices"], + "inputMapping": { + "recordId": "{{id}}" + } + }, + "entrypoint": { + "type": "cli", + "command": "show-rpa-invoice", + "args": [ + "--record-id", "{{recordId}}" + ] + }, + "inputSchema": { + "type": "object", + "properties": { + "recordId": { + "type": "number", + "title": "记录ID", + "description": "RPA提取记录ID" + } + }, + "required": ["recordId"] + } + }, + { + "id": "rpa-invoice-stats", + "label": "RPA提取统计", + "description": "获取RPA提取的统计信息。", + "placements": ["agent", "skill-detail"], + "executionProfile": "sync", + "entrypoint": { + "type": "cli", + "command": "rpa-invoice-stats", + "args": [] + } } ] }