tyc-cli 0.3.10 → 0.3.12

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.
package/CHANGELOG.md CHANGED
@@ -87,3 +87,9 @@
87
87
  ## [0.1.0] - 2026-04-25
88
88
 
89
89
  首发版本:CLI 直连 tyc OpenAPI 的初始实现。
90
+
91
+ ## Unreleased — T3
92
+
93
+ - 原欠税工具增加可选 `--isHistory`,默认 0 当前、1 历史;服务端兼容旧调用。
94
+ - 当前/历史计数分开展示,历史引导携带参数;每页最大 20,超过上限明确拒绝。
95
+ - 保留公告金额的零值与缺失值,不将明细合计解释为网站累计金额。
package/README.md CHANGED
@@ -12,11 +12,11 @@
12
12
  ## 📖 项目简介
13
13
 
14
14
  `tyc-cli` 是天眼查 MCP Server 的官方命令行客户端。CLI 通过 shared core HTTP 入口
15
- 调用天眼查 162 个业务语义聚合工具,覆盖企业工商、知产、司法风险、董监高等全维度
15
+ 调用天眼查 165 个业务语义聚合工具,覆盖企业工商、知产、司法风险、董监高等全维度
16
16
  商业数据。
17
17
 
18
18
  当前 MCP Server 的 `tools/list` 默认只公开少量 AI Agent 入口工具
19
- (搜索、公司画像、能力目录、`call_tool` / `call_tools_batch` 等),但 162 个业务语义
19
+ (搜索、公司画像、能力目录、`call_tool` / `call_tools_batch` 等),但 165 个业务语义
20
20
  工具仍注册在服务端并保持 `tools/call` 兼容。CLI 不依赖 `tools/list` 构建命令树,
21
21
  而是使用打包内 `catalog.json` 直达这些业务工具。
22
22
 
@@ -27,7 +27,7 @@
27
27
  - 🔌 **公网优先**:默认连接天眼查 MCP 端点 `https://mcp.tianyancha.com/mcp`;
28
28
  支持 `--url` 指向本地或私有部署
29
29
  - 🔄 **无本地 MCP Session**:CLI 调用 stateless shared core endpoint,不缓存 `Mcp-Session-Id`
30
- - 🎯 **6 大业务分类 / 162 个工具**:企业基础信息 · 风险合规 · 知识产权 · 经营与公示 · 历史信息 · 董监高
30
+ - 🎯 **6 大业务分类 / 165 个工具**:企业基础信息 · 风险合规 · 知识产权 · 经营与公示 · 历史信息 · 董监高
31
31
  - 🤖 **AI Agent 友好**:tyc 英文 key 透传 / 时间戳格式化 / `_summary / _empty / _warnings` 元数据
32
32
 
33
33
  ---
@@ -374,7 +374,7 @@ HTTP 402 同样返回退出码 1 并保留服务端错误说明,不自动重
374
374
  | 职责 | 命令树 · 参数透传 · 格式化输出 | 多源聚合 · 时间戳格式化 · 元数据注入 · Authorization 透传至 OpenAPI |
375
375
  | 运维 | 用户本地安装 | 默认连接官方托管 `mcp.tianyancha.com`,也可切到本机 apimcp 或用户自建 |
376
376
 
377
- CLI 和 MCP Server 共享同一 162 工具清单;工具元数据从打包内的 `catalog.json`
377
+ CLI 和 MCP Server 共享同一 165 工具清单;工具元数据从打包内的 `catalog.json`
378
378
  读取,保证命令树冷启动零网络开销。
379
379
 
380
380
  ---
@@ -414,3 +414,17 @@ MCP_URL=https://my-mcp.example.com/mcp AUTH_TOKEN=xxx bash test/t1_1/cli/run_t1_
414
414
  本项目采用 [MIT License](LICENSE)。
415
415
 
416
416
  数据来源:天眼查 OpenAPI(用户需自行获取并合规使用 token)。本工具不存储、不转发、不解析用户的查询数据,所有调用经天眼查 MCP Server 转发。
417
+
418
+ ### 限制出境(L2)
419
+
420
+ `tyc risk exit-restriction "广东振戎能源有限公司" --pageNum 1 --pageSize 20 --md`
421
+
422
+ 每页默认及最大 20 条。关键词匹配申请执行人和被执行人,命中不代表企业或其高管被限制出境。走 MCP 计费的用户每次有效查询扣 1 次,无结果或失败扣 0 次,翻页独立计次;企业独立凭据通道不进入 MCP 本地计费。完整字段及披露规则见[风险合规](../../docs/t1_1/apis/风险合规.md)。
423
+
424
+ `tyc risk overview "中联重科股份有限公司"` 默认返回风险总览正文和第 1 页标识明细。`--pageNum` 默认 1,`--pageSize` 默认 100,每页最多 100 条。第 2 页起只显示当页标识明细。快照有效期内可直接跳页,`--full --output-file <文件>` 可保存当前页。
425
+
426
+ 作品著作权关键词搜索示例为 `tyc intellectual_property copyright-works "象之城" --pageNum 1 --pageSize 10`。可传完整登记号精确查询。`--md` 将关联公司名称和公司 ID(`company_id`)分列展示,多家公司按顺序对应。
427
+
428
+ ### 当前与历史欠税公告
429
+
430
+ `tyc risk tax-arrears-notice "河南赤野文化传媒有限公司"` 默认查当前;历史查询使用 `--isHistory 1 --pageNum 1 --pageSize 20`。参数可选,允许 0/1;每页最大 20,超限报错。历史范围与当前范围分别计数、分页。
package/dist/catalog.json CHANGED
@@ -5,17 +5,17 @@
5
5
  {
6
6
  "group": "company",
7
7
  "name_zh": "企业基础信息",
8
- "tool_count": 49
8
+ "tool_count": 50
9
9
  },
10
10
  {
11
11
  "group": "risk",
12
12
  "name_zh": "风险合规",
13
- "tool_count": 35
13
+ "tool_count": 38
14
14
  },
15
15
  {
16
16
  "group": "intellectual_property",
17
17
  "name_zh": "知识产权",
18
- "tool_count": 14
18
+ "tool_count": 15
19
19
  },
20
20
  {
21
21
  "group": "operation",
@@ -25,12 +25,12 @@
25
25
  {
26
26
  "group": "history",
27
27
  "name_zh": "历史信息",
28
- "tool_count": 17
28
+ "tool_count": 18
29
29
  },
30
30
  {
31
31
  "group": "executive",
32
32
  "name_zh": "董监高",
33
- "tool_count": 15
33
+ "tool_count": 16
34
34
  }
35
35
  ],
