weaver-work-cli 0.1.25 → 0.1.28
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 +35 -30
- package/dist/cmd/root.js +1 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/core/runtime-agent.js +19 -0
- package/dist/internal/e10/auth/commands.js +48 -33
- package/dist/internal/e10/auth/messages.js +3 -0
- package/dist/internal/e10/auth/session.js +8 -0
- package/dist/internal/e10/auth/xiaoe.js +62 -43
- package/dist/internal/e10/auth-recovery.js +148 -0
- package/dist/internal/e10/client.js +47 -15
- package/dist/internal/e10/context.js +9 -31
- package/dist/internal/e10/index.js +1 -0
- package/dist/internal/e10/request-runtime.js +51 -9
- package/dist/shortcuts/archive/host.js +3 -2
- package/dist/shortcuts/archive/manifest.js +1 -1
- package/dist/shortcuts/archive-oa/constants.js +66 -0
- package/dist/shortcuts/archive-oa/continuation.js +70 -0
- package/dist/shortcuts/archive-oa/errors.js +53 -0
- package/dist/shortcuts/archive-oa/host.js +158 -0
- package/dist/shortcuts/archive-oa/index.js +225 -0
- package/dist/shortcuts/archive-oa/manifest.js +62 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +159 -0
- package/dist/shortcuts/archive-oa/operations/borrow-url.js +108 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +48 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +120 -0
- package/dist/shortcuts/archive-oa/operations/locate.js +50 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +40 -0
- package/dist/shortcuts/archive-oa/operations/shared.js +181 -0
- package/dist/shortcuts/archive-oa/operations/types.js +45 -0
- package/dist/shortcuts/archive-oa/operations.js +13 -0
- package/dist/shortcuts/asset/host.js +7 -6
- package/dist/shortcuts/blog/host.js +4 -3
- package/dist/shortcuts/caizhilian/host.js +3 -2
- package/dist/shortcuts/caizhilian/manifest.js +1 -1
- package/dist/shortcuts/calendar/host.js +2 -1
- package/dist/shortcuts/contract/host.js +34 -59
- package/dist/shortcuts/ehr/host.js +2 -1
- package/dist/shortcuts/esb/host.js +2 -1
- package/dist/shortcuts/fna/host.js +6 -3
- package/dist/shortcuts/fna/manifest.js +10 -5
- package/dist/shortcuts/fna/operations/expense-chart.js +162 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/hrm/host.js +2 -1
- package/dist/shortcuts/im/host.js +3 -2
- package/dist/shortcuts/index.js +2 -0
- package/dist/shortcuts/invoice/host.js +9 -7
- package/dist/shortcuts/invoice/manifest.js +38 -47
- package/dist/shortcuts/invoice/operations/issuing-qys.js +328 -0
- package/dist/shortcuts/invoice/operations/registry.js +2 -3
- package/dist/shortcuts/jiuchuanhui/host.js +2 -1
- package/dist/shortcuts/mail/host.js +2 -1
- package/dist/shortcuts/meeting/host.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/conflict.js +78 -12
- package/dist/shortcuts/okr/host.js +2 -1
- package/dist/shortcuts/plan/host.js +2 -1
- package/dist/shortcuts/project/host.js +2 -1
- package/dist/shortcuts/workflow/endpoints.js +11 -0
- package/dist/shortcuts/workflow/host.js +5 -7
- package/dist/shortcuts/workflow/index.js +6 -36
- package/dist/shortcuts/workflow/operations/chatscene.js +252 -0
- package/dist/shortcuts/workflow/operations/form.js +1047 -191
- package/dist/shortcuts/workflow/operations/read.js +137 -8
- package/dist/shortcuts/workflow/operations/sign-input.js +106 -0
- package/dist/shortcuts/workflow/operations/write.js +9 -1
- package/dist/shortcuts/workflow/stdout-compact.js +16 -1
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +1 -1
- package/docs/agent-invoice.md +1 -1
- package/docs/archive-oa.md +79 -0
- package/docs/caizhilian.md +1 -1
- package/docs/e10-auth.md +7 -6
- package/docs/fna.md +7 -3
- package/docs/invoice.md +4 -6
- package/package.json +1 -1
- package/skill-template/business-info.json +20 -1
- package/skill-template/domains/archive-oa.md +19 -0
- package/skill-template/domains/caizhilian.md +2 -1
- package/skill-template/domains/qiyecheng.md +1 -0
- package/skill-template/domains/yepiaotong.md +8 -4
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +159 -0
- package/skills/weaver-e10-archive-oa/references/archive-locate.md +49 -0
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +76 -0
- package/skills/weaver-e10-archive-oa/references/borrow-flow.md +53 -0
- package/skills/weaver-e10-archive-oa/references/contract-search.md +63 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +29 -0
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +47 -0
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +400 -0
- package/skills/weaver-e10-blog/SKILL.md +6 -1
- package/skills/weaver-e10-blog/references/blog-query.md +3 -1
- package/skills/weaver-e10-builder/SKILL.md +22 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +47 -16
- package/skills/weaver-e10-caizhilian/references/action-flow.md +70 -0
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +12 -4
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +207 -0
- package/skills/weaver-e10-caizhilian/references/collaboration.md +5 -3
- package/skills/weaver-e10-caizhilian/references/document.md +33 -11
- package/skills/weaver-e10-caizhilian/references/file-collection.md +57 -54
- package/skills/weaver-e10-caizhilian/references/file-upload.md +5 -6
- package/skills/weaver-e10-caizhilian/references/files.md +9 -3
- package/skills/weaver-e10-caizhilian/references/folder.md +48 -16
- package/skills/weaver-e10-caizhilian/references/host-executor-prompt.md +32 -0
- package/skills/weaver-e10-caizhilian/references/host-platform-integration.md +46 -0
- package/skills/weaver-e10-caizhilian/references/rule-index.md +56 -0
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +17 -54
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +16 -63
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +24 -64
- package/skills/weaver-e10-caizhilian/references/setting-storage-docs-summary.md +126 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage-field-map.md +57 -0
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +143 -548
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +7 -7
- package/skills/weaver-e10-caizhilian/references/task-workflow.md +87 -0
- package/skills/weaver-e10-caizhilian/references/withheld.md +21 -45
- package/skills/weaver-e10-caizhilian/references/write-protocol.md +7 -0
- package/skills/weaver-e10-calendar/SKILL.md +6 -1
- package/skills/weaver-e10-esb/SKILL.md +8 -0
- package/skills/weaver-e10-esb/references/input-format.md +3 -1
- package/skills/weaver-e10-esb/references/source-manifest.json +5 -5
- package/skills/weaver-e10-hrm/SKILL.md +6 -1
- package/skills/weaver-e10-hrm/references/employee.md +1 -1
- package/skills/weaver-e10-hrm/references/org.md +1 -1
- package/skills/weaver-e10-hrm/references/position.md +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +2 -1
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -1
- package/skills/weaver-e10-jucailin/SKILL.md +6 -1
- package/skills/weaver-e10-jucailin/references/hr-contact.md +1 -1
- package/skills/weaver-e10-jucailin/references/salary.md +1 -1
- package/skills/weaver-e10-mail/SKILL.md +6 -1
- package/skills/weaver-e10-meeting/SKILL.md +11 -6
- package/skills/weaver-e10-meeting/references/meeting-eb.md +7 -3
- package/skills/weaver-e10-meeting/references/meeting-queries.md +3 -1
- package/skills/weaver-e10-meeting/references/meeting-verification.md +4 -2
- package/skills/weaver-e10-okr/SKILL.md +6 -1
- package/skills/weaver-e10-okr/references/source-manifest.json +5 -5
- package/skills/weaver-e10-plan/SKILL.md +6 -1
- package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +3 -1
- package/skills/weaver-e10-plan/references/plan-report-query.md +3 -1
- package/skills/weaver-e10-plan/references/source-manifest.json +7 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +16 -6
- package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -3
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +2 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +78 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +87 -33
- package/skills/weaver-e10-shared/SKILL.md +53 -28
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +22 -20
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +13 -13
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +3 -1
- package/skills/weaver-e10-wenshuding/SKILL.md +6 -1
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +33 -24
- package/skills/weaver-e10-workflow/references/workflow-create.md +41 -26
- package/skills/weaver-e10-yepiaotong/SKILL.md +23 -18
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +87 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +152 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +210 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +59 -36
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +63 -512
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +205 -346
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -5
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +231 -344
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +201 -162
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +121 -145
- package/skills/weaver-e10-yimiaoban/SKILL.md +9 -2
- package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/skills/weaver-e10-ziguanjia/SKILL.md +6 -1
- package/dist/shortcuts/invoice/operations/issuing.js +0 -198
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +0 -161
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +0 -107
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +0 -119
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: weaver-file-collection
|
|
3
3
|
description: "泛微E10采知连文件服务 FTP/SFTP 文件采集技能。用于选择仅采集文件或采集到档案、按需选择全宗、查询或创建 FTP/SFTP 资源、检索并校验已有动作流、动态新建动作流、创建或维护采集任务,以及校验、扫描、运行和查看文件级结果。"
|
|
4
4
|
license: Proprietary
|
|
5
|
-
compatibility: 泛微E10
|
|
5
|
+
compatibility: 泛微E10采知连配套使用,随 weaver-e10-caizhilian 技能分发
|
|
6
6
|
metadata:
|
|
7
7
|
maintainer: unknown
|
|
8
8
|
type: capability
|
|
@@ -13,78 +13,63 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
# 文件采集 FTP/SFTP
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
本模块通过 CLI 管理文件采集生命周期。正式 API 请求、动作流设计物化和任务 Payload 均由 CLI 生成,不手写正式结构。
|
|
17
17
|
|
|
18
18
|
## 前置依赖
|
|
19
19
|
|
|
20
20
|
### 认证前置(必须)
|
|
21
21
|
|
|
22
|
-
本模块通过 CLI 托管的认证获取凭证(base_url + Cookie + eteamsid + User-Agent
|
|
22
|
+
本模块通过 CLI 托管的认证获取凭证(base_url + Cookie + eteamsid + User-Agent),凭证契约见 `auth-and-install.md`,不依赖手动配置文件,Agent 不得自己读取或输出凭证。
|
|
23
23
|
|
|
24
24
|
**使用前必须确保**:
|
|
25
25
|
1. CLI 已安装:`weaver-work-cli --version` 能正常输出版本号
|
|
26
26
|
2. 已完成登录:`weaver-work-cli auth status` 显示已登录
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
```text
|
|
30
|
-
# OAuth2.0 浏览器授权(推荐)
|
|
31
|
-
weaver-work-cli auth login
|
|
32
|
-
|
|
33
|
-
# 或手动写入 ETEAMSID(从浏览器 DevTools 复制)
|
|
34
|
-
weaver-work-cli auth set --eteamsid "PCACCOUNT_xxx"
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**凭证过期处理**:操作返回认证错误时,提示用户通过 `weaver-work-cli auth login` 或 `weaver-work-cli auth set` 重新登录。
|
|
28
|
+
**登录与登录失效处理**:读取 `auth-and-install.md`,由 Agent 复用任务开始时的宿主判定,禁止调用任何其他登录 Skill。明确为 XiaoE 时只执行 `weaver-work-cli auth xiaoe`,失败即停止且不得改走浏览器;非 XiaoE 时先取得用户确认的真实 E10 域名,再执行 `weaver-work-cli auth login --base-url "<用户确认的 E10 登录域名>" --agent_type "<当前智能体名称>"`。
|
|
38
29
|
|
|
39
30
|
## First Move
|
|
40
31
|
|
|
41
32
|
1. 读取 `rule-index.md`。
|
|
42
|
-
2. 确认 CLI
|
|
43
|
-
3.
|
|
44
|
-
4.
|
|
45
|
-
5.
|
|
46
|
-
6.
|
|
33
|
+
2. 确认 CLI 已安装并已完成登录(`weaver-work-cli --version`、`weaver-work-cli auth status` 显示已登录)。
|
|
34
|
+
3. 任务分支、执行与结果判读读取 `task-workflow.md`。
|
|
35
|
+
4. 动作流检测、兼容校验与动态创建读取 `action-flow.md`。
|
|
36
|
+
5. 只有用户选择采集到档案时,才按 `task-workflow.md`「采集目标」的全宗确认流程执行。
|
|
37
|
+
6. 由宿主/Agent 代为执行时,另读 `host-executor-prompt.md` 和 `host-platform-integration.md`。
|
|
47
38
|
|
|
48
39
|
## Hard Rules
|
|
49
40
|
|
|
50
41
|
- 认证凭证统一由 CLI 托管(`weaver-work-cli auth ...`);不得写死域名或输出 Cookie。
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- `search
|
|
55
|
-
- `create
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- 初始化后的命令携带同一 `chatId`;阶段会原子保存,重复初始化恢复进度,只有显式 `--restart` 才重新开始。
|
|
59
|
-
- `save-task` 和 `update-task-workflow` 只接受 `inspect-action-flow` 或 `create-action-flow` 生成的 `file_collection_workflow_selection.v1` 文件。归档凭据还必须绑定归档兼容检测,并携带已确认全宗。
|
|
42
|
+
- 仅采集文件的分支不询问、不写入全宗;仅采集到档案的分支必须先取得用户确认的全宗,再用 `task.update-fonds` 绑定。
|
|
43
|
+
- 新建任务前先确定 FTP/SFTP 资源(已有或新建),再确定动作流(已有或新建)。
|
|
44
|
+
- 新建任务时先确定是否维持原目录结构(`retain_dir_struct`);该值必须与动作流检测/创建、保存任务保持一致。维持模式使用带动态目录输入的动作流,非维持模式使用固定目录动作流,二者不得混用。
|
|
45
|
+
- `workflow.search` 的候选仅供展示。用户确认 ID 后必须执行 `workflow.inspect` 通过兼容检测,才能把该动作流用于保存任务。
|
|
46
|
+
- 新建动作流使用 `workflow.create` 动态创建标准链路(自定义触发 → 文档保存 → 输出);禁止上传、迁入或导入固定动作流包,不手写触发字段或设计文件。
|
|
47
|
+
- 新建 FTP/SFTP 资源在未指定已有连接器(`system_pk`)时由 CLI 自动创建 FTP 连接器并返回资源 ID;不得通过失败重试摸参数。
|
|
48
|
+
- 所有写操作走 prepare → 用户确认 → apply(见 `write-protocol.md`);apply 入参与 prepare 完全一致。
|
|
60
49
|
- 默认任务名按 UTC+8 生成 `文件采集(yyyyMMdd HHmmss)`。
|
|
61
|
-
- `
|
|
62
|
-
- `run` 只证明启动。只有 `
|
|
63
|
-
- 用户可见输出不展示长 ID、完整 Cookie、明文 FTP
|
|
50
|
+
- 扫描默认增量;只有用户明确要求全量时才传 `full_coll=true`。
|
|
51
|
+
- `run` 只证明启动。只有 `run.result` 结果为 `collection_succeeded`、`file_collection_ok=true` 且失败数为 0,才能报告采集成功。
|
|
52
|
+
- 用户可见输出不展示长 ID、完整 Cookie、明文 FTP 密码、动作流密钥或大段请求体。
|
|
64
53
|
|
|
65
54
|
## Workflow
|
|
66
55
|
|
|
67
|
-
1. 确认 CLI
|
|
68
|
-
2.
|
|
69
|
-
3.
|
|
70
|
-
4.
|
|
71
|
-
5.
|
|
72
|
-
6.
|
|
73
|
-
7. 依次执行 `check-storage`、`scan --wait`、`run`;需要等待文件级结果时使用 `run --wait` 或 `run-progress`。
|
|
56
|
+
1. 确认 CLI 已安装并已登录,然后明确采集目标:仅采集文件,还是采集到档案(归档分支按 `task-workflow.md` 完成全宗确认)。
|
|
57
|
+
2. 选择已有任务(`task.list` / `task.form`)或新建任务。已有任务仅归档分支可更新全宗(`task.update-fonds`)。
|
|
58
|
+
3. 新建任务时先选资源:`connector.query` 挑已有资源,或 `resource.create` 新建 FTP/SFTP 资源(缺连接器时 CLI 内部自动创建,返回 `source_id`)。
|
|
59
|
+
4. 确定 `retain_dir_struct` 后选动作流:`workflow.search` → 用户确认 → `workflow.inspect`(与任务同一目录模式,归档加 `archive_required=true`);或直接 `workflow.create` 动态新建。
|
|
60
|
+
5. 用 `task.save` 保存任务(`source_id` + `workflow_id` + 同一 `retain_dir_struct`);归档分支保存后再绑定确认过的全宗。
|
|
61
|
+
6. 依次执行 `storage.check`、`scan`(默认增量,必要时 `scan.wait`)、`run`;结果用 `run.result` 判读,明细用 `detail` 查看。
|
|
74
62
|
|
|
75
63
|
## References
|
|
76
64
|
|
|
77
65
|
| Need | Read |
|
|
78
66
|
| --- | --- |
|
|
79
67
|
| 规则与 owner | `rule-index.md` |
|
|
80
|
-
| 认证 | `auth-and-
|
|
81
|
-
|
|
|
68
|
+
| 认证 | `auth-and-install.md` 与本文「认证前置」 |
|
|
69
|
+
| 主流程与结果判读 | `task-workflow.md` |
|
|
82
70
|
| 动作流合同 | `action-flow.md` |
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
| API 端点 | `api-endpoints.md` |
|
|
86
|
-
| Payload | `api-payloads.md` |
|
|
87
|
-
| 宿主提示词 | `host-executor-prompt.md` |
|
|
71
|
+
| 写操作确认协议 | `write-protocol.md` |
|
|
72
|
+
| 宿主执行提示词 | `host-executor-prompt.md` |
|
|
88
73
|
| 宿主集成 | `host-platform-integration.md` |
|
|
89
74
|
|
|
90
75
|
# API Endpoints
|
|
@@ -133,7 +118,7 @@ Search results are not association credentials. Inspect or create must complete
|
|
|
133
118
|
| Cancel | POST | `/api/file/coll/cancel` | cancelled task |
|
|
134
119
|
| Delete | POST | `/api/file/coll/delete` | boolean result |
|
|
135
120
|
|
|
136
|
-
`scan`
|
|
121
|
+
`scan` 默认增量并传 `fullColl=false`;入参 `full_coll=true` 才是全量(须用户明确要求)。`finish=true` 不是文件级成功。成功/失败明细由 `run.result` 统一读取并归一化为 `file_collection_result.v1`。
|
|
137
122
|
|
|
138
123
|
## CLI 操作
|
|
139
124
|
|
|
@@ -162,12 +147,30 @@ weaver-work-cli --json caizhilian run caizhilian.file-collection.task.save.prepa
|
|
|
162
147
|
|
|
163
148
|
### 其他操作
|
|
164
149
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
150
|
+
写操作均分 `.prepare` / `.apply` 两步(见 `write-protocol.md`)。
|
|
151
|
+
|
|
152
|
+
| 分组 | 操作 | CLI 命令(`caizhilian run` 后接) |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| 任务 | 列出任务 | `caizhilian.file-collection.task.list` |
|
|
155
|
+
| 任务 | 查看任务详情 | `caizhilian.file-collection.task.form` |
|
|
156
|
+
| 任务 | 另存为副本 | `caizhilian.file-collection.task.save-as.prepare/apply` |
|
|
157
|
+
| 任务 | 启用/禁用任务 | `caizhilian.file-collection.task.switch.prepare/apply` |
|
|
158
|
+
| 任务 | 更新任务全宗(归档分支) | `caizhilian.file-collection.task.update-fonds.prepare/apply` |
|
|
159
|
+
| 资源 | 查询连接器与资源 | `caizhilian.file-collection.connector.query` |
|
|
160
|
+
| 资源 | 创建 FTP 连接器 | `caizhilian.file-collection.connector.create.prepare/apply` |
|
|
161
|
+
| 资源 | 创建 FTP/SFTP 资源 | `caizhilian.file-collection.resource.create.prepare/apply` |
|
|
162
|
+
| 动作流 | 搜索动作流 | `caizhilian.file-collection.workflow.search` |
|
|
163
|
+
| 动作流 | 兼容性检测 | `caizhilian.file-collection.workflow.inspect` |
|
|
164
|
+
| 动作流 | 动态创建动作流 | `caizhilian.file-collection.workflow.create.prepare/apply` |
|
|
165
|
+
| 动作流 | 启用动作流 | `caizhilian.file-collection.workflow.enable.prepare/apply` |
|
|
166
|
+
| 动作流 | 更换任务动作流 | `caizhilian.file-collection.workflow.update-task.prepare/apply` |
|
|
167
|
+
| 执行 | 检查存储连接 | `caizhilian.file-collection.storage.check` |
|
|
168
|
+
| 执行 | 扫描任务 | `caizhilian.file-collection.scan.prepare/apply` |
|
|
169
|
+
| 执行 | 等待扫描完成 | `caizhilian.file-collection.scan.wait` |
|
|
170
|
+
| 执行 | 查询扫描进度 | `caizhilian.file-collection.scan.progress` |
|
|
171
|
+
| 执行 | 运行/暂停任务 | `caizhilian.file-collection.run.prepare/apply` |
|
|
172
|
+
| 执行 | 查询运行进度 | `caizhilian.file-collection.run.progress` |
|
|
173
|
+
| 执行 | 查询采集结果(归一化) | `caizhilian.file-collection.run.result` |
|
|
174
|
+
| 执行 | 查询采集明细 | `caizhilian.file-collection.detail` |
|
|
175
|
+
| 执行 | 取消任务 | `caizhilian.file-collection.cancel.prepare/apply` |
|
|
176
|
+
| 执行 | 删除任务 | `caizhilian.file-collection.delete.prepare/apply` |
|
|
@@ -6,19 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
## 运行与认证
|
|
8
8
|
|
|
9
|
-
- 唯一运行时为 `weaver-work-cli
|
|
10
|
-
|
|
11
|
-
- 安装与登录遵守 `../../weaver-e10-shared/SKILL.md`。认证只使用 CLI 当前身份或连接器注入的身份。
|
|
9
|
+
- 唯一运行时为 `weaver-work-cli`,全部操作由 CLI 提供。
|
|
10
|
+
- 安装与登录遵守 `auth-and-install.md` 的接入规则。认证只使用 CLI 当前身份或连接器注入的身份。
|
|
12
11
|
- 本模块不执行独立 Skill 的 `dist/weaver-file-upload.js`,不复用 `e10-login` 的会话,
|
|
13
12
|
不启动第二套 Chrome 登录;独立 Skill 的双登录模式不属于本 CLI 上传接口。
|
|
14
|
-
-
|
|
13
|
+
- 缺少会话或登录失效时按 `auth-and-install.md` 处理,不自行切换账号或环境。
|
|
15
14
|
|
|
16
15
|
## 操作与参数
|
|
17
16
|
|
|
18
17
|
| 操作 | 作用 | 必填 |
|
|
19
18
|
| --- | --- | --- |
|
|
20
19
|
| `caizhilian.file-upload.contract` | 获取完整命令、参数用途、策略和结果证据 | 无 |
|
|
21
|
-
| `caizhilian.file-upload.prepare` | 本地文件/上下文检查与 MD5、SHA256
|
|
20
|
+
| `caizhilian.file-upload.prepare` | 本地文件/上下文检查与 MD5、SHA256;仅本地校验、不发起业务请求、不签发上传票据 | `file_path`、`module` |
|
|
22
21
|
| `caizhilian.file-upload.upload.prepare` | 用户授权检查、本地校验、绑定当前环境和身份的确认票据 | `file_path`、`module`、`user_confirmed=true` |
|
|
23
22
|
| `caizhilian.file-upload.upload.apply` | 校验确认票据和内容未变,再执行上传 | 上述参数、`continuation`、`confirm=true`(CLI 用 `--yes`) |
|
|
24
23
|
|
|
@@ -87,7 +86,7 @@ POSIX 文件权限为 `0600`、回执目录为 `0700`。回执只保存归一化
|
|
|
87
86
|
## 命令示例
|
|
88
87
|
|
|
89
88
|
先读取 contract。下面的 `document` 只示意真实文档业务;使用时必须来自当前调用方场景。
|
|
90
|
-
只有用户已经明确确认后,才传 `user_confirmed=true
|
|
89
|
+
只有用户已经明确确认后,才传 `user_confirmed=true`,并遵守 `auth-and-install.md` 的连接器参数要求。
|
|
91
90
|
|
|
92
91
|
Windows PowerShell:
|
|
93
92
|
|
|
@@ -96,12 +96,18 @@ weaver-work-cli --json caizhilian run caizhilian.compare.submit.prepare --input-
|
|
|
96
96
|
|
|
97
97
|
## 输出处理
|
|
98
98
|
|
|
99
|
-
- **prepare 返回**:`data` 含本地文件预览 `{ file_name, file_size, file_md5, ext_name }` + `upload` 预览块(`path`、`extra_body`、`allowed_ext`、`required_permission`、`deferred_to_apply: true`),外加 `continuation
|
|
100
|
-
|
|
99
|
+
- **prepare 返回**:`data` 含本地文件预览 `{ file_name, file_size, file_md5, ext_name }` + `upload` 预览块(`path`、`extra_body`、`allowed_ext`、`required_permission`、`deferred_to_apply: true`),外加 `continuation`、
|
|
100
|
+
`expires_in_ms`、`hint`,
|
|
101
|
+
`meta.status = "PREPARED"`。
|
|
102
|
+
向用户摘要时必须写清「哪个文件、多大、传到哪篇文档/做什么」。
|
|
103
|
+
- **上传类 apply 返回**:`{ file_id, name, size, ext_name, ... }`(`attachment.upload` 额外把源的 `uploadTime` 改名为 `upload_time` 放在最后;`attachment.replace` 与 `document.replace-content` 额外带 `version`(新版本号))。
|
|
104
|
+
命中服务端 MD5 秒传时不会真正传文件,
|
|
105
|
+
但返回结构一致。
|
|
101
106
|
- **下载类返回**:`{ file_path, file_name, file_size }`,`meta` 带 `{ doc_id, attachment_id }`。回复用户时给出**绝对路径 + 文件大小**,并提示已存在同名文件时被自动改名。
|
|
102
107
|
- `cover.upload.apply` 返回 `{ file_id, name, size, ext_name }`;`cover.set.apply` 返回 `{ doc_id, file_id, name }`;`cover.remove.apply` 返回 `{ doc_id, cover_picture_id }`(`cover_picture_id` 为删除后的空串)。
|
|
103
108
|
- `compare.list-file-objects` 返回 `{ attachments: [{ docId, file_id, ext_name, file_name, size, updateTime }] }`,其中 `file_id` 就是 `compare.submit` 需要的 ID;用 Markdown 表格摘要「文件名/类型/大小/更新时间」。
|
|
104
|
-
- `attachment.list-versions` 返回 `{ versions: [{ id, name, versionNumber, updateTime, describe, extName }], has_next }`;`updateTime` 已转为东八区时间字符串。用 Markdown 表格摘要「版本号/文件名/更新时间/版本说明」,`id`
|
|
109
|
+
- `attachment.list-versions` 返回 `{ versions: [{ id, name, versionNumber, updateTime, describe, extName }], has_next }`;`updateTime` 已转为东八区时间字符串。用 Markdown 表格摘要「版本号/文件名/更新时间/版本说明」,`id` 作为后续操作入参,
|
|
110
|
+
不作为展示主体。
|
|
105
111
|
- `compare.search-documents` 与 `document.search` 同构(`{ page_no, page_size, has_next, documents[] }`),参见 `document.md`。
|
|
106
112
|
- `compare.submit.apply` 返回 `{ compare_link }`,把链接原样交给用户,不要尝试抓取链接内容。
|
|
107
113
|
|
|
@@ -28,13 +28,21 @@
|
|
|
28
28
|
|
|
29
29
|
枚举取值(**拼写 1:1 沿用源接口,注意 `Premisstion` 是源的拼写,不要自行改成 `Permission`**):
|
|
30
30
|
|
|
31
|
-
- `permission_type`(8 项):`copyPermission`、`deletePremisstion`、`downloadPremisstion`、`folderDefaultParticipants`、`movePermission`、`newCreateDocPremisstion`、`newCreateFolderPremisstion
|
|
31
|
+
- `permission_type`(8 项):`copyPermission`、`deletePremisstion`、`downloadPremisstion`、`folderDefaultParticipants`、`movePermission`、`newCreateDocPremisstion`、`newCreateFolderPremisstion`、
|
|
32
|
+
`settingPermission`
|
|
32
33
|
- `setting_type`(9 项):上面 8 项 + `defaultShares`
|
|
33
|
-
- `permission_key`(9 项):上面 8 项,但把 `folderDefaultParticipants` 之外再加 `folderDefaultShareNew`(即 `copyPermission`、`deletePremisstion`、`downloadPremisstion`、`folderDefaultParticipants
|
|
34
|
+
- `permission_key`(9 项):上面 8 项,但把 `folderDefaultParticipants` 之外再加 `folderDefaultShareNew`(即 `copyPermission`、`deletePremisstion`、`downloadPremisstion`、`folderDefaultParticipants`、
|
|
35
|
+
`folderDefaultShareNew`、`movePermission`、`newCreateDocPremisstion`、`newCreateFolderPremisstion`、
|
|
36
|
+
`settingPermission`)
|
|
34
37
|
|
|
35
|
-
`query-by-permission` 的 `permissions` 是对象数组,元素形如 `{"object_type":"all"}` 或 `{"object_type":"resource","object_ids":["123"]}`;`object_type` 必填,`object_ids`
|
|
38
|
+
`query-by-permission` 的 `permissions` 是对象数组,元素形如 `{"object_type":"all"}` 或 `{"object_type":"resource","object_ids":["123"]}`;`object_type` 必填,`object_ids` 必须是正整数字符串。
|
|
39
|
+
`page_no` / `page_size` 传 `<=0` 会报 `validation/number_invalid`(源脚本是静默归一,
|
|
40
|
+
这里选择显式报错)。
|
|
36
41
|
|
|
37
|
-
`object_ids` 必须是**对象的真实 ID**:人员/部门/分部/角色/岗位/客户一律用 `caizhilian.org.search-*` 查出来的 `id`(每个对象都要是字符串,且不要用 JSON
|
|
42
|
+
`object_ids` 必须是**对象的真实 ID**:人员/部门/分部/角色/岗位/客户一律用 `caizhilian.org.search-*` 查出来的 `id`(每个对象都要是字符串,且不要用 JSON 数字传)。
|
|
43
|
+
**不要用 `default-share.list` / `get-settings` / `permission.list` 返回条目里的 `id`**——那是共享/权限条目的 ID,不是对象 ID,
|
|
44
|
+
拿它反查只会得到空结果。
|
|
45
|
+
不带 ID 的对象类型(`all`、`allExternal`、`createrSelf` 等)不传 `object_ids`。
|
|
38
46
|
|
|
39
47
|
### 写操作
|
|
40
48
|
|
|
@@ -57,7 +65,8 @@
|
|
|
57
65
|
| `caizhilian.folder.permission.sync-default-share` | `id`(文件夹 ID)、`sync_to_folder_docs`、`sync_to_all_folders`、`sync_to_all_sub_folder_docs`(至少选一个) | `keep_old_default_share_for_folder_docs`、`keep_old_non_default_share_for_folder_docs`、`keep_old_default_share_for_all_folders`、`keep_old_default_share_for_sub_folder_docs`、`keep_old_non_default_share_for_sub_folder_docs`(默认 true) |
|
|
58
66
|
|
|
59
67
|
- `folder.create` 的 `parent_type=privy`(个人)时,`sequence` 强制为 `0`、`inherit_parent` 强制为 `false`(源行为)。
|
|
60
|
-
- `obj_type` 与 `share_level` 不要猜:先用 `default-share.form` / `permission.form` 拿到 `obj_types[].id` 和级联参数,再决定要传哪些 `obj_id*`
|
|
68
|
+
- `obj_type` 与 `share_level` 不要猜:先用 `default-share.form` / `permission.form` 拿到 `obj_types[].id` 和级联参数,再决定要传哪些 `obj_id*` 字段;
|
|
69
|
+
传了 `obj_type` 未配置的对象字段会报 `validation/obj_type_not_configured` 或 `obj_type_not_supported`。
|
|
61
70
|
- `download` 在 `share_level != 1` 且未传时默认按 `["download"]` 处理(源行为)。
|
|
62
71
|
- `set-auth` 的 `value=user` 表示「按人员白名单」,此时白名单条目由 `permission.list` / `permission.add` 维护;`permission_auth_not_user` 表示当前权限类型不是 `user` 模式,需要先 `set-auth`。
|
|
63
72
|
|
|
@@ -107,16 +116,29 @@ weaver-work-cli --json caizhilian run caizhilian.folder.permission.sync-default-
|
|
|
107
116
|
|
|
108
117
|
- `query-by-name` 返回**展平后的路径列表**(源模板 `FlattenSearchResultFolderTree`),每项含文件夹 ID、名称与完整路径;同名文件夹可能出现在多个路径下,必须让用户确认选哪一个,不要默认取第一条。
|
|
109
118
|
- `search-virtual` 返回 `{ page_no, page_size, has_next, folders[] }`,每项含 `id`、`name`、`path`、`parent_folder_id`(源 `content` 形如 `名称[路径]`,CLI 已拆开)。
|
|
110
|
-
- `get-settings` 返回 `{ defaultVirtualFolder, folderDefaultParticipants, currentFolder, folderDefaultShareNew }`(`currentFolder` 含 `id`/`name`/`title`;参与人每项含 `id`/`content`/`_entityType
|
|
119
|
+
- `get-settings` 返回 `{ defaultVirtualFolder, folderDefaultParticipants, currentFolder, folderDefaultShareNew }`(`currentFolder` 含 `id`/`name`/`title`;参与人每项含 `id`/`content`/`_entityType`,
|
|
120
|
+
共享对象另含 `canDelete`),
|
|
121
|
+
创建文档时的兜底来源。
|
|
111
122
|
- `folder.create.apply` 返回 `{ folder_id, name, type, parent_id }`,新文件夹 ID 可直接用于后续创建文档。
|
|
112
123
|
- 文件夹侧共享/权限条目统一归一为 `{ id, object_type, object_name, share_level, sec_level }`(`sec_level` 空值显示为 `--`);文档级共享条目(`share.*`)另含 `download`、`can_delete`。
|
|
113
|
-
- `list-default-shares` → `{ defaultShares[] }`;`default-share.list` → `{ default_shares[] }`;`permission.list` → `{ add_visible, shares[] }`(`add_visible=false` 时不要再引导用户添加)。删除前必须从列表里取真实条目 `ids
|
|
124
|
+
- `list-default-shares` → `{ defaultShares[] }`;`default-share.list` → `{ default_shares[] }`;`permission.list` → `{ add_visible, shares[] }`(`add_visible=false` 时不要再引导用户添加)。删除前必须从列表里取真实条目 `ids`,
|
|
125
|
+
不要自己拼。
|
|
114
126
|
- `default-share.form` → `{ category, obj_types[], param_options }`;`permission.form` → `{ obj_types[], param_options }`。`obj_types[].id` 就是 `obj_type` 的合法取值,`param_options` 给出级联参数。
|
|
115
127
|
- `permission.get-auth` 返回 `{ permission_type, current_value }`(`true` / `user` / `false`)。
|
|
116
128
|
- `permission.detail` 返回 `{ title, current_setting, list_label, items[] }`;`setting_type=defaultShares` 时只返回 `{ title, items[] }`。
|
|
117
|
-
- `permission.query` 返回 `{ permissions }`:以 `folder_id` 为 key 的映射,每个 value 含 `isCreateDoc`、`isCreateFolder`、`canMoveDoc`、`canCopyDoc` 四个布尔标志与 `allowDocumentCreateTypes
|
|
118
|
-
|
|
119
|
-
-
|
|
129
|
+
- `permission.query` 返回 `{ permissions }`:以 `folder_id` 为 key 的映射,每个 value 含 `isCreateDoc`、`isCreateFolder`、`canMoveDoc`、`canCopyDoc` 四个布尔标志与 `allowDocumentCreateTypes`(允许创建的文档类型列表,无设置时为空数组)。
|
|
130
|
+
建文档前可用它确认目标文件夹是否允许创建及允许的文档类型。
|
|
131
|
+
- `query-by-permission` 返回 `{ total, page_no, page_size, has_next, folders[] }`,每项含 `folder_id`、`folder_name`、`folder_type`。返回空数组只表示「没有匹配到」:先按上文核对 `object_ids` 是不是对象的真实 ID,再如实把结果告诉用户;
|
|
132
|
+
**不要据此断定「反查不支持该权限类型」**。
|
|
133
|
+
返回里没有文件夹路径,需要展示路径时用 `get-settings` 的 `currentFolder.title` 或 `query-by-name` 补。
|
|
134
|
+
- 写操作 `apply` 返回结果回显:`default-share.add` → `{ added: true, default_shares }` 或 `{ added: false, message }`(服务端判定「已存在」不是失败,必须把 message 转述给用户);
|
|
135
|
+
`default-share.delete` → `{ deleted: true, default_shares }`;
|
|
136
|
+
`permission.add` → `{ added: true, shares }`;`permission.delete` → `{ deleted: true, shares }`;`permission.set-auth` → `{ permission_type, value, current_value }`;
|
|
137
|
+
`permission.sync-setting` → `{ existChildFolder }`;
|
|
138
|
+
`permission.sync-maintain` → `{ existChildFolder }`;`permission.sync-download` → `{ existChildFolder }`;`permission.sync-delete` → `{ existChildFolder }`;
|
|
139
|
+
`permission.sync-copy` → `{ existChildFolder }`;
|
|
140
|
+
`permission.sync-create` → `{ existChildFolder }`;`permission.sync-move` → `{ existChildFolder }`;`permission.sync-participant` → `{ existChildFolder, existChildDocument, asyncKey }`;
|
|
141
|
+
`permission.sync-default-share` → `{ existChildFolder, existChildDocument, asyncKey }`。
|
|
120
142
|
- 权限/共享类写操作的 `prepare` 返回请求体预览 + `continuation`;向用户摘要时必须写清「哪个文件夹、哪项权限、给谁、什么级别」,并说明删除类操作不可撤销。
|
|
121
143
|
- 列表类结果默认用 Markdown 表格摘要(文件夹名/路径/权限类型/对象/级别),不要原样贴 JSON。
|
|
122
144
|
|
|
@@ -125,11 +147,21 @@ weaver-work-cli --json caizhilian run caizhilian.folder.permission.sync-default-
|
|
|
125
147
|
- 文件夹权限与默认共享是**影响面很大的配置**:改错会导致整个知识库的下载、复制、新建权限对全员开放或全部收紧。`permission.set-auth` 从 `user` 改成 `true` 等于放开给所有人,确认摘要里必须显式写出这一后果。
|
|
126
148
|
- `folder.create` 会在服务端产生新节点;`inherit_parent=true` 会连带继承父文件夹的权限与默认设置,必须在确认摘要里说明。
|
|
127
149
|
- 删除类(`default-share.delete` / `permission.delete`)必须先做一次对应 `list` 只读查询,把待删条目的可读信息展示给用户后再 prepare。
|
|
128
|
-
- `permission.sync-setting`、`permission.sync-maintain`、`permission.sync-copy`、`permission.sync-create`、`permission.sync-move` 的 `keepOldSettingForAllFolders`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- `permission.sync-
|
|
150
|
+
- `permission.sync-setting`、`permission.sync-maintain`、`permission.sync-copy`、`permission.sync-create`、`permission.sync-move` 的 `keepOldSettingForAllFolders` 是**必填参数**,
|
|
151
|
+
必须明确传入 `true`(保留原有设置)或 `false`(不保留),
|
|
152
|
+
否则会报错。
|
|
153
|
+
执行前必须提醒用户此操作对系统性能可能有一定影响。
|
|
154
|
+
- `permission.sync-participant` 是**异步操作**,支持三种同步范围:同步到当前文件夹内的历史文档(`sync_to_folder_docs`)、同步到所有下级文件夹(`sync_to_all_folders`)、同步到所有下级文件夹内的历史文档(`sync_to_all_sub_folder_docs`),**至少选择一个**。
|
|
155
|
+
每个选中的范围对应的"原有参与人"参数(`keep_old_for_folder_docs`、`keep_old_for_all_folders`、
|
|
156
|
+
`keep_old_for_all_sub_folder_docs`)默认为 `true`(保留)。
|
|
157
|
+
执行后会自动轮询进度,超时时间为 300 秒。
|
|
158
|
+
- `permission.sync-default-share` 是**异步操作**,支持三种同步范围:同步到当前文件夹内的历史文档(`sync_to_folder_docs`)、同步到所有下级文件夹(`sync_to_all_folders`)、同步到所有下级文件夹内的历史文档(`sync_to_all_sub_folder_docs`),**至少选择一个**。
|
|
159
|
+
每个选中的范围对应的"原有默认共享人"和"原有非默认共享人"参数默认为 `true`(保留)。
|
|
160
|
+
执行后会自动轮询进度,超时时间为 300 秒。
|
|
161
|
+
- `permission.sync-download` 的行为取决于当前下载权限设置:当下载权限为"允许所有人下载"或"不允许下载"时,直接同步到所有下级文件夹,不需要 `keepOldSettingForAllFolders` 参数;当下载权限为"允许以下人员下载"时,`keepOldSettingForAllFolders` 是**必填参数**,
|
|
162
|
+
必须明确传入 `true`(保留原有下载权限设置)或 `false`(不保留)。
|
|
163
|
+
- `permission.sync-delete` 的行为取决于当前删除权限设置:当删除权限为"允许完全控制权限人员删除文档"时,直接同步到所有下级文件夹,不需要 `keepOldSettingForAllFolders` 参数;当删除权限为"允许以下人员删除文档"时,`keepOldSettingForAllFolders` 是**必填参数**,
|
|
164
|
+
必须明确传入 `true`(保留原有删除权限设置)或 `false`(不保留)。
|
|
133
165
|
- 本 reference 只覆盖文件夹与权限;文档级共享/参与人/标签见 `collaboration.md`。
|
|
134
166
|
|
|
135
167
|
## 失败处理
|
|
@@ -147,4 +179,4 @@ weaver-work-cli --json caizhilian run caizhilian.folder.permission.sync-default-
|
|
|
147
179
|
| `id_invalid` | `folder_id` / `object_ids` 等不是正整数 | 重新查真实 ID;反查的对象 ID 要来自 `org.search-*`,不是共享条目 ID |
|
|
148
180
|
| `range_invalid` / `number_invalid` | `sequence`、`seclevel_min/max`、分页越界 | 按范围修正 |
|
|
149
181
|
| `api/business_error` | 服务端业务失败(含权限不足) | 原样转述 message,不要重复提交 |
|
|
150
|
-
| `partial/write_uncertain` | 写结果不确定 | 立即停止,最多补一次 `permission.list` / `default-share.list` 只读回查,禁止自动重放 |
|
|
182
|
+
| `partial/write_uncertain` | 写结果不确定 | 立即停止,最多补一次 `permission.list` / `default-share.list` 只读回查,禁止自动重放 |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# 文件采集执行提示词(宿主注入用)
|
|
2
|
+
|
|
3
|
+
你是「FTP/SFTP 文件采集」的纯执行器。只按命令结果推进:不手写请求体、不猜参数、不跳步,不把准备态报告为完成。
|
|
4
|
+
|
|
5
|
+
## 开始前
|
|
6
|
+
|
|
7
|
+
1. 读取 `SKILL.md` 路由与 `file-collection.md`,按需读 `rule-index.md`、`task-workflow.md`、`action-flow.md`;宿主调度细节见 `host-platform-integration.md`。
|
|
8
|
+
2. 确认 CLI 已安装且已登录(`weaver-work-cli --version`、`weaver-work-cli auth status`);未登录时按 `auth-and-install.md` 先登录,不要自行拼请求头。
|
|
9
|
+
3. 写操作必须按 `write-protocol.md` 的 prepare → 用户确认 → apply 执行。
|
|
10
|
+
|
|
11
|
+
## 调用规范
|
|
12
|
+
|
|
13
|
+
- 统一形式:`weaver-work-cli --json caizhilian run caizhilian.file-collection.<操作> --input-json '<json>'`;全局参数放在子命令之前。
|
|
14
|
+
- 简单 JSON 用 `--input-json`;复杂或多行 JSON 先写 UTF-8 文件再用 `--input <path>`。
|
|
15
|
+
- 不写内联脚本包装调用;不靠反复 `--help` 试错猜参数——字段以 references 文档和 `weaver-work-cli caizhilian schema` 为准。
|
|
16
|
+
- 只使用 `weaver-work-cli caizhilian operations` 列出的操作;未列出的能力一律视为不存在。
|
|
17
|
+
|
|
18
|
+
## 执行纪律
|
|
19
|
+
|
|
20
|
+
1. **只读先行**:ID 一律来自真实查询(`task.list` / `connector.query` / `workflow.search` / `workflow.inspect` / `workflow.create` 等),禁止编造。
|
|
21
|
+
2. **分支先问再走**:仅文件还是归档、已有还是新建任务/资源/动作流,先向用户确认;用户首轮已明确的意图直接消费,不重复问。
|
|
22
|
+
3. **写操作三步走**:prepare(无副作用)→ 向用户摘要并取得明确同意 → apply(入参与 prepare 逐字一致)。没有同意绝不 apply;要改参数就重新 prepare。
|
|
23
|
+
4. **失败即停**:登录态失效提示重新登录;业务错误原样反馈原因;参数缺失只补问缺失项;不靠重试碰运气。
|
|
24
|
+
5. **证据分级**:请求成功 ≠ 业务成功;启动 ≠ 完成 ≠ 成功。采集成功只能按 `task-workflow.md` 的成功标准报告。
|
|
25
|
+
6. **分支边界**:仅文件分支不问全宗、不写全宗;归档分支先取得用户确认的全宗再绑定。
|
|
26
|
+
|
|
27
|
+
## 对用户的输出
|
|
28
|
+
|
|
29
|
+
- 只展示序号、名称、地址、状态与短摘要。
|
|
30
|
+
- 不展示长 ID、Cookie、FTP 明文密码、动作流密钥、票据(continuation)与大段请求体。
|
|
31
|
+
- 内部推理、参数试错过程不展示给用户。
|
|
32
|
+
- 默认任务名 `文件采集(yyyyMMdd HHmmss)`、默认动作流名 `文件采集动作流(yyyyMMdd HHmmss)` 均按 UTC+8 生成,展示时保留原样即可。
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 宿主平台集成(文件采集)
|
|
2
|
+
|
|
3
|
+
本模块通过 `weaver-work-cli` 直接执行:宿主调用 CLI、消费 JSON 结果,**从不**自行构造业务请求体。
|
|
4
|
+
|
|
5
|
+
## 运行前提
|
|
6
|
+
|
|
7
|
+
1. 已安装 `weaver-work-cli`(`weaver-work-cli --version` 有输出)。
|
|
8
|
+
2. 已读取 `auth-and-install.md`:安装、认证、超时与重试预算以该文档为准。
|
|
9
|
+
3. 已登录:`weaver-work-cli auth status` 显示已登录;失效时按 `auth-and-install.md` 复用宿主判定恢复会话,禁止在本提示中写死登录命令或调用其他登录 Skill。
|
|
10
|
+
|
|
11
|
+
## 调用方式
|
|
12
|
+
|
|
13
|
+
- 统一形式:`weaver-work-cli --json caizhilian run caizhilian.file-collection.<操作> --input-json '<json>'`(全局参数在子命令前)。
|
|
14
|
+
- 输入按复杂度选:`--input-json '<json>'`、`--input <UTF-8 文件路径>`、确认当前 shell 稳定后再用 `--input -`。
|
|
15
|
+
- 命令示例同时给 Windows PowerShell 与 macOS/Linux 两套;Windows 示例不用 Unix-only 写法(`printf`、`~/`、`rm` 等)。
|
|
16
|
+
- 能力与字段以 `weaver-work-cli caizhilian operations` / `caizhilian schema` 与 references 文档为准,不靠失败试错发现参数。
|
|
17
|
+
|
|
18
|
+
## 结果处理
|
|
19
|
+
|
|
20
|
+
- 输出为 JSON 信封:`ok`、`operation`、`data`。业务原始返回在 `data` 中;`run.result` 返回归一化的 `file_collection_result.v1`。
|
|
21
|
+
- 错误按类型处理:
|
|
22
|
+
|
|
23
|
+
| 类型 | 场景 | 处理 |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `confirmation` | 写操作缺确认 | 按 `write-protocol.md` 走确认后再 apply |
|
|
26
|
+
| `continuation_*` | 票据缺失/过期/不匹配/入参变化 | 重新 prepare,不改参硬套 |
|
|
27
|
+
| `business_error` | 服务端业务失败 | 原样反馈原因,不重试蒙混 |
|
|
28
|
+
| 认证错误 | 登录态失效 | 提示并按 `auth-and-install.md` 重新登录 |
|
|
29
|
+
|
|
30
|
+
## 执行顺序与操作面
|
|
31
|
+
|
|
32
|
+
按 `task-workflow.md` 的总流程推进;动作流细节见 `action-flow.md`;执行纪律见 `host-executor-prompt.md`。操作面速查(写操作均含 `.prepare` / `.apply`):
|
|
33
|
+
|
|
34
|
+
| 阶段 | 只读 | 写 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| 任务 | `task.list` / `task.form` | `task.save` / `task.save-as` / `task.switch` / `task.cancel` / `task.delete` / `task.update-fonds` |
|
|
37
|
+
| 资源 | `connector.query` | `connector.create` / `resource.create` |
|
|
38
|
+
| 动作流 | `workflow.search` / `workflow.inspect` | `workflow.create` / `workflow.enable` / `workflow.update-task` |
|
|
39
|
+
| 执行 | `storage.check` / `scan.progress` / `scan.wait` / `run.progress` / `run.result` / `detail` | `scan` / `run` |
|
|
40
|
+
|
|
41
|
+
## 安全与输出
|
|
42
|
+
|
|
43
|
+
- 凭证由 CLI 统一注入:宿主与 Agent 不读取、不打印、不转存 Cookie / eteamsid / 密码。
|
|
44
|
+
- 面向用户的摘要必须脱敏:掩码 FTP 密码与动作流密钥,不展示长 ID 与完整请求体。
|
|
45
|
+
- FTP/SFTP 密码只作为必要入参传递,不写入日志、文件或对话记录。
|
|
46
|
+
- 仅文件分支不暴露全宗相关询问;归档分支按 `task-workflow.md` 的全宗确认流程执行。
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# 文件采集规则索引
|
|
2
|
+
|
|
3
|
+
每条规则给出适用范围与典型违反表现,细节见对应文档。
|
|
4
|
+
|
|
5
|
+
## FILE-AUTH-001 认证由 CLI 托管
|
|
6
|
+
|
|
7
|
+
- 适用:所有文件采集操作。
|
|
8
|
+
- 要求:登录态与请求头凭证统一由 `weaver-work-cli auth ...` 托管;不写死域名,不读取、不输出 Cookie / eteamsid。
|
|
9
|
+
- 违反表现:手写认证头、把凭证写进入参或日志、绕过 CLI 直接发 HTTP 请求。
|
|
10
|
+
- 详见:`file-collection.md`「认证前置」、`auth-and-install.md`。
|
|
11
|
+
|
|
12
|
+
## FILE-WRITE-001 写操作先确认再执行
|
|
13
|
+
|
|
14
|
+
- 适用:保存任务、扫描、运行、取消、删除、切换/另存为任务、更新全宗、创建连接器/资源、创建/启用动作流、更新任务动作流。
|
|
15
|
+
- 要求:一律走 prepare → 向用户确认 → apply(见 `write-protocol.md`);apply 入参与 prepare 完全一致。
|
|
16
|
+
- 违反表现:跳过确认直接写、改参数后复用票据、把 prepare 的返回当成已执行。
|
|
17
|
+
|
|
18
|
+
## FILE-TASK-001 任务入参真实且一致
|
|
19
|
+
|
|
20
|
+
- 适用:保存采集任务、更新任务动作流。
|
|
21
|
+
- 要求:`source_id`、`workflow_id` 只能来自真实查询或创建结果;`retain_dir_struct` 在动作流检测/创建与保存任务时取值一致;默认任务名按 UTC+8 生成 `文件采集(yyyyMMdd HHmmss)`。
|
|
22
|
+
- 违反表现:编造 ID、目录结构模式前后不一致、把候选列表行直接当 ID 使用。
|
|
23
|
+
|
|
24
|
+
## FILE-FONDS-001 全宗仅限归档分支
|
|
25
|
+
|
|
26
|
+
- 适用:采集到档案的分支。
|
|
27
|
+
- 要求:仅文件分支不询问、不写入全宗;归档分支的全宗 ID 必须经用户明确确认后写入(`task.update-fonds`)。
|
|
28
|
+
- 违反表现:仅文件分支要全宗、单个候选自动确认、把展示名称当成全宗 ID 写入。
|
|
29
|
+
- 详见:`task-workflow.md`「采集目标」。
|
|
30
|
+
|
|
31
|
+
## FILE-FLOW-001 动作流必须回读校验
|
|
32
|
+
|
|
33
|
+
- 适用:选择已有动作流。
|
|
34
|
+
- 要求:搜索结果仅供展示;用户确认后必须执行兼容性检测(`workflow.inspect`),检测通过后才允许用于保存任务。
|
|
35
|
+
- 违反表现:列表未经校验就关联、把不兼容或未启用的应用关联进任务。
|
|
36
|
+
- 详见:`action-flow.md`。
|
|
37
|
+
|
|
38
|
+
## FILE-FLOW-002 动作流动态创建,不使用固定包
|
|
39
|
+
|
|
40
|
+
- 适用:新建动作流。
|
|
41
|
+
- 要求:由 `workflow.create` 动态生成标准链路(自定义触发 → 文档保存 → 输出);不手写设计文件,不上传或导入固定动作流包。
|
|
42
|
+
- 违反表现:手工拼设计、导入模板包、往链路里插入其他节点。
|
|
43
|
+
- 详见:`action-flow.md`。
|
|
44
|
+
|
|
45
|
+
## FILE-EXEC-001 执行证据分级
|
|
46
|
+
|
|
47
|
+
- 适用:扫描、运行、结果汇报。
|
|
48
|
+
- 要求:扫描默认增量,只有用户明确要求才全量;`run` 只证明启动;只有 `run.result` 满足成功条件才能报告采集成功。
|
|
49
|
+
- 违反表现:把「已启动 / 扫描完成」当成采集成功、没有文件级结果就报成功。
|
|
50
|
+
- 详见:`task-workflow.md`「结果判读」。
|
|
51
|
+
|
|
52
|
+
## FILE-OUTPUT-001 输出脱敏
|
|
53
|
+
|
|
54
|
+
- 适用:所有面向用户的输出。
|
|
55
|
+
- 要求:不展示长 ID、Cookie、FTP 明文密码、动作流密钥、票据(continuation)或大段请求体;只给序号、名称、地址、状态与短摘要。
|
|
56
|
+
- 违反表现:原样打印接口返回、密码或密钥出现在对话里。
|