weaver-work-cli 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +14 -9
  2. package/dist/cmd/skills/index.js +60 -0
  3. package/dist/internal/e10/auth/commands.js +48 -32
  4. package/dist/internal/e10/auth/session.js +44 -3
  5. package/dist/internal/e10/auth/xiaoe.js +363 -11
  6. package/dist/internal/e10/context.js +4 -2
  7. package/dist/internal/skills/detector.js +42 -0
  8. package/dist/internal/skills/install.js +50 -3
  9. package/dist/shortcuts/archive/render/search-format.js +12 -3
  10. package/dist/shortcuts/ebuilder-form/continuation.js +70 -0
  11. package/dist/shortcuts/ebuilder-form/errors.js +54 -0
  12. package/dist/shortcuts/ebuilder-form/host.js +1238 -0
  13. package/dist/shortcuts/ebuilder-form/index.js +108 -0
  14. package/dist/shortcuts/ebuilder-form/manifest.js +347 -0
  15. package/dist/shortcuts/ebuilder-form/operations/read.js +157 -0
  16. package/dist/shortcuts/ebuilder-form/operations/registry.js +56 -0
  17. package/dist/shortcuts/ebuilder-form/operations/shared.js +132 -0
  18. package/dist/shortcuts/ebuilder-form/operations/types.js +19 -0
  19. package/dist/shortcuts/ebuilder-form/operations/write.js +277 -0
  20. package/dist/shortcuts/ebuilder-form/operations.js +8 -0
  21. package/dist/shortcuts/ehr/operations/salary.js +2 -140
  22. package/dist/shortcuts/im/continuation.js +70 -0
  23. package/dist/shortcuts/{yimiaoban → im}/errors.js +14 -14
  24. package/dist/shortcuts/{yimiaoban → im}/host.js +26 -26
  25. package/dist/shortcuts/{yimiaoban → im}/index.js +42 -42
  26. package/dist/shortcuts/{yimiaoban → im}/manifest.js +7 -6
  27. package/dist/shortcuts/{yimiaoban → im}/operations/file-user.js +54 -41
  28. package/dist/shortcuts/{yimiaoban → im}/operations/group-read.js +46 -44
  29. package/dist/shortcuts/{yimiaoban → im}/operations/group-write.js +113 -66
  30. package/dist/shortcuts/{yimiaoban → im}/operations/msg-sync.js +164 -141
  31. package/dist/shortcuts/{yimiaoban → im}/operations/msg-write.js +47 -47
  32. package/dist/shortcuts/{yimiaoban → im}/operations/person.js +10 -10
  33. package/dist/shortcuts/{yimiaoban → im}/operations/registry.js +10 -8
  34. package/dist/shortcuts/{yimiaoban → im}/operations/session.js +82 -83
  35. package/dist/shortcuts/im/operations/shared.js +442 -0
  36. package/dist/shortcuts/{yimiaoban → im}/operations/types.js +1 -1
  37. package/dist/shortcuts/im/operations/user-remind.js +201 -0
  38. package/dist/shortcuts/{yimiaoban → im}/operations/write-util.js +7 -7
  39. package/dist/shortcuts/{yimiaoban → im}/operations.js +3 -3
  40. package/dist/shortcuts/index.js +10 -2
  41. package/dist/shortcuts/invoice/manifest.js +113 -10
  42. package/dist/shortcuts/invoice/operations/import.js +39 -14
  43. package/dist/shortcuts/invoice/operations/reim.js +38 -18
  44. package/dist/shortcuts/invoice/operations/shared.js +35 -6
  45. package/dist/shortcuts/jiuchuanhui/manifest.js +3 -3
  46. package/dist/shortcuts/jiuchuanhui/operations/registry.js +2 -2
  47. package/dist/shortcuts/{yimiaoban → okr}/continuation.js +10 -10
  48. package/dist/shortcuts/okr/errors.js +70 -0
  49. package/dist/shortcuts/okr/host.js +169 -0
  50. package/dist/shortcuts/okr/index.js +155 -0
  51. package/dist/shortcuts/okr/manifest.js +70 -0
  52. package/dist/shortcuts/okr/operations/link.js +305 -0
  53. package/dist/shortcuts/okr/operations/read.js +481 -0
  54. package/dist/shortcuts/okr/operations/registry.js +31 -0
  55. package/dist/shortcuts/okr/operations/shared.js +381 -0
  56. package/dist/shortcuts/okr/operations/types.js +88 -0
  57. package/dist/shortcuts/okr/operations/write.js +838 -0
  58. package/dist/shortcuts/okr/operations.js +8 -0
  59. package/dist/shortcuts/project/continuation.js +70 -0
  60. package/dist/shortcuts/project/errors.js +53 -0
  61. package/dist/shortcuts/project/host.js +160 -0
  62. package/dist/shortcuts/project/index.js +106 -0
  63. package/dist/shortcuts/project/manifest.js +36 -0
  64. package/dist/shortcuts/project/operations/read.js +551 -0
  65. package/dist/shortcuts/project/operations/registry.js +31 -0
  66. package/dist/shortcuts/project/operations/shared.js +68 -0
  67. package/dist/shortcuts/project/operations/types.js +39 -0
  68. package/dist/shortcuts/project/operations/write.js +266 -0
  69. package/dist/shortcuts/project/operations.js +8 -0
  70. package/dist/shortcuts/workflow/continuation.js +508 -0
  71. package/dist/shortcuts/workflow/endpoints.js +149 -0
  72. package/dist/shortcuts/workflow/errors.js +112 -0
  73. package/dist/shortcuts/workflow/host.js +224 -0
  74. package/dist/shortcuts/workflow/index.js +116 -0
  75. package/dist/shortcuts/workflow/manifest.js +30 -0
  76. package/dist/shortcuts/workflow/operations/form.js +4159 -0
  77. package/dist/shortcuts/workflow/operations/read.js +3778 -0
  78. package/dist/shortcuts/workflow/operations/registry.js +33 -0
  79. package/dist/shortcuts/workflow/operations/shared.js +167 -0
  80. package/dist/shortcuts/workflow/operations/types.js +44 -0
  81. package/dist/shortcuts/workflow/operations/write.js +1991 -0
  82. package/dist/shortcuts/workflow/operations.js +119 -0
  83. package/dist/shortcuts/workflow/state.js +182 -0
  84. package/docs/SKILL.md +5 -3
  85. package/docs/_catalog.md +10 -1
  86. package/docs/agent-invoice.md +2 -2
  87. package/docs/agent-skill-install.md +2 -2
  88. package/docs/e10-auth.md +3 -1
  89. package/docs/ebuilder-form.md +38 -0
  90. package/docs/im.md +104 -0
  91. package/docs/invoice.md +5 -5
  92. package/docs/okr.md +122 -0
  93. package/docs/operation-manual.md +10 -7
  94. package/docs/project.md +69 -0
  95. package/docs/skill-review-2026-09-19.md +68 -0
  96. package/package.json +3 -2
  97. package/scripts/package-skill.mjs +38 -11
  98. package/scripts/sync-connector-skills.mjs +172 -0
  99. package/skill-template/business-info.json +357 -16
  100. package/skill-template/domains/ebuilder-form.md +5 -0
  101. package/skill-template/domains/okr.md +18 -0
  102. package/skill-template/domains/shijingran.md +3 -0
  103. package/skill-template/domains/skill-maker.md +4 -4
  104. package/skill-template/domains/workflow.md +22 -0
  105. package/skill-template/domains/yepiaotong.md +4 -2
  106. package/skill-template/domains/yimiaoban.md +13 -10
  107. package/skill-template/product.json +5 -0
  108. package/skill-template/skill-template.md +1 -0
  109. package/skills/weaver-e10-calendar/SKILL.md +5 -1
  110. package/skills/weaver-e10-calendar/references/calendar-query.md +7 -0
  111. package/skills/weaver-e10-calendar/references/source-manifest.json +314 -32
  112. package/skills/weaver-e10-ebuilder-form/SKILL.md +123 -0
  113. package/skills/weaver-e10-ebuilder-form/references/context-routing.md +90 -0
  114. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +86 -0
  115. package/skills/weaver-e10-ebuilder-form/references/disabled-capabilities.md +50 -0
  116. package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +100 -0
  117. package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +91 -0
  118. package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +74 -0
  119. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +86 -0
  120. package/skills/weaver-e10-ebuilder-form/references/source-manifest.json +107 -0
  121. package/skills/weaver-e10-esb/SKILL.md +1 -1
  122. package/skills/weaver-e10-esb/references/source-manifest.json +15 -14
  123. package/skills/weaver-e10-hrm/SKILL.md +1 -1
  124. package/skills/weaver-e10-hrm/references/source-manifest.json +357 -38
  125. package/skills/weaver-e10-jiuchuanhui/SKILL.md +22 -4
  126. package/skills/weaver-e10-jiuchuanhui/references/clue.md +4 -2
  127. package/skills/weaver-e10-jiuchuanhui/references/contact.md +1 -1
  128. package/skills/weaver-e10-jiuchuanhui/references/customer.md +3 -3
  129. package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +1 -1
  130. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +10 -10
  131. package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +3 -3
  132. package/skills/weaver-e10-jiuchuanhui/references/sale.md +7 -7
  133. package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +3 -3
  134. package/skills/weaver-e10-jucailin/SKILL.md +2 -2
  135. package/skills/weaver-e10-mail/SKILL.md +22 -6
  136. package/skills/weaver-e10-meeting/SKILL.md +22 -1
  137. package/skills/weaver-e10-okr/SKILL.md +139 -0
  138. package/skills/weaver-e10-okr/references/okr-align.md +59 -0
  139. package/skills/weaver-e10-okr/references/okr-keyresult.md +68 -0
  140. package/skills/weaver-e10-okr/references/okr-link-routing.md +67 -0
  141. package/skills/weaver-e10-okr/references/okr-query.md +105 -0
  142. package/skills/weaver-e10-okr/references/okr-write.md +94 -0
  143. package/skills/weaver-e10-okr/references/source-manifest.json +672 -0
  144. package/skills/weaver-e10-plan/SKILL.md +3 -3
  145. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  146. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  147. package/skills/weaver-e10-qiyecheng/SKILL.md +21 -1
  148. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +17 -17
  149. package/skills/weaver-e10-shared/SKILL.md +79 -11
  150. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +41 -8
  151. package/skills/weaver-e10-shared/references/non-interactive-environment.md +78 -0
  152. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +39 -0
  153. package/skills/weaver-e10-shijingran/SKILL.md +83 -0
  154. package/skills/weaver-e10-shijingran/references/field-resolution.md +105 -0
  155. package/skills/weaver-e10-shijingran/references/operations.md +154 -0
  156. package/skills/weaver-e10-shijingran/references/source-manifest.json +1380 -0
  157. package/skills/weaver-e10-shijingran/references/write-operations.md +90 -0
  158. package/skills/weaver-e10-skill-maker/SKILL.md +26 -9
  159. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +39 -8
  160. package/skills/weaver-e10-skill-maker/references/detector-validation.md +25 -8
  161. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +66 -5
  162. package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +86 -0
  163. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +59 -5
  164. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +16 -8
  165. package/skills/weaver-e10-wenshuding/SKILL.md +28 -4
  166. package/skills/weaver-e10-wenshuding/references/archive-search.md +14 -0
  167. package/skills/weaver-e10-wenshuding/references/source-manifest.json +27 -26
  168. package/skills/weaver-e10-workflow/SKILL.md +250 -0
  169. package/skills/weaver-e10-workflow/references/source-manifest.json +1062 -0
  170. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +96 -0
  171. package/skills/weaver-e10-workflow/references/workflow-batch.md +275 -0
  172. package/skills/weaver-e10-workflow/references/workflow-create.md +182 -0
  173. package/skills/weaver-e10-workflow/references/workflow-edit.md +106 -0
  174. package/skills/weaver-e10-workflow/references/workflow-memory.md +165 -0
  175. package/skills/weaver-e10-workflow/references/workflow-operate.md +153 -0
  176. package/skills/weaver-e10-workflow/references/workflow-query.md +821 -0
  177. package/skills/weaver-e10-workflow/references/workflow-share.md +117 -0
  178. package/skills/weaver-e10-workflow/references/workflow-view.md +189 -0
  179. package/skills/weaver-e10-yepiaotong/SKILL.md +28 -28
  180. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +11 -5
  181. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +14 -8
  182. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +9 -43
  183. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +8 -0
  184. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +13 -17
  185. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +6 -7
  186. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +2 -2
  187. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1155 -553
  188. package/skills/weaver-e10-yimiaoban/SKILL.md +56 -38
  189. package/skills/weaver-e10-yimiaoban/references/ding-write.md +8 -8
  190. package/skills/weaver-e10-yimiaoban/references/error-codes.md +16 -0
  191. package/skills/weaver-e10-yimiaoban/references/field-resolution.md +10 -10
  192. package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +12 -12
  193. package/skills/weaver-e10-yimiaoban/references/group-read.md +16 -16
  194. package/skills/weaver-e10-yimiaoban/references/group-write.md +17 -15
  195. package/skills/weaver-e10-yimiaoban/references/msg-read.md +21 -17
  196. package/skills/weaver-e10-yimiaoban/references/msg-write.md +10 -10
  197. package/skills/weaver-e10-yimiaoban/references/person.md +6 -6
  198. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +15 -11
  199. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +11 -10
  200. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +2164 -154
  201. package/skills/weaver-e10-yimiaoban/references/user-remind.md +75 -0
  202. package/skills/weaver-e10-ziguanjia/SKILL.md +4 -2
  203. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +99 -29
  204. package/tools/weaver-skill-detector-1.0.13/SKILL.md +253 -0
  205. package/tools/weaver-skill-detector-1.0.13/_meta.json +6 -0
  206. package/tools/weaver-skill-detector-1.0.13/references/checklist.md +298 -0
  207. package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +4190 -0
  208. package/dist/shortcuts/yimiaoban/operations/shared.js +0 -236
  209. package/docs/yimiaoban.md +0 -86
  210. package/skills/weaver-e10-calendar/product.json +0 -8
  211. package/skills/weaver-e10-esb/product.json +0 -8
  212. package/skills/weaver-e10-hrm/product.json +0 -8
  213. package/skills/weaver-e10-jiuchuanhui/product.json +0 -8
  214. package/skills/weaver-e10-jucailin/product.json +0 -8
  215. package/skills/weaver-e10-mail/product.json +0 -8
  216. package/skills/weaver-e10-meeting/product.json +0 -8
  217. package/skills/weaver-e10-plan/product.json +0 -8
  218. package/skills/weaver-e10-qiyecheng/product.json +0 -8
  219. package/skills/weaver-e10-skill-maker/product.json +0 -8
  220. package/skills/weaver-e10-wenshuding/product.json +0 -8
  221. package/skills/weaver-e10-yepiaotong/product.json +0 -8
  222. package/skills/weaver-e10-yepiaotong/references/invoice-red.md +0 -261
  223. package/skills/weaver-e10-yimiaoban/product.json +0 -8
  224. package/skills/weaver-e10-ziguanjia/product.json +0 -8
  225. /package/dist/shortcuts/{yimiaoban → im}/operations/msg-parse.js +0 -0