36
36
  "layers": [
@@ -44,11 +44,11 @@
44
44
  },
45
45
  {
46
46
  "layer": "L2",
47
- "count": 57
47
+ "count": 59
48
48
  },
49
49
  {
50
50
  "layer": "L3",
51
- "count": 98
51
+ "count": 103
52
52
  }
53
53
  ],
54
54
  "tools": [
@@ -320,6 +320,58 @@
320
320
  }
321
321
  ]
322
322
  },
323
+ {
324
+ "name": "get_contact_linked_companies",
325
+ "group": "company",
326
+ "layer": "L2",
327
+ "requiredPlan": "vip",
328
+ "cliMethod": "contact-linked-companies",
329
+ "categoryNameZh": "企业基础信息",
330
+ "description": "按天眼查企业 ID 反查共用电话、邮箱或完整地址的候选企业,返回逐项匹配值和候选企业 ID。可用候选 ID 继续查询第二层。共用联系方式仅为核查线索。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
331
+ "params": [
332
+ {
333
+ "name": "searchKey",
334
+ "type": "string",
335
+ "required": true,
336
+ "description": "主体企业 ID,从 search_companies 或上一层候选获取"
337
+ },
338
+ {
339
+ "name": "keyword",
340
+ "type": "string",
341
+ "description": "可选候选企业检索关键字"
342
+ },
343
+ {
344
+ "default": "true",
345
+ "enum": [
346
+ "true",
347
+ "false"
348
+ ],
349
+ "name": "exclude_agent_phones",
350
+ "type": "string",
351
+ "description": "过滤主体被标记为代账的电话"
352
+ },
353
+ {
354
+ "default": "false",
355
+ "enum": [
356
+ "true",
357
+ "false"
358
+ ],
359
+ "name": "latest_address_only",
360
+ "type": "string",
361
+ "description": "仅使用主体最新地址匹配"
362
+ },
363
+ {
364
+ "name": "pageNum",
365
+ "type": "number",
366
+ "description": "页码,默认 1"
367
+ },
368
+ {
369
+ "name": "pageSize",
370
+ "type": "number",
371
+ "description": "每页 1 至 100 条,默认 10,页码乘以每页条数最多 5000"
372
+ }
373
+ ]
374
+ },
323
375
  {
324
376
  "name": "get_controlled_companies",
325
377
  "group": "company",
@@ -907,7 +959,7 @@
907
959
  "requiredPlan": "vip",
908
960
  "cliMethod": "stock-shareholders",
909
961
  "categoryNameZh": "企业基础信息",
910
- "description": "查询上市公司股东信息,包含十大股东(十大流通股东)和参股控股。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
962
+ "description": "查询上市公司股东榜单及参股控股信息。type=1查询十大股东(默认),type=2查询十大流通股东;一次仅查询一种股东榜单。time可指定股东榜单期次,格式YYYY-MM-DD,建议从返回的timeList选择;不传时采用下游默认期次,实际日期以返回记录为准。type和time仅影响股东榜单来源,pageNum/pageSize仅影响参股控股来源。需要比较两种榜单时,应使用相同time分别调用。股份类型shareType不能用于判断榜单类型。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
911
963
  "params": [
912
964
  {
913
965
  "name": "searchKey",
@@ -915,15 +967,30 @@
915
967
  "required": true,
916
968
  "description": "企业名称、统一社会信用代码或天眼查企业 ID"
917
969
  },
970
+ {
971
+ "default": "1",
972
+ "enum": [
973
+ "1",
974
+ "2"
975
+ ],
976
+ "name": "type",
977
+ "type": "string",
978
+ "description": "股东榜单类型:1=十大股东(默认),2=十大流通股东;仅作用于股东榜单来源"
979
+ },
980
+ {
981
+ "name": "time",
982
+ "type": "string",
983
+ "description": "股东榜单查询期次,格式YYYY-MM-DD;建议从timeList选择。不传采用下游默认期次;不影响参股控股来源"
984
+ },
918
985
  {
919
986
  "name": "pageNum",
920
987
  "type": "number",
921
- "description": "页码(可选,默认 1)"
988
+ "description": "参股控股页码(可选,默认 1);不对股东榜单分页"
922
989
  },
923
990
  {
924
991
  "name": "pageSize",
925
992
  "type": "number",
926
- "description": "每页大小(可选,默认 10,常见上限 100)"
993
+ "description": "参股控股每页大小(可选,默认 10);不对股东榜单分页"
927
994
  }
928
995
  ]
929
996
  },
@@ -1237,7 +1304,7 @@
1237
1304
  "requiredPlan": "svip",
1238
1305
  "cliMethod": "person-profile",
1239
1306
  "categoryNameZh": "董监高",
1240
- "description": "查询人员画像,包含企业人员简介、人员所有角色和人员所有公司。 数据权益:早鸟期可用;2026年9月1日起需SVIP。",
1307
+ "description": "按公司和姓名查询人员简介、当前角色、历史角色和关联公司;有可核对的本人 PID 时注明来源。 数据权益:早鸟期可用;2026年9月1日起需SVIP。",
1241
1308
  "params": [
1242
1309
  {
1243
1310
  "name": "searchKey",
@@ -1610,6 +1677,46 @@
1610
1677
  }
1611
1678
  ]
1612
1679
  },
1680
+ {
1681
+ "name": "search_people",
1682
+ "group": "executive",
1683
+ "layer": "L3",
1684
+ "requiredPlan": "free",
1685
+ "cliMethod": "people",
1686
+ "categoryNameZh": "董监高",
1687
+ "description": "按姓名或“地区+姓名”搜索人员候选,例如“李彦宏”“北京 李彦宏”。可通过 area_code 指定 8 位地区国标码筛选,返回候选人员、关联公司和地区摘要,支持分页。适用于尚未确定关联公司的查人场景;已知公司和姓名时可使用 get_person_profile。 数据权益:免费会员可用。",
1688
+ "params": [
1689
+ {
1690
+ "name": "query",
1691
+ "type": "string",
1692
+ "required": true,
1693
+ "description": "姓名或地区+姓名,例如“北京 李彦宏”;最多 40 个 UTF-16 单元。"
1694
+ },
1695
+ {
1696
+ "name": "area_code",
1697
+ "type": "string",
1698
+ "description": "可选,8 位地区国标码字符串,保留前导零,例如北京 00110000。未知编码时可将地区写入 query。"
1699
+ },
1700
+ {
1701
+ "default": "1",
1702
+ "name": "page",
1703
+ "type": "integer",
1704
+ "description": "页码,从 1 开始。"
1705
+ },
1706
+ {
1707
+ "default": "20",
1708
+ "name": "page_size",
1709
+ "type": "integer",
1710
+ "description": "每页候选数,1~20。"
1711
+ },
1712
+ {
1713
+ "default": "5",
1714
+ "name": "service_company_count",
1715
+ "type": "integer",
1716
+ "description": "每条候选最多返回的关联公司关系数,1~20。"
1717
+ }
1718
+ ]
1719
+ },
1613
1720
  {
1614
1721
  "name": "get_historical_admin_license",
1615
1722
  "group": "history",
@@ -1772,6 +1879,33 @@
1772
1879
  }
