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
|
@@ -66,11 +66,15 @@ function normalizeRoom(row) {
|
|
|
66
66
|
place: toText(main.place).trim(),
|
|
67
67
|
equipments: toText(main.equipments).trim(),
|
|
68
68
|
mrType: toText(main.mr_type).trim(),
|
|
69
|
+
// ⛔ 2026-11-04 真机发现:以前没映射 room_desc,`roomDesc` 永远是 undefined,
|
|
70
|
+
// 于是「带客户优先接待类」里**按描述文案判定**那一半从来没生效过(只有名称含「接待」的能命中)。
|
|
71
|
+
// 例:广州会议室四 的描述「用来接待重要来宾…」明明写着,却被当普通房间。
|
|
72
|
+
roomDesc: toText(main.room_desc).trim(),
|
|
69
73
|
};
|
|
70
74
|
}
|
|
71
75
|
/** 全量会议室:优先缓存(24h),`refresh:true` 强制重拉。 */
|
|
72
76
|
export async function loadRooms(env, options = {}) {
|
|
73
|
-
const key = `rooms-
|
|
77
|
+
const key = `rooms-v3-${await cacheScopeSuffix(env)}`;
|
|
74
78
|
const warnings = [];
|
|
75
79
|
if (!options.refresh) {
|
|
76
80
|
const cached = await readCache(env, key, { ttlMs: ROOMS_TTL_MS });
|
|
@@ -124,10 +128,19 @@ export async function loadFrequentRooms(env, options = {}) {
|
|
|
124
128
|
try {
|
|
125
129
|
const { getMeetingOperation } = await import('../registry.js');
|
|
126
130
|
const listOp = getMeetingOperation('meeting.eb.meeting.list');
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
// ⛔ 2026-11-04 实测:会议列表接口**每页固定 10 条**(pageSize=200 也无效),
|
|
132
|
+
// 以前只扫 5 页 = 最近 50 场,而用户 180 天有 130+ 场 —— 统计被截断,
|
|
133
|
+
// 结果全被最近的测试会议带偏(「测试会议室1」排第一就是这么来的)。
|
|
134
|
+
// 现在按返回的 total 翻到底(封顶 40 页 / 400 场,避免异常数据打爆)。
|
|
135
|
+
let seen = 0;
|
|
136
|
+
let total = 0;
|
|
137
|
+
for (let pageNo = 1; pageNo <= 40; pageNo += 1) {
|
|
138
|
+
const page = await listOp.handler({ creator: userId, begindatetime: sinceText, pageNo, pageSize: 200 }, env);
|
|
129
139
|
requests += 1;
|
|
130
140
|
const rows = (page?.data?.rows ?? []);
|
|
141
|
+
if (rows.length === 0)
|
|
142
|
+
break;
|
|
143
|
+
total = Number(page?.data?.total ?? total) || total;
|
|
131
144
|
for (const row of rows) {
|
|
132
145
|
const main = row?.mainTable ?? row ?? {};
|
|
133
146
|
const name = toText(main.address).trim();
|
|
@@ -135,7 +148,8 @@ export async function loadFrequentRooms(env, options = {}) {
|
|
|
135
148
|
continue;
|
|
136
149
|
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
137
150
|
}
|
|
138
|
-
|
|
151
|
+
seen += rows.length;
|
|
152
|
+
if (total > 0 && seen >= total)
|
|
139
153
|
break;
|
|
140
154
|
}
|
|
141
155
|
}
|
|
@@ -200,6 +214,10 @@ export async function recommendRooms(env, input) {
|
|
|
200
214
|
});
|
|
201
215
|
const memberCount = input.memberCount && input.memberCount > 0 ? input.memberCount : null;
|
|
202
216
|
const requirement = input.requirement ?? {};
|
|
217
|
+
// 兼容顶层 hasCustomer(建会链路以前就是传顶层,打分却只读 requirement.hasCustomer,
|
|
218
|
+
// 导致「带客户优先接待类」从来没生效过 —— 2026-11-04 用户实测 3 个候选全是普通会议室)。
|
|
219
|
+
if (input.hasCustomer === true)
|
|
220
|
+
requirement.hasCustomer = true;
|
|
203
221
|
const usable = roomData.rooms.filter((room) => room.status === '0');
|
|
204
222
|
let busyCount = 0;
|
|
205
223
|
const candidates = [];
|
|
@@ -258,14 +276,16 @@ export async function recommendRooms(env, input) {
|
|
|
258
276
|
reasons.push(`设备含「${requirement.equipmentsKeyword}」`);
|
|
259
277
|
score += 10;
|
|
260
278
|
}
|
|
261
|
-
// 带客户时优先接待类:会议室描述(room_desc
|
|
262
|
-
//
|
|
279
|
+
// 带客户时优先接待类:会议室描述(room_desc)或名称里带「接待/招待/贵宾/商务」的加分。
|
|
280
|
+
// ⛔ 不要把「客户」单独当关键词:`e-message(建议客户培训)` 这种培训室会被误判成接待类,
|
|
281
|
+
// 直接加 35 分排到第一(2026-11-04 真机实测)。真正的接待房名称/描述里一定带「接待」。
|
|
263
282
|
if (requirement.hasCustomer === true) {
|
|
264
|
-
const
|
|
265
|
-
const
|
|
283
|
+
const desc = String(room.roomDesc ?? '').trim();
|
|
284
|
+
const nameHit = room.name.match(/(接待|招待|贵宾|商务|vip)/iu);
|
|
285
|
+
const descHit = desc.match(/(接待|招待|贵宾|商务|vip)/iu);
|
|
286
|
+
const hostHit = nameHit ?? descHit;
|
|
266
287
|
if (hostHit) {
|
|
267
|
-
|
|
268
|
-
reasons.push(`带客户优先:${desc !== '' ? `描述含「${desc.slice(0, 30)}」` : `名称含「${hostHit[1]}」`}`);
|
|
288
|
+
reasons.push(`带客户优先:${descHit ? `描述含「${desc.slice(0, 30)}」` : `名称含「${hostHit[1]}」`}`);
|
|
269
289
|
score += 35;
|
|
270
290
|
}
|
|
271
291
|
}
|
|
@@ -390,6 +410,8 @@ export const ebRoomRecommendOperation = {
|
|
|
390
410
|
...(args.mrType ? { mrType: String(args.mrType) } : {}),
|
|
391
411
|
...(args.roomAttr ? { roomAttr: String(args.roomAttr) } : {}),
|
|
392
412
|
...(args.equipmentsKeyword ? { equipmentsKeyword: String(args.equipmentsKeyword) } : {}),
|
|
413
|
+
// 2026-11-04 修:以前漏了它 —— 用户传了 hasCustomer,打分却读 requirement.hasCustomer,永远 false
|
|
414
|
+
...(args.hasCustomer === true ? { hasCustomer: true } : {}),
|
|
393
415
|
},
|
|
394
416
|
...(args.topN !== undefined ? { topN: Number(args.topN) } : {}),
|
|
395
417
|
...(args.refresh === true ? { refreshRooms: true, refreshFrequent: true } : {}),
|
|
@@ -417,7 +439,7 @@ export async function rememberFrequentRoom(env, roomId) {
|
|
|
417
439
|
if (!id)
|
|
418
440
|
return false;
|
|
419
441
|
const scope = await cacheScopeSuffix(env);
|
|
420
|
-
const roomsCached = await readCache(env, `rooms-
|
|
442
|
+
const roomsCached = await readCache(env, `rooms-v3-${scope}`, { ttlMs: ROOMS_TTL_MS });
|
|
421
443
|
const name = roomsCached?.data?.find((room) => room.id === id)?.name ?? '';
|
|
422
444
|
if (!name)
|
|
423
445
|
return false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { meetingConfirmationError, meetingPartialError, meetingValidationError } from '../errors.js';
|
|
3
4
|
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
4
5
|
import { assertMeetingExists, mergeSnapshot, toIdString } from './shared.js';
|
|
5
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
6
6
|
function fingerprint(value) {
|
|
7
7
|
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { meetingPartialError, meetingValidationError } from '../errors.js';
|
|
3
4
|
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
4
5
|
import { extractRows, mergeSnapshot, pickBusinessInput, toIdString } from './shared.js';
|
|
5
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
6
6
|
function fingerprint(value) {
|
|
7
7
|
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { meetingConfirmationError, meetingPartialError, meetingValidationError } from '../errors.js';
|
|
3
4
|
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
4
5
|
import { extractRows, mergeSnapshot, pickBusinessInput, toIdString } from './shared.js';
|
|
5
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
6
6
|
function fingerprint(value) {
|
|
7
7
|
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
8
8
|
}
|
|
@@ -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 createOkrContinuationSigner(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 { createOkrContinuationSigner } from './continuation.js';
|
|
4
5
|
import { okrValidationError } from './errors.js';
|
|
5
6
|
import { createOkrHost } from './host.js';
|
|
@@ -83,6 +84,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
83
84
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
84
85
|
}
|
|
85
86
|
catch (error) {
|
|
87
|
+
reportPlatformError(error);
|
|
86
88
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
87
89
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
88
90
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { okrApiError, okrPartialError, okrValidationError } from '../errors.js';
|
|
2
3
|
import { businessMessage, isDatajsonSuccess, isFlagSuccess } from '../host.js';
|
|
3
4
|
import { buildStandardSaveBody, createDetailUrlResolver, fetchGoalRaw, goalPrincipalId, okrAbsoluteUrl, resolveLink, } from './link.js';
|
|
4
5
|
import { assertLinkSupported, compact, ebPeriodFields, ensureConfirmLease, fingerprint, optionValue, resolvePeriod, toIdString, toPersonIdListText, toPersonIdString, } from './shared.js';
|
|
5
6
|
import { okrSuccess, schemaOf, SCHEMA_DATE, SCHEMA_ID, SCHEMA_ID_LIST_TEXT, SCHEMA_PERSON_ID, SCHEMA_PERIOD_TYPE, SCHEMA_QUARTER, SCHEMA_SCOPE, } from './types.js';
|
|
6
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
7
7
|
/** ebuilder 新建目标接口支持的 mainTable 字段(源资料 okr_createGoal 传入字段)。 */
|
|
8
8
|
const EB_CREATE_KEYS = [
|
|
9
9
|
'principal_dept',
|
|
@@ -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 createPlanContinuationSigner(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 { createPlanContinuationSigner } from './continuation.js';
|
|
4
5
|
import { planValidationError } from './errors.js';
|
|
5
6
|
import { createPlanHost } from './host.js';
|
|
@@ -83,6 +84,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
83
84
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
84
85
|
}
|
|
85
86
|
catch (error) {
|
|
87
|
+
reportPlatformError(error);
|
|
86
88
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
87
89
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
88
90
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { isPlanErrorType, planApiError, planPartialError, planValidationError } from '../errors.js';
|
|
2
3
|
import { businessMessage, isDatajsonSuccess, isFlagSuccess, isWeaverCodeSuccess, } from '../host.js';
|
|
3
4
|
import { POST_STATUS_LABELS, SCHEMA_ID, SCHEMA_REPORT_TYPE, planSuccess, schemaOf, } from './types.js';
|
|
4
5
|
import { assertLinkSupported, assertReportType, compact, defaultRemindContent, ensureConfirmLease, fingerprint, resolveSerialNumber, resolveYear, toIdListText, toIdString, } from './shared.js';
|
|
5
6
|
import { buildDetailUrl, lookupReport, resolveLink } from './link.js';
|
|
6
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
7
7
|
const REMIND_MESSAGE_EVENT_CODE = 14;
|
|
8
8
|
const BODY_KEYS = ['content', 'summary', 'plans'];
|
|
9
9
|
function textField(value, field) {
|
|
@@ -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 createProjectContinuationSigner(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 { createProjectContinuationSigner } from './continuation.js';
|
|
4
5
|
import { createProjectHost } from './host.js';
|
|
5
6
|
import { projectManifest } from './manifest.js';
|
|
@@ -79,6 +80,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
79
80
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
80
81
|
}
|
|
81
82
|
catch (error) {
|
|
83
|
+
reportPlatformError(error);
|
|
82
84
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
83
85
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
84
86
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { assertDatajsonSuccess, assertWeaverSuccess, } from '../host.js';
|
|
2
2
|
import { projectValidationError } from '../errors.js';
|
|
3
3
|
import { SCHEMA_FILTERS, SCHEMA_FIELDS, SCHEMA_ID_STRING, SCHEMA_PAGE_NO, SCHEMA_PAGE_SIZE, projectSuccess, schemaOf, } from './types.js';
|
|
4
|
-
import { compactFilters, idString, operatorId, positiveInt, queryText, } from './shared.js';
|
|
4
|
+
import { buildCardUrl, compactFilters, idString, operatorId, positiveInt, queryText, resolveObjectId, } from './shared.js';
|
|
5
5
|
const APP_TAG = 'weaver-project-eb';
|
|
6
|
-
const DEFAULT_OBJ_IDS = { task: '1020270486210527232', project: '1020275562853482532' };
|
|
7
6
|
const MIN_VERSION = [20, 6, 11];
|
|
8
|
-
function buildCardUrl(baseUrl, objId, dataId) {
|
|
9
|
-
if (!baseUrl || !objId || !dataId || /[\s/\\?#]/u.test(dataId))
|
|
10
|
-
return null;
|
|
11
|
-
return `${baseUrl.replace(/\/+$/u, '')}/sp/ebdfpage/card/0/${objId}/${dataId}`;
|
|
12
|
-
}
|
|
13
7
|
const CURRENT_USER_FILTERS = new Set([
|
|
14
8
|
'manager',
|
|
15
9
|
'participant',
|
|
@@ -114,7 +108,7 @@ async function decorateDetailUrls(host, operation, datajson) {
|
|
|
114
108
|
if (targets.length === 0)
|
|
115
109
|
return datajson;
|
|
116
110
|
try {
|
|
117
|
-
const objId = await
|
|
111
|
+
const objId = await resolveObjectId(host, operationTable(operation));
|
|
118
112
|
const session = await host.getSession();
|
|
119
113
|
for (const row of targets) {
|
|
120
114
|
const url = buildCardUrl(session.baseUrl, objId, String(row.id));
|
|
@@ -161,19 +155,6 @@ async function getAppId(host) {
|
|
|
161
155
|
throw new Error('当前环境未安装事井然项目管理应用');
|
|
162
156
|
return appId;
|
|
163
157
|
}
|
|
164
|
-
async function getObject(host, value) {
|
|
165
|
-
const response = await host.request({
|
|
166
|
-
method: 'GET',
|
|
167
|
-
path: '/api/ebproject/backendConsole/getCurrentObjId',
|
|
168
|
-
query: { objId: DEFAULT_OBJ_IDS[value] },
|
|
169
|
-
operation: 'project.object.id',
|
|
170
|
-
});
|
|
171
|
-
assertWeaverSuccess(response, 'project.object.id');
|
|
172
|
-
const object = String(response?.data ?? '');
|
|
173
|
-
if (!object)
|
|
174
|
-
throw new Error('接口未返回当前环境对象 ID');
|
|
175
|
-
return object;
|
|
176
|
-
}
|
|
177
158
|
async function datajsonRequest(host, operation, path, payload, query) {
|
|
178
159
|
const response = await host.request({
|
|
179
160
|
method: 'POST',
|
|
@@ -383,7 +364,7 @@ export const projectReadOperations = [
|
|
|
383
364
|
inputSchema: schemaOf({ table: { type: 'string', enum: ['task', 'project'] } }, { required: ['table'] }),
|
|
384
365
|
handler: async (args, { host }) => {
|
|
385
366
|
const value = table(args.table);
|
|
386
|
-
return projectSuccess('project.object.id', { table: value, objId: await
|
|
367
|
+
return projectSuccess('project.object.id', { table: value, objId: await resolveObjectId(host, value) });
|
|
387
368
|
},
|
|
388
369
|
},
|
|
389
370
|
{
|
|
@@ -417,7 +398,7 @@ export const projectReadOperations = [
|
|
|
417
398
|
handler: async (args, { host }) => {
|
|
418
399
|
const value = table(args.table);
|
|
419
400
|
const groupId = args.groupId ? String(args.groupId) : await getAppId(host);
|
|
420
|
-
const sourceId = args.sourceId ? String(args.sourceId) : await
|
|
401
|
+
const sourceId = args.sourceId ? String(args.sourceId) : await resolveObjectId(host, value);
|
|
421
402
|
const response = await host.request({
|
|
422
403
|
method: 'POST',
|
|
423
404
|
path: '/api/ebuilder/common/ds/fields',
|
|
@@ -456,7 +437,7 @@ export const projectReadOperations = [
|
|
|
456
437
|
handler: async (args, { host }) => {
|
|
457
438
|
const value = table(args.table);
|
|
458
439
|
const groupId = args.groupId ? String(args.groupId) : await getAppId(host);
|
|
459
|
-
const sourceId = args.sourceId ? String(args.sourceId) : await
|
|
440
|
+
const sourceId = args.sourceId ? String(args.sourceId) : await resolveObjectId(host, value);
|
|
460
441
|
const response = await host.request({
|
|
461
442
|
method: 'GET',
|
|
462
443
|
path: '/api/ebuilder/common/ds/options',
|
|
@@ -549,4 +530,4 @@ export const projectReadOperations = [
|
|
|
549
530
|
hrmOperation('project.department.resolve', '/api/hrm/common/browser/data/department', 'organization', '按名称精确或模糊解析部门 ID'),
|
|
550
531
|
hrmOperation('project.subcompany.resolve', '/api/hrm/common/browser/data/subcompany', 'organization', '按名称精确或模糊解析分部 ID'),
|
|
551
532
|
];
|
|
552
|
-
export { getAppId, getObject, SCHEMA_FIELDS };
|
|
533
|
+
export { getAppId, resolveObjectId as getObject, SCHEMA_FIELDS };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { projectValidationError } from '../errors.js';
|
|
2
|
+
import { assertWeaverSuccess } from '../host.js';
|
|
2
3
|
export function asObject(value, field = 'input') {
|
|
3
4
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
4
5
|
throw projectValidationError('field_invalid', `${field} 必须是 JSON 对象`);
|
|
@@ -66,3 +67,24 @@ export function stableFingerprint(value) {
|
|
|
66
67
|
}
|
|
67
68
|
return `${text.length}:${hash.toString(16)}`;
|
|
68
69
|
}
|
|
70
|
+
export const DEFAULT_OBJ_IDS = { task: '1020270486210527232', project: '1020275562853482532' };
|
|
71
|
+
/** 详情卡片地址:`{baseUrl}/sp/ebdfpage/card/0/{objId}/{dataId}`。参数不全或 dataId 含分隔符时返回 null。 */
|
|
72
|
+
export function buildCardUrl(baseUrl, objId, dataId) {
|
|
73
|
+
if (!baseUrl || !objId || !dataId || /[\s/\\?#]/u.test(dataId))
|
|
74
|
+
return null;
|
|
75
|
+
return `${baseUrl.replace(/\/+$/u, '')}/sp/ebdfpage/card/0/${objId}/${dataId}`;
|
|
76
|
+
}
|
|
77
|
+
/** 解析当前环境下的表单对象 ID(列表/详情/新建共用)。 */
|
|
78
|
+
export async function resolveObjectId(host, value) {
|
|
79
|
+
const response = await host.request({
|
|
80
|
+
method: 'GET',
|
|
81
|
+
path: '/api/ebproject/backendConsole/getCurrentObjId',
|
|
82
|
+
query: { objId: DEFAULT_OBJ_IDS[value] },
|
|
83
|
+
operation: 'project.object.id',
|
|
84
|
+
});
|
|
85
|
+
assertWeaverSuccess(response, 'project.object.id');
|
|
86
|
+
const object = String(response?.data ?? '');
|
|
87
|
+
if (!object)
|
|
88
|
+
throw new Error('接口未返回当前环境对象 ID');
|
|
89
|
+
return object;
|
|
90
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { projectPartialError, projectValidationError } from '../errors.js';
|
|
2
2
|
import { assertDatajsonSuccess } from '../host.js';
|
|
3
3
|
import { SCHEMA_CONFIRM, SCHEMA_CONTINUATION, SCHEMA_FIELDS, SCHEMA_ID_STRING, SCHEMA_RECORDS, projectSuccess, schemaOf, } from './types.js';
|
|
4
|
-
import { asObject, idString, operatorId, stableFingerprint } from './shared.js';
|
|
4
|
+
import { asObject, buildCardUrl, idString, operatorId, resolveObjectId, stableFingerprint } from './shared.js';
|
|
5
5
|
const WRITE_TARGETS = {
|
|
6
6
|
taskCreate: { entity: 'task', action: 'create', listPath: '', detailPath: '/api/ebuilder/form/formdata/v2/getFormDataByPk/queryTaskDetail', writePath: '/api/ebuilder/form/formdata/v2/saveFormData/createTask' },
|
|
7
7
|
taskUpdate: { entity: 'task', action: 'update', listPath: '', detailPath: '/api/ebuilder/form/formdata/v2/getFormDataByPk/queryTaskDetail', writePath: '/api/ebuilder/form/formdata/v2/updateFormData/updateTask' },
|
|
@@ -62,6 +62,31 @@ async function sendWrite(host, operation, path, datajsonObject) {
|
|
|
62
62
|
assertDatajsonSuccess(response, operation);
|
|
63
63
|
return response?.datajson ?? null;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* 新建成功后,把返回的 dataIds 映射成详情页地址,供展示层把记录名称渲染为可点击链接。
|
|
67
|
+
* 链接解析失败不影响创建结果(写入已成功),只附带 detail_url_warning。
|
|
68
|
+
*/
|
|
69
|
+
async function decorateCreatedRecords(host, entity, data) {
|
|
70
|
+
if (!data || typeof data !== 'object')
|
|
71
|
+
return data;
|
|
72
|
+
const value = data;
|
|
73
|
+
const ids = Array.isArray(value.dataIds)
|
|
74
|
+
? value.dataIds.map((item) => String(item)).filter((item) => item !== '')
|
|
75
|
+
: [];
|
|
76
|
+
if (ids.length === 0)
|
|
77
|
+
return data;
|
|
78
|
+
try {
|
|
79
|
+
const [objId, session] = await Promise.all([resolveObjectId(host, entity), host.getSession()]);
|
|
80
|
+
const urls = ids.map((id) => buildCardUrl(session.baseUrl, objId, id));
|
|
81
|
+
return urls.some((url) => url !== null) ? { ...value, detail_urls: urls } : data;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return {
|
|
85
|
+
...value,
|
|
86
|
+
detail_url_warning: `详情链接暂不可用:${error instanceof Error ? error.message : String(error)};创建已成功,不要因此重试。`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
65
90
|
async function verifySession(env, continuation) {
|
|
66
91
|
if (continuation.userId !== await operatorId(env.host)) {
|
|
67
92
|
throw projectValidationError('continuation_mismatch', 'continuation 与当前登录会话不匹配');
|
|
@@ -119,7 +144,8 @@ function createOperations(namePrefix, target) {
|
|
|
119
144
|
await verifySession(env, continuation);
|
|
120
145
|
const datajson = asObject(continuation.datajson, 'continuation.datajson');
|
|
121
146
|
const response = await sendWrite(env.host, applyName, target.writePath, datajson);
|
|
122
|
-
|
|
147
|
+
const data = await decorateCreatedRecords(env.host, target.entity, response);
|
|
148
|
+
return projectSuccess(applyName, data, { targetType: target.entity, writeAction: 'create' });
|
|
123
149
|
},
|
|
124
150
|
},
|
|
125
151
|
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reception 域常量。
|
|
3
|
+
*
|
|
4
|
+
* 与环境有关的路径一律不写死在这里:状态目录由 `stateRoot(ctx)` 提供,
|
|
5
|
+
* 模板与 render.py 由技能包自带、通过参数或快照同目录推导。
|
|
6
|
+
*/
|
|
7
|
+
/** 目标流程名。可用 --workflow 覆盖,用于同租户内的变体流程。 */
|
|
8
|
+
export const DEFAULT_WORKFLOW = '泛微客户参观接待流程';
|
|
9
|
+
/** 状态目录名,落在 `<stateRoot>/reception/` 下,跟 profile 走。 */
|
|
10
|
+
export const STATE_SUBDIR = 'reception';
|
|
11
|
+
/** 产物默认输出目录(宿主不传 --out-dir 时)。 */
|
|
12
|
+
export const DEFAULT_OUT_DIR_WIN = '.reception-cli/out';
|
|
13
|
+
export const DEFAULT_OUT_DIR_POSIX = '/workspace/files';
|
|
14
|
+
/** 后勤 6 项 + 手机号:不给预设选项,一律手动填写。 */
|
|
15
|
+
export const LOGISTICS_FIELDS = ['headcount', 'meetingRoom', 'pickup', 'meal', 'hotel', 'gift'];
|
|
16
|
+
export const LOGISTICS_LABEL = {
|
|
17
|
+
headcount: '人数',
|
|
18
|
+
meetingRoom: '会议室',
|
|
19
|
+
pickup: '接送/用车',
|
|
20
|
+
meal: '用餐',
|
|
21
|
+
hotel: '住宿',
|
|
22
|
+
gift: '伴手礼',
|
|
23
|
+
mobile: '手机',
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 面板标题。宿主硬约束(实测):title 严格单行,超长直接截断成「…」。
|
|
27
|
+
* 只留一句短话,完整样例放 placeholder,口径放 hint(不渲染,仅模型兜底)。
|
|
28
|
+
*/
|
|
29
|
+
export const LOGISTICS_TITLE = '接待细节(人数、具体安排、用餐情况等)';
|
|
30
|
+
/** 输入框灰字:固定字段清单。样例里的手机号会被宿主脱敏成 [[PHONE_001]],所以不给样例。 */
|
|
31
|
+
export const LOGISTICS_PLACEHOLDER = '客户人数、是否会议、是否接送、是否用餐、是否代订住宿、是否伴手礼、陪同人员手机号';
|
|
32
|
+
/** 模型侧兜底口径。宿主不渲染 hint,切勿并入 title。 */
|
|
33
|
+
export const LOGISTICS_HINT = [
|
|
34
|
+
'照输入框灰字样例写,逗号或「|」隔开都行;没定的项直接不写。',
|
|
35
|
+
'人数:如「10人」',
|
|
36
|
+
'会议室:总部129 / 总部130 / 总部131,或「不需会议室」',
|
|
37
|
+
'接送/用车:如「虹桥接机2辆商务车 10:00」或「不用车」',
|
|
38
|
+
'用餐:公司食堂 / 小餐厅 / 外部餐厅 / 不用餐',
|
|
39
|
+
'住宿:如「2间大床房住1晚」或「不住」',
|
|
40
|
+
'伴手礼:如「礼盒每人1份」或「不用」',
|
|
41
|
+
'手机:11 位,只用于行程单显示接待人联系方式(系统不查员工手机号)',
|
|
42
|
+
].join('\n');
|
|
43
|
+
/** 客户需求面板的固定选项。取值为原文,模型检索案例时直接用它拼检索词。 */
|
|
44
|
+
export const CUSTOMER_NEED_OPTIONS = [
|
|
45
|
+
'了解泛微产品与政务行业解决方案',
|
|
46
|
+
'参观总部环境与展厅,了解公司实力',
|
|
47
|
+
'交流具体项目合作与实施细节',
|
|
48
|
+
'暂未确定,先进待办',
|
|
49
|
+
];
|
|
50
|
+
/** 快照文件的 kind 标识,用于拒收无关 JSON。 */
|
|
51
|
+
export const SNAPSHOT_KIND = 'reception-fields-snapshot';
|
|
52
|
+
/** python 探测结果的缓存时长(7 天)。 */
|
|
53
|
+
export const PYTHON_CACHE_TTL_MS = 7 * 24 * 3600 * 1000;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CliError, ExitCode } from '../../core/errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* reception 域内结构化错误。
|
|
4
|
+
*
|
|
5
|
+
* 约定:
|
|
6
|
+
* - `type` 用 CLI 规范的分类词(validation / environment / business / authentication);
|
|
7
|
+
* - `subtype` 保留接待流程既有的全大写业务码(KNOWN_REQUIRED / RUN_NOT_FOUND 等),
|
|
8
|
+
* SKILL.md 与历史排障记录都按这套码检索,改小写会让文档与实现脱节。
|
|
9
|
+
*/
|
|
10
|
+
export class ReceptionCliError extends CliError {
|
|
11
|
+
type;
|
|
12
|
+
subtype;
|
|
13
|
+
retryable;
|
|
14
|
+
stage;
|
|
15
|
+
details;
|
|
16
|
+
constructor(type, subtype, message, options = {}) {
|
|
17
|
+
super(message, options.exitCode ?? ExitCode.GeneralError);
|
|
18
|
+
this.name = 'ReceptionCliError';
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.subtype = subtype;
|
|
21
|
+
this.retryable = options.retryable ?? false;
|
|
22
|
+
this.stage = options.stage;
|
|
23
|
+
this.details = options.details;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** 入参问题:缺参数、JSON 不合法、校验不过。退出码 2。 */
|
|
27
|
+
export const receptionValidationError = (subtype, message, details) => new ReceptionCliError('validation', subtype, message, {
|
|
28
|
+
details,
|
|
29
|
+
exitCode: ExitCode.UsageError,
|
|
30
|
+
});
|
|
31
|
+
/** 环境问题:缺 python、缺快照、渲染脚本找不到。退出码 3。 */
|
|
32
|
+
export const receptionEnvironmentError = (subtype, message, details) => new ReceptionCliError('environment', subtype, message, {
|
|
33
|
+
details,
|
|
34
|
+
exitCode: ExitCode.AuthError,
|
|
35
|
+
});
|
|
36
|
+
/** 业务问题:渲染失败、上传失败、run 丢失。退出码 1。 */
|
|
37
|
+
export const receptionBusinessError = (subtype, message, details) => new ReceptionCliError('business', subtype, message, {
|
|
38
|
+
details,
|
|
39
|
+
exitCode: ExitCode.GeneralError,
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* run 状态缺失。
|
|
43
|
+
*
|
|
44
|
+
* 与其它业务错误分开放:调用方(doc)会捕获它走"带 --known 现场重建"的分支,
|
|
45
|
+
* 因此必须是可识别的类型,不能只是一个 message。
|
|
46
|
+
*/
|
|
47
|
+
export const receptionRunNotFound = (runId, stateDir) => new ReceptionCliError('business', 'RUN_NOT_FOUND', `找不到 run:${runId}`, {
|
|
48
|
+
exitCode: ExitCode.GeneralError,
|
|
49
|
+
details: {
|
|
50
|
+
runId,
|
|
51
|
+
stateDir,
|
|
52
|
+
hint: '把 ask 用过的 --known 与 answers 一起带上重跑 doc,CLI 会现场重建 run',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { getE10Session } from '../../internal/e10/context.js';
|
|
2
|
+
import { E10ApiError, createE10RequestRuntime, } from '../../internal/e10/request-runtime.js';
|
|
3
|
+
import { receptionBusinessError, receptionEnvironmentError } from './errors.js';
|
|
4
|
+
import { UploadProtocolError, uploadToFileService } from './upload.js';
|
|
5
|
+
/** 单次上传的总时限。分片上传是多轮请求,留足 3 分钟。 */
|
|
6
|
+
const UPLOAD_TIMEOUT_MS = 180_000;
|
|
7
|
+
export function createReceptionHost(ctx) {
|
|
8
|
+
let cached = null;
|
|
9
|
+
async function resolve() {
|
|
10
|
+
if (cached)
|
|
11
|
+
return cached;
|
|
12
|
+
const e10 = await getE10Session(ctx);
|
|
13
|
+
if (!e10) {
|
|
14
|
+
cached = {
|
|
15
|
+
e10: null,
|
|
16
|
+
info: {
|
|
17
|
+
available: false,
|
|
18
|
+
baseUrl: '',
|
|
19
|
+
userId: '',
|
|
20
|
+
reason: '未取得 E10 会话:附件不会上传,产物按本地文件交付',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return cached;
|
|
24
|
+
}
|
|
25
|
+
cached = {
|
|
26
|
+
e10,
|
|
27
|
+
info: { available: true, baseUrl: e10.getBaseUrl(), userId: e10.userId },
|
|
28
|
+
};
|
|
29
|
+
return cached;
|
|
30
|
+
}
|
|
31
|
+
async function getSession() {
|
|
32
|
+
return (await resolve()).info;
|
|
33
|
+
}
|
|
34
|
+
async function requireRuntime() {
|
|
35
|
+
const { e10, info } = await resolve();
|
|
36
|
+
if (!e10) {
|
|
37
|
+
throw receptionEnvironmentError('NO_SESSION', info.reason || '未取得 E10 会话');
|
|
38
|
+
}
|
|
39
|
+
return { runtime: createE10RequestRuntime(ctx, e10), session: info };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 上传一份文件。
|
|
43
|
+
*
|
|
44
|
+
* 走 teamsCheck → preUploadCheck → module/upload 三阶段(见 `upload.ts`)。
|
|
45
|
+
* 旧的 `/api/file/upload` 已废弃,调用只会得到 200 + 空响应,别再回去。
|
|
46
|
+
*/
|
|
47
|
+
async function uploadFile(filePath, options = {}) {
|
|
48
|
+
const { e10, info } = await resolve();
|
|
49
|
+
if (!e10) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
reason: 'NO_SESSION',
|
|
53
|
+
localPath: filePath,
|
|
54
|
+
error: info.reason || '无可用会话,已跳过上传(文件已生成,按本地文件交付)',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const baseUrl = String(info.baseUrl || '').replace(/\/+$/u, '');
|
|
58
|
+
const runtime = createE10RequestRuntime(ctx, e10);
|
|
59
|
+
// 默认 document(E10 的文件归属取值);需要别的归属时用 RECEPTION_UPLOAD_MODULE 覆盖。
|
|
60
|
+
const module = options.module || process.env.RECEPTION_UPLOAD_MODULE || 'document';
|
|
61
|
+
try {
|
|
62
|
+
const uploaded = await uploadToFileService({
|
|
63
|
+
transport: {
|
|
64
|
+
post: (path, formData) => runtime.requestJson({
|
|
65
|
+
module: 'reception',
|
|
66
|
+
operation: 'reception.upload',
|
|
67
|
+
method: 'POST',
|
|
68
|
+
path,
|
|
69
|
+
formData,
|
|
70
|
+
headers: {
|
|
71
|
+
langtype: 'zh_CN',
|
|
72
|
+
referer: `${baseUrl}/`,
|
|
73
|
+
},
|
|
74
|
+
timeoutMs: UPLOAD_TIMEOUT_MS,
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
filePath,
|
|
78
|
+
module,
|
|
79
|
+
userId: info.userId ? String(info.userId) : undefined,
|
|
80
|
+
name: options.name,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
ok: true,
|
|
84
|
+
fileid: uploaded.fileid,
|
|
85
|
+
name: uploaded.name,
|
|
86
|
+
size: uploaded.size,
|
|
87
|
+
kind: uploaded.kind,
|
|
88
|
+
localPath: filePath,
|
|
89
|
+
previewUrl: `${baseUrl}/sp/file/filePreview/${uploaded.fileid}`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (error instanceof UploadProtocolError) {
|
|
94
|
+
return {
|
|
95
|
+
ok: false,
|
|
96
|
+
localPath: filePath,
|
|
97
|
+
reason: error.subtype,
|
|
98
|
+
error: error.message,
|
|
99
|
+
httpStatus: error.httpStatus,
|
|
100
|
+
contentType: error.contentType,
|
|
101
|
+
detail: error.detail,
|
|
102
|
+
hint: `链路 teamsCheck → preUploadCheck → module/upload,module=${module}`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (error instanceof E10ApiError) {
|
|
106
|
+
return { ok: false, localPath: filePath, reason: 'UPLOAD_NETWORK', error: `网络异常: ${error.message}` };
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
ok: false,
|
|
110
|
+
localPath: filePath,
|
|
111
|
+
reason: 'UPLOAD_LOCAL_ERROR',
|
|
112
|
+
error: `上传异常: ${error.message}`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { getSession, requireRuntime, uploadFile };
|
|
117
|
+
}
|
|
118
|
+
/** 未登录时不该静默继续的场景,统一用它取 baseUrl 并给出可读错误。 */
|
|
119
|
+
export async function requireBaseUrl(host) {
|
|
120
|
+
const session = await host.getSession();
|
|
121
|
+
if (!session.available || !session.baseUrl) {
|
|
122
|
+
throw receptionBusinessError('BASE_URL_MISSING', '未取得 E10 会话,无法确定环境地址');
|
|
123
|
+
}
|
|
124
|
+
return session.baseUrl;
|
|
125
|
+
}
|