weaver-work-cli 0.1.80 → 0.1.81

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 (186) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/{archive-ENBSUMHV.js → archive-KVV4SM7J.js} +3 -3
  3. package/dist/chunks/{archive-oa-7BFPQ6M5.js → archive-oa-VRSPNLY4.js} +3 -3
  4. package/dist/chunks/{asset-V5SUD3PW.js → asset-JZ5MN6OL.js} +306 -10
  5. package/dist/chunks/{asset-idle-3CEL7WFX.js → asset-idle-B4SAL43V.js} +3 -3
  6. package/dist/chunks/{attachment-content-SHXZUE3N.js → attachment-content-7W4XQTA7.js} +3 -3
  7. package/dist/chunks/{blog-FLI4SS3P.js → blog-XCBM467O.js} +3 -3
  8. package/dist/chunks/{caizhilian-7WCTKCCP.js → caizhilian-NZVUKCZD.js} +5 -5
  9. package/dist/chunks/{calendar-G726HUUH.js → calendar-OVM2SGYJ.js} +3 -3
  10. package/dist/chunks/{chunk-XNN5PZTI.js → chunk-3WZMDOI3.js} +1 -1
  11. package/dist/chunks/{chunk-TM2G7DNT.js → chunk-56F2GGE4.js} +5 -5
  12. package/dist/chunks/{chunk-LCM5SSGJ.js → chunk-5MM2IZ27.js} +423 -36
  13. package/dist/chunks/{chunk-BWFCTE43.js → chunk-5NQZO3CO.js} +48 -5
  14. package/dist/chunks/{chunk-KVCDZ2FX.js → chunk-5RIK6OLF.js} +7 -7
  15. package/dist/chunks/{chunk-5E2FDXBU.js → chunk-64RYQOXA.js} +1 -1
  16. package/dist/chunks/{chunk-44ZWNC7A.js → chunk-7BP3HU74.js} +2 -2
  17. package/dist/chunks/{chunk-3Q5F4C5B.js → chunk-AW3HQUOC.js} +5 -5
  18. package/dist/chunks/{chunk-7M5OYRK2.js → chunk-BD3M2YVN.js} +3 -3
  19. package/dist/chunks/{chunk-JEQHNNSS.js → chunk-BFVUBCYO.js} +14 -0
  20. package/dist/chunks/{chunk-PAWXVT6H.js → chunk-CLVEXDEJ.js} +4 -5
  21. package/dist/chunks/{chunk-TBCKK6LH.js → chunk-DWCMKEMO.js} +2 -2
  22. package/dist/chunks/{chunk-AVDEZLEB.js → chunk-E3XUYWYA.js} +4 -4
  23. package/dist/chunks/{chunk-3IX6L74V.js → chunk-FIPTUAOW.js} +2 -2
  24. package/dist/chunks/{chunk-4MAQALTM.js → chunk-GQEIHXY5.js} +6 -6
  25. package/dist/chunks/{chunk-TD5IOEGN.js → chunk-JUPKXW4P.js} +1 -1
  26. package/dist/chunks/{chunk-HYNOKFYJ.js → chunk-KZ3JR3GE.js} +3 -3
  27. package/dist/chunks/{chunk-4PBN7NJY.js → chunk-L2PKMZIU.js} +1 -1
  28. package/dist/chunks/{chunk-DACQKJ6O.js → chunk-LXWWOHM6.js} +4 -4
  29. package/dist/chunks/{chunk-7DE3VMZD.js → chunk-LYFPWZBD.js} +6 -1
  30. package/dist/chunks/{chunk-2UV4IZIT.js → chunk-MTIV6JEN.js} +2 -2
  31. package/dist/chunks/{chunk-WXV5FIKA.js → chunk-MWFKLXVU.js} +38 -38
  32. package/dist/chunks/{chunk-PMRNIGKZ.js → chunk-RVVRTW4P.js} +2 -2
  33. package/dist/chunks/{chunk-FPWCCRKT.js → chunk-UASZW22U.js} +3 -3
  34. package/dist/chunks/{chunk-RVEKGVZU.js → chunk-VMUVVTT4.js} +2 -2
  35. package/dist/chunks/{chunk-JQPKSQAK.js → chunk-W4BGNYKR.js} +1 -1
  36. package/dist/chunks/{chunk-OVTCWLNQ.js → chunk-W4R3SXJV.js} +15 -7
  37. package/dist/chunks/{chunk-UDBQJLQF.js → chunk-WF5G5SV3.js} +2 -2
  38. package/dist/chunks/{chunk-EGHRA2E3.js → chunk-WM5ZE67G.js} +1 -1
  39. package/dist/chunks/{chunk-QVKRNL7L.js → chunk-WQ4ZHAEZ.js} +10 -2
  40. package/dist/chunks/{chunk-JFZM3ZRU.js → chunk-X7OZKI6F.js} +12 -12
  41. package/dist/chunks/{chunk-YKTVK6XM.js → chunk-Y6HRTEDD.js} +1 -1
  42. package/dist/chunks/{chunk-2KW7AI6P.js → chunk-YFDKTTYX.js} +8 -5
  43. package/dist/chunks/{chunk-HKW5FYZR.js → chunk-YLPGCOAM.js} +76 -69
  44. package/dist/chunks/{chunk-LQLIXBJF.js → chunk-YXIPZFMX.js} +1 -1
  45. package/dist/chunks/{cli-JDTWQDDR.js → cli-VCQIDBDQ.js} +37 -37
  46. package/dist/chunks/{commands-J52MJ6NF.js → commands-THGXVOEL.js} +9 -5
  47. package/dist/chunks/{conflict-O4FXUTIX.js → conflict-T7URCNS6.js} +2 -2
  48. package/dist/chunks/{contract-GW7US3UF.js → contract-ZLGLQ45G.js} +3 -3
  49. package/dist/chunks/{cowork-GZDODGKF.js → cowork-2MBNOUYS.js} +21 -8
  50. package/dist/chunks/{create-flow-YIFMKM2C.js → create-flow-OFZC36MV.js} +6 -6
  51. package/dist/chunks/{data-HTQZRPPI.js → data-6O7ANJVT.js} +3 -3
  52. package/dist/chunks/{ebuilder-form-GHNIZ7ET.js → ebuilder-form-OJ3KJVQI.js} +4 -4
  53. package/dist/chunks/{ehr-7TGZTZR3.js → ehr-NWMI5Q7S.js} +4 -4
  54. package/dist/chunks/{employee-QX57HEWS.js → employee-O2EPUYIH.js} +2 -2
  55. package/dist/chunks/{entry-mode-X3KKRN36.js → entry-mode-TVACGU7K.js} +3 -3
  56. package/dist/chunks/{env-MCVDVISU.js → env-EWG4ZAWP.js} +2 -2
  57. package/dist/chunks/{esb-ATRKVHCD.js → esb-56FV2PIA.js} +5 -5
  58. package/dist/chunks/{factory-ALB7DMVY.js → factory-GQSEJRDY.js} +1 -1
  59. package/dist/chunks/{fna-IKYI3SST.js → fna-YLA3RKRW.js} +3 -3
  60. package/dist/chunks/{group-chat-GGPL2EBF.js → group-chat-5R6L3LCG.js} +3 -3
  61. package/dist/chunks/{host-UY4LQPN4.js → host-42MLO4KX.js} +4 -4
  62. package/dist/chunks/{host-XXGDQM7D.js → host-J72VEDW5.js} +4 -4
  63. package/dist/chunks/{host-EJSJSLVK.js → host-QKCRQS2C.js} +4 -4
  64. package/dist/chunks/{host-EYNLB6S4.js → host-W3BVEATN.js} +4 -4
  65. package/dist/chunks/{host-OT4KNR3G.js → host-YJINI5GG.js} +4 -4
  66. package/dist/chunks/{host-6UOXYOOY.js → host-ZVGBZOHY.js} +4 -4
  67. package/dist/chunks/{hrm-5JQ7QZ6A.js → hrm-3JFZNB42.js} +66 -26
  68. package/dist/chunks/{im-2YJW3EI5.js → im-HKIRPCGD.js} +5 -5
  69. package/dist/chunks/{invoice-36BCXKOX.js → invoice-4PREIOTG.js} +80 -17
  70. package/dist/chunks/{jiuchuanhui-KBWUZ7WT.js → jiuchuanhui-K3PLNENZ.js} +3 -3
  71. package/dist/chunks/{lazy-dispatch-ZDKLS5MR.js → lazy-dispatch-MKGEWZNM.js} +8 -8
  72. package/dist/chunks/{mail-YBKUM6HM.js → mail-6QPVWKXM.js} +3 -3
  73. package/dist/chunks/{meeting-MU3RHAEX.js → meeting-QPPEPBSN.js} +15 -15
  74. package/dist/chunks/{minute-doc-NHIEZEHU.js → minute-doc-JMIDZK5D.js} +1 -1
  75. package/dist/chunks/{okr-HW7IULIR.js → okr-67C5LQYD.js} +3 -3
  76. package/dist/chunks/{operations-4P2UYVLH.js → operations-YLKRNAPI.js} +5 -5
  77. package/dist/chunks/{org-MWWIFNAO.js → org-L5XDM2RQ.js} +2 -2
  78. package/dist/chunks/{performance-PM2G6L3E.js → performance-33QZZR4I.js} +3 -3
  79. package/dist/chunks/{plan-3YYGZ7ZM.js → plan-W4BPONRL.js} +3 -3
  80. package/dist/chunks/{project-6PRGBLO2.js → project-OKSEH6AF.js} +3 -3
  81. package/dist/chunks/{reception-7G3J2MA6.js → reception-H5M7SPHT.js} +3 -3
  82. package/dist/chunks/{recruit-stage-5KK7R37U.js → recruit-stage-O2JGNVMO.js} +12 -8
  83. package/dist/chunks/{registry-4S3RXXWS.js → registry-45VEUYTC.js} +4 -4
  84. package/dist/chunks/{registry-3VTB3KLV.js → registry-BMTQ55G5.js} +5 -5
  85. package/dist/chunks/{registry-KQ4TNUWO.js → registry-PYONXFUF.js} +3 -3
  86. package/dist/chunks/{registry-HWUNNXDU.js → registry-SAMJ4VH2.js} +14 -14
  87. package/dist/chunks/{registry-AC33ZZVH.js → registry-YY62OFKQ.js} +1 -1
  88. package/dist/chunks/{room-recommend-V4BSHR2M.js → room-recommend-NRLAZJCI.js} +4 -4
  89. package/dist/chunks/{schedule-T7W357TN.js → schedule-LNBOCBP5.js} +4 -4
  90. package/dist/chunks/{smart-extract-T5Z4AULN.js → smart-extract-JOTX6UZC.js} +3 -3
  91. package/dist/chunks/{update-77ZUIYSG.js → update-BERR64TI.js} +3 -3
  92. package/dist/chunks/{workflow-SYCBS5XD.js → workflow-ZDQY3TI7.js} +5 -5
  93. package/dist/core/runtime-agent.js +19 -3
  94. package/dist/index.js +4 -4
  95. package/dist/internal/e10/auth/agent-host-key.js +10 -1
  96. package/dist/internal/e10/auth/commands.js +20 -4
  97. package/dist/internal/e10/auth/xiaoe.js +15 -3
  98. package/dist/shortcuts/asset/host.js +39 -1
  99. package/dist/shortcuts/asset/index.js +16 -2
  100. package/dist/shortcuts/asset/manifest.js +115 -1
  101. package/dist/shortcuts/asset/operations/audit-report.js +144 -0
  102. package/dist/shortcuts/asset/operations/registry.js +4 -0
  103. package/dist/shortcuts/asset/operations/write.js +7 -1
  104. package/dist/shortcuts/cowork/operations/read.js +13 -6
  105. package/dist/shortcuts/cowork/operations/shared.js +15 -0
  106. package/dist/shortcuts/hrm/host.js +51 -4
  107. package/dist/shortcuts/hrm/index.js +45 -26
  108. package/dist/shortcuts/hrm/manifest.js +17 -0
  109. package/dist/shortcuts/hrm/operations/employee.js +3 -7
  110. package/dist/shortcuts/hrm/operations/org.js +2 -4
  111. package/dist/shortcuts/hrm/operations/position.js +2 -4
  112. package/dist/shortcuts/hrm/operations/shared.js +21 -0
  113. package/dist/shortcuts/hrm/operations.js +34 -0
  114. package/dist/shortcuts/im/constants.js +163 -0
  115. package/dist/shortcuts/im/host.js +12 -5
  116. package/dist/shortcuts/im/operations/at-mention.js +4 -2
  117. package/dist/shortcuts/im/operations/file-user.js +3 -1
  118. package/dist/shortcuts/im/operations/msg-sync.js +219 -2
  119. package/dist/shortcuts/im/operations/msg-write.js +70 -30
  120. package/dist/shortcuts/invoice/invoice-record.js +4 -0
  121. package/dist/shortcuts/invoice/manifest.js +1 -1
  122. package/dist/shortcuts/invoice/operations/reim-auto.js +10 -7
  123. package/dist/shortcuts/invoice/read-enrichment.js +74 -7
  124. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1 -1
  125. package/dist/shortcuts/meeting/operations/rooms.js +7 -0
  126. package/dist/shortcuts/recruit-stage/operations/list.js +3 -2
  127. package/dist/shortcuts/recruit-stage/operations/profile.js +3 -2
  128. package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
  129. package/dist/shortcuts/recruit-stage/operations/shortlist.js +3 -2
  130. package/dist/shortcuts/recruit-stage/operations/tag.js +5 -0
  131. package/dist/shortcuts/workflow/operations/form.js +2 -1
  132. package/docs/agent-invoice.md +1 -1
  133. package/docs/e10-auth.md +14 -1
  134. package/docs/hrm.md +5 -1
  135. package/docs/invoice.md +1 -1
  136. package/docs/ziguanjia.md +5 -1
  137. package/package.json +1 -1
  138. package/skill-template/business-info.json +6 -1
  139. package/skill-template/domains/hrm.md +1 -1
  140. package/skill-template/domains/yepiaotong.md +1 -1
  141. package/skill-template/domains/ziguanjia.md +7 -2
  142. package/skills/weaver-e10-cowork/SKILL.md +13 -1
  143. package/skills/weaver-e10-hrm/SKILL.md +16 -2
  144. package/skills/weaver-e10-hrm/references/org.md +1 -1
  145. package/skills/weaver-e10-meeting/SKILL.md +1 -1
  146. package/skills/weaver-e10-recruit-stage/SKILL.md +24 -15
  147. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +14 -7
  148. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +12 -1
  149. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +18 -1
  150. package/skills/weaver-e10-recruit-stage/lib/resume-import-once.mjs +308 -0
  151. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +9 -4
  152. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +54 -15
  153. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +456 -93
  154. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +2 -2
  155. package/skills/weaver-e10-shared/SKILL.md +1 -1
  156. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +1 -1
  157. package/skills/weaver-e10-shared-report.html +874 -0
  158. package/skills/weaver-e10-workflow/SKILL.md +4 -4
  159. package/skills/weaver-e10-workflow/aiDeepRead/config.json +138 -142
  160. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +7 -7
  161. package/skills/weaver-e10-yepiaotong/SKILL.md +2 -2
  162. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +1 -1
  163. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +1 -1
  164. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +5 -3
  165. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +1 -1
  166. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1 -1
  167. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +34 -32
  168. package/skills/weaver-e10-yepiaotong.zip +0 -0
  169. package/skills/weaver-e10-yimiaoban/SKILL.md +12 -9
  170. package/skills/weaver-e10-yimiaoban/references/constants.md +291 -0
  171. package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -0
  172. package/skills/weaver-e10-yimiaoban/references/group-read.md +1 -0
  173. package/skills/weaver-e10-yimiaoban/references/group-write.md +1 -0
  174. package/skills/weaver-e10-yimiaoban/references/msg-read.md +10 -1
  175. package/skills/weaver-e10-yimiaoban/references/msg-write.md +3 -1
  176. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +1 -0
  177. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +175 -36
  178. package/skills/weaver-e10-ziguanjia/SKILL.md +26 -6
  179. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +1373 -96
  180. package/skills/weaver-e10-ziguanjia/references/ziguanjia-audit.md +63 -0
  181. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +5 -1
  182. package/skills/weaver-e10-ziguanjia/references/ziguanjia-idle.md +52 -0
  183. package/skills/weaver-e10-ziguanjia/references/ziguanjia-report.md +59 -0
  184. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  185. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  186. package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