@@ -0,0 +1,117 @@
1
+ # 单条流程共享(workflow.sharePrepare / workflow.shareApply)
2
+
3
+ ## 什么时候读取
4
+
5
+ 用户要把**单条**流程共享给人员 / 部门 / 分部 / 群组 / 角色 / 岗位 / 所有人("把这条流程共享给 X / 让 X 也能看这条流程")时读取本文件。批量共享见 `workflow-batch.md`。
6
+
7
+ ## Operation
8
+
9
+ | Operation | 风险 | 固定规则 |
10
+ | --- | --- | --- |
11
+ | `workflow.sharePrepare` | read-before-write | 解析共享对象名称转 ID、取安全级别默认值,不写入;产出 continuation |
12
+ | `workflow.shareApply` | high-risk-write | 提交流程共享(addRequestShare2);必须 `confirm: true` + continuation |
13
+
14
+ ## 确认链
15
+
16
+ 1. `sharePrepare` → 向用户摘要目标 `requestId` / 共享对象解析结果 / 安全级别范围 / 风险。
17
+ 2. 等用户**明确确认**。
18
+ 3. `shareApply` 带 `confirm: true` 与 `continuation`(**无需重复传 shareObjects / 安全级别,continuation 已携带**)。
19
+ 4. 返回 `partial/write_uncertain` 时**立即停止**,先只读回查,**不自动重放**。
20
+
21
+ ## 输入
22
+
23
+ - `requestId`(数字或仅数字字符串)或 `group` + `index` 定位流程;`requestId` 必须来自查询索引,模型不能自己编。
24
+ - `shareObjects`:共享对象 JSON 数组字符串,每项 `{"type": <类型>, "name": <名称>}`;`all` 不需要 `name`。
25
+ - `minSeclevel`:最小安全级别(与默认值取大),仅用户明确要求限制时传。
26
+ - `maxSeclevel`:最大安全级别(与默认值取小),仅用户明确要求限制时传。
27
+ - `continuation`(仅 Apply):Prepare 返回的短句柄(形如 `wc-1a2b3c4d5e6f7a8b`),载荷由 CLI 托管在本机状态目录;原样回传,禁止解析、手工构造 / 修改 / 复用。
28
+ - `confirm`(仅 Apply):固定为 `true`。
29
+
30
+ ## 共享对象类型
31
+
32
+ | type | 共享对象 | name 说明 |
33
+ | --- | --- | --- |
34
+ | `user` | 人员 | 必填,姓名自动转 ID |
35
+ | `dept` | 部门 | 必填,部门名自动转 ID |
36
+ | `subcompany` | 分部 | 必填,分部名自动转 ID |
37
+ | `group` | 群组 | 必填,群组名自动转 ID |
38
+ | `role` | 角色 | 必填,角色名自动转 ID |
39
+ | `position` | 岗位 | 必填,岗位名自动转 ID |
40
+ | `all` | 所有人 | 不需要 name,直接 `{"type":"all"}` |
41
+
42
+ 名称自动转 ID;`name` 也支持 `"名称(ID)"`(如 `"张三(1001)"`):此时**直接采用括号里的 ID、不再搜名称**,多命中澄清后按该形式回传即可。多命中返回候选列表让用户确认,禁止静默全选(不允许把同名多人全部设为共享对象);0 命中报错提示核对名称。
43
+
44
+ ## 示例
45
+
46
+ ### 共享给一个人 + 一个部门 + 所有人
47
+
48
+ Windows PowerShell:
49
+
50
+ ```powershell
51
+ Set-Content -Encoding utf8 -LiteralPath .\share.json -Value @'
52
+ {
53
+ "requestId": "1307945196792242242",
54
+ "shareObjects": ["{\"type\":\"user\",\"name\":\"张三\"}","{\"type\":\"dept\",\"name\":\"产品研发中心\"}","{\"type\":\"all\"}"]
55
+ }
56
+ '@
57
+ weaver-work-cli --json workflow run workflow.sharePrepare --input .\share.json
58
+ ```
59
+
60
+ macOS/Linux(bash/zsh):
61
+
62
+ ```bash
63
+ cat > ./share.json <<'JSON'
64
+ {
65
+ "requestId": "1307945196792242242",
66
+ "shareObjects": ["{\"type\":\"user\",\"name\":\"张三\"}","{\"type\":\"dept\",\"name\":\"产品研发中心\"}","{\"type\":\"all\"}"]
67
+ }
68
+ JSON
69
+ weaver-work-cli --json workflow run workflow.sharePrepare --input ./share.json
70
+ ```
71
+
72
+ 确认后提交:
73
+
74
+ Windows PowerShell:
75
+
76
+ ```powershell
77
+ weaver-work-cli --json workflow run workflow.shareApply --input-json '{"confirm":true,"continuation":"<sharePrepare 返回的句柄,形如 wc-1a2b3c4d5e6f7a8b>"}'
78
+ ```
79
+
80
+ macOS/Linux(bash/zsh):
81
+
82
+ ```bash
83
+ weaver-work-cli --json workflow run workflow.shareApply --input-json '{"confirm":true,"continuation":"<sharePrepare 返回的句柄,形如 wc-1a2b3c4d5e6f7a8b>"}'
84
+ ```
85
+
86
+ ### 按列表序号定位 + 限制安全级别范围
87
+
88
+ Windows PowerShell:
89
+
90
+ ```powershell
91
+ weaver-work-cli --json workflow run workflow.sharePrepare --input-json '{"index":3,"shareObjects":["{\"type\":\"user\",\"name\":\"张三\"}"],"minSeclevel":"1","maxSeclevel":"3"}'
92
+ ```
93
+
94
+ macOS/Linux(bash/zsh):
95
+
96
+ ```bash
97
+ weaver-work-cli --json workflow run workflow.sharePrepare --input-json '{"index":3,"shareObjects":["{\"type\":\"user\",\"name\":\"张三\"}"],"minSeclevel":"1","maxSeclevel":"3"}'
98
+ ```
99
+
100
+ ## 返回
101
+
102
+ - `sharePrepare` 返回共享对象解析结果、安全级别默认值与 `continuation`;不写入。
103
+ - `shareApply` 透传 addRequestShare2 响应:`{code, status, msg, fail, data: [{sourceId, result, msg}, ...]}`(单条 data 数组 1 个元素,`result=true/false` 表示是否共享成功,`msg` 含原因);或返回 `partial/write_uncertain`。
104
+ - 按退出码 / `error.type` / `error.subtype` / `error.message` 判断成败,不盲目重试。
105
+
106
+ ## 注意
107
+
108
+ - 这不是 `workflow.operatePrepare` 的参数(operate 无共享动作)。
109
+ - `requestId` 必须来自查询索引;`shareObjects` 名称多命中必须澄清,禁止静默全选。
110
+ - `continuation` 是 CLI 托管的短句柄(形如 `wc-1a2b3c4d5e6f7a8b`),Agent 只原样回传,禁止解析、手工构造 / 修改 / 复用;`confirm` 必须且只能为 `true`。
111
+ - Apply 被重复执行、且上一次已经成功时,返回 `ok:true` + `data.status = "ALREADY_APPLIED"`(含 `previousResult`;若上一次是"服务端已成功回执、只是没来得及写回结果",还会给出 `requestId`)——**这不是失败**,本次没有重复写入,按上一次结果汇报即可,不要重跑 Prepare。
112
+ - Apply 报 `validation/continuation_busy` 时,说明句柄正被另一次执行占用、**上一次还没发出任何写入**:**稍后原样重试同一条命令**即可,不必重跑 Prepare、也不要换句柄。
113
+ - Apply 报 `validation/continuation_consumed` 时,说明占用该句柄的那次执行停在无法判定的旧状态:先只读核对目标流程是否已生效,确认没生效才重跑 Prepare。
114
+ - 安全级别范围仅在用户明确要求限制时传 `minSeclevel` / `maxSeclevel`。
115
+ - 写操作遇登录失效 / 超时 / 断连返回 `partial/write_uncertain`,**禁止自动重放**,先只读回查确认状态,不得重复提交。
116
+ - 同一操作连续 2 次失败必须停止。
117
+ - 不写任何凭据(Cookie / ETEAMSID / Token / 操作员标识由 CLI 托管)。
@@ -0,0 +1,189 @@
1
+ # 流程查看(detail / summary / open / requestLog / pageOpen)
2
+
3
+ ## 什么时候读取
4
+
5
+ 用户要查看某条流程的完整详情、生成业务摘要、打开流程,或查看签字意见/流转日志,或打开常用/动态 OA 页面时读取本文件。
6
+
7
+ ## Operation
8
+
9
+ | Operation | 固定规则 |
10
+ | --- | --- |
11
+ | `workflow.detail` | 优先用 `requestId`;列表序号定位用 `index`(分组场景加 `group`)。固定以"用户主动查看"语义调用(标记已读)。只读,无需 confirm。 |
12
+ | `workflow.summary` | 优先用 `requestId`;生成业务摘要上下文,**不标记已读**。`summaryFields` 默认 12。只读,无需 confirm。 |
13
+ | `workflow.open` | 优先用 `requestId`;生成打开动作(URL + clientAction)。`openMode` 默认 `auto`、`noOpen` 默认 false。只读,无需 confirm。 |
14
+ | `workflow.requestLog` | **必带 `requestId`**;按页查询签字意见/流转日志。`current` 默认 1、`pageSize` 默认 10(最大 50)。只读,无需 confirm。 |
15
+ | `workflow.pageOpen` | **必带 `page`**;动态页 `create` 配 `workflowId`、`view` 配 `requestId`。`openMode` 默认 `auto`、`noOpen` 默认 false。只读,无需 confirm。 |
16
+
17
+ ## 输入 —— 定位方式(requestId 与 index 二选一)
18
+
19
+ - `requestId`:流程请求 ID(整数或纯数字字符串)。用户已给出 ID 时直接用,不要先查列表再过滤。
20
+ - `index`:基于当前会话最近一次查询结果的序号(从 1 开始)。
21
+ - `group`:分组标识(`urgent`/`overdue`/`batch`/`pending`),**仅分组场景必填**——低版本模式(OA < `10.0.9909.01`)通用待办分组展示时每个分组序号独立从 1 开始,必须同时传 `group` + `index`。
22
+ - 只传 `index` 不传 `group` 会定位到其他分组的同序号流程。
23
+
24
+ **智能分组模式(OA ≥ `10.0.9909.01`)查询不产生分组,定位时只传 `index`,不传 `group`。**
25
+
26
+ ## 输入 —— 各 operation 字段
27
+
28
+ | Operation | 关键字段 | 说明 |
29
+ | --- | --- | --- |
30
+ | `workflow.detail` | `requestId` / `index` / `group` | `requestLogCurrent`(签字意见当前页,默认 1)、`requestLogPageSize`(每页条数,默认 10,最大 50) |
31
+ | `workflow.summary` | `requestId` / `index` / `group` | `summaryFields`(摘要关注字段数,默认 12) |
32
+ | `workflow.open` | `requestId` / `index` / `group` | `openMode`(`auto`/`localBrowser`/`clientAction`/`url`,默认 `auto`)、`noOpen`(默认 false) |
33
+ | `workflow.requestLog` | `requestId`(必填) | `current`(默认 1)、`pageSize`(默认 10,最大 50) |
34
+ | `workflow.pageOpen` | `page`(必填) | `workflowId`(create 页)、`requestId`(view 页)、`openMode`、`noOpen` |
35
+
36
+ ### pageOpen 页面 key(page)
37
+
38
+ | key | 页面 | 额外必填 |
39
+ | --- | --- | --- |
40
+ | `center` | 流程首页 | — |
41
+ | `todo` | 待办列表 | — |
42
+ | `done` | 已办列表 | — |
43
+ | `mine` | 我发起的 | — |
44
+ | `share` | 共享 | — |
45
+ | `attention` | 关注 | — |
46
+ | `draft` | 草稿 | — |
47
+ | `subordinates` | 下属待办 | — |
48
+ | `all` | 全部 | — |
49
+ | `newflow` | 提交申请/可发起流程页 | — |
50
+ | `monitor` | 流程监控 | — |
51
+ | `create` | 发起流程 | `workflowId` |
52
+ | `view` | 流程详情 | `requestId` |
53
+
54
+ > `pageOpen` 的地址由 CLI 按内置地址表生成,**不要自行拼接 OA URL**(不要手动拼 baseUrl + 路径)——只传 `page`,动态页再配 `workflowId`/`requestId`。
55
+
56
+ ## 详情输出规则(按用户问法选择)
57
+
58
+ **A. 用户要看完整详情**("打开这条/看完整详情/详情是啥")→ 直接原样输出 `renderMarkdown` 全部三部分(基础信息 + 表单内容 + 签字意见)。不要输出 HTML 面板、不要输出 Markdown 表格、不要拆多个卡片。字段值必须原样展示,长文本保留换行,链接字段用超链接渲染。
59
+
60
+ **B. 用户对流程具体内容提问**("审批人发表了什么意见/某字段是什么/为什么退回了/流程走到哪了")→ **不要原样输出完整详情**(三段堆出来对内容提问是噪音)。从 `renderMarkdown` / 返回数据里提取用户问的相关部分,用一段话直接回答;只引用相关的签字意见段、字段值或基础信息片段。后续用户明确要"看完整详情/打开流程"才输出完整 `renderMarkdown`。
61
+
62
+ 签字意见每条三行(不论 A/B 场景,提取签字意见时按此格式组织):
63
+
64
+ 1. 操作人、操作方式、操作时间。
65
+ 2. 接收人员。
66
+ 3. 签字意见。
67
+
68
+ 详情规则补充:
69
+
70
+ - 标题用流程请求标题,不单独展示"流程名称"字段;`workflowName` 只能叫"工作流名称",默认不展示。
71
+ - 第一条分隔线只能在基础信息区之后;标题下方不要加横线。
72
+ - 表单字段值必须原样展示,不能摘要、改写、删减字段值中自带的"需求概述:"等文字。
73
+ - 字段有 `valueHtml`/`links` 时优先渲染为超链接;长文本字段全宽展示,保留原文换行。
74
+ - 只有签字意见 `hasMore=true` 才显示下一页提示。
75
+ - 详情面板后不要输出固定建议列表或"如果想进一步操作"类尾巴。
76
+
77
+ ## 摘要规则
78
+
79
+ 模型基于返回的摘要上下文提炼业务摘要,**不默认展示完整详情**。摘要先一句话概括业务事项,再列 4–7 条要点;不要体现发起人/申请人姓名,不要只复述标题,不要编造。流程状态和当前节点只在用户明确询问或确实影响业务判断时补充。
80
+
81
+ ## 示例
82
+
83
+ ### 按 requestId 查看详情
84
+
85
+ Windows PowerShell:
86
+
87
+ ```powershell
88
+ weaver-work-cli --json workflow run workflow.detail --input-json '{"requestId":"1307945196792242242"}'
89
+ ```
90
+
91
+ macOS/Linux(bash/zsh):
92
+
93
+ ```bash
94
+ weaver-work-cli --json workflow run workflow.detail --input-json '{"requestId":"1307945196792242242"}'
95
+ ```
96
+
97
+ ### 分组场景按序号查看(待处理组第 3 条,低版本模式)
98
+
99
+ Windows PowerShell:
100
+
101
+ ```powershell
102
+ weaver-work-cli --json workflow run workflow.detail --input-json '{"group":"pending","index":3}'
103
+ ```
104
+
105
+ macOS/Linux(bash/zsh):
106
+
107
+ ```bash
108
+ weaver-work-cli --json workflow run workflow.detail --input-json '{"group":"pending","index":3}'
109
+ ```
110
+
111
+ ### 生成业务摘要
112
+
113
+ Windows PowerShell:
114
+
115
+ ```powershell
116
+ weaver-work-cli --json workflow run workflow.summary --input-json '{"requestId":"1307945196792242242"}'
117
+ ```
118
+
119
+ macOS/Linux(bash/zsh):
120
+
121
+ ```bash
122
+ weaver-work-cli --json workflow run workflow.summary --input-json '{"requestId":"1307945196792242242"}'
123
+ ```
124
+
125
+ ### 打开流程
126
+
127
+ Windows PowerShell:
128
+
129
+ ```powershell
130
+ weaver-work-cli --json workflow run workflow.open --input-json '{"requestId":"1307945196792242242"}'
131
+ ```
132
+
133
+ macOS/Linux(bash/zsh):
134
+
135
+ ```bash
136
+ weaver-work-cli --json workflow run workflow.open --input-json '{"requestId":"1307945196792242242"}'
137
+ ```
138
+
139
+ ### 查询签字意见(第 2 页)
140
+
141
+ Windows PowerShell:
142
+
143
+ ```powershell
144
+ weaver-work-cli --json workflow run workflow.requestLog --input-json '{"requestId":"1307945196792242242","current":2}'
145
+ ```
146
+
147
+ macOS/Linux(bash/zsh):
148
+
149
+ ```bash
150
+ weaver-work-cli --json workflow run workflow.requestLog --input-json '{"requestId":"1307945196792242242","current":2}'
151
+ ```
152
+
153
+ ### 打开常用 OA 页面
154
+
155
+ Windows PowerShell:
156
+
157
+ ```powershell
158
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"todo"}'
159
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"create","workflowId":"100003460000000060"}'
160
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"view","requestId":"1307945196792242242"}'
161
+ ```
162
+
163
+ macOS/Linux(bash/zsh):
164
+
165
+ ```bash
166
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"todo"}'
167
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"create","workflowId":"100003460000000060"}'
168
+ weaver-work-cli --json workflow run workflow.pageOpen --input-json '{"page":"view","requestId":"1307945196792242242"}'
169
+ ```
170
+
171
+ ## 返回
172
+
173
+ | Operation | 关键返回字段 | 渲染说明 |
174
+ | --- | --- | --- |
175
+ | `workflow.detail` | `renderMarkdown`(基础信息 + 表单内容 + 签字意见) | 直接原样输出,不改成 HTML/表格/多卡片;字段值原样展示,长文本保留换行,链接字段渲染为超链接 |
176
+ | `workflow.summary` | 业务摘要上下文 | 一句话概括业务事项 + 4–7 条要点;默认不体现发起人姓名 |
177
+ | `workflow.open` | `opened`、`requiresHostAction`、URL/clientAction | 仅 `opened=true` 才说已打开;`requiresHostAction=true` 时说明已生成宿主打开动作,等待客户端执行 |
178
+ | `workflow.requestLog` | 签字意见数组(操作人/方式/时间、接收人、签字意见)、`hasMore` | 每条三行组织;仅 `hasMore=true` 才提示下一页 |
179
+ | `workflow.pageOpen` | `opened`、`requiresHostAction`、URL | 同 `open`;动态页按 `page` 生成对应地址 |
180
+
181
+ ## 注意
182
+
183
+ - **禁止事项**:不要把详情/摘要/打开结果改写、压缩或重排成自己的话;`renderMarkdown`/`finalMarkdown` 必须一字不改原样呈现。详情面板后不要加固定建议尾巴。
184
+ - **摘要不标记已读**:`workflow.summary` 不改变流程未读状态;`workflow.detail` 会标记已读(用户主动查看语义),按需选择。
185
+ - **定位纪律**:用户已给 `requestId` 时不要先查列表再过滤;分组场景必须 `group` + `index` 同时传;智能分组模式只传 `index`。
186
+ - **大结果**:详情签字意见按 `requestLogPageSize` 分页,仅 `hasMore=true` 提示下一页;需要原始 JSON 时落本地文件返回路径。
187
+ - **失败/停止**:CLI 失败时在 **stderr** 返回 `ok:false` + `error.type`/`error.subtype`/`error.message`/`error.retryable`(**没有** `success`/`stopReason`/`userMessage` 字段)——`retryable=true` 时最多重试一次,否则原样转述 `error.message` 并停止,不重试、不换接口。入参类错误(如 `locate_required`)按 `error.message` 补齐参数后重试一次。
188
+ - **未登录/登录失效**:按 `weaver-e10-shared` 的 `references/e10-auth-and-session.md` 引导用户登录,登录后重放原请求(读操作可重放)。
189
+ - **凭据禁止**:业务输入里禁止传入 Cookie、ETEAMSID、Token、`header.operator`,这些由 CLI 托管。
@@ -2,10 +2,10 @@
2
2
  name: weaver-e10-yepiaotong
