weaver-work-cli 0.1.8 → 0.1.21
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 +25 -17
- package/dist/cmd/action.js +76 -0
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/refs/index.js +103 -0
- package/dist/cmd/register.js +31 -0
- package/dist/cmd/root.js +1 -0
- package/dist/cmd/setup/index.js +25 -5
- package/dist/cmd/skills/index.js +37 -5
- package/dist/core/connector.js +54 -0
- package/dist/core/context.js +2 -1
- package/dist/core/input.js +48 -0
- package/dist/core/output.js +298 -3
- package/dist/core/refs.js +435 -0
- package/dist/core/state.js +26 -0
- package/dist/internal/e10/auth/commands.js +34 -19
- package/dist/internal/e10/auth/session.js +74 -2
- package/dist/internal/e10/auth/xiaoe.js +359 -94
- package/dist/internal/e10/context.js +18 -6
- package/dist/internal/e10/request-runtime.js +8 -1
- package/dist/internal/skills/install.js +148 -28
- package/dist/internal/skills/reader.js +12 -9
- package/dist/shortcuts/blog/continuation.js +74 -0
- package/dist/shortcuts/blog/errors.js +60 -0
- package/dist/shortcuts/blog/host.js +175 -0
- package/dist/shortcuts/blog/index.js +324 -0
- package/dist/shortcuts/blog/manifest.js +415 -0
- package/dist/shortcuts/blog/operations/comment.js +125 -0
- package/dist/shortcuts/blog/operations/comments.js +31 -0
- package/dist/shortcuts/blog/operations/edit.js +131 -0
- package/dist/shortcuts/blog/operations/export.js +46 -0
- package/dist/shortcuts/blog/operations/like.js +80 -0
- package/dist/shortcuts/blog/operations/publish.js +157 -0
- package/dist/shortcuts/blog/operations/query-user.js +58 -0
- package/dist/shortcuts/blog/operations/query.js +96 -0
- package/dist/shortcuts/blog/operations/registry.js +54 -0
- package/dist/shortcuts/blog/operations/remind.js +176 -0
- package/dist/shortcuts/blog/operations/shared.js +330 -0
- package/dist/shortcuts/blog/operations/types.js +16 -0
- package/dist/shortcuts/blog/operations.js +9 -0
- package/dist/shortcuts/caizhilian/continuation.js +70 -0
- package/dist/shortcuts/caizhilian/errors.js +53 -0
- package/dist/shortcuts/caizhilian/host.js +190 -0
- package/dist/shortcuts/caizhilian/index.js +186 -0
- package/dist/shortcuts/caizhilian/manifest.js +42 -0
- package/dist/shortcuts/caizhilian/operations/api.js +801 -0
- package/dist/shortcuts/caizhilian/operations/confirm.js +75 -0
- package/dist/shortcuts/caizhilian/operations/files.js +306 -0
- package/dist/shortcuts/caizhilian/operations/form.js +170 -0
- package/dist/shortcuts/caizhilian/operations/handlers/collab.js +611 -0
- package/dist/shortcuts/caizhilian/operations/handlers/document.js +890 -0
- package/dist/shortcuts/caizhilian/operations/handlers/file-collection.js +1227 -0
- package/dist/shortcuts/caizhilian/operations/handlers/file-upload.js +192 -0
- package/dist/shortcuts/caizhilian/operations/handlers/fileops.js +570 -0
- package/dist/shortcuts/caizhilian/operations/handlers/folder.js +1024 -0
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +318 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-attach.js +294 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-backup.js +423 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-encrypt.js +238 -0
- package/dist/shortcuts/caizhilian/operations/handlers/setting-storage.js +364 -0
- package/dist/shortcuts/caizhilian/operations/handlers/system.js +106 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +151 -0
- package/dist/shortcuts/caizhilian/operations/shared.js +408 -0
- package/dist/shortcuts/caizhilian/operations/specs.js +698 -0
- package/dist/shortcuts/caizhilian/operations/types.js +57 -0
- package/dist/shortcuts/caizhilian/operations.js +21 -0
- package/dist/shortcuts/contract/continuation.js +70 -0
- package/dist/shortcuts/contract/errors.js +62 -0
- package/dist/shortcuts/contract/host.js +205 -0
- package/dist/shortcuts/contract/index.js +318 -0
- package/dist/shortcuts/contract/manifest.js +596 -0
- package/dist/shortcuts/contract/operations/clause-reference.js +78 -0
- package/dist/shortcuts/contract/operations/form-info.js +371 -0
- package/dist/shortcuts/contract/operations/read.js +118 -0
- package/dist/shortcuts/contract/operations/registry.js +43 -0
- package/dist/shortcuts/contract/operations/request.js +300 -0
- package/dist/shortcuts/contract/operations/shared.js +133 -0
- package/dist/shortcuts/contract/operations/subject.js +157 -0
- package/dist/shortcuts/contract/operations/template.js +81 -0
- package/dist/shortcuts/contract/operations/types.js +7 -0
- package/dist/shortcuts/contract/operations/workflow.js +52 -0
- package/dist/shortcuts/contract/operations/write.js +131 -0
- package/dist/shortcuts/contract/operations.js +8 -0
- package/dist/shortcuts/hrm/index.js +83 -2
- package/dist/shortcuts/hrm/manifest.js +16 -9
- package/dist/shortcuts/hrm/operations/employee.js +160 -30
- package/dist/shortcuts/hrm/operations/org.js +17 -3
- package/dist/shortcuts/hrm/operations/position.js +18 -2
- package/dist/shortcuts/hrm/operations/registry.js +2 -0
- package/dist/shortcuts/hrm/operations/resolve.js +449 -0
- package/dist/shortcuts/index.js +5 -1
- package/dist/shortcuts/invoice/index.js +74 -36
- package/dist/shortcuts/invoice/manifest.js +674 -4
- package/dist/shortcuts/invoice/markdown.js +172 -0
- package/dist/shortcuts/invoice/operations/add.js +3 -3
- package/dist/shortcuts/invoice/operations/delete.js +2 -2
- package/dist/shortcuts/invoice/operations/get.js +10 -2
- package/dist/shortcuts/invoice/operations/import.js +2 -2
- package/dist/shortcuts/invoice/operations/registry.js +8 -1
- package/dist/shortcuts/invoice/operations/reim-auto.js +719 -0
- package/dist/shortcuts/invoice/operations/reim.js +85 -2
- package/dist/shortcuts/invoice/operations/shared.js +75 -8
- package/dist/shortcuts/invoice/operations/update.js +2 -2
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +93 -0
- package/dist/shortcuts/invoice/operations/validate-preview.js +2 -1
- package/dist/shortcuts/invoice/projection.js +328 -0
- package/dist/shortcuts/meeting/host.js +18 -1
- package/dist/shortcuts/meeting/manifest.js +30 -18
- package/dist/shortcuts/meeting/operations/eb/catalog.js +390 -0
- package/dist/shortcuts/meeting/operations/eb/conflict.js +389 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +389 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +22 -0
- package/dist/shortcuts/meeting/operations/env.js +8 -1
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/signs.js +216 -2
- package/dist/shortcuts/workflow/endpoints.js +2 -1
- package/dist/shortcuts/workflow/errors.js +8 -2
- package/dist/shortcuts/workflow/host.js +11 -4
- package/dist/shortcuts/workflow/operations/form.js +1016 -590
- package/dist/shortcuts/workflow/operations/read.js +913 -231
- package/dist/shortcuts/workflow/operations/shared.js +21 -0
- package/dist/shortcuts/workflow/operations/write.js +750 -52
- package/dist/shortcuts/workflow/operations.js +36 -10
- package/docs/_catalog.md +6 -0
- package/docs/agent-invoice.md +5 -1
- package/docs/agent-io-channel-design.md +468 -0
- package/docs/agent-skill-install.md +9 -4
- package/docs/blog.md +123 -0
- package/docs/caizhilian.md +304 -0
- package/docs/contract.md +91 -0
- package/docs/e10-auth.md +4 -2
- package/docs/hrm.md +53 -11
- package/docs/invoice.md +5 -1
- package/docs/meeting.md +1 -1
- package/docs/operation-manual.md +15 -3
- package/docs/skill-review-2026-09-19.md +2 -2
- package/package.json +1 -1
- package/scripts/package-skill.mjs +32 -20
- package/scripts/xiaoe_env.py +118 -0
- package/skill-template/business-info.json +113 -14
- package/skill-template/domains/blog.md +24 -0
- package/skill-template/domains/caizhilian.md +22 -0
- package/skill-template/domains/hrm.md +2 -1
- package/skill-template/domains/jinchengda.md +23 -0
- package/skill-template/domains/meeting.md +1 -1
- package/skill-template/domains/workflow.md +1 -1
- package/skill-template/skill-template.md +1 -1
- package/skills/weaver-e10-blog/SKILL.md +111 -0
- package/skills/weaver-e10-blog/references/blog-comment.md +51 -0
- package/skills/weaver-e10-blog/references/blog-comments.md +39 -0
- package/skills/weaver-e10-blog/references/blog-default-permission.md +38 -0
- package/skills/weaver-e10-blog/references/blog-disabled-capabilities.md +11 -0
- package/skills/weaver-e10-blog/references/blog-edit.md +51 -0
- package/skills/weaver-e10-blog/references/blog-export.md +42 -0
- package/skills/weaver-e10-blog/references/blog-like.md +50 -0
- package/skills/weaver-e10-blog/references/blog-publish.md +52 -0
- package/skills/weaver-e10-blog/references/blog-query-user.md +45 -0
- package/skills/weaver-e10-blog/references/blog-query.md +49 -0
- package/skills/weaver-e10-blog/references/blog-remind.md +51 -0
- package/skills/weaver-e10-blog/references/blog-resolve-users.md +38 -0
- package/skills/weaver-e10-blog/references/source-manifest.json +1540 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +217 -0
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +106 -0
- package/skills/weaver-e10-caizhilian/references/collaboration.md +112 -0
- package/skills/weaver-e10-caizhilian/references/document.md +111 -0
- package/skills/weaver-e10-caizhilian/references/file-collection.md +173 -0
- package/skills/weaver-e10-caizhilian/references/file-upload.md +309 -0
- package/skills/weaver-e10-caizhilian/references/files.md +120 -0
- package/skills/weaver-e10-caizhilian/references/folder.md +122 -0
- package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +440 -0
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +372 -0
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +399 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +603 -0
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +5694 -0
- package/skills/weaver-e10-caizhilian/references/withheld.md +93 -0
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +120 -0
- package/skills/weaver-e10-calendar/SKILL.md +4 -3
- package/skills/weaver-e10-ebuilder-form/SKILL.md +4 -9
- package/skills/weaver-e10-ebuilder-form/references/context-routing.md +0 -9
- package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +1 -5
- package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -5
- package/skills/weaver-e10-esb/SKILL.md +2 -2
- package/skills/weaver-e10-esb/references/source-manifest.json +9 -9
- package/skills/weaver-e10-hrm/SKILL.md +104 -9
- package/skills/weaver-e10-hrm/references/employee.md +89 -15
- package/skills/weaver-e10-hrm/references/org.md +114 -5
- package/skills/weaver-e10-hrm/references/position.md +14 -7
- package/skills/weaver-e10-hrm/references/source-manifest.json +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +167 -0
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +82 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +69 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +78 -0
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +27 -0
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +71 -0
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +94 -0
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +89 -0
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +77 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +66 -0
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +94 -0
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +259 -0
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -11
- package/skills/weaver-e10-jucailin/SKILL.md +4 -3
- package/skills/weaver-e10-mail/SKILL.md +4 -11
- package/skills/weaver-e10-meeting/SKILL.md +66 -32
- package/skills/weaver-e10-meeting/references/meeting-change.md +5 -2
- package/skills/weaver-e10-meeting/references/meeting-create.md +2 -1
- package/skills/weaver-e10-meeting/references/meeting-eb.md +114 -0
- package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +9 -8
- package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +35 -7
- package/skills/weaver-e10-meeting/references/meeting-update.md +1 -1
- package/skills/weaver-e10-okr/SKILL.md +6 -11
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-plan/SKILL.md +3 -3
- package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +1 -1
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +1 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +4 -10
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-shared/SKILL.md +42 -34
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +16 -43
- package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +21 -14
- package/skills/weaver-e10-shijingran/SKILL.md +2 -1
- package/skills/weaver-e10-shijingran/references/source-manifest.json +9 -9
- package/skills/weaver-e10-skill-maker/SKILL.md +4 -10
- package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +5 -3
- package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +12 -27
- package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +17 -5
- package/skills/weaver-e10-skill-maker/references/source-update-detection.md +4 -27
- package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +1 -1
- package/skills/weaver-e10-wenshuding/SKILL.md +5 -16
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
- package/skills/weaver-e10-workflow/SKILL.md +41 -46
- package/skills/weaver-e10-workflow/references/source-manifest.json +39 -75
- package/skills/weaver-e10-workflow/references/workflow-batch.md +90 -29
- package/skills/weaver-e10-workflow/references/workflow-create.md +83 -109
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -9
- package/skills/weaver-e10-workflow/references/workflow-operate.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-query.md +40 -27
- package/skills/weaver-e10-workflow/references/workflow-share.md +18 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -4
- package/skills/weaver-e10-yepiaotong/SKILL.md +74 -39
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +22 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +135 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +15 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +217 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +88 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +7 -2
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +89 -9
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -0
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +70 -49
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +119 -0
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +55 -36
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +4 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +149 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +125 -5
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +430 -63
- package/skills/weaver-e10-yimiaoban/SKILL.md +4 -12
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-ziguanjia/SKILL.md +2 -1
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +3 -3
- package/tools/weaver-skill-detector-1.0.13/SKILL.md +9 -9
- package/tools/weaver-skill-detector-1.0.13/references/checklist.md +3 -3
- package/tools/weaver-skill-detector-1.0.13/scripts/__pycache__/validate_skill.cpython-313.pyc +0 -0
- package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +98 -91
- package/scripts/sync-connector-skills.mjs +0 -172
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// 把 skills/(skillhub 版)已修复的增量同步到 connector-skills/(连接器版)。
|
|
3
|
-
// 连接器版差异:name 后缀 -connector、命令带 --profile eteams、登录与安装由连接器托管。
|
|
4
|
-
// 本脚本只做「字符串级增量同步」,不重排既有内容,避免破坏连接器专属文案。
|
|
5
|
-
|
|
6
|
-
import { readFile, readdir, writeFile, stat } from 'node:fs/promises'
|
|
7
|
-
import path from 'node:path'
|
|
8
|
-
import { fileURLToPath } from 'node:url'
|
|
9
|
-
|
|
10
|
-
const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
11
|
-
const skillsRoot = path.join(repositoryRoot, 'skills')
|
|
12
|
-
const connectorRoot = path.join(repositoryRoot, 'connector-skills')
|
|
13
|
-
|
|
14
|
-
// 连接器版命令需带 --profile eteams,因此同步正文时要做一次命令改写。
|
|
15
|
-
function toConnectorCommands(text) {
|
|
16
|
-
return text
|
|
17
|
-
.replace(/(?<!--profile eteams )weaver-work-cli --json /g, 'weaver-work-cli --profile eteams --json ')
|
|
18
|
-
.replace(/^weaver-work-cli (hrm|ehr|fna|mail|meeting|okr|plan|esb|jiuchuanhui|asset|im|project|workflow|archive|calendar|invoice|ebuilder-form) schema$/gm,
|
|
19
|
-
'weaver-work-cli --profile eteams $1 schema')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 需要同步的「事实性/规范性修复」片段,按原文 → 新文替换。
|
|
23
|
-
const BODY_FIXES = [
|
|
24
|
-
[
|
|
25
|
-
'- 签到二维码、签到写操作、会议室/类型管理、会议变更/取消/结束未实现。',
|
|
26
|
-
'- 签到二维码、签到写操作、会议室/类型的增删改管理未实现(查询与占用可用,见命令表)。\n- 会议变更(`meeting.change.*`)与取消(`meeting.cancel.*`)**已实现**,按上文「处理链:变更 / 取消 / 删除会议」执行;只有「提前结束会议」不支持,见上一条。',
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
'- eb 链路的「撤回报告」为 ESB 动作流,改由 weaver-e10-customesb-execute skill 执行同名动作流。',
|
|
30
|
-
'- eb 链路的「撤回报告」为 ESB 动作流,CLI 返回 `policy/link_unsupported`;改由 `weaver-e10-esb` skill 用 `esb.input-format` + `esb.trigger.prepare/apply` 触发同名动作流(需要动作流 ID 或唯一值,见该 skill)。',
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
'需要改用 weaver-e10-customesb-execute skill 执行同名动作流。',
|
|
34
|
-
'需要改用 `weaver-e10-esb` skill 执行同名动作流。',
|
|
35
|
-
],
|
|
36
|
-
[
|
|
37
|
-
'三个子系统的响应契约和分页结构不统一',
|
|
38
|
-
'四个子系统(人事档案 / 出勤 / 薪酬 / 招聘)的响应契约和分页结构不统一',
|
|
39
|
-
],
|
|
40
|
-
['\n-客户列表默认展示', '\n- 客户列表默认展示'],
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
const CONNECTOR_CRED = [
|
|
44
|
-
'## 认证与请求头契约',
|
|
45
|
-
'',
|
|
46
|
-
'登录与会话由 E10 登录能力统一提供:文档型约定为 `weaver-e10-login` 技能;连接器场景下由连接器完成授权(`weaver-work-cli auth login`),业务命令统一通过 `--profile eteams` 读取该登录态。业务 Skill 不自建登录流程,不索取、打印或转存任何凭证。',
|
|
47
|
-
'',
|
|
48
|
-
'CLI 发往 E10 的每个请求都自动携带以下三项用户信息参数,**缺一不可**(业务入参里不要传这些字段,也不要手工拼装请求头):',
|
|
49
|
-
'',
|
|
50
|
-
'```text',
|
|
51
|
-
'Cookie: <weaver-e10-login 返回的完整原始 Cookie 串,原样透传,禁止裁剪/去重/改写>',
|
|
52
|
-
'eteamsid: <weaver-e10-login 返回的 ETEAMSID>',
|
|
53
|
-
'User-Agent: AgentType=<agentType>,IsAgent=true',
|
|
54
|
-
'```',
|
|
55
|
-
'',
|
|
56
|
-
].join('\n')
|
|
57
|
-
|
|
58
|
-
const TRIGGER_SECTIONS = {
|
|
59
|
-
'weaver-e10-meeting': '## 适用场景(何时使用本技能)\n\n用户提到会议、会议室、预约/建会、会议冲突、改期/改地点/改参会人、取消/删除会议、回执、签到、会议类型或会议室占用视图时,使用本技能。\n\n用户要处理的是日程、审批流程或组织人员查询时,分别转 `weaver-e10-calendar-connector` / `weaver-e10-workflow-connector` / `weaver-e10-hrm-connector`。\n\n',
|
|
60
|
-
'weaver-e10-qiyecheng': '## 适用场景(何时使用本技能)\n\n用户提到事前申请单预算、预算执行报表、报销/借款/预付核销金额、全公司借款汇总与列表、提醒还款、发票核销金额与列表或催票时,使用本技能。\n\n发票票夹与 OCR 走 `weaver-e10-yepiaotong-connector`,人员与流程 ID 解析不属于本技能范围。\n\n',
|
|
61
|
-
'weaver-e10-shijingran': '## 适用场景(何时使用本技能)\n\n用户要创建、查询、修改或删除事井然项目与任务,或查项目/任务的类型、状态、紧急程度等字典时使用本技能。\n\n用户处理的是流程审批、组织人员或发票时,转对应业务技能,不在本技能范围。\n\n',
|
|
62
|
-
'weaver-e10-workflow': '## 适用场景(何时使用本技能)\n\n用户提到待办、已办、我发起的流程、流程详情与摘要、同意/退回/转办/加审等流程操作、批量处理、共享流程、发起创建流程或修改流程表单时,使用本技能。\n\n用户要查组织架构与人员 ID 时转 `weaver-e10-hrm-connector`;查发票、邮件、日程、费控时转对应业务技能。\n\n',
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const H1_TITLES = {
|
|
66
|
-
'weaver-e10-jiuchuanhui': '# 泛微九氚汇营销管理\n',
|
|
67
|
-
'weaver-e10-mail': '# 泛微E10邮件\n',
|
|
68
|
-
'weaver-e10-wenshuding': '# 泛微E10文书定档案管理\n',
|
|
69
|
-
'weaver-e10-workflow': '# 泛微E10流程智能助手\n',
|
|
70
|
-
'weaver-e10-yepiaotong': '# 泛微E10业票通发票管理\n',
|
|
71
|
-
'weaver-e10-ziguanjia': '# 泛微E10资管家资产管理\n',
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async function exists(p) {
|
|
75
|
-
try { await stat(p); return true } catch { return false }
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function applyFixes(text) {
|
|
79
|
-
let out = text
|
|
80
|
-
for (const [from, to] of BODY_FIXES) {
|
|
81
|
-
if (out.includes(from)) out = out.split(from).join(to)
|
|
82
|
-
}
|
|
83
|
-
return out
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async function main() {
|
|
87
|
-
const skillDirs = (await readdir(skillsRoot, { withFileTypes: true }))
|
|
88
|
-
.filter((e) => e.isDirectory())
|
|
89
|
-
.map((e) => e.name)
|
|
90
|
-
|
|
91
|
-
let changed = 0
|
|
92
|
-
const report = []
|
|
93
|
-
|
|
94
|
-
for (const skill of skillDirs) {
|
|
95
|
-
const connectorName = `${skill}-connector`
|
|
96
|
-
const connectorDir = path.join(connectorRoot, connectorName)
|
|
97
|
-
if (!(await exists(connectorDir))) {
|
|
98
|
-
report.push(`跳过 ${connectorName}(连接器版不存在)`)
|
|
99
|
-
continue
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const srcPath = path.join(skillsRoot, skill, 'SKILL.md')
|
|
103
|
-
if (!(await exists(srcPath))) continue
|
|
104
|
-
const src = await readFile(srcPath, 'utf8')
|
|
105
|
-
const dstPath = path.join(connectorDir, 'SKILL.md')
|
|
106
|
-
let dst = await readFile(dstPath, 'utf8')
|
|
107
|
-
const before = dst
|
|
108
|
-
|
|
109
|
-
// 1) 事实性/规范性修复(先做命令改写,保证片段能命中)
|
|
110
|
-
dst = applyFixes(toConnectorCommands(dst))
|
|
111
|
-
|
|
112
|
-
// 2) 补 H1
|
|
113
|
-
if (!/^# /m.test(dst) && H1_TITLES[skill]) {
|
|
114
|
-
const idx = dst.search(/^## /m)
|
|
115
|
-
if (idx > 0) dst = dst.slice(0, idx) + H1_TITLES[skill] + '\n' + dst.slice(idx)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// 3) 补触发场景章节
|
|
119
|
-
const trigger = TRIGGER_SECTIONS[skill]
|
|
120
|
-
if (trigger && !/适用场景(何时使用本技能)/.test(dst)) {
|
|
121
|
-
const idx = dst.search(/^## /m)
|
|
122
|
-
if (idx > 0) dst = dst.slice(0, idx) + trigger + dst.slice(idx)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 4) 补登录依赖与请求头契约(源版有 dependencies 才同步)
|
|
126
|
-
const srcHasDeps = /^dependencies:/m.test(src)
|
|
127
|
-
if (srcHasDeps && !/^dependencies:/m.test(dst)) {
|
|
128
|
-
dst = dst.replace(/^(requires:\n(?:\s+.*\n)+)/m, (m) => `${m}dependencies:\n - weaver-e10-login\n`)
|
|
129
|
-
}
|
|
130
|
-
if (srcHasDeps && !/## 认证与请求头契约/.test(dst)) {
|
|
131
|
-
const idx = dst.search(/^## /m)
|
|
132
|
-
if (idx > 0) dst = dst.slice(0, idx) + CONNECTOR_CRED + '\n' + dst.slice(idx)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (dst !== before) {
|
|
136
|
-
await writeFile(dstPath, dst)
|
|
137
|
-
changed += 1
|
|
138
|
-
report.push(`已同步 ${connectorName}/SKILL.md`)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// 5) references 增量同步:只在源文件存在且内容不同时做同样的修复
|
|
142
|
-
const srcRefDir = path.join(skillsRoot, skill, 'references')
|
|
143
|
-
const dstRefDir = path.join(connectorDir, 'references')
|
|
144
|
-
if (!(await exists(srcRefDir)) || !(await exists(dstRefDir))) continue
|
|
145
|
-
for (const file of await readdir(srcRefDir)) {
|
|
146
|
-
if (!file.endsWith('.md')) continue
|
|
147
|
-
const s = await readFile(path.join(srcRefDir, file), 'utf8')
|
|
148
|
-
const dPath = path.join(dstRefDir, file)
|
|
149
|
-
if (!(await exists(dPath))) continue
|
|
150
|
-
let d = await readFile(dPath, 'utf8')
|
|
151
|
-
const dBefore = d
|
|
152
|
-
d = applyFixes(toConnectorCommands(d))
|
|
153
|
-
// 源版新增的登录/凭证契约段同步到连接器版
|
|
154
|
-
if (/### 登录与凭证契约(生成产物必须遵循)/.test(s) && !/登录与凭证契约/.test(d)) {
|
|
155
|
-
const anchor = d.search(/^## /m)
|
|
156
|
-
if (anchor > 0) d = d.slice(0, anchor) + CONNECTOR_CRED + '\n' + d.slice(anchor)
|
|
157
|
-
}
|
|
158
|
-
if (d !== dBefore) {
|
|
159
|
-
await writeFile(dPath, d)
|
|
160
|
-
report.push(`已同步 ${connectorName}/references/${file}`)
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
console.log(report.join('\n'))
|
|
166
|
-
console.log(`\n完成:更新 ${changed} 个连接器 SKILL.md`)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
main().catch((error) => {
|
|
170
|
-
console.error(error)
|
|
171
|
-
process.exit(1)
|
|
172
|
-
})
|