@@ -40,7 +40,25 @@ export const ziguanjiaViewLink = {
40
40
  depreViewportPath: DEPRE_VIEWPORT_PATH,
41
41
  sceneFormTags: VIEW_LINK_SCENE_TAGS,
42
42
  };
43
- export const ziguanjiaFixed = { EB_INTERFACE_PK, ES_UNIQUE_INDENT, VIEW_LINK_SCENE_TAGS, DEPRE_VIEWPORT_PATH };
43
+ /** esbFlowId(动作流 ID)类标识:与 uniqueIndent 不是同一类型,不可混用。 */
44
+ const ES_FLOW_ID = {
45
+ /** 资产清查取数(只读);门禁豁免。 */
46
+ auditList: '907938775240413184',
47
+ /** 资产清查确认表写入(写操作);门禁豁免。 */
48
+ auditConfirm: '913634865562390528',
49
+ /** 资产上报写入(写操作);门禁豁免,moduleSource 固定 AISKILL。 */
50
+ reportApply: '915199285606354944',
51
+ };
52
+ /** 资产上报写入固定来源标识:缺失时服务端无法识别 dataList 声明类型。 */
53
+ const REPORT_MODULE_SOURCE = 'AISKILL';
54
+ export const ziguanjiaFixed = {
55
+ EB_INTERFACE_PK,
56
+ ES_UNIQUE_INDENT,
57
+ ES_FLOW_ID,
58
+ REPORT_MODULE_SOURCE,
59
+ VIEW_LINK_SCENE_TAGS,
60
+ DEPRE_VIEWPORT_PATH,
61
+ };
44
62
  /**
45
63
  * 每条 operation 的一句话用途,写入 schema 的 summary。
46
64
  *
@@ -67,6 +85,9 @@ const OPERATION_SUMMARIES = {
67
85
  'asset.purch': '发起资产采购申请(高风险写操作,会落库);入参 purchase_name/detail1',
68
86
  'asset.depre': '发起资产折旧计提(高风险写操作,会落库);入参 calc_month/company_ids',
69
87
  'asset.viewlink': '生成资产相关页面的查看链接;入参 scene/ids(可带 calc_month/anchor)',
88
+ 'asset.audit.list': '分页查询资产清查数据(只读,动作流 esbFlowId 取数;不纳入版本门禁);按 curPage/hasMore 翻页',
89
+ 'asset.audit.confirm': '写入资产清查确认表(高风险写操作,会落库;不纳入版本门禁);入参 records(编号图/外观图 ID 与判定)',
90
+ 'asset.report.apply': '资产上报写入(高风险写操作,会落库;不纳入版本门禁);入参 dataList(图片 ID/名称/类型/规格),moduleSource 固定 AISKILL',
70
91
  };
71
92
  function withSummaries(operations) {
72
93
  return operations.map((item) => ({
@@ -486,6 +507,83 @@ export const ziguanjiaOperations = [
486
507
  anyOf: [{ required: ['ids'] }, { required: ['calc_month'] }],
487
508
  },
488
509
  },
510
+ {
511
+ name: 'asset.audit.list',
512
+ risk: 'read',
513
+ fixed: { esbFlowId: ES_FLOW_ID.auditList },
514
+ inputSchema: {
515
+ type: 'object',
516
+ additionalProperties: false,
517
+ properties: {
518
+ esbFlowId: { type: 'string', pattern: '^\\d+$', description: '清查取数动作流 ID;默认使用部署期常量,换环境须重新确认' },
519
+ cur_page: { type: 'integer', minimum: 1, default: 1, description: '页码,从 1 起;hasMore=true 时 +1 继续' },
520
+ max_pages: { type: 'integer', minimum: 1, maximum: 100, default: 20, description: '单次最多翻页数,防止动作流限流失控' },
521
+ },
522
+ },
523
+ },
524
+ {
525
+ name: 'asset.audit.confirm',
526
+ risk: 'high-risk-write',
527
+ requiresConfirmation: true,
528
+ fixed: { esbFlowId: ES_FLOW_ID.auditConfirm },
529
+ inputSchema: {
530
+ type: 'object',
531
+ additionalProperties: false,
532
+ properties: {
533
+ records: {
534
+ type: 'array',
535
+ minItems: 1,
536
+ description: '清查确认记录;每张资产卡片两条(编号图、外观图各一条)',
537
+ items: {
538
+ type: 'object',
539
+ additionalProperties: false,
540
+ properties: {
541
+ except_remark: { type: 'string', description: '备注,原样取用' },
542
+ asset_image: { type: 'string', minLength: 1, description: '编号图 file_id(来自 caizhilian 上传)' },
543
+ zcwgtp: { type: 'string', minLength: 1, description: '外观图 file_id(来自 caizhilian 上传)' },
544
+ sure_type: { type: 'string', enum: ['0', '1'], description: '两图均 100 分传 0;任一低于 100(含缺失)传 1' },
545
+ },
546
+ required: ['asset_image', 'zcwgtp', 'sure_type'],
547
+ },
548
+ },
549
+ confirm: { const: true },
550
+ continuation: { type: 'string', minLength: 1 },
551
+ },
552
+ required: ['records'],
553
+ },
554
+ },
555
+ {
556
+ name: 'asset.report.apply',
557
+ risk: 'high-risk-write',
558
+ requiresConfirmation: true,
559
+ fixed: { esbFlowId: ES_FLOW_ID.reportApply, moduleSource: REPORT_MODULE_SOURCE },
560
+ inputSchema: {
561
+ type: 'object',
562
+ additionalProperties: false,
563
+ properties: {
564
+ dataList: {
565
+ type: 'array',
566
+ minItems: 1,
567
+ description: '上报资产明细;字段名固定 asset_aspc(不得改写为 asset_spec)',
568
+ items: {
569
+ type: 'object',
570
+ additionalProperties: false,
571
+ properties: {
572
+ img_id: { type: 'string', minLength: 1, description: '图片上传后的 file_id' },
573
+ asset_name: { type: 'string', minLength: 1, description: '资产名称,空时以资产编号兜底' },
574
+ asset_type: { type: 'string', description: '资产类型' },
575
+ asset_aspc: { type: 'string', description: '规格型号(固定字段名)' },
576
+ count: { type: 'integer', minimum: 1, default: 1 },
577
+ },
578
+ required: ['img_id', 'asset_name'],
579
+ },
580
+ },
581
+ confirm: { const: true },
582
+ continuation: { type: 'string', minLength: 1 },
583
+ },
584
+ required: ['dataList'],
585
+ },
586
+ },
489
587
  ];
490
588
  export const ziguanjiaManifest = {
491
589
  schemaVersion: 1,
@@ -509,6 +607,22 @@ export const ziguanjiaManifest = {
509
607
  name: 'asset.file.upload',
510
608
  reason: '图片上传依赖 weaver-e10-caizhilian 文件上传模块,CLI 不内置文件上传能力,create 仅接受已上传得到的裸 file_id。',
511
609
  },
610
+ {
611
+ name: 'asset.idle.list',
612
+ reason: '闲置资产分析(动作流取数 + 聚合统计)由独立模块 asset-idle 提供(asset-idle.idle.list / asset-idle.idle.stats);本模块不重复命令面,Skill 侧路由到该模块。',
613
+ },
614
+ {
615
+ name: 'asset.audit.render',
616
+ reason: '资产清查 HTML 渲染、图片智能识别与匹配依赖源资料自带的 Python 脚本与 HTML 模板,Skill 安装会过滤 scripts/ 与 assets/,不能作为随包能力交付;CLI 只暴露取数与清查确认表写入。',
617
+ },
618
+ {
619
+ name: 'asset.report.render',
620
+ reason: '资产上报的图片识别与 HTML 列表渲染依赖源资料自带脚本/模板,不随 Skill 包分发;CLI 只暴露上报写入(dataList),图片上传委托 caizhilian 模块。',
621
+ },
622
+ {
623
+ name: 'asset.disposal.start',
624
+ reason: '闲置资产处置发起须经「资产处置申请」流程(workflow.createForm / createRequest),属 weaver-e10-workflow 能力;本模块不重复实现,且不直接回写资产数据。',
625
+ },
512
626
  ],
513
627
  };
514
628
  export function hasZiguanjiaOperation(operation) {
@@ -0,0 +1,144 @@
1
+ import { ziguanjiaFixed } from '../manifest.js';
2
+ import { ziguanjiaValidationError } from '../errors.js';
3
+ import { asObject, actionFlowResult, ok } from './shared.js';
4
+ import { ZiguanjiaPreparedWriteOperation } from './write.js';
5
+ const FLOW = ziguanjiaFixed.ES_FLOW_ID;
6
+ /** 清查取数返回值路径与 asset-idle 一致:actionData.responseData.customData.mainTable。 */
7
+ function pageData(result) {
8
+ const table = actionFlowResult(result).mainTable;
9
+ const raw = table?.dataList ?? table?.datas ?? table?.items ?? table?.auditList;
10
+ return {
11
+ items: Array.isArray(raw) ? raw : [],
12
+ hasMore: table?.hasMore === true || String(table?.hasMore ?? '').toLowerCase() === 'true',
13
+ };
14
+ }
15
+ /**
16
+ * 资产清查取数(只读,门禁豁免):动作流 esbFlowId=907938775240413184,
17
+ * curPage 从 1 起、hasMore=true 继续;不就"是否触发动作流"向用户征询确认。
18
+ */
19
+ export class ZiguanjiaAuditListOperation {
20
+ name = 'asset.audit.list';
21
+ async execute(input, context) {
22
+ const body = asObject(input, this.name);
23
+ const flowId = typeof body.esbFlowId === 'string' && /^\d+$/u.test(body.esbFlowId)
24
+ ? body.esbFlowId : String(FLOW.auditList);
25
+ const startPage = Number(body.cur_page ?? 1);
26
+ const maxPages = Number(body.max_pages ?? 20);
27
+ if (!Number.isInteger(startPage) || startPage < 1) {
28
+ throw ziguanjiaValidationError('cur_page_invalid', 'cur_page 必须是 >= 1 的整数');
29
+ }
30
+ if (!Number.isInteger(maxPages) || maxPages < 1 || maxPages > 100) {
31
+ throw ziguanjiaValidationError('max_pages_invalid', 'max_pages 必须是 1..100 的整数');
32
+ }
33
+ const all = [];
34
+ let curPage = startPage;
35
+ let hasMore = true;
36
+ let truncated = false;
37
+ while (hasMore) {
38
+ const result = await context.host.flowByApplication({
39
+ esbFlowId: flowId,
40
+ mainTable: { curPage: String(curPage) },
41
+ operation: this.name,
42
+ });
43
+ const page = pageData(result);
44
+ all.push(...page.items);
45
+ hasMore = page.hasMore;
46
+ if (!hasMore)
47
+ break;
48
+ if (curPage - startPage + 1 >= maxPages) {
49
+ truncated = true;
50
+ break;
51
+ }
52
+ curPage += 1;
53
+ }
54
+ return ok('COMPLETE', {
55
+ esbFlowId: flowId,
56
+ items: all,
57
+ count: all.length,
58
+ pages: truncated ? maxPages : curPage - startPage + 1,
59
+ hasMore,
60
+ truncated,
61
+ });
62
+ }
63
+ }
64
+ /**
65
+ * 资产清查确认表写入(高风险写,门禁豁免):动作流 esbFlowId=913634865562390528。
66
+ * 每张资产卡片两条(编号图 / 外观图各一条);except_remark 原样取用,sure_type 0/1。
67
+ */
68
+ export class ZiguanjiaAuditConfirmOperation extends ZiguanjiaPreparedWriteOperation {
69
+ skipVersionGate = true;
70
+ constructor() {
71
+ super('asset.audit.confirm');
72
+ }
73
+ async prepare(body, _context) {
74
+ const records = Array.isArray(body.records) ? body.records : [];
75
+ if (records.length === 0)
76
+ throw ziguanjiaValidationError('input_required', 'records 至少一条清查确认记录');
77
+ for (const [index, record] of records.entries()) {
78
+ if (!record || typeof record !== 'object') {
79
+ throw ziguanjiaValidationError('input_invalid', `records[${index}] 必须是对象`);
80
+ }
81
+ if (!record.asset_image || !record.zcwgtp) {
82
+ throw ziguanjiaValidationError('input_required', `records[${index}] 必须提供编号图与外观图 ID`);
83
+ }
84
+ if (record.sure_type !== '0' && record.sure_type !== '1') {
85
+ throw ziguanjiaValidationError('input_invalid', `records[${index}].sure_type 只能是 0 或 1`);
86
+ }
87
+ }
88
+ return {
89
+ preview: { operation: 'audit.confirm', esbFlowId: FLOW.auditConfirm, records },
90
+ confirmationText: `即将写入资产清查确认表(${records.length} 条记录)。确认后执行。`,
91
+ commit: { esbFlowId: FLOW.auditConfirm, records },
92
+ };
93
+ }
94
+ async apply(commit, context) {
95
+ const result = await context.host.flowByApplication({
96
+ esbFlowId: String(commit.esbFlowId),
97
+ mainTable: { dataList: commit.records },
98
+ operation: this.name,
99
+ });
100
+ return actionFlowResult(result);
101
+ }
102
+ }
103
+ /**
104
+ * 资产上报写入(高风险写,门禁豁免):动作流 esbFlowId=915199285606354944,
105
+ * moduleSource 固定 AISKILL,dataList 传数组对象(不 JSON 字符串、不双重编码)。
106
+ */
107
+ export class ZiguanjiaReportApplyOperation extends ZiguanjiaPreparedWriteOperation {
108
+ skipVersionGate = true;
109
+ constructor() {
110
+ super('asset.report.apply');
111
+ }
112
+ async prepare(body, _context) {
113
+ const dataList = Array.isArray(body.dataList) ? body.dataList : [];
114
+ if (dataList.length === 0)
115
+ throw ziguanjiaValidationError('input_required', 'dataList 至少一条上报记录');
116
+ for (const [index, item] of dataList.entries()) {
117
+ if (!item || typeof item !== 'object') {
118
+ throw ziguanjiaValidationError('input_invalid', `dataList[${index}] 必须是对象`);
119
+ }
120
+ if (!item.img_id || !item.asset_name) {
121
+ throw ziguanjiaValidationError('input_required', `dataList[${index}] 必须提供 img_id 与 asset_name`);
122
+ }
123
+ }
124
+ return {
125
+ preview: {
126
+ operation: 'report.apply',
127
+ esbFlowId: FLOW.reportApply,
128
+ moduleSource: ziguanjiaFixed.REPORT_MODULE_SOURCE,
129
+ dataList,
130
+ },
131
+ confirmationText: `即将提交资产上报(${dataList.length} 条记录)。确认后执行。`,
132
+ commit: { esbFlowId: FLOW.reportApply, dataList },
133
+ };
134
+ }
135
+ async apply(commit, context) {
136
+ const result = await context.host.flowByApplication({
137
+ esbFlowId: String(commit.esbFlowId),
138
+ mainTable: { dataList: commit.dataList },
139
+ operation: this.name,
140
+ moduleSource: ziguanjiaFixed.REPORT_MODULE_SOURCE,
141
+ });
142
+ return actionFlowResult(result);
143
+ }
144
+ }
@@ -2,6 +2,7 @@ import { ziguanjiaValidationError } from '../errors.js';
2
2
  import { ziguanjiaFixed, ziguanjiaOperations } from '../manifest.js';
