@klarkxy/dsh-zhihu 0.2.1 → 0.2.3
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 +36 -84
- package/docs/README.zh-CN.md +37 -92
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,117 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Zhihu
|
|
2
2
|
|
|
3
3
|
<!-- release-state-note -->
|
|
4
|
-
The [repository registry](../../README.md#plugin-lifecycle) tracks Draft → Testing → Published, moving forward only. Fixes, testing and version updates keep published packages Published; each update still passes release checks. First publication explicitly selects Testing packages and records Published only after npm archive verification. See the [release guide](../../RELEASING.md).
|
|
5
|
-
|
|
6
|
-
Hand Zhihu to the agent as a research source: in-site search, global web search, the hot list, 直答 AI answers and public knowledge bases, plus question discovery, creator statistics and usage tracking. Every call uses your own Zhihu Access Secret, and what comes back is reference material for the agent, not a settled verdict.
|
|
7
4
|
|
|
8
5
|
[简体中文](docs/README.zh-CN.md)
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
Use Zhihu as a research source for the model: site search, web search, the hot list, Zhida answers, knowledge bases, question discovery, and creator statistics. Every request uses your own Zhihu Access Secret. Results are reference material, not conclusions.
|
|
11
8
|
|
|
12
9
|
## Install
|
|
13
10
|
|
|
14
|
-
Install the published package into the target profile:
|
|
15
|
-
|
|
16
11
|
```sh
|
|
17
12
|
dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
18
13
|
```
|
|
19
14
|
|
|
20
|
-
Replace `web` with your profile name
|
|
15
|
+
Replace `web` with your profile name and restart DSH Web. Use the full scoped name; the unscoped `dsh-zhihu` belongs to someone else.
|
|
21
16
|
|
|
22
17
|
## Use
|
|
23
18
|
|
|
24
|
-
**Plugins →
|
|
25
|
-
|
|
26
|
-
## Agent tools
|
|
27
|
-
|
|
28
|
-
To enable the agent tools, add this entry to the plugin list in the `agent.cordis.yml` you use:
|
|
29
|
-
|
|
30
|
-
```yaml
|
|
31
|
-
- name: '@klarkxy/dsh-zhihu/tools'
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Twelve tools are available once that entry is enabled. The five existing tools are unchanged:
|
|
35
|
-
|
|
36
|
-
- `zhihu_search`: search within Zhihu for community evidence; results are community/reader feedback only, never canon, and never written into project files.
|
|
37
|
-
- `zhihu_global_search`: search the wider web beyond Zhihu through the open platform's global search; reference only.
|
|
38
|
-
- `zhihu_hot_list`: pull the Zhihu hot list to see current community trends; reference for topics and hotspots only.
|
|
39
|
-
- `zhihu_ask`: ask Zhihu 直答, an OpenAI-compatible AI answer service grounded in Zhihu community content; suited for research and background investigation.
|
|
40
|
-
- `zhihu_knowledge_search`: retrieve RAG fragments from Zhihu knowledge bases — public bases by default, with personal and subscription recall scopes available after you upload material on Zhihu's web side.
|
|
41
|
-
|
|
42
|
-
### Question discovery and creator data
|
|
43
|
-
|
|
44
|
-
Aligned with [zhihu-search PR #4](https://github.com/klarkxy/zhihu-search/pull/4) and upstream `main` at `62fd3ce5c5761dd217094280390b394e4eb77ed2` (2026-09-28). All seven additions use **only the current Access Secret**. They neither accept an OAuth identity switch nor expose credentials as tool parameters.
|
|
45
|
-
|
|
46
|
-
| Agent tool | RPC endpoint on `/zhihu` | Parameters | Official quota |
|
|
47
|
-
| --- | --- | --- | --- |
|
|
48
|
-
| `zhihu_question_recommendations` | `question.recommendations` | Optional `query`; `count` 1–20, default 5 | `question_discovery` |
|
|
49
|
-
| `zhihu_question_answers` | `question.answers` | `questionUrl`; `offset`, `limit` | `question_discovery` |
|
|
50
|
-
| `zhihu_user_content_detail` | `content.detail` | `contentUrl` | `creator` |
|
|
51
|
-
| `zhihu_user_content_comments` | `content.comments` | `contentUrl`; `offset`, `limit`; `order`: `score` (default), `reverse`, `ascending` | `creator` |
|
|
52
|
-
| `zhihu_creator_account_stats` | `creator.account.stats` | `contentType`: `all` (default), `answer`, `article`, `pin`, `zvideo`; paired dates | `creator` |
|
|
53
|
-
| `zhihu_creator_content_stats` | `creator.content.stats` | `contentUrl`; paired dates | `creator` |
|
|
54
|
-
| `zhihu_quota` | `quota` | Optional `apiIds` array; omit or `[]` for all | None |
|
|
55
|
-
|
|
56
|
-
The service also accepts upstream-style underscore aliases such as `question_recommendations`, `question_answers`, `content_detail`, `content_comments`, `creator_account_stats`, and `creator_content_stats` (plus `user_content_detail` / `user_content_comments`). Parameter names remain camelCase as shown above.
|
|
57
|
-
|
|
58
|
-
Omit `query` to get profile-based recommendations. An explicitly empty or whitespace-only theme is rejected. Recommendations do not paginate. `questionUrl` must be an HTTPS `www.zhihu.com/question/{id}` link. `contentUrl` must be a Zhihu answer, column article, pin, or video link; creator endpoints apply only to content published by the current account. Video details contain associated text, not video files.
|
|
59
|
-
|
|
60
|
-
Paged tools accept `offset` as a non-negative Int64 **decimal string**, default `"0"`; RPC also accepts safe JavaScript integers. `limit` is an integer from 1 to 50, default 20. Every call fetches one page. Only continue when `paging.canContinue` is true, using its `nextOffset` verbatim. A short or empty page is not the end; a missing, invalid, non-advancing, or unsafe numeric `NextOffset` stops pagination with a warning. Never derive the next offset from item counts. `Totals` may include filtered answers; `Summary` is an upstream excerpt, not full text or a newly generated AI summary. Attached comment `Children` may be incomplete.
|
|
19
|
+
Open **Plugins → Zhihu** and enter your Access Secret under **Settings**. The other tabs are:
|
|
61
20
|
|
|
62
|
-
|
|
21
|
+
- **Stats**: local daily calls, failures, and results;
|
|
22
|
+
- **Official quota**: your remaining free allowance as reported by Zhihu;
|
|
23
|
+
- **Knowledge base**: upload and search reference files;
|
|
24
|
+
- **Test**: run any search or query by hand.
|
|
63
25
|
|
|
64
|
-
|
|
26
|
+
With the Web Search plugin installed, Zhihu web search also appears in its provider list.
|
|
65
27
|
|
|
66
|
-
|
|
28
|
+
## Give the tools to the model
|
|
67
29
|
|
|
68
|
-
|
|
30
|
+
Add this to the plugin list of the `agent.cordis.yml` you use:
|
|
69
31
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Works with the web search manager
|
|
73
|
-
|
|
74
|
-
When this profile provides `ctx.web`, the plugin registers **Zhihu global search** directly with the host, independently of the search manager. If [@klarkxy/dsh-web-search-manager](https://www.npmjs.com/package/@klarkxy/dsh-web-search-manager) is installed, it discovers the provider for enablement and ordering. Configure the Access Secret in Zhihu settings; the Zhihu plugin resolves it per request and refreshes local availability after credential changes. The dedicated Zhihu tools work independently.
|
|
75
|
-
|
|
76
|
-
## Boundaries and limits
|
|
77
|
-
|
|
78
|
-
- Search covers Zhihu in-site search, the wider web, the hot list, Zhihu 直答 AI answers, and public knowledge bases.
|
|
79
|
-
- Uploaded reference files are stored in Zhihu's cloud; do not upload unpublished manuscripts.
|
|
80
|
-
- This sync does not cover all upstream CLI/MCP features, such as OAuth identity management or PDF/PPT tasks.
|
|
81
|
-
- The client accepts structural host controls and has native HTML fallbacks. Building or using this package does not require application-private UI packages.
|
|
82
|
-
- Existing agent tools, credentials, RPC contracts and storage identifiers are preserved; the additions above are additive.
|
|
83
|
-
|
|
84
|
-
## Development
|
|
85
|
-
|
|
86
|
-
Read [contracts](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/contracts.ts), [tools](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/tools.ts), and [open-platform client](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/open-platform.ts) for the API. The seven additions cover the six question/creator endpoints plus official quota.
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
pnpm --filter @klarkxy/dsh-zhihu typecheck
|
|
90
|
-
pnpm --filter @klarkxy/dsh-zhihu test
|
|
91
|
-
pnpm --filter @klarkxy/dsh-zhihu build
|
|
32
|
+
```yaml
|
|
33
|
+
- name: '@klarkxy/dsh-zhihu/tools'
|
|
92
34
|
```
|
|
93
35
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
## Call and cost protection (2026-10-13)
|
|
36
|
+
The model then gets these tools:
|
|
98
37
|
|
|
99
|
-
|
|
38
|
+
| Tool | Purpose |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `zhihu_search`, `zhihu_global_search`, `zhihu_hot_list` | Zhihu search, web search, hot list |
|
|
41
|
+
| `zhihu_ask` | Zhida AI answers based on Zhihu content |
|
|
42
|
+
| `zhihu_knowledge_search` | Search knowledge bases |
|
|
43
|
+
| `zhihu_question_recommendations`, `zhihu_question_answers` | Find questions and read answer summaries |
|
|
44
|
+
| `zhihu_user_content_detail`, `zhihu_user_content_comments` | Read your own published content and its comments |
|
|
45
|
+
| `zhihu_creator_account_stats`, `zhihu_creator_content_stats` | Your creator statistics |
|
|
46
|
+
| `zhihu_quota` | Check official quota |
|
|
100
47
|
|
|
101
|
-
|
|
48
|
+
## Cost protection
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Plugin row configuration accepts `allowPaid` (default false) and `dailyCallLimit` (default 100), overriding the server environment `ZHIHU_ALLOW_PAID` and `ZHIHU_DAILY_CALL_LIMIT`. Reload using the host's normal configuration workflow. The Settings tab shows the active policy; business RPC/tool arguments cannot opt into paid use. `policy.status` is local and does not query Zhihu.
|
|
50
|
+
By default the plugin only uses Zhihu's free allowance: before each request it checks the official quota and skips the request if none is left. It also stops after 100 requests per day (Beijing time). Both can be changed in the plugin configuration:
|
|
106
51
|
|
|
107
52
|
```yaml
|
|
108
53
|
config:
|
|
109
54
|
allowPaid: false
|
|
110
|
-
dailyCallLimit:
|
|
55
|
+
dailyCallLimit: 100
|
|
111
56
|
```
|
|
112
57
|
|
|
113
|
-
|
|
58
|
+
Paid use is allowed only when you set `allowPaid: true` yourself.
|
|
59
|
+
|
|
60
|
+
## Limits
|
|
61
|
+
|
|
62
|
+
- Zero cost is not guaranteed: other clients on the same account can use up the free allowance first.
|
|
63
|
+
- Uploaded files are stored on Zhihu's servers; do not upload unpublished manuscripts. Each file is limited to 20 MB.
|
|
64
|
+
- Requests are never retried automatically.
|
|
65
|
+
- Not included: OAuth account switching, top-ups, or wallet queries.
|
|
114
66
|
|
|
115
|
-
|
|
67
|
+
## License
|
|
116
68
|
|
|
117
|
-
|
|
69
|
+
[SATA License 2.1](LICENSE)
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -1,124 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 知乎
|
|
2
2
|
|
|
3
3
|
<!-- release-state-note -->
|
|
4
|
-
插件生命周期见[仓库状态清单](../../../README.zh-CN.md#插件生命周期):草稿 → 测试中 → 已发布,只向前推进。已发布插件的修复、测试和升版保持已发布;每次更新仍须通过发布检查。首次发布须明确选择测试中的包,并在 npm 归档验证成功后登记。详见[发布规则](../../../RELEASING.zh-CN.md)。
|
|
5
|
-
|
|
6
|
-
把知乎交给模型当调研信源:站内搜索、全网搜索、热榜、直答和公开知识库,外加问题发现、创作数据与用量统计。每次请求都只用你自己的知乎 Access Secret,取回的内容是给模型参考的资料,不是定论。
|
|
7
4
|
|
|
8
5
|
[English](../README.md)
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
把知乎交给模型当调研信源:站内搜索、全网搜索、热榜、知乎直答、知识库、问题发现和创作数据。每次请求都只用你自己的知乎 Access Secret;取回的内容是参考资料,不是定论。
|
|
11
8
|
|
|
12
9
|
## 安装
|
|
13
10
|
|
|
14
|
-
把已发布包装进目标 profile:
|
|
15
|
-
|
|
16
11
|
```sh
|
|
17
12
|
dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
18
13
|
```
|
|
19
14
|
|
|
20
|
-
把 `web` 换成你的 profile
|
|
15
|
+
把 `web` 换成你的 profile 名,重启 DSH Web。请使用完整的 scoped 包名;无 scope 的 `dsh-zhihu` 属于其他维护者。
|
|
21
16
|
|
|
22
17
|
## 使用
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## 模型工具
|
|
27
|
-
|
|
28
|
-
模型需要使用知乎工具时,在所用 `agent.cordis.yml` 的插件列表加入:
|
|
29
|
-
|
|
30
|
-
```yaml
|
|
31
|
-
- name: '@klarkxy/dsh-zhihu/tools'
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
加入后,模型可使用十二个工具。原有五个工具保持兼容:
|
|
35
|
-
|
|
36
|
-
- `zhihu_search`:知乎站内搜索,拉取社区证据;结果仅作社区/读者反馈参考,不构成 canon,也不直接写入项目文件。
|
|
37
|
-
- `zhihu_global_search`:知乎开放平台全网搜索,检索站外公开网页资料;仅作参考。
|
|
38
|
-
- `zhihu_hot_list`:拉取知乎热榜,了解当前社区热点;仅作题材与热点参考。
|
|
39
|
-
- `zhihu_ask`:调用知乎直答(OpenAI 兼容的 AI 问答),基于知乎社区内容生成综合回答;适合考据与背景调研。
|
|
40
|
-
- `zhihu_knowledge_search`:检索知乎知识库(RAG 片段),默认只查公开库;在知乎网页端上传过个人资料后可加个人/订阅召回范围。
|
|
41
|
-
|
|
42
|
-
### 问题发现与创作能力
|
|
43
|
-
|
|
44
|
-
对齐 [zhihu-search PR #4](https://github.com/klarkxy/zhihu-search/pull/4) 和主库 `main` 的 `62fd3ce5c5761dd217094280390b394e4eb77ed2`(2026-09-28)。以下新增接口**只使用当前 Access Secret**,不接受 OAuth 身份切换,模型参数中不暴露密钥。
|
|
45
|
-
|
|
46
|
-
| 模型工具 | `/zhihu` 上的 RPC 端点 | 参数 | 官方额度分类 |
|
|
47
|
-
| --- | --- | --- | --- |
|
|
48
|
-
| `zhihu_question_recommendations` | `question.recommendations` | 可选 `query`;`count` 1–20,默认 5 | `question_discovery` |
|
|
49
|
-
| `zhihu_question_answers` | `question.answers` | `questionUrl`;`offset`、`limit` | `question_discovery` |
|
|
50
|
-
| `zhihu_user_content_detail` | `content.detail` | `contentUrl` | `creator` |
|
|
51
|
-
| `zhihu_user_content_comments` | `content.comments` | `contentUrl`;`offset`、`limit`;`order` 为 `score`(默认)、`reverse`、`ascending` | `creator` |
|
|
52
|
-
| `zhihu_creator_account_stats` | `creator.account.stats` | `contentType` 为 `all`(默认)、`answer`、`article`、`pin`、`zvideo`;成对日期 | `creator` |
|
|
53
|
-
| `zhihu_creator_content_stats` | `creator.content.stats` | `contentUrl`;成对日期 | `creator` |
|
|
54
|
-
| `zhihu_quota` | `quota` | 可选 `apiIds` 数组,省略或 `[]` 查全部 | 不消耗业务额度 |
|
|
55
|
-
|
|
56
|
-
RPC 还接受主库风格的下划线别名:`question_recommendations`、`question_answers`、`content_detail`、`content_comments`、`creator_account_stats`、`creator_content_stats`,以及 `user_content_detail` / `user_content_comments`。参数名仍使用表中的 camelCase。
|
|
57
|
-
|
|
58
|
-
省略 `query` 才按当前账号画像推荐;显式空字符串或纯空白主题会被拒绝。推荐不分页。`questionUrl` 必须是 HTTPS `www.zhihu.com/question/{id}` 问题链接。`contentUrl` 仅支持知乎回答、专栏文章、想法或视频链接;创作接口仅查询当前账号已发布的内容,视频仅返回关联正文,不返回视频文件。
|
|
59
|
-
|
|
60
|
-
分页工具的 `offset` 使用非负 Int64 **十进制字符串**,默认 `"0"`;RPC 也接受 JavaScript 安全整数。`limit` 为 1–50 的整数,默认 20。每次只取一页,只有 `paging.canContinue=true` 才原样使用其 `nextOffset` 继续。空页或条目不足不能视为结束;`NextOffset` 缺失、无效、未前进或为不安全的数值时,返回警告并停止翻页,不按条目数补偏移。`Totals` 可能包含被过滤的回答;`Summary` 是上游摘要/截取文本,不是全文,也不是额外生成的 AI 摘要。评论附带的 `Children` 不保证完整。
|
|
61
|
-
|
|
62
|
-
统计日期 `startDate` / `endDate` 必须同时提供或同时省略,格式为有效公历 `YYYY-MM-DD`,结束日期不得早于开始日期。省略时采用上游默认范围,不自行指定天数。缺失指标不补零,比例不换算百分比。新增结果包含 `version`、`operation`、`data`、可选 `quotaId` 与安全分页信息 `paging`。结构化 `data` 保留上游字段及原始 HTML;工具展示清洗 HTML 后放入不会执行的文本代码块。缺少或为空的 `Body` 不能视为全文。
|
|
63
|
-
|
|
64
|
-
### 官方额度与本地用量
|
|
65
|
-
|
|
66
|
-
`zhihu_quota` 调用 `GET /api/v1/quota`,是官方剩余额度的唯一来源。`apiIds` 白名单为 `global_search`、`zhihu_search`、`hot_list`、`question_discovery`、`zhida_openai`、`tools`、`knowledge`、`user_data`、`creator`;重复项按首次出现顺序去重。额度查询本身不记录业务调用事件,失败时也不计入。不会用本地计数预测余额或推算额度重置时间,也不自动重试。
|
|
19
|
+
打开「插件 → 知乎」,在「设置」中填写 Access Secret。其他页签:
|
|
67
20
|
|
|
68
|
-
|
|
21
|
+
- **统计**:本机记录的每日调用、失败和结果条数;
|
|
22
|
+
- **官方用量**:知乎返回的剩余免费额度;
|
|
23
|
+
- **知识库**:上传并检索参考文件;
|
|
24
|
+
- **测试**:手动执行各类搜索和查询。
|
|
69
25
|
|
|
70
|
-
|
|
26
|
+
安装了网页搜索插件时,「知乎全网搜索」也会出现在它的服务列表中。
|
|
71
27
|
|
|
72
|
-
##
|
|
28
|
+
## 让模型使用
|
|
73
29
|
|
|
74
|
-
|
|
30
|
+
在所用 `agent.cordis.yml` 的插件列表中加入:
|
|
75
31
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- 可查询站内、全网、热榜、直答和公开知识库。
|
|
79
|
-
- 上传的参考文件保存在知乎云端,请勿上传未发表手稿。
|
|
80
|
-
- 此次同步不代表主库的全部 CLI/MCP 能力都已移植;OAuth 身份管理、PDF/PPT 任务等不在本次范围。
|
|
81
|
-
- 客户端接收宿主提供的结构化控件,缺失时使用原生 HTML 控件。构建和使用本包不依赖应用私有 UI 包。
|
|
82
|
-
- 原有 Agent 工具、凭据、RPC 合同和存储标识保持兼容,上述能力为增量扩展。
|
|
83
|
-
|
|
84
|
-
## 开发
|
|
85
|
-
|
|
86
|
-
接口见 [contracts](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/contracts.ts)、[tools](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/tools.ts) 与 [开放平台客户端](https://github.com/klarkxy/dsh-plugins/blob/main/plugins/dsh-zhihu/src/open-platform.ts)。七个新增接口覆盖六个问题发现/创作端点及官方额度。
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
pnpm --filter @klarkxy/dsh-zhihu typecheck
|
|
90
|
-
pnpm --filter @klarkxy/dsh-zhihu test
|
|
91
|
-
pnpm --filter @klarkxy/dsh-zhihu build
|
|
32
|
+
```yaml
|
|
33
|
+
- name: '@klarkxy/dsh-zhihu/tools'
|
|
92
34
|
```
|
|
93
35
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
## 调用与费用保护(2026-10-13)
|
|
36
|
+
模型会获得以下工具:
|
|
98
37
|
|
|
99
|
-
|
|
38
|
+
| 工具 | 用途 |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `zhihu_search`、`zhihu_global_search`、`zhihu_hot_list` | 知乎站内搜索、全网搜索、热榜 |
|
|
41
|
+
| `zhihu_ask` | 基于知乎内容的直答 |
|
|
42
|
+
| `zhihu_knowledge_search` | 检索知识库 |
|
|
43
|
+
| `zhihu_question_recommendations`、`zhihu_question_answers` | 发现问题、读取回答摘要 |
|
|
44
|
+
| `zhihu_user_content_detail`、`zhihu_user_content_comments` | 读取自己已发布的内容及评论 |
|
|
45
|
+
| `zhihu_creator_account_stats`、`zhihu_creator_content_stats` | 自己的创作数据 |
|
|
46
|
+
| `zhihu_quota` | 查询官方额度 |
|
|
100
47
|
|
|
101
|
-
|
|
48
|
+
## 费用保护
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
两个客户端共用 `~/.config/zhihu-search/call-policy/daily.json` 和 `request.lock`;`ZHIHU_SEARCH_HOME` 可改变根目录,`ZHIHU_CALL_POLICY_DIR` 可显式指定共同保护目录。同目录内所有账号/进程共用一个本地上限,避免多 Secret 或多入口绕开计数;自定义目录时需让两项目使用同一路径。锁覆盖预查与请求,状态先原子预留,不缓存额度、不自动重试。网络失败或取消后的未知请求保守占用对应免费容量,跨日仍保留这些未知预留。
|
|
106
|
-
|
|
107
|
-
本地保护**不能承诺绝对零费用**:同账号其他客户端可能在预查后竞争免费额度,平台扣费时间也不由本机控制。结果未知时先在官方控制台核对,不盲目重试。进程崩溃留下的锁不会自动抢占;确认两个客户端均无在途请求、核对未知请求后才可手动移除 `request.lock`。损坏的计数文件会失败关闭,不自动清零。
|
|
108
|
-
|
|
109
|
-
鉴权和账号设置保持不变。不提供充值、权益兑换或钱包查询。官方依据:[服务价格](https://developer.zhihu.com/docs?key=billing_price)、[免费额度](https://developer.zhihu.com/docs?key=quota)、[线上订购协议](https://developer.zhihu.com/content/order-agreement)(V1.0,2026-10-10 生效)。API 计费不扩大内容访问或传播授权范围。
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### DSH 配置
|
|
113
|
-
|
|
114
|
-
插件行配置支持 `allowPaid`(默认 false)和 `dailyCallLimit`(默认 100);也可在 DSH 服务端启动环境设置 `ZHIHU_ALLOW_PAID`、`ZHIHU_DAILY_CALL_LIMIT`。显式插件行配置优先。例:
|
|
50
|
+
默认只使用知乎的免费额度:每次请求前先查询官方额度,额度不足就不发送。另外每天(北京时间)最多 100 次请求。两项都可以在插件配置中修改:
|
|
115
51
|
|
|
116
52
|
```yaml
|
|
117
53
|
config:
|
|
118
54
|
allowPaid: false
|
|
119
|
-
dailyCallLimit:
|
|
55
|
+
dailyCallLimit: 100
|
|
120
56
|
```
|
|
121
57
|
|
|
122
|
-
|
|
58
|
+
只有你自己把 `allowPaid` 设为 `true` 才允许付费调用。
|
|
59
|
+
|
|
60
|
+
## 限制
|
|
61
|
+
|
|
62
|
+
- 不能保证绝对零费用:同一账号的其他客户端可能先用掉免费额度。
|
|
63
|
+
- 上传的文件保存在知乎云端,请勿上传未发表手稿;单个文件最大 20 MB。
|
|
64
|
+
- 所有请求都不会自动重试。
|
|
65
|
+
- 不提供 OAuth 账号切换、充值或钱包查询。
|
|
66
|
+
|
|
67
|
+
## 许可证
|
|
123
68
|
|
|
124
|
-
|
|
69
|
+
[SATA License 2.1](../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-zhihu",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Zhihu search, agent tools, knowledge bases, and usage tracking for DeepSeek Harness.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"zod": "^4.1.5",
|
|
99
|
-
"@klarkxy/dsh-plugin-kit": "0.3.
|
|
99
|
+
"@klarkxy/dsh-plugin-kit": "0.3.2"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@deepseek-ai/cordis": ">=4.0.4",
|
|
@@ -153,6 +153,6 @@
|
|
|
153
153
|
"registry": "https://registry.npmjs.org/"
|
|
154
154
|
},
|
|
155
155
|
"dshRelease": {
|
|
156
|
-
"contentHash": "
|
|
156
|
+
"contentHash": "0ddd6c9ac0199d03b64a853f453efbb3f5fac26b7d3fde4389764bc7b06e4d70"
|
|
157
157
|
}
|
|
158
158
|
}
|