3
3
  display_name: 泛微业票通发票
4
4
  display_name_en: Weaver Invoice
5
- description: "泛微 E10 业票通发票管理:查询票夹、OCR/查验、附件、流程发票字段、报销填单、智能开票确认链、红字发票(红冲申请/查询/确认)。"
6
- description_zh: "泛微 E10 业票通发票管理。支持查询个人/企业票夹、查看详情、上传、OCR/查验预览、下载附件、流程表单发票字段数据,通过 prepare/apply 确认链处理导入、新增、编辑、删除、报销单创建/更新、智能开票/存台账;红字发票红冲申请/查询/确认。"
7
- description_en: "Weaver E10 Yepiaotong invoice skill for folder queries, detail lookup, OCR and validation previews, attachment downloads, workflow invoice field data, reimbursement form submission, confirmed invoice issuing, and red invoice management."
8
- version: 1.0.0
5
+ description: "泛微 E10 业票通发票管理:查询票夹、OCR/查验、附件、流程发票字段、报销填单、智能开票确认链。"
6
+ description_zh: "泛微 E10 业票通发票管理。支持查询个人/企业票夹、查看详情、上传、OCR/查验预览、下载附件、流程表单发票字段数据,通过 prepare/apply 确认链处理导入、新增、编辑、删除、报销单创建/更新、智能开票/存台账。"
7
+ description_en: "Weaver E10 Yepiaotong invoice skill for folder queries, detail lookup, OCR and validation previews, attachment downloads, workflow invoice field data, reimbursement form submission, and confirmed invoice issuing."
8
+ version: 1.0.1
9
9
  author: 泛微网络科技股份有限公司
