weaver-work-cli 0.1.57 → 0.1.59

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 (86) hide show
  1. package/dist/chunks/{attachment-content-QGM5MLQE.js → attachment-content-TP6WDNC6.js} +3 -3
  2. package/dist/chunks/{caizhilian-QJ4FLSQJ.js → caizhilian-5NM4X5HG.js} +1 -1
  3. package/dist/chunks/{chunk-7EBV7Q3R.js → chunk-2FHP4PYS.js} +50 -27
  4. package/dist/chunks/{chunk-DVR2EDUU.js → chunk-6YWHRXEQ.js} +17 -1
  5. package/dist/chunks/{chunk-FDAJC7R4.js → chunk-AQOPPNTR.js} +2 -2
  6. package/dist/chunks/{chunk-6DVL5IN5.js → chunk-CI2RF3AJ.js} +7 -4
  7. package/dist/chunks/{chunk-WHJIUKJW.js → chunk-FM7B5BIR.js} +206 -39
  8. package/dist/chunks/{chunk-L2LMBFG5.js → chunk-I3BFBBP2.js} +1 -1
  9. package/dist/chunks/{chunk-6MS3RLPO.js → chunk-MQBMMJUV.js} +2 -2
  10. package/dist/chunks/{chunk-XU3FL3AW.js → chunk-QNPIY5R6.js} +4 -4
  11. package/dist/chunks/{chunk-AHJZIMCX.js → chunk-U2DWV6JC.js} +1 -1
  12. package/dist/chunks/{chunk-WMB3SMXI.js → chunk-WINR2Q6K.js} +27 -4
  13. package/dist/chunks/{chunk-UI66EMOR.js → chunk-XR5BGFNT.js} +4 -4
  14. package/dist/chunks/{chunk-TJUAGZU7.js → chunk-ZHPCNM2S.js} +6 -6
  15. package/dist/chunks/{conflict-VAFFPUY3.js → conflict-Y3ESXYIA.js} +2 -2
  16. package/dist/chunks/{create-flow-TVYE3IOH.js → create-flow-JHQSA6JF.js} +6 -6
  17. package/dist/chunks/{data-WVICO3DT.js → data-ZVS3BWPT.js} +3 -5
  18. package/dist/chunks/{env-BVVFIN4P.js → env-LQBLL3MZ.js} +2 -2
  19. package/dist/chunks/{factory-RCQ36LLE.js → factory-X7PN6B3B.js} +1 -1
  20. package/dist/chunks/{group-chat-YFZDUUY3.js → group-chat-PPFY7SPV.js} +3 -3
  21. package/dist/chunks/{invoice-7JGSEWT5.js → invoice-6XDMPCWB.js} +59 -8
  22. package/dist/chunks/{lazy-dispatch-JHGFCKJN.js → lazy-dispatch-GCA6HDOB.js} +1 -1
  23. package/dist/chunks/{meeting-JOHV4RH3.js → meeting-GMRQZFJP.js} +16 -12
  24. package/dist/chunks/{minute-doc-JLS4KMFZ.js → minute-doc-JXH3MNC7.js} +5 -5
  25. package/dist/chunks/{operations-ZPWBMYKE.js → operations-6NXJ7RTE.js} +1 -1
  26. package/dist/chunks/{registry-LITYOH2W.js → registry-WZCCBI5L.js} +10 -10
  27. package/dist/chunks/{room-recommend-62MECG4J.js → room-recommend-CKU5NF2E.js} +4 -4
  28. package/dist/chunks/{schedule-6QRXIBGU.js → schedule-DEFAO2RY.js} +4 -4
  29. package/dist/index.js +6 -6
  30. package/dist/internal/e10/auth/commands.js +29 -1
  31. package/dist/shortcuts/caizhilian/operations/files.js +4 -1
  32. package/dist/shortcuts/caizhilian/operations/handlers/document.js +33 -4
  33. package/dist/shortcuts/data/index.js +0 -1
  34. package/dist/shortcuts/data/manifest.js +1 -1
  35. package/dist/shortcuts/data/operations/module.js +2 -3
  36. package/dist/shortcuts/invoice/manifest.js +6 -4
  37. package/dist/shortcuts/invoice/operations/reim-subsidy.js +54 -4
  38. package/dist/shortcuts/meeting/host.js +6 -1
  39. package/dist/shortcuts/meeting/minute-doc.js +3 -2
  40. package/dist/shortcuts/meeting/operations/compose-outcome.js +4 -0
  41. package/dist/shortcuts/meeting/operations/eb/create-flow.js +29 -3
  42. package/dist/shortcuts/meeting/operations/eb/crm-search.js +20 -0
  43. package/dist/shortcuts/meeting/operations/eb/decision-task-reassign.js +113 -0
  44. package/dist/shortcuts/meeting/operations/eb/decision.js +41 -1
  45. package/dist/shortcuts/meeting/operations/eb/factory.js +4 -4
  46. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  47. package/dist/shortcuts/meeting/operations/eb-fallback.js +3 -0
  48. package/dist/shortcuts/meeting/operations/registry.js +14 -1
  49. package/dist/shortcuts/meeting/operations/shared.js +4 -0
  50. package/docs/agent-invoice.md +0 -1
  51. package/docs/data.md +1 -1
  52. package/docs/e10-auth.md +5 -0
  53. package/docs/invoice.md +1 -1
  54. package/package.json +1 -1
  55. package/skill-template/domains/yepiaotong.md +2 -0
  56. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  57. package/skills/weaver-e10-caizhilian/references/document.md +1 -1
  58. package/skills/weaver-e10-caizhilian/references/source-manifest.json +2 -2
  59. package/skills/weaver-e10-data/references/config-center.md +0 -1
  60. package/skills/weaver-e10-jucailin/SKILL.md +6 -6
  61. package/skills/weaver-e10-jucailin/references/recruit-read.md +3 -2
  62. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +1 -1
  63. package/skills/weaver-e10-jucailin/references/recruit-write.md +15 -8
  64. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +3 -1
  65. package/skills/weaver-e10-meeting/SKILL.md +14 -4
  66. package/skills/weaver-e10-recruit-stage/SKILL.md +42 -14
  67. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +61 -20
  68. package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +194 -0
  69. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +5 -4
  70. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -5
  71. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +1 -10
  72. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +25 -6
  73. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +3 -2
  74. package/skills/weaver-e10-yepiaotong/SKILL.md +5 -5
  75. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +0 -23
  76. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +1 -1
  77. package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +1 -1
  78. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +2 -2
  79. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +15 -11
  80. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +2 -2
  81. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
  82. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +1 -1
  83. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +80 -35
  84. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +9 -9
  85. package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +0 -217
  86. package/skills/weaver-e10-yepiaotong.zip +0 -0