1773
1880
  ]
1774
1881
  },
1882
+ {
1883
+ "name": "get_historical_environmental_penalty",
1884
+ "group": "history",
1885
+ "layer": "L3",
1886
+ "requiredPlan": "vip",
1887
+ "cliMethod": "historical-environmental-penalty",
1888
+ "categoryNameZh": "历史信息",
1889
+ "description": "查询企业历史环保处罚记录,返回决定书文号、处罚日期、 处罚单位和处罚金额(元),用于历史环保合规排查。 违法类型为上游保留字段,可能为空。 支持企业名称或统一社会信用代码,历史记录不表示处罚已撤销或已整改。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
1890
+ "params": [
1891
+ {
1892
+ "name": "searchKey",
1893
+ "type": "string",
1894
+ "required": true,
1895
+ "description": "精确企业名称或统一社会信用代码,不支持直接使用企业 ID"
1896
+ },
1897
+ {
1898
+ "name": "pageNum",
1899
+ "type": "number",
1900
+ "description": "页码,须为正整数,默认 1"
1901
+ },
1902
+ {
1903
+ "name": "pageSize",
1904
+ "type": "number",
1905
+ "description": "每页条数,须为 1–20 的整数,默认 10"
1906
+ }
1907
+ ]
1908
+ },
1775
1909
  {
1776
1910
  "name": "get_historical_equity_freeze",
1777
1911
  "group": "history",
@@ -2401,6 +2535,33 @@
2401
2535
  }
2402
2536
  ]
2403
2537
  },