10
10
  agent_created: true
11
11
  requires:
@@ -13,12 +13,23 @@ requires:
13
13
  cliHelp: "weaver-work-cli invoice --help"
14
14
  ---
15
15
 
16
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --skills-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
16
+ **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出、超时与重试预算、非交互环境处置和高风险写入规则。若共享规则不存在、CLI 未安装或读取失败,必须先提示用户先补齐 `weaver-work-cli` 与共享 skill;Agent 不能自行安装或继续猜测,补齐方式(npm 源安装 / 本地代码安装)与版本检查一律以共享规则为准,必须先取得用户明确确认后再执行。**
17
+
17
18
  认证和登录态只能按共享规则通过 `weaver-work-cli auth ...` 命令判断;禁止直接读取、列出、打印或解析用户主目录下的旧 `.e10-cli`、auth、config 或 Keychain 数据。
18
19
  所有命令通过 `weaver-work-cli --json invoice run <operation>` 执行:简单 JSON 优先传 `--input-json '<json>'`,复杂或多行 JSON 先写入 UTF-8 文件再传 `--input <path>`,只有确认当前 shell 能稳定传管道时才使用 `--input -`。调用前先按需读取 references 下对应的文件,查参数结构,不要猜字段;**references 是第一信息源**,`weaver-work-cli invoice schema` 是 operation、字段和风险等级的合约来源。
