@klarkxy/dsh-zhihu 0.1.2 → 0.1.4

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 CHANGED
@@ -1,62 +1,35 @@
1
1
  # @klarkxy/dsh-zhihu
2
2
 
3
- Zhihu search, knowledge-base access, usage tracking, and optional agent tools for DSH. The service and tool entry points can be used separately.
3
+ Zhihu search, answers, knowledge bases, and usage tracking for DSH.
4
4
 
5
5
  [简体中文](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/docs/README.zh-CN.md)
6
6
 
7
- ## Install in DSH Web
7
+ ## Install
8
8
 
9
- Requires Node.js 22 or later and a DSH `0.1.5-rc.2` Web profile.
9
+ Requires Node.js 22 and DSH `0.1.7-alpha.1`. 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 `dsh web`, open **Zhihu resources (知乎资料)**, and configure the DSH credential `ZHIHU_ACCESS_TOKEN`.
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 make the Zhihu tools available to an agent, add this entry to the plugin list in its `agent.cordis.yml`:
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 the full scoped package name. The unscoped npm package `dsh-zhihu` belongs to another maintainer. This package includes compiled output; you do not need to clone or build this repository to install it. Its version is maintained independently of the DSH version.
23
+ ## Use
24
24
 
25
- ## Features and entry points
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
- - **DSH Web:** a `shell.overlay` entry with ID `zhihu`, containing search, settings, usage, and knowledge-base views.
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
- The desktop composition enables both the `zhihu` and `zhihu-tools` features. The `basic`, `smart`, and `full` recipe aliases resolve to the same desktop feature set.
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
- ## Service and tool API
31
+ ## Development
35
32
 
36
- The `/zhihu` RPC methods are `search`, `global.search`, `hot.list`, `ask`, `knowledge.search`, `knowledge.bases`, `knowledge.upload`, and `usage.summary`.
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
- The agent tools are:
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)
@@ -1,47 +1,35 @@
1
1
  # @klarkxy/dsh-zhihu
2
2
 
3
- [English](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/README.md)
3
+ DSH 知乎搜索、直答、知识库与用量插件。
4
4
 
5
- 独立知乎资料插件。普通 RPC 与可选 Tool 入口分开,可单独使用。包版本独立维护;兼容 DSH `0.1.5-rc.2`。凭据:DSH `ZHIHU_ACCESS_TOKEN`。
5
+ [English](https://github.com/klarkxy/dsh-editor/blob/main/packages/dsh-zhihu/README.md)
6
6
 
7
- ## 安装到 DSH Web
7
+ ## 安装
8
8
 
9
- 需要 Node.js 22 或更高版本,以及 DSH `0.1.5-rc.2` 的 Web profile。
9
+ 需要 Node.js 22DSH `0.1.7-alpha.1`,无需构建本仓库。
10
10
 
11
11
  ```sh
12
12
  dsh plugin --profile web add @klarkxy/dsh-zhihu
13
13
  ```
14
14
 
15
- 安装后重启 `dsh web`,打开「知乎资料」并配置 `ZHIHU_ACCESS_TOKEN`。模型需要知乎工具时,在所用 `agent.cordis.yml` 的插件列表中加入:
15
+ 重启 DSH Web,打开「知乎资料」填写 Access Secret(DSH 凭据 `ZHIHU_ACCESS_TOKEN`)。请使用完整 scoped 包名;无 scope 的 `dsh-zhihu` 属于其他维护者。
16
+
17
+ 模型需要使用知乎工具时,在所用 `agent.cordis.yml` 的插件列表加入:
16
18
 
17
19
  ```yaml
18
20
  - name: '@klarkxy/dsh-zhihu/tools'
19
21
  ```
20
22
 
21
- npm 上无 scope 的 `dsh-zhihu` 属于其他维护者,请使用完整的 `@klarkxy/dsh-zhihu` 包名。此包已经编译,安装时无需构建本仓库。
22
-
23
- ## 入口
23
+ ## 使用
24
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`):桌面组合自动加入;工具名未改
25
+ DSH Web 提供搜索、设置、用量与知识库视图。DSH Editor 在「设置 → 知乎资料」配置、查看用量、管理知识库和测试连接,已内置模型工具。
29
26
 
30
- 桌面 canonical recipe `desktop` 启用 `zhihu` + `zhihu-tools`;`basic` / `smart` / `full` 别名解析同一集合。
27
+ 可查询站内、全网、热榜、直答和公开知识库。上传的参考文件保存在知乎云端,请勿上传未发表手稿。
31
28
 
32
- ## 契约
29
+ 同一 profile 安装 [@klarkxy/dsh-web-search-manager](https://www.npmjs.com/package/@klarkxy/dsh-web-search-manager) 后,可在网络搜索的后端列表开启「知乎全网搜索」,共用 Access Secret。专用知乎工具仍可独立使用。
33
30
 
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
- ```
31
+ ## 开发
44
32
 
45
- ## 文档
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)。
46
34
 
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)
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.2",
3
+ "version": "0.1.4",
4
4
  "description": "Independent Zhihu services, tools and UI for DSH",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -83,18 +83,18 @@
83
83
  ]
84
84
  },
85
85
  "dependencies": {
86
- "@deepseek-ai/dsh-storage-domain": "0.1.5-rc.2",
86
+ "@deepseek-ai/dsh-storage-domain": "0.1.7-alpha.1",
87
87
  "zod": "^4.1.5"
88
88
  },
89
89
  "peerDependencies": {
90
- "@deepseek-ai/cordis": "^4.0.2",
91
- "@deepseek-ai/dsh-credentials": "0.1.5-rc.2",
92
- "@deepseek-ai/dsh-tools": ">=0.1.5-rc.2 <0.2.0"
90
+ "@deepseek-ai/cordis": "^4.0.3",
91
+ "@deepseek-ai/dsh-credentials": "0.1.7-alpha.1",
92
+ "@deepseek-ai/dsh-tools": ">=0.1.7-alpha.1 <0.2.0"
93
93
  },
94
94
  "devDependencies": {
95
- "@deepseek-ai/cordis": "^4.0.2",
96
- "@deepseek-ai/dsh-credentials": "0.1.5-rc.2",
97
- "@deepseek-ai/dsh-tools": "0.1.5-rc.2",
95
+ "@deepseek-ai/cordis": "^4.0.3",
96
+ "@deepseek-ai/dsh-credentials": "0.1.7-alpha.1",
97
+ "@deepseek-ai/dsh-tools": "0.1.7-alpha.1",
98
98
  "react": "^18.2.0",
99
99
  "@types/react": "18.3.31",
100
100
  "dsh-editor-seats": "0.1.0"
@@ -126,7 +126,7 @@
126
126
  "registry": "https://registry.npmjs.org/"
127
127
  },
128
128
  "dshRelease": {
129
- "contentHash": "sha256-8e2766613495fa6345f0e52458239ae27133d24ebe1e916946572fb66a74fe02"
129
+ "contentHash": "sha256-f66b81b022d7f5b2851517c19b4e1ba77671e96531ffaf00141bedf9dfc1b3d3"
130
130
  },
131
131
  "scripts": {
132
132
  "build": "tsdown && node ../../scripts/wrap-client.mjs @klarkxy/dsh-zhihu",