weaver-work-cli 0.1.8 → 0.1.20

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 (263) hide show
  1. package/README.md +11 -11
  2. package/dist/cmd/action.js +76 -0
  3. package/dist/cmd/index.js +2 -0
  4. package/dist/cmd/refs/index.js +103 -0
  5. package/dist/cmd/register.js +31 -0
  6. package/dist/cmd/root.js +1 -0
  7. package/dist/cmd/setup/index.js +25 -5
  8. package/dist/cmd/skills/index.js +37 -5
  9. package/dist/core/connector.js +54 -0
  10. package/dist/core/context.js +2 -1
  11. package/dist/core/input.js +48 -0
  12. package/dist/core/output.js +298 -3
  13. package/dist/core/refs.js +432 -0
  14. package/dist/core/state.js +26 -0
  15. package/dist/internal/e10/auth/commands.js +2 -2
  16. package/dist/internal/e10/auth/session.js +14 -0
  17. package/dist/internal/e10/auth/xiaoe.js +116 -51
  18. package/dist/internal/e10/request-runtime.js +5 -0
  19. package/dist/internal/skills/install.js +148 -28
  20. package/dist/internal/skills/reader.js +12 -9
  21. package/dist/shortcuts/blog/continuation.js +74 -0
  22. package/dist/shortcuts/blog/errors.js +60 -0
  23. package/dist/shortcuts/blog/host.js +175 -0
  24. package/dist/shortcuts/blog/index.js +324 -0
  25. package/dist/shortcuts/blog/manifest.js +415 -0
  26. package/dist/shortcuts/blog/operations/comment.js +125 -0
  27. package/dist/shortcuts/blog/operations/comments.js +31 -0
  28. package/dist/shortcuts/blog/operations/edit.js +131 -0
  29. package/dist/shortcuts/blog/operations/export.js +46 -0
  30. package/dist/shortcuts/blog/operations/like.js +80 -0
  31. package/dist/shortcuts/blog/operations/publish.js +157 -0
  32. package/dist/shortcuts/blog/operations/query-user.js +58 -0
  33. package/dist/shortcuts/blog/operations/query.js +96 -0
  34. package/dist/shortcuts/blog/operations/registry.js +54 -0
  35. package/dist/shortcuts/blog/operations/remind.js +176 -0
  36. package/dist/shortcuts/blog/operations/shared.js +330 -0
  37. package/dist/shortcuts/blog/operations/types.js +16 -0
  38. package/dist/shortcuts/blog/operations.js +9 -0
  39. package/dist/shortcuts/caizhilian/continuation.js +70 -0
  40. package/dist/shortcuts/caizhilian/errors.js +53 -0
  41. package/dist/shortcuts/caizhilian/host.js +190 -0
  42. package/dist/shortcuts/caizhilian/index.js +186 -0
  43. package/dist/shortcuts/caizhilian/manifest.js +42 -0
  44. package/dist/shortcuts/caizhilian/operations/api.js +801 -0
  45. package/dist/shortcuts/caizhilian/operations/confirm.js +75 -0
  46. package/dist/shortcuts/caizhilian/operations/files.js +306 -0
  47. package/dist/shortcuts/caizhilian/operations/form.js +170 -0
  48. package/dist/shortcuts/caizhilian/operations/handlers/collab.js +611 -0
  49. package/dist/shortcuts/caizhilian/operations/handlers/document.js +890 -0
  50. package/dist/shortcuts/caizhilian/operations/handlers/file-collection.js +346 -0
  51. package/dist/shortcuts/caizhilian/operations/handlers/file-upload.js +192 -0
  52. package/dist/shortcuts/caizhilian/operations/handlers/fileops.js +570 -0
  53. package/dist/shortcuts/caizhilian/operations/handlers/folder.js +969 -0
  54. package/dist/shortcuts/caizhilian/operations/handlers/search.js +318 -0
  55. package/dist/shortcuts/caizhilian/operations/handlers/setting-attach.js +294 -0
  56. package/dist/shortcuts/caizhilian/operations/handlers/setting-backup.js +423 -0
  57. package/dist/shortcuts/caizhilian/operations/handlers/setting-encrypt.js +238 -0
  58. package/dist/shortcuts/caizhilian/operations/handlers/setting-storage.js +364 -0
  59. package/dist/shortcuts/caizhilian/operations/handlers/system.js +106 -0
  60. package/dist/shortcuts/caizhilian/operations/registry.js +151 -0
  61. package/dist/shortcuts/caizhilian/operations/shared.js +408 -0
  62. package/dist/shortcuts/caizhilian/operations/specs.js +623 -0
  63. package/dist/shortcuts/caizhilian/operations/types.js +57 -0
  64. package/dist/shortcuts/caizhilian/operations.js +21 -0
  65. package/dist/shortcuts/contract/continuation.js +70 -0
  66. package/dist/shortcuts/contract/errors.js +62 -0
  67. package/dist/shortcuts/contract/host.js +205 -0
  68. package/dist/shortcuts/contract/index.js +318 -0
  69. package/dist/shortcuts/contract/manifest.js +596 -0
  70. package/dist/shortcuts/contract/operations/clause-reference.js +78 -0
  71. package/dist/shortcuts/contract/operations/form-info.js +371 -0
  72. package/dist/shortcuts/contract/operations/read.js +118 -0
  73. package/dist/shortcuts/contract/operations/registry.js +43 -0
  74. package/dist/shortcuts/contract/operations/request.js +300 -0
  75. package/dist/shortcuts/contract/operations/shared.js +133 -0
  76. package/dist/shortcuts/contract/operations/subject.js +157 -0
  77. package/dist/shortcuts/contract/operations/template.js +81 -0
  78. package/dist/shortcuts/contract/operations/types.js +7 -0
  79. package/dist/shortcuts/contract/operations/workflow.js +52 -0
  80. package/dist/shortcuts/contract/operations/write.js +131 -0
  81. package/dist/shortcuts/contract/operations.js +8 -0
  82. package/dist/shortcuts/hrm/index.js +83 -2
  83. package/dist/shortcuts/hrm/operations/employee.js +160 -30
  84. package/dist/shortcuts/hrm/operations/org.js +17 -3
  85. package/dist/shortcuts/hrm/operations/position.js +18 -2
  86. package/dist/shortcuts/index.js +5 -1
  87. package/dist/shortcuts/invoice/index.js +74 -36
  88. package/dist/shortcuts/invoice/manifest.js +674 -4
  89. package/dist/shortcuts/invoice/markdown.js +172 -0
  90. package/dist/shortcuts/invoice/operations/add.js +3 -3
  91. package/dist/shortcuts/invoice/operations/delete.js +2 -2
  92. package/dist/shortcuts/invoice/operations/get.js +10 -2
  93. package/dist/shortcuts/invoice/operations/import.js +2 -2
  94. package/dist/shortcuts/invoice/operations/registry.js +8 -1
  95. package/dist/shortcuts/invoice/operations/reim-auto.js +719 -0
  96. package/dist/shortcuts/invoice/operations/reim.js +85 -2
  97. package/dist/shortcuts/invoice/operations/shared.js +75 -8
  98. package/dist/shortcuts/invoice/operations/update.js +2 -2
  99. package/dist/shortcuts/invoice/operations/upload-and-validate.js +93 -0
  100. package/dist/shortcuts/invoice/operations/validate-preview.js +2 -1
  101. package/dist/shortcuts/invoice/projection.js +328 -0
  102. package/dist/shortcuts/meeting/host.js +18 -1
  103. package/dist/shortcuts/meeting/manifest.js +30 -18
  104. package/dist/shortcuts/meeting/operations/eb/catalog.js +390 -0
  105. package/dist/shortcuts/meeting/operations/eb/conflict.js +389 -0
  106. package/dist/shortcuts/meeting/operations/eb/factory.js +389 -0
  107. package/dist/shortcuts/meeting/operations/eb/index.js +22 -0
  108. package/dist/shortcuts/meeting/operations/env.js +8 -1
  109. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  110. package/dist/shortcuts/meeting/operations/signs.js +216 -2
  111. package/dist/shortcuts/workflow/endpoints.js +2 -1
  112. package/dist/shortcuts/workflow/errors.js +8 -2
  113. package/dist/shortcuts/workflow/host.js +6 -3
  114. package/dist/shortcuts/workflow/operations/form.js +931 -589
  115. package/dist/shortcuts/workflow/operations/read.js +128 -205
  116. package/dist/shortcuts/workflow/operations/shared.js +21 -0
  117. package/dist/shortcuts/workflow/operations/write.js +750 -52
  118. package/dist/shortcuts/workflow/operations.js +36 -10
  119. package/docs/_catalog.md +6 -0
  120. package/docs/agent-invoice.md +5 -1
  121. package/docs/agent-io-channel-design.md +468 -0
  122. package/docs/agent-skill-install.md +9 -4
  123. package/docs/blog.md +123 -0
  124. package/docs/caizhilian.md +304 -0
  125. package/docs/contract.md +91 -0
  126. package/docs/e10-auth.md +2 -2
  127. package/docs/hrm.md +19 -9
  128. package/docs/invoice.md +5 -1
  129. package/docs/meeting.md +1 -1
  130. package/docs/operation-manual.md +15 -3
  131. package/docs/skill-review-2026-09-19.md +2 -2
  132. package/package.json +2 -2
  133. package/scripts/package-skill.mjs +32 -20
  134. package/skill-template/business-info.json +113 -14
  135. package/skill-template/domains/blog.md +24 -0
  136. package/skill-template/domains/caizhilian.md +22 -0
  137. package/skill-template/domains/jinchengda.md +23 -0
  138. package/skill-template/domains/meeting.md +1 -1
  139. package/skill-template/domains/workflow.md +1 -1
  140. package/skill-template/skill-template.md +1 -1
  141. package/skills/weaver-e10-blog/SKILL.md +111 -0
  142. package/skills/weaver-e10-blog/references/blog-comment.md +51 -0
  143. package/skills/weaver-e10-blog/references/blog-comments.md +39 -0
  144. package/skills/weaver-e10-blog/references/blog-default-permission.md +38 -0
  145. package/skills/weaver-e10-blog/references/blog-disabled-capabilities.md +11 -0
  146. package/skills/weaver-e10-blog/references/blog-edit.md +51 -0
  147. package/skills/weaver-e10-blog/references/blog-export.md +42 -0
  148. package/skills/weaver-e10-blog/references/blog-like.md +50 -0
  149. package/skills/weaver-e10-blog/references/blog-publish.md +52 -0
  150. package/skills/weaver-e10-blog/references/blog-query-user.md +45 -0
  151. package/skills/weaver-e10-blog/references/blog-query.md +49 -0
  152. package/skills/weaver-e10-blog/references/blog-remind.md +51 -0
  153. package/skills/weaver-e10-blog/references/blog-resolve-users.md +38 -0
  154. package/skills/weaver-e10-blog/references/source-manifest.json +1540 -0
  155. package/skills/weaver-e10-caizhilian/SKILL.md +216 -0
  156. package/skills/weaver-e10-caizhilian/references/agent-entry.md +106 -0
  157. package/skills/weaver-e10-caizhilian/references/collaboration.md +112 -0
  158. package/skills/weaver-e10-caizhilian/references/document.md +111 -0
  159. package/skills/weaver-e10-caizhilian/references/file-collection.md +136 -0
  160. package/skills/weaver-e10-caizhilian/references/file-upload.md +309 -0
  161. package/skills/weaver-e10-caizhilian/references/files.md +120 -0
  162. package/skills/weaver-e10-caizhilian/references/folder.md +118 -0
  163. package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
  164. package/skills/weaver-e10-caizhilian/references/setting-attach.md +410 -0
  165. package/skills/weaver-e10-caizhilian/references/setting-backup.md +372 -0
  166. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +399 -0
  167. package/skills/weaver-e10-caizhilian/references/setting-storage.md +603 -0
  168. package/skills/weaver-e10-caizhilian/references/source-manifest.json +5079 -0
  169. package/skills/weaver-e10-caizhilian/references/withheld.md +93 -0
  170. package/skills/weaver-e10-caizhilian/references/write-protocol.md +120 -0
  171. package/skills/weaver-e10-calendar/SKILL.md +4 -3
  172. package/skills/weaver-e10-ebuilder-form/SKILL.md +4 -9
  173. package/skills/weaver-e10-ebuilder-form/references/context-routing.md +0 -9
  174. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -5
  175. package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +1 -5
  176. package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +1 -5
  177. package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +1 -5
  178. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -5
  179. package/skills/weaver-e10-esb/SKILL.md +2 -2
  180. package/skills/weaver-e10-esb/references/source-manifest.json +9 -9
  181. package/skills/weaver-e10-hrm/SKILL.md +54 -6
  182. package/skills/weaver-e10-hrm/references/employee.md +89 -15
  183. package/skills/weaver-e10-hrm/references/org.md +7 -4
  184. package/skills/weaver-e10-hrm/references/position.md +14 -7
  185. package/skills/weaver-e10-hrm/references/source-manifest.json +1 -1
  186. package/skills/weaver-e10-jinchengda/SKILL.md +166 -0
  187. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +82 -0
  188. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +69 -0
  189. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +78 -0
  190. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +27 -0
  191. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +71 -0
  192. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +94 -0
  193. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +89 -0
  194. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +77 -0
  195. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +66 -0
  196. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +94 -0
  197. package/skills/weaver-e10-jinchengda/references/source-manifest.json +259 -0
  198. package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -11
  199. package/skills/weaver-e10-jucailin/SKILL.md +4 -3
  200. package/skills/weaver-e10-mail/SKILL.md +4 -11
  201. package/skills/weaver-e10-meeting/SKILL.md +66 -32
  202. package/skills/weaver-e10-meeting/references/meeting-change.md +5 -2
  203. package/skills/weaver-e10-meeting/references/meeting-create.md +2 -1
  204. package/skills/weaver-e10-meeting/references/meeting-eb.md +114 -0
  205. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +9 -8
  206. package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +35 -7
  207. package/skills/weaver-e10-meeting/references/meeting-update.md +1 -1
  208. package/skills/weaver-e10-okr/SKILL.md +6 -11
  209. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  210. package/skills/weaver-e10-plan/SKILL.md +3 -3
  211. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +1 -1
  212. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +1 -1
  213. package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
  214. package/skills/weaver-e10-qiyecheng/SKILL.md +4 -10
  215. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
  216. package/skills/weaver-e10-shared/SKILL.md +36 -25
  217. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -31
  218. package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
  219. package/skills/weaver-e10-shijingran/SKILL.md +2 -1
  220. package/skills/weaver-e10-shijingran/references/source-manifest.json +9 -9
  221. package/skills/weaver-e10-skill-maker/SKILL.md +4 -10
  222. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +5 -3
  223. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +12 -27
  224. package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +17 -5
  225. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +4 -27
  226. package/skills/weaver-e10-wenshuding/SKILL.md +5 -16
  227. package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
  228. package/skills/weaver-e10-workflow/SKILL.md +32 -37
  229. package/skills/weaver-e10-workflow/references/source-manifest.json +39 -75
  230. package/skills/weaver-e10-workflow/references/workflow-batch.md +90 -29
  231. package/skills/weaver-e10-workflow/references/workflow-create.md +79 -109
  232. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -9
  233. package/skills/weaver-e10-workflow/references/workflow-operate.md +2 -2
  234. package/skills/weaver-e10-workflow/references/workflow-query.md +38 -20
  235. package/skills/weaver-e10-workflow/references/workflow-share.md +18 -2
  236. package/skills/weaver-e10-workflow/references/workflow-view.md +3 -4
  237. package/skills/weaver-e10-yepiaotong/SKILL.md +75 -39
  238. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +22 -1
  239. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +3 -1
  240. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +135 -0
  241. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +15 -3
  242. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  243. package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +217 -0
  244. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +88 -0
  245. package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +7 -2
  246. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +89 -9
  247. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -0
  248. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +70 -49
  249. package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +119 -0
  250. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +55 -36
  251. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +4 -0
  252. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +149 -0
  253. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +125 -5
  254. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +430 -63
  255. package/skills/weaver-e10-yimiaoban/SKILL.md +4 -12
  256. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  257. package/skills/weaver-e10-ziguanjia/SKILL.md +2 -1
  258. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +3 -3
  259. package/tools/weaver-skill-detector-1.0.13/SKILL.md +9 -9
  260. package/tools/weaver-skill-detector-1.0.13/references/checklist.md +3 -3
  261. package/tools/weaver-skill-detector-1.0.13/scripts/__pycache__/validate_skill.cpython-313.pyc +0 -0
  262. package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +98 -91
  263. package/scripts/sync-connector-skills.mjs +0 -172