19
20
  命令示例、提示词和临时说明必须同时兼容 Windows 和 macOS/Linux;涉及 JSON 输入、用户目录、路径分隔符、Python 启动器、文件删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例。Agent 先根据当前系统和 shell 选择对应示例,不确定时用 `node -p "process.platform"` 判断。Windows/PowerShell 下不要使用 `printf`、`$HOME/...`、`~/...`、bash 反斜杠续行、`rm/ls/diff/python3` 等 Unix-only 写法。
20
21
  涉及发票附件、图片、本地文件、远程 URL 文件或 OCR/文件解析的操作,执行前必须提醒用户:文件内容可能被上传到 E10 业票通、OCR/查验服务,并可能进入当前大模型上下文用于理解和处理;必须等待用户明确确认后才继续。
21
22
 
23
+ # 泛微E10业票通发票管理
24
+
25
+ ## 共享包依赖(发布与安装约束)
26
+
27
+ 本包通过相对路径引用共享规则 `../weaver-e10-shared/`(SKILL.md 与 9 处 references 内联路径,合计 10 处)。这些引用**只有在共享包以同名目录 `weaver-e10-shared` 存在时才可解析**。
28
+
29
+ - 发布共享规则时,必须使用原 installId **覆盖同名共享包**,不要以新技能名上传并与旧包并存;否则本包引用仍指向旧版共享规则,新版超时、降级识别与非交互处置一行都不会被读取。
30
+ - 若确需改用新的共享包目录名,必须同步全量替换本包 10 处跨包引用并做一次回归验证。
31
+ - Agent 发现引用目标不存在或内容明显过期时,停止执行并提示用户补齐/覆盖同名共享包,不要改写相对路径去适配其它目录名。
32
+
22
33
  ## 路由优先级(先判断是不是业票通发票,再选 operation)
