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
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
continuationReplayError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HP7JIYMT.js";
|
|
6
6
|
import {
|
|
7
7
|
CLARIFICATION_SUBTYPE,
|
|
8
8
|
WorkflowCliError,
|
|
@@ -12,19 +12,23 @@ import {
|
|
|
12
12
|
workflowPartialError,
|
|
13
13
|
workflowPolicyError,
|
|
14
14
|
workflowValidationError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WRXSAVKO.js";
|
|
16
16
|
import {
|
|
17
17
|
stringifyForStdout
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-727FH2NI.js";
|
|
19
19
|
import {
|
|
20
20
|
stateRoot
|
|
21
21
|
} from "./chunk-AJ62BGAW.js";
|
|
22
|
+
import {
|
|
23
|
+
CONTINUATION_TTL_MS,
|
|
24
|
+
CONTINUATION_TTL_SECONDS
|
|
25
|
+
} from "./chunk-7BDPM5ST.js";
|
|
22
26
|
import {
|
|
23
27
|
E10_REAUTH_GUIDANCE,
|
|
24
28
|
createFetchTimingSink,
|
|
25
29
|
hasXiaoEEnv,
|
|
26
30
|
runWithFetchTiming
|
|
27
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-U6R6FZHD.js";
|
|
28
32
|
|
|
29
33
|
// src/shortcuts/workflow/operations/form.ts
|
|
30
34
|
import { randomUUID } from "node:crypto";
|
|
@@ -5150,7 +5154,6 @@ var SYSTEM_FIELD_KEYS = {
|
|
|
5150
5154
|
SECLEVEL: "\u5BC6\u7EA7"
|
|
5151
5155
|
};
|
|
5152
5156
|
var ATTACH_SIZE_LIMIT_STEPS_MB = [1, 5, 10, 20, 50, 100];
|
|
5153
|
-
var CONTINUATION_TTL_MS = 10 * 60 * 1e3;
|
|
5154
5157
|
var READ_WHOLE_OUTPUT_HINT = "\u8BFB\u53D6\u672C\u8F93\u51FA\u8BF7\u4E00\u6B21\u8BFB\u5B8C\uFF1A\u4E0D\u8981\u7528 head/tail \u7B49\u7BA1\u9053\u622A\u65AD\uFF08\u622A\u65AD\u4F1A\u7834\u574F JSON\uFF0C\u5E76\u5BFC\u81F4\u91CD\u590D\u6267\u884C\u540C\u4E00\u6761\u547D\u4EE4\uFF09\u3002";
|
|
5155
5158
|
var CREATE_FORM_STDOUT_SAFE_CHARS = 2e4;
|
|
5156
5159
|
var DURATION_RESERVE_SENTINEL = 99999999;
|
|
@@ -8264,6 +8267,7 @@ var XIAOE_FILL_FORM_SDK_OPTIONS = {
|
|
|
8264
8267
|
var XIAOE_INITIAL_VALUES_MULTI_SEPARATOR = ",";
|
|
8265
8268
|
var XIAOE_INITIAL_VALUES_ROW_SEPARATOR = ";";
|
|
8266
8269
|
var XIAOE_BROWSER_ID_PREFIX = "##";
|
|
8270
|
+
var XIAOE_INITIAL_COVERT_NAME = 1;
|
|
8267
8271
|
function xiaoEUrlParamScalar(value, prefixBrowserId = false) {
|
|
8268
8272
|
if (value === null || value === void 0) return "";
|
|
8269
8273
|
if (typeof value === "object") {
|
|
@@ -8357,6 +8361,9 @@ function xiaoESrcFieldQuery(params) {
|
|
|
8357
8361
|
}
|
|
8358
8362
|
return query;
|
|
8359
8363
|
}
|
|
8364
|
+
function xiaoEEncodeSrcHash(src) {
|
|
8365
|
+
return src.replace(/#/gu, "%23");
|
|
8366
|
+
}
|
|
8360
8367
|
function renderXiaoEFillFormMarkdown(params) {
|
|
8361
8368
|
const base = String(params.baseUrl ?? "").replace(/\/+$/u, "");
|
|
8362
8369
|
const workflowId = String(params.workflowId ?? "").trim();
|
|
@@ -8368,7 +8375,10 @@ function renderXiaoEFillFormMarkdown(params) {
|
|
|
8368
8375
|
arguments: {
|
|
8369
8376
|
type: "e10",
|
|
8370
8377
|
title: String(params.title ?? ""),
|
|
8371
|
-
|
|
8378
|
+
// `#` 一律转义成 `%23`(2026-11-05 用户裁定):`##<id>` 前缀与用户填的 `#` 都会被当成片段起始符。
|
|
8379
|
+
src: xiaoEEncodeSrcHash(
|
|
8380
|
+
`${base}/sp/workflow${createPath}?workflowId=${workflowId}&isCreate=1&initialCovertName=${XIAOE_INITIAL_COVERT_NAME}${xiaoESrcFieldQuery(params.customParams)}`
|
|
8381
|
+
),
|
|
8372
8382
|
sdkOptions: {
|
|
8373
8383
|
compName: XIAOE_FILL_FORM_SDK_OPTIONS.compName,
|
|
8374
8384
|
routerType: XIAOE_FILL_FORM_SDK_OPTIONS.routerType,
|
|
@@ -8378,9 +8388,10 @@ function renderXiaoEFillFormMarkdown(params) {
|
|
|
8378
8388
|
params_mobile: { ...XIAOE_FILL_FORM_SDK_OPTIONS.params_mobile },
|
|
8379
8389
|
params: {
|
|
8380
8390
|
customParams: {
|
|
8381
|
-
// 字段 id → 值(要填写的字段及值),随后是这次要填的**全部字段 id
|
|
8391
|
+
// 字段 id → 值(要填写的字段及值),随后是这次要填的**全部字段 id** 与自定义标识。
|
|
8382
8392
|
...params.customParams.values,
|
|
8383
|
-
fieldAssignKeys: params.customParams.keys.join(",")
|
|
8393
|
+
fieldAssignKeys: params.customParams.keys.join(","),
|
|
8394
|
+
initialCovertName: XIAOE_INITIAL_COVERT_NAME
|
|
8384
8395
|
}
|
|
8385
8396
|
}
|
|
8386
8397
|
}
|
|
@@ -10075,6 +10086,36 @@ function renderMarkdown(params) {
|
|
|
10075
10086
|
}
|
|
10076
10087
|
return lines.join("\n");
|
|
10077
10088
|
}
|
|
10089
|
+
var COLLECT_FILTER_KEYS = [
|
|
10090
|
+
"tabid",
|
|
10091
|
+
"tabName",
|
|
10092
|
+
"subCategory",
|
|
10093
|
+
"isremarks",
|
|
10094
|
+
"workflow",
|
|
10095
|
+
"workflowTerm",
|
|
10096
|
+
"creator",
|
|
10097
|
+
"creatorDept",
|
|
10098
|
+
"creatorSubcom",
|
|
10099
|
+
"workflowType",
|
|
10100
|
+
"requestName",
|
|
10101
|
+
"requestNameTerm",
|
|
10102
|
+
"requestMark",
|
|
10103
|
+
"requestMarkTerm",
|
|
10104
|
+
"requestLevel",
|
|
10105
|
+
"nodeId",
|
|
10106
|
+
"nodeIdTerm",
|
|
10107
|
+
"flowStatus",
|
|
10108
|
+
"flowStatusTerm",
|
|
10109
|
+
"requestId",
|
|
10110
|
+
"exRequestId",
|
|
10111
|
+
"createTime",
|
|
10112
|
+
"operateTime",
|
|
10113
|
+
"receiveTime",
|
|
10114
|
+
"finishTime",
|
|
10115
|
+
"filterFields",
|
|
10116
|
+
"conditionType"
|
|
10117
|
+
];
|
|
10118
|
+
var COLLECT_ORDER_KEYS = ["sort"];
|
|
10078
10119
|
var ALLOWED_INPUT_KEYS = [
|
|
10079
10120
|
"stage",
|
|
10080
10121
|
"items",
|
|
@@ -10098,15 +10139,8 @@ var ALLOWED_INPUT_KEYS = [
|
|
|
10098
10139
|
"limit",
|
|
10099
10140
|
"pageSize",
|
|
10100
10141
|
"category",
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
"subCategory",
|
|
10104
|
-
"isremarks",
|
|
10105
|
-
"workflow",
|
|
10106
|
-
"creator",
|
|
10107
|
-
"requestName",
|
|
10108
|
-
"receiveTime",
|
|
10109
|
-
"requestLevel",
|
|
10142
|
+
...COLLECT_FILTER_KEYS,
|
|
10143
|
+
...COLLECT_ORDER_KEYS,
|
|
10110
10144
|
"skillTiming"
|
|
10111
10145
|
];
|
|
10112
10146
|
var RESUME_INPUT_KEYS = [
|
|
@@ -10212,9 +10246,18 @@ function groupKeyOf(row, groupBy) {
|
|
|
10212
10246
|
function stripDisplayHtml(value) {
|
|
10213
10247
|
return value.replace(/<[^>]*>/gu, " ").replace(/ /gu, " ").replace(/\s+/gu, " ").trim();
|
|
10214
10248
|
}
|
|
10215
|
-
function rowFromAny(raw) {
|
|
10249
|
+
function rowFromAny(raw, extraFields) {
|
|
10216
10250
|
const record = asRecord(raw);
|
|
10217
10251
|
if (!record) return void 0;
|
|
10252
|
+
let rawFields;
|
|
10253
|
+
if (extraFields && extraFields.size > 0) {
|
|
10254
|
+
for (const [key, value] of Object.entries(record)) {
|
|
10255
|
+
if (!extraFields.has(key.toLowerCase())) continue;
|
|
10256
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") continue;
|
|
10257
|
+
rawFields ??= {};
|
|
10258
|
+
rawFields[key] = value;
|
|
10259
|
+
}
|
|
10260
|
+
}
|
|
10218
10261
|
const pick = (keys, sanitize = false) => {
|
|
10219
10262
|
for (const key of keys) {
|
|
10220
10263
|
const value = record[key];
|
|
@@ -10237,7 +10280,7 @@ function rowFromAny(raw) {
|
|
|
10237
10280
|
}
|
|
10238
10281
|
return 0;
|
|
10239
10282
|
};
|
|
10240
|
-
|
|
10283
|
+
const result = {
|
|
10241
10284
|
requestId: pick(["requestId", "requestid", "request_id", "id"]) ?? "",
|
|
10242
10285
|
workflowId: pick(["workflowId", "workflowid", "workflowtype"]) ?? "",
|
|
10243
10286
|
userMasterId: pick(["userMasterId", "usermasterid", "userid"]) ?? "",
|
|
@@ -10269,6 +10312,14 @@ function rowFromAny(raw) {
|
|
|
10269
10312
|
requestMark: pick(["requestMark", "requestmark"]),
|
|
10270
10313
|
amount: parseAmount(record.amount ?? record.money ?? record.totalAmount ?? record.totalamount ?? record.sum ?? record.fee)
|
|
10271
10314
|
};
|
|
10315
|
+
if (rawFields) {
|
|
10316
|
+
const mapped = new Set(Object.keys(result).map((key) => key.toLowerCase()));
|
|
10317
|
+
const rest = Object.fromEntries(
|
|
10318
|
+
Object.entries(rawFields).filter(([key]) => !mapped.has(key.toLowerCase()))
|
|
10319
|
+
);
|
|
10320
|
+
if (Object.keys(rest).length > 0) result._rawFields = rest;
|
|
10321
|
+
}
|
|
10322
|
+
return result;
|
|
10272
10323
|
}
|
|
10273
10324
|
function assertKnownKeys(args) {
|
|
10274
10325
|
const known = [...ALLOWED_INPUT_KEYS, ...RESUME_INPUT_KEYS];
|
|
@@ -10509,6 +10560,462 @@ async function openSummaryCache(ctx) {
|
|
|
10509
10560
|
return cache;
|
|
10510
10561
|
}
|
|
10511
10562
|
|
|
10563
|
+
// src/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.ts
|
|
10564
|
+
var PriorityExprError = class extends Error {
|
|
10565
|
+
position;
|
|
10566
|
+
constructor(message, position) {
|
|
10567
|
+
super(`${message}\uFF08\u7B2C ${position + 1} \u4E2A\u5B57\u7B26\uFF09`);
|
|
10568
|
+
this.name = "PriorityExprError";
|
|
10569
|
+
this.position = position;
|
|
10570
|
+
}
|
|
10571
|
+
};
|
|
10572
|
+
var OP_TOKENS = [">=", "<=", "!=", "==", "=", ">", "<", "+", "-"];
|
|
10573
|
+
function isIdentChar(char) {
|
|
10574
|
+
return /[A-Za-z0-9_.\u4e00-\u9fa5]/u.test(char);
|
|
10575
|
+
}
|
|
10576
|
+
function tokenize(source) {
|
|
10577
|
+
const tokens = [];
|
|
10578
|
+
let index = 0;
|
|
10579
|
+
while (index < source.length) {
|
|
10580
|
+
const char = source[index];
|
|
10581
|
+
if (/\s/u.test(char)) {
|
|
10582
|
+
index += 1;
|
|
10583
|
+
continue;
|
|
10584
|
+
}
|
|
10585
|
+
if (char === "(") {
|
|
10586
|
+
tokens.push({ type: "lparen", value: char, pos: index });
|
|
10587
|
+
index += 1;
|
|
10588
|
+
continue;
|
|
10589
|
+
}
|
|
10590
|
+
if (char === ")") {
|
|
10591
|
+
tokens.push({ type: "rparen", value: char, pos: index });
|
|
10592
|
+
index += 1;
|
|
10593
|
+
continue;
|
|
10594
|
+
}
|
|
10595
|
+
if (char === ",") {
|
|
10596
|
+
tokens.push({ type: "comma", value: char, pos: index });
|
|
10597
|
+
index += 1;
|
|
10598
|
+
continue;
|
|
10599
|
+
}
|
|
10600
|
+
if (char === "'" || char === '"') {
|
|
10601
|
+
const quote = char;
|
|
10602
|
+
const start = index;
|
|
10603
|
+
index += 1;
|
|
10604
|
+
let text = "";
|
|
10605
|
+
while (index < source.length && source[index] !== quote) {
|
|
10606
|
+
if (source[index] === "\\" && index + 1 < source.length) {
|
|
10607
|
+
text += source[index + 1];
|
|
10608
|
+
index += 2;
|
|
10609
|
+
continue;
|
|
10610
|
+
}
|
|
10611
|
+
text += source[index];
|
|
10612
|
+
index += 1;
|
|
10613
|
+
}
|
|
10614
|
+
if (index >= source.length) throw new PriorityExprError("\u5B57\u7B26\u4E32\u7F3A\u5C11\u7ED3\u675F\u5F15\u53F7", start);
|
|
10615
|
+
index += 1;
|
|
10616
|
+
tokens.push({ type: "string", value: text, pos: start });
|
|
10617
|
+
continue;
|
|
10618
|
+
}
|
|
10619
|
+
const opToken = OP_TOKENS.find((token) => source.startsWith(token, index));
|
|
10620
|
+
if (opToken) {
|
|
10621
|
+
tokens.push({ type: "op", value: opToken, pos: index });
|
|
10622
|
+
index += opToken.length;
|
|
10623
|
+
continue;
|
|
10624
|
+
}
|
|
10625
|
+
if (/\d/u.test(char)) {
|
|
10626
|
+
const start = index;
|
|
10627
|
+
while (index < source.length && /[\d.]/u.test(source[index])) index += 1;
|
|
10628
|
+
const text = source.slice(start, index);
|
|
10629
|
+
if (!/^\d+(?:\.\d+)?$/u.test(text)) throw new PriorityExprError(`\u6570\u5B57\u5199\u6CD5\u4E0D\u5408\u6CD5\uFF1A\u300C${text}\u300D`, start);
|
|
10630
|
+
tokens.push({ type: "number", value: text, pos: start });
|
|
10631
|
+
continue;
|
|
10632
|
+
}
|
|
10633
|
+
if (isIdentChar(char)) {
|
|
10634
|
+
const start = index;
|
|
10635
|
+
while (index < source.length && isIdentChar(source[index])) index += 1;
|
|
10636
|
+
tokens.push({ type: "ident", value: source.slice(start, index), pos: start });
|
|
10637
|
+
continue;
|
|
10638
|
+
}
|
|
10639
|
+
throw new PriorityExprError(`\u65E0\u6CD5\u8BC6\u522B\u7684\u5B57\u7B26\u300C${char}\u300D`, index);
|
|
10640
|
+
}
|
|
10641
|
+
return tokens;
|
|
10642
|
+
}
|
|
10643
|
+
function keywordOf(token) {
|
|
10644
|
+
if (token.type !== "ident") return null;
|
|
10645
|
+
const text = token.value.toLowerCase();
|
|
10646
|
+
const map = {
|
|
10647
|
+
and: "and",
|
|
10648
|
+
"\u4E14": "and",
|
|
10649
|
+
or: "or",
|
|
10650
|
+
"\u6216": "or",
|
|
10651
|
+
not: "not",
|
|
10652
|
+
"\u975E": "not",
|
|
10653
|
+
in: "in",
|
|
10654
|
+
"\u5C5E\u4E8E": "in",
|
|
10655
|
+
true: "true",
|
|
10656
|
+
"false": "false",
|
|
10657
|
+
"\u4ECA\u5929": "today",
|
|
10658
|
+
"\u6628\u5929": "yesterday",
|
|
10659
|
+
"\u660E\u5929": "tomorrow",
|
|
10660
|
+
"\u5305\u542B": "contains",
|
|
10661
|
+
"\u4E0D\u5305\u542B": "notContains",
|
|
10662
|
+
"\u4E3A\u7A7A": "isEmpty",
|
|
10663
|
+
"\u4E0D\u4E3A\u7A7A": "isNotEmpty"
|
|
10664
|
+
};
|
|
10665
|
+
return map[text] ?? null;
|
|
10666
|
+
}
|
|
10667
|
+
var Parser = class {
|
|
10668
|
+
tokens;
|
|
10669
|
+
source;
|
|
10670
|
+
index = 0;
|
|
10671
|
+
constructor(source) {
|
|
10672
|
+
this.source = source;
|
|
10673
|
+
this.tokens = tokenize(source);
|
|
10674
|
+
}
|
|
10675
|
+
parse() {
|
|
10676
|
+
if (this.tokens.length === 0) throw new PriorityExprError("\u89C4\u5219\u8868\u8FBE\u5F0F\u4E0D\u80FD\u4E3A\u7A7A", 0);
|
|
10677
|
+
const expr = this.parseOr();
|
|
10678
|
+
const rest = this.peek();
|
|
10679
|
+
if (rest) throw new PriorityExprError(`\u591A\u4F59\u7684\u5185\u5BB9\u300C${this.source.slice(rest.pos)}\u300D`, rest.pos);
|
|
10680
|
+
return expr;
|
|
10681
|
+
}
|
|
10682
|
+
peek() {
|
|
10683
|
+
return this.tokens[this.index];
|
|
10684
|
+
}
|
|
10685
|
+
next() {
|
|
10686
|
+
const token = this.tokens[this.index];
|
|
10687
|
+
if (!token) {
|
|
10688
|
+
const end = this.tokens[this.tokens.length - 1]?.pos ?? 0;
|
|
10689
|
+
throw new PriorityExprError("\u8868\u8FBE\u5F0F\u5728\u6B64\u5904\u610F\u5916\u7ED3\u675F", end);
|
|
10690
|
+
}
|
|
10691
|
+
this.index += 1;
|
|
10692
|
+
return token;
|
|
10693
|
+
}
|
|
10694
|
+
matchKeyword(word) {
|
|
10695
|
+
const token = this.peek();
|
|
10696
|
+
if (token && keywordOf(token) === word) {
|
|
10697
|
+
this.index += 1;
|
|
10698
|
+
return true;
|
|
10699
|
+
}
|
|
10700
|
+
return false;
|
|
10701
|
+
}
|
|
10702
|
+
parseOr() {
|
|
10703
|
+
const children = [this.parseAnd()];
|
|
10704
|
+
while (this.matchKeyword("or")) children.push(this.parseAnd());
|
|
10705
|
+
return children.length === 1 ? children[0] : { kind: "or", children };
|
|
10706
|
+
}
|
|
10707
|
+
parseAnd() {
|
|
10708
|
+
const children = [this.parseNot()];
|
|
10709
|
+
while (this.matchKeyword("and")) children.push(this.parseNot());
|
|
10710
|
+
return children.length === 1 ? children[0] : { kind: "and", children };
|
|
10711
|
+
}
|
|
10712
|
+
parseNot() {
|
|
10713
|
+
if (this.matchKeyword("not")) return { kind: "not", child: this.parseNot() };
|
|
10714
|
+
return this.parseAtom();
|
|
10715
|
+
}
|
|
10716
|
+
parseAtom() {
|
|
10717
|
+
const token = this.peek();
|
|
10718
|
+
if (!token) {
|
|
10719
|
+
const end = this.tokens[this.tokens.length - 1]?.pos ?? 0;
|
|
10720
|
+
throw new PriorityExprError("\u8868\u8FBE\u5F0F\u5728\u6B64\u5904\u610F\u5916\u7ED3\u675F", end);
|
|
10721
|
+
}
|
|
10722
|
+
if (token.type === "lparen") {
|
|
10723
|
+
this.index += 1;
|
|
10724
|
+
const inner = this.parseOr();
|
|
10725
|
+
const close = this.peek();
|
|
10726
|
+
if (!close || close.type !== "rparen") throw new PriorityExprError("\u62EC\u53F7\u6CA1\u6709\u95ED\u5408", token.pos);
|
|
10727
|
+
this.index += 1;
|
|
10728
|
+
return inner;
|
|
10729
|
+
}
|
|
10730
|
+
return this.parseCondition();
|
|
10731
|
+
}
|
|
10732
|
+
parseCondition() {
|
|
10733
|
+
const start = this.peek();
|
|
10734
|
+
if (!start) throw new PriorityExprError("\u7F3A\u5C11\u5B57\u6BB5\u540D", 0);
|
|
10735
|
+
if (keywordOf(start)) {
|
|
10736
|
+
throw new PriorityExprError(`\u300C${start.value}\u300D\u662F\u5173\u952E\u5B57\uFF0C\u6B64\u5904\u5E94\u4E3A\u5B57\u6BB5\u540D`, start.pos);
|
|
10737
|
+
}
|
|
10738
|
+
if (start.type !== "ident" && start.type !== "number") {
|
|
10739
|
+
throw new PriorityExprError(`\u6B64\u5904\u5E94\u4E3A\u5B57\u6BB5\u540D\uFF0C\u6536\u5230\u300C${start.value}\u300D`, start.pos);
|
|
10740
|
+
}
|
|
10741
|
+
this.index += 1;
|
|
10742
|
+
const field = start.value;
|
|
10743
|
+
const opToken = this.peek();
|
|
10744
|
+
if (!opToken) throw new PriorityExprError(`\u5B57\u6BB5\u300C${field}\u300D\u540E\u9762\u7F3A\u5C11\u6BD4\u8F83\u7B26`, start.pos);
|
|
10745
|
+
let op;
|
|
10746
|
+
if (opToken.type === "op") {
|
|
10747
|
+
this.index += 1;
|
|
10748
|
+
const map = {
|
|
10749
|
+
"=": "eq",
|
|
10750
|
+
"==": "eq",
|
|
10751
|
+
"!=": "ne",
|
|
10752
|
+
">": "gt",
|
|
10753
|
+
">=": "gte",
|
|
10754
|
+
"<": "lt",
|
|
10755
|
+
"<=": "lte"
|
|
10756
|
+
};
|
|
10757
|
+
const mapped = map[opToken.value];
|
|
10758
|
+
if (!mapped) {
|
|
10759
|
+
throw new PriorityExprError(`\u6BD4\u8F83\u7B26\u300C${opToken.value}\u300D\u4E0D\u5408\u6CD5\uFF08\u53EF\u7528\uFF1A= != > >= < <= \u5305\u542B \u4E0D\u5305\u542B in not in \u4E3A\u7A7A \u4E0D\u4E3A\u7A7A\uFF09`, opToken.pos);
|
|
10760
|
+
}
|
|
10761
|
+
op = mapped;
|
|
10762
|
+
} else if (keywordOf(opToken) === "not" && this.tokens[this.index + 1] && keywordOf(this.tokens[this.index + 1]) === "in") {
|
|
10763
|
+
this.index += 2;
|
|
10764
|
+
op = "notIn";
|
|
10765
|
+
} else {
|
|
10766
|
+
const keyword = keywordOf(opToken);
|
|
10767
|
+
const map = {
|
|
10768
|
+
in: "in",
|
|
10769
|
+
contains: "contains",
|
|
10770
|
+
notContains: "notContains",
|
|
10771
|
+
isEmpty: "isEmpty",
|
|
10772
|
+
isNotEmpty: "isNotEmpty"
|
|
10773
|
+
};
|
|
10774
|
+
if (!keyword || !(keyword in map)) {
|
|
10775
|
+
throw new PriorityExprError(`\u5B57\u6BB5\u300C${field}\u300D\u540E\u9762\u7684\u6BD4\u8F83\u7B26\u300C${opToken.value}\u300D\u4E0D\u652F\u6301`, opToken.pos);
|
|
10776
|
+
}
|
|
10777
|
+
this.index += 1;
|
|
10778
|
+
op = map[keyword];
|
|
10779
|
+
}
|
|
10780
|
+
const text = this.source.slice(start.pos, this.tokens[Math.max(0, this.index - 1)].pos + String(this.tokens[Math.max(0, this.index - 1)].value).length);
|
|
10781
|
+
if (op === "isEmpty" || op === "isNotEmpty") return { kind: "condition", field, op, text };
|
|
10782
|
+
const operand = this.parseOperand(op === "in" || op === "notIn");
|
|
10783
|
+
return { kind: "condition", field, op, operand, text };
|
|
10784
|
+
}
|
|
10785
|
+
parseOperand(isList) {
|
|
10786
|
+
if (isList) {
|
|
10787
|
+
const open = this.peek();
|
|
10788
|
+
if (!open || open.type !== "lparen") {
|
|
10789
|
+
throw new PriorityExprError("in / not in \u540E\u9762\u5FC5\u987B\u662F\u62EC\u53F7\u5217\u8868\uFF0C\u5982 (20, 21, 30)", open?.pos ?? 0);
|
|
10790
|
+
}
|
|
10791
|
+
this.index += 1;
|
|
10792
|
+
const items = [];
|
|
10793
|
+
for (; ; ) {
|
|
10794
|
+
items.push(this.parseScalarLiteral());
|
|
10795
|
+
const token = this.peek();
|
|
10796
|
+
if (token && token.type === "comma") {
|
|
10797
|
+
this.index += 1;
|
|
10798
|
+
continue;
|
|
10799
|
+
}
|
|
10800
|
+
if (token && token.type === "rparen") {
|
|
10801
|
+
this.index += 1;
|
|
10802
|
+
break;
|
|
10803
|
+
}
|
|
10804
|
+
throw new PriorityExprError("\u5217\u8868\u7F3A\u5C11\u53F3\u62EC\u53F7", token?.pos ?? 0);
|
|
10805
|
+
}
|
|
10806
|
+
if (items.length === 0) throw new PriorityExprError("\u5217\u8868\u4E0D\u80FD\u4E3A\u7A7A", open.pos);
|
|
10807
|
+
return { kind: "list", items };
|
|
10808
|
+
}
|
|
10809
|
+
return this.parseScalarLiteral();
|
|
10810
|
+
}
|
|
10811
|
+
parseScalarLiteral() {
|
|
10812
|
+
const token = this.next();
|
|
10813
|
+
if (token.type === "number") return { kind: "number", value: Number(token.value) };
|
|
10814
|
+
if (token.type === "string") return { kind: "string", value: token.value };
|
|
10815
|
+
const keyword = keywordOf(token);
|
|
10816
|
+
if (keyword === "true") return { kind: "boolean", value: true };
|
|
10817
|
+
if (keyword === "false") return { kind: "boolean", value: false };
|
|
10818
|
+
if (keyword === "today") return this.parseDateOffset("\u4ECA\u5929");
|
|
10819
|
+
if (keyword === "yesterday") return this.parseDateOffset("\u6628\u5929");
|
|
10820
|
+
if (keyword === "tomorrow") return this.parseDateOffset("\u660E\u5929");
|
|
10821
|
+
throw new PriorityExprError(
|
|
10822
|
+
`\u300C${token.value}\u300D\u4E0D\u662F\u5408\u6CD5\u53D6\u503C\uFF1A\u5B57\u7B26\u4E32\u8BF7\u52A0\u5F15\u53F7\uFF08\u5982 '\u5DF2\u8D85\u65F6'\uFF09\uFF0C\u65E5\u671F\u53EF\u7528 \u4ECA\u5929 / \u6628\u5929 / \u660E\u5929\uFF0C\u6216\u7528 \u4ECA\u5929+1\u5929 / \u4ECA\u5929-3\u5929 \u505A\u504F\u79FB`,
|
|
10823
|
+
token.pos
|
|
10824
|
+
);
|
|
10825
|
+
}
|
|
10826
|
+
/**
|
|
10827
|
+
* 日期字面量的可选天数偏移(2026-11-05 用户定:`今天+n天` 调规则,n 可正可负)。
|
|
10828
|
+
*
|
|
10829
|
+
* 写法:`今天` / `今天+1天` / `今天-3天` / `今天+2`(`天` 可省;空格随意)。
|
|
10830
|
+
* 只算到「日」,时分秒在求值阶段整体忽略。
|
|
10831
|
+
*/
|
|
10832
|
+
parseDateOffset(base) {
|
|
10833
|
+
const token = this.peek();
|
|
10834
|
+
if (!token || token.type !== "op" || token.value !== "+" && token.value !== "-") {
|
|
10835
|
+
return { kind: "date", value: base, offsetDays: 0 };
|
|
10836
|
+
}
|
|
10837
|
+
this.index += 1;
|
|
10838
|
+
const num = this.next();
|
|
10839
|
+
if (num.type !== "number" || !/^\d+$/u.test(num.value)) {
|
|
10840
|
+
throw new PriorityExprError("\u65E5\u671F\u504F\u79FB\u5FC5\u987B\u662F\u6574\u6570\u5929\u6570\uFF0C\u5982 \u4ECA\u5929+1\u5929 / \u4ECA\u5929-3\u5929", num.pos);
|
|
10841
|
+
}
|
|
10842
|
+
const tail = this.peek();
|
|
10843
|
+
if (tail && tail.type === "ident" && tail.value === "\u5929") this.index += 1;
|
|
10844
|
+
const days = Number(num.value);
|
|
10845
|
+
return { kind: "date", value: base, offsetDays: token.value === "-" ? -days : days };
|
|
10846
|
+
}
|
|
10847
|
+
};
|
|
10848
|
+
function parsePriorityRule(source) {
|
|
10849
|
+
return new Parser(source).parse();
|
|
10850
|
+
}
|
|
10851
|
+
function collectPriorityFields(expr, into = /* @__PURE__ */ new Set()) {
|
|
10852
|
+
switch (expr.kind) {
|
|
10853
|
+
case "and":
|
|
10854
|
+
case "or":
|
|
10855
|
+
for (const child of expr.children) collectPriorityFields(child, into);
|
|
10856
|
+
break;
|
|
10857
|
+
case "not":
|
|
10858
|
+
collectPriorityFields(expr.child, into);
|
|
10859
|
+
break;
|
|
10860
|
+
case "condition":
|
|
10861
|
+
into.add(expr.field.toLowerCase());
|
|
10862
|
+
break;
|
|
10863
|
+
}
|
|
10864
|
+
return into;
|
|
10865
|
+
}
|
|
10866
|
+
var YEAR_WINDOW_MS = 180 * 24 * 60 * 60 * 1e3;
|
|
10867
|
+
function parseDateYmd(value, now) {
|
|
10868
|
+
const text = String(value ?? "").trim();
|
|
10869
|
+
if (!text) return null;
|
|
10870
|
+
const full = /^(\d{4})[-/](\d{1,2})[-/](\d{1,2})/u.exec(text);
|
|
10871
|
+
if (full) {
|
|
10872
|
+
const [, y, m, d] = full;
|
|
10873
|
+
const stamp = new Date(Number(y), Number(m) - 1, Number(d));
|
|
10874
|
+
if (Number.isNaN(stamp.getTime())) return null;
|
|
10875
|
+
return { key: stamp.getTime() };
|
|
10876
|
+
}
|
|
10877
|
+
const short = /^(\d{1,2})[-/](\d{1,2})/u.exec(text);
|
|
10878
|
+
if (short) {
|
|
10879
|
+
const [, m, d] = short;
|
|
10880
|
+
const month = Number(m);
|
|
10881
|
+
const day = Number(d);
|
|
10882
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) return null;
|
|
10883
|
+
let stamp = new Date(now.getFullYear(), month - 1, day).getTime();
|
|
10884
|
+
if (stamp - now.getTime() > YEAR_WINDOW_MS) {
|
|
10885
|
+
stamp = new Date(now.getFullYear() - 1, month - 1, day).getTime();
|
|
10886
|
+
}
|
|
10887
|
+
return { key: stamp };
|
|
10888
|
+
}
|
|
10889
|
+
return null;
|
|
10890
|
+
}
|
|
10891
|
+
function dateTokenYmd(which, offsetDays, now) {
|
|
10892
|
+
const base = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
10893
|
+
const baseOffset = which === "\u6628\u5929" ? -1 : which === "\u660E\u5929" ? 1 : 0;
|
|
10894
|
+
base.setDate(base.getDate() + baseOffset + offsetDays);
|
|
10895
|
+
return base.getTime();
|
|
10896
|
+
}
|
|
10897
|
+
function asNumber(value) {
|
|
10898
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
10899
|
+
const text = String(value ?? "").trim();
|
|
10900
|
+
if (!text) return null;
|
|
10901
|
+
const parsed = Number(text);
|
|
10902
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
10903
|
+
}
|
|
10904
|
+
function asBoolean(value) {
|
|
10905
|
+
if (typeof value === "boolean") return value;
|
|
10906
|
+
const text = String(value ?? "").trim().toLowerCase();
|
|
10907
|
+
if (text === "true" || text === "1" || text === "\u662F") return true;
|
|
10908
|
+
if (text === "false" || text === "0" || text === "\u5426") return false;
|
|
10909
|
+
return null;
|
|
10910
|
+
}
|
|
10911
|
+
function isEmptyValue(value) {
|
|
10912
|
+
return value === void 0 || value === null || String(value).trim() === "";
|
|
10913
|
+
}
|
|
10914
|
+
function evaluateCondition(condition, raw, now) {
|
|
10915
|
+
if (condition.op === "isEmpty") return isEmptyValue(raw);
|
|
10916
|
+
if (condition.op === "isNotEmpty") return !isEmptyValue(raw);
|
|
10917
|
+
if (isEmptyValue(raw)) return false;
|
|
10918
|
+
const operand = condition.operand;
|
|
10919
|
+
if (!operand) return false;
|
|
10920
|
+
switch (condition.op) {
|
|
10921
|
+
case "contains":
|
|
10922
|
+
return String(raw).includes(String(operand.kind === "list" ? "" : operand.value));
|
|
10923
|
+
case "notContains":
|
|
10924
|
+
return !String(raw).includes(String(operand.kind === "list" ? "" : operand.value));
|
|
10925
|
+
case "in":
|
|
10926
|
+
case "notIn": {
|
|
10927
|
+
if (operand.kind !== "list") return false;
|
|
10928
|
+
const left = String(raw).trim();
|
|
10929
|
+
const hit = operand.items.some((item) => String(item.kind === "list" ? "" : item.value).trim() === left);
|
|
10930
|
+
return condition.op === "in" ? hit : !hit;
|
|
10931
|
+
}
|
|
10932
|
+
default:
|
|
10933
|
+
break;
|
|
10934
|
+
}
|
|
10935
|
+
if (operand.kind === "date") {
|
|
10936
|
+
const left = parseDateYmd(raw, now);
|
|
10937
|
+
if (!left) return false;
|
|
10938
|
+
const right = dateTokenYmd(operand.value, operand.offsetDays, now);
|
|
10939
|
+
switch (condition.op) {
|
|
10940
|
+
case "eq":
|
|
10941
|
+
return left.key === right;
|
|
10942
|
+
case "ne":
|
|
10943
|
+
return left.key !== right;
|
|
10944
|
+
case "gt":
|
|
10945
|
+
return left.key > right;
|
|
10946
|
+
case "gte":
|
|
10947
|
+
return left.key >= right;
|
|
10948
|
+
case "lt":
|
|
10949
|
+
return left.key < right;
|
|
10950
|
+
case "lte":
|
|
10951
|
+
return left.key <= right;
|
|
10952
|
+
default:
|
|
10953
|
+
return false;
|
|
10954
|
+
}
|
|
10955
|
+
}
|
|
10956
|
+
if (operand.kind === "number") {
|
|
10957
|
+
const left = asNumber(raw);
|
|
10958
|
+
if (left === null) return false;
|
|
10959
|
+
const right = operand.value;
|
|
10960
|
+
switch (condition.op) {
|
|
10961
|
+
case "eq":
|
|
10962
|
+
return left === right;
|
|
10963
|
+
case "ne":
|
|
10964
|
+
return left !== right;
|
|
10965
|
+
case "gt":
|
|
10966
|
+
return left > right;
|
|
10967
|
+
case "gte":
|
|
10968
|
+
return left >= right;
|
|
10969
|
+
case "lt":
|
|
10970
|
+
return left < right;
|
|
10971
|
+
case "lte":
|
|
10972
|
+
return left <= right;
|
|
10973
|
+
default:
|
|
10974
|
+
return false;
|
|
10975
|
+
}
|
|
10976
|
+
}
|
|
10977
|
+
if (operand.kind === "boolean") {
|
|
10978
|
+
const left = asBoolean(raw);
|
|
10979
|
+
if (left === null) return false;
|
|
10980
|
+
if (condition.op === "eq") return left === operand.value;
|
|
10981
|
+
if (condition.op === "ne") return left !== operand.value;
|
|
10982
|
+
return false;
|
|
10983
|
+
}
|
|
10984
|
+
if (operand.kind === "string") {
|
|
10985
|
+
const left = String(raw).trim();
|
|
10986
|
+
const right = operand.value.trim();
|
|
10987
|
+
switch (condition.op) {
|
|
10988
|
+
case "eq":
|
|
10989
|
+
return left === right;
|
|
10990
|
+
case "ne":
|
|
10991
|
+
return left !== right;
|
|
10992
|
+
case "gt":
|
|
10993
|
+
return left > right;
|
|
10994
|
+
case "gte":
|
|
10995
|
+
return left >= right;
|
|
10996
|
+
case "lt":
|
|
10997
|
+
return left < right;
|
|
10998
|
+
case "lte":
|
|
10999
|
+
return left <= right;
|
|
11000
|
+
default:
|
|
11001
|
+
return false;
|
|
11002
|
+
}
|
|
11003
|
+
}
|
|
11004
|
+
return false;
|
|
11005
|
+
}
|
|
11006
|
+
function evaluatePriorityRule(expr, resolve3, now = /* @__PURE__ */ new Date()) {
|
|
11007
|
+
switch (expr.kind) {
|
|
11008
|
+
case "and":
|
|
11009
|
+
return expr.children.every((child) => evaluatePriorityRule(child, resolve3, now));
|
|
11010
|
+
case "or":
|
|
11011
|
+
return expr.children.some((child) => evaluatePriorityRule(child, resolve3, now));
|
|
11012
|
+
case "not":
|
|
11013
|
+
return !evaluatePriorityRule(expr.child, resolve3, now);
|
|
11014
|
+
case "condition":
|
|
11015
|
+
return evaluateCondition(expr, resolve3(expr.field), now);
|
|
11016
|
+
}
|
|
11017
|
+
}
|
|
11018
|
+
|
|
10512
11019
|
// src/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.ts
|
|
10513
11020
|
var AIGROUP_DIR_NAME = "aigroup";
|
|
10514
11021
|
var DEFAULT_RULE_FILE = "default.json";
|
|
@@ -10526,6 +11033,17 @@ var FOCUS_OPERATORS = [
|
|
|
10526
11033
|
"\u5305\u542B"
|
|
10527
11034
|
];
|
|
10528
11035
|
var MAX_GROUPING_PROMPT_CHARS = 500;
|
|
11036
|
+
var PRIORITY_SORT_PATTERN = /^([A-Za-z_][A-Za-z0-9_]*)(?:\s+(asc|desc))?$/i;
|
|
11037
|
+
function parsePrioritySort(raw) {
|
|
11038
|
+
const list = typeof raw === "string" ? [raw] : Array.isArray(raw) ? raw : [];
|
|
11039
|
+
const keys = [];
|
|
11040
|
+
for (const item of list) {
|
|
11041
|
+
const matched = PRIORITY_SORT_PATTERN.exec(String(item ?? "").trim());
|
|
11042
|
+
if (!matched) continue;
|
|
11043
|
+
keys.push({ field: matched[1], dir: matched[2]?.toLowerCase() === "desc" ? "desc" : "asc" });
|
|
11044
|
+
}
|
|
11045
|
+
return keys;
|
|
11046
|
+
}
|
|
10529
11047
|
var EMPTY_GROUP_RULE = { focus: false };
|
|
10530
11048
|
var FALLBACK_DEFAULTS = {
|
|
10531
11049
|
weight: 999,
|
|
@@ -10608,10 +11126,38 @@ function validateRuleFile(raw) {
|
|
|
10608
11126
|
if (priority.title !== void 0 && (typeof priority.title !== "string" || !priority.title.trim())) {
|
|
10609
11127
|
errors.push("generalRules.priorityGroup.title \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");
|
|
10610
11128
|
}
|
|
10611
|
-
if (priority.
|
|
10612
|
-
const
|
|
10613
|
-
if (!Array.isArray(
|
|
10614
|
-
errors.push(
|
|
11129
|
+
if (priority.sort !== void 0) {
|
|
11130
|
+
const list = typeof priority.sort === "string" ? [priority.sort] : priority.sort;
|
|
11131
|
+
if (!Array.isArray(list) || list.length === 0) {
|
|
11132
|
+
errors.push('generalRules.priorityGroup.sort \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5982 ["userOverTime asc", "requestLevel desc"]');
|
|
11133
|
+
} else {
|
|
11134
|
+
for (const item of list) {
|
|
11135
|
+
if (typeof item !== "string" || !PRIORITY_SORT_PATTERN.test(item.trim())) {
|
|
11136
|
+
errors.push(
|
|
11137
|
+
`generalRules.priorityGroup.sort \u7684\u300C${String(item)}\u300D\u683C\u5F0F\u4E0D\u5BF9\uFF1A\u6BCF\u9879\u5199\u6210\u300C\u5B57\u6BB5\u540D + \u7A7A\u683C + asc|desc\u300D\uFF08\u65B9\u5411\u53EF\u7701\uFF0C\u9ED8\u8BA4 asc\uFF09`
|
|
11138
|
+
);
|
|
11139
|
+
}
|
|
11140
|
+
}
|
|
11141
|
+
}
|
|
11142
|
+
}
|
|
11143
|
+
const legacyKeys = ["rules", "excludeIsremarks"].filter(
|
|
11144
|
+
(key) => priority[key] !== void 0
|
|
11145
|
+
);
|
|
11146
|
+
if (legacyKeys.length > 0) {
|
|
11147
|
+
errors.push(
|
|
11148
|
+
`generalRules.priorityGroup.${legacyKeys.join(" / ")} \u5DF2\u5E9F\u5F03\uFF082026-11-05 \u8D77\u7531 rule \u8868\u8FBE\u5F0F\u53D6\u4EE3\uFF09\uFF0C\u8BF7\u628A\u53E3\u5F84\u5199\u8FDB rule`
|
|
11149
|
+
);
|
|
11150
|
+
}
|
|
11151
|
+
if (priority.rule !== void 0) {
|
|
11152
|
+
if (typeof priority.rule !== "string" || !priority.rule.trim()) {
|
|
11153
|
+
errors.push("generalRules.priorityGroup.rule \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\uFF08\u4E0D\u542F\u7528\u8BF7\u5220\u6389\u8FD9\u4E2A\u952E\uFF09");
|
|
11154
|
+
} else {
|
|
11155
|
+
try {
|
|
11156
|
+
parsePriorityRule(priority.rule);
|
|
11157
|
+
} catch (error) {
|
|
11158
|
+
const detail = error instanceof PriorityExprError ? error.message : error.message;
|
|
11159
|
+
errors.push(`generalRules.priorityGroup.rule \u8BED\u6CD5\u9519\u8BEF\uFF1A${detail}`);
|
|
11160
|
+
}
|
|
10615
11161
|
}
|
|
10616
11162
|
}
|
|
10617
11163
|
}
|
|
@@ -10855,7 +11401,7 @@ function compare(a, b) {
|
|
|
10855
11401
|
}
|
|
10856
11402
|
return null;
|
|
10857
11403
|
}
|
|
10858
|
-
function
|
|
11404
|
+
function evaluateCondition2(condition, actual, now = /* @__PURE__ */ new Date()) {
|
|
10859
11405
|
const [metric, op, expected, upper] = condition;
|
|
10860
11406
|
const left = comparableOf(actual, now);
|
|
10861
11407
|
if (!left) return false;
|
|
@@ -10899,7 +11445,7 @@ function evaluateCondition(condition, actual, now = /* @__PURE__ */ new Date())
|
|
|
10899
11445
|
}
|
|
10900
11446
|
function evaluateFocusKeywords(conditions, resolve3, now = /* @__PURE__ */ new Date()) {
|
|
10901
11447
|
if (conditions.length === 0) return false;
|
|
10902
|
-
return conditions.every((condition) =>
|
|
11448
|
+
return conditions.every((condition) => evaluateCondition2(condition, resolve3(condition[0]), now));
|
|
10903
11449
|
}
|
|
10904
11450
|
var activeFile = null;
|
|
10905
11451
|
var activeDir = null;
|
|
@@ -10925,9 +11471,33 @@ function activeRuleFor(workflowName) {
|
|
|
10925
11471
|
function generalRules() {
|
|
10926
11472
|
return activeRules().generalRules ?? null;
|
|
10927
11473
|
}
|
|
11474
|
+
var priorityExprCache = null;
|
|
11475
|
+
function priorityRuleSource() {
|
|
11476
|
+
const source = generalRules()?.priorityGroup?.rule?.trim();
|
|
11477
|
+
return source ? source : null;
|
|
11478
|
+
}
|
|
11479
|
+
function priorityRuleExpr() {
|
|
11480
|
+
const source = priorityRuleSource();
|
|
11481
|
+
if (!source) {
|
|
11482
|
+
priorityExprCache = null;
|
|
11483
|
+
return null;
|
|
11484
|
+
}
|
|
11485
|
+
if (priorityExprCache && priorityExprCache.source === source) return priorityExprCache.expr;
|
|
11486
|
+
const expr = parsePriorityRule(source);
|
|
11487
|
+
priorityExprCache = { source, expr };
|
|
11488
|
+
return expr;
|
|
11489
|
+
}
|
|
11490
|
+
function priorityRuleFields() {
|
|
11491
|
+
const expr = priorityRuleExpr();
|
|
11492
|
+
return expr ? collectPriorityFields(expr) : /* @__PURE__ */ new Set();
|
|
11493
|
+
}
|
|
11494
|
+
function prioritySort() {
|
|
11495
|
+
return parsePrioritySort(generalRules()?.priorityGroup?.sort);
|
|
11496
|
+
}
|
|
10928
11497
|
function resetActiveRules() {
|
|
10929
11498
|
activeFile = null;
|
|
10930
11499
|
activeDir = null;
|
|
11500
|
+
priorityExprCache = null;
|
|
10931
11501
|
}
|
|
10932
11502
|
function excludeFieldsFor(workflowName) {
|
|
10933
11503
|
return activeRuleFor(workflowName)?.excludeOriginFormDataFields ?? [];
|
|
@@ -10981,13 +11551,19 @@ var DISPLAY_ROW_FIELDS = [
|
|
|
10981
11551
|
"operatedatetime",
|
|
10982
11552
|
// 最后反馈时间:`getTodoListData.displayData` 里的原始键是全小写,大小写变体一并保留。
|
|
10983
11553
|
"lastfeedbackdatetime",
|
|
10984
|
-
"lastFeedbackDateTime"
|
|
11554
|
+
"lastFeedbackDateTime",
|
|
11555
|
+
// 计划完成时间(2026-11-05 补):接口原始键是**驼峰** `planFinishDatetime`,且与
|
|
11556
|
+
// `minOverDateTime` / `curUserOverTime` 三者同值(实测 5 条:`2026-11-06 14:21:23`)。
|
|
11557
|
+
// 之前漏在白名单外 ⇒ `rowFromAny` 虽然写了 pick 也永远取不到,优先组规则想按到期时间判断就成了空谈。
|
|
11558
|
+
"planFinishDatetime",
|
|
11559
|
+
"planfinishdatetime"
|
|
10985
11560
|
];
|
|
10986
|
-
function projectDisplayRows(response) {
|
|
11561
|
+
function projectDisplayRows(response, extraFields) {
|
|
10987
11562
|
const record = responseData(response);
|
|
10988
11563
|
const raw = record?.data?.displayData ?? record?.displayData ?? [];
|
|
10989
11564
|
const rows = Array.isArray(raw) ? raw : [];
|
|
10990
11565
|
const projected = [];
|
|
11566
|
+
const extra = extraFields && extraFields.size > 0 ? extraFields : null;
|
|
10991
11567
|
for (const row of rows) {
|
|
10992
11568
|
if (!row || typeof row !== "object" || Array.isArray(row)) continue;
|
|
10993
11569
|
const source = row;
|
|
@@ -10998,6 +11574,15 @@ function projectDisplayRows(response) {
|
|
|
10998
11574
|
picked[key] = value;
|
|
10999
11575
|
}
|
|
11000
11576
|
}
|
|
11577
|
+
if (extra) {
|
|
11578
|
+
for (const [key, value] of Object.entries(source)) {
|
|
11579
|
+
if (key in picked) continue;
|
|
11580
|
+
if (!extra.has(key.toLowerCase())) continue;
|
|
11581
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
11582
|
+
picked[key] = value;
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
}
|
|
11001
11586
|
if (Object.keys(picked).length > 0) projected.push(picked);
|
|
11002
11587
|
}
|
|
11003
11588
|
return projected;
|
|
@@ -11690,44 +12275,106 @@ function isExpiringTodayRow(row, now = Date.now()) {
|
|
|
11690
12275
|
if (row.overTime) return false;
|
|
11691
12276
|
return isExpiringTodayUserOverTime(row.userOverTime, now);
|
|
11692
12277
|
}
|
|
11693
|
-
function
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
12278
|
+
function sameField(key, field) {
|
|
12279
|
+
return key.toLowerCase() === field.toLowerCase();
|
|
12280
|
+
}
|
|
12281
|
+
function resolveRuleField(row, field) {
|
|
12282
|
+
for (const [key, value] of Object.entries(row)) {
|
|
12283
|
+
if (key === "_rawFields") continue;
|
|
12284
|
+
if (sameField(key, field)) return value;
|
|
11698
12285
|
}
|
|
11699
|
-
const
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
12286
|
+
const raw = row._rawFields;
|
|
12287
|
+
if (raw) {
|
|
12288
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
12289
|
+
if (sameField(key, field)) return value;
|
|
12290
|
+
}
|
|
12291
|
+
}
|
|
12292
|
+
return void 0;
|
|
12293
|
+
}
|
|
12294
|
+
function selectPriorityRows(rows, expr, now = /* @__PURE__ */ new Date()) {
|
|
12295
|
+
if (!expr) return { rows: [], evaluatedCount: 0 };
|
|
12296
|
+
const selected = rows.filter((row) => evaluatePriorityRule(expr, (field) => resolveRuleField(row, field), now));
|
|
12297
|
+
return { rows: selected, evaluatedCount: rows.length };
|
|
12298
|
+
}
|
|
12299
|
+
var DEFAULT_PRIORITY_SORT = [{ field: "receivedatetime", dir: "asc" }];
|
|
12300
|
+
var SORT_FIELD_LABEL = {
|
|
12301
|
+
userovertime: "\u5230\u671F\u65F6\u95F4(userOverTime)",
|
|
12302
|
+
curuserovertime: "\u5230\u671F\u65F6\u95F4(curUserOverTime)",
|
|
12303
|
+
requestlevel: "\u7D27\u6025\u7A0B\u5EA6(requestLevel)",
|
|
12304
|
+
receivedatetime: "\u63A5\u6536\u65F6\u95F4(receivedatetime)",
|
|
12305
|
+
receivedtime: "\u63A5\u6536\u65F6\u95F4(receivedTime)",
|
|
12306
|
+
planfinishdatetime: "\u8BA1\u5212\u5B8C\u6210\u65F6\u95F4"
|
|
12307
|
+
};
|
|
12308
|
+
function isTimeSortField(field) {
|
|
12309
|
+
const key = field.toLowerCase();
|
|
12310
|
+
return key.endsWith("datetime") || key.endsWith("time") || key.endsWith("date");
|
|
12311
|
+
}
|
|
12312
|
+
var HALF_YEAR_MS = 180 * 24 * 60 * 60 * 1e3;
|
|
12313
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
12314
|
+
function startOfDay(stamp) {
|
|
12315
|
+
const date = new Date(stamp);
|
|
12316
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
12317
|
+
}
|
|
12318
|
+
function monthDayStamp(month, day, now) {
|
|
12319
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) return void 0;
|
|
12320
|
+
const base = new Date(now);
|
|
12321
|
+
let stamp = new Date(base.getFullYear(), month - 1, day).getTime();
|
|
12322
|
+
if (stamp - now > HALF_YEAR_MS) stamp = new Date(base.getFullYear() - 1, month - 1, day).getTime();
|
|
12323
|
+
return stamp;
|
|
12324
|
+
}
|
|
12325
|
+
function prioritySortStamp(text, now = Date.now()) {
|
|
12326
|
+
const value = text.trim();
|
|
12327
|
+
if (!value) return void 0;
|
|
12328
|
+
if (/^已超时$/u.test(value)) return 0;
|
|
12329
|
+
if (/^昨天到期$/u.test(value)) return startOfDay(now) - DAY_MS;
|
|
12330
|
+
if (/^今日到期$/u.test(value)) return startOfDay(now);
|
|
12331
|
+
if (/^明天到期$/u.test(value)) return startOfDay(now) + DAY_MS;
|
|
12332
|
+
const monthDay = /^(\d{1,2})[-/](\d{1,2})\s*到期$/u.exec(value);
|
|
12333
|
+
if (monthDay) return monthDayStamp(Number(monthDay[1]), Number(monthDay[2]), now);
|
|
12334
|
+
return timeOf(value);
|
|
12335
|
+
}
|
|
12336
|
+
function sortValueOf(row, key, now) {
|
|
12337
|
+
const raw = resolveRuleField(row, key.field);
|
|
12338
|
+
if (raw === void 0 || raw === null) return null;
|
|
12339
|
+
if (typeof raw === "boolean") return { kind: "num", value: raw ? 1 : 0 };
|
|
12340
|
+
if (typeof raw === "number") return Number.isFinite(raw) ? { kind: "num", value: raw } : null;
|
|
12341
|
+
const text = String(raw).trim();
|
|
12342
|
+
if (!text) return null;
|
|
12343
|
+
if (isTimeSortField(key.field)) {
|
|
12344
|
+
const stamp = prioritySortStamp(text, now);
|
|
12345
|
+
return stamp === void 0 ? null : { kind: "num", value: stamp };
|
|
12346
|
+
}
|
|
12347
|
+
return { kind: "str", value: text };
|
|
12348
|
+
}
|
|
12349
|
+
function compareSortValue(a, b, dir) {
|
|
12350
|
+
if (!a && !b) return 0;
|
|
12351
|
+
if (!a) return 1;
|
|
12352
|
+
if (!b) return -1;
|
|
12353
|
+
const diff = a.kind === "num" && b.kind === "num" ? a.value - b.value : String(a.value).localeCompare(String(b.value), "zh-Hans-CN");
|
|
12354
|
+
return dir === "desc" ? -diff : diff;
|
|
12355
|
+
}
|
|
12356
|
+
function configuredPrioritySort() {
|
|
12357
|
+
const configured = prioritySort();
|
|
12358
|
+
return configured.length > 0 ? configured : DEFAULT_PRIORITY_SORT;
|
|
12359
|
+
}
|
|
12360
|
+
function describePrioritySort(keys) {
|
|
12361
|
+
return keys.map((key) => `${SORT_FIELD_LABEL[key.field.toLowerCase()] ?? key.field} ${key.dir === "desc" ? "\u964D\u5E8F" : "\u5347\u5E8F"}`).join(" \u2192 ");
|
|
12362
|
+
}
|
|
12363
|
+
function sortPriorityRows(rows, keys = configuredPrioritySort(), now = Date.now()) {
|
|
12364
|
+
const effective = keys.length > 0 ? keys : DEFAULT_PRIORITY_SORT;
|
|
11721
12365
|
return [...rows].sort((a, b) => {
|
|
11722
|
-
const
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
if (at !== bt) return at - bt;
|
|
12366
|
+
for (const key of effective) {
|
|
12367
|
+
const diff = compareSortValue(sortValueOf(a, key, now), sortValueOf(b, key, now), key.dir);
|
|
12368
|
+
if (diff !== 0) return diff;
|
|
12369
|
+
}
|
|
11727
12370
|
return a.requestId.localeCompare(b.requestId);
|
|
11728
12371
|
});
|
|
11729
12372
|
}
|
|
11730
12373
|
function toRequestData(row) {
|
|
12374
|
+
const rawFields = {
|
|
12375
|
+
...row.receivedTime ? { receivedatetime: row.receivedTime } : {},
|
|
12376
|
+
...row._rawFields ?? {}
|
|
12377
|
+
};
|
|
11731
12378
|
return {
|
|
11732
12379
|
requestId: row.requestId,
|
|
11733
12380
|
workflowId: row.workflowId,
|
|
@@ -11743,7 +12390,11 @@ function toRequestData(row) {
|
|
|
11743
12390
|
createrName: row.createrName,
|
|
11744
12391
|
lastFeedBackDateTime: row.lastFeedBackDateTime,
|
|
11745
12392
|
...row.planFinishDatetime ? { planFinishDatetime: row.planFinishDatetime } : {},
|
|
11746
|
-
summary: row.summary ?? ""
|
|
12393
|
+
summary: row.summary ?? "",
|
|
12394
|
+
// 2026-11-05:**总是**写这个键(哪怕是空对象)。它是「还没剥离」的标记,
|
|
12395
|
+
// 最后一步靠「有没有这个键」区分「数据里没这个字段」和「字段已被上一阶段剥掉」。
|
|
12396
|
+
// 只在有字段时写,会让前者被误判成后者,优先组直接不重建。
|
|
12397
|
+
_rawFields: rawFields
|
|
11747
12398
|
};
|
|
11748
12399
|
}
|
|
11749
12400
|
function statsOf(rows) {
|
|
@@ -11927,12 +12578,13 @@ function runGroup(args) {
|
|
|
11927
12578
|
var DEFAULT_REQUEST_SUMMARY_MAX = 50;
|
|
11928
12579
|
async function collectRawTodos(args, env) {
|
|
11929
12580
|
const category = readCategory(args.category);
|
|
12581
|
+
const priorityFields = priorityRuleFields();
|
|
11930
12582
|
const { limit, cappedFrom } = readFetchLimit(args.limit);
|
|
11931
12583
|
const pageSize = readPageSize(limit);
|
|
11932
12584
|
const plannedPages = Math.max(1, Math.min(Math.ceil(limit / pageSize), MAX_FETCH_PAGES));
|
|
11933
12585
|
const listEnv = guardListOnlyHost(env);
|
|
11934
12586
|
const searchArgs = { category };
|
|
11935
|
-
for (const key of [
|
|
12587
|
+
for (const key of [...COLLECT_FILTER_KEYS, ...COLLECT_ORDER_KEYS]) {
|
|
11936
12588
|
const value = args[key];
|
|
11937
12589
|
if (value !== void 0 && value !== null && value !== "") searchArgs[key] = value;
|
|
11938
12590
|
}
|
|
@@ -11959,6 +12611,12 @@ async function collectRawTodos(args, env) {
|
|
|
11959
12611
|
`\u5355\u9875\u6761\u6570\u5DF2\u6309 limit \u63A8\u5BFC\u4E3A ${pageSize}\uFF08\u6700\u591A ${MAX_FETCH_PAGES} \u6B21\u8BF7\u6C42\uFF09\uFF0C\u5FFD\u7565\u4F20\u5165\u7684 pageSize=${String(requestedPageSize)}`
|
|
11960
12612
|
);
|
|
11961
12613
|
}
|
|
12614
|
+
const sortText = String(searchArgs.sort ?? "").trim();
|
|
12615
|
+
if (sortText) {
|
|
12616
|
+
warnings.push(
|
|
12617
|
+
`\u5DF2\u6309\u81EA\u5B9A\u4E49\u6392\u5E8F\u53D6\u6570\uFF08sort=${sortText}\uFF09\uFF1B\u8DE8\u9875\u6309 requestId \u53BB\u91CD\uFF0C\u6392\u5E8F\u952E\u540C\u503C\u8F83\u591A\u65F6\u76F8\u90BB\u9875\u53EF\u80FD\u91CD\u590D\u6216\u6F0F\u9879\uFF0C\u5EFA\u8BAE\u914D\u5408\u65F6\u95F4 / \u5DE5\u4F5C\u6D41\u6761\u4EF6\u7F29\u5C0F\u8303\u56F4`
|
|
12618
|
+
);
|
|
12619
|
+
}
|
|
11962
12620
|
const seen = /* @__PURE__ */ new Set();
|
|
11963
12621
|
const items = [];
|
|
11964
12622
|
let duplicateCount = 0;
|
|
@@ -11992,6 +12650,15 @@ async function collectRawTodos(args, env) {
|
|
|
11992
12650
|
body: query
|
|
11993
12651
|
});
|
|
11994
12652
|
pages += 1;
|
|
12653
|
+
if (process.env.WEAVER_WORK_CLI_DUMP_LIST_RESP) {
|
|
12654
|
+
try {
|
|
12655
|
+
writeFileSync(
|
|
12656
|
+
join3(tmpdir2(), `weaver-list-resp-page${pageNo}.json`),
|
|
12657
|
+
JSON.stringify(response, null, 2)
|
|
12658
|
+
);
|
|
12659
|
+
} catch {
|
|
12660
|
+
}
|
|
12661
|
+
}
|
|
11995
12662
|
if (totalAvailable === null) {
|
|
11996
12663
|
const record = responseData(response);
|
|
11997
12664
|
const candidates = [record?.data?.total, record?.data?.totalCount, record?.total, record?.totalCount];
|
|
@@ -12003,7 +12670,7 @@ async function collectRawTodos(args, env) {
|
|
|
12003
12670
|
}
|
|
12004
12671
|
}
|
|
12005
12672
|
}
|
|
12006
|
-
const pageRows = projectDisplayRows(response).map((row) => rowFromAny(row)).filter((row) => row !== void 0);
|
|
12673
|
+
const pageRows = projectDisplayRows(response, priorityFields).map((row) => rowFromAny(row, priorityFields)).filter((row) => row !== void 0);
|
|
12007
12674
|
if (pageRows.length === 0) {
|
|
12008
12675
|
stoppedEarly = true;
|
|
12009
12676
|
break;
|
|
@@ -12234,8 +12901,10 @@ async function collectRawTodos(args, env) {
|
|
|
12234
12901
|
totalAvailable,
|
|
12235
12902
|
/** 取数只用了这一个接口(照实写出来,便于核对「有没有偷偷调别的」) */
|
|
12236
12903
|
endpoint: listPath,
|
|
12904
|
+
/** 自定义排序原文(不在 filters 里:它是排序不是筛选条件) */
|
|
12905
|
+
...sortText ? { sort: sortText } : {},
|
|
12237
12906
|
filters: Object.fromEntries(
|
|
12238
|
-
Object.entries(searchArgs).filter(([key]) => !["category", "tabid"].includes(key))
|
|
12907
|
+
Object.entries(searchArgs).filter(([key]) => !["category", "tabid", "sort"].includes(key))
|
|
12239
12908
|
)
|
|
12240
12909
|
},
|
|
12241
12910
|
fetched: items.length,
|
|
@@ -12378,19 +13047,25 @@ function rowsOfGroup(group) {
|
|
|
12378
13047
|
function groupItemsOf(group) {
|
|
12379
13048
|
return group.displayItems.filter((item) => item.type === "group");
|
|
12380
13049
|
}
|
|
12381
|
-
function assemblePriorityGroup(groups) {
|
|
12382
|
-
const
|
|
13050
|
+
function assemblePriorityGroup(groups, options = {}) {
|
|
13051
|
+
const all = groups ?? [];
|
|
13052
|
+
const base = all.filter((group) => group.id !== PRIORITY_GROUP_ID && group.topPriority !== true);
|
|
12383
13053
|
const pgConfig = generalRules()?.priorityGroup ?? null;
|
|
12384
13054
|
const title = pgConfig?.title?.trim() || PRIORITY_GROUP_TITLE;
|
|
12385
|
-
const
|
|
13055
|
+
const expr = priorityRuleExpr();
|
|
13056
|
+
if (!expr) return { groups: base };
|
|
12386
13057
|
const rows = base.flatMap((group) => rowsOfGroup(group));
|
|
12387
|
-
if (rows.length === 0) return { groups:
|
|
12388
|
-
const selection = selectPriorityRows(rows,
|
|
12389
|
-
const
|
|
13058
|
+
if (rows.length === 0) return { groups: all };
|
|
13059
|
+
const selection = selectPriorityRows(rows, expr);
|
|
13060
|
+
const sortKeys = configuredPrioritySort();
|
|
13061
|
+
const selected = sortPriorityRows(selection.rows, sortKeys);
|
|
13062
|
+
const strip = options.stripRawFields !== false;
|
|
12390
13063
|
if (selected.length === 0) {
|
|
12391
|
-
return {
|
|
13064
|
+
return {
|
|
13065
|
+
groups: strip ? stripPriorityRawFields(base) : base,
|
|
13066
|
+
warning: `\u300C${title}\u300D\u89C4\u5219\u8868\u8FBE\u5F0F\u672A\u547D\u4E2D\u4EFB\u4F55\u6761\u76EE\uFF08\u5171\u5224\u5B9A ${selection.evaluatedCount} \u6761\uFF09\uFF0C\u6545\u4E0D\u8F93\u51FA\u8BE5\u5206\u7EC4`
|
|
13067
|
+
};
|
|
12392
13068
|
}
|
|
12393
|
-
const levelText = selection.targetLevel === 2 ? "\u7D27\u6025\uFF08requestLevel=2\uFF09" : selection.targetLevel === 1 ? "\u91CD\u8981\uFF08requestLevel=1\uFF1B\u672C\u6B21\u65E0 2 \u7EA7\u6570\u636E\uFF0C\u5DF2\u6309\u89C4\u5219\u964D\u7EA7\u53D6 1\uFF0C0 \u7EA7\u4E0D\u53D6\uFF09" : "\u65E0\u7B49\u7EA7\uFF08\u672C\u6B21\u6574\u6279\u6CA1\u6709 \u22651 \u7EA7\u7684\u6761\u76EE\uFF0C\u53EA\u6309\u8D85\u65F6\u7B5B\uFF09";
|
|
12394
13069
|
const priorityGroup = {
|
|
12395
13070
|
id: PRIORITY_GROUP_ID,
|
|
12396
13071
|
topPriority: true,
|
|
@@ -12402,10 +13077,22 @@ function assemblePriorityGroup(groups) {
|
|
|
12402
13077
|
displayItems: requestItemsOf(selected.map((row) => ({ ...row })))
|
|
12403
13078
|
};
|
|
12404
13079
|
return {
|
|
12405
|
-
groups: [priorityGroup, ...base],
|
|
12406
|
-
warning: `\u300C${title}\u300D\u7B5B\u51FA ${selected.length}
|
|
13080
|
+
groups: strip ? stripPriorityRawFields([priorityGroup, ...base]) : [priorityGroup, ...base],
|
|
13081
|
+
warning: `\u300C${title}\u300D\u6309\u89C4\u5219\u8868\u8FBE\u5F0F\u7B5B\u51FA ${selected.length}/${selection.evaluatedCount} \u6761\uFF08\u7EC4\u5185\u6309 ${describePrioritySort(sortKeys)} \u6392\u5E8F\uFF09\uFF1B\u8FD9 ${selected.length} \u6761\u540C\u65F6\u4FDD\u7559\u5728\u5404\u81EA\u5DE5\u4F5C\u6D41\u5206\u7EC4\u4E2D\uFF08\u53E0\u52A0\u89C6\u56FE\uFF1A\u03A3count \u4F1A\u5927\u4E8E totalCount\uFF0CtotalCount \u6309\u53BB\u91CD\u6761\u6570\u8BA1\uFF09`
|
|
12407
13082
|
};
|
|
12408
13083
|
}
|
|
13084
|
+
function stripPriorityRawFields(groups) {
|
|
13085
|
+
for (const group of groups) {
|
|
13086
|
+
for (const item of group.displayItems) {
|
|
13087
|
+
if (item.type === "request") {
|
|
13088
|
+
delete item.requestData._rawFields;
|
|
13089
|
+
continue;
|
|
13090
|
+
}
|
|
13091
|
+
for (const row of item.requestDatas) delete row._rawFields;
|
|
13092
|
+
}
|
|
13093
|
+
}
|
|
13094
|
+
return groups;
|
|
13095
|
+
}
|
|
12409
13096
|
function readAiGroups(value) {
|
|
12410
13097
|
if (!Array.isArray(value)) {
|
|
12411
13098
|
throw workflowValidationError(
|
|
@@ -13807,11 +14494,39 @@ var inputSchema = schemaOf({
|
|
|
13807
14494
|
tabName: { type: "string" },
|
|
13808
14495
|
subCategory: { type: "string" },
|
|
13809
14496
|
isremarks: { type: "string", description: "\u5907\u6CE8\u7B5B\u9009\uFF08getTodoListData params.isremarks\uFF09\uFF0C\u591A\u4E2A\u6570\u5B57\u7528\u82F1\u6587\u9017\u53F7\u62FC\u63A5\uFF0C\u4EC5\u4F5C\u7528\u4E8E\u672C\u6C47\u603B\u53D6\u6570" },
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
14497
|
+
// 以下筛选条件与 `workflow.search` 逐字对齐(2026-11-06):取数走同一个 buildSearchQuery,
|
|
14498
|
+
// 校验/澄清/报文形态完全一致,只是 search 的查询模式开关(sort/totalOnly/batchType/planJson/queryJson)不在此列。
|
|
14499
|
+
workflow: { type: "array", items: { type: "string" }, description: '\u5DE5\u4F5C\u6D41\u6761\u4EF6\uFF0C\u591A\u4E2A or\uFF1B\u652F\u6301 "\u540D\u79F0(ID)"\uFF1B\u7EAF\u540D\u79F0\u591A\u547D\u4E2D/0 \u547D\u4E2D\u8FD4\u56DE\u6F84\u6E05\u5019\u9009' },
|
|
14500
|
+
workflowTerm: { type: "string", enum: ["in", "notin"] },
|
|
14501
|
+
creator: { type: "string", description: '\u53D1\u8D77\u4EBA\u59D3\u540D\uFF0C\u652F\u6301 "\u540D\u79F0(ID)"\uFF1B\u7EAF\u540D\u79F0\u591A\u547D\u4E2D\u8FD4\u56DE\u6F84\u6E05\u5019\u9009\uFF0C0 \u547D\u4E2D\u62A5\u9519' },
|
|
14502
|
+
creatorDept: { type: "string", description: "\u53D1\u8D77\u4EBA\u90E8\u95E8\uFF1B\u7EAF\u540D\u79F0\u591A\u547D\u4E2D\u8FD4\u56DE\u6F84\u6E05\u5019\u9009\uFF0C0 \u547D\u4E2D\u62A5\u9519" },
|
|
14503
|
+
creatorSubcom: { type: "string", description: "\u53D1\u8D77\u4EBA\u5206\u90E8\uFF1B\u7EAF\u540D\u79F0\u591A\u547D\u4E2D\u8FD4\u56DE\u6F84\u6E05\u5019\u9009\uFF0C0 \u547D\u4E2D\u62A5\u9519" },
|
|
14504
|
+
workflowType: { type: "string", description: "\u5DE5\u4F5C\u6D41\u7C7B\u578B\uFF1B\u7EAF\u540D\u79F0\u591A\u547D\u4E2D\u8FD4\u56DE\u6F84\u6E05\u5019\u9009\uFF0C0 \u547D\u4E2D\u62A5\u9519" },
|
|
14505
|
+
requestName: { type: "string", description: "\u6D41\u7A0B\u6807\u9898 like \u6A21\u7CCA" },
|
|
14506
|
+
requestNameTerm: { type: "string", enum: ["in", "notin", "eq", "ne"] },
|
|
14507
|
+
requestMark: { type: "string", description: "\u6D41\u7A0B\u7F16\u53F7 like \u6A21\u7CCA" },
|
|
14508
|
+
requestMarkTerm: { type: "string", enum: ["in", "notin", "eq", "ne"] },
|
|
14509
|
+
requestLevel: { type: "string", description: "\u7D27\u6025\u7A0B\u5EA6\u540D\u79F0\uFF08CLI \u6309\u5F53\u524D\u73AF\u5883\u7B49\u7EA7\u5217\u8868\u8F6C ID\uFF09\uFF1B0 \u547D\u4E2D\u62A5\u9519\u5E76\u5217\u51FA\u53EF\u9009\u7B49\u7EA7" },
|
|
14510
|
+
requestId: { type: "string", description: "\u6309 requestId \u7CBE\u786E\u8FC7\u6EE4\uFF0C\u9017\u53F7\u5206\u9694" },
|
|
14511
|
+
exRequestId: { type: "string", description: "\u6392\u9664 requestId\uFF0C\u9017\u53F7\u5206\u9694" },
|
|
14512
|
+
nodeId: { type: "string", description: "\u5F53\u524D\u8282\u70B9 ID\uFF0C\u9017\u53F7\u5206\u9694\u53EF\u591A\u503C\uFF08\u53EA\u80FD\u586B\u8282\u70B9 ID\uFF0C\u4E0D\u80FD\u586B\u8282\u70B9\u540D\u79F0\uFF09" },
|
|
14513
|
+
nodeIdTerm: { type: "string", enum: ["in", "notin"] },
|
|
14514
|
+
flowStatus: { type: "string", description: `\u6D41\u7A0B\u72B6\u6001\uFF08\u9009\u9879\u7C7B\uFF0C\u591A\u9009\uFF09\uFF1A${FLOW_STATUS_HINT}` },
|
|
14515
|
+
flowStatusTerm: { type: "string", enum: ["in", "notin"] },
|
|
14516
|
+
createTime: { type: "string", description: TIME_DESCRIPTIONS.createTime },
|
|
14517
|
+
operateTime: { type: "string", description: TIME_DESCRIPTIONS.operateTime },
|
|
14518
|
+
receiveTime: { type: "string", description: TIME_DESCRIPTIONS.receiveTime },
|
|
14519
|
+
finishTime: { type: "string", description: TIME_DESCRIPTIONS.finishTime },
|
|
14520
|
+
filterFields: {
|
|
14521
|
+
type: "array",
|
|
14522
|
+
items: { type: "object" },
|
|
14523
|
+
description: '\u8868\u5355\u5B57\u6BB5\u7B5B\u9009\u6761\u4EF6\uFF1A[{"fieldName":"\u5B57\u6BB5\u540D(\u5B57\u6BB5ID)","term":"...","value":...}]\uFF1B\u5FC5\u987B\u540C\u65F6\u4F20\u4E14\u53EA\u4F20\u4E00\u4E2A workflow\uFF0CfieldName \u4F1A\u6309\u8BE5\u5DE5\u4F5C\u6D41\u771F\u5B9E\u8868\u5355\u5B57\u6BB5\u89E3\u6790\uFF08\u89E3\u6790\u4E0D\u51FA\u552F\u4E00\u5B57\u6BB5\u65F6\u8FD4\u56DE\u6F84\u6E05\u5E76\u5217\u51FA\u5019\u9009\uFF09'
|
|
14524
|
+
},
|
|
14525
|
+
conditionType: { type: "string", enum: ["and", "or"], default: "and" },
|
|
14526
|
+
sort: {
|
|
14527
|
+
type: "string",
|
|
14528
|
+
description: `\u6392\u5E8F\uFF1A"\u6392\u5E8F\u65B9\u5F0F:asc|desc"\uFF0C\u591A\u7EC4\u9017\u53F7\u5206\u9694\uFF08\u7FFB\u9875\u65F6\u6BCF\u9875\u5E26\u540C\u4E00\u4EFD\u6392\u5E8F\uFF09\u3002\u53EF\u7528\u6392\u5E8F\u65B9\u5F0F\uFF1A${Object.keys(SORT_OPTIONS).join("/")}\uFF1B\u4E5F\u53EF\u76F4\u63A5\u4F20 orderkey \u6570\u5B57`
|
|
14529
|
+
},
|
|
13815
14530
|
groupFocus: { type: "string" },
|
|
13816
14531
|
maxCharsPerBatch: { type: "integer", minimum: 500, maximum: 2e5, default: 24e3 },
|
|
13817
14532
|
maxItemsPerBatch: { type: "integer", minimum: 1, maximum: 500, default: 100 },
|
|
@@ -13864,9 +14579,18 @@ var workflowTodoSmartConvertOperations = [{
|
|
|
13864
14579
|
const stage = args.stage === void 0 || args.stage === null || args.stage === "" ? inferStage(args) : readStage(args.stage);
|
|
13865
14580
|
const hasItems = Array.isArray(args.items);
|
|
13866
14581
|
const resumed = stage === "collect" && hasItems;
|
|
13867
|
-
const withPriorityView = (data, extraWarnings) => {
|
|
13868
|
-
if ((args.groupBy ?? "workflow") !== "workflow")
|
|
13869
|
-
|
|
14582
|
+
const withPriorityView = (data, extraWarnings, options) => {
|
|
14583
|
+
if ((args.groupBy ?? "workflow") !== "workflow") {
|
|
14584
|
+
const groups2 = data.wfIdGroup ?? [];
|
|
14585
|
+
return {
|
|
14586
|
+
data: { ...data, wfIdGroup: options.stripRawFields ? stripPriorityRawFields(groups2) : groups2 },
|
|
14587
|
+
warnings: extraWarnings
|
|
14588
|
+
};
|
|
14589
|
+
}
|
|
14590
|
+
const { groups, warning } = assemblePriorityGroup(
|
|
14591
|
+
data.wfIdGroup ?? [],
|
|
14592
|
+
{ stripRawFields: options.stripRawFields }
|
|
14593
|
+
);
|
|
13870
14594
|
return {
|
|
13871
14595
|
data: { ...data, wfIdGroup: groups },
|
|
13872
14596
|
warnings: warning ? [...extraWarnings, warning] : extraWarnings
|
|
@@ -13934,7 +14658,7 @@ var workflowTodoSmartConvertOperations = [{
|
|
|
13934
14658
|
baseWarnings = [...baseWarnings, ...sub.warnings];
|
|
13935
14659
|
subGrouped = true;
|
|
13936
14660
|
}
|
|
13937
|
-
const final = withPriorityView(baseData, baseWarnings);
|
|
14661
|
+
const final = withPriorityView(baseData, baseWarnings, { stripRawFields: false });
|
|
13938
14662
|
if (args.withGroupSummaryContext === true) {
|
|
13939
14663
|
const context = await runGroupSummaryContext({
|
|
13940
14664
|
wfIdGroup: final.data.wfIdGroup,
|
|
@@ -13974,7 +14698,7 @@ var workflowTodoSmartConvertOperations = [{
|
|
|
13974
14698
|
}
|
|
13975
14699
|
if (stage === "subGroup") {
|
|
13976
14700
|
const result = await runSubGroup(args, env);
|
|
13977
|
-
const final = withPriorityView(result.data, result.warnings);
|
|
14701
|
+
const final = withPriorityView(result.data, result.warnings, { stripRawFields: false });
|
|
13978
14702
|
return finish(env, args, startedAt, stage, final.data, {
|
|
13979
14703
|
branch: "todo-smart-convert",
|
|
13980
14704
|
stage,
|
|
@@ -13999,7 +14723,7 @@ var workflowTodoSmartConvertOperations = [{
|
|
|
13999
14723
|
);
|
|
14000
14724
|
}
|
|
14001
14725
|
const result = await runGroupSummary(args, env);
|
|
14002
|
-
const final = withPriorityView(result.data, result.warnings);
|
|
14726
|
+
const final = withPriorityView(result.data, result.warnings, { stripRawFields: true });
|
|
14003
14727
|
return finish(env, args, startedAt, stage, final.data, {
|
|
14004
14728
|
branch: "todo-smart-convert",
|
|
14005
14729
|
stage,
|
|
@@ -14032,7 +14756,6 @@ var workflowTodoSmartConvertOperations = [{
|
|
|
14032
14756
|
|
|
14033
14757
|
// src/shortcuts/workflow/operations/write.ts
|
|
14034
14758
|
import { createHash } from "node:crypto";
|
|
14035
|
-
var CONTINUATION_TTL_SECONDS = 600;
|
|
14036
14759
|
var BATCH_SIZE_DEFAULT = 100;
|
|
14037
14760
|
var READ_REMARK_VALUES = /* @__PURE__ */ new Set(["60", "61", "70", "71", "80", "81"]);
|
|
14038
14761
|
var SHARE_TYPE_MAP = {
|