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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<browsertool>` 渲染。
|
|
3
|
+
*
|
|
4
|
+
* 依据官方《browsertool 渲染说明》:
|
|
5
|
+
* fill_form + data → iframe 填单
|
|
6
|
+
* fill_form + sdkOptions → E10 表单组件化渲染(本文件用的形态)
|
|
7
|
+
* open_web → 打开外部网页 + XiaoEWorkspace 通信(不用于 E10 表单)
|
|
8
|
+
*
|
|
9
|
+
* 打开形态由 `arguments.sdkRenderType` 决定:
|
|
10
|
+
* inline 内嵌(移动端默认)
|
|
11
|
+
* popup / drawer 弹层(PC 端默认;drawer = 右侧抽屉,即"侧边打开")
|
|
12
|
+
* 不传则用宿主默认值(实测为内嵌),所以这里显式给值。
|
|
13
|
+
*
|
|
14
|
+
* 除 title / src / sdkRenderType / 两处 routerProps / params 外全部写死;JSON 用 2 空格缩进。
|
|
15
|
+
*/
|
|
16
|
+
export const SDK_RENDER_TYPES = ['inline', 'popup', 'drawer'];
|
|
17
|
+
function normalizeRenderType(value) {
|
|
18
|
+
const text = String(value || '').trim().toLowerCase();
|
|
19
|
+
return SDK_RENDER_TYPES.includes(text) ? text : '';
|
|
20
|
+
}
|
|
21
|
+
/** 默认形态:右侧抽屉(业务要的就是"侧边打开")。可用 RECEPTION_SDK_RENDER 或 --sdk-render 覆盖。 */
|
|
22
|
+
export const DEFAULT_SDK_RENDER = normalizeRenderType(process.env.RECEPTION_SDK_RENDER) || 'drawer';
|
|
23
|
+
/** 对外:给定入参解析出最终形态(非法值回落到默认)。 */
|
|
24
|
+
export const resolveRenderType = (value) => normalizeRenderType(value) || DEFAULT_SDK_RENDER;
|
|
25
|
+
export function renderBrowsertool(options) {
|
|
26
|
+
const base = String(options.baseUrl || '').replace(/\/+$/u, '');
|
|
27
|
+
const id = String(options.workflowId || '').trim();
|
|
28
|
+
if (!base || !id)
|
|
29
|
+
throw new Error('渲染 browsertool 需要 baseUrl 与 workflowId');
|
|
30
|
+
const renderType = normalizeRenderType(options.sdkRenderType) || DEFAULT_SDK_RENDER;
|
|
31
|
+
const createPath = `/flowpage/create/${id}`;
|
|
32
|
+
const payload = {
|
|
33
|
+
version: 1,
|
|
34
|
+
callId: 'call_001',
|
|
35
|
+
toolId: 'fill_form',
|
|
36
|
+
arguments: {
|
|
37
|
+
type: 'e10',
|
|
38
|
+
title: String(options.workflowName || ''),
|
|
39
|
+
src: `${base}/sp/workflow${createPath}?workflowId=${id}&isCreate=1`,
|
|
40
|
+
sdkRenderType: renderType,
|
|
41
|
+
sdkOptions: {
|
|
42
|
+
compName: 'ui.CorsComponent',
|
|
43
|
+
routerType: 'MemoryRouter',
|
|
44
|
+
routerProps_pc: { initialEntries: [createPath] },
|
|
45
|
+
routerProps_mobile: { initialEntries: [createPath] },
|
|
46
|
+
params_pc: { app: '@weapp/workflow', compName: 'Comp.WffpRoute', noMDialog: true },
|
|
47
|
+
params_mobile: { app: '@weapp/workflow', compName: 'Comp.MWffpRoute', noMDialog: true },
|
|
48
|
+
params: {
|
|
49
|
+
customParams: {
|
|
50
|
+
...options.customParams.values,
|
|
51
|
+
fieldAssignKeys: options.customParams.keys.join(','),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return `<browsertool>\n${JSON.stringify(payload, null, 2)}\n</browsertool>`;
|
|
58
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { buildCustomParams } from './customparams.js';
|
|
2
|
+
import { normalizeScheduleRows } from './schedule.js';
|
|
3
|
+
import { nameList } from './shared.js';
|
|
4
|
+
/**
|
|
5
|
+
* 把「接待数据 + 字段快照」合成 customParams(纯本地、零网络)。
|
|
6
|
+
*
|
|
7
|
+
* 这是渲染段的核心:不依赖实时 formctx,也不需要 continuation。
|
|
8
|
+
* 字段清单来自技能包里的快照,字段 ID 与 doNotWrite / attachmentMountField 都在快照里。
|
|
9
|
+
*/
|
|
10
|
+
const pick = (map, key) => (key && map && map[String(key)] !== undefined ? String(map[String(key)]) : '');
|
|
11
|
+
/** 附件 id 归一:接受 [{fileid,name}] / ['id1','id2'] / 'id1,id2' / 单串,返回去重后的 id 数组。 */
|
|
12
|
+
export function normAttachmentIds(list, single = '') {
|
|
13
|
+
const fromList = (Array.isArray(list) ? list : [])
|
|
14
|
+
.map((item) => {
|
|
15
|
+
if (typeof item === 'string')
|
|
16
|
+
return item.trim();
|
|
17
|
+
if (!item || typeof item !== 'object')
|
|
18
|
+
return '';
|
|
19
|
+
const record = item;
|
|
20
|
+
return String(record.fileid || record.optionId || record.fileId || record.id || '').trim();
|
|
21
|
+
})
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
if (fromList.length)
|
|
24
|
+
return [...new Set(fromList)];
|
|
25
|
+
return String(single || '').split(',').map((item) => item.trim()).filter(Boolean);
|
|
26
|
+
}
|
|
27
|
+
export function composeInitialValues(options) {
|
|
28
|
+
const { snapshot, data = {}, attachmentFileid = '', attachmentFileids = null } = options;
|
|
29
|
+
const fields = (snapshot && snapshot.fields) || [];
|
|
30
|
+
const codes = (snapshot && snapshot.optionCodes) || {};
|
|
31
|
+
const warnings = [];
|
|
32
|
+
const todos = [];
|
|
33
|
+
const params = { values: {}, keys: [] };
|
|
34
|
+
const valueOf = (name) => {
|
|
35
|
+
switch (name) {
|
|
36
|
+
// 客户名直接传中文,宿主已支持;不再拼 {id,name} 对象
|
|
37
|
+
case '来访客户名称':
|
|
38
|
+
return data.customer || '';
|
|
39
|
+
case '参观访问类型':
|
|
40
|
+
return pick(codes['参观访问类型'], data.visitType) || data.visitType || '';
|
|
41
|
+
case '客户到达日期':
|
|
42
|
+
case '客户参观日期':
|
|
43
|
+
return data.visitDate || data.arrivalDate || '';
|
|
44
|
+
case '客户需求':
|
|
45
|
+
return data.demand || '';
|
|
46
|
+
case '客户性质':
|
|
47
|
+
return pick(codes['客户性质'], data.nature) || data.nature || '';
|
|
48
|
+
case '项目金额(万元)':
|
|
49
|
+
return data.amount === 0 || data.amount ? data.amount : '';
|
|
50
|
+
case '泛微分支机构参与人员(主联络人,此人必须陪客户一同参观)': {
|
|
51
|
+
// escorts 是用户明确指定的对接人,优先级最高:companions 可能被 --user 覆盖成当前操作人。
|
|
52
|
+
// 直接传中文姓名;一个都没有时才用当前登录人 employeeid 兜底。
|
|
53
|
+
const escorts = nameList(data.escorts);
|
|
54
|
+
if (escorts.length)
|
|
55
|
+
return escorts;
|
|
56
|
+
const list = Array.isArray(data.companions) ? data.companions : [];
|
|
57
|
+
const names = list
|
|
58
|
+
.map((item) => (typeof item === 'string' ? item : item && (item.name || item.id)))
|
|
59
|
+
.map((item) => String(item || '').trim())
|
|
60
|
+
.filter(Boolean);
|
|
61
|
+
if (names.length)
|
|
62
|
+
return names;
|
|
63
|
+
return data.empId ? [String(data.empId)] : [];
|
|
64
|
+
}
|
|
65
|
+
case '是否需要高层参与':
|
|
66
|
+
return pick(codes['是否需要高层参与'], data.senior) || data.senior || '';
|
|
67
|
+
case '客户带队人':
|
|
68
|
+
return data.leader || '';
|
|
69
|
+
case '客户参观接待行程单(由行政经理汇总后反馈)':
|
|
70
|
+
// doNotWrite,走下方挂载字段
|
|
71
|
+
return '';
|
|
72
|
+
default:
|
|
73
|
+
return '';
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const items = [];
|
|
77
|
+
for (const field of fields) {
|
|
78
|
+
if (field.doNotWrite)
|
|
79
|
+
continue;
|
|
80
|
+
const value = valueOf(field.name);
|
|
81
|
+
if (value === '' || value === null || value === undefined) {
|
|
82
|
+
if (field.required && ['客户性质', '项目金额(万元)', '客户带队人', '是否需要高层参与'].includes(field.name)) {
|
|
83
|
+
todos.push(`${field.name} 未填`);
|
|
84
|
+
}
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
items.push({ fieldId: field.id, value });
|
|
88
|
+
}
|
|
89
|
+
// 附件挂载字段(不在 formctx 的 10 个字段里,但页面认这个 id)
|
|
90
|
+
// 多附件(行程单 docx + 接待方案 md):同字段多值用 `,`,交给 buildCustomParams 拼
|
|
91
|
+
const mount = (snapshot && snapshot.attachmentMountField && snapshot.attachmentMountField.fieldId) || '';
|
|
92
|
+
const attachIds = normAttachmentIds(attachmentFileids, attachmentFileid);
|
|
93
|
+
const attachmentPending = attachIds.length === 0;
|
|
94
|
+
if (mount && attachIds.length)
|
|
95
|
+
items.push({ fieldId: mount, value: attachIds });
|
|
96
|
+
// 日程明细开关 + 7 列
|
|
97
|
+
const details = (snapshot && snapshot.details) || {};
|
|
98
|
+
const rows = normalizeScheduleRows(data);
|
|
99
|
+
const switchCode = (details.switch && details.switch.codes && details.switch.codes[details.switch.on]) || '1';
|
|
100
|
+
if (rows.length && details.switch)
|
|
101
|
+
items.push({ fieldId: details.switch.fieldId, value: switchCode });
|
|
102
|
+
for (const [semantic, fieldId] of Object.entries(details.columns || {})) {
|
|
103
|
+
rows.forEach((row, index) => items.push({
|
|
104
|
+
fieldId: String(fieldId),
|
|
105
|
+
value: row[semantic],
|
|
106
|
+
dataIndex: index,
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
if (!rows.length)
|
|
110
|
+
warnings.push('日程明细为 0 行:页面上明细会是空的');
|
|
111
|
+
const built = buildCustomParams(items);
|
|
112
|
+
params.values = built.values;
|
|
113
|
+
params.keys = built.keys;
|
|
114
|
+
if (attachmentPending)
|
|
115
|
+
todos.push('行程单附件未上传(可在页面手动添加)');
|
|
116
|
+
if (!data.companions || !data.companions.length)
|
|
117
|
+
todos.push('陪同人员未填');
|
|
118
|
+
if (!data.demand)
|
|
119
|
+
todos.push('客户需求未填');
|
|
120
|
+
return {
|
|
121
|
+
values: params.values,
|
|
122
|
+
keys: params.keys,
|
|
123
|
+
todos,
|
|
124
|
+
warnings,
|
|
125
|
+
attachmentPending,
|
|
126
|
+
detailRowCount: rows.length,
|
|
127
|
+
items,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* customParams 口径:逐行对齐 weaver-work-cli release 的 xiaoEUrlParamValue / buildXiaoECustomParams。
|
|
3
|
+
*
|
|
4
|
+
* 关键三条(与旧方案文档相反的地方已按源码纠正):
|
|
5
|
+
* 1) 同字段多值用 `,`,明细多行用 `;`;
|
|
6
|
+
* 2) 标量对象按 id > optionId > fileId > fileid > fid > value 取标识;
|
|
7
|
+
* 3) 空值字段整个省略,且不进入 fieldAssignKeys。
|
|
8
|
+
*/
|
|
9
|
+
export const MULTI_SEPARATOR = ',';
|
|
10
|
+
export const ROW_SEPARATOR = ';';
|
|
11
|
+
const SCALAR_KEYS = ['id', 'optionId', 'fileId', 'fileid', 'fid', 'value'];
|
|
12
|
+
export function urlParamScalar(value) {
|
|
13
|
+
if (value === null || value === undefined)
|
|
14
|
+
return '';
|
|
15
|
+
if (typeof value === 'object') {
|
|
16
|
+
const record = value;
|
|
17
|
+
for (const key of SCALAR_KEYS) {
|
|
18
|
+
const picked = record[key];
|
|
19
|
+
if (picked === null || picked === undefined)
|
|
20
|
+
continue;
|
|
21
|
+
const text = String(picked).trim();
|
|
22
|
+
if (text)
|
|
23
|
+
return text;
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
return String(value).trim();
|
|
28
|
+
}
|
|
29
|
+
export function urlParamValue(value) {
|
|
30
|
+
if (value === null || value === undefined)
|
|
31
|
+
return '';
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
return value.map((item) => urlParamScalar(item)).filter(Boolean).join(MULTI_SEPARATOR);
|
|
34
|
+
}
|
|
35
|
+
return urlParamScalar(value);
|
|
36
|
+
}
|
|
37
|
+
export function buildCustomParams(items = []) {
|
|
38
|
+
const ordered = [];
|
|
39
|
+
const main = new Map();
|
|
40
|
+
const detail = new Map();
|
|
41
|
+
for (const item of items) {
|
|
42
|
+
const fieldId = String((item && item.fieldId) || '').trim();
|
|
43
|
+
if (!fieldId)
|
|
44
|
+
continue;
|
|
45
|
+
const text = urlParamValue(item.value);
|
|
46
|
+
if (!text)
|
|
47
|
+
continue;
|
|
48
|
+
const isDetail = item.dataIndex !== undefined && item.dataIndex !== null;
|
|
49
|
+
if (!isDetail) {
|
|
50
|
+
if (!main.has(fieldId) && !detail.has(fieldId))
|
|
51
|
+
ordered.push(fieldId);
|
|
52
|
+
main.set(fieldId, text);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (!detail.has(fieldId)) {
|
|
56
|
+
if (!main.has(fieldId))
|
|
57
|
+
ordered.push(fieldId);
|
|
58
|
+
detail.set(fieldId, []);
|
|
59
|
+
}
|
|
60
|
+
const index = Number(item.dataIndex);
|
|
61
|
+
detail.get(fieldId).push({ index: Number.isFinite(index) ? index : 0, text });
|
|
62
|
+
}
|
|
63
|
+
const values = {};
|
|
64
|
+
for (const fieldId of ordered) {
|
|
65
|
+
const rows = detail.get(fieldId);
|
|
66
|
+
if (rows && rows.length) {
|
|
67
|
+
rows.sort((left, right) => left.index - right.index);
|
|
68
|
+
values[fieldId] = rows.map((row) => row.text).join(ROW_SEPARATOR);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
values[fieldId] = main.get(fieldId) ?? '';
|
|
72
|
+
}
|
|
73
|
+
return { values, keys: ordered };
|
|
74
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
4
|
+
import { receptionValidationError } from '../errors.js';
|
|
5
|
+
import { mergeAnswers } from './panels.js';
|
|
6
|
+
import { requirePython, renderBoth, resolveRenderPy } from './render-assets.js';
|
|
7
|
+
import { newRunId, saveRun, tryLoadRun } from './runs.js';
|
|
8
|
+
import { canonical, ensureDir, parseJsonText, sha256, writeJson } from './shared.js';
|
|
9
|
+
/** 案例 + 专家检索结果注入。软依赖:文件没给 / 给空就整段不出,不阻断出单。 */
|
|
10
|
+
function applyCases(data, casesFile) {
|
|
11
|
+
let raw;
|
|
12
|
+
try {
|
|
13
|
+
raw = readFileSync(casesFile, 'utf8');
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
throw receptionValidationError('CASES_FILE_UNREADABLE', `读不到 --cases-file:${casesFile}`, {
|
|
17
|
+
path: casesFile,
|
|
18
|
+
detail: error.message,
|
|
19
|
+
hint: '检查路径与读权限',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const parsed = parseJsonText(raw);
|
|
23
|
+
if (!parsed.ok) {
|
|
24
|
+
throw receptionValidationError('CASES_INVALID', `--cases-file 不是合法 JSON:${parsed.error}`, {
|
|
25
|
+
preview: parsed.preview,
|
|
26
|
+
hasBom: parsed.hasBom,
|
|
27
|
+
hint: '常见原因:UTF-8 BOM(hasBom:true)、中文引号、尾随逗号;修 JSON 本身,不要换传参方式',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const list = Array.isArray(payload) ? payload : (payload.cases || payload.items || []);
|
|
32
|
+
if (Array.isArray(list) && list.length)
|
|
33
|
+
data.cases = list;
|
|
34
|
+
if (payload && !Array.isArray(payload)) {
|
|
35
|
+
const note = payload.note || payload.casesNote || '';
|
|
36
|
+
if (note)
|
|
37
|
+
data.casesNote = String(note);
|
|
38
|
+
const query = payload.query || payload.casesQuery || '';
|
|
39
|
+
if (query)
|
|
40
|
+
data.casesQuery = String(query);
|
|
41
|
+
// 专家参考:与案例同文件,第二个检索结果
|
|
42
|
+
const experts = payload.experts || payload.expertItems || [];
|
|
43
|
+
if (Array.isArray(experts) && experts.length)
|
|
44
|
+
data.experts = experts;
|
|
45
|
+
const expertsNote = payload.expertsNote || payload.expertNote || '';
|
|
46
|
+
if (expertsNote)
|
|
47
|
+
data.expertsNote = String(expertsNote);
|
|
48
|
+
const expertsQuery = payload.expertsQuery || payload.expertQuery || '';
|
|
49
|
+
if (expertsQuery)
|
|
50
|
+
data.expertsQuery = String(expertsQuery);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export async function doc(input, ctx) {
|
|
54
|
+
const startedAt = Date.now();
|
|
55
|
+
const runIdArg = String(input.runId || '').trim();
|
|
56
|
+
const knownArg = input.known || null;
|
|
57
|
+
let run = runIdArg ? tryLoadRun(ctx.stateDir, runIdArg) : null;
|
|
58
|
+
let rebuilt = false;
|
|
59
|
+
if (!run) {
|
|
60
|
+
if (!knownArg) {
|
|
61
|
+
if (!runIdArg) {
|
|
62
|
+
throw receptionValidationError('RUN_ID_MISSING', '缺少 --run-id:正常流程先用 ask 取 runId;run 已失效时改用 --known 现场重建', { hint: 'reception doc --known \'{"customer":"…","visitDate":"…"}\' --answers \'{…}\'' });
|
|
63
|
+
}
|
|
64
|
+
// 有 runId 但文件没了,且没给 known:只能让调用方补齐
|
|
65
|
+
throw receptionValidationError('RUN_NOT_FOUND', `找不到 run:${runIdArg}(可能已过期或换了机器)`, { runId: runIdArg, stateDir: ctx.stateDir, hint: '把 ask 用过的 --known 一起带上重跑本条,CLI 会现场重建 run' });
|
|
66
|
+
}
|
|
67
|
+
rebuilt = Boolean(runIdArg);
|
|
68
|
+
const session = await ctx.host.getSession();
|
|
69
|
+
run = {
|
|
70
|
+
// 重建的 run 用新 id:传进来的那个已经不存在了,复用它会让人误以为原 run 还在
|
|
71
|
+
runId: newRunId(),
|
|
72
|
+
createdAt: new Date().toISOString(),
|
|
73
|
+
workflow: input.workflow || DEFAULT_WORKFLOW,
|
|
74
|
+
outDir: input.outDir || ctx.outDir,
|
|
75
|
+
base: session.baseUrl,
|
|
76
|
+
data: { ...knownArg },
|
|
77
|
+
customer: null,
|
|
78
|
+
user: null,
|
|
79
|
+
mode: 'browsertool',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const answers = input.answers ?? run.answers ?? {};
|
|
83
|
+
const data = mergeAnswers(run, answers);
|
|
84
|
+
if (input.casesFile)
|
|
85
|
+
applyCases(data, input.casesFile);
|
|
86
|
+
const outDir = input.outDir || run.outDir || ctx.outDir;
|
|
87
|
+
ensureDir(outDir);
|
|
88
|
+
const warnings = [];
|
|
89
|
+
const dataHash = sha256(canonical(data)).slice(0, 32);
|
|
90
|
+
const dataPath = join(ctx.stateDir, `doc-data-${dataHash.slice(0, 12)}.json`);
|
|
91
|
+
writeJson(dataPath, data);
|
|
92
|
+
const python = requirePython(ctx.stateDir);
|
|
93
|
+
const renderPy = resolveRenderPy(input.renderPy || '', input.snapshot || '');
|
|
94
|
+
const noUpload = input.noUpload === true;
|
|
95
|
+
// 会话与渲染并行:渲染约 7s,会话读取基本瞬时,没必要串行等
|
|
96
|
+
const sessionPromise = noUpload
|
|
97
|
+
? Promise.resolve(null)
|
|
98
|
+
: ctx.host.getSession();
|
|
99
|
+
const renderPromise = renderBoth({ python, renderPy, dataPath, outDir });
|
|
100
|
+
const uploadPromise = renderPromise.then(async (rendered) => {
|
|
101
|
+
if (noUpload)
|
|
102
|
+
return null;
|
|
103
|
+
const session = await sessionPromise;
|
|
104
|
+
if (!session || !session.available) {
|
|
105
|
+
return { ups: [], uploadMs: 0, base: '', skipped: 'NO_SESSION' };
|
|
106
|
+
}
|
|
107
|
+
const uploadStartedAt = Date.now();
|
|
108
|
+
// 两附件都挂同一个字段:docx(对外行程单)+ md(内部接待方案),按此顺序上传
|
|
109
|
+
const picks = ['docx', 'md']
|
|
110
|
+
.map((kind) => ({
|
|
111
|
+
kind,
|
|
112
|
+
file: (rendered.result.files || []).find((file) => file.kind === kind),
|
|
113
|
+
}))
|
|
114
|
+
.filter((item) => item.file);
|
|
115
|
+
const ups = [];
|
|
116
|
+
for (const item of picks) {
|
|
117
|
+
const result = await ctx.host.uploadFile(item.file.path);
|
|
118
|
+
ups.push({ kind: item.kind, ...result });
|
|
119
|
+
}
|
|
120
|
+
return { ups, uploadMs: Date.now() - uploadStartedAt, base: session.baseUrl };
|
|
121
|
+
});
|
|
122
|
+
const [rendered, uploadResult] = await Promise.all([renderPromise, uploadPromise]);
|
|
123
|
+
const docxMs = rendered.docxMs;
|
|
124
|
+
const mdMs = rendered.mdMs;
|
|
125
|
+
let attachment = null;
|
|
126
|
+
let attachments = [];
|
|
127
|
+
let uploadMs = null;
|
|
128
|
+
/** 上传失败时的结构化诊断,直接进返回体:下次失败不用再靠猜。 */
|
|
129
|
+
let uploadDiagnostics = [];
|
|
130
|
+
if (uploadResult) {
|
|
131
|
+
uploadMs = uploadResult.uploadMs;
|
|
132
|
+
const succeeded = uploadResult.ups.filter((item) => item.ok && item.fileid);
|
|
133
|
+
const failed = uploadResult.ups.filter((item) => !item.ok);
|
|
134
|
+
if (succeeded.length) {
|
|
135
|
+
attachments = succeeded.map((item) => ({
|
|
136
|
+
fileid: String(item.fileid),
|
|
137
|
+
name: item.name || '',
|
|
138
|
+
kind: item.kind,
|
|
139
|
+
}));
|
|
140
|
+
attachment = attachments.find((item) => item.kind === 'docx') || attachments[0];
|
|
141
|
+
}
|
|
142
|
+
if (failed.length) {
|
|
143
|
+
// 失败原因必须带够线索:HTTP 状态、content-type、响应片段、下一步提示。
|
|
144
|
+
// 只写"no fileid in response"等于让人猜,实测排查成本极高。
|
|
145
|
+
uploadDiagnostics = failed.map((item) => ({
|
|
146
|
+
kind: item.kind,
|
|
147
|
+
error: item.reason || item.error || '未知',
|
|
148
|
+
httpStatus: item.httpStatus ?? null,
|
|
149
|
+
contentType: item.contentType || null,
|
|
150
|
+
hint: item.hint || null,
|
|
151
|
+
responsePreview: item.detail ? String(item.detail).slice(0, 300) : null,
|
|
152
|
+
}));
|
|
153
|
+
const reason = uploadDiagnostics
|
|
154
|
+
.map((item) => {
|
|
155
|
+
const bits = [`${item.kind}:${item.error}`];
|
|
156
|
+
if (item.httpStatus)
|
|
157
|
+
bits.push(`HTTP ${item.httpStatus}`);
|
|
158
|
+
if (item.contentType && !/json/i.test(String(item.contentType))) {
|
|
159
|
+
bits.push(`content-type=${item.contentType}`);
|
|
160
|
+
}
|
|
161
|
+
if (item.responsePreview)
|
|
162
|
+
bits.push(`响应片段=${String(item.responsePreview).slice(0, 160)}`);
|
|
163
|
+
if (item.hint)
|
|
164
|
+
bits.push(`提示=${item.hint}`);
|
|
165
|
+
return bits.join(' | ');
|
|
166
|
+
})
|
|
167
|
+
.join(';');
|
|
168
|
+
warnings.push(`附件上传失败(${reason}):本地文件已生成(见 data.files),可在页面手动添加`);
|
|
169
|
+
}
|
|
170
|
+
if (uploadResult.skipped === 'NO_SESSION') {
|
|
171
|
+
warnings.push('未取得 E10 会话:附件未上传,产物按本地文件交付');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (noUpload) {
|
|
175
|
+
warnings.push('已按 --no-upload 跳过上传:页面上需要手动添加附件');
|
|
176
|
+
}
|
|
177
|
+
run.answers = answers;
|
|
178
|
+
run.data = data;
|
|
179
|
+
run.files = rendered.result.files || [];
|
|
180
|
+
// 记住快照路径,render 就不必再传一次
|
|
181
|
+
if (input.snapshot)
|
|
182
|
+
run.snapshotPath = input.snapshot;
|
|
183
|
+
if (uploadResult && uploadResult.base)
|
|
184
|
+
run.base = uploadResult.base;
|
|
185
|
+
if (attachment)
|
|
186
|
+
run.attachmentFileid = String(attachment.fileid);
|
|
187
|
+
if (attachments.length)
|
|
188
|
+
run.attachmentFileids = attachments;
|
|
189
|
+
saveRun(ctx.stateDir, run);
|
|
190
|
+
// 内部参考文档正文:直接带在回包里,让模型在对话中原样贴出。
|
|
191
|
+
// 否则模型会为了贴全文再单独读一次产物文件,白多一次工具往返;docx 是二进制,永远不要回读。
|
|
192
|
+
let internalDoc = null;
|
|
193
|
+
const mdFile = (rendered.result.files || []).find((file) => file.kind === 'md');
|
|
194
|
+
if (mdFile?.path) {
|
|
195
|
+
try {
|
|
196
|
+
internalDoc = {
|
|
197
|
+
name: basename(mdFile.path),
|
|
198
|
+
path: mdFile.path,
|
|
199
|
+
content: readFileSync(mdFile.path, 'utf8'),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// 读不到就当没生成,技能侧跳过这一段,不影响出件与填单
|
|
204
|
+
internalDoc = null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
state: 'doc-ready',
|
|
209
|
+
ok: true,
|
|
210
|
+
data: {
|
|
211
|
+
runId: run.runId,
|
|
212
|
+
rebuilt,
|
|
213
|
+
files: (rendered.result.files || []).map((file) => ({ kind: file.kind, path: file.path, size: file.size })),
|
|
214
|
+
internalDoc,
|
|
215
|
+
attachment,
|
|
216
|
+
attachments,
|
|
217
|
+
attachmentPending: attachments.length === 0,
|
|
218
|
+
uploadDiagnostics,
|
|
219
|
+
qa: rendered.result.qa || {},
|
|
220
|
+
verify: rendered.result.verify || {},
|
|
221
|
+
timings: {
|
|
222
|
+
docxMs,
|
|
223
|
+
mdMs,
|
|
224
|
+
uploadMs,
|
|
225
|
+
parallelMs: rendered.parallelMs,
|
|
226
|
+
totalMs: Date.now() - startedAt,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
warnings,
|
|
230
|
+
next: {
|
|
231
|
+
command: `weaver-work-cli reception render --run-id ${run.runId}`,
|
|
232
|
+
reason: '附件 fileid 已写入 run,render 会自动带上',
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
export const docOperation = {
|
|
237
|
+
execute: (input, ctx) => doc(input, ctx),
|
|
238
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { doc } from './doc.js';
|
|
2
|
+
import { render } from './render.js';
|
|
3
|
+
/**
|
|
4
|
+
* reception.docRender —— 一次调用完成「出文件 + 传附件 + 拼填单参数 + 落 browsertool」。
|
|
5
|
+
*
|
|
6
|
+
* 为什么合并:`doc` 与 `render` 之间没有人工确认点,拆两次只会多付一次工具往返
|
|
7
|
+
* (宿主侧单次 3~5 秒),而 CLI 内部这两步加起来只有几百毫秒。
|
|
8
|
+
*
|
|
9
|
+
* 失败语义与分开调用**完全一致**,不因为合并而改变:
|
|
10
|
+
* - `doc` 失败(快照缺失 / render.py 缺失 / python-docx 缺失)→ 直接返回 doc 的错误,不继续 render;
|
|
11
|
+
* - 附件上传失败**不算** doc 失败(只进 `warnings` + `uploadDiagnostics`),`customParams` 照常产出;
|
|
12
|
+
* - `render` 失败 → 返回 render 的错误,此时文件已生成,回包里仍带 `files`。
|
|
13
|
+
*/
|
|
14
|
+
export async function docRender(input, ctx) {
|
|
15
|
+
const docResult = await doc(input, ctx);
|
|
16
|
+
if (!docResult.ok)
|
|
17
|
+
return docResult;
|
|
18
|
+
const runId = String((docResult.data || {}).runId || input.runId || '');
|
|
19
|
+
// answers / snapshotPath 已经由 doc 写进 run,这里只传 runId;
|
|
20
|
+
// sdkRender 属于 render 自己的入参,透传即可。
|
|
21
|
+
const renderResult = await render({ runId, sdkRender: input.sdkRender }, ctx);
|
|
22
|
+
return {
|
|
23
|
+
state: renderResult.state,
|
|
24
|
+
ok: renderResult.ok,
|
|
25
|
+
data: {
|
|
26
|
+
...docResult.data,
|
|
27
|
+
...renderResult.data,
|
|
28
|
+
runId,
|
|
29
|
+
},
|
|
30
|
+
warnings: [...(docResult.warnings || []), ...(renderResult.warnings || [])],
|
|
31
|
+
next: renderResult.next,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const docRenderOperation = {
|
|
35
|
+
execute: (input, ctx) => docRender(input, ctx),
|
|
36
|
+
};
|