@@ -1,217 +0,0 @@
1
- #!/usr/bin/env python3
2
- """把 weaver-work-cli 发票查询的完整 JSON envelope 裁成语义摘要。
3
-
4
- 为什么需要它
5
- ------------
6
- `invoice.list` / `invoice.enterprise.list` 的原始输出里,单条发票有 40+ 字段
7
- (`custom_field_*`、`rb`、`oa`、`suser`、`agricultural_*` 等对调用方无用),
8
- 10 条就是 35KB 左右。要拿到"号码 / 金额 / 购销方"就得先解析一遍。
9
-
10
- 优先用 CLI 原生能力
11
- ------------------
12
- CLI 0.1.17 起支持 `--view summary`(语义平表)与 `--fields a,b.c`(点路径投影),
13
- Agent 应当优先用它们,不必写脚本:
14
-
15
- weaver-work-cli --json invoice list --view summary
16
-
17
- 本脚本用于以下兜底场景:
18
- 1. 目标机器上的 CLI 版本低于 0.1.17,没有 `--view summary`
19
- 2. 需要把结果整理成 markdown 表格直接贴给用户
20
- 3. 需要在多份导出文件之间做汇总核对
21
-
22
- 用法
23
- ----
24
- weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10}' > list.json
25
- python invoice-summarize.py list.json
26
- python invoice-summarize.py list.json --format table
27
- weaver-work-cli --json invoice list | python invoice-summarize.py -
28
-
29
- 输入可以是:完整 envelope、`data` 对象、`{items:[...]}`,或 E10 原生 `{infos:[...]}` 响应。
30
-
31
- 字段口径与 CLI `--view summary` 保持一致(见 references/invoice-output-view.md)。
32
- """
33
-
34
- from __future__ import annotations
35
-
36
- import argparse
37
- import json
38
- import sys
39
-
40
- # 与 src/shortcuts/invoice/projection.ts 的 SUMMARY_ITEM_FIELDS 保持同序同义
41
- SUMMARY_FIELDS = [
42
- "fid",
43
- "number",
44
- "code",
45
- "typeName",
46
- "date",
47
- "amount",
48
- "total",
49
- "taxAmount",
50
- "buyer",
51
- "buyerTaxNo",
52
- "payer",
53
- "payerTaxNo",
54
- "valid",
55
- "status",
56
- "reimState",
57
- "reimRequests",
58
- "fileName",
59
- "detailUrl",
60
- ]
61
-
62
- TABLE_COLUMNS = [
63
- ("number", "发票号码"),
64
- ("typeName", "类型"),
65
- ("date", "开票日期"),
66
- ("total", "价税合计"),
67
- ("payer", "销方"),
68
- ("buyer", "购方"),
69
- ("reimRequests", "关联报销单"),
70
- ]
71
-
72
-
73
- def as_dict(value: object) -> dict:
74
- return value if isinstance(value, dict) else {}
75
-
76
-
77
- def as_text(value: object) -> str:
78
- if value is None:
79
- return ""
80
- return str(value).lstrip("\ufeff").strip()
81
-
82
-
83
- def as_int(value: object) -> int | None:
84
- if isinstance(value, bool):
85
- return None
86
- if isinstance(value, int):
87
- return value
88
- return None
89
-
90
-
91
- def summarize_item(item: dict) -> dict:
92
- """把一条原始发票对象裁成语义摘要;空值省键,票面自带的 '0' 保留。"""
93
- comm = as_dict(item.get("comm_info"))
94
- pro = as_dict(comm.get("pro"))
95
- price = as_dict(comm.get("price"))
96
- buyer = as_dict(comm.get("buyer"))
97
- payer = as_dict(comm.get("payer"))
98
- modify = as_dict(item.get("modify_info"))
99
- oreim = as_dict(item.get("oreim"))
100
- reim_list = oreim.get("list_reim") if isinstance(oreim.get("list_reim"), list) else []
101
-
102
- summary = {
103
- "fid": as_text(item.get("fid") or item.get("id")),
104
- "number": as_text(item.get("number")),
105
- "code": as_text(item.get("code")),
106
- "typeName": as_text(pro.get("cname")),
107
- "date": as_text(pro.get("date")),
108
- "amount": as_text(price.get("amount")),
109
- "total": as_text(price.get("total")),
110
- "taxAmount": as_text(price.get("dtax")),
111
- "buyer": as_text(buyer.get("company")),
112
- "buyerTaxNo": as_text(buyer.get("tcode")),
113
- "payer": as_text(payer.get("company")),
114
- "payerTaxNo": as_text(payer.get("tcode")),
115
- "valid": as_int(pro.get("valid")),
116
- "status": as_int(pro.get("status")),
117
- "reimState": as_int(pro.get("sreim")),
118
- "reimRequests": [as_text(as_dict(entry).get("name")) for entry in reim_list if as_text(as_dict(entry).get("name"))],
119
- "fileName": as_text(modify.get("fname")),
120
- "detailUrl": as_text(item.get("detailUrl")),
121
- }
122
- return {key: value for key, value in summary.items() if value not in ("", None, [])}
123
-
124
-
125
- def extract_items(payload: object) -> tuple[list, dict]:
126
- """兼容 envelope / data / items / E10 原生 infos 四种输入形状。"""
127
- root = as_dict(payload)
128
- data = as_dict(root.get("data")) or root
129
- for key in ("items", "infos"):
130
- candidate = data.get(key)
131
- if isinstance(candidate, list):
132
- return candidate, data
133
- if isinstance(payload, list):
134
- return payload, {}
135
- return [], data
136
-
137
-
138
- def summarize_payload(payload: object) -> dict:
139
- items, data = extract_items(payload)
140
- summary = {}
141
- for key in ("total", "totalAmount", "totalAmountExcludingTax", "hasMore", "scope"):
142
- if data.get(key) is not None:
143
- summary[key] = data[key]
144
- summary["items"] = [summarize_item(as_dict(item)) for item in items]
145
- summary["itemCount"] = len(summary["items"])
146
- return summary
147
-
148
-
149
- def render_cell(item: dict, key: str) -> str:
150
- value = item.get(key)
151
- if key == "reimRequests":
152
- names = value if isinstance(value, list) else []
153
- if not names:
154
- return "-"
155
- return names[0] if len(names) == 1 else f"{names[0]} 等 {len(names)} 笔"
156
- return str(value) if value is not None else ""
157
-
158
-
159
- def render_table(summary: dict) -> str:
160
- lines = []
161
- header = "| " + " | ".join(label for _, label in TABLE_COLUMNS) + " |"
162
- divider = "|" + "---|" * len(TABLE_COLUMNS)
163
- lines.append(header)
164
- lines.append(divider)
165
- for item in summary["items"]:
166
- cells = [render_cell(item, key) for key, _ in TABLE_COLUMNS]
167
- lines.append("| " + " | ".join(cells) + " |")
168
-
169
- parts = [f"共 {summary.get('itemCount', 0)} 张"]
170
- if summary.get("total") is not None:
171
- parts.append(f"票夹总数 {summary['total']}")
172
- if summary.get("totalAmount") is not None:
173
- parts.append(f"价税合计 {summary['totalAmount']}")
174
- if summary.get("hasMore"):
175
- parts.append("还有更多(hasMore=true)")
176
- lines.append("")
177
- lines.append(";".join(parts))
178
- lines.append("")
179
- lines.append("注:`reimState`(票面 `comm_info.pro.sreim`)的取值语义未在 CLI 契约中定义,只能原样呈现,不要自行解读成已报销/未报销。")
180
- return "\n".join(lines)
181
-
182
-
183
- def main(argv: list[str]) -> int:
184
- parser = argparse.ArgumentParser(
185
- description="把 weaver-work-cli 发票查询的完整 JSON 输出裁成语义摘要(CLI --view summary 的兜底方案)",
186
- )
187
- parser.add_argument("path", help="JSON 文件路径,或 - 表示从标准输入读取")
188
- parser.add_argument("--format", choices=["json", "table"], default="json", help="json=摘要对象(默认),table=markdown 表格")
189
- parser.add_argument("--indent", type=int, default=1, help="json 格式的缩进,默认 1")
190
- args = parser.parse_args(argv)
191
-
192
- if args.path == "-":
193
- raw = sys.stdin.read()
194
- else:
195
- try:
196
- with open(args.path, encoding="utf-8-sig") as handle:
197
- raw = handle.read()
198
- except OSError as error:
199
- print(f"无法读取 {args.path}:{error}", file=sys.stderr)
200
- return 1
201
-
202
- try:
203
- payload = json.loads(raw.lstrip("\ufeff"))
204
- except json.JSONDecodeError as error:
205
- print(f"{args.path} 不是合法 JSON:{error}", file=sys.stderr)
206
- return 1
207
-
208
- summary = summarize_payload(payload)
209
- if args.format == "table":
210
- print(render_table(summary))
211
- else:
212
- print(json.dumps(summary, ensure_ascii=False, indent=args.indent))
213
- return 0
214
-
215
-
216
- if __name__ == "__main__":
217
- raise SystemExit(main(sys.argv[1:]))
Binary file