weaver-work-cli 0.1.1 → 0.1.4
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 +187 -76
- package/dist/cmd/setup/index.js +5 -5
- package/dist/cmd/skills/index.js +1 -1
- package/dist/core/hooks.js +7 -0
- package/dist/index.js +0 -0
- package/dist/internal/e10/auth/commands.js +160 -55
- package/dist/internal/e10/auth/crypto.js +7 -22
- package/dist/internal/e10/auth/session.js +1 -1
- package/dist/internal/e10/auth/xiaoe.js +268 -0
- package/dist/internal/e10/context.js +16 -2
- package/dist/internal/e10/index.js +1 -0
- package/dist/internal/e10/request-runtime.js +344 -0
- package/dist/internal/skills/install.js +48 -6
- package/dist/internal/skills/reader.js +27 -0
- package/dist/shortcuts/archive/continuation.js +70 -0
- package/dist/shortcuts/archive/errors.js +53 -0
- package/dist/shortcuts/archive/host.js +197 -0
- package/dist/shortcuts/archive/index.js +363 -0
- package/dist/shortcuts/archive/manifest.js +45 -0
- package/dist/shortcuts/archive/operations/archive-info.js +55 -0
- package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
- package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
- package/dist/shortcuts/archive/operations/confirm.js +46 -0
- package/dist/shortcuts/archive/operations/download.js +238 -0
- package/dist/shortcuts/archive/operations/flow-url.js +240 -0
- package/dist/shortcuts/archive/operations/fonds.js +95 -0
- package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
- package/dist/shortcuts/archive/operations/registry.js +43 -0
- package/dist/shortcuts/archive/operations/search.js +88 -0
- package/dist/shortcuts/archive/operations/shared.js +120 -0
- package/dist/shortcuts/archive/operations/types.js +23 -0
- package/dist/shortcuts/archive/operations/upload.js +182 -0
- package/dist/shortcuts/archive/operations.js +13 -0
- package/dist/shortcuts/archive/render/search-format.js +276 -0
- package/dist/shortcuts/archive/render/search-view.js +125 -0
- package/dist/shortcuts/asset/continuation.js +70 -0
- package/dist/shortcuts/asset/errors.js +67 -0
- package/dist/shortcuts/asset/host.js +438 -0
- package/dist/shortcuts/asset/index.js +255 -0
- package/dist/shortcuts/asset/manifest.js +471 -0
- package/dist/shortcuts/asset/operations/query.js +249 -0
- package/dist/shortcuts/asset/operations/registry.js +85 -0
- package/dist/shortcuts/asset/operations/shared.js +100 -0
- package/dist/shortcuts/asset/operations/type-cache.js +49 -0
- package/dist/shortcuts/asset/operations/types.js +1 -0
- package/dist/shortcuts/asset/operations/viewlink.js +117 -0
- package/dist/shortcuts/asset/operations/write.js +435 -0
- package/dist/shortcuts/asset/operations.js +9 -0
- package/dist/shortcuts/calendar/continuation.js +70 -0
- package/dist/shortcuts/calendar/errors.js +53 -0
- package/dist/shortcuts/calendar/host.js +148 -0
- package/dist/shortcuts/calendar/index.js +125 -0
- package/dist/shortcuts/calendar/manifest.js +26 -0
- package/dist/shortcuts/calendar/operations/read.js +259 -0
- package/dist/shortcuts/calendar/operations/registry.js +31 -0
- package/dist/shortcuts/calendar/operations/shared.js +132 -0
- package/dist/shortcuts/calendar/operations/types.js +25 -0
- package/dist/shortcuts/calendar/operations/write.js +439 -0
- package/dist/shortcuts/calendar/operations.js +8 -0
- package/dist/shortcuts/ehr/continuation.js +70 -0
- package/dist/shortcuts/ehr/errors.js +53 -0
- package/dist/shortcuts/ehr/host.js +213 -0
- package/dist/shortcuts/ehr/index.js +205 -0
- package/dist/shortcuts/ehr/manifest.js +47 -0
- package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
- package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
- package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
- package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
- package/dist/shortcuts/ehr/operations/recruit.js +803 -0
- package/dist/shortcuts/ehr/operations/registry.js +43 -0
- package/dist/shortcuts/ehr/operations/salary.js +319 -0
- package/dist/shortcuts/ehr/operations/shared.js +246 -0
- package/dist/shortcuts/ehr/operations/types.js +25 -0
- package/dist/shortcuts/ehr/operations.js +25 -0
- package/dist/shortcuts/esb/continuation.js +70 -0
- package/dist/shortcuts/esb/errors.js +65 -0
- package/dist/shortcuts/esb/host.js +187 -0
- package/dist/shortcuts/esb/index.js +112 -0
- package/dist/shortcuts/esb/manifest.js +91 -0
- package/dist/shortcuts/esb/operations/input-format.js +31 -0
- package/dist/shortcuts/esb/operations/registry.js +48 -0
- package/dist/shortcuts/esb/operations/shared.js +152 -0
- package/dist/shortcuts/esb/operations/trigger.js +76 -0
- package/dist/shortcuts/esb/operations/types.js +21 -0
- package/dist/shortcuts/esb/operations.js +15 -0
- package/dist/shortcuts/fna/continuation.js +70 -0
- package/dist/shortcuts/fna/errors.js +59 -0
- package/dist/shortcuts/fna/host.js +146 -0
- package/dist/shortcuts/fna/index.js +111 -0
- package/dist/shortcuts/fna/manifest.js +41 -0
- package/dist/shortcuts/fna/operations/budget.js +124 -0
- package/dist/shortcuts/fna/operations/expense-center.js +148 -0
- package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
- package/dist/shortcuts/fna/operations/loan.js +195 -0
- package/dist/shortcuts/fna/operations/registry.js +35 -0
- package/dist/shortcuts/fna/operations/shared.js +210 -0
- package/dist/shortcuts/fna/operations/types.js +25 -0
- package/dist/shortcuts/fna/operations.js +19 -0
- package/dist/shortcuts/hrm/errors.js +38 -0
- package/dist/shortcuts/hrm/host.js +156 -0
- package/dist/shortcuts/hrm/index.js +111 -0
- package/dist/shortcuts/hrm/manifest.js +32 -0
- package/dist/shortcuts/hrm/operations/employee.js +338 -0
- package/dist/shortcuts/hrm/operations/org.js +110 -0
- package/dist/shortcuts/hrm/operations/position.js +176 -0
- package/dist/shortcuts/hrm/operations/registry.js +33 -0
- package/dist/shortcuts/hrm/operations/shared.js +143 -0
- package/dist/shortcuts/hrm/operations/types.js +23 -0
- package/dist/shortcuts/hrm/operations.js +19 -0
- package/dist/shortcuts/index.js +20 -0
- package/dist/shortcuts/invoice/host.js +99 -94
- package/dist/shortcuts/invoice/index.js +65 -61
- package/dist/shortcuts/invoice/manifest.js +222 -14
- package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
- package/dist/shortcuts/invoice/operations/issuing.js +198 -0
- package/dist/shortcuts/invoice/operations/ocr-preview.js +6 -3
- package/dist/shortcuts/invoice/operations/registry.js +17 -0
- package/dist/shortcuts/invoice/operations/reim.js +401 -0
- package/dist/shortcuts/invoice/operations/shared.js +271 -6
- package/dist/shortcuts/invoice/operations/validate-preview.js +1 -1
- package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
- package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
- package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
- package/dist/shortcuts/jiuchuanhui/host.js +159 -0
- package/dist/shortcuts/jiuchuanhui/index.js +109 -0
- package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
- package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
- package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
- package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
- package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
- package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
- package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
- package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
- package/dist/shortcuts/mail/continuation.js +70 -0
- package/dist/shortcuts/mail/errors.js +53 -0
- package/dist/shortcuts/mail/host.js +182 -0
- package/dist/shortcuts/mail/index.js +519 -0
- package/dist/shortcuts/mail/manifest.js +38 -0
- package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
- package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
- package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
- package/dist/shortcuts/mail/operations/mail-read.js +508 -0
- package/dist/shortcuts/mail/operations/mail-send.js +474 -0
- package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
- package/dist/shortcuts/mail/operations/mail-template.js +170 -0
- package/dist/shortcuts/mail/operations/registry.js +41 -0
- package/dist/shortcuts/mail/operations/shared.js +64 -0
- package/dist/shortcuts/mail/operations/types.js +27 -0
- package/dist/shortcuts/mail/operations.js +19 -0
- package/dist/shortcuts/plan/continuation.js +70 -0
- package/dist/shortcuts/plan/errors.js +70 -0
- package/dist/shortcuts/plan/host.js +180 -0
- package/dist/shortcuts/plan/index.js +150 -0
- package/dist/shortcuts/plan/manifest.js +53 -0
- package/dist/shortcuts/plan/operations/link.js +256 -0
- package/dist/shortcuts/plan/operations/read.js +259 -0
- package/dist/shortcuts/plan/operations/registry.js +33 -0
- package/dist/shortcuts/plan/operations/shared.js +246 -0
- package/dist/shortcuts/plan/operations/types.js +49 -0
- package/dist/shortcuts/plan/operations/version.js +49 -0
- package/dist/shortcuts/plan/operations/write.js +710 -0
- package/dist/shortcuts/plan/operations.js +8 -0
- package/docs/SKILL.md +11 -7
- package/docs/_catalog.md +23 -5
- package/docs/agent-invoice.md +31 -10
- package/docs/agent-skill-install.md +211 -0
- package/docs/calendar.md +87 -0
- package/docs/e10-auth.md +28 -9
- package/docs/ehr.md +186 -0
- package/docs/esb.md +64 -0
- package/docs/fna.md +72 -0
- package/docs/hrm.md +89 -0
- package/docs/invoice.md +66 -20
- package/docs/jiuchuanhui.md +131 -0
- package/docs/operation-manual.md +443 -0
- package/docs/plan.md +82 -0
- package/docs/wenshuding.md +129 -0
- package/docs/ziguanjia.md +89 -0
- package/package.json +4 -4
- package/scripts/package-skill.mjs +127 -34
- package/scripts/postbuild.mjs +13 -0
- package/skill-template/business-info.json +13 -2
- package/skill-template/domains/calendar.md +15 -0
- package/skill-template/domains/esb.md +13 -0
- package/skill-template/domains/hrm.md +16 -0
- package/skill-template/domains/jiuchuanhui.md +23 -0
- package/skill-template/domains/jucailin.md +22 -0
- package/skill-template/domains/mail.md +21 -0
- package/skill-template/domains/plan.md +17 -0
- package/skill-template/domains/qiyecheng.md +17 -0
- package/skill-template/domains/shared.md +9 -3
- package/skill-template/domains/skill-maker.md +10 -0
- package/skill-template/domains/wenshuding.md +22 -0
- package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
- package/skill-template/domains/ziguanjia.md +21 -0
- package/skill-template/master-skill-template.md +12 -6
- package/skill-template/skill-template.md +40 -9
- package/skills/weaver-e10-calendar/SKILL.md +101 -0
- package/skills/weaver-e10-calendar/product.json +8 -0
- package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
- package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
- package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
- package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
- package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
- package/skills/weaver-e10-esb/SKILL.md +102 -0
- package/skills/weaver-e10-esb/product.json +8 -0
- package/skills/weaver-e10-esb/references/input-format.md +52 -0
- package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
- package/skills/weaver-e10-esb/references/trigger.md +99 -0
- package/skills/weaver-e10-hrm/SKILL.md +87 -0
- package/skills/weaver-e10-hrm/product.json +8 -0
- package/skills/weaver-e10-hrm/references/employee.md +109 -0
- package/skills/weaver-e10-hrm/references/org.md +95 -0
- package/skills/weaver-e10-hrm/references/position.md +95 -0
- package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +174 -0
- package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
- package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
- package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
- package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
- package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
- package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
- package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
- package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
- package/skills/weaver-e10-jucailin/SKILL.md +101 -0
- package/skills/weaver-e10-jucailin/product.json +8 -0
- package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
- package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
- package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
- package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
- package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
- package/skills/weaver-e10-jucailin/references/salary.md +110 -0
- package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
- package/skills/weaver-e10-mail/SKILL.md +151 -0
- package/skills/weaver-e10-mail/product.json +8 -0
- package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
- package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
- package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
- package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
- package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
- package/skills/weaver-e10-mail/references/mail-read.md +76 -0
- package/skills/weaver-e10-mail/references/mail-send.md +43 -0
- package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
- package/skills/weaver-e10-mail/references/mail-template.md +31 -0
- package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
- package/skills/weaver-e10-plan/SKILL.md +139 -0
- package/skills/weaver-e10-plan/product.json +8 -0
- package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
- package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
- package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
- package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +118 -0
- package/skills/weaver-e10-qiyecheng/product.json +8 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
- package/skills/weaver-e10-shared/SKILL.md +86 -0
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
- package/skills/weaver-e10-shared/references/json-output-contract.md +120 -0
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
- package/skills/weaver-e10-skill-maker/SKILL.md +77 -0
- package/skills/weaver-e10-skill-maker/product.json +8 -0
- package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
- package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
- package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
- package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
- package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
- package/skills/weaver-e10-wenshuding/SKILL.md +157 -0
- package/skills/weaver-e10-wenshuding/product.json +8 -0
- package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
- package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
- package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
- package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
- package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
- package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
- package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +47 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-download.md +31 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +45 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +15 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +45 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +14 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +58 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +10 -3
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
- package/skills/weaver-e10-ziguanjia/SKILL.md +162 -0
- package/skills/weaver-e10-ziguanjia/product.json +8 -0
- package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
- package/skills/weaver-work-cli-invoice/SKILL.md +0 -103
- package/skills/weaver-work-cli-invoice/references/invoice-agent-entry.md +0 -38
- package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
- package/skills/weaver-work-cli-invoice/references/invoice-download.md +0 -22
- package/skills/weaver-work-cli-invoice/references/invoice-enterprise-list.md +0 -35
- package/skills/weaver-work-cli-invoice/references/invoice-import.md +0 -28
- package/skills/weaver-work-cli-invoice/references/invoice-personal-list.md +0 -47
- package/skills/weaver-work-cli-shared/SKILL.md +0 -53
- package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -83
- package/skills/weaver-work-cli-shared/references/json-output-contract.md +0 -61
- package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -61
- /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
- /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getPlanOperation } from './operations/registry.js';
|
|
2
|
+
import { asObject, assertNoForbiddenKeys } from './operations/shared.js';
|
|
3
|
+
export async function executePlanOperation(operation, rawInput, context) {
|
|
4
|
+
const definition = getPlanOperation(operation);
|
|
5
|
+
const input = asObject(rawInput);
|
|
6
|
+
assertNoForbiddenKeys(input);
|
|
7
|
+
return definition.handler(input, context);
|
|
8
|
+
}
|
package/docs/SKILL.md
CHANGED
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
|
|
7
7
|
- `src/cmd`:框架内置命令、平台命令和 `skills list/read`。
|
|
8
8
|
- `src/internal/e10`:E10 session、profile、auth 文件和 API client。
|
|
9
|
-
- `src/shortcuts`:面向人和 Agent 的高层业务 CLI 能力,按业务模块分目录;模块内每个业务 operation 用相对独立的 class
|
|
10
|
-
- `skills`:随包发布的 Agent Skill,按业务模块分目录;每个模块对应一个独立 Skill,入口 `SKILL.md` 只做路由,具体操作细节放到 `references/`,公共约束通过 `weaver-
|
|
9
|
+
- `src/shortcuts`:面向人和 Agent 的高层业务 CLI 能力,按业务模块分目录;模块内每个业务 operation 用相对独立的 class 封装。使用 Skill Maker 新增业务模块时,默认同步生成或更新对应 shortcut。
|
|
10
|
+
- `skills`:随包发布的 Agent Skill,按业务模块分目录;每个模块对应一个独立 Skill,入口 `SKILL.md` 只做路由,具体操作细节放到 `references/`,公共约束通过 `weaver-e10-shared` 复用。
|
|
11
11
|
- `skill-template`:新增或重写业务 Skill 的模板来源;结构参考飞书 CLI 的 `skill-template`,用于保持入口、路由关键词、业务域说明和 reference 拆分方式一致。
|
|
12
12
|
|
|
13
13
|
使用内置 docs 命令可以把当前文档目录复制到业务工作区:
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```text
|
|
16
16
|
weaver-work-cli docs copy
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
后续业务模块应在 `src/shortcuts/<name>` 下维护源码,在 `skills/weaver-e10-<name>` 下维护对应 Agent Skill,在 `_catalog.md` 和 `skill-template/business-info.json` 中补充对应的加载规则。新增或更新模块时,先按 `skills/weaver-e10-skill-maker/references/module-cli-generation.md` 定正确实现面、operation 合约、测试断言和 Skill/CLI 一致性。业务 Skill 直接声明并调用 `weaver-work-cli` bin,不为每个业务模块复制 bootstrap 脚本。
|
|
20
20
|
|
|
21
21
|
业务 Skill 目录约定:
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
|
-
skills/weaver-
|
|
24
|
+
skills/weaver-e10-<name>/
|
|
25
25
|
SKILL.md 入口路由:共享规则、schema、reference 索引、禁用边界。
|
|
26
26
|
product.json 可选:Skill 包元信息。
|
|
27
27
|
references/ 具体业务 reference,按用户意图和 operation 分文件。
|
|
@@ -31,6 +31,10 @@ skills/weaver-work-cli-<name>/
|
|
|
31
31
|
|
|
32
32
|
## 已内置业务模块
|
|
33
33
|
|
|
34
|
-
- `invoice`:E10 业票通发票管理。源码说明先读 `docs/invoice.md`;面向 Agent 时先读 `skills/weaver-
|
|
34
|
+
- `invoice`:E10 业票通发票管理。源码说明先读 `docs/invoice.md`;面向 Agent 时先读 `skills/weaver-e10-yepiaotong/SKILL.md`,再按入口路由读取对应 reference。
|
|
35
|
+
- `fna`:E10 齐业成费控中心(预算查询/费用中心/借款管理/发票核销)。源码说明先读 `docs/fna.md`;面向 Agent 时先读 `skills/weaver-e10-qiyecheng/SKILL.md`,再按入口路由读取对应 reference。写操作(提醒还款/催票)走 prepare/apply 确认链。
|
|
36
|
+
- `plan`:E10 计划报告(报告查询/新建/修改/发布/撤回/提交提醒/评论),自动适配标准版与 e10-ebuilder 两套报告接口链路。源码说明先读 `docs/plan.md`;面向 Agent 时先读 `skills/weaver-e10-plan/SKILL.md`,再按入口路由读取对应 reference。写操作走 prepare/apply 确认链。
|
|
37
|
+
- `esb`:E10 ESB 中心自定义触发动作流(入参模板查询 + 触发)。源码说明先读 `docs/esb.md`;面向 Agent 时先读 `skills/weaver-e10-esb/SKILL.md`,再按入口路由读取对应 reference。触发动作流是写操作,走 prepare/apply 确认链。
|
|
38
|
+
- `skill-maker`:把用户提供的新业务模块文档或代码转换成 `weaver-e10-*` Agent Skill,通过源资料指纹检测更新,用泛微技能检测工具做发布前静态质检,并在检测通过后询问是否安装到当前智能体。面向 Agent 时先读 `skills/weaver-e10-skill-maker/SKILL.md`。
|
|
35
39
|
|
|
36
|
-
Agent 调用业务能力时优先使用 `weaver-work-cli --json
|
|
40
|
+
Agent 调用业务能力时优先使用 `weaver-work-cli --json <command> run <operation> --input-json '<json>'`;复杂或多行 JSON 用 UTF-8 文件和 `--input <path>`,只有确认当前 shell 能稳定传管道时才使用 `--input -`。不要绕过 CLI 直接拼业务 HTTP。新增业务模块时,如果源资料不足以实现 CLI,先向用户列出缺口并确认,不生成假 operation。
|
package/docs/_catalog.md
CHANGED
|
@@ -5,8 +5,26 @@
|
|
|
5
5
|
| CLI 框架、钩子、system/platform/business 分层、新增模块 | `docs/SKILL.md` |
|
|
6
6
|
| E10 鉴权、profile、共享 API client | `docs/e10-auth.md` |
|
|
7
7
|
| Agent Skill 模板、业务域关键词、入口和 reference 拆分方式 | `skill-template/` |
|
|
8
|
-
| Agent 共享规则、安装检查、JSON 输出、高风险写入 | `skills/weaver-
|
|
9
|
-
| Agent 共享规则细节:安装、E10 登录、JSON 输出、写入协议 | `skills/weaver-
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
8
|
+
| Agent 共享规则、安装检查、JSON 输出、高风险写入 | `skills/weaver-e10-shared/SKILL.md` |
|
|
9
|
+
| Agent 共享规则细节:安装、E10 登录、JSON 输出、写入协议 | `skills/weaver-e10-shared/references/` |
|
|
10
|
+
| 业票通发票管理、报销填单、智能开票、invoice operation、写操作 prepare/apply | `docs/invoice.md` |
|
|
11
|
+
| 聚才林人事云(人事档案/出勤/薪酬)、ehr operation、写操作 prepare/apply | `docs/ehr.md` |
|
|
12
|
+
| 齐业成费控中心(预算/费用中心/借款管理/发票核销)、fna operation、提醒还款与催票 prepare/apply | `docs/fna.md` |
|
|
13
|
+
| 文书定档案管理(全宗/检索/借阅车/借阅单/发起借阅/预归档上传)、wenshuding operation | `docs/wenshuding.md` |
|
|
14
|
+
| 计划报告管理(报告查询/新建/修改/发布/撤回/提交提醒/评论)、plan operation、写操作 prepare/apply | `docs/plan.md` |
|
|
15
|
+
| E10 ESB 中心自定义触发动作流(入参模板查询 / prepare-apply 触发)、esb operation | `docs/esb.md` |
|
|
16
|
+
| 快速安装 CLI,并使用 CLI/Skill Maker 生成、验证、打包和安装业务模块 Skill | `docs/operation-manual.md` |
|
|
17
|
+
| 把随包 Agent Skill 安装/升级到本机 Agent(Codex/WorkBuddy 目录、从本地仓库发布最新版) | `docs/agent-skill-install.md` |
|
|
18
|
+
| Agent 调用业票通 CLI 的入口路由 | `skills/weaver-e10-yepiaotong/SKILL.md` |
|
|
19
|
+
| Agent 调用业票通 CLI 的具体 reference | `skills/weaver-e10-yepiaotong/references/` |
|
|
20
|
+
| Agent 调用聚才林 CLI 的入口路由 | `skills/weaver-e10-jucailin/SKILL.md` |
|
|
21
|
+
| Agent 调用聚才林 CLI 的具体 reference | `skills/weaver-e10-jucailin/references/` |
|
|
22
|
+
| Agent 调用文书定 CLI 的入口路由 | `skills/weaver-e10-wenshuding/SKILL.md` |
|
|
23
|
+
| Agent 调用文书定 CLI 的具体 reference | `skills/weaver-e10-wenshuding/references/` |
|
|
24
|
+
| Agent 调用齐业成费控 CLI 的入口路由 | `skills/weaver-e10-qiyecheng/SKILL.md` |
|
|
25
|
+
| Agent 调用齐业成费控 CLI 的具体 reference | `skills/weaver-e10-qiyecheng/references/` |
|
|
26
|
+
| Agent 调用计划报告 CLI 的入口路由 | `skills/weaver-e10-plan/SKILL.md` |
|
|
27
|
+
| Agent 调用计划报告 CLI 的具体 reference | `skills/weaver-e10-plan/references/` |
|
|
28
|
+
| Agent 调用 ESB 动作流 CLI 的入口路由 | `skills/weaver-e10-esb/SKILL.md` |
|
|
29
|
+
| Agent 调用 ESB 动作流 CLI 的具体 reference | `skills/weaver-e10-esb/references/` |
|
|
30
|
+
| 将新业务模块文档或代码同步转换为 weaver-work-cli 业务 CLI 与 Skill、检测源资料更新 | `skills/weaver-e10-skill-maker/SKILL.md` |
|
package/docs/agent-invoice.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
安装后的 Agent Skill 已拆为入口和 references:
|
|
6
6
|
|
|
7
|
-
- `skills/weaver-
|
|
8
|
-
- `skills/weaver-
|
|
9
|
-
- `skills/weaver-
|
|
7
|
+
- `skills/weaver-e10-shared/SKILL.md`:安装检查、E10 认证、JSON 输出、高风险写入和安全边界。
|
|
8
|
+
- `skills/weaver-e10-yepiaotong/SKILL.md`:业票通入口路由。
|
|
9
|
+
- `skills/weaver-e10-yepiaotong/references/`:按 schema、查询、文件预览、流程发票字段、报销、开票、写入和暂缓能力拆分的具体说明。
|
|
10
10
|
|
|
11
11
|
## 准备
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```text
|
|
14
14
|
weaver-work-cli --version
|
|
15
15
|
weaver-work-cli doctor --e10
|
|
16
16
|
weaver-work-cli invoice schema
|
|
@@ -18,35 +18,56 @@ weaver-work-cli invoice schema
|
|
|
18
18
|
|
|
19
19
|
如未登录,先让用户完成:
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
weaver-work-cli auth login --base-url "https://weapp.xxx.cn"
|
|
21
|
+
```text
|
|
22
|
+
weaver-work-cli auth login --base-url "https://weapp.xxx.cn" --agent_type "<当前智能体名称>"
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## 固定入口
|
|
26
26
|
|
|
27
|
-
Agent
|
|
27
|
+
Agent 优先使用统一 operation 入口。简单 JSON 用 `--input-json`,复杂 JSON 用临时文件和 `--input <path>`;只有确认当前 shell 能稳定传管道时才使用 `--input -`。
|
|
28
|
+
|
|
29
|
+
Windows PowerShell:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0}'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
macOS/Linux(bash/zsh):
|
|
28
36
|
|
|
29
37
|
```bash
|
|
30
|
-
weaver-work-cli --json invoice run
|
|
38
|
+
weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0}'
|
|
31
39
|
```
|
|
32
40
|
|
|
33
41
|
不要直接 `curl`、`fetch` 或浏览器自动化访问 E10 `/api/inc/*`。不要输出或索取 Cookie、ETEAMSID、发票 Token。
|
|
34
42
|
|
|
43
|
+
## 输出与大数据处理
|
|
44
|
+
|
|
45
|
+
当前项目的输出方式是 JSON envelope 直接写 stdout,失败 envelope 写 stderr;不像飞书 CLI 已内置 `--format table/pretty/ndjson`、`--jq` 和通用翻页参数。因此 Agent 调用时要主动控量:
|
|
46
|
+
|
|
47
|
+
- 列表默认 `page_size=10`,需要更多时再按 `start_pos` 分页。
|
|
48
|
+
- 回复用户时只展示结论、数量、关键字段和下一步,不要原样粘完整 stdout JSON。
|
|
49
|
+
- 发票列表/详情优先展示 `fid`、代码/号码、购销方、金额、日期、查验/报销状态和附件摘要。
|
|
50
|
+
- 全量统计按页读取并只累计必要字段;超长 OCR、详情或调试 JSON 需要保留时落本地文件,再返回路径和摘要。
|
|
51
|
+
|
|
35
52
|
## 推荐工作流
|
|
36
53
|
|
|
37
54
|
处理“把这张发票录入业票通”的典型流程:
|
|
38
55
|
|
|
39
56
|
1. 查询个人票夹和企业票夹,确认目标不存在。
|
|
40
57
|
2. `invoice.ocr.preview` 预览文件识别结果,预览阶段固定不保存。
|
|
41
|
-
3. 用户确认后执行 `invoice.import.prepare`,输入必须显式包含 `validate` 和 `syncToOa
|
|
58
|
+
3. 用户确认后执行 `invoice.import.prepare`,输入必须显式包含 `validate` 和 `syncToOa`;默认传 `validate=true`、`syncToOa=true`,表示导入时请求服务端查验并按服务端要求同步 OA。
|
|
42
59
|
4. 把 prepare 返回的 `continuation` 原样交给 `invoice.import.apply`,并传 `confirm=true`。
|
|
43
60
|
5. 使用返回的 `fid` 回查详情,按实际结果报告查验状态、写入状态和附件信息。
|
|
44
61
|
|
|
62
|
+
只有用户明确要求跳过发票查验或离线导入时,Agent 才能传 `validate=false`。这种结果必须报告为“跳过查验”,不能写成“查验通过”。
|
|
63
|
+
|
|
45
64
|
删除、编辑、新增同样必须使用 `prepare -> apply`。出现 `partial/write_uncertain` 时停止,不能自动重试写操作。
|
|
46
65
|
|
|
66
|
+
处理“把发票填进流程表单”的场景,使用 `invoice.browse-field.data` 生成浏览按钮控件所需 JSON。处理“报销发票/自动填单”时,先读取 `invoice-reim.md`,用报销相关只读 operation 获取事前申请、工作流、表单结构、预填信息和人员上级;Agent 组装 payload 后,必须通过 `invoice.reim.flow.create.prepare/apply` 或 `invoice.reim.flow.update.prepare/apply` 写入。处理“开票/存台账”时,先读取 `invoice-issuing.md`,字段提取、税率确认和金额校验完成后,再走 `invoice.issuing.make.prepare/apply`。
|
|
67
|
+
|
|
47
68
|
## 暂缓能力
|
|
48
69
|
|
|
49
|
-
|
|
70
|
+
以下新版源资料已有提交接口,但当前仍不暴露为 Agent 操作:
|
|
50
71
|
|
|
51
72
|
- 共享发票:缺接收人的稳定 `appid/cid/uid` 解析和共享关系回查契约。
|
|
52
73
|
- 转让发票:会改变持有人,缺接收人侧归属回查契约。
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Agent Skill 安装与升级
|
|
2
|
+
|
|
3
|
+
本文说明如何把 `weaver-work-cli` 随包 Agent Skill(以 `yepiaotong` 为例)安装或升级到本机 Agent 的 skill 目录。适用两类读者:
|
|
4
|
+
|
|
5
|
+
- 首次让 Codex / WorkBuddy 等 Agent 识别发票业务的使用者;
|
|
6
|
+
- 在本仓库修改 Skill 内容后,需要把最新版同步到本机 Agent 环境的开发者。
|
|
7
|
+
|
|
8
|
+
Agent 运行期调用规则不在这里,见 `skills/weaver-e10-shared/SKILL.md` 与 `skills/weaver-e10-yepiaotong/SKILL.md`。人类视角的安装总览见 `README.md`。
|
|
9
|
+
|
|
10
|
+
本文命令示例按平台选择执行。涉及用户目录、路径、文件删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例。Agent 应先判断当前环境,Windows 或 PowerShell 用 Windows 示例,macOS/Linux、bash 或 zsh 用 macOS/Linux 示例;不确定时用 `node -p "process.platform"` 判断。
|
|
11
|
+
|
|
12
|
+
## Agent 自动安装 CLI 运行时
|
|
13
|
+
|
|
14
|
+
如果安装 Skill 前发现 `weaver-work-cli` 命令不可用,Agent 可以在用户明确同意后代装运行时。提示必须让用户选择安装来源:npm 源,或本地代码。选择本地代码时,用户必须提供 `weaver-work-cli` 仓库目录的绝对路径。
|
|
15
|
+
|
|
16
|
+
建议提示词:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
未检测到可用的 weaver-work-cli。是否允许我为当前智能体安装运行时?
|
|
20
|
+
|
|
21
|
+
请选择安装来源:
|
|
22
|
+
1. npm 源安装:使用当前 npm registry;如需公司私有 registry,请同时提供 registry 地址。
|
|
23
|
+
2. 本地代码安装:请提供 weaver-work-cli 仓库目录的绝对路径。
|
|
24
|
+
|
|
25
|
+
我会先检查 node/npm 版本,安装后再运行 weaver-work-cli --version 和 weaver-work-cli skills list 验证。
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
npm 源安装命令;如用户指定公司 registry,把 `npm install -g weaver-work-cli` 替换为 `npm install -g weaver-work-cli --registry "<NPM_REGISTRY_URL>"`:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
node --version
|
|
32
|
+
npm --version
|
|
33
|
+
npm config get registry
|
|
34
|
+
npm install -g weaver-work-cli
|
|
35
|
+
weaver-work-cli --version
|
|
36
|
+
weaver-work-cli skills list
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
本地代码安装命令:
|
|
40
|
+
|
|
41
|
+
Windows PowerShell:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
$WeaverWorkCliRoot = "C:\path\to\weaver-work-cli"
|
|
45
|
+
if (-not (Test-Path "$WeaverWorkCliRoot\package.json")) { throw "invalid weaver-work-cli path" }
|
|
46
|
+
Set-Location $WeaverWorkCliRoot
|
|
47
|
+
npm install
|
|
48
|
+
npm run build
|
|
49
|
+
npm link
|
|
50
|
+
weaver-work-cli --version
|
|
51
|
+
weaver-work-cli skills list
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
macOS/Linux(bash/zsh):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
WEAVER_WORK_CLI_ROOT="/path/to/weaver-work-cli"
|
|
58
|
+
test -f "$WEAVER_WORK_CLI_ROOT/package.json" || exit 1
|
|
59
|
+
cd "$WEAVER_WORK_CLI_ROOT"
|
|
60
|
+
npm install
|
|
61
|
+
npm run build
|
|
62
|
+
npm link
|
|
63
|
+
weaver-work-cli --version
|
|
64
|
+
weaver-work-cli skills list
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 最短命令
|
|
68
|
+
|
|
69
|
+
Windows PowerShell:
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
$AgentSkillsRoot = "C:\path\to\agent-skills"
|
|
73
|
+
if (-not (Test-Path "$AgentSkillsRoot\weaver-e10-shared\SKILL.md")) {
|
|
74
|
+
weaver-work-cli skills install shared --target-dir "$AgentSkillsRoot"
|
|
75
|
+
}
|
|
76
|
+
weaver-work-cli skills install yepiaotong --target-dir "$AgentSkillsRoot"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
macOS/Linux(bash/zsh):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
AGENT_SKILLS_ROOT="/path/to/agent-skills"
|
|
83
|
+
if [ ! -f "$AGENT_SKILLS_ROOT/weaver-e10-shared/SKILL.md" ]; then
|
|
84
|
+
weaver-work-cli skills install shared --target-dir "$AGENT_SKILLS_ROOT"
|
|
85
|
+
fi
|
|
86
|
+
weaver-work-cli skills install yepiaotong --target-dir "$AGENT_SKILLS_ROOT"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- Agent 代装业务 Skill 时,必须先判断目标目录里的 `weaver-e10-shared/SKILL.md` 是否存在;未安装时先执行 `weaver-work-cli skills install shared --target-dir "<agent-skills-root>"`,再安装业务 Skill。
|
|
90
|
+
- `skills install yepiaotong` 的 CLI 层会同时安装 `weaver-e10-shared` 与 `weaver-e10-yepiaotong`,用于命令兜底;但提示词和自动安装流程仍需显式展示 shared 前置检查。
|
|
91
|
+
- 默认目标优先使用环境变量 `CODEX_HOME` 下的 `skills` 子目录;未设置时使用用户主目录下的 `.codex/skills`。其它目录必须用 `--target-dir` 显式指定。
|
|
92
|
+
- 安装是文件拷贝,不需要 E10 登录;登录只在执行业务命令(`invoice run ...`)前需要。
|
|
93
|
+
- 名称支持短名(如 `skill-maker`)、全名 `weaver-e10-skill-maker` 和旧前缀 `weaver-work-cli-skill-maker`;旧前缀会转换为当前名称。建议使用短名,避免不同版本的前缀差异。
|
|
94
|
+
- Skill 生成器拼写为 `maker`,不是 `marker`。名称不存在时会提示相近名称和查询命令,不会自动安装猜测的 Skill。
|
|
95
|
+
|
|
96
|
+
安装 Skill 生成器到 WorkBuddy(macOS/Linux):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
weaver-work-cli skills install skill-maker --target-dir "$HOME/.workbuddy/skills"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 各 Agent 环境的 skill 目录
|
|
103
|
+
|
|
104
|
+
| Agent 环境 | skill 根目录 | 安装方式 |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| Codex CLI | `CODEX_HOME` 下的 `skills`;默认用户主目录下的 `.codex/skills` | `skills install yepiaotong`(默认目标) |
|
|
107
|
+
| WorkBuddy(桌面端) | 用户主目录下的 `.workbuddy/skills`(用户级) | Windows:`skills install yepiaotong --target-dir "$env:USERPROFILE\.workbuddy\skills"`;macOS/Linux:`skills install yepiaotong --target-dir "$HOME/.workbuddy/skills"` |
|
|
108
|
+
| 其它 Agent | 由 Agent 配置决定 | `skills install yepiaotong --target-dir <path>` |
|
|
109
|
+
|
|
110
|
+
不确定 Agent 读哪个目录时先问用户,不要盲目同时安装到多个目录。装到用户主目录下的 `.workbuddy/skills` 不会同步 `.codex/skills`,反之亦然。
|
|
111
|
+
|
|
112
|
+
## 核心事实(先读,避免误操作)
|
|
113
|
+
|
|
114
|
+
1. **内容源是包内 `skills/` 目录**,不经过编译;`npm run build` 只保证 CLI 代码通过构建期 TS 校验,不产出 Skill。
|
|
115
|
+
2. **`skills install` 是拷贝语义**:装出的是真实副本,不与源目录联动。之后源里改动 Skill,已安装目录不会自动更新,需重跑安装;覆盖安装只写入与覆盖同名文件,**不会清理目标里已不存在的旧文件**,需要干净结果时先整目录移除再安装。
|
|
116
|
+
3. **目标目录已有旧条目(旧副本或软链)时不能直接覆盖**:命令内部是递归拷贝,目标为软链时会报 `ERR_FS_CP_DIR_TO_NON_DIR` 失败;先移除该条目再安装(移除软链只断链,不影响其指向的目录)。
|
|
117
|
+
4. **本机 CLI 若为 `npm link` 指向本地仓库**,`skills list/install` 反映的是仓库当前工作区内容,包含未提交改动——开发期可直接发布最新工作区。
|
|
118
|
+
5. 拷贝会过滤 dotfiles、`scripts/`、`assets/`、`node_modules/`;`SKILL.md`、`references/`、`product.json` 会完整拷贝。
|
|
119
|
+
|
|
120
|
+
## 首次安装
|
|
121
|
+
|
|
122
|
+
Windows PowerShell:
|
|
123
|
+
|
|
124
|
+
```powershell
|
|
125
|
+
# 1. 确认命令可用且能看到随包 Skill
|
|
126
|
+
weaver-work-cli --version
|
|
127
|
+
weaver-work-cli skills list
|
|
128
|
+
|
|
129
|
+
# 2. 安装到目标目录(示例:WorkBuddy)
|
|
130
|
+
weaver-work-cli skills install yepiaotong --target-dir "$env:USERPROFILE\.workbuddy\skills"
|
|
131
|
+
|
|
132
|
+
# 3. 验证:结果是真实目录,不是软链
|
|
133
|
+
Get-ChildItem -Force "$env:USERPROFILE\.workbuddy\skills"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
macOS/Linux(bash/zsh):
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# 1. 确认命令可用且能看到随包 Skill
|
|
140
|
+
weaver-work-cli --version
|
|
141
|
+
weaver-work-cli skills list
|
|
142
|
+
|
|
143
|
+
# 2. 安装到目标目录(示例:WorkBuddy)
|
|
144
|
+
weaver-work-cli skills install yepiaotong --target-dir "$HOME/.workbuddy/skills"
|
|
145
|
+
|
|
146
|
+
# 3. 验证:结果是真实目录,不是软链
|
|
147
|
+
ls -la "$HOME/.workbuddy/skills"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 从本地开发仓库升级到最新
|
|
151
|
+
|
|
152
|
+
在仓库根目录执行:
|
|
153
|
+
|
|
154
|
+
Windows PowerShell:
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
# 1. 前置检查:确认全局 CLI 来源与待发布的工作区状态
|
|
158
|
+
Get-Command weaver-work-cli
|
|
159
|
+
git status --short
|
|
160
|
+
|
|
161
|
+
# 2. 重新构建,通过构建期 TS 校验(clean + tsc)
|
|
162
|
+
npm run build
|
|
163
|
+
|
|
164
|
+
# 3. 移除目标目录旧条目(软链/旧副本),再安装
|
|
165
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.workbuddy\skills\weaver-e10-yepiaotong", "$env:USERPROFILE\.workbuddy\skills\weaver-e10-shared"
|
|
166
|
+
weaver-work-cli skills install yepiaotong --target-dir "$env:USERPROFILE\.workbuddy\skills"
|
|
167
|
+
|
|
168
|
+
# 4. 验证安装的是最新内容(与仓库工作区一致)
|
|
169
|
+
if ((Get-FileHash "skills\weaver-e10-yepiaotong\SKILL.md").Hash -ne (Get-FileHash "$env:USERPROFILE\.workbuddy\skills\weaver-e10-yepiaotong\SKILL.md").Hash) { throw "yepiaotong skill differs" }
|
|
170
|
+
if ((Get-FileHash "skills\weaver-e10-shared\SKILL.md").Hash -ne (Get-FileHash "$env:USERPROFILE\.workbuddy\skills\weaver-e10-shared\SKILL.md").Hash) { throw "shared skill differs" }
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
macOS/Linux(bash/zsh):
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# 1. 前置检查:确认全局 CLI 来源与待发布的工作区状态
|
|
177
|
+
command -v weaver-work-cli
|
|
178
|
+
git status --short
|
|
179
|
+
|
|
180
|
+
# 2. 重新构建,通过构建期 TS 校验(clean + tsc)
|
|
181
|
+
npm run build
|
|
182
|
+
|
|
183
|
+
# 3. 移除目标目录旧条目(软链/旧副本),再安装
|
|
184
|
+
rm -rf "$HOME/.workbuddy/skills/weaver-e10-yepiaotong" "$HOME/.workbuddy/skills/weaver-e10-shared"
|
|
185
|
+
weaver-work-cli skills install yepiaotong --target-dir "$HOME/.workbuddy/skills"
|
|
186
|
+
|
|
187
|
+
# 4. 验证安装的是最新内容(与仓库工作区一致)
|
|
188
|
+
diff -q skills/weaver-e10-yepiaotong/SKILL.md "$HOME/.workbuddy/skills/weaver-e10-yepiaotong/SKILL.md"
|
|
189
|
+
diff -q skills/weaver-e10-shared/SKILL.md "$HOME/.workbuddy/skills/weaver-e10-shared/SKILL.md"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
构建失败(tsc 报错)时先修复 TS 错误再安装;`skills install` 的内容源不依赖 `dist/`,但发布前应保证仓库可构建。
|
|
193
|
+
|
|
194
|
+
## 验证清单与生效
|
|
195
|
+
|
|
196
|
+
安装本身不校验业务 API。要确认对 Agent 生效:
|
|
197
|
+
|
|
198
|
+
- 目录结构正确:用户主目录下的 `.workbuddy/skills/weaver-e10-yepiaotong` 包含 `SKILL.md`、`product.json`、`references/`,且 `weaver-e10-shared` 包含 `SKILL.md`、`references/`。
|
|
199
|
+
- 内容一致:Windows 使用上述 `Get-FileHash`,macOS/Linux 使用上述 `diff -q`;或用 `weaver-work-cli skills read weaver-e10-yepiaotong` 与仓库内容比对。
|
|
200
|
+
- **Agent 需重新加载**:新建会话或按 Agent 规则重载 Skill 后才读取新内容;已打开的会话不会热更新。
|
|
201
|
+
- 业务可用性:安装后仍需完成 E10 登录(`weaver-work-cli auth login --base-url "<E10_BASE_URL>" --agent_type "<当前智能体名称>"`),并可按 `weaver-work-cli invoice schema` 验证 operation 契约。
|
|
202
|
+
|
|
203
|
+
## 常见问题
|
|
204
|
+
|
|
205
|
+
| 现象 | 处理 |
|
|
206
|
+
| --- | --- |
|
|
207
|
+
| `weaver-work-cli: command not found` | 先安装运行时:`npm install -g weaver-work-cli`,再 `setup invoice` |
|
|
208
|
+
| 安装报 `ERR_FS_CP_DIR_TO_NON_DIR` | 目标目录对应条目是软链;Windows 用 `Remove-Item -Recurse -Force "C:\path\to\skills\weaver-e10-*"`,macOS/Linux 用 `rm -rf "/path/to/skills"/weaver-e10-*` 断链再安装 |
|
|
209
|
+
| `unknown packaged skill` | 确认 `weaver-work-cli skills list` 输出的包内 Skill 名称;目标是全名或 `yepiaotong` 等短名 |
|
|
210
|
+
| 改了仓库 Skill 但 Agent 看不到 | 已安装目录是拷贝,需重跑安装;且 Agent 需新会话重载 |
|
|
211
|
+
| 需要离线/平台导入的独立归档 | 用 `npm run build:yepiaotong-skill`,产物 `dist/weaver-e10-yepiaotong-skill.zip`;日常本机安装优先用 `skills install` |
|
package/docs/calendar.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# 日程管理(calendar)
|
|
2
|
+
|
|
3
|
+
`calendar` 是 E10 日程管理的聚合命令,覆盖**创建日程、查询列表、查询详情、查询总数、更新日程、删除日程、查询类型/紧急程度字典、应用版本检测** 8 类能力。
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
weaver-work-cli calendar --help
|
|
7
|
+
weaver-work-cli calendar schema
|
|
8
|
+
weaver-work-cli --json calendar run <operation> --input-json '{"key":"value"}'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`schema` 是能力清单的唯一事实来源,包含每个 operation 的 `inputSchema`、`risk`、`requiresConfirmation`。
|
|
12
|
+
|
|
13
|
+
## 实现位置
|
|
14
|
+
|
|
15
|
+
| 路径 | 职责 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `src/shortcuts/calendar/index.ts` | 命令注册与 JSON envelope |
|
|
18
|
+
| `src/shortcuts/calendar/manifest.ts` | `schema` 契约 |
|
|
19
|
+
| `src/shortcuts/calendar/host.ts` | E10 会话桥接、datajson/ESB 两类请求、响应归一化 |
|
|
20
|
+
| `src/shortcuts/calendar/continuation.ts` | 写操作确认链的 HMAC-SHA256 token |
|
|
21
|
+
| `src/shortcuts/calendar/operations/read.ts` | 读 operation(list/get/count/priority/type/app.check) |
|
|
22
|
+
| `src/shortcuts/calendar/operations/write.ts` | 写 operation(create/update/delete prepare→apply) |
|
|
23
|
+
| `src/shortcuts/calendar/operations/registry.ts` | operation 注册表与去重校验 |
|
|
24
|
+
|
|
25
|
+
## 认证
|
|
26
|
+
|
|
27
|
+
复用 `src/internal/e10` 的 E10 会话(`requireE10Session`),请求自动携带 `Cookie`、`eteamsid`、`User-Agent`。业务代码不接触认证目录。所有 `datajson` 结构接口的 `header.operator` 由 CLI 自动填充为当前登录用户。
|
|
28
|
+
|
|
29
|
+
## operation 清单
|
|
30
|
+
|
|
31
|
+
| operation | 类型 | 用途 |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `calendar.list` | read | 分页查询日程列表(ESB 流程触发,`uniqueIndent` 固定) |
|
|
34
|
+
| `calendar.get` | read | 按 ID 查询单条日程详情 |
|
|
35
|
+
| `calendar.count` | read | 查询日程总数 |
|
|
36
|
+
| `calendar.priority.list` | read | 查询紧急程度选项 |
|
|
37
|
+
| `calendar.type.list` | read | 查询日程类型选项 |
|
|
38
|
+
| `calendar.app.check` | read | 应用版本检测(要求 >= 4.1.4) |
|
|
39
|
+
| `calendar.create.prepare` / `.apply` | high-risk-write | 创建日程 |
|
|
40
|
+
| `calendar.update.prepare` / `.apply` | high-risk-write | 更新日程(全量覆盖) |
|
|
41
|
+
| `calendar.delete.prepare` / `.apply` | high-risk-write | 删除日程(不可逆) |
|
|
42
|
+
|
|
43
|
+
## 两类请求结构
|
|
44
|
+
|
|
45
|
+
- **datajson 结构**(创建/查询详情/总数/更新/删除/类型/紧急程度):请求体 `{datajson: {...}}`,业务成功判定 `datajson.status === true`。
|
|
46
|
+
- **ESB 直接 JSON**(列表查询):请求体 `{customParams, moduleSource, uniqueIndent}`,业务成功判定 `resultCode === 200`。
|
|
47
|
+
|
|
48
|
+
`host.ts` 的 `isBusinessSuccess` 统一判定,operation 层无需关心差异。
|
|
49
|
+
|
|
50
|
+
## 写操作确认链
|
|
51
|
+
|
|
52
|
+
创建、更新、删除全部走 `prepare -> apply`:
|
|
53
|
+
|
|
54
|
+
1. `prepare` 只归一化、补默认值、查当前数据(更新/删除)、生成预览和 continuation,不写入。
|
|
55
|
+
2. `apply` 必须带 `confirm=true` 与 prepare 返回的 continuation。
|
|
56
|
+
3. continuation 绑定 `baseUrl`/`profile`/`userId`,10 分钟有效;变化触发 `context_mismatch`,字段指纹变化触发 `target_changed`。
|
|
57
|
+
4. 网络中断抛 `partial/write_uncertain`,禁止自动重试,先做只读回查。
|
|
58
|
+
|
|
59
|
+
## 关键业务规则
|
|
60
|
+
|
|
61
|
+
- **参与人默认带当前人**:未传 `participants` 自动用当前用户;指定他人时当前人仍默认包含。
|
|
62
|
+
- **时长默认 1 小时**:只传 `start_time` 时自动补 `end_time`。
|
|
63
|
+
- **更新为全量覆盖**:`update.prepare` 先查当前详情,把 `[{name,id}]` 数组字段转标量 ID 再合并用户修改。
|
|
64
|
+
- **Switch 字段**(`all_day`/`remind`/`part_receipt`)传数字 `0`/`1`,禁止布尔值。
|
|
65
|
+
- **`agn_type`/`priority` 传选项 ID**,`participants` 传人员 ID,均非语义字符串/姓名。
|
|
66
|
+
|
|
67
|
+
## 调用示例
|
|
68
|
+
|
|
69
|
+
Windows PowerShell:
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
weaver-work-cli --json calendar run calendar.list --input-json '{"page_no":1,"page_size":10}'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
macOS/Linux(bash/zsh):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
printf '%s\n' '{"page_no":1,"page_size":10}' | weaver-work-cli --json calendar run calendar.list --input -
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 测试
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
node --test --import tsx "test/business/calendar-*.test.ts"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
覆盖 manifest/registry 一致性、请求形状断言、写操作确认链、响应归一化与错误形状。
|
package/docs/e10-auth.md
CHANGED
|
@@ -4,35 +4,41 @@ E10 适配模块刻意与核心 CLI 框架隔离,避免平台逻辑污染通
|
|
|
4
4
|
|
|
5
5
|
存储路径与密钥:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Profile
|
|
9
|
-
- 当前激活 profile
|
|
7
|
+
- 鉴权根目录:通过 `weaver-work-cli auth root` 查看;默认位于用户主目录下的 `.weaver-work-cli/e10`(Windows PowerShell:`$env:USERPROFILE\.weaver-work-cli\e10`;macOS/Linux:`$HOME/.weaver-work-cli/e10`)
|
|
8
|
+
- Profile 目录:`profiles/<profile>`(位于鉴权根目录下)
|
|
9
|
+
- 当前激活 profile:`profile`(位于鉴权根目录下)
|
|
10
10
|
- Keychain service/account:`weaver-work-cli` / `auth-key`
|
|
11
11
|
- 发票业务 Token Keychain service:`cn.weaver.weaver-work-cli.invoice-token`
|
|
12
12
|
|
|
13
|
-
`weaver-work-cli` 默认不读取、不迁移 `e10-login` / `e10-cli`
|
|
13
|
+
`weaver-work-cli` 默认不读取、不迁移 `e10-login` / `e10-cli` 的旧 `.e10-cli`
|
|
14
14
|
登录态,避免用户安装本插件后因为历史登录状态被自动授权。确需复用外部 auth
|
|
15
15
|
文件时,可以显式传 `--auth <path>` 或设置 `E10_AUTH_PATH`。
|
|
16
16
|
|
|
17
17
|
主要命令:
|
|
18
18
|
|
|
19
|
-
```
|
|
19
|
+
```text
|
|
20
20
|
weaver-work-cli auth status
|
|
21
21
|
weaver-work-cli auth login --base-url "https://weapp.xxx.cn"
|
|
22
22
|
weaver-work-cli auth oidc --base-url "https://weapp.xxx.cn"
|
|
23
|
+
weaver-work-cli auth xiaoe
|
|
23
24
|
weaver-work-cli auth set --eteamsid "PCACCOUNT_xxx" --base-url "https://weapp.xxx.cn"
|
|
24
25
|
weaver-work-cli auth whoami
|
|
25
26
|
weaver-work-cli auth whoami --live
|
|
26
27
|
weaver-work-cli auth logout
|
|
27
28
|
weaver-work-cli auth profile list
|
|
28
|
-
weaver-work-cli auth profile use
|
|
29
|
+
weaver-work-cli auth profile use PROFILE_NAME
|
|
29
30
|
weaver-work-cli auth export-weaver-env
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
`auth login` 和 `auth oidc` 都走 E10 OAuth2.0 浏览器授权登录,本地默认监听
|
|
33
34
|
`http://127.0.0.1:19800/callback`。如端口被占用,可以使用
|
|
34
35
|
`--port 19801` 指定其他端口;如需要区分客户端来源,可以使用
|
|
35
|
-
`--agent_type <value
|
|
36
|
+
`--agent_type <value>`。未显式传入时,CLI 会依次读取 `WEAVER_AGENT_TYPE`、
|
|
37
|
+
`WORKBUDDY_AGENT_TYPE`、`CODEX_AGENT_TYPE`,再根据 `WORKBUDDY_*` / `CODEX_*`
|
|
38
|
+
环境变量推断当前宿主,最后回落为 `weaver-work-cli`。浏览器授权地址会同时携带
|
|
39
|
+
`agent_type=<value>` 和 `from=<value>`,其中 `from` 用于 E10 授权确认页展示客户端名称。
|
|
40
|
+
|
|
41
|
+
小 E 宿主环境中,`auth login` / `auth oidc` / `auth xiaoe` 会先尝试从 `XIAOE_*` 环境变量读取当前域名对应的统一登录凭证。域名匹配且凭证可用时,CLI 直接保存登录态,保存的 `agentType` 固定为 `Xiao.E`;未显式传域名时,会优先使用小 E 环境变量里的首个支持域名,其次才使用当前 profile 配置,仍没有支持域名时保留资料包默认域名 `https://www.e-cology.com.cn`。业务命令在未显式指定 `--auth` / `--profile` 时,也会自动优先尝试小 E 统一登录。小 E 凭证校验失败、当前域名不在支持范围内,或用户切换了访问域名时,会自动降级到原浏览器 OAuth2.0 登录。
|
|
36
42
|
|
|
37
43
|
无法使用浏览器回调时,可以用 `auth set` 直接写入浏览器中复制到的
|
|
38
44
|
`ETEAMSID`。命令会调用 `teamsCheck` 解析当前用户、租户和组织信息,并写入
|
|
@@ -41,7 +47,10 @@ E10 兼容的 auth 文件。
|
|
|
41
47
|
`auth whoami` 默认读取本地缓存,不发网络请求;`auth whoami --live` 会调用
|
|
42
48
|
`teamsCheck` 获取实时信息。`auth export-weaver-env` 会输出
|
|
43
49
|
`WEAVER_BASE_URL`、`WEAVER_ETEAMSID`、`WEAVER_COOKIE`、`WEAVER_USER_AGENT` 和
|
|
44
|
-
`WEAVER_AGENT_TYPE
|
|
50
|
+
`WEAVER_AGENT_TYPE`。默认 `--shell auto` 会在 Windows 输出 PowerShell 语法,在
|
|
51
|
+
macOS/Linux 输出 POSIX shell 语法;也可显式使用 `--shell powershell` 或
|
|
52
|
+
`--shell posix`。Agent 给子进程使用登录态时,仍优先通过 `weaver-work-cli run ...`
|
|
53
|
+
自动注入,避免在回复或日志中展示敏感值。
|
|
45
54
|
|
|
46
55
|
`auth login`、`auth oidc` 和 `auth set` 保存新登录态前,会清理同一
|
|
47
56
|
profile/baseUrl/userId 下缓存的发票业务 Token,避免重登后继续复用旧 Token。
|
|
@@ -50,6 +59,16 @@ profile/baseUrl/userId 下缓存的发票业务 Token,避免重登后继续复
|
|
|
50
59
|
`--profile <name>` 清理指定 profile。该命令不删除 profile 配置和登录加密用
|
|
51
60
|
keychain 密钥。
|
|
52
61
|
|
|
62
|
+
Windows PowerShell:
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
Invoke-Expression (weaver-work-cli auth export-weaver-env --shell powershell)
|
|
66
|
+
weaver-work-cli run node -e "console.log(process.env.WEAVER_BASE_URL || 'no e10 auth')"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
macOS/Linux(bash/zsh):
|
|
70
|
+
|
|
53
71
|
```bash
|
|
54
|
-
eval "$(weaver-work-cli auth export-weaver-env)"
|
|
72
|
+
eval "$(weaver-work-cli auth export-weaver-env --shell posix)"
|
|
73
|
+
weaver-work-cli run node -e "console.log(process.env.WEAVER_BASE_URL || 'no e10 auth')"
|
|
55
74
|
```
|