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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createBlogContinuationSigner } from './continuation.js';
|
|
4
5
|
import { blogValidationError } from './errors.js';
|
|
5
6
|
import { createBlogHost } from './host.js';
|
|
@@ -101,6 +102,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
101
102
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
102
103
|
}
|
|
103
104
|
catch (error) {
|
|
105
|
+
reportPlatformError(error);
|
|
104
106
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
105
107
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
106
108
|
}
|
|
@@ -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 createCaizhilianContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createCaizhilianContinuationSigner } from './continuation.js';
|
|
4
5
|
import { caizhilianValidationError } from './errors.js';
|
|
5
6
|
import { createCaizhilianHost } from './host.js';
|
|
@@ -88,6 +89,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
88
89
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
|
92
|
+
reportPlatformError(error);
|
|
91
93
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
92
94
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
93
95
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { caizhilianConfirmationError, caizhilianValidationError } from '../errors.js';
|
|
2
3
|
import { fingerprint } from './shared.js';
|
|
3
4
|
/** apply 类写操作必须显式确认。 */
|
|
@@ -12,7 +13,7 @@ export function requireConfirm(args, action) {
|
|
|
12
13
|
* prepare 阶段签发 continuation。
|
|
13
14
|
* 环境指纹(baseUrl + 登录账号)写进票据,apply 时校验,避免跨环境/跨账号复用。
|
|
14
15
|
*/
|
|
15
|
-
export async function issueLease(env, action, payload, ttlMs =
|
|
16
|
+
export async function issueLease(env, action, payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
16
17
|
const session = await env.host.getSession();
|
|
17
18
|
const continuation = await env.continuation.issue({
|
|
18
19
|
operation: action,
|
|
@@ -61,7 +62,7 @@ export function leaseArgsFingerprint(args) {
|
|
|
61
62
|
return fingerprint(picked);
|
|
62
63
|
}
|
|
63
64
|
/** prepare 签发票据:自动附带入参指纹(apply 时由 assertLeaseArgs 校验)。 */
|
|
64
|
-
export async function issueWriteLease(env, action, args, payload, ttlMs =
|
|
65
|
+
export async function issueWriteLease(env, action, args, payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
65
66
|
return issueLease(env, action, { ...payload, argsFingerprint: leaseArgsFingerprint(args) }, ttlMs);
|
|
66
67
|
}
|
|
67
68
|
/** apply 校验整体入参与 prepare 时一致(比 assertLeaseTarget 更严格的全量防漂移)。 */
|
|
@@ -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 createCalendarContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createCalendarContinuationSigner } from './continuation.js';
|
|
4
5
|
import { createCalendarHost } from './host.js';
|
|
5
6
|
import { calendarManifest } from './manifest.js';
|
|
@@ -83,6 +84,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
83
84
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
84
85
|
}
|
|
85
86
|
catch (error) {
|
|
87
|
+
reportPlatformError(error);
|
|
86
88
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
87
89
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
88
90
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
|
|
1
2
|
import { createHash } from 'node:crypto';
|
|
2
3
|
import { calendarConfirmationError, calendarPartialError, calendarValidationError, CalendarCliError } from '../errors.js';
|
|
3
4
|
import { calendarSuccess, schemaOf, SCHEMA_ID, SCHEMA_DATETIME_MINUTE, SCHEMA_SWITCH, SCHEMA_DATE } from './types.js';
|
|
4
5
|
import { assertDateTimeMinute, defaultEndTime, optionId, participantIds, pickDefined, } from './shared.js';
|
|
5
6
|
import { fetchAgendaAppAndForm } from './read.js';
|
|
6
|
-
const CONTINUATION_TTL_SECONDS = 600;
|
|
7
7
|
// 日程 mainTable 可选业务字段(创建/更新共用)
|
|
8
8
|
const OPTIONAL_FIELDS = [
|
|
9
9
|
'next_start_remind',
|
|
@@ -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 createContractContinuationSigner(ctx) {
|
|
37
38
|
return {
|
|
38
|
-
async issue(payload, ttlMs =
|
|
39
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
39
40
|
const issuedAt = Date.now();
|
|
40
41
|
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
41
42
|
const sig = signature(body, await loadKey(ctx));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { basename } from 'node:path';
|
|
1
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { basename, dirname } from 'node:path';
|
|
3
3
|
import { E10_SESSION_EXPIRED_MESSAGE } from '../../internal/e10/auth/messages.js';
|
|
4
4
|
import { isE10SessionExpiredResponse, } from '../../internal/e10/auth-recovery.js';
|
|
5
5
|
import { requireE10Session } from '../../internal/e10/context.js';
|
|
@@ -7,6 +7,10 @@ import { getActiveProfile } from '../../internal/e10/auth/session.js';
|
|
|
7
7
|
import { E10ApiError, createE10RequestRuntime, } from '../../internal/e10/request-runtime.js';
|
|
8
8
|
import { ContractCliError, contractAuthError, contractNetworkError, contractValidationError, } from './errors.js';
|
|
9
9
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
10
|
+
/** 文件下载超时:普通接口 30s 不够,大文件按 120s 走。 */
|
|
11
|
+
const DEFAULT_DOWNLOAD_TIMEOUT_MS = 120_000;
|
|
12
|
+
/** 单文件下载上限 200MB,与采知连附件下载口径一致。 */
|
|
13
|
+
const DEFAULT_MAX_DOWNLOAD_BYTES = 200 * 1024 * 1024;
|
|
10
14
|
function assertPath(requestPath) {
|
|
11
15
|
if (typeof requestPath !== 'string' || !requestPath.startsWith('/') || requestPath.startsWith('//')) {
|
|
12
16
|
throw contractValidationError('path_invalid', '请求路径必须是相对绝对路径');
|
|
@@ -32,6 +36,8 @@ function textOf(value, keys) {
|
|
|
32
36
|
* 因此 0 与 200 均视为成功,并辅以 status/fail 判定
|
|
33
37
|
* - /api/ebuilder/form/obj/getObjsByTag、/api/bs/ebuilder/app/tags/getAppIds、
|
|
34
38
|
* /api/ebuilder/common/ds/fields、/api/ebuilder/common/ds/options:顶层 code = 200 且 status 不为 false
|
|
39
|
+
* - /api/ebuilder/form/common/browser/**(表单浏览补全):同样是顶层 code = 0/200 且 status 不为 false,
|
|
40
|
+
* 但没有 message 节点也没有 errcode——不单独分组就会被末尾兜底判成失败
|
|
35
41
|
* - /api/ebuilder/form/dataset/v2/**:message.code = "0"
|
|
36
42
|
* - /api/workflow/**:message.errcode = "0"(getFieldOption 上游文档示例为 200,同样视为成功)
|
|
37
43
|
* - /api/workflow/core/flowPage/**、/api/workflow/core/form/**、/api/ebuilder/flow/form/**
|
|
@@ -64,6 +70,15 @@ export function contractBusinessStatus(path, value) {
|
|
|
64
70
|
const ok = (code === 0 || code === '0' || code === 200 || code === '200') && root.status !== false && root.fail !== true;
|
|
65
71
|
return { ok, code: code === undefined ? undefined : String(code), message: textOf(root, ['msg', 'message']) ?? textOf(messageNode, ['errmsg', 'msg']) };
|
|
66
72
|
}
|
|
73
|
+
// 表单浏览补全 browser/complete:与 getObjsByTag 同一族形状——顶层 code=200、无 message 节点、
|
|
74
|
+
// 也没有 errcode。落到末尾兜底分支会因 errcode === undefined 被判成失败,必须在这里拦下来。
|
|
75
|
+
if (path.startsWith('/api/ebuilder/form/common/browser/')) {
|
|
76
|
+
const code = root.code ?? messageNode.code ?? messageNode.errcode;
|
|
77
|
+
const ok = (code === 0 || code === '0' || code === 200 || code === '200')
|
|
78
|
+
&& root.status !== false
|
|
79
|
+
&& root.fail !== true;
|
|
80
|
+
return { ok, code: code === undefined ? undefined : String(code), message: textOf(root, ['msg', 'message']) ?? textOf(messageNode, ['errmsg', 'msg']) };
|
|
81
|
+
}
|
|
67
82
|
if (path === '/api/ebuilder/form/obj/getObjsByTag'
|
|
68
83
|
|| path === '/api/bs/ebuilder/app/tags/getAppIds'
|
|
69
84
|
|| path === '/api/ebuilder/common/ds/fields'
|
|
@@ -121,7 +136,7 @@ export function createContractHost(ctx, dependencies = {}) {
|
|
|
121
136
|
return sessionContext;
|
|
122
137
|
}
|
|
123
138
|
async function contractRequest(request) {
|
|
124
|
-
const { method = 'POST', path, query = {}, body, form, file, headers: extraHeaders, userIdField, timeoutMs = DEFAULT_TIMEOUT_MS, } = request;
|
|
139
|
+
const { method = 'POST', path, query = {}, body, form, file, headers: extraHeaders, userIdField, timeoutMs = DEFAULT_TIMEOUT_MS, okOnHttpSuccess = false, } = request;
|
|
125
140
|
assertPath(path);
|
|
126
141
|
const session = await ensureSession();
|
|
127
142
|
const context = await getSession();
|
|
@@ -197,6 +212,10 @@ export function createContractHost(ctx, dependencies = {}) {
|
|
|
197
212
|
exitCode: 1,
|
|
198
213
|
});
|
|
199
214
|
}
|
|
215
|
+
// 触发型接口:HTTP 2xx 即成功,空响应体也是正确结果,不再走业务码判定。
|
|
216
|
+
if (okOnHttpSuccess) {
|
|
217
|
+
return value;
|
|
218
|
+
}
|
|
200
219
|
const status = contractBusinessStatus(path, value);
|
|
201
220
|
if (!status.ok) {
|
|
202
221
|
const rawPreview = typeof text === 'string' ? text.slice(0, 500) : '';
|
|
@@ -208,5 +227,93 @@ export function createContractHost(ctx, dependencies = {}) {
|
|
|
208
227
|
}
|
|
209
228
|
return value;
|
|
210
229
|
}
|
|
211
|
-
|
|
230
|
+
/**
|
|
231
|
+
* 二进制下载通道。
|
|
232
|
+
*
|
|
233
|
+
* 刻意与 `contractRequest` 分离,原因有三:
|
|
234
|
+
* 1. `contractRequest` 强制 `response.text()` + `JSON.parse`,文件字节流过不去;
|
|
235
|
+
* 2. 它的成功判据走 `contractBusinessStatus`,而文件服务没有统一业务码,硬套会把成功判成失败;
|
|
236
|
+
* 3. 下载要跟重定向(302 → 登录页 / CDN),`contractRequest` 对 302 直接抛 session_expired。
|
|
237
|
+
*
|
|
238
|
+
* 认证与重定向**完全复用** `createE10RequestRuntime().requestBinary()`:同一套 auth 头、
|
|
239
|
+
* 超时控制,以及下载重定向跟随(同源带 Cookie/eteamsid、跨域对象存储不带任何会话凭证),
|
|
240
|
+
* 不另读凭证、也不复写一遍低层 fetch 逻辑。
|
|
241
|
+
*/
|
|
242
|
+
async function contractDownloadToFile(request) {
|
|
243
|
+
const { path, query = {}, headers: extraHeaders, savePath, maxBytes = DEFAULT_MAX_DOWNLOAD_BYTES, timeoutMs = DEFAULT_DOWNLOAD_TIMEOUT_MS, } = request;
|
|
244
|
+
assertPath(path);
|
|
245
|
+
if (!savePath || typeof savePath !== 'string') {
|
|
246
|
+
throw contractValidationError('save_path_required', '下载必须提供本地保存路径');
|
|
247
|
+
}
|
|
248
|
+
const session = await ensureSession();
|
|
249
|
+
const runtime = createE10RequestRuntime(ctx, session, {
|
|
250
|
+
interceptors: dependencies.interceptors,
|
|
251
|
+
fetch: dependencies.fetch,
|
|
252
|
+
recoverAuthentication: dependencies.recoverAuthentication,
|
|
253
|
+
});
|
|
254
|
+
let response;
|
|
255
|
+
try {
|
|
256
|
+
response = await runtime.requestBinary({
|
|
257
|
+
module: 'contract',
|
|
258
|
+
method: 'GET',
|
|
259
|
+
path,
|
|
260
|
+
query,
|
|
261
|
+
headers: extraHeaders,
|
|
262
|
+
timeoutMs,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
if (error instanceof E10ApiError && error.type === 'network') {
|
|
267
|
+
throw contractNetworkError(error.subtype, error.message, {
|
|
268
|
+
retryable: error.retryable,
|
|
269
|
+
details: error.details,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
throw error;
|
|
273
|
+
}
|
|
274
|
+
// requestBinary 内部已跟随下载重定向(302 → 文件服务/CDN)。这里还残留的
|
|
275
|
+
// 302 只可能是登录跳转(运行时判定为 login 不跟随),按登录失效处理。
|
|
276
|
+
if (response.status === 302) {
|
|
277
|
+
throw contractAuthError('session_expired', '下载接口跳转到登录页,登录态未被接受;请先完成 E10 登录后重试', { httpStatus: response.status, path });
|
|
278
|
+
}
|
|
279
|
+
if (response.status === 401 || response.status === 403) {
|
|
280
|
+
throw contractAuthError('session_expired', 'E10 登录态不可用于文件下载,或当前账号对该文件没有下载权限', { httpStatus: response.status, path });
|
|
281
|
+
}
|
|
282
|
+
if (response.status < 200 || response.status >= 300) {
|
|
283
|
+
throw new ContractCliError('api', 'http_error', `文件下载失败,HTTP ${response.status}`, {
|
|
284
|
+
code: response.status,
|
|
285
|
+
details: { path, status: response.status },
|
|
286
|
+
exitCode: 1,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
const contentType = response.contentType;
|
|
290
|
+
// 服务端把登录页/错误页当 200 返回时,content-type 是 html,不能当文件落盘。
|
|
291
|
+
if (contentType && /text\/html/i.test(contentType)) {
|
|
292
|
+
const preview = response.content.subarray(0, 200).toString('utf8').replace(/\s+/g, ' ');
|
|
293
|
+
throw new ContractCliError('api', 'not_a_file', '返回的是 HTML 页面而不是文件,登录态或下载权限不足', {
|
|
294
|
+
details: { path, contentType, preview },
|
|
295
|
+
exitCode: 1,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
const declared = Number(response.headers.get('content-length') ?? '');
|
|
299
|
+
if (Number.isFinite(declared) && declared > maxBytes) {
|
|
300
|
+
throw contractValidationError('file_too_large', `文件超过下载上限 ${Math.round(maxBytes / 1024 / 1024)}MB`);
|
|
301
|
+
}
|
|
302
|
+
const buffer = response.content;
|
|
303
|
+
if (buffer.length === 0) {
|
|
304
|
+
throw new ContractCliError('api', 'empty_file', '下载结果为空文件', {
|
|
305
|
+
details: { path, contentType },
|
|
306
|
+
exitCode: 1,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
if (buffer.length > maxBytes) {
|
|
310
|
+
throw contractValidationError('file_too_large', `文件超过下载上限 ${Math.round(maxBytes / 1024 / 1024)}MB`);
|
|
311
|
+
}
|
|
312
|
+
const directory = dirname(savePath);
|
|
313
|
+
if (directory)
|
|
314
|
+
await mkdir(directory, { recursive: true });
|
|
315
|
+
await writeFile(savePath, buffer);
|
|
316
|
+
return { filePath: savePath, fileSize: buffer.length, contentType: contentType ?? null };
|
|
317
|
+
}
|
|
318
|
+
return { contractRequest, getSession, contractDownloadToFile };
|
|
212
319
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
|
+
import { reportPlatformError } from '../../core/error-codes.js';
|
|
3
4
|
import { createContractContinuationSigner } from './continuation.js';
|
|
4
5
|
import { contractValidationError } from './errors.js';
|
|
5
6
|
import { createContractHost } from './host.js';
|
|
@@ -109,6 +110,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
109
110
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
110
111
|
}
|
|
111
112
|
catch (error) {
|
|
113
|
+
reportPlatformError(error);
|
|
112
114
|
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
113
115
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
114
116
|
}
|
|
@@ -185,6 +187,7 @@ export const contractShortcut = {
|
|
|
185
187
|
{ flag: '--page-no <n>', description: 'page number', key: 'pageNo', kind: 'int' },
|
|
186
188
|
{ flag: '--page-size <n>', description: 'page size', key: 'pageSize', kind: 'int' },
|
|
187
189
|
]);
|
|
190
|
+
registerCommand(clause, 'insert', 'Insert clauses into a contract docx (locate by chapter, dedupe)', 'contract.clause.insert');
|
|
188
191
|
registerCommand(clause, 'search', 'Search clauses', 'contract.clause.search', [
|
|
189
192
|
{ flag: '--title <title>', description: 'clause title keyword', key: 'title' },
|
|
190
193
|
{ flag: '--tag-id <id>', description: 'clause tag id', key: 'tagId' },
|
|
@@ -349,6 +352,12 @@ export const contractShortcut = {
|
|
|
349
352
|
const review = contract.command('review').description('Contract AI review commands');
|
|
350
353
|
// paths 是数组,子命令只提供 JSON 输入入口,避免把路径拆成多个位置参数。
|
|
351
354
|
registerCommand(review, 'upload', 'Upload contracts and get the AI review page url', 'contract.review.upload');
|
|
355
|
+
registerCommand(review, 'prewarm', 'Trigger contract review prewarm for one fileId', 'contract.review.prewarm', [
|
|
356
|
+
{ flag: '--file-id <id>', description: 'uploaded file id', key: 'fileId' },
|
|
357
|
+
]);
|
|
358
|
+
registerCommand(review, 'prewarm-batch', 'Trigger review prewarm for multiple fileIds (parallel)', 'contract.review.prewarm.batch', [
|
|
359
|
+
{ flag: '--file-ids <json>', description: 'JSON array of file ids', key: 'fileIds' },
|
|
360
|
+
]);
|
|
352
361
|
registerCommand(review, 'export', 'Export AI review records', 'contract.review.export', [
|
|
353
362
|
{ flag: '--file-id <id>', description: 'contract file id', key: 'fileId' },
|
|
354
363
|
{ flag: '--sclx <types>', description: '1 risk, 2 legal, 3 proofreading', key: 'sclx' },
|
|
@@ -440,6 +449,18 @@ export const contractShortcut = {
|
|
|
440
449
|
{ flag: '--contract-numbers <json>', description: 'contract numbers JSON array', key: 'contractNumbers' },
|
|
441
450
|
{ flag: '--page-size <n>', description: 'page size', key: 'pageSize', kind: 'int' },
|
|
442
451
|
]);
|
|
452
|
+
const summary = contract.command('summary').description('Contract summary rendering commands (local)');
|
|
453
|
+
registerCommand(summary, 'render', 'Render summary data JSON into an HTML file (local)', 'contract.summary.render', [
|
|
454
|
+
{ flag: '--data <file>', description: 'summary data JSON path', key: 'data' },
|
|
455
|
+
{ flag: '--out <file>', description: 'output HTML path', key: 'out' },
|
|
456
|
+
]);
|
|
457
|
+
const file = contract.command('file').description('Contract file download commands (binary)');
|
|
458
|
+
registerCommand(file, 'download', 'Download an E10 file to a local path', 'contract.file.download', [
|
|
459
|
+
{ flag: '--file-id <id>', description: 'E10 file id (template / attachment / review file)', key: 'fileId' },
|
|
460
|
+
{ flag: '--module <name>', description: 'ebContract / workflow / docCompared / ebuilderform', key: 'module' },
|
|
461
|
+
{ flag: '--save-path <path>', description: 'local absolute save path', key: 'savePath' },
|
|
462
|
+
{ flag: '--max-bytes <n>', description: 'max file size in bytes, default 200MB', key: 'maxBytes', kind: 'int' },
|
|
463
|
+
]);
|
|
443
464
|
const quote = contract.command('quote').description('Quote-to-contract commands (local xlsx/docx)');
|
|
444
465
|
registerCommand(quote, 'rmb', 'Convert a number to RMB uppercase (local)', 'contract.quote.rmb', [
|
|
445
466
|
{ flag: '--num <value>', description: 'number', key: 'num' },
|
|
@@ -434,6 +434,31 @@ const quoteContracts = [
|
|
|
434
434
|
fixed: { local: true, kind: 'rmb-upper' },
|
|
435
435
|
inputSchema: readSchema({ num: { type: 'string', minLength: 1 } }, ['num']),
|
|
436
436
|
},
|
|
437
|
+
{
|
|
438
|
+
name: 'contract.summary.render',
|
|
439
|
+
risk: 'local-file-write',
|
|
440
|
+
fixed: { local: true, kind: 'summary-render' },
|
|
441
|
+
inputSchema: readSchema({
|
|
442
|
+
data: { type: 'string', minLength: 1, maxLength: 4096, description: '摘要数据 JSON 文件路径' },
|
|
443
|
+
out: { type: 'string', minLength: 1, maxLength: 4096, description: '输出 HTML 绝对路径' },
|
|
444
|
+
}, ['data', 'out']),
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: 'contract.file.download',
|
|
448
|
+
risk: 'local-file-write',
|
|
449
|
+
auth: AUTH,
|
|
450
|
+
fixed: { local: true, kind: 'file-download', method: 'GET' },
|
|
451
|
+
inputSchema: readSchema({
|
|
452
|
+
fileId: { ...idString, description: 'E10 文件 ID(模板 fileId、附件 id、审查 fileId)' },
|
|
453
|
+
module: {
|
|
454
|
+
type: 'string',
|
|
455
|
+
enum: ['ebContract', 'workflow', 'docCompared', 'ebuilderform'],
|
|
456
|
+
description: '文件所属模块,合同模板用 ebContract',
|
|
457
|
+
},
|
|
458
|
+
savePath: { type: 'string', minLength: 1, maxLength: 4096, description: '本地保存绝对路径' },
|
|
459
|
+
maxBytes: { type: 'integer', minimum: 1, maximum: 209715200, description: '单文件大小上限,默认 200MB' },
|
|
460
|
+
}, ['fileId', 'savePath']),
|
|
461
|
+
},
|
|
437
462
|
{
|
|
438
463
|
name: 'contract.quote.sheets',
|
|
439
464
|
risk: 'read-with-upload',
|
|
@@ -464,6 +489,27 @@ const quoteContracts = [
|
|
|
464
489
|
}, ['template', 'data', 'out']),
|
|
465
490
|
},
|
|
466
491
|
];
|
|
492
|
+
// ---------------------------------------------------------------- 客户主数据查询(按全称)
|
|
493
|
+
//
|
|
494
|
+
// 编排层 S2(对象识别)的取数入口:把「最终用户」全称丢进来,判断有没有匹配到客户主数据。
|
|
495
|
+
// 走表单浏览补全接口而非 subject.query —— 客户主数据的 objId/appId 是环境值,只能由服务端
|
|
496
|
+
// 从 fieldId 现场解析,不能硬编码,也不能靠 getObjsByTag 发现(它挂在别的应用下)。
|
|
497
|
+
// 只接受全称:空关键词在这条接口上是"按顺序返回前若干条",会把任意主体当命中。
|
|
498
|
+
const contractCustomerOperationContracts = [
|
|
499
|
+
{
|
|
500
|
+
name: 'contract.customer.browser',
|
|
501
|
+
risk: 'read',
|
|
502
|
+
auth: AUTH,
|
|
503
|
+
fixed: { method: 'POST', path: '/api/ebuilder/form/common/browser/complete/ebuilder' },
|
|
504
|
+
inputSchema: readSchema({
|
|
505
|
+
searchValue: { type: 'string', minLength: 1, maxLength: 100, description: '客户全称(必填、不可为空)。只做全称查询:空关键词会返回无关的前若干条,会把新老客户判错' },
|
|
506
|
+
workflowId: idString,
|
|
507
|
+
fieldName: { type: 'string', maxLength: 50, description: '客户字段名;缺省按「客户名称 / 最终用户名称 / 最终用户 / 客户」依次匹配' },
|
|
508
|
+
fieldId: idString,
|
|
509
|
+
pageSize: { type: 'integer', minimum: 1, maximum: 50 },
|
|
510
|
+
}, ['searchValue', 'workflowId']),
|
|
511
|
+
},
|
|
512
|
+
];
|
|
467
513
|
export const contractOperations = [
|
|
468
514
|
{
|
|
469
515
|
name: 'contract.type.tree',
|
|
@@ -1020,6 +1066,8 @@ export const contractOperations = [
|
|
|
1020
1066
|
module: 'ebContract',
|
|
1021
1067
|
createDoc: true,
|
|
1022
1068
|
pagePath: '/sp/contract/business/ai-contract',
|
|
1069
|
+
prewarmPath: '/api/ebd/contract/ai/saveInternalRecord',
|
|
1070
|
+
prewarmFlowId: '1269716062340284522',
|
|
1023
1071
|
},
|
|
1024
1072
|
inputSchema: readSchema({
|
|
1025
1073
|
paths: {
|
|
@@ -1028,8 +1076,46 @@ export const contractOperations = [
|
|
|
1028
1076
|
maxItems: 10,
|
|
1029
1077
|
items: { type: 'string', minLength: 1, maxLength: 1000 },
|
|
1030
1078
|
},
|
|
1079
|
+
prewarm: {
|
|
1080
|
+
type: 'boolean',
|
|
1081
|
+
description: '默认 true:上传成功即触发预审预热;传 false 可关闭',
|
|
1082
|
+
},
|
|
1031
1083
|
}, ['paths']),
|
|
1032
1084
|
},
|
|
1085
|
+
{
|
|
1086
|
+
name: 'contract.review.prewarm',
|
|
1087
|
+
risk: 'write',
|
|
1088
|
+
auth: AUTH,
|
|
1089
|
+
fixed: {
|
|
1090
|
+
method: 'POST',
|
|
1091
|
+
path: '/api/ebd/contract/ai/saveInternalRecord',
|
|
1092
|
+
flowId: '1269716062340284522',
|
|
1093
|
+
purpose: '合同预审预处理:提前启动预审,打开审查页时结果已就绪',
|
|
1094
|
+
},
|
|
1095
|
+
inputSchema: readSchema({
|
|
1096
|
+
fileId: { ...idString, description: '上传返回的 fileId' },
|
|
1097
|
+
}, ['fileId']),
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: 'contract.review.prewarm.batch',
|
|
1101
|
+
risk: 'write',
|
|
1102
|
+
auth: AUTH,
|
|
1103
|
+
fixed: {
|
|
1104
|
+
method: 'POST',
|
|
1105
|
+
path: '/api/ebd/contract/ai/saveInternalRecord',
|
|
1106
|
+
flowId: '1269716062340284522',
|
|
1107
|
+
parallel: true,
|
|
1108
|
+
},
|
|
1109
|
+
inputSchema: readSchema({
|
|
1110
|
+
fileIds: {
|
|
1111
|
+
type: 'array',
|
|
1112
|
+
minItems: 1,
|
|
1113
|
+
maxItems: 10,
|
|
1114
|
+
items: idString,
|
|
1115
|
+
description: '批量预热的 fileId 列表',
|
|
1116
|
+
},
|
|
1117
|
+
}, ['fileIds']),
|
|
1118
|
+
},
|
|
1033
1119
|
{
|
|
1034
1120
|
name: 'contract.review.export',
|
|
1035
1121
|
risk: 'read',
|
|
@@ -1054,6 +1140,19 @@ export const contractOperations = [
|
|
|
1054
1140
|
flow: { type: 'string', enum: ['契约锁', '新客户', '老客户增值', '常规二次销售'] },
|
|
1055
1141
|
}, ['flow']),
|
|
1056
1142
|
},
|
|
1143
|
+
{
|
|
1144
|
+
name: 'contract.flow.upload-field',
|
|
1145
|
+
risk: 'read',
|
|
1146
|
+
auth: AUTH,
|
|
1147
|
+
fixed: {
|
|
1148
|
+
method: 'POST',
|
|
1149
|
+
path: '/api/workflow/core/flowPage/loadBaseParam',
|
|
1150
|
+
note: '诊断用:三段式读布局后解析主表附件字段(loadBaseParam -> loadFrameParam -> getFormLayout)',
|
|
1151
|
+
},
|
|
1152
|
+
inputSchema: readSchema({
|
|
1153
|
+
flow: { type: 'string', enum: ['契约锁', '新客户', '老客户增值', '常规二次销售'] },
|
|
1154
|
+
}, ['flow']),
|
|
1155
|
+
},
|
|
1057
1156
|
{
|
|
1058
1157
|
name: 'contract.flow.launch',
|
|
1059
1158
|
risk: 'read-with-upload',
|
|
@@ -1293,6 +1392,31 @@ export const contractOperations = [
|
|
|
1293
1392
|
confirm: { type: 'boolean', enum: [true] },
|
|
1294
1393
|
}, ['id', 'continuation', 'confirm']),
|
|
1295
1394
|
},
|
|
1395
|
+
{
|
|
1396
|
+
name: 'contract.clause.insert',
|
|
1397
|
+
risk: 'local-file-write',
|
|
1398
|
+
fixed: { local: true, kind: 'clause-insert', dedupe: true, locateByChapter: true },
|
|
1399
|
+
inputSchema: readSchema({
|
|
1400
|
+
path: { type: 'string', minLength: 1, maxLength: 4096, description: '合同 docx 绝对路径' },
|
|
1401
|
+
out: { type: 'string', maxLength: 4096, description: '输出路径;缺省与 path 相同(原地覆盖)' },
|
|
1402
|
+
dryRun: { type: 'boolean', description: 'true 时只分析插入位置与去重,不写文件' },
|
|
1403
|
+
clauses: {
|
|
1404
|
+
type: 'array',
|
|
1405
|
+
minItems: 1,
|
|
1406
|
+
maxItems: 30,
|
|
1407
|
+
items: {
|
|
1408
|
+
type: 'object',
|
|
1409
|
+
additionalProperties: false,
|
|
1410
|
+
properties: {
|
|
1411
|
+
name: { type: 'string', minLength: 1, maxLength: 200 },
|
|
1412
|
+
content: { type: 'string', minLength: 1, maxLength: 20000 },
|
|
1413
|
+
anchor: { type: 'string', maxLength: 200, description: '锚点章节关键词,如「保密条款」' },
|
|
1414
|
+
},
|
|
1415
|
+
required: ['name', 'content'],
|
|
1416
|
+
},
|
|
1417
|
+
},
|
|
1418
|
+
}, ['path', 'clauses']),
|
|
1419
|
+
},
|
|
1296
1420
|
{
|
|
1297
1421
|
name: 'contract.clause.create.prepare',
|
|
1298
1422
|
risk: 'read-before-write',
|
|
@@ -1487,6 +1611,7 @@ export const contractOperations = [
|
|
|
1487
1611
|
confirm: { type: 'boolean', enum: [true] },
|
|
1488
1612
|
}, ['id', 'continuation', 'confirm']),
|
|
1489
1613
|
},
|
|
1614
|
+
...contractCustomerOperationContracts,
|
|
1490
1615
|
...contractAssistantOperationContracts,
|
|
1491
1616
|
...performanceContracts,
|
|
1492
1617
|
...quoteContracts,
|