weaver-work-cli 0.1.40 → 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-JHTONRST.js → archive-P6TBQGKL.js} +13 -5
- package/dist/chunks/{archive-oa-FCHLCPHC.js → archive-oa-7TQ2NXOH.js} +12 -5
- package/dist/chunks/{asset-RLIHC7DB.js → asset-3ELRG37G.js} +11 -4
- package/dist/chunks/{asset-idle-KVOFTLCP.js → asset-idle-WIGMUFMD.js} +7 -3
- package/dist/chunks/{attachment-content-RZYDB3MB.js → attachment-content-E3276UOV.js} +5 -4
- package/dist/chunks/{blog-42OZTJNP.js → blog-C5NMZAAC.js} +11 -4
- package/dist/chunks/{caizhilian-KRK547K5.js → caizhilian-5XSM2DFP.js} +13 -6
- package/dist/chunks/{calendar-RTWAMKHD.js → calendar-FI2WNSBO.js} +71 -26
- package/dist/chunks/{chunk-CXRQWOZ5.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-LN447PY2.js → chunk-BCVYBYYT.js} +432 -2247
- package/dist/chunks/{chunk-7E6MUOEK.js → chunk-CWYGFU5B.js} +2 -2
- package/dist/chunks/{chunk-NOODWMCL.js → chunk-D4ADSZ7H.js} +1 -1
- package/dist/chunks/{chunk-WFFNM65B.js → chunk-ETNJSKMM.js} +281 -29
- package/dist/chunks/{chunk-CAQNBBQA.js → chunk-F4E4EM35.js} +3 -3
- package/dist/chunks/{chunk-4CTESSKI.js → chunk-FAZTGX7S.js} +6 -6
- package/dist/chunks/chunk-FRZKBMSW.js +2562 -0
- package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
- package/dist/chunks/{chunk-NJKREDA3.js → chunk-GAMZLAG2.js} +1 -1
- package/dist/chunks/{chunk-FLS4DPGP.js → chunk-GM6J7Q4B.js} +28 -15
- package/dist/chunks/{chunk-NETCCARD.js → chunk-GRDRG6HP.js} +3 -3
- package/dist/chunks/chunk-HIT4Y6OI.js +1238 -0
- package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
- package/dist/chunks/{chunk-IZSSVYAG.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-57IECMWX.js → chunk-N4M2DDFE.js} +29 -15
- package/dist/chunks/{chunk-JWRZM2H2.js → chunk-OF4S23UB.js} +4 -4
- package/dist/chunks/{chunk-VNBU55SL.js → chunk-PC7VKEB5.js} +80 -2458
- package/dist/chunks/{chunk-G2JSIUWF.js → chunk-PUQS5MWL.js} +91 -2
- package/dist/chunks/{chunk-E7OK5WD5.js → chunk-Q4OYAQYH.js} +5 -5
- package/dist/chunks/{chunk-7BRU4EFH.js → chunk-QVSWRLLU.js} +35 -6
- package/dist/chunks/{chunk-T6EGVBKU.js → chunk-TA7FXXJD.js} +6 -3
- package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
- package/dist/chunks/{chunk-4TEDNCON.js → chunk-UFIT2UU3.js} +354 -56
- 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-7U577Q7U.js → chunk-WSF4NNMR.js} +3 -3
- package/dist/chunks/chunk-XHK4MDR5.js +2497 -0
- package/dist/chunks/{chunk-LFMSDBZN.js → chunk-XNIK66I4.js} +326 -161
- 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-I566ZYNF.js → chunk-Z7VYWPZV.js} +1 -1
- package/dist/chunks/{conflict-VR55AOOO.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-HI4FNPYE.js → contract-DNIIW5VJ.js} +13 -5
- package/dist/chunks/{cowork-HJLI353D.js → cowork-GMLRGVIW.js} +31 -14
- package/dist/chunks/create-flow-J22BO65E.js +56 -0
- package/dist/chunks/{ebuilder-form-HTGI63UU.js → ebuilder-form-ANV2FHYV.js} +12 -7
- package/dist/chunks/{ehr-GYXIYH3A.js → ehr-GSTGAIY3.js} +695 -1255
- package/dist/chunks/{employee-SAK2QYXX.js → employee-22BGJ3QS.js} +3 -3
- package/dist/chunks/{env-DW3G4HUO.js → env-BX3VRFS7.js} +4 -3
- package/dist/chunks/{esb-I5INCEFE.js → esb-ATAIASX2.js} +12 -7
- package/dist/chunks/{factory-TKXGXS6L.js → factory-PETTFME6.js} +3 -2
- package/dist/chunks/{fna-K2MHTQ24.js → fna-YEKBSFSX.js} +14 -8
- package/dist/chunks/{group-chat-VYBNMJLG.js → group-chat-BFVXAYFX.js} +7 -4
- package/dist/chunks/{host-D5SERMAJ.js → host-HRBXEPDQ.js} +5 -5
- package/dist/chunks/{host-JM4YVHFM.js → host-LR55CTHP.js} +5 -5
- package/dist/chunks/{host-L3VLITMT.js → host-SUOY6VYQ.js} +5 -5
- package/dist/chunks/{host-ZUQTJYYK.js → host-SZGV4UNT.js} +5 -5
- package/dist/chunks/{host-256GVCAH.js → host-WIKN2EJ5.js} +5 -5
- package/dist/chunks/{hrm-VLRBKTZB.js → hrm-NRDO4W5G.js} +11 -7
- package/dist/chunks/{im-QK3VTLXK.js → im-IQ2HN23S.js} +11 -10
- package/dist/chunks/{invoice-T5JTA32H.js → invoice-MNRW76PP.js} +636 -1768
- package/dist/chunks/{jiuchuanhui-P2FNEQVZ.js → jiuchuanhui-DTRBAX4N.js} +14 -6
- package/dist/chunks/{lazy-dispatch-XRRI46M6.js → lazy-dispatch-ZVWAI25B.js} +7 -6
- package/dist/chunks/{mail-3Y7MJ6PS.js → mail-ZVAUXOJA.js} +16 -14
- package/dist/chunks/{meeting-M7LTXGJE.js → meeting-FEVPZ67S.js} +21 -13
- package/dist/chunks/{okr-OBC6S67L.js → okr-SDH3E5RA.js} +12 -5
- package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
- package/dist/chunks/{plan-5H6I53SK.js → plan-E35JFDI7.js} +12 -5
- package/dist/chunks/{project-L75QZV4S.js → project-73QXBAB2.js} +49 -25
- package/dist/chunks/reception-UWZVACBN.js +1899 -0
- package/dist/chunks/recruit-stage-4MAOCKFY.js +4770 -0
- package/dist/chunks/registry-IM5G23LS.js +24 -0
- package/dist/chunks/{registry-UGRBCBHO.js → registry-JDUS4E7D.js} +7 -6
- package/dist/chunks/{registry-RXPN6BBT.js → registry-KNKSCJNT.js} +7 -6
- package/dist/chunks/{registry-NYPYMZXG.js → registry-PO7SI256.js} +4 -4
- package/dist/chunks/{registry-QGHFNUWS.js → registry-PVUZQDDQ.js} +3 -3
- package/dist/chunks/{room-recommend-A3UDC3CA.js → room-recommend-H7KLXA5R.js} +6 -5
- package/dist/chunks/{schedule-5GCACCK7.js → schedule-ESZIBAUO.js} +6 -5
- package/dist/chunks/{workflow-M5ZJ7DWF.js → workflow-CWJFJLQU.js} +15 -10
- 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 +41 -30
- package/dist/internal/e10/auth/commands.js +164 -8
- package/dist/internal/e10/auth/error-log.js +182 -0
- package/dist/internal/e10/auth/messages.js +6 -0
- package/dist/internal/e10/auth/session.js +34 -3
- package/dist/internal/e10/auth/xiaoe.js +286 -44
- package/dist/internal/e10/auth-recovery.js +72 -14
- package/dist/internal/e10/context.js +72 -13
- package/dist/internal/e10/index.js +1 -1
- package/dist/internal/e10/network-error.js +93 -0
- package/dist/internal/e10/request-runtime.js +6 -0
- 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/read.js +31 -22
- package/dist/shortcuts/calendar/operations/write.js +46 -2
- 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/cowork/operations/discuss-write.js +5 -1
- package/dist/shortcuts/cowork/operations/item-write.js +1 -7
- package/dist/shortcuts/cowork/operations/member-write.js +3 -1
- package/dist/shortcuts/cowork/operations/permission-write.js +5 -1
- package/dist/shortcuts/cowork/operations/shared.js +7 -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 +44 -2
- package/dist/shortcuts/ehr/operations/hr-contact.js +7 -4
- package/dist/shortcuts/ehr/operations/hr-report.js +13 -7
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +317 -63
- package/dist/shortcuts/ehr/operations/recruit-position.js +134 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +263 -18
- package/dist/shortcuts/ehr/operations/recruit.js +10 -4
- package/dist/shortcuts/ehr/operations/shared.js +47 -0
- 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/hrm/operations/org.js +118 -0
- package/dist/shortcuts/im/continuation.js +2 -1
- package/dist/shortcuts/index.js +10 -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/catalog.js +4 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +101 -35
- package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/factory.js +34 -1
- package/dist/shortcuts/meeting/operations/eb/group-chat.js +25 -3
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +96 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +33 -11
- 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/project/operations/read.js +6 -25
- package/dist/shortcuts/project/operations/shared.js +22 -0
- package/dist/shortcuts/project/operations/write.js +28 -2
- 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 +231 -0
- package/dist/shortcuts/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/recruit-stage/host.js +109 -0
- package/dist/shortcuts/recruit-stage/index.js +115 -0
- package/dist/shortcuts/recruit-stage/manifest.js +29 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +722 -0
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +269 -0
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +719 -0
- package/dist/shortcuts/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +38 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +1354 -0
- package/dist/shortcuts/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/recruit-stage/operations/types.js +25 -0
- package/dist/shortcuts/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/recruit-stage/shared.js +608 -0
- 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/todoSmartConvert/detailFieldRules.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +13 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +17 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +14 -9
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +50 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +17 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +7 -39
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +51 -15
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.pipeline.js +16 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +151 -63
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subGroup.js +56 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +39 -14
- 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 +23 -1
- 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/operation-manual.md +8 -0
- package/docs/reception.md +119 -0
- package/package.json +1 -1
- package/scripts/clean.mjs +43 -2
- package/scripts/install-skill-to-xiaoe.mjs +105 -0
- package/scripts/package-skill.mjs +4 -2
- package/skill-template/business-info.json +42 -2
- package/skill-template/domains/caizhilian.md +1 -1
- package/skill-template/domains/reception-flow.md +18 -0
- package/skill-template/domains/recruit-stage.md +29 -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/SKILL.md +2 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +55 -1
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-cowork/references/cowork-write.md +3 -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 +10 -2
- package/skills/weaver-e10-jucailin/references/hr-contact.md +8 -0
- package/skills/weaver-e10-jucailin/references/hr-report.md +8 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +14 -5
- package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-write.md +5 -4
- package/skills/weaver-e10-mail/SKILL.md +1 -1
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- 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 +230 -0
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +119 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +188 -0
- 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-arrange-interview.md +322 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +127 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +65 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +95 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +56 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +148 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +59 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +451 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-shared/SKILL.md +1 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -2
- package/skills/weaver-e10-shijingran/SKILL.md +7 -6
- package/skills/weaver-e10-shijingran/references/operations.md +3 -1
- package/skills/weaver-e10-shijingran/references/source-manifest.json +30 -28
- package/skills/weaver-e10-shijingran/references/write-operations.md +2 -0
- 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/SKILL.md +4 -2
- package/skills/weaver-e10-workflow/aigroup/default.json +11 -9
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +23 -13
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +62 -20
- package/skills/weaver-e10-yepiaotong/SKILL.md +28 -36
- package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +6 -3
- 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-SPRHHSVC.js +0 -465
- package/dist/chunks/registry-KMHCPAAD.js +0 -22
- 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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* customParams 口径:逐行对齐 weaver-work-cli release 的 xiaoEUrlParamValue / buildXiaoECustomParams。
|
|
3
|
+
*
|
|
4
|
+
* 关键三条(与旧方案文档相反的地方已按源码纠正):
|
|
5
|
+
* 1) 同字段多值用 `,`,明细多行用 `;`;
|
|
6
|
+
* 2) 标量对象按 id > optionId > fileId > fileid > fid > value 取标识;
|
|
7
|
+
* 3) 空值字段整个省略,且不进入 fieldAssignKeys。
|
|
8
|
+
*/
|
|
9
|
+
export const MULTI_SEPARATOR = ',';
|
|
10
|
+
export const ROW_SEPARATOR = ';';
|
|
11
|
+
const SCALAR_KEYS = ['id', 'optionId', 'fileId', 'fileid', 'fid', 'value'];
|
|
12
|
+
export function urlParamScalar(value) {
|
|
13
|
+
if (value === null || value === undefined)
|
|
14
|
+
return '';
|
|
15
|
+
if (typeof value === 'object') {
|
|
16
|
+
const record = value;
|
|
17
|
+
for (const key of SCALAR_KEYS) {
|
|
18
|
+
const picked = record[key];
|
|
19
|
+
if (picked === null || picked === undefined)
|
|
20
|
+
continue;
|
|
21
|
+
const text = String(picked).trim();
|
|
22
|
+
if (text)
|
|
23
|
+
return text;
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
return String(value).trim();
|
|
28
|
+
}
|
|
29
|
+
export function urlParamValue(value) {
|
|
30
|
+
if (value === null || value === undefined)
|
|
31
|
+
return '';
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value.map((item) => urlParamScalar(item)).filter(Boolean).join(MULTI_SEPARATOR);
|
|
34
|
+
}
|
|
35
|
+
return urlParamScalar(value);
|
|
36
|
+
}
|
|
37
|
+
export function buildCustomParams(items = []) {
|
|
38
|
+
const ordered = [];
|
|
39
|
+
const main = new Map();
|
|
40
|
+
const detail = new Map();
|
|
41
|
+
for (const item of items) {
|
|
42
|
+
const fieldId = String((item && item.fieldId) || '').trim();
|
|
43
|
+
if (!fieldId)
|
|
44
|
+
continue;
|
|
45
|
+
const text = urlParamValue(item.value);
|
|
46
|
+
if (!text)
|
|
47
|
+
continue;
|
|
48
|
+
const isDetail = item.dataIndex !== undefined && item.dataIndex !== null;
|
|
49
|
+
if (!isDetail) {
|
|
50
|
+
if (!main.has(fieldId) && !detail.has(fieldId))
|
|
51
|
+
ordered.push(fieldId);
|
|
52
|
+
main.set(fieldId, text);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!detail.has(fieldId)) {
|
|
56
|
+
if (!main.has(fieldId))
|
|
57
|
+
ordered.push(fieldId);
|
|
58
|
+
detail.set(fieldId, []);
|
|
59
|
+
}
|
|
60
|
+
const index = Number(item.dataIndex);
|
|
61
|
+
detail.get(fieldId).push({ index: Number.isFinite(index) ? index : 0, text });
|
|
62
|
+
}
|
|
63
|
+
const values = {};
|
|
64
|
+
for (const fieldId of ordered) {
|
|
65
|
+
const rows = detail.get(fieldId);
|
|
66
|
+
if (rows && rows.length) {
|
|
67
|
+
rows.sort((left, right) => left.index - right.index);
|
|
68
|
+
values[fieldId] = rows.map((row) => row.text).join(ROW_SEPARATOR);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
values[fieldId] = main.get(fieldId) ?? '';
|
|
72
|
+
}
|
|
73
|
+
return { values, keys: ordered };
|
|
74
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
4
|
+
import { receptionValidationError } from '../errors.js';
|
|
5
|
+
import { mergeAnswers } from './panels.js';
|
|
6
|
+
import { requirePython, renderBoth, resolveRenderPy } from './render-assets.js';
|
|
7
|
+
import { newRunId, saveRun, tryLoadRun } from './runs.js';
|
|
8
|
+
import { canonical, ensureDir, parseJsonText, sha256, writeJson } from './shared.js';
|
|
9
|
+
/** 案例 + 专家检索结果注入。软依赖:文件没给 / 给空就整段不出,不阻断出单。 */
|
|
10
|
+
function applyCases(data, casesFile) {
|
|
11
|
+
let raw;
|
|
12
|
+
try {
|
|
13
|
+
raw = readFileSync(casesFile, 'utf8');
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw receptionValidationError('CASES_FILE_UNREADABLE', `读不到 --cases-file:${casesFile}`, {
|
|
17
|
+
path: casesFile,
|
|
18
|
+
detail: error.message,
|
|
19
|
+
hint: '检查路径与读权限',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const parsed = parseJsonText(raw);
|
|
23
|
+
if (!parsed.ok) {
|
|
24
|
+
throw receptionValidationError('CASES_INVALID', `--cases-file 不是合法 JSON:${parsed.error}`, {
|
|
25
|
+
preview: parsed.preview,
|
|
26
|
+
hasBom: parsed.hasBom,
|
|
27
|
+
hint: '常见原因:UTF-8 BOM(hasBom:true)、中文引号、尾随逗号;修 JSON 本身,不要换传参方式',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const list = Array.isArray(payload) ? payload : (payload.cases || payload.items || []);
|
|
32
|
+
if (Array.isArray(list) && list.length)
|
|
33
|
+
data.cases = list;
|
|
34
|
+
if (payload && !Array.isArray(payload)) {
|
|
35
|
+
const note = payload.note || payload.casesNote || '';
|
|
36
|
+
if (note)
|
|
37
|
+
data.casesNote = String(note);
|
|
38
|
+
const query = payload.query || payload.casesQuery || '';
|
|
39
|
+
if (query)
|
|
40
|
+
data.casesQuery = String(query);
|
|
41
|
+
// 专家参考:与案例同文件,第二个检索结果
|
|
42
|
+
const experts = payload.experts || payload.expertItems || [];
|
|
43
|
+
if (Array.isArray(experts) && experts.length)
|
|
44
|
+
data.experts = experts;
|
|
45
|
+
const expertsNote = payload.expertsNote || payload.expertNote || '';
|
|
46
|
+
if (expertsNote)
|
|
47
|
+
data.expertsNote = String(expertsNote);
|
|
48
|
+
const expertsQuery = payload.expertsQuery || payload.expertQuery || '';
|
|
49
|
+
if (expertsQuery)
|
|
50
|
+
data.expertsQuery = String(expertsQuery);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export async function doc(input, ctx) {
|
|
54
|
+
const startedAt = Date.now();
|
|
55
|
+
const runIdArg = String(input.runId || '').trim();
|
|
56
|
+
const knownArg = input.known || null;
|
|
57
|
+
let run = runIdArg ? tryLoadRun(ctx.stateDir, runIdArg) : null;
|
|
58
|
+
let rebuilt = false;
|
|
59
|
+
if (!run) {
|
|
60
|
+
if (!knownArg) {
|
|
61
|
+
if (!runIdArg) {
|
|
62
|
+
throw receptionValidationError('RUN_ID_MISSING', '缺少 --run-id:正常流程先用 ask 取 runId;run 已失效时改用 --known 现场重建', { hint: 'reception doc --known \'{"customer":"…","visitDate":"…"}\' --answers \'{…}\'' });
|
|
63
|
+
}
|
|
64
|
+
// 有 runId 但文件没了,且没给 known:只能让调用方补齐
|
|
65
|
+
throw receptionValidationError('RUN_NOT_FOUND', `找不到 run:${runIdArg}(可能已过期或换了机器)`, { runId: runIdArg, stateDir: ctx.stateDir, hint: '把 ask 用过的 --known 一起带上重跑本条,CLI 会现场重建 run' });
|
|
66
|
+
}
|
|
67
|
+
rebuilt = Boolean(runIdArg);
|
|
68
|
+
const session = await ctx.host.getSession();
|
|
69
|
+
run = {
|
|
70
|
+
// 重建的 run 用新 id:传进来的那个已经不存在了,复用它会让人误以为原 run 还在
|
|
71
|
+
runId: newRunId(),
|
|
72
|
+
createdAt: new Date().toISOString(),
|
|
73
|
+
workflow: input.workflow || DEFAULT_WORKFLOW,
|
|
74
|
+
outDir: input.outDir || ctx.outDir,
|
|
75
|
+
base: session.baseUrl,
|
|
76
|
+
data: { ...knownArg },
|
|
77
|
+
customer: null,
|
|
78
|
+
user: null,
|
|
79
|
+
mode: 'browsertool',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const answers = input.answers ?? run.answers ?? {};
|
|
83
|
+
const data = mergeAnswers(run, answers);
|
|
84
|
+
if (input.casesFile)
|
|
85
|
+
applyCases(data, input.casesFile);
|
|
86
|
+
const outDir = input.outDir || run.outDir || ctx.outDir;
|
|
87
|
+
ensureDir(outDir);
|
|
88
|
+
const warnings = [];
|
|
89
|
+
const dataHash = sha256(canonical(data)).slice(0, 32);
|
|
90
|
+
const dataPath = join(ctx.stateDir, `doc-data-${dataHash.slice(0, 12)}.json`);
|
|
91
|
+
writeJson(dataPath, data);
|
|
92
|
+
const python = requirePython(ctx.stateDir);
|
|
93
|
+
const renderPy = resolveRenderPy(input.renderPy || '', input.snapshot || '');
|
|
94
|
+
const noUpload = input.noUpload === true;
|
|
95
|
+
// 会话与渲染并行:渲染约 7s,会话读取基本瞬时,没必要串行等
|
|
96
|
+
const sessionPromise = noUpload
|
|
97
|
+
? Promise.resolve(null)
|
|
98
|
+
: ctx.host.getSession();
|
|
99
|
+
const renderPromise = renderBoth({ python, renderPy, dataPath, outDir });
|
|
100
|
+
const uploadPromise = renderPromise.then(async (rendered) => {
|
|
101
|
+
if (noUpload)
|
|
102
|
+
return null;
|
|
103
|
+
const session = await sessionPromise;
|
|
104
|
+
if (!session || !session.available) {
|
|
105
|
+
return { ups: [], uploadMs: 0, base: '', skipped: 'NO_SESSION' };
|
|
106
|
+
}
|
|
107
|
+
const uploadStartedAt = Date.now();
|
|
108
|
+
// 两附件都挂同一个字段:docx(对外行程单)+ md(内部接待方案),按此顺序上传
|
|
109
|
+
const picks = ['docx', 'md']
|
|
110
|
+
.map((kind) => ({
|
|
111
|
+
kind,
|
|
112
|
+
file: (rendered.result.files || []).find((file) => file.kind === kind),
|
|
113
|
+
}))
|
|
114
|
+
.filter((item) => item.file);
|
|
115
|
+
const ups = [];
|
|
116
|
+
for (const item of picks) {
|
|
117
|
+
const result = await ctx.host.uploadFile(item.file.path);
|
|
118
|
+
ups.push({ kind: item.kind, ...result });
|
|
119
|
+
}
|
|
120
|
+
return { ups, uploadMs: Date.now() - uploadStartedAt, base: session.baseUrl };
|
|
121
|
+
});
|
|
122
|
+
const [rendered, uploadResult] = await Promise.all([renderPromise, uploadPromise]);
|
|
123
|
+
const docxMs = rendered.docxMs;
|
|
124
|
+
const mdMs = rendered.mdMs;
|
|
125
|
+
let attachment = null;
|
|
126
|
+
let attachments = [];
|
|
127
|
+
let uploadMs = null;
|
|
128
|
+
/** 上传失败时的结构化诊断,直接进返回体:下次失败不用再靠猜。 */
|
|
129
|
+
let uploadDiagnostics = [];
|
|
130
|
+
if (uploadResult) {
|
|
131
|
+
uploadMs = uploadResult.uploadMs;
|
|
132
|
+
const succeeded = uploadResult.ups.filter((item) => item.ok && item.fileid);
|
|
133
|
+
const failed = uploadResult.ups.filter((item) => !item.ok);
|
|
134
|
+
if (succeeded.length) {
|
|
135
|
+
attachments = succeeded.map((item) => ({
|
|
136
|
+
fileid: String(item.fileid),
|
|
137
|
+
name: item.name || '',
|
|
138
|
+
kind: item.kind,
|
|
139
|
+
}));
|
|
140
|
+
attachment = attachments.find((item) => item.kind === 'docx') || attachments[0];
|
|
141
|
+
}
|
|
142
|
+
if (failed.length) {
|
|
143
|
+
// 失败原因必须带够线索:HTTP 状态、content-type、响应片段、下一步提示。
|
|
144
|
+
// 只写"no fileid in response"等于让人猜,实测排查成本极高。
|
|
145
|
+
uploadDiagnostics = failed.map((item) => ({
|
|
146
|
+
kind: item.kind,
|
|
147
|
+
error: item.reason || item.error || '未知',
|
|
148
|
+
httpStatus: item.httpStatus ?? null,
|
|
149
|
+
contentType: item.contentType || null,
|
|
150
|
+
hint: item.hint || null,
|
|
151
|
+
responsePreview: item.detail ? String(item.detail).slice(0, 300) : null,
|
|
152
|
+
}));
|
|
153
|
+
const reason = uploadDiagnostics
|
|
154
|
+
.map((item) => {
|
|
155
|
+
const bits = [`${item.kind}:${item.error}`];
|
|
156
|
+
if (item.httpStatus)
|
|
157
|
+
bits.push(`HTTP ${item.httpStatus}`);
|
|
158
|
+
if (item.contentType && !/json/i.test(String(item.contentType))) {
|
|
159
|
+
bits.push(`content-type=${item.contentType}`);
|
|
160
|
+
}
|
|
161
|
+
if (item.responsePreview)
|
|
162
|
+
bits.push(`响应片段=${String(item.responsePreview).slice(0, 160)}`);
|
|
163
|
+
if (item.hint)
|
|
164
|
+
bits.push(`提示=${item.hint}`);
|
|
165
|
+
return bits.join(' | ');
|
|
166
|
+
})
|
|
167
|
+
.join(';');
|
|
168
|
+
warnings.push(`附件上传失败(${reason}):本地文件已生成(见 data.files),可在页面手动添加`);
|
|
169
|
+
}
|
|
170
|
+
if (uploadResult.skipped === 'NO_SESSION') {
|
|
171
|
+
warnings.push('未取得 E10 会话:附件未上传,产物按本地文件交付');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (noUpload) {
|
|
175
|
+
warnings.push('已按 --no-upload 跳过上传:页面上需要手动添加附件');
|
|
176
|
+
}
|
|
177
|
+
run.answers = answers;
|
|
178
|
+
run.data = data;
|
|
179
|
+
run.files = rendered.result.files || [];
|
|
180
|
+
// 记住快照路径,render 就不必再传一次
|
|
181
|
+
if (input.snapshot)
|
|
182
|
+
run.snapshotPath = input.snapshot;
|
|
183
|
+
if (uploadResult && uploadResult.base)
|
|
184
|
+
run.base = uploadResult.base;
|
|
185
|
+
if (attachment)
|
|
186
|
+
run.attachmentFileid = String(attachment.fileid);
|
|
187
|
+
if (attachments.length)
|
|
188
|
+
run.attachmentFileids = attachments;
|
|
189
|
+
saveRun(ctx.stateDir, run);
|
|
190
|
+
// 内部参考文档正文:直接带在回包里,让模型在对话中原样贴出。
|
|
191
|
+
// 否则模型会为了贴全文再单独读一次产物文件,白多一次工具往返;docx 是二进制,永远不要回读。
|
|
192
|
+
let internalDoc = null;
|
|
193
|
+
const mdFile = (rendered.result.files || []).find((file) => file.kind === 'md');
|
|
194
|
+
if (mdFile?.path) {
|
|
195
|
+
try {
|
|
196
|
+
internalDoc = {
|
|
197
|
+
name: basename(mdFile.path),
|
|
198
|
+
path: mdFile.path,
|
|
199
|
+
content: readFileSync(mdFile.path, 'utf8'),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// 读不到就当没生成,技能侧跳过这一段,不影响出件与填单
|
|
204
|
+
internalDoc = null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
state: 'doc-ready',
|
|
209
|
+
ok: true,
|
|
210
|
+
data: {
|
|
211
|
+
runId: run.runId,
|
|
212
|
+
rebuilt,
|
|
213
|
+
files: (rendered.result.files || []).map((file) => ({ kind: file.kind, path: file.path, size: file.size })),
|
|
214
|
+
internalDoc,
|
|
215
|
+
attachment,
|
|
216
|
+
attachments,
|
|
217
|
+
attachmentPending: attachments.length === 0,
|
|
218
|
+
uploadDiagnostics,
|
|
219
|
+
qa: rendered.result.qa || {},
|
|
220
|
+
verify: rendered.result.verify || {},
|
|
221
|
+
timings: {
|
|
222
|
+
docxMs,
|
|
223
|
+
mdMs,
|
|
224
|
+
uploadMs,
|
|
225
|
+
parallelMs: rendered.parallelMs,
|
|
226
|
+
totalMs: Date.now() - startedAt,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
warnings,
|
|
230
|
+
next: {
|
|
231
|
+
command: `weaver-work-cli reception render --run-id ${run.runId}`,
|
|
232
|
+
reason: '附件 fileid 已写入 run,render 会自动带上',
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
export const docOperation = {
|
|
237
|
+
execute: (input, ctx) => doc(input, ctx),
|
|
238
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { doc } from './doc.js';
|
|
2
|
+
import { render } from './render.js';
|
|
3
|
+
/**
|
|
4
|
+
* reception.docRender —— 一次调用完成「出文件 + 传附件 + 拼填单参数 + 落 browsertool」。
|
|
5
|
+
*
|
|
6
|
+
* 为什么合并:`doc` 与 `render` 之间没有人工确认点,拆两次只会多付一次工具往返
|
|
7
|
+
* (宿主侧单次 3~5 秒),而 CLI 内部这两步加起来只有几百毫秒。
|
|
8
|
+
*
|
|
9
|
+
* 失败语义与分开调用**完全一致**,不因为合并而改变:
|
|
10
|
+
* - `doc` 失败(快照缺失 / render.py 缺失 / python-docx 缺失)→ 直接返回 doc 的错误,不继续 render;
|
|
11
|
+
* - 附件上传失败**不算** doc 失败(只进 `warnings` + `uploadDiagnostics`),`customParams` 照常产出;
|
|
12
|
+
* - `render` 失败 → 返回 render 的错误,此时文件已生成,回包里仍带 `files`。
|
|
13
|
+
*/
|
|
14
|
+
export async function docRender(input, ctx) {
|
|
15
|
+
const docResult = await doc(input, ctx);
|
|
16
|
+
if (!docResult.ok)
|
|
17
|
+
return docResult;
|
|
18
|
+
const runId = String((docResult.data || {}).runId || input.runId || '');
|
|
19
|
+
// answers / snapshotPath 已经由 doc 写进 run,这里只传 runId;
|
|
20
|
+
// sdkRender 属于 render 自己的入参,透传即可。
|
|
21
|
+
const renderResult = await render({ runId, sdkRender: input.sdkRender }, ctx);
|
|
22
|
+
return {
|
|
23
|
+
state: renderResult.state,
|
|
24
|
+
ok: renderResult.ok,
|
|
25
|
+
data: {
|
|
26
|
+
...docResult.data,
|
|
27
|
+
...renderResult.data,
|
|
28
|
+
runId,
|
|
29
|
+
},
|
|
30
|
+
warnings: [...(docResult.warnings || []), ...(renderResult.warnings || [])],
|
|
31
|
+
next: renderResult.next,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const docRenderOperation = {
|
|
35
|
+
execute: (input, ctx) => docRender(input, ctx),
|
|
36
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { CUSTOMER_NEED_OPTIONS, LOGISTICS_FIELDS, LOGISTICS_HINT, LOGISTICS_LABEL, LOGISTICS_PLACEHOLDER, LOGISTICS_TITLE, } from '../constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* 后勤与人数自由文本 → 6 个子项。
|
|
4
|
+
*
|
|
5
|
+
* 用户手写格式不可控,这里只做"能认就认",认不出的子项由调用方按原文进待办,
|
|
6
|
+
* 绝不追问第二轮。
|
|
7
|
+
*/
|
|
8
|
+
export function parseLogistics(text) {
|
|
9
|
+
const raw = String(text || '').trim();
|
|
10
|
+
if (!raw)
|
|
11
|
+
return {};
|
|
12
|
+
const out = {};
|
|
13
|
+
if (/^(暂未确定|待定|都不确定|还没定|都没定)/.test(raw))
|
|
14
|
+
return out;
|
|
15
|
+
// 用户没改灰字直接提交:整串都是字段名、且一个数字都没有 → 视为未填,不产脏数据
|
|
16
|
+
const FIELD_HINTS = ['客户人数', '是否会议', '是否接送', '是否用餐', '是否代订住宿', '是否伴手礼', '陪同人员手机号'];
|
|
17
|
+
if (!/\d/.test(raw) && FIELD_HINTS.filter((word) => raw.includes(word)).length >= 2)
|
|
18
|
+
return out;
|
|
19
|
+
// 手机号:11 位,可能写在这段话的任意位置;单独取出,由 mergeAnswers 挂到接待人身上
|
|
20
|
+
const mobile = raw.match(/(?<!\d)1[3-9]\d{9}(?!\d)/);
|
|
21
|
+
if (mobile)
|
|
22
|
+
out.mobile = mobile[0];
|
|
23
|
+
// 编号(①②③ / 1) / (1) / 1. / 1、)一律当分隔;换行、句号、顿号也算
|
|
24
|
+
const segs = raw
|
|
25
|
+
.replace(/[①②③④⑤⑥⑦⑧⑨]/g, '\n')
|
|
26
|
+
.replace(/[((]\s*\d\s*[))]/g, '\n')
|
|
27
|
+
.replace(/(^|[\s||;;,,。])\d\s*[.))、]/g, '\n')
|
|
28
|
+
.replace(/总部\s*(\d{3})/g, '总部$1')
|
|
29
|
+
.replace(/(\d)\s*[人名位]/g, '$1人')
|
|
30
|
+
.replace(/(\d)\s*间/g, '$1间')
|
|
31
|
+
.split(/[\n||;;,,。、]+/)
|
|
32
|
+
.map((item) => item.trim())
|
|
33
|
+
.filter(Boolean);
|
|
34
|
+
for (const part of segs) {
|
|
35
|
+
// 一个片段可能同时含多个子项(如「10人 总部130会议室」),因此逐项独立判断,不 continue
|
|
36
|
+
if (!out.meetingRoom) {
|
|
37
|
+
// 兼容「总部131」「131会议室」「总部131会议室」三种写法;
|
|
38
|
+
// 数字前后不能紧邻数字,否则会从手机号里捞出 131。
|
|
39
|
+
const room = part.match(/(?:总部\s*)?(?<!\d)(129|130|131)(?!\d)\s*会议室/)
|
|
40
|
+
|| part.match(/总部\s*(?<!\d)(129|130|131)(?!\d)/);
|
|
41
|
+
if (room)
|
|
42
|
+
out.meetingRoom = `总部${room[1]}会议室`;
|
|
43
|
+
else if (/(不需要|不用|无需|没有)会议室/.test(part))
|
|
44
|
+
out.meetingRoom = '不需会议室';
|
|
45
|
+
else {
|
|
46
|
+
const named = part.match(/([\u4e00-\u9fa5]{2,8}会议室)/);
|
|
47
|
+
if (named)
|
|
48
|
+
out.meetingRoom = named[1];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!out.headcount) {
|
|
52
|
+
const band = part.match(/(5人以内|6-10人|11-20人|20人以上)/);
|
|
53
|
+
if (band) {
|
|
54
|
+
out.headcount = band[1] === '5人以内' ? 5 : band[1] === '6-10人' ? 6 : band[1] === '11-20人' ? 11 : 20;
|
|
55
|
+
out.headcountBand = band[1];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const exact = part.match(/(\d{1,3})\s*人/);
|
|
59
|
+
if (exact)
|
|
60
|
+
out.headcount = Number(exact[1]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!out.meal) {
|
|
64
|
+
if (/(不用餐|不需要用餐|不吃饭|吃过再来)/.test(part))
|
|
65
|
+
out.meal = '不用餐';
|
|
66
|
+
else if (/(午餐|晚餐|中饭|午饭|晚饭|食堂|小餐厅|外部餐厅|餐厅)/.test(part))
|
|
67
|
+
out.meal = part;
|
|
68
|
+
}
|
|
69
|
+
if (!out.hotel) {
|
|
70
|
+
if (/(无需住宿|不需要住宿|不用住宿|不住|不用订房|当天往返|不需住宿)/.test(part))
|
|
71
|
+
out.hotel = '无需住宿';
|
|
72
|
+
else if (/(住宿|订房|间房|住\s*\d*\s*晚|\d+\s*晚)/.test(part))
|
|
73
|
+
out.hotel = part;
|
|
74
|
+
}
|
|
75
|
+
if (!out.pickup) {
|
|
76
|
+
// 「不用车」「不用接」= 不需要安排车,归一到「客户自行前往」
|
|
77
|
+
if (/(自行前往|自驾|自己过去|不用接|不需要接|不用车|不需要用车|无需用车|不用派车)/.test(part)) {
|
|
78
|
+
out.pickup = '客户自行前往';
|
|
79
|
+
}
|
|
80
|
+
else if (/(接站|接机|用车|派车|商务车|大巴|司机|接送|高铁)/.test(part)) {
|
|
81
|
+
out.pickup = part;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!out.gift) {
|
|
85
|
+
// 兼顾客语序:「不用伴手礼」与「伴手礼不用」都要认
|
|
86
|
+
if (/(不需要伴手礼|无需伴手礼|不用伴手礼|不送|不用礼品|伴手礼(不用|不需要|免)|礼品(不用|不需要))/.test(part)) {
|
|
87
|
+
out.gift = '不需要伴手礼';
|
|
88
|
+
}
|
|
89
|
+
else if (/(伴手礼|纪念品|礼品|礼盒)/.test(part)) {
|
|
90
|
+
out.gift = part;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** 手机号只挂到第一个陪同(接待人)身上;没有陪同就只存 data.mobile,不编造人员。 */
|
|
97
|
+
export function setCompanionMobile(data, mobile) {
|
|
98
|
+
const value = String(mobile || '').trim();
|
|
99
|
+
if (!value)
|
|
100
|
+
return;
|
|
101
|
+
const list = Array.isArray(data.companions) ? data.companions.slice() : [];
|
|
102
|
+
if (list.length) {
|
|
103
|
+
const first = typeof list[0] === 'string' ? { name: list[0] } : { ...list[0] };
|
|
104
|
+
first.mobile = value;
|
|
105
|
+
list[0] = first;
|
|
106
|
+
data.companions = list;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
data.mobile = value;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** 合并 run 上下文与 ask_user 的 answers。 */
|
|
113
|
+
export function mergeAnswers(run, answers = {}) {
|
|
114
|
+
const data = { ...(run.data || {}) };
|
|
115
|
+
if (answers && typeof answers === 'object') {
|
|
116
|
+
if (answers.fields && typeof answers.fields === 'object')
|
|
117
|
+
Object.assign(data, answers.fields);
|
|
118
|
+
if (answers.customer_need)
|
|
119
|
+
data.demand = String(answers.customer_need);
|
|
120
|
+
if (answers.logistics) {
|
|
121
|
+
const raw = String(answers.logistics).trim();
|
|
122
|
+
if (raw) {
|
|
123
|
+
// 原文留存:手动输入格式不可控,解析不到的子项靠它兜底(交付时原样透出,不丢信息)
|
|
124
|
+
data.logisticsRaw = raw;
|
|
125
|
+
const parsed = parseLogistics(raw);
|
|
126
|
+
const mobile = parsed.mobile;
|
|
127
|
+
delete parsed.mobile;
|
|
128
|
+
Object.assign(data, parsed);
|
|
129
|
+
if (mobile)
|
|
130
|
+
setCompanionMobile(data, mobile);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// 兼容旧口径:独立手机号面板传进来的值(新流程已并进 logistics)
|
|
134
|
+
if (answers.companion_mobile)
|
|
135
|
+
setCompanionMobile(data, answers.companion_mobile);
|
|
136
|
+
}
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 面板由 CLI 生成,模型原样传给 ask_user。
|
|
141
|
+
*
|
|
142
|
+
* 硬约束(宿主实测):title 严格单行、超长截断成「…」;placeholder 正常渲染;hint 不渲染。
|
|
143
|
+
* 因此标题只留一句短话,完整清单放 placeholder,口径放 hint。
|
|
144
|
+
* 总屏数 ≤ 2(客户需求 1 + 接待细节 1),手机号并入接待细节,不单独出屏。
|
|
145
|
+
*/
|
|
146
|
+
export function buildPanels(data) {
|
|
147
|
+
const panels = [];
|
|
148
|
+
if (!data.demand) {
|
|
149
|
+
panels.push({
|
|
150
|
+
id: 'customer_need',
|
|
151
|
+
// 同样受「标题单行」约束:不写 ①②③ 追问清单,只留一句
|
|
152
|
+
title: '客户需求(选一个,也可自己写)',
|
|
153
|
+
inputType: 'single',
|
|
154
|
+
required: false,
|
|
155
|
+
allowCustomInput: true,
|
|
156
|
+
options: CUSTOMER_NEED_OPTIONS.map((item) => ({ label: item, value: item })),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const missing = LOGISTICS_FIELDS.filter((key) => !data[key]);
|
|
160
|
+
const mobile = ((data.companions || []).find((item) => item && item.mobile) || {}).mobile || '';
|
|
161
|
+
if (missing.length || !mobile) {
|
|
162
|
+
const known = LOGISTICS_FIELDS
|
|
163
|
+
.filter((key) => data[key])
|
|
164
|
+
.map((key) => `${LOGISTICS_LABEL[key]}:${data[key]}`);
|
|
165
|
+
if (mobile)
|
|
166
|
+
known.push(`${LOGISTICS_LABEL.mobile}:${mobile}`);
|
|
167
|
+
panels.push({
|
|
168
|
+
id: 'logistics',
|
|
169
|
+
// 标题严格单行:不拼字段清单、不拼已识别项、不讲规则——拼了必被截断成「…」
|
|
170
|
+
title: LOGISTICS_TITLE,
|
|
171
|
+
inputType: 'text',
|
|
172
|
+
required: false,
|
|
173
|
+
allowCustomInput: true,
|
|
174
|
+
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
175
|
+
placeholder: LOGISTICS_PLACEHOLDER,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return panels;
|
|
179
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { askOperation } from './ask.js';
|
|
2
|
+
import { docOperation } from './doc.js';
|
|
3
|
+
import { docRenderOperation } from './docrender.js';
|
|
4
|
+
import { renderOperation } from './render.js';
|
|
5
|
+
/**
|
|
6
|
+
* operation 名 → handler。
|
|
7
|
+
*
|
|
8
|
+
* 四个:ask / doc / render 是既有链路,docRender 是「doc + render 一次跑完」的合并入口
|
|
9
|
+
* (两者之间没有人工确认点,拆两次纯属白付一次工具往返)。
|
|
10
|
+
* 兜底链路(prepare/build/submit)已随独立 reception CLI 退役:
|
|
11
|
+
* 真需要写流程时直接调 `weaver-work-cli workflow`,不必在这里再包一层。
|
|
12
|
+
*/
|
|
13
|
+
const REGISTRY = new Map([
|
|
14
|
+
['reception.ask', askOperation],
|
|
15
|
+
['reception.doc', docOperation],
|
|
16
|
+
['reception.docRender', docRenderOperation],
|
|
17
|
+
['reception.render', renderOperation],
|
|
18
|
+
]);
|
|
19
|
+
export function getReceptionOperation(name) {
|
|
20
|
+
const hit = REGISTRY.get(name);
|
|
21
|
+
if (!hit) {
|
|
22
|
+
throw new Error(`未知 operation: ${name}(可用:${[...REGISTRY.keys()].join(' / ')})`);
|
|
23
|
+
}
|
|
24
|
+
return hit;
|
|
25
|
+
}
|
|
26
|
+
export const receptionOperationNames = [...REGISTRY.keys()];
|