weaver-work-cli 0.1.42 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
- package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
- package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
- package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
- package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
- package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
- package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
- package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
- package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
- package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
- package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
- package/dist/chunks/chunk-6N4JPNFL.js +76 -0
- package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
- package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
- package/dist/chunks/chunk-7BDPM5ST.js +11 -0
- package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
- package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
- package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
- package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
- package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
- package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
- package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
- package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
- package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
- package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
- package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
- package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
- package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
- package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
- package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
- package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
- package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
- package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
- package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
- package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
- package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
- package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
- package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
- package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
- package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
- package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
- package/dist/chunks/{chunk-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
- package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.js} +4 -3
- package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
- package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
- package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
- package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
- package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
- package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
- package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
- package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
- package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
- package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
- package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
- package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
- package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
- package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
- package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
- package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
- package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
- package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
- package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
- package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
- package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
- package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
- package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
- package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
- package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
- package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
- package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
- package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
- package/dist/chunks/reception-5WITA44R.js +1899 -0
- package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
- package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
- package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
- package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
- package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
- package/dist/chunks/registry-XPWPGHYE.js +24 -0
- package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
- package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
- package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
- package/dist/cmd/action.js +6 -0
- package/dist/cmd/identity/index.js +45 -0
- package/dist/cmd/index.js +2 -0
- package/dist/core/continuation-ttl.js +18 -0
- package/dist/core/error-codes.js +85 -0
- package/dist/core/logger.js +11 -0
- package/dist/index.js +37 -31
- package/dist/internal/e10/auth/commands.js +195 -8
- package/dist/internal/e10/auth/error-log.js +312 -0
- package/dist/internal/e10/auth/session.js +17 -3
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/auth-recovery.js +39 -12
- package/dist/internal/e10/context.js +29 -3
- package/dist/internal/skills/install.js +9 -1
- package/dist/shortcuts/archive/continuation.js +2 -1
- package/dist/shortcuts/archive/index.js +3 -0
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/confirm.js +2 -1
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/archive-oa/continuation.js +2 -1
- package/dist/shortcuts/archive-oa/index.js +2 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
- package/dist/shortcuts/asset/continuation.js +2 -1
- package/dist/shortcuts/asset/index.js +2 -0
- package/dist/shortcuts/asset-idle/index.js +2 -0
- package/dist/shortcuts/blog/continuation.js +2 -1
- package/dist/shortcuts/blog/index.js +2 -0
- package/dist/shortcuts/caizhilian/continuation.js +2 -1
- package/dist/shortcuts/caizhilian/index.js +2 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
- package/dist/shortcuts/calendar/continuation.js +2 -1
- package/dist/shortcuts/calendar/index.js +2 -0
- package/dist/shortcuts/calendar/operations/write.js +1 -1
- package/dist/shortcuts/contract/continuation.js +2 -1
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +21 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/operations/write.js +2 -1
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/cowork/continuation.js +2 -1
- package/dist/shortcuts/cowork/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
- package/dist/shortcuts/ebuilder-form/index.js +2 -0
- package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
- package/dist/shortcuts/ehr/continuation.js +2 -1
- package/dist/shortcuts/ehr/index.js +2 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
- package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
- package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
- package/dist/shortcuts/ehr/operations/recruit.js +17 -5
- package/dist/shortcuts/esb/continuation.js +2 -1
- package/dist/shortcuts/esb/index.js +2 -0
- package/dist/shortcuts/esb/operations/trigger.js +2 -1
- package/dist/shortcuts/fna/continuation.js +2 -1
- package/dist/shortcuts/fna/index.js +2 -0
- package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
- package/dist/shortcuts/fna/operations/loan.js +1 -1
- package/dist/shortcuts/hrm/index.js +2 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/im/continuation.js +2 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/continuation.js +2 -1
- package/dist/shortcuts/invoice/index.js +14 -15
- package/dist/shortcuts/invoice/invoice-record.js +93 -0
- package/dist/shortcuts/invoice/manifest.js +190 -393
- package/dist/shortcuts/invoice/operations/add.js +2 -1
- package/dist/shortcuts/invoice/operations/delete.js +2 -1
- package/dist/shortcuts/invoice/operations/import.js +2 -1
- package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
- package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
- package/dist/shortcuts/invoice/operations/registry.js +17 -17
- package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
- package/dist/shortcuts/invoice/operations/reim.js +52 -341
- package/dist/shortcuts/invoice/operations/shared.js +21 -4
- package/dist/shortcuts/invoice/operations/update.js +2 -1
- package/dist/shortcuts/invoice/projection.js +10 -62
- package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
- package/dist/shortcuts/mail/continuation.js +2 -1
- package/dist/shortcuts/mail/index.js +2 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
- package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
- package/dist/shortcuts/mail/operations/mail-send.js +1 -1
- package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
- package/dist/shortcuts/mail/operations/mail-template.js +1 -1
- package/dist/shortcuts/meeting/continuation.js +2 -1
- package/dist/shortcuts/meeting/index.js +2 -0
- package/dist/shortcuts/meeting/operations/change.js +1 -1
- package/dist/shortcuts/meeting/operations/create.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
- package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
- package/dist/shortcuts/meeting/operations/receipts.js +1 -1
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/signs.js +1 -1
- package/dist/shortcuts/okr/continuation.js +2 -1
- package/dist/shortcuts/okr/index.js +2 -0
- package/dist/shortcuts/okr/operations/write.js +1 -1
- package/dist/shortcuts/plan/continuation.js +2 -1
- package/dist/shortcuts/plan/index.js +2 -0
- package/dist/shortcuts/plan/operations/write.js +1 -1
- package/dist/shortcuts/project/continuation.js +2 -1
- package/dist/shortcuts/project/index.js +2 -0
- package/dist/shortcuts/reception/constants.js +53 -0
- package/dist/shortcuts/reception/errors.js +54 -0
- package/dist/shortcuts/reception/host.js +125 -0
- package/dist/shortcuts/reception/index.js +198 -0
- package/dist/shortcuts/reception/manifest.js +177 -0
- package/dist/shortcuts/reception/operations/ask.js +71 -0
- package/dist/shortcuts/reception/operations/browsertool.js +58 -0
- package/dist/shortcuts/reception/operations/compose.js +129 -0
- package/dist/shortcuts/reception/operations/customparams.js +74 -0
- package/dist/shortcuts/reception/operations/doc.js +238 -0
- package/dist/shortcuts/reception/operations/docrender.js +36 -0
- package/dist/shortcuts/reception/operations/panels.js +179 -0
- package/dist/shortcuts/reception/operations/registry.js +26 -0
- package/dist/shortcuts/reception/operations/render-assets.js +184 -0
- package/dist/shortcuts/reception/operations/render.js +123 -0
- package/dist/shortcuts/reception/operations/runs.js +38 -0
- package/dist/shortcuts/reception/operations/schedule.js +127 -0
- package/dist/shortcuts/reception/operations/shared.js +196 -0
- package/dist/shortcuts/reception/operations/snapshot.js +68 -0
- package/dist/shortcuts/reception/operations/types.js +1 -0
- package/dist/shortcuts/reception/operations.js +33 -0
- package/dist/shortcuts/reception/upload.js +218 -0
- package/dist/shortcuts/recruit-stage/context.js +145 -33
- package/dist/shortcuts/recruit-stage/continuation.js +2 -1
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +289 -48
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
- package/dist/shortcuts/recruit-stage/shared.js +161 -18
- package/dist/shortcuts/workflow/continuation.js +2 -1
- package/dist/shortcuts/workflow/index.js +4 -0
- package/dist/shortcuts/workflow/operations/form.js +32 -8
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/_catalog.md +3 -0
- package/docs/agent-invoice.md +1 -1
- package/docs/archive-oa.md +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/contract.md +2 -1
- package/docs/e10-auth.md +19 -1
- package/docs/ehr.md +2 -2
- package/docs/esb.md +1 -1
- package/docs/im.md +1 -1
- package/docs/invoice.md +8 -12
- package/docs/okr.md +1 -1
- package/docs/reception.md +119 -0
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/scripts/clean.mjs +43 -2
- package/skill-template/business-info.json +18 -2
- package/skill-template/domains/caizhilian.md +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skill-template/domains/reception-flow.md +18 -0
- package/skill-template/domains/yepiaotong.md +4 -7
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
- package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
- package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
- package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
- package/skills/weaver-e10-esb/references/trigger.md +2 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
- package/skills/weaver-e10-jucailin/SKILL.md +1 -1
- package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
- package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
- package/skills/weaver-e10-meeting/SKILL.md +64 -14
- package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-okr/references/okr-align.md +1 -1
- package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
- package/skills/weaver-e10-okr/references/okr-write.md +1 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
- package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
- package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
- package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
- package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
- package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
- package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
- package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
- package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -10
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
- package/skills/weaver-e10-shijingran/SKILL.md +5 -5
- package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
- package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/chunk-TTPJJJC4.js +0 -465
- package/dist/chunks/registry-BKBZPBAJ.js +0 -23
- package/dist/shortcuts/invoice/markdown.js +0 -172
- package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
|
@@ -1,324 +1,20 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
CAIZHILAN_MAX_DOWNLOAD_BYTES,
|
|
5
|
+
CAIZHILAN_TRANSFER_TIMEOUT_MS,
|
|
6
|
+
caizhilianBusinessMessage,
|
|
7
|
+
isCaizhilianBusinessSuccess
|
|
8
|
+
} from "./chunk-762M5XJS.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
CaizhilianCliError,
|
|
11
|
+
caizhilianAuthError,
|
|
12
|
+
caizhilianConfirmationError,
|
|
13
|
+
caizhilianValidationError
|
|
14
|
+
} from "./chunk-P5GQRWDC.js";
|
|
13
15
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
toErrorEnvelope
|
|
17
|
-
} from "./chunk-LUSPKZKY.js";
|
|
18
|
-
import "./chunk-BUSC6UAE.js";
|
|
19
|
-
|
|
20
|
-
// src/shortcuts/caizhilian/index.ts
|
|
21
|
-
import { readFile as readFile5 } from "node:fs/promises";
|
|
22
|
-
|
|
23
|
-
// src/shortcuts/caizhilian/continuation.ts
|
|
24
|
-
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
25
|
-
import { existsSync } from "node:fs";
|
|
26
|
-
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
27
|
-
import { homedir } from "node:os";
|
|
28
|
-
import { resolve } from "node:path";
|
|
29
|
-
|
|
30
|
-
// src/shortcuts/caizhilian/errors.ts
|
|
31
|
-
var CaizhilianCliError = class extends CliError {
|
|
32
|
-
type;
|
|
33
|
-
subtype;
|
|
34
|
-
code;
|
|
35
|
-
retryable;
|
|
36
|
-
stage;
|
|
37
|
-
details;
|
|
38
|
-
partialData;
|
|
39
|
-
constructor(type, subtype, message, options = {}) {
|
|
40
|
-
super(message, options.exitCode ?? 5 /* InternalError */);
|
|
41
|
-
this.name = "CaizhilianCliError";
|
|
42
|
-
this.type = type;
|
|
43
|
-
this.subtype = subtype;
|
|
44
|
-
this.code = options.code;
|
|
45
|
-
this.retryable = options.retryable ?? false;
|
|
46
|
-
this.stage = options.stage;
|
|
47
|
-
this.details = options.details;
|
|
48
|
-
this.partialData = options.partialData;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
function caizhilianValidationError(subtype, message, details) {
|
|
52
|
-
return new CaizhilianCliError("validation", subtype, message, {
|
|
53
|
-
details,
|
|
54
|
-
exitCode: 2 /* UsageError */
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function caizhilianAuthError(subtype, message, details) {
|
|
58
|
-
return new CaizhilianCliError("authentication", subtype, message, {
|
|
59
|
-
details,
|
|
60
|
-
exitCode: 3 /* AuthError */
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function caizhilianNetworkError(subtype, message, options = {}) {
|
|
64
|
-
return new CaizhilianCliError("network", subtype, message, {
|
|
65
|
-
...options,
|
|
66
|
-
retryable: options.retryable ?? true,
|
|
67
|
-
exitCode: 4 /* NetworkError */
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
function caizhilianConfirmationError(action, details) {
|
|
71
|
-
return new CaizhilianCliError("confirmation", "required", "\u8BE5\u64CD\u4F5C\u9700\u8981\u660E\u786E\u786E\u8BA4", {
|
|
72
|
-
details: { action, ...details },
|
|
73
|
-
exitCode: 10 /* ConfirmationRequired */
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// src/shortcuts/caizhilian/continuation.ts
|
|
78
|
-
function stateRoot(ctx) {
|
|
79
|
-
const configured = ctx?.config?.path();
|
|
80
|
-
if (configured) return resolve(configured, "..");
|
|
81
|
-
return process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), ".weaver-work-cli");
|
|
82
|
-
}
|
|
83
|
-
async function loadKey(ctx) {
|
|
84
|
-
const keysDir = resolve(stateRoot(ctx), "keys");
|
|
85
|
-
const filename = resolve(keysDir, "caizhilian-continuation.key");
|
|
86
|
-
await mkdir(keysDir, { recursive: true, mode: 448 });
|
|
87
|
-
if (existsSync(filename)) return readFile(filename);
|
|
88
|
-
const key = randomBytes(32);
|
|
89
|
-
try {
|
|
90
|
-
await writeFile(filename, key, { flag: "wx", mode: 384 });
|
|
91
|
-
if (process.platform !== "win32") await chmod(filename, 384).catch(() => void 0);
|
|
92
|
-
return key;
|
|
93
|
-
} catch {
|
|
94
|
-
return readFile(filename);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function encode(value) {
|
|
98
|
-
return Buffer.from(JSON.stringify(value)).toString("base64url");
|
|
99
|
-
}
|
|
100
|
-
function signature(payload, key) {
|
|
101
|
-
return createHmac("sha256", key).update(payload).digest("base64url");
|
|
102
|
-
}
|
|
103
|
-
function createCaizhilianContinuationSigner(ctx) {
|
|
104
|
-
return {
|
|
105
|
-
async issue(payload, ttlMs = 10 * 6e4) {
|
|
106
|
-
const issuedAt = Date.now();
|
|
107
|
-
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
108
|
-
const sig = signature(body, await loadKey(ctx));
|
|
109
|
-
return `${body}.${sig}`;
|
|
110
|
-
},
|
|
111
|
-
async verify(token, expectedOperation) {
|
|
112
|
-
if (typeof token !== "string" || !token.includes(".")) {
|
|
113
|
-
throw caizhilianValidationError("continuation_invalid", "continuation \u65E0\u6548");
|
|
114
|
-
}
|
|
115
|
-
const [body, provided] = token.split(".");
|
|
116
|
-
const expected = signature(body, await loadKey(ctx));
|
|
117
|
-
const valid = provided.length === expected.length && timingSafeEqual(Buffer.from(provided), Buffer.from(expected));
|
|
118
|
-
if (!valid) throw caizhilianValidationError("continuation_invalid", "continuation \u7B7E\u540D\u6821\u9A8C\u5931\u8D25");
|
|
119
|
-
let value;
|
|
120
|
-
try {
|
|
121
|
-
value = JSON.parse(Buffer.from(body, "base64url").toString("utf8"));
|
|
122
|
-
} catch {
|
|
123
|
-
throw caizhilianValidationError("continuation_invalid", "continuation \u5185\u5BB9\u65E0\u6CD5\u89E3\u6790");
|
|
124
|
-
}
|
|
125
|
-
if (value.operation !== expectedOperation) {
|
|
126
|
-
throw caizhilianValidationError("continuation_mismatch", "continuation \u4E0D\u5C5E\u4E8E\u5F53\u524D\u64CD\u4F5C");
|
|
127
|
-
}
|
|
128
|
-
if (!Number.isSafeInteger(value.expiresAt) || value.expiresAt < Date.now()) {
|
|
129
|
-
throw caizhilianValidationError("continuation_expired", "continuation \u5DF2\u8FC7\u671F");
|
|
130
|
-
}
|
|
131
|
-
return value;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// src/shortcuts/caizhilian/host.ts
|
|
137
|
-
var CAIZHILAN_TIMEOUT_MS = 12e3;
|
|
138
|
-
var CAIZHILAN_TRANSFER_TIMEOUT_MS = 12e4;
|
|
139
|
-
var CAIZHILAN_MAX_DOWNLOAD_BYTES = 100 * 1024 * 1024;
|
|
140
|
-
function inferProfile(ctx) {
|
|
141
|
-
const options = ctx.getGlobalOptions();
|
|
142
|
-
return options.profile || getActiveProfile();
|
|
143
|
-
}
|
|
144
|
-
function isCaizhilianBusinessSuccess(value) {
|
|
145
|
-
if (!value || typeof value !== "object") return false;
|
|
146
|
-
if (value.code !== void 0 && value.code !== null) return Number(value.code) === 200;
|
|
147
|
-
if (typeof value.success === "boolean") return value.success;
|
|
148
|
-
if (typeof value.status === "boolean") return value.status;
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
function caizhilianBusinessMessage(value) {
|
|
152
|
-
if (!value || typeof value !== "object") return "\u91C7\u77E5\u8FDE\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25";
|
|
153
|
-
const candidates = [value.msg, value.message, value.errMsg, value.data?.msg, value.data?.message];
|
|
154
|
-
for (const item of candidates) {
|
|
155
|
-
if (typeof item === "string" && item.trim()) return item;
|
|
156
|
-
}
|
|
157
|
-
return "\u91C7\u77E5\u8FDE\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25";
|
|
158
|
-
}
|
|
159
|
-
function caizhilianBusinessCode(value) {
|
|
160
|
-
if (!value || typeof value !== "object") return void 0;
|
|
161
|
-
const code = value.code ?? value.status;
|
|
162
|
-
if (typeof code === "string" || typeof code === "number") return code;
|
|
163
|
-
return void 0;
|
|
164
|
-
}
|
|
165
|
-
function assertCaizhilianPath(requestPath) {
|
|
166
|
-
if (typeof requestPath !== "string" || !requestPath.startsWith("/") || requestPath.startsWith("//")) {
|
|
167
|
-
throw caizhilianValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u5FC5\u987B\u662F\u76F8\u5BF9\u7EDD\u5BF9\u8DEF\u5F84");
|
|
168
|
-
}
|
|
169
|
-
if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
|
|
170
|
-
throw caizhilianValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
|
|
171
|
-
}
|
|
172
|
-
if (!requestPath.startsWith("/api/")) {
|
|
173
|
-
throw caizhilianValidationError("path_not_allowed", "\u91C7\u77E5\u8FDE\u6A21\u5757\u53EA\u80FD\u8C03\u7528 /api/ \u8DEF\u5F84");
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function formBody(form) {
|
|
177
|
-
if (!form) return void 0;
|
|
178
|
-
const params = new URLSearchParams();
|
|
179
|
-
for (const [key, value] of Object.entries(form)) {
|
|
180
|
-
if (value === void 0 || value === null) continue;
|
|
181
|
-
params.set(key, typeof value === "string" ? value : JSON.stringify(value));
|
|
182
|
-
}
|
|
183
|
-
return params;
|
|
184
|
-
}
|
|
185
|
-
function omitEmptyQueryValues(query) {
|
|
186
|
-
if (!query) return void 0;
|
|
187
|
-
return Object.fromEntries(Object.entries(query).filter(([, value]) => value !== ""));
|
|
188
|
-
}
|
|
189
|
-
function mapRuntimeNetworkError(error) {
|
|
190
|
-
if (error instanceof E10ApiError && error.type === "network") {
|
|
191
|
-
throw caizhilianNetworkError(error.subtype, error.message, {
|
|
192
|
-
retryable: error.retryable,
|
|
193
|
-
details: error.details
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
function createCaizhilianHost(ctx, dependencies = {}) {
|
|
199
|
-
let e10Session = null;
|
|
200
|
-
let sessionContext = null;
|
|
201
|
-
const requireSession = dependencies.requireSession || requireE10Session;
|
|
202
|
-
async function ensureSession() {
|
|
203
|
-
if (!e10Session) {
|
|
204
|
-
e10Session = await requireSession(ctx);
|
|
205
|
-
sessionContext = {
|
|
206
|
-
baseUrl: e10Session.getBaseUrl(),
|
|
207
|
-
profile: inferProfile(ctx),
|
|
208
|
-
userId: e10Session.userId,
|
|
209
|
-
tenantKey: e10Session.tenantKey,
|
|
210
|
-
eteamsId: e10Session.eteamsId
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
return e10Session;
|
|
214
|
-
}
|
|
215
|
-
async function getSession() {
|
|
216
|
-
await ensureSession();
|
|
217
|
-
return sessionContext;
|
|
218
|
-
}
|
|
219
|
-
async function runtime() {
|
|
220
|
-
return createE10RequestRuntime(ctx, await ensureSession(), {
|
|
221
|
-
interceptors: dependencies.interceptors,
|
|
222
|
-
fetch: dependencies.fetch
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
async function doRequest(request2, binary) {
|
|
226
|
-
const {
|
|
227
|
-
method,
|
|
228
|
-
path,
|
|
229
|
-
query,
|
|
230
|
-
body,
|
|
231
|
-
operation,
|
|
232
|
-
form,
|
|
233
|
-
multipart,
|
|
234
|
-
streamMultipart,
|
|
235
|
-
maxResponseBytes,
|
|
236
|
-
headers: extraHeaders = {},
|
|
237
|
-
timeoutMs = CAIZHILAN_TIMEOUT_MS
|
|
238
|
-
} = request2;
|
|
239
|
-
assertCaizhilianPath(path);
|
|
240
|
-
const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 && streamMultipart === void 0 ? "GET" : "POST");
|
|
241
|
-
const headers = { "X-Requested-With": "XMLHttpRequest", ...extraHeaders, ...streamMultipart ? {
|
|
242
|
-
"Content-Type": streamMultipart.contentType,
|
|
243
|
-
"Content-Length": String(streamMultipart.contentLength)
|
|
244
|
-
} : {} };
|
|
245
|
-
const rt = await runtime();
|
|
246
|
-
const response = binary ? await rt.requestBinary({
|
|
247
|
-
module: "caizhilian",
|
|
248
|
-
operation,
|
|
249
|
-
method: resolvedMethod,
|
|
250
|
-
path,
|
|
251
|
-
query: omitEmptyQueryValues(query),
|
|
252
|
-
body: multipart === void 0 ? body : void 0,
|
|
253
|
-
form: multipart === void 0 && form === void 0 ? void 0 : formBody(form ?? {}),
|
|
254
|
-
formData: multipart,
|
|
255
|
-
streamBody: streamMultipart?.body,
|
|
256
|
-
maxResponseBytes,
|
|
257
|
-
headers,
|
|
258
|
-
timeoutMs
|
|
259
|
-
}) : await rt.requestJson({
|
|
260
|
-
module: "caizhilian",
|
|
261
|
-
operation,
|
|
262
|
-
method: resolvedMethod,
|
|
263
|
-
path,
|
|
264
|
-
query: omitEmptyQueryValues(query),
|
|
265
|
-
body: multipart === void 0 ? body : void 0,
|
|
266
|
-
form: multipart === void 0 && form === void 0 ? void 0 : formBody(form ?? {}),
|
|
267
|
-
formData: multipart,
|
|
268
|
-
streamBody: streamMultipart?.body,
|
|
269
|
-
maxResponseBytes,
|
|
270
|
-
headers,
|
|
271
|
-
timeoutMs
|
|
272
|
-
});
|
|
273
|
-
return response;
|
|
274
|
-
}
|
|
275
|
-
async function request(request2) {
|
|
276
|
-
const response = await doRequest(request2, false).catch((error) => mapRuntimeNetworkError(error));
|
|
277
|
-
if (isE10SessionExpiredResponse(response)) {
|
|
278
|
-
throw caizhilianAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
279
|
-
}
|
|
280
|
-
if (response.parseError) {
|
|
281
|
-
if (response.status < 200 || response.status >= 300) {
|
|
282
|
-
throw new CaizhilianCliError("api", "http_error", `\u91C7\u77E5\u8FDE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
283
|
-
code: response.status,
|
|
284
|
-
details: { status: response.status },
|
|
285
|
-
exitCode: 1
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
throw caizhilianNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
|
|
289
|
-
}
|
|
290
|
-
if (response.status < 200 || response.status >= 300 || request2.requireHttp200 && response.status !== 200) {
|
|
291
|
-
throw new CaizhilianCliError("api", "http_error", `\u91C7\u77E5\u8FDE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
292
|
-
code: response.status,
|
|
293
|
-
details: { status: response.status, message: caizhilianBusinessMessage(response.value) },
|
|
294
|
-
exitCode: 1
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
if (!request2.tolerateBusinessError && !isCaizhilianBusinessSuccess(response.value)) {
|
|
298
|
-
throw new CaizhilianCliError("api", "business_error", caizhilianBusinessMessage(response.value), {
|
|
299
|
-
code: caizhilianBusinessCode(response.value),
|
|
300
|
-
details: { code: caizhilianBusinessCode(response.value), message: caizhilianBusinessMessage(response.value) },
|
|
301
|
-
exitCode: 1
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
return response.value;
|
|
305
|
-
}
|
|
306
|
-
async function requestBinary(request2) {
|
|
307
|
-
const response = await doRequest(request2, true).catch((error) => mapRuntimeNetworkError(error));
|
|
308
|
-
if (isE10SessionExpiredResponse(response)) {
|
|
309
|
-
throw caizhilianAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
310
|
-
}
|
|
311
|
-
if (response.status < 200 || response.status >= 300) {
|
|
312
|
-
throw new CaizhilianCliError("api", "http_error", `\u91C7\u77E5\u8FDE\u4E0B\u8F7D HTTP ${response.status}`, {
|
|
313
|
-
code: response.status,
|
|
314
|
-
details: { status: response.status },
|
|
315
|
-
exitCode: 1
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
return { status: response.status, contentType: response.contentType, content: response.content, headers: response.headers };
|
|
319
|
-
}
|
|
320
|
-
return { request, requestBinary, getSession };
|
|
321
|
-
}
|
|
16
|
+
CONTINUATION_TTL_MS
|
|
17
|
+
} from "./chunk-7BDPM5ST.js";
|
|
322
18
|
|
|
323
19
|
// src/shortcuts/caizhilian/operations/shared.ts
|
|
324
20
|
import { createHash } from "node:crypto";
|
|
@@ -642,7 +338,7 @@ function requireConfirm(args, action) {
|
|
|
642
338
|
});
|
|
643
339
|
}
|
|
644
340
|
}
|
|
645
|
-
async function issueLease(env, action, payload, ttlMs =
|
|
341
|
+
async function issueLease(env, action, payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
646
342
|
const session = await env.host.getSession();
|
|
647
343
|
const continuation = await env.continuation.issue(
|
|
648
344
|
{
|
|
@@ -691,7 +387,7 @@ function leaseArgsFingerprint(args) {
|
|
|
691
387
|
}
|
|
692
388
|
return fingerprint(picked);
|
|
693
389
|
}
|
|
694
|
-
async function issueWriteLease(env, action, args, payload, ttlMs =
|
|
390
|
+
async function issueWriteLease(env, action, args, payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
695
391
|
return issueLease(env, action, { ...payload, argsFingerprint: leaseArgsFingerprint(args) }, ttlMs);
|
|
696
392
|
}
|
|
697
393
|
function assertLeaseArgs(lease, args, action) {
|
|
@@ -2100,14 +1796,14 @@ var caizhilianCollabHandlers = {
|
|
|
2100
1796
|
};
|
|
2101
1797
|
|
|
2102
1798
|
// src/shortcuts/caizhilian/operations/handlers/document.ts
|
|
2103
|
-
import { readFile as
|
|
1799
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
2104
1800
|
import { basename as basename2, extname as extname2 } from "node:path";
|
|
2105
1801
|
|
|
2106
1802
|
// src/shortcuts/caizhilian/operations/files.ts
|
|
2107
1803
|
import { createHash as createHash2 } from "node:crypto";
|
|
2108
|
-
import { existsSync
|
|
2109
|
-
import { mkdir
|
|
2110
|
-
import { basename, dirname, extname, join, resolve
|
|
1804
|
+
import { existsSync } from "node:fs";
|
|
1805
|
+
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
1806
|
+
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
2111
1807
|
var TRANSFER_TIMEOUT_MS = CAIZHILAN_TRANSFER_TIMEOUT_MS;
|
|
2112
1808
|
var IMAGE_ALLOWED_EXT = [".bmp", ".gif", ".jpeg", ".jpg", ".png", ".webp"];
|
|
2113
1809
|
var EXT_TO_CONTENT_TYPE = {
|
|
@@ -2164,14 +1860,14 @@ async function readFileMetadata(filePath) {
|
|
|
2164
1860
|
if (!info.isFile()) throw caizhilianValidationError("file_not_found", `\u6587\u4EF6\u4E0D\u5B58\u5728: ${text}`);
|
|
2165
1861
|
let content;
|
|
2166
1862
|
try {
|
|
2167
|
-
content = await
|
|
1863
|
+
content = await readFile(text);
|
|
2168
1864
|
} catch {
|
|
2169
1865
|
throw caizhilianValidationError("file_unreadable", `\u65E0\u6CD5\u8BFB\u53D6\u6587\u4EF6: ${text}`);
|
|
2170
1866
|
}
|
|
2171
1867
|
const name = basename(text);
|
|
2172
1868
|
const ext = extname(name);
|
|
2173
1869
|
return {
|
|
2174
|
-
path:
|
|
1870
|
+
path: resolve(text),
|
|
2175
1871
|
name,
|
|
2176
1872
|
size: content.length,
|
|
2177
1873
|
md5: createHash2("md5").update(content).digest("hex"),
|
|
@@ -2302,8 +1998,8 @@ async function downloadAttachment(host, request) {
|
|
|
2302
1998
|
);
|
|
2303
1999
|
}
|
|
2304
2000
|
const target = renameIfExists(await resolveTargetPath(savePath, response.headers, path));
|
|
2305
|
-
await
|
|
2306
|
-
await
|
|
2001
|
+
await mkdir(dirname(target), { recursive: true });
|
|
2002
|
+
await writeFile(target, response.content);
|
|
2307
2003
|
return { file_path: target, file_name: basename(target), file_size: response.content.length };
|
|
2308
2004
|
}
|
|
2309
2005
|
function resolveSavePathArg(savePath) {
|
|
@@ -2317,7 +2013,7 @@ function resolveSavePathArg(savePath) {
|
|
|
2317
2013
|
);
|
|
2318
2014
|
}
|
|
2319
2015
|
async function resolveTargetPath(savePath, headers, urlPath) {
|
|
2320
|
-
const absolute =
|
|
2016
|
+
const absolute = resolve(savePath);
|
|
2321
2017
|
const looksLikeDir = savePath.endsWith("/") || savePath.endsWith("\\");
|
|
2322
2018
|
if (!looksLikeDir) return absolute;
|
|
2323
2019
|
return join(absolute, extractDownloadFilename(headers, urlPath));
|
|
@@ -2358,7 +2054,7 @@ function renameIfExists(target) {
|
|
|
2358
2054
|
}
|
|
2359
2055
|
function existsSyncSafe(path) {
|
|
2360
2056
|
try {
|
|
2361
|
-
return
|
|
2057
|
+
return existsSync(path);
|
|
2362
2058
|
} catch {
|
|
2363
2059
|
return false;
|
|
2364
2060
|
}
|
|
@@ -2492,7 +2188,7 @@ function createPreview(docType, body) {
|
|
|
2492
2188
|
async function readMarkdownFile(filePath) {
|
|
2493
2189
|
let buffer;
|
|
2494
2190
|
try {
|
|
2495
|
-
buffer = await
|
|
2191
|
+
buffer = await readFile2(filePath);
|
|
2496
2192
|
} catch (error) {
|
|
2497
2193
|
throw caizhilianValidationError(
|
|
2498
2194
|
"file_unreadable",
|
|
@@ -4251,7 +3947,7 @@ async function waitScanCompletion(args, env) {
|
|
|
4251
3947
|
progress: result
|
|
4252
3948
|
});
|
|
4253
3949
|
}
|
|
4254
|
-
await new Promise((
|
|
3950
|
+
await new Promise((resolve3) => setTimeout(resolve3, intervalSeconds * 1e3));
|
|
4255
3951
|
}
|
|
4256
3952
|
throw new CaizhilianCliError("api", "timeout", `\u626B\u63CF\u7B49\u5F85\u8D85\u65F6\uFF08${timeoutSeconds}\u79D2\uFF09`, {
|
|
4257
3953
|
details: { runtime_id: runtimeId, timeout_seconds: timeoutSeconds },
|
|
@@ -5026,7 +4722,7 @@ var caizhilianFileopsHandlers = {
|
|
|
5026
4722
|
// src/shortcuts/caizhilian/file-upload/metadata.ts
|
|
5027
4723
|
import { createHash as createHash3 } from "node:crypto";
|
|
5028
4724
|
import { constants } from "node:fs";
|
|
5029
|
-
import { lstat, open, readFile as
|
|
4725
|
+
import { lstat, open, readFile as readFile3 } from "node:fs/promises";
|
|
5030
4726
|
import { basename as basename3, extname as extname3, isAbsolute } from "node:path";
|
|
5031
4727
|
var RESERVED_CONTEXT_FIELDS = [
|
|
5032
4728
|
"sf_request_type",
|
|
@@ -5129,7 +4825,7 @@ async function readUploadContext(value) {
|
|
|
5129
4825
|
if (value !== void 0 && value !== "") {
|
|
5130
4826
|
const { path, info } = await regularFile(value, "context_file");
|
|
5131
4827
|
if (info.size > 64 * 1024) throw caizhilianValidationError("context_too_large", "\u4E1A\u52A1\u4E0A\u4E0B\u6587\u4E0D\u80FD\u8D85\u8FC7 64 KiB");
|
|
5132
|
-
const content = await
|
|
4828
|
+
const content = await readFile3(path, { flag: READ_FLAGS });
|
|
5133
4829
|
if (content.length > 64 * 1024) throw caizhilianValidationError("context_too_large", "\u4E1A\u52A1\u4E0A\u4E0B\u6587\u4E0D\u80FD\u8D85\u8FC7 64 KiB");
|
|
5134
4830
|
try {
|
|
5135
4831
|
fields = JSON.parse(content.toString("utf8"));
|
|
@@ -5168,7 +4864,7 @@ function uploadTimeout(value) {
|
|
|
5168
4864
|
}
|
|
5169
4865
|
|
|
5170
4866
|
// src/shortcuts/caizhilian/file-upload/multipart.ts
|
|
5171
|
-
import { randomBytes
|
|
4867
|
+
import { randomBytes } from "node:crypto";
|
|
5172
4868
|
import { open as open2 } from "node:fs/promises";
|
|
5173
4869
|
import { Readable } from "node:stream";
|
|
5174
4870
|
function quoted(value) {
|
|
@@ -5178,7 +4874,7 @@ function encodedFilename(value) {
|
|
|
5178
4874
|
return encodeURIComponent(value).replace(/[!'()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
5179
4875
|
}
|
|
5180
4876
|
function uploadMultipart(fields, file) {
|
|
5181
|
-
const boundary = `weaver-${
|
|
4877
|
+
const boundary = `weaver-${randomBytes(16).toString("hex")}`;
|
|
5182
4878
|
const parts = [];
|
|
5183
4879
|
for (const [key, value] of Object.entries(fields)) {
|
|
5184
4880
|
const text = value === null || value === void 0 ? "" : typeof value === "string" ? value : JSON.stringify(value);
|
|
@@ -5355,9 +5051,9 @@ async function uploadToFileService(host, file, module, context, timeoutMs) {
|
|
|
5355
5051
|
|
|
5356
5052
|
// src/shortcuts/caizhilian/file-upload/receipt.ts
|
|
5357
5053
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
5358
|
-
import { chmod
|
|
5359
|
-
import { homedir
|
|
5360
|
-
import { dirname as dirname2, resolve as
|
|
5054
|
+
import { chmod, mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
5055
|
+
import { homedir } from "node:os";
|
|
5056
|
+
import { dirname as dirname2, resolve as resolve2 } from "node:path";
|
|
5361
5057
|
async function writeUploadReceipt(env, chatId, module, file, context, verified) {
|
|
5362
5058
|
const session = await env.host.getSession();
|
|
5363
5059
|
const identity = JSON.stringify({ baseUrl: session.baseUrl, userId: session.userId, tenantKey: session.tenantKey });
|
|
@@ -5385,15 +5081,15 @@ async function writeUploadReceipt(env, chatId, module, file, context, verified)
|
|
|
5385
5081
|
}
|
|
5386
5082
|
};
|
|
5387
5083
|
const configPath = env.ctx.config?.path();
|
|
5388
|
-
const
|
|
5389
|
-
const directory =
|
|
5390
|
-
const filename =
|
|
5084
|
+
const stateRoot = configPath ? dirname2(configPath) : env.ctx.env?.WEAVER_WORK_CLI_HOME || env.ctx.env?.WORK_CLI_HOME || resolve2(homedir(), ".weaver-work-cli");
|
|
5085
|
+
const directory = resolve2(stateRoot, "caizhilian", "file-upload", "runs", chatId, "receipts");
|
|
5086
|
+
const filename = resolve2(directory, `upload-${randomUUID2()}.json`);
|
|
5391
5087
|
const content = `${JSON.stringify(result, null, 2)}
|
|
5392
5088
|
`;
|
|
5393
5089
|
try {
|
|
5394
|
-
await
|
|
5395
|
-
if (process.platform !== "win32") await
|
|
5396
|
-
await
|
|
5090
|
+
await mkdir2(directory, { recursive: true, mode: 448 });
|
|
5091
|
+
if (process.platform !== "win32") await chmod(directory, 448);
|
|
5092
|
+
await writeFile2(filename, content, { flag: "wx", mode: 384 });
|
|
5397
5093
|
} catch {
|
|
5398
5094
|
throw new CaizhilianCliError("partial", "receipt_write_failed", "\u6587\u4EF6\u5DF2\u4E0A\u4F20\uFF0C\u4F46\u672C\u5730\u56DE\u6267\u4FDD\u5B58\u5931\u8D25\uFF1B\u8BF7\u52FF\u91CD\u590D\u4E0A\u4F20", {
|
|
5399
5095
|
retryable: false,
|
|
@@ -7721,7 +7417,7 @@ var permissionSyncParticipantHandler = {
|
|
|
7721
7417
|
const deadline = Date.now() + PROGRESS_POLL_TIMEOUT_MS;
|
|
7722
7418
|
let progress = 0;
|
|
7723
7419
|
while (Date.now() < deadline) {
|
|
7724
|
-
await new Promise((
|
|
7420
|
+
await new Promise((resolve3) => setTimeout(resolve3, PROGRESS_POLL_INTERVAL_MS));
|
|
7725
7421
|
try {
|
|
7726
7422
|
const progressResponse = await env.host.request({
|
|
7727
7423
|
method: "GET",
|
|
@@ -7857,7 +7553,7 @@ var permissionSyncDefaultShareHandler = {
|
|
|
7857
7553
|
const deadline = Date.now() + PROGRESS_POLL_TIMEOUT_MS;
|
|
7858
7554
|
let progress = 0;
|
|
7859
7555
|
while (Date.now() < deadline) {
|
|
7860
|
-
await new Promise((
|
|
7556
|
+
await new Promise((resolve3) => setTimeout(resolve3, PROGRESS_POLL_INTERVAL_MS));
|
|
7861
7557
|
try {
|
|
7862
7558
|
const progressResponse = await env.host.request({
|
|
7863
7559
|
method: "GET",
|
|
@@ -9912,177 +9608,8 @@ async function executeCaizhilianOperation(operation, rawInput, context) {
|
|
|
9912
9608
|
return definition.handler(normalized, context);
|
|
9913
9609
|
}
|
|
9914
9610
|
|
|
9915
|
-
// src/shortcuts/caizhilian/index.ts
|
|
9916
|
-
function asOptions(value) {
|
|
9917
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
9918
|
-
}
|
|
9919
|
-
async function readStdin() {
|
|
9920
|
-
const chunks = [];
|
|
9921
|
-
for await (const chunk of process.stdin) {
|
|
9922
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
9923
|
-
}
|
|
9924
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
9925
|
-
}
|
|
9926
|
-
function stripBom(value) {
|
|
9927
|
-
return value.replace(/^\uFEFF+/, "");
|
|
9928
|
-
}
|
|
9929
|
-
function parseJsonInput(raw, label) {
|
|
9930
|
-
try {
|
|
9931
|
-
const parsed = JSON.parse(stripBom(raw));
|
|
9932
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
9933
|
-
throw new Error("input must be an object");
|
|
9934
|
-
}
|
|
9935
|
-
return parsed;
|
|
9936
|
-
} catch {
|
|
9937
|
-
throw caizhilianValidationError("input_invalid", `${label} \u4E0D\u662F\u5408\u6CD5 JSON \u5BF9\u8C61`);
|
|
9938
|
-
}
|
|
9939
|
-
}
|
|
9940
|
-
async function inputFrom(options, extra = {}) {
|
|
9941
|
-
const opts = asOptions(options);
|
|
9942
|
-
let input = {};
|
|
9943
|
-
if (opts.input && opts.inputJson) {
|
|
9944
|
-
throw caizhilianValidationError("input_conflict", "\u4E0D\u80FD\u540C\u65F6\u4F20 --input \u548C --input-json");
|
|
9945
|
-
}
|
|
9946
|
-
if (opts.inputJson) {
|
|
9947
|
-
input = parseJsonInput(String(opts.inputJson), "--input-json");
|
|
9948
|
-
}
|
|
9949
|
-
if (opts.input) {
|
|
9950
|
-
let raw;
|
|
9951
|
-
try {
|
|
9952
|
-
raw = stripBom(opts.input === "-" ? await readStdin() : await readFile5(String(opts.input), "utf8"));
|
|
9953
|
-
} catch {
|
|
9954
|
-
throw caizhilianValidationError("input_unreadable", `\u65E0\u6CD5\u8BFB\u53D6 --input\uFF1A${String(opts.input)}`);
|
|
9955
|
-
}
|
|
9956
|
-
input = parseJsonInput(raw, "--input");
|
|
9957
|
-
}
|
|
9958
|
-
return {
|
|
9959
|
-
...input,
|
|
9960
|
-
...Object.fromEntries(Object.entries(extra).filter(([, value]) => value !== void 0 && value !== ""))
|
|
9961
|
-
};
|
|
9962
|
-
}
|
|
9963
|
-
function successEnvelope(operation, result) {
|
|
9964
|
-
return {
|
|
9965
|
-
schemaVersion: 1,
|
|
9966
|
-
ok: true,
|
|
9967
|
-
operation,
|
|
9968
|
-
data: result.data === void 0 ? null : result.data,
|
|
9969
|
-
...result.meta ? { meta: result.meta } : {},
|
|
9970
|
-
warnings: result.warnings ?? []
|
|
9971
|
-
};
|
|
9972
|
-
}
|
|
9973
|
-
function failureEnvelope(error) {
|
|
9974
|
-
const structured = error;
|
|
9975
|
-
return {
|
|
9976
|
-
schemaVersion: 1,
|
|
9977
|
-
ok: false,
|
|
9978
|
-
...structured?.partialData === void 0 ? {} : { data: structured.partialData },
|
|
9979
|
-
error: toErrorEnvelope(error)
|
|
9980
|
-
};
|
|
9981
|
-
}
|
|
9982
|
-
async function executeAndPrint(ctx, operation, input) {
|
|
9983
|
-
try {
|
|
9984
|
-
const result = await executeCaizhilianOperation(operation, input, {
|
|
9985
|
-
ctx,
|
|
9986
|
-
host: createCaizhilianHost(ctx),
|
|
9987
|
-
continuation: createCaizhilianContinuationSigner(ctx)
|
|
9988
|
-
});
|
|
9989
|
-
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
9990
|
-
} catch (error) {
|
|
9991
|
-
console.error(JSON.stringify(failureEnvelope(error), null, 2));
|
|
9992
|
-
process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
|
|
9993
|
-
}
|
|
9994
|
-
}
|
|
9995
|
-
function operationsCatalog() {
|
|
9996
|
-
const groups = /* @__PURE__ */ new Map();
|
|
9997
|
-
for (const definition of caizhilianOperationDefinitions()) {
|
|
9998
|
-
const list = groups.get(definition.resource) ?? [];
|
|
9999
|
-
list.push({
|
|
10000
|
-
name: definition.name,
|
|
10001
|
-
summary: definition.summary,
|
|
10002
|
-
risk: definition.risk,
|
|
10003
|
-
...definition.requiresConfirmation ? { requiresConfirmation: true } : {},
|
|
10004
|
-
sourceOperation: definition.sourceOperation
|
|
10005
|
-
});
|
|
10006
|
-
groups.set(definition.resource, list);
|
|
10007
|
-
}
|
|
10008
|
-
return {
|
|
10009
|
-
schemaVersion: 1,
|
|
10010
|
-
ok: true,
|
|
10011
|
-
module: caizhilianManifest.name,
|
|
10012
|
-
sourceSkill: caizhilianManifest.sourceSkill,
|
|
10013
|
-
total: caizhilianOperationDefinitions().length,
|
|
10014
|
-
groups: [...groups.entries()].map(([resource, operations]) => ({ resource, operations })),
|
|
10015
|
-
withheldOperations: caizhilianManifest.withheldOperations
|
|
10016
|
-
};
|
|
10017
|
-
}
|
|
10018
|
-
function withJsonInputOptions(command) {
|
|
10019
|
-
return command.option("--input <path>", "JSON input file, or - for stdin").option("--input-json <json>", "inline JSON input object");
|
|
10020
|
-
}
|
|
10021
|
-
var caizhilianShortcut = {
|
|
10022
|
-
name: "caizhilian",
|
|
10023
|
-
description: "\u6CDB\u5FAEE10\u91C7\u77E5\u8FDE\uFF08\u6587\u6863\u4E2D\u5FC3\uFF09CLI",
|
|
10024
|
-
category: "shortcut",
|
|
10025
|
-
register({ program, action }) {
|
|
10026
|
-
const caizhilian = program.command("caizhilian").description("\u6CDB\u5FAEE10\u91C7\u77E5\u8FDE\u6587\u6863\u4E2D\u5FC3\uFF08\u6587\u6863/\u6587\u4EF6\u5939/\u6743\u9650\u5171\u4EAB/\u6807\u7B7E/\u53C2\u4E0E\u4EBA/\u9644\u4EF6/\u5C01\u9762/\u6587\u6863\u6BD4\u5BF9\uFF09");
|
|
10027
|
-
caizhilian.command("schema").description("Print caizhilian operation manifest for agents").action(
|
|
10028
|
-
action((ctx) => {
|
|
10029
|
-
ctx.output.write(caizhilianManifest, { json: true });
|
|
10030
|
-
})
|
|
10031
|
-
);
|
|
10032
|
-
caizhilian.command("operations").description("List caizhilian operations grouped by resource").action(
|
|
10033
|
-
action((ctx) => {
|
|
10034
|
-
ctx.output.write(operationsCatalog(), { json: true });
|
|
10035
|
-
})
|
|
10036
|
-
);
|
|
10037
|
-
withJsonInputOptions(
|
|
10038
|
-
caizhilian.command("run").description("Run a caizhilian operation with JSON input").argument("<operation>", "operation name, e.g. caizhilian.document.search / caizhilian.tag.add.apply").option("--continuation <token>", "prepare \u8FD4\u56DE\u7684\u786E\u8BA4\u7968\u636E\uFF08apply \u5FC5\u586B\uFF09").option("--yes", "confirm the write operation\uFF08apply \u5FC5\u586B\uFF09")
|
|
10039
|
-
).action(
|
|
10040
|
-
action(async (ctx, operation, options) => {
|
|
10041
|
-
const opts = asOptions(options);
|
|
10042
|
-
await executeAndPrint(
|
|
10043
|
-
ctx,
|
|
10044
|
-
String(operation),
|
|
10045
|
-
await inputFrom(options, {
|
|
10046
|
-
continuation: opts.continuation,
|
|
10047
|
-
confirm: opts.yes === true ? true : void 0
|
|
10048
|
-
})
|
|
10049
|
-
);
|
|
10050
|
-
})
|
|
10051
|
-
);
|
|
10052
|
-
withJsonInputOptions(
|
|
10053
|
-
caizhilian.command("search").description("\u68C0\u7D22\u6587\u6863\uFF08caizhilian.document.search \u8584\u5305\u88C5\uFF09").option("--keywords <kw>", "\u68C0\u7D22\u5173\u952E\u8BCD").option("--folder-id <id>", "\u6587\u4EF6\u5939 ID\uFF1A100=\u7CFB\u7EDF\uFF0C200=\u516C\u5171\uFF0C300=\u4E2A\u4EBA").option("--page-no <n>", "\u9875\u7801\uFF081-indexed\uFF09").option("--page-size <n>", "\u6BCF\u9875\u6761\u6570")
|
|
10054
|
-
).action(
|
|
10055
|
-
action(async (ctx, options) => {
|
|
10056
|
-
const opts = asOptions(options);
|
|
10057
|
-
await executeAndPrint(
|
|
10058
|
-
ctx,
|
|
10059
|
-
"caizhilian.document.search",
|
|
10060
|
-
await inputFrom(options, {
|
|
10061
|
-
keywords: opts.keywords,
|
|
10062
|
-
folder_id: opts.folderId,
|
|
10063
|
-
page_no: opts.pageNo,
|
|
10064
|
-
page_size: opts.pageSize
|
|
10065
|
-
})
|
|
10066
|
-
);
|
|
10067
|
-
})
|
|
10068
|
-
);
|
|
10069
|
-
withJsonInputOptions(
|
|
10070
|
-
caizhilian.command("get").description("\u67E5\u8BE2\u6587\u6863\u8BE6\u60C5\uFF08caizhilian.document.get \u8584\u5305\u88C5\uFF09").option("--doc-id <id>", "\u6587\u6863 ID\uFF08\u5FC5\u586B\uFF09")
|
|
10071
|
-
).action(
|
|
10072
|
-
action(async (ctx, options) => {
|
|
10073
|
-
const opts = asOptions(options);
|
|
10074
|
-
await executeAndPrint(ctx, "caizhilian.document.get", await inputFrom(options, { doc_id: opts.docId }));
|
|
10075
|
-
})
|
|
10076
|
-
);
|
|
10077
|
-
caizhilian.command("health").description("\u91C7\u77E5\u8FDE\u63A5\u53E3\u8FDE\u901A\u6027\u4E0E\u767B\u5F55\u6001\u81EA\u68C0\uFF08caizhilian.system.health \u8584\u5305\u88C5\uFF09").action(
|
|
10078
|
-
action(async (ctx) => {
|
|
10079
|
-
await executeAndPrint(ctx, "caizhilian.system.health", {});
|
|
10080
|
-
})
|
|
10081
|
-
);
|
|
10082
|
-
}
|
|
10083
|
-
};
|
|
10084
9611
|
export {
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
9612
|
+
caizhilianOperationDefinitions,
|
|
9613
|
+
caizhilianManifest,
|
|
9614
|
+
executeCaizhilianOperation
|
|
10088
9615
|
};
|