weaver-work-cli 0.1.75 → 0.1.78
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 +3 -1
- package/dist/chunks/{archive-OZJ6PYUR.js → archive-ENBSUMHV.js} +1 -1
- package/dist/chunks/{archive-oa-BHL5RK2F.js → archive-oa-7BFPQ6M5.js} +1 -1
- package/dist/chunks/{asset-HKRFRQR2.js → asset-V5SUD3PW.js} +1 -1
- package/dist/chunks/{asset-idle-GGIR4KE7.js → asset-idle-3CEL7WFX.js} +1 -1
- package/dist/chunks/{attachment-content-4OV65NK5.js → attachment-content-TFOC3Y3X.js} +3 -3
- package/dist/chunks/{blog-HYDP4DV3.js → blog-FLI4SS3P.js} +1 -1
- package/dist/chunks/{caizhilian-JS4RQZ6Z.js → caizhilian-7WCTKCCP.js} +3 -3
- package/dist/chunks/{calendar-SWRY4DIT.js → calendar-G726HUUH.js} +1 -1
- package/dist/chunks/{chunk-5ZJGPEIB.js → chunk-2KW7AI6P.js} +1 -1
- package/dist/chunks/{chunk-JOY3HZXL.js → chunk-2UV4IZIT.js} +21 -15
- package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
- package/dist/chunks/{chunk-VOMDD2C5.js → chunk-5E2FDXBU.js} +1 -1
- package/dist/chunks/{chunk-ZUB4M4N3.js → chunk-5VQ7JHV4.js} +134 -49
- package/dist/chunks/{chunk-I6NOHKEK.js → chunk-7SQN5IZR.js} +1 -1
- package/dist/chunks/{chunk-4FCBEWNB.js → chunk-BP7BONZO.js} +675 -86
- package/dist/chunks/{chunk-U6Y32KEV.js → chunk-BWFCTE43.js} +1 -1
- package/dist/chunks/{chunk-PG5YSNYY.js → chunk-DACQKJ6O.js} +3 -3
- package/dist/chunks/{chunk-KWJEICD4.js → chunk-E2EY3DMS.js} +2 -2
- package/dist/chunks/{chunk-KEA4XQPO.js → chunk-FAC4IFGQ.js} +4 -4
- package/dist/chunks/{chunk-MXCRKXOP.js → chunk-FPWCCRKT.js} +1 -1
- package/dist/chunks/{minute-doc-OQUMDTKG.js → chunk-IBTGXLOT.js} +101 -18
- package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
- package/dist/chunks/{chunk-BNKUHN4N.js → chunk-OVTCWLNQ.js} +2 -2
- package/dist/chunks/{chunk-5D2V7ZAN.js → chunk-PMRNIGKZ.js} +1 -1
- package/dist/chunks/{chunk-OQCK5SAU.js → chunk-RVEKGVZU.js} +1 -1
- package/dist/chunks/{chunk-2AUFKU2D.js → chunk-SWFTWNWL.js} +11 -11
- package/dist/chunks/{chunk-TA2RBUTH.js → chunk-TBCKK6LH.js} +1 -1
- package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
- package/dist/chunks/{chunk-J7FAAHWH.js → chunk-UDBQJLQF.js} +1 -1
- package/dist/chunks/{chunk-BSR5TM7U.js → chunk-USYFVIUR.js} +22 -7
- package/dist/chunks/{chunk-ERZY6GYL.js → chunk-UZ2E3VNI.js} +1 -1
- package/dist/chunks/{chunk-NWYHCZTY.js → chunk-VNEU7OUN.js} +1 -1
- package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
- package/dist/chunks/{chunk-LJI4N6FV.js → chunk-XNN5PZTI.js} +1 -1
- package/dist/chunks/{chunk-QJWVYOOV.js → chunk-Z44YFIN6.js} +2 -2
- package/dist/chunks/{chunk-ZWIMLT6P.js → chunk-ZOTXXGUM.js} +7 -7
- package/dist/chunks/{cli-FULPXIKJ.js → cli-WA7FOQKC.js} +35 -35
- package/dist/chunks/{commands-BNWFNTD3.js → commands-J52MJ6NF.js} +3 -3
- package/dist/chunks/{conflict-5BKCDV2F.js → conflict-D4GVAURN.js} +2 -2
- package/dist/chunks/{contract-WI23OXVC.js → contract-GW7US3UF.js} +4400 -3548
- package/dist/chunks/{cowork-DZBBVNMQ.js → cowork-GZDODGKF.js} +1 -1
- package/dist/chunks/{create-flow-7ZRBRKX7.js → create-flow-ERDGW3FZ.js} +10 -6
- package/dist/chunks/{data-PAZVE6QE.js → data-HTQZRPPI.js} +1 -1
- package/dist/chunks/{ebuilder-form-5SQXIGXN.js → ebuilder-form-GHNIZ7ET.js} +2 -2
- package/dist/chunks/{ehr-CX5F4ZAU.js → ehr-P6T7OAAV.js} +2 -2
- package/dist/chunks/{entry-mode-I2BYNONZ.js → entry-mode-SQU5WTX6.js} +3 -3
- package/dist/chunks/{env-ZAQZ7EHN.js → env-DASBNSEM.js} +2 -2
- package/dist/chunks/{esb-DQTXDIBF.js → esb-ATRKVHCD.js} +3 -3
- package/dist/chunks/{factory-XRI6KZ7H.js → factory-A3NAKZAA.js} +1 -1
- package/dist/chunks/{fna-FK6HQVJL.js → fna-IKYI3SST.js} +1 -1
- package/dist/chunks/{group-chat-MLWNYM2P.js → group-chat-7SEAVAJR.js} +3 -3
- package/dist/chunks/{host-MEC4VQZA.js → host-6UOXYOOY.js} +2 -2
- package/dist/chunks/{host-KUMU3DDK.js → host-EJSJSLVK.js} +2 -2
- package/dist/chunks/{host-3EPREGXS.js → host-EYNLB6S4.js} +2 -2
- package/dist/chunks/{host-T6NNQGVZ.js → host-OT4KNR3G.js} +2 -2
- package/dist/chunks/{host-VI7Q45PM.js → host-UY4LQPN4.js} +2 -2
- package/dist/chunks/{host-J74JGYAW.js → host-XXGDQM7D.js} +2 -2
- package/dist/chunks/{hrm-KKVAW4P5.js → hrm-5JQ7QZ6A.js} +2 -2
- package/dist/chunks/{im-47CIWQNL.js → im-2YJW3EI5.js} +2 -2
- package/dist/chunks/{invoice-CDYRBNIG.js → invoice-37HR6L3W.js} +937 -552
- package/dist/chunks/{jiuchuanhui-M7QTRHZK.js → jiuchuanhui-KBWUZ7WT.js} +1 -1
- package/dist/chunks/{lazy-dispatch-FKQJZFI5.js → lazy-dispatch-ZDKLS5MR.js} +6 -6
- package/dist/chunks/{mail-NRBS5N6Y.js → mail-YBKUM6HM.js} +1 -1
- package/dist/chunks/{meeting-WC5LD3IO.js → meeting-7AEQGBAT.js} +19 -13
- package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
- package/dist/chunks/{okr-EHKSKMPL.js → okr-HW7IULIR.js} +1 -1
- package/dist/chunks/{operations-V5VM5MS2.js → operations-4P2UYVLH.js} +3 -3
- package/dist/chunks/{performance-ZJADXJPN.js → performance-PM2G6L3E.js} +1 -1
- package/dist/chunks/{plan-OTDNBDJ7.js → plan-3YYGZ7ZM.js} +1 -1
- package/dist/chunks/{project-4XVBQ3HX.js → project-6PRGBLO2.js} +39 -15
- package/dist/chunks/{reception-3FAHOOH7.js → reception-7G3J2MA6.js} +1 -1
- package/dist/chunks/{recruit-stage-3WTVWW2K.js → recruit-stage-TLZJUFHD.js} +544 -464
- package/dist/chunks/{registry-TJGCVRCW.js → registry-3VTB3KLV.js} +3 -3
- package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
- package/dist/chunks/{registry-NBTBXR4L.js → registry-UVTI323K.js} +12 -11
- package/dist/chunks/{room-recommend-KL62XB2Y.js → room-recommend-ELEJUYBN.js} +4 -4
- package/dist/chunks/{schedule-XOISYUPB.js → schedule-XBKY7VEA.js} +4 -4
- package/dist/chunks/{smart-extract-UYGNV3BM.js → smart-extract-T5Z4AULN.js} +1 -1
- package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
- package/dist/chunks/{workflow-V54LJPXL.js → workflow-SYCBS5XD.js} +3 -3
- package/dist/index.js +3 -3
- package/dist/internal/update/service.js +9 -8
- package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
- package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
- package/dist/shortcuts/contract/data/report-renderers.js +75 -31
- package/dist/shortcuts/contract/data/report-spec.js +17 -3
- package/dist/shortcuts/contract/manifest.js +20 -3
- package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
- package/dist/shortcuts/contract/operations/collection-node.js +116 -1
- package/dist/shortcuts/contract/operations/compare-report.js +27 -5
- package/dist/shortcuts/contract/operations/credit-page.js +11 -2
- package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
- package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
- package/dist/shortcuts/contract/operations/elements-build.js +162 -30
- package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
- package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
- package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
- package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
- package/dist/shortcuts/contract/operations/ledger.js +88 -16
- package/dist/shortcuts/contract/operations/metrics.js +16 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
- package/dist/shortcuts/contract/operations/page.js +23 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
- package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
- package/dist/shortcuts/contract/operations/review-report.js +11 -3
- package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
- package/dist/shortcuts/contract/operations/triage.js +18 -3
- package/dist/shortcuts/contract/operations/viewlink.js +17 -1
- package/dist/shortcuts/ehr/operations/recruit.js +255 -90
- package/dist/shortcuts/invoice/business-response.js +13 -0
- package/dist/shortcuts/invoice/calendar.js +24 -0
- package/dist/shortcuts/invoice/host.js +26 -15
- package/dist/shortcuts/invoice/index.js +2 -2
- package/dist/shortcuts/invoice/invoice-record.js +7 -2
- package/dist/shortcuts/invoice/manifest.js +179 -155
- package/dist/shortcuts/invoice/operations/get.js +9 -3
- package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
- package/dist/shortcuts/invoice/operations/registry.js +4 -5
- package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
- package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
- package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
- package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
- package/dist/shortcuts/invoice/operations/reim.js +2 -126
- package/dist/shortcuts/invoice/operations/shared.js +15 -17
- package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
- package/dist/shortcuts/invoice/projection.js +14 -0
- package/dist/shortcuts/invoice/read-enrichment.js +123 -0
- package/dist/shortcuts/meeting/confirm-gate.js +42 -0
- package/dist/shortcuts/meeting/continuation.js +6 -2
- package/dist/shortcuts/meeting/minute-doc.js +119 -12
- package/dist/shortcuts/meeting/operations/attachment.js +19 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
- package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
- package/dist/shortcuts/meeting/operations/group-share.js +268 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
- package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/project/operations/read.js +40 -15
- package/dist/shortcuts/recruit-stage/context.js +16 -81
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
- package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
- package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
- package/dist/shortcuts/recruit-stage/shared.js +153 -4
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +11 -0
- package/dist/shortcuts/workflow/operations/read.js +24 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
- package/docs/agent-invoice.md +28 -2
- package/docs/invoice.md +60 -9
- package/docs/project.md +1 -1
- package/package.json +1 -1
- package/skill-template/domains/yepiaotong.md +36 -7
- package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
- package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
- package/skills/weaver-e10-meeting/SKILL.md +203 -80
- package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
- package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
- package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
- package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +158 -146
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +64 -51
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +56 -18
- package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +217 -30
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +18 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +19 -20
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +21 -25
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +19 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +31 -58
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +25 -15
- package/skills/weaver-e10-shijingran/SKILL.md +2 -2
- package/skills/weaver-e10-shijingran/references/operations.md +5 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
- package/skills/weaver-e10-workflow/SKILL.md +13 -9
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
- package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
- package/skills/weaver-e10-yepiaotong/SKILL.md +133 -61
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
- package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
- package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
- package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
- package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
- package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
- package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
- package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
- package/templates/meeting/minute.docx +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
|
@@ -1061,6 +1061,35 @@ export async function fixedFlowIdsForEnv(env) {
|
|
|
1061
1061
|
* 只有一个有权限 → 直接发起(不弹窗);都没有权限 → 报"没有发起权限"。
|
|
1062
1062
|
* 只有显式 `flowChoice: 'auto'`(或 `WEAVER_MEETING_FLOW_CHOICE=auto`)才自动取第一个。
|
|
1063
1063
|
*/
|
|
1064
|
+
/**
|
|
1065
|
+
* workflow 层已经算好的耗时,原样透传(**不新增测量**,只是不再丢弃)。
|
|
1066
|
+
* 键名:durationMs→workflowMs、authMs→authMs、apiSlowest 字符串原样带。
|
|
1067
|
+
*/
|
|
1068
|
+
function workflowTimingsOf(data) {
|
|
1069
|
+
const out = {};
|
|
1070
|
+
for (const [from, to] of [['durationMs', 'workflowMs'], ['authMs', 'authMs']]) {
|
|
1071
|
+
const value = Number(data?.[from]);
|
|
1072
|
+
if (Number.isFinite(value) && value >= 0)
|
|
1073
|
+
out[to] = Math.round(value);
|
|
1074
|
+
}
|
|
1075
|
+
const slowest = data?.apiSlowest;
|
|
1076
|
+
if (typeof slowest === 'string' && slowest !== '')
|
|
1077
|
+
out.apiSlowest = slowest;
|
|
1078
|
+
return out;
|
|
1079
|
+
}
|
|
1080
|
+
/** 每个接口各自多久(workflow 层按 span 汇总好的)。 */
|
|
1081
|
+
function workflowApiDurations(data) {
|
|
1082
|
+
const raw = data?.apiDurations;
|
|
1083
|
+
if (!raw || typeof raw !== 'object')
|
|
1084
|
+
return null;
|
|
1085
|
+
const out = {};
|
|
1086
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
1087
|
+
const num = Number(value);
|
|
1088
|
+
if (Number.isFinite(num))
|
|
1089
|
+
out[key] = Math.round(num);
|
|
1090
|
+
}
|
|
1091
|
+
return Object.keys(out).length > 0 ? out : null;
|
|
1092
|
+
}
|
|
1064
1093
|
export function shouldAutoPickFlow(args) {
|
|
1065
1094
|
if (args.flowChoice === 'auto')
|
|
1066
1095
|
return true;
|
|
@@ -1268,6 +1297,39 @@ export function decideEntryMode(input) {
|
|
|
1268
1297
|
return { mode: declared, reason: 'token' };
|
|
1269
1298
|
return { mode: '', reason: 'unverified' };
|
|
1270
1299
|
}
|
|
1300
|
+
/**
|
|
1301
|
+
* 是否已经"问都不用问"就能往下走(免入口询问)。
|
|
1302
|
+
*
|
|
1303
|
+
* 判据只有两条:**时间**(具体时刻,或时段+日期)和**地点**。
|
|
1304
|
+
* ⛔ 参会人**不参与**判定:
|
|
1305
|
+
* - 「没点名就不传 `hrm_members`,CLI 自动填当前登录人」是明文允许的输入;
|
|
1306
|
+
* - 拿它当阻断条件,会让「就我一个人参加」「我们两个去」这类会永远判不齐,
|
|
1307
|
+
* 白弹一次入口询问(一次调用实测 +8.5s,什么都没查)。
|
|
1308
|
+
* ⛔ 地点仍然要:它决定会不会撞占用/换房,没给地点时问一次入口是合理的。
|
|
1309
|
+
*/
|
|
1310
|
+
export function decideAutoDirect(args) {
|
|
1311
|
+
const beginRaw = String(args.begin_datetime ?? '').trim();
|
|
1312
|
+
const timeReady = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/.test(beginRaw)
|
|
1313
|
+
|| (String(args.time_slot ?? '').trim() !== ''
|
|
1314
|
+
&& (String(args.dateFrom ?? '').trim() !== '' || /^\d{4}-\d{2}-\d{2}/.test(beginRaw)));
|
|
1315
|
+
const placeReady = String(args.address ?? args.customize_address ?? '').trim() !== ''
|
|
1316
|
+
|| args.allowNoRoom === true;
|
|
1317
|
+
return timeReady && placeReady;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* 时间**完全没给**:既没有时刻、也没有时段、也没有日期。
|
|
1321
|
+
*
|
|
1322
|
+
* 这种输入不能弹"直发 / 推荐"入口,也不能拿去推荐会议室 —— 只能先问时间。
|
|
1323
|
+
* (实测:缺时间时走推荐链路会返回 `room_unavailable`,用户看到的是"没推荐出可用会议室",
|
|
1324
|
+
* 而真实原因是他还没说什么时候开。)
|
|
1325
|
+
*/
|
|
1326
|
+
export function isTimeMissing(args) {
|
|
1327
|
+
const begin = String(args.begin_datetime ?? args.beginDatetime ?? '').trim();
|
|
1328
|
+
const hasClock = /\d{1,2}:\d{2}/.test(begin);
|
|
1329
|
+
const hasSlot = /(上午|下午|晚上|早上)/u.test(begin) || String(args.time_slot ?? '').trim() !== '';
|
|
1330
|
+
const hasDate = /\d{4}-\d{2}-\d{2}/.test(begin) || String(args.dateFrom ?? '').trim() !== '';
|
|
1331
|
+
return !hasClock && !hasSlot && !hasDate;
|
|
1332
|
+
}
|
|
1271
1333
|
const ebMeetingCreateFlowPrepare = {
|
|
1272
1334
|
name: 'meeting.eb.meeting.create.flow.prepare',
|
|
1273
1335
|
resource: 'eb',
|
|
@@ -1355,6 +1417,13 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1355
1417
|
+ '不传 = 未确认:即使传了 address,CLI 也会把"你指定的这间"和推荐候选一起列出来让用户点选。'
|
|
1356
1418
|
+ '⛔ 不要自己从 room.list / room.recommend 里挑一间塞进 address —— 那是替用户拍板',
|
|
1357
1419
|
},
|
|
1420
|
+
roomStrategy: {
|
|
1421
|
+
type: 'string',
|
|
1422
|
+
enum: ['auto', 'ask'],
|
|
1423
|
+
description: '指定的会议室被占用时怎么办。auto(默认)= 自动改用首选空闲房并继续出确认卡,'
|
|
1424
|
+
+ '回复里说明换了哪间;ask = 返回候选让用户点选。'
|
|
1425
|
+
+ '只有用户明确表达"就要这间 / 必须是 317"时才传 ask',
|
|
1426
|
+
},
|
|
1358
1427
|
extraFields: {
|
|
1359
1428
|
type: 'object',
|
|
1360
1429
|
description: '按**流程表单里的字段名**填额外字段,形如 {"参会客户": "xx公司", "联系方式": "138xxxx"}'
|
|
@@ -1441,20 +1510,18 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1441
1510
|
const { getMeetingOperation } = await import('../registry.js');
|
|
1442
1511
|
return getMeetingOperation('meeting.eb.meeting.create.formLink').handler(args, env);
|
|
1443
1512
|
}
|
|
1444
|
-
//
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
|| (String(args.time_slot ?? '').trim() !== ''
|
|
1448
|
-
&& (String(args.dateFrom ?? '').trim() !== '' || /^\d{4}-\d{2}-\d{2}/.test(beginRaw)));
|
|
1449
|
-
const placeReady = String(args.address ?? args.customize_address ?? '').trim() !== '';
|
|
1450
|
-
const peopleReady = String(args.hrm_members ?? '').trim() !== '';
|
|
1451
|
-
const autoDirect = timeReady && placeReady && peopleReady;
|
|
1513
|
+
// 时间 + 地点已齐 ⇒ 直接往下走(判冲突/推荐/换房),不再问入口。
|
|
1514
|
+
// ⛔ 不要在这里再要求 `hrm_members`:没点名时 CLI 自动填当前登录人,是合法输入。
|
|
1515
|
+
const autoDirect = decideAutoDirect(args);
|
|
1452
1516
|
if (autoDirect) {
|
|
1453
1517
|
args = { ...args, skipPreflight: true };
|
|
1454
1518
|
skipPreflight = true;
|
|
1455
1519
|
}
|
|
1456
1520
|
// 入口确认:没有 entryMode、没有会话标记、也不是直接发起 → 必须先让用户选一次。
|
|
1457
|
-
|
|
1521
|
+
// ⛔ 但时间都没定(既没时刻、也没时段、也没日期)时**不要**弹入口:
|
|
1522
|
+
// 那个选择对用户毫无意义,而且会一路走到 room_unavailable(把"缺时间"错报成"没房间")。
|
|
1523
|
+
// 让流程继续往下,由后面的时间闸门给时段候选。
|
|
1524
|
+
if (!entryResolved && args.skipPreflight !== true && !isTimeMissing(args)) {
|
|
1458
1525
|
const { createEntryToken } = await import('./entry-mode.js');
|
|
1459
1526
|
const tokenDirect = await createEntryToken(env, 'direct_form');
|
|
1460
1527
|
const tokenAssist = await createEntryToken(env, 'assist');
|
|
@@ -1676,7 +1743,9 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1676
1743
|
if (Number.isFinite(startMs))
|
|
1677
1744
|
endText = formatMinute(new Date(startMs + duration * 60000));
|
|
1678
1745
|
}
|
|
1679
|
-
|
|
1746
|
+
// ⛔ 这里不再要求 `!skipPreflight`:直发(skipPreflight)但**时间根本没给**时,
|
|
1747
|
+
// 往下走只会得到 room_unavailable("没推荐出可用的空闲会议室"),把缺时间错报成没房间。
|
|
1748
|
+
if (!beginHasTime || !timeConfirmed) {
|
|
1680
1749
|
const day = /^\d{4}-\d{2}-\d{2}/.test(beginText)
|
|
1681
1750
|
? beginText.slice(0, 10)
|
|
1682
1751
|
: (String(args.dateFrom ?? '').trim().slice(0, 10) || tomorrowIso());
|
|
@@ -1960,8 +2029,15 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1960
2029
|
}).catch(noteFailure('参会人**日程空闲**检测'))
|
|
1961
2030
|
: Promise.resolve(null);
|
|
1962
2031
|
const enrichStarted = Date.now();
|
|
1963
|
-
|
|
1964
|
-
|
|
2032
|
+
// ⚡ 流程解析只读配置/缓存,不依赖房间与人员的检测结果 → 提前算出来,
|
|
2033
|
+
// 顺带把「表单载入(createForm)」塞进并行组:原本是四路检测**全部结束之后**才串行载表单,
|
|
2034
|
+
// 实测表单载入 1~4s(缓存 miss 时更久),藏进检测窗口里等于白赚。
|
|
2035
|
+
const resolvedEarly = await resolveWorkflowId(env, args).catch(() => null);
|
|
2036
|
+
const formPreloadTask = resolvedEarly?.workflowId
|
|
2037
|
+
? loadCreateForm(env, resolvedEarly.workflowId).catch(() => null)
|
|
2038
|
+
: Promise.resolve(null);
|
|
2039
|
+
const [roomRec, memberConflict, free, roomConflict, preloadedForm] = await Promise.all([
|
|
2040
|
+
roomTask, conflictTask, availabilityTask, roomConflictTask, formPreloadTask,
|
|
1965
2041
|
]);
|
|
1966
2042
|
mark('enrichMs', enrichStarted);
|
|
1967
2043
|
timings.parallelMs = Date.now() - startedAt;
|
|
@@ -2068,16 +2144,51 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2068
2144
|
});
|
|
2069
2145
|
}
|
|
2070
2146
|
// 只有"用户已确认这间房"时才按占用拦截;未确认的只是候选,交给下面的选房分支处理。
|
|
2071
|
-
//
|
|
2072
|
-
|
|
2147
|
+
// 指定房被占的默认处置:自动改用首选空闲房并继续出确认卡(回复里说明换了哪间),
|
|
2148
|
+
// 不再让用户对着 R1/R2/R3 手打一遍;只有用户明说"就要这间"(roomStrategy=ask)或没有替代房时才拦。
|
|
2149
|
+
const roomStrategyAsk = String(args.roomStrategy ?? '').trim() === 'ask';
|
|
2150
|
+
let roomSwitchNotice = '';
|
|
2151
|
+
/** 自动换房后的**可点候选**:R1 = 已改用的那间,R2 起 = 其它空闲房。
|
|
2152
|
+
* ⛔ 不给结构化候选项时,模型会自己把 `decisions.roomOptions` 抄成文字列表("可选:A / B / C"),
|
|
2153
|
+
* 用户只能手打房间名 —— 明明有数据,却退化成打字。
|
|
2154
|
+
*/
|
|
2155
|
+
let roomSwapOptions;
|
|
2156
|
+
if (addressInput && roomConfirmed && roomConflictData?.hasConflict === true
|
|
2157
|
+
&& roomOptions.length > 0 && !roomStrategyAsk) {
|
|
2073
2158
|
const fallback = roomOptions[0].value ?? {};
|
|
2074
2159
|
const from = { id: resolvedAddressId, name: addressDisplay };
|
|
2075
2160
|
resolvedAddressId = String(fallback.id ?? '');
|
|
2076
2161
|
addressDisplay = String(fallback.name ?? addressDisplay);
|
|
2077
2162
|
addressInput = resolvedAddressId;
|
|
2078
|
-
decisions.roomAutoSwitched = {
|
|
2163
|
+
decisions.roomAutoSwitched = {
|
|
2164
|
+
reason: '你指定的会议室该时段被占用,已改用首选空闲房',
|
|
2165
|
+
from,
|
|
2166
|
+
to: { id: resolvedAddressId, name: addressDisplay },
|
|
2167
|
+
};
|
|
2168
|
+
roomSwitchNotice = `${from.name} 在 ${beginText}~${endText} 已被占用,本次已改用「${addressDisplay}」;`
|
|
2169
|
+
+ '要换别的房间或改时间,直接在表单里改,或告诉我房间名';
|
|
2170
|
+
const others = roomOptions
|
|
2171
|
+
.filter((item) => String(item.value?.id ?? '') !== resolvedAddressId)
|
|
2172
|
+
.slice(0, 3);
|
|
2173
|
+
// 选项文案是给**最终用户**看的,不是给模型看的:
|
|
2174
|
+
// ⛔ label 只放房间名(+容纳人数),不要写「已自动改用 / 推荐」这类系统口径 —— 用户看不懂;
|
|
2175
|
+
// 为什么换、为什么选它,全写在 reason 里(照抄推荐理由:常用次数 + 容量 + 该时段空闲)。
|
|
2176
|
+
const picked = roomOptions[0];
|
|
2177
|
+
const pickedLabel = String(picked?.label ?? addressDisplay).replace(/\s*·\s*推荐\s*$/, '').trim();
|
|
2178
|
+
const pickedReason = String(picked?.reason ?? '').trim();
|
|
2179
|
+
roomSwapOptions = [
|
|
2180
|
+
{
|
|
2181
|
+
key: 'R1',
|
|
2182
|
+
label: pickedLabel || addressDisplay,
|
|
2183
|
+
reason: `${from.name} 该时段已被占用,已自动改用这间`
|
|
2184
|
+
+ (pickedReason ? `;${pickedReason}` : ''),
|
|
2185
|
+
value: { id: resolvedAddressId, name: addressDisplay, roomConfirmed: true, applyDirect: true },
|
|
2186
|
+
},
|
|
2187
|
+
...others.map((item, index) => ({ ...item, key: `R${index + 2}` })),
|
|
2188
|
+
];
|
|
2079
2189
|
}
|
|
2080
|
-
if (addressInput && roomConfirmed && roomConflictData?.hasConflict === true
|
|
2190
|
+
if (addressInput && roomConfirmed && roomConflictData?.hasConflict === true
|
|
2191
|
+
&& (roomStrategyAsk || roomOptions.length === 0)) {
|
|
2081
2192
|
const busy = Array.isArray(roomConflictData.conflicts) ? roomConflictData.conflicts : [];
|
|
2082
2193
|
decisions.roomConflict = {
|
|
2083
2194
|
address: resolvedAddressId,
|
|
@@ -2246,7 +2357,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2246
2357
|
// 理由:流程只是承载体,用户先要确定"这会到底开不开、什么时候开、在哪开、谁参加",
|
|
2247
2358
|
// 到这一步都定了,最后再让他挑"用哪条流程走审批"。所以时间/房间闸门都在上面,
|
|
2248
2359
|
// 到这里四要素已经齐了(时间带 timeConfirmed、地点带 roomConfirmed),只剩流程没定。
|
|
2249
|
-
const resolved = await resolveWorkflowId(env, args);
|
|
2360
|
+
const resolved = resolvedEarly ?? await resolveWorkflowId(env, args);
|
|
2250
2361
|
// 地点还原成**人看得懂的名字**(address 入参可能是 id):用户看确认摘要不能是一串数字。
|
|
2251
2362
|
// 名称/名称(id) 传进来时用解析出来的真实房间名,别再回显用户那串原文。
|
|
2252
2363
|
const confirmedAddressId = resolvedAddressId;
|
|
@@ -2269,6 +2380,8 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2269
2380
|
: '应用设置配置'));
|
|
2270
2381
|
let probes = [];
|
|
2271
2382
|
let loadedForms = new Map();
|
|
2383
|
+
if (preloadedForm && resolvedEarly?.workflowId)
|
|
2384
|
+
loadedForms.set(resolvedEarly.workflowId, preloadedForm);
|
|
2272
2385
|
// 固化自用场景:多个流程都能发起时自动取优先级最高的,不再打断用户去选(2026-10-30 要求)。
|
|
2273
2386
|
const autoPick = shouldAutoPickFlow(args);
|
|
2274
2387
|
if (!workflowId && candidates.length > 1) {
|
|
@@ -2413,7 +2526,11 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2413
2526
|
throw meetingValidationError('flow_context_missing', '建会流程表单没有返回 continuation,无法继续提交');
|
|
2414
2527
|
}
|
|
2415
2528
|
// 参会人冲突 / 空闲时段已在选房之前处理完(见上方 conflictBrief)。
|
|
2416
|
-
|
|
2529
|
+
// 把 mark() 记的分段耗时(enrichMs / formLoadMs / flowProbeMs…)一并交出去:
|
|
2530
|
+
// 只看一个总毫秒数没法判断"慢在哪",用户也没法自证是不是环境问题。
|
|
2531
|
+
const markMs = Object.fromEntries(Object.entries((env.__meetingTimings ?? {}))
|
|
2532
|
+
.filter(([key, value]) => /Ms$/.test(key) && typeof value === 'number'));
|
|
2533
|
+
decisions.timings = { ...timings, ...markMs };
|
|
2417
2534
|
// 参会客户:选了客户就自动算「应到客户数」,不让用户再手填一遍(填了以用户的为准)。
|
|
2418
2535
|
const crmMemberCount = (() => {
|
|
2419
2536
|
if (args.crm_member_count !== undefined && args.crm_member_count !== '')
|
|
@@ -2817,6 +2934,18 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2817
2934
|
return meetingSuccess('meeting.eb.meeting.create.flow.prepare', {
|
|
2818
2935
|
status: 'AWAITING_CONFIRMATION',
|
|
2819
2936
|
...(entryResolved ? { entryResolved } : {}),
|
|
2937
|
+
// 指定房被占、已自动换房时给一句人话说明:模型必须把它带进回复,不许静默换房
|
|
2938
|
+
...(roomSwitchNotice ? { roomSwitchNotice } : {}),
|
|
2939
|
+
// 换房后的候选房必须是可以点的:模型要问就渲染成选项控件,⛔ 不许抄成文字列表让用户打字
|
|
2940
|
+
...(roomSwapOptions
|
|
2941
|
+
? {
|
|
2942
|
+
options: roomSwapOptions,
|
|
2943
|
+
ui: { component: 'choice', multiple: false, recommendedKey: 'R1' },
|
|
2944
|
+
roomSwapHint: '要问用户就用选项控件渲染 options,⛔ 不许写成"可选:A/B/C"这种文字列表;'
|
|
2945
|
+
+ 'R1 是已自动改用的房(点它直接用 continuationId 提交,不必重新预检),'
|
|
2946
|
+
+ 'R2 起是其它空闲房(选中后用该 value.id 当 address 重新 prepare)',
|
|
2947
|
+
}
|
|
2948
|
+
: {}),
|
|
2820
2949
|
preview: {
|
|
2821
2950
|
workflowId,
|
|
2822
2951
|
workflowCandidates: candidates,
|
|
@@ -2845,6 +2974,10 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2845
2974
|
},
|
|
2846
2975
|
continuation,
|
|
2847
2976
|
continuationId: await saveContinuationAlias(continuation, CONTINUATION_TTL_MS).catch(() => null),
|
|
2977
|
+
// 长 token 有 4KB,模型转述时会被截断/改写(实测出现过 fingerprint 被改成 "x" 导致验签失败)。
|
|
2978
|
+
// 这里把"该用哪个"写成一句话,避免模型自己挑。
|
|
2979
|
+
submitHint: '提交 apply 时传 continuationId(8 位)即可,不要手抄 continuation 长串;'
|
|
2980
|
+
+ '长串被截断或改写会报 continuation_invalid',
|
|
2848
2981
|
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
2849
2982
|
}, warnings.length > 0 ? { warnings } : {});
|
|
2850
2983
|
},
|
|
@@ -3122,7 +3255,17 @@ const ebMeetingCreateFlowApply = {
|
|
|
3122
3255
|
message: String(submittedData.message ?? ''),
|
|
3123
3256
|
invitation: browserInvitation,
|
|
3124
3257
|
...(groupChat ? { groupChat } : {}),
|
|
3125
|
-
|
|
3258
|
+
// ⛔ 这里以前只报 submitMs(拼 URL 的 13ms),把 workflow 层**已经算好**的
|
|
3259
|
+
// `durationMs / authMs / apiDurations / apiSlowest` 全丢了 —— 于是用户看到"7 秒"、
|
|
3260
|
+
// timings 里只有 13ms,谁也说不清剩下的时间花在哪(2026-11-30 用户质问)。
|
|
3261
|
+
// 这些字段 workflow 本来就产出(见 workflow/index.ts 的 printWorkflowResult 注释),
|
|
3262
|
+
// 这里只是别再把它们扔掉,方便直接对着日志看分段。
|
|
3263
|
+
timings: {
|
|
3264
|
+
submitMs: Date.now() - submitStartedAt,
|
|
3265
|
+
invitationMs: pre.ms,
|
|
3266
|
+
...workflowTimingsOf(submittedData),
|
|
3267
|
+
},
|
|
3268
|
+
...(workflowApiDurations(submittedData) ? { apiDurations: workflowApiDurations(submittedData) } : {}),
|
|
3126
3269
|
}, {
|
|
3127
3270
|
warnings: [
|
|
3128
3271
|
'当前是小e 环境:本次**没有向服务端写入**,建会流程改由浏览器页面完成填单(见 finalMarkdown)。'
|
|
@@ -250,8 +250,17 @@ export async function recommendRooms(env, input) {
|
|
|
250
250
|
const candidates = [];
|
|
251
251
|
/** 描述/名称命中「接待」定位的房间 id:带客户时作为硬筛选池,而不是加分项。 */
|
|
252
252
|
const purposeHitIds = new Set();
|
|
253
|
+
/** 台账里到底有没有接待类房间(**不论忙闲**)。用来区分两种"候选池空了":
|
|
254
|
+
* ① 根本没有接待房 → 只能退回普通房;② 有接待房但都被占/被楼层设备筛掉 → 必须拦住,不许退回普通房。 */
|
|
255
|
+
let receptionSeen = false;
|
|
253
256
|
for (const room of usable) {
|
|
254
257
|
const isBusy = busy.ids.has(room.id);
|
|
258
|
+
if (requirement.hasCustomer === true && !receptionSeen) {
|
|
259
|
+
const hostName = room.name.match(/(接待|招待|贵宾|商务|vip)/iu);
|
|
260
|
+
const hostDesc = String(room.roomDesc ?? '').trim().match(/(接待|招待|贵宾|商务|vip)/iu);
|
|
261
|
+
if (hostName || hostDesc)
|
|
262
|
+
receptionSeen = true;
|
|
263
|
+
}
|
|
255
264
|
if (isBusy) {
|
|
256
265
|
busyCount += 1;
|
|
257
266
|
if (!input.includeBusy)
|
|
@@ -343,10 +352,20 @@ export async function recommendRooms(env, input) {
|
|
|
343
352
|
}
|
|
344
353
|
// 定位优先(带客户场景):只要库里有「接待」定位的房间,就只在这些房间里排序。
|
|
345
354
|
// 常规/容量分再高也不能顶掉定位,否则会把客户安排到普通茶室。
|
|
346
|
-
|
|
355
|
+
let receptionBlocked = false;
|
|
356
|
+
if (requirement.hasCustomer === true && receptionSeen) {
|
|
347
357
|
const preferred = candidates.filter((candidate) => purposeHitIds.has(candidate.id));
|
|
348
|
-
if (preferred.length > 0)
|
|
358
|
+
if (preferred.length > 0) {
|
|
349
359
|
candidates.splice(0, candidates.length, ...preferred);
|
|
360
|
+
}
|
|
361
|
+
else if (candidates.length > 0) {
|
|
362
|
+
// 有接待房,但当前筛选范围(楼层 / 设备 / 容量 / 占用)里一间都进不来。
|
|
363
|
+
// ⛔ 不许静默退回普通房:客户会被排进普通会议室,而用户完全看不出"接待类"这条规则没生效。
|
|
364
|
+
candidates.length = 0;
|
|
365
|
+
receptionBlocked = true;
|
|
366
|
+
warnings.push('本次带客户,但当前条件下没有可用的接待类会议室(楼层 / 设备 / 人数 / 占用任一维度把它筛没了);'
|
|
367
|
+
+ '已停止推荐,请换楼层、去掉设备要求,或改会议时间');
|
|
368
|
+
}
|
|
350
369
|
}
|
|
351
370
|
candidates.sort((left, right) => {
|
|
352
371
|
if (right.score !== left.score)
|
|
@@ -361,7 +380,7 @@ export async function recommendRooms(env, input) {
|
|
|
361
380
|
// ⛔ 候选为空且数据来自缓存 → 缓存可能已过时(刚导入会议室、房间刚解封、容量刚改),
|
|
362
381
|
// 静默用旧缓存回答会让用户得出"系统里没有会议室/只有一间"的错误结论(2026-10-30 真机事故)。
|
|
363
382
|
// 这里自动强制重拉一次再算;只有重拉后仍为空才如实报告。不递归:refreshRooms=true 时直接跳过。
|
|
364
|
-
if (candidates.length === 0 && roomData.fromCache && input.refreshRooms !== true) {
|
|
383
|
+
if (candidates.length === 0 && roomData.fromCache && input.refreshRooms !== true && !receptionBlocked) {
|
|
365
384
|
const retried = await recommendRooms(env, { ...input, refreshRooms: true, refreshFrequent: true });
|
|
366
385
|
return {
|
|
367
386
|
...retried,
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 会议侧「建群 + 把纪要和待办发进群 + @人」。
|
|
3
|
+
*
|
|
4
|
+
* 为什么放在会议模块而不是 im 模块:
|
|
5
|
+
* IM 侧其实**早就有**建群和群发能力(`im.group.create` / `im.msg.send.group` 的两段式),
|
|
6
|
+
* 但它们没挂在 `im group` / `im send` 的子命令上(`im group --help` 只有 search/info/users),
|
|
7
|
+
* 模型按 help 摸能力时完全看不到,于是得出"CLI 不能建群、不能群发"的错误结论(实测白烧 168 秒)。
|
|
8
|
+
* 按"只改会议域"的约束,这里不碰 im 的注册表,而是在会议侧包一层业务语义:
|
|
9
|
+
* 会议名 → 群名、参会人 → 群成员、纪要 docx → 群文件、待办 → 带 @ 的文本消息。
|
|
10
|
+
*
|
|
11
|
+
* 内部固定四步(每步都是 im 的两段式 prepare → apply):
|
|
12
|
+
* ① im.group.create 建群(传 group_id 则跳过)
|
|
13
|
+
* ② im.msg.send.group 发纪要文件(⛔ 只传 file,不带 txt:同传时服务端会丢文件)
|
|
14
|
+
* ③ im.msg.send.group 发待办文本 + @(atUids 必须是群成员,否则 prepare 会拒)
|
|
15
|
+
*/
|
|
16
|
+
import { basename } from 'node:path';
|
|
17
|
+
import { meetingValidationError } from '../errors.js';
|
|
18
|
+
import { meetingSuccess } from './types.js';
|
|
19
|
+
/** 分隔成员:中英文逗号、顿号、分号、空白都认 */
|
|
20
|
+
function splitList(raw) {
|
|
21
|
+
return String(raw ?? '')
|
|
22
|
+
.split(/[,,、;;\s]+/)
|
|
23
|
+
.map((item) => item.trim())
|
|
24
|
+
.filter((item) => item !== '');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 跑一次 IM 两段式(prepare → apply),返回 apply 的结果。
|
|
28
|
+
* 失败不抛,交给调用方决定是"整体失败"还是"只留 warning"。
|
|
29
|
+
*/
|
|
30
|
+
async function runImWrite(imEnv, prepareName, applyName, input) {
|
|
31
|
+
const { getImOperation } = await import('../../im/operations/registry.js');
|
|
32
|
+
const prepared = await getImOperation(prepareName).handler(input, imEnv);
|
|
33
|
+
const continuation = String(prepared?.continuation ?? prepared?.data?.continuation ?? '');
|
|
34
|
+
if (!continuation) {
|
|
35
|
+
return {
|
|
36
|
+
ok: false,
|
|
37
|
+
data: {},
|
|
38
|
+
error: String(prepared?.error?.message ?? '未拿到 continuation(prepare 未通过)').slice(0, 200),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const applied = await getImOperation(applyName).handler({ continuation, confirm: true }, imEnv);
|
|
42
|
+
return {
|
|
43
|
+
ok: applied?.ok === true,
|
|
44
|
+
data: (applied?.data ?? {}),
|
|
45
|
+
error: String(applied?.error?.message ?? '').slice(0, 200),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export const groupShareOperations = [
|
|
49
|
+
{
|
|
50
|
+
name: 'meeting.group.shareMinutes',
|
|
51
|
+
resource: 'meeting',
|
|
52
|
+
method: 'group.shareMinutes',
|
|
53
|
+
action: 'meeting.group.shareMinutes',
|
|
54
|
+
summary: '建会议群并把纪要文档 + 待办发进群(可 @ 具体人):按会议名建群,成员用姓名/工号;'
|
|
55
|
+
+ '已有群时传 group_id 跳过建群。写操作,发送前先让用户确认群名与成员',
|
|
56
|
+
capability: 'minute',
|
|
57
|
+
risk: 'high-risk-write',
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
properties: {
|
|
62
|
+
mt_name: { type: 'string', description: '会议名(群名默认用它,如「AI 趋势讨论会」)' },
|
|
63
|
+
group_name: { type: 'string', description: '群名;不传则用 mt_name 或「会议群-MMDD」' },
|
|
64
|
+
members: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: '群成员:姓名或员工 id,逗号/顿号分隔(如「鲁云聪、王丹丹」);至少要传当前登录人以外的人',
|
|
67
|
+
},
|
|
68
|
+
message: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: '发到群里的开头语(一两句话,如「会议纪要与待办已上传,请按分工推进」)。'
|
|
71
|
+
+ '⛔ 待办不要塞在这串里 —— 用 tasks,否则一堆任务被「;」连成一行,群里看着没有换行',
|
|
72
|
+
},
|
|
73
|
+
tasks: {
|
|
74
|
+
type: 'array',
|
|
75
|
+
description: '待办清单:CLI 拼成「@责任人:事项(期限)」,**一行一条**,并自动把这些责任人加入 @ 列表',
|
|
76
|
+
items: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
properties: {
|
|
79
|
+
owner: { type: 'string', description: '责任人姓名(应在 members 里,否则 @ 不生效)' },
|
|
80
|
+
content: { type: 'string', description: '要做的事' },
|
|
81
|
+
due: { type: 'string', description: '期限或交付物,可省略' },
|
|
82
|
+
},
|
|
83
|
+
required: ['content'],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
file_path: { type: 'string', description: '要发进群的本地文件(通常是纪要 docx 的 filePath)' },
|
|
87
|
+
at_members: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: '@ 谁:姓名或 id,逗号分隔;默认 = members。⛔ 必须是群成员,否则发送会被拒',
|
|
90
|
+
},
|
|
91
|
+
at_all: { type: 'boolean', description: 'true 时 @全体成员(仅文本消息生效)' },
|
|
92
|
+
group_id: { type: 'string', description: '已有群 id:传了就不再建群,直接往里发' },
|
|
93
|
+
dry_run: { type: 'boolean', description: 'true 时只校验成员、返回将要执行的步骤,不真的建群/发送' },
|
|
94
|
+
},
|
|
95
|
+
required: [],
|
|
96
|
+
},
|
|
97
|
+
handler: async (args, env) => {
|
|
98
|
+
const startedAt = Date.now();
|
|
99
|
+
const warnings = [];
|
|
100
|
+
const mtName = String(args.mt_name ?? '').trim();
|
|
101
|
+
let groupName = String(args.group_name ?? '').trim() || mtName;
|
|
102
|
+
const memberTokens = splitList(args.members);
|
|
103
|
+
const filePath = String(args.file_path ?? '').trim();
|
|
104
|
+
const rawMessage = String(args.message ?? '').trim();
|
|
105
|
+
let groupId = String(args.group_id ?? '').trim();
|
|
106
|
+
// 待办按"人 - 事 - 期限"结构化传入,由 CLI 拼成**一行一条**。
|
|
107
|
+
// ⛔ 不能让调用方自己在 message 里拼:模型拼出来的往往是用「;」连成的一整段,
|
|
108
|
+
// IM 里就是一大坨没有换行(用户实测:"任务没有换行,看不清谁负责什么")。
|
|
109
|
+
const rawTasks = Array.isArray(args.tasks) ? args.tasks : [];
|
|
110
|
+
const taskItems = [];
|
|
111
|
+
const taskOwners = [];
|
|
112
|
+
for (const task of rawTasks) {
|
|
113
|
+
const owner = String(task?.owner ?? '').trim();
|
|
114
|
+
const content = String(task?.content ?? task?.task ?? '').trim();
|
|
115
|
+
const due = String(task?.due ?? '').trim();
|
|
116
|
+
if (content === '')
|
|
117
|
+
continue;
|
|
118
|
+
if (owner !== '')
|
|
119
|
+
taskOwners.push(owner);
|
|
120
|
+
taskItems.push({ owner, content, due });
|
|
121
|
+
}
|
|
122
|
+
if (memberTokens.length === 0 && groupId === '') {
|
|
123
|
+
throw meetingValidationError('members_required', '建群至少要给 members(群成员姓名或 id)。只想发消息到已有群就传 group_id');
|
|
124
|
+
}
|
|
125
|
+
if (groupName === '') {
|
|
126
|
+
const now = new Date();
|
|
127
|
+
const mm = String(now.getMonth() + 1).padStart(2, '0');
|
|
128
|
+
const dd = String(now.getDate()).padStart(2, '0');
|
|
129
|
+
groupName = `会议群-${mm}${dd}`;
|
|
130
|
+
}
|
|
131
|
+
// 姓名 → 员工 id(IM 的 uid 就是员工 id)。待办责任人也要解析,否则 @ 不生效
|
|
132
|
+
const { resolvePersonTokens } = await import('./eb/create-flow.js');
|
|
133
|
+
const allTokens = [...new Set([...memberTokens, ...taskOwners])];
|
|
134
|
+
const peopleMap = allTokens.length > 0
|
|
135
|
+
? await resolvePersonTokens(env, allTokens)
|
|
136
|
+
: new Map();
|
|
137
|
+
const resolved = memberTokens.map((token) => peopleMap.get(token)).filter(Boolean);
|
|
138
|
+
const unresolved = memberTokens.filter((token) => !peopleMap.get(token));
|
|
139
|
+
if (unresolved.length > 0) {
|
|
140
|
+
warnings.push(`这些成员没解析到员工 id,已跳过:${unresolved.join('、')}(请核对姓名或直接传 id)`);
|
|
141
|
+
}
|
|
142
|
+
const memberIds = [...new Set(resolved.map((one) => one.id))];
|
|
143
|
+
const memberNames = resolved.map((one) => one.name);
|
|
144
|
+
// ⛔ @ 必须用**解析后的真实姓名**(如「王丹丹(上海)」),不能用调用方传的「王丹丹」:
|
|
145
|
+
// IM 的提及是按姓名精确匹配写进 aus 的,名字差一个字就退化成纯文本「@王丹丹」——
|
|
146
|
+
// 在群里看是一行黑字、点不到人,而且开头还会被补一个孤零零的蓝 @(2026-11-30 实测截图)。
|
|
147
|
+
const displayNameOf = (token) => peopleMap.get(token)?.name ?? token;
|
|
148
|
+
const taskLines = taskItems.map((item) => (`@${item.owner ? displayNameOf(item.owner) : '(未指定)'}:${item.content}${item.due ? `(${item.due})` : ''}`));
|
|
149
|
+
// 开头语里手写的 @原文 也换成真实姓名(模型常写 @王丹丹,组织里实际叫 王丹丹(上海))。
|
|
150
|
+
// 用占位符中转,避免「王丹丹」替换成「王丹丹(上海)」后又被「王丹丹(上海)」那条规则二次替换。
|
|
151
|
+
let headMessage = rawMessage;
|
|
152
|
+
const atSlots = [];
|
|
153
|
+
allTokens.forEach((token, index) => {
|
|
154
|
+
const person = peopleMap.get(token);
|
|
155
|
+
if (!person || person.name === token)
|
|
156
|
+
return;
|
|
157
|
+
if (!headMessage.includes(`@${token}`))
|
|
158
|
+
return;
|
|
159
|
+
const slot = `\u0000AT${index}\u0000`;
|
|
160
|
+
headMessage = headMessage.split(`@${token}`).join(slot);
|
|
161
|
+
atSlots.push({ slot, name: person.name });
|
|
162
|
+
});
|
|
163
|
+
for (const { slot, name } of atSlots)
|
|
164
|
+
headMessage = headMessage.split(slot).join(`@${name}`);
|
|
165
|
+
const message = [headMessage, ...taskLines].filter((line) => line !== '').join('\n');
|
|
166
|
+
// ⛔ IM 侧规则:不准建"不含自己"的群(实测报 `self_not_included`)——
|
|
167
|
+
// 建群成员里自动补上当前登录人,@ 列表不补(不 @ 自己)。
|
|
168
|
+
let selfId = '';
|
|
169
|
+
let selfName = '';
|
|
170
|
+
try {
|
|
171
|
+
const session = await env.host.getSession();
|
|
172
|
+
selfId = String(session?.userId ?? '').trim();
|
|
173
|
+
selfName = String(session?.employeeName ?? session?.name ?? session?.userName ?? '').trim();
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
selfId = '';
|
|
177
|
+
selfName = '';
|
|
178
|
+
}
|
|
179
|
+
const addSelf = selfId !== '' && !memberIds.includes(selfId);
|
|
180
|
+
const createUsers = addSelf ? [selfId, ...memberIds] : memberIds;
|
|
181
|
+
// ⛔ names 必须与 users 一一对应(实测 `names_mismatch`):补了自己就把名字也补在前面
|
|
182
|
+
const createNames = addSelf ? [selfName, ...memberNames] : memberNames;
|
|
183
|
+
const { buildImEnv } = await import('./eb/group-chat.js');
|
|
184
|
+
const imEnv = await buildImEnv(env);
|
|
185
|
+
const steps = [];
|
|
186
|
+
if (args.dry_run === true) {
|
|
187
|
+
return meetingSuccess('meeting.group.shareMinutes', {
|
|
188
|
+
dryRun: true,
|
|
189
|
+
groupName,
|
|
190
|
+
groupId: groupId || null,
|
|
191
|
+
members: memberNames,
|
|
192
|
+
willSendFile: filePath || null,
|
|
193
|
+
willSendText: message || null,
|
|
194
|
+
steps: [
|
|
195
|
+
groupId ? '跳过建群(已给 group_id)' : `建群「${groupName}」,成员 ${memberNames.join('、') || '(空)'}`,
|
|
196
|
+
filePath ? `发纪要文件:${basename(filePath)}` : '不发文件(未传 file_path)',
|
|
197
|
+
message ? '发文本(含 @ 提及)' : '不发文本(未传 message)',
|
|
198
|
+
],
|
|
199
|
+
}, { warnings });
|
|
200
|
+
}
|
|
201
|
+
// ① 建群(没给 group_id 才建)
|
|
202
|
+
if (!groupId) {
|
|
203
|
+
const created = await runImWrite(imEnv, 'im.group.create.prepare', 'im.group.create.apply', {
|
|
204
|
+
users: createUsers,
|
|
205
|
+
...(createNames.length > 0 ? { names: createNames } : {}),
|
|
206
|
+
name: groupName,
|
|
207
|
+
});
|
|
208
|
+
const newId = String(created.data?.groupId ?? created.data?.id ?? '');
|
|
209
|
+
if (!created.ok || newId === '') {
|
|
210
|
+
throw meetingValidationError('group_create_failed', `建群失败:${created.error || '未返回群 id'}。`
|
|
211
|
+
+ '这类失败通常是租户没开 IM 建群权限或成员不在同一组织 —— 如实告诉用户,不要改口说"已建群"');
|
|
212
|
+
}
|
|
213
|
+
groupId = newId;
|
|
214
|
+
steps.push({ step: 'createGroup', ok: true, detail: `群 id ${groupId}(${groupName})` });
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
steps.push({ step: 'createGroup', ok: true, detail: `复用已有群 ${groupId}` });
|
|
218
|
+
}
|
|
219
|
+
// ② 发纪要文件:⛔ 只传 file,不带 txt —— 同传时服务端只落文本、文件被丢
|
|
220
|
+
if (filePath) {
|
|
221
|
+
const sent = await runImWrite(imEnv, 'im.msg.send.group.prepare', 'im.msg.send.group.apply', {
|
|
222
|
+
groupId,
|
|
223
|
+
file: filePath,
|
|
224
|
+
});
|
|
225
|
+
steps.push({ step: 'sendFile', ok: sent.ok, detail: sent.ok ? basename(filePath) : sent.error });
|
|
226
|
+
if (!sent.ok)
|
|
227
|
+
warnings.push(`纪要文件没发进群(${sent.error});文件在本地,可手动转发`);
|
|
228
|
+
}
|
|
229
|
+
// ③ 发文本 + @:atUids 只取"确实是群成员"的人,否则 prepare 会拒发
|
|
230
|
+
if (message) {
|
|
231
|
+
// @ 候选:显式 at_members > 待办责任人 + 群成员(责任人排前面,保证任务那几行都能真 @ 到)
|
|
232
|
+
// 显式 at_members 一律尊重;否则只 @ 文本里**真正出现**的人 ——
|
|
233
|
+
// 文本里没提的人被前置成「@某某」会显得莫名其妙(IM 会把未匹配的 aus 条目补到开头)。
|
|
234
|
+
const explicitAt = splitList(args.at_members);
|
|
235
|
+
const atTokens = explicitAt.length > 0
|
|
236
|
+
? explicitAt
|
|
237
|
+
: [...new Set([...taskOwners, ...memberTokens].filter((token) => message.includes(`@${displayNameOf(token)}`)))];
|
|
238
|
+
const atResolved = atTokens
|
|
239
|
+
.map((token) => peopleMap.get(token))
|
|
240
|
+
.filter(Boolean);
|
|
241
|
+
const atIds = [...new Set(atResolved.map((one) => one.id))].filter((id) => memberIds.includes(id));
|
|
242
|
+
const dropped = atResolved.filter((one) => !memberIds.includes(one.id)).map((one) => one.name);
|
|
243
|
+
if (dropped.length > 0) {
|
|
244
|
+
warnings.push(`这些人不在群里,@ 不生效(已从 atUids 去掉):${dropped.join('、')}`);
|
|
245
|
+
}
|
|
246
|
+
const sent = await runImWrite(imEnv, 'im.msg.send.group.prepare', 'im.msg.send.group.apply', {
|
|
247
|
+
groupId,
|
|
248
|
+
txt: message,
|
|
249
|
+
...(args.at_all === true ? { atAll: true } : {}),
|
|
250
|
+
...(atIds.length > 0 ? { atUids: atIds } : {}),
|
|
251
|
+
});
|
|
252
|
+
steps.push({ step: 'sendText', ok: sent.ok, detail: sent.ok ? `@ ${atIds.length} 人` : sent.error });
|
|
253
|
+
if (!sent.ok)
|
|
254
|
+
warnings.push(`文本没发进群(${sent.error})`);
|
|
255
|
+
}
|
|
256
|
+
const failed = steps.filter((step) => !step.ok);
|
|
257
|
+
return meetingSuccess('meeting.group.shareMinutes', {
|
|
258
|
+
groupId,
|
|
259
|
+
groupName,
|
|
260
|
+
members: memberNames,
|
|
261
|
+
atCount: steps.find((step) => step.step === 'sendText')?.detail ?? '',
|
|
262
|
+
steps,
|
|
263
|
+
durationMs: Date.now() - startedAt,
|
|
264
|
+
...(failed.length === 0 ? { status: 'SENT' } : { status: 'PARTIAL' }),
|
|
265
|
+
}, { warnings });
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
];
|