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,179 @@
|
|
|
1
|
+
import { CUSTOMER_NEED_OPTIONS, LOGISTICS_FIELDS, LOGISTICS_HINT, LOGISTICS_LABEL, LOGISTICS_PLACEHOLDER, LOGISTICS_TITLE, } from '../constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* 后勤与人数自由文本 → 6 个子项。
|
|
4
|
+
*
|
|
5
|
+
* 用户手写格式不可控,这里只做"能认就认",认不出的子项由调用方按原文进待办,
|
|
6
|
+
* 绝不追问第二轮。
|
|
7
|
+
*/
|
|
8
|
+
export function parseLogistics(text) {
|
|
9
|
+
const raw = String(text || '').trim();
|
|
10
|
+
if (!raw)
|
|
11
|
+
return {};
|
|
12
|
+
const out = {};
|
|
13
|
+
if (/^(暂未确定|待定|都不确定|还没定|都没定)/.test(raw))
|
|
14
|
+
return out;
|
|
15
|
+
// 用户没改灰字直接提交:整串都是字段名、且一个数字都没有 → 视为未填,不产脏数据
|
|
16
|
+
const FIELD_HINTS = ['客户人数', '是否会议', '是否接送', '是否用餐', '是否代订住宿', '是否伴手礼', '陪同人员手机号'];
|
|
17
|
+
if (!/\d/.test(raw) && FIELD_HINTS.filter((word) => raw.includes(word)).length >= 2)
|
|
18
|
+
return out;
|
|
19
|
+
// 手机号:11 位,可能写在这段话的任意位置;单独取出,由 mergeAnswers 挂到接待人身上
|
|
20
|
+
const mobile = raw.match(/(?<!\d)1[3-9]\d{9}(?!\d)/);
|
|
21
|
+
if (mobile)
|
|
22
|
+
out.mobile = mobile[0];
|
|
23
|
+
// 编号(①②③ / 1) / (1) / 1. / 1、)一律当分隔;换行、句号、顿号也算
|
|
24
|
+
const segs = raw
|
|
25
|
+
.replace(/[①②③④⑤⑥⑦⑧⑨]/g, '\n')
|
|
26
|
+
.replace(/[((]\s*\d\s*[))]/g, '\n')
|
|
27
|
+
.replace(/(^|[\s||;;,,。])\d\s*[.))、]/g, '\n')
|
|
28
|
+
.replace(/总部\s*(\d{3})/g, '总部$1')
|
|
29
|
+
.replace(/(\d)\s*[人名位]/g, '$1人')
|
|
30
|
+
.replace(/(\d)\s*间/g, '$1间')
|
|
31
|
+
.split(/[\n||;;,,。、]+/)
|
|
32
|
+
.map((item) => item.trim())
|
|
33
|
+
.filter(Boolean);
|
|
34
|
+
for (const part of segs) {
|
|
35
|
+
// 一个片段可能同时含多个子项(如「10人 总部130会议室」),因此逐项独立判断,不 continue
|
|
36
|
+
if (!out.meetingRoom) {
|
|
37
|
+
// 兼容「总部131」「131会议室」「总部131会议室」三种写法;
|
|
38
|
+
// 数字前后不能紧邻数字,否则会从手机号里捞出 131。
|
|
39
|
+
const room = part.match(/(?:总部\s*)?(?<!\d)(129|130|131)(?!\d)\s*会议室/)
|
|
40
|
+
|| part.match(/总部\s*(?<!\d)(129|130|131)(?!\d)/);
|
|
41
|
+
if (room)
|
|
42
|
+
out.meetingRoom = `总部${room[1]}会议室`;
|
|
43
|
+
else if (/(不需要|不用|无需|没有)会议室/.test(part))
|
|
44
|
+
out.meetingRoom = '不需会议室';
|
|
45
|
+
else {
|
|
46
|
+
const named = part.match(/([\u4e00-\u9fa5]{2,8}会议室)/);
|
|
47
|
+
if (named)
|
|
48
|
+
out.meetingRoom = named[1];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!out.headcount) {
|
|
52
|
+
const band = part.match(/(5人以内|6-10人|11-20人|20人以上)/);
|
|
53
|
+
if (band) {
|
|
54
|
+
out.headcount = band[1] === '5人以内' ? 5 : band[1] === '6-10人' ? 6 : band[1] === '11-20人' ? 11 : 20;
|
|
55
|
+
out.headcountBand = band[1];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const exact = part.match(/(\d{1,3})\s*人/);
|
|
59
|
+
if (exact)
|
|
60
|
+
out.headcount = Number(exact[1]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!out.meal) {
|
|
64
|
+
if (/(不用餐|不需要用餐|不吃饭|吃过再来)/.test(part))
|
|
65
|
+
out.meal = '不用餐';
|
|
66
|
+
else if (/(午餐|晚餐|中饭|午饭|晚饭|食堂|小餐厅|外部餐厅|餐厅)/.test(part))
|
|
67
|
+
out.meal = part;
|
|
68
|
+
}
|
|
69
|
+
if (!out.hotel) {
|
|
70
|
+
if (/(无需住宿|不需要住宿|不用住宿|不住|不用订房|当天往返|不需住宿)/.test(part))
|
|
71
|
+
out.hotel = '无需住宿';
|
|
72
|
+
else if (/(住宿|订房|间房|住\s*\d*\s*晚|\d+\s*晚)/.test(part))
|
|
73
|
+
out.hotel = part;
|
|
74
|
+
}
|
|
75
|
+
if (!out.pickup) {
|
|
76
|
+
// 「不用车」「不用接」= 不需要安排车,归一到「客户自行前往」
|
|
77
|
+
if (/(自行前往|自驾|自己过去|不用接|不需要接|不用车|不需要用车|无需用车|不用派车)/.test(part)) {
|
|
78
|
+
out.pickup = '客户自行前往';
|
|
79
|
+
}
|
|
80
|
+
else if (/(接站|接机|用车|派车|商务车|大巴|司机|接送|高铁)/.test(part)) {
|
|
81
|
+
out.pickup = part;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!out.gift) {
|
|
85
|
+
// 兼顾客语序:「不用伴手礼」与「伴手礼不用」都要认
|
|
86
|
+
if (/(不需要伴手礼|无需伴手礼|不用伴手礼|不送|不用礼品|伴手礼(不用|不需要|免)|礼品(不用|不需要))/.test(part)) {
|
|
87
|
+
out.gift = '不需要伴手礼';
|
|
88
|
+
}
|
|
89
|
+
else if (/(伴手礼|纪念品|礼品|礼盒)/.test(part)) {
|
|
90
|
+
out.gift = part;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** 手机号只挂到第一个陪同(接待人)身上;没有陪同就只存 data.mobile,不编造人员。 */
|
|
97
|
+
export function setCompanionMobile(data, mobile) {
|
|
98
|
+
const value = String(mobile || '').trim();
|
|
99
|
+
if (!value)
|
|
100
|
+
return;
|
|
101
|
+
const list = Array.isArray(data.companions) ? data.companions.slice() : [];
|
|
102
|
+
if (list.length) {
|
|
103
|
+
const first = typeof list[0] === 'string' ? { name: list[0] } : { ...list[0] };
|
|
104
|
+
first.mobile = value;
|
|
105
|
+
list[0] = first;
|
|
106
|
+
data.companions = list;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
data.mobile = value;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** 合并 run 上下文与 ask_user 的 answers。 */
|
|
113
|
+
export function mergeAnswers(run, answers = {}) {
|
|
114
|
+
const data = { ...(run.data || {}) };
|
|
115
|
+
if (answers && typeof answers === 'object') {
|
|
116
|
+
if (answers.fields && typeof answers.fields === 'object')
|
|
117
|
+
Object.assign(data, answers.fields);
|
|
118
|
+
if (answers.customer_need)
|
|
119
|
+
data.demand = String(answers.customer_need);
|
|
120
|
+
if (answers.logistics) {
|
|
121
|
+
const raw = String(answers.logistics).trim();
|
|
122
|
+
if (raw) {
|
|
123
|
+
// 原文留存:手动输入格式不可控,解析不到的子项靠它兜底(交付时原样透出,不丢信息)
|
|
124
|
+
data.logisticsRaw = raw;
|
|
125
|
+
const parsed = parseLogistics(raw);
|
|
126
|
+
const mobile = parsed.mobile;
|
|
127
|
+
delete parsed.mobile;
|
|
128
|
+
Object.assign(data, parsed);
|
|
129
|
+
if (mobile)
|
|
130
|
+
setCompanionMobile(data, mobile);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// 兼容旧口径:独立手机号面板传进来的值(新流程已并进 logistics)
|
|
134
|
+
if (answers.companion_mobile)
|
|
135
|
+
setCompanionMobile(data, answers.companion_mobile);
|
|
136
|
+
}
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 面板由 CLI 生成,模型原样传给 ask_user。
|
|
141
|
+
*
|
|
142
|
+
* 硬约束(宿主实测):title 严格单行、超长截断成「…」;placeholder 正常渲染;hint 不渲染。
|
|
143
|
+
* 因此标题只留一句短话,完整清单放 placeholder,口径放 hint。
|
|
144
|
+
* 总屏数 ≤ 2(客户需求 1 + 接待细节 1),手机号并入接待细节,不单独出屏。
|
|
145
|
+
*/
|
|
146
|
+
export function buildPanels(data) {
|
|
147
|
+
const panels = [];
|
|
148
|
+
if (!data.demand) {
|
|
149
|
+
panels.push({
|
|
150
|
+
id: 'customer_need',
|
|
151
|
+
// 同样受「标题单行」约束:不写 ①②③ 追问清单,只留一句
|
|
152
|
+
title: '客户需求(选一个,也可自己写)',
|
|
153
|
+
inputType: 'single',
|
|
154
|
+
required: false,
|
|
155
|
+
allowCustomInput: true,
|
|
156
|
+
options: CUSTOMER_NEED_OPTIONS.map((item) => ({ label: item, value: item })),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const missing = LOGISTICS_FIELDS.filter((key) => !data[key]);
|
|
160
|
+
const mobile = ((data.companions || []).find((item) => item && item.mobile) || {}).mobile || '';
|
|
161
|
+
if (missing.length || !mobile) {
|
|
162
|
+
const known = LOGISTICS_FIELDS
|
|
163
|
+
.filter((key) => data[key])
|
|
164
|
+
.map((key) => `${LOGISTICS_LABEL[key]}:${data[key]}`);
|
|
165
|
+
if (mobile)
|
|
166
|
+
known.push(`${LOGISTICS_LABEL.mobile}:${mobile}`);
|
|
167
|
+
panels.push({
|
|
168
|
+
id: 'logistics',
|
|
169
|
+
// 标题严格单行:不拼字段清单、不拼已识别项、不讲规则——拼了必被截断成「…」
|
|
170
|
+
title: LOGISTICS_TITLE,
|
|
171
|
+
inputType: 'text',
|
|
172
|
+
required: false,
|
|
173
|
+
allowCustomInput: true,
|
|
174
|
+
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
175
|
+
placeholder: LOGISTICS_PLACEHOLDER,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return panels;
|
|
179
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { askOperation } from './ask.js';
|
|
2
|
+
import { docOperation } from './doc.js';
|
|
3
|
+
import { docRenderOperation } from './docrender.js';
|
|
4
|
+
import { renderOperation } from './render.js';
|
|
5
|
+
/**
|
|
6
|
+
* operation 名 → handler。
|
|
7
|
+
*
|
|
8
|
+
* 四个:ask / doc / render 是既有链路,docRender 是「doc + render 一次跑完」的合并入口
|
|
9
|
+
* (两者之间没有人工确认点,拆两次纯属白付一次工具往返)。
|
|
10
|
+
* 兜底链路(prepare/build/submit)已随独立 reception CLI 退役:
|
|
11
|
+
* 真需要写流程时直接调 `weaver-work-cli workflow`,不必在这里再包一层。
|
|
12
|
+
*/
|
|
13
|
+
const REGISTRY = new Map([
|
|
14
|
+
['reception.ask', askOperation],
|
|
15
|
+
['reception.doc', docOperation],
|
|
16
|
+
['reception.docRender', docRenderOperation],
|
|
17
|
+
['reception.render', renderOperation],
|
|
18
|
+
]);
|
|
19
|
+
export function getReceptionOperation(name) {
|
|
20
|
+
const hit = REGISTRY.get(name);
|
|
21
|
+
if (!hit) {
|
|
22
|
+
throw new Error(`未知 operation: ${name}(可用:${[...REGISTRY.keys()].join(' / ')})`);
|
|
23
|
+
}
|
|
24
|
+
return hit;
|
|
25
|
+
}
|
|
26
|
+
export const receptionOperationNames = [...REGISTRY.keys()];
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { spawnSync, execFile } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { PYTHON_CACHE_TTL_MS } from '../constants.js';
|
|
5
|
+
import { receptionBusinessError, receptionEnvironmentError } from '../errors.js';
|
|
6
|
+
import { ensureDir, mtimeMs, readJson, writeJson } from './shared.js';
|
|
7
|
+
import { skillRootFromSnapshot } from './snapshot.js';
|
|
8
|
+
/**
|
|
9
|
+
* docx / md 渲染外壳。
|
|
10
|
+
*
|
|
11
|
+
* 边界:这里只负责「找到 python、找到 render.py、解析它吐的 JSON」,
|
|
12
|
+
* 产物口径全在技能包的 `scripts/render.py` 里(模板也在技能包 `assets/` 下,由 py 自己定位)。
|
|
13
|
+
* CLI 不打包 render.py,也不打包模板——字段与版式调整不该触发 CLI 发版。
|
|
14
|
+
*/
|
|
15
|
+
const PYTHON_CACHE_FILE = 'python.json';
|
|
16
|
+
let pythonCache;
|
|
17
|
+
function runSync(file, args, options = {}) {
|
|
18
|
+
const result = spawnSync(file, args, { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, ...options });
|
|
19
|
+
return {
|
|
20
|
+
stdout: String(result.stdout || ''),
|
|
21
|
+
stderr: String(result.stderr || ''),
|
|
22
|
+
status: result.status,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function runAsync(file, args) {
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
execFile(file, args, { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
28
|
+
resolve({
|
|
29
|
+
stdout: String(stdout || ''),
|
|
30
|
+
stderr: String(stderr || ''),
|
|
31
|
+
status: error ? (typeof error.code === 'number' ? error.code : 1) : 0,
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** 从混杂输出里取最后一个合法 JSON(render.py 可能先打印日志)。 */
|
|
37
|
+
function lastJsonLine(text) {
|
|
38
|
+
const lines = String(text || '').split(/\r?\n/).filter((line) => line.trim().startsWith('{'));
|
|
39
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(lines[index]);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// 继续往上找
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 依次探测 RECEPTION_PY / python3 / python,要求能 `import docx`。
|
|
51
|
+
* 探测结果落盘 7 天省掉每次 0.3~1s;磁盘缓存也要能真跑起来才认(避免升级后命中死路径)。
|
|
52
|
+
*/
|
|
53
|
+
export function pickPython(stateDir) {
|
|
54
|
+
if (pythonCache !== undefined)
|
|
55
|
+
return pythonCache;
|
|
56
|
+
if (process.env.RECEPTION_PY) {
|
|
57
|
+
pythonCache = process.env.RECEPTION_PY;
|
|
58
|
+
return pythonCache;
|
|
59
|
+
}
|
|
60
|
+
const cachePath = join(stateDir, PYTHON_CACHE_FILE);
|
|
61
|
+
const disk = readJson(cachePath);
|
|
62
|
+
if (disk?.py && Date.now() - Number(disk.at || 0) < PYTHON_CACHE_TTL_MS) {
|
|
63
|
+
if (runSync(disk.py, ['-c', 'import docx'], { stdio: 'ignore' }).status === 0) {
|
|
64
|
+
pythonCache = disk.py;
|
|
65
|
+
return pythonCache;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const candidate of ['python3', 'python', 'py']) {
|
|
69
|
+
const args = candidate === 'py' ? ['-3', '-c', 'import docx'] : ['-c', 'import docx'];
|
|
70
|
+
if (runSync(candidate, args, { stdio: 'ignore' }).status === 0) {
|
|
71
|
+
pythonCache = candidate;
|
|
72
|
+
try {
|
|
73
|
+
writeJson(cachePath, { py: candidate, at: Date.now() });
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// 缓存写不进不阻断
|
|
77
|
+
}
|
|
78
|
+
return candidate;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
pythonCache = null;
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
/** 测试用:清掉进程内缓存。 */
|
|
85
|
+
export function resetPythonCache() {
|
|
86
|
+
pythonCache = undefined;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 定位 render.py。优先级:显式参数 → 环境变量 → 技能包内固定相对位置。
|
|
90
|
+
*
|
|
91
|
+
* 技能包布局固定为 `<skill>/scripts/render.py` + `<skill>/data/fields-snapshot.json`,
|
|
92
|
+
* 因此拿到快照路径就能反推脚本位置,调用方不必传两个参数。
|
|
93
|
+
*/
|
|
94
|
+
export function resolveRenderPy(explicitPath = '', snapshotPath = '') {
|
|
95
|
+
const candidates = [
|
|
96
|
+
explicitPath,
|
|
97
|
+
process.env.RECEPTION_RENDER_PY || '',
|
|
98
|
+
snapshotPath ? join(skillRootFromSnapshot(snapshotPath), 'scripts', 'render.py') : '',
|
|
99
|
+
join(process.cwd(), 'scripts', 'render.py'),
|
|
100
|
+
].filter(Boolean);
|
|
101
|
+
for (const path of candidates) {
|
|
102
|
+
if (existsSync(path))
|
|
103
|
+
return path;
|
|
104
|
+
}
|
|
105
|
+
throw receptionEnvironmentError('RENDER_PY_MISSING', '找不到 render.py:请传 --render-py,或确保技能包 scripts/render.py 存在', { candidates });
|
|
106
|
+
}
|
|
107
|
+
function parseRenderOutput(result, outDir) {
|
|
108
|
+
const parsed = lastJsonLine(result.stdout);
|
|
109
|
+
if (!parsed) {
|
|
110
|
+
throw receptionBusinessError('RENDER_NO_JSON', '渲染失败:render.py 未返回 JSON', {
|
|
111
|
+
hint: `检查 ${outDir} 是否可写、render.py 是否完整`,
|
|
112
|
+
detail: String(result.stderr || '').split(/\r?\n/).filter(Boolean).slice(-12).join('\n').slice(-1200),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (!parsed.ok) {
|
|
116
|
+
throw receptionBusinessError('RENDER_FAILED', `渲染失败: ${parsed.error || '未知错误'}`, {
|
|
117
|
+
hint: '多为字段类型不匹配(日期需 yyyy-MM-dd、金额为数字);按 detail 修数据后重跑',
|
|
118
|
+
detail: String(result.stderr || '').split(/\r?\n/).filter(Boolean).slice(-12).join('\n').slice(-1200),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return parsed;
|
|
122
|
+
}
|
|
123
|
+
/** 单份渲染(异步):供 docx 与 md 并行调用。 */
|
|
124
|
+
export async function renderOnly(options) {
|
|
125
|
+
ensureDir(options.outDir);
|
|
126
|
+
const args = [options.renderPy, '--data', options.dataPath, '--out-dir', options.outDir, '--only', options.only];
|
|
127
|
+
const raw = await runAsync(options.python, args);
|
|
128
|
+
return parseRenderOutput(raw, options.outDir);
|
|
129
|
+
}
|
|
130
|
+
function mergeTwo(docx, md) {
|
|
131
|
+
const files = [...(docx.files || []), ...(md.files || [])];
|
|
132
|
+
const qa = { ...(docx.qa || {}), ...(md.qa || {}) };
|
|
133
|
+
if (docx.qa && docx.qa.external)
|
|
134
|
+
qa.external = docx.qa.external;
|
|
135
|
+
const warnings = [
|
|
136
|
+
...((docx.qa && docx.qa.warnings) || []),
|
|
137
|
+
...((md.qa && md.qa.warnings) || []),
|
|
138
|
+
];
|
|
139
|
+
if (warnings.length)
|
|
140
|
+
qa.warnings = warnings;
|
|
141
|
+
const verify = { ...(docx.verify || {}), ...(md.verify || {}) };
|
|
142
|
+
verify.fileCount = files.length;
|
|
143
|
+
return {
|
|
144
|
+
ok: true,
|
|
145
|
+
files,
|
|
146
|
+
qa,
|
|
147
|
+
verify,
|
|
148
|
+
agendaRows: docx.agendaRows || md.agendaRows || [],
|
|
149
|
+
scheduleRows: docx.scheduleRows || md.scheduleRows || [],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** 并行渲染两份并合并。两份都落盘后再上传,因为要挂到同一个附件字段。 */
|
|
153
|
+
export async function renderBoth(options) {
|
|
154
|
+
ensureDir(options.outDir);
|
|
155
|
+
const startedAt = Date.now();
|
|
156
|
+
let docxMs = 0;
|
|
157
|
+
let mdMs = 0;
|
|
158
|
+
const docxPromise = renderOnly({ ...options, only: 'docx' }).then((result) => {
|
|
159
|
+
docxMs = Date.now() - startedAt;
|
|
160
|
+
return result;
|
|
161
|
+
});
|
|
162
|
+
const mdPromise = renderOnly({ ...options, only: 'md' }).then((result) => {
|
|
163
|
+
mdMs = Date.now() - startedAt;
|
|
164
|
+
return result;
|
|
165
|
+
});
|
|
166
|
+
const [docxResult, mdResult] = await Promise.all([docxPromise, mdPromise]);
|
|
167
|
+
return {
|
|
168
|
+
result: mergeTwo(docxResult, mdResult),
|
|
169
|
+
docxResult,
|
|
170
|
+
mdResult,
|
|
171
|
+
docxMs,
|
|
172
|
+
mdMs,
|
|
173
|
+
parallelMs: Date.now() - startedAt,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/** 供 doc 用:缺 python 时给出可执行的提示而不是堆栈。 */
|
|
177
|
+
export function requirePython(stateDir) {
|
|
178
|
+
const python = pickPython(stateDir);
|
|
179
|
+
if (!python) {
|
|
180
|
+
throw receptionEnvironmentError('NO_PYTHON_DOCX', '缺 python3 + python-docx,无法渲染 docx', { hint: 'pip install python-docx;离线环境只能交付 md' });
|
|
181
|
+
}
|
|
182
|
+
return python;
|
|
183
|
+
}
|
|
184
|
+
export { mtimeMs };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { receptionEnvironmentError } from '../errors.js';
|
|
4
|
+
import { renderBrowsertool, resolveRenderType } from './browsertool.js';
|
|
5
|
+
import { composeInitialValues } from './compose.js';
|
|
6
|
+
import { mergeAnswers } from './panels.js';
|
|
7
|
+
import { loadRun, runsDir } from './runs.js';
|
|
8
|
+
import { nameList } from './shared.js';
|
|
9
|
+
import { resolveSnapshot } from './snapshot.js';
|
|
10
|
+
export async function render(input, ctx) {
|
|
11
|
+
const startedAt = Date.now();
|
|
12
|
+
const run = loadRun(ctx.stateDir, String(input.runId || '').trim());
|
|
13
|
+
// 快照优先级:显式参数 → doc 记在 run 里的路径。重建的 run 没有记录,仍需显式传。
|
|
14
|
+
const snapshotPath = String(input.snapshot || '').trim() || run.snapshotPath || '';
|
|
15
|
+
const resolved = resolveSnapshot(snapshotPath);
|
|
16
|
+
if (!resolved.snapshot) {
|
|
17
|
+
throw receptionEnvironmentError('SNAPSHOT_MISSING', '未找到字段快照 data/fields-snapshot.json', {
|
|
18
|
+
hint: '传 --snapshot "<技能目录>/data/fields-snapshot.json";doc 传过的话通常已记在 run 里,不必重复传',
|
|
19
|
+
snapshotPath,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const answers = input.answers ?? run.answers ?? {};
|
|
23
|
+
const data = mergeAnswers(run, answers);
|
|
24
|
+
// 附件:显式 --attachment-fileid(可逗号分隔多个)优先,否则用 doc 落盘的附件数组
|
|
25
|
+
const argAttachment = String(input.attachmentFileid || '').trim();
|
|
26
|
+
const runAttachments = Array.isArray(run.attachmentFileids) ? run.attachmentFileids : [];
|
|
27
|
+
// 「参与人员」兜底:一个人名都没有时,才用当前登录人填。
|
|
28
|
+
// 读会话要解 keyring(~300ms),有人名的正常流程不该为它付代价。
|
|
29
|
+
const hasCompanions = Array.isArray(data.companions) && data.companions.length > 0;
|
|
30
|
+
const hasEscorts = nameList(data.escorts).length > 0;
|
|
31
|
+
if (!data.empId && !hasCompanions && !hasEscorts) {
|
|
32
|
+
const session = await ctx.host.getSession();
|
|
33
|
+
data.empId = session.userId || '';
|
|
34
|
+
}
|
|
35
|
+
const composed = composeInitialValues({
|
|
36
|
+
snapshot: resolved.snapshot,
|
|
37
|
+
data,
|
|
38
|
+
attachmentFileid: argAttachment || run.attachmentFileid || '',
|
|
39
|
+
attachmentFileids: argAttachment ? null : runAttachments,
|
|
40
|
+
});
|
|
41
|
+
// 主联络人一致性:用户明确指定了对接人(escorts),但实际填入的是别人时提前报警。
|
|
42
|
+
// 修复不彻底或调用方传参有误时,这是最后一道防线。
|
|
43
|
+
const escortNames = nameList(data.escorts);
|
|
44
|
+
const filledNames = (Array.isArray(data.companions) ? data.companions : [])
|
|
45
|
+
.map((item) => (typeof item === 'string' ? item : (item && (item.name || item.id)) || ''))
|
|
46
|
+
.map((item) => String(item || '').trim())
|
|
47
|
+
.filter(Boolean);
|
|
48
|
+
if (escortNames.length && filledNames.length && !escortNames.some((name) => filledNames.includes(name))) {
|
|
49
|
+
composed.warnings.push([
|
|
50
|
+
'主联络人可能填错:',
|
|
51
|
+
`指定对接人为 ${escortNames.join(',')},实际填入 ${filledNames.join(',')}。`,
|
|
52
|
+
'请在页面上核对「泛微分支机构参与人员(主联络人)」字段。',
|
|
53
|
+
].join(''));
|
|
54
|
+
}
|
|
55
|
+
if (!composed.keys.length) {
|
|
56
|
+
return {
|
|
57
|
+
state: 'empty',
|
|
58
|
+
ok: false,
|
|
59
|
+
data: { customParams: {}, fieldAssignKeys: '', todos: composed.todos },
|
|
60
|
+
warnings: composed.warnings,
|
|
61
|
+
next: {
|
|
62
|
+
command: 'weaver-work-cli reception render --run-id … --answers \'{...}\'',
|
|
63
|
+
reason: '没有任何字段有值,先补齐 answers',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// baseUrl 优先级:run 记录 → 当前会话 → 快照环境值。
|
|
68
|
+
// run.base 是 doc 上传时回填的,与本次执行同机同环境;先取它能省掉一次会话解析(~228ms)。
|
|
69
|
+
// run 被重建(RUN_NOT_FOUND)时 run.base 为空,才回落到会话。
|
|
70
|
+
const baseUrl = run.base
|
|
71
|
+
|| (await ctx.host.getSession()).baseUrl
|
|
72
|
+
|| (resolved.snapshot.env && resolved.snapshot.env.baseUrl)
|
|
73
|
+
|| '';
|
|
74
|
+
const browsertool = renderBrowsertool({
|
|
75
|
+
baseUrl,
|
|
76
|
+
workflowId: (resolved.snapshot.workflow && resolved.snapshot.workflow.workflowId) || '',
|
|
77
|
+
workflowName: (resolved.snapshot.workflow && resolved.snapshot.workflow.name) || run.workflow,
|
|
78
|
+
customParams: { values: composed.values, keys: composed.keys },
|
|
79
|
+
sdkRenderType: input.sdkRender,
|
|
80
|
+
});
|
|
81
|
+
// browsertool 落盘:宿主若支持文件引用,模型就不必逐字复述这 2.5KB 结构化 JSON
|
|
82
|
+
// (那是整条链路里最贵的一段生成)。`data.browsertool` 仍然保留,宿主不支持时照旧整段输出。
|
|
83
|
+
let browsertoolFile = '';
|
|
84
|
+
try {
|
|
85
|
+
const dir = runsDir(ctx.stateDir);
|
|
86
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
87
|
+
const file = join(dir, `${run.runId}.browsertool.json`);
|
|
88
|
+
// 落纯 JSON(不含 <browsertool> 标签):标签由宿主按自己的解析规则包上
|
|
89
|
+
const payload = browsertool
|
|
90
|
+
.replace(/^<browsertool>\s*/u, '')
|
|
91
|
+
.replace(/\s*<\/browsertool>$/u, '');
|
|
92
|
+
writeFileSync(file, payload, 'utf8');
|
|
93
|
+
// 统一正斜杠:JSON 里不用转义,Windows 前端也能直接读
|
|
94
|
+
browsertoolFile = file.replace(/\\/gu, '/');
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
composed.warnings.push(`browsertool 落盘失败(${error.message}):按整段 browsertool 输出即可`);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
state: 'rendered',
|
|
101
|
+
ok: true,
|
|
102
|
+
data: {
|
|
103
|
+
customParams: composed.values,
|
|
104
|
+
fieldAssignKeys: composed.keys.join(','),
|
|
105
|
+
detailRowCount: composed.detailRowCount,
|
|
106
|
+
attachmentPending: composed.attachmentPending,
|
|
107
|
+
sdkRenderType: resolveRenderType(input.sdkRender),
|
|
108
|
+
todos: composed.todos,
|
|
109
|
+
browsertool,
|
|
110
|
+
browsertoolFile,
|
|
111
|
+
browsertoolRef: browsertoolFile ? `<browsertool-file path="${browsertoolFile}" />` : '',
|
|
112
|
+
timings: { totalMs: Date.now() - startedAt },
|
|
113
|
+
},
|
|
114
|
+
warnings: composed.warnings,
|
|
115
|
+
next: {
|
|
116
|
+
command: '把 data.browsertool 整段原样作为回复正文(不包代码块)',
|
|
117
|
+
reason: '宿主会打开新建页并带值;用户自己提交',
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export const renderOperation = {
|
|
122
|
+
execute: (input, ctx) => render(input, ctx),
|
|
123
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { receptionRunNotFound, receptionValidationError } from '../errors.js';
|
|
4
|
+
import { ensureDir, readJson, writeJson } from './shared.js';
|
|
5
|
+
function pad(value) {
|
|
6
|
+
return String(value).padStart(2, '0');
|
|
7
|
+
}
|
|
8
|
+
export function newRunId(now = new Date()) {
|
|
9
|
+
const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`
|
|
10
|
+
+ `${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
11
|
+
return `rc-${stamp}-${randomBytes(2).toString('hex')}`;
|
|
12
|
+
}
|
|
13
|
+
export function runsDir(stateDir) {
|
|
14
|
+
return join(stateDir, 'runs');
|
|
15
|
+
}
|
|
16
|
+
export function runPath(stateDir, runId) {
|
|
17
|
+
return join(runsDir(stateDir), `${runId}.json`);
|
|
18
|
+
}
|
|
19
|
+
export function saveRun(stateDir, run) {
|
|
20
|
+
ensureDir(runsDir(stateDir));
|
|
21
|
+
writeJson(runPath(stateDir, run.runId), run);
|
|
22
|
+
return run;
|
|
23
|
+
}
|
|
24
|
+
export function loadRun(stateDir, runId) {
|
|
25
|
+
if (!runId) {
|
|
26
|
+
throw receptionValidationError('RUN_ID_MISSING', '缺少 --run-id(正常流程先用 ask 取 runId;run 已失效时改用 --known 现场重建)', { hint: 'reception doc --known \'{"customer":"…","visitDate":"…"}\' --answers \'{…}\'' });
|
|
27
|
+
}
|
|
28
|
+
const found = readJson(runPath(stateDir, runId));
|
|
29
|
+
if (!found)
|
|
30
|
+
throw receptionRunNotFound(runId, stateDir);
|
|
31
|
+
return found;
|
|
32
|
+
}
|
|
33
|
+
/** 尝试读取;不存在返回 null,不抛。doc 的"现场重建"分支用它。 */
|
|
34
|
+
export function tryLoadRun(stateDir, runId) {
|
|
35
|
+
if (!runId)
|
|
36
|
+
return null;
|
|
37
|
+
return readJson(runPath(stateDir, runId));
|
|
38
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { nameList } from './shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* 日程明细口径:四种来源(scheduleRows / schedule / agenda / 标准议程兜底)+ 7 列按字段 ID 映射。
|
|
4
|
+
*
|
|
5
|
+
* 这张表是表单 subForm 的真实结构,改动必须先在真机核对快照;
|
|
6
|
+
* 口径与 `data/fields-snapshot.json` 的 details 段一一对应。
|
|
7
|
+
*/
|
|
8
|
+
export const SCHEDULE_DETAIL = {
|
|
9
|
+
subFormId: '100003690000000143',
|
|
10
|
+
dataKey: 'formtable_main_23_dt2',
|
|
11
|
+
switch: { fieldId: '100003720000014930', on: '启用' },
|
|
12
|
+
columns: {
|
|
13
|
+
date: '100003720000014936',
|
|
14
|
+
time: '100003720000014937',
|
|
15
|
+
item: '100003720000014938',
|
|
16
|
+
place: '100003720000014939',
|
|
17
|
+
person: '100003720000014940',
|
|
18
|
+
activity: '100003720000014941',
|
|
19
|
+
remark: '100003720000014942',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const STANDARD_AGENDA = [
|
|
23
|
+
{ offset: 0, item: '公司参观', activity: '参观泛微上海总部展厅与办公区,了解公司发展历程与产品能力' },
|
|
24
|
+
{ offset: 45, item: '方案介绍', activity: '' },
|
|
25
|
+
{ offset: 120, item: '讨论交流', activity: '双方围绕关注点交流答疑,明确后续推进节奏' },
|
|
26
|
+
];
|
|
27
|
+
const SEVEN = ['date', 'time', 'item', 'place', 'person', 'activity', 'remark'];
|
|
28
|
+
export function hhmmPlus(start, mins) {
|
|
29
|
+
const base = /^\d{1,2}:\d{2}$/.test(String(start || '')) ? String(start) : '09:30';
|
|
30
|
+
const [hour, minute] = base.split(':').map(Number);
|
|
31
|
+
const total = (((hour * 60 + minute + mins) % 1440) + 1440) % 1440;
|
|
32
|
+
return `${String(Math.floor(total / 60)).padStart(2, '0')}:${String(total % 60).padStart(2, '0')}`;
|
|
33
|
+
}
|
|
34
|
+
function pick7(row) {
|
|
35
|
+
if (!row || typeof row !== 'object' || Array.isArray(row))
|
|
36
|
+
return null;
|
|
37
|
+
const source = row;
|
|
38
|
+
const out = {};
|
|
39
|
+
for (const key of SEVEN) {
|
|
40
|
+
const value = source[key];
|
|
41
|
+
if (value !== null && value !== undefined && String(value).trim())
|
|
42
|
+
out[key] = String(value).trim();
|
|
43
|
+
}
|
|
44
|
+
return Object.keys(out).length ? out : null;
|
|
45
|
+
}
|
|
46
|
+
export function normalizeScheduleRows(data = {}) {
|
|
47
|
+
const rows = [];
|
|
48
|
+
const push = (row) => {
|
|
49
|
+
if (row)
|
|
50
|
+
rows.push(row);
|
|
51
|
+
};
|
|
52
|
+
const companions = Array.isArray(data.companions) ? data.companions : [];
|
|
53
|
+
// 接待人员优先取用户指定的对接人(escorts);companions 可能被 --user 覆盖成当前操作人
|
|
54
|
+
const escortNames = nameList(data.escorts);
|
|
55
|
+
const mainPerson = escortNames[0] || companions
|
|
56
|
+
.map((item) => (typeof item === 'string' ? item : (item && item.name) || ''))
|
|
57
|
+
.filter(Boolean)[0] || data.contact || '';
|
|
58
|
+
if (Array.isArray(data.scheduleRows))
|
|
59
|
+
data.scheduleRows.forEach((row) => push(pick7(row)));
|
|
60
|
+
if (!rows.length && Array.isArray(data.schedule)) {
|
|
61
|
+
data.schedule.forEach((row) => {
|
|
62
|
+
if (Array.isArray(row)) {
|
|
63
|
+
const [time, item, place] = row;
|
|
64
|
+
push(pick7({ date: data.visitDate || data.arrivalDate || '', time, item, place, person: mainPerson }));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
push(pick7(row));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (!rows.length && Array.isArray(data.agenda)) {
|
|
72
|
+
data.agenda.forEach((row) => push(pick7({
|
|
73
|
+
date: data.visitDate || data.arrivalDate || '',
|
|
74
|
+
time: (row && (row.start || row.time)) || '',
|
|
75
|
+
item: row && row.item,
|
|
76
|
+
place: row && row.place,
|
|
77
|
+
person: (row && row.person) || mainPerson,
|
|
78
|
+
activity: row && row.activity,
|
|
79
|
+
remark: row && row.remark,
|
|
80
|
+
})));
|
|
81
|
+
}
|
|
82
|
+
if (!rows.length) {
|
|
83
|
+
const date = data.visitDate || data.arrivalDate || '';
|
|
84
|
+
const start = /^\d{1,2}:\d{2}$/.test(String(data.agendaStart || '')) ? String(data.agendaStart) : '09:30';
|
|
85
|
+
const room = data.meetingRoom || '总部129/130/131会议室(按人数择一)';
|
|
86
|
+
for (const item of STANDARD_AGENDA) {
|
|
87
|
+
push(pick7({
|
|
88
|
+
date,
|
|
89
|
+
time: hhmmPlus(start, item.offset),
|
|
90
|
+
item: item.item,
|
|
91
|
+
place: item.item === '公司参观' ? '泛微上海总部' : room,
|
|
92
|
+
person: mainPerson,
|
|
93
|
+
activity: item.item === '方案介绍' ? (data.demand || '产品与方案介绍') : item.activity,
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const row of rows)
|
|
98
|
+
if (!row.person && mainPerson)
|
|
99
|
+
row.person = mainPerson;
|
|
100
|
+
return rows;
|
|
101
|
+
}
|
|
102
|
+
export function buildDetailsPayload(rows) {
|
|
103
|
+
const list = Array.isArray(rows) ? rows : [];
|
|
104
|
+
const out = [];
|
|
105
|
+
for (const item of list) {
|
|
106
|
+
const row = {};
|
|
107
|
+
for (const [semantic, fieldId] of Object.entries(SCHEDULE_DETAIL.columns)) {
|
|
108
|
+
const value = item && item[semantic];
|
|
109
|
+
if (value === null || value === undefined)
|
|
110
|
+
continue;
|
|
111
|
+
const text = String(value).trim();
|
|
112
|
+
if (text)
|
|
113
|
+
row[fieldId] = text;
|
|
114
|
+
}
|
|
115
|
+
if (Object.keys(row).length)
|
|
116
|
+
out.push(row);
|
|
117
|
+
}
|
|
118
|
+
if (!out.length)
|
|
119
|
+
return null;
|
|
120
|
+
return {
|
|
121
|
+
details: { [SCHEDULE_DETAIL.subFormId]: out },
|
|
122
|
+
switchField: SCHEDULE_DETAIL.switch,
|
|
123
|
+
subFormId: SCHEDULE_DETAIL.subFormId,
|
|
124
|
+
dataKey: SCHEDULE_DETAIL.dataKey,
|
|
125
|
+
rowCount: out.length,
|
|
126
|
+
};
|
|
127
|
+
}
|