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,7 +5,8 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { CliError, ExitCode } from '../../../core/errors.js';
|
|
6
6
|
import { packagePath } from '../../../core/package-paths.js';
|
|
7
7
|
import { isXiaoERuntime, isXiaoERuntimeAgent } from '../../../core/runtime-agent.js';
|
|
8
|
-
import {
|
|
8
|
+
import { createTimeoutSignal, isAbortError, isNetworkErrorCode, looksLikeTransportMessage, readErrorCauseCode, } from '../network-error.js';
|
|
9
|
+
import { buildE10CookieHeader, E10_TEAMS_CHECK_TIMEOUT_MS, E10AuthSession, extractRawSetCookie, extractSessionTicket, profileNameFromUrl, readTeamsCheckUserInfo, saveAuthFile, saveProfileConfig, setActiveProfile, } from './session.js';
|
|
9
10
|
export const DEFAULT_E10_BASE_URL = 'https://www.e-cology.com.cn';
|
|
10
11
|
export const XIAOE_AGENT_TYPE = 'XiaoE';
|
|
11
12
|
// `XIAOE_` 是宿主/平台保留前缀(XIAOE_DOMAIN、XIAOE_USER_TOKEN、XIAOE_SKILL_* 等)。
|
|
@@ -59,6 +60,109 @@ export const XIAOE_USER_TOKEN_SOURCE = 'XIAOE_USER_TOKEN';
|
|
|
59
60
|
export const XIAOE_BUNDLED_ENV_SCRIPT_SOURCE = 'bundled scripts/xiaoe_env.py';
|
|
60
61
|
/** 与 XiaoE `tokens.py` 保持一致:换票成功后默认有效 2 小时。 */
|
|
61
62
|
export const XIAOE_ETEAMID_TTL_MS = 7_200_000;
|
|
63
|
+
const XIAOE_DIAGNOSTIC_MAX_LENGTH = 300;
|
|
64
|
+
/** 换票失败原因可能夹带服务端回显,落进结构化错误前先抹掉已知密钥。 */
|
|
65
|
+
function redactXiaoEDiagnostic(message, secrets) {
|
|
66
|
+
let text = message;
|
|
67
|
+
for (const secret of secrets) {
|
|
68
|
+
if (secret && secret.length >= 8 && text.includes(secret)) {
|
|
69
|
+
text = text.split(secret).join('<redacted>');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const normalized = text.replace(/\s+/gu, ' ').trim();
|
|
73
|
+
return normalized.length > XIAOE_DIAGNOSTIC_MAX_LENGTH
|
|
74
|
+
? `${normalized.slice(0, XIAOE_DIAGNOSTIC_MAX_LENGTH)}…`
|
|
75
|
+
: normalized;
|
|
76
|
+
}
|
|
77
|
+
function noteXiaoEStep(diagnostics, step) {
|
|
78
|
+
diagnostics?.attemptedSteps.push(step);
|
|
79
|
+
}
|
|
80
|
+
function tagXiaoEError(message, tags) {
|
|
81
|
+
return Object.assign(new CliError(message, ExitCode.AuthError), tags);
|
|
82
|
+
}
|
|
83
|
+
function readTag(error, key, type) {
|
|
84
|
+
if (!error || typeof error !== 'object')
|
|
85
|
+
return undefined;
|
|
86
|
+
const value = error[key];
|
|
87
|
+
return typeof value === type ? value : undefined;
|
|
88
|
+
}
|
|
89
|
+
/** 401/403/3xx = 登录态被拒;其余 4xx/5xx 才算服务端 HTTP 异常。 */
|
|
90
|
+
function classifyXiaoEHttpStatus(status) {
|
|
91
|
+
if (status === 401 || status === 403)
|
|
92
|
+
return 'credential';
|
|
93
|
+
if (status >= 300 && status < 400)
|
|
94
|
+
return 'credential';
|
|
95
|
+
return status >= 400 ? 'http' : 'credential';
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 把任意异常归成三类。已经带标签的错误直接沿用;原始 fetch 异常则顺着
|
|
99
|
+
* `error.cause.code`(Node 把真实原因藏在这一层)区分网络错误与协议错误。
|
|
100
|
+
*/
|
|
101
|
+
function classifyXiaoEError(error) {
|
|
102
|
+
const taggedKind = readTag(error, 'errorKind', 'string');
|
|
103
|
+
const taggedStatus = readTag(error, 'status', 'number');
|
|
104
|
+
const taggedCause = readTag(error, 'causeCode', 'string');
|
|
105
|
+
const causeCode = taggedCause || readErrorCauseCode(error);
|
|
106
|
+
const withCause = causeCode ? { causeCode } : {};
|
|
107
|
+
const withStatus = taggedStatus === undefined ? {} : { status: taggedStatus };
|
|
108
|
+
if (taggedKind)
|
|
109
|
+
return { kind: taggedKind, ...withCause, ...withStatus };
|
|
110
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
111
|
+
if (isAbortError(error))
|
|
112
|
+
return { kind: 'network', causeCode: causeCode || 'ETIMEDOUT' };
|
|
113
|
+
if (taggedStatus !== undefined) {
|
|
114
|
+
return { kind: classifyXiaoEHttpStatus(taggedStatus), ...withCause, status: taggedStatus };
|
|
115
|
+
}
|
|
116
|
+
if (causeCode && isNetworkErrorCode(causeCode))
|
|
117
|
+
return { kind: 'network', causeCode };
|
|
118
|
+
const httpMatch = /\bHTTP (\d{3})\b/u.exec(message);
|
|
119
|
+
if (httpMatch) {
|
|
120
|
+
const status = Number(httpMatch[1]);
|
|
121
|
+
return { kind: classifyXiaoEHttpStatus(status), ...withCause, status };
|
|
122
|
+
}
|
|
123
|
+
if (looksLikeTransportMessage(message))
|
|
124
|
+
return { kind: 'network', ...withCause };
|
|
125
|
+
return { kind: 'credential', ...withCause };
|
|
126
|
+
}
|
|
127
|
+
function noteXiaoEError(diagnostics, error, secrets = [], stage = 'e10_session') {
|
|
128
|
+
if (!diagnostics)
|
|
129
|
+
return;
|
|
130
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
131
|
+
const redacted = redactXiaoEDiagnostic(message, secrets);
|
|
132
|
+
if (redacted)
|
|
133
|
+
diagnostics.lastError = redacted;
|
|
134
|
+
const { kind, causeCode, status } = classifyXiaoEError(error);
|
|
135
|
+
const failure = {
|
|
136
|
+
stage: readTag(error, 'stage', 'string') ?? stage,
|
|
137
|
+
kind,
|
|
138
|
+
message: redacted,
|
|
139
|
+
...(causeCode ? { causeCode } : {}),
|
|
140
|
+
...(status === undefined ? {} : { httpStatus: status }),
|
|
141
|
+
};
|
|
142
|
+
if (!diagnostics.failures)
|
|
143
|
+
diagnostics.failures = [];
|
|
144
|
+
diagnostics.failures.push(failure);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 一次恢复失败的整体归因:只要出现过明确的凭证拒绝,就按凭证问题报(用户该去
|
|
148
|
+
* 重新登录);否则 HTTP 异常优先;只有**所有**失败都是网络错误时,才判定为
|
|
149
|
+
* 「暂时连不上 E10」,避免把网络抖动说成登录失效。
|
|
150
|
+
*/
|
|
151
|
+
export function summarizeXiaoEFailureKind(diagnostics) {
|
|
152
|
+
const failures = diagnostics?.failures || [];
|
|
153
|
+
if (!failures.length)
|
|
154
|
+
return undefined;
|
|
155
|
+
if (failures.some((failure) => failure.kind === 'credential'))
|
|
156
|
+
return 'credential';
|
|
157
|
+
if (failures.some((failure) => failure.kind === 'http'))
|
|
158
|
+
return 'http';
|
|
159
|
+
return failures.every((failure) => failure.kind === 'network') ? 'network' : undefined;
|
|
160
|
+
}
|
|
161
|
+
/** 最后一条失败记录,用于把结构化错误的 `stage` 指向真正卡住的那一步。 */
|
|
162
|
+
export function lastXiaoEFailure(diagnostics) {
|
|
163
|
+
const failures = diagnostics?.failures || [];
|
|
164
|
+
return failures.length ? failures[failures.length - 1] : undefined;
|
|
165
|
+
}
|
|
62
166
|
function envString(env, ...keys) {
|
|
63
167
|
for (const key of keys) {
|
|
64
168
|
const value = env[key];
|
|
@@ -91,6 +195,18 @@ export function hasXiaoEEnv(env = process.env, options = {}) {
|
|
|
91
195
|
const explicitAgentType = envString(env, 'WEAVER_AGENT_TYPE');
|
|
92
196
|
return explicitAgentType ? isXiaoERuntimeAgent(explicitAgentType) : false;
|
|
93
197
|
}
|
|
198
|
+
export function resolveXiaoEClientType(env = process.env) {
|
|
199
|
+
const raw = envString(env, 'XIAOE_CLIENT_TYPE').toLowerCase();
|
|
200
|
+
if (raw === 'client' || raw === 'desktop' || raw === 'pc')
|
|
201
|
+
return 'client';
|
|
202
|
+
if (raw === 'cloud' || raw === 'web' || raw === 'browser')
|
|
203
|
+
return 'cloud';
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
/** 网页端运行时没有桌面凭据通道,只有平台票据可换。 */
|
|
207
|
+
export function isXiaoECloudRuntime(env = process.env) {
|
|
208
|
+
return resolveXiaoEClientType(env) === 'cloud';
|
|
209
|
+
}
|
|
94
210
|
export function describeXiaoECredentialSource(source) {
|
|
95
211
|
// Step 1 is the platform-injected credential (XIAOE_USER_TOKEN + XIAOE_DOMAIN):
|
|
96
212
|
// it is available in every sandbox run and needs no local desktop client.
|
|
@@ -706,15 +822,22 @@ export function inspectXiaoEUnifiedLoginSources(options = {}) {
|
|
|
706
822
|
});
|
|
707
823
|
const platformCredential = hasXiaoEPlatformCredential(env);
|
|
708
824
|
const allowLocalDiscovery = options.allowLocalDiscovery !== false;
|
|
709
|
-
const
|
|
825
|
+
const clientType = resolveXiaoEClientType(env);
|
|
826
|
+
// 网页端/沙箱不存在桌面凭据通道,跳过探测也就不会被机器上别人的
|
|
827
|
+
// 客户端登录态误命中。
|
|
828
|
+
const allowDesktopChannels = clientType !== 'cloud';
|
|
829
|
+
const tokenScript = allowDesktopChannels
|
|
830
|
+
&& options.allowTokenScript !== false
|
|
710
831
|
&& hasXiaoETokenScript(env, allowLocalDiscovery);
|
|
711
|
-
const clientCredential =
|
|
832
|
+
const clientCredential = allowDesktopChannels
|
|
833
|
+
&& hasXiaoEClientCredential(env, allowLocalDiscovery);
|
|
712
834
|
const environmentCredential = Boolean(baseUrl && resolveXiaoEUnifiedLoginCredential(baseUrl, env));
|
|
713
835
|
return {
|
|
714
836
|
platformCredential,
|
|
715
837
|
tokenScript,
|
|
716
838
|
clientCredential,
|
|
717
839
|
environmentCredential,
|
|
840
|
+
clientType,
|
|
718
841
|
any: platformCredential || tokenScript || clientCredential || environmentCredential,
|
|
719
842
|
};
|
|
720
843
|
}
|
|
@@ -741,11 +864,16 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
741
864
|
if (resp.status < 300 || resp.status >= 400)
|
|
742
865
|
break;
|
|
743
866
|
if (redirects === 5) {
|
|
744
|
-
throw
|
|
867
|
+
throw tagXiaoEError('XiaoE client token endpoint redirected too many times.', {
|
|
868
|
+
errorKind: 'http',
|
|
869
|
+
});
|
|
745
870
|
}
|
|
746
871
|
const location = resp.headers.get('location');
|
|
747
872
|
if (!location) {
|
|
748
|
-
throw
|
|
873
|
+
throw tagXiaoEError('XiaoE client token endpoint returned a redirect without Location.', {
|
|
874
|
+
errorKind: 'http',
|
|
875
|
+
status: resp.status,
|
|
876
|
+
});
|
|
749
877
|
}
|
|
750
878
|
const next = new URL(location, endpoint);
|
|
751
879
|
const sameOrigin = next.origin === endpoint.origin;
|
|
@@ -754,17 +882,32 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
754
882
|
&& next.hostname === endpoint.hostname;
|
|
755
883
|
const safeProtocol = next.protocol === 'http:' || next.protocol === 'https:';
|
|
756
884
|
if (!safeProtocol || next.username || next.password || (!sameOrigin && !sameHostHttpsUpgrade)) {
|
|
757
|
-
throw
|
|
885
|
+
throw tagXiaoEError('XiaoE client token endpoint attempted an unsafe cross-origin redirect.', {
|
|
886
|
+
errorKind: 'http',
|
|
887
|
+
status: resp.status,
|
|
888
|
+
});
|
|
758
889
|
}
|
|
759
890
|
await resp.body?.cancel().catch(() => undefined);
|
|
760
891
|
endpoint = next;
|
|
761
892
|
}
|
|
762
893
|
if (!resp?.ok) {
|
|
763
|
-
|
|
894
|
+
const status = resp?.status || 0;
|
|
895
|
+
throw tagXiaoEError(`XiaoE client token endpoint returned HTTP ${status}.`, {
|
|
896
|
+
errorKind: classifyXiaoEHttpStatus(status),
|
|
897
|
+
status,
|
|
898
|
+
});
|
|
764
899
|
}
|
|
765
|
-
const data = await resp.json().catch(() =>
|
|
900
|
+
const data = await resp.json().catch((error) => {
|
|
901
|
+
// 读响应体时被超时打断属于网络错误,不能当成「返回了非法 JSON」。
|
|
902
|
+
if (isAbortError(error))
|
|
903
|
+
throw error;
|
|
904
|
+
return null;
|
|
905
|
+
});
|
|
766
906
|
if (!data || typeof data !== 'object' || Array.isArray(data)) {
|
|
767
|
-
throw
|
|
907
|
+
throw tagXiaoEError('XiaoE client token endpoint returned invalid JSON.', {
|
|
908
|
+
errorKind: 'http',
|
|
909
|
+
status: resp.status,
|
|
910
|
+
});
|
|
768
911
|
}
|
|
769
912
|
const payload = data;
|
|
770
913
|
const businessCode = payload.code;
|
|
@@ -773,10 +916,23 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
773
916
|
: {};
|
|
774
917
|
if ((businessCode !== '0000' && businessCode !== 0 && businessCode !== 200) || !readString(businessData, 'eteamId')) {
|
|
775
918
|
const codeText = businessCode === undefined ? 'missing' : String(businessCode);
|
|
776
|
-
throw
|
|
919
|
+
throw tagXiaoEError(`XiaoE client token exchange failed with business code ${codeText}.`, {
|
|
920
|
+
errorKind: 'credential',
|
|
921
|
+
});
|
|
777
922
|
}
|
|
778
923
|
return payload;
|
|
779
924
|
}
|
|
925
|
+
catch (error) {
|
|
926
|
+
if (isAbortError(error)) {
|
|
927
|
+
throw tagXiaoEError(`XiaoE client token endpoint timed out after ${XIAOE_CLIENT_TOKEN_TIMEOUT_MS} ms.`, { errorKind: 'network', causeCode: 'ETIMEDOUT' });
|
|
928
|
+
}
|
|
929
|
+
// 已经带语义的 HTTP / 业务码错误原样上抛,别再包一层网络错误。
|
|
930
|
+
if (error instanceof CliError)
|
|
931
|
+
throw error;
|
|
932
|
+
const causeCode = readErrorCauseCode(error);
|
|
933
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
934
|
+
throw tagXiaoEError(`XiaoE client token endpoint request failed${causeCode ? ` (${causeCode})` : ''}: ${message}`, { errorKind: 'network', ...(causeCode ? { causeCode } : {}) });
|
|
935
|
+
}
|
|
780
936
|
finally {
|
|
781
937
|
clearTimeout(timer);
|
|
782
938
|
}
|
|
@@ -831,26 +987,62 @@ export function createXiaoEUnifiedLoginUnavailableError(baseUrl = '') {
|
|
|
831
987
|
});
|
|
832
988
|
}
|
|
833
989
|
async function resolveUserInfo(baseUrl, eteamsId, rawCookie = '', agentType = '') {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
990
|
+
// teamsCheck 是恢复流程的必经往返:没有超时的话,服务端半开连接会把整条命令挂死。
|
|
991
|
+
const { signal, clear } = createTimeoutSignal(E10_TEAMS_CHECK_TIMEOUT_MS);
|
|
992
|
+
try {
|
|
993
|
+
const resp = await fetch(`${baseUrl}/api/baseserver/layout/teamsCheck?clientType=not_xinchuang&client=WEB&domainName=${encodeURIComponent(baseUrl)}`, {
|
|
994
|
+
method: 'POST',
|
|
995
|
+
headers: {
|
|
996
|
+
accept: 'application/json',
|
|
997
|
+
'content-type': 'application/json',
|
|
998
|
+
eteamsid: eteamsId,
|
|
999
|
+
cookie: buildE10CookieHeader(rawCookie, eteamsId, agentType),
|
|
1000
|
+
'user-agent': agentType ? `AgentType=${agentType},IsAgent=true` : 'weaver-work-cli',
|
|
1001
|
+
origin: baseUrl,
|
|
1002
|
+
},
|
|
1003
|
+
redirect: 'manual',
|
|
1004
|
+
signal,
|
|
1005
|
+
});
|
|
1006
|
+
// 读响应体同样在超时窗口内;中途被 abort 不能当成「空响应」吞掉。
|
|
1007
|
+
const data = await resp.json().catch((error) => {
|
|
1008
|
+
if (isAbortError(error))
|
|
1009
|
+
throw error;
|
|
1010
|
+
return {};
|
|
1011
|
+
});
|
|
1012
|
+
return { userInfo: readTeamsCheckUserInfo(resp, data), setCookie: extractRawSetCookie(resp), status: resp.status };
|
|
1013
|
+
}
|
|
1014
|
+
catch (error) {
|
|
1015
|
+
if (isAbortError(error)) {
|
|
1016
|
+
throw tagXiaoEError(`E10 teamsCheck timed out after ${E10_TEAMS_CHECK_TIMEOUT_MS} ms.`, { errorKind: 'network', stage: 'teams_check', causeCode: 'ETIMEDOUT' });
|
|
1017
|
+
}
|
|
1018
|
+
if (error instanceof CliError)
|
|
1019
|
+
throw error;
|
|
1020
|
+
const causeCode = readErrorCauseCode(error);
|
|
1021
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1022
|
+
throw tagXiaoEError(`E10 teamsCheck request failed${causeCode ? ` (${causeCode})` : ''}: ${message}`, { errorKind: 'network', stage: 'teams_check', ...(causeCode ? { causeCode } : {}) });
|
|
1023
|
+
}
|
|
1024
|
+
finally {
|
|
1025
|
+
clear();
|
|
1026
|
+
}
|
|
848
1027
|
}
|
|
849
1028
|
async function saveXiaoEUnifiedLogin(input) {
|
|
850
1029
|
const baseUrl = normalizeUrl(input.baseUrl);
|
|
851
|
-
const { userInfo, setCookie } = await resolveUserInfo(baseUrl, input.eteamsId, input.rawCookie || '', XIAOE_AGENT_TYPE);
|
|
1030
|
+
const { userInfo, setCookie, status } = await resolveUserInfo(baseUrl, input.eteamsId, input.rawCookie || '', XIAOE_AGENT_TYPE);
|
|
852
1031
|
if (!userInfo.userId) {
|
|
853
|
-
|
|
1032
|
+
// 401/403/3xx 是「票不被接受」,用户该去恢复登录;5xx 则是 E10 侧故障,
|
|
1033
|
+
// 报成凭证问题会把人引向无用的重新登录。
|
|
1034
|
+
const statusText = status || 0;
|
|
1035
|
+
throw classifyXiaoEHttpStatus(statusText) === 'http'
|
|
1036
|
+
? tagXiaoEError(`E10 teamsCheck returned HTTP ${statusText}.`, {
|
|
1037
|
+
errorKind: 'http',
|
|
1038
|
+
stage: 'teams_check',
|
|
1039
|
+
status: statusText,
|
|
1040
|
+
})
|
|
1041
|
+
: tagXiaoEError('Could not resolve userId. Check whether XiaoE unified login is valid for this E10 domain.', {
|
|
1042
|
+
errorKind: 'credential',
|
|
1043
|
+
stage: 'teams_check',
|
|
1044
|
+
status: statusText,
|
|
1045
|
+
});
|
|
854
1046
|
}
|
|
855
1047
|
const tenantKey = userInfo.tenantKey || input.tenantKeyFallback || '';
|
|
856
1048
|
const profile = input.profileHint || profileNameFromUrl(baseUrl);
|
|
@@ -908,19 +1100,32 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
908
1100
|
profileBaseUrl: options.profileBaseUrl,
|
|
909
1101
|
env,
|
|
910
1102
|
});
|
|
911
|
-
|
|
912
|
-
|
|
1103
|
+
// 网页端没有桌面凭据通道:`XIAOE_CLIENT_TYPE=cloud` 时不尝试 tokens.py 与
|
|
1104
|
+
// 本地客户端会话,避免在共享机器上误用他人的客户端登录态。
|
|
1105
|
+
const mayUseTokenScript = options.allowTokenScript === true && !isXiaoECloudRuntime(env);
|
|
1106
|
+
const diagnostics = options.diagnostics;
|
|
1107
|
+
const platformCredentialDetected = hasXiaoEPlatformCredential(env);
|
|
1108
|
+
const secrets = [envString(env, 'XIAOE_USER_TOKEN')];
|
|
1109
|
+
if (diagnostics) {
|
|
1110
|
+
diagnostics.baseUrl = baseUrl;
|
|
1111
|
+
diagnostics.platformCredentialDetected = platformCredentialDetected;
|
|
1112
|
+
diagnostics.clientType = resolveXiaoEClientType(env);
|
|
1113
|
+
}
|
|
1114
|
+
if (!baseUrl && !mayUseTokenScript) {
|
|
1115
|
+
noteXiaoEStep(diagnostics, 'base_url:missing');
|
|
913
1116
|
return null;
|
|
1117
|
+
}
|
|
914
1118
|
let credential = null;
|
|
915
1119
|
// Step 1 — platform-injected credential (XIAOE_USER_TOKEN + XIAOE_DOMAIN).
|
|
916
1120
|
// Works in sandboxes: no desktop client, no Python, no developer-machine paths.
|
|
917
|
-
if (
|
|
1121
|
+
if (platformCredentialDetected) {
|
|
918
1122
|
options.logger?.info('Trying XiaoE platform credential from XIAOE_USER_TOKEN...');
|
|
919
1123
|
try {
|
|
920
1124
|
credential = await resolveXiaoEPlatformCredential(baseUrl || DEFAULT_E10_BASE_URL, env);
|
|
921
1125
|
}
|
|
922
1126
|
catch (error) {
|
|
923
1127
|
const message = error instanceof Error ? error.message : String(error);
|
|
1128
|
+
noteXiaoEError(diagnostics, error, secrets, 'platform_token');
|
|
924
1129
|
options.logger?.warn('XiaoE platform credential failed. ' + message);
|
|
925
1130
|
}
|
|
926
1131
|
if (!credential) {
|
|
@@ -929,25 +1134,38 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
929
1134
|
: 'XiaoE platform credential did not return usable ETEAMSID; will try xiaoeUserData/tokens.py next.');
|
|
930
1135
|
}
|
|
931
1136
|
}
|
|
1137
|
+
noteXiaoEStep(diagnostics, credential ? 'platform_token:ok' : `platform_token:${platformCredentialDetected ? 'failed' : 'missing'}`);
|
|
932
1138
|
// Step 1b — compatibility path used by the reference login package. The
|
|
933
1139
|
// script is shipped with the CLI npm package (never with a Skill) and its
|
|
934
1140
|
// stdout stays inside this process so credentials are not exposed to agents.
|
|
935
|
-
if (!credential
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1141
|
+
if (!credential) {
|
|
1142
|
+
if (!options.allowBundledEnvScript) {
|
|
1143
|
+
noteXiaoEStep(diagnostics, 'bundled_env_script:disabled');
|
|
1144
|
+
}
|
|
1145
|
+
else if (!platformCredentialDetected) {
|
|
1146
|
+
// 脚本本身也只读 XIAOE_USER_TOKEN/XIAOE_DOMAIN,前置缺失时重跑没有意义。
|
|
1147
|
+
noteXiaoEStep(diagnostics, 'bundled_env_script:missing');
|
|
939
1148
|
}
|
|
940
1149
|
else {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1150
|
+
const scriptPath = xiaoEBundledEnvScriptPath();
|
|
1151
|
+
if (!scriptPath) {
|
|
1152
|
+
noteXiaoEStep(diagnostics, 'bundled_env_script:missing');
|
|
1153
|
+
options.logger?.warn('CLI-bundled xiaoe_env.py was not found; will try desktop XiaoE credential sources next.');
|
|
944
1154
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1155
|
+
else {
|
|
1156
|
+
options.logger?.info('Trying CLI-bundled xiaoe_env.py compatibility credential...');
|
|
1157
|
+
try {
|
|
1158
|
+
credential = await resolveXiaoEBundledEnvScriptCredential(baseUrl || DEFAULT_E10_BASE_URL, env);
|
|
1159
|
+
}
|
|
1160
|
+
catch (error) {
|
|
1161
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1162
|
+
noteXiaoEError(diagnostics, error, secrets, 'bundled_env_script');
|
|
1163
|
+
options.logger?.warn('CLI-bundled xiaoe_env.py failed. ' + message);
|
|
1164
|
+
}
|
|
1165
|
+
if (!credential) {
|
|
1166
|
+
options.logger?.warn('CLI-bundled xiaoe_env.py did not return usable ETEAMSID; will try xiaoeUserData/tokens.py next.');
|
|
1167
|
+
}
|
|
1168
|
+
noteXiaoEStep(diagnostics, `bundled_env_script:${credential ? 'ok' : 'failed'}`);
|
|
951
1169
|
}
|
|
952
1170
|
}
|
|
953
1171
|
}
|
|
@@ -955,6 +1173,7 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
955
1173
|
if (!credential && mayUseTokenScript) {
|
|
956
1174
|
const tokenScriptPath = xiaoETokenScriptPath(env);
|
|
957
1175
|
if (!tokenScriptPath) {
|
|
1176
|
+
noteXiaoEStep(diagnostics, 'token_script:missing');
|
|
958
1177
|
options.logger?.warn('XiaoE token script not found. Expected xiaoeUserData/tokens.py; will try the local XiaoE client session next.');
|
|
959
1178
|
}
|
|
960
1179
|
else {
|
|
@@ -964,11 +1183,13 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
964
1183
|
}
|
|
965
1184
|
catch (error) {
|
|
966
1185
|
const message = error instanceof Error ? error.message : String(error);
|
|
1186
|
+
noteXiaoEError(diagnostics, error, secrets, 'token_script');
|
|
967
1187
|
options.logger?.warn('XiaoE token script failed. ' + message);
|
|
968
1188
|
}
|
|
969
1189
|
if (!credential) {
|
|
970
1190
|
options.logger?.warn('XiaoE token script did not return usable ETEAMSID; will try the local XiaoE client session next.');
|
|
971
1191
|
}
|
|
1192
|
+
noteXiaoEStep(diagnostics, `token_script:${credential ? 'ok' : 'failed'}`);
|
|
972
1193
|
}
|
|
973
1194
|
// Step 3 — built-in Node equivalent of tokens.py: reads the local XiaoE
|
|
974
1195
|
// client session and exchanges it for an eteamId, so Python availability
|
|
@@ -980,20 +1201,32 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
980
1201
|
}
|
|
981
1202
|
catch (error) {
|
|
982
1203
|
const message = error instanceof Error ? error.message : String(error);
|
|
1204
|
+
noteXiaoEError(diagnostics, error, secrets, 'client_session');
|
|
983
1205
|
options.logger?.warn('Built-in XiaoE client credential failed. ' + message);
|
|
984
1206
|
}
|
|
985
1207
|
if (!credential) {
|
|
986
1208
|
options.logger?.warn('Built-in XiaoE client credential did not return usable ETEAMSID; will try WEAVER_XIAOE_* credentials next.');
|
|
987
1209
|
}
|
|
1210
|
+
noteXiaoEStep(diagnostics, `client_session:${credential ? 'ok' : 'failed'}`);
|
|
988
1211
|
}
|
|
1212
|
+
else if (!credential) {
|
|
1213
|
+
noteXiaoEStep(diagnostics, 'client_session:missing');
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
else if (!credential) {
|
|
1217
|
+
noteXiaoEStep(diagnostics, 'token_script:disabled');
|
|
1218
|
+
noteXiaoEStep(diagnostics, 'client_session:disabled');
|
|
989
1219
|
}
|
|
990
1220
|
if (!credential && baseUrl)
|
|
991
1221
|
credential = resolveXiaoEUnifiedLoginCredential(baseUrl, env);
|
|
992
|
-
if (!credential)
|
|
1222
|
+
if (!credential) {
|
|
1223
|
+
noteXiaoEStep(diagnostics, 'environment_map:empty');
|
|
993
1224
|
return null;
|
|
1225
|
+
}
|
|
1226
|
+
noteXiaoEStep(diagnostics, `credential_source:${credential.source}`);
|
|
994
1227
|
options.logger?.info('Detected XiaoE unified login for this E10 domain. Trying XiaoE auth...');
|
|
995
1228
|
try {
|
|
996
|
-
|
|
1229
|
+
const login = await saveXiaoEUnifiedLogin({
|
|
997
1230
|
baseUrl: credential.baseUrl || baseUrl || DEFAULT_E10_BASE_URL,
|
|
998
1231
|
eteamsId: credential.eteamsId,
|
|
999
1232
|
rawCookie: credential.rawCookie,
|
|
@@ -1002,9 +1235,18 @@ export async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
1002
1235
|
profileHint: options.profileHint,
|
|
1003
1236
|
credentialSource: describeXiaoECredentialSource(credential.source),
|
|
1004
1237
|
});
|
|
1238
|
+
noteXiaoEStep(diagnostics, 'e10_session:ok');
|
|
1239
|
+
if (diagnostics) {
|
|
1240
|
+
// 成功换到登录态:前面压着的失败不该再让调用方误判整次恢复失败。
|
|
1241
|
+
delete diagnostics.lastError;
|
|
1242
|
+
delete diagnostics.failures;
|
|
1243
|
+
}
|
|
1244
|
+
return login;
|
|
1005
1245
|
}
|
|
1006
1246
|
catch (error) {
|
|
1007
1247
|
const message = error instanceof Error ? error.message : String(error);
|
|
1248
|
+
noteXiaoEError(diagnostics, error, secrets, 'e10_session');
|
|
1249
|
+
noteXiaoEStep(diagnostics, 'e10_session:failed');
|
|
1008
1250
|
options.logger?.warn('XiaoE unified login failed. ' + message);
|
|
1009
1251
|
return null;
|
|
1010
1252
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isXiaoERuntimeAgent } from '../../core/runtime-agent.js';
|
|
2
2
|
import { getActiveProfile, readProfileConfig } from './auth/session.js';
|
|
3
|
-
import {
|
|
3
|
+
import { appendXiaoEAuthErrorLog, xiaoEAuthLogSecrets } from './auth/error-log.js';
|
|
4
|
+
import { hasXiaoEEnv, resolveXiaoEPreferredBaseUrl, tryXiaoEUnifiedLogin, } from './auth/xiaoe.js';
|
|
4
5
|
const AUTH_REQUIRED_CODES = new Set(['-2', '401']);
|
|
5
6
|
const AUTH_REQUIRED_MARKERS = [
|
|
6
7
|
'未登录',
|
|
@@ -224,6 +225,28 @@ export function canAutomaticallyRecoverXiaoE(ctx, currentSession) {
|
|
|
224
225
|
|| currentSession?.loginSource === 'xiaoe-unified'
|
|
225
226
|
|| isXiaoERuntimeAgent(currentSession?.agentType);
|
|
226
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* 透明恢复默认必须零输出:中间登录步骤绝不能漏进 Agent 的 stdout 或 JSON。
|
|
230
|
+
* 只有显式 `--verbose`(且非 `--json`/`--quiet`)时才把每一步的真实失败原因
|
|
231
|
+
* 经 debug 通道送到 stderr,供人排查。宿主 logger 若没有 debug(测试替身、
|
|
232
|
+
* 旧嵌入方)则继续完全静默。
|
|
233
|
+
*/
|
|
234
|
+
function recoveryLogger(ctx) {
|
|
235
|
+
const options = globalOptions(ctx);
|
|
236
|
+
if (options.json || options.quiet || options.verbose !== true)
|
|
237
|
+
return undefined;
|
|
238
|
+
const adapter = ctx.logger;
|
|
239
|
+
if (!adapter || typeof adapter.debug !== 'function')
|
|
240
|
+
return undefined;
|
|
241
|
+
return {
|
|
242
|
+
info: (message) => adapter.debug(message),
|
|
243
|
+
warn: (message) => adapter.debug(message),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function reportAuthLogWriteFailure(ctx, error) {
|
|
247
|
+
const logger = ctx.logger;
|
|
248
|
+
logger?.debug?.(`Could not persist XiaoE auth error log: ${error instanceof Error ? error.message : String(error)}`);
|
|
249
|
+
}
|
|
227
250
|
/**
|
|
228
251
|
* Silently recover a stale or missing XiaoE session. Without a local session,
|
|
229
252
|
* current runtime evidence is required before obtaining credentials.
|
|
@@ -232,8 +255,20 @@ export function canAutomaticallyRecoverXiaoE(ctx, currentSession) {
|
|
|
232
255
|
* does not start a burst of login attempts.
|
|
233
256
|
*/
|
|
234
257
|
export async function recoverXiaoEAuthSession(ctx, currentSession) {
|
|
258
|
+
return (await recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession)).session;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* `recoverXiaoEAuthSession` 的诊断版:失败时返回本次尝试评估过哪些凭证来源、
|
|
262
|
+
* 最后一条真实原因,供调用方挂到结构化错误上。并发恢复共享同一份诊断
|
|
263
|
+
* (同一个 in-flight Promise),因此每个等待者看到的原因一致。
|
|
264
|
+
*/
|
|
265
|
+
export async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession) {
|
|
266
|
+
const emptyOutcome = () => ({
|
|
267
|
+
session: null,
|
|
268
|
+
diagnostics: { attemptedSteps: [] },
|
|
269
|
+
});
|
|
235
270
|
if (!canAutomaticallyRecoverXiaoE(ctx, currentSession))
|
|
236
|
-
return
|
|
271
|
+
return emptyOutcome();
|
|
237
272
|
const options = globalOptions(ctx);
|
|
238
273
|
const profile = options.profile || getActiveProfile();
|
|
239
274
|
const config = readProfileConfig(profile);
|
|
@@ -246,19 +281,42 @@ export async function recoverXiaoEAuthSession(ctx, currentSession) {
|
|
|
246
281
|
const existing = recoveryInFlight.get(key);
|
|
247
282
|
if (existing)
|
|
248
283
|
return existing;
|
|
284
|
+
const diagnostics = { attemptedSteps: [] };
|
|
249
285
|
const recovery = (async () => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
286
|
+
try {
|
|
287
|
+
const login = await tryXiaoEUnifiedLogin({
|
|
288
|
+
env: ctx.env,
|
|
289
|
+
baseUrl,
|
|
290
|
+
profileBaseUrl: baseUrl,
|
|
291
|
+
allowBundledEnvScript: true,
|
|
292
|
+
allowTokenScript: true,
|
|
293
|
+
tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
|
|
294
|
+
profileHint: profile,
|
|
295
|
+
diagnostics,
|
|
296
|
+
logger: recoveryLogger(ctx),
|
|
297
|
+
});
|
|
298
|
+
if (!login) {
|
|
299
|
+
await appendXiaoEAuthErrorLog({
|
|
300
|
+
source: 'recovery',
|
|
301
|
+
profile,
|
|
302
|
+
baseUrl,
|
|
303
|
+
diagnostics,
|
|
304
|
+
secrets: xiaoEAuthLogSecrets(ctx.env),
|
|
305
|
+
}).catch((error) => reportAuthLogWriteFailure(ctx, error));
|
|
306
|
+
}
|
|
307
|
+
return { session: login?.session || null, diagnostics };
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
await appendXiaoEAuthErrorLog({
|
|
311
|
+
source: 'recovery',
|
|
312
|
+
profile,
|
|
313
|
+
baseUrl,
|
|
314
|
+
diagnostics,
|
|
315
|
+
error,
|
|
316
|
+
secrets: xiaoEAuthLogSecrets(ctx.env),
|
|
317
|
+
}).catch((logError) => reportAuthLogWriteFailure(ctx, logError));
|
|
318
|
+
throw error;
|
|
319
|
+
}
|
|
262
320
|
})();
|
|
263
321
|
recoveryInFlight.set(key, recovery);
|
|
264
322
|
try {
|