@yizhuan-cli/cli 0.1.11 → 0.1.13
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 +2 -2
- package/package.json +1 -1
- package/resources/yizhuan-cli/SKILL.md +1 -0
- package/resources/yizhuan-cli/manifest.json +4 -4
- package/src/doctor.js +2 -2
- package/src/index.js +3 -0
package/README.md
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
需要 Node.js 22 或更高版本。
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @yizhuan-cli/cli@0.1.
|
|
10
|
+
npm install -g @yizhuan-cli/cli@0.1.13
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
如果发布在私有 npm registry,请加上对应 registry:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install -g @yizhuan-cli/cli@0.1.
|
|
16
|
+
npm install -g @yizhuan-cli/cli@0.1.13 --registry=https://your-private-registry.example
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## 配置
|
package/package.json
CHANGED
|
@@ -67,6 +67,7 @@ yizhuan doctor
|
|
|
67
67
|
- `author_search` 返回的 `extAuthorId` 是平台外部作者 ID,不是易撰内部 `authorId`。需要按外部 ID 查询作品时只能传 `extAuthorId` / `ext_author_id`(兼容 `author_id`),必须同时提供 `platform`,由服务端完成内部 ID 转换;禁止把它直接作为内部 `authorId` 使用。
|
|
68
68
|
- 公开作者结果中的 `workCount: 0` 可能是上游未返回作品数后的缺省值,不代表作者没有作品;是否有作品必须以 `works_search` 的结果为准。
|
|
69
69
|
- 作品复合筛选优先使用统一协议 `intent=works_search`。平台使用 `platform`,分类使用 `categories`,内容类型使用 `content_type`,最低阅读/播放和评论分别使用 `min_views`、`min_comments`;需要固定顺序时显式传 `sort_by` 和 `order`。不得把作品查询改成作者、雷达或热点查询。
|
|
70
|
+
- 当前 CLI 不支持按单篇作品 URL 或平台侧 `articleId` 精确查询作品详情。用户提供作品链接或文章 ID 时,直接说明该能力暂不支持;不得将完整链接或纯文章 ID 改作 `keyword` 搜索,也不得把这种搜索返回的 `empty` 解读为全网不存在该作品。
|
|
70
71
|
- 作品查询返回后必须逐项核对用户要求的分类、类型和指标阈值;低于阈值或缺少必要指标的项目不得作为符合条件的结果展示,也不得擅自放宽条件。展示总数必须使用返回的 `data.total`,不能把当前页条数当成总数。
|
|
71
72
|
- 作者累计指标筛选使用 `author_query`,不得改成作品指标或擅自降低阈值。必须逐项映射用户给出的所有条件:粉丝使用 `min_follower` / `max_follower`,点赞使用 `min_total_likes` / `max_total_likes`,阅读使用 `min_total_views` / `max_total_views`,关注使用 `min_friends` / `max_friends`,作品数使用 `min_work_count` / `max_work_count`;复合条件不得遗漏任何字段。例如“百家号粉丝大于50万,点赞大于10万”必须同时传 `platform_id:2`、`min_follower:500000` 和 `min_total_likes:100000`。
|
|
72
73
|
- 作者指标查询返回后,必须核对 `data.items` 中所有已请求指标。指标缺失、显示“暂未返回”或低于/高于用户阈值的项目不得作为符合条件的结果展示;一旦发现此类项目,必须先检查实际请求参数是否遗漏对应的 min/max 字段并使用完整参数重新查询,禁止直接报告原总数。
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "yizhuan-cli",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"compatibleCliVersion": "0.1.
|
|
6
|
-
"source": "npm:@yizhuan-cli/cli@0.1.
|
|
4
|
+
"version": "0.1.13",
|
|
5
|
+
"compatibleCliVersion": "0.1.13",
|
|
6
|
+
"source": "npm:@yizhuan-cli/cli@0.1.13",
|
|
7
7
|
"digestAlgorithm": "sha256",
|
|
8
8
|
"files": [
|
|
9
9
|
{
|
|
10
10
|
"path": "SKILL.md",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "4fcca6c6a4bc98ffabab267174bf369e617e58f2bd297b20132d29138fdcad19"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/src/doctor.js
CHANGED
|
@@ -53,9 +53,9 @@ export function inspectLocalEnvironment(
|
|
|
53
53
|
? check('pass', 'node', `Node.js ${nodeVersion} 满足 >=${minimumNode}`)
|
|
54
54
|
: check('fail', 'node', `Node.js ${nodeVersion} 不满足 ${packageJson.engines?.node || '版本要求'}`, `安装 Node.js ${minimumNode || 22} 或更高版本。`))
|
|
55
55
|
|
|
56
|
-
checks.push(packageJson.version === '0.1.
|
|
56
|
+
checks.push(packageJson.version === '0.1.13'
|
|
57
57
|
? check('pass', 'cli_version', `CLI ${packageJson.version}`)
|
|
58
|
-
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.
|
|
58
|
+
: check('fail', 'cli_version', `CLI 版本为 ${packageJson.version},预期 0.1.13`, '安装 @yizhuan-cli/cli@0.1.13。'))
|
|
59
59
|
|
|
60
60
|
if (!exists(configPath)) {
|
|
61
61
|
checks.push(check('fail', 'config', `配置不存在:${configPath}`, '运行 yizhuan config init。'))
|
package/src/index.js
CHANGED
|
@@ -77,6 +77,9 @@ Notes:
|
|
|
77
77
|
- --json-file 是唯一参数源,不能与 --params、--query 或独立参数混用
|
|
78
78
|
- bash/zsh 也可用:--params '{"platform":"douyin"}' 或 --platform douyin
|
|
79
79
|
- 兼容 key=value:--params platform=douyin
|
|
80
|
+
- 统一 query 快照默认缓存 5 分钟;重复查询返回 isCached=true,并保留首次抓取的 fetchedAt
|
|
81
|
+
- 需要绕过快照缓存时,在 query JSON 中传 forceRefresh=true;响应会返回 cacheTtlSeconds 和 cacheExpiresAt
|
|
82
|
+
- 5 分钟是 CLI 快照缓存期限,不代表平台阅读、点赞等指标的上游更新频率;指标更新时间以平台实际返回为准
|
|
80
83
|
|
|
81
84
|
Abilities:
|
|
82
85
|
works 作品查询
|