2538
+ {
2539
+ "name": "search_copyright_works",
2540
+ "group": "intellectual_property",
2541
+ "layer": "L3",
2542
+ "requiredPlan": "vip",
2543
+ "cliMethod": "copyright-works",
2544
+ "categoryNameZh": "知识产权",
2545
+ "description": "按作品名称关键词或完整登记号跨公司搜索作品著作权登记记录,返回作品类别、登记号、日期和关联公司。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2546
+ "params": [
2547
+ {
2548
+ "name": "searchKey",
2549
+ "type": "string",
2550
+ "required": true,
2551
+ "description": "作品名称关键词(分词短语匹配)或完整登记号(精确匹配)"
2552
+ },
2553
+ {
2554
+ "name": "pageNum",
2555
+ "type": "number",
2556
+ "description": "页码,默认 1;页码乘以每页条数不能超过 10000"
2557
+ },
2558
+ {
2559
+ "name": "pageSize",
2560
+ "type": "number",
2561
+ "description": "每页条数,1–50 的整数,默认 10"
2562
+ }
2563
+ ]
2564
+ },
2404
2565
  {
2405
2566
  "name": "search_patents",
2406
2567
  "group": "intellectual_property",
@@ -2614,7 +2775,7 @@
2614
2775
  "requiredPlan": "vip",
2615
2776
  "cliMethod": "company-announcement",
2616
2777
  "categoryNameZh": "经营与公示",
2617
- "description": "查询企业公告信息,包含上市公告和公告研报。适用于核验上市公司公告、破产重整/清算公告、管理人公告、资产处置公告、投资人招募公告。遇到“税务/规划/司法三重关卡”“资金来源”“交易对价”“股权比例”“担保责任”等问题时,应优先用公告原文核验,并按用户给定框架分别检查税务、规划/政策、司法/执行等维度。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2778
+ "description": "查询上市公告及企业研报或相关公告。type=0查询企业研报,type=1查询相关公告(默认),仅作用于公告研报来源。相关公告可能由其他主体发布;返回标题、日期与原文链接,不代表已读取原文。适用于核验上市公司公告、破产重整/清算公告、管理人公告、资产处置公告、投资人招募公告。遇到“税务/规划/司法三重关卡”“资金来源”“交易对价”“股权比例”“担保责任”等问题时,应优先用公告原文核验,并按用户给定框架分别检查税务、规划/政策、司法/执行等维度。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2618
2779
  "params": [
2619
2780
  {
2620
2781
  "name": "searchKey",
@@ -2622,6 +2783,16 @@
2622
2783
  "required": true,
2623
2784
  "description": "企业名称、统一社会信用代码或天眼查企业 ID"
2624
2785
  },
2786
+ {
2787
+ "default": "1",
2788
+ "enum": [
2789
+ "0",
2790
+ "1"
2791
+ ],
2792
+ "name": "type",
2793
+ "type": "number",
2794
+ "description": "公告研报查询类型:0=企业研报,1=相关公告(默认);不影响上市公告来源"
2795
+ },
2625
2796
  {
2626
2797
  "name": "pageNum",
2627
2798
  "type": "number",
@@ -2630,7 +2801,7 @@
2630
2801
  {
2631
2802
  "name": "pageSize",
2632
2803
  "type": "number",
2633
- "description": "每页大小(可选,默认 10,常见上限 100)"
2804
+ "description": "每个来源每页大小(可选,默认 10,最大 20;超出按 20 查询)"
2634
2805
  }
2635
2806
  ]
2636
2807
  },
@@ -2722,7 +2893,7 @@
2722
2893
  "requiredPlan": "vip",
2723
2894
  "cliMethod": "honor-info",
2724
2895
  "categoryNameZh": "经营与公示",
2725
- "description": "查询企业荣誉、获奖情况(从上榜榜单中按荣誉类标签筛选)。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2896
+ "description": "查询企业荣誉、奖项及认定,返回荣誉名称、状态、类型、级别、认证单位、有效期和来源。recordScope 支持 current(有效,默认)、historical(历史)、all(全部);上榜榜单请使用 get_ranking_list_info。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2726
2897
  "params": [
2727
2898
  {
2728
2899
  "name": "searchKey",
@@ -2730,6 +2901,17 @@
2730
2901
  "required": true,
2731
2902
  "description": "企业名称、统一社会信用代码或天眼查企业 ID"
2732
2903
  },
2904
+ {
2905
+ "default": "current",
2906
+ "enum": [
2907
+ "current",
2908
+ "historical",
2909
+ "all"
2910
+ ],
2911
+ "name": "recordScope",
2912
+ "type": "string",
2913
+ "description": "查询范围:current=有效(默认)、historical=历史、all=全部;不是按过去日期查询快照"
2914
+ },
2733
2915
  {
2734
2916
  "name": "pageNum",
2735
2917
  "type": "number",
@@ -2738,7 +2920,7 @@
2738
2920
  {
2739
2921
  "name": "pageSize",
2740
2922
  "type": "number",
2741
- "description": "每页大小(可选,默认 20,常见上限 100)"
2923
+ "description": "每页大小(可选,默认 20,最大 20;超过时按 20 查询并返回请求值与生效值)"
2742
2924
  }
2743
2925
  ]
2744
2926
  },
@@ -2766,13 +2948,13 @@
2766
2948
  "requiredPlan": "vip",
2767
2949
  "cliMethod": "invest-agency-events",
2768
2950
  "categoryNameZh": "经营与公示",
2769
- "description": "查询投资机构最新投资动态。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2951
+ "description": "查询投资机构最新投资动态。请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2770
2952
  "params": [
2771
2953
  {
2772
2954
  "name": "searchKey",
2773
2955
  "type": "string",
2774
2956
  "required": true,
2775
- "description": "投资机构名称"
2957
+ "description": "请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。"
2776
2958
  },
2777
2959
  {
2778
2960
  "name": "pageNum",
@@ -2793,13 +2975,13 @@
2793
2975
  "requiredPlan": "vip",
2794
2976
  "cliMethod": "invest-agency-funds",
2795
2977
  "categoryNameZh": "经营与公示",
2796
- "description": "查询投资机构基金信息,包含基金管理公司、对外投资基金和基金管理人。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2978
+ "description": "查询投资机构基金信息,包含基金管理公司、对外投资基金和基金管理人。请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2797
2979
  "params": [
2798
2980
  {
2799
2981
  "name": "searchKey",
2800
2982
  "type": "string",
2801
2983
  "required": true,
2802
- "description": "投资机构名称"
2984
+ "description": "请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。"
2803
2985
  },
2804
2986
  {
2805
2987
  "name": "pageNum",
@@ -2820,13 +3002,13 @@
2820
3002
  "requiredPlan": "vip",
2821
3003
  "cliMethod": "invest-agency-news",
2822
3004
  "categoryNameZh": "经营与公示",
2823
- "description": "查询投资机构相关新闻舆情信息。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
3005
+ "description": "查询投资机构相关新闻舆情信息。请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2824
3006
  "params": [
2825
3007
  {
2826
3008
  "name": "searchKey",
2827
3009
  "type": "string",
2828
3010
  "required": true,
2829
- "description": "投资机构名称"
3011
+ "description": "请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。"
2830
3012
  },
2831
3013
  {
2832
3014
  "name": "pageNum",
@@ -2847,13 +3029,13 @@
2847
3029
  "requiredPlan": "vip",
2848
3030
  "cliMethod": "invest-agency-profile",
2849
3031
  "categoryNameZh": "经营与公示",
2850
- "description": "查询投资机构画像,包含工商追踪、机构成员和统计分析。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
3032
+ "description": "查询投资机构画像,包含工商追踪、机构成员和统计分析。请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2851
3033
  "params": [
2852
3034
  {
2853
3035
  "name": "searchKey",
2854
3036
  "type": "string",
2855
3037
  "required": true,
2856
- "description": "投资机构名称"
3038
+ "description": "请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。"
2857
3039
  },
2858
3040
  {
2859
3041
  "name": "pageNum",
@@ -2874,13 +3056,13 @@
2874
3056
  "requiredPlan": "vip",
2875
3057
  "cliMethod": "invest-agency-public-investments",
2876
3058
  "categoryNameZh": "经营与公示",
2877
- "description": "查询投资机构投资信息,包含公开投资事件和未公开投资。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
3059
+ "description": "查询投资机构投资信息,包含公开投资事件和未公开投资。请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
2878
3060
  "params": [
2879
3061
  {
2880
3062
  "name": "searchKey",
2881
3063
  "type": "string",
2882
3064
  "required": true,
2883
- "description": "投资机构名称"
3065
+ "description": "请传投资机构库收录的机构名称,例如“深创投”。使用工商全称可能返回空结果。"
2884
3066
  },
2885
3067
  {
2886
3068
  "name": "pageNum",
@@ -3709,6 +3891,33 @@
3709
3891
  }
3710
3892
  ]
3711
3893
  },
3894
+ {
3895
+ "name": "get_exit_restriction",
3896
+ "group": "risk",
3897
+ "layer": "L2",
3898
+ "requiredPlan": "vip",
3899
+ "cliMethod": "exit-restriction",
3900
+ "categoryNameZh": "风险合规",
3901
+ "description": "查询与企业相关的限制出境记录,包括案号、限制出境对象、被执行人、申请执行人、执行法院、执行标的及发布日期。关键词同时匹配申请执行人和被执行人,命中记录不代表该企业或其高管被限制出境,应结合记录中的角色字段判断。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
3902
+ "params": [
3903
+ {
3904
+ "name": "searchKey",
3905
+ "type": "string",
3906
+ "required": true,
3907
+ "description": "企业名称、统一社会信用代码、天眼查企业 ID 或注册号;同时匹配申请执行人和被执行人"
3908
+ },
3909
+ {
3910
+ "name": "pageNum",
3911
+ "type": "number",
3912
+ "description": "页码,须为正整数,默认 1"
3913
+ },
3914
+ {
3915
+ "name": "pageSize",
3916
+ "type": "number",
3917
+ "description": "每页条数,须为 1–20 的整数,默认 20;超过 20 拒绝调用"
3918
+ }
3919
+ ]
3920
+ },
3712
3921
  {
3713
3922
  "name": "get_guarantee_info",
3714
3923
  "group": "risk",
@@ -3931,6 +4140,43 @@
3931
4140
  }
3932
4141
  ]
3933
4142
  },
4143
+ {
4144
+ "name": "get_labor_arbitration",
4145
+ "group": "risk",
4146
+ "layer": "L3",
4147
+ "requiredPlan": "vip",
4148
+ "cliMethod": "labor-arbitration",
4149
+ "categoryNameZh": "风险合规",
4150
+ "description": "查询企业劳动仲裁公告,必须选择 court 开庭公告或 delivery 送达公告。 返回案号、申请人、被申请人及对应日期;开庭公告另含案由和发布机构。 支持精确企业名称或统一社会信用代码;公告不代表已裁决或败诉。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
4151
+ "params": [
4152
+ {
4153
+ "name": "searchKey",
4154
+ "type": "string",
4155
+ "required": true,
4156
+ "description": "精确企业名称或统一社会信用代码,不支持直接使用企业 ID"
4157
+ },
4158
+ {
4159
+ "enum": [
4160
+ "court",
4161
+ "delivery"
4162
+ ],
4163
+ "name": "noticeType",
4164
+ "type": "string",
4165
+ "required": true,
4166
+ "description": "court 为开庭公告,delivery 为送达公告;每次只查询所选类型"
4167
+ },
4168
+ {
4169
+ "name": "pageNum",
4170
+ "type": "number",
4171
+ "description": "正整数页码,默认 1"
4172
+ },
4173
+ {
4174
+ "name": "pageSize",
4175
+ "type": "number",
4176
+ "description": "每页 1–20 条,默认 10"
4177
+ }
4178
+ ]
4179
+ },
3934
4180
  {
3935
4181
  "name": "get_land_mortgage_info",
3936
4182
  "group": "risk",
@@ -3992,6 +4238,33 @@
3992
4238
  }
3993
4239
  ]
3994
4240
  },
4241
+ {
4242
+ "name": "get_prelitigation_mediation",
4243
+ "group": "risk",
4244
+ "layer": "L3",
4245
+ "requiredPlan": "vip",
4246
+ "cliMethod": "prelitigation-mediation",
4247
+ "categoryNameZh": "风险合规",
4248
+ "description": "查询企业当前诉前调解记录,返回案号、法院、立案日期、案由及当事人分组。 支持精确企业名称或统一社会信用代码;PunishDate 表示立案日期,角色保留上游代码。 不含历史诉前调解,不代表已形成裁判或已达成调解。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
4249
+ "params": [
4250
+ {
4251
+ "name": "searchKey",
4252
+ "type": "string",
4253
+ "required": true,
4254
+ "description": "精确企业名称或统一社会信用代码,不支持直接使用企业 ID"
4255
+ },
4256
+ {
4257
+ "name": "pageNum",
4258
+ "type": "number",
4259
+ "description": "正整数页码,默认 1"
4260
+ },
4261
+ {
4262
+ "name": "pageSize",
4263
+ "type": "number",
4264
+ "description": "每页 1–20 条,默认 10"
4265
+ }
4266
+ ]
4267
+ },
3995
4268
  {
3996
4269
  "name": "get_public_exhortation",
3997
4270
  "group": "risk",
@@ -4058,13 +4331,23 @@
4058
4331
  "requiredPlan": "free",
4059
4332
  "cliMethod": "overview",
4060
4333
  "categoryNameZh": "风险合规",
4061
- "description": "查询企业天眼风险总览,包括企业自身/周边/预警风险信息。 数据权益:免费会员可用。",
4334
+ "description": "查询企业自身、周边和预警风险。上游标识明细支持分页,pageNum 默认 1,pageSize 默认 100,每页最多 100 条。第 1 页返回风险总览正文和当页标识明细,第 2 页起仅返回当页标识明细。 数据权益:免费会员可用。",
4062
4335
  "params": [
4063
4336
  {
4064
4337
  "name": "searchKey",
4065
4338
  "type": "string",
4066
4339
  "required": true,
4067
4340
  "description": "企业名称、统一社会信用代码或天眼查企业 ID"
4341
+ },
4342
+ {
4343
+ "name": "pageNum",
4344
+ "type": "number",
4345
+ "description": "标识明细页码,可单独传,默认 1。仅第 1 页包含风险总览正文"
4346
+ },
4347
+ {
4348
+ "name": "pageSize",
4349
+ "type": "number",
4350
+ "description": "每页标识明细条数,可单独传,默认 100,范围 1–100"
4068
4351
  }
4069
4352
  ]
4070
4353
  },
@@ -4190,7 +4473,7 @@
4190
4473
  "requiredPlan": "vip",
4191
4474
  "cliMethod": "tax-arrears-notice",
4192
4475
  "categoryNameZh": "风险合规",
4193
- "description": "查询企业欠税公告,包括欠税税种、欠税余额、纳税人识别号、经营地点。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
4476
+ "description": "查询企业当前或历史欠税公告,包括欠税税种、欠税余额、本期新发生欠税余额、税务机关和发布日期。默认查询当前;历史欠税请传 isHistory=1。历史公告不代表当前仍欠税或已经缴清。 数据权益:早鸟期可用;2026年9月1日起需VIP。",
4194
4477
  "params": [
4195
4478
  {
4196
4479
  "name": "searchKey",
@@ -4198,6 +4481,16 @@
4198
4481
  "required": true,
4199
4482
  "description": "企业名称、统一社会信用代码或天眼查企业 ID"
4200
4483
  },
4484
+ {
4485
+ "default": "0",
4486
+ "enum": [
4487
+ "0",
4488
+ "1"
4489
+ ],
4490
+ "name": "isHistory",
4491
+ "type": "string",
4492
+ "description": "查询范围,可选;0=当前(默认),1=历史;查询全部时分别调用两个范围。"
4493
+ },
4201
4494
  {
4202
4495
  "name": "pageNum",
4203
4496
  "type": "number",
@@ -4206,7 +4499,7 @@
4206
4499
  {
4207
4500
  "name": "pageSize",
4208
4501
  "type": "number",
4209
- "description": "每页大小(可选,默认 20,常见上限 100)"
4502
+ "description": "每页条数,可选,默认 20,最大 20。"
4210
4503
  }
4211
4504
  ]
4212
4505
  },
@@ -1,3 +1,12 @@
1
+ // 动态注册:按 catalog.json 生成 `tyc <group> <method>` 命令
2
+ //
3
+ // 每个方法的 handler 只负责:
4
+ // 1. 组装 arguments 映射
5
+ // 2. 调 shared core tools/call → MCP Server
6
+ // 3. 从 result.content[0].text 解出业务 JSON(已是服务端合并/格式化后的成品)
7
+ // 4. 按 --md / --compact / --pretty / 默认 输出,再过 --head/--tail/--full
8
+ // /--threshold/--output-file 截断 & 落盘
9
+ import { Option } from "commander";
1
10
  import { getCategories, getToolsByGroup } from "../registry.js";
2
11
  import { registerCompanyCapabilitiesCommand } from "./capabilities.js";
3
12
  import { callCoreToolWithOAuthRefresh } from "./coreCall.js";
@@ -5,6 +14,8 @@ import { emitToolResult } from "./output.js";
5
14
  const GLOBAL_OUTPUT_HELP = `
6
15
  全局输出选项:所有工具命令均支持 --md / --compact / --pretty / --head / --tail / --full / --threshold / --output-file / --verbose;完整说明见 tyc --help。
7
16
  `;
17
+ // Use the server view to retain field semantics and paging instructions.
18
+ const serverMarkdownViews = new Set(["search_people", "get_contact_linked_companies", "search_copyright_works", "get_risk_overview", "get_person_profile", "get_personnel_legal_rep_roles", "get_person_partners", "get_actual_controller"]);
8
19
  export function registerCategoryCommands(program) {
9
20
  for (const cat of getCategories()) {
10
21
  const tools = getToolsByGroup(cat.group);
@@ -36,7 +47,7 @@ function bindMethod(catCmd, tool, program) {
36
47
  // 都能直观看到分层信息;徽章不影响 Agent 对 description 的语义理解。
37
48
  let methodCmd = catCmd
38
49
  .command(tool.cliMethod)
39
- .description(`[${tool.layer}] ${tool.description} 调用额度:成功且返回有效结果计 1 次;报错、全部无结果和系统异常计 0 次。`);
50
+ .description(`[${tool.layer}] ${tool.description} 调用额度:${tool.name === "get_risk_overview" ? "有效业务查询计 1 次,读取已有标识快照计 0 次。" : "成功且返回有效结果计 1 次;报错、全部无结果和系统异常计 0 次。"}`);
40
51
  if (positional) {
41
52
  methodCmd = methodCmd.argument(`<${positional.name}>`, positional.description);
42
53
  }
@@ -46,19 +57,35 @@ function bindMethod(catCmd, tool, program) {
46
57
  for (const p of optionalParams) {
47
58
  methodCmd = methodCmd.option(`--${p.name} <value>`, p.description);
48
59
  }
60
+ if (tool.name === "get_contact_info") {
61
+ // Accept paging flags from generic callers without adding them to the API arguments.
62
+ for (const flag of ["--pageNum", "--pageNUm", "--pageSize"]) {
63
+ methodCmd.addOption(new Option(`${flag} [value]`).hideHelp());
64
+ }
65
+ }
49
66
  methodCmd.addHelpText("after", GLOBAL_OUTPUT_HELP);
50
67
  methodCmd.action(async (posVal, options) => {
51
68
  const args = {};
52
69
  if (positional && posVal)
53
70
  args[positional.name] = posVal;
54
71
  for (const p of [...remainingRequired, ...optionalParams]) {
55
- if (options[p.name] !== undefined)
56
- args[p.name] = options[p.name];
72
+ if (options[p.name] !== undefined) {
73
+ const value = options[p.name];
74
+ if (p.type === "integer") {
75
+ if (!/^[0-9]+$/.test(value) || !Number.isSafeInteger(Number(value)))
76
+ throw new Error(`参数 ${p.name} 必须为整数`);
77
+ args[p.name] = Number(value);
78
+ }
79
+ else {
80
+ args[p.name] = value;
81
+ }
82
+ }
57
83
  }
58
84
  const opts = program.opts();
59
85
  const verbose = !!opts.verbose;
60
86
  try {
61
- const result = await callToolWithOAuthRefresh(tool.name, args, verbose);
87
+ const format = opts.md && serverMarkdownViews.has(tool.name) ? "markdown" : "json";
88
+ const result = await callCoreToolWithOAuthRefresh(tool.name, args, { verbose, format });
62
89
  emitToolResult(result, opts, tool.name);
63
90
  }
64
91
  catch (err) {
@@ -67,6 +94,3 @@ function bindMethod(catCmd, tool, program) {
67
94
  }
68
95
  });
69
96
  }
70
- async function callToolWithOAuthRefresh(name, args, verbose) {
71
- return callCoreToolWithOAuthRefresh(name, args, { verbose });
72
- }
@@ -8,8 +8,17 @@ export function renderHistoryGuide(value) {
8
8
  const lines = [`> 查询范围:${cell(value.scope)}`];
9
9
  if (Array.isArray(value.nextTools))
10
10
  for (const next of value.nextTools) {
11
- if (object(next))
11
+ if (object(next)) {
12
12
  lines.push(`> 后续查询:\`${cell(next.toolName)}\` — ${cell(next.purpose)}`);
13
+ if (object(next.arguments)) {
14
+ if (next.toolName === "get_tax_arrears_notice") {
15
+ lines.push("> CLI:`tyc risk tax-arrears-notice <企业名称> --isHistory 1 --pageNum 1 --pageSize 20`");
16
+ }
17
+ else {
18
+ lines.push(`> 调用参数:\`${cell(next.arguments)}\``);
19
+ }
20
+ }
21
+ }
13
22
  }
14
23
  if (Array.isArray(value.notes))
15
24
  for (const note of value.notes)
@@ -1,3 +1,4 @@
1
+ import { renderOA2Items } from "./oa2.js";
1
2
  import { identifierDetails } from "./identifierDetails.js";
2
3
  import { stringifyLosslessJSON, LosslessNumber } from "./losslessJson.js";
3
4
  /**
@@ -11,7 +12,7 @@ import { stringifyLosslessJSON, LosslessNumber } from "./losslessJson.js";
11
12
  */
12
13
  import { renderChangeRecords, splitChangeRecords } from "./personnelChanges.js";
13
14
  import { renderHistoryGuide, splitHistoricalPersonnel } from "./history.js";
14
- const META_KEYS = new Set(["_summary", "_empty", "_warnings", "_tip", "_truncated", "_pagination", "_riskOverview", "_dateSemantics", "_fieldSemantics", "_historyGuide", "_source"]);
15
+ const META_KEYS = new Set(["_queryScope", "_summary", "_empty", "_warnings", "_tip", "_truncated", "_pagination", "_riskOverview", "_identifierExport", "_recordCounts", "_dateSemantics", "_fieldSemantics", "_historyGuide", "_source"]);
15
16
  function isPlainObject(v) {
16
17
  return v !== null && typeof v === "object" && !Array.isArray(v) && !(v instanceof LosslessNumber);
17
18
  }
@@ -113,6 +114,9 @@ function renderTopFields(obj) {
113
114
  }
114
115
  function renderMeta(obj) {
115
116
  const lines = renderHistoryGuide(obj._historyGuide);
117
+ if (typeof obj._queryScope === "string") {
118
+ lines.push(`> 查询范围:${escapeCell(obj._queryScope === "historical" ? "历史" : obj._queryScope === "current" ? "当前" : obj._queryScope)}`);
119
+ }
116
120
  const sourceNotes = (payload, prefix = "") => {
117
121
  if (!isPlainObject(payload._source))
118
122
  return;
@@ -148,7 +152,7 @@ function renderMeta(obj) {
148
152
  lines.push(`> 💡 **提示**:${formatPrimitive(obj._tip)}`);
149
153
  }
150
154
  if (obj._empty === true && !isPlainObject(obj._riskOverview)) {
151
- lines.push(`> ⚪ **空结果**:未发现该维度记录`);
155
+ lines.push(`> ⚪ **空结果**:本次未返回记录`);
152
156
  }
153
157
  if (isPlainObject(obj._pagination)) {
154
158
  const p = obj._pagination;
@@ -299,8 +303,92 @@ function renderMarkdownValue(value, toolName) {
299
303
  const meta = renderMeta(obj);
300
304
  if (meta)
301
305
  parts.push(meta);
306
+ const oa2 = renderOA2Items(obj, toolName);
307
+ if (oa2 !== undefined)
308
+ return parts.concat(oa2).join("\n");
302
309
  if (toolName === "get_risk_overview" || isPlainObject(obj._riskOverview)) {
303
- parts.push(renderRiskOverview(obj));
310
+ if (obj.section === "identifier_details" && Array.isArray(obj.items)) {
311
+ parts.push(`> 快照 ${obj.snapshot_version}`, renderJSONBlock(obj.items));
312
+ }
313
+ else {
314
+ parts.push(renderRiskOverview(obj));
315
+ if (isPlainObject(obj._identifierExport)) {
316
+ const info = obj._identifierExport;
317
+ if (Array.isArray(info.items))
318
+ parts.push("## 上游标识明细", renderJSONBlock(info.items));
319
+ if (info.status === "unavailable") {
320
+ parts.push("> 快照暂不可用,需要续页时请重新查询第 1 页。");
321
+ }
322
+ else if (isPlainObject(info._pagination) && info._pagination.has_more) {
323
+ parts.push(`> 下一页传 --pageNum ${info._pagination.next_page} --pageSize ${info._pagination.effective_page_size}。`);
324
+ }
325
+ }
326
+ }
327
+ return parts.join("\n").replace(/\n{3,}/g, "\n\n");
328
+ }
329
+ if (toolName === "get_stock_shareholders" && isPlainObject(obj.sources)) {
330
+ for (const scope of ["top", "holding"]) {
331
+ const source = obj.sources[scope];
332
+ if (!isPlainObject(source))
333
+ continue;
334
+ const title = scope === "holding" ? "参股控股" : String(source._queryType) === "2" ? "十大流通股东" : String(source._queryType) === "1" ? "十大股东" : "股东榜单";
335
+ parts.push(`## ${title}\n`);
336
+ if (scope === "top" && source._queryType !== undefined)
337
+ parts.push(`> 查询类型:type=${source._queryType};续查保持 --type ${source._queryType}。\n`);
338
+ if (source.status === "error") {
339
+ parts.push(`> 查询失败:${escapeCell(formatPrimitive(source.error))};不能据此判断无记录。\n`);
340
+ continue;
341
+ }
342
+ if (source.status === "unknown") {
343
+ parts.push("> 返回结构未知,无法确认记录数。\n");
344
+ continue;
345
+ }
346
+ if (scope === "top") {
347
+ parts.push(`> 本次返回${source.returnedCount}条。${escapeCell(formatPrimitive(source._periodNote))}\n`);
348
+ if (source.empty === true)
349
+ parts.push("> 空结果:本次股东榜单查询无记录。\n");
350
+ if (Array.isArray(source.holderList))
351
+ parts.push(renderItemsTable(source.holderList, title));
352
+ if (Array.isArray(source.timeList))
353
+ parts.push(renderItemsTable(source.timeList, "可选期次 timeList"));
354
+ }
355
+ else {
356
+ parts.push(renderMeta(source));
357
+ if (source.empty === true)
358
+ parts.push("> 空结果:本次参股控股查询无记录。\n");
359
+ else if (Array.isArray(source.items) && source.items.length === 0)
360
+ parts.push("> 当前页无记录,不代表该来源没有记录。\n");
361
+ if (Array.isArray(source.items))
362
+ parts.push(renderItemsTable(source.items, title));
363
+ }
364
+ }
365
+ return parts.join("\n").replace(/\n{3,}/g, "\n\n");
366
+ }
367
+ if (toolName === "get_company_announcement" && isPlainObject(obj.sources)) {
368
+ for (const scope of ["stock", "mr"]) {
369
+ const source = obj.sources[scope];
370
+ if (!isPlainObject(source))
371
+ continue;
372
+ const title = scope === "stock" ? "上市公告" : String(source._queryType) === "0" ? "企业研报" : String(source._queryType) === "1" ? "相关公告" : "公告研报";
373
+ parts.push(`## ${title}\n`);
374
+ if (scope === "mr" && source._queryType !== undefined)
375
+ parts.push(`> 查询类型:type=${source._queryType}(${title});续查保持 --type ${source._queryType}。\n`);
376
+ if (source.status === "error") {
377
+ parts.push(`> 查询失败:${escapeCell(formatPrimitive(source.error))};不能据此判断该来源无记录。\n`);
378
+ }
379
+ else if (source.status === "unknown") {
380
+ parts.push("> 返回结构未知,无法确认该来源记录数。\n");
381
+ }
382
+ else {
383
+ parts.push(renderMeta(source));
384
+ if (source.empty === true)
385
+ parts.push(`> 空结果:未发现${title}记录。\n`);
386
+ else if (Array.isArray(source.items) && source.items.length === 0)
387
+ parts.push("> 当前页无记录,不代表该来源没有记录。\n");
388
+ else if (Array.isArray(source.items))
389
+ parts.push(renderItemsTable(source.items, title));
390
+ }
391
+ }
304
392
  return parts.join("\n").replace(/\n{3,}/g, "\n\n");
305
393
  }
306
394
  // 顶层字段
@@ -317,5 +405,8 @@ function renderMarkdownValue(value, toolName) {
317
405
  return parts.join("\n").replace(/\n{3,}/g, "\n\n");
318
406
  }
319
407
  export function jsonToMarkdown(value, toolName) {
320
- return renderMarkdownValue(value, toolName) + identifierDetails(value);
408
+ const body = renderMarkdownValue(value, toolName);
409
+ if (toolName === "get_risk_overview" || (isPlainObject(value) && isPlainObject(value._riskOverview)))
410
+ return body;
411
+ return body + identifierDetails(value);
321
412
  }
@@ -0,0 +1,33 @@
1
+ /** OA2 list labels preserve the provider's date/unit/role semantics. */
2
+ export function renderOA2Items(obj, toolName) {
3
+ let columns;
4
+ switch (toolName) {
5
+ case 'get_historical_environmental_penalty':
6
+ columns = [['Id', '记录标识'], ['CaseNo', '决定书文号'], ['PunishDate', '处罚日期'], ['IllegalType', '违法类型'], ['PunishGov', '处罚单位'], ['PunishAmt', '处罚金额(元)']];
7
+ break;
8
+ case 'get_labor_arbitration':
9
+ columns = [['CaseNo', '案号'], ['Applicant', '申请人'], ['Respondent', '被申请人']];
10
+ if (obj._notice_type === 'court')
11
+ columns.push(['CaseReason', '案由'], ['PublishOrg', '发布机构'], ['PublishDate', '开庭日期']);
12
+ else
13
+ columns.push(['PublishDate', '发布日期']);
14
+ break;
15
+ case 'get_prelitigation_mediation':
16
+ columns = [['CaseNo', '案号'], ['Court', '法院'], ['PunishDate', '立案日期'], ['CaseReason', '案由'], ['RoleList', '当事人分组(上游代码)']];
17
+ break;
18
+ default: return undefined;
19
+ }
20
+ const items = Array.isArray(obj.items) ? obj.items : [];
21
+ if (!items.length)
22
+ return '';
23
+ const cell = (v) => String(v ?? '').replace(/\|/g, '\\|').replace(/\r?\n/g, ' ') || '—';
24
+ const lines = ['| ' + columns.map(([, title]) => title).join(' | ') + ' |', '| ' + columns.map(() => '---').join(' | ') + ' |'];
25
+ for (const row of items) {
26
+ lines.push('| ' + columns.map(([key]) => {
27
+ if (key !== 'RoleList')
28
+ return cell(row[key]);
29
+ return cell((row.RoleList ?? []).map((role) => `类型代码 ${role.RoleType}:${role.RoleItemList.join('、')}`).join(';'));
30
+ }).join(' | ') + ' |');
31
+ }
32
+ return lines.join('\n') + '\n';
33
+ }
@@ -4,6 +4,7 @@ import { changeRecordsForDisplay } from "./history.js";
4
4
  const object = (v) => v !== null && typeof v === "object" && !Array.isArray(v) && !(v instanceof LosslessNumber);
5
5
  const text = (v) => typeof v === "string" ? v : stringifyLosslessJSON(v) ?? "null";
6
6
  const cell = (v) => (v === undefined || v === "" ? "-" : text(v)).replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
7
+ const positionSource = (v) => v === "content" ? "正文(content)" : v === "changeItem" ? "变更事项(changeItem)" : v;
7
8
  function block(value) {
8
9
  const raw = text(value);
9
10
  const longest = Math.max(0, ...(raw.match(/`+/g) ?? []).map((s) => s.length));
@@ -29,7 +30,7 @@ function renderSide(title, side) {
29
30
  const out = [`#### ${title}\n`, `解析状态:${cell(side.status)}\n`];
30
31
  const people = Array.isArray(side.people) ? side.people : [];
31
32
  if (people.length) {
32
- out.push("| 姓名 | 职务原值 | 法定代表人标志原值 | 显式变更标记 | 其他登记字段 |", "|---|---|---|---|---|");
33
+ out.push("| 姓名 | 职务 | 职务来源 | 姓名附加标记原值 | 法定代表人标志原值 | 显式变更标记 | 其他登记字段 |", "|---|---|---|---|---|---|---|");
33
34
  for (const person of people) {
34
35
  if (!object(person)) {
35
36
  out.push(block(person));
@@ -37,7 +38,7 @@ function renderSide(title, side) {
37
38
  }
38
39
  const fields = Array.isArray(person.fields) ? person.fields : [];
39
40
  const other = fields.filter((field) => !object(field) || !["姓名", "职务", "法定代表人标志"].includes(String(field.key)));
40
- out.push(`| ${[person.name, person.position, person.legalRepresentativeFlag, person.marker, other].map(cell).join(" | ")} |`);
41
+ out.push(`| ${[person.name, person.position, positionSource(person.positionSource), person.nameMarker, person.legalRepresentativeFlag, person.marker, other].map(cell).join(" | ")} |`);
41
42
  }
42
43
  out.push("");
43
44
  }
@@ -57,7 +58,7 @@ export function renderChangeRecords(records, title) {
57
58
  return;
58
59
  }
59
60
  out.push(`### 第 ${index + 1} 条 · ${cell(value.changeTime)} · ${cell(value.changeItem)}\n`);
60
- const parsed = object(value._parsed) && value._parsed.version === 1 ? value._parsed : undefined;
61
+ const parsed = object(value._parsed) && (value._parsed.version === 1 || value._parsed.version === 2) ? value._parsed : undefined;
61
62
  for (const [key, v] of Object.entries(value)) {
62
63
  if (["changeTime", "changeItem", "contentBefore", "contentAfter"].includes(key) || (key === "_parsed" && parsed))
63
64
  continue;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tyc-cli",
3
- "version": "0.3.10",
4
- "description": "天眼查 AI CLI — 162 个业务语义聚合工具 · 默认 Shared Core 调用 · 兼容 MCP transport",
3
+ "version": "0.3.12",
4
+ "description": "天眼查 AI CLI — 165 个业务语义聚合工具 · 默认 Shared Core 调用 · 兼容 MCP transport",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "tyc": "dist/index.js"