weaver-work-cli 0.1.2 → 0.1.5
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 +176 -78
- 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 +159 -54
- 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 +345 -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 +24 -0
- package/dist/shortcuts/invoice/host.js +99 -94
- package/dist/shortcuts/invoice/index.js +58 -59
- package/dist/shortcuts/invoice/manifest.js +200 -3
- package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
- package/dist/shortcuts/invoice/operations/issuing.js +198 -0
- 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 +247 -0
- 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/meeting/continuation.js +70 -0
- package/dist/shortcuts/meeting/errors.js +63 -0
- package/dist/shortcuts/meeting/host.js +167 -0
- package/dist/shortcuts/meeting/index.js +123 -0
- package/dist/shortcuts/meeting/manifest.js +64 -0
- package/dist/shortcuts/meeting/operations/catalogs.js +58 -0
- package/dist/shortcuts/meeting/operations/change.js +242 -0
- package/dist/shortcuts/meeting/operations/conflicts.js +142 -0
- package/dist/shortcuts/meeting/operations/create.js +349 -0
- package/dist/shortcuts/meeting/operations/env.js +191 -0
- package/dist/shortcuts/meeting/operations/lifecycle.js +139 -0
- package/dist/shortcuts/meeting/operations/meetings.js +73 -0
- package/dist/shortcuts/meeting/operations/receipts.js +195 -0
- package/dist/shortcuts/meeting/operations/registry.js +47 -0
- package/dist/shortcuts/meeting/operations/rooms.js +132 -0
- package/dist/shortcuts/meeting/operations/shared.js +112 -0
- package/dist/shortcuts/meeting/operations/signs.js +41 -0
- package/dist/shortcuts/meeting/operations/types.js +25 -0
- package/dist/shortcuts/meeting/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/dist/shortcuts/yimiaoban/continuation.js +70 -0
- package/dist/shortcuts/yimiaoban/errors.js +61 -0
- package/dist/shortcuts/yimiaoban/host.js +469 -0
- package/dist/shortcuts/yimiaoban/index.js +271 -0
- package/dist/shortcuts/yimiaoban/manifest.js +28 -0
- package/dist/shortcuts/yimiaoban/operations/file-user.js +288 -0
- package/dist/shortcuts/yimiaoban/operations/group-read.js +477 -0
- package/dist/shortcuts/yimiaoban/operations/group-write.js +591 -0
- package/dist/shortcuts/yimiaoban/operations/msg-parse.js +429 -0
- package/dist/shortcuts/yimiaoban/operations/msg-sync.js +519 -0
- package/dist/shortcuts/yimiaoban/operations/msg-write.js +593 -0
- package/dist/shortcuts/yimiaoban/operations/person.js +102 -0
- package/dist/shortcuts/yimiaoban/operations/registry.js +38 -0
- package/dist/shortcuts/yimiaoban/operations/session.js +437 -0
- package/dist/shortcuts/yimiaoban/operations/shared.js +236 -0
- package/dist/shortcuts/yimiaoban/operations/types.js +27 -0
- package/dist/shortcuts/yimiaoban/operations/write-util.js +78 -0
- package/dist/shortcuts/yimiaoban/operations.js +8 -0
- package/docs/SKILL.md +11 -7
- package/docs/_catalog.md +28 -5
- package/docs/agent-invoice.md +19 -9
- package/docs/agent-skill-install.md +141 -22
- 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 +61 -20
- package/docs/jiuchuanhui.md +131 -0
- package/docs/meeting.md +48 -0
- package/docs/operation-manual.md +443 -0
- package/docs/plan.md +82 -0
- package/docs/wenshuding.md +129 -0
- package/docs/yimiaoban.md +86 -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 +16 -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/meeting.md +3 -0
- package/skill-template/domains/plan.md +17 -0
- package/skill-template/domains/qiyecheng.md +17 -0
- package/skill-template/domains/shared.md +5 -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/yimiaoban.md +21 -0
- package/skill-template/domains/ziguanjia.md +21 -0
- package/skill-template/master-skill-template.md +12 -6
- package/skill-template/skill-template.md +26 -10
- package/skills/weaver-e10-calendar/SKILL.md +102 -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 +103 -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 +88 -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 +175 -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 +102 -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 +152 -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-meeting/SKILL.md +106 -0
- package/skills/weaver-e10-meeting/product.json +8 -0
- package/skills/weaver-e10-meeting/references/meeting-change.md +67 -0
- package/skills/weaver-e10-meeting/references/meeting-create.md +52 -0
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +57 -0
- package/skills/weaver-e10-meeting/references/meeting-queries.md +61 -0
- package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +48 -0
- package/skills/weaver-e10-meeting/references/meeting-update.md +7 -0
- package/skills/weaver-e10-meeting/references/source-manifest.json +50 -0
- package/skills/weaver-e10-plan/SKILL.md +140 -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 +119 -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 +90 -0
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
- package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/json-output-contract.md +34 -0
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
- package/skills/weaver-e10-skill-maker/SKILL.md +78 -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 +158 -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-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-agent-entry.md +16 -9
- 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-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-download.md +9 -2
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-enterprise-list.md +12 -4
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +9 -2
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-import.md +16 -7
- 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 +12 -4
- package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-personal-list.md +12 -4
- 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 +9 -2
- 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-yimiaoban/SKILL.md +104 -0
- package/skills/weaver-e10-yimiaoban/product.json +8 -0
- package/skills/weaver-e10-yimiaoban/references/ding-write.md +68 -0
- package/skills/weaver-e10-yimiaoban/references/error-codes.md +85 -0
- package/skills/weaver-e10-yimiaoban/references/field-resolution.md +46 -0
- package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +54 -0
- package/skills/weaver-e10-yimiaoban/references/group-read.md +55 -0
- package/skills/weaver-e10-yimiaoban/references/group-write.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +59 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +64 -0
- package/skills/weaver-e10-yimiaoban/references/person.md +44 -0
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +61 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +47 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +485 -0
- package/skills/weaver-e10-ziguanjia/SKILL.md +163 -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 -122
- package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
- package/skills/weaver-work-cli-shared/SKILL.md +0 -63
- package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -90
- package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -73
- /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,236 @@
|
|
|
1
|
+
import { ymbValidationError, ymbBusinessError } from '../errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* 禁止出现在输入对象中的键:
|
|
4
|
+
* - 原型污染防护:`__proto__`/`constructor`/`prototype`
|
|
5
|
+
* - 操作人红线:`user`/`sender`/`operator`(操作者由会话 eteamsid 识别,请求体一律不传)
|
|
6
|
+
*/
|
|
7
|
+
const FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype', 'user', 'sender', 'operator']);
|
|
8
|
+
export function asObject(value) {
|
|
9
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
10
|
+
throw ymbValidationError('input_not_object', '输入必须是 JSON 对象');
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
export function assertNoForbiddenKeys(input) {
|
|
15
|
+
for (const key of Object.keys(input)) {
|
|
16
|
+
if (FORBIDDEN_KEYS.has(key)) {
|
|
17
|
+
throw ymbValidationError('forbidden_key', `输入包含非法字段:${key}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** 校验 uid/cid 非空且非 0(易秒办红线:uid/cid 不得为 0)。 */
|
|
22
|
+
export function assertNonZeroId(value, field) {
|
|
23
|
+
if (value === undefined || value === null || value === '') {
|
|
24
|
+
throw ymbValidationError('id_required', `${field} 必填`);
|
|
25
|
+
}
|
|
26
|
+
const text = String(value).trim();
|
|
27
|
+
if (!/^\d+$/.test(text) || text === '0') {
|
|
28
|
+
throw ymbValidationError('id_invalid', `${field} 必须是非 0 数字 ID`);
|
|
29
|
+
}
|
|
30
|
+
return text;
|
|
31
|
+
}
|
|
32
|
+
/** 拆分逗号分隔 id 列表(uint64 按字符串保留),去空。 */
|
|
33
|
+
export function splitIds(value, field) {
|
|
34
|
+
if (value === undefined || value === null || value === '') {
|
|
35
|
+
throw ymbValidationError('id_list_required', `${field} 必填`);
|
|
36
|
+
}
|
|
37
|
+
const list = String(value).split(',').map((s) => s.trim()).filter(Boolean);
|
|
38
|
+
if (list.length === 0) {
|
|
39
|
+
throw ymbValidationError('id_list_empty', `${field} 不能为空`);
|
|
40
|
+
}
|
|
41
|
+
for (const item of list) {
|
|
42
|
+
if (!/^\d+$/.test(item) || item === '0') {
|
|
43
|
+
throw ymbValidationError('id_invalid', `${field} 含非法 id(必须非 0 数字):${item}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return list;
|
|
47
|
+
}
|
|
48
|
+
/** 无符号整数转换(uint32 等),拒绝小数/负数。 */
|
|
49
|
+
export function toUint(value, field) {
|
|
50
|
+
if (value === undefined || value === null || value === '')
|
|
51
|
+
return undefined;
|
|
52
|
+
const numeric = Number(value);
|
|
53
|
+
if (!Number.isInteger(numeric) || numeric < 0) {
|
|
54
|
+
throw ymbValidationError('number_invalid', `${field} 必须是非负整数`);
|
|
55
|
+
}
|
|
56
|
+
return numeric;
|
|
57
|
+
}
|
|
58
|
+
/** 正整数转换。 */
|
|
59
|
+
export function toPositiveInt(value, field) {
|
|
60
|
+
if (value === undefined || value === null || value === '')
|
|
61
|
+
return undefined;
|
|
62
|
+
const numeric = Number(value);
|
|
63
|
+
if (!Number.isInteger(numeric) || numeric <= 0) {
|
|
64
|
+
throw ymbValidationError('number_invalid', `${field} 必须是正整数`);
|
|
65
|
+
}
|
|
66
|
+
return numeric;
|
|
67
|
+
}
|
|
68
|
+
/** 移除值为 undefined 的键。 */
|
|
69
|
+
export function compact(body) {
|
|
70
|
+
for (const key of Object.keys(body)) {
|
|
71
|
+
if (body[key] === undefined)
|
|
72
|
+
delete body[key];
|
|
73
|
+
}
|
|
74
|
+
return body;
|
|
75
|
+
}
|
|
76
|
+
/** 时间(unix 秒)→ 消息 id 最小/最大值(fwutils MakeMinAndMaxIdByTm)。返回字符串(超 JS 安全整数)。 */
|
|
77
|
+
export function makeMinMaxIdByTm(tmSec) {
|
|
78
|
+
if (!tmSec || tmSec <= 0)
|
|
79
|
+
return { min: '0', max: '0' };
|
|
80
|
+
const base = BigInt(Math.floor(tmSec)) * 1000000000n;
|
|
81
|
+
return { min: base.toString(), max: (base + 999999999n).toString() };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 解析时间参数为 unix 秒(按本地时区):
|
|
85
|
+
* - 10 位纯数字:视为 unix 秒
|
|
86
|
+
* - YYYY-MM-DD:isEnd=false → 当天 00:00:00;isEnd=true → 当天 23:59:59
|
|
87
|
+
* - YYYY-MM-DD HH:mm[:ss]
|
|
88
|
+
*/
|
|
89
|
+
export function parseTimeToSec(arg, isEnd) {
|
|
90
|
+
if (arg === undefined || arg === null || arg === '')
|
|
91
|
+
return 0;
|
|
92
|
+
const s = String(arg).trim();
|
|
93
|
+
if (/^\d{10}$/.test(s))
|
|
94
|
+
return Number(s);
|
|
95
|
+
const m = s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);
|
|
96
|
+
if (!m) {
|
|
97
|
+
throw ymbValidationError('time_invalid', `无法解析时间参数: ${s}(支持 unix 秒 / YYYY-MM-DD / YYYY-MM-DD HH:mm:ss)`);
|
|
98
|
+
}
|
|
99
|
+
const hh = m[4] !== undefined ? Number(m[4]) : (isEnd ? 23 : 0);
|
|
100
|
+
const mm = m[5] !== undefined ? Number(m[5]) : (isEnd ? 59 : 0);
|
|
101
|
+
const ss = m[6] !== undefined ? Number(m[6]) : (isEnd ? 59 : 0);
|
|
102
|
+
return Math.floor(new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]), hh, mm, ss).getTime() / 1000);
|
|
103
|
+
}
|
|
104
|
+
/** 当天 00:00:00 / 23:59:59 的 unix 秒(本地时区)。 */
|
|
105
|
+
export function todayRange() {
|
|
106
|
+
const now = new Date();
|
|
107
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
|
|
108
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);
|
|
109
|
+
return { fromSec: Math.floor(start.getTime() / 1000), toSec: Math.floor(end.getTime() / 1000) };
|
|
110
|
+
}
|
|
111
|
+
/** 时间展示统一格式:YYYY/M/D HH:MM:SS(unix 秒输入)。 */
|
|
112
|
+
export function formatFullTime(ts) {
|
|
113
|
+
if (ts === undefined || ts === null || ts === '')
|
|
114
|
+
return '-';
|
|
115
|
+
const d = new Date(Number(ts) * 1000);
|
|
116
|
+
if (Number.isNaN(d.getTime()))
|
|
117
|
+
return '-';
|
|
118
|
+
const p = (n) => String(n).padStart(2, '0');
|
|
119
|
+
return `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
|
120
|
+
}
|
|
121
|
+
/** 校验枚举取值。 */
|
|
122
|
+
export function assertEnum(value, allowed, field) {
|
|
123
|
+
const text = typeof value === 'string' ? value : String(value);
|
|
124
|
+
if (!allowed.includes(text)) {
|
|
125
|
+
throw ymbValidationError('enum_invalid', `${field} 取值必须是 ${allowed.join(' / ')} 之一`);
|
|
126
|
+
}
|
|
127
|
+
return text;
|
|
128
|
+
}
|
|
129
|
+
/** 从 IM 响应 JSON 中提取 actionMsg(路径多样兼容)。 */
|
|
130
|
+
export function findActionMsg(value) {
|
|
131
|
+
const candidate = value?.data?.actionMsg ?? value?.actionMsg;
|
|
132
|
+
if (candidate === undefined || candidate === null)
|
|
133
|
+
return null;
|
|
134
|
+
return {
|
|
135
|
+
code: candidate.code !== undefined ? candidate.code : 0,
|
|
136
|
+
message: candidate.message ?? candidate.msg ?? '',
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** 判断 IM 业务是否成功(actionMsg.code === 0)。失败抛 business_error。 */
|
|
140
|
+
export function assertImOk(value, actionLabel) {
|
|
141
|
+
const msg = findActionMsg(value);
|
|
142
|
+
if (msg === null) {
|
|
143
|
+
// 无 actionMsg 时回退顶层 code===200 && status 判定(sendDing 等路径)
|
|
144
|
+
if (Number(value?.code) === 200 && value?.status)
|
|
145
|
+
return;
|
|
146
|
+
throw ymbBusinessError('business_error', `${actionLabel}失败:缺少 actionMsg`, {
|
|
147
|
+
details: { raw: value },
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (Number(msg.code) === 0)
|
|
151
|
+
return;
|
|
152
|
+
const message = msg.message || `${actionLabel}失败(actionMsg.code=${msg.code})`;
|
|
153
|
+
throw ymbBusinessError('action_failed', message, { code: msg.code });
|
|
154
|
+
}
|
|
155
|
+
/** 取出响应 data 主体(兼容 data.data.data / data.data 等路径)。 */
|
|
156
|
+
export function unwrapInner(value) {
|
|
157
|
+
return value?.data?.data ?? value?.data;
|
|
158
|
+
}
|
|
159
|
+
/** 群成员条目判定(成员行至少含 uid 或 user 身份)。 */
|
|
160
|
+
function isMemberRow(value) {
|
|
161
|
+
return Boolean(value) && typeof value === 'object' && (value.uid !== undefined || value.user !== undefined);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 从 getGroupUsers 响应主体提取成员数组。
|
|
165
|
+
* 兼容服务端历史形态:`users` / `members` / `datas`(含 `datas[].datas` 嵌套),
|
|
166
|
+
* 避免因响应包裹层不同导致「群内没有可接收成员」这类误判。
|
|
167
|
+
*/
|
|
168
|
+
export function extractGroupMembers(inner) {
|
|
169
|
+
if (!inner || typeof inner !== 'object')
|
|
170
|
+
return [];
|
|
171
|
+
for (const key of ['users', 'members']) {
|
|
172
|
+
const list = inner[key];
|
|
173
|
+
if (Array.isArray(list) && list.some(isMemberRow))
|
|
174
|
+
return list;
|
|
175
|
+
}
|
|
176
|
+
const datas = Array.isArray(inner.datas) ? inner.datas : [];
|
|
177
|
+
if (datas.some(isMemberRow))
|
|
178
|
+
return datas;
|
|
179
|
+
const nested = [];
|
|
180
|
+
for (const group of datas) {
|
|
181
|
+
if (Array.isArray(group?.datas))
|
|
182
|
+
nested.push(...group.datas);
|
|
183
|
+
}
|
|
184
|
+
return nested;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 当前登录用户 uid(易秒办 IM uid = E10 登录 userId)。
|
|
188
|
+
* 仅用于展示层识别「我」,请求体依旧不携带任何操作人字段。
|
|
189
|
+
*/
|
|
190
|
+
export async function resolveAuthUid(host) {
|
|
191
|
+
try {
|
|
192
|
+
const session = await host.getSession();
|
|
193
|
+
return str(session?.userId);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** 消息页最小 ser_msgid(`hasMore` 时作为下一页 `start` 锚点;服务端返回含边界那条,需按 msgid 去重)。 */
|
|
200
|
+
export function minMsgId(messages) {
|
|
201
|
+
let min = null;
|
|
202
|
+
for (const message of messages) {
|
|
203
|
+
const id = str(message?.msgid);
|
|
204
|
+
if (!/^\d+$/.test(id))
|
|
205
|
+
continue;
|
|
206
|
+
if (min === null || BigInt(id) < BigInt(min))
|
|
207
|
+
min = id;
|
|
208
|
+
}
|
|
209
|
+
return min ?? '';
|
|
210
|
+
}
|
|
211
|
+
/** 枚举值转成 string(可能为字符串数字)。 */
|
|
212
|
+
export function str(value) {
|
|
213
|
+
if (value === undefined || value === null)
|
|
214
|
+
return '';
|
|
215
|
+
return String(value);
|
|
216
|
+
}
|
|
217
|
+
/** 解析消息 JSON 字符串或对象。 */
|
|
218
|
+
export function parseMsg(value) {
|
|
219
|
+
if (!value)
|
|
220
|
+
return null;
|
|
221
|
+
if (typeof value === 'string') {
|
|
222
|
+
try {
|
|
223
|
+
return JSON.parse(value);
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === 'object')
|
|
230
|
+
return value;
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* 媒体文件上传所需文件大小上限(消息图片/文件常规场景按服务端约束执行)。
|
|
235
|
+
*/
|
|
236
|
+
export const MAX_UPLOAD_BYTES = 1024 * 1024 * 200;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const READ = 'read';
|
|
2
|
+
export const WRITE = 'write';
|
|
3
|
+
export function ymbSuccess(action, data, meta) {
|
|
4
|
+
const payload = { ok: true, action, data };
|
|
5
|
+
if (meta && Object.keys(meta).length > 0)
|
|
6
|
+
payload.meta = meta;
|
|
7
|
+
return payload;
|
|
8
|
+
}
|
|
9
|
+
/** 构造「对象类型 + 严格禁止额外字段」的 JSON Schema。 */
|
|
10
|
+
export function schemaOf(properties, options = {}) {
|
|
11
|
+
return {
|
|
12
|
+
type: 'object',
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
properties,
|
|
15
|
+
...(options.required?.length ? { required: options.required } : {}),
|
|
16
|
+
...(options.description ? { description: options.description } : {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export const SCHEMA_INTEGER_POSITIVE = { type: 'integer', minimum: 1 };
|
|
20
|
+
export const SCHEMA_NUMBER_POSITIVE = { type: 'number', exclusiveMinimum: 0 };
|
|
21
|
+
export const SCHEMA_ID = { oneOf: [{ type: 'integer' }, { type: 'string', pattern: '^\\d+$' }] };
|
|
22
|
+
export const SCHEMA_ID_LIST = { type: 'array', items: SCHEMA_ID };
|
|
23
|
+
export const SCHEMA_STRING = { type: 'string' };
|
|
24
|
+
export const SCHEMA_STRING_LIST = { type: 'array', items: { type: 'string' } };
|
|
25
|
+
export const SCHEMA_BOOLEAN = { type: 'boolean' };
|
|
26
|
+
export const SCHEMA_INTEGER = { type: 'integer' };
|
|
27
|
+
export const SCHEMA_NUMBER = { type: 'number' };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { ymbConfirmationError, ymbValidationError } from '../errors.js';
|
|
3
|
+
import { ymbSuccess } from './types.js';
|
|
4
|
+
import { assertNoForbiddenKeys } from './shared.js';
|
|
5
|
+
function fingerprint(value) {
|
|
6
|
+
return createHash('sha256').update(JSON.stringify(value ?? null)).digest('hex').slice(0, 32);
|
|
7
|
+
}
|
|
8
|
+
function requireConfirm(action) {
|
|
9
|
+
throw ymbConfirmationError(action, { hint: '重新调用时传入 confirm=true 与 prepare 返回的 continuation' });
|
|
10
|
+
}
|
|
11
|
+
async function verifyLease(continuationToken, action, env) {
|
|
12
|
+
const lease = await env.continuation.verify(continuationToken, action);
|
|
13
|
+
const session = await env.host.getSession();
|
|
14
|
+
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
15
|
+
throw ymbValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
|
|
16
|
+
}
|
|
17
|
+
return lease;
|
|
18
|
+
}
|
|
19
|
+
export function makeWritePair(options) {
|
|
20
|
+
return {
|
|
21
|
+
async prepare(args, env) {
|
|
22
|
+
assertNoForbiddenKeys(args);
|
|
23
|
+
const plan = await options.plan(args, env);
|
|
24
|
+
const session = await env.host.getSession();
|
|
25
|
+
const token = await env.continuation.issue({
|
|
26
|
+
operation: options.action,
|
|
27
|
+
baseUrl: session.baseUrl,
|
|
28
|
+
profile: session.profile,
|
|
29
|
+
userId: session.userId,
|
|
30
|
+
snapshotFingerprint: fingerprint(plan.snapshot),
|
|
31
|
+
plan: plan.snapshot,
|
|
32
|
+
});
|
|
33
|
+
return ymbSuccess(`${options.action}.prepare`, {
|
|
34
|
+
summary: plan.summary,
|
|
35
|
+
continuation: token,
|
|
36
|
+
hint: '确认无误后调用 ' + options.action + '.apply,传 confirm:true 与 continuation',
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
async apply(args, env) {
|
|
40
|
+
assertNoForbiddenKeys(args);
|
|
41
|
+
if (args.confirm !== true)
|
|
42
|
+
requireConfirm(options.action);
|
|
43
|
+
const lease = await verifyLease(String(args.continuation ?? ''), options.action, env);
|
|
44
|
+
const plan = lease.plan;
|
|
45
|
+
if (lease.snapshotFingerprint !== fingerprint(plan)) {
|
|
46
|
+
throw ymbValidationError('target_changed', '写入目标/内容与 prepare 时不一致,请重新执行 prepare');
|
|
47
|
+
}
|
|
48
|
+
const data = await options.execute(plan, env);
|
|
49
|
+
return ymbSuccess(`${options.action}.apply`, data);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** fileObj → 图片消息 img 对象。 */
|
|
54
|
+
export function fileObjToImg(fileObj) {
|
|
55
|
+
const img = { src: String(fileObj.id || fileObj.fileid) };
|
|
56
|
+
if (fileObj.name)
|
|
57
|
+
img.nm = String(fileObj.name);
|
|
58
|
+
if (fileObj.type)
|
|
59
|
+
img.t = String(fileObj.type);
|
|
60
|
+
if (fileObj.imgWidth !== undefined && fileObj.imgWidth !== null)
|
|
61
|
+
img.w = String(fileObj.imgWidth);
|
|
62
|
+
if (fileObj.imgHeight !== undefined && fileObj.imgHeight !== null)
|
|
63
|
+
img.h = String(fileObj.imgHeight);
|
|
64
|
+
if (fileObj.size !== undefined && fileObj.size !== null)
|
|
65
|
+
img.s = String(fileObj.size);
|
|
66
|
+
return img;
|
|
67
|
+
}
|
|
68
|
+
/** fileObj → 文件消息 file 对象。 */
|
|
69
|
+
export function fileObjToFile(fileObj) {
|
|
70
|
+
const f = { id: String(fileObj.id || fileObj.fileid) };
|
|
71
|
+
if (fileObj.name)
|
|
72
|
+
f.nm = String(fileObj.name);
|
|
73
|
+
if (fileObj.type)
|
|
74
|
+
f.t = String(fileObj.type);
|
|
75
|
+
if (fileObj.size !== undefined && fileObj.size !== null)
|
|
76
|
+
f.s = String(fileObj.size);
|
|
77
|
+
return f;
|
|
78
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getYmbOperation } from './operations/registry.js';
|
|
2
|
+
import { asObject, assertNoForbiddenKeys } from './operations/shared.js';
|
|
3
|
+
export async function executeYmbOperation(operation, rawInput, context) {
|
|
4
|
+
const definition = getYmbOperation(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,9 +5,32 @@
|
|
|
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
|
-
|
|
|
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
|
+
| E10 会议管理(标准版:查询/冲突/预约/回执/签到)、meeting operation、写操作 prepare/apply | `docs/meeting.md` |
|
|
12
|
+
| 聚才林人事云(人事档案/出勤/薪酬)、ehr operation、写操作 prepare/apply | `docs/ehr.md` |
|
|
13
|
+
| 齐业成费控中心(预算/费用中心/借款管理/发票核销)、fna operation、提醒还款与催票 prepare/apply | `docs/fna.md` |
|
|
14
|
+
| 文书定档案管理(全宗/检索/借阅车/借阅单/发起借阅/预归档上传)、wenshuding operation | `docs/wenshuding.md` |
|
|
15
|
+
| 计划报告管理(报告查询/新建/修改/发布/撤回/提交提醒/评论)、plan operation、写操作 prepare/apply | `docs/plan.md` |
|
|
16
|
+
| E10 ESB 中心自定义触发动作流(入参模板查询 / prepare-apply 触发)、esb operation | `docs/esb.md` |
|
|
17
|
+
| 快速安装 CLI,并使用 CLI/Skill Maker 生成、验证、打包和安装业务模块 Skill | `docs/operation-manual.md` |
|
|
11
18
|
| 把随包 Agent Skill 安装/升级到本机 Agent(Codex/WorkBuddy 目录、从本地仓库发布最新版) | `docs/agent-skill-install.md` |
|
|
12
|
-
| Agent 调用业票通 CLI 的入口路由 | `skills/weaver-
|
|
13
|
-
| Agent 调用业票通 CLI 的具体 reference | `skills/weaver-
|
|
19
|
+
| Agent 调用业票通 CLI 的入口路由 | `skills/weaver-e10-yepiaotong/SKILL.md` |
|
|
20
|
+
| Agent 调用业票通 CLI 的具体 reference | `skills/weaver-e10-yepiaotong/references/` |
|
|
21
|
+
| Agent 调用聚才林 CLI 的入口路由 | `skills/weaver-e10-jucailin/SKILL.md` |
|
|
22
|
+
| Agent 调用聚才林 CLI 的具体 reference | `skills/weaver-e10-jucailin/references/` |
|
|
23
|
+
| Agent 调用文书定 CLI 的入口路由 | `skills/weaver-e10-wenshuding/SKILL.md` |
|
|
24
|
+
| Agent 调用文书定 CLI 的具体 reference | `skills/weaver-e10-wenshuding/references/` |
|
|
25
|
+
| Agent 调用齐业成费控 CLI 的入口路由 | `skills/weaver-e10-qiyecheng/SKILL.md` |
|
|
26
|
+
| Agent 调用齐业成费控 CLI 的具体 reference | `skills/weaver-e10-qiyecheng/references/` |
|
|
27
|
+
| Agent 调用计划报告 CLI 的入口路由 | `skills/weaver-e10-plan/SKILL.md` |
|
|
28
|
+
| Agent 调用计划报告 CLI 的具体 reference | `skills/weaver-e10-plan/references/` |
|
|
29
|
+
| Agent 调用 ESB 动作流 CLI 的入口路由 | `skills/weaver-e10-esb/SKILL.md` |
|
|
30
|
+
| Agent 调用 ESB 动作流 CLI 的具体 reference | `skills/weaver-e10-esb/references/` |
|
|
31
|
+
| Agent 调用会议管理 CLI 的入口路由 | `skills/weaver-e10-meeting/SKILL.md` |
|
|
32
|
+
| Agent 调用会议管理 CLI 的具体 reference | `skills/weaver-e10-meeting/references/` |
|
|
33
|
+
| 易秒办即时通讯(消息/群组/会话/系统消息)、yimiaoban operation、写操作 prepare/apply | `docs/yimiaoban.md` |
|
|
34
|
+
| Agent 调用易秒办 CLI 的入口路由 | `skills/weaver-e10-yimiaoban/SKILL.md` |
|
|
35
|
+
| Agent 调用易秒办 CLI 的具体 reference | `skills/weaver-e10-yimiaoban/references/` |
|
|
36
|
+
| 将新业务模块文档或代码同步转换为 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,16 +18,24 @@ 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。
|
|
@@ -55,9 +63,11 @@ weaver-work-cli --json invoice run <operation> --input -
|
|
|
55
63
|
|
|
56
64
|
删除、编辑、新增同样必须使用 `prepare -> apply`。出现 `partial/write_uncertain` 时停止,不能自动重试写操作。
|
|
57
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
|
+
|
|
58
68
|
## 暂缓能力
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
以下新版源资料已有提交接口,但当前仍不暴露为 Agent 操作:
|
|
61
71
|
|
|
62
72
|
- 共享发票:缺接收人的稳定 `appid/cid/uid` 解析和共享关系回查契约。
|
|
63
73
|
- 转让发票:会改变持有人,缺接收人侧归属回查契约。
|