@klarkxy/dsh-zhihu 0.1.1 → 0.1.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 +13 -40
- package/docs/README.zh-CN.md +35 -0
- package/package.json +3 -3
- package/README.zh-CN.md +0 -47
package/README.md
CHANGED
|
@@ -1,62 +1,35 @@
|
|
|
1
1
|
# @klarkxy/dsh-zhihu
|
|
2
2
|
|
|
3
|
-
Zhihu search,
|
|
3
|
+
Zhihu search, answers, knowledge bases, and usage tracking for DSH.
|
|
4
4
|
|
|
5
|
-
[简体中文](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/README.zh-CN.md)
|
|
5
|
+
[简体中文](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/docs/README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
## Install
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
Requires Node.js 22
|
|
9
|
+
Requires Node.js ≥22 and DSH `0.1.5-rc.2`. No repository build is needed.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Restart
|
|
15
|
+
Restart DSH Web, open **Zhihu resources**, and enter your Access Secret (DSH credential `ZHIHU_ACCESS_TOKEN`). Use the full scoped name; the unscoped `dsh-zhihu` package belongs to another maintainer.
|
|
16
16
|
|
|
17
|
-
To
|
|
17
|
+
To enable agent tools, add this entry to the plugin list in the agent's `agent.cordis.yml`:
|
|
18
18
|
|
|
19
19
|
```yaml
|
|
20
20
|
- name: '@klarkxy/dsh-zhihu/tools'
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Use
|
|
23
|
+
## Use
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
DSH Web provides search, settings, usage, and knowledge-base views. In DSH Editor, open **Settings → Zhihu resources** for configuration, usage, knowledge bases, and a connection test; the agent tools are included.
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
- **DSH Editor desktop:** **Settings → Zhihu resources (知乎资料)** provides configuration, usage, knowledge bases, and a connection test.
|
|
29
|
-
- **Host service:** `zhihu`, exposed through `/zhihu`.
|
|
30
|
-
- **Agent tools:** the optional `@klarkxy/dsh-zhihu/tools` entry.
|
|
27
|
+
Search covers Zhihu, the wider web, trending topics, answers, and public knowledge bases. Uploaded reference files are stored in Zhihu's cloud; do not upload unpublished manuscripts.
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
Installing [@klarkxy/dsh-web-search-manager](https://www.npmjs.com/package/@klarkxy/dsh-web-search-manager) in the same profile adds **Zhihu global search** to its provider list. Enable it there to use standard web search with the same Access Secret. The dedicated Zhihu tools work independently.
|
|
33
30
|
|
|
34
|
-
##
|
|
31
|
+
## Development
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
Read [contracts](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/src/contracts.ts) and [tools](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/src/tools.ts) for the API.
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- `zhihu_search`
|
|
41
|
-
- `zhihu_global_search`
|
|
42
|
-
- `zhihu_hot_list`
|
|
43
|
-
- `zhihu_ask`
|
|
44
|
-
- `zhihu_knowledge_search`
|
|
45
|
-
|
|
46
|
-
The UI and tools share usage accounting in `dsh_editor_zhihu_usage`. The Web client uses the host UI contracts without importing private Shell packages.
|
|
47
|
-
|
|
48
|
-
## Integration with web search
|
|
49
|
-
|
|
50
|
-
When the same profile provides `webSearchManager` through [@klarkxy/dsh-web-search-manager](https://www.npmjs.com/package/@klarkxy/dsh-web-search-manager), this plugin also registers a `zhihu-global` search backend. It shares `ZHIHU_ACCESS_TOKEN` with the Zhihu settings and is available through the standard `web_search` tool when enabled in the manager.
|
|
51
|
-
|
|
52
|
-
The integration is optional: without the manager, no backend is registered and no extra dependency is required. The dedicated `zhihu_global_search` tool remains available independently.
|
|
53
|
-
|
|
54
|
-
## Documentation
|
|
55
|
-
|
|
56
|
-
The following repository guides are in Chinese:
|
|
57
|
-
|
|
58
|
-
- [User guide](https://github.com/klarkxy/dsh-editor/blob/main/docs/user-guide.md)
|
|
59
|
-
- [Product principles](https://github.com/klarkxy/dsh-editor/blob/main/docs/product-principles.md)
|
|
60
|
-
- [Plugin publishing and marketplace discovery](https://github.com/klarkxy/dsh-editor/blob/main/docs/plugin-distribution.md)
|
|
61
|
-
|
|
62
|
-
See [LICENSE](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/LICENSE) for the package license.
|
|
35
|
+
[Publishing](https://github.com/klarkxy/dsh-editor/blob/main/packages/PUBLISHING.md) · [License](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/LICENSE)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @klarkxy/dsh-zhihu
|
|
2
|
+
|
|
3
|
+
DSH 知乎搜索、直答、知识库与用量插件。
|
|
4
|
+
|
|
5
|
+
[English](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/README.md)
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
需要 Node.js ≥22、DSH `0.1.5-rc.2`,无需构建本仓库。
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
重启 DSH Web,打开「知乎资料」填写 Access Secret(DSH 凭据 `ZHIHU_ACCESS_TOKEN`)。请使用完整 scoped 包名;无 scope 的 `dsh-zhihu` 属于其他维护者。
|
|
16
|
+
|
|
17
|
+
模型需要使用知乎工具时,在所用 `agent.cordis.yml` 的插件列表加入:
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
- name: '@klarkxy/dsh-zhihu/tools'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 使用
|
|
24
|
+
|
|
25
|
+
DSH Web 提供搜索、设置、用量与知识库视图。DSH Editor 在「设置 → 知乎资料」配置、查看用量、管理知识库和测试连接,已内置模型工具。
|
|
26
|
+
|
|
27
|
+
可查询站内、全网、热榜、直答和公开知识库。上传的参考文件保存在知乎云端,请勿上传未发表手稿。
|
|
28
|
+
|
|
29
|
+
同一 profile 安装 [@klarkxy/dsh-web-search-manager](https://www.npmjs.com/package/@klarkxy/dsh-web-search-manager) 后,可在网络搜索的后端列表开启「知乎全网搜索」,共用 Access Secret。专用知乎工具仍可独立使用。
|
|
30
|
+
|
|
31
|
+
## 开发
|
|
32
|
+
|
|
33
|
+
接口见 [contracts](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/src/contracts.ts) 与 [tools](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/src/tools.ts)。
|
|
34
|
+
|
|
35
|
+
[发布维护](https://github.com/klarkxy/dsh-editor/blob/main/packages/PUBLISHING.md) · [许可证](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-zhihu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Independent Zhihu services, tools and UI for DSH",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"lib/*.d.ts",
|
|
42
42
|
"cordis.patch.yml",
|
|
43
43
|
"README.md",
|
|
44
|
-
"README.zh-CN.md",
|
|
44
|
+
"docs/README.zh-CN.md",
|
|
45
45
|
"LICENSE"
|
|
46
46
|
],
|
|
47
47
|
"dsh": {
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"registry": "https://registry.npmjs.org/"
|
|
127
127
|
},
|
|
128
128
|
"dshRelease": {
|
|
129
|
-
"contentHash": "sha256-
|
|
129
|
+
"contentHash": "sha256-44f4605c6a872ba2107bfccaeb2e273a0261f9de19ae634c5bec9dfda64cc740"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"build": "tsdown && node ../../scripts/wrap-client.mjs @klarkxy/dsh-zhihu",
|
package/README.zh-CN.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# @klarkxy/dsh-zhihu
|
|
2
|
-
|
|
3
|
-
[English](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/README.md)
|
|
4
|
-
|
|
5
|
-
独立知乎资料插件。普通 RPC 与可选 Tool 入口分开,可单独使用。包版本独立维护;兼容 DSH `0.1.5-rc.2`。凭据:DSH `ZHIHU_ACCESS_TOKEN`。
|
|
6
|
-
|
|
7
|
-
## 安装到 DSH Web
|
|
8
|
-
|
|
9
|
-
需要 Node.js 22 或更高版本,以及 DSH `0.1.5-rc.2` 的 Web profile。
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
安装后重启 `dsh web`,打开「知乎资料」并配置 `ZHIHU_ACCESS_TOKEN`。模型需要知乎工具时,在所用 `agent.cordis.yml` 的插件列表中加入:
|
|
16
|
-
|
|
17
|
-
```yaml
|
|
18
|
-
- name: '@klarkxy/dsh-zhihu/tools'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
npm 上无 scope 的 `dsh-zhihu` 属于其他维护者,请使用完整的 `@klarkxy/dsh-zhihu` 包名。此包已经编译,安装时无需构建本仓库。
|
|
22
|
-
|
|
23
|
-
## 入口
|
|
24
|
-
|
|
25
|
-
- Host `zhihu`(feature `zhihu`):`/zhihu`(`src/index.ts`)
|
|
26
|
-
- 官方 Web:`shell.overlay`(id `zhihu`,搜索 / 设置 / 用量 / 知识库)
|
|
27
|
-
- 桌面:`dsh-editor.settings.zhihu` 嵌入设置「知乎资料」(配置 / 用量 / 知识库 / 连接测试),桌面上只有这一个入口(`src/client.ts`)
|
|
28
|
-
- `zhihu-tools`(feature `zhihu-tools`,`dshEditor.inserts`):桌面组合自动加入;工具名未改
|
|
29
|
-
|
|
30
|
-
桌面 canonical recipe `desktop` 启用 `zhihu` + `zhihu-tools`;`basic` / `smart` / `full` 别名解析同一集合。
|
|
31
|
-
|
|
32
|
-
## 契约
|
|
33
|
-
|
|
34
|
-
`/zhihu`:`search`、`global.search`、`hot.list`、`ask`、`knowledge.search`、`knowledge.bases`、`knowledge.upload`、`usage.summary`。工具:`zhihu_search`、`zhihu_global_search`、`zhihu_hot_list`、`zhihu_ask`、`zhihu_knowledge_search`(`src/tools.ts`)。UI 与 Tool 共用计量 `dsh_editor_zhihu_usage`。Client 用结构型 `Select` / `Dialog`,不导入私有 Shell 包(`src/client-host-ui.ts`)。
|
|
35
|
-
|
|
36
|
-
若当前 profile 已经提供 `webSearchManager`(安装了 `@klarkxy/dsh-web-search-manager`),Host 还会把知乎全网搜索注册为网络搜索后端(id `zhihu-global`),与「知乎资料」共用 `ZHIHU_ACCESS_TOKEN`。未安装管理插件时不注册,也不额外增加依赖。模型侧仍走官方 `web_search`;专用 `zhihu_global_search` 工具不受影响。
|
|
37
|
-
|
|
38
|
-
在不含空格的目录放置 tarball 后执行:
|
|
39
|
-
|
|
40
|
-
```powershell
|
|
41
|
-
$packagePath = (Resolve-Path .\klarkxy-dsh-zhihu-0.1.0.tgz).Path.Replace('\', '/')
|
|
42
|
-
dsh plugin --profile web add "file:$packagePath" # klarkxy-dsh-zhihu-0.1.0.tgz
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## 文档
|
|
46
|
-
|
|
47
|
-
[使用者指南](https://github.com/klarkxy/dsh-editor/blob/main/docs/user-guide.md) · [产品原则](https://github.com/klarkxy/dsh-editor/blob/main/docs/product-principles.md) · [插件发布与发现](https://github.com/klarkxy/dsh-editor/blob/main/docs/plugin-distribution.md)
|