@@ -29,6 +29,26 @@
29
29
 
30
30
  ---
31
31
 
32
+ ## 报销共享常量(所有 reference 统一引用本节)
33
+
34
+ 以下常量在报销 reference 中多处出现,**统一以本节为准**,其余文件引用本节不再重复定义。
35
+
36
+ | 常量 | 值 | 说明 |
37
+ |------|-----|------|
38
+ | 默认合同编号 | `"20260999"` | 快速路径 `template.build`/`auto-prepare` 与手工路径统一使用;CLI 0.1.19 起未传入时自动填充并产生 warning |
39
+ | 非出差相关客户 | `"100504500000311504"` | 泛微上海;出差流程必须由用户提供具体客户 |
40
+ | 兜底费用科目 | `"100502270000000104"` | 其他-管理费用;所有匹配策略均未命中时使用 |
41
+ | 人民币币种 ID | `"100001050000000001"` | — |
42
+ | 报销方式默认值 | optionValue `"7"` | 银行(个人报销) |
43
+ | 全额红冲状态值 | `status = 8` | `comm_info.pro.status`;此类发票必须过滤,不允许报销 |
44
+ | 相关凭证 typeCode | 17, 18, 57, 58 | 不能独立成行,必须与发票配对 |
45
+ | directSuperior 取值 | `directSuperior.id` | ⚠️ **不是 `allSuperiors[0]`**(后者是上级链最高层) |
46
+ | continuation 有效期 | 600 秒 | 过期后重新 prepare 即可,无需重新征询用户确认 |
47
+
48
+ > **continuation 过期处理**:`prepare`/`auto-prepare` 签发的 continuation 有 600 秒有效期。中间若用户核对耗时过长导致过期(返回 `validation/continuation_expired`),**重新 `prepare` 后立即 `apply` 即可**(用户已确认过的内容无需重新征询)。不要重放旧 continuation。
49
+
50
+ ---
51
+
32
52
  ## 时间戳内联计算(零工具调用)
