@yixiaoermail/cli 3.2.3 → 3.2.6
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/bin/install.js +46 -2
- package/bin/yxer.js +31 -2
- package/checksums.txt +6 -6
- package/package.json +1 -1
- package/references/cli/command-design.md +1 -1
- package/references/cli/command-reference.md +30 -39
- package/references/cli/publish-channels.md +77 -0
- package/references/create-account-group.md +27 -0
- package/references/delete-account-group.md +20 -0
- package/references/domains/accounts-and-env.md +43 -0
- package/references/domains/draft-and-material.md +34 -0
- package/references/domains/install-and-sync.md +63 -0
- package/references/domains/publish.md +84 -0
- package/references/domains/troubleshooting.md +34 -0
- package/references/execution-standard.md +144 -0
- package/references/get-account-groups.md +15 -0
- package/references/get-account-overviews.md +56 -0
- package/references/get-challenges.md +14 -0
- package/references/get-collections.md +34 -0
- package/references/get-content-overviews.md +59 -0
- package/references/get-friends.md +9 -0
- package/references/get-games.md +39 -0
- package/references/get-goods.md +42 -0
- package/references/get-groups.md +35 -0
- package/references/get-hot-events.md +14 -0
- package/references/get-locations.md +48 -0
- package/references/get-members.md +28 -0
- package/references/get-miniapps.md +38 -0
- package/references/get-music-categories.md +41 -0
- package/references/get-music.md +67 -0
- package/references/get-publish-activities.md +40 -0
- package/references/get-publish-categories.md +62 -0
- package/references/get-sync-apps.md +14 -0
- package/references/get-topics.md +13 -0
- package/references/go-live-process.md +160 -0
- package/references/keyword-reference.md +114 -0
- package/references/legacy/capabilities.md +1 -1
- package/references/material-resource.md +88 -0
- package/references/platform-doc-maintenance.md +33 -0
- package/references/platform.md +62 -0
- package/references/platforms/article/acfun.md +90 -0
- package/references/platforms/article/aiqiyi.md +56 -0
- package/references/platforms/article/baijiahao.md +94 -0
- package/references/platforms/article/bilibili.md +88 -0
- package/references/platforms/article/chejiahao.md +81 -0
- package/references/platforms/article/csdn.md +86 -0
- package/references/platforms/article/dayuhao.md +78 -0
- package/references/platforms/article/douban.md +62 -0
- package/references/platforms/article/douyin.md +106 -0
- package/references/platforms/article/index.md +157 -0
- package/references/platforms/article/jianshu.md +58 -0
- package/references/platforms/article/kuaichuanhao.md +78 -0
- package/references/platforms/article/qiehao.md +78 -0
- package/references/platforms/article/souhuhao.md +75 -0
- package/references/platforms/article/toutiaohao.md +78 -0
- package/references/platforms/article/wangyihao.md +79 -0
- package/references/platforms/article/weixingongzhonghao.md +135 -0
- package/references/platforms/article/xinlangweibo.md +75 -0
- package/references/platforms/article/xueqiuhao.md +73 -0
- package/references/platforms/article/yichehao.md +92 -0
- package/references/platforms/article/yidianhao.md +76 -0
- package/references/platforms/article/zhihu.md +75 -0
- package/references/platforms/imageText/baijiahao.md +102 -0
- package/references/platforms/imageText/douyin.md +111 -0
- package/references/platforms/imageText/index.md +113 -0
- package/references/platforms/imageText/kuaishou.md +106 -0
- package/references/platforms/imageText/shipinhao.md +112 -0
- package/references/platforms/imageText/toutiaohao.md +76 -0
- package/references/platforms/imageText/xiaohongshu.md +85 -0
- package/references/platforms/imageText/xinlangweibo.md +77 -0
- package/references/platforms/imageText/zhihu.md +92 -0
- package/references/platforms/index.md +6 -6
- package/references/platforms/video/acfun.md +82 -0
- package/references/platforms/video/aiqiyi.md +89 -0
- package/references/platforms/video/baijiahao.md +89 -0
- package/references/platforms/video/bilibili-open.md +59 -0
- package/references/platforms/video/bilibili.md +80 -0
- package/references/platforms/video/chejiahao.md +63 -0
- package/references/platforms/video/dayuhao.md +91 -0
- package/references/platforms/video/dewu.md +80 -0
- package/references/platforms/video/douyin.md +173 -0
- package/references/platforms/video/duoduoshipin.md +64 -0
- package/references/platforms/video/facebook.md +37 -0
- package/references/platforms/video/fengwang.md +81 -0
- package/references/platforms/video/index.md +173 -0
- package/references/platforms/video/instagram.md +40 -0
- package/references/platforms/video/kuaishou-open.md +44 -0
- package/references/platforms/video/kuaishou.md +77 -0
- package/references/platforms/video/meipai.md +79 -0
- package/references/platforms/video/meiyou.md +59 -0
- package/references/platforms/video/pipixia.md +58 -0
- package/references/platforms/video/qiehao.md +91 -0
- package/references/platforms/video/shipinhao.md +100 -0
- package/references/platforms/video/souhuhao.md +91 -0
- package/references/platforms/video/souhushipin.md +64 -0
- package/references/platforms/video/tengxunshipin.md +63 -0
- package/references/platforms/video/tiktok.md +50 -0
- package/references/platforms/video/toutiaohao.md +66 -0
- package/references/platforms/video/wangyihao.md +93 -0
- package/references/platforms/video/weishi.md +61 -0
- package/references/platforms/video/xiaohongshu.md +133 -0
- package/references/platforms/video/xiaohongshushop.md +92 -0
- package/references/platforms/video/xinlangweibo.md +79 -0
- package/references/platforms/video/yichehao.md +61 -0
- package/references/platforms/video/yidianhao.md +85 -0
- package/references/platforms/video/youtube.md +53 -0
- package/references/platforms/video/zhihu.md +85 -0
- package/references/protocols/confirmation.md +62 -0
- package/references/protocols/error-recovery.md +50 -0
- package/references/protocols/execution.md +65 -0
- package/references/protocols/provenance.md +61 -0
- package/references/proxy-management.md +69 -0
- package/references/query-accounts.md +85 -0
- package/references/save-draft.md +75 -0
- package/references/topic-tags.md +140 -0
- package/references/troubleshooting-guide.md +105 -0
- package/references/update-account-group.md +28 -0
- package/references/upload-resource.md +70 -0
- package/references/usage-workflow.md +207 -0
- package/references/workflows/common-rules.md +57 -27
- package/references/workflows/data-accuracy.md +83 -0
- package/references/workflows/local-vs-cloud.md +12 -5
- package/references/workflows/payload-sourcing.md +3 -0
- package/references/workflows/publish-article.md +5 -3
- package/references/workflows/publish-imageText.md +5 -3
- package/references/workflows/publish-troubleshooting.md +1 -1
- package/references/workflows/publish-video.md +6 -4
- package/references/yixiaoer-shared.md +106 -0
- package/schemas/platforms/acfun.article.schema.json +9 -9
- package/schemas/platforms/baijiahao.article.schema.json +8 -0
- package/schemas/platforms/baijiahao.video.schema.json +19 -2
- package/schemas/platforms/bilibili-open.video.schema.json +188 -0
- package/schemas/platforms/chejiahao.article.schema.json +7 -7
- package/schemas/platforms/dayuhao.video.schema.json +26 -0
- package/schemas/platforms/douyin.article.schema.json +8 -0
- package/schemas/platforms/douyin.imageText.schema.json +16 -2
- package/schemas/platforms/douyin.video.schema.json +88 -6
- package/schemas/platforms/kuaichuanhao.article.schema.json +20 -8
- package/schemas/platforms/kuaishou-open.video.schema.json +102 -0
- package/schemas/platforms/kuaishou.imageText.schema.json +12 -2
- package/schemas/platforms/kuaishou.video.schema.json +31 -0
- package/schemas/platforms/shipinhao.imageText.schema.json +13 -1
- package/schemas/platforms/shipinhao.video.schema.json +31 -0
- package/schemas/platforms/souhushipin.video.schema.json +3 -3
- package/schemas/platforms/tengxunshipin.video.schema.json +1 -0
- package/schemas/platforms/toutiaohao.imageText.schema.json +2 -1
- package/schemas/platforms/toutiaohao.video.schema.json +2 -1
- package/schemas/platforms/wangyihao.article.schema.json +6 -5
- package/schemas/platforms/wangyihao.video.schema.json +1 -0
- package/schemas/platforms/xhs.imageText.schema.json +27 -25
- package/schemas/platforms/xiaohongshu.video.schema.json +2 -1
- package/schemas/platforms/xinlang.imageText.schema.json +23 -2
- package/schemas/platforms/xinlang.video.schema.json +40 -10
- package/schemas/platforms/yidianhao.article.schema.json +1 -0
- package/schemas/platforms/yidianhao.video.schema.json +9 -8
- package/skills/yixiaoer/SKILL.md +30 -4
- package/skills/yixiaoer/references/cli/command-design.md +305 -0
- package/skills/yixiaoer/references/cli/command-reference.md +21 -8
- package/skills/yixiaoer/references/cli/publish-channels.md +77 -0
- package/skills/yixiaoer/references/domains/accounts-and-env.md +6 -2
- package/skills/yixiaoer/references/domains/draft-and-material.md +8 -3
- package/skills/yixiaoer/references/domains/install-and-sync.md +5 -7
- package/skills/yixiaoer/references/domains/publish.md +17 -10
- package/skills/yixiaoer/references/domains/troubleshooting.md +6 -2
- package/skills/yixiaoer/references/get-account-groups.md +2 -1
- package/skills/yixiaoer/references/go-live-process.md +2 -2
- package/skills/yixiaoer/references/keyword-reference.md +3 -2
- package/skills/yixiaoer/references/legacy/capabilities.md +37 -0
- package/skills/yixiaoer/references/platform.md +2 -1
- package/skills/yixiaoer/references/platforms/article/acfun.md +1 -1
- package/skills/yixiaoer/references/platforms/article/aiqiyi.md +1 -1
- package/skills/yixiaoer/references/platforms/article/baijiahao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/bilibili.md +1 -1
- package/skills/yixiaoer/references/platforms/article/chejiahao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/csdn.md +1 -1
- package/skills/yixiaoer/references/platforms/article/dayuhao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/douban.md +1 -1
- package/skills/yixiaoer/references/platforms/article/douyin.md +1 -1
- package/skills/yixiaoer/references/platforms/article/index.md +2 -2
- package/skills/yixiaoer/references/platforms/article/jianshu.md +1 -1
- package/skills/yixiaoer/references/platforms/article/kuaichuanhao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/qiehao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/souhuhao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/toutiaohao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/wangyihao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/weixingongzhonghao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/xinlangweibo.md +1 -1
- package/skills/yixiaoer/references/platforms/article/xueqiuhao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/yichehao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/yidianhao.md +1 -1
- package/skills/yixiaoer/references/platforms/article/zhihu.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/douyin.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/index.md +5 -8
- package/skills/yixiaoer/references/platforms/imageText/kuaishou.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/shipinhao.md +4 -17
- package/skills/yixiaoer/references/platforms/imageText/toutiaohao.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/xiaohongshu.md +4 -7
- package/skills/yixiaoer/references/platforms/imageText/xinlangweibo.md +1 -1
- package/skills/yixiaoer/references/platforms/imageText/zhihu.md +1 -1
- package/skills/yixiaoer/references/platforms/video/acfun.md +1 -1
- package/skills/yixiaoer/references/platforms/video/aiqiyi.md +1 -1
- package/skills/yixiaoer/references/platforms/video/baijiahao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/bilibili-open.md +33 -61
- package/skills/yixiaoer/references/platforms/video/bilibili.md +1 -1
- package/skills/yixiaoer/references/platforms/video/chejiahao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/dayuhao.md +3 -1
- package/skills/yixiaoer/references/platforms/video/dewu.md +1 -1
- package/skills/yixiaoer/references/platforms/video/douyin.md +41 -11
- package/skills/yixiaoer/references/platforms/video/duoduoshipin.md +1 -1
- package/skills/yixiaoer/references/platforms/video/fengwang.md +1 -1
- package/skills/yixiaoer/references/platforms/video/index.md +6 -2
- package/skills/yixiaoer/references/platforms/video/kuaishou-open.md +20 -39
- package/skills/yixiaoer/references/platforms/video/kuaishou.md +1 -1
- package/skills/yixiaoer/references/platforms/video/meipai.md +1 -1
- package/skills/yixiaoer/references/platforms/video/meiyou.md +1 -1
- package/skills/yixiaoer/references/platforms/video/pipixia.md +1 -1
- package/skills/yixiaoer/references/platforms/video/qiehao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/shipinhao.md +7 -2
- package/skills/yixiaoer/references/platforms/video/souhuhao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/souhushipin.md +1 -1
- package/skills/yixiaoer/references/platforms/video/tengxunshipin.md +1 -1
- package/skills/yixiaoer/references/platforms/video/toutiaohao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/wangyihao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/weishi.md +1 -1
- package/skills/yixiaoer/references/platforms/video/xiaohongshu.md +1 -1
- package/skills/yixiaoer/references/platforms/video/xiaohongshushop.md +1 -1
- package/skills/yixiaoer/references/platforms/video/xinlangweibo.md +1 -1
- package/skills/yixiaoer/references/platforms/video/yichehao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/yidianhao.md +1 -1
- package/skills/yixiaoer/references/platforms/video/zhihu.md +1 -1
- package/skills/yixiaoer/references/protocols/confirmation.md +62 -0
- package/skills/yixiaoer/references/protocols/error-recovery.md +50 -0
- package/skills/yixiaoer/references/protocols/execution.md +65 -0
- package/skills/yixiaoer/references/protocols/provenance.md +61 -0
- package/skills/yixiaoer/references/upload-resource.md +7 -0
- package/skills/yixiaoer/references/usage-workflow.md +1 -1
- package/skills/yixiaoer/references/workflows/common-rules.md +37 -16
- package/skills/yixiaoer/references/workflows/local-vs-cloud.md +12 -5
- package/skills/yixiaoer/references/workflows/publish-troubleshooting.md +1 -1
- package/skills/yixiaoer/references/workflows/publish-video.md +1 -1
- package/skills/yixiaoer/references/yixiaoer-shared.md +20 -9
- package/skills/yixiaoer/references/platforms/get-locations.md +0 -5
- package/skills/yixiaoer/references/platforms/imageText/weixinshipinhao.md +0 -7
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"formType",
|
|
6
6
|
"title",
|
|
7
7
|
"description",
|
|
8
|
-
"
|
|
8
|
+
"createType",
|
|
9
9
|
"video"
|
|
10
10
|
],
|
|
11
11
|
"properties": {
|
|
@@ -23,15 +23,6 @@
|
|
|
23
23
|
"minLength": 1,
|
|
24
24
|
"maxLength": 2000
|
|
25
25
|
},
|
|
26
|
-
"type": {
|
|
27
|
-
"type": "number",
|
|
28
|
-
"enum": [
|
|
29
|
-
1,
|
|
30
|
-
2,
|
|
31
|
-
3
|
|
32
|
-
],
|
|
33
|
-
"default": 1
|
|
34
|
-
},
|
|
35
26
|
"video": {
|
|
36
27
|
"type": "object",
|
|
37
28
|
"required": [
|
|
@@ -116,6 +107,28 @@
|
|
|
116
107
|
},
|
|
117
108
|
"additionalProperties": true
|
|
118
109
|
},
|
|
110
|
+
"category": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"yixiaoerId",
|
|
116
|
+
"yixiaoerName"
|
|
117
|
+
],
|
|
118
|
+
"properties": {
|
|
119
|
+
"yixiaoerId": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"yixiaoerName": {
|
|
123
|
+
"type": "string"
|
|
124
|
+
},
|
|
125
|
+
"raw": {
|
|
126
|
+
"type": "object"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"additionalProperties": true
|
|
130
|
+
}
|
|
131
|
+
},
|
|
119
132
|
"collection": {
|
|
120
133
|
"type": "object",
|
|
121
134
|
"required": [
|
|
@@ -146,6 +159,23 @@
|
|
|
146
159
|
1
|
|
147
160
|
],
|
|
148
161
|
"default": 1
|
|
162
|
+
},
|
|
163
|
+
"visibleType": {
|
|
164
|
+
"type": "number",
|
|
165
|
+
"enum": [
|
|
166
|
+
0,
|
|
167
|
+
1
|
|
168
|
+
],
|
|
169
|
+
"default": 0
|
|
170
|
+
},
|
|
171
|
+
"createType": {
|
|
172
|
+
"type": "number",
|
|
173
|
+
"enum": [
|
|
174
|
+
1,
|
|
175
|
+
2,
|
|
176
|
+
3
|
|
177
|
+
],
|
|
178
|
+
"default": 1
|
|
149
179
|
}
|
|
150
180
|
},
|
|
151
181
|
"additionalProperties": false
|
|
@@ -54,17 +54,10 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
"type": {
|
|
58
|
-
"type": "number",
|
|
59
|
-
"enum": [
|
|
60
|
-
0,
|
|
61
|
-
1
|
|
62
|
-
],
|
|
63
|
-
"default": 1
|
|
64
|
-
},
|
|
65
57
|
"declaration": {
|
|
66
58
|
"type": "number",
|
|
67
59
|
"enum": [
|
|
60
|
+
0,
|
|
68
61
|
3,
|
|
69
62
|
4,
|
|
70
63
|
5
|
|
@@ -146,6 +139,14 @@
|
|
|
146
139
|
1
|
|
147
140
|
],
|
|
148
141
|
"default": 1
|
|
142
|
+
},
|
|
143
|
+
"createType": {
|
|
144
|
+
"type": "number",
|
|
145
|
+
"enum": [
|
|
146
|
+
1,
|
|
147
|
+
2
|
|
148
|
+
],
|
|
149
|
+
"default": 1
|
|
149
150
|
}
|
|
150
151
|
},
|
|
151
152
|
"additionalProperties": false
|
package/skills/yixiaoer/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yixiaoer
|
|
3
|
-
version: 3.2.
|
|
3
|
+
version: 3.2.6
|
|
4
4
|
description: "通过 yxer CLI 操作蚁小二多平台内容分发:账号查询、资源上传、发布前准备、payload 校验、云发布/本机发布、草稿保存、素材登记、发布记录排查与技能同步。"
|
|
5
5
|
metadata:
|
|
6
6
|
category: "productivity"
|
|
@@ -16,12 +16,20 @@ metadata:
|
|
|
16
16
|
**🚀 首次使用?先读 [`./QUICKSTART.md`](./QUICKSTART.md) - 5 分钟完成首次发布**
|
|
17
17
|
|
|
18
18
|
**CRITICAL - 开始前 MUST 先读取 [`./references/yixiaoer-shared.md`](./references/yixiaoer-shared.md),其中包含环境检查、发布通道、同步和输出协议。**
|
|
19
|
+
**AI EXECUTION PROTOCOL - 涉及查询、payload 修订、草稿、素材或发布时,MUST 先读取 [`./references/protocols/execution.md`](./references/protocols/execution.md),并按状态机推进。**
|
|
19
20
|
**BLOCKING REQUIREMENT - 涉及正式写操作时,禁止凭记忆拼 payload、禁止跳过 workflow、禁止绕过 `yxer` CLI 直接执行旧脚本或隐式 API。**
|
|
20
21
|
|
|
21
22
|
## 能力索引
|
|
22
23
|
|
|
23
24
|
根据用户需求,必须先读取对应业务域文档,再进入具体 workflow 或 reference。不要直接凭记忆拼 payload 或执行正式发布。
|
|
24
25
|
|
|
26
|
+
- AI 执行协议
|
|
27
|
+
- 入口:[`./references/protocols/execution.md`](./references/protocols/execution.md)
|
|
28
|
+
- 候选确认:[`./references/protocols/confirmation.md`](./references/protocols/confirmation.md)
|
|
29
|
+
- 字段来源追踪:[`./references/protocols/provenance.md`](./references/protocols/provenance.md)
|
|
30
|
+
- 错误恢复:[`./references/protocols/error-recovery.md`](./references/protocols/error-recovery.md)
|
|
31
|
+
- 覆盖状态机、写操作门禁、多候选确认、payload 来源追踪和失败后的最小修复策略。
|
|
32
|
+
|
|
25
33
|
- 发布与 payload 修订
|
|
26
34
|
- 入口:[`./references/domains/publish.md`](./references/domains/publish.md)
|
|
27
35
|
- 覆盖视频、图文、文章发布,账号选择,云/本机通道判断,payload 来源纪律,动态字段查询,平台差异文档入口。
|
|
@@ -42,7 +50,7 @@ metadata:
|
|
|
42
50
|
|
|
43
51
|
| 用户意图 / 说法 | 先读入口 | 后续动作 |
|
|
44
52
|
| --- | --- | --- |
|
|
45
|
-
| “帮我发一下”“发个抖音/小红书”“发布视频/图文/文章” | [`./references/domains/publish.md`](./references/domains/publish.md) | 再按类型进入对应 workflow
|
|
53
|
+
| “帮我发一下”“发个抖音/小红书”“发布视频/图文/文章” | [`./references/domains/publish.md`](./references/domains/publish.md) | 再按类型进入对应 workflow;已有完整 payload 时走 `validate -> publish --dry-run -> publish`,缺账号/字段/资源时先补 `doctor -> accounts list -> prepare/form -> upload/query` |
|
|
46
54
|
| “先别发,只生成/修一下 payload” | [`./references/domains/publish.md`](./references/domains/publish.md) | 强制读取 payload 来源和类型 workflow,只做字段修订,不擅自正式发布 |
|
|
47
55
|
| “查下账号/环境”“怎么配置 clientId”“看看 skill 要不要同步” | [`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md) | 先做环境检查,再决定是否继续业务流程 |
|
|
48
56
|
| “存草稿”“传素材”“放到素材库里” | [`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md) | 先区分草稿和素材,再判断是否需要回切发布域 |
|
|
@@ -63,9 +71,27 @@ yxer schema get <platform> <type>
|
|
|
63
71
|
## 全局规则
|
|
64
72
|
|
|
65
73
|
- 发布、草稿、素材、排查都只允许通过 `yxer` CLI 执行。
|
|
74
|
+
- 任何涉及查询、候选选择、payload 修订或写操作的任务,必须先遵循 AI 执行协议中的状态机、确认协议和错误恢复协议。
|
|
66
75
|
- 涉及写操作或 payload 修订时,必须遵守 [`./references/workflows/data-accuracy.md`](./references/workflows/data-accuracy.md):先查询真实数据,再确认候选,最后 validate / dry-run / 写入。
|
|
67
|
-
- BLOCKING REQUIREMENT:
|
|
68
|
-
- `prepare`、`schema fields` / `schema get`、workflow、平台文档和 CLI 实际输出,是组装 payload 的唯一依据。
|
|
76
|
+
- BLOCKING REQUIREMENT: 正式发布前必须先用同一份 `payload.json`、同一套发布通道参数完成 `yxer validate -> yxer publish --dry-run`;缺账号、字段、资源或动态对象时,先补 `doctor -> accounts list -> prepare/form -> upload/query`。
|
|
77
|
+
- `prepare`/`publish form`、`schema fields` / `schema get`、workflow、平台文档和 CLI 实际输出,是组装 payload 的唯一依据。
|
|
78
|
+
- `prepare` 返回的 `data.form` 是可恢复的页面式表单契约;新建复杂 payload 时优先使用 `yxer publish form start/inspect/set/choose/verify/review/export`,不要自行发明字段或路径。form 会话不能直接发布,必须先 verify 并 export 成标准 `payload.json`。
|
|
69
79
|
- 图片、视频、封面等资源必须先上传,且只能复用 `yxer upload` 返回的真实字段。
|
|
70
80
|
- `category`、`location`、`music`、`collection`、`challenge`、`goods` 等动态字段必须先通过 `yxer query ...` 查询,不能手写对象。
|
|
71
81
|
- CRITICAL: `validate`、`publish --dry-run`、正式 `publish` 必须使用同一套发布通道参数。
|
|
82
|
+
|
|
83
|
+
## 页面式表单会话
|
|
84
|
+
|
|
85
|
+
当一次性编辑 `payload.json` 无法表达页面中的完整流程时,使用本地会话逐步推进:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
yxer publish form start <platform> <type> --output publish-form.json
|
|
89
|
+
yxer publish form inspect publish-form.json
|
|
90
|
+
yxer publish form set publish-form.json <payload.path> --value '<json-value>'
|
|
91
|
+
yxer publish form choose publish-form.json <field> --value-file query-result.json --id <candidate_id> --source-command "yxer query ... --json"
|
|
92
|
+
yxer publish form verify publish-form.json
|
|
93
|
+
yxer publish form review publish-form.json
|
|
94
|
+
yxer publish form export publish-form.json --output payload.json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`set` / `choose` / `verify` / `review` 只更新或检查本地会话,不会触发发布;动态字段必须用 `choose` 从 `query` 返回候选中选择,并用 `--source-command` 记录实际执行的 `yxer query ... --json` 命令。`set` 只能写 form contract 声明过的路径;`choose` 只写 `dynamicFieldExamples` 声明的字段,且 query 账号必须匹配目标账号。资源应直接使用 `upload` 返回的完整对象。文本字段可直接传文本,复杂对象使用 JSON。导出前 `verify` / `review` / `export` 会校验来源记录和当前 payload 是否一致;导出后仍必须按同一份 payload 和同一套发布通道参数执行 `validate payload.json -> publish payload.json --dry-run -> 用户授权 -> publish payload.json`。所有写本地文件的会话命令都支持 `--dry-run`。
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# yxer 命令树设计标准
|
|
2
|
+
|
|
3
|
+
本文定义 `yxer` CLI 的命令树设计标准、输出约束,以及当前架构缺陷和后续优化方向。
|
|
4
|
+
|
|
5
|
+
## 目标
|
|
6
|
+
|
|
7
|
+
- 保持命令语义稳定,便于人类和 AI agent 共同使用。
|
|
8
|
+
- 保持 `stdout` JSON 输出稳定,避免命令名、action 名和返回结构长期漂移。
|
|
9
|
+
- 让“资源类能力”和“工作流类能力”在命令树上有明确边界。
|
|
10
|
+
|
|
11
|
+
## 顶层命令分层
|
|
12
|
+
|
|
13
|
+
当前建议把命令分为 4 类:
|
|
14
|
+
|
|
15
|
+
1. 系统类命令
|
|
16
|
+
- `doctor`
|
|
17
|
+
- `config`
|
|
18
|
+
- `skill`
|
|
19
|
+
- `update`
|
|
20
|
+
|
|
21
|
+
2. 资源类命令
|
|
22
|
+
- `accounts`
|
|
23
|
+
- `account-group`
|
|
24
|
+
- `material`
|
|
25
|
+
- `draft`
|
|
26
|
+
|
|
27
|
+
3. 工作流类命令
|
|
28
|
+
- `prepare`
|
|
29
|
+
- `validate`
|
|
30
|
+
- `publish`
|
|
31
|
+
- `upload`
|
|
32
|
+
|
|
33
|
+
4. 查询类命令
|
|
34
|
+
- `query`
|
|
35
|
+
|
|
36
|
+
## 命令树标准
|
|
37
|
+
|
|
38
|
+
### 1. 资源类能力优先使用资源命令
|
|
39
|
+
|
|
40
|
+
资源自身的 CRUD 能力优先设计成:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yxer <resource> list
|
|
44
|
+
yxer <resource> create ...
|
|
45
|
+
yxer <resource> update ...
|
|
46
|
+
yxer <resource> delete ...
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
例如:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
yxer account-group list
|
|
53
|
+
yxer account-group create <name> --dry-run
|
|
54
|
+
yxer account-group update <group_id> <name> --dry-run
|
|
55
|
+
yxer account-group delete <group_id> --dry-run
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
规则:
|
|
59
|
+
|
|
60
|
+
- 资源名统一使用单数,如 `account-group`
|
|
61
|
+
- 子命令统一使用 `list/create/update/delete`
|
|
62
|
+
- `list` 可提供 `ls` alias;其余写操作默认不提供别名
|
|
63
|
+
|
|
64
|
+
### 2. `query` 只保留“跨资源查询”或“发布前置查询”
|
|
65
|
+
|
|
66
|
+
`query` 不是资源 CRUD 的兜底入口,而是保留给:
|
|
67
|
+
|
|
68
|
+
- 发布前置对象查询,如 `locations`、`music`、`groups`
|
|
69
|
+
- 远端聚合视图查询,如 `records`、`details`
|
|
70
|
+
- 非标准资源树、但仍然明确只读的接口
|
|
71
|
+
|
|
72
|
+
规则:
|
|
73
|
+
|
|
74
|
+
- `query` 下只放只读能力
|
|
75
|
+
- 新增资源型查询时,优先判断是否应该归入某个资源命令,而不是默认塞进 `query`
|
|
76
|
+
|
|
77
|
+
### 3. 写操作必须支持 `--dry-run`
|
|
78
|
+
|
|
79
|
+
所有会产生副作用的命令应优先支持:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yxer <command> ... --dry-run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
规则:
|
|
86
|
+
|
|
87
|
+
- `--dry-run` 返回实际请求预览,不执行远端写操作
|
|
88
|
+
- dry-run 输出中的字段必须来自 CLI 真实会发送的请求体,不允许编造
|
|
89
|
+
- 若命令没有可预览的 body,也应至少返回关键路径参数,如 `groupId`
|
|
90
|
+
|
|
91
|
+
### 4. action 命名要和命令树一致
|
|
92
|
+
|
|
93
|
+
成功 envelope 里的 `action` 字段统一按命令树命名:
|
|
94
|
+
|
|
95
|
+
- 读操作:`resource.list`
|
|
96
|
+
- 写操作:`resource.create` / `resource.update` / `resource.delete`
|
|
97
|
+
- dry-run:追加 `.dry-run`
|
|
98
|
+
|
|
99
|
+
例如:
|
|
100
|
+
|
|
101
|
+
- `account-group.list`
|
|
102
|
+
- `account-group.create`
|
|
103
|
+
- `account-group.create.dry-run`
|
|
104
|
+
|
|
105
|
+
不要继续混用这两类风格:
|
|
106
|
+
|
|
107
|
+
- `create-account-group`
|
|
108
|
+
- `account-group.create`
|
|
109
|
+
|
|
110
|
+
应统一保留后一种。
|
|
111
|
+
|
|
112
|
+
### 5. 命令命名统一使用 kebab-case
|
|
113
|
+
|
|
114
|
+
规则:
|
|
115
|
+
|
|
116
|
+
- 多单词资源名统一 kebab-case,如 `account-group`
|
|
117
|
+
- 多单词 flag 统一 kebab-case,如 `--publish-start-time`
|
|
118
|
+
- 路径参数占位名统一 `<group_id>`、`<account_id>` 这种 snake_case 风格
|
|
119
|
+
|
|
120
|
+
### 6. 帮助文案不再强调“兼容入口”
|
|
121
|
+
|
|
122
|
+
既然标准入口已经明确,后续帮助文案应直接描述职责,不再长期保留:
|
|
123
|
+
|
|
124
|
+
- “兼容入口”
|
|
125
|
+
- “推荐使用 xxx”
|
|
126
|
+
|
|
127
|
+
这些文案只适合迁移期,不适合作为长期帮助文本。
|
|
128
|
+
|
|
129
|
+
## 实现标准
|
|
130
|
+
|
|
131
|
+
### 1. 每个资源/领域一个命令文件
|
|
132
|
+
|
|
133
|
+
建议保持:
|
|
134
|
+
|
|
135
|
+
- `cmd/account_groups.go`
|
|
136
|
+
- `cmd/accounts.go`
|
|
137
|
+
- `cmd/material.go`
|
|
138
|
+
- `cmd/query.go`
|
|
139
|
+
|
|
140
|
+
不要让单个文件无限膨胀。
|
|
141
|
+
|
|
142
|
+
### 2. 优先使用 `newXxxCmd()` 构造函数
|
|
143
|
+
|
|
144
|
+
建议统一使用构造函数返回 `*cobra.Command`,而不是长期混用:
|
|
145
|
+
|
|
146
|
+
- `var xxxCmd = &cobra.Command{}`
|
|
147
|
+
- `func newXxxCmd() *cobra.Command`
|
|
148
|
+
|
|
149
|
+
构造函数模式更适合:
|
|
150
|
+
|
|
151
|
+
- 测试隔离
|
|
152
|
+
- 子命令复用
|
|
153
|
+
- 避免全局命令对象互相污染
|
|
154
|
+
|
|
155
|
+
### 3. 共享逻辑下沉到独立 helper
|
|
156
|
+
|
|
157
|
+
例如:
|
|
158
|
+
|
|
159
|
+
- body 构造:`buildAccountGroupBody`
|
|
160
|
+
- 读操作包装:`runQuery`
|
|
161
|
+
|
|
162
|
+
后续还可以继续抽象:
|
|
163
|
+
|
|
164
|
+
- `runWrite`
|
|
165
|
+
- `runDryRun`
|
|
166
|
+
- `requireNonEmptyID`
|
|
167
|
+
|
|
168
|
+
避免每个写命令都重复拼相同的 dry-run 和 runtime 加载逻辑。
|
|
169
|
+
|
|
170
|
+
## 当前架构缺陷
|
|
171
|
+
|
|
172
|
+
### 1. `cmd/query.go` 过大,职责过重
|
|
173
|
+
|
|
174
|
+
当前 `cmd/query.go` 同时承担:
|
|
175
|
+
|
|
176
|
+
- 查询命令注册
|
|
177
|
+
- 兼容根命令注册
|
|
178
|
+
- `update-account` 写操作
|
|
179
|
+
- `prepare` 工作流入口
|
|
180
|
+
|
|
181
|
+
问题:
|
|
182
|
+
|
|
183
|
+
- 文件过长,维护成本高
|
|
184
|
+
- `query` 与非 `query` 能力耦合
|
|
185
|
+
- 写操作 `update-account` 放在 `query.go` 里,职责不清晰
|
|
186
|
+
|
|
187
|
+
建议:
|
|
188
|
+
|
|
189
|
+
- 把 `update-account` 拆到 `cmd/accounts.go` 或新建 `cmd/account_update.go`
|
|
190
|
+
- 把 `prepare` 拆到单独文件
|
|
191
|
+
- `query.go` 只保留 query 域相关内容
|
|
192
|
+
|
|
193
|
+
### 2. 命令注册方式不统一
|
|
194
|
+
|
|
195
|
+
目前同时存在两种风格:
|
|
196
|
+
|
|
197
|
+
- 包级变量命令对象
|
|
198
|
+
- `newXxxCmd()` 工厂函数
|
|
199
|
+
|
|
200
|
+
问题:
|
|
201
|
+
|
|
202
|
+
- 测试时容易共享全局状态
|
|
203
|
+
- dry-run flag 等变量容易互相污染
|
|
204
|
+
- 不利于后续做命令树生成或重构
|
|
205
|
+
|
|
206
|
+
建议:
|
|
207
|
+
|
|
208
|
+
- 新代码统一走 `newXxxCmd()`
|
|
209
|
+
- 旧命令逐步迁移
|
|
210
|
+
|
|
211
|
+
### 3. 全局 flag 状态过多
|
|
212
|
+
|
|
213
|
+
当前很多命令使用包级变量存 flag 值,例如 `cmd/query.go` 中的大量全局变量。
|
|
214
|
+
|
|
215
|
+
问题:
|
|
216
|
+
|
|
217
|
+
- 测试需要手动清理状态
|
|
218
|
+
- 多命令复用时容易串值
|
|
219
|
+
- 命令实例不是完全自包含
|
|
220
|
+
|
|
221
|
+
建议:
|
|
222
|
+
|
|
223
|
+
- 优先把 flag 绑定到局部变量或 option struct
|
|
224
|
+
- 复杂命令引入 `Options` 结构,执行前从 `cmd.Flags()` 读取
|
|
225
|
+
|
|
226
|
+
### 4. action 命名历史包袱较重
|
|
227
|
+
|
|
228
|
+
当前仓库里既有:
|
|
229
|
+
|
|
230
|
+
- `records.list`
|
|
231
|
+
- `update-account`
|
|
232
|
+
- `publish.dry-run`
|
|
233
|
+
|
|
234
|
+
问题:
|
|
235
|
+
|
|
236
|
+
- 同一类动作命名风格不统一
|
|
237
|
+
- agent 侧很难基于 action 做稳定分类
|
|
238
|
+
|
|
239
|
+
建议:
|
|
240
|
+
|
|
241
|
+
- 逐步统一为 `resource.verb`
|
|
242
|
+
- 工作流类命令统一为 `workflow.verb` 或保持单命令名,但要明确约定
|
|
243
|
+
|
|
244
|
+
### 5. 文档存在重复源
|
|
245
|
+
|
|
246
|
+
当前命令文档分散在:
|
|
247
|
+
|
|
248
|
+
- `README.md`
|
|
249
|
+
- `README.md`
|
|
250
|
+
- `skills/yixiaoer/references/cli/command-reference.md`
|
|
251
|
+
|
|
252
|
+
问题:
|
|
253
|
+
|
|
254
|
+
- 容易改一处漏两处
|
|
255
|
+
- 标准变更时容易产生冲突文案
|
|
256
|
+
|
|
257
|
+
建议:
|
|
258
|
+
|
|
259
|
+
- 选一个主文档源
|
|
260
|
+
- 其余文档尽量引用或做自动同步
|
|
261
|
+
- 至少建立“命令变更时必须同步哪些文档”的 checklist
|
|
262
|
+
|
|
263
|
+
### 6. 测试覆盖偏重“命令存在”,缺少“命令树一致性”抽象
|
|
264
|
+
|
|
265
|
+
当前测试大量手动枚举命令名。
|
|
266
|
+
|
|
267
|
+
问题:
|
|
268
|
+
|
|
269
|
+
- 增删命令时测试改动分散
|
|
270
|
+
- 无法快速看出命令树整体是否符合标准
|
|
271
|
+
|
|
272
|
+
建议:
|
|
273
|
+
|
|
274
|
+
- 增加一类“命令树快照测试”或“结构断言 helper”
|
|
275
|
+
- 例如统一断言某个资源必须具备 `list/create/update/delete`
|
|
276
|
+
|
|
277
|
+
## 推荐优化顺序
|
|
278
|
+
|
|
279
|
+
### 第一阶段
|
|
280
|
+
|
|
281
|
+
- 固化资源类命令标准:`resource {list|create|update|delete}`
|
|
282
|
+
- 新增命令一律不再添加兼容入口
|
|
283
|
+
- 新增写命令一律支持 `--dry-run`
|
|
284
|
+
|
|
285
|
+
### 第二阶段
|
|
286
|
+
|
|
287
|
+
- 拆分 `cmd/query.go`
|
|
288
|
+
- 把包级 flag 变量逐步迁移到局部 options
|
|
289
|
+
- 统一 action 命名规范
|
|
290
|
+
|
|
291
|
+
### 第三阶段
|
|
292
|
+
|
|
293
|
+
- 建立命令树测试 helper
|
|
294
|
+
- 收敛命令文档单一来源
|
|
295
|
+
- 评估是否把 query 域拆成更细的资源树
|
|
296
|
+
|
|
297
|
+
## 当前建议
|
|
298
|
+
|
|
299
|
+
后续新增能力时,优先按下面顺序判断:
|
|
300
|
+
|
|
301
|
+
1. 这是系统命令、资源命令、工作流命令,还是只读查询命令?
|
|
302
|
+
2. 如果是资源能力,能否直接挂到已有资源树下?
|
|
303
|
+
3. 如果是写操作,`--dry-run` 输出应该长什么样?
|
|
304
|
+
4. 成功 envelope 的 `action` 是否和命令路径一致?
|
|
305
|
+
5. 文档是否同步到了命令参考和 skill 参考?
|
|
@@ -32,7 +32,7 @@ yxer skill sync [--global]
|
|
|
32
32
|
yxer accounts list [platform] [--name 关键词] [--status 1] [--page 1] [--size 20] [--all] [--json]
|
|
33
33
|
yxer accounts update <account_id> [--proxy-id ID] [--kuaidaili-area CODE] [--remark 文本] [--group ID] --dry-run
|
|
34
34
|
yxer accounts update <account_id> [--proxy-id ID] [--kuaidaili-area CODE] [--remark 文本] [--group ID]
|
|
35
|
-
yxer account-group list
|
|
35
|
+
yxer account-group list [--page 1] [--size 10]
|
|
36
36
|
yxer account-group create <name> [--visible-scope all|specific] [--visible-user USER_ID]... [--dry-run]
|
|
37
37
|
yxer account-group update <group_id> <name> [--visible-scope all|specific] [--visible-user USER_ID]... [--dry-run]
|
|
38
38
|
yxer account-group delete <group_id> [--dry-run]
|
|
@@ -44,7 +44,14 @@ yxer upload --url <resource_url> [--bucket cloud-publish|material-library] [--dr
|
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
yxer validate <platform> <type> <payload.json> [--publish-channel cloud|local] [--client-id <clientId>]
|
|
47
|
-
yxer publish <type> <platform> <payload.json> [clientId] [--dry-run]
|
|
47
|
+
yxer publish <type> <platform> <payload.json> [--publish-channel cloud|local] [--client-id <clientId>] [--dry-run]
|
|
48
|
+
yxer publish form start <platform> <type> [--output publish-form.json] [--dry-run]
|
|
49
|
+
yxer publish form inspect <session.json>
|
|
50
|
+
yxer publish form set <session.json> <payload.path> --value '<json-value-or-text>' [--index N] [--source-command <cmd>] [--dry-run]
|
|
51
|
+
yxer publish form choose <session.json> <field> --value-file <query.json> [--id <candidate_id>|--index N] [--account-id <id>] --source-command "yxer query ... --json" [--dry-run]
|
|
52
|
+
yxer publish form verify <session.json>
|
|
53
|
+
yxer publish form review <session.json> [--dry-run]
|
|
54
|
+
yxer publish form export <session.json> [--output payload.json] [--dry-run]
|
|
48
55
|
```
|
|
49
56
|
|
|
50
57
|
### 草稿与素材库
|
|
@@ -82,22 +89,27 @@ yxer schema get <platform> <type>
|
|
|
82
89
|
- 发布类型统一使用:`video`、`imageText`、`article`
|
|
83
90
|
- 单次 `yxer publish` 只处理一个平台
|
|
84
91
|
- `publish` 仅支持 `payload.json` 模式
|
|
85
|
-
-
|
|
92
|
+
- 新建或补字段时,先执行 `yxer prepare <platform> <type>` / `yxer publish form start` 和 `yxer schema fields <platform> <type>`;`schema fields` 默认返回扁平路径清单,只有需要完整 payload 骨架时再执行 `yxer schema get <platform> <type>`
|
|
86
93
|
- `payload.json` 只支持标准 `publishArgs` 结构,所有平台统一
|
|
87
94
|
- CLI 会根据 `publishArgs` 自动补齐最外层 `cover`、`coverKey`、`desc`、`isDraft`、`isAppContent`
|
|
88
95
|
- 云发布是默认模式
|
|
89
96
|
- 本机发布时必须提供 `clientId`
|
|
90
97
|
- `yxer validate`、`yxer publish --dry-run`、`yxer publish` 使用同一套发布通道解析逻辑
|
|
91
|
-
-
|
|
92
|
-
|
|
98
|
+
- `yxer publish --dry-run` 不创建发布任务;它返回最终请求预览,并在有 API key 的云发布场景执行账号/代理 preflight。local dry-run 不检测客户端在线状态。
|
|
99
|
+
- 本机发布推荐通过两种方式提供 `clientId`:
|
|
93
100
|
- flags:`yxer publish <type> <platform> <payload.json> --publish-channel local --client-id <clientId>`
|
|
94
101
|
- 预设默认值:`yxer config set-local-client-id <clientId>` 后,再执行 `--publish-channel local`
|
|
102
|
+
- 第四个位置参数属于旧版兼容,不再作为 Agent 推荐入口。
|
|
95
103
|
- 本机发布校验时,推荐在 `validate` 阶段就显式传入 `--publish-channel local`;若未显式传入但 payload 中已写 `publishChannel=local`,CLI 也会尝试从默认配置读取 `clientId`
|
|
96
104
|
- `yxer draft save` 只处理蚁小二内部草稿,不等同于平台草稿箱
|
|
97
105
|
- `yxer material create` 只做素材登记,前提是资源已经通过 `yxer upload --bucket material-library` 上传
|
|
98
106
|
- `yxer material add --file ...` 会自动完成上传和素材登记
|
|
99
107
|
- 查询类操作可以直接执行
|
|
100
|
-
-
|
|
108
|
+
- 已有完整标准 payload 时,发布类操作遵守“validate -> publish --dry-run -> 用户授权 -> publish”顺序;缺账号、字段、资源或动态对象时,先补“查账号 -> prepare/form/schema -> 上传资源 -> 查询复杂对象 -> 填 payload”。
|
|
109
|
+
- 页面式逐步填写可使用 `publish form` 会话;会话只负责本地状态,正式发布路径固定为 `publish form verify -> publish form export -> validate payload.json -> publish payload.json --dry-run -> publish payload.json`
|
|
110
|
+
- `publish form set` 只能写 `prepare` / `schema fields` / `fieldPlacements` 声明过的路径,不能用拼写不确定的路径试错。
|
|
111
|
+
- `publish form choose` 只用于 `dynamicFieldExamples` 声明的动态字段,必须带 `--source-command` 记录产生候选的 `yxer query ... --json` 命令;若 query 账号和目标账号不一致会被拒绝。
|
|
112
|
+
- `publish form verify`、`review`、`export` 会校验会话来源记录和当前 payload 是否一致;如果候选值被手工改写,需要重新执行 `set` 或 `choose`。
|
|
101
113
|
- 所有请求字段都必须来自 schema、平台文档或 CLI 返回结果;严禁虚构字段、乱猜枚举、手写 `raw` 对象或编造资源元数据
|
|
102
114
|
|
|
103
115
|
## 快速示例
|
|
@@ -202,6 +214,7 @@ yxer publish video 抖音 .\payload.json --publish-channel local --client-id <cl
|
|
|
202
214
|
- 用户未指定“本机发布 / 本地发布 / 客户端发布”时,Agent 应默认使用云发布。
|
|
203
215
|
- 用户明确要求本机发布,或说明要走本机客户端/本机网络时,Agent 必须显式传 `--publish-channel local`,不要只在说明文字里表达。
|
|
204
216
|
- 若云发布返回“账号代理不存在”等代理相关错误,可建议切换到本机发布。
|
|
217
|
+
- CLI 默认只返回本机发布 `nextCommand`,不会自动切换通道;`--auto-fallback-local` 属于用户明确授权后的高级选项,不作为 Agent 默认路径。
|
|
205
218
|
- 若本机发布返回“客户端不在线”或“获取在线设备列表失败”,可建议用户启动蚁小二客户端,或改回云发布。
|
|
206
219
|
|
|
207
220
|
## 输出约定
|
|
@@ -211,8 +224,8 @@ yxer publish video 抖音 .\payload.json --publish-channel local --client-id <cl
|
|
|
211
224
|
- 成功输出格式:`ok/action/version/data`
|
|
212
225
|
- 失败输出格式:`ok/version/error`
|
|
213
226
|
- 错误通过统一错误 envelope 输出
|
|
214
|
-
- `yxer doctor` 可能返回 `_notice.skills`,提示当前 AI skill 与 CLI
|
|
215
|
-
- `yxer update`
|
|
227
|
+
- `yxer doctor` 可能返回 `_notice.skills`,提示当前 AI skill 与 CLI 版本不同步,并建议优先执行 `yxer update`
|
|
228
|
+
- `yxer update` 是当前推荐的统一入口:会检查 CLI 安装方式、在 npm 安装场景下升级 CLI,并同步 AI skill
|
|
216
229
|
|
|
217
230
|
## 入口约束
|
|
218
231
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 发布通道说明
|
|
2
|
+
|
|
3
|
+
`yxer publish` 支持两种发布通道:云发布 `cloud` 和本机发布 `local`。通道会影响任务由云端代理执行,还是由用户本机客户端执行。
|
|
4
|
+
|
|
5
|
+
## 通道定义
|
|
6
|
+
|
|
7
|
+
| 通道 | 值 | 执行位置 | 默认 |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| 云发布 | `cloud` | 蚁小二云端服务 | 是 |
|
|
10
|
+
| 本机发布 | `local` | 用户本机蚁小二客户端 | 否 |
|
|
11
|
+
|
|
12
|
+
用户未明确指定时,CLI 默认使用 `cloud`。本机发布必须显式使用 `--publish-channel local`,并提供可用的 `clientId`。
|
|
13
|
+
|
|
14
|
+
## 参数来源优先级
|
|
15
|
+
|
|
16
|
+
发布通道只在当前命令执行时解析一次,优先级如下:
|
|
17
|
+
|
|
18
|
+
1. 显式 flag:`--publish-channel cloud|local`
|
|
19
|
+
2. 旧版第四位置参数:仅在已明确为 `local` 时兼容读取 `clientId`
|
|
20
|
+
3. payload 字段:`publishChannel` / `clientId`
|
|
21
|
+
4. 本地配置:`yxer config set-local-client-id <clientId>`,仅用于本机发布的 `clientId`
|
|
22
|
+
5. 默认值:`cloud`
|
|
23
|
+
|
|
24
|
+
云发布会移除 `clientId`,避免把本机连接信息带入云端请求。第四位置参数只为旧版兼容保留,新流程应使用 `--publish-channel local --client-id <clientId>`。
|
|
25
|
+
|
|
26
|
+
## 推荐命令
|
|
27
|
+
|
|
28
|
+
云发布:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yxer validate 抖音 video .\payload.json
|
|
32
|
+
yxer publish video 抖音 .\payload.json --dry-run
|
|
33
|
+
yxer publish video 抖音 .\payload.json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
本机发布:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
yxer validate 抖音 video .\payload.json --publish-channel local --client-id <clientId>
|
|
40
|
+
yxer publish video 抖音 .\payload.json --publish-channel local --client-id <clientId> --dry-run
|
|
41
|
+
yxer publish video 抖音 .\payload.json --publish-channel local --client-id <clientId>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
如果已经配置默认本机客户端:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yxer config set-local-client-id <clientId>
|
|
48
|
+
yxer validate 抖音 video .\payload.json --publish-channel local
|
|
49
|
+
yxer publish video 抖音 .\payload.json --publish-channel local --dry-run
|
|
50
|
+
yxer publish video 抖音 .\payload.json --publish-channel local
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Dry-run 元数据
|
|
54
|
+
|
|
55
|
+
`yxer publish --dry-run` 会返回最终请求和通道解析结果。发布前应检查:
|
|
56
|
+
|
|
57
|
+
| 字段 | 含义 |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `data.meta.effectivePublishChannel` | 最终生效通道 |
|
|
60
|
+
| `data.meta.publishChannelSource` | 通道来源:`flag`、`payload`、`positional`、`default` |
|
|
61
|
+
| `data.meta.clientIdSource` | `clientId` 来源:`flag`、`payload`、`positional`、`config`、`none` |
|
|
62
|
+
| `data.meta.requestHash` | 最终请求指纹,用于确认 dry-run 和正式发布使用同一份请求 |
|
|
63
|
+
|
|
64
|
+
`validate`、`publish --dry-run` 和正式 `publish` 必须使用同一份 `payload.json` 和同一套通道参数。
|
|
65
|
+
|
|
66
|
+
## 失败与回退
|
|
67
|
+
|
|
68
|
+
- 云发布报账号代理、云端代理或代理不存在问题时,可以提示用户检查代理配置,或在用户确认后改为本机发布。
|
|
69
|
+
- 本机发布报客户端不在线、获取在线设备失败时,应提示用户启动并登录蚁小二客户端,或在用户确认后改回云发布。
|
|
70
|
+
- `--auto-fallback-local` 不作为默认路径,只能在用户明确授权自动切换到本机发布时使用。
|
|
71
|
+
|
|
72
|
+
## 禁止行为
|
|
73
|
+
|
|
74
|
+
- 用户明确要求本机发布时仍默认走 `cloud`
|
|
75
|
+
- 本机发布缺少 `clientId`
|
|
76
|
+
- `validate`、`publish --dry-run`、正式 `publish` 使用不同通道参数
|
|
77
|
+
- 根据服务端默认值猜测通道,而不是以 CLI 解析结果为准
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
## 优先读取
|
|
8
8
|
|
|
9
|
-
1. [`../
|
|
10
|
-
2. [`../
|
|
9
|
+
1. [`../protocols/execution.md`](../protocols/execution.md)
|
|
10
|
+
2. [`../protocols/confirmation.md`](../protocols/confirmation.md)
|
|
11
|
+
3. [`../protocols/error-recovery.md`](../protocols/error-recovery.md)
|
|
12
|
+
4. [`../yixiaoer-shared.md`](../yixiaoer-shared.md)
|
|
13
|
+
5. [`../workflows/account-selection.md`](../workflows/account-selection.md)
|
|
11
14
|
|
|
12
15
|
## 常用命令
|
|
13
16
|
|
|
@@ -36,4 +39,5 @@ yxer skill sync [--global]
|
|
|
36
39
|
- `yxer accounts update` 是写操作,正式执行前必须先用同一参数执行 `--dry-run`
|
|
37
40
|
- 涉及账号分组的 `visibleUsers`、指定成员可见、按成员挑选负责人时,先执行 `yxer query members` 获取真实成员 ID
|
|
38
41
|
- 命中多个账号时,结构化列出候选并让用户确认;只有一个可用账号时可自动选中并说明
|
|
42
|
+
- 查询或更新账号配置时,按执行协议记录当前状态;任何写操作失败后按错误恢复协议处理,不直接重复执行
|
|
39
43
|
- 用户明确说“先不要发布,只查环境/账号”时,完成本域后直接停下,不擅自继续发布流程
|