3
3
  import { ZiguanjiaGateCheckOperation, ZiguanjiaQueryOperation, ZiguanjiaResolveOperation, } from './query.js';
4
4
  import { ZiguanjiaViewLinkOperation } from './viewlink.js';
5
+ import { ZiguanjiaAuditConfirmOperation, ZiguanjiaAuditListOperation, ZiguanjiaReportApplyOperation, } from './audit-report.js';
5
6
  import { ZiguanjiaCreateOperation, ZiguanjiaDepreOperation, ZiguanjiaPurchOperation, ZiguanjiaRepairCreateOperation, ZiguanjiaRepairQueryOperation, ZiguanjiaReturnCreateOperation, ZiguanjiaReturnQueryOperation, ZiguanjiaUpdateOperation, ZiguanjiaUseOperation, } from './write.js';
6
7
  const EB = ziguanjiaFixed.EB_INTERFACE_PK;
7
8
  function buildRegistry() {
@@ -63,6 +64,9 @@ function buildRegistry() {
63
64
  new ZiguanjiaPurchOperation(),
64
65
  new ZiguanjiaDepreOperation(),
65
66
  new ZiguanjiaViewLinkOperation(),
67
+ new ZiguanjiaAuditListOperation(),
68
+ new ZiguanjiaAuditConfirmOperation(),
69
+ new ZiguanjiaReportApplyOperation(),
66
70
  ];
67
71
  for (const handler of handlers) {
68
72
  if (registry.has(handler.name))
@@ -17,12 +17,18 @@ function todayStr() {
17
17
  */
18
18
  export class ZiguanjiaPreparedWriteOperation {
19
19
  name;
20
+ /**
21
+ * 版本门禁豁免(源资料约定资产清查 / 资产上报不纳入门禁)。
22
+ * 其余写操作保持默认 false,任何写库前都必须过门禁。
23
+ */
24
+ skipVersionGate = false;
20
25
  constructor(name) {
21
26
  this.name = name;
22
27
  }
23
28
  async execute(input, context) {
24
29
  const body = asObject(input, this.name);
25
- await ensureVersionGate(context.host, this.name);
30
+ if (!this.skipVersionGate)
31
+ await ensureVersionGate(context.host, this.name);
26
32
  if (body.confirm !== true || typeof body.continuation !== 'string' || body.continuation === '') {
27
33
  const prepared = await this.prepare(body, context);
28
34
  const token = await context.continuation.issue({ operation: this.name, ...prepared.commit });
@@ -1,5 +1,6 @@
1
+ import { coworkValidationError } from '../errors.js';
1
2
  import { READ, SCHEMA_ID, SCHEMA_PAGE_CURRENT, SCHEMA_PAGE_SIZE, coworkSuccess, schemaOf, } from './types.js';
2
- import { assertEnum, buildListBody, compact, normalizeList, toId, toPositiveInt, unwrapData, } from './shared.js';
3
+ import { assertEnum, buildListBody, compact, normalizeList, requireId, toId, toPositiveInt, unwrapData, } from './shared.js';
3
4
  /**
4
5
  * 列表 scope → 接口路径。11 个列表结构一致(JSON + 标准列表 envelope),
5
6
  * 因此收敛为单个 `cowork.list`:同一业务动作(查协作/事项/申请),用 scope 区分数据集,
@@ -169,7 +170,7 @@ const coworkView = {
169
170
  risk: READ,
170
171
  inputSchema: schemaOf({ id: { ...SCHEMA_ID, description: '协作 id' } }, { required: ['id'] }),
171
172
  handler: async (args, { host }) => {
172
- const id = toId(args.id, 'id');
173
+ const id = requireId(args.id, 'id');
173
174
  const response = await host.request({
174
175
  method: 'POST',
175
176
  path: '/api/cowork/view/viewCowork',
@@ -194,7 +195,7 @@ const coworkDiscussList = {
194
195
  orderAsc: { type: 'boolean', description: '是否升序,默认 false(倒序)' },
195
196
  }, { required: ['coworkId'] }),
196
197
  handler: async (args, { host }) => {
197
- const coworkId = toId(args.coworkId, 'coworkId');
198
+ const coworkId = requireId(args.coworkId, 'coworkId');
198
199
  const body = compact({
199
200
  coworkId,
200
201
  current: toPositiveInt(args.current, 'current') ?? 1,
@@ -230,8 +231,14 @@ const coworkParticipantList = {
230
231
  pageSize: SCHEMA_PAGE_SIZE,
231
232
  }, { required: ['scope', 'id'] }),
232
233
  handler: async (args, { host }) => {
234
+ // 2026-12-01 复测:scope、id 同为必填,空参时一次报全,避免"补一个再报一个"被误读成漏校验
235
+ const lacksScope = typeof args.scope !== 'string' || !args.scope;
236
+ const lacksId = args.id === undefined || args.id === null || String(args.id).trim() === '';
237
+ if (lacksScope && lacksId) {
238
+ throw coworkValidationError('params_required', '缺少必填参数:scope(all / share / quit)、id(协作 id)');
239
+ }
233
240
  const scope = assertEnum(args.scope, PARTICIPANT_SCOPES, 'scope');
234
- const id = toId(args.id, 'id');
241
+ const id = requireId(args.id, 'id');
235
242
  if (scope === 'share') {
236
243
  const response = await host.request({
237
244
  method: 'POST',
@@ -283,7 +290,7 @@ const coworkResource = {
283
290
  risk: READ,
284
291
  inputSchema: schemaOf({ id: { ...SCHEMA_ID, description: '协作 id' } }, { required: ['id'] }),
285
292
  handler: async (args, { host }) => {
286
- const id = toId(args.id, 'id');
293
+ const id = requireId(args.id, 'id');
287
294
  const response = await host.request({
288
295
  method: 'POST',
289
296
  path: '/api/cowork/view/resourceData',
@@ -306,7 +313,7 @@ const coworkVoteLog = {
306
313
  pageSize: SCHEMA_PAGE_SIZE,
307
314
  }, { required: ['id'] }),
308
315
  handler: async (args, { host }) => {
309
- const id = toId(args.id, 'id');
316
+ const id = requireId(args.id, 'id');
310
317
  const body = compact({
311
318
  id,
312
319
  current: toPositiveInt(args.current, 'current') ?? 1,
@@ -27,6 +27,21 @@ export function toId(value, field) {
27
27
  }
28
28
  return text;
29
29
  }
30
+ /**
31
+ * 必填协作 ID(2026-12-01 授权后复测)。
32
+ * `toId(undefined)` 返回 undefined,旧 handler 直接把 `form: { id: undefined }` 打到上游,
33
+ * 空参调用被服务端判成 400/500、错误码落成 E-9999。schema 里 required 的 ID 一律走本函数,
34
+ * 空值在本地拦成 E-0003(validation/id_required)。
35
+ */
36
+ export function requireId(value, field) {
37
+ if (value === undefined || value === null || value === '') {
38
+ throw coworkValidationError('id_required', `${field} 必填(协作 id 为数字 ID)`);
39
+ }
40
+ const id = toId(value, field);
41
+ if (!id)
42
+ throw coworkValidationError('id_required', `${field} 必填(协作 id 为数字 ID)`);
43
+ return id;
44
+ }
30
45
  export function toIdList(value, field) {
31
46
  if (value === undefined || value === null)
32
47
  return undefined;
@@ -39,6 +39,29 @@ function businessCode(value) {
39
39
  return code;
40
40
  return undefined;
41
41
  }
42
+ /**
43
+ * 飞书审计 H-01:E10 侧「接口未装配 / 本租户未开通」的典型服务端文案。
44
+ * 实测 employee.detail / org.detail 回「系统内部错误」、subordinate.by-id 回「没有权限」,
45
+ * 原样抛出去用户只看到一句「系统内部错误」,无法自助判断该找谁。
46
+ * 这里把这类服务端失败改写成可操作的提示,原始文案保留在 `details.message` 便于排查。
47
+ */
48
+ const UNAVAILABLE_MESSAGE = /系统内部错误|接口标识不存在|接口不存在|接口未实现|未装配|尚未启用/;
49
+ const PERMISSION_MESSAGE = /没有权限|无权限|权限不足|未授权/;
50
+ /**
51
+ * `confirmed=true` 表示服务端文案已明确指向「未装配 / 未开通」(如「接口标识不存在」);
52
+ * 仅凭 HTTP 500 不能下这个结论,因此 `confirmed=false` 时如实写成两种可能,避免误导。
53
+ */
54
+ function operationUnavailableMessage(operation, confirmed = false) {
55
+ const scope = operation ? `(${operation})` : '';
56
+ const cause = confirmed
57
+ ? 'E10 服务端未装配或未开通对应接口'
58
+ : 'E10 服务端返回 HTTP 500(可能是对应接口未装配 / 未开通,也可能是服务端临时故障)';
59
+ return `组织管理查询能力${scope}在当前租户不可用:${cause}。请联系管理员确认本租户已开通组织管理模块、并装配对应的 ebuilder / ESB 应用后重试。这不是 CLI 参数或会话问题;若为临时故障可稍后重试。`;
60
+ }
61
+ function permissionDeniedMessage(rawMessage, operation) {
62
+ const scope = operation ? `(${operation})` : '';
63
+ return `当前账号缺少该组织数据的可见范围${scope}:${rawMessage}。请联系管理员为当前账号开启组织管理读接口 / 对应组织数据可见范围后重试。CLI 参数与会话均正常,重试不会成功。`;
64
+ }
42
65
  function assertPath(requestPath) {
43
66
  if (typeof requestPath !== 'string' || !requestPath.startsWith('/') || requestPath.startsWith('//')) {
44
67
  throw hrmValidationError('path_invalid', '请求路径必须是相对绝对路径');
@@ -120,6 +143,14 @@ export function createHrmHost(ctx, dependencies = {}) {
120
143
  }
121
144
  if (response.parseError) {
122
145
  if (response.status < 200 || response.status >= 300) {
146
+ // 500 且正文不是 JSON:多半是网关层直接报「接口不存在 / 系统内部错误」。
147
+ if (response.status === 500) {
148
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation), {
149
+ code: response.status,
150
+ details: { status: response.status },
151
+ exitCode: 1,
152
+ });
153
+ }
123
154
  throw new HrmCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
124
155
  code: response.status,
125
156
  details: { status: response.status },
@@ -129,18 +160,34 @@ export function createHrmHost(ctx, dependencies = {}) {
129
160
  throw hrmNetworkError('protocol', `接口返回不是合法 JSON(HTTP ${response.status})`, { retryable: false });
130
161
  }
131
162
  if (response.status < 200 || response.status >= 300) {
163
+ const rawMessage = businessMessage(response.value);
164
+ const confirmedUnavailable = UNAVAILABLE_MESSAGE.test(rawMessage);
165
+ if (response.status === 500 || confirmedUnavailable) {
166
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation, confirmedUnavailable), { code: response.status, details: { status: response.status, message: rawMessage }, exitCode: 1 });
167
+ }
168
+ if (response.status === 403 || PERMISSION_MESSAGE.test(rawMessage)) {
169
+ throw new HrmCliError('api', 'permission_denied', permissionDeniedMessage(rawMessage, operation), {
170
+ code: response.status,
171
+ details: { status: response.status, message: rawMessage },
172
+ exitCode: 1,
173
+ });
174
+ }
132
175
  throw new HrmCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
133
176
  code: response.status,
134
- details: { status: response.status, message: businessMessage(response.value) },
177
+ details: { status: response.status, message: rawMessage },
135
178
  exitCode: 1,
136
179
  });
137
180
  }
138
181
  if (!isBusinessSuccess(response.value)) {
139
182
  const code = businessCode(response.value);
140
183
  const message = businessMessage(response.value);
141
- // 403 = AI 开放接口 / HRM 读权限未开启,提示明确处置而非盲目重试。
142
- if (code === 403) {
143
- throw new HrmCliError('api', 'permission_denied', message || '当前租户未开启组织管理读接口,请联系管理员开启后再试', {
184
+ // 403 = AI 开放接口 / HRM 读权限未开启;「没有权限」也可能藏在 HTTP 200 的 WeaResult 里。
185
+ if (code === 403 || PERMISSION_MESSAGE.test(message)) {
186
+ throw new HrmCliError('api', 'permission_denied', permissionDeniedMessage(message || '当前账号无该组织数据的访问权限', operation), { code, details: { code, message }, exitCode: 1 });
187
+ }
188
+ // 500 / 「系统内部错误」/「接口标识不存在」= 服务端未装配或未开通,不要原样抛给用户。
189
+ if (UNAVAILABLE_MESSAGE.test(message)) {
190
+ throw new HrmCliError('api', 'operation_unavailable', operationUnavailableMessage(operation, true), {
144
191
  code,
145
192
  details: { code, message },
146
193
  exitCode: 1,
@@ -122,6 +122,49 @@ function failureEnvelope(error) {
122
122
  error: toErrorEnvelope(error),
123
123
  };
124
124
  }
125
+ /** 首屏最多展示几条 withheld 摘要;超出的用 withheldTruncated 提示去看 --full。 */
126
+ const WITHHELD_BRIEF_MAX = 6;
127
+ const WITHHELD_REASON_MAX_CHARS = 80;
128
+ /**
129
+ * `hrm schema` 的默认精简首屏。
130
+ *
131
+ * 2026-11-30 飞书审计 HR-02:原先首屏只给 operations,模型看不到任何「不支持什么」,
132
+ * 遇到组织变更/岗位调整等诉求只能试错。这里与全局 G-10 对齐:先给 withheldCount,
133
+ * 再给最多 6 条 name + 截断 reason(与 `manifestView --list` 的 80 字口径一致),
134
+ * 完整原因走 `hrm schema --full`。
135
+ */
136
+ export function hrmSchemaBrief() {
137
+ const withheld = hrmManifest.withheldOperations;
138
+ return {
139
+ schemaVersion: hrmManifest.schemaVersion,
140
+ name: hrmManifest.name,
141
+ version: hrmManifest.version,
142
+ withheldCount: withheld.length,
143
+ withheldOperations: withheld.slice(0, WITHHELD_BRIEF_MAX).map((item) => ({
144
+ name: item.name,
145
+ reason: item.reason.length > WITHHELD_REASON_MAX_CHARS
146
+ ? `${item.reason.slice(0, WITHHELD_REASON_MAX_CHARS)}…`
147
+ : item.reason,
148
+ })),
149
+ ...(withheld.length > WITHHELD_BRIEF_MAX ? { withheldTruncated: true } : {}),
150
+ operations: hrmManifest.operations.map((o) => {
151
+ const anyOf = Array.isArray(o.inputSchema?.anyOf) ? o.inputSchema.anyOf : null;
152
+ // 查询类的「至少一个收敛条件」用 inputSchema.anyOf 表达,精简视图原先只打印
153
+ // required(=[]),看起来像「无需入参」,实测空入参会被 E-0003 empty_condition 拒。
154
+ const atLeastOne = anyOf
155
+ ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))]
156
+ : [];
157
+ return {
158
+ name: o.name,
159
+ summary: o.summary,
160
+ risk: o.risk,
161
+ params: Object.keys(o.inputSchema?.properties ?? {}),
162
+ required: o.inputSchema?.required ?? [],
163
+ ...(atLeastOne.length ? { atLeastOne } : {}),
164
+ };
165
+ }),
166
+ };
167
+ }
125
168
  async function executeAndPrint(ctx, operation, input) {
126
169
  try {
127
170
  const result = await executeHrmOperation(operation, input, {
@@ -159,32 +202,8 @@ export const hrmShortcut = {
159
202
  ctx.output.write(hrmManifest, { json: true });
160
203
  return;
161
204
  }
162
- // 精简版:name + summary + 参数名 + 必填项,供 Agent 快速路由,避免全量 schema 撑爆上下文。
163
- //
164
- // `atLeastOne`:查询类的「至少一个收敛条件」用 inputSchema.anyOf 表达,
165
- // 精简视图原先只打印 required(=[]),看起来像「无需入参」,实测空入参会被
166
- // E-0003 empty_condition 拒(hrm.employee.query / org.query / position.query)。
167
- // 这里把 anyOf 各分支的 required 并成扁平列表回给调用方,避免再靠报错反推。
168
- const brief = {
169
- schemaVersion: hrmManifest.schemaVersion,
170
- name: hrmManifest.name,
171
- version: hrmManifest.version,
172
- operations: hrmManifest.operations.map((o) => {
173
- const anyOf = Array.isArray(o.inputSchema?.anyOf) ? o.inputSchema.anyOf : null;
174
- const atLeastOne = anyOf
175
- ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))]
176
- : [];
177
- return {
178
- name: o.name,
179
- summary: o.summary,
180
- risk: o.risk,
181
- params: Object.keys(o.inputSchema?.properties ?? {}),
182
- required: o.inputSchema?.required ?? [],
183
- ...(atLeastOne.length ? { atLeastOne } : {}),
184
- };
185
- }),
186
- };
187
- ctx.output.write(brief, { json: true });
205
+ // 精简版:name + summary + 参数名 + 必填项 + 不支持能力摘要,供 Agent 一次看清可用与不可用边界。
206
+ ctx.output.write(hrmSchemaBrief(), { json: true });
188
207
  }));
189
208
  hrm.command('run')
190
209
  .description('Run an hrm operation with JSON input')
@@ -5,6 +5,12 @@ import { hrmOperationDefinitions } from './operations/registry.js';
5
5
  * - `hrm.org.virtuals`:多维(组织维度)清单**不单独暴露**——维度获取与匹配已并入
6
6
  * `hrm.org.resolve` 内部;「列出该租户有哪些多维」属暂不支持的诉求,
7
7
  * 不要构造一个不存在的维度名去套 `availableVirtuals`,也不要绕过。
8
+ * - `hrm.org.change` / `hrm.position.adjust`:组织变更、岗位调整是**写操作**,本模块
9
+ * 全部为只读查询(见 SKILL.md 首段),不提供任何写能力;替代路径是 E10 界面自助操作。
10
+ *
11
+ * 2026-11-30 飞书审计 HR-02:这份清单原先只用于运行时过滤,模型在 `hrm schema` 首屏
12
+ * 完全看不到,遇到写操作诉求只能试错。现在同时透出 `withheldCount` 与首屏摘要,
13
+ * SKILL.md 也补了「不支持的能力」章节。
8
14
  */
9
15
  const WITHHELD = [
10
16
  {
@@ -15,6 +21,14 @@ const WITHHELD = [
15
21
  name: 'hrm.org.virtuals',
16
22
  reason: '多维(组织维度)清单不单独暴露:维度获取与名称匹配已并入 hrm.org.resolve 内部(其 not_found 会顺带回 availableVirtuals 供纠错)。「列出该租户有哪些多维」暂不支持,不要构造不存在的维度名去套 availableVirtuals,也不要编造或绕过。',
17
23
  },
24
+ {
25
+ name: 'hrm.org.change',
26
+ reason: '组织变更(新增/修改/删除部门、分部)是写操作,本模块全部为只读查询,不提供该能力;替代做法:请到 E10 组织管理界面自助操作,不要编造 hrm 写 operation。',
27
+ },
28
+ {
29
+ name: 'hrm.position.adjust',
30
+ reason: '岗位调整(人员调岗、新增/删除岗位)是写操作,本模块全部为只读查询,不提供该能力;替代做法:请到 E10 组织管理界面自助操作,不要编造 hrm 写 operation。',
31
+ },
18
32
  ];
19
33
  function buildOperations() {
20
34
  return hrmOperationDefinitions().map((definition) => ({
@@ -35,5 +49,8 @@ export const hrmManifest = {
35
49
  sourceSkill: 'weaver-e10-hrm',
36
50
  capabilities: ['employee', 'org', 'position'],
37
51
  operations: buildOperations(),
52
+ // 2026-11-30 飞书审计 HR-02:首屏必须先给总数,模型才知道边界之外还有多少条,
53
+ // 再看摘要或 --full 明细;与其他域 G-10 的口径保持一致。
54
+ withheldCount: WITHHELD.length,
38
55
  withheldOperations: WITHHELD,
39
56
  };
@@ -1,6 +1,6 @@
1
1
  import { HrmCliError, hrmValidationError } from '../errors.js';
2
2
  import { READ, SCHEMA_ID, SCHEMA_ID_LIST, SCHEMA_PAGE, hrmSuccess, schemaOf, } from './types.js';
3
- import { browserBaseBody, inferEmployeeField, orgLink, personLink, resolveDepartmentIdByName, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
3
+ import { browserBaseBody, inferEmployeeField, orgLink, personLink, requireId, resolveDepartmentIdByName, toNumber, toPositiveInt, toStringIdList, } from './shared.js';
4
4
  const EMPLOYEE_STATUS = ['normal', '6'];
5
5
  const SUBORDINATE_SCOPE = ['direct', 'indirect', 'all'];
6
6
  const SUBORDINATE_BYID_SCOPE = ['direct', 'indirect'];
@@ -385,9 +385,7 @@ const employeeDetail = {
385
385
  full: { type: 'boolean', description: '默认 false:只回核心业务字段(姓名/工号/组织/岗位/上级/助理/联系方式/办公地点等,体积约为完整卡片的 1/5);true:回完整人员卡片(含 password、last_android、hideFieldList、setting、*_admin 等登录/管理元数据)' },
386
386
  }, { required: ['id'] }),
387
387
  handler: async (args, { host }) => {
388
- const id = String(args.id).trim();
389
- if (!id)
390
- throw hrmValidationError('id_required', 'id 必填');
388
+ const id = requireId(args.id);
391
389
  const session = await host.getSession();
392
390
  const baseUrl = session.baseUrl.replace(/\/+$/, '');
393
391
  // readOnly=true 必需:非只读且非本人/非基础信息管理员时服务端会拒绝(checkCardHasRight)。
@@ -463,9 +461,7 @@ const subordinateById = {
463
461
  pageSize: { ...SCHEMA_ID, description: '每页条数,默认 10' },
464
462
  }, { required: ['id'] }),
465
463
  handler: async (args, { host }) => {
466
- const id = String(args.id).trim();
467
- if (!id)
468
- throw hrmValidationError('id_required', 'id 必填');
464
+ const id = requireId(args.id);
469
465
  const scope = args.scope === undefined ? 'direct' : String(args.scope);
470
466
  const path = scope === 'indirect'
471
467
  ? `/api/bs/hrm/user/myIndirectSubordinates/${id}`