23
34
 
24
35
  业票通发票不是通用 E10 对象。**只要用户的核心对象是业票通发票、个人/企业票夹、发票 OCR、发票查验或发票附件,就优先使用 `weaver-e10-yepiaotong`。**
@@ -32,10 +43,9 @@ cliHelp: "weaver-work-cli invoice --help"
32
43
  - 导入发票 / 新增发票 / 编辑发票 / 删除发票
33
44
  - 发票报销 / 自动填单 / 事前申请报销 / 报销单创建或更新
34
45
  - 开票 / 开专票 / 开普票 / 存台账 / 智能开票
35
- - 红冲 / 冲红 / 开红票 / 红字发票 / 红字确认单 / 红冲确认
36
46
  - `fid` / `fileId` / 发票号码 / 发票代码 / 查验状态 / 报销状态
37
47
 
38
- **判定规则:** 只要最终动作是对业票通发票做查询、查看、上传、OCR、查验预览、下载、导入、新增、编辑、删除、流程表单发票字段、发票报销填单、开票/存台账或红冲,就归 `weaver-e10-yepiaotong`。只有当用户处理的是非发票类 E10 业务、通用工作流或尚未封装的业票通能力时,才不使用本 Skill。
48
+ **判定规则:** 只要最终动作是对业票通发票做查询、查看、上传、OCR、查验预览、下载、导入、新增、编辑、删除、流程表单发票字段、发票报销填单或开票/存台账,就归 `weaver-e10-yepiaotong`。只有当用户处理的是非发票类 E10 业务、通用工作流或尚未封装的业票通能力时,才不使用本 Skill。
39
49
 
40
50
  ## 选哪个命令
41
51
 
@@ -64,22 +74,9 @@ cliHelp: "weaver-work-cli invoice --help"
64
74
  | 报销表单字段填充与 JSON 组装规则 | AI 内部 | [`reim-form-fill-rules.md`](references/reim-form-fill-rules.md) |
65
75
  | 报销端到端示例 | 参考 | [`reim-examples.md`](references/reim-examples.md) |
66
76
  | 智能开票或存入待开台账 | `invoice run invoice.issuing.make.prepare/apply` | [`invoice-issuing.md`](references/invoice-issuing.md) |
67
- | 共享、转让、标签或 schema 未列出的能力 | 无可用命令 | [`invoice-disabled-capabilities.md`](references/invoice-disabled-capabilities.md) |
68
-
69
- ### 红字发票 / 红冲(直接 API 调用)
70
-
71
- > 红冲能力通过发票 Token + E10 API 直接调用,CLI 尚未封装。
72
- > 需要 E10 上下文的 `BASE_URL` 和 `eteamsId`;发票 Token 由 `getToken` 接口获取。
73
-
74
- | 想做什么 | 调用方式 | 按需读取 reference |
75
- |---|---|---|
76
- | **红冲申请(全额/部分)** | `POST redConfirmationApply` | [`invoice-red.md`](references/invoice-red.md) |
77
- | **查询可红冲蓝票** | `POST queryAvailableBlueInfo` | [`invoice-red.md`](references/invoice-red.md) |
78
- | **查询红字确认单列表** | `POST queryRedConfirmationList` | [`invoice-red.md`](references/invoice-red.md) |
79
- | **查询红字确认单明细** | `POST queryRedConfirmationDetail` | [`invoice-red.md`](references/invoice-red.md) |
80
- | **红冲确认/拒绝/撤销** | `POST redConfirmationConfirm` | [`invoice-red.md`](references/invoice-red.md) |
81
77
  | 开票字段提取规则、税率推断、金额计算 | AI 内部 | [`invoice-issuing-field-rules.md`](references/invoice-issuing-field-rules.md) |
82
- | 开票/红冲端到端示例 | 参考 | [`invoice-issuing-examples.md`](references/invoice-issuing-examples.md) |
78
+ | 开票端到端示例 | 参考 | [`invoice-issuing-examples.md`](references/invoice-issuing-examples.md) |
79
+ | 共享、转让、标签或 schema 未列出的能力 | 无可用命令 | [`invoice-disabled-capabilities.md`](references/invoice-disabled-capabilities.md) |
83
80
 
84
81
  处理链:
85
82
 
@@ -90,10 +87,8 @@ cliHelp: "weaver-work-cli invoice --help"
90
87
  - 编辑发票:`invoice.update.prepare` -> 用户确认 -> `invoice.update.apply`
91
88
  - 删除发票:`invoice.delete.prepare` -> 用户确认 -> `invoice.delete.apply`
92
89
  - 流程发票字段:已有 `fid` 或详情时,用 `invoice.browse-field.data` 生成浏览按钮对象;不要运行旧源码脚本或直接调接口。
93
- - 报销填单(完整工作流见 [`reim-workflow.md`](references/reim-workflow.md)):先用 `invoice.list`/`invoice.get`/`invoice.reim.file-ocr.preview` 获取发票 -> 展示汇总并确认 -> 用 `invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.employee-superiors` 组装 payload(匹配规则见 [`reim-matching-rules.md`](references/reim-matching-rules.md),填单规则见 [`reim-form-fill-rules.md`](references/reim-form-fill-rules.md),科目匹配见 [`reim-expense-subject-rules.md`](references/reim-expense-subject-rules.md))-> `invoice.reim.flow.create.prepare` -> 用户确认 -> `invoice.reim.flow.create.apply`。创建成功后修改只能用 `invoice.reim.flow.update.prepare/apply`。
94
- - 智能开票:Agent 先提取并校验开票字段、税率和金额 -> `invoice.issuing.make.prepare` -> 用户确认开票或存台账 -> `invoice.issuing.make.apply`。
95
- - **红冲申请**:获取蓝字发票号 -> `queryAvailableBlueInfo` -> 展示蓝票 -> 确认方式+原因 -> 预览 -> `redConfirmationApply`
96
- - **红冲确认**:`queryRedConfirmationList` -> 选择 -> `queryRedConfirmationDetail` -> 确认 -> `redConfirmationConfirm`
90
+ - 报销填单(完整工作流见 [`reim-workflow.md`](references/reim-workflow.md)):先用 `invoice.list`/`invoice.get`/`invoice.reim.file-ocr.preview` 获取发票 -> 展示汇总并确认 -> 用 `invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.employee-superiors` 组装报销单 JSON(匹配规则见 [`reim-matching-rules.md`](references/reim-matching-rules.md),填单规则见 [`reim-form-fill-rules.md`](references/reim-form-fill-rules.md),科目匹配见 [`reim-expense-subject-rules.md`](references/reim-expense-subject-rules.md))-> `invoice.reim.flow.create.prepare` -> 用户确认 -> `invoice.reim.flow.create.apply`。创建成功后修改只能用 `invoice.reim.flow.update.prepare/apply`。
91
+ - 智能开票:Agent 读取 `invoice-issuing.md` `invoice-issuing-field-rules.md`,从用户输入或附件中提取购方、税号、商品明细、金额和税率;资料不足时追问用户补齐,再执行 `invoice.issuing.make.prepare` -> 用户确认开票或存台账 -> `invoice.issuing.make.apply`。当前资料包没有客户档案查询 operation,不要调用 `invoice.customer.*`。
97
92
 
98
93
  ## 执行原则(减少误路由、误重试和无效消耗)
99
94
 
