weaver-work-cli 0.1.42 → 0.1.45
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 +21 -0
- package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
- package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
- package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
- package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
- package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
- package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
- package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
- package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
- package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
- package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
- package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
- package/dist/chunks/chunk-6N4JPNFL.js +76 -0
- package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
- package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
- package/dist/chunks/chunk-7BDPM5ST.js +11 -0
- package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
- package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
- package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
- package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
- package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
- package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
- package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
- package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
- package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
- package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
- package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
- package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
- package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
- package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
- package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
- package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
- package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
- package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
- package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
- package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
- 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-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
- package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
- 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-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
- package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.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-GW6PRWK3.js +12 -0
- package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
- package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
- package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
- package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
- package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
- package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
- package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
- package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
- package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
- package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
- package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
- package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
- package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
- package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
- package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
- package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
- package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
- package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
- package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
- package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
- package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
- package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
- package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
- package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
- package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
- package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
- package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
- package/dist/chunks/reception-5WITA44R.js +1899 -0
- package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
- package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
- package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
- package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
- package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
- package/dist/chunks/registry-XPWPGHYE.js +24 -0
- package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
- package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
- package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
- package/dist/cmd/action.js +6 -0
- package/dist/cmd/identity/index.js +45 -0
- package/dist/cmd/index.js +2 -0
- package/dist/core/continuation-ttl.js +18 -0
- package/dist/core/error-codes.js +85 -0
- package/dist/core/logger.js +11 -0
- package/dist/index.js +37 -31
- package/dist/internal/e10/auth/commands.js +195 -8
- package/dist/internal/e10/auth/error-log.js +312 -0
- package/dist/internal/e10/auth/session.js +17 -3
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/auth-recovery.js +39 -12
- package/dist/internal/e10/context.js +29 -3
- 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/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/confirm.js +2 -1
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/archive-oa/continuation.js +2 -1
- package/dist/shortcuts/archive-oa/index.js +2 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
- package/dist/shortcuts/asset/continuation.js +2 -1
- package/dist/shortcuts/asset/index.js +2 -0
- package/dist/shortcuts/asset-idle/index.js +2 -0
- package/dist/shortcuts/blog/continuation.js +2 -1
- package/dist/shortcuts/blog/index.js +2 -0
- package/dist/shortcuts/caizhilian/continuation.js +2 -1
- package/dist/shortcuts/caizhilian/index.js +2 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
- package/dist/shortcuts/calendar/continuation.js +2 -1
- package/dist/shortcuts/calendar/index.js +2 -0
- package/dist/shortcuts/calendar/operations/write.js +1 -1
- package/dist/shortcuts/contract/continuation.js +2 -1
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +21 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/operations/write.js +2 -1
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/cowork/continuation.js +2 -1
- package/dist/shortcuts/cowork/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
- package/dist/shortcuts/ebuilder-form/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
- package/dist/shortcuts/ehr/continuation.js +2 -1
- package/dist/shortcuts/ehr/index.js +2 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
- package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
- package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
- package/dist/shortcuts/ehr/operations/recruit.js +17 -5
- 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/employee.js +29 -1
- package/dist/shortcuts/im/continuation.js +2 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/continuation.js +2 -1
- package/dist/shortcuts/invoice/index.js +14 -15
- package/dist/shortcuts/invoice/invoice-record.js +93 -0
- package/dist/shortcuts/invoice/manifest.js +190 -393
- package/dist/shortcuts/invoice/operations/add.js +2 -1
- package/dist/shortcuts/invoice/operations/delete.js +2 -1
- package/dist/shortcuts/invoice/operations/import.js +2 -1
- package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
- package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
- package/dist/shortcuts/invoice/operations/registry.js +17 -17
- package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
- package/dist/shortcuts/invoice/operations/reim.js +52 -341
- package/dist/shortcuts/invoice/operations/shared.js +21 -4
- package/dist/shortcuts/invoice/operations/update.js +2 -1
- package/dist/shortcuts/invoice/projection.js +10 -62
- package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
- package/dist/shortcuts/mail/continuation.js +2 -1
- package/dist/shortcuts/mail/index.js +2 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
- package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
- package/dist/shortcuts/mail/operations/mail-send.js +1 -1
- package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
- package/dist/shortcuts/mail/operations/mail-template.js +1 -1
- package/dist/shortcuts/meeting/continuation.js +2 -1
- package/dist/shortcuts/meeting/index.js +2 -0
- package/dist/shortcuts/meeting/operations/change.js +1 -1
- package/dist/shortcuts/meeting/operations/create.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
- package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
- package/dist/shortcuts/meeting/operations/receipts.js +1 -1
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/signs.js +1 -1
- package/dist/shortcuts/okr/continuation.js +2 -1
- package/dist/shortcuts/okr/index.js +2 -0
- package/dist/shortcuts/okr/operations/write.js +1 -1
- package/dist/shortcuts/plan/continuation.js +2 -1
- package/dist/shortcuts/plan/index.js +2 -0
- package/dist/shortcuts/plan/operations/write.js +1 -1
- package/dist/shortcuts/project/continuation.js +2 -1
- package/dist/shortcuts/project/index.js +2 -0
- package/dist/shortcuts/reception/constants.js +53 -0
- package/dist/shortcuts/reception/errors.js +54 -0
- package/dist/shortcuts/reception/host.js +125 -0
- package/dist/shortcuts/reception/index.js +198 -0
- package/dist/shortcuts/reception/manifest.js +177 -0
- package/dist/shortcuts/reception/operations/ask.js +71 -0
- package/dist/shortcuts/reception/operations/browsertool.js +58 -0
- package/dist/shortcuts/reception/operations/compose.js +129 -0
- package/dist/shortcuts/reception/operations/customparams.js +74 -0
- package/dist/shortcuts/reception/operations/doc.js +238 -0
- package/dist/shortcuts/reception/operations/docrender.js +36 -0
- package/dist/shortcuts/reception/operations/panels.js +179 -0
- package/dist/shortcuts/reception/operations/registry.js +26 -0
- package/dist/shortcuts/reception/operations/render-assets.js +184 -0
- package/dist/shortcuts/reception/operations/render.js +123 -0
- package/dist/shortcuts/reception/operations/runs.js +38 -0
- package/dist/shortcuts/reception/operations/schedule.js +127 -0
- package/dist/shortcuts/reception/operations/shared.js +196 -0
- package/dist/shortcuts/reception/operations/snapshot.js +68 -0
- package/dist/shortcuts/reception/operations/types.js +1 -0
- package/dist/shortcuts/reception/operations.js +33 -0
- package/dist/shortcuts/reception/upload.js +218 -0
- package/dist/shortcuts/recruit-stage/context.js +145 -33
- package/dist/shortcuts/recruit-stage/continuation.js +2 -1
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +289 -48
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
- package/dist/shortcuts/recruit-stage/shared.js +161 -18
- package/dist/shortcuts/workflow/continuation.js +2 -1
- package/dist/shortcuts/workflow/index.js +4 -0
- package/dist/shortcuts/workflow/operations/form.js +32 -8
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- 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 +2 -1
- package/docs/e10-auth.md +19 -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/reception.md +119 -0
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/scripts/clean.mjs +43 -2
- package/skill-template/business-info.json +18 -2
- package/skill-template/domains/caizhilian.md +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skill-template/domains/reception-flow.md +18 -0
- package/skill-template/domains/yepiaotong.md +4 -7
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
- package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
- package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
- package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
- package/skills/weaver-e10-esb/references/trigger.md +2 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- 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-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
- package/skills/weaver-e10-jucailin/SKILL.md +1 -1
- package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
- package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
- package/skills/weaver-e10-meeting/SKILL.md +64 -14
- 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 +19 -10
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
- package/skills/weaver-e10-shijingran/SKILL.md +5 -5
- package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
- package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/chunk-TTPJJJC4.js +0 -465
- package/dist/chunks/registry-BKBZPBAJ.js +0 -23
- package/dist/shortcuts/invoice/markdown.js +0 -172
- package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
|
@@ -61,19 +61,30 @@ export const XIAOE_BUNDLED_ENV_SCRIPT_SOURCE = 'bundled scripts/xiaoe_env.py';
|
|
|
61
61
|
/** 与 XiaoE `tokens.py` 保持一致:换票成功后默认有效 2 小时。 */
|
|
62
62
|
export const XIAOE_ETEAMID_TTL_MS = 7_200_000;
|
|
63
63
|
const XIAOE_DIAGNOSTIC_MAX_LENGTH = 300;
|
|
64
|
+
const XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH = 2_000;
|
|
64
65
|
/** 换票失败原因可能夹带服务端回显,落进结构化错误前先抹掉已知密钥。 */
|
|
65
|
-
function redactXiaoEDiagnostic(message, secrets) {
|
|
66
|
+
function redactXiaoEDiagnostic(message, secrets, maxLength = XIAOE_DIAGNOSTIC_MAX_LENGTH) {
|
|
66
67
|
let text = message;
|
|
67
68
|
for (const secret of secrets) {
|
|
68
69
|
if (secret && secret.length >= 8 && text.includes(secret)) {
|
|
69
70
|
text = text.split(secret).join('<redacted>');
|
|
70
71
|
}
|
|
71
72
|
}
|
|
73
|
+
text = text
|
|
74
|
+
.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/giu, '$1<redacted>')
|
|
75
|
+
.replace(/((?:eteamsid|access[_-]?token|refresh[_-]?token|auth(?:orization)?|cookie|session[_-]?id|secret|password)\s*[:=]\s*)(["']?)[^\s,;}"']+/giu, '$1$2<redacted>');
|
|
72
76
|
const normalized = text.replace(/\s+/gu, ' ').trim();
|
|
73
|
-
return normalized.length >
|
|
74
|
-
? `${normalized.slice(0,
|
|
77
|
+
return normalized.length > maxLength
|
|
78
|
+
? `${normalized.slice(0, maxLength)}…`
|
|
75
79
|
: normalized;
|
|
76
80
|
}
|
|
81
|
+
function xiaoEDiagnosticSecrets(env) {
|
|
82
|
+
return Object.entries(env)
|
|
83
|
+
.filter(([key, value]) => Boolean(value
|
|
84
|
+
&& (key.startsWith('XIAOE_') || key.startsWith('WEAVER_XIAOE_'))
|
|
85
|
+
&& /(?:TOKEN|AUTH|ETEAMSID|COOKIE|SESSION|SECRET|PASSWORD)/iu.test(key)))
|
|
86
|
+
.map(([, value]) => value);
|
|
87
|
+
}
|
|
77
88
|
function noteXiaoEStep(diagnostics, step) {
|
|
78
89
|
diagnostics?.attemptedSteps.push(step);
|
|
79
90
|
}
|
|
@@ -86,6 +97,14 @@ function readTag(error, key, type) {
|
|
|
86
97
|
const value = error[key];
|
|
87
98
|
return typeof value === type ? value : undefined;
|
|
88
99
|
}
|
|
100
|
+
function readExchangeRequest(error) {
|
|
101
|
+
if (!error || typeof error !== 'object')
|
|
102
|
+
return undefined;
|
|
103
|
+
const request = error.request;
|
|
104
|
+
if (!request || typeof request !== 'object' || Array.isArray(request))
|
|
105
|
+
return undefined;
|
|
106
|
+
return request;
|
|
107
|
+
}
|
|
89
108
|
/** 401/403/3xx = 登录态被拒;其余 4xx/5xx 才算服务端 HTTP 异常。 */
|
|
90
109
|
function classifyXiaoEHttpStatus(status) {
|
|
91
110
|
if (status === 401 || status === 403)
|
|
@@ -128,21 +147,52 @@ function noteXiaoEError(diagnostics, error, secrets = [], stage = 'e10_session')
|
|
|
128
147
|
if (!diagnostics)
|
|
129
148
|
return;
|
|
130
149
|
const message = error instanceof Error ? error.message : String(error);
|
|
150
|
+
const request = readExchangeRequest(error);
|
|
131
151
|
const redacted = redactXiaoEDiagnostic(message, secrets);
|
|
132
152
|
if (redacted)
|
|
133
153
|
diagnostics.lastError = redacted;
|
|
154
|
+
const failureMessage = request || stage === 'bundled_env_script'
|
|
155
|
+
? redactXiaoEDiagnostic(message, secrets, XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH)
|
|
156
|
+
: redacted;
|
|
134
157
|
const { kind, causeCode, status } = classifyXiaoEError(error);
|
|
135
158
|
const failure = {
|
|
136
159
|
stage: readTag(error, 'stage', 'string') ?? stage,
|
|
137
160
|
kind,
|
|
138
|
-
message:
|
|
161
|
+
message: failureMessage,
|
|
139
162
|
...(causeCode ? { causeCode } : {}),
|
|
140
163
|
...(status === undefined ? {} : { httpStatus: status }),
|
|
164
|
+
...(request ? { request } : {}),
|
|
141
165
|
};
|
|
142
166
|
if (!diagnostics.failures)
|
|
143
167
|
diagnostics.failures = [];
|
|
144
168
|
diagnostics.failures.push(failure);
|
|
145
169
|
}
|
|
170
|
+
function xiaoEErrorChainDetail(error, secrets) {
|
|
171
|
+
const parts = [];
|
|
172
|
+
const seen = new Set();
|
|
173
|
+
let current = error;
|
|
174
|
+
for (let depth = 0; depth < 5 && current !== undefined && current !== null; depth += 1) {
|
|
175
|
+
if (seen.has(current))
|
|
176
|
+
break;
|
|
177
|
+
seen.add(current);
|
|
178
|
+
const record = typeof current === 'object' ? current : null;
|
|
179
|
+
const name = current instanceof Error
|
|
180
|
+
? current.name
|
|
181
|
+
: typeof record?.name === 'string' ? record.name : `cause${depth}`;
|
|
182
|
+
const message = current instanceof Error
|
|
183
|
+
? current.message
|
|
184
|
+
: typeof record?.message === 'string' ? record.message : String(current);
|
|
185
|
+
const attributes = ['code', 'errno', 'syscall', 'hostname', 'address', 'port']
|
|
186
|
+
.map((key) => {
|
|
187
|
+
const value = record?.[key];
|
|
188
|
+
return typeof value === 'string' || typeof value === 'number' ? `${key}=${String(value)}` : '';
|
|
189
|
+
})
|
|
190
|
+
.filter(Boolean);
|
|
191
|
+
parts.push(`${name}: ${message}${attributes.length ? ` {${attributes.join(', ')}}` : ''}`);
|
|
192
|
+
current = record?.cause;
|
|
193
|
+
}
|
|
194
|
+
return redactXiaoEDiagnostic(parts.join(' <- '), secrets, XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH);
|
|
195
|
+
}
|
|
146
196
|
/**
|
|
147
197
|
* 一次恢复失败的整体归因:只要出现过明确的凭证拒绝,就按凭证问题报(用户该去
|
|
148
198
|
* 重新登录);否则 HTTP 异常优先;只有**所有**失败都是网络错误时,才判定为
|
|
@@ -587,6 +637,73 @@ function isXiaoETokenScriptEnvFailure(message) {
|
|
|
587
637
|
return /No module named|ModuleNotFoundError|ENOENT|EACCES|permission denied|command not found|not recognized as an internal|cannot find the file/i
|
|
588
638
|
.test(message);
|
|
589
639
|
}
|
|
640
|
+
function safeXiaoEEndpoint(value) {
|
|
641
|
+
const url = value instanceof URL ? new URL(value.toString()) : new URL(value);
|
|
642
|
+
url.username = '';
|
|
643
|
+
url.password = '';
|
|
644
|
+
url.search = '';
|
|
645
|
+
url.hash = '';
|
|
646
|
+
return url.toString();
|
|
647
|
+
}
|
|
648
|
+
function xiaoEExchangeRequestDiagnostic(options) {
|
|
649
|
+
const endpoint = safeXiaoEEndpoint(options.endpoint);
|
|
650
|
+
const finalEndpoint = options.finalEndpoint ? safeXiaoEEndpoint(options.finalEndpoint) : endpoint;
|
|
651
|
+
const body = { domain: options.domain || DEFAULT_E10_BASE_URL };
|
|
652
|
+
const serializedBody = JSON.stringify(body);
|
|
653
|
+
return {
|
|
654
|
+
transport: options.transport,
|
|
655
|
+
method: 'POST',
|
|
656
|
+
endpoint,
|
|
657
|
+
...(finalEndpoint === endpoint ? {} : { finalEndpoint }),
|
|
658
|
+
redirect: options.transport === 'node_fetch' ? 'manual' : 'safe-follow',
|
|
659
|
+
headers: {
|
|
660
|
+
'content-type': 'application/json',
|
|
661
|
+
authorization: '<redacted>',
|
|
662
|
+
},
|
|
663
|
+
authorizationPresent: Boolean(options.authorization),
|
|
664
|
+
authorizationLength: options.authorization.length,
|
|
665
|
+
body,
|
|
666
|
+
bodyBytes: Buffer.byteLength(serializedBody, 'utf8'),
|
|
667
|
+
timeoutMs: XIAOE_CLIENT_TOKEN_TIMEOUT_MS,
|
|
668
|
+
elapsedMs: Math.max(0, Date.now() - options.startedAt),
|
|
669
|
+
...(options.redirectCount ? { redirectCount: options.redirectCount } : {}),
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function xiaoEPythonFailureDetail(error, stderr, env) {
|
|
673
|
+
const stderrText = stderr.trim();
|
|
674
|
+
const lines = stderrText.split(/\r?\n/u).map((line) => line.trim()).filter(Boolean);
|
|
675
|
+
let scriptMessage = '';
|
|
676
|
+
for (const line of [...lines].reverse()) {
|
|
677
|
+
try {
|
|
678
|
+
const parsed = JSON.parse(line);
|
|
679
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
680
|
+
const candidate = readString(parsed, 'msg', 'message', 'error');
|
|
681
|
+
if (candidate) {
|
|
682
|
+
scriptMessage = candidate;
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
catch {
|
|
688
|
+
// Keep scanning stderr; Python tracebacks and sandbox wrappers are not JSON.
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
const stderrTail = lines.slice(-12).join(' | ');
|
|
692
|
+
const rawDetail = [
|
|
693
|
+
`exitCode=${String(error.code ?? 'unknown')}`,
|
|
694
|
+
...(error.signal ? [`signal=${error.signal}`] : []),
|
|
695
|
+
...(error.killed ? ['killed=true'] : []),
|
|
696
|
+
...(scriptMessage ? [`scriptMessage=${scriptMessage}`] : []),
|
|
697
|
+
...(stderrTail ? [`stderrTail=${stderrTail}`] : [`processError=${error.message || 'unknown error'}`]),
|
|
698
|
+
].join(' ');
|
|
699
|
+
const detail = redactXiaoEDiagnostic(rawDetail, xiaoEDiagnosticSecrets(env), XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH);
|
|
700
|
+
const causeCode = /\b(?:UND_ERR_[A-Z_]+|E[A-Z_]{3,})\b/u.exec(detail)?.[0];
|
|
701
|
+
return {
|
|
702
|
+
detail,
|
|
703
|
+
...(causeCode && isNetworkErrorCode(causeCode) ? { causeCode } : {}),
|
|
704
|
+
network: Boolean((causeCode && isNetworkErrorCode(causeCode)) || looksLikeTransportMessage(detail)),
|
|
705
|
+
};
|
|
706
|
+
}
|
|
590
707
|
async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env) {
|
|
591
708
|
const wrapper = [
|
|
592
709
|
'import ast,contextlib,io,json,runpy,sys',
|
|
@@ -626,8 +743,15 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
|
|
|
626
743
|
maxBuffer: 1024 * 1024,
|
|
627
744
|
}, (error, stdout, stderr) => {
|
|
628
745
|
if (error) {
|
|
629
|
-
const detail = (
|
|
630
|
-
|
|
746
|
+
const { detail, causeCode, network } = xiaoEPythonFailureDetail(error, stderr, env);
|
|
747
|
+
const scriptError = new CliError('XiaoE credential script failed: ' + detail, ExitCode.AuthError);
|
|
748
|
+
if (network) {
|
|
749
|
+
Object.assign(scriptError, {
|
|
750
|
+
errorKind: 'network',
|
|
751
|
+
...(causeCode ? { causeCode } : {}),
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
reject(scriptError);
|
|
631
755
|
return;
|
|
632
756
|
}
|
|
633
757
|
const text = stdout.trim();
|
|
@@ -677,7 +801,26 @@ async function resolveXiaoEBundledEnvScriptCredential(baseUrl, env = process.env
|
|
|
677
801
|
const scriptPath = xiaoEBundledEnvScriptPath();
|
|
678
802
|
if (!scriptPath)
|
|
679
803
|
return null;
|
|
680
|
-
const
|
|
804
|
+
const platformCredential = readXiaoEPlatformCredential(env);
|
|
805
|
+
const startedAt = Date.now();
|
|
806
|
+
let tokenData;
|
|
807
|
+
try {
|
|
808
|
+
tokenData = await runXiaoEPythonCredentialScript(scriptPath, baseUrl, env);
|
|
809
|
+
}
|
|
810
|
+
catch (error) {
|
|
811
|
+
if (platformCredential && error && typeof error === 'object') {
|
|
812
|
+
Object.assign(error, {
|
|
813
|
+
request: xiaoEExchangeRequestDiagnostic({
|
|
814
|
+
transport: 'bundled_python',
|
|
815
|
+
endpoint: `${platformCredential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`,
|
|
816
|
+
domain: baseUrl,
|
|
817
|
+
authorization: platformCredential.authToken,
|
|
818
|
+
startedAt,
|
|
819
|
+
}),
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
throw error;
|
|
823
|
+
}
|
|
681
824
|
if (!tokenData)
|
|
682
825
|
return null;
|
|
683
826
|
return withDefaultXiaoEExpiry(readXiaoECredentialRecord(tokenData, XIAOE_BUNDLED_ENV_SCRIPT_SOURCE, baseUrl));
|
|
@@ -845,10 +988,23 @@ export function hasXiaoEUnifiedLoginSource(options = {}) {
|
|
|
845
988
|
return inspectXiaoEUnifiedLoginSources(options).any;
|
|
846
989
|
}
|
|
847
990
|
async function fetchXiaoEClientEteamId(credential, domain) {
|
|
991
|
+
const requestedDomain = domain || DEFAULT_E10_BASE_URL;
|
|
992
|
+
const startedAt = Date.now();
|
|
993
|
+
const initialEndpoint = new URL(`${credential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`);
|
|
994
|
+
let endpoint = initialEndpoint;
|
|
995
|
+
let redirectCount = 0;
|
|
996
|
+
const requestDiagnostic = () => xiaoEExchangeRequestDiagnostic({
|
|
997
|
+
transport: 'node_fetch',
|
|
998
|
+
endpoint: initialEndpoint,
|
|
999
|
+
finalEndpoint: endpoint,
|
|
1000
|
+
domain: requestedDomain,
|
|
1001
|
+
authorization: credential.authToken,
|
|
1002
|
+
startedAt,
|
|
1003
|
+
redirectCount,
|
|
1004
|
+
});
|
|
848
1005
|
const controller = new AbortController();
|
|
849
1006
|
const timer = setTimeout(() => controller.abort(), XIAOE_CLIENT_TOKEN_TIMEOUT_MS);
|
|
850
1007
|
try {
|
|
851
|
-
let endpoint = new URL(`${credential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`);
|
|
852
1008
|
let resp = null;
|
|
853
1009
|
for (let redirects = 0; redirects <= 5; redirects += 1) {
|
|
854
1010
|
resp = await fetch(endpoint, {
|
|
@@ -857,7 +1013,7 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
857
1013
|
'content-type': 'application/json',
|
|
858
1014
|
authorization: credential.authToken,
|
|
859
1015
|
},
|
|
860
|
-
body: JSON.stringify({ domain:
|
|
1016
|
+
body: JSON.stringify({ domain: requestedDomain }),
|
|
861
1017
|
redirect: 'manual',
|
|
862
1018
|
signal: controller.signal,
|
|
863
1019
|
});
|
|
@@ -889,6 +1045,7 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
889
1045
|
}
|
|
890
1046
|
await resp.body?.cancel().catch(() => undefined);
|
|
891
1047
|
endpoint = next;
|
|
1048
|
+
redirectCount = redirects + 1;
|
|
892
1049
|
}
|
|
893
1050
|
if (!resp?.ok) {
|
|
894
1051
|
const status = resp?.status || 0;
|
|
@@ -924,14 +1081,20 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
924
1081
|
}
|
|
925
1082
|
catch (error) {
|
|
926
1083
|
if (isAbortError(error)) {
|
|
927
|
-
throw tagXiaoEError(`XiaoE client token endpoint timed out after ${XIAOE_CLIENT_TOKEN_TIMEOUT_MS} ms.`, { errorKind: 'network', causeCode: 'ETIMEDOUT' });
|
|
1084
|
+
throw tagXiaoEError(`XiaoE client token endpoint timed out after ${XIAOE_CLIENT_TOKEN_TIMEOUT_MS} ms.`, { errorKind: 'network', causeCode: 'ETIMEDOUT', request: requestDiagnostic() });
|
|
928
1085
|
}
|
|
929
1086
|
// 已经带语义的 HTTP / 业务码错误原样上抛,别再包一层网络错误。
|
|
930
|
-
if (error instanceof CliError)
|
|
1087
|
+
if (error instanceof CliError) {
|
|
1088
|
+
Object.assign(error, { request: requestDiagnostic() });
|
|
931
1089
|
throw error;
|
|
1090
|
+
}
|
|
932
1091
|
const causeCode = readErrorCauseCode(error);
|
|
933
|
-
const
|
|
934
|
-
throw tagXiaoEError(`XiaoE client token endpoint request failed${causeCode ? ` (${causeCode})` : ''}: ${
|
|
1092
|
+
const detail = xiaoEErrorChainDetail(error, [credential.authToken]);
|
|
1093
|
+
throw tagXiaoEError(`XiaoE client token endpoint request failed${causeCode ? ` (${causeCode})` : ''}: ${detail}`, {
|
|
1094
|
+
errorKind: 'network',
|
|
1095
|
+
...(causeCode ? { causeCode } : {}),
|
|
1096
|
+
request: requestDiagnostic(),
|
|
1097
|
+
});
|
|
935
1098
|
}
|
|
936
1099
|
finally {
|
|
937
1100
|
clearTimeout(timer);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isXiaoERuntimeAgent } from '../../core/runtime-agent.js';
|
|
2
2
|
import { getActiveProfile, readProfileConfig } from './auth/session.js';
|
|
3
|
+
import { appendXiaoEAuthErrorLog, xiaoEAuthLogSecrets } from './auth/error-log.js';
|
|
3
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 = [
|
|
@@ -242,6 +243,10 @@ function recoveryLogger(ctx) {
|
|
|
242
243
|
warn: (message) => adapter.debug(message),
|
|
243
244
|
};
|
|
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
|
+
}
|
|
245
250
|
/**
|
|
246
251
|
* Silently recover a stale or missing XiaoE session. Without a local session,
|
|
247
252
|
* current runtime evidence is required before obtaining credentials.
|
|
@@ -278,18 +283,40 @@ export async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession
|
|
|
278
283
|
return existing;
|
|
279
284
|
const diagnostics = { attemptedSteps: [] };
|
|
280
285
|
const recovery = (async () => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
+
}
|
|
293
320
|
})();
|
|
294
321
|
recoveryInFlight.set(key, recovery);
|
|
295
322
|
try {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CliError, ExitCode } from '../../core/errors.js';
|
|
2
2
|
import { E10_AUTH_REQUIRED_MESSAGE, E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE, E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE, E10_XIAOE_RECOVERY_FAILED_MESSAGE, } from './auth/messages.js';
|
|
3
3
|
import { lastXiaoEFailure, summarizeXiaoEFailureKind, } from './auth/xiaoe.js';
|
|
4
|
-
import {
|
|
4
|
+
import { appendXiaoEAuthErrorLog, xiaoEAuthLogSecrets } from './auth/error-log.js';
|
|
5
|
+
import { E10AuthSession, getActiveProfile } from './auth/session.js';
|
|
5
6
|
import { E10ApiClient } from './client.js';
|
|
6
7
|
import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession, recoverXiaoEAuthSessionWithDiagnostics, } from './auth-recovery.js';
|
|
7
8
|
/**
|
|
@@ -11,10 +12,21 @@ import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession, recoverXiaoEAuth
|
|
|
11
12
|
* 评估过哪些凭证通道及各自结果,`failures` 保留每一次失败的阶段、类别和
|
|
12
13
|
* `error.cause.code`,`lastError` 是最后一条真实原因(已脱敏截断),
|
|
13
14
|
* `resultSessionExpired` 表示票其实换到了、但被判为已过期。
|
|
15
|
+
* 完整请求快照只写入 auth logs;stderr details 刻意移除 `failure.request`。
|
|
14
16
|
*/
|
|
17
|
+
function xiaoEFailureForErrorDetails(failure) {
|
|
18
|
+
return {
|
|
19
|
+
stage: failure.stage,
|
|
20
|
+
kind: failure.kind,
|
|
21
|
+
message: failure.message,
|
|
22
|
+
...(failure.causeCode ? { causeCode: failure.causeCode } : {}),
|
|
23
|
+
...(failure.httpStatus === undefined ? {} : { httpStatus: failure.httpStatus }),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
15
26
|
function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
|
|
16
27
|
const failureKind = summarizeXiaoEFailureKind(diagnostics);
|
|
17
28
|
const lastFailure = lastXiaoEFailure(diagnostics);
|
|
29
|
+
const publicFailures = diagnostics?.failures?.map(xiaoEFailureForErrorDetails);
|
|
18
30
|
const networkUnavailable = failureKind === 'network';
|
|
19
31
|
// Web sandboxes only have the platform credential channel. If the runtime
|
|
20
32
|
// marker survived but the host credential pair did not, asking the user to
|
|
@@ -34,7 +46,7 @@ function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
|
|
|
34
46
|
...(diagnostics.lastError ? { lastError: diagnostics.lastError } : {}),
|
|
35
47
|
...(failureKind ? { errorKind: failureKind } : {}),
|
|
36
48
|
...(lastFailure ? { failureStage: lastFailure.stage } : {}),
|
|
37
|
-
...(
|
|
49
|
+
...(publicFailures?.length ? { failures: publicFailures } : {}),
|
|
38
50
|
...(hostCredentialMissing ? { reason: 'host_credential_not_injected' } : {}),
|
|
39
51
|
...(resultSessionExpired ? { resultSessionExpired: true } : {}),
|
|
40
52
|
}
|
|
@@ -57,12 +69,26 @@ export async function getE10Session(ctx, load = {}) {
|
|
|
57
69
|
return E10AuthSession.fromOptions(options, ctx.cwd, load);
|
|
58
70
|
}
|
|
59
71
|
export async function requireE10Session(ctx, load = {}) {
|
|
72
|
+
const options = ctx.getGlobalOptions();
|
|
60
73
|
let session = await getE10Session(ctx, load);
|
|
61
74
|
if (session?.isExpired() && canAutomaticallyRecoverXiaoE(ctx, session)) {
|
|
62
75
|
const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx, session).catch(() => null);
|
|
63
76
|
session = outcome?.session || null;
|
|
64
77
|
if (!session || session.isExpired()) {
|
|
65
|
-
|
|
78
|
+
const resultSessionExpired = session?.isExpired() === true;
|
|
79
|
+
const error = xiaoERecoveryFailedError(outcome?.diagnostics, resultSessionExpired);
|
|
80
|
+
if (resultSessionExpired) {
|
|
81
|
+
await appendXiaoEAuthErrorLog({
|
|
82
|
+
source: 'recovery',
|
|
83
|
+
profile: options.profile || getActiveProfile(),
|
|
84
|
+
baseUrl: session?.getBaseUrl(),
|
|
85
|
+
diagnostics: outcome?.diagnostics,
|
|
86
|
+
resultSessionExpired: true,
|
|
87
|
+
error,
|
|
88
|
+
secrets: xiaoEAuthLogSecrets(ctx.env),
|
|
89
|
+
}).catch(() => undefined);
|
|
90
|
+
}
|
|
91
|
+
throw error;
|
|
66
92
|
}
|
|
67
93
|
}
|
|
68
94
|
if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
|
|
@@ -272,6 +272,14 @@ function writeProductMetadata(target, productContent) {
|
|
|
272
272
|
return;
|
|
273
273
|
writeFileSync(resolve(target, 'product.json'), productContent, 'utf8');
|
|
274
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* 拷贝白名单:整目录复制,只剔除本地依赖与系统垃圾。
|
|
277
|
+
*
|
|
278
|
+
* 历史实现把 `scripts/` 与 `assets/` 一并排除,导致带资产的技能装出来是残缺的——
|
|
279
|
+
* reception 缺 `scripts/render.py` 与 `assets/行程单模板-泛微.docx` 会直接跑不出 docx,
|
|
280
|
+
* builder 缺 `assets/dom-structure/` 也少一半能力。
|
|
281
|
+
* 技能包是受控的内部产物,资产就应当随包分发,因此只保留 node_modules 这一条硬排除。
|
|
282
|
+
*/
|
|
275
283
|
function shouldCopy(entry, sourceRoot, skipSkillProduct) {
|
|
276
284
|
const relativePath = relative(sourceRoot, entry);
|
|
277
285
|
const name = basename(entry);
|
|
@@ -282,7 +290,7 @@ function shouldCopy(entry, sourceRoot, skipSkillProduct) {
|
|
|
282
290
|
if (name === '.DS_Store' || name.startsWith('.'))
|
|
283
291
|
return false;
|
|
284
292
|
const parts = relativePath.split(sep);
|
|
285
|
-
return !parts.includes('node_modules')
|
|
293
|
+
return !parts.includes('node_modules');
|
|
286
294
|
}
|
|
287
295
|
function countFiles(root) {
|
|
288
296
|
let count = 0;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
|
|
1
2
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
@@ -35,7 +36,7 @@ function signature(payload, key) {
|
|
|
35
36
|
}
|
|
36
37
|
export function createArchiveContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
4
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
5
|
import { formatSearchCard, formatSearchHtml, formatSearchText } from './render/search-format.js';
|
|
5
6
|
import { createArchiveContinuationSigner } from './continuation.js';
|
|
6
7
|
import { createArchiveHost } from './host.js';
|
|
@@ -99,6 +100,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
99
100
|
ctx.output.write(successEnvelope(result), { json: true });
|
|
100
101
|
}
|
|
101
102
|
catch (error) {
|
|
103
|
+
reportPlatformError(error);
|
|
102
104
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
103
105
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
104
106
|
}
|
|
@@ -140,6 +142,7 @@ async function executeSearchPrint(ctx, input, format, outputPath) {
|
|
|
140
142
|
ctx.output.raw(formatSearchText(rows, meta));
|
|
141
143
|
}
|
|
142
144
|
catch (error) {
|
|
145
|
+
reportPlatformError(error);
|
|
143
146
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
144
147
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
145
148
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArchiveCliError, archiveValidationError } from '../errors.js';
|
|
2
2
|
import { READ, archiveSuccess, schemaOf, } from './types.js';
|
|
3
|
-
import { positiveInt, unwrapDatajson } from './shared.js';
|
|
4
|
-
import { BORROWING_TAG, fetchArchiveListDatas, resolveArchiveListTarget } from './getPageUrl.js';
|
|
3
|
+
import { buildBrowserToolCell, buildOpenAction, isXiaoECtx, positiveInt, unwrapDatajson, } from './shared.js';
|
|
4
|
+
import { BORROWING_TAG, fetchArchiveListDatas, resolveArchiveListTarget, resolveBorrowFormId, } from './getPageUrl.js';
|
|
5
5
|
/** 兼容「纯 ID 字符串」与「对象数组」两种字段形态(列表接口两者都会出现)。 */
|
|
6
6
|
function textOrName(value) {
|
|
7
7
|
if (Array.isArray(value)) {
|
|
@@ -62,6 +62,34 @@ function isExpired(returnDateTime, now = Date.now()) {
|
|
|
62
62
|
const due = parseDateTime(returnDateTime);
|
|
63
63
|
return due === undefined ? false : now > due;
|
|
64
64
|
}
|
|
65
|
+
/** 借阅单卡片页地址:`/sp/ebdfpage/card/0/{formId}/{dataId}`。 */
|
|
66
|
+
function borrowCardPath(formId, dataId) {
|
|
67
|
+
return `/sp/ebdfpage/card/0/${formId}/${dataId}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 借阅单的打开链接(a 标签用)。
|
|
71
|
+
* `formId` 取「我的借阅」表单对象 ID(按环境 + 租户缓存),缺任一项就不给链接。
|
|
72
|
+
*/
|
|
73
|
+
function borrowCardLink(session, formId, dataId) {
|
|
74
|
+
if (!formId || !dataId)
|
|
75
|
+
return undefined;
|
|
76
|
+
const viewPath = borrowCardPath(formId, dataId);
|
|
77
|
+
const root = String(session?.baseUrl ?? '').replace(/\/+$/, '');
|
|
78
|
+
return { viewPath, url: root ? `${root}${viewPath}` : viewPath };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 列表行 / 单条记录的打开字段:`viewPath`、`url`,小E 环境再加单行 `<browsertool>` 单元格。
|
|
82
|
+
* 表单 ID 缺失(无链接)时返回空对象,调用方原样展开即可。
|
|
83
|
+
*/
|
|
84
|
+
function borrowOpenFields(session, formId, dataId, title, xiaoE) {
|
|
85
|
+
const link = borrowCardLink(session, formId, dataId);
|
|
86
|
+
if (!link)
|
|
87
|
+
return {};
|
|
88
|
+
return {
|
|
89
|
+
...link,
|
|
90
|
+
...(xiaoE ? { browserToolCell: buildBrowserToolCell(link.url, title || '打开借阅单') } : {}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
65
93
|
function normalizeBorrowListRow(mainTable, index) {
|
|
66
94
|
const row = (mainTable && typeof mainTable === 'object' ? mainTable : {});
|
|
67
95
|
return {
|
|
@@ -119,23 +147,52 @@ const borrowListList = {
|
|
|
119
147
|
pageNo: { type: 'integer', minimum: 1, description: '页码,默认 1' },
|
|
120
148
|
pageSize: { type: 'integer', minimum: 1, description: '每页条数,默认 10' },
|
|
121
149
|
}),
|
|
122
|
-
handler: async (args, { host }) => {
|
|
150
|
+
handler: async (args, { ctx, host }) => {
|
|
123
151
|
const pageNo = positiveInt(args.pageNo, 'pageNo', 1);
|
|
124
152
|
const pageSize = positiveInt(args.pageSize, 'pageSize', 10);
|
|
125
153
|
const session = await host.getSession();
|
|
154
|
+
// 借阅单表单 ID:按「环境 + 租户」缓存(进程内 + state 目录),失败时降级为无链接
|
|
155
|
+
const formId = await resolveBorrowFormId(host, session, ctx);
|
|
156
|
+
const xiaoE = isXiaoECtx(ctx);
|
|
126
157
|
const custom = await listByCustomApi(host, session.userId, pageNo, pageSize);
|
|
127
158
|
if (custom) {
|
|
128
|
-
|
|
159
|
+
const rows = custom.rows.map((row) => ({
|
|
160
|
+
...row,
|
|
161
|
+
...borrowOpenFields(session, formId, row.dataId, row.name, xiaoE),
|
|
162
|
+
}));
|
|
163
|
+
return archiveSuccess('archive.borrow-list.list', {
|
|
164
|
+
source: 'myBorrowList',
|
|
165
|
+
pageNo,
|
|
166
|
+
pageSize,
|
|
167
|
+
count: custom.count,
|
|
168
|
+
...(formId ? { formId } : {}),
|
|
169
|
+
hasXiaoEEnv: xiaoE,
|
|
170
|
+
rows,
|
|
171
|
+
}, { source: 'myBorrowList' });
|
|
129
172
|
}
|
|
130
173
|
const target = await resolveArchiveListTarget(host, { sign: BORROWING_TAG, viewMode: 'myBorrow' });
|
|
131
174
|
const page = await fetchArchiveListDatas(host, target, pageNo);
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
dataId
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
175
|
+
const targetFormId = formId || String(target.objId ?? '');
|
|
176
|
+
const rows = page.rows.map((row, index) => {
|
|
177
|
+
const dataId = String(row.id ?? '');
|
|
178
|
+
const display = page.displayRows[index];
|
|
179
|
+
const title = String(display?.name ?? row.name ?? '');
|
|
180
|
+
return {
|
|
181
|
+
index: index + 1,
|
|
182
|
+
dataId,
|
|
183
|
+
fields: row,
|
|
184
|
+
...(display ? { display } : {}),
|
|
185
|
+
...borrowOpenFields(session, targetFormId, dataId, title, xiaoE),
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
return archiveSuccess('archive.borrow-list.list', {
|
|
189
|
+
source: 'ebuilder',
|
|
190
|
+
pageNo: page.pageNo,
|
|
191
|
+
count: rows.length,
|
|
192
|
+
...(targetFormId ? { formId: targetFormId } : {}),
|
|
193
|
+
hasXiaoEEnv: xiaoE,
|
|
194
|
+
rows,
|
|
195
|
+
}, { source: 'ebuilder', viewSource: target.viewSource });
|
|
139
196
|
},
|
|
140
197
|
};
|
|
141
198
|
/** 借阅单详情(myBorrowDetail),下载前的两项前置校验也基于本接口。 */
|
|
@@ -187,7 +244,7 @@ const borrowListDetail = {
|
|
|
187
244
|
capability: 'archive',
|
|
188
245
|
risk: READ,
|
|
189
246
|
inputSchema: schemaOf({ dataId: { type: 'string', pattern: '^\\d+$', description: '借阅单主表数据 ID' } }, { required: ['dataId'], description: '借阅单详情' }),
|
|
190
|
-
handler: async (args, { host }) => {
|
|
247
|
+
handler: async (args, { ctx, host }) => {
|
|
191
248
|
const dataId = args.dataId;
|
|
192
249
|
if (dataId === undefined || dataId === null || !/^\d+$/.test(String(dataId))) {
|
|
193
250
|
throw archiveValidationError('data_id_invalid', 'dataId 必填且为数字 ID');
|
|
@@ -196,6 +253,7 @@ const borrowListDetail = {
|
|
|
196
253
|
const detail = await fetchBorrowDetail(host, session.userId, String(dataId));
|
|
197
254
|
// 档案题名补可点击链接:arcDangan.id 形如 {档案ID}_{表单ID},拼成与全文检索一致的 archiveView
|
|
198
255
|
const root = String(session?.baseUrl ?? '').replace(/\/+$/, '');
|
|
256
|
+
const xiaoE = isXiaoECtx(ctx);
|
|
199
257
|
const details = detail.details.map((item) => ({
|
|
200
258
|
...item,
|
|
201
259
|
arcDangan: item.arcDangan.map((arc) => {
|
|
@@ -203,10 +261,43 @@ const borrowListDetail = {
|
|
|
203
261
|
if (!arcId || !arcFormId)
|
|
204
262
|
return arc;
|
|
205
263
|
const viewPath = `/sp/custom/archive/archiveView?arcId=${arcId}&arcFormId=${arcFormId}`;
|
|
206
|
-
|
|
264
|
+
const url = root ? `${root}${viewPath}` : viewPath;
|
|
265
|
+
const name = String(arc.name ?? '打开档案');
|
|
266
|
+
return {
|
|
267
|
+
...arc,
|
|
268
|
+
viewPath,
|
|
269
|
+
url,
|
|
270
|
+
// 小E 环境:明细表最后一列“操作”放该档案的单行 <browsertool>,与档案同一行;非小E 不带该字段
|
|
271
|
+
...(xiaoE ? { browserToolCell: buildBrowserToolCell(url, name) } : {}),
|
|
272
|
+
};
|
|
207
273
|
}),
|
|
208
274
|
}));
|
|
209
|
-
|
|
275
|
+
// 明细里的档案链接:题名正常给 a 标签,打开动作由宿主按 clientAction 执行
|
|
276
|
+
const openEnv = buildOpenAction(ctx, String(details[0]?.arcDangan?.[0]?.url ?? ''), '打开档案');
|
|
277
|
+
// 借阅单本身的卡片页链接(表单 ID 按环境 + 租户缓存)
|
|
278
|
+
const borrowFormId = await resolveBorrowFormId(host, session, ctx);
|
|
279
|
+
const selfLink = borrowCardLink(session, borrowFormId, String(detail.dataId || dataId));
|
|
280
|
+
// 单条场景:小E 环境给出 <browsertool> 参数,放在单据数据之后单独一行渲染
|
|
281
|
+
const selfOpen = selfLink
|
|
282
|
+
? buildOpenAction(ctx, selfLink.url, String(detail.name || '打开借阅单'))
|
|
283
|
+
: undefined;
|
|
284
|
+
return archiveSuccess('archive.borrow-list.detail', {
|
|
285
|
+
...detail,
|
|
286
|
+
details,
|
|
287
|
+
...(borrowFormId ? { formId: borrowFormId } : {}),
|
|
288
|
+
...(selfLink
|
|
289
|
+
? {
|
|
290
|
+
viewPath: selfLink.viewPath,
|
|
291
|
+
url: selfLink.url,
|
|
292
|
+
markdown: `[打开借阅单](${selfLink.url})`,
|
|
293
|
+
}
|
|
294
|
+
: {}),
|
|
295
|
+
...(selfOpen?.browserTool ? { browserTool: selfOpen.browserTool } : {}),
|
|
296
|
+
hasXiaoEEnv: xiaoE,
|
|
297
|
+
requiresHostAction: openEnv.requiresHostAction,
|
|
298
|
+
opened: openEnv.opened,
|
|
299
|
+
clientAction: openEnv.clientAction,
|
|
300
|
+
}, { count: details.length });
|
|
210
301
|
},
|
|
211
302
|
};
|
|
212
303
|
export const borrowListOperations = [borrowListList, borrowListDetail];
|