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
|
@@ -5,6 +5,7 @@ import { CliError, ExitCode } from '../../../core/errors.js';
|
|
|
5
5
|
import { clearInvoiceTokenForSession } from '../../../shortcuts/invoice/host.js';
|
|
6
6
|
import { buildE10CookieHeader, E10AuthSession, clearProfileAuthFile, extractRawSetCookie, extractSessionTicket, findAuthFile, getActiveProfile, getProfileAuthPath, getProfileDir, listProfiles, profileNameFromUrl, readProfileConfig, readTeamsCheckUserInfo, saveAuthFile, saveProfileConfig, setActiveProfile, switchActiveProfile, } from './session.js';
|
|
7
7
|
import { getE10AuthRoot } from './paths.js';
|
|
8
|
+
import { appendXiaoEAuthErrorLog, clearXiaoEAuthErrorLog, getXiaoEAuthErrorLogPath, normalizeXiaoEAuthErrorLogLimit, readXiaoEAuthErrorLog, xiaoEAuthLogSecrets, } from './error-log.js';
|
|
8
9
|
import { XIAOE_AGENT_TYPE, createXiaoEUnifiedLoginUnavailableError, hasXiaoEEnv, inspectXiaoEUnifiedLoginSources, resolveXiaoEPreferredBaseUrl, tryXiaoEUnifiedLogin as tryXiaoEUnifiedSessionLogin, } from './xiaoe.js';
|
|
9
10
|
export { DEFAULT_E10_BASE_URL, XIAOE_AGENT_TYPE, hasXiaoEEnv, hasXiaoETokenScript, hasXiaoEUnifiedLoginSource, inspectXiaoEUnifiedLoginSources, resolveXiaoEDefaultBaseUrl, resolveXiaoEPreferredBaseUrl, resolveXiaoEUnifiedLoginCredential, } from './xiaoe.js';
|
|
10
11
|
const DEFAULT_AGENT_TYPE = 'weaver-work-cli';
|
|
@@ -385,7 +386,7 @@ async function saveEteamsIdLogin(input) {
|
|
|
385
386
|
version: input.version || '',
|
|
386
387
|
};
|
|
387
388
|
}
|
|
388
|
-
async function tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKeyFallback, profileHint, allowTokenScript = false) {
|
|
389
|
+
async function tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKeyFallback, profileHint, allowTokenScript = false, diagnostics) {
|
|
389
390
|
const login = await tryXiaoEUnifiedSessionLogin({
|
|
390
391
|
env: ctx.env,
|
|
391
392
|
baseUrl,
|
|
@@ -394,6 +395,7 @@ async function tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKeyFallback, profileHint
|
|
|
394
395
|
profileHint,
|
|
395
396
|
allowTokenScript,
|
|
396
397
|
logger: ctx.logger,
|
|
398
|
+
diagnostics,
|
|
397
399
|
});
|
|
398
400
|
return login?.result || null;
|
|
399
401
|
}
|
|
@@ -529,6 +531,15 @@ async function runXiaoELogin(ctx, options) {
|
|
|
529
531
|
const useXiaoELogin = xiaoESources.any;
|
|
530
532
|
const baseUrl = preferredXiaoEBaseUrl;
|
|
531
533
|
const tenantKey = optionString(commandOpts, 'tenantKey');
|
|
534
|
+
const diagnostics = {
|
|
535
|
+
attemptedSteps: [],
|
|
536
|
+
baseUrl,
|
|
537
|
+
clientType: xiaoESources.clientType,
|
|
538
|
+
platformCredentialDetected: xiaoESources.platformCredential,
|
|
539
|
+
};
|
|
540
|
+
if (!useXiaoELogin) {
|
|
541
|
+
diagnostics.attemptedSteps.push('platform_token:missing', 'bundled_env_script:missing', xiaoESources.clientType === 'cloud' ? 'token_script:disabled' : 'token_script:missing', xiaoESources.clientType === 'cloud' ? 'client_session:disabled' : 'client_session:missing', 'environment_map:empty');
|
|
542
|
+
}
|
|
532
543
|
ctx.logger.info([
|
|
533
544
|
'XiaoE unified login preflight:',
|
|
534
545
|
'authMode=xiaoe',
|
|
@@ -538,15 +549,38 @@ async function runXiaoELogin(ctx, options) {
|
|
|
538
549
|
`tokenScriptDetected=${String(xiaoESources.tokenScript)}`,
|
|
539
550
|
`clientSettingsDetected=${String(xiaoESources.clientCredential)}`,
|
|
540
551
|
`environmentCredentialDetected=${String(xiaoESources.environmentCredential)}`,
|
|
552
|
+
`clientType=${xiaoESources.clientType || '(unset)'}`,
|
|
541
553
|
`baseUrl=${baseUrl || '(unresolved)'}`,
|
|
542
554
|
].join(' '));
|
|
543
555
|
if (useXiaoELogin) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
556
|
+
try {
|
|
557
|
+
const xiaoEResult = await tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKey, profileFromGlobal, true, diagnostics);
|
|
558
|
+
if (xiaoEResult)
|
|
559
|
+
return xiaoEResult;
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
await appendXiaoEAuthErrorLog({
|
|
563
|
+
source: 'login',
|
|
564
|
+
profile: profileFromGlobal || getActiveProfile(),
|
|
565
|
+
baseUrl,
|
|
566
|
+
diagnostics,
|
|
567
|
+
error,
|
|
568
|
+
secrets: xiaoEAuthLogSecrets(ctx.env),
|
|
569
|
+
}).catch((logError) => ctx.logger.debug(`Could not persist XiaoE auth error log: ${logError instanceof Error ? logError.message : String(logError)}`));
|
|
570
|
+
throw error;
|
|
571
|
+
}
|
|
547
572
|
}
|
|
548
573
|
ctx.logger.warn(xiaoEUnifiedLoginUnavailableMessage(baseUrl, useXiaoELogin));
|
|
549
|
-
|
|
574
|
+
const error = createXiaoEUnifiedLoginUnavailableError(baseUrl);
|
|
575
|
+
await appendXiaoEAuthErrorLog({
|
|
576
|
+
source: 'login',
|
|
577
|
+
profile: profileFromGlobal || getActiveProfile(),
|
|
578
|
+
baseUrl,
|
|
579
|
+
diagnostics,
|
|
580
|
+
error,
|
|
581
|
+
secrets: xiaoEAuthLogSecrets(ctx.env),
|
|
582
|
+
}).catch((logError) => ctx.logger.debug(`Could not persist XiaoE auth error log: ${logError instanceof Error ? logError.message : String(logError)}`));
|
|
583
|
+
throw error;
|
|
550
584
|
}
|
|
551
585
|
async function runBrowserLogin(ctx, options) {
|
|
552
586
|
const commandOpts = asOptions(options);
|
|
@@ -767,7 +801,78 @@ function formatWhoami(title, data) {
|
|
|
767
801
|
'User-Agent: ' + (data.userAgent || ''),
|
|
768
802
|
].join('\n');
|
|
769
803
|
}
|
|
770
|
-
function
|
|
804
|
+
function formatXiaoEAuthErrorLogEntry(entry) {
|
|
805
|
+
const lines = [
|
|
806
|
+
`[${entry.timestamp}] ${entry.source} id=${entry.id}`,
|
|
807
|
+
...(entry.profile ? [`profile: ${entry.profile}`] : []),
|
|
808
|
+
...(entry.baseUrl ? [`baseUrl: ${entry.baseUrl}`] : []),
|
|
809
|
+
...(entry.clientType ? [`clientType: ${entry.clientType}`] : []),
|
|
810
|
+
...(entry.attemptedSteps.length ? [`attemptedSteps: ${entry.attemptedSteps.join(', ')}`] : []),
|
|
811
|
+
...(entry.lastError ? [`lastError: ${entry.lastError}`] : []),
|
|
812
|
+
...(entry.resultSessionExpired ? ['resultSessionExpired: true'] : []),
|
|
813
|
+
...(entry.error ? [`error: ${entry.error.type}/${entry.error.subtype}: ${entry.error.message}`] : []),
|
|
814
|
+
];
|
|
815
|
+
for (const failure of entry.failures || []) {
|
|
816
|
+
lines.push([
|
|
817
|
+
`failure: ${failure.stage}/${failure.kind}`,
|
|
818
|
+
failure.causeCode ? `causeCode=${failure.causeCode}` : '',
|
|
819
|
+
failure.httpStatus === undefined ? '' : `httpStatus=${failure.httpStatus}`,
|
|
820
|
+
failure.message,
|
|
821
|
+
].filter(Boolean).join(' '));
|
|
822
|
+
}
|
|
823
|
+
return lines.join('\n');
|
|
824
|
+
}
|
|
825
|
+
async function showXiaoEAuthErrorLogs(ctx, options) {
|
|
826
|
+
const commandOpts = asOptions(options);
|
|
827
|
+
let limit;
|
|
828
|
+
try {
|
|
829
|
+
limit = normalizeXiaoEAuthErrorLogLimit(commandOpts.limit);
|
|
830
|
+
}
|
|
831
|
+
catch (error) {
|
|
832
|
+
throw new CliError(error instanceof Error ? error.message : String(error), ExitCode.UsageError);
|
|
833
|
+
}
|
|
834
|
+
const result = await readXiaoEAuthErrorLog(limit);
|
|
835
|
+
const text = result.entries.length
|
|
836
|
+
? [
|
|
837
|
+
`XiaoE auth error logs (${result.returned}/${result.total}, newest first)`,
|
|
838
|
+
`logFile: ${result.path}`,
|
|
839
|
+
...(result.invalidLines ? [`invalidLines: ${result.invalidLines}`] : []),
|
|
840
|
+
'',
|
|
841
|
+
result.entries.map(formatXiaoEAuthErrorLogEntry).join('\n\n'),
|
|
842
|
+
].join('\n')
|
|
843
|
+
: [
|
|
844
|
+
'No XiaoE auth error logs.',
|
|
845
|
+
`logFile: ${result.path}`,
|
|
846
|
+
...(result.invalidLines ? [`invalidLines: ${result.invalidLines}`] : []),
|
|
847
|
+
].join('\n');
|
|
848
|
+
ctx.output.write(result, { text });
|
|
849
|
+
}
|
|
850
|
+
function registerXiaoEAuthLogCommands(auth, action) {
|
|
851
|
+
const logs = auth.command('logs')
|
|
852
|
+
.description('View or clear persisted XiaoE authentication error logs')
|
|
853
|
+
.option('--limit <n>', 'number of recent entries to show (1-500)', '50')
|
|
854
|
+
.action(action(showXiaoEAuthErrorLogs));
|
|
855
|
+
logs.command('show')
|
|
856
|
+
.description('Show persisted XiaoE authentication error logs')
|
|
857
|
+
.option('--limit <n>', 'number of recent entries to show (1-500)', '50')
|
|
858
|
+
.action(action(showXiaoEAuthErrorLogs));
|
|
859
|
+
logs.command('path')
|
|
860
|
+
.description('Print the XiaoE authentication error log path')
|
|
861
|
+
.action(action((ctx) => {
|
|
862
|
+
const path = getXiaoEAuthErrorLogPath();
|
|
863
|
+
ctx.output.write({ path }, { text: path });
|
|
864
|
+
}));
|
|
865
|
+
logs.command('clear')
|
|
866
|
+
.description('Clear persisted XiaoE authentication error logs')
|
|
867
|
+
.action(action(async (ctx) => {
|
|
868
|
+
const result = await clearXiaoEAuthErrorLog();
|
|
869
|
+
const text = result.cleared
|
|
870
|
+
? `Cleared XiaoE auth error logs.\nlogFile: ${result.path}`
|
|
871
|
+
: `No XiaoE auth error logs to clear.\nlogFile: ${result.path}`;
|
|
872
|
+
ctx.output.write(result, { text });
|
|
873
|
+
}));
|
|
874
|
+
}
|
|
875
|
+
function registerBrowserLoginCommand(auth, action, name, description, machine = false) {
|
|
771
876
|
const command = auth.command(name)
|
|
772
877
|
.description(description)
|
|
773
878
|
.option('--base-url <url>', 'E10 base URL')
|
|
@@ -777,8 +882,28 @@ function registerBrowserLoginCommand(auth, action, name, description) {
|
|
|
777
882
|
.option('--agent-type <value>', 'Alias of --agent_type')
|
|
778
883
|
.option('--agent-return-url <url>', 'Desktop application URL linked by the login success page');
|
|
779
884
|
command.action(action(async (ctx, options) => {
|
|
780
|
-
|
|
781
|
-
|
|
885
|
+
if (!machine) {
|
|
886
|
+
const result = await runBrowserLogin(ctx, options);
|
|
887
|
+
ctx.output.write(result, { text: formatLoginResult(result) });
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
// 平台型连接器契约:stdout 只出严格 JSON,进度与授权链接走 stderr。
|
|
891
|
+
ctx.logger.machineMode = true;
|
|
892
|
+
try {
|
|
893
|
+
const result = await runBrowserLogin(ctx, options);
|
|
894
|
+
ctx.output.raw(JSON.stringify({
|
|
895
|
+
status: 'authorized',
|
|
896
|
+
employeeId: result.userId || '',
|
|
897
|
+
tenantKey: result.tenantKey || '',
|
|
898
|
+
}));
|
|
899
|
+
}
|
|
900
|
+
catch (error) {
|
|
901
|
+
ctx.output.raw(JSON.stringify({ status: 'unauthorized' }));
|
|
902
|
+
throw error;
|
|
903
|
+
}
|
|
904
|
+
finally {
|
|
905
|
+
ctx.logger.machineMode = false;
|
|
906
|
+
}
|
|
782
907
|
}));
|
|
783
908
|
}
|
|
784
909
|
function registerXiaoELoginCommand(auth, action) {
|
|
@@ -846,6 +971,35 @@ export function registerE10AuthCommands(parent, action) {
|
|
|
846
971
|
};
|
|
847
972
|
ctx.output.write(status, { text: formatAuthStatus(status) });
|
|
848
973
|
}));
|
|
974
|
+
auth.command('show')
|
|
975
|
+
.description('Platform contract: print login status as {"status":"authorized"|"unauthorized"}')
|
|
976
|
+
.option('--status', 'print only the strict JSON status object')
|
|
977
|
+
.option('--no-check', 'skip remote session validity check')
|
|
978
|
+
.action(action(async (ctx, options) => {
|
|
979
|
+
const opts = ctx.getGlobalOptions();
|
|
980
|
+
const commandOpts = asOptions(options);
|
|
981
|
+
const authFile = findAuthFile(ctx.cwd, opts);
|
|
982
|
+
const session = authFile ? E10AuthSession.fromFile(authFile, opts.baseUrl, opts.passportUrl) : null;
|
|
983
|
+
const profile = opts.profile || getActiveProfile();
|
|
984
|
+
const expired = session ? session.isExpired() : false;
|
|
985
|
+
// 三态探活:只有明确失效(401/403)才算未授权,网络异常保持乐观,避免逼用户重复登录。
|
|
986
|
+
const probe = session && !expired && commandOpts.check !== false
|
|
987
|
+
? await session.probeValid()
|
|
988
|
+
: undefined;
|
|
989
|
+
const authorized = Boolean(session) && !expired && probe !== false;
|
|
990
|
+
if (commandOpts.status === true) {
|
|
991
|
+
ctx.output.raw(JSON.stringify({ status: authorized ? 'authorized' : 'unauthorized' }));
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
ctx.output.write({
|
|
995
|
+
status: authorized ? 'authorized' : 'unauthorized',
|
|
996
|
+
loggedIn: Boolean(session),
|
|
997
|
+
expired,
|
|
998
|
+
reachable: probe,
|
|
999
|
+
profile,
|
|
1000
|
+
baseUrl: session ? session.getBaseUrl() : '',
|
|
1001
|
+
}, { json: true });
|
|
1002
|
+
}));
|
|
849
1003
|
auth.command('set')
|
|
850
1004
|
.description('Save E10 auth from an ETEAMSID cookie')
|
|
851
1005
|
.requiredOption('--eteamsid <id>', 'ETEAMSID cookie value')
|
|
@@ -881,7 +1035,9 @@ export function registerE10AuthCommands(parent, action) {
|
|
|
881
1035
|
}));
|
|
882
1036
|
registerBrowserLoginCommand(auth, action, 'login', 'Open browser OAuth2.0 login and save E10 auth');
|
|
883
1037
|
registerBrowserLoginCommand(auth, action, 'oidc', 'Alias of auth login for OAuth2.0 browser login');
|
|
1038
|
+
registerBrowserLoginCommand(auth, action, 'init', 'Platform contract alias of auth login: stdout is strict JSON {"status":"authorized"}', true);
|
|
884
1039
|
registerXiaoELoginCommand(auth, action);
|
|
1040
|
+
registerXiaoEAuthLogCommands(auth, action);
|
|
885
1041
|
auth.command('logout')
|
|
886
1042
|
.alias('clear')
|
|
887
1043
|
.description('Clear saved E10 auth for the current or selected profile')
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { appendFile, chmod, mkdir, readFile, unlink } from 'node:fs/promises';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
import { toErrorEnvelope } from '../../../core/errors.js';
|
|
5
|
+
import { getE10AuthRoot } from './paths.js';
|
|
6
|
+
const XIAOE_AUTH_ERROR_LOG_NAME = 'xiaoe-auth-errors.ndjson';
|
|
7
|
+
const DEFAULT_LOG_LIMIT = 50;
|
|
8
|
+
export const MAX_XIAOE_AUTH_ERROR_LOG_LIMIT = 500;
|
|
9
|
+
/**
|
|
10
|
+
* The log lives beside the CLI-owned E10 profiles, never beside a caller-owned
|
|
11
|
+
* `--auth` file. Keeping the target fixed also makes the clear command safe.
|
|
12
|
+
*/
|
|
13
|
+
export function getXiaoEAuthErrorLogPath() {
|
|
14
|
+
return resolve(getE10AuthRoot(), 'logs', XIAOE_AUTH_ERROR_LOG_NAME);
|
|
15
|
+
}
|
|
16
|
+
export function xiaoEAuthLogSecrets(env) {
|
|
17
|
+
return Object.entries(env)
|
|
18
|
+
.filter(([key, value]) => Boolean(value
|
|
19
|
+
&& (key.startsWith('XIAOE_') || key.startsWith('WEAVER_XIAOE_'))
|
|
20
|
+
&& /(?:TOKEN|AUTH|ETEAMSID|COOKIE|SESSION|SECRET|PASSWORD)/iu.test(key)))
|
|
21
|
+
.map(([, value]) => value);
|
|
22
|
+
}
|
|
23
|
+
function redactSensitiveText(value, secrets = []) {
|
|
24
|
+
let text = value;
|
|
25
|
+
for (const secret of secrets) {
|
|
26
|
+
if (secret && secret.length >= 6)
|
|
27
|
+
text = text.split(secret).join('<redacted>');
|
|
28
|
+
}
|
|
29
|
+
return text
|
|
30
|
+
// Query strings regularly carry temporary tickets. The path is enough for diagnostics.
|
|
31
|
+
.replace(/(https?:\/\/[^\s?#]+)\?[^\s#]*/giu, '$1?<redacted>')
|
|
32
|
+
.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/giu, '$1<redacted>')
|
|
33
|
+
.replace(/((?:eteamsid|access[_-]?token|refresh[_-]?token|auth(?:orization)?|cookie|session[_-]?id|secret|password)\s*[:=]\s*)(["']?)[^\s,;}"']+/giu, '$1$2<redacted>')
|
|
34
|
+
.replace(/(["'](?:eteamsid|access[_-]?token|refresh[_-]?token|authorization|cookie|session[_-]?id|secret|password)["']\s*:\s*["'])[^"']*(["'])/giu, '$1<redacted>$2')
|
|
35
|
+
// Opaque credentials that were not labelled by the producer.
|
|
36
|
+
.replace(/\b[A-Za-z0-9_-]{48,}\b/gu, '<redacted>');
|
|
37
|
+
}
|
|
38
|
+
function sanitizeBaseUrl(value, secrets) {
|
|
39
|
+
if (!value)
|
|
40
|
+
return undefined;
|
|
41
|
+
try {
|
|
42
|
+
const url = new URL(value);
|
|
43
|
+
url.username = '';
|
|
44
|
+
url.password = '';
|
|
45
|
+
url.search = '';
|
|
46
|
+
url.hash = '';
|
|
47
|
+
return redactSensitiveText(url.toString().replace(/\/$/u, ''), secrets);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return redactSensitiveText(value, secrets);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function sanitizeFailure(failure, secrets) {
|
|
54
|
+
return {
|
|
55
|
+
stage: failure.stage,
|
|
56
|
+
kind: failure.kind,
|
|
57
|
+
message: redactSensitiveText(failure.message, secrets),
|
|
58
|
+
...(failure.causeCode ? { causeCode: redactSensitiveText(failure.causeCode, secrets) } : {}),
|
|
59
|
+
...(failure.httpStatus === undefined ? {} : { httpStatus: failure.httpStatus }),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function sanitizeError(error, secrets) {
|
|
63
|
+
if (error === undefined)
|
|
64
|
+
return undefined;
|
|
65
|
+
const envelope = toErrorEnvelope(error);
|
|
66
|
+
return {
|
|
67
|
+
...envelope,
|
|
68
|
+
message: redactSensitiveText(envelope.message, secrets),
|
|
69
|
+
// Error details can contain arbitrary server payloads. The normalized
|
|
70
|
+
// diagnostics fields above are the only details persisted to disk.
|
|
71
|
+
...(envelope.details === undefined ? {} : { details: '<omitted from persistent auth log>' }),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function createEntry(input) {
|
|
75
|
+
const secrets = input.secrets || [];
|
|
76
|
+
const diagnostics = input.diagnostics;
|
|
77
|
+
const baseUrl = sanitizeBaseUrl(input.baseUrl || diagnostics?.baseUrl, secrets);
|
|
78
|
+
const lastError = diagnostics?.lastError
|
|
79
|
+
? redactSensitiveText(diagnostics.lastError, secrets)
|
|
80
|
+
: undefined;
|
|
81
|
+
const failures = diagnostics?.failures?.map((failure) => sanitizeFailure(failure, secrets));
|
|
82
|
+
const error = sanitizeError(input.error, secrets);
|
|
83
|
+
return {
|
|
84
|
+
schemaVersion: 1,
|
|
85
|
+
id: randomUUID(),
|
|
86
|
+
timestamp: new Date().toISOString(),
|
|
87
|
+
source: input.source,
|
|
88
|
+
...(input.profile ? { profile: redactSensitiveText(input.profile, secrets) } : {}),
|
|
89
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
90
|
+
...(diagnostics?.clientType ? { clientType: diagnostics.clientType } : {}),
|
|
91
|
+
...(diagnostics?.platformCredentialDetected === undefined
|
|
92
|
+
? {}
|
|
93
|
+
: { platformCredentialDetected: diagnostics.platformCredentialDetected }),
|
|
94
|
+
attemptedSteps: (diagnostics?.attemptedSteps || []).map((step) => redactSensitiveText(step, secrets)),
|
|
95
|
+
...(lastError ? { lastError } : {}),
|
|
96
|
+
...(failures?.length ? { failures } : {}),
|
|
97
|
+
...(input.resultSessionExpired ? { resultSessionExpired: true } : {}),
|
|
98
|
+
...(error ? { error } : {}),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Append-only persistence keeps concurrent CLI processes from overwriting one
|
|
103
|
+
* another. A logging failure is returned to the caller and must never replace
|
|
104
|
+
* the original authentication error.
|
|
105
|
+
*/
|
|
106
|
+
export async function appendXiaoEAuthErrorLog(input) {
|
|
107
|
+
const path = getXiaoEAuthErrorLogPath();
|
|
108
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
109
|
+
await chmod(dirname(path), 0o700).catch(() => undefined);
|
|
110
|
+
const entry = createEntry(input);
|
|
111
|
+
await appendFile(path, `${JSON.stringify(entry)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
112
|
+
// Existing files may have been created under a permissive umask.
|
|
113
|
+
await chmod(path, 0o600).catch(() => undefined);
|
|
114
|
+
return entry;
|
|
115
|
+
}
|
|
116
|
+
function isLogEntry(value) {
|
|
117
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
118
|
+
return false;
|
|
119
|
+
const candidate = value;
|
|
120
|
+
return candidate.schemaVersion === 1
|
|
121
|
+
&& typeof candidate.id === 'string'
|
|
122
|
+
&& typeof candidate.timestamp === 'string'
|
|
123
|
+
&& (candidate.source === 'login' || candidate.source === 'recovery')
|
|
124
|
+
&& Array.isArray(candidate.attemptedSteps);
|
|
125
|
+
}
|
|
126
|
+
export function normalizeXiaoEAuthErrorLogLimit(value) {
|
|
127
|
+
if (value === undefined || value === null || value === '')
|
|
128
|
+
return DEFAULT_LOG_LIMIT;
|
|
129
|
+
const limit = Number(value);
|
|
130
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > MAX_XIAOE_AUTH_ERROR_LOG_LIMIT) {
|
|
131
|
+
throw new RangeError(`limit must be an integer between 1 and ${MAX_XIAOE_AUTH_ERROR_LOG_LIMIT}`);
|
|
132
|
+
}
|
|
133
|
+
return limit;
|
|
134
|
+
}
|
|
135
|
+
export async function readXiaoEAuthErrorLog(limit = DEFAULT_LOG_LIMIT) {
|
|
136
|
+
const normalizedLimit = normalizeXiaoEAuthErrorLogLimit(limit);
|
|
137
|
+
const path = getXiaoEAuthErrorLogPath();
|
|
138
|
+
let content = '';
|
|
139
|
+
try {
|
|
140
|
+
content = await readFile(path, 'utf8');
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error?.code !== 'ENOENT')
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
let invalidLines = 0;
|
|
147
|
+
const entries = [];
|
|
148
|
+
for (const line of content.split(/\r?\n/u)) {
|
|
149
|
+
if (!line.trim())
|
|
150
|
+
continue;
|
|
151
|
+
try {
|
|
152
|
+
const value = JSON.parse(line);
|
|
153
|
+
if (isLogEntry(value))
|
|
154
|
+
entries.push(value);
|
|
155
|
+
else
|
|
156
|
+
invalidLines += 1;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
invalidLines += 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const recent = entries.slice(-normalizedLimit).reverse();
|
|
163
|
+
return {
|
|
164
|
+
path,
|
|
165
|
+
total: entries.length,
|
|
166
|
+
returned: recent.length,
|
|
167
|
+
invalidLines,
|
|
168
|
+
entries: recent,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export async function clearXiaoEAuthErrorLog() {
|
|
172
|
+
const path = getXiaoEAuthErrorLogPath();
|
|
173
|
+
try {
|
|
174
|
+
await unlink(path);
|
|
175
|
+
return { path, cleared: true };
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
if (error?.code === 'ENOENT')
|
|
179
|
+
return { path, cleared: false };
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export const E10_REAUTH_GUIDANCE = '请结合当前宿主环境选择合适的登录方式,恢复登录后重试原请求。';
|
|
2
2
|
export const E10_AUTH_REQUIRED_MESSAGE = `E10 登录态不可用。${E10_REAUTH_GUIDANCE}`;
|
|
3
3
|
export const E10_XIAOE_RECOVERY_FAILED_MESSAGE = 'E10 登录态不可用。已尝试小 e 自动重新获取登录信息,但未取得可用登录态。请在小 e 中恢复登录后重试。';
|
|
4
|
+
export const E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE = 'E10 登录态不可用。小 e 网页端未向当前运行环境注入统一登录凭据,自动获取已停止。请检查网页技能沙箱的宿主凭据透传后重试。';
|
|
5
|
+
/**
|
|
6
|
+
* 恢复流程全程只有网络错误时的文案。此时登录态根本没有被验证过,让用户去
|
|
7
|
+
* 重新登录是误导——该做的是稍后重试。
|
|
8
|
+
*/
|
|
9
|
+
export const E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE = '暂时无法连接 E10,请稍后重试';
|
|
4
10
|
export const E10_SESSION_EXPIRED_MESSAGE = `E10 登录态已失效,本次操作已停止。${E10_REAUTH_GUIDANCE}`;
|
|
@@ -4,8 +4,14 @@ import { dirname, resolve } from 'node:path';
|
|
|
4
4
|
import { CliError, ExitCode } from '../../../core/errors.js';
|
|
5
5
|
import { isConnectorMode } from '../../../core/connector.js';
|
|
6
6
|
import { writeWithRetry } from '../../../core/write-with-retry.js';
|
|
7
|
+
import { createTimeoutSignal } from '../network-error.js';
|
|
7
8
|
import { encryptAuthData, parseAuthFile } from './crypto.js';
|
|
8
9
|
import { getE10ActiveProfilePath, getE10ProfilesRoot } from './paths.js';
|
|
10
|
+
/**
|
|
11
|
+
* teamsCheck 与会话探测都是「发业务请求之前的必经往返」,没有上限时一个半开
|
|
12
|
+
* 连接就能把整条命令挂死。所有这类小请求统一用这个超时。
|
|
13
|
+
*/
|
|
14
|
+
export const E10_TEAMS_CHECK_TIMEOUT_MS = 15_000;
|
|
9
15
|
const RSA_PUBLIC_KEY_PEM = `-----BEGIN PUBLIC KEY-----
|
|
10
16
|
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCEOk/WyyJKdAHIfMODFnKg7MBoraFBnL3F18hhLx5n01J5g4hCkmpc5+KQFKIQIA/QWk9m7QBzI/OV9ZDFk54LaWm3xP8C+P1TPp7UVGz3iNDLdvgSxuGEYPmML3NaqkbVlvW7/NlNA3ED4Kao7rR5GUYSdFfbaBoxBFae638hzQIDAQAB
|
|
11
17
|
-----END PUBLIC KEY-----`;
|
|
@@ -435,6 +441,8 @@ export class E10AuthSession {
|
|
|
435
441
|
return session;
|
|
436
442
|
}
|
|
437
443
|
async fetchEmployeeId() {
|
|
444
|
+
// 富化不是关键路径:超时就放弃,不能让 teamsCheck 无限等待。
|
|
445
|
+
const { signal, clear } = createTimeoutSignal(E10_TEAMS_CHECK_TIMEOUT_MS);
|
|
438
446
|
try {
|
|
439
447
|
const resp = await fetch(`${this.getBaseUrl()}/api/baseserver/layout/teamsCheck?clientType=not_xinchuang&client=WEB&domainName=${encodeURIComponent(this.getBaseUrl())}`, {
|
|
440
448
|
method: 'POST',
|
|
@@ -446,6 +454,7 @@ export class E10AuthSession {
|
|
|
446
454
|
'user-agent': this.uaHeader(),
|
|
447
455
|
origin: this.getBaseUrl(),
|
|
448
456
|
},
|
|
457
|
+
signal,
|
|
449
458
|
});
|
|
450
459
|
const data = await resp.json().catch(() => ({}));
|
|
451
460
|
const userInfo = readTeamsCheckUserInfo(resp, data);
|
|
@@ -465,8 +474,19 @@ export class E10AuthSession {
|
|
|
465
474
|
catch {
|
|
466
475
|
// Non-critical profile enrichment.
|
|
467
476
|
}
|
|
477
|
+
finally {
|
|
478
|
+
clear();
|
|
479
|
+
}
|
|
468
480
|
}
|
|
469
|
-
|
|
481
|
+
/**
|
|
482
|
+
* 三态探活:`true` 明确有效、`false` 明确失效(401/403)、`undefined` 无法判定(网络/5xx)。
|
|
483
|
+
*
|
|
484
|
+
* 为什么要和 `checkValid()` 分开:平台连接器判断"是否已登录"时,
|
|
485
|
+
* 把网络抖动当成"未登录"会逼用户重复登录;而把 401 当成"已登录"会让后续业务全失败。
|
|
486
|
+
* 未认定失效时保持乐观,明确失效才降级。
|
|
487
|
+
*/
|
|
488
|
+
async probeValid() {
|
|
489
|
+
const { signal, clear } = createTimeoutSignal(E10_TEAMS_CHECK_TIMEOUT_MS);
|
|
470
490
|
try {
|
|
471
491
|
const resp = await fetch(`${this.getBaseUrl()}/api/ecode/tree/list?parentId=0`, {
|
|
472
492
|
headers: {
|
|
@@ -476,13 +496,24 @@ export class E10AuthSession {
|
|
|
476
496
|
'user-agent': this.uaHeader(),
|
|
477
497
|
},
|
|
478
498
|
redirect: 'manual',
|
|
499
|
+
signal,
|
|
479
500
|
});
|
|
480
|
-
|
|
501
|
+
if (resp.status === 200)
|
|
502
|
+
return true;
|
|
503
|
+
if (resp.status === 401 || resp.status === 403)
|
|
504
|
+
return false;
|
|
505
|
+
return undefined;
|
|
481
506
|
}
|
|
482
507
|
catch {
|
|
483
|
-
return
|
|
508
|
+
return undefined;
|
|
509
|
+
}
|
|
510
|
+
finally {
|
|
511
|
+
clear();
|
|
484
512
|
}
|
|
485
513
|
}
|
|
514
|
+
async checkValid() {
|
|
515
|
+
return (await this.probeValid()) === true;
|
|
516
|
+
}
|
|
486
517
|
async ensureValid() {
|
|
487
518
|
if (await this.checkValid())
|
|
488
519
|
return true;
|