33
53
 
34
54
  > **所有日期 → 秒级时间戳的转换由 AI 直接计算,无需调用外部脚本。**
@@ -245,7 +265,10 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
245
265
  | `date_begin` / `date_end` | 开票日期范围 | 默认使用 |
246
266
  | `create_tm_begin` / `create_tm_end` | 录入/创建日期范围 | 用户明确说"录入日期"/"创建日期"时 |
247
267
 
248
- **⚠️ 数据过滤:** `info.comm_info.pro.status == 8` 的发票为**全额红冲发票**,**必须过滤掉,不允许报销**
268
+ **⚠️ 数据过滤(红冲票排除):**
269
+ - **快速路径**:`candidates.list` **自动过滤** `status=8` 的全额红冲发票(过滤张数在 `summary.filteredRedReversedCount` 中报告),无需手动处理。
270
+ - **手动路径**:使用 `invoice.list` 获取发票后,**必须在进入任何后续流程前先过滤掉 `info.comm_info.pro.status == 8` 的发票**。过滤后向用户报告:"已自动排除 N 张全额红冲发票"。
271
+ - 全额红冲发票不允许报销,**两条路径都不能让红冲票进入匹配/组装环节**。
249
272
 
250
273
  关键返回字段映射见 [reim-api-reference.md](reim-api-reference.md#1-获取发票数据)。
251
274
 
@@ -294,6 +317,7 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
294
317
  | 场景 | 筛选方式 |
295
318
  |------|----------|
296
319
  | 先有发票 → 筛选事前申请 | `cusCreateDateEnd` = 最晚 invoiceDate,`cusCreateDateStart` = 最早 invoiceDate - 90天 |
320
+ | 先有发票 → **话费报销** | `cusCreateDateEnd` = 最晚 invoiceDate,`cusCreateDateStart` = 最早 invoiceDate - **1095天(3年)**,且加 `requestname="话费"` 缩小范围(见 [reim-phone-subsidy-rules.md](reim-phone-subsidy-rules.md)) |
297
321
  | 先有事前申请 → 筛选发票 | `date_begin` = 最早 createTime 秒时间戳 |
298
322
  | 并行获取 | 不做预筛选,Step 2 匹配时统一过滤 |
299
323
 
@@ -317,6 +341,27 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
317
341
  ]