@@ -124,7 +119,12 @@ cliHelp: "weaver-work-cli invoice --help"
124
119
  - 失败后先看进程退出码、`error.type`、`error.subtype` 和 `error.message`
125
120
  - **除非错误明确提示可恢复或需要补充参数,否则不要重复刷同一个 operation**
126
121
  - 写请求已经发出后,遇到结果不确定必须停止;不要把 `.apply` 当成可重试读操作
127
- - **错误为 `authentication`(未登录,如 `E10 auth not found`)或 `session_expired`(登录态失效)时:立即停止当前操作,不要用示例占位域名或自行猜域名登录,也不要盲目重试**。先读取共享规则 `../weaver-e10-shared/references/e10-auth-and-session.md`,按其中流程用宿主提问/弹框让用户输入 E10 登录域名或选择已有 profile,完成登录后再继续原操作。
122
+ - **错误为 `authentication`(未登录,如 `E10 auth not found`)或 `session_expired`(登录态失效)时:立即停止当前操作,不要用示例占位域名或自行猜域名登录,也不要盲目重试**。
123
+ - 认证失败后**先判定当前环境是否可交互**(能否向用户提问并等待回答、CLI 与浏览器是否同机、外部浏览器能否回调 `127.0.0.1:19800`):
124
+ - **不可交互**(容器 / 沙箱 / CI / 无 GUI / 无人值守):立即终止,不要调用宿主提问或弹框等待用户输入域名或选择 profile,直接读取并按共享规则 [`../weaver-e10-shared/references/non-interactive-environment.md`](../weaver-e10-shared/references/non-interactive-environment.md) 处置,把完整登录命令交给用户在其本地终端执行。
125
+ - **可交互**:读取共享规则 [`../weaver-e10-shared/references/e10-auth-and-session.md`](../weaver-e10-shared/references/e10-auth-and-session.md),用宿主提问/弹框让用户输入 E10 登录域名或选择已有 profile,完成登录后再继续原操作。
126
+ - 登录类命令必须带 timeout 限时(上限 300 秒 / 5 分钟,后台运行 + 限时观察):输出一旦出现 `Open browser login`、`Waiting for E10 authorization callback` 或 `Could not open browser automatically`,即判定已降级到浏览器 OAuth,立即终止该命令并反馈,不得继续等待。登录失败不自动重试。
127
+ - 需要浏览器登录时必须携带发起方标识 `--agent_type "<当前智能体名称>"`(授权确认页展示用;宿主无法确认名称时才可省略,交由 CLI 从环境变量推断)。
128
128
 
129
129
  ### 4) 附件、图片和文件解析确认
130
130
 
@@ -177,7 +177,7 @@ weaver-work-cli --json invoice run invoice.issuing.make.prepare --input-json '{"
177
177
 
178
178
  - 禁止加载原始 `weaver-e10-yepiaotong` Skill 代替 CLI。
179
179
  - 已有 CLI 封装的能力(list/get/upload/OCR/import/add/update/delete/issuing/reim)禁止 curl、fetch、浏览器自动化或直接访问 E10 `/api/inc/*`,必须通过 CLI。
180
- - **红冲能力**可以直接调用 E10 API(`getToken`、`queryAvailableBlueInfo`、`redConfirmationApply`、`redConfirmationConfirm`、`queryRedConfirmationList`、`queryRedConfirmationDetail`),因为 CLI 尚未封装红冲 operation。调用时使用发票 Token(非 CLI 内部 Token)。
180
+ - 当前修正源资料未提供客户档案查询或红字发票红冲接口,`invoice.customer.*` `invoice.red.*` 不属于可用 operation;遇到这类请求时读取 [`invoice-disabled-capabilities.md`](references/invoice-disabled-capabilities.md) 并说明当前 CLI 不支持绕过调用。
181
181
  - 禁止读取或复制 CLI runtime 内部 Token、Cookie、ETEAMSID。
182
182
  - 禁止读取、列出、打印或解析用户主目录下的旧 `.e10-cli`、auth、config 或 Keychain 数据。
183
183
  - 共享、转让和标签当前未纳入 CLI manifest;新版源资料已给出提交接口,但仍需要补稳定接收人/标签 ID 来源、写后回查和测试后再开放。
@@ -6,13 +6,18 @@
6
6
 
7
7
  ## 当前不暴露
8
8
 
9
- 以下新版源资料中已有接口路径和请求体,但当前没有纳入 `weaver-work-cli invoice` manifest,Agent 不能绕过 CLI 直接调用:
9
+ 以下新版源资料中已有后端能力线索,但当前没有纳入 `weaver-work-cli invoice` manifest,Agent 不能绕过 CLI 直接调用。这里仅保留源资料标识用于转换差异追踪,不构成可执行接口文档:
10
10
 
11
- - 共享发票:`POST /api/inc/shareUsers`
12
- - 转让发票:`POST /api/inc/transferFpyUser`
13
- - 标记发票:`POST /api/my/tag/common/batchAddEntityTag`
11
+ - 共享发票:`shareUsers`
12
+ - 转让发票:`transferFpyUser`
13
+ - 标记发票:`batchAddEntityTag`
14
14
  - 移除、替换或覆盖标签
15
15
 
16
+ 修正后的资料包没有提供客户档案查询或红字发票红冲接口定义,因此以下 operation 不属于当前 skill/CLI 能力:
17
+
18
+ - 客户档案查询:`invoice.customer.*`
19
+ - 红字发票/红冲查询、申请和确认:`invoice.red.*`
20
+
16
21
  ## 原因
17
22
 
18
23
  这些能力缺少稳定的 Agent 合约:
@@ -22,7 +27,8 @@
22
27
  - 转让会改变发票持有人,缺少接收人侧归属回查契约;当前登录人可能在成功后失去可见性,不能据此单独证明新归属
23
28
  - 标签缺少标签定义查询、当前标签关系查询和移除/替换语义
24
29
  - 写操作后的读回验证边界不完整
30
+ - 客户档案查询、红字发票红冲接口在当前资料包中没有来源文档,不能从旧资料或猜测路径转换
25
31
 
26
32
  ## Agent 行为
27
33
 
28
- 遇到这类请求时,明确说明当前 CLI 未暴露该 operation,不能通过 `curl`、`fetch`、浏览器自动化或原始 E10 `/api/inc/*` 绕过。可以建议先补对应的人员/标签查询能力、`prepare -> apply`、写后回查和测试,再开放给 Agent。
34
+ 遇到这类请求时,明确说明当前 CLI 未暴露该 operation,不能通过 `curl`、`fetch`、浏览器自动化或原始 E10 接口绕过。可以建议先补对应的人员/标签查询能力、`prepare -> apply`、写后回查和测试,再开放给 Agent。
@@ -2,15 +2,15 @@
2
2
 
3
3
  ## 什么时候读取
4
4
 
5
- 用户要把本地发票文件导入票夹时读取本文件。开始前也读取共享高风险协议:`../../weaver-e10-shared/references/high-risk-write.md`。
5
+ 用户要把本地发票文件或远程发票 URL 导入票夹时读取本文件。开始前也读取共享高风险协议:`../../weaver-e10-shared/references/high-risk-write.md`。
6
6
 
7
7
  ## Operation
8
8
 
9
9
  | 阶段 | Operation | 必填输入 |
10
10
  | --- | --- | --- |
11
- | 识别预览 | `invoice.ocr.preview` | `file` |
12
- | 准备导入 | `invoice.import.prepare` | `file`、`validate`、`syncToOa` |
13
- | 确认导入 | `invoice.import.apply` | `file`、`continuation`、`confirm=true` |
11
+ | 识别预览 | `invoice.ocr.preview` | `file` 或 `url` |
12
+ | 准备导入 | `invoice.import.prepare` | `file` 或 `url`,以及 `validate`、`syncToOa` |
13
+ | 确认导入 | `invoice.import.apply` | 与 prepare 相同的 `file` 或 `url`,以及 `continuation`、`confirm=true` |
14
14
 
15
15
  ## 示例
16
16
 
