weaver-work-cli 0.1.42 → 0.1.44
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/README.md +17 -0
- package/dist/chunks/{archive-J4I6MCKF.js → archive-P6TBQGKL.js} +13 -5
- package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-7TQ2NXOH.js} +12 -5
- package/dist/chunks/{asset-L7D4FAOZ.js → asset-3ELRG37G.js} +11 -4
- package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-WIGMUFMD.js} +7 -3
- package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-E3276UOV.js} +5 -4
- package/dist/chunks/{blog-BVGQ7NZL.js → blog-C5NMZAAC.js} +11 -4
- package/dist/chunks/{caizhilian-SAADNFD6.js → caizhilian-5XSM2DFP.js} +13 -6
- package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-FI2WNSBO.js} +12 -5
- package/dist/chunks/{chunk-YRSZQUD2.js → chunk-3YBDYOC4.js} +3 -3
- package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
- package/dist/chunks/chunk-6N4JPNFL.js +76 -0
- package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
- package/dist/chunks/chunk-7BDPM5ST.js +11 -0
- package/dist/chunks/{chunk-EKWAQSLU.js → chunk-BCVYBYYT.js} +432 -2248
- package/dist/chunks/{chunk-W7BEHOSR.js → chunk-CWYGFU5B.js} +2 -2
- package/dist/chunks/{chunk-NOODWMCL.js → chunk-D4ADSZ7H.js} +1 -1
- package/dist/chunks/{chunk-SA6VBIHY.js → chunk-ETNJSKMM.js} +214 -16
- package/dist/chunks/{chunk-BBKDXQEC.js → chunk-F4E4EM35.js} +3 -3
- package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-FAZTGX7S.js} +6 -6
- package/dist/chunks/{chunk-NKZRQXST.js → chunk-FRZKBMSW.js} +52 -36
- package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
- package/dist/chunks/{chunk-GEWYMQME.js → chunk-GAMZLAG2.js} +1 -1
- package/dist/chunks/{chunk-R4CHUSKC.js → chunk-GM6J7Q4B.js} +4 -4
- package/dist/chunks/{chunk-APVFJUQH.js → chunk-GRDRG6HP.js} +3 -3
- package/dist/chunks/{chunk-LDZQPUIA.js → chunk-HIT4Y6OI.js} +1 -1
- package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
- package/dist/chunks/{chunk-LADPYOWC.js → chunk-IAZ3UPY6.js} +3 -3
- package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
- package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
- package/dist/chunks/{chunk-BIPYLLVS.js → chunk-N4M2DDFE.js} +15 -15
- package/dist/chunks/{chunk-QKNKR4RH.js → chunk-OF4S23UB.js} +4 -4
- package/dist/chunks/{chunk-JPRO6ER2.js → chunk-PC7VKEB5.js} +57 -60
- package/dist/chunks/{chunk-4PD5NWAX.js → chunk-PUQS5MWL.js} +2 -2
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
- package/dist/chunks/{chunk-72CKAUAG.js → chunk-QVSWRLLU.js} +7 -5
- package/dist/chunks/{chunk-4RAE6JXP.js → chunk-TA7FXXJD.js} +6 -3
- package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
- package/dist/chunks/{chunk-FOAA27U5.js → chunk-UFIT2UU3.js} +16 -4
- package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
- package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
- package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
- package/dist/chunks/{chunk-G4UR6NXN.js → chunk-WSF4NNMR.js} +3 -3
- package/dist/chunks/chunk-XHK4MDR5.js +2497 -0
- package/dist/chunks/{chunk-3KTFS4IA.js → chunk-XNIK66I4.js} +19 -9
- package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
- package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
- package/dist/chunks/{chunk-GHXCDPTM.js → chunk-Z7VYWPZV.js} +1 -1
- package/dist/chunks/{conflict-F2OMZRTO.js → conflict-ARLSZJ6V.js} +4 -3
- package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
- package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
- package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
- package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
- package/dist/chunks/{contract-5BETHRSG.js → contract-DNIIW5VJ.js} +13 -5
- package/dist/chunks/{cowork-3MN6EQQO.js → cowork-GMLRGVIW.js} +11 -4
- package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-J22BO65E.js} +8 -7
- package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-ANV2FHYV.js} +12 -7
- package/dist/chunks/{ehr-KMOJULKG.js → ehr-GSTGAIY3.js} +266 -24
- package/dist/chunks/{employee-SAK2QYXX.js → employee-22BGJ3QS.js} +3 -3
- package/dist/chunks/{env-LB7NBL2O.js → env-BX3VRFS7.js} +4 -3
- package/dist/chunks/{esb-W2PJCFCX.js → esb-ATAIASX2.js} +12 -7
- package/dist/chunks/{factory-6ZFQXQ46.js → factory-PETTFME6.js} +3 -2
- package/dist/chunks/{fna-ZQPCUV4R.js → fna-YEKBSFSX.js} +14 -8
- package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-BFVXAYFX.js} +5 -4
- package/dist/chunks/{host-ATKVNZAT.js → host-HRBXEPDQ.js} +5 -5
- package/dist/chunks/{host-BQH22NTQ.js → host-LR55CTHP.js} +5 -5
- package/dist/chunks/{host-X2CSLFM6.js → host-SUOY6VYQ.js} +5 -5
- package/dist/chunks/{host-4CBHGOHT.js → host-SZGV4UNT.js} +5 -5
- package/dist/chunks/{host-YTODKMSL.js → host-WIKN2EJ5.js} +5 -5
- package/dist/chunks/{hrm-FFM4UJFS.js → hrm-NRDO4W5G.js} +11 -7
- package/dist/chunks/{im-VEHKDQPB.js → im-IQ2HN23S.js} +8 -7
- package/dist/chunks/{invoice-LVIKSIIF.js → invoice-MNRW76PP.js} +636 -1768
- package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-DTRBAX4N.js} +14 -6
- package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-ZVWAI25B.js} +7 -6
- package/dist/chunks/{mail-VDKRGUD3.js → mail-ZVAUXOJA.js} +16 -14
- package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-FEVPZ67S.js} +21 -14
- package/dist/chunks/{okr-CHG4OO3U.js → okr-SDH3E5RA.js} +12 -5
- package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
- package/dist/chunks/{plan-XWR75667.js → plan-E35JFDI7.js} +12 -5
- package/dist/chunks/{project-5BXOOKMG.js → project-73QXBAB2.js} +11 -4
- package/dist/chunks/reception-UWZVACBN.js +1899 -0
- package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-4MAOCKFY.js} +320 -57
- package/dist/chunks/registry-IM5G23LS.js +24 -0
- package/dist/chunks/{registry-RHMW6ANW.js → registry-JDUS4E7D.js} +7 -6
- package/dist/chunks/{registry-7FFOXIAW.js → registry-KNKSCJNT.js} +7 -6
- package/dist/chunks/{registry-Z43434VG.js → registry-PO7SI256.js} +4 -4
- package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
- package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-H7KLXA5R.js} +6 -5
- package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-ESZIBAUO.js} +6 -5
- package/dist/chunks/{workflow-ADHKCAJK.js → workflow-CWJFJLQU.js} +13 -8
- package/dist/cmd/action.js +6 -0
- package/dist/cmd/identity/index.js +45 -0
- package/dist/cmd/index.js +2 -0
- package/dist/core/continuation-ttl.js +18 -0
- package/dist/core/error-codes.js +85 -0
- package/dist/core/logger.js +11 -0
- package/dist/index.js +37 -31
- package/dist/internal/e10/auth/commands.js +163 -8
- package/dist/internal/e10/auth/error-log.js +182 -0
- package/dist/internal/e10/auth/session.js +17 -3
- package/dist/internal/e10/auth-recovery.js +39 -12
- package/dist/internal/e10/context.js +17 -2
- package/dist/internal/skills/install.js +9 -1
- package/dist/shortcuts/archive/continuation.js +2 -1
- package/dist/shortcuts/archive/index.js +3 -0
- package/dist/shortcuts/archive/operations/confirm.js +2 -1
- package/dist/shortcuts/archive-oa/continuation.js +2 -1
- package/dist/shortcuts/archive-oa/index.js +2 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
- package/dist/shortcuts/asset/continuation.js +2 -1
- package/dist/shortcuts/asset/index.js +2 -0
- package/dist/shortcuts/asset-idle/index.js +2 -0
- package/dist/shortcuts/blog/continuation.js +2 -1
- package/dist/shortcuts/blog/index.js +2 -0
- package/dist/shortcuts/caizhilian/continuation.js +2 -1
- package/dist/shortcuts/caizhilian/index.js +2 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
- package/dist/shortcuts/calendar/continuation.js +2 -1
- package/dist/shortcuts/calendar/index.js +2 -0
- package/dist/shortcuts/calendar/operations/write.js +1 -1
- package/dist/shortcuts/contract/continuation.js +2 -1
- package/dist/shortcuts/contract/index.js +2 -0
- package/dist/shortcuts/contract/operations/write.js +2 -1
- package/dist/shortcuts/cowork/continuation.js +2 -1
- package/dist/shortcuts/cowork/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
- package/dist/shortcuts/ebuilder-form/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
- package/dist/shortcuts/ehr/continuation.js +2 -1
- package/dist/shortcuts/ehr/index.js +2 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +182 -3
- package/dist/shortcuts/ehr/operations/recruit-position.js +134 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +1 -1
- package/dist/shortcuts/esb/continuation.js +2 -1
- package/dist/shortcuts/esb/index.js +2 -0
- package/dist/shortcuts/esb/operations/trigger.js +2 -1
- package/dist/shortcuts/fna/continuation.js +2 -1
- package/dist/shortcuts/fna/index.js +2 -0
- package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
- package/dist/shortcuts/fna/operations/loan.js +1 -1
- package/dist/shortcuts/hrm/index.js +2 -0
- package/dist/shortcuts/im/continuation.js +2 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/continuation.js +2 -1
- package/dist/shortcuts/invoice/index.js +14 -15
- package/dist/shortcuts/invoice/invoice-record.js +93 -0
- package/dist/shortcuts/invoice/manifest.js +190 -393
- package/dist/shortcuts/invoice/operations/add.js +2 -1
- package/dist/shortcuts/invoice/operations/delete.js +2 -1
- package/dist/shortcuts/invoice/operations/import.js +2 -1
- package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
- package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
- package/dist/shortcuts/invoice/operations/registry.js +17 -17
- package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
- package/dist/shortcuts/invoice/operations/reim.js +52 -341
- package/dist/shortcuts/invoice/operations/shared.js +21 -4
- package/dist/shortcuts/invoice/operations/update.js +2 -1
- package/dist/shortcuts/invoice/projection.js +10 -62
- package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
- package/dist/shortcuts/mail/continuation.js +2 -1
- package/dist/shortcuts/mail/index.js +2 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
- package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
- package/dist/shortcuts/mail/operations/mail-send.js +1 -1
- package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
- package/dist/shortcuts/mail/operations/mail-template.js +1 -1
- package/dist/shortcuts/meeting/continuation.js +2 -1
- package/dist/shortcuts/meeting/index.js +2 -0
- package/dist/shortcuts/meeting/operations/change.js +1 -1
- package/dist/shortcuts/meeting/operations/create.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +16 -7
- package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/factory.js +1 -1
- package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
- package/dist/shortcuts/meeting/operations/receipts.js +1 -1
- package/dist/shortcuts/meeting/operations/signs.js +1 -1
- package/dist/shortcuts/okr/continuation.js +2 -1
- package/dist/shortcuts/okr/index.js +2 -0
- package/dist/shortcuts/okr/operations/write.js +1 -1
- package/dist/shortcuts/plan/continuation.js +2 -1
- package/dist/shortcuts/plan/index.js +2 -0
- package/dist/shortcuts/plan/operations/write.js +1 -1
- package/dist/shortcuts/project/continuation.js +2 -1
- package/dist/shortcuts/project/index.js +2 -0
- package/dist/shortcuts/reception/constants.js +53 -0
- package/dist/shortcuts/reception/errors.js +54 -0
- package/dist/shortcuts/reception/host.js +125 -0
- package/dist/shortcuts/reception/index.js +198 -0
- package/dist/shortcuts/reception/manifest.js +177 -0
- package/dist/shortcuts/reception/operations/ask.js +71 -0
- package/dist/shortcuts/reception/operations/browsertool.js +58 -0
- package/dist/shortcuts/reception/operations/compose.js +129 -0
- package/dist/shortcuts/reception/operations/customparams.js +74 -0
- package/dist/shortcuts/reception/operations/doc.js +238 -0
- package/dist/shortcuts/reception/operations/docrender.js +36 -0
- package/dist/shortcuts/reception/operations/panels.js +179 -0
- package/dist/shortcuts/reception/operations/registry.js +26 -0
- package/dist/shortcuts/reception/operations/render-assets.js +184 -0
- package/dist/shortcuts/reception/operations/render.js +123 -0
- package/dist/shortcuts/reception/operations/runs.js +38 -0
- package/dist/shortcuts/reception/operations/schedule.js +127 -0
- package/dist/shortcuts/reception/operations/shared.js +196 -0
- package/dist/shortcuts/reception/operations/snapshot.js +68 -0
- package/dist/shortcuts/reception/operations/types.js +1 -0
- package/dist/shortcuts/reception/operations.js +33 -0
- package/dist/shortcuts/reception/upload.js +218 -0
- package/dist/shortcuts/recruit-stage/context.js +145 -33
- package/dist/shortcuts/recruit-stage/continuation.js +2 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +106 -17
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +166 -10
- package/dist/shortcuts/workflow/continuation.js +2 -1
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +32 -8
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/_catalog.md +3 -0
- package/docs/agent-invoice.md +1 -1
- package/docs/archive-oa.md +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/contract.md +1 -1
- package/docs/e10-auth.md +16 -0
- package/docs/ehr.md +2 -2
- package/docs/esb.md +1 -1
- package/docs/im.md +1 -1
- package/docs/invoice.md +8 -12
- package/docs/okr.md +1 -1
- package/docs/reception.md +119 -0
- package/package.json +1 -1
- package/scripts/clean.mjs +43 -2
- package/skill-template/business-info.json +18 -2
- package/skill-template/domains/caizhilian.md +1 -1
- package/skill-template/domains/reception-flow.md +18 -0
- package/skill-template/domains/yepiaotong.md +4 -7
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
- package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
- package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
- package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
- package/skills/weaver-e10-esb/references/trigger.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
- package/skills/weaver-e10-jucailin/SKILL.md +1 -1
- package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-create.md +12 -3
- package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
- package/skills/weaver-e10-meeting/SKILL.md +8 -6
- package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-okr/references/okr-align.md +1 -1
- package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
- package/skills/weaver-e10-okr/references/okr-write.md +1 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
- package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
- package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
- package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
- package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
- package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
- package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
- package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
- package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +9 -5
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +202 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +22 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +14 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +6 -0
- package/skills/weaver-e10-shijingran/SKILL.md +5 -5
- package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
- package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
- package/skills/weaver-e10-yimiaoban/SKILL.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
- package/dist/chunks/chunk-TTPJJJC4.js +0 -465
- package/dist/chunks/registry-BKBZPBAJ.js +0 -23
- package/dist/shortcuts/invoice/markdown.js +0 -172
- package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS, CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { ehrConfirmationError, ehrValidationError } from '../errors.js';
|
|
3
4
|
import { WRITE, SCHEMA_ID, ehrSuccess, schemaOf, } from './types.js';
|
|
@@ -25,6 +26,10 @@ const TEXT_KEYS = ['position_name'];
|
|
|
25
26
|
const MTEXT_KEYS = ['position_duty', 'work_request'];
|
|
26
27
|
const ASSOC_KEYS = ['demand'];
|
|
27
28
|
const PERSON_DEFAULT_KEYS = ['recr_principal', 'employ_manager'];
|
|
29
|
+
// 🔴 薪资(salary_min / salary_max)必须沿用现值,不能留空:
|
|
30
|
+
// 这两个字段是**表单必填项**,不传就会导致后端必填校验失败、整个建职位流程直接报错。
|
|
31
|
+
// 但历史职位薪资确实可能是脏数据(实测抓到过 300 元月薪),因此不静默使用——
|
|
32
|
+
// 通过 summary.inheritedFromRef 逐项暴露给用户核对,并对明显偏低的值追加 inheritedSalaryWarnings 提示。
|
|
28
33
|
const REF_COPY_KEYS = [
|
|
29
34
|
'position_nature',
|
|
30
35
|
'job_category',
|
|
@@ -41,6 +46,7 @@ const OPTION_DEFAULTS = { salary_type: '月薪', recruit_type: '社会招聘', s
|
|
|
41
46
|
const SET_FIELDS = [
|
|
42
47
|
{ arg: 'education', key: 'education', kind: 'dict', label: '学历要求(按数据字典名称)' },
|
|
43
48
|
{ arg: 'workYears', key: 'work_years', kind: 'dict', label: '工作年限(按数据字典名称)' },
|
|
49
|
+
{ arg: 'workLocation', key: 'work_location', kind: 'assoc', label: '工作地点(办公地点名称/详细地址,如「上海」或完整地址)' },
|
|
44
50
|
{ arg: 'jobCategory', key: 'job_category', kind: 'dict', label: '职位类别(按数据字典名称)' },
|
|
45
51
|
{ arg: 'positionNature', key: 'position_nature', kind: 'dict', label: '职位属性(按数据字典名称)' },
|
|
46
52
|
{ arg: 'salaryType', key: 'salary_type', kind: 'option', label: '薪酬类型(月薪/年薪等)' },
|
|
@@ -95,6 +101,105 @@ async function fetchReferenceDetails(env, cache, objId, formId) {
|
|
|
95
101
|
return [];
|
|
96
102
|
}
|
|
97
103
|
}
|
|
104
|
+
const WORK_PLACE_NAMES = ['办公地点', '工作地点'];
|
|
105
|
+
/** 「办公地点」菜单定位:三级来源(lists.all_search → cache.menus(若存在)→ allMenus 接口),不依赖单一缓存键。
|
|
106
|
+
* 背景同 recruit-stage:原实现直接读 cache.menus,而该环境缓存没有 menus 字段 → 恒取不到 → 工作地点永远写不进去。 */
|
|
107
|
+
async function findWorkPlaceMenu(env, cache) {
|
|
108
|
+
const ok = (m) => !!(m && m.listId);
|
|
109
|
+
const pick = (list) => {
|
|
110
|
+
const hit = list.find((m) => ok(m) && WORK_PLACE_NAMES.some((n) => String(m.menuName || '').includes(n)));
|
|
111
|
+
return hit ? hit : null;
|
|
112
|
+
};
|
|
113
|
+
// ① 环境缓存 all_search(与面试数字人菜单同一模式)
|
|
114
|
+
const hit1 = pick((cache.lists?.all_search || []));
|
|
115
|
+
if (hit1)
|
|
116
|
+
return hit1;
|
|
117
|
+
// ② legacy menus(部分环境可能有)
|
|
118
|
+
const hit2 = pick((cache.menus || []));
|
|
119
|
+
if (hit2)
|
|
120
|
+
return hit2;
|
|
121
|
+
// ③ allMenus 接口兜底
|
|
122
|
+
try {
|
|
123
|
+
const r = (await env.host.request({
|
|
124
|
+
path: '/api/cusapp/app/allMenus',
|
|
125
|
+
query: { isFront: 1, appId: String(cache.appId || ''), terminalType: 'PC' },
|
|
126
|
+
}));
|
|
127
|
+
const flat = [];
|
|
128
|
+
(function walk(nodes) {
|
|
129
|
+
for (const n of nodes || []) {
|
|
130
|
+
if (n && typeof n === 'object') {
|
|
131
|
+
flat.push(n);
|
|
132
|
+
walk(n.children || n.childs);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
})((r?.data?.cusAppMenus || r?.data));
|
|
136
|
+
return pick(flat);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** 工作地点:按名称/详细地址/区域文本解析「办公地点」记录 id;解析不到返回 null(调用方进 setSkipped,不臆造 id)。 */
|
|
143
|
+
async function resolveWorkLocation(env, cache, value) {
|
|
144
|
+
const v = String(value).trim();
|
|
145
|
+
if (!v)
|
|
146
|
+
return null;
|
|
147
|
+
const menu = await findWorkPlaceMenu(env, cache);
|
|
148
|
+
if (!menu?.listId)
|
|
149
|
+
return null;
|
|
150
|
+
let pObj = '';
|
|
151
|
+
try {
|
|
152
|
+
const t = (await env.host.request({
|
|
153
|
+
path: '/api/ebuilder/form/obj/getObjsByTag',
|
|
154
|
+
query: { appId: String(cache.appId || ''), tag: 'uf_rcrt_work_place' },
|
|
155
|
+
}));
|
|
156
|
+
const d = t?.data;
|
|
157
|
+
if (Array.isArray(d) && d[0])
|
|
158
|
+
pObj = String(d[0].id || '');
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
/* tag 未注册:用菜单节点兜底 */
|
|
162
|
+
}
|
|
163
|
+
if (!pObj)
|
|
164
|
+
pObj = String(menu.objId || '');
|
|
165
|
+
if (!pObj)
|
|
166
|
+
return null;
|
|
167
|
+
const body = buildListBody({
|
|
168
|
+
listId: menu.listId,
|
|
169
|
+
cusMenuId: menu.cusMenuId,
|
|
170
|
+
menuName: menu.menuName || '办公地点',
|
|
171
|
+
title: menu.menuName || '办公地点',
|
|
172
|
+
pageSize: 200,
|
|
173
|
+
});
|
|
174
|
+
const r = (await env.host.request({
|
|
175
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
176
|
+
body,
|
|
177
|
+
headers: { ebBusinessId: menu.listId },
|
|
178
|
+
}));
|
|
179
|
+
const rows = (r?.data?.data || r?.data?.displayData || []);
|
|
180
|
+
const hit = rows.find((x) => {
|
|
181
|
+
const name = String(x?.name || '');
|
|
182
|
+
const detail = String(x?.detail_location || '');
|
|
183
|
+
const area = String(x?.area_text || '');
|
|
184
|
+
return name.includes(v) || detail.includes(v) || area.includes(v) || (!!detail && v.includes(detail));
|
|
185
|
+
});
|
|
186
|
+
return hit ? { id: String(hit.form_data_id || hit.id), name: String(hit.detail_location || hit.name || v) } : null;
|
|
187
|
+
}
|
|
188
|
+
/** 从提交 detail 取可读值(用于 summary 里点名「继承来的值」) */
|
|
189
|
+
function detailDisplayValue(detail) {
|
|
190
|
+
if (!detail)
|
|
191
|
+
return '';
|
|
192
|
+
const d = detail;
|
|
193
|
+
if (d.content !== undefined && d.content !== null)
|
|
194
|
+
return String(d.content);
|
|
195
|
+
if (Array.isArray(d.dataOptions) && d.dataOptions[0]) {
|
|
196
|
+
const o = d.dataOptions[0];
|
|
197
|
+
return String(o.content ?? o.optionId ?? '');
|
|
198
|
+
}
|
|
199
|
+
if (d.dataText?.content !== undefined)
|
|
200
|
+
return String(d.dataText.content).replace(/<[^>]+>/g, '').slice(0, 60);
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
98
203
|
async function buildPositionPlan(env, cache, args) {
|
|
99
204
|
const form = cache.forms.position_manage;
|
|
100
205
|
const objId = form?.objId;
|
|
@@ -169,6 +274,15 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
169
274
|
put({ formField: { id: fieldId }, dataOptions: [{ optionId: String(optionId), content: value }] });
|
|
170
275
|
applied.push(`${field.key}=${value}`);
|
|
171
276
|
}
|
|
277
|
+
else if (field.kind === 'assoc') {
|
|
278
|
+
const loc = await resolveWorkLocation(env, cache, value);
|
|
279
|
+
if (!loc) {
|
|
280
|
+
skipped.push(`${field.key}=${value}(未匹配到「办公地点」记录,已跳过)`);
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
put({ formField: { id: fieldId }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
|
|
284
|
+
applied.push(`${field.key}=${value}`);
|
|
285
|
+
}
|
|
172
286
|
else if (field.kind === 'dict') {
|
|
173
287
|
const ids = cache.dict.by_name[value] || [];
|
|
174
288
|
const unique = [...new Set(ids.map(String))];
|
|
@@ -237,6 +351,18 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
237
351
|
const inverse = {};
|
|
238
352
|
for (const [dataKey, fieldId] of Object.entries(fields))
|
|
239
353
|
inverse[String(fieldId)] = dataKey;
|
|
354
|
+
// 继承来的薪资若明显偏低(历史脏数据,实测出现过 300 元月薪),额外点名提示。
|
|
355
|
+
// 不阻断提交(薪资是必填项,阻断等于无法建档),但要求 Agent 在确认摘要里明确提示用户核对。
|
|
356
|
+
const inheritedSalaryWarnings = [];
|
|
357
|
+
for (const key of ['salary_min', 'salary_max']) {
|
|
358
|
+
if (!inherited.includes(key))
|
|
359
|
+
continue;
|
|
360
|
+
const raw = detailDisplayValue(refMap.get(String(fid(key))));
|
|
361
|
+
const num = Number(String(raw).replace(/[^\d.]/g, ''));
|
|
362
|
+
if (raw && Number.isFinite(num) && num > 0 && num < 1000) {
|
|
363
|
+
inheritedSalaryWarnings.push(`${key} 继承值「${raw}」明显偏低(疑历史脏数据),请人工核对后再提交`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
240
366
|
return {
|
|
241
367
|
objId,
|
|
242
368
|
formId,
|
|
@@ -250,6 +376,12 @@ async function buildPositionPlan(env, cache, args) {
|
|
|
250
376
|
explicitApplied: applied,
|
|
251
377
|
explicitSkipped: skipped,
|
|
252
378
|
inheritedFromExistingPosition: inherited,
|
|
379
|
+
// 带值的继承清单:Agent 必须在确认摘要里逐项点名(尤其 work_location),
|
|
380
|
+
// 不得因为它是默认值就略过——历史上这里曾静默带出过重复地点等脏数据。
|
|
381
|
+
inheritedFromRef: inherited.length
|
|
382
|
+
? inherited.map((k) => ({ field: k, value: detailDisplayValue(refMap.get(String(fid(k)))) }))
|
|
383
|
+
: undefined,
|
|
384
|
+
inheritedSalaryWarnings: inheritedSalaryWarnings.length ? inheritedSalaryWarnings : undefined,
|
|
253
385
|
noReferenceValue: missingRef,
|
|
254
386
|
principalDefault: session.userId ? '当前登录用户' : '未解析到当前用户',
|
|
255
387
|
},
|
|
@@ -283,13 +415,13 @@ const positionCreatePrepare = {
|
|
|
283
415
|
userId: session.userId,
|
|
284
416
|
payload: { objId: plan.objId, formId: plan.formId, positionName: String(args.positionName).trim(), dataDetails: plan.dataDetails },
|
|
285
417
|
fingerprint: fingerprint({ objId: plan.objId, dataDetails: plan.dataDetails }),
|
|
286
|
-
},
|
|
418
|
+
}, CONTINUATION_TTL_MS);
|
|
287
419
|
return ehrSuccess('ehr.recruit.position.create.prepare', {
|
|
288
420
|
status: 'AWAITING_CONFIRMATION',
|
|
289
421
|
preview: { action: '生成职位JD并建职位(saveFormData → addPosition)', ...plan.summary },
|
|
290
422
|
willSubmit: { objId: plan.objId, formId: plan.formId, dataDetails: plan.dataDetails },
|
|
291
423
|
continuation,
|
|
292
|
-
expiresInSeconds:
|
|
424
|
+
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
293
425
|
});
|
|
294
426
|
},
|
|
295
427
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { ehrConfirmationError, ehrPartialError, ehrValidationError, EhrCliError } from '../errors.js';
|
|
3
4
|
import { WRITE, ehrSuccess, schemaOf, } from './types.js';
|
|
4
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
5
5
|
function fingerprint(value) {
|
|
6
6
|
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
|
|
1
2
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
@@ -35,7 +36,7 @@ function signature(payload, key) {
|
|
|
35
36
|
}
|
|
36
37
|
export function createEsbContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createEsbContinuationSigner } from './continuation.js';
|
|
4
5
|
import { createEsbHost } from './host.js';
|
|
5
6
|
import { esbManifest } from './manifest.js';
|
|
@@ -85,6 +86,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
85
86
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
86
87
|
}
|
|
87
88
|
catch (error) {
|
|
89
|
+
reportPlatformError(error);
|
|
88
90
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
89
91
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
90
92
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { esbSuccess } from './types.js';
|
|
2
3
|
import { esbValidationError } from '../errors.js';
|
|
3
4
|
import { isEsbFlowUnavailable } from '../host.js';
|
|
@@ -51,7 +52,7 @@ export const esbTriggerHandlers = {
|
|
|
51
52
|
requestPreview: payload,
|
|
52
53
|
templateFields,
|
|
53
54
|
continuation: token,
|
|
54
|
-
expiresInSeconds:
|
|
55
|
+
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
55
56
|
}, { status: 'PREPARED' }, warnings);
|
|
56
57
|
},
|
|
57
58
|
'esb.trigger.apply': async (input, { host, continuation }) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
|
|
1
2
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
@@ -35,7 +36,7 @@ function signature(payload, key) {
|
|
|
35
36
|
}
|
|
36
37
|
export function createFnaContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createFnaContinuationSigner } from './continuation.js';
|
|
4
5
|
import { createFnaHost } from './host.js';
|
|
5
6
|
import { fnaManifest } from './manifest.js';
|
|
@@ -84,6 +85,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
84
85
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
85
86
|
}
|
|
86
87
|
catch (error) {
|
|
88
|
+
reportPlatformError(error);
|
|
87
89
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
88
90
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
89
91
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { fnaPartialError, fnaValidationError, isFnaNetworkError } from '../errors.js';
|
|
2
3
|
import { fnaSuccess, READ, schemaOf, SCHEMA_INTEGER_POSITIVE, WRITE } from './types.js';
|
|
3
4
|
import { compact, fingerprint, normalizeWeaTable, requireConfirm, requireRequestIds, toPositiveInt, unwrapData, verifyLease } from './shared.js';
|
|
4
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
5
5
|
/** 发票核销公开字段(InvWriteOffSearchVo 非分页部分)。 */
|
|
6
6
|
const WRITE_OFF_FILTER_FIELDS = {
|
|
7
7
|
invoiceStatus: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { fnaPartialError, fnaValidationError, isFnaNetworkError } from '../errors.js';
|
|
2
3
|
import { fnaSuccess, READ, schemaOf, SCHEMA_INTEGER_POSITIVE, SCHEMA_STRING_NONEMPTY, WRITE } from './types.js';
|
|
3
4
|
import { compact, fingerprint, normalizeWeaTable, requireConfirm, requireRemindRows, summarizeRemindRows, toPositiveInt, unwrapData, verifyLease } from './shared.js';
|
|
4
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
5
5
|
const LOAN_MENU_FIELDS = {
|
|
6
6
|
menuCode: { ...SCHEMA_STRING_NONEMPTY, description: '菜单编码,如 fesx_fna_borrowingManagement(与环境核对)' },
|
|
7
7
|
permissionSetCode: { ...SCHEMA_STRING_NONEMPTY, description: '权限集编码,如 fesx_fna_borrowingManagement.default(与环境核对)' },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createHrmHost } from './host.js';
|
|
4
5
|
import { hrmManifest } from './manifest.js';
|
|
5
6
|
import { executeHrmOperation } from './operations.js';
|
|
@@ -129,6 +130,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
129
130
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
130
131
|
}
|
|
131
132
|
catch (error) {
|
|
133
|
+
reportPlatformError(error);
|
|
132
134
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
133
135
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
134
136
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
|
|
1
2
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
@@ -35,7 +36,7 @@ function signature(payload, key) {
|
|
|
35
36
|
}
|
|
36
37
|
export function createImContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
package/dist/shortcuts/index.js
CHANGED
|
@@ -145,6 +145,11 @@ export const builtinShortcuts = [
|
|
|
145
145
|
description: '泛微E10今承达合同管理 CLI',
|
|
146
146
|
load: async () => (await import('./contract/index.js')).contractShortcut,
|
|
147
147
|
}),
|
|
148
|
+
lazyShortcut({
|
|
149
|
+
name: 'reception',
|
|
150
|
+
description: '泛微客户参观接待流程 CLI(面板/行程单与内部方案/填单页预填)',
|
|
151
|
+
load: async () => (await import('./reception/index.js')).receptionShortcut,
|
|
152
|
+
}),
|
|
148
153
|
];
|
|
149
154
|
/** 全部 shortcut 的 CLI 元数据(不触发任何实现模块加载)。 */
|
|
150
155
|
export function shortcutMetadata() {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
|
|
1
2
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
@@ -35,7 +36,7 @@ function signature(payload, key) {
|
|
|
35
36
|
}
|
|
36
37
|
export function createInvoiceContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { Option } from 'commander';
|
|
2
3
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
4
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
5
|
import { createInvoiceContinuationSigner } from './continuation.js';
|
|
4
6
|
import { createInvoiceHost } from './host.js';
|
|
5
7
|
import { invoiceManifest } from './manifest.js';
|
|
6
8
|
import { executeInvoiceOperation } from './operations.js';
|
|
7
|
-
import { normalizeFields, normalizeView,
|
|
8
|
-
import { renderInvoiceMarkdown } from './markdown.js';
|
|
9
|
+
import { normalizeFields, normalizeView, assertProjectionSupported, applyInvoiceProjection, } from './projection.js';
|
|
9
10
|
import { invoiceValidationError } from './errors.js';
|
|
10
11
|
function asOptions(value) {
|
|
11
12
|
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
@@ -62,27 +63,32 @@ function withJsonInputOptions(command) {
|
|
|
62
63
|
/**
|
|
63
64
|
* 输出投影选项:让调用方一次拿到可读结果,而不必再写脚本解析完整 envelope。
|
|
64
65
|
* `--view summary` 只对 list 类 operation 生效、`--view detail` 只对 invoice.get 生效(见 projection.ts);
|
|
65
|
-
* `--fields` 对所有 operation
|
|
66
|
+
* `--fields` 对所有 operation 生效。
|
|
66
67
|
*/
|
|
67
68
|
function withOutputOptions(command) {
|
|
68
69
|
command
|
|
69
70
|
.option('--view <mode>', 'output view: full (default), summary (list ops) or detail (invoice.get)')
|
|
70
|
-
.option('--
|
|
71
|
-
.
|
|
71
|
+
.option('--fields <paths>', 'comma-separated dot paths to keep, e.g. number,detailUrl')
|
|
72
|
+
.addOption(new Option('--format <mode>').hideHelp());
|
|
72
73
|
return command;
|
|
73
74
|
}
|
|
75
|
+
/** `--format` 已移除但仍隐藏接住:照旧 skill 调用的 Agent 要拿到改用 `--view` 的提示,而不是 unknown option。 */
|
|
76
|
+
function rejectRemovedFormat(value) {
|
|
77
|
+
if (value === undefined || String(value).trim() === 'json')
|
|
78
|
+
return;
|
|
79
|
+
throw invoiceValidationError('format_removed', '--format markdown 已移除:列表改用 --view summary,invoice get 改用 --view detail,再按字段在回复里拼 markdown 表格');
|
|
80
|
+
}
|
|
74
81
|
function withInvoiceOptions(command) {
|
|
75
82
|
return withOutputOptions(withJsonInputOptions(command));
|
|
76
83
|
}
|
|
77
84
|
function projectionFrom(options) {
|
|
78
85
|
const opts = asOptions(options);
|
|
86
|
+
rejectRemovedFormat(opts.format);
|
|
79
87
|
const view = normalizeView(opts.view);
|
|
80
88
|
const fields = normalizeFields(opts.fields);
|
|
81
|
-
const format = formatFrom(opts.format);
|
|
82
89
|
return {
|
|
83
90
|
...(view ? { view } : {}),
|
|
84
91
|
...(fields ? { fields } : {}),
|
|
85
|
-
...(format ? { format } : {}),
|
|
86
92
|
};
|
|
87
93
|
}
|
|
88
94
|
function intOption(value) {
|
|
@@ -123,17 +129,10 @@ async function executeAndPrint(ctx, operation, input, projection = {}) {
|
|
|
123
129
|
continuation: createInvoiceContinuationSigner(ctx),
|
|
124
130
|
});
|
|
125
131
|
const projected = applyInvoiceProjection(operation, result.data, projection);
|
|
126
|
-
if (projection.format === 'markdown') {
|
|
127
|
-
// 渲染档输出的是文本,不是 envelope:与 --json 混用会让调用方误判输出契约,直接拦住。
|
|
128
|
-
if (ctx.getGlobalOptions().json) {
|
|
129
|
-
throw invoiceValidationError('input_conflict', '--format markdown 与 --json 互斥:markdown 是渲染档(文本),不是 JSON。去掉 --json 再试');
|
|
130
|
-
}
|
|
131
|
-
process.stdout.write(renderInvoiceMarkdown(operation, projected.data));
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
132
|
ctx.output.write(successEnvelope(operation, { status: result.status, data: projected.data }, projected.meta), { json: true });
|
|
135
133
|
}
|
|
136
134
|
catch (error) {
|
|
135
|
+
reportPlatformError(error);
|
|
137
136
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
138
137
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
139
138
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 发票记录与票面扩展信息 `ext` 的语义提取。
|
|
3
|
+
*
|
|
4
|
+
* `ext` 是**字符串化的 JSON**。费用说明、城市、备注(常写出差地、订单行程)、起止地、上下车站点
|
|
5
|
+
* 只在这里,报销按城市 / 行程筛票离不开它。list 的完整输出(`extInfo`)、summary 视图、
|
|
6
|
+
* detail 视图共用这一份口径,避免同一业务概念在不同出口换名。
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* `/api/inc/sync` 的 `mext` 按位选择返回哪些 ext 字段(1=trate、2=ttax …),不传就不返回 ext。
|
|
10
|
+
* 全 1 掩码返回完整 ext;取 int32 上限,避免服务端按 int 解析时溢出。
|
|
11
|
+
*/
|
|
12
|
+
export const FULL_EXT_MASK = 2147483647;
|
|
13
|
+
/** `extInfo` 及 summary / detail 视图里来自 `ext` 的语义字段。 */
|
|
14
|
+
export const EXT_INFO_FIELDS = [
|
|
15
|
+
'expenseNote',
|
|
16
|
+
'content',
|
|
17
|
+
'city',
|
|
18
|
+
'province',
|
|
19
|
+
'comment',
|
|
20
|
+
'from',
|
|
21
|
+
'to',
|
|
22
|
+
'stationGetOn',
|
|
23
|
+
'stationGetOff',
|
|
24
|
+
];
|
|
25
|
+
function asRecord(value) {
|
|
26
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
27
|
+
}
|
|
28
|
+
function text(value) {
|
|
29
|
+
if (value === undefined || value === null)
|
|
30
|
+
return '';
|
|
31
|
+
return String(value).replace(/^\uFEFF/u, '').trim();
|
|
32
|
+
}
|
|
33
|
+
function firstText(...values) {
|
|
34
|
+
for (const value of values) {
|
|
35
|
+
const candidate = text(value);
|
|
36
|
+
if (candidate)
|
|
37
|
+
return candidate;
|
|
38
|
+
}
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 列表项一般是平铺的发票对象;也兼容 `{ info, ret, is_valid }` 包装(与 `invoice.get` 同形)。
|
|
43
|
+
* 只有外层没有票面字段、且 `info` 是对象时才拆包,避免误拆业务字段。
|
|
44
|
+
*/
|
|
45
|
+
export function invoiceRecordOf(item) {
|
|
46
|
+
const record = asRecord(item);
|
|
47
|
+
const inner = asRecord(record.info);
|
|
48
|
+
const hasOwnInvoiceFields = record.comm_info !== undefined || record.fid !== undefined || record.number !== undefined;
|
|
49
|
+
return !hasOwnInvoiceFields && Object.keys(inner).length ? inner : record;
|
|
50
|
+
}
|
|
51
|
+
/** 解析失败按空对象处理,不让脏数据打断输出。已是对象时直接使用。 */
|
|
52
|
+
export function parseInvoiceExt(value) {
|
|
53
|
+
if (value && typeof value === 'object')
|
|
54
|
+
return asRecord(value);
|
|
55
|
+
const raw = text(value);
|
|
56
|
+
if (!raw)
|
|
57
|
+
return {};
|
|
58
|
+
try {
|
|
59
|
+
return asRecord(JSON.parse(raw));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function productNames(products) {
|
|
66
|
+
if (!Array.isArray(products))
|
|
67
|
+
return '';
|
|
68
|
+
return products.map((product) => text(asRecord(product).name)).filter(Boolean).join('、');
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 从一条发票记录里提取 `ext` 的语义字段,空值省键。
|
|
72
|
+
* 起止地与上下车站点在不同票种里位置不一:先取 `ext`,再取票面顶层,最后取 `ext.passengersService[0]`。
|
|
73
|
+
*/
|
|
74
|
+
export function invoiceExtInfo(invoice) {
|
|
75
|
+
const ext = parseInvoiceExt(invoice.ext);
|
|
76
|
+
const passenger = asRecord(Array.isArray(ext.passengersService) ? ext.passengersService[0] : undefined);
|
|
77
|
+
const info = {
|
|
78
|
+
expenseNote: text(ext.expenseDesc),
|
|
79
|
+
content: firstText(ext.content, productNames(ext.products)),
|
|
80
|
+
city: text(ext.city),
|
|
81
|
+
province: firstText(ext.province, invoice.province),
|
|
82
|
+
comment: text(ext.comment),
|
|
83
|
+
from: firstText(ext.from, invoice.from, passenger.from),
|
|
84
|
+
to: firstText(ext.to, invoice.to, passenger.to),
|
|
85
|
+
stationGetOn: firstText(ext.station_geton, invoice.station_geton, passenger.station_geton),
|
|
86
|
+
stationGetOff: firstText(ext.station_getoff, invoice.station_getoff, passenger.station_getoff),
|
|
87
|
+
};
|
|
88
|
+
for (const [key, value] of Object.entries(info)) {
|
|
89
|
+
if (!value)
|
|
90
|
+
delete info[key];
|
|
91
|
+
}
|
|
92
|
+
return info;
|
|
93
|
+
}
|