318
342
  ```
319
343
 
344
+ ### Step 2 匹配结果展示(推荐)
345
+
346
+ 匹配完成后,**建议向用户展示匹配结果**,而不是静默进入下一步。展示格式:
347
+
348
+ ```markdown
349
+ 发票与事前申请匹配结果:
350
+
351
+ | # | 发票号码 | 金额 | 匹配到的事前申请 | 置信度 | 匹配原因 |
352
+ |---|----------|------|------------------|--------|----------|
353
+ | 1 | 36901189 | ¥108.20 | 交通费报销-后端开发111-2026-07-25 | ✅ 高 | 费用类型匹配、时间匹配 |
354
+ | 2 | 36901201 | ¥380.00 | (未匹配) | — | 无匹配的事前申请 |
355
+
356
+ 确认后将自动进入后续填单流程。如需调整匹配关系,请告诉我。
357
+ ```
358
+
359
+ - 匹配到 high 置信度的直接标记 ✅ 高
360
+ - medium 置信度标记 ⚠️ 中(建议核实)
361
+ - 未匹配的标记 —,说明将跳过事前申请关联
362
+ - **只有全部都是 high 且用户已在 Step 1C 确认过 → 可以静默跳过本展示直接继续**
363
+ - medium 或 low 出现时**必须展示并等用户确认**
364
+
320
365
  ---
321
366
 
322
367
  ## Step 2.5: 获取报销单工作流ID
@@ -335,8 +380,9 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
335
380
  ### 发票 → 工作流匹配规则(按优先级)
336
381
 
337
382
  1. **事前申请绑定**:发票已匹配到事前申请 → 使用该事前申请对应的 workFlowId
338
- 2. **发票费用类型匹配**:用 `expenseType` 与候选 `workFlowName` 做关键词匹配
339
- 3. **通用兜底**:归入 workFlowName 含"日常"/"通用"/"报销"的;仍无法区分归入第一个
383
+ 2. **话费专项**:通讯/话费类发票优先匹配 `workFlowName` 含「话费补贴标准审批流程」或「话费报销」的工作流,命中后必须按 [reim-phone-subsidy-rules.md](reim-phone-subsidy-rules.md) 核算
384
+ 3. **发票费用类型匹配**:用 `expenseType` 与候选 `workFlowName` 做关键词匹配
385
+ 4. **通用兜底**:归入 workFlowName 含"日常"/"通用"/"报销"的;仍无法区分归入第一个
340
386
 
341
387
  每组独立执行 Step 3 → 3.5 → 3.6 → 4 → 5,不能省略任何字段。
342
388
 
@@ -378,7 +424,7 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
378
424
 
379
425
  > **可缓存**:同一会话只需调用一次。
380
426
 
381
- - `allSuperiors[0].id` → "报销人上级" + "承担人直接上级"(⚠️ 必填)
427
+ - `directSuperior.id` → "报销人上级" + "承担人直接上级"(⚠️ 必填。**注意不是 `allSuperiors[0]`** —— `allSuperiors[0]` 是上级链最高层,与直接上级不是同一人)
382
428
  - `allSuperiors` 全部 `id` 逗号拼接 → "承担人所有上级"(⚠️ 必填)
383
429
 
384
430
  ---
@@ -389,7 +435,9 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
389
435
  > **费用科目匹配规则见 [reim-expense-subject-rules.md](reim-expense-subject-rules.md)**
390
436
  >
391
437
  > **⚠️ 费用类型(科目)字段必须有值。匹配不到时直接填兜底值 `"100502270000000104"`。**
438
+ > **⚠️ 合同编号固定填 `"20260999"`**(除用户当次明确给出别的合同号):主表 `合同号(100003720000001376)` 不能留空、不能放进 `unable_to_fill`;走快速路径 `template.build`/`auto-prepare` 时同样必须显式传 `contractNo`,否则该字段静默缺失。口径见 [reim-form-fill-rules.md](reim-form-fill-rules.md) 主表字段映射。
392
439
  > **⚠️ 出差流程相关客户规则见 Step 4.5。**
440
+ > **⚠️ 话费补贴 / 话费报销必须遵守 [reim-phone-subsidy-rules.md](reim-phone-subsidy-rules.md),见 Step 4.6。**
393
441
 
394
442
  核心结构概览:
395
443
 
@@ -408,7 +456,7 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
408
456
  **关键约束:**
409
457
  - **发票 vs 相关凭证分类**:`invoiceTypeCode` 为 17/18/57/58 的是相关凭证,不能独立成行,必须与对应发票配对放在同一行明细中
410
458
  - 每行 `fields` 中有两个 `EinvoiceComponent` 字段:`single=false` 填**发票** `invoiceId`,`single=true` 填**配对凭证** `invoiceId`
411
- - `dataIndex` 从 1 递增,`subFormId` 只用 `subTables[0]` 的
459
+ - `dataIndex` 从 1 递增,`subFormId` 用「费用明细」表的(按名称定位明细表,**不要机械取 `subTables[0]`** —— 总部费用报销的 `subTables[0]` 是「外包订单」,「费用明细」`100003690000000011` 排第 3)
412
460
 
413
461
  ---
414
462
 
@@ -425,12 +473,82 @@ Step 6 (可选): invoice.reim.flow.update.prepare/apply → 用户修正
425
473
 
426
474
  ---
427
475
 
476
+ ## Step 4.6: 话费补贴 / 话费报销必须按月度标准核算
477
+
478
+ > **命中「话费补贴标准审批流程」或「话费报销」时,未齐备账单材料和岗位标准前,禁止进入 Step 5。**
479
+ > 完整规则见 [reim-phone-subsidy-rules.md](reim-phone-subsidy-rules.md)。
480
+
481
+ 简要规则:
482
+ - `workFlowName` 或事前申请名称含「话费补贴标准审批流程」「话费报销」,或用户明确说话费报销 → 先暂停
483
+ - 必须提供本人实名制当月手机账单截图及账单构成
484
+ - 必须确认岗位对应月度上限(350 / 200 / 100),禁止猜测岗位
485
+ - 剔除手机设备赠送套餐、家庭宽带套餐后,实报金额 = `min(可报销账单金额, 上限)`
486
+ - 低于标准按实际支付,超过上限按上限支付
487
+ - 材料不齐 / 岗位未确认 / 用户拒绝 → **结束报销,禁止调用 `invoice.reim.flow.create.prepare`**
488
+
489
+ ---
490
+
491
+ ## Step 4.7: 预览展示规则 —— 字典类 ID 必须带中文名
492
+
493
+ > **向用户展示单据预览、汇总、确认清单时,凡是字典/选择类 ID 值,一律渲染成 `中文名(ID)`,禁止只给裸 ID。**
494
+ > 用户要靠中文名核对金额、科目、上级和客户;裸 ID 无法复核,属于无效展示。
495
+
496
+ ### 优先:直接用 CLI 已渲染好的展示字段(快速路径 / `auto-prepare` / `template.build`)
497
+
498
+ `invoice.reim.template.build` 与 `invoice.reim.flow.create.auto-prepare` 的返回已包含渲染完成的展示数据。**返回里有 `preview.mainFields` / `labels` 就直接用,不要再自己调 `field.search` / `row-info` 查名。**
499
+
500
+ | 返回字段 | 内容 | 怎么用 |
501
+ | --- | --- | --- |
502
+ | `preview.mainFields[]` | `{ fieldId, fieldName, value \| optionValue, text }` | **主表预览直接读 `text`**。人员/客户渲染成 `温明刚(6490972696771260615)`;选择类渲染成 `银行(个人报销)(optionValue=7)`;逗号列表(承担人所有上级)逐项带名 |
503
+ | `preview.detailRows[]` | `{ dataIndex, invoiceId, invoiceNumber, amount, expenseNote, subject, currency }` | **明细表预览直接读 `subject` / `currency`**,已带中文名 |
504
+ | `labels` | `employees` / `subjects` / `currencies` / `customers` / `selectOptions` / `customer` / `detailSubForm` / `workflow` | 需要自己拼其它展示时取字典 |
505
+ | `labels.unresolved`、`preview.unresolvedLabels` | 未取到中文名的 ID 清单 | 非空时按下方兜底口径如实展示,并放进 `need_user_confirm` 提醒用户核对 |
506
+
507
+ 相关客户只给名称也能用:传 `relatedCustomerName`(不传 ID 时 CLI 会自动反查 ID;ID 与名称同时传则不额外请求,只用于渲染)。
508
+
509
+ ### 兜底:返回里没有上述字段时(旧版 CLI、或手工组装路径)按来源表自查
510
+
511
+ | 展示项 | 中文名来源 | 兜底 |
512
+ | --- | --- | --- |
513
+ | 费用类型(科目) | `invoice.reim.row-info` 的 `subjectName`(与 `subjectId` 同源,**同一行数据直接取**) | 用 `reim-expense-subject-rules.md` 查找表反查;仍无则保留 `未知科目(ID)` |
514
+ | 币种 | `invoice.reim.row-info` 的 `bz[].name` | `人民币(100001050000000001)` |
515
+ | 申请人 / 提单人员 / 承担主体 | `invoice.reim.employee-superiors` 的 `currentEmployee.name` | — |
516
+ | 报销人上级 / 承担人直接上级 | 同命令 `directSuperior.name` | — |
517
+ | 承担人所有上级 | 同命令 `allSuperiors[].name`,按原顺序逗号拼接,**每个都带 ID** | — |
518
+ | 报销方式等 Select 字段 | `invoice.reim.form.structure` 主表该字段 `options` 里 `optionValue` → `optionName` | 保留 `optionValue=7` |
519
+ | 相关客户 | `invoice.reim.field.search` 返回项的 `name` | 见下方警告 |
520
+
521
+ ⚠️ **相关客户无法用 ID 反查**(实测):`invoice.reim.field.search` 把待查的那个 ID 当 `keywords` 传,一律返回 `[]`(例如 `keywords="100504500000311504"` → 空)。必须改用**关键词模糊搜索**再按 `id` 匹配:
522
+
523
+ ```text
524
+ keywords="泛微" → 命中 {"name":"泛微上海","id":"100504500000311504"}
525
+ ```
526
+
527
+ 关键词取不准时按 2-3 个候选词依次试(公司字号、简称);仍查不到就显示 `未知来源(100504500000311504)` 并放进 `need_user_confirm` 让用户核对,**禁止编造名称**。
528
+
529
+ 展示格式示例:
530
+
531
+ ```markdown
532
+ | 项目 | 值 |
533
+ | --- | --- |
534
+ | 相关客户 | 泛微上海(100504500000311504) |
535
+ | 报销人上级 / 承担人直接上级 | 温明刚(6490972696771260615) |
536
+ | 承担人所有上级 | 熊学武(8005823778783571762), 章宏武(4270809363797382452), 周军锋(9080972482706531342), 温明刚(6490972696771260615), 韦利东(8005823776035471761) |
537
+ | 报销方式 | 银行(个人报销)(optionValue=7) |
538
+ | 费用科目(每行) | 日常消费(1256664958132969489) |
539
+ ```
540
+
541
+ 纯数值/文本字段(金额、日期、张数、费用说明)保持原样,不加 ID。
542
+
543
+ ---
544
+
428
545
  ## Step 5: 生成报销单流程
429
546
 
430
547
  通过 `invoice.reim.flow.create.prepare` → 用户确认 → `invoice.reim.flow.create.apply` 完成。
431
548
 
432
549
  > **⚠️ 禁止重复调用:同一组发票数据只能调用一次。调用成功后,修改已创建的报销单使用 Step 6 的 update。**
433
550
  > **⚠️ 出差流程拦截:相关客户未由用户提供具体信息前,禁止调用。**
551
+ > **⚠️ 话费报销拦截:账单截图、账单构成或岗位标准未确认前,禁止调用。**
434
552
 
435
553
  ### 创建成功后
436
554
 
@@ -470,6 +588,7 @@ CLI 返回 `requestId` 和 `viewUrl`,**用结构化汇总信息展示给用户
470
588
  **需暂停询问用户的情况:**
471
589
  - 发票列表为空 → 提示"未找到未报销的发票",结束
472
590
  - 出差/差旅流程缺少相关客户 → 见 Step 4.5
591
+ - 话费报销缺少账单截图、账单构成或岗位标准 → 见 Step 4.6
473
592
  - 模糊搜索返回多结果 → 放入 `need_user_confirm` 让用户选择
474
593
 
475
594
  **严禁重复调用:**
@@ -491,4 +610,5 @@ CLI 返回 `requestId` 和 `viewUrl`,**用结构化汇总信息展示给用户
491
610
  - [reim-matching-rules.md](reim-matching-rules.md) - 发票与事前申请匹配逻辑
492
611
  - [reim-form-fill-rules.md](reim-form-fill-rules.md) - 表单字段填充策略与填单 JSON 组装规则
493
612
  - [reim-expense-subject-rules.md](reim-expense-subject-rules.md) - 费用科目自动匹配规则(JSON 查找表)
613
+ - [reim-phone-subsidy-rules.md](reim-phone-subsidy-rules.md) - 话费补贴 / 话费报销月度标准与实报金额
494
614
  - [reim-examples.md](reim-examples.md) - 完整端到端示例