@@ -19,9 +19,11 @@ Windows PowerShell:
19
19
  ```powershell
20
20
  weaver-work-cli --json invoice run invoice.ocr.preview --input-json '{"file":"./invoice.pdf"}'
21
21
 
22
- weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"file":"./invoice.pdf","validate":true,"syncToOa":true}'
22
+ weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"file":"./invoice.pdf","validate":true,"syncToOa":true,"filedMap":{"projectName":"示例项目"}}'
23
23
 
24
- weaver-work-cli --json invoice run invoice.import.apply --input-json '{"file":"./invoice.pdf","continuation":"PREPARE_CONTINUATION","confirm":true}'
24
+ weaver-work-cli --json invoice run invoice.import.apply --input-json '{"file":"./invoice.pdf","filedMap":{"projectName":"示例项目"},"continuation":"PREPARE_CONTINUATION","confirm":true}'
25
+
26
+ weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"url":"https://example.com/invoice.pdf","validate":true,"syncToOa":true}'
25
27
  ```
26
28
 
27
29
  macOS/Linux(bash/zsh):
@@ -29,9 +31,11 @@ macOS/Linux(bash/zsh):
29
31
  ```bash
30
32
  weaver-work-cli --json invoice run invoice.ocr.preview --input-json '{"file":"./invoice.pdf"}'
31
33
 
32
- weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"file":"./invoice.pdf","validate":true,"syncToOa":true}'
34
+ weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"file":"./invoice.pdf","validate":true,"syncToOa":true,"filedMap":{"projectName":"示例项目"}}'
35
+
36
+ weaver-work-cli --json invoice run invoice.import.apply --input-json '{"file":"./invoice.pdf","filedMap":{"projectName":"示例项目"},"continuation":"PREPARE_CONTINUATION","confirm":true}'
33
37
 
34
- weaver-work-cli --json invoice run invoice.import.apply --input-json '{"file":"./invoice.pdf","continuation":"PREPARE_CONTINUATION","confirm":true}'
38
+ weaver-work-cli --json invoice run invoice.import.prepare --input-json '{"url":"https://example.com/invoice.pdf","validate":true,"syncToOa":true}'
35
39
  ```
36
40
 
37
41
  ## 注意
@@ -42,4 +46,6 @@ weaver-work-cli --json invoice run invoice.import.apply --input-json '{"file":".
42
46
 
43
47
  `validate` 和 `syncToOa` 必须显式传布尔值。默认推荐 `validate=true`、`syncToOa=true`;`validate=true` 分支由服务端固定同步 OA,不能设置 `syncToOa=false`。只有用户明确要求跳过发票查验或离线导入时,才传 `validate=false`;`validate=false` 表示跳过查验,不能描述为“查验通过”。
44
48
 
49
+ `fieldKey`/`fieldValue` 可给成功发票设置单个字段,两个参数必须同时提供。`filedMap` 用于批量设置成功发票字段;它在 `inputSchema` 和 `--input-json` 中必须保持 JSON 对象,例如 `"filedMap":{"projectName":"示例项目"}`,不要提前转成字符串。CLI 会在提交 `/api/app/inc/biz/addInvoiceByFile` 的 multipart 表单时再序列化为字符串。
50
+
45
51
  `.prepare` 返回 `preview`、`continuation`、`expiresInSeconds` 和 `workflow.state="AWAITING_CONFIRMATION"`。展示风险后等待用户明确确认,再调用 `.apply`。
@@ -1,8 +1,8 @@
1
- # 开票与红冲端到端示例
1
+ # 开票端到端示例
2
2
 
3
3
  ## 什么时候读取
4
4
 
5
- 需要参考开票或红冲完整对话流程时读取本文件。
5
+ 需要参考开票完整对话流程时读取本文件。
6
6
 
7
7
  ---
8
8
 
@@ -33,11 +33,11 @@
33
33
  **用户**:开给杭州阿里巴巴,技术服务费5万,不含税
34
34
 
35
35
  **AI**:
36
- > 推断税率 6%。需要购方税号吗?如需开专票请提供。
36
+ > 请问是开**个人票(普票,无需税号)**还是**企业专票(需提供税号)**?
37
37
 
38
38
  **用户**:专票,税号 91330100MA27F4RQ12
39
39
 
40
- → 金额计算 → 预览 → 确认 → 提交
40
+ 推断税率 6% → 金额计算 → 预览 → 确认 → 提交
41
41
 
42
42
  ---
43
43
 
@@ -45,6 +45,11 @@
45
45
 
46
46
  **用户**:开普票,购方张三,500块钱的餐饮服务,含税
47
47
 
48
+ **AI**:
49
+ > 是否确认开**个人普票**?(个人票无需税号)
50
+
51
+ **用户**:对,开个人票
52
+
48
53
  **AI 推断**:invoiceType="7", personLogo="1",税率 6%,不含税 471.70,税额 28.30
49
54
 
50
55
  → 预览 → 确认 → 提交
@@ -79,42 +84,3 @@
79
84
  预览后用户回复:"**先存台账**"
80
85
 
81
86
  **AI**:调用 makeInvoice 时添加 `"operateType": "5"` → 展示"已存入待开台账"
82
-
83
- ---
84
-
85
- ## 示例 7:全额红冲
86
-
87
- **用户**:帮我红冲发票 24532000000070468898
88
-
89
- **AI**:
90
- 1. queryAvailableBlueInfo 查蓝票
91
- 2. 展示蓝票信息(购方、金额、明细)
92
- 3. 追问:全额/部分?原因?
93
-
94
- **用户**:全额红冲,开票有误
95
-
96
- 4. 展示红冲预览 → 用户确认
97
- 5. redConfirmationApply(isPart="0", redCause="01")
98
- 6. 展示结果:确认单编号 + 状态
99
-
100
- ---
101
-
102
- ## 示例 8:部分红冲
103
-
104
- **用户**:红冲发票 2453200...899,只冲第 1 行的 3 万
105
-
106
- **AI**:查蓝票 → 展示 → 追问原因 → "销售折让"
107
-
108
- 提交:isPart="1",detail 传 blueInvoiceLine="1",amount="30000" → 展示结果
109
-
110
- ---
111
-
112
- ## 示例 9:查询红冲并确认
113
-
114
- **用户**:看看最近有没有待确认的红冲
115
-
116
- **AI**:queryRedConfirmationList → 过滤待确认记录 → 展示列表
117
-
118
- **用户**:同意第 1 条
119
-
120
- **AI**:queryRedConfirmationDetail 展示详情 → 用户确认 → redConfirmationConfirm(confirmType="Y") → 展示结果
@@ -20,6 +20,14 @@
20
20
 
21
21
  `payload` 是已整理好的 `MakeInvoiceReqDTO`。核心字段至少包括购方名称、发票类型、外部单号、金额合计和一条商品明细。专票或全电纸质专票必须提供购方税号。
22
22
 
23
+ ### 购方信息补齐
24
+
25
+ 修正后的资料包没有提供客户档案查询 operation。组装 payload 前,Agent 只能从用户输入、附件内容或对话上下文提取购方信息;资料不足时必须追问用户补齐,不要调用 `invoice.customer.*` 或绕过 CLI 查询原始接口。
26
+
27
+ - 个人普票:`invoiceType="7"`,`personLogo="1"`,无需税号。
28
+ - 企业专票或需要企业抬头时:必须由用户或附件提供购方名称、税号;地址、电话、开户行和账号有明确来源时才填入,没有来源不要编造。
29
+ - 从附件提取购方信息前,必须先提醒用户文件内容可能进入当前大模型上下文,并可能发送到解析服务,等待明确确认后再处理。
30
+
23
31
  CLI 会固定销方名称 `上海泛微网络科技股份有限公司`、销方税号 `9131000070322836XD`,并补齐 `billingType="0"`、`sourceType="4"`、`asyncCallFlag="1"`、`invoiceMethod="5"`、`taxSign="1"`。Agent 不要把 Cookie、ETEAMSID、业务 Token 或认证字段放入 payload。
24
32
 
25
33
  ## 命令