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
|
@@ -1,31 +1,113 @@
|
|
|
1
1
|
# Agent Skill 安装与升级
|
|
2
2
|
|
|
3
|
-
本文说明如何把 `weaver-work-cli` 随包 Agent Skill(以 `
|
|
3
|
+
本文说明如何把 `weaver-work-cli` 随包 Agent Skill(以 `yepiaotong` 为例)安装或升级到本机 Agent 的 skill 目录。适用两类读者:
|
|
4
4
|
|
|
5
5
|
- 首次让 Codex / WorkBuddy 等 Agent 识别发票业务的使用者;
|
|
6
6
|
- 在本仓库修改 Skill 内容后,需要把最新版同步到本机 Agent 环境的开发者。
|
|
7
7
|
|
|
8
|
-
Agent 运行期调用规则不在这里,见 `skills/weaver-
|
|
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
|
+
```
|
|
9
66
|
|
|
10
67
|
## 最短命令
|
|
11
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
|
+
|
|
12
81
|
```bash
|
|
13
|
-
|
|
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"
|
|
14
87
|
```
|
|
15
88
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
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` 显式指定。
|
|
18
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
|
+
```
|
|
19
101
|
|
|
20
102
|
## 各 Agent 环境的 skill 目录
|
|
21
103
|
|
|
22
104
|
| Agent 环境 | skill 根目录 | 安装方式 |
|
|
23
105
|
| --- | --- | --- |
|
|
24
|
-
| Codex CLI |
|
|
25
|
-
| WorkBuddy(桌面端) |
|
|
26
|
-
| 其它 Agent | 由 Agent 配置决定 | `skills install
|
|
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>` |
|
|
27
109
|
|
|
28
|
-
不确定 Agent
|
|
110
|
+
不确定 Agent 读哪个目录时先问用户,不要盲目同时安装到多个目录。装到用户主目录下的 `.workbuddy/skills` 不会同步 `.codex/skills`,反之亦然。
|
|
29
111
|
|
|
30
112
|
## 核心事实(先读,避免误操作)
|
|
31
113
|
|
|
@@ -37,37 +119,74 @@ weaver-work-cli skills install invoice --target-dir <目标skills目录>
|
|
|
37
119
|
|
|
38
120
|
## 首次安装
|
|
39
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
|
+
|
|
40
138
|
```bash
|
|
41
139
|
# 1. 确认命令可用且能看到随包 Skill
|
|
42
140
|
weaver-work-cli --version
|
|
43
141
|
weaver-work-cli skills list
|
|
44
142
|
|
|
45
143
|
# 2. 安装到目标目录(示例:WorkBuddy)
|
|
46
|
-
weaver-work-cli skills install
|
|
144
|
+
weaver-work-cli skills install yepiaotong --target-dir "$HOME/.workbuddy/skills"
|
|
47
145
|
|
|
48
146
|
# 3. 验证:结果是真实目录,不是软链
|
|
49
|
-
ls -la
|
|
147
|
+
ls -la "$HOME/.workbuddy/skills"
|
|
50
148
|
```
|
|
51
149
|
|
|
52
150
|
## 从本地开发仓库升级到最新
|
|
53
151
|
|
|
54
152
|
在仓库根目录执行:
|
|
55
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
|
+
|
|
56
175
|
```bash
|
|
57
176
|
# 1. 前置检查:确认全局 CLI 来源与待发布的工作区状态
|
|
58
|
-
|
|
177
|
+
command -v weaver-work-cli
|
|
59
178
|
git status --short
|
|
60
179
|
|
|
61
180
|
# 2. 重新构建,通过构建期 TS 校验(clean + tsc)
|
|
62
181
|
npm run build
|
|
63
182
|
|
|
64
183
|
# 3. 移除目标目录旧条目(软链/旧副本),再安装
|
|
65
|
-
rm
|
|
66
|
-
weaver-work-cli skills install
|
|
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"
|
|
67
186
|
|
|
68
187
|
# 4. 验证安装的是最新内容(与仓库工作区一致)
|
|
69
|
-
diff -q skills/weaver-
|
|
70
|
-
diff -q skills/weaver-
|
|
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"
|
|
71
190
|
```
|
|
72
191
|
|
|
73
192
|
构建失败(tsc 报错)时先修复 TS 错误再安装;`skills install` 的内容源不依赖 `dist/`,但发布前应保证仓库可构建。
|
|
@@ -76,17 +195,17 @@ diff -q skills/weaver-work-cli-shared/SKILL.md ~/.workbuddy/skills/weaver-work-c
|
|
|
76
195
|
|
|
77
196
|
安装本身不校验业务 API。要确认对 Agent 生效:
|
|
78
197
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
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` 与仓库内容比对。
|
|
81
200
|
- **Agent 需重新加载**:新建会话或按 Agent 规则重载 Skill 后才读取新内容;已打开的会话不会热更新。
|
|
82
|
-
- 业务可用性:安装后仍需完成 E10 登录(`weaver-work-cli auth login --base-url "<E10_BASE_URL>"`),并可按 `weaver-work-cli invoice schema` 验证 operation 契约。
|
|
201
|
+
- 业务可用性:安装后仍需完成 E10 登录(`weaver-work-cli auth login --base-url "<E10_BASE_URL>" --agent_type "<当前智能体名称>"`),并可按 `weaver-work-cli invoice schema` 验证 operation 契约。
|
|
83
202
|
|
|
84
203
|
## 常见问题
|
|
85
204
|
|
|
86
205
|
| 现象 | 处理 |
|
|
87
206
|
| --- | --- |
|
|
88
207
|
| `weaver-work-cli: command not found` | 先安装运行时:`npm install -g weaver-work-cli`,再 `setup invoice` |
|
|
89
|
-
| 安装报 `ERR_FS_CP_DIR_TO_NON_DIR` |
|
|
90
|
-
| `unknown packaged skill` | 确认 `weaver-work-cli skills list` 输出的包内 Skill 名称;目标是全名或 `
|
|
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` 等短名 |
|
|
91
210
|
| 改了仓库 Skill 但 Agent 看不到 | 已安装目录是拷贝,需重跑安装;且 Agent 需新会话重载 |
|
|
92
|
-
| 需要离线/平台导入的独立归档 | 用 `npm run build:
|
|
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
|
```
|
package/docs/ehr.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# 聚才林人事云(ehr)
|
|
2
|
+
|
|
3
|
+
`ehr` 是 E10 聚才林人事云的聚合命令,覆盖**人事档案(hr)**、**出勤管理(attend)**、**薪酬管理(salary)**、**招聘(recruit,读 + 写)** 四个业务域。
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
weaver-work-cli ehr --help
|
|
7
|
+
weaver-work-cli ehr schema
|
|
8
|
+
weaver-work-cli --json ehr run <operation> --input -
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`schema` 是能力清单的唯一事实来源,包含每个 operation 的 `inputSchema`、`risk`、`requiresConfirmation`,以及固定数据源 `formId` 常量表 `dataSourceIds` 和禁用清单 `withheldOperations`。
|
|
12
|
+
|
|
13
|
+
## 实现位置
|
|
14
|
+
|
|
15
|
+
| 路径 | 职责 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `src/shortcuts/ehr/index.ts` | 命令注册与 JSON envelope |
|
|
18
|
+
| `src/shortcuts/ehr/manifest.ts` | `schema` 契约与禁用边界声明 |
|
|
19
|
+
| `src/shortcuts/ehr/host.ts` | E10 会话桥接、认证头、form/JSON 请求、响应归一化 |
|
|
20
|
+
| `src/shortcuts/ehr/continuation.ts` | 写操作确认链的 HMAC-SHA256 token |
|
|
21
|
+
| `src/shortcuts/ehr/operations/` | 按业务域拆分的 operation 实现 |
|
|
22
|
+
| `src/shortcuts/ehr/operations/registry.ts` | operation 注册表与去重校验 |
|
|
23
|
+
|
|
24
|
+
## 认证
|
|
25
|
+
|
|
26
|
+
复用 `src/internal/e10` 的 E10 会话(`requireE10Session`),请求自动携带 `Cookie`、`eteamsid` 与 `X-Requested-With: XMLHttpRequest`。业务代码不接触认证目录。
|
|
27
|
+
|
|
28
|
+
请求路径强制以 `/api/` 开头,并拒绝绝对路径、跨域 URL 与路径逃逸。
|
|
29
|
+
|
|
30
|
+
## 子系统差异归一化
|
|
31
|
+
|
|
32
|
+
三个子系统由不同团队开发,契约不一致,`host.ts` 与 `operations/shared.ts` 负责归一化。
|
|
33
|
+
|
|
34
|
+
**响应成功判定**
|
|
35
|
+
|
|
36
|
+
| 子系统 | 契约 |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| 出勤 | `success` 布尔 |
|
|
39
|
+
| 人事档案 | `code=200` |
|
|
40
|
+
| 薪酬个人报表 | `status` 布尔 |
|
|
41
|
+
|
|
42
|
+
**分页**:统一提取 `pageNo`/`current`/`pageSize`/`total`/`totalCount`/`totalPage`/`tableId`。
|
|
43
|
+
- 表格类接口(出勤/人事/薪酬)总数用 **`total`**;数据源计数接口用 **`totalCount`**——两者都要提取,已在 `normalizePaged` 中覆盖。
|
|
44
|
+
- 出勤统计接口不返回 page 对象(它是范围聚合,不是分页列表)。
|
|
45
|
+
- `pageSize` **由服务端固定,传参无效**:通讯录 100,出勤与报表类 20。全量数据必须递增 `current` 翻页。
|
|
46
|
+
|
|
47
|
+
**数据行位置(三种命名,均已在真实 E10 实测)**:
|
|
48
|
+
|
|
49
|
+
| 接口 | 数据行字段 |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `hr.contact.search` | `data` |
|
|
52
|
+
| 出勤表格类(`abnormal`/`signrecord`/`orbit`/`worktime`/`leave`/`appeal`)+ hr 报表(`report.*`/`props.table`) | **`displayData`**(`data` 为空数组) |
|
|
53
|
+
| `attend.report.get` | **`datas`** |
|
|
54
|
+
|
|
55
|
+
注意 `birthday.list` 是例外——它的行在 `data`(同模块内也不统一)。
|
|
56
|
+
|
|
57
|
+
CLI 原样透传整个响应对象,不做重命名;取用方按上表判断。
|
|
58
|
+
|
|
59
|
+
**每页条数**:由服务端按接口独立配置,**`pageSize` 传参无效**(实测):通讯录 100、出勤表格类 20、`worktime`/`leave.report` 10、hr 报表 20、薪酬 `bill.list`/`employee.list` 20、`empchange.list` 100。全量数据一律递增 `current` 翻页。
|
|
60
|
+
|
|
61
|
+
**成功响应的 `data` 恒存在**:业务数据为 `undefined` 时(如社保福利、调薪记录为空)统一补为 `null`,避免 `JSON.stringify` 省略该键导致调用方需判断键是否存在。
|
|
62
|
+
|
|
63
|
+
**二次身份验证 token**:工资单相关 4 个接口要求携带 `token`(与登录凭证无关,不由认证链路提供)。`bill.list` 走 body,其余三个走 query。用户未提供时 CLI 自动补固定协议值 `DONT_NEED`;用户主动提供时用原值。缺失会返回 `checkSecondFailNoToken`,验证失败返回 `checkSecondFail`,服务异常返回 `checkSecondError`(此时**不得绕过验证读取数据**)。见 `shared.ts` 的 `resolveSecondAuthToken`。
|
|
64
|
+
|
|
65
|
+
**历史教训(2026-09-04)**:`bill.get` 曾持续返回 `code=500`,一度被判定为"服务端问题"(当时绕过 CLI 直接发 HTTP 也是 500,看似佐证)。真实原因是**未传 `token`**——直接 HTTP 对照时同样没传,所以对照组也失败,形成了误导性证据。补齐 `token` 后两个工资单 ID 均正常返回。结论:**构造对照实验时,必须确保对照组与实验组的差异只有唯一变量**。
|
|
66
|
+
|
|
67
|
+
**语义差异(需调用方注意)**:通讯录默认只查在职(`personnelStatus=["normal"]`),人员状态变更台账默认包含离职人员。
|
|
68
|
+
|
|
69
|
+
## 数据源接口
|
|
70
|
+
|
|
71
|
+
HR 报表类接口走 `application/x-www-form-urlencoded`(`sourceType=LOGIC` + `queryDto` 为 JSON 字符串),不是 JSON body。`queryDto` 由 CLI 从结构化参数构造:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"formId": "754217732232708651",
|
|
76
|
+
"conditions": [{ "field": "timePoint", "value": "2026-02-28", "compareType": "eq" }],
|
|
77
|
+
"pageNo": 1,
|
|
78
|
+
"pageSize": 100
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**日期范围条件必须拆成 `gte` + `lte` 两个条件**,这是 `hw.dutyDate` / `turn.dateRange` / `v2DeptEmpMove.month` / `dismiss.dismissDate` 的唯一正确传法。引擎取前 2 个 `conditionValue` 作为起止日期。
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
"conditions": [
|
|
86
|
+
{ "field": "dutyDate", "value": "2026-01-01", "compareType": "gte" },
|
|
87
|
+
{ "field": "dutyDate", "value": "2026-12-31", "compareType": "lte" }
|
|
88
|
+
]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
只有 `tp.timePoint` 是单条件,用 `eq`。
|
|
92
|
+
|
|
93
|
+
**不要用 `between`**(2026-09-04 修正,此前误判为可用):实测 `_inner_params` 回显为 `paramTp: "2026-01-01,2026-12-31"`(服务端只收到单个字符串),返回条数与全量相同,即**退化为不过滤**;`hw` 等数据源传 `between` 则直接报 500。
|
|
94
|
+
|
|
95
|
+
验证条件是否真生效:查返回记录的 `_inner_params`(如 `paramDutyDate: ["2026-01-01","2026-12-31"]`),它回显服务端实际收到的起止值;并用不同范围对比条数(实测 2026 全年 2535 vs 2026-06 单月 2534,证明过滤生效)。
|
|
96
|
+
|
|
97
|
+
`COMPARE_TYPES` 白名单含 `eq`/`in`/`like`/`gtAndEq`/`ltAndEq`/`gte`/`lte`/`between`,具体以 `ds.fields` 返回的 `conditionType` 为准。
|
|
98
|
+
|
|
99
|
+
`getListData` 走 `/api/bs/hr/ai/ds/getListData`,旧路径 `/api/bs/hr/ds/getListData` 已废弃。
|
|
100
|
+
|
|
101
|
+
## 写操作确认链
|
|
102
|
+
|
|
103
|
+
出勤域有 4 组写操作,全部采用 `prepare -> apply`:
|
|
104
|
+
|
|
105
|
+
| 用途 | prepare | apply |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| PC 端打卡 | `ehr.attend.card.check.prepare` | `ehr.attend.card.check.apply` |
|
|
108
|
+
| 创建申诉 | `ehr.attend.appeal.save.prepare` | `ehr.attend.appeal.save.apply` |
|
|
109
|
+
| 处理申诉 | `ehr.attend.appeal.result.prepare` | `ehr.attend.appeal.result.apply` |
|
|
110
|
+
| 报表重算 | `ehr.attend.report.recalc.prepare` | `ehr.attend.report.recalc.apply` |
|
|
111
|
+
|
|
112
|
+
协议:
|
|
113
|
+
|
|
114
|
+
1. `prepare` 只预览并生成 continuation,不发送写请求。
|
|
115
|
+
2. `apply` 必须带 `confirm=true` 与 `prepare` 返回的 continuation。
|
|
116
|
+
3. continuation 绑定 `baseUrl`/`profile`/`userId`,10 分钟有效;租户或账号变化会触发 `context_mismatch`。
|
|
117
|
+
4. 关键参数与 `prepare` 快照不一致时触发 `target_changed`,必须重新 `prepare`。
|
|
118
|
+
5. 网络中断抛出 `partial/write_uncertain`(退出码 `partial`),**禁止自动重试**,先做只读回查。
|
|
119
|
+
|
|
120
|
+
PC 打卡凭证 `sign` = `md5("wea" + "web" + empId + ETEAMSID + tenantKey 小写) + "ver"`,在 `apply` 阶段按当前会话实时构造,continuation 中不携带签名材料。
|
|
121
|
+
|
|
122
|
+
## 调用示例
|
|
123
|
+
|
|
124
|
+
Windows PowerShell:
|
|
125
|
+
|
|
126
|
+
```powershell
|
|
127
|
+
weaver-work-cli --json ehr run ehr.attend.summary.get --input-json '{"beginDate":"2026-03-01","endDate":"2026-03-31"}'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
macOS/Linux(bash/zsh):
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
printf '%s\n' '{"beginDate":"2026-03-01","endDate":"2026-03-31"}' | weaver-work-cli --json ehr run ehr.attend.summary.get --input -
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 招聘查询(recruit)
|
|
137
|
+
|
|
138
|
+
招聘域第一期提供 4 个读 operation(`operations/recruit.ts`):
|
|
139
|
+
|
|
140
|
+
| operation | 用途 |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| `ehr.recruit.context.resolve` | 五层解析结果查看(调试/兜底用) |
|
|
143
|
+
| `ehr.recruit.candidate.search` | 人才库姓名/手机号模糊搜索(无筛选 = 列出全部) |
|
|
144
|
+
| `ehr.recruit.candidate.list` | demand/position/entry/offer 四类业务列表 |
|
|
145
|
+
| `ehr.recruit.candidate.card` | 人才详情卡片(权限闸门 + 四卡片并行) |
|
|
146
|
+
|
|
147
|
+
**五层运行时解析**:招聘接口不依赖固定路径,CLI 在业务调用前自动完成
|
|
148
|
+
`getAppIds(tag=weaver-recruit-service) -> getObjsByTag -> allMenus -> ds/fields -> ds/options`,
|
|
149
|
+
拿到 appId/objId/listId/cusMenuId/fieldId/optionId。菜单名按关键词匹配(跨版本菜单名不同,
|
|
150
|
+
解析不到必须报错,禁止臆造)。解析产物缓存于进程内 + 磁盘双层,磁盘缓存根 = `E10_SKILL_CACHE_DIR`
|
|
151
|
+
环境变量,未设置回退 CLI 数据目录 `WEAVER_WORK_CLI_HOME`(默认用户主目录下 `.weaver-work-cli`)的
|
|
152
|
+
`env-cache/recruit-ops/<host>_<port>/<appId>.json`,与独立技能 `weaver-e10-jucailin` 同构(设同一
|
|
153
|
+
`E10_SKILL_CACHE_DIR` 即可共享);缓存目录内唯一 `<appId>.json`
|
|
154
|
+
直接命中时跳过安装闸门(省 1 次 RTT),缺失时自动全量解析并回写缓存。
|
|
155
|
+
|
|
156
|
+
**displayData 显示层策略**:EB 列表接口(`mapResult=1`)响应同时含 `data.data`(原始层,
|
|
157
|
+
人员/字典字段为裸大 ID)与 `data.displayData`(显示层,服务端已内联姓名与字典中文)。
|
|
158
|
+
列表 operation 优先取 displayData(零额外请求);缺失时回退原始层——字典映射 + 纯 ID 创建人
|
|
159
|
+
经 `/api/hrm/common/getEmployeeByIds`(`devtype: 5` 头,100 个一批)批量反查兜底。显示层行清理
|
|
160
|
+
剔除 `DISPLAY_UI_KEYS`(operate/isToDo/todoPropSpan/flow_status 等)与 `xxxSpan`/`xxxAction` 动态后缀。
|
|
161
|
+
|
|
162
|
+
**详情卡片**:`hasRights`(READ 闸门,严格前置)与 `getCandidateCardPrepareQuery` 并行
|
|
163
|
+
(3RTT→2RTT),通过后四张卡片(BaseInfo/OtherInfo GET + InterviewInfo/Remark POST)并行;
|
|
164
|
+
面试/沟通 `pageSize=100` 防默认 10 条静默截断。姓名内联解析兼容三种形态:数组 `name`、
|
|
165
|
+
对象 `username`(备注创建人)、字符串 JSON。唯一仍需本地翻译的是 `baseInfo.recruitStatus`。
|
|
166
|
+
每请求随机串:`tableuid` 32 位 hex、`randomkey_`/`v` 6 位 hex。
|
|
167
|
+
|
|
168
|
+
招聘 EB 接口要求 `ebBusinessId: <listId>` 请求头,`ds/fields` 要求 multipart/form-data,
|
|
169
|
+
两者由 `host.ts` 的 `headers`/`multipart` 通道支持(认证头仍由运行时统一注入并保护)。
|
|
170
|
+
|
|
171
|
+
**招聘写操作**(`operations/recruit-write.ts`):candidate.create / interview.arrange / offer.send / entry.process / interview.feedback.edit / interview.feedback.urge 六对 prepare→apply 已实现(迁移自 ehr 技能 recruit-* 写脚本),全部走确认链协议:prepare(只读定位/查重/枚举与人员解析 + 摘要 + continuation 10 分钟)→ 用户确认 → apply(confirm + 指纹校验 + 会话绑定校验 + 部分操作 apply 阶段二次查重);多步写入(saveFormData → initTalentBatch / sendOffer / saveEstPreEntry / runEsb)中断报 `partial/write_uncertain` 禁止自动重试。Offer 邮件、面试通知(notify)、催评为 L3 外部通知。esbActionIds 全部运行时按钮解析(getFormButtons/getListButtons),解析不到阻断不编造。入职撤销(entry.cancel.change)暂缓实现。
|
|
172
|
+
|
|
173
|
+
## 禁用边界
|
|
174
|
+
|
|
175
|
+
`withheldOperations` 中声明的两类能力不实现,也不要绕过:
|
|
176
|
+
|
|
177
|
+
- **招聘撤销类写操作**(`recruit.entry.cancel.change`):撤销动作破坏性最强且依赖独立入口链路,暂缓迁移;招聘其余读/写操作已可用。
|
|
178
|
+
- **移动端打卡**(`attend.card.sign.mobile`):依赖真实定位、WiFi/蓝牙、设备凭证,Agent 无法获取,服务端必拒。严禁伪造参数重试。
|
|
179
|
+
|
|
180
|
+
## 测试
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
node --test --import tsx "test/business/ehr-recruit.test.ts" "test/business/ehr-recruit-write.test.ts" "test/business/ehr-operations.test.ts" "test/business/ehr-host.test.ts"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
覆盖 manifest/registry 一致性、请求形状断言、写操作确认链、响应归一化、打卡签名算法与路径白名单,招聘域另覆盖 displayData 优先、原始层兜底反查、权限闸门前置、prepare/apply 全协议(指纹篡改拦截、二次查重、partial 报告、按钮解析失败阻断)与错误形状。
|
package/docs/esb.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# esb — E10 ESB 中心自定义触发动作流
|
|
2
|
+
|
|
3
|
+
本模块为维护者说明。面向 Agent 的使用入口在 `skills/weaver-e10-esb/SKILL.md`,operation 合约以 `weaver-work-cli esb schema` 为准。
|
|
4
|
+
|
|
5
|
+
## 模块来源
|
|
6
|
+
|
|
7
|
+
- 源资料 Skill:`weaver-e10-customesb-execute`(ESB 中心动作流触发接口 Skill),本模块把它同步转换为 `weaver-work-cli esb` 命令面 + Agent Skill `skills/weaver-e10-esb`。
|
|
8
|
+
- 源接口(去域名路径,域名与认证由 `src/internal/e10` 托管,业务 `host.ts` 不拼接域名、不处理凭证):
|
|
9
|
+
- `POST /api/bs/esb/setting/customData/application/copyCustomData` — 取入参模板(只读)。
|
|
10
|
+
- `POST /api/esb/server/event/triggerActionFlow` — 执行自定义触发类型动作流(写操作)。
|
|
11
|
+
|
|
12
|
+
## CLI 结构
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
src/shortcuts/esb/
|
|
16
|
+
index.ts Commander 注册(schema / run)、输入解析、输出 envelope
|
|
17
|
+
manifest.ts operation 合约(WHAT:name/summary/risk/inputSchema/withheldOperations)
|
|
18
|
+
operations.ts run 入口:白名单校验后分发 handler
|
|
19
|
+
host.ts E10 请求适配:路径白名单、resultCode 归一化、写不确定性处理
|
|
20
|
+
errors.ts 模块结构化错误
|
|
21
|
+
continuation.ts prepare/apply 的 HMAC continuation 签发与校验
|
|
22
|
+
operations/
|
|
23
|
+
registry.ts manifest 与 handler 强制一一对应
|
|
24
|
+
types.ts handler 类型与 envelope
|
|
25
|
+
shared.ts 输入归一化、占位字段收集、resultCode 结果摘要
|
|
26
|
+
input-format.ts
|
|
27
|
+
trigger.ts
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## operation 表
|
|
31
|
+
|
|
32
|
+
| operation | 风险 | 用途 |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `esb.input-format` | `read` | 按 `applicationId` 取回 `customParams` 模板、`moduleSource` 与 `esbFlowId`;无副作用 |
|
|
35
|
+
| `esb.trigger.prepare` | `read-before-write` | 只读回查目标动作流、组装触发请求体、签发 continuation(10 分钟);不触发动作流 |
|
|
36
|
+
| `esb.trigger.apply` | `high-risk-write` | 校验 continuation 与登录身份后调用触发接口,需 `confirm: true` |
|
|
37
|
+
|
|
38
|
+
## 常见命令
|
|
39
|
+
|
|
40
|
+
Windows PowerShell:
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
weaver-work-cli --json esb run esb.input-format --input-json '{"applicationId":"900000000000000001"}'
|
|
44
|
+
weaver-work-cli --json esb run esb.trigger.prepare --input-json '{"esbFlowId":"900000000000000001","employeeId":"10001","customParams":{"mainTable":{"dataId":"D1001"}}}'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
macOS/Linux(bash/zsh):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
weaver-work-cli --json esb run esb.input-format --input-json '{"applicationId":"900000000000000001"}'
|
|
51
|
+
weaver-work-cli --json esb run esb.trigger.prepare --input-json '{"esbFlowId":"900000000000000001","employeeId":"10001","customParams":{"mainTable":{"dataId":"D1001"}}}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 安全边界
|
|
55
|
+
|
|
56
|
+
- **写操作强制确认链**:触发走 `prepare → apply`;`apply` 必须带 `confirm: true` 与有效 continuation,continuation 与签发时的 `userId`/`tenantKey` 绑定,过期或身份变化必须重新 prepare。
|
|
57
|
+
- **写不确定性**:触发请求已发出但未取得结果(网络中断、超时)时返回 `partial/write_uncertain`,退出码为 `Partial`,禁止自动重试——重试可能造成重复执行。
|
|
58
|
+
- **resultCode 归一化**:触发接口非 200 的 `resultCode` 全部在 `host.ts` 映射为结构化 subtype(如 507/508/511 → `throttled` 可重试,404 → `flow_not_found` 不可重试),`resultMsg` 原样带出。
|
|
59
|
+
- **输入白名单**:顶层字段严格来自 `manifest.ts` 的 `inputSchema.properties`,未知字段直接报 `unknown_field`;`esbFlowId` 与 `uniqueIndent` 二选一,都传或多缺均报错,不做静默回退。
|
|
60
|
+
|
|
61
|
+
## 已知限制(`withheldOperations`)
|
|
62
|
+
|
|
63
|
+
- `esb.actionflow.resolve`:按动作流名称解析 ID 需要 ESB 中心查询接口,源资料未给出路径与字段契约,未实现;请用户直接提供 ID。
|
|
64
|
+
- `esb.unique-indent.resolve`:唯一值触发所需的 `primary_key` 需直接查询 `esb_setting` 库(`SELECT primary_key FROM esb_application WHERE id = ?`),CLI 无数据库通道,只能由调